Adds some gen9 moves (#3147)

* Adds some gen9 moves

* Fix Test + Tabs

* Collision Course boost changed to 1.3333
This commit is contained in:
Alex 2023-07-19 13:25:20 +02:00 committed by GitHub
parent ca792d43cc
commit 6b5d1e7577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 169 additions and 243 deletions

View File

@ -432,6 +432,22 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectInfernalParade @ EFFECT_INFERNAL_PARADE
.4byte BattleScript_EffectTakeHeart @ EFFECT_TAKE_HEART
.4byte BattleScript_EffectAxeKick @ EFFECT_AXE_KICK
.4byte BattleScript_EffectHit @ EFFECT_COLLISION_COURSE
.4byte BattleScript_EffectSpinOut @ EFFECT_SPIN_OUT
.4byte BattleScript_EffectMakeItRain @ EFFECT_MAKE_IT_RAIN
BattleScript_EffectMakeItRain:
setmoveeffect MOVE_EFFECT_PAYDAY
call BattleScript_EffectHit_Ret
seteffectwithchance
tryfaintmon BS_TARGET
setmoveeffect MOVE_EFFECT_SP_ATK_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
seteffectprimary
goto BattleScript_MoveEnd
BattleScript_EffectSpinOut::
setmoveeffect MOVE_EFFECT_SPD_MINUS_2 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
goto BattleScript_EffectHit
BattleScript_EffectAxeKick::
setmoveeffect MOVE_EFFECT_CONFUSION
@ -1121,24 +1137,7 @@ BattleScript_HyperspaceFuryRemoveProtect::
return
BattleScript_EffectPlasmaFists:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
seteffectwithchance
tryfaintmon BS_TARGET
applyplasmafists
@ -1147,24 +1146,7 @@ BattleScript_EffectPlasmaFists:
goto BattleScript_MoveEnd
BattleScript_EffectSparklySwirl:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
tryfaintmon BS_TARGET
healpartystatus
waitstate
@ -1173,24 +1155,7 @@ BattleScript_EffectSparklySwirl:
goto BattleScript_MoveEnd
BattleScript_EffectFreezyFrost:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
tryfaintmon BS_TARGET
normalisebuffs
printstring STRINGID_STATCHANGESGONE
@ -1199,24 +1164,7 @@ BattleScript_EffectFreezyFrost:
BattleScript_EffectSappySeed:
jumpifstatus3 BS_TARGET, STATUS3_LEECHSEED, BattleScript_EffectHit
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
tryfaintmon BS_TARGET
jumpifhasnohp BS_TARGET, BattleScript_MoveEnd
setseeded
@ -1226,24 +1174,7 @@ BattleScript_EffectSappySeed:
BattleScript_EffectBaddyBad:
jumpifsideaffecting BS_ATTACKER, SIDE_STATUS_REFLECT, BattleScript_EffectHit
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
tryfaintmon BS_TARGET
setreflect
printfromtable gReflectLightScreenSafeguardStringIds
@ -1252,24 +1183,7 @@ BattleScript_EffectBaddyBad:
BattleScript_EffectGlitzyGlow:
jumpifsideaffecting BS_ATTACKER, SIDE_STATUS_LIGHTSCREEN, BattleScript_EffectHit
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
tryfaintmon BS_TARGET
setlightscreen
printfromtable gReflectLightScreenSafeguardStringIds
@ -1430,24 +1344,7 @@ BattleScript_NoMoveEffect:
BattleScript_EffectRelicSong:
setmoveeffect MOVE_EFFECT_RELIC_SONG | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
seteffectwithchance
argumentstatuseffect
tryfaintmon BS_TARGET
@ -2214,24 +2111,7 @@ BattleScript_EffectFinalGambit:
goto BattleScript_MoveEnd
BattleScript_EffectHitSwitchTarget:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
tryfaintmon BS_TARGET
moveendall
jumpifability BS_TARGET, ABILITY_SUCTION_CUPS, BattleScript_AbilityPreventsPhasingOut
@ -3191,24 +3071,7 @@ BattleScript_EffectThroatChop:
goto BattleScript_EffectHit
BattleScript_EffectHitEscape:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
jumpifmovehadnoeffect BattleScript_MoveEnd
jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_MoveEnd
seteffectwithchance
@ -3280,6 +3143,27 @@ BattleScript_MoveEnd::
moveendall
end
BattleScript_EffectHit_Ret::
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
return
BattleScript_EffectNaturalGift:
attackcanceler
attackstring
@ -3471,24 +3355,7 @@ BattleScript_EffectPoisonHit:
goto BattleScript_EffectHit
BattleScript_EffectAbsorb::
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_AbsorbHealBlock
setdrainedhp
manipulatedamage DMG_BIG_ROOT
@ -3917,24 +3784,7 @@ BattleScript_EffectFlinchHit::
BattleScript_EffectFlinchStatus:
setmoveeffect MOVE_EFFECT_FLINCH
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
seteffectwithchance
argumentstatuseffect
tryfaintmon BS_TARGET
@ -5167,24 +5017,7 @@ BattleScript_EffectBatonPass::
BattleScript_EffectRapidSpin::
.if B_SPEED_BUFFING_RAPID_SPIN == GEN_8
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd
setmoveeffect MOVE_EFFECT_RAPIDSPIN | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
seteffectwithchance
@ -9023,7 +8856,7 @@ BattleScript_BadDreams_ShowPopUp:
goto BattleScript_BadDreams_DmgAfterPopUp
BattleScript_BadDreams_HidePopUp:
destroyabilitypopup
tryfaintmon BS_TARGET
tryfaintmon BS_TARGET
goto BattleScript_BadDreamsIncrement
BattleScript_TookAttack::
@ -10301,24 +10134,7 @@ BattleScript_ExtremeEvoboostEnd::
goto BattleScript_MoveEnd
BattleScript_EffectHitSetRemoveTerrain:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
call BattleScript_EffectHit_Ret
setterrain BattleScript_TryFaint
playanimation BS_ATTACKER, B_ANIM_RESTORE_BG
printfromtable gTerrainStringIds

View File

@ -409,7 +409,10 @@
#define EFFECT_INFERNAL_PARADE 403
#define EFFECT_TAKE_HEART 404
#define EFFECT_AXE_KICK 405
#define EFFECT_COLLISION_COURSE 406
#define EFFECT_SPIN_OUT 407
#define EFFECT_MAKE_IT_RAIN 408
#define NUM_BATTLE_MOVE_EFFECTS 406
#define NUM_BATTLE_MOVE_EFFECTS 409
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -4389,8 +4389,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
break;
case EFFECT_SUPERPOWER:
case EFFECT_OVERHEAT:
case EFFECT_MAKE_IT_RAIN:
if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY)
score += 10;
score += 3;
break;
case EFFECT_MAGIC_COAT:
if (IS_MOVE_STATUS(predictedMove) && AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH))
@ -5197,7 +5198,6 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
case EFFECT_ROOST:
case EFFECT_MEMENTO:
case EFFECT_GRUDGE:
case EFFECT_OVERHEAT:
score -= 2;
break;
default:

View File

@ -378,6 +378,7 @@ static const u16 sIgnoredPowerfulMoveEffects[] =
EFFECT_ERUPTION,
EFFECT_OVERHEAT,
EFFECT_MIND_BLOWN,
EFFECT_MAKE_IT_RAIN,
IGNORED_MOVES_END
};

View File

@ -9484,6 +9484,10 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move
finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(1.5));
}
// Collision Course, Electro Drift
if (gBattleMoves[move].effect == EFFECT_COLLISION_COURSE && typeEffectivenessModifier >= UQ_4_12(2.0))
finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(1.3333));
// reflect, light screen, aurora veil
if (((gSideStatuses[defSide] & SIDE_STATUS_REFLECT && IS_MOVE_PHYSICAL(move))
|| (gSideStatuses[defSide] & SIDE_STATUS_LIGHTSCREEN && IS_MOVE_SPECIAL(move))

View File

@ -13137,7 +13137,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
[MOVE_SPIN_OUT] =
{
.effect = EFFECT_PLACEHOLDER, // EFFECT_SPIN_OUT
.effect = EFFECT_SPIN_OUT,
.power = 100,
.type = TYPE_STEEL,
.accuracy = 100,
@ -13371,12 +13371,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
[MOVE_MAKE_IT_RAIN] =
{
.effect = EFFECT_PLACEHOLDER, // EFFECT_MAKE_IT_RAIN
.effect = EFFECT_MAKE_IT_RAIN,
.power = 120,
.type = TYPE_STEEL,
.accuracy = 100,
.pp = 5,
.secondaryEffectChance = 0,
.secondaryEffectChance = 100,
.target = MOVE_TARGET_BOTH,
.priority = 0,
.split = SPLIT_SPECIAL,
@ -13401,7 +13401,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
[MOVE_COLLISION_COURSE] =
{
.effect = EFFECT_PLACEHOLDER, // EFFECT_COLLISION_COURSE
.effect = EFFECT_COLLISION_COURSE,
.power = 100,
.type = TYPE_FIGHTING,
.accuracy = 100,
@ -13417,7 +13417,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
[MOVE_ELECTRO_DRIFT] =
{
.effect = EFFECT_PLACEHOLDER, // EFFECT_COLLISION_COURSE
.effect = EFFECT_COLLISION_COURSE,
.power = 100,
.type = TYPE_ELECTRIC,
.accuracy = 100,

View File

@ -0,0 +1,47 @@
#include "global.h"
#include "test_battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_COLLISION_COURSE].effect == EFFECT_COLLISION_COURSE);
}
SINGLE_BATTLE_TEST("Collision Course damage is increased by 33 Percent if super effective", s16 damage)
{
u32 move;
PARAMETRIZE { move = MOVE_HAMMER_ARM; }
PARAMETRIZE { move = MOVE_COLLISION_COURSE; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_KANGASKHAN);
} WHEN {
TURN { MOVE(player, move); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, player);
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.3333), results[1].damage);
}
}
SINGLE_BATTLE_TEST("Collision Course does normal damage if not super effective", s16 damage)
{
u32 move;
PARAMETRIZE { move = MOVE_HAMMER_ARM; }
PARAMETRIZE { move = MOVE_COLLISION_COURSE; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, move); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, player);
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_EQ(results[0].damage, results[1].damage);
}
}

View File

@ -0,0 +1,34 @@
#include "global.h"
#include "test_battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_MAKE_IT_RAIN].effect == EFFECT_MAKE_IT_RAIN);
}
SINGLE_BATTLE_TEST("Make It Rain lowers special attack by one stage")
{
s16 damage[2];
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_MAKE_IT_RAIN); }
TURN { MOVE(player, MOVE_MAKE_IT_RAIN); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_MAKE_IT_RAIN, player);
HP_BAR(opponent, captureDamage: &damage[0]);
MESSAGE("Coins scattered everywhere!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Sp. Atk fell!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_MAKE_IT_RAIN, player);
HP_BAR(opponent, captureDamage: &damage[1]);
MESSAGE("Coins scattered everywhere!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Sp. Atk fell!");
} THEN {
EXPECT_MUL_EQ(damage[0], Q_4_12(0.66), damage[1]);
}
}

View File

@ -0,0 +1,21 @@
#include "global.h"
#include "test_battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_SPIN_OUT].effect == EFFECT_SPIN_OUT);
}
SINGLE_BATTLE_TEST("Spin Out lowers speed by 2 stages")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SPIN_OUT); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIN_OUT, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Speed harshly fell!");
}
}