Skip to content

Commit

Permalink
Tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
KJeff01 committed Oct 20, 2020
1 parent 0878a24 commit 42926d4
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 43 deletions.
6 changes: 4 additions & 2 deletions multiplay/skirmish/Cobra.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,27 @@ const ESSENTIALS = [
"R-Struc-Research-Upgrade01",
"R-Vehicle-Prop-Halftracks",
"R-Vehicle-Body05",
"R-Wpn-MG-Damage03",
];
const ESSENTIALS_2 = [
"R-Vehicle-Metals02",
"R-Cyborg-Metals02",
"R-Struc-RprFac-Upgrade01",
"R-Wpn-MG3Mk1",
"R-Sys-Autorepair-General",
"R-Struc-Research-Upgrade09",
"R-Struc-Power-Upgrade03a",
"R-Struc-Factory-Upgrade09",
];
const ESSENTIALS_3 = [
"R-Sys-Sensor-Upgrade01",
"R-Vehicle-Prop-Hover",
"R-Sys-Sensor-Upgrade01",
];
const SYSTEM_UPGRADES = [
"R-Sys-MobileRepairTurretHvy",
"R-Vehicle-Prop-Tracks",
"R-Struc-RprFac-Upgrade06",
"R-Sys-Sensor-Upgrade03",
"R-Sys-Resistance-Circuits",
];
const FLAMER = [
"R-Wpn-Flame2",
Expand All @@ -79,6 +80,7 @@ const SENSOR_TECH = [
"R-Sys-Sensor-WSTower",
"R-Sys-Sensor-UpLink",
"R-Wpn-LasSat",
"R-Sys-Resistance-Circuits",
];
const DEFENSE_UPGRADES = [
"R-Struc-Materials09",
Expand Down
2 changes: 1 addition & 1 deletion multiplay/skirmish/cobra_includes/adaption.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function switchOffMG()

function useLasersForCyborgControl()
{
return getResearch("R-Struc-Research-Upgrade08").done;
return getResearch("R-Struc-Research-Upgrade07").done;
}

function playerCyborgRatio(player)
Expand Down
32 changes: 11 additions & 21 deletions multiplay/skirmish/cobra_includes/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function lookForOil()
//Ok, most oils are already owned so go ahead and defend all derricks from now one
forceDerrickBuildDefense = true;
}
if (!highOilMap() && forceDerrickBuildDefense)
if (mapOilLevel() !== "NTW" && forceDerrickBuildDefense)
{
protectUnguardedDerricks();
}
Expand Down Expand Up @@ -612,41 +612,31 @@ function buildBaseStructures()
{
var haveAllies = (alliancesType === ALLIANCES_TEAMS) && (playerAlliance(true).length > 0);

if (getRealPower() < 500 && countAndBuild(structures.gen, 5))
if (getRealPower() < 550 && countAndBuild(structures.gen, 5))
{
return true; //a little fail-safe
}
if (countAndBuild(FACTORY, 2))
{
return true;
}
if (haveAllies)
if (!researchComplete && countAndBuild(structures.lab, haveAllies ? 3 : 5))
{
if (!researchComplete && countAndBuild(structures.lab, 3))
{
return true;
}
if (countAndBuild(FACTORY, 3))
{
return true;
}
return true;
}
else
if (countAndBuild(structures.gen, 1))
{
if (!researchComplete && countAndBuild(structures.lab, 5))
{
return true;
}
if (countAndBuild(FACTORY, 3))
{
return true;
}
return true; //a little fail-safe
}
if (countAndBuild(FACTORY, 3))
{
return true;
}
if (countAndBuild(structures.hq, 1))
{
return true;
}
if (GOOD_POWER_LEVEL && countAndBuild(CYBORG_FACTORY, 3))
if (countAndBuild(CYBORG_FACTORY, 3))
{
return true;
}
Expand Down
8 changes: 4 additions & 4 deletions multiplay/skirmish/cobra_includes/research.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ function research()
{
antiCyborgChance = 35;
}
if (antiCyborgChance > 0 && antiCyborgChance < 8)
if (antiCyborgChance > 0 && antiCyborgChance < 10)
{
antiCyborgChance = 8; //just in case...
antiCyborgChance = 10; //just in case...
}

for (var i = 0, a = labList.length; i < a; ++i)
Expand Down Expand Up @@ -374,9 +374,9 @@ function research()
}
}

if (!found && random(100) < 35)
if (!found && random(100) < 33)
found = evalResearch(lab, weaponTech);
if (!found && !turnOffCyborgs && getResearch("R-Struc-Research-Upgrade04").done && random(100) < 15)
if (!found && !turnOffCyborgs && getResearch("R-Struc-Research-Upgrade04").done && random(100) < 20)
found = evalResearch(lab, cyborgWeaps);
if (!found && random(100) < 60)
found = evalResearch(lab, extraTech);
Expand Down
39 changes: 24 additions & 15 deletions multiplay/skirmish/cobra_includes/tactics.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function recycleForHover()
{
return;
}
if (highOilMap() && (!startAttacking || (gameTime < 900000) || (countDroid(DROID_ANY, me) < 100)))
if (highOilMap() && (!startAttacking || (gameTime < 900000) || (countDroid(DROID_ANY, me) < 75)))
{
return; //wait
}
Expand Down Expand Up @@ -573,7 +573,7 @@ function enemyUnitsInBase()
var high = highOilMap();

if (!startAttacking &&
((gameTime > high ? 600000 : 300000) || (enemyUnits.length > high ? 20 : 8)) &&
((gameTime > high ? 900000 : 300000) && (enemyUnits.length > high ? 20 : 8)) &&
enemyUnits[0].droidType !== DROID_CONSTRUCT &&
enemyUnits[0].droidType !== DROID_SENSOR)
{
Expand Down Expand Up @@ -626,13 +626,11 @@ function donateSomePower()
//Have Cobra sit and wait and build up a small army before starting attack tactics.
function haveEnoughUnitsForFirstAttack()
{
var highOil = highOilMap();

if (!startAttacking)
{
var amountOfAttackers = groupSize(attackGroup) + groupSize(artilleryGroup) + groupSize(vtolGroup);
// These amounts of units will build up in base if unprovoked
startAttacking = amountOfAttackers >= (highOil ? 120 : 20);
startAttacking = amountOfAttackers >= (highOilMap() ? 120 : 20);
}

return startAttacking;
Expand All @@ -658,19 +656,30 @@ function baseShuffleDefensePattern()
{x1: area.x2 - 20, x2: area.x2, y1: area.y1, y2: area.y2,},
{x1: area.x1, x2: area.x2, y1: area.y2 - 20, y2: area.y2,},
];
var sector = quad[random(quad.length)];
var x = sector.x1 + random(sector.x2);
var y = sector.y1 + random(sector.y2);

if (x <= 2)
{
x = 2;
}
else if (x >= mapWidth - 2)
{
x = mapWidth - 2;
}
if (y <= 2)
{
y = 2;
}
else if (y >= mapHeight - 2)
{
y = mapHeight - 2;
}
// Given that the base area has an additional 20 tiles of territory around the furthest base structure in a rectangel/square
// we can safely tell units to go into this territory zone to keep trucks from being obstructed, maybe.
for (var i = 0, len = attackers.length; i < len; ++i)
{
var sector = quad[random(quad.length)];
var x = sector.x1 + random(sector.x2);
var y = sector.y1 + random(sector.y2);

if (x <= 2) { x = 2; }
else if (x >= mapWidth - 2) { x = mapWidth - 2; }
if (y <= 2) { y = 2; }
else if (y >= mapHeight - 2) { y = mapHeight - 2; }

orderDroidLoc(attackers[i], DORDER_SCOUT, x, y);
}

Expand Down Expand Up @@ -712,7 +721,7 @@ function shouldCobraAttack()
{
return true;
}
else
else if (!startAttacking)
{
if (highOilMap())
{
Expand Down
1 change: 1 addition & 0 deletions multiplay/skirmish/cobra_rulesets/CobraStandard.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const weaponStats =
// Extra things to research on this path, even if they don't lead to any new stuff
extras: [
"R-Wpn-MG-Damage08",
"R-Wpn-MG-ROF03",
],
},
flamers:
Expand Down

0 comments on commit 42926d4

Please sign in to comment.