Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/extinct_volcano_triggers.js
/** | /** | ||||
* Whether to log the water levels and which units became killed or transformed to visual actors. | * Whether to log the water levels and which units became killed or transformed to visual actors. | ||||
*/ | */ | ||||
var debugLog = false; | var debugLog = false; | ||||
/** | /** | ||||
* Whether to rise the water to the maximum level in a minute or two. | * Whether to rise the water to the maximum level in a minute or two. | ||||
*/ | */ | ||||
var debugWaterRise = false; | var debugWaterRise = false; | ||||
/** | /** | ||||
* Time in minutes when the water level starts to rise. | |||||
* Allow players to build up the economy and military for some time. | |||||
*/ | |||||
var waterRiseStartTime = [22, 26]; | |||||
/** | |||||
* Duration in minutes for which the notification will be shown that states that the water will rise soon. | * Duration in minutes for which the notification will be shown that states that the water will rise soon. | ||||
*/ | */ | ||||
var waterRiseNotificationDuration = 1; | var waterRiseNotificationDuration = 1; | ||||
/** | /** | ||||
* Time in minutes between increases of the water level. | * Time in minutes between increases of the water level. | ||||
* If the water rises too fast, the hills are of no strategic importance, | * If the water rises too fast, the hills are of no strategic importance, | ||||
* building structures would be pointless. | * building structures would be pointless. | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | Trigger.prototype.RaiseWaterLevelStep = function() | ||||
this.DebugLog("Checking entities took " + (cmpTimer.GetTime() - time)); | this.DebugLog("Checking entities took " + (cmpTimer.GetTime() - time)); | ||||
this.DebugLog("Killed: " + uneval(killedTemplates)); | this.DebugLog("Killed: " + uneval(killedTemplates)); | ||||
this.DebugLog("Converted to actors: " + uneval(actorTemplates)); | this.DebugLog("Converted to actors: " + uneval(actorTemplates)); | ||||
}; | }; | ||||
{ | { | ||||
let waterRiseTime = debugWaterRise ? 0 : randFloat(...waterRiseStartTime); | let waterRiseTime = debugWaterRise ? 0 : (InitAttributes.settings.SeaLevelRiseTime || 25); | ||||
let cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); | let cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); | ||||
cmpTrigger.GarrisonWoodenTowers(); | cmpTrigger.GarrisonWoodenTowers(); | ||||
cmpTrigger.DoAfterDelay((waterRiseTime - waterRiseNotificationDuration) * 60 * 1000, "RaisingWaterNotification", {}); | cmpTrigger.DoAfterDelay((waterRiseTime - waterRiseNotificationDuration) * 60 * 1000, "RaisingWaterNotification", {}); | ||||
cmpTrigger.DoAfterDelay(waterRiseTime * 60 * 1000, "RaiseWaterLevelStep", {}); | cmpTrigger.DoAfterDelay(waterRiseTime * 60 * 1000, "RaiseWaterLevelStep", {}); | ||||
} | } |
Wildfire Games · Phabricator