From f496a6b0c75645aa38f76600d357e291f80d4f50 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 9 Sep 2016 21:08:42 -0500 Subject: [PATCH] feat: Lower cost of orb of rebirth closes #7917 fixes #7944 --- common/locales/en/limited.json | 2 +- common/locales/en/rebirth.json | 7 +++-- common/script/ops/rebirth.js | 9 +++---- .../user/POST-user_rebirth.test.js | 2 +- test/common/ops/rebirth.js | 26 +++++++++---------- website/views/options/inventory/drops.jade | 2 +- .../options/inventory/seasonal-shop.jade | 2 +- website/views/shared/modals/rebirth.jade | 7 +++-- 8 files changed, 25 insertions(+), 32 deletions(-) diff --git a/common/locales/en/limited.json b/common/locales/en/limited.json index f991113f58..c5f66ef1c3 100644 --- a/common/locales/en/limited.json +++ b/common/locales/en/limited.json @@ -33,7 +33,7 @@ "seasonalShopFallText": "Welcome to the Seasonal Shop!! We're stocking autumn Seasonal Edition goodies at the moment. Everything here will be available to purchase during the Fall Festival event each year, but we're only open until October 31, so be sure to stock up now, or you'll have to wait a year to buy these items again!", "seasonalShopWinterText": "Welcome to the Seasonal Shop!! We're stocking winter Seasonal Edition goodies at the moment. Everything here will be available to purchase during the Winter Wonderland event each year, but we're only open until January 31, so be sure to stock up now, or you'll have to wait a year to buy these items again!", "seasonalShopFallTextBroken": "Oh.... Welcome to the Seasonal Shop... We're stocking autumn Seasonal Edition goodies, or something... Everything here will be available to purchase during the Fall Festival event each year, but we're only open until October 31... I guess you should to stock up now, or you'll have to wait... and wait... and wait... *sigh*", - "seasonalShopRebirth": "If you've used the Orb of Rebirth, you can repurchase this equipment in the Rewards Column. Initially, you'll only be able to purchase the items for your current class (Warrior by default), but fear not, the other class-specific items will become available if you switch to that class.", + "seasonalShopRebirth": "If you bought any of this equipment in the past but don't currently own it, you can repurchase it in the Rewards Column. Initially, you'll only be able to purchase the items for your current class (Warrior by default), but fear not, the other class-specific items will become available if you switch to that class.", "candycaneSet": "Candy Cane (Mage)", "skiSet": "Ski-sassin (Rogue)", "snowflakeSet": "Snowflake (Healer)", diff --git a/common/locales/en/rebirth.json b/common/locales/en/rebirth.json index f56c9d6279..58ea71dfa5 100644 --- a/common/locales/en/rebirth.json +++ b/common/locales/en/rebirth.json @@ -4,15 +4,14 @@ "rebirthBegin": "Rebirth: Begin a New Adventure", "rebirthStartOver": "Rebirth starts your character over from Level 1.", "rebirthAdvList1": "You return to full Health.", - "rebirthAdvList2": "You have no Experience, Gold, or Equipment (with the exception of free items like Mystery items).", + "rebirthAdvList2": "You have no Experience or Gold.", "rebirthAdvList3": "Your Habits, Dailies, and To-Dos reset to yellow, and streaks reset, except for challenge tasks.", "rebirthAdvList4": "You have the starting class of Warrior until you earn a new class.", "rebirthInherit": "Your new character inherits a few things from their predecessor:", - "rebirthInList1": "Tasks, history, and settings remain.", + "rebirthInList1": "Tasks, history, equipment, and settings remain.", "rebirthInList2": "Challenge, Guild, and Party memberships remain.", "rebirthInList3": "Gems, backer tiers, and contributor levels remain.", "rebirthInList4": "Items obtained from Gems or drops (such as pets and mounts) remain, though you cannot access them until you unlock them again.", - "rebirthInList5": "Limited edition equipment you've purchased can be repurchased, even if its event has ended. To repurchase class-specific equipment, you must first change to the correct class.", "rebirthEarnAchievement": "You also earn an Achievement for beginning a new adventure!", "beReborn": "Be Reborn", "rebirthAchievement": "You've begun a new adventure! This is Rebirth <%= number %> for you, and the highest Level you've attained is <%= level %>. To stack this Achievement, begin your next new adventure when you've reached an even higher Level!", @@ -21,7 +20,7 @@ "rebirthText": "Began <%= rebirths %> New Adventures", "rebirthOrb": "Used an Orb of Rebirth to start over after attaining Level", "rebirthOrb100": "Used an Orb of Rebirth to start over after attaining Level 100 or higher", - "rebirthPop": "Begin a new character at Level 1 while retaining achievements, collectibles, and tasks with history.", + "rebirthPop": "Begin a new character at Level 1 while retaining achievements, collectibles, equipment, and tasks with history.", "rebirthName": "Orb of Rebirth", "reborn": "Reborn, max level <%= reLevel %>", "confirmReborn": "Are you sure?", diff --git a/common/script/ops/rebirth.js b/common/script/ops/rebirth.js index 7937f295ad..265e520491 100644 --- a/common/script/ops/rebirth.js +++ b/common/script/ops/rebirth.js @@ -5,13 +5,12 @@ import { MAX_LEVEL } from '../constants'; import { NotAuthorized, } from '../libs/errors'; -import resetGear from '../fns/resetGear'; import equip from './equip'; const USERSTATSLIST = ['per', 'int', 'con', 'str', 'points', 'gp', 'exp', 'mp']; module.exports = function rebirth (user, tasks = [], req = {}, analytics) { - if (user.balance < 2 && user.stats.lvl < MAX_LEVEL) { + if (user.balance < 1.5 && user.stats.lvl < MAX_LEVEL) { throw new NotAuthorized(i18n.t('notEnoughGems', req.language)); } @@ -21,9 +20,9 @@ module.exports = function rebirth (user, tasks = [], req = {}, analytics) { }; if (user.stats.lvl < MAX_LEVEL) { - user.balance -= 2; + user.balance -= 1.5; analyticsData.acquireMethod = 'Gems'; - analyticsData.gemCost = 8; + analyticsData.gemCost = 6; } else { analyticsData.gemCost = 0; analyticsData.acquireMethod = '> 100'; @@ -59,8 +58,6 @@ module.exports = function rebirth (user, tasks = [], req = {}, analytics) { stats[value] = 0; }); - resetGear(user); - if (user.items.currentPet) { equip(user, { params: { diff --git a/test/api/v3/integration/user/POST-user_rebirth.test.js b/test/api/v3/integration/user/POST-user_rebirth.test.js index f418590020..6182091ad7 100644 --- a/test/api/v3/integration/user/POST-user_rebirth.test.js +++ b/test/api/v3/integration/user/POST-user_rebirth.test.js @@ -25,7 +25,7 @@ describe('POST /user/rebirth', () => { it('resets user\'s tasks', async () => { await user.update({ - balance: 2, + balance: 1.5, }); let daily = await generateDaily({ diff --git a/test/common/ops/rebirth.js b/test/common/ops/rebirth.js index 9fd766b863..a8dfe7a522 100644 --- a/test/common/ops/rebirth.js +++ b/test/common/ops/rebirth.js @@ -20,7 +20,7 @@ describe('shared.ops.rebirth', () => { beforeEach(() => { user = generateUser(); - user.balance = 2; + user.balance = 1.5; tasks = [generateHabit(), generateDaily(), generateTodo(), generateReward()]; }); @@ -119,27 +119,25 @@ describe('shared.ops.rebirth', () => { }); }); - it('resets a user\'s gear', () => { - let gearReset = { - armor: 'armor_base_0', - weapon: 'weapon_warrior_0', - head: 'head_base_0', - shield: 'shield_base_0', - }; + it('retains a user\'s gear', () => { + let prevGearEquipped = user.items.gear.equipped; + let prevGearCostume = user.items.gear.costume; + let prevPrefCostume = user.preferences.costume; rebirth(user); - expect(user.items.gear.equipped).to.deep.equal(gearReset); - expect(user.items.gear.costume).to.deep.equal(gearReset); - expect(user.preferences.costume).to.be.false; + expect(user.items.gear.equipped).to.deep.equal(prevGearEquipped); + expect(user.items.gear.costume).to.deep.equal(prevGearCostume); + expect(user.preferences.costume).to.equal(prevPrefCostume); }); - it('resets a user\'s gear owned', () => { + it('retains a user\'s gear owned', () => { user.items.gear.owned.weapon_warrior_1 = true; // eslint-disable-line camelcase + let prevGearOwned = user.items.gear.owned; + rebirth(user); - expect(user.items.gear.owned.weapon_warrior_1).to.be.false; - expect(user.items.gear.owned.weapon_warrior_0).to.be.true; + expect(user.items.gear.owned).to.equal(prevGearOwned); }); it('resets a user\'s current pet', () => { diff --git a/website/views/options/inventory/drops.jade b/website/views/options/inventory/drops.jade index 7b3704a04a..a0716bf0e2 100644 --- a/website/views/options/inventory/drops.jade +++ b/website/views/options/inventory/drops.jade @@ -139,7 +139,7 @@ popover-append-to-body='true', ng-click='openModal("rebirth")') p(ng-show='user.stats.lvl < 100') - | 8  + | 6  span.Pet_Currency_Gem1x.inline-gems div(ng-show='petCount >= 90 || mountCount >= 90') button.customize-option(popover=env.t('petKeyPop'), popover-title=env.t('petKeyName'), diff --git a/website/views/options/inventory/seasonal-shop.jade b/website/views/options/inventory/seasonal-shop.jade index 9e59b18a7d..f8b9e320d1 100644 --- a/website/views/options/inventory/seasonal-shop.jade +++ b/website/views/options/inventory/seasonal-shop.jade @@ -8,7 +8,7 @@ p(ng-if='!env.worldDmg.seasonalShop')!=env.t('seasonalShopClosedText') p(ng-if='env.worldDmg.seasonalShop')!=env.t('seasonalShopClosedText') - // .well(ng-if='User.user.achievements.rebirths > 0')=env.t('seasonalShopRebirth') + .well(ng-if='User.user.achievements.rebirths > 0')=env.t('seasonalShopRebirth') // li.customize-menu.inventory-gear menu.pets-menu(label=env.t('seasonalItems')) diff --git a/website/views/shared/modals/rebirth.jade b/website/views/shared/modals/rebirth.jade index 68ee0b7c58..f520b8c8fd 100644 --- a/website/views/shared/modals/rebirth.jade +++ b/website/views/shared/modals/rebirth.jade @@ -33,7 +33,6 @@ script(type='text/ng-template', id='modals/rebirth.html') li=env.t('rebirthInList2') li=env.t('rebirthInList3') li=env.t('rebirthInList4') - li=env.t('rebirthInList5') br p @@ -42,11 +41,11 @@ script(type='text/ng-template', id='modals/rebirth.html') =env.t('rebirthEarnAchievement') .modal-footer button.btn.btn-default(ng-click='$close()')=env.t('neverMind') - span(ng-if='user.balance < 2 && user.stats.lvl < 100') + span(ng-if='user.balance < 1.5 && user.stats.lvl < 100') a.btn.btn-success(ng-click='openModal("buyGems",{track:"Gems > Rebirth"})')=env.t('buyMoreGems') span.gem-cost=env.t('notEnoughGems') - span(ng-if='user.balance >= 2 || user.stats.lvl >= 100', ng-controller='SettingsCtrl') + span(ng-if='user.balance >= 1.5 || user.stats.lvl >= 100', ng-controller='SettingsCtrl') a.btn.btn-danger(ng-click='clickRebirth($event)')=env.t('beReborn') span.gem-cost(ng-if='user.stats.lvl < 100') - | 8  + | 6  =env.t('gems')