mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 22:03:36 -07:00
Remove z_play code
This commit is contained in:
parent
3b0b6539b9
commit
745d0d2c68
1 changed files with 0 additions and 146 deletions
|
@ -1533,152 +1533,6 @@ u8 PlayerGrounded(Player* player) {
|
||||||
return (player->actor.world.pos.y - player->actor.floorHeight) == 0;
|
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"
|
// original name: "Game_play_demo_mode_check"
|
||||||
s32 Gameplay_InCsMode(GlobalContext* globalCtx) {
|
s32 Gameplay_InCsMode(GlobalContext* globalCtx) {
|
||||||
return (globalCtx->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(globalCtx);
|
return (globalCtx->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(globalCtx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue