Modify daily checklists to stay checked at cron if inactive and Stealth to only apply to active dailys

This commit is contained in:
Verabird 2015-02-22 21:22:49 -05:00
parent 881f70997b
commit 4a0f165af8
2 changed files with 15 additions and 8 deletions

View file

@ -611,8 +611,8 @@ api.spells =
notes: t('spellRogueStealthNotes')
cast: (user, target) ->
user.stats.buffs.stealth ?= 0
## scales to user's # of dailies; maxes out at 100% at 100 per ##
user.stats.buffs.stealth += Math.ceil(user.dailys.length * user._statsComputed.per / 100)
## scales to user's # of dailies; Diminishing Returns, maxes out at 25%, halfway point at 100 PER##
user.stats.buffs.stealth += Math.ceil( diminishingReturns(user._statsComputed.per, user.dailys.length*0.25,100))
healer:
heal:

View file

@ -1493,28 +1493,35 @@ api.wrap = (user, main=true) ->
{id, type, completed, repeat} = task
return if (type is 'daily') && !completed && user.stats.buffs.stealth && user.stats.buffs.stealth-- # User "evades" a certain number of uncompleted dailies
# return if (type is 'daily') && !completed && user.stats.buffs.stealth && user.stats.buffs.stealth-- # User "evades" a certain number of uncompleted dailies
# Deduct experience for missed Daily tasks, but not for Todos (just increase todo's value)
EvadeTask = 0
scheduleMisses = daysMissed
unless completed
scheduleMisses = daysMissed
# for dailys which have repeat dates, need to calculate how many they've missed according to their own schedule
if (type is 'daily') and repeat
scheduleMisses = 0
_.times daysMissed, (n) ->
thatDay = moment(now).subtract({days: n + 1})
scheduleMisses++ if api.shouldDo(thatDay, repeat, user.preferences)
if scheduleMisses > 0
if api.shouldDo(thatDay, repeat, user.preferences)
scheduleMisses++
if user.stats.buffs.stealth
user.stats.buffs.stealth--
EvadeTask++
if scheduleMisses > EvadeTask
perfect = false if type is 'daily'
delta = user.ops.score({params:{id:task.id, direction:'down'}, query:{times:scheduleMisses, cron:true}});
delta = user.ops.score({params:{id:task.id, direction:'down'}, query:{times:(scheduleMisses-EvadeTask), cron:true}}); # this line occurs for todos or dailys
user.party.quest.progress.down += delta if type is 'daily'
switch type
when 'daily'
# This occurs whether or not the task is completed
(task.history ?= []).push({ date: +new Date, value: task.value })
task.completed = false
_.each task.checklist, ((i)->i.completed=false;true)
if completed || (scheduleMisses > 0)
_.each task.checklist, ((i)->i.completed=false;true) # this should not happen for grey tasks unless they are completed
when 'todo'
#get updated value
absVal = if (completed) then Math.abs(task.value) else task.value