Remove now unused scav script files

master
Per Inge Mathisen 2011-04-02 23:30:22 +02:00
parent df6e6dd669
commit c261aca433
2 changed files with 0 additions and 211 deletions

View File

@ -1,192 +0,0 @@
// Scavenger MultiPlayer Factory (one) Script
/* aims.
x build upto x droids of y types
x add each new droid to the buildgroup
+ if buildgroup has x droids, send off to wander/attack enemy stuff
x when sending a group, remove the droids from it
x Groups attack things that come into range
x when a friendly structure is attacked send group to attack back
+ wandering likes oil resources, especially those with derricks
*/
// scavenger values
public int maxDroids;
public STRUCTURESTAT factory;
private STRUCTURE fac1;
// Build Templates
public TEMPLATE trike;
public TEMPLATE buggy;
public TEMPLATE bloke;
public TEMPLATE jeep;
public TEMPLATE firetruck;
public TEMPLATE firebus;
public TEMPLATE cannonbus;
// groups
private GROUP attackGroup;
private DROID newDroid, droid;
// attacking
private STRUCTURE structure;
private BASEOBJ attacker;
private INT lastAttack;
// Our player number
private INT enemy1;
#region triggers
trigger chainloadTr(wait, 10);
trigger regularTr(every, 100);
event structureAttacked;
event startup;
event droidbuilt;
event startLevel;
event scavManagement;
#endregion triggers
// We need to reguarly check back on our scavs, since they are stupid and forget their orders.
// (A nice way of saying we have bugs in our code.)
event scavManagement(inactive)
{
local DROID mydroid;
local int closest, current;
local STRUCTURE clfac;
initEnumStruct(FALSE, factory, enemy1, enemy1);
fac1 = enumStruct();
while (fac1 != NULLOBJECT)
{
// Remind factory to produce
if (structureIdle(fac1))
{
buildDroid(trike, fac1, enemy1, 1);
}
fac1 = enumStruct();
}
if ((gameTime - lastAttack) > 600)
{
// Return to nearest factory (ie base)
lastAttack = gameTime;
initIterateGroup(attackGroup);
mydroid = iterateGroup(attackGroup);
while (mydroid != NULLOBJECT)
{
clfac = NULLOBJECT;
closest = 9999;
initEnumStruct(FALSE, factory, enemy1, enemy1);
fac1 = enumStruct();
while (fac1 != NULLOBJECT)
{
current = distBetweenTwoPoints(fac1.x, fac1.y, mydroid.x, mydroid.y);
if (current < closest)
{
closest = current;
clfac = fac1;
}
fac1 = enumStruct();
}
if (clfac != NULLOBJECT)
{
orderDroidLoc(mydroid, DORDER_MOVE, clfac.x, clfac.y);
}
mydroid = iterateGroup(attackGroup);
}
}
setEventTrigger(scavManagement, regularTr);
}
event startLevel(CALL_START_NEXT_LEVEL)
{
setEventTrigger(scavManagement, chainloadTr);
}
// deal with a droid being built by us
event droidbuilt(CALL_NEWDROID, enemy1, ref newDroid, ref fac1)
{
local int Fact1State;
groupAddDroid(attackGroup, newDroid);
// Build another
if (fac1 != NULLOBJECT)
{
if (structureIdle(fac1) and (numDroidsInArea(enemy1, 0, 0, (mapWidth * 128), (mapHeight * 128)) < maxDroids))
{
Fact1State = random(10);
if (Fact1State == 0)
{
buildDroid(trike, fac1, enemy1, 1);
}
else if (Fact1State == 1)
{
buildDroid(buggy, fac1, enemy1, 1);
}
else if (Fact1State == 2)
{
buildDroid(jeep, fac1, enemy1, 1);
}
else if (Fact1State == 3)
{
buildDroid(cannonbus, fac1, enemy1, 1);
}
else if (Fact1State == 4)
{
buildDroid(firebus, fac1, enemy1, 1);
}
else
{
buildDroid(bloke, fac1, enemy1, 1);
}
}
}
}
// watch for structures being attacked. Send the cavalry as required.
event structureAttacked(CALL_STRUCT_ATTACKED, enemy1, ref structure, ref attacker)
{
local DROID mydroid;
if ((gameTime - lastAttack) > 300)
{
lastAttack = gameTime;
initIterateGroup(attackGroup);
mydroid = iterateGroup(attackGroup);
while (mydroid != NULLOBJECT)
{
if (distBetweenTwoPoints(attackGroup.x, attackGroup.y,attacker.x, attacker.y) < (24 * 128))
{
orderDroidLoc(mydroid, DORDER_MOVE, attacker.x, attacker.y);
}
mydroid = iterateGroup(attackGroup);
}
}
}
// Startup
event startup(CALL_GAMEINIT)
{
enemy1 = scavengersActive();
if (enemy1 < 0 or !myResponsibility(enemy1))
{
setEventTrigger(startLevel, inactive);
setEventTrigger(droidbuilt, inactive);
setEventTrigger(structureAttacked, inactive);
}
else
{
lastAttack = 0;
groupAddArea(attackGroup, enemy1, 0, 0, (mapWidth * 128), (mapHeight * 128));
}
}

View File

@ -1,19 +0,0 @@
// Multiplayer Script for Scavenger Factory
script "scavFact.slo"
run
{
maxDroids INT 25 // max guys to handle.
factory STRUCTURESTAT "A0BaBaFactory"
//build templates
trike TEMPLATE "BarbarianTrike"
buggy TEMPLATE "BarbarianBuggy"
bloke TEMPLATE "BaBaPeople"
jeep TEMPLATE "BabaJeep"
firetruck TEMPLATE "BabaFireTruck"
cannonbus TEMPLATE "BabaBusCan"
firebus TEMPLATE "BabaFireCan"
}