2017-09-24 22:23:22 +00:00
|
|
|
module TK.SpaceTac {
|
2017-04-18 22:55:59 +00:00
|
|
|
describe("AttributeEffect", function () {
|
|
|
|
it("is not applied directly", function () {
|
|
|
|
let ship = new Ship();
|
2017-06-11 20:44:12 +00:00
|
|
|
expect(ship.getAttribute("maneuvrability")).toBe(0);
|
2017-04-18 22:55:59 +00:00
|
|
|
|
2017-06-11 20:44:12 +00:00
|
|
|
let effect = new AttributeEffect("maneuvrability", 20);
|
2017-05-28 22:16:50 +00:00
|
|
|
effect.applyOnShip(ship, ship);
|
2017-06-11 20:44:12 +00:00
|
|
|
expect(ship.getAttribute("maneuvrability")).toBe(0);
|
2017-04-18 22:55:59 +00:00
|
|
|
|
|
|
|
ship.sticky_effects.push(new StickyEffect(effect, 2));
|
|
|
|
ship.updateAttributes();
|
2017-06-11 20:44:12 +00:00
|
|
|
expect(ship.getAttribute("maneuvrability")).toBe(20);
|
2017-04-18 22:55:59 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("has a description", function () {
|
2017-06-11 20:44:12 +00:00
|
|
|
let effect = new AttributeEffect("maneuvrability", 12);
|
|
|
|
expect(effect.getDescription()).toEqual("maneuvrability +12");
|
2017-04-18 22:55:59 +00:00
|
|
|
|
|
|
|
effect = new AttributeEffect("shield_capacity", -4);
|
|
|
|
expect(effect.getDescription()).toEqual("shield capacity -4");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|