fix(world-boss): simplify desperation stats

This commit is contained in:
Sabe Jones 2015-01-19 23:00:00 -06:00
parent 0137dd7209
commit da2d59734c

View file

@ -264,13 +264,8 @@ GroupSchema.statics.tavernBoss = function(user,progress) {
// Deal damage. Note a couple things here, str & def are calculated. If str/def are defined in the database,
// use those first - which allows us to update the boss on the go if things are too easy/hard.
if (!tavern.quest.extra) tavern.quest.extra = {};
if (tavern.quest.progress.hp < quest.boss.desperation.threshold) {
tavern.quest.progress.hp -= dmg / (quest.boss.desperation.def);
tavern.quest.progress.rage -= rage * (quest.boss.desperation.str);
} else {
tavern.quest.progress.hp -= dmg / (tavern.quest.extra.def || quest.boss.def);
tavern.quest.progress.rage -= rage * (tavern.quest.extra.str || quest.boss.str);
}
tavern.quest.progress.hp -= dmg / (tavern.quest.extra.def || quest.boss.def);
tavern.quest.progress.rage -= rage * (tavern.quest.extra.str || quest.boss.str);
if (tavern.quest.progress.rage >= quest.boss.rage.value) {
if (!tavern.quest.extra.worldDmg) tavern.quest.extra.worldDmg = {};
var wd = tavern.quest.extra.worldDmg;
@ -291,7 +286,9 @@ GroupSchema.statics.tavernBoss = function(user,progress) {
if ((tavern.quest.progress.hp < quest.boss.desperation.threshold) && !tavern.quest.extra.desperate) {
tavern.sendChat(quest.boss.desperation.text('en'));
tavern.quest.extra.desperate = true;
tavern.markModified('quest.extra.desperate');
tavern.quest.extra.def = quest.boss.desperation.def;
tavern.quest.extra.str = quest.boss.desperation.str;
tavern.markModified('quest.extra');
}
tavern.save(cb);
}