Rename SetPhotonGeyser to a more general use and clean up (#6272)

This commit is contained in:
Alex 2025-02-17 22:07:30 +01:00 committed by GitHub
parent d555f5c97f
commit 502b1c5087
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 24 additions and 12 deletions

View File

@ -1641,8 +1641,8 @@
callnative BS_TryTriggerStatusForm
.endm
.macro setphotongeysercategory
callnative BS_SetPhotonGeyserCategory
.macro setdynamicmovecategory
callnative BS_SetDynamicMoveCategory
.endm
.macro tryupperhand failInstr:req

View File

@ -836,8 +836,8 @@ BattleScript_FlingMissed:
ppreduce
goto BattleScript_MoveMissedPause
BattleScript_EffectPhotonGeyser::
setphotongeysercategory
BattleScript_EffectDynamicCategory::
setdynamicmovecategory
goto BattleScript_EffectHit
BattleScript_EffectAuraWheel:: @ Aura Wheel can only be used by Morpeko

View File

@ -825,7 +825,7 @@ extern const u8 BattleScript_MoveEffectHaze[];
extern const u8 BattleScript_MoveEffectIonDeluge[];
extern const u8 BattleScript_EffectHyperspaceFury[];
extern const u8 BattleScript_EffectAuraWheel[];
extern const u8 BattleScript_EffectPhotonGeyser[];
extern const u8 BattleScript_EffectDynamicCategory[];
extern const u8 BattleScript_EffectNoRetreat[];
extern const u8 BattleScript_EffectTarShot[];
extern const u8 BattleScript_EffectPoltergeist[];

View File

@ -17705,13 +17705,25 @@ void BS_AllySwitchFailChance(void)
gBattlescriptCurrInstr = cmd->nextInstr;
}
void BS_SetPhotonGeyserCategory(void)
void BS_SetDynamicMoveCategory(void)
{
NATIVE_ARGS();
u32 effect = GetMoveEffect(gCurrentMove);
if (!((effect == EFFECT_TERA_BLAST && GetActiveGimmick(gBattlerAttacker) != GIMMICK_TERA)
|| (effect == EFFECT_TERA_STARSTORM && GetActiveGimmick(gBattlerAttacker) != GIMMICK_TERA && gBattleMons[gBattlerAttacker].species == SPECIES_TERAPAGOS_STELLAR)))
switch (GetMoveEffect(gCurrentMove))
{
case EFFECT_TERA_BLAST:
if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_TERA)
gBattleStruct->swapDamageCategory = (GetCategoryBasedOnStats(gBattlerAttacker) != GetMoveCategory(gCurrentMove));
break;
case EFFECT_TERA_STARSTORM:
if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_TERA && gBattleMons[gBattlerAttacker].species == SPECIES_TERAPAGOS_STELLAR)
gBattleStruct->swapDamageCategory = (GetCategoryBasedOnStats(gBattlerAttacker) != GetMoveCategory(gCurrentMove));
break;
default:
gBattleStruct->swapDamageCategory = (GetCategoryBasedOnStats(gBattlerAttacker) != GetMoveCategory(gCurrentMove));
break;
}
gBattlescriptCurrInstr = cmd->nextInstr;
}

View File

@ -1909,7 +1909,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
[EFFECT_PHOTON_GEYSER] =
{
.battleScript = BattleScript_EffectPhotonGeyser,
.battleScript = BattleScript_EffectDynamicCategory,
.battleTvScore = 0, // TODO: Assign points
},
@ -2201,13 +2201,13 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
[EFFECT_TERA_BLAST] =
{
.battleScript = BattleScript_EffectPhotonGeyser,
.battleScript = BattleScript_EffectDynamicCategory,
.battleTvScore = 0, // TODO: Assign points
},
[EFFECT_TERA_STARSTORM] =
{
.battleScript = BattleScript_EffectPhotonGeyser,
.battleScript = BattleScript_EffectDynamicCategory,
.battleTvScore = 0, // TODO: Assign points
},