Permalink
Browse files

Update campaign templates and fix base detection.

Change how group ids are given for campaign. Saveload and newGroup() could cause group ID clashes and trigger events that should not have been triggered (ie. early enemy base detection).

Templates:
Use only one unified body component for campaign cyborgs called
"CyborgLightBody". Also research for cyborg weapons now grants the
weapon instead of the special body component only for that cyborg.
Removed some duplicate cyborgs in production menu.
  • Loading branch information...
KJeff01 committed Sep 9, 2017
1 parent e0f0a42 commit ea1c4ffe61fe6c79a0a46596f127b7e2bb2d2935
@@ -348,7 +348,7 @@ function camMakeGroup(what, filter)
}
if (camDef(array))
{
var group = newGroup();
var group = camNewGroup();
for (var i = 0, l = array.length; i < l; ++i)
{
var o = array[i];
@@ -866,7 +866,7 @@ function camSetEnemyBases(bases)
camDebug("Neither group nor cleanup area found for", blabel);
continue;
}
bi.group = newGroup();
bi.group = camNewGroup();
addLabel({ type: GROUP, id: bi.group }, blabel);
var structs = enumArea(bi.cleanup, ENEMIES, false);
for (var i = 0, l = structs.length; i < l; ++i)
@@ -1433,7 +1433,7 @@ function camOrderToString(order)
}
}
//;; \subsection{camSortByHealth(orbject 1, object 2)}
//;; \subsection{camSortByHealth(object 1, object 2)}
//;; Use this to sort an array of objects by health value.
function camSortByHealth(a, b)
{
@@ -2041,7 +2041,7 @@ function camSetFactoryData(flabel, fdata)
fi.enabled = false;
fi.state = 0;
if (!camDef(fi.group))
fi.group = newGroup();
fi.group = camNewGroup();
for (var i = 0, l = droids.length; i < l; ++i)
{
groupAdd(fi.group, droids[i]);
@@ -2107,7 +2107,7 @@ function __camFactoryUpdateTactics(flabel)
if (droids.length >= fi.groupSize)
{
camManageGroup(fi.group, fi.order, fi.data);
fi.group = newGroup();
fi.group = camNewGroup();
}
else
{
@@ -2730,8 +2730,6 @@ const STRUCTURE_NEUTRALIZE = "strutnut.ogg";
const SYNAPTICS_ACTIVATED = "synplnk.ogg";
const UNIT_ABSORBED = "untabsrd.ogg";
const UNIT_NEUTRALIZE = "untnut.ogg";
var __camLastNexusAttack;
var __camNexusActivated;
//Play a random laugh.
function camNexusLaugh()
@@ -2847,6 +2845,29 @@ function camGetNexusState()
return __camNexusActivated;
}
// privates
var __camLastNexusAttack;
var __camNexusActivated;
////////////////////////////////////////////////////////////////////////////////
// Group numerical ID functionality
////////////////////////////////////////////////////////////////////////////////
//;; \subsection{camNewGroup()}
//;; A saveload safe version of newGroup() so as not to create group ID clashes.
function camNewGroup()
{
if(!camDef(__camNewGroupCounter))
{
__camNewGroupCounter = 0;
}
++__camNewGroupCounter;
return __camNewGroupCounter;
}
// privates
var __camNewGroupCounter;
////////////////////////////////////////////////////////////////////////////////
// Event hooks magic. This makes all the library catch all the necessary events
// without distracting the script authors from handling them on their own.
@@ -2998,6 +3019,7 @@ function cam_eventStartLevel()
__camVtolSpawnActive = false;
__camLastNexusAttack = 0;
__camNexusActivated = false;
__camNewGroupCounter = 0;
setTimer("__camTick", 1000); // campaign pollers
setTimer("__camTruckTick", 40100); // some slower campaign pollers
queue("__camTacticsTick", 100); // would re-queue itself
@@ -31,17 +31,17 @@ npmmct: { body: "Body12SUP", prop: "tracked01", weap: "Cannon2A-TMk1" },
npsbb: { body: "Body8MBT", prop: "HalfTrack", weap: "Rocket-BB" },
// CAM_1_5
npcybc: { body: "CyborgCannonGrd", prop: "CyborgLegs", weap: "CyborgCannon" },
npcybf: { body: "CyborgFlamerGrd", prop: "CyborgLegs", weap: "CyborgFlamer01" },
npcybm: { body: "CyborgChain1Ground", prop: "CyborgLegs", weap: "CyborgChaingun" },
npcybc: { body: "CyborgLightBody", prop: "CyborgLegs", weap: "CyborgCannon" },
npcybf: { body: "CyborgLightBody", prop: "CyborgLegs", weap: "CyborgFlamer01" },
npcybm: { body: "CyborgLightBody", prop: "CyborgLegs", weap: "CyborgChaingun" },
// CAM_1AC
nphct: { body: "Body12SUP", prop: "tracked01", weap: "Cannon375mmMk1" },
npmorb: { body: "Body8MBT", prop: "HalfTrack", weap: "Mortar2Mk1" },
npmsens: { body: "Body8MBT", prop: "HalfTrack", weap: "SensorTurret1Mk1" },
// CAM_1_D
npcybr: { body: "CyborgRkt1Ground", prop: "CyborgLegs", weap: "CyborgRocket" },
npcybr: { body: "CyborgLightBody", prop: "CyborgLegs", weap: "CyborgRocket" },
npltat: { body: "Body4ABT", prop: "HalfTrack", weap: "Rocket-LtA-T" },
nphmgh: { body: "Body8MBT", prop: "hover01", weap: "MG3Mk1" },
npltath: { body: "Body8MBT", prop: "hover01", weap: "Rocket-LtA-T" },
@@ -82,7 +82,7 @@ cohhot: { body: "Body9REC", prop: "tracked01", weap: "Howitzer105Mk1" },
// CAM_2_5
cohhpv: { body: "Body9REC", prop: "tracked01", weap: "Cannon4AUTOMk1" },
comagt: { body: "Body6SUPP", prop: "tracked01", weap: "MG4ROTARYMk1" },
cocybag: { body: "CybRotMgGrd", prop: "CyborgLegs", weap: "CyborgRotMG" },
cocybag: { body: "CyborgLightBody", prop: "CyborgLegs", weap: "CyborgRotMG" },
cohaaq: { body: "Body9REC", prop: "tracked01", weap: "QuadRotAAGun" },
// CAM_2_D
@@ -106,8 +106,8 @@ nxmreph: { body: "Body7ABT", prop: "hover02", weap: "LightRepair1" },
nxlsensh: { body: "Body3MBT", prop: "hover02", weap: "SensorTurret1Mk1" },
nxmrailh: { body: "Body7ABT", prop: "hover02", weap: "RailGun2Mk1" },
nxmscouh: { body: "Body7ABT", prop: "hover02", weap: "Missile-A-T" },
nxcyrail: { body: "Cyb-Bod-Rail1", prop: "CyborgLegs02", weap: "Cyb-Wpn-Rail1" },
nxcyscou: { body: "Cyb-Bod-Atmiss", prop: "CyborgLegs02", weap: "Cyb-Wpn-Atmiss" },
nxcyrail: { body: "CyborgLightBody", prop: "CyborgLegs02", weap: "Cyb-Wpn-Rail1" },
nxcyscou: { body: "CyborgLightBody", prop: "CyborgLegs02", weap: "Cyb-Wpn-Atmiss" },
nxlneedv: { body: "Body3MBT", prop: "V-Tol02", weap: "RailGun1-VTOL" },
nxlscouv: { body: "Body3MBT", prop: "V-Tol02", weap: "Missile-VTOL-AT" },
nxmtherv: { body: "Body7ABT", prop: "V-Tol02", weap: "Bomb4-VTOL-HvyINC" },
@@ -117,7 +117,7 @@ prhaacnt: { body: "Body11ABT", prop: "tracked01", weap: "AAGun2Mk1" },
// CAM_3_1
nxmcommh: { body: "Body7ABT", prop: "hover02", weap: "CommandTurret1" },
nxcylas: { body: "Cyb-Bod-Las1", prop: "CyborgLegs02", weap: "Cyb-Wpn-Laser" },
nxcylas: { body: "CyborgLightBody", prop: "CyborgLegs02", weap: "Cyb-Wpn-Laser" },
// CAM_3_B
nxmlinkh: { body: "Body7ABT", prop: "hover02", weap: "SpyTurret01" },
@@ -1,4 +1,4 @@
//Contains the camapign transition technology definitions.
//Contains the campaign transition technology definitions.
//This array should give a player all the research from Alpha.
const ALPHA_RESEARCH = [
@@ -35,11 +35,9 @@ const ALPHA_TECH = [
"MG2Mk1", "MG3Mk1", "Mortar1Mk1", "Mortar2Mk1", "Rocket-BB", "Rocket-LtA-T",
"Rocket-MRL", "Rocket-Pod", "Cannon1-VTOL", "MG1-VTOL", "MG2-VTOL",
"MG3-VTOL", "Rocket-VTOL-LtA-T", "Rocket-VTOL-Pod", "Rocket-VTOL-BB",
"CyborgFlamer01", "CyborgCannon", "CyborgChaingun", "Cyb-Wpn-Atmiss",
"Cyb-Wpn-Laser", "Cyb-Wpn-Rail1", "CyborgRocket", "CyborgRotMG",
"CyborgFlamer01", "CyborgCannon", "CyborgChaingun", "CyborgRocket",
"CommandTurret1", "Body1REC", "Body5REC", "Body11ABT", "Body4ABT",
"Body8MBT", "Body12SUP", "CyborgCannonGrd", "CyborgFlamerGrd",
"CyborgChain1Ground", "CyborgRkt1Ground", "HalfTrack", "hover01",
"Body8MBT", "Body12SUP", "CyborgLightBody", "HalfTrack", "hover01",
"tracked01", "wheeled01", "Spade1Mk1", "SensorTurret1Mk1",
"CommandBrain01",
];
@@ -76,11 +74,9 @@ const BETA_TECH = [
"MG2Mk1", "MG3Mk1", "Mortar1Mk1", "Mortar2Mk1", "Rocket-BB", "Rocket-LtA-T",
"Rocket-MRL", "Rocket-Pod", "Cannon1-VTOL", "MG1-VTOL", "MG2-VTOL",
"MG3-VTOL", "Rocket-VTOL-LtA-T", "Rocket-VTOL-Pod", "Rocket-VTOL-BB",
"CyborgFlamer01", "CyborgCannon", "CyborgChaingun", "Cyb-Wpn-Atmiss",
"Cyb-Wpn-Laser", "Cyb-Wpn-Rail1", "CyborgRocket", "CyborgRotMG",
"CyborgFlamer01", "CyborgCannon", "CyborgChaingun", "CyborgRocket", "CyborgRotMG",
"CommandTurret1", "Body1REC", "Body5REC", "Body11ABT", "Body4ABT",
"Body8MBT", "Body12SUP", "CyborgCannonGrd", "CyborgFlamerGrd",
"CyborgChain1Ground", "CyborgRkt1Ground", "HalfTrack", "hover01",
"Body8MBT", "Body12SUP", "CyborgLightBody", "HalfTrack", "hover01",
"tracked01", "wheeled01", "Spade1Mk1", "SensorTurret1Mk1",
"CommandBrain01", "V-Tol", "Sys-CBTurret01", "Sys-VstrikeTurret01",
"Sys-VTOLCBTurret01", "Body2SUP", "Body6SUPP", "Body9REC", "AAGun2Mk1",
@@ -128,7 +124,7 @@ const PLAYER_RES_GAMMA = [
"R-Struc-Power-Upgrade01", "R-Sys-Sensor-Upgrade01", "R-Wpn-AAGun-Accuracy02",
"R-Wpn-AAGun-Damage03", "R-Wpn-AAGun-ROF03", "R-Wpn-Bomb-Accuracy02", "R-Wpn-Bomb03",
"R-Wpn-Howitzer-ROF03", "R-Sys-CBSensor-Turret01", "R-Sys-VTOLStrike-Turret01",
"R-Cyborg-Wpn-RotMG-Grd", "R-Defense-AASite-QuadRotMg", "R-Defense-Emplacement-HPVcannon",
"R-Cyborg-Wpn-RotMG", "R-Defense-AASite-QuadRotMg", "R-Defense-Emplacement-HPVcannon",
"R-Defense-Howitzer", "R-Defense-HvyFlamer", "R-Defense-RotMG", "R-Defense-Wall-VulcanCan",
"R-Defense-WallTower-HPVcannon", "R-Defense-HvyHowitzer", "R-Defense-Wall-RotMg",
];
View
@@ -1040,193 +1040,17 @@
"weaponSlots": 1,
"weight": 2000
},
"Cyb-Bod-Atmiss": {
"CyborgLightBody": {
"armourHeat": 6,
"armourKinetic": 12,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 200,
"id": "Cyb-Bod-Atmiss",
"model": "cybd_std.pie",
"name": "*Cyb-Bod-Atmiss*",
"powerOutput": 500,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"Cyb-Bod-Las1": {
"armourHeat": 6,
"armourKinetic": 12,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 200,
"id": "Cyb-Bod-Las1",
"model": "cybd_std.pie",
"name": "*Cyb-Bod-Las1*",
"powerOutput": 500,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"Cyb-Bod-Rail1": {
"armourHeat": 6,
"armourKinetic": 12,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 200,
"id": "Cyb-Bod-Rail1",
"model": "cybd_std.pie",
"name": "*Cyb-Bod-Rail1*",
"powerOutput": 500,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"CybFlamer01CGrd": {
"armourHeat": 6,
"armourKinetic": 12,
"buildPoints": 100,
"buildPower": 25,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 200,
"id": "CybFlamer01CGrd",
"model": "cybd_std.pie",
"name": "*Cyborg Flamer*",
"powerOutput": 600,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"CybNXMissJmp": {
"armourHeat": 15,
"armourKinetic": 18,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 370,
"id": "CybNXMissJmp",
"model": "cybd_std.pie",
"name": "*CybNXMissJmp*",
"powerOutput": 675,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"CybNXPulseLasJmp": {
"armourHeat": 15,
"armourKinetic": 18,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 370,
"id": "CybNXPulseLasJmp",
"model": "cybd_std.pie",
"name": "*CybNXPulseLasJ*",
"powerOutput": 675,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"CybNXRail1Jmp": {
"armourHeat": 15,
"armourKinetic": 18,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 370,
"id": "CybNXRail1Jmp",
"model": "cybd_std.pie",
"name": "*CybNXRail1Jmp*",
"powerOutput": 675,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"CybRotMgGrd": {
"armourHeat": 6,
"armourKinetic": 12,
"buildPoints": 100,
"buildPoints": 115,
"buildPower": 25,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 200,
"id": "CybRotMgGrd",
"model": "cybd_std.pie",
"name": "*Cyborg Assault Gun*",
"powerOutput": 600,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"CyborgCannonGrd": {
"armourHeat": 6,
"armourKinetic": 12,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 200,
"id": "CyborgCannonGrd",
"model": "cybd_std.pie",
"name": "*Cyborg Cannon*",
"powerOutput": 500,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"CyborgChain1Ground": {
"armourHeat": 6,
"armourKinetic": 12,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 200,
"id": "CyborgChain1Ground",
"model": "cybd_std.pie",
"name": "*CyborgChaingun1Ground*",
"powerOutput": 500,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"CyborgFlamerGrd": {
"armourHeat": 6,
"armourKinetic": 12,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 200,
"id": "CyborgFlamerGrd",
"model": "cybd_std.pie",
"name": "*Cyborg Flamer*",
"powerOutput": 500,
"size": "LIGHT",
"weaponSlots": 1,
"weight": 150
},
"CyborgRkt1Ground": {
"armourHeat": 6,
"armourKinetic": 12,
"buildPoints": 125,
"buildPower": 30,
"class": "Cyborgs",
"droidType": "CYBORG",
"hitpoints": 200,
"id": "CyborgRkt1Ground",
"id": "CyborgLightBody",
"model": "cybd_std.pie",
"name": "*CyborgRocket1Ground*",
"name": "Cyborg Light Body",
"powerOutput": 500,
"size": "LIGHT",
"weaponSlots": 1,
Oops, something went wrong.

0 comments on commit ea1c4ff

Please sign in to comment.