Stomping Tantrum

Uses timer in gBattleStruct to count time since last failed move. This is augmented by a MOVE_FAILED result in atk_49 and decreased with an ENDTURN case. EFFECT_STOMPING_TANTRUM doubles  base power if the timer is set.
This commit is contained in:
Papa Cancer 2019-04-01 15:28:17 +01:00
parent 83936185be
commit c9ad96d228
7 changed files with 37 additions and 21 deletions

View file

@ -345,6 +345,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectPartingShot
.4byte BattleScript_EffectSpectralThief
.4byte BattleScript_EffectVCreate
.4byte BattleScript_EffectStompingTantrum
BattleScript_EffectVCreate:
setmoveeffect MOVE_EFFECT_V_CREATE | MOVE_EFFECT_AFFECTS_USER
@ -1721,6 +1722,7 @@ BattleScript_EffectPlaceholder:
printstring STRINGID_NOTDONEYET
goto BattleScript_MoveEnd
BattleScript_EffectStompingTantrum:
BattleScript_EffectEvasionDownHit:
BattleScript_EffectVitalThrow:
BattleScript_EffectFalseSwipe:

View file

@ -576,6 +576,7 @@ struct BattleStruct
u8 introState;
u8 ateBerry[2]; // array id determined by side, each party pokemon as bit
u8 stolenStats[NUM_BATTLE_STATS]; // hp byte is used for which stats to raise, other inform about by how many stages
u8 lastMoveFailed; // as bits for each battler, for the sake of Stomping Tantrum
};
#define GET_MOVE_TYPE(move, typeArg) \

View file

@ -333,5 +333,6 @@
#define EFFECT_PARTING_SHOT 327
#define EFFECT_SPECTRAL_THIEF 328
#define EFFECT_V_CREATE 329
#define EFFECT_STOMPING_TANTRUM 330
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View file

@ -162,26 +162,27 @@
#define ATK48_DONT_CHECK_LOWER 0x8
// atk49, moveend cases
#define ATK49_SPIKY_SHIELD 0
#define ATK49_RAGE 1
#define ATK49_DEFROST 2
#define ATK49_SYNCHRONIZE_TARGET 3
#define ATK49_MOVE_END_ABILITIES 4
#define ATK49_STATUS_IMMUNITY_ABILITIES 5
#define ATK49_SYNCHRONIZE_ATTACKER 6
#define ATK49_CHOICE_MOVE 7
#define ATK49_CHANGED_ITEMS 8
#define ATK49_ATTACKER_INVISIBLE 9
#define ATK49_ATTACKER_VISIBLE 10
#define ATK49_TARGET_VISIBLE 11
#define ATK49_ITEM_EFFECTS_ALL 12
#define ATK49_KINGSROCK_SHELLBELL 13
#define ATK49_SUBSTITUTE 14
#define ATK49_UPDATE_LAST_MOVES 15
#define ATK49_MIRROR_MOVE 16
#define ATK49_NEXT_TARGET 17
#define ATK49_CLEAR_BITS 18
#define ATK49_COUNT 19
#define ATK49_FAILED_MOVE_COUNTER 0
#define ATK49_SPIKY_SHIELD 1
#define ATK49_RAGE 2
#define ATK49_DEFROST 3
#define ATK49_SYNCHRONIZE_TARGET 4
#define ATK49_MOVE_END_ABILITIES 5
#define ATK49_STATUS_IMMUNITY_ABILITIES 6
#define ATK49_SYNCHRONIZE_ATTACKER 7
#define ATK49_CHOICE_MOVE 8
#define ATK49_CHANGED_ITEMS 9
#define ATK49_ATTACKER_INVISIBLE 10
#define ATK49_ATTACKER_VISIBLE 11
#define ATK49_TARGET_VISIBLE 12
#define ATK49_ITEM_EFFECTS_ALL 13
#define ATK49_KINGSROCK_SHELLBELL 14
#define ATK49_SUBSTITUTE 15
#define ATK49_UPDATE_LAST_MOVES 16
#define ATK49_MIRROR_MOVE 17
#define ATK49_NEXT_TARGET 18
#define ATK49_CLEAR_BITS 19
#define ATK49_COUNT 20
#define BIT_HP 0x1
#define BIT_ATK 0x2

View file

@ -4198,6 +4198,13 @@ static void atk49_moveend(void)
{
switch (gBattleScripting.atk49_state)
{
case ATK49_FAILED_MOVE_COUNTER:
if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
gBattleStruct->lastMoveFailed |= gBitTable[gBattlerAttacker];
else
gBattleStruct->lastMoveFailed &= ~(gBitTable[gBattlerAttacker]);
gBattleScripting.atk49_state++;
break;
case ATK49_SPIKY_SHIELD:
if (gProtectStructs[gBattlerTarget].spikyShielded
&& gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT

View file

@ -5149,6 +5149,10 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
if (WEATHER_HAS_EFFECT && gBattleWeather & (WEATHER_HAIL_ANY | WEATHER_SANDSTORM_ANY | WEATHER_RAIN_ANY))
MulModifier(&modifier, UQ_4_12(0.5));
break;
case EFFECT_STOMPING_TANTRUM:
if (gBattleStruct->lastMoveFailed & gBitTable[battlerAtk])
MulModifier(&modifier, UQ_4_12(2.0));
break;
case EFFECT_BULLDOZE:
case EFFECT_MAGNITUDE:
case EFFECT_EARTHQUAKE:

View file

@ -9277,7 +9277,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_STOMPING_TANTRUM] =
{
.effect = EFFECT_PLACEHOLDER,
.effect = EFFECT_STOMPING_TANTRUM,
.power = 75,
.type = TYPE_GROUND,
.accuracy = 100,