tscommon namespace renamed
This commit is contained in:
parent
d3f4cffde8
commit
e511b78754
2
TODO.md
2
TODO.md
|
@ -57,6 +57,7 @@ Battle
|
|||
* Add a battle log display
|
||||
* Allow to move targetting indicator with arrow keys
|
||||
* Add targetting shortcuts for "previous target", "next enemy" and "next ally"
|
||||
* Area targetting should include the hotkeyed ship at best (apply exclusion and power limit), not necessarily center on it
|
||||
|
||||
Ships models and equipments
|
||||
---------------------------
|
||||
|
@ -89,6 +90,7 @@ Common UI
|
|||
|
||||
* Add caret/focus to text input
|
||||
* Add a standard confirm dialog
|
||||
* Hover out when using keyboard shortcuts
|
||||
* Mobile: think UI layout so that fingers do not block the view (right and left handed)
|
||||
* Mobile: display tooltips larger and on the side of screen where the finger is not
|
||||
* Mobile: targetting in two times, using a draggable target indicator
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
|
||||
<script>
|
||||
window.onload = function () {
|
||||
TS.SpaceTac.AIDuel.setup(document.getElementById("duel"));
|
||||
TK.SpaceTac.AIDuel.setup(document.getElementById("duel"));
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<script>
|
||||
window.oncontextmenu = function (e) { e.preventDefault(); };
|
||||
window.onload = function () {
|
||||
window.game = new TS.SpaceTac.MainUI();
|
||||
window.game = new TK.SpaceTac.MainUI();
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -65,17 +65,17 @@
|
|||
|
||||
<script>
|
||||
window.onload = function () {
|
||||
var generator = new TS.SpaceTac.LootGenerator();
|
||||
var generator = new TK.SpaceTac.LootGenerator();
|
||||
var result = document.getElementById("result");
|
||||
var current_level = 1;
|
||||
var current_name = "";
|
||||
var qualities = {}
|
||||
|
||||
qualities[TS.SpaceTac.EquipmentQuality.WEAK] = "#e66";
|
||||
qualities[TS.SpaceTac.EquipmentQuality.COMMON] = "#eee";
|
||||
qualities[TS.SpaceTac.EquipmentQuality.FINE] = "#669";
|
||||
qualities[TS.SpaceTac.EquipmentQuality.PREMIUM] = "#66b";
|
||||
qualities[TS.SpaceTac.EquipmentQuality.LEGENDARY] = "#66e";
|
||||
qualities[TK.SpaceTac.EquipmentQuality.WEAK] = "#e66";
|
||||
qualities[TK.SpaceTac.EquipmentQuality.COMMON] = "#eee";
|
||||
qualities[TK.SpaceTac.EquipmentQuality.FINE] = "#669";
|
||||
qualities[TK.SpaceTac.EquipmentQuality.PREMIUM] = "#66b";
|
||||
qualities[TK.SpaceTac.EquipmentQuality.LEGENDARY] = "#66e";
|
||||
|
||||
function update() {
|
||||
result.innerHTML = "";
|
||||
|
@ -83,7 +83,7 @@
|
|||
if (template.name != current_name) {
|
||||
return;
|
||||
}
|
||||
TS.iterenum(TS.SpaceTac.EquipmentQuality, function (quality) {
|
||||
TK.iterenum(TK.SpaceTac.EquipmentQuality, function (quality) {
|
||||
var loot = template.generate(current_level, quality);
|
||||
|
||||
var block = document.createElement("div");
|
||||
|
@ -101,7 +101,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
TS.sortedBy(generator.templates, function (template) {
|
||||
TK.sortedBy(generator.templates, function (template) {
|
||||
return template.name;
|
||||
}).forEach(function (template) {
|
||||
var opt = document.createElement('option');
|
||||
|
|
|
@ -4,7 +4,7 @@ if (typeof window != "undefined") {
|
|||
(<any>window).describe = (<any>window).describe || function () { };
|
||||
}
|
||||
|
||||
module TS.SpaceTac.UI.Specs {
|
||||
module TK.SpaceTac.UI.Specs {
|
||||
class FakeStorage {
|
||||
data: any = {}
|
||||
getItem(name: string) {
|
||||
|
|
|
@ -4,7 +4,7 @@ if (typeof window != "undefined") {
|
|||
(<any>window).describe = (<any>window).describe || function () { };
|
||||
}
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// Router between game views
|
||||
export class MainUI extends Phaser.Game {
|
||||
// Current game session
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 18a9b3c75b576af53362b7ce6d5081d71050cde4
|
||||
Subproject commit c77c859359e3cee3700dcd7a28431f2f0b49e0a2
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("ArenaLocation", () => {
|
||||
it("gets distance and angle between two locations", () => {
|
||||
expect(arenaDistance({ x: 0, y: 0 }, { x: 1, y: 1 })).toBeCloseTo(Math.sqrt(2), 8);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Location in the arena (coordinates only)
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("Battle", function () {
|
||||
it("defines play order by initiative throws", function () {
|
||||
var fleet1 = new Fleet();
|
||||
|
@ -372,7 +372,7 @@ module TS.SpaceTac {
|
|||
let battle = Battle.newQuickRandom();
|
||||
battle.ai_playing = true;
|
||||
|
||||
let serializer = new Serializer(TS.SpaceTac);
|
||||
let serializer = new Serializer(TK.SpaceTac);
|
||||
let data = serializer.serialize(battle);
|
||||
|
||||
let loaded = serializer.unserialize(data);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// A turn-based battle between fleets
|
||||
export class Battle {
|
||||
// Flag indicating if the battle is ended
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("BattleCheats", function () {
|
||||
it("wins a battle", function () {
|
||||
let battle = Battle.newQuickRandom();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Cheat helpers for current battle
|
||||
*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="events/BaseBattleEvent.ts"/>
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// Check a single game log event
|
||||
function checkEvent(got: BaseBattleEvent, ship: Ship, code: string,
|
||||
target_ship: Ship | null = null, target_x: number | null = null, target_y: number | null = null): void {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Function called to inform subscribers of new events.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("BattleOutcome", () => {
|
||||
it("generates loot from defeated ships", () => {
|
||||
var fleet1 = new Fleet();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Result of an ended battle
|
||||
*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("BattleStats", function () {
|
||||
it("collects stats", function () {
|
||||
let stats = new BattleStats();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Statistics collection over a battle
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("Cooldown", function () {
|
||||
it("applies overheat and cooldown", function () {
|
||||
let cooldown = new Cooldown();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Cooldown system for equipments
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="effects/BaseEffect.ts" />
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Fake effect to capture apply requests
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Drones are static objects that apply effects in a circular zone around themselves.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("Equipment", () => {
|
||||
it("generates a full name", function () {
|
||||
let equipment = new Equipment(SlotType.Weapon, "rayofdeath");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Quality of loot.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("ExclusionAreas", function () {
|
||||
it("constructs from a ship or battle", function () {
|
||||
let battle = new Battle();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Helper for working with exclusion areas (areas where a ship cannot go)
|
||||
*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("Fleet", function () {
|
||||
it("get average level", function () {
|
||||
var fleet = new Fleet();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* A fleet of ships, all belonging to the same player
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// Generator of balanced ships to form a fleet
|
||||
export class FleetGenerator {
|
||||
// Random generator to use
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("GameSession", () => {
|
||||
/**
|
||||
* Compare two sessions
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* A game session, binding a universe and a player
|
||||
*
|
||||
|
@ -41,13 +41,13 @@ module TS.SpaceTac {
|
|||
|
||||
// Load a game state from a string
|
||||
static loadFromString(serialized: string): GameSession {
|
||||
var serializer = new Serializer(TS.SpaceTac);
|
||||
var serializer = new Serializer(TK.SpaceTac);
|
||||
return <GameSession>serializer.unserialize(serialized);
|
||||
}
|
||||
|
||||
// Serializes the game state to a string
|
||||
saveToString(): string {
|
||||
var serializer = new Serializer(TS.SpaceTac);
|
||||
var serializer = new Serializer(TK.SpaceTac);
|
||||
return serializer.serialize(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="LootTemplate.ts" />
|
||||
|
||||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
class TestTemplate extends LootTemplate {
|
||||
constructor() {
|
||||
super(SlotType.Shield, "Hexagrid Shield");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Equipment generator from loot templates
|
||||
*
|
||||
|
@ -34,7 +34,7 @@ module TS.SpaceTac {
|
|||
// Fill the list of templates
|
||||
populate(): void {
|
||||
let templates: LootTemplate[] = [];
|
||||
let namespace: any = TS.SpaceTac.Equipments;
|
||||
let namespace: any = TK.SpaceTac.Equipments;
|
||||
for (var template_name in namespace) {
|
||||
if (template_name && template_name.indexOf("Abstract") != 0) {
|
||||
let template_class = namespace[template_name];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Modifiers of basic loot, to obtain different quality levels
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="effects/BaseEffect.ts" />
|
||||
|
||||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
class FakeEffect extends BaseEffect {
|
||||
fakevalue: number
|
||||
constructor(val = 5) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* A leveled value is an iterator yielding the desired value for each level (first item is for level 1, and so on)
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("MoveFireSimulator", function () {
|
||||
|
||||
function simpleWeaponCase(distance = 10, ship_ap = 5, weapon_ap = 3, engine_distance = 5): [Ship, MoveFireSimulator, BaseAction] {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Error codes for approach simulation
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("NameGenerator", () => {
|
||||
it("generates unique names", () => {
|
||||
var random = new SkewedRandomGenerator([0.48, 0.9, 0.1]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// A unique name generator
|
||||
export class NameGenerator {
|
||||
// List of available choices
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("Player", function () {
|
||||
it("keeps track of visited locations", function () {
|
||||
let player = new Player();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// One player (human or IA)
|
||||
export class Player {
|
||||
// Player's name
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
function checkProportional(range: Range, value1: number, value2: number) {
|
||||
expect(range.getProportional(value1)).toEqual(value2);
|
||||
expect(range.getReverseProportional(value2)).toEqual(value1);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// Range of number values
|
||||
export class Range {
|
||||
// Minimal value
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("Ship", function () {
|
||||
it("creates a full name", function () {
|
||||
let ship = new Ship();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* A single ship in a fleet
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("ShipGenerator", function () {
|
||||
it("can use ship model", function () {
|
||||
var gen = new ShipGenerator();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Generator of random ship
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("ShipLevel", () => {
|
||||
it("level up from experience points", () => {
|
||||
let level = new ShipLevel();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Level and experience system for a ship.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// A model of ship
|
||||
// It defines the ship looks, and available slots for equipment
|
||||
export class ShipModel {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("ShipValue", function () {
|
||||
it("is initially not limited", function () {
|
||||
var attr = new ShipValue("test");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
const SHIP_VALUES_DESCRIPTIONS: { [name: string]: string } = {
|
||||
"materials skill": "Usage of physical materials such as bullets, shells...",
|
||||
"photons skill": "Forces of light, and electromagnetic radiation",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("Shop", () => {
|
||||
it("generates a stock", () => {
|
||||
let shop = new Shop();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* A shop is a place to buy/sell equipments
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("Slot", () => {
|
||||
it("checks equipment type", () => {
|
||||
var ship = new Ship();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// Types of slots
|
||||
export enum SlotType {
|
||||
Hull,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("Star", () => {
|
||||
it("lists links to other stars", () => {
|
||||
var universe = new Universe();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// A star system
|
||||
export class Star {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("StarLink", () => {
|
||||
it("checks link intersection", () => {
|
||||
var star1 = new Star(null, 0, 0);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// An hyperspace link between two star systems
|
||||
export class StarLink {
|
||||
// Stars
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("StarLocation", () => {
|
||||
it("removes generated encounters that lose", function () {
|
||||
var location = new StarLocation(undefined, StarLocationType.PLANET, 0, 0);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
export enum StarLocationType {
|
||||
STAR,
|
||||
WARP,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("Target", () => {
|
||||
it("initializes from ship or location", () => {
|
||||
var target: Target;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// Find the nearest intersection between a line and a circle
|
||||
// Circle is supposed to be centered at (0,0)
|
||||
// Nearest intersection to (x1,y1) is returned
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("TestTools", () => {
|
||||
it("set ship power", () => {
|
||||
let ship = new Ship();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// unit testing utilities
|
||||
export class TestTools {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("Universe", () => {
|
||||
it("generates star systems", () => {
|
||||
var universe = new Universe();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Main game universe
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("BaseAction", function () {
|
||||
it("check if equipment can be used with remaining AP", function () {
|
||||
var equipment = new Equipment(SlotType.Hull);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Targetting mode for an action.
|
||||
*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="../effects/BaseEffect.ts" />
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("DeployDroneAction", function () {
|
||||
it("stores useful information", function () {
|
||||
let equipment = new Equipment(SlotType.Weapon, "testdrone");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="BaseAction.ts"/>
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Action to deploy a drone in space
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("EndTurnAction", () => {
|
||||
it("can't be applied to non-playing ship", () => {
|
||||
spyOn(console, "warn").and.stub();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// Action to end the ship's turn
|
||||
export class EndTurnAction extends BaseAction {
|
||||
constructor() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="../effects/BaseEffect.ts" />
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("FireWeaponAction", function () {
|
||||
it("constructs correctly", function () {
|
||||
let equipment = new Equipment(SlotType.Weapon, "testweapon");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="BaseAction.ts"/>
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Action to fire a weapon on another ship, or in space
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("MoveAction", function () {
|
||||
it("checks movement against remaining AP", function () {
|
||||
var ship = new Ship();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
// Action to move to a given location
|
||||
export class MoveAction extends BaseAction {
|
||||
// Distance allowed for each power point (raw, without applying maneuvrability)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="BaseAction.ts"/>
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Action to toggle some effects on the ship or around it, until next turn start
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Duel between two AIs, over multiple battles
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Base class for all Artificial Intelligence interaction
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("Maneuver", function () {
|
||||
it("guesses weapon effects", function () {
|
||||
let battle = new Battle();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Ship maneuver for an artifical intelligence
|
||||
*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="Maneuver.ts" />
|
||||
|
||||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("TacticalAI", function () {
|
||||
class FixedManeuver extends Maneuver {
|
||||
score: number;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="AbstractAI.ts"/>
|
||||
/// <reference path="Maneuver.ts"/>
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
|
||||
export type TacticalProducer = Iterator<Maneuver>;
|
||||
export type TacticalEvaluator = (maneuver: Maneuver) => number;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("TacticalAIHelpers", function () {
|
||||
it("produces direct weapon shots", function () {
|
||||
let battle = new Battle();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Iterator of a list of "random" arena coordinates, based on a grid
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("AttributeEffect", function () {
|
||||
it("is not applied directly", function () {
|
||||
let ship = new Ship();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="BaseEffect.ts"/>
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Effect to modify an attribute.
|
||||
*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
describe("AttributeLimitEffect", function () {
|
||||
it("limits an attribute", function () {
|
||||
let battle = new Battle();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="BaseEffect.ts"/>
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Enforce a limitation on ship attribute final value
|
||||
*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("BaseEffect", function () {
|
||||
it("gets a fixed or variable amount", function () {
|
||||
let effect = new BaseEffect("test");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
export type EffectAmount = number | { base: number, span: number };
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("DamageEffect", function () {
|
||||
it("applies damage and wear", function () {
|
||||
var ship = new Ship();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="BaseEffect.ts"/>
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Apply damage on a ship.
|
||||
*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="BaseEffect.ts"/>
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Modify damage on ships.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.Specs {
|
||||
module TK.SpaceTac.Specs {
|
||||
describe("RepelEffect", function () {
|
||||
it("shows a textual description", function () {
|
||||
expect(new RepelEffect(34).getDescription()).toEqual("repel ships 34km away");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="BaseEffect.ts"/>
|
||||
|
||||
module TS.SpaceTac {
|
||||
module TK.SpaceTac {
|
||||
/**
|
||||
* Repel ships from a central point
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue