Move all pet counting to shared count scripts
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user