From fdd856c2f8b0ab195288052aea1f3cc6ed58855d Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sat, 4 Jan 2014 17:32:14 -0700 Subject: [PATCH] autoAllocate: small tweak to taskbased to make it more apparent which is kicking --- tests/simulations/autoAllocate.coffee | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/simulations/autoAllocate.coffee b/tests/simulations/autoAllocate.coffee index f722557753..87e15dbf0c 100644 --- a/tests/simulations/autoAllocate.coffee +++ b/tests/simulations/autoAllocate.coffee @@ -31,9 +31,18 @@ user = armor: 'armor_warrior_4' shield: 'shield_warrior_4' head: 'head_warrior_4' - habits: [{value:1,type:'habit'}] - dailys: [] - todos: [] + habits: [ + # we're gonna change this habit's attribute to mess with taskbased allo. Add the others to make sure our _.reduce is legit + {id:'a',value:1,type:'habit',attribute:'str'} + ] + dailys: [ + {id:'b',value:1,type:'daily',attribute:'str'} + ] + todos: [ + {id:'c',value:1,type:'todo',attribute:'con'} + {id:'d',value:1,type:'todo',attribute:'per'} + {id:'e',value:1,type:'todo',attribute:'int'} + ] rewards: [] modes = @@ -65,6 +74,7 @@ _.times [20], (lvl) -> _.each $w('flat classbased_warrior classbased_rogue classbased_wizard classbased_healer taskbased'), (mode) -> u = modes[mode] #local var u.stats.exp = shared.tnl(lvl)+1 # level up + _.merge u.stats, {per:0,con:0,int:0,str:0} if mode is 'taskbased' # if task-based, clear stat so we can see clearly which stat got +1 u.habits[0].attribute = u.fns.randomVal({str:'str',int:'int',per:'per',con:'con'}) u.ops.score {params:{id:u.habits[0].id},direction:'up'} u.fns.updateStats(u.stats) # trigger stats update