Skip to content

Commit

Permalink
More Fling tweaks
Browse files Browse the repository at this point in the history
-Added a battle string stating the item that is thrown at the target just like in the official games
-curemovebindingeffects->curecertainstatuses
-Made curecertainstatuses heal the specific statuses it's supposed to

To do:
-Find out why does the waitmessage in BattleScript_FlingMentalHerb not work
-Test the following statuses affected by curecertainstatuses: Encore, Disable
  • Loading branch information
LOuroboros committed Dec 20, 2020
1 parent b27f451 commit 84c02a0
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 11 deletions.
4 changes: 2 additions & 2 deletions asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1767,8 +1767,8 @@
.4byte \ptr
.endm
.macro curemovebindingeffects battler:req
various \battler, VARIOUS_CURE_MOVE_BINDING_EFFECTS
.macro curecertainstatuses battler:req
various \battler, VARIOUS_CURE_CERTAIN_STATUSES
.endm
@ helpful macros
Expand Down
9 changes: 6 additions & 3 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ BattleScript_EffectFling:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
pause 0x20
setlastuseditem BS_ATTACKER
printstring STRINGID_PKMNFLUNG
waitmessage 0x20
ppreduce
critcalc
damagecalc
Expand Down Expand Up @@ -416,9 +420,8 @@ BattleScript_FlingParalyze:
seteffectprimary
goto BattleScript_FlingEnd
BattleScript_FlingMentalHerb:
curemovebindingeffects BS_TARGET
printstring STRINGID_TARGETGOTOVERINFATUATION
waitmessage 0x40
curecertainstatuses BS_TARGET
waitmessage 0x40 @ This doesn't seem to have any effect on the STRINGID_BUFFERENDS printed by curecertainstatuses. Idk why.
goto BattleScript_FlingEnd
BattleScript_FlingPoisonPoisonBarb:
setmoveeffect MOVE_EFFECT_POISON
Expand Down
2 changes: 1 addition & 1 deletion include/constants/battle_script_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
#define VARIOUS_JUMP_IF_ABSENT 101
#define VARIOUS_JUMP_IF_FLING_FAILS 102
#define VARIOUS_JUMP_IF_HOLD_EFFECT 103
#define VARIOUS_CURE_MOVE_BINDING_EFFECTS 104
#define VARIOUS_CURE_CERTAIN_STATUSES 104

// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0
Expand Down
64 changes: 59 additions & 5 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -8316,11 +8316,65 @@ static void Cmd_various(void)
else
gBattlescriptCurrInstr += 8;
return;
case VARIOUS_CURE_MOVE_BINDING_EFFECTS:
gBattleMons[gActiveBattler].status2 = 0;
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status2);
MarkBattlerForControllerExec(gActiveBattler);
break;
case VARIOUS_CURE_CERTAIN_STATUSES:
if (gBattleMons[gActiveBattler].status2 & STATUS2_INFATUATION)
{
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_INFATUATION);
gBattleMons[gActiveBattler].status2 = 0;
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status2);
MarkBattlerForControllerExec(gActiveBattler);
PrepareStringBattle(STRINGID_TARGETGOTOVERINFATUATION, gActiveBattler);
gBattleCommunication[MSG_DISPLAY] = 1;
}
else if (gBattleMons[gActiveBattler].status2 & STATUS2_TORMENT)
{
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_TORMENT);
gBattleMons[gActiveBattler].status2 = 0;
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status2);
MarkBattlerForControllerExec(gActiveBattler);
// Swap gBattlerTarget and gBattlerAttacker so STRINGID_BUFFERENDS works correctly
gActiveBattler = gBattlerAttacker;
gBattlerAttacker = gBattlerTarget;
gBattlerTarget = gActiveBattler;
gHitMarker |= HITMARKER_SWAP_ATTACKER_TARGET;
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_TORMENT);
PrepareStringBattle(STRINGID_BUFFERENDS, gActiveBattler);
gBattleCommunication[MSG_DISPLAY] = 1;
// Swap gBattlerTarget and gBattlerAttacker back
if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET)
gHitMarker &= ~(HITMARKER_SWAP_ATTACKER_TARGET);
}
else if (gDisableStructs[gActiveBattler].tauntTimer != 0)
{
gDisableStructs[gActiveBattler].tauntTimer = 0;
// Swap gBattlerTarget and gBattlerAttacker so STRINGID_BUFFERENDS works correctly
gActiveBattler = gBattlerAttacker;
gBattlerAttacker = gBattlerTarget;
gBattlerTarget = gActiveBattler;
gHitMarker |= HITMARKER_SWAP_ATTACKER_TARGET;
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_TAUNT);
PrepareStringBattle(STRINGID_BUFFERENDS, gActiveBattler);
gBattleCommunication[MSG_DISPLAY] = 1;
// Swap gBattlerTarget and gBattlerAttacker back
if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET)
gHitMarker &= ~(HITMARKER_SWAP_ATTACKER_TARGET);
}
else if (gDisableStructs[gActiveBattler].encoreTimer)
{
gDisableStructs[gActiveBattler].encoredMove = 0;
gDisableStructs[gActiveBattler].encoreTimer = 0;
PrepareStringBattle(STRINGID_PKMNENCOREENDED, gActiveBattler);
gBattleCommunication[MSG_DISPLAY] = 1;
}
else if (gDisableStructs[gActiveBattler].disableTimer)
{
gDisableStructs[gActiveBattler].disabledMove = 0;
gActiveBattler = gActiveBattler;
PrepareStringBattle(STRINGID_PKMNMOVEDISABLEDNOMORE, gActiveBattler);
gBattleCommunication[MSG_DISPLAY] = 1;
}
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 7);
return;
}

gBattlescriptCurrInstr += 3;
Expand Down

0 comments on commit 84c02a0

Please sign in to comment.