Merge branch 'followers' into followers-expanded-id
1
.gitignore
vendored
@ -21,7 +21,6 @@ sound/**/*.bin
|
||||
sound/songs/midi/*.s
|
||||
tools/agbcc
|
||||
*.map
|
||||
*.ld
|
||||
*.bat
|
||||
*.dump
|
||||
*.sa*
|
||||
|
||||
@ -150,9 +150,9 @@ Note that in msys2, Copy is Ctrl+Insert and Paste is Shift+Insert.
|
||||
<details>
|
||||
<summary><i>Notes...</i></summary>
|
||||
|
||||
> Note 1: While not shown, msys uses forward slashes `/` instead of backwards slashes `\` as the directory separator.
|
||||
> Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "Downloads/My Downloads"`.
|
||||
> Note 3: Windows path names are case-insensitive so adhering to capitalization isn’t needed.
|
||||
> Note 1: While not shown, msys uses forward slashes `/` instead of backwards slashes `\` as the directory separator.
|
||||
> Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "Downloads/My Downloads"`.
|
||||
> Note 3: Windows path names are case-insensitive so adhering to capitalization isn’t needed.
|
||||
> Note 4: If libpng was saved elsewhere, you will need to specify the full path to where libpng was downloaded, e.g. `cd c:/devkitpro/msys2` if it was saved there.
|
||||
</details>
|
||||
|
||||
|
||||
12
Makefile
@ -119,8 +119,6 @@ ifneq ($(MODERN),1)
|
||||
CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef
|
||||
endif
|
||||
|
||||
LDFLAGS = -Map ../../$(MAP)
|
||||
|
||||
SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c
|
||||
GFX := tools/gbagfx/gbagfx$(EXE)
|
||||
AIF := tools/aif2pcm/aif2pcm$(EXE)
|
||||
@ -236,8 +234,7 @@ clean-tools:
|
||||
@$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);)
|
||||
|
||||
mostlyclean: tidynonmodern tidymodern
|
||||
rm -f $(SAMPLE_SUBDIR)/*.bin
|
||||
rm -f $(CRY_SUBDIR)/*.bin
|
||||
find sound -iname '*.bin' -exec rm {} +
|
||||
rm -f $(MID_SUBDIR)/*.s
|
||||
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} +
|
||||
rm -f $(DATA_ASM_SUBDIR)/layouts/layouts.inc $(DATA_ASM_SUBDIR)/layouts/layouts_table.inc
|
||||
@ -412,19 +409,20 @@ $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt
|
||||
$(RAMSCRGEN) ewram_data $< ENGLISH > $@
|
||||
|
||||
ifeq ($(MODERN),0)
|
||||
LD_SCRIPT := ld_script.txt
|
||||
LD_SCRIPT := ld_script.ld
|
||||
LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld
|
||||
else
|
||||
LD_SCRIPT := ld_script_modern.txt
|
||||
LD_SCRIPT := ld_script_modern.ld
|
||||
LD_SCRIPT_DEPS :=
|
||||
endif
|
||||
|
||||
$(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS)
|
||||
cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld
|
||||
|
||||
LDFLAGS = -Map ../../$(MAP)
|
||||
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) libagbsyscall
|
||||
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ <objects> <lib>"
|
||||
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) $(LIB)
|
||||
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
|
||||
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
|
||||
|
||||
$(ROM): $(ELF)
|
||||
|
||||
70
README.md
@ -12,6 +12,8 @@ There are several branches, each with one main feature (and sometimes some extra
|
||||
* PID (but not legitimacy) preserving Pokémon nature-changing function
|
||||
* Function to detect modern emulators/GBA hardware.
|
||||
|
||||
> Note: Unless you have a specific need for it, you should probably use `followers-expanded-id` over this.
|
||||
|
||||
**icons** branch:
|
||||
* Everything from the **followers** branch.
|
||||
* All pokemon icons updated to Gen 6, based on [this repo](https://github.com/msikma/pokesprite/tree/master/icons/pokemon/regular)
|
||||
@ -28,36 +30,52 @@ There are several branches, each with one main feature (and sometimes some extra
|
||||
* WIP interframe-blended lamp lights at night, i.e in Rustboro.
|
||||
* HGSS-style alpha-blended shadows for object events.
|
||||
|
||||
Additional branches to mention:
|
||||
**just-lighting** branch:
|
||||
* `lighting-expanded-id` but with following pokémon code & assets completely removed. (This allows for more than 255 OW graphics)
|
||||
* Saves with following pokémon can safely be loaded.
|
||||
|
||||
**followers-expanded-id** branch:
|
||||
* Like `followers`, but includes expands OW graphicsIds to 16-bits
|
||||
in a backwards compatible way
|
||||
* Includes support for compressed OW graphics
|
||||
|
||||
Additional branches to mention:
|
||||
|
||||
* `followers-expanded-id` - like `followers`, but includes backwards-compatible 16-bit graphics IDs for object events.
|
||||
* `lighting-expanded-id` - like the above but for `lighting`.
|
||||
|
||||
To set up the repository, see [INSTALL.md](INSTALL.md).
|
||||
|
||||
## FAQ
|
||||
### `(followers*)` Q: Where are the config settings?
|
||||
A: Configuration for the follower system is mostly in [event_objects.h](include/constants/event_objects.h):
|
||||
```c
|
||||
// If true, follower pokemon will bob up and down
|
||||
// during their idle & walking animations
|
||||
#define OW_MON_BOBBING TRUE
|
||||
|
||||
// If true, adds a small amount of overhead
|
||||
// to OW code so that large (48x48, 64x64) OWs
|
||||
// will display correctly under bridges, etc.
|
||||
#define LARGE_OW_SUPPORT TRUE
|
||||
```
|
||||
|
||||
### `(lighting)` Q: How do I mark certain colors in a palette as light-blended?
|
||||
A: Create a `.pla` file in the same folder as the `.pal` with the same name.
|
||||
|
||||
In this file you can enter color indices [0,15]
|
||||
on separate lines to mark those colors as being light-blended, i.e:
|
||||
|
||||
`06.pla:`
|
||||
```
|
||||
# A comment
|
||||
0 # if color 0 is listed, uses it to blend with instead of the default!
|
||||
1
|
||||
9
|
||||
10
|
||||
```
|
||||
|
||||
You might have to `make mostlyclean` or change the `.pal` file to pick up the changes.
|
||||
|
||||
## See also
|
||||
|
||||
Other disassembly and/or decompilation projects:
|
||||
* [**Pokémon Red and Blue**](https://github.com/pret/pokered)
|
||||
* [**Pokémon Gold and Silver (Space World '97 demo)**](https://github.com/pret/pokegold-spaceworld)
|
||||
* [**Pokémon Yellow**](https://github.com/pret/pokeyellow)
|
||||
* [**Pokémon Trading Card Game**](https://github.com/pret/poketcg)
|
||||
* [**Pokémon Pinball**](https://github.com/pret/pokepinball)
|
||||
* [**Pokémon Stadium**](https://github.com/pret/pokestadium)
|
||||
* [**Pokémon Gold and Silver**](https://github.com/pret/pokegold)
|
||||
* [**Pokémon Crystal**](https://github.com/pret/pokecrystal)
|
||||
* [**Pokémon Ruby and Sapphire**](https://github.com/pret/pokeruby)
|
||||
* [**Pokémon Pinball: Ruby & Sapphire**](https://github.com/pret/pokepinballrs)
|
||||
* [**Pokémon FireRed and LeafGreen**](https://github.com/pret/pokefirered)
|
||||
* [**Pokémon Mystery Dungeon: Red Rescue Team**](https://github.com/pret/pmd-red)
|
||||
* [**Pokémon Diamond and Pearl**](https://github.com/pret/pokediamond)
|
||||
* [**Pokémon Platinum**](https://github.com/pret/pokeplatinum)
|
||||
* [**Pokémon HeartGold and SoulSilver**](https://github.com/pret/pokeheartgold)
|
||||
* [**Pokémon Mystery Dungeon: Explorers of Sky**](https://github.com/pret/pmd-sky)
|
||||
|
||||
## Contacts
|
||||
|
||||
You can find PRET on:
|
||||
|
||||
* [Discord (PRET, #pokeemerald)](https://discord.gg/d5dubZ3)
|
||||
* [IRC](https://web.libera.chat/?#pret)
|
||||
For contacts and other pret projects, see [pret.github.io](https://pret.github.io/).
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#ifndef GUARD_CONSTANTS_GBA_CONSTANTS_INC
|
||||
#define GUARD_CONSTANTS_GBA_CONSTANTS_INC
|
||||
|
||||
.set PSR_USR_MODE, 0x00000010
|
||||
.set PSR_FIQ_MODE, 0x00000011
|
||||
.set PSR_IRQ_MODE, 0x00000012
|
||||
@ -511,3 +514,5 @@
|
||||
.set BLDCNT_TGT2_OBJ, 1 << 12
|
||||
.set BLDCNT_TGT2_BD, 1 << 13
|
||||
.set BLDCNT_TGT2_ALL, BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD
|
||||
|
||||
#endif @ GUARD_CONSTANTS_GBA_CONSTANTS_INC
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#ifndef GUARD_CONSTANTS_GLOBAL_INC
|
||||
#define GUARD_CONSTANTS_GLOBAL_INC
|
||||
|
||||
.set TRUE, 1
|
||||
.set FALSE, 0
|
||||
|
||||
@ -20,3 +23,5 @@
|
||||
|
||||
.set OBJ_IMAGE_ANIM_H_FLIP, 1 << 6
|
||||
.set OBJ_IMAGE_ANIM_V_FLIP, 1 << 7
|
||||
|
||||
#endif @ GUARD_CONSTANTS_GLOBAL_INC
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#ifndef GUARD_CONSTANTS_M4A_CONSTANTS_INC
|
||||
#define GUARD_CONSTANTS_M4A_CONSTANTS_INC
|
||||
|
||||
.equiv ID_NUMBER, 0x68736d53
|
||||
|
||||
.equiv PCM_DMA_BUF_SIZE, 1584
|
||||
@ -250,3 +253,5 @@
|
||||
struct_field o_CgbChannel_nextChannelPointer, 4
|
||||
struct_field o_CgbChannel_dummy4, 8
|
||||
struct_field CgbChannel_size, 0
|
||||
|
||||
#endif @ GUARD_CONSTANTS_M4A_CONSTANTS_INC
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#ifndef GUARD_CONSTANTS_TMS_HMS_INC
|
||||
#define GUARD_CONSTANTS_TMS_HMS_INC
|
||||
|
||||
#include "constants/tms_hms.h"
|
||||
|
||||
/* Expands to:
|
||||
@ -15,3 +18,5 @@ FOREACH_TM(EQUIV_TM)
|
||||
FOREACH_HM(EQUIV_HM)
|
||||
#undef EQUIV_TM
|
||||
#undef EQUIV_HM
|
||||
|
||||
#endif @ GUARD_CONSTANTS_TMS_HMS_INC
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#include "config.h"
|
||||
#include "constants/battle.h"
|
||||
#include "constants/battle_ai.h"
|
||||
#include "constants/abilities.h"
|
||||
@ -1926,19 +1927,19 @@ AI_CV_Protect_End:
|
||||
@ BUG: Foresight is only encouraged if the user is Ghost type or
|
||||
@ has high evasion, but should check target instead
|
||||
AI_CV_Foresight:
|
||||
.ifdef BUGFIX
|
||||
#ifdef BUGFIX
|
||||
get_target_type1
|
||||
if_equal TYPE_GHOST, AI_CV_Foresight2
|
||||
get_target_type2
|
||||
if_equal TYPE_GHOST, AI_CV_Foresight2
|
||||
if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, AI_CV_Foresight3
|
||||
.else
|
||||
#else
|
||||
get_user_type1
|
||||
if_equal TYPE_GHOST, AI_CV_Foresight2
|
||||
get_user_type2
|
||||
if_equal TYPE_GHOST, AI_CV_Foresight2
|
||||
if_stat_level_more_than AI_USER, STAT_EVASION, 8, AI_CV_Foresight3
|
||||
.endif
|
||||
#endif
|
||||
score -2
|
||||
goto AI_CV_Foresight_End
|
||||
|
||||
@ -2183,13 +2184,13 @@ AI_CV_SemiInvulnerable2:
|
||||
if_status2 AI_TARGET, STATUS2_CURSED, AI_CV_SemiInvulnerable_TryEncourage
|
||||
if_status3 AI_TARGET, STATUS3_LEECHSEED, AI_CV_SemiInvulnerable_TryEncourage
|
||||
get_weather
|
||||
.ifdef BUGFIX
|
||||
#ifdef BUGFIX
|
||||
if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckIceType
|
||||
if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckSandstormTypes
|
||||
.else
|
||||
#else
|
||||
if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckSandstormTypes
|
||||
if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckIceType
|
||||
.endif
|
||||
#endif
|
||||
goto AI_CV_SemiInvulnerable5
|
||||
|
||||
AI_CV_SemiInvulnerable_CheckSandstormTypes:
|
||||
@ -2254,11 +2255,11 @@ AI_CV_Hail_End:
|
||||
|
||||
@ BUG: Facade score is increased if the target is statused, but should be if the user is
|
||||
AI_CV_Facade:
|
||||
.ifdef BUGFIX
|
||||
#ifdef BUGFIX
|
||||
if_not_status AI_USER, STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON, AI_CV_Facade_End
|
||||
.else
|
||||
#else
|
||||
if_not_status AI_TARGET, STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON, AI_CV_Facade_End
|
||||
.endif
|
||||
#endif
|
||||
score +1
|
||||
AI_CV_Facade_End:
|
||||
end
|
||||
@ -3176,9 +3177,9 @@ AI_HPAware_DiscouragedEffectsWhenTargetLowHP:
|
||||
AI_TrySunnyDayStart:
|
||||
if_target_is_ally AI_TryOnAlly
|
||||
if_not_effect EFFECT_SUNNY_DAY, AI_TrySunnyDayStart_End
|
||||
.ifndef BUGFIX @ funcResult has not been set in this script yet, below call is nonsense
|
||||
#ifndef BUGFIX @ funcResult has not been set in this script yet, below call is nonsense
|
||||
if_equal FALSE, AI_TrySunnyDayStart_End
|
||||
.endif
|
||||
#endif
|
||||
is_first_turn_for AI_USER
|
||||
if_equal FALSE, AI_TrySunnyDayStart_End
|
||||
score +5
|
||||
|
||||
@ -3208,7 +3208,7 @@ BattleScript_DamagingWeatherLoop::
|
||||
jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement
|
||||
printfromtable gSandStormHailDmgStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||
orword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||
effectivenesssound
|
||||
hitanimation BS_ATTACKER
|
||||
healthbarupdate BS_ATTACKER
|
||||
@ -3220,7 +3220,7 @@ BattleScript_DamagingWeatherLoopIncrement::
|
||||
addbyte gBattleCommunication, 1
|
||||
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
|
||||
BattleScript_DamagingWeatherContinuesEnd::
|
||||
bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||
bicword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||
end2
|
||||
|
||||
BattleScript_SandStormHailEnds::
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#include "config.h"
|
||||
#include "constants/global.h"
|
||||
#include "constants/contest.h"
|
||||
.include "asm/macros.inc"
|
||||
@ -435,11 +436,11 @@ AI_CGM_BetterWhenAudienceExcited:
|
||||
AI_CGM_BetterWhenAudienceExcited_1stUp:
|
||||
@ BUG: Should be if_appeal_num_eq 0
|
||||
@ 1st up on 1st appeal excitement will always be 0
|
||||
.ifdef BUGFIX
|
||||
#ifdef BUGFIX
|
||||
if_appeal_num_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal
|
||||
.else
|
||||
#else
|
||||
if_appeal_num_not_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal
|
||||
.endif
|
||||
#endif
|
||||
if_excitement_eq 4, AI_CGM_BetterWhenAudienceExcited_1AwayFromMax
|
||||
if_excitement_eq 3, AI_CGM_BetterWhenAudienceExcited_2AwayFromMax
|
||||
end
|
||||
@ -546,11 +547,11 @@ AI_CGM_TargetMonWithJudgesAttention:
|
||||
end
|
||||
AI_CGM_TargetMonWithJudgesAttention_CheckMon1:
|
||||
if_cannot_participate MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
|
||||
.ifdef BUGFIX
|
||||
#ifdef BUGFIX
|
||||
if_not_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
|
||||
.else
|
||||
#else
|
||||
if_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
|
||||
.endif
|
||||
#endif
|
||||
if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
|
||||
score +2
|
||||
if_not_completed_combo MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
|
||||
@ -559,11 +560,11 @@ AI_CGM_TargetMonWithJudgesAttention_CheckMon1:
|
||||
AI_CGM_TargetMonWithJudgesAttention_CheckMon2:
|
||||
if_user_order_eq MON_2, AI_CGM_End
|
||||
if_cannot_participate MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
|
||||
.ifdef BUGFIX
|
||||
#ifdef BUGFIX
|
||||
if_not_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
|
||||
.else
|
||||
#else
|
||||
if_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
|
||||
.endif
|
||||
#endif
|
||||
if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
|
||||
score +2
|
||||
if_not_completed_combo MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
|
||||
@ -572,11 +573,11 @@ AI_CGM_TargetMonWithJudgesAttention_CheckMon2:
|
||||
AI_CGM_TargetMonWithJudgesAttention_CheckMon3:
|
||||
if_user_order_eq MON_3, AI_CGM_End
|
||||
if_cannot_participate MON_3, AI_CGM_End
|
||||
.ifdef BUGFIX
|
||||
#ifdef BUGFIX
|
||||
if_not_used_combo_starter MON_3, AI_CGM_End
|
||||
.else
|
||||
#else
|
||||
if_used_combo_starter MON_3, AI_CGM_End
|
||||
.endif
|
||||
#endif
|
||||
if_random_less_than 125, AI_CGM_End
|
||||
score +2
|
||||
if_not_completed_combo MON_3, AI_CGM_End
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#include "config.h"
|
||||
#include "constants/global.h"
|
||||
#include "constants/apprentice.h"
|
||||
#include "constants/battle.h"
|
||||
|
||||
@ -421,18 +421,18 @@ BattleFrontier_BattleTowerLobby_EventScript_SaveBeforeLinkMultisChallenge::
|
||||
@ to the flash, but not data in PokemonStorage. The SaveGame script that follows asks the player to do a full save,
|
||||
@ which they can opt out of. As a result the player can save their party and quit without having saved the PC.
|
||||
@ This allows players to clone pokemon and their held items by withdrawing them (or erase them by despositing).
|
||||
.ifndef BUGFIX
|
||||
#ifndef BUGFIX
|
||||
tower_save 0
|
||||
.endif
|
||||
#endif
|
||||
call Common_EventScript_SaveGame
|
||||
setvar VAR_TEMP_CHALLENGE_STATUS, 255
|
||||
goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed
|
||||
@ GAME_STAT_ENTERED_BATTLE_TOWER should not be incremented here, for two reasons:
|
||||
@ 1. It is incremented again in BattleFrontier_BattleTowerLobby_EventScript_CableLinkSuccessful or BattleFrontier_BattleTowerLobby_EventScript_WirelessLinkSuccessful
|
||||
@ 2. If the player tries to save, but fails, the counter will still be incremented even if the player never enters the tower.
|
||||
.ifndef BUGFIX
|
||||
@ 2. If the player tries to connect, but fails, the counter will still be incremented even if the player never enters the tower.
|
||||
#ifndef BUGFIX
|
||||
incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER
|
||||
.endif
|
||||
#endif
|
||||
specialvar VAR_RESULT, IsWirelessAdapterConnected
|
||||
goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_TryWirelessLink
|
||||
goto BattleFrontier_BattleTowerLobby_EventScript_TryCableLink
|
||||
|
||||
@ -229,11 +229,11 @@ MossdeepCity_SpaceCenter_1F_EventScript_Grunt2::
|
||||
copyobjectxytoperm LOCALID_STAIR_GRUNT
|
||||
switch VAR_FACING
|
||||
case DIR_WEST, MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsWest
|
||||
#ifdef BUGFIX
|
||||
#ifdef BUGFIX
|
||||
case DIR_EAST, MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsEast
|
||||
#else
|
||||
#else
|
||||
case DIR_WEST, MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsEast
|
||||
#endif
|
||||
#endif
|
||||
applymovement LOCALID_STAIR_GRUNT, MossdeepCity_SpaceCenter_1F_Movement_MoveGruntFromStairs
|
||||
waitmovement 0
|
||||
setvar VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 2
|
||||
|
||||
@ -13,9 +13,9 @@ TrainerHill_OnWarp:
|
||||
|
||||
TrainerHill_1F_EventScript_DummyOnWarp::
|
||||
setvar VAR_TEMP_3, 1
|
||||
.ifdef BUGFIX
|
||||
#ifdef BUGFIX
|
||||
end @ Missing end. By chance, the next byte (0x02 of VAR_TEMP_2) is also the id for the end cmd
|
||||
.endif
|
||||
#endif
|
||||
|
||||
TrainerHill_OnFrame:
|
||||
map_script_2 VAR_TEMP_2, 0, TrainerHill_1F_EventScript_DummyWarpToEntranceCounter
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
#include "global.h"
|
||||
#include "malloc.h"
|
||||
|
||||
static void *sHeapStart;
|
||||
static u32 sHeapSize;
|
||||
|
||||
EWRAM_DATA u8 gHeap[HEAP_SIZE] = {0};
|
||||
|
||||
#define MALLOC_SYSTEM_ID 0xA3A3
|
||||
|
||||
struct MemBlock {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#ifndef GUARD_ALLOC_H
|
||||
#define GUARD_ALLOC_H
|
||||
|
||||
#define HEAP_SIZE 0x1C000
|
||||
|
||||
#define FREE_AND_SET_NULL(ptr) \
|
||||
{ \
|
||||
@ -11,7 +10,8 @@
|
||||
|
||||
#define TRY_FREE_AND_SET_NULL(ptr) if (ptr != NULL) FREE_AND_SET_NULL(ptr)
|
||||
|
||||
extern u8 gHeap[];
|
||||
#define HEAP_SIZE 0x1C000
|
||||
extern u8 gHeap[HEAP_SIZE];
|
||||
|
||||
void *Alloc(u32 size);
|
||||
void *AllocZeroed(u32 size);
|
||||
|
||||
@ -1623,7 +1623,6 @@ u8 LoadSpritePalette(const struct SpritePalette *palette)
|
||||
{
|
||||
u8 index = IndexOfSpritePaletteTag(palette->tag);
|
||||
u8 i;
|
||||
u16 *debugPtr = (u16*) 0x0203d800;
|
||||
|
||||
if (index != 0xFF)
|
||||
return index;
|
||||
@ -1637,9 +1636,6 @@ u8 LoadSpritePalette(const struct SpritePalette *palette)
|
||||
else
|
||||
{
|
||||
sSpritePaletteTags[index] = palette->tag;
|
||||
for (i = 0; i < 16; i++) {
|
||||
debugPtr[i] = sSpritePaletteTags[i];
|
||||
}
|
||||
DoLoadSpritePalette(palette->data, PLTT_ID(index));
|
||||
return index;
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8
|
||||
|
||||
if (state == WRITING_DIGITS)
|
||||
{
|
||||
char *out = dest++;
|
||||
u8 *out = dest++;
|
||||
|
||||
if (digit <= 0xF)
|
||||
c = sDigits[digit];
|
||||
@ -309,7 +309,7 @@ u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8
|
||||
}
|
||||
else if (digit != 0 || powerOfSixteen == 1)
|
||||
{
|
||||
char *out;
|
||||
u8 *out;
|
||||
state = WRITING_DIGITS;
|
||||
out = dest++;
|
||||
|
||||
|
||||
@ -554,8 +554,7 @@ void DecompressGlyphTile(const void *src_, void *dest_)
|
||||
*(dest++) = ((sFontHalfRowLookupTable[sFontHalfRowOffsets[temp & 0xFF]]) << 16) | (sFontHalfRowLookupTable[sFontHalfRowOffsets[temp >> 8]]);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static u8 GetLastTextColor(u8 colorType)
|
||||
static u8 UNUSED GetLastTextColor(u8 colorType)
|
||||
{
|
||||
switch (colorType)
|
||||
{
|
||||
@ -1224,8 +1223,7 @@ static u16 RenderText(struct TextPrinter *textPrinter)
|
||||
return RENDER_FINISH;
|
||||
}
|
||||
|
||||
// Unused
|
||||
static u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing)
|
||||
static u32 UNUSED GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing)
|
||||
{
|
||||
int i;
|
||||
u8 width;
|
||||
|
||||
@ -411,7 +411,7 @@ void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u
|
||||
BlitBitmapRect4Bit(&sourceRect, &destRect, srcX, srcY, destX, destY, rectWidth, rectHeight, 0);
|
||||
}
|
||||
|
||||
static void BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
|
||||
static void UNUSED BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
|
||||
{
|
||||
struct Bitmap sourceRect;
|
||||
struct Bitmap destRect;
|
||||
|
||||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |
|
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 99 B |
|
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 99 B |
1
graphics/unused/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
redyellowgreen_frame.bin
|
||||
@ -21,7 +21,7 @@ JPCONTESTGFXDIR := graphics/contest/japanese
|
||||
POKEDEXGFXDIR := graphics/pokedex
|
||||
STARTERGFXDIR := graphics/starter_choose
|
||||
NAMINGGFXDIR := graphics/naming_screen
|
||||
SPINDAGFXDIR := graphics/spinda_spots
|
||||
SPINDAGFXDIR := graphics/pokemon/spinda/spots
|
||||
|
||||
types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark
|
||||
contest_types := cool beauty cute smart tough
|
||||
@ -290,10 +290,10 @@ $(FONTGFXDIR)/short.fwjpnfont: $(FONTGFXDIR)/japanese_short.png
|
||||
$(FONTGFXDIR)/braille.fwjpnfont: $(FONTGFXDIR)/braille.png
|
||||
$(GFX) $< $@
|
||||
|
||||
$(FONTGFXDIR)/frlg_male.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_male_font.png
|
||||
$(FONTGFXDIR)/frlg_male.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_male.png
|
||||
$(GFX) $< $@
|
||||
|
||||
$(FONTGFXDIR)/frlg_female.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_female_font.png
|
||||
$(FONTGFXDIR)/frlg_female.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_female.png
|
||||
$(GFX) $< $@
|
||||
|
||||
|
||||
|
||||
@ -54,6 +54,9 @@
|
||||
|
||||
#define BATTLE_BUFFER_LINK_SIZE 0x1000
|
||||
|
||||
// Special indicator value for shellBellDmg in SpecialStatus
|
||||
#define IGNORE_SHELL_BELL 0xFFFF
|
||||
|
||||
struct ResourceFlags
|
||||
{
|
||||
u32 flags[MAX_BATTLERS_COUNT];
|
||||
@ -133,7 +136,7 @@ struct SpecialStatus
|
||||
u32 ppNotAffectedByPressure:1;
|
||||
u32 faintedHasReplacement:1;
|
||||
u32 focusBanded:1;
|
||||
s32 dmg;
|
||||
s32 shellBellDmg;
|
||||
s32 physicalDmg;
|
||||
s32 specialDmg;
|
||||
u8 physicalBattlerId;
|
||||
@ -417,7 +420,7 @@ struct BattleStruct
|
||||
u8 arenaTurnCounter;
|
||||
u8 turnSideTracker;
|
||||
u8 unused_6[3];
|
||||
u8 givenExpMons; // Bits for enemy party's pokemon that gave exp to player's party.
|
||||
u8 givenExpMons; // Bits for enemy party's Pokémon that gave exp to player's party.
|
||||
u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte]
|
||||
u16 castformPalette[NUM_CASTFORM_FORMS][16];
|
||||
union {
|
||||
@ -437,7 +440,7 @@ struct BattleStruct
|
||||
u16 arenaStartHp[2];
|
||||
u8 arenaLostPlayerMons; // Bits for party member, lost as in referee's decision, not by fainting.
|
||||
u8 arenaLostOpponentMons;
|
||||
u8 alreadyStatusedMoveAttempt; // As bits for battlers; For example when using Thunder Wave on an already paralyzed pokemon.
|
||||
u8 alreadyStatusedMoveAttempt; // As bits for battlers; For example when using Thunder Wave on an already paralyzed Pokémon.
|
||||
};
|
||||
|
||||
// The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider,
|
||||
@ -445,9 +448,9 @@ struct BattleStruct
|
||||
// The assert below is to ensure palaceFlags is large enough to store these flags without overlap.
|
||||
STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLERS_COUNT + MAX_MON_MOVES, PalaceFlagsTooSmall)
|
||||
|
||||
#define F_DYNAMIC_TYPE_1 (1 << 6)
|
||||
#define F_DYNAMIC_TYPE_2 (1 << 7)
|
||||
#define DYNAMIC_TYPE_MASK (F_DYNAMIC_TYPE_1 - 1)
|
||||
#define DYNAMIC_TYPE_MASK ((1 << 6) - 1)
|
||||
#define F_DYNAMIC_TYPE_IGNORE_PHYSICALITY (1 << 6) // If set, the dynamic type's physicality won't be used for certain move effects.
|
||||
#define F_DYNAMIC_TYPE_SET (1 << 7) // Set for all dynamic types to distinguish a dynamic type of Normal (0) from no dynamic type.
|
||||
|
||||
#define GET_MOVE_TYPE(move, typeArg) \
|
||||
{ \
|
||||
@ -592,7 +595,7 @@ struct BattleSpriteData
|
||||
|
||||
struct MonSpritesGfx
|
||||
{
|
||||
void *firstDecompressed; // ptr to the decompressed sprite of the first pokemon
|
||||
void *firstDecompressed; // ptr to the decompressed sprite of the first Pokémon
|
||||
union {
|
||||
void *ptr[MAX_BATTLERS_COUNT];
|
||||
u8 *byte[MAX_BATTLERS_COUNT];
|
||||
@ -647,7 +650,7 @@ extern u16 gChosenMove;
|
||||
extern u16 gCalledMove;
|
||||
extern s32 gBattleMoveDamage;
|
||||
extern s32 gHpDealt;
|
||||
extern s32 gTakenDmg[MAX_BATTLERS_COUNT];
|
||||
extern s32 gBideDmg[MAX_BATTLERS_COUNT];
|
||||
extern u16 gLastUsedItem;
|
||||
extern u8 gLastUsedAbility;
|
||||
extern u8 gBattlerAttacker;
|
||||
@ -673,7 +676,7 @@ extern u8 gLastHitBy[MAX_BATTLERS_COUNT];
|
||||
extern u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT];
|
||||
extern u8 gMoveResultFlags;
|
||||
extern u32 gHitMarker;
|
||||
extern u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT];
|
||||
extern u8 gBideTarget[MAX_BATTLERS_COUNT];
|
||||
extern u8 gUnusedFirstBattleVar2;
|
||||
extern u16 gSideStatuses[NUM_BATTLE_SIDES];
|
||||
extern struct SideTimer gSideTimers[NUM_BATTLE_SIDES];
|
||||
|
||||
@ -168,7 +168,7 @@
|
||||
|
||||
// Not really sure what a "hitmarker" is.
|
||||
#define HITMARKER_WAKE_UP_CLEAR (1 << 4) // Cleared when waking up. Never set or checked.
|
||||
#define HITMARKER_SKIP_DMG_TRACK (1 << 5)
|
||||
#define HITMARKER_IGNORE_BIDE (1 << 5)
|
||||
#define HITMARKER_DESTINYBOND (1 << 6)
|
||||
#define HITMARKER_NO_ANIMATIONS (1 << 7)
|
||||
#define HITMARKER_IGNORE_SUBSTITUTE (1 << 8)
|
||||
@ -176,7 +176,7 @@
|
||||
#define HITMARKER_ATTACKSTRING_PRINTED (1 << 10)
|
||||
#define HITMARKER_NO_PPDEDUCT (1 << 11)
|
||||
#define HITMARKER_SWAP_ATTACKER_TARGET (1 << 12)
|
||||
#define HITMARKER_IGNORE_SAFEGUARD (1 << 13)
|
||||
#define HITMARKER_STATUS_ABILITY_EFFECT (1 << 13)
|
||||
#define HITMARKER_SYNCHRONISE_EFFECT (1 << 14)
|
||||
#define HITMARKER_RUN (1 << 15)
|
||||
#define HITMARKER_IGNORE_ON_AIR (1 << 16)
|
||||
|
||||
@ -16,12 +16,12 @@
|
||||
#define PALACE_DATA_WIN_STREAK 1
|
||||
#define PALACE_DATA_WIN_STREAK_ACTIVE 2
|
||||
|
||||
// Pokemon in Battle Palace have a move "group" type preference depending on nature
|
||||
// Pokémon in Battle Palace have a move "group" type preference depending on nature
|
||||
#define PALACE_MOVE_GROUP_ATTACK 0
|
||||
#define PALACE_MOVE_GROUP_DEFENSE 1
|
||||
#define PALACE_MOVE_GROUP_SUPPORT 2
|
||||
|
||||
// In palace doubles battles pokemon have a target preference depending on nature
|
||||
// In palace doubles battles Pokémon have a target preference depending on nature
|
||||
#define PALACE_TARGET_STRONGER 0
|
||||
#define PALACE_TARGET_WEAKER 1
|
||||
#define PALACE_TARGET_RANDOM 2
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
#define DEPT_STORE_FLOORNUM_11F 14
|
||||
#define DEPT_STORE_FLOORNUM_ROOFTOP 15
|
||||
|
||||
// Lilycove Pokemon Trainer Fan Club
|
||||
// Lilycove Pokémon Trainer Fan Club
|
||||
#define NUM_TRAINER_FAN_CLUB_MEMBERS 8
|
||||
|
||||
#define FANCLUB_GOT_FIRST_FANS 7
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
#define GUARD_CONSTANTS_GLOBAL_H
|
||||
// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen.
|
||||
// In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen.
|
||||
// In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------".
|
||||
// In Gen 4 only, migrated Pokémon with Diamond, Pearl, or Platinum's ID show as "----------".
|
||||
// Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh".
|
||||
// In Gen 4 and up, migrated Pokemon with HeartGold or SoulSilver's ID show the otherwise unused "Johto" string.
|
||||
// In Gen 4 and up, migrated Pokémon with HeartGold or SoulSilver's ID show the otherwise unused "Johto" string.
|
||||
#define VERSION_SAPPHIRE 1
|
||||
#define VERSION_RUBY 2
|
||||
#define VERSION_EMERALD 3
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#define FIRST_BALL ITEM_MASTER_BALL
|
||||
#define LAST_BALL ITEM_PREMIER_BALL
|
||||
|
||||
// Pokemon Items
|
||||
// Pokémon Items
|
||||
#define ITEM_POTION 13
|
||||
#define ITEM_ANTIDOTE 14
|
||||
#define ITEM_BURN_HEAL 15
|
||||
@ -476,7 +476,7 @@
|
||||
#define ITEM_B_USE_MEDICINE 1
|
||||
#define ITEM_B_USE_OTHER 2
|
||||
|
||||
// Check if the item is one that can be used on a Pokemon.
|
||||
// Check if the item is one that can be used on a Pokémon.
|
||||
#define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= MAX_BERRY_INDEX)
|
||||
|
||||
#endif // GUARD_CONSTANTS_ITEMS_H
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_CONSTANTS_POKEDEX_H
|
||||
#define GUARD_CONSTANTS_POKEDEX_H
|
||||
|
||||
// National Pokedex order
|
||||
// National Pokédex order
|
||||
enum {
|
||||
NATIONAL_DEX_NONE,
|
||||
// Kanto
|
||||
@ -425,7 +425,7 @@ enum {
|
||||
#define JOHTO_DEX_COUNT NATIONAL_DEX_CELEBI
|
||||
#define NATIONAL_DEX_COUNT NATIONAL_DEX_DEOXYS
|
||||
|
||||
// Hoenn Pokedex order
|
||||
// Hoenn Pokédex order
|
||||
enum {
|
||||
HOENN_DEX_NONE,
|
||||
HOENN_DEX_TREECKO,
|
||||
@ -631,7 +631,7 @@ enum {
|
||||
HOENN_DEX_JIRACHI,
|
||||
HOENN_DEX_DEOXYS,
|
||||
// End of Hoenn Dex (see HOENN_DEX_COUNT)
|
||||
// Here below have values but are excluded from the Pokedex
|
||||
// Here below have values but are excluded from the Pokédex
|
||||
HOENN_DEX_BULBASAUR,
|
||||
HOENN_DEX_IVYSAUR,
|
||||
HOENN_DEX_VENUSAUR,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_CONSTANTS_POKEMON_H
|
||||
#define GUARD_CONSTANTS_POKEMON_H
|
||||
|
||||
// Pokemon types
|
||||
// Pokémon types
|
||||
#define TYPE_NONE 255
|
||||
#define TYPE_NORMAL 0
|
||||
#define TYPE_FIGHTING 1
|
||||
@ -23,27 +23,27 @@
|
||||
#define TYPE_DARK 17
|
||||
#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_UNDISCOVERED 15
|
||||
// Pokémon 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_NO_EGGS_DISCOVERED 15
|
||||
|
||||
#define EGG_GROUPS_PER_MON 2
|
||||
#define EGG_GROUPS_PER_MON 2
|
||||
|
||||
// Pokemon natures
|
||||
// Pokémon natures
|
||||
#define NATURE_HARDY 0
|
||||
#define NATURE_LONELY 1
|
||||
#define NATURE_BRAVE 2
|
||||
@ -71,7 +71,7 @@
|
||||
#define NATURE_QUIRKY 24
|
||||
#define NUM_NATURES 25
|
||||
|
||||
// Pokemon Stats
|
||||
// Pokémon Stats
|
||||
#define STAT_HP 0
|
||||
#define STAT_ATK 1
|
||||
#define STAT_DEF 2
|
||||
@ -220,7 +220,7 @@
|
||||
#define GROWTH_FAST 4
|
||||
#define GROWTH_SLOW 5
|
||||
|
||||
// Body colors for pokedex search
|
||||
// Body colors for Pokédex search
|
||||
#define BODY_COLOR_RED 0
|
||||
#define BODY_COLOR_BLUE 1
|
||||
#define BODY_COLOR_YELLOW 2
|
||||
@ -263,7 +263,7 @@
|
||||
#define MON_PIC_HEIGHT 64
|
||||
#define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2)
|
||||
|
||||
// Most pokemon have 2 frames (a default and an alternate for their animation).
|
||||
// Most Pokémon have 2 frames (a default and an alternate for their animation).
|
||||
// There are 4 exceptions:
|
||||
// - Castform has 4 frames, 1 for each form
|
||||
// - Deoxys has 2 frames, 1 for each form
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
|
||||
#define NUM_SECRET_BASE_FLAGS 32 // by definition, bitfield of 2 u16s
|
||||
|
||||
// TV Show states for Pokemon Contest Live Updates
|
||||
// TV Show states for Pokémon Contest Live Updates
|
||||
#define CONTESTLIVE_STATE_INTRO 0
|
||||
#define CONTESTLIVE_STATE_WON_BOTH_ROUNDS 1
|
||||
#define CONTESTLIVE_STATE_BETTER_ROUND2 2
|
||||
|
||||
@ -209,7 +209,7 @@ struct ContestantStatus
|
||||
u8 comboAppealBonus;
|
||||
u8 repeatJam;
|
||||
u8 nextTurnOrder; // turn position
|
||||
u8 attentionLevel; // How much the Pokemon "stood out"
|
||||
u8 attentionLevel; // How much the Pokémon "stood out"
|
||||
u8 contestantAnimTarget;
|
||||
};
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@
|
||||
#define ROUND_BITS_TO_BYTES(numBits) DIV_ROUND_UP(numBits, 8)
|
||||
|
||||
// NUM_DEX_FLAG_BYTES allocates more flags than it needs to, as NUM_SPECIES includes the "old unown"
|
||||
// values that don't appear in the Pokedex. NATIONAL_DEX_COUNT does not include these values.
|
||||
// values that don't appear in the Pokédex. NATIONAL_DEX_COUNT does not include these values.
|
||||
#define NUM_DEX_FLAG_BYTES ROUND_BITS_TO_BYTES(NUM_SPECIES)
|
||||
#define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT)
|
||||
#define NUM_TRENDY_SAYING_BYTES ROUND_BITS_TO_BYTES(NUM_TRENDY_SAYINGS)
|
||||
@ -523,7 +523,7 @@ struct SaveBlock2
|
||||
/*0x90*/ u8 filler_90[0x8];
|
||||
/*0x98*/ struct Time localTimeOffset;
|
||||
/*0xA0*/ struct Time lastBerryTreeUpdate;
|
||||
/*0xA8*/ u32 gcnLinkFlags; // Read by Pokemon Colosseum/XD
|
||||
/*0xA8*/ u32 gcnLinkFlags; // Read by Pokémon Colosseum/XD
|
||||
/*0xAC*/ u32 encryptionKey;
|
||||
/*0xB0*/ struct PlayersApprentice playerApprentice;
|
||||
/*0xDC*/ struct Apprentice apprentices[APPRENTICE_COUNT];
|
||||
|
||||
@ -32,7 +32,7 @@ extern const u32 gBallGfx_Premier[];
|
||||
extern const u32 gBallPal_Premier[];
|
||||
extern const u32 gOpenPokeballGfx[];
|
||||
|
||||
// pokemon gfx
|
||||
// Pokémon gfx
|
||||
extern const u32 gMonFrontPic_Bulbasaur[];
|
||||
extern const u32 gMonPalette_Bulbasaur[];
|
||||
extern const u32 gMonBackPic_Bulbasaur[];
|
||||
@ -881,13 +881,13 @@ extern const u32 gMonShinyPalette_Starmie[];
|
||||
extern const u32 gMonStillFrontPic_Starmie[];
|
||||
extern const u8 gMonIcon_Starmie[];
|
||||
extern const u8 gMonFootprint_Starmie[];
|
||||
extern const u32 gMonFrontPic_Mrmime[];
|
||||
extern const u32 gMonPalette_Mrmime[];
|
||||
extern const u32 gMonBackPic_Mrmime[];
|
||||
extern const u32 gMonShinyPalette_Mrmime[];
|
||||
extern const u32 gMonStillFrontPic_Mrmime[];
|
||||
extern const u8 gMonIcon_Mrmime[];
|
||||
extern const u8 gMonFootprint_Mrmime[];
|
||||
extern const u32 gMonFrontPic_MrMime[];
|
||||
extern const u32 gMonPalette_MrMime[];
|
||||
extern const u32 gMonBackPic_MrMime[];
|
||||
extern const u32 gMonShinyPalette_MrMime[];
|
||||
extern const u32 gMonStillFrontPic_MrMime[];
|
||||
extern const u8 gMonIcon_MrMime[];
|
||||
extern const u8 gMonFootprint_MrMime[];
|
||||
extern const u32 gMonFrontPic_Scyther[];
|
||||
extern const u32 gMonPalette_Scyther[];
|
||||
extern const u32 gMonBackPic_Scyther[];
|
||||
@ -3282,7 +3282,7 @@ extern const u32 gBattleTerrainPalette_StadiumGlacia[];
|
||||
extern const u32 gBattleTerrainPalette_StadiumDrake[];
|
||||
extern const u32 gBattleTerrainPalette_StadiumWallace[];
|
||||
|
||||
// pokedex
|
||||
// Pokédex
|
||||
extern const u32 gPokedexInterface_Gfx[];
|
||||
extern const u16 gPokedexBgHoenn_Pal[];
|
||||
extern const u32 gPokedexMenu_Gfx[];
|
||||
@ -4005,7 +4005,7 @@ extern const u32 gBerryPalette_Starf[];
|
||||
extern const u32 gBerryPic_Enigma[];
|
||||
extern const u32 gBerryPalette_Enigma[];
|
||||
|
||||
//pokenav
|
||||
//PokéNav
|
||||
extern const u16 gPokenavCondition_Pal[];
|
||||
extern const u32 gPokenavCondition_Gfx[];
|
||||
extern const u32 gPokenavCondition_Tilemap[];
|
||||
@ -4879,11 +4879,11 @@ extern const u16 gSlotMachineReelTimePikachu_Pal[];
|
||||
extern const u32 gBattleAnimBgTilemap_Sandstorm[];
|
||||
extern const u32 gBattleAnimBgImage_Sandstorm[];
|
||||
|
||||
// Pokedex Area Screen
|
||||
// Pokédex Area Screen
|
||||
extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[];
|
||||
extern const u16 gPokedexAreaScreenAreaUnknown_Pal[];
|
||||
|
||||
// Pokemon Storage System
|
||||
// Pokémon Storage System
|
||||
extern const u32 gStorageSystemMenu_Gfx[];
|
||||
extern const u16 gStorageSystemPartyMenu_Pal[];
|
||||
extern const u32 gStorageSystemPartyMenu_Tilemap[];
|
||||
@ -5011,7 +5011,7 @@ extern const u32 gBerryCrush_Crusher_Gfx[];
|
||||
extern const u16 gBerryCrush_Crusher_Pal[];
|
||||
extern const u32 gBerryCrush_TextWindows_Tilemap[];
|
||||
|
||||
// Pokenav
|
||||
// PokéNav
|
||||
extern const u32 gPokenavMessageBox_Gfx[];
|
||||
extern const u32 gPokenavMessageBox_Tilemap[];
|
||||
extern const u16 gPokenavMessageBox_Pal[];
|
||||
|
||||
@ -203,7 +203,8 @@ struct BoxPokemon
|
||||
u8 isBadEgg:1;
|
||||
u8 hasSpecies:1;
|
||||
u8 isEgg:1;
|
||||
u8 unused:5;
|
||||
u8 blockBoxRS:1; // Unused, but Pokémon Box Ruby & Sapphire will refuse to deposit a Pokémon with this flag set
|
||||
u8 unused:4;
|
||||
u8 otName[PLAYER_NAME_LENGTH];
|
||||
u8 markings;
|
||||
u16 checksum;
|
||||
|
||||
@ -14,7 +14,7 @@ void ShowPokemonSummaryScreenHandleDeoxys(u8 mode, struct BoxPokemon *mons, u8 m
|
||||
u8 GetMoveSlotToReplace(void);
|
||||
void SummaryScreen_SetAnimDelayTaskId(u8 taskId);
|
||||
|
||||
// The Pokemon Summary Screen can operate in different modes. Certain features,
|
||||
// The Pokémon Summary Screen can operate in different modes. Certain features,
|
||||
// such as move re-ordering, are available in the different modes.
|
||||
enum PokemonSummaryScreenMode
|
||||
{
|
||||
|
||||
@ -65,8 +65,8 @@ struct PokenavMonList
|
||||
enum
|
||||
{
|
||||
POKENAV_MODE_NORMAL, // Chosen from Start menu.
|
||||
POKENAV_MODE_FORCE_CALL_READY, // Pokenav tutorial before calling Mr. Stone
|
||||
POKENAV_MODE_FORCE_CALL_EXIT, // Pokenav tutorial after calling Mr. Stone
|
||||
POKENAV_MODE_FORCE_CALL_READY, // PokéNav tutorial before calling Mr. Stone
|
||||
POKENAV_MODE_FORCE_CALL_EXIT, // PokéNav tutorial after calling Mr. Stone
|
||||
};
|
||||
|
||||
enum
|
||||
@ -232,8 +232,8 @@ enum
|
||||
[CHECK_PAGE_INTRO_2] = gText_MatchCall##name##_Intro2}
|
||||
|
||||
|
||||
// Pokenav Function IDs
|
||||
// Indices into the LoopedTask tables for each of the main Pokenav features
|
||||
// PokéNav Function IDs
|
||||
// Indices into the LoopedTask tables for each of the main PokéNav features
|
||||
|
||||
enum RegionMapFuncIds
|
||||
{
|
||||
|
||||
@ -9,6 +9,10 @@
|
||||
#define SIIRTCINFO_24HOUR 0x40 // 0: 12-hour mode, 1: 24-hour mode
|
||||
#define SIIRTCINFO_POWER 0x80 // power on or power failure occurred
|
||||
|
||||
#define HOURS_PER_DAY 24
|
||||
#define MINUTES_PER_HOUR 60
|
||||
#define SECONDS_PER_MINUTE 60
|
||||
|
||||
enum
|
||||
{
|
||||
MONTH_JAN = 1,
|
||||
@ -22,7 +26,8 @@ enum
|
||||
MONTH_SEP,
|
||||
MONTH_OCT,
|
||||
MONTH_NOV,
|
||||
MONTH_DEC
|
||||
MONTH_DEC,
|
||||
MONTH_COUNT = MONTH_DEC
|
||||
};
|
||||
|
||||
struct SiiRtcInfo
|
||||
|
||||
@ -519,7 +519,7 @@ extern const u8 gText_Speed[];
|
||||
extern const u8 gText_Dash[];
|
||||
extern const u8 gText_Plus[];
|
||||
|
||||
//pokedex text
|
||||
//Pokédex text
|
||||
extern const u8 gText_CryOf[];
|
||||
extern const u8 gText_SizeComparedTo[];
|
||||
extern const u8 gText_PokedexRegistration[];
|
||||
@ -1121,7 +1121,7 @@ extern const u8 gTrickHouse_Mechadoll_Six2[];
|
||||
extern const u8 gTrickHouse_Mechadoll_Seven2[];
|
||||
extern const u8 gTrickHouse_Mechadoll_Eight2[];
|
||||
|
||||
// Pokedex strings
|
||||
// Pokédex strings
|
||||
extern const u8 gText_SearchForPkmnBasedOnParameters[];
|
||||
extern const u8 gText_SwitchPokedexListings[];
|
||||
extern const u8 gText_ReturnToPokedex[];
|
||||
@ -2874,7 +2874,7 @@ extern const u8 gText_WantToPlayAgain[];
|
||||
extern const u8 gText_CommunicationStandby3[];
|
||||
extern const u8 gText_SomeoneDroppedOut[];
|
||||
|
||||
// Pokemon jump
|
||||
// Pokémon jump
|
||||
extern const u8 gText_WantToPlayAgain2[];
|
||||
extern const u8 gText_SomeoneDroppedOut2[];
|
||||
extern const u8 gText_CommunicationStandby4[];
|
||||
@ -2949,7 +2949,7 @@ extern const u8 gText_CutenessContest[];
|
||||
extern const u8 gText_SmartnessContest[];
|
||||
extern const u8 gText_ToughnessContest[];
|
||||
|
||||
// Pokenav Match Call
|
||||
// PokéNav Match Call
|
||||
extern const u8 gText_CallCantBeMadeHere[];
|
||||
extern const u8 gText_NumberRegistered[];
|
||||
extern const u8 gText_NumberOfBattles[];
|
||||
@ -2959,7 +2959,7 @@ extern const u8 gText_Call[];
|
||||
extern const u8 gText_Check[];
|
||||
extern const u8 gText_Cancel6[];
|
||||
|
||||
// Pokenav Menu Handler
|
||||
// PokéNav Menu Handler
|
||||
extern const u8 gText_CheckMapOfHoenn[];
|
||||
extern const u8 gText_CheckPokemonInDetail[];
|
||||
extern const u8 gText_CallRegisteredTrainer[];
|
||||
@ -2976,7 +2976,7 @@ extern const u8 gText_FindToughPokemon[];
|
||||
extern const u8 gText_ReturnToConditionMenu[];
|
||||
extern const u8 gText_NoRibbonWinners[];
|
||||
|
||||
// Pokenav
|
||||
// PokéNav
|
||||
extern const u8 gText_NumberIndex[];
|
||||
extern const u8 gText_RibbonsF700[];
|
||||
|
||||
|
||||
@ -3,19 +3,21 @@ ENTRY(Start)
|
||||
gNumMusicPlayers = 4;
|
||||
gMaxLines = 0;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K
|
||||
IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K
|
||||
ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M
|
||||
}
|
||||
|
||||
/* Modify the following load addresses as needed to make more room. Alternately, delete both the
|
||||
declarations below and their references further down to get rid of the gaps. */
|
||||
|
||||
SECTIONS {
|
||||
. = 0x2000000;
|
||||
|
||||
ewram (NOLOAD) :
|
||||
ewram 0x2000000 (NOLOAD) :
|
||||
ALIGN(4)
|
||||
{
|
||||
gHeap = .;
|
||||
|
||||
. = 0x1C000;
|
||||
|
||||
INCLUDE "sym_ewram.ld"
|
||||
src/*.o(ewram_data);
|
||||
gflib/*.o(ewram_data);
|
||||
@ -23,12 +25,9 @@ SECTIONS {
|
||||
*libc.a:impure.o(.data);
|
||||
*libc.a:locale.o(.data);
|
||||
*libc.a:mallocr.o(.data);
|
||||
. = 0x40000;
|
||||
}
|
||||
} > EWRAM
|
||||
|
||||
. = 0x3000000;
|
||||
|
||||
iwram (NOLOAD) :
|
||||
iwram 0x3000000 (NOLOAD) :
|
||||
ALIGN(4)
|
||||
{
|
||||
/* .bss starts at 0x3000000 */
|
||||
@ -43,10 +42,9 @@ SECTIONS {
|
||||
/* COMMON starts at 0x30022A8 */
|
||||
INCLUDE "sym_common.ld"
|
||||
*libc.a:sbrkr.o(COMMON);
|
||||
end = .;
|
||||
. = 0x8000;
|
||||
}
|
||||
} > IWRAM
|
||||
|
||||
/* BEGIN ROM DATA */
|
||||
. = 0x8000000;
|
||||
|
||||
.text :
|
||||
@ -341,7 +339,7 @@ SECTIONS {
|
||||
src/gym_leader_rematch.o(.text);
|
||||
src/battle_transition_frontier.o(.text);
|
||||
src/international_string_util.o(.text);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
script_data :
|
||||
ALIGN(4)
|
||||
@ -354,7 +352,7 @@ SECTIONS {
|
||||
data/battle_ai_scripts.o(script_data);
|
||||
data/contest_ai_scripts.o(script_data);
|
||||
data/mystery_event_script_cmd_table.o(script_data);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
lib_text :
|
||||
ALIGN(4)
|
||||
@ -438,7 +436,7 @@ SECTIONS {
|
||||
*libc.a:libcfunc.o(.text);
|
||||
*libc.a:lseekr.o(.text);
|
||||
*libc.a:readr.o(.text);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
.rodata :
|
||||
ALIGN(4)
|
||||
@ -704,7 +702,7 @@ SECTIONS {
|
||||
data/mystery_gift.o(.rodata);
|
||||
src/m4a_tables.o(.rodata);
|
||||
data/sound_data.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
song_data :
|
||||
ALIGN(4)
|
||||
@ -1239,7 +1237,7 @@ SECTIONS {
|
||||
sound/songs/midi/ph_nurse_blend.o(.rodata);
|
||||
sound/songs/midi/ph_nurse_held.o(.rodata);
|
||||
sound/songs/midi/ph_nurse_solo.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
lib_rodata :
|
||||
SUBALIGN(4)
|
||||
@ -1292,7 +1290,7 @@ SECTIONS {
|
||||
*libc.a:lseekr.o(.rodata);
|
||||
*libc.a:readr.o(.rodata);
|
||||
src/libisagbprn.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
multiboot_data :
|
||||
ALIGN(4)
|
||||
@ -1300,19 +1298,19 @@ SECTIONS {
|
||||
data/multiboot_ereader.o(.rodata);
|
||||
data/multiboot_berry_glitch_fix.o(.rodata);
|
||||
data/multiboot_pokemon_colosseum.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
anim_mon_front_pic_data :
|
||||
ALIGN(4)
|
||||
{
|
||||
src/anim_mon_front_pics.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
gfx_data :
|
||||
ALIGN(4)
|
||||
{
|
||||
src/graphics.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
extra :
|
||||
ALIGN(4)
|
||||
@ -1322,7 +1320,7 @@ SECTIONS {
|
||||
src/*.o(.rodata);
|
||||
gflib/*.o(.rodata);
|
||||
data/*.o(.rodata);
|
||||
} = 0
|
||||
} > ROM = 0
|
||||
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to the beginning
|
||||
@ -3,46 +3,40 @@ ENTRY(Start)
|
||||
gNumMusicPlayers = 4;
|
||||
gMaxLines = 0;
|
||||
|
||||
SECTIONS {
|
||||
. = 0x2000000;
|
||||
|
||||
ewram (NOLOAD) :
|
||||
ALIGN(4)
|
||||
{
|
||||
gHeap = .;
|
||||
|
||||
. = 0x1C000;
|
||||
|
||||
src/*.o(ewram_data);
|
||||
gflib/*.o(ewram_data);
|
||||
|
||||
. = 0x40000;
|
||||
MEMORY
|
||||
{
|
||||
EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K
|
||||
IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K
|
||||
ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M
|
||||
}
|
||||
|
||||
. = 0x3000000;
|
||||
SECTIONS {
|
||||
|
||||
iwram (NOLOAD) :
|
||||
ewram 0x2000000 (NOLOAD) :
|
||||
ALIGN(4)
|
||||
{
|
||||
src/*.o(ewram_data);
|
||||
gflib/*.o(ewram_data);
|
||||
} > EWRAM
|
||||
|
||||
iwram 0x3000000 (NOLOAD) :
|
||||
ALIGN(4)
|
||||
{
|
||||
/* .bss starts at 0x3000000 */
|
||||
src/*.o(.bss);
|
||||
gflib/*.o(.bss);
|
||||
data/*.o(.bss);
|
||||
*libc.a:*.o(.bss*);
|
||||
*libnosys.a:*.o(.bss*);
|
||||
|
||||
/* .bss.code starts at 0x3001AA8 */
|
||||
src/m4a.o(.bss.code);
|
||||
|
||||
/* COMMON starts at 0x30022A8 */
|
||||
src/*.o(COMMON);
|
||||
gflib/*.o(COMMON);
|
||||
*libc.a:*.o(COMMON);
|
||||
*libnosys.a:*.o(COMMON);
|
||||
end = .;
|
||||
. = 0x8000;
|
||||
}
|
||||
} > IWRAM
|
||||
|
||||
/* BEGIN ROM DATA */
|
||||
. = 0x8000000;
|
||||
|
||||
.text :
|
||||
@ -55,13 +49,13 @@ SECTIONS {
|
||||
gflib/*.o(.text*);
|
||||
src/*.o(.text*);
|
||||
asm/*.o(.text*);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
script_data :
|
||||
ALIGN(4)
|
||||
{
|
||||
data/*.o(script_data);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
lib_text :
|
||||
ALIGN(4)
|
||||
@ -82,7 +76,7 @@ SECTIONS {
|
||||
*libc.a:*.o(.text*);
|
||||
*libnosys.a:*.o(.text*);
|
||||
src/libisagbprn.o(.text);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
.rodata :
|
||||
ALIGN(4)
|
||||
@ -90,13 +84,13 @@ SECTIONS {
|
||||
src/*.o(.rodata*);
|
||||
gflib/*.o(.rodata*);
|
||||
data/*.o(.rodata*);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
song_data :
|
||||
ALIGN(4)
|
||||
{
|
||||
sound/songs/*.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
lib_rodata :
|
||||
SUBALIGN(4)
|
||||
@ -121,19 +115,19 @@ SECTIONS {
|
||||
data/multiboot_ereader.o(.rodata);
|
||||
data/multiboot_berry_glitch_fix.o(.rodata);
|
||||
data/multiboot_pokemon_colosseum.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
anim_mon_front_pic_data :
|
||||
ALIGN(4)
|
||||
{
|
||||
src/anim_mon_front_pics.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
gfx_data :
|
||||
ALIGN(4)
|
||||
{
|
||||
src/graphics.o(.rodata);
|
||||
} =0
|
||||
} > ROM =0
|
||||
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to the beginning
|
||||
@ -229,7 +229,7 @@ u8 rfu_LMAN_CHILD_connectParent(u16 parentId, u16 connect_period)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rfu_LMAN_PARENT_stopWaitLinkRecoveryAndDisconnect(u8 bm_targetSlot)
|
||||
static void UNUSED rfu_LMAN_PARENT_stopWaitLinkRecoveryAndDisconnect(u8 bm_targetSlot)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
@ -1295,7 +1295,7 @@ void rfu_LMAN_setMSCCallback(void (*MSC_callback_p)(u16))
|
||||
rfu_setMSCCallback(rfu_LMAN_MSC_callback);
|
||||
}
|
||||
|
||||
static void rfu_LMAN_setLMANCallback(void (*func)(u8, u8))
|
||||
static void UNUSED rfu_LMAN_setLMANCallback(void (*func)(u8, u8))
|
||||
{
|
||||
lman.LMAN_callback = func;
|
||||
}
|
||||
@ -1315,7 +1315,7 @@ u8 rfu_LMAN_setLinkRecovery(u8 enable_flag, u16 recovery_period)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u8 rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
|
||||
static u8 UNUSED rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
|
||||
{
|
||||
if (gRfuLinkStatus->sendSlotNIFlag | gRfuLinkStatus->recvSlotNIFlag)
|
||||
{
|
||||
@ -1327,7 +1327,7 @@ static u8 rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u8 rfu_LMAN_setFastSearchParent(u8 enable_flag)
|
||||
static u8 UNUSED rfu_LMAN_setFastSearchParent(u8 enable_flag)
|
||||
{
|
||||
if (lman.state == LMAN_STATE_START_SEARCH_PARENT || lman.state == LMAN_STATE_POLL_SEARCH_PARENT || lman.state == LMAN_STATE_END_SEARCH_PARENT)
|
||||
{
|
||||
|
||||
@ -123,7 +123,7 @@ const u32 gMonFrontPic_Goldeen[] = INCBIN_U32("graphics/pokemon/goldeen/anim_fro
|
||||
const u32 gMonFrontPic_Seaking[] = INCBIN_U32("graphics/pokemon/seaking/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Staryu[] = INCBIN_U32("graphics/pokemon/staryu/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Starmie[] = INCBIN_U32("graphics/pokemon/starmie/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Mrmime[] = INCBIN_U32("graphics/pokemon/mr_mime/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_MrMime[] = INCBIN_U32("graphics/pokemon/mr_mime/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Scyther[] = INCBIN_U32("graphics/pokemon/scyther/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Jynx[] = INCBIN_U32("graphics/pokemon/jynx/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Electabuzz[] = INCBIN_U32("graphics/pokemon/electabuzz/anim_front.4bpp.lz");
|
||||
|
||||
@ -623,6 +623,9 @@ static void CreateApprenticeMenu(u8 menu)
|
||||
default:
|
||||
left = 0;
|
||||
top = 0;
|
||||
#ifdef UBFIX
|
||||
return;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1278,8 +1281,7 @@ const u8 *GetApprenticeNameInLanguage(u32 apprenticeId, s32 language)
|
||||
}
|
||||
}
|
||||
|
||||
// Functionally unused
|
||||
static void Task_SwitchToFollowupFuncAfterButtonPress(u8 taskId)
|
||||
static void UNUSED Task_SwitchToFollowupFuncAfterButtonPress(u8 taskId)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON))
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
@ -1302,8 +1304,7 @@ static void ExecuteFuncAfterButtonPress(void (*func)(void))
|
||||
gTasks[taskId].data[1] = (u32)(func) >> 16;
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void ExecuteFollowupFuncAfterButtonPress(TaskFunc task)
|
||||
static void UNUSED ExecuteFollowupFuncAfterButtonPress(TaskFunc task)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_SwitchToFollowupFuncAfterButtonPress, 1);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_SwitchToFollowupFuncAfterButtonPress, task);
|
||||
|
||||
@ -1392,7 +1392,7 @@ static void Cmd_get_ability(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1.
|
||||
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no Pokémon has ability 2 and no ability 1.
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1445,7 +1445,7 @@ static void Cmd_check_ability(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1.
|
||||
ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no Pokémon has ability 2 and no ability 1.
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1457,9 +1457,9 @@ static void Cmd_check_ability(void)
|
||||
if (ability == 0)
|
||||
AI_THINKING_STRUCT->funcResult = 2; // Unable to answer.
|
||||
else if (ability == gAIScriptPtr[2])
|
||||
AI_THINKING_STRUCT->funcResult = 1; // Pokemon has the ability we wanted to check.
|
||||
AI_THINKING_STRUCT->funcResult = 1; // Pokémon has the ability we wanted to check.
|
||||
else
|
||||
AI_THINKING_STRUCT->funcResult = 0; // Pokemon doesn't have the ability we wanted to check.
|
||||
AI_THINKING_STRUCT->funcResult = 0; // Pokémon doesn't have the ability we wanted to check.
|
||||
|
||||
gAIScriptPtr += 3;
|
||||
}
|
||||
@ -1484,7 +1484,13 @@ static void Cmd_get_highest_type_effectiveness(void)
|
||||
|
||||
if (gCurrentMove != MOVE_NONE)
|
||||
{
|
||||
// TypeCalc does not assign to gMoveResultFlags, Cmd_typecalc does
|
||||
// This makes the check for gMoveResultFlags below always fail
|
||||
#ifdef BUGFIX
|
||||
gMoveResultFlags = TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
|
||||
#else
|
||||
TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
|
||||
#endif
|
||||
|
||||
if (gBattleMoveDamage == 120) // Super effective STAB.
|
||||
gBattleMoveDamage = AI_EFFECTIVENESS_x2;
|
||||
@ -1519,7 +1525,16 @@ static void Cmd_if_type_effectiveness(void)
|
||||
gBattleMoveDamage = AI_EFFECTIVENESS_x1;
|
||||
gCurrentMove = AI_THINKING_STRUCT->moveConsidered;
|
||||
|
||||
// TypeCalc does not assign to gMoveResultFlags, Cmd_typecalc does
|
||||
// This makes the check for gMoveResultFlags below always fail
|
||||
// This is how you get the "dual non-immunity" glitch, where AI
|
||||
// will use ineffective moves on immune pokémon if the second type
|
||||
// has a non-neutral, non-immune effectiveness
|
||||
#ifdef BUGFIX
|
||||
gMoveResultFlags = TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
|
||||
#else
|
||||
TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
|
||||
#endif
|
||||
|
||||
if (gBattleMoveDamage == 120) // Super effective STAB.
|
||||
gBattleMoveDamage = AI_EFFECTIVENESS_x2;
|
||||
@ -2252,7 +2267,7 @@ static void AIStackPushVar(const u8 *var)
|
||||
gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size++] = var;
|
||||
}
|
||||
|
||||
static void AIStackPushVar_cursor(void)
|
||||
static void UNUSED AIStackPushVar_cursor(void)
|
||||
{
|
||||
gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size++] = gAIScriptPtr;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
|
||||
if (gBattleMons[GetBattlerAtPosition(opposingPosition)].ability != ABILITY_WONDER_GUARD)
|
||||
return FALSE;
|
||||
|
||||
// Check if Pokemon has a super effective move.
|
||||
// Check if Pokémon has a super effective move.
|
||||
for (opposingBattler = GetBattlerAtPosition(opposingPosition), i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
move = gBattleMons[gActiveBattler].moves[i];
|
||||
@ -81,7 +81,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
|
||||
else
|
||||
party = gEnemyParty;
|
||||
|
||||
// Find a Pokemon in the party that has a super effective move.
|
||||
// Find a Pokémon in the party that has a super effective move.
|
||||
for (i = firstId; i < lastId; i++)
|
||||
{
|
||||
if (GetMonData(&party[i], MON_DATA_HP) == 0)
|
||||
@ -113,7 +113,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE; // There is not a single Pokemon in the party that has a super effective move against a mon with Wonder Guard.
|
||||
return FALSE; // There is not a single Pokémon in the party that has a super effective move against a mon with Wonder Guard.
|
||||
}
|
||||
|
||||
static bool8 FindMonThatAbsorbsOpponentsMove(void)
|
||||
|
||||
@ -443,7 +443,7 @@ static void AnimMissileArc_Step(struct Sprite *sprite)
|
||||
else
|
||||
{
|
||||
s16 tempData[8];
|
||||
u16 *data = sprite->data;
|
||||
s16 *data = sprite->data;
|
||||
u16 x1 = sprite->x;
|
||||
s16 x2 = sprite->x2;
|
||||
u16 y1 = sprite->y;
|
||||
|
||||
@ -2765,7 +2765,7 @@ static void AnimConstrictBinding(struct Sprite *sprite)
|
||||
|
||||
static void AnimConstrictBinding_Step1(struct Sprite *sprite)
|
||||
{
|
||||
u8 spriteId;
|
||||
u8 UNUSED spriteId;
|
||||
|
||||
if ((u16)gBattleAnimArgs[7] == 0xFFFF)
|
||||
{
|
||||
@ -2778,7 +2778,7 @@ static void AnimConstrictBinding_Step1(struct Sprite *sprite)
|
||||
|
||||
static void AnimConstrictBinding_Step2(struct Sprite *sprite)
|
||||
{
|
||||
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
|
||||
u8 UNUSED spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
|
||||
if (!sprite->data[2])
|
||||
sprite->data[0] += 11;
|
||||
else
|
||||
@ -3884,7 +3884,7 @@ static void AnimSlice_Step(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void UnusedFlickerAnim(struct Sprite *sprite)
|
||||
static void UNUSED UnusedFlickerAnim(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[2] > 1)
|
||||
{
|
||||
@ -4734,7 +4734,7 @@ static void AnimFalseSwipeSlice(struct Sprite *sprite)
|
||||
|
||||
static void AnimFalseSwipePositionedSlice(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x = sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + 0xFFD0 + gBattleAnimArgs[0];
|
||||
sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) - 48 + gBattleAnimArgs[0];
|
||||
sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
|
||||
StartSpriteAnim(sprite, 1);
|
||||
sprite->data[0] = 0;
|
||||
@ -4917,8 +4917,7 @@ void AnimTask_Conversion2AlphaBlend(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void AnimTask_HideBattlersHealthbox(u8 taskId)
|
||||
static void UNUSED AnimTask_HideBattlersHealthbox(u8 taskId)
|
||||
{
|
||||
u8 i;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
@ -4933,8 +4932,7 @@ static void AnimTask_HideBattlersHealthbox(u8 taskId)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void AnimTask_ShowBattlersHealthbox(u8 taskId)
|
||||
static void UNUSED AnimTask_ShowBattlersHealthbox(u8 taskId)
|
||||
{
|
||||
u8 i;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
|
||||
@ -2551,8 +2551,8 @@ static void AnimPencil_Step(struct Sprite *sprite)
|
||||
static void AnimBlendThinRing(struct Sprite *sprite)
|
||||
{
|
||||
u8 battler = 0;
|
||||
u16 sp0 = 0;
|
||||
u16 sp1 = 0;
|
||||
s16 x = 0;
|
||||
s16 y = 0;
|
||||
u8 r4;
|
||||
|
||||
if (gBattleAnimArgs[2] == 0)
|
||||
@ -2563,16 +2563,16 @@ static void AnimBlendThinRing(struct Sprite *sprite)
|
||||
r4 = gBattleAnimArgs[3] ^ 1;
|
||||
if (IsDoubleBattle() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler)))
|
||||
{
|
||||
SetAverageBattlerPositions(battler, r4, &sp0, &sp1);
|
||||
SetAverageBattlerPositions(battler, r4, &x, &y);
|
||||
if (r4 == 0)
|
||||
r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X);
|
||||
else
|
||||
r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2);
|
||||
|
||||
if (GetBattlerSide(battler) != B_SIDE_PLAYER)
|
||||
gBattleAnimArgs[0] -= (sp0 - r4) - gBattleAnimArgs[0]; // This is weird.
|
||||
gBattleAnimArgs[0] -= (x - r4) - gBattleAnimArgs[0]; // This is weird.
|
||||
else
|
||||
gBattleAnimArgs[0] = sp0 - r4;
|
||||
gBattleAnimArgs[0] = x - r4;
|
||||
}
|
||||
|
||||
sprite->callback = AnimSpriteOnMonPos;
|
||||
|
||||
@ -1428,8 +1428,7 @@ static void FadeScreenToWhite_Step(u8 taskId)
|
||||
|
||||
static void AnimSpikes(struct Sprite *sprite)
|
||||
{
|
||||
u16 x;
|
||||
u16 y;
|
||||
s16 x, y;
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y);
|
||||
@ -4758,8 +4757,8 @@ static void AnimMeteorMashStar_Step(struct Sprite *sprite)
|
||||
// arg 4: duration
|
||||
static void AnimMeteorMashStar(struct Sprite *sprite)
|
||||
{
|
||||
s16 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); // unused local variable
|
||||
s16 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); // unused local variable
|
||||
s16 UNUSED y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
|
||||
s16 UNUSED x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
|
||||
|
||||
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER || IsContest())
|
||||
{
|
||||
|
||||
@ -1220,8 +1220,7 @@ void AnimSkyAttackBird_Step(struct Sprite *sprite)
|
||||
DestroySpriteAndMatrix(sprite);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void AnimTask_SetAttackerVisibility(u8 taskId)
|
||||
static void UNUSED AnimTask_SetAttackerVisibility(u8 taskId)
|
||||
{
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
{
|
||||
|
||||
@ -535,7 +535,7 @@ static void SlideMonToOriginalPos_Step(struct Sprite *sprite)
|
||||
}
|
||||
|
||||
// Linearly translates a mon to a target offset. The horizontal offset
|
||||
// is mirrored for the opponent's pokemon, and the vertical offset
|
||||
// is mirrored for the opponent's Pokémon, and the vertical offset
|
||||
// is only mirrored if arg 3 is set to 1.
|
||||
// arg 0: 0 = attacker, 1 = target
|
||||
// arg 1: target x pixel offset
|
||||
|
||||
@ -77,7 +77,7 @@ static const u8 sCastformBackSpriteYCoords[NUM_CASTFORM_FORMS] =
|
||||
[CASTFORM_ICE] = 0,
|
||||
};
|
||||
|
||||
// Placeholders for pokemon sprites to be created for a move animation effect (e.g. Role Play / Snatch)
|
||||
// Placeholders for Pokémon sprites to be created for a move animation effect (e.g. Role Play / Snatch)
|
||||
#define TAG_MOVE_EFFECT_MON_1 55125
|
||||
#define TAG_MOVE_EFFECT_MON_2 55126
|
||||
|
||||
@ -485,9 +485,8 @@ void TranslateSpriteInGrowingCircle(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
// Exact shape depends on arguments. Can move in a figure-8-like pattern, or circular, etc.
|
||||
static void TranslateSpriteInLissajousCurve(struct Sprite *sprite)
|
||||
static void UNUSED TranslateSpriteInLissajousCurve(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->sDuration)
|
||||
{
|
||||
@ -639,8 +638,7 @@ static void TranslateSpriteLinearFixedPointIconFrame(struct Sprite *sprite)
|
||||
UpdateMonIconFrame(sprite);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void TranslateSpriteToBattleTargetPos(struct Sprite *sprite)
|
||||
static void UNUSED TranslateSpriteToBattleTargetPos(struct Sprite *sprite)
|
||||
{
|
||||
sprite->sStartX = sprite->x + sprite->x2;
|
||||
sprite->sStartY = sprite->y + sprite->y2;
|
||||
@ -707,8 +705,7 @@ void DestroySpriteAndMatrix(struct Sprite *sprite)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
|
||||
static void UNUSED TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
|
||||
{
|
||||
sprite->sStartX = sprite->x + sprite->x2;
|
||||
sprite->sStartY = sprite->y + sprite->y2;
|
||||
@ -723,8 +720,7 @@ static void TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
|
||||
#undef sStartY
|
||||
#undef sTargetY
|
||||
|
||||
// Unused
|
||||
static void EndUnkPaletteAnim(struct Sprite *sprite)
|
||||
static void UNUSED EndUnkPaletteAnim(struct Sprite *sprite)
|
||||
{
|
||||
PaletteStruct_ResetById(sprite->data[5]);
|
||||
DestroySpriteAndMatrix(sprite);
|
||||
@ -1103,8 +1099,7 @@ void StartAnimLinearTranslation(struct Sprite *sprite)
|
||||
sprite->callback(sprite);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void StartAnimLinearTranslation_SetCornerVecX(struct Sprite *sprite)
|
||||
static void UNUSED StartAnimLinearTranslation_SetCornerVecX(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[1] = sprite->x;
|
||||
sprite->data[3] = sprite->y;
|
||||
@ -1512,8 +1507,7 @@ u8 GetSpritePalIdxByBattler(u8 battler)
|
||||
return battler;
|
||||
}
|
||||
|
||||
// Unused
|
||||
static u8 GetSpritePalIdxByPosition(u8 position)
|
||||
static u8 UNUSED GetSpritePalIdxByPosition(u8 position)
|
||||
{
|
||||
return GetBattlerAtPosition(position);
|
||||
}
|
||||
@ -2012,8 +2006,7 @@ void AnimTask_GetFrustrationPowerLevel(u8 taskId)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void SetPriorityForVisibleBattlers(u8 priority)
|
||||
static void UNUSED SetPriorityForVisibleBattlers(u8 priority)
|
||||
{
|
||||
if (IsBattlerSpriteVisible(gBattleAnimTarget))
|
||||
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].oam.priority = priority;
|
||||
@ -2092,7 +2085,7 @@ u8 GetBattlerSpriteBGPriorityRank(u8 battlerId)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Create pokemon sprite to be used for a move animation effect (e.g. Role Play / Snatch)
|
||||
// Create Pokémon sprite to be used for a move animation effect (e.g. Role Play / Snatch)
|
||||
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm)
|
||||
{
|
||||
u8 spriteId;
|
||||
|
||||
@ -270,8 +270,7 @@ static const struct SpriteTemplate sFlashingCircleImpactSpriteTemplate =
|
||||
.callback = AnimFlashingCircleImpact,
|
||||
};
|
||||
|
||||
// Unused
|
||||
static u8 Task_FlashingCircleImpacts(u8 battlerId, bool8 red)
|
||||
static u8 UNUSED Task_FlashingCircleImpacts(u8 battlerId, bool8 red)
|
||||
{
|
||||
u8 battlerSpriteId = gBattlerSpriteIds[battlerId];
|
||||
u8 taskId = CreateTask(Task_UpdateFlashingCircleImpacts, 10);
|
||||
|
||||
@ -2386,11 +2386,11 @@ static void SpriteCB_ShinyStars_Diagonal(struct Sprite *sprite)
|
||||
|
||||
void AnimTask_LoadPokeblockGfx(u8 taskId)
|
||||
{
|
||||
u8 paletteIndex;
|
||||
u8 UNUSED paletteIndex;
|
||||
|
||||
LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[ANIM_TAG_POKEBLOCK - ANIM_SPRITES_START]);
|
||||
LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[ANIM_TAG_POKEBLOCK - ANIM_SPRITES_START]);
|
||||
paletteIndex = IndexOfSpritePaletteTag(ANIM_TAG_POKEBLOCK); // unused
|
||||
paletteIndex = IndexOfSpritePaletteTag(ANIM_TAG_POKEBLOCK);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
|
||||
@ -69,6 +69,9 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
|
||||
selectedPalettes = 0;
|
||||
// fall through
|
||||
case ANIM_ATTACKER:
|
||||
#ifdef UBFIX
|
||||
default:
|
||||
#endif
|
||||
animBattlers[0] = gBattleAnimAttacker;
|
||||
break;
|
||||
case 3:
|
||||
@ -806,7 +809,7 @@ void AnimTask_SetAllNonAttackersInvisiblity(u8 taskId)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
void StartMonScrollingBgMask(u8 taskId, int unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette)
|
||||
void StartMonScrollingBgMask(u8 taskId, int UNUSED unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette)
|
||||
{
|
||||
u16 species;
|
||||
u8 spriteId, spriteId2;
|
||||
|
||||
@ -651,8 +651,7 @@ void BattleArena_DeductSkillPoints(u8 battler, u16 stringId)
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void UpdateHPAtStart(u8 battler)
|
||||
static void UNUSED UpdateHPAtStart(u8 battler)
|
||||
{
|
||||
u16 *hpAtStart = gBattleStruct->arenaStartHp;
|
||||
|
||||
|
||||
@ -692,9 +692,9 @@ static const struct BattleBackground sBattleTerrainTable[] =
|
||||
},
|
||||
};
|
||||
|
||||
static void CB2_UnusedBattleInit(void);
|
||||
static void UNUSED CB2_UnusedBattleInit(void);
|
||||
|
||||
static void UnusedBattleInit(void)
|
||||
static void UNUSED UnusedBattleInit(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
|
||||
@ -704,7 +704,7 @@ static void UnusedBattleInit(void)
|
||||
SetMainCallback2(CB2_UnusedBattleInit);
|
||||
}
|
||||
|
||||
static void CB2_UnusedBattleInit(void)
|
||||
static void UNUSED CB2_UnusedBattleInit(void)
|
||||
{
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
|
||||
@ -529,7 +529,7 @@ static void LinkOpponentBufferExecCompleted(void)
|
||||
|
||||
static void LinkOpponentHandleGetMonData(void)
|
||||
{
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
|
||||
u32 size = 0;
|
||||
u8 monToCheck;
|
||||
s32 i;
|
||||
|
||||
@ -423,7 +423,7 @@ static void CompleteOnFinishedBattleAnimation(void)
|
||||
|
||||
static void LinkPartnerHandleGetMonData(void)
|
||||
{
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
|
||||
u32 size = 0;
|
||||
u8 monToCheck;
|
||||
s32 i;
|
||||
|
||||
@ -534,7 +534,7 @@ static void OpponentBufferExecCompleted(void)
|
||||
|
||||
static void OpponentHandleGetMonData(void)
|
||||
{
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
|
||||
u32 size = 0;
|
||||
u8 monToCheck;
|
||||
s32 i;
|
||||
|
||||
@ -330,7 +330,7 @@ static void HandleInputChooseAction(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void UnusedEndBounceEffect(void)
|
||||
static void UNUSED UnusedEndBounceEffect(void)
|
||||
{
|
||||
EndBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX);
|
||||
EndBounceEffect(gActiveBattler, BOUNCE_MON);
|
||||
@ -615,7 +615,7 @@ static void HandleInputChooseMove(void)
|
||||
}
|
||||
}
|
||||
|
||||
static u32 HandleMoveInputUnused(void)
|
||||
static u32 UNUSED HandleMoveInputUnused(void)
|
||||
{
|
||||
u32 var = 0;
|
||||
|
||||
@ -982,12 +982,12 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
bool32 bgmRestored = FALSE;
|
||||
bool32 battlerAnimsDone = FALSE;
|
||||
|
||||
// Start shiny animation if applicable for 1st pokemon
|
||||
// Start shiny animation if applicable for 1st Pokémon
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
|
||||
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
|
||||
// Start shiny animation if applicable for 2nd pokemon
|
||||
// Start shiny animation if applicable for 2nd Pokémon
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
|
||||
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
@ -1582,7 +1582,7 @@ static void PrintLinkStandbyMsg(void)
|
||||
|
||||
static void PlayerHandleGetMonData(void)
|
||||
{
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
|
||||
u32 size = 0;
|
||||
u8 monToCheck;
|
||||
s32 i;
|
||||
|
||||
@ -607,7 +607,7 @@ static void CompleteOnFinishedBattleAnimation(void)
|
||||
|
||||
static void PlayerPartnerHandleGetMonData(void)
|
||||
{
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
|
||||
u32 size = 0;
|
||||
u8 monToCheck;
|
||||
s32 i;
|
||||
|
||||
@ -186,7 +186,7 @@ static void CompleteOnBattlerSpriteCallbackDummy(void)
|
||||
RecordedOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
static void CompleteOnBankSpriteCallbackDummy2(void)
|
||||
static void UNUSED CompleteOnBankSpriteCallbackDummy2(void)
|
||||
{
|
||||
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
|
||||
RecordedOpponentBufferExecCompleted();
|
||||
@ -515,7 +515,7 @@ static void RecordedOpponentBufferExecCompleted(void)
|
||||
|
||||
static void RecordedOpponentHandleGetMonData(void)
|
||||
{
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
|
||||
u32 size = 0;
|
||||
u8 monToCheck;
|
||||
s32 i;
|
||||
|
||||
@ -498,7 +498,7 @@ static void CompleteOnFinishedBattleAnimation(void)
|
||||
|
||||
static void RecordedPlayerHandleGetMonData(void)
|
||||
{
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
|
||||
u32 size = 0;
|
||||
u8 monToCheck;
|
||||
s32 i;
|
||||
|
||||
@ -147,7 +147,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
[CONTROLLER_TERMINATOR_NOP] = SafariCmdEnd
|
||||
};
|
||||
|
||||
static void SpriteCB_Null4(void)
|
||||
static void UNUSED SpriteCB_Null4(void)
|
||||
{
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ static void SafariBufferExecCompleted(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void CompleteOnFinishedStatusAnimation(void)
|
||||
static void UNUSED CompleteOnFinishedStatusAnimation(void)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].statusAnimActive)
|
||||
SafariBufferExecCompleted();
|
||||
|
||||
@ -161,7 +161,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
[CONTROLLER_TERMINATOR_NOP] = WallyCmdEnd
|
||||
};
|
||||
|
||||
static void SpriteCB_Null7(void)
|
||||
static void UNUSED SpriteCB_Null7(void)
|
||||
{
|
||||
}
|
||||
|
||||
@ -417,7 +417,7 @@ static void WallyBufferExecCompleted(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void CompleteOnFinishedStatusAnimation(void)
|
||||
static void UNUSED CompleteOnFinishedStatusAnimation(void)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].statusAnimActive)
|
||||
WallyBufferExecCompleted();
|
||||
@ -425,7 +425,7 @@ static void CompleteOnFinishedStatusAnimation(void)
|
||||
|
||||
static void WallyHandleGetMonData(void)
|
||||
{
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
|
||||
u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
|
||||
u32 size = 0;
|
||||
u8 monToCheck;
|
||||
s32 i;
|
||||
|
||||
@ -905,8 +905,7 @@ void BtlController_EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
|
||||
static void UNUSED BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_GETRAWMONDATA;
|
||||
sBattleBuffersTransferData[1] = monId;
|
||||
@ -927,8 +926,7 @@ void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 b
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 3 + bytes);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
|
||||
static void UNUSED BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1001,8 +999,7 @@ void BtlController_EmitFaintAnimation(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitPaletteFade(u8 bufferId)
|
||||
static void UNUSED BtlController_EmitPaletteFade(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_PALETTEFADE;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_PALETTEFADE;
|
||||
@ -1011,8 +1008,7 @@ static void BtlController_EmitPaletteFade(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
|
||||
static void UNUSED BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_SUCCESSBALLTHROWANIM;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_SUCCESSBALLTHROWANIM;
|
||||
@ -1028,8 +1024,7 @@ void BtlController_EmitBallThrowAnim(u8 bufferId, u8 caseId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
|
||||
static void UNUSED BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1188,8 +1183,7 @@ void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abili
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 8); // Only 7 bytes were written.
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitCmd23(u8 bufferId)
|
||||
static void UNUSED BtlController_EmitCmd23(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_23;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_23;
|
||||
@ -1243,8 +1237,7 @@ void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 6);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitStatusXor(u8 bufferId, u8 b)
|
||||
static void UNUSED BtlController_EmitStatusXor(u8 bufferId, u8 b)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_STATUSXOR;
|
||||
sBattleBuffersTransferData[1] = b;
|
||||
@ -1264,8 +1257,7 @@ void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 4);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
|
||||
static void UNUSED BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1281,8 +1273,7 @@ static void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, voi
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 7);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
static void UNUSED BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1297,8 +1288,7 @@ static void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, songId + 3);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
|
||||
static void UNUSED BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1348,8 +1338,7 @@ void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitClearUnkVar(u8 bufferId)
|
||||
static void UNUSED BtlController_EmitClearUnkVar(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKVAR;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKVAR;
|
||||
@ -1358,16 +1347,14 @@ static void BtlController_EmitClearUnkVar(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
|
||||
static void UNUSED BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_SETUNKVAR;
|
||||
sBattleBuffersTransferData[1] = b;
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitClearUnkFlag(u8 bufferId)
|
||||
static void UNUSED BtlController_EmitClearUnkFlag(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKFLAG;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKFLAG;
|
||||
@ -1376,8 +1363,7 @@ static void BtlController_EmitClearUnkFlag(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BtlController_EmitToggleUnkFlag(u8 bufferId)
|
||||
static void UNUSED BtlController_EmitToggleUnkFlag(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_TOGGLEUNKFLAG;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_TOGGLEUNKFLAG;
|
||||
|
||||
@ -1667,13 +1667,13 @@ static const u8 sTourneyTreePokeballCoords[DOME_TOURNAMENT_TRAINERS_COUNT + DOME
|
||||
{.tile = LINE_V_L, .y = 9, .x = 17}, \
|
||||
{.tile = LINE_V_L, .y = 10, .x = 17}, \
|
||||
{.tile = LINE_V_L_HALF_LOGO, .y = 11, .x = 17},
|
||||
|
||||
|
||||
#define LINESECTION_SEMIFINAL_BOTTOM_RIGHT \
|
||||
{.tile = LINE_V_L_LOGO4, .y = 14, .x = 17}, \
|
||||
{.tile = LINE_V_L_LOGO3, .y = 13, .x = 17}, \
|
||||
{.tile = LINE_V_L_LOGO2, .y = 12, .x = 17}, \
|
||||
{.tile = LINE_V_L_LOGO1, .y = 11, .x = 17},
|
||||
|
||||
|
||||
#define LINESECTION_FINAL_LEFT \
|
||||
{.tile = LINE_H_LOGO1, .y = 11, .x = 13}, \
|
||||
{.tile = LINE_H_LOGO2, .y = 11, .x = 14},
|
||||
@ -2588,7 +2588,7 @@ static void CreateDomeOpponentMon(u8 monPartyId, u16 tournamentTrainerId, u8 tou
|
||||
#ifdef BUGFIX
|
||||
u8 fixedIv = GetDomeTrainerMonIvs(DOME_TRAINERS[tournamentTrainerId].trainerId);
|
||||
#else
|
||||
u8 fixedIv = GetDomeTrainerMonIvs(tournamentTrainerId); // BUG: Using the wrong ID. As a result, all Pokemon have ivs of 3.
|
||||
u8 fixedIv = GetDomeTrainerMonIvs(tournamentTrainerId); // BUG: Using the wrong ID. As a result, all Pokémon have ivs of 3.
|
||||
#endif
|
||||
u8 level = SetFacilityPtrsGetLevel();
|
||||
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[monPartyId],
|
||||
@ -2650,13 +2650,13 @@ static void CreateDomeOpponentMons(u16 tournamentTrainerId)
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a bitmask representing which 2 of the trainer's 3 pokemon to select.
|
||||
// Returns a bitmask representing which 2 of the trainer's 3 Pokémon to select.
|
||||
// The choice is calculated solely depending on the type effectiveness of their
|
||||
// movesets against the player's pokemon.
|
||||
// movesets against the player's Pokémon.
|
||||
// There is a 50% chance of either a "good" or "bad" selection mode being used.
|
||||
// In the good mode movesets are preferred which are more effective against the
|
||||
// player, and in the bad mode the opposite is true. If all 3 pokemon tie, the
|
||||
// other mode will be tried. If they tie again, the pokemon selection is random.
|
||||
// player, and in the bad mode the opposite is true. If all 3 Pokémon tie, the
|
||||
// other mode will be tried. If they tie again, the Pokémon selection is random.
|
||||
int GetDomeTrainerSelectedMons(u16 tournamentTrainerId)
|
||||
{
|
||||
int selectedMonBits;
|
||||
@ -4837,7 +4837,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
if (lost[1])
|
||||
gSprites[sInfoCard->spriteIds[1 + arrId]].oam.paletteNum = 3;
|
||||
|
||||
// Draw left trainer's pokemon icons.
|
||||
// Draw left trainer's Pokémon icons.
|
||||
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
|
||||
{
|
||||
if (trainerIds[0] == TRAINER_PLAYER)
|
||||
@ -4877,7 +4877,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
}
|
||||
}
|
||||
|
||||
// Draw right trainer's pokemon icons.
|
||||
// Draw right trainer's Pokémon icons.
|
||||
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
|
||||
{
|
||||
if (trainerIds[1] == TRAINER_PLAYER)
|
||||
@ -5228,7 +5228,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
|
||||
int movePower = 0;
|
||||
SetFacilityPtrsGetLevel();
|
||||
|
||||
// Calc move points of all 4 moves for all 3 pokemon hitting all 3 target mons.
|
||||
// Calc move points of all 4 moves for all 3 Pokémon hitting all 3 target mons.
|
||||
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
|
||||
{
|
||||
for (j = 0; j < MAX_MON_MOVES; j++)
|
||||
|
||||
@ -337,7 +337,7 @@ static void GenerateOpponentMons(void)
|
||||
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
|
||||
continue;
|
||||
|
||||
// Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player
|
||||
// Ensure none of the opponent's Pokémon are the same as the potential rental Pokémon for the player
|
||||
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
|
||||
{
|
||||
if (gFacilityTrainerMons[monId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
|
||||
@ -346,7 +346,7 @@ static void GenerateOpponentMons(void)
|
||||
if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons))
|
||||
continue;
|
||||
|
||||
// "High tier" pokemon are only allowed on open level mode
|
||||
// "High tier" Pokémon are only allowed on open level mode
|
||||
if (lvlMode == FRONTIER_LVL_50 && monId > FRONTIER_MONS_HIGH_TIER)
|
||||
continue;
|
||||
|
||||
@ -554,7 +554,7 @@ static void GenerateInitialRentalMons(void)
|
||||
i = 0;
|
||||
while (i != PARTY_SIZE)
|
||||
{
|
||||
if (i < rentalRank) // The more times the player has rented, the more initial rentals are generated from a better set of pokemon
|
||||
if (i < rentalRank) // The more times the player has rented, the more initial rentals are generated from a better set of Pokémon
|
||||
monId = GetFactoryMonId(factoryLvlMode, challengeNum, TRUE);
|
||||
else
|
||||
monId = GetFactoryMonId(factoryLvlMode, challengeNum, FALSE);
|
||||
@ -562,7 +562,7 @@ static void GenerateInitialRentalMons(void)
|
||||
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
|
||||
continue;
|
||||
|
||||
// Cannot have two pokemon of the same species.
|
||||
// Cannot have two Pokémon of the same species.
|
||||
for (j = firstMonId; j < firstMonId + i; j++)
|
||||
{
|
||||
u16 existingMonId = monIds[j];
|
||||
@ -741,8 +741,15 @@ u8 GetFactoryMonFixedIV(u8 challengeNum, bool8 isLastBattle)
|
||||
u8 ivSet;
|
||||
bool8 useHigherIV = isLastBattle ? TRUE : FALSE;
|
||||
|
||||
if (challengeNum > 8)
|
||||
ivSet = 7;
|
||||
// The Factory has an out-of-bounds access when generating the rental draft for round 9 (challengeNum==8),
|
||||
// or the "elevated" rentals from round 8 (challengeNum+1==8)
|
||||
// This happens to land on a number higher than 31, which is interpreted as "random IVs"
|
||||
#ifdef BUGFIX
|
||||
if (challengeNum >= ARRAY_COUNT(sFixedIVTable))
|
||||
#else
|
||||
if (challengeNum > ARRAY_COUNT(sFixedIVTable))
|
||||
#endif
|
||||
ivSet = ARRAY_COUNT(sFixedIVTable) - 1;
|
||||
else
|
||||
ivSet = challengeNum;
|
||||
|
||||
|
||||
@ -32,15 +32,15 @@
|
||||
#include "constants/songs.h"
|
||||
#include "constants/rgb.h"
|
||||
|
||||
// Select_ refers to the first Pokemon selection screen where you choose your initial 3 rental Pokemon.
|
||||
// Swap_ refers to the subsequent selection screens where you can swap a Pokemon with one from the beaten trainer
|
||||
// Select_ refers to the first Pokémon selection screen where you choose your initial 3 rental Pokémon.
|
||||
// Swap_ refers to the subsequent selection screens where you can swap a Pokémon with one from the beaten trainer
|
||||
|
||||
// Note that, generally, "Action" will refer to the immediate actions that can be taken on each screen,
|
||||
// i.e. selecting a pokemon or selecting the Cancel button
|
||||
// i.e. selecting a Pokémon or selecting the Cancel button
|
||||
// The "Options menu" will refer to the popup menu that shows when some actions have been selected
|
||||
|
||||
#define SWAP_PLAYER_SCREEN 0 // The screen where the player selects which of their pokemon to swap away
|
||||
#define SWAP_ENEMY_SCREEN 1 // The screen where the player selects which new pokemon from the defeated party to swap for
|
||||
#define SWAP_PLAYER_SCREEN 0 // The screen where the player selects which of their Pokémon to swap away
|
||||
#define SWAP_ENEMY_SCREEN 1 // The screen where the player selects which new Pokémon from the defeated party to swap for
|
||||
|
||||
#define SELECTABLE_MONS_COUNT 6
|
||||
|
||||
@ -89,7 +89,7 @@ struct FactorySelectableMon
|
||||
{
|
||||
u16 monId;
|
||||
u16 ballSpriteId;
|
||||
u8 selectedId; // 0 - not selected, 1 - first pokemon, 2 - second pokemon, 3 - third pokemon
|
||||
u8 selectedId; // 0 - not selected, 1 - first Pokémon, 2 - second Pokémon, 3 - third Pokémon
|
||||
struct Pokemon monData;
|
||||
};
|
||||
|
||||
@ -1060,7 +1060,7 @@ static void SpriteCB_Pokeball(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->oam.paletteNum == IndexOfSpritePaletteTag(PALTAG_BALL_SELECTED))
|
||||
{
|
||||
// Pokeball selected, do rocking animation
|
||||
// Poké Ball selected, do rocking animation
|
||||
if (sprite->animEnded)
|
||||
{
|
||||
if (sprite->data[0] != 0)
|
||||
@ -1084,7 +1084,7 @@ static void SpriteCB_Pokeball(struct Sprite *sprite)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pokeball not selected, remain still
|
||||
// Poké Ball not selected, remain still
|
||||
StartSpriteAnimIfDifferent(sprite, 0);
|
||||
}
|
||||
}
|
||||
@ -1521,7 +1521,7 @@ static void Select_Task_Exit(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
// Handles the Yes/No prompt when confirming the 3 selected rental pokemon
|
||||
// Handles the Yes/No prompt when confirming the 3 selected rental Pokémon
|
||||
static void Select_Task_HandleYesNo(u8 taskId)
|
||||
{
|
||||
if (sFactorySelectScreen->monPicAnimating == TRUE)
|
||||
@ -1543,14 +1543,14 @@ static void Select_Task_HandleYesNo(u8 taskId)
|
||||
PlaySE(SE_SELECT);
|
||||
if (sFactorySelectScreen->yesNoCursorPos == 0)
|
||||
{
|
||||
// Selected Yes, confirmed selected pokemon
|
||||
// Selected Yes, confirmed selected Pokémon
|
||||
Select_HideChosenMons();
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].func = Select_Task_Exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Selected No, continue choosing pokemon
|
||||
// Selected No, continue choosing Pokémon
|
||||
Select_ErasePopupMenu(SELECT_WIN_YES_NO);
|
||||
Select_DeclineChosenMons();
|
||||
sFactorySelectScreen->fadeSpeciesNameActive = TRUE;
|
||||
@ -1560,7 +1560,7 @@ static void Select_Task_HandleYesNo(u8 taskId)
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
// Pressed B, Continue choosing pokemon
|
||||
// Pressed B, Continue choosing Pokémon
|
||||
PlaySE(SE_SELECT);
|
||||
Select_ErasePopupMenu(SELECT_WIN_YES_NO);
|
||||
Select_DeclineChosenMons();
|
||||
@ -1582,7 +1582,7 @@ static void Select_Task_HandleYesNo(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
// Handles the popup menu that shows when a pokemon is selected
|
||||
// Handles the popup menu that shows when a Pokémon is selected
|
||||
static void Select_Task_HandleMenu(u8 taskId)
|
||||
{
|
||||
switch (gTasks[taskId].tState)
|
||||
@ -2415,7 +2415,7 @@ static void Swap_Task_Exit(u8 taskId)
|
||||
{
|
||||
case 0:
|
||||
// Set return value for script
|
||||
// TRUE if player kept their current pokemon
|
||||
// TRUE if player kept their current Pokémon
|
||||
if (sFactorySwapScreen->monSwapped == TRUE)
|
||||
{
|
||||
gTasks[taskId].tState++;
|
||||
@ -2630,7 +2630,7 @@ static void Swap_Task_HandleMenu(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
// Handles input on the two main swap screens (choosing a current pokeon to get rid of, and choosing a new pokemon to receive)
|
||||
// Handles input on the two main swap screens (choosing a current pokeon to get rid of, and choosing a new Pokémon to receive)
|
||||
static void Swap_Task_HandleChooseMons(u8 taskId)
|
||||
{
|
||||
switch (gTasks[taskId].tState)
|
||||
@ -2645,7 +2645,7 @@ static void Swap_Task_HandleChooseMons(u8 taskId)
|
||||
case STATE_CHOOSE_MONS_HANDLE_INPUT:
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
// Run whatever action is currently selected (a pokeball, the Cancel button, etc.)
|
||||
// Run whatever action is currently selected (a Poké Ball, the Cancel button, etc.)
|
||||
PlaySE(SE_SELECT);
|
||||
sFactorySwapScreen->fadeSpeciesNameActive = FALSE;
|
||||
Swap_PrintMonSpeciesAtFade();
|
||||
@ -3553,7 +3553,7 @@ static void Swap_HandleActionCursorChange(u8 cursorId)
|
||||
{
|
||||
if (cursorId < FRONTIER_PARTY_SIZE)
|
||||
{
|
||||
// Cursor is on one of the pokemon
|
||||
// Cursor is on one of the Pokémon
|
||||
gSprites[sFactorySwapScreen->cursorSpriteId].invisible = FALSE;
|
||||
Swap_HideActionButtonHighlights();
|
||||
gSprites[sFactorySwapScreen->cursorSpriteId].x = gSprites[sFactorySwapScreen->ballSpriteIds[cursorId]].x;
|
||||
|
||||
@ -105,7 +105,7 @@ void FreeBattleSpritesData(void)
|
||||
FREE_AND_SET_NULL(gBattleSpritesDataPtr);
|
||||
}
|
||||
|
||||
// Pokemon chooses move to use in Battle Palace rather than player
|
||||
// Pokémon chooses move to use in Battle Palace rather than player
|
||||
u16 ChooseMoveAndTargetInBattlePalace(void)
|
||||
{
|
||||
s32 i, var1, var2;
|
||||
@ -165,7 +165,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
|
||||
chosenMoveId = BattleAI_ChooseMoveOrAction();
|
||||
}
|
||||
|
||||
// If no moves matched the selected group, pick a new move from groups the pokemon has
|
||||
// If no moves matched the selected group, pick a new move from groups the Pokémon has
|
||||
// In this case the AI is not checked again, so the choice may be worse
|
||||
// If a move is chosen this way, there's a 50% chance that it will be unable to use it anyway
|
||||
if (chosenMoveId == -1)
|
||||
@ -357,7 +357,7 @@ static u16 GetBattlePalaceTarget(void)
|
||||
return BATTLE_OPPOSITE(gActiveBattler) << 8;
|
||||
}
|
||||
|
||||
// Wait for the pokemon to finish appearing out from the pokeball on send out
|
||||
// Wait for the Pokémon to finish appearing out from the Poké Ball on send out
|
||||
void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
|
||||
{
|
||||
u8 spriteId = sprite->data[1];
|
||||
@ -378,7 +378,7 @@ void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 pointless)
|
||||
static void UNUSED UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 pointless)
|
||||
{
|
||||
sprite->animPaused = TRUE;
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
@ -690,8 +690,7 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BattleGfxSfxDummy1(void)
|
||||
static void UNUSED BattleGfxSfxDummy1(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -841,8 +841,7 @@ static void Debug_DrawNumber(s16 number, u16 *dest, bool8 unk)
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest)
|
||||
static void UNUSED Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest)
|
||||
{
|
||||
dest[4] = 0x1E;
|
||||
Debug_DrawNumber(number2, dest, FALSE);
|
||||
@ -2459,9 +2458,8 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32
|
||||
return filledPixels;
|
||||
}
|
||||
|
||||
// Unused
|
||||
// These two functions seem as if they were made for testing the health bar.
|
||||
static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *dest, s32 unused)
|
||||
static s16 UNUSED Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *dest, s32 unused)
|
||||
{
|
||||
s16 ret, var;
|
||||
|
||||
|
||||
@ -602,7 +602,7 @@ void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8
|
||||
LoadBgTilemap(bgId, tilemap, BG_SCREEN_SIZE, 0);
|
||||
}
|
||||
|
||||
static void DrawBattlerOnBgDMA(u8 x, u8 y, u8 battlerPosition, u8 arg3, u8 paletteId, u16 arg5, u8 arg6, u8 arg7)
|
||||
static void UNUSED DrawBattlerOnBgDMA(u8 x, u8 y, u8 battlerPosition, u8 arg3, u8 paletteId, u16 arg5, u8 arg6, u8 arg7)
|
||||
{
|
||||
int i, j, offset;
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ EWRAM_DATA u16 gChosenMove = 0;
|
||||
EWRAM_DATA u16 gCalledMove = 0;
|
||||
EWRAM_DATA s32 gBattleMoveDamage = 0;
|
||||
EWRAM_DATA s32 gHpDealt = 0;
|
||||
EWRAM_DATA s32 gTakenDmg[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA s32 gBideDmg[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u16 gLastUsedItem = 0;
|
||||
EWRAM_DATA u8 gLastUsedAbility = 0;
|
||||
EWRAM_DATA u8 gBattlerAttacker = 0;
|
||||
@ -197,7 +197,7 @@ EWRAM_DATA u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gMoveResultFlags = 0;
|
||||
EWRAM_DATA u32 gHitMarker = 0;
|
||||
EWRAM_DATA static u8 sUnusedBattlersArray[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBideTarget[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gUnusedFirstBattleVar2 = 0; // Never read
|
||||
EWRAM_DATA u16 gSideStatuses[NUM_BATTLE_SIDES] = {0};
|
||||
EWRAM_DATA struct SideTimer gSideTimers[NUM_BATTLE_SIDES] = {0};
|
||||
@ -2073,8 +2073,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
|
||||
return gTrainers[trainerNum].partySize;
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void HBlankCB_Battle(void)
|
||||
static void UNUSED HBlankCB_Battle(void)
|
||||
{
|
||||
if (REG_VCOUNT < DISPLAY_HEIGHT && REG_VCOUNT >= 111)
|
||||
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_SCREENBASE(24) | BGCNT_TXT256x512);
|
||||
@ -2710,8 +2709,7 @@ void SpriteCallbackDummy_2(struct Sprite *sprite)
|
||||
#define sNumFlickers data[3]
|
||||
#define sDelay data[4]
|
||||
|
||||
// Unused
|
||||
static void SpriteCB_InitFlicker(struct Sprite *sprite)
|
||||
static void UNUSED SpriteCB_InitFlicker(struct Sprite *sprite)
|
||||
{
|
||||
sprite->sNumFlickers = 6;
|
||||
sprite->sDelay = 1;
|
||||
@ -2866,8 +2864,7 @@ static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void SetIdleSpriteCallback(struct Sprite *sprite)
|
||||
static void UNUSED SetIdleSpriteCallback(struct Sprite *sprite)
|
||||
{
|
||||
sprite->callback = SpriteCB_Idle;
|
||||
}
|
||||
@ -3712,8 +3709,7 @@ static void BattleIntroRecordMonsToDex(void)
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BattleIntroSkipRecordMonsToDex(void)
|
||||
static void UNUSED BattleIntroSkipRecordMonsToDex(void)
|
||||
{
|
||||
if (gBattleControllerExecFlags == 0)
|
||||
gBattleMainFunc = BattleIntroPrintPlayerSendsOut;
|
||||
@ -3816,8 +3812,7 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void)
|
||||
gBattleMainFunc = TryDoEventsBeforeFirstTurn;
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BattleIntroSwitchInPlayerMons(void)
|
||||
static void UNUSED BattleIntroSwitchInPlayerMons(void)
|
||||
{
|
||||
if (gBattleControllerExecFlags == 0)
|
||||
{
|
||||
|
||||
@ -2152,7 +2152,7 @@ void BufferStringBattle(u16 stringID)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case STRINGID_USEDMOVE: // pokemon used a move msg
|
||||
case STRINGID_USEDMOVE: // Pokémon used a move msg
|
||||
ChooseMoveUsedParticle(gBattleTextBuff1); // buff1 doesn't appear in the string, leftover from japanese move names
|
||||
|
||||
if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT)
|
||||
@ -2313,7 +2313,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
{
|
||||
u32 dstID = 0; // if they used dstID, why not use srcID as well?
|
||||
const u8 *toCpy = NULL;
|
||||
// This buffer may hold either the name of a trainer, pokemon, or item.
|
||||
// This buffer may hold either the name of a trainer, Pokémon, or item.
|
||||
u8 text[max(max(max(32, TRAINER_NAME_LENGTH + 1), POKEMON_NAME_LENGTH + 1), ITEM_NAME_LENGTH)];
|
||||
u8 multiplayerId;
|
||||
s32 i;
|
||||
|
||||
@ -1097,8 +1097,7 @@ static u16 GetNPCRoomGraphicsId(void)
|
||||
return sNPCTable[sNpcId].graphicsId;
|
||||
}
|
||||
|
||||
// Unused
|
||||
static u8 GetInWildMonRoom(void)
|
||||
static bool8 UNUSED GetInWildMonRoom(void)
|
||||
{
|
||||
return sInWildMonRoom;
|
||||
}
|
||||
@ -1268,7 +1267,7 @@ static void TryHealMons(u8 healCount)
|
||||
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
|
||||
indices[i] = i;
|
||||
|
||||
// Only 'healCount' number of pokemon will be healed.
|
||||
// Only 'healCount' number of Pokémon will be healed.
|
||||
// The order in which they're (attempted to be) healed is random,
|
||||
// and determined by performing 10 random swaps to this index array.
|
||||
for (k = 0; k < 10; k++)
|
||||
|
||||
@ -1479,8 +1479,7 @@ u8 GetTrainerEncounterMusicIdInBattlePyramid(u16 trainerId)
|
||||
return TRAINER_ENCOUNTER_MUSIC_MALE;
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void BattlePyramidRetireChallenge(void)
|
||||
static void UNUSED BattlePyramidRetireChallenge(void)
|
||||
{
|
||||
ScriptContext_SetupScript(BattlePyramid_Retire);
|
||||
}
|
||||
|
||||
@ -174,12 +174,12 @@ enum {
|
||||
|
||||
static const struct MenuAction sMenuActions[] =
|
||||
{
|
||||
[ACTION_USE_FIELD] = { gMenuText_Use, BagAction_UseOnField },
|
||||
[ACTION_TOSS] = { gMenuText_Toss, BagAction_Toss },
|
||||
[ACTION_GIVE] = { gMenuText_Give, BagAction_Give },
|
||||
[ACTION_CANCEL] = { gText_Cancel2, BagAction_Cancel },
|
||||
[ACTION_USE_BATTLE] = { gMenuText_Use, BagAction_UseInBattle },
|
||||
[ACTION_DUMMY] = { gText_EmptyString2, NULL },
|
||||
[ACTION_USE_FIELD] = { gMenuText_Use, {BagAction_UseOnField} },
|
||||
[ACTION_TOSS] = { gMenuText_Toss, {BagAction_Toss} },
|
||||
[ACTION_GIVE] = { gMenuText_Give, {BagAction_Give} },
|
||||
[ACTION_CANCEL] = { gText_Cancel2, {BagAction_Cancel} },
|
||||
[ACTION_USE_BATTLE] = { gMenuText_Use, {BagAction_UseInBattle} },
|
||||
[ACTION_DUMMY] = { gText_EmptyString2, {NULL} },
|
||||
};
|
||||
|
||||
static const u8 sMenuActionIds_Field[] = {ACTION_USE_FIELD, ACTION_GIVE, ACTION_TOSS, ACTION_CANCEL};
|
||||
@ -382,8 +382,8 @@ void CB2_PyramidBagMenuFromStartMenu(void)
|
||||
GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_FIELD, CB2_ReturnToFieldWithOpenMenu);
|
||||
}
|
||||
|
||||
// Unused, CB2_BagMenuFromBattle is used instead
|
||||
static void OpenBattlePyramidBagInBattle(void)
|
||||
// CB2_BagMenuFromBattle is used instead
|
||||
static void UNUSED OpenBattlePyramidBagInBattle(void)
|
||||
{
|
||||
GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_BATTLE, CB2_SetUpReshowBattleScreenAfterMenu2);
|
||||
}
|
||||
@ -1468,8 +1468,7 @@ static void DrawTossNumberWindow(u8 windowId)
|
||||
ScheduleBgCopyTilemapToVram(1);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static u8 GetMenuActionWindowId(u8 windowArrayId)
|
||||
static u8 UNUSED GetMenuActionWindowId(u8 windowArrayId)
|
||||
{
|
||||
return gPyramidBagMenu->windowIds[windowArrayId];
|
||||
}
|
||||
|
||||
@ -1706,7 +1706,7 @@ static inline void ApplyRandomDmgMultiplier(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void Unused_ApplyRandomDmgMultiplier(void)
|
||||
static void UNUSED Unused_ApplyRandomDmgMultiplier(void)
|
||||
{
|
||||
ApplyRandomDmgMultiplier();
|
||||
}
|
||||
@ -1892,6 +1892,7 @@ static void Cmd_healthbarupdate(void)
|
||||
gBattlescriptCurrInstr += 2;
|
||||
}
|
||||
|
||||
// Update the active battler's HP and various HP trackers (Substitute, Bide, etc.)
|
||||
static void Cmd_datahpupdate(void)
|
||||
{
|
||||
u32 moveType;
|
||||
@ -1899,9 +1900,13 @@ static void Cmd_datahpupdate(void)
|
||||
if (gBattleControllerExecFlags)
|
||||
return;
|
||||
|
||||
// moveType will be used later to record for Counter/Mirror Coat whether this was physical or special damage.
|
||||
// For moves with a dynamic type that have F_DYNAMIC_TYPE_IGNORE_PHYSICALITY set (in vanilla, just Hidden Power) this will ignore
|
||||
// the dynamic type and use the move's base type instead, meaning (as a Normal type) Hidden Power will only ever trigger Counter.
|
||||
// It also means that Hidden Power Fire is unable to defrost targets.
|
||||
if (gBattleStruct->dynamicMoveType == 0)
|
||||
moveType = gBattleMoves[gCurrentMove].type;
|
||||
else if (!(gBattleStruct->dynamicMoveType & F_DYNAMIC_TYPE_1))
|
||||
else if (!(gBattleStruct->dynamicMoveType & F_DYNAMIC_TYPE_IGNORE_PHYSICALITY))
|
||||
moveType = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK;
|
||||
else
|
||||
moveType = gBattleMoves[gCurrentMove].type;
|
||||
@ -1911,23 +1916,26 @@ static void Cmd_datahpupdate(void)
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE))
|
||||
{
|
||||
// Target has an active Substitute, deal damage to that instead.
|
||||
if (gDisableStructs[gActiveBattler].substituteHP >= gBattleMoveDamage)
|
||||
{
|
||||
if (gSpecialStatuses[gActiveBattler].dmg == 0)
|
||||
gSpecialStatuses[gActiveBattler].dmg = gBattleMoveDamage;
|
||||
if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0)
|
||||
gSpecialStatuses[gActiveBattler].shellBellDmg = gBattleMoveDamage;
|
||||
gDisableStructs[gActiveBattler].substituteHP -= gBattleMoveDamage;
|
||||
gHpDealt = gBattleMoveDamage;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gSpecialStatuses[gActiveBattler].dmg == 0)
|
||||
gSpecialStatuses[gActiveBattler].dmg = gDisableStructs[gActiveBattler].substituteHP;
|
||||
// Substitute has less HP than the damage dealt, set its HP to 0.
|
||||
if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0)
|
||||
gSpecialStatuses[gActiveBattler].shellBellDmg = gDisableStructs[gActiveBattler].substituteHP;
|
||||
gHpDealt = gDisableStructs[gActiveBattler].substituteHP;
|
||||
gDisableStructs[gActiveBattler].substituteHP = 0;
|
||||
}
|
||||
// check substitute fading
|
||||
|
||||
if (gDisableStructs[gActiveBattler].substituteHP == 0)
|
||||
{
|
||||
// Substitute fades
|
||||
gBattlescriptCurrInstr += 2;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_SubstituteFade;
|
||||
@ -1937,28 +1945,30 @@ static void Cmd_datahpupdate(void)
|
||||
else
|
||||
{
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SUBSTITUTE;
|
||||
if (gBattleMoveDamage < 0) // hp goes up
|
||||
if (gBattleMoveDamage < 0)
|
||||
{
|
||||
gBattleMons[gActiveBattler].hp -= gBattleMoveDamage;
|
||||
// Negative damage is HP gain
|
||||
gBattleMons[gActiveBattler].hp += -gBattleMoveDamage;
|
||||
if (gBattleMons[gActiveBattler].hp > gBattleMons[gActiveBattler].maxHP)
|
||||
gBattleMons[gActiveBattler].hp = gBattleMons[gActiveBattler].maxHP;
|
||||
|
||||
}
|
||||
else // hp goes down
|
||||
else
|
||||
{
|
||||
if (gHitMarker & HITMARKER_SKIP_DMG_TRACK)
|
||||
if (gHitMarker & HITMARKER_IGNORE_BIDE)
|
||||
{
|
||||
gHitMarker &= ~HITMARKER_SKIP_DMG_TRACK;
|
||||
gHitMarker &= ~HITMARKER_IGNORE_BIDE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gTakenDmg[gActiveBattler] += gBattleMoveDamage;
|
||||
// Record damage/attacker for Bide
|
||||
gBideDmg[gActiveBattler] += gBattleMoveDamage;
|
||||
if (gBattlescriptCurrInstr[1] == BS_TARGET)
|
||||
gTakenDmgByBattler[gActiveBattler] = gBattlerAttacker;
|
||||
gBideTarget[gActiveBattler] = gBattlerAttacker;
|
||||
else
|
||||
gTakenDmgByBattler[gActiveBattler] = gBattlerTarget;
|
||||
gBideTarget[gActiveBattler] = gBattlerTarget;
|
||||
}
|
||||
|
||||
// Deal damage to the battler
|
||||
if (gBattleMons[gActiveBattler].hp > gBattleMoveDamage)
|
||||
{
|
||||
gBattleMons[gActiveBattler].hp -= gBattleMoveDamage;
|
||||
@ -1970,11 +1980,16 @@ static void Cmd_datahpupdate(void)
|
||||
gBattleMons[gActiveBattler].hp = 0;
|
||||
}
|
||||
|
||||
if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||
gSpecialStatuses[gActiveBattler].dmg = gHpDealt;
|
||||
// Record damage for Shell Bell
|
||||
if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0 && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||
gSpecialStatuses[gActiveBattler].shellBellDmg = gHpDealt;
|
||||
|
||||
// Note: While physicalDmg/specialDmg below are only distinguished between for Counter/Mirror Coat, they are
|
||||
// used in combination as general damage trackers for other purposes. specialDmg is additionally used
|
||||
// to help determine if a fire move should defrost the target.
|
||||
if (IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gCurrentMove != MOVE_PAIN_SPLIT)
|
||||
{
|
||||
// Record physical damage/attacker for Counter
|
||||
gProtectStructs[gActiveBattler].physicalDmg = gHpDealt;
|
||||
gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt;
|
||||
if (gBattlescriptCurrInstr[1] == BS_TARGET)
|
||||
@ -1990,6 +2005,7 @@ static void Cmd_datahpupdate(void)
|
||||
}
|
||||
else if (!IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||
{
|
||||
// Record special damage/attacker for Mirror Coat
|
||||
gProtectStructs[gActiveBattler].specialDmg = gHpDealt;
|
||||
gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt;
|
||||
if (gBattlescriptCurrInstr[1] == BS_TARGET)
|
||||
@ -2005,15 +2021,18 @@ static void Cmd_datahpupdate(void)
|
||||
}
|
||||
}
|
||||
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
|
||||
|
||||
// Send updated HP
|
||||
BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// MOVE_RESULT_NO_EFFECT was set
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
if (gSpecialStatuses[gActiveBattler].dmg == 0)
|
||||
gSpecialStatuses[gActiveBattler].dmg = 0xFFFF;
|
||||
if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0)
|
||||
gSpecialStatuses[gActiveBattler].shellBellDmg = IGNORE_SHELL_BELL;
|
||||
}
|
||||
gBattlescriptCurrInstr += 2;
|
||||
}
|
||||
@ -2283,11 +2302,11 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
gBattleScripting.battler = gBattlerAttacker;
|
||||
}
|
||||
|
||||
if (gBattleMons[gEffectBattler].ability == ABILITY_SHIELD_DUST && !(gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
if (gBattleMons[gEffectBattler].ability == ABILITY_SHIELD_DUST && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
&& !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 9)
|
||||
INCREMENT_RESET_RETURN
|
||||
|
||||
if (gSideStatuses[GET_BATTLER_SIDE(gEffectBattler)] & SIDE_STATUS_SAFEGUARD && !(gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
if (gSideStatuses[GET_BATTLER_SIDE(gEffectBattler)] & SIDE_STATUS_SAFEGUARD && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
&& !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 7)
|
||||
INCREMENT_RESET_RETURN
|
||||
|
||||
@ -2337,10 +2356,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_PSNPrevention;
|
||||
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2349,7 +2368,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
RESET_RETURN
|
||||
}
|
||||
if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL))
|
||||
&& (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
&& (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
@ -2378,10 +2397,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_BRNPrevention;
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2390,7 +2409,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
RESET_RETURN
|
||||
}
|
||||
if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE)
|
||||
&& (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
&& (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
@ -2434,10 +2453,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_PRLZPrevention;
|
||||
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2462,10 +2481,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_PSNPrevention;
|
||||
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2474,7 +2493,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
RESET_RETURN
|
||||
}
|
||||
if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL))
|
||||
&& (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
&& (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
@ -2517,10 +2536,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].status1), &gBattleMons[gEffectBattler].status1);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY;
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3403,7 +3422,7 @@ static void Cmd_getexp(void)
|
||||
|
||||
if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId]))
|
||||
{
|
||||
// check if the pokemon doesn't belong to the player
|
||||
// check if the Pokémon doesn't belong to the player
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gBattleStruct->expGetterMonId >= 3)
|
||||
{
|
||||
i = STRINGID_EMPTYSTRING4;
|
||||
@ -4485,7 +4504,7 @@ static void Cmd_moveend(void)
|
||||
}
|
||||
gBattleScripting.moveendState++;
|
||||
break;
|
||||
case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokemon.
|
||||
case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokémon.
|
||||
if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
||||
&& !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH
|
||||
&& !(gHitMarker & HITMARKER_NO_ATTACKSTRING))
|
||||
@ -7148,7 +7167,7 @@ static void Cmd_setbide(void)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS;
|
||||
gLockedMoves[gBattlerAttacker] = gCurrentMove;
|
||||
gTakenDmg[gBattlerAttacker] = 0;
|
||||
gBideDmg[gBattlerAttacker] = 0;
|
||||
gBattleMons[gBattlerAttacker].status2 |= STATUS2_BIDE_TURN(2);
|
||||
|
||||
gBattlescriptCurrInstr++;
|
||||
@ -7307,7 +7326,7 @@ static void Cmd_forcerandomswitch(void)
|
||||
lastMonId = PARTY_SIZE;
|
||||
monsCount = PARTY_SIZE;
|
||||
minNeeded = 1;
|
||||
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one pokemon out in single battles
|
||||
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one Pokémon out in single battles
|
||||
battler1PartyId = gBattlerPartyIndexes[gBattlerTarget];
|
||||
}
|
||||
|
||||
@ -7798,7 +7817,7 @@ static void Cmd_setsubstitute(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; // one bit value will only work for pokemon which max hp can go to 1020(which is more than possible in games)
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; // one bit value will only work for Pokémon which max hp can go to 1020(which is more than possible in games)
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
|
||||
@ -8040,7 +8059,7 @@ static void Cmd_painsplitdmgcalc(void)
|
||||
storeLoc[3] = (painSplitHp & 0xFF000000) >> 24;
|
||||
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp - hpDiff;
|
||||
gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF;
|
||||
gSpecialStatuses[gBattlerTarget].shellBellDmg = IGNORE_SHELL_BELL;
|
||||
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
@ -8878,7 +8897,7 @@ static void Cmd_hiddenpowercalc(void)
|
||||
gBattleStruct->dynamicMoveType = ((NUMBER_OF_MON_TYPES - 3) * typeBits) / 63 + 1;
|
||||
if (gBattleStruct->dynamicMoveType >= TYPE_MYSTERY)
|
||||
gBattleStruct->dynamicMoveType++;
|
||||
gBattleStruct->dynamicMoveType |= F_DYNAMIC_TYPE_1 | F_DYNAMIC_TYPE_2;
|
||||
gBattleStruct->dynamicMoveType |= F_DYNAMIC_TYPE_IGNORE_PHYSICALITY | F_DYNAMIC_TYPE_SET;
|
||||
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
@ -9179,7 +9198,7 @@ static void Cmd_tryswapitems(void)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
}
|
||||
// can't swap if two pokemon don't have an item
|
||||
// can't swap if two Pokémon don't have an item
|
||||
// or if either of them is an enigma berry or a mail
|
||||
else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE)
|
||||
|| gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY
|
||||
@ -9755,15 +9774,15 @@ static void Cmd_setweatherballtype(void)
|
||||
if (gBattleWeather & B_WEATHER_ANY)
|
||||
gBattleScripting.dmgMultiplier = 2;
|
||||
if (gBattleWeather & B_WEATHER_RAIN)
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_WATER | F_DYNAMIC_TYPE_2;
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_WATER | F_DYNAMIC_TYPE_SET;
|
||||
else if (gBattleWeather & B_WEATHER_SANDSTORM)
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_ROCK | F_DYNAMIC_TYPE_2;
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_ROCK | F_DYNAMIC_TYPE_SET;
|
||||
else if (gBattleWeather & B_WEATHER_SUN)
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_FIRE | F_DYNAMIC_TYPE_2;
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_FIRE | F_DYNAMIC_TYPE_SET;
|
||||
else if (gBattleWeather & B_WEATHER_HAIL)
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_ICE | F_DYNAMIC_TYPE_2;
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_ICE | F_DYNAMIC_TYPE_SET;
|
||||
else
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_NORMAL | F_DYNAMIC_TYPE_2;
|
||||
*(&gBattleStruct->dynamicMoveType) = TYPE_NORMAL | F_DYNAMIC_TYPE_SET;
|
||||
}
|
||||
|
||||
gBattlescriptCurrInstr++;
|
||||
|
||||
@ -108,7 +108,7 @@ EWRAM_DATA static u8 *sTrainerBBattleScriptRetAddr = NULL;
|
||||
EWRAM_DATA static bool8 sShouldCheckTrainerBScript = FALSE;
|
||||
EWRAM_DATA static u8 sNoOfPossibleTrainerRetScripts = 0;
|
||||
|
||||
// The first transition is used if the enemy pokemon are lower level than our pokemon.
|
||||
// The first transition is used if the enemy Pokémon are lower level than our Pokémon.
|
||||
// Otherwise, the second transition is used.
|
||||
static const u8 sBattleTransitionTable_Wild[][2] =
|
||||
{
|
||||
@ -845,7 +845,7 @@ static u8 GetTrainerBattleTransition(void)
|
||||
return B_TRANSITION_AQUA;
|
||||
|
||||
if (gTrainers[gTrainerBattleOpponent_A].doubleBattle == TRUE)
|
||||
minPartyCount = 2; // double battles always at least have 2 pokemon.
|
||||
minPartyCount = 2; // double battles always at least have 2 Pokémon.
|
||||
else
|
||||
minPartyCount = 1;
|
||||
|
||||
@ -1248,7 +1248,7 @@ static void SetBattledTrainersFlags(void)
|
||||
FlagSet(GetTrainerAFlag());
|
||||
}
|
||||
|
||||
static void SetBattledTrainerFlag(void)
|
||||
static void UNUSED SetBattledTrainerFlag(void)
|
||||
{
|
||||
FlagSet(GetTrainerAFlag());
|
||||
}
|
||||
|
||||
@ -309,11 +309,10 @@ static void GenerateInitialRentalMons(void)
|
||||
i = 0;
|
||||
while (i != PARTY_SIZE)
|
||||
{
|
||||
// Cannot have two pokemon of the same species.
|
||||
// Cannot have two Pokémon of the same species.
|
||||
monSetId = Random() % NUM_SLATEPORT_TENT_MONS;
|
||||
for (j = firstMonId; j < firstMonId + i; j++)
|
||||
{
|
||||
u16 monId = monIds[j];
|
||||
if (monIds[j] == monSetId)
|
||||
break;
|
||||
if (species[j] == gFacilityTrainerMons[monSetId].species)
|
||||
@ -391,7 +390,7 @@ static void GenerateOpponentMons(void)
|
||||
{
|
||||
sRandMonId = monSet[Random() % numMons];
|
||||
|
||||
// Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player
|
||||
// Ensure none of the opponent's Pokémon are the same as the potential rental Pokémon for the player
|
||||
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
|
||||
{
|
||||
if (gFacilityTrainerMons[sRandMonId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
|
||||
|
||||
@ -1129,8 +1129,7 @@ u16 GetRandomScaledFrontierTrainerId(u8 challengeNum, u8 battleNum)
|
||||
return trainerId;
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum, u16 *trainerIdPtr, u8 *rangePtr)
|
||||
static void UNUSED GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum, u16 *trainerIdPtr, u8 *rangePtr)
|
||||
{
|
||||
u16 trainerId, range;
|
||||
|
||||
@ -1681,8 +1680,8 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
}
|
||||
|
||||
// Regular battle frontier trainer.
|
||||
// Attempt to fill the trainer's party with random Pokemon until 3 have been
|
||||
// successfully chosen. The trainer's party may not have duplicate pokemon species
|
||||
// Attempt to fill the trainer's party with random Pokémon until 3 have been
|
||||
// successfully chosen. The trainer's party may not have duplicate Pokémon species
|
||||
// or duplicate held items.
|
||||
for (bfMonCount = 0; monSet[bfMonCount] != 0xFFFF; bfMonCount++)
|
||||
;
|
||||
@ -1692,12 +1691,12 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
{
|
||||
u16 monId = monSet[Random() % bfMonCount];
|
||||
|
||||
// "High tier" pokemon are only allowed on open level mode
|
||||
// "High tier" Pokémon are only allowed on open level mode
|
||||
// 20 is not a possible value for level here
|
||||
if ((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER)
|
||||
continue;
|
||||
|
||||
// Ensure this pokemon species isn't a duplicate.
|
||||
// Ensure this Pokémon species isn't a duplicate.
|
||||
for (j = 0; j < i + firstMonId; j++)
|
||||
{
|
||||
if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species)
|
||||
@ -1716,7 +1715,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
if (j != i + firstMonId)
|
||||
continue;
|
||||
|
||||
// Ensure this exact pokemon index isn't a duplicate. This check doesn't seem necessary
|
||||
// Ensure this exact Pokémon index isn't a duplicate. This check doesn't seem necessary
|
||||
// because the species and held items were already checked directly above.
|
||||
for (j = 0; j < i; j++)
|
||||
{
|
||||
@ -1728,7 +1727,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
|
||||
chosenMonIndices[i] = monId;
|
||||
|
||||
// Place the chosen pokemon into the trainer's party.
|
||||
// Place the chosen Pokémon into the trainer's party.
|
||||
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId],
|
||||
gFacilityTrainerMons[monId].species,
|
||||
level,
|
||||
@ -1738,7 +1737,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
otID);
|
||||
|
||||
friendship = MAX_FRIENDSHIP;
|
||||
// Give the chosen pokemon its specified moves.
|
||||
// Give the chosen Pokémon its specified moves.
|
||||
for (j = 0; j < MAX_MON_MOVES; j++)
|
||||
{
|
||||
SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], j);
|
||||
@ -1749,14 +1748,14 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_FRIENDSHIP, &friendship);
|
||||
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]);
|
||||
|
||||
// The pokemon was successfully added to the trainer's party, so it's safe to move on to
|
||||
// The Pokémon was successfully added to the trainer's party, so it's safe to move on to
|
||||
// the next party slot.
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// Probably an early draft before the 'CreateApprenticeMon' was written.
|
||||
static void Unused_CreateApprenticeMons(u16 trainerId, u8 firstMonId)
|
||||
static void UNUSED Unused_CreateApprenticeMons(u16 trainerId, u8 firstMonId)
|
||||
{
|
||||
s32 i, j;
|
||||
u8 friendship = MAX_FRIENDSHIP;
|
||||
@ -1805,7 +1804,7 @@ u16 GetRandomFrontierMonFromSet(u16 trainerId)
|
||||
|
||||
do
|
||||
{
|
||||
// "High tier" pokemon are only allowed on open level mode
|
||||
// "High tier" Pokémon are only allowed on open level mode
|
||||
// 20 is not a possible value for level here
|
||||
monId = monSet[Random() % numMons];
|
||||
} while((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER);
|
||||
@ -1832,12 +1831,14 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId)
|
||||
|
||||
if (trainerId < FRONTIER_TRAINERS_COUNT)
|
||||
{
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
// By mistake Battle Tower's Level 50 challenge number is used to determine the IVs for Battle Factory.
|
||||
#ifdef BUGFIX
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
#else
|
||||
u8 UNUSED lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][FRONTIER_LVL_50] / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
#endif
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1)
|
||||
@ -2278,7 +2279,7 @@ static void LoadMultiPartnerCandidatesData(void)
|
||||
u32 lvlMode, battleMode;
|
||||
s32 challengeNum;
|
||||
u32 species1, species2;
|
||||
u32 level;
|
||||
u32 UNUSED level;
|
||||
struct ObjectEventTemplate *objEventTemplates;
|
||||
|
||||
objEventTemplates = gSaveBlock1Ptr->objectEventTemplates;
|
||||
@ -2453,15 +2454,15 @@ static void GetPotentialPartnerMoveAndSpecies(u16 trainerId, u16 monId)
|
||||
// These partners can be an NPC or a former/record-mixed Apprentice
|
||||
// When talked to, their response consists of:
|
||||
// PARTNER_MSGID_INTRO - A greeting
|
||||
// PARTNER_MSGID_MON1 - Naming one pokemon on their team, and a move it has
|
||||
// PARTNER_MSGID_MON2_ASK - Naming a second pokemon on their team, a move it has, and asking if they'd like to be their partner
|
||||
// PARTNER_MSGID_MON1 - Naming one Pokémon on their team, and a move it has
|
||||
// PARTNER_MSGID_MON2_ASK - Naming a second Pokémon on their team, a move it has, and asking if they'd like to be their partner
|
||||
// PARTNER_MSGID_ACCEPT - If the player agrees to be their partner
|
||||
// PARTNER_MSGID_REJECT - If the player declines to be their partner
|
||||
static void ShowPartnerCandidateMessage(void)
|
||||
{
|
||||
s32 i, j, partnerId;
|
||||
s32 monId;
|
||||
s32 level = SetFacilityPtrsGetLevel();
|
||||
s32 UNUSED level = SetFacilityPtrsGetLevel();
|
||||
u16 winStreak = GetCurrentFacilityWinStreak();
|
||||
s32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
s32 k = gSpecialVar_LastTalked - 2;
|
||||
@ -2772,7 +2773,7 @@ static void AwardBattleTowerRibbons(void)
|
||||
#ifdef BUGFIX
|
||||
struct RibbonCounter ribbons[MAX_FRONTIER_PARTY_SIZE];
|
||||
#else
|
||||
struct RibbonCounter ribbons[3]; // BUG: 4 Pokemon can receive ribbons in a double battle mode.
|
||||
struct RibbonCounter ribbons[3]; // BUG: 4 Pokémon can receive ribbons in a double battle mode.
|
||||
#endif
|
||||
u8 ribbonType = 0;
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
@ -2823,7 +2824,7 @@ static void AwardBattleTowerRibbons(void)
|
||||
|
||||
// This is a leftover debugging function that is used to populate the E-Reader
|
||||
// trainer with the player's current data.
|
||||
static void FillEReaderTrainerWithPlayerData(void)
|
||||
static void UNUSED FillEReaderTrainerWithPlayerData(void)
|
||||
{
|
||||
struct BattleTowerEReaderTrainer *ereaderTrainer = &gSaveBlock2Ptr->frontier.ereaderTrainer;
|
||||
s32 i, j;
|
||||
@ -2981,7 +2982,7 @@ static void FillPartnerParty(u16 trainerId)
|
||||
#ifdef BUGFIX
|
||||
j,
|
||||
#else
|
||||
i, // BUG: personality was stored in the 'j' variable. As a result, Steven's pokemon do not have the intended natures.
|
||||
i, // BUG: personality was stored in the 'j' variable. As a result, Steven's Pokémon do not have the intended natures.
|
||||
#endif
|
||||
OT_ID_PRESET, STEVEN_OTID);
|
||||
for (j = 0; j < PARTY_SIZE; j++)
|
||||
@ -3408,7 +3409,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
{
|
||||
u16 monId = monSet[Random() % bfMonCount];
|
||||
|
||||
// Ensure this pokemon species isn't a duplicate.
|
||||
// Ensure this Pokémon species isn't a duplicate.
|
||||
for (j = 0; j < i + firstMonId; j++)
|
||||
{
|
||||
if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species)
|
||||
@ -3427,7 +3428,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
if (j != i + firstMonId)
|
||||
continue;
|
||||
|
||||
// Ensure this exact pokemon index isn't a duplicate. This check doesn't seem necessary
|
||||
// Ensure this exact Pokémon index isn't a duplicate. This check doesn't seem necessary
|
||||
// because the species and held items were already checked directly above.
|
||||
for (j = 0; j < i; j++)
|
||||
{
|
||||
@ -3439,7 +3440,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
|
||||
chosenMonIndices[i] = monId;
|
||||
|
||||
// Place the chosen pokemon into the trainer's party.
|
||||
// Place the chosen Pokémon into the trainer's party.
|
||||
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId],
|
||||
gFacilityTrainerMons[monId].species,
|
||||
level,
|
||||
@ -3449,7 +3450,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
otID);
|
||||
|
||||
friendship = MAX_FRIENDSHIP;
|
||||
// Give the chosen pokemon its specified moves.
|
||||
// Give the chosen Pokémon its specified moves.
|
||||
for (j = 0; j < MAX_MON_MOVES; j++)
|
||||
{
|
||||
SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], j);
|
||||
@ -3460,7 +3461,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_FRIENDSHIP, &friendship);
|
||||
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]);
|
||||
|
||||
// The pokemon was successfully added to the trainer's party, so it's safe to move on to
|
||||
// The Pokémon was successfully added to the trainer's party, so it's safe to move on to
|
||||
// the next party slot.
|
||||
i++;
|
||||
}
|
||||
|
||||
@ -779,7 +779,7 @@ static const TransitionStateFunc sTransitionIntroFuncs[] =
|
||||
|
||||
static const struct SpriteFrameImage sSpriteImage_Pokeball[] =
|
||||
{
|
||||
sPokeball_Gfx, sizeof(sPokeball_Gfx)
|
||||
{sPokeball_Gfx, sizeof(sPokeball_Gfx)}
|
||||
};
|
||||
|
||||
static const union AnimCmd sSpriteAnim_Pokeball[] =
|
||||
@ -841,12 +841,12 @@ static const struct OamData sOam_UnusedBrendanLass =
|
||||
|
||||
static const struct SpriteFrameImage sImageTable_UnusedBrendan[] =
|
||||
{
|
||||
sUnusedBrendan_Gfx, sizeof(sUnusedBrendan_Gfx)
|
||||
{sUnusedBrendan_Gfx, sizeof(sUnusedBrendan_Gfx)}
|
||||
};
|
||||
|
||||
static const struct SpriteFrameImage sImageTable_UnusedLass[] =
|
||||
{
|
||||
sUnusedLass_Gfx, sizeof(sUnusedLass_Gfx)
|
||||
{sUnusedLass_Gfx, sizeof(sUnusedLass_Gfx)}
|
||||
};
|
||||
|
||||
static const union AnimCmd sSpriteAnim_UnusedBrendanLass[] =
|
||||
@ -1017,8 +1017,7 @@ static void CB2_TestBattleTransition(void)
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void TestBattleTransition(u8 transitionId)
|
||||
static void UNUSED TestBattleTransition(u8 transitionId)
|
||||
{
|
||||
sTestingTransitionId = transitionId;
|
||||
SetMainCallback2(CB2_TestBattleTransition);
|
||||
|
||||
@ -526,7 +526,7 @@ static const u16 *const sPointsArray[] =
|
||||
};
|
||||
|
||||
// Points will always be calculated for these messages
|
||||
// even if current pokemon does not have corresponding move
|
||||
// even if current Pokémon does not have corresponding move
|
||||
static const u16 sSpecialBattleStrings[] =
|
||||
{
|
||||
STRINGID_PKMNPERISHCOUNTFELL, STRINGID_PKMNWISHCAMETRUE, STRINGID_PKMNLOSTPPGRUDGE,
|
||||
|
||||
@ -649,7 +649,7 @@ void HandleAction_NothingIsFainted(void)
|
||||
gCurrentTurnActionNumber++;
|
||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
|
||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_IGNORE_ON_AIR
|
||||
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
|
||||
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
|
||||
| HITMARKER_CHARGING | HITMARKER_NEVER_SET);
|
||||
@ -662,7 +662,7 @@ void HandleAction_ActionFinished(void)
|
||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||
SpecialStatusesClear();
|
||||
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
|
||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_IGNORE_ON_AIR
|
||||
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
|
||||
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
|
||||
| HITMARKER_CHARGING | HITMARKER_NEVER_SET);
|
||||
@ -827,8 +827,7 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker)
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void MarkAllBattlersForControllerExec(void)
|
||||
static void UNUSED MarkAllBattlersForControllerExec(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1449,7 +1448,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
{
|
||||
u8 effect = 0;
|
||||
|
||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
|
||||
while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= ENDTURN_BATTLER_COUNT)
|
||||
{
|
||||
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId];
|
||||
@ -1546,7 +1545,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
if ((gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE) && gBattleMons[gActiveBattler].hp != 0)
|
||||
{
|
||||
// R/S does not perform this sleep check, which causes the nightmare effect to
|
||||
// persist even after the affected Pokemon has been awakened by Shed Skin.
|
||||
// persist even after the affected Pokémon has been awakened by Shed Skin.
|
||||
if (gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)
|
||||
{
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4;
|
||||
@ -1626,7 +1625,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
}
|
||||
if (gBattlerAttacker != gBattlersCount)
|
||||
{
|
||||
effect = 2; // a pokemon was awaken
|
||||
effect = 2; // a Pokémon was awaken
|
||||
break;
|
||||
}
|
||||
else
|
||||
@ -1686,7 +1685,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
if (gDisableStructs[gActiveBattler].disabledMove == gBattleMons[gActiveBattler].moves[i])
|
||||
break;
|
||||
}
|
||||
if (i == MAX_MON_MOVES) // pokemon does not have the disabled move anymore
|
||||
if (i == MAX_MON_MOVES) // Pokémon does not have the disabled move anymore
|
||||
{
|
||||
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
|
||||
gDisableStructs[gActiveBattler].disableTimer = 0;
|
||||
@ -1703,7 +1702,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
case ENDTURN_ENCORE: // encore
|
||||
if (gDisableStructs[gActiveBattler].encoreTimer != 0)
|
||||
{
|
||||
if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // pokemon does not have the encored move anymore
|
||||
if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // Pokémon does not have the encored move anymore
|
||||
{
|
||||
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
|
||||
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
||||
@ -1762,13 +1761,13 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
return effect;
|
||||
}
|
||||
}
|
||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||
{
|
||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
|
||||
|
||||
switch (gBattleStruct->wishPerishSongState)
|
||||
{
|
||||
@ -1797,7 +1796,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||
gBattlerTarget = gActiveBattler;
|
||||
gBattlerAttacker = gWishFutureKnock.futureSightAttacker[gActiveBattler];
|
||||
gBattleMoveDamage = gWishFutureKnock.futureSightDmg[gActiveBattler];
|
||||
gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF;
|
||||
gSpecialStatuses[gBattlerTarget].shellBellDmg = IGNORE_SHELL_BELL;
|
||||
BattleScriptExecute(BattleScript_MonTookFutureAttack);
|
||||
|
||||
if (gWishFutureKnock.futureSightCounter[gActiveBattler] == 0
|
||||
@ -1868,7 +1867,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||
break;
|
||||
}
|
||||
|
||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -2213,11 +2212,11 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
{
|
||||
// This is removed in FRLG and Emerald for some reason
|
||||
//gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
|
||||
if (gTakenDmg[gBattlerAttacker])
|
||||
if (gBideDmg[gBattlerAttacker])
|
||||
{
|
||||
gCurrentMove = MOVE_BIDE;
|
||||
*bideDmg = gTakenDmg[gBattlerAttacker] * 2;
|
||||
gBattlerTarget = gTakenDmgByBattler[gBattlerAttacker];
|
||||
*bideDmg = gBideDmg[gBattlerAttacker] * 2;
|
||||
gBattlerTarget = gBideTarget[gBattlerAttacker];
|
||||
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget])
|
||||
gBattlerTarget = GetMoveTarget(MOVE_BIDE, MOVE_TARGET_SELECTED + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_BideAttack;
|
||||
@ -2783,7 +2782,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] += MOVE_EFFECT_AFFECTS_USER;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
@ -2798,7 +2797,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_POISON;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
@ -2813,7 +2812,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_PARALYSIS;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
@ -2828,7 +2827,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_BURN;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
@ -2964,7 +2963,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
gBattleScripting.battler = gBattlerTarget;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
@ -2980,7 +2979,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
gBattleScripting.battler = gBattlerAttacker;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
@ -3004,7 +3003,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE))
|
||||
{
|
||||
u8 target2;
|
||||
side = BATTLE_OPPOSITE(GetBattlerPosition(i)) & BIT_SIDE; // side of the opposing pokemon
|
||||
side = BATTLE_OPPOSITE(GetBattlerPosition(i)) & BIT_SIDE; // side of the opposing Pokémon
|
||||
target1 = GetBattlerAtPosition(side);
|
||||
target2 = GetBattlerAtPosition(side + BIT_FLANK);
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
@ -3243,8 +3242,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
int i = 0;
|
||||
u8 effect = ITEM_NO_EFFECT;
|
||||
u8 changedPP = 0;
|
||||
u8 battlerHoldEffect, atkHoldEffect, defHoldEffect;
|
||||
u8 battlerHoldEffectParam, atkHoldEffectParam, defHoldEffectParam;
|
||||
u8 battlerHoldEffect, atkHoldEffect, UNUSED defHoldEffect;
|
||||
u8 battlerHoldEffectParam, atkHoldEffectParam, UNUSED defHoldEffectParam;
|
||||
u16 atkItem, defItem;
|
||||
|
||||
gLastUsedItem = gBattleMons[battlerId].item;
|
||||
@ -3770,8 +3769,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
break;
|
||||
case HOLD_EFFECT_SHELL_BELL:
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& gSpecialStatuses[gBattlerTarget].dmg != 0
|
||||
&& gSpecialStatuses[gBattlerTarget].dmg != 0xFFFF
|
||||
&& gSpecialStatuses[gBattlerTarget].shellBellDmg != 0
|
||||
&& gSpecialStatuses[gBattlerTarget].shellBellDmg != IGNORE_SHELL_BELL
|
||||
&& gBattlerAttacker != gBattlerTarget
|
||||
&& gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP
|
||||
&& gBattleMons[gBattlerAttacker].hp != 0)
|
||||
@ -3779,10 +3778,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
gLastUsedItem = atkItem;
|
||||
gPotentialItemEffectBattler = gBattlerAttacker;
|
||||
gBattleScripting.battler = gBattlerAttacker;
|
||||
gBattleMoveDamage = (gSpecialStatuses[gBattlerTarget].dmg / atkHoldEffectParam) * -1;
|
||||
gBattleMoveDamage = (gSpecialStatuses[gBattlerTarget].shellBellDmg / atkHoldEffectParam) * -1;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = -1;
|
||||
gSpecialStatuses[gBattlerTarget].dmg = 0;
|
||||
gSpecialStatuses[gBattlerTarget].shellBellDmg = 0;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_ItemHealHP_Ret;
|
||||
effect++;
|
||||
|
||||
@ -2377,8 +2377,7 @@ static void Debug_SetMaxRPMStage(s16 value)
|
||||
sDebug_MaxRPMStage = value;
|
||||
}
|
||||
|
||||
// Unused
|
||||
static s16 Debug_GetMaxRPMStage(void)
|
||||
static s16 UNUSED Debug_GetMaxRPMStage(void)
|
||||
{
|
||||
return sDebug_MaxRPMStage;
|
||||
}
|
||||
@ -2388,8 +2387,7 @@ static void Debug_SetGameTimeStage(s16 value)
|
||||
sDebug_GameTimeStage = value;
|
||||
}
|
||||
|
||||
// Unued
|
||||
static s16 Debug_GetGameTimeStage(void)
|
||||
static s16 UNUSED Debug_GetGameTimeStage(void)
|
||||
{
|
||||
return sDebug_GameTimeStage;
|
||||
}
|
||||
@ -2501,8 +2499,7 @@ static void CalculatePokeblock(struct BlenderBerry *berries, struct Pokeblock *p
|
||||
flavors[i] = sPokeblockFlavors[i];
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
|
||||
static void UNUSED Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
|
||||
{
|
||||
CalculatePokeblock(berries, pokeblock, numPlayers, flavors, maxRPM);
|
||||
}
|
||||
@ -3471,7 +3468,7 @@ static bool8 PrintBlendingResults(void)
|
||||
struct Pokeblock pokeblock;
|
||||
u8 flavors[FLAVOR_COUNT + 1];
|
||||
u8 text[40];
|
||||
u16 berryIds[4]; // unused
|
||||
u16 UNUSED berryIds[4];
|
||||
|
||||
switch (sBerryBlender->mainState)
|
||||
{
|
||||
@ -3866,6 +3863,9 @@ static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s3
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
#ifdef UBFIX
|
||||
default:
|
||||
#endif
|
||||
txtColor[0] = TEXT_COLOR_WHITE;
|
||||
txtColor[1] = TEXT_COLOR_DARK_GRAY;
|
||||
txtColor[2] = TEXT_COLOR_LIGHT_GRAY;
|
||||
|
||||
@ -1062,7 +1062,7 @@ static void BerryCrush_SetVBlankCB(void)
|
||||
SetVBlankCallback(VBlankCB);
|
||||
}
|
||||
|
||||
static void BerryCrush_InitVBlankCB(void)
|
||||
static void UNUSED BerryCrush_InitVBlankCB(void)
|
||||
{
|
||||
SetVBlankCallback(NULL);
|
||||
}
|
||||
|
||||
@ -34,8 +34,8 @@ static const struct {
|
||||
}
|
||||
};
|
||||
|
||||
// Unused. See berry_fix_program.c
|
||||
static void LoadBerryFixGraphics(u32 idx)
|
||||
// See berry_fix_program.c
|
||||
static void UNUSED LoadBerryFixGraphics(u32 idx)
|
||||
{
|
||||
REG_DISPCNT = 0;
|
||||
REG_BG0HOFS = 0;
|
||||
|
||||
@ -15,8 +15,7 @@
|
||||
|
||||
static EWRAM_DATA u8 sBerryPowderVendorWindowId = 0;
|
||||
|
||||
// Unused
|
||||
static const struct BgTemplate sBerryPowderBgTemplates[] =
|
||||
static const struct BgTemplate UNUSED sBerryPowderBgTemplates[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
@ -57,10 +56,9 @@ static const struct BgTemplate sBerryPowderBgTemplates[] =
|
||||
};
|
||||
|
||||
// ? Part of the BG templates?
|
||||
static const u32 sUnknown[] = {0xFF, 0x00};
|
||||
static const u32 UNUSED sUnknown[] = {0xFF, 0x00};
|
||||
|
||||
// Unused
|
||||
static const struct WindowTemplate sBerryPowderWindowTemplates[] =
|
||||
static const struct WindowTemplate UNUSED sBerryPowderWindowTemplates[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
@ -177,7 +175,7 @@ bool8 GiveBerryPowder(u32 amountToAdd)
|
||||
}
|
||||
}
|
||||
|
||||
static bool8 TakeBerryPowder_(u32 cost)
|
||||
static bool8 UNUSED TakeBerryPowder_(u32 cost)
|
||||
{
|
||||
u32 *powder = &gSaveBlock2Ptr->berryCrush.berryPowderAmount;
|
||||
if (!HasEnoughBerryPowder_(cost))
|
||||
|
||||
@ -20,7 +20,7 @@ bool16 ScriptGetPokedexInfo(void)
|
||||
return IsNationalPokedexEnabled();
|
||||
}
|
||||
|
||||
// This shows your Hoenn Pokedex rating and not your National Dex.
|
||||
// This shows your Hoenn Pokédex rating and not your National Dex.
|
||||
const u8 *GetPokedexRatingText(u16 count)
|
||||
{
|
||||
if (count < 10)
|
||||
|
||||
@ -259,7 +259,7 @@ static void DoBrailleRegisteelEffect(void)
|
||||
}
|
||||
|
||||
// theory: another commented out DoBrailleWait and Task_BrailleWait.
|
||||
static void DoBrailleWait(void)
|
||||
static void UNUSED DoBrailleWait(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||