More style fixes

This commit is contained in:
Eduardo Quezada 2024-05-18 14:36:06 -04:00
parent 06094a2137
commit a6bfcc1194
7 changed files with 273 additions and 198 deletions

View File

@ -266,7 +266,7 @@ enum {
#define PLAYER_AVATAR_FLAG_DASH (1 << 7)
#define PLAYER_AVATAR_FLAG_BIKE (PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE)
// Player avatar flags for which follower pokemon are hidden
// Player avatar flags for which follower Pokémon are hidden
#define FOLLOWER_INVISIBLE_FLAGS (PLAYER_AVATAR_FLAG_SURFING | PLAYER_AVATAR_FLAG_UNDERWATER | \
PLAYER_AVATAR_FLAG_BIKE | PLAYER_AVATAR_FLAG_FORCED_MOVE)

View File

@ -1631,8 +1631,10 @@ static bool8 CanPlaceDecoration(u8 taskId, const struct Decoration *decoration)
if (decoration->permission == DECORPERM_SPRITE)
{
for (i = 0; i < NUM_DECORATION_FLAGS; i++)
{
if (FlagGet(FLAG_DECORATION_1 + i) == TRUE)
return TRUE;
}
return FALSE;
}
return TRUE;

View File

@ -167,7 +167,6 @@ static u8 UpdateSpritePalette(const struct SpritePalette *spritePalette, struct
static void ResetObjectEventFldEffData(struct ObjectEvent *);
static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *);
static u8 FindObjectEventPaletteIndexByTag(u16);
static void _PatchObjectPalette(u16, u8);
static bool8 ObjectEventDoesElevationMatch(struct ObjectEvent *, u8);
static void SpriteCB_CameraObject(struct Sprite *);
static void CameraObject_Init(struct Sprite *);
@ -1743,7 +1742,6 @@ u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *),
const struct ObjectEventGraphicsInfo *graphicsInfo;
struct Sprite *sprite;
u8 spriteId;
u32 UNUSED paletteNum;
bool32 isShiny = graphicsId >= SPECIES_SHINY_TAG + OBJ_EVENT_GFX_MON_BASE;
if (isShiny)
@ -1754,7 +1752,7 @@ u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *),
if (spriteTemplate->paletteTag == OBJ_EVENT_PAL_TAG_DYNAMIC)
{
paletteNum = LoadDynamicFollowerPaletteFromGraphicsId(graphicsId, isShiny, spriteTemplate);
u32 paletteNum = LoadDynamicFollowerPaletteFromGraphicsId(graphicsId, isShiny, spriteTemplate);
spriteTemplate->paletteTag = GetSpritePaletteTagByPaletteNum(paletteNum);
}
else if (spriteTemplate->paletteTag != TAG_NONE)
@ -2092,11 +2090,9 @@ void UpdateFollowingPokemon(void)
// Follower appearance changed; move to player and set invisible
if (species != OW_SPECIES(objEvent) || shiny != objEvent->shiny || form != OW_FORM(objEvent))
{
MoveObjectEventToMapCoords(
objEvent,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y
);
MoveObjectEventToMapCoords(objEvent,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y);
FollowerSetGraphics(objEvent, species, form, shiny);
objEvent->invisible = TRUE;
}
@ -2159,20 +2155,28 @@ static u32 FindMetatileBehaviorWithinRange(s32 x, s32 y, u32 mb, u8 distance)
s32 i;
for (i = y + 1; i <= y + distance; i++)
{
if (MapGridGetMetatileBehaviorAt(x, i) == mb)
return DIR_SOUTH;
}
for (i = y - 1; i >= y - distance; i--)
{
if (MapGridGetMetatileBehaviorAt(x, i) == mb)
return DIR_NORTH;
}
for (i = x + 1; i <= x + distance; i++)
{
if (MapGridGetMetatileBehaviorAt(i, y) == mb)
return DIR_EAST;
}
for (i = x - 1; i >= x - distance; i--)
{
if (MapGridGetMetatileBehaviorAt(i, y) == mb)
return DIR_WEST;
}
return DIR_NONE;
}
@ -2217,9 +2221,10 @@ bool32 CheckMsgCondition(const struct MsgCondition *cond, struct Pokemon *mon, u
// case MSG_COND_TIME_OF_DAY:
// break;
case MSG_COND_NEAR_MB:
multi = FindMetatileBehaviorWithinRange(
obj->currentCoords.x, obj->currentCoords.y,
cond->data.bytes[0], cond->data.bytes[1]);
multi = FindMetatileBehaviorWithinRange(obj->currentCoords.x,
obj->currentCoords.y,
cond->data.bytes[0],
cond->data.bytes[1]);
if (multi)
gSpecialVar_Result = multi;
return multi;
@ -2943,11 +2948,6 @@ void LoadSpecialObjectReflectionPalette(u16 tag, u8 slot)
}
}
static void UNUSED _PatchObjectPalette(u16 tag, u8 slot)
{
PatchObjectPalette(tag, slot);
}
static void UNUSED IncrementObjectEventCoords(struct ObjectEvent *objectEvent, s16 x, s16 y)
{
objectEvent->previousCoords.x = objectEvent->currentCoords.x;
@ -5282,8 +5282,7 @@ bool8 MovementType_FollowPlayer_Shadow(struct ObjectEvent *objectEvent, struct S
objectEvent->invisible = TRUE;
MoveObjectEventToMapCoords(objectEvent,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y
);
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y);
objectEvent->triggerGroundEffectsOnMove = FALSE; // Stop endless reflection spawning
return FALSE;
}
@ -5293,8 +5292,7 @@ bool8 MovementType_FollowPlayer_Shadow(struct ObjectEvent *objectEvent, struct S
{
MoveObjectEventToMapCoords(objectEvent,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y
);
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y);
objectEvent->triggerGroundEffectsOnMove = FALSE; // Stop endless reflection spawning
}
sprite->sTypeFuncId = 1; // Enter active state; if the player moves the follower will appear
@ -5877,11 +5875,10 @@ bool8 ScrFunc_GetDirectionToFace(struct ScriptContext *ctx)
if (id0 >= OBJECT_EVENTS_COUNT || id1 >= OBJECT_EVENTS_COUNT)
*var = DIR_NONE;
else
*var = GetDirectionToFace(
gObjectEvents[id0].currentCoords.x,
gObjectEvents[id0].currentCoords.y,
gObjectEvents[id1].currentCoords.x,
gObjectEvents[id1].currentCoords.y);
*var = GetDirectionToFace(gObjectEvents[id0].currentCoords.x,
gObjectEvents[id0].currentCoords.y,
gObjectEvents[id1].currentCoords.x,
gObjectEvents[id1].currentCoords.y);
return FALSE;
}

View File

@ -707,38 +707,38 @@ u32 FldEff_DeepSandFootprints(void)
u32 FldEff_TracksBug(void)
{
u8 spriteId;
struct Sprite *sprite;
u8 spriteId;
struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_TRACKS_BUG], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
sprite->data[7] = FLDEFF_TRACKS_BUG;
StartSpriteAnim(sprite, gFieldEffectArguments[4]);
}
return 0;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_TRACKS_BUG], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
sprite->data[7] = FLDEFF_TRACKS_BUG;
StartSpriteAnim(sprite, gFieldEffectArguments[4]);
}
return 0;
}
u32 FldEff_TracksSpot(void)
{
u8 spriteId;
struct Sprite *sprite;
u8 spriteId;
struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_TRACKS_SPOT], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
sprite->data[7] = FLDEFF_TRACKS_SPOT;
StartSpriteAnim(sprite, gFieldEffectArguments[4]);
}
return 0;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_TRACKS_SPOT], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
sprite->data[7] = FLDEFF_TRACKS_SPOT;
StartSpriteAnim(sprite, gFieldEffectArguments[4]);
}
return 0;
}
u32 FldEff_BikeTireTracks(void)
@ -760,20 +760,20 @@ u32 FldEff_BikeTireTracks(void)
u32 FldEff_TracksSlither(void)
{
u8 spriteId;
struct Sprite *sprite;
u8 spriteId;
struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_TRACKS_SLITHER], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
sprite->data[7] = FLDEFF_TRACKS_SLITHER;
StartSpriteAnim(sprite, gFieldEffectArguments[4]);
}
return spriteId;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_TRACKS_SLITHER], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
sprite->data[7] = FLDEFF_TRACKS_SLITHER;
StartSpriteAnim(sprite, gFieldEffectArguments[4]);
}
return spriteId;
}
void (*const gFadeFootprintsTireTracksFuncs[])(struct Sprite *) = {

View File

@ -67,228 +67,302 @@ static const u8* const sIceTexts[] = {sCondMsg26, sCondMsg40, sCondMsg41, NULL};
static const u8 sCondMsg42[] = _("{STR_VAR_1}'s burn looks painful!");
// See the struct definition in follower_helper.h for more info
const struct FollowerMsgInfoExtended gFollowerConditionalMessages[COND_MSG_COUNT] = {
const struct FollowerMsgInfoExtended gFollowerConditionalMessages[COND_MSG_COUNT] =
{
[COND_MSG_CELEBI] =
{
.text = (u8*)sCelebiTexts,
.textSpread = 1,
.script = EventScript_FollowerDance,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions = {MATCH_SPECIES(SPECIES_CELEBI)},
.text = (u8*)sCelebiTexts,
.textSpread = 1,
.script = EventScript_FollowerDance,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions =
{
MATCH_SPECIES(SPECIES_CELEBI),
},
},
[COND_MSG_FIRE] =
{
.text = (u8*)sFireTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions = {MATCH_TYPES(TYPE_FIRE, TYPE_FIRE)},
.text = (u8*)sFireTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions =
{
MATCH_TYPES(TYPE_FIRE, TYPE_FIRE),
},
},
[COND_MSG_EVER_GRANDE] =
{
.text = sCondMsg06,
.script = EventScript_FollowerFaceUp,
.emotion = FOLLOWER_EMOTION_HAPPY,
.conditions = {MATCH_MAP(EVER_GRANDE_CITY)},
.text = sCondMsg06,
.script = EventScript_FollowerFaceUp,
.emotion = FOLLOWER_EMOTION_HAPPY,
.conditions =
{
MATCH_MAP(EVER_GRANDE_CITY),
},
},
[COND_MSG_ROUTE_112] =
{
.text = sCondMsg07,
.emotion = FOLLOWER_EMOTION_HAPPY,
.conditions = {MATCH_MAP(ROUTE112)},
.text = sCondMsg07,
.emotion = FOLLOWER_EMOTION_HAPPY,
.conditions =
{
MATCH_MAP(ROUTE112),
},
},
[COND_MSG_DAY_CARE] =
{
.text = sCondMsg08,
.script = EventScript_FollowerNostalgia,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions = {MATCH_MAP(ROUTE117_POKEMON_DAY_CARE)},
.text = sCondMsg08,
.script = EventScript_FollowerNostalgia,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions =
{
MATCH_MAP(ROUTE117_POKEMON_DAY_CARE)
},
},
[COND_MSG_MART] =
{
.text = (u8*)sShopTexts,
.textSpread = 1,
.script = EventScript_FollowerLookAround,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions = {MATCH_MUSIC(MUS_POKE_MART)},
.text = (u8*)sShopTexts,
.textSpread = 1,
.script = EventScript_FollowerLookAround,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions =
{
MATCH_MUSIC(MUS_POKE_MART)
},
},
[COND_MSG_VICTORY_ROAD] =
{
.text = sCondMsg11,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions = {MATCH_MUSIC(MUS_VICTORY_ROAD)},
.text = sCondMsg11,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_MUSIC(MUS_VICTORY_ROAD)
},
},
[COND_MSG_BIKE_SHOP] =
{
.text = sCondMsg12,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions = {MATCH_MAP(MAUVILLE_CITY_BIKE_SHOP)},
.text = sCondMsg12,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_MAP(MAUVILLE_CITY_BIKE_SHOP)
},
},
[COND_MSG_MACHINES] =
{
.text = (u8*)sMachineTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_MUSIC,
.orFlag = 1, // match any of these maps
.conditions = {
MATCH_MAP(NEW_MAUVILLE_INSIDE),
MATCH_MAP(SLATEPORT_CITY_STERNS_SHIPYARD_1F),
MATCH_MAP(SLATEPORT_CITY_STERNS_SHIPYARD_2F),
}
.text = (u8*)sMachineTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_MUSIC,
.orFlag = 1, // match any of these maps
.conditions =
{
MATCH_MAP(NEW_MAUVILLE_INSIDE),
MATCH_MAP(SLATEPORT_CITY_STERNS_SHIPYARD_1F),
MATCH_MAP(SLATEPORT_CITY_STERNS_SHIPYARD_2F),
},
},
[COND_MSG_SAILING] =
{
.text = (u8*)sBoatTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_MUSIC,
.script = EventScript_FollowerLookAround,
.conditions = {MATCH_MUSIC(MUS_SAILING)},
.text = (u8*)sBoatTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_MUSIC,
.script = EventScript_FollowerLookAround,
.conditions =
{
MATCH_MUSIC(MUS_SAILING),
},
},
[COND_MSG_PUDDLE] =
{
.text = sCondMsg18,
.script = EventScript_FollowerHopping,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions = {MATCH_ON_MB(MB_SHALLOW_WATER, MB_PUDDLE)},
.text = sCondMsg18,
.script = EventScript_FollowerHopping,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_ON_MB(MB_SHALLOW_WATER, MB_PUDDLE),
},
},
[COND_MSG_SAND] =
{
.text = sCondMsg19,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions = {MATCH_ON_MB(MB_SAND, MB_DEEP_SAND)},
.text = sCondMsg19,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_ON_MB(MB_SAND, MB_DEEP_SAND),
},
},
[COND_MSG_GRASS] =
{
.text = sCondMsg20,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions = {MATCH_ON_MB(MB_TALL_GRASS, MB_LONG_GRASS)},
.text = sCondMsg20,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_ON_MB(MB_TALL_GRASS, MB_LONG_GRASS),
},
},
[COND_MSG_FOOTPRINTS] =
{
.text = sCondMsg21,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions = {MATCH_ON_MB(MB_SAND, MB_FOOTPRINTS)},
.text = sCondMsg21,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_ON_MB(MB_SAND, MB_FOOTPRINTS),
},
},
[COND_MSG_ELEVATOR] =
{
.text = (u8*)sElevatorTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_SURPRISE,
.conditions = {MATCH_MAP(LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR)},
.text = (u8*)sElevatorTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_SURPRISE,
.conditions =
{
MATCH_MAP(LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR),
},
},
[COND_MSG_ICE_ROOM] =
{
.text = (u8*)sColdTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_SURPRISE,
.conditions = {MATCH_MAP(SHOAL_CAVE_LOW_TIDE_ICE_ROOM)},
.text = (u8*)sColdTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_SURPRISE,
.conditions =
{
MATCH_MAP(SHOAL_CAVE_LOW_TIDE_ICE_ROOM),
},
},
[COND_MSG_ROUTE_117] =
{
.text = sCondMsg27,
.emotion = FOLLOWER_EMOTION_SURPRISE,
.conditions = {MATCH_MAP(ROUTE117)},
.text = sCondMsg27,
.emotion = FOLLOWER_EMOTION_SURPRISE,
.conditions =
{
MATCH_MAP(ROUTE117),
},
},
[COND_MSG_DRAGON_GROWL] =
{
.text = sCondMsg28,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions = {
MATCH_TYPES(TYPE_DRAGON, TYPE_DRAGON),
MATCH_MAPSEC(MAPSEC_SKY_PILLAR),
}
.text = sCondMsg28,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions =
{
MATCH_TYPES(TYPE_DRAGON, TYPE_DRAGON),
MATCH_MAPSEC(MAPSEC_SKY_PILLAR),
},
},
[COND_MSG_FEAR] =
{
.text = (u8*)sFearTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions = {
MATCH_NOT_TYPES(TYPE_GHOST, TYPE_GHOST),
MATCH_MAPSEC(MAPSEC_MT_PYRE),
MATCH_MUSIC(MUS_MT_PYRE),
}
.text = (u8*)sFearTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions =
{
MATCH_NOT_TYPES(TYPE_GHOST, TYPE_GHOST),
MATCH_MAPSEC(MAPSEC_MT_PYRE),
MATCH_MUSIC(MUS_MT_PYRE),
},
},
[COND_MSG_FIRE_RAIN] =
{
.text = sCondMsg31,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions = {
MATCH_TYPES(TYPE_FIRE, TYPE_FIRE),
MATCH_WEATHER(WEATHER_RAIN, WEATHER_RAIN_THUNDERSTORM),
}
.text = sCondMsg31,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions =
{
MATCH_TYPES(TYPE_FIRE, TYPE_FIRE),
MATCH_WEATHER(WEATHER_RAIN, WEATHER_RAIN_THUNDERSTORM),
},
},
[COND_MSG_FROZEN] =
{
.text = sCondMsg32,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions = {
MATCH_STATUS(STATUS1_FREEZE),
}
.text = sCondMsg32,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions =
{
MATCH_STATUS(STATUS1_FREEZE),
},
},
[COND_MSG_SEASIDE] =
{
.text = (u8*)sSeaTexts,
.textSpread = 1,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions = {MATCH_NEAR_MB(MB_OCEAN_WATER, 5)},
.text = (u8*)sSeaTexts,
.textSpread = 1,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_NEAR_MB(MB_OCEAN_WATER, 5),
},
},
[COND_MSG_WATERFALL] =
{
.text = sCondMsg36,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions = {MATCH_NEAR_MB(MB_WATERFALL, 5)},
.text = sCondMsg36,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_NEAR_MB(MB_WATERFALL, 5),
},
},
[COND_MSG_RAIN] =
{
.text = sCondMsg37,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions = {
.text = sCondMsg37,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_NOT_TYPES(TYPE_FIRE, TYPE_FIRE),
MATCH_WEATHER(WEATHER_RAIN, WEATHER_RAIN_THUNDERSTORM)
}
},
[COND_MSG_REFLECTION] =
{
.text = sCondMsg38,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions = {MATCH_NEAR_MB(MB_POND_WATER, 1)},
.text = sCondMsg38,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_NEAR_MB(MB_POND_WATER, 1),
},
},
[COND_MSG_LEAVES] =
{
.text = sCondMsg39,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions = {MATCH_MAPSEC(MAPSEC_PETALBURG_WOODS)},
.text = sCondMsg39,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_MAPSEC(MAPSEC_PETALBURG_WOODS),
},
},
[COND_MSG_ICE] =
{
.text = (u8*)sIceTexts,
.textSpread = 1,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions = {MATCH_NEAR_MB(MB_ICE, 1)},
.text = (u8*)sIceTexts,
.textSpread = 1,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_NEAR_MB(MB_ICE, 1),
},
},
[COND_MSG_BURN] =
{
.text = sCondMsg42,
.emotion = FOLLOWER_EMOTION_SAD,
.conditions = {MATCH_STATUS(STATUS1_BURN)},
.text = sCondMsg42,
.emotion = FOLLOWER_EMOTION_SAD,
.conditions =
{
MATCH_STATUS(STATUS1_BURN),
},
},
};
// Pool of "unconditional" follower messages
const struct FollowerMessagePool gFollowerBasicMessages[FOLLOWER_EMOTION_LENGTH] = {
[FOLLOWER_EMOTION_HAPPY] = {gFollowerHappyMessages, EventScript_FollowerGeneric, N_FOLLOWER_HAPPY_MESSAGES},
[FOLLOWER_EMOTION_NEUTRAL] = {gFollowerNeutralMessages, EventScript_FollowerGeneric, N_FOLLOWER_NEUTRAL_MESSAGES},
[FOLLOWER_EMOTION_SAD] = {gFollowerSadMessages, EventScript_FollowerGeneric, N_FOLLOWER_SAD_MESSAGES},
[FOLLOWER_EMOTION_UPSET] = {gFollowerUpsetMessages, EventScript_FollowerGeneric, N_FOLLOWER_UPSET_MESSAGES},
[FOLLOWER_EMOTION_ANGRY] = {gFollowerAngryMessages, EventScript_FollowerGeneric, N_FOLLOWER_ANGRY_MESSAGES},
[FOLLOWER_EMOTION_PENSIVE] = {gFollowerPensiveMessages, EventScript_FollowerGeneric, N_FOLLOWER_PENSIVE_MESSAGES},
[FOLLOWER_EMOTION_LOVE] = {gFollowerLoveMessages, EventScript_FollowerGeneric, N_FOLLOWER_LOVE_MESSAGES},
const struct FollowerMessagePool gFollowerBasicMessages[FOLLOWER_EMOTION_LENGTH] =
{
[FOLLOWER_EMOTION_HAPPY] = {gFollowerHappyMessages, EventScript_FollowerGeneric, N_FOLLOWER_HAPPY_MESSAGES},
[FOLLOWER_EMOTION_NEUTRAL] = {gFollowerNeutralMessages, EventScript_FollowerGeneric, N_FOLLOWER_NEUTRAL_MESSAGES},
[FOLLOWER_EMOTION_SAD] = {gFollowerSadMessages, EventScript_FollowerGeneric, N_FOLLOWER_SAD_MESSAGES},
[FOLLOWER_EMOTION_UPSET] = {gFollowerUpsetMessages, EventScript_FollowerGeneric, N_FOLLOWER_UPSET_MESSAGES},
[FOLLOWER_EMOTION_ANGRY] = {gFollowerAngryMessages, EventScript_FollowerGeneric, N_FOLLOWER_ANGRY_MESSAGES},
[FOLLOWER_EMOTION_PENSIVE] = {gFollowerPensiveMessages, EventScript_FollowerGeneric, N_FOLLOWER_PENSIVE_MESSAGES},
[FOLLOWER_EMOTION_LOVE] = {gFollowerLoveMessages, EventScript_FollowerGeneric, N_FOLLOWER_LOVE_MESSAGES},
[FOLLOWER_EMOTION_SURPRISE] = {gFollowerSurpriseMessages, EventScript_FollowerGeneric, N_FOLLOWER_SURPRISE_MESSAGES},
[FOLLOWER_EMOTION_CURIOUS] = {gFollowerCuriousMessages, EventScript_FollowerGeneric, N_FOLLOWER_CURIOUS_MESSAGES},
[FOLLOWER_EMOTION_MUSIC] = {gFollowerMusicMessages, EventScript_FollowerGeneric, N_FOLLOWER_MUSIC_MESSAGES},
[FOLLOWER_EMOTION_CURIOUS] = {gFollowerCuriousMessages, EventScript_FollowerGeneric, N_FOLLOWER_CURIOUS_MESSAGES},
[FOLLOWER_EMOTION_MUSIC] = {gFollowerMusicMessages, EventScript_FollowerGeneric, N_FOLLOWER_MUSIC_MESSAGES},
[FOLLOWER_EMOTION_POISONED] = {gFollowerPoisonedMessages, EventScript_FollowerGeneric, N_FOLLOWER_POISONED_MESSAGES},
};

View File

@ -1303,8 +1303,10 @@ static void CB2_InitRayquazaScene(void)
ClearScheduledBgCopiesToVram();
ScanlineEffect_Stop();
for (i = 0; i < OBJECT_EVENTS_COUNT; i++)
{
if (gObjectEvents[i].graphicsId == OBJ_EVENT_GFX_RAYQUAZA)
gObjectEvents[i].invisible = FALSE;
}
FreeAllSpritePalettes();
ResetPaletteFade();
ResetSpriteData();

View File

@ -1217,7 +1217,7 @@ bool8 ScrCmd_setobjectmovementtype(struct ScriptContext *ctx)
bool8 ScrCmd_createvobject(struct ScriptContext *ctx)
{
u16 graphicsId = ScriptReadByte(ctx); // Support u16 in createvobject
u16 graphicsId = ScriptReadByte(ctx);
u8 virtualObjId = ScriptReadByte(ctx);
u16 x = VarGet(ScriptReadHalfword(ctx));
u32 y = VarGet(ScriptReadHalfword(ctx));