mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 20:58:51 +00:00
feat(accessories): add head accessory
This commit is contained in:
parent
7b8e0dc0a4
commit
74f62e7c1c
2 changed files with 8 additions and 5 deletions
|
|
@ -10,11 +10,12 @@ moment = require 'moment'
|
|||
###
|
||||
|
||||
classes = ['warrior', 'rogue', 'healer', 'wizard']
|
||||
gearTypes = ['armor', 'weapon', 'shield', 'head', 'back']
|
||||
gearTypes = ['armor', 'weapon', 'shield', 'head', 'back', 'headAccessory']
|
||||
|
||||
events =
|
||||
winter: {start:'2013-12-31',end:'2014-02-01'}
|
||||
birthday: {start:'2013-01-30',end:'2014-02-01'}
|
||||
spring: {start:'2014-03-21',end:'2014-05-01'}
|
||||
|
||||
mystery =
|
||||
201402: {start:'2014-02-22',end:'2014-02-28'}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ preenHistory = (history) ->
|
|||
api.updateStore = (user) ->
|
||||
return unless user
|
||||
changes = []
|
||||
_.each ['weapon', 'armor', 'shield', 'head', 'back'], (type) ->
|
||||
_.each ['weapon', 'armor', 'shield', 'head', 'back', 'headAccessory'], (type) ->
|
||||
found = _.find content.gear.tree[type][user.stats.class], (item) ->
|
||||
!user.items.gear.owned[item.key]
|
||||
changes.push(found) if found
|
||||
|
|
@ -139,8 +139,9 @@ api.updateStore = (user) ->
|
|||
when 'head' then 3
|
||||
when 'shield' then 4
|
||||
when 'back' then 5
|
||||
when 'potion' then 6
|
||||
else 7
|
||||
when 'headAccessory' then 6
|
||||
when 'potion' then 7
|
||||
else 8
|
||||
|
||||
###
|
||||
------------------------------------------------------
|
||||
|
|
@ -1291,7 +1292,8 @@ api.wrap = (user, main=true) ->
|
|||
lastGearClassTypeMatrix = {}
|
||||
_.each content.classes, (klass) ->
|
||||
lastGearClassTypeMatrix[klass] = {}
|
||||
_.each content.gearTypes, (type) ->
|
||||
#_.each content.gearTypes, (type) ->
|
||||
_.each ['armor', 'weapon', 'shield', 'head'], (type) ->
|
||||
lastGearClassTypeMatrix[klass][type] = false
|
||||
return true # false exits the each loop early
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue