From b05c41fe8fbd988d077beb2c0f4c44abe306947d Mon Sep 17 00:00:00 2001 From: Niklas Conen Date: Thu, 16 Dec 2021 00:30:46 +0100 Subject: [PATCH 1/2] added tracking of the It's Truly Random achievement --- dScripts/LegoDieRoll.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dScripts/LegoDieRoll.cpp b/dScripts/LegoDieRoll.cpp index 20d4ca33..564c190a 100644 --- a/dScripts/LegoDieRoll.cpp +++ b/dScripts/LegoDieRoll.cpp @@ -33,8 +33,22 @@ void LegoDieRoll::OnTimerDone(Entity* self, std::string timerName) { GameMessages::SendPlayAnimation(self, u"roll-die-5"); break; case 6: + { GameMessages::SendPlayAnimation(self, u"roll-die-6"); + // tracking the It's Truly Random Achievement + auto* owner = self->GetOwner(); + auto* missionComponent = owner->GetComponent(); + + if (missionComponent != nullptr) + { + const auto rollMissionState = missionComponent->GetMissionState(756); + if (rollMissionState == MissionState::MISSION_STATE_ACTIVE) + { + missionComponent->ForceProgress(756, 1103, 1); + } + } break; + } default: Game::logger->LogDebug("LegoDieRoll", "Invalid animation: roll-die-%i\n", dieRoll); break; From 2a00d50672a219294b19628f7a88dc5e143593fd Mon Sep 17 00:00:00 2001 From: Niklas Conen Date: Thu, 16 Dec 2021 00:36:10 +0100 Subject: [PATCH 2/2] fixed formatting --- dScripts/LegoDieRoll.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dScripts/LegoDieRoll.cpp b/dScripts/LegoDieRoll.cpp index 564c190a..4b375a38 100644 --- a/dScripts/LegoDieRoll.cpp +++ b/dScripts/LegoDieRoll.cpp @@ -39,11 +39,9 @@ void LegoDieRoll::OnTimerDone(Entity* self, std::string timerName) { auto* owner = self->GetOwner(); auto* missionComponent = owner->GetComponent(); - if (missionComponent != nullptr) - { + if (missionComponent != nullptr) { const auto rollMissionState = missionComponent->GetMissionState(756); - if (rollMissionState == MissionState::MISSION_STATE_ACTIVE) - { + if (rollMissionState == MissionState::MISSION_STATE_ACTIVE) { missionComponent->ForceProgress(756, 1103, 1); } }