Sync pokemon.c

This commit is contained in:
GriffinR
2023-03-01 00:42:12 -05:00
parent 3a4eaa0ff5
commit ab417d1255
54 changed files with 3710 additions and 4365 deletions
-1
View File
@@ -1,7 +1,6 @@
.include "asm/macros/asm.inc"
.include "asm/macros/function.inc"
.include "asm/macros/movement.inc"
.include "asm/macros/pokemon_data.inc"
.include "asm/macros/ec.inc"
.include "asm/macros/map.inc"
.include "asm/macros/m4a.inc"
+6 -6
View File
@@ -1576,15 +1576,15 @@
.4byte \value
.endm
@ Sets the eventLegal bit for the Pokemon in the specified slot of the player's party.
.macro setmoneventlegal slot:req
@ Sets the modernFatefulEncounter bit for the Pokemon in the specified slot of the player's party.
.macro setmonmodernfatefulencounter slot:req
.byte 0xcd
.2byte \slot
.endm
@ Checks if the eventLegal bit is set for the Pokemon in the specified slot of the player's party. If it isn't set,
@ Checks if the modernFatefulEncounter bit is set for the Pokemon in the specified slot of the player's party. If it isn't set,
@ VAR_RESULT is TRUE. If the bit is set (or if the specified slot is empty or invalid), VAR_RESULT is FALSE.
.macro checkmoneventlegal slot:req
.macro checkmonmodernfatefulencounter slot:req
.byte 0xce
.2byte \slot
.endm
@@ -1849,10 +1849,10 @@
call EventScript_BrailleCursorWaitButton
.endm
@ Creates an "event legal" Pokémon for an encounter
@ Creates a Pokémon with the modernFatefulEncounter bit set for an encounter
.macro seteventmon species:req, level:req, item=ITEM_NONE
setvar VAR_0x8004, \species
setvar VAR_0x8005, \level
setvar VAR_0x8006, \item
special CreateEventLegalEnemyMon
special CreateEnemyEventMon
.endm
-57
View File
@@ -1,57 +0,0 @@
.macro pokedex_entry pokemon_name, height, weight, pokemon_scale, pokemon_offset, trainer_scale, trainer_offset
.2byte \height @ in decimeters
.2byte \weight @ in hectograms
.4byte DexDescription_\pokemon_name\()_1
.4byte DexDescription_\pokemon_name\()_2
.2byte 0 @ unused
.2byte \pokemon_scale
.2byte \pokemon_offset
.2byte \trainer_scale
.2byte \trainer_offset
.2byte 0 @ padding
.endm
.macro base_stats hp, attack, defense, speed, sp_attack, sp_defense
.byte \hp
.byte \attack
.byte \defense
.byte \speed
.byte \sp_attack
.byte \sp_defense
.endm
.macro ev_yield hp, attack, defense, speed, sp_attack, sp_defense
.2byte (\sp_defense << 10) | (\sp_attack << 8) | (\speed << 6) | (\defense << 4) | (\attack << 2) | \hp
.endm
.macro level_up_move level, move
.2byte (\level << 9) | \move
.endm
.macro evo_entry method, parameter, target_species
.2byte \method
.2byte \parameter
.2byte \target_species
.2byte 0 @ padding
.endm
.macro empty_evo_entries count
.fill 8 * \count, 1, 0
.endm
.macro egg_moves_begin species
.2byte 20000 + \species
.endm
@ If the min level equals the max level, only one level argument is needed.
.macro wild_mon species, min_level, max_level
.byte \min_level
.ifb \max_level
.byte \min_level
.else
.byte \max_level
.endif
.2byte SPECIES_\species
.endm
+3 -2
View File
@@ -7,6 +7,7 @@
#include "constants/species.h"
#include "constants/vars.h"
#include "constants/items.h"
#include "constants/region_map_sections.h"
.include "asm/macros.inc"
.include "asm/macros/event.inc"
.include "constants/constants.inc"
@@ -67,8 +68,8 @@ SurfPichu_FullParty:
SurfPichu_GiveEgg:
giveegg SPECIES_PICHU
setmoneventlegal VAR_EVENT_PICHU_SLOT
setmonmetlocation VAR_EVENT_PICHU_SLOT, 0xff
setmonmodernfatefulencounter VAR_EVENT_PICHU_SLOT
setmonmetlocation VAR_EVENT_PICHU_SLOT, METLOC_FATEFUL_ENCOUNTER
vgoto_if_eq VAR_EVENT_PICHU_SLOT, 1, SurfPichu_Slot1
vgoto_if_eq VAR_EVENT_PICHU_SLOT, 2, SurfPichu_Slot2
vgoto_if_eq VAR_EVENT_PICHU_SLOT, 3, SurfPichu_Slot3
+213 -213
View File
@@ -1,219 +1,219 @@
.align 2
gScriptCmdTable::
.4byte ScrCmd_nop @ 0x00
.4byte ScrCmd_nop1 @ 0x01
.4byte ScrCmd_end @ 0x02
.4byte ScrCmd_return @ 0x03
.4byte ScrCmd_call @ 0x04
.4byte ScrCmd_goto @ 0x05
.4byte ScrCmd_goto_if @ 0x06
.4byte ScrCmd_call_if @ 0x07
.4byte ScrCmd_gotostd @ 0x08
.4byte ScrCmd_callstd @ 0x09
.4byte ScrCmd_gotostd_if @ 0x0a
.4byte ScrCmd_callstd_if @ 0x0b
.4byte ScrCmd_returnram @ 0x0c
.4byte ScrCmd_endram @ 0x0d
.4byte ScrCmd_setmysteryeventstatus @ 0x0e
.4byte ScrCmd_loadword @ 0x0f
.4byte ScrCmd_loadbyte @ 0x10
.4byte ScrCmd_setptr @ 0x11
.4byte ScrCmd_loadbytefromptr @ 0x12
.4byte ScrCmd_setptrbyte @ 0x13
.4byte ScrCmd_copylocal @ 0x14
.4byte ScrCmd_copybyte @ 0x15
.4byte ScrCmd_setvar @ 0x16
.4byte ScrCmd_addvar @ 0x17
.4byte ScrCmd_subvar @ 0x18
.4byte ScrCmd_copyvar @ 0x19
.4byte ScrCmd_setorcopyvar @ 0x1a
.4byte ScrCmd_compare_local_to_local @ 0x1b
.4byte ScrCmd_compare_local_to_value @ 0x1c
.4byte ScrCmd_compare_local_to_ptr @ 0x1d
.4byte ScrCmd_compare_ptr_to_local @ 0x1e
.4byte ScrCmd_compare_ptr_to_value @ 0x1f
.4byte ScrCmd_compare_ptr_to_ptr @ 0x20
.4byte ScrCmd_compare_var_to_value @ 0x21
.4byte ScrCmd_compare_var_to_var @ 0x22
.4byte ScrCmd_callnative @ 0x23
.4byte ScrCmd_gotonative @ 0x24
.4byte ScrCmd_special @ 0x25
.4byte ScrCmd_specialvar @ 0x26
.4byte ScrCmd_waitstate @ 0x27
.4byte ScrCmd_delay @ 0x28
.4byte ScrCmd_setflag @ 0x29
.4byte ScrCmd_clearflag @ 0x2a
.4byte ScrCmd_checkflag @ 0x2b
.4byte ScrCmd_initclock @ 0x2c
.4byte ScrCmd_dotimebasedevents @ 0x2d
.4byte ScrCmd_gettime @ 0x2e
.4byte ScrCmd_playse @ 0x2f
.4byte ScrCmd_waitse @ 0x30
.4byte ScrCmd_playfanfare @ 0x31
.4byte ScrCmd_waitfanfare @ 0x32
.4byte ScrCmd_playbgm @ 0x33
.4byte ScrCmd_savebgm @ 0x34
.4byte ScrCmd_fadedefaultbgm @ 0x35
.4byte ScrCmd_fadenewbgm @ 0x36
.4byte ScrCmd_fadeoutbgm @ 0x37
.4byte ScrCmd_fadeinbgm @ 0x38
.4byte ScrCmd_warp @ 0x39
.4byte ScrCmd_warpsilent @ 0x3a
.4byte ScrCmd_warpdoor @ 0x3b
.4byte ScrCmd_warphole @ 0x3c
.4byte ScrCmd_warpteleport @ 0x3d
.4byte ScrCmd_setwarp @ 0x3e
.4byte ScrCmd_setdynamicwarp @ 0x3f
.4byte ScrCmd_setdivewarp @ 0x40
.4byte ScrCmd_setholewarp @ 0x41
.4byte ScrCmd_getplayerxy @ 0x42
.4byte ScrCmd_getpartysize @ 0x43
.4byte ScrCmd_additem @ 0x44
.4byte ScrCmd_removeitem @ 0x45
.4byte ScrCmd_checkitemspace @ 0x46
.4byte ScrCmd_checkitem @ 0x47
.4byte ScrCmd_checkitemtype @ 0x48
.4byte ScrCmd_addpcitem @ 0x49
.4byte ScrCmd_checkpcitem @ 0x4a
.4byte ScrCmd_adddecoration @ 0x4b
.4byte ScrCmd_removedecoration @ 0x4c
.4byte ScrCmd_checkdecor @ 0x4d
.4byte ScrCmd_checkdecorspace @ 0x4e
.4byte ScrCmd_applymovement @ 0x4f
.4byte ScrCmd_applymovementat @ 0x50
.4byte ScrCmd_waitmovement @ 0x51
.4byte ScrCmd_waitmovementat @ 0x52
.4byte ScrCmd_removeobject @ 0x53
.4byte ScrCmd_removeobjectat @ 0x54
.4byte ScrCmd_addobject @ 0x55
.4byte ScrCmd_addobjectat @ 0x56
.4byte ScrCmd_setobjectxy @ 0x57
.4byte ScrCmd_showobjectat @ 0x58
.4byte ScrCmd_hideobjectat @ 0x59
.4byte ScrCmd_faceplayer @ 0x5a
.4byte ScrCmd_turnobject @ 0x5b
.4byte ScrCmd_trainerbattle @ 0x5c
.4byte ScrCmd_dotrainerbattle @ 0x5d
.4byte ScrCmd_gotopostbattlescript @ 0x5e
.4byte ScrCmd_gotobeatenscript @ 0x5f
.4byte ScrCmd_checktrainerflag @ 0x60
.4byte ScrCmd_settrainerflag @ 0x61
.4byte ScrCmd_cleartrainerflag @ 0x62
.4byte ScrCmd_setobjectxyperm @ 0x63
.4byte ScrCmd_copyobjectxytoperm @ 0x64
.4byte ScrCmd_setobjectmovementtype @ 0x65
.4byte ScrCmd_waitmessage @ 0x66
.4byte ScrCmd_message @ 0x67
.4byte ScrCmd_closemessage @ 0x68
.4byte ScrCmd_lockall @ 0x69
.4byte ScrCmd_lock @ 0x6a
.4byte ScrCmd_releaseall @ 0x6b
.4byte ScrCmd_release @ 0x6c
.4byte ScrCmd_waitbuttonpress @ 0x6d
.4byte ScrCmd_yesnobox @ 0x6e
.4byte ScrCmd_multichoice @ 0x6f
.4byte ScrCmd_multichoicedefault @ 0x70
.4byte ScrCmd_multichoicegrid @ 0x71
.4byte ScrCmd_drawbox @ 0x72
.4byte ScrCmd_erasebox @ 0x73
.4byte ScrCmd_drawboxtext @ 0x74
.4byte ScrCmd_showmonpic @ 0x75
.4byte ScrCmd_hidemonpic @ 0x76
.4byte ScrCmd_showcontestpainting @ 0x77
.4byte ScrCmd_braillemessage @ 0x78
.4byte ScrCmd_givemon @ 0x79
.4byte ScrCmd_giveegg @ 0x7a
.4byte ScrCmd_setmonmove @ 0x7b
.4byte ScrCmd_checkpartymove @ 0x7c
.4byte ScrCmd_bufferspeciesname @ 0x7d
.4byte ScrCmd_bufferleadmonspeciesname @ 0x7e
.4byte ScrCmd_bufferpartymonnick @ 0x7f
.4byte ScrCmd_bufferitemname @ 0x80
.4byte ScrCmd_bufferdecorationname @ 0x81
.4byte ScrCmd_buffermovename @ 0x82
.4byte ScrCmd_buffernumberstring @ 0x83
.4byte ScrCmd_bufferstdstring @ 0x84
.4byte ScrCmd_bufferstring @ 0x85
.4byte ScrCmd_pokemart @ 0x86
.4byte ScrCmd_pokemartdecoration @ 0x87
.4byte ScrCmd_pokemartdecoration2 @ 0x88
.4byte ScrCmd_playslotmachine @ 0x8
.4byte ScrCmd_setberrytree @ 0x8a
.4byte ScrCmd_choosecontestmon @ 0x8b
.4byte ScrCmd_startcontest @ 0x8c
.4byte ScrCmd_showcontestresults @ 0x8d
.4byte ScrCmd_contestlinktransfer @ 0x8e
.4byte ScrCmd_random @ 0x8f
.4byte ScrCmd_addmoney @ 0x90
.4byte ScrCmd_removemoney @ 0x91
.4byte ScrCmd_checkmoney @ 0x92
.4byte ScrCmd_showmoneybox @ 0x93
.4byte ScrCmd_hidemoneybox @ 0x94
.4byte ScrCmd_updatemoneybox @ 0x95
.4byte ScrCmd_getpokenewsactive @ 0x96
.4byte ScrCmd_fadescreen @ 0x97
.4byte ScrCmd_fadescreenspeed @ 0x98
.4byte ScrCmd_setflashlevel @ 0x99
.4byte ScrCmd_animateflash @ 0x9a
.4byte ScrCmd_messageautoscroll @ 0x9b
.4byte ScrCmd_dofieldeffect @ 0x9c
.4byte ScrCmd_setfieldeffectargument @ 0x9d
.4byte ScrCmd_waitfieldeffect @ 0x9e
.4byte ScrCmd_setrespawn @ 0x9f
.4byte ScrCmd_checkplayergender @ 0xa0
.4byte ScrCmd_playmoncry @ 0xa1
.4byte ScrCmd_setmetatile @ 0xa2
.4byte ScrCmd_resetweather @ 0xa3
.4byte ScrCmd_setweather @ 0xa4
.4byte ScrCmd_doweather @ 0xa5
.4byte ScrCmd_setstepcallback @ 0xa6
.4byte ScrCmd_setmaplayoutindex @ 0xa7
.4byte ScrCmd_setobjectsubpriority @ 0xa8
.4byte ScrCmd_resetobjectsubpriority @ 0xa9
.4byte ScrCmd_createvobject @ 0xaa
.4byte ScrCmd_turnvobject @ 0xab
.4byte ScrCmd_opendoor @ 0xac
.4byte ScrCmd_closedoor @ 0xad
.4byte ScrCmd_waitdooranim @ 0xae
.4byte ScrCmd_setdooropen @ 0xaf
.4byte ScrCmd_setdoorclosed @ 0xb0
.4byte ScrCmd_addelevmenuitem @ 0xb1
.4byte ScrCmd_showelevmenu @ 0xb2
.4byte ScrCmd_checkcoins @ 0xb3
.4byte ScrCmd_addcoins @ 0xb4
.4byte ScrCmd_removecoins @ 0xb5
.4byte ScrCmd_setwildbattle @ 0xb6
.4byte ScrCmd_dowildbattle @ 0xb7
.4byte ScrCmd_setvaddress @ 0xb8
.4byte ScrCmd_vgoto @ 0xb9
.4byte ScrCmd_vcall @ 0xba
.4byte ScrCmd_vgoto_if @ 0xbb
.4byte ScrCmd_vcall_if @ 0xbc
.4byte ScrCmd_vmessage @ 0xbd
.4byte ScrCmd_vbuffermessage @ 0xbe
.4byte ScrCmd_vbufferstring @ 0xbf
.4byte ScrCmd_showcoinsbox @ 0xc0
.4byte ScrCmd_hidecoinsbox @ 0xc1
.4byte ScrCmd_updatecoinsbox @ 0xc2
.4byte ScrCmd_incrementgamestat @ 0xc3
.4byte ScrCmd_setescapewarp @ 0xc4
.4byte ScrCmd_waitmoncry @ 0xc5
.4byte ScrCmd_bufferboxname @ 0xc6
.4byte ScrCmd_textcolor @ 0xc7
.4byte ScrCmd_loadhelp @ 0xc8
.4byte ScrCmd_unloadhelp @ 0xc9
.4byte ScrCmd_signmsg @ 0xca
.4byte ScrCmd_normalmsg @ 0xcb
.4byte ScrCmd_comparestat @ 0xcc
.4byte ScrCmd_setmoneventlegal @ 0xcd
.4byte ScrCmd_checkmoneventlegal @ 0xce
.4byte ScrCmd_trywondercardscript @ 0xcf
.4byte ScrCmd_setworldmapflag @ 0xd0
.4byte ScrCmd_warpspinenter @ 0xd1
.4byte ScrCmd_setmonmetlocation @ 0xd2
.4byte ScrCmd_getbraillestringwidth @ 0xd3
.4byte ScrCmd_bufferitemnameplural @ 0xd4
.4byte ScrCmd_nop @ 0x00
.4byte ScrCmd_nop1 @ 0x01
.4byte ScrCmd_end @ 0x02
.4byte ScrCmd_return @ 0x03
.4byte ScrCmd_call @ 0x04
.4byte ScrCmd_goto @ 0x05
.4byte ScrCmd_goto_if @ 0x06
.4byte ScrCmd_call_if @ 0x07
.4byte ScrCmd_gotostd @ 0x08
.4byte ScrCmd_callstd @ 0x09
.4byte ScrCmd_gotostd_if @ 0x0a
.4byte ScrCmd_callstd_if @ 0x0b
.4byte ScrCmd_returnram @ 0x0c
.4byte ScrCmd_endram @ 0x0d
.4byte ScrCmd_setmysteryeventstatus @ 0x0e
.4byte ScrCmd_loadword @ 0x0f
.4byte ScrCmd_loadbyte @ 0x10
.4byte ScrCmd_setptr @ 0x11
.4byte ScrCmd_loadbytefromptr @ 0x12
.4byte ScrCmd_setptrbyte @ 0x13
.4byte ScrCmd_copylocal @ 0x14
.4byte ScrCmd_copybyte @ 0x15
.4byte ScrCmd_setvar @ 0x16
.4byte ScrCmd_addvar @ 0x17
.4byte ScrCmd_subvar @ 0x18
.4byte ScrCmd_copyvar @ 0x19
.4byte ScrCmd_setorcopyvar @ 0x1a
.4byte ScrCmd_compare_local_to_local @ 0x1b
.4byte ScrCmd_compare_local_to_value @ 0x1c
.4byte ScrCmd_compare_local_to_ptr @ 0x1d
.4byte ScrCmd_compare_ptr_to_local @ 0x1e
.4byte ScrCmd_compare_ptr_to_value @ 0x1f
.4byte ScrCmd_compare_ptr_to_ptr @ 0x20
.4byte ScrCmd_compare_var_to_value @ 0x21
.4byte ScrCmd_compare_var_to_var @ 0x22
.4byte ScrCmd_callnative @ 0x23
.4byte ScrCmd_gotonative @ 0x24
.4byte ScrCmd_special @ 0x25
.4byte ScrCmd_specialvar @ 0x26
.4byte ScrCmd_waitstate @ 0x27
.4byte ScrCmd_delay @ 0x28
.4byte ScrCmd_setflag @ 0x29
.4byte ScrCmd_clearflag @ 0x2a
.4byte ScrCmd_checkflag @ 0x2b
.4byte ScrCmd_initclock @ 0x2c
.4byte ScrCmd_dotimebasedevents @ 0x2d
.4byte ScrCmd_gettime @ 0x2e
.4byte ScrCmd_playse @ 0x2f
.4byte ScrCmd_waitse @ 0x30
.4byte ScrCmd_playfanfare @ 0x31
.4byte ScrCmd_waitfanfare @ 0x32
.4byte ScrCmd_playbgm @ 0x33
.4byte ScrCmd_savebgm @ 0x34
.4byte ScrCmd_fadedefaultbgm @ 0x35
.4byte ScrCmd_fadenewbgm @ 0x36
.4byte ScrCmd_fadeoutbgm @ 0x37
.4byte ScrCmd_fadeinbgm @ 0x38
.4byte ScrCmd_warp @ 0x39
.4byte ScrCmd_warpsilent @ 0x3a
.4byte ScrCmd_warpdoor @ 0x3b
.4byte ScrCmd_warphole @ 0x3c
.4byte ScrCmd_warpteleport @ 0x3d
.4byte ScrCmd_setwarp @ 0x3e
.4byte ScrCmd_setdynamicwarp @ 0x3f
.4byte ScrCmd_setdivewarp @ 0x40
.4byte ScrCmd_setholewarp @ 0x41
.4byte ScrCmd_getplayerxy @ 0x42
.4byte ScrCmd_getpartysize @ 0x43
.4byte ScrCmd_additem @ 0x44
.4byte ScrCmd_removeitem @ 0x45
.4byte ScrCmd_checkitemspace @ 0x46
.4byte ScrCmd_checkitem @ 0x47
.4byte ScrCmd_checkitemtype @ 0x48
.4byte ScrCmd_addpcitem @ 0x49
.4byte ScrCmd_checkpcitem @ 0x4a
.4byte ScrCmd_adddecoration @ 0x4b
.4byte ScrCmd_removedecoration @ 0x4c
.4byte ScrCmd_checkdecor @ 0x4d
.4byte ScrCmd_checkdecorspace @ 0x4e
.4byte ScrCmd_applymovement @ 0x4f
.4byte ScrCmd_applymovementat @ 0x50
.4byte ScrCmd_waitmovement @ 0x51
.4byte ScrCmd_waitmovementat @ 0x52
.4byte ScrCmd_removeobject @ 0x53
.4byte ScrCmd_removeobjectat @ 0x54
.4byte ScrCmd_addobject @ 0x55
.4byte ScrCmd_addobjectat @ 0x56
.4byte ScrCmd_setobjectxy @ 0x57
.4byte ScrCmd_showobjectat @ 0x58
.4byte ScrCmd_hideobjectat @ 0x59
.4byte ScrCmd_faceplayer @ 0x5a
.4byte ScrCmd_turnobject @ 0x5b
.4byte ScrCmd_trainerbattle @ 0x5c
.4byte ScrCmd_dotrainerbattle @ 0x5d
.4byte ScrCmd_gotopostbattlescript @ 0x5e
.4byte ScrCmd_gotobeatenscript @ 0x5f
.4byte ScrCmd_checktrainerflag @ 0x60
.4byte ScrCmd_settrainerflag @ 0x61
.4byte ScrCmd_cleartrainerflag @ 0x62
.4byte ScrCmd_setobjectxyperm @ 0x63
.4byte ScrCmd_copyobjectxytoperm @ 0x64
.4byte ScrCmd_setobjectmovementtype @ 0x65
.4byte ScrCmd_waitmessage @ 0x66
.4byte ScrCmd_message @ 0x67
.4byte ScrCmd_closemessage @ 0x68
.4byte ScrCmd_lockall @ 0x69
.4byte ScrCmd_lock @ 0x6a
.4byte ScrCmd_releaseall @ 0x6b
.4byte ScrCmd_release @ 0x6c
.4byte ScrCmd_waitbuttonpress @ 0x6d
.4byte ScrCmd_yesnobox @ 0x6e
.4byte ScrCmd_multichoice @ 0x6f
.4byte ScrCmd_multichoicedefault @ 0x70
.4byte ScrCmd_multichoicegrid @ 0x71
.4byte ScrCmd_drawbox @ 0x72
.4byte ScrCmd_erasebox @ 0x73
.4byte ScrCmd_drawboxtext @ 0x74
.4byte ScrCmd_showmonpic @ 0x75
.4byte ScrCmd_hidemonpic @ 0x76
.4byte ScrCmd_showcontestpainting @ 0x77
.4byte ScrCmd_braillemessage @ 0x78
.4byte ScrCmd_givemon @ 0x79
.4byte ScrCmd_giveegg @ 0x7a
.4byte ScrCmd_setmonmove @ 0x7b
.4byte ScrCmd_checkpartymove @ 0x7c
.4byte ScrCmd_bufferspeciesname @ 0x7d
.4byte ScrCmd_bufferleadmonspeciesname @ 0x7e
.4byte ScrCmd_bufferpartymonnick @ 0x7f
.4byte ScrCmd_bufferitemname @ 0x80
.4byte ScrCmd_bufferdecorationname @ 0x81
.4byte ScrCmd_buffermovename @ 0x82
.4byte ScrCmd_buffernumberstring @ 0x83
.4byte ScrCmd_bufferstdstring @ 0x84
.4byte ScrCmd_bufferstring @ 0x85
.4byte ScrCmd_pokemart @ 0x86
.4byte ScrCmd_pokemartdecoration @ 0x87
.4byte ScrCmd_pokemartdecoration2 @ 0x88
.4byte ScrCmd_playslotmachine @ 0x8
.4byte ScrCmd_setberrytree @ 0x8a
.4byte ScrCmd_choosecontestmon @ 0x8b
.4byte ScrCmd_startcontest @ 0x8c
.4byte ScrCmd_showcontestresults @ 0x8d
.4byte ScrCmd_contestlinktransfer @ 0x8e
.4byte ScrCmd_random @ 0x8f
.4byte ScrCmd_addmoney @ 0x90
.4byte ScrCmd_removemoney @ 0x91
.4byte ScrCmd_checkmoney @ 0x92
.4byte ScrCmd_showmoneybox @ 0x93
.4byte ScrCmd_hidemoneybox @ 0x94
.4byte ScrCmd_updatemoneybox @ 0x95
.4byte ScrCmd_getpokenewsactive @ 0x96
.4byte ScrCmd_fadescreen @ 0x97
.4byte ScrCmd_fadescreenspeed @ 0x98
.4byte ScrCmd_setflashlevel @ 0x99
.4byte ScrCmd_animateflash @ 0x9a
.4byte ScrCmd_messageautoscroll @ 0x9b
.4byte ScrCmd_dofieldeffect @ 0x9c
.4byte ScrCmd_setfieldeffectargument @ 0x9d
.4byte ScrCmd_waitfieldeffect @ 0x9e
.4byte ScrCmd_setrespawn @ 0x9f
.4byte ScrCmd_checkplayergender @ 0xa0
.4byte ScrCmd_playmoncry @ 0xa1
.4byte ScrCmd_setmetatile @ 0xa2
.4byte ScrCmd_resetweather @ 0xa3
.4byte ScrCmd_setweather @ 0xa4
.4byte ScrCmd_doweather @ 0xa5
.4byte ScrCmd_setstepcallback @ 0xa6
.4byte ScrCmd_setmaplayoutindex @ 0xa7
.4byte ScrCmd_setobjectsubpriority @ 0xa8
.4byte ScrCmd_resetobjectsubpriority @ 0xa9
.4byte ScrCmd_createvobject @ 0xaa
.4byte ScrCmd_turnvobject @ 0xab
.4byte ScrCmd_opendoor @ 0xac
.4byte ScrCmd_closedoor @ 0xad
.4byte ScrCmd_waitdooranim @ 0xae
.4byte ScrCmd_setdooropen @ 0xaf
.4byte ScrCmd_setdoorclosed @ 0xb0
.4byte ScrCmd_addelevmenuitem @ 0xb1
.4byte ScrCmd_showelevmenu @ 0xb2
.4byte ScrCmd_checkcoins @ 0xb3
.4byte ScrCmd_addcoins @ 0xb4
.4byte ScrCmd_removecoins @ 0xb5
.4byte ScrCmd_setwildbattle @ 0xb6
.4byte ScrCmd_dowildbattle @ 0xb7
.4byte ScrCmd_setvaddress @ 0xb8
.4byte ScrCmd_vgoto @ 0xb9
.4byte ScrCmd_vcall @ 0xba
.4byte ScrCmd_vgoto_if @ 0xbb
.4byte ScrCmd_vcall_if @ 0xbc
.4byte ScrCmd_vmessage @ 0xbd
.4byte ScrCmd_vbuffermessage @ 0xbe
.4byte ScrCmd_vbufferstring @ 0xbf
.4byte ScrCmd_showcoinsbox @ 0xc0
.4byte ScrCmd_hidecoinsbox @ 0xc1
.4byte ScrCmd_updatecoinsbox @ 0xc2
.4byte ScrCmd_incrementgamestat @ 0xc3
.4byte ScrCmd_setescapewarp @ 0xc4
.4byte ScrCmd_waitmoncry @ 0xc5
.4byte ScrCmd_bufferboxname @ 0xc6
.4byte ScrCmd_textcolor @ 0xc7
.4byte ScrCmd_loadhelp @ 0xc8
.4byte ScrCmd_unloadhelp @ 0xc9
.4byte ScrCmd_signmsg @ 0xca
.4byte ScrCmd_normalmsg @ 0xcb
.4byte ScrCmd_comparestat @ 0xcc
.4byte ScrCmd_setmonmodernfatefulencounter @ 0xcd
.4byte ScrCmd_checkmonmodernfatefulencounter @ 0xce
.4byte ScrCmd_trywondercardscript @ 0xcf
.4byte ScrCmd_setworldmapflag @ 0xd0
.4byte ScrCmd_warpspinenter @ 0xd1
.4byte ScrCmd_setmonmetlocation @ 0xd2
.4byte ScrCmd_getbraillestringwidth @ 0xd3
.4byte ScrCmd_bufferitemnameplural @ 0xd4
gScriptCmdTableEnd::
.4byte ScrCmd_nop
+1 -1
View File
@@ -451,5 +451,5 @@ gSpecials::
def_special InitElevatorFloorSelectMenuPos
def_special UpdateLoreleiDollCollection
def_special LoopWingFlapSound
def_special CreateEventLegalEnemyMon
def_special CreateEnemyEventMon
gSpecialsEnd::
+1 -1
View File
@@ -518,7 +518,7 @@ struct BattleScripting
u8 pursuitDoublesAttacker;
u8 reshowMainState;
u8 reshowHelperState;
u8 field_23;
u8 levelUpHP;
};
struct BattleSpriteInfo
+1 -1
View File
@@ -28,7 +28,7 @@
#define HOLD_EFFECT_MACHO_BRACE 24
#define HOLD_EFFECT_EXP_SHARE 25
#define HOLD_EFFECT_QUICK_CLAW 26
#define HOLD_EFFECT_HAPPINESS_UP 27
#define HOLD_EFFECT_FRIENDSHIP_UP 27
#define HOLD_EFFECT_CURE_ATTRACT 28
#define HOLD_EFFECT_CHOICE_BAND 29
#define HOLD_EFFECT_FLINCH 30
+15 -2
View File
@@ -3,7 +3,7 @@
// field 0 masks
#define ITEM0_X_ATTACK 0x0F
#define ITEM0_HIGH_CRIT 0x30 // For Dire Hit, works the same way as move Focus Energy.
#define ITEM0_DIRE_HIT 0x30 // Works the same way as move Focus Energy.
#define ITEM0_SACRED_ASH 0x40
#define ITEM0_INFATUATION 0x80
@@ -23,7 +23,7 @@
#define ITEM3_POISON 0x10
#define ITEM3_SLEEP 0x20
#define ITEM3_LEVEL_UP 0x40
#define ITEM3_MIST 0x80 // For Guard Specs, works the same way as move Mist.
#define ITEM3_GUARD_SPEC 0x80 // Works the same way as the move Mist.
#define ITEM3_STATUS_ALL (ITEM3_CONFUSION | ITEM3_PARALYSIS | ITEM3_FREEZE | ITEM3_BURN | ITEM3_POISON | ITEM3_SLEEP)
@@ -50,6 +50,19 @@
#define ITEM5_FRIENDSHIP_ALL (ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID | ITEM5_FRIENDSHIP_HIGH)
// fields 6 and onwards are item-specific arguments
#define ITEM_EFFECT_ARG_START 6
// Special HP recovery amounts for ITEM4_HEAL_HP
#define ITEM6_HEAL_HP_FULL ((u8) -1)
#define ITEM6_HEAL_HP_HALF ((u8) -2)
#define ITEM6_HEAL_HP_LVL_UP ((u8) -3)
// Special PP recovery amounts for ITEM4_HEAL_PP
#define ITEM6_HEAL_PP_FULL 0x7F
// Amount of EV modified by ITEM4_EV_HP, ITEM4_EV_ATK, ITEM5_EV_DEF, ITEM5_EV_SPEED, ITEM5_EV_SPDEF and ITEM5_EV_SPATK
#define ITEM6_ADD_EV 10
#define ITEM6_SUBTRACT_EV -10
// Used for GetItemEffectType.
#define ITEM_EFFECT_X_ITEM 0
+177 -118
View File
@@ -2,95 +2,95 @@
#define GUARD_CONSTANTS_POKEMON_H
// For (Set|Get)(Box)?MonData
#define MON_DATA_PERSONALITY 0
#define MON_DATA_OT_ID 1
#define MON_DATA_NICKNAME 2
#define MON_DATA_LANGUAGE 3
#define MON_DATA_SANITY_IS_BAD_EGG 4
#define MON_DATA_SANITY_HAS_SPECIES 5
#define MON_DATA_SANITY_IS_EGG 6
#define MON_DATA_OT_NAME 7
#define MON_DATA_MARKINGS 8
#define MON_DATA_CHECKSUM 9
#define MON_DATA_ENCRYPT_SEPARATOR 10
#define MON_DATA_SPECIES 11
#define MON_DATA_HELD_ITEM 12
#define MON_DATA_MOVE1 13
#define MON_DATA_MOVE2 14
#define MON_DATA_MOVE3 15
#define MON_DATA_MOVE4 16
#define MON_DATA_PP1 17
#define MON_DATA_PP2 18
#define MON_DATA_PP3 19
#define MON_DATA_PP4 20
#define MON_DATA_PP_BONUSES 21
#define MON_DATA_COOL 22
#define MON_DATA_BEAUTY 23
#define MON_DATA_CUTE 24
#define MON_DATA_EXP 25
#define MON_DATA_HP_EV 26
#define MON_DATA_ATK_EV 27
#define MON_DATA_DEF_EV 28
#define MON_DATA_SPEED_EV 29
#define MON_DATA_SPATK_EV 30
#define MON_DATA_SPDEF_EV 31
#define MON_DATA_FRIENDSHIP 32
#define MON_DATA_SMART 33
#define MON_DATA_POKERUS 34
#define MON_DATA_MET_LOCATION 35
#define MON_DATA_MET_LEVEL 36
#define MON_DATA_MET_GAME 37
#define MON_DATA_POKEBALL 38
#define MON_DATA_HP_IV 39
#define MON_DATA_ATK_IV 40
#define MON_DATA_DEF_IV 41
#define MON_DATA_SPEED_IV 42
#define MON_DATA_SPATK_IV 43
#define MON_DATA_SPDEF_IV 44
#define MON_DATA_IS_EGG 45
#define MON_DATA_ABILITY_NUM 46
#define MON_DATA_TOUGH 47
#define MON_DATA_SHEEN 48
#define MON_DATA_OT_GENDER 49
#define MON_DATA_COOL_RIBBON 50
#define MON_DATA_BEAUTY_RIBBON 51
#define MON_DATA_CUTE_RIBBON 52
#define MON_DATA_SMART_RIBBON 53
#define MON_DATA_TOUGH_RIBBON 54
#define MON_DATA_STATUS 55
#define MON_DATA_LEVEL 56
#define MON_DATA_HP 57
#define MON_DATA_MAX_HP 58
#define MON_DATA_ATK 59
#define MON_DATA_DEF 60
#define MON_DATA_SPEED 61
#define MON_DATA_SPATK 62
#define MON_DATA_SPDEF 63
#define MON_DATA_MAIL 64
#define MON_DATA_SPECIES2 65
#define MON_DATA_IVS 66
#define MON_DATA_CHAMPION_RIBBON 67
#define MON_DATA_WINNING_RIBBON 68
#define MON_DATA_VICTORY_RIBBON 69
#define MON_DATA_ARTIST_RIBBON 70
#define MON_DATA_EFFORT_RIBBON 71
#define MON_DATA_MARINE_RIBBON 72
#define MON_DATA_LAND_RIBBON 73
#define MON_DATA_SKY_RIBBON 74
#define MON_DATA_COUNTRY_RIBBON 75
#define MON_DATA_NATIONAL_RIBBON 76
#define MON_DATA_EARTH_RIBBON 77
#define MON_DATA_WORLD_RIBBON 78
#define MON_DATA_UNUSED_RIBBONS 79
#define MON_DATA_EVENT_LEGAL 80
#define MON_DATA_KNOWN_MOVES 81
#define MON_DATA_RIBBON_COUNT 82
#define MON_DATA_RIBBONS 83
#define MON_DATA_ATK2 84
#define MON_DATA_DEF2 85
#define MON_DATA_SPEED2 86
#define MON_DATA_SPATK2 87
#define MON_DATA_SPDEF2 88
#define MON_DATA_PERSONALITY 0
#define MON_DATA_OT_ID 1
#define MON_DATA_NICKNAME 2
#define MON_DATA_LANGUAGE 3
#define MON_DATA_SANITY_IS_BAD_EGG 4
#define MON_DATA_SANITY_HAS_SPECIES 5
#define MON_DATA_SANITY_IS_EGG 6
#define MON_DATA_OT_NAME 7
#define MON_DATA_MARKINGS 8
#define MON_DATA_CHECKSUM 9
#define MON_DATA_ENCRYPT_SEPARATOR 10
#define MON_DATA_SPECIES 11
#define MON_DATA_HELD_ITEM 12
#define MON_DATA_MOVE1 13
#define MON_DATA_MOVE2 14
#define MON_DATA_MOVE3 15
#define MON_DATA_MOVE4 16
#define MON_DATA_PP1 17
#define MON_DATA_PP2 18
#define MON_DATA_PP3 19
#define MON_DATA_PP4 20
#define MON_DATA_PP_BONUSES 21
#define MON_DATA_COOL 22
#define MON_DATA_BEAUTY 23
#define MON_DATA_CUTE 24
#define MON_DATA_EXP 25
#define MON_DATA_HP_EV 26
#define MON_DATA_ATK_EV 27
#define MON_DATA_DEF_EV 28
#define MON_DATA_SPEED_EV 29
#define MON_DATA_SPATK_EV 30
#define MON_DATA_SPDEF_EV 31
#define MON_DATA_FRIENDSHIP 32
#define MON_DATA_SMART 33
#define MON_DATA_POKERUS 34
#define MON_DATA_MET_LOCATION 35
#define MON_DATA_MET_LEVEL 36
#define MON_DATA_MET_GAME 37
#define MON_DATA_POKEBALL 38
#define MON_DATA_HP_IV 39
#define MON_DATA_ATK_IV 40
#define MON_DATA_DEF_IV 41
#define MON_DATA_SPEED_IV 42
#define MON_DATA_SPATK_IV 43
#define MON_DATA_SPDEF_IV 44
#define MON_DATA_IS_EGG 45
#define MON_DATA_ABILITY_NUM 46
#define MON_DATA_TOUGH 47
#define MON_DATA_SHEEN 48
#define MON_DATA_OT_GENDER 49
#define MON_DATA_COOL_RIBBON 50
#define MON_DATA_BEAUTY_RIBBON 51
#define MON_DATA_CUTE_RIBBON 52
#define MON_DATA_SMART_RIBBON 53
#define MON_DATA_TOUGH_RIBBON 54
#define MON_DATA_STATUS 55
#define MON_DATA_LEVEL 56
#define MON_DATA_HP 57
#define MON_DATA_MAX_HP 58
#define MON_DATA_ATK 59
#define MON_DATA_DEF 60
#define MON_DATA_SPEED 61
#define MON_DATA_SPATK 62
#define MON_DATA_SPDEF 63
#define MON_DATA_MAIL 64
#define MON_DATA_SPECIES_OR_EGG 65
#define MON_DATA_IVS 66
#define MON_DATA_CHAMPION_RIBBON 67
#define MON_DATA_WINNING_RIBBON 68
#define MON_DATA_VICTORY_RIBBON 69
#define MON_DATA_ARTIST_RIBBON 70
#define MON_DATA_EFFORT_RIBBON 71
#define MON_DATA_MARINE_RIBBON 72
#define MON_DATA_LAND_RIBBON 73
#define MON_DATA_SKY_RIBBON 74
#define MON_DATA_COUNTRY_RIBBON 75
#define MON_DATA_NATIONAL_RIBBON 76
#define MON_DATA_EARTH_RIBBON 77
#define MON_DATA_WORLD_RIBBON 78
#define MON_DATA_UNUSED_RIBBONS 79
#define MON_DATA_MODERN_FATEFUL_ENCOUNTER 80
#define MON_DATA_KNOWN_MOVES 81
#define MON_DATA_RIBBON_COUNT 82
#define MON_DATA_RIBBONS 83
#define MON_DATA_ATK2 84
#define MON_DATA_DEF2 85
#define MON_DATA_SPEED2 86
#define MON_DATA_SPATK2 87
#define MON_DATA_SPDEF2 88
// Pokemon types
#define TYPE_NONE 255
@@ -115,21 +115,21 @@
#define NUMBER_OF_MON_TYPES 18
// 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_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
#define EGG_GROUPS_PER_MON 2
@@ -184,23 +184,29 @@
// Shiny odds
#define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536
#define MAX_LEVEL 100
#define OT_ID_PLAYER_ID 0
#define OT_ID_PRESET 1
#define OT_ID_RANDOM_NO_SHINY 2
#define MON_GIVEN_TO_PARTY 0
#define MON_GIVEN_TO_PC 1
#define MON_CANT_GIVE 2
#define PLAYER_HAS_TWO_USABLE_MONS 0
#define PLAYER_HAS_ONE_MON 1
#define PLAYER_HAS_ONE_USABLE_MON 2
// Learning moves
#define MON_ALREADY_KNOWS_MOVE 0xFFFE
#define MON_HAS_MAX_MOVES 0xFFFF
#define PLAYER_HAS_TWO_USABLE_MONS 0x0
#define PLAYER_HAS_ONE_MON 0x1
#define PLAYER_HAS_ONE_USABLE_MON 0x2
#define LEVEL_UP_MOVE_ID 0x01FF
#define LEVEL_UP_MOVE_LV 0xFE00
#define LEVEL_UP_END 0xFFFF
#define MAX_LEVEL 100
#define OT_ID_RANDOM_NO_SHINY 2
#define OT_ID_PRESET 1
#define OT_ID_PLAYER_ID 0
#define MON_GIVEN_TO_PARTY 0x0
#define MON_GIVEN_TO_PC 0x1
#define MON_CANT_GIVE 0x2
#define MAX_LEVEL_UP_MOVES 20
#define MON_MALE 0x00
#define MON_FEMALE 0xFE
@@ -217,6 +223,10 @@
#define FRIENDSHIP_EVENT_FAINT_OUTSIDE_BATTLE 8
#define FRIENDSHIP_EVENT_FAINT_LARGE 9
#define MAX_FRIENDSHIP 255
#define MAX_SHEEN 255
#define MAX_CONDITION 255
#define MAX_PER_STAT_IVS 31
#define MAX_IV_MASK 31
#define USE_RANDOM_IVS (MAX_PER_STAT_IVS + 1)
@@ -224,8 +234,52 @@
#define MAX_TOTAL_EVS 510
#define EV_ITEM_RAISE_LIMIT 100
#define PARTY_SIZE 6
#define BOX_NAME_LENGTH 8
// Battle move flags
#define FLAG_MAKES_CONTACT (1 << 0)
#define FLAG_PROTECT_AFFECTED (1 << 1)
#define FLAG_MAGIC_COAT_AFFECTED (1 << 2)
#define FLAG_SNATCH_AFFECTED (1 << 3)
#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4)
#define FLAG_KINGS_ROCK_AFFECTED (1 << 5)
// Growth rates
#define GROWTH_MEDIUM_FAST 0
#define GROWTH_ERRATIC 1
#define GROWTH_FLUCTUATING 2
#define GROWTH_MEDIUM_SLOW 3
#define GROWTH_FAST 4
#define GROWTH_SLOW 5
// Body colors for pokedex search
#define BODY_COLOR_RED 0
#define BODY_COLOR_BLUE 1
#define BODY_COLOR_YELLOW 2
#define BODY_COLOR_GREEN 3
#define BODY_COLOR_BLACK 4
#define BODY_COLOR_BROWN 5
#define BODY_COLOR_PURPLE 6
#define BODY_COLOR_GRAY 7
#define BODY_COLOR_WHITE 8
#define BODY_COLOR_PINK 9
// Evolution types
#define EVO_FRIENDSHIP 1 // Pokémon levels up with friendship ≥ 220
#define EVO_FRIENDSHIP_DAY 2 // Pokémon levels up during the day with friendship ≥ 220
#define EVO_FRIENDSHIP_NIGHT 3 // Pokémon levels up at night with friendship ≥ 220
#define EVO_LEVEL 4 // Pokémon reaches the specified level
#define EVO_TRADE 5 // Pokémon is traded
#define EVO_TRADE_ITEM 6 // Pokémon is traded while it's holding the specified item
#define EVO_ITEM 7 // specified item is used on Pokémon
#define EVO_LEVEL_ATK_GT_DEF 8 // Pokémon reaches the specified level with attack > defense
#define EVO_LEVEL_ATK_EQ_DEF 9 // Pokémon reaches the specified level with attack = defense
#define EVO_LEVEL_ATK_LT_DEF 10 // Pokémon reaches the specified level with attack < defense
#define EVO_LEVEL_SILCOON 11 // Pokémon reaches the specified level with a Silcoon personality value
#define EVO_LEVEL_CASCOON 12 // Pokémon reaches the specified level with a Cascoon personality value
#define EVO_LEVEL_NINJASK 13 // Pokémon reaches the specified level (special value for Ninjask)
#define EVO_LEVEL_SHEDINJA 14 // Pokémon reaches the specified level (special value for Shedinja)
#define EVO_BEAUTY 15 // Pokémon levels up with beauty ≥ specified value
#define EVOS_PER_MON 5
#define EVO_MODE_NORMAL 0
#define EVO_MODE_TRADE 1
@@ -236,6 +290,11 @@
#define MON_PIC_HEIGHT 64
#define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2)
// Most pokemon have 1 frame. There are 2 exceptions:
// - Castform has 4 frames, 1 for each form
// - Deoxys has 2 frames, 1 for each form
#define MAX_MON_PIC_FRAMES 4
// used by ShouldIgnoreDeoxysForm
#define DEOXYS_CHECK_BATTLE_SPRITE 1
#define DEOXYS_CHECK_TRADE_MAIN 3
+2
View File
@@ -14,6 +14,8 @@
ptr = NULL; \
}
#define TRY_FREE_AND_SET_NULL(ptr) if (ptr != NULL) FREE_AND_SET_NULL(ptr)
extern u8 gHeap[];
void *Alloc(u32 size);
void *AllocZeroed(u32 size);
+62 -104
View File
@@ -4,7 +4,6 @@
#include "global.h"
#include "sprite.h"
#include "constants/pokemon.h"
#include "pokemon_storage_system.h"
struct PokemonSubstruct0
{
@@ -13,12 +12,13 @@ struct PokemonSubstruct0
u32 experience;
u8 ppBonuses;
u8 friendship;
u16 filler;
};
struct PokemonSubstruct1
{
u16 moves[4];
u8 pp[4];
u16 moves[MAX_MON_MOVES];
u8 pp[MAX_MON_MOVES];
};
struct PokemonSubstruct2
@@ -56,34 +56,50 @@ struct PokemonSubstruct3
/* 0x07 */ u32 isEgg:1;
/* 0x07 */ u32 abilityNum:1;
/* 0x08 */ u32 coolRibbon:3;
/* 0x08 */ u32 beautyRibbon:3;
/* 0x08 */ u32 cuteRibbon:3;
/* 0x09 */ u32 smartRibbon:3;
/* 0x09 */ u32 toughRibbon:3;
/* 0x09 */ u32 championRibbon:1;
/* 0x0A */ u32 winningRibbon:1;
/* 0x0A */ u32 victoryRibbon:1;
/* 0x0A */ u32 artistRibbon:1;
/* 0x0A */ u32 effortRibbon:1;
/* 0x0A */ u32 marineRibbon:1; // never distributed
/* 0x0A */ u32 landRibbon:1; // never distributed
/* 0x0A */ u32 skyRibbon:1; // never distributed
/* 0x0A */ u32 countryRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners
/* 0x0B */ u32 nationalRibbon:1;
/* 0x0B */ u32 earthRibbon:1;
/* 0x0B */ u32 worldRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners
/* 0x0B */ u32 unusedRibbons:4; // discarded in Gen 4
/* 0x0B */ u32 eventLegal:1; // controls Mew & Deoxys obedience; if set, Pokémon is a fateful encounter in FRLG & Gen 4+ summary screens; set for in-game event island legendaries, some distributed events, and Pokémon from XD: Gale of Darkness.
/* 0x08 */ u32 coolRibbon:3; // Stores the highest contest rank achieved in the Cool category.
/* 0x08 */ u32 beautyRibbon:3; // Stores the highest contest rank achieved in the Beauty category.
/* 0x08 */ u32 cuteRibbon:3; // Stores the highest contest rank achieved in the Cute category.
/* 0x09 */ u32 smartRibbon:3; // Stores the highest contest rank achieved in the Smart category.
/* 0x09 */ u32 toughRibbon:3; // Stores the highest contest rank achieved in the Tough category.
/* 0x09 */ u32 championRibbon:1; // Given when defeating the Champion. Because both RSE and FRLG use it, later generations don't specify from which region it comes from.
/* 0x0A */ u32 winningRibbon:1; // Given at the Battle Tower's Level 50 challenge by winning a set of seven battles that extends the current streak to 56 or more.
/* 0x0A */ u32 victoryRibbon:1; // Given at the Battle Tower's Level 100 challenge by winning a set of seven battles that extends the current streak to 56 or more.
/* 0x0A */ u32 artistRibbon:1; // Given at the Contest Hall by winning a Master Rank contest with at least 800 points, and agreeing to have the Pokémon's portrait placed in the museum after being offered.
/* 0x0A */ u32 effortRibbon:1; // Given at Slateport's market to Pokémon with maximum EVs.
/* 0x0A */ u32 marineRibbon:1; // Never distributed.
/* 0x0A */ u32 landRibbon:1; // Never distributed.
/* 0x0A */ u32 skyRibbon:1; // Never distributed.
/* 0x0A */ u32 countryRibbon:1; // Distributed during Pokémon Festa '04 and '05 to tournament winners.
/* 0x0B */ u32 nationalRibbon:1; // Given to purified Shadow Pokémon in Colosseum/XD.
/* 0x0B */ u32 earthRibbon:1; // Given to teams that have beaten Mt. Battle's 100-battle challenge in Colosseum/XD.
/* 0x0B */ u32 worldRibbon:1; // Distributed during Pokémon Festa '04 and '05 to tournament winners.
/* 0x0B */ u32 unusedRibbons:4; // Discarded in Gen 4.
// The functionality of this bit changed in FRLG:
// In RS, this bit does nothing, is never set, & is accidentally unset when hatching Eggs.
// In FRLG & Emerald, this controls Mew & Deoxys obedience and whether they can be traded.
// If set, a Pokémon is a fateful encounter in FRLG's summary screen if hatched & for all Pokémon in Gen 4+ summary screens.
// Set for in-game event island legendaries, events distributed after a certain date, & Pokémon from XD: Gale of Darkness.
// Not to be confused with METLOC_FATEFUL_ENCOUNTER.
/* 0x0B */ u32 modernFatefulEncounter:1;
};
// Number of bytes in the largest Pokémon substruct.
// They are assumed to be the same size, and will be padded to
// the largest size by the union.
// By default they are all 12 bytes.
#define NUM_SUBSTRUCT_BYTES (max(sizeof(struct PokemonSubstruct0), \
max(sizeof(struct PokemonSubstruct1), \
max(sizeof(struct PokemonSubstruct2), \
sizeof(struct PokemonSubstruct3)))))
union PokemonSubstruct
{
struct PokemonSubstruct0 type0;
struct PokemonSubstruct1 type1;
struct PokemonSubstruct2 type2;
struct PokemonSubstruct3 type3;
u16 raw[6];
u16 raw[NUM_SUBSTRUCT_BYTES / 2]; // /2 because it's u16, not u8
};
struct BoxPokemon
@@ -103,7 +119,7 @@ struct BoxPokemon
union
{
u32 raw[12];
u32 raw[(NUM_SUBSTRUCT_BYTES * 4) / 4]; // *4 because there are 4 substructs, /4 because it's u32, not u8
union PokemonSubstruct substructs[4];
} secure;
};
@@ -123,19 +139,11 @@ struct Pokemon
u16 spDefense;
};
struct PokemonStorage
{
/*0x0000*/ u8 currentBox;
/*0x0001*/ struct BoxPokemon boxes[TOTAL_BOXES_COUNT][IN_BOX_COUNT];
/*0x8344*/ u8 boxNames[TOTAL_BOXES_COUNT][BOX_NAME_LENGTH + 1];
/*0x83C2*/ u8 boxWallpapers[TOTAL_BOXES_COUNT];
};
struct BattleTowerPokemon
{
/*0x00*/ u16 species;
/*0x02*/ u16 heldItem;
/*0x04*/ u16 moves[4];
/*0x04*/ u16 moves[MAX_MON_MOVES];
/*0x0C*/ u8 level;
/*0x0D*/ u8 ppBonuses;
/*0x0E*/ u8 hpEV;
@@ -154,12 +162,10 @@ struct BattleTowerPokemon
u32 gap:1;
u32 abilityNum:1;
/*0x1C*/ u32 personality;
/*0x20*/ u8 nickname[11];
/*0x20*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x2B*/ u8 friendship;
};
#define BATTLE_STATS_NO 8
struct BattlePokemon
{
/*0x00*/ u16 species;
@@ -168,7 +174,7 @@ struct BattlePokemon
/*0x06*/ u16 speed;
/*0x08*/ u16 spAttack;
/*0x0A*/ u16 spDefense;
/*0x0C*/ u16 moves[4];
/*0x0C*/ u16 moves[MAX_MON_MOVES];
/*0x14*/ u32 hpIV:5;
/*0x14*/ u32 attackIV:5;
/*0x15*/ u32 defenseIV:5;
@@ -177,12 +183,12 @@ struct BattlePokemon
/*0x17*/ u32 spDefenseIV:5;
/*0x17*/ u32 isEgg:1;
/*0x17*/ u32 abilityNum:1;
/*0x18*/ s8 statStages[BATTLE_STATS_NO];
/*0x18*/ s8 statStages[NUM_BATTLE_STATS];
/*0x20*/ u8 ability;
/*0x21*/ u8 type1;
/*0x22*/ u8 type2;
/*0x23*/ u8 unknown;
/*0x24*/ u8 pp[4];
/*0x24*/ u8 pp[MAX_MON_MOVES];
/*0x28*/ u16 hp;
/*0x2A*/ u8 level;
/*0x2B*/ u8 friendship;
@@ -190,7 +196,7 @@ struct BattlePokemon
/*0x2E*/ u16 item;
/*0x30*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x3B*/ u8 ppBonuses;
/*0x3C*/ u8 otName[8];
/*0x3C*/ u8 otName[PLAYER_NAME_LENGTH + 1];
/*0x44*/ u32 experience;
/*0x48*/ u32 personality;
/*0x4C*/ u32 status1;
@@ -198,7 +204,7 @@ struct BattlePokemon
/*0x54*/ u32 otId;
};
struct BaseStats
struct SpeciesInfo
{
/* 0x00 */ u8 baseHP;
/* 0x01 */ u8 baseAttack;
@@ -206,8 +212,7 @@ struct BaseStats
/* 0x03 */ u8 baseSpeed;
/* 0x04 */ u8 baseSpAttack;
/* 0x05 */ u8 baseSpDefense;
/* 0x06 */ u8 type1;
/* 0x07 */ u8 type2;
/* 0x06 */ u8 types[2];
/* 0x08 */ u8 catchRate;
/* 0x09 */ u8 expYield;
/* 0x0A */ u16 evYield_HP:2;
@@ -216,14 +221,13 @@ struct BaseStats
/* 0x0A */ u16 evYield_Speed:2;
/* 0x0B */ u16 evYield_SpAttack:2;
/* 0x0B */ u16 evYield_SpDefense:2;
/* 0x0C */ u16 item1;
/* 0x0E */ u16 item2;
/* 0x0C */ u16 itemCommon;
/* 0x0E */ u16 itemRare;
/* 0x10 */ u8 genderRatio;
/* 0x11 */ u8 eggCycles;
/* 0x12 */ u8 friendship;
/* 0x13 */ u8 growthRate;
/* 0x14 */ u8 eggGroup1;
/* 0x15 */ u8 eggGroup2;
/* 0x14 */ u8 eggGroups[2];
/* 0x16 */ u8 abilities[2];
/* 0x18 */ u8 safariZoneFleeRate;
/* 0x19 */ u8 bodyColor : 7;
@@ -243,20 +247,13 @@ struct BattleMove
u8 flags;
};
extern const struct BattleMove gBattleMoves[];
// Battle move flags
#define FLAG_MAKES_CONTACT (1 << 0)
#define FLAG_PROTECT_AFFECTED (1 << 1)
#define FLAG_MAGIC_COAT_AFFECTED (1 << 2)
#define FLAG_SNATCH_AFFECTED (1 << 3)
#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4)
#define FLAG_KINGS_ROCK_AFFECTED (1 << 5)
#define SPINDA_SPOT_WIDTH 16
#define SPINDA_SPOT_HEIGHT 16
struct SpindaSpot
{
u8 x, y;
u16 image[16];
u16 image[SPINDA_SPOT_HEIGHT];
};
struct __attribute__((packed)) LevelUpMove
@@ -265,46 +262,6 @@ struct __attribute__((packed)) LevelUpMove
u16 level:7;
};
enum
{
GROWTH_MEDIUM_FAST,
GROWTH_ERRATIC,
GROWTH_FLUCTUATING,
GROWTH_MEDIUM_SLOW,
GROWTH_FAST,
GROWTH_SLOW
};
enum
{
BODY_COLOR_RED,
BODY_COLOR_BLUE,
BODY_COLOR_YELLOW,
BODY_COLOR_GREEN,
BODY_COLOR_BLACK,
BODY_COLOR_BROWN,
BODY_COLOR_PURPLE,
BODY_COLOR_GRAY,
BODY_COLOR_WHITE,
BODY_COLOR_PINK
};
#define EVO_FRIENDSHIP 0x0001 // Pokémon levels up with friendship ≥ 220
#define EVO_FRIENDSHIP_DAY 0x0002 // Pokémon levels up during the day with friendship ≥ 220
#define EVO_FRIENDSHIP_NIGHT 0x0003 // Pokémon levels up at night with friendship ≥ 220
#define EVO_LEVEL 0x0004 // Pokémon reaches the specified level
#define EVO_TRADE 0x0005 // Pokémon is traded
#define EVO_TRADE_ITEM 0x0006 // Pokémon is traded while it's holding the specified item
#define EVO_ITEM 0x0007 // specified item is used on Pokémon
#define EVO_LEVEL_ATK_GT_DEF 0x0008 // Pokémon reaches the specified level with attack > defense
#define EVO_LEVEL_ATK_EQ_DEF 0x0009 // Pokémon reaches the specified level with attack = defense
#define EVO_LEVEL_ATK_LT_DEF 0x000a // Pokémon reaches the specified level with attack < defense
#define EVO_LEVEL_SILCOON 0x000b // Pokémon reaches the specified level with a Silcoon personality value
#define EVO_LEVEL_CASCOON 0x000c // Pokémon reaches the specified level with a Cascoon personality value
#define EVO_LEVEL_NINJASK 0x000d // Pokémon reaches the specified level (special value for Ninjask)
#define EVO_LEVEL_SHEDINJA 0x000e // Pokémon reaches the specified level (special value for Shedinja)
#define EVO_BEAUTY 0x000f // Pokémon levels up with beauty ≥ specified value
struct Evolution
{
u16 method;
@@ -312,8 +269,6 @@ struct Evolution
u16 targetSpecies;
};
#define EVOS_PER_MON 5
#define NUM_UNOWN_FORMS 28
#define GET_UNOWN_LETTER(personality) (( \
@@ -323,11 +278,14 @@ struct Evolution
| (((personality) & 0x00000003) >> 0) \
) % NUM_UNOWN_FORMS)
#define GET_SHINY_VALUE(otId, personality) (HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality))
extern const struct BattleMove gBattleMoves[];
extern u8 gPlayerPartyCount;
extern struct Pokemon gPlayerParty[PARTY_SIZE];
extern u8 gEnemyPartyCount;
extern struct Pokemon gEnemyParty[PARTY_SIZE];
extern const struct BaseStats gBaseStats[];
extern const struct SpeciesInfo gSpeciesInfo[];
extern const u8 *const gItemEffectTable[];
extern const u8 gStatStageRatios[][2];
extern struct SpriteTemplate gMultiuseSpriteTemplate;
@@ -459,11 +417,11 @@ bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId);
void SetDeoxysStats(void);
u16 GetUnionRoomTrainerPic(void);
u16 GetUnionRoomTrainerClass(void);
void CreateEventLegalEnemyMon(void);
void CreateEnemyEventMon(void);
void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
bool8 CheckBattleTypeGhost(struct Pokemon *mon, u8 bank);
struct OakSpeechNidoranFStruct *OakSpeechNidoranFSetup(u8 battlePosition, bool8 enable);
void OakSpeechNidoranFFreeResources(void);
void *OakSpeechNidoranFGetBuffer(u8 bufferId);
struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 battlePosition, u8 mode);
void DestroyMonSpritesGfxManager(void);
u8 *MonSpritesGfxManager_GetSpritePtr(u8 bufferId);
#endif // GUARD_POKEMON_H
+10
View File
@@ -2,11 +2,13 @@
#define GUARD_POKEMON_STORAGE_SYSTEM_H
#include "global.h"
#include "pokemon.h"
#define TOTAL_BOXES_COUNT 14
#define IN_BOX_ROWS 5 // Number of rows, 6 Pokémon per row
#define IN_BOX_COLUMNS 6 // Number of columns, 5 Pokémon per column
#define IN_BOX_COUNT (IN_BOX_ROWS * IN_BOX_COLUMNS)
#define BOX_NAME_LENGTH 8
/*
COLUMNS
@@ -39,6 +41,14 @@ enum
};
#define MAX_DEFAULT_WALLPAPER WALLPAPER_SAVANNA
struct PokemonStorage
{
/*0x0000*/ u8 currentBox;
/*0x0001*/ struct BoxPokemon boxes[TOTAL_BOXES_COUNT][IN_BOX_COUNT];
/*0x8344*/ u8 boxNames[TOTAL_BOXES_COUNT][BOX_NAME_LENGTH + 1];
/*0x83C2*/ u8 boxWallpapers[TOTAL_BOXES_COUNT];
};
u8 *GetBoxNamePtr(u8 boxNumber);
struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 monPosition);
void SetBoxMonNickAt(u8 boxId, u8 monPosition, const u8 *newNick);
+8 -8
View File
@@ -1113,8 +1113,8 @@ static void Cmd_count_alive_pokemon(void)
{
if (i != battlerOnField1 && i != battlerOnField2
&& GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
{
AI_THINKING_STRUCT->funcResult++;
}
@@ -1165,25 +1165,25 @@ static void Cmd_get_ability(void)
return;
}
if (gBaseStats[gBattleMons[battlerId].species].abilities[0] != ABILITY_NONE)
if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[0] != ABILITY_NONE)
{
if (gBaseStats[gBattleMons[battlerId].species].abilities[1] != ABILITY_NONE)
if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[1] != ABILITY_NONE)
{
// AI has no knowledge of opponent, so it guesses which ability.
if (Random() % 2)
AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[0];
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[0];
else
AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[1];
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1];
}
else
{
AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[0];
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[0];
}
}
else
{
// AI can't actually reach this part since no pokemon has ability 2 and no ability 1.
AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[1];
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1];
}
}
else
+19 -19
View File
@@ -54,8 +54,8 @@ static bool8 ShouldSwitchIfWonderGuard(void)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG
|| i == gBattlerPartyIndexes[gActiveBattler])
continue;
GetMonData(&gEnemyParty[i], MON_DATA_SPECIES); // Unused return value.
@@ -120,8 +120,8 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
u8 monAbility;
if ((GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
|| (i == gBattlerPartyIndexes[battlerIn1])
|| (i == gBattlerPartyIndexes[battlerIn2])
|| (i == *(gBattleStruct->monToSwitchIntoId + battlerIn1))
@@ -129,9 +129,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
continue;
species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES);
if (GetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM) != ABILITY_NONE)
monAbility = gBaseStats[species].abilities[1];
monAbility = gSpeciesInfo[species].abilities[1];
else
monAbility = gBaseStats[species].abilities[0];
monAbility = gSpeciesInfo[species].abilities[0];
if (absorbingTypeAbility == monAbility && Random() & 1)
{
// we found a mon
@@ -265,8 +265,8 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
u8 monAbility;
if ((GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
|| (i == gBattlerPartyIndexes[battlerIn1])
|| (i == gBattlerPartyIndexes[battlerIn2])
|| (i == *(gBattleStruct->monToSwitchIntoId + battlerIn1))
@@ -274,9 +274,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
continue;
species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES);
if (GetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM) != ABILITY_NONE)
monAbility = gBaseStats[species].abilities[1];
monAbility = gSpeciesInfo[species].abilities[1];
else
monAbility = gBaseStats[species].abilities[0];
monAbility = gSpeciesInfo[species].abilities[0];
moveFlags = AI_TypeCalc(gLastLandedMoves[gActiveBattler], species, monAbility);
if (moveFlags & flags)
{
@@ -330,8 +330,8 @@ static bool8 ShouldSwitch(void)
for (i = 0; i < PARTY_SIZE; ++i)
{
if ((GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
|| (i == gBattlerPartyIndexes[battlerIn1])
|| (i == gBattlerPartyIndexes[battlerIn2])
|| (i == *(gBattleStruct->monToSwitchIntoId + battlerIn1))
@@ -472,8 +472,8 @@ u8 GetMostSuitableMonToSwitchInto(void)
&& i != *(gBattleStruct->monToSwitchIntoId + battlerIn1)
&& i != *(gBattleStruct->monToSwitchIntoId + battlerIn2))
{
u8 type1 = gBaseStats[species].type1;
u8 type2 = gBaseStats[species].type2;
u8 type1 = gSpeciesInfo[species].types[0];
u8 type2 = gSpeciesInfo[species].types[1];
u8 typeDmg = 10;
ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type1, type1, type2, &typeDmg);
ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type2, type1, type2, &typeDmg);
@@ -551,9 +551,9 @@ static u8 GetAI_ItemType(u8 itemId, const u8 *itemEffect) // NOTE: should take u
return AI_ITEM_HEAL_HP;
else if (itemEffect[3] & ITEM3_STATUS_ALL)
return AI_ITEM_CURE_CONDITION;
else if (itemEffect[0] & (ITEM0_HIGH_CRIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0)
else if (itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0)
return AI_ITEM_X_STAT;
else if (itemEffect[3] & ITEM3_MIST)
else if (itemEffect[3] & ITEM3_GUARD_SPEC)
return AI_ITEM_GUARD_SPECS;
else
return AI_ITEM_NOT_RECOGNIZABLE;
@@ -567,8 +567,8 @@ static bool8 ShouldUseItem(void)
for (i = 0; i < PARTY_SIZE; ++i)
if (GetMonData(&gEnemyParty[i], MON_DATA_HP) != 0
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
++validMons;
for (i = 0; i < MAX_TRAINER_ITEMS; ++i)
{
@@ -650,7 +650,7 @@ static bool8 ShouldUseItem(void)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8;
if (itemEffects[2] & ITEM2_X_ACCURACY)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x20;
if (itemEffects[0] & ITEM0_HIGH_CRIT)
if (itemEffects[0] & ITEM0_DIRE_HIT)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x80;
shouldUse = TRUE;
break;
+4 -4
View File
@@ -470,7 +470,7 @@ static void Task_GiveExpToMon(u8 taskId)
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u32 currExp = GetMonData(mon, MON_DATA_EXP);
u32 nextLvlExp = gExperienceTables[gBaseStats[species].growthRate][level + 1];
u32 nextLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= nextLvlExp)
{
@@ -512,11 +512,11 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId)
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 exp = GetMonData(mon, MON_DATA_EXP);
u32 currLvlExp = gExperienceTables[gBaseStats[species].growthRate][level];
u32 currLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
u32 expToNextLvl;
exp -= currLvlExp;
expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp;
expToNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLvlExp;
SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp);
PlaySE(SE_EXP);
gTasks[taskId].func = Task_GiveExpWithExpBar;
@@ -548,7 +548,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP);
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES);
expOnNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1];
expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= expOnNextLvl)
{
u8 savedActiveBattler;
+4 -4
View File
@@ -1031,7 +1031,7 @@ static void Task_GiveExpToMon(u8 taskId)
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u32 currExp = GetMonData(mon, MON_DATA_EXP);
u32 nextLvlExp = gExperienceTables[gBaseStats[species].growthRate][level + 1];
u32 nextLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= nextLvlExp)
{
@@ -1073,11 +1073,11 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId)
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 exp = GetMonData(mon, MON_DATA_EXP);
u32 currLvlExp = gExperienceTables[gBaseStats[species].growthRate][level];
u32 currLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
u32 expToNextLvl;
exp -= currLvlExp;
expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp;
expToNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLvlExp;
SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp);
PlaySE(SE_EXP);
gTasks[taskId].func = Task_GiveExpWithExpBar;
@@ -1109,7 +1109,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP);
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES);
expOnNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1];
expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= expOnNextLvl)
{
u8 savedActiveBattler;
+4 -4
View File
@@ -451,7 +451,7 @@ static void Task_GiveExpToMon(u8 taskId)
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u32 currExp = GetMonData(mon, MON_DATA_EXP);
u32 nextLvlExp = gExperienceTables[gBaseStats[species].growthRate][level + 1];
u32 nextLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= nextLvlExp)
{
@@ -493,11 +493,11 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId)
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 exp = GetMonData(mon, MON_DATA_EXP);
u32 currLvlExp = gExperienceTables[gBaseStats[species].growthRate][level];
u32 currLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
u32 expToNextLvl;
exp -= currLvlExp;
expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp;
expToNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLvlExp;
SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp);
PlaySE(SE_EXP);
gTasks[taskId].func = Task_GiveExpWithExpBar;
@@ -529,7 +529,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP);
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES);
expOnNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1];
expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= expOnNextLvl)
{
u8 savedActiveBattler;
+7 -7
View File
@@ -302,8 +302,8 @@ static void SetBattlePartyIds(void)
if (GET_BATTLER_SIDE2(i) == B_SIDE_PLAYER)
{
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG))
{
gBattlerPartyIndexes[i] = j;
@@ -313,8 +313,8 @@ static void SetBattlePartyIds(void)
else
{
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG))
{
gBattlerPartyIndexes[i] = j;
@@ -328,7 +328,7 @@ static void SetBattlePartyIds(void)
{
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES) != SPECIES_NONE // Probably a typo by Game Freak. The rest use SPECIES2.
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG)
&& gBattlerPartyIndexes[i - 2] != j)
{
@@ -339,8 +339,8 @@ static void SetBattlePartyIds(void)
else
{
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG)
&& gBattlerPartyIndexes[i - 2] != j)
{
+2 -2
View File
@@ -1811,9 +1811,9 @@ void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elem
species = GetMonData(mon, MON_DATA_SPECIES);
level = GetMonData(mon, MON_DATA_LEVEL);
exp = GetMonData(mon, MON_DATA_EXP);
currLevelExp = gExperienceTables[gBaseStats[species].growthRate][level];
currLevelExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
currExpBarValue = exp - currLevelExp;
maxExpBarValue = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLevelExp;
maxExpBarValue = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLevelExp;
SetBattleBarStruct(battlerId, healthboxSpriteId, maxExpBarValue, currExpBarValue, isDoubles);
MoveBattleBar(battlerId, healthboxSpriteId, EXP_BAR, 0);
}
+40 -40
View File
@@ -715,33 +715,33 @@ static void CB2_InitBattleInternal(void)
gBattleCommunication[MULTIUSE_STATE] = 0;
}
#define BUFFER_PARTY_VS_SCREEN_STATUS(party, flags, i) \
for ((i) = 0; (i) < PARTY_SIZE; (i)++) \
{ \
u16 species = GetMonData(&(party)[(i)], MON_DATA_SPECIES2); \
u16 hp = GetMonData(&(party)[(i)], MON_DATA_HP); \
u32 status = GetMonData(&(party)[(i)], MON_DATA_STATUS); \
\
if (species == SPECIES_NONE) \
continue; \
\
/* Is healthy mon? */ \
if (species != SPECIES_EGG && hp != 0 && status == 0) \
(flags) |= 1 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is Egg or statused? */ \
if (hp != 0 && (species == SPECIES_EGG || status != 0)) \
(flags) |= 2 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is fainted? */ \
if (species != SPECIES_EGG && hp == 0) \
(flags) |= 3 << (i) * 2; \
#define BUFFER_PARTY_VS_SCREEN_STATUS(party, flags, i) \
for ((i) = 0; (i) < PARTY_SIZE; (i)++) \
{ \
u16 species = GetMonData(&(party)[(i)], MON_DATA_SPECIES_OR_EGG); \
u16 hp = GetMonData(&(party)[(i)], MON_DATA_HP); \
u32 status = GetMonData(&(party)[(i)], MON_DATA_STATUS); \
\
if (species == SPECIES_NONE) \
continue; \
\
/* Is healthy mon? */ \
if (species != SPECIES_EGG && hp != 0 && status == 0) \
(flags) |= 1 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is Egg or statused? */ \
if (hp != 0 && (species == SPECIES_EGG || status != 0)) \
(flags) |= 2 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is fainted? */ \
if (species != SPECIES_EGG && hp == 0) \
(flags) |= 3 << (i) * 2; \
}
// For Vs Screen at link battle start
@@ -2277,8 +2277,8 @@ static void BattleStartClearSetData(void)
gBattleStruct->runTries = 0;
gBattleStruct->safariRockThrowCounter = 0;
gBattleStruct->safariBaitThrowCounter = 0;
*(&gBattleStruct->safariCatchFactor) = gBaseStats[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].catchRate * 100 / 1275;
*(&gBattleStruct->safariEscapeFactor) = gBaseStats[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].safariZoneFleeRate * 100 / 1275;
*(&gBattleStruct->safariCatchFactor) = gSpeciesInfo[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].catchRate * 100 / 1275;
*(&gBattleStruct->safariEscapeFactor) = gSpeciesInfo[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].safariZoneFleeRate * 100 / 1275;
if (gBattleStruct->safariEscapeFactor <= 1)
gBattleStruct->safariEscapeFactor = 2;
gBattleStruct->wildVictorySong = 0;
@@ -2508,8 +2508,8 @@ void FaintClearSetData(void)
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
}
gBattleResources->flags->flags[gActiveBattler] = 0;
gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1;
gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2;
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
}
static void BattleIntroGetMonsData(void)
@@ -2573,8 +2573,8 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
for (i = 0; i < sizeof(struct BattlePokemon); i++)
ptr[i] = gBattleBufferB[gActiveBattler][4 + i];
gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1;
gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2;
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum);
hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(gActiveBattler)];
*hpOnSwitchout = gBattleMons[gActiveBattler].hp;
@@ -2651,8 +2651,8 @@ static void BattleIntroDrawPartySummaryScreens(void)
{
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatus[i].hp = HP_EMPTY_SLOT;
hpStatus[i].status = 0;
@@ -2669,8 +2669,8 @@ static void BattleIntroDrawPartySummaryScreens(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatus[i].hp = HP_EMPTY_SLOT;
hpStatus[i].status = 0;
@@ -2695,8 +2695,8 @@ static void BattleIntroDrawPartySummaryScreens(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatus[i].hp = HP_EMPTY_SLOT;
hpStatus[i].status = 0;
@@ -4337,7 +4337,7 @@ static void HandleAction_WatchesCarefully(void)
--gBattleStruct->safariRockThrowCounter;
if (gBattleStruct->safariRockThrowCounter == 0)
{
*(&gBattleStruct->safariCatchFactor) = gBaseStats[GetMonData(gEnemyParty, MON_DATA_SPECIES)].catchRate * 100 / 1275;
*(&gBattleStruct->safariCatchFactor) = gSpeciesInfo[GetMonData(gEnemyParty, MON_DATA_SPECIES)].catchRate * 100 / 1275;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MON_WATCHING;
}
else
+19 -19
View File
@@ -1514,7 +1514,7 @@ u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility)
{
s32 i = 0;
u8 flags = 0;
u8 type1 = gBaseStats[targetSpecies].type1, type2 = gBaseStats[targetSpecies].type2;
u8 type1 = gSpeciesInfo[targetSpecies].types[0], type2 = gSpeciesInfo[targetSpecies].types[1];
u8 moveType;
if (move == MOVE_STRUGGLE)
@@ -3163,7 +3163,7 @@ static void Cmd_getexp(void)
viaExpShare++;
}
calculatedExp = gBaseStats[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7;
calculatedExp = gSpeciesInfo[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7;
if (viaExpShare) // at least one mon is getting exp via exp share
{
@@ -4480,8 +4480,8 @@ static void Cmd_switchindataupdate(void)
for (i = 0; i < sizeof(struct BattlePokemon); i++)
monData[i] = gBattleBufferB[gActiveBattler][4 + i];
gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1;
gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2;
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum);
// check knocked off item
@@ -5453,8 +5453,8 @@ static void Cmd_drawpartystatussummary(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatuses[i].hp = 0xFFFF;
hpStatuses[i].status = 0;
@@ -6168,7 +6168,7 @@ static void Cmd_various(void)
}
for (i = 0; i < PARTY_SIZE; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
abilityNum = GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM);
status = GetMonData(&gPlayerParty[i], MON_DATA_STATUS);
if (species != SPECIES_NONE
@@ -6188,7 +6188,7 @@ static void Cmd_various(void)
monToCheck = 0;
for (i = 0; i < PARTY_SIZE; i++)
{
species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG);
abilityNum = GetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM);
status = GetMonData(&gEnemyParty[i], MON_DATA_STATUS);
@@ -8041,7 +8041,7 @@ static void Cmd_healpartystatus(void)
for (i = 0; i < PARTY_SIZE; i++)
{
u16 species = GetMonData(&party[i], MON_DATA_SPECIES2);
u16 species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG);
u8 abilityNum = GetMonData(&party[i], MON_DATA_ABILITY_NUM);
if (species != SPECIES_NONE && species != SPECIES_EGG)
@@ -8587,8 +8587,8 @@ static void Cmd_trydobeatup(void)
for (;gBattleCommunication[0] < PARTY_SIZE; gBattleCommunication[0]++)
{
if (GetMonData(&party[gBattleCommunication[0]], MON_DATA_HP)
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES2)
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES_OR_EGG)
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&party[gBattleCommunication[0]], MON_DATA_STATUS))
break;
}
@@ -8598,10 +8598,10 @@ static void Cmd_trydobeatup(void)
gBattlescriptCurrInstr += 9;
gBattleMoveDamage = gBaseStats[GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES)].baseAttack;
gBattleMoveDamage = gSpeciesInfo[GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES)].baseAttack;
gBattleMoveDamage *= gBattleMoves[gCurrentMove].power;
gBattleMoveDamage *= (GetMonData(&party[gBattleCommunication[0]], MON_DATA_LEVEL) * 2 / 5 + 2);
gBattleMoveDamage /= gBaseStats[gBattleMons[gBattlerTarget].species].baseDefense;
gBattleMoveDamage /= gSpeciesInfo[gBattleMons[gBattlerTarget].species].baseDefense;
gBattleMoveDamage = (gBattleMoveDamage / 50) + 2;
if (gProtectStructs[gBattlerAttacker].helpingHand)
gBattleMoveDamage = gBattleMoveDamage * 15 / 10;
@@ -9104,9 +9104,9 @@ static void Cmd_assistattackselect(void)
{
if (monId == gBattlerPartyIndexes[gBattlerAttacker])
continue;
if (GetMonData(&party[monId], MON_DATA_SPECIES2) == SPECIES_NONE)
if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
continue;
if (GetMonData(&party[monId], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
continue;
for (moveId = 0; moveId < MAX_MON_MOVES; moveId++)
@@ -9267,12 +9267,12 @@ static void Cmd_pickup(void)
for (i = 0; i < PARTY_SIZE; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM) != ABILITY_NONE)
ability = gBaseStats[species].abilities[1];
ability = gSpeciesInfo[species].abilities[1];
else
ability = gBaseStats[species].abilities[0];
ability = gSpeciesInfo[species].abilities[0];
if (ability == ABILITY_PICKUP && species != SPECIES_NONE && species != SPECIES_EGG && heldItem == ITEM_NONE && !(Random() % 10))
{
s32 random = Random() % 100;
@@ -9496,7 +9496,7 @@ static void Cmd_handleballthrow(void)
if (gLastUsedItem == ITEM_SAFARI_BALL)
catchRate = gBattleStruct->safariCatchFactor * 1275 / 100;
else
catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate;
catchRate = gSpeciesInfo[gBattleMons[gBattlerTarget].species].catchRate;
if (gLastUsedItem > ITEM_SAFARI_BALL)
{
+1 -1
View File
@@ -545,7 +545,7 @@ static u16 GetSumOfPlayerPartyLevel(u8 numMons)
for (i = 0; i < PARTY_SIZE; ++i)
{
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_EGG && species != SPECIES_NONE && GetMonData(&gPlayerParty[i], MON_DATA_HP) != 0)
{
+1 -1
View File
@@ -796,7 +796,7 @@ void CheckPartyBattleTowerBanlist(void)
for (i = 0; i < PARTY_SIZE; i++)
{
species2 = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species2 = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
level = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
hp = GetMonData(&gPlayerParty[i], MON_DATA_HP);
+7 -7
View File
@@ -1560,8 +1560,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
break;
}
return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
@@ -1589,8 +1589,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& i != partyIdBattlerOn1 && i != partyIdBattlerOn2
&& i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId])
break;
@@ -3130,14 +3130,14 @@ u8 GetMoveTarget(u16 move, u8 setTarget)
return targetBattler;
}
static bool32 IsMonEventLegal(u8 battlerId)
static bool32 IsBattlerModernFatefulEncounter(u8 battlerId)
{
if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT)
return TRUE;
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[battlerId]], MON_DATA_EVENT_LEGAL, NULL);
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_MODERN_FATEFUL_ENCOUNTER, NULL);
}
u8 IsMonDisobedient(void)
@@ -3151,7 +3151,7 @@ u8 IsMonDisobedient(void)
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT)
return 0;
if (IsMonEventLegal(gBattlerAttacker)) // only false if illegal Mew or Deoxys
if (IsBattlerModernFatefulEncounter(gBattlerAttacker)) // only false if illegal Mew or Deoxys
{
if (!IsOtherTrainer(gBattleMons[gBattlerAttacker].otId, gBattleMons[gBattlerAttacker].otName))
return 0;
+1 -1
View File
@@ -2948,7 +2948,7 @@
"english": "SOOTHE BELL",
"itemId": "ITEM_SOOTHE_BELL",
"price": 100,
"holdEffect": "HOLD_EFFECT_HAPPINESS_UP",
"holdEffect": "HOLD_EFFECT_FRIENDSHIP_UP",
"holdEffectParam": 0,
"description_english": "An item to be held by a POKéMON.\\nA bell with a comforting chime that\\nmakes the holder calm and friendly.",
"importance": 0,
+135 -151
View File
@@ -1,6 +1,6 @@
static const u8 sItemEffect_Potion[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 20,
[6] = 20, // Amount of HP to recover
};
static const u8 sItemEffect_Antidote[6] = {
@@ -26,22 +26,22 @@ static const u8 sItemEffect_ParalyzeHeal[6] = {
static const u8 sItemEffect_FullRestore[7] = {
[3] = ITEM3_STATUS_ALL,
[4] = ITEM4_HEAL_HP,
[6] = -1,
[6] = ITEM6_HEAL_HP_FULL,
};
static const u8 sItemEffect_MaxPotion[7] = {
[4] = ITEM4_HEAL_HP,
[6] = -1,
[6] = ITEM6_HEAL_HP_FULL,
};
static const u8 sItemEffect_HyperPotion[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 200,
[6] = 200, // Amount of HP to recover
};
static const u8 sItemEffect_SuperPotion[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 50,
[6] = 50, // Amount of HP to recover
};
static const u8 sItemEffect_FullHeal[6] = {
@@ -50,87 +50,87 @@ static const u8 sItemEffect_FullHeal[6] = {
static const u8 sItemEffect_Revive[7] = {
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[6] = -2,
[6] = ITEM6_HEAL_HP_HALF,
};
static const u8 sItemEffect_MaxRevive[7] = {
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[6] = -1,
[6] = ITEM6_HEAL_HP_FULL,
};
static const u8 sItemEffect_FreshWater[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 50,
[6] = 50, // Amount of HP to recover
};
static const u8 sItemEffect_SodaPop[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 60,
[6] = 60, // Amount of HP to recover
};
static const u8 sItemEffect_Lemonade[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 80,
[6] = 80, // Amount of HP to recover
};
static const u8 sItemEffect_MoomooMilk[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 100,
[6] = 100, // Amount of HP to recover
};
static const u8 sItemEffect_EnergyPowder[10] = {
[4] = ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 50,
[7] = -5,
[8] = -5,
[9] = -10,
[6] = 50, // Amount of HP to recover
[7] = -5, // Friendship change, low
[8] = -5, // Friendship change, mid
[9] = -10, // Friendship change, high
};
static const u8 sItemEffect_EnergyRoot[10] = {
[4] = ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 200,
[7] = -10,
[8] = -10,
[9] = -15,
[6] = 200, // Amount of HP to recover
[7] = -10, // Friendship change, low
[8] = -10, // Friendship change, mid
[9] = -15, // Friendship change, high
};
static const u8 sItemEffect_HealPowder[9] = {
[3] = ITEM3_STATUS_ALL,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = -5,
[7] = -5,
[8] = -10,
[6] = -5, // Friendship change, low
[7] = -5, // Friendship change, mid
[8] = -10, // Friendship change, high
};
static const u8 sItemEffect_RevivalHerb[10] = {
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = -1,
[7] = -15,
[8] = -15,
[9] = -20,
[6] = ITEM6_HEAL_HP_FULL,
[7] = -15, // Friendship change, low
[8] = -15, // Friendship change, mid
[9] = -20, // Friendship change, high
};
static const u8 sItemEffect_Ether[7] = {
[4] = ITEM4_HEAL_PP_ONE | ITEM4_HEAL_PP_ALL,
[6] = 10,
[6] = 10, // Amount of PP to recover
};
static const u8 sItemEffect_MaxEther[7] = {
[4] = ITEM4_HEAL_PP_ONE | ITEM4_HEAL_PP_ALL,
[6] = 0x7F,
[6] = ITEM6_HEAL_PP_FULL,
};
static const u8 sItemEffect_Elixir[7] = {
[4] = ITEM4_HEAL_PP_ALL,
[6] = 10,
[6] = 10, // Amount of PP to recover
};
static const u8 sItemEffect_MaxElixir[7] = {
[4] = ITEM4_HEAL_PP_ALL,
[6] = 0x7F,
[6] = ITEM6_HEAL_PP_FULL,
};
static const u8 sItemEffect_LavaCookie[6] = {
@@ -151,137 +151,121 @@ static const u8 sItemEffect_RedFlute[6] = {
static const u8 sItemEffect_BerryJuice[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 20,
[6] = 20, // Amount of HP to recover
};
static const u8 sItemEffect_SacredAsh[7] = {
[0] = ITEM0_SACRED_ASH,
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[6] = -1,
[6] = ITEM6_HEAL_HP_FULL,
};
#define VITAMIN_FRIENDSHIP_CHANGE(i) \
[(i) + 0] = 5, /* Friendship change, low */ \
[(i) + 1] = 3, /* Friendship change, mid */ \
[(i) + 2] = 2 /* Friendship change, high */
static const u8 sItemEffect_HPUp[10] = {
[4] = ITEM4_EV_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_Protein[10] = {
[4] = ITEM4_EV_ATK,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_Iron[10] = {
[5] = ITEM5_EV_DEF | ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_Carbos[10] = {
[5] = ITEM5_EV_SPEED | ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_Calcium[10] = {
[5] = ITEM5_EV_SPATK | ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_RareCandy[10] = {
[3] = ITEM3_LEVEL_UP,
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 0xFD,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_HEAL_HP_LVL_UP,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_PPUp[9] = {
[4] = ITEM4_PP_UP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 5,
[7] = 3,
[8] = 2,
VITAMIN_FRIENDSHIP_CHANGE(6),
};
static const u8 sItemEffect_Zinc[10] = {
[5] = ITEM5_EV_SPDEF | ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_PPMax[9] = {
[5] = ITEM5_PP_MAX | ITEM5_FRIENDSHIP_ALL,
[6] = 5,
[7] = 3,
[8] = 2,
VITAMIN_FRIENDSHIP_CHANGE(6),
};
#define STAT_BOOST_FRIENDSHIP_CHANGE \
[6] = 1, /* Friendship change, low */ \
[7] = 1 /* Friendship change, mid */
static const u8 sItemEffect_GuardSpec[8] = {
[3] = ITEM3_MIST,
[3] = ITEM3_GUARD_SPEC,
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE
};
static const u8 sItemEffect_DireHit[8] = {
[0] = 2 << 4,
[0] = 2 << 4, // ITEM0_DIRE_HIT
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE
};
static const u8 sItemEffect_XAttack[8] = {
[0] = 1,
[0] = 1, // ITEM0_X_ATTACK
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE
};
static const u8 sItemEffect_XDefend[8] = {
[1] = 1 << 4,
[1] = 1 << 4, /// ITEM1_X_DEFEND
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE,
};
static const u8 sItemEffect_XSpeed[8] = {
[1] = 1,
[1] = 1, // ITEM1_X_SPEED
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE,
};
static const u8 sItemEffect_XAccuracy[8] = {
[2] = 1 << 4,
[2] = 1 << 4, // ITEM2_X_ACCURACY
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE,
};
static const u8 sItemEffect_XSpecial[8] = {
[2] = 1,
[2] = 1, // ITEM2_X_SPATK
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE,
};
static const u8 sItemEffect_SunStone[6] = {
@@ -330,12 +314,12 @@ static const u8 sItemEffect_AspearBerry[6] = {
static const u8 sItemEffect_LeppaBerry[7] = {
[4] = ITEM4_HEAL_PP_ONE | ITEM4_HEAL_PP_ALL,
[6] = 10,
[6] = 10, // Amount of PP to recover
};
static const u8 sItemEffect_OranBerry[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 10,
[6] = 10, // Amount of HP to recover
};
static const u8 sItemEffect_PersimBerry[6] = {
@@ -348,73 +332,73 @@ static const u8 sItemEffect_LumBerry[6] = {
static const u8 sItemEffect_SitrusBerry[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 30,
[6] = 30, // Amount of HP to recover
};
const u8 *const gItemEffectTable[] =
{
[ITEM_POTION - ITEM_POTION] = sItemEffect_Potion,
[ITEM_ANTIDOTE - ITEM_POTION] = sItemEffect_Antidote,
[ITEM_BURN_HEAL - ITEM_POTION] = sItemEffect_BurnHeal,
[ITEM_ICE_HEAL - ITEM_POTION] = sItemEffect_IceHeal,
[ITEM_AWAKENING - ITEM_POTION] = sItemEffect_Awakening,
[ITEM_POTION - ITEM_POTION] = sItemEffect_Potion,
[ITEM_ANTIDOTE - ITEM_POTION] = sItemEffect_Antidote,
[ITEM_BURN_HEAL - ITEM_POTION] = sItemEffect_BurnHeal,
[ITEM_ICE_HEAL - ITEM_POTION] = sItemEffect_IceHeal,
[ITEM_AWAKENING - ITEM_POTION] = sItemEffect_Awakening,
[ITEM_PARALYZE_HEAL - ITEM_POTION] = sItemEffect_ParalyzeHeal,
[ITEM_FULL_RESTORE - ITEM_POTION] = sItemEffect_FullRestore,
[ITEM_MAX_POTION - ITEM_POTION] = sItemEffect_MaxPotion,
[ITEM_HYPER_POTION - ITEM_POTION] = sItemEffect_HyperPotion,
[ITEM_SUPER_POTION - ITEM_POTION] = sItemEffect_SuperPotion,
[ITEM_FULL_HEAL - ITEM_POTION] = sItemEffect_FullHeal,
[ITEM_REVIVE - ITEM_POTION] = sItemEffect_Revive,
[ITEM_MAX_REVIVE - ITEM_POTION] = sItemEffect_MaxRevive,
[ITEM_FRESH_WATER - ITEM_POTION] = sItemEffect_FreshWater,
[ITEM_SODA_POP - ITEM_POTION] = sItemEffect_SodaPop,
[ITEM_LEMONADE - ITEM_POTION] = sItemEffect_Lemonade,
[ITEM_MOOMOO_MILK - ITEM_POTION] = sItemEffect_MoomooMilk,
[ITEM_FULL_RESTORE - ITEM_POTION] = sItemEffect_FullRestore,
[ITEM_MAX_POTION - ITEM_POTION] = sItemEffect_MaxPotion,
[ITEM_HYPER_POTION - ITEM_POTION] = sItemEffect_HyperPotion,
[ITEM_SUPER_POTION - ITEM_POTION] = sItemEffect_SuperPotion,
[ITEM_FULL_HEAL - ITEM_POTION] = sItemEffect_FullHeal,
[ITEM_REVIVE - ITEM_POTION] = sItemEffect_Revive,
[ITEM_MAX_REVIVE - ITEM_POTION] = sItemEffect_MaxRevive,
[ITEM_FRESH_WATER - ITEM_POTION] = sItemEffect_FreshWater,
[ITEM_SODA_POP - ITEM_POTION] = sItemEffect_SodaPop,
[ITEM_LEMONADE - ITEM_POTION] = sItemEffect_Lemonade,
[ITEM_MOOMOO_MILK - ITEM_POTION] = sItemEffect_MoomooMilk,
[ITEM_ENERGY_POWDER - ITEM_POTION] = sItemEffect_EnergyPowder,
[ITEM_ENERGY_ROOT - ITEM_POTION] = sItemEffect_EnergyRoot,
[ITEM_HEAL_POWDER - ITEM_POTION] = sItemEffect_HealPowder,
[ITEM_REVIVAL_HERB - ITEM_POTION] = sItemEffect_RevivalHerb,
[ITEM_ETHER - ITEM_POTION] = sItemEffect_Ether,
[ITEM_MAX_ETHER - ITEM_POTION] = sItemEffect_MaxEther,
[ITEM_ELIXIR - ITEM_POTION] = sItemEffect_Elixir,
[ITEM_MAX_ELIXIR - ITEM_POTION] = sItemEffect_MaxElixir,
[ITEM_LAVA_COOKIE - ITEM_POTION] = sItemEffect_LavaCookie,
[ITEM_BLUE_FLUTE - ITEM_POTION] = sItemEffect_BlueFlute,
[ITEM_YELLOW_FLUTE - ITEM_POTION] = sItemEffect_YellowFlute,
[ITEM_RED_FLUTE - ITEM_POTION] = sItemEffect_RedFlute,
[ITEM_BERRY_JUICE - ITEM_POTION] = sItemEffect_BerryJuice,
[ITEM_SACRED_ASH - ITEM_POTION] = sItemEffect_SacredAsh,
[ITEM_HP_UP - ITEM_POTION] = sItemEffect_HPUp,
[ITEM_PROTEIN - ITEM_POTION] = sItemEffect_Protein,
[ITEM_IRON - ITEM_POTION] = sItemEffect_Iron,
[ITEM_CARBOS - ITEM_POTION] = sItemEffect_Carbos,
[ITEM_CALCIUM - ITEM_POTION] = sItemEffect_Calcium,
[ITEM_RARE_CANDY - ITEM_POTION] = sItemEffect_RareCandy,
[ITEM_PP_UP - ITEM_POTION] = sItemEffect_PPUp,
[ITEM_ZINC - ITEM_POTION] = sItemEffect_Zinc,
[ITEM_PP_MAX - ITEM_POTION] = sItemEffect_PPMax,
[ITEM_GUARD_SPEC - ITEM_POTION] = sItemEffect_GuardSpec,
[ITEM_DIRE_HIT - ITEM_POTION] = sItemEffect_DireHit,
[ITEM_X_ATTACK - ITEM_POTION] = sItemEffect_XAttack,
[ITEM_X_DEFEND - ITEM_POTION] = sItemEffect_XDefend,
[ITEM_X_SPEED - ITEM_POTION] = sItemEffect_XSpeed,
[ITEM_X_ACCURACY - ITEM_POTION] = sItemEffect_XAccuracy,
[ITEM_X_SPECIAL - ITEM_POTION] = sItemEffect_XSpecial,
[ITEM_SUN_STONE - ITEM_POTION] = sItemEffect_SunStone,
[ITEM_MOON_STONE - ITEM_POTION] = sItemEffect_MoonStone,
[ITEM_FIRE_STONE - ITEM_POTION] = sItemEffect_FireStone,
[ITEM_ENERGY_ROOT - ITEM_POTION] = sItemEffect_EnergyRoot,
[ITEM_HEAL_POWDER - ITEM_POTION] = sItemEffect_HealPowder,
[ITEM_REVIVAL_HERB - ITEM_POTION] = sItemEffect_RevivalHerb,
[ITEM_ETHER - ITEM_POTION] = sItemEffect_Ether,
[ITEM_MAX_ETHER - ITEM_POTION] = sItemEffect_MaxEther,
[ITEM_ELIXIR - ITEM_POTION] = sItemEffect_Elixir,
[ITEM_MAX_ELIXIR - ITEM_POTION] = sItemEffect_MaxElixir,
[ITEM_LAVA_COOKIE - ITEM_POTION] = sItemEffect_LavaCookie,
[ITEM_BLUE_FLUTE - ITEM_POTION] = sItemEffect_BlueFlute,
[ITEM_YELLOW_FLUTE - ITEM_POTION] = sItemEffect_YellowFlute,
[ITEM_RED_FLUTE - ITEM_POTION] = sItemEffect_RedFlute,
[ITEM_BERRY_JUICE - ITEM_POTION] = sItemEffect_BerryJuice,
[ITEM_SACRED_ASH - ITEM_POTION] = sItemEffect_SacredAsh,
[ITEM_HP_UP - ITEM_POTION] = sItemEffect_HPUp,
[ITEM_PROTEIN - ITEM_POTION] = sItemEffect_Protein,
[ITEM_IRON - ITEM_POTION] = sItemEffect_Iron,
[ITEM_CARBOS - ITEM_POTION] = sItemEffect_Carbos,
[ITEM_CALCIUM - ITEM_POTION] = sItemEffect_Calcium,
[ITEM_RARE_CANDY - ITEM_POTION] = sItemEffect_RareCandy,
[ITEM_PP_UP - ITEM_POTION] = sItemEffect_PPUp,
[ITEM_ZINC - ITEM_POTION] = sItemEffect_Zinc,
[ITEM_PP_MAX - ITEM_POTION] = sItemEffect_PPMax,
[ITEM_GUARD_SPEC - ITEM_POTION] = sItemEffect_GuardSpec,
[ITEM_DIRE_HIT - ITEM_POTION] = sItemEffect_DireHit,
[ITEM_X_ATTACK - ITEM_POTION] = sItemEffect_XAttack,
[ITEM_X_DEFEND - ITEM_POTION] = sItemEffect_XDefend,
[ITEM_X_SPEED - ITEM_POTION] = sItemEffect_XSpeed,
[ITEM_X_ACCURACY - ITEM_POTION] = sItemEffect_XAccuracy,
[ITEM_X_SPECIAL - ITEM_POTION] = sItemEffect_XSpecial,
[ITEM_SUN_STONE - ITEM_POTION] = sItemEffect_SunStone,
[ITEM_MOON_STONE - ITEM_POTION] = sItemEffect_MoonStone,
[ITEM_FIRE_STONE - ITEM_POTION] = sItemEffect_FireStone,
[ITEM_THUNDER_STONE - ITEM_POTION] = sItemEffect_ThunderStone,
[ITEM_WATER_STONE - ITEM_POTION] = sItemEffect_WaterStone,
[ITEM_LEAF_STONE - ITEM_POTION] = sItemEffect_LeafStone,
[ITEM_CHERI_BERRY - ITEM_POTION] = sItemEffect_CheriBerry,
[ITEM_CHESTO_BERRY - ITEM_POTION] = sItemEffect_ChestoBerry,
[ITEM_PECHA_BERRY - ITEM_POTION] = sItemEffect_PechaBerry,
[ITEM_RAWST_BERRY - ITEM_POTION] = sItemEffect_RawstBerry,
[ITEM_ASPEAR_BERRY - ITEM_POTION] = sItemEffect_AspearBerry,
[ITEM_LEPPA_BERRY - ITEM_POTION] = sItemEffect_LeppaBerry,
[ITEM_ORAN_BERRY - ITEM_POTION] = sItemEffect_OranBerry,
[ITEM_PERSIM_BERRY - ITEM_POTION] = sItemEffect_PersimBerry,
[ITEM_LUM_BERRY - ITEM_POTION] = sItemEffect_LumBerry,
[ITEM_SITRUS_BERRY - ITEM_POTION] = sItemEffect_SitrusBerry,
[LAST_BERRY_INDEX - ITEM_POTION] = NULL,
[ITEM_WATER_STONE - ITEM_POTION] = sItemEffect_WaterStone,
[ITEM_LEAF_STONE - ITEM_POTION] = sItemEffect_LeafStone,
[ITEM_CHERI_BERRY - ITEM_POTION] = sItemEffect_CheriBerry,
[ITEM_CHESTO_BERRY - ITEM_POTION] = sItemEffect_ChestoBerry,
[ITEM_PECHA_BERRY - ITEM_POTION] = sItemEffect_PechaBerry,
[ITEM_RAWST_BERRY - ITEM_POTION] = sItemEffect_RawstBerry,
[ITEM_ASPEAR_BERRY - ITEM_POTION] = sItemEffect_AspearBerry,
[ITEM_LEPPA_BERRY - ITEM_POTION] = sItemEffect_LeppaBerry,
[ITEM_ORAN_BERRY - ITEM_POTION] = sItemEffect_OranBerry,
[ITEM_PERSIM_BERRY - ITEM_POTION] = sItemEffect_PersimBerry,
[ITEM_LUM_BERRY - ITEM_POTION] = sItemEffect_LumBerry,
[ITEM_SITRUS_BERRY - ITEM_POTION] = sItemEffect_SitrusBerry,
[LAST_BERRY_INDEX - ITEM_POTION] = NULL,
};
File diff suppressed because it is too large Load Diff
+13 -21
View File
@@ -1092,13 +1092,13 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
u8 metLocation;
u8 isEgg;
CreateMon(mon, species, EGG_HATCH_LEVEL, 32, FALSE, 0, OT_ID_PLAYER_ID, 0);
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
SetMonData(mon, MON_DATA_POKEBALL, &ball);
SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname);
SetMonData(mon, MON_DATA_FRIENDSHIP, &gBaseStats[species].eggCycles);
SetMonData(mon, MON_DATA_FRIENDSHIP, &gSpeciesInfo[species].eggCycles);
SetMonData(mon, MON_DATA_MET_LEVEL, &metLevel);
SetMonData(mon, MON_DATA_LANGUAGE, &language);
if (setHotSpringsLocation)
@@ -1119,13 +1119,13 @@ static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *
u8 language;
personality = daycare->offspringPersonality | (Random() << 16);
CreateMon(mon, species, EGG_HATCH_LEVEL, 32, TRUE, personality, OT_ID_PLAYER_ID, 0);
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
SetMonData(mon, MON_DATA_POKEBALL, &ball);
SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname);
SetMonData(mon, MON_DATA_FRIENDSHIP, &gBaseStats[species].eggCycles);
SetMonData(mon, MON_DATA_FRIENDSHIP, &gSpeciesInfo[species].eggCycles);
SetMonData(mon, MON_DATA_MET_LEVEL, &metLevel);
SetMonData(mon, MON_DATA_LANGUAGE, &language);
}
@@ -1284,8 +1284,8 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare)
trainerIds[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_OT_ID);
personality = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_PERSONALITY);
genders[i] = GetGenderFromSpeciesAndPersonality(species[i], personality);
eggGroups[i][0] = gBaseStats[species[i]].eggGroup1;
eggGroups[i][1] = gBaseStats[species[i]].eggGroup2;
eggGroups[i][0] = gSpeciesInfo[species[i]].eggGroups[0];
eggGroups[i][1] = gSpeciesInfo[species[i]].eggGroups[1];
}
// check unbreedable egg group
@@ -1594,42 +1594,34 @@ static void CreatedHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
{
u16 species;
u32 personality, pokerus;
u8 i, friendship, language, gameMet, markings, isEventLegal;
u16 moves[4];
u8 i, friendship, language, gameMet, markings, isModernFatefulEncounter;
u16 moves[MAX_MON_MOVES];
u32 ivs[NUM_STATS];
species = GetMonData(egg, MON_DATA_SPECIES);
for (i = 0; i < 4; i++)
{
for (i = 0; i < MAX_MON_MOVES; i++)
moves[i] = GetMonData(egg, MON_DATA_MOVE1 + i);
}
personality = GetMonData(egg, MON_DATA_PERSONALITY);
for (i = 0; i < NUM_STATS; i++)
{
ivs[i] = GetMonData(egg, MON_DATA_HP_IV + i);
}
// language = GetMonData(egg, MON_DATA_LANGUAGE);
gameMet = GetMonData(egg, MON_DATA_MET_GAME);
markings = GetMonData(egg, MON_DATA_MARKINGS);
pokerus = GetMonData(egg, MON_DATA_POKERUS);
isEventLegal = GetMonData(egg, MON_DATA_EVENT_LEGAL);
isModernFatefulEncounter = GetMonData(egg, MON_DATA_MODERN_FATEFUL_ENCOUNTER);
CreateMon(temp, species, EGG_HATCH_LEVEL, 32, TRUE, personality, 0, 0);
CreateMon(temp, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
for (i = 0; i < 4; i++)
{
for (i = 0; i < MAX_MON_MOVES; i++)
SetMonData(temp, MON_DATA_MOVE1 + i, &moves[i]);
}
for (i = 0; i < NUM_STATS; i++)
{
SetMonData(temp, MON_DATA_HP_IV + i, &ivs[i]);
}
language = GAME_LANGUAGE;
SetMonData(temp, MON_DATA_LANGUAGE, &language);
@@ -1639,7 +1631,7 @@ static void CreatedHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
friendship = 120;
SetMonData(temp, MON_DATA_FRIENDSHIP, &friendship);
SetMonData(temp, MON_DATA_POKERUS, &pokerus);
SetMonData(temp, MON_DATA_EVENT_LEGAL, &isEventLegal);
SetMonData(temp, MON_DATA_MODERN_FATEFUL_ENCOUNTER, &isModernFatefulEncounter);
*egg = *temp;
}
+1 -1
View File
@@ -2914,7 +2914,7 @@ void IsDodrioInParty(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_DODRIO)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_DODRIO)
{
gSpecialVar_Result = TRUE;
return;
+1 -1
View File
@@ -12,7 +12,7 @@
static bool32 IsMonValidSpecies(struct Pokemon *pokemon)
{
u16 species = GetMonData(pokemon, MON_DATA_SPECIES2);
u16 species = GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
if (species == SPECIES_NONE || species == SPECIES_EGG)
return FALSE;
return TRUE;
+8 -8
View File
@@ -199,7 +199,7 @@ bool8 PlayerHasGrassPokemonInParty(void)
)
{
species = GetMonData(pokemon, MON_DATA_SPECIES);
if (gBaseStats[species].type1 == TYPE_GRASS || gBaseStats[species].type2 == TYPE_GRASS)
if (gSpeciesInfo[species].types[0] == TYPE_GRASS || gSpeciesInfo[species].types[1] == TYPE_GRASS)
return TRUE;
}
}
@@ -423,7 +423,7 @@ bool8 IsStarterFirstStageInParty(void)
u8 i;
for (i = 0; i < partyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) == species)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) == species)
return TRUE;
}
return FALSE;
@@ -515,7 +515,7 @@ u8 GetLeadMonIndex(void)
for (i = 0; i < partyCount; i++)
{
pokemon = &gPlayerParty[i];
if (GetMonData(pokemon, MON_DATA_SPECIES2, NULL) != SPECIES_EGG && GetMonData(pokemon, MON_DATA_SPECIES2, NULL) != SPECIES_NONE)
if (GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_EGG && GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_NONE)
return i;
}
return 0;
@@ -523,7 +523,7 @@ u8 GetLeadMonIndex(void)
u16 GetPartyMonSpecies(void)
{
return GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES2, NULL);
return GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES_OR_EGG, NULL);
}
bool8 IsMonOTNameNotPlayers(void)
@@ -1716,7 +1716,7 @@ void UpdateTrainerCardPhotoIcons(void)
partyCount = CalculatePlayerPartyCount();
for (i = 0; i < partyCount; i++)
{
species[i] = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL);
species[i] = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL);
personality[i] = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY, NULL);
}
VarSet(VAR_TRAINER_CARD_MON_ICON_1, SpeciesToMailSpecies(species[0], personality[0]));
@@ -1768,7 +1768,7 @@ bool8 DoesPlayerPartyContainSpecies(void)
u8 i;
for (i = 0; i < partyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) == gSpecialVar_0x8004)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) == gSpecialVar_0x8004)
return TRUE;
}
return FALSE;
@@ -2232,7 +2232,7 @@ bool8 CapeBrinkGetMoveToTeachLeadPokemon(void)
gSpecialVar_0x8007 = leadMonSlot;
for (i = 0; i < NELEMS(sCapeBrinkCompatibleSpecies); i++)
{
if (GetMonData(&gPlayerParty[leadMonSlot], MON_DATA_SPECIES2, NULL) == sCapeBrinkCompatibleSpecies[i])
if (GetMonData(&gPlayerParty[leadMonSlot], MON_DATA_SPECIES_OR_EGG, NULL) == sCapeBrinkCompatibleSpecies[i])
{
tutorMonId = i;
break;
@@ -2500,7 +2500,7 @@ bool8 PlayerPartyContainsSpeciesWithPlayerID(void)
u8 i;
for (i = 0; i < playerCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) == gSpecialVar_0x8004
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) == gSpecialVar_0x8004
&& GetPlayerTrainerId() == GetMonData(&gPlayerParty[i], MON_DATA_OT_ID, NULL))
return TRUE;
}
+1 -1
View File
@@ -390,7 +390,7 @@ static void Task_Hof_InitMonData(u8 taskId)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE)
{
sHofMonPtr[0].mon[i].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
sHofMonPtr[0].mon[i].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
sHofMonPtr[0].mon[i].tid = GetMonData(&gPlayerParty[i], MON_DATA_OT_ID);
sHofMonPtr[0].mon[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
sHofMonPtr[0].mon[i].lvl = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
+1 -1
View File
@@ -923,7 +923,7 @@ void ItemUse_SetQuestLogEvent(u8 eventId, struct Pokemon *pokemon, u16 itemId, u
questLog->itemId = itemId;
questLog->param = param;
if (pokemon != NULL)
questLog->species = GetMonData(pokemon, MON_DATA_SPECIES2);
questLog->species = GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
else
questLog->species = 0xFFFF;
SetQuestLogEvent(eventId, (void *)questLog);
+1
View File
@@ -3,6 +3,7 @@
#include "gba/flash_internal.h"
#include "load_save.h"
#include "pokemon.h"
#include "pokemon_storage_system.h"
#include "random.h"
#include "item.h"
#include "save_location.h"
+1 -1
View File
@@ -242,7 +242,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx)
void *mailPtr = (void *)(data + sizeof(struct Pokemon));
pokemon = *(struct Pokemon *)pokemonPtr;
species = GetMonData(&pokemon, MON_DATA_SPECIES2);
species = GetMonData(&pokemon, MON_DATA_SPECIES_OR_EGG);
if (species == SPECIES_EGG)
StringCopyN(gStringVar1, gText_EggNickname, POKEMON_NAME_LENGTH + 1);
+3 -3
View File
@@ -722,7 +722,7 @@ static void Task_NewGameScene(u8 taskId)
break;
case 1:
sOakSpeechResources = AllocZeroed(sizeof(*sOakSpeechResources));
OakSpeechNidoranFSetup(1, TRUE);
CreateMonSpritesGfxManager(1, 1);
break;
case 2:
SetGpuReg(REG_OFFSET_WIN0H, 0);
@@ -1775,7 +1775,7 @@ static void Task_OakSpeech_WaitForFade(u8 taskId)
static void Task_OakSpeech_FreeResources(u8 taskId)
{
FreeAllWindowBuffers();
OakSpeechNidoranFFreeResources();
DestroyMonSpritesGfxManager();
Free(sOakSpeechResources);
sOakSpeechResources = NULL;
gTextFlags.canABSpeedUpPrint = FALSE;
@@ -1876,7 +1876,7 @@ static void CreateNidoranFSprite(u8 taskId)
{
u8 spriteId;
DecompressPicFromTable(&gMonFrontPicTable[SPECIES_NIDORAN_F], OakSpeechNidoranFGetBuffer(0), SPECIES_NIDORAN_F);
DecompressPicFromTable(&gMonFrontPicTable[SPECIES_NIDORAN_F], MonSpritesGfxManager_GetSpritePtr(0), SPECIES_NIDORAN_F);
LoadCompressedSpritePaletteUsingHeap(&gMonPaletteTable[SPECIES_NIDORAN_F]);
SetMultiuseSpriteTemplateToPokemon(SPECIES_NIDORAN_F, 0);
spriteId = CreateSprite(&gMultiuseSpriteTemplate, 96, 96, 1);
+13 -13
View File
@@ -2652,7 +2652,7 @@ static void CreatePartyMonIconSprite(struct Pokemon *mon, struct PartyMenuBox *m
// If in a multi battle, show partners Deoxys icon as Normal forme
if (IsMultiBattle() == TRUE && gMain.inBattle)
handleDeoxys = (sMultiBattlePartnersPartyMask[slot] ^ handleDeoxys) ? TRUE : FALSE;
species2 = GetMonData(mon, MON_DATA_SPECIES2);
species2 = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
CreatePartyMonIconSpriteParameterized(species2, GetMonData(mon, MON_DATA_PERSONALITY), menuBox, 1, handleDeoxys);
UpdatePartyMonHPBar(menuBox->monSpriteId, mon);
}
@@ -3357,8 +3357,8 @@ static void SetSwitchedPartyOrderQuestLogEvent(void)
{
u16 *buffer = Alloc(2 * sizeof(u16));
buffer[0] = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
buffer[1] = GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_SPECIES2);
buffer[0] = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
buffer[1] = GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_SPECIES_OR_EGG);
SetQuestLogEvent(QL_EVENT_SWITCHED_PARTY_ORDER, buffer);
Free(buffer);
}
@@ -3847,11 +3847,11 @@ static void CursorCB_Store(u8 taskId)
// Register mon for the Trading Board in Union Room
static void CursorCB_Register(u8 taskId)
{
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
u8 isModernFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MODERN_FATEFUL_ENCOUNTER);
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isEventLegal))
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isModernFatefulEncounter))
{
case CANT_REGISTER_MON:
StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow);
@@ -3874,10 +3874,10 @@ static void CursorCB_Register(u8 taskId)
static void CursorCB_Trade1(u8 taskId)
{
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal);
u8 isModernFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MODERN_FATEFUL_ENCOUNTER);
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isModernFatefulEncounter);
if (stringId != UR_TRADE_MSG_NONE)
{
@@ -4133,7 +4133,7 @@ static void SetSwappedHeldItemQuestLogEvent(struct Pokemon *mon, u16 item, u16 i
{
u16 *ptr = Alloc(4 * sizeof(u16));
ptr[2] = GetMonData(mon, MON_DATA_SPECIES2);
ptr[2] = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
ptr[0] = item;
ptr[1] = item2;
if (gPartyMenu.action == PARTY_ACTION_GIVE_PC_ITEM)
@@ -4154,7 +4154,7 @@ static void SetUsedFieldMoveQuestLogEvent(struct Pokemon *mon, u8 fieldMove)
{
struct FieldMoveWarpParams *ptr = Alloc(sizeof(*ptr));
ptr->species = GetMonData(mon, MON_DATA_SPECIES2);
ptr->species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
ptr->fieldMove = fieldMove;
switch (ptr->fieldMove)
{
@@ -4187,7 +4187,7 @@ void SetUsedFlyQuestLogEvent(const u8 *healLocCtrlData)
mapHeader = Overworld_GetMapHeaderByGroupAndId(ptr->mapGroup, ptr->mapNum);
Free(ptr);
ptr2 = Alloc(4);
ptr2->species = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_SPECIES2);
ptr2->species = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_SPECIES_OR_EGG);
ptr2->fieldMove = FIELD_MOVE_FLY;
ptr2->regionMapSectionId = mapHeader->regionMapSectionId;
SetQuestLogEvent(QL_EVENT_USED_FIELD_MOVE, (u16 *)ptr2);
@@ -5342,7 +5342,7 @@ u8 GetItemEffectType(u16 item)
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
itemEffect = gItemEffectTable[item - ITEM_POTION];
if ((itemEffect[0] & (ITEM0_HIGH_CRIT | ITEM0_X_ATTACK)) || itemEffect[1] || itemEffect[2] || (itemEffect[3] & ITEM3_MIST))
if ((itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK)) || itemEffect[1] || itemEffect[2] || (itemEffect[3] & ITEM3_GUARD_SPEC))
return ITEM_EFFECT_X_ITEM;
else if (itemEffect[0] & ITEM0_SACRED_ASH)
return ITEM_EFFECT_SACRED_ASH;
+6 -6
View File
@@ -1555,10 +1555,10 @@ static void ItemPrintFunc_OrderedListMenu(u8 windowId, u32 itemId, u8 y)
if (caught)
{
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, 0, 0x28, y);
type1 = gBaseStats[species].type1;
type1 = gSpeciesInfo[species].types[0];
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, type1 + 1, 0x78, y);
if (type1 != gBaseStats[species].type2)
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, gBaseStats[species].type2 + 1, 0x98, y);
if (type1 != gSpeciesInfo[species].types[1])
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, gSpeciesInfo[species].types[1] + 1, 0x98, y);
}
}
@@ -3091,9 +3091,9 @@ u8 DexScreen_DrawMonAreaPage(void)
if (monIsCaught)
{
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gBaseStats[species].type1, 0, 1);
if (gBaseStats[species].type1 != gBaseStats[species].type2)
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gBaseStats[species].type2, 32, 1);
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gSpeciesInfo[species].types[0], 0, 1);
if (gSpeciesInfo[species].types[0] != gSpeciesInfo[species].types[1])
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gSpeciesInfo[species].types[1], 32, 1);
}
PutWindowTilemap(sPokedexScreenData->windowIds[12]);
CopyWindowToVram(sPokedexScreenData->windowIds[12], COPYWIN_GFX);
+870 -714
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2692,7 +2692,7 @@ void IsPokemonJumpSpeciesInParty(void)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES))
{
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (IsSpeciesAllowedInPokemonJump(species))
{
gSpecialVar_Result = TRUE;
+2 -2
View File
@@ -1031,7 +1031,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode)
{
struct Pokemon *mon = (struct Pokemon *)pokemon;
gStorage->displayMonSpecies = GetMonData(mon, MON_DATA_SPECIES2);
gStorage->displayMonSpecies = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
if (gStorage->displayMonSpecies != SPECIES_NONE)
{
sanityIsBagEgg = GetMonData(mon, MON_DATA_SANITY_IS_BAD_EGG);
@@ -1054,7 +1054,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode)
{
struct BoxPokemon *boxMon = (struct BoxPokemon *)pokemon;
gStorage->displayMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES2);
gStorage->displayMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
if (gStorage->displayMonSpecies != SPECIES_NONE)
{
u32 otId = GetBoxMonData(boxMon, MON_DATA_OT_ID);
+6 -6
View File
@@ -298,7 +298,7 @@ static u8 GetMonIconPriorityByCursorArea(void)
void CreateMovingMonIcon(void)
{
u32 personality = GetMonData(&gStorage->movingMon, MON_DATA_PERSONALITY);
u16 species = GetMonData(&gStorage->movingMon, MON_DATA_SPECIES2);
u16 species = GetMonData(&gStorage->movingMon, MON_DATA_SPECIES_OR_EGG);
u8 priority = GetMonIconPriorityByCursorArea();
gStorage->movingMonSprite = CreateMonIconSprite(species, personality, 0, 0, priority, 7);
@@ -318,7 +318,7 @@ static void InitBoxMonSprites(u8 boxId)
{
for (j = 0; j < IN_BOX_COLUMNS; j++)
{
species = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2);
species = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
personality = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY);
@@ -344,7 +344,7 @@ static void InitBoxMonSprites(u8 boxId)
void CreateBoxMonIconAtPos(u8 boxPosition)
{
u16 species = GetCurrentBoxMonData(boxPosition, MON_DATA_SPECIES2);
u16 species = GetCurrentBoxMonData(boxPosition, MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
@@ -567,7 +567,7 @@ static void SetBoxSpeciesAndPersonalities(u8 boxId)
{
for (j = 0; j < IN_BOX_COLUMNS; j++)
{
gStorage->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2);
gStorage->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES_OR_EGG);
if (gStorage->boxSpecies[boxPosition] != SPECIES_NONE)
gStorage->boxPersonalities[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY);
boxPosition++;
@@ -597,14 +597,14 @@ void SetBoxMonIconObjMode(u8 boxPosition, u8 objMode)
void CreatePartyMonsSprites(bool8 visible)
{
u16 i, count;
u16 species = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES_OR_EGG);
u32 personality = GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY);
gStorage->partySprites[0] = CreateMonIconSprite(species, personality, 104, 64, 1, 12);
count = 1;
for (i = 1; i < PARTY_SIZE; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
+2 -2
View File
@@ -400,7 +400,7 @@ static void MultiMove_DeselectRow(u8 row, u8 minColumn, u8 maxColumn)
static void MultiMove_SetIconToBg(u8 x, u8 y)
{
u8 position = x + (IN_BOX_COLUMNS * y);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES_OR_EGG);
u32 personality = GetCurrentBoxMonData(position, MON_DATA_PERSONALITY);
if (species != SPECIES_NONE)
@@ -414,7 +414,7 @@ static void MultiMove_SetIconToBg(u8 x, u8 y)
static void MultiMove_ClearIconFromBg(u8 x, u8 y)
{
u8 position = x + (IN_BOX_COLUMNS * y);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
FillWindowPixelRect8Bit(gStorage->multiMoveWindowId, PIXEL_FILL(0), 24 * x, 24 * y, 32, 32);
+2 -2
View File
@@ -2680,12 +2680,12 @@ static void SetPokeStorageQuestLogEvent(u8 action)
if (sInPartyMenu)
{
box2 = TOTAL_BOXES_COUNT;
species2 = GetMonData(&gPlayerParty[GetBoxCursorPosition()], MON_DATA_SPECIES2);
species2 = GetMonData(&gPlayerParty[GetBoxCursorPosition()], MON_DATA_SPECIES_OR_EGG);
}
else
{
box2 = StorageGetCurrentBox();
species2 = GetCurrentBoxMonData(GetBoxCursorPosition(), MON_DATA_SPECIES2);
species2 = GetCurrentBoxMonData(GetBoxCursorPosition(), MON_DATA_SPECIES_OR_EGG);
}
questLogData = &gStorage->pokeStorageQuestLogData;
+15 -15
View File
@@ -2105,15 +2105,15 @@ static void BufferMonInfo(void)
return;
}
sMonSummaryScreen->monTypes[0] = gBaseStats[dexNum].type1;
sMonSummaryScreen->monTypes[1] = gBaseStats[dexNum].type2;
sMonSummaryScreen->monTypes[0] = gSpeciesInfo[dexNum].types[0];
sMonSummaryScreen->monTypes[1] = gSpeciesInfo[dexNum].types[1];
GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_NICKNAME, tempStr);
StringCopyN_Multibyte(sMonSummaryScreen->summary.nicknameStrBuf, tempStr, POKEMON_NAME_LENGTH);
StringGet_Nickname(sMonSummaryScreen->summary.nicknameStrBuf);
gender = GetMonGender(&sMonSummaryScreen->currentMon);
dexNum = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2);
dexNum = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG);
if (gender == MON_FEMALE)
StringCopy(sMonSummaryScreen->summary.genderSymbolStrBuf, gText_FemaleSymbol);
@@ -2224,7 +2224,7 @@ static void BufferMonSkills(void)
if (level < 100)
{
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES);
expToNextLevel = gExperienceTables[gBaseStats[species].growthRate][level + 1] - exp;
expToNextLevel = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - exp;
}
ConvertIntToDecimalStringN(sMonSummaryScreen->summary.expToNextLevelStrBuf, expToNextLevel, STR_CONV_MODE_LEFT_ALIGN, 7);
@@ -2646,7 +2646,7 @@ static void PokeSum_PrintTrainerMemo_Mon_HeldByOT(void)
// but Japanese uses different grammar for Bold and Gentle natures.
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MET_LEVEL) == 0) // Hatched
{
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_EVENT_LEGAL) == 1) // Fateful encounter
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MODERN_FATEFUL_ENCOUNTER) == TRUE)
{
if (PokeSum_IsMonBoldOrGentle(nature))
DynamicPlaceholderTextUtil_ExpandPlaceholders(natureMetOrHatchedAtLevelStr, gText_PokeSum_FatefulEncounterHatched_BoldGentleGrammar);
@@ -2743,7 +2743,7 @@ static void PokeSum_PrintTrainerMemo_Mon_NotHeldByOT(void)
// but Japanese uses different grammar for Bold and Gentle natures.
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MET_LEVEL) == 0) // hatched from an EGG
{
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_EVENT_LEGAL) == 1) // Fateful encounter
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MODERN_FATEFUL_ENCOUNTER) == TRUE)
{
if (PokeSum_IsMonBoldOrGentle(nature))
DynamicPlaceholderTextUtil_ExpandPlaceholders(natureMetOrHatchedAtLevelStr, gText_PokeSum_ApparentlyFatefulEncounterHatched_BoldGentleGrammar);
@@ -2797,7 +2797,7 @@ static void PokeSum_PrintTrainerMemo_Egg(void)
if (sMonSummaryScreen->monList.mons != gEnemyParty)
{
if (metLocation == METLOC_FATEFUL_ENCOUNTER || GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_EVENT_LEGAL) == 1)
if (metLocation == METLOC_FATEFUL_ENCOUNTER || GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MODERN_FATEFUL_ENCOUNTER) == TRUE)
chosenStrIndex = 4;
else
{
@@ -2815,7 +2815,7 @@ static void PokeSum_PrintTrainerMemo_Egg(void)
}
else
{
if (metLocation == METLOC_FATEFUL_ENCOUNTER || GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_EVENT_LEGAL) == 1)
if (metLocation == METLOC_FATEFUL_ENCOUNTER || GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MODERN_FATEFUL_ENCOUNTER) == TRUE)
chosenStrIndex = 4;
else
{
@@ -4014,7 +4014,7 @@ static void PokeSum_CreateMonPicSprite(void)
sMonPicBounceState = AllocZeroed(sizeof(struct MonPicBounceState));
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2);
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG);
personality = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_PERSONALITY);
trainerId = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_OT_ID);
@@ -4142,7 +4142,7 @@ static void PokeSum_CreateMonIconSprite(void)
u16 species;
u32 personality;
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2);
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG);
personality = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_PERSONALITY);
SafeLoadMonIconPalette(species);
@@ -4178,7 +4178,7 @@ static void PokeSum_ShowOrHideMonIconSprite(bool8 invisible)
static void PokeSum_DestroyMonIconSprite(void)
{
u16 species;
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2);
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG);
SafeFreeMonIconPalette(species);
DestroyMonIcon(&gSprites[sMonSummaryScreen->monIconSpriteId]);
}
@@ -4622,8 +4622,8 @@ static void UpdateExpBarObjs(void)
if (level < 100)
{
totalExpToNextLevel = gExperienceTables[gBaseStats[species].growthRate][level + 1] - gExperienceTables[gBaseStats[species].growthRate][level];
curExpToNextLevel = exp - gExperienceTables[gBaseStats[species].growthRate][level];
totalExpToNextLevel = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - gExperienceTables[gSpeciesInfo[species].growthRate][level];
curExpToNextLevel = exp - gExperienceTables[gSpeciesInfo[species].growthRate][level];
pointsPerTile = ((totalExpToNextLevel << 2) / 8);
totalPoints = (curExpToNextLevel << 2);
@@ -5183,9 +5183,9 @@ static void PokeSum_TryPlayMonCry(void)
if (!GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_IS_EGG))
{
if (ShouldPlayNormalMonCry(&sMonSummaryScreen->currentMon) == TRUE)
PlayCry_ByMode(GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2), 0, CRY_MODE_NORMAL);
PlayCry_ByMode(GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG), 0, CRY_MODE_NORMAL);
else
PlayCry_ByMode(GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2), 0, CRY_MODE_WEAK);
PlayCry_ByMode(GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG), 0, CRY_MODE_WEAK);
}
}
+2 -2
View File
@@ -61,7 +61,7 @@ struct GFRomHeader
u32 externalEventFlagsOffset;
u32 externalEventDataOffset;
u32 unk18;
const struct BaseStats * baseStats;
const struct SpeciesInfo * speciesInfo;
const u8 (* abilityNames)[];
const u8 *const * abilityDescriptions;
const struct Item * items;
@@ -146,7 +146,7 @@ static const struct GFRomHeader sGFRomHeader = {
.externalEventFlagsOffset = offsetof(struct SaveBlock1, externalEventFlags),
.externalEventDataOffset = offsetof(struct SaveBlock1, externalEventData),
.unk18 = 0x00000000,
.baseStats = gBaseStats,
.speciesInfo = gSpeciesInfo,
.abilityNames = gAbilityNames,
.abilityDescriptions = gAbilityDescriptionPointers,
.items = gItems,
+1
View File
@@ -7,6 +7,7 @@
#include "link.h"
#include "save_failed_screen.h"
#include "fieldmap.h"
#include "pokemon_storage_system.h"
#include "gba/flash_internal.h"
static u8 HandleWriteSector(u16 sectorId, const struct SaveSectorLocation *locations);
+6 -6
View File
@@ -2222,21 +2222,21 @@ bool8 ScrCmd_normalmsg(struct ScriptContext * ctx)
return FALSE;
}
// This command will set a Pokémon's eventLegal bit; there is no similar command to clear it.
bool8 ScrCmd_setmoneventlegal(struct ScriptContext * ctx)
// This command will set a Pokémon's modernFatefulEncounter bit; there is no similar command to clear it.
bool8 ScrCmd_setmonmodernfatefulencounter(struct ScriptContext * ctx)
{
bool8 isEventLegal = TRUE;
bool8 isModernFatefulEncounter = TRUE;
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
SetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, &isEventLegal);
SetMonData(&gPlayerParty[partyIndex], MON_DATA_MODERN_FATEFUL_ENCOUNTER, &isModernFatefulEncounter);
return FALSE;
}
bool8 ScrCmd_checkmoneventlegal(struct ScriptContext * ctx)
bool8 ScrCmd_checkmonmodernfatefulencounter(struct ScriptContext * ctx)
{
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, NULL);
gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_MODERN_FATEFUL_ENCOUNTER, NULL);
return FALSE;
}
+1 -1
View File
@@ -109,7 +109,7 @@ static bool8 CheckPartyMonHasHeldItem(u16 item)
for(i = 0; i < PARTY_SIZE; i++)
{
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE && species != SPECIES_EGG && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == item)
return TRUE;
}
+15 -15
View File
@@ -948,7 +948,7 @@ static void CB2_CreateTradeMenu(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++)
{
struct Pokemon * mon = &gPlayerParty[i];
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2),
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES_OR_EGG),
SpriteCB_MonIcon,
(sTradeMonSpriteCoords[i][0] * 8) + 14,
(sTradeMonSpriteCoords[i][1] * 8) - 12,
@@ -960,7 +960,7 @@ static void CB2_CreateTradeMenu(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PARTNER]; i++)
{
struct Pokemon * mon = &gEnemyParty[i];
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL),
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES_OR_EGG, NULL),
SpriteCB_MonIcon,
(sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14,
(sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12,
@@ -1145,7 +1145,7 @@ void CB2_ReturnToTradeMenuFromSummary(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++)
{
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(
GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL),
GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL),
SpriteCB_MonIcon,
sTradeMonSpriteCoords[i][0] * 8 + 14,
sTradeMonSpriteCoords[i][1] * 8 - 12,
@@ -1157,7 +1157,7 @@ void CB2_ReturnToTradeMenuFromSummary(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PARTNER]; i++)
{
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(
GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2, NULL),
GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG, NULL),
SpriteCB_MonIcon,
sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8 + 14,
sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8 - 12,
@@ -1964,7 +1964,7 @@ static u8 CheckValidityOfTradeMons(u8 *aliveMons, u8 playerPartyCount, u8 cursor
// Partner cant trade illegitimate Deoxys or Mew
partnerSpecies = GetMonData(&gEnemyParty[sTradeMenu->partnerCursorPosition % PARTY_SIZE], MON_DATA_SPECIES);
if ((partnerSpecies == SPECIES_DEOXYS || partnerSpecies == SPECIES_MEW)
&& !GetMonData(&gEnemyParty[sTradeMenu->partnerCursorPosition % PARTY_SIZE], MON_DATA_EVENT_LEGAL))
&& !GetMonData(&gEnemyParty[sTradeMenu->partnerCursorPosition % PARTY_SIZE], MON_DATA_MODERN_FATEFUL_ENCOUNTER))
return PARTNER_MON_INVALID;
if (hasLiveMon != 0)
@@ -2747,7 +2747,7 @@ static u32 CanTradeSelectedMon(struct Pokemon * playerParty, int partyCount, int
for (i = 0; i < partyCount; i++)
{
species2[i] = GetMonData(&playerParty[i], MON_DATA_SPECIES2);
species2[i] = GetMonData(&playerParty[i], MON_DATA_SPECIES_OR_EGG);
species[i] = GetMonData(&playerParty[i], MON_DATA_SPECIES);
}
@@ -2790,7 +2790,7 @@ static u32 CanTradeSelectedMon(struct Pokemon * playerParty, int partyCount, int
if (species[monIdx] == SPECIES_DEOXYS || species[monIdx] == SPECIES_MEW)
{
if (!GetMonData(&playerParty[monIdx], MON_DATA_EVENT_LEGAL))
if (!GetMonData(&playerParty[monIdx], MON_DATA_MODERN_FATEFUL_ENCOUNTER))
return CANT_TRADE_INVALID_MON;
}
@@ -2855,17 +2855,17 @@ s32 GetGameProgressForLinkTrade(void)
return TRADE_BOTH_PLAYERS_READY;
}
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal)
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isModernFatefulEncounter)
{
if (species == SPECIES_DEOXYS || species == SPECIES_MEW)
{
if (!isEventLegal)
if (!isModernFatefulEncounter)
return TRUE;
}
return FALSE;
}
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal)
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isModernFatefulEncounter)
{
bool8 playerHasNationalDex = player.hasNationalDex;
bool8 playerCanLinkNationally = player.canLinkNationally;
@@ -2890,7 +2890,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
}
// Cannot trade illegitimate Deoxys/Mew
if (IsDeoxysOrMewUntradable(playerSpecies, isEventLegal))
if (IsDeoxysOrMewUntradable(playerSpecies, isModernFatefulEncounter))
return UR_TRADE_MSG_MON_CANT_BE_TRADED_2;
if (partnerSpecies == SPECIES_EGG)
@@ -2902,8 +2902,8 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
else
{
// Player's Pokémon must be of the type the partner requested
if (gBaseStats[playerSpecies2].type1 != requestedType
&& gBaseStats[playerSpecies2].type2 != requestedType)
if (gSpeciesInfo[playerSpecies2].types[0] != requestedType
&& gSpeciesInfo[playerSpecies2].types[1] != requestedType)
return UR_TRADE_MSG_NOT_MON_PARTNER_WANTS;
}
@@ -2933,11 +2933,11 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
return UR_TRADE_MSG_NONE;
}
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal)
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isModernFatefulEncounter)
{
bool8 hasNationalDex = player.hasNationalDex;
if (IsDeoxysOrMewUntradable(species, isEventLegal))
if (IsDeoxysOrMewUntradable(species, isModernFatefulEncounter))
return CANT_REGISTER_MON;
if (hasNationalDex)
+3 -3
View File
@@ -755,7 +755,7 @@ static void LoadTradeMonPic(u8 whichParty, u8 state)
{
case 0:
// Load graphics
species = GetMonData(mon, MON_DATA_SPECIES2);
species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
personality = GetMonData(mon, MON_DATA_PERSONALITY);
if (whichParty == TRADE_PLAYER)
@@ -883,8 +883,8 @@ void CB2_LinkTrade(void)
case 10:
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
ShowBg(0);
sTradeAnim->questLogSpecies[TRADE_PLAYER] = GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_SPECIES2);
sTradeAnim->questLogSpecies[TRADE_PARTNER] = GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_SPECIES2);
sTradeAnim->questLogSpecies[TRADE_PLAYER] = GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_SPECIES_OR_EGG);
sTradeAnim->questLogSpecies[TRADE_PARTNER] = GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_SPECIES_OR_EGG);
memcpy(sTradeAnim->linkPartnerName, gLinkPlayers[GetMultiplayerId() ^ 1].name, PLAYER_NAME_LENGTH);
gMain.state++;
break;
+1 -1
View File
@@ -1030,7 +1030,7 @@ static s32 GetPartyMaxLevel(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) != 0 && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_EGG)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) != 0 && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_EGG)
{
s32 currLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL, NULL);
if (currLevel > topLevel)
+7 -7
View File
@@ -4002,7 +4002,7 @@ static s32 IsRequestedTradeInPlayerParty(u32 type, u32 species)
{
for (i = 0; i < gPlayerPartyCount; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species == SPECIES_EGG)
return UR_TRADE_MATCH;
}
@@ -4012,8 +4012,8 @@ static s32 IsRequestedTradeInPlayerParty(u32 type, u32 species)
{
for (i = 0; i < gPlayerPartyCount; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
if (gBaseStats[species].type1 == type || gBaseStats[species].type2 == type)
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (gSpeciesInfo[species].types[0] == type || gSpeciesInfo[species].types[1] == type)
return UR_TRADE_MATCH;
}
return UR_TRADE_NOTYPE;
@@ -4145,7 +4145,7 @@ static bool32 HasAtLeastTwoMonsOfLevel30OrLower(void)
for (i = 0; i < gPlayerPartyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) <= UNION_ROOM_MAX_LEVEL
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
count++;
}
@@ -4174,7 +4174,7 @@ void Script_ResetUnionRoomTrade(void)
static bool32 RegisterTradeMonAndGetIsEgg(u32 monId, struct UnionRoomTrade * trade)
{
trade->playerSpecies = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2);
trade->playerSpecies = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES_OR_EGG);
trade->playerLevel = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
trade->playerPersonality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY);
if (trade->playerSpecies == SPECIES_EGG)
@@ -4185,7 +4185,7 @@ static bool32 RegisterTradeMonAndGetIsEgg(u32 monId, struct UnionRoomTrade * tra
static void RegisterTradeMon(u32 monId, struct UnionRoomTrade * trade)
{
trade->species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2);
trade->species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES_OR_EGG);
trade->level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
trade->personality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY);
}
@@ -4217,7 +4217,7 @@ static u32 GetPartyPositionOfRegisteredMon(struct UnionRoomTrade * trade, u8 mul
cur_personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
if (cur_personality != personality)
continue;
cur_species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
cur_species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (cur_species != species)
continue;
response = i;