summaryrefslogtreecommitdiff
path: root/src/engine/Rulesets.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/Rulesets.cpp')
-rw-r--r--src/engine/Rulesets.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/engine/Rulesets.cpp b/src/engine/Rulesets.cpp
index acdbfde2a..23ea0a6cf 100644
--- a/src/engine/Rulesets.cpp
+++ b/src/engine/Rulesets.cpp
@@ -1,6 +1,8 @@
#include "Rulesets.h"
#include "objects/Thwomp.h"
#include "objects/Trophy.h"
+#include "objects/BombKart.h"
+#include "actors/Text.h"
extern "C" {
#include "code_800029B0.h"
@@ -29,7 +31,7 @@ void Rulesets::PostInit() {
for (auto object : gWorldInstance.Objects) {
if (OThwomp* thwomp = dynamic_cast<OThwomp*>(object)) {
gObjectList[thwomp->_objectIndex].unk_0D5 = OThwomp::States::JAILED; // Sets all the thwomp behaviour flags to marty
- thwomp->State = OThwomp::States::JAILED;
+ thwomp->Behaviour = OThwomp::States::JAILED;
}
}
}
@@ -37,12 +39,37 @@ void Rulesets::PostInit() {
if (CVarGetInteger("gAllBombKartsChase", false) == true) {
for (auto object : gWorldInstance.Objects) {
if (OBombKart* kart = dynamic_cast<OBombKart*>(object)) {
- kart->State = OBombKart::States::CHASE;
+ kart->Behaviour = OBombKart::States::CHASE;
}
}
}
if (CVarGetInteger("gGoFish", false) == true) {
- gWorldInstance.AddObject(new OTrophy(FVector(0,0,0), OTrophy::TrophyType::GOLD, OTrophy::Behaviour::GO_FISH));
+ OTrophy::Spawn(FVector(0,0,0), OTrophy::TrophyType::GOLD, OTrophy::Behaviour::GO_FISH);
+ }
+
+ if (CVarGetInteger("gPlayerNames", false) == true) {
+
+ std::string playerNames[NUM_PLAYERS] = {
+ "Player 1", "Player 2", "Player 3",
+ "Player 4", "Player 5", "Player 6",
+ "Player 7", "Player 8"
+ };
+
+ for (size_t i = 0; i < NUM_PLAYERS; i++) {
+ // text, pos, scale, mode, playerIndex
+ AText* text = AText::Spawn(playerNames[i], FVector(0, 0, 0), FVector(0.15f, 0.15f, 0.15f), AText::TextMode::FOLLOW_PLAYER, i);
+ text->ScaleX = 1.0f;
+ text->Scale.x = 0.15f;
+ text->Scale.y = 0.15f;
+ text->Scale.z = 0.15f;
+ text->Animate = false; // Cycle between colours similar to grand prix title text
+
+ // White
+ for (size_t j = 0; j < 4; j++) {
+ text->TextColour[j] = {255, 255, 255, 255};
+ }
+
+ }
}
}