mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
Adds Mortal Spin and Population Bomb
This commit is contained in:
parent
ad78dfcf68
commit
bca29d8586
@ -435,6 +435,17 @@ gBattleScriptsForMoveEffects::
|
||||
.4byte BattleScript_EffectHit @ EFFECT_COLLISION_COURSE
|
||||
.4byte BattleScript_EffectSpinOut @ EFFECT_SPIN_OUT
|
||||
.4byte BattleScript_EffectMakeItRain @ EFFECT_MAKE_IT_RAIN
|
||||
.4byte BattleScript_EffectHit @ EFFECT_POPULATION_BOMB
|
||||
.4byte BattleScript_EffectMortalSpin @ EFFECT_MORTAL_SPIN
|
||||
|
||||
BattleScript_EffectMortalSpin:
|
||||
call BattleScript_EffectHit_Ret
|
||||
rapidspinfree
|
||||
setmoveeffect MOVE_EFFECT_POISON
|
||||
seteffectwithchance
|
||||
tryfaintmon BS_TARGET
|
||||
moveendall
|
||||
end
|
||||
|
||||
BattleScript_EffectMakeItRain:
|
||||
setmoveeffect MOVE_EFFECT_PAYDAY
|
||||
|
@ -412,7 +412,9 @@
|
||||
#define EFFECT_COLLISION_COURSE 406
|
||||
#define EFFECT_SPIN_OUT 407
|
||||
#define EFFECT_MAKE_IT_RAIN 408
|
||||
#define EFFECT_POPULATION_BOMB 409
|
||||
#define EFFECT_MORTAL_SPIN 410
|
||||
|
||||
#define NUM_BATTLE_MOVE_EFFECTS 409
|
||||
#define NUM_BATTLE_MOVE_EFFECTS 411
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||
|
@ -3571,6 +3571,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
case EFFECT_TOXIC:
|
||||
case EFFECT_POISON:
|
||||
case EFFECT_BARB_BARRAGE:
|
||||
case EFFECT_MORTAL_SPIN:
|
||||
IncreasePoisonScore(battlerAtk, battlerDef, move, &score);
|
||||
break;
|
||||
case EFFECT_LIGHT_SCREEN:
|
||||
@ -4246,6 +4247,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
}
|
||||
break;
|
||||
case MOVE_RAPID_SPIN:
|
||||
case MOVE_MORTAL_SPIN:
|
||||
if (gStatuses3[battlerAtk] & STATUS3_LEECHSEED || gBattleMons[battlerAtk].status2 & STATUS2_WRAPPED)
|
||||
score += 3;
|
||||
break;
|
||||
|
@ -865,7 +865,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness,
|
||||
}
|
||||
|
||||
// Handle other multi-strike moves
|
||||
if (gBattleMoves[move].strikeCount > 1)
|
||||
if (gBattleMoves[move].strikeCount > 1 && gBattleMoves[move].effect != EFFECT_TRIPLE_KICK)
|
||||
dmg *= gBattleMoves[move].strikeCount;
|
||||
else if (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)
|
||||
dmg *= 3;
|
||||
|
@ -1722,10 +1722,10 @@ static void Cmd_accuracycheck(void)
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
else if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT
|
||||
|| (gSpecialStatuses[gBattlerAttacker].multiHitOn && (gBattleMoves[move].effect != EFFECT_TRIPLE_KICK
|
||||
|| GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK)))
|
||||
|| (gSpecialStatuses[gBattlerAttacker].multiHitOn && (GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK
|
||||
|| !(gBattleMoves[move].effect == EFFECT_TRIPLE_KICK || gBattleMoves[move].effect == EFFECT_POPULATION_BOMB))))
|
||||
{
|
||||
// No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel
|
||||
// No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel/Population Bomb
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
else
|
||||
|
@ -3748,11 +3748,6 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
gMultiHitCounter = gBattleMoves[gCurrentMove].strikeCount;
|
||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 3, 0)
|
||||
}
|
||||
else if (gBattleMoves[gCurrentMove].effect == EFFECT_TRIPLE_KICK)
|
||||
{
|
||||
gMultiHitCounter = 3;
|
||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0)
|
||||
}
|
||||
#if B_BEAT_UP >= GEN_5
|
||||
else if (gBattleMoves[gCurrentMove].effect == EFFECT_BEAT_UP)
|
||||
{
|
||||
|
@ -2886,6 +2886,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
.split = SPLIT_PHYSICAL,
|
||||
.zMoveEffect = Z_EFFECT_NONE,
|
||||
.makesContact = TRUE,
|
||||
.strikeCount = 3,
|
||||
},
|
||||
|
||||
[MOVE_THIEF] =
|
||||
@ -12357,6 +12358,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
.split = SPLIT_PHYSICAL,
|
||||
.zMoveEffect = Z_EFFECT_NONE,
|
||||
.makesContact = TRUE,
|
||||
.strikeCount = 3,
|
||||
},
|
||||
|
||||
[MOVE_DUAL_WINGBEAT] =
|
||||
@ -13152,7 +13154,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
|
||||
[MOVE_POPULATION_BOMB] =
|
||||
{
|
||||
.effect = EFFECT_PLACEHOLDER, // EFFECT_MULTI_HIT maybe?
|
||||
.effect = EFFECT_POPULATION_BOMB,
|
||||
.power = 20,
|
||||
.type = TYPE_NORMAL,
|
||||
.accuracy = 90,
|
||||
@ -13165,6 +13167,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
.makesContact = TRUE,
|
||||
.slicingMove = TRUE,
|
||||
.metronomeBanned = TRUE,
|
||||
.strikeCount = 10,
|
||||
},
|
||||
|
||||
[MOVE_ICE_SPINNER] =
|
||||
@ -13246,12 +13249,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
|
||||
[MOVE_MORTAL_SPIN] =
|
||||
{
|
||||
.effect = EFFECT_PLACEHOLDER, // EFFECT_MORTAL_SPIN
|
||||
.effect = EFFECT_MORTAL_SPIN,
|
||||
.power = 30,
|
||||
.type = TYPE_POISON,
|
||||
.accuracy = 100,
|
||||
.pp = 15,
|
||||
.secondaryEffectChance = 0,
|
||||
.secondaryEffectChance = 100,
|
||||
.target = MOVE_TARGET_BOTH,
|
||||
.priority = 0,
|
||||
.split = SPLIT_PHYSICAL,
|
||||
|
24
test/move_effect_mortal_spin.c
Normal file
24
test/move_effect_mortal_spin.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include "global.h"
|
||||
#include "test_battle.h"
|
||||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
ASSUME(gBattleMoves[MOVE_MORTAL_SPIN].effect == EFFECT_MORTAL_SPIN);
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Mortal Spin blows away hazards and poisons foe")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_STEALTH_ROCK); MOVE(player, MOVE_MORTAL_SPIN); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_STEALTH_ROCK, opponent);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_MORTAL_SPIN, player);
|
||||
MESSAGE("Wobbuffet blew away Stealth Rock!");
|
||||
MESSAGE("Foe Wobbuffet was poisoned!");
|
||||
STATUS_ICON(opponent, poison: TRUE);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user