Merge pull request #237 from GriffinRichards/sync-ai

Sync AI scripts
This commit is contained in:
PikalaxALT
2020-01-23 15:33:01 -05:00
committed by GitHub
11 changed files with 3296 additions and 3107 deletions
+222 -175
View File
@@ -1,257 +1,257 @@
.macro if_random_less_than percent, address
.macro if_random_less_than percent:req, ptr:req
.byte 0x00
.byte \percent
.4byte \address
.4byte \ptr
.endm
@ unused
.macro if_random_greater_than percent, address
.macro if_random_greater_than percent:req, ptr:req
.byte 0x01
.byte \percent
.4byte \address
.4byte \ptr
.endm
@ unused
.macro if_random_equal address
.macro if_random_equal ptr:req
.byte 0x02
.4byte \address
.4byte \ptr
.endm
@ unused
.macro if_random_not_equal address
.macro if_random_not_equal ptr:req
.byte 0x03
.4byte \address
.4byte \ptr
.endm
.macro score score
.macro score score:req
.byte 0x04
.byte \score
.endm
.macro if_hp_less_than target, percent, address
.macro if_hp_less_than battler:req, percent:req, ptr:req
.byte 0x05
.byte \target
.byte \battler
.byte \percent
.4byte \address
.4byte \ptr
.endm
.macro if_hp_more_than target, percent, address
.macro if_hp_more_than battler:req, percent:req, ptr:req
.byte 0x06
.byte \target
.byte \battler
.byte \percent
.4byte \address
.4byte \ptr
.endm
.macro if_hp_equal target, percent, address
.macro if_hp_equal battler:req, percent:req, ptr:req
.byte 0x07
.byte \target
.byte \battler
.byte \percent
.4byte \address
.4byte \ptr
.endm
.macro if_hp_not_equal target, percent, address
.macro if_hp_not_equal battler:req, percent:req, ptr:req
.byte 0x08
.byte \target
.byte \battler
.byte \percent
.4byte \address
.4byte \ptr
.endm
.macro if_status target, status, address
.macro if_status battler:req, status:req, ptr:req
.byte 0x09
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
.macro if_not_status target, status, address
.macro if_not_status battler:req, status:req, ptr:req
.byte 0x0a
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
.macro if_status2 target, status, address
.macro if_status2 battler:req, status:req, ptr:req
.byte 0x0b
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
.macro if_not_status2 target, status, address
.macro if_not_status2 battler:req, status:req, ptr:req
.byte 0x0c
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
.macro if_status3 target, status, address
.macro if_status3 battler:req, status:req, ptr:req
.byte 0x0d
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
.macro if_not_status3 target, status, address
.macro if_not_status3 battler:req, status:req, ptr:req
.byte 0x0e
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
.macro if_status4 target, status, address
.macro if_side_affecting battler:req, status:req, ptr:req
.byte 0x0f
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
.macro if_not_status4 target, status, address
.macro if_not_side_affecting battler:req, status:req, ptr:req
.byte 0x10
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
.macro if_less_than value, address
.macro if_less_than value:req, ptr:req
.byte 0x11
.byte \value
.4byte \address
.4byte \ptr
.endm
.macro if_more_than value, address
.macro if_more_than value:req, ptr:req
.byte 0x12
.byte \value
.4byte \address
.4byte \ptr
.endm
.macro if_equal value, address
.macro if_equal value:req, ptr:req
.byte 0x13
.byte \value
.4byte \address
.4byte \ptr
.endm
.macro if_not_equal value, address
.macro if_not_equal value:req, ptr:req
.byte 0x14
.byte \value
.4byte \address
.4byte \ptr
.endm
.macro if_less_than_32 value, address
.macro if_less_than_ptr value:req, ptr:req
.byte 0x15
.4byte \value
.4byte \address
.4byte \ptr
.endm
.macro if_more_than_32 value, address
.macro if_more_than_ptr value:req, ptr:req
.byte 0x16
.4byte \value
.4byte \address
.4byte \ptr
.endm
.macro if_equal_32 value, address
.macro if_equal_ptr value:req, ptr:req
.byte 0x17
.4byte \value
.4byte \address
.4byte \ptr
.endm
.macro if_not_equal_32 value, address
.macro if_not_equal_ptr value:req, ptr:req
.byte 0x18
.4byte \value
.4byte \address
.4byte \ptr
.endm
.macro if_move move, address
.macro if_move move:req, ptr:req
.byte 0x19
.2byte \move
.4byte \address
.4byte \ptr
.endm
.macro if_not_move move, address
.macro if_not_move move:req, ptr:req
.byte 0x1a
.2byte \move
.4byte \address
.4byte \ptr
.endm
.macro if_in_bytes list, address
.macro if_in_bytes list:req, ptr:req
.byte 0x1b
.4byte \list
.4byte \address
.4byte \ptr
.endm
.macro if_not_in_bytes list, address
.macro if_not_in_bytes list:req, ptr:req
.byte 0x1c
.4byte \list
.4byte \address
.4byte \ptr
.endm
.macro if_in_words list, address
.macro if_in_hwords list:req, ptr:req
.byte 0x1d
.4byte \list
.4byte \address
.4byte \ptr
.endm
.macro if_not_in_words list, address
.macro if_not_in_hwords list:req, ptr:req
.byte 0x1e
.4byte \list
.4byte \address
.4byte \ptr
.endm
.macro if_user_can_damage address
.macro if_user_has_attacking_move ptr:req
.byte 0x1f
.4byte \address
.4byte \ptr
.endm
.macro if_user_cant_damage address
.macro if_user_has_no_attacking_moves ptr:req
.byte 0x20
.4byte \address
.4byte \ptr
.endm
.macro get_turn_count
.byte 0x21
.endm
.macro get_type byte
.macro get_type byte:req
.byte 0x22
.byte \byte
.endm
@ unused
.macro get_move_power
.macro get_considered_move_power
.byte 0x23
.endm
.macro is_most_powerful_move
.macro get_how_powerful_move_is
.byte 0x24
.endm
.macro get_move target
.macro get_last_used_move battler:req
.byte 0x25
.byte \target
.byte \battler
.endm
.macro if_arg_equal type, address
.macro if_equal_ type:req, ptr:req
.byte 0x26
.byte \type
.4byte \address
.4byte \ptr
.endm
@ unused
.macro if_arg_not_equal type, address
.macro if_not_equal_ type:req, ptr:req
.byte 0x27
.byte \type
.4byte \address
.4byte \ptr
.endm
.macro if_would_go_first target, address
.macro if_would_go_first battler:req, ptr:req
.byte 0x28
.byte \target
.4byte \address
.byte \battler
.4byte \ptr
.endm
.macro if_would_not_go_first target, address
.macro if_would_not_go_first battler:req, ptr:req
.byte 0x29
.byte \target
.4byte \address
.byte \battler
.4byte \ptr
.endm
@ nullsub
@@ -264,9 +264,9 @@
.byte 0x2b
.endm
.macro count_alive_pokemon target
.macro count_alive_pokemon battler:req
.byte 0x2c
.byte \target
.byte \battler
.endm
@ unused
@@ -274,24 +274,24 @@
.byte 0x2d
.endm
.macro get_effect
.macro get_considered_move_effect
.byte 0x2e
.endm
.macro get_ability target
.macro get_ability battler:req
.byte 0x2f
.byte \target
.byte \battler
.endm
@ unused
.macro get_highest_possible_damage
.macro get_highest_type_effectiveness
.byte 0x30
.endm
.macro if_damage_bonus value, address
.macro if_type_effectiveness effectiveness:req, ptr:req
.byte 0x31
.byte \value
.4byte \address
.byte \effectiveness
.4byte \ptr
.endm
@ nullsub
@@ -304,162 +304,162 @@
.byte 0x33
.endm
.macro if_status_in_party target, status, address
.macro if_status_in_party battler:req, status:req, ptr:req
.byte 0x34
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
@ bugged
.macro if_status_not_in_party target, status, address
.macro if_status_not_in_party battler:req, status:req, ptr:req
.byte 0x35
.byte \target
.byte \battler
.4byte \status
.4byte \address
.4byte \ptr
.endm
.macro get_weather
.byte 0x36
.endm
.macro if_effect byte, address
.macro if_effect byte:req, ptr:req
.byte 0x37
.byte \byte
.4byte \address
.4byte \ptr
.endm
.macro if_not_effect byte, address
.macro if_not_effect byte:req, ptr:req
.byte 0x38
.byte \byte
.4byte \address
.4byte \ptr
.endm
.macro if_stat_level_less_than target, stat, level, address
.macro if_stat_level_less_than battler:req, stat:req, level:req, ptr:req
.byte 0x39
.byte \target
.byte \battler
.byte \stat
.byte \level
.4byte \address
.4byte \ptr
.endm
.macro if_stat_level_more_than target, stat, level, address
.macro if_stat_level_more_than battler:req, stat:req, level:req, ptr:req
.byte 0x3a
.byte \target
.byte \battler
.byte \stat
.byte \level
.4byte \address
.4byte \ptr
.endm
.macro if_stat_level_equal target, stat, level, address
.macro if_stat_level_equal battler:req, stat:req, level:req, ptr:req
.byte 0x3b
.byte \target
.byte \battler
.byte \stat
.byte \level
.4byte \address
.4byte \ptr
.endm
.macro if_stat_level_not_equal target, stat, level, address
.macro if_stat_level_not_equal battler:req, stat:req, level:req, ptr:req
.byte 0x3c
.byte \target
.byte \battler
.byte \stat
.byte \level
.4byte \address
.4byte \ptr
.endm
.macro if_can_faint address
.macro if_can_faint ptr:req
.byte 0x3d
.4byte \address
.4byte \ptr
.endm
.macro if_cant_faint address
.macro if_cant_faint ptr:req
.byte 0x3e
.4byte \address
.4byte \ptr
.endm
@ unused
.macro if_has_move, target, move, address
.macro if_has_move battler:req, move:req, ptr:req
.byte 0x3f
.byte \target
.byte \battler
.2byte \move
.4byte \address
.4byte \ptr
.endm
@ unused
.macro if_dont_have_move, target, move, address
.macro if_doesnt_have_move battler:req, move:req, ptr:req
.byte 0x40
.byte \target
.byte \battler
.2byte \move
.4byte \address
.4byte \ptr
.endm
.macro if_move_effect target, effect, address
.macro if_has_move_with_effect battler:req, effect:req, ptr:req
.byte 0x41
.byte \target
.byte \battler
.byte \effect
.4byte \address
.4byte \ptr
.endm
.macro if_not_move_effect target, effect, address
.macro if_doesnt_have_move_with_effect battler:req, effect:req, ptr:req
.byte 0x42
.byte \target
.byte \battler
.byte \effect
.4byte \address
.4byte \ptr
.endm
.macro if_last_move_did_damage target, byte, address
.macro if_any_move_disabled_or_encored battler:req, byte:req, ptr:req
.byte 0x43
.byte \target
.byte \battler
.byte \byte
.4byte \address
.4byte \ptr
.endm
.macro if_encored target, address
.macro if_curr_move_disabled_or_encored battler:req, ptr:req
.byte 0x44
.byte \target
.4byte \address
.byte \battler
.4byte \ptr
.endm
.macro flee
.byte 0x45
.endm
.macro if_random_100 address
.macro if_random_safari_flee ptr:req
.byte 0x46
.4byte \address
.4byte \ptr
.endm
.macro watch
.byte 0x47
.endm
.macro get_hold_effect target
.macro get_hold_effect battler:req
.byte 0x48
.byte \target
.byte \battler
.endm
.macro get_gender target
.macro get_gender battler:req
.byte 0x49
.byte \target
.byte \battler
.endm
.macro is_first_turn target
.macro is_first_turn_for battler:req
.byte 0x4a
.byte \target
.byte \battler
.endm
.macro get_stockpile_count target
.macro get_stockpile_count battler:req
.byte 0x4b
.byte \target
.byte \battler
.endm
.macro is_double_battle
.byte 0x4c
.endm
.macro get_item target
.macro get_used_held_item battler:req
.byte 0x4d
.byte \target
.byte \battler
.endm
.macro get_move_type_from_result
@@ -474,9 +474,9 @@
.byte 0x50
.endm
.macro get_protect_count target
.macro get_protect_count battler:req
.byte 0x51
.byte \target
.byte \battler
.endm
@ nullsub
@@ -510,45 +510,92 @@
.endm
@ unused
.macro call address
.macro call ptr:req
.byte 0x58
.4byte \address
.4byte \ptr
.endm
.macro jump address
.macro goto ptr:req
.byte 0x59
.4byte \address
.4byte \ptr
.endm
.macro end
.byte 0x5a
.endm
.macro if_level_cond cond, address
.macro if_level_cond cond:req, ptr:req
.byte 0x5b
.byte \cond
.4byte \address
.4byte \ptr
.endm
.macro if_user_higher_level address
if_level_cond 0, \address
.macro if_user_higher_level ptr:req
if_level_cond 0, \ptr
.endm
.macro if_target_higher_level address
if_level_cond 1, \address
.macro if_target_higher_level ptr:req
if_level_cond 1, \ptr
.endm
.macro if_equal_levels address
if_level_cond 2, \address
.macro if_equal_levels ptr:req
if_level_cond 2, \ptr
.endm
@ unused
.macro if_taunted address
.macro if_target_taunted ptr:req
.byte 0x5c
.4byte \address
.4byte \ptr
.endm
.macro if_not_taunted address
.macro if_target_not_taunted ptr:req
.byte 0x5d
.4byte \address
.4byte \ptr
.endm
@ useful script macros
.macro get_curr_move_type
get_type AI_TYPE_MOVE
.endm
.macro get_user_type1
get_type AI_TYPE1_USER
.endm
.macro get_user_type2
get_type AI_TYPE2_USER
.endm
.macro get_target_type1
get_type AI_TYPE1_TARGET
.endm
.macro get_target_type2
get_type AI_TYPE2_TARGET
.endm
.macro if_target_faster ptr:req
if_would_go_first 1, \ptr
.endm
.macro if_user_faster ptr:req
if_would_go_first 0, \ptr
.endm
.macro if_double_battle ptr:req
is_double_battle
if_equal 1, \ptr
.endm
.macro if_not_double_battle ptr:req
is_double_battle
if_equal 0, \ptr
.endm
.macro if_any_move_disabled battler:req, ptr:req
if_any_move_disabled_or_encored \battler, 0, \ptr
.endm
.macro if_any_move_encored battler:req, ptr:req
if_any_move_disabled_or_encored \battler, 1, \ptr
.endm
+2390 -2258
View File
File diff suppressed because it is too large Load Diff
+8 -6
View File
@@ -58,14 +58,15 @@
#define BATTLE_TYPE_EREADER_TRAINER 0x0800
#define BATTLE_TYPE_KYOGRE_GROUDON 0x1000
#define BATTLE_TYPE_LEGENDARY 0x2000
#define BATTLE_TYPE_GHOST_UNVEILED 0x2000 // Re-use of BATTLE_TYPE_LEGENDARY, when combined with BATTLE_TYPE_GHOST
#define BATTLE_TYPE_REGI 0x4000
#define BATTLE_TYPE_GHOST 0x8000
#define BATTLE_TYPE_POKEDUDE 0x10000
#define BATTLE_TYPE_PALACE 0x20000
#define BATTLE_TYPE_ARENA 0x40000
#define BATTLE_TYPE_WILD_SCRIPTED 0x20000
#define BATTLE_TYPE_LEGENDARY_FRLG 0x40000
#define BATTLE_TYPE_TRAINER_TOWER 0x80000
#define BATTLE_TYPE_PIKE 0x100000
#define BATTLE_TYPE_PYRAMID 0x200000
#define BATTLE_TYPE_x100000 0x100000
#define BATTLE_TYPE_x200000 0x200000
#define BATTLE_TYPE_INGAME_PARTNER 0x400000
#define BATTLE_TYPE_x800000 0x800000
#define BATTLE_TYPE_RECORDED 0x1000000
@@ -76,8 +77,9 @@
#define BATTLE_TYPE_KYOGRE 0x20000000
#define BATTLE_TYPE_RAYQUAZA 0x40000000
#define BATTLE_TYPE_x80000000 0x80000000
#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID)
#define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE)
#define IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(flags) ((flags) & BATTLE_TYPE_GHOST && !((flags) & BATTLE_TYPE_GHOST_UNVEILED))
#define IS_BATTLE_TYPE_GHOST_WITH_SCOPE(flags) ((flags) & BATTLE_TYPE_GHOST && (flags) & BATTLE_TYPE_GHOST_UNVEILED)
// Battle Outcome defines
#define B_OUTCOME_WON 0x1
+3 -3
View File
@@ -23,7 +23,7 @@
#define AI_EFFECTIVENESS_x0 0
// ai weather
#define AI_WEATHER_SUNNY 0
#define AI_WEATHER_SUN 0
#define AI_WEATHER_RAIN 1
#define AI_WEATHER_SANDSTORM 2
#define AI_WEATHER_HAIL 3
@@ -35,8 +35,8 @@
// script's table id to bit
#define AI_SCRIPT_CHECK_BAD_MOVE (1 << 0)
#define AI_SCRIPT_TRY_TO_FAINT (1 << 1)
#define AI_SCRIPT_CHECK_VIABILITY (1 << 2)
#define AI_SCRIPT_CHECK_VIABILITY (1 << 1)
#define AI_SCRIPT_TRY_TO_FAINT (1 << 2)
#define AI_SCRIPT_SETUP_FIRST_TURN (1 << 3)
#define AI_SCRIPT_RISKY (1 << 4)
#define AI_SCRIPT_PREFER_STRONGEST_MOVE (1 << 5)
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -2559,9 +2559,9 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
{
if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT)
{
if (gBattleTypeFlags & (BATTLE_TYPE_GHOST | BATTLE_TYPE_LEGENDARY))
if (gBattleTypeFlags & (BATTLE_TYPE_GHOST | BATTLE_TYPE_GHOST_UNVEILED))
{
if ((gBattleTypeFlags & (BATTLE_TYPE_GHOST | BATTLE_TYPE_LEGENDARY)) != BATTLE_TYPE_GHOST)
if (!IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags))
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
}
else if (!(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER
@@ -2674,7 +2674,7 @@ static void BattleIntroPrintWildMonAttacked(void)
{
gBattleMainFunc = BattleIntroPrintPlayerSendsOut;
PrepareStringBattle(STRINGID_INTROMSG, 0);
if ((gBattleTypeFlags & (BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_GHOST)) == (BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_GHOST))
if (IS_BATTLE_TYPE_GHOST_WITH_SCOPE(gBattleTypeFlags))
{
gBattleScripting.battler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
BattleScriptExecute(BattleScript_SilphScopeUnveiled);
@@ -4183,7 +4183,7 @@ bool8 TryRunFromBattle(u8 battler)
gProtectStructs[battler].fleeFlag = 2;
++effect;
}
else if ((gBattleTypeFlags & (BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_GHOST)) == BATTLE_TYPE_GHOST)
else if (IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags))
{
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
++effect;
+1 -1
View File
@@ -1516,7 +1516,7 @@ void BufferStringBattle(u16 stringId)
{
if (gBattleTypeFlags & BATTLE_TYPE_GHOST)
{
if (gBattleTypeFlags & BATTLE_TYPE_LEGENDARY)
if (gBattleTypeFlags & BATTLE_TYPE_GHOST_UNVEILED)
stringPtr = gUnknown_83FD30D;
else
stringPtr = gUnknown_83FD2D9;
+1 -1
View File
@@ -7352,7 +7352,7 @@ static void atk95_setsandstorm(void)
static void atk96_weatherdamage(void)
{
if (((gBattleTypeFlags & (BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_GHOST)) == BATTLE_TYPE_GHOST)
if (IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags)
&& (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT))
{
gBattleMoveDamage = 0;
+3 -3
View File
@@ -301,7 +301,7 @@ void BattleSetup_StartScriptedWildBattle(void)
{
ScriptContext2_Enable();
gMain.savedCallback = CB2_EndScriptedWildBattle;
gBattleTypeFlags = BATTLE_TYPE_PALACE;
gBattleTypeFlags = BATTLE_TYPE_WILD_SCRIPTED;
CreateBattleStartTask(GetWildBattleTransition(), 0);
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
@@ -313,7 +313,7 @@ void ScrSpecial_StartMarowakBattle(void)
gMain.savedCallback = CB2_EndMarowakBattle;
if (CheckBagHasItem(ITEM_SILPH_SCOPE, 1))
{
gBattleTypeFlags = BATTLE_TYPE_GHOST | BATTLE_TYPE_LEGENDARY;
gBattleTypeFlags = BATTLE_TYPE_GHOST | BATTLE_TYPE_GHOST_UNVEILED;
CreateMonWithGenderNatureLetter(gEnemyParty, SPECIES_MAROWAK, 30, 31, MON_FEMALE, NATURE_SERIOUS, 0);
}
else
@@ -342,7 +342,7 @@ void Special_StartLegendaryBattle(void)
ScriptContext2_Enable();
gMain.savedCallback = CB2_EndScriptedWildBattle;
gBattleTypeFlags = BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_ARENA;
gBattleTypeFlags = BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_LEGENDARY_FRLG;
species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES);
switch (species)
{
+2 -2
View File
@@ -1382,7 +1382,7 @@ u8 AtkCanceller_UnableToUseMove(void)
++gBattleStruct->atkCancellerTracker;
break;
case CANCELLER_GHOST: // GHOST in pokemon tower
if ((gBattleTypeFlags & (BATTLE_TYPE_GHOST | BATTLE_TYPE_LEGENDARY)) == BATTLE_TYPE_GHOST)
if (IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags))
{
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
gBattlescriptCurrInstr = BattleScript_TooScaredToMove;
@@ -1616,7 +1616,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
if (!moveArg)
moveArg = gCurrentMove;
GET_MOVE_TYPE(moveArg, moveType);
if ((gBattleTypeFlags & (BATTLE_TYPE_GHOST | BATTLE_TYPE_LEGENDARY)) == BATTLE_TYPE_GHOST
if (IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags)
&& (gLastUsedAbility == ABILITY_INTIMIDATE || gLastUsedAbility == ABILITY_TRACE))
return effect;
switch (caseID)
+2 -2
View File
@@ -202,7 +202,7 @@ static bool8 LoadBattlerSpriteGfx(u8 battler)
{
if (GetBattlerSide(battler) != B_SIDE_PLAYER)
{
if ((gBattleTypeFlags & (BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_GHOST)) == BATTLE_TYPE_GHOST)
if (IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags))
DecompressGhostFrontPic(&gEnemyParty[gBattlerPartyIndexes[battler]], battler);
else if (!gBattleSpritesDataPtr->battlerData[battler].behindSubstitute)
BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[battler]], battler);
@@ -228,7 +228,7 @@ static void CreateBattlerSprite(u8 battler)
{
u8 posY;
if ((gBattleTypeFlags & (BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_GHOST)) == BATTLE_TYPE_GHOST)
if (IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags))
posY = GetGhostSpriteDefault_Y(battler);
else if (gBattleSpritesDataPtr->battlerData[battler].behindSubstitute)
posY = GetSubstituteSpriteDefault_Y(battler);