summaryrefslogtreecommitdiff
path: root/src/spawn_players.c
diff options
context:
space:
mode:
authorcoco875 <59367621+coco875@users.noreply.github.com>2024-09-11 00:35:46 +0200
committerGitHub <noreply@github.com>2024-09-10 16:35:46 -0600
commitabde6714be6d8d2cd552907b897589d6438d222c (patch)
tree93d766523f8d7874801572e9d7d015e409f0ad1a /src/spawn_players.c
parentb7bc19cf9d53550e7280eb476afe5f16a5b10c9d (diff)
[Cheat] custom cc (#71)
* custom cc * Update ImguiUI.cpp --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/spawn_players.c')
-rw-r--r--src/spawn_players.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/spawn_players.c b/src/spawn_players.c
index aceb9e157..af103b653 100644
--- a/src/spawn_players.c
+++ b/src/spawn_players.c
@@ -111,6 +111,25 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC
player->topSpeed = gTopSpeedTable[CC_BATTLE][player->characterId];
break;
}
+ if (CVarGetInteger("gEnableCustomCC", 0) == 1) {
+#define calc_a(x, y, x2, y2) (y2 - y) / (x2 - x)
+#define calc_b(x, y, b) y - (b * x)
+ f32 a;
+ f32 b;
+
+#define calc(table, field) \
+ a = calc_a(50, table[CC_50][player->characterId], 150, table[CC_150][player->characterId]); \
+ b = calc_b(50, table[CC_50][player->characterId], a); \
+ player->field = a * CVarGetFloat("gCustomCC", 150.0f) + b;
+
+ calc(gTopSpeedTable, topSpeed);
+ calc(D_800E2400, unk_084);
+ calc(D_800E24B4, unk_088);
+ calc(D_800E2568, unk_210);
+#undef calc_a
+#undef calc_b
+#undef calc
+ }
player->pos[0] = startingRow;
ret = spawn_actor_on_surface(startingRow, arg4 + 50.0f, startingColumn) + player->boundingBoxSize;