Added Difficulty Fallback for Trainer Slides (#6088)
This commit is contained in:
parent
bc5adcac18
commit
b130a3846e
@ -59,14 +59,14 @@ static const u8* const sTrainerSlides[DIFFICULTY_COUNT][TRAINERS_COUNT][TRAINER_
|
||||
},
|
||||
};
|
||||
|
||||
static const u8* const sFrontierTrainerSlides[DIFFICULTY_COUNT][TRAINERS_COUNT][TRAINER_SLIDE_COUNT] =
|
||||
static const u8* const sFrontierTrainerSlides[DIFFICULTY_COUNT][FRONTIER_TRAINERS_COUNT][TRAINER_SLIDE_COUNT] =
|
||||
{
|
||||
[DIFFICULTY_NORMAL] =
|
||||
{
|
||||
},
|
||||
};
|
||||
|
||||
static const u8* const sTestTrainerSlides[DIFFICULTY_COUNT][FRONTIER_TRAINERS_COUNT][TRAINER_SLIDE_COUNT] =
|
||||
static const u8* const sTestTrainerSlides[DIFFICULTY_COUNT][TRAINERS_COUNT][TRAINER_SLIDE_COUNT] =
|
||||
{
|
||||
#include "../test/battle/trainer_slides.h"
|
||||
};
|
||||
@ -107,24 +107,36 @@ static u32 GetEnemyMonCount(u32 firstId, u32 lastId, bool32 onlyAlive)
|
||||
return count;
|
||||
}
|
||||
|
||||
static bool32 DoesTrainerHaveSlideMessage(enum DifficultyLevel difficulty, u32 trainerId, u32 slideId)
|
||||
static const u8* const *GetTrainerSlideArray(enum DifficultyLevel difficulty, u32 trainerId, u32 slideId)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
return (sFrontierTrainerSlides[difficulty][trainerId][slideId] != NULL);
|
||||
return sFrontierTrainerSlides[difficulty][trainerId];
|
||||
else if (TESTING)
|
||||
return (sTestTrainerSlides[difficulty][trainerId][slideId] != NULL);
|
||||
return sTestTrainerSlides[difficulty][trainerId];
|
||||
else
|
||||
return (sTrainerSlides[difficulty][trainerId][slideId] != NULL);
|
||||
return sTrainerSlides[difficulty][trainerId];
|
||||
}
|
||||
|
||||
static bool32 DoesTrainerHaveSlideMessage(enum DifficultyLevel difficulty, u32 trainerId, u32 slideId)
|
||||
{
|
||||
const u8* const *trainerSlides = GetTrainerSlideArray(difficulty, trainerId, slideId);
|
||||
const u8* const *trainerSlidesNormal = GetTrainerSlideArray(DIFFICULTY_NORMAL, trainerId, slideId);
|
||||
|
||||
if (trainerSlides[slideId] == NULL)
|
||||
return (trainerSlidesNormal[slideId] != NULL);
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void SetTrainerSlideMessage(enum DifficultyLevel difficulty, u32 trainerId, u32 slideId)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
gBattleStruct->trainerSlideMsg = sFrontierTrainerSlides[difficulty][trainerId][slideId];
|
||||
else if (TESTING)
|
||||
gBattleStruct->trainerSlideMsg = sTestTrainerSlides[difficulty][trainerId][slideId];
|
||||
const u8* const *trainerSlides = GetTrainerSlideArray(difficulty, trainerId, slideId);
|
||||
const u8* const *trainerSlidesNormal = GetTrainerSlideArray(DIFFICULTY_NORMAL, trainerId, slideId);
|
||||
|
||||
if (trainerSlides[slideId] != NULL)
|
||||
gBattleStruct->trainerSlideMsg = trainerSlides[slideId];
|
||||
else
|
||||
gBattleStruct->trainerSlideMsg = sTrainerSlides[difficulty][trainerId][slideId];
|
||||
gBattleStruct->trainerSlideMsg = trainerSlidesNormal[slideId];
|
||||
}
|
||||
|
||||
static bool32 ShouldRunTrainerSlidePlayerLandsFirstCriticalHit(enum TrainerSlideType slideId)
|
||||
@ -232,7 +244,7 @@ enum TrainerSlideTargets ShouldDoTrainerSlide(u32 battler, enum TrainerSlideType
|
||||
return TRAINER_SLIDE_TARGET_NONE;
|
||||
|
||||
SetTrainerSlideParamters(battler, &firstId, &lastId, &trainerId, &retValue);
|
||||
enum DifficultyLevel difficulty = GetTrainerDifficultyLevel(trainerId);
|
||||
enum DifficultyLevel difficulty = GetCurrentDifficultyLevel();
|
||||
|
||||
gBattleScripting.battler = battler;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user