From 77d92b84dcf07702536572e833c286723c39b078 Mon Sep 17 00:00:00 2001 From: Taldin Date: Thu, 30 Oct 2014 12:35:14 -0700 Subject: [PATCH] added mountmaster support pets: added language support - needs to be commuted to other languages' content.coffee - added api.mounts and api.questmounts index.coffee - revised api.countMounts to remove quest mounts from the list --- locales/en/pets.json | 4 ++++ script/content.coffee | 9 +++++++++ script/index.coffee | 10 ++++++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/locales/en/pets.json b/locales/en/pets.json index 8a47beacb6..f82f17b569 100644 --- a/locales/en/pets.json +++ b/locales/en/pets.json @@ -30,6 +30,10 @@ "beastMastName": "Beast Master", "beastMastText": "Has found all 90 pets (insanely difficult, congratulate this user!)", "beastMastText2": " and has released their pets a total of <%= count %> times", + "mountAchievement": "You have earned the \"Mount Master\" achievement for taming all the mounts!", + "mountMastName": "Mount Master", + "mountMastText": "Has tamed all 90 mounts (even more difficult, congratulate this user!)", + "mountMastText2": " and has released their mounts a total of <%= count %> times", "dropsEnabled": "Drops Enabled!", "itemDrop": "An item has dropped!", "firstDrop": "You've unlocked the Drop System! Now when you complete tasks, you have a small chance of finding an item. You just found a <%= eggText %> Egg! <%= eggNotes %>", diff --git a/script/content.coffee b/script/content.coffee index 7db4eec2ef..8d49e50ab3 100644 --- a/script/content.coffee +++ b/script/content.coffee @@ -730,6 +730,15 @@ api.questPets = _.transform api.questEggs, (m, egg) -> _.defaults m, _.transform api.hatchingPotions, (m2, pot) -> m2[egg.key + "-" + pot.key] = true +## added for mountmaster -- yes, the transforms are correct, since the same strings are used for both pets and mounts +api.mounts = _.transform api.dropEggs, (m, egg) -> + _.defaults m, _.transform api.hatchingPotions, (m2, pot) -> + m2[egg.key + "-" + pot.key] = true + +api.questMounts = _.transform api.questEggs, (m, egg) -> + _.defaults m, _.transform api.hatchingPotions, (m2, pot) -> + m2[egg.key + "-" + pot.key] = true + #TODO after the fall event, set Base set to canBuy:true (or remove, since it's default) and set Fall set to canBuy:false api.food = # Base diff --git a/script/index.coffee b/script/index.coffee index bc2899916a..9ae6052ef4 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -318,11 +318,13 @@ api.countPets = (originalCount, pets) -> count-- if pets[pet] count -api.countMounts= (originalCount, mounts) -> - count = if originalCount? then originalCount else _.size(mounts) +api.countMounts = (originalCount, mounts) -> + count2 = if originalCount? then originalCount else _.size(mounts) + for mount of content.questPets + count2-- if mounts[mount] for mount of content.specialMounts - count-- if mounts[mount] - count + count2-- if mounts[mount] + count2 ### ------------------------------------------------------