Move all pet counting to shared count scripts

This commit is contained in:
Blade Barringer
2015-07-22 17:32:12 -05:00
parent 063e53b0ea
commit f40cfd2b66
5 changed files with 16 additions and 35 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
require('coffee-script');
var _ = require('lodash');
var content = require('./content');
var content = require('./content.coffee');
var DROP_ANIMALS = _.keys(content.pets);
+5 -25
View File
@@ -378,35 +378,15 @@ api.appliedTags = (userTags, taskTags) ->
arr.push(t.name) if taskTags?[t.id]
arr.join(', ')
DROP_ANIMALS = _.keys(content.pets)
api.countBeastMasterProgress = (pets) ->
count = 0
for animal in DROP_ANIMALS
if pets[animal] > 0 || pets[animal] == -1
count++
count
api.countMountMasterProgress = (mounts) ->
count = 0
for animal in DROP_ANIMALS
if mounts[animal]
count++
count
api.countTriad = (pets) ->
count3 = 0
for egg of content.dropEggs
for potion of content.hatchingPotions
if pets[egg + "-" + potion] > 0 then count3++
count3
api.countArmoire = (gear) ->
count = _.size(_.filter(content.gear.flat, ((i)->i.klass is 'armoire' and !gear[i.key])))
count
###
Various counting functions
###
api.count = require('./count')
###
------------------------------------------------------
User (prototype wrapper to give it ops, helper funcs, and virtuals