Skip to content

Commit

Permalink
remove clamp on point swap, make random HP/FP only +/- 10
Browse files Browse the repository at this point in the history
  • Loading branch information
JCog committed Sep 23, 2024
1 parent 47b8bcd commit 42336b5
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/chaos_effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,16 +971,11 @@ static void unequipBadge(ChaosEffectData *effect) {
}

static void pointSwap(ChaosEffectData *effect) {
// intentionally allowing this to set values greater than max and HP to 0
// certain actions like pausing will enforce cap, but should be stable -- will change if proven otherwise
s8 curHpTemp = gPlayerData.curHP;
gPlayerData.curHP = gPlayerData.curFP;
gPlayerData.curFP = curHpTemp;
// intentionally allowing this to set your HP to 0, should be stable -- will change if proven otherwise
if (gPlayerData.curHP > gPlayerData.curMaxHP) {
gPlayerData.curHP = gPlayerData.curMaxHP;
}
if (gPlayerData.curFP > gPlayerData.curMaxFP) {
gPlayerData.curFP = gPlayerData.curMaxFP;
}
sfx_play_sound(SOUND_JUMP_COMBO_8);
chaosHpSoundPlayed = FALSE;
chaosFpSoundPlayed = FALSE;
Expand Down Expand Up @@ -1098,17 +1093,17 @@ static void hideModels(ChaosEffectData *effect) {

static void randomHp(ChaosEffectData *effect) {
s8 oldHp = gPlayerData.curHP;
while (gPlayerData.curHP == oldHp) {
gPlayerData.curHP = rand_int(gPlayerData.curMaxHP - 1) + 1;
while (gPlayerData.curHP == oldHp || gPlayerData.curHP > gPlayerData.curMaxHP || gPlayerData.curHP < 1) {
gPlayerData.curHP = oldHp + rand_int(20) - 10;
}
chaosHpSoundPlayed = FALSE;
chaosTimers[TIMER_HP_SOUND] = 20;
}

static void randomFp(ChaosEffectData *effect) {
s8 oldFp = gPlayerData.curFP;
while (gPlayerData.curFP == oldFp) {
gPlayerData.curFP = rand_int(gPlayerData.curMaxFP);
while (gPlayerData.curFP == oldFp || gPlayerData.curFP > gPlayerData.curMaxFP || gPlayerData.curFP < 0) {
gPlayerData.curFP = oldFp + rand_int(20) - 10;
}
chaosFpSoundPlayed = FALSE;
chaosTimers[TIMER_FP_SOUND] = 20;
Expand Down

0 comments on commit 42336b5

Please sign in to comment.