Skip to content

Commit

Permalink
30% less attackers on Jebel Barkal and leave more time between attack…
Browse files Browse the repository at this point in the history
…er waves in later stages of the game.

git-svn-id: https://svn.wildfiregames.com/public/ps/trunk@21797 3db68df2-c116-0410-a063-a993310a9797
  • Loading branch information
elexis committed Apr 28, 2018
1 parent e2b71ed commit 398dfc4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions binaries/data/mods/public/maps/random/jebel_barkal_triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ var jebelBarkal_cityPatrolGroup_balancing = {

/**
* Frequently the buildings spawn different units that attack the players groupwise.
* Leave more time between the attacks in later stages of the game since the attackers become much stronger over time.
*/
var jebelBarkal_attackInterval = () => randFloat(5, 7);
var jebelBarkal_attackInterval = (time, difficulty) => randFloat(5, 7) + time / difficulty / 4;

/**
* Prevent city patrols chasing the starting units in nomad mode.
Expand All @@ -117,15 +118,15 @@ var jebelBarkal_firstCityPatrolTime = (difficulty, isNomad) =>
* Delay the first attack in nomad mode.
*/
var jebelBarkal_firstAttackTime = (difficulty, isNomad) =>
jebelBarkal_attackInterval() +
jebelBarkal_attackInterval(0, difficulty) +
2 * Math.max(0, 3 - difficulty) +
(isNomad ? 9 - difficulty : 0);

/**
* Account for varying mapsizes and number of players when spawning attackers.
*/
var jebelBarkal_attackerGroup_sizeFactor = (numPlayers, numInitialSpawnPoints, difficulty) =>
numPlayers / numInitialSpawnPoints * difficulty;
numPlayers / numInitialSpawnPoints * difficulty * 0.7;

/**
* Assume gaia to be the native kushite player.
Expand Down Expand Up @@ -509,10 +510,10 @@ Trigger.prototype.JebelBarkal_SpawnAttackerGroups = function()
if (!this.jebelBarkal_attackerGroupSpawnPoints)
return;

this.JebelBarkal_StartAttackTimer(jebelBarkal_attackInterval());
let time = TriggerHelper.GetMinutes();
this.JebelBarkal_StartAttackTimer(jebelBarkal_attackInterval(time, this.GetDifficulty()));

this.debugLog("Attacker wave (at most " + (jebelBarkal_maxPopulation - this.jebelBarkal_attackerUnits.length) + " attackers)");
let time = TriggerHelper.GetMinutes();

let activePlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetActivePlayers();
let playerEntities = activePlayers.map(playerID =>
Expand Down

0 comments on commit 398dfc4

Please sign in to comment.