Power Herb

This commit is contained in:
DizzyEggg 2020-04-22 10:44:19 +02:00
parent 2de60b5562
commit c8ba013539
5 changed files with 35 additions and 8 deletions

View File

@ -1730,6 +1730,12 @@
.4byte \ptr
.endm
.macro jumpifnoholdeffect battler:req, holdEffet:req, ptr:req
various \battler, VARIOUS_JUMP_IF_NO_HOLD_EFFECT
.byte \holdEffet
.4byte \ptr
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7

View File

@ -4,6 +4,7 @@
#include "constants/battle_anim.h"
#include "constants/battle_string_ids.h"
#include "constants/abilities.h"
#include "constants/hold_effects.h"
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/game_stat.h"
@ -3048,6 +3049,13 @@ BattleScript_EffectSpecialDefenseDownHit2::
BattleScript_EffectAccuracyDownHit::
setmoveeffect MOVE_EFFECT_ACC_MINUS_1
goto BattleScript_EffectHit
BattleScript_PowerHerbActivation:
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_POWERHERB
waitmessage 0x40
removeitem BS_ATTACKER
return
BattleScript_EffectTwoTurnsAttack::
jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn
@ -3059,7 +3067,9 @@ BattleScript_EffectTwoTurnsAttack::
setbyte sTWOTURN_STRINGID, 0x0
BattleScript_EffectTwoTurnsAttackContinue:
call BattleScriptFirstChargingTurn
goto BattleScript_MoveEnd
jumpifnoholdeffect BS_ATTACKER, HOLD_EFFECT_POWER_HERB, BattleScript_MoveEnd
call BattleScript_PowerHerbActivation
goto BattleScript_TwoTurnMovesSecondTurn
BattleScript_EffectTwoTurnsAttackSkyAttack:
setbyte sTWOTURN_STRINGID, 0x3
goto BattleScript_EffectTwoTurnsAttackContinue
@ -3078,8 +3088,8 @@ BattleScript_EffectGeomancy:
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_GeomancySecondTurn
setbyte sTWOTURN_STRINGID, 0x9
call BattleScriptFirstChargingTurn
goto BattleScript_MoveEnd
jumpifnoholdeffect BS_ATTACKER, HOLD_EFFECT_POWER_HERB, BattleScript_MoveEnd
call BattleScript_PowerHerbActivation
BattleScript_GeomancySecondTurn:
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING
@ -3888,7 +3898,9 @@ BattleScript_EffectSkullBash::
printfromtable gStatUpStringIds
waitmessage 0x40
BattleScript_SkullBashEnd::
goto BattleScript_MoveEnd
jumpifnoholdeffect BS_ATTACKER, HOLD_EFFECT_POWER_HERB, BattleScript_MoveEnd
call BattleScript_PowerHerbActivation
goto BattleScript_TwoTurnMovesSecondTurn
BattleScript_EffectTwister:
BattleScript_FlinchEffect:
@ -3924,7 +3936,9 @@ BattleScript_SolarbeamDecideTurn::
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn
setbyte sTWOTURN_STRINGID, 0x1
call BattleScriptFirstChargingTurn
goto BattleScript_MoveEnd
jumpifnoholdeffect BS_ATTACKER, HOLD_EFFECT_POWER_HERB, BattleScript_MoveEnd
call BattleScript_PowerHerbActivation
goto BattleScript_TwoTurnMovesSecondTurn
BattleScript_SolarbeamOnFirstTurn::
orword gHitMarker, HITMARKER_CHARGING
setmoveeffect MOVE_EFFECT_CHARGING | MOVE_EFFECT_AFFECTS_USER
@ -4012,8 +4026,8 @@ BattleScript_FirstTurnFly::
BattleScript_FirstTurnSemiInvulnerable::
call BattleScriptFirstChargingTurn
setsemiinvulnerablebit
goto BattleScript_MoveEnd
jumpifnoholdeffect BS_ATTACKER, HOLD_EFFECT_POWER_HERB, BattleScript_MoveEnd
call BattleScript_PowerHerbActivation
BattleScript_SecondTurnSemiInvulnerable::
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING

View File

@ -157,6 +157,7 @@
#define VARIOUS_TRY_FAIRY_LOCK 94
#define VARIOUS_JUMP_IF_NO_ALLY 95
#define VARIOUS_HANDLE_TYPE_IMMUNITY 96
#define VARIOUS_JUMP_IF_NO_HOLD_EFFECT 97
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -6832,6 +6832,12 @@ static void Cmd_various(void)
else
gBattlescriptCurrInstr += 7;
return;
case VARIOUS_JUMP_IF_NO_HOLD_EFFECT:
if (GetBattlerHoldEffect(gActiveBattler, TRUE) != gBattlescriptCurrInstr[3])
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4);
else
gBattlescriptCurrInstr += 8;
return;
case VARIOUS_JUMP_IF_NO_ALLY:
if (!IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)))
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);

View File

@ -7296,7 +7296,7 @@ const struct BaseStats gBaseStats[] =
.growthRate = GROWTH_SLOW,
.eggGroup1 = EGG_GROUP_FLYING,
.eggGroup2 = EGG_GROUP_FLYING,
.abilities = {ABILITY_SCHOOLING, ABILITY_SCHOOLING},
.abilities = {ABILITY_STURDY, ABILITY_KEEN_EYE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_GRAY,
.noFlip = FALSE,