Skip to content

Commit

Permalink
Merge pull request #1 from Nordegraf/add-its-truly-random-achievement
Browse files Browse the repository at this point in the history
Add its truly random achievement
  • Loading branch information
ckawell-sb authored Dec 16, 2021
2 parents 337383b + 2a00d50 commit 9c570b8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dScripts/LegoDieRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,20 @@ 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<MissionComponent>();

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;
Expand Down

0 comments on commit 9c570b8

Please sign in to comment.