From 2a417cd2019d1b31c35da5fa5081ecf93dcbeafa Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 4 Dec 2013 23:53:15 -0700 Subject: [PATCH] classes: add level requirements for spells, remove derby cleanup, unlock classes properly --- dist/habitrpg-shared.js | 40 +++++++++++++++++++++++----------------- script/algos.coffee | 15 ++++++++------- script/items.coffee | 24 ++++++++++++++++++++---- 3 files changed, 51 insertions(+), 28 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 7d4a3e2087..4d4ea7f0e9 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -8983,19 +8983,6 @@ var global=self;/** _ref1 = [+user.stats.gp, +user.stats.hp, +user.stats.exp, ~~user.stats.lvl], gp = _ref1[0], hp = _ref1[1], exp = _ref1[2], lvl = _ref1[3]; _ref2 = [task.type, +task.value, ~~task.streak, task.priority || '!'], type = _ref2[0], value = _ref2[1], streak = _ref2[2], priority = _ref2[3]; _ref3 = [options.paths || {}, options.times || 1, options.cron || false], paths = _ref3[0], times = _ref3[1], cron = _ref3[2]; - if (!task.id) { - return 0; - } - if (!_.isNumber(value) || _.isNaN(value)) { - task.value = value = 0; - paths["tasks." + task.id + ".value"] = true; - } - _.each(user.stats, function(v, k) { - if (!_.isNumber(v) || _.isNaN(v)) { - user.stats[k] = 0; - return paths["stats." + k] = true; - } - }); if (task.value > user.stats.gp && task.type === 'reward') { return; } @@ -9170,6 +9157,9 @@ var global=self;/** user.flags.dropsEnabled = true; user.items.eggs["Wolf"] = 1; } + if (!user.flags.classSelected && user.stats.lvl >= 5) { + user.flags.classSelected; + } } if (newStats.gp != null) { if ((typeof gp === "undefined" || gp === null) || gp < 0) { @@ -10112,7 +10102,7 @@ try { last: true } }, - mage: { + wizard: { 0: { text: "Apprentice Staff", notes: 'Practice staff. Confers no benefit.', @@ -10306,7 +10296,7 @@ try { last: true } }, - mage: { + wizard: { 0: { text: "Apprentice Garb", notes: 'For students of magic. Confers no benefit.', @@ -10482,7 +10472,7 @@ try { last: true } }, - mage: { + wizard: { 0: { text: "No Hat", notes: 'No headgear.', @@ -10628,7 +10618,7 @@ try { last: true } }, - mage: { + wizard: { 0: { text: "No Shield", notes: 'No shield.', @@ -10781,6 +10771,7 @@ try { fireball: { text: 'Burst of Flames', mana: 10, + lvl: 6, target: 'task', notes: 'With a crack, flames burst from your staff, scorching a task. You deal much higher damage to the task and gain additional xp.', cast: function(user, target) { @@ -10790,6 +10781,7 @@ try { lightning: { text: 'Lightning Strike', mana: 15, + lvl: 7, target: 'task', notes: 'A bolt a lightning pierces through a task. There is a high chance of a critical hit.', cast: function(user, target) { @@ -10799,6 +10791,7 @@ try { frost: { text: 'Chilling Frost', mana: 35, + lvl: 8, target: 'party', notes: "Ice forms of the party's tasks, slowing them down and opening them up to more attacks. Your party gains a buff to xp.", cast: function(user, target) { @@ -10810,6 +10803,7 @@ try { darkness: { text: 'Shroud of Darkness', mana: 30, + lvl: 9, target: 'party', notes: "Unearthly shadows form and wisp around your party, concealing their presence. Under the shroud, your party can sneak up on tasks, dealing more critical hits.", cast: function(user, target) { @@ -10823,6 +10817,7 @@ try { smash: { text: 'Brutal Smash', mana: 10, + lvl: 6, target: 'task', notes: "You savagely hit a single task with all of your might, beating it into submission. The task's redness decreases.", cast: function(user, target) { @@ -10832,6 +10827,7 @@ try { defensiveStance: { text: 'Defensive Stance', mana: 25, + lvl: 7, target: 'self', notes: "You take a moment to relax your body and enter a defensive stance to ready yourself for the tasks' next onslaught. Reduced damage from dailies at the end of the day.", cast: function(user, target) { @@ -10841,6 +10837,7 @@ try { valorousPresence: { text: 'Valorous Presence', mana: 20, + lvl: 8, target: 'party', notes: "Your presence emboldens the party. Their newfound courage gives them a boost of strength. Party members gain a buff to their STR.", cast: function(user, target) { @@ -10852,6 +10849,7 @@ try { intimidate: { text: 'Intimidating Gaze', mana: 15, + lvl: 9, target: 'party', notes: "Your gaze strikes fear into the hearts of your party's enemies. The party gains a moderate boost to defense.", cast: function(user, target) { @@ -10865,6 +10863,7 @@ try { pickPocket: { text: 'Pickpocket', mana: 10, + lvl: 6, target: 'task', notes: "Your nimble fingers run through the task's pockets and 'find' some treasures for yourself. You gain an increased gold bonus on the task and a higher chance of an item drop.", cast: function(user, target) { @@ -10874,6 +10873,7 @@ try { backStab: { text: 'Backstab', mana: 15, + lvl: 7, target: 'task', notes: "Without a sound, you sweep behind a task and stab it in the back. You deal higher damage to the stat, with a higher chance of a critical hit.", cast: function(user, target) { @@ -10884,6 +10884,7 @@ try { stealth: { text: 'Tools of the Trade', mana: 20, + lvl: 8, target: 'party', notes: "You share your thievery tools with the party to aid them in 'acquiring' more gold. The party's gold bonus for tasks is buffed for a day.", cast: function(user, target) { @@ -10895,6 +10896,7 @@ try { speedburst: { text: 'Burst of Speed', mana: 25, + lvl: 9, target: 'party', notes: "You hurry your step and dance circles around your party's enemies. You assist your party, helping them do extra damage to a number of tasks equal to half your strength.", cast: function(user, target) { @@ -10908,6 +10910,7 @@ try { heal: { text: 'Healing Light', mana: 15, + lvl: 6, target: 'self', notes: 'Light covers your body, healing your wounds. You gain a boost to your health.', cast: function(user, target) { @@ -10917,6 +10920,7 @@ try { brightness: { text: 'Searing Brightness', mana: 15, + lvl: 7, target: 'self', notes: "You cast a burst of light that blinds all of your tasks. The redness of your tasks is reduced", cast: function(user, target) { @@ -10926,6 +10930,7 @@ try { protectAura: { text: 'Protective Aura', mana: 30, + lvl: 8, target: 'party', notes: "A magical aura surrounds your party members, protecting them from damage. Your party members gain a buff to their defense.", cast: function(user, target) { @@ -10937,6 +10942,7 @@ try { heallAll: { text: 'Blessing', mana: 25, + lvl: 9, target: 'party', notes: "Soothing light envelops your party and heals them of their injuries. Your party members gain a boost to their health.", cast: function(user, target) { diff --git a/script/algos.coffee b/script/algos.coffee index 4d5b7d1684..b37ef60dbf 100644 --- a/script/algos.coffee +++ b/script/algos.coffee @@ -215,13 +215,12 @@ obj.score = (user, task, direction, options={}) -> # Handle corrupt tasks # This type of cleanup-code shouldn't be necessary, revisit once we're off Derby - return 0 unless task.id - if !_.isNumber(value) or _.isNaN(value) - task.value = value = 0; - paths["tasks.#{task.id}.value"] = true - _.each user.stats, (v,k) -> - if !_.isNumber(v) or _.isNaN(v) - user.stats[k] = 0; paths["stats.#{k}"] = true +# return 0 unless task.id +# if !_.isNumber(value) or _.isNaN(value) +# task.value = value = 0; +# _.each user.stats, (v,k) -> +# if !_.isNumber(v) or _.isNaN(v) +# user.stats[k] = 0; paths["stats.#{k}"] = true # If they're trying to purhcase a too-expensive reward, don't allow them to do that. if task.value > user.stats.gp and task.type is 'reward' @@ -369,6 +368,8 @@ updateStats = (user, newStats, options={}) -> if !user.flags.dropsEnabled and user.stats.lvl >= 4 user.flags.dropsEnabled = true user.items.eggs["Wolf"] = 1 + if !user.flags.classSelected and user.stats.lvl >= 5 + user.flags.classSelected if newStats.gp? #FIXME what was I doing here? I can't remember, gp isn't defined diff --git a/script/items.coffee b/script/items.coffee index 1c0c015b1e..a772d6a27e 100644 --- a/script/items.coffee +++ b/script/items.coffee @@ -27,7 +27,7 @@ gear = 4: text: "Icicle Bow", notes:'Fires arrows of piercing cold. Increases STR by 12.', str: 12, value:120 5: text: "Meteor Bow", notes:'Rains flame upon your foes. Increases STR by 16.', str: 16, value:160 6: text: "Golden Bow", notes:'As swift as sunlight and as sharp as lightning. Increases STR by 20.', str: 20, value:200, last: true - mage: + wizard: 0: text: "Apprentice Staff", notes:'Practice staff. Confers no benefit.', value:0 1: text: "Wooden Staff", notes:'Basic implement of carven wood. Increases INT by 3 and PER by 1.', int: 3, per: 1, value:30 2: text: "Jeweled Staff", notes:'Focuses power through a precious stone. Increases INT by 6 and PER by 2.', int: 6, per: 2, value:50 @@ -62,7 +62,7 @@ gear = 3: text: "Camouflage Vest", notes:'Equally discreet in dungeon or wilderness. Increases PER by 12.', per: 12, value:65 4: text: "Penumbral Armor", notes:'Wraps the wearer in a veil of twilight. Increases PER by 15.', per: 15, value:90 5: text: "Umbral Armor", notes:'Allows stealth in the open in broad daylight. Increases PER by 18.', per: 18, value:120, last: true - mage: + wizard: 0: text: "Apprentice Garb", notes:'For students of magic. Confers no benefit.', value:0 1: text: "Magician Robe", notes:'Hedge-mage\'s outfit. Increases INT by 2.', int: 2, value:30 2: text: "Wizard Robe", notes:'Clothes for a wandering wonder-worker. Increases INT by 4.', int: 4, value:45 @@ -95,7 +95,7 @@ gear = 3: text: "Camouflage Hood", notes:'Rugged, but doesn\'t impede hearing. Increases PER by 6.', per: 6, value:40 4: text: "Penumbral Hood", notes:'Grants perfect vision in darkness. Increases PER by 9.', per: 9, value:60 5: text: "Umbral Hood", notes:'Conceals even thoughts from those who would probe them. Increases PER by 12.', per: 12, value:80, last: true - mage: + wizard: 0: text: "No Hat", notes:'No headgear.', value:0 1: text: "Magician Hat", notes:'Simple, comfortable, and fashionable. Increases PER by 2.', per: 2, value:15 2: text: "Cornuthaum", notes:'Traditional headgear of the itinerant wizard. Increases PER by 3.', per: 3, value:25 @@ -123,7 +123,7 @@ gear = 5: text: "Golden Shield", notes:'Shining badge of the vanguard. Increases CON by 9.', con: 9, value:90, last: true rogue: 0: text: "No Shield", notes:'No shield.', value:0, last: true - mage: + wizard: 0: text: "No Shield", notes:'No shield.', def: 0, value:0, last: true healer: 0: text: "No Shield", notes:'No shield.', def: 0, value:0 @@ -188,6 +188,7 @@ items.spells = fireball: text: 'Burst of Flames' mana: 10 + lvl: 6 target: 'task' notes: 'With a crack, flames burst from your staff, scorching a task. You deal much higher damage to the task and gain additional xp.' cast: (user, target) -> @@ -195,6 +196,7 @@ items.spells = lightning: text: 'Lightning Strike' mana: 15 + lvl: 7 target: 'task' notes: 'A bolt a lightning pierces through a task. There is a high chance of a critical hit.' cast: (user, target) -> @@ -202,6 +204,7 @@ items.spells = frost: text: 'Chilling Frost' mana: 35 + lvl: 8 target: 'party' notes: "Ice forms of the party's tasks, slowing them down and opening them up to more attacks. Your party gains a buff to xp.", cast: (user, target) -> @@ -211,6 +214,7 @@ items.spells = darkness: text: 'Shroud of Darkness' mana: 30 + lvl: 9 target: 'party' notes: "Unearthly shadows form and wisp around your party, concealing their presence. Under the shroud, your party can sneak up on tasks, dealing more critical hits.", cast: (user, target) -> @@ -222,6 +226,7 @@ items.spells = smash: text: 'Brutal Smash' mana: 10 + lvl: 6 target: 'task' notes: "You savagely hit a single task with all of your might, beating it into submission. The task's redness decreases." cast: (user, target) -> @@ -229,6 +234,7 @@ items.spells = defensiveStance: text: 'Defensive Stance' mana: 25 + lvl: 7 target: 'self' notes: "You take a moment to relax your body and enter a defensive stance to ready yourself for the tasks' next onslaught. Reduced damage from dailies at the end of the day." cast: (user, target) -> @@ -237,6 +243,7 @@ items.spells = valorousPresence: text: 'Valorous Presence' mana: 20 + lvl: 8 target: 'party' notes: "Your presence emboldens the party. Their newfound courage gives them a boost of strength. Party members gain a buff to their STR." cast: (user, target) -> @@ -246,6 +253,7 @@ items.spells = intimidate: text: 'Intimidating Gaze' mana: 15 + lvl: 9 target: 'party' notes: "Your gaze strikes fear into the hearts of your party's enemies. The party gains a moderate boost to defense." cast: (user, target) -> @@ -257,6 +265,7 @@ items.spells = pickPocket: text: 'Pickpocket' mana: 10 + lvl: 6 target: 'task' notes: "Your nimble fingers run through the task's pockets and 'find' some treasures for yourself. You gain an increased gold bonus on the task and a higher chance of an item drop." cast: (user, target) -> @@ -264,6 +273,7 @@ items.spells = backStab: text: 'Backstab' mana: 15 + lvl: 7 target: 'task' notes: "Without a sound, you sweep behind a task and stab it in the back. You deal higher damage to the stat, with a higher chance of a critical hit." cast: (user, target) -> @@ -272,6 +282,7 @@ items.spells = stealth: text: 'Tools of the Trade' mana: 20 + lvl: 8 target: 'party' notes: "You share your thievery tools with the party to aid them in 'acquiring' more gold. The party's gold bonus for tasks is buffed for a day." cast: (user, target) -> @@ -281,6 +292,7 @@ items.spells = speedburst: text: 'Burst of Speed' mana: 25 + lvl: 9 target: 'party' notes: "You hurry your step and dance circles around your party's enemies. You assist your party, helping them do extra damage to a number of tasks equal to half your strength." cast: (user, target) -> @@ -294,6 +306,7 @@ items.spells = heal: text: 'Healing Light' mana: 15 + lvl: 6 target: 'self' notes: 'Light covers your body, healing your wounds. You gain a boost to your health.' cast: (user, target) -> @@ -301,6 +314,7 @@ items.spells = brightness: text: 'Searing Brightness' mana: 15 + lvl: 7 target: 'self' notes: "You cast a burst of light that blinds all of your tasks. The redness of your tasks is reduced" cast: (user, target) -> @@ -308,6 +322,7 @@ items.spells = protectAura: text: 'Protective Aura' mana: 30 + lvl: 8 target: 'party' notes: "A magical aura surrounds your party members, protecting them from damage. Your party members gain a buff to their defense." cast: (user, target) -> @@ -317,6 +332,7 @@ items.spells = heallAll: text: 'Blessing' mana: 25 + lvl: 9 target: 'party' notes: "Soothing light envelops your party and heals them of their injuries. Your party members gain a boost to their health." cast: (user, target) ->