mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
119 lines
2.5 KiB
Plaintext
119 lines
2.5 KiB
Plaintext
include library.group;
|
|
include library.space_utils;
|
|
include library.space_create;
|
|
include library.load_test;
|
|
include library.prose;
|
|
include library.ship_ai;
|
|
include library.space_combat;
|
|
include library.space_transition;
|
|
include library.utils;
|
|
include library.space_battlefield;
|
|
include java.lang.Math;
|
|
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
LOG("space", "manager preloading");
|
|
//requestPreloadCompleteTrigger(self);
|
|
messageTo(self, "nextPhase", null, 2, false);
|
|
setObjVar(self, "intSpawnersDeactivated", 1);
|
|
setObjVar(self, "intPhase", 2);
|
|
return SCRIPT_CONTINUE;
|
|
|
|
}
|
|
trigger OnAttach()
|
|
{
|
|
|
|
//space_battlefield.resetSpaceBattlefield(self);
|
|
return SCRIPT_CONTINUE;
|
|
|
|
}
|
|
//trigger OnPreloadComplete()
|
|
messageHandler bootStrapZone()
|
|
{
|
|
|
|
// we need to turn on all spanwers that are needed.
|
|
LOG("space", "preload compltede");
|
|
// space_battlefield.sendNextPhaseNotification(self);
|
|
//int intPhase = getIntObjVar(self, "intPhase");
|
|
/*
|
|
if(intPhase==space_battlefield.PHASE_ESCORT)
|
|
{
|
|
// spawners already restart, so do nothing
|
|
|
|
|
|
}
|
|
else if(intPhase==space_battlefield.PHASE_CONTROL)
|
|
{
|
|
// spawners already restart, so do nothing
|
|
|
|
|
|
}
|
|
*/
|
|
//if(intPhase==space_battlefield.PHASE_DESTROY)
|
|
//{
|
|
// make the station attackable and remake the stardestroyer
|
|
// space_battlefield.doDestroyerPhase(self);
|
|
//}
|
|
//else
|
|
//{
|
|
// wooh fucked
|
|
|
|
//}
|
|
return SCRIPT_CONTINUE;
|
|
|
|
}
|
|
|
|
messageHandler shipHyperspacing()
|
|
{
|
|
// is it phase 1?
|
|
int intPhase = getIntObjVar(self, "intPhase");
|
|
|
|
if(intPhase==space_battlefield.PHASE_CONTROL)
|
|
{
|
|
// you rebel or imperial?
|
|
obj_id objShip = params.getObjId("objShip");
|
|
|
|
int intFaction = shipGetSpaceFaction(objShip);
|
|
if(intFaction==##"imperial")
|
|
{
|
|
// increment the count
|
|
int intCount =getIntObjVar(self, "intImperialShipCount");
|
|
intCount = intCount+1;
|
|
setObjVar(self, "intImperialShipCount", intCount);
|
|
|
|
}
|
|
}
|
|
if(intPhase==space_battlefield.PHASE_ESCORT)
|
|
{
|
|
obj_id objShip = params.getObjId("objShip");
|
|
|
|
int intFaction = shipGetSpaceFaction(objShip);
|
|
if(intFaction==##"imperial")
|
|
{
|
|
int intCount =getIntObjVar(self, "intImperialShipCount");
|
|
intCount = intCount+10;
|
|
setObjVar(self, "intImperialShipCount", intCount);
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
messageHandler nextPhase()
|
|
{
|
|
setObjVar(self, "intPhase", 2);
|
|
space_battlefield.doDestroyerPhase(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
messageHandler resetBattlefield()
|
|
{
|
|
LOG("space", "RESETTING");
|
|
space_battlefield.resetSpaceBattlefield(self);
|
|
return SCRIPT_CONTINUE;
|
|
|
|
} |