AP consumption is now done by BaseAction
This commit is contained in:
parent
9814f08883
commit
f01a9059e9
|
@ -79,7 +79,16 @@ module SpaceTac.Game {
|
|||
if (!target && this.needs_target) {
|
||||
return false;
|
||||
}
|
||||
return this.customApply(battle, ship, target);
|
||||
|
||||
var cost = this.getActionPointsUsage(battle, ship, target);
|
||||
if (this.customApply(battle, ship, target)) {
|
||||
if (cost > 0) {
|
||||
ship.useActionPoints(cost);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -49,11 +49,6 @@ module SpaceTac.Game {
|
|||
result = result || eff_result;
|
||||
});
|
||||
|
||||
// Consume AP
|
||||
if (result) {
|
||||
ship.useActionPoints(this.equipment.ap_usage);
|
||||
}
|
||||
|
||||
return result;
|
||||
} else {
|
||||
// TODO target in space (=> apply blast radius)
|
||||
|
|
|
@ -35,9 +35,7 @@ module SpaceTac.Game {
|
|||
}
|
||||
|
||||
protected customApply(battle: Battle, ship: Ship, target: Target): boolean {
|
||||
var cost = this.getActionPointsUsage(battle, ship, target);
|
||||
ship.moveTo(target.x, target.y);
|
||||
ship.useActionPoints(cost);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue