gBattlescriptCurrInstr[3] is not reading species parameter

This commit is contained in:
MissingNoL 2021-06-06 19:14:11 -07:00
parent e48e9c1d7a
commit bfc66a21cc
10 changed files with 42 additions and 4 deletions

View File

@ -1769,6 +1769,12 @@
various \battler, VARIOUS_TRY_ACTIVATE_GRIM_NEIGH
.endm
.macro jumpifspecies battler:req, species:req, ptr:req
various \battler, VARIOUS_JUMP_IF_SPECIES
.byte \species
.4byte \ptr
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7

View File

@ -11,6 +11,7 @@
#include "constants/game_stat.h"
#include "constants/trainers.h"
#include "constants/battle_config.h"
#include "constants/species.h"
.include "asm/macros.inc"
.include "asm/macros/battle_script.inc"
.include "constants/constants.inc"
@ -369,6 +370,18 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectSleepHit
.4byte BattleScript_EffectAttackerDefenseDownHit
.4byte BattleScript_EffectBodyPress
.4byte BattleScript_EffectHyperspaceFury
BattleScript_EffectHyperspaceFury:
jumpifspecies BS_ATTACKER, SPECIES_HOOPA_UNBOUND, BattleScript_EffectAttackerDefenseDownHit
jumpifspecies BS_ATTACKER, SPECIES_HOOPA, BattleScript_ButHoopaCantUseIt
printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_ButHoopaCantUseIt:
printstring STRINGID_BUTHOOPACANTUSEIT
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectAttackerDefenseDownHit:
setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN

View File

@ -35,6 +35,8 @@
#define SPECIES_ZYGARDE 0 // 50%
#define SPECIES_ZYGARDE_10 10011 // 10 %
#define SPECIES_ZYGARDE_COMPLETE 10012 // 100 %
#define SPECIES_HOOPA 0
#define SPECIES_HOOPA_UNBOUND 10013
#endif
// Items with peculiar battle effects.

View File

@ -353,7 +353,8 @@
#define EFFECT_SLEEP_HIT 347 // Relic Song
#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348
#define EFFECT_BODY_PRESS 349
#define EFFECT_HYPERSPACE_FURY 350
#define NUM_BATTLE_MOVE_EFFECTS 350
#define NUM_BATTLE_MOVE_EFFECTS 351
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -173,6 +173,7 @@
#define VARIOUS_DESTROY_ABILITY_POPUP 102
#define VARIOUS_TOTEM_BOOST 103
#define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104
#define VARIOUS_JUMP_IF_SPECIES 105
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -570,8 +570,10 @@
#define STRINGID_MICLEBERRYACTIVATES 566
#define STRINGID_PKMNSHOOKOFFTHETAUNT 567
#define STRINGID_PKMNGOTOVERITSINFATUATION 568
#define STRINGID_BUTPOKEMONCANTUSETHEMOVE 569
#define STRINGID_BUTHOOPACANTUSEIT 570
#define BATTLESTRINGS_COUNT 569
#define BATTLESTRINGS_COUNT 571
// The below IDs are all indexes into battle message tables,
// used to determine which of a set of messages to print.

View File

@ -315,6 +315,7 @@
#define FLAG_DMG_2X_IN_AIR (1 << 22) // If target is in the air, can hit and deal double damage.
#define FLAG_DMG_IN_AIR (1 << 23) // If target is in the air, can hit.
#define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets
#define FLAG_HIT_IN_SUBSTITUTE (1 << 25) // Hyperspace Fury
// Split defines.
#define SPLIT_PHYSICAL 0x0

View File

@ -696,6 +696,8 @@ static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faste
static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!");
static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shook off\nthe taunt!");
static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!");
static const u8 sText_ButPokemonCantUseTheMove[] = _("But {B_ATK_NAME_WITH_PREFIX} can't\nuse the move!");
static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way it is now!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
@ -1256,6 +1258,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_AURABREAKENTERS - 12] = sText_AuraBreakActivates,
[STRINGID_COMATOSEENTERS - 12] = sText_ComatoseActivates,
[STRINGID_SCREENCLEANERENTERS - 12] = sText_ScreenCleanerActivates,
[STRINGID_BUTPOKEMONCANTUSETHEMOVE - 12] = sText_ButPokemonCantUseTheMove,
[STRINGID_BUTHOOPACANTUSEIT - 12] = sText_ButHoopaCantUseIt,
};
const u16 gTerrainStringIds[] =

View File

@ -8426,6 +8426,12 @@ static void Cmd_various(void)
gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe)
}
return;
case VARIOUS_JUMP_IF_SPECIES:
if (gBattleMons[gBattlerAttacker].species == gBattlescriptCurrInstr[3])
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4);
else
gBattlescriptCurrInstr += 8;
return;
}
gBattlescriptCurrInstr += 3;
@ -11862,6 +11868,8 @@ bool32 DoesSubstituteBlockMove(u8 battlerAtk, u8 battlerDef, u32 move)
return FALSE;
else if (GetBattlerAbility(battlerAtk) == ABILITY_INFILTRATOR)
return FALSE;
else if (gBattleMoves[move].flags & FLAG_HIT_IN_SUBSTITUTE)
return FALSE;
else
return TRUE;
}

View File

@ -9678,7 +9678,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_HYPERSPACE_FURY] =
{
.effect = EFFECT_ATTACKER_DEFENSE_DOWN_HIT,
.effect = EFFECT_HYPERSPACE_FURY,
.power = 100,
.type = TYPE_DARK,
.accuracy = 0,
@ -9686,7 +9686,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 100,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
.flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIT_IN_SUBSTITUTE,
.split = SPLIT_PHYSICAL,
.argument = MOVE_EFFECT_FEINT,
},