From b05c41fe8fbd988d077beb2c0f4c44abe306947d Mon Sep 17 00:00:00 2001 From: Niklas Conen Date: Thu, 16 Dec 2021 00:30:46 +0100 Subject: [PATCH] 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;