2013-12-20 02:38:57 +00:00
|
|
|
###
|
2013-12-20 03:13:52 +00:00
|
|
|
1) clone the repo
|
2013-12-20 02:38:57 +00:00
|
|
|
2) npm install
|
2013-12-20 07:10:46 +00:00
|
|
|
3) coffee ./tests/math_samples.coffee
|
|
|
|
|
|
|
|
|
|
Current results at https://gist.github.com/lefnire/8049676
|
2013-12-20 02:38:57 +00:00
|
|
|
###
|
|
|
|
|
|
2013-12-20 02:35:01 +00:00
|
|
|
shared = require '../script/index.coffee'
|
|
|
|
|
_ = require 'lodash'
|
|
|
|
|
|
|
|
|
|
id = shared.uuid()
|
|
|
|
|
user =
|
|
|
|
|
stats: {class: 'warrior', buffs: {per:0,int:0,con:0,str:0}}
|
|
|
|
|
items:
|
|
|
|
|
eggs: {}
|
|
|
|
|
hatchingPotions: {}
|
|
|
|
|
food: {}
|
|
|
|
|
gear:
|
|
|
|
|
equipped:
|
|
|
|
|
weapon: 'weapon_warrior_4'
|
|
|
|
|
armor: 'armor_warrior_4'
|
|
|
|
|
shield: 'shield_warrior_4'
|
|
|
|
|
head: 'head_warrior_4'
|
|
|
|
|
habits: [
|
2013-12-20 07:10:46 +00:00
|
|
|
shared.taskDefaults({id, value: 0})
|
2013-12-20 02:35:01 +00:00
|
|
|
]
|
|
|
|
|
dailys: []
|
|
|
|
|
todos: []
|
|
|
|
|
rewards: []
|
|
|
|
|
|
|
|
|
|
shared.wrap(user)
|
|
|
|
|
s = user.stats
|
2013-12-20 03:13:52 +00:00
|
|
|
task = user.tasks[id]
|
|
|
|
|
party = [user]
|
2013-12-20 07:10:46 +00:00
|
|
|
taskValue = -10
|
2013-12-20 03:13:52 +00:00
|
|
|
|
|
|
|
|
clearUser = (i=1) ->
|
|
|
|
|
_.merge user.stats, {exp:0, gp:0, hp:50, lvl:i, str:i, con:i, per:i, int:i, mp: 100}
|
|
|
|
|
_.merge s.buffs, {str:0,con:0,int:0,per:0}
|
|
|
|
|
|
2013-12-20 02:35:01 +00:00
|
|
|
_.times 10, (n) ->
|
2013-12-20 03:26:30 +00:00
|
|
|
console.log "lvl\t\texp\t\thp\t\tgp\t\ttask.value"
|
2013-12-20 02:35:01 +00:00
|
|
|
i = n*10 + 1
|
2013-12-20 03:13:52 +00:00
|
|
|
clearUser(i)
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue
|
2013-12-20 02:35:01 +00:00
|
|
|
delta = user.ops.score params:{id, direction:'up'}
|
2013-12-20 03:13:52 +00:00
|
|
|
console.log "#{s.lvl}\t\t#{s.exp}/#{shared.tnl(s.lvl)}\t\t#{s.hp}\t\t#{s.gp.toFixed(2)}\t\t#{task.value.toFixed(2)} (↑ Δ#{delta.toFixed(2)})"
|
2013-12-20 02:35:01 +00:00
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue
|
2013-12-20 02:35:01 +00:00
|
|
|
delta = user.ops.score params:{id, direction:'down'}
|
2013-12-20 03:13:52 +00:00
|
|
|
console.log "#{s.lvl}\t\t#{s.exp}/#{shared.tnl(s.lvl)}\t\t#{s.hp}\t\t#{s.gp.toFixed(2)}\t\t#{task.value.toFixed(2)} (↓ Δ#{delta.toFixed(2)})"
|
|
|
|
|
|
2013-12-20 03:26:30 +00:00
|
|
|
console.log '[Wizard]'
|
2013-12-20 03:13:52 +00:00
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.wizard.fireball.cast(user,task)
|
|
|
|
|
console.log "fireball: task.value=#{task.value} hp=#{s.exp}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.wizard.mpheal.cast(user,party)
|
|
|
|
|
console.log "mpheal: mp=#{s.mp} (from 100)"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.wizard.earth.cast(user,party)
|
|
|
|
|
console.log "earth: buffs.int=#{s.buffs.int}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.wizard.frost.cast(user,{})
|
|
|
|
|
console.log "frost: -"
|
|
|
|
|
|
2013-12-20 03:26:30 +00:00
|
|
|
console.log '[Warrior]'
|
2013-12-20 03:13:52 +00:00
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.warrior.smash.cast(user,task)
|
|
|
|
|
console.log "smash: task.value=#{task.value}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.warrior.defensiveStance.cast(user,{})
|
|
|
|
|
console.log "defensiveStance: buffs.con=#{s.buffs.con}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.warrior.valorousPresence.cast(user,party)
|
|
|
|
|
console.log "valorousPresence: buffs.str=#{s.buffs.str}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.warrior.intimidate.cast(user,party)
|
|
|
|
|
console.log "intimidate: buffs.con=#{s.buffs.con}"
|
|
|
|
|
|
2013-12-20 03:26:30 +00:00
|
|
|
console.log '[Rogue]'
|
2013-12-20 03:13:52 +00:00
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.rogue.pickPocket.cast(user,task)
|
|
|
|
|
console.log "pickPocket: gp=#{s.gp}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:26:30 +00:00
|
|
|
shared.content.spells.rogue.backStab.cast(user,task)
|
2013-12-20 03:13:52 +00:00
|
|
|
console.log "backStab: task.value=#{task.value} exp=#{s.exp} gp=#{s.gp}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.rogue.toolsOfTrade.cast(user,party)
|
|
|
|
|
console.log "toolsOfTrade: buffs.per=#{s.buffs.per}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.rogue.stealth.cast(user,{})
|
2013-12-20 03:34:29 +00:00
|
|
|
console.log "stealth: avoiding #{user.stats.buffs.stealth} tasks"
|
2013-12-20 03:13:52 +00:00
|
|
|
|
2013-12-20 03:26:30 +00:00
|
|
|
console.log '[Healer]'
|
2013-12-20 03:13:52 +00:00
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
s.hp=0
|
|
|
|
|
shared.content.spells.healer.heal.cast(user,{})
|
|
|
|
|
console.log "heal: hp=#{s.hp}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.healer.brightness.cast(user,{})
|
|
|
|
|
console.log "brightness: task.value=#{task.value}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
shared.content.spells.healer.protectAura.cast(user,party)
|
|
|
|
|
console.log "protectAura: buffs.con=#{s.buffs.con}"
|
|
|
|
|
|
2013-12-20 07:10:46 +00:00
|
|
|
task.value = taskValue;clearUser(i)
|
2013-12-20 03:13:52 +00:00
|
|
|
s.hp=0
|
|
|
|
|
shared.content.spells.healer.heallAll.cast(user,party)
|
|
|
|
|
console.log "heallAll: hp=#{s.hp}"
|
|
|
|
|
|
|
|
|
|
|
2013-12-20 02:35:01 +00:00
|
|
|
console.log '------------------------------------------------------------'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|