Code: Select all
#include "springdefs.h";
piece base,door,chimney1,chimney2,chimney3,chimney4,chimney5,chimney6,exit;
#define SIG_BUILD 1
// Signal definitions
#define SIG_ACTIVATE 2
//#define nanoflame 1024+0
static-var Structureheight;
static-var STARTED, Static_Var_1, Static_Var_2, Static_Var_3, Static_Var_4, Static_Var_5, Static_Var_6, Static_Var_7, Static_Var_8;
static-var spray, unitviewer, statechg_DesiredState, statechg_StateChanging, building;
Create() //What happens when we get made?
{
structureheight = (get UNIT_HEIGHT)*(-1);
move base to y-axis structureheight now;
while( get BUILD_PERCENT_LEFT )
{
move base to y-axis (structureheight * (get BUILD_PERCENT_LEFT)/100) speed [10];
//emit-sfx DUST from base;
sleep 50;
}
move base to y-axis 0 speed [10];
//call-script InitState();
//start-script SmokeUnit();
}
SmokeUnit(healthpercent, sleeptime, smoketype)
{
while( get BUILD_PERCENT_LEFT )
{
sleep 400;
}
while( TRUE )
{
healthpercent = get HEALTH;
if( healthpercent < 66 )
{
smoketype = 256 | 2;
if( Rand( 1, 66 ) < healthpercent )
{
smoketype = 256 | 1;
}
emit-sfx smoketype from base;
}
sleeptime = healthpercent * 50;
if( sleeptime < 200 )
sleeptime = 200;
}
{
sleep sleeptime;
}
}
Buildingfx()
{
while(building)
{
// emit-sfx nanoflame from chimney1;
// emit-sfx nanoflame from chimney2;
sleep 5;
}
}
OpenYard()
{
// spin ring around z-axis speed <50.005495>;
// move spikes to y-axis [7] speed [5];
move door to Y-axis <-90> speed <50>;
// wait-for-move spikes along y-axis;
wait-for-move door along Y-axis;
start-script Buildingfx(); //F├╝r Rauch etc.
set YARD_OPEN to 1;
while( !get YARD_OPEN )
{
set BUGGER_OFF to 1;
sleep 1500;
set YARD_OPEN to 1;
}
set BUGGER_OFF to 0;
}
CloseYard()
{
// stop-spin ring around z-axis decelerate <10.000000>;
// move spikes to y-axis [0] speed [5];
move door to y-axis <0> speed <50>;
set YARD_OPEN to 0;
while( get YARD_OPEN )
{
set BUGGER_OFF to 1;
sleep 1500;
set YARD_OPEN to 0;
}
set BUGGER_OFF to 0;
}
Go()
{
call-script OpenYard();
set INBUILDSTANCE to 1;
}
Stop()
{
set INBUILDSTANCE to 0;
call-script CloseYard();
}
InitState()
{
statechg_DesiredState = TRUE;
statechg_StateChanging = FALSE;
}
RequestState(requestedstate, currentstate)
{
if( statechg_StateChanging )
{
statechg_DesiredState = requestedstate;
return (0);
}
statechg_StateChanging = TRUE;
currentstate = statechg_DesiredState;
statechg_DesiredState = requestedstate;
while( statechg_DesiredState != currentstate )
{
if( statechg_DesiredState == 0 )
{
building=1;
call-script Go();
currentstate = 0;
}
if( statechg_DesiredState == 1 )
{
building=0;
call-script Stop();
currentstate = 1;
}
}
statechg_StateChanging = FALSE;
}
QueryNanoPiece(piecenum)
{
piecenum = base;
}
Activate()
{
signal SIG_ACTIVATE;
start-script RequestState(0);
}
Deactivate()
{
signal SIG_ACTIVATE;
set-signal-mask SIG_ACTIVATE;
set-signal-mask 0;
start-script RequestState(1);
}
StartBuilding()
{
}
StopBuilding()
{
}
QueryBuildInfo(piecenum)
{
piecenum = base;
}
Killed(severity, corpsetype)
{
}