Skip to content

Commit

Permalink
jscam: An easier way to define factory templates.
Browse files Browse the repository at this point in the history
refs ticket:4234
  • Loading branch information
haoNoQ committed Oct 25, 2014
1 parent 2e81cba commit b615352
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
9 changes: 4 additions & 5 deletions data/base/script/campaign/cam1a.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,15 @@ function eventStartLevel()
"artifact4pos": { tech: "R-Wpn-MG-Damage01" },
});

var t = camTemplates;
camSetFactories({
with (camTemplates) camSetFactories({
"base1factory": {
assembly: "assembly1",
order: CAM_ORDER_ATTACK,
data: { pos: "playerBase" },
groupSize: 3,
maxSize: 3,
throttle: 20000,
templates: [ t.trike, t.bloke ]
templates: [ trike, bloke ]
},
"base2factory1": {
assembly: "assembly2",
Expand All @@ -207,7 +206,7 @@ function eventStartLevel()
groupSize: 4,
maxSize: 4,
throttle: 16000,
templates: [ t.bloke, t.buggy, t.bloke ]
templates: [ bloke, buggy, bloke ]
},
"base2factory2": {
assembly: "assembly3",
Expand All @@ -216,7 +215,7 @@ function eventStartLevel()
groupSize: 4,
maxSize: 4,
throttle: 13000,
templates: [ t.bjeep, t.bloke, t.trike, t.bloke ]
templates: [ bjeep, bloke, trike, bloke ]
},
});
}
18 changes: 9 additions & 9 deletions data/base/script/campaign/cam1b.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ camAreaEvent("AttackArea1", me, function(droid)
fallback: camMakePos("enemy1Force1Fallback"),
morale: 50
});
var t = camTemplates;
camEnableFactory("base1factory"); // pink factory
camSetFactoryData("base2factory", { // sic! hill factory
// pink factory
camEnableFactory("base1factory");
// sic! hill factory
with (camTemplates) camSetFactoryData("base2factory", {
assembly: "assembly2",
order: CAM_ORDER_ATTACK, // changes
data: { pos: "playerBase" }, // changes
groupSize: 10, // changes
maxSize: 10,
throttle: 40000,
templates: [ t.trike, t.bloke, t.buggy, t.bloke, ] // changes
templates: [ trike, bloke, buggy, bloke, ] // changes
});
});

Expand Down Expand Up @@ -78,16 +79,15 @@ function eventStartLevel()
},
});

var t = camTemplates;
camSetFactories({
with (camTemplates) camSetFactories({
"base1factory": {
assembly: "assembly1",
order: CAM_ORDER_ATTACK,
data: { pos: "playerBase" },
groupSize: 6,
maxSize: 6,
throttle: 40000,
templates: [ t.trike, t.bloke, t.buggy, t.bloke ]
templates: [ trike, bloke, buggy, bloke ]
},
"base2factory": { // the hill harass factory
assembly: "assembly2",
Expand All @@ -100,7 +100,7 @@ function eventStartLevel()
groupSize: 4, // will override later
maxSize: 10,
throttle: 40000,
templates: [ t.bloke ] // will override later
templates: [ bloke ] // will override later
},
"base4factory": {
assembly: "assembly4",
Expand All @@ -109,7 +109,7 @@ function eventStartLevel()
groupSize: 8,
maxSize: 8,
throttle: 40000,
templates: [ t.trike, t.bloke, t.buggy, t.bjeep ]
templates: [ trike, bloke, buggy, bjeep ]
},
});
camEnableFactory("base2factory");
Expand Down

0 comments on commit b615352

Please sign in to comment.