1
0
Fork 0
spacetac/src/core/diffs/ShipDamageDiff.ts

32 lines
824 B
TypeScript
Raw Normal View History

/// <reference path="BaseBattleDiff.ts"/>
module TK.SpaceTac {
/**
* A ship takes damage (to hull or shield)
*
* This is only informative, and does not apply the damage on ship values (there are ShipValueDiff for this).
*/
export class ShipDamageDiff extends BaseBattleShipDiff {
// Damage to hull
hull: number
// Damage to shield
shield: number
2018-03-26 15:30:43 +00:00
// Evaded damage
evaded: number
// Theoretical damage value
theoretical: number
2018-03-26 15:30:43 +00:00
constructor(ship: Ship, hull: number, shield: number, evaded = 0, theoretical = hull + shield + evaded) {
super(ship);
this.hull = hull;
this.shield = shield;
2018-03-26 15:30:43 +00:00
this.evaded = evaded;
this.theoretical = theoretical;
}
}
}