mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 09:14:09 +00:00
sam do not target twice same nuke (#270)
This commit is contained in:
@@ -244,6 +244,9 @@ export interface Unit {
|
||||
setMoveTarget(cell: TileRef): void;
|
||||
moveTarget(): TileRef | null;
|
||||
|
||||
setTargetedBySAM(targeted: boolean): void;
|
||||
targetedBySAM(): boolean;
|
||||
|
||||
// Mutations
|
||||
setTroops(troops: number): void;
|
||||
delete(displayerMessage?: boolean): void;
|
||||
|
||||
@@ -15,10 +15,11 @@ export class UnitImpl implements Unit {
|
||||
// Currently only warship use it
|
||||
private _target: Unit = null;
|
||||
private _moveTarget: TileRef = null;
|
||||
private _targetedBySAM = false;
|
||||
|
||||
private _constructionType: UnitType = undefined;
|
||||
|
||||
private _isSamCooldown: boolean;
|
||||
private _isSamCooldown: boolean = false;
|
||||
private _dstPort: Unit | null = null; // Only for trade ships
|
||||
private _detonationDst: TileRef | null = null; // Only for nukes
|
||||
private _warshipTarget: Unit | null = null;
|
||||
@@ -204,4 +205,12 @@ export class UnitImpl implements Unit {
|
||||
moveTarget(): TileRef | null {
|
||||
return this._moveTarget;
|
||||
}
|
||||
|
||||
setTargetedBySAM(targeted: boolean): void {
|
||||
this._targetedBySAM = targeted;
|
||||
}
|
||||
|
||||
targetedBySAM(): boolean {
|
||||
return this._targetedBySAM;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user