diff --git a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc index 31314b5982..cdd08fc777 100644 --- a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc @@ -476,6 +476,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_SetUpObjects:: call BattleFrontier_EventScript_SetBrainObjectGfx setobjectxyperm LOCALID_OPPONENT, 13, 9 removeobject LOCALID_OPPONENT + delay 1 addobject LOCALID_OPPONENT applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_SetInvisibleFacingUp BattleFrontier_BattleDomeBattleRoom_EventScript_EndSetUpObjects:: diff --git a/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc b/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc index 53514bb5e9..fd6567cb65 100644 --- a/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc +++ b/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc @@ -48,6 +48,7 @@ SlateportCity_BattleTentBattleRoom_EventScript_EnterRoom:: factory_setopponentgfx setobjectxyperm LOCALID_OPPONENT, 5, 1 removeobject LOCALID_OPPONENT + delay 1 addobject LOCALID_OPPONENT applymovement LOCALID_OPPONENT, SlateportCity_BattleTentBattleRoom_Movement_OpponentEnter waitmovement 0 @@ -102,4 +103,3 @@ SlateportCity_BattleTentBattleRoom_Movement_OpponentEnter: walk_down walk_in_place_faster_left step_end - diff --git a/data/tilesets/secondary/ever_grande/palettes/01.pal b/data/tilesets/secondary/ever_grande/palettes/01.pal index 3c6e40c2e9..2c02767613 100644 --- a/data/tilesets/secondary/ever_grande/palettes/01.pal +++ b/data/tilesets/secondary/ever_grande/palettes/01.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -24 41 82 -255 255 255 -222 230 238 -189 205 230 -156 180 222 +0 197 0 +246 197 123 +238 156 90 +205 115 41 +164 90 49 131 131 139 98 98 123 65 74 106 41 49 90 -115 189 246 -98 172 238 -255 189 131 -238 148 115 -222 106 98 -205 65 82 -115 197 164 +224 226 171 +216 200 152 +255 255 238 +222 222 197 +197 197 164 +164 172 123 +255 255 115 diff --git a/data/tilesets/secondary/ever_grande/palettes/08.pal b/data/tilesets/secondary/ever_grande/palettes/08.pal index 083dd5080a..67b9146fd0 100644 --- a/data/tilesets/secondary/ever_grande/palettes/08.pal +++ b/data/tilesets/secondary/ever_grande/palettes/08.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -24 41 82 +0 197 0 246 197 123 238 156 90 205 115 41 diff --git a/data/tilesets/secondary/sootopolis/palettes/10.pal b/data/tilesets/secondary/sootopolis/palettes/10.pal index 6ca963250f..46457797ed 100644 --- a/data/tilesets/secondary/sootopolis/palettes/10.pal +++ b/data/tilesets/secondary/sootopolis/palettes/10.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -115 197 164 +0 230 25 139 115 106 115 90 82 90 65 65 @@ -16,4 +16,4 @@ JASC-PAL 148 74 41 82 139 197 74 115 172 -0 0 0 +246 74 65 diff --git a/include/event_object_movement.h b/include/event_object_movement.h index aa9e66964f..811474ccc4 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -131,6 +131,7 @@ struct ObjectEvent * GetFollowerObject(void); u8 GetDirectionToFace(s16, s16, s16, s16); void UpdateLightSprite(struct Sprite *); void TrySpawnObjectEvents(s16 cameraX, s16 cameraY); +u8 CreateObjectGraphicsSpriteWithTag(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u16 paletteTag); u8 CreateObjectGraphicsSprite(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority); u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup); u8 SpawnSpecialObjectEventParameterized(u16 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 elevation); diff --git a/src/data/tilesets/headers.h b/src/data/tilesets/headers.h index 0e8d4dca90..8a7907c6c8 100644 --- a/src/data/tilesets/headers.h +++ b/src/data/tilesets/headers.h @@ -154,6 +154,8 @@ const struct Tileset gTileset_EverGrande = .metatiles = gMetatiles_EverGrande, .metatileAttributes = gMetatileAttributes_EverGrande, .callback = InitTilesetAnim_EverGrande, + .lightPalettes = LIGHT_PAL(8), + .swapPalettes = SWAP_PAL(8), }; const struct Tileset gTileset_Pacifidlog = @@ -174,8 +176,8 @@ const struct Tileset gTileset_Sootopolis = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(6), .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(6), - .customLightColor = LIGHT_PAL(6), + .lightPalettes = LIGHT_PAL(6) | LIGHT_PAL(10), + .customLightColor = LIGHT_PAL(6) | LIGHT_PAL(10), .tiles = gTilesetTiles_Sootopolis, .palettes = gTilesetPalettes_Sootopolis, .metatiles = gMetatiles_Sootopolis, diff --git a/src/decoration.c b/src/decoration.c index 6d95cfbdc3..d33ded155f 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -2110,7 +2110,7 @@ static u8 AddDecorationIconObjectFromObjectEvent(u16 tilesTag, u16 paletteTag, u } else { - spriteId = CreateObjectGraphicsSprite(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1); + spriteId = CreateObjectGraphicsSpriteWithTag(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1, paletteTag); } return spriteId; } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index f460a68804..96c1d2f305 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1632,8 +1632,20 @@ static u8 LoadDynamicFollowerPaletteFromGraphicsId(u16 graphicsId, bool8 shiny, return paletteNum; } +// Like LoadObjectEventPalette, but overwrites the palette tag that is loaded +static u8 LoadObjectEventPaletteWithTag(u16 paletteTag, u16 overTag) { + u32 i = FindObjectEventPaletteIndexByTag(paletteTag); + struct SpritePalette spritePalette; + if (i == 0xFF) + return i; + spritePalette = sObjectEventSpritePalettes[i]; + if (overTag != TAG_NONE) + spritePalette.tag = overTag; // overwrite palette tag + return LoadSpritePaletteIfTagExists(&spritePalette); +} + // Used to create a sprite using a graphicsId associated with object events. -u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority) +u8 CreateObjectGraphicsSpriteWithTag(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u16 paletteTag) { struct SpriteTemplate *spriteTemplate; const struct SubspriteTable *subspriteTables; @@ -1649,8 +1661,14 @@ u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), // Use shininess info from follower object // in future this should be passed in paletteNum = LoadDynamicFollowerPaletteFromGraphicsId(graphicsId, obj ? obj->shiny : FALSE, spriteTemplate); - } else if (spriteTemplate->paletteTag != TAG_NONE) - LoadObjectEventPalette(spriteTemplate->paletteTag); + } else if (spriteTemplate->paletteTag != TAG_NONE) { + if (paletteTag == TAG_NONE) + LoadObjectEventPalette(spriteTemplate->paletteTag); + else { + LoadObjectEventPaletteWithTag(spriteTemplate->paletteTag, paletteTag); + spriteTemplate->paletteTag = paletteTag; + } + } spriteId = CreateSprite(spriteTemplate, x, y, subpriority); Free(spriteTemplate); @@ -1664,6 +1682,10 @@ u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), return spriteId; } +u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority) { + return CreateObjectGraphicsSpriteWithTag(graphicsId, callback, x, y, subpriority, TAG_NONE); +} + #define sVirtualObjId data[0] #define sVirtualObjElev data[1] diff --git a/src/field_weather.c b/src/field_weather.c index 4f9b72ea75..a875b7ec39 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -483,7 +483,7 @@ static void ApplyColorMap(u8 startPalIndex, u8 numPalettes, s8 colorMapIndex) palOffset = startPalIndex * 16; UpdateAltBgPalettes(palettes & PALETTES_BG); // Thunder gamma-shift looks bad on night-blended palettes, so ignore time blending in some situations - if (!(colorMapIndex > 3 && gWeatherPtr->currWeather == WEATHER_RAIN_THUNDERSTORM) && MapHasNaturalLight(gMapHeader.mapType)) + if (!(colorMapIndex > 3) && MapHasNaturalLight(gMapHeader.mapType)) UpdatePalettesWithTime(palettes); else CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 32 * numPalettes); diff --git a/src/shop.c b/src/shop.c index 46c2f240d8..a122670422 100644 --- a/src/shop.c +++ b/src/shop.c @@ -41,7 +41,7 @@ #include "constants/songs.h" #define TAG_SCROLL_ARROW 2100 -#define TAG_ITEM_ICON_BASE 2110 +#define TAG_ITEM_ICON_BASE 9110 // immune to time blending #define MAX_ITEMS_SHOWN 8