mirror of
https://github.com/pret/pokefirered.git
synced 2026-05-09 04:23:14 -05:00
[SAVEBREAKING] Refactor/remove battle tower (#107)
This commit is contained in:
parent
30adbd6e7b
commit
69366e22b9
|
|
@ -2,7 +2,7 @@
|
|||
#include "config/battle.h"
|
||||
#include "constants/global.h"
|
||||
#include "constants/flags.h"
|
||||
#include "constants/battle_tower.h"
|
||||
#include "constants/battle_special.h"
|
||||
#include "constants/berry.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/event_object_movement.h"
|
||||
|
|
@ -812,7 +812,7 @@ gStdScriptsEnd::
|
|||
|
||||
.include "data/scripts/std_msgbox.inc"
|
||||
.include "data/scripts/trainer_battle.inc"
|
||||
|
||||
|
||||
.include "data/scripts/config.inc"
|
||||
.include "data/scripts/debug.inc"
|
||||
|
||||
|
|
@ -1129,7 +1129,7 @@ EventScript_HandOverItem::
|
|||
return
|
||||
|
||||
.include "data/scripts/pokemon_league.inc"
|
||||
.include "data/scripts/movement.inc"
|
||||
.include "data/scripts/movement.inc"
|
||||
.include "data/scripts/flavor_text.inc"
|
||||
.include "data/scripts/questionnaire.inc"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ SevenIsland_House_Room2_EventScript_BattleVisitingTrainer::
|
|||
special BufferEReaderTrainerGreeting
|
||||
msgbox gStringVar4
|
||||
closemessage
|
||||
setvar VAR_0x8004, 2
|
||||
setvar VAR_0x8004, SPECIAL_BATTLE_EREADER
|
||||
setvar VAR_0x8005, 0
|
||||
special StartSpecialBattle
|
||||
special DoSpecialTrainerBattle
|
||||
waitstate
|
||||
call_if_eq VAR_RESULT, 3, SevenIsland_House_Room2_EventScript_BattleTie
|
||||
call_if_eq VAR_RESULT, 1, SevenIsland_House_Room2_EventScript_BattleWon
|
||||
|
|
|
|||
|
|
@ -246,21 +246,7 @@ gSpecials::
|
|||
def_special NullFieldSpecial
|
||||
def_special NullFieldSpecial
|
||||
def_special GetLeadMonFriendship
|
||||
def_special BattleTowerMapScript2
|
||||
def_special ChooseNextBattleTowerTrainer
|
||||
def_special CheckPartyBattleTowerBanlist
|
||||
def_special PrintBattleTowerTrainerGreeting
|
||||
def_special BufferEReaderTrainerGreeting
|
||||
def_special StartSpecialBattle
|
||||
def_special SetBattleTowerProperty
|
||||
def_special BattleTowerUtil
|
||||
def_special SetBattleTowerParty
|
||||
def_special SaveBattleTowerProgress
|
||||
def_special BattleTower_SoftReset
|
||||
def_special DetermineBattleTowerPrize
|
||||
def_special GiveBattleTowerPrize
|
||||
def_special AwardBattleTowerRibbons
|
||||
def_special ChooseBattleTowerPlayerParty
|
||||
def_special ValidateEReaderTrainer
|
||||
def_special NullFieldSpecial
|
||||
def_special ReducePlayerPartyToSelectedMons
|
||||
|
|
@ -353,7 +339,6 @@ gSpecials::
|
|||
def_special HasAllKantoMons
|
||||
def_special IsMonOTNameNotPlayers
|
||||
def_special NullFieldSpecial
|
||||
def_special Dummy_TryEnableBravoTrainerBattleTower
|
||||
def_special DoesPartyHaveEnigmaBerry
|
||||
def_special DoSpecialTrainerBattle
|
||||
def_special SetPostgameFlags
|
||||
|
|
|
|||
|
|
@ -723,7 +723,6 @@ struct BattleStruct
|
|||
u8 magicBounceActive:1;
|
||||
u8 moveBouncer;
|
||||
// pokefirered
|
||||
u8 field_DA; // battle tower related
|
||||
u8 lastAttackerToFaintOpponent;
|
||||
};
|
||||
|
||||
|
|
@ -1175,7 +1174,7 @@ static inline struct PartyState *GetBattlerPartyState(u32 battler)
|
|||
|
||||
static inline bool32 IsDoubleBattle(void)
|
||||
{
|
||||
return (gBattleTypeFlags & BATTLE_TYPE_MORE_THAN_TWO_BATTLERS);
|
||||
return !!(gBattleTypeFlags & BATTLE_TYPE_MORE_THAN_TWO_BATTLERS);
|
||||
}
|
||||
|
||||
static inline bool32 IsSpreadMove(enum MoveTarget moveTarget)
|
||||
|
|
|
|||
|
|
@ -278,12 +278,6 @@ extern const u8 gText_Ice[];
|
|||
extern const u8 gText_Confusion[];
|
||||
extern const u8 gText_Love[];
|
||||
|
||||
extern const u8 gText_BattleTowerBan_Space[];
|
||||
extern const u8 gText_BattleTowerBan_Newline1[];
|
||||
extern const u8 gText_BattleTowerBan_Newline2[];
|
||||
extern const u8 gText_BattleTowerBan_Is1[];
|
||||
extern const u8 gText_BattleTowerBan_Is2[];
|
||||
|
||||
extern const u8 gText_StatSharply[];
|
||||
extern const u8 gText_StatRose[];
|
||||
extern const u8 gText_StatFell[];
|
||||
|
|
|
|||
10
include/battle_special.h
Normal file
10
include/battle_special.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef GUARD_BATTLE_SPECIAL_H
|
||||
#define GUARD_BATTLE_SPECIAL_H
|
||||
|
||||
void ClearEReaderTrainer(struct BattleTowerEReaderTrainer *);
|
||||
void ValidateEReaderTrainer(void);
|
||||
u8 GetEreaderTrainerFrontSpriteId(void);
|
||||
void CopyEReaderTrainerName5(u8 *dest);
|
||||
u8 GetEreaderTrainerClassId(void);
|
||||
|
||||
#endif // GUARD_BATTLE_SPECIAL_H
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
#ifndef GUARD_BATTLE_TOWER_H
|
||||
#define GUARD_BATTLE_TOWER_H
|
||||
|
||||
#include "global.h"
|
||||
#include "constants/battle_tower.h"
|
||||
|
||||
#define BATTLE_TOWER_EREADER_TRAINER_ID 200
|
||||
#define BATTLE_TOWER_RECORD_MIXING_TRAINER_BASE_ID 100
|
||||
|
||||
struct BattleTowerTrainer
|
||||
{
|
||||
u8 trainerClass;
|
||||
u8 name[3];
|
||||
u8 teamFlags;
|
||||
u16 greeting[6];
|
||||
};
|
||||
|
||||
struct BattleTowerPokemonTemplate
|
||||
{
|
||||
u16 species;
|
||||
u8 heldItem;
|
||||
u8 teamFlags;
|
||||
u16 moves[4];
|
||||
u8 evSpread;
|
||||
u8 nature;
|
||||
};
|
||||
|
||||
extern const u16 gBattleTowerBannedSpecies[];
|
||||
|
||||
void ClearEReaderTrainer(struct BattleTowerEReaderTrainer *);
|
||||
void ValidateEReaderTrainer(void);
|
||||
u8 GetBattleTowerTrainerFrontSpriteId(u16 trainerId);
|
||||
u8 GetEreaderTrainerFrontSpriteId(void);
|
||||
void CopyEReaderTrainerName5(u8 *dest);
|
||||
void GetBattleTowerTrainerName(u8 *text);
|
||||
u8 GetEreaderTrainerClassId(void);
|
||||
u8 GetBattleTowerTrainerClassNameId(void);
|
||||
void DoSpecialTrainerBattle(void);
|
||||
|
||||
#endif //GUARD_BATTLE_TOWER_H
|
||||
19
include/constants/battle_special.h
Normal file
19
include/constants/battle_special.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef GUARD_CONSTANTS_BATTLE_SPECIAL_H
|
||||
#define GUARD_CONSTANTS_BATTLE_SPECIAL_H
|
||||
|
||||
// Special trainer battles.
|
||||
enum SpecialBattle
|
||||
{
|
||||
SPECIAL_BATTLE_EREADER,
|
||||
SPECIAL_BATTLE_MULTI,
|
||||
};
|
||||
|
||||
// Ids for special multi battle types
|
||||
#define MULTI_BATTLE_2_VS_2 0
|
||||
#define MULTI_BATTLE_2_VS_WILD 1
|
||||
#define MULTI_BATTLE_2_VS_1 2
|
||||
#define MULTI_BATTLE_CHOOSE_MONS 0x80
|
||||
|
||||
#define BATTLE_TOWER_EREADER_TRAINER_ID 200
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_SPECIAL_H
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
#ifndef GUARD_CONSTANTS_BATTLE_TOWER_H
|
||||
#define GUARD_CONSTANTS_BATTLE_TOWER_H
|
||||
|
||||
#define F_EV_SPREAD_HP 1 << 0
|
||||
#define F_EV_SPREAD_ATTACK 1 << 1
|
||||
#define F_EV_SPREAD_DEFENSE 1 << 2
|
||||
#define F_EV_SPREAD_SPEED 1 << 3
|
||||
#define F_EV_SPREAD_SP_ATTACK 1 << 4
|
||||
#define F_EV_SPREAD_SP_DEFENSE 1 << 5
|
||||
|
||||
#define BATTLE_TOWER_ITEM_NONE 0
|
||||
#define BATTLE_TOWER_ITEM_KINGS_ROCK 1
|
||||
#define BATTLE_TOWER_ITEM_SITRUS_BERRY 2
|
||||
#define BATTLE_TOWER_ITEM_ORAN_BERRY 3
|
||||
#define BATTLE_TOWER_ITEM_CHESTO_BERRY 4
|
||||
#define BATTLE_TOWER_ITEM_HARD_STONE 5
|
||||
#define BATTLE_TOWER_ITEM_FOCUS_BAND 6
|
||||
#define BATTLE_TOWER_ITEM_PERSIM_BERRY 7
|
||||
#define BATTLE_TOWER_ITEM_MIRACLE_SEED 8
|
||||
#define BATTLE_TOWER_ITEM_BERRY_JUICE 9
|
||||
#define BATTLE_TOWER_ITEM_MACHO_BRACE 10
|
||||
#define BATTLE_TOWER_ITEM_SILVER_POWDER 11
|
||||
#define BATTLE_TOWER_ITEM_CHERI_BERRY 12
|
||||
#define BATTLE_TOWER_ITEM_BLACK_GLASSES 13
|
||||
#define BATTLE_TOWER_ITEM_BLACK_BELT 14
|
||||
#define BATTLE_TOWER_ITEM_SOUL_DEW 15
|
||||
#define BATTLE_TOWER_ITEM_CHOICE_BAND 16
|
||||
#define BATTLE_TOWER_ITEM_MAGNET 17
|
||||
#define BATTLE_TOWER_ITEM_SILK_SCARF 18
|
||||
#define BATTLE_TOWER_ITEM_WHITE_HERB 19
|
||||
#define BATTLE_TOWER_ITEM_DEEP_SEA_SCALE 20
|
||||
#define BATTLE_TOWER_ITEM_DEEP_SEA_TOOTH 21
|
||||
#define BATTLE_TOWER_ITEM_MYSTIC_WATER 22
|
||||
#define BATTLE_TOWER_ITEM_SHARP_BEAK 23
|
||||
#define BATTLE_TOWER_ITEM_QUICK_CLAW 24
|
||||
#define BATTLE_TOWER_ITEM_LEFTOVERS 25
|
||||
#define BATTLE_TOWER_ITEM_RAWST_BERRY 26
|
||||
#define BATTLE_TOWER_ITEM_LIGHT_BALL 27
|
||||
#define BATTLE_TOWER_ITEM_POISON_BARB 28
|
||||
#define BATTLE_TOWER_ITEM_NEVER_MELT_ICE 29
|
||||
#define BATTLE_TOWER_ITEM_ASPEAR_BERRY 30
|
||||
#define BATTLE_TOWER_ITEM_SPELL_TAG 31
|
||||
#define BATTLE_TOWER_ITEM_BRIGHT_POWDER 32
|
||||
#define BATTLE_TOWER_ITEM_LEPPA_BERRY 33
|
||||
#define BATTLE_TOWER_ITEM_SCOPE_LENS 34
|
||||
#define BATTLE_TOWER_ITEM_TWISTED_SPOON 35
|
||||
#define BATTLE_TOWER_ITEM_METAL_COAT 36
|
||||
#define BATTLE_TOWER_ITEM_MENTAL_HERB 37
|
||||
#define BATTLE_TOWER_ITEM_CHARCOAL 38
|
||||
#define BATTLE_TOWER_ITEM_PECHA_BERRY 39
|
||||
#define BATTLE_TOWER_ITEM_SOFT_SAND 40
|
||||
#define BATTLE_TOWER_ITEM_LUM_BERRY 41
|
||||
#define BATTLE_TOWER_ITEM_DRAGON_SCALE 42
|
||||
#define BATTLE_TOWER_ITEM_DRAGON_FANG 43
|
||||
#define BATTLE_TOWER_ITEM_IAPAPA_BERRY 44
|
||||
#define BATTLE_TOWER_ITEM_WIKI_BERRY 45
|
||||
#define BATTLE_TOWER_ITEM_SEA_INCENSE 46
|
||||
#define BATTLE_TOWER_ITEM_SHELL_BELL 47
|
||||
#define BATTLE_TOWER_ITEM_SALAC_BERRY 48
|
||||
#define BATTLE_TOWER_ITEM_LANSAT_BERRY 49
|
||||
#define BATTLE_TOWER_ITEM_APICOT_BERRY 50
|
||||
#define BATTLE_TOWER_ITEM_STARF_BERRY 51
|
||||
#define BATTLE_TOWER_ITEM_LIECHI_BERRY 52
|
||||
#define BATTLE_TOWER_ITEM_STICK 53
|
||||
#define BATTLE_TOWER_ITEM_LAX_INCENSE 54
|
||||
#define BATTLE_TOWER_ITEM_AGUAV_BERRY 55
|
||||
#define BATTLE_TOWER_ITEM_FIGY_BERRY 56
|
||||
#define BATTLE_TOWER_ITEM_THICK_CLUB 57
|
||||
#define BATTLE_TOWER_ITEM_MAGO_BERRY 58
|
||||
#define BATTLE_TOWER_ITEM_METAL_POWDER 59
|
||||
#define BATTLE_TOWER_ITEM_PETAYA_BERRY 60
|
||||
#define BATTLE_TOWER_ITEM_LUCKY_PUNCH 61
|
||||
#define BATTLE_TOWER_ITEM_GANLON_BERRY 62
|
||||
|
||||
#define BTSPECIAL_TEST 0
|
||||
#define BTSPECIAL_RESULT_SAVE_SCUM 1
|
||||
#define BTSPECIAL_RESULT_WON7 2
|
||||
#define BTSPECIAL_RESULT_LOST 3
|
||||
#define BTSPECIAL_RESULT_QUICKSAVE 4
|
||||
#define BTSPECIAL_RESULT_INACTIVE 5
|
||||
|
||||
// Ids for special multi battle types
|
||||
#define MULTI_BATTLE_2_VS_2 0
|
||||
#define MULTI_BATTLE_2_VS_WILD 1
|
||||
#define MULTI_BATTLE_2_VS_1 2
|
||||
#define MULTI_BATTLE_CHOOSE_MONS 0x80
|
||||
|
||||
|
||||
#define SPECIAL_BATTLE_MULTI 10
|
||||
|
||||
#endif //GUARD_CONSTANTS_BATTLE_TOWER_H
|
||||
|
|
@ -106,7 +106,6 @@
|
|||
enum
|
||||
{
|
||||
CHOOSE_MONS_FOR_CABLE_CLUB_BATTLE,
|
||||
CHOOSE_MONS_FOR_BATTLE_TOWER,
|
||||
CHOOSE_MONS_FOR_UNION_ROOM_BATTLE,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -58,355 +58,6 @@ extern const u8 EventScript_FollowerFaceUp[];
|
|||
extern const u8 EventScript_FollowerFaceResult[];
|
||||
extern const u8 EnterPokeballMovement[];
|
||||
|
||||
extern const u8 gTVBravoTrainerText00[];
|
||||
extern const u8 gTVBravoTrainerText01[];
|
||||
extern const u8 gTVBravoTrainerText02[];
|
||||
extern const u8 gTVBravoTrainerText03[];
|
||||
extern const u8 gTVBravoTrainerText04[];
|
||||
extern const u8 gTVBravoTrainerText05[];
|
||||
extern const u8 gTVBravoTrainerText06[];
|
||||
extern const u8 gTVBravoTrainerText07[];
|
||||
extern const u8 gTVBravoTrainerText08[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText00[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText01[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText02[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText03[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText04[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText05[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText06[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText07[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText08[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText09[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText10[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText11[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText12[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText13[];
|
||||
extern const u8 gTVBravoTrainerBattleTowerText14[];
|
||||
extern const u8 gTVFanClubOpinionsText00[];
|
||||
extern const u8 gTVFanClubOpinionsText01[];
|
||||
extern const u8 gTVFanClubOpinionsText02[];
|
||||
extern const u8 gTVFanClubOpinionsText03[];
|
||||
extern const u8 gTVFanClubOpinionsText04[];
|
||||
extern const u8 gTVFanClubText00[];
|
||||
extern const u8 gTVFanClubText01[];
|
||||
extern const u8 gTVFanClubText02[];
|
||||
extern const u8 gTVFanClubText03[];
|
||||
extern const u8 gTVFanClubText04[];
|
||||
extern const u8 gTVFanClubText05[];
|
||||
extern const u8 gTVFanClubText06[];
|
||||
extern const u8 gTVFanClubText07[];
|
||||
extern const u8 gTVRecentHappeningsText00[];
|
||||
extern const u8 gTVRecentHappeningsText01[];
|
||||
extern const u8 gTVRecentHappeningsText02[];
|
||||
extern const u8 gTVRecentHappeningsText03[];
|
||||
extern const u8 gTVRecentHappeningsText04[];
|
||||
extern const u8 gTVRecentHappeningsText05[];
|
||||
extern const u8 gTVMassOutbreakText00[];
|
||||
extern const u8 gTV3CheersForPokeblocksText00[];
|
||||
extern const u8 gTV3CheersForPokeblocksText01[];
|
||||
extern const u8 gTV3CheersForPokeblocksText02[];
|
||||
extern const u8 gTV3CheersForPokeblocksText03[];
|
||||
extern const u8 gTV3CheersForPokeblocksText04[];
|
||||
extern const u8 gTV3CheersForPokeblocksText05[];
|
||||
extern const u8 gTVTrainerFanClubSpecialText00[];
|
||||
extern const u8 gTVTrainerFanClubSpecialText01[];
|
||||
extern const u8 gTVTrainerFanClubSpecialText02[];
|
||||
extern const u8 gTVTrainerFanClubSpecialText03[];
|
||||
extern const u8 gTVTrainerFanClubSpecialText04[];
|
||||
extern const u8 gTVTrainerFanClubSpecialText05[];
|
||||
extern const u8 gTVNameRaterText00[];
|
||||
extern const u8 gTVNameRaterText01[];
|
||||
extern const u8 gTVNameRaterText02[];
|
||||
extern const u8 gTVNameRaterText03[];
|
||||
extern const u8 gTVNameRaterText04[];
|
||||
extern const u8 gTVNameRaterText05[];
|
||||
extern const u8 gTVNameRaterText06[];
|
||||
extern const u8 gTVNameRaterText07[];
|
||||
extern const u8 gTVNameRaterText08[];
|
||||
extern const u8 gTVNameRaterText09[];
|
||||
extern const u8 gTVNameRaterText10[];
|
||||
extern const u8 gTVNameRaterText11[];
|
||||
extern const u8 gTVNameRaterText12[];
|
||||
extern const u8 gTVNameRaterText13[];
|
||||
extern const u8 gTVNameRaterText14[];
|
||||
extern const u8 gTVNameRaterText15[];
|
||||
extern const u8 gTVNameRaterText16[];
|
||||
extern const u8 gTVNameRaterText17[];
|
||||
extern const u8 gTVNameRaterText18[];
|
||||
extern const u8 gTVPokemonAnglerText00[];
|
||||
extern const u8 gTVPokemonAnglerText01[];
|
||||
extern const u8 gTVPokemonTodayFailedText00[];
|
||||
extern const u8 gTVPokemonTodayFailedText01[];
|
||||
extern const u8 gTVPokemonTodayFailedText02[];
|
||||
extern const u8 gTVPokemonTodayFailedText03[];
|
||||
extern const u8 gTVPokemonTodayFailedText04[];
|
||||
extern const u8 gTVPokemonTodayFailedText05[];
|
||||
extern const u8 gTVPokemonTodayFailedText06[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText00[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText01[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText02[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText03[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText04[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText05[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText06[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText07[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText08[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText09[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText10[];
|
||||
extern const u8 gTVPokemonTodaySuccessfulText11[];
|
||||
extern const u8 gTVTodaysSmartShopperText00[];
|
||||
extern const u8 gTVTodaysSmartShopperText01[];
|
||||
extern const u8 gTVTodaysSmartShopperText02[];
|
||||
extern const u8 gTVTodaysSmartShopperText03[];
|
||||
extern const u8 gTVTodaysSmartShopperText04[];
|
||||
extern const u8 gTVTodaysSmartShopperText05[];
|
||||
extern const u8 gTVTodaysSmartShopperText06[];
|
||||
extern const u8 gTVTodaysSmartShopperText07[];
|
||||
extern const u8 gTVTodaysSmartShopperText08[];
|
||||
extern const u8 gTVTodaysSmartShopperText09[];
|
||||
extern const u8 gTVTodaysSmartShopperText10[];
|
||||
extern const u8 gTVTodaysSmartShopperText11[];
|
||||
extern const u8 gTVTodaysSmartShopperText12[];
|
||||
extern const u8 gTVWorldOfMastersText00[];
|
||||
extern const u8 gTVWorldOfMastersText01[];
|
||||
extern const u8 gTVWorldOfMastersText02[];
|
||||
extern const u8 gTVTodaysRivalTrainerText00[];
|
||||
extern const u8 gTVTodaysRivalTrainerText07[];
|
||||
extern const u8 gTVTodaysRivalTrainerText08[];
|
||||
extern const u8 gTVTodaysRivalTrainerText09[];
|
||||
extern const u8 gTVTodaysRivalTrainerText10[];
|
||||
extern const u8 gTVTodaysRivalTrainerText01[];
|
||||
extern const u8 gTVTodaysRivalTrainerText02[];
|
||||
extern const u8 gTVTodaysRivalTrainerText03[];
|
||||
extern const u8 gTVTodaysRivalTrainerText04[];
|
||||
extern const u8 gTVTodaysRivalTrainerText05[];
|
||||
extern const u8 gTVTodaysRivalTrainerText06[];
|
||||
extern const u8 gTVDewfordTrendWatcherNetworkText00[];
|
||||
extern const u8 gTVDewfordTrendWatcherNetworkText01[];
|
||||
extern const u8 gTVDewfordTrendWatcherNetworkText02[];
|
||||
extern const u8 gTVDewfordTrendWatcherNetworkText03[];
|
||||
extern const u8 gTVDewfordTrendWatcherNetworkText04[];
|
||||
extern const u8 gTVDewfordTrendWatcherNetworkText05[];
|
||||
extern const u8 gTVDewfordTrendWatcherNetworkText06[];
|
||||
extern const u8 gTVHoennTreasureInvestigatorsText00[];
|
||||
extern const u8 gTVHoennTreasureInvestigatorsText01[];
|
||||
extern const u8 gTVHoennTreasureInvestigatorsText02[];
|
||||
extern const u8 gTVFindThatGamerText00[];
|
||||
extern const u8 gTVFindThatGamerText01[];
|
||||
extern const u8 gTVFindThatGamerText02[];
|
||||
extern const u8 gTVFindThatGamerText03[];
|
||||
extern const u8 gTVBreakingNewsText00[];
|
||||
extern const u8 gTVBreakingNewsText01[];
|
||||
extern const u8 gTVBreakingNewsText02[];
|
||||
extern const u8 gTVBreakingNewsText03[];
|
||||
extern const u8 gTVBreakingNewsText04[];
|
||||
extern const u8 gTVBreakingNewsText05[];
|
||||
extern const u8 gTVBreakingNewsText06[];
|
||||
extern const u8 gTVBreakingNewsText07[];
|
||||
extern const u8 gTVBreakingNewsText12[];
|
||||
extern const u8 gTVBreakingNewsText08[];
|
||||
extern const u8 gTVBreakingNewsText09[];
|
||||
extern const u8 gTVBreakingNewsText10[];
|
||||
extern const u8 gTVBreakingNewsText11[];
|
||||
extern const u8 gTVSecretBaseVisitText00[];
|
||||
extern const u8 gTVSecretBaseVisitText01[];
|
||||
extern const u8 gTVSecretBaseVisitText02[];
|
||||
extern const u8 gTVSecretBaseVisitText03[];
|
||||
extern const u8 gTVSecretBaseVisitText04[];
|
||||
extern const u8 gTVSecretBaseVisitText05[];
|
||||
extern const u8 gTVSecretBaseVisitText06[];
|
||||
extern const u8 gTVSecretBaseVisitText07[];
|
||||
extern const u8 gTVSecretBaseVisitText08[];
|
||||
extern const u8 gTVSecretBaseVisitText09[];
|
||||
extern const u8 gTVSecretBaseVisitText10[];
|
||||
extern const u8 gTVSecretBaseVisitText11[];
|
||||
extern const u8 gTVSecretBaseVisitText12[];
|
||||
extern const u8 gTVSecretBaseVisitText13[];
|
||||
extern const u8 gTVPokemonLotteryWinnerFlashReportText00[];
|
||||
extern const u8 gTVThePokemonBattleSeminarText00[];
|
||||
extern const u8 gTVThePokemonBattleSeminarText01[];
|
||||
extern const u8 gTVThePokemonBattleSeminarText02[];
|
||||
extern const u8 gTVThePokemonBattleSeminarText03[];
|
||||
extern const u8 gTVThePokemonBattleSeminarText04[];
|
||||
extern const u8 gTVThePokemonBattleSeminarText05[];
|
||||
extern const u8 gTVThePokemonBattleSeminarText06[];
|
||||
extern const u8 gTVTrainerFanClubText00[];
|
||||
extern const u8 gTVTrainerFanClubText01[];
|
||||
extern const u8 gTVTrainerFanClubText02[];
|
||||
extern const u8 gTVTrainerFanClubText03[];
|
||||
extern const u8 gTVTrainerFanClubText04[];
|
||||
extern const u8 gTVTrainerFanClubText05[];
|
||||
extern const u8 gTVTrainerFanClubText06[];
|
||||
extern const u8 gTVTrainerFanClubText07[];
|
||||
extern const u8 gTVTrainerFanClubText08[];
|
||||
extern const u8 gTVTrainerFanClubText09[];
|
||||
extern const u8 gTVTrainerFanClubText10[];
|
||||
extern const u8 gTVTrainerFanClubText11[];
|
||||
extern const u8 gTVCutiesText00[];
|
||||
extern const u8 gTVCutiesText01[];
|
||||
extern const u8 gTVCutiesText02[];
|
||||
extern const u8 gTVCutiesText03[];
|
||||
extern const u8 gTVCutiesText04[];
|
||||
extern const u8 gTVCutiesText05[];
|
||||
extern const u8 gTVCutiesText06[];
|
||||
extern const u8 gTVCutiesText07[];
|
||||
extern const u8 gTVCutiesText08[];
|
||||
extern const u8 gTVCutiesText09[];
|
||||
extern const u8 gTVCutiesText10[];
|
||||
extern const u8 gTVCutiesText11[];
|
||||
extern const u8 gTVCutiesText12[];
|
||||
extern const u8 gTVCutiesText13[];
|
||||
extern const u8 gTVCutiesText14[];
|
||||
extern const u8 gTVCutiesText15[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText00[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText01[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText02[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText03[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText04[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText05[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText06[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText07[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText08[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText09[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText10[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText11[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText12[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText13[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText14[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText15[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText16[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText17[];
|
||||
extern const u8 gTVPokemonNewsBattleFrontierText18[];
|
||||
extern const u8 gTVWhatsNo1InHoennTodayText00[];
|
||||
extern const u8 gTVWhatsNo1InHoennTodayText01[];
|
||||
extern const u8 gTVWhatsNo1InHoennTodayText02[];
|
||||
extern const u8 gTVWhatsNo1InHoennTodayText03[];
|
||||
extern const u8 gTVWhatsNo1InHoennTodayText04[];
|
||||
extern const u8 gTVWhatsNo1InHoennTodayText05[];
|
||||
extern const u8 gTVWhatsNo1InHoennTodayText06[];
|
||||
extern const u8 gTVWhatsNo1InHoennTodayText07[];
|
||||
extern const u8 gTVWhatsNo1InHoennTodayText08[];
|
||||
extern const u8 gTVSecretBaseSecretsText00[];
|
||||
extern const u8 gTVSecretBaseSecretsText01[];
|
||||
extern const u8 gTVSecretBaseSecretsText02[];
|
||||
extern const u8 gTVSecretBaseSecretsText03[];
|
||||
extern const u8 gTVSecretBaseSecretsText04[];
|
||||
extern const u8 gTVSecretBaseSecretsText05[];
|
||||
extern const u8 gTVSecretBaseSecretsText06[];
|
||||
extern const u8 gTVSecretBaseSecretsText07[];
|
||||
extern const u8 gTVSecretBaseSecretsText08[];
|
||||
extern const u8 gTVSecretBaseSecretsText09[];
|
||||
extern const u8 gTVSecretBaseSecretsText10[];
|
||||
extern const u8 gTVSecretBaseSecretsText11[];
|
||||
extern const u8 gTVSecretBaseSecretsText12[];
|
||||
extern const u8 gTVSecretBaseSecretsText13[];
|
||||
extern const u8 gTVSecretBaseSecretsText14[];
|
||||
extern const u8 gTVSecretBaseSecretsText15[];
|
||||
extern const u8 gTVSecretBaseSecretsText16[];
|
||||
extern const u8 gTVSecretBaseSecretsText17[];
|
||||
extern const u8 gTVSecretBaseSecretsText18[];
|
||||
extern const u8 gTVSecretBaseSecretsText19[];
|
||||
extern const u8 gTVSecretBaseSecretsText20[];
|
||||
extern const u8 gTVSecretBaseSecretsText21[];
|
||||
extern const u8 gTVSecretBaseSecretsText22[];
|
||||
extern const u8 gTVSecretBaseSecretsText23[];
|
||||
extern const u8 gTVSecretBaseSecretsText24[];
|
||||
extern const u8 gTVSecretBaseSecretsText25[];
|
||||
extern const u8 gTVSecretBaseSecretsText26[];
|
||||
extern const u8 gTVSecretBaseSecretsText27[];
|
||||
extern const u8 gTVSecretBaseSecretsText28[];
|
||||
extern const u8 gTVSecretBaseSecretsText29[];
|
||||
extern const u8 gTVSecretBaseSecretsText30[];
|
||||
extern const u8 gTVSecretBaseSecretsText31[];
|
||||
extern const u8 gTVSecretBaseSecretsText32[];
|
||||
extern const u8 gTVSecretBaseSecretsText33[];
|
||||
extern const u8 gTVSecretBaseSecretsText34[];
|
||||
extern const u8 gTVSecretBaseSecretsText35[];
|
||||
extern const u8 gTVSecretBaseSecretsText36[];
|
||||
extern const u8 gTVSecretBaseSecretsText37[];
|
||||
extern const u8 gTVSecretBaseSecretsText38[];
|
||||
extern const u8 gTVSecretBaseSecretsText39[];
|
||||
extern const u8 gTVSecretBaseSecretsText40[];
|
||||
extern const u8 gTVSecretBaseSecretsText41[];
|
||||
extern const u8 gTVSecretBaseSecretsText42[];
|
||||
extern const u8 gTVSafariFanClubText00[];
|
||||
extern const u8 gTVSafariFanClubText01[];
|
||||
extern const u8 gTVSafariFanClubText02[];
|
||||
extern const u8 gTVSafariFanClubText03[];
|
||||
extern const u8 gTVSafariFanClubText04[];
|
||||
extern const u8 gTVSafariFanClubText05[];
|
||||
extern const u8 gTVSafariFanClubText06[];
|
||||
extern const u8 gTVSafariFanClubText07[];
|
||||
extern const u8 gTVSafariFanClubText08[];
|
||||
extern const u8 gTVSafariFanClubText09[];
|
||||
extern const u8 gTVSafariFanClubText10[];
|
||||
extern const u8 gTVContestLiveUpdatesText00[];
|
||||
extern const u8 gTVContestLiveUpdatesText01[];
|
||||
extern const u8 gTVContestLiveUpdatesText02[];
|
||||
extern const u8 gTVContestLiveUpdatesText03[];
|
||||
extern const u8 gTVContestLiveUpdatesText04[];
|
||||
extern const u8 gTVContestLiveUpdatesText05[];
|
||||
extern const u8 gTVContestLiveUpdatesText06[];
|
||||
extern const u8 gTVContestLiveUpdatesText07[];
|
||||
extern const u8 gTVContestLiveUpdatesText08[];
|
||||
extern const u8 gTVContestLiveUpdatesText09[];
|
||||
extern const u8 gTVContestLiveUpdatesText10[];
|
||||
extern const u8 gTVContestLiveUpdatesText11[];
|
||||
extern const u8 gTVContestLiveUpdatesText12[];
|
||||
extern const u8 gTVContestLiveUpdatesText13[];
|
||||
extern const u8 gTVContestLiveUpdatesText14[];
|
||||
extern const u8 gTVContestLiveUpdatesText15[];
|
||||
extern const u8 gTVContestLiveUpdatesText16[];
|
||||
extern const u8 gTVContestLiveUpdatesText17[];
|
||||
extern const u8 gTVContestLiveUpdatesText18[];
|
||||
extern const u8 gTVContestLiveUpdatesText19[];
|
||||
extern const u8 gTVContestLiveUpdatesText20[];
|
||||
extern const u8 gTVContestLiveUpdatesText21[];
|
||||
extern const u8 gTVContestLiveUpdatesText22[];
|
||||
extern const u8 gTVContestLiveUpdatesText23[];
|
||||
extern const u8 gTVContestLiveUpdatesText24[];
|
||||
extern const u8 gTVContestLiveUpdatesText25[];
|
||||
extern const u8 gTVContestLiveUpdatesText26[];
|
||||
extern const u8 gTVContestLiveUpdatesText27[];
|
||||
extern const u8 gTVContestLiveUpdatesText28[];
|
||||
extern const u8 gTVContestLiveUpdatesText29[];
|
||||
extern const u8 gTVContestLiveUpdatesText30[];
|
||||
extern const u8 gTVContestLiveUpdatesText31[];
|
||||
extern const u8 gTVContestLiveUpdatesText32[];
|
||||
extern const u8 gTVPokemonBattleUpdateText00[];
|
||||
extern const u8 gTVPokemonBattleUpdateText01[];
|
||||
extern const u8 gTVPokemonBattleUpdateText02[];
|
||||
extern const u8 gTVPokemonBattleUpdateText03[];
|
||||
extern const u8 gTVPokemonBattleUpdateText04[];
|
||||
extern const u8 gTVPokemonBattleUpdateText05[];
|
||||
extern const u8 gTVPokemonBattleUpdateText06[];
|
||||
extern const u8 gTVPokemonBattleUpdateText07[];
|
||||
extern const u8 gTVInSearchOfTrainersText00[];
|
||||
extern const u8 gTVInSearchOfTrainersText01[];
|
||||
extern const u8 gTVInSearchOfTrainersText02[];
|
||||
extern const u8 gTVInSearchOfTrainersText03[];
|
||||
extern const u8 gTVInSearchOfTrainersText04[];
|
||||
extern const u8 gTVInSearchOfTrainersText05[];
|
||||
extern const u8 gTVInSearchOfTrainersText06[];
|
||||
extern const u8 gTVInSearchOfTrainersText07[];
|
||||
extern const u8 gTVInSearchOfTrainersText08[];
|
||||
extern const u8 gTVPokemonContestLiveUpdates2Text00[];
|
||||
extern const u8 gTVPokemonContestLiveUpdates2Text01[];
|
||||
extern const u8 gTVPokemonContestLiveUpdates2Text02[];
|
||||
extern const u8 gTVPokemonContestLiveUpdates2Text03[];
|
||||
extern const u8 gPokeNewsTextSlateport_Upcoming[];
|
||||
extern const u8 gPokeNewsTextSlateport_Ongoing[];
|
||||
extern const u8 gPokeNewsTextSlateport_Ending[];
|
||||
extern const u8 gPokeNewsTextGameCorner_Upcoming[];
|
||||
extern const u8 gPokeNewsTextGameCorner_Ongoing[];
|
||||
extern const u8 gPokeNewsTextGameCorner_Ending[];
|
||||
extern const u8 gPokeNewsTextLilycove_Upcoming[];
|
||||
extern const u8 gPokeNewsTextLilycove_Ongoing[];
|
||||
extern const u8 gPokeNewsTextLilycove_Ending[];
|
||||
extern const u8 gPokeNewsTextBlendMaster_Upcoming[];
|
||||
extern const u8 gPokeNewsTextBlendMaster_Ongoing[];
|
||||
extern const u8 gPokeNewsTextBlendMaster_Ending[];
|
||||
|
||||
extern const u8 gText_LtSurge[];
|
||||
extern const u8 gText_Koga[];
|
||||
extern const u8 gText_PokemonCenter[];
|
||||
|
|
|
|||
|
|
@ -374,18 +374,6 @@ struct RecordMixingGift
|
|||
#include "global.berry.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
struct BattleTowerRecord // record mixing
|
||||
{
|
||||
/*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100
|
||||
/*0x01*/ u8 trainerClass;
|
||||
/*0x02*/ u16 winStreak;
|
||||
/*0x04*/ u8 name[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x0C*/ u8 trainerId[TRAINER_ID_LENGTH];
|
||||
/*0x10*/ u16 greeting[EASY_CHAT_BATTLE_WORDS_COUNT];
|
||||
/*0x1C*/ struct BattleTowerPokemon party[3];
|
||||
/*0xA0*/ u32 checksum;
|
||||
};
|
||||
|
||||
struct BattleTowerEReaderTrainer
|
||||
{
|
||||
/*0x4A0 0x3F0 0x00*/ u8 unk0;
|
||||
|
|
@ -400,35 +388,6 @@ struct BattleTowerEReaderTrainer
|
|||
/*0x558 0x4A8 0xB8*/ u32 checksum;
|
||||
};
|
||||
|
||||
struct BattleTowerData // Leftover from R/S
|
||||
{
|
||||
struct BattleTowerRecord playerRecord;
|
||||
struct BattleTowerRecord records[5]; // from record mixing
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
struct BattleTowerEReaderTrainer ereaderTrainer;
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
u16 firstMonSpecies; // species of the first pokemon in the player's battle tower party
|
||||
u16 defeatedBySpecies; // species of the pokemon that defated the player
|
||||
u16 curChallengeBattleNum[2]; // 1-based index of battle in the current challenge. (challenges consist of 7 battles)
|
||||
u16 curStreakChallengesNum[2]; // 1-based index of the current challenge in the current streak.
|
||||
u16 recordWinStreaks[2];
|
||||
u16 prizeItem;
|
||||
u16 totalBattleTowerWins;
|
||||
u16 bestBattleTowerWinStreak;
|
||||
u16 currentWinStreaks[2];
|
||||
u8 defeatedByTrainerName[8];
|
||||
u8 firstMonNickname[VANILLA_POKEMON_NAME_LENGTH]; // nickname of the first pokemon in the player's battle tower party
|
||||
u8 battleTowerLevelType:1; // 0 = level 50; 1 = level 100
|
||||
u8 unk_554:1;
|
||||
u8 battleOutcome;
|
||||
u8 var_4AE[2];
|
||||
u8 battleTowerTrainerId; // index for gBattleTowerTrainers table
|
||||
u8 selectedPartyMons[MAX_FRONTIER_PARTY_SIZE];
|
||||
u8 battledTrainerIds[6];
|
||||
u8 lastStreakLevelType; // 0 = level 50, 1 = level 100. level type of the last streak. Used by tv to report the level mode.
|
||||
u8 filler_4D1[0x316];
|
||||
};
|
||||
|
||||
struct SaveBlock2
|
||||
{
|
||||
/*0x000*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||
|
|
@ -452,7 +411,10 @@ struct SaveBlock2
|
|||
/*0x0A8*/ u32 gcnLinkFlags; // Read by Pokemon Colosseum/XD
|
||||
/*0x0AC*/ bool8 unkFlag1; // Set TRUE, never read
|
||||
/*0x0AD*/ bool8 unkFlag2; // Set FALSE, never read
|
||||
/*0x0B0*/ struct BattleTowerData battleTower;
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
struct BattleTowerEReaderTrainer ereaderTrainer;
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
u8 selectedPartyMons[MAX_FRONTIER_PARTY_SIZE]; // temporary, replace with frontier
|
||||
/*0x898*/ u16 mapView[0x100];
|
||||
#if FREE_LINK_BATTLE_RECORDS == FALSE
|
||||
/*0xA98*/ struct LinkBattleRecords linkBattleRecords;
|
||||
|
|
@ -463,7 +425,7 @@ struct SaveBlock2
|
|||
#endif //FREE_POKEMON_JUMP
|
||||
/*0xB10*/ struct BerryPickingResults berryPick;
|
||||
/*0x169C*/ struct BerryTree berryTrees[BERRY_TREES_COUNT]; // moved to SaveBlock2 due to QuestLogScene taking up SaveBlock1
|
||||
/*0x???*/ u8 filler_90[212];
|
||||
/*0x???*/ u8 filler_90[2044];
|
||||
}; // size: 0xF24
|
||||
|
||||
extern struct SaveBlock2 *gSaveBlock2Ptr;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include "battle_interface.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
// #include "battle_tv.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
|
|
@ -336,12 +335,7 @@ static void LinkOpponentHandleDrawTrainerPic(u32 battler)
|
|||
|
||||
static void LinkOpponentHandleTrainerSlide(u32 battler)
|
||||
{
|
||||
u32 trainerPicId;
|
||||
|
||||
if (battler == B_POSITION_OPPONENT_LEFT)
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId(TRAINER_BATTLE_PARAM.opponentA);
|
||||
else
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId(TRAINER_BATTLE_PARAM.opponentB);
|
||||
u32 trainerPicId = TRAINER_PIC_RED;
|
||||
|
||||
BtlController_HandleTrainerSlide(battler, trainerPicId);
|
||||
BtlController_Complete(battler); // Possibly a bug, because execution should be completed after the slide in finishes. See Controller_WaitForTrainerPic.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include "battle_interface.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
// #include "battle_tv.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "battle_message.h"
|
||||
#include "battle_interface.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
#include "battle_special.h"
|
||||
// #include "battle_special.h"
|
||||
// #include "battle_tv.h"
|
||||
#include "battle_z_move.h"
|
||||
|
|
@ -317,17 +317,7 @@ static u32 OpponentGetTrainerPicId(u32 battlerId)
|
|||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
{
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
|
||||
{
|
||||
if (battlerId == 1)
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId(TRAINER_BATTLE_PARAM.opponentA);
|
||||
else
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId(TRAINER_BATTLE_PARAM.opponentB);
|
||||
}
|
||||
else
|
||||
{
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId(TRAINER_BATTLE_PARAM.opponentA);
|
||||
}
|
||||
trainerPicId = TRAINER_PIC_RED; // placeholder
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_TOWER)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include "battle_message.h"
|
||||
#include "battle_interface.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
#include "battle_z_move.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
|
|
@ -241,7 +240,7 @@ static void PlayerPartnerHandleDrawTrainerPic(u32 battler)
|
|||
}
|
||||
else
|
||||
{
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId(gPartnerTrainerId);
|
||||
trainerPicId = TRAINER_PIC_RED;
|
||||
xPos = 32;
|
||||
yPos = 80;
|
||||
}
|
||||
|
|
@ -360,7 +359,7 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(u32 battler)
|
|||
else if (IsAiVsAiBattle())
|
||||
trainerPal = gTrainerSprites[GetTrainerBackPicFromId(gPartnerTrainerId)].palette.data;
|
||||
else
|
||||
trainerPal = gTrainerSprites[GetBattleTowerTrainerFrontSpriteId(gPartnerTrainerId)].palette.data; // 2 vs 2 multi battle in Battle Frontier, load front sprite and pal.
|
||||
trainerPal = gTrainerSprites[TRAINER_PIC_RED].palette.data; // 2 vs 2 multi battle in Battle Frontier, load front sprite and pal.
|
||||
|
||||
BtlController_HandleIntroTrainerBallThrow(battler, 0xD6F9, trainerPal, 24, Controller_PlayerPartnerShowIntroHealthbox);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include "battle_interface.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
// #include "battle_tv.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
|
|
@ -300,28 +299,17 @@ static void RecordedOpponentHandleDrawTrainerPic(u32 battler)
|
|||
xPos = 200;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
|
||||
{
|
||||
if (battler == B_POSITION_OPPONENT_LEFT)
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId(TRAINER_BATTLE_PARAM.opponentA);
|
||||
else
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId(TRAINER_BATTLE_PARAM.opponentB);
|
||||
}
|
||||
trainerPicId = TRAINER_PIC_RED;
|
||||
else
|
||||
{
|
||||
trainerPicId = PlayerGenderToFrontTrainerPicId(GetBattlerLinkPlayerGender(battler));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
xPos = 176;
|
||||
if (TRAINER_BATTLE_PARAM.opponentA == TRAINER_UNION_ROOM)
|
||||
{
|
||||
trainerPicId = GetUnionRoomTrainerPic();
|
||||
}
|
||||
else
|
||||
{
|
||||
trainerPicId = PlayerGenderToFrontTrainerPicId(gLinkPlayers[gRecordedBattleMultiplayerId ^ BIT_SIDE].gender);
|
||||
}
|
||||
}
|
||||
|
||||
BtlController_HandleDrawTrainerPic(battler, trainerPicId, TRUE, xPos, 40, -1);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include "battle_message.h"
|
||||
#include "battle_interface.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
#include "battle_z_move.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
|
|
@ -270,7 +269,7 @@ static void RecordedPartnerHandleIntroTrainerBallThrow(u32 battler)
|
|||
else if (IsAiVsAiBattle())
|
||||
trainerPal = gTrainerSprites[GetTrainerPicFromId(gPartnerTrainerId)].palette.data;
|
||||
else
|
||||
trainerPal = gTrainerSprites[GetBattleTowerTrainerFrontSpriteId(gPartnerTrainerId)].palette.data; // 2 vs 2 multi battle in Battle Frontier, load front sprite and pal.
|
||||
trainerPal = gTrainerSprites[TRAINER_PIC_RED].palette.data; // 2 vs 2 multi battle in Battle Frontier, load front sprite and pal.
|
||||
|
||||
BtlController_HandleIntroTrainerBallThrow(battler, 0xD6F9, trainerPal, 24, Controller_RecordedPartnerShowIntroHealthbox);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
// #include "battle_pyramid.h"
|
||||
#include "battle_scripts.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
#include "battle_z_move.h"
|
||||
#include "battle_gimmick.h"
|
||||
#include "berry.h"
|
||||
|
|
|
|||
|
|
@ -2,23 +2,23 @@
|
|||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_z_move.h"
|
||||
#include "strings.h"
|
||||
#include "battle_message.h"
|
||||
#include "link.h"
|
||||
#include "line_break.h"
|
||||
#include "event_scripts.h"
|
||||
#include "event_data.h"
|
||||
#include "item.h"
|
||||
#include "battle_tower.h"
|
||||
#include "trainer_tower.h"
|
||||
#include "battle_setup.h"
|
||||
#include "field_specials.h"
|
||||
#include "menu.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_special.h"
|
||||
#include "battle_z_move.h"
|
||||
#include "event_data.h"
|
||||
#include "event_scripts.h"
|
||||
#include "field_specials.h"
|
||||
#include "graphics.h"
|
||||
#include "item.h"
|
||||
#include "line_break.h"
|
||||
#include "link.h"
|
||||
#include "menu.h"
|
||||
#include "recorded_battle.h"
|
||||
#include "strings.h"
|
||||
#include "test_runner.h"
|
||||
#include "trainer_tower.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/battle_string_ids.h"
|
||||
#include "constants/moves.h"
|
||||
|
|
@ -277,11 +277,6 @@ static const u8 sText_GotchaPkmnCaught2[] = _("Gotcha!\n{B_OPPONENT_MON1_NAME} w
|
|||
static const u8 sText_Bills[] = _("BILL's");
|
||||
const u8 gText_HighlightRed_Left[] = _("{HIGHLIGHT 2}Left: ");
|
||||
const u8 gText_HighlightRed[] = _("{HIGHLIGHT 2}");
|
||||
const u8 gText_BattleTowerBan_Space[] = _(" ");
|
||||
const u8 gText_BattleTowerBan_Newline1[] = _("\n");
|
||||
const u8 gText_BattleTowerBan_Newline2[] = _("\n");
|
||||
const u8 gText_BattleTowerBan_Is1[] = _(" is");
|
||||
const u8 gText_BattleTowerBan_Is2[] = _(" is");
|
||||
const u8 gText_TimeBoard[] = _("TIME BOARD");
|
||||
const u8 gText_XMinYZSec[] = _("{STR_VAR_1}MIN. {STR_VAR_2}.{STR_VAR_3}SEC.");
|
||||
|
||||
|
|
@ -2105,6 +2100,8 @@ static void GetBattlerNick(u32 battler, u8 *dst)
|
|||
GetBattlerNick(battler, text); \
|
||||
toCpy = text;
|
||||
|
||||
static const u8 gText_Placeholder[] = _("PH");
|
||||
|
||||
static const u8 *BattleStringGetOpponentNameByTrainerId(u16 trainerId, u8 *text, u8 multiplayerId, u8 battler)
|
||||
{
|
||||
const u8 *toCpy = NULL;
|
||||
|
|
@ -2131,7 +2128,7 @@ static const u8 *BattleStringGetOpponentNameByTrainerId(u16 trainerId, u8 *text,
|
|||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
|
||||
{
|
||||
GetBattleTowerTrainerName(text);
|
||||
StringCopy(text, gText_Placeholder);
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_TOWER)
|
||||
{
|
||||
|
|
@ -2235,7 +2232,7 @@ static const u8 *BattleStringGetOpponentClassByTrainerId(u16 trainerId)
|
|||
else if (trainerId == TRAINER_UNION_ROOM)
|
||||
toCpy = gTrainerClasses[GetUnionRoomTrainerClass()].name;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
|
||||
toCpy = gTrainerClasses[GetBattleTowerTrainerClassNameId()].name;
|
||||
toCpy = gTrainerClasses[TRAINER_CLASS_PLAYER].name;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_TOWER)
|
||||
toCpy = gTrainerClasses[GetTrainerTowerOpponentClass()].name;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_EREADER_TRAINER)
|
||||
|
|
|
|||
|
|
@ -13,10 +13,8 @@
|
|||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/battle_ai.h"
|
||||
#include "constants/battle_tower.h"
|
||||
|
||||
#include "data/partner_parties.h"
|
||||
const struct Trainer gBattlePartners[DIFFICULTY_COUNT][PARTNER_COUNT] =
|
||||
|
|
@ -121,67 +119,3 @@ void FillPartnerParty(u16 trainerId)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleSpecialTrainerBattleEnd(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
switch (gBattleScripting.specialTrainerBattleType)
|
||||
{
|
||||
case SPECIAL_BATTLE_MULTI:
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES))
|
||||
gSaveBlock1Ptr->playerParty[i] = gPlayerParty[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
}
|
||||
|
||||
static void Task_StartBattleAfterTransition(u8 taskId)
|
||||
{
|
||||
if (IsBattleTransitionDone() == TRUE)
|
||||
{
|
||||
gMain.savedCallback = HandleSpecialTrainerBattleEnd;
|
||||
SetMainCallback2(CB2_InitBattle);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
void DoSpecialTrainerBattle(void)
|
||||
{
|
||||
gBattleScripting.specialTrainerBattleType = gSpecialVar_0x8004;
|
||||
switch (gSpecialVar_0x8004)
|
||||
{
|
||||
case SPECIAL_BATTLE_MULTI:
|
||||
if (gSpecialVar_0x8005 & MULTI_BATTLE_2_VS_WILD) // Player + AI against wild mon
|
||||
{
|
||||
gBattleTypeFlags = BATTLE_TYPE_DOUBLE | BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER;
|
||||
}
|
||||
else if (gSpecialVar_0x8005 & MULTI_BATTLE_2_VS_1) // Player + AI against one trainer
|
||||
{
|
||||
TRAINER_BATTLE_PARAM.opponentB = 0xFFFF;
|
||||
gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER;
|
||||
}
|
||||
else // MULTI_BATTLE_2_VS_2
|
||||
{
|
||||
gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER;
|
||||
}
|
||||
|
||||
gPartnerTrainerId = VarGet(gSpecialVar_0x8006) + TRAINER_PARTNER(PARTNER_NONE);
|
||||
FillPartnerParty(gPartnerTrainerId);
|
||||
CreateTask(Task_StartBattleAfterTransition, 1);
|
||||
PlayMapChosenOrBattleBGM(0);
|
||||
if (gSpecialVar_0x8005 & MULTI_BATTLE_2_VS_WILD)
|
||||
BattleTransition_StartOnField(GetWildBattleTransition());
|
||||
else
|
||||
BattleTransition_StartOnField(GetTrainerBattleTransition());
|
||||
|
||||
if (gSpecialVar_0x8005 & MULTI_BATTLE_CHOOSE_MONS) // Skip mons restoring(done in the script)
|
||||
gBattleScripting.specialTrainerBattleType = 0xFF;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#include "battle.h"
|
||||
#include "load_save.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
#include "battle_transition.h"
|
||||
#include "main.h"
|
||||
#include "task.h"
|
||||
|
|
@ -30,7 +29,6 @@
|
|||
#include "string_util.h"
|
||||
#include "overworld.h"
|
||||
#include "field_weather.h"
|
||||
#include "battle_tower.h"
|
||||
// #include "gym_leader_rematch.h"
|
||||
// #include "battle_pike.h"
|
||||
// #include "battle_pyramid.h"
|
||||
|
|
|
|||
223
src/battle_special.c
Normal file
223
src/battle_special.c
Normal file
|
|
@ -0,0 +1,223 @@
|
|||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_partner.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_special.h"
|
||||
#include "battle_transition.h"
|
||||
#include "easy_chat.h"
|
||||
#include "event_data.h"
|
||||
#include "overworld.h"
|
||||
#include "task.h"
|
||||
#include "constants/battle_special.h"
|
||||
#include "constants/characters.h"
|
||||
#include "constants/event_objects.h"
|
||||
|
||||
static void Task_StartBattleAfterTransition(u8 taskId);
|
||||
static void HandleSpecialTrainerBattleEnd(void);
|
||||
static void PrintEReaderTrainerFarewellMessage(void);
|
||||
|
||||
void DoSpecialTrainerBattle(void)
|
||||
{
|
||||
gBattleScripting.specialTrainerBattleType = gSpecialVar_0x8004;
|
||||
switch (gSpecialVar_0x8004)
|
||||
{
|
||||
case SPECIAL_BATTLE_MULTI:
|
||||
if (gSpecialVar_0x8005 & MULTI_BATTLE_2_VS_WILD) // Player + AI against wild mon
|
||||
{
|
||||
gBattleTypeFlags = BATTLE_TYPE_DOUBLE | BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER;
|
||||
}
|
||||
else if (gSpecialVar_0x8005 & MULTI_BATTLE_2_VS_1) // Player + AI against one trainer
|
||||
{
|
||||
TRAINER_BATTLE_PARAM.opponentB = 0xFFFF;
|
||||
gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER;
|
||||
}
|
||||
else // MULTI_BATTLE_2_VS_2
|
||||
{
|
||||
gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER;
|
||||
}
|
||||
|
||||
gPartnerTrainerId = VarGet(gSpecialVar_0x8006) + TRAINER_PARTNER(PARTNER_NONE);
|
||||
FillPartnerParty(gPartnerTrainerId);
|
||||
CreateTask(Task_StartBattleAfterTransition, 1);
|
||||
PlayMapChosenOrBattleBGM(0);
|
||||
if (gSpecialVar_0x8005 & MULTI_BATTLE_2_VS_WILD)
|
||||
BattleTransition_StartOnField(GetWildBattleTransition());
|
||||
else
|
||||
BattleTransition_StartOnField(GetTrainerBattleTransition());
|
||||
|
||||
if (gSpecialVar_0x8005 & MULTI_BATTLE_CHOOSE_MONS) // Skip mons restoring(done in the script)
|
||||
gBattleScripting.specialTrainerBattleType = 0xFF;
|
||||
break;
|
||||
case SPECIAL_BATTLE_EREADER: // e-reader trainer battle
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
ZeroEnemyPartyMons();
|
||||
|
||||
for (u32 i = 0; i < 3; i++)
|
||||
CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->ereaderTrainer.party[i]);
|
||||
|
||||
gBattleTypeFlags = (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_TRAINER);
|
||||
TRAINER_BATTLE_PARAM.opponentA = 0;
|
||||
|
||||
CreateTask(Task_StartBattleAfterTransition, 1);
|
||||
PlayMapChosenOrBattleBGM(0);
|
||||
BattleTransition_StartOnField(BattleSetup_GetBattleTowerBattleTransition());
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void Task_StartBattleAfterTransition(u8 taskId)
|
||||
{
|
||||
if (IsBattleTransitionDone() == TRUE)
|
||||
{
|
||||
gMain.savedCallback = HandleSpecialTrainerBattleEnd;
|
||||
CleanupOverworldWindowsAndTilemaps();
|
||||
SetMainCallback2(CB2_InitBattle);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleSpecialTrainerBattleEnd(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
switch (gBattleScripting.specialTrainerBattleType)
|
||||
{
|
||||
case SPECIAL_BATTLE_EREADER:
|
||||
PrintEReaderTrainerFarewellMessage();
|
||||
break;
|
||||
case SPECIAL_BATTLE_MULTI:
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES))
|
||||
gSaveBlock1Ptr->playerParty[i] = gPlayerParty[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
}
|
||||
|
||||
static void BufferBattleTowerTrainerMessage(const u16 *greeting)
|
||||
{
|
||||
s32 i;
|
||||
if (EC_DoesEasyChatStringFitOnLine(greeting, 3, 2, 18))
|
||||
{
|
||||
ConvertEasyChatWordsToString(gStringVar4, greeting, 2, 3);
|
||||
i = 0;
|
||||
while (gStringVar4[i++] != CHAR_NEWLINE)
|
||||
;
|
||||
while (gStringVar4[i] != CHAR_NEWLINE)
|
||||
i++;
|
||||
gStringVar4[i] = CHAR_PROMPT_SCROLL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConvertEasyChatWordsToString(gStringVar4, greeting, 3, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void BufferEReaderTrainerGreeting(void)
|
||||
{
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
BufferBattleTowerTrainerMessage(gSaveBlock2Ptr->ereaderTrainer.greeting);
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
}
|
||||
|
||||
static void PrintEReaderTrainerFarewellMessage(void)
|
||||
{
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
if (gBattleOutcome == B_OUTCOME_DREW)
|
||||
gStringVar4[0] = EOS;
|
||||
else if (gBattleOutcome == B_OUTCOME_WON)
|
||||
BufferBattleTowerTrainerMessage(gSaveBlock2Ptr->ereaderTrainer.farewellPlayerWon);
|
||||
else
|
||||
BufferBattleTowerTrainerMessage(gSaveBlock2Ptr->ereaderTrainer.farewellPlayerLost);
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
}
|
||||
|
||||
void ClearEReaderTrainer(struct BattleTowerEReaderTrainer *ereaderTrainer)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < sizeof(struct BattleTowerEReaderTrainer) / sizeof(u32); i++)
|
||||
((u32 *)ereaderTrainer)[i] = 0;
|
||||
}
|
||||
|
||||
void SetEReaderTrainerGfxId(void)
|
||||
{
|
||||
VarSet(VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_YOUNGSTER);
|
||||
}
|
||||
|
||||
|
||||
u8 GetEreaderTrainerFrontSpriteId(void)
|
||||
{
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
return gFacilityClassToPicIndex[gSaveBlock2Ptr->ereaderTrainer.trainerClass];
|
||||
#else
|
||||
return 0;
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
}
|
||||
|
||||
u8 GetEreaderTrainerClassId(void)
|
||||
{
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
return gFacilityClassToTrainerClass[gSaveBlock2Ptr->ereaderTrainer.trainerClass];
|
||||
#else
|
||||
return 0;
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
}
|
||||
|
||||
void CopyEReaderTrainerName5(u8 *trainerName)
|
||||
{
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
trainerName[i] = gSaveBlock2Ptr->ereaderTrainer.name[i];
|
||||
|
||||
trainerName[i] = EOS;
|
||||
#else
|
||||
trainerName[0] = EOS;
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
}
|
||||
|
||||
// Checks if the saved E-Reader trainer is valid.
|
||||
void ValidateEReaderTrainer(void)
|
||||
{
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
u32 i;
|
||||
u32 checksum;
|
||||
struct BattleTowerEReaderTrainer *ereaderTrainer;
|
||||
|
||||
gSpecialVar_Result = 0;
|
||||
ereaderTrainer = &gSaveBlock2Ptr->ereaderTrainer;
|
||||
|
||||
checksum = 0;
|
||||
for (i = 0; i < sizeof(struct BattleTowerEReaderTrainer) / sizeof(u32) - 1; i++)
|
||||
checksum |= ((u32 *)ereaderTrainer)[i];
|
||||
|
||||
if (checksum == 0)
|
||||
{
|
||||
gSpecialVar_Result = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
checksum = 0;
|
||||
for (i = 0; i < sizeof(struct BattleTowerEReaderTrainer) / sizeof(u32) - 1; i++)
|
||||
checksum += ((u32 *)ereaderTrainer)[i];
|
||||
|
||||
if (gSaveBlock2Ptr->ereaderTrainer.checksum != checksum)
|
||||
{
|
||||
ClearEReaderTrainer(&gSaveBlock2Ptr->ereaderTrainer);
|
||||
gSpecialVar_Result = 1;
|
||||
}
|
||||
#else
|
||||
gSpecialVar_Result = FALSE;
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
}
|
||||
|
||||
void BufferEReaderTrainerName(void)
|
||||
{
|
||||
CopyEReaderTrainerName5(gStringVar1);
|
||||
}
|
||||
1342
src/battle_tower.c
1342
src/battle_tower.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -2157,7 +2157,7 @@ static void DebugAction_Trainers_TryBattle(u8 taskId)
|
|||
for (u32 i = 0; i < MAX_FRONTIER_PARTY_SIZE; i++)
|
||||
{
|
||||
gSelectedOrderFromParty[i] = i + 1;
|
||||
gSaveBlock2Ptr->battleTower.selectedPartyMons[i] = gSelectedOrderFromParty[i];
|
||||
gSaveBlock2Ptr->selectedPartyMons[i] = gSelectedOrderFromParty[i];
|
||||
}
|
||||
FillPartnerParty(gPartnerTrainerId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
#include "field_specials.h"
|
||||
#include "region_map.h"
|
||||
#include "task.h"
|
||||
#include "battle_tower.h"
|
||||
#include "field_camera.h"
|
||||
#include "field_effect.h"
|
||||
#include "field_weather.h"
|
||||
|
|
@ -376,11 +375,6 @@ void RemoveCameraObject(void)
|
|||
RemoveObjectEventByLocalIdAndMap(LOCALID_CAMERA, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
}
|
||||
|
||||
void BufferEReaderTrainerName(void)
|
||||
{
|
||||
CopyEReaderTrainerName5(gStringVar1);
|
||||
}
|
||||
|
||||
// Unused
|
||||
static const u8 sSlotMachineRandomSeeds[] = {
|
||||
13,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "battle.h"
|
||||
#include "battle_partner.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
#include "bike.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "berry.h"
|
||||
#include "battle_tower.h"
|
||||
#include "battle_special.h"
|
||||
#include "easy_chat.h"
|
||||
#include "event_data.h"
|
||||
#include "mail.h"
|
||||
|
|
@ -284,7 +284,7 @@ bool8 MEScrCmd_addtrainer(struct ScriptContext *ctx)
|
|||
{
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
u32 data = ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0];
|
||||
memcpy(&gSaveBlock2Ptr->battleTower.ereaderTrainer, (void *)data, sizeof(struct BattleTowerEReaderTrainer));
|
||||
memcpy(&gSaveBlock2Ptr->ereaderTrainer, (void *)data, sizeof(struct BattleTowerEReaderTrainer));
|
||||
ValidateEReaderTrainer();
|
||||
StringExpandPlaceholders(gStringVar4, gText_MysteryGiftNewTrainer);
|
||||
ctx->data[2] = 2;
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "constants/songs.h"
|
||||
#include "battle_special.h"
|
||||
#include "easy_chat.h"
|
||||
#include "task.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "util.h"
|
||||
#include "script.h"
|
||||
#include "event_data.h"
|
||||
#include "battle_tower.h"
|
||||
#include "new_game.h"
|
||||
#include "wonder_news.h"
|
||||
#include "mystery_gift_menu.h"
|
||||
#include "help_system.h"
|
||||
#include "link_rfu.h"
|
||||
#include "link.h"
|
||||
#include "mystery_gift_menu.h"
|
||||
#include "mystery_gift.h"
|
||||
#include "new_game.h"
|
||||
#include "script.h"
|
||||
#include "strings.h"
|
||||
#include "task.h"
|
||||
#include "util.h"
|
||||
#include "wonder_news.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
#define CALC_CRC(data) CalcCRC16WithTable((void *)&(data), sizeof(data))
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ void ClearSavedWonderCardAndRelated(void)
|
|||
ClearMysteryGiftVars();
|
||||
#endif //FREE_MYSTERY_GIFT
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
ClearEReaderTrainer(&gSaveBlock2Ptr->battleTower.ereaderTrainer);
|
||||
ClearEReaderTrainer(&gSaveBlock2Ptr->ereaderTrainer);
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
}
|
||||
|
||||
|
|
@ -480,7 +480,7 @@ u32 MysteryGift_CompareCardFlags(const u16 * flagId, const struct MysteryGiftLin
|
|||
u32 MysteryGift_CheckStamps(const u16 * stamp, const struct MysteryGiftLinkGameData * data, const void *unused)
|
||||
{
|
||||
s32 stampsMissing = data->maxStamps - GetNumStampsInMetadata(&data->cardMetadata, data->maxStamps);
|
||||
|
||||
|
||||
// Has full stamp card?
|
||||
if (stampsMissing == 0)
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle_special.h"
|
||||
#include "decompress.h"
|
||||
#include "overworld.h"
|
||||
#include "script.h"
|
||||
#include "battle_tower.h"
|
||||
#include "malloc.h"
|
||||
#include "mystery_event_script.h"
|
||||
#include "mystery_gift.h"
|
||||
#include "mystery_gift_client.h"
|
||||
#include "mystery_gift_server.h"
|
||||
#include "mystery_gift.h"
|
||||
#include "overworld.h"
|
||||
#include "script.h"
|
||||
|
||||
enum {
|
||||
FUNC_INIT,
|
||||
|
|
@ -232,7 +232,7 @@ static u32 Client_Run(struct MysteryGiftClient * client)
|
|||
break;
|
||||
case CLI_RECV_EREADER_TRAINER:
|
||||
#if FREE_BATTLE_TOWER_E_READER == FALSE
|
||||
memcpy(&gSaveBlock2Ptr->battleTower.ereaderTrainer, client->recvBuffer, sizeof(gSaveBlock2Ptr->battleTower.ereaderTrainer));
|
||||
memcpy(&gSaveBlock2Ptr->ereaderTrainer, client->recvBuffer, sizeof(gSaveBlock2Ptr->ereaderTrainer));
|
||||
ValidateEReaderTrainer();
|
||||
#endif //FREE_BATTLE_TOWER_E_READER
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -80,9 +80,9 @@ static void ClearPokedexFlags(void)
|
|||
memset(&gSaveBlock1Ptr->dexSeen, 0, sizeof(gSaveBlock1Ptr->dexSeen));
|
||||
}
|
||||
|
||||
static void ClearBattleTower(void)
|
||||
static void ClearEReaderTrainer(void)
|
||||
{
|
||||
CpuFill32(0, &gSaveBlock2Ptr->battleTower, sizeof(gSaveBlock2Ptr->battleTower));
|
||||
CpuFill32(0, &gSaveBlock2Ptr->ereaderTrainer, sizeof(gSaveBlock2Ptr->ereaderTrainer));
|
||||
}
|
||||
|
||||
static void WarpToPlayersRoom(void)
|
||||
|
|
@ -121,7 +121,7 @@ void NewGameInitData(void)
|
|||
gDifferentSaveFile = TRUE;
|
||||
ZeroPlayerPartyMons();
|
||||
ZeroEnemyPartyMons();
|
||||
ClearBattleTower();
|
||||
ClearEReaderTrainer();
|
||||
ClearSav1();
|
||||
ClearSav3();
|
||||
ClearMailData();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
#include "battle_controllers.h"
|
||||
#include "battle_gfx_sfx_util.h"
|
||||
#include "battle_interface.h"
|
||||
#include "battle_tower.h"
|
||||
#include "berry_pouch.h"
|
||||
#include "data.h"
|
||||
#include "decompress.h"
|
||||
|
|
@ -6517,11 +6516,9 @@ static u8 GetPartySlotEntryStatus(s8 slot)
|
|||
|
||||
static bool8 GetBattleEntryEligibility(struct Pokemon *mon)
|
||||
{
|
||||
u16 species;
|
||||
u16 i = 0;
|
||||
|
||||
if (GetMonData(mon, MON_DATA_IS_EGG))
|
||||
return FALSE;
|
||||
|
||||
switch (gPartyMenu.chooseMonsBattleType)
|
||||
{
|
||||
default:
|
||||
|
|
@ -6532,43 +6529,16 @@ static bool8 GetBattleEntryEligibility(struct Pokemon *mon)
|
|||
if (GetMonData(mon, MON_DATA_HP) == 0)
|
||||
return FALSE;
|
||||
break;
|
||||
case CHOOSE_MONS_FOR_BATTLE_TOWER:
|
||||
if (gSaveBlock2Ptr->battleTower.battleTowerLevelType == 0 // level 50
|
||||
&& GetMonData(mon, MON_DATA_LEVEL) > 50)
|
||||
return FALSE;
|
||||
species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
for (; gBattleTowerBannedSpecies[i] != 0xFFFF; ++i)
|
||||
if (gBattleTowerBannedSpecies[i] == species)
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static u8 CheckBattleEntriesAndGetMessage(void)
|
||||
{
|
||||
u8 i, j;
|
||||
struct Pokemon *party = gPlayerParty;
|
||||
u8 *order = gSelectedOrderFromParty;
|
||||
|
||||
switch (gPartyMenu.chooseMonsBattleType)
|
||||
{
|
||||
case CHOOSE_MONS_FOR_BATTLE_TOWER:
|
||||
if (order[2] == 0)
|
||||
return PARTY_MSG_THREE_MONS_ARE_NEEDED;
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
sPartyMenuInternal->data[15] = GetMonData(&party[order[i] - 1], MON_DATA_SPECIES);
|
||||
sPartyMenuInternal->data[14] = GetMonData(&party[order[i] - 1], MON_DATA_HELD_ITEM);
|
||||
for (j = i + 1; j < 3; ++j)
|
||||
{
|
||||
if (sPartyMenuInternal->data[15] == GetMonData(&party[order[j] - 1], MON_DATA_SPECIES))
|
||||
return PARTY_MSG_MONS_CANT_BE_SAME;
|
||||
if (sPartyMenuInternal->data[14] != ITEM_NONE && sPartyMenuInternal->data[14] == GetMonData(&party[order[j] - 1], MON_DATA_HELD_ITEM))
|
||||
return PARTY_MSG_NO_SAME_HOLD_ITEMS;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CHOOSE_MONS_FOR_UNION_ROOM_BATTLE:
|
||||
if (order[1] == 0)
|
||||
return PARTY_MSG_TWO_MONS_ARE_NEEDED;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
// #include "battle_pike.h"
|
||||
// #include "battle_pyramid.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
#include "battle_z_move.h"
|
||||
#include "caps.h"
|
||||
#include "data.h"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#include "constants/pokemon.h"
|
||||
|
||||
static void CB2_ReturnFromChooseHalfParty(void);
|
||||
static void CB2_ReturnFromChooseBattleTowerParty(void);
|
||||
static void HealPlayerBoxes(void);
|
||||
|
||||
void HealPlayerParty(void)
|
||||
|
|
@ -528,29 +527,6 @@ static void CB2_ReturnFromChooseHalfParty(void)
|
|||
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
}
|
||||
|
||||
void ChooseBattleTowerPlayerParty(void)
|
||||
{
|
||||
gMain.savedCallback = CB2_ReturnFromChooseBattleTowerParty;
|
||||
InitChooseMonsForBattle(CHOOSE_MONS_FOR_BATTLE_TOWER);
|
||||
}
|
||||
|
||||
static void CB2_ReturnFromChooseBattleTowerParty(void)
|
||||
{
|
||||
switch (gSelectedOrderFromParty[0])
|
||||
{
|
||||
case 0:
|
||||
LoadPlayerParty();
|
||||
gSpecialVar_Result = FALSE;
|
||||
break;
|
||||
default:
|
||||
ReducePlayerPartyToSelectedMons();
|
||||
gSpecialVar_Result = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
}
|
||||
|
||||
void ReducePlayerPartyToSelectedMons(void)
|
||||
{
|
||||
struct Pokemon party[MAX_FRONTIER_PARTY_SIZE];
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "battle_controllers.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
#include "battle_z_move.h"
|
||||
#include "data.h"
|
||||
#include "event_data.h"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user