Code: Select all
// ----------------------------------------------------------------------
// state Dying
//
// make sure the death animation finishes
// ----------------------------------------------------------------------
state Dying
{
ignores all;
event PlayerTick(float deltaTime)
{
if (PlayerIsClient())
ClientDeath();
UpdateDynamicMusic(deltaTime);
Super.PlayerTick(deltaTime);
}
exec function Fire(optional float F)
{
if ( Level.NetMode != NM_Standalone )
Super.Fire();
}
exec function ShowMainMenu()
{
// reduce the white glow when the menu is up
if (InstantFog != vect(0,0,0))
{
InstantFog = vect(0.1,0.1,0.1);
InstantFlash = 0.01;
// force an update
ViewFlash(1.0);
}
Global.ShowMainMenu();
}
function BeginState()
{
FrobTime = Level.TimeSeconds;
ShowHud(False);
ClientDeath();
}
function TakeDamage(int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)
{
}
function PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator CameraRotation)
{
local vector ViewVect, HitLocation, HitNormal, whiteVec;
local float ViewDist;
local actor HitActor;
local float time;
ViewActor = Self;
if (bHidden)
{
// spiral up and around carcass and fade to white in five seconds
time = Level.TimeSeconds - FrobTime;
if ( ((myKiller != None) && (killProfile != None) && (!killProfile.bKilledSelf)) ||
((killProfile != None) && killProfile.bValid && (!killProfile.bKilledSelf)))
{
if ( killProfile.bValid && killProfile.bTurretKilled )
ViewVect = killProfile.killerLoc - Location;
else if ( killProfile.bValid && killProfile.bProximityKilled )
ViewVect = killProfile.killerLoc - Location;
else if (( !killProfile.bKilledSelf ) && ( myKiller != None ))
ViewVect = myKiller.Location - Location;
CameraLocation = Location;
CameraRotation = Rotator(ViewVect);
}
else if (time < 8.0)
{
whiteVec.X = time / 16.0;
whiteVec.Y = time / 16.0;
whiteVec.Z = time / 16.0;
CameraRotation.Pitch = -16384;
CameraRotation.Yaw = (time * 8192.0) % 65536;
ViewDist = 32 + time * 32;
InstantFog = whiteVec;
InstantFlash = 0.5;
ViewFlash(1.0);
// make sure we don't go through the ceiling
ViewVect = vect(0,0,1);
HitActor = Trace(HitLocation, HitNormal, Location + ViewDist * ViewVect, Location);
if ( HitActor != None )
CameraLocation = HitLocation;
else
CameraLocation = Location + ViewDist * ViewVect;
}
else
{
if ( Level.NetMode != NM_Standalone )
{
// Don't fade to black in multiplayer
}
else
{
// then, fade out to black in four seconds and bring up
// the main menu automatically
whiteVec.X = FMax(0.5 - (time-8.0) / 8.0, -1.0);
whiteVec.Y = FMax(0.5 - (time-8.0) / 8.0, -1.0);
whiteVec.Z = FMax(0.5 - (time-8.0) / 8.0, -1.0);
CameraRotation.Pitch = -16384;
CameraRotation.Yaw = (time * 8192.0) % 65536;
ViewDist = 32 + 8.0 * 32;
InstantFog = whiteVec;
InstantFlash = whiteVec.X;
ViewFlash(1.0);
// start the splash screen after a bit
// only if we don't have a menu open
// DEUS_EX AMSD Don't do this in multiplayer!!!!
if (Level.NetMode == NM_Standalone)
{
if (whiteVec == vect(-1.0,-1.0,-1.0))
if ((MenuUIWindow(DeusExRootWindow(rootWindow).GetTopWindow()) == None) &&
(ToolWindow(DeusExRootWindow(rootWindow).GetTopWindow()) == None))
ConsoleCommand("OPEN DXONLY");
}
}
// make sure we don't go through the ceiling
ViewVect = vect(0,0,1);
HitActor = Trace(HitLocation, HitNormal, Location + ViewDist * ViewVect, Location);
if ( HitActor != None )
CameraLocation = HitLocation;
else
CameraLocation = Location + ViewDist * ViewVect;
}
}
else
{
// use FrobTime as the cool DeathCam timer
FrobTime = Level.TimeSeconds;
// make sure we don't go through the wall
ViewDist = 190;
ViewVect = vect(1,0,0) >> Rotation;
HitActor = Trace( HitLocation, HitNormal,
Location - ViewDist * vector(CameraRotation), Location, false, vect(12,12,2));
if ( HitActor != None )
CameraLocation = HitLocation;
else
CameraLocation = Location - ViewDist * ViewVect;
}
// don't fog view if we are "paused"
if (DeusExRootWindow(rootWindow).bUIPaused)
{
InstantFog = vect(0,0,0);
InstantFlash = 0;
ViewFlash(1.0);
}
}
Begin:
// Dead players comes back to life with scope view, so this is here to prevent that
if ( DeusExWeapon(inHand) != None )
{
DeusExWeapon(inHand).bZoomed = False;
DeusExWeapon(inHand).RefreshScopeDisplay(Self, True, False);
}
if ( DeusExRootWindow(rootWindow).hud.augDisplay != None )
{
DeusExRootWindow(rootWindow).hud.augDisplay.bVisionActive = False;
DeusExRootWindow(rootWindow).hud.augDisplay.activeCount = 0;
}
// Don't come back to life drugged or posioned
poisonCounter = 0;
poisonTimer = 0;
drugEffectTimer = 0;
// Don't come back to life crouched
bCrouchOn = False;
bWasCrouchOn = False;
bIsCrouching = False;
bForceDuck = False;
lastbDuck = 0;
bDuck = 0;
FrobTime = Level.TimeSeconds;
bBehindView = True;
Velocity = vect(0,0,0);
Acceleration = vect(0,0,0);
DesiredFOV = Default.DesiredFOV;
FinishAnim();
KillShadow();
FlashTimer = 0;
// hide us and spawn the carcass
bHidden = True;
SpawnCarcass();
//DEUS_EX AMSD Players should not leave physical versions of themselves around :)
if (Level.NetMode != NM_Standalone)
HidePlayer();
}
Anyway, looking at the code it seems some of the devs effects are unused. Namely fading to black after five second or whatever.
It seems as if viewfog() cannot be accessed here, and I am assuming it's because this state Ignores all; (Ignores all non-final functions, of which viewfog doesn't seem to be part of).
What can I do to fix this? Final Functions only seem to be Native so I cannot create my own.
This is if I am understanding what is happening to begin with and the issue isn't caused by something else other than Ignores all.