TechpriestEnginseer / Community-Patch-Events-Development

If you are interested in joining or have any issues. Leave me a PM or post in the issue tab.
GNU General Public License v3.0
2 stars 2 forks source link

Restricting Events to ArtStyle #18

Closed TechpriestEnginseer closed 8 years ago

TechpriestEnginseer commented 8 years ago

An event can be restricted to a certain ArtStyle meaning other civilization mods can have this event if their artstyle matches appropriately. This sample shows that if you are not a European civilization, The Death of a Great Merchant Event cannot be given.

function ArtEventsCanTake(iPlayer, iEvent)
    local pPlayer = Players[iPlayer]
    local ArtStyle = GameInfo.Civilizations[pPlayer:GetCivilizationType()].ArtStyleType 
    if not(ArtStyle == "ARTSTYLE_EUROPEAN") then
        if iEvent == GameInfoTypes.PLAYER_EVENT_DEATH_OF_A_GREAT_MERCHANT then
            return false
        end
    return true
end
GameEvents.EventCanTake(ArtEventsCanTake)