1
0
Fork 0

Rebalanced power depleter (as its effect lasts on turn end)

This commit is contained in:
Michaël Lemaire 2017-12-04 22:48:18 +01:00
parent d5b3b79a29
commit 0c429bd305
3 changed files with 5 additions and 8 deletions

View file

@ -6,28 +6,28 @@ module TK.SpaceTac.Specs {
let equipment = template.generate(1);
check.equals(equipment.requirements, { "skill_antimatter": 1 });
compare_trigger_action(check, equipment.action, new TriggerAction(equipment, [
new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 2)
new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 1)
], 4, 460, 0));
check.equals(equipment.price, 100);
equipment = template.generate(2);
check.equals(equipment.requirements, { "skill_antimatter": 2 });
compare_trigger_action(check, equipment.action, new TriggerAction(equipment, [
new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 2)
new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 1)
], 4, 490, 0));
check.equals(equipment.price, 350);
equipment = template.generate(3);
check.equals(equipment.requirements, { "skill_antimatter": 4 });
compare_trigger_action(check, equipment.action, new TriggerAction(equipment, [
new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 2)
new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 1)
], 4, 526, 0));
check.equals(equipment.price, 850);
equipment = template.generate(10);
check.equals(equipment.requirements, { "skill_antimatter": 25 });
compare_trigger_action(check, equipment.action, new TriggerAction(equipment, [
new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 2)
new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 1)
], 4, 946, 0));
check.equals(equipment.price, 11350);
});

View file

@ -8,7 +8,7 @@ module TK.SpaceTac.Equipments {
this.setSkillsRequirements({ "skill_antimatter": leveled(1, 1.5) });
this.setCooldown(irepeat(2), irepeat(3));
this.addTriggerAction(irepeat(4), [
new StickyEffectTemplate(new AttributeLimitEffect("power_capacity"), { "value": irepeat(3) }, irepeat(2))
new StickyEffectTemplate(new AttributeLimitEffect("power_capacity"), { "value": irepeat(3) }, irepeat(1))
], leveled(460, 30));
}
}

View file

@ -187,7 +187,6 @@ module TK.SpaceTac.UI {
if (foregrounds.length > 0) {
if (this.background_promises.length > 0) {
console.log("wait", this.background_promises);
await Promise.all(this.background_promises);
this.background_promises = [];
}
@ -196,10 +195,8 @@ module TK.SpaceTac.UI {
await Promise.all(promises);
}
console.log("start backgrounds");
let promises = backgrounds.map(background => background(timed, timed ? this.view.timer : new Timer(true)));
this.background_promises = this.background_promises.concat(promises);
console.log("added", diff, this.background_promises);
}
/**