Skip to content

Commit

Permalink
fixes (fp crash, flower saver double dip, bombette destroying hammer …
Browse files Browse the repository at this point in the history
…blocks) (#28)
  • Loading branch information
bates64 authored Jan 25, 2024
2 parents 8c73b5f + c9a569d commit 18a4a52
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/23680.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ void spawn_drops(Enemy* enemy) {

dropCount = 0;
itemToDrop = ITEM_NONE;
fraction = playerData->curFP / (f32) playerData->curMaxFP;

if (playerData->curMaxFP > 0) {
fraction = playerData->curFP / (f32) playerData->curMaxFP;
} else {
fraction = 0.0;
}

for (i = 0; i < 8; i++) {
attempts = drops->flowerDrops[4 * i + 0];
Expand Down
7 changes: 6 additions & 1 deletion src/battle/btl_states_menus.c
Original file line number Diff line number Diff line change
Expand Up @@ -2539,10 +2539,15 @@ void btl_state_update_player_menu(void) {
s32 moveID = gItemTable[playerData->equippedBadges[i]].moveID;
moveData = &gMoveTable[moveID];
if (moveData->category == BattleMenu_CategoryForSubmenu[battleStatus->curSubmenu]) {
s32 cost = moveData->costFP;
battleStatus->submenuMoves[entryIdx] = moveID;
battleStatus->submenuIcons[entryIdx] = playerData->equippedBadges[i];
battleStatus->submenuStatus[entryIdx] = 1;
if (playerData->curFP < moveData->costFP) {

cost -= player_team_is_ability_active(playerActor, ABILITY_FLOWER_SAVER);
cost -= 2 * player_team_is_ability_active(playerActor, ABILITY_FLOWER_FANATIC);

if (playerData->curFP < cost) {
battleStatus->submenuStatus[entryIdx] = 0;
}
entryIdx++;
Expand Down
11 changes: 11 additions & 0 deletions src/entity/Block.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,18 @@ s32 entity_block_handle_collision(Entity* entity) {
}
return TRUE;
}

if (entity->collisionFlags & ENTITY_COLLISION_PARTNER) {
// partner collision means either kooper shell toss or bombette explosion
if (gPlayerData.curPartner == PARTNER_BOMBETTE) {
switch (get_entity_type(entity->listIndex)) {
case ENTITY_TYPE_HAMMER1_BLOCK:
case ENTITY_TYPE_HAMMER1_BLOCK_TINY:
set_entity_commandlist(entity, Entity_BreakingBlock_Script);
sfx_play_sound_at_position(SOUND_SMASH_HAMER_BLOCK_1, SOUND_SPACE_DEFAULT, entity->pos.x, entity->pos.y, entity->pos.z);
return TRUE;
}
}
exec_entity_commandlist(entity);
return TRUE;
}
Expand Down

0 comments on commit 18a4a52

Please sign in to comment.