diff --git a/README.md b/README.md index 52584fa..bebf34f 100644 --- a/README.md +++ b/README.md @@ -98,34 +98,34 @@ For battle purpose, the ship is to be considered "dead". ### Attributes -Attributes represent a ship's ability to use its HSP system: +Attributes represent a ship's ability to use its HSP system and weapons: -* **Initiative** - Ability to play before other ships in the play order * **Hull capacity** - Maximal Hull value (when the battle starts) * **Shield capacity** - Maximal Shield value (when the battle starts) * **Power capacity** - Maximal Power value -* **Initial power** - Power immediately available at the start of battle -* **Power recovery** - Power generated at the end of a ship's turn +* **Power generation** - Power generated at the end of a ship's turn +* **Maneuverability** - Ability to move first and fast +* **Precision** - Ability to target far and good These attributes are the sum of all currently applied effects (being permanent by an equipped item, or a temporary effect caused by a weapon or a drone). -For example, a ship that equips a power generator with "power recovery +3", but has a sticky effect -of "power recovery -1" from a previous weapon hit, will have an effective power recovery of 2. +For example, a ship that equips a power generator with "power generation +3", but has a sticky effect +of "power generation -1" from a previous weapon hit, will have an effective power generation of 2. ### Skills Skills represent a ship's ability to use equipments: * **Materials** - Usage of physical materials such as bullets, shells... -* **Electronics** - Components of computers and communication -* **Energy** - Raw energy manipulation -* **Human** - Management of a human team and resources +* **Photons** - Forces of light, and electromagnetic radiation +* **Antimatter** - Manipulation of matter and antimatter particles +* **Quantum** - Application of quantum uncertainty principle * **Gravity** - Interaction with gravitational forces -* **Time** - Manipulation of time +* **Time** - Control of relativity's time properties Each equipment has minimal skill requirements to be used. For example, a weapon may require "materials >= 2" -and "energy >= 3" to be equipped. A ship that does not meet these requirements will not be able to use +and "photons >= 3" to be equipped. A ship that does not meet these requirements will not be able to use the equipment. Skills are defined by the player, using points given while leveling up. diff --git a/graphics/ui/character.svg b/graphics/ui/character.svg index b3d43f3..439625a 100644 --- a/graphics/ui/character.svg +++ b/graphics/ui/character.svg @@ -19,7 +19,7 @@ inkscape:version="0.92.1 r15371" sodipodi:docname="character.svg" enable-background="new" - inkscape:export-filename="/home/michael/workspace/perso/spacetac/out/assets/images/character/close.png" + inkscape:export-filename="/tmp/sheet.png" inkscape:export-xdpi="96" inkscape:export-ydpi="96"> + inkscape:measure-start="519.581,357.616" + inkscape:measure-end="665.158,357.616"> image/svg+xml - + @@ -1188,17 +1188,6 @@ height="10.620193" x="191.35637" y="195.53967" /> - 35 - 2 - - 0 - - - + - - Initiative - Hull capacity - Shield capacity - Power capacity - Initial power - Power recovery - Materials - Electronics - Energy - Human - Gravity - Time | SKILLS | + + + + + + + + Initiative + Hull capacity + Shield capacity + Power capacity + Initial power + Power recovery + Materials + Electronics + Energy + Human + Gravity + Time + 35 + 0 + 2 + + ship.setAttribute("initiative", 1)); + iforeach(battle.iships(), ship => ship.setAttribute("maneuvrability", 1)); var gen = new SkewedRandomGenerator([0.1, 0.2, 0.0]); battle.throwInitiative(gen); diff --git a/src/core/BattleOutcome.spec.ts b/src/core/BattleOutcome.spec.ts index 0e9e198..5356e6e 100644 --- a/src/core/BattleOutcome.spec.ts +++ b/src/core/BattleOutcome.spec.ts @@ -37,7 +37,7 @@ module TS.SpaceTac.Specs { // Force lucky finds with one template var looter = new LootGenerator(random, false); var template = new LootTemplate(SlotType.Power, "Nuclear Reactor"); - template.setSkillsRequirements({ "skill_energy": istep(4) }); + template.setSkillsRequirements({ "skill_photons": istep(4) }); template.addAttributeEffect("power_capacity", 1); looter.templates = [template]; spyOn(outcome, "getLootGenerator").and.returnValue(looter); @@ -49,11 +49,11 @@ module TS.SpaceTac.Specs { expect(outcome.loot[1].name).toBe("Nuclear Reactor"); expect(outcome.loot[1].level).toBe(4); expect(outcome.loot[1].quality).toBe(EquipmentQuality.COMMON); - expect(outcome.loot[1].requirements).toEqual({ "skill_energy": 7 }); + expect(outcome.loot[1].requirements).toEqual({ "skill_photons": 7 }); expect(outcome.loot[2].name).toBe("Nuclear Reactor"); expect(outcome.loot[2].level).toBe(6); expect(outcome.loot[2].quality).toBe(EquipmentQuality.PREMIUM); - expect(outcome.loot[2].requirements).toEqual({ "skill_energy": 9 }); + expect(outcome.loot[2].requirements).toEqual({ "skill_photons": 9 }); }); it("grants experience", function () { diff --git a/src/core/Drone.spec.ts b/src/core/Drone.spec.ts index 2230360..6e80895 100644 --- a/src/core/Drone.spec.ts +++ b/src/core/Drone.spec.ts @@ -94,9 +94,9 @@ module TS.SpaceTac { drone.duration = 3; drone.effects = [ new DamageEffect(5), - new AttributeEffect("skill_human", 1) + new AttributeEffect("skill_quantum", 1) ] - expect(drone.getDescription()).toEqual("For 3 activations:\n• do 5 damage\n• human skill +1"); + expect(drone.getDescription()).toEqual("For 3 activations:\n• do 5 damage\n• quantum skill +1"); }); }); } diff --git a/src/core/Equipment.spec.ts b/src/core/Equipment.spec.ts index 0a6807a..49e16c3 100644 --- a/src/core/Equipment.spec.ts +++ b/src/core/Equipment.spec.ts @@ -34,11 +34,11 @@ module TS.SpaceTac.Specs { expect(equipment.canBeEquipped(ship.attributes)).toBe(true); // Second requirement - equipment.requirements["skill_material"] = 3; + equipment.requirements["skill_materials"] = 3; expect(equipment.canBeEquipped(ship.attributes)).toBe(false); - ship.attributes.skill_material.set(4); + ship.attributes.skill_materials.set(4); expect(equipment.canBeEquipped(ship.attributes)).toBe(true); }); @@ -65,7 +65,7 @@ module TS.SpaceTac.Specs { let equipment = new Equipment(); expect(equipment.getMinimumLevel()).toBe(1); - equipment.requirements["skill_human"] = 10; + equipment.requirements["skill_quantum"] = 10; expect(equipment.getMinimumLevel()).toBe(1); equipment.requirements["skill_time"] = 1; @@ -74,7 +74,7 @@ module TS.SpaceTac.Specs { equipment.requirements["skill_gravity"] = 2; expect(equipment.getMinimumLevel()).toBe(2); - equipment.requirements["skill_electronics"] = 4; + equipment.requirements["skill_antimatter"] = 4; expect(equipment.getMinimumLevel()).toBe(3); }); diff --git a/src/core/LootTemplate.spec.ts b/src/core/LootTemplate.spec.ts index 5de1ec4..8de0f02 100644 --- a/src/core/LootTemplate.spec.ts +++ b/src/core/LootTemplate.spec.ts @@ -33,23 +33,23 @@ module TS.SpaceTac.Specs { it("applies requirements on skills", function () { let template = new LootTemplate(SlotType.Hull, "Hull"); - template.setSkillsRequirements({ "skill_energy": 1, "skill_gravity": istep(2, istep(1)) }); + template.setSkillsRequirements({ "skill_photons": 1, "skill_gravity": istep(2, istep(1)) }); let result = template.generate(1); expect(result.requirements).toEqual({ - "skill_energy": 1, + "skill_photons": 1, "skill_gravity": 2 }); result = template.generate(2); expect(result.requirements).toEqual({ - "skill_energy": 2, + "skill_photons": 2, "skill_gravity": 3 }); result = template.generate(10); expect(result.requirements).toEqual({ - "skill_energy": 10, + "skill_photons": 10, "skill_gravity": 47 }); }); @@ -123,7 +123,7 @@ module TS.SpaceTac.Specs { let template = new LootTemplate(SlotType.Weapon, "Weapon"); expect(template.hasDamageEffect()).toBe(false); - template.addAttributeEffect("initiative", 1); + template.addAttributeEffect("maneuvrability", 1); expect(template.hasDamageEffect()).toBe(false); template.addFireAction(1, 50, 50, [new EffectTemplate(new BaseEffect("test"), {})]); diff --git a/src/core/Ship.spec.ts b/src/core/Ship.spec.ts index a98f422..5c7a010 100644 --- a/src/core/Ship.spec.ts +++ b/src/core/Ship.spec.ts @@ -291,14 +291,13 @@ module TS.SpaceTac.Specs { let power_generator = new Equipment(SlotType.Power); power_generator.effects = [ new AttributeEffect("power_capacity", 8), - new AttributeEffect("power_recovery", 3), - new AttributeEffect("power_initial", 4) + new AttributeEffect("power_generation", 3), ] ship.addSlot(SlotType.Power).attach(power_generator); expect(ship.values.power.get()).toBe(0); ship.initializeActionPoints(); - expect(ship.values.power.get()).toBe(4); + expect(ship.values.power.get()).toBe(8); ship.values.power.set(3); expect(ship.values.power.get()).toBe(3); ship.recoverActionPoints(); @@ -424,13 +423,13 @@ module TS.SpaceTac.Specs { let slot = ship.addSlot(SlotType.Hull); expect(ship.canEquip(equipment)).toBe(slot); - equipment.requirements["skill_energy"] = 2; + equipment.requirements["skill_photons"] = 2; expect(ship.canEquip(equipment)).toBe(null); - ship.upgradeSkill("skill_energy"); + ship.upgradeSkill("skill_photons"); expect(ship.canEquip(equipment)).toBe(null); - ship.upgradeSkill("skill_energy"); + ship.upgradeSkill("skill_photons"); expect(ship.canEquip(equipment)).toBe(slot); slot.attach(new Equipment(SlotType.Hull)); @@ -446,17 +445,17 @@ module TS.SpaceTac.Specs { expect(ship.level.get()).toBe(2); expect(ship.getAvailableUpgradePoints()).toBe(15); - expect(ship.getAttribute("skill_energy")).toBe(0); - ship.upgradeSkill("skill_energy"); - expect(ship.getAttribute("skill_energy")).toBe(1); + expect(ship.getAttribute("skill_photons")).toBe(0); + ship.upgradeSkill("skill_photons"); + expect(ship.getAttribute("skill_photons")).toBe(1); range(50).forEach(() => ship.upgradeSkill("skill_gravity")); - expect(ship.getAttribute("skill_energy")).toBe(1); + expect(ship.getAttribute("skill_photons")).toBe(1); expect(ship.getAttribute("skill_gravity")).toBe(14); expect(ship.getAvailableUpgradePoints()).toBe(0); ship.updateAttributes(); - expect(ship.getAttribute("skill_energy")).toBe(1); + expect(ship.getAttribute("skill_photons")).toBe(1); expect(ship.getAttribute("skill_gravity")).toBe(14); }); diff --git a/src/core/Ship.ts b/src/core/Ship.ts index 641b599..552027c 100644 --- a/src/core/Ship.ts +++ b/src/core/Ship.ts @@ -8,30 +8,30 @@ module TS.SpaceTac { */ export class ShipSkills { // Skills - skill_material = new ShipAttribute("material skill") - skill_energy = new ShipAttribute("energy skill") - skill_electronics = new ShipAttribute("electronics skill") - skill_human = new ShipAttribute("human skill") - skill_time = new ShipAttribute("time skill") + skill_materials = new ShipAttribute("materials skill") + skill_photons = new ShipAttribute("photons skill") + skill_antimatter = new ShipAttribute("antimatter skill") + skill_quantum = new ShipAttribute("quantum skill") skill_gravity = new ShipAttribute("gravity skill") + skill_time = new ShipAttribute("time skill") } /** * Set of ShipAttribute for a ship */ export class ShipAttributes extends ShipSkills { - // Attribute controlling the play order - initiative = new ShipAttribute("initiative") // Maximal hull value hull_capacity = new ShipAttribute("hull capacity") // Maximal shield value shield_capacity = new ShipAttribute("shield capacity") // Maximal power value power_capacity = new ShipAttribute("power capacity") - // Initial power value at the start of a battle - power_initial = new ShipAttribute("initial power") // Power value recovered each turn - power_recovery = new ShipAttribute("power recovery") + power_generation = new ShipAttribute("power generation") + // Ability to move first and fast + maneuvrability = new ShipAttribute("maneuvrability") + // Ability to fire far and good + precision = new ShipAttribute("precision") } /** @@ -153,7 +153,7 @@ module TS.SpaceTac { // Make an initiative throw, to resolve play order in a battle throwInitiative(gen: RandomGenerator): void { - this.play_priority = gen.random() * this.attributes.initiative.get(); + this.play_priority = gen.random() * this.attributes.maneuvrability.get(); } // Return the player owning this ship @@ -289,7 +289,7 @@ module TS.SpaceTac { // If no value is provided, the attribute ap_initial will be used initializeActionPoints(value: number | null = null): void { if (value === null) { - value = this.attributes.power_initial.get(); + value = this.attributes.power_capacity.get(); } this.setValue("power", value); } @@ -300,7 +300,7 @@ module TS.SpaceTac { recoverActionPoints(value: number | null = null): void { if (this.alive) { if (value === null) { - value = this.attributes.power_recovery.get(); + value = this.attributes.power_generation.get(); } this.setValue("power", value, true); } diff --git a/src/core/ShipGenerator.spec.ts b/src/core/ShipGenerator.spec.ts index 535a54e..c5e2b8c 100644 --- a/src/core/ShipGenerator.spec.ts +++ b/src/core/ShipGenerator.spec.ts @@ -14,7 +14,7 @@ module TS.SpaceTac.Specs { expect(ship.slots[4].type).toBe(SlotType.Weapon); expect(ship.slots[5].type).toBe(SlotType.Weapon); expect(ship.slots[6].type).toBe(SlotType.Weapon); - expect(ship.getAttribute("skill_material")).toBe(1); + expect(ship.getAttribute("skill_materials")).toBe(1); }); }); } diff --git a/src/core/TestTools.spec.ts b/src/core/TestTools.spec.ts index 30a4ef3..dedb41f 100644 --- a/src/core/TestTools.spec.ts +++ b/src/core/TestTools.spec.ts @@ -4,15 +4,13 @@ module TS.SpaceTac.Specs { let ship = new Ship(); expect(ship.getAttribute("power_capacity")).toBe(0); - expect(ship.getAttribute("power_initial")).toBe(0); - expect(ship.getAttribute("power_recovery")).toBe(0); + expect(ship.getAttribute("power_generation")).toBe(0); expect(ship.getValue("power")).toBe(0); TestTools.setShipAP(ship, 12, 4); expect(ship.getAttribute("power_capacity")).toBe(12); - expect(ship.getAttribute("power_initial")).toBe(12); - expect(ship.getAttribute("power_recovery")).toBe(4); + expect(ship.getAttribute("power_generation")).toBe(4); expect(ship.getValue("power")).toBe(12); }); diff --git a/src/core/TestTools.ts b/src/core/TestTools.ts index ce37f7b..922e376 100644 --- a/src/core/TestTools.ts +++ b/src/core/TestTools.ts @@ -59,10 +59,8 @@ module TS.SpaceTac { if (effect instanceof AttributeEffect) { if (effect.attrcode === "power_capacity") { effect.value = points; - } else if (effect.attrcode === "power_recovery") { + } else if (effect.attrcode === "power_generation") { effect.value = recovery; - } else if (effect.attrcode === "power_initial") { - effect.value = points; } } }); diff --git a/src/core/ai/Maneuver.spec.ts b/src/core/ai/Maneuver.spec.ts index 478e058..189b958 100644 --- a/src/core/ai/Maneuver.spec.ts +++ b/src/core/ai/Maneuver.spec.ts @@ -44,7 +44,7 @@ module TS.SpaceTac.Specs { let ship = battle.fleets[0].addShip(); TestTools.addEngine(ship, 500); let drone = new Drone(ship); - drone.effects = [new AttributeEffect("initiative", 1)]; + drone.effects = [new AttributeEffect("maneuvrability", 1)]; drone.x = 100; drone.y = 0; drone.radius = 50; @@ -56,7 +56,7 @@ module TS.SpaceTac.Specs { maneuver = new Maneuver(ship, new MoveAction(new Equipment()), Target.newFromLocation(100, 30)); expect(maneuver.getFinalLocation()).toEqual(jasmine.objectContaining({ x: 100, y: 30 })); - expect(maneuver.effects).toEqual([[ship, new AttributeEffect("initiative", 1)]]); + expect(maneuver.effects).toEqual([[ship, new AttributeEffect("maneuvrability", 1)]]); }); }); } diff --git a/src/core/ai/TacticalAIHelpers.ts b/src/core/ai/TacticalAIHelpers.ts index 55e913a..7308e2d 100644 --- a/src/core/ai/TacticalAIHelpers.ts +++ b/src/core/ai/TacticalAIHelpers.ts @@ -144,7 +144,7 @@ module TS.SpaceTac { * Evaluate doing nothing, between -1 and 1 */ static evaluateIdling(ship: Ship, battle: Battle, maneuver: Maneuver): number { - let lost = ship.getValue("power") - maneuver.getPowerUsage() + ship.getAttribute("power_recovery") - ship.getAttribute("power_capacity"); + let lost = ship.getValue("power") - maneuver.getPowerUsage() + ship.getAttribute("power_generation") - ship.getAttribute("power_capacity"); if (lost > 0) { return -lost / ship.getAttribute("power_capacity"); } else if (maneuver.action instanceof FireWeaponAction || maneuver.action instanceof DeployDroneAction) { diff --git a/src/core/effects/AttributeEffect.spec.ts b/src/core/effects/AttributeEffect.spec.ts index 2c91e19..8eea909 100644 --- a/src/core/effects/AttributeEffect.spec.ts +++ b/src/core/effects/AttributeEffect.spec.ts @@ -2,20 +2,20 @@ module TS.SpaceTac { describe("AttributeEffect", function () { it("is not applied directly", function () { let ship = new Ship(); - expect(ship.getAttribute("initiative")).toBe(0); + expect(ship.getAttribute("maneuvrability")).toBe(0); - let effect = new AttributeEffect("initiative", 20); + let effect = new AttributeEffect("maneuvrability", 20); effect.applyOnShip(ship, ship); - expect(ship.getAttribute("initiative")).toBe(0); + expect(ship.getAttribute("maneuvrability")).toBe(0); ship.sticky_effects.push(new StickyEffect(effect, 2)); ship.updateAttributes(); - expect(ship.getAttribute("initiative")).toBe(20); + expect(ship.getAttribute("maneuvrability")).toBe(20); }); it("has a description", function () { - let effect = new AttributeEffect("initiative", 12); - expect(effect.getDescription()).toEqual("initiative +12"); + let effect = new AttributeEffect("maneuvrability", 12); + expect(effect.getDescription()).toEqual("maneuvrability +12"); effect = new AttributeEffect("shield_capacity", -4); expect(effect.getDescription()).toEqual("shield capacity -4"); diff --git a/src/core/equipments/ForceField.spec.ts b/src/core/equipments/ForceField.spec.ts index bfc8864..a6eaac0 100644 --- a/src/core/equipments/ForceField.spec.ts +++ b/src/core/equipments/ForceField.spec.ts @@ -4,19 +4,19 @@ module TS.SpaceTac.Equipments { let template = new ForceField(); let equipment = template.generate(1); - expect(equipment.requirements).toEqual({ "skill_energy": 1 }); + expect(equipment.requirements).toEqual({ "skill_photons": 1 }); expect(equipment.effects).toEqual([new AttributeEffect("shield_capacity", 100)]); equipment = template.generate(2); - expect(equipment.requirements).toEqual({ "skill_energy": 3 }); + expect(equipment.requirements).toEqual({ "skill_photons": 3 }); expect(equipment.effects).toEqual([new AttributeEffect("shield_capacity", 140)]); equipment = template.generate(3); - expect(equipment.requirements).toEqual({ "skill_energy": 5 }); + expect(equipment.requirements).toEqual({ "skill_photons": 5 }); expect(equipment.effects).toEqual([new AttributeEffect("shield_capacity", 180)]); equipment = template.generate(10); - expect(equipment.requirements).toEqual({ "skill_energy": 19 }); + expect(equipment.requirements).toEqual({ "skill_photons": 19 }); expect(equipment.effects).toEqual([new AttributeEffect("shield_capacity", 460)]); }); }); diff --git a/src/core/equipments/ForceField.ts b/src/core/equipments/ForceField.ts index ac44f5b..f3abe36 100644 --- a/src/core/equipments/ForceField.ts +++ b/src/core/equipments/ForceField.ts @@ -5,7 +5,7 @@ module TS.SpaceTac.Equipments { constructor() { super(SlotType.Shield, "Force Field", "A basic force field, generated by radiating waves of compressed energy"); - this.setSkillsRequirements({ "skill_energy": istep(1, irepeat(2)) }); + this.setSkillsRequirements({ "skill_photons": istep(1, irepeat(2)) }); this.addAttributeEffect("shield_capacity", istep(100, irepeat(40))); } } diff --git a/src/core/equipments/GatlingGun.spec.ts b/src/core/equipments/GatlingGun.spec.ts index f1ba241..bf3b5b4 100644 --- a/src/core/equipments/GatlingGun.spec.ts +++ b/src/core/equipments/GatlingGun.spec.ts @@ -4,19 +4,19 @@ module TS.SpaceTac.Equipments { let template = new GatlingGun(); let equipment = template.generate(1); - expect(equipment.requirements).toEqual({ "skill_material": 1 }); + expect(equipment.requirements).toEqual({ "skill_materials": 1 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 3, 600, 0, [new DamageEffect(30, 20)])); equipment = template.generate(2); - expect(equipment.requirements).toEqual({ "skill_material": 2 }); + expect(equipment.requirements).toEqual({ "skill_materials": 2 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 3, 600, 0, [new DamageEffect(35, 25)])); equipment = template.generate(3); - expect(equipment.requirements).toEqual({ "skill_material": 3 }); + expect(equipment.requirements).toEqual({ "skill_materials": 3 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 3, 600, 0, [new DamageEffect(40, 30)])); equipment = template.generate(10); - expect(equipment.requirements).toEqual({ "skill_material": 10 }); + expect(equipment.requirements).toEqual({ "skill_materials": 10 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 3, 600, 0, [new DamageEffect(75, 65)])); }); }); diff --git a/src/core/equipments/GatlingGun.ts b/src/core/equipments/GatlingGun.ts index c85b57f..448a973 100644 --- a/src/core/equipments/GatlingGun.ts +++ b/src/core/equipments/GatlingGun.ts @@ -5,7 +5,7 @@ module TS.SpaceTac.Equipments { constructor() { super(SlotType.Weapon, "Gatling Gun", "Mechanical weapon using loads of metal bullets propelled by guided explosions"); - this.setSkillsRequirements({ "skill_material": 1 }); + this.setSkillsRequirements({ "skill_materials": 1 }); this.setCooldown(irepeat(2), irepeat(2)); this.addFireAction(irepeat(3), irepeat(600), 0, [ new EffectTemplate(new DamageEffect(), { base: istep(30, irepeat(5)), span: istep(20, irepeat(5)) }) diff --git a/src/core/equipments/IronHull.spec.ts b/src/core/equipments/IronHull.spec.ts index 250bc9a..4b0f2c4 100644 --- a/src/core/equipments/IronHull.spec.ts +++ b/src/core/equipments/IronHull.spec.ts @@ -4,19 +4,19 @@ module TS.SpaceTac.Equipments { let template = new IronHull(); let equipment = template.generate(1); - expect(equipment.requirements).toEqual({ "skill_material": 1 }); + expect(equipment.requirements).toEqual({ "skill_materials": 1 }); expect(equipment.effects).toEqual([new AttributeEffect("hull_capacity", 200)]); equipment = template.generate(2); - expect(equipment.requirements).toEqual({ "skill_material": 2 }); + expect(equipment.requirements).toEqual({ "skill_materials": 2 }); expect(equipment.effects).toEqual([new AttributeEffect("hull_capacity", 220)]); equipment = template.generate(3); - expect(equipment.requirements).toEqual({ "skill_material": 3 }); + expect(equipment.requirements).toEqual({ "skill_materials": 3 }); expect(equipment.effects).toEqual([new AttributeEffect("hull_capacity", 240)]); equipment = template.generate(10); - expect(equipment.requirements).toEqual({ "skill_material": 10 }); + expect(equipment.requirements).toEqual({ "skill_materials": 10 }); expect(equipment.effects).toEqual([new AttributeEffect("hull_capacity", 380)]); }); }); diff --git a/src/core/equipments/IronHull.ts b/src/core/equipments/IronHull.ts index 94fc00f..63d5217 100644 --- a/src/core/equipments/IronHull.ts +++ b/src/core/equipments/IronHull.ts @@ -5,7 +5,7 @@ module TS.SpaceTac.Equipments { constructor() { super(SlotType.Hull, "Iron Hull", "Protective hull, based on layered iron alloys"); - this.setSkillsRequirements({ "skill_material": 1 }); + this.setSkillsRequirements({ "skill_materials": 1 }); this.addAttributeEffect("hull_capacity", istep(200, irepeat(20))); } } diff --git a/src/core/equipments/NuclearReactor.spec.ts b/src/core/equipments/NuclearReactor.spec.ts index 21cbc50..c9fb4b7 100644 --- a/src/core/equipments/NuclearReactor.spec.ts +++ b/src/core/equipments/NuclearReactor.spec.ts @@ -4,39 +4,35 @@ module TS.SpaceTac.Equipments { let template = new NuclearReactor(); let equipment = template.generate(1); - expect(equipment.requirements).toEqual({ "skill_energy": 1 }); + expect(equipment.requirements).toEqual({ "skill_photons": 1 }); expect(equipment.effects).toEqual([ - new AttributeEffect("initiative", 1), - new AttributeEffect("power_capacity", 8), - new AttributeEffect("power_initial", 5), - new AttributeEffect("power_recovery", 4), + new AttributeEffect("maneuvrability", 1), + new AttributeEffect("power_capacity", 7), + new AttributeEffect("power_generation", 4), ]); equipment = template.generate(2); - expect(equipment.requirements).toEqual({ "skill_energy": 2 }); + expect(equipment.requirements).toEqual({ "skill_photons": 2 }); expect(equipment.effects).toEqual([ - new AttributeEffect("initiative", 2), - new AttributeEffect("power_capacity", 9), - new AttributeEffect("power_initial", 5), - new AttributeEffect("power_recovery", 4), + new AttributeEffect("maneuvrability", 2), + new AttributeEffect("power_capacity", 8), + new AttributeEffect("power_generation", 4), ]); equipment = template.generate(3); - expect(equipment.requirements).toEqual({ "skill_energy": 3 }); + expect(equipment.requirements).toEqual({ "skill_photons": 3 }); expect(equipment.effects).toEqual([ - new AttributeEffect("initiative", 3), - new AttributeEffect("power_capacity", 10), - new AttributeEffect("power_initial", 6), - new AttributeEffect("power_recovery", 4), + new AttributeEffect("maneuvrability", 3), + new AttributeEffect("power_capacity", 9), + new AttributeEffect("power_generation", 4), ]); equipment = template.generate(10); - expect(equipment.requirements).toEqual({ "skill_energy": 10 }); + expect(equipment.requirements).toEqual({ "skill_photons": 10 }); expect(equipment.effects).toEqual([ - new AttributeEffect("initiative", 10), - new AttributeEffect("power_capacity", 17), - new AttributeEffect("power_initial", 9), - new AttributeEffect("power_recovery", 6), + new AttributeEffect("maneuvrability", 10), + new AttributeEffect("power_capacity", 16), + new AttributeEffect("power_generation", 6), ]); }); }); diff --git a/src/core/equipments/NuclearReactor.ts b/src/core/equipments/NuclearReactor.ts index b1d7312..1f2f968 100644 --- a/src/core/equipments/NuclearReactor.ts +++ b/src/core/equipments/NuclearReactor.ts @@ -5,11 +5,10 @@ module TS.SpaceTac.Equipments { constructor() { super(SlotType.Power, "Nuclear Reactor", "A standard nuclear power core, drawing power from atom fusion cycles"); - this.setSkillsRequirements({ "skill_energy": 1 }); - this.addAttributeEffect("initiative", istep(1)); - this.addAttributeEffect("power_capacity", istep(8)); - this.addAttributeEffect("power_initial", istep(5, irepeat(0.5))); - this.addAttributeEffect("power_recovery", istep(4, irepeat(0.3))); + this.setSkillsRequirements({ "skill_photons": 1 }); + this.addAttributeEffect("maneuvrability", istep(1)); + this.addAttributeEffect("power_capacity", istep(7)); + this.addAttributeEffect("power_generation", istep(4, irepeat(0.3))); } } } diff --git a/src/core/equipments/PowerDepleter.spec.ts b/src/core/equipments/PowerDepleter.spec.ts index 8884803..cb75321 100644 --- a/src/core/equipments/PowerDepleter.spec.ts +++ b/src/core/equipments/PowerDepleter.spec.ts @@ -4,19 +4,19 @@ module TS.SpaceTac.Equipments { let template = new PowerDepleter(); let equipment = template.generate(1); - expect(equipment.requirements).toEqual({ "skill_energy": 1 }); + expect(equipment.requirements).toEqual({ "skill_photons": 1 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 4, 500, 0, [new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 2, true)])); equipment = template.generate(2); - expect(equipment.requirements).toEqual({ "skill_energy": 2 }); + expect(equipment.requirements).toEqual({ "skill_photons": 2 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 4, 520, 0, [new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 2, true)])); equipment = template.generate(3); - expect(equipment.requirements).toEqual({ "skill_energy": 3 }); + expect(equipment.requirements).toEqual({ "skill_photons": 3 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 4, 540, 0, [new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 2, true)])); equipment = template.generate(10); - expect(equipment.requirements).toEqual({ "skill_energy": 10 }); + expect(equipment.requirements).toEqual({ "skill_photons": 10 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 4, 680, 0, [new StickyEffect(new AttributeLimitEffect("power_capacity", 3), 2, true)])); }); diff --git a/src/core/equipments/PowerDepleter.ts b/src/core/equipments/PowerDepleter.ts index 0fa339f..2c19633 100644 --- a/src/core/equipments/PowerDepleter.ts +++ b/src/core/equipments/PowerDepleter.ts @@ -5,7 +5,7 @@ module TS.SpaceTac.Equipments { constructor() { super(SlotType.Weapon, "Power Depleter", "Direct-hit weapon that creates an energy well near the target, sucking its power surplus"); - this.setSkillsRequirements({ "skill_energy": 1 }); + this.setSkillsRequirements({ "skill_photons": 1 }); this.setCooldown(irepeat(2), irepeat(3)); this.addFireAction(irepeat(4), istep(500, irepeat(20)), 0, [ new StickyEffectTemplate(new AttributeLimitEffect("power_capacity"), { "value": irepeat(3) }, irepeat(2)) diff --git a/src/core/equipments/RepairDrone.spec.ts b/src/core/equipments/RepairDrone.spec.ts index 4d6677c..a3977c9 100644 --- a/src/core/equipments/RepairDrone.spec.ts +++ b/src/core/equipments/RepairDrone.spec.ts @@ -4,19 +4,19 @@ module TS.SpaceTac.Equipments { let template = new RepairDrone(); let equipment = template.generate(1); - expect(equipment.requirements).toEqual({ "skill_human": 1 }); + expect(equipment.requirements).toEqual({ "skill_quantum": 1 }); expect(equipment.action).toEqual(new DeployDroneAction(equipment, 4, 300, 10, 150, [new ValueEffect("hull", 5)])); equipment = template.generate(2); - expect(equipment.requirements).toEqual({ "skill_human": 2 }); + expect(equipment.requirements).toEqual({ "skill_quantum": 2 }); expect(equipment.action).toEqual(new DeployDroneAction(equipment, 4, 310, 11, 155, [new ValueEffect("hull", 6)])); equipment = template.generate(3); - expect(equipment.requirements).toEqual({ "skill_human": 3 }); + expect(equipment.requirements).toEqual({ "skill_quantum": 3 }); expect(equipment.action).toEqual(new DeployDroneAction(equipment, 4, 320, 12, 160, [new ValueEffect("hull", 7)])); equipment = template.generate(10); - expect(equipment.requirements).toEqual({ "skill_human": 10 }); + expect(equipment.requirements).toEqual({ "skill_quantum": 10 }); expect(equipment.action).toEqual(new DeployDroneAction(equipment, 4, 390, 19, 195, [new ValueEffect("hull", 14)])); }); diff --git a/src/core/equipments/RepairDrone.ts b/src/core/equipments/RepairDrone.ts index 51337e5..3560549 100644 --- a/src/core/equipments/RepairDrone.ts +++ b/src/core/equipments/RepairDrone.ts @@ -8,7 +8,7 @@ module TS.SpaceTac.Equipments { constructor() { super(SlotType.Weapon, "Repair Drone", "Drone able to repair small hull breaches, remotely controlled by human pilots"); - this.setSkillsRequirements({ "skill_human": 1 }); + this.setSkillsRequirements({ "skill_quantum": 1 }); this.setCooldown(irepeat(1), istep(3, irepeat(0.2))); this.addDroneAction(irepeat(4), istep(300, irepeat(10)), istep(10, irepeat(1)), istep(150, irepeat(5)), [ new EffectTemplate(new ValueEffect("hull"), { "value": istep(5) }) diff --git a/src/core/equipments/RocketEngine.spec.ts b/src/core/equipments/RocketEngine.spec.ts index 86b1ee9..fb0937a 100644 --- a/src/core/equipments/RocketEngine.spec.ts +++ b/src/core/equipments/RocketEngine.spec.ts @@ -4,23 +4,23 @@ module TS.SpaceTac.Equipments { let template = new RocketEngine(); let equipment = template.generate(1); - expect(equipment.requirements).toEqual({ "skill_energy": 1 }); - expect(equipment.effects).toEqual([new AttributeEffect("initiative", 1)]); + expect(equipment.requirements).toEqual({ "skill_photons": 1 }); + expect(equipment.effects).toEqual([new AttributeEffect("maneuvrability", 1)]); expect(equipment.action).toEqual(new MoveAction(equipment, 200)); equipment = template.generate(2); - expect(equipment.requirements).toEqual({ "skill_energy": 2 }); - expect(equipment.effects).toEqual([new AttributeEffect("initiative", 2)]); + expect(equipment.requirements).toEqual({ "skill_photons": 2 }); + expect(equipment.effects).toEqual([new AttributeEffect("maneuvrability", 2)]); expect(equipment.action).toEqual(new MoveAction(equipment, 220)); equipment = template.generate(3); - expect(equipment.requirements).toEqual({ "skill_energy": 3 }); - expect(equipment.effects).toEqual([new AttributeEffect("initiative", 3)]); + expect(equipment.requirements).toEqual({ "skill_photons": 3 }); + expect(equipment.effects).toEqual([new AttributeEffect("maneuvrability", 3)]); expect(equipment.action).toEqual(new MoveAction(equipment, 240)); equipment = template.generate(10); - expect(equipment.requirements).toEqual({ "skill_energy": 10 }); - expect(equipment.effects).toEqual([new AttributeEffect("initiative", 10)]); + expect(equipment.requirements).toEqual({ "skill_photons": 10 }); + expect(equipment.effects).toEqual([new AttributeEffect("maneuvrability", 10)]); expect(equipment.action).toEqual(new MoveAction(equipment, 380)); }); }); diff --git a/src/core/equipments/RocketEngine.ts b/src/core/equipments/RocketEngine.ts index 50a9cb0..a7c7d87 100644 --- a/src/core/equipments/RocketEngine.ts +++ b/src/core/equipments/RocketEngine.ts @@ -5,9 +5,9 @@ module TS.SpaceTac.Equipments { constructor() { super(SlotType.Engine, "Rocket Engine", "First-era conventional deep-space engine, based on gas exhausts pushed through a nozzle"); - this.setSkillsRequirements({ "skill_energy": 1 }); + this.setSkillsRequirements({ "skill_photons": 1 }); this.setCooldown(irepeat(2), 0); - this.addAttributeEffect("initiative", 1); + this.addAttributeEffect("maneuvrability", 1); this.addMoveAction(istep(200, irepeat(20))); } } diff --git a/src/core/equipments/SubMunitionMissile.spec.ts b/src/core/equipments/SubMunitionMissile.spec.ts index 577577c..c7735f9 100644 --- a/src/core/equipments/SubMunitionMissile.spec.ts +++ b/src/core/equipments/SubMunitionMissile.spec.ts @@ -4,19 +4,19 @@ module TS.SpaceTac.Equipments { let template = new SubMunitionMissile(); let equipment = template.generate(1); - expect(equipment.requirements).toEqual({ "skill_material": 1 }); + expect(equipment.requirements).toEqual({ "skill_materials": 1 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 4, 500, 150, [new DamageEffect(30, 2)])); equipment = template.generate(2); - expect(equipment.requirements).toEqual({ "skill_material": 2 }); + expect(equipment.requirements).toEqual({ "skill_materials": 2 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 4, 520, 155, [new DamageEffect(32, 3)])); equipment = template.generate(3); - expect(equipment.requirements).toEqual({ "skill_material": 3 }); + expect(equipment.requirements).toEqual({ "skill_materials": 3 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 4, 540, 160, [new DamageEffect(34, 4)])); equipment = template.generate(10); - expect(equipment.requirements).toEqual({ "skill_material": 10 }); + expect(equipment.requirements).toEqual({ "skill_materials": 10 }); expect(equipment.action).toEqual(new FireWeaponAction(equipment, 4, 680, 195, [new DamageEffect(48, 11)])); }); diff --git a/src/core/equipments/SubMunitionMissile.ts b/src/core/equipments/SubMunitionMissile.ts index f733b7d..d4c8996 100644 --- a/src/core/equipments/SubMunitionMissile.ts +++ b/src/core/equipments/SubMunitionMissile.ts @@ -5,7 +5,7 @@ module TS.SpaceTac.Equipments { constructor() { super(SlotType.Weapon, "SubMunition Missile", "Explosive missile releasing small shelled payloads, that will in turn explode on impact"); - this.setSkillsRequirements({ "skill_material": 1 }); + this.setSkillsRequirements({ "skill_materials": 1 }); this.setCooldown(irepeat(1), 0); this.addFireAction(irepeat(4), istep(500, irepeat(20)), istep(150, irepeat(5)), [ new EffectTemplate(new DamageEffect(), { base: istep(30, irepeat(2)), span: istep(2, irepeat(1)) }) diff --git a/src/ui/battle/ArenaShip.spec.ts b/src/ui/battle/ArenaShip.spec.ts index c0c5da4..bcffdac 100644 --- a/src/ui/battle/ArenaShip.spec.ts +++ b/src/ui/battle/ArenaShip.spec.ts @@ -10,11 +10,11 @@ module TS.SpaceTac.UI.Specs { expect(sprite.effects.children.length).toBe(0); - sprite.displayValueChanged(new ValueChangeEvent(ship, ship.attributes.power_recovery, -4)); + sprite.displayValueChanged(new ValueChangeEvent(ship, ship.attributes.power_generation, -4)); expect(sprite.effects.children.length).toBe(1); let t1 = sprite.effects.getChildAt(0); - expect(t1.text).toBe("power recovery -4"); + expect(t1.text).toBe("power generation -4"); sprite.displayValueChanged(new ValueChangeEvent(ship, ship.values.shield, 12)); diff --git a/src/ui/character/CharacterSheet.ts b/src/ui/character/CharacterSheet.ts index 475fdff..1413105 100644 --- a/src/ui/character/CharacterSheet.ts +++ b/src/ui/character/CharacterSheet.ts @@ -137,16 +137,16 @@ module TS.SpaceTac.UI { let x1 = 664; let x2 = 1066; let y = 662; - this.addAttribute("initiative", x1, y); - this.addAttribute("hull_capacity", x1, y + 64); - this.addAttribute("shield_capacity", x1, y + 128); - this.addAttribute("power_capacity", x1, y + 192); - this.addAttribute("power_initial", x1, y + 256); - this.addAttribute("power_recovery", x1, y + 320); - this.addAttribute("skill_material", x2, y); - this.addAttribute("skill_electronics", x2, y + 64); - this.addAttribute("skill_energy", x2, y + 128); - this.addAttribute("skill_human", x2, y + 192); + this.addAttribute("hull_capacity", x1, y); + this.addAttribute("shield_capacity", x1, y + 64); + this.addAttribute("power_capacity", x1, y + 128); + this.addAttribute("power_generation", x1, y + 192); + this.addAttribute("maneuvrability", x1, y + 256); + this.addAttribute("precision", x1, y + 320); + this.addAttribute("skill_materials", x2, y); + this.addAttribute("skill_photons", x2, y + 64); + this.addAttribute("skill_antimatter", x2, y + 128); + this.addAttribute("skill_quantum", x2, y + 192); this.addAttribute("skill_gravity", x2, y + 256); this.addAttribute("skill_time", x2, y + 320); } @@ -155,11 +155,18 @@ module TS.SpaceTac.UI { * Add an attribute display */ private addAttribute(attribute: keyof ShipAttributes, x: number, y: number) { - let text = new Phaser.Text(this.game, x, y, "", { align: "center", font: "18pt Arial", fill: "#FFFFFF" }); + let attrname = capitalize(SHIP_ATTRIBUTES[attribute].name); + let name = new Phaser.Text(this.game, x - 144, y - 2, attrname, + { align: "center", font: "20pt Arial", fill: "#c9d8ef", stroke: "#395665", strokeThickness: 1 }); + name.anchor.set(0.5, 0.5); + this.addChild(name); + + let text = new Phaser.Text(this.game, x, y, "", + { align: "center", font: "bold 18pt Arial", fill: "#FFFFFF" }); text.anchor.set(0.5, 0.5); this.addChild(text); - this.attributes[SHIP_ATTRIBUTES[attribute].name] = text; + this.attributes[attribute] = text; if (SHIP_SKILLS.hasOwnProperty(attribute)) { let button = new Phaser.Button(this.game, x + 54, y - 4, "character-skill-upgrade", () => { @@ -169,7 +176,7 @@ module TS.SpaceTac.UI { button.anchor.set(0.5, 0.5); this.ship_upgrades.add(button); - this.view.tooltip.bindStaticText(button, `Spend one point to upgrade ${SHIP_ATTRIBUTES[attribute].name}`); + this.view.tooltip.bindStaticText(button, `Spend one point to upgrade ${attrname}`); } } @@ -214,7 +221,7 @@ module TS.SpaceTac.UI { this.ship_upgrades.visible = upgrade_points > 0; iteritems(ship.attributes, (key, value: ShipAttribute) => { - let text = this.attributes[value.name]; + let text = this.attributes[key]; if (text) { text.setText(value.get().toString()); }