diff --git a/lib/defpacks.js b/lib/defpacks.js index 4ff8cf6..0de025f 100644 --- a/lib/defpacks.js +++ b/lib/defpacks.js @@ -239,6 +239,31 @@ const withCustomRows = id => pack => { return pack; }; +// colours of clothing items from a dump of a beta-era inventory (art id, +// then the colour as 4 bytes, little-endian), added after each item's own +// so the colours already given keep their place. the shop shows a list's +// first 8 only, so these are had from the item givers. +const DUMP_COLOURS = new Map([ + [231, [0x6929C069]], // Rare Eyeball Hat (Beta EyeBall; tried in the game) + [224, [0x67520169]], // Creature Mask (Beta Creature Mask) + [136, [0x2C083069, 0x55153131]], // Tiara (Beta Tiara, Milky Tiara) + [135, [0x83550505]], // Arctic Hood (Beta Hood) + [169, [0x937FF63B]], // Elf Helmet (Beta Elf) + [714, [0x00000069]], // Furry Hat (Real Magenta Furry Hat) + [649, [0x2E2D1906]], // Turquoise Ring (1st Glitched Ring) +]); + +const withDumpColours = pack => { + for (const def of Object.values(pack)) { + const added = def && DUMP_COLOURS.get(Number(def.id)); + if (added) { + const colours = String(def.colors).split(",").filter(Boolean); + def.colors = [...colours, ...added.map(String).filter(colour => !colours.includes(colour))].join(","); + } + } + return pack; +}; + const withAddedStrings = pack => Object.assign(withLineBreaks(withOurName(Object.assign(pack, ADDED_STRINGS, extraMusic.strings()))), customStrings); // the extra music tracks (lib/extramusic.js), as den items like the @@ -301,7 +326,7 @@ const SHARED_CHANGES = new Map([ [DEF_PARTY, withRestoredParties], [DEF_DEN_ROOM, withoutPrices(DEF_DEN_ROOM, withAddedDens)], [DEF_DEN_ITEM, withoutPrices(DEF_DEN_ITEM, pack => withCustomRows(DEF_DEN_ITEM)(withExtraMusic(pack)))], - [DEF_ITEM, withoutPrices(DEF_ITEM, withCustomRows(DEF_ITEM))], + [DEF_ITEM, withoutPrices(DEF_ITEM, pack => withCustomRows(DEF_ITEM)(withDumpColours(pack)))], [DEF_DIAMOND, withoutPrices(DEF_DIAMOND)], [DEF_PET, withoutPrices(DEF_PET)], [DEF_LOCALIZATION_EN, withAddedStrings],