Config/script.js |
"use strict";
this.name = "sc-serpents";
this.author = "Astrobe";
this.copyright = "2017 Creative Commons: attribution, non-commercial, sharealike.";
this.description = "Adds stellar serpents encounter to Spacecrowds.";
this.version = "0.0.2";
this.$serpent= function(pos)
{
// 'this' is bound to the spacecrowds script-object here
this.$report("Stellar serpent!");
// The automatic despawn done by $spawnRandomRoles doesn't work well on Stellar Serpents
// because they are made of multiple "ships". So we do it manually.
// Serpents will therefore remain in the system, which is not too bad; plus that's a rare encounter
system.addGroup("stellarSerpents_head", 1, pos, 5E3);
this.$small_police_patrol(pos);
}
this.startUp=function()
{
delete this.startUp;
function runDeps(s)
{
var ws=worldScripts[s];
if(ws.startUp) ws.startUp();
if(worldScripts[s].startUp) delete worldScripts[s].startUp;
return ws;
};
var ws=runDeps("spacecrowds");
//ws.$flushScenarios();
ws.$pushRareScenario(this.$serpent);
ws.$report("Added stellar serpent encounter");
}
|