API: Programming-friendly interface to getFactionInviteRequirements (#953)

This commit is contained in:
Jesse Clark
2023-12-16 01:27:22 -08:00
committed by GitHub
parent e957864c4b
commit 473217ef31
79 changed files with 1626 additions and 140 deletions
@@ -620,10 +620,10 @@ export function checkForFactionInvitations(this: PlayerObject): Faction[] {
if (faction.alreadyInvited) continue;
// Handle invites
const { inviteReqs, rumorReqs } = faction.getInfo();
if (inviteReqs.every((req) => req.isSatisfied(this))) invitedFactions.push(faction);
if (inviteReqs.isSatisfied(this)) invitedFactions.push(faction);
// Handle rumors
if (this.factionRumors.has(faction.name)) continue;
if (rumorReqs.every((req) => req.isSatisfied(this))) this.receiveRumor(faction.name);
if (rumorReqs.isSatisfied(this)) this.receiveRumor(faction.name);
}
return invitedFactions;
}