Index: binaries/data/mods/public/simulation/ai/petra/chatHelper.js =================================================================== --- binaries/data/mods/public/simulation/ai/petra/chatHelper.js +++ binaries/data/mods/public/simulation/ai/petra/chatHelper.js @@ -80,14 +80,20 @@ markForTranslation("%(_player_)s, consider us allies from now on.") ], "acceptWithTribute": [ - markForTranslation("I will ally with you, %(_player_)s, but only if you send me a tribute of %(_amount_)s %(_resource_)s."), - markForTranslation("%(_player_)s, you must send me a tribute of %(_amount_)s %(_resource_)s before I accept an alliance with you."), - markForTranslation("Unless you send me %(_amount_)s %(_resource_)s, an alliance won’t be formed, %(_player_)s,") + n => markForPluralTranslation("I will ally with you, %(_player_)s, but only if you send me a tribute of %(_amount_)s %(_resource_)s.", + "I will ally with you, %(_player_)s, but only if you send me a tribute of %(_amount_)s %(_resource_)s.", n), + n => markForPluralTranslation("%(_player_)s, you must send me a tribute of %(_amount_)s %(_resource_)s before I accept an alliance with you.", + "%(_player_)s, you must send me a tribute of %(_amount_)s %(_resource_)s before I accept an alliance with you.", n), + n => markForPluralTranslation("Unless you send me %(_amount_)s %(_resource_)s, an alliance won’t be formed, %(_player_)s,", + "Unless you send me %(_amount_)s %(_resource_)s, an alliance won’t be formed, %(_player_)s,", n) ], "waitingForTribute": [ - markForTranslation("%(_player_)s, my offer still stands. I will ally with you only if you send me a tribute of %(_amount_)s %(_resource_)s."), - markForTranslation("I’m still waiting for %(_amount_)s %(_resource_)s before accepting your alliance, %(_player_)s."), - markForTranslation("%(_player_)s, if you do not send me part of the %(_amount_)s %(_resource_)s tribute soon, I will break off our negotiations.") + n => markForPluralTranslation("%(_player_)s, my offer still stands. I will ally with you only if you send me a tribute of %(_amount_)s %(_resource_)s.", + "%(_player_)s, my offer still stands. I will ally with you only if you send me a tribute of %(_amount_)s %(_resource_)s.", n), + n => markForPluralTranslation("I’m still waiting for %(_amount_)s %(_resource_)s before accepting your alliance, %(_player_)s.", + "I’m still waiting for %(_amount_)s %(_resource_)s before accepting your alliance, %(_player_)s.", n), + n => markForPluralTranslation("%(_player_)s, if you do not send me part of the %(_amount_)s %(_resource_)s tribute soon, I will break off our negotiations.", + "%(_player_)s, if you do not send me part of the %(_amount_)s %(_resource_)s tribute soon, I will break off our negotiations.", n) ] }, "neutral": { @@ -103,12 +109,16 @@ markForTranslation("%(_player_)s, I will accept your neutrality request. May both our civilizations benefit.") ], "acceptWithTribute": [ - markForTranslation("If you send me a tribute of %(_amount_)s %(_resource_)s, I will accept your neutrality request, %(_player_)s."), - markForTranslation("%(_player_)s, if you send me %(_amount_)s %(_resource_)s, I will accept a neutrality pact.") + n => markForPluralTranslation("If you send me a tribute of %(_amount_)s %(_resource_)s, I will accept your neutrality request, %(_player_)s.", + "If you send me a tribute of %(_amount_)s %(_resource_)s, I will accept your neutrality request, %(_player_)s.", n), + n => markForPluralTranslation("%(_player_)s, if you send me %(_amount_)s %(_resource_)s, I will accept a neutrality pact.", + "%(_player_)s, if you send me %(_amount_)s %(_resource_)s, I will accept a neutrality pact.", n) ], "waitingForTribute": [ - markForTranslation("%(_player_)s, I will not accept your neutrality request unless you tribute me %(_amount_)s %(_resource_)s soon."), - markForTranslation("%(_player_)s, if you do not send me part of the %(_amount_)s %(_resource_)s tribute soon, I will break off our negotiations.") + n => markForPluralTranslation("%(_player_)s, I will not accept your neutrality request unless you tribute me %(_amount_)s %(_resource_)s soon.", + "%(_player_)s, I will not accept your neutrality request unless you tribute me %(_amount_)s %(_resource_)s soon.", n), + n => markForPluralTranslation("%(_player_)s, if you do not send me part of the %(_amount_)s %(_resource_)s tribute soon, I will break off our negotiations.", + "%(_player_)s, if you do not send me part of the %(_amount_)s %(_resource_)s tribute soon, I will break off our negotiations.", n) ] } }; @@ -214,10 +224,12 @@ m.chatAnswerRequestDiplomacy = function(gameState, player, requestType, response, requiredTribute) { + response = pickRandom(this.answerDiplomacyRequestMessages[requestType][response]); + if (requiredTribute) + response = response(requiredTribute.wanted); Engine.PostCommand(PlayerID, { "type": "aichat", - "message": "/msg " + gameState.sharedScript.playersData[player].name + " " + - pickRandom(this.answerDiplomacyRequestMessages[requestType][response]), + "message": "/msg " + gameState.sharedScript.playersData[player].name + " " + response, "translateMessage": true, "translateParameters": requiredTribute ? ["_amount_", "_resource_", "_player_"] : ["_player_"], "parameters": requiredTribute ?