From 745d0d2c68f97ab79c39dbf5ebb53ed48a91607d Mon Sep 17 00:00:00 2001 From: David Chavez Date: Fri, 12 Aug 2022 05:33:19 +0200 Subject: [PATCH] Remove z_play code --- soh/src/code/z_play.c | 146 ------------------------------------------ 1 file changed, 146 deletions(-) diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 02fb773df..5a176fd7d 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -1533,152 +1533,6 @@ u8 PlayerGrounded(Player* player) { return (player->actor.world.pos.y - player->actor.floorHeight) == 0; } -void RemoveEffect(const char* effectId) { - if (gGlobalCtx == NULL) { - return; - } - - Player* player = GET_PLAYER(gGlobalCtx); - - if (player != NULL) { - if (strcmp(effectId, "giant_link") == 0) { - giantLink = 0; - resetLinkScale = 1; - return; - } else if (strcmp(effectId, "minish_link") == 0) { - minishLink = 0; - resetLinkScale = 1; - } else if (strcmp(effectId, "defense_modifier") == 0) { - // defenseModifier = 0; - return; - } else if (strcmp(effectId, "iron_boots") == 0 || strcmp(effectId, "hover_boots") == 0) { - player->currentBoots = PLAYER_BOOTS_KOKIRI; - Inventory_ChangeEquipment(EQUIP_BOOTS, PLAYER_BOOTS_KOKIRI + 1); - Player_SetBootData(gGlobalCtx, player); - return; - } else if (strcmp(effectId, "high_gravity") == 0 || strcmp(effectId, "low_gravity") == 0) { - gravityLevel = 1; - return; - } else if (strcmp(effectId, "no_ui") == 0) { - // noUI = 0; - return; - } else if (strcmp(effectId, "invisible") == 0) { - invisibleLink = 0; - player->actor.shape.shadowDraw = ActorShadow_DrawFeet; - return; - } - } -} - -u8 ExecuteEffect(const char* effectId, uint32_t value) { - if (gGlobalCtx == NULL) { - return 0; - } - - Player* player = GET_PLAYER(gGlobalCtx); - - if (player != NULL) { - if (strcmp(effectId, "add_heart_container") == 0) { - if (gSaveContext.healthCapacity >= 0x140) { - return 2; - } - gSaveContext.healthCapacity += 0x10; - return 1; - } else if (strcmp(effectId, "remove_heart_container") == 0) { - if ((gSaveContext.healthCapacity - 0x10) <= 0) { - return 2; - } - gSaveContext.healthCapacity -= 0x10; - return 1; - } - } - - if (player != NULL && !Player_InBlockingCsMode(gGlobalCtx, player) && gGlobalCtx->pauseCtx.state == 0) { - if (strcmp(effectId, "high_gravity") == 0) { - gravityLevel = 2; - return 1; - } else if (strcmp(effectId, "low_gravity") == 0) { - gravityLevel = 0; - return 1; - } else if (strcmp(effectId, "giant_link") == 0) { - giantLink = 1; - return 1; - } else if (strcmp(effectId, "minish_link") == 0) { - minishLink = 1; - return 1; - } else if (strcmp(effectId, "defense_modifier") == 0) { - // defenseModifier = value; - return 1; - } else if (strcmp(effectId, "kill") == 0) { - if (PlayerGrounded(player)) { - gSaveContext.health = 0; - return 1; - } - return 0; - } else if (strcmp(effectId, "cucco") == 0) { - EnNiw* cucco = - (EnNiw*)Actor_Spawn(&gGlobalCtx->actorCtx, gGlobalCtx, ACTOR_EN_NIW, player->actor.world.pos.x, - player->actor.world.pos.y, player->actor.world.pos.z, 0, 0, 0, 0); - // cucco->actionFunc = func_80AB70A0; - return 1; - } else if (strcmp(effectId, "damage") == 0) { - Health_ChangeBy(gGlobalCtx, -value * 16); - func_80837C0C(gGlobalCtx, player, 0, 0, 0, 0, 0); - player->invincibilityTimer = 28; - return 1; - } else if (strcmp(effectId, "heal") == 0) { - Health_ChangeBy(gGlobalCtx, value * 16); - return 1; - } else if (strcmp(effectId, "freeze") == 0) { - if (PlayerGrounded(player)) { - func_80837C0C(gGlobalCtx, player, 3, 0, 0, 0, 0); - return 1; - } - return 0; - } else if (strcmp(effectId, "knockback") == 0) { - func_8002F71C(gGlobalCtx, &player->actor, value * 5, player->actor.world.rot.y + 0x8000, value * 5); - return 1; - } else if (strcmp(effectId, "burn") == 0) { - if (PlayerGrounded(player)) { - for (int i = 0; i < 18; i++) { - player->flameTimers[i] = Rand_S16Offset(0, 200); - } - player->isBurning = true; - func_80837C0C(gGlobalCtx, player, 0, 0, 0, 0, 0); - return 1; - } - return 0; - } else if (strcmp(effectId, "electrocute") == 0) { - if (PlayerGrounded(player)) { - func_80837C0C(gGlobalCtx, player, 4, 0, 0, 0, 0); - return 1; - } - return 0; - } else if (strcmp(effectId, "iron_boots") == 0) { - player->currentBoots = PLAYER_BOOTS_IRON; - Inventory_ChangeEquipment(EQUIP_BOOTS, PLAYER_BOOTS_IRON + 1); - Player_SetBootData(gGlobalCtx, player); - return 1; - } else if (strcmp(effectId, "hover_boots") == 0) { - player->currentBoots = PLAYER_BOOTS_HOVER; - Inventory_ChangeEquipment(EQUIP_BOOTS, PLAYER_BOOTS_HOVER + 1); - Player_SetBootData(gGlobalCtx, player); - return 1; - } else if (strcmp(effectId, "wallmaster") == 0) { - Actor_Spawn(&gGlobalCtx->actorCtx, gGlobalCtx, ACTOR_EN_WALLMAS, player->actor.world.pos.x, player->actor.world.pos.y, player->actor.world.pos.z, 0, 0, 0, 0); - return 1; - } else if (strcmp(effectId, "no_ui") == 0) { - // noUI = 1; - return 1; - } else if (strcmp(effectId, "invisible") == 0) { - invisibleLink = 1; - return 1; - } - } - - return 0; -} - // original name: "Game_play_demo_mode_check" s32 Gameplay_InCsMode(GlobalContext* globalCtx) { return (globalCtx->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(globalCtx);