Skip to content

Commit

Permalink
Update for v1.0.4
Browse files Browse the repository at this point in the history
- Fixed some Royalist VTOL CB towers being incorrectly rebuilt as VTOL Strike towers when destroyed.
- Fixed transports flying back and forth forever when an LZ is destroyed while a transport is en route.
- Coalition transport reinforcements stop after the Royalists' outer base is destroyed, to reduce traffic in the final area.
- Coalition transport reinforcements no longer bring mobile repair units when allied.
  • Loading branch information
DARwins1 committed Jul 21, 2023
1 parent ba3731f commit 1c5a05c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
6 changes: 6 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v1.0.4
- Fixed some Royalist VTOL CB towers being incorrectly rebuilt as VTOL Strike towers when destroyed.
- Fixed transports flying back and forth forever when an LZ is destroyed while a transport is en route.
- Coalition transport reinforcements stop after the Royalists' outer base is destroyed, to reduce traffic in the final area.
- Coalition transport reinforcements no longer bring mobile repair units when allied.

v1.0.3
- Fixed errors in camDisableTruck() and camEnableTruck().
- Properly remove a duplicate artifact for Composite Alloys Mk3 if the Hellraisers are allied.
Expand Down
12 changes: 6 additions & 6 deletions script/campaign/kingdomdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ var structSets = {
{stat: "CO-ROTMGBunker", x: 166, y: 55}, {stat: "A0HardcreteMk1Gate", x: 160, y: 56}, {stat: "A0HardcreteMk1Gate", x: 160, y: 57},
{stat: "CO-WallTower-HvCan", x: 160, y: 58}, {stat: "CollectiveWall", x: 160, y: 59}, {stat: "CO-Tower-HvATRkt", x: 160, y: 60},
{stat: "Sys-CO-SensoTower", x: 164, y: 57}, {stat: "CO-WallTower-HvCan", x: 175, y: 48}, {stat: "A0RepairCentre3", x: 169, y: 59},
{stat: "Sys-CO-VTOL-RadarTower01", x: 171, y: 56}, {stat: "CO-Emp-RotMor", x: 169, y: 62}, {stat: "AASite-QuadRotMg", x: 174, y: 57},
{stat: "Sys-CO-VTOL-CB-Tower01", x: 171, y: 56}, {stat: "CO-Emp-RotMor", x: 169, y: 62}, {stat: "AASite-QuadRotMg", x: 174, y: 57},
{stat: "A0HardcreteMk1Gate", x: 176, y: 48}, {stat: "A0HardcreteMk1Gate", x: 177, y: 48}, {stat: "CollectiveWall", x: 178, y: 48},
{stat: "WallTower-Projector", x: 178, y: 49}, {stat: "CO-WallTower-HvCan", x: 179, y: 48}, {stat: "CO-ROTMGBunker", x: 177, y: 56},
{stat: "CO-WallTower-RotCan", x: 184, y: 57}, {stat: "CO-Tower-RotMG", x: 185, y: 56}, {stat: "CollectiveWall", x: 185, y: 57},
Expand Down Expand Up @@ -829,7 +829,7 @@ var structSets = {
{stat: "CO-WallTower-QuadRotAAGun", x: 118, y: 78}, {stat: "WallTower-Projector", x: 121, y: 79}, {stat: "Sys-CO-SensoTower", x: 123, y: 76},
{stat: "CO-Tower-HvATRkt", x: 124, y: 75}, {stat: "CollectiveWall", x: 124, y: 76}, {stat: "CO-WallTower-RotCan", x: 124, y: 77},
{stat: "CO-ROTMGBunker", x: 125, y: 77}, {stat: "A0HardcreteMk1Gate", x: 124, y: 78}, {stat: "A0HardcreteMk1Gate", x: 124, y: 79},
{stat: "CollectiveWall", x: 113, y: 80}, {stat: "CO-WallTower-RotCan", x: 113, y: 81}, {stat: "Sys-CO-VTOL-RadarTower01", x: 114, y: 82},
{stat: "CollectiveWall", x: 113, y: 80}, {stat: "CO-WallTower-RotCan", x: 113, y: 81}, {stat: "Sys-CO-VTOL-CB-Tower01", x: 114, y: 82},
{stat: "CO-Emp-RotMor", x: 116, y: 81}, {stat: "A0ResearchFacility", x: 117, y: 83, mods: 1}, {stat: "CO-Emp-RotMor", x: 113, y: 88},
{stat: "CO-Tower-HVCan", x: 112, y: 91}, {stat: "WallTower-Projector", x: 116, y: 89}, {stat: "A0LightFactory", x: 120, y: 82, rot: 2, mods: 2},
{stat: "CO-WallTower-RotCan", x: 124, y: 80}, {stat: "CollectiveWall", x: 125, y: 80}, {stat: "CO-Tower-RotMG", x: 125, y: 81},
Expand Down Expand Up @@ -892,7 +892,7 @@ var structSets = {
{stat: "CollectiveWall", x: 90, y: 45}, {stat: "CollectiveWall", x: 91, y: 45}, {stat: "CollectiveWall", x: 92, y: 45},
{stat: "CO-WallTower-QuadRotAAGun", x: 93, y: 45}, {stat: "CollectiveWall", x: 93, y: 46}, {stat: "A0HardcreteMk1Gate", x: 93, y: 47},
{stat: "A0VtolPad", x: 94, y: 46}, {stat: "CO-Tower-LtATRkt", x: 83, y: 51}, {stat: "CO-WallTower-RotCan", x: 83, y: 54},
{stat: "CollectiveWall", x: 83, y: 55}, {stat: "CO-Tower-HVCan", x: 87, y: 48}, {stat: "Sys-CO-VTOL-RadarTower01", x: 86, y: 51},
{stat: "CollectiveWall", x: 83, y: 55}, {stat: "CO-Tower-HVCan", x: 87, y: 48}, {stat: "Sys-CO-VTOL-CB-Tower01", x: 86, y: 51},
{stat: "A0VtolPad", x: 86, y: 55}, {stat: "CO-WallTower-RotCan", x: 83, y: 56}, {stat: "A0VtolPad", x: 85, y: 56},
{stat: "AASite-QuadRotMg", x: 84, y: 59, rot: 3}, {stat: "A0VtolPad", x: 85, y: 58}, {stat: "Sys-COCB-Tower01", x: 85, y: 59},
{stat: "A0VtolPad", x: 87, y: 56}, {stat: "A0VtolPad", x: 86, y: 59}, {stat: "A0VtolPad", x: 87, y: 58},
Expand Down Expand Up @@ -920,7 +920,7 @@ var structSets = {
{stat: "CO-WallTower-QuadRotAAGun", x: 210, y: 49}, {stat: "CollectiveWall", x: 211, y: 49}, {stat: "CO-Emp-RotMor", x: 210, y: 51},
{stat: "CollectiveWall", x: 208, y: 53}, {stat: "CO-WallTower-QuadRotAAGun", x: 209, y: 53}, {stat: "CollectiveWall", x: 210, y: 53},
{stat: "CO-WallTower-QuadRotAAGun", x: 211, y: 53}, {stat: "PillBox-Cannon6", x: 212, y: 49}, {stat: "A0HardcreteMk1Gate", x: 213, y: 49},
{stat: "A0HardcreteMk1Gate", x: 214, y: 49}, {stat: "PillBox-Cannon6", x: 215, y: 49}, {stat: "Sys-CO-VTOL-RadarTower01", x: 215, y: 51},
{stat: "A0HardcreteMk1Gate", x: 214, y: 49}, {stat: "PillBox-Cannon6", x: 215, y: 49}, {stat: "Sys-CO-VTOL-CB-Tower01", x: 215, y: 51},
{stat: "Sys-CO-SensoTower", x: 213, y: 54}, {stat: "CO-WallTower-QuadRotAAGun", x: 217, y: 49}, {stat: "CollectiveWall", x: 218, y: 49},
{stat: "CollectiveWall", x: 219, y: 49}, {stat: "CO-WallTower-QuadRotAAGun", x: 220, y: 49}, {stat: "Sys-COCB-Tower01", x: 221, y: 49},
{stat: "CollectiveWall", x: 223, y: 50}, {stat: "CollectiveWall", x: 224, y: 50}, {stat: "CO-WallTower-QuadRotAAGun", x: 225, y: 50},
Expand Down Expand Up @@ -982,7 +982,7 @@ var structSets = {
{stat: "CO-Tower-HvATRkt", x: 234, y: 23}, {stat: "CollectiveWall", x: 235, y: 23}, {stat: "CO-Tower-HvATRkt", x: 236, y: 23},
{stat: "CO-Tower-HvATRkt", x: 233, y: 25}, {stat: "CollectiveWall", x: 233, y: 26}, {stat: "CollectiveWall", x: 233, y: 27},
{stat: "CO-Tower-HvATRkt", x: 233, y: 28}, {stat: "A0CyborgFactory", x: 237, y: 24, rot: 3}, {stat: "A0PowerGenerator", x: 236, y: 27, mods: 1},
{stat: "A0LightFactory", x: 236, y: 30, rot: 3, mods: 2}, {stat: "Sys-CO-VTOL-RadarTower01", x: 224, y: 33}, {stat: "CO-WallTower-QuadRotAAGun", x: 225, y: 34},
{stat: "A0LightFactory", x: 236, y: 30, rot: 3, mods: 2}, {stat: "Sys-CO-VTOL-CB-Tower01", x: 224, y: 33}, {stat: "CO-WallTower-QuadRotAAGun", x: 225, y: 34},
{stat: "A0ResearchFacility", x: 226, y: 32, mods: 1}, {stat: "CollectiveWall", x: 226, y: 34}, {stat: "CO-WallTower-TwinAssaultGun", x: 227, y: 34},
{stat: "A0CommandCentreNE", x: 229, y: 32}, {stat: "CollectiveWall", x: 228, y: 34}, {stat: "CO-WallTower-QuadRotAAGun", x: 229, y: 34},
{stat: "CollectiveWall", x: 230, y: 34}, {stat: "CollectiveWall", x: 231, y: 34}, {stat: "A0RepairCentre3", x: 232, y: 32},
Expand Down Expand Up @@ -1011,7 +1011,7 @@ var structSets = {
{stat: "CollectiveWall", x: 144, y: 24}, {stat: "CO-Tower-HvATRkt", x: 144, y: 25}, {stat: "CollectiveWall", x: 144, y: 26},
{stat: "CO-WallTower-QuadRotAAGun", x: 144, y: 27}, {stat: "CO-ROTMGBunker", x: 149, y: 28}, {stat: "CO-Emp-RotMor", x: 153, y: 16},
{stat: "CO-ROTMGBunker", x: 155, y: 19}, {stat: "A0VtolPad", x: 152, y: 21}, {stat: "A0VtolPad", x: 153, y: 20},
{stat: "A0VtolPad", x: 152, y: 23}, {stat: "Sys-CO-VTOL-RadarTower01", x: 153, y: 22}, {stat: "A0VtolPad", x: 154, y: 21},
{stat: "A0VtolPad", x: 152, y: 23}, {stat: "Sys-CO-VTOL-CB-Tower01", x: 153, y: 22}, {stat: "A0VtolPad", x: 154, y: 21},
{stat: "A0VtolPad", x: 154, y: 23}, {stat: "CO-Emp-RotMor", x: 156, y: 16}, {stat: "CO-ROTMGBunker", x: 159, y: 17},
{stat: "CO-Tower-HvATRkt", x: 158, y: 20}, {stat: "CollectiveWall", x: 158, y: 21}, {stat: "A0HardcreteMk1Gate", x: 158, y: 22},
{stat: "CollectiveWall", x: 158, y: 23}, {stat: "A0VtolPad", x: 153, y: 24}, {stat: "CO-ROTMGBunker", x: 155, y: 25},
Expand Down
30 changes: 18 additions & 12 deletions script/campaign/kingdomgroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,10 +856,13 @@ function transportTick()
return (obj.type === STRUCTURE && obj.stattype === DEFENSE
&& allianceExistsBetween(THE_COALITION, obj.player));
});
if (camWithinArea(transport, lzName) && lzStructs.length > 0)
if (camWithinArea(transport, lzName))
{
spawnTransportDroids(THE_COALITION, camMakePos(lzName));
gameState.coalition.lzRequests[lzName] = false; // Reinforcements have arrived
if (lzStructs.length > 0)
{
spawnTransportDroids(THE_COALITION, camMakePos(lzName));
}
gameState.coalition.lzRequests[lzName] = false; // Transport has arrived
}
}
}
Expand Down Expand Up @@ -894,10 +897,13 @@ function transportTick()
var lzStructs = enumArea(lzName, ROYALISTS, false).filter(function(obj) {
return (obj.type === STRUCTURE && obj.stattype === DEFENSE);
});
if (camWithinArea(transport, lzName) && lzStructs.length > 0)
if (camWithinArea(transport, lzName))
{
spawnTransportDroids(ROYALISTS, camMakePos(lzName));
gameState.royalists.lzRequests[lzName] = false; // Reinforcements have arrived
if (lzStructs.length > 0)
{
spawnTransportDroids(ROYALISTS, camMakePos(lzName));
}
gameState.royalists.lzRequests[lzName] = false; // Transport has arrived
}
}
}
Expand Down Expand Up @@ -942,8 +948,8 @@ function spawnTransportDroids(player, pos)
}
else
{
droidPool = [cTempl.cohhcan, cTempl.comhmort, cTempl.comsenst, cTempl.comhrepht]; // Tanks
droidPool = droidPool.concat([cTempl.cybrp, cTempl.cybgr]); // Cyborgs
droidPool = [cTempl.cohhcan, cTempl.comhmort, cTempl.comsenst]; // Tanks
droidPool = droidPool.concat([cTempl.cybgr]); // Cyborgs
if (camIsResearched("R-Wpn-MG4"))
{
droidPool.push(cTempl.cybag); // Add Assault Gunner
Expand Down Expand Up @@ -1135,18 +1141,18 @@ function hellraiserLZTransRequest()

function westGateLZTransRequest()
{
if (camBaseIsEliminated("coaWestGateLZ"))
if (camBaseIsEliminated("coaWestGateLZ") || camBaseIsEliminated("royalistOuterGate"))
{
return; // LZ is gone (for now)
return; // LZ is gone (for now), or the Royalist outer base is destroyed.
}
gameState.coalition.lzRequests.westGateLZ = true;
}

function southGateLZTransRequest()
{
if (camBaseIsEliminated("ampSouthGateLZ"))
if (camBaseIsEliminated("ampSouthGateLZ") || camBaseIsEliminated("royalistOuterGate"))
{
return; // LZ is gone (for now)
return; // LZ is gone (for now), or the Royalist outer base is destroyed.
}
gameState.coalition.lzRequests.coastLZ = true;
}
Expand Down
4 changes: 2 additions & 2 deletions script/campaign/libcampaign_includes/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ function camUpgradeOnMapTemplates(t1, t2, player, excluded)
}
}

//;; ## camUpgradeOnMapStructures(struct1Name, struct2, player, [excluded object IDs])
//;; ## camUpgradeOnMapStructures(struct1, struct2, player, [excluded object IDs])
//;;
//;; Search for struct1, save its coordinates, remove it, and then replace with it
//;; with struct2. A fourth parameter can be specified to ignore specific object
Expand Down Expand Up @@ -337,7 +337,7 @@ function camUpgradeOnMapStructures(struct1, struct2, player, excluded)
}
}

//Cehck if this object has a label and/or group assigned to it
//Check if this object has a label and/or group assigned to it
// FIXME: O(n) lookup here
let label = (getLabel(structure));
let group = (structure.group);
Expand Down

0 comments on commit 1c5a05c

Please sign in to comment.