Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/config.js
Show All 13 Lines | PETRA.Config = function(difficulty, behavior) | ||||
this.popScaling = 1; // scale factor depending on the max population | this.popScaling = 1; // scale factor depending on the max population | ||||
this.Military = { | this.Military = { | ||||
"towerLapseTime": 90, // Time to wait between building 2 towers | "towerLapseTime": 90, // Time to wait between building 2 towers | ||||
"fortressLapseTime": 390, // Time to wait between building 2 fortresses | "fortressLapseTime": 390, // Time to wait between building 2 fortresses | ||||
"popForBarracks1": 25, | "popForBarracks1": 25, | ||||
"popForBarracks2": 95, | "popForBarracks2": 95, | ||||
"popForBlacksmith": 65, | "popForBlacksmith": 65, | ||||
"numSentryTowers": 1 | "numSmallTowers": 1 | ||||
}; | }; | ||||
// Define damage type importance factors here. | // Define damage type importance factors here. | ||||
this.DamageTypeImportance = { | this.DamageTypeImportance = { | ||||
"Hack": 0.085, | "Hack": 0.085, | ||||
"Pierce": 0.075, | "Pierce": 0.075, | ||||
"Crush": 0.065 | "Crush": 0.065 | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | PETRA.Config.prototype.setConfig = function(gameState) | ||||
this.Military.towerLapseTime = Math.round(this.Military.towerLapseTime * (1.1 - 0.2 * this.personality.defensive)); | this.Military.towerLapseTime = Math.round(this.Military.towerLapseTime * (1.1 - 0.2 * this.personality.defensive)); | ||||
this.Military.fortressLapseTime = Math.round(this.Military.fortressLapseTime * (1.1 - 0.2 * this.personality.defensive)); | this.Military.fortressLapseTime = Math.round(this.Military.fortressLapseTime * (1.1 - 0.2 * this.personality.defensive)); | ||||
this.priorities.defenseBuilding = Math.round(this.priorities.defenseBuilding * (0.9 + 0.2 * this.personality.defensive)); | this.priorities.defenseBuilding = Math.round(this.priorities.defenseBuilding * (0.9 + 0.2 * this.personality.defensive)); | ||||
if (this.difficulty < 2) | if (this.difficulty < 2) | ||||
{ | { | ||||
this.Economy.supportRatio = 0.5; | this.Economy.supportRatio = 0.5; | ||||
this.Economy.provisionFields = 1; | this.Economy.provisionFields = 1; | ||||
this.Military.numSentryTowers = this.personality.defensive > this.personalityCut.strong ? 1 : 0; | this.Military.numSmallTowers = this.personality.defensive > this.personalityCut.strong ? 1 : 0; | ||||
} | } | ||||
else if (this.difficulty < 3) | else if (this.difficulty < 3) | ||||
{ | { | ||||
this.Economy.supportRatio = 0.4; | this.Economy.supportRatio = 0.4; | ||||
this.Economy.provisionFields = 1; | this.Economy.provisionFields = 1; | ||||
this.Military.numSentryTowers = this.personality.defensive > this.personalityCut.strong ? 1 : 0; | this.Military.numSmallTowers = this.personality.defensive > this.personalityCut.strong ? 1 : 0; | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (this.difficulty == 3) | if (this.difficulty == 3) | ||||
this.Military.numSentryTowers = 1; | this.Military.numSmallTowers = 1; | ||||
else | else | ||||
this.Military.numSentryTowers = 2; | this.Military.numSmallTowers = 2; | ||||
if (this.personality.defensive > this.personalityCut.strong) | if (this.personality.defensive > this.personalityCut.strong) | ||||
++this.Military.numSentryTowers; | ++this.Military.numSmallTowers; | ||||
else if (this.personality.defensive < this.personalityCut.weak) | else if (this.personality.defensive < this.personalityCut.weak) | ||||
--this.Military.numSentryTowers; | --this.Military.numSmallTowers; | ||||
if (this.personality.aggressive > this.personalityCut.strong) | if (this.personality.aggressive > this.personalityCut.strong) | ||||
{ | { | ||||
this.Military.popForBarracks1 = 12; | this.Military.popForBarracks1 = 12; | ||||
this.Economy.popPhase2 = 50; | this.Economy.popPhase2 = 50; | ||||
this.priorities.healer = 10; | this.priorities.healer = 10; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator