From 82b58a7435adb442c55221ff42a32a909ca53a60 Mon Sep 17 00:00:00 2001 From: Lorian Date: Sat, 8 Feb 2014 20:14:50 -0800 Subject: [PATCH] dropEggs and questEggs now automatically make the full content.eggs list; no manual duplication required. --- dist/habitrpg-shared.js | 60 ++--------------------------------------- script/content.coffee | 22 ++------------- 2 files changed, 4 insertions(+), 78 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 14127db8a2..718657fb8a 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -10548,64 +10548,6 @@ var global=typeof self !== "undefined" ? self : typeof window !== "undefined" ? */ - api.eggs = { - Wolf: { - text: 'Wolf', - adjective: 'loyal' - }, - TigerCub: { - text: 'Tiger Cub', - mountText: 'Tiger', - adjective: 'fierce' - }, - PandaCub: { - text: 'Panda Cub', - mountText: 'Panda', - adjective: 'gentle' - }, - LionCub: { - text: 'Lion Cub', - mountText: 'Lion', - adjective: 'regal' - }, - Fox: { - text: 'Fox', - adjective: 'wily' - }, - FlyingPig: { - text: 'Flying Pig', - adjective: 'whimsical' - }, - Dragon: { - text: 'Dragon', - adjective: 'mighty' - }, - Cactus: { - text: 'Cactus', - adjective: 'prickly' - }, - BearCub: { - text: 'Bear Cub', - mountText: 'Bear', - adjective: 'cuddly' - }, - Gryphon: { - text: 'Gryphon', - adjective: 'regal', - canBuy: false - } - }; - - _.each(api.eggs, function(egg, key) { - return _.defaults(egg, { - canBuy: true, - value: 3, - key: key, - notes: "Find a hatching potion to pour on this egg, and it will hatch into a " + egg.adjective + " " + egg.text + ".", - mountText: egg.text - }); - }); - api.dropEggs = { Wolf: { text: 'Wolf', @@ -10677,6 +10619,8 @@ var global=typeof self !== "undefined" ? self : typeof window !== "undefined" ? }); }); + api.eggs = _.assign(_.cloneDeep(api.dropEggs), api.questEggs); + api.specialPets = { 'Wolf-Veteran': true, 'Wolf-Cerberus': true, diff --git a/script/content.coffee b/script/content.coffee index ee02a58c67..028f330be8 100644 --- a/script/content.coffee +++ b/script/content.coffee @@ -486,26 +486,6 @@ api.special = api.spells.special --------------------------------------------------------------- ### -api.eggs = - # value & other defaults set below - Wolf: text: 'Wolf', adjective: 'loyal' - TigerCub: text: 'Tiger Cub', mountText: 'Tiger', adjective: 'fierce' - PandaCub: text: 'Panda Cub', mountText: 'Panda', adjective: 'gentle' - LionCub: text: 'Lion Cub', mountText: 'Lion', adjective: 'regal' - Fox: text: 'Fox', adjective: 'wily' - FlyingPig: text: 'Flying Pig', adjective: 'whimsical' - Dragon: text: 'Dragon', adjective: 'mighty' - Cactus: text: 'Cactus', adjective: 'prickly' - BearCub: text: 'Bear Cub', mountText: 'Bear', adjective: 'cuddly' - Gryphon: text: 'Gryphon', adjective: 'regal', canBuy: false -_.each api.eggs, (egg,key) -> - _.defaults egg, - canBuy:true - value: 3 - key: key - notes: "Find a hatching potion to pour on this egg, and it will hatch into a #{egg.adjective} #{egg.text}." - mountText: egg.text - api.dropEggs = # value & other defaults set below Wolf: text: 'Wolf', adjective: 'loyal' @@ -536,6 +516,8 @@ _.each api.questEggs, (egg,key) -> notes: "Find a hatching potion to pour on this egg, and it will hatch into a #{egg.adjective} #{egg.text}." mountText: egg.text +api.eggs = _.assign(_.cloneDeep(api.dropEggs), api.questEggs) + api.specialPets = 'Wolf-Veteran': true 'Wolf-Cerberus': true