Ally Switch, tbd

This commit is contained in:
DizzyEggg 2020-04-20 20:05:04 +02:00
parent 0f628c8ff2
commit 328e951afa
7 changed files with 29 additions and 1 deletions

View File

@ -1719,6 +1719,11 @@
.4byte \ptr
.endm
.macro jumpifnoally battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_NO_ALLY
.4byte \ptr
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7

View File

@ -263,6 +263,7 @@ AI_CheckBadMove_CheckEffect: @ 82DC045
if_effect EFFECT_FOLLOW_ME, AI_CBM_FollowMe
if_effect EFFECT_GEOMANCY, AI_CBM_QuiverDance
if_effect EFFECT_FAIRY_LOCK, AI_CBM_FairyLock
if_effect EFFECT_ALLY_SWITCH, AI_CBM_HelpingHand
end
AI_CBM_FairyLock:
@ -847,6 +848,7 @@ AI_CBM_WillOWisp: @ 82DC6B4
AI_CBM_HelpingHand: @ 82DC6E3
if_not_double_battle Score_Minus10
if_battler_absent AI_USER_PARTNER, Score_Minus10
end
AI_CBM_TrickAndKnockOff: @ 82DC6EB

View File

@ -362,6 +362,19 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectShoreUp
.4byte BattleScript_EffectGeomancy
.4byte BattleScript_EffectFairyLock
.4byte BattleScript_EffectAllySwitch
BattleScript_EffectAllySwitch:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
jumpifnoally BS_ATTACKER, BattleScript_ButItFailed
attackanimation
waitanimation
printstring STRINGID_ALLYSWITCHPOSITION
waitmessage 0x40
goto BattleScript_MoveEnd
BattleScript_EffectFairyLock:
attackcanceler

View File

@ -350,5 +350,6 @@
#define EFFECT_SHORE_UP 344
#define EFFECT_GEOMANCY 345
#define EFFECT_FAIRY_LOCK 346
#define EFFECT_ALLY_SWITCH 347
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -155,6 +155,7 @@
#define VARIOUS_TRY_FRISK 92
#define VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED 93
#define VARIOUS_TRY_FAIRY_LOCK 94
#define VARIOUS_JUMP_IF_NO_ALLY 95
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -6827,6 +6827,12 @@ static void Cmd_various(void)
else
gBattlescriptCurrInstr += 7;
return;
case VARIOUS_JUMP_IF_NO_ALLY:
if (!IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)))
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
else
gBattlescriptCurrInstr += 7;
return;
case VARIOUS_TRY_FAIRY_LOCK:
if (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK)
{

View File

@ -7041,7 +7041,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_ALLY_SWITCH] =
{
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
.effect = EFFECT_ALLY_SWITCH,
.power = 0,
.type = TYPE_PSYCHIC,
.accuracy = 0,