Fix partner palette problem (#4736)

This commit is contained in:
Bassoonian 2024-06-07 21:05:16 +02:00 committed by GitHub
parent 0fda9d6cd6
commit d6422da284
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 16 additions and 21 deletions

View file

@ -98,7 +98,7 @@
waitstate
.endm
.macro multi_do type:req, partnerId:req, partnerPicId:req
.macro multi_do type:req, partnerId:req
special ReducePlayerPartyToSelectedMons
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA
setvar VAR_0x8005, FRONTIER_DATA_SELECTED_MON_ORDER
@ -106,7 +106,6 @@
setvar VAR_0x8004, SPECIAL_BATTLE_MULTI
setvar VAR_0x8005, \type | MULTI_BATTLE_CHOOSE_MONS
setvar VAR_0x8006, \partnerId
setvar VAR_0x8007, \partnerPicId
special DoSpecialTrainerBattle
waitstate
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY
@ -114,30 +113,29 @@
special LoadPlayerParty
.endm
.macro multi_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req, partnerPicId:req
.macro multi_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req
special SavePlayerParty
trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons
trainerbattle TRAINER_BATTLE_SET_TRAINER_B, \trainer2Id, 0, NULL, \trainer2LoseText @ set second trainer mons
multi_do MULTI_BATTLE_2_VS_2, \partnerId, \partnerPicId
multi_do MULTI_BATTLE_2_VS_2, \partnerId
.endm
.macro multi_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req, partnerPicId:req
.macro multi_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req
special SavePlayerParty
trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons
multi_do MULTI_BATTLE_2_VS_1, \partnerId, \partnerPicId
multi_do MULTI_BATTLE_2_VS_1, \partnerId
.endm
@ Wild mons need to be assigned to gEnemyParty 0 and 3 slots, other slots need to be cleared out.
.macro multi_wild partnerId:req, partnerPicId:req
.macro multi_wild partnerId:req
special SavePlayerParty
multi_do MULTI_BATTLE_2_VS_WILD, \partnerId, \partnerPicId
multi_do MULTI_BATTLE_2_VS_WILD, \partnerId
.endm
.macro multi_do_fixed type:req, partnerId:req, partnerPicId:req
.macro multi_do_fixed type:req, partnerId:req
setvar VAR_0x8004, SPECIAL_BATTLE_MULTI
setvar VAR_0x8005, \type
setvar VAR_0x8006, \partnerId
setvar VAR_0x8007, \partnerPicId
special DoSpecialTrainerBattle
waitstate
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY
@ -145,21 +143,21 @@
special LoadPlayerParty
.endm
.macro multi_fixed_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req, partnerPicId:req
.macro multi_fixed_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req
special SavePlayerParty
trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons
trainerbattle TRAINER_BATTLE_SET_TRAINER_B, \trainer2Id, 0, NULL, \trainer2LoseText @ set second trainer mons
multi_do_fixed MULTI_BATTLE_2_VS_2, \partnerId, \partnerPicId
multi_do_fixed MULTI_BATTLE_2_VS_2, \partnerId
.endm
.macro multi_fixed_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req, partnerPicId:req
.macro multi_fixed_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req
special SavePlayerParty
trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons
multi_do_fixed MULTI_BATTLE_2_VS_1, \partnerId, \partnerPicId
multi_do_fixed MULTI_BATTLE_2_VS_1, \partnerId
.endm
@ Wild mons need to be assigned to gEnemyParty 0 and 3 slots, other slots need to be cleared out.
.macro multi_fixed_wild partnerId:req, partnerPicId:req
.macro multi_fixed_wild partnerId:req
special SavePlayerParty
multi_do_fixed MULTI_BATTLE_2_VS_WILD, \partnerId, \partnerPicId
multi_do_fixed MULTI_BATTLE_2_VS_WILD, \partnerId
.endm

View file

@ -257,7 +257,7 @@ MossdeepCity_SpaceCenter_2F_EventScript_ChoosePartyForMultiBattle::
goto MossdeepCity_SpaceCenter_2F_EventScript_ReadyForBattlePrompt
MossdeepCity_SpaceCenter_2F_EventScript_DoStevenMultiBattle::
multi_2_vs_2 TRAINER_MAXIE_MOSSDEEP, MossdeepCity_SpaceCenter_2F_Text_JustWantToExpandLand, TRAINER_TABITHA_MOSSDEEP, MossdeepCity_SpaceCenter_Text_TabithaDefeat, PARTNER_STEVEN, TRAINER_BACK_PIC_STEVEN
multi_2_vs_2 TRAINER_MAXIE_MOSSDEEP, MossdeepCity_SpaceCenter_2F_Text_JustWantToExpandLand, TRAINER_TABITHA_MOSSDEEP, MossdeepCity_SpaceCenter_Text_TabithaDefeat, PARTNER_STEVEN
switch VAR_RESULT
case 1, MossdeepCity_SpaceCenter_2F_EventScript_DefeatedMaxieTabitha
fadescreen FADE_TO_BLACK

View file

@ -1090,7 +1090,6 @@ extern u16 gMoveToLearn;
extern u32 gFieldStatuses;
extern struct FieldTimer gFieldTimers;
extern u8 gBattlerAbility;
extern u16 gPartnerSpriteId;
extern struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT];
extern const struct BattleMoveEffect gBattleMoveEffects[];

View file

@ -435,7 +435,7 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(u32 battler)
const u32 *trainerPal;
if (gPartnerTrainerId > TRAINER_PARTNER(PARTNER_NONE))
trainerPal = gTrainerBacksprites[gPartnerSpriteId].palette.data;
trainerPal = gTrainerBacksprites[gBattlePartners[gPartnerTrainerId - TRAINER_PARTNER(PARTNER_NONE)].trainerPic].palette.data;
else if (IsAiVsAiBattle())
trainerPal = gTrainerSprites[GetTrainerPicFromId(gPartnerTrainerId)].palette.data;
else

View file

@ -220,7 +220,6 @@ EWRAM_DATA u16 gMoveToLearn = 0;
EWRAM_DATA u32 gFieldStatuses = 0;
EWRAM_DATA struct FieldTimer gFieldTimers = {0};
EWRAM_DATA u8 gBattlerAbility = 0;
EWRAM_DATA u16 gPartnerSpriteId = 0;
EWRAM_DATA struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA bool8 gHasFetchedBall = FALSE;
EWRAM_DATA u8 gLastUsedBall = 0;

View file

@ -2148,7 +2148,6 @@ void DoSpecialTrainerBattle(void)
gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER;
}
gPartnerSpriteId = VarGet(gSpecialVar_0x8007);
gPartnerTrainerId = VarGet(gSpecialVar_0x8006) + TRAINER_PARTNER(PARTNER_NONE);
FillPartnerParty(gPartnerTrainerId);
CreateTask(Task_StartBattleAfterTransition, 1);