Class: DiplomacyManager

DiplomacyManager()

new DiplomacyManager()

Source:

Classes

DiplomacyManager

Members

Config

Source:

[undefined]

Source:

betrayLapseTime

Source:

betrayLapseTime

Source:

betrayLapseTime

Source:

betrayLapseTime

Source:

betrayWeighting

Source:

nextTributeRequest

Source:

nextTributeUpdate

Source:

nextTributeUpdate

Source:

nextTributeUpdate

Source:

receivedDiplomacyRequests

Source:

sentDiplomacyRequestLapseTime

Source:

sentDiplomacyRequestLapseTime

Source:

sentDiplomacyRequests

Source:

waitingToBetray

Source:

waitingToBetray

Source:

waitingToBetray

Source:

waitingToBetray

Source:

Methods

Deserialize()

Source:

Serialize()

Source:

changePlayerDiplomacy()

Source:

checkEvents()

Source:

checkRequestedTributes()

Source:

checkSentDiplomacyRequests()

Source:

handleDiplomacyRequest()

Do not become allies with a player if the game would be over. Overall, be reluctant to become allies with any one player, but be more likely to accept neutral requests.
Source:

init()

If there are any players that are allied/neutral with us but we are not allied/neutral with them, treat this situation like an ally/neutral request.
Source:

lastManStandingCheck()

If the "Last Man Standing" option is enabled, check if the only remaining players are allies or neutral. If so, turn against the strongest first, but be more likely to first turn against neutral players, if there are any.
Source:

sendDiplomacyRequest()

Try to become allies with a player who has a lot of mutual enemies in common with us. TODO: Possibly let human players demand tributes from AIs who send diplomacy requests.
Source:

tributes()

Check if any allied needs help (tribute) and sent it if we have enough resource or ask for a tribute if we are in need and one ally can help
Source:

update()

Source:

DiplomacyManager()

If a player sends us an ally or neutral request, an Object in this.receivedDiplomacyRequests will be created that includes the request status, and the amount and type of the resource tribute (if any) that they must send in order for us to accept their request. In addition, a message will be sent if the player has not sent us a tribute within a minute. If two minutes pass without a tribute, we will decline their request. If we send a diplomacy request to another player, an Object in this.sentDiplomacyRequests will be created, which consists of the requestType (i.e. "ally" or "neutral") and the timeSent. A chat message will be sent to the other player, and AI players will actually be informed of the request by a DiplomacyRequest event sent through AIInterface. It is expected that the other player will change their diplomacy stance to the stance that we suggested within a period of time, or else the request will be deleted from this.sentDiplomacyRequests. When @c deserialized is true, do not call any random function inside constructor as that would cause oos.

Constructor

new DiplomacyManager()

Source:

Classes

DiplomacyManager

Members

Config

Source:

[undefined]

Source:

betrayLapseTime

Source:

betrayLapseTime

Source:

betrayLapseTime

Source:

betrayLapseTime

Source:

betrayWeighting

Source:

nextTributeRequest

Source:

nextTributeUpdate

Source:

nextTributeUpdate

Source:

nextTributeUpdate

Source:

receivedDiplomacyRequests

Source:

sentDiplomacyRequestLapseTime

Source:

sentDiplomacyRequestLapseTime

Source:

sentDiplomacyRequests

Source:

waitingToBetray

Source:

waitingToBetray

Source:

waitingToBetray

Source:

waitingToBetray

Source:

Methods

Deserialize()

Source:

Serialize()

Source:

changePlayerDiplomacy()

Source:

checkEvents()

Source:

checkRequestedTributes()

Source:

checkSentDiplomacyRequests()

Source:

handleDiplomacyRequest()

Do not become allies with a player if the game would be over. Overall, be reluctant to become allies with any one player, but be more likely to accept neutral requests.
Source:

init()

If there are any players that are allied/neutral with us but we are not allied/neutral with them, treat this situation like an ally/neutral request.
Source:

lastManStandingCheck()

If the "Last Man Standing" option is enabled, check if the only remaining players are allies or neutral. If so, turn against the strongest first, but be more likely to first turn against neutral players, if there are any.
Source:

sendDiplomacyRequest()

Try to become allies with a player who has a lot of mutual enemies in common with us. TODO: Possibly let human players demand tributes from AIs who send diplomacy requests.
Source:

tributes()

Check if any allied needs help (tribute) and sent it if we have enough resource or ask for a tribute if we are in need and one ally can help
Source:

update()

Source: