2017-02-09 00:00:35 +00:00
|
|
|
module TS.SpaceTac {
|
2015-01-06 00:00:00 +00:00
|
|
|
// Action to end the ship's turn
|
|
|
|
export class EndTurnAction extends BaseAction {
|
|
|
|
constructor() {
|
2017-09-19 15:09:06 +00:00
|
|
|
super("endturn", "End ship's turn");
|
2015-01-06 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
2017-03-07 19:27:46 +00:00
|
|
|
protected customApply(ship: Ship, target: Target) {
|
2017-09-19 15:09:06 +00:00
|
|
|
if (target.ship == ship) {
|
|
|
|
ship.endTurn();
|
2017-03-07 19:27:46 +00:00
|
|
|
|
2017-09-19 15:09:06 +00:00
|
|
|
let battle = ship.getBattle();
|
|
|
|
if (battle) {
|
|
|
|
battle.advanceToNextShip();
|
|
|
|
}
|
2017-03-07 19:27:46 +00:00
|
|
|
}
|
2015-01-06 00:00:00 +00:00
|
|
|
}
|
2017-05-22 16:29:04 +00:00
|
|
|
|
2017-09-19 15:09:06 +00:00
|
|
|
protected checkShipTarget(ship: Ship, target: Target): Target | null {
|
|
|
|
return target.ship == ship ? target : null;
|
|
|
|
}
|
|
|
|
|
|
|
|
getTargettingMode(ship: Ship): ActionTargettingMode {
|
|
|
|
return ship.getValue("power") ? ActionTargettingMode.SELF_CONFIRM : ActionTargettingMode.SELF;
|
|
|
|
}
|
|
|
|
|
2017-05-22 16:29:04 +00:00
|
|
|
getEffectsDescription(): string {
|
|
|
|
return "End the current ship's turn.\nWill also generate power and cool down equipments.";
|
|
|
|
}
|
2015-01-06 00:00:00 +00:00
|
|
|
}
|
2015-01-07 00:00:00 +00:00
|
|
|
}
|