From 2054d10de245b02744fcf1657ce1aae12c6931b4 Mon Sep 17 00:00:00 2001 From: deilann Date: Mon, 29 Sep 2014 15:11:24 -0700 Subject: [PATCH] release pets feature --- img/sprites/spritesmith/misc/pet_key.png | Bin 0 -> 1486 bytes locales/en/pets.json | 13 ++++++++++- script/index.coffee | 28 +++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 img/sprites/spritesmith/misc/pet_key.png diff --git a/img/sprites/spritesmith/misc/pet_key.png b/img/sprites/spritesmith/misc/pet_key.png new file mode 100644 index 0000000000000000000000000000000000000000..81cd39b302ec7b68048c27cfca79c86ba9b29034 GIT binary patch literal 1486 zcmeAS@N?(olHy`uVBq!ia0vp^S|H591|*LjJ{b+9BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFsEgPM3hAM`dB6B=jtVb)aX^@765fKFxc2v6eK2Rr0UTq__OB&@Hb09I0xZL0)vRD^GUf^&XRs)DJWv2L<~p`n7AnVzAE zshOFfj)IYap^?4;5Si&3npl~dSs9rtK!Fm_wxX0Ys~{IQs9ivwtx`rwNr9EVetCJh zUb(Seeo?xx^|#0uTKVr7^KE~&-IMVSR9nfZANAQKal@=Hr> zm4GgVcpk{1iHq`zbF$JDTz5Q`N^fZsd*)yF1AWQ8NHOu6e|lyGiL)c zb3+poOLJFaLqkhv7Xw!lX9G7Ub5loW14oz{*z_8kn;V##Ik{Szo0u9Jx*9uKIJ>x7 zn3)<`I-0py8XLp(dgc|EB<3Zj!tBii+6&d|f>*DVb5UwyNq$jCetr%t1q5W|m*f{` zecdiTuYGgqW8RIcZtlpFw)s_bs%zq8M&@lX`76@f zuF5<~X_#}yZSlNif&FuKPh1@Rh0V*z!G$--=*G@ceWl6_>4e^QkC*cwzBz5#wt}*> zAi+6n->2}Wryu$8U%t1h>S>i*&Q597T@$Y;Feiv8Pda;*JK}Xo%H9JhALKQc9~M31 z(DmygQ~d$%nwVA_BZt1ECqfMViG1v0YG#MkUD|t`B_~Gz*fFbkhePm+xAi%t=7y!a z?E3ET>O2utJus2vX7OuJQiLJ7sdWHJgHjq;JT&D zYuTNg?ROk!_lZnBaj{+dx^nriw$Ki~vn$-$6zc>FI&ZXCtodrO?!__IS7GvMnKcO} zuU?9MJ-{bECpa*&({$Iw*B@J&f-HVN+SeSR&G+O^@9Gf7-X{WHLW=|azwVN=1S-gT za%j$sH0dJFhCBYpnK$$)GE@sMcDDM`S@mR@_`F@x*C%inl?dy6m{@GMfhFOH*xdsu z4JW>SZCku^UKy)h5g)6YxeeF4dlg*$Ou4+7Yj~NSoD*NiC$)81J23EXF(@2hNaQ`g UJ9(1oJWvVi>FVdQ&MBb@09mOUbN~PV literal 0 HcmV?d00001 diff --git a/locales/en/pets.json b/locales/en/pets.json index d7e84db679..8a47beacb6 100644 --- a/locales/en/pets.json +++ b/locales/en/pets.json @@ -29,6 +29,7 @@ "beastAchievement": "You have earned the \"Beast Master\" Achievement for collecting all the pets!", "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", "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 %>", @@ -37,5 +38,15 @@ "feedPet": "Feed <%= article %><%= text %> to your <%= name %>?", "useSaddle": "Saddle <%= pet %>?", "petName": "<%= potion %> <%= egg %>", - "mountName": "<%= potion %> <%= mount %>" + "mountName": "<%= potion %> <%= mount %>", + "petKeyName": "Key to the Kennels", + "petKeyPop": "Let your pets roam free, release them to start their own adventure, and give yourself the thrill of Beastmaster once more!", + "petKeyBegin": "Key to the Kennels: Experience Beastmaster Once More!", + "petKeyInfo": "Love your pets enough to let them go, and have drops feel meaningful again.", + "petKeyInfo2": "The Key to the Kennels resets all of your non-quest pets back to as if you'd never found them. Once you've used it, you'll be able to stack the Beastmaster achievement, showing off how many times you've been able to best the RNG.", + "petKeyInfo3": "There are two sets of Keys: you can either just release your pets for four gems or your pets and mounts for eight gems. If you're still working towards getting all of the mounts, you may not want to give them their freedom yet!", + "petKeyPets": "Release My Pets", + "petKeyMounts": "Release Both Please", + "petKeyNeverMind": "Not Yet", + "gemsEach": "gems each" } diff --git a/script/index.coffee b/script/index.coffee index 21cbffa985..8d8e573e32 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -642,6 +642,34 @@ api.wrap = (user, main=true) -> cb? null, _.pick(user,$w 'items balance') ga?.event('purchase', key).send() + release: (req, cb) -> + if user.balance < 1 + return cb? {code:401,message: i18n.t('notEnoughGems', req.language)} + else + user.balance-- + for pet of content.pets + user.items.pets[pet] = 0 + if not user.achievements.beastMasterCount + user.achievements.beastMasterCount = 0 + user.achievements.beastMasterCount++ + user.items.currentPet = "" + cb? null, user + + release2: (req, cb) -> + if user.balance < 2 + return cb? {code:401,message: i18n.t('notEnoughGems', req.language)} + else + user.balance -= 2 + user.items.currentMount = "" + user.items.currentPet = "" + for pet of content.pets + user.items.mounts[pet] = false + user.items.pets[pet] = 0 + if not user.achievements.beastMasterCount + user.achievements.beastMasterCount = 0 + user.achievements.beastMasterCount++ + cb? null, user + # buy is for gear, purchase is for gem-purchaseables (i know, I know...) buy: (req, cb) -> {key} = req.params