mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
Implemented Wind Power's effect
This commit is contained in:
parent
c1e232cbf6
commit
88cae380d0
@ -6609,6 +6609,27 @@ BattleScript_WindRiderEnd:
|
||||
destroyabilitypopup
|
||||
end2
|
||||
|
||||
BattleScript_WindPowerActivatesEnd2::
|
||||
setbyte gBattlerAttacker, 0
|
||||
BattleScript_WindPowerLoop:
|
||||
printstring STRINGID_EMPTYSTRING3
|
||||
jumpifability BS_ATTACKER, ABILITY_WIND_POWER, BattleScript_WindPowerLoop_Cont
|
||||
goto BattleScript_WindPowerIncrement
|
||||
BattleScript_WindPowerLoop_Cont:
|
||||
jumpifstatus3 BS_ATTACKER, STATUS3_CHARGED_UP, BattleScript_WindPowerIncrement
|
||||
goto BattleScript_WindPower_Activate
|
||||
BattleScript_WindPower_Activate:
|
||||
call BattleScript_AbilityPopUp
|
||||
setcharge
|
||||
printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_WindPowerIncrement:
|
||||
addbyte gBattlerAttacker, 1
|
||||
jumpifbytenotequal gBattlerAttacker, gBattlersCount, BattleScript_WindPowerLoop
|
||||
BattleScript_WindPowerEnd:
|
||||
destroyabilitypopup
|
||||
end2
|
||||
|
||||
BattleScript_TrickRoomEnds::
|
||||
printstring STRINGID_TRICKROOMENDS
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
@ -7102,6 +7123,15 @@ BattleScript_AngerShellTrySpeed:
|
||||
BattleScript_AngerShellRet:
|
||||
return
|
||||
|
||||
BattleScript_WindPowerActivates::
|
||||
jumpifstatus3 BS_ATTACKER, STATUS3_CHARGED_UP, BattleScript_WindPowerActivates_Ret
|
||||
call BattleScript_AbilityPopUp
|
||||
setcharge
|
||||
printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_WindPowerActivates_Ret:
|
||||
return
|
||||
|
||||
BattleScript_PerishSongCountGoesDown::
|
||||
printstring STRINGID_PKMNPERISHCOUNTFELL
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
|
@ -438,6 +438,8 @@ extern const u8 BattleScript_AngerShellActivates[];
|
||||
extern const u8 BattleScript_WellBakedBodyActivates[];
|
||||
extern const u8 BattleScript_WindRiderActivatesEnd2[];
|
||||
extern const u8 BattleScript_WindRiderActivatesMoveEnd[];
|
||||
extern const u8 BattleScript_WindPowerActivates[];
|
||||
extern const u8 BattleScript_WindPowerActivatesEnd2[];
|
||||
|
||||
// zmoves
|
||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||
|
@ -630,8 +630,9 @@
|
||||
#define STRINGID_ATTACKERHEALEDITSBURN 628
|
||||
#define STRINGID_ATTACKERMELTEDTHEICE 629
|
||||
#define STRINGID_TARGETTOUGHEDITOUT 630
|
||||
#define STRINGID_BEINGHITCHARGEDPKMNWITHPOWER 631
|
||||
|
||||
#define BATTLESTRINGS_COUNT 631
|
||||
#define BATTLESTRINGS_COUNT 632
|
||||
|
||||
// This is the string id that gBattleStringsTable starts with.
|
||||
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
|
||||
|
@ -759,10 +759,11 @@ static const u8 sText_AttackerBrokeThroughParalysis[] = _("{B_ATK_NAME_WITH_PREF
|
||||
static const u8 sText_AttackerHealedItsBurn[] = _("{B_ATK_NAME_WITH_PREFIX} healed its burn with\nits sheer determination!");
|
||||
static const u8 sText_AttackerMeltedTheIce[] = _("{B_ATK_NAME_WITH_PREFIX} melted the ice with\nits fiery determination!");
|
||||
static const u8 sText_TargetToughedItOut[] = _("{B_DEF_NAME_WITH_PREFIX} toughed it out\nto show you its best side!");
|
||||
|
||||
static const u8 sText_BeingHitChargedPkmnWithPower[] = _("Being hit by {B_CURRENT_MOVE}\ncharged {B_ATK_NAME_WITH_PREFIX} with power!");
|
||||
|
||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
{
|
||||
[STRINGID_BEINGHITCHARGEDPKMNWITHPOWER - BATTLESTRINGS_TABLE_START] = sText_BeingHitChargedPkmnWithPower,
|
||||
[STRINGID_TARGETTOUGHEDITOUT - BATTLESTRINGS_TABLE_START] = sText_TargetToughedItOut,
|
||||
[STRINGID_ATTACKERMELTEDTHEICE - BATTLESTRINGS_TABLE_START] = sText_AttackerMeltedTheIce,
|
||||
[STRINGID_ATTACKERHEALEDITSBURN - BATTLESTRINGS_TABLE_START] = sText_AttackerHealedItsBurn,
|
||||
|
@ -2378,6 +2378,12 @@ u8 DoFieldEndTurnEffects(void)
|
||||
BattleScriptExecute(BattleScript_WindRiderActivatesEnd2);
|
||||
effect++;
|
||||
}
|
||||
if (IsAbilityOnSide(gActiveBattler, ABILITY_WIND_POWER))
|
||||
{
|
||||
gCurrentMove = MOVE_TAILWIND;
|
||||
BattleScriptExecute(BattleScript_WindPowerActivatesEnd2);
|
||||
effect++;
|
||||
}
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect != 0)
|
||||
@ -5777,6 +5783,19 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_WIND_POWER:
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||
&& TARGET_TURN_DAMAGED
|
||||
&& gBattleMoves[gCurrentMove].flags & FLAG_WIND_MOVE
|
||||
&& IsBattlerAlive(gBattlerTarget))
|
||||
{
|
||||
gBattlerAttacker = gBattlerTarget;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_WindPowerActivates;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ABILITYEFFECT_MOVE_END_ATTACKER: // Same as above, but for attacker
|
||||
|
Loading…
Reference in New Issue
Block a user