add ~30 second alliance request cooldown to prevent spam

This commit is contained in:
evanpelle
2024-09-30 21:07:43 -07:00
parent 155c0366a3
commit 6469911230
11 changed files with 46 additions and 17 deletions
@@ -199,6 +199,9 @@ export class EventsDisplay implements Layer {
if (other == null) {
return
}
if (!myPlayer.isAlive() || !other.isAlive()) {
return
}
this.addEvent({
description: `Your alliance with ${other.name()} expired`,
type: MessageType.WARN,
+1 -5
View File
@@ -231,17 +231,13 @@ export class RadialMenu implements Layer {
return
}
if (myPlayer.pendingAllianceRequestWith(other)) {
return
}
if (myPlayer.isAlliedWith(other)) {
this.activateMenuElement(RadialElement.BreakAlliance, () => {
this.eventBus.emit(
new SendBreakAllianceIntentEvent(myPlayer, other)
)
})
} else {
} else if (!myPlayer.recentOrPendingAllianceRequestWith(other)) {
this.activateMenuElement(RadialElement.RequestAlliance, () => {
this.eventBus.emit(
new SendAllianceRequestIntentEvent(myPlayer, other)