diff --git a/multiplay/skirmish/Cobra.js b/multiplay/skirmish/Cobra.js index 2d5af7e..6115160 100644 --- a/multiplay/skirmish/Cobra.js +++ b/multiplay/skirmish/Cobra.js @@ -35,17 +35,18 @@ const ESSENTIALS = [ "R-Sys-Engineering01", "R-Defense-Tower01", "R-Struc-PowerModuleMk1", - "R-Struc-Power-Upgrade03a", - "R-Struc-Research-Upgrade09", - "R-Sys-Autorepair-General", + "R-Struc-Research-Upgrade01", ]; const ESSENTIALS_2 = [ "R-Vehicle-Prop-Halftracks", "R-Struc-RprFac-Upgrade01", "R-Sys-Sensor-Upgrade01", "R-Vehicle-Body11", - "R-Struc-Factory-Upgrade09", + "R-Struc-Power-Upgrade03a", + "R-Struc-Research-Upgrade09", + "R-Sys-Autorepair-General", "R-Vehicle-Prop-Hover", + "R-Struc-Factory-Upgrade09", ]; const SYSTEM_UPGRADES = [ "R-Vehicle-Body12", diff --git a/multiplay/skirmish/cobra_includes/build.js b/multiplay/skirmish/cobra_includes/build.js index 2c69795..64e7269 100644 --- a/multiplay/skirmish/cobra_includes/build.js +++ b/multiplay/skirmish/cobra_includes/build.js @@ -377,7 +377,7 @@ function returnDefense(type) var bestDefense = "Emplacement-MortarEMP"; //default //Choose a random electronic warfare defense if possible. - if (random(101) < ELECTRONIC_CHANCE) + if (random(100) < ELECTRONIC_CHANCE) { var avail = 0; for (var i = 0, t = ELECTRONIC_DEFENSES.length; i < t; ++i) @@ -627,7 +627,7 @@ function buildExtras() } var gens = countStruct(structures.gens); - if (getRealPower() > MIN_POWER && countStruct(structures.extras[0]) < 5 && countAndBuild(structures.extras[0], gens + 1)) + if (getRealPower() > SUPER_LOW_POWER && countStruct(structures.extras[0]) < 5 && countAndBuild(structures.extras[0], gens + 1)) { return true; } diff --git a/multiplay/skirmish/cobra_includes/events.js b/multiplay/skirmish/cobra_includes/events.js index 4788538..65d016a 100644 --- a/multiplay/skirmish/cobra_includes/events.js +++ b/multiplay/skirmish/cobra_includes/events.js @@ -55,7 +55,7 @@ function eventStartLevel() recycleForHover(); buildOrders(); //Start building right away. - + setTimer("buildOrders", 300); setTimer("produce", 400); setTimer("checkAllForRepair", 600); @@ -97,7 +97,7 @@ function eventStructureBuilt(structure, droid) return ((obj.type === STRUCTURE) && (obj.stattype === DEFENSE)); }); - if ((gameTime > 120000) && (random(101) < subPersonalities[personality].defensePriority)) + if ((gameTime > 120000) && (random(100) < subPersonalities[personality].defensePriority)) { protectUnguardedDerricks(droid); } diff --git a/multiplay/skirmish/cobra_includes/production.js b/multiplay/skirmish/cobra_includes/production.js index ec56131..1ea2fb1 100644 --- a/multiplay/skirmish/cobra_includes/production.js +++ b/multiplay/skirmish/cobra_includes/production.js @@ -63,7 +63,7 @@ function chooseWeaponType(weaps) { var weaponType = weaps; - if (isDefined(weaps.fastFire) && (random(101) < 50)) + if (isDefined(weaps.fastFire) && (random(100) < 50)) { weaponType = weaps.fastFire; } @@ -139,7 +139,7 @@ function choosePersonalityWeapon(type) weaponList = shuffleWeaponList(chooseWeaponType(weaps)); //on hard difficulty and above. - if (componentAvailable("tracked01") && (random(101) <= 1)) + if (componentAvailable("tracked01") && (random(100) <= 1)) { if((difficulty === HARD) || (difficulty === INSANE)) { @@ -200,18 +200,18 @@ function useHover(weap) if ((NAME === "Rocket-LtA-T") || (NAME === "Rocket-HvyA-T") || (NAME === "Missile-A-T")) { - useHover = (random(101) <= 75); + useHover = (random(100) <= 75); break; } if ((NAME === "Laser3BEAMMk1") || (NAME === "Laser2PULSEMk1") || (NAME === "HeavyLaser")) { - useHover = (random(101) <= 55); + useHover = (random(100) <= 55); break; } } - return (((useHover === true) || (random(101) <= 15)) && (weap[0] !== "Laser4-PlasmaCannon")); + return (((useHover === true) || (random(100) <= 15)) && (weap[0] !== "Laser4-PlasmaCannon")); } //Choose our ground propulsion. Non-hover units will have a preference for tracks. @@ -229,7 +229,7 @@ function pickPropulsion(weap) "wheeled01", // wheels ]; - if ((random(101) < 45) || (gameTime < TIME_FOR_HALF_TRACKS)) + if ((random(100) < 45) || (gameTime < TIME_FOR_HALF_TRACKS)) { tankProp.shift(); } diff --git a/multiplay/skirmish/cobra_includes/research.js b/multiplay/skirmish/cobra_includes/research.js index 1e85895..3894854 100644 --- a/multiplay/skirmish/cobra_includes/research.js +++ b/multiplay/skirmish/cobra_includes/research.js @@ -77,13 +77,13 @@ function research() for (var i = 0, a = labList.length; i < a; ++i) { var lab = labList[i]; - var found = !random(4) && evalResearch(lab, ESSENTIALS); + var found = evalResearch(lab, ESSENTIALS); if (!found && forceHover) found = pursueResearch(lab, "R-Vehicle-Prop-Hover"); if (!found) found = evalResearch(lab, techlist); - if (!found && !random(4)) + if (!found && random(100) < 25) found = evalResearch(lab, ESSENTIALS_2); if (!found && getRealPower() > MIN_POWER) @@ -93,11 +93,11 @@ function research() if (subPersonalities[personality].resPath === "generic") { - if (!found && !random(3)) + if (!found && random(100) < 33) found = evalResearch(lab, extraTech); //Use default AA until stormbringer. - if (!random(2) && countEnemyVTOL() && !isStructureAvailable("P0-AASite-Laser")) + if (random(100) < 50 && countEnemyVTOL() && !isStructureAvailable("P0-AASite-Laser")) { if (!found) found = evalResearch(lab, antiAirTech); @@ -107,9 +107,9 @@ function research() if (!found && !turnOffCyborgs) found = evalResearch(lab, cyborgWeaps); - if (!found && !random(2)) + if (!found && random(100) < 50) found = evalResearch(lab, weaponTech); - if (!found && useArti && !random(2)) + if (!found && useArti && random(100) < 50) found = evalResearch(lab, artilleryTech); if (!found) @@ -117,7 +117,7 @@ function research() if (!found) found = evalResearch(lab, LATE_EARLY_GAME_TECH); - if (!found && (random(101) < subPersonalities[personality].alloyPriority)) + if (!found && (random(100) < subPersonalities[personality].alloyPriority)) { if (!turnOffCyborgs && countStruct(CYBORG_FACTORY) && random(2)) found = evalResearch(lab, CYBORG_ARMOR); @@ -131,7 +131,7 @@ function research() found = evalResearch(lab, artillExtra); - if (!found && (random(101) < subPersonalities[personality].defensePriority)) + if (!found && (random(100) < subPersonalities[personality].defensePriority)) { found = evalResearch(lab, standardDefenseTech); if (!found && useArti) @@ -152,13 +152,13 @@ function research() found = evalResearch(lab, secondaryWeaponTech); } - if (!found && useVtol && (random(101) < subPersonalities[personality].vtolPriority)) + if (!found && useVtol && (random(100) < subPersonalities[personality].vtolPriority)) found = evalResearch(lab, VTOL_RES); } else if (subPersonalities[personality].resPath === "defensive") { //Use default AA until stormbringer. - if (!random(2) && countEnemyVTOL() && !isStructureAvailable("P0-AASite-Laser")) + if (random(100) < 50 && countEnemyVTOL() && !isStructureAvailable("P0-AASite-Laser")) { if (!found) found = evalResearch(lab, antiAirTech); @@ -178,7 +178,7 @@ function research() if (!found) found = evalResearch(lab, LATE_EARLY_GAME_TECH); - if (!found && random(2) && useArti) + if (!found && random(100) < 50 && useArti) found = evalResearch(lab, artillExtra); if (!found) found = evalResearch(lab, SYSTEM_UPGRADES); @@ -198,7 +198,7 @@ function research() found = evalResearch(lab, TANK_ARMOR); } - if (!found && useVtol && (random(101) < subPersonalities[personality].vtolPriority)) + if (!found && useVtol && (random(100) < subPersonalities[personality].vtolPriority)) found = evalResearch(lab, VTOL_RES); if (!found) @@ -227,9 +227,9 @@ function research() if (!found && !turnOffCyborgs && random(2)) found = evalResearch(lab, cyborgWeaps); - if (!found && random(2)) + if (!found && random(100) < 50) found = evalResearch(lab, weaponTech); - if (!found && useArti && random(2)) + if (!found && useArti && random(100) < 50) found = evalResearch(lab, artilleryTech); if (!found) @@ -238,7 +238,7 @@ function research() found = evalResearch(lab, LATE_EARLY_GAME_TECH); //Use default AA until stormbringer. - if (!random(2) && countEnemyVTOL() && !isStructureAvailable("P0-AASite-Laser")) + if (random(100) < 50 && countEnemyVTOL() && !isStructureAvailable("P0-AASite-Laser")) { if (!found) found = evalResearch(lab, antiAirTech); @@ -251,10 +251,10 @@ function research() if (!found && useArti) found = evalResearch(lab, artilleryTech); - if (!found && useVtol && (random(101) < subPersonalities[personality].vtolPriority)) + if (!found && useVtol && (random(100) < subPersonalities[personality].vtolPriority)) found = evalResearch(lab, VTOL_RES); - if (!found && (random(101) < 70)) + if (!found && (random(100) < 70)) { if (!turnOffCyborgs && countStruct(CYBORG_FACTORY) && random(2)) { @@ -279,7 +279,7 @@ function research() if (!found) found = evalResearch(lab, SENSOR_TECH); - if (!found && ((random(101) < subPersonalities[personality].defensePriority))) + if (!found && ((random(100) < subPersonalities[personality].defensePriority))) { found = evalResearch(lab, standardDefenseTech); if (!found && useArti) @@ -293,13 +293,13 @@ function research() if (!useVtol) useVtol = true; - if (!found && !random(2)) + if (!found && random(100) < 50) found = evalResearch(lab, extraTech); - if (!found && useArti && !random(2)) + if (!found && useArti && random(100) < 50) found = evalResearch(lab, artilleryTech); //Use default AA until stormbringer. - if (!random(2) && countEnemyVTOL() && !isStructureAvailable("P0-AASite-Laser")) + if (random(100) < 50 && countEnemyVTOL() && !isStructureAvailable("P0-AASite-Laser")) { if (!found) found = evalResearch(lab, antiAirTech); @@ -322,7 +322,7 @@ function research() if (!found) found = evalResearch(lab, SENSOR_TECH); - if (!found && (random(101) < subPersonalities[personality].alloyPriority)) + if (!found && (random(100) < subPersonalities[personality].alloyPriority)) { if (!turnOffCyborgs && countStruct(CYBORG_FACTORY) && random(2)) { @@ -348,7 +348,7 @@ function research() } - if (!found && (random(101) < subPersonalities[personality].defensePriority)) + if (!found && (random(100) < subPersonalities[personality].defensePriority)) { found = evalResearch(lab, standardDefenseTech); if (!found && useArti)