feat: cancel attack

Canceling attack takes time and incurs a malus (loose some troops).
Also prettier fixed a file HostLobbyModal.
This commit is contained in:
ilan schemoul
2025-03-03 22:06:35 +01:00
parent 8803cc89b6
commit 9a1f916f4d
11 changed files with 181 additions and 9 deletions
+3
View File
@@ -35,6 +35,7 @@ import { ConstructionExecution } from "./ConstructionExecution";
import { fixProfaneUsername, isProfaneUsername } from "../validations/username";
import { NoOpExecution } from "./NoOpExecution";
import { EmbargoExecution } from "./EmbargoExecution";
import { RetreatExecution } from "./RetreatExecution";
export class Executor {
// private random = new PseudoRandom(999)
@@ -80,6 +81,8 @@ export class Executor {
null,
);
}
case "cancel_attack":
return new RetreatExecution(intent.playerID, intent.attackID);
case "spawn":
return new SpawnExecution(
new PlayerInfo(