pokemon and battle constants
This commit is contained in:
@@ -50069,7 +50069,7 @@ sub_8117E94: @ 8117E94
|
||||
ldrb r1, [r1]
|
||||
strb r1, [r2]
|
||||
ldr r2, =gBattleAnimTarget
|
||||
ldr r1, =gEffectBank
|
||||
ldr r1, =gEffectBattler
|
||||
ldrb r1, [r1]
|
||||
strb r1, [r2]
|
||||
bl DestroyAnimVisualTask
|
||||
@@ -50136,7 +50136,7 @@ sub_8117F30: @ 8117F30
|
||||
ldrb r1, [r1]
|
||||
strb r1, [r2]
|
||||
ldr r2, =gBattleAnimTarget
|
||||
ldr r1, =gEffectBank
|
||||
ldr r1, =gEffectBattler
|
||||
ldrb r1, [r1]
|
||||
strb r1, [r2]
|
||||
bl DestroyAnimVisualTask
|
||||
@@ -50670,7 +50670,7 @@ _081183B4:
|
||||
strh r0, [r1, 0xC]
|
||||
movs r0, 0x20
|
||||
strh r0, [r1, 0xE]
|
||||
ldr r2, =gUnknown_020243FC
|
||||
ldr r2, =gIntroSlideFlags
|
||||
ldrh r1, [r2]
|
||||
ldr r0, =0x0000fffe
|
||||
ands r0, r1
|
||||
@@ -51014,7 +51014,7 @@ _08118690:
|
||||
strh r0, [r1, 0xE]
|
||||
movs r0, 0x1
|
||||
strh r0, [r1, 0x12]
|
||||
ldr r2, =gUnknown_020243FC
|
||||
ldr r2, =gIntroSlideFlags
|
||||
ldrh r1, [r2]
|
||||
ldr r0, =0x0000fffe
|
||||
ands r0, r1
|
||||
@@ -51315,7 +51315,7 @@ _08118934:
|
||||
strh r0, [r1, 0xE]
|
||||
movs r0, 0x1
|
||||
strh r0, [r1, 0x12]
|
||||
ldr r2, =gUnknown_020243FC
|
||||
ldr r2, =gIntroSlideFlags
|
||||
ldrh r1, [r2]
|
||||
ldr r0, =0x0000fffe
|
||||
ands r0, r1
|
||||
@@ -51675,7 +51675,7 @@ _08118C50:
|
||||
strh r0, [r1, 0xC]
|
||||
movs r0, 0x20
|
||||
strh r0, [r1, 0xE]
|
||||
ldr r2, =gUnknown_020243FC
|
||||
ldr r2, =gIntroSlideFlags
|
||||
ldrh r1, [r2]
|
||||
ldr r0, =0x0000fffe
|
||||
ands r0, r1
|
||||
@@ -51924,7 +51924,7 @@ _08118E7E:
|
||||
strh r0, [r1, 0x8]
|
||||
movs r0, 0xF0
|
||||
strh r0, [r1, 0xC]
|
||||
ldr r2, =gUnknown_020243FC
|
||||
ldr r2, =gIntroSlideFlags
|
||||
ldrh r1, [r2]
|
||||
ldr r0, =0x0000fffe
|
||||
ands r0, r1
|
||||
|
||||
@@ -5069,7 +5069,7 @@ sub_8172ED0: @ 8172ED0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r2, =gBattleAnimTarget
|
||||
ldr r1, =gEffectBank
|
||||
ldr r1, =gEffectBattler
|
||||
ldrb r1, [r1]
|
||||
strb r1, [r2]
|
||||
bl DestroyAnimVisualTask
|
||||
|
||||
@@ -44,7 +44,7 @@ _0817C988:
|
||||
bl GetBattlerSide
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
ldr r0, =gEffectBank
|
||||
ldr r0, =gEffectBattler
|
||||
ldrb r0, [r0]
|
||||
bl GetBattlerSide
|
||||
lsls r0, 24
|
||||
@@ -145,7 +145,7 @@ _0817CA9C:
|
||||
bl GetBattlerPosition
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 25
|
||||
ldr r0, =gEffectBank
|
||||
ldr r0, =gEffectBattler
|
||||
ldrb r0, [r0]
|
||||
bl GetBattlerPosition
|
||||
lsls r0, 24
|
||||
@@ -1302,7 +1302,7 @@ _0817D6F2:
|
||||
bl _0817E0A6
|
||||
_0817D704:
|
||||
ldr r5, =gBattlerPartyIndexes
|
||||
ldr r6, =gEffectBank
|
||||
ldr r6, =gEffectBattler
|
||||
ldrb r0, [r6]
|
||||
lsls r0, 1
|
||||
adds r0, r5
|
||||
@@ -1396,7 +1396,7 @@ _0817D7B2:
|
||||
.pool
|
||||
_0817D7D8:
|
||||
ldr r5, =gBattlerPartyIndexes
|
||||
ldr r6, =gEffectBank
|
||||
ldr r6, =gEffectBattler
|
||||
ldrb r0, [r6]
|
||||
lsls r0, 1
|
||||
adds r0, r5
|
||||
@@ -1440,7 +1440,7 @@ _0817D7D8:
|
||||
.pool
|
||||
_0817D838:
|
||||
ldr r5, =gBattlerPartyIndexes
|
||||
ldr r6, =gEffectBank
|
||||
ldr r6, =gEffectBattler
|
||||
ldrb r0, [r6]
|
||||
lsls r0, 1
|
||||
adds r0, r5
|
||||
@@ -1628,7 +1628,7 @@ _0817D9AE:
|
||||
b _0817E086
|
||||
_0817D9C2:
|
||||
ldr r5, =gBattlerPartyIndexes
|
||||
ldr r6, =gEffectBank
|
||||
ldr r6, =gEffectBattler
|
||||
ldrb r0, [r6]
|
||||
lsls r0, 1
|
||||
adds r0, r5
|
||||
@@ -1703,7 +1703,7 @@ _0817DA48:
|
||||
.pool
|
||||
_0817DA68:
|
||||
ldr r5, =gBattlerPartyIndexes
|
||||
ldr r6, =gEffectBank
|
||||
ldr r6, =gEffectBattler
|
||||
ldrb r0, [r6]
|
||||
lsls r0, 1
|
||||
adds r0, r5
|
||||
@@ -1791,7 +1791,7 @@ _0817DB10:
|
||||
.pool
|
||||
_0817DB24:
|
||||
ldr r5, =gBattlerPartyIndexes
|
||||
ldr r6, =gEffectBank
|
||||
ldr r6, =gEffectBattler
|
||||
ldrb r0, [r6]
|
||||
lsls r0, 1
|
||||
adds r0, r5
|
||||
|
||||
@@ -1373,11 +1373,11 @@
|
||||
.endm
|
||||
|
||||
.macro jumpifmove move, jumpptr
|
||||
jumpifhalfword EQUAL, gCurrentMove, \move, \jumpptr
|
||||
jumpifhalfword CMP_EQUAL, gCurrentMove, \move, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifnotmove move, jumpptr
|
||||
jumpifhalfword NOT_EQUAL, gCurrentMove, \move, \jumpptr
|
||||
jumpifhalfword CMP_NOT_EQUAL, gCurrentMove, \move, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifstatus3 bank, status, jumpptr
|
||||
@@ -1389,13 +1389,13 @@
|
||||
.endm
|
||||
|
||||
.macro jumpifmovehadnoeffect jumpptr
|
||||
jumpifbyte COMMON_BITS, gMoveResultFlags, MOVE_RESULT_NO_EFFECT, \jumpptr
|
||||
jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_NO_EFFECT, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifbattletype flags, jumpptr
|
||||
jumpifword COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr
|
||||
jumpifword CMP_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifnotbattletype flags, jumpptr
|
||||
jumpifword NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr
|
||||
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr
|
||||
.endm
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
@ stats
|
||||
.set HP, 0x0
|
||||
.set ATK, 0x1
|
||||
.set DEF, 0x2
|
||||
.set SPEED, 0x3
|
||||
.set SPATK, 0x4
|
||||
.set SPDEF, 0x5
|
||||
.set ACC, 0x6
|
||||
.set EVASION, 0x7
|
||||
@@ -1,76 +0,0 @@
|
||||
@ atk 80
|
||||
.set ATK80_DMG_CHANGE_SIGN, 0x0
|
||||
.set ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP, 0x1
|
||||
.set ATK80_DMG_DOUBLED, 0x2
|
||||
|
||||
@ compare operands
|
||||
.set EQUAL, 0x0
|
||||
.set NOT_EQUAL, 0x1
|
||||
.set GREATER_THAN, 0x2
|
||||
.set LESS_THAN, 0x3
|
||||
.set COMMON_BITS, 0x4
|
||||
.set NO_COMMON_BITS, 0x5
|
||||
|
||||
@ accuracy calc
|
||||
.set NO_ACC_CALC, 0xFFFE
|
||||
.set NO_ACC_CALC_CHECK_LOCK_ON, 0xFFFF
|
||||
.set ACC_CURR_MOVE, 0x0
|
||||
|
||||
@ bank values
|
||||
.set TARGET, 0x0
|
||||
.set ATTACKER, 0x1
|
||||
.set MOVE_EFFECT_BANK, 0x2
|
||||
.set GBANK_1, 0x3
|
||||
.set ATTACKER_WITH_PARTNER, 0x4 @ only for cmd98
|
||||
.set BANK0, 0x7
|
||||
.set SCRIPTING_BANK, 0xA
|
||||
.set OPPONENT1, 0xC
|
||||
|
||||
@ various
|
||||
.set VARIOUS_CANCEL_MULTI_TURN_MOVES, 0
|
||||
.set VARIOUS_SET_MAGIC_COAT_TARGET, 1
|
||||
.set VARIOUS_IS_RUNNING_IMPOSSIBLE, 2
|
||||
.set VARIOUS_GET_MOVE_TARGET, 3
|
||||
.set VARIOUS_RESET_INTIMIDATE_TRACE_BITS, 5
|
||||
.set VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP, 6
|
||||
.set VARIOUS_EMIT_YESNOBOX, 13
|
||||
.set VARIOUS_WAIT_CRY, 18
|
||||
.set VARIOUS_RETURN_OPPONENT_MON1, 19
|
||||
.set VARIOUS_RETURN_OPPONENT_MON2, 20
|
||||
.set VARIOUS_SET_TELEPORT_OUTCOME, 25
|
||||
.set VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC, 26
|
||||
|
||||
@ jumpifcant switch flag argument
|
||||
.set ATK4F_DONT_CHECK_STATUSES, 0x80
|
||||
|
||||
@ battle scripting struct
|
||||
.equiv sPAINSPLIT_HP, gBattleScripting
|
||||
.equiv sBIDE_DMG, gBattleScripting + 4
|
||||
.equiv sMULTIHIT_STRING, gBattleScripting + 8
|
||||
.equiv sDMG_MULTIPLIER, gBattleScripting + 0xE
|
||||
.equiv sTWOTURN_STRINGID, gBattleScripting + 0xF
|
||||
.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 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
|
||||
.equiv sBATTLE_STYLE, gBattleScripting + 0x1D
|
||||
.equiv sLVLBOX_STATE, gBattleScripting + 0x1E
|
||||
.equiv sLEARNMOVE_STATE, gBattleScripting + 0x1F
|
||||
.equiv sFIELD_20, gBattleScripting + 0x20
|
||||
.equiv sRESHOW_MAIN_STATE, gBattleScripting + 0x21
|
||||
.equiv sRESHOW_HELPER_STATE, gBattleScripting + 0x22
|
||||
.equiv sFIELD_23, gBattleScripting + 0x23
|
||||
.equiv sFIELD_24, gBattleScripting + 0x24
|
||||
.equiv sMULTIPLAYER_ID, gBattleScripting + 0x25
|
||||
|
||||
@ battle communication struct
|
||||
.equiv cEFFECT_CHOOSER, gBattleCommunication + 3
|
||||
.equiv cMULTISTRING_CHOOSER, gBattleCommunication + 5
|
||||
@@ -1,6 +1,5 @@
|
||||
.include "constants/gba_constants.inc"
|
||||
.include "constants/misc_constants.inc"
|
||||
.include "constants/type_constants.inc"
|
||||
.include "constants/contest_constants.inc"
|
||||
.include "constants/pokemon_data_constants.inc"
|
||||
.include "constants/item_data_constants.inc"
|
||||
|
||||
@@ -1,29 +1,3 @@
|
||||
.set NATURE_HARDY, 0
|
||||
.set NATURE_LONELY, 1
|
||||
.set NATURE_BRAVE, 2
|
||||
.set NATURE_ADAMANT, 3
|
||||
.set NATURE_NAUGHTY, 4
|
||||
.set NATURE_BOLD, 5
|
||||
.set NATURE_DOCILE, 6
|
||||
.set NATURE_RELAXED, 7
|
||||
.set NATURE_IMPISH, 8
|
||||
.set NATURE_LAX, 9
|
||||
.set NATURE_TIMID, 10
|
||||
.set NATURE_HASTY, 11
|
||||
.set NATURE_SERIOUS, 12
|
||||
.set NATURE_JOLLY, 13
|
||||
.set NATURE_NAIVE, 14
|
||||
.set NATURE_MODEST, 15
|
||||
.set NATURE_MILD, 16
|
||||
.set NATURE_QUIET, 17
|
||||
.set NATURE_BASHFUL, 18
|
||||
.set NATURE_RASH, 19
|
||||
.set NATURE_CALM, 20
|
||||
.set NATURE_GENTLE, 21
|
||||
.set NATURE_SASSY, 22
|
||||
.set NATURE_CAREFUL, 23
|
||||
.set NATURE_QUIRKY, 24
|
||||
|
||||
.set GROWTH_MEDIUM_FAST, 0x00
|
||||
.set GROWTH_ERRATIC, 0x01
|
||||
.set GROWTH_FLUCTUATING, 0x02
|
||||
@@ -31,23 +5,6 @@
|
||||
.set GROWTH_FAST, 0x04
|
||||
.set GROWTH_SLOW, 0x05
|
||||
|
||||
.set EGG_GROUP_NONE, 0x00
|
||||
.set EGG_GROUP_MONSTER, 0x01
|
||||
.set EGG_GROUP_WATER_1, 0x02
|
||||
.set EGG_GROUP_BUG, 0x03
|
||||
.set EGG_GROUP_FLYING, 0x04
|
||||
.set EGG_GROUP_FIELD, 0x05
|
||||
.set EGG_GROUP_FAIRY, 0x06
|
||||
.set EGG_GROUP_GRASS, 0x07
|
||||
.set EGG_GROUP_HUMAN_LIKE, 0x08
|
||||
.set EGG_GROUP_WATER_3, 0x09
|
||||
.set EGG_GROUP_MINERAL, 0x0a
|
||||
.set EGG_GROUP_AMORPHOUS, 0x0b
|
||||
.set EGG_GROUP_WATER_2, 0x0c
|
||||
.set EGG_GROUP_DITTO, 0x0d
|
||||
.set EGG_GROUP_DRAGON, 0x0e
|
||||
.set EGG_GROUP_UNDISCOVERED, 0x0f
|
||||
|
||||
.set BODY_COLOR_RED, 0x00
|
||||
.set BODY_COLOR_BLUE, 0x01
|
||||
.set BODY_COLOR_YELLOW, 0x02
|
||||
|
||||
@@ -1,387 +0,0 @@
|
||||
.set SPECIES_BULBASAUR, 0x001
|
||||
.set SPECIES_IVYSAUR, 0x002
|
||||
.set SPECIES_VENUSAUR, 0x003
|
||||
.set SPECIES_CHARMANDER, 0x004
|
||||
.set SPECIES_CHARMELEON, 0x005
|
||||
.set SPECIES_CHARIZARD, 0x006
|
||||
.set SPECIES_SQUIRTLE, 0x007
|
||||
.set SPECIES_WARTORTLE, 0x008
|
||||
.set SPECIES_BLASTOISE, 0x009
|
||||
.set SPECIES_CATERPIE, 0x00a
|
||||
.set SPECIES_METAPOD, 0x00b
|
||||
.set SPECIES_BUTTERFREE, 0x00c
|
||||
.set SPECIES_WEEDLE, 0x00d
|
||||
.set SPECIES_KAKUNA, 0x00e
|
||||
.set SPECIES_BEEDRILL, 0x00f
|
||||
.set SPECIES_PIDGEY, 0x010
|
||||
.set SPECIES_PIDGEOTTO, 0x011
|
||||
.set SPECIES_PIDGEOT, 0x012
|
||||
.set SPECIES_RATTATA, 0x013
|
||||
.set SPECIES_RATICATE, 0x014
|
||||
.set SPECIES_SPEAROW, 0x015
|
||||
.set SPECIES_FEAROW, 0x016
|
||||
.set SPECIES_EKANS, 0x017
|
||||
.set SPECIES_ARBOK, 0x018
|
||||
.set SPECIES_PIKACHU, 0x019
|
||||
.set SPECIES_RAICHU, 0x01a
|
||||
.set SPECIES_SANDSHREW, 0x01b
|
||||
.set SPECIES_SANDSLASH, 0x01c
|
||||
.set SPECIES_NIDORAN_F, 0x01d
|
||||
.set SPECIES_NIDORINA, 0x01e
|
||||
.set SPECIES_NIDOQUEEN, 0x01f
|
||||
.set SPECIES_NIDORAN_M, 0x020
|
||||
.set SPECIES_NIDORINO, 0x021
|
||||
.set SPECIES_NIDOKING, 0x022
|
||||
.set SPECIES_CLEFAIRY, 0x023
|
||||
.set SPECIES_CLEFABLE, 0x024
|
||||
.set SPECIES_VULPIX, 0x025
|
||||
.set SPECIES_NINETALES, 0x026
|
||||
.set SPECIES_JIGGLYPUFF, 0x027
|
||||
.set SPECIES_WIGGLYTUFF, 0x028
|
||||
.set SPECIES_ZUBAT, 0x029
|
||||
.set SPECIES_GOLBAT, 0x02a
|
||||
.set SPECIES_ODDISH, 0x02b
|
||||
.set SPECIES_GLOOM, 0x02c
|
||||
.set SPECIES_VILEPLUME, 0x02d
|
||||
.set SPECIES_PARAS, 0x02e
|
||||
.set SPECIES_PARASECT, 0x02f
|
||||
.set SPECIES_VENONAT, 0x030
|
||||
.set SPECIES_VENOMOTH, 0x031
|
||||
.set SPECIES_DIGLETT, 0x032
|
||||
.set SPECIES_DUGTRIO, 0x033
|
||||
.set SPECIES_MEOWTH, 0x034
|
||||
.set SPECIES_PERSIAN, 0x035
|
||||
.set SPECIES_PSYDUCK, 0x036
|
||||
.set SPECIES_GOLDUCK, 0x037
|
||||
.set SPECIES_MANKEY, 0x038
|
||||
.set SPECIES_PRIMEAPE, 0x039
|
||||
.set SPECIES_GROWLITHE, 0x03a
|
||||
.set SPECIES_ARCANINE, 0x03b
|
||||
.set SPECIES_POLIWAG, 0x03c
|
||||
.set SPECIES_POLIWHIRL, 0x03d
|
||||
.set SPECIES_POLIWRATH, 0x03e
|
||||
.set SPECIES_ABRA, 0x03f
|
||||
.set SPECIES_KADABRA, 0x040
|
||||
.set SPECIES_ALAKAZAM, 0x041
|
||||
.set SPECIES_MACHOP, 0x042
|
||||
.set SPECIES_MACHOKE, 0x043
|
||||
.set SPECIES_MACHAMP, 0x044
|
||||
.set SPECIES_BELLSPROUT, 0x045
|
||||
.set SPECIES_WEEPINBELL, 0x046
|
||||
.set SPECIES_VICTREEBEL, 0x047
|
||||
.set SPECIES_TENTACOOL, 0x048
|
||||
.set SPECIES_TENTACRUEL, 0x049
|
||||
.set SPECIES_GEODUDE, 0x04a
|
||||
.set SPECIES_GRAVELER, 0x04b
|
||||
.set SPECIES_GOLEM, 0x04c
|
||||
.set SPECIES_PONYTA, 0x04d
|
||||
.set SPECIES_RAPIDASH, 0x04e
|
||||
.set SPECIES_SLOWPOKE, 0x04f
|
||||
.set SPECIES_SLOWBRO, 0x050
|
||||
.set SPECIES_MAGNEMITE, 0x051
|
||||
.set SPECIES_MAGNETON, 0x052
|
||||
.set SPECIES_FARFETCH_D, 0x053
|
||||
.set SPECIES_DODUO, 0x054
|
||||
.set SPECIES_DODRIO, 0x055
|
||||
.set SPECIES_SEEL, 0x056
|
||||
.set SPECIES_DEWGONG, 0x057
|
||||
.set SPECIES_GRIMER, 0x058
|
||||
.set SPECIES_MUK, 0x059
|
||||
.set SPECIES_SHELLDER, 0x05a
|
||||
.set SPECIES_CLOYSTER, 0x05b
|
||||
.set SPECIES_GASTLY, 0x05c
|
||||
.set SPECIES_HAUNTER, 0x05d
|
||||
.set SPECIES_GENGAR, 0x05e
|
||||
.set SPECIES_ONIX, 0x05f
|
||||
.set SPECIES_DROWZEE, 0x060
|
||||
.set SPECIES_HYPNO, 0x061
|
||||
.set SPECIES_KRABBY, 0x062
|
||||
.set SPECIES_KINGLER, 0x063
|
||||
.set SPECIES_VOLTORB, 0x064
|
||||
.set SPECIES_ELECTRODE, 0x065
|
||||
.set SPECIES_EXEGGCUTE, 0x066
|
||||
.set SPECIES_EXEGGUTOR, 0x067
|
||||
.set SPECIES_CUBONE, 0x068
|
||||
.set SPECIES_MAROWAK, 0x069
|
||||
.set SPECIES_HITMONLEE, 0x06a
|
||||
.set SPECIES_HITMONCHAN, 0x06b
|
||||
.set SPECIES_LICKITUNG, 0x06c
|
||||
.set SPECIES_KOFFING, 0x06d
|
||||
.set SPECIES_WEEZING, 0x06e
|
||||
.set SPECIES_RHYHORN, 0x06f
|
||||
.set SPECIES_RHYDON, 0x070
|
||||
.set SPECIES_CHANSEY, 0x071
|
||||
.set SPECIES_TANGELA, 0x072
|
||||
.set SPECIES_KANGASKHAN, 0x073
|
||||
.set SPECIES_HORSEA, 0x074
|
||||
.set SPECIES_SEADRA, 0x075
|
||||
.set SPECIES_GOLDEEN, 0x076
|
||||
.set SPECIES_SEAKING, 0x077
|
||||
.set SPECIES_STARYU, 0x078
|
||||
.set SPECIES_STARMIE, 0x079
|
||||
.set SPECIES_MR_MIME, 0x07a
|
||||
.set SPECIES_SCYTHER, 0x07b
|
||||
.set SPECIES_JYNX, 0x07c
|
||||
.set SPECIES_ELECTABUZZ, 0x07d
|
||||
.set SPECIES_MAGMAR, 0x07e
|
||||
.set SPECIES_PINSIR, 0x07f
|
||||
.set SPECIES_TAUROS, 0x080
|
||||
.set SPECIES_MAGIKARP, 0x081
|
||||
.set SPECIES_GYARADOS, 0x082
|
||||
.set SPECIES_LAPRAS, 0x083
|
||||
.set SPECIES_DITTO, 0x084
|
||||
.set SPECIES_EEVEE, 0x085
|
||||
.set SPECIES_VAPOREON, 0x086
|
||||
.set SPECIES_JOLTEON, 0x087
|
||||
.set SPECIES_FLAREON, 0x088
|
||||
.set SPECIES_PORYGON, 0x089
|
||||
.set SPECIES_OMANYTE, 0x08a
|
||||
.set SPECIES_OMASTAR, 0x08b
|
||||
.set SPECIES_KABUTO, 0x08c
|
||||
.set SPECIES_KABUTOPS, 0x08d
|
||||
.set SPECIES_AERODACTYL, 0x08e
|
||||
.set SPECIES_SNORLAX, 0x08f
|
||||
.set SPECIES_ARTICUNO, 0x090
|
||||
.set SPECIES_ZAPDOS, 0x091
|
||||
.set SPECIES_MOLTRES, 0x092
|
||||
.set SPECIES_DRATINI, 0x093
|
||||
.set SPECIES_DRAGONAIR, 0x094
|
||||
.set SPECIES_DRAGONITE, 0x095
|
||||
.set SPECIES_MEWTWO, 0x096
|
||||
.set SPECIES_MEW, 0x097
|
||||
.set SPECIES_CHIKORITA, 0x098
|
||||
.set SPECIES_BAYLEEF, 0x099
|
||||
.set SPECIES_MEGANIUM, 0x09a
|
||||
.set SPECIES_CYNDAQUIL, 0x09b
|
||||
.set SPECIES_QUILAVA, 0x09c
|
||||
.set SPECIES_TYPHLOSION, 0x09d
|
||||
.set SPECIES_TOTODILE, 0x09e
|
||||
.set SPECIES_CROCONAW, 0x09f
|
||||
.set SPECIES_FERALIGATR, 0x0a0
|
||||
.set SPECIES_SENTRET, 0x0a1
|
||||
.set SPECIES_FURRET, 0x0a2
|
||||
.set SPECIES_HOOTHOOT, 0x0a3
|
||||
.set SPECIES_NOCTOWL, 0x0a4
|
||||
.set SPECIES_LEDYBA, 0x0a5
|
||||
.set SPECIES_LEDIAN, 0x0a6
|
||||
.set SPECIES_SPINARAK, 0x0a7
|
||||
.set SPECIES_ARIADOS, 0x0a8
|
||||
.set SPECIES_CROBAT, 0x0a9
|
||||
.set SPECIES_CHINCHOU, 0x0aa
|
||||
.set SPECIES_LANTURN, 0x0ab
|
||||
.set SPECIES_PICHU, 0x0ac
|
||||
.set SPECIES_CLEFFA, 0x0ad
|
||||
.set SPECIES_IGGLYBUFF, 0x0ae
|
||||
.set SPECIES_TOGEPI, 0x0af
|
||||
.set SPECIES_TOGETIC, 0x0b0
|
||||
.set SPECIES_NATU, 0x0b1
|
||||
.set SPECIES_XATU, 0x0b2
|
||||
.set SPECIES_MAREEP, 0x0b3
|
||||
.set SPECIES_FLAAFFY, 0x0b4
|
||||
.set SPECIES_AMPHAROS, 0x0b5
|
||||
.set SPECIES_BELLOSSOM, 0x0b6
|
||||
.set SPECIES_MARILL, 0x0b7
|
||||
.set SPECIES_AZUMARILL, 0x0b8
|
||||
.set SPECIES_SUDOWOODO, 0x0b9
|
||||
.set SPECIES_POLITOED, 0x0ba
|
||||
.set SPECIES_HOPPIP, 0x0bb
|
||||
.set SPECIES_SKIPLOOM, 0x0bc
|
||||
.set SPECIES_JUMPLUFF, 0x0bd
|
||||
.set SPECIES_AIPOM, 0x0be
|
||||
.set SPECIES_SUNKERN, 0x0bf
|
||||
.set SPECIES_SUNFLORA, 0x0c0
|
||||
.set SPECIES_YANMA, 0x0c1
|
||||
.set SPECIES_WOOPER, 0x0c2
|
||||
.set SPECIES_QUAGSIRE, 0x0c3
|
||||
.set SPECIES_ESPEON, 0x0c4
|
||||
.set SPECIES_UMBREON, 0x0c5
|
||||
.set SPECIES_MURKROW, 0x0c6
|
||||
.set SPECIES_SLOWKING, 0x0c7
|
||||
.set SPECIES_MISDREAVUS, 0x0c8
|
||||
.set SPECIES_UNOWN, 0x0c9
|
||||
.set SPECIES_WOBBUFFET, 0x0ca
|
||||
.set SPECIES_GIRAFARIG, 0x0cb
|
||||
.set SPECIES_PINECO, 0x0cc
|
||||
.set SPECIES_FORRETRESS, 0x0cd
|
||||
.set SPECIES_DUNSPARCE, 0x0ce
|
||||
.set SPECIES_GLIGAR, 0x0cf
|
||||
.set SPECIES_STEELIX, 0x0d0
|
||||
.set SPECIES_SNUBBULL, 0x0d1
|
||||
.set SPECIES_GRANBULL, 0x0d2
|
||||
.set SPECIES_QWILFISH, 0x0d3
|
||||
.set SPECIES_SCIZOR, 0x0d4
|
||||
.set SPECIES_SHUCKLE, 0x0d5
|
||||
.set SPECIES_HERACROSS, 0x0d6
|
||||
.set SPECIES_SNEASEL, 0x0d7
|
||||
.set SPECIES_TEDDIURSA, 0x0d8
|
||||
.set SPECIES_URSARING, 0x0d9
|
||||
.set SPECIES_SLUGMA, 0x0da
|
||||
.set SPECIES_MAGCARGO, 0x0db
|
||||
.set SPECIES_SWINUB, 0x0dc
|
||||
.set SPECIES_PILOSWINE, 0x0dd
|
||||
.set SPECIES_CORSOLA, 0x0de
|
||||
.set SPECIES_REMORAID, 0x0df
|
||||
.set SPECIES_OCTILLERY, 0x0e0
|
||||
.set SPECIES_DELIBIRD, 0x0e1
|
||||
.set SPECIES_MANTINE, 0x0e2
|
||||
.set SPECIES_SKARMORY, 0x0e3
|
||||
.set SPECIES_HOUNDOUR, 0x0e4
|
||||
.set SPECIES_HOUNDOOM, 0x0e5
|
||||
.set SPECIES_KINGDRA, 0x0e6
|
||||
.set SPECIES_PHANPY, 0x0e7
|
||||
.set SPECIES_DONPHAN, 0x0e8
|
||||
.set SPECIES_PORYGON2, 0x0e9
|
||||
.set SPECIES_STANTLER, 0x0ea
|
||||
.set SPECIES_SMEARGLE, 0x0eb
|
||||
.set SPECIES_TYROGUE, 0x0ec
|
||||
.set SPECIES_HITMONTOP, 0x0ed
|
||||
.set SPECIES_SMOOCHUM, 0x0ee
|
||||
.set SPECIES_ELEKID, 0x0ef
|
||||
.set SPECIES_MAGBY, 0x0f0
|
||||
.set SPECIES_MILTANK, 0x0f1
|
||||
.set SPECIES_BLISSEY, 0x0f2
|
||||
.set SPECIES_RAIKOU, 0x0f3
|
||||
.set SPECIES_ENTEI, 0x0f4
|
||||
.set SPECIES_SUICUNE, 0x0f5
|
||||
.set SPECIES_LARVITAR, 0x0f6
|
||||
.set SPECIES_PUPITAR, 0x0f7
|
||||
.set SPECIES_TYRANITAR, 0x0f8
|
||||
.set SPECIES_LUGIA, 0x0f9
|
||||
.set SPECIES_HO_OH, 0x0fa
|
||||
.set SPECIES_CELEBI, 0x0fb
|
||||
.set SPECIES_TREECKO, 0x115
|
||||
.set SPECIES_GROVYLE, 0x116
|
||||
.set SPECIES_SCEPTILE, 0x117
|
||||
.set SPECIES_TORCHIC, 0x118
|
||||
.set SPECIES_COMBUSKEN, 0x119
|
||||
.set SPECIES_BLAZIKEN, 0x11a
|
||||
.set SPECIES_MUDKIP, 0x11b
|
||||
.set SPECIES_MARSHTOMP, 0x11c
|
||||
.set SPECIES_SWAMPERT, 0x11d
|
||||
.set SPECIES_POOCHYENA, 0x11e
|
||||
.set SPECIES_MIGHTYENA, 0x11f
|
||||
.set SPECIES_ZIGZAGOON, 0x120
|
||||
.set SPECIES_LINOONE, 0x121
|
||||
.set SPECIES_WURMPLE, 0x122
|
||||
.set SPECIES_SILCOON, 0x123
|
||||
.set SPECIES_BEAUTIFLY, 0x124
|
||||
.set SPECIES_CASCOON, 0x125
|
||||
.set SPECIES_DUSTOX, 0x126
|
||||
.set SPECIES_LOTAD, 0x127
|
||||
.set SPECIES_LOMBRE, 0x128
|
||||
.set SPECIES_LUDICOLO, 0x129
|
||||
.set SPECIES_SEEDOT, 0x12a
|
||||
.set SPECIES_NUZLEAF, 0x12b
|
||||
.set SPECIES_SHIFTRY, 0x12c
|
||||
.set SPECIES_NINCADA, 0x12d
|
||||
.set SPECIES_NINJASK, 0x12e
|
||||
.set SPECIES_SHEDINJA, 0x12f
|
||||
.set SPECIES_TAILLOW, 0x130
|
||||
.set SPECIES_SWELLOW, 0x131
|
||||
.set SPECIES_SHROOMISH, 0x132
|
||||
.set SPECIES_BRELOOM, 0x133
|
||||
.set SPECIES_SPINDA, 0x134
|
||||
.set SPECIES_WINGULL, 0x135
|
||||
.set SPECIES_PELIPPER, 0x136
|
||||
.set SPECIES_SURSKIT, 0x137
|
||||
.set SPECIES_MASQUERAIN, 0x138
|
||||
.set SPECIES_WAILMER, 0x139
|
||||
.set SPECIES_WAILORD, 0x13a
|
||||
.set SPECIES_SKITTY, 0x13b
|
||||
.set SPECIES_DELCATTY, 0x13c
|
||||
.set SPECIES_KECLEON, 0x13d
|
||||
.set SPECIES_BALTOY, 0x13e
|
||||
.set SPECIES_CLAYDOL, 0x13f
|
||||
.set SPECIES_NOSEPASS, 0x140
|
||||
.set SPECIES_TORKOAL, 0x141
|
||||
.set SPECIES_SABLEYE, 0x142
|
||||
.set SPECIES_BARBOACH, 0x143
|
||||
.set SPECIES_WHISCASH, 0x144
|
||||
.set SPECIES_LUVDISC, 0x145
|
||||
.set SPECIES_CORPHISH, 0x146
|
||||
.set SPECIES_CRAWDAUNT, 0x147
|
||||
.set SPECIES_FEEBAS, 0x148
|
||||
.set SPECIES_MILOTIC, 0x149
|
||||
.set SPECIES_CARVANHA, 0x14a
|
||||
.set SPECIES_SHARPEDO, 0x14b
|
||||
.set SPECIES_TRAPINCH, 0x14c
|
||||
.set SPECIES_VIBRAVA, 0x14d
|
||||
.set SPECIES_FLYGON, 0x14e
|
||||
.set SPECIES_MAKUHITA, 0x14f
|
||||
.set SPECIES_HARIYAMA, 0x150
|
||||
.set SPECIES_ELECTRIKE, 0x151
|
||||
.set SPECIES_MANECTRIC, 0x152
|
||||
.set SPECIES_NUMEL, 0x153
|
||||
.set SPECIES_CAMERUPT, 0x154
|
||||
.set SPECIES_SPHEAL, 0x155
|
||||
.set SPECIES_SEALEO, 0x156
|
||||
.set SPECIES_WALREIN, 0x157
|
||||
.set SPECIES_CACNEA, 0x158
|
||||
.set SPECIES_CACTURNE, 0x159
|
||||
.set SPECIES_SNORUNT, 0x15a
|
||||
.set SPECIES_GLALIE, 0x15b
|
||||
.set SPECIES_LUNATONE, 0x15c
|
||||
.set SPECIES_SOLROCK, 0x15d
|
||||
.set SPECIES_AZURILL, 0x15e
|
||||
.set SPECIES_SPOINK, 0x15f
|
||||
.set SPECIES_GRUMPIG, 0x160
|
||||
.set SPECIES_PLUSLE, 0x161
|
||||
.set SPECIES_MINUN, 0x162
|
||||
.set SPECIES_MAWILE, 0x163
|
||||
.set SPECIES_MEDITITE, 0x164
|
||||
.set SPECIES_MEDICHAM, 0x165
|
||||
.set SPECIES_SWABLU, 0x166
|
||||
.set SPECIES_ALTARIA, 0x167
|
||||
.set SPECIES_WYNAUT, 0x168
|
||||
.set SPECIES_DUSKULL, 0x169
|
||||
.set SPECIES_DUSCLOPS, 0x16a
|
||||
.set SPECIES_ROSELIA, 0x16b
|
||||
.set SPECIES_SLAKOTH, 0x16c
|
||||
.set SPECIES_VIGOROTH, 0x16d
|
||||
.set SPECIES_SLAKING, 0x16e
|
||||
.set SPECIES_GULPIN, 0x16f
|
||||
.set SPECIES_SWALOT, 0x170
|
||||
.set SPECIES_TROPIUS, 0x171
|
||||
.set SPECIES_WHISMUR, 0x172
|
||||
.set SPECIES_LOUDRED, 0x173
|
||||
.set SPECIES_EXPLOUD, 0x174
|
||||
.set SPECIES_CLAMPERL, 0x175
|
||||
.set SPECIES_HUNTAIL, 0x176
|
||||
.set SPECIES_GOREBYSS, 0x177
|
||||
.set SPECIES_ABSOL, 0x178
|
||||
.set SPECIES_SHUPPET, 0x179
|
||||
.set SPECIES_BANETTE, 0x17a
|
||||
.set SPECIES_SEVIPER, 0x17b
|
||||
.set SPECIES_ZANGOOSE, 0x17c
|
||||
.set SPECIES_RELICANTH, 0x17d
|
||||
.set SPECIES_ARON, 0x17e
|
||||
.set SPECIES_LAIRON, 0x17f
|
||||
.set SPECIES_AGGRON, 0x180
|
||||
.set SPECIES_CASTFORM, 0x181
|
||||
.set SPECIES_VOLBEAT, 0x182
|
||||
.set SPECIES_ILLUMISE, 0x183
|
||||
.set SPECIES_LILEEP, 0x184
|
||||
.set SPECIES_CRADILY, 0x185
|
||||
.set SPECIES_ANORITH, 0x186
|
||||
.set SPECIES_ARMALDO, 0x187
|
||||
.set SPECIES_RALTS, 0x188
|
||||
.set SPECIES_KIRLIA, 0x189
|
||||
.set SPECIES_GARDEVOIR, 0x18a
|
||||
.set SPECIES_BAGON, 0x18b
|
||||
.set SPECIES_SHELGON, 0x18c
|
||||
.set SPECIES_SALAMENCE, 0x18d
|
||||
.set SPECIES_BELDUM, 0x18e
|
||||
.set SPECIES_METANG, 0x18f
|
||||
.set SPECIES_METAGROSS, 0x190
|
||||
.set SPECIES_REGIROCK, 0x191
|
||||
.set SPECIES_REGICE, 0x192
|
||||
.set SPECIES_REGISTEEL, 0x193
|
||||
.set SPECIES_KYOGRE, 0x194
|
||||
.set SPECIES_GROUDON, 0x195
|
||||
.set SPECIES_RAYQUAZA, 0x196
|
||||
.set SPECIES_LATIAS, 0x197
|
||||
.set SPECIES_LATIOS, 0x198
|
||||
.set SPECIES_JIRACHI, 0x199
|
||||
.set SPECIES_DEOXYS, 0x19a
|
||||
.set SPECIES_CHIMECHO, 0x19b
|
||||
.set SPECIES_EGG, 0x19c
|
||||
@@ -1,18 +0,0 @@
|
||||
.set TYPE_NORMAL, 0x00
|
||||
.set TYPE_FIGHTING, 0x01
|
||||
.set TYPE_FLYING, 0x02
|
||||
.set TYPE_POISON, 0x03
|
||||
.set TYPE_GROUND, 0x04
|
||||
.set TYPE_ROCK, 0x05
|
||||
.set TYPE_BUG, 0x06
|
||||
.set TYPE_GHOST, 0x07
|
||||
.set TYPE_STEEL, 0x08
|
||||
.set TYPE_UNKNOWN, 0x09
|
||||
.set TYPE_FIRE, 0x0a
|
||||
.set TYPE_WATER, 0x0b
|
||||
.set TYPE_GRASS, 0x0c
|
||||
.set TYPE_ELECTRIC, 0x0d
|
||||
.set TYPE_PSYCHIC, 0x0e
|
||||
.set TYPE_ICE, 0x0f
|
||||
.set TYPE_DRAGON, 0x10
|
||||
.set TYPE_DARK, 0x11
|
||||
@@ -5,8 +5,7 @@
|
||||
#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 "constants/pokemon.h"
|
||||
.include "asm/macros/battle_ai_script.inc"
|
||||
|
||||
.section script_data, "aw", %progbits
|
||||
@@ -250,64 +249,64 @@ BattleAIScript_82DC341:
|
||||
if_hp_less_than AI_USER, 51, Score_Minus10
|
||||
|
||||
BattleAIScript_82DC348:
|
||||
if_stat_level_equal AI_USER, ATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_ATK, 12, Score_Minus10
|
||||
end
|
||||
|
||||
BattleAIScript_82DC351:
|
||||
if_stat_level_equal AI_USER, DEF, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_DEF, 12, Score_Minus10
|
||||
end
|
||||
|
||||
BattleAIScript_82DC35A:
|
||||
if_stat_level_equal AI_USER, SPEED, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_SPEED, 12, Score_Minus10
|
||||
end
|
||||
|
||||
BattleAIScript_82DC363:
|
||||
if_stat_level_equal AI_USER, SPATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_SPATK, 12, Score_Minus10
|
||||
end
|
||||
|
||||
BattleAIScript_82DC36C:
|
||||
if_stat_level_equal AI_USER, SPDEF, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_SPDEF, 12, Score_Minus10
|
||||
end
|
||||
|
||||
BattleAIScript_82DC375:
|
||||
if_stat_level_equal AI_USER, ACC, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_ACC, 12, Score_Minus10
|
||||
end
|
||||
|
||||
BattleAIScript_82DC37E:
|
||||
if_stat_level_equal AI_USER, EVASION, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_EVASION, 12, Score_Minus10
|
||||
end
|
||||
|
||||
BattleAIScript_82DC387:
|
||||
if_stat_level_equal AI_TARGET, ATK, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, STAT_ATK, 0, Score_Minus10
|
||||
get_ability AI_TARGET
|
||||
if_equal ABILITY_HYPER_CUTTER, Score_Minus10
|
||||
goto BattleAIScript_82DC3F6
|
||||
|
||||
BattleAIScript_82DC39C:
|
||||
if_stat_level_equal AI_TARGET, DEF, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, STAT_DEF, 0, Score_Minus10
|
||||
goto BattleAIScript_82DC3F6
|
||||
|
||||
BattleAIScript_82DC3A9:
|
||||
if_stat_level_equal AI_TARGET, SPEED, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, STAT_SPEED, 0, Score_Minus10
|
||||
if_ability AI_TARGET, ABILITY_SPEED_BOOST, Score_Minus10
|
||||
goto BattleAIScript_82DC3F6
|
||||
|
||||
BattleAIScript_82DC3BF:
|
||||
if_stat_level_equal AI_TARGET, SPATK, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, STAT_SPATK, 0, Score_Minus10
|
||||
goto BattleAIScript_82DC3F6
|
||||
|
||||
BattleAIScript_82DC3CC:
|
||||
if_stat_level_equal AI_TARGET, SPDEF, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, STAT_SPDEF, 0, Score_Minus10
|
||||
goto BattleAIScript_82DC3F6
|
||||
|
||||
BattleAIScript_82DC3D9:
|
||||
if_stat_level_equal AI_TARGET, ACC, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, STAT_ACC, 0, Score_Minus10
|
||||
get_ability AI_TARGET
|
||||
if_equal ABILITY_KEEN_EYE, Score_Minus10
|
||||
goto BattleAIScript_82DC3F6
|
||||
|
||||
BattleAIScript_82DC3EE:
|
||||
if_stat_level_equal AI_TARGET, EVASION, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, STAT_EVASION, 0, Score_Minus10
|
||||
|
||||
BattleAIScript_82DC3F6:
|
||||
get_ability AI_TARGET
|
||||
@@ -316,20 +315,20 @@ BattleAIScript_82DC3F6:
|
||||
end
|
||||
|
||||
BattleAIScript_82DC405:
|
||||
if_stat_level_less_than AI_USER, ATK, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, DEF, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, SPEED, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, SPATK, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, SPDEF, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, ACC, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, EVASION, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, ATK, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, DEF, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, SPEED, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, SPATK, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, SPDEF, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, ACC, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, EVASION, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, STAT_ATK, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, STAT_DEF, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, STAT_SPEED, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, STAT_SPATK, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, STAT_SPDEF, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, STAT_ACC, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_less_than AI_USER, STAT_EVASION, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, STAT_ATK, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, STAT_DEF, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPEED, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPATK, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPDEF, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, STAT_ACC, 6, BattleAIScript_82DC47A
|
||||
if_stat_level_more_than AI_TARGET, STAT_EVASION, 6, BattleAIScript_82DC47A
|
||||
goto Score_Minus10
|
||||
|
||||
BattleAIScript_82DC47A:
|
||||
@@ -437,8 +436,8 @@ BattleAIScript_82DC5B0:
|
||||
end
|
||||
|
||||
BattleAIScript_82DC5BB:
|
||||
if_stat_level_equal AI_USER, ATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, DEF, 12, Score_Minus8
|
||||
if_stat_level_equal AI_USER, STAT_ATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_DEF, 12, Score_Minus8
|
||||
end
|
||||
|
||||
BattleAIScript_82DC5CC:
|
||||
@@ -485,8 +484,8 @@ BattleAIScript_82DC635:
|
||||
end
|
||||
|
||||
BattleAIScript_82DC640:
|
||||
if_stat_level_equal AI_TARGET, ATK, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, SPATK, 0, Score_Minus8
|
||||
if_stat_level_equal AI_TARGET, STAT_ATK, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, STAT_SPATK, 0, Score_Minus8
|
||||
|
||||
BattleAIScript_82DC650:
|
||||
count_usable_party_mons AI_USER
|
||||
@@ -575,18 +574,18 @@ BattleAIScript_82DC71E:
|
||||
end
|
||||
|
||||
BattleAIScript_82DC729:
|
||||
if_stat_level_equal AI_TARGET, ATK, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, DEF, 0, Score_Minus8
|
||||
if_stat_level_equal AI_TARGET, STAT_ATK, 0, Score_Minus10
|
||||
if_stat_level_equal AI_TARGET, STAT_DEF, 0, Score_Minus8
|
||||
end
|
||||
|
||||
BattleAIScript_82DC73A:
|
||||
if_stat_level_equal AI_USER, DEF, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, SPDEF, 12, Score_Minus8
|
||||
if_stat_level_equal AI_USER, STAT_DEF, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_SPDEF, 12, Score_Minus8
|
||||
end
|
||||
|
||||
BattleAIScript_82DC74B:
|
||||
if_stat_level_equal AI_USER, ATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, DEF, 12, Score_Minus8
|
||||
if_stat_level_equal AI_USER, STAT_ATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_DEF, 12, Score_Minus8
|
||||
end
|
||||
|
||||
BattleAIScript_82DC75C:
|
||||
@@ -594,13 +593,13 @@ BattleAIScript_82DC75C:
|
||||
end
|
||||
|
||||
BattleAIScript_82DC767:
|
||||
if_stat_level_equal AI_USER, SPATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, SPDEF, 12, Score_Minus8
|
||||
if_stat_level_equal AI_USER, STAT_SPATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_SPDEF, 12, Score_Minus8
|
||||
end
|
||||
|
||||
BattleAIScript_82DC778:
|
||||
if_stat_level_equal AI_USER, ATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, SPEED, 12, Score_Minus8
|
||||
if_stat_level_equal AI_USER, STAT_ATK, 12, Score_Minus10
|
||||
if_stat_level_equal AI_USER, STAT_SPEED, 12, Score_Minus8
|
||||
end
|
||||
|
||||
Score_Minus1:
|
||||
@@ -806,9 +805,9 @@ BattleAIScript_82DCAC7:
|
||||
end
|
||||
|
||||
BattleAIScript_82DCAC8:
|
||||
if_stat_level_less_than AI_TARGET, EVASION, 7, BattleAIScript_82DCAE2
|
||||
if_stat_level_less_than AI_TARGET, STAT_EVASION, 7, BattleAIScript_82DCAE2
|
||||
score -1
|
||||
if_stat_level_less_than AI_TARGET, EVASION, 10, BattleAIScript_82DCAE2
|
||||
if_stat_level_less_than AI_TARGET, STAT_EVASION, 10, BattleAIScript_82DCAE2
|
||||
if_random_less_than 128, BattleAIScript_82DCAE2
|
||||
score -1
|
||||
|
||||
@@ -907,7 +906,7 @@ sMovesTable_82DCB6C:
|
||||
.2byte -1
|
||||
|
||||
BattleAIScript_82DCBBC:
|
||||
if_stat_level_less_than AI_USER, ATK, 9, BattleAIScript_82DCBD1
|
||||
if_stat_level_less_than AI_USER, STAT_ATK, 9, BattleAIScript_82DCBD1
|
||||
if_random_less_than 100, BattleAIScript_82DCBE0
|
||||
score -1
|
||||
goto BattleAIScript_82DCBE0
|
||||
@@ -929,7 +928,7 @@ BattleAIScript_82DCBF6:
|
||||
end
|
||||
|
||||
BattleAIScript_82DCBF7:
|
||||
if_stat_level_less_than AI_USER, DEF, 9, BattleAIScript_82DCC0C
|
||||
if_stat_level_less_than AI_USER, STAT_DEF, 9, BattleAIScript_82DCC0C
|
||||
if_random_less_than 100, BattleAIScript_82DCC1B
|
||||
score -1
|
||||
goto BattleAIScript_82DCC1B
|
||||
@@ -987,7 +986,7 @@ BattleAIScript_82DCC72:
|
||||
end
|
||||
|
||||
BattleAIScript_82DCC73:
|
||||
if_stat_level_less_than AI_USER, SPATK, 9, BattleAIScript_82DCC88
|
||||
if_stat_level_less_than AI_USER, STAT_SPATK, 9, BattleAIScript_82DCC88
|
||||
if_random_less_than 100, BattleAIScript_82DCC97
|
||||
score -1
|
||||
goto BattleAIScript_82DCC97
|
||||
@@ -1009,7 +1008,7 @@ BattleAIScript_82DCCAD:
|
||||
end
|
||||
|
||||
BattleAIScript_82DCCAE:
|
||||
if_stat_level_less_than AI_USER, SPDEF, 9, BattleAIScript_82DCCC3
|
||||
if_stat_level_less_than AI_USER, STAT_SPDEF, 9, BattleAIScript_82DCCC3
|
||||
if_random_less_than 100, BattleAIScript_82DCCD2
|
||||
score -1
|
||||
goto BattleAIScript_82DCCD2
|
||||
@@ -1055,7 +1054,7 @@ sTypesTable_82DCD0A:
|
||||
.byte -1
|
||||
|
||||
BattleAIScript_82DCD14:
|
||||
if_stat_level_less_than AI_USER, ACC, 9, BattleAIScript_82DCD24
|
||||
if_stat_level_less_than AI_USER, STAT_ACC, 9, BattleAIScript_82DCD24
|
||||
if_random_less_than 50, BattleAIScript_82DCD24
|
||||
score -2
|
||||
|
||||
@@ -1072,7 +1071,7 @@ BattleAIScript_82DCD2E:
|
||||
score +3
|
||||
|
||||
BattleAIScript_82DCD3D:
|
||||
if_stat_level_less_than AI_USER, EVASION, 9, BattleAIScript_82DCD4D
|
||||
if_stat_level_less_than AI_USER, STAT_EVASION, 9, BattleAIScript_82DCD4D
|
||||
if_random_less_than 128, BattleAIScript_82DCD4D
|
||||
score -1
|
||||
|
||||
@@ -1102,7 +1101,7 @@ BattleAIScript_82DCD90:
|
||||
|
||||
BattleAIScript_82DCDA2:
|
||||
if_hp_more_than AI_USER, 70, BattleAIScript_82DCDC7
|
||||
if_stat_level_equal AI_USER, EVASION, 6, BattleAIScript_82DCDC7
|
||||
if_stat_level_equal AI_USER, STAT_EVASION, 6, BattleAIScript_82DCDC7
|
||||
if_hp_less_than AI_USER, 40, BattleAIScript_82DCDC5
|
||||
if_hp_less_than AI_TARGET, 40, BattleAIScript_82DCDC5
|
||||
if_random_less_than 70, BattleAIScript_82DCDC7
|
||||
@@ -1114,10 +1113,10 @@ BattleAIScript_82DCDC7:
|
||||
end
|
||||
|
||||
BattleAIScript_82DCDC8:
|
||||
if_stat_level_more_than AI_TARGET, EVASION, 10, BattleAIScript_82DCDED
|
||||
if_stat_level_less_than AI_USER, ACC, 2, BattleAIScript_82DCDED
|
||||
if_stat_level_more_than AI_TARGET, EVASION, 8, BattleAIScript_82DCDEF
|
||||
if_stat_level_less_than AI_USER, ACC, 4, BattleAIScript_82DCDEF
|
||||
if_stat_level_more_than AI_TARGET, STAT_EVASION, 10, BattleAIScript_82DCDED
|
||||
if_stat_level_less_than AI_USER, STAT_ACC, 2, BattleAIScript_82DCDED
|
||||
if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, BattleAIScript_82DCDEF
|
||||
if_stat_level_less_than AI_USER, STAT_ACC, 4, BattleAIScript_82DCDEF
|
||||
goto BattleAIScript_82DCDF7
|
||||
|
||||
BattleAIScript_82DCDED:
|
||||
@@ -1131,13 +1130,13 @@ BattleAIScript_82DCDF7:
|
||||
end
|
||||
|
||||
BattleAIScript_82DCDF8:
|
||||
if_stat_level_equal AI_TARGET, ATK, 6, BattleAIScript_82DCE1B
|
||||
if_stat_level_equal AI_TARGET, STAT_ATK, 6, BattleAIScript_82DCE1B
|
||||
score -1
|
||||
if_hp_more_than AI_USER, 90, BattleAIScript_82DCE0B
|
||||
score -1
|
||||
|
||||
BattleAIScript_82DCE0B:
|
||||
if_stat_level_more_than AI_TARGET, ATK, 3, BattleAIScript_82DCE1B
|
||||
if_stat_level_more_than AI_TARGET, STAT_ATK, 3, BattleAIScript_82DCE1B
|
||||
if_random_less_than 50, BattleAIScript_82DCE1B
|
||||
score -2
|
||||
|
||||
@@ -1167,7 +1166,7 @@ sTypesTable_82DCE43:
|
||||
|
||||
BattleAIScript_82DCE4A:
|
||||
if_hp_less_than AI_USER, 70, BattleAIScript_82DCE59
|
||||
if_stat_level_more_than AI_TARGET, DEF, 3, BattleAIScript_82DCE61
|
||||
if_stat_level_more_than AI_TARGET, STAT_DEF, 3, BattleAIScript_82DCE61
|
||||
|
||||
BattleAIScript_82DCE59:
|
||||
if_random_less_than 50, BattleAIScript_82DCE61
|
||||
@@ -1199,13 +1198,13 @@ BattleAIScript_82DCE96:
|
||||
end
|
||||
|
||||
BattleAIScript_82DCE97:
|
||||
if_stat_level_equal AI_TARGET, ATK, 6, BattleAIScript_82DCEBA
|
||||
if_stat_level_equal AI_TARGET, STAT_ATK, 6, BattleAIScript_82DCEBA
|
||||
score -1
|
||||
if_hp_more_than AI_USER, 90, BattleAIScript_82DCEAA
|
||||
score -1
|
||||
|
||||
BattleAIScript_82DCEAA:
|
||||
if_stat_level_more_than AI_TARGET, SPATK, 3, BattleAIScript_82DCEBA
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPATK, 3, BattleAIScript_82DCEBA
|
||||
if_random_less_than 50, BattleAIScript_82DCEBA
|
||||
score -2
|
||||
|
||||
@@ -1237,7 +1236,7 @@ sTypesTable_82DCEE2:
|
||||
|
||||
BattleAIScript_82DCEEB:
|
||||
if_hp_less_than AI_USER, 70, BattleAIScript_82DCEFA
|
||||
if_stat_level_more_than AI_TARGET, SPDEF, 3, BattleAIScript_82DCF02
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPDEF, 3, BattleAIScript_82DCF02
|
||||
|
||||
BattleAIScript_82DCEFA:
|
||||
if_random_less_than 50, BattleAIScript_82DCF02
|
||||
@@ -1259,7 +1258,7 @@ BattleAIScript_82DCF1A:
|
||||
score -1
|
||||
|
||||
BattleAIScript_82DCF22:
|
||||
if_stat_level_more_than AI_USER, ACC, 4, BattleAIScript_82DCF32
|
||||
if_stat_level_more_than AI_USER, STAT_ACC, 4, BattleAIScript_82DCF32
|
||||
if_random_less_than 80, BattleAIScript_82DCF32
|
||||
score -2
|
||||
|
||||
@@ -1285,7 +1284,7 @@ BattleAIScript_82DCF68:
|
||||
|
||||
BattleAIScript_82DCF7A:
|
||||
if_hp_more_than AI_USER, 70, BattleAIScript_82DCF9F
|
||||
if_stat_level_equal AI_TARGET, ACC, 6, BattleAIScript_82DCF9F
|
||||
if_stat_level_equal AI_TARGET, STAT_ACC, 6, BattleAIScript_82DCF9F
|
||||
if_hp_less_than AI_USER, 40, BattleAIScript_82DCF9D
|
||||
if_hp_less_than AI_TARGET, 40, BattleAIScript_82DCF9D
|
||||
if_random_less_than 70, BattleAIScript_82DCF9F
|
||||
@@ -1298,7 +1297,7 @@ BattleAIScript_82DCF9F:
|
||||
|
||||
BattleAIScript_82DCFA0:
|
||||
if_hp_less_than AI_USER, 70, BattleAIScript_82DCFAF
|
||||
if_stat_level_more_than AI_TARGET, EVASION, 3, BattleAIScript_82DCFB7
|
||||
if_stat_level_more_than AI_TARGET, STAT_EVASION, 3, BattleAIScript_82DCFB7
|
||||
|
||||
BattleAIScript_82DCFAF:
|
||||
if_random_less_than 50, BattleAIScript_82DCFB7
|
||||
@@ -1312,16 +1311,16 @@ BattleAIScript_82DCFC0:
|
||||
end
|
||||
|
||||
BattleAIScript_82DCFC1:
|
||||
if_stat_level_more_than AI_USER, ATK, 8, BattleAIScript_82DD016
|
||||
if_stat_level_more_than AI_USER, DEF, 8, BattleAIScript_82DD016
|
||||
if_stat_level_more_than AI_USER, SPATK, 8, BattleAIScript_82DD016
|
||||
if_stat_level_more_than AI_USER, SPDEF, 8, BattleAIScript_82DD016
|
||||
if_stat_level_more_than AI_USER, EVASION, 8, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, ATK, 4, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, DEF, 4, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, SPATK, 4, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, SPDEF, 4, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, ACC, 4, BattleAIScript_82DD016
|
||||
if_stat_level_more_than AI_USER, STAT_ATK, 8, BattleAIScript_82DD016
|
||||
if_stat_level_more_than AI_USER, STAT_DEF, 8, BattleAIScript_82DD016
|
||||
if_stat_level_more_than AI_USER, STAT_SPATK, 8, BattleAIScript_82DD016
|
||||
if_stat_level_more_than AI_USER, STAT_SPDEF, 8, BattleAIScript_82DD016
|
||||
if_stat_level_more_than AI_USER, STAT_EVASION, 8, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, STAT_ATK, 4, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, STAT_DEF, 4, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, STAT_SPATK, 4, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, STAT_SPDEF, 4, BattleAIScript_82DD016
|
||||
if_stat_level_less_than AI_TARGET, STAT_ACC, 4, BattleAIScript_82DD016
|
||||
goto BattleAIScript_82DD01E
|
||||
|
||||
BattleAIScript_82DD016:
|
||||
@@ -1329,16 +1328,16 @@ BattleAIScript_82DD016:
|
||||
score -3
|
||||
|
||||
BattleAIScript_82DD01E:
|
||||
if_stat_level_more_than AI_TARGET, ATK, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_more_than AI_TARGET, DEF, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_more_than AI_TARGET, SPATK, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_more_than AI_TARGET, SPDEF, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_more_than AI_TARGET, EVASION, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, ATK, 4, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, DEF, 4, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, SPATK, 4, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, SPDEF, 4, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, ACC, 4, BattleAIScript_82DD07B
|
||||
if_stat_level_more_than AI_TARGET, STAT_ATK, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_more_than AI_TARGET, STAT_DEF, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPATK, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPDEF, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, STAT_ATK, 4, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, STAT_DEF, 4, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, STAT_SPATK, 4, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, STAT_SPDEF, 4, BattleAIScript_82DD07B
|
||||
if_stat_level_less_than AI_USER, STAT_ACC, 4, BattleAIScript_82DD07B
|
||||
if_random_less_than 50, BattleAIScript_82DD083
|
||||
score -1
|
||||
goto BattleAIScript_82DD083
|
||||
@@ -1358,11 +1357,11 @@ BattleAIScript_82DD08D:
|
||||
end
|
||||
|
||||
BattleAIScript_82DD08E:
|
||||
if_stat_level_more_than AI_TARGET, ATK, 8, BattleAIScript_82DD0BD
|
||||
if_stat_level_more_than AI_TARGET, DEF, 8, BattleAIScript_82DD0BD
|
||||
if_stat_level_more_than AI_TARGET, SPATK, 8, BattleAIScript_82DD0BD
|
||||
if_stat_level_more_than AI_TARGET, SPDEF, 8, BattleAIScript_82DD0BD
|
||||
if_stat_level_more_than AI_TARGET, EVASION, 8, BattleAIScript_82DD0BD
|
||||
if_stat_level_more_than AI_TARGET, STAT_ATK, 8, BattleAIScript_82DD0BD
|
||||
if_stat_level_more_than AI_TARGET, STAT_DEF, 8, BattleAIScript_82DD0BD
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPATK, 8, BattleAIScript_82DD0BD
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPDEF, 8, BattleAIScript_82DD0BD
|
||||
if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, BattleAIScript_82DD0BD
|
||||
score -3
|
||||
goto BattleAIScript_82DD0C5
|
||||
|
||||
@@ -1570,7 +1569,7 @@ BattleAIScript_82DD2B7:
|
||||
end
|
||||
|
||||
BattleAIScript_82DD2B8:
|
||||
if_stat_level_more_than AI_TARGET, ATK, 3, BattleAIScript_82DD2D0
|
||||
if_stat_level_more_than AI_TARGET, STAT_ATK, 3, BattleAIScript_82DD2D0
|
||||
score +3
|
||||
get_turn_count
|
||||
if_not_equal 0, BattleAIScript_82DD2D2
|
||||
@@ -1988,17 +1987,17 @@ BattleAIScript_82DD645:
|
||||
if_equal TYPE_GHOST, BattleAIScript_82DD68A
|
||||
get_user_type2
|
||||
if_equal TYPE_GHOST, BattleAIScript_82DD68A
|
||||
if_stat_level_more_than AI_USER, DEF, 9, BattleAIScript_82DD693
|
||||
if_stat_level_more_than AI_USER, STAT_DEF, 9, BattleAIScript_82DD693
|
||||
if_random_less_than 128, BattleAIScript_82DD665
|
||||
score +1
|
||||
|
||||
BattleAIScript_82DD665:
|
||||
if_stat_level_more_than AI_USER, DEF, 7, BattleAIScript_82DD693
|
||||
if_stat_level_more_than AI_USER, STAT_DEF, 7, BattleAIScript_82DD693
|
||||
if_random_less_than 128, BattleAIScript_82DD675
|
||||
score +1
|
||||
|
||||
BattleAIScript_82DD675:
|
||||
if_stat_level_more_than AI_USER, DEF, 6, BattleAIScript_82DD693
|
||||
if_stat_level_more_than AI_USER, STAT_DEF, 6, BattleAIScript_82DD693
|
||||
if_random_less_than 128, BattleAIScript_82DD693
|
||||
score +1
|
||||
goto BattleAIScript_82DD693
|
||||
@@ -2063,7 +2062,7 @@ BattleAIScript_82DD75D:
|
||||
if_equal TYPE_GHOST, BattleAIScript_82DD77C
|
||||
get_user_type2
|
||||
if_equal TYPE_GHOST, BattleAIScript_82DD77C
|
||||
if_stat_level_more_than AI_USER, EVASION, 8, BattleAIScript_82DD782
|
||||
if_stat_level_more_than AI_USER, STAT_EVASION, 8, BattleAIScript_82DD782
|
||||
score -2
|
||||
goto BattleAIScript_82DD78A
|
||||
|
||||
@@ -2093,11 +2092,11 @@ BattleAIScript_82DD7A8:
|
||||
end
|
||||
|
||||
BattleAIScript_82DD7A9:
|
||||
if_stat_level_more_than AI_USER, ATK, 8, BattleAIScript_82DD7D6
|
||||
if_stat_level_more_than AI_USER, DEF, 8, BattleAIScript_82DD7D6
|
||||
if_stat_level_more_than AI_USER, SPATK, 8, BattleAIScript_82DD7D6
|
||||
if_stat_level_more_than AI_USER, SPDEF, 8, BattleAIScript_82DD7D6
|
||||
if_stat_level_more_than AI_USER, EVASION, 8, BattleAIScript_82DD7D6
|
||||
if_stat_level_more_than AI_USER, STAT_ATK, 8, BattleAIScript_82DD7D6
|
||||
if_stat_level_more_than AI_USER, STAT_DEF, 8, BattleAIScript_82DD7D6
|
||||
if_stat_level_more_than AI_USER, STAT_SPATK, 8, BattleAIScript_82DD7D6
|
||||
if_stat_level_more_than AI_USER, STAT_SPDEF, 8, BattleAIScript_82DD7D6
|
||||
if_stat_level_more_than AI_USER, STAT_EVASION, 8, BattleAIScript_82DD7D6
|
||||
goto BattleAIScript_82DD7FC
|
||||
|
||||
BattleAIScript_82DD7D6:
|
||||
@@ -2114,11 +2113,11 @@ BattleAIScript_82DD7EF:
|
||||
goto BattleAIScript_82DD844
|
||||
|
||||
BattleAIScript_82DD7FC:
|
||||
if_stat_level_more_than AI_USER, ATK, 7, BattleAIScript_82DD829
|
||||
if_stat_level_more_than AI_USER, DEF, 7, BattleAIScript_82DD829
|
||||
if_stat_level_more_than AI_USER, SPATK, 7, BattleAIScript_82DD829
|
||||
if_stat_level_more_than AI_USER, SPDEF, 7, BattleAIScript_82DD829
|
||||
if_stat_level_more_than AI_USER, EVASION, 7, BattleAIScript_82DD829
|
||||
if_stat_level_more_than AI_USER, STAT_ATK, 7, BattleAIScript_82DD829
|
||||
if_stat_level_more_than AI_USER, STAT_DEF, 7, BattleAIScript_82DD829
|
||||
if_stat_level_more_than AI_USER, STAT_SPATK, 7, BattleAIScript_82DD829
|
||||
if_stat_level_more_than AI_USER, STAT_SPDEF, 7, BattleAIScript_82DD829
|
||||
if_stat_level_more_than AI_USER, STAT_EVASION, 7, BattleAIScript_82DD829
|
||||
goto BattleAIScript_82DD842
|
||||
|
||||
BattleAIScript_82DD829:
|
||||
@@ -2209,19 +2208,19 @@ BattleAIScript_82DD8F1:
|
||||
end
|
||||
|
||||
BattleAIScript_82DD8F2:
|
||||
if_stat_level_more_than AI_TARGET, ATK, 8, BattleAIScript_82DD91F
|
||||
if_stat_level_more_than AI_TARGET, DEF, 8, BattleAIScript_82DD91F
|
||||
if_stat_level_more_than AI_TARGET, SPATK, 8, BattleAIScript_82DD91F
|
||||
if_stat_level_more_than AI_TARGET, SPDEF, 8, BattleAIScript_82DD91F
|
||||
if_stat_level_more_than AI_TARGET, EVASION, 8, BattleAIScript_82DD91F
|
||||
if_stat_level_more_than AI_TARGET, STAT_ATK, 8, BattleAIScript_82DD91F
|
||||
if_stat_level_more_than AI_TARGET, STAT_DEF, 8, BattleAIScript_82DD91F
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPATK, 8, BattleAIScript_82DD91F
|
||||
if_stat_level_more_than AI_TARGET, STAT_SPDEF, 8, BattleAIScript_82DD91F
|
||||
if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, BattleAIScript_82DD91F
|
||||
goto BattleAIScript_82DD957
|
||||
|
||||
BattleAIScript_82DD91F:
|
||||
if_stat_level_less_than AI_USER, ATK, 7, BattleAIScript_82DD954
|
||||
if_stat_level_less_than AI_USER, DEF, 7, BattleAIScript_82DD954
|
||||
if_stat_level_less_than AI_USER, SPATK, 7, BattleAIScript_82DD954
|
||||
if_stat_level_less_than AI_USER, SPDEF, 7, BattleAIScript_82DD954
|
||||
if_stat_level_less_than AI_USER, EVASION, 7, BattleAIScript_82DD952
|
||||
if_stat_level_less_than AI_USER, STAT_ATK, 7, BattleAIScript_82DD954
|
||||
if_stat_level_less_than AI_USER, STAT_DEF, 7, BattleAIScript_82DD954
|
||||
if_stat_level_less_than AI_USER, STAT_SPATK, 7, BattleAIScript_82DD954
|
||||
if_stat_level_less_than AI_USER, STAT_SPDEF, 7, BattleAIScript_82DD954
|
||||
if_stat_level_less_than AI_USER, STAT_EVASION, 7, BattleAIScript_82DD952
|
||||
if_random_less_than 50, BattleAIScript_82DD959
|
||||
goto BattleAIScript_82DD957
|
||||
|
||||
@@ -2516,7 +2515,7 @@ sAbilitiesTable_82DDBDF:
|
||||
BattleAIScript_82DDBF0:
|
||||
if_type_effectiveness AI_EFFECTIVENESS_x0_25, BattleAIScript_82DDC1D
|
||||
if_type_effectiveness AI_EFFECTIVENESS_x0_5, BattleAIScript_82DDC1D
|
||||
if_stat_level_less_than AI_USER, ATK, 6, BattleAIScript_82DDC1D
|
||||
if_stat_level_less_than AI_USER, STAT_ATK, 6, BattleAIScript_82DDC1D
|
||||
if_target_faster BattleAIScript_82DDC16
|
||||
if_hp_more_than AI_USER, 40, BattleAIScript_82DDC1D
|
||||
goto BattleAIScript_82DDC1F
|
||||
@@ -2931,12 +2930,12 @@ sMovesTable_82DDF75:
|
||||
BattleAIScript_82DDF7B:
|
||||
get_turn_count
|
||||
if_equal 0, Score_Minus2
|
||||
if_stat_level_more_than AI_USER, ATK, 8, Score_Plus3
|
||||
if_stat_level_more_than AI_USER, ATK, 7, Score_Plus2
|
||||
if_stat_level_more_than AI_USER, ATK, 6, Score_Plus1
|
||||
if_stat_level_more_than AI_USER, SPATK, 8, Score_Plus3
|
||||
if_stat_level_more_than AI_USER, SPATK, 7, Score_Plus2
|
||||
if_stat_level_more_than AI_USER, SPATK, 6, Score_Plus1
|
||||
if_stat_level_more_than AI_USER, STAT_ATK, 8, Score_Plus3
|
||||
if_stat_level_more_than AI_USER, STAT_ATK, 7, Score_Plus2
|
||||
if_stat_level_more_than AI_USER, STAT_ATK, 6, Score_Plus1
|
||||
if_stat_level_more_than AI_USER, STAT_SPATK, 8, Score_Plus3
|
||||
if_stat_level_more_than AI_USER, STAT_SPATK, 7, Score_Plus2
|
||||
if_stat_level_more_than AI_USER, STAT_SPATK, 6, Score_Plus1
|
||||
end
|
||||
|
||||
BattleAIScript_82DDFB3:
|
||||
@@ -3074,7 +3073,7 @@ BattleAIScript_82DE178:
|
||||
goto Score_Minus30_
|
||||
|
||||
BattleAIScript_82DE185:
|
||||
if_stat_level_more_than AI_TARGET, ATK, 7, BattleAIScript_82DE18F
|
||||
if_stat_level_more_than AI_TARGET, STAT_ATK, 7, BattleAIScript_82DE18F
|
||||
score +3
|
||||
|
||||
BattleAIScript_82DE18F:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
#include "constants/battle.h"
|
||||
#include "constants/battle_script_commands.h"
|
||||
#include "constants/battle_anim.h"
|
||||
#include "constants/battle_string_ids.h"
|
||||
#include "constants/items.h"
|
||||
@@ -6,8 +7,6 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "asm/macros/battle_script.inc"
|
||||
.include "constants/constants.inc"
|
||||
.include "constants/battle_constants.inc"
|
||||
.include "constants/battle_script_constants.inc"
|
||||
|
||||
.section script_data, "aw", %progbits
|
||||
|
||||
@@ -48,7 +47,7 @@ gBattlescriptsForSafariActions:: @ 82DBD58
|
||||
.4byte BattleScript_82DBEE3
|
||||
|
||||
BattleScript_BallThrow::
|
||||
jumpifword COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_WALLY_TUTORIAL, BattleScript_BallThrowByWally
|
||||
jumpifword CMP_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_WALLY_TUTORIAL, BattleScript_BallThrowByWally
|
||||
printstring STRINGID_PLAYERUSEDITEM
|
||||
handleballthrow
|
||||
|
||||
@@ -58,11 +57,11 @@ BattleScript_BallThrowByWally::
|
||||
|
||||
BattleScript_SafariBallThrow::
|
||||
printstring STRINGID_PLAYERUSEDITEM
|
||||
updatestatusicon ATTACKER
|
||||
updatestatusicon BS_ATTACKER
|
||||
handleballthrow
|
||||
|
||||
BattleScript_SuccessBallThrow::
|
||||
jumpifhalfword EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_PrintCaughtMonInfo
|
||||
jumpifhalfword CMP_EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_PrintCaughtMonInfo
|
||||
incrementgamestat 0xB
|
||||
BattleScript_PrintCaughtMonInfo::
|
||||
printstring STRINGID_GOTCHAPKMNCAUGHT
|
||||
@@ -94,8 +93,8 @@ BattleScript_WallyBallThrow::
|
||||
BattleScript_ShakeBallThrow::
|
||||
printfromtable gBallEscapeStringIds
|
||||
waitmessage 0x40
|
||||
jumpifword NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd
|
||||
jumpifbyte NOT_EQUAL, gNumSafariBalls, 0x0, BattleScript_ShakeBallThrowEnd
|
||||
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd
|
||||
jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0x0, BattleScript_ShakeBallThrowEnd
|
||||
printstring STRINGID_OUTOFSAFARIBALLS
|
||||
waitmessage 0x40
|
||||
setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS
|
||||
@@ -123,11 +122,11 @@ BattleScript_OpponentUsesHealItem::
|
||||
waitmessage 0x40
|
||||
useitemonopponent
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
||||
healthbarupdate ATTACKER
|
||||
datahpupdate ATTACKER
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
||||
waitmessage 0x40
|
||||
updatestatusicon ATTACKER
|
||||
updatestatusicon BS_ATTACKER
|
||||
setbyte sMOVEEND_STATE, 0xF
|
||||
moveend 0x1, 0x0
|
||||
finishaction
|
||||
@@ -141,7 +140,7 @@ BattleScript_OpponentUsesStatusCureItem::
|
||||
useitemonopponent
|
||||
printfromtable gTrainerItemCuredStatusStringIds
|
||||
waitmessage 0x40
|
||||
updatestatusicon ATTACKER
|
||||
updatestatusicon BS_ATTACKER
|
||||
setbyte sMOVEEND_STATE, 0xF
|
||||
moveend 0x1, 0x0
|
||||
finishaction
|
||||
@@ -190,7 +189,7 @@ BattleScript_ActionGetNear::
|
||||
BattleScript_ActionThrowPokeblock::
|
||||
printstring STRINGID_THREWPOKEBLOCKATPKMN
|
||||
waitmessage 0x40
|
||||
playanimation ATTACKER, B_ANIM_x4, NULL
|
||||
playanimation BS_ATTACKER, B_ANIM_x4, NULL
|
||||
printfromtable gSafariPokeblockResultStringIds
|
||||
waitmessage 0x40
|
||||
end2
|
||||
@@ -200,7 +199,7 @@ BattleScript_82DBEE3::
|
||||
waitmessage 0x40
|
||||
returnatktoball
|
||||
waitstate
|
||||
trainerslidein TARGET
|
||||
trainerslidein BS_TARGET
|
||||
waitstate
|
||||
printstring STRINGID_YOUTHROWABALLNOWRIGHT
|
||||
waitmessage 0x40
|
||||
|
||||
@@ -90,27 +90,6 @@
|
||||
#define TYPE_FORESIGHT 0xFE
|
||||
#define TYPE_ENDTABLE 0xFF
|
||||
|
||||
#define BS_GET_TARGET 0
|
||||
#define BS_GET_ATTACKER 1
|
||||
#define BS_GET_EFFECT_BANK 2
|
||||
#define BS_GET_gBank1 3
|
||||
#define BS_GET_BANK_0 7
|
||||
#define BS_ATTACKER_WITH_PARTNER 4 // for atk98_status_icon_update
|
||||
#define BS_GET_ATTACKER_SIDE 8 // for atk1E_jumpifability
|
||||
#define BS_GET_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability
|
||||
#define BS_GET_SCRIPTING_BANK 10
|
||||
#define BS_GET_OPPONENT1 12
|
||||
#define BS_GET_PLAYER2 13
|
||||
#define BS_GET_OPPONENT2 14
|
||||
|
||||
// for battle script commands
|
||||
#define CMP_EQUAL 0x0
|
||||
#define CMP_NOT_EQUAL 0x1
|
||||
#define CMP_GREATER_THAN 0x2
|
||||
#define CMP_LESS_THAN 0x3
|
||||
#define CMP_COMMON_BITS 0x4
|
||||
#define CMP_NO_COMMON_BITS 0x5
|
||||
|
||||
#define BATTLE_BUFFER_LINK_SIZE 0x1000
|
||||
|
||||
struct TrainerMonNoItemDefaultMoves
|
||||
@@ -511,6 +490,9 @@ struct BattleStruct
|
||||
typeArg = gBattleMoves[move].type; \
|
||||
}
|
||||
|
||||
#define IS_MOVE_PHYSICAL(moveType)(moveType < TYPE_MYSTERY)
|
||||
#define IS_MOVE_SPECIAL(moveType)(moveType > TYPE_MYSTERY)
|
||||
|
||||
#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
|
||||
@@ -678,7 +660,7 @@ extern u8 gCurrentActionFuncId;
|
||||
extern struct BattlePokemon gBattleMons[MAX_BATTLERS_COUNT];
|
||||
extern u8 gBattlerSpriteIds[MAX_BATTLERS_COUNT];
|
||||
extern u8 gCurrMovePos;
|
||||
extern u8 gUnknown_020241E9;
|
||||
extern u8 gChosenMovePos;
|
||||
extern u16 gCurrentMove;
|
||||
extern u16 gChosenMove;
|
||||
extern u16 gRandomMove;
|
||||
@@ -689,8 +671,8 @@ extern u16 gLastUsedItem;
|
||||
extern u8 gLastUsedAbility;
|
||||
extern u8 gBattlerAttacker;
|
||||
extern u8 gBattlerTarget;
|
||||
extern u8 gBank1;
|
||||
extern u8 gEffectBank;
|
||||
extern u8 gBattlerFainted;
|
||||
extern u8 gEffectBattler;
|
||||
extern u8 gStringBattler;
|
||||
extern u8 gAbsentBattlerFlags;
|
||||
extern u8 gCritMultiplier;
|
||||
@@ -710,7 +692,6 @@ extern u8 gLastHitBy[MAX_BATTLERS_COUNT];
|
||||
extern u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT];
|
||||
extern u8 gMoveResultFlags;
|
||||
extern u32 gHitMarker;
|
||||
extern u8 gUnknown_02024284[MAX_BATTLERS_COUNT];
|
||||
extern u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT];
|
||||
extern u8 gUnknown_0202428C;
|
||||
extern u16 gSideStatuses[2];
|
||||
@@ -726,7 +707,7 @@ extern struct ProtectStruct gProtectStructs[MAX_BATTLERS_COUNT];
|
||||
extern struct SpecialStatus gSpecialStatuses[MAX_BATTLERS_COUNT];
|
||||
extern u16 gBattleWeather;
|
||||
extern struct WishFutureKnock gWishFutureKnock;
|
||||
extern u16 gUnknown_020243FC;
|
||||
extern u16 gIntroSlideFlags;
|
||||
extern u8 gSentPokesToOpponent[2];
|
||||
extern u16 gDynamicBasePower;
|
||||
extern u16 gExpShareExp;
|
||||
@@ -738,7 +719,7 @@ extern u8 *gLinkBattleRecvBuffer;
|
||||
extern struct BattleResources *gBattleResources;
|
||||
extern u8 gActionSelectionCursor[MAX_BATTLERS_COUNT];
|
||||
extern u8 gMoveSelectionCursor[MAX_BATTLERS_COUNT];
|
||||
extern u8 gUnknown_020244B4[MAX_BATTLERS_COUNT];
|
||||
extern u8 gBattlerStatusSummaryTaskId[MAX_BATTLERS_COUNT];
|
||||
extern u8 gBattlerInMenuId;
|
||||
extern bool8 gDoingBattleAnim;
|
||||
extern u32 gTransformedPersonalities[MAX_BATTLERS_COUNT];
|
||||
|
||||
@@ -1,51 +1,6 @@
|
||||
#ifndef GUARD_BATTLE_SCRIPT_COMMANDS_H
|
||||
#define GUARD_BATTLE_SCRIPT_COMMANDS_H
|
||||
|
||||
#define NO_ACC_CALC 0xFFFE
|
||||
#define NO_ACC_CALC_CHECK_LOCK_ON 0xFFFF
|
||||
#define ACC_CURR_MOVE 0
|
||||
|
||||
#define CMP_EQUAL 0x0
|
||||
#define CMP_NOT_EQUAL 0x1
|
||||
#define CMP_GREATER_THAN 0x2
|
||||
#define CMP_LESS_THAN 0x3
|
||||
#define CMP_COMMON_BITS 0x4
|
||||
#define CMP_NO_COMMON_BITS 0x5
|
||||
|
||||
#define BS_ATTACKER_WITH_PARTNER 4 // for atk98_status_icon_update
|
||||
#define BS_GET_ATTACKER_SIDE 8 // for atk1E_jumpifability
|
||||
#define BS_GET_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability
|
||||
|
||||
#define ATK48_STAT_NEGATIVE 0x1
|
||||
#define ATK48_STAT_BY_TWO 0x2
|
||||
#define ATK48_BIT_x4 0x4
|
||||
#define ATK48_LOWER_FAIL_CHECK 0x8
|
||||
|
||||
#define ATK4F_DONT_CHECK_STATUSES 0x80
|
||||
|
||||
#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0
|
||||
#define VARIOUS_SET_MAGIC_COAT_TARGET 1
|
||||
#define VARIOUS_IS_RUNNING_IMPOSSIBLE 2
|
||||
#define VARIOUS_GET_MOVE_TARGET 3
|
||||
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
|
||||
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
|
||||
#define VARIOUS_EMIT_YESNOBOX 13
|
||||
#define VARIOUS_WAIT_CRY 18
|
||||
#define VARIOUS_RETURN_OPPONENT_MON1 19
|
||||
#define VARIOUS_RETURN_OPPONENT_MON2 20
|
||||
#define VARIOUS_SET_TELEPORT_OUTCOME 25
|
||||
#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
|
||||
|
||||
#define ATK80_DMG_CHANGE_SIGN 0
|
||||
#define ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP 1
|
||||
#define ATK80_DMG_DOUBLED 2
|
||||
|
||||
#define STAT_CHANGE_BS_PTR 0x1
|
||||
#define STAT_CHANGE_NOT_PROTECT_AFFECTED 0x20
|
||||
|
||||
#define STAT_CHANGE_WORKED 0
|
||||
#define STAT_CHANGE_DIDNT_WORK 1
|
||||
|
||||
#define WINDOW_CLEAR 0x1
|
||||
#define WINDOW_x80 0x80
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ extern const u8 BattleScript_SpikesOnAttacker[];
|
||||
extern const u8 BattleScript_82DAE7A[];
|
||||
extern const u8 BattleScript_SpikesOnTarget[];
|
||||
extern const u8 BattleScript_82DAEB1[];
|
||||
extern const u8 BattleScript_SpikesOngBank1[];
|
||||
extern const u8 BattleScript_SpikesOnFaintedBattler[];
|
||||
extern const u8 BattleScript_82DAEE8[];
|
||||
extern const u8 BattleScript_82DAEFE[];
|
||||
extern const u8 BattleScript_PerishSongTakesLife[];
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#define BS_GET_PLAYER2 13
|
||||
#define BS_GET_OPPONENT2 14
|
||||
|
||||
u8 GetBattleBank(u8 caseId);
|
||||
u8 GetBattlerForBattleScript(u8 caseId);
|
||||
void PressurePPLose(u8 bankDef, u8 bankAtk, u16 move);
|
||||
void PressurePPLoseOnUsingPerishSong(u8 bankAtk);
|
||||
void PressurePPLoseOnUsingImprision(u8 bankAtk);
|
||||
|
||||
97
include/constants/battle_script_commands.h
Normal file
97
include/constants/battle_script_commands.h
Normal file
@@ -0,0 +1,97 @@
|
||||
#ifndef GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H
|
||||
#define GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H
|
||||
|
||||
// Battle Scripting and BattleCommunication addresses
|
||||
#define sPAINSPLIT_HP gBattleScripting
|
||||
#define sBIDE_DMG gBattleScripting + 4
|
||||
#define sMULTIHIT_STRING gBattleScripting + 8
|
||||
#define sDMG_MULTIPLIER gBattleScripting + 0xE
|
||||
#define sTWOTURN_STRINGID gBattleScripting + 0xF
|
||||
#define sB_ANIM_ARG1 gBattleScripting + 0x10
|
||||
#define sB_ANIM_ARG2 gBattleScripting + 0x11
|
||||
#define sTRIPLE_KICK_POWER gBattleScripting + 0x12
|
||||
#define sMOVEEND_STATE gBattleScripting + 0x14
|
||||
#define sBANK_WITH_ABILITY gBattleScripting + 0x15
|
||||
#define sMULTIHIT_EFFECT gBattleScripting + 0x16
|
||||
#define sBANK gBattleScripting + 0x17
|
||||
#define sB_ANIM_TURN gBattleScripting + 0x18
|
||||
#define sB_ANIM_TARGETS_HIT gBattleScripting + 0x19
|
||||
#define sSTATCHANGER gBattleScripting + 0x1A
|
||||
#define sFIELD_1B gBattleScripting + 0x1B
|
||||
#define sGIVEEXP_STATE gBattleScripting + 0x1C
|
||||
#define sBATTLE_STYLE gBattleScripting + 0x1D
|
||||
#define sLVLBOX_STATE gBattleScripting + 0x1E
|
||||
#define sLEARNMOVE_STATE gBattleScripting + 0x1F
|
||||
#define sFIELD_20 gBattleScripting + 0x20
|
||||
#define sRESHOW_MAIN_STATE gBattleScripting + 0x21
|
||||
#define sRESHOW_HELPER_STATE gBattleScripting + 0x22
|
||||
#define sFIELD_23 gBattleScripting + 0x23
|
||||
#define sFIELD_24 gBattleScripting + 0x24
|
||||
#define sMULTIPLAYER_ID gBattleScripting + 0x25
|
||||
|
||||
#define cEFFECT_CHOOSER gBattleCommunication + 3
|
||||
#define cMULTISTRING_CHOOSER gBattleCommunication + 5
|
||||
|
||||
// Battle Script defines for getting the wanted battler
|
||||
#define BS_TARGET 0
|
||||
#define BS_ATTACKER 1
|
||||
#define BS_EFFECT_BATTLER 2
|
||||
#define BS_FAINTED 3
|
||||
#define BS_BANK_0 7
|
||||
#define BS_ATTACKER_WITH_PARTNER 4 // for atk98_status_icon_update
|
||||
#define BS_ATTACKER_SIDE 8 // for atk1E_jumpifability
|
||||
#define BS_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability
|
||||
#define BS_SCRIPTING 10
|
||||
#define BS_PLAYER1 11
|
||||
#define BS_OPPONENT1 12
|
||||
#define BS_PLAYER2 13
|
||||
#define BS_OPPONENT2 14
|
||||
|
||||
// atk 01, accuracy calc
|
||||
#define NO_ACC_CALC 0xFFFE
|
||||
#define NO_ACC_CALC_CHECK_LOCK_ON 0xFFFF
|
||||
#define ACC_CURR_MOVE 0
|
||||
|
||||
// compare operands
|
||||
#define CMP_EQUAL 0x0
|
||||
#define CMP_NOT_EQUAL 0x1
|
||||
#define CMP_GREATER_THAN 0x2
|
||||
#define CMP_LESS_THAN 0x3
|
||||
#define CMP_COMMON_BITS 0x4
|
||||
#define CMP_NO_COMMON_BITS 0x5
|
||||
|
||||
// atk76, various
|
||||
#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0
|
||||
#define VARIOUS_SET_MAGIC_COAT_TARGET 1
|
||||
#define VARIOUS_IS_RUNNING_IMPOSSIBLE 2
|
||||
#define VARIOUS_GET_MOVE_TARGET 3
|
||||
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
|
||||
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
|
||||
#define VARIOUS_EMIT_YESNOBOX 13
|
||||
#define VARIOUS_WAIT_CRY 18
|
||||
#define VARIOUS_RETURN_OPPONENT_MON1 19
|
||||
#define VARIOUS_RETURN_OPPONENT_MON2 20
|
||||
#define VARIOUS_SET_TELEPORT_OUTCOME 25
|
||||
#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
|
||||
|
||||
// atk80, dmg manipulation
|
||||
#define ATK80_DMG_CHANGE_SIGN 0
|
||||
#define ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP 1
|
||||
#define ATK80_DMG_DOUBLED 2
|
||||
|
||||
// atk4F, a flag used for the jumpifcantswitch command
|
||||
#define ATK4F_DONT_CHECK_STATUSES 0x80
|
||||
|
||||
// statchange defines
|
||||
#define STAT_CHANGE_BS_PTR 0x1
|
||||
#define STAT_CHANGE_NOT_PROTECT_AFFECTED 0x20
|
||||
#define STAT_CHANGE_WORKED 0
|
||||
#define STAT_CHANGE_DIDNT_WORK 1
|
||||
|
||||
// atk48
|
||||
#define ATK48_STAT_NEGATIVE 0x1
|
||||
#define ATK48_STAT_BY_TWO 0x2
|
||||
#define ATK48_BIT_x4 0x4
|
||||
#define ATK48_LOWER_FAIL_CHECK 0x8
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H
|
||||
80
include/constants/pokemon.h
Normal file
80
include/constants/pokemon.h
Normal file
@@ -0,0 +1,80 @@
|
||||
#ifndef GUARD_CONSTANTS_POKEMON_H
|
||||
#define GUARD_CONSTANTS_POKEMON_H
|
||||
|
||||
// Pokemon types
|
||||
#define TYPE_NORMAL 0x00
|
||||
#define TYPE_FIGHTING 0x01
|
||||
#define TYPE_FLYING 0x02
|
||||
#define TYPE_POISON 0x03
|
||||
#define TYPE_GROUND 0x04
|
||||
#define TYPE_ROCK 0x05
|
||||
#define TYPE_BUG 0x06
|
||||
#define TYPE_GHOST 0x07
|
||||
#define TYPE_STEEL 0x08
|
||||
#define TYPE_MYSTERY 0x09
|
||||
#define TYPE_FIRE 0x0a
|
||||
#define TYPE_WATER 0x0b
|
||||
#define TYPE_GRASS 0x0c
|
||||
#define TYPE_ELECTRIC 0x0d
|
||||
#define TYPE_PSYCHIC 0x0e
|
||||
#define TYPE_ICE 0x0f
|
||||
#define TYPE_DRAGON 0x10
|
||||
#define TYPE_DARK 0x11
|
||||
#define NUMBER_OF_MON_TYPES 0x12
|
||||
|
||||
// Pokemon egg groups
|
||||
#define EGG_GROUP_NONE 0
|
||||
#define EGG_GROUP_MONSTER 1
|
||||
#define EGG_GROUP_WATER_1 2
|
||||
#define EGG_GROUP_BUG 3
|
||||
#define EGG_GROUP_FLYING 4
|
||||
#define EGG_GROUP_FIELD 5
|
||||
#define EGG_GROUP_FAIRY 6
|
||||
#define EGG_GROUP_GRASS 7
|
||||
#define EGG_GROUP_HUMAN_LIKE 8
|
||||
#define EGG_GROUP_WATER_3 9
|
||||
#define EGG_GROUP_MINERAL 10
|
||||
#define EGG_GROUP_AMORPHOUS 11
|
||||
#define EGG_GROUP_WATER_2 12
|
||||
#define EGG_GROUP_DITTO 13
|
||||
#define EGG_GROUP_DRAGON 14
|
||||
#define EGG_GROUP_UNDISCOVERED 15
|
||||
|
||||
// Pokemon natures
|
||||
#define NATURE_HARDY 0
|
||||
#define NATURE_LONELY 1
|
||||
#define NATURE_BRAVE 2
|
||||
#define NATURE_ADAMANT 3
|
||||
#define NATURE_NAUGHTY 4
|
||||
#define NATURE_BOLD 5
|
||||
#define NATURE_DOCILE 6
|
||||
#define NATURE_RELAXED 7
|
||||
#define NATURE_IMPISH 8
|
||||
#define NATURE_LAX 9
|
||||
#define NATURE_TIMID 10
|
||||
#define NATURE_HASTY 11
|
||||
#define NATURE_SERIOUS 12
|
||||
#define NATURE_JOLLY 13
|
||||
#define NATURE_NAIVE 14
|
||||
#define NATURE_MODEST 15
|
||||
#define NATURE_MILD 16
|
||||
#define NATURE_QUIET 17
|
||||
#define NATURE_BASHFUL 18
|
||||
#define NATURE_RASH 19
|
||||
#define NATURE_CALM 20
|
||||
#define NATURE_GENTLE 21
|
||||
#define NATURE_SASSY 22
|
||||
#define NATURE_CAREFUL 23
|
||||
#define NATURE_QUIRKY 24
|
||||
|
||||
// Pokemon Stats
|
||||
#define STAT_HP 0
|
||||
#define STAT_ATK 1
|
||||
#define STAT_DEF 2
|
||||
#define STAT_SPEED 3
|
||||
#define STAT_SPATK 4
|
||||
#define STAT_SPDEF 5
|
||||
#define STAT_ACC 6 // only in battles
|
||||
#define STAT_EVASION 7 // only in battles
|
||||
|
||||
#endif // GUARD_CONSTANTS_POKEMON_H
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef GUARD_POKEMON_H
|
||||
#define GUARD_POKEMON_H
|
||||
|
||||
#include "constants/pokemon.h"
|
||||
|
||||
#define MON_DATA_PERSONALITY 0
|
||||
#define MON_DATA_OT_ID 1
|
||||
#define MON_DATA_NICKNAME 2
|
||||
@@ -107,81 +109,11 @@
|
||||
#define MON_FEMALE 0xFE
|
||||
#define MON_GENDERLESS 0xFF
|
||||
|
||||
#define TYPE_NORMAL 0x00
|
||||
#define TYPE_FIGHTING 0x01
|
||||
#define TYPE_FLYING 0x02
|
||||
#define TYPE_POISON 0x03
|
||||
#define TYPE_GROUND 0x04
|
||||
#define TYPE_ROCK 0x05
|
||||
#define TYPE_BUG 0x06
|
||||
#define TYPE_GHOST 0x07
|
||||
#define TYPE_STEEL 0x08
|
||||
#define TYPE_MYSTERY 0x09
|
||||
#define TYPE_FIRE 0x0a
|
||||
#define TYPE_WATER 0x0b
|
||||
#define TYPE_GRASS 0x0c
|
||||
#define TYPE_ELECTRIC 0x0d
|
||||
#define TYPE_PSYCHIC 0x0e
|
||||
#define TYPE_ICE 0x0f
|
||||
#define TYPE_DRAGON 0x10
|
||||
#define TYPE_DARK 0x11
|
||||
|
||||
#define NUMBER_OF_MON_TYPES 0x12
|
||||
|
||||
#define MAX_TOTAL_EVS 510
|
||||
#define NUM_STATS 6
|
||||
#define UNOWN_FORM_COUNT 28
|
||||
#define MAX_MON_LEVEL 100
|
||||
|
||||
enum
|
||||
{
|
||||
EGG_GROUP_NONE,
|
||||
EGG_GROUP_MONSTER,
|
||||
EGG_GROUP_WATER_1,
|
||||
EGG_GROUP_BUG,
|
||||
EGG_GROUP_FLYING,
|
||||
EGG_GROUP_FIELD,
|
||||
EGG_GROUP_FAIRY,
|
||||
EGG_GROUP_GRASS,
|
||||
EGG_GROUP_HUMAN_LIKE,
|
||||
EGG_GROUP_WATER_3,
|
||||
EGG_GROUP_MINERAL,
|
||||
EGG_GROUP_AMORPHOUS,
|
||||
EGG_GROUP_WATER_2,
|
||||
EGG_GROUP_DITTO,
|
||||
EGG_GROUP_DRAGON,
|
||||
EGG_GROUP_UNDISCOVERED
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
NATURE_HARDY,
|
||||
NATURE_LONELY,
|
||||
NATURE_BRAVE,
|
||||
NATURE_ADAMANT,
|
||||
NATURE_NAUGHTY,
|
||||
NATURE_BOLD,
|
||||
NATURE_DOCILE,
|
||||
NATURE_RELAXED,
|
||||
NATURE_IMPISH,
|
||||
NATURE_LAX,
|
||||
NATURE_TIMID,
|
||||
NATURE_HASTY,
|
||||
NATURE_SERIOUS,
|
||||
NATURE_JOLLY,
|
||||
NATURE_NAIVE,
|
||||
NATURE_MODEST,
|
||||
NATURE_MILD,
|
||||
NATURE_QUIET,
|
||||
NATURE_BASHFUL,
|
||||
NATURE_RASH,
|
||||
NATURE_CALM,
|
||||
NATURE_GENTLE,
|
||||
NATURE_SASSY,
|
||||
NATURE_CAREFUL,
|
||||
NATURE_QUIRKY,
|
||||
};
|
||||
|
||||
struct PokemonSubstruct0
|
||||
{
|
||||
u16 species;
|
||||
@@ -374,28 +306,6 @@ struct BattlePokemon
|
||||
/*0x54*/ u32 otId;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
STAT_STAGE_HP, // 0
|
||||
STAT_STAGE_ATK, // 1
|
||||
STAT_STAGE_DEF, // 2
|
||||
STAT_STAGE_SPEED, // 3
|
||||
STAT_STAGE_SPATK, // 4
|
||||
STAT_STAGE_SPDEF, // 5
|
||||
STAT_STAGE_ACC, // 6
|
||||
STAT_STAGE_EVASION, // 7
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
STAT_HP, // 0
|
||||
STAT_ATK, // 1
|
||||
STAT_DEF, // 2
|
||||
STAT_SPD, // 3
|
||||
STAT_SPATK, // 4
|
||||
STAT_SPDEF, // 5
|
||||
};
|
||||
|
||||
struct BaseStats
|
||||
{
|
||||
/* 0x00 */ u8 baseHP;
|
||||
|
||||
@@ -7,9 +7,9 @@ extern u8 gUnknown_0203C7B4;
|
||||
|
||||
void sub_8184DA4(u8 arg0);
|
||||
void sub_8184E58(void);
|
||||
void RecordedBattle_SetBattlerAction(u8 bank, u8 action);
|
||||
void RecordedBattle_ClearBattlerAction(u8 bank, u8 bytesToClear);
|
||||
u8 RecordedBattle_GetBattlerAction(u8 bank);
|
||||
void RecordedBattle_SetBattlerAction(u8 battlerId, u8 action);
|
||||
void RecordedBattle_ClearBattlerAction(u8 battlerId, u8 bytesToClear);
|
||||
u8 RecordedBattle_GetBattlerAction(u8 battlerId);
|
||||
u8 sub_81850D0(void);
|
||||
u8 sub_81850DC(u8 *arg0);
|
||||
void sub_81851A8(u8 *arg0);
|
||||
@@ -19,13 +19,13 @@ void PlayRecordedBattle(void (*CB2_After)(void));
|
||||
u8 sub_8185EA0(void);
|
||||
u8 sub_8185EAC(void);
|
||||
void RecordedBattle_SaveParties(void);
|
||||
u8 GetActiveBankLinkPlayerGender(void);
|
||||
u8 GetActiveBattlerLinkPlayerGender(void);
|
||||
void sub_8185F84(void);
|
||||
void sub_8185F90(u16 arg0);
|
||||
u8 sub_8185FAC(void);
|
||||
u8 GetBattleStyleInRecordedBattle(void);
|
||||
u8 GetTextSpeedInRecordedBattle(void);
|
||||
void RecordedBattle_CopyBankMoves(void);
|
||||
void RecordedBattle_CopyBattlerMoves(void);
|
||||
void sub_818603C(u8 arg0);
|
||||
u32 GetAiScriptsInRecordedBattle(void);
|
||||
void sub_8186444(void);
|
||||
|
||||
@@ -1697,7 +1697,7 @@ static void LinkOpponentHandleFaintingCry(void)
|
||||
static void LinkOpponentHandleIntroSlide(void)
|
||||
{
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gUnknown_020243FC |= 1;
|
||||
gIntroSlideFlags |= 1;
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -1719,7 +1719,7 @@ static void LinkOpponentHandleIntroTrainerBallThrow(void)
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_28;
|
||||
@@ -1779,7 +1779,7 @@ static void LinkOpponentHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
}
|
||||
|
||||
gUnknown_020244B4[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
@@ -1801,7 +1801,7 @@ static void sub_806782C(void)
|
||||
static void LinkOpponentHandleCmd49(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
||||
@@ -1521,7 +1521,7 @@ static void LinkPartnerHandleFaintingCry(void)
|
||||
static void LinkPartnerHandleIntroSlide(void)
|
||||
{
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gUnknown_020243FC |= 1;
|
||||
gIntroSlideFlags |= 1;
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -1567,7 +1567,7 @@ static void LinkPartnerHandleIntroTrainerBallThrow(void)
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_112;
|
||||
@@ -1614,7 +1614,7 @@ static void LinkPartnerHandleDrawPartyStatusSummary(void)
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gUnknown_020244B4[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
@@ -1636,7 +1636,7 @@ static void sub_814DE9C(void)
|
||||
static void LinkPartnerHandleCmd49(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
||||
@@ -1846,7 +1846,7 @@ static void OpponentHandleFaintingCry(void)
|
||||
static void OpponentHandleIntroSlide(void)
|
||||
{
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gUnknown_020243FC |= 1;
|
||||
gIntroSlideFlags |= 1;
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -1868,7 +1868,7 @@ static void OpponentHandleIntroTrainerBallThrow(void)
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_26;
|
||||
@@ -1933,7 +1933,7 @@ static void OpponentHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
}
|
||||
|
||||
gUnknown_020244B4[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
@@ -1955,7 +1955,7 @@ static void sub_8062A2C(void)
|
||||
static void OpponentHandleCmd49(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ extern u8 gUnknown_0203CF00[];
|
||||
extern u16 gBattle_BG0_X;
|
||||
extern u16 gBattle_BG0_Y;
|
||||
extern s32 gUnknown_0203CD70;
|
||||
extern u16 gUnknown_020243FC;
|
||||
extern struct UnusedControllerStruct gUnknown_02022D0C;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
extern struct SpriteTemplate gUnknown_0202499C;
|
||||
@@ -2929,7 +2928,7 @@ static void PlayerHandleFaintingCry(void)
|
||||
static void PlayerHandleIntroSlide(void)
|
||||
{
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gUnknown_020243FC |= 1;
|
||||
gIntroSlideFlags |= 1;
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -2957,7 +2956,7 @@ static void PlayerHandleIntroTrainerBallThrow(void)
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_21;
|
||||
@@ -3015,7 +3014,7 @@ static void PlayerHandleDrawPartyStatusSummary(void)
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gUnknown_020244B4[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
@@ -3037,7 +3036,7 @@ static void sub_805CE38(void)
|
||||
static void PlayerHandleCmd49(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
extern struct SpriteTemplate gUnknown_0202499C;
|
||||
extern u16 gBattle_BG0_X;
|
||||
extern u16 gBattle_BG0_Y;
|
||||
extern u16 gUnknown_020243FC;
|
||||
extern struct UnusedControllerStruct gUnknown_02022D0C;
|
||||
|
||||
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
|
||||
@@ -1775,7 +1774,7 @@ static void PlayerPartnerHandleFaintingCry(void)
|
||||
static void PlayerPartnerHandleIntroSlide(void)
|
||||
{
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gUnknown_020243FC |= 1;
|
||||
gIntroSlideFlags |= 1;
|
||||
PlayerPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -1814,7 +1813,7 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(void)
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_77;
|
||||
@@ -1861,7 +1860,7 @@ static void PlayerPartnerHandleDrawPartyStatusSummary(void)
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gUnknown_020244B4[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
@@ -1883,7 +1882,7 @@ static void sub_81BE498(void)
|
||||
static void PlayerPartnerHandleCmd49(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
PlayerPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
extern struct SpriteTemplate gUnknown_0202499C;
|
||||
extern u16 gBattle_BG0_X;
|
||||
extern u16 gBattle_BG0_Y;
|
||||
extern u16 gUnknown_020243FC;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
extern struct UnusedControllerStruct gUnknown_02022D0C;
|
||||
extern u8 gUnknown_0203C7B4;
|
||||
@@ -1236,7 +1235,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
trainerPicId = PlayerGenderToFrontTrainerPicId(GetActiveBankLinkPlayerGender());
|
||||
trainerPicId = PlayerGenderToFrontTrainerPicId(GetActiveBattlerLinkPlayerGender());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1639,7 +1638,7 @@ static void RecordedOpponentHandleFaintingCry(void)
|
||||
static void RecordedOpponentHandleIntroSlide(void)
|
||||
{
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gUnknown_020243FC |= 1;
|
||||
gIntroSlideFlags |= 1;
|
||||
RecordedOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -1661,7 +1660,7 @@ static void RecordedOpponentHandleIntroTrainerBallThrow(void)
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_70;
|
||||
@@ -1721,7 +1720,7 @@ static void RecordedOpponentHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
}
|
||||
|
||||
gUnknown_020244B4[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
@@ -1743,7 +1742,7 @@ static void sub_818975C(void)
|
||||
static void RecordedOpponentHandleCmd49(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
RecordedOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
extern struct SpriteTemplate gUnknown_0202499C;
|
||||
extern u16 gBattle_BG0_X;
|
||||
extern u16 gBattle_BG0_Y;
|
||||
extern u16 gUnknown_020243FC;
|
||||
extern u32 gTransformedPersonalities[MAX_BATTLERS_COUNT];
|
||||
extern u8 gUnknown_0203C7B4;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
@@ -1208,7 +1207,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void)
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_x2000000)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
trainerPicId = GetActiveBankLinkPlayerGender();
|
||||
trainerPicId = GetActiveBattlerLinkPlayerGender();
|
||||
else
|
||||
trainerPicId = gLinkPlayers[gUnknown_0203C7B4].gender;
|
||||
}
|
||||
@@ -1662,7 +1661,7 @@ static void RecordedPlayerHandleFaintingCry(void)
|
||||
static void RecordedPlayerHandleIntroSlide(void)
|
||||
{
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gUnknown_020243FC |= 1;
|
||||
gIntroSlideFlags |= 1;
|
||||
RecordedPlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -1697,7 +1696,7 @@ static void RecordedPlayerHandleIntroTrainerBallThrow(void)
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_120;
|
||||
@@ -1744,7 +1743,7 @@ static void RecordedPlayerHandleDrawPartyStatusSummary(void)
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gUnknown_020244B4[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
@@ -1766,7 +1765,7 @@ static void sub_818CDF4(void)
|
||||
static void RecordedPlayerHandleCmd49(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
RecordedPlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ extern struct BattlePokemon gBattleMons[MAX_BATTLERS_COUNT];
|
||||
extern struct SpriteTemplate gUnknown_0202499C;
|
||||
extern u16 gBattle_BG0_X;
|
||||
extern u16 gBattle_BG0_Y;
|
||||
extern u16 gUnknown_020243FC;
|
||||
|
||||
extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[];
|
||||
|
||||
@@ -634,7 +633,7 @@ static void SafariHandleFaintingCry(void)
|
||||
static void SafariHandleIntroSlide(void)
|
||||
{
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gUnknown_020243FC |= 1;
|
||||
gIntroSlideFlags |= 1;
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ extern struct SpriteTemplate gUnknown_0202499C;
|
||||
extern u16 gBattle_BG0_X;
|
||||
extern u16 gBattle_BG0_Y;
|
||||
extern s32 gUnknown_0203CD70;
|
||||
extern u16 gUnknown_020243FC;
|
||||
extern struct UnusedControllerStruct gUnknown_02022D0C;
|
||||
|
||||
extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[];
|
||||
@@ -1429,7 +1428,7 @@ static void WallyHandleFaintingCry(void)
|
||||
static void WallyHandleIntroSlide(void)
|
||||
{
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gUnknown_020243FC |= 1;
|
||||
gIntroSlideFlags |= 1;
|
||||
WallyBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -1457,7 +1456,7 @@ static void WallyHandleIntroTrainerBallThrow(void)
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gUnknown_020244B4[gActiveBattler]].func = sub_8073C30;
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_21;
|
||||
@@ -1518,7 +1517,7 @@ static void WallyHandleDrawPartyStatusSummary(void)
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gUnknown_020244B4[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
WallyBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data)
|
||||
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_SIZE_LO] = alignedSize;
|
||||
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_SIZE_HI] = (alignedSize & 0x0000FF00) >> 8;
|
||||
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ABSENT_BANK_FLAGS] = gAbsentBattlerFlags;
|
||||
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_EFFECT_BANK] = gEffectBank;
|
||||
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_EFFECT_BANK] = gEffectBattler;
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_DATA + i] = data[i];
|
||||
@@ -899,7 +899,7 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId)
|
||||
gBattlerAttacker = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 2];
|
||||
gBattlerTarget = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 3];
|
||||
gAbsentBattlerFlags = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 6];
|
||||
gEffectBank = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 7];
|
||||
gEffectBattler = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 7];
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "contest.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
extern u16 gUnknown_020243FC;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE1;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE2;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
@@ -356,7 +355,7 @@ void sub_805D770(struct Sprite *sprite, bool8 arg1)
|
||||
|
||||
void sub_805D7AC(struct Sprite *sprite)
|
||||
{
|
||||
if (!(gUnknown_020243FC & 1))
|
||||
if (!(gIntroSlideFlags & 1))
|
||||
{
|
||||
sprite->pos2.x += sprite->data[0];
|
||||
if (sprite->pos2.x == 0)
|
||||
|
||||
@@ -1531,7 +1531,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar
|
||||
gSprites[barSpriteId].pos1.x += 96;
|
||||
}
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
ballIconSpritesIds[i] = CreateSpriteAtEnd(&sStatusSummaryBallsSpriteTemplates[isOpponent], bar_X, bar_Y - 4, 9);
|
||||
|
||||
|
||||
@@ -116,11 +116,11 @@ extern void PadNameString(u8* dst, u8 arg2); //
|
||||
extern void sub_81B9150(void);
|
||||
extern void sub_800AC34(void);
|
||||
extern void sub_80B3AF8(u8 taskId); // cable club
|
||||
extern void sub_8076918(u8 bank);
|
||||
extern void sub_8076918(u8 battlerId);
|
||||
extern void SetHealthboxSpriteVisible(u8 healthoxSpriteId);
|
||||
extern void sub_81A56B4(void); // battle frontier 2
|
||||
extern u8 sub_81A9E28(void); // battle frontier 2
|
||||
extern void sub_81A56E8(u8 bank); // battle frontier 2
|
||||
extern void sub_81A56E8(u8 battlerId); // battle frontier 2
|
||||
extern void sub_81B8FB0(u8, u8); // party menu
|
||||
extern u8 pokemon_order_func(u8); // party menu
|
||||
extern bool8 InBattlePyramid(void);
|
||||
@@ -168,7 +168,7 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void);
|
||||
static void TryDoEventsBeforeFirstTurn(void);
|
||||
static void HandleTurnActionSelectionState(void);
|
||||
static void RunTurnActionsFunctions(void);
|
||||
static void SetActionsAndBanksTurnOrder(void);
|
||||
static void SetActionsAndBattlersTurnOrder(void);
|
||||
static void sub_803CDF8(void);
|
||||
static bool8 sub_803CDB8(void);
|
||||
static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void);
|
||||
@@ -197,7 +197,7 @@ static void HandleAction_NothingIsFainted(void);
|
||||
static void HandleAction_ActionFinished(void);
|
||||
|
||||
// EWRAM vars
|
||||
EWRAM_DATA u32 gUnknown_02022F88[25] = {0};
|
||||
EWRAM_DATA static u32 sUnusedUnknownArray[25] = {0};
|
||||
EWRAM_DATA u32 gBattleTypeFlags = 0;
|
||||
EWRAM_DATA u8 gBattleTerrain = 0;
|
||||
EWRAM_DATA u32 gUnknown_02022FF4 = 0;
|
||||
@@ -219,7 +219,7 @@ EWRAM_DATA u8 gCurrentActionFuncId = 0;
|
||||
EWRAM_DATA struct BattlePokemon gBattleMons[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattlerSpriteIds[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gCurrMovePos = 0;
|
||||
EWRAM_DATA u8 gUnknown_020241E9 = 0;
|
||||
EWRAM_DATA u8 gChosenMovePos = 0;
|
||||
EWRAM_DATA u16 gCurrentMove = 0;
|
||||
EWRAM_DATA u16 gChosenMove = 0;
|
||||
EWRAM_DATA u16 gRandomMove = 0;
|
||||
@@ -230,8 +230,8 @@ EWRAM_DATA u16 gLastUsedItem = 0;
|
||||
EWRAM_DATA u8 gLastUsedAbility = 0;
|
||||
EWRAM_DATA u8 gBattlerAttacker = 0;
|
||||
EWRAM_DATA u8 gBattlerTarget = 0;
|
||||
EWRAM_DATA u8 gBank1 = 0;
|
||||
EWRAM_DATA u8 gEffectBank = 0;
|
||||
EWRAM_DATA u8 gBattlerFainted = 0;
|
||||
EWRAM_DATA u8 gEffectBattler = 0;
|
||||
EWRAM_DATA u8 gStringBattler = 0;
|
||||
EWRAM_DATA u8 gAbsentBattlerFlags = 0;
|
||||
EWRAM_DATA u8 gCritMultiplier = 0;
|
||||
@@ -251,7 +251,7 @@ EWRAM_DATA u8 gLastHitBy[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gMoveResultFlags = 0;
|
||||
EWRAM_DATA u32 gHitMarker = 0;
|
||||
EWRAM_DATA u8 gUnknown_02024284[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA static u8 sUnusedBattlersArray[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gUnknown_0202428C = 0;
|
||||
EWRAM_DATA u16 gSideStatuses[2] = {0};
|
||||
@@ -267,7 +267,7 @@ EWRAM_DATA struct ProtectStruct gProtectStructs[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA struct SpecialStatus gSpecialStatuses[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u16 gBattleWeather = 0;
|
||||
EWRAM_DATA struct WishFutureKnock gWishFutureKnock = {0};
|
||||
EWRAM_DATA u16 gUnknown_020243FC = 0;
|
||||
EWRAM_DATA u16 gIntroSlideFlags = 0;
|
||||
EWRAM_DATA u8 gSentPokesToOpponent[2] = {0};
|
||||
EWRAM_DATA u16 gDynamicBasePower = 0;
|
||||
EWRAM_DATA u16 gExpShareExp = 0;
|
||||
@@ -279,7 +279,7 @@ EWRAM_DATA u8 *gLinkBattleRecvBuffer = NULL;
|
||||
EWRAM_DATA struct BattleResources *gBattleResources = NULL;
|
||||
EWRAM_DATA u8 gActionSelectionCursor[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gMoveSelectionCursor[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gUnknown_020244B4[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattlerStatusSummaryTaskId[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattlerInMenuId = 0;
|
||||
EWRAM_DATA bool8 gDoingBattleAnim = FALSE;
|
||||
EWRAM_DATA u32 gTransformedPersonalities[MAX_BATTLERS_COUNT] = {0};
|
||||
@@ -1740,7 +1740,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
|
||||
else
|
||||
personalityValue = 0x88;
|
||||
|
||||
for (j = 0; gTrainers[trainerNum].trainerName[j] != 0xFF; j++)
|
||||
for (j = 0; gTrainers[trainerNum].trainerName[j] != EOS; j++)
|
||||
nameHash += gTrainers[trainerNum].trainerName[j];
|
||||
|
||||
switch (gTrainers[trainerNum].partyFlags)
|
||||
@@ -2425,7 +2425,7 @@ void oac_poke_opponent(struct Sprite *sprite)
|
||||
|
||||
static void sub_803980C(struct Sprite *sprite)
|
||||
{
|
||||
if ((gUnknown_020243FC & 1) == 0)
|
||||
if ((gIntroSlideFlags & 1) == 0)
|
||||
{
|
||||
sprite->pos2.x += 2;
|
||||
if (sprite->pos2.x == 0)
|
||||
@@ -2479,7 +2479,7 @@ static void sub_80398D0(struct Sprite *sprite)
|
||||
{
|
||||
sprite->invisible = FALSE;
|
||||
sprite->callback = SpriteCallbackDummy_2;
|
||||
gUnknown_02022F88[0] = 0;
|
||||
sUnusedUnknownArray[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2602,7 +2602,7 @@ void sub_8039BB4(struct Sprite *sprite)
|
||||
|
||||
static void oac_poke_ally_(struct Sprite *sprite)
|
||||
{
|
||||
if ((gUnknown_020243FC & 1) == 0)
|
||||
if ((gIntroSlideFlags & 1) == 0)
|
||||
{
|
||||
sprite->pos2.x -= 2;
|
||||
if (sprite->pos2.x == 0)
|
||||
@@ -2624,7 +2624,7 @@ static void SpriteCallbackDummy_3(struct Sprite *sprite)
|
||||
|
||||
void sub_8039C00(struct Sprite *sprite)
|
||||
{
|
||||
if (!(gUnknown_020243FC & 1))
|
||||
if (!(gIntroSlideFlags & 1))
|
||||
{
|
||||
sprite->pos2.x += sprite->data[1];
|
||||
sprite->pos2.y += sprite->data[2];
|
||||
@@ -2773,7 +2773,7 @@ static void BattleStartClearSetData(void)
|
||||
dataPtr[j] = 0;
|
||||
|
||||
gDisableStructs[i].isFirstTurn = 2;
|
||||
gUnknown_02024284[i] = 0;
|
||||
sUnusedBattlersArray[i] = 0;
|
||||
gLastMoves[i] = 0;
|
||||
gLastLandedMoves[i] = 0;
|
||||
gLastHitByType[i] = 0;
|
||||
@@ -2826,7 +2826,7 @@ static void BattleStartClearSetData(void)
|
||||
|
||||
gPauseCounterBattle = 0;
|
||||
gBattleMoveDamage = 0;
|
||||
gUnknown_020243FC = 0;
|
||||
gIntroSlideFlags = 0;
|
||||
gBattleScripting.animTurn = 0;
|
||||
gBattleScripting.animTargetsHit = 0;
|
||||
gLeveledUpInBattle = 0;
|
||||
@@ -3926,7 +3926,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
switch (gBattleCommunication[gActiveBattler])
|
||||
{
|
||||
case STATE_TURN_START_RECORD: // recorded battle related on start of every turn
|
||||
RecordedBattle_CopyBankMoves();
|
||||
RecordedBattle_CopyBattlerMoves();
|
||||
gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN;
|
||||
break;
|
||||
case STATE_BEFORE_ACTION_CHOSEN: // choose an action
|
||||
@@ -4330,7 +4330,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
if (gBattleCommunication[ACTIONS_CONFIRMED_COUNT] == gBattlersCount)
|
||||
{
|
||||
sub_818603C(1);
|
||||
gBattleMainFunc = SetActionsAndBanksTurnOrder;
|
||||
gBattleMainFunc = SetActionsAndBattlersTurnOrder;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)
|
||||
{
|
||||
@@ -4387,162 +4387,162 @@ void SwapTurnOrder(u8 id1, u8 id2)
|
||||
gBattleTurnOrder[id2] = temp;
|
||||
}
|
||||
|
||||
u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreChosenMoves)
|
||||
u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
|
||||
{
|
||||
u8 strikesFirst = 0;
|
||||
u8 speedMultiplierBank1 = 0, speedMultiplierBank2 = 0;
|
||||
u32 speedBank1 = 0, speedBank2 = 0;
|
||||
u8 speedMultiplierBattler1 = 0, speedMultiplierBattler2 = 0;
|
||||
u32 speedBattler1 = 0, speedBattler2 = 0;
|
||||
u8 holdEffect = 0;
|
||||
u8 holdEffectParam = 0;
|
||||
u16 moveBank1 = 0, moveBank2 = 0;
|
||||
u16 moveBattler1 = 0, moveBattler2 = 0;
|
||||
|
||||
if (WEATHER_HAS_EFFECT)
|
||||
{
|
||||
if ((gBattleMons[bank1].ability == ABILITY_SWIFT_SWIM && gBattleWeather & WEATHER_RAIN_ANY)
|
||||
|| (gBattleMons[bank1].ability == ABILITY_CHLOROPHYLL && gBattleWeather & WEATHER_SUN_ANY))
|
||||
speedMultiplierBank1 = 2;
|
||||
if ((gBattleMons[battler1].ability == ABILITY_SWIFT_SWIM && gBattleWeather & WEATHER_RAIN_ANY)
|
||||
|| (gBattleMons[battler1].ability == ABILITY_CHLOROPHYLL && gBattleWeather & WEATHER_SUN_ANY))
|
||||
speedMultiplierBattler1 = 2;
|
||||
else
|
||||
speedMultiplierBank1 = 1;
|
||||
speedMultiplierBattler1 = 1;
|
||||
|
||||
if ((gBattleMons[bank2].ability == ABILITY_SWIFT_SWIM && gBattleWeather & WEATHER_RAIN_ANY)
|
||||
|| (gBattleMons[bank2].ability == ABILITY_CHLOROPHYLL && gBattleWeather & WEATHER_SUN_ANY))
|
||||
speedMultiplierBank2 = 2;
|
||||
if ((gBattleMons[battler2].ability == ABILITY_SWIFT_SWIM && gBattleWeather & WEATHER_RAIN_ANY)
|
||||
|| (gBattleMons[battler2].ability == ABILITY_CHLOROPHYLL && gBattleWeather & WEATHER_SUN_ANY))
|
||||
speedMultiplierBattler2 = 2;
|
||||
else
|
||||
speedMultiplierBank2 = 1;
|
||||
speedMultiplierBattler2 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
speedMultiplierBank1 = 1;
|
||||
speedMultiplierBank2 = 1;
|
||||
speedMultiplierBattler1 = 1;
|
||||
speedMultiplierBattler2 = 1;
|
||||
}
|
||||
|
||||
speedBank1 = (gBattleMons[bank1].speed * speedMultiplierBank1)
|
||||
* (gStatStageRatios[gBattleMons[bank1].statStages[STAT_STAGE_SPEED]][0])
|
||||
/ (gStatStageRatios[gBattleMons[bank1].statStages[STAT_STAGE_SPEED]][1]);
|
||||
speedBattler1 = (gBattleMons[battler1].speed * speedMultiplierBattler1)
|
||||
* (gStatStageRatios[gBattleMons[battler1].statStages[STAT_STAGE_SPEED]][0])
|
||||
/ (gStatStageRatios[gBattleMons[battler1].statStages[STAT_STAGE_SPEED]][1]);
|
||||
|
||||
if (gBattleMons[bank1].item == ITEM_ENIGMA_BERRY)
|
||||
if (gBattleMons[battler1].item == ITEM_ENIGMA_BERRY)
|
||||
{
|
||||
holdEffect = gEnigmaBerries[bank1].holdEffect;
|
||||
holdEffectParam = gEnigmaBerries[bank1].holdEffectParam;
|
||||
holdEffect = gEnigmaBerries[battler1].holdEffect;
|
||||
holdEffectParam = gEnigmaBerries[battler1].holdEffectParam;
|
||||
}
|
||||
else
|
||||
{
|
||||
holdEffect = ItemId_GetHoldEffect(gBattleMons[bank1].item);
|
||||
holdEffectParam = ItemId_GetHoldEffectParam(gBattleMons[bank1].item);
|
||||
holdEffect = ItemId_GetHoldEffect(gBattleMons[battler1].item);
|
||||
holdEffectParam = ItemId_GetHoldEffectParam(gBattleMons[battler1].item);
|
||||
}
|
||||
|
||||
// badge boost
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER))
|
||||
&& FlagGet(FLAG_BADGE03_GET)
|
||||
&& GetBattlerSide(bank1) == B_SIDE_PLAYER)
|
||||
&& GetBattlerSide(battler1) == B_SIDE_PLAYER)
|
||||
{
|
||||
speedBank1 = (speedBank1 * 110) / 100;
|
||||
speedBattler1 = (speedBattler1 * 110) / 100;
|
||||
}
|
||||
|
||||
if (holdEffect == HOLD_EFFECT_MACHO_BRACE)
|
||||
speedBank1 /= 2;
|
||||
speedBattler1 /= 2;
|
||||
|
||||
if (gBattleMons[bank1].status1 & STATUS1_PARALYSIS)
|
||||
speedBank1 /= 4;
|
||||
if (gBattleMons[battler1].status1 & STATUS1_PARALYSIS)
|
||||
speedBattler1 /= 4;
|
||||
|
||||
if (holdEffect == HOLD_EFFECT_QUICK_CLAW && gRandomTurnNumber < (0xFFFF * holdEffectParam) / 100)
|
||||
speedBank1 = UINT_MAX;
|
||||
speedBattler1 = UINT_MAX;
|
||||
|
||||
// check second bank's speed
|
||||
// check second battlerId's speed
|
||||
|
||||
speedBank2 = (gBattleMons[bank2].speed * speedMultiplierBank2)
|
||||
* (gStatStageRatios[gBattleMons[bank2].statStages[STAT_STAGE_SPEED]][0])
|
||||
/ (gStatStageRatios[gBattleMons[bank2].statStages[STAT_STAGE_SPEED]][1]);
|
||||
speedBattler2 = (gBattleMons[battler2].speed * speedMultiplierBattler2)
|
||||
* (gStatStageRatios[gBattleMons[battler2].statStages[STAT_STAGE_SPEED]][0])
|
||||
/ (gStatStageRatios[gBattleMons[battler2].statStages[STAT_STAGE_SPEED]][1]);
|
||||
|
||||
if (gBattleMons[bank2].item == ITEM_ENIGMA_BERRY)
|
||||
if (gBattleMons[battler2].item == ITEM_ENIGMA_BERRY)
|
||||
{
|
||||
holdEffect = gEnigmaBerries[bank2].holdEffect;
|
||||
holdEffectParam = gEnigmaBerries[bank2].holdEffectParam;
|
||||
holdEffect = gEnigmaBerries[battler2].holdEffect;
|
||||
holdEffectParam = gEnigmaBerries[battler2].holdEffectParam;
|
||||
}
|
||||
else
|
||||
{
|
||||
holdEffect = ItemId_GetHoldEffect(gBattleMons[bank2].item);
|
||||
holdEffectParam = ItemId_GetHoldEffectParam(gBattleMons[bank2].item);
|
||||
holdEffect = ItemId_GetHoldEffect(gBattleMons[battler2].item);
|
||||
holdEffectParam = ItemId_GetHoldEffectParam(gBattleMons[battler2].item);
|
||||
}
|
||||
|
||||
// badge boost
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER))
|
||||
&& FlagGet(FLAG_BADGE03_GET)
|
||||
&& GetBattlerSide(bank2) == B_SIDE_PLAYER)
|
||||
&& GetBattlerSide(battler2) == B_SIDE_PLAYER)
|
||||
{
|
||||
speedBank2 = (speedBank2 * 110) / 100;
|
||||
speedBattler2 = (speedBattler2 * 110) / 100;
|
||||
}
|
||||
|
||||
if (holdEffect == HOLD_EFFECT_MACHO_BRACE)
|
||||
speedBank2 /= 2;
|
||||
speedBattler2 /= 2;
|
||||
|
||||
if (gBattleMons[bank2].status1 & STATUS1_PARALYSIS)
|
||||
speedBank2 /= 4;
|
||||
if (gBattleMons[battler2].status1 & STATUS1_PARALYSIS)
|
||||
speedBattler2 /= 4;
|
||||
|
||||
if (holdEffect == HOLD_EFFECT_QUICK_CLAW && gRandomTurnNumber < (0xFFFF * holdEffectParam) / 100)
|
||||
speedBank2 = UINT_MAX;
|
||||
speedBattler2 = UINT_MAX;
|
||||
|
||||
if (ignoreChosenMoves)
|
||||
{
|
||||
moveBank1 = MOVE_NONE;
|
||||
moveBank2 = MOVE_NONE;
|
||||
moveBattler1 = MOVE_NONE;
|
||||
moveBattler2 = MOVE_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gChosenActionByBattler[bank1] == B_ACTION_USE_MOVE)
|
||||
if (gChosenActionByBattler[battler1] == B_ACTION_USE_MOVE)
|
||||
{
|
||||
if (gProtectStructs[bank1].onlyStruggle)
|
||||
moveBank1 = MOVE_STRUGGLE;
|
||||
if (gProtectStructs[battler1].onlyStruggle)
|
||||
moveBattler1 = MOVE_STRUGGLE;
|
||||
else
|
||||
moveBank1 = gBattleMons[bank1].moves[*(gBattleStruct->chosenMovePositions + bank1)];
|
||||
moveBattler1 = gBattleMons[battler1].moves[*(gBattleStruct->chosenMovePositions + battler1)];
|
||||
}
|
||||
else
|
||||
moveBank1 = MOVE_NONE;
|
||||
moveBattler1 = MOVE_NONE;
|
||||
|
||||
if (gChosenActionByBattler[bank2] == B_ACTION_USE_MOVE)
|
||||
if (gChosenActionByBattler[battler2] == B_ACTION_USE_MOVE)
|
||||
{
|
||||
if (gProtectStructs[bank2].onlyStruggle)
|
||||
moveBank2 = MOVE_STRUGGLE;
|
||||
if (gProtectStructs[battler2].onlyStruggle)
|
||||
moveBattler2 = MOVE_STRUGGLE;
|
||||
else
|
||||
moveBank2 = gBattleMons[bank2].moves[*(gBattleStruct->chosenMovePositions + bank2)];
|
||||
moveBattler2 = gBattleMons[battler2].moves[*(gBattleStruct->chosenMovePositions + battler2)];
|
||||
}
|
||||
else
|
||||
moveBank2 = MOVE_NONE;
|
||||
moveBattler2 = MOVE_NONE;
|
||||
}
|
||||
|
||||
// both move priorities are different than 0
|
||||
if (gBattleMoves[moveBank1].priority != 0 || gBattleMoves[moveBank2].priority != 0)
|
||||
if (gBattleMoves[moveBattler1].priority != 0 || gBattleMoves[moveBattler2].priority != 0)
|
||||
{
|
||||
// both priorities are the same
|
||||
if (gBattleMoves[moveBank1].priority == gBattleMoves[moveBank2].priority)
|
||||
if (gBattleMoves[moveBattler1].priority == gBattleMoves[moveBattler2].priority)
|
||||
{
|
||||
if (speedBank1 == speedBank2 && Random() & 1)
|
||||
if (speedBattler1 == speedBattler2 && Random() & 1)
|
||||
strikesFirst = 2; // same speeds, same priorities
|
||||
else if (speedBank1 < speedBank2)
|
||||
strikesFirst = 1; // bank2 has more speed
|
||||
else if (speedBattler1 < speedBattler2)
|
||||
strikesFirst = 1; // battler2 has more speed
|
||||
|
||||
// else bank1 has more speed
|
||||
// else battler1 has more speed
|
||||
}
|
||||
else if (gBattleMoves[moveBank1].priority < gBattleMoves[moveBank2].priority)
|
||||
strikesFirst = 1; // bank2's move has greater priority
|
||||
else if (gBattleMoves[moveBattler1].priority < gBattleMoves[moveBattler2].priority)
|
||||
strikesFirst = 1; // battler2's move has greater priority
|
||||
|
||||
// else bank1's move has greater priority
|
||||
// else battler1's move has greater priority
|
||||
}
|
||||
// both priorities are equal to 0
|
||||
else
|
||||
{
|
||||
if (speedBank1 == speedBank2 && Random() & 1)
|
||||
if (speedBattler1 == speedBattler2 && Random() & 1)
|
||||
strikesFirst = 2; // same speeds, same priorities
|
||||
else if (speedBank1 < speedBank2)
|
||||
strikesFirst = 1; // bank2 has more speed
|
||||
else if (speedBattler1 < speedBattler2)
|
||||
strikesFirst = 1; // battler2 has more speed
|
||||
|
||||
// else bank1 has more speed
|
||||
// else battler1 has more speed
|
||||
}
|
||||
|
||||
return strikesFirst;
|
||||
}
|
||||
|
||||
static void SetActionsAndBanksTurnOrder(void)
|
||||
static void SetActionsAndBattlersTurnOrder(void)
|
||||
{
|
||||
s32 var = 0;
|
||||
s32 i, j;
|
||||
@@ -4625,14 +4625,14 @@ static void SetActionsAndBanksTurnOrder(void)
|
||||
{
|
||||
for (j = i + 1; j < gBattlersCount; j++)
|
||||
{
|
||||
u8 bank1 = gBattleTurnOrder[i];
|
||||
u8 bank2 = gBattleTurnOrder[j];
|
||||
u8 battler1 = gBattleTurnOrder[i];
|
||||
u8 battler2 = gBattleTurnOrder[j];
|
||||
if (gActionsByTurnOrder[i] != B_ACTION_USE_ITEM
|
||||
&& gActionsByTurnOrder[j] != B_ACTION_USE_ITEM
|
||||
&& gActionsByTurnOrder[i] != B_ACTION_SWITCH
|
||||
&& gActionsByTurnOrder[j] != B_ACTION_SWITCH)
|
||||
{
|
||||
if (GetWhoStrikesFirst(bank1, bank2, FALSE))
|
||||
if (GetWhoStrikesFirst(battler1, battler2, FALSE))
|
||||
SwapTurnOrder(i, j);
|
||||
}
|
||||
}
|
||||
@@ -4742,7 +4742,7 @@ static void RunTurnActionsFunctions(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another bank
|
||||
if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another battlerId
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
|
||||
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
|
||||
@@ -4976,7 +4976,7 @@ static void TryEvolvePokemon(void)
|
||||
|
||||
while (gLeveledUpInBattle != 0)
|
||||
{
|
||||
for (i = 0; i < 6; i++)
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (gLeveledUpInBattle & gBitTable[i])
|
||||
{
|
||||
@@ -5073,7 +5073,7 @@ static void HandleAction_UseMove(void)
|
||||
gMoveResultFlags = 0;
|
||||
gMultiHitCounter = 0;
|
||||
gBattleCommunication[6] = 0;
|
||||
gCurrMovePos = gUnknown_020241E9 = *(gBattleStruct->chosenMovePositions + gBattlerAttacker);
|
||||
gCurrMovePos = gChosenMovePos = *(gBattleStruct->chosenMovePositions + gBattlerAttacker);
|
||||
|
||||
// choose move
|
||||
if (gProtectStructs[gBattlerAttacker].onlyStruggle)
|
||||
@@ -5092,14 +5092,14 @@ static void HandleAction_UseMove(void)
|
||||
&& gDisableStructs[gBattlerAttacker].encoredMove == gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos])
|
||||
{
|
||||
gCurrentMove = gChosenMove = gDisableStructs[gBattlerAttacker].encoredMove;
|
||||
gCurrMovePos = gUnknown_020241E9 = gDisableStructs[gBattlerAttacker].encoredMovePos;
|
||||
gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos;
|
||||
*(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(gCurrentMove, 0);
|
||||
}
|
||||
// check if the encored move wasn't overwritten
|
||||
else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE
|
||||
&& gDisableStructs[gBattlerAttacker].encoredMove != gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos])
|
||||
{
|
||||
gCurrMovePos = gUnknown_020241E9 = gDisableStructs[gBattlerAttacker].encoredMovePos;
|
||||
gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos;
|
||||
gCurrentMove = gChosenMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
|
||||
gDisableStructs[gBattlerAttacker].encoredMove = MOVE_NONE;
|
||||
gDisableStructs[gBattlerAttacker].encoredMovePos = 0;
|
||||
|
||||
@@ -1888,7 +1888,7 @@ u32 BattleStringExpandPlaceholders(const u8* src, u8* dst)
|
||||
HANDLE_NICKNAME_STRING_CASE(gBattlerTarget, gBattlerPartyIndexes[gBattlerTarget])
|
||||
break;
|
||||
case B_TXT_EFF_NAME_WITH_PREFIX: // effect bank name with prefix
|
||||
HANDLE_NICKNAME_STRING_CASE(gEffectBank, gBattlerPartyIndexes[gEffectBank])
|
||||
HANDLE_NICKNAME_STRING_CASE(gEffectBattler, gBattlerPartyIndexes[gEffectBattler])
|
||||
break;
|
||||
case B_TXT_ACTIVE_NAME_WITH_PREFIX: // active bank name with prefix
|
||||
HANDLE_NICKNAME_STRING_CASE(gActiveBattler, gBattlerPartyIndexes[gActiveBattler])
|
||||
@@ -1964,7 +1964,7 @@ u32 BattleStringExpandPlaceholders(const u8* src, u8* dst)
|
||||
toCpy = gAbilityNames[gBattlerAbilities[gBattleScripting.battler]];
|
||||
break;
|
||||
case B_TXT_EFF_ABILITY: // effect bank ability
|
||||
toCpy = gAbilityNames[gBattlerAbilities[gEffectBank]];
|
||||
toCpy = gAbilityNames[gBattlerAbilities[gEffectBattler]];
|
||||
break;
|
||||
case B_TXT_TRAINER1_CLASS: // trainer class name
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_SECRET_BASE)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "constants/battle_script_commands.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/hold_effects.h"
|
||||
@@ -34,46 +35,46 @@ static const u16 sSoundMovesTable[] =
|
||||
MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, 0xFFFF
|
||||
};
|
||||
|
||||
u8 GetBattleBank(u8 caseId)
|
||||
u8 GetBattlerForBattleScript(u8 caseId)
|
||||
{
|
||||
u8 ret = 0;
|
||||
switch (caseId)
|
||||
{
|
||||
case BS_GET_TARGET:
|
||||
case BS_TARGET:
|
||||
ret = gBattlerTarget;
|
||||
break;
|
||||
case BS_GET_ATTACKER:
|
||||
case BS_ATTACKER:
|
||||
ret = gBattlerAttacker;
|
||||
break;
|
||||
case BS_GET_EFFECT_BANK:
|
||||
ret = gEffectBank;
|
||||
case BS_EFFECT_BATTLER:
|
||||
ret = gEffectBattler;
|
||||
break;
|
||||
case BS_GET_BANK_0:
|
||||
case BS_BANK_0:
|
||||
ret = 0;
|
||||
break;
|
||||
case BS_GET_SCRIPTING_BANK:
|
||||
case BS_SCRIPTING:
|
||||
ret = gBattleScripting.battler;
|
||||
break;
|
||||
case BS_GET_gBank1:
|
||||
ret = gBank1;
|
||||
case BS_FAINTED:
|
||||
ret = gBattlerFainted;
|
||||
break;
|
||||
case 5:
|
||||
ret = gBank1;
|
||||
ret = gBattlerFainted;
|
||||
break;
|
||||
case 4:
|
||||
case 6:
|
||||
case 8:
|
||||
case 9:
|
||||
case BS_GET_PLAYER1:
|
||||
case BS_PLAYER1:
|
||||
ret = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
break;
|
||||
case BS_GET_OPPONENT1:
|
||||
case BS_OPPONENT1:
|
||||
ret = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
break;
|
||||
case BS_GET_PLAYER2:
|
||||
case BS_PLAYER2:
|
||||
ret = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
|
||||
break;
|
||||
case BS_GET_OPPONENT2:
|
||||
case BS_OPPONENT2:
|
||||
ret = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
|
||||
break;
|
||||
}
|
||||
@@ -415,36 +416,36 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
return limitations;
|
||||
}
|
||||
|
||||
u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check)
|
||||
u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
|
||||
{
|
||||
u8 holdEffect;
|
||||
u16 *choicedMove = &gBattleStruct->choicedMove[bank];
|
||||
u16 *choicedMove = &gBattleStruct->choicedMove[battlerId];
|
||||
s32 i;
|
||||
|
||||
if (gBattleMons[bank].item == ITEM_ENIGMA_BERRY)
|
||||
holdEffect = gEnigmaBerries[bank].holdEffect;
|
||||
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
|
||||
holdEffect = gEnigmaBerries[battlerId].holdEffect;
|
||||
else
|
||||
holdEffect = ItemId_GetHoldEffect(gBattleMons[bank].item);
|
||||
holdEffect = ItemId_GetHoldEffect(gBattleMons[battlerId].item);
|
||||
|
||||
gStringBattler = bank;
|
||||
gStringBattler = battlerId;
|
||||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
{
|
||||
if (gBattleMons[bank].moves[i] == 0 && check & MOVE_LIMITATION_ZEROMOVE)
|
||||
if (gBattleMons[battlerId].moves[i] == 0 && check & MOVE_LIMITATION_ZEROMOVE)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gBattleMons[bank].pp[i] == 0 && check & MOVE_LIMITATION_PP)
|
||||
if (gBattleMons[battlerId].pp[i] == 0 && check & MOVE_LIMITATION_PP)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gBattleMons[bank].moves[i] == gDisableStructs[bank].disabledMove && check & MOVE_LIMITATION_DISABLED)
|
||||
if (gBattleMons[battlerId].moves[i] == gDisableStructs[battlerId].disabledMove && check & MOVE_LIMITATION_DISABLED)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gBattleMons[bank].moves[i] == gLastMoves[bank] && check & MOVE_LIMITATION_TORMENTED && gBattleMons[bank].status2 & STATUS2_TORMENT)
|
||||
if (gBattleMons[battlerId].moves[i] == gLastMoves[battlerId] && check & MOVE_LIMITATION_TORMENTED && gBattleMons[battlerId].status2 & STATUS2_TORMENT)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gDisableStructs[bank].tauntTimer1 && check & MOVE_LIMITATION_TAUNT && gBattleMoves[gBattleMons[bank].moves[i]].power == 0)
|
||||
if (gDisableStructs[battlerId].tauntTimer1 && check & MOVE_LIMITATION_TAUNT && gBattleMoves[gBattleMons[battlerId].moves[i]].power == 0)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (GetImprisonedMovesCount(bank, gBattleMons[bank].moves[i]) && check & MOVE_LIMITATION_IMPRISION)
|
||||
if (GetImprisonedMovesCount(battlerId, gBattleMons[battlerId].moves[i]) && check & MOVE_LIMITATION_IMPRISION)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gDisableStructs[bank].encoreTimer1 && gDisableStructs[bank].encoredMove != gBattleMons[bank].moves[i])
|
||||
if (gDisableStructs[battlerId].encoreTimer1 && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[bank].moves[i])
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
}
|
||||
return unusableMoves;
|
||||
@@ -468,11 +469,11 @@ bool8 AreAllMovesUnusable(void)
|
||||
return (unusable == 0xF);
|
||||
}
|
||||
|
||||
u8 GetImprisonedMovesCount(u8 bank, u16 move)
|
||||
u8 GetImprisonedMovesCount(u8 battlerId, u16 move)
|
||||
{
|
||||
s32 i;
|
||||
u8 imprisionedMoves = 0;
|
||||
u8 bankSide = GetBattlerSide(bank);
|
||||
u8 bankSide = GetBattlerSide(battlerId);
|
||||
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
@@ -800,7 +801,7 @@ u8 TurnBasedEffects(void)
|
||||
&& gBattleMons[gStatuses3[gActiveBattler] & STATUS3_LEECHSEED_BANK].hp != 0
|
||||
&& gBattleMons[gActiveBattler].hp != 0)
|
||||
{
|
||||
gBattlerTarget = gStatuses3[gActiveBattler] & STATUS3_LEECHSEED_BANK; //funny how the 'target' is actually the bank that receives HP
|
||||
gBattlerTarget = gStatuses3[gActiveBattler] & STATUS3_LEECHSEED_BANK; //funny how the 'target' is actually the battlerId that receives HP
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 8;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
@@ -1051,7 +1052,7 @@ u8 TurnBasedEffects(void)
|
||||
gBattleMons[gActiveBattler].status1 |= (Random() & 3) + 2;
|
||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gEffectBank = gActiveBattler;
|
||||
gEffectBattler = gActiveBattler;
|
||||
BattleScriptExecute(BattleScript_YawnMakesAsleep);
|
||||
effect++;
|
||||
}
|
||||
@@ -1201,7 +1202,7 @@ bool8 HandleFaintedMonActions(void)
|
||||
case 1:
|
||||
do
|
||||
{
|
||||
gBank1 = gBattlerTarget = gBattleStruct->faintedActionsBattlerId;
|
||||
gBattlerFainted = gBattlerTarget = gBattleStruct->faintedActionsBattlerId;
|
||||
if (gBattleMons[gBattleStruct->faintedActionsBattlerId].hp == 0
|
||||
&& !(gBattleStruct->field_DF & gBitTable[gBattlerPartyIndexes[gBattleStruct->faintedActionsBattlerId]])
|
||||
&& !(gAbsentBattlerFlags & gBitTable[gBattleStruct->faintedActionsBattlerId]))
|
||||
@@ -1214,7 +1215,7 @@ bool8 HandleFaintedMonActions(void)
|
||||
gBattleStruct->faintedActionsState = 3;
|
||||
break;
|
||||
case 2:
|
||||
sub_803F9EC(gBank1);
|
||||
sub_803F9EC(gBattlerFainted);
|
||||
if (++gBattleStruct->faintedActionsBattlerId == gBattlersCount)
|
||||
gBattleStruct->faintedActionsState = 3;
|
||||
else
|
||||
@@ -1227,7 +1228,7 @@ bool8 HandleFaintedMonActions(void)
|
||||
case 4:
|
||||
do
|
||||
{
|
||||
gBank1 = gBattlerTarget = gBattleStruct->faintedActionsBattlerId;
|
||||
gBattlerFainted = gBattlerTarget = gBattleStruct->faintedActionsBattlerId;
|
||||
if (gBattleMons[gBattleStruct->faintedActionsBattlerId].hp == 0
|
||||
&& !(gAbsentBattlerFlags & gBitTable[gBattleStruct->faintedActionsBattlerId]))
|
||||
{
|
||||
@@ -2496,7 +2497,7 @@ enum
|
||||
ITEM_STATS_CHANGE, // 5
|
||||
};
|
||||
|
||||
u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
{
|
||||
int i = 0;
|
||||
u8 effect = ITEM_NO_EFFECT;
|
||||
@@ -2505,11 +2506,11 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
u8 bankQuality, atkQuality, defQuality;
|
||||
u16 atkItem, defItem;
|
||||
|
||||
gLastUsedItem = gBattleMons[bank].item;
|
||||
gLastUsedItem = gBattleMons[battlerId].item;
|
||||
if (gLastUsedItem == ITEM_ENIGMA_BERRY)
|
||||
{
|
||||
bankHoldEffect = gEnigmaBerries[bank].holdEffect;
|
||||
bankQuality = gEnigmaBerries[bank].holdEffectParam;
|
||||
bankHoldEffect = gEnigmaBerries[battlerId].holdEffect;
|
||||
bankQuality = gEnigmaBerries[battlerId].holdEffectParam;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2548,39 +2549,39 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
switch (bankHoldEffect)
|
||||
{
|
||||
case HOLD_EFFECT_DOUBLE_PRIZE:
|
||||
if (GetBattlerSide(bank) == B_SIDE_PLAYER)
|
||||
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER)
|
||||
gBattleStruct->moneyMultiplier = 2;
|
||||
break;
|
||||
case HOLD_EFFECT_RESTORE_STATS:
|
||||
for (i = 0; i < BATTLE_STATS_NO; i++)
|
||||
{
|
||||
if (gBattleMons[bank].statStages[i] < 6)
|
||||
if (gBattleMons[battlerId].statStages[i] < 6)
|
||||
{
|
||||
gBattleMons[bank].statStages[i] = 6;
|
||||
gBattleMons[battlerId].statStages[i] = 6;
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
{
|
||||
gBattleScripting.battler = bank;
|
||||
gStringBattler = bank;
|
||||
gActiveBattler = gBattlerAttacker = bank;
|
||||
gBattleScripting.battler = battlerId;
|
||||
gStringBattler = battlerId;
|
||||
gActiveBattler = gBattlerAttacker = battlerId;
|
||||
BattleScriptExecute(BattleScript_WhiteHerbEnd2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (gBattleMons[bank].hp)
|
||||
if (gBattleMons[battlerId].hp)
|
||||
{
|
||||
switch (bankHoldEffect)
|
||||
{
|
||||
case HOLD_EFFECT_RESTORE_HP:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / 2 && !moveTurn)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2 && !moveTurn)
|
||||
{
|
||||
gBattleMoveDamage = bankQuality;
|
||||
if (gBattleMons[bank].hp + bankQuality > gBattleMons[bank].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP - gBattleMons[bank].hp;
|
||||
if (gBattleMons[battlerId].hp + bankQuality > gBattleMons[battlerId].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP - gBattleMons[battlerId].hp;
|
||||
gBattleMoveDamage *= -1;
|
||||
BattleScriptExecute(BattleScript_ItemHealHP_RemoveItem);
|
||||
effect = 4;
|
||||
@@ -2593,10 +2594,10 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
u8 ppBonuses;
|
||||
u16 move;
|
||||
|
||||
if (GetBattlerSide(bank) == B_SIDE_PLAYER)
|
||||
mon = &gPlayerParty[gBattlerPartyIndexes[bank]];
|
||||
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER)
|
||||
mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]];
|
||||
else
|
||||
mon = &gEnemyParty[gBattlerPartyIndexes[bank]];
|
||||
mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]];
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
move = GetMonData(mon, MON_DATA_MOVE1 + i);
|
||||
@@ -2625,47 +2626,47 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
case HOLD_EFFECT_RESTORE_STATS:
|
||||
for (i = 0; i < BATTLE_STATS_NO; i++)
|
||||
{
|
||||
if (gBattleMons[bank].statStages[i] < 6)
|
||||
if (gBattleMons[battlerId].statStages[i] < 6)
|
||||
{
|
||||
gBattleMons[bank].statStages[i] = 6;
|
||||
gBattleMons[battlerId].statStages[i] = 6;
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
{
|
||||
gBattleScripting.battler = bank;
|
||||
gStringBattler = bank;
|
||||
gActiveBattler = gBattlerAttacker = bank;
|
||||
gBattleScripting.battler = battlerId;
|
||||
gStringBattler = battlerId;
|
||||
gActiveBattler = gBattlerAttacker = battlerId;
|
||||
BattleScriptExecute(BattleScript_WhiteHerbEnd2);
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_LEFTOVERS:
|
||||
if (gBattleMons[bank].hp < gBattleMons[bank].maxHP && !moveTurn)
|
||||
if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn)
|
||||
{
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP / 16;
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP / 16;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
if (gBattleMons[bank].hp + gBattleMoveDamage > gBattleMons[bank].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP - gBattleMons[bank].hp;
|
||||
if (gBattleMons[battlerId].hp + gBattleMoveDamage > gBattleMons[battlerId].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP - gBattleMons[battlerId].hp;
|
||||
gBattleMoveDamage *= -1;
|
||||
BattleScriptExecute(BattleScript_ItemHealHP_End2);
|
||||
effect = ITEM_HP_CHANGE;
|
||||
RecordItemEffectBattle(bank, bankHoldEffect);
|
||||
RecordItemEffectBattle(battlerId, bankHoldEffect);
|
||||
}
|
||||
break;
|
||||
// nice copy/paste there gamefreak, making a function for confuse berries was too much eh?
|
||||
case HOLD_EFFECT_CONFUSE_SPICY:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / 2 && !moveTurn)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2 && !moveTurn)
|
||||
{
|
||||
PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, FLAVOR_SPICY);
|
||||
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP / bankQuality;
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP / bankQuality;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
if (gBattleMons[bank].hp + gBattleMoveDamage > gBattleMons[bank].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP - gBattleMons[bank].hp;
|
||||
if (gBattleMons[battlerId].hp + gBattleMoveDamage > gBattleMons[battlerId].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP - gBattleMons[battlerId].hp;
|
||||
gBattleMoveDamage *= -1;
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[bank].personality, FLAVOR_SPICY) < 0)
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[battlerId].personality, FLAVOR_SPICY) < 0)
|
||||
BattleScriptExecute(BattleScript_BerryConfuseHealEnd2);
|
||||
else
|
||||
BattleScriptExecute(BattleScript_ItemHealHP_RemoveItem);
|
||||
@@ -2673,17 +2674,17 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_DRY:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / 2 && !moveTurn)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2 && !moveTurn)
|
||||
{
|
||||
PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, FLAVOR_DRY);
|
||||
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP / bankQuality;
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP / bankQuality;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
if (gBattleMons[bank].hp + gBattleMoveDamage > gBattleMons[bank].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP - gBattleMons[bank].hp;
|
||||
if (gBattleMons[battlerId].hp + gBattleMoveDamage > gBattleMons[battlerId].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP - gBattleMons[battlerId].hp;
|
||||
gBattleMoveDamage *= -1;
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[bank].personality, FLAVOR_DRY) < 0)
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[battlerId].personality, FLAVOR_DRY) < 0)
|
||||
BattleScriptExecute(BattleScript_BerryConfuseHealEnd2);
|
||||
else
|
||||
BattleScriptExecute(BattleScript_ItemHealHP_RemoveItem);
|
||||
@@ -2691,17 +2692,17 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_SWEET:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / 2 && !moveTurn)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2 && !moveTurn)
|
||||
{
|
||||
PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, FLAVOR_SWEET);
|
||||
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP / bankQuality;
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP / bankQuality;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
if (gBattleMons[bank].hp + gBattleMoveDamage > gBattleMons[bank].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP - gBattleMons[bank].hp;
|
||||
if (gBattleMons[battlerId].hp + gBattleMoveDamage > gBattleMons[battlerId].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP - gBattleMons[battlerId].hp;
|
||||
gBattleMoveDamage *= -1;
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[bank].personality, FLAVOR_SWEET) < 0)
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[battlerId].personality, FLAVOR_SWEET) < 0)
|
||||
BattleScriptExecute(BattleScript_BerryConfuseHealEnd2);
|
||||
else
|
||||
BattleScriptExecute(BattleScript_ItemHealHP_RemoveItem);
|
||||
@@ -2709,17 +2710,17 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_BITTER:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / 2 && !moveTurn)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2 && !moveTurn)
|
||||
{
|
||||
PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, FLAVOR_BITTER);
|
||||
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP / bankQuality;
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP / bankQuality;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
if (gBattleMons[bank].hp + gBattleMoveDamage > gBattleMons[bank].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP - gBattleMons[bank].hp;
|
||||
if (gBattleMons[battlerId].hp + gBattleMoveDamage > gBattleMons[battlerId].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP - gBattleMons[battlerId].hp;
|
||||
gBattleMoveDamage *= -1;
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[bank].personality, FLAVOR_BITTER) < 0)
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[battlerId].personality, FLAVOR_BITTER) < 0)
|
||||
BattleScriptExecute(BattleScript_BerryConfuseHealEnd2);
|
||||
else
|
||||
BattleScriptExecute(BattleScript_ItemHealHP_RemoveItem);
|
||||
@@ -2727,17 +2728,17 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_SOUR:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / 2 && !moveTurn)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2 && !moveTurn)
|
||||
{
|
||||
PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, FLAVOR_SOUR);
|
||||
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP / bankQuality;
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP / bankQuality;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
if (gBattleMons[bank].hp + gBattleMoveDamage > gBattleMons[bank].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[bank].maxHP - gBattleMons[bank].hp;
|
||||
if (gBattleMons[battlerId].hp + gBattleMoveDamage > gBattleMons[battlerId].maxHP)
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP - gBattleMons[battlerId].hp;
|
||||
gBattleMoveDamage *= -1;
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[bank].personality, FLAVOR_SOUR) < 0)
|
||||
if (GetFlavorRelationByPersonality(gBattleMons[battlerId].personality, FLAVOR_SOUR) < 0)
|
||||
BattleScriptExecute(BattleScript_BerryConfuseHealEnd2);
|
||||
else
|
||||
BattleScriptExecute(BattleScript_ItemHealHP_RemoveItem);
|
||||
@@ -2746,12 +2747,12 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
break;
|
||||
// copy/paste again, smh
|
||||
case HOLD_EFFECT_ATTACK_UP:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / bankQuality && !moveTurn && gBattleMons[bank].statStages[STAT_STAGE_ATK] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / bankQuality && !moveTurn && gBattleMons[battlerId].statStages[STAT_STAGE_ATK] < 0xC)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_STAGE_ATK);
|
||||
PREPARE_STRING_BUFFER(gBattleTextBuff2, STRINGID_STATROSE);
|
||||
|
||||
gEffectBank = bank;
|
||||
gEffectBattler = battlerId;
|
||||
SET_STATCHANGER(STAT_STAGE_ATK, 1, FALSE);
|
||||
gBattleScripting.animArg1 = 0xE + STAT_STAGE_ATK;
|
||||
gBattleScripting.animArg2 = 0;
|
||||
@@ -2760,11 +2761,11 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_DEFENSE_UP:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / bankQuality && !moveTurn && gBattleMons[bank].statStages[STAT_STAGE_DEF] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / bankQuality && !moveTurn && gBattleMons[battlerId].statStages[STAT_STAGE_DEF] < 0xC)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_STAGE_DEF);
|
||||
|
||||
gEffectBank = bank;
|
||||
gEffectBattler = battlerId;
|
||||
SET_STATCHANGER(STAT_STAGE_DEF, 1, FALSE);
|
||||
gBattleScripting.animArg1 = 0xE + STAT_STAGE_DEF;
|
||||
gBattleScripting.animArg2 = 0;
|
||||
@@ -2773,11 +2774,11 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_SPEED_UP:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / bankQuality && !moveTurn && gBattleMons[bank].statStages[STAT_STAGE_SPEED] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / bankQuality && !moveTurn && gBattleMons[battlerId].statStages[STAT_STAGE_SPEED] < 0xC)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_STAGE_SPEED);
|
||||
|
||||
gEffectBank = bank;
|
||||
gEffectBattler = battlerId;
|
||||
SET_STATCHANGER(STAT_STAGE_SPEED, 1, FALSE);
|
||||
gBattleScripting.animArg1 = 0xE + STAT_STAGE_SPEED;
|
||||
gBattleScripting.animArg2 = 0;
|
||||
@@ -2786,11 +2787,11 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_SP_ATTACK_UP:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / bankQuality && !moveTurn && gBattleMons[bank].statStages[STAT_STAGE_SPATK] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / bankQuality && !moveTurn && gBattleMons[battlerId].statStages[STAT_STAGE_SPATK] < 0xC)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_STAGE_SPATK);
|
||||
|
||||
gEffectBank = bank;
|
||||
gEffectBattler = battlerId;
|
||||
SET_STATCHANGER(STAT_STAGE_SPATK, 1, FALSE);
|
||||
gBattleScripting.animArg1 = 0xE + STAT_STAGE_SPATK;
|
||||
gBattleScripting.animArg2 = 0;
|
||||
@@ -2799,11 +2800,11 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_SP_DEFENSE_UP:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / bankQuality && !moveTurn && gBattleMons[bank].statStages[STAT_STAGE_SPDEF] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / bankQuality && !moveTurn && gBattleMons[battlerId].statStages[STAT_STAGE_SPDEF] < 0xC)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_STAGE_SPDEF);
|
||||
|
||||
gEffectBank = bank;
|
||||
gEffectBattler = battlerId;
|
||||
SET_STATCHANGER(STAT_STAGE_SPDEF, 1, FALSE);
|
||||
gBattleScripting.animArg1 = 0xE + STAT_STAGE_SPDEF;
|
||||
gBattleScripting.animArg2 = 0;
|
||||
@@ -2812,19 +2813,19 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CRITICAL_UP:
|
||||
if (gBattleMons[bank].hp <= gBattleMons[bank].maxHP / bankQuality && !moveTurn && !(gBattleMons[bank].status2 & STATUS2_FOCUS_ENERGY))
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / bankQuality && !moveTurn && !(gBattleMons[battlerId].status2 & STATUS2_FOCUS_ENERGY))
|
||||
{
|
||||
gBattleMons[bank].status2 |= STATUS2_FOCUS_ENERGY;
|
||||
gBattleMons[battlerId].status2 |= STATUS2_FOCUS_ENERGY;
|
||||
BattleScriptExecute(BattleScript_BerryFocusEnergyEnd2);
|
||||
effect = ITEM_EFFECT_OTHER;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_RANDOM_STAT_UP:
|
||||
if (!moveTurn && gBattleMons[bank].hp <= gBattleMons[bank].maxHP / bankQuality)
|
||||
if (!moveTurn && gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / bankQuality)
|
||||
{
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
if (gBattleMons[bank].statStages[STAT_STAGE_ATK + i] < 0xC)
|
||||
if (gBattleMons[battlerId].statStages[STAT_STAGE_ATK + i] < 0xC)
|
||||
break;
|
||||
}
|
||||
if (i != 5)
|
||||
@@ -2832,7 +2833,7 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
do
|
||||
{
|
||||
i = Random() % 5;
|
||||
} while (gBattleMons[bank].statStages[STAT_STAGE_ATK + i] == 0xC);
|
||||
} while (gBattleMons[battlerId].statStages[STAT_STAGE_ATK + i] == 0xC);
|
||||
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, i + 1);
|
||||
|
||||
@@ -2845,7 +2846,7 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
gBattleTextBuff2[6] = STRINGID_STATROSE >> 8;
|
||||
gBattleTextBuff2[7] = EOS;
|
||||
|
||||
gEffectBank = bank;
|
||||
gEffectBattler = battlerId;
|
||||
SET_STATCHANGER(i + 1, 2, FALSE);
|
||||
gBattleScripting.animArg1 = 0x21 + i + 6;
|
||||
gBattleScripting.animArg2 = 0;
|
||||
@@ -2855,85 +2856,85 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_PAR:
|
||||
if (gBattleMons[bank].status1 & STATUS1_PARALYSIS)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_PARALYSIS);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_PARALYSIS);
|
||||
BattleScriptExecute(BattleScript_BerryCurePrlzEnd2);
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_PSN:
|
||||
if (gBattleMons[bank].status1 & STATUS1_PSN_ANY)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER);
|
||||
BattleScriptExecute(BattleScript_BerryCurePsnEnd2);
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_BRN:
|
||||
if (gBattleMons[bank].status1 & STATUS1_BURN)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_BURN)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_BURN);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_BURN);
|
||||
BattleScriptExecute(BattleScript_BerryCureBrnEnd2);
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_FRZ:
|
||||
if (gBattleMons[bank].status1 & STATUS1_FREEZE)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_FREEZE)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_FREEZE);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE);
|
||||
BattleScriptExecute(BattleScript_BerryCureFrzEnd2);
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_SLP:
|
||||
if (gBattleMons[bank].status1 & STATUS1_SLEEP)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_SLEEP);
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
BattleScriptExecute(BattleScript_BerryCureSlpEnd2);
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_CONFUSION:
|
||||
if (gBattleMons[bank].status2 & STATUS2_CONFUSION)
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION)
|
||||
{
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_CONFUSION);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION);
|
||||
BattleScriptExecute(BattleScript_BerryCureConfusionEnd2);
|
||||
effect = ITEM_EFFECT_OTHER;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_STATUS:
|
||||
if (gBattleMons[bank].status1 & STATUS1_ANY || gBattleMons[bank].status2 & STATUS2_CONFUSION)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_ANY || gBattleMons[battlerId].status2 & STATUS2_CONFUSION)
|
||||
{
|
||||
i = 0;
|
||||
if (gBattleMons[bank].status1 & STATUS1_PSN_ANY)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn);
|
||||
i++;
|
||||
}
|
||||
if (gBattleMons[bank].status1 & STATUS1_SLEEP)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
||||
{
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn);
|
||||
i++;
|
||||
}
|
||||
if (gBattleMons[bank].status1 & STATUS1_PARALYSIS)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn);
|
||||
i++;
|
||||
}
|
||||
if (gBattleMons[bank].status1 & STATUS1_BURN)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_BURN)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn);
|
||||
i++;
|
||||
}
|
||||
if (gBattleMons[bank].status1 & STATUS1_FREEZE)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_FREEZE)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn);
|
||||
i++;
|
||||
}
|
||||
if (gBattleMons[bank].status2 & STATUS2_CONFUSION)
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn);
|
||||
i++;
|
||||
@@ -2942,16 +2943,16 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
else
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
|
||||
gBattleMons[bank].status1 = 0;
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_CONFUSION);
|
||||
gBattleMons[battlerId].status1 = 0;
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION);
|
||||
BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2);
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_ATTRACT:
|
||||
if (gBattleMons[bank].status2 & STATUS2_INFATUATION)
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION)
|
||||
{
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_INFATUATION);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION);
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
|
||||
BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2);
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
@@ -2961,18 +2962,18 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
if (effect)
|
||||
{
|
||||
gBattleScripting.battler = bank;
|
||||
gStringBattler = bank;
|
||||
gActiveBattler = gBattlerAttacker = bank;
|
||||
gBattleScripting.battler = battlerId;
|
||||
gStringBattler = battlerId;
|
||||
gActiveBattler = gBattlerAttacker = battlerId;
|
||||
switch (effect)
|
||||
{
|
||||
case ITEM_STATUS_CHANGE:
|
||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[bank].status1);
|
||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battlerId].status1);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
break;
|
||||
case ITEM_PP_CHANGE:
|
||||
if (!(gBattleMons[bank].status2 & STATUS2_TRANSFORMED) && !(gDisableStructs[bank].unk18_b & gBitTable[i]))
|
||||
gBattleMons[bank].pp[i] = changedPP;
|
||||
if (!(gBattleMons[battlerId].status2 & STATUS2_TRANSFORMED) && !(gDisableStructs[battlerId].unk18_b & gBitTable[i]))
|
||||
gBattleMons[battlerId].pp[i] = changedPP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2981,13 +2982,13 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
for (bank = 0; bank < gBattlersCount; bank++)
|
||||
for (battlerId = 0; battlerId < gBattlersCount; battlerId++)
|
||||
{
|
||||
gLastUsedItem = gBattleMons[bank].item;
|
||||
if (gBattleMons[bank].item == ITEM_ENIGMA_BERRY)
|
||||
gLastUsedItem = gBattleMons[battlerId].item;
|
||||
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
|
||||
{
|
||||
bankHoldEffect = gEnigmaBerries[bank].holdEffect;
|
||||
bankQuality = gEnigmaBerries[bank].holdEffectParam;
|
||||
bankHoldEffect = gEnigmaBerries[battlerId].holdEffect;
|
||||
bankQuality = gEnigmaBerries[battlerId].holdEffectParam;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2997,64 +2998,64 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
switch (bankHoldEffect)
|
||||
{
|
||||
case HOLD_EFFECT_CURE_PAR:
|
||||
if (gBattleMons[bank].status1 & STATUS1_PARALYSIS)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_PARALYSIS);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_PARALYSIS);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_BerryCureParRet;
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_PSN:
|
||||
if (gBattleMons[bank].status1 & STATUS1_PSN_ANY)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_BerryCurePsnRet;
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_BRN:
|
||||
if (gBattleMons[bank].status1 & STATUS1_BURN)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_BURN)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_BURN);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_BURN);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_BerryCureBrnRet;
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_FRZ:
|
||||
if (gBattleMons[bank].status1 & STATUS1_FREEZE)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_FREEZE)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_FREEZE);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_BerryCureFrzRet;
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_SLP:
|
||||
if (gBattleMons[bank].status1 & STATUS1_SLEEP)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_SLEEP);
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_BerryCureSlpRet;
|
||||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_CONFUSION:
|
||||
if (gBattleMons[bank].status2 & STATUS2_CONFUSION)
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION)
|
||||
{
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_CONFUSION);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_BerryCureConfusionRet;
|
||||
effect = ITEM_EFFECT_OTHER;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_ATTRACT:
|
||||
if (gBattleMons[bank].status2 & STATUS2_INFATUATION)
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION)
|
||||
{
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_INFATUATION);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION);
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
|
||||
BattleScriptPushCursor();
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
@@ -3063,35 +3064,35 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_STATUS:
|
||||
if (gBattleMons[bank].status1 & STATUS1_ANY || gBattleMons[bank].status2 & STATUS2_CONFUSION)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_ANY || gBattleMons[battlerId].status2 & STATUS2_CONFUSION)
|
||||
{
|
||||
if (gBattleMons[bank].status1 & STATUS1_PSN_ANY)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn);
|
||||
}
|
||||
if (gBattleMons[bank].status1 & STATUS1_SLEEP)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
||||
{
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn);
|
||||
}
|
||||
if (gBattleMons[bank].status1 & STATUS1_PARALYSIS)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn);
|
||||
}
|
||||
if (gBattleMons[bank].status1 & STATUS1_BURN)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_BURN)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn);
|
||||
}
|
||||
if (gBattleMons[bank].status1 & STATUS1_FREEZE)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_FREEZE)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn);
|
||||
}
|
||||
if (gBattleMons[bank].status2 & STATUS2_CONFUSION)
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION)
|
||||
{
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn);
|
||||
}
|
||||
gBattleMons[bank].status1 = 0;
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_CONFUSION);
|
||||
gBattleMons[battlerId].status1 = 0;
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION);
|
||||
BattleScriptPushCursor();
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet;
|
||||
@@ -3101,16 +3102,16 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
case HOLD_EFFECT_RESTORE_STATS:
|
||||
for (i = 0; i < BATTLE_STATS_NO; i++)
|
||||
{
|
||||
if (gBattleMons[bank].statStages[i] < 6)
|
||||
if (gBattleMons[battlerId].statStages[i] < 6)
|
||||
{
|
||||
gBattleMons[bank].statStages[i] = 6;
|
||||
gBattleMons[battlerId].statStages[i] = 6;
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
{
|
||||
gBattleScripting.battler = bank;
|
||||
gStringBattler = bank;
|
||||
gBattleScripting.battler = battlerId;
|
||||
gStringBattler = battlerId;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_WhiteHerbRet;
|
||||
return effect; // unnecessary return
|
||||
@@ -3119,9 +3120,9 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
}
|
||||
if (effect)
|
||||
{
|
||||
gBattleScripting.battler = bank;
|
||||
gStringBattler = bank;
|
||||
gActiveBattler = bank;
|
||||
gBattleScripting.battler = battlerId;
|
||||
gStringBattler = battlerId;
|
||||
gActiveBattler = battlerId;
|
||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
break;
|
||||
@@ -3174,11 +3175,11 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
|
||||
return effect;
|
||||
}
|
||||
|
||||
void ClearFuryCutterDestinyBondGrudge(u8 bank)
|
||||
void ClearFuryCutterDestinyBondGrudge(u8 battlerId)
|
||||
{
|
||||
gDisableStructs[bank].furyCutterCounter = 0;
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_DESTINY_BOND);
|
||||
gStatuses3[bank] &= ~(STATUS3_GRUDGE);
|
||||
gDisableStructs[battlerId].furyCutterCounter = 0;
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_DESTINY_BOND);
|
||||
gStatuses3[battlerId] &= ~(STATUS3_GRUDGE);
|
||||
}
|
||||
|
||||
void HandleAction_RunBattleScript(void) // identical to RunBattleScriptCommands
|
||||
@@ -3266,14 +3267,14 @@ u8 GetMoveTarget(u16 move, u8 useMoveTarget)
|
||||
return targetBank;
|
||||
}
|
||||
|
||||
static bool32 HasObedientBitSet(u8 bank)
|
||||
static bool32 HasObedientBitSet(u8 battlerId)
|
||||
{
|
||||
if (GetBattlerSide(bank) == B_SIDE_OPPONENT)
|
||||
if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT)
|
||||
return TRUE;
|
||||
if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS
|
||||
&& GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_SPECIES, NULL) != SPECIES_MEW)
|
||||
if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS
|
||||
&& GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_MEW)
|
||||
return TRUE;
|
||||
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_OBEDIENCE, NULL);
|
||||
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_OBEDIENCE, NULL);
|
||||
}
|
||||
|
||||
u8 IsMonDisobedient(void)
|
||||
@@ -3341,7 +3342,7 @@ u8 IsMonDisobedient(void)
|
||||
{
|
||||
do
|
||||
{
|
||||
gCurrMovePos = gUnknown_020241E9 = Random() & 3;
|
||||
gCurrMovePos = gChosenMovePos = Random() & 3;
|
||||
} while (gBitTable[gCurrMovePos] & calc);
|
||||
|
||||
gRandomMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
|
||||
|
||||
@@ -74,7 +74,7 @@ void FreeBattleResources(void)
|
||||
}
|
||||
}
|
||||
|
||||
void AdjustFriendshipOnBattleFaint(u8 bank)
|
||||
void AdjustFriendshipOnBattleFaint(u8 battlerId)
|
||||
{
|
||||
u8 opposingBank;
|
||||
|
||||
@@ -93,22 +93,22 @@ void AdjustFriendshipOnBattleFaint(u8 bank)
|
||||
opposingBank = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
}
|
||||
|
||||
if (gBattleMons[opposingBank].level > gBattleMons[bank].level)
|
||||
if (gBattleMons[opposingBank].level > gBattleMons[battlerId].level)
|
||||
{
|
||||
if (gBattleMons[opposingBank].level - gBattleMons[bank].level > 29)
|
||||
AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[bank]], 8);
|
||||
if (gBattleMons[opposingBank].level - gBattleMons[battlerId].level > 29)
|
||||
AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battlerId]], 8);
|
||||
else
|
||||
AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[bank]], 6);
|
||||
AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battlerId]], 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[bank]], 6);
|
||||
AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battlerId]], 6);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80571DC(u8 bank, u8 arg1)
|
||||
void sub_80571DC(u8 battlerId, u8 arg1)
|
||||
{
|
||||
if (GetBattlerSide(bank) != B_SIDE_OPPONENT)
|
||||
if (GetBattlerSide(battlerId) != B_SIDE_OPPONENT)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -117,14 +117,14 @@ void sub_80571DC(u8 bank, u8 arg1)
|
||||
for (i = 0; i < 3; i++)
|
||||
gUnknown_0203CF00[i] = *(0 * 3 + i + (u8*)(gBattleStruct->field_60));
|
||||
|
||||
sub_81B8FB0(pokemon_order_func(gBattlerPartyIndexes[bank]), pokemon_order_func(arg1));
|
||||
sub_81B8FB0(pokemon_order_func(gBattlerPartyIndexes[battlerId]), pokemon_order_func(arg1));
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
*(0 * 3 + i + (u8*)(gBattleStruct->field_60)) = gUnknown_0203CF00[i];
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_805725C(u8 bank)
|
||||
u32 sub_805725C(u8 battlerId)
|
||||
{
|
||||
u32 effect = 0;
|
||||
|
||||
@@ -133,12 +133,12 @@ u32 sub_805725C(u8 bank)
|
||||
switch (gBattleCommunication[MULTIUSE_STATE])
|
||||
{
|
||||
case 0:
|
||||
if (gBattleMons[bank].status1 & STATUS1_SLEEP)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
||||
{
|
||||
if (UproarWakeUpCheck(bank))
|
||||
if (UproarWakeUpCheck(battlerId))
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_SLEEP);
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
BattleScriptPushCursor();
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
|
||||
@@ -148,24 +148,24 @@ u32 sub_805725C(u8 bank)
|
||||
{
|
||||
u32 toSub;
|
||||
|
||||
if (gBattleMons[bank].ability == ABILITY_EARLY_BIRD)
|
||||
if (gBattleMons[battlerId].ability == ABILITY_EARLY_BIRD)
|
||||
toSub = 2;
|
||||
else
|
||||
toSub = 1;
|
||||
|
||||
if ((gBattleMons[bank].status1 & STATUS1_SLEEP) < toSub)
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_SLEEP);
|
||||
if ((gBattleMons[battlerId].status1 & STATUS1_SLEEP) < toSub)
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
||||
else
|
||||
gBattleMons[bank].status1 -= toSub;
|
||||
gBattleMons[battlerId].status1 -= toSub;
|
||||
|
||||
if (gBattleMons[bank].status1 & STATUS1_SLEEP)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
||||
{
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsAsleep;
|
||||
effect = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMons[bank].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
BattleScriptPushCursor();
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
|
||||
@@ -176,7 +176,7 @@ u32 sub_805725C(u8 bank)
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
break;
|
||||
case 1:
|
||||
if (gBattleMons[bank].status1 & STATUS1_FREEZE)
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_FREEZE)
|
||||
{
|
||||
if (Random() % 5 != 0)
|
||||
{
|
||||
@@ -184,7 +184,7 @@ u32 sub_805725C(u8 bank)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMons[bank].status1 &= ~(STATUS1_FREEZE);
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
@@ -201,7 +201,7 @@ u32 sub_805725C(u8 bank)
|
||||
|
||||
if (effect == 2)
|
||||
{
|
||||
gActiveBattler = bank;
|
||||
gActiveBattler = battlerId;
|
||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
|
||||
@@ -141,30 +141,30 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
|
||||
if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION)
|
||||
defense /= 2;
|
||||
|
||||
if (type < TYPE_MYSTERY) // is physical
|
||||
if (IS_MOVE_PHYSICAL(type))
|
||||
{
|
||||
if (gCritMultiplier == 2)
|
||||
{
|
||||
if (attacker->statStages[STAT_STAGE_ATK] > 6)
|
||||
APPLY_STAT_MOD(damage, attacker, attack, STAT_STAGE_ATK)
|
||||
if (attacker->statStages[STAT_ATK] > 6)
|
||||
APPLY_STAT_MOD(damage, attacker, attack, STAT_ATK)
|
||||
else
|
||||
damage = attack;
|
||||
}
|
||||
else
|
||||
APPLY_STAT_MOD(damage, attacker, attack, STAT_STAGE_ATK)
|
||||
APPLY_STAT_MOD(damage, attacker, attack, STAT_ATK)
|
||||
|
||||
damage = damage * gBattleMovePower;
|
||||
damage *= (2 * attacker->level / 5 + 2);
|
||||
|
||||
if (gCritMultiplier == 2)
|
||||
{
|
||||
if (defender->statStages[STAT_STAGE_DEF] < 6)
|
||||
APPLY_STAT_MOD(damageHelper, defender, defense, STAT_STAGE_DEF)
|
||||
if (defender->statStages[STAT_DEF] < 6)
|
||||
APPLY_STAT_MOD(damageHelper, defender, defense, STAT_DEF)
|
||||
else
|
||||
damageHelper = defense;
|
||||
}
|
||||
else
|
||||
APPLY_STAT_MOD(damageHelper, defender, defense, STAT_STAGE_DEF)
|
||||
APPLY_STAT_MOD(damageHelper, defender, defense, STAT_DEF)
|
||||
|
||||
damage = damage / damageHelper;
|
||||
damage /= 50;
|
||||
@@ -191,30 +191,30 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
|
||||
if (type == TYPE_MYSTERY)
|
||||
damage = 0; // is ??? type. does 0 damage.
|
||||
|
||||
if (type > TYPE_MYSTERY) // is special?
|
||||
if (IS_MOVE_SPECIAL(type))
|
||||
{
|
||||
if (gCritMultiplier == 2)
|
||||
{
|
||||
if (attacker->statStages[STAT_STAGE_SPATK] > 6)
|
||||
APPLY_STAT_MOD(damage, attacker, spAttack, STAT_STAGE_SPATK)
|
||||
if (attacker->statStages[STAT_SPATK] > 6)
|
||||
APPLY_STAT_MOD(damage, attacker, spAttack, STAT_SPATK)
|
||||
else
|
||||
damage = spAttack;
|
||||
}
|
||||
else
|
||||
APPLY_STAT_MOD(damage, attacker, spAttack, STAT_STAGE_SPATK)
|
||||
APPLY_STAT_MOD(damage, attacker, spAttack, STAT_SPATK)
|
||||
|
||||
damage = damage * gBattleMovePower;
|
||||
damage *= (2 * attacker->level / 5 + 2);
|
||||
|
||||
if (gCritMultiplier == 2)
|
||||
{
|
||||
if (defender->statStages[STAT_STAGE_SPDEF] < 6)
|
||||
APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_STAGE_SPDEF)
|
||||
if (defender->statStages[STAT_SPDEF] < 6)
|
||||
APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_SPDEF)
|
||||
else
|
||||
damageHelper = spDefense;
|
||||
}
|
||||
else
|
||||
APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_STAGE_SPDEF)
|
||||
APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_SPDEF)
|
||||
|
||||
damage = (damage / damageHelper);
|
||||
damage /= 50;
|
||||
|
||||
@@ -30,7 +30,7 @@ struct PlayerInfo
|
||||
u32 trainerId;
|
||||
u8 name[PLAYER_NAME_LENGTH];
|
||||
u8 gender;
|
||||
u16 bank;
|
||||
u16 battlerId;
|
||||
u16 language;
|
||||
};
|
||||
|
||||
@@ -50,7 +50,7 @@ struct RecordedBattleSave
|
||||
u8 playersLanguage[MAX_BATTLERS_COUNT];
|
||||
u32 rngSeed;
|
||||
u32 battleFlags;
|
||||
u8 playersBank[MAX_BATTLERS_COUNT];
|
||||
u8 playersBattler[MAX_BATTLERS_COUNT];
|
||||
u16 opponentA;
|
||||
u16 opponentB;
|
||||
u16 partnerId;
|
||||
@@ -160,7 +160,7 @@ void sub_8184E58(void)
|
||||
{
|
||||
sRecordedBattle_Players[i].trainerId = gLinkPlayers[i].trainerId;
|
||||
sRecordedBattle_Players[i].gender = gLinkPlayers[i].gender;
|
||||
sRecordedBattle_Players[i].bank = gLinkPlayers[i].lp_field_18;
|
||||
sRecordedBattle_Players[i].battlerId = gLinkPlayers[i].lp_field_18;
|
||||
sRecordedBattle_Players[i].language = gLinkPlayers[i].language;
|
||||
|
||||
if (i < linkPlayersCount)
|
||||
@@ -184,7 +184,7 @@ void sub_8184E58(void)
|
||||
| (gSaveBlock2Ptr->playerTrainerId[3] << 24);
|
||||
|
||||
sRecordedBattle_Players[0].gender = gSaveBlock2Ptr->playerGender;
|
||||
sRecordedBattle_Players[0].bank = 0;
|
||||
sRecordedBattle_Players[0].battlerId = 0;
|
||||
sRecordedBattle_Players[0].language = gGameLanguage;
|
||||
|
||||
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
|
||||
@@ -192,31 +192,31 @@ void sub_8184E58(void)
|
||||
}
|
||||
}
|
||||
|
||||
void RecordedBattle_SetBattlerAction(u8 bank, u8 action)
|
||||
void RecordedBattle_SetBattlerAction(u8 battlerId, u8 action)
|
||||
{
|
||||
if (sRecordedBytesNo[bank] < BANK_RECORD_SIZE && sUnknown_0203C7AC != 2)
|
||||
if (sRecordedBytesNo[battlerId] < BANK_RECORD_SIZE && sUnknown_0203C7AC != 2)
|
||||
{
|
||||
sBattleRecords[bank][sRecordedBytesNo[bank]++] = action;
|
||||
sBattleRecords[battlerId][sRecordedBytesNo[battlerId]++] = action;
|
||||
}
|
||||
}
|
||||
|
||||
void RecordedBattle_ClearBattlerAction(u8 bank, u8 bytesToClear)
|
||||
void RecordedBattle_ClearBattlerAction(u8 battlerId, u8 bytesToClear)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < bytesToClear; i++)
|
||||
{
|
||||
sRecordedBytesNo[bank]--;
|
||||
sBattleRecords[bank][sRecordedBytesNo[bank]] |= 0xFF;
|
||||
if (sRecordedBytesNo[bank] == 0)
|
||||
sRecordedBytesNo[battlerId]--;
|
||||
sBattleRecords[battlerId][sRecordedBytesNo[battlerId]] |= 0xFF;
|
||||
if (sRecordedBytesNo[battlerId] == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
u8 RecordedBattle_GetBattlerAction(u8 bank)
|
||||
u8 RecordedBattle_GetBattlerAction(u8 battlerId)
|
||||
{
|
||||
// trying to read past array or invalid action byte, battle is over
|
||||
if (sRecordedBytesNo[bank] >= BANK_RECORD_SIZE || sBattleRecords[bank][sRecordedBytesNo[bank]] == 0xFF)
|
||||
if (sRecordedBytesNo[battlerId] >= BANK_RECORD_SIZE || sBattleRecords[battlerId][sRecordedBytesNo[battlerId]] == 0xFF)
|
||||
{
|
||||
gSpecialVar_Result = gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED; // hah
|
||||
ResetPaletteFadeControl();
|
||||
@@ -226,7 +226,7 @@ u8 RecordedBattle_GetBattlerAction(u8 bank)
|
||||
}
|
||||
else
|
||||
{
|
||||
return sBattleRecords[bank][sRecordedBytesNo[bank]++];
|
||||
return sBattleRecords[battlerId][sRecordedBytesNo[battlerId]++];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ u32 MoveRecordedBattleToSaveData(void)
|
||||
}
|
||||
battleSave->playersGender[i] = sRecordedBattle_Players[i].gender;
|
||||
battleSave->playersLanguage[i] = sRecordedBattle_Players[i].language;
|
||||
battleSave->playersBank[i] = sRecordedBattle_Players[i].bank;
|
||||
battleSave->playersBattler[i] = sRecordedBattle_Players[i].battlerId;
|
||||
battleSave->playersTrainerId[i] = sRecordedBattle_Players[i].trainerId;
|
||||
}
|
||||
|
||||
@@ -367,16 +367,16 @@ u32 MoveRecordedBattleToSaveData(void)
|
||||
}
|
||||
else if (sRecordedBattle_BattleFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
switch (sRecordedBattle_Players[0].bank)
|
||||
switch (sRecordedBattle_Players[0].battlerId)
|
||||
{
|
||||
case 0:
|
||||
case 2:
|
||||
if (!(sRecordedBattle_Players[gUnknown_0203C7B4].bank & 1))
|
||||
if (!(sRecordedBattle_Players[gUnknown_0203C7B4].battlerId & 1))
|
||||
battleSave->battleFlags |= BATTLE_TYPE_x80000000;
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
if ((sRecordedBattle_Players[gUnknown_0203C7B4].bank & 1))
|
||||
if ((sRecordedBattle_Players[gUnknown_0203C7B4].battlerId & 1))
|
||||
battleSave->battleFlags |= BATTLE_TYPE_x80000000;
|
||||
break;
|
||||
}
|
||||
@@ -1341,7 +1341,7 @@ static void SetRecordedBattleVarsFromSave(struct RecordedBattleSave *src)
|
||||
}
|
||||
gLinkPlayers[i].gender = src->playersGender[i];
|
||||
gLinkPlayers[i].language = src->playersLanguage[i];
|
||||
gLinkPlayers[i].lp_field_18 = src->playersBank[i];
|
||||
gLinkPlayers[i].lp_field_18 = src->playersBattler[i];
|
||||
gLinkPlayers[i].trainerId = src->playersTrainerId[i];
|
||||
|
||||
if (var)
|
||||
@@ -1448,7 +1448,7 @@ static void RecordedBattle_RestoreSavedParties(void)
|
||||
}
|
||||
}
|
||||
|
||||
u8 GetActiveBankLinkPlayerGender(void)
|
||||
u8 GetActiveBattlerLinkPlayerGender(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -1489,7 +1489,7 @@ u8 GetTextSpeedInRecordedBattle(void)
|
||||
return sRecordedBattle_TextSpeed;
|
||||
}
|
||||
|
||||
void RecordedBattle_CopyBankMoves(void)
|
||||
void RecordedBattle_CopyBattlerMoves(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -1510,32 +1510,32 @@ void RecordedBattle_CopyBankMoves(void)
|
||||
|
||||
void sub_818603C(u8 arg0)
|
||||
{
|
||||
s32 bank, j, k;
|
||||
s32 battlerId, j, k;
|
||||
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000))
|
||||
return;
|
||||
|
||||
for (bank = 0; bank < gBattlersCount; bank++)
|
||||
for (battlerId = 0; battlerId < gBattlersCount; battlerId++)
|
||||
{
|
||||
if (GetBattlerSide(bank) != B_SIDE_OPPONENT) // player's side only
|
||||
if (GetBattlerSide(battlerId) != B_SIDE_OPPONENT) // player's side only
|
||||
{
|
||||
if (arg0 == 1)
|
||||
{
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
if (gBattleMons[bank].moves[j] != sRecordedBattle_PlayerMonMoves[bank / 2][j])
|
||||
if (gBattleMons[battlerId].moves[j] != sRecordedBattle_PlayerMonMoves[battlerId / 2][j])
|
||||
break;
|
||||
}
|
||||
if (j != 4) // player's mon's move has been changed
|
||||
{
|
||||
RecordedBattle_SetBattlerAction(bank, ACTION_MOVE_CHANGE);
|
||||
RecordedBattle_SetBattlerAction(battlerId, ACTION_MOVE_CHANGE);
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
for (k = 0; k < 4; k++)
|
||||
{
|
||||
if (gBattleMons[bank].moves[j] == sRecordedBattle_PlayerMonMoves[bank / 2][k])
|
||||
if (gBattleMons[battlerId].moves[j] == sRecordedBattle_PlayerMonMoves[battlerId / 2][k])
|
||||
{
|
||||
RecordedBattle_SetBattlerAction(bank, k);
|
||||
RecordedBattle_SetBattlerAction(battlerId, k);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1544,7 +1544,7 @@ void sub_818603C(u8 arg0)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sBattleRecords[bank][sRecordedBytesNo[bank]] == ACTION_MOVE_CHANGE)
|
||||
if (sBattleRecords[battlerId][sRecordedBytesNo[battlerId]] == ACTION_MOVE_CHANGE)
|
||||
{
|
||||
u8 ppBonuses[4];
|
||||
u8 array1[4];
|
||||
@@ -1553,58 +1553,58 @@ void sub_818603C(u8 arg0)
|
||||
u8 array3[8];
|
||||
u8 var;
|
||||
|
||||
RecordedBattle_GetBattlerAction(bank);
|
||||
RecordedBattle_GetBattlerAction(battlerId);
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
ppBonuses[j] = ((gBattleMons[bank].ppBonuses & ((3 << (j << 1)))) >> (j << 1));
|
||||
ppBonuses[j] = ((gBattleMons[battlerId].ppBonuses & ((3 << (j << 1)))) >> (j << 1));
|
||||
}
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
array1[j] = RecordedBattle_GetBattlerAction(bank);
|
||||
movePp.moves[j] = gBattleMons[bank].moves[array1[j]];
|
||||
movePp.pp[j] = gBattleMons[bank].pp[array1[j]];
|
||||
array1[j] = RecordedBattle_GetBattlerAction(battlerId);
|
||||
movePp.moves[j] = gBattleMons[battlerId].moves[array1[j]];
|
||||
movePp.pp[j] = gBattleMons[battlerId].pp[array1[j]];
|
||||
array3[j] = ppBonuses[array1[j]];
|
||||
array2[j] = (gDisableStructs[bank].unk18_b & gBitTable[j]) >> j;
|
||||
array2[j] = (gDisableStructs[battlerId].unk18_b & gBitTable[j]) >> j;
|
||||
}
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
gBattleMons[bank].moves[j] = movePp.moves[j];
|
||||
gBattleMons[bank].pp[j] = movePp.pp[j];
|
||||
gBattleMons[battlerId].moves[j] = movePp.moves[j];
|
||||
gBattleMons[battlerId].pp[j] = movePp.pp[j];
|
||||
}
|
||||
gBattleMons[bank].ppBonuses = 0;
|
||||
gDisableStructs[bank].unk18_b = 0;
|
||||
gBattleMons[battlerId].ppBonuses = 0;
|
||||
gDisableStructs[battlerId].unk18_b = 0;
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
gBattleMons[bank].ppBonuses |= (array3[j]) << (j << 1);
|
||||
gDisableStructs[bank].unk18_b |= (array2[j]) << (j);
|
||||
gBattleMons[battlerId].ppBonuses |= (array3[j]) << (j << 1);
|
||||
gDisableStructs[battlerId].unk18_b |= (array2[j]) << (j);
|
||||
}
|
||||
|
||||
if (!(gBattleMons[bank].status2 & STATUS2_TRANSFORMED))
|
||||
if (!(gBattleMons[battlerId].status2 & STATUS2_TRANSFORMED))
|
||||
{
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
ppBonuses[j] = ((GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_PP_BONUSES, NULL) & ((3 << (j << 1)))) >> (j << 1));
|
||||
ppBonuses[j] = ((GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_PP_BONUSES, NULL) & ((3 << (j << 1)))) >> (j << 1));
|
||||
}
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
movePp.moves[j] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_MOVE1 + array1[j], NULL);
|
||||
movePp.pp[j] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_PP1 + array1[j], NULL);
|
||||
movePp.moves[j] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_MOVE1 + array1[j], NULL);
|
||||
movePp.pp[j] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_PP1 + array1[j], NULL);
|
||||
array3[j] = ppBonuses[array1[j]];
|
||||
}
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
SetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_MOVE1 + j, &movePp.moves[j]);
|
||||
SetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_PP1 + j, &movePp.pp[j]);
|
||||
SetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_MOVE1 + j, &movePp.moves[j]);
|
||||
SetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_PP1 + j, &movePp.pp[j]);
|
||||
}
|
||||
var = 0;
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
var |= (array3[j]) << (j << 1);
|
||||
}
|
||||
SetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_PP_BONUSES, &var);
|
||||
SetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_PP_BONUSES, &var);
|
||||
}
|
||||
|
||||
gChosenMoveByBattler[bank] = gBattleMons[bank].moves[*(gBattleStruct->chosenMovePositions + bank)];
|
||||
gChosenMoveByBattler[battlerId] = gBattleMons[battlerId].moves[*(gBattleStruct->chosenMovePositions + battlerId)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user