From 0b0fb8838a99fdece91f3488b69f484bfcd574e3 Mon Sep 17 00:00:00 2001 From: elexis Date: Fri, 23 Mar 2018 15:12:35 +0000 Subject: [PATCH] Delay the first Napata attack on nomad mode by 4 minutes. This was SVN commit r21609. --- .../maps/random/jebel_barkal_triggers.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js b/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js index 31acabba61..a2c3aad4b4 100644 --- a/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js +++ b/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js @@ -97,7 +97,14 @@ var jebelBarkal_cityPatrolGroup_balancing = { /** * Frequently the buildings spawn different units that attack the players groupwise. */ -var jebelBarkal_attackInterval = time => randFloat(5, 7); +var jebelBarkal_attackInterval = () => randFloat(5, 7); + +/** + * Delay the first attack in nomad mode. + */ +var jebelBarkal_firstAttackTime = () => + jebelBarkal_attackInterval() + + (TriggerHelper.GetAllPlayersEntitiesByClass("CivCentre").length ? 4 : 0); /** * Assume gaia to be the native kushite player. @@ -341,7 +348,7 @@ Trigger.prototype.JebelBarkal_Init = function() this.JebelBarkal_StartRitualAnimations(); this.JebelBarkal_GarrisonBuildings(); this.JebelBarkal_SpawnCityPatrolGroups(); - this.JebelBarkal_SpawnAttackerGroups(); + this.JebelBarkal_StartAttackTimer(jebelBarkal_firstAttackTime()); }; Trigger.prototype.JebelBarkal_TrackUnits = function() @@ -537,7 +544,12 @@ Trigger.prototype.JebelBarkal_SpawnAttackerGroups = function() "translateMessage": true }); - let nextAttack = jebelBarkal_attackInterval(TriggerHelper.GetMinutes()) * 60 * 1000; + this.JebelBarkal_StartAttackTimer(jebelBarkal_attackInterval()); +}; + +Trigger.prototype.JebelBarkal_StartAttackTimer = function(delay) +{ + let nextAttack = delay * 60 * 1000; Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface).AddTimeNotification({ "message": markForTranslation("Napata will attack in %(time)s!"),