create more battle constants

This commit is contained in:
DizzyEggg 2018-02-08 00:35:13 +01:00
parent caf9af321d
commit a10fd5a7c4
19 changed files with 485 additions and 1114 deletions

View File

@ -1,118 +1,3 @@
@ battle types
.set BATTLE_TYPE_DOUBLE , 0x0001
.set BATTLE_TYPE_LINK, 0x0002
.set BATTLE_TYPE_WILD, 0x0004
.set BATTLE_TYPE_TRAINER, 0x0008
.set BATTLE_TYPE_FIRST_BATTLE, 0x0010
.set BATTLE_TYPE_20, 0x0020
.set BATTLE_TYPE_MULTI, 0x0040
.set BATTLE_TYPE_SAFARI, 0x0080
.set BATTLE_TYPE_BATTLE_TOWER, 0x0100
.set BATTLE_TYPE_WALLY_TUTORIAL, 0x0200
.set BATTLE_TYPE_ROAMER, 0x0400
.set BATTLE_TYPE_EREADER_TRAINER, 0x0800
.set BATTLE_TYPE_KYOGRE_GROUDON, 0x1000
.set BATTLE_TYPE_LEGENDARY, 0x2000
.set BATTLE_TYPE_REGI, 0x4000
.set BATTLE_TYPE_TWO_OPPONENTS, 0x8000
.set BATTLE_TYPE_DOME, 0x10000
.set BATTLE_TYPE_PALACE, 0x20000
.set BATTLE_TYPE_ARENA, 0x40000
.set BATTLE_TYPE_FACTORY, 0x80000
.set BATTLE_TYPE_PIKE, 0x100000
.set BATTLE_TYPE_PYRAMID, 0x200000
.set BATTLE_TYPE_INGAME_PARTNER, 0x400000
.set BATTLE_TYPE_x800000, 0x800000
.set BATTLE_TYPE_RECORDED, 0x1000000
.set BATTLE_TYPE_x2000000, 0x2000000
.set BATTLE_TYPE_x4000000, 0x4000000
.set BATTLE_TYPE_SECRET_BASE, 0x8000000
.set BATTLE_TYPE_GROUDON, 0x10000000
.set BATTLE_TYPE_KYOGRE, 0x20000000
.set BATTLE_TYPE_RAYQUAZA, 0x40000000
.set BATTLE_TYPE_x80000000, 0x80000000
@ battle outcomes
.set WON, 0x1
.set LOST, 0x2
.set DREW, 0x3
.set RAN, 0x4
.set PLAYER_TELEPORTED, 0x5
.set MON_FLED, 0x6
.set CAUGHT, 0x7
.set OUT_OF_BALLS, 0x8
.set FORFEITED, 0x9
.set OPPONENT_TELEPORTED, 0xA
@ identities
.set B_POSITION_PLAYER_LEFT, 0
.set B_POSITION_OPPONENT_LEFT, 1
.set B_POSITION_PLAYER_RIGHT, 2
.set B_POSITION_OPPONENT_RIGHT, 3
@ status 1
.set STATUS1_SLEEP, 0x7
.set STATUS1_POISON, 0x8
.set STATUS1_BURN, 0x10
.set STATUS1_FREEZE, 0x20
.set STATUS1_PARALYSIS, 0x40
.set STATUS1_TOXIC_POISON, 0x80
.set STATUS1_TOXIC_COUNTER, 0xF00
.set STATUS1_ANY, STATUS1_SLEEP | STATUS1_POISON | STATUS1_BURN | STATUS1_FREEZE | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON
@ status 2
.set STATUS2_CONFUSION, 0x00000007
.set STATUS2_FLINCHED, 0x00000008
.set STATUS2_UPROAR, 0x00000070
.set STATUS2_BIDE, 0x00000300
.set STATUS2_LOCK_CONFUSE, 0x00000C00
.set STATUS2_MULTIPLETURNS, 0x00001000
.set STATUS2_WRAPPED, 0x0000E000
.set STATUS2_INFATUATION, 0x000F0000
.set STATUS2_FOCUS_ENERGY, 0x00100000
.set STATUS2_TRANSFORMED, 0x00200000
.set STATUS2_RECHARGE, 0x00400000
.set STATUS2_RAGE, 0x00800000
.set STATUS2_SUBSTITUTE, 0x01000000
.set STATUS2_DESTINY_BOND, 0x02000000
.set STATUS2_ESCAPE_PREVENTION, 0x04000000
.set STATUS2_NIGHTMARE, 0x08000000
.set STATUS2_CURSED, 0x10000000
.set STATUS2_FORESIGHT, 0x20000000
.set STATUS2_DEFENSE_CURL, 0x40000000
.set STATUS2_TORMENT, 0x80000000
@ status 3
.set STATUS3_LEECHSEED_BANK, 0x3
.set STATUS3_LEECHSEED, 0x4
.set STATUS3_ALWAYS_HITS, 0x18
.set STATUS3_PERISH_SONG, 0x20
.set STATUS3_ON_AIR, 0x40
.set STATUS3_UNDERGROUND, 0x80
.set STATUS3_MINIMIZED, 0x100
.set STATUS3_ROOTED, 0x400
.set STATUS3_CHARGED_UP, 0x200
.set STATUS3_YAWN, 0x1800
.set STATUS3_IMPRISONED_OTHERS, 0x2000
.set STATUS3_GRUDGE, 0x4000
.set STATUS3_CANT_SCORE_A_CRIT, 0x8000
.set STATUS3_MUDSPORT, 0x10000
.set STATUS3_WATERSPORT, 0x20000
.set STATUS3_UNDERWATER, 0x40000
.set STATUS3_INTIMIDATE_POKES, 0x80000
.set STATUS3_TRACE, 0x100000
@ side status
.set SIDE_STATUS_REFLECT, 0x1
.set SIDE_STATUS_LIGHTSCREEN, 0x2
.set SIDE_STATUS_X4, 0x4
.set SIDE_STATUS_SPIKES, 0x10
.set SIDE_STATUS_SAFEGUARD, 0x20
.set SIDE_STATUS_FUTUREATTACK, 0x40
.set SIDE_STATUS_MIST, 0x100
.set SIDE_STATUS_SPIKES_DAMAGED, 0x200
@ stats
.set HP, 0x0
.set ATK, 0x1
@ -122,50 +7,3 @@
.set SPDEF, 0x5
.set ACC, 0x6
.set EVASION, 0x7
@ weather flags
.set WEATHER_RAIN_TEMPORARY, 0x01
.set WEATHER_RAIN_DOWNPOUR, 0x02
.set WEATHER_RAIN_PERMANENT, 0x04
.set WEATHER_SANDSTORM_TEMPORARY, 0x08
.set WEATHER_SANDSTORM_PERMANENT, 0x10
.set WEATHER_SUN_TEMPORARY, 0x20
.set WEATHER_SUN_PERMANENT, 0x40
.set WEATHER_HAIL, 0x80
@ hitmarker
.set HITMARKER_x10, 0x00000010
.set HITMARKER_x20, 0x00000020
.set HITMARKER_DESTINYBOND, 0x00000040
.set HITMARKER_NO_ANIMATIONS, 0x00000080
.set HITMARKER_IGNORE_SUBSTITUTE, 0x00000100
.set HITMARKER_NO_ATTACKSTRING, 0x00000200
.set HITMARKER_ATTACKSTRING_PRINTED, 0x00000400
.set HITMARKER_NO_PPDEDUCT, 0x00000800
.set HITMARKER_PURSUIT_TRAP, 0x00001000
.set HITMARKER_IGNORE_SAFEGUARD, 0x00002000
.set HITMARKER_SYNCHRONISE_EFFECT, 0x00004000
.set HITMARKER_RUN, 0x00008000
.set HITMARKER_IGNORE_ON_AIR, 0x00010000
.set HITMARKER_IGNORE_UNDERGROUND, 0x00020000
.set HITMARKER_IGNORE_UNDERWATER, 0x00040000
.set HITMARKER_UNABLE_TO_USE_MOVE, 0x00080000
.set HITMARKER_x100000, 0x00100000
.set HITMARKER_x200000, 0x00200000
.set HITMARKER_x400000, 0x00400000
.set HITMARKER_x800000, 0x00800000
.set HITMARKER_GRUDGE, 0x01000000
.set HITMARKER_OBEYS, 0x02000000
.set HITMARKER_x4000000, 0x04000000
.set HITMARKER_x8000000, 0x08000000
@ move flags
.set MOVE_RESULT_MISSED, 0x1
.set MOVE_RESULT_SUPER_EFFECTIVE, 0x2
.set MOVE_RESULT_NOT_VERY_EFFECTIVE, 0x4
.set MOVE_RESULT_DOESNT_AFFECT_FOE, 0x8
.set MOVE_RESULT_ONE_HIT_KO, 0x10
.set MOVE_RESULT_FAILED, 0x20
.set MOVE_RESULT_FOE_ENDURED, 0x40
.set MOVE_RESULT_FOE_HUNG_ON, 0x80
.set MOVE_RESULT_NO_EFFECT, (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED)

View File

@ -1,28 +1,3 @@
@ animation ids
.set ANIM_CASTFORM_CHANGE, 0x0
.set ANIM_STATS_CHANGE, 0x1
.set ANIM_SUBSTITUTE_FADE, 0x2
.set ANIM_SUBSTITUTE_APPEAR, 0x3
.set ANIM_x4, 0x4
.set ANIM_ITEM_KNOCKOFF, 0x5
.set ANIM_TURN_TRAP, 0x6
.set ANIM_ITEM_EFFECT, 0x7
.set ANIM_SMOKEBALL_ESCAPE, 0x8
.set ANIM_HANGED_ON, 0x9
.set ANIM_RAIN_CONTINUES, 0xA
.set ANIM_SUN_CONTINUES, 0xB
.set ANIM_SANDSTORM_CONTINUES, 0xC
.set ANIM_HAIL_CONTINUES, 0xD
.set ANIM_LEECH_SEED_DRAIN, 0xE
.set ANIM_MON_HIT, 0xF
.set ANIM_ITEM_STEAL, 0x10
.set ANIM_SNATCH_MOVE, 0x11
.set ANIM_FUTURE_SIGHT_HIT, 0x12
.set ANIM_DOOM_DESIRE_HIT, 0x13
.set ANIM_x14, 0x14
.set ANIM_INGRAIN_HEAL, 0x15
.set ANIM_WISH_HEAL, 0x16
@ atk 80
.set ATK80_DMG_CHANGE_SIGN, 0x0
.set ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP, 0x1
@ -36,74 +11,6 @@
.set COMMON_BITS, 0x4
.set NO_COMMON_BITS, 0x5
@ move effects
.set EFFECT_SLEEP, 0x1
.set EFFECT_POISON, 0x2
.set EFFECT_BURN, 0x3
.set EFFECT_FREEZE, 0x4
.set EFFECT_PARALYSIS, 0x5
.set EFFECT_TOXIC, 0x6
.set EFFECT_CONFUSION, 0x7
.set EFFECT_FLINCH, 0x8
.set EFFECT_TRI_ATTACK, 0x9
.set EFFECT_UPROAR, 0xA
.set EFFECT_PAYDAY, 0xB
.set EFFECT_CHARGING, 0xC
.set EFFECT_WRAP, 0xD
.set EFFECT_RECOIL_25, 0xE
.set EFFECT_ATK_PLUS_1, 0xF
.set EFFECT_DEF_PLUS_1, 0x10
.set EFFECT_SPD_PLUS_1, 0x11
.set EFFECT_SP_ATK_PLUS_1, 0x12
.set EFFECT_SP_DEF_PLUS_1, 0x13
.set EFFECT_ACC_PLUS_1, 0x14
.set EFFECT_EVS_PLUS_1, 0x15
.set EFFECT_ATK_MINUS_1, 0x16
.set EFFECT_DEF_MINUS_1, 0x17
.set EFFECT_SPD_MINUS_1, 0x18
.set EFFECT_SP_ATK_MINUS_1, 0x19
.set EFFECT_SP_DEF_MINUS_1, 0x1A
.set EFFECT_ACC_MINUS_1, 0x1B
.set EFFECT_EVS_MINUS_1, 0x1C
.set EFFECT_RECHARGE, 0x1D
.set EFFECT_RAGE, 0x1E
.set EFFECT_STEAL_ITEM, 0x1F
.set EFFECT_PREVENT_ESCAPE, 0x20
.set EFFECT_NIGHTMARE, 0x21
.set EFFECT_ALL_STATS_UP, 0x22
.set EFFECT_RAPIDSPIN, 0x23
.set EFFECT_REMOVE_PARALYSIS, 0x24
.set EFFECT_ATK_DEF_DOWN, 0x25
.set EFFECT_RECOIL_33_PARALYSIS, 0x26
.set EFFECT_ATK_PLUS_2, 0x27
.set EFFECT_DEF_PLUS_2, 0x28
.set EFFECT_SPD_PLUS_2, 0x29
.set EFFECT_SP_ATK_PLUS_2, 0x2A
.set EFFECT_SP_DEF_PLUS_2, 0x2B
.set EFFECT_ACC_PLUS_2, 0x2C
.set EFFECT_EVS_PLUS_2, 0x2D
.set EFFECT_ATK_MINUS_2, 0x2E
.set EFFECT_DEF_MINUS_2, 0x2F
.set EFFECT_SPD_MINUS_2, 0x30
.set EFFECT_SP_ATK_MINUS_2, 0x31
.set EFFECT_SP_DEF_MINUS_2, 0x32
.set EFFECT_ACC_MINUS_2, 0x33
.set EFFECT_EVS_MINUS_2, 0x34
.set EFFECT_THRASH, 0x35
.set EFFECT_KNOCK_OFF, 0x36
.set EFFECT_NOTHING_37, 0x37
.set EFFECT_NOTHING_38, 0x38
.set EFFECT_NOTHING_39, 0x39
.set EFFECT_NOTHING_3A, 0x3A
.set EFFECT_SP_ATK_TWO_DOWN, 0x3B
.set EFFECT_NOTHING_3C, 0x3C
.set EFFECT_NOTHING_3D, 0x3D
.set EFFECT_NOTHING_3E, 0x3E
.set EFFECT_NOTHING_3F, 0x3F
.set AFFECTS_USER, 0x40
.set CERTAIN, 0x80
@ accuracy calc
.set NO_ACC_CALC, 0xFFFE
.set NO_ACC_CALC_CHECK_LOCK_ON, 0xFFFF
@ -112,7 +19,7 @@
@ bank values
.set TARGET, 0x0
.set ATTACKER, 0x1
.set EFFECT_BANK, 0x2
.set MOVE_EFFECT_BANK, 0x2
.set GBANK_1, 0x3
.set ATTACKER_WITH_PARTNER, 0x4 @ only for cmd98
.set BANK0, 0x7
@ -142,15 +49,15 @@
.equiv sMULTIHIT_STRING, gBattleScripting + 8
.equiv sDMG_MULTIPLIER, gBattleScripting + 0xE
.equiv sTWOTURN_STRINGID, gBattleScripting + 0xF
.equiv sANIM_ARG1, gBattleScripting + 0x10
.equiv sANIM_ARG2, gBattleScripting + 0x11
.equiv sB_ANIM_ARG1, gBattleScripting + 0x10
.equiv sB_ANIM_ARG2, gBattleScripting + 0x11
.equiv sTRIPLE_KICK_POWER, gBattleScripting + 0x12
.equiv sMOVEEND_STATE, gBattleScripting + 0x14
.equiv sBANK_WITH_ABILITY, gBattleScripting + 0x15
.equiv sMULTIHIT_EFFECT, gBattleScripting + 0x16
.equiv sBANK, gBattleScripting + 0x17
.equiv sANIM_TURN, gBattleScripting + 0x18
.equiv sANIM_TARGETS_HIT, gBattleScripting + 0x19
.equiv sB_ANIM_TURN, gBattleScripting + 0x18
.equiv sB_ANIM_TARGETS_HIT, gBattleScripting + 0x19
.equiv sSTATCHANGER, gBattleScripting + 0x1A
.equiv sFIELD_1B, gBattleScripting + 0x1B
.equiv sGIVEEXP_STATE, gBattleScripting + 0x1C

View File

@ -1,375 +0,0 @@
.set STRINGID_INTROMSG, 0
.set STRINGID_INTROSENDOUT, 1
.set STRINGID_RETURNMON, 2
.set STRINGID_SWITCHINMON, 3
.set STRINGID_USEDMOVE, 4
.set STRINGID_BATTLEEND, 5
.set STRINGID_TRAINER1LOSETEXT, 12
.set STRINGID_PKMNGAINEDEXP, 13
.set STRINGID_PKMNGREWTOLV, 14
.set STRINGID_PKMNLEARNEDMOVE, 15
.set STRINGID_TRYTOLEARNMOVE1, 16
.set STRINGID_TRYTOLEARNMOVE2, 17
.set STRINGID_TRYTOLEARNMOVE3, 18
.set STRINGID_PKMNFORGOTMOVE, 19
.set STRINGID_STOPLEARNINGMOVE, 20
.set STRINGID_DIDNOTLEARNMOVE, 21
.set STRINGID_PKMNLEARNEDMOVE2, 22
.set STRINGID_ATTACKMISSED, 23
.set STRINGID_PKMNPROTECTEDITSELF, 24
.set STRINGID_STATSWONTINCREASE2, 25
.set STRINGID_AVOIDEDDAMAGE, 26
.set STRINGID_ITDOESNTAFFECT, 27
.set STRINGID_ATTACKERFAINTED, 28
.set STRINGID_TARGETFAINTED, 29
.set STRINGID_PLAYERGOTMONEY, 30
.set STRINGID_PLAYERWHITEOUT, 31
.set STRINGID_PLAYERWHITEOUT2, 32
.set STRINGID_PREVENTSESCAPE, 33
.set STRINGID_HITXTIMES, 34
.set STRINGID_PKMNFELLASLEEP, 35
.set STRINGID_PKMNMADESLEEP, 36
.set STRINGID_PKMNALREADYASLEEP, 37
.set STRINGID_PKMNALREADYASLEEP2, 38
.set STRINGID_PKMNWASNTAFFECTED, 39
.set STRINGID_PKMNWASPOISONED, 40
.set STRINGID_PKMNPOISONEDBY, 41
.set STRINGID_PKMNHURTBYPOISON, 42
.set STRINGID_PKMNALREADYPOISONED, 43
.set STRINGID_PKMNBADLYPOISONED, 44
.set STRINGID_PKMNENERGYDRAINED, 45
.set STRINGID_PKMNWASBURNED, 46
.set STRINGID_PKMNBURNEDBY, 47
.set STRINGID_PKMNHURTBYBURN, 48
.set STRINGID_PKMNWASFROZEN, 49
.set STRINGID_PKMNFROZENBY, 50
.set STRINGID_PKMNISFROZEN, 51
.set STRINGID_PKMNWASDEFROSTED, 52
.set STRINGID_PKMNWASDEFROSTED2, 53
.set STRINGID_PKMNWASDEFROSTEDBY, 54
.set STRINGID_PKMNWASPARALYZED, 55
.set STRINGID_PKMNWASPARALYZEDBY, 56
.set STRINGID_PKMNISPARALYZED, 57
.set STRINGID_PKMNISALREADYPARALYZED, 58
.set STRINGID_PKMNHEALEDPARALYSIS, 59
.set STRINGID_PKMNDREAMEATEN, 60
.set STRINGID_STATSWONTINCREASE, 61
.set STRINGID_STATSWONTDECREASE, 62
.set STRINGID_TEAMSTOPPEDWORKING, 63
.set STRINGID_FOESTOPPEDWORKING, 64
.set STRINGID_PKMNISCONFUSED, 65
.set STRINGID_PKMNHEALEDCONFUSION, 66
.set STRINGID_PKMNWASCONFUSED, 67
.set STRINGID_PKMNALREADYCONFUSED, 68
.set STRINGID_PKMNFELLINLOVE, 69
.set STRINGID_PKMNINLOVE, 70
.set STRINGID_PKMNIMMOBILIZEDBYLOVE, 71
.set STRINGID_PKMNBLOWNAWAY, 72
.set STRINGID_PKMNCHANGEDTYPE, 73
.set STRINGID_PKMNFLINCHED, 74
.set STRINGID_PKMNREGAINEDHEALTH, 75
.set STRINGID_PKMNHPFULL, 76
.set STRINGID_PKMNRAISEDSPDEF, 77
.set STRINGID_PKMNRAISEDDEF, 78
.set STRINGID_PKMNCOVEREDBYVEIL, 79
.set STRINGID_PKMNUSEDSAFEGUARD, 80
.set STRINGID_PKMNSAFEGUARDEXPIRED, 81
.set STRINGID_PKMNWENTTOSLEEP, 82
.set STRINGID_PKMNSLEPTHEALTHY, 83
.set STRINGID_PKMNWHIPPEDWHIRLWIND, 84
.set STRINGID_PKMNTOOKSUNLIGHT, 85
.set STRINGID_PKMNLOWEREDHEAD, 86
.set STRINGID_PKMNISGLOWING, 87
.set STRINGID_PKMNFLEWHIGH, 88
.set STRINGID_PKMNDUGHOLE, 89
.set STRINGID_PKMNSQUEEZEDBYBIND, 90
.set STRINGID_PKMNTRAPPEDINVORTEX, 91
.set STRINGID_PKMNWRAPPEDBY, 92
.set STRINGID_PKMNCLAMPED, 93
.set STRINGID_PKMNHURTBY, 94
.set STRINGID_PKMNFREEDFROM, 95
.set STRINGID_PKMNCRASHED, 96
.set STRINGID_PKMNSHROUDEDINMIST, 97
.set STRINGID_PKMNPROTECTEDBYMIST, 98
.set STRINGID_PKMNGETTINGPUMPED, 99
.set STRINGID_PKMNHITWITHRECOIL, 100
.set STRINGID_PKMNPROTECTEDITSELF2, 101
.set STRINGID_PKMNBUFFETEDBYSANDSTORM, 102
.set STRINGID_PKMNPELTEDBYHAIL, 103
.set STRINGID_PKMNSEEDED, 104
.set STRINGID_PKMNEVADEDATTACK, 105
.set STRINGID_PKMNSAPPEDBYLEECHSEED, 106
.set STRINGID_PKMNFASTASLEEP, 107
.set STRINGID_PKMNWOKEUP, 108
.set STRINGID_PKMNUPROARKEPTAWAKE, 109
.set STRINGID_PKMNWOKEUPINUPROAR, 110
.set STRINGID_PKMNCAUSEDUPROAR, 111
.set STRINGID_PKMNMAKINGUPROAR, 112
.set STRINGID_PKMNCALMEDDOWN, 113
.set STRINGID_PKMNCANTSLEEPINUPROAR, 114
.set STRINGID_PKMNSTOCKPILED, 115
.set STRINGID_PKMNCANTSTOCKPILE, 116
.set STRINGID_PKMNCANTSLEEPINUPROAR2, 117
.set STRINGID_UPROARKEPTPKMNAWAKE, 118
.set STRINGID_PKMNSTAYEDAWAKEUSING, 119
.set STRINGID_PKMNSTORINGENERGY, 120
.set STRINGID_PKMNUNLEASHEDENERGY, 121
.set STRINGID_PKMNFATIGUECONFUSION, 122
.set STRINGID_PKMNPICKEDUPITEM, 123
.set STRINGID_PKMNUNAFFECTED, 124
.set STRINGID_PKMNTRANSFORMEDINTO, 125
.set STRINGID_PKMNMADESUBSTITUTE, 126
.set STRINGID_PKMNHASSUBSTITUTE, 127
.set STRINGID_SUBSTITUTEDAMAGED, 128
.set STRINGID_PKMNSUBSTITUTEFADED, 129
.set STRINGID_PKMNMUSTRECHARGE, 130
.set STRINGID_PKMNRAGEBUILDING, 131
.set STRINGID_PKMNMOVEWASDISABLED, 132
.set STRINGID_PKMNMOVEISDISABLED, 133
.set STRINGID_PKMNMOVEDISABLEDNOMORE, 134
.set STRINGID_PKMNGOTENCORE, 135
.set STRINGID_PKMNENCOREENDED, 136
.set STRINGID_PKMNTOOKAIM, 137
.set STRINGID_PKMNSKETCHEDMOVE, 138
.set STRINGID_PKMNTRYINGTOTAKEFOE, 139
.set STRINGID_PKMNTOOKFOE, 140
.set STRINGID_PKMNREDUCEDPP, 141
.set STRINGID_PKMNSTOLEITEM, 142
.set STRINGID_TARGETCANTESCAPENOW, 143
.set STRINGID_PKMNFELLINTONIGHTMARE, 144
.set STRINGID_PKMNLOCKEDINNIGHTMARE, 145
.set STRINGID_PKMNLAIDCURSE, 146
.set STRINGID_PKMNAFFLICTEDBYCURSE, 147
.set STRINGID_SPIKESSCATTERED, 148
.set STRINGID_PKMNHURTBYSPIKES, 149
.set STRINGID_PKMNIDENTIFIED, 150
.set STRINGID_PKMNPERISHCOUNTFELL, 151
.set STRINGID_PKMNBRACEDITSELF, 152
.set STRINGID_PKMNENDUREDHIT, 153
.set STRINGID_MAGNITUDESTRENGTH, 154
.set STRINGID_PKMNCUTHPMAXEDATTACK, 155
.set STRINGID_PKMNCOPIEDSTATCHANGES, 156
.set STRINGID_PKMNGOTFREE, 157
.set STRINGID_PKMNSHEDLEECHSEED, 158
.set STRINGID_PKMNBLEWAWAYSPIKES, 159
.set STRINGID_PKMNFLEDFROMBATTLE, 160
.set STRINGID_PKMNFORESAWATTACK, 161
.set STRINGID_PKMNTOOKATTACK, 162
.set STRINGID_PKMNATTACK, 163
.set STRINGID_PKMNCENTERATTENTION, 164
.set STRINGID_PKMNCHARGINGPOWER, 165
.set STRINGID_NATUREPOWERTURNEDINTO, 166
.set STRINGID_PKMNSTATUSNORMAL, 167
.set STRINGID_PKMNHASNOMOVESLEFT, 168
.set STRINGID_PKMNSUBJECTEDTOTORMENT, 169
.set STRINGID_PKMNCANTUSEMOVETORMENT, 170
.set STRINGID_PKMNTIGHTENINGFOCUS, 171
.set STRINGID_PKMNFELLFORTAUNT, 172
.set STRINGID_PKMNCANTUSEMOVETAUNT, 173
.set STRINGID_PKMNREADYTOHELP, 174
.set STRINGID_PKMNSWITCHEDITEMS, 175
.set STRINGID_PKMNCOPIEDFOE, 176
.set STRINGID_PKMNMADEWISH, 177
.set STRINGID_PKMNWISHCAMETRUE, 178
.set STRINGID_PKMNPLANTEDROOTS, 179
.set STRINGID_PKMNABSORBEDNUTRIENTS, 180
.set STRINGID_PKMNANCHOREDITSELF, 181
.set STRINGID_PKMNWASMADEDROWSY, 182
.set STRINGID_PKMNKNOCKEDOFF, 183
.set STRINGID_PKMNSWAPPEDABILITIES, 184
.set STRINGID_PKMNSEALEDOPPONENTMOVE, 185
.set STRINGID_PKMNCANTUSEMOVESEALED, 186
.set STRINGID_PKMNWANTSGRUDGE, 187
.set STRINGID_PKMNLOSTPPGRUDGE, 188
.set STRINGID_PKMNSHROUDEDITSELF, 189
.set STRINGID_PKMNMOVEBOUNCED, 190
.set STRINGID_PKMNWAITSFORTARGET, 191
.set STRINGID_PKMNSNATCHEDMOVE, 192
.set STRINGID_PKMNMADEITRAIN, 193
.set STRINGID_PKMNRAISEDSPEED, 194
.set STRINGID_PKMNPROTECTEDBY, 195
.set STRINGID_PKMNPREVENTSUSAGE, 196
.set STRINGID_PKMNRESTOREDHPUSING, 197
.set STRINGID_PKMNCHANGEDTYPEWITH, 198
.set STRINGID_PKMNPREVENTSPARALYSISWITH, 199
.set STRINGID_PKMNPREVENTSROMANCEWITH, 200
.set STRINGID_PKMNPREVENTSPOISONINGWITH, 201
.set STRINGID_PKMNPREVENTSCONFUSIONWITH, 202
.set STRINGID_PKMNRAISEDFIREPOWERWITH, 203
.set STRINGID_PKMNANCHORSITSELFWITH, 204
.set STRINGID_PKMNCUTSATTACKWITH, 205
.set STRINGID_PKMNPREVENTSSTATLOSSWITH, 206
.set STRINGID_PKMNHURTSWITH, 207
.set STRINGID_PKMNTRACED, 208
.set STRINGID_STATSHARPLY, 209
.set STRINGID_STATROSE, 210
.set STRINGID_STATHARSHLY, 211
.set STRINGID_STATFELL, 212
.set STRINGID_PKMNSSTATCHANGED, 213
.set STRINGID_PKMNSSTATCHANGED2, 214
.set STRINGID_PKMNSSTATCHANGED3, 215
.set STRINGID_PKMNSSTATCHANGED4, 216
.set STRINGID_CRITICALHIT, 217
.set STRINGID_ONEHITKO, 218
.set STRINGID_123POOF, 219
.set STRINGID_ANDELLIPSIS, 220
.set STRINGID_NOTVERYEFFECTIVE, 221
.set STRINGID_SUPEREFFECTIVE, 222
.set STRINGID_GOTAWAYSAFELY, 223
.set STRINGID_WILDPKMNFLED, 224
.set STRINGID_NORUNNINGFROMTRAINERS, 225
.set STRINGID_CANTESCAPE, 226
.set STRINGID_DONTLEAVEBIRCH, 227
.set STRINGID_BUTNOTHINGHAPPENED, 228
.set STRINGID_BUTITFAILED, 229
.set STRINGID_ITHURTCONFUSION, 230
.set STRINGID_MIRRORMOVEFAILED, 231
.set STRINGID_STARTEDTORAIN, 232
.set STRINGID_DOWNPOURSTARTED, 233
.set STRINGID_RAINCONTINUES, 234
.set STRINGID_DOWNPOURCONTINUES, 235
.set STRINGID_RAINSTOPPED, 236
.set STRINGID_SANDSTORMBREWED, 237
.set STRINGID_SANDSTORMRAGES, 238
.set STRINGID_SANDSTORMSUBSIDED, 239
.set STRINGID_SUNLIGHTGOTBRIGHT, 240
.set STRINGID_SUNLIGHTSTRONG, 241
.set STRINGID_SUNLIGHTFADED, 242
.set STRINGID_STARTEDHAIL, 243
.set STRINGID_HAILCONTINUES, 244
.set STRINGID_HAILSTOPPED, 245
.set STRINGID_FAILEDTOSPITUP, 246
.set STRINGID_FAILEDTOSWALLOW, 247
.set STRINGID_WINDBECAMEHEATWAVE, 248
.set STRINGID_STATCHANGESGONE, 249
.set STRINGID_COINSSCATTERED, 250
.set STRINGID_TOOWEAKFORSUBSTITUTE, 251
.set STRINGID_SHAREDPAIN, 252
.set STRINGID_BELLCHIMED, 253
.set STRINGID_FAINTINTHREE, 254
.set STRINGID_NOPPLEFT, 255
.set STRINGID_BUTNOPPLEFT, 256
.set STRINGID_PLAYERUSEDITEM, 257
.set STRINGID_WALLYUSEDITEM, 258
.set STRINGID_TRAINERBLOCKEDBALL, 259
.set STRINGID_DONTBEATHIEF, 260
.set STRINGID_ITDODGEDBALL, 261
.set STRINGID_YOUMISSEDPKMN, 262
.set STRINGID_PKMNBROKEFREE, 263
.set STRINGID_ITAPPEAREDCAUGHT, 264
.set STRINGID_AARGHALMOSTHADIT, 265
.set STRINGID_SHOOTSOCLOSE, 266
.set STRINGID_GOTCHAPKMNCAUGHT, 267
.set STRINGID_GOTCHAPKMNCAUGHT2, 268
.set STRINGID_GIVENICKNAMECAPTURED, 269
.set STRINGID_PKMNSENTTOPC, 270
.set STRINGID_PKMNDATAADDEDTODEX, 271
.set STRINGID_ITISRAINING, 272
.set STRINGID_SANDSTORMISRAGING, 273
.set STRINGID_CANTESCAPE2, 274
.set STRINGID_PKMNIGNORESASLEEP, 275
.set STRINGID_PKMNIGNOREDORDERS, 276
.set STRINGID_PKMNBEGANTONAP, 277
.set STRINGID_PKMNLOAFING, 278
.set STRINGID_PKMNWONTOBEY, 279
.set STRINGID_PKMNTURNEDAWAY, 280
.set STRINGID_PKMNPRETENDNOTNOTICE, 281
.set STRINGID_ENEMYABOUTTOSWITCHPKMN, 282
.set STRINGID_CREPTCLOSER, 283
.set STRINGID_CANTGETCLOSER, 284
.set STRINGID_PKMNWATCHINGCAREFULLY, 285
.set STRINGID_PKMNCURIOUSABOUTX, 286
.set STRINGID_PKMNENTHRALLEDBYX, 287
.set STRINGID_PKMNIGNOREDX, 288
.set STRINGID_THREWPOKEBLOCKATPKMN, 289
.set STRINGID_OUTOFSAFARIBALLS, 290
.set STRINGID_PKMNSITEMCUREDPARALYSIS, 291
.set STRINGID_PKMNSITEMCUREDPOISON, 292
.set STRINGID_PKMNSITEMHEALEDBURN, 293
.set STRINGID_PKMNSITEMDEFROSTEDIT, 294
.set STRINGID_PKMNSITEMWOKEIT, 295
.set STRINGID_PKMNSITEMSNAPPEDOUT, 296
.set STRINGID_PKMNSITEMCUREDPROBLEM, 297
.set STRINGID_PKMNSITEMRESTOREDHEALTH, 298
.set STRINGID_PKMNSITEMRESTOREDPP, 299
.set STRINGID_PKMNSITEMRESTOREDSTATUS, 300
.set STRINGID_PKMNSITEMRESTOREDHPALITTLE, 301
.set STRINGID_ITEMALLOWSONLYYMOVE, 302
.set STRINGID_PKMNHUNGONWITHX, 303
.set STRINGID_EMPTYSTRING3, 304
.set STRINGID_PKMNSXPREVENTSBURNS, 305
.set STRINGID_PKMNSXBLOCKSY, 306
.set STRINGID_PKMNSXRESTOREDHPALITTLE2, 307
.set STRINGID_PKMNSXWHIPPEDUPSANDSTORM, 308
.set STRINGID_PKMNSXPREVENTSYLOSS, 309
.set STRINGID_PKMNSXINFATUATEDY, 310
.set STRINGID_PKMNSXMADEYINEFFECTIVE, 311
.set STRINGID_PKMNSXCUREDYPROBLEM, 312
.set STRINGID_ITSUCKEDLIQUIDOOZE, 313
.set STRINGID_PKMNTRANSFORMED, 314
.set STRINGID_ELECTRICITYWEAKENED, 315
.set STRINGID_FIREWEAKENED, 316
.set STRINGID_PKMNHIDUNDERWATER, 317
.set STRINGID_PKMNSPRANGUP, 318
.set STRINGID_HMMOVESCANTBEFORGOTTEN, 319
.set STRINGID_XFOUNDONEY, 320
.set STRINGID_PLAYERDEFEATEDTRAINER1, 321
.set STRINGID_SOOTHINGAROMA, 322
.set STRINGID_ITEMSCANTBEUSEDNOW, 323
.set STRINGID_FORXCOMMAYZ, 324
.set STRINGID_USINGXTHEYOFZN, 325
.set STRINGID_PKMNUSEDXTOGETPUMPED, 326
.set STRINGID_PKMNSXMADEYUSELESS, 327
.set STRINGID_PKMNTRAPPEDBYSANDTOMB, 328
.set STRINGID_EMPTYSTRING4, 329
.set STRINGID_ABOOSTED, 330
.set STRINGID_PKMNSXINTENSIFIEDSUN, 331
.set STRINGID_PKMNMAKESGROUNDMISS, 332
.set STRINGID_YOUTHROWABALLNOWRIGHT, 333
.set STRINGID_PKMNSXTOOKATTACK, 334
.set STRINGID_PKMNCHOSEXASDESTINY, 335
.set STRINGID_PKMNLOSTFOCUS, 336
.set STRINGID_USENEXTPKMN, 337
.set STRINGID_PKMNFLEDUSINGITS, 338
.set STRINGID_PKMNFLEDUSING, 339
.set STRINGID_PKMNWASDRAGGEDOUT, 340
.set STRINGID_PREVENTEDFROMWORKING, 341
.set STRINGID_PKMNSITEMNORMALIZEDSTATUS, 342
.set STRINGID_TRAINER1USEDITEM, 343
.set STRINGID_BOXISFULL, 344
.set STRINGID_PKMNAVOIDEDATTACK, 345
.set STRINGID_PKMNSXMADEITINEFFECTIVE, 346
.set STRINGID_PKMNSXPREVENTSFLINCHING, 347
.set STRINGID_PKMNALREADYHASBURN, 348
.set STRINGID_STATSWONTDECREASE2, 349
.set STRINGID_PKMNSXBLOCKSY2, 350
.set STRINGID_PKMNSXWOREOFF, 351
.set STRINGID_PKMNRAISEDDEFALITTLE, 352
.set STRINGID_PKMNRAISEDSPDEFALITTLE, 353
.set STRINGID_THEWALLSHATTERED, 354
.set STRINGID_PKMNSXPREVENTSYSZ, 355
.set STRINGID_PKMNSXCUREDITSYPROBLEM, 356
.set STRINGID_ATTACKERCANTESCAPE, 357
.set STRINGID_PKMNOBTAINEDX, 358
.set STRINGID_PKMNOBTAINEDX2, 359
.set STRINGID_PKMNOBTAINEDXYOBTAINEDZ, 360
.set STRINGID_BUTNOEFFECT, 361
.set STRINGID_PKMNSXHADNOEFFECTONY, 362
.set STRINGID_TWOENEMIESDEFEATED, 363
.set STRINGID_TRAINER2LOSETEXT, 364
.set STRINGID_PKMNINCAPABLEOFPOWER, 365
.set STRINGID_GLINTAPPEARSINEYE, 366
.set STRINGID_PKMNGETTINGINTOPOSITION, 367
.set STRINGID_PKMNBEGANGROWLINGDEEPLY, 368
.set STRINGID_PKMNEAGERFORMORE, 369
.set STRINGID_DEFEATEDOPPONENTBYREFEREE, 370
.set STRINGID_LOSTTOOPPONENTBYREFEREE, 371
.set STRINGID_TIEDOPPONENTBYREFEREE, 372
.set STRINGID_QUESTIONFORFEITMATCH, 373
.set STRINGID_FORFEITEDMATCH, 374
.set STRINGID_PKMNTRANSFERREDSOMEONESPC, 375
.set STRINGID_PKMNTRANSFERREDLANETTESPC, 376
.set STRINGID_PKMNBOXSOMEONESPCFULL, 377
.set STRINGID_PKMNBOXLANETTESPCFULL, 378
.set STRINGID_TRAINER1WINTEXT, 379
.set STRINGID_TRAINER2WINTEXT, 380

View File

@ -1,9 +1,10 @@
.include "include/constants/battle_ai.h"
.include "include/constants/abilities.h"
.include "include/constants/items.h"
.include "include/constants/moves.h"
.include "include/constants/battle_move_effects.h"
.include "include/constants/hold_effects.h"
#include "constants/battle.h"
#include "constants/battle_ai.h"
#include "constants/abilities.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/battle_move_effects.h"
#include "constants/hold_effects.h"
.include "constants/battle_constants.inc"
.include "constants/type_constants.inc"
.include "asm/macros/battle_ai_script.inc"

View File

@ -1,7 +1,7 @@
#include "constants/battle_anim.h"
#include "constants/rgb.h"
#include "constants/songs.h"
.include "asm/macros/battle_anim_script.inc"
.include "include/constants/battle_anim.h"
.section script_data, "aw", %progbits

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,6 @@
#include "constants/battle.h"
#include "constants/battle_anim.h"
#include "constants/battle_string_ids.h"
#include "constants/items.h"
#include "constants/songs.h"
.include "asm/macros.inc"
@ -5,7 +8,6 @@
.include "constants/constants.inc"
.include "constants/battle_constants.inc"
.include "constants/battle_script_constants.inc"
.include "constants/battle_text.inc"
.section script_data, "aw", %progbits
@ -81,12 +83,12 @@ BattleScript_TryNicknameCaughtMon::
BattleScript_GiveCaughtMonEnd::
givecaughtmon
BattleScript_SuccessBallThrowEnd::
setbyte gBattleOutcome, CAUGHT
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
finishturn
BattleScript_WallyBallThrow::
printstring STRINGID_GOTCHAPKMNCAUGHT2
setbyte gBattleOutcome, CAUGHT
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
finishturn
BattleScript_ShakeBallThrow::
@ -96,7 +98,7 @@ BattleScript_ShakeBallThrow::
jumpifbyte NOT_EQUAL, gNumSafariBalls, 0x0, BattleScript_ShakeBallThrowEnd
printstring STRINGID_OUTOFSAFARIBALLS
waitmessage 0x40
setbyte gBattleOutcome, OUT_OF_BALLS
setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS
BattleScript_ShakeBallThrowEnd::
finishaction
@ -172,7 +174,7 @@ BattleScript_OpponentUsesGuardSpecs::
BattleScript_RunByUsingItem::
playse SE_NIGERU
setbyte gBattleOutcome, RAN
setbyte gBattleOutcome, B_OUTCOME_RAN
finishturn
BattleScript_ActionWatchesCarefully::
@ -188,7 +190,7 @@ BattleScript_ActionGetNear::
BattleScript_ActionThrowPokeblock::
printstring STRINGID_THREWPOKEBLOCKATPKMN
waitmessage 0x40
playanimation ATTACKER, ANIM_x4, NULL
playanimation ATTACKER, B_ANIM_x4, NULL
printfromtable gSafariPokeblockResultStringIds
waitmessage 0x40
end2

View File

@ -2,6 +2,7 @@
#define GUARD_BATTLE_H
// should they be included here or included individually by every file?
#include "constants/battle.h"
#include "battle_util.h"
#include "battle_script_commands.h"
#include "battle_main.h"
@ -10,210 +11,16 @@
#include "battle_util2.h"
#include "battle_bg.h"
/*
* A battler may be in one of four positions on the field. The first bit determines
* what side the battler is on, either the player's side or the opponent's side.
* The second bit determines what flank the battler is on, either the left or right.
* Note that the opponent's flanks are drawn corresponding to their perspective, so
* their right mon appears on the left, and their left mon appears on the right.
* The battler ID is usually the same as the position, except in the case of link battles.
*
* + ------------------------- +
* | Opponent's side |
* | Right Left |
* | 3 1 |
* | |
* | Player's side |
* | Left Right |
* | 0 2 |
* ----------------------------+
* | |
* | |
* +---------------------------+
*/
#define MAX_BATTLERS_COUNT 4
#define B_POSITION_PLAYER_LEFT 0
#define B_POSITION_OPPONENT_LEFT 1
#define B_POSITION_PLAYER_RIGHT 2
#define B_POSITION_OPPONENT_RIGHT 3
// These macros can be used with either battler ID or positions to get the partner or the opposite mon
#define BATTLE_OPPOSITE(id) ((id) ^ 1)
#define BATTLE_PARTNER(id) ((id) ^ 2)
#define B_SIDE_PLAYER 0
#define B_SIDE_OPPONENT 1
#define B_FLANK_LEFT 0
#define B_FLANK_RIGHT 1
#define BIT_SIDE 1
#define BIT_FLANK 2
#define GET_BATTLER_POSITION(battler) (gBattlerPositions[battler])
#define GET_BATTLER_SIDE(battler) (GetBattlerPosition(battler) & BIT_SIDE)
#define GET_BATTLER_SIDE2(battler) (GET_BATTLER_POSITION(battler) & BIT_SIDE)
// Battle Type Flags
#define BATTLE_TYPE_DOUBLE 0x0001
#define BATTLE_TYPE_LINK 0x0002
#define BATTLE_TYPE_WILD 0x0004
#define BATTLE_TYPE_TRAINER 0x0008
#define BATTLE_TYPE_FIRST_BATTLE 0x0010
#define BATTLE_TYPE_20 0x0020
#define BATTLE_TYPE_MULTI 0x0040
#define BATTLE_TYPE_SAFARI 0x0080
#define BATTLE_TYPE_BATTLE_TOWER 0x0100
#define BATTLE_TYPE_WALLY_TUTORIAL 0x0200
#define BATTLE_TYPE_ROAMER 0x0400
#define BATTLE_TYPE_EREADER_TRAINER 0x0800
#define BATTLE_TYPE_KYOGRE_GROUDON 0x1000
#define BATTLE_TYPE_LEGENDARY 0x2000
#define BATTLE_TYPE_REGI 0x4000
#define BATTLE_TYPE_TWO_OPPONENTS 0x8000
#define BATTLE_TYPE_DOME 0x10000
#define BATTLE_TYPE_PALACE 0x20000
#define BATTLE_TYPE_ARENA 0x40000
#define BATTLE_TYPE_FACTORY 0x80000
#define BATTLE_TYPE_PIKE 0x100000
#define BATTLE_TYPE_PYRAMID 0x200000
#define BATTLE_TYPE_INGAME_PARTNER 0x400000
#define BATTLE_TYPE_x800000 0x800000
#define BATTLE_TYPE_RECORDED 0x1000000
#define BATTLE_TYPE_x2000000 0x2000000
#define BATTLE_TYPE_x4000000 0x4000000
#define BATTLE_TYPE_SECRET_BASE 0x8000000
#define BATTLE_TYPE_GROUDON 0x10000000
#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 TRAINER_OPPONENT_3FE 0x3FE
#define TRAINER_OPPONENT_C00 0xC00
#define TRAINER_OPPONENT_800 0x800
#define STEVEN_PARTNER_ID 0xC03
#define SECRET_BASE_OPPONENT 0x400
#define B_OUTCOME_WON 0x1
#define B_OUTCOME_LOST 0x2
#define B_OUTCOME_DREW 0x3
#define B_OUTCOME_RAN 0x4
#define B_OUTCOME_PLAYER_TELEPORTED 0x5
#define B_OUTCOME_POKE_FLED 0x6
#define B_OUTCOME_CAUGHT_POKE 0x7
#define B_OUTCOME_NO_SAFARI_BALLS 0x8
#define B_OUTCOME_FORFEITED 0x9
#define B_OUTCOME_POKE_TELEPORTED 0xA
#define B_OUTCOME_LINK_BATTLE_RAN 0x80
// Non-volatile status conditions
// These persist remain outside of battle and after switching out
#define STATUS1_NONE 0x0
#define STATUS1_SLEEP 0x7
#define STATUS1_POISON 0x8
#define STATUS1_BURN 0x10
#define STATUS1_FREEZE 0x20
#define STATUS1_PARALYSIS 0x40
#define STATUS1_TOXIC_POISON 0x80
#define STATUS1_TOXIC_COUNTER 0xF00
#define STATUS1_PSN_ANY (STATUS1_POISON | STATUS1_TOXIC_POISON)
#define STATUS1_ANY (STATUS1_SLEEP | STATUS1_POISON | STATUS1_BURN | STATUS1_FREEZE | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)
// Volatile status ailments
// These are removed after exiting the battle or switching out
#define STATUS2_CONFUSION 0x00000007
#define STATUS2_FLINCHED 0x00000008
#define STATUS2_UPROAR 0x00000070
#define STATUS2_BIDE 0x00000300 // two bits 0x100, 0x200
#define STATUS2_LOCK_CONFUSE 0x00000C00
#define STATUS2_MULTIPLETURNS 0x00001000
#define STATUS2_WRAPPED 0x0000E000
#define STATUS2_INFATUATION 0x000F0000 // 4 bits, one for every battler
#define STATUS2_INFATUATED_WITH(battler) (gBitTable[battler] << 16)
#define STATUS2_FOCUS_ENERGY 0x00100000
#define STATUS2_TRANSFORMED 0x00200000
#define STATUS2_RECHARGE 0x00400000
#define STATUS2_RAGE 0x00800000
#define STATUS2_SUBSTITUTE 0x01000000
#define STATUS2_DESTINY_BOND 0x02000000
#define STATUS2_ESCAPE_PREVENTION 0x04000000
#define STATUS2_NIGHTMARE 0x08000000
#define STATUS2_CURSED 0x10000000
#define STATUS2_FORESIGHT 0x20000000
#define STATUS2_DEFENSE_CURL 0x40000000
#define STATUS2_TORMENT 0x80000000
// Seems like per-battler statuses. Not quite sure how to categorize these
#define STATUS3_LEECHSEED_BANK 0x3
#define STATUS3_LEECHSEED 0x4
#define STATUS3_ALWAYS_HITS 0x18 // two bits
#define STATUS3_PERISH_SONG 0x20
#define STATUS3_ON_AIR 0x40
#define STATUS3_UNDERGROUND 0x80
#define STATUS3_MINIMIZED 0x100
#define STATUS3_ROOTED 0x400
#define STATUS3_CHARGED_UP 0x200
#define STATUS3_YAWN 0x1800 // two bits
#define STATUS3_IMPRISONED_OTHERS 0x2000
#define STATUS3_GRUDGE 0x4000
#define STATUS3_CANT_SCORE_A_CRIT 0x8000
#define STATUS3_MUDSPORT 0x10000
#define STATUS3_WATERSPORT 0x20000
#define STATUS3_UNDERWATER 0x40000
#define STATUS3_INTIMIDATE_POKES 0x80000
#define STATUS3_TRACE 0x100000
#define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER)
// Not really sure what a "hitmarker" is.
#define HITMARKER_x10 0x00000010
#define HITMARKER_x20 0x00000020
#define HITMARKER_DESTINYBOND 0x00000040
#define HITMARKER_NO_ANIMATIONS 0x00000080
#define HITMARKER_IGNORE_SUBSTITUTE 0x00000100
#define HITMARKER_NO_ATTACKSTRING 0x00000200
#define HITMARKER_ATTACKSTRING_PRINTED 0x00000400
#define HITMARKER_NO_PPDEDUCT 0x00000800
#define HITMARKER_PURSUIT_TRAP 0x00001000
#define HITMARKER_IGNORE_SAFEGUARD 0x00002000
#define HITMARKER_SYNCHRONISE_EFFECT 0x00004000
#define HITMARKER_RUN 0x00008000
#define HITMARKER_IGNORE_ON_AIR 0x00010000
#define HITMARKER_IGNORE_UNDERGROUND 0x00020000
#define HITMARKER_IGNORE_UNDERWATER 0x00040000
#define HITMARKER_UNABLE_TO_USE_MOVE 0x00080000
#define HITMARKER_x100000 0x00100000
#define HITMARKER_x200000 0x00200000
#define HITMARKER_x400000 0x00400000
#define HITMARKER_x800000 0x00800000
#define HITMARKER_GRUDGE 0x01000000
#define HITMARKER_OBEYS 0x02000000
#define HITMARKER_x4000000 0x04000000
#define HITMARKER_x8000000 0x08000000
#define HITMARKER_FAINTED(battler) (gBitTable[battler] << 0x1C)
#define HITMARKER_UNK(battler) (0x10000000 << battler)
// Per-side statuses that affect an entire party
#define SIDE_STATUS_REFLECT (1 << 0)
#define SIDE_STATUS_LIGHTSCREEN (1 << 1)
#define SIDE_STATUS_X4 (1 << 2)
#define SIDE_STATUS_SPIKES (1 << 4)
#define SIDE_STATUS_SAFEGUARD (1 << 5)
#define SIDE_STATUS_FUTUREATTACK (1 << 6)
#define SIDE_STATUS_MIST (1 << 8)
#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9)
// Battle Actions
// These determine what each battler will do in a turn
#define B_ACTION_USE_MOVE 0
@ -233,36 +40,9 @@
#define B_ACTION_NOTHING_FAINTED 13 // when choosing an action
#define B_ACTION_NONE 0xFF
#define MOVE_RESULT_MISSED (1 << 0)
#define MOVE_RESULT_SUPER_EFFECTIVE (1 << 1)
#define MOVE_RESULT_NOT_VERY_EFFECTIVE (1 << 2)
#define MOVE_RESULT_DOESNT_AFFECT_FOE (1 << 3)
#define MOVE_RESULT_ONE_HIT_KO (1 << 4)
#define MOVE_RESULT_FAILED (1 << 5)
#define MOVE_RESULT_FOE_ENDURED (1 << 6)
#define MOVE_RESULT_FOE_HUNG_ON (1 << 7)
#define MOVE_RESULT_NO_EFFECT (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED)
#define MAX_TRAINER_ITEMS 4
#define MAX_MON_MOVES 4
// Battle Weather flags
#define WEATHER_RAIN_TEMPORARY (1 << 0)
#define WEATHER_RAIN_DOWNPOUR (1 << 1) // unused
#define WEATHER_RAIN_PERMANENT (1 << 2)
#define WEATHER_RAIN_ANY (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT)
#define WEATHER_SANDSTORM_TEMPORARY (1 << 3)
#define WEATHER_SANDSTORM_PERMANENT (1 << 4)
#define WEATHER_SANDSTORM_ANY (WEATHER_SANDSTORM_TEMPORARY | WEATHER_SANDSTORM_PERMANENT)
#define WEATHER_SUN_TEMPORARY (1 << 5)
#define WEATHER_SUN_PERMANENT (1 << 6)
#define WEATHER_SUN_ANY (WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT)
#define WEATHER_HAIL (1 << 7)
#define WEATHER_HAIL_ANY (WEATHER_HAIL)
#define WEATHER_ANY (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)
#define BATTLE_TERRAIN_GRASS 0
#define BATTLE_TERRAIN_LONG_GRASS 1
#define BATTLE_TERRAIN_SAND 2
@ -274,7 +54,6 @@
#define BATTLE_TERRAIN_BUILDING 8
#define BATTLE_TERRAIN_PLAIN 9
// array entries for battle communication
#define MULTIUSE_STATE 0x0
#define CURSOR_POSITION 0x1
@ -732,72 +511,6 @@ struct BattleStruct
typeArg = gBattleMoves[move].type; \
}
#define MOVE_EFFECT_SLEEP 0x1
#define MOVE_EFFECT_POISON 0x2
#define MOVE_EFFECT_BURN 0x3
#define MOVE_EFFECT_FREEZE 0x4
#define MOVE_EFFECT_PARALYSIS 0x5
#define MOVE_EFFECT_TOXIC 0x6
#define MOVE_EFFECT_CONFUSION 0x7
#define MOVE_EFFECT_FLINCH 0x8
#define MOVE_EFFECT_TRI_ATTACK 0x9
#define MOVE_EFFECT_UPROAR 0xA
#define MOVE_EFFECT_PAYDAY 0xB
#define MOVE_EFFECT_CHARGING 0xC
#define MOVE_EFFECT_WRAP 0xD
#define MOVE_EFFECT_RECOIL_25 0xE
#define MOVE_EFFECT_ATK_PLUS_1 0xF
#define MOVE_EFFECT_DEF_PLUS_1 0x10
#define MOVE_EFFECT_SPD_PLUS_1 0x11
#define MOVE_EFFECT_SP_ATK_PLUS_1 0x12
#define MOVE_EFFECT_SP_DEF_PLUS_1 0x13
#define MOVE_EFFECT_ACC_PLUS_1 0x14
#define MOVE_EFFECT_EVS_PLUS_1 0x15
#define MOVE_EFFECT_ATK_MINUS_1 0x16
#define MOVE_EFFECT_DEF_MINUS_1 0x17
#define MOVE_EFFECT_SPD_MINUS_1 0x18
#define MOVE_EFFECT_SP_ATK_MINUS_1 0x19
#define MOVE_EFFECT_SP_DEF_MINUS_1 0x1A
#define MOVE_EFFECT_ACC_MINUS_1 0x1B
#define MOVE_EFFECT_EVS_MINUS_1 0x1C
#define MOVE_EFFECT_RECHARGE 0x1D
#define MOVE_EFFECT_RAGE 0x1E
#define MOVE_EFFECT_STEAL_ITEM 0x1F
#define MOVE_EFFECT_PREVENT_ESCAPE 0x20
#define MOVE_EFFECT_NIGHTMARE 0x21
#define MOVE_EFFECT_ALL_STATS_UP 0x22
#define MOVE_EFFECT_RAPIDSPIN 0x23
#define MOVE_EFFECT_REMOVE_PARALYSIS 0x24
#define MOVE_EFFECT_ATK_DEF_DOWN 0x25
#define MOVE_EFFECT_RECOIL_33_PARALYSIS 0x26
#define MOVE_EFFECT_ATK_PLUS_2 0x27
#define MOVE_EFFECT_DEF_PLUS_2 0x28
#define MOVE_EFFECT_SPD_PLUS_2 0x29
#define MOVE_EFFECT_SP_ATK_PLUS_2 0x2A
#define MOVE_EFFECT_SP_DEF_PLUS_2 0x2B
#define MOVE_EFFECT_ACC_PLUS_2 0x2C
#define MOVE_EFFECT_EVS_PLUS_2 0x2D
#define MOVE_EFFECT_ATK_MINUS_2 0x2E
#define MOVE_EFFECT_DEF_MINUS_2 0x2F
#define MOVE_EFFECT_SPD_MINUS_2 0x30
#define MOVE_EFFECT_SP_ATK_MINUS_2 0x31
#define MOVE_EFFECT_SP_DEF_MINUS_2 0x32
#define MOVE_EFFECT_ACC_MINUS_2 0x33
#define MOVE_EFFECT_EVS_MINUS_2 0x34
#define MOVE_EFFECT_THRASH 0x35
#define MOVE_EFFECT_KNOCK_OFF 0x36
#define MOVE_EFFECT_NOTHING_37 0x37
#define MOVE_EFFECT_NOTHING_38 0x38
#define MOVE_EFFECT_NOTHING_39 0x39
#define MOVE_EFFECT_NOTHING_3A 0x3A
#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B
#define MOVE_EFFECT_NOTHING_3C 0x3C
#define MOVE_EFFECT_NOTHING_3D 0x3D
#define MOVE_EFFECT_NOTHING_3E 0x3E
#define MOVE_EFFECT_NOTHING_3F 0x3F
#define MOVE_EFFECT_AFFECTS_USER 0x40
#define MOVE_EFFECT_CERTAIN 0x80
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
#define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit

284
include/constants/battle.h Normal file
View File

@ -0,0 +1,284 @@
#ifndef GUARD_CONSTANTS_BATTLE_H
#define GUARD_CONSTANTS_BATTLE_H
/*
* A battler may be in one of four positions on the field. The first bit determines
* what side the battler is on, either the player's side or the opponent's side.
* The second bit determines what flank the battler is on, either the left or right.
* Note that the opponent's flanks are drawn corresponding to their perspective, so
* their right mon appears on the left, and their left mon appears on the right.
* The battler ID is usually the same as the position, except in the case of link battles.
*
* + ------------------------- +
* | Opponent's side |
* | Right Left |
* | 3 1 |
* | |
* | Player's side |
* | Left Right |
* | 0 2 |
* ----------------------------+
* | |
* | |
* +---------------------------+
*/
#define MAX_BATTLERS_COUNT 4
#define B_POSITION_PLAYER_LEFT 0
#define B_POSITION_OPPONENT_LEFT 1
#define B_POSITION_PLAYER_RIGHT 2
#define B_POSITION_OPPONENT_RIGHT 3
// These macros can be used with either battler ID or positions to get the partner or the opposite mon
#define BATTLE_OPPOSITE(id) ((id) ^ 1)
#define BATTLE_PARTNER(id) ((id) ^ 2)
#define B_SIDE_PLAYER 0
#define B_SIDE_OPPONENT 1
#define B_FLANK_LEFT 0
#define B_FLANK_RIGHT 1
#define BIT_SIDE 1
#define BIT_FLANK 2
// Battle Type Flags
#define BATTLE_TYPE_DOUBLE 0x0001
#define BATTLE_TYPE_LINK 0x0002
#define BATTLE_TYPE_WILD 0x0004
#define BATTLE_TYPE_TRAINER 0x0008
#define BATTLE_TYPE_FIRST_BATTLE 0x0010
#define BATTLE_TYPE_20 0x0020
#define BATTLE_TYPE_MULTI 0x0040
#define BATTLE_TYPE_SAFARI 0x0080
#define BATTLE_TYPE_BATTLE_TOWER 0x0100
#define BATTLE_TYPE_WALLY_TUTORIAL 0x0200
#define BATTLE_TYPE_ROAMER 0x0400
#define BATTLE_TYPE_EREADER_TRAINER 0x0800
#define BATTLE_TYPE_KYOGRE_GROUDON 0x1000
#define BATTLE_TYPE_LEGENDARY 0x2000
#define BATTLE_TYPE_REGI 0x4000
#define BATTLE_TYPE_TWO_OPPONENTS 0x8000
#define BATTLE_TYPE_DOME 0x10000
#define BATTLE_TYPE_PALACE 0x20000
#define BATTLE_TYPE_ARENA 0x40000
#define BATTLE_TYPE_FACTORY 0x80000
#define BATTLE_TYPE_PIKE 0x100000
#define BATTLE_TYPE_PYRAMID 0x200000
#define BATTLE_TYPE_INGAME_PARTNER 0x400000
#define BATTLE_TYPE_x800000 0x800000
#define BATTLE_TYPE_RECORDED 0x1000000
#define BATTLE_TYPE_x2000000 0x2000000
#define BATTLE_TYPE_x4000000 0x4000000
#define BATTLE_TYPE_SECRET_BASE 0x8000000
#define BATTLE_TYPE_GROUDON 0x10000000
#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)
// Battle Outcome defines
#define B_OUTCOME_WON 0x1
#define B_OUTCOME_LOST 0x2
#define B_OUTCOME_DREW 0x3
#define B_OUTCOME_RAN 0x4
#define B_OUTCOME_PLAYER_TELEPORTED 0x5
#define B_OUTCOME_MON_FLED 0x6
#define B_OUTCOME_CAUGHT 0x7
#define B_OUTCOME_NO_SAFARI_BALLS 0x8
#define B_OUTCOME_FORFEITED 0x9
#define B_OUTCOME_MON_TELEPORTED 0xA
#define B_OUTCOME_LINK_BATTLE_RAN 0x80
// Non-volatile status conditions
// These persist remain outside of battle and after switching out
#define STATUS1_NONE 0x0
#define STATUS1_SLEEP 0x7
#define STATUS1_POISON 0x8
#define STATUS1_BURN 0x10
#define STATUS1_FREEZE 0x20
#define STATUS1_PARALYSIS 0x40
#define STATUS1_TOXIC_POISON 0x80
#define STATUS1_TOXIC_COUNTER 0xF00
#define STATUS1_PSN_ANY (STATUS1_POISON | STATUS1_TOXIC_POISON)
#define STATUS1_ANY (STATUS1_SLEEP | STATUS1_POISON | STATUS1_BURN | STATUS1_FREEZE | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)
// Volatile status ailments
// These are removed after exiting the battle or switching out
#define STATUS2_CONFUSION 0x00000007
#define STATUS2_FLINCHED 0x00000008
#define STATUS2_UPROAR 0x00000070
#define STATUS2_BIDE 0x00000300 // two bits 0x100, 0x200
#define STATUS2_LOCK_CONFUSE 0x00000C00
#define STATUS2_MULTIPLETURNS 0x00001000
#define STATUS2_WRAPPED 0x0000E000
#define STATUS2_INFATUATION 0x000F0000 // 4 bits, one for every battler
#define STATUS2_INFATUATED_WITH(battler) (gBitTable[battler] << 16)
#define STATUS2_FOCUS_ENERGY 0x00100000
#define STATUS2_TRANSFORMED 0x00200000
#define STATUS2_RECHARGE 0x00400000
#define STATUS2_RAGE 0x00800000
#define STATUS2_SUBSTITUTE 0x01000000
#define STATUS2_DESTINY_BOND 0x02000000
#define STATUS2_ESCAPE_PREVENTION 0x04000000
#define STATUS2_NIGHTMARE 0x08000000
#define STATUS2_CURSED 0x10000000
#define STATUS2_FORESIGHT 0x20000000
#define STATUS2_DEFENSE_CURL 0x40000000
#define STATUS2_TORMENT 0x80000000
// Seems like per-battler statuses. Not quite sure how to categorize these
#define STATUS3_LEECHSEED_BANK 0x3
#define STATUS3_LEECHSEED 0x4
#define STATUS3_ALWAYS_HITS 0x18 // two bits
#define STATUS3_PERISH_SONG 0x20
#define STATUS3_ON_AIR 0x40
#define STATUS3_UNDERGROUND 0x80
#define STATUS3_MINIMIZED 0x100
#define STATUS3_ROOTED 0x400
#define STATUS3_CHARGED_UP 0x200
#define STATUS3_YAWN 0x1800 // two bits
#define STATUS3_IMPRISONED_OTHERS 0x2000
#define STATUS3_GRUDGE 0x4000
#define STATUS3_CANT_SCORE_A_CRIT 0x8000
#define STATUS3_MUDSPORT 0x10000
#define STATUS3_WATERSPORT 0x20000
#define STATUS3_UNDERWATER 0x40000
#define STATUS3_INTIMIDATE_POKES 0x80000
#define STATUS3_TRACE 0x100000
#define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER)
// Not really sure what a "hitmarker" is.
#define HITMARKER_x10 0x00000010
#define HITMARKER_x20 0x00000020
#define HITMARKER_DESTINYBOND 0x00000040
#define HITMARKER_NO_ANIMATIONS 0x00000080
#define HITMARKER_IGNORE_SUBSTITUTE 0x00000100
#define HITMARKER_NO_ATTACKSTRING 0x00000200
#define HITMARKER_ATTACKSTRING_PRINTED 0x00000400
#define HITMARKER_NO_PPDEDUCT 0x00000800
#define HITMARKER_PURSUIT_TRAP 0x00001000
#define HITMARKER_IGNORE_SAFEGUARD 0x00002000
#define HITMARKER_SYNCHRONISE_EFFECT 0x00004000
#define HITMARKER_RUN 0x00008000
#define HITMARKER_IGNORE_ON_AIR 0x00010000
#define HITMARKER_IGNORE_UNDERGROUND 0x00020000
#define HITMARKER_IGNORE_UNDERWATER 0x00040000
#define HITMARKER_UNABLE_TO_USE_MOVE 0x00080000
#define HITMARKER_x100000 0x00100000
#define HITMARKER_x200000 0x00200000
#define HITMARKER_x400000 0x00400000
#define HITMARKER_x800000 0x00800000
#define HITMARKER_GRUDGE 0x01000000
#define HITMARKER_OBEYS 0x02000000
#define HITMARKER_x4000000 0x04000000
#define HITMARKER_x8000000 0x08000000
#define HITMARKER_FAINTED(battler) (gBitTable[battler] << 0x1C)
#define HITMARKER_UNK(battler) (0x10000000 << battler)
// Per-side statuses that affect an entire party
#define SIDE_STATUS_REFLECT (1 << 0)
#define SIDE_STATUS_LIGHTSCREEN (1 << 1)
#define SIDE_STATUS_X4 (1 << 2)
#define SIDE_STATUS_SPIKES (1 << 4)
#define SIDE_STATUS_SAFEGUARD (1 << 5)
#define SIDE_STATUS_FUTUREATTACK (1 << 6)
#define SIDE_STATUS_MIST (1 << 8)
#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9)
// Flags describing move's result
#define MOVE_RESULT_MISSED (1 << 0)
#define MOVE_RESULT_SUPER_EFFECTIVE (1 << 1)
#define MOVE_RESULT_NOT_VERY_EFFECTIVE (1 << 2)
#define MOVE_RESULT_DOESNT_AFFECT_FOE (1 << 3)
#define MOVE_RESULT_ONE_HIT_KO (1 << 4)
#define MOVE_RESULT_FAILED (1 << 5)
#define MOVE_RESULT_FOE_ENDURED (1 << 6)
#define MOVE_RESULT_FOE_HUNG_ON (1 << 7)
#define MOVE_RESULT_NO_EFFECT (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED)
// Battle Weather flags
#define WEATHER_RAIN_TEMPORARY (1 << 0)
#define WEATHER_RAIN_DOWNPOUR (1 << 1) // unused
#define WEATHER_RAIN_PERMANENT (1 << 2)
#define WEATHER_RAIN_ANY (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT)
#define WEATHER_SANDSTORM_TEMPORARY (1 << 3)
#define WEATHER_SANDSTORM_PERMANENT (1 << 4)
#define WEATHER_SANDSTORM_ANY (WEATHER_SANDSTORM_TEMPORARY | WEATHER_SANDSTORM_PERMANENT)
#define WEATHER_SUN_TEMPORARY (1 << 5)
#define WEATHER_SUN_PERMANENT (1 << 6)
#define WEATHER_SUN_ANY (WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT)
#define WEATHER_HAIL (1 << 7)
#define WEATHER_HAIL_ANY (WEATHER_HAIL)
#define WEATHER_ANY (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)
// Move Effects
#define MOVE_EFFECT_SLEEP 0x1
#define MOVE_EFFECT_POISON 0x2
#define MOVE_EFFECT_BURN 0x3
#define MOVE_EFFECT_FREEZE 0x4
#define MOVE_EFFECT_PARALYSIS 0x5
#define MOVE_EFFECT_TOXIC 0x6
#define MOVE_EFFECT_CONFUSION 0x7
#define MOVE_EFFECT_FLINCH 0x8
#define MOVE_EFFECT_TRI_ATTACK 0x9
#define MOVE_EFFECT_UPROAR 0xA
#define MOVE_EFFECT_PAYDAY 0xB
#define MOVE_EFFECT_CHARGING 0xC
#define MOVE_EFFECT_WRAP 0xD
#define MOVE_EFFECT_RECOIL_25 0xE
#define MOVE_EFFECT_ATK_PLUS_1 0xF
#define MOVE_EFFECT_DEF_PLUS_1 0x10
#define MOVE_EFFECT_SPD_PLUS_1 0x11
#define MOVE_EFFECT_SP_ATK_PLUS_1 0x12
#define MOVE_EFFECT_SP_DEF_PLUS_1 0x13
#define MOVE_EFFECT_ACC_PLUS_1 0x14
#define MOVE_EFFECT_EVS_PLUS_1 0x15
#define MOVE_EFFECT_ATK_MINUS_1 0x16
#define MOVE_EFFECT_DEF_MINUS_1 0x17
#define MOVE_EFFECT_SPD_MINUS_1 0x18
#define MOVE_EFFECT_SP_ATK_MINUS_1 0x19
#define MOVE_EFFECT_SP_DEF_MINUS_1 0x1A
#define MOVE_EFFECT_ACC_MINUS_1 0x1B
#define MOVE_EFFECT_EVS_MINUS_1 0x1C
#define MOVE_EFFECT_RECHARGE 0x1D
#define MOVE_EFFECT_RAGE 0x1E
#define MOVE_EFFECT_STEAL_ITEM 0x1F
#define MOVE_EFFECT_PREVENT_ESCAPE 0x20
#define MOVE_EFFECT_NIGHTMARE 0x21
#define MOVE_EFFECT_ALL_STATS_UP 0x22
#define MOVE_EFFECT_RAPIDSPIN 0x23
#define MOVE_EFFECT_REMOVE_PARALYSIS 0x24
#define MOVE_EFFECT_ATK_DEF_DOWN 0x25
#define MOVE_EFFECT_RECOIL_33_PARALYSIS 0x26
#define MOVE_EFFECT_ATK_PLUS_2 0x27
#define MOVE_EFFECT_DEF_PLUS_2 0x28
#define MOVE_EFFECT_SPD_PLUS_2 0x29
#define MOVE_EFFECT_SP_ATK_PLUS_2 0x2A
#define MOVE_EFFECT_SP_DEF_PLUS_2 0x2B
#define MOVE_EFFECT_ACC_PLUS_2 0x2C
#define MOVE_EFFECT_EVS_PLUS_2 0x2D
#define MOVE_EFFECT_ATK_MINUS_2 0x2E
#define MOVE_EFFECT_DEF_MINUS_2 0x2F
#define MOVE_EFFECT_SPD_MINUS_2 0x30
#define MOVE_EFFECT_SP_ATK_MINUS_2 0x31
#define MOVE_EFFECT_SP_DEF_MINUS_2 0x32
#define MOVE_EFFECT_ACC_MINUS_2 0x33
#define MOVE_EFFECT_EVS_MINUS_2 0x34
#define MOVE_EFFECT_THRASH 0x35
#define MOVE_EFFECT_KNOCK_OFF 0x36
#define MOVE_EFFECT_NOTHING_37 0x37
#define MOVE_EFFECT_NOTHING_38 0x38
#define MOVE_EFFECT_NOTHING_39 0x39
#define MOVE_EFFECT_NOTHING_3A 0x3A
#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B
#define MOVE_EFFECT_NOTHING_3C 0x3C
#define MOVE_EFFECT_NOTHING_3D 0x3D
#define MOVE_EFFECT_NOTHING_3E 0x3E
#define MOVE_EFFECT_NOTHING_3F 0x3F
#define MOVE_EFFECT_AFFECTS_USER 0x40
#define MOVE_EFFECT_CERTAIN 0x80
#endif // GUARD_CONSTANTS_BATTLE_H

View File

@ -1,5 +1,5 @@
#ifndef GUARD_BATTLE_AI_H
#define GUARD_BATTLE_AI_H
#ifndef GUARD_CONSTANTS_BATTLE_AI_H
#define GUARD_CONSTANTS_BATTLE_AI_H
// battlers
#define AI_TARGET 0
@ -49,4 +49,4 @@
#define AI_SCRIPT_SAFARI (1 << 30)
#define AI_SCRIPT_FIRST_BATTLE (1 << 31)
#endif // GUARD_BATTLE_AI_H
#endif // GUARD_CONSTANTS_BATTLE_AI_H

View File

@ -1,5 +1,5 @@
#ifndef GUARD_BATTLE_STRING_IDS_H
#define GUARD_BATTLE_STRING_IDS_H
#ifndef GUARD_CONSTANTS_BATTLE_STRING_IDS_H
#define GUARD_CONSTANTS_BATTLE_STRING_IDS_H
#define BATTLESTRINGS_COUNT 369
@ -12,7 +12,6 @@
#define STRINGID_USEDMOVE 4
#define STRINGID_BATTLEEND 5
// todo: make some of those names less vague: attacker/target vs pkmn, etc.
#define STRINGID_TRAINER1LOSETEXT 12
#define STRINGID_PKMNGAINEDEXP 13
@ -384,4 +383,4 @@
#define STRINGID_TRAINER1WINTEXT 379
#define STRINGID_TRAINER2WINTEXT 380
#endif // GUARD_BATTLE_STRING_IDS_H
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H

View File

@ -43,7 +43,7 @@
#include "roamer.h"
#include "tv.h"
#include "safari_zone.h"
#include "battle_string_ids.h"
#include "constants/battle_string_ids.h"
#include "data2.h"
#include "decompress.h"
@ -330,11 +330,11 @@ static void (* const sEndTurnFuncsTable[])(void) =
HandleEndTurn_BattleLost, // B_OUTCOME_DREW
HandleEndTurn_RanFromBattle, // B_OUTCOME_RAN
HandleEndTurn_FinishBattle, // B_OUTCOME_PLAYER_TELEPORTED
HandleEndTurn_MonFled, // B_OUTCOME_POKE_FLED
HandleEndTurn_FinishBattle, // B_OUTCOME_CAUGHT_POKE
HandleEndTurn_MonFled, // B_OUTCOME_MON_FLED
HandleEndTurn_FinishBattle, // B_OUTCOME_CAUGHT
HandleEndTurn_FinishBattle, // battle outcome 8
HandleEndTurn_FinishBattle, // B_OUTCOME_FORFEITED
HandleEndTurn_FinishBattle, // B_OUTCOME_POKE_TELEPORTED
HandleEndTurn_FinishBattle, // B_OUTCOME_MON_TELEPORTED
};
const u8 gStatusConditionString_PoisonJpn[8] = _("どく$$$$$");
@ -5025,7 +5025,7 @@ static void ReturnFromBattleToOverworld(void)
if (gBattleTypeFlags & BATTLE_TYPE_ROAMER)
{
UpdateRoamerHPStatus(&gEnemyParty[0]);
if ((gBattleOutcome & B_OUTCOME_WON) || gBattleOutcome == B_OUTCOME_CAUGHT_POKE)
if ((gBattleOutcome & B_OUTCOME_WON) || gBattleOutcome == B_OUTCOME_CAUGHT)
SetRoamerInactive();
}
@ -5496,7 +5496,7 @@ static void HandleAction_Run(void)
else
{
gCurrentTurnActionNumber = gBattlersCount;
gBattleOutcome = B_OUTCOME_POKE_FLED;
gBattleOutcome = B_OUTCOME_MON_FLED;
}
}
}

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "battle.h"
#include "battle_message.h"
#include "battle_string_ids.h"
#include "constants/battle_string_ids.h"
#include "constants/moves.h"
#include "text.h"
#include "string_util.h"

View File

@ -38,7 +38,7 @@
#include "pokemon_storage_system.h"
#include "task.h"
#include "naming_screen.h"
#include "battle_string_ids.h"
#include "constants/battle_string_ids.h"
#include "battle_setup.h"
#include "overworld.h"
@ -7053,7 +7053,7 @@ static void atk76_various(void)
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED;
else
gBattleOutcome = B_OUTCOME_POKE_TELEPORTED;
gBattleOutcome = B_OUTCOME_MON_TELEPORTED;
break;
case VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC:
BtlController_EmitPlayFanfareOrBGM(0, MUS_KACHI1, TRUE);

View File

@ -993,8 +993,8 @@ static bool32 IsPlayerDefeated(u32 battleOutcome)
case B_OUTCOME_WON:
case B_OUTCOME_RAN:
case B_OUTCOME_PLAYER_TELEPORTED:
case B_OUTCOME_POKE_FLED:
case B_OUTCOME_CAUGHT_POKE:
case B_OUTCOME_MON_FLED:
case B_OUTCOME_CAUGHT:
return FALSE;
default:
return FALSE;

View File

@ -15,7 +15,7 @@
#include "text.h"
#include "string_util.h"
#include "battle_message.h"
#include "battle_string_ids.h"
#include "constants/battle_string_ids.h"
#include "battle_ai_script_commands.h"
#include "battle_controllers.h"
#include "event_data.h"

View File

@ -21,7 +21,7 @@
#include "constants/songs.h"
#include "overworld.h"
#include "battle_message.h"
#include "battle_string_ids.h"
#include "constants/battle_string_ids.h"
#include "gpu_regs.h"
#include "bg.h"
#include "link.h"

View File

@ -108,7 +108,7 @@ void SafariZoneRetirePrompt(void)
void CB2_EndSafariBattle(void)
{
sSafariZoneFleedMons += gBattleResults.field_1F;
if (gBattleOutcome == B_OUTCOME_CAUGHT_POKE)
if (gBattleOutcome == B_OUTCOME_CAUGHT)
sSafariZoneCaughtMons++;
if (gNumSafariBalls != 0)
{
@ -121,7 +121,7 @@ void CB2_EndSafariBattle(void)
gFieldCallback = sub_80AF6F0;
SetMainCallback2(c2_load_new_map);
}
else if (gBattleOutcome == B_OUTCOME_CAUGHT_POKE)
else if (gBattleOutcome == B_OUTCOME_CAUGHT)
{
ScriptContext1_SetupScript(EventScript_2A4B9B);
ScriptContext1_Stop();

View File

@ -1208,7 +1208,7 @@ void PutPokemonTodayFailedOnTheAir(void)
{
ct = 0xFF;
}
if (ct > 2 && (gBattleOutcome == B_OUTCOME_POKE_FLED || gBattleOutcome == B_OUTCOME_WON))
if (ct > 2 && (gBattleOutcome == B_OUTCOME_MON_FLED || gBattleOutcome == B_OUTCOME_WON))
{
sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows);
if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_POKEMON_TODAY_FAILED, FALSE) != TRUE)
@ -2406,7 +2406,7 @@ void sub_80EE184(void)
case B_OUTCOME_DREW:
show->breakingNews.kind = TVSHOW_OFF_AIR;
return;
case B_OUTCOME_CAUGHT_POKE:
case B_OUTCOME_CAUGHT:
show->breakingNews.outcome = 0;
break;
case B_OUTCOME_WON:
@ -2417,8 +2417,8 @@ void sub_80EE184(void)
case B_OUTCOME_NO_SAFARI_BALLS:
show->breakingNews.outcome = 2;
break;
case B_OUTCOME_POKE_FLED:
case B_OUTCOME_POKE_TELEPORTED:
case B_OUTCOME_MON_FLED:
case B_OUTCOME_MON_TELEPORTED:
show->breakingNews.outcome = 3;
break;
}