home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 April
/
Gamestar_83_2006-04_dvd.iso
/
Dema
/
demowot_english.exe
/
Script
/
Source
/
visualeffects.inc
< prev
Wrap
Text File
|
2005-03-11
|
5KB
|
171 lines
// Call this .inc only if you really use it,
// since it loads everything into the memory!
// You can call this with the following command:
// BulletTime(TheUnit'sDrID), if no Unit is specified it will do at the camera's current location.
// ADDITIONAL PARAMETERS:
// BulletTime(TargetDrID, UI_STATE(optional!), PAUSE(optional!), LEAVE_THERE(optional!), BT_DISTANCE(optional!))
// UI_STATE - turn off the User Interface during the effect -> default true
// PAUSE - 'Pause' the game during the effect -> default false
// LEAVE_THERE - If the Camera should stay at the end of BT
// BT_Distance - The Distance BT should use
// IMPORTANT: NEVER EVER ADD THE LAST BOOLEAN AT BULLETTIME CALL!!!
//--------------------MATRIX POWWA!--------------------START
stock BulletTime(DrID:OurTarget=DrID:0, bool:BT_UIState=true, bool:BT_Pause=false, bool:BT_LeaveThere=false, Float:BT_Distance=15.0, Float:BT_FBSize=0.0, bool:BulletTimeController=true)
{
static Float:CamActPos[vec3];
static Float:CamActRot;
static Float:CamActDist;
static Float:CamActPitch;
static Float:ActGameSpeed;
static bool:BT_UIStatus;
static bool:BT_Pauz;
static bool:BT_Lock=false;
static bool:BT_LeaveAlone;
// imre
// static DrID:BT_DasFowBaca;
static BT_DasFowBacaStringID[100] = {0, ...};
new DrID:BT_DasFowBaca;
BT_DasFowBaca = GetEntity(BT_DasFowBacaStringID);
// \imre
DebugMessage( "BulletTime called", DL_MESSAGE )
if (BulletTimeController)
{
if(BT_Lock)
{
DebugMessage( "Attention!!! BulletTime called while an other BulletTime was already running!!!!", DL_WARNING );
return;
}
BT_Lock=true;
DebugMessage( "BulletTime init", DL_MESSAGE )
ActGameSpeed=GetGameSpeed();
if (BT_UIStatus)
{
SetCutScene(true);
}
SetGameSpeed(0.05);
GetCameraActualPos(CamActPos);
CamActRot = GetCameraActualRotate();
CamActDist = GetCameraActualDistance();
CamActPitch = GetCameraActualPitch();
TeleportCameraToEnt(OurTarget);
CameraFollow(OurTarget);
SetCameraTargetPitch( 55.0 );
SetCameraTargetDistance( BT_Distance );
BT_UIStatus = BT_UIState;
BT_Pauz = BT_Pause;
BT_LeaveAlone = BT_LeaveThere;
if(BT_Pauz)
AddTimerEvent( "ActBulletTime", 0.1, "AnimLogic" );
else
AddTimerEvent( "WeNeededPause", 0.5, "AnimLogic" );
if(BT_FBSize!=0.0)
{
DebugMessage( "BulletTime: FOW Bacon requested! Creating ...", DL_MESSAGE )
new Float:BT_TempPos[vec3];
GetPropertyVec3( OurTarget, "LogicalPos_", BT_TempPos );
BT_DasFowBaca=CreateEntity( "fowbacon_20", BT_TempPos );
GetPropertyString(BT_DasFowBaca, "StringID", 100, BT_DasFowBacaStringID);
SetPropertyInt( BT_DasFowBaca, "Team", gPlayerTeam );
SetPropertyFloat( BT_DasFowBaca, "FOWRangeRadius", (BT_FBSize+5.5) );
SetPropertyFloat( BT_DasFowBaca, "FOWRangeInnerRadius", BT_FBSize );
RefreshFOW();
RefreshFOW();
}
else
{
BT_DasFowBaca=DrID:0;
BT_DasFowBacaStringID = "";
}
}
else
{
if(BT_Pauz)
{
BT_Lock=false;
CameraFollow( DrID:0 );
ResetCameraSpeed();
// if(ActGameSpeed<0.125)
// {
// ActGameSpeed=0.125;
// DebugMessage( "ActGameSpeed resetted",DL_MESSAGE );
// }
SetGameSpeed(ActGameSpeed);
if (BT_UIStatus)
{
SetCutScene(false);
}
if(!BT_LeaveAlone)
{
SetCameraTargetPos(CamActPos);
SetCameraTargetRotate(CamActRot);
SetCameraTargetDistance(CamActDist);
SetCameraTargetPitch(CamActPitch);
}
if(BT_DasFowBaca!=DrID:0)
{
SetPropertyInt( BT_DasFowBaca, "Team", 0 );
DestructEntity( BT_DasFowBaca );
BT_DasFowBaca=DrID:0;
}
CallUserEvent(UE_BULLETTIME_END);
}
else
{
SetGameSpeed(0.5)
AddTimerEvent( "CloseBulletTime", 1.5, "AnimLogic", bool:true);
BT_Pauz = true;
}
}
}
public WeNeededPause()
{
SetGameSpeed(0.2);
AddTimerEvent( "WeNeededAnother", 1.5, "AnimLogic" );
RemoveEvent( "WeNeededPause" );
}
public WeNeededAnother()
{
SetGameSpeed( 0.1 );
AddTimerEvent( "ActBulletTime", 0.1, "AnimLogic" );
RemoveEvent( "WeNeededAnother" );
}
public ActBulletTime()
{
static BulletTimer = 0;
static Float:lTmpActRot;
switch(BulletTimer)
{
case 0: //init
{
SetCameraRotSpeed(55.0);
lTmpActRot= GetCameraActualRotate();
}
case 41: //end
{
RemoveEvent( "ActBulletTime" );
BulletTimer = -1;
BulletTime(DrID:0,true,true,true,15.0,0.0,false);
}
default:
{
SetCameraTargetRotate( lTmpActRot+(9*BulletTimer));
}
}
BulletTimer++;
}
public CloseBulletTime()
{
BulletTime(DrID:0,true,true,true,15.0,0.0,false);
RemoveEvent( "CloseBulletTime" );
}
//--------------------MATRIX POWWA!--------------------END