GameEvents.GetScenarioDiploModifier1 (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of GameEvents.

This is a static method, invoke it with a dot.

  • This method was added in Gods & Kings.


Usage

void GameEvents.GetScenarioDiploModifier1(PlayerID player1, PlayerID player2)


Event Type

Unknown

Parameters

player1: No description available.
player2: No description available.


Source code samples

TurnsRemaining.lua (G&K)

DLC/Expansion/Scenarios/MedievalScenario/TurnsRemaining.lua
0457
GameEvents.GetScenarioDiploModifier1.Add(function(ePlayer1, ePlayer2)
0459
local eReligion1;
0460
local eReligion2;
0462
eReligion1 = MyCurrentReligion(ePlayer1);
0463
eReligion2 = MyCurrentReligion(ePlayer2);
0465
if (eReligion1 ~= eReligion2) then
0466
return 60;
0467
else
0468
return 0;
0469
end
0470
end)
0473
-- GetFounderBenefitsReligion
0475
function OnGetFounderBenefitsReligion(ePlayer)


TurnsRemaining.lua (G&K)

DLC/Expansion/Scenarios/SteampunkScenario/TurnsRemaining.lua
0537
GameEvents.GetScenarioDiploModifier1.Add(function(ePlayer1, ePlayer2)
0539
if (GetNumTokensOwned(ePlayer2) == 2) then
0540
return 20;
0541
end
0543
return 0;
0544
end)
0546
-- Large negative modifier when other player has more than 2 Titles (about to win)
0547
GameEvents.GetScenarioDiploModifier2.Add(function(ePlayer1, ePlayer2)



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.