mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-29 23:15:55 -04:00
151 lines
3.7 KiB
Plaintext
151 lines
3.7 KiB
Plaintext
include library.space_create;
|
|
include library.space_transition;
|
|
include library.ship_ai;
|
|
include library.space_battlefield;
|
|
include library.space_crafting;
|
|
include library.player_structure;
|
|
include library.space_content;
|
|
include library.objvar_mangle;
|
|
include library.space_quest;
|
|
include library.sui;
|
|
include library.datatable;
|
|
include library.utils;
|
|
include library.hue;
|
|
include library.space_utils;
|
|
|
|
|
|
|
|
trigger OnSpeaking(string strText)
|
|
{
|
|
|
|
|
|
string[] strCommands = split(strText, ' ' );
|
|
|
|
|
|
if(strCommands[0]=="flipPhase")
|
|
{
|
|
|
|
obj_id objManager = space_battlefield.getManagerObject();
|
|
int intPhase = getIntObjVar(objManager, "intPhase");
|
|
if(intPhase == 0)
|
|
{
|
|
space_battlefield.battlefieldCompleted(objManager, 1);
|
|
sendSystemMessageTestingOnly(self, "setting to 1");
|
|
}
|
|
else if(intPhase==1)
|
|
{
|
|
|
|
space_battlefield.battlefieldCompleted(objManager, 0);
|
|
sendSystemMessageTestingOnly(self, "setting to 0");
|
|
|
|
}
|
|
|
|
}
|
|
if(strCommands[0] == "createAt")
|
|
{
|
|
if(strCommands.length>0)
|
|
{
|
|
|
|
obj_id objTest = getPilotedShip(self);
|
|
obj_id objShip = null;
|
|
if(isIdValid(objTest))
|
|
{
|
|
|
|
objShip = space_create.createShip(strCommands[1], getTransform_o2p(getPilotedShip(self)));
|
|
}
|
|
else
|
|
{
|
|
objShip = space_create.createShip(strCommands[1], getTransform_o2p(self));
|
|
|
|
}
|
|
|
|
if(objShip==null)
|
|
{
|
|
sendSystemMessageTestingOnly(self, "You passed in a bad shipType. Type is "+strCommands[1]);
|
|
return SCRIPT_CONTINUE;
|
|
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessageTestingOnly(self, "Made ship of type "+strCommands[1]+" object id is: "+objShip);
|
|
debugConsoleMsg(self, "Made ship of type "+strCommands[1]+" object id is: "+objShip);
|
|
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessageTestingOnly(self, "You need to pass in a ship type for me to spawn.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if(strCommands[0] == "createNear")
|
|
{
|
|
if(strCommands.length>0)
|
|
{
|
|
transform whereAt = getTransform_o2p(getPilotedShip(self));
|
|
transform nearby = whereAt.move_l(vector.unitY.multiply(100.0f).add(vector.unitX.multiply(100.0f)));
|
|
obj_id objShip = space_create.createShip(strCommands[1], nearby);
|
|
|
|
if(objShip==null)
|
|
{
|
|
sendSystemMessageTestingOnly(self, "You passed in a bad shipType. Type is "+strCommands[1]);
|
|
return SCRIPT_CONTINUE;
|
|
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessageTestingOnly(self, "Made ship of type "+strCommands[1]+" object id is: "+objShip);
|
|
debugConsoleMsg(self, "Made ship of type "+strCommands[1]+" object id is: "+objShip);
|
|
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessageTestingOnly(self, "You need to pass in a ship type for me to spawn.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
|
|
if(strCommands[0]=="fixMe")
|
|
{
|
|
|
|
space_crafting.repairDamage(self, getPilotedShip(self), 100.0f);
|
|
sendSystemMessageTestingOnly(self, "Fixed ship");
|
|
|
|
|
|
}
|
|
|
|
if(strCommands[0]=="checkPhase")
|
|
{
|
|
obj_id objManager = space_battlefield.getManagerObject();
|
|
sendSystemMessageTestingOnly(self, "Manager is "+objManager+" phase is "+getIntObjVar(objManager, "intPhase"));
|
|
}
|
|
|
|
if(strCommands[0]=="resetBattlefield")
|
|
{
|
|
obj_id objManager = space_battlefield.getManagerObject();
|
|
sendSystemMessageTestingOnly(self, "Manager is "+objManager+" RESETTING");
|
|
space_battlefield.resetSpaceBattlefield(objManager);
|
|
|
|
}
|
|
if(strCommands[0]=="nextPhase")
|
|
{
|
|
obj_id objManager = space_battlefield.getManagerObject();
|
|
int intPhase = getIntObjVar(objManager, "intPhase");
|
|
sendSystemMessageTestingOnly(self, "Manager is "+objManager);
|
|
int intDuration = space_battlefield.PHASE_DURATIONS[intPhase];
|
|
//removeObjVar(objManager, "intPhaseStart");
|
|
setObjVar(objManager, "intPhaseStart", 100); //getGameTime() - intDuration + 200);
|
|
space_battlefield.sendNextPhaseNotification(objManager);
|
|
|
|
|
|
}
|
|
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|