mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -05:00
fix: eco items, wall, photo booth, chat emoji, den fixes
- the eco den items work: the Eco Shop sells the real eco items, solar panels and wind turbines placed in the den in use earn eco credits, lamps switch on while there is power for them, and the eco score earns the three eco plaques; a first look gives an account its first credits - the item giver row opens the web item giver - a painting that cannot be shown is the Burrow logo, not a wait for good - Jammer Central's buttons work; What's New shows the newest Jamaa Journal - the Jammer Wall opens even while the HUD is checking the player's own; a photo of an animal wearing nothing is kept; a wall photo of an animal the game does not know no longer stops the wall - the photo booth's paid picture is answered - emoji no longer push the line off centre; "\" keeps an emote or a ":name:" as typed; a repeated line with emoji is sent as it was said - the emoji button hides with the HUD, not a moment after - the join date on a player's card stays in its corner - den items whose def is gone no longer garble the den and the inventory; custom pictures in a den no longer stop walking - the den editor's switch and recycle buttons are always there - the den inventory scrolls to an eleventh item
This commit is contained in:
1 parent
7de41ceed5
commit
c7efda7030
20 files changed
+6959
-1901
No files matched your search
+11
-3
@@ -44,8 +44,9 @@ const DEF_WORLD_ITEMS = 1064;
|
||||
const DEF_NPC = 1025;
|
||||
const DEF_NAMEBAR_BADGE = 1049;
|
||||
const DEF_EMOTICON = 1036;
|
||||
const DEF_NEWSPAPER = 1065; // the Jamaa Journal's pages (newspaper.NewspaperManager)
|
||||
|
||||
const OFFERED_SPECIAL_TYPES = ["0", "4"]; // den items: plain, mannequin
|
||||
const OFFERED_SPECIAL_TYPES = ["0", "4", "6", "7"]; // den items: plain, mannequin, eco producer and consumer (lib/eco.js)
|
||||
const DEN_ITEM_MASTERPIECE = 2725;
|
||||
|
||||
const packs = new Map();
|
||||
@@ -487,6 +488,7 @@ let npcDefs = new Map(); // the characters of the adventures, see lib/disguises.
|
||||
// An avatar attachment is named by its emoticon definition id on the wire,
|
||||
// while AvatarWorldView needs the media id stored by that definition.
|
||||
let emoticonMediaIds = new Map();
|
||||
let journalPages = []; // the Jamaa Journal's pages: {id, page (media id), start (seconds)}
|
||||
|
||||
// A pack whose feature can be done without: missing (offline and never
|
||||
// cached) just leaves that feature empty.
|
||||
@@ -516,8 +518,9 @@ const init = async () => {
|
||||
petIds = [...petDefs.keys()];
|
||||
denItemDefs = new Map((await load(DEF_DEN_ITEM)).map(def => [Number(def.id), def]));
|
||||
// special types carry extra state (a den portal's destination, a shop's
|
||||
// stock, ...). of those only mannequins (4) are modelled, in lib/dens.js,
|
||||
// so plain den items and mannequins are what is offered.
|
||||
// stock, ...). of those mannequins (4) are modelled, in lib/dens.js, and
|
||||
// the eco items (6, 7) in lib/eco.js, so those and plain den items are
|
||||
// what is offered.
|
||||
// the Masterpiece item is a painting's frame, made in the Art Studio and
|
||||
// nowhere else (lib/masterpieces.js).
|
||||
denItemIds = [...denItemDefs].filter(([id, def]) => OFFERED_SPECIAL_TYPES.includes(def.specialType) && id !== DEN_ITEM_MASTERPIECE).map(([id]) => id);
|
||||
@@ -554,6 +557,8 @@ const init = async () => {
|
||||
petToyDefs = await loadOptional(DEF_PET_TOY);
|
||||
npcDefs = new Map((await loadOptional(DEF_NPC)).map(def => [Number(def.id), def]));
|
||||
emoticonMediaIds = new Map((await loadOptional(DEF_EMOTICON)).map(def => [Number(def.id), Number(def.mediaRef)]));
|
||||
journalPages = (await loadOptional(DEF_NEWSPAPER)).map(def => ({id: Number(def.id), page: Number(def.pageMediaRefId),
|
||||
start: Number(def.availabilityStartTime) || 0})).filter(page => page.page > 0);
|
||||
partyDefs = new Map((await loadOptional(DEF_PARTY)).map(def => {
|
||||
const room = roomPathsById.get(Number(def.roomDefId));
|
||||
return [Number(def.id), {
|
||||
@@ -665,6 +670,9 @@ module.exports = {
|
||||
badgeIds: () => badgeIds,
|
||||
npcDef: id => npcDefs.get(Number(id)),
|
||||
emoticonMediaId: id => emoticonMediaIds.get(Number(id)) || 0,
|
||||
// the media ids of the newest Jamaa Journal pages out by `now` (seconds), newest first
|
||||
newestJournalPages: (count, now = Date.now() / 1000) => journalPages.filter(page => page.start <= now)
|
||||
.sort((one, other) => other.start - one.start || other.id - one.id).slice(0, count).map(page => page.page),
|
||||
oddDenItemIds: () => oddDenItemIds,
|
||||
// den items that exist to be given by id and are in no shop.
|
||||
unsoldDenItemIds: () => extraMusic.ids,
|
||||
|
||||
Reference in new issue
Block a user