mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 00:09:41 +00:00
add countPets helper
This commit is contained in:
parent
7c5818c876
commit
ec1681fce4
2 changed files with 21 additions and 2 deletions
15
dist/habitrpg-shared.js
vendored
15
dist/habitrpg-shared.js
vendored
|
|
@ -9991,6 +9991,21 @@ var process=require("__browserify_process");(function() {
|
|||
return i.defense;
|
||||
}
|
||||
},
|
||||
countPets: function(originalCount, pets) {
|
||||
var count;
|
||||
|
||||
count = originalCount || _.size(pets);
|
||||
if (pets["Wolf-Veteran"]) {
|
||||
count--;
|
||||
}
|
||||
if (pets["Wolf-Cerberus"]) {
|
||||
count--;
|
||||
}
|
||||
if (pets["Dragon-Hydra"]) {
|
||||
count--;
|
||||
}
|
||||
return count;
|
||||
},
|
||||
/*
|
||||
----------------------------------------------------------------------
|
||||
Derby-specific helpers. Will remove after the rewrite, need them here for now
|
||||
|
|
|
|||
|
|
@ -307,8 +307,6 @@ module.exports =
|
|||
return false unless messages?.length > 0
|
||||
messages?[0] and (messages[0].id != lastMessageSeen)
|
||||
|
||||
|
||||
|
||||
###
|
||||
are any tags active?
|
||||
###
|
||||
|
|
@ -353,6 +351,12 @@ module.exports =
|
|||
i = items.getItem(type, item)
|
||||
if type is 'weapon' then i.strength else i.defense
|
||||
|
||||
countPets: (originalCount, pets) ->
|
||||
count = originalCount or _.size(pets);
|
||||
count-- if pets["Wolf-Veteran"]
|
||||
count-- if pets["Wolf-Cerberus"]
|
||||
count-- if pets["Dragon-Hydra"]
|
||||
count
|
||||
|
||||
###
|
||||
----------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue