Shame it would be pritty hard to realize. It's a very complex movement, b ut I'll see what I can do.
My guess is that I won't have a world of time comming week, but everyone who is making stuff for any project is saying that

Moderators: MR.D, Moderators
Code: Select all
// Core Silencer Remake
#include "sfxtype.h"
#include "exptype.h"
piece Base, Tube, Tower, Nuke, Hoses, DoorL, DoorR;
static-var gun_1, restore_delay, statechg_DesiredState, statechg_StateChanging;
#define SIG_AIM 2
activatescr()
{
if( TRUE )
{
move DoorL to x-axis [0.000000] now;
move DoorL to x-axis [8.000000] speed [7.000000];
move DoorR to x-axis [0.000000] now;
move DoorR to x-axis [-8.000000] speed [7.000000];
move Tube to y-axis [0.000000] now;
move Nuke to x-axis [-0.100000] now;
move Nuke to y-axis [0.000000] now;
move Nuke to z-axis [0.100000] now;
sleep 941;
}
if( TRUE )
{
move Tube to y-axis [6.500000] speed [10.000000];
sleep 802;
}
if( TRUE )
{
move Tower to y-axis [27.200000] speed [18.200000];
sleep 1591;
}
sleep 28;
}
deactivatescr()
{
if( TRUE )
{
move DoorL to x-axis [8.000000] now;
move DoorR to x-axis [-8.000000] now;
move Tube to y-axis [6.500000] now;
move Tower to y-axis [27.200000] now;
move Tower to y-axis [0.000000] speed [16.400000];
move Nuke to x-axis [-0.100000] now;
move Nuke to y-axis [0.000000] now;
move Nuke to z-axis [0.100000] now;
sleep 1746;
}
if( TRUE )
{
move Tube to y-axis [0.000000] speed [6.400000];
sleep 836;
}
if( TRUE )
{
move DoorL to x-axis [0.000000] speed [7.800000];
move DoorR to x-axis [0.000000] speed [7.800000];
sleep 576;
}
sleep 49;
}
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;
}
}
Go()
{
show Nuke;
call-script activatescr();
gun_1 = Nuke;
}
Stop()
{
gun_1 = base;
sleep 4000;
call-script deactivatescr();
}
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 )
{
call-script Go();
currentstate = 0;
}
if( statechg_DesiredState == 1 )
{
call-script Stop();
currentstate = 1;
}
}
statechg_StateChanging = FALSE;
}
Create()
{
call-script InitState();
restore_delay = 3000;
start-script SmokeUnit();
}
Activate()
{
dont-cache Tube;
dont-cache DoorL;
dont-cache DoorR;
dont-cache Tower;
dont-cache Nuke;
start-script RequestState(0);
}
Deactivate()
{
start-script RequestState(1);
cache Tube;
cache DoorL;
cache DoorR;
cache Tower;
cache Nuke;
}
SetMaxReloadTime(Func_Var_1)
{
restore_delay = Func_Var_1 * 2;
}
RestoreAfterDelay()
{
sleep restore_delay;
set-signal-mask 0;
start-script RequestState(1);
}
AimPrimary(heading, pitch)
{
start-script RequestState(0);
signal SIG_AIM;
set-signal-mask SIG_AIM;
while( !gun_1 )
{
sleep 250;
}
start-script RestoreAfterDelay();
return (1);
}
FirePrimary()
{
hide Nuke;
gun_1 = base;
start-script RequestState(1);
}
QueryPrimary(piecenum)
{
piecenum = Nuke;
}
SweetSpot(piecenum)
{
piecenum = base;
}
Killed(severity, corpsetype)
{
if( severity <= 25 )
{
corpsetype = 1;
explode base type BITMAPONLY | BITMAP1;
explode Tube type BITMAPONLY | BITMAP2;
explode DoorL type BITMAPONLY | BITMAP3;
explode DoorR type BITMAPONLY | BITMAP4;
explode Tower type BITMAPONLY | BITMAP1;
explode Nuke type BITMAPONLY | BITMAP2;
return (0);
}
if( severity <= 50 )
{
corpsetype = 2;
explode base type BITMAPONLY | BITMAP1;
explode Tube type SHATTER | BITMAP2;
explode DoorL type FALL | BITMAP3;
explode DoorR type FALL | BITMAP4;
explode Tower type BITMAPONLY | BITMAP1;
explode Nuke type BITMAPONLY | BITMAP2;
return (0);
}
if( severity <= 99 )
{
corpsetype = 3;
explode base type BITMAPONLY | BITMAP1;
explode Tube type SHATTER | BITMAP2;
explode DoorL type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
explode DoorR type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP4;
explode Tower type BITMAPONLY | BITMAP1;
explode Nuke type BITMAPONLY | BITMAP2;
return (0);
}
corpsetype = 3;
explode base type BITMAPONLY | BITMAP1;
explode Tube type SHATTER | EXPLODE_ON_HIT | BITMAP2;
explode DoorL type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
explode DoorR type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP4;
explode Tower type BITMAPONLY | BITMAP1;
explode Nuke type BITMAPONLY | BITMAP2;
}