refactored alliance

This commit is contained in:
evanpelle
2024-09-22 13:38:43 -07:00
parent e746ea35e3
commit d874392467
15 changed files with 79 additions and 48 deletions
+1 -1
View File
@@ -208,7 +208,7 @@ export class ClientGame {
if (tile.owner() == this.myPlayer) {
return
}
if (tile.owner().isPlayer() && this.myPlayer.alliedWith(tile.owner() as Player)) {
if (tile.owner().isPlayer() && this.myPlayer.isAlliedWith(tile.owner() as Player)) {
this.eventBus.emit(new DisplayMessageEvent("Cannot attack ally", MessageType.WARN))
return
}
+1 -1
View File
@@ -166,7 +166,7 @@ export class NameLayer implements Layer {
}
const myPlayer = this.getPlayer()
if (myPlayer != null && myPlayer.alliedWith(render.player)) {
if (myPlayer != null && myPlayer.isAlliedWith(render.player)) {
context.drawImage(
this.allianceIconImage,
nameCenterX - iconSize / 2,
+1 -1
View File
@@ -260,7 +260,7 @@ export class UILayer implements Layer {
return
}
if (myPlayer.alliedWith(owner)) {
if (myPlayer.isAlliedWith(owner)) {
options.push({
label: "Break Alliance",
action: (): void => {