add 5 second player immunity to prevent spawn kills

This commit is contained in:
Evan
2025-02-08 19:34:16 -08:00
parent 2fa576c841
commit 4f4b6adb80
5 changed files with 37 additions and 56 deletions
+9
View File
@@ -756,6 +756,15 @@ export class PlayerImpl implements Player {
}
public canAttack(tile: TileRef): boolean {
if (
this.mg.hasOwner(tile) &&
this.mg.config().numSpawnPhaseTurns() +
this.mg.config().spawnImmunityDuration() >
this.mg.ticks()
) {
return false;
}
if (this.mg.owner(tile) == this) {
return false;
}