mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
Static rewards now in list
This commit is contained in:
parent
74513509bb
commit
73dffc8ffb
2 changed files with 31 additions and 6 deletions
|
|
@ -114,10 +114,26 @@ module.exports = {
|
|||
}
|
||||
]
|
||||
|
||||
staticRewards: [
|
||||
{ text: "Re-Roll", notes: "Reset your task values to 0. Do this only if you're floundering.", value: 100, icon:"icon-retweet" }
|
||||
{ text: "Re-Roll", notes: "Reset your task values to 0. Do this only if you're floundering.", value: 100 }
|
||||
]
|
||||
staticRewardIds: [0] #stupid, but necessary for refList
|
||||
staticRewards: {
|
||||
weapon: [
|
||||
{text: "Hands", notes:'', value:0}
|
||||
{text: "Sword", notes:'', value:100}
|
||||
{text: "Mace", notes:'', value:200}
|
||||
]
|
||||
armor: [
|
||||
{text: "Cloth Armor", notes:'', value:0}
|
||||
{text: "Leather Armor", notes:'', value:100}
|
||||
{text: "Chain Mail", notes:'', value:200}
|
||||
]
|
||||
potion:
|
||||
text: "Potion"
|
||||
notes: "Recover 15 HP"
|
||||
value: 100
|
||||
icon:"icon-retweet"
|
||||
reroll:
|
||||
text: "Re-Roll"
|
||||
notes: "Reset your task values to 0. Do this only if you're floundering."
|
||||
icon: "icon-retweet"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,13 +30,22 @@ getRoom = (page, model, userId) ->
|
|||
model.refList "_dailyList", "_user.tasks", "_user.dailyIds"
|
||||
model.refList "_todoList", "_user.tasks", "_user.todoIds"
|
||||
model.refList "_rewardList", "_user.tasks", "_user.rewardIds"
|
||||
model.set '_staticRewards', content.staticRewards
|
||||
unless model.get('_user.tasks')
|
||||
model.push '_habitList', task for task in content.defaultTasks.habits
|
||||
model.push '_dailyList', task for task in content.defaultTasks.dailys
|
||||
model.push '_todoList', task for task in content.defaultTasks.todos
|
||||
model.push '_rewardList', task for task in content.defaultTasks.rewards
|
||||
|
||||
#static rewards
|
||||
model.setNull('_user.inventory', {armor:0, weapon:0})
|
||||
sr = [
|
||||
content.staticRewards.armor[user.get('inventory.armor')+1]
|
||||
content.staticRewards.weapon[user.get('inventory.weapon')+1]
|
||||
content.staticRewards.potion
|
||||
content.staticRewards.reroll
|
||||
]
|
||||
model.set '_staticRewards', sr
|
||||
|
||||
# http://tibia.wikia.com/wiki/Formula
|
||||
model.fn '_tnl', '_user.lvl', (lvl) -> 50 * Math.pow(lvl, 2) - 150 * lvl + 200
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue