Deus Ex Documentation::DeusEx

AIPrototype.uc (extends DeusExDecoration)

bInvincible=True
ItemName="AI Prototype"
bPushable=False
BaseEyeHeight=50.000000
Mesh=LodMesh'DeusExDeco.AIPrototype'
CollisionRadius=27.280001
CollisionHeight=21.139999
Mass=40.000000
Buoyancy=45.000000



ATM.uc (extends ElectronicDevices)

var ATMWindow atmwindow;
var() string accountNumber;
var() string PIN;
var() int balance;
var() sUserInfo userList[8];
var bool bLockedOut; // true if this ATM is locked out
var() float lockoutDelay; // delay until locked out ATM can be used
var float lockoutTime; // time when ATM was locked out
var float lastHackTime; // last time the ATM was hacked
var localized String msgLockedOut;
var bool bSuckedDryByHack;
lockoutDelay=60.000000
lastHackTime=-9999.000000
msgLockedOut="Terminal is locked out for %d more seconds"
ItemName="Public Banking Terminal"
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.ATM'
SoundRadius=8
SoundVolume=255
AmbientSound=Sound'DeusExSounds.Generic.ElectronicsHum'
CollisionHeight=40.000000
bCollideWorld=False
Mass=400.000000
Buoyancy=200.000000

Frob (Actor Frobber, Inventory frobWith)


local DeusExPlayer Player;
local DeusExRootWindow root;
local float elapsed, delay;


Super.Frob(Frobber, frobWith);

// if we're already using this ATM, get out
if (atmwindow != None)
return;

Player = DeusExPlayer(Frobber);

if (Player != None)
{
if (bLockedOut)
{
// computer skill shortens the lockout duration
delay = lockoutDelay / Player.SkillSystem.GetSkillLevelValue(class'SkillComputer');

elapsed = Level.TimeSeconds - lockoutTime;
if (elapsed < delay)
Player.ClientMessage(Sprintf(msgLockedOut, Int(delay - elapsed)));
else
bLockedOut = False;
}
if (!bLockedOut)
{
root = DeusExRootWindow(Player.rootWindow);
if (root != None)
{
atmWindow = ATMWindow(root.InvokeUIScreen(Class'ATMWindow', True));

if (atmWindow != None)
{
atmWindow.SetCompOwner(Self);
atmWindow.ShowFirstScreen();
}
}
}
}

GetAccountNumber (int userIndex) -> string


if ((userIndex >= 0) && (userIndex < ArrayCount(userList)))
return Caps(userList[userIndex].accountNumber);
else if (userIndex == -1)
return "HACKED";

return "ERR";

GetBalance (int userIndex, float mod) -> int


local int i, sum;


sum = 0;

if ((userIndex >= 0) && (userIndex < ArrayCount(userList)))
sum = userList[userIndex].balance;
else if (userIndex == -1)
{
// if we've been hacked, sum all the accounts
for (i=0; i sum += userList[i].balance;
sum *= mod;
}

return sum;

GetPIN (int userIndex) -> string


if ((userIndex >= 0) && (userIndex < ArrayCount(userList)))
return Caps(userList[userIndex].PIN);
else if (userIndex == -1)
return "HACKED";

return "ERR";

ModBalance (int userIndex, int numCredits, bool bSync)


local ATM atm;
local int i;


if ((userIndex >= 0) && (userIndex < ArrayCount(userList)))
userList[userIndex].balance -= numCredits;
else if (userIndex == -1)
{
// if we've been hacked, zero all the accounts if we have enough to transfer
for (i=0; i userList[i].balance = 0;
}

// sync the balance with all other ATMs on this map
if (bSync)
{
foreach AllActors(class'ATM', atm)
for (i=0; i if (atm != Self)
if ((Caps(userList[userIndex].accountNumber) == atm.GetAccountNumber(i)) &&
(Caps(userList[userIndex].PIN) == atm.GetPIN(i)))
{
atm.ModBalance(i, numCredits, False);
}
}

NumUsers -> int


local int i;


for (i=0; i if (userList[i].accountNumber == "")
break;

return i;




ATMWindow.uc (extends NetworkTerminalATM)




AcousticSensor.uc (extends HackableDevices)

ItemName="Gunfire Acoustic Sensor"
Mesh=LodMesh'DeusExDeco.AcousticSensor'
CollisionRadius=24.400000
CollisionHeight=23.059999
Mass=10.000000
Buoyancy=5.000000

HackAction (Actor Hacker, bool bHacked)


local Actor A;


Super.HackAction(Hacker, bHacked);

if (bHacked)
AIClearEventCallback('WeaponFire');

NoiseHeard (Name eventName, EAIEventState state, XAIParams params)


local Actor A;


if (Event != '')
foreach AllActors(class 'Actor', A, Event)
A.Trigger(Self, GetPlayerPawn());

PostBeginPlay


Super.PostBeginPlay();

AISetEventCallback('WeaponFire', 'NoiseHeard');




ActorDisplayWindow.uc (extends Window)

var class viewClass;
var bool bShowEyes;
var bool bShowArea;
var bool bShowCylinder;
var bool bShowMesh;
var bool bShowZone;
var bool bShowLineOfSight;
var bool bShowData;
var bool bShowVisibility;
var bool bShowState;
var bool bShowEnemy;
var bool bShowInstigator;
var bool bShowBase;
var bool bShowOwner;
var bool bShowBindName;
var bool bShowLightLevel;
var bool bShowDist;
var bool bShowPos;
var bool bShowHealth;
var bool bShowMass;
var bool bShowPhysics;
var bool bShowVelocity;
var bool bShowAcceleration;
var bool bShowLastRendered;
var bool bShowEnemyResponse;
var int maxPoints;
var float sinTable[16];
bShowLineOfSight=True

AreEyesVisible -> Bool


return bShowEyes;

ArePhysicsVisible -> Bool


return bShowPhysics;

DrawCylinder (GC gc, actor trackActor)


local int i;
local vector topCircle[8];
local vector bottomCircle[8];
local float topSide, bottomSide;
local int numPoints;
local DeusExMover dxMover;
local vector center, area;


dxMover = DeusExMover(trackActor);
if (dxMover == None)
{
topSide = trackActor.Location.Z + trackActor.CollisionHeight;
bottomSide = trackActor.Location.Z - trackActor.CollisionHeight;
for (i=0; i {
topCircle[i] = trackActor.Location;
topCircle[i].Z = topSide;
topCircle[i].X += sinTable[i]*trackActor.CollisionRadius;
topCircle[i].Y += sinTable[i+maxPoints/4]*trackActor.CollisionRadius;
bottomCircle[i] = topCircle[i];
bottomCircle[i].Z = bottomSide;
}
numPoints = maxPoints;
}
else
{
dxMover.ComputeMovementArea(center, area);
topCircle[0] = center+area*vect(1,1,1);
topCircle[1] = center+area*vect(1,-1,1);
topCircle[2] = center+area*vect(-1,-1,1);
topCircle[3] = center+area*vect(-1,1,1);
bottomCircle[0] = center+area*vect(1,1,-1);
bottomCircle[1] = center+area*vect(1,-1,-1);
bottomCircle[2] = center+area*vect(-1,-1,-1);
bottomCircle[3] = center+area*vect(-1,1,-1);
numPoints = 4;
}

for (i=0; i DrawLine(gc, topCircle[i], bottomCircle[i]);
for (i=0; i {
DrawLine(gc, topCircle[i], topCircle[i+1]);
DrawLine(gc, bottomCircle[i], bottomCircle[i+1]);
}
DrawLine(gc, topCircle[i], topCircle[0]);
DrawLine(gc, bottomCircle[i], bottomCircle[0]);

DrawLine (GC gc, vector point1, vector point2)


local float fromX, fromY;
local float toX, toY;


gc.SetStyle(DSTY_Normal);
if (ConvertVectorToCoordinates(point1, fromX, fromY) && ConvertVectorToCoordinates(point2, toX, toY))
{
gc.SetTileColorRGB(255, 255, 255);
DrawPoint(gc, fromX, fromY);
DrawPoint(gc, toX, toY);
gc.SetTileColorRGB(128, 128, 128);
Interpolate(gc, fromX, fromY, toX, toY, 8);
}


DrawPoint (GC gc, float xPos, float yPos)


gc.DrawPattern(xPos, yPos, 1, 1, 0, 0, Texture'Solid');

DrawWindow (GC gc)


local float xPos, yPos;
local float centerX, centerY;
local float topY, bottomY;
local float leftX, rightX;
local int i, j, k;
local vector tVect;
local vector cVect;
local PlayerPawnExt player;
local Actor trackActor;
local ScriptedPawn trackPawn;
local bool bValid;
local bool bPointValid;
local float visibility;
local float dist;
local float speed;
local name stateName;
local float temp;
local string str;
local texture skins[9];
local color mainColor;
local byte zoneNum;
local float oldRenderTime;
local float barOffset;
local float barValue;
local float barWidth;
local DeusExMover dxMover;


Super.DrawWindow(gc);

if (viewClass == None)
return;

player = GetPlayerPawn();

if (bShowMesh)
gc.ClearZ();

foreach player.AllActors(viewClass, trackActor)
{
dxMover = DeusExMover(trackActor);
cVect.X = trackActor.CollisionRadius;
cVect.Y = trackActor.CollisionRadius;
cVect.Z = trackActor.CollisionHeight;
tVect = trackActor.Location;
if (bShowEyes && (Pawn(trackActor) != None))
tVect.Z += Pawn(trackActor).BaseEyeHeight;
if (trackActor == player)
{
if (player.bBehindView)
bPointValid = ConvertVectorToCoordinates(tVect, centerX, centerY);
else
bPointValid = FALSE;
}
else if (dxMover != None)
{
if (!bShowLineOfSight || (player.AICanSee(trackActor, 1, false, true, bShowArea) > 0)) // need a better way to do this
bPointValid = ConvertVectorToCoordinates(tVect, centerX, centerY);
else
bPointValid = FALSE;
}
else
{
if (!bShowLineOfSight || (player.AICanSee(trackActor, 1, false, true, bShowArea) > 0))
bPointValid = ConvertVectorToCoordinates(tVect, centerX, centerY);
else
bPointValid = FALSE;
}

if (bPointValid)
{
bValid = FALSE;
if (bShowArea)
{
for (i=-1; i<=1; i+=2)
{
for (j=-1; j<=1; j+=2)
{
for (k=-1; k<=1; k+=2)
{
tVect = cVect;
tVect.X *= i;
tVect.Y *= j;
tVect.Z *= k;
tVect.X += trackActor.Location.X;
tVect.Y += trackActor.Location.Y;
tVect.Z += trackActor.Location.Z;
if (ConvertVectorToCoordinates(tVect, xPos, yPos))
{
if (!bValid)
{
leftX = xPos;
rightX = xPos;
topY = yPos;
bottomY = yPos;
bValid = TRUE;
}
else
{
Extend(xPos, leftX, rightX);
Extend(yPos, topY, bottomY);
}
}
}
}
}
}

if (!bValid)
{
leftX = centerX-10;
rightX = centerX+10;
topY = centerY-10;
bottomY = centerY+10;
bValid = TRUE;
}

gc.EnableDrawing(true);
gc.SetStyle(DSTY_Translucent);
if (bShowZone)
{
zoneNum = trackActor.Region.ZoneNumber;
if (zoneNum == 0)
{
mainColor.R = 255;
mainColor.G = 255;
mainColor.B = 255;
}
else
{
// The following color algorithm was copied from UnRender.cpp...
mainColor.R = (zoneNum*67)&255;
mainColor.G = (zoneNum*1371)&255;
mainColor.B = (zoneNum*1991)&255;
}
}
else
{
mainColor.R = 0;
mainColor.G = 255;
mainColor.B = 0;
}
gc.SetTileColor(mainColor);
if (bShowMesh)
{
SetSkins(trackActor, skins);
oldRenderTime = trackActor.LastRenderTime;
gc.DrawActor(trackActor, false, false, true, 1.0, 1.0, None);
trackActor.LastRenderTime = oldRenderTime;
ResetSkins(trackActor, skins);
}
if (!bShowMesh || bShowArea)
{
gc.SetTileColorRGB(mainColor.R/4, mainColor.G/4, mainColor.B/4);
gc.DrawBox(leftX, topY, 1+rightX-leftX, 1+bottomY-topY, 0, 0, 1, Texture'Solid');
leftX += 1;
rightX -= 1;
topY += 1;
bottomY -= 1;
gc.SetTileColorRGB(mainColor.R*3/16, mainColor.G*3/16, mainColor.B*3/16);
gc.DrawBox(leftX, topY, 1+rightX-leftX, 1+bottomY-topY, 0, 0, 1, Texture'Solid');
leftX += 1;
rightX -= 1;
topY += 1;
bottomY -= 1;
gc.SetTileColorRGB(mainColor.R/8, mainColor.G/8, mainColor.B/8);
gc.DrawBox(leftX, topY, 1+rightX-leftX, 1+bottomY-topY, 0, 0, 1, Texture'Solid');
}

gc.SetStyle(DSTY_Normal);

if (bShowCylinder)
DrawCylinder(gc, trackActor);

if (trackActor.InStasis())
{
gc.SetTileColorRGB(0, 255, 0);
gc.DrawPattern(centerX, centerY-2, 1, 5, 0, 0, Texture'Solid');
gc.DrawPattern(centerX-2, centerY, 5, 1, 0, 0, Texture'Solid');
}
else
{
gc.SetTileColorRGB(255, 255, 255);
gc.DrawPattern(centerX, centerY-3, 1, 7, 0, 0, Texture'Solid');
gc.DrawPattern(centerX-3, centerY, 7, 1, 0, 0, Texture'Solid');
}

str = "";
if (bShowState || bShowData)
{
stateName = trackActor.GetStateName();
str = str $ "|p1'" $ stateName $ "'" $ CR();
}
if (bShowPhysics || bShowData)
{
str = str $ "|c80ff80P=";
switch (trackActor.Physics)
{
case PHYS_None:
str = str $ "PHYS_None";
break;
case PHYS_Walking:
str = str $ "PHYS_Walking";
break;
case PHYS_Falling:
str = str $ "PHYS_Falling";
break;
case PHYS_Swimming:
str = str $ "PHYS_Swimming";
break;
case PHYS_Flying:
str = str $ "PHYS_Flying";
break;
case PHYS_Rotating:
str = str $ "PHYS_Rotating";
break;
case PHYS_Projectile:
str = str $ "PHYS_Projectile";
break;
case PHYS_Rolling:
str = str $ "PHYS_Rolling";
break;
case PHYS_Interpolating:
str = str $ "PHYS_Interpolating";
break;
case PHYS_MovingBrush:
str = str $ "PHYS_MovingBrush";
break;
case PHYS_Spider:
str = str $ "PHYS_Spider";
break;
case PHYS_Trailer:
str = str $ "PHYS_Trailer";
break;
default:
str = str $ "Unknown";
break;
}
str = str $ CR();
}
if (bShowMass || bShowData)
{
str = str $ "|cff80ffM=";
str = str $ trackActor.Mass $ CR();
}
if (bShowEnemy || bShowData)
{
str = str $ "|cff8000E=";
if (Pawn(trackActor) != None)
str = str $ "'" $ Pawn(trackActor).Enemy $ "'" $ CR();
else
str = str $ "n/a" $ CR();
}
if (bShowInstigator || bShowData)
{
str = str $ "|c0080ffI=";
str = str $ "'" $ trackActor.Instigator $ "'" $ CR();
}
if (bShowOwner || bShowData)
{
str = str $ "|c80ffffO=";
str = str $ "'" $ trackActor.Owner $ "'" $ CR();
}
if (bShowBindName || bShowData)
{
str = str $ "|c80b0b0N=";
str = str $ "'" $ trackActor.BindName $ "'" $ CR();
}
if (bShowBase || bShowData)
{
str = str $ "|c808080B=";
str = str $ "'" $ trackActor.Base $ "'" $ CR();
}
if (bShowLastRendered || bShowData)
{
str = str $ "|cffffffR=";
str = str $ "'" $ trackActor.LastRendered() $ "'" $ CR();
}
if (bShowLightLevel || bShowData)
{
visibility = trackActor.AIVisibility(false);
str = str $ "|p4L=" $ visibility*100 $ CR();
}
if (bShowVisibility || bShowData)
{
visibility = player.AICanSee(trackActor, 1.0, true, true, true);
str = str $ "|p7V=" $ visibility*100 $ CR();
}
if (bShowDist || bShowData)
{
// It would be soooo much easier to call
// (trackActor.Location-player.Location).Size(), but noooooo...
// that's only supported in the Actor class!

temp = (trackActor.Location.X - player.Location.X);
dist = temp*temp;
temp = (trackActor.Location.Y - player.Location.Y);
dist += temp*temp;
temp = (trackActor.Location.Z - player.Location.Z);
dist += temp*temp;
dist = sqrt(dist);
str = str $ "|p3D=" $ dist $ CR();
}
if (bShowPos || bShowData)
{
str = str $ "|p2";
str = str $ "X=" $ trackActor.Location.X $ CR() $
"Y=" $ trackActor.Location.Y $ CR() $
"Z=" $ trackActor.Location.Z $ CR();
}
if (bShowVelocity || bShowData)
{
speed = trackActor.Velocity.X*trackActor.Velocity.X;
speed += trackActor.Velocity.Y*trackActor.Velocity.Y;
speed += trackActor.Velocity.Z*trackActor.Velocity.Z;
speed = sqrt(speed);

str = str $ "|c8080ff";
str = str $ "vS=" $ speed $ CR() $
"vX=" $ trackActor.Velocity.X $ CR() $
"vY=" $ trackActor.Velocity.Y $ CR() $
"vZ=" $ trackActor.Velocity.Z $ CR();
}
if (bShowAcceleration || bShowData)
{
speed = trackActor.Acceleration.X*trackActor.Acceleration.X;
speed += trackActor.Acceleration.Y*trackActor.Acceleration.Y;
speed += trackActor.Acceleration.Z*trackActor.Acceleration.Z;
speed = sqrt(speed);

str = str $ "|cff8080";
str = str $ "aS=" $ speed $ CR() $
"aX=" $ trackActor.Acceleration.X $ CR() $
"aY=" $ trackActor.Acceleration.Y $ CR() $
"aZ=" $ trackActor.Acceleration.Z $ CR();
}
if (bShowHealth || bShowData)
{
str = str $ "|p6H=";
if (Pawn(trackActor) != None)
{
str = str $ Pawn(trackActor).Health $ CR();
str = str $ Pawn(trackActor).HealthHead $ CR();
str = str $ Pawn(trackActor).HealthArmRight $ "-" $ Pawn(trackActor).HealthTorso $ "-" $ Pawn(trackActor).HealthArmLeft $ CR();
str = str $ Pawn(trackActor).HealthLegRight $ "-" $ Pawn(trackActor).HealthLegLeft $ CR();

}
else if (DeusExDecoration(trackActor) != None)
str = str $ DeusExDecoration(trackActor).HitPoints $ CR();
else
str = str $ "n/a" $ CR();
}

barOffset = 0;
if (bShowEnemyResponse || bShowData)
{
trackPawn = ScriptedPawn(trackActor);
if (trackPawn != None)
{
barOffset = 8;
barWidth = 50;
barValue = int(FClamp(trackPawn.EnemyReadiness*barWidth+0.5, 1, barWidth));
if (trackPawn.EnemyReadiness <= 0)
barValue = 0;
gc.SetStyle(DSTY_Normal);
gc.SetTileColorRGB(64, 64, 64);
gc.DrawPattern((leftX+rightX-barWidth)/2, bottomY+5, barWidth, barOffset,
0, 0, Texture'Dithered');
if (trackPawn.EnemyReadiness >= 1.0)
{
if (int(GetPlayerPawn().Level.TimeSeconds*4)%2 == 1)
gc.SetTileColorRGB(255, 0, 0);
else
gc.SetTileColorRGB(255, 255, 255);
}
else
gc.SetTileColor(GetColorScaled(1-trackPawn.EnemyReadiness));
gc.DrawPattern((leftX+rightX-barWidth)/2, bottomY+5, barValue, barOffset,
0, 0, Texture'Solid');
barOffset += 5;
}
}

if (str != "")
{
gc.SetAlignments(HALIGN_Center, VALIGN_Top);
gc.SetFont(Font'TechSmall');
//gc.SetTextColorRGB(visibility*255, visibility*255, visibility*255);
gc.SetTextColorRGB(0, 255, 0);
gc.DrawText(leftX-40, bottomY+barOffset+5, 80+rightX-leftX, 280, str);
}

gc.SetTextColor(mainColor);
gc.SetAlignments(HALIGN_Center, VALIGN_Bottom);
gc.SetFont(Font'TechSmall');
gc.DrawText(leftX-40, topY-140, 80+rightX-leftX, 135, GetPlayerPawn().GetItemName(String(trackActor)));
}
}

Extend (float pos, out float left, out float right)


if (left > pos)
left = pos;
if (right < pos)
right = pos;

GetGridTexture (Texture tex) -> Texture


if (tex == None)
return Texture'BlackMaskTex';
else if (tex == Texture'BlackMaskTex')
return Texture'BlackMaskTex';
else if (tex == Texture'GrayMaskTex')
return Texture'BlackMaskTex';
else if (tex == Texture'PinkMaskTex')
return Texture'BlackMaskTex';
else if (tex.USize >= 256)
{
if (tex.VSize >= 256)
return Texture'GridTex256x256';
else
return Texture'GridTex256x128';
}
else if (tex.USize >= 128)
{
if (tex.VSize >= 256)
return Texture'GridTex128x256';
else if (tex.VSize >= 128)
return Texture'GridTex128x128';
else
return Texture'GridTex128x64';
}
else if (tex.USize >= 64)
{
if (tex.VSize >= 128)
return Texture'GridTex64x128';
else if (tex.VSize >= 64)
return Texture'GridTex64x64';
else
return Texture'GridTex64x32';
}
else if (tex.USize >= 32)
{
if (tex.VSize >= 64)
return Texture'GridTex32x64';
else
return Texture'GridTex32x32';
}
else
return Texture'GridTex16x16';

GetViewClass -> Class


return viewClass;

InitWindow


local int i;

Super.InitWindow();

maxPoints = 8;
for (i=0; i sinTable[i] = sin(2*3.1415926*(i/float(maxPoints)));

Interpolate (GC gc, float fromX, float fromY, float toX, float toY, int power)


local float xPos, yPos;
local float deltaX, deltaY;
local float maxDist;
local int points;
local int i;


maxDist = 6;

points = 1;
deltaX = (toX-fromX);
deltaY = (toY-fromY);
while (power >= 0)
{
if ((deltaX >= maxDist) || (deltaX <= -maxDist) || (deltaY >= maxDist) || (deltaY <= -maxDist))
{
deltaX *= 0.5;
deltaY *= 0.5;
points *= 2;
power--;
}
else
break;
}

xPos = fromX;
yPos = fromY;
for (i=0; i {
xPos += deltaX;
yPos += deltaY;
DrawPoint(gc, xPos, yPos);
}

IsAccelerationVisible -> Bool


return bShowAcceleration;

IsAreaVisible -> Bool


return bShowArea;

IsBaseVisible -> Bool


return bShowBase;

IsBindNameVisible -> Bool


return bShowBindName;

IsCylinderVisible -> Bool


return bShowCylinder;

IsDistVisible -> Bool


return bShowDist;

IsEnemyResponseVisible -> Bool


return bShowEnemyResponse;

IsEnemyVisible -> Bool


return bShowEnemy;

IsHealthVisible -> Bool


return bShowHealth;

IsInstigatorVisible -> Bool


return bShowInstigator;

IsLOSVisible -> Bool


return bShowLineOfSight;

IsLastRenderedVisible -> Bool


return bShowLastRendered;

IsLightVisible -> Bool


return bShowLightLevel;

IsMassVisible -> Bool


return bShowMass;

IsMeshVisible -> Bool


return bShowMesh;

IsOwnerVisible -> Bool


return bShowOwner;

IsPosVisible -> Bool


return bShowPos;

IsStateVisible -> Bool


return bShowState;

IsVelocityVisible -> Bool


return bShowVelocity;

IsVisibilityVisible -> Bool


return bShowVisibility;

IsZoneVisible -> Bool


return bShowZone;

ResetSkins (Actor actor, Texture oldSkins[9])


local int i;


for (i=0; i<8; i++)
actor.MultiSkins[i] = oldSkins[i];
actor.Skin = oldSkins[i];

SetSkins (Actor actor, out Texture oldSkins[9])


local int i;
local texture curSkin;


for (i=0; i<8; i++)
oldSkins[i] = actor.MultiSkins[i];
oldSkins[i] = actor.Skin;

for (i=0; i<8; i++)
{
curSkin = actor.GetMeshTexture(i);
actor.MultiSkins[i] = GetGridTexture(curSkin);
}
actor.Skin = GetGridTexture(oldSkins[i]);

SetViewClass (Class newViewClass)


viewClass = newViewClass;

ShowAcceleration (bool bShow)


bShowAcceleration = bShow;

ShowArea (bool bShow)


bShowArea = bShow;

ShowBase (bool bShow)


bShowBase = bShow;

ShowBindName (bool bShow)


bShowBindName = bShow;

ShowCylinder (bool bShow)


bShowCylinder = bShow;

ShowData (bool bShow)


bShowData = bShow;

ShowDist (bool bShow)


bShowDist = bShow;

ShowEnemy (bool bShow)


bShowEnemy = bShow;

ShowEnemyResponse (bool bShow)


bShowEnemyResponse = bShow;

ShowEyes (bool bShow)


bShowEyes = bShow;

ShowHealth (bool bShow)


bShowHealth = bShow;

ShowInstigator (bool bShow)


bShowInstigator = bShow;

ShowLOS (bool bShow)


bShowLineOfSight = bShow;

ShowLastRendered (bool bShow)


bShowLastRendered = bShow;

ShowLight (bool bShow)


bShowLightLevel = bShow;

ShowMass (bool bShow)


bShowMass = bShow;

ShowMesh (bool bShow)


bShowMesh = bShow;

ShowOwner (bool bShow)


bShowOwner = bShow;

ShowPhysics (bool bShow)


bShowPhysics = bShow;

ShowPos (bool bShow)


bShowPos = bShow;

ShowState (bool bShow)


bShowState = bShow;

ShowVelocity (bool bShow)


bShowVelocity = bShow;

ShowVisibility (bool bShow)


bShowVisibility = bShow;

ShowZone (bool bShow)


bShowZone = bShow;




AdaptiveArmor.uc (extends ChargedPickup)

skillNeeded=Class'DeusEx.SkillEnviro'
LoopSound=Sound'DeusExSounds.Pickup.SuitLoop'
ChargedIcon=Texture'DeusExUI.Icons.ChargedIconArmorAdaptive'
ExpireMessage="Thermoptic camo power supply used up"
ItemName="Thermoptic Camo"
ItemArticle="some"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.AdaptiveArmor'
PickupViewMesh=LodMesh'DeusExItems.AdaptiveArmor'
ThirdPersonMesh=LodMesh'DeusExItems.AdaptiveArmor'
Charge=500
LandSound=Sound'DeusExSounds.Generic.PaperHit2'
Icon=Texture'DeusExUI.Icons.BeltIconArmorAdaptive'
largeIcon=Texture'DeusExUI.Icons.LargeIconArmorAdaptive'
largeIconWidth=35
largeIconHeight=49
Description="Integrating woven fiber-optics and an advanced computing system, thermoptic camo can render an agent invisible to both humans and bots by dynamically refracting light and radar waves; however, the high power drain makes it impractial for more than short-term use, after which the circuitry is fused and it becomes useless."
beltDescription="THRM CAMO"
Mesh=LodMesh'DeusExItems.AdaptiveArmor'
CollisionRadius=11.500000
CollisionHeight=13.810000
Mass=30.000000
Buoyancy=20.000000



AirBubble.uc (extends Effects)

var() float RiseRate;
var vector OrigVel;
RiseRate=50.000000
Physics=PHYS_Projectile
LifeSpan=10.000000
DrawType=DT_Sprite
Style=STY_Translucent
Texture=Texture'DeusExItems.Skins.FlatFXTex45'
DrawScale=0.050000

BeginState


Super.BeginState();

OrigVel = Velocity;
DrawScale += FRand() * 0.1;

Tick (float deltaTime)


Velocity.X = OrigVel.X + 8 - FRand() * 17;
Velocity.Y = OrigVel.Y + 8 - FRand() * 17;
Velocity.Z = RiseRate * (FRand() * 0.2 + 0.9);

if (!Region.Zone.bWaterZone)
Destroy();




AlarmLight.uc (extends DeusExDecoration)

var() ESkinColor SkinColor;
var() bool bIsOn;
bIsOn=True
FragType=Class'DeusEx.PlasticFragment'
ItemName="Alarm Light"
bPushable=False
Physics=PHYS_Rotating
Texture=Texture'DeusExDeco.Skins.AlarmLightTex3'
Mesh=LodMesh'DeusExDeco.AlarmLight'
CollisionRadius=4.000000
CollisionHeight=6.140000
LightType=LT_Steady
LightEffect=LE_Spotlight
LightBrightness=255
LightRadius=32
LightCone=32
bFixedRotationDir=True
Mass=20.000000
Buoyancy=15.000000
RotationRate=(Yaw=98304)

BeginPlay


Super.BeginPlay();

SetLightColor(SkinColor);

if (!bIsOn)
{
MultiSkins[1] = Texture'BlackMaskTex';
LightType = LT_None;
bFixedRotationDir = False;
}

SetLightColor (ESkinColor color)


switch (SkinColor)
{
case SC_Red: MultiSkins[1] = Texture'AlarmLightTex2';
MultiSkins[2] = Texture'AlarmLightTex3';
Texture = Texture'AlarmLightTex3';
LightHue = 0;
break;
case SC_Green: MultiSkins[1] = Texture'AlarmLightTex4';
MultiSkins[2] = Texture'AlarmLightTex5';
Texture = Texture'AlarmLightTex5';
LightHue = 64;
break;
case SC_Blue: MultiSkins[1] = Texture'AlarmLightTex6';
MultiSkins[2] = Texture'AlarmLightTex7';
Texture = Texture'AlarmLightTex7';
LightHue = 160;
break;
case SC_Amber: MultiSkins[1] = Texture'AlarmLightTex8';
MultiSkins[2] = Texture'AlarmLightTex9';
Texture = Texture'AlarmLightTex9';
LightHue = 36;
break;
}

Trigger (Actor Other, Pawn Instigator)


if (!bIsOn)
{
bIsOn = True;
SetLightColor(SkinColor);
LightType = LT_Steady;
bFixedRotationDir = True;
}

Super.Trigger(Other, Instigator);

UnTrigger (Actor Other, Pawn Instigator)


if (bIsOn)
{
bIsOn = False;
MultiSkins[1] = Texture'BlackMaskTex';
LightType = LT_None;
bFixedRotationDir = False;
}

Super.UnTrigger(Other, Instigator);




AlarmUnit.uc (extends HackableDevices)

var() int alarmTimeout;
var localized string msgActivated;
var localized string msgDeactivated;
var bool bActive;
var float curTime;
var Pawn alarmInstigator;
var Vector alarmLocation;
var() name Alliance;
var Pawn associatedPawn;
var bool bDisabled;
var bool bConfused; // used when hit by EMP
var float confusionTimer; // how long until unit resumes normal operation
var float confusionDuration; // how long does EMP hit last?
alarmTimeout=30
msgActivated="Alarm activated"
msgDeactivated="Alarm deactivated"
confusionDuration=10.000000
HitPoints=50
minDamageThreshold=50
bInvincible=False
ItemName="Alarm Sounder Panel"
Mesh=LodMesh'DeusExDeco.AlarmUnit'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
SoundRadius=16
SoundVolume=192
AmbientSound=Sound'DeusExSounds.Generic.AlarmUnitHum'
CollisionRadius=9.720000
CollisionHeight=9.720000
LightBrightness=255
LightRadius=1
Mass=10.000000
Buoyancy=5.000000

HackAction (Actor Hacker, bool bHacked)


Super.HackAction(Hacker, bHacked);

if (bHacked)
{
if (bActive)
{
UnTrigger(Hacker, Pawn(Hacker));
bDisabled = True;
LightType = LT_None;
MultiSkins[1] = Texture'BlackMaskTex';
}
/* else // don't actually ever set off the alarm
{
Trigger(Hacker, Pawn(Hacker));
bDisabled = False;
LightType = LT_None;
MultiSkins[1] = Texture'PinkMaskTex';
}*/
}

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


if (DamageType == 'EMP')
{
confusionTimer = 0;
if (!bConfused)
{
curTime = alarmTimeout;
bConfused = True;
PlaySound(sound'EMPZap', SLOT_None,,, 1280);
UnTrigger(Self, None);
}
return;
}

Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);

Tick (float deltaTime)


Super.Tick(deltaTime);

if (bDisabled)
return;

// if we've been EMP'ed, act confused
if (bConfused)
{
confusionTimer += deltaTime;

// randomly flash the light
if (FRand() > 0.95)
MultiSkins[1] = Texture'AlarmUnitTex2';
else
MultiSkins[1] = Texture'PinkMaskTex';

if (confusionTimer > confusionDuration)
{
bConfused = False;
confusionTimer = 0;
MultiSkins[1] = Texture'AlarmUnitTex2';
}

return;
}

if (bActive)
{
curTime += deltaTime;
if (curTime >= alarmTimeout)
{
UnTrigger(Self, None);
return;
}

// flash the light and texture
if ((Level.TimeSeconds % 0.5) > 0.25)
{
LightType = LT_Steady;
MultiSkins[1] = Texture'AlarmUnitTex2';
}
else
{
LightType = LT_None;
MultiSkins[1] = Texture'PinkMaskTex';
}
}

Trigger (Actor Other, Pawn Instigator)


local Actor A;


if (bConfused || bDisabled)
return;

Super.Trigger(Other, Instigator);

if (!bActive)
{
if (Instigator != None)
Instigator.ClientMessage(msgActivated);
bActive = True;
AmbientSound = Sound'Klaxon2';
SoundRadius = 64;
SoundVolume = 128;
curTime = 0;
LightType = LT_Steady;
MultiSkins[1] = Texture'AlarmUnitTex2';
alarmInstigator = Instigator;
/* taken out for now...
if (Instigator != None)
alarmLocation = Instigator.Location-vect(0,0,1)*(Instigator.CollisionHeight-1);
else
*/
alarmLocation = Location;
UpdateAIEvents();
UpdateGroup(Other, Instigator, true);

// trigger the event
if (Event != '')
foreach AllActors(class'Actor', A, Event)
A.Trigger(Self, Instigator);

// make sure we can't go into stasis while we're alarming
bStasis = False;
}

UnTrigger (Actor Other, Pawn Instigator)


if (bConfused || bDisabled)
return;

Super.UnTrigger(Other, Instigator);

if (bActive)
{
if (Instigator != None)
Instigator.ClientMessage(msgDeactivated);
bActive = False;
AmbientSound = Default.AmbientSound;
SoundRadius = 16;
SoundVolume = 192;
curTime = 0;
LightType = LT_None;
MultiSkins[1] = Texture'PinkMaskTex';
UpdateAIEvents();
UpdateGroup(Other, Instigator, false);

// reset our stasis info
bStasis = Default.bStasis;
}

UpdateAIEvents


if (bActive)
{
// Make noise and light
AIStartEvent('Alarm', EAITYPE_Audio, SoundVolume/255.0, 25*(SoundRadius+1));
}
else
{
// Stop making noise and light
AIEndEvent('Alarm', EAITYPE_Audio);
}

UpdateGroup (Actor Other, Pawn Instigator, bool bActivated)


local AlarmUnit unit;


// Only do this if we have a group tag set
if (Tag != '')
{
// Trigger (or untrigger) every alarm with the same tag
foreach AllActors(Class'AlarmUnit', unit, Tag)
{
if (bActivated)
unit.Trigger(Other, Instigator);
else
unit.UnTrigger(Other, Instigator);
}
}




AlexJacobson.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.AlexJacobsonCarcass'
WalkingSpeed=0.296000
bImportant=True
bInvincible=True
walkAnimMult=0.750000
runAnimMult=0.700000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S'
MultiSkins(0)=Texture'DeusExCharacters.Skins.AlexJacobsonTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.AlexJacobsonTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.AlexJacobsonTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.AlexJacobsonTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex1'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="AlexJacobson"
FamiliarName="Alex Jacobson"
UnfamiliarName="Hacker"



AlexJacobsonCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.AlexJacobsonTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.AlexJacobsonTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.AlexJacobsonTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.AlexJacobsonTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex1'
CollisionRadius=40.000000



AlignWindow.uc (extends Window)

var float childSpacing;
var EVAlign childVAlign;

ChildRequestedReconfiguration (window childWin) -> bool


return False;

ConfigurationChanged


local float tempWidth, tempHeight;
local Window child;


// just for safety
tempWidth = width;
tempHeight = height;
ComputeChildSizes(true, tempWidth, true, tempHeight);

child = GetBottomChild();
while (child != None)
{
child.ConfigureChild(child.holdX, child.holdY, child.holdWidth, child.holdHeight);
child = child.GetHigherSibling();
}

SetChildSpacing (float newChildSpacing)


if (childSpacing != newChildSpacing)
{
childSpacing = newChildSpacing;
AskParentForReconfigure();
}

SetChildVAlignment (EVAlign newChildVAlign)


if (childVAlign != newChildVAlign)
{
childVAlign = newChildVAlign;
AskParentForReconfigure();
}




AllianceTrigger.uc (extends Trigger)

var() Name AllianceName;
var() float AllianceLevel;
var() bool bPermanent;
var() name Alliance;
var() InitialAllianceInfo Alliances[8];
bTriggerOnceOnly=True
CollisionRadius=96.000000

SetAlliances -> bool


local ScriptedPawn P;
local int i;


// find the target NPC to set alliances
if (Event != '')
foreach AllActors (class'ScriptedPawn', P, Event)
{
P.SetAlliance(Alliance);
for (i=0; i if (Alliances[i].AllianceName != '')
P.ChangeAlly(Alliances[i].AllianceName, Alliances[i].AllianceLevel, Alliances[i].bPermanent);
}

return True;

Touch (Actor Other)


if (!IsRelevant(Other))
return;

if (SetAlliances())
if (bTriggerOnceOnly)
Destroy();

Trigger (Actor Other, Pawn Instigator)


if (SetAlliances())
{
Super.Trigger(Other, Instigator);
if (bTriggerOnceOnly)
Destroy();
}




AmbientSoundTriggered.uc (extends AmbientSound)

var Sound savedSound;
var() bool bActive;
var() bool bTriggerOnceOnly;
var bool bAlreadyHit;
bActive=True

PostBeginPlay


Super.PostBeginPlay();

savedSound = AmbientSound;

if (!bActive)
AmbientSound = None;

Trigger (Actor Other, Pawn Instigator)


if (bTriggerOnceOnly && bAlreadyHit)
return;

Super.Trigger(Other, Instigator);

bActive = !bActive;
if (bActive)
AmbientSound = savedSound;
else
AmbientSound = None;

bAlreadyHit = True;

UnTrigger (Actor Other, Pawn Instigator)


if (bTriggerOnceOnly && bAlreadyHit)
return;

Super.UnTrigger(Other, Instigator);

bActive = False;
AmbientSound = None;

bAlreadyHit = True;




AmbrosiaPool.uc (extends DeusExDecal)

var float spreadTime;
var float maxDrawScale;
var float time;
spreadTime=5.000000
maxDrawScale=1.500000
Texture=Texture'DeusExItems.Skins.FlatFXTex48'

Tick (float deltaTime)


time += deltaTime;
if (time <= spreadTime)
{
DrawScale = maxDrawScale * time / spreadTime;
ReattachDecal(vect(0.1,0.1,0));
}




Ammo10mm.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=6
MaxAmmo=150
ItemName="10mm Ammo"
ItemArticle="some"
PickupViewMesh=LodMesh'DeusExItems.Ammo10mm'
Icon=Texture'DeusExUI.Icons.BeltIconAmmo10mm'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmo10mm'
largeIconWidth=44
largeIconHeight=31
Description="With their combination of high stopping power and low recoil, pistols chambered for the 10mm round have become the sidearms of choice for paramilitary forces around the world."
beltDescription="10MM AMMO"
Mesh=LodMesh'DeusExItems.Ammo10mm'
CollisionRadius=8.500000
CollisionHeight=3.770000
bCollideActors=True

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
AmmoAmount = 9;

UseAmmo (int AmountNeeded) -> bool


local vector offset, tempvec, X, Y, Z;
local ShellCasing shell;
local DeusExWeapon W;


if (Super.UseAmmo(AmountNeeded))
{
GetAxes(Pawn(Owner).ViewRotation, X, Y, Z);
offset = Owner.CollisionRadius * X + 0.3 * Owner.CollisionRadius * Y;
tempvec = 0.8 * Owner.CollisionHeight * Z;
offset.Z += tempvec.Z;

// use silent shells if the weapon has been silenced
W = DeusExWeapon(Pawn(Owner).Weapon);
if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
{
shell = None;
}
else
{
if ((W != None) && ((W.NoiseLevel < 0.1) || W.bHasSilencer))
shell = spawn(class'ShellCasingSilent',,, Owner.Location + offset);
else
shell = spawn(class'ShellCasing',,, Owner.Location + offset);
}

if (shell != None)
{
shell.Velocity = (FRand()*20+90) * Y + (10-FRand()*20) * X;
shell.Velocity.Z = 0;
}
return True;
}

return False;




Ammo20mm.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=4
MaxAmmo=32
ItemName="20mm HE Ammo"
ItemArticle="some"
PickupViewMesh=LodMesh'DeusExItems.Ammo20mm'
LandSound=Sound'DeusExSounds.Generic.MetalHit1'
Icon=Texture'DeusExUI.Icons.BeltIconAmmo20mm'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmo20mm'
largeIconWidth=47
largeIconHeight=37
Description="The 20mm high-explosive round complements the standard 7.62x51mm assault rifle by adding the capability to clear small rooms, foxholes, and blind corners using an underhand launcher."
beltDescription="20MM AMMO"
Mesh=LodMesh'DeusExItems.Ammo20mm'
CollisionRadius=9.500000
CollisionHeight=4.750000
bCollideActors=True



Ammo3006.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=6
MaxAmmo=96
ItemName="30.06 Ammo"
ItemArticle="some"
PickupViewMesh=LodMesh'DeusExItems.Ammo3006'
Icon=Texture'DeusExUI.Icons.BeltIconAmmo3006'
largeIconWidth=43
largeIconHeight=31
Description="Its high velocity and accuracy have made sniper rifles using the 30.06 round the preferred tool of individuals requiring 'one shot, one kill' for over fifty years."
beltDescription="3006 AMMO"
Mesh=LodMesh'DeusExItems.Ammo3006'
CollisionRadius=8.000000
CollisionHeight=3.860000
bCollideActors=True

UseAmmo (int AmountNeeded) -> bool


local vector offset, tempvec, X, Y, Z;
local ShellCasing shell;
local DeusExWeapon W;


if (Super.UseAmmo(AmountNeeded))
{
GetAxes(Pawn(Owner).ViewRotation, X, Y, Z);
offset = Owner.CollisionRadius * X + 0.3 * Owner.CollisionRadius * Y;
tempvec = 0.8 * Owner.CollisionHeight * Z;
offset.Z += tempvec.Z;

// use silent shells if the weapon has been silenced
W = DeusExWeapon(Pawn(Owner).Weapon);
if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
{
shell = None;
}
else
{
if ((W != None) && ((W.NoiseLevel < 0.1) || W.bHasSilencer))
shell = spawn(class'ShellCasingSilent',,, Owner.Location + offset);
else
shell = spawn(class'ShellCasing',,, Owner.Location + offset);
}

if (shell != None)
{
shell.Velocity = (FRand()*20+90) * Y + (10-FRand()*20) * X;
shell.Velocity.Z = 0;
}
return True;
}

return False;




Ammo762mm.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=30
MaxAmmo=300
ItemName="7.62x51mm Ammo"
ItemArticle="some"
PickupViewMesh=LodMesh'DeusExItems.Ammo762mm'
LandSound=Sound'DeusExSounds.Generic.MetalHit1'
Icon=Texture'DeusExUI.Icons.BeltIconAmmo762'
largeIconWidth=46
largeIconHeight=34
Description="The 7.62x51mm (NATO) round was chiefly used by anti-terrorist units equipped with assault rifles for close-quarters combat until its widespread adoption among national security forces requiring enhanced combat responsiveness made it ubiquitous."
beltDescription="7.62 AMMO"
Mesh=LodMesh'DeusExItems.Ammo762mm'
CollisionRadius=6.000000
CollisionHeight=0.750000
bCollideActors=True

SimUseAmmo -> bool


local vector offset, tempvec, X, Y, Z;
local ShellCasing shell;
local DeusExWeapon W;


if ( AmmoAmount > 0 )
{
GetAxes(Pawn(Owner).ViewRotation, X, Y, Z);
offset = Owner.CollisionRadius * X + 0.3 * Owner.CollisionRadius * Y;
tempvec = 0.8 * Owner.CollisionHeight * Z;
offset.Z += tempvec.Z;

W = DeusExWeapon(Pawn(Owner).Weapon);

if ((W != None) && ((W.NoiseLevel < 0.1) || W.bHasSilencer))
shell = spawn(class'ShellCasingSilent',,, Owner.Location + offset);
else
shell = spawn(class'ShellCasing',,, Owner.Location + offset);

shell.RemoteRole = ROLE_None;

if (shell != None)
{
shell.Velocity = (FRand()*20+90) * Y + (10-FRand()*20) * X;
shell.Velocity.Z = 0;
}
return True;
}
return False;

UseAmmo (int AmountNeeded) -> bool


local vector offset, tempvec, X, Y, Z;
local ShellCasing shell;
local DeusExWeapon W;


if (Super.UseAmmo(AmountNeeded))
{
GetAxes(Pawn(Owner).ViewRotation, X, Y, Z);
offset = Owner.CollisionRadius * X + 0.3 * Owner.CollisionRadius * Y;
tempvec = 0.8 * Owner.CollisionHeight * Z;
offset.Z += tempvec.Z;

// use silent shells if the weapon has been silenced
W = DeusExWeapon(Pawn(Owner).Weapon);
if ( DeusExMPGame(Level.Game) != None )
{
if ( Level.NetMode == NM_ListenServer )
{
if ((W != None) && ((W.NoiseLevel < 0.1) || W.bHasSilencer))
shell = spawn(class'ShellCasingSilent',,, Owner.Location + offset);
else
shell = spawn(class'ShellCasing',,, Owner.Location + offset);

shell.RemoteRole = ROLE_None;
}
else
shell = None;
}
else
{
if ((W != None) && ((W.NoiseLevel < 0.1) || W.bHasSilencer))
shell = spawn(class'ShellCasingSilent',,, Owner.Location + offset);
else
shell = spawn(class'ShellCasing',,, Owner.Location + offset);
}

if (shell != None)
{
shell.Velocity = (FRand()*20+90) * Y + (10-FRand()*20) * X;
shell.Velocity.Z = 0;
}
return True;
}

return False;




AmmoBattery.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=4
MaxAmmo=40
ItemName="Prod Charger"
ItemArticle="a"
PickupViewMesh=LodMesh'DeusExItems.AmmoProd'
LandSound=Sound'DeusExSounds.Generic.PlasticHit2'
Icon=Texture'DeusExUI.Icons.BeltIconAmmoProd'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmoProd'
largeIconWidth=17
largeIconHeight=46
Description="A portable charging unit for the riot prod."
beltDescription="CHARGER"
Mesh=LodMesh'DeusExItems.AmmoProd'
CollisionRadius=2.100000
CollisionHeight=5.600000
bCollideActors=True



AmmoDart.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=4
MaxAmmo=60
ItemName="Darts"
ItemArticle="some"
PickupViewMesh=LodMesh'DeusExItems.AmmoDart'
LandSound=Sound'DeusExSounds.Generic.PaperHit2'
Icon=Texture'DeusExUI.Icons.BeltIconAmmoDartsNormal'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmoDartsNormal'
largeIconWidth=20
largeIconHeight=47
Description="The mini-crossbow dart is a favored weapon for many 'wet' operations; however, silent kills require a high degree of skill."
beltDescription="DART"
Mesh=LodMesh'DeusExItems.AmmoDart'
CollisionRadius=8.500000
CollisionHeight=2.000000
bCollideActors=True

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
AmmoAmount = 6;




AmmoDartFlare.uc (extends AmmoDart)

ItemName="Flare Darts"
Icon=Texture'DeusExUI.Icons.BeltIconAmmoDartsFlare'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmoDartsFlare'
Description="Mini-crossbow flare darts use a slow-burning incendiary device, ignited on impact, to provide illumination of a targeted area."
beltDescription="FLR DART"
Skin=Texture'DeusExItems.Skins.AmmoDartTex2'



AmmoDartPoison.uc (extends AmmoDart)

ItemName="Tranquilizer Darts"
Icon=Texture'DeusExUI.Icons.BeltIconAmmoDartsPoison'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmoDartsPoison'
Description="A mini-crossbow dart tipped with a succinylcholine-variant that causes complete skeletal muscle relaxation, effectively incapacitating a target in a non-lethal manner."
beltDescription="TRQ DART"
Skin=Texture'DeusExItems.Skins.AmmoDartTex3'



AmmoEMPGrenade.uc (extends DeusExAmmo)

AmmoAmount=1
MaxAmmo=10
PickupViewMesh=LodMesh'DeusExItems.TestBox'
Icon=Texture'DeusExUI.Icons.BeltIconEMPGrenade'
beltDescription="EMP GREN"
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True



AmmoGasGrenade.uc (extends DeusExAmmo)

AmmoAmount=1
MaxAmmo=10
PickupViewMesh=LodMesh'DeusExItems.TestBox'
Icon=Texture'DeusExUI.Icons.BeltIconGasGrenade'
beltDescription="GAS GREN"
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True



AmmoGraySpit.uc (extends DeusExAmmo)

AmmoAmount=20
MaxAmmo=60
PickupViewMesh=LodMesh'DeusExItems.TestBox'
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True



AmmoGreaselSpit.uc (extends DeusExAmmo)

AmmoAmount=20
MaxAmmo=60
PickupViewMesh=LodMesh'DeusExItems.TestBox'
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True



AmmoLAM.uc (extends DeusExAmmo)

AmmoAmount=1
MaxAmmo=10
PickupViewMesh=LodMesh'DeusExItems.TestBox'
Icon=Texture'DeusExUI.Icons.BeltIconLAM'
beltDescription="LAM"
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True



AmmoNanoVirusGrenade.uc (extends DeusExAmmo)

AmmoAmount=1
MaxAmmo=10
PickupViewMesh=LodMesh'DeusExItems.TestBox'
Icon=Texture'DeusExUI.Icons.BeltIconWeaponNanoVirus'
beltDescription="SCRM GREN"
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True



AmmoNapalm.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=100
MaxAmmo=400
ItemName="Napalm Canister"
ItemArticle="a"
PickupViewMesh=LodMesh'DeusExItems.AmmoNapalm'
LandSound=Sound'DeusExSounds.Generic.GlassDrop'
Icon=Texture'DeusExUI.Icons.BeltIconAmmoNapalm'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmoNapalm'
largeIconWidth=46
largeIconHeight=42
Description="A pressurized canister of jellied gasoline for use with flamethrowers.|n|n The canister is double-walled to minimize accidental detonation caused by stray bullets during a firefight. -- Sam Carter "
beltDescription="NAPALM"
Mesh=LodMesh'DeusExItems.AmmoNapalm'
CollisionRadius=3.130000
CollisionHeight=11.480000
bCollideActors=True



AmmoNone.uc (extends DeusExAmmo)

PickupViewMesh=LodMesh'DeusExItems.TestBox'
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True



AmmoPepper.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=100
MaxAmmo=400
ItemName="Pepper Cartridge"
ItemArticle="a"
PickupViewMesh=LodMesh'DeusExItems.AmmoPepper'
LandSound=Sound'DeusExSounds.Generic.GlassHit1'
Icon=Texture'DeusExUI.Icons.BeltIconAmmoPepper'
largeIconWidth=19
largeIconHeight=45
Description="'ANTIGONE pepper spray will incapacitate your attacker in UNDER TWO SECONDS. ANTIGONE -- better BLIND than DEAD. NOTE: Keep away from children under the age of five. Contents under pressure.'"
beltDescription="PPR CART"
Mesh=LodMesh'DeusExItems.AmmoPepper'
CollisionRadius=1.440000
CollisionHeight=3.260000
bCollideActors=True



AmmoPlasma.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=12
MaxAmmo=84
ItemName="Plasma Clip"
ItemArticle="a"
PickupViewMesh=LodMesh'DeusExItems.AmmoPlasma'
LandSound=Sound'DeusExSounds.Generic.PlasticHit2'
Icon=Texture'DeusExUI.Icons.BeltIconAmmoPlasma'
largeIconWidth=22
largeIconHeight=46
Description="A clip of extruded, magnetically-doped plastic slugs that can be heated and delivered with devastating effect using the plasma gun."
beltDescription="PMA CLIP"
Mesh=LodMesh'DeusExItems.AmmoPlasma'
CollisionRadius=4.300000
CollisionHeight=8.440000
bCollideActors=True



AmmoRocket.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=4
MaxAmmo=20
ItemName="Rockets"
ItemArticle="some"
PickupViewMesh=LodMesh'DeusExItems.GEPAmmo'
LandSound=Sound'DeusExSounds.Generic.WoodHit2'
Icon=Texture'DeusExUI.Icons.BeltIconAmmoRockets'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmoRockets'
largeIconWidth=46
largeIconHeight=36
Description="A gyroscopically stabilized rocket with limited onboard guidance systems for in-flight course corrections. Engineered for use with the GEP gun."
beltDescription="ROCKET"
Mesh=LodMesh'DeusExItems.GEPAmmo'
CollisionRadius=18.000000
CollisionHeight=7.800000
bCollideActors=True



AmmoRocketMini.uc (extends DeusExAmmo)

AmmoAmount=20
MaxAmmo=60
PickupViewMesh=LodMesh'DeusExItems.TestBox'
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True



AmmoRocketRobot.uc (extends DeusExAmmo)

AmmoAmount=20
MaxAmmo=60
PickupViewMesh=LodMesh'DeusExItems.TestBox'
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True



AmmoRocketWP.uc (extends AmmoRocket)

ItemName="WP Rockets"
Icon=Texture'DeusExUI.Icons.BeltIconAmmoWPRockets'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmoWPRockets'
largeIconWidth=45
largeIconHeight=37
Description="The white-phosphorus rocket, or 'wooly peter,' was designed to expand the mission profile of the GEP gun. While it does minimal damage upon detonation, the explosion will spread a cloud of particularized white phosphorus that ignites immediately upon contact with the air."
beltDescription="WP ROCKET"
Skin=Texture'DeusExItems.Skins.GEPAmmoTex2'



AmmoSabot.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=12
MaxAmmo=96
ItemName="12 Gauge Sabot Shells"
ItemArticle="some"
PickupViewMesh=LodMesh'DeusExItems.AmmoShell'
Icon=Texture'DeusExUI.Icons.BeltIconAmmoSabot'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmoSabot'
largeIconWidth=35
largeIconHeight=46
Description="A 12 gauge shotgun shell surrounding a solid core of tungsten that can punch through all but the thickest hardened steel armor at close range; however, its ballistic profile will result in minimal damage to soft targets."
beltDescription="SABOT"
Skin=Texture'DeusExItems.Skins.AmmoShellTex2'
Mesh=LodMesh'DeusExItems.AmmoShell'
CollisionRadius=9.300000
CollisionHeight=10.210000
bCollideActors=True

UseAmmo (int AmountNeeded) -> bool


local vector offset, tempvec, X, Y, Z;
local ShellCasing2 shell;


if (Super.UseAmmo(AmountNeeded))
{
GetAxes(Pawn(Owner).ViewRotation, X, Y, Z);
offset = Owner.CollisionRadius * X + 0.3 * Owner.CollisionRadius * Y;
tempvec = 0.8 * Owner.CollisionHeight * Z;
offset.Z += tempvec.Z;
if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
{
shell = None;
}
else
{
shell = spawn(class'ShellCasing2',,, Owner.Location + offset);
}
if (shell != None)
{
shell.Velocity = (FRand()*20+90) * Y + (10-FRand()*20) * X;
shell.Velocity.Z = 0;
}
return True;
}

return False;




AmmoShell.uc (extends DeusExAmmo)

bShowInfo=True
AmmoAmount=12
MaxAmmo=96
ItemName="12 Gauge Buckshot Shells"
ItemArticle="some"
PickupViewMesh=LodMesh'DeusExItems.AmmoShell'
Icon=Texture'DeusExUI.Icons.BeltIconAmmoShells'
largeIcon=Texture'DeusExUI.Icons.LargeIconAmmoShells'
largeIconWidth=34
largeIconHeight=45
Description="Standard 12 gauge shotgun shell; very effective for close-quarters combat against soft targets, but useless against body armor."
beltDescription="BUCKSHOT"
Mesh=LodMesh'DeusExItems.AmmoShell'
CollisionRadius=9.300000
CollisionHeight=10.210000
bCollideActors=True

SimUseAmmo -> bool


local vector offset, tempvec, X, Y, Z;
local ShellCasing2 shell;


if ( AmmoAmount > 0 )
{
GetAxes(Pawn(Owner).ViewRotation, X, Y, Z);
offset = Owner.CollisionRadius * X + 0.3 * Owner.CollisionRadius * Y;
tempvec = 0.8 * Owner.CollisionHeight * Z;
offset.Z += tempvec.Z;

shell = spawn(class'ShellCasing2',,, Owner.Location + offset);
shell.RemoteRole = ROLE_None;

if (shell != None)
{
shell.Velocity = (FRand()*20+90) * Y + (10-FRand()*20) * X;
shell.Velocity.Z = 0;
}
return True;
}
return False;

UseAmmo (int AmountNeeded) -> bool


local vector offset, tempvec, X, Y, Z;
local ShellCasing2 shell;


if (Super.UseAmmo(AmountNeeded))
{
GetAxes(Pawn(Owner).ViewRotation, X, Y, Z);
offset = Owner.CollisionRadius * X + 0.3 * Owner.CollisionRadius * Y;
tempvec = 0.8 * Owner.CollisionHeight * Z;
offset.Z += tempvec.Z;
if ( DeusExMPGame(Level.Game) != None )
{
if ( Level.NetMode == NM_ListenServer )
{
shell = spawn(class'ShellCasing2',,, Owner.Location + offset);
shell.RemoteRole = ROLE_None;
}
else
shell = None;
}
else
{
shell = spawn(class'ShellCasing2',,, Owner.Location + offset);
}
if (shell != None)
{
shell.Velocity = (FRand()*20+90) * Y + (10-FRand()*20) * X;
shell.Velocity.Z = 0;
}
return True;
}
return False;




AmmoShuriken.uc (extends DeusExAmmo)

AmmoAmount=5
MaxAmmo=25
PickupViewMesh=LodMesh'DeusExItems.TestBox'
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=22.500000
CollisionHeight=16.000000
bCollideActors=True

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
AmmoAmount = 7;




Animal.uc (extends ScriptedPawn)

var bool bPlayDying;
var float FoodTimer;
var int FoodIndex;
var Actor Food;
var Class FoodClass;
var int FoodDamage;
var int FoodHealth;
var bool bBefriendFoodGiver;
var bool bPauseWhenEating;
var bool bMessyEater;
var bool bFleeBigPawns;
var Actor BestFood;
var float BestDist;
var float fleePawnTimer;
var float aggressiveTimer;
var float checkAggTimer;
var bool bFoodOverridesAttack;
FoodDamage=10
FoodHealth=3
maxRange=512.000000
MinHealth=5.000000
bCanBleed=False
bCanSit=False
bAvoidAim=False
bAvoidHarm=False
bHateShot=False
bReactProjectiles=False
bFearIndirectInjury=True
bEmitDistress=False
RaiseAlarm=RAISEALARM_Never
MaxProvocations=0
SurprisePeriod=0.000000
ShadowScale=0.500000
walkAnimMult=1.000000
bCanStrafe=False
bCanSwim=False
bCanOpenDoors=False
bIsHuman=False
bCanGlide=True
Health=10
VisibilityThreshold=0.006000
BindName="Animal"

AnimEnd


PlayWaiting();

BeginState


StandUp();
SetEnemy(None, EnemyLastSeen, true);
Disable('AnimEnd');
SetDistress(false);
if (!bFoodOverridesAttack)
ResetReactions();
else if (aggressiveTimer > 0)
ResetReactions();
else
BlockReactions();

Chomp


Munch(Food); // mmm... finger-lickin' good!

EndState


ResetReactions();
Food = None;
BestFood = None;

FleeFromPawn (Pawn fleePawn)


SetEnemy(fleePawn, , true);
GotoState('AvoidingPawn');

FrightenedByPawn -> Pawn


local pawn candidate;
local bool bCheck;
local Pawn fearPawn;


fearPawn = None;
if ((!bFleeBigPawns) || (!bBlockActors && !bBlockPlayers))
return fearPawn;

foreach RadiusActors(Class'Pawn', candidate, 500)
{
bCheck = false;
if (!ClassIsChildOf(candidate.Class, Class))
{
if (candidate.bBlockActors)
{
if (bBlockActors && !candidate.bIsPlayer)
bCheck = true;
else if (bBlockPlayers && candidate.bIsPlayer)
bCheck = true;
}
}

if (bCheck)
{
if ((candidate.MaxStepHeight < CollisionHeight*1.5) && (candidate.CollisionHeight*0.5 <= CollisionHeight))
bCheck = false;
}

if (bCheck)
{
if (ShouldBeStartled(candidate))
{
fearPawn = candidate;
break;
}
}
}

return fearPawn;

GetChompPosition -> vector


return (Location+Vector(Rotation)*CollisionRadius);

GetFeedSpot (Actor foodActor, out vector feedSpot) -> bool


local rotator rot;


if (IsInRange(foodActor))
{
feedSpot = Location;
return true;
}
else
{
rot = Rotator(foodActor.Location - Location);
return AIDirectionReachable(foodActor.Location, rot.Yaw, rot.Pitch,
0, GetMaxDistance(foodActor), feedSpot);
}

GetMaxDistance (Actor foodActor) -> float


return (foodActor.CollisionRadius+CollisionRadius);

GetSwimPivot -> vector


// THIS IS A HIDEOUS, UGLY, MASSIVELY EVIL HACK!!!!
return (vect(0,0,0));

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
else if ((damageType == 'TearGas') || (damageType == 'HalonGas'))
GotoState('Fleeing');
else if (damageType == 'Stunned')
GotoState('Fleeing');
else if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

HandleDamage (int Damage, Vector hitLocation, Vector offset, name damageType) -> EHitLocation


local EHitLocation hitPos;


hitPos = HITLOC_None;

if (offset.X < 0.0)
hitPos = HITLOC_TorsoBack;
else
hitPos = HITLOC_TorsoFront;

if (!bInvincible)
Health -= Damage;

return hitPos;


HitWall (vector HitNormal, actor Wall)


if (Physics == PHYS_Falling)
return;
CheckOpenDoor(HitNormal, Wall);

InterestedInFood -> bool


if (((GetStateName() == 'Wandering') || (GetStateName() == 'Standing') || (GetStateName() == 'Patrolling')) &&
(LastRendered() < 10.0))
return true;
else if (bFoodOverridesAttack && ((GetStateName() == 'Attacking') || (GetStateName() == 'Seeking')) && (aggressiveTimer <= 0))
return true;
else
return false;

IsInRange (Actor foodActor) -> bool


return (VSize(foodActor.Location-Location) <= GetMaxDistance(foodActor)+20);

IsValidFood (Actor foodActor) -> bool


if (foodActor == None)
return false;
else if (foodActor.bDeleteMe)
return false;
else if (foodActor.Region.Zone.bWaterZone)
return false;
else if ((foodActor.Physics == PHYS_Swimming) || (foodActor.Physics == PHYS_Falling))
return false;
else if (!ClassIsChildOf(foodActor.Class, FoodClass))
return false;
else
return true;

Munch (Actor foodActor)


if (IsValidFood(foodActor) && IsInRange(Food))
{
foodActor.TakeDamage(FoodDamage, self, foodActor.Location, vect(0,0,0), 'Munch'); // finger-lickin' good!
if (bMessyEater)
SpewBlood(GetChompPosition());
Health += FoodHealth;
if (Health > Default.Health)
Health = Default.Health;
}

PickDestination


local int iterations;
local float magnitude;


magnitude = (wanderlust*300+100) * (FRand()*0.2+0.9); // 100-400, +/-10%
iterations = 5; // try up to 5 different directions

if (!AIPickRandomDestination(30, magnitude, 0, 0, 0, 0, iterations, FRand()*0.4+0.35, destLoc))
destLoc = Location;

PlayDying (name damageType, vector hitLoc)


local Vector X, Y, Z;
local float dotp;


if (bPlayDying)
{
GetAxes(Rotation, X, Y, Z);
dotp = (Location - HitLoc) dot X;

// die from the correct side
if (dotp < 0.0) // shot from the front, fall back
PlayAnimPivot('DeathBack',, 0.1);
else // shot from the back, fall front
PlayAnimPivot('DeathFront',, 0.1);
}

PlayDyingSound();

PlayEating


PlayAnimPivot('Eat', 1.3, 0.2);

PlayEatingSound

PlayPanicRunning


PlayRunning();

PlayPauseWhenEating

PlayRunning


LoopAnimPivot('Run');

PlayStartEating


PlayAnimPivot('EatBegin');

PlayStopEating


PlayAnimPivot('EatEnd');

PlaySwimming


LoopAnimPivot('Swim', , , , GetSwimPivot());

PlayTurning


LoopAnimPivot('Walk', 0.1);

PlayWaiting


LoopAnimPivot('BreatheLight', , 0.3);

PlayWalking


LoopAnimPivot('Walk', , 0.15);

SetFall


StartFalling('Eating', 'ContinueEat');

ShouldBeStartled (Pawn startler) -> bool


local float speed;
local float time;
local float dist;
local float dist2;
local bool bPh33r;


bPh33r = false;
if (startler != None)
{
speed = VSize(startler.Velocity);
if (speed >= 20)
{
dist = VSize(Location - startler.Location);
time = dist/speed;
if (time <= 2.0)
{
dist2 = VSize(Location - (startler.Location+startler.Velocity*time));
if (dist2 < speed*0.6)
bPh33r = true;
}
}
}

return bPh33r;

ShouldDropWeapon -> bool


return false;

ShouldFlee -> bool


return (Health <= MinHealth);

SpewBlood (vector Position)


spawn(class'BloodSpurt', , , Position);
spawn(class'BloodDrop', , , Position);
if (FRand() < 0.5)
spawn(class'BloodDrop', , , Position);

Tick (float deltaSeconds)


Super.Tick(deltaSeconds);

if (bFoodOverridesAttack && (checkAggTimer <= 0))
{
checkAggTimer = 0.3;
if (aggressiveTimer > 0)
ResetReactions();
else
BlockReactions();
}

TweenToRunning (float tweentime)


LoopAnimPivot('Run',, tweentime);

TweenToSwimming (float tweentime)


TweenAnimPivot('Swim', tweentime, GetSwimPivot());

TweenToWaiting (float tweentime)


TweenAnimPivot('BreatheLight', tweentime);

TweenToWalking (float tweentime)


TweenAnimPivot('Walk', tweentime);




AnimatedSprite.uc (extends Effects)

var float animSpeed;
var int numFrames;
var int nextFrame;
var texture frames[16];
var float time, totalTime, duration;
animSpeed=0.075000
nextFrame=1
DrawType=DT_Sprite
Style=STY_Translucent
bUnlit=True

PostBeginPlay


Super.PostBeginPlay();

// calculate length of animation
duration = animSpeed * numFrames;

Tick (float deltaTime)


time += deltaTime;
totalTime += deltaTime;

DrawScale = 0.5 + (3.0 * totalTime / duration);
ScaleGlow = (duration - totalTime) / duration;

if (time >= animSpeed)
{
Texture = frames[nextFrame++];
if (nextFrame >= numFrames)
Destroy();

time -= animSpeed;
}




AnnaNavarre.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.AnnaNavarreCarcass'
WalkingSpeed=0.280000
bImportant=True
bInvincible=True
CloseCombatMult=0.500000
BaseAssHeight=-18.000000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponAssaultGun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCombatKnife')
BurnPeriod=5.000000
bHasCloak=True
CloakThreshold=100
walkAnimMult=1.000000
bIsFemale=True
GroundSpeed=220.000000
BaseEyeHeight=38.000000
Health=300
HealthHead=400
HealthTorso=300
HealthLegLeft=300
HealthLegRight=300
HealthArmLeft=300
HealthArmRight=300
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants'
DrawScale=1.100000
MultiSkins(0)=Texture'DeusExCharacters.Skins.AnnaNavarreTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.AnnaNavarreTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex9'
MultiSkins(7)=Texture'DeusExCharacters.Skins.AnnaNavarreTex1'
CollisionHeight=47.299999
BindName="AnnaNavarre"
FamiliarName="Anna Navarre"
UnfamiliarName="Anna Navarre"

Explode


local SphereEffect sphere;
local ScorchMark s;
local ExplosionLight light;
local int i;
local float explosionDamage;
local float explosionRadius;


explosionDamage = 100;
explosionRadius = 256;

// alert NPCs that I'm exploding
AISendEvent('LoudNoise', EAITYPE_Audio, , explosionRadius*16);
PlaySound(Sound'LargeExplosion1', SLOT_None,,, explosionRadius*16);

// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, Location);
if (light != None)
light.size = 4;

Spawn(class'ExplosionSmall',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionMedium',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionMedium',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionLarge',,, Location + 2*VRand()*CollisionRadius);

sphere = Spawn(class'SphereEffect',,, Location);
if (sphere != None)
sphere.size = explosionRadius / 32.0;

// spawn a mark
s = spawn(class'ScorchMark', Base,, Location-vect(0,0,1)*CollisionHeight, Rotation+rot(16384,0,0));
if (s != None)
{
s.DrawScale = FClamp(explosionDamage/30, 0.1, 3.0);
s.ReattachDecal();
}

// spawn some rocks and flesh fragments
for (i=0; i {
if (FRand() < 0.3)
spawn(class'Rockchip',,,Location);
else
spawn(class'FleshFragment',,,Location);
}

HurtRadius(explosionDamage, explosionRadius, 'Exploded', explosionDamage*100, Location);

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

HasTwoHandedWeapon -> Bool


return False;

SpawnCarcass -> Carcass


if (bStunned)
return Super.SpawnCarcass();

Explode();

return None;




AnnaNavarreCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants_Carcass'
DrawScale=1.100000
MultiSkins(0)=Texture'DeusExCharacters.Skins.AnnaNavarreTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.AnnaNavarreTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex9'
MultiSkins(7)=Texture'DeusExCharacters.Skins.AnnaNavarreTex1'
CollisionRadius=44.000000
CollisionHeight=7.700000



AttackHelicopter.uc (extends Vehicles)

ItemName="Attack Helicopter"
Mesh=LodMesh'DeusExDeco.AttackHelicopter'
SoundRadius=160
SoundVolume=192
AmbientSound=Sound'Ambient.Ambient.Helicopter'
CollisionRadius=461.230011
CollisionHeight=87.839996
Mass=6000.000000
Buoyancy=1000.000000

BeginState


Super.BeginState();
LoopAnim('Fly');

SupportActor (Actor standingActor)


// kill whatever lands on the blades
if (standingActor != None)
standingActor.TakeDamage(10000, None, standingActor.Location, vect(0,0,0), 'Exploded');




AugAqualung.uc (extends Augmentation)

var float mult, pct;
var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=240.000000
mpEnergyDrain=10.000000
EnergyRate=10.000000
Icon=Texture'DeusExUI.UserInterface.AugIconAquaLung'
smallIcon=Texture'DeusExUI.UserInterface.AugIconAquaLung_Small'
AugmentationName="Aqualung"
Description="Soda lime exostructures imbedded in the alveoli of the lungs convert CO2 to O2, extending the time an agent can remain underwater.|n|nTECH ONE: Lung capacity is extended slightly.|n|nTECH TWO: Lung capacity is extended moderately.|n|nTECH THREE: Lung capacity is extended significantly.|n|nTECH FOUR: An agent can stay underwater indefinitely."
MPInfo="When active, you can stay underwater 12 times as long and swim twice as fast. Energy Drain: Low"
LevelValues(0)=30.000000
LevelValues(1)=60.000000
LevelValues(2)=120.000000
LevelValues(3)=240.000000
AugmentationLocation=LOC_Torso
MPConflictSlot=9

Deactivate


Super.Deactivate();

mult = Player.SkillSystem.GetSkillLevelValue(class'SkillSwimming');
pct = Player.swimTimer / Player.swimDuration;
Player.UnderWaterTime = Player.Default.UnderWaterTime;
Player.swimDuration = Player.UnderWaterTime * mult;
Player.swimTimer = Player.swimDuration * pct;

if (( Level.NetMode != NM_Standalone ) && Player.IsA('Human') )
{
mult = Player.SkillSystem.GetSkillLevelValue(class'SkillSwimming');
Player.WaterSpeed = Human(Player).Default.mpWaterSpeed * mult;
}

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
}




AugBallistic.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=0.600000
mpEnergyDrain=90.000000
EnergyRate=60.000000
Icon=Texture'DeusExUI.UserInterface.AugIconBallistic'
smallIcon=Texture'DeusExUI.UserInterface.AugIconBallistic_Small'
AugmentationName="Ballistic Protection"
Description="Monomolecular plates reinforce the skin's epithelial membrane, reducing the damage an agent receives from projectiles and bladed weapons.|n|nTECH ONE: Damage from projectiles and bladed weapons is reduced slightly.|n|nTECH TWO: Damage from projectiles and bladed weapons is reduced moderately.|n|nTECH THREE: Damage from projectiles and bladed weapons is reduced significantly.|n|nTECH FOUR: An agent is nearly invulnerable to damage from projectiles and bladed weapons."
MPInfo="When active, damage from projectiles and melee weapons is reduced by 40%. Energy Drain: High"
LevelValues(0)=0.800000
LevelValues(1)=0.650000
LevelValues(2)=0.500000
LevelValues(3)=0.350000
AugmentationLocation=LOC_Subdermal
MPConflictSlot=4

Deactivate


Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
}




AugCloak.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=1.000000
mpEnergyDrain=40.000000
EnergyRate=300.000000
Icon=Texture'DeusExUI.UserInterface.AugIconCloak'
smallIcon=Texture'DeusExUI.UserInterface.AugIconCloak_Small'
AugmentationName="Cloak"
Description="Subdermal pigmentation cells allow the agent to blend with their surrounding environment, rendering them effectively invisible to observation by organic hostiles.|n|nTECH ONE: Power drain is normal.|n|nTECH TWO: Power drain is reduced slightly.|n|nTECH THREE: Power drain is reduced moderately.|n|nTECH FOUR: Power drain is reduced significantly."
MPInfo="When active, you are invisible to enemy players. Electronic devices and players with the vision augmentation can still detect you. Cannot be used with a weapon. Energy Drain: Moderate"
LevelValues(0)=1.000000
LevelValues(1)=0.830000
LevelValues(2)=0.660000
LevelValues(3)=0.500000
AugmentationLocation=LOC_Subdermal
MPConflictSlot=6

Deactivate


Player.PlaySound(Sound'CloakDown', SLOT_Interact, 0.85, ,768,1.0);
Super.Deactivate();

GetEnergyRate -> float


return energyRate * LevelValues[CurrentLevel];

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
AugmentationLocation = LOC_Eye;
}




AugCombat.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=2.000000
mpEnergyDrain=20.000000
EnergyRate=20.000000
Icon=Texture'DeusExUI.UserInterface.AugIconCombat'
smallIcon=Texture'DeusExUI.UserInterface.AugIconCombat_Small'
AugmentationName="Combat Strength"
Description="Sorting rotors accelerate calcium ion concentration in the sarcoplasmic reticulum, increasing an agent's muscle speed several-fold and multiplying the damage they inflict in melee combat.|n|nTECH ONE: The effectiveness of melee weapons is increased slightly.|n|nTECH TWO: The effectiveness of melee weapons is increased moderately.|n|nTECH THREE: The effectiveness of melee weapons is increased significantly.|n|nTECH FOUR: Melee weapons are almost instantly lethal."
MPInfo="When active, you do double damage with melee weapons. Energy Drain: Low"
LevelValues(0)=1.250000
LevelValues(1)=1.500000
LevelValues(2)=1.750000
LevelValues(3)=2.000000
AugmentationLocation=LOC_Arm
MPConflictSlot=1

Deactivate


Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
}




AugDatalink.uc (extends Augmentation)

EnergyRate=0.000000
MaxLevel=0
Icon=Texture'DeusExUI.UserInterface.AugIconDatalink'
smallIcon=Texture'DeusExUI.UserInterface.AugIconDatalink_Small'
bAlwaysActive=True
AugmentationName="Infolink"
Description="One-way micro-transceiver array allows agents in the field to receive messages from Control, and to store and later retrieve relevant maps, conversations, and notes.|n|n This is top of the line all the way, so don't expect any upgrades. -- Jaime Reyes |n|nNO UPGRADES"
LevelValues(0)=1.000000
LevelValues(1)=1.000000
LevelValues(2)=1.000000
LevelValues(3)=1.000000
AugmentationLocation=LOC_Default

Deactivate


Super.Deactivate();




AugDefense.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
var bool bDefenseActive;
var float defenseSoundTime;
mpAugValue=500.000000
mpEnergyDrain=35.000000
EnergyRate=10.000000
Icon=Texture'DeusExUI.UserInterface.AugIconDefense'
smallIcon=Texture'DeusExUI.UserInterface.AugIconDefense_Small'
AugmentationName="Aggressive Defense System"
Description="Aerosol nanoparticles are released upon the detection of objects fitting the electromagnetic threat profile of missiles and grenades; these nanoparticles will prematurely detonate such objects prior to reaching the agent.|n|nTECH ONE: The range at which incoming rockets and grenades are detonated is short.|n|nTECH TWO: The range at which detonation occurs is increased slightly.|n|nTECH THREE: The range at which detonation occurs is increased moderately.|n|nTECH FOUR: Rockets and grenades are detonated almost before they are fired."
MPInfo="When active, enemy rockets detonate when they get close, doing reduced damage. Some large rockets may still be close enough to do damage when they explode. Energy Drain: Low"
LevelValues(0)=160.000000
LevelValues(1)=320.000000
LevelValues(2)=480.000000
LevelValues(3)=800.000000
MPConflictSlot=7

Deactivate


Super.Deactivate();

SetTimer(0.1, False);
SetDefenseAugStatus(False,CurrentLevel,None);

FindNearestProjectile -> DeusExProjectile


local DeusExProjectile proj, minproj;
local float dist, mindist;
local bool bValidProj;


minproj = None;
mindist = 999999;
foreach AllActors(class'DeusExProjectile', proj)
{
if (Level.NetMode != NM_Standalone)
bValidProj = !proj.bIgnoresNanoDefense;
else
bValidProj = (!proj.IsA('Cloud') && !proj.IsA('Tracer') && !proj.IsA('GreaselSpit') && !proj.IsA('GraySpit'));

if (bValidProj)
{
// make sure we don't own it
if (proj.Owner != Player)
{
// MBCODE : If team game, don't blow up teammates projectiles
if (!((TeamDMGame(Player.DXGame) != None) && (TeamDMGame(Player.DXGame).ArePlayersAllied(DeusExPlayer(proj.Owner),Player))))
{
// make sure it's moving fast enough
if (VSize(proj.Velocity) > 100)
{
dist = VSize(Player.Location - proj.Location);
if (dist < mindist)
{
mindist = dist;
minproj = proj;
}
}
}
}
}
}

return minproj;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
defenseSoundTime=0;
}

SetDefenseAugStatus (bool bDefenseActive, int defenseLevel, DeusExProjectile defenseTarget)


if (Player == None)
return;
if (Player.rootWindow == None)
return;
DeusExRootWindow(Player.rootWindow).hud.augDisplay.bDefenseActive = bDefenseActive;
DeusExRootWindow(Player.rootWindow).hud.augDisplay.defenseLevel = defenseLevel;
DeusExRootWindow(Player.rootWindow).hud.augDisplay.defenseTarget = defenseTarget;


Tick (float DeltaTime)


Super.Tick(DeltaTime);

// DEUS_EX AMSD Make sure it gets turned off in multiplayer.
if (Level.NetMode == NM_Client)
{
if (!bDefenseActive)
SetDefenseAugStatus(False,CurrentLevel,None);
}

Timer


local DeusExProjectile minproj;
local float mindist;


minproj = None;

// DEUS_EX AMSD Multiplayer check
if (Player == None)
{
SetTimer(0.1,False);
return;
}

// In multiplayer propagate a sound that will let others know their in an aggressive defense field
// with range slightly greater than the current level value of the aug
if ( (Level.NetMode != NM_Standalone) && ( Level.Timeseconds > defenseSoundTime ))
{
Player.PlaySound(Sound'AugDefenseOn', SLOT_Interact, 1.0, ,(LevelValues[CurrentLevel]*1.33), 0.75);
defenseSoundTime = Level.Timeseconds + defenseSoundDelay;
}

//DEUS_EX AMSD Exported to function call for duplication in multiplayer.
minproj = FindNearestProjectile();

// if we have a valid projectile, send it to the aug display window
if (minproj != None)
{
bDefenseActive = True;
mindist = VSize(Player.Location - minproj.Location);

// DEUS_EX AMSD In multiplayer, let the client turn his HUD on here.
// In singleplayer, turn it on normally.
if (Level.Netmode != NM_Standalone)
TriggerDefenseAugHUD();
else
{
SetDefenseAugStatus(True,CurrentLevel,minproj);
}

// play a warning sound
Player.PlaySound(sound'GEPGunLock', SLOT_None,,,, 2.0);

if (mindist < LevelValues[CurrentLevel])
{
minproj.bAggressiveExploded=True;
minproj.Explode(minproj.Location, vect(0,0,1));
Player.PlaySound(sound'ProdFire', SLOT_None,,,, 2.0);
}
}
else
{
if ((Level.NetMode == NM_Standalone) || (bDefenseActive))
SetDefenseAugStatus(False,CurrentLevel,None);
bDefenseActive = false;
}

TriggerDefenseAugHUD


local DeusExProjectile minproj;


minproj = None;

minproj = FindNearestProjectile();

// if we have a valid projectile, send it to the aug display window
// That's all we do.
if (minproj != None)
{
SetDefenseAugStatus(True,CurrentLevel,minproj);
}




AugDrone.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
var float reconstructTime;
var float lastDroneTime;
mpAugValue=100.000000
mpEnergyDrain=20.000000
reconstructTime=30.000000
lastDroneTime=-30.000000
EnergyRate=150.000000
Icon=Texture'DeusExUI.UserInterface.AugIconDrone'
smallIcon=Texture'DeusExUI.UserInterface.AugIconDrone_Small'
AugmentationName="Spy Drone"
Description="Advanced nanofactories can assemble a spy drone upon demand which can then be remotely controlled by the agent until released or destroyed, at which a point a new drone will be assembled. Further upgrades equip the spy drones with better armor and a one-shot EMP attack.|n|nTECH ONE: The drone can take little damage and has a very light EMP attack.|n|nTECH TWO: The drone can take minor damage and has a light EMP attack.|n|nTECH THREE: The drone can take moderate damage and has a medium EMP attack.|n|nTECH FOUR: The drone can take heavy damage and has a strong EMP attack."
MPInfo="Activation creates a remote-controlled spy drone. Deactivation disables the drone. Firing while active detonates the drone in a massive EMP explosion. Energy Drain: Medium"
LevelValues(0)=10.000000
LevelValues(1)=20.000000
LevelValues(2)=35.000000
LevelValues(3)=50.000000
MPConflictSlot=7

Deactivate


Super.Deactivate();

// record the time if we were just active
if (Player.bSpyDroneActive)
lastDroneTime = Level.TimeSeconds;

Player.bSpyDroneActive = False;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
}




AugEMP.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=0.050000
mpEnergyDrain=5.000000
EnergyRate=10.000000
Icon=Texture'DeusExUI.UserInterface.AugIconEMP'
smallIcon=Texture'DeusExUI.UserInterface.AugIconEMP_Small'
AugmentationName="EMP Shield"
Description="Nanoscale EMP generators partially protect individual nanites and reduce bioelectrical drain by canceling incoming pulses.|n|nTECH ONE: Damage from EMP attacks is reduced slightly.|n|nTECH TWO: Damage from EMP attacks is reduced moderately.|n|nTECH THREE: Damage from EMP attacks is reduced significantly.|n|nTECH FOUR: An agent is nearly invulnerable to damage from EMP attacks."
MPInfo="When active, you only take 5% damage from EMP attacks. Energy Drain: Very Low"
LevelValues(0)=0.750000
LevelValues(1)=0.500000
LevelValues(2)=0.250000
AugmentationLocation=LOC_Subdermal
MPConflictSlot=3

Deactivate


Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
}




AugEnviro.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=0.100000
mpEnergyDrain=20.000000
EnergyRate=20.000000
Icon=Texture'DeusExUI.UserInterface.AugIconEnviro'
smallIcon=Texture'DeusExUI.UserInterface.AugIconEnviro_Small'
AugmentationName="Environmental Resistance"
Description="Induced keratin production strengthens all epithelial tissues and reduces the agent's vulnerability to radiation and other toxins.|n|nTECH ONE: Toxic resistance is increased slightly.|n|nTECH TWO: Toxic resistance is increased moderately.|n|nTECH THREE: Toxic resistance is increased significantly.|n|nTECH FOUR: An agent is nearly invulnerable to damage from toxins."
MPInfo="When active, you only take 10% damage from poison and gas, and poison and gas will not affect your vision. Energy Drain: Low"
LevelValues(0)=0.750000
LevelValues(1)=0.500000
LevelValues(2)=0.250000
LevelValues(3)=0.100000
AugmentationLocation=LOC_Torso
MPConflictSlot=3

Deactivate


Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
AugmentationLocation = LOC_Subdermal;
}




AugHealing.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=10.000000
mpEnergyDrain=100.000000
EnergyRate=120.000000
Icon=Texture'DeusExUI.UserInterface.AugIconHealing'
smallIcon=Texture'DeusExUI.UserInterface.AugIconHealing_Small'
AugmentationName="Regeneration"
Description="Programmable polymerase automatically directs construction of proteins in injured cells, restoring an agent to full health over time.|n|nTECH ONE: Healing occurs at a normal rate.|n|nTECH TWO: Healing occurs at a slightly faster rate.|n|nTECH THREE: Healing occurs at a moderately faster rate.|n|nTECH FOUR: Healing occurs at a significantly faster rate."
MPInfo="When active, you heal, but at a rate insufficient for healing in combat. Energy Drain: High"
LevelValues(0)=5.000000
LevelValues(1)=15.000000
LevelValues(2)=25.000000
LevelValues(3)=40.000000
AugmentationLocation=LOC_Torso
MPConflictSlot=2

Deactivate


Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
}




AugHeartLung.uc (extends Augmentation)

EnergyRate=100.000000
MaxLevel=0
Icon=Texture'DeusExUI.UserInterface.AugIconHeartLung'
smallIcon=Texture'DeusExUI.UserInterface.AugIconHeartLung_Small'
AugmentationName="Synthetic Heart"
Description="This synthetic heart circulates not only blood but a steady concentration of mechanochemical power cells, smart phagocytes, and liposomes containing prefab diamondoid machine parts, resulting in upgraded performance for all installed augmentations.|n|n However, this will not enhance any augmentation past its maximum upgrade level. -- Jaime Reyes |n|nNO UPGRADES"
LevelValues(0)=1.000000
AugmentationLocation=LOC_Torso

Deactivate


Super.Deactivate();

Player.AugmentationSystem.BoostAugs(False, Self);
Player.AugmentationSystem.DeactivateAll();




AugIFF.uc (extends Augmentation)

EnergyRate=0.000000
MaxLevel=0
Icon=Texture'DeusExUI.UserInterface.AugIconIFF'
bAlwaysActive=True
AugmentationName="IFF"
Description="Automatic friend or foe identification uses advanced heuristic algorithms to associate visible objects with known threat categories.|n|nTargeting reticle highlights RED over enemies, and GREEN over allies and neutrals.|n|nNO UPGRADES"
LevelValues(0)=1.000000
AugmentationLocation=LOC_Default

Deactivate


Super.Deactivate();




AugLight.uc (extends Augmentation)

var Beam b1, b2;
EnergyRate=10.000000
MaxLevel=0
Icon=Texture'DeusExUI.UserInterface.AugIconLight'
smallIcon=Texture'DeusExUI.UserInterface.AugIconLight_Small'
AugmentationName="Light"
Description="Bioluminescent cells within the retina provide coherent illumination of the agent's field of view.|n|nNO UPGRADES"
LevelValues(0)=1024.000000
AugmentationLocation=LOC_Default
MPConflictSlot=10

BeginState


Super.BeginState();

b1 = Spawn(class'Beam', Player, '', Player.Location);
if (b1 != None)
{
AIStartEvent('Beam', EAITYPE_Visual);
b1.LightHue = 32;
b1.LightRadius = 4;
b1.LightSaturation = 140;
b1.LightBrightness = 192;
SetBeamLocation();
}
b2 = Spawn(class'Beam', Player, '', Player.Location);
if (b2 != None)
{
b2.LightHue = 32;
b2.LightRadius = 4;
b2.LightSaturation = 140;
b2.LightBrightness = 220;
SetGlowLocation();
}

Deactivate


Super.Deactivate();
if (b1 != None)
b1.Destroy();
if (b2 != None)
b2.Destroy();
b1 = None;
b2 = None;

PreTravel


// make sure we destroy the light before we travel
if (b1 != None)
b1.Destroy();
if (b2 != None)
b2.Destroy();
b1 = None;
b2 = None;

SetBeamLocation


local float dist, size, radius, brightness;
local Vector HitNormal, HitLocation, StartTrace, EndTrace;


if (b1 != None)
{
StartTrace = Player.Location;
StartTrace.Z += Player.BaseEyeHeight;
EndTrace = StartTrace + LevelValues[CurrentLevel] * Vector(Player.ViewRotation);

Trace(HitLocation, HitNormal, EndTrace, StartTrace, True);
if (HitLocation == vect(0,0,0))
HitLocation = EndTrace;

dist = VSize(HitLocation - StartTrace);
size = fclamp(dist/LevelValues[CurrentLevel], 0, 1);
radius = size*5.12 + 4.0;
brightness = fclamp(size-0.5, 0, 1)*2*-192 + 192;
b1.SetLocation(HitLocation-vector(Player.ViewRotation)*64);
b1.LightRadius = byte(radius);
//b1.LightBrightness = byte(brightness); // someday we should put this back in again
b1.LightType = LT_Steady;
}

SetGlowLocation -> vector


local vector pos;


if (b2 != None)
{
pos = Player.Location + vect(0,0,1)*Player.BaseEyeHeight +
vect(1,1,0)*vector(Player.Rotation)*Player.CollisionRadius*1.5;
b2.SetLocation(pos);
}

Tick (float deltaTime)


SetBeamLocation();
SetGlowLocation();




AugMuscle.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=2.000000
mpEnergyDrain=20.000000
EnergyRate=20.000000
Icon=Texture'DeusExUI.UserInterface.AugIconMuscle'
smallIcon=Texture'DeusExUI.UserInterface.AugIconMuscle_Small'
AugmentationName="Microfibral Muscle"
Description="Muscle strength is amplified with ionic polymeric gel myofibrils that allow the agent to push and lift extraordinarily heavy objects.|n|nTECH ONE: Strength is increased slightly.|n|nTECH TWO: Strength is increased moderately.|n|nTECH THREE: Strength is increased significantly.|n|nTECH FOUR: An agent is inhumanly strong."
MPInfo="When active, you can pick up large crates. Energy Drain: Low"
LevelValues(0)=1.250000
LevelValues(1)=1.500000
LevelValues(2)=1.750000
LevelValues(3)=2.000000
AugmentationLocation=LOC_Arm
MPConflictSlot=8

Deactivate


Super.Deactivate();

// check to see if the player is carrying something too heavy for him
if (Player.CarriedDecoration != None)
if (!Player.CanBeLifted(Player.CarriedDecoration))
Player.DropDecoration();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
//Lift with your legs, not with your back.
AugmentationLocation = LOC_Leg;
}




AugPower.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=0.650000
EnergyRate=10.000000
Icon=Texture'DeusExUI.UserInterface.AugIconPowerRecirc'
smallIcon=Texture'DeusExUI.UserInterface.AugIconPowerRecirc_Small'
AugmentationName="Power Recirculator"
Description="Power consumption for all augmentations is reduced by polyanilene circuits, plugged directly into cell membranes, that allow nanite particles to interconnect electronically without leaving their host cells.|n|nTECH ONE: Power drain of augmentations is reduced slightly.|n|nTECH TWO: Power drain of augmentations is reduced moderately.|n|nTECH THREE: Power drain of augmentations is reduced.|n|nTECH FOUR: Power drain of augmentations is reduced significantly."
MPInfo="Reduces the cost of other augs. Automatically used when needed. Energy Drain: None"
LevelValues(0)=0.900000
LevelValues(1)=0.800000
LevelValues(2)=0.600000
LevelValues(3)=0.400000
AugmentationLocation=LOC_Torso
MPConflictSlot=5

Deactivate


Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
}




AugRadarTrans.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=0.500000
mpEnergyDrain=30.000000
EnergyRate=300.000000
Icon=Texture'DeusExUI.UserInterface.AugIconRadarTrans'
smallIcon=Texture'DeusExUI.UserInterface.AugIconRadarTrans_Small'
AugmentationName="Radar Transparency"
Description="Radar-absorbent resin augments epithelial proteins; microprojection units distort agent's visual signature. Provides highly effective concealment from automated detection systems -- bots, cameras, turrets.|n|nTECH ONE: Power drain is normal.|n|nTECH TWO: Power drain is reduced slightly.|n|nTECH THREE: Power drain is reduced moderately.|n|nTECH FOUR: Power drain is reduced significantly."
MPInfo="When active, you are invisible to electronic devices such as cameras, turrets, and proximity mines. Energy Drain: Very Low"
LevelValues(0)=1.000000
LevelValues(1)=0.830000
LevelValues(2)=0.660000
LevelValues(3)=0.500000
AugmentationLocation=LOC_Subdermal
MPConflictSlot=2

Deactivate


Super.Deactivate();

GetEnergyRate -> float


return energyRate * LevelValues[CurrentLevel];

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
AugmentationLocation = LOC_Torso;
}




AugShield.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=0.500000
mpEnergyDrain=25.000000
EnergyRate=40.000000
Icon=Texture'DeusExUI.UserInterface.AugIconShield'
smallIcon=Texture'DeusExUI.UserInterface.AugIconShield_Small'
AugmentationName="Energy Shield"
Description="Polyanilene capacitors below the skin absorb heat and electricity, reducing the damage received from flame, electrical, and plasma attacks.|n|nTECH ONE: Damage from energy attacks is reduced slightly.|n|nTECH TWO: Damage from energy attacks is reduced moderately.|n|nTECH THREE: Damage from energy attacks is reduced significantly.|n|nTECH FOUR: An agent is nearly invulnerable to damage from energy attacks."
MPInfo="When active, you only take 50% damage from flame and plasma attacks. Energy Drain: Low"
LevelValues(0)=0.800000
LevelValues(1)=0.600000
LevelValues(2)=0.400000
LevelValues(3)=0.200000
AugmentationLocation=LOC_Torso
MPConflictSlot=1

Deactivate


Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
AugmentationLocation = LOC_Arm;
}




AugSpeed.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=2.000000
mpEnergyDrain=180.000000
EnergyRate=40.000000
Icon=Texture'DeusExUI.UserInterface.AugIconSpeedJump'
smallIcon=Texture'DeusExUI.UserInterface.AugIconSpeedJump_Small'
AugmentationName="Speed Enhancement"
Description="Ionic polymeric gel myofibrils are woven into the leg muscles, increasing the speed at which an agent can run and climb, the height they can jump, and reducing the damage they receive from falls.|n|nTECH ONE: Speed and jumping are increased slightly, while falling damage is reduced.|n|nTECH TWO: Speed and jumping are increased moderately, while falling damage is further reduced.|n|nTECH THREE: Speed and jumping are increased significantly, while falling damage is substantially reduced.|n|nTECH FOUR: An agent can run like the wind and leap from the tallest building."
MPInfo="When active, you move twice as fast and jump twice as high. Energy Drain: Very High"
LevelValues(0)=1.200000
LevelValues(1)=1.400000
LevelValues(2)=1.600000
LevelValues(3)=1.800000
AugmentationLocation=LOC_Leg
MPConflictSlot=5

Deactivate


Super.Deactivate();

if (( Level.NetMode != NM_Standalone ) && Player.IsA('Human') )
Player.GroundSpeed = Human(Player).Default.mpGroundSpeed;
else
Player.GroundSpeed = Player.Default.GroundSpeed;

Player.JumpZ = Player.Default.JumpZ;
if ( Level.NetMode != NM_Standalone )
{
if ( Human(Player) != None )
Human(Player).UpdateAnimRate( -1.0 );
}

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
AugmentationLocation = LOC_Torso;
}




AugStealth.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpEnergyDrain=20.000000
EnergyRate=40.000000
Icon=Texture'DeusExUI.UserInterface.AugIconRunSilent'
smallIcon=Texture'DeusExUI.UserInterface.AugIconRunSilent_Small'
AugmentationName="Run Silent"
Description="The necessary muscle movements for complete silence when walking or running are determined continuously with reactive kinematics equations produced by embedded nanocomputers.|n|nTECH ONE: Sound made while moving is reduced slightly.|n|nTECH TWO: Sound made while moving is reduced moderately.|n|nTECH THREE: Sound made while moving is reduced significantly.|n|nTECH FOUR: An agent is completely silent."
MPInfo="When active, you do not make footstep sounds. Energy Drain: Low"
LevelValues(0)=0.750000
LevelValues(1)=0.500000
LevelValues(2)=0.250000
AugmentationLocation=LOC_Leg
MPConflictSlot=8

Deactivate


Player.RunSilentValue = 1.0;
Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
}




AugTarget.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=-0.125000
mpEnergyDrain=40.000000
EnergyRate=40.000000
Icon=Texture'DeusExUI.UserInterface.AugIconTarget'
smallIcon=Texture'DeusExUI.UserInterface.AugIconTarget_Small'
AugmentationName="Targeting"
Description="Image-scaling and recognition provided by multiplexing the optic nerve with doped polyacetylene 'quantum wires' not only increases accuracy, but also delivers limited situational info about a target.|n|nTECH ONE: Slight increase in accuracy and general target information.|n|nTECH TWO: Additional increase in accuracy and more target information.|n|nTECH THREE: Additional increase in accuracy and specific target information.|n|nTECH FOUR: Additional increase in accuracy and telescopic vision."
MPInfo="When active, all weapon skills are effectively increased by one level, and you can see an enemy's health. The skill increases allow you to effectively surpass skill level 3. Energy Drain: Moderate"
LevelValues(0)=-0.050000
LevelValues(1)=-0.100000
LevelValues(2)=-0.150000
LevelValues(3)=-0.200000
AugmentationLocation=LOC_Eye
MPConflictSlot=4

Deactivate


Super.Deactivate();

SetTargetingAugStatus(CurrentLevel,False);

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
AugmentationLocation = LOC_Subdermal;
}

SetTargetingAugStatus (int Level, bool IsActive)


DeusExRootWindow(Player.rootWindow).hud.augDisplay.bTargetActive = IsActive;
DeusExRootWindow(Player.rootWindow).hud.augDisplay.targetLevel = Level;




AugVision.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=800.000000
mpEnergyDrain=50.000000
EnergyRate=40.000000
Icon=Texture'DeusExUI.UserInterface.AugIconVision'
smallIcon=Texture'DeusExUI.UserInterface.AugIconVision_Small'
AugmentationName="Vision Enhancement"
Description="By bleaching selected rod photoreceptors and saturating them with metarhodopsin XII, the 'nightvision' present in most nocturnal animals can be duplicated. Subsequent upgrades and modifications add infravision and sonar-resonance imaging that effectively allows an agent to see through walls.|n|nTECH ONE: Nightvision.|n|nTECH TWO: Infravision.|n|nTECH THREE: Close range sonar imaging.|n|nTECH FOUR: Long range sonar imaging."
MPInfo="When active, you can see enemy players in the dark from any distance, and for short distances you can see through walls and see cloaked enemies. Energy Drain: Moderate"
LevelValues(2)=320.000000
LevelValues(3)=800.000000
AugmentationLocation=LOC_Eye
MPConflictSlot=6

Activate


local bool bWasActive;


bWasActive = bIsActive;

Super.Activate();

if (!bWasActive && bIsActive)
{
SetVisionAugStatus(CurrentLevel,LevelValues[CurrentLevel],True);
Player.RelevantRadius = LevelValues[CurrentLevel];
}

Deactivate


local bool bWasActive;


bWasActive = bIsActive;

Super.Deactivate();

if (bWasActive && !bIsActive)
{
SetVisionAugStatus(CurrentLevel,LevelValues[CurrentLevel],False);
Player.RelevantRadius = 0;
}

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
LevelValues[3] = mpAugValue;
EnergyRate = mpEnergyDrain;
}

SetVisionAugStatus (int Level, int LevelValue, bool IsActive)


if (IsActive)
{
if (++DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount == 1)
DeusExRootWindow(Player.rootWindow).hud.augDisplay.bVisionActive = True;
}
else
{
if (--DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount == 0)
DeusExRootWindow(Player.rootWindow).hud.augDisplay.bVisionActive = False;
DeusExRootWindow(Player.rootWindow).hud.augDisplay.visionBlinder = None;
}
DeusExRootWindow(Player.rootWindow).hud.augDisplay.visionLevel = Level;
DeusExRootWindow(Player.rootWindow).hud.augDisplay.visionLevelValue = LevelValue;




Augmentation.uc (extends Actor)

var() bool bAutomatic;
var() float EnergyRate;
var travel int CurrentLevel;
var int MaxLevel;
var texture icon;
var int IconWidth;
var int IconHeight;
var texture smallIcon;
var bool bAlwaysActive;
var travel bool bBoosted;
var travel int HotKeyNum;
var travel Augmentation next;
var bool bUsingMedbot;
var localized String EnergyRateLabel;
var localized string OccupiesSlotLabel;
var localized string AugLocsText[7];
var() localized string AugActivated;
var() localized string AugDeactivated;
var() localized string AugmentationName;
var() localized string Description;
var() localized string MPInfo;
var() localized string AugAlreadyHave;
var() localized string AugNowHave;
var() localized string AugNowHaveAtLevel;
var() localized string AlwaysActiveLabel;
var() localized String CanUpgradeLabel;
var() localized String CurrentLevelLabel;
var() localized String MaximumLabel;
var DeusExPlayer Player;
var() float LevelValues[4];
var travel bool bHasIt;
var travel bool bIsActive;
var() enum EAugmentationLocation
var() int MPConflictSlot;
var() sound ActivateSound;
var() sound DeactivateSound;
var() sound LoopSound;
EnergyRate=50.000000
MaxLevel=3
IconWidth=52
IconHeight=52
HotKeyNum=-1
EnergyRateLabel="Energy Rate: %d Units/Minute"
OccupiesSlotLabel="Occupies Slot: %s"
AugLocsText(0)="Cranial"
AugLocsText(1)="Eyes"
AugLocsText(2)="Torso"
AugLocsText(3)="Arms"
AugLocsText(4)="Legs"
AugLocsText(5)="Subdermal"
AugLocsText(6)="Default"
AugActivated="%s activated"
AugDeactivated="%s deactivated"
MPInfo="DEFAULT AUG MP INFO - REPORT THIS AS A BUG"
AugAlreadyHave="You already have the %s at the maximum level"
AugNowHave="%s upgraded to level %d"
AugNowHaveAtLevel="Augmentation %s at level %d"
AlwaysActiveLabel="[Always Active]"
CanUpgradeLabel="(Can Upgrade)"
CurrentLevelLabel="Current Level: %d"
MaximumLabel="(Maximum)"
ActivateSound=Sound'DeusExSounds.Augmentation.AugActivate'
DeActivateSound=Sound'DeusExSounds.Augmentation.AugDeactivate'
LoopSound=Sound'DeusExSounds.Augmentation.AugLoop'
bHidden=True
bTravel=True
NetUpdateFrequency=5.000000

Activate


// can't do anything if we don't have it
if (!bHasIt)
return;

if (IsInState('Inactive'))
{
// this block needs to be before bIsActive is set to True, otherwise
// NumAugsActive counts incorrectly and the sound won't work
Player.PlaySound(ActivateSound, SLOT_None);
if (Player.AugmentationSystem.NumAugsActive() == 0)
Player.AmbientSound = LoopSound;

bIsActive = True;

Player.ClientMessage(Sprintf(AugActivated, AugmentationName));

if (Player.bHUDShowAllAugs)
Player.UpdateAugmentationDisplayStatus(Self);
else
Player.AddAugmentationDisplay(Self);

GotoState('Active');
}

CanBeUpgraded -> bool


local bool bCanUpgrade;
local Augmentation anAug;
local AugmentationUpgradeCannister augCan;


bCanUpgrade = False;

// Check to see if this augmentation is already at
// the maximum level
if ( CurrentLevel < MaxLevel )
{
// Now check to see if the player has a cannister that can
// be used to upgrade this Augmentation
augCan = AugmentationUpgradeCannister(player.FindInventoryType(Class'AugmentationUpgradeCannister'));

if (augCan != None)
bCanUpgrade = True;
}

return bCanUpgrade;

Deactivate


// can't do anything if we don't have it
if (!bHasIt)
return;

// If the 'bAlwaysActive' flag is set, this aug can't be
// deactivated
if (bAlwaysActive)
return;

if (IsInState('Active'))
{
bIsActive = False;

Player.ClientMessage(Sprintf(AugDeactivated, AugmentationName));

if (Player.bHUDShowAllAugs)
Player.UpdateAugmentationDisplayStatus(Self);
else
Player.RemoveAugmentationDisplay(Self);

if (Player.AugmentationSystem.NumAugsActive() == 0)
Player.AmbientSound = None;

Player.PlaySound(DeactivateSound, SLOT_None);
GotoState('Inactive');
}

GetCurrentLevel -> int


return CurrentLevel;

GetEnergyRate -> float


return energyRate;

GetHotKey -> int


return hotKeyNum;

IncLevel -> bool


if ( !CanBeUpgraded() )
{
Player.ClientMessage(Sprintf(AugAlreadyHave, AugmentationName));
return False;
}

if (bIsActive)
Deactivate();

CurrentLevel++;

Player.ClientMessage(Sprintf(AugNowHave, AugmentationName, CurrentLevel + 1));

IsActive -> bool


return bIsActive;

IsAlwaysActive -> bool


return bAlwaysActive;

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;
local String strOut;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.Clear();
winInfo.SetTitle(AugmentationName);

if (bUsingMedbot)
{
winInfo.SetText(Sprintf(OccupiesSlotLabel, AugLocsText[AugmentationLocation]));
winInfo.AppendText(winInfo.CR() $ winInfo.CR() $ Description);
}
else
{
winInfo.SetText(Description);
}

// Energy Rate
winInfo.AppendText(winInfo.CR() $ winInfo.CR() $ Sprintf(EnergyRateLabel, Int(EnergyRate)));

// Current Level
strOut = Sprintf(CurrentLevelLabel, CurrentLevel + 1);

// Can Upgrade / Is Active labels
if (CanBeUpgraded())
strOut = strOut @ CanUpgradeLabel;
else if (CurrentLevel == MaxLevel )
strOut = strOut @ MaximumLabel;

winInfo.AppendText(winInfo.CR() $ winInfo.CR() $ strOut);

// Always Active?
if (bAlwaysActive)
winInfo.AppendText(winInfo.CR() $ winInfo.CR() $ AlwaysActiveLabel);

return True;

UsingMedBot (bool bNewUsingMedbot)


bUsingMedbot = bNewUsingMedbot;




AugmentationCannister.uc (extends DeusExPickup)

var() travel Name AddAugs[2];
var localized string AugsAvailable;
var localized string MustBeUsedOn;
AugsAvailable="Can Add:"
MustBeUsedOn="Can only be installed with the help of a MedBot."
ItemName="Augmentation Canister"
ItemArticle="an"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.AugmentationCannister'
PickupViewMesh=LodMesh'DeusExItems.AugmentationCannister'
ThirdPersonMesh=LodMesh'DeusExItems.AugmentationCannister'
LandSound=Sound'DeusExSounds.Generic.PlasticHit1'
Icon=Texture'DeusExUI.Icons.BeltIconAugmentationCannister'
largeIcon=Texture'DeusExUI.Icons.LargeIconAugmentationCannister'
largeIconWidth=19
largeIconHeight=49
Description="An augmentation canister teems with nanoscale mecanocarbon ROM modules suspended in a carrier serum. When injected into a compatible host subject, these modules augment an individual with extra-sapient abilities. However, proper programming of augmentations must be conducted by a medical robot, otherwise terminal damage may occur. For more information, please see 'Face of the New Man' by Kelley Chance."
beltDescription="AUG CAN"
Mesh=LodMesh'DeusExItems.AugmentationCannister'
CollisionRadius=4.310000
CollisionHeight=10.240000
Mass=10.000000
Buoyancy=12.000000

BeginState


Super.BeginState();

Frob (Actor Other, Inventory frobWith)


local Inventory Copy;
local int AugZeroPriority;
local int AugOnePriority;
local Augmentation AugZero;
local Augmentation AugOne;

//If we aren't autoinstalling, just return.
if ( (Level.NetMode == NM_Standalone) || (DeusExMPGame(Level.Game) == None) || (DeusExMPGame(Level.Game).bAutoInstall == False) ||
(DeusExPlayer(Other) == None) )
{
Super.Frob(Other,frobWith);
return;
}
if ( ValidTouch(Other) )
{
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogPickup(Self, Pawn(Other));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogPickup(Self, Pawn(Other));

SetOwner(DeusExPlayer(Other));

AugZero = GetAugmentation(0);
AugOne = GetAugmentation(1);

if (AugZero != None)
AugZeroPriority = DeusExPlayer(Other).GetAugPriority(AugZero);
else
AugZeroPriority = -10;

if (AugOne != None)
AugOnePriority = DeusExPlayer(Other).GetAugPriority(AugOne);
else
AugOnePriority = -10;

if ((AugZeroPriority < 0) || (AugOnePriority < 0))
{
Pawn(Other).ClientMessage("No available augmentations found.");
}
else if (AugZeroPriority < 0)
{
Pawn(Other).ClientMessage("Autoinstalling Augmentation "$AugOne.AugmentationName$".");
DeusExPlayer(Other).AugmentationSystem.GivePlayerAugmentation(AugOne.Class);
}
else if (AugOnePriority < 0)
{
Pawn(Other).ClientMessage("Autoinstalling Augmentation "$AugZero.AugmentationName$".");
DeusExPlayer(Other).AugmentationSystem.GivePlayerAugmentation(AugZero.Class);
}
else if (AugZeroPriority < AugOnePriority)
{
Pawn(Other).ClientMessage("Autoinstalling Augmentation "$AugZero.AugmentationName$".");
DeusExPlayer(Other).AugmentationSystem.GivePlayerAugmentation(AugZero.Class);
}
else
{
Pawn(Other).ClientMessage("Autoinstalling Augmentation "$AugOne.AugmentationName$".");
DeusExPlayer(Other).AugmentationSystem.GivePlayerAugmentation(AugOne.Class);
}

SetOwner(None);
}

GetAugmentation (int augIndex) -> Augmentation


local Augmentation anAug;
local DeusExPlayer player;


// First make sure we have a valid value
if ((augIndex < 0) || (augIndex > (ArrayCount(AddAugs) - 1)))
return None;

if (AddAugs[augIndex] == '')
return None;

// Loop through all the augmentation objects and look
// for the augName that matches the one stored in
// this object

player = DeusExPlayer(Owner);

if (player != None)
{
anAug = player.AugmentationSystem.FirstAug;
while(anAug != None)
{
if (addAugs[augIndex] == anAug.Class.Name)
break;

anAug = anAug.next;
}
}

return anAug;

SpawnCopy (pawn Other) -> inventory


local inventory Copy;
local Int augIndex;
local AugmentationCannister CopyCan;


Copy = Super.SpawnCopy(Other);
CopyCan = AugmentationCannister(Copy);
for (augIndex = 0; augIndex < ArrayCount(Addaugs); augIndex++)
{
CopyCan.addAugs[augIndex] = addAugs[augIndex];
}


UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;
local String outText;
local Int canIndex;
local Augmentation aug;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.Clear();
winInfo.SetTitle(itemName);
winInfo.SetText(Description);

winInfo.AppendText(winInfo.CR() $ winInfo.CR() $ AugsAvailable);
winInfo.AppendText(winInfo.CR() $ winInfo.CR());

for(canIndex=0; canIndex {
if (AddAugs[canIndex] != '')
{
aug = GetAugmentation(canIndex);

if (aug != None)
winInfo.AppendText(aug.default.AugmentationName $ winInfo.CR());
}
}

winInfo.AppendText(winInfo.CR() $ MustBeUsedOn);

return True;




AugmentationDisplayWindow.uc (extends HUDBaseWindow)

var ViewportWindow winZoom;
var float margin;
var float corner;
var bool bDefenseActive;
var int defenseLevel;
var DeusExProjectile defenseTarget;
var ViewportWindow winDrone;
var bool bDroneCreated;
var bool bDroneReferenced;
var bool bTargetActive;
var int targetLevel;
var Actor lastTarget;
var float lastTargetTime;
var bool bVisionActive;
var int visionLevel;
var float visionLevelValue;
var int activeCount;
var localized String msgRange;
var localized String msgRangeUnits;
var localized String msgHigh;
var localized String msgMedium;
var localized String msgLow;
var localized String msgHealth;
var localized String msgOverall;
var localized String msgPercent;
var localized String msgHead;
var localized String msgTorso;
var localized String msgLeftArm;
var localized String msgRightArm;
var localized String msgLeftLeg;
var localized String msgRightLeg;
var localized String msgLegs;
var localized String msgWeapon;
var localized String msgNone;
var localized String msgScanning1;
var localized String msgScanning2;
var localized String msgADSTracking;
var localized String msgADSDetonating;
var localized String msgBehind;
var localized String msgDroneActive;
var localized String msgEnergyLow;
var localized String msgCantLaunch;
var localized String msgLightAmpActive;
var localized String msgIRAmpActive;
var localized String msgNoImage;
var localized String msgDisabled;
var localized String SpottedTeamString;
var localized String YouArePoisonedString;
var localized String YouAreBurnedString;
var localized String TurretInvincibleString;
var localized String CameraInvincibleString;
var localized String NeutBurnPoisonString;
var localized String OnlyString;
var localized String KillsToGoString;
var localized String KillToGoString;
var localized String LessThanMinuteString;
var localized String LessThanXString1;
var localized String LessThanXString2;
var localized String LeadsMatchString;
var localized String TiedMatchString;
var localized String WillWinMatchString;
var localized String OutOfRangeString;
var localized String LostLegsString;
var localized String DropItem1String;
var localized String DropItem2String;
var localized String msgTeammateHit, msgTeamNsf, msgTeamUnatco;
var localized String UseString;
var localized String TeamTalkString;
var localized String TalkString;
var localized String YouKilledTeammateString;
var localized String TeamLAMString;
var localized String TeamComputerString;
var localized String NoCloakWeaponString;
var localized String TeamHackTurretString;
var localized String KeyNotBoundString;
var localized String OutOfAmmoString;
var float OutOfAmmoTime;
var Actor VisionBlinder; //So the same thing doesn't blind me twice.
var int VisionTargetStatus; //For picking see through wall texture
var String targetPlayerName; // Player's name in targeting reticle
var String targetPlayerHealthString; // Target player's health (for targeting aug)'
var String targetPlayerLocationString; // Point on target player at which you are aiming (For multiplayer)
var float targetPlayerTime; // Timer
var float targetRangeTime;
var color targetPlayerColor; // Color red or green
var bool targetOutOfRange; // Is target out of range with current weapon
var String keyDropItem, keyTalk, keyTeamTalk;
var Color colRed, colGreen, colWhite;
margin=4.000000
corner=9.000000
msgRange="Range"
msgRangeUnits="ft"
msgHigh="High"
msgMedium="Medium"
msgLow="Low"
msgHealth="health"
msgOverall="Overall"
msgPercent="%"
msgHead="Head"
msgTorso="Torso"
msgLeftArm="L Arm"
msgRightArm="R Arm"
msgLeftLeg="L Leg"
msgRightLeg="R Leg"
msgLegs="Legs"
msgWeapon="Weapon:"
msgNone="None"
msgScanning1="* No Target *"
msgScanning2="* Scanning *"
msgADSTracking="* ADS Tracking *"
msgADSDetonating="* ADS Detonating *"
msgBehind="BEHIND"
msgDroneActive="Remote SpyDrone Active"
msgEnergyLow="BioElectric energy low!"
msgCantLaunch="ERROR - No room for SpyDrone construction!"
msgLightAmpActive="LightAmp Active"
msgIRAmpActive="IRAmp Active"
msgNoImage="Image Not Available"
msgDisabled="Disabled"
SpottedTeamString="You have spotted a teammate!"
YouArePoisonedString="You have been poisoned!"
YouAreBurnedString="You are burning!"
TurretInvincibleString="Turrets are only affected by EMP damage!"
CameraInvincibleString="Cameras are only affected by EMP damage!"
NeutBurnPoisonString="(Use medkits to instantly neutralize)"
OnlyString="Only "
KillsToGoString=" more kills, and "
KillToGoString=" more kill, and "
LessThanMinuteString="Less than a minute to go, and "
LessThanXString1="Less than "
LessThanXString2=" minutes to go, and "
LeadsMatchString=" leads the match!"
TiedMatchString="it's a tied match!"
WillWinMatchString=" will win the match!"
OutOfRangeString="(Out of range)"
LostLegsString="You've lost your legs!"
DropItem1String="You can use <"
DropItem2String="> to drop an equipped item."
msgTeammateHit="You hit your teammate!"
msgTeamNsf="You're on Team NSF!"
msgTeamUnatco="You're on Team Unatco!"
UseString="Use <"
TeamTalkString="> to send team messages."
TalkString="> to send regular chat messages."
YouKilledTeammateString="You killed a teammate!"
TeamLAMString="You cannot pickup your teammate's grenade!"
TeamComputerString="That computer already belongs to your team!"
NoCloakWeaponString="You cannot cloak while a weapon is drawn!"
TeamHackTurretString="That turret already belongs to your team!"
KeyNotBoundString="Key Not Bound"
OutOfAmmoString="Out of Ammo!"
colRed=(R=255)
colGreen=(G=255)
colWhite=(R=255,G=255,B=255)

ChildRequestedReconfiguration (Window childWin) -> bool


ConfigurationChanged();

return True;

ConfigurationChanged


local float x, y, w, h, cx, cy;


if ((winDrone != None) || (winZoom != None))
{
w = width/4;
h = height/4;
cx = width/8 + margin;
cy = height/2;
x = cx - w/2;
y = cy - h/2;

if (winDrone != None)
winDrone.ConfigureChild(x, y, w, h);

if (winZoom != None)
winZoom.ConfigureChild(x, y, w, h);
}

DrawDefenseAugmentation (GC gc)


local String str;
local float boxCX, boxCY;
local float x, y, w, h, mult;
local bool bDrawLine;


if (defenseTarget != None)
{
bDrawLine = False;

if (defenseTarget.IsInState('Exploding'))
{
str = msgADSDetonating;
bDrawLine = True;
}
else
str = msgADSTracking;

mult = VSize(defenseTarget.Location - Player.Location);
str = str $ CR() $ msgRange @ Int(mult/16) @ msgRangeUnits;

if (!ConvertVectorToCoordinates(defenseTarget.Location, boxCX, boxCY))
str = str @ msgBehind;

gc.GetTextExtent(0, w, h, str);
x = boxCX - w/2;
y = boxCY - h;
gc.SetTextColorRGB(255,0,0);
gc.DrawText(x, y, w, h, str);
gc.SetTextColor(colHeaderText);

if (bDrawLine)
{
gc.SetTileColorRGB(255,0,0);
Interpolate(gc, width/2, height/2, boxCX, boxCY, 64);
gc.SetTileColor(colHeaderText);
}
}

DrawDropShadowBox (GC gc, float x, float y, float w, float h)


local Color oldColor;


gc.GetTileColor(oldColor);
gc.SetTileColorRGB(0,0,0);
gc.DrawBox(x, y+h+1, w+2, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(x+w+1, y, 1, h+2, 0, 0, 1, Texture'Solid');
gc.SetTileColor(colBorder);
gc.DrawBox(x-1, y-1, w+2, h+2, 0, 0, 1, Texture'Solid');
gc.SetTileColor(oldColor);

DrawFadedText (GC gc, float x, float y, Color msgColor, String msg)


local Color adj;
local float mul, w, h;


EnableTranslucentText(True);
gc.SetStyle(DSTY_Translucent);
mul = FClamp( (Player.mpMsgTime - Player.Level.Timeseconds)/Player.mpMsgDelay, 0.0, 1.0 );
adj.r = mul * msgColor.r;
adj.g = mul * msgColor.g;
adj.b = mul * msgColor.b;
gc.SetTextColor(adj);
gc.GetTextExtent( 0, w, h, msg );
gc.DrawText( x, y, w, h, msg );
gc.SetStyle(DSTY_Normal);
EnableTranslucentText(False);

DrawMiscStatusMessages (GC gc)


local DeusExWeapon weap;
local float x, y, w, h, cury;
local Color msgColor;
local String str;
local bool bNeutralMsg;
local String dropKeyName, keyName;
local int i;


bNeutralMsg = False;

if (( Player.Level.Timeseconds < Player.mpMsgTime ) && !Player.bShowScores )
{
msgColor = colGreen;

switch( Player.mpMsgCode )
{
case Player.MPMSG_TeamUnatco:
str = msgTeamUnatco;
cury = TopCentralMessage( gc, str, msgColor );
if ( keyTalk ~= KeyNotBoundString )
RefreshMultiplayerKeys();
str = UseString $ keyTalk $ TalkString;
gc.GetTextExtent( 0, w, h, str );
cury += h;
DrawFadedText( gc, (width * 0.5) - (w * 0.5), cury, msgColor, str );
if ( TeamDMGame(Player.DXGame) != None )
{
cury += h;
if ( keyTeamTalk ~= KeyNotBoundString )
RefreshMultiplayerKeys();
str = UseString $ keyTeamTalk $ TeamTalkString;
gc.GetTextExtent( 0, w, h, str );
DrawFadedText( gc, (width * 0.5) - (w * 0.5), cury, msgColor, str );
}
break;
case Player.MPMSG_TeamNsf:
str = msgTeamNsf;
cury = TopCentralMessage( gc, str, msgColor );
if ( keyTalk ~= KeyNotBoundString )
RefreshMultiplayerKeys();
str = UseString $ keyTalk $ TalkString;
gc.GetTextExtent( 0, w, h, str );
cury += h;
DrawFadedText( gc, (width * 0.5) - (w * 0.5), cury, msgColor, str );
if ( TeamDMGame(Player.DXGame) != None )
{
cury += h;
if ( keyTeamTalk ~= KeyNotBoundString )
RefreshMultiplayerKeys();
str = UseString $ keyTeamTalk $ TeamTalkString;
gc.GetTextExtent( 0, w, h, str );
DrawFadedText( gc, (width * 0.5) - (w * 0.5), cury, msgColor, str );
}
break;
case Player.MPMSG_TeamHit:
msgColor = colRed;
str = msgTeammateHit;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_TeamSpot:
str = SpottedTeamString;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_FirstPoison:
str = YouArePoisonedString;
cury = TopCentralMessage( gc, str, msgColor );
gc.GetTextExtent( 0, w, h, NeutBurnPoisonString );
x = (width * 0.5) - (w * 0.5);
DrawFadedText( gc, x, cury, msgColor, NeutBurnPoisonString );
break;
case Player.MPMSG_FirstBurn:
str = YouAreBurnedString;
cury = TopCentralMessage( gc, str, msgColor );
gc.GetTextExtent( 0, w, h, NeutBurnPoisonString );
x = (width * 0.5) - (w * 0.5);
DrawFadedText( gc, x, cury, msgColor, NeutBurnPoisonString );
break;
case Player.MPMSG_TurretInv:
str = TurretInvincibleString;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_CameraInv:
str = CameraInvincibleString;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_CloseKills:
if ( Player.mpMsgOptionalParam > 1 )
str = OnlyString $ Player.mpMsgOptionalParam $ KillsToGoString;
else
str = OnlyString $ Player.mpMsgOptionalParam $ KillToGoString;
if ( Player.mpMsgOptionalString ~= "Tied" ) // Should only happen in a team game
str = str $ TiedMatchString;
else
str = str $ Player.mpMsgOptionalString $ WillWinMatchString;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_TimeNearEnd:
if ( Player.mpMsgOptionalParam > 1 )
str = LessThanXString1 $ Player.mpMsgOptionalParam $ LessThanXString2;
else
str = LessThanMinuteString;

if ( Player.mpMsgOptionalString ~= "Tied" ) // Should only happen in a team game
str = str $ TiedMatchString;
else
str = str $ Player.mpMsgOptionalString $ LeadsMatchString;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_LostLegs:
str = LostLegsString;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_DropItem:
if ( keyDropItem ~= KeyNotBoundString )
RefreshMultiplayerKeys();
str = DropItem1String $ keyDropItem $ DropItem2String;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_KilledTeammate:
msgColor = colRed;
TopCentralMessage( gc, YouKilledTeammateString, msgColor );
break;
case Player.MPMSG_TeamLAM:
str = TeamLAMString;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_TeamComputer:
str = TeamComputerString;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_NoCloakWeapon:
str = NoCloakWeaponString;
TopCentralMessage( gc, str, msgColor );
break;
case Player.MPMSG_TeamHackTurret:
str = TeamHackTurretString;
TopCentralMessage( gc, str, msgColor );
break;
}
gc.SetTextColor(colWhite);
}
if ( Player.Level.Timeseconds < targetPlayerTime )
{
gc.SetFont(Font'FontMenuSmall');
gc.GetTextExtent(0, w, h, targetPlayerName $ targetPlayerHealthString $ targetPlayerLocationString);
gc.SetTextColor(targetPlayerColor);
x = width * targetPlayerXMul - (w*0.5);
if ( x < 1) x = 1;
y = height * targetPlayerYMul;
gc.DrawText( x, y, w, h, targetPlayerName $ targetPlayerHealthString $ targetPlayerLocationString);
if (( targetOutOfRange ) && ( targetRangeTime > Player.Level.Timeseconds ))
{
gc.GetTextExtent(0, w, h, OutOfRangeString);
x = (width * 0.5) - (w*0.5);
y = (height * 0.5) - (h * 3.0);
gc.DrawText( x, y, w, h, OutOfRangeString );
}
gc.SetTextColor(colWhite);
}
weap = DeusExWeapon(Player.inHand);
if (( weap != None ) && ( weap.AmmoLeftInClip() == 0 ) && (weap.NumClips() == 0) )
{
if ( weap.IsA('WeaponLAM') ||
weap.IsA('WeaponGasGrenade') ||
weap.IsA('WeaponEMPGrenade') ||
weap.IsA('WeaponShuriken') ||
weap.IsA('WeaponLAW') )
{
}
else
{
if ( Player.Level.Timeseconds < OutOfAmmoTime )
{
gc.SetFont(Font'FontMenuTitle');
gc.GetTextExtent( 0, w, h, OutOfAmmoString );
gc.SetTextColor(colRed);
x = (width*0.5) - (w*0.5);
y = (height*0.5) - (h*5.0);
gc.DrawText( x, y, w, h, OutOfAmmoString );
}
if ( Player.Level.Timeseconds-OutOfAmmoTime > 0.33 )
OutOfAmmoTime = Player.Level.Timeseconds + 1.0;
}
}

DrawSpyDroneAugmentation (GC gc)


local String str;
local float boxCX, boxCY, boxTLX, boxTLY, boxBRX, boxBRY, boxW, boxH;
local float x, y, w, h, mult;
local Vector loc;


// set the coords of the drone window
boxW = width/4;
boxH = height/4;
boxCX = width/8 + margin;
boxCY = height/2;
boxTLX = boxCX - boxW/2;
boxTLY = boxCY - boxH/2;
boxBRX = boxCX + boxW/2;
boxBRY = boxCY + boxH/2;

if (winDrone != None)
{
DrawDropShadowBox(gc, boxTLX, boxTLY, boxW, boxH);

str = msgDroneActive;
gc.GetTextExtent(0, w, h, str);
x = boxCX - w/2;
y = boxTLY - h - margin;
gc.DrawText(x, y, w, h, str);

// print a low energy warning message
if ((Player.Energy / Player.Default.Energy) < 0.2)
{
str = msgEnergyLow;
gc.GetTextExtent(0, w, h, str);
x = boxCX - w/2;
y = boxTLY + margin;
gc.SetTextColorRGB(255,0,0);
gc.DrawText(x, y, w, h, str);
gc.SetTextColor(colHeaderText);
}
}
// Since drone is created on server, they is a delay in when it will actually show up on the client
// the flags dronecreated and drone referenced negotiate this timing
if ( !bDroneCreated )
{
if (Player.aDrone == None)
{
bDroneCreated = true;
Player.CreateDrone();
}
}
else if ( !bDroneReferenced )
{
if ( Player.aDrone != None )
{
bDroneReferenced = true;
AddActorRef( Player.aDrone );
}
}

DrawTargetAugmentation (GC gc)


local String str;
local Actor target;
local float boxCX, boxCY, boxTLX, boxTLY, boxBRX, boxBRY, boxW, boxH;
local float x, y, w, h, mult;
local Vector v1, v2;
local int i, j, k;
local DeusExWeapon weapon;
local bool bUseOldTarget;
local Color crossColor;
local DeusExPlayer own;
local vector AimLocation;
local int AimBodyPart;



crossColor.R = 255; crossColor.G = 255; crossColor.B = 255;

// check 500 feet in front of the player
target = TraceLOS(8000,AimLocation);

targetplayerhealthstring = "";
targetplayerlocationstring = "";

if ( target != None )
{
GetTargetReticleColor( target, crossColor );

if ((DeusExPlayer(target) != None) && (bTargetActive))
{
AimBodyPart = DeusExPlayer(target).GetMPHitLocation(AimLocation);
if (AimBodyPart == 1)
TargetPlayerLocationString = "("$msgHead$")";
else if ((AimBodyPart == 2) || (AimBodyPart == 5) || (AimBodyPart == 6))
TargetPlayerLocationString = "("$msgTorso$")";
else if ((AimBodyPart == 3) || (AimBodyPart == 4))
TargetPlayerLocationString = "("$msgLegs$")";
}

weapon = DeusExWeapon(Player.Weapon);
if ((weapon != None) && !weapon.bHandToHand && !bUseOldTarget)
{
// if the target is out of range, don't draw the reticle
if (weapon.MaxRange >= VSize(target.Location - Player.Location))
{
w = width;
h = height;
x = int(w * 0.5)-1;
y = int(h * 0.5)-1;

// scale based on screen resolution - default is 640x480
mult = FClamp(weapon.currentAccuracy * 80.0 * (width/640.0), corner, 80.0);

// make sure it's not too close to the center unless you have a perfect accuracy
mult = FMax(mult, corner+4.0);
if (weapon.currentAccuracy == 0.0)
mult = corner;

// draw the drop shadowed reticle
gc.SetTileColorRGB(0,0,0);
for (i=1; i>=0; i--)
{
gc.DrawBox(x+i, y-mult+i, 1, corner, 0, 0, 1, Texture'Solid');
gc.DrawBox(x+i, y+mult-corner+i, 1, corner, 0, 0, 1, Texture'Solid');
gc.DrawBox(x-(corner-1)/2+i, y-mult+i, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(x-(corner-1)/2+i, y+mult+i, corner, 1, 0, 0, 1, Texture'Solid');

gc.DrawBox(x-mult+i, y+i, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(x+mult-corner+i, y+i, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(x-mult+i, y-(corner-1)/2+i, 1, corner, 0, 0, 1, Texture'Solid');
gc.DrawBox(x+mult+i, y-(corner-1)/2+i, 1, corner, 0, 0, 1, Texture'Solid');

gc.SetTileColor(crossColor);
}
}
}
// movers are invalid targets for the aug
if (target.IsA('DeusExMover'))
target = None;
}

// let there be a 0.5 second delay before losing a target
if (target == None)
{
if ((Player.Level.TimeSeconds - lastTargetTime < 0.5) && IsActorValid(lastTarget))
{
target = lastTarget;
bUseOldTarget = True;
}
else
{
RemoveActorRef(lastTarget);
lastTarget = None;
}
}
else
{
lastTargetTime = Player.Level.TimeSeconds;
bUseOldTarget = False;
if (lastTarget != target)
{
RemoveActorRef(lastTarget);
lastTarget = target;
AddActorRef(lastTarget);
}
}

if (target != None)
{
// draw a cornered targetting box
v1.X = target.CollisionRadius;
v1.Y = target.CollisionRadius;
v1.Z = target.CollisionHeight;

if (ConvertVectorToCoordinates(target.Location, boxCX, boxCY))
{
boxTLX = boxCX;
boxTLY = boxCY;
boxBRX = boxCX;
boxBRY = boxCY;

// get the smallest box to enclose actor
// modified from Scott's ActorDisplayWindow
for (i=-1; i<=1; i+=2)
{
for (j=-1; j<=1; j+=2)
{
for (k=-1; k<=1; k+=2)
{
v2 = v1;
v2.X *= i;
v2.Y *= j;
v2.Z *= k;
v2.X += target.Location.X;
v2.Y += target.Location.Y;
v2.Z += target.Location.Z;

if (ConvertVectorToCoordinates(v2, x, y))
{
boxTLX = FMin(boxTLX, x);
boxTLY = FMin(boxTLY, y);
boxBRX = FMax(boxBRX, x);
boxBRY = FMax(boxBRY, y);
}
}
}
}

boxTLX = FClamp(boxTLX, margin, width-margin);
boxTLY = FClamp(boxTLY, margin, height-margin);
boxBRX = FClamp(boxBRX, margin, width-margin);
boxBRY = FClamp(boxBRY, margin, height-margin);

boxW = boxBRX - boxTLX;
boxH = boxBRY - boxTLY;

if ((bTargetActive) && (Player.Level.Netmode == NM_Standalone))
{
// set the coords of the zoom window, and draw the box
// even if we don't have a zoom window
x = width/8 + margin;
y = height/2;
w = width/4;
h = height/4;

DrawDropShadowBox(gc, x-w/2, y-h/2, w, h);

boxCX = width/8 + margin;
boxCY = height/2;
boxTLX = boxCX - width/8;
boxTLY = boxCY - height/8;
boxBRX = boxCX + width/8;
boxBRY = boxCY + height/8;

if (targetLevel > 2)
{
if (winZoom != None)
{
mult = (target.CollisionRadius + target.CollisionHeight);
v1 = Player.Location;
v1.Z += Player.BaseEyeHeight;
v2 = 1.5 * Player.Normal(target.Location - v1);
winZoom.SetViewportLocation(target.Location - mult * v2);
winZoom.SetWatchActor(target);
}
// window construction now happens in Tick()
}
else
{
// black out the zoom window and draw a "no image" message
gc.SetStyle(DSTY_Normal);
gc.SetTileColorRGB(0,0,0);
gc.DrawPattern(boxTLX, boxTLY, w, h, 0, 0, Texture'Solid');

gc.SetTextColorRGB(255,255,255);
gc.GetTextExtent(0, w, h, msgNoImage);
x = boxCX - w/2;
y = boxCY - h/2;
gc.DrawText(x, y, w, h, msgNoImage);
}

// print the name of the target above the box
if (target.IsA('Pawn'))
str = target.BindName;
else if (target.IsA('DeusExDecoration'))
str = DeusExDecoration(target).itemName;
else if (target.IsA('DeusExProjectile'))
str = DeusExProjectile(target).itemName;
else
str = target.GetItemName(String(target.Class));

// print disabled robot info
if (target.IsA('Robot') && (Robot(target).EMPHitPoints == 0))
str = str $ " (" $ msgDisabled $ ")";
gc.SetTextColor(crossColor);

// print the range to target
mult = VSize(target.Location - Player.Location);
str = str $ CR() $ msgRange @ Int(mult/16) @ msgRangeUnits;

gc.GetTextExtent(0, w, h, str);
x = boxTLX + margin;
y = boxTLY - h - margin;
gc.DrawText(x, y, w, h, str);

// level zero gives very basic health info
if (target.IsA('Pawn'))
mult = Float(Pawn(target).Health) / Float(Pawn(target).Default.Health);
else if (target.IsA('DeusExDecoration'))
mult = Float(DeusExDecoration(target).HitPoints) / Float(DeusExDecoration(target).Default.HitPoints);
else
mult = 1.0;

if (targetLevel == 0)
{
// level zero only gives us general health readings
if (mult >= 0.66)
{
str = msgHigh;
mult = 1.0;
}
else if (mult >= 0.33)
{
str = msgMedium;
mult = 0.5;
}
else
{
str = msgLow;
mult = 0.05;
}

str = str @ msgHealth;
}
else
{
// level one gives exact health readings
str = Int(mult * 100.0) $ msgPercent;
if (target.IsA('Pawn') && !target.IsA('Robot') && !target.IsA('Animal'))
{
x = mult; // save this for color calc
str = str @ msgOverall;
mult = Float(Pawn(target).HealthHead) / Float(Pawn(target).Default.HealthHead);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgHead;
mult = Float(Pawn(target).HealthTorso) / Float(Pawn(target).Default.HealthTorso);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgTorso;
mult = Float(Pawn(target).HealthArmLeft) / Float(Pawn(target).Default.HealthArmLeft);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgLeftArm;
mult = Float(Pawn(target).HealthArmRight) / Float(Pawn(target).Default.HealthArmRight);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgRightArm;
mult = Float(Pawn(target).HealthLegLeft) / Float(Pawn(target).Default.HealthLegLeft);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgLeftLeg;
mult = Float(Pawn(target).HealthLegRight) / Float(Pawn(target).Default.HealthLegRight);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgRightLeg;
mult = x;
}
else
{
str = str @ msgHealth;
}
}

gc.GetTextExtent(0, w, h, str);
x = boxTLX + margin;
y = boxTLY + margin;
gc.SetTextColor(GetColorScaled(mult));
gc.DrawText(x, y, w, h, str);
gc.SetTextColor(colHeaderText);

if (targetLevel > 1)
{
// level two gives us weapon info as well
if (target.IsA('Pawn'))
{
str = msgWeapon;

if (Pawn(target).Weapon != None)
str = str @ target.GetItemName(String(Pawn(target).Weapon.Class));
else
str = str @ msgNone;

gc.GetTextExtent(0, w, h, str);
x = boxTLX + margin;
y = boxBRY - h - margin;
gc.DrawText(x, y, w, h, str);
}
}
}
else
{
// display disabled robots
if (target.IsA('Robot') && (Robot(target).EMPHitPoints == 0))
{
str = msgDisabled;
gc.SetTextColor(crossColor);
gc.GetTextExtent(0, w, h, str);
x = boxCX - w/2;
y = boxTLY - h - margin;
gc.DrawText(x, y, w, h, str);
}
}
}
}
else if ((bTargetActive) && (Player.Level.NetMode == NM_Standalone))
{
if (Player.Level.TimeSeconds % 1.5 > 0.75)
str = msgScanning1;
else
str = msgScanning2;
gc.GetTextExtent(0, w, h, str);
x = width/2 - w/2;
y = (height/2 - h) - 20;
gc.DrawText(x, y, w, h, str);
}

// set the crosshair colors
DeusExRootWindow(player.rootWindow).hud.cross.SetCrosshairColor(crossColor);

DrawVisionAugmentation (GC gc)


local Vector loc;
local float boxCX, boxCY, boxTLX, boxTLY, boxBRX, boxBRY, boxW, boxH;
local float dist, x, y, w, h;
local float BrightDot;
local Actor A;
local float DrawGlow;
local float RadianView;
local float OldFlash, NewFlash;
local vector OldFog, NewFog;
local Texture oldSkins[9];


boxW = width/2;
boxH = height/2;
boxCX = width/2;
boxCY = height/2;
boxTLX = boxCX - boxW/2;
boxTLY = boxCY - boxH/2;
boxBRX = boxCX + boxW/2;
boxBRY = boxCY + boxH/2;

// at level one and higher, enhance heat sources (FLIR)
// use DrawActor to enhance NPC visibility
if (visionLevel >= 1)
{
// shift the entire screen to dark red (except for the middle box)
if (player.Level.Netmode == NM_Standalone)
{
gc.SetStyle(DSTY_Modulated);
gc.DrawPattern(0, 0, width, boxTLY, 0, 0, Texture'ConWindowBackground');
gc.DrawPattern(0, boxBRY, width, height-boxBRY, 0, 0, Texture'ConWindowBackground');
gc.DrawPattern(0, boxTLY, boxTLX, boxH, 0, 0, Texture'ConWindowBackground');
gc.DrawPattern(boxBRX, boxTLY, width-boxBRX, boxH, 0, 0, Texture'ConWindowBackground');
gc.DrawPattern(0, 0, width, boxTLY, 0, 0, Texture'SolidRed');
gc.DrawPattern(0, boxBRY, width, height-boxBRY, 0, 0, Texture'SolidRed');
gc.DrawPattern(0, boxTLY, boxTLX, boxH, 0, 0, Texture'SolidRed');
gc.DrawPattern(boxBRX, boxTLY, width-boxBRX, boxH, 0, 0, Texture'SolidRed');
gc.SetStyle(DSTY_Translucent);
}

// DEUS_EX AMSD In multiplayer, draw green here so that we can draw red actors over it
if (player.Level.Netmode != NM_Standalone)
{
gc.SetStyle(DSTY_Modulated);
gc.DrawPattern(0, 0, width, height, 0, 0, Texture'VisionBlue');
gc.DrawPattern(0, 0, width, height, 0, 0, Texture'VisionBlue');
gc.SetStyle(DSTY_Translucent);
}


// adjust for the player's eye height
loc = Player.Location;
loc.Z += Player.BaseEyeHeight;

// DEUS_EX AMSD In multiplayer, in order to not let you snipe people hiding in the dark across the map, but not get
// bad feedback from coloring everything green, we have to make the red non translucent so that scale glow darkens it,
// instead of fading it out.
//if (Player.Level.Netmode != NM_Standalone)
//gc.SetStyle(DSTY_Normal);

foreach Player.AllActors(class'Actor', A)
{
if (A.bVisionImportant)
{
if (IsHeatSource(A) || ( (Player.Level.Netmode != NM_Standalone) && ((A.IsA('AutoTurret')) || (A.IsA('AutoTurretGun')) || (A.IsA('SecurityCamera')) ) ))
{
dist = VSize(A.Location - loc);
//If within range of vision aug bit
if ( ( ((Player.Level.Netmode != NM_Standalone) && (dist <= (visionLevelvalue / 2))) ||
((Player.Level.Netmode == NM_Standalone) && (dist <= (visionLevelValue))) ) && (IsHeatSource(A)))
{
VisionTargetStatus = GetVisionTargetStatus(A);
SetSkins(A, oldSkins);
gc.DrawActor(A, False, False, True, 1.0, 2.0, None);
ResetSkins(A, oldSkins);
}
else if ((Player.Level.Netmode != NM_Standalone) && (GetVisionTargetStatus(A) == VISIONENEMY) && (A.Style == STY_Translucent))
{
//DEUS_EX AMSD In multiplayer, if looking at a cloaked enemy player within range (greater than see through walls)
//(If within walls radius he'd already have been seen.
if ( (dist <= (visionLevelvalue)) && (Player.LineOfSightTo(A,true)) )
{
VisionTargetStatus = GetVisionTargetStatus(A);
SetSkins(A, oldSkins);
gc.DrawActor(A, False, False, True, 1.0, 2.0, None);
ResetSkins(A, oldSkins);
}
}
else if (Player.LineOfSightTo(A,true))
{
VisionTargetStatus = GetVisionTargetStatus(A);
SetSkins(A, oldSkins);

if ((Player.Level.NetMode == NM_Standalone) || (dist < VisionLevelValue * 1.5) || (VisionTargetStatus != VISIONENEMY))
{
DrawGlow = 2.0;
}
else
{
// Fadeoff with distance square
DrawGlow = 2.0 / ((dist / (VisionLevelValue * 1.5)) * (dist / (VisionLevelValue * 1.5)));
// Don't make the actor harder to see than without the aug.
//DrawGlow = FMax(DrawGlow,A.ScaleGlow);
// Set a minimum.
DrawGlow = FMax(DrawGlow,0.15);
}
gc.DrawActor(A, False, False, True, 1.0, DrawGlow, None);
ResetSkins(A, oldSkins);
}
}
else if ( (A != VisionBlinder) && (Player.Level.NetMode != NM_Standalone) && (A.IsA('ExplosionLight')) && (Player.LineOfSightTo(A,True)) )
{
BrightDot = Normal(Vector(Player.ViewRotation)) dot Normal(A.Location - Player.Location);
dist = VSize(A.Location - Player.Location);

if (dist > 3000)
DrawGlow = 0;
else if (dist < 300)
DrawGlow = 1;
else
DrawGlow = ( 3000 - dist ) / ( 3000 - 300 );

// Calculate view angle in radians.
RadianView = (Player.FovAngle / 180) * 3.141593;

if ((BrightDot >= Cos(RadianView)) && (DrawGlow > 0.2) && (BrightDot * DrawGlow * 0.9 > 0.2)) //DEUS_EX AMSD .75 is approximately at our view angle edge.
{
VisionBlinder = A;
NewFlash = 10.0 * BrightDot * DrawGlow;
NewFog = vect(1000,1000,900) * BrightDot * DrawGlow * 0.9;
OldFlash = player.DesiredFlashScale;
OldFog = player.DesiredFlashFog * 1000;

// Don't add increase the player's flash above the current newflash.
NewFlash = FMax(0,NewFlash - OldFlash);
NewFog.X = FMax(0,NewFog.X - OldFog.X);
NewFog.Y = FMax(0,NewFog.Y - OldFog.Y);
NewFog.Z = FMax(0,NewFog.Z - OldFog.Z);
player.ClientFlash(NewFlash,NewFog);
player.IncreaseClientFlashLength(4.0*BrightDot*DrawGlow*BrightDot);
}
}
}
}

// draw text label
if (player.Level.Netmode == NM_Standalone)
{
gc.GetTextExtent(0, w, h, msgIRAmpActive);
x = boxTLX + margin;
y = boxTLY - margin - h;
gc.SetTextColor(colHeaderText);
gc.DrawText(x, y, w, h, msgIRAmpActive);
}
}

// shift the middle of the screen green (NV) and increase the contrast
// DEUS_EX AMSD In singleplayer, draw this here
// In multiplayer, drawn earlier so you can still see through walls with it.
if (player.Level.Netmode == NM_Standalone)
{
gc.SetStyle(DSTY_Modulated);
gc.DrawPattern(boxTLX, boxTLY, boxW, boxH, 0, 0, Texture'SolidGreen');
gc.DrawPattern(boxTLX, boxTLY, boxW, boxH, 0, 0, Texture'SolidGreen');
}
gc.SetStyle(DSTY_Normal);

if (player.Level.NetMode == NM_Standalone)
DrawDropShadowBox(gc, boxTLX, boxTLY, boxW, boxH);

// draw text label
if (player.Level.Netmode == NM_Standalone)
{
gc.GetTextExtent(0, w, h, msgLightAmpActive);
x = boxTLX + margin;
y = boxTLY + margin;
gc.SetTextColor(colHeaderText);
gc.DrawText(x, y, w, h, msgLightAmpActive);
}

GetGridTexture (Texture tex) -> Texture


if (tex == None)
return Texture'BlackMaskTex';
else if (tex == Texture'BlackMaskTex')
return Texture'BlackMaskTex';
else if (tex == Texture'GrayMaskTex')
return Texture'BlackMaskTex';
else if (tex == Texture'PinkMaskTex')
return Texture'BlackMaskTex';
else if (VisionTargetStatus == VISIONENEMY)
return Texture'Virus_SFX';
else if (VisionTargetStatus == VISIONALLY)
return Texture'Wepn_Prifle_SFX';
else if (VisionTargetStatus == VISIONNEUTRAL)
return Texture'WhiteStatic';
else
return Texture'WhiteStatic';

GetTargetReticleColor (Actor target, out Color xcolor)


local DeusExPlayer safePlayer;
local AutoTurret turret;
local bool bDM, bTeamDM;
local Vector dist;
local float SightDist;
local DeusExWeapon w;
local int team;
local String titleString;


bDM = (DeathMatchGame(player.DXGame) != None);
bTeamDM = (TeamDMGame(player.DXGame) != None);

if ( target.IsA('ScriptedPawn') )
{
if (ScriptedPawn(target).GetPawnAllianceType(Player) == ALLIANCE_Hostile)
xcolor = colRed;
else
xcolor = colGreen;
}
else if ( Player.Level.NetMode != NM_Standalone ) // Only do the rest in multiplayer
{
if ( target.IsA('DeusExPlayer') && (target != player) ) // Other players IFF
{
if ( bTeamDM && (TeamDMGame(player.DXGame).ArePlayersAllied(DeusExPlayer(target),player)) )
{
xcolor = colGreen;
if ( (Player.mpMsgFlags & Player.MPFLAG_FirstSpot) != Player.MPFLAG_FirstSpot )
Player.MultiplayerNotifyMsg( Player.MPMSG_TeamSpot );
}
else
xcolor = colRed;

SightDist = VSize(target.Location - Player.Location);

if ( ( bTeamDM && (TeamDMGame(player.DXGame).ArePlayersAllied(DeusExPlayer(target),player))) ||
(target.Style != STY_Translucent) || (bVisionActive && (Sightdist <= visionLevelvalue)) )
{
targetPlayerName = DeusExPlayer(target).PlayerReplicationInfo.PlayerName;
// DEUS_EX AMSD Show health of enemies with the target active.
if (bTargetActive)
TargetPlayerHealthString = "(" $ int(100 * (DeusExPlayer(target).Health / Float(DeusExPlayer(target).Default.Health))) $ "%)";
targetOutOfRange = False;
w = DeusExWeapon(player.Weapon);
if (( w != None ) && ( xcolor != colGreen ))
{
dist = player.Location - target.Location;
if ( VSize(dist) > w.maxRange )
{
if (!(( WeaponAssaultGun(w) != None ) && ( Ammo20mm(WeaponAssaultGun(w).AmmoType) != None )))
{
targetRangeTime = Player.Level.Timeseconds + 0.1;
targetOutOfRange = True;
}
}
}
targetPlayerTime = Player.Level.Timeseconds + targetPlayerDelay;
targetPlayerColor = xcolor;
}
else
xcolor = colWhite; // cloaked enemy
}
else if (target.IsA('ThrownProjectile')) // Grenades IFF
{
if ( ThrownProjectile(target).bDisabled )
xcolor = colWhite;
else if ( (bTeamDM && (ThrownProjectile(target).team == player.PlayerReplicationInfo.team)) ||
(player == DeusExPlayer(target.Owner)) )
xcolor = colGreen;
else
xcolor = colRed;
}
else if ( target.IsA('AutoTurret') || target.IsA('AutoTurretGun') ) // Autoturrets IFF
{
if ( target.IsA('AutoTurretGun') )
{
team = AutoTurretGun(target).team;
titleString = AutoTurretGun(target).titleString;
}
else
{
team = AutoTurret(target).team;
titleString = AutoTurret(target).titleString;
}
if ( (bTeamDM && (player.PlayerReplicationInfo.team == team)) ||
(!bTeamDM && (player.PlayerReplicationInfo.PlayerID == team)) )
xcolor = colGreen;
else if (team == -1)
xcolor = colWhite;
else
xcolor = colRed;

targetPlayerName = titleString;
targetOutOfRange = False;
targetPlayerTime = Player.Level.Timeseconds + targetPlayerDelay;
targetPlayerColor = xcolor;
}
else if ( target.IsA('ComputerSecurity'))
{
if ( ComputerSecurity(target).team == -1 )
xcolor = colWhite;
else if ((bTeamDM && (ComputerSecurity(target).team==player.PlayerReplicationInfo.team)) ||
(bDM && (ComputerSecurity(target).team==player.PlayerReplicationInfo.PlayerID)))
xcolor = colGreen;
else
xcolor = colRed;
}
else if ( target.IsA('SecurityCamera'))
{
if ( !SecurityCamera(target).bActive )
xcolor = colWhite;
else if ( SecurityCamera(target).team == -1 )
xcolor = colWhite;
else if ((bTeamDM && (SecurityCamera(target).team==player.PlayerReplicationInfo.team)) ||
(bDM && (SecurityCamera(target).team==player.PlayerReplicationInfo.PlayerID)))
xcolor = colGreen;
else
xcolor = colRed;
}
}

GetVisionTargetStatus (Actor Target) -> int


local DeusExPlayer PlayerTarget;
local TeamDMGame TeamGame;


if (Target == None)
return VISIONNEUTRAL;

if (player.Level.NetMode == NM_Standalone)
return VISIONNEUTRAL;

if (target.IsA('DeusExPlayer'))
{
if (target == player)
return VISIONNEUTRAL;

TeamGame = TeamDMGame(player.DXGame);
// In deathmatch, all players are hostile.
if (TeamGame == None)
return VISIONENEMY;

PlayerTarget = DeusExPlayer(Target);

if (TeamGame.ArePlayersAllied(PlayerTarget,Player))
return VISIONALLY;
else
return VISIONENEMY;
}
else if ( (target.IsA('AutoTurretGun')) || (target.IsA('AutoTurret')) )
{
if (target.IsA('AutoTurretGun'))
return GetVisionTargetStatus(target.Owner);
else if ((AutoTurret(Target).bDisabled))
return VISIONNEUTRAL;
else if (AutoTurret(Target).safetarget == Player)
return VISIONALLY;
else if ((Player.DXGame.IsA('TeamDMGame')) && (AutoTurret(Target).team == -1))
return VISIONNEUTRAL;
else if ( (!Player.DXGame.IsA('TeamDMGame')) || (Player.PlayerReplicationInfo.Team != AutoTurret(Target).team) )
return VISIONENEMY;
else if (Player.PlayerReplicationInfo.Team == AutoTurret(Target).team)
return VISIONALLY;
else
return VISIONNEUTRAL;
}
else if (target.IsA('SecurityCamera'))
{
if ( !SecurityCamera(target).bActive )
return VISIONNEUTRAL;
else if ( SecurityCamera(target).team == -1 )
return VISIONNEUTRAL;
else if (((Player.DXGame.IsA('TeamDMGame')) && (SecurityCamera(target).team==player.PlayerReplicationInfo.team)) ||
( (Player.DXGame.IsA('DeathMatchGame')) && (SecurityCamera(target).team==player.PlayerReplicationInfo.PlayerID)))
return VISIONALLY;
else
return VISIONENEMY;
}
else
return VISIONNEUTRAL;

InitWindow


Super.InitWindow();
bTickEnabled = True;
Lower();
RefreshMultiplayerKeys();

Interpolate (GC gc, float fromX, float fromY, float toX, float toY, int power)


local float xPos, yPos;
local float deltaX, deltaY;
local float maxDist;
local int points;
local int i;


maxDist = 16;

points = 1;
deltaX = (toX-fromX);
deltaY = (toY-fromY);
while (power >= 0)
{
if ((deltaX >= maxDist) || (deltaX <= -maxDist) || (deltaY >= maxDist) || (deltaY <= -maxDist))
{
deltaX *= 0.5;
deltaY *= 0.5;
points *= 2;
power--;
}
else
break;
}

xPos = fromX + ((Player.Level.TimeSeconds % 0.5) * deltaX * 2);
yPos = fromY + ((Player.Level.TimeSeconds % 0.5) * deltaY * 2);
for (i=0; i {
xPos += deltaX;
yPos += deltaY;
gc.DrawPattern(xPos, yPos, 2, 2, 0, 0, Texture'Solid');
}

IsHeatSource (Actor A) -> bool


if ((A.bHidden) && (Player.Level.NetMode != NM_Standalone))
return False;
if (A.IsA('Pawn'))
{
if (A.IsA('ScriptedPawn'))
return True;
else if ( (A.IsA('DeusExPlayer')) && (A != Player) )//DEUS_EX AMSD For multiplayer.
return True;
return False;
}
else if (A.IsA('DeusExCarcass'))
return True;
else if (A.IsA('FleshFragment'))
return True;
else
return False;

PostDrawWindow (GC gc)


local PlayerPawn pp;


pp = Player.GetPlayerPawn();

//DEUS_EX AMSD Draw vision first so that everything else doesn't get washed green
if (bVisionActive)
DrawVisionAugmentation(gc);

if ( Player.Level.NetMode != NM_Standalone )
DrawMiscStatusMessages( gc );

if (bDefenseActive)
DrawDefenseAugmentation(gc);

if (Player.bSpyDroneActive)
DrawSpyDroneAugmentation(gc);

// draw IFF and accuracy information all the time, return False if target aug is not active
DrawTargetAugmentation(gc);

gc.SetFont(Font'FontMenuSmall_DS');
gc.SetTextColor(colHeaderText);
gc.SetStyle(DSTY_Normal);
gc.SetTileColor(colBorder);

if ( (pp != None) && (pp.bShowScores) )
{
if ( DeathMatchGame(Player.DXGame) != None )
DeathMatchGame(Player.DXGame).ShowDMScoreboard( Player, gc, width, height );
else if ( TeamDMGame(Player.DXGame) != None )
TeamDMGame(Player.DXGame).ShowTeamDMScoreboard( Player, gc, width, height );
}

RefreshMultiplayerKeys


local String Alias, keyName;
local int i;


for ( i = 0; i < 255; i++ )
{
keyName = player.ConsoleCommand ( "KEYNAME "$i );
if ( keyName != "" )
{
Alias = player.ConsoleCommand( "KEYBINDING "$keyName );
if ( Alias ~= "DropItem" )
keyDropItem = keyName;
else if ( Alias ~= "Talk" )
keyTalk = keyName;
else if ( Alias ~= "TeamTalk" )
keyTeamTalk = keyName;
}
}
if ( keyDropItem ~= "" )
keyDropItem = KeyNotBoundString;
if ( keyTalk ~= "" )
keyTalk = KeyNotBoundString;
if ( keyTeamTalk ~= "" )
keyTeamTalk = KeyNotBoundString;

ResetSkins (Actor actor, Texture oldSkins[9])


local int i;


for (i=0; i<8; i++)
actor.MultiSkins[i] = oldSkins[i];
actor.Skin = oldSkins[i];

SetSkins (Actor actor, out Texture oldSkins[9])


local int i;
local texture curSkin;


for (i=0; i<8; i++)
oldSkins[i] = actor.MultiSkins[i];
oldSkins[i] = actor.Skin;

for (i=0; i<8; i++)
{
curSkin = actor.GetMeshTexture(i);
actor.MultiSkins[i] = GetGridTexture(curSkin);
}
actor.Skin = GetGridTexture(oldSkins[i]);

Tick (float deltaTime)


// check for the drone ViewportWindow being constructed
if (Player.bSpyDroneActive && (Player.aDrone != None) && (winDrone == None) &&
(Player.PlayerIsClient() || (Player.Level.NetMode==NM_Standalone)) )
{
winDrone = ViewportWindow(NewChild(class'ViewportWindow'));
if (winDrone != None)
{
winDrone.AskParentForReconfigure();
winDrone.Lower();
winDrone.SetViewportActor(Player.aDrone);
}
}

// check for the target ViewportWindow being constructed
if (bTargetActive && (targetLevel > 2) && (winZoom == None) && (lastTarget != None) && (Player.Level.NetMode == NM_Standalone))
{
winZoom = ViewportWindow(NewChild(class'ViewportWindow'));
if (winZoom != None)
{
winZoom.AskParentForReconfigure();
winZoom.Lower();
}
}

// handle Destroy() in Tick() since they can't be in DrawWindow()
if (!Player.bSpyDroneActive)
{
if (winDrone != None)
{
winDrone.Destroy();
winDrone = None;
}
if ((Player.aDrone != None) && IsActorValid(Player.aDrone))
{
RemoveActorRef(Player.aDrone);
bDroneReferenced = false;
}
bDroneCreated = false;
}

if (winZoom != None)
{
if ((bTargetActive && (lastTarget == None)) || !bTargetActive)
{
winZoom.Destroy();
winZoom = None;
}
}

TopCentralMessage (GC gc, String str, color textColor) -> float


local float x, y, w, h;


gc.SetFont(Font'FontMenuTitle');
gc.GetTextExtent( 0, w, h, str );
gc.SetTextColor( textColor );
x = (width * 0.5) - (w * 0.5);
y = height * 0.33;
DrawFadedText( gc, x, y, textColor, str );
return( y + h );

TraceLOS (float checkDist, out vector HitLocation) -> Actor


local Actor target;
local Vector HitLoc, HitNormal, StartTrace, EndTrace;


target = None;

// figure out how far ahead we should trace
StartTrace = Player.Location;
EndTrace = Player.Location + (Vector(Player.ViewRotation) * checkDist);

// adjust for the eye height
StartTrace.Z += Player.BaseEyeHeight;
EndTrace.Z += Player.BaseEyeHeight;

// find the object that we are looking at
// make sure we don't select the object that we're carrying
foreach Player.TraceActors(class'Actor', target, HitLoc, HitNormal, EndTrace, StartTrace)
{
if (target.IsA('Pawn') || target.IsA('DeusExDecoration') || target.IsA('ThrownProjectile') ||
(target.IsA('DeusExMover') && DeusExMover(target).bBreakable))
{
if (target != Player.CarriedDecoration)
{
if ( (Player.Level.NetMode != NM_Standalone) && target.IsA('DeusExPlayer') )
{
if ( DeusExPlayer(target).AdjustHitLocation( HitLoc, EndTrace - StartTrace ) )
break;
else
target = None;
}
else
break;
}
}
}

HitLocation = HitLoc;

return target;




AugmentationManager.uc (extends Actor)

var int NumSlots;
var int AugCount;
var int KeyBase;
var travel S_AugInfo AugLocs[7];
var DeusExPlayer Player; // which player am I attached to?
var travel Augmentation FirstAug; // Pointer to first Augmentation
var Class augClasses[25];
var Class defaultAugs[3];
var localized string AugLocationFull;
var localized String NoAugInSlot;
AugLocs(0)=(NumSlots=1,KeyBase=4)
AugLocs(1)=(NumSlots=1,KeyBase=7)
AugLocs(2)=(NumSlots=3,KeyBase=8)
AugLocs(3)=(NumSlots=1,KeyBase=5)
AugLocs(4)=(NumSlots=1,KeyBase=6)
AugLocs(5)=(NumSlots=2,KeyBase=2)
AugLocs(6)=(NumSlots=3,KeyBase=11)
augClasses(0)=Class'DeusEx.AugSpeed'
augClasses(1)=Class'DeusEx.AugTarget'
augClasses(2)=Class'DeusEx.AugCloak'
augClasses(3)=Class'DeusEx.AugBallistic'
augClasses(4)=Class'DeusEx.AugRadarTrans'
augClasses(5)=Class'DeusEx.AugShield'
augClasses(6)=Class'DeusEx.AugEnviro'
augClasses(7)=Class'DeusEx.AugEMP'
augClasses(8)=Class'DeusEx.AugCombat'
augClasses(9)=Class'DeusEx.AugHealing'
augClasses(10)=Class'DeusEx.AugStealth'
augClasses(11)=Class'DeusEx.AugIFF'
augClasses(12)=Class'DeusEx.AugLight'
augClasses(13)=Class'DeusEx.AugMuscle'
augClasses(14)=Class'DeusEx.AugVision'
augClasses(15)=Class'DeusEx.AugDrone'
augClasses(16)=Class'DeusEx.AugDefense'
augClasses(17)=Class'DeusEx.AugAqualung'
augClasses(18)=Class'DeusEx.AugDatalink'
augClasses(19)=Class'DeusEx.AugHeartLung'
augClasses(20)=Class'DeusEx.AugPower'
defaultAugs(0)=Class'DeusEx.AugLight'
defaultAugs(1)=Class'DeusEx.AugIFF'
defaultAugs(2)=Class'DeusEx.AugDatalink'
AugLocationFull="You can't add any more augmentations to that location!"
NoAugInSlot="There is no augmentation in that slot"
bHidden=True
bTravel=True

ActivateAll


local Augmentation anAug;


// Only allow this if the player still has
// Bioleectric Energy(tm)

if ((player != None) && (player.Energy > 0))
{
anAug = FirstAug;
while(anAug != None)
{
if ( (Level.NetMode == NM_Standalone) || (!anAug.IsA('AugLight')) )
anAug.Activate();
anAug = anAug.next;
}
}

ActivateAugByKey (int keyNum) -> bool


local Augmentation anAug;
local bool bActivated;


bActivated = False;

if ((keyNum < 0) || (keyNum > 9))
return False;

anAug = FirstAug;
while(anAug != None)
{
if ((anAug.HotKeyNum - 3 == keyNum) && (anAug.bHasIt))
break;

anAug = anAug.next;
}

if (anAug == None)
{
player.ClientMessage(NoAugInSlot);
}
else
{
// Toggle
if (anAug.bIsActive)
anAug.Deactivate();
else
anAug.Activate();

bActivated = True;
}

return bActivated;

AddAllAugs


local int augIndex;


// Loop through all the augmentation classes and create
// any augs that don't exist. Then set them all to the
// maximum level.

for(augIndex=0; augIndex {
if (augClasses[augIndex] != None)
GivePlayerAugmentation(augClasses[augIndex]);
}

AddDefaultAugmentations


local int augIndex;


for(augIndex=0; augIndex {
if (defaultAugs[augIndex] != None)
GivePlayerAugmentation(defaultAugs[augIndex]);
}

AreSlotsFull (Augmentation augToCheck) -> Bool


local int num;
local bool bHasMPConflict;
local Augmentation anAug;


// You can only have a limited number augmentations in each location,
// so here we check to see if you already have the maximum allowed.

num = 0;
bHasMPConflict = false;
anAug = FirstAug;
while(anAug != None)
{
if (anAug.AugmentationName != "")
if (augToCheck != anAug)
if (Level.Netmode == NM_Standalone)
{
if (augToCheck.AugmentationLocation == anAug.AugmentationLocation)
if (anAug.bHasIt)
num++;
}
else
{
if ((AnAug.MPConflictSlot == AugToCheck.MPConflictSlot) && (AugToCheck.MPConflictSlot != 0) && (AnAug.bHasIt))
{
bHasMPConflict = true;
}
}
anAug = anAug.next;
}
if (Level.NetMode == NM_Standalone)
return (num >= AugLocs[augToCheck.AugmentationLocation].NumSlots);
else
return bHasMPConflict;

BoostAugs (bool bBoostEnabled, Augmentation augBoosting)


local Augmentation anAug;


anAug = FirstAug;
while(anAug != None)
{
// Don't boost the augmentation causing the boosting!
if (anAug != augBoosting)
{
if (bBoostEnabled)
{
if (anAug.bIsActive && !anAug.bBoosted && (anAug.CurrentLevel < anAug.MaxLevel))
{
anAug.Deactivate();
anAug.CurrentLevel++;
anAug.bBoosted = True;
anAug.Activate();
}
}
else if (anAug.bBoosted)
{
anAug.CurrentLevel--;
anAug.bBoosted = False;
}
}
anAug = anAug.next;
}

CalcEnergyUse (float deltaTime) -> Float


local float energyUse, energyMult;
local Augmentation anAug;
local Augmentation PowerAug;


energyUse = 0;
energyMult = 1.0;

anAug = FirstAug;
while(anAug != None)
{
if (anAug.IsA('AugPower'))
PowerAug = anAug;
if (anAug.bHasIt && anAug.bIsActive)
{
energyUse += ((anAug.GetEnergyRate()/60) * deltaTime);
if (anAug.IsA('AugPower'))
{
energyMult = anAug.LevelValues[anAug.CurrentLevel];
}
}
anAug = anAug.next;
}

// DEUS_EX AMSD Manage the power aug automatically in multiplayer.
if ( (Level.NetMode != NM_Standalone) && (PowerAug != None) && (PowerAug.bHasIt) )
{
//If using energy, turn on the power aug.
if ((energyUse > 0) && (!PowerAug.bIsActive))
ActivateAugByKey(PowerAug.HotKeyNum - 3);

//If not using energy, turn off the power aug.
if ((energyUse == 0) && (PowerAug.bIsActive))
ActivateAugByKey(PowerAug.HotKeyNum - 3);

if (PowerAug.bIsActive)
energyMult = PowerAug.LevelValues[PowerAug.CurrentLevel];
}
// check for the power augmentation
energyUse *= energyMult;

return energyUse;

CreateAugmentations (DeusExPlayer newPlayer)


local int augIndex;
local Augmentation anAug;
local Augmentation lastAug;


FirstAug = None;
LastAug = None;

player = newPlayer;

for(augIndex=0; augIndex {
if (augClasses[augIndex] != None)
{
anAug = Spawn(augClasses[augIndex], Self);
anAug.Player = player;

// Manage our linked list
if (anAug != None)
{
if (FirstAug == None)
{
FirstAug = anAug;
}
else
{
LastAug.next = anAug;
}

LastAug = anAug;
}
}
}

DeactivateAll


local Augmentation anAug;


anAug = FirstAug;
while(anAug != None)
{
if (anAug.bIsActive)
anAug.Deactivate();
anAug = anAug.next;
}

FindAugmentation (Class findClass) -> Augmentation


local Augmentation anAug;


anAug = FirstAug;
while(anAug != None)
{
if (anAug.Class == findClass)
break;

anAug = anAug.next;
}

return anAug;

GetAugLevelValue (class AugClass) -> float


local Augmentation anAug;
local float retval;


retval = 0;

anAug = FirstAug;
while(anAug != None)
{
if (anAug.Class == augClass)
{
if (anAug.bHasIt && anAug.bIsActive)
return anAug.LevelValues[anAug.CurrentLevel];
else
return -1.0;
}

anAug = anAug.next;
}

return -1.0;

GetClassLevel (class augClass) -> int


local Augmentation anAug;


anAug = FirstAug;
while(anAug != None)
{
if (anAug.Class == augClass)
{
if (anAug.bHasIt && anAug.bIsActive)
return anAug.CurrentLevel;
else
return -1;
}

anAug = anAug.next;
}

return -1;

GivePlayerAugmentation (Class giveClass) -> Augmentation


local Augmentation anAug;


// Checks to see if the player already has it. If so, we want to
// increase the level
anAug = FindAugmentation(giveClass);

if (anAug == None)
return None; // shouldn't happen, but you never know!

if (anAug.bHasIt)
{
anAug.IncLevel();
return anAug;
}

if (AreSlotsFull(anAug))
{
Player.ClientMessage(AugLocationFull);
return anAug;
}

anAug.bHasIt = True;

if (anAug.bAlwaysActive)
{
anAug.bIsActive = True;
anAug.GotoState('Active');
}
else
{
anAug.bIsActive = False;
}


if ( Player.Level.Netmode == NM_Standalone )
Player.ClientMessage(Sprintf(anAug.AugNowHaveAtLevel, anAug.AugmentationName, anAug.CurrentLevel + 1));

// Manage our AugLocs[] array
AugLocs[anAug.AugmentationLocation].augCount++;

// Assign hot key to new aug
// (must be after before augCount is incremented!)
if (Level.NetMode == NM_Standalone)
anAug.HotKeyNum = AugLocs[anAug.AugmentationLocation].augCount + AugLocs[anAug.AugmentationLocation].KeyBase;
else
anAug.HotKeyNum = anAug.MPConflictSlot + 2;

if ((!anAug.bAlwaysActive) && (Player.bHUDShowAllAugs))
Player.AddAugmentationDisplay(anAug);

return anAug;

IncreaseAllAugs (int Amount)


local Augmentation anAug;


anAug = FirstAug;
while(anAug != None)
{
if (anAug.bHasIt)
anAug.CurrentLevel = Min(anAug.CurrentLevel + Amount, anAug.MaxLevel);

anAug = anAug.next;
}

NumAugsActive -> int


local Augmentation anAug;
local int count;


if (player == None)
return 0;

count = 0;
anAug = FirstAug;
while(anAug != None)
{
if (anAug.bHasIt && anAug.bIsActive && !anAug.bAlwaysActive)
count++;

anAug = anAug.next;
}

return count;

RefreshAugDisplay


local Augmentation anAug;


if (player == None)
return;

// First make sure there are no augs visible in the display
player.ClearAugmentationDisplay();

anAug = FirstAug;
while(anAug != None)
{
// First make sure the aug is active if need be
if (anAug.bHasIt)
{
if (anAug.bIsActive)
{
anAug.GotoState('Active');

// Now, if this is an aug that isn't *always* active, then
// make sure it's in the augmentation display

if (!anAug.bAlwaysActive)
player.AddAugmentationDisplay(anAug);
}
else if ((player.bHUDShowAllAugs) && (!anAug.bAlwaysActive))
{
player.AddAugmentationDisplay(anAug);
}
}

anAug = anAug.next;
}

ResetAugmentations


local Augmentation anAug;
local Augmentation nextAug;
local int LocIndex;


anAug = FirstAug;
while(anAug != None)
{
nextAug = anAug.next;
anAug.Destroy();
anAug = nextAug;
}

FirstAug = None;

//Must also clear auglocs.
for (LocIndex = 0; LocIndex < 7; LocIndex++)
{
AugLocs[LocIndex].AugCount = 0;
}


SetAllAugsToMaxLevel


local Augmentation anAug;


anAug = FirstAug;
while(anAug != None)
{
if (anAug.bHasIt)
anAug.CurrentLevel = anAug.MaxLevel;

anAug = anAug.next;
}

SetPlayer (DeusExPlayer newPlayer)


local Augmentation anAug;


player = newPlayer;

anAug = FirstAug;
while(anAug != None)
{
anAug.player = player;
anAug = anAug.next;
}




AugmentationUpgradeCannister.uc (extends DeusExPickup)

var localized string MustBeUsedOn;
MustBeUsedOn="Must be used on Augmentations Screen."
ItemName="Augmentation Upgrade Canister"
ItemArticle="an"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.AugmentationUpgradeCannister'
PickupViewMesh=LodMesh'DeusExItems.AugmentationUpgradeCannister'
ThirdPersonMesh=LodMesh'DeusExItems.AugmentationUpgradeCannister'
LandSound=Sound'DeusExSounds.Generic.PlasticHit1'
Icon=Texture'DeusExUI.Icons.BeltIconAugmentationUpgrade'
largeIcon=Texture'DeusExUI.Icons.LargeIconAugmentationUpgrade'
largeIconWidth=24
largeIconHeight=41
Description="An augmentation upgrade canister contains highly specific nanomechanisms that, when combined with a previously programmed module, can increase the efficiency of an installed augmentation. Because no programming is required, upgrade canisters may be used by trained agents in the field with minimal risk."
beltDescription="AUG UPG"
Mesh=LodMesh'DeusExItems.AugmentationUpgradeCannister'
CollisionRadius=3.200000
CollisionHeight=5.180000
Mass=10.000000
Buoyancy=12.000000

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.Clear();
winInfo.SetTitle(itemName);
winInfo.SetText(Description $ winInfo.CR() $ winInfo.CR() $ MustBeUsedOn);

return True;




AutoTurret.uc (extends DeusExDecoration)

var AutoTurretGun gun;
var() localized String titleString; // So we can name specific turrets in multiplayer
var() bool bTrackPawnsOnly;
var() bool bTrackPlayersOnly;
var() bool bActive;
var() int maxRange;
var() float fireRate;
var() float gunAccuracy;
var() int gunDamage;
var() int ammoAmount;
var Actor curTarget;
var Actor prevTarget; // target we had last tick.
var Pawn safeTarget; // in multiplayer, this actor is strictly off-limits
var float fireTimer;
var bool bConfused; // used when hit by EMP
var float confusionTimer; // how long until turret resumes normal operation
var float confusionDuration; // how long does an EMP hit last?
var Actor LastTarget; // what was our last target?
var float pitchLimit; // what's the maximum pitch?
var Rotator origRot; // original rotation
var bool bPreAlarmActiveState; // was I previously awake or not?
var bool bDisabled; // have I been hacked or shut down by computers?
var float TargetRefreshTime; // used for multiplayer to reduce rate of checking for targets.
var int team; // Keep track of team the turrets on
var int mpTurretDamage; // Settings for multiplayer
var int mpTurretRange;
var bool bComputerReset; // Keep track of if computer has been reset so we avoid all actors checks
var bool bSwitching;
var float SwitchTime, beepTime;
var Pawn savedTarget;
titleString="AutoTurret"
bTrackPlayersOnly=True
bActive=True
maxRange=512
fireRate=0.250000
gunAccuracy=0.500000
gunDamage=5
AmmoAmount=1000
confusionDuration=10.000000
pitchLimit=11000.000000
Team=-1
mpTurretDamage=20
mpTurretRange=1024
HitPoints=50
minDamageThreshold=50
bHighlight=False
ItemName="Turret Base"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.AutoTurretBase'
SoundRadius=48
SoundVolume=192
AmbientSound=Sound'DeusExSounds.Generic.AutoTurretHum'
CollisionRadius=14.000000
CollisionHeight=20.200001
Mass=50.000000
Buoyancy=10.000000
bVisionImportant=True

AcquireMultiplayerTarget -> Actor


local Pawn apawn;
local DeusExPlayer aplayer;
local Vector dist;
local Actor noActor;


if ( bSwitching )
{
noActor = None;
return noActor;
}

//DEUS_EX AMSD See if our old target is still valid.
if ((prevtarget != None) && (prevtarget != safetarget) && (Pawn(prevtarget) != None))
{
if (Pawn(prevtarget).AICanSee(self, 1.0, false, false, false, true) > 0)
{
if ((DeusExPlayer(prevtarget) == None) && !DeusExPlayer(prevtarget).bHidden )
{
dist = DeusExPlayer(prevtarget).Location - gun.Location;
if (VSize(dist) < maxRange )
{
curtarget = prevtarget;
return curtarget;
}
}
else
{
if ((DeusExPlayer(prevtarget).AugmentationSystem.GetAugLevelValue(class'AugRadarTrans') == -1.0) && !DeusExPlayer(prevtarget).bHidden )
{
dist = DeusExPlayer(prevtarget).Location - gun.Location;
if (VSize(dist) < maxRange )
{
curtarget = prevtarget;
return curtarget;
}
}
}
}
}
// MB Optimized to use pawn list, previous way used foreach VisibleActors
apawn = gun.Level.PawnList;
while ( apawn != None )
{
if (apawn.bDetectable && !apawn.bIgnore && apawn.IsA('DeusExPlayer'))
{
aplayer = DeusExPlayer(apawn);

dist = aplayer.Location - gun.Location;

if ( VSize(dist) < maxRange )
{
// Only players we can see
if ( aplayer.FastTrace( aplayer.Location, gun.Location ))
{
//only shoot at players who aren't the safetarget.
//we alreayd know prevtarget not valid.
if ((aplayer != safeTarget) && (aplayer != prevTarget))
{
if (! ( (TeamDMGame(aplayer.DXGame) != None) && (safeTarget != None) && (TeamDMGame(aplayer.DXGame).ArePlayersAllied( DeusExPlayer(safeTarget),aplayer)) ) )
{
// If the player's RadarTrans aug is off, the turret can see him
if ((aplayer.AugmentationSystem.GetAugLevelValue(class'AugRadarTrans') == -1.0) && !aplayer.bHidden )
{
curTarget = apawn;
PlaySound(Sound'TurretLocked', SLOT_Interact, 1.0,, maxRange );
break;
}
}
}
}
}
}
apawn = apawn.nextPawn;
}
return curtarget;

AlarmHeard (Name event, EAIEventState state, XAIParams params)


if (state == EAISTATE_Begin)
{
if (!bActive)
{
bPreAlarmActiveState = bActive;
bActive = True;
}
}
else if (state == EAISTATE_End)
{
if (bActive)
bActive = bPreAlarmActiveState;
}

Destroyed


if (gun != None)
{
gun.Destroy();
gun = None;
}

Super.Destroyed();

Fire


local Vector HitLocation, HitNormal, StartTrace, EndTrace, X, Y, Z;
local Rotator rot;
local Actor hit;
local ShellCasing shell;
local Spark spark;
local Pawn attacker;


if (!gun.IsAnimating())
gun.LoopAnim('Fire');

// CNN - give turrets infinite ammo
// if (ammoAmount > 0)
// {
// ammoAmount--;
GetAxes(gun.Rotation, X, Y, Z);
StartTrace = gun.Location;
EndTrace = StartTrace + gunAccuracy * (FRand()-0.5)*Y*1000 + gunAccuracy * (FRand()-0.5)*Z*1000 ;
EndTrace += 10000 * X;
hit = Trace(HitLocation, HitNormal, EndTrace, StartTrace, True);

// spawn some effects
if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
{
shell = None;
}
else
{
shell = Spawn(class'ShellCasing',,, gun.Location);
}
if (shell != None)
shell.Velocity = Vector(gun.Rotation - rot(0,16384,0)) * 100 + VRand() * 30;

MakeNoise(1.0);
PlaySound(sound'PistolFire', SLOT_None);
AISendEvent('LoudNoise', EAITYPE_Audio);

// muzzle flash
gun.LightType = LT_Steady;
gun.MultiSkins[2] = Texture'FlatFXTex34';
SetTimer(0.1, False);

// randomly draw a tracer
if (FRand() < 0.5)
{
if (VSize(HitLocation - StartTrace) > 250)
{
rot = Rotator(EndTrace - StartTrace);
Spawn(class'Tracer',,, StartTrace + 96 * Vector(rot), rot);
}
}

if (hit != None)
{
if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
{
spark = None;
}
else
{
// spawn a little spark and make a ricochet sound if we hit something
spark = spawn(class'Spark',,,HitLocation+HitNormal, Rotator(HitNormal));
}

if (spark != None)
{
spark.DrawScale = 0.05;
PlayHitSound(spark, hit);
}

attacker = None;
if ((curTarget == hit) && !curTarget.IsA('PlayerPawn'))
attacker = GetPlayerPawn();
if (Level.NetMode != NM_Standalone)
attacker = safetarget;
if ( hit.IsA('DeusExPlayer') && ( Level.NetMode != NM_Standalone ))
DeusExPlayer(hit).myTurretKiller = Self;
hit.TakeDamage(gunDamage, attacker, HitLocation, 1000.0*X, 'AutoShot');

if (hit.IsA('Pawn') && !hit.IsA('Robot'))
SpawnBlood(HitLocation, HitNormal);
else if ((hit == Level) || hit.IsA('Mover'))
SpawnEffects(HitLocation, HitNormal, hit);
}
//

GetWallMaterial (vector HitLocation, vector HitNormal) -> name


local vector EndTrace, StartTrace;
local actor newtarget;
local int texFlags;
local name texName, texGroup;


StartTrace = HitLocation + HitNormal*16; // make sure we start far enough out
EndTrace = HitLocation - HitNormal;

foreach TraceTexture(class'Actor', newtarget, texName, texGroup, texFlags, StartTrace, HitNormal, EndTrace)
if ((newtarget == Level) || newtarget.IsA('Mover'))
break;

return texGroup;

PlayHitSound (actor destActor, Actor hitActor)


local float rnd;
local sound snd;


rnd = FRand();

if (rnd < 0.25)
snd = sound'Ricochet1';
else if (rnd < 0.5)
snd = sound'Ricochet2';
else if (rnd < 0.75)
snd = sound'Ricochet3';
else
snd = sound'Ricochet4';

// play a different ricochet sound if the object isn't damaged by normal bullets
if (hitActor != None)
{
if (hitActor.IsA('DeusExDecoration') && (DeusExDecoration(hitActor).minDamageThreshold > 10))
snd = sound'ArmorRicochet';
else if (hitActor.IsA('Robot'))
snd = sound'ArmorRicochet';
}

if (destActor != None)
destActor.PlaySound(snd, SLOT_None,,, 1024, 1.1 - 0.2*FRand());

PostBeginPlay


safeTarget = None;
prevTarget = None;
TargetRefreshTime = 0;
Super.PostBeginPlay();

PreBeginPlay


local Vector v1, v2;
local class gunClass;
local Rotator rot;


Super.PreBeginPlay();

if (IsA('AutoTurretSmall'))
gunClass = class'AutoTurretGunSmall';
else
gunClass = class'AutoTurretGun';

rot = Rotation;
rot.Pitch = 0;
rot.Roll = 0;
origRot = rot;
gun = Spawn(gunClass, Self,, Location, rot);
if (gun != None)
{
v1.X = 0;
v1.Y = 0;
v1.Z = CollisionHeight + gun.Default.CollisionHeight;
v2 = v1 >> Rotation;
v2 += Location;
gun.SetLocation(v2);
gun.SetBase(Self);
}

// set up the alarm listeners
AISetEventCallback('Alarm', 'AlarmHeard');

if ( Level.NetMode != NM_Standalone )
{
maxRange = mpTurretRange;
gunDamage = mpTurretDamage;
bInvincible = True;
bDisabled = !bActive;
}

SetSafeTarget (Pawn newSafeTarget)


local DeusExPlayer aplayer;


bSwitching = True;
SwitchTime = Level.Timeseconds + 2.5;
beepTime = 0.0;
safeTarget = newSafeTarget;
//savedTarget = newSafeTarget;

SpawnBlood (Vector HitLocation, Vector HitNormal)


local rotator rot;


rot = Rotator(Location - HitLocation);
rot.Pitch = 0;
rot.Roll = 0;

if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
return;

spawn(class'BloodSpurt',,,HitLocation+HitNormal, rot);
spawn(class'BloodDrop',,,HitLocation+HitNormal);
if (FRand() < 0.5)
spawn(class'BloodDrop',,,HitLocation+HitNormal);

SpawnEffects (Vector HitLocation, Vector HitNormal, Actor Other)


local SmokeTrail puff;
local int i;
local BulletHole hole;
local Rotator rot;


if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
return;

if (FRand() < 0.5)
{
puff = spawn(class'SmokeTrail',,,HitLocation+HitNormal, Rotator(HitNormal));
if (puff != None)
{
puff.DrawScale *= 0.3;
puff.OrigScale = puff.DrawScale;
puff.LifeSpan = 0.25;
puff.OrigLifeSpan = puff.LifeSpan;
}
}

if (!Other.IsA('BreakableGlass'))
for (i=0; i<2; i++)
if (FRand() < 0.8)
spawn(class'Rockchip',,,HitLocation+HitNormal);

hole = spawn(class'BulletHole', Other,, HitLocation, Rotator(HitNormal));

// should we crack glass?
if (GetWallMaterial(HitLocation, HitNormal) == 'Glass')
{
if (FRand() < 0.5)
hole.Texture = Texture'FlatFXTex29';
else
hole.Texture = Texture'FlatFXTex30';

hole.DrawScale = 0.1;
hole.ReattachDecal();
}

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


local float mindmg;


if (DamageType == 'EMP')
{
// duration is based on daamge
// 10 seconds min to 30 seconds max
mindmg = Max(Damage - 15.0, 0.0);
confusionDuration += mindmg / 5.0;
confusionDuration = FClamp(confusionDuration,10.0,30.0);
confusionTimer = 0;
if (!bConfused)
{
bConfused = True;
PlaySound(sound'EMPZap', SLOT_None,,, 1280);
}
return;
}
if (( Level.NetMode != NM_Standalone ) && (EventInstigator.IsA('DeusExPlayer')))
DeusExPlayer(EventInstigator).ServerConditionalNotifyMsg( DeusExPlayer(EventInstigator).MPMSG_TurretInv );

Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);

Tick (float deltaTime)


local Pawn pawn;
local ScriptedPawn sp;
local DeusExDecoration deco;
local float near;
local Rotator destRot;
local bool bSwitched;


Super.Tick(deltaTime);

bSwitched = False;

if ( bSwitching )
{
UpdateSwitch();
return;
}

// Make sure everything is valid and account for when players leave or switch teams
if ( !bDisabled && (Level.NetMode != NM_Standalone) )
{
if ( safeTarget == None )
{
bDisabled = True;
bComputerReset = False;
}
else
{
if ( DeusExPlayer(safeTarget) != None )
{
if ((TeamDMGame(DeusExPlayer(safeTarget).DXGame) != None) && (DeusExPlayer(safeTarget).PlayerReplicationInfo.team != team))
bSwitched = True;
else if ((DeathMatchGame(DeusExPlayer(safeTarget).DXGame) != None ) && (DeusExPlayer(safeTarget).PlayerReplicationInfo.PlayerID != team))
bSwitched = True;

if ( bSwitched )
{
bDisabled = True;
safeTarget = None;
bComputerReset = False;
}
}
}
}
if ( bDisabled && (Level.NetMode != NM_Standalone) )
{
team = -1;
safeTarget = None;
if ( !bComputerReset )
{
gun.ResetComputerAlignment();
bComputerReset = True;
}
}

if (bConfused)
{
confusionTimer += deltaTime;

// pick a random facing
if (confusionTimer % 0.25 > 0.2)
{
gun.DesiredRotation.Pitch = origRot.Pitch + (pitchLimit / 2 - Rand(pitchLimit));
gun.DesiredRotation.Yaw = Rand(65535);
}
if (confusionTimer > confusionDuration)
{
bConfused = False;
confusionTimer = 0;
confusionDuration = Default.confusionDuration;
}
}

if (bActive && !bDisabled)
{
curTarget = None;

if ( !bConfused )
{
// if we've been EMP'ed, act confused
if ((Level.NetMode != NM_Standalone) && (Role == ROLE_Authority))
{
// DEUS_EX AMSD If in multiplayer, get the multiplayer target.

if (TargetRefreshTime < 0)
TargetRefreshTime = 0;

TargetRefreshTime = TargetRefreshTime + deltaTime;

if (TargetRefreshTime >= 0.3)
{
TargetRefreshTime = 0;
curTarget = AcquireMultiplayerTarget();
if (( curTarget != prevTarget ) && ( curTarget == None ))
PlaySound(Sound'TurretUnlocked', SLOT_Interact, 1.0,, maxRange );
prevtarget = curtarget;
}
else
{
curTarget = prevtarget;
}
}
else
{
//
// Logic table for turrets
//
// bTrackPlayersOnly bTrackPawnsOnly Should Attack
// T X Allies
// F T Enemies
// F F Everything
//

// Attack allies and neutrals
if (bTrackPlayersOnly || (!bTrackPlayersOnly && !bTrackPawnsOnly))
{
foreach gun.VisibleActors(class'Pawn', pawn, maxRange, gun.Location)
{
if (pawn.bDetectable && !pawn.bIgnore)
{
if (pawn.IsA('DeusExPlayer'))
{
// If the player's RadarTrans aug is off, the turret can see him
if (DeusExPlayer(pawn).AugmentationSystem.GetAugLevelValue(class'AugRadarTrans') == -1.0)
{
curTarget = pawn;
break;
}
}
else if (pawn.IsA('ScriptedPawn') && (ScriptedPawn(pawn).GetPawnAllianceType(GetPlayerPawn()) != ALLIANCE_Hostile))
{
curTarget = pawn;
break;
}
}
}
}

if (!bTrackPlayersOnly)
{
// Attack everything
if (!bTrackPawnsOnly)
{
foreach gun.VisibleActors(class'DeusExDecoration', deco, maxRange, gun.Location)
{
if (!deco.IsA('ElectronicDevices') && !deco.IsA('AutoTurret') &&
!deco.bInvincible && deco.bDetectable && !deco.bIgnore)
{
curTarget = deco;
break;
}
}
}

// Attack enemies
foreach gun.VisibleActors(class'ScriptedPawn', sp, maxRange, gun.Location)
{
if (sp.bDetectable && !sp.bIgnore && (sp.GetPawnAllianceType(GetPlayerPawn()) == ALLIANCE_Hostile))
{
curTarget = sp;
break;
}
}
}
}

// if we have a target, rotate to face it
if (curTarget != None)
{
destRot = Rotator(curTarget.Location - gun.Location);
gun.DesiredRotation = destRot;
near = pitchLimit / 2;
gun.DesiredRotation.Pitch = FClamp(gun.DesiredRotation.Pitch, origRot.Pitch - near, origRot.Pitch + near);
}
else
gun.DesiredRotation = origRot;
}
}
else
{
if ( !bConfused )
gun.DesiredRotation = origRot;
}

near = (Abs(gun.Rotation.Pitch - gun.DesiredRotation.Pitch)) % 65536;
near += (Abs(gun.Rotation.Yaw - gun.DesiredRotation.Yaw)) % 65536;

if (bActive && !bDisabled)
{
// play an alert sound and light up
if ((curTarget != None) && (curTarget != LastTarget))
PlaySound(Sound'Beep6',,,, 1280);

// if we're aiming close enough to our target
if (curTarget != None)
{
gun.MultiSkins[1] = Texture'RedLightTex';
if ((near < 4096) && (((Abs(gun.Rotation.Pitch - destRot.Pitch)) % 65536) < 8192))
{
if (fireTimer > fireRate)
{
Fire();
fireTimer = 0;
}
}
}
else
{
if (gun.IsAnimating())
gun.PlayAnim('Still', 10.0, 0.001);

if (bConfused)
gun.MultiSkins[1] = Texture'YellowLightTex';
else
gun.MultiSkins[1] = Texture'GreenLightTex';
}

fireTimer += deltaTime;
LastTarget = curTarget;
}
else
{
if (gun.IsAnimating())
gun.PlayAnim('Still', 10.0, 0.001);
gun.MultiSkins[1] = None;
}

// make noise if we're still moving
if (near > 64)
{
gun.AmbientSound = Sound'AutoTurretMove';
if (bConfused)
gun.SoundPitch = 128;
else
gun.SoundPitch = 64;
}
else
gun.AmbientSound = None;

Timer


gun.LightType = LT_None;
gun.MultiSkins[2] = None;

Trigger (Actor Other, Pawn Instigator)


if (bConfused || bDisabled)
return;

if (!bActive)
{
bActive = True;
AmbientSound = Default.AmbientSound;
}

Super.Trigger(Other, Instigator);

UnTrigger (Actor Other, Pawn Instigator)


if (bConfused || bDisabled)
return;

if (bActive)
{
bActive = False;
AmbientSound = None;
}

Super.UnTrigger(Other, Instigator);

UpdateSwitch


if ( Level.Timeseconds > SwitchTime )
{
bSwitching = False;
//safeTarget = savedTarget;
SwitchTime = 0;
beepTime = 0;
}
else
{
if ( Level.Timeseconds > beepTime )
{
PlaySound(Sound'TurretSwitch', SLOT_Interact, 1.0,, maxRange );
beepTime = Level.Timeseconds + 0.75;
}
}




AutoTurretGun.uc (extends HackableDevices)

var int team;
var String titleString;
var float updateTime;
Team=-1
hackStrength=0.500000
HitPoints=50
minDamageThreshold=50
bInvincible=False
FragType=Class'DeusEx.MetalFragment'
ItemName="Autonomous Defense Turret"
Physics=PHYS_Rotating
Mesh=LodMesh'DeusExDeco.AutoTurretGun'
PrePivot=(Z=-8.770000)
SoundRadius=24
CollisionRadius=22.500000
CollisionHeight=9.100000
LightEffect=LE_NonIncidence
LightBrightness=255
LightHue=28
LightSaturation=160
LightRadius=2
bRotateToDesired=True
Mass=50.000000
Buoyancy=10.000000
RotationRate=(Pitch=16384,Yaw=16384)
bVisionImportant=True

Destroyed


local AutoTurret turret;


turret = AutoTurret(Owner);
if (turret != None)
{
turret.gun = None;
turret.Destroy();
SetOwner(None);
}
Super.Destroyed();

HackAction (Actor Hacker, bool bHacked)


local ComputerSecurity CompOwner;
local ComputerSecurity TempComp;
local AutoTurret turret;
local SecurityCamera Camera;
local name CameraTag;
local int ViewIndex;


Super.HackAction(Hacker, bHacked);

turret = AutoTurret(Owner);
if (bHacked && (turret != None))
{
if (Level.NetMode == NM_Standalone)
{
if (!turret.bDisabled)
{
turret.UnTrigger(Hacker, Pawn(Hacker));
turret.bDisabled = True;
}
else
{
turret.bDisabled = False;
turret.Trigger(Hacker, Pawn(Hacker));
}
}
else
{
//DEUS_EX AMSD Reset the hackstrength afterwards
if (hackStrength == 0.0)
hackStrength = 0.6;
turret.bDisabled = True;
turret.Trigger(Hacker,Pawn(Hacker));
//Find the associated computer.
foreach AllActors(class'ComputerSecurity',TempComp)
{
for (ViewIndex = 0; ViewIndex < ArrayCount(TempComp.Views); ViewIndex++)
{
if (TempComp.Views[ViewIndex].turretTag == Turret.Tag)
{
CompOwner = TempComp;
//find associated turret
cameratag = TempComp.Views[ViewIndex].cameratag;
if (cameratag != '')
{
foreach AllActors(class'Securitycamera', camera, cameraTag)
{
break;
}
}
}
}
}

if (CompOwner != None)
{
if ( (Hacker.IsA('DeusExPlayer')) && (Camera.bActive))
{
Camera.HackStrength = 0.6;
if (Camera.bActive)
Camera.UnTrigger(Hacker, Pawn(Hacker));
}
}
}
}

PostBeginPlay


local AutoTurret turret;


Super.PostBeginPlay();

turret = AutoTurret(Owner);

if (( Level.NetMode != NM_Standalone ) && ( turret != None ))
{
team = turret.team;
titleString = turret.titleString;
}

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
bInvincible = True;
hackStrength = 0.6;
}

ResetComputerAlignment


local AutoTurret turret;
local ComputerSecurity TempComp;
local int ViewIndex;


turret = AutoTurret(Owner);

if (( Level.NetMode != NM_Standalone ) && ( turret != None ))
{
//Find the associated computer
foreach AllActors(class'ComputerSecurity',TempComp)
{
for (ViewIndex = 0; ViewIndex < ArrayCount(TempComp.Views); ViewIndex++)
{
if (TempComp.Views[ViewIndex].turretTag == turret.Tag)
{
TempComp.Team = -1;
}
}
}
}

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


if (( Level.NetMode != NM_Standalone ) && (EventInstigator.IsA('DeusExPlayer')))
DeusExPlayer(EventInstigator).ServerConditionalNotifyMsg( DeusExPlayer(EventInstigator).MPMSG_TurretInv );

Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);

Tick (float deltaTime)


local AutoTurret turret;


Super.Tick(deltaTime);

// As a client, it was possible for the turret to become irrelevant to you while the gun remained relevant
if ((Level.NetMode != NM_Standalone) && (updateTime < Level.Timeseconds))
{
updateTime = Level.Timeseconds + 2.0;
turret = AutoTurret(Owner);
if ( turret != None )
{
if ( team != turret.team )
team = turret.team;
if (!( titleString ~= turret.titleString ))
titleString = turret.titleString;
}
}




AutoTurretGunSmall.uc (extends AutoTurretGun)

DrawScale=0.500000
PrePivot=(Z=-4.380000)
CollisionRadius=11.250000
CollisionHeight=4.550000



AutoTurretSmall.uc (extends AutoTurret)

DrawScale=0.500000
CollisionRadius=7.000000
CollisionHeight=10.100000



BallisticArmor.uc (extends ChargedPickup)

skillNeeded=Class'DeusEx.SkillEnviro'
LoopSound=Sound'DeusExSounds.Pickup.SuitLoop'
ChargedIcon=Texture'DeusExUI.Icons.ChargedIconArmorBallistic'
ExpireMessage="Ballistic Armor power supply used up"
ItemName="Ballistic Armor"
ItemArticle="some"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.BallisticArmor'
PickupViewMesh=LodMesh'DeusExItems.BallisticArmor'
ThirdPersonMesh=LodMesh'DeusExItems.BallisticArmor'
Charge=1000
LandSound=Sound'DeusExSounds.Generic.PaperHit2'
Icon=Texture'DeusExUI.Icons.BeltIconArmorBallistic'
largeIcon=Texture'DeusExUI.Icons.LargeIconArmorBallistic'
largeIconWidth=34
largeIconHeight=49
Description="Ballistic armor is manufactured from electrically sensitive polymer sheets that intrinsically react to the violent impact of a bullet or an explosion by 'stiffening' in response and absorbing the majority of the damage. These polymer sheets must be charged before use; after the charge has dissipated they lose their reflexive properties and should be discarded."
beltDescription="BAL ARMOR"
Mesh=LodMesh'DeusExItems.BallisticArmor'
CollisionRadius=11.500000
CollisionHeight=13.810000
Mass=40.000000
Buoyancy=30.000000



BarkManager.uc (extends Actor)

var Scriptedpawn barkPawn;
var Name conName;
var Float barkDuration;
var Float barkTimer;
var EBarkModes barkMode;
var Int barkPriority;
var Int playingSoundId;
var BarkInfo currentBarks[8];
var BarkInfo recentBarks[32];
var Float perCharDelay;
var Float minimumTextPause;
var Float barkModeSpacer;
var Int maxCurrentBarks;
var Float maxBarkExpirationTimer;
var Int maxAllowableRadius;
var Int maxHiddenHeightDifference;
var Int maxVisibleHeightDifference;
var transient DeusExRootWindow rootWindow;
perCharDelay=0.100000
minimumTextPause=3.000000
barkModeSpacer=1.000000
maxCurrentBarks=4
maxBarkExpirationTimer=30.000000
maxAllowableRadius=1000
maxHiddenHeightDifference=100
maxVisibleHeightDifference=500
bHidden=True
bTravel=True

BuildBarkName (ScriptedPawn newBarkPawn, EBarkModes newBarkMode) -> Name


local String conStringName;


SetRootWindow();

// Use the "BarkBindName" unless it's blank, in which case
// we'll fall back to the "BindName" used for normal
// conversations

if (newBarkPawn.BarkBindName == "")
conStringName = newBarkPawn.BindName $ "_Bark";
else
conStringName = newBarkPawn.BarkBindName $ "_Bark";

switch(newBarkMode)
{
case BM_Idle:
conStringName = conStringName $ "Idle";
break;

case BM_CriticalDamage:
conStringName = conStringName $ "CriticalDamage";
break;

case BM_AreaSecure:
conStringName = conStringName $ "AreaSecure";
break;

case BM_TargetAcquired:
conStringName = conStringName $ "TargetAcquired";
break;

case BM_TargetLost:
conStringName = conStringName $ "TargetLost";
break;

case BM_GoingForAlarm:
conStringName = conStringName $ "GoingForAlarm";
break;

case BM_OutOfAmmo:
conStringName = conStringName $ "OutOfAmmo";
break;

case BM_Scanning:
conStringName = conStringName $ "Scanning";
break;

case BM_Futz:
conStringName = conStringName $ "Futz";
break;

case BM_OnFire:
conStringName = conStringName $ "OnFire";
break;

case BM_TearGas:
conStringName = conStringName $ "TearGas";
break;

case BM_Gore:
conStringName = conStringName $ "Gore";
break;

case BM_Surprise:
conStringName = conStringName $ "Surprise";
break;

case BM_PreAttackSearching:
conStringName = conStringName $ "PreAttackSearching";
break;

case BM_PreAttackSighting:
conStringName = conStringName $ "PreAttackSighting";
break;

case BM_PostAttackSearching:
conStringName = conStringName $ "PostAttackSearching";
break;

case BM_SearchGiveUp:
conStringName = conStringName $ "SearchGiveUp";
break;

case BM_AllianceHostile:
conStringName = conStringName $ "AllianceHostile";
break;

case BM_AllianceFriendly:
conStringName = conStringName $ "AllianceFriendly";
break;
}

// Take the string name and convert it to a name
return rootWindow.StringToName(conStringName);

CheckHeightDifference (ScriptedPawn invokePawn) -> bool


// If the ScriptedPawn can see the player, than allow a taller height difference.
// Otherwise make it pretty small (this is done especially to prevent the
// bark from playing through ceilings).

if (DeusExPlayer(owner).FastTrace(invokePawn.Location))
return DeusExPlayer(owner).CheckConversationHeightDifference(invokePawn, maxVisibleHeightDifference);
else
return DeusExPlayer(owner).CheckConversationHeightDifference(invokePawn, maxHiddenHeightDifference);


CheckRadius (ScriptedPawn invokePawn) -> bool


local Int invokeRadius;
local Int dist;


dist = VSize(DeusExPlayer(owner).Location - invokePawn.Location);

return (dist <= maxAllowableRadius);

GetAvailableRecentBarkSlot -> int


local int barkIndex;
local int emptyBarkIndex;
local int oldestBarkIndex;
local float expireTimer;


emptyBarkIndex = -1;
oldestBarkIndex = -1;
expireTimer = maxBarkExpirationTimer;

for (barkIndex=0; barkIndex < arrayCount(recentBarks); barkIndex++)
{
if (recentBarks[barkIndex].barkPawn == None)
{
emptyBarkIndex = barkIndex;
break;
}
else if ((recentBarks[barkIndex].barkDuration - recentBarks[barkIndex].barkTimer) < expireTimer)
{
expireTimer = recentBarks[barkIndex].barkDuration - recentBarks[barkIndex].barkTimer;
oldestBarkIndex = barkIndex;
}
}

// If we found an empty slot, use it. Otherwise use the bark that will
// expire first

if (emptyBarkIndex == -1)
emptyBarkIndex = oldestBarkIndex;

return emptyBarkIndex;

GetBarkPriority (EBarkModes barkMode) -> int


local int barkPriority;


switch(barkMode)
{
case BM_Idle:
barkPriority = 1;
break;

case BM_CriticalDamage:
barkPriority = 5;
break;

case BM_AreaSecure:
barkPriority = 2;
break;

case BM_TargetAcquired:
barkPriority = 3;
break;

case BM_TargetLost:
barkPriority = 2;
break;

case BM_GoingForAlarm:
barkPriority = 4;
break;

case BM_OutOfAmmo:
barkPriority = 2;
break;

case BM_Scanning:
barkPriority = 2;
break;

case BM_Futz:
barkPriority = 3;
break;

case BM_OnFire:
barkPriority = 5;
break;

case BM_TearGas:
barkPriority = 4;
break;

case BM_Gore:
barkPriority = 3;
break;

case BM_Surprise:
barkPriority = 5;
break;

case BM_PreAttackSearching:
barkPriority = 4;
break;

case BM_PreAttackSighting:
barkPriority = 5;
break;

case BM_PostAttackSearching:
barkPriority = 4;
break;

case BM_SearchGiveUp:
barkPriority = 2;
break;

case BM_AllianceHostile:
barkPriority = 3;
break;

case BM_AllianceFriendly:
barkPriority = 2;
break;
}

return barkPriority;

GetBarkTimeout (EBarkModes barkMode) -> Float


local Float barkTimeout;


switch(barkMode)
{
case BM_Futz:
barkTimeout = 1.0;
break;

default:
barkTimeout = 10.0;
break;
}

return barkTimeout;

HasBarkTypePlayedRecently (ScriptedPawn newBarkPawn, EBarkModes newBarkMode) -> bool


local int barkIndex;


for (barkIndex=0; barkIndex < arrayCount(recentBarks); barkIndex++)
{
if ((recentBarks[barkIndex].barkPawn == newBarkPawn) && (recentBarks[barkIndex].barkMode == newBarkMode))
{
return True;
}
}

return False;

IsBarkPlaying (Name conName) -> bool


local int barkIndex;


for (barkIndex=0; barkIndex < maxCurrentBarks; barkIndex++)
{
if (currentBarks[barkIndex].conName == conName)
{
return True;
}
}

return False;

MoveCurrentBarkToRecent (int currentBarkIndex)


local int recentBarkIndex;


recentBarkIndex = GetAvailableRecentBarkSlot();

if (recentBarkIndex != -1)
{
recentBarks[recentBarkIndex].conName = currentBarks[currentBarkIndex].conName;
recentBarks[recentBarkIndex].barkPawn = currentBarks[currentBarkIndex].barkPawn;
recentBarks[recentBarkIndex].barkDuration = GetBarkTimeout(currentBarks[currentBarkIndex].barkMode);
recentBarks[recentBarkIndex].barkTimer = 0.0;
recentBarks[recentBarkIndex].barkMode = currentBarks[currentBarkIndex].barkMode;
recentBarks[recentBarkIndex].barkPriority = currentBarks[currentBarkIndex].barkPriority;
}

RemoveCurrentBark (int barkIndex)


// First add to the RecentBarkList
MoveCurrentBarkToRecent(barkIndex);

currentBarks[barkIndex].barkPawn = None;
currentBarks[barkIndex].conName = '';
currentBarks[barkIndex].barkDuration = 0.0;
currentBarks[barkIndex].barkTimer = 0.0;
currentBarks[barkIndex].barkMode = BM_Idle;
currentBarks[barkIndex].barkPriority = 0;
currentBarks[barkIndex].playingSoundID = 0;

RemoveRecentBark (int barkIndex)


recentBarks[barkIndex].conName = '';
recentBarks[barkIndex].barkPawn = None;
recentBarks[barkIndex].barkDuration = 0.0;
recentBarks[barkIndex].barkTimer = 0.0;
recentBarks[barkIndex].barkMode = BM_Idle;
recentBarks[barkIndex].barkPriority = 0;

ScriptedPawnDied (ScriptedPawn deadPawn)


local int barkIndex;
local DeusExPlayer player;


// Loop through our active barks and see if one of them is
// owned by the dead dude.

for (barkIndex=0; barkIndex < maxCurrentBarks; barkIndex++)
{
if (currentBarks[barkIndex].barkPawn == deadPawn)
{
player = DeusExPlayer(GetPlayerPawn());

// Stop the sound and remove the bark
if (player != None)
{
player.StopSound(currentBarks[barkIndex].playingSoundID);
RemoveCurrentBark(barkIndex);
}
}
}

SetRootWindow


local DeusExPlayer player;


if (rootWindow == None)
{
player = DeusExPlayer(GetPlayerPawn());

if (player != None)
rootWindow = DeusExRootWindow(player.RootWindow);
}

StartBark (DeusExRootWindow newRoot, ScriptedPawn newBarkPawn, EBarkModes newBarkMode) -> bool


local Name conName;
local Conversation con;
local int barkIndex;
local Float barkDuration;
local bool bBarkStarted;
local ConPlayBark conPlayBark;
local String conSpeechString;
local ConSpeech conSpeech;
local Sound speechAudio;
local bool bHaveSpeechAudio;
local int playingSoundID;


bBarkStarted = False;

// Store away the root window
rootWindow = newRoot;

// Don't even go any further if the actor is too far away
// from the player
if (!CheckRadius(newBarkPawn))
return False;

// Now check the height difference
if (!CheckHeightDifference(newBarkPawn))
return False;

// First attempt to find this conversation
conName = BuildBarkName(newBarkPawn, newBarkMode);

// Okay, we have the name of the bark, now attempt to find a
// conversation based on this name.
con = ConListItem(newBarkPawn.conListItems).FindConversationByName(conName);

if (con != None)
{
barkIndex = GetAvailableCurrentBarkSlot(newBarkPawn, newBarkMode);

// Abort if we don't get a valid barkIndex back
if (barkIndex == -1)
return False;

// Make sure that another NPC isn't already playing this
// particular bark.
if (IsBarkPlaying(conName))
return False;

// Now check to see if the same kind of bark has already been
// played by this NPC within a certain range of time.
if (HasBarkTypePlayedRecently(newBarkPawn, newBarkMode))
return False;

// Summon a 'ConPlayBark' object, which will process
// the conversation and play the bark.
// Found an active conversation, so start it
conPlayBark = Spawn(class'ConPlayBark');
conPlayBark.SetConversation(con);

conSpeech = conPlayBark.GetBarkSpeech();

bHaveSpeechAudio = False;

// Nuke conPlayBark
conPlayBark.Destroy();

// Play the audio (if we have audio)
if ((conSpeech != None) && (conSpeech.soundID != -1))
{
speechAudio = con.GetSpeechAudio(conSpeech.soundID);

if (speechAudio != None)
{
bHaveSpeechAudio = True;
playingSoundID = newBarkPawn.PlaySound(speechAudio, SLOT_Talk,,,1024.0);
barkDuration = con.GetSpeechLength(conSpeech.soundID);
}
}

// If we don't have any audio, then calculate the timer based on the
// length of the speech text.

if ((conSpeech != None) && (!bHaveSpeechAudio))
barkDuration = FMax(Len(conSpeech.speech) * perCharDelay, minimumTextPause);

// Show the speech if Subtitles are on
if ((DeusExPlayer(owner) != None) && (DeusExPlayer(owner).bSubtitles) && (conSpeech != None) && (conSpeech.speech != ""))
{
rootWindow.hud.barkDisplay.AddBark(conSpeech.speech, barkDuration, newBarkPawn);
}

// Keep track fo the bark
SetBarkInfo(barkIndex, conName, newBarkPawn, newBarkMode, barkDuration, playingSoundID);

bBarkStarted = True;
}

return bBarkStarted;

Tick (float deltaTime)


Super.Tick(deltaTime);

UpdateCurrentBarks(deltaTime);
UpdateRecentBarks(deltaTime);

UpdateCurrentBarks (Float deltaTime)


local int barkIndex;


// DEUS_EX AMSD In multiplayer, for now, kill barks.
if (Level.NetMode != NM_Standalone)
return;

for (barkIndex=0; barkIndex < maxCurrentBarks; barkIndex++)
{
if (currentBarks[barkIndex].barkPawn != None)
{
currentBarks[barkIndex].barkTimer += deltaTime;

if (currentBarks[barkIndex].barkTimer >= currentBarks[barkIndex].barkDuration)
RemoveCurrentBark(barkIndex);
}
}

UpdateRecentBarks (Float deltaTime)


local int barkIndex;


// DEUS_EX AMSD In multiplayer, for now, kill barks.
if (Level.NetMode != NM_Standalone)
return;

for (barkIndex=0; barkIndex < arrayCount(recentBarks); barkIndex++)
{
if (recentBarks[barkIndex].barkPawn != None)
{
recentBarks[barkIndex].barkTimer += deltaTime;

if (recentBarks[barkIndex].barkTimer >= recentBarks[barkIndex].barkDuration)
RemoveRecentBark(barkIndex);
}
}




Barrel1.uc (extends Containers)

var() ESkinColor SkinColor;
var() bool bPreDamage;
var bool bLeaking;
var float radTimer;
SkinColor=SC_Rusty
HitPoints=30
ItemName="Barrel"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.Barrel1'
CollisionRadius=20.000000
CollisionHeight=29.000000
Mass=80.000000
Buoyancy=90.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Biohazard: Skin = Texture'Barrel1Tex1';
HitPoints = 12;
break;
case SC_Blue: Skin = Texture'Barrel1Tex2'; break;
case SC_Brown: Skin = Texture'Barrel1Tex3'; break;
case SC_Rusty: Skin = Texture'Barrel1Tex4'; break;
case SC_Explosive: Skin = Texture'Barrel1Tex5';
bExplosive = True;
explosionDamage = 400;
explosionRadius = 1000;
HitPoints = 4;
break;
case SC_FlammableLiquid: Skin = Texture'Barrel1Tex6';
bExplosive = True;
HitPoints = 8;
break;
case SC_FlammableSolid: Skin = Texture'Barrel1Tex7';
bExplosive = True;
explosionDamage = 200;
HitPoints = 8;
break;
case SC_Poison: Skin = Texture'Barrel1Tex8';
HitPoints = 12;
break;
case SC_RadioActive: Skin = Texture'Barrel1Tex9';
bInvincible = True;
LightType = LT_Steady;
LightRadius = 8;
LightBrightness = 128;
LightHue = 64;
LightSaturation = 96;
AmbientSound = sound'GeigerLoop';
SoundRadius = 8;
SoundVolume = 255;
bUnlit = True;
ScaleGlow = 0.4;
break;
case SC_Wood: Skin = Texture'Barrel1Tex10'; break;
case SC_Yellow: Skin = Texture'Barrel1Tex11'; break;
}

PostPostBeginPlay


Super.PostPostBeginPlay();

if (bPreDamage)
TakeDamage(1, None, Location, vect(0,0,0), 'shot');

TakeDamage (int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)


local ParticleGenerator gen;
local ProjectileGenerator projgen;
local float size;
local Vector loc;
local Actor A;
local SmokeTrail puff;
local PoisonGas gas;
local int i;


if (bStatic || bInvincible)
return;

if ((damageType == 'TearGas') || (damageType == 'PoisonGas') || (damageType == 'HalonGas'))
return;

if ((damageType == 'EMP') || (damageType == 'NanoVirus') || (damageType == 'Radiation'))
return;

if (Damage >= minDamageThreshold)
{
if (HitPoints-Damage <= 0)
{
foreach BasedActors(class'Actor', A)
{
if (A.IsA('ParticleGenerator'))
ParticleGenerator(A).DelayedDestroy();
else if (A.IsA('ProjectileGenerator'))
A.Destroy();
}

// spread out a gas cloud
for (i=0; i {
loc = Location;
loc.X += FRand() * explosionRadius - explosionRadius * 0.5;
loc.Y += FRand() * explosionRadius - explosionRadius * 0.5;

if ((SkinColor == SC_Explosive) || (SkinColor == SC_FlammableLiquid) ||
(SkinColor == SC_FlammableSolid))
{
puff = spawn(class'SmokeTrail',,, loc);
if (puff != None)
{
puff.RiseRate = FRand() + 1;
puff.DrawScale = FRand() + 3.0;
puff.OrigScale = puff.DrawScale;
puff.LifeSpan = FRand() * 10 + 10;
puff.OrigLifeSpan = puff.LifeSpan;
}
}
else if ((SkinColor == SC_Biohazard) || (SkinColor == SC_Poison))
{
loc.Z += 32;
gas = spawn(class'PoisonGas', None,, loc);
if (gas != None)
{
gas.Velocity = vect(0,0,0);
gas.Acceleration = vect(0,0,0);
gas.DrawScale = FRand() * 0.5 + 2.0;
gas.LifeSpan = FRand() * 10 + 30;
gas.bFloating = True;
gas.Instigator = Instigator;
}
}
}
}

if (!bLeaking)
{
// spawn a projectile generator for toxic gas leaks
if (((SkinColor == SC_Biohazard) || (SkinColor == SC_Poison)) &&
(HitPoints-Damage > 0))
{
size = CollisionRadius / 54.0;
size = FClamp(size, 0.1, 4.0);

loc.X = 0;
loc.Y = 0;
loc.Z = CollisionHeight;
loc += Location;

projgen = Spawn(class'ProjectileGenerator', Self,, loc, rot(16384,0,0));
if (projgen != None)
{
bLeaking = True;
projgen.ProjectileClass = class'PoisonGas';
projgen.ProjectileLifeSpan = 3.0;
projgen.frequency = 0.9;
projgen.checkTime = 0.5;
projgen.ejectSpeed = 50.0;
projgen.bRandomEject = True;
projgen.SetBase(Self);
}

// play a hissing sound
if (AmbientSound == None)
{
AmbientSound = Sound'SteamVent2';
SoundRadius = 64 * size;
SoundVolume = 192;
}
}

// spawn a smoke generator if a flammable solid barrel is damaged
if (((SkinColor == SC_Explosive) || (SkinColor == SC_FlammableLiquid) ||
(SkinColor == SC_FlammableSolid)) && (HitPoints-Damage > 0))
{
size = CollisionRadius / 54.0;
size = FClamp(size, 0.1, 4.0);

loc.X = 0;
loc.Y = 0;
loc.Z = CollisionHeight;
loc += Location;

gen = Spawn(class'ParticleGenerator', Self,, loc, rot(16384,0,0));
if (gen != None)
{
bLeaking = True;
gen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
gen.particleDrawScale = size * 4.0;
gen.frequency = 0.9;
gen.checkTime = 0.1;
gen.riseRate = 90.0;
gen.ejectSpeed = 40.0;
gen.bRandomEject = True;
gen.SetBase(Self);
}

// play a hissing sound
if (AmbientSound == None)
{
AmbientSound = Sound'SteamVent2';
SoundRadius = 64 * size;
SoundVolume = 192;
}
}
}
}

Super.TakeDamage(Damage, instigatedBy, hitlocation, momentum, damageType);

Tick (float deltaTime)


local Actor A;
local Vector offset;


Super.Tick(deltaTime);

if (SkinColor == SC_RadioActive)
{
radTimer += deltaTime;

if (radTimer > 1.0)
{
radTimer = 0;

// check to see if anything has entered our effect radius
foreach VisibleActors(class'Actor', A, 128.0)
if (A != None)
{
// be sure to damage the torso
offset = A.Location;
A.TakeDamage(5, None, offset, vect(0,0,0), 'Radiation');
}
}
}




BarrelAmbrosia.uc (extends Containers)

HitPoints=30
bInvincible=True
bFlammable=False
ItemName="Ambrosia Storage Container"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.BarrelAmbrosia'
CollisionRadius=16.000000
CollisionHeight=28.770000
LightType=LT_Steady
LightEffect=LE_WateryShimmer
LightBrightness=96
LightHue=80
LightRadius=4
Mass=80.000000
Buoyancy=90.000000



BarrelFire.uc (extends Containers)

var float lastDamageTime;
HitPoints=40
bInvincible=True
bFlammable=False
ItemName="Burning Barrel"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.BarrelFire'
ScaleGlow=2.000000
bUnlit=True
SoundRadius=16
SoundVolume=255
AmbientSound=Sound'Ambient.Ambient.FireSmall2'
CollisionRadius=20.000000
CollisionHeight=29.000000
LightType=LT_Steady
LightEffect=LE_FireWaver
LightBrightness=128
LightHue=32
LightSaturation=64
LightRadius=6
Mass=260.000000
Buoyancy=270.000000

Bump (Actor Other)


DamageOther(Other);
Super.Bump(Other);

DamageOther (Actor Other)


if ((Other != None) && !Other.IsA('ScriptedPawn'))
{
// only take damage every second
if (Level.TimeSeconds - lastDamageTime >= 1.0)
{
Other.TakeDamage(5, None, Location, vect(0,0,0), 'Burned');
lastDamageTime = Level.TimeSeconds;
}
}

SupportActor (Actor Other)


DamageOther(Other);
Super.SupportActor(Other);




BarrelVirus.uc (extends Containers)

HitPoints=30
bInvincible=True
bFlammable=False
ItemName="NanoVirus Storage Container"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.BarrelAmbrosia'
MultiSkins(1)=FireTexture'Effects.liquid.Virus_SFX'
CollisionRadius=16.000000
CollisionHeight=28.770000
LightType=LT_Steady
LightEffect=LE_WateryShimmer
LightBrightness=96
LightRadius=4
Mass=80.000000
Buoyancy=90.000000



Bartender.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.BartenderCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.750000
runAnimMult=0.850000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BartenderTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(4)=Texture'DeusExCharacters.Skins.BartenderTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BartenderTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex3'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Bartender"
FamiliarName="Bartender"
UnfamiliarName="Bartender"



BartenderCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BartenderTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(4)=Texture'DeusExCharacters.Skins.BartenderTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BartenderTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex3'



Basket.uc (extends Containers)

FragType=Class'DeusEx.PaperFragment'
ItemName="Wicker Basket"
Mesh=LodMesh'DeusExDeco.Basket'
CollisionRadius=27.530001
CollisionHeight=9.500000
Mass=20.000000
Buoyancy=25.000000



Basketball.uc (extends DeusExDecoration)

bInvincible=True
ItemName="Basketball"
Mesh=LodMesh'DeusExDeco.Basketball'
CollisionRadius=10.000000
CollisionHeight=10.000000
bBounce=True
Mass=8.000000
Buoyancy=10.000000

HitWall (vector HitNormal, actor HitWall)


local float speed;


Velocity = 0.8*((Velocity dot HitNormal) * HitNormal * (-2.0) + Velocity); // Reflect off Wall w/damping
speed = VSize(Velocity);
bFixedRotationDir = True;
RotationRate = RotRand(False);
if ((speed > 0) && (speed < 30) && (HitNormal.Z > 0.7))
{
SetPhysics(PHYS_None, HitWall);
if (Physics == PHYS_None)
bFixedRotationDir = False;
}
else if (speed > 30)
{
PlaySound(sound'BasketballBounce', SLOT_None);
AISendEvent('LoudNoise', EAITYPE_Audio);
}




Beam.uc (extends Light)

bStatic=False
bHidden=False
bNoDelete=False
bMovable=True
LightEffect=LE_NonIncidence
LightBrightness=250
LightHue=32
LightSaturation=142
LightRadius=7
LightPeriod=0

BeginPlay


DrawType = DT_None;
SetTimer(1.0, True);

Timer


MakeNoise(0.3);




BeamTrigger.uc (extends Trigger)

var LaserEmitter emitter;
var() bool bIsOn;
var actor LastHitActor;
var bool bConfused; // used when hit by EMP
var float confusionTimer; // how long until trigger resumes normal operation
var float confusionDuration; // how long does EMP hit last?
var int HitPoints;
var int minDamageThreshold;
var bool bAlreadyTriggered;
bIsOn=True
confusionDuration=10.000000
HitPoints=50
minDamageThreshold=50
TriggerType=TT_AnyProximity
bHidden=False
bDirectional=True
DrawType=DT_Mesh
Mesh=LodMesh'DeusExDeco.LaserEmitter'
CollisionRadius=2.500000
CollisionHeight=2.500000

BeginPlay


Super.BeginPlay();

LastHitActor = None;
emitter = Spawn(class'LaserEmitter');

if (emitter != None)
{
emitter.SetBlueBeam();
emitter.TurnOn();
bIsOn = True;
}
else
bIsOn = False;

Destroyed


if (emitter != None)
{
emitter.Destroy();
emitter = None;
}

Super.Destroyed();

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


local MetalFragment frag;


if (DamageType == 'EMP')
{
confusionTimer = 0;
if (!bConfused)
{
bConfused = True;
PlaySound(sound'EMPZap', SLOT_None,,, 1280);
}
}
else if ((DamageType == 'Exploded') || (DamageType == 'Shot'))
{
if (Damage >= minDamageThreshold)
HitPoints -= Damage;

if (HitPoints <= 0)
{
frag = Spawn(class'MetalFragment', Owner);
if (frag != None)
{
frag.Instigator = EventInstigator;
frag.CalcVelocity(Momentum,0);
frag.DrawScale = 0.5*FRand();
frag.Skin = GetMeshTexture();
}

Destroy();
}
}

Tick (float deltaTime)


local Actor A;
local AdaptiveArmor armor;
local bool bTrigger;


if (emitter != None)
{
// if we've been EMP'ed, act confused
if (bConfused && bIsOn)
{
confusionTimer += deltaTime;

// randomly turn on/off the beam
if (FRand() > 0.95)
emitter.TurnOn();
else
emitter.TurnOff();

if (confusionTimer > confusionDuration)
{
bConfused = False;
confusionTimer = 0;
emitter.TurnOn();
}

return;
}

emitter.SetLocation(Location);
emitter.SetRotation(Rotation);

if ((emitter.HitActor != None) && (LastHitActor != emitter.HitActor))
{
if (IsRelevant(emitter.HitActor))
{
bTrigger = True;

if (emitter.HitActor.IsA('DeusExPlayer'))
{
// check for adaptive armor - makes the player invisible
foreach AllActors(class'AdaptiveArmor', armor)
if ((armor.Owner == emitter.HitActor) && armor.bActive)
{
bTrigger = False;
break;
}
}

if (bTrigger)
{
// play "beam broken" sound
PlaySound(sound'Beep2',,,, 1280, 3.0);

if (!bAlreadyTriggered)
{
// only be triggered once?
if (bTriggerOnceOnly)
bAlreadyTriggered = True;

// Trigger event
if(Event != '')
foreach AllActors(class 'Actor', A, Event)
A.Trigger(Self, Pawn(emitter.HitActor));
}
}
}
}

LastHitActor = emitter.HitActor;
}

Touch (Actor Other)


// does nothing when touched

Trigger (Actor Other, Pawn Instigator)


if (bConfused)
return;

if (emitter != None)
{
if (!bIsOn)
{
emitter.TurnOn();
bIsOn = True;
LastHitActor = None;
MultiSkins[1] = Texture'LaserSpot1';
}
}

Super.Trigger(Other, Instigator);

UnTrigger (Actor Other, Pawn Instigator)


if (bConfused)
return;

if (emitter != None)
{
if (bIsOn)
{
emitter.TurnOff();
bIsOn = False;
LastHitActor = None;
MultiSkins[1] = Texture'BlackMaskTex';
}
}

Super.UnTrigger(Other, Instigator);




BehindTheCurtain.uc (extends ToolWindow)

var ToolButtonWindow btnLoadMap;
var ToolButtonWindow btnEditFlags;
var ToolButtonWindow btnInvokeCon;
var ToolButtonWindow btnShowClass;
var ToolButtonWindow btnQuotes;
var ToolButtonWindow btnAddDump;
var ToolButtonWindow btnViewDumps;
var ToolButtonWindow btnPlayMusic;
var ToolButtonWindow btnClose;

BoxOptionSelected (Window msgBoxWindow, int buttonNumber) -> bool


// Nuke the msgbox
root.PopWindow();
return true;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;
local Window win;


bHandled = True;

switch( buttonPressed )
{
case btnLoadMap:
root.PushWindow(Class'LoadMapWindow', True);
break;

case btnEditFlags:
root.PushWindow(Class'FlagEditWindow', True);
break;

case btnAddDump:
win = root.PushWindow(Class'DumpLocationEditWindow', True);
DumpLocationEditWindow(win).SetAddMode();
break;

case btnViewDumps:
ViewDumps();
break;

case btnInvokeCon:
root.PushWindow(Class'InvokeConWindow', True);
break;

case btnShowClass:
root.PushWindow(Class'ShowClassWindow', True);
break;

case btnQuotes:
root.PushWindow(Class'QuotesWindow', True);
break;

case btnPlayMusic:
root.PushWindow(Class'PlayMusicWindow', True);
break;

case btnClose:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated( buttonPressed );

return bHandled;

CreateControls


// Buttons
btnLoadMap = CreateToolButton(20, 110, "|&Load Map");
btnEditFlags = CreateToolButton(20, 135, "|&Edit Flags");
btnAddDump = CreateToolButton(20, 160, "|&Add Dump");
btnViewDumps = CreateToolButton(20, 185, "|&View Dumps");
btnInvokeCon = CreateToolButton(20, 210, "|&Invoke Con");
btnShowClass = CreateToolButton(20, 235, "|&Show Class");
btnQuotes = CreateToolButton(20, 260, "View |&Quotes");
btnPlayMusic = CreateToolButton(20, 285, "Play |&Music");
btnClose = CreateToolButton(20, 325, "|&Close");

// Button Descriptions
CreateToolLabel(110, 115, "Load a map from the MAPS directory");
CreateToolLabel(110, 140, "Edit game flags");
CreateToolLabel(110, 165, "Add New Dump Location");
CreateToolLabel(110, 190, "View Dump Locations");
CreateToolLabel(110, 215, "Invoke Conversation Dialog");
CreateToolLabel(110, 240, "Display Actors In 3D Scene");
CreateToolLabel(110, 265, "Quotes from your favorite personalities");
CreateToolLabel(110, 290, "Music Jukebox");
CreateToolLabel(110, 330, "Return to the world of Conspiracies");

CreateDumpLoc -> DumpLocation


local DumpLocation newDumpLoc;


if (player != None)
{
// Create our DumpLocation object
newDumpLoc = player.CreateDumpLocationObject();
newDumpLoc.SetPlayer(player);
}

return newDumpLoc;

DisplayNoDumpFilesError


root.ToolMessageBox(
"No Dump Files!",
"There are no Dump Location files to view!",
1, False, Self);

DrawWindow (GC gc)


// Draw the Deus Ex logo
gc.SetStyle(DSTY_Normal);
gc.DrawTexture( 10, 10, 256, 93, 0, 0, Texture'BehindTheCurtain1');
gc.DrawTexture(266, 10, 21, 93, 0, 0, Texture'BehindTheCurtain2');

InitWindow


Super.InitWindow();

// Center this window
SetSize(300, 360);

SetTitle("Behind The Curtain");

// Create the controls
CreateControls();

// Hide the title bar
SetTitleBarVisibility(False);
SetWindowDragging(True);

ViewDumps


local DumpLocation dumpLoc;
local DumpLocationListLocationsWindow winLocations;
local String dumpFileName;


if (player != None)
{
// Create our DumpLocation object
dumpLoc = player.CreateDumpLocationObject();

if (dumpLoc.GetDumpFileCount() == 0)
{
DisplayNoDumpFilesError();
}
else if (dumpLoc.GetDumpFileCount() > 2)
{
root.PushWindow(Class'DumpLocationListWindow', True);
}
else
{
winLocations = DumpLocationListLocationsWindow(root.PushWindow(Class'DumpLocationListLocationsWindow', True));

dumpFileName = dumpLoc.GetFirstDumpFile();
dumpFileName = left(dumpFileName, len(dumpFileName) - 4);

winLocations.SetDumpFile(dumpFileName);
}

CriticalDelete(dumpLoc);
dumpLoc = None;
}




Binoculars.uc (extends DeusExPickup)

bActivatable=True
ItemName="Binoculars"
ItemArticle="some"
PlayerViewOffset=(X=18.000000,Z=-6.000000)
PlayerViewMesh=LodMesh'DeusExItems.Binoculars'
PickupViewMesh=LodMesh'DeusExItems.Binoculars'
ThirdPersonMesh=LodMesh'DeusExItems.Binoculars'
LandSound=Sound'DeusExSounds.Generic.PaperHit2'
Icon=Texture'DeusExUI.Icons.BeltIconBinoculars'
largeIcon=Texture'DeusExUI.Icons.LargeIconBinoculars'
largeIconWidth=49
largeIconHeight=34
Description="A pair of military binoculars."
beltDescription="BINOCS"
Mesh=LodMesh'DeusExItems.Binoculars'
CollisionRadius=7.000000
CollisionHeight=2.060000
Mass=5.000000
Buoyancy=6.000000

Activate


local DeusExPlayer player;


Super.Activate();

player = DeusExPlayer(Owner);
if (player != None)
player.DesiredFOV = player.Default.DesiredFOV;

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
{
// Hide the Scope View
DeusExRootWindow(player.rootWindow).scopeView.DeactivateView();
}

RefreshScopeDisplay (DeusExPlayer player, optional bool bInstant)


if ((bActive) && (player != None))
{
// Show the Scope View
DeusExRootWindow(player.rootWindow).scopeView.ActivateView(20, True, bInstant);
}




BioelectricCell.uc (extends DeusExPickup)

var int rechargeAmount;
var int mpRechargeAmount;
var localized String msgRecharged;
var localized String RechargesLabel;
rechargeAmount=25
mpRechargeAmount=50
msgRecharged="Recharged %d points"
RechargesLabel="Recharges %d Energy Units"
maxCopies=30
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Bioelectric Cell"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.BioCell'
PickupViewMesh=LodMesh'DeusExItems.BioCell'
ThirdPersonMesh=LodMesh'DeusExItems.BioCell'
LandSound=Sound'DeusExSounds.Generic.PlasticHit2'
Icon=Texture'DeusExUI.Icons.BeltIconBioCell'
largeIcon=Texture'DeusExUI.Icons.LargeIconBioCell'
largeIconWidth=44
largeIconHeight=43
Description="A bioelectric cell provides efficient storage of energy in a form that can be utilized by a number of different devices.|n|n Augmented agents have been equipped with an interface that allows them to transparently absorb energy from bioelectric cells. -- Jaime Reyes "
beltDescription="BIOCELL"
Mesh=LodMesh'DeusExItems.BioCell'
CollisionRadius=4.700000
CollisionHeight=0.930000
Mass=5.000000
Buoyancy=4.000000

Activate


// can't turn it off

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
{
player.ClientMessage(Sprintf(msgRecharged, rechargeAmount));

player.PlaySound(sound'BioElectricHiss', SLOT_None,,, 256);

player.Energy += rechargeAmount;
if (player.Energy > player.EnergyMax)
player.Energy = player.EnergyMax;
}

UseOnce();

PostBeginPlay


Super.PostBeginPlay();
if (Level.NetMode != NM_Standalone)
rechargeAmount = mpRechargeAmount;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
MaxCopies = 5;

TestMPBeltSpot (int BeltSpot) -> bool


return (BeltSpot == 0);

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;
local string str;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.SetTitle(itemName);
winInfo.SetText(Description $ winInfo.CR() $ winInfo.CR());
winInfo.AppendText(Sprintf(RechargesLabel, RechargeAmount));

// Print the number of copies
str = CountLabel @ String(NumCopies);
winInfo.AppendText(winInfo.CR() $ winInfo.CR() $ str);

return True;




Bird.uc (extends Animal)

var name WaitAnim;
var(AI) float LikesFlying;
var float lastCheck;
var float stuck;
var float hitTimer;
var float fright;
var float initialRate;
WaitAnim=Idle1
LikesFlying=0.250000
bFleeBigPawns=True
Restlessness=1.000000
Wanderlust=0.050000
Cowardice=0.200000
bCanFly=True
MaxStepHeight=2.000000

BeginPlay


Super.BeginPlay();
AIClearEventCallback('WeaponFire');

BeginState


SetPhysics(PHYS_Flying);
Enable('HitWall');
stuck = 0;
hitTimer = 0;
AISetEventCallback('LoudNoise', 'HeardNoise');
if (IsA('Pigeon'))
PlaySound(Sound'PigeonFly', SLOT_Misc);
else if (IsA('Seagull'))
PlaySound(Sound'SeagullFly', SLOT_Misc);
SetCollision(true, false, false);

CheckDestination (vector dest, out float magnitude, float minDist) -> bool


local bool retval;
local float dist;


retval = False;
dist = magnitude;
while (dist > minDist)
{
if (PointReachable(Location+(dest*dist)))
break;
dist *= 0.5;
}
if (dist > minDist)
{
magnitude = dist;
retval = True;
}

return (retval);

CheckStuck


if (stuck > 10.0)
GotoState('Flying', 'Drop');

EndState


SetCollision(true, true, true);
SetPhysics(PHYS_Falling);
Enable('HitWall');
AIClearEventCallback('LoudNoise');

FleeFromPawn (Pawn fleePawn)


MakeFrightened();
if (GetStateName() != 'Flying')
GotoState('Flying');

HeardNoise (Name eventName, EAIEventState state, XAIParams params)


MakeFrightened();

HitWall (vector HitNormal, actor Wall)


local Vector newVector;
local Rotator newRotator;


if (hitTimer > 0)
return;

hitTimer = 0.5;
Disable('HitWall');

newVector = (Velocity dot HitNormal) * HitNormal * (-2.0) + Velocity;
newRotator = Rotator(newVector);

SetRotation(newRotator);
DesiredRotation = newRotator;

Acceleration = vect(0, 0, 0);
Velocity = newVector;
if (VSize(Velocity) < 0.01)
Velocity = Vector(Rotation);

destLoc = Location + 80*Velocity/VSize(Velocity);
GotoState('Flying', 'KeepGoing');

MakeFrightened


fright = (cowardice*99)+1;

PickDestination


local vector dest;
local float magnitude;
local int iterations;
local bool bValid;


iterations = 4;
while (iterations > 0)
{
//magnitude = 800+(FRand()*100-50);
magnitude = 1200+(FRand()*200-100);
dest = VRand();
bValid = CheckDestination(dest, magnitude, 100);
if (!bValid && (dest.Z != 0))
{
dest.Z = -dest.Z;
bValid = CheckDestination(dest, magnitude, 100);
}
if (bValid)
break;

iterations--;
}
if (iterations > 0)
{
destLoc = Location + (dest*magnitude);
stuck = 0;
}
else
{
if (VSize(Velocity) > 0.001)
destLoc = 40*Velocity/VSize(Velocity);
else
destLoc = Velocity;
if (stuck > 5.0)
destLoc += VRand()*((stuck-5.0)*3.0);
destLoc += Location;
}

PickFinalDestination -> bool


local vector dest;
local Actor landActor;
local vector hitLoc;
local vector hitNorm;
local vector endPoint;
local vector startPoint;
local int iterations;
local bool retval;


retval = False;

iterations = 3;
while (iterations > 0)
{
startPoint = VRand()*100 + Location;
startPoint.Z = Location.Z;
endPoint = startPoint;
endPoint.Z -= 1000;
foreach TraceActors(Class'Actor', landActor, hitLoc, hitNorm, endPoint, startPoint)
{
if (landActor == Level)
{
hitLoc.Z += CollisionHeight+5;
if (PointReachable(hitLoc))
break;
}
else
{
landActor = None;
break;
}
}
if (landActor != None)
{
break;
}
iterations--;
}

if (iterations > 0)
{
destLoc = hitLoc;
retval = True;
}

return (retval);

PickInitialDestination


local vector dest;
local rotator rot;
local float magnitude;


//magnitude = 200 + (FRand()*50-25);
magnitude = 300 + (FRand()*100-50);
rot.yaw = Rotation.yaw;
//rot.pitch = 8192+(Rand(6000)-3000);
rot.pitch = 10000+(Rand(6000)-3000);
rot.roll = 0;
dest = Vector(rot);
if (CheckDestination(dest, magnitude, 20))
destLoc = Location + (dest*magnitude);
else
destLoc = Location + vect(0, 0, 100);

PlayFlying


LoopAnim('Fly', 1.0, 0.1);
initialRate = AnimRate;

PlayWaiting


LoopAnim(WaitAnim);

ReadyToLand -> bool


local Pawn fearPawn;


fearPawn = FrightenedByPawn();
if (fearPawn != None)
{
MakeFrightened();
return false;
}
else if (fright > 0)
return false;
else if (FRand() <= LikesFlying)
return false;
else
return true;

Tick (float deltaSeconds)


local float rate;


Global.Tick(deltaSeconds);

if (hitTimer > 0)
{
hitTimer -= deltaSeconds;
if (hitTimer < 0)
{
hitTimer = 0;
Enable('HitWall');
}
}
stuck += deltaSeconds;

if (Physics == PHYS_Flying)
{
rate = FClamp(Acceleration.Z+250, 0, 500)/500 + 0.5;
AnimRate = initialRate*rate;
}
else if (Physics == PHYS_Falling)
AnimRate = initialRate*0.1;

TweenToWaiting (float tweentime)


if (FRand() >= 0.5)
WaitAnim = 'Idle1';
else
WaitAnim = 'Idle2';
TweenAnim(WaitAnim, tweentime);




BlackHelicopter.uc (extends Vehicles)

ItemName="Black Helicopter"
Mesh=LodMesh'DeusExDeco.BlackHelicopter'
SoundRadius=160
SoundVolume=192
AmbientSound=Sound'Ambient.Ambient.Helicopter2'
CollisionRadius=461.230011
CollisionHeight=87.839996
Mass=6000.000000
Buoyancy=1000.000000

BeginState


Super.BeginState();
LoopAnim('Fly');

SupportActor (Actor standingActor)


// kill whatever lands on the blades
if (standingActor != None)
standingActor.TakeDamage(10000, None, standingActor.Location, vect(0,0,0), 'Exploded');




BloodDrop.uc (extends DeusExFragment)

Style=STY_Modulated
Mesh=LodMesh'DeusExItems.BloodDrop'
CollisionRadius=0.000000
CollisionHeight=0.000000
bBounce=False
NetPriority=1.000000
NetUpdateFrequency=5.000000

BeginState


Velocity = VRand() * 100;
DrawScale = 1.0 + FRand();
SetRotation(Rotator(Velocity));

// Gore check
if (Level.Game.bLowGore || Level.Game.bVeryLowGore)
{
Destroy();
return;
}

HitWall (vector HitNormal, actor Wall)


spawn(class'BloodSplat',,, Location, Rotator(HitNormal));
Destroy();

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
ScaleGlow = 2.0;
DrawScale *= 1.5;
LifeSpan *= 2.0;
bUnlit=True;
}

Tick (float deltaTime)


if (Velocity == vect(0,0,0))
{
spawn(class'BloodSplat',,, Location, rot(16384,0,0));
Destroy();
}
else
SetRotation(Rotator(Velocity));




BloodPool.uc (extends DeusExDecal)

var float spreadTime;
var float maxDrawScale;
var float time;
spreadTime=5.000000
maxDrawScale=1.500000
Texture=Texture'DeusExItems.Skins.FlatFXTex1'

BeginPlay


// Gore check
if (Level.Game.bLowGore || Level.Game.bVeryLowGore)
{
Destroy();
return;
}
Super.BeginPlay();

Tick (float deltaTime)


time += deltaTime;
if (time <= spreadTime)
{
DrawScale = maxDrawScale * time / spreadTime;
ReattachDecal(vect(0.1,0.1,0));
}




BloodSplat.uc (extends DeusExDecal)

Texture=Texture'DeusExItems.Skins.FlatFXTex2'
DrawScale=0.200000

BeginPlay


local Rotator rot;
local float rnd;


// Gore check
if (Level.Game.bLowGore || Level.Game.bVeryLowGore)
{
Destroy();
return;
}

rnd = FRand();
if (rnd < 0.25)
Texture = Texture'FlatFXTex3';
else if (rnd < 0.5)
Texture = Texture'FlatFXTex5';
else if (rnd < 0.75)
Texture = Texture'FlatFXTex6';

DrawScale += FRand() * 0.2;

Super.BeginPlay();




BloodSpurt.uc (extends Effects)

LifeSpan=0.500000
DrawType=DT_Mesh
Style=STY_Modulated
Mesh=LodMesh'DeusExItems.BloodSpurt'
bFixedRotationDir=True
NetUpdateFrequency=5.000000

BeginState


Velocity = vect(0,0,0);
DrawScale -= FRand() * 0.5;
PlayAnim('Spurt');

// Gore check
if (Level.Game.bLowGore || Level.Game.bVeryLowGore)
{
Destroy();
return;
}

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
ScaleGlow = 2.0;
DrawScale *= 1.5;
LifeSpan *= 2.0;
bUnlit=True;
}




BoatPerson.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.BoatPersonCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.750000
runAnimMult=0.700000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BoatPersonTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex3'
MultiSkins(4)=Texture'DeusExCharacters.Skins.BoatPersonTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BoatPersonTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="BoatPerson"
FamiliarName="Boat Person"
UnfamiliarName="Boat Person"



BoatPersonCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BoatPersonTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex3'
MultiSkins(4)=Texture'DeusExCharacters.Skins.BoatPersonTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BoatPersonTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



BobPage.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.BobPageCarcass'
WalkingSpeed=0.213333
bImportant=True
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BobPageTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.BobPageTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.BobPageTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BobPageTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.BobPageTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="BobPage"
FamiliarName="Bob Page"
UnfamiliarName="Bob Page"

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();




BobPageAugmented.uc (extends DeusExDecoration)

bInvincible=True
bHighlight=False
ItemName="Augmented Bob Page"
bPushable=False
BaseEyeHeight=38.000000
bBlockSight=True
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.BobPageAugmented'
CollisionRadius=21.600000
CollisionHeight=54.209999
Mass=200.000000
Buoyancy=100.000000

PostBeginPlay


Super.PostBeginPlay();

LoopAnim('Idle');




BobPageCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BobPageTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.BobPageTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.BobPageTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BobPageTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.BobPageTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



BoneFemur.uc (extends DeusExDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Human Femur"
Mesh=LodMesh'DeusExDeco.BoneFemur'
CollisionRadius=12.500000
CollisionHeight=1.680000
Mass=8.000000
Buoyancy=10.000000



BoneSkull.uc (extends DeusExDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Human Skull"
Mesh=LodMesh'DeusExDeco.BoneSkull'
CollisionRadius=5.800000
CollisionHeight=4.750000
Mass=8.000000
Buoyancy=10.000000



BookClosed.uc (extends InformationDevices)

bCanBeBase=True
ItemName="Book"
Mesh=LodMesh'DeusExDeco.BookClosed'
CollisionRadius=10.000000
CollisionHeight=1.700000
Mass=10.000000
Buoyancy=11.000000



BookOpen.uc (extends InformationDevices)

bCanBeBase=True
ItemName="Book"
Mesh=LodMesh'DeusExDeco.BookOpen'
CollisionRadius=15.000000
CollisionHeight=1.420000
Mass=10.000000
Buoyancy=11.000000



BoxLarge.uc (extends Containers)

FragType=Class'DeusEx.PaperFragment'
ItemName="Cardboard Box"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.BoxLarge'
CollisionRadius=42.000000
CollisionHeight=50.000000
Mass=80.000000
Buoyancy=90.000000



BoxMedium.uc (extends Containers)

HitPoints=10
FragType=Class'DeusEx.PaperFragment'
ItemName="Cardboard Box"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.BoxMedium'
CollisionRadius=42.000000
CollisionHeight=30.000000
Mass=50.000000
Buoyancy=60.000000



BoxSmall.uc (extends Containers)

HitPoints=5
FragType=Class'DeusEx.PaperFragment'
ItemName="Cardboard Box"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.BoxSmall'
CollisionRadius=13.000000
CollisionHeight=5.180000
Mass=20.000000
Buoyancy=30.000000



BreakableGlass.uc (extends DeusExMover)

bPickable=False
bBreakable=True
doorStrength=0.100000
bHighlight=False
bFrobbable=False
minDamageThreshold=3
NumFragments=10
FragmentScale=1.000000
FragmentSpread=16
FragmentClass=Class'DeusEx.GlassFragment'
bFragmentTranslucent=True
ExplodeSound1=Sound'DeusExSounds.Generic.GlassBreakSmall'
ExplodeSound2=Sound'DeusExSounds.Generic.GlassBreakLarge'
bBlockSight=False
bOwned=True



BreakableWall.uc (extends DeusExMover)

bPickable=False
bBreakable=True
doorStrength=0.400000
bHighlight=False
bFrobbable=False
minDamageThreshold=20
FragmentScale=3.000000
FragmentClass=Class'DeusEx.Rockchip'
ExplodeSound1=Sound'DeusExSounds.Generic.SmallExplosion1'
ExplodeSound2=Sound'DeusExSounds.Generic.LargeExplosion1'
bOwned=True



BulletHole.uc (extends DeusExDecal)

Texture=Texture'DeusExItems.Skins.FlatFXTex9'
DrawScale=0.100000

BeginPlay


if(!AttachDecal(32, vect(0.1,0.1,0)))
Destroy();




BumFemale.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.BumFemaleCarcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BumFemaleTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.BumFemaleTex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BumFemaleTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex4'
MultiSkins(7)=Texture'DeusExCharacters.Skins.BumFemaleTex1'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="BumFemale"
FamiliarName="Bum"
UnfamiliarName="Bum"



BumFemaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BumFemaleTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.BumFemaleTex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BumFemaleTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex4'
MultiSkins(7)=Texture'DeusExCharacters.Skins.BumFemaleTex1'



BumMale.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.BumMaleCarcass'
WalkingSpeed=0.213333
BaseAssHeight=-23.000000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BumMaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.BumMaleTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex4'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BumMaleTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BumMaleTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Bum"
FamiliarName="Bum"
UnfamiliarName="Bum"



BumMale2.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.BumMale2Carcass'
WalkingSpeed=0.213333
BaseAssHeight=-23.000000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BumMale2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.BumMale2Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex4'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BumMale2Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BumMale2Tex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="OlderBum"
FamiliarName="Older Bum"
UnfamiliarName="Older Bum"



BumMale2Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BumMale2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.BumMale2Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex4'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BumMale2Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BumMale2Tex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



BumMale3.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.BumMale3Carcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BumMale3Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.BumMale3Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex7'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BumMale3Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BumMale3Tex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Bum"
FamiliarName="Bum"
UnfamiliarName="Bum"



BumMale3Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BumMale3Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.BumMale3Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex7'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BumMale3Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BumMale3Tex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



BumMaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BumMaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.BumMaleTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex4'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BumMaleTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.BumMaleTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



Buoy.uc (extends OutdoorThings)

bFloating=True
bStatic=False
Mesh=LodMesh'DeusExDeco.Buoy'
CollisionRadius=24.070000
CollisionHeight=57.820000
Mass=100.000000
Buoyancy=200.000000



BurnMark.uc (extends DeusExDecal)

Texture=Texture'DeusExItems.Skins.FlatFXTex40'



Bushes1.uc (extends OutdoorThings)

bCanBeBase=True
Mesh=LodMesh'DeusExDeco.Bushes1'
CollisionRadius=20.000000
CollisionHeight=43.790001
Mass=100.000000
Buoyancy=110.000000



Bushes2.uc (extends OutdoorThings)

Mesh=LodMesh'DeusExDeco.Bushes2'
CollisionRadius=10.000000
CollisionHeight=35.099998
Mass=100.000000
Buoyancy=110.000000



Bushes3.uc (extends OutdoorThings)

var() ESkinColor SkinColor;
Mesh=LodMesh'DeusExDeco.Bushes3'
CollisionRadius=10.000000
CollisionHeight=30.000000
Mass=40.000000
Buoyancy=20.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Bushes1: Skin = Texture'Bushes3Tex1'; break;
case SC_Bushes2: Skin = Texture'Bushes3Tex2'; break;
case SC_Bushes3: Skin = Texture'Bushes3Tex3'; break;
case SC_Bushes4: Skin = Texture'Bushes3Tex4'; break;
}




Businessman1.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Businessman1Carcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex4'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Businessman1Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SkinTex4'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Businessman1Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Businessman1Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Businessman1"
FamiliarName="Businessman"
UnfamiliarName="Businessman"



Businessman1Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex4'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Businessman1Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SkinTex4'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Businessman1Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Businessman1Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



Businessman2.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Businessman2Carcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Businessman2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Businessman2Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Businessman2Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Businessman2Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Businessman2Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Businessman2"
FamiliarName="Businessman"
UnfamiliarName="Businessman"



Businessman2Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Businessman2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Businessman2Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Businessman2Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Businessman2Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Businessman2Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



Businessman3.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Businessman3Carcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Businessman3Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Businessman3Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Businessman3Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Businessman3"
FamiliarName="Businessman"
UnfamiliarName="Businessman"



Businessman3Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Businessman3Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Businessman3Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Businessman3Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



Businesswoman1.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Businesswoman1Carcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=140.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Businesswoman1Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Businesswoman1Tex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Businesswoman1Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Businesswoman1Tex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Businesswoman1Tex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Businesswoman1Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Businesswoman1"
FamiliarName="Businesswoman"
UnfamiliarName="Businesswoman"



Businesswoman1Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Businesswoman1Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Businesswoman1Tex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Businesswoman1Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Businesswoman1Tex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Businesswoman1Tex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Businesswoman1Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Butler.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.ButlerCarcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ButlerTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ButlerTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ButlerTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ButlerTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Butler"
FamiliarName="Butler"
UnfamiliarName="Butler"



ButlerCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ButlerTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ButlerTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ButlerTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ButlerTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



Button1.uc (extends DeusExDecoration)

var() EButtonType ButtonType;
var() float buttonLitTime;
var() sound buttonSound1;
var() sound buttonSound2;
var() bool bLit;
var() bool bWaitForEvent;
var bool isPressed;
var Vector lastLoc, rpcLocation;
var bool bIsMoving;
ButtonType=BT_Blank
buttonLitTime=0.500000
buttonSound1=Sound'DeusExSounds.Generic.Beep1'
bInvincible=True
ItemName="Button"
bPushable=False
Physics=PHYS_None
RemoteRole=ROLE_SimulatedProxy
Mesh=LodMesh'DeusExDeco.Button1'
CollisionRadius=2.000000
CollisionHeight=2.000000
bCollideWorld=False
bBlockActors=False
Mass=5.000000
Buoyancy=2.000000

BeginPlay


Super.BeginPlay();

SetSkin(ButtonType, bLit);

if ( Level.NetMode != NM_Standalone )
rpcLocation = Location;

Bump (actor Other)


// do nothing

Frob (Actor Frobber, Inventory frobWith)


if (!isPressed)
{
isPressed = True;
PlaySound(buttonSound1, SLOT_None);
SetSkin(ButtonType, !bLit);
if (!bWaitForEvent)
SetTimer(buttonLitTime, False);

Super.Frob(Frobber, frobWith);
}

SetSkin (EButtonType type, bool lit)


switch (type)
{
case BT_Up: if (lit)
{
Skin = Texture'Button1Tex2';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex1';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_Down: if (lit)
{
Skin = Texture'Button1Tex4';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex3';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_1: if (lit)
{
Skin = Texture'Button1Tex6';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex5';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_2: if (lit)
{
Skin = Texture'Button1Tex8';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex7';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_3: if (lit)
{
Skin = Texture'Button1Tex10';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex9';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_4: if (lit)
{
Skin = Texture'Button1Tex12';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex11';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_5: if (lit)
{
Skin = Texture'Button1Tex14';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex13';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_6: if (lit)
{
Skin = Texture'Button1Tex16';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex15';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_7: if (lit)
{
Skin = Texture'Button1Tex18';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex17';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_8: if (lit)
{
Skin = Texture'Button1Tex20';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex19';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_9: if (lit)
{
Skin = Texture'Button1Tex22';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex21';
ScaleGlow = Default.ScaleGlow;
}
break;
case BT_Blank: if (lit)
{
Skin = Texture'Button1Tex24';
ScaleGlow = 3.0;
}
else
{
Skin = Texture'Button1Tex23';
ScaleGlow = Default.ScaleGlow;
}
break;
}

SupportActor (Actor standingActor)


// do nothing

Tick (float deltaTime)


if ( Level.NetMode != NM_Standalone )
{
if ( Role == ROLE_Authority )
{
// Was moving, now at rest
if ( bIsMoving && ( Location == lastLoc ))
rpcLocation = Location;

bIsMoving = ( Location != lastLoc );
lastLoc = Location;
}
else
{
// Our replicated location changed which means the button has come to rest
if ( lastLoc != rpcLocation )
{
SetLocation( rpcLocation );
lastLoc = rpcLocation;
}
}
}
Super.Tick( deltaTime );

Timer


PlaySound(buttonSound2, SLOT_None);
SetSkin(ButtonType, bLit);
isPressed = False;

Trigger (Actor Other, Pawn Instigator)


if (bWaitForEvent)
Timer();




Cactus1.uc (extends OutdoorThings)

Mesh=LodMesh'DeusExDeco.Cactus1'
CollisionRadius=33.000000
CollisionHeight=81.260002
Mass=1000.000000
Buoyancy=5.000000



Cactus2.uc (extends OutdoorThings)

Mesh=LodMesh'DeusExDeco.Cactus2'
CollisionRadius=10.000000
CollisionHeight=12.010000
Mass=50.000000
Buoyancy=5.000000



CageLight.uc (extends DeusExDecoration)

var() ESkinColor SkinColor;
var() bool bOn;
bOn=True
HitPoints=5
bInvincible=True
FragType=Class'DeusEx.GlassFragment'
bHighlight=False
bCanBeBase=True
ItemName="Light Fixture"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.CageLight'
ScaleGlow=2.000000
CollisionRadius=17.139999
CollisionHeight=17.139999
LightType=LT_Steady
LightBrightness=255
LightHue=32
LightSaturation=224
LightRadius=8
Mass=20.000000
Buoyancy=10.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_1: Skin = Texture'CageLightTex1'; break;
case SC_2: Skin = Texture'CageLightTex2'; break;
case SC_3: Skin = Texture'CageLightTex3'; break;
case SC_4: Skin = Texture'CageLightTex4'; break;
case SC_5: Skin = Texture'CageLightTex5'; break;
case SC_6: Skin = Texture'CageLightTex6'; break;
}

PostBeginPlay


Super.PostBeginPlay();

if (!bOn)
LightType = LT_None;

Trigger (Actor Other, Pawn Instigator)


Super.Trigger(Other, Instigator);

if (!bOn)
{
bOn = True;
LightType = LT_Steady;
bUnlit = True;
ScaleGlow = 2.0;
}
else
{
bOn = False;
LightType = LT_None;
bUnlit = False;
ScaleGlow = 1.0;
}




Candybar.uc (extends DeusExPickup)

maxCopies=20
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Candy Bar"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.Candybar'
PickupViewMesh=LodMesh'DeusExItems.Candybar'
ThirdPersonMesh=LodMesh'DeusExItems.Candybar'
Icon=Texture'DeusExUI.Icons.BeltIconCandyBar'
largeIcon=Texture'DeusExUI.Icons.LargeIconCandyBar'
largeIconWidth=46
largeIconHeight=36
Description="'CHOC-O-LENT DREAM. IT'S CHOCOLATE! IT'S PEOPLE! IT'S BOTH!(tm) 85% Recycled Material.'"
beltDescription="CANDY BAR"
Mesh=LodMesh'DeusExItems.Candybar'
CollisionRadius=6.250000
CollisionHeight=0.670000
Mass=3.000000
Buoyancy=4.000000

Activate


// can't turn it off

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
player.HealPlayer(2, False);

UseOnce();




CarBurned.uc (extends OutdoorThings)

var() ESkinColor SkinColor;
bCanBeBase=True
Mesh=LodMesh'DeusExDeco.CarBurned'
CollisionRadius=101.650002
CollisionHeight=29.430000
Mass=2000.000000
Buoyancy=1500.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Yellow: Skin = Texture'CarBurnedTex1'; break;
case SC_DarkBlue: Skin = Texture'CarBurnedTex2'; break;
}




CarStripped.uc (extends OutdoorThings)

var() ESkinColor SkinColor;
bCanBeBase=True
Mesh=LodMesh'DeusExDeco.CarStripped'
CollisionRadius=115.000000
CollisionHeight=23.860001
Mass=2000.000000
Buoyancy=1500.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_LightBlue: Skin = Texture'CarStrippedTex1'; break;
case SC_DarkBlue: Skin = Texture'CarStrippedTex2'; break;
case SC_Gray: Skin = Texture'CarStrippedTex3'; break;
case SC_Black: Skin = Texture'CarStrippedTex4'; break;
}




CarWrecked.uc (extends OutdoorThings)

bCanBeBase=True
Mesh=LodMesh'DeusExDeco.CarWrecked'
CollisionRadius=118.000000
CollisionHeight=49.580002
Mass=2000.000000
Buoyancy=1500.000000



Cart.uc (extends DeusExDecoration)

var float rollTimer;
var float pushTimer;
var vector pushVel;
var bool bJustPushed;
bCanBeBase=True
ItemName="Utility Push-Cart"
Mesh=LodMesh'DeusExDeco.Cart'
SoundRadius=16
CollisionRadius=28.000000
CollisionHeight=26.780001
Mass=40.000000
Buoyancy=45.000000

Bump (actor Other)


if (bJustPushed)
return;

if ((Other != None) && (Physics != PHYS_Falling))
if (abs(Location.Z-Other.Location.Z) < (CollisionHeight+Other.CollisionHeight-1)) // no bump if landing on cart
StartRolling(0.25*Other.Velocity*Other.Mass/Mass);

StartRolling (vector vel)


// Transfer momentum
SetPhysics(PHYS_Rolling);
pushVel = vel;
pushVel.Z = 0;
Velocity = pushVel;
rollTimer = 2;
bJustPushed = True;
pushTimer = 0.5;
AmbientSound = Sound'UtilityCart';

Tick (float deltaTime)


Super.Tick(deltaTime);

if ((Physics == PHYS_Rolling) && (rollTimer > 0))
{
rollTimer -= deltaTime;
Velocity = pushVel;

if (pushTimer > 0)
pushTimer -= deltaTime;
else
bJustPushed = False;
}


// make the sound pitch depend on the velocity
if (VSize(Velocity) > 1)
{
SoundPitch = Clamp(2*VSize(Velocity), 32, 64);
}
else
{
// turn off the sound when it stops
AmbientSound = None;
SoundPitch = Default.SoundPitch;
}




Cat.uc (extends Animal)

var float time;
bPlayDying=True
bFleeBigPawns=True
MinHealth=0.000000
CarcassType=Class'DeusEx.CatCarcass'
WalkingSpeed=0.111111
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponCatScratch')
GroundSpeed=180.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
MaxStepHeight=14.000000
BaseEyeHeight=6.000000
Health=30
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
HitSound1=Sound'DeusExSounds.Animal.CatHiss'
HitSound2=Sound'DeusExSounds.Animal.CatHiss'
Die=Sound'DeusExSounds.Animal.CatDie'
Alliance=Cat
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Cat'
CollisionRadius=17.000000
CollisionHeight=11.300000
bBlockActors=False
Mass=10.000000
Buoyancy=97.000000
RotationRate=(Yaw=100000)
BindName="Cat"
FamiliarName="Cat"
UnfamiliarName="Cat"

ShouldBeStartled (Pawn startler) -> bool


local float speed;
local float time;
local float dist;
local float dist2;
local bool bPh33r;


bPh33r = false;
if (startler != None)
{
speed = VSize(startler.Velocity);
if (speed >= 20)
{
dist = VSize(Location - startler.Location);
time = dist/speed;
if (time <= 3.0)
{
dist2 = VSize(Location - (startler.Location+startler.Velocity*time));
if (dist2 < speed*1.5)
bPh33r = true;
}
}
}

return bPh33r;

Tick (float deltaSeconds)


Super.Tick(deltaSeconds);
if (Enemy != None)
GotoState('Fleeing');




CatCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.CatCarcass'
Mesh3=LodMesh'DeusExCharacters.CatCarcass'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.CatCarcass'
CollisionRadius=17.000000
CollisionHeight=3.600000



CeilingFan.uc (extends DeusExDecoration)

var() ESkinColor SkinColor;
SkinColor=SC_DarkWoodIron
FragType=Class'DeusEx.WoodFragment'
bHighlight=False
bCanBeBase=True
ItemName="Ceiling Fan Blades"
bPushable=False
Physics=PHYS_Rotating
RemoteRole=ROLE_SimulatedProxy
Mesh=LodMesh'DeusExDeco.CeilingFan'
CollisionRadius=45.750000
CollisionHeight=3.300000
bCollideWorld=False
bFixedRotationDir=True
Mass=50.000000
Buoyancy=30.000000
RotationRate=(Yaw=16384)

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_WoodBrass: Skin = Texture'CeilingFanTex1'; break;
case SC_DarkWoodIron: Skin = Texture'CeilingFanTex2'; break;
case SC_White: Skin = Texture'CeilingFanTex3'; break;
case SC_WoodBrassFancy: Skin = Texture'CeilingFanTex4'; break;
case SC_WoodPlastic: Skin = Texture'CeilingFanTex5'; break;
}




CeilingFanMotor.uc (extends DeusExDecoration)

var() ESkinColor SkinColor;
SkinColor=SC_DarkWoodIron
bInvincible=True
bHighlight=False
bCanBeBase=True
ItemName="Ceiling Fan Motor"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.CeilingFanMotor'
SoundRadius=12
SoundVolume=160
AmbientSound=Sound'DeusExSounds.Generic.MotorHum'
CollisionRadius=12.000000
CollisionHeight=4.420000
bCollideWorld=False
Mass=50.000000
Buoyancy=30.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_WoodBrass: Skin = Texture'CeilingFanTex1'; break;
case SC_DarkWoodIron: Skin = Texture'CeilingFanTex2'; break;
case SC_White: Skin = Texture'CeilingFanTex3'; break;
case SC_WoodBrassFancy: Skin = Texture'CeilingFanTex4'; break;
case SC_WoodPlastic: Skin = Texture'CeilingFanTex5'; break;
}




Chad.uc (extends HumanThug)

CarcassType=Class'DeusEx.ChadCarcass'
WalkingSpeed=0.213333
bImportant=True
walkAnimMult=0.500000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S'
DrawScale=1.050000
MultiSkins(0)=Texture'DeusExCharacters.Skins.ChadTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ChadTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ChadTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ChadTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=21.000000
CollisionHeight=49.880001
BindName="Chad"
FamiliarName="Chad"
UnfamiliarName="Chad"



ChadCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S_Carcass'
DrawScale=1.050000
MultiSkins(0)=Texture'DeusExCharacters.Skins.ChadTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ChadTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ChadTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ChadTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=42.000000
CollisionHeight=7.350000



Chair1.uc (extends Seat)

sitPoint(0)=(X=0.000000,Y=-6.000000,Z=-4.500000)
ItemName="Chair"
Mesh=LodMesh'DeusExDeco.Chair1'
CollisionRadius=23.000000
CollisionHeight=33.169998
Mass=30.000000
Buoyancy=5.000000



ChairLeather.uc (extends Seat)

var() ESkinColor SkinColor;
sitPoint(0)=(X=0.000000,Y=-8.000000,Z=0.000000)
ItemName="Comfy Chair"
Mesh=LodMesh'DeusExDeco.ChairLeather'
CollisionRadius=33.500000
CollisionHeight=23.250000
Mass=100.000000
Buoyancy=110.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Black: Skin = Texture'ChairLeatherTex1'; break;
case SC_Blue: Skin = Texture'ChairLeatherTex1'; break;
case SC_Brown: Skin = Texture'ChairLeatherTex1'; break;
case SC_LitGray: Skin = Texture'ChairLeatherTex1'; break;
case SC_Tan: Skin = Texture'ChairLeatherTex1'; break;
}




Chandelier.uc (extends HangingDecoration)

bNoPitch=True
FragType=Class'DeusEx.GlassFragment'
ItemName="Chandelier"
Mesh=LodMesh'DeusExDeco.Chandelier'
PrePivot=(Z=20.480000)
CollisionRadius=17.500000
CollisionHeight=20.480000
Mass=30.000000
Buoyancy=25.000000



CharacterModelButton.uc (extends ButtonWindow)

var Texture modelTexture;

DrawWindow (GC gc)


gc.SetStyle(DSTY_Masked);
gc.DrawIcon(-38, 17, modelTexture);

InitWindow


Super.InitWindow();

SetSize(179, 295);
SetSensitivity(False);

SetModelTexture (Texture newTexture)


modelTexture = newTexture;




ChargedPickup.uc (extends DeusExPickup)

var() class skillNeeded;
var() bool bOneUseOnly;
var() sound ActivateSound;
var() sound DeactivateSound;
var() sound LoopSound;
var Texture ChargedIcon;
var travel bool bIsActive;
var localized String ChargeRemainingLabel;
bOneUseOnly=True
ActivateSound=Sound'DeusExSounds.Pickup.PickupActivate'
DeActivateSound=Sound'DeusExSounds.Pickup.PickupDeactivate'
ChargeRemainingLabel="Charge remaining:"
bActivatable=True
Charge=2000

Activate


// if this is a single-use item, don't allow the player to turn it off
if (bOneUseOnly)
return;

Super.Activate();

BeginState


local DeusExPlayer Player;


Super.BeginState();

Player = DeusExPlayer(Owner);
if (Player != None)
{
// remove it from our inventory, but save our owner info
if (bOneUseOnly)
{
// Player.DeleteInventory(Self);

// Remove from player's hand
Player.PutInHand(None);

SetOwner(Player);
}

ChargedPickupBegin(Player);
SetTimer(0.1, True);
}

CalcChargeDrain (DeusExPlayer Player) -> int


local float skillValue;
local float drain;


drain = 4.0;
skillValue = 1.0;

if (skillNeeded != None)
skillValue = Player.SkillSystem.GetSkillLevelValue(skillNeeded);
drain *= skillValue;

return Int(drain);

ChargedPickupBegin (DeusExPlayer Player)


Player.AddChargedDisplay(Self);
PlaySound(ActivateSound, SLOT_None);
if (LoopSound != None)
AmbientSound = LoopSound;

//DEUS_EX AMSD In multiplayer, remove it from the belt if the belt
//is the only inventory.
if ((Level.NetMode != NM_Standalone) && (Player.bBeltIsMPInventory))
{
if (DeusExRootWindow(Player.rootWindow) != None)
DeusExRootWindow(Player.rootWindow).DeleteInventory(self);

bInObjectBelt=False;
BeltPos=default.BeltPos;
}

bIsActive = True;

ChargedPickupEnd (DeusExPlayer Player)


Player.RemoveChargedDisplay(Self);
PlaySound(DeactivateSound, SLOT_None);
if (LoopSound != None)
AmbientSound = None;

// remove it from our inventory if this is a one
// use item
if (bOneUseOnly)
Player.DeleteInventory(Self);

bIsActive = False;

ChargedPickupUpdate (DeusExPlayer Player)

EndState


local DeusExPlayer Player;


Super.EndState();

Player = DeusExPlayer(Owner);
if (Player != None)
{
ChargedPickupEnd(Player);
SetTimer(0.1, False);
}

GetCurrentCharge -> Float


return (Float(Charge) / Float(Default.Charge)) * 100.0;

IsActive -> bool


return bIsActive;

Timer


local DeusExPlayer Player;


Player = DeusExPlayer(Owner);
if (Player != None)
{
ChargedPickupUpdate(Player);
Charge -= CalcChargeDrain(Player);
if (Charge <= 0)
UsedUp();
}

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;
local DeusExPlayer player;
local String outText;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

player = DeusExPlayer(Owner);

if (player != None)
{
winInfo.SetTitle(itemName);
winInfo.SetText(Description $ winInfo.CR() $ winInfo.CR());

outText = ChargeRemainingLabel @ Int(GetCurrentCharge()) $ "%";
winInfo.AppendText(outText);
}

return True;

UsedUp


local DeusExPlayer Player;


if ( Pawn(Owner) != None )
{
bActivatable = false;
Pawn(Owner).ClientMessage(ExpireMessage);
}
Owner.PlaySound(DeactivateSound);
Player = DeusExPlayer(Owner);

if (Player != None)
{
if (Player.inHand == Self)
ChargedPickupEnd(Player);
}

Destroy();




Chef.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.ChefCarcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ChefTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex10'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ChefTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ChefTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ChefTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.ChefTex3'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Chef"
FamiliarName="Chef"
UnfamiliarName="Chef"



ChefCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ChefTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex10'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ChefTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ChefTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ChefTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.ChefTex3'



ChildMale.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.ChildMaleCarcass'
WalkingSpeed=0.256000
walkAnimMult=1.150000
GroundSpeed=150.000000
BaseEyeHeight=26.000000
HealthHead=50
HealthTorso=50
HealthLegLeft=50
HealthLegRight=50
HealthArmLeft=50
HealthArmRight=50
Mesh=LodMesh'DeusExCharacters.GMK_DressShirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ChildMaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ChildMaleTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ChildMaleTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ChildMaleTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=17.000000
CollisionHeight=32.500000
Mass=80.000000
Buoyancy=85.000000
BindName="Child"
FamiliarName="Child"
UnfamiliarName="Child"



ChildMale2.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.ChildMale2Carcass'
WalkingSpeed=0.256000
walkAnimMult=1.150000
GroundSpeed=150.000000
BaseEyeHeight=26.000000
HealthHead=50
HealthTorso=50
HealthLegLeft=50
HealthLegRight=50
HealthArmLeft=50
HealthArmRight=50
Mesh=LodMesh'DeusExCharacters.GMK_DressShirt_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ChildMale2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ChildMale2Tex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ChildMale2Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ChildMale2Tex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ChildMale2Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=17.000000
CollisionHeight=32.500000
Mass=80.000000
Buoyancy=85.000000
BindName="Child2"
FamiliarName="Child"
UnfamiliarName="Child"



ChildMale2Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GMK_DressShirt_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GMK_DressShirt_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GMK_DressShirt_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ChildMale2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ChildMale2Tex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ChildMale2Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ChildMale2Tex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ChildMale2Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=34.000000
CollisionHeight=5.000000



ChildMaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GMK_DressShirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GMK_DressShirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GMK_DressShirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ChildMaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ChildMaleTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ChildMaleTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ChildMaleTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=34.000000
CollisionHeight=5.000000



CigaretteMachine.uc (extends ElectronicDevices)

var localized String msgDispensed;
var localized String msgNoCredits;
var int numUses;
var localized String msgEmpty;
msgDispensed="8 credits deducted from your account"
msgNoCredits="Costs 8 credits..."
numUses=10
msgEmpty="It's empty"
ItemName="Cigarette Machine"
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.CigaretteMachine'
SoundRadius=8
SoundVolume=96
AmbientSound=Sound'Ambient.Ambient.HumLight3'
CollisionRadius=27.000000
CollisionHeight=26.320000
Mass=150.000000
Buoyancy=100.000000

Frob (actor Frobber, Inventory frobWith)


local DeusExPlayer player;
local Vector loc;
local Pickup product;


Super.Frob(Frobber, frobWith);

player = DeusExPlayer(Frobber);

if (player != None)
{
if (numUses <= 0)
{
player.ClientMessage(msgEmpty);
return;
}

if (player.Credits >= 8)
{
PlaySound(sound'VendingCoin', SLOT_None);
loc = Vector(Rotation) * CollisionRadius * 0.8;
loc.Z -= CollisionHeight * 0.6;
loc += Location;

product = Spawn(class'Cigarettes', None,, loc);

if (product != None)
{
PlaySound(sound'VendingSmokes', SLOT_None);
product.Velocity = Vector(Rotation) * 100;
product.bFixedRotationDir = True;
product.RotationRate.Pitch = (32768 - Rand(65536)) * 4.0;
product.RotationRate.Yaw = (32768 - Rand(65536)) * 4.0;
}

player.Credits -= 8;
player.ClientMessage(msgDispensed);
numUses--;
}
else
player.ClientMessage(msgNoCredits);
}




Cigarettes.uc (extends DeusExPickup)

maxCopies=20
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Cigarettes"
ItemArticle="some"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.Cigarettes'
PickupViewMesh=LodMesh'DeusExItems.Cigarettes'
ThirdPersonMesh=LodMesh'DeusExItems.Cigarettes'
Icon=Texture'DeusExUI.Icons.BeltIconCigarettes'
largeIcon=Texture'DeusExUI.Icons.LargeIconCigarettes'
largeIconWidth=29
largeIconHeight=43
Description="'COUGHING NAILS -- when you've just got to have a cigarette.'"
beltDescription="CIGS"
Mesh=LodMesh'DeusExItems.Cigarettes'
CollisionRadius=5.200000
CollisionHeight=1.320000
Mass=2.000000
Buoyancy=3.000000

Activate


// can't turn it off

BeginState


local Pawn P;
local vector loc;
local rotator rot;
local SmokeTrail puff;


Super.BeginState();

P = Pawn(Owner);
if (P != None)
{
P.TakeDamage(5, P, P.Location, vect(0,0,0), 'PoisonGas');
loc = Owner.Location;
rot = Owner.Rotation;
loc += 2.0 * Owner.CollisionRadius * vector(P.ViewRotation);
loc.Z += Owner.CollisionHeight * 0.9;
puff = Spawn(class'SmokeTrail', Owner,, loc, rot);
if (puff != None)
{
puff.DrawScale = 1.0;
puff.origScale = puff.DrawScale;
}
PlaySound(sound'MaleCough');
}

UseOnce();




CinematicWindow.uc (extends Window)

ConfigurationChanged


SetRootViewport();

DestroyWindow


ResetRootViewport();

Super.DestroyWindow();

InitWindow


Super.InitWindow();

SetWindowAlignments(HALIGN_Full, VALIGN_Full);

ResetRootViewport


local RootWindow root;


root = GetRootWindow();
root.ResetRenderViewport();

SetRootViewport


local RootWindow root;
local float cinWidth, cinHeight;
local float cinX, cinY;
local float ratio;


root = GetRootWindow();

// calculate the correct 16:9 ratio
ratio = 0.5625 * (root.width / root.height);

cinWidth = root.width;
cinHeight = root.height * ratio;
cinX = 0;
cinY = int(0.5 * (root.height - cinHeight));

// make sure we don't invert the letterbox if the screen size is strange
if (cinY < 0)
root.ResetRenderViewport();
else
root.SetRenderViewport(cinX, cinY, cinWidth, cinHeight);

VisibilityChanged (bool bNewVisibility)


Super.VisibilityChanged( bNewVisibility );

if (bNewVisibility)
SetRootViewport();
else
ResetRootViewport();




CleanerBot.uc (extends Robot)

var float blotchTimer;
var float fleePawnTimer;
var ECleanDirection minorDir;
var ECleanDirection majorDir;
majorDir=CLEANDIR_East
EMPHitPoints=20
WalkingSpeed=0.200000
GroundSpeed=300.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
Health=20
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.CleanerBot'
SoundRadius=16
SoundVolume=128
AmbientSound=Sound'DeusExSounds.Robot.CleanerBotMove'
CollisionRadius=18.000000
CollisionHeight=11.210000
Mass=70.000000
Buoyancy=97.000000
RotationRate=(Yaw=100000)
BindName="CleanerBot"
FamiliarName="Cleaner Bot"
UnfamiliarName="Cleaner Bot"

BeginState


Super.BeginState();

Bump (actor bumper)


if (bAcceptBump)
{
// If we get bumped by another actor while we wait, start wandering again
bAcceptBump = False;
Disable('AnimEnd');
GotoState('Wandering', 'Wander');
}

// Handle conversations, if need be
Global.Bump(bumper);

EndState


Super.EndState();

FleeFromPawn (Pawn fleePawn)


SetEnemy(fleePawn, , true);
GotoState('AvoidingPawn');

FrightenedByPawn -> Pawn


local pawn candidate;
local bool bCheck;
local Pawn fearPawn;


fearPawn = None;
if (!bBlockActors && !bBlockPlayers)
return fearPawn;

foreach RadiusActors(Class'Pawn', candidate, 500)
{
bCheck = false;
if (!ClassIsChildOf(candidate.Class, Class))
{
if (candidate.bBlockActors)
{
if (bBlockActors && !candidate.bIsPlayer)
bCheck = true;
else if (bBlockPlayers && candidate.bIsPlayer)
bCheck = true;
}
}

if (bCheck)
{
if ((candidate.MaxStepHeight < CollisionHeight*1.5) && (candidate.CollisionHeight*0.5 <= CollisionHeight))
bCheck = false;
}

if (bCheck)
{
if (ShouldBeStartled(candidate))
{
fearPawn = candidate;
break;
}
}
}

return fearPawn;

GetReverseDirection (ECleanDirection cleanDir) -> ECleanDirection


if (cleanDir == CLEANDIR_North)
cleanDir = CLEANDIR_South;
else if (cleanDir == CLEANDIR_South)
cleanDir = CLEANDIR_North;
else if (cleanDir == CLEANDIR_East)
cleanDir = CLEANDIR_West;
else if (cleanDir == CLEANDIR_West)
cleanDir = CLEANDIR_East;

return (cleanDir);

HitWall (vector HitNormal, actor Wall)


if (Physics == PHYS_Falling)
return;
Global.HitWall(HitNormal, Wall);
CheckOpenDoor(HitNormal, Wall);

PickDestination


local Rotator rot;
local float minorMagnitude, majorMagnitude;
local float minDist;


MoveTarget = None;
destPoint = None;

minorMagnitude = 256;
majorMagnitude = CollisionRadius*2;
minDist = 24;

rot = RotationDir(minorDir);
if (!AIDirectionReachable(Location, rot.Yaw, rot.Pitch,
minDist, minorMagnitude, destLoc))
{
minorDir = GetReverseDirection(minorDir);
rot = RotationDir(majorDir);
if (!AIDirectionReachable(Location, rot.Yaw, rot.Pitch,
minDist, majorMagnitude, destLoc))
{
majorDir = GetReverseDirection(majorDir);
rot = RotationDir(minorDir);
if (!AIDirectionReachable(Location, rot.Yaw, rot.Pitch,
minDist, minorMagnitude, destLoc))
{
minorDir = GetReverseDirection(minorDir);
rot = RotationDir(majorDir);
if (!AIDirectionReachable(Location, rot.Yaw, rot.Pitch,
minDist, majorMagnitude, destLoc))
{
majorDir = GetReverseDirection(majorDir);
destLoc = Location; // give up
}
}
}
}

RotationDir (ECleanDirection cleanDir) -> rotator


local rotator rot;


rot = rot(0,0,0);
if (cleanDir == CLEANDIR_North)
rot.Yaw = 0;
else if (cleanDir == CLEANDIR_South)
rot.Yaw = 32768;
else if (cleanDir == CLEANDIR_East)
rot.Yaw = 16384;
else if (cleanDir == CLEANDIR_West)
rot.Yaw = 49152;

return (rot);

SetFall


StartFalling('Wandering', 'ContinueWander');

ShouldBeStartled (Pawn startler) -> bool


local float speed;
local float time;
local float dist;
local float dist2;
local bool bPh33r;


bPh33r = false;
if (IsValidEnemy(startler, False))
{
speed = VSize(startler.Velocity);
if (speed >= 20)
{
dist = VSize(Location - startler.Location);
time = dist/speed;
if (time <= 2.0)
{
dist2 = VSize(Location - (startler.Location+startler.Velocity*time));
if (dist2 < speed*0.8)
bPh33r = true;
}
}
}

return bPh33r;

Tick (float deltaSeconds)


local pawn fearPawn;
local DeusExDecal blotch;
local float deltaXY, deltaZ;


Super.Tick(deltaSeconds);

fleePawnTimer += deltaSeconds;
if (fleePawnTimer > 0.5)
{
fleePawnTimer = 0;
fearPawn = FrightenedByPawn();
if (fearPawn != None)
FleeFromPawn(fearPawn);
}

blotchTimer += deltaSeconds;
if (blotchTimer > 0.3)
{
blotchTimer = 0;
foreach RadiusActors(Class'DeusExDecal', blotch, CollisionRadius*2)
{
deltaXY = VSize((blotch.Location-Location)*vect(1,1,0));
deltaZ = blotch.Location.Z - Location.Z;
if ((deltaXY <= CollisionRadius*1.2) && (deltaZ < 0) && (deltaZ > -(CollisionHeight+10)))
blotch.Destroy();
}
}




ClothesRack.uc (extends HangingDecoration)

var() ESkinColor SkinColor;
FragType=Class'DeusEx.PaperFragment'
ItemName="Hanging Clothes"
Mesh=LodMesh'DeusExDeco.ClothesRack'
PrePivot=(Z=24.750000)
CollisionRadius=13.000000
CollisionHeight=24.750000
Mass=60.000000
Buoyancy=70.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Blue: Skin = Texture'ClothesRackTex1'; break;
case SC_Yellow: Skin = Texture'ClothesRackTex2'; break;
case SC_Green: Skin = Texture'ClothesRackTex3'; break;
case SC_Black: Skin = Texture'ClothesRackTex4'; break;
}




Cloud.uc (extends DeusExProjectile)

var bool bFloating;
var float cloudRadius;
var float damageInterval;
var vector CloudLocation; //to make sure location is updated w/o making it dumb proxy
cloudRadius=128.000000
damageInterval=1.000000
blastRadius=1.000000
DamageType=PoisonGas
AccurateRange=100
maxRange=100
maxDrawScale=5.000000
bIgnoresNanoDefense=True
ItemName="Gas Cloud"
ItemArticle="a"
speed=300.000000
MaxSpeed=300.000000
Damage=1.000000
MomentumTransfer=100
LifeSpan=1.000000
DrawType=DT_Sprite
Style=STY_Translucent
Texture=None
DrawScale=0.010000
bUnlit=True
CollisionRadius=16.000000
CollisionHeight=16.000000

BeginPlay


Super.BeginPlay();

// set the cloud damage timer
SetTimer(damageInterval, True);

HitWall (vector HitNormal, actor Wall)


// do nothing
Velocity = vect(0,0,0);

ProcessTouch (Actor Other, Vector HitLocation)


// do nothing

Tick (float deltaTime)


local float value;
local float sizeMult;
local float NewDrawScale;


if (Role == ROLE_Authority)
CloudLocation = Location;
else
SetLocation(CloudLocation);

// don't Super.Tick() becuase we don't want gravity to affect the stream
time += deltaTime;

value = 1.0+time;
if (MinDrawScale > 0)
sizeMult = MaxDrawScale/MinDrawScale;
else
sizeMult = 1;

// DEUS_EX AMSD Update drawscale less often in mp, to reduce bandwidth hit.
// Effect won't look quite as good for listen server client... but will otherwise
// help tremendously (one gas grenade was 3k a sec in traffic).
NewDrawScale = (-sizeMult/(value*value) + (sizeMult+1))*MinDrawScale;

if (Level.Netmode == NM_Standalone)
{
DrawScale = NewDrawScale;
}
else if (Level.Netmode == NM_Client)
{
DrawScale = NewDrawScale;
}
else if (Level.Netmode == NM_DedicatedServer)
{
//Do nothing
}
else
{
//On a listen server, just start it full size.
DrawScale = (-sizeMult/(50*50) + (sizeMult+1))*MinDrawScale;
}

// DrawScale = (-sizeMult/(value*value) + (sizeMult+1))*MinDrawScale;
if (Role == ROLE_Authority)
ScaleGlow = FClamp(LifeSpan*0.5, 0.0, 1.0);

// make it swim around a bit at random
if (bFloating)
{
Acceleration = VRand() * 15;
Acceleration.Z = 0;
}

Timer


local Actor A;
local Vector offset, dist;
local Pawn apawn;


if ( Level.NetMode != NM_Standalone )
{
// Use PawnList for multiplayer
apawn = Level.PawnList;
while ( apawn != None )
{
dist = apawn.Location - Location;
if ( VSize(dist) < cloudRadius )
{
offset = apawn.Location;
apawn.TakeDamage( Damage, Instigator, offset, vect(0,0,0), damageType );
}
apawn = apawn.nextPawn;
}
}
else
{
// check to see if anything has entered our effect radius
// don't damage our owner
foreach VisibleActors(class'Actor', A, cloudRadius)
if (A != Owner)
{
// be sure to damage the torso
offset = A.Location;
A.TakeDamage(Damage, Instigator, offset, vect(0,0,0), damageType);
}
}

ZoneChange (ZoneInfo NewZone)


Super.ZoneChange(NewZone);

// clouds can't live underwater, so kill us quickly if we enter the water
if ((NewZone.bWaterZone) && (LifeSpan > 2.0))
LifeSpan = 2.0;




CoffeeTable.uc (extends Furniture)

var() ESkinColor SkinColor;
bCanBeBase=True
ItemName="Coffee Table"
Mesh=LodMesh'DeusExDeco.CoffeeTable'
CollisionRadius=34.750000
CollisionHeight=13.680000
Mass=80.000000
Buoyancy=25.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_WhiteMarble: Skin = Texture'CoffeeTableTex1'; break;
case SC_BlackMarble: Skin = Texture'CoffeeTableTex2'; break;
case SC_GrayMarble: Skin = Texture'CoffeeTableTex3'; break;
}




ColorTheme.uc (extends Actor)

var EColorThemeTypes themeType;
var String themeName;
var Bool bSystemTheme; // Cannot delete these
var Name colorNames[15];
var Color colors[15];
var travel ColorTheme next;
var Color colBad; // Used when invalid index or color requested
colBad=(R=255,B=255)
bHidden=True
bTravel=True
NetUpdateFrequency=1.000000

GetColor (Int colorIndex) -> Color


if ((colorIndex >= 0) && (colorIndex < arrayCount(colorNames)))
return colors[colorIndex];
else
return colBad;

GetColorCount -> int


local int colorIndex;


for(colorIndex=0; colorIndex {
if (colorNames[colorIndex] == '')
break;
}

return colorIndex;

GetColorFromName (Name colorName) -> Color


local int colorIndex;


colorIndex = GetColorIndex(colorName);

if (colorIndex != -1)
return colors[colorIndex];
else
return colBad;

GetColorIndex (Name colorName) -> int


local int colorIndex;
local bool bColorNameFound;


for(colorIndex=0; colorIndex {
if (colorNames[colorIndex] == colorName)
{
bColorNameFound = True;
break;
}
}

if (bColorNameFound)
return colorIndex;
else
return -1;

GetColorName (Int colorIndex) -> Name


if ((colorIndex >= 0) && (colorIndex < arrayCount(colorNames)))
return colorNames[colorIndex];
else
return '';

GetThemeName -> String


return themeName;

IsSystemTheme -> Bool


return bSystemTheme;

ResetThemeToDefault


local int colorIndex;


for(colorIndex=0; colorIndex {
if (colorNames[colorIndex] != '')
colors[colorIndex] = default.colors[colorIndex];
}

SetColor (Int colorIndex, Color newColor)


if ((colorIndex >= 0) && (colorIndex < arrayCount(colorNames)))
{
colors[colorIndex] = newColor;
}

SetColorFromName (Name colorName, Color newColor)


local int colorIndex;


colorIndex = GetColorIndex(colorName);

if (colorIndex != -1)
SetColor(colorIndex, newColor);

SetThemeName (String newThemeName)


themeName = newThemeName;




ColorThemeHUD.uc (extends ColorTheme)

themeType=CTT_HUD
colorNames(0)=HUDColor_Background
colorNames(1)=HUDColor_Borders
colorNames(2)=HUDColor_TitleText
colorNames(3)=HUDColor_ButtonFace
colorNames(4)=HUDColor_ButtonTextNormal
colorNames(5)=HUDColor_ButtonTextFocus
colorNames(6)=HUDColor_ButtonTextDisabled
colorNames(7)=HUDColor_HeaderText
colorNames(8)=HUDColor_NormalText
colorNames(9)=HUDColor_ListText
colorNames(10)=HUDColor_ListTextHighlight
colorNames(11)=HUDColor_ListHighlight
colorNames(12)=HUDColor_ListFocus
colorNames(13)=HUDColor_Cursor



ColorThemeHUD_Amber.uc (extends ColorThemeHUD)

themeName="Amber"
bSystemTheme=True
Colors(0)=(R=139,G=105,B=35)
Colors(1)=(R=185,G=177,B=140)
Colors(2)=(R=255,G=255)
Colors(3)=(R=139,G=105,B=35)
Colors(4)=(R=202,G=158,B=73)
Colors(5)=(R=255,G=233,B=177)
Colors(6)=(R=86,G=83,B=35)
Colors(7)=(R=255,G=233,B=177)
Colors(8)=(R=202,G=158,B=73)
Colors(9)=(R=202,G=158,B=73)
Colors(10)=(R=200,G=200,B=200)
Colors(11)=(R=128,G=128,B=128)
Colors(12)=(R=255,G=255,B=255)
Colors(13)=(R=185,G=177,B=140)



ColorThemeHUD_Cops.uc (extends ColorThemeHUD)

themeName="Cops"
bSystemTheme=True
Colors(0)=(R=255,G=255,B=255)
Colors(1)=(B=255)
Colors(2)=(R=190,G=190,B=190)
Colors(3)=(R=255,G=255,B=255)
Colors(4)=(R=255,G=255,B=255)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(B=255)
Colors(7)=(R=255,G=255,B=255)
Colors(8)=(R=255,G=255,B=255)
Colors(9)=(R=255,G=255,B=255)
Colors(10)=(R=255,G=255,B=255)
Colors(11)=(B=78)
Colors(12)=(R=255,G=255,B=255)
Colors(13)=(R=255,G=255,B=255)



ColorThemeHUD_Cyan.uc (extends ColorThemeHUD)

themeName="Cyan"
bSystemTheme=True
Colors(0)=(G=125,B=125)
Colors(1)=(R=127,G=255,B=255)
Colors(2)=(R=125,G=255,B=255)
Colors(3)=(G=125,B=125)
Colors(4)=(R=100,G=200,B=200)
Colors(5)=(R=125,G=255,B=255)
Colors(6)=(R=64,G=64,B=64)
Colors(7)=(R=125,G=255,B=255)
Colors(8)=(R=100,G=200,B=200)
Colors(9)=(R=100,G=200,B=200)
Colors(10)=(R=200,G=200,B=200)
Colors(11)=(R=128,G=128,B=128)
Colors(12)=(R=255,G=255,B=255)
Colors(13)=(R=127,G=255,B=255)



ColorThemeHUD_DarkBlue.uc (extends ColorThemeHUD)

themeName="Dark Blue"
bSystemTheme=True
Colors(0)=(R=26,G=26,B=255)
Colors(1)=(R=137,G=105,B=185)
Colors(2)=(R=121,G=214,B=255)
Colors(3)=(R=26,G=26,B=255)
Colors(4)=(R=137,G=249,B=255)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=26,G=57,B=150)
Colors(7)=(R=131,G=214,B=255)
Colors(8)=(R=107,G=193,B=255)
Colors(9)=(R=107,G=193,B=255)
Colors(10)=(R=255,G=255,B=255)
Colors(11)=(R=2,G=77,B=113)
Colors(12)=(R=255,G=255,B=255)
Colors(13)=(R=137,G=105,B=185)



ColorThemeHUD_Default.uc (extends ColorThemeHUD)

themeName="Default"
bSystemTheme=True
Colors(0)=(R=127,G=127,B=127)
Colors(1)=(R=255,G=255,B=255)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(R=127,G=127,B=127)
Colors(4)=(R=200,G=200,B=200)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=64,G=64,B=64)
Colors(7)=(R=255,G=255,B=255)
Colors(8)=(R=200,G=200,B=200)
Colors(9)=(R=200,G=200,B=200)
Colors(10)=(R=200,G=200,B=200)
Colors(11)=(R=128,G=128,B=128)
Colors(12)=(R=255,G=255,B=255)
Colors(13)=(R=255,G=255,B=255)



ColorThemeHUD_DesertStorm.uc (extends ColorThemeHUD)

themeName="Desert Storm"
bSystemTheme=True
Colors(0)=(R=255,G=155,B=105)
Colors(1)=(R=255,G=255,B=255)
Colors(2)=(R=255,G=155,B=105)
Colors(3)=(R=255,G=155,B=105)
Colors(4)=(R=255,G=255,B=255)
Colors(5)=(R=255,G=155,B=105)
Colors(6)=(R=255,G=155,B=105)
Colors(7)=(R=255,G=155,B=105)
Colors(8)=(R=255,G=155,B=105)
Colors(9)=(R=255,G=155,B=105)
Colors(10)=(R=124,G=29)
Colors(11)=(R=255,G=155,B=105)
Colors(12)=(R=255,G=155,B=105)
Colors(13)=(R=255,G=155,B=105)



ColorThemeHUD_DriedBlood.uc (extends ColorThemeHUD)

themeName="Dried Blood"
bSystemTheme=True
Colors(0)=(R=198,G=129,B=139)
Colors(1)=(R=194)
Colors(2)=(R=102)
Colors(3)=(R=198,G=129,B=139)
Colors(4)=(R=200,G=73)
Colors(5)=(R=255)
Colors(6)=(R=64)
Colors(7)=(R=120)
Colors(8)=(R=200,G=21)
Colors(9)=(R=140)
Colors(10)=(R=150,G=88)
Colors(11)=(R=33)
Colors(12)=(R=255,G=255,B=255)
Colors(13)=(R=255,G=255,B=255)



ColorThemeHUD_Dusk.uc (extends ColorThemeHUD)

themeName="Dusk"
bSystemTheme=True
Colors(0)=(R=255,G=182,B=255)
Colors(1)=(R=255,G=182,B=255)
Colors(2)=(R=255,G=135)
Colors(3)=(R=255,G=182,B=255)
Colors(4)=(R=255,B=255)
Colors(5)=(R=255,G=175)
Colors(6)=(R=91,B=92)
Colors(7)=(R=255,G=175)
Colors(8)=(R=255,G=175)
Colors(9)=(R=255,G=255,B=255)
Colors(10)=(R=255,G=175)
Colors(11)=(R=84,B=84)
Colors(12)=(R=255,G=182,B=255)
Colors(13)=(R=255,G=182,B=255)



ColorThemeHUD_Grey.uc (extends ColorThemeHUD)

themeName="Grey"
bSystemTheme=True
Colors(0)=(R=127,G=127,B=127)
Colors(1)=(R=255,G=255,B=255)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(R=127,G=127,B=127)
Colors(4)=(R=200,G=200,B=200)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=64,G=64,B=64)
Colors(7)=(R=255,G=255,B=255)
Colors(8)=(R=200,G=200,B=200)
Colors(9)=(R=200,G=200,B=200)
Colors(10)=(R=200,G=200,B=200)
Colors(11)=(R=128,G=128,B=128)
Colors(12)=(R=255,G=255,B=255)
Colors(13)=(R=255,G=255,B=255)



ColorThemeHUD_IonStorm.uc (extends ColorThemeHUD)

themeName="Ion Storm"
bSystemTheme=True
Colors(0)=(G=100)
Colors(1)=(G=255)
Colors(2)=(G=255)
Colors(3)=(G=100)
Colors(4)=(G=200)
Colors(5)=(G=255)
Colors(7)=(G=255)
Colors(8)=(G=145)
Colors(9)=(R=200,G=255,B=200)
Colors(10)=(G=200)
Colors(12)=(G=255)
Colors(13)=(R=255,G=255,B=255)



ColorThemeHUD_Nightvision.uc (extends ColorThemeHUD)

themeName="Night Vision"
bSystemTheme=True
Colors(0)=(G=78)
Colors(1)=(G=255)
Colors(2)=(R=255)
Colors(3)=(G=78)
Colors(4)=(R=123)
Colors(5)=(R=255)
Colors(7)=(G=255)
Colors(8)=(G=159)
Colors(9)=(R=104)
Colors(11)=(R=128)
Colors(12)=(R=244)
Colors(13)=(R=255,G=201,B=191)



ColorThemeHUD_Ninja.uc (extends ColorThemeHUD)

themeName="Ninja"
bSystemTheme=True
Colors(0)=(R=100,G=100,B=100)
Colors(1)=(R=255,G=255,B=255)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(R=100,G=100,B=100)
Colors(4)=(R=128,G=128,B=128)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=64,G=64,B=64)
Colors(7)=(R=255,G=255,B=255)
Colors(8)=(R=200,G=200,B=200)
Colors(9)=(R=200,G=200,B=200)
Colors(10)=(R=200,G=200,B=200)
Colors(12)=(R=220,G=220,B=220)
Colors(13)=(R=255,G=255,B=255)



ColorThemeHUD_PaleGreen.uc (extends ColorThemeHUD)

themeName="Pale Green"
bSystemTheme=True
Colors(0)=(R=137,G=155,B=56)
Colors(1)=(R=239,G=255,B=175)
Colors(2)=(R=239,G=255,B=191)
Colors(3)=(R=137,G=155,B=56)
Colors(4)=(R=169,G=255,B=151)
Colors(5)=(R=239,G=255,B=191)
Colors(6)=(R=56,G=69)
Colors(7)=(R=239,G=255,B=191)
Colors(8)=(R=169,G=255,B=151)
Colors(9)=(R=169,G=255,B=151)
Colors(10)=(R=200,G=200,B=200)
Colors(11)=(R=128,G=128,B=128)
Colors(12)=(R=255,G=255,B=255)
Colors(13)=(R=239,G=255,B=175)



ColorThemeHUD_Pastel.uc (extends ColorThemeHUD)

themeName="Pastel"
bSystemTheme=True
Colors(0)=(R=207,G=255,B=212)
Colors(1)=(R=204,G=223,B=255)
Colors(2)=(R=255,G=255,B=124)
Colors(3)=(R=207,G=255,B=212)
Colors(4)=(R=200,G=199,B=77)
Colors(5)=(R=255,G=145,B=255)
Colors(6)=(R=64,G=64,B=200)
Colors(7)=(R=255,G=255,B=132)
Colors(8)=(R=200,G=126,B=200)
Colors(9)=(R=200,G=118,B=200)
Colors(10)=(R=255,G=255,B=112)
Colors(11)=(R=128,G=151,B=124)
Colors(12)=(R=255,G=255,B=100)
Colors(13)=(R=255,G=255,B=255)



ColorThemeHUD_Plasma.uc (extends ColorThemeHUD)

themeName="Plasma"
bSystemTheme=True
Colors(0)=(R=107)
Colors(1)=(R=107)
Colors(2)=(R=107)
Colors(3)=(R=107)
Colors(4)=(R=134)
Colors(5)=(R=199,G=118)
Colors(6)=(R=201,G=40)
Colors(7)=(R=255,G=121,B=18)
Colors(8)=(R=255,G=105)
Colors(9)=(R=255,G=96)
Colors(11)=(R=255,G=94)
Colors(12)=(R=255)
Colors(13)=(R=255,G=155,B=105)



ColorThemeHUD_Primaries.uc (extends ColorThemeHUD)

themeName="Primaries"
bSystemTheme=True
Colors(0)=(B=80)
Colors(1)=(R=177)
Colors(2)=(R=100)
Colors(3)=(B=80)
Colors(4)=(R=200,G=200)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(B=97)
Colors(7)=(R=255,G=255)
Colors(8)=(R=200,G=200)
Colors(9)=(R=131)
Colors(10)=(R=137,G=121)
Colors(11)=(R=64)
Colors(12)=(R=255)
Colors(13)=(R=255,G=255,B=255)



ColorThemeHUD_Purple.uc (extends ColorThemeHUD)

themeName="Purple"
bSystemTheme=True
Colors(0)=(R=166,G=24,B=137)
Colors(1)=(R=255,G=207,B=236)
Colors(2)=(R=255,G=201,B=237)
Colors(3)=(R=166,G=24,B=137)
Colors(4)=(R=207,G=135,B=190)
Colors(5)=(R=255,G=201,B=237)
Colors(6)=(R=69,G=21,B=72)
Colors(7)=(R=255,G=201,B=237)
Colors(8)=(R=207,G=135,B=190)
Colors(9)=(R=207,G=135,B=190)
Colors(10)=(R=255,G=233,B=247)
Colors(11)=(R=115,G=11,B=88)
Colors(12)=(R=255,G=209,B=236)
Colors(13)=(R=255,G=207,B=236)



ColorThemeHUD_Red.uc (extends ColorThemeHUD)

themeName="Red"
bSystemTheme=True
Colors(0)=(R=230,G=20,B=10)
Colors(1)=(R=255,G=201,B=191)
Colors(2)=(R=255,G=194,B=185)
Colors(3)=(R=230,G=20,B=10)
Colors(4)=(R=200,G=143,B=135)
Colors(5)=(R=255,G=194,B=185)
Colors(6)=(R=97,G=33,B=33)
Colors(7)=(R=255,G=194,B=185)
Colors(8)=(R=200,G=143,B=135)
Colors(9)=(R=200,G=143,B=135)
Colors(10)=(R=200,G=200,B=200)
Colors(11)=(R=128,G=128,B=128)
Colors(12)=(R=255,G=255,B=255)
Colors(13)=(R=255,G=201,B=191)



ColorThemeHUD_SoylentGreen.uc (extends ColorThemeHUD)

themeName="SoylentGreen"
bSystemTheme=True
Colors(0)=(R=70,G=160,B=100)
Colors(1)=(R=70,G=160,B=100)
Colors(2)=(R=80,G=145,B=105)
Colors(3)=(R=70,G=160,B=100)
Colors(4)=(R=80,G=145,B=105)
Colors(5)=(R=160,G=160,B=160)
Colors(6)=(R=80,G=145,B=105)
Colors(7)=(R=70,G=160,B=100)
Colors(8)=(R=70,G=160,B=100)
Colors(9)=(R=80,G=145,B=105)
Colors(10)=(R=70,G=160,B=100)
Colors(11)=(B=30)
Colors(12)=(R=80,G=145,B=105)
Colors(13)=(R=80,G=145,B=105)



ColorThemeHUD_Starlight.uc (extends ColorThemeHUD)

themeName="Starlight"
bSystemTheme=True
Colors(0)=(R=27,G=56,B=86)
Colors(1)=(G=123,B=255)
Colors(2)=(R=27,G=120,B=193)
Colors(3)=(R=27,G=56,B=86)
Colors(4)=(R=11,G=54,B=161)
Colors(5)=(R=35,G=139,B=255)
Colors(7)=(G=150,B=255)
Colors(8)=(G=159,B=255)
Colors(9)=(R=14,G=182,B=255)
Colors(11)=(G=91,B=147)
Colors(12)=(B=196)
Colors(13)=(R=255,G=201,B=191)



ColorThemeHUD_SteelGreen.uc (extends ColorThemeHUD)

themeName="Steel Green"
bSystemTheme=True
Colors(0)=(R=100,G=155,B=159)
Colors(1)=(G=153,B=161)
Colors(2)=(R=255,G=255,B=139)
Colors(3)=(R=100,G=155,B=159)
Colors(4)=(R=177,G=255,B=212)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(G=64,B=64)
Colors(7)=(G=153,B=148)
Colors(8)=(R=8,G=129,B=135)
Colors(9)=(R=200,G=200,B=200)
Colors(10)=(G=54,B=64)
Colors(11)=(R=218,G=228,B=159)
Colors(12)=(G=96,B=89)
Colors(13)=(R=255,G=255,B=255)



ColorThemeHUD_Superhero.uc (extends ColorThemeHUD)

themeName="Superhero"
bSystemTheme=True
Colors(0)=(R=46,G=156,B=255)
Colors(1)=(R=255,G=155,B=105)
Colors(2)=(R=255,G=32)
Colors(3)=(R=46,G=156,B=255)
Colors(4)=(R=255,G=255,B=105)
Colors(5)=(R=255,G=29)
Colors(7)=(R=255,G=255,B=201)
Colors(8)=(R=255,G=32)
Colors(9)=(R=255,G=30)
Colors(11)=(R=255,G=255,B=209)
Colors(12)=(R=255)
Colors(13)=(R=255,G=155,B=105)



ColorThemeHUD_Terminator.uc (extends ColorThemeHUD)

themeName="Terminator"
bSystemTheme=True
Colors(0)=(R=128)
Colors(1)=(R=255,G=255,B=255)
Colors(2)=(R=255,G=2)
Colors(3)=(R=128)
Colors(4)=(G=123)
Colors(5)=(G=255)
Colors(7)=(R=255)
Colors(8)=(R=200)
Colors(9)=(G=129)
Colors(11)=(G=78)
Colors(12)=(G=255)
Colors(13)=(G=113)



ColorThemeHUD_Violet.uc (extends ColorThemeHUD)

themeName="Violet"
bSystemTheme=True
Colors(0)=(R=126,B=124)
Colors(1)=(B=199)
Colors(2)=(R=57,B=255)
Colors(3)=(R=126,B=124)
Colors(4)=(R=155,G=8,B=105)
Colors(5)=(R=24,G=120,B=212)
Colors(6)=(R=70,B=70)
Colors(7)=(R=185,B=145)
Colors(8)=(R=180,G=2,B=100)
Colors(9)=(R=64,B=215)
Colors(10)=(G=81,B=150)
Colors(12)=(R=129,B=118)
Colors(13)=(R=255,G=255,B=255)



ColorThemeManager.uc (extends Actor)

var travel ColorTheme FirstColorTheme;
var travel ColorTheme CurrentSearchTheme;
var travel EColorThemeTypes CurrentSearchThemeType;
var travel ColorTheme currentHUDTheme;
var travel ColorTheme currentMenuTheme;
bHidden=True
bTravel=True

AddTheme (Class newThemeClass) -> ColorTheme


local ColorTheme newTheme;
local ColorTheme theme;


if (newThemeClass == None)
return None;

// Spawn the class
newTheme = Spawn(newThemeClass, Self);

if (FirstColorTheme == None)
{
FirstColorTheme = newTheme;
}
else
{
theme = FirstColorTheme;

// Add at end for now
while(theme.next != None)
theme = theme.next;

theme.next = newTheme;
}

return newTheme;

CreateTheme (Class newThemeClass, String newThemeName) -> ColorTheme


local ColorTheme newTheme;


newTheme = AddTheme(newThemeClass);

if (newTheme != None)
newTheme.SetThemeName(newThemeName);

return newTheme;

DeleteColorTheme (String themeName) -> bool


local ColorTheme deleteTheme;
local ColorTheme prevTheme;
local Bool bDeleted;


bDeleted = False;
prevTheme = None;
deleteTheme = FirstColorTheme;

while(deleteTheme != None)
{
if ((deleteTheme.GetThemeName() == themeName) && (deleteTheme.IsSystemTheme() != True))
{
if (deleteTheme == FirstColorTheme)
FirstColorTheme = deleteTheme.next;

if (prevTheme != None)
prevTheme.next = deleteTheme.next;

bDeleted = True;
break;
}

prevTheme = deleteTheme;
deleteTheme = deleteTheme.next;
}

FindTheme (String themeName) -> ColorTheme


local ColorTheme theme;


theme = FirstColorTheme;

while(theme != None)
{
if (theme.GetThemeName() == themeName)
break;
}

return theme;

GetCurrentHUDColorTheme -> ColorTheme


return currentHUDTheme;

GetCurrentMenuColorTheme -> ColorTheme


return currentMenuTheme;

GetFirstTheme (int intThemeType) -> ColorTheme


local EColorThemeTypes themeType;


if (intThemeType == 0)
themeType = CTT_Menu;
else
themeType = CTT_HUD;

CurrentSearchThemeType = themeType;
CurrentSearchTheme = GetNextThemeByType(None, CurrentSearchThemeType);

return CurrentSearchTheme;

GetNextTheme -> ColorTheme


if (CurrentSearchTheme != None)
CurrentSearchTheme = GetNextThemeByType(CurrentSearchTheme, CurrentSearchThemeType);

return CurrentSearchTheme;

GetNextThemeByType (ColorTheme theme, EColorThemeTypes themeType) -> ColorTheme


if (theme == None)
theme = FirstColorTheme;
else
theme = theme.next;

while(theme != None)
{
if (theme.themeType == themeType)
break;

theme = theme.next;
}

return theme;

NextHUDColorTheme


currentHUDTheme = GetNextThemeByType(currentHUDTheme, CTT_HUD);

NextMenuColorTheme


currentMenuTheme = GetNextThemeByType(currentMenuTheme, CTT_Menu);

SetCurrentHUDColorTheme (ColorTheme newTheme)


if (newTheme != None)
currentHUDTheme = newTheme;

SetCurrentMenuColorTheme (ColorTheme newTheme)


if (newTheme != None)
currentMenuTheme = newTheme;

SetHUDThemeByName (String themeName) -> ColorTheme


local ColorTheme theme;
local ColorTheme firstHUDTheme;


theme = FirstColorTheme;

while(theme != None)
{
if (theme.themeType == CTT_HUD)
firstHUDTheme = theme;

if ((theme.GetThemeName() == themeName) && (theme.themeType == CTT_HUD))
{
currentHUDTheme = theme;
break;
}

theme = theme.next;
}

if (currentHUDTheme != None)
return currentHUDTheme;
else
return firstHUDTheme;

SetMenuThemeByName (String themeName) -> ColorTheme


local ColorTheme theme;
local ColorTheme firstMenuTheme;


theme = FirstColorTheme;

while(theme != None)
{
if (theme.themeType == CTT_Menu)
firstMenuTheme = theme;

if ((theme.GetThemeName() == themeName) && (theme.themeType == CTT_Menu))
{
currentMenuTheme = theme;
break;
}

theme = theme.next;
}

if (currentMenuTheme != None)
return currentMenuTheme;
else
return firstMenuTheme;




ColorThemeMenu.uc (extends ColorTheme)

colorNames(0)=MenuColor_Background
colorNames(1)=MenuColor_TitleBackground
colorNames(2)=MenuColor_TitleText
colorNames(3)=MenuColor_ButtonFace
colorNames(4)=MenuColor_ButtonTextNormal
colorNames(5)=MenuColor_ButtonTextFocus
colorNames(6)=MenuColor_ButtonTextDisabled
colorNames(7)=MenuColor_HelpText
colorNames(8)=MenuColor_ListText
colorNames(9)=MenuColor_ListTextHighlight
colorNames(10)=MenuColor_ListHighlight
colorNames(11)=MenuColor_ListFocus
colorNames(12)=MenuColor_Cursor



ColorThemeMenu_Blue.uc (extends ColorThemeMenu)

themeName="Dark Blue"
bSystemTheme=True
Colors(0)=(R=50)
Colors(1)=(R=255)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(R=100)
Colors(4)=(R=200,G=200,B=200)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=50,G=50,B=50)
Colors(7)=(R=255,G=255,B=255)
Colors(8)=(R=200,G=200,B=200)
Colors(9)=(R=255)
Colors(10)=(R=128,G=128,B=128)
Colors(11)=(R=64,G=64,B=64)
Colors(12)=(R=255,G=255,B=255)



ColorThemeMenu_BlueAndGold.uc (extends ColorThemeMenu)

themeName="Blue & Gold"
bSystemTheme=True
Colors(0)=(R=148,G=166,B=225)
Colors(1)=(R=169,G=182,B=231)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(R=255,G=242,B=89)
Colors(4)=(R=255,G=255,B=151)
Colors(5)=(R=255,G=255,B=239)
Colors(6)=(R=50,G=50,B=50)
Colors(7)=(R=199,G=218,B=241)
Colors(8)=(R=199,G=218,B=241)
Colors(9)=(R=255,G=255,B=239)
Colors(10)=(R=56,G=67,B=83)
Colors(11)=(R=228,G=202,B=100)
Colors(12)=(R=148,G=166,B=225)



ColorThemeMenu_CoolGreen.uc (extends ColorThemeMenu)

themeName="Cool Green"
bSystemTheme=True
Colors(0)=(R=96,G=255,B=194)
Colors(1)=(G=255,B=217)
Colors(2)=(R=214,G=255,B=237)
Colors(3)=(R=86,G=255,B=166)
Colors(4)=(R=62,G=217,B=143)
Colors(5)=(R=191,G=255,B=215)
Colors(6)=(G=163,B=121)
Colors(7)=(R=191,G=255,B=215)
Colors(8)=(R=23,G=217,B=143)
Colors(9)=(R=191,G=255,B=215)
Colors(10)=(G=134,B=83)
Colors(11)=(R=73,G=255,B=177)
Colors(12)=(R=96,G=255,B=194)



ColorThemeMenu_Cops.uc (extends ColorThemeMenu)

themeName="Cops"
bSystemTheme=True
Colors(0)=(R=255,G=255,B=255)
Colors(1)=(G=8,B=255)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(B=255)
Colors(4)=(R=255,G=255,B=255)
Colors(5)=(R=255)
Colors(6)=(B=255)
Colors(7)=(R=255,G=255,B=255)
Colors(8)=(R=255,G=255,B=255)
Colors(9)=(R=255,G=255,B=255)
Colors(10)=(B=67)
Colors(11)=(R=255,G=255,B=255)
Colors(12)=(R=255,G=255,B=255)



ColorThemeMenu_Cyan.uc (extends ColorThemeMenu)

themeName="Cyan"
bSystemTheme=True
Colors(0)=(G=255,B=255)
Colors(1)=(G=110,B=255)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(G=255,B=255)
Colors(4)=(G=255,B=255)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(G=102,B=102)
Colors(7)=(G=255,B=255)
Colors(8)=(G=255,B=255)
Colors(9)=(R=255,G=255,B=255)
Colors(10)=(G=88,B=88)
Colors(11)=(G=255,B=255)
Colors(12)=(G=255,B=255)



ColorThemeMenu_Default.uc (extends ColorThemeMenu)

themeName="Default"
bSystemTheme=True
Colors(0)=(R=200,G=200,B=200)
Colors(1)=(R=100,G=100,B=255)
Colors(2)=(R=250,G=250,B=250)
Colors(3)=(R=255,G=255,B=255)
Colors(4)=(R=200,G=200,B=200)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=100,G=100,B=100)
Colors(7)=(R=175,G=175,B=175)
Colors(8)=(R=175,G=175,B=175)
Colors(9)=(R=255,G=255,B=255)
Colors(10)=(R=100,G=100,B=100)
Colors(11)=(R=150,G=150,B=150)
Colors(12)=(R=255,G=255,B=255)



ColorThemeMenu_DesertStorm.uc (extends ColorThemeMenu)

themeName="Desert Storm"
bSystemTheme=True
Colors(0)=(R=255,G=155,B=105)
Colors(1)=(R=255,G=255,B=255)
Colors(2)=(R=255,G=155,B=105)
Colors(3)=(R=255,G=155,B=105)
Colors(4)=(R=255,G=155,B=105)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=255,G=155,B=105)
Colors(7)=(R=255,G=155,B=105)
Colors(8)=(R=255,G=155,B=105)
Colors(10)=(R=255,G=155,B=105)
Colors(12)=(R=255,G=255,B=255)



ColorThemeMenu_DriedBlood.uc (extends ColorThemeMenu)

themeName="Dried Blood"
bSystemTheme=True
Colors(0)=(R=192,G=121,B=128)
Colors(1)=(R=78,G=5)
Colors(2)=(R=155)
Colors(3)=(R=77,G=22)
Colors(4)=(R=147)
Colors(5)=(R=255)
Colors(6)=(R=72)
Colors(7)=(R=175,G=128,B=126)
Colors(8)=(R=175)
Colors(9)=(R=255)
Colors(10)=(R=27)
Colors(11)=(R=255,G=139)
Colors(12)=(R=77,G=41)



ColorThemeMenu_Dusk.uc (extends ColorThemeMenu)

themeName="Dusk"
bSystemTheme=True
Colors(0)=(R=255,G=182,B=255)
Colors(1)=(R=84,B=84)
Colors(2)=(R=255,G=175)
Colors(3)=(R=84,B=84)
Colors(4)=(R=255,G=175)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=255,G=99,B=255)
Colors(7)=(R=255,G=255,B=255)
Colors(8)=(R=255,G=175)
Colors(9)=(R=255,G=255,B=255)
Colors(10)=(R=84,B=84)
Colors(11)=(R=255,G=175)
Colors(12)=(R=255,G=175)



ColorThemeMenu_Earth.uc (extends ColorThemeMenu)

themeName="Earth"
bSystemTheme=True
Colors(0)=(R=255,G=99,B=32)
Colors(1)=(R=255,G=108,B=27)
Colors(2)=(R=223,G=96,B=32)
Colors(3)=(R=206,G=143,B=96)
Colors(4)=(R=207,G=142,B=116)
Colors(5)=(R=255,G=255,B=192)
Colors(6)=(R=86,G=38,B=24)
Colors(7)=(R=255,G=255,B=255)
Colors(8)=(R=204,G=96,B=32)
Colors(9)=(R=112,G=32)
Colors(10)=(R=255,G=185,B=120)
Colors(11)=(R=204,G=99,B=32)
Colors(12)=(R=204,G=96,B=32)



ColorThemeMenu_Green.uc (extends ColorThemeMenu)

themeName="Green"
bSystemTheme=True
Colors(0)=(R=10,G=200,B=40)
Colors(1)=(G=97)
Colors(2)=(R=91,G=255,B=132)
Colors(3)=(R=25,G=225,B=70)
Colors(4)=(R=32,G=218,B=69)
Colors(5)=(R=91,G=255,B=132)
Colors(6)=(R=18,G=107,B=37)
Colors(7)=(G=255,B=127)
Colors(8)=(R=32,G=218,B=69)
Colors(9)=(R=91,G=255,B=132)
Colors(10)=(G=88,B=22)
Colors(11)=(R=18,G=158,B=67)
Colors(12)=(G=255)



ColorThemeMenu_Grey.uc (extends ColorThemeMenu)

themeName="Grey"
bSystemTheme=True
Colors(0)=(R=255,G=255,B=255)
Colors(1)=(B=255)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(R=255,G=255,B=255)
Colors(4)=(R=200,G=200,B=200)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=50,G=50,B=50)
Colors(7)=(R=200,G=200,B=200)
Colors(8)=(R=200,G=200,B=200)
Colors(10)=(R=128,G=128,B=128)
Colors(11)=(R=64,G=64,B=64)
Colors(12)=(R=255,G=255,B=255)



ColorThemeMenu_IonStorm.uc (extends ColorThemeMenu)

themeName="Ion Storm"
bSystemTheme=True
Colors(0)=(G=61)
Colors(1)=(G=215)
Colors(2)=(G=255)
Colors(3)=(G=123)
Colors(4)=(R=200,G=255,B=200)
Colors(5)=(R=255,G=255,B=37)
Colors(6)=(G=134)
Colors(7)=(R=175,G=175,B=175)
Colors(8)=(G=255)
Colors(9)=(G=249)
Colors(11)=(G=255)
Colors(12)=(G=255)



ColorThemeMenu_Lava.uc (extends ColorThemeMenu)

themeName="Lava"
bSystemTheme=True
Colors(0)=(R=255,G=16)
Colors(1)=(R=200,G=100,B=64)
Colors(2)=(R=255,G=255,B=192)
Colors(3)=(R=255,G=100,B=40)
Colors(4)=(R=255,G=137,B=92)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=120,G=42,B=16)
Colors(7)=(R=200,G=200,B=200)
Colors(8)=(R=255,G=96,B=32)
Colors(9)=(R=182)
Colors(10)=(R=255,G=200,B=128)
Colors(11)=(R=123)
Colors(12)=(R=255,G=16)



ColorThemeMenu_NightVision.uc (extends ColorThemeMenu)

themeName="Night Vision"
bSystemTheme=True
Colors(0)=(G=78)
Colors(1)=(R=61)
Colors(2)=(R=145)
Colors(3)=(G=32)
Colors(4)=(G=78)
Colors(5)=(G=210)
Colors(6)=(G=32)
Colors(7)=(G=78)
Colors(8)=(R=104)
Colors(10)=(R=123)
Colors(11)=(R=242)
Colors(12)=(R=166)



ColorThemeMenu_Ninja.uc (extends ColorThemeMenu)

themeName="Ninja"
bSystemTheme=True
Colors(0)=(R=100,G=100,B=100)
Colors(1)=(R=40,G=40,B=40)
Colors(2)=(R=200,G=200,B=200)
Colors(3)=(R=40,G=40,B=40)
Colors(4)=(R=150,G=150,B=150)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=48,G=48,B=48)
Colors(7)=(R=175,G=175,B=175)
Colors(8)=(R=175,G=175,B=175)
Colors(9)=(R=255,G=255,B=255)
Colors(11)=(R=220,G=220,B=220)
Colors(12)=(R=255,G=255,B=255)



ColorThemeMenu_Olive.uc (extends ColorThemeMenu)

themeName="Olive"
bSystemTheme=True
Colors(0)=(R=204,G=255,B=158)
Colors(1)=(R=191,G=242,B=51)
Colors(2)=(R=255,G=255,B=206)
Colors(3)=(R=217,G=255,B=148)
Colors(4)=(R=185,G=222,B=142)
Colors(5)=(R=253,G=255,B=242)
Colors(6)=(R=135,G=166,B=96)
Colors(7)=(R=253,G=255,B=242)
Colors(8)=(R=185,G=222,B=142)
Colors(9)=(R=253,G=255,B=242)
Colors(10)=(R=84,G=120,B=57)
Colors(11)=(R=207,G=255,B=137)
Colors(12)=(R=204,G=255,B=158)



ColorThemeMenu_PaleGreen.uc (extends ColorThemeMenu)

themeName="Pale Green"
bSystemTheme=True
Colors(0)=(R=218,G=255,B=196)
Colors(1)=(G=242,B=230)
Colors(2)=(R=255,G=255,B=206)
Colors(3)=(R=241,G=255,B=202)
Colors(4)=(R=180,G=211,B=178)
Colors(5)=(R=255,G=255,B=206)
Colors(6)=(R=70,G=70,B=70)
Colors(7)=(R=155,G=186,B=153)
Colors(8)=(R=155,G=186,B=153)
Colors(9)=(R=255,G=255,B=206)
Colors(10)=(G=108,B=84)
Colors(11)=(G=185,B=166)
Colors(12)=(R=218,G=255,B=196)



ColorThemeMenu_Pastel.uc (extends ColorThemeMenu)

themeName="Pastel"
bSystemTheme=True
Colors(0)=(R=207,G=255,B=212)
Colors(1)=(R=255,G=196,B=255)
Colors(2)=(R=250,G=250,B=131)
Colors(3)=(R=204,G=223,B=255)
Colors(4)=(R=244,G=255,B=161)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=100,G=100,B=100)
Colors(7)=(R=175,G=134,B=196)
Colors(8)=(R=175,G=113,B=175)
Colors(9)=(R=255,G=255,B=145)
Colors(10)=(R=100,G=100,B=124)
Colors(11)=(R=150,G=80,B=150)
Colors(12)=(R=255,G=188,B=255)



ColorThemeMenu_Plasma.uc (extends ColorThemeMenu)

themeName="Plasma"
bSystemTheme=True
Colors(0)=(R=107)
Colors(1)=(R=107)
Colors(2)=(R=107)
Colors(3)=(R=164,G=61)
Colors(4)=(R=255,G=105)
Colors(5)=(R=255,G=161)
Colors(6)=(R=108,G=30)
Colors(7)=(R=134)
Colors(8)=(R=107)
Colors(10)=(R=107)
Colors(11)=(R=220,G=116)
Colors(12)=(R=174,G=88)



ColorThemeMenu_Primaries.uc (extends ColorThemeMenu)

themeName="Primaries"
bSystemTheme=True
Colors(0)=(B=80)
Colors(1)=(R=100)
Colors(2)=(R=250,G=253)
Colors(3)=(R=108)
Colors(4)=(R=200,G=200)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(B=46)
Colors(7)=(R=175,G=175,B=175)
Colors(8)=(R=142)
Colors(9)=(R=255,G=255)
Colors(10)=(R=67)
Colors(11)=(R=166)
Colors(12)=(R=255,G=255,B=255)



ColorThemeMenu_Purple.uc (extends ColorThemeMenu)

themeName="Purple"
bSystemTheme=True
Colors(0)=(R=214,G=177,B=255)
Colors(1)=(R=255,B=255)
Colors(2)=(R=249,G=239,B=255)
Colors(3)=(R=212,G=190,B=242)
Colors(4)=(R=209,G=201,B=212)
Colors(5)=(R=249,G=239,B=255)
Colors(6)=(R=83,G=72,B=97)
Colors(7)=(R=188,G=177,B=200)
Colors(8)=(R=188,G=177,B=200)
Colors(9)=(R=255,G=255,B=255)
Colors(10)=(R=77,G=54,B=91)
Colors(11)=(R=143,G=121,B=156)
Colors(12)=(R=214,G=177,B=255)



ColorThemeMenu_Red.uc (extends ColorThemeMenu)

themeName="Red"
bSystemTheme=True
Colors(0)=(R=255)
Colors(1)=(R=135)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(R=255,G=27)
Colors(4)=(R=255,G=107,B=94)
Colors(5)=(R=255,G=191,B=186)
Colors(6)=(R=169,G=8,B=3)
Colors(7)=(R=200,G=200,B=200)
Colors(8)=(R=255)
Colors(10)=(R=255,G=191,B=186)
Colors(11)=(R=255)
Colors(12)=(R=255)



ColorThemeMenu_Seawater.uc (extends ColorThemeMenu)

themeName="Seawater"
bSystemTheme=True
Colors(0)=(G=255,B=140)
Colors(1)=(R=64,G=224,B=192)
Colors(2)=(G=255,B=255)
Colors(3)=(G=255,B=255)
Colors(4)=(R=64,G=255,B=255)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(G=96,B=164)
Colors(7)=(G=255,B=255)
Colors(8)=(G=255,B=255)
Colors(10)=(G=255,B=192)
Colors(12)=(G=255,B=255)



ColorThemeMenu_SoylentGreen.uc (extends ColorThemeMenu)

themeName="SoylentGreen"
bSystemTheme=True
Colors(0)=(R=70,G=160,B=100)
Colors(1)=(B=30)
Colors(2)=(R=80,G=145,B=105)
Colors(3)=(R=70,G=160,B=100)
Colors(4)=(R=80,G=145,B=105)
Colors(5)=(R=160,G=160,B=160)
Colors(6)=(R=80,G=145,B=105)
Colors(7)=(R=80,G=145,B=105)
Colors(8)=(R=80,G=145,B=105)
Colors(9)=(R=70,G=160,B=100)
Colors(10)=(B=30)
Colors(11)=(R=80,G=145,B=105)
Colors(12)=(R=80,G=145,B=105)



ColorThemeMenu_Starlight.uc (extends ColorThemeMenu)

themeName="Starlight"
bSystemTheme=True
Colors(0)=(R=27,G=56,B=86)
Colors(1)=(R=27,G=56,B=190)
Colors(2)=(R=27,G=56,B=86)
Colors(3)=(R=27,G=107,B=148)
Colors(4)=(R=142,G=191,B=239)
Colors(5)=(R=54,G=120,B=239)
Colors(6)=(B=255)
Colors(7)=(R=27,G=56,B=107)
Colors(8)=(R=27,G=61,B=159)
Colors(9)=(R=10,G=41,B=255)
Colors(10)=(G=18,B=43)
Colors(11)=(R=100,G=155,B=239)
Colors(12)=(R=27,G=56,B=230)



ColorThemeMenu_Steel.uc (extends ColorThemeMenu)

themeName="Steel"
bSystemTheme=True
Colors(0)=(R=198,G=210,B=255)
Colors(1)=(G=77,B=255)
Colors(2)=(R=225,G=244,B=255)
Colors(3)=(R=218,G=239,B=255)
Colors(4)=(R=191,G=202,B=215)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=84,G=97,B=108)
Colors(7)=(R=191,G=202,B=215)
Colors(8)=(R=191,G=202,B=215)
Colors(9)=(R=255,G=255,B=255)
Colors(10)=(R=56,G=73,B=88)
Colors(11)=(R=113,G=128,B=139)
Colors(12)=(R=223,G=234,B=255)



ColorThemeMenu_SteelGreen.uc (extends ColorThemeMenu)

themeName="Steel Green"
bSystemTheme=True
Colors(0)=(R=100,G=155,B=159)
Colors(1)=(G=199,B=255)
Colors(2)=(R=255,G=255,B=139)
Colors(3)=(R=255,G=255,B=204)
Colors(4)=(R=210,G=250,B=177)
Colors(5)=(R=255,G=255,B=255)
Colors(6)=(R=100,G=100,B=100)
Colors(7)=(R=175,G=175,B=175)
Colors(8)=(R=116,G=167,B=120)
Colors(9)=(G=65)
Colors(10)=(R=218,G=228,B=177)
Colors(11)=(G=61)
Colors(12)=(R=226,G=180,B=120)



ColorThemeMenu_Superhero.uc (extends ColorThemeMenu)

themeName="Superhero"
bSystemTheme=True
Colors(0)=(R=45,G=156,B=255)
Colors(1)=(R=167,G=24)
Colors(2)=(R=255,G=255,B=255)
Colors(3)=(R=255,G=255,B=202)
Colors(4)=(R=255,G=255,B=255)
Colors(5)=(R=255,G=255)
Colors(6)=(R=89,G=89,B=61)
Colors(7)=(R=255,G=255,B=255)
Colors(8)=(R=177,G=24)
Colors(9)=(R=255,G=255,B=252)
Colors(10)=(B=41)
Colors(11)=(R=255,G=255,B=142)
Colors(12)=(R=255,G=255,B=255)



ColorThemeMenu_Terminator.uc (extends ColorThemeMenu)

themeName="Terminator"
bSystemTheme=True
Colors(0)=(R=106,G=10,B=10)
Colors(1)=(G=116,B=10)
Colors(2)=(G=113)
Colors(3)=(R=80,G=10,B=10)
Colors(4)=(R=128,G=10,B=10)
Colors(5)=(R=255,G=70,B=10)
Colors(6)=(R=106,G=10,B=10)
Colors(7)=(R=106,G=10,B=10)
Colors(8)=(G=72)
Colors(9)=(G=239)
Colors(10)=(G=62)
Colors(11)=(R=5,G=255)
Colors(12)=(R=182,G=10,B=10)



ColorThemeMenu_Violet.uc (extends ColorThemeMenu)

themeName="Violet"
bSystemTheme=True
Colors(0)=(R=126,B=124)
Colors(1)=(R=100,G=100,B=255)
Colors(2)=(R=116,B=88)
Colors(3)=(R=89,B=164)
Colors(4)=(G=41,B=255)
Colors(5)=(R=158,B=148)
Colors(6)=(B=64)
Colors(7)=(R=175,G=175,B=175)
Colors(8)=(R=163,B=175)
Colors(9)=(R=241,B=255)
Colors(10)=(R=57,B=110)
Colors(11)=(R=150,G=72,B=253)
Colors(12)=(R=142,B=120)



ComputerCameraUIChoice.uc (extends MenuUIChoiceEnum)

var ComputerSecurityCameraWindow winCamera;
var ComputerScreenSecurity securityWindow;
defaultInfoWidth=113
defaultInfoPosX=154

DisableChoice


btnAction.DisableWindow();
btnInfo.DisableWindow();

SetCameraView (ComputerSecurityCameraWindow newCamera)


winCamera = newCamera;

SetSecurityWindow (ComputerScreenSecurity newScreen)


securityWindow = newScreen;




ComputerPersonal.uc (extends Computers)

terminalType=Class'DeusEx.NetworkTerminalPersonal'
lockoutDelay=60.000000
UserList(0)=(userName="USER",Password="USER")
ItemName="Personal Computer Terminal"
Mesh=LodMesh'DeusExDeco.ComputerPersonal'
CollisionRadius=36.000000
CollisionHeight=7.400000
BindName="ComputerPersonal"



ComputerPublic.uc (extends Computers)

var() name bulletinTag;
terminalType=Class'DeusEx.NetworkTerminalPublic'
ItemName="Public Computer Terminal"
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.ComputerPublic'
ScaleGlow=2.000000
CollisionHeight=49.139999
BindName="ComputerPublic"



ComputerScreenATM.uc (extends ComputerUIWindow)

var MenuUIActionButtonWindow btnLogin;
var MenuUIActionButtonWindow btnCancel;
var MenuUILabelWindow winWarning;
var MenuUILabelWindow winLoginInfo;
var MenuUISmallLabelWindow winLoginError;
var MenuUIEditWindow editAccount;
var MenuUIEditWindow editPIN;
var ATM atmOwner; // what ATM owns this window?
var localized String AccountLabel;
var localized String PinLabel;
var localized String LoginInfoText;
var localized String WarningText;
var localized String StatusText;
var localized String InvalidLoginMessage;
AccountLabel="Account #:"
PinLabel="PIN #:"
LoginInfoText="Please enter your Account # and Pin"
WarningText="WARNING: Unauthorized access will be met with excessive force!"
StatusText="PNGBS//GLOBAL//PUB:3902.9571[login]"
InvalidLoginMessage="LOGIN ERROR, ACCESS DENIED"
Title="PageNet Global Banking System"
ClientWidth=303
ClientHeight=231
verticalOffset=30
clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerGBSLogonBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerGBSLogonBackground_2'
textureRows=1
textureCols=2
bAlwaysCenter=True
statusPosY=206

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnLogin:
ProcessLogin();
break;

case btnCancel:
CloseScreen("EXIT");
break;

default:
bHandled = False;
break;
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

CreateControls


Super.CreateControls();

btnCancel = winButtonBar.AddButton(ButtonLabelCancel, HALIGN_Right);
btnLogin = winButtonBar.AddButton(ButtonLabelLogin, HALIGN_Right);

CreateMenuLabel(10, 111, AccountLabel, winClient);
CreateMenuLabel(10, 141, PINLabel, winClient);

editAccount = CreateMenuEditWindow(131, 109, 143, 24, winClient);
editPIN = CreateMenuEditWindow(131, 139, 143, 24, winClient);

CreateWarningWindow();
CreateLoginInfoWindow();
CreateLoginErrorWindow();

winTitle.SetTitle(Title);
winStatus.SetText(StatusText);

CreateLoginErrorWindow


winLoginError = MenuUISmallLabelWindow(winClient.NewChild(Class'MenuUISmallLabelWindow'));

winLoginError.SetPos(80, 172);
winLoginError.SetSize(287, 25);
winLoginError.SetTextAlignments(HALIGN_Left, VALIGN_Center);
winLoginError.SetTextMargins(0, 0);

CreateLoginInfoWindow


winLoginInfo = MenuUILabelWindow(winClient.NewChild(Class'MenuUILabelWindow'));

winLoginInfo.SetPos(8, 66);
winLoginInfo.SetSize(273, 31);
winLoginInfo.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winLoginInfo.SetTextMargins(0, 0);
winLoginInfo.SetText(LoginInfoText);

CreateWarningWindow


winWarning = MenuUILabelWindow(winClient.NewChild(Class'MenuUILabelWindow'));

winWarning.SetPos(8, 10);
winWarning.SetSize(273, 50);
winWarning.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winWarning.SetTextMargins(0, 0);
winWarning.SetText(WarningText);

EditActivated (window edit, bool bModified) -> bool


if (btnLogin.IsSensitive())
{
ProcessLogin();
return True;
}
else
{
return False;
}

EnableButtons


// Text must be entered in the two fields for the login button to be
// enabled

btnLogin.SetSensitivity((editAccount.GetText() != "") && (editPIN.GetText() != ""));

InitWindow


Super.InitWindow();
EnableButtons();

ProcessLogin


local bool bSuccessfulLogin;
local int accountIndex;
local int userIndex;


bSuccessfulLogin = False;

for (accountIndex=0; accountIndex {
if (Caps(editAccount.GetText()) == atmOwner.GetAccountNumber(accountIndex))
{
userIndex = accountIndex;
break;
}
}

if (userIndex != -1)
{
if (Caps(editPIN.GetText()) == atmOwner.GetPIN(userIndex))
bSuccessfulLogin = True;
}

if (bSuccessfulLogin)
{
winTerm.SetLoginInfo("", userIndex);
CloseScreen("LOGIN");
}
else
{
// Print a message about invalid login
winLoginError.SetText(InvalidLoginMessage);

// Clear text fields and reset focus
editAccount.SetText("");
editPIN.SetText("");
SetFocusWindow(editAccount);
}

SetCompOwner (ElectronicDevices newCompOwner)


Super.SetCompOwner(newCompOwner);
atmowner = ATM(compOwner);

SetFocusWindow(editAccount);

// Check to see if this ATM has been sucked dry, in which
// case we just want to show the the Disabled screen

if (atmOwner.bSuckedDryByHack == True)
CloseScreen("ATMDISABLED");

SetNetworkTerminal (NetworkTerminal newTerm)


Super.SetNetworkTerminal(newTerm);

// If the user already hacked this computer, then set the
// "Hack" button to "Return"
if (winTerm != None)
winTerm.SetHackButtonToReturn();

TextChanged (window edit, bool bModified) -> bool


EnableButtons();

return False;

UpdateStatus


// Update the title, texture and description
winTitle.SetTitle(Title);




ComputerScreenATMDisabled.uc (extends ComputerUIWindow)

var MenuUILabelWindow winLoginInfo;
var MenuUIActionButtonWindow btnClose;
var localized String ButtonLabelClose;
var localized String LoginInfoText;
var localized String StatusText;
ButtonLabelClose="Close"
LoginInfoText="Sorry, this terminal is out of service (ERR 06MJ12)|n|nWe apologize for the inconvenience but would gladly service you at any of the other 231,000 PageNet Banking Terminals around the globe."
StatusText="PNGBS//GLOBAL//PUB:3902.9571[dsbld]"
Title="PageNet Global Banking System"
ClientWidth=403
ClientHeight=211
verticalOffset=30
clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerGBSDisabledBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerGBSDisabledBackground_2'
textureRows=1
textureCols=2
bAlwaysCenter=True
statusPosY=186

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnClose:
CloseScreen("EXIT");
break;

default:
bHandled = False;
break;
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

CreateControls


Super.CreateControls();

btnClose = winButtonBar.AddButton(ButtonLabelClose, HALIGN_Right);

CreateLoginInfoWindow();

winTitle.SetTitle(Title);
winStatus.SetText(StatusText);

CreateLoginInfoWindow


winLoginInfo = MenuUILabelWindow(winClient.NewChild(Class'MenuUILabelWindow'));

winLoginInfo.SetPos(10, 12);
winLoginInfo.SetSize(377, 122);
winLoginInfo.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winLoginInfo.SetTextMargins(0, 0);
winLoginInfo.SetText(LoginInfoText);

SetNetworkTerminal (NetworkTerminal newTerm)


Super.SetNetworkTerminal(newTerm);

// Hide the Hack window
if (winTerm != None)
winTerm.CloseHackWindow();




ComputerScreenATMWithdraw.uc (extends ComputerUIWindow)

var MenuUILabelWindow winInstructions;
var MenuUISmallLabelWindow winInfo;
var MenuUIActionButtonWindow btnWithdraw;
var MenuUIActionButtonWindow btnClose;
var MenuUIEditWindow editBalance;
var MenuUIEditWindow editWithdraw;
var ATM atmOwner; // what ATM owns this window?
var float balanceModifier;
var float disabledDelay; // Amount of time before ATM disabled when hacking
var localized String ButtonLabelWithdraw;
var localized String ButtonLabelClose;
var localized String BalanceLabel;
var localized String WithdrawAmountLabel;
var localized String InstructionText;
var localized String InvalidAmountLabel;
var localized String InsufficientCreditsLabel;
var localized String CreditsWithdrawnLabel;
var localized String StatusText;
var localized String HackedText;
disabledDelay=5.000000
ButtonLabelWithdraw="|&Withdraw"
ButtonLabelClose="|&Close"
BalanceLabel="Current Balance:"
WithdrawAmountLabel="Amount to Withdraw:"
InstructionText="Account #: %d|nPlease enter the amount of|ncredits you wish to withdraw."
InvalidAmountLabel="INVALID AMOUNT ENTERED"
InsufficientCreditsLabel="INSUFFICIENT CREDITS"
CreditsWithdrawnLabel="CREDITS WITHDRAWN"
StatusText="PNGBS//GLOBAL//PUB:3902.9571[wd]"
HackedText="TERMINAL HACKED"
escapeAction="LOGOUT"
Title="PageNet Global Banking System"
ClientWidth=403
ClientHeight=211
verticalOffset=30
clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerGBSWithdrawBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerGBSWithdrawBackground_2'
textureRows=1
textureCols=2
bAlwaysCenter=True
statusPosY=186
ComputerNodeFunctionLabel="ATMWD"

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnWithdraw:
WithdrawCredits();
break;

case btnClose:
CloseScreen("LOGOUT");
break;

default:
bHandled = False;
break;
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

CreateControls


Super.CreateControls();

btnWithdraw = winButtonBar.AddButton(ButtonLabelWithdraw, HALIGN_Right);
btnClose = winButtonBar.AddButton(ButtonLabelClose, HALIGN_Right);

CreateMenuLabel(20, 91, BalanceLabel, winClient);
CreateMenuLabel(20, 121, WithdrawAmountLabel, winClient);

editBalance = CreateMenuEditWindow(231, 89, 143, 10, winClient);
editBalance.SetSensitivity(False); // cannot edit balance!!
editWithdraw = CreateMenuEditWindow(231, 119, 143, 10, winClient);

CreateInstructionsWindow();
CreateInfoWindow();

winTitle.SetTitle(Title);
winStatus.SetText(StatusText);

CreateInfoWindow


winInfo = MenuUISmallLabelWindow(winClient.NewChild(Class'MenuUISmallLabelWindow'));

winInfo.SetPos(8, 152);
winInfo.SetSize(385, 25);
winInfo.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winInfo.SetTextMargins(0, 0);

CreateInstructionsWindow


winInstructions = MenuUILabelWindow(winClient.NewChild(Class'MenuUILabelWindow'));

winInstructions.SetPos(8, 10);
winInstructions.SetSize(381, 50);
winInstructions.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winInstructions.SetTextMargins(0, 0);

EditActivated (window edit, bool bModified) -> bool


WithdrawCredits();

EnableButtons


local float balance;


// Only allow withdraw if there's money to be withdrawn and the user has typed
// something into the editWithdraw field

if (winTerm.bHacked)
balance = atmOwner.GetBalance(-1, balanceModifier);
else
balance = atmOwner.GetBalance(winTerm.GetUserIndex(), balanceModifier);

btnWithdraw.SetSensitivity((editWithdraw.GetText() != "") && (balance > 0));

SetCompOwner (ElectronicDevices newCompOwner)


local String test;


Super.SetCompOwner(newCompOwner);
atmowner = ATM(compOwner);

balanceModifier = winTerm.GetSkillLevel() * 0.5;
UpdateBalance();

if (winTerm.bHacked)
{
// Once hacked, an ATM can't be returned to
atmOwner.bSuckedDryByHack = True;
test = Sprintf(InstructionText, HackedText);
}
else
{
test = Sprintf(InstructionText, atmOwner.GetAccountNumber(winTerm.GetUserIndex()));
}

winInstructions.SetText(test);

EnableButtons();
SetFocusWindow(editWithdraw);

TextChanged (window edit, bool bModified) -> bool


EnableButtons();

return False;

Tick (float deltaTime)


disabledDelay -= deltaTime;

if (disabledDelay <= 0.0)
{
bTickEnabled = False;

// Go to the ATM Disabled screen
CloseScreen("ATMDISABLED");
}

UpdateBalance


if (winTerm.bHacked)
editBalance.SetText(String(atmOwner.GetBalance(-1, balanceModifier)));
else
editBalance.SetText(String(atmOwner.GetBalance(winTerm.GetUserIndex(), balanceModifier)));

WithdrawCredits


local int numCredits;
local int balance;


numCredits = Int(editWithdraw.GetText());

// withdrawal
if (numCredits > 0)
{
if (winTerm.bHacked)
balance = atmOwner.GetBalance(-1, balanceModifier);
else
balance = atmOwner.GetBalance(winTerm.GetUserIndex(), balanceModifier);

if (balance >= numCredits)
{
if (winTerm.bHacked)
atmOwner.ModBalance(-1, numCredits, True);
else
atmOwner.ModBalance(winTerm.GetUserIndex(), numCredits, True);

player.Credits += numCredits;
winInfo.SetText(String(numCredits) @ CreditsWithdrawnLabel);

// If the user withdrew *ALL* the money and this ATM machine
// was hacked, then set a timer which will cause the
// ATM Disabled screen to come up after a few seconds.

if ((winTerm.bHacked) && (balance - numCredits <= 0))
{
bTickEnabled = True;
atmOwner.bSuckedDryByHack = True;
}
}
else
{
winInfo.SetText(InsufficientCreditsLabel);
}
}
else
{
winInfo.SetText(InvalidAmountLabel);
}

// Blank withdraw box and reset focus to that window
editWithdraw.SetText("");
UpdateBalance();
SetFocusWindow(editWithdraw);




ComputerScreenBulletins.uc (extends ComputerUIWindow)

var MenuUIHeaderWindow winHeader;
var MenuUIActionButtonWindow btnSpecial;
var MenuUIActionButtonWindow btnLogout;
var MenuUIListWindow lstBulletins;
var MenuUINormalLargeTextWindow winBulletin;
var Localized String NoBulletinsTodayText;
var Localized String BulletinsHeaderText;
NoBulletinsTodayText="No Bulletins Today!"
BulletinsHeaderText="Please choose a bulletin to view:"
Title="Bulletins"
ClientWidth=395
ClientHeight=412
clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerBulletinBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerBulletinBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.ComputerBulletinBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.ComputerBulletinBackground_4'
textureRows=2
textureCols=2
statusPosY=383
defaultStatusLeftOffset=12
ComputerNodeFunctionLabel="Bulletins"

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnLogout:
CloseScreen("EXIT");
break;

case btnSpecial:
CloseScreen("SPECIAL");
break;

default:
bHandled = False;
break;
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

CreateBulletinViewWindow


local MenuUIScrollAreaWindow winScroll;


winScroll = CreateScrollAreaWindow(winClient);
winScroll.SetPos(11, 143);
winScroll.SetSize(373, 232);

winBulletin = MenuUINormalLargeTextWindow(winScroll.ClipWindow.NewChild(Class'MenuUINormalLargeTextWindow'));
winBulletin.SetTextMargins(4, 1);
winBulletin.SetWordWrap(True);
winBulletin.SetTextAlignments(HALIGN_Left, VALIGN_Top);

CreateBulletinsListWindow


local MenuUIScrollAreaWindow winScroll;


winScroll = CreateScrollAreaWindow(winClient);
winScroll.SetPos(11, 22);
winScroll.SetSize(373, 113);

lstBulletins = MenuUIListWindow(winScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
lstBulletins.EnableMultiSelect(False);
lstBulletins.EnableAutoExpandColumns(False);
lstBulletins.EnableHotKeys(False);

lstBulletins.SetNumColumns(1);
lstBulletins.SetColumnWidth(0, 373);

CreateControls


Super.CreateControls();

btnLogout = winButtonBar.AddButton(ButtonLabelLogout, HALIGN_Right);

CreateHeaderWindow();
CreateBulletinsListWindow();
CreateBulletinViewWindow();

CreateHeaderWindow


winHeader = MenuUIHeaderWindow(winClient.NewChild(Class'MenuUIHeaderWindow'));
winHeader.SetPos(11, 6);
winHeader.SetSize(300, 12);
winHeader.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winHeader.SetText(BulletinsHeaderText);

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


local int bulletinIndex;


bulletinIndex = lstBulletins.RowIdToIndex(focusRowId);
winBulletin.SetText("");
ProcessDeusExText(fileInfo[bulletinIndex].fileName, winBulletin);

SetCompOwner (ElectronicDevices newCompOwner)


local int bulletinIndex;
local int rowId;


Super.SetCompOwner(newCompOwner);

// Now populate the bulletins
if (ComputerPublic(compOwner).bulletinTag != '')
{
// Churn through the bulletin text
ProcessDeusExText(ComputerPublic(compOwner).bulletinTag);

// Now populate our list
for(bulletinIndex=0; bulletinIndex<=fileIndex; bulletinIndex++)
lstBulletins.AddRow(fileInfo[bulletinIndex].fileDescription);

// Select the first row
rowId = lstBulletins.IndexToRowId(0);
lstBulletins.SetRow(rowId, True);
}
else
{
// No bulletins, so just print a "No Bulletins Today!" message
winBulletin.SetText(NoBulletinsTodayText);
winBulletin.SetTextAlignments(HALIGN_Center, VALIGN_Center);
}

SetNetworkTerminal (NetworkTerminal newTerm)


Super.SetNetworkTerminal(newTerm);

if (winTerm.AreSpecialOptionsAvailable())
{
btnSpecial = winButtonBar.AddButton(ButtonLabelSpecial, HALIGN_Left);
CreateLeftEdgeWindow();
}




ComputerScreenEmail.uc (extends ComputerUIWindow)

var MenuUIActionButtonWindow btnSpecial;
var MenuUIActionButtonWindow btnLogout;
var MenuUIListWindow lstEmail;
var MenuUINormalLargeTextWindow winEmail;
var MenuUIListHeaderButtonWindow btnHeaderFrom;
var MenuUIListHeaderButtonWindow btnHeaderSubject;
var MenuUISmallLabelWindow winEmailFrom;
var MenuUISmallLabelWindow winEmailTo;
var MenuUISmallLabelWindow winEmailSubject;
var MenuUISmallLabelWindow winEmailCC;
var MenuUILabelWindow winEmailCCHeader;
var bool bFromSortOrder;
var bool bSubjectSortOrder;
var localized String NoEmailTodayText;
var localized String EmailFromHeader;
var localized String EmailToHeader;
var localized String EmailCarbonCopyHeader;
var localized String EmailSubjectHeader;
var localized String HeaderFromLabel;
var localized String HeaderSubjectLabel;
bFromSortOrder=True
NoEmailTodayText="No Email Today!"
EmailFromHeader="From:"
EmailToHeader="To:"
EmailCarbonCopyHeader="CC:"
EmailSubjectHeader="Subj:"
HeaderFromLabel="From"
HeaderSubjectLabel="Subject"
escapeAction="LOGOUT"
Title="Email"
ClientWidth=395
ClientHeight=412
clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerEmailBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerEmailBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.ComputerEmailBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.ComputerEmailBackground_4'
textureRows=2
textureCols=2
statusPosY=383
defaultStatusLeftOffset=12
ComputerNodeFunctionLabel="Email"

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnHeaderFrom:
bFromSortOrder = !bFromSortOrder;
lstEmail.SetSortColumn(0, bFromSortOrder);
lstEmail.Sort();
break;

case btnHeaderSubject:
bSubjectSortOrder = !bSubjectSortOrder;
lstEmail.SetSortColumn(1, bSubjectSortOrder);
lstEmail.Sort();
break;

case btnLogout:
CloseScreen("EXIT");
break;

case btnSpecial:
CloseScreen("SPECIAL");
break;

default:
bHandled = False;
break;
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

ChangeAccount


Super.ChangeAccount();
CloseScreen("EMAIL");

CloseScreen (String action)


if (winTerm != None)
winTerm.CloseHackAccountsWindow();

Super.CloseScreen(action);

CreateControls


Super.CreateControls();

btnLogout = winButtonBar.AddButton(ButtonLabelLogout, HALIGN_Right);

CreateEmailListWindow();
CreateEmailViewWindow();
CreateEmailHeaders();
CreateHeaderButtons();

CreateEmailHeaders


local MenuUILabelWindow newLabel;


// First create the headers
newLabel = CreateMenuLabel(12, 104, EmailFromHeader, winClient);
newLabel.SetFont(Font'FontMenuTitle');

newLabel = CreateMenuLabel(212, 104, EmailToHeader, winClient);
newLabel.SetFont(Font'FontMenuTitle');

newLabel = CreateMenuLabel(12, 118, EmailSubjectHeader, winClient);
newLabel.SetFont(Font'FontMenuTitle');

winEmailCCHeader = CreateMenuLabel(212, 118, EmailCarbonCopyHeader, winClient);
winEmailCCHeader.SetFont(Font'FontMenuTitle');
winEmailCCHeader.Hide();

// Now create the text fields
winEmailFrom = CreateSmallMenuLabel( 50, 105, "", winClient);
winEmailTo = CreateSmallMenuLabel(240, 105, "", winClient);
winEmailSubject = CreateSmallMenuLabel( 50, 119, "", winClient);
winEmailCC = CreateSmallMenuLabel(240, 119, "", winClient);

CreateEmailListWindow


local MenuUIScrollAreaWindow winScroll;


winScroll = CreateScrollAreaWindow(winClient);
winScroll.SetPos(11, 22);
winScroll.SetSize(373, 73);

lstEmail = MenuUIListWindow(winScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
lstEmail.EnableMultiSelect(False);
lstEmail.EnableAutoExpandColumns(False);
lstEmail.EnableHotKeys(False);

lstEmail.SetNumColumns(3);
lstEMail.HideColumn(2);
lstEmail.SetColumnType(2, COLTYPE_Float);

lstEmail.SetColumnWidth(0, 123);
lstEmail.SetColumnWidth(1, 250);
lstEmail.SetSortColumn(0, bFromSortOrder);

CreateEmailViewWindow


local MenuUIScrollAreaWindow winScroll;


winScroll = CreateScrollAreaWindow(winClient);
winScroll.SetPos(11, 136);
winScroll.SetSize(373, 239);

winEmail = MenuUINormalLargeTextWindow(winScroll.ClipWindow.NewChild(Class'MenuUINormalLargeTextWindow'));
winEmail.SetTextMargins(4, 1);
winEmail.SetWordWrap(True);
winEmail.SetTextAlignments(HALIGN_Left, VALIGN_Top);

CreateHeaderButtons


btnHeaderFrom = CreateHeaderButton(10, 3, 121, HeaderFromLabel, winClient);
btnHeaderSubject = CreateHeaderButton(134, 3, 187, HeaderSubjectLabel, winClient);

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


local int emailInfoIndex;


emailInfoIndex = Int(lstEmail.GetField(focusRowId, 2));

// Generate the email header
winEmailFrom.SetText(emailInfo[emailInfoIndex].emailFrom);
winEmailTo.SetText(emailInfo[emailInfoIndex].emailTo);
winEmailSubject.SetText(emailInfo[emailInfoIndex].emailSubject);

if (emailInfo[emailInfoIndex].emailCC != "")
{
winEmailCCHeader.Show();
winEmailCC.SetText(emailInfo[emailInfoIndex].emailCC);
}
else
{
winEmailCCHeader.Hide();
}

// Process the body
winEmail.SetText("");
ProcessDeusExText(emailInfo[emailInfoIndex].emailName, winEmail);

SetCompOwner (ElectronicDevices newCompOwner)


local String emailName;
local String missionNumber;
local DeusExLevelInfo info;
local int emailInfoIndex;
local int rowId;


Super.SetCompOwner(newCompOwner);

info = player.GetLevelInfo();

// hack for the DX.DX splash level
if (info != None)
{
if (info.MissionNumber < 10)
MissionNumber = "0" $ String(info.MissionNumber);
else
MissionNumber = String(info.MissionNumber);
}

// Open the email menu based on the login id
// or if it's been hacked, use the first account in the list
emailName = MissionNumber $ "_EmailMenu_" $ winTerm.GetUserName();

ProcessDeusExText(StringToName(emailName));

if (emailIndex != -1)
{
// Now populate our list
for(emailInfoIndex=0; emailInfoIndex<=emailIndex; emailInfoIndex++)
lstEmail.AddRow(emailInfo[emailInfoIndex].emailFrom $ ";" $
emailInfo[emailInfoIndex].emailSubject $ ";" $
emailInfoIndex);

// Select the first row
rowId = lstEmail.IndexToRowId(0);
lstEmail.SetRow(rowId, True);
}
else
{
// No Email, so just print a "No Email Today!" message
winEmail.SetText(NoEmailTodayText);
winEmail.SetTextAlignments(HALIGN_Center, VALIGN_Center);
}

SetNetworkTerminal (NetworkTerminal newTerm)


Super.SetNetworkTerminal(newTerm);

if (winTerm.AreSpecialOptionsAvailable())
{
btnSpecial = winButtonBar.AddButton(ButtonLabelSpecial, HALIGN_Left);
CreateLeftEdgeWindow();
}

// Create the Hack Accounts window (will only be created
// if the user hacked into the computer)

winTerm.CreateHackAccountsWindow();

WindowReady


SetFocusWindow(lstEmail);




ComputerScreenHack.uc (extends HUDBaseWindow)

var PersonaNormalTextWindow winDigits;
var PersonaHeaderTextWindow winHackMessage;
var PersonaActionButtonWindow btnHack;
var ProgressBarWindow barHackProgress;
var NetworkTerminal winTerm;
var Float detectionTime;
var Float saveDetectionTime;
var Float hackTime;
var Float saveHackTime;
var Float blinkTimer;
var Float digitUpdateTimer;
var Float hackDetectedDelay;
var Bool bHacking;
var Bool bHacked;
var Bool bHackDetected;
var Bool bHackDetectedNotified;
var Int digitWidth;
var String digitStrings[4];
var String digitFillerChars;
var Color colDigits;
var Color colRed;
var Texture texBackground;
var Texture texBorder;
var localized String HackButtonLabel;
var localized String ReturnButtonLabel;
var localized String HackReadyLabel;
var localized String HackInitializingLabel;
var localized String HackSuccessfulLabel;
var localized String HackDetectedLabel;
var localized String MPHackInitializingLabel;
blinkTimer=1.000000
digitUpdateTimer=0.050000
hackDetectedDelay=3.000000
digitWidth=23
digitFillerChars="01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_+-=][}{"
colDigits=(G=128)
colRed=(R=255)
texBackground=Texture'DeusExUI.UserInterface.ComputerHackBackground'
texBorder=Texture'DeusExUI.UserInterface.ComputerHackBorder'
HackButtonLabel="|&Hack"
ReturnButtonLabel="|&Return"
HackReadyLabel="Ice Breaker Ready..."
HackInitializingLabel="Initializing ICE Breaker..."
HackSuccessfulLabel="ICE Breaker Hack Successful..."
HackDetectedLabel="*** WARNING ***|nINTRUDER DETECTED!"
MPHackInitializingLabel="Hacking... Hit ESC to Abort"
backgroundWidth=187
backgroundHeight=94
backgroundPosX=14
backgroundPosY=13

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnHack:
if (winTerm != None)
{
if (bHacked)
winTerm.ComputerHacked();
else
StartHack();

btnHack.SetSensitivity(False);
}
break;

default:
bHandled = False;
break;
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

CreateControls


CreateTextDigits();
CreateHackMessageWindow();
CreateHackProgressBar();
CreateHackButton();

CreateHackButton


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(20, 86);
winActionButtons.SetWidth(88);
winActionButtons.FillAllSpace(False);

btnHack = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnHack.SetButtonText(HackButtonLabel);

CreateHackMessageWindow


winHackMessage = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
winHackMessage.SetPos(22, 19);
winHackMessage.SetSize(168, 47);
winHackMessage.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winHackMessage.SetBackgroundStyle(DSTY_Modulated);
winHackMessage.SetBackground(Texture'HackInfoBackground');

CreateHackProgressBar


barHackProgress = ProgressBarWindow(NewChild(Class'ProgressBarWindow'));
barHackProgress.SetPos(22, 71);
barHackProgress.SetSize(169, 12);
barHackProgress.SetValues(0, 100);
barHackProgress.SetVertical(False);
barHackProgress.UseScaledColor(True);
barHackProgress.SetDrawBackground(False);
barHackProgress.SetCurrentValue(100);

CreateTextDigits


winDigits = PersonaNormalTextWindow(NewChild(Class'PersonaNormalTextWindow'));
winDigits.SetPos(22, 19);
winDigits.SetSize(168, 47);
winDigits.SetFont(Font'FontFixedWidthSmall');
winDigits.SetTextColor(colDigits);
winDigits.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winDigits.SetTextMargins(0, 0);

DestroyWindow


if ((bHackDetected) && (!bHackDetectedNotified) && (winTerm != None))
winTerm.HackDetected(True);

Super.DestroyWindow();

DrawBackground (GC gc)


gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawTexture(
backgroundPosX, backgroundPosY,
backgroundWidth, backgroundHeight,
0, 0, texBackground);

DrawBorder (GC gc)


if (bDrawBorder)
{
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);
gc.DrawTexture(0, 0, 221, 112, 0, 0, texBorder);
}

FinishHack


bHacked = True;

// Display hack message
SetHackMessage(HackSuccessfulLabel);

winDigits.SetText("");

if (winTerm != None)
winTerm.ComputerHacked();

GetSaveDetectionTime -> Float


return saveDetectionTime;

HackDetected


bHackDetected = True;
blinkTimer = Default.blinkTimer;
detectionTime = hackDetectedDelay;
bTickEnabled = True;
SetHackMessage(HackDetectedLabel);
winHackMessage.SetTextColor(colRed);

InitWindow


Super.InitWindow();

SetSize(215, 112);

CreateControls();

SetHackMessage(HackReadyLabel);

SetDetectionTime (Float newDetectionTime, Float newHackTime)


// The detection time is how long it takes before the user is
// caught and electrified. This now includes the Hack time to
// give the player the perception that he's being tracked
// immediately (a little more tense). When in reality he has the
// same amount of "detection" time (once hacked) as before.

detectionTime = newDetectionTime + newHackTime;
saveDetectionTime = detectionTime;

// Hack time is also based on skill
hackTime = newHackTime;
saveHackTime = hackTime;

SetHackButtonToReturn


btnHack.SetSensitivity(True);
btnHack.SetButtonText(ReturnButtonLabel);

SetHackMessage (String newHackMessage)


if (newHackMessage == "")
winHackMessage.Hide();
else
winHackMessage.Show();

winHackMessage.SetText(newHackMessage);

SetNetworkTerminal (NetworkTerminal newTerm)


winTerm = newTerm;

StartHack


bHacking = True;
bTickEnabled = True;

// Display hack message
if (Player.Level.NetMode == NM_Standalone)
SetHackMessage(HackInitializingLabel);
else
SetHackMessage(MPHackInitializingLabel);

Tick (float deltaTime)


if (bHacking) // manage initial hacking
{
hackTime -= deltaTime;
blinkTimer -= deltaTime;
digitUpdateTimer -= deltaTime;

// Update blinking text
if (blinkTimer < 0)
{
if (winHackMessage.GetText() == "")
{
blinkTimer = Default.blinkTimer;
// Display hack message
if (Player.Level.NetMode == NM_Standalone)
SetHackMessage(HackInitializingLabel);
else
SetHackMessage(MPHackInitializingLabel);
}
else
{
blinkTimer = Default.blinkTimer / 3;
winHackMessage.SetText("");
}
}

// Update scrolling text
if (digitUpdateTimer < 0)
{
digitUpdateTimer = Default.digitUpdateTimer;
UpdateDigits();
}

if (hackTime < 0)
{
bHacking = False;
FinishHack();
}
}

if (bHackDetected)
{
detectionTime -= deltaTime;
blinkTimer -= deltaTime;

// Update blinking text
if (blinkTimer < 0)
{
if (winHackMessage.GetText() == "")
{
blinkTimer = Default.blinkTimer;
winHackMessage.SetText(HackDetectedLabel);
}
else
{
blinkTimer = Default.blinkTimer / 3;
winHackMessage.SetText("");
}
}

if (detectionTime < 0)
{
if (winTerm != None)
{
bHackDetectedNotified = True;
winTerm.HackDetected();
}
}
}
else
{
// manage detection
detectionTime -= deltaTime;

// Update the progress bar
UpdateHackBar();

if (detectionTime < 0)
{
detectionTime = 0;
bTickEnabled = False;
HackDetected();
}
}

UpdateDetectionTime (Float newDetectionTime)


detectionTime = newDetectionTime;

// Update the progress bar
UpdateHackBar();

UpdateDigits


local bool bSpace;
local int stringIndex;


// First move down the existing strings

for(stringIndex=arrayCount(digitStrings)-1; stringIndex>0; stringIndex--)
digitStrings[stringIndex] = digitStrings[stringIndex-1];

// Now fill the string. As we get closer to detection time,
// will fill with more characters

digitStrings[0] = "";

for(stringIndex=0; stringIndex {
// Calculate chance that this is a space
bSpace = ((saveHackTime - hackTime) / saveHackTime) > FRand();

if (bSpace)
digitStrings[0] = digitStrings[0] $ " ";
else
digitStrings[0] = digitStrings[0] $ Mid(digitFillerChars, Rand(Len(digitFillerChars)) + 1, 1);
}

winDigits.SetText("");

for(stringIndex=0; stringIndex {
winDigits.AppendText(digitStrings[stringIndex]);
if (stringIndex - 1 == arrayCount(digitStrings))
winDigits.AppendText("|n");
}

UpdateHackBar


local float percentRemaining;


percentRemaining = (detectionTime / saveDetectionTime) * 100;
barHackProgress.SetCurrentValue(percentRemaining);

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;

bKeyHandled = True;

switch( key )
{
case IK_Escape:
winTerm.ForceCloseScreen();
break;

default:
bKeyHandled = False;
}

if (bKeyHandled)
return True;
else
return Super.VirtualKeyPressed(key, bRepeat);




ComputerScreenHackAccounts.uc (extends HUDBaseWindow)

var PersonaActionButtonWindow btnChangeAccount;
var PersonaHeaderTextWindow winCurrentUser;
var PersonaListWindow lstAccounts;
var NetworkTerminal winTerm;
var Computers compOwner; // what computer owns this window?
var Texture texBackground;
var Texture texBorder;
var localized String ChangeAccountButtonLabel;
var localized String AllAccountsHeader;
var localized String CurrentAccountHeader;
texBackground=Texture'DeusExUI.UserInterface.ComputerHackAccountsBackground'
texBorder=Texture'DeusExUI.UserInterface.ComputerHackAccountsBorder'
ChangeAccountButtonLabel="|&Change Account"
AllAccountsHeader="All User Accounts"
CurrentAccountHeader="Current User"
backgroundWidth=188
backgroundHeight=181
backgroundPosX=6
backgroundPosY=9

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnChangeAccount:
ChangeSelectedAccount();
break;

default:
bHandled = False;
break;
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

ChangeSelectedAccount


local int userIndex;


userIndex = lstAccounts.RowIdToIndex(lstAccounts.GetSelectedRow());

if (winTerm != None)
winTerm.ChangeAccount(userIndex);

CreateAccountsList


local PersonaScrollAreaWindow winScroll;


winScroll = PersonaScrollAreaWindow(NewChild(Class'PersonaScrollAreaWindow'));;
winScroll.SetPos(14, 69);
winScroll.SetSize(170, 97);

lstAccounts = PersonaListWindow(winScroll.clipWindow.NewChild(Class'PersonaListWindow'));
lstAccounts.EnableMultiSelect(False);
lstAccounts.EnableAutoExpandColumns(False);
lstAccounts.EnableHotKeys(False);
lstAccounts.SetNumColumns(1);
lstAccounts.SetColumnWidth(0, 170);

CreateChangeAccountButton


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(12, 169);
winActionButtons.SetWidth(174);
winActionButtons.FillAllSpace(False);

btnChangeAccount = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnChangeAccount.SetButtonText(ChangeAccountButtonLabel);

CreateControls


CreateChangeAccountButton();
CreateCurrentUserWindow();
CreateAccountsList();
CreateHeaders();

CreateCurrentUserWindow


winCurrentUser = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
winCurrentUser.SetPos(16, 29);
winCurrentUser.SetSize(170, 12);

CreateHeaders


local MenuUIHeaderWindow winHeader;


winHeader = MenuUIHeaderWindow(NewChild(Class'MenuUIHeaderWindow'));
winHeader.SetPos(12, 12);
winHeader.SetText(CurrentAccountHeader);

winHeader = MenuUIHeaderWindow(NewChild(Class'MenuUIHeaderWindow'));
winHeader.SetPos(12, 53);
winHeader.SetText(AllAccountsHeader);

DrawBackground (GC gc)


gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawTexture(
backgroundPosX, backgroundPosY,
backgroundWidth, backgroundHeight,
0, 0, texBackground);

DrawBorder (GC gc)


if (bDrawBorder)
{
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);
gc.DrawTexture(0, 0, 206, 232, 0, 0, texBorder);
}

InitWindow


Super.InitWindow();

SetSize(206, 232);

CreateControls();

ListRowActivated (window list, int rowId) -> bool


ChangeSelectedAccount();
return TRUE;

SetCompOwner (ElectronicDevices newCompOwner)


local int compIndex;
local int rowId;
local int userRowIndex;


compOwner = Computers(newCompOwner);

// Loop through the names and add them to our listbox
for (compIndex=0; compIndex {
lstAccounts.AddRow(Caps(compOwner.GetUserName(compIndex)));

if (Caps(winTerm.GetUserName()) == Caps(compOwner.GetUserName(compIndex)))
userRowIndex = compIndex;
}

// Select the row that matches the current user
rowId = lstAccounts.IndexToRowId(userRowIndex);
lstAccounts.SetRow(rowId, True);

SetNetworkTerminal (NetworkTerminal newTerm)


winTerm = newTerm;
UpdateCurrentUser();

UpdateCurrentUser


if (winTerm != None)
winCurrentUser.SetText(winTerm.GetUserName());

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;

bKeyHandled = True;

switch( key )
{
case IK_Escape:
winTerm.ForceCloseScreen();
break;

default:
bKeyHandled = False;
}

if (bKeyHandled)
return True;
else
return Super.VirtualKeyPressed(key, bRepeat);




ComputerScreenLogin.uc (extends ComputerUIWindow)

var MenuUIActionButtonWindow btnLogin;
var MenuUIActionButtonWindow btnCancel;
var MenuUISmallLabelWindow winLoginInfo;
var MenuUIEditWindow editUserName;
var MenuUIEditWindow editPassword;
var Window winLogo;
var localized String UserNameLabel;
var localized String PasswordLabel;
var localized String InvalidLoginMessage;
UserNameLabel="User Name"
PasswordLabel="Password"
InvalidLoginMessage="LOGIN ERROR - ACCESS DENIED"
Title="Welcome to %s"
ClientWidth=343
ClientHeight=151
clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerLogonBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerLogonBackground_2'
textureRows=1
textureCols=2
statusPosY=131
ComputerNodeFunctionLabel="Login"

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnLogin:
ProcessLogin();
break;

case btnCancel:
CloseScreen("EXIT");
break;

default:
bHandled = False;
break;
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

CreateControls


Super.CreateControls();

btnCancel = winButtonBar.AddButton(ButtonLabelCancel, HALIGN_Right);
btnLogin = winButtonBar.AddButton(ButtonLabelLogin, HALIGN_Right);

CreateMenuLabel(10, 22, UserNameLabel, winClient);
CreateMenuLabel(10, 55, PasswordLabel, winClient);

editUserName = CreateMenuEditWindow(105, 20, 143, 20, winClient);
editPassword = CreateMenuEditWindow(105, 54, 143, 20, winClient);

CreateLogo();
CreateLoginInfoWindow();

CreateLoginInfoWindow


winLoginInfo = MenuUISmallLabelWindow(winClient.NewChild(Class'MenuUISmallLabelWindow'));

winLoginInfo.SetPos(10, 97);
winLoginInfo.SetSize(320, 25);
winLoginInfo.SetTextAlignments(HALIGN_Left, VALIGN_Center);
winLoginInfo.SetTextMargins(0, 0);


winLogo = winClient.NewChild(Class'Window');

winLogo.SetPos(276, 5);
winLogo.SetSize(61, 61);
winLogo.SetBackgroundStyle(DSTY_Masked);

EditActivated (window edit, bool bModified) -> bool


if (btnLogin.IsSensitive())
{
ProcessLogin();
return True;
}
else
{
return False;
}

EnableButtons


// Text must be entered in the two fields for the login button to be
// enabled

btnLogin.SetSensitivity((editUsername.GetText() != "") && (editPassword.GetText() != ""));

InitWindow


Super.InitWindow();
EnableButtons();

ProcessLogin


local string userName;
local int userIndex;
local int compIndex;
local int userSkillLevel;
local bool bSuccessfulLogin;


bSuccessfulLogin = False;
userIndex = -1;

// Verify that this is a valid userid/password combination

// First check the name
for (compIndex=0; compIndex {
if (Caps(editUsername.GetText()) == Caps(Computers(compOwner).GetUserName(compIndex)))
{
userName = Caps(Computers(compOwner).GetUserName(compIndex));
userIndex = compIndex;
break;
}
}

if (userIndex != -1)
{
if (Caps(editPassword.GetText()) == Caps(Computers(compOwner).GetPassword(userIndex)))
{
bSuccessfulLogin = True;
}
}

if (bSuccessfulLogin)
{
winTerm.SetLoginInfo(userName, userIndex);

// set the user's access level if it's higher than the player's
userSkillLevel = Computers(compOwner).GetAccessLevel(userIndex);

if (winTerm.GetSkillLevel() < userSkillLevel)
winTerm.SetSkillLevel(userSkillLevel);

CloseScreen("LOGIN");
}
else
{
// Print a message about invalid login
winLoginInfo.SetText(InvalidLoginMessage);

// Clear text fields and reset focus
editUserName.SetText("");
editPassword.SetText("");
SetFocusWindow(editUserName);
}

SetCompOwner (ElectronicDevices newCompOwner)


Super.SetCompOwner(newCompOwner);

// Update the title, texture and description
winTitle.SetTitle(Sprintf(Title, Computers(compOwner).GetNodeName()));
winLoginInfo.SetText(Computers(compOwner).GetNodeDesc());

SetFocusWindow(editUserName);

SetLogo(Computers(compOwner).GetNodeTexture());


if (winLogo != None)
winLogo.SetBackground(newLogo);

SetNetworkTerminal (NetworkTerminal newTerm)


Super.SetNetworkTerminal(newTerm);

// If the user already hacked this computer, then set the
// "Hack" button to "Return"
if (winTerm != None)
winTerm.SetHackButtonToReturn();

TextChanged (window edit, bool bModified) -> bool


EnableButtons();

return False;




ComputerScreenSecurity.uc (extends ComputerUIWindow)

var MenuUISpecialButtonWindow btnPanUp;
var MenuUISpecialButtonWindow btnPanDown;
var MenuUISpecialButtonWindow btnPanLeft;
var MenuUISpecialButtonWindow btnPanRight;
var MenuUISpecialButtonWindow btnZoomIn;
var MenuUISpecialButtonWindow btnZoomOut;
var MenuUIActionButtonWindow btnSpecial;
var MenuUIActionButtonWindow btnLogout;
var MenuUISmallLabelWindow winInfo;
var ComputerSecuritySliderWindow winPanSlider;
var ComputerSecurityCameraWindow winCameras[3];
var ComputerSecurityCameraWindow selectedCamera;
var Class choices[4];
var ComputerCameraUIChoice choiceWindows[4];
var int choiceStartX;
var int choiceStartY;
var int choiceVerticalGap;
var int choiceActionButtonWidth;
var int doorTimerID;
var int networkTimerID;
var const int panSize;
var const float zoomSize;
var const int numPanTicks;
var const float lowPanValue;
var const float highPanValue;
var Float panMod;
var localized String ActiveWindowOptionsHeader;
var localized String CameraOptionsHeader;
var localized String PanZoomSpeedHeader;
var localized String ClickCameraWindowText;
choices(0)=Class'DeusEx.ComputerSecurityChoice_Camera'
choices(1)=Class'DeusEx.ComputerSecurityChoice_DoorAccess'
choices(2)=Class'DeusEx.ComputerSecurityChoice_DoorOpen'
choices(3)=Class'DeusEx.ComputerSecurityChoice_Turret'
choiceStartX=13
choiceStartY=30
choiceVerticalGap=34
choiceActionButtonWidth=143
doorTimerID=-1
networkTimerID=-1
panSize=256
zoomSize=2.000000
numPanTicks=9
lowPanValue=1.000000
highPanValue=5.000000
ActiveWindowOptionsHeader="Active Window Options"
CameraOptionsHeader="Camera Options"
PanZoomSpeedHeader="Pan/Zoom Speed"
ClickCameraWindowText="Click on a camera view to select that camera."
escapeAction="LOGOUT"
Title="Surveillance"
ClientWidth=622
ClientHeight=435
clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerSecurityBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerSecurityBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.ComputerSecurityBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.ComputerSecurityBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.ComputerSecurityBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.ComputerSecurityBackground_6'
textureRows=2
textureCols=3
bUsesStatusWindow=False
bAlwaysCenter=True
ComputerNodeFunctionLabel="Security"

AllyCamera


local SecurityCamera cam;


if (selectedCamera != None)
{
cam = selectedCamera.camera;

if (cam != None)
{
player.MakeCameraAlly(cam);
selectedCamera.UpdateCameraStatus();
}
if ((selectedCamera.turret != None) && (Player.Level.Netmode != NM_Standalone))
{
player.SetTurretTrackMode(ComputerSecurity(selectedCamera.compOwner),selectedCamera.turret,false,true);
selectedCamera.UpdateTurretStatus();
ComputerSecurityChoice_Turret(choiceWindows[3]).SetMPEnumState();
}
}

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

// First check if it's one of our camera buttons
if (buttonPressed.IsA('ComputerSecurityCameraViewButton'))
{
SelectCamera(ComputerSecurityCameraWindow(buttonPressed.GetParent()));
}
else
{
switch( buttonPressed )
{
case btnPanUp:
PanCamera(IK_Up);
break;

case btnPanDown:
PanCamera(IK_Down);
break;

case btnPanLeft:
PanCamera(IK_Left);
break;

case btnPanRight:
PanCamera(IK_Right);
break;

case btnZoomIn:
PanCamera(IK_GreyPlus);
break;

case btnZoomOut:
PanCamera(IK_GreyMinus);
break;

case btnSpecial:
CloseScreen("SPECIAL");
break;

case btnLogout:
CloseScreen("LOGOUT");
break;

default:
bHandled = False;
break;
}
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

CreateCameraButtons


btnPanUp = CreateSpecialButton(335, 58, Texture'SecurityButtonPanUp_Normal', Texture'SecurityButtonPanUp_Pressed');
btnPanDown = CreateSpecialButton(335, 98, Texture'SecurityButtonPanDown_Normal', Texture'SecurityButtonPanDown_Pressed');
btnPanLeft = CreateSpecialButton(309, 78, Texture'SecurityButtonPanLeft_Normal', Texture'SecurityButtonPanLeft_Pressed');
btnPanRight = CreateSpecialButton(361, 78, Texture'SecurityButtonPanRight_Normal', Texture'SecurityButtonPanRight_Pressed');
btnZoomIn = CreateSpecialButton(323, 31, Texture'SecurityButtonZoomIn_Normal', Texture'SecurityButtonZoomIn_Pressed');
btnZoomOut = CreateSpecialButton(349, 31, Texture'SecurityButtonZoomOut_Normal', Texture'SecurityButtonZoomOut_Pressed');

CreateCameraViewWindows


winCameras[0] = ComputerSecurityCameraWindow(winClient.NewChild(Class'ComputerSecurityCameraWindow'));
winCameras[0].SetPos(1, 175);
winCameras[0].SetViewIndex(0);

winCameras[1] = ComputerSecurityCameraWindow(winClient.NewChild(Class'ComputerSecurityCameraWindow'));
winCameras[1].SetPos(208, 175);
winCameras[1].SetViewIndex(1);

winCameras[2] = ComputerSecurityCameraWindow(winClient.NewChild(Class'ComputerSecurityCameraWindow'));
winCameras[2].SetPos(415, 175);
winCameras[2].SetViewIndex(2);

CreateChoices


local int choiceIndex;
local int choiceCount;
local ComputerCameraUIChoice newChoice;


// Loop through the Menu Choices and create the appropriate buttons
if (Player.Level.Netmode != NM_Standalone)
choices[0]=Class'ComputerSecurityChoice_MPCamera';

for(choiceIndex=0; choiceIndex {
if (choices[choiceIndex] != None)
{
newChoice = ComputerCameraUIChoice(winClient.NewChild(choices[choiceIndex]));
newChoice.SetPos(choiceStartX, choiceStartY + (choiceCount * choiceVerticalGap) - newChoice.buttonVerticalOffset);
newChoice.SetActionButtonWidth(choiceActionButtonWidth);

choiceWindows[choiceIndex] = newChoice;

choiceCount++;
}
}

CreateControls


Super.CreateControls();

btnLogout = winButtonBar.AddButton(ButtonLabelLogout, HALIGN_Right);

CreateChoices();
CreateCameraButtons();
CreateCameraViewWindows();
CreateHeaders();
CreatePanSlider();
CreateInfoWindow();

CreateHeaders


local MenuUIHeaderWindow winHeader;


winHeader = MenuUIHeaderWindow(winClient.NewChild(Class'MenuUIHeaderWindow'));
winHeader.SetFont(Font'FontMenuTitle');
winHeader.SetPos(12, 9);
winHeader.SetText(ActiveWindowOptionsHeader);

winHeader = MenuUIHeaderWindow(winClient.NewChild(Class'MenuUIHeaderWindow'));
winHeader.SetFont(Font'FontMenuTitle');
winHeader.SetPos(298, 9);
winHeader.SetTextAlignments(HALIGN_Center, VALIGN_Top);
winHeader.SetText(CameraOptionsHeader);

CreateInfoWindow


winInfo = MenuUISmallLabelWindow(winClient.NewChild(Class'MenuUISmallLabelWindow'));

winInfo.SetPos(9, 398);
winInfo.SetSize(600, 25);
winInfo.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winInfo.SetTextMargins(0, 0);
winInfo.SetText(ClickCameraWindowText);

CreatePanSlider


local MenuUIHeaderWindow winLabel;


winPanSlider = ComputerSecuritySliderWindow(winClient.NewChild(Class'ComputerSecuritySliderWindow'));
winPanSlider.SetPos(309, 146);
winPanSlider.SetTicks(numPanTicks, lowPanValue, highPanValue);

// Create a label as well

winLabel = MenuUIHeaderWindow(winClient.NewChild(Class'MenuUIHeaderWindow'));
winLabel.SetPos(302, 127);
winLabel.SetWidth(94);
winLabel.SetTextAlignments(HALIGN_Center, VALIGN_Top);
winLabel.SetText(PanZoomSpeedHeader);

CreateSpecialButton (int posX, int posY, Texture texNormal, Texture texPressed) -> MenuUISpecialButtonWindow


local MenuUISpecialButtonWindow winButton;


winButton = MenuUISpecialButtonWindow(winClient.NewChild(Class'MenuUISpecialButtonWindow'));
winButton.SetPos(posX, posY);
winButton.SetButtonTextures(texNormal, texPressed, texNormal, texPressed, texNormal, texPressed);
winButton.EnableAutoRepeat();

return winButton;

DestroyWindow


Super.DestroyWindow();

if (doorTimerID != -1)
{
RemoveTimer(doorTimerID);
doorTimerID = -1;
}

if (networkTimerID != -1)
{
Removetimer(networkTimerID);
networkTimerID = -1;
}

DoorRefreshTimer (int timerID, int invocations, int clientData)


winCameras[0].UpdateDoorStatus();
winCameras[1].UpdateDoorStatus();
winCameras[2].UpdateDoorStatus();

EnableCameraButtons (bool bEnable)


if (btnPanUp != None)
{
btnPanUp.EnableWindow(bEnable);
btnPanDown.EnableWindow(bEnable);
btnPanLeft.EnableWindow(bEnable);
btnPanRight.EnableWindow(bEnable);
btnZoomIn.EnableWindow(bEnable);
btnZoomOut.EnableWindow(bEnable);
}

InitCameras


local int cameraIndex;
local name tag;
local SecurityCamera camera;
local AutoTurret turret;
local DeusExMover door;


for (cameraIndex=0; cameraIndex {
winCameras[cameraIndex].compOwner = Computers(compOwner);
winCameras[cameraIndex].camera = None;

tag = ComputerSecurity(compOwner).Views[cameraIndex].cameraTag;
if (tag != '')
{
foreach player.AllActors(class'SecurityCamera', camera, tag)
{
// force the camera to wake up
camera.bStasis = False;
winCameras[cameraIndex].camera = camera;
}
}

winCameras[cameraIndex].turret = None;
tag = ComputerSecurity(compOwner).Views[cameraIndex].turretTag;
if (tag != '')
foreach player.AllActors(class'AutoTurret', turret, tag)
winCameras[cameraIndex].turret = turret;

winCameras[cameraIndex].door = None;
tag = ComputerSecurity(compOwner).Views[cameraIndex].doorTag;
if (tag != '')
foreach player.AllActors(class'DeusExMover', door, tag)
winCameras[cameraIndex].door = door;

winCameras[cameraIndex].UpdateCameraStatus();
winCameras[cameraIndex].UpdateTurretStatus();
winCameras[cameraIndex].UpdateDoorStatus();
winCameras[cameraIndex].winCamera.Show();
}

// Select the first security camera
SelectFirstCamera();

InitWindow


Super.InitWindow();

// set up the timer to auto-update the door status
if (doorTimerID == -1)
doorTimerID = AddTimer(0.25, True, 0, 'DoorRefreshTimer');

// setup the timer for refreshing the screen in multiplayer
if (networkTimerID == -1)
networkTimerID = AddTimer(0.25, True, 0, 'NetworkRefreshTimer');

NetworkRefreshTimer (int timerID, int invocations, int clientData)


local int cameraIndex;


for (cameraIndex = 0; cameraIndex < arrayCount(winCameras); cameraIndex++)
{
winCameras[cameraIndex].UpdateCameraStatus();
winCameras[cameraIndex].UpdateTurretStatus();
winCameras[cameraIndex].UpdateDoorStatus();
}

PanCamera (EInputKey key)


local bool bKeyHandled;
local Rotator rot;
local float fov;
local float localPanMod;


if (selectedCamera == None)
return;

localPanMod = panMod;


if (IsKeyDown(IK_Shift))
localPanMod = Max(localPanMod * 2, 5.0);

// DEUS_EX AMSD Use replicated rotation.
rot = selectedCamera.camera.ReplicatedRotation;
fov = selectedCamera.winCamera.fov;

switch(key)
{
case IK_Left: rot.Yaw -= localPanMod * panSize * (fov / 90.0);
break;

case IK_Right: rot.Yaw += localPanMod * panSize * (fov / 90.0);
break;

case IK_Up: rot.Pitch += localPanMod * panSize * (fov / 90.0);
break;

case IK_Down: rot.Pitch -= localPanMod * panSize * (fov / 90.0);
break;

case IK_GreyPlus:
case IK_Equals: fov -= localPanMod * zoomSize;
break;

case IK_GreyMinus:
case IK_Minus: fov += localPanMod * zoomSize;
break;
}

player.UpdateCameraRotation(selectedCamera.camera,rot);
//selectedCamera.camera.DesiredRotation = rot;

// limit the zoom level
fov = FClamp(fov, 5, 90);
selectedCamera.winCamera.SetFOVAngle(fov);

SelectCamera (ComputerSecurityCameraWindow newCamera)


if (newCamera != selectedCamera)
{
if (selectedCamera != None)
selectedCamera.btnCamera.SelectButton(False);

selectedCamera = newCamera;

if (selectedCamera != None)
selectedCamera.btnCamera.SelectButton(True);
}
UpdateActionButtons();

SelectFirstCamera


local int cameraIndex;
local bool bCameraSelected;


/*
for(cameraIndex=0; cameraIndex {
if (winCameras[cameraIndex].camera != None)
{
winCameras[cameraIndex].btnCamera.PressButton(IK_None);
bCameraSelected = True;
break;
}
}

if (!bCameraSelected)
SelectCamera(None);
*/
// Always want to select the first camera, even if it's static
// (as doors can still be controlled)

winCameras[0].btnCamera.PressButton(IK_None);
bCameraSelected = True;

SetCompOwner (ElectronicDevices newCompOwner)


Super.SetCompOwner(newCompOwner);

InitCameras();

SetNetworkTerminal (NetworkTerminal newTerm)


Super.SetNetworkTerminal(newTerm);

if (winTerm.AreSpecialOptionsAvailable())
{
btnSpecial = winButtonBar.AddButton(ButtonLabelSpecial, HALIGN_Left);
CreateLeftEdgeWindow();
}

// Check the user's skill level and possibly disable the Turret button
// if the user Hacked into the computer.
//
// Turrets are only usable at Advanced or higher

// DEUS_EX AMSD in multiplayer, all hackers can affect turrets

if (Player.Level.NetMode == NM_Standalone)
{
if ((winTerm.GetSkillLevel() < 2) && (winTerm.bHacked))
choiceWindows[3].DisableChoice();
}

SetTurretState (bool bActive, bool bDisabled)


if ((selectedCamera != None) && (selectedCamera.turret != None))
{
player.SetTurretState(selectedCamera.turret,bActive,bDisabled);
selectedCamera.UpdateTurretStatus();

//make camera match
if ((SelectedCamera.Camera != None) && (Player.Level.Netmode != NM_Standalone))
{
if (selectedCamera.camera.bActive != bActive)
player.ToggleCameraState(selectedCamera.camera, compOwner);
selectedCamera.UpdateCameraStatus();
ComputerSecurityChoice_MPCamera(choiceWindows[0]).SetMPEnumState();
}
}

SetTurretTrackMode (bool bTrackPlayers, bool bTrackPawns)


if ((selectedCamera != None) && (selectedCamera.turret != None))
{
player.SetTurretTrackMode(ComputerSecurity(selectedCamera.compOwner),selectedCamera.turret,bTrackPlayers,bTrackPawns);
selectedCamera.UpdateTurretStatus();

if ((selectedCamera.camera != None) && (Player.Level.Netmode != NM_Standalone))
{
player.MakeCameraAlly(selectedCamera.camera);
selectedCamera.UpdateCameraStatus();
ComputerSecurityChoice_MPCamera(choiceWindows[0]).SetMPEnumState();
}
}

ToggleCameraState (optional bool bCamIsActive, optional bool bCamWasActive)


local SecurityCamera cam;


if (selectedCamera != None)
{
cam = selectedCamera.camera;

if (cam != None)
{
player.ToggleCameraState(cam, compOwner);

selectedCamera.UpdateCameraStatus();

//make turret match, yes, I suck.
if ((SelectedCamera.Turret != None) && (Player.Level.Netmode != NM_Standalone))
{
//if ((selectedCamera.Turret.bActive != cam.bActive) || (selectedCamera.Turret.bDisabled == cam.bActive))
player.SetTurretState(SelectedCamera.Turret,bCamIsActive,!bCamIsActive);
selectedCamera.UpdateTurretStatus();
ComputerSecurityChoice_Turret(choiceWindows[3]).SetMPEnumState();
}
}
}

ToggleDoorLock


local DeusExMover M;


if ((selectedCamera != None) && (selectedCamera.door != None))
{
// be sure to lock/unlock all matching tagged doors
foreach player.AllActors(class'DeusExMover', M, selectedCamera.door.Tag)
M.bLocked = !M.bLocked;

selectedCamera.UpdateDoorStatus();
}

TriggerDoor


local DeusExMover M;


if ((selectedCamera != None) && (selectedCamera.door != None))
{
// be sure to trigger all matching tagged doors
foreach player.AllActors(class'DeusExMover', M, selectedCamera.door.Tag)
M.Trigger(compOwner, player);

selectedCamera.UpdateDoorStatus();
}

UpdateActionButtons


local int choiceIndex;


for (choiceIndex=0; choiceIndex {
choiceWindows[choiceIndex].SetSecurityWindow(Self);
choiceWindows[choiceIndex].SetCameraView(selectedCamera);
}

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;


bKeyHandled = True;

switch(key)
{
case IK_Left:
case IK_Right:
case IK_Up:
case IK_Down:
case IK_GreyPlus:
case IK_Equals:
case IK_GreyMinus:
case IK_Minus:
PanCamera(key);
break;

case IK_1:
winCameras[0].btnCamera.PressButton();
break;
case IK_2:
winCameras[1].btnCamera.PressButton();
break;
case IK_3:
winCameras[2].btnCamera.PressButton();
break;

default:
bKeyHandled = False;
break;
}

if (!bKeyHandled)
return Super.VirtualKeyPressed(key, bRepeat);
else
return bKeyHandled;




ComputerScreenSpecialOptions.uc (extends ComputerUIWindow)

var int specialIndex;
var MenuUIChoiceButton btnSpecial;
var S_OptionButtons optionButtons[4];
var MenuUIActionButtonWindow btnReturn;
var MenuUIActionButtonWindow btnLogout;
var MenuUISmallLabelWindow winSpecialInfo;
var int buttonLeftMargin;
var int firstButtonPosY;
var int specialOffsetY;
var int statusPosYOffset;
var int TopTextureHeight;
var int MiddleTextureHeight;
var int BottomTextureHeight;
var localized String SecurityButtonLabel;
var localized String EmailButtonLabel;
buttonLeftMargin=25
firstButtonPosY=17
specialOffsetY=16
statusPosYOffset=50
TopTextureHeight=12
MiddleTextureHeight=30
BottomTextureHeight=75
SecurityButtonLabel="|&Security"
EmailButtonLabel="|&Email"
classClient=Class'DeusEx.ComputerUIScaleClientWindow'
escapeAction="LOGOUT"
Title="Special Options"
ClientWidth=331
clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerSpecialOptionsBackgroundTop_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerSpecialOptionsBackgroundTop_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.ComputerSpecialOptionsBackgroundMiddle_1'
clientTextures(3)=Texture'DeusExUI.UserInterface.ComputerSpecialOptionsBackgroundMiddle_2'
clientTextures(4)=Texture'DeusExUI.UserInterface.ComputerSpecialOptionsBackgroundBottom_1'
clientTextures(5)=Texture'DeusExUI.UserInterface.ComputerSpecialOptionsBackgroundBottom_2'
textureCols=2
bAlwaysCenter=True
ComputerNodeFunctionLabel="SpecialOptions"

ActivateSpecialOption (MenuUIChoiceButton buttonPressed)


local int buttonIndex;
local int specialIndex;
local Actor A;


specialIndex = -1;

// Loop through the buttons and find a Match!
for(buttonIndex=0; buttonIndex {
if (optionButtons[buttonIndex].btnSpecial == buttonPressed)
{
specialIndex = optionButtons[buttonIndex].specialIndex;

// Disable this button so the user can't activate this
// choice again
optionButtons[buttonIndex].btnSpecial.SetSensitivity(False);

break;
}
}

// If we found the matching button, activate the option!
if (specialIndex != -1)
{
// Make sure this option wasn't already triggered
if (!Computers(compOwner).specialOptions[specialIndex].bAlreadyTriggered)
{
if (Computers(compOwner).specialOptions[specialIndex].TriggerEvent != '')
foreach player.AllActors(class'Actor', A, Computers(compOwner).specialOptions[specialIndex].TriggerEvent)
A.Trigger(None, player);

if (Computers(compOwner).specialOptions[specialIndex].UnTriggerEvent != '')
foreach player.AllActors(class'Actor', A, Computers(compOwner).specialOptions[specialIndex].UnTriggerEvent)
A.UnTrigger(None, player);

if (Computers(compOwner).specialOptions[specialIndex].bTriggerOnceOnly)
Computers(compOwner).specialOptions[specialIndex].bAlreadyTriggered = True;

// Display a message
winSpecialInfo.SetText(Computers(compOwner).specialOptions[specialIndex].TriggerText);
}
}

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


// First check to see if one of our Special Options
// buttons was pressed
if (buttonPressed.IsA('MenuUIChoiceButton'))
{
ActivateSpecialOption(MenuUIChoiceButton(buttonPressed));
bHandled = True;
}
else
{
bHandled = True;
switch( buttonPressed )
{
case btnLogout:
CloseScreen("LOGOUT");
break;

case btnReturn:
CloseScreen("RETURN");
break;

default:
bHandled = False;
break;
}
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

CreateClientWindow


Super.CreateClientWindow();

if (winClient != None)
ComputerUIScaleClientWindow(winClient).SetTextureHeights(TopTextureHeight, MiddleTextureHeight, BottomTextureHeight);

CreateControls


Super.CreateControls();

btnLogout = winButtonBar.AddButton(ButtonLabelLogout, HALIGN_Right);

CreateSpecialInfoWindow();

CreateOptionButtons


local int specialIndex;
local int numOptions;
local MenuUIChoiceButton winButton;


// Figure out how many special options we have

numOptions = 0;
for (specialIndex=0; specialIndex {
if ((Computers(compOwner).specialOptions[specialIndex].userName == "") || (Caps(Computers(compOwner).specialOptions[specialIndex].userName) == winTerm.GetUserName()))
{
if (Computers(compOwner).specialOptions[specialIndex].Text != "")
{
// Create the button
winButton = MenuUIChoiceButton(winClient.NewChild(Class'MenuUIChoiceButton'));
winButton.SetPos(buttonLeftMargin, firstButtonPosY + (numOptions * MiddleTextureHeight));
winButton.SetButtonText(Computers(compOwner).specialOptions[specialIndex].Text);
winButton.SetSensitivity(!Computers(compOwner).specialOptions[specialIndex].bAlreadyTriggered);
winButton.SetWidth(273);

optionButtons[numOptions].specialIndex = specialIndex;
optionButtons[numOptions].btnSpecial = winButton;

numOptions++;
}
}
}

ComputerUIScaleClientWindow(winClient).SetNumMiddleTextures(numOptions);

// Update the location of the Special Info window and the Status window
winSpecialInfo.SetPos(10, specialOffsetY + TopTextureHeight + (MiddleTextureHeight * numOptions));
statusPosY = statusPosYOffset + TopTextureHeight + (MiddleTextureHeight * numOptions);
AskParentForReconfigure();

CreateSpecialInfoWindow


winSpecialInfo = MenuUISmallLabelWindow(winClient.NewChild(Class'MenuUISmallLabelWindow'));

winSpecialInfo.SetPos(10, 97);
winSpecialInfo.SetSize(315, 25);
winSpecialInfo.SetTextAlignments(HALIGN_Left, VALIGN_Center);
winSpecialInfo.SetTextMargins(0, 0);

SetCompOwner (ElectronicDevices newCompOwner)


Super.SetCompOwner(newCompOwner);

CreateOptionButtons();

SetNetworkTerminal (NetworkTerminal newTerm)


Super.SetNetworkTerminal(newTerm);

if (winTerm.IsA('NetworkTerminalPersonal'))
btnReturn = winButtonBar.AddButton(EmailButtonLabel, HALIGN_Left);
else if (winTerm.IsA('NetworkTerminalSecurity'))
btnReturn = winButtonBar.AddButton(SecurityButtonLabel, HALIGN_Left);

if (btnReturn != None)
CreateLeftEdgeWindow();

UpdateOptionsButtons




ComputerSecurity.uc (extends Computers)

var() localized string titleString;
var() name cameraTag;
var() name turretTag;
var() name doorTag;
var() localized sViewInfo Views[3];
var int team;
Team=-1
terminalType=Class'DeusEx.NetworkTerminalSecurity'
lockoutDelay=120.000000
UserList(0)=(userName="SECURITY",Password="SECURITY")
ItemName="Security Computer Terminal"
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.ComputerSecurity'
SoundRadius=8
SoundVolume=255
SoundPitch=96
AmbientSound=Sound'DeusExSounds.Generic.SecurityL'
CollisionRadius=11.590000
CollisionHeight=10.100000
bCollideWorld=False
BindName="ComputerSecurity"

AdditionalActivation (DeusExPlayer ActivatingPlayer)


if (Level.NetMode != NM_Standalone)
SetControlledObjectOwners(ActivatingPlayer);

Super.AdditionalDeactivation(ActivatingPlayer);

AdditionalDeactivation (DeusExPlayer DeactivatingPlayer)


if (Level.NetMode != NM_Standalone)
SetControlledObjectOwners(None);

Super.AdditionalDeactivation(DeactivatingPlayer);

SetControlledObjectOwners (DeusExPlayer PlayerWhoOwns)


local int cameraIndex;
local name tag;
local SecurityCamera camera;
local AutoTurret turret;
local DeusExMover door;


for (cameraIndex=0; cameraIndex {
tag = Views[cameraIndex].cameraTag;
if (tag != '')
foreach AllActors(class'SecurityCamera', camera, tag)
camera.SetOwner(PlayerWhoOwns);

tag = Views[cameraIndex].turretTag;
if (tag != '')
foreach AllActors(class'AutoTurret', turret, tag)
turret.SetOwner(PlayerWhoOwns);

tag = Views[cameraIndex].doorTag;
if (tag != '')
foreach AllActors(class'DeusExMover', door, tag)
door.SetOwner(PlayerWhoOwns);

}





ComputerSecurityCameraViewButton.uc (extends ButtonWindow)

var DeusExPlayer player;
var Bool bSelected;
var Texture texBorders[9];
var StaticWindow winStatic;
var Color colSelectionBorder;
texBorders(0)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_TL'
texBorders(1)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_TR'
texBorders(2)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_BL'
texBorders(3)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_BR'
texBorders(4)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Left'
texBorders(5)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Right'
texBorders(6)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Top'
texBorders(7)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Bottom'
texBorders(8)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Center'
colSelectionBorder=(R=255,G=255,B=255)

CreateStaticWindow


// Window used to display static
winStatic = StaticWindow(NewChild(Class'StaticWindow', False));
winStatic.SetSize(200, 150);
winStatic.RandomizeStatic();
winStatic.SetPos(1, 1);
winStatic.SetBackgroundStyle(DSTY_Modulated);
winStatic.Raise();

DrawWindow (GC gc)


// Draw selection border
if (bSelected)
{
gc.SetTileColor(colSelectionBorder);
gc.SetStyle(DSTY_Masked);
gc.DrawBorders(0, 0, width, height, 0, 0, 0, 0, texBorders);
}

InitWindow


Super.InitWindow();

SetSize(202, 152);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

CreateStaticWindow();

SelectButton (Bool bNewSelected)


bSelected = bNewSelected;

SetStatic


winStatic.Raise();
winStatic.Show();




ComputerSecurityCameraWindow.uc (extends Window)

var DeusExRootWindow root; // Keep a pointer to the root window handy
var DeusExPlayer player; // Keep a pointer to the player for easy reference
var Computers compOwner; // what computer owns this window?
var ComputerSecurityCameraViewButton btnCamera;
var MenuUIHeaderWindow winTitle;
var MenuUIHeaderWindow winCameraStatus;
var MenuUIHeaderWindow winDoorStatus;
var MenuUIHeaderWindow winTurretStatus;
var int viewIndex;
var ViewportWindow winCamera;
var SecurityCamera camera;
var AutoTurret turret;
var DeusExMover door;
var localized string CameraLabel;
var localized string CameraStatusLabel;
var localized string DoorStatusLabel;
var localized string TurretStatusLabel;
var localized string OnLabel;
var localized string OffLabel;
var localized string FriendlyLabel;
var localized string HostileLabel;
var localized string DisabledLabel;
var localized string AttackingAlliesLabel;
var localized string AttackingEnemiesLabel;
var localized string AttackingEverythingLabel;
var localized String NoSignalLabel;
var localized String OpenLabel;
var localized String ClosedLabel;
var localized String LockedLabel;
var localized String UnlockedLabel;
CameraLabel="Camera"
CameraStatusLabel="Camera:"
DoorStatusLabel="Door:"
TurretStatusLabel="Turret:"
OnLabel="On"
OffLabel="Off"
FriendlyLabel="Detecting Enemies"
HostileLabel="Detecting Allies"
DisabledLabel="Bypassed"
AttackingAlliesLabel="Attacking Allies"
AttackingEnemiesLabel="Attacking Enemies"
AttackingEverythingLabel="Attacking Everything"
NoSignalLabel="NO SIGNAL"
OpenLabel="Open"
ClosedLabel="Closed"
LockedLabel="Locked"
UnlockedLabel="Unlocked"

CreateCameraButton


btnCamera = ComputerSecurityCameraViewButton(NewChild(Class'ComputerSecurityCameraViewButton'));
btnCamera.SetPos(0, 16);

CreateControls


CreateTitle();
CreateStatusLabels();
CreateCameraButton();
CreateViewportWindow();

CreateLabel (int posY, string labelText) -> MenuUIHeaderWindow


local MenuUIHeaderWindow newLabel;


newLabel = MenuUIHeaderWindow(NewChild(Class'MenuUIHeaderWindow'));
newLabel.SetPos(6, posY);
newLabel.SetText(labelText);

return newLabel;

CreateStatusLabels


winCameraStatus = CreateLabel(171, CameraStatusLabel);
winDoorStatus = CreateLabel(186, DoorStatusLabel);
winTurretStatus = CreateLabel(201, TurretStatusLabel);

CreateTitle


winTitle = CreateLabel(2, "");

CreateViewportWindow


winCamera = ViewportWindow(NewChild(class'ViewportWindow', False));
winCamera.SetSize(200, 150);
winCamera.SetPos(1, 17);

DestroyWindow


if (camera != None)
camera.bStasis = camera.Default.bStasis;

Super.DestroyWindow();

HideCameraLabels


winCameraStatus.Hide();
winDoorStatus.Hide();
winTurretStatus.Hide();

InitWindow


Super.InitWindow();

// Get a pointer to the root window
root = DeusExRootWindow(GetRootWindow());

// Get a pointer to the player
player = DeusExPlayer(root.parentPawn);

SetSize(202, 213);
CreateControls();

SetCameraStatus (bool bOn)


if (Player.Level.Netmode == NM_Standalone)
{
if (bOn)
winCameraStatus.SetText(CameraStatusLabel @ OnLabel);
else
winCameraStatus.SetText(CameraStatusLabel @ OffLabel);
}
else
{
if (!bOn)
winCameraStatus.SetText(CameraStatusLabel @ OffLabel);

else if (DeusExPlayer(camera.safetarget) == player)
winCameraStatus.SetText(CameraStatusLabel @ FriendlyLabel);

else if ( (TeamDMGame(player.DXGame) != None) && (player.PlayerReplicationInfo.team == camera.team) )
winCameraStatus.SetText(CameraStatusLabel @ FriendlyLabel);

else
winCameraStatus.SetText(CameraStatusLabel @ HostileLabel);
}

SetTitle (String newTitle)


winTitle.SetText(newTitle);

SetViewIndex (int newViewIndex)


viewIndex = newViewIndex;

ShowDoorLabel (bool bNewShow)


winDoorStatus.Show(bNewShow);

ShowTurretLabel (bool bNewShow)


winTurretStatus.Show(bNewShow);

UpdateCameraStatus


if (camera == None)
{
winCamera.EnableViewport(False);
winCamera.Lower();
btnCamera.SetStatic();
SetTitle(NoSignalLabel);
winCameraStatus.Hide();
HideCameraLabels();
}
else
{
winCamera.SetViewportActor(camera);
winCamera.EnableViewport(True);
winCamera.SetDefaultTexture(None);
winCamera.Lower();
SetTitle(CameraLabel @ "|&" $ String(viewIndex + 1) @ ":" @ ComputerSecurity(compOwner).Views[viewIndex].titleString);
winCameraStatus.Show();
SetCameraStatus(camera.bActive);
}

UpdateDoorStatus


local string str;
local int i;


if ((door == None) || (door.bDestroyed))
{
ShowDoorLabel(False);
}
else
{
ShowDoorLabel(True);

str = DoorStatusLabel;

if (door.KeyNum != 0)
str = str @ OpenLabel;
else
str = str @ ClosedLabel;

str = str $ ",";

if (door.bLocked)
str = str @ LockedLabel;
else
str = str @ UnlockedLabel;

winDoorStatus.SetText(str);
}

UpdateTurretStatus


local string str;


if (turret == None)
{
ShowTurretLabel(False);
}
else if (player.level.netmode == NM_Standalone)
{
ShowTurretLabel(True);

str = TurretStatusLabel;

if (turret.bDisabled)
str = str @ DisabledLabel;

else if (turret.bTrackPlayersOnly)
str = str @ AttackingAlliesLabel;

else if (turret.bTrackPawnsOnly)
str = str @ AttackingEnemiesLabel;

else
str = str @ AttackingEverythingLabel;

winTurretStatus.SetText(str);
}
else
{
ShowTurretLabel(True);

str = TurretStatusLabel;

// if disabled, disabled.
// if our player is safe, attacking enemies
// if it is our team, attacking enemies.
// otherwise, attacking allies.

if (turret.bDisabled)
str = str @ DisabledLabel;

else if (DeusExPlayer(turret.safetarget) == player)
str = str @ AttackingEnemiesLabel;

else if ( (TeamDMGame(player.DXGame) != None) && (player.PlayerReplicationInfo.team == turret.team) )
str = str @ AttackingEnemiesLabel;

else
str = str @ AttackingAlliesLabel;

winTurretStatus.SetText(str);
}




ComputerSecurityChoice_Camera.uc (extends ComputerCameraUIChoice)

enumText(0)="On"
enumText(1)="Off"
actionText="|&Camera Status"

ButtonActivated (Window buttonPressed) -> bool


Super.ButtonActivated(buttonPressed);
securityWindow.ToggleCameraState();
return True;

ButtonActivatedRight (Window buttonPressed) -> bool


Super.ButtonActivated(buttonPressed);
securityWindow.ToggleCameraState();
return True;

SetCameraView (ComputerSecurityCameraWindow newCamera)


Super.SetCameraView(newCamera);

if (winCamera != None)
{
if (winCamera.camera != None)
{
if (winCamera.camera.bActive)
SetValue(0);
else
SetValue(1);

EnableWindow();
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");
}

if (securityWindow != None)
securityWindow.EnableCameraButtons(winCamera.camera != None);
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");

if (securityWindow != None)
securityWindow.EnableCameraButtons(False);
}




ComputerSecurityChoice_DoorAccess.uc (extends ComputerCameraUIChoice)

enumText(0)="Locked"
enumText(1)="Unlocked"
actionText="Door |&Access"

ButtonActivated (Window buttonPressed) -> bool


Super.ButtonActivated(buttonPressed);
securityWindow.ToggleDoorLock();
return True;

ButtonActivatedRight (Window buttonPressed) -> bool


Super.ButtonActivated(buttonPressed);
securityWindow.ToggleDoorLock();
return True;

SetCameraView (ComputerSecurityCameraWindow newCamera)


Super.SetCameraView(newCamera);

if (winCamera != None)
{
if (winCamera.door != None)
{
EnableWindow(); // In case was previously disabled

if (winCamera.door.bLocked)
SetValue(0);
else
SetValue(1);
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");
}
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");
}




ComputerSecurityChoice_DoorOpen.uc (extends ComputerCameraUIChoice)

enumText(0)="Open"
enumText(1)="Closed"
actionText="|&Door Status"

ButtonActivated (Window buttonPressed) -> bool


Super.ButtonActivated(buttonPressed);
securityWindow.TriggerDoor();
return True;

ButtonActivatedRight (Window buttonPressed) -> bool


Super.ButtonActivated(buttonPressed);
securityWindow.TriggerDoor();
return True;

SetCameraView (ComputerSecurityCameraWindow newCamera)


Super.SetCameraView(newCamera);

if (winCamera != None)
{
if (winCamera.door != None)
{
EnableWindow(); // In case was previously disabled

if (winCamera.door.KeyNum != 0)
SetValue(0);
else
SetValue(1);
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");
}
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");
}




ComputerSecurityChoice_MPCamera.uc (extends ComputerCameraUIChoice)

enumText(0)="Off"
enumText(1)="Enemies"
enumText(2)="Allies"
actionText="|&Camera Status"

ButtonActivated (Window buttonPressed) -> bool


local bool bWasActive;


bWasActive = (GetValue() != 0);

Super.ButtonActivated(buttonPressed);
SetCameraState(bWasActive);
//securityWindow.ToggleCameraState();
return True;

ButtonActivatedRight (Window buttonPressed) -> bool


local bool bWasActive;


bWasActive = (GetValue() != 0);

Super.ButtonActivated(buttonPressed);
SetCameraState(bWasActive);
return True;

SetCameraState (bool bWasActive)


local bool bIsActive;


if (securitywindow.Player.Level.Netmode != NM_Standalone)
{
if (GetValue() == 2)
{
SetValue(0);
}
}

bIsActive = (GetValue() != 0);

if (bWasActive != bIsActive)
{
securityWindow.ToggleCameraState(bIsActive,bWasActive);
securityWindow.AllyCamera();
}

SetCameraView (ComputerSecurityCameraWindow newCamera)


Super.SetCameraView(newCamera);

if (winCamera != None)
{
if (winCamera.camera != None)
{
if (!winCamera.camera.bActive)
SetValue(0);
else if (DeusExPlayer(winCamera.camera.safetarget) == winCamera.player)
SetValue(1);
else if ( (winCamera.player.DXGame.IsA('TeamDMGame')) && (winCamera.player.PlayerReplicationInfo.team == winCamera.camera.team) )
SetValue(1);
else
SetValue(2);
EnableWindow();
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");
}

if (securityWindow != None)
securityWindow.EnableCameraButtons(winCamera.camera != None);
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");

if (securityWindow != None)
securityWindow.EnableCameraButtons(False);
}

SetMPEnumState


local int TurretState;

if ((winCamera != None) && (winCamera.camera != None))
{
TurretState = SecurityWindow.choiceWindows[3].GetValue();

if (TurretState == 0)
SetValue(0);
else if (TurretState == 2)
SetValue(1);
else
SetValue(2);
}




ComputerSecurityChoice_Turret.uc (extends ComputerCameraUIChoice)

enumText(0)="Bypassed"
enumText(1)="Allies"
enumText(2)="Enemies"
enumText(3)="Everything"
actionText="|&Turret Status"

ButtonActivated (Window buttonPressed) -> bool


Super.ButtonActivated(buttonPressed);
SetTurretState();
return True;

ButtonActivatedRight (Window buttonPressed) -> bool


Super.ButtonActivated(buttonPressed);
SetTurretState();
return True;

SetCameraView (ComputerSecurityCameraWindow newCamera)


Super.SetCameraView(newCamera);

if (winCamera != None)
{
if (winCamera.turret != None)
{
EnableWindow(); // In case was previously disabled

// DEUS_EX AMSD Multiplayer support
if (winCamera.player.Level.NetMode == NM_Standalone)
{
if (winCamera.turret.bDisabled)
SetValue(0);
else if (winCamera.turret.bTrackPlayersOnly)
SetValue(1);
else if (winCamera.turret.bTrackPawnsOnly)
SetValue(2);
else
SetValue(3);
}
else
{
if (winCamera.turret.bDisabled)
SetValue(0);
else if (DeusExPlayer(winCamera.turret.safetarget) == winCamera.player)
SetValue(2);
else if ( (winCamera.player.DXGame.IsA('TeamDMGame')) && (winCamera.player.PlayerReplicationInfo.team == winCamera.turret.team) )
SetValue(2);
else
SetValue(1);
}
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");
}
}
else
{
// Disable!
DisableWindow();
btnInfo.SetButtonText("");
}

SetMPEnumState


local int CameraState;

if (winCamera != None)
{
if (winCamera.turret != None)
{
CameraState = SecurityWindow.choiceWindows[0].GetValue();

if (CameraState == 0)
SetValue(0);
else if (CameraState == 1)
SetValue(2);
else
SetValue(1);
}
}

SetTurretState


//DEUS_EX AMSD In multiplayer, skip attack allies and attack everything settings.
if (securitywindow.Player.Level.Netmode != NM_Standalone)
{
if (GetValue() == 1)
SetValue(2);
else if (GetValue() == 3)
SetValue(0);
}
switch(GetValue())
{
case 0: // Disabled
securityWindow.SetTurretState(False, True);
break;

case 1: // Attack Allies
securityWindow.SetTurretState(True, False);
securityWindow.SetTurretTrackMode(True, False);
break;

case 2: // Attack Enemies
securityWindow.SetTurretState(True, False);
securityWindow.SetTurretTrackMode(False, True);
break;

case 3: // Attack Everything
securityWindow.SetTurretState(True, False);
securityWindow.SetTurretTrackMode(False, False);
break;
}




ComputerSecuritySliderWindow.uc (extends MenuUISliderButtonWindow)

defaultScaleTexture=Texture'DeusExUI.UserInterface.SecuritySliderBar'
DefaultWidth=77
defaultScaleWidth=77
bUseScaleText=False



ComputerUIScaleClientWindow.uc (extends MenuUIClientWindow)

var int numMiddleTextures;
var int topHeight;
var int middleHeight;
var int bottomHeight;
numMiddleTextures=1

DrawWindow (GC gc)


local int textureIndex;
local int middlePosY;
local int colIndex;
local int middleIndex;
local int middleTextureIndex;


// Draw window background
gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);

textureIndex = 0;
middlePosY = 0;

// Draw top textures
for(colIndex=0; colIndex gc.DrawIcon(colIndex * 256, 0, clientTextures[textureIndex++]);

// Draw middle textures
for(middleIndex=0; middleIndex {
middleTextureIndex = textureIndex;
for(colIndex=0; colIndex {
gc.DrawIcon(colIndex * 256, topHeight + middlePosY, clientTextures[middleTextureIndex++]);
}

middlePosY += middleHeight;
}

textureIndex = middleTextureIndex;

// Draw bottom textures
for(colIndex=0; colIndex gc.DrawIcon(colIndex * 256, topHeight + middlePosY, clientTextures[textureIndex++]);

SetNumMiddleTextures (int newNum)


numMiddleTextures = newNum;

// Now calculate and set the height of the window
// (width should already be set at this point)

SetHeight(topHeight + (middleHeight * numMiddleTextures) + bottomHeight);

SetTextureHeights (int newTopHeight, int newMiddleHeight, int newBottomHeight)


topHeight = newTopHeight;
middleHeight = newMiddleHeight;
bottomHeight = newBottomHeight;




ComputerUIWindow.uc (extends Window)

var DeusExRootWindow root; // Keep a pointer to the root window handy
var DeusExPlayer player; // Keep a pointer to the player for easy reference
var NetworkTerminal winTerm;
var MenuUITitleWindow winTitle; // Title bar, outside client
var MenuUIClientWindow winClient; // Window that contains all controls
var MenuUIActionButtonBarWindow winButtonBar; // Button Bar Window
var MenuUILeftEdgeWindow winLeftEdge;
var MenuUIRightEdgeWindow winRightEdge;
var MenuUIHelpWindow winStatus;
var Class classClient; // Which client class to use
var ElectronicDevices compOwner; // what computer owns this window?
var String escapeAction; // Action to invoke when Escape pressed
var Name fileName;
var String fileDescription;
var Name emailName;
var String emailSubject;
var String emailFrom;
var String emailTo;
var String emailCC;
var transient TextFileInfo fileInfo[10];
var transient TextEmailInfo emailInfo[10];
var int fileIndex;
var int emailIndex;
var Bool bWindowBeingDragged;
var Bool bAllowWindowDragging;
var Bool bWindowDragged;
var float windowStartDragX;
var float windowStartDragY;
var localized String title;
var int clientWidth;
var int clientHeight;
var int verticalOffset;
var Texture clientTextures[6];
var int textureRows;
var int textureCols;
var bool bActionButtonBarActive;
var bool bRightEdgeActive;
var bool bUsesStatusWindow;
var bool bAlwaysCenter;
var int statusPosY;
var int defaultStatusLeftOffset;
var int defaultStatusHeight;
var int defaultStatusClientDiffY;
var localized string ButtonLabelLogin;
var localized string ButtonLabelLogout;
var localized string ButtonLabelCancel;
var localized string ButtonLabelSpecial;
var localized string ComputerNodeFunctionLabel;
classClient=Class'DeusEx.MenuUIClientWindow'
escapeAction="EXIT"
bActionButtonBarActive=True
bUsesStatusWindow=True
defaultStatusLeftOffset=10
defaultStatusHeight=13
defaultStatusClientDiffY=21
ButtonLabelLogin="|&Login"
ButtonLabelLogout="|&Logout"
ButtonLabelCancel="|&Cancel"
ButtonLabelSpecial="|&Special Options"

ChangeAccount

ChildRequestedReconfiguration (window child) -> bool


return False;

CloseScreen (String action)


if (winTerm != None)
winTerm.CloseScreen(action);

ConfigurationChanged


local float clientWidth, clientHeight;
local float titleWidth, titleHeight, titleTopHeight, titleBarWidth;
local float leftEdgeWidth, leftEdgeHeight;
local float rightEdgeWidth, rightEdgeHeight;
local float buttonBarWidth, buttonBarHeight;
local float rightEdgeX, rightEdgeY;
local float winLeftEdgeGap;
local float rightEdgeGap;


// Client Window
if (winClient != None)
winClient.QueryPreferredSize(clientWidth, clientHeight);

// Title Bar
if (winTitle != None)
{
winTitle.QueryPreferredSize(titleBarWidth, titleHeight);
titleWidth = winTitle.leftBottomWidth;
titleTopHeight = winTitle.titleHeight;
}

// Button Bar
if (winButtonBar != None)
{
// If Right edge active, need to make button bar wider
if (winRightEdge != None)
{
winRightEdge.QueryPreferredSize(rightEdgeWidth, rightEdgeHeight);
rightEdgeWidth = winRightEdge.rightWidth;
rightEdgeGap = 2;
}

if (winLeftEdge != None)
winLeftEdgeGap = 1;

winButtonBar.QueryPreferredSize(buttonBarWidth, buttonBarHeight);
winButtonBar.ConfigureChild(
titleWidth + winLeftEdgeGap, titleTopHeight + clientHeight + verticalOffset,
clientWidth - 1 - rightEdgeGap, buttonBarHeight);
}

// Left Edge
if (winLeftEdge != None)
{
winLeftEdge.QueryPreferredSize(LeftEdgeWidth, LeftEdgeHeight);
winLeftEdge.ConfigureChild(
titleWidth - LeftEdgeWidth, titleHeight + verticalOffset,
LeftEdgeWidth, clientHeight + buttonBarHeight - (titleHeight - titleTopHeight) - 1);
}

// Right Edge
if (winRightEdge != None)
{
winRightEdge.ConfigureChild(
titleBarWidth + 1, titleTopHeight - 4 + verticalOffset,
clientWidth - (titleBarWidth - titleWidth) - 1 + winRightEdge.rightWidth,
clientHeight + 4 + 14);
}

// Configure Status Window
if (winStatus != None)
{
winStatus.ConfigureChild(
titleWidth + defaultStatusLeftOffset, titleTopHeight + StatusPosY + verticalOffset,
clientWidth - defaultStatusClientDiffY, defaultStatusHeight);
}

CreateActionButtonBar -> MenuUIActionButtonBarWindow


// Only create if we're supposed to create it
if (bActionButtonBarActive)
winButtonBar = MenuUIActionButtonBarWindow(NewChild(Class'MenuUIActionButtonBarWindow'));

CreateClientWindow


local int clientIndex;
local int titleOffsetX, titleOffsetY;


winClient = MenuUIClientWindow(NewChild(classClient));

winTitle.GetOffsetWidths(titleOffsetX, titleOffsetY);

winClient.SetPos(titleOffsetX, titleOffsetY + verticalOffset);
winClient.SetSize(clientWidth, clientHeight);
winClient.SetTextureLayout(textureCols, textureRows);

// Set background textures
for(clientIndex=0; clientIndex {
winClient.SetClientTexture(clientIndex, clientTextures[clientIndex]);
}

CreateControls


CreateTitleWindow();
CreateClientWindow();
CreateActionButtonBar();
CreateRightEdgeWindow();
CreateStatusWindow();

CreateLeftEdgeWindow


winLeftEdge = MenuUILeftEdgeWindow(NewChild(Class'MenuUILeftEdgeWindow'));
winLeftEdge.AskParentForReconfigure();

CreateMenuEditWindow (int posX, int posY, int editWidth, int maxChars, Window winParent) -> MenuUIEditWindow


local MenuUIInfoButtonWindow btnInfo;
local ClipWindow clipName;
local MenuUIEditWindow newEdit;


// Create an info button behind this sucker
btnInfo = MenuUIInfoButtonWindow(winParent.NewChild(Class'MenuUIInfoButtonWindow'));
btnInfo.SetPos(posX, posY);
btnInfo.SetWidth(editWidth);
btnInfo.SetSensitivity(False);

clipName = ClipWindow(winClient.newChild(Class'ClipWindow'));
clipName.SetWidth(editWidth - 8);
clipName.ForceChildSize(False, True);
clipName.SetPos(posX + 4, posY + 4);

newEdit = MenuUIEditWindow(clipName.NewChild(Class'MenuUIEditWindow'));
newEdit.SetMaxSize(maxChars);

return newEdit;

CreateMenuLabel (int posX, int posY, String strLabel, Window winParent) -> MenuUILabelWindow


local MenuUILabelWindow newLabel;


newLabel = MenuUILabelWindow(winParent.NewChild(Class'MenuUILabelWindow'));

newLabel.SetPos(posX, posY);
newLabel.SetText(strLabel);

return newLabel;

CreateRightEdgeWindow


if (bRightEdgeActive)
{
winRightEdge = MenuUIRightEdgeWindow(NewChild(Class'MenuUIRightEdgeWindow'));
winRightEdge.Lower();
}

CreateScrollAreaWindow (Window winParent) -> MenuUIScrollAreaWindow


return MenuUIScrollAreaWindow(winParent.NewChild(Class'MenuUIScrollAreaWindow'));

CreateSmallMenuLabel (int posX, int posY, String strLabel, Window winParent) -> MenuUISmallLabelWindow


local MenuUISmallLabelWindow newLabel;


newLabel = MenuUISmallLabelWindow(winParent.NewChild(Class'MenuUISmallLabelWindow'));

newLabel.SetPos(posX, posY);
newLabel.SetText(strLabel);

return newLabel;

CreateStatusWindow


if (bUsesStatusWindow)
{
winStatus = MenuUIHelpWindow(NewChild(Class'MenuUIHelpWindow'));
winStatus.SetWordWrap(False);
winStatus.SetTextMargins(0, 0);
}

CreateTitleWindow


winTitle = MenuUITitleWindow(NewChild(Class'MenuUITitleWindow'));
winTitle.SetPos(0, verticalOffset);

SetTitle(title);

DestroyWindow


local int texIndex;


if (Player != Player.GetPlayerPawn())
{
log("==============>Player mismatch!!!!");
}
else
{
// Play OK Sound
PlaySound(Sound'Menu_OK', 0.25);
}

for(texIndex=0; texIndex player.UnloadTexture(clientTextures[texIndex]);

Super.DestroyWindow();

HideStatus


if (winStatus != None)
winStatus.Hide();

InitWindow


Super.InitWindow();

// Get a pointer to the root window
root = DeusExRootWindow(GetRootWindow());

// Get a pointer to the player
player = DeusExPlayer(root.parentPawn);

CreateControls();
StyleChanged();

// Play Menu Activated Sound
PlaySound(Sound'Menu_Activate', 0.25);

MouseMoved (float newX, float newY)


if (bWindowBeingDragged)
{
bWindowDragged = True;
SetPos( x + (newX - windowStartDragX), y + (newY - windowStartDragY) );
}

ProcessDeusExText (Name textName, optional TextWindow winText)


local DeusExTextParser parser;
local string TextPackage;


fileIndex = -1;
emailIndex = -1;

// First check to see if we have a name
if ( textName != '' )
{
// Create the text parser
parser = new(None) Class'DeusExTextParser';
parser.SetPlayerName(player.TruePlayerName);

if (CompOwner.IsA('Computers'))
TextPackage = Computers(CompOwner).TextPackage;
else
TextPackage = "DeusExText";

// Attempt to find the text object
if ( parser.OpenText(textName, TextPackage) )
{
while(parser.ProcessText())
ProcessDeusExTextTag(parser, winText);

parser.CloseText();
}

CriticalDelete(parser);
}

ProcessDeusExTextTag (DeusExTextParser parser, optional TextWindow winText)


local String text;
local byte tag;
local Name fontName;
local String textPart;

// local EDeusExTextTags tag;

tag = parser.GetTag();

switch(tag)
{
case 0: // TT_Text:
case 9: // TT_PlayerName:
case 10: // TT_PlayerFirstName:
text = parser.GetText();

// Add the text
if (winText != None)
winText.AppendText(text);

break;

case 1: // TT_File
ProcessFile(parser);
break;

case 2: // TT_Email
ProcessEmail(parser);
break;

case 18: // TT_NewParagraph:
if (winText != None)
winText.AppendText(CR());
break;

case 13: // TT_LeftJustify:
break;

case 14: // TT_RightJustify:
break;

case 12: // TT_CenterText:
break;

case 26: // TT_Font:
break;

case 15: // TT_DefaultColor:
case 16: // TT_TextColor:
case 17: // TT_RevertColor:
break;
}

ProcessEmail (DeusExTextParser parser)


local String emailStringName;


// Make sure we don't overwrite our array
if (emailIndex == 9)
return;

emailIndex = emailIndex + 1;

parser.GetEmailInfo(
emailStringName,
emailInfo[emailIndex].emailSubject,
emailInfo[emailIndex].emailFrom,
emailInfo[emailIndex].emailTo,
emailInfo[emailIndex].emailCC);

emailInfo[emailIndex].emailName = StringToName(emailStringName);

ProcessFile (DeusExTextParser parser)


local String fileStringName;


// Make sure we don't overwrite our array
if (fileIndex == 9)
return;

fileIndex = fileIndex + 1;

parser.GetFileInfo(
fileStringName,
fileInfo[fileIndex].fileDescription);

fileInfo[fileIndex].fileName = StringToName(fileStringName);

SetCompOwner (ElectronicDevices newCompOwner)


compOwner = newCompOwner;

if ((winStatus != None) && (compOwner.IsA('Computers')))
winStatus.SetText("Daedalus:GlobalNode:" $ Computers(compOwner).GetNodeAddress() $ "/" $ ComputerNodeFunctionLabel);

SetNetworkTerminal (NetworkTerminal newTerm)


winTerm = newTerm;

SetTitle (String newTitle)


winTitle.SetTitle(newTitle);

ShowStatus (String statusMessage)


if (winStatus != None)
{
winStatus.Show();
winStatus.SetText(statusMessage);
}

StyleChanged


local ColorTheme theme;
local Color colCursor;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

colCursor = theme.GetColorFromName('MenuColor_Cursor');

SetDefaultCursor(Texture'DeusExCursor1', Texture'DeusExCursor1_Shadow', 32, 32, colCursor);

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;

bKeyHandled = True;

switch( key )
{
case IK_Escape:
CloseScreen(escapeAction);
break;

default:
bKeyHandled = False;
}

if (bKeyHandled)
return True;
else
return Super.VirtualKeyPressed(key, bRepeat);




Computers.uc (extends ElectronicDevices)

var() localized string Text;
var() localized string TriggerText;
var() string userName;
var() name TriggerEvent;
var() name UnTriggerEvent;
var() bool bTriggerOnceOnly;
var bool bAlreadyTriggered;
var() localized sSpecialOptions specialOptions[4];
var class terminalType;
var NetworkTerminal termwindow;
var bool bOn;
var bool bAnimating;
var bool bLockedOut; // true if this terminal is locked out
var() float lockoutDelay; // delay until locked out terminal can be used
var float lockoutTime; // time when terminal was locked out
var float lastHackTime; // last time the terminal was hacked
var DeusExPlayer curFrobber; // player currently frobbing.
var localized String msgLockedOut;
var() string userName;
var() string password;
var() EAccessLevel accessLevel;
var() sUserInfo userList[8];
var() string nodeName;
var() string titleString;
var() texture titleTexture;
var() string TextPackage; // Package from which text for emails/bulletins for this computer should be loaded.
var localized string nodeName;
var localized string nodeDesc;
var string nodeAddress;
var Texture nodeTexture;
var() EComputerNodes ComputerNode;
var localized sNodeInfo NodeInfo[20];
var float lastAlarmTime; // last time the alarm was sounded
var int alarmTimeout; // how long before the alarm silences itself
var localized string CompInUseMsg;
bOn=True
lockoutDelay=30.000000
lastHackTime=-9999.000000
msgLockedOut="Terminal is locked out for %d more seconds"
nodeName="UNATCO"
titleString="United Nations Anti-Terrorist Coalition (UNATCO)"
titleTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoUNATCO'
TextPackage="DeusExText"
NodeInfo(0)=(nodeName="UNATCO",nodeAddress="UN//UNATCO//RESTRICTED//923.128.6430",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoUNATCO')
NodeInfo(1)=(nodeName="VersaLife",nodeDesc="VersaLife",nodeAddress="VERSALIFECORP//GLOBAL//3939.39.8",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoVersaLife')
NodeInfo(2)=(nodeName="Queens Tower",nodeDesc="Queens Tower Luxury Suites",nodeAddress="QT_UTIL//LOCAL//673.9845.09531",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoQueensTower')
NodeInfo(3)=(nodeName="USN",nodeDesc="United States Navy",nodeAddress="USGOV//MIL//USN//GLOBAL//0001",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoUSNavy')
NodeInfo(4)=(nodeName="MJ12Net",nodeDesc="Majestic 12 Net",nodeAddress="MAJESTIC//GLOBAL//12.12.12",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoMJ12')
NodeInfo(5)=(nodeName="Page Industries",nodeDesc="Page Industries",nodeAddress="PAGEIND//USERWEB//NODE.34@778",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoPage')
NodeInfo(6)=(nodeName="X-51 SecureNet",nodeDesc="X-51 SecureNet",nodeAddress="X51//SECURENET//NODE.938@893",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoArea51')
NodeInfo(7)=(nodeName="Everett Enterprises",nodeDesc="Everett Enterprises",nodeAddress="EE//INTSYS.TT//0232.98//TERMINAL",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoEverettEnt')
NodeInfo(8)=(nodeName="NSF",nodeDesc="NSF",nodeAddress="HUB//RESISTANCE.7654//NSFNODES",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoNSF')
NodeInfo(9)=(nodeName="NYComm",nodeDesc="NYC Communications",nodeAddress="USA//DOMESTIC//NYCCOM.USERS.PUB",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoNYComm')
NodeInfo(10)=(nodeName="PRChina",nodeDesc="Peoples Republic of China",nodeAddress="PRC//GOV//RESTRICTED.HK.562",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoPRChina')
NodeInfo(11)=(nodeName="HKNet",nodeDesc="HK Net",nodeAddress="PUB//HKNET//USERS.ACCTS.20435//2",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoHKNet')
NodeInfo(12)=(nodeName="Quick Stop",nodeDesc="Quick Stop",nodeAddress="PUB//HKNET//QUICKSTOPINT//NODE98",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoQuickStop')
NodeInfo(13)=(nodeName="Lucky Money",nodeDesc="Lucky Money Club",nodeAddress="PUB//HKNET//LUCKYMONEY/BUSSYS.294",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoLuckyMoney')
NodeInfo(14)=(nodeName="IIS",nodeDesc="Illuminati Information Systems",nodeAddress="SECURE//IIS.INFTRANS.SYS//UEU",nodeTexture=Texture'DeusExUI.UserInterface.ComputerLogonLogoIlluminati')
alarmTimeout=30
CompInUseMsg="The computer is already in use by %s."
Mass=20.000000
Buoyancy=5.000000

AdditionalActivation (DeusExPlayer ActivatingPlayer)

AdditionalDeactivation (DeusExPlayer DeactivatingPlayer)

BeginAlarm


AmbientSound = Sound'Klaxon2';
SoundVolume = 128;
SoundRadius = 64;
SoundPitch = 64;
lastAlarmTime = Level.TimeSeconds;
AIStartEvent('Alarm', EAITYPE_Audio, SoundVolume/255.0, 25*(SoundRadius+1));

// make sure we can't go into stasis while we're alarming
bStasis = False;

ChangePlayerVisibility (bool bInviso)


local DeusExPlayer player;


if (Level.NetMode != NM_Standalone)
return;
player = DeusExPlayer(GetPlayerPawn());
if (player != None)
player.MakePlayerIgnored(!bInviso);

CloseOut


if (curFrobber != None)
{
//curFrobber = None;
GotoState('Off');
}

EndAlarm


AmbientSound = Default.AmbientSound;
SoundVolume = Default.SoundVolume;
SoundRadius = Default.SoundRadius;
SoundPitch = Default.SoundPitch;
lastAlarmTime = 0;
AIEndEvent('Alarm', EAITYPE_Audio);

// reset our stasis info
bStasis = Default.bStasis;

Frob (Actor Frobber, Inventory frobWith)


local DeusExPlayer player;
local float elapsed, delay;


// Don't allow someone else to use the computer when already in use.
if (curFrobber != None)
{
if (DeusExPlayer(Frobber) != None)
DeusExPlayer(Frobber).ClientMessage(Sprintf(CompInUseMsg,curFrobber.PlayerReplicationInfo.PlayerName));
return;
}

Super.Frob(Frobber, frobWith);

// DEUS_EX AMSD get player from frobber, not from getplayerpawn
player = DeusExPlayer(Frobber);
if (player != None)
{
if (bLockedOut)
{
// computer skill shortens the lockout duration
delay = lockoutDelay / player.SkillSystem.GetSkillLevelValue(class'SkillComputer');

elapsed = Level.TimeSeconds - lockoutTime;
if (elapsed < delay)
player.ClientMessage(Sprintf(msgLockedOut, Int(delay - elapsed)));
else
bLockedOut = False;
}
if (!bAnimating && !bLockedOut)
{
curFrobber = player;
GotoState('On');
}
}

GetAccessLevel (int userIndex) -> int


if ((userIndex >= 0) && (userIndex < ArrayCount(userList)))
return Int(userList[userIndex].accessLevel);

return 0;

GetNodeAddress -> String


return nodeInfo[Int(ComputerNode)].nodeAddress;

GetNodeDesc -> String


return nodeInfo[Int(ComputerNode)].nodeDesc;

GetNodeName -> String


return nodeInfo[Int(ComputerNode)].nodeName;

GetNodeTexture -> Texture


return nodeInfo[Int(ComputerNode)].nodeTexture;

GetPassword (int userIndex) -> string


if ((userIndex >= 0) && (userIndex < ArrayCount(userList)))
return userList[userIndex].password;

return "ERR";

GetUserName (int userIndex) -> string


if ((userIndex >= 0) && (userIndex < ArrayCount(userList)))
return userList[userIndex].userName;

return "ERR";

Invoke -> bool


local DeusExPlayer player;


if (termwindow != None)
return False;

player = curFrobber;
if (player != None)
{
//pass timing info so the player can keep the time uptodate on his end.
player.InvokeComputerScreen(self, lastHackTime, Level.TimeSeconds);
// set owner for relevancy fer sure;
SetOwner(Player);
}

return True;

NumUsers -> int


local int i;


for (i=0; i if (userList[i].userName == "")
break;

return i;

PostBeginPlay


Super.PostBeginPlay();
curFrobber = None;


local DeusExPlayer player;


player = curFrobber;
if (player != None)
{
player.ResumeDataLinks();
}

Tick (float deltaTime)


Global.Tick(deltaTime);

if (bOn)
{
if ((termwindow == None) && (Level.NetMode == NM_Standalone))
{
GotoState('Off');
}
if (curFrobber == None)
{
GotoState('Off');
}
else if (VSize(curFrobber.Location - Location) > 1500)
{
log("Disabling computer "$Self$" because user "$curFrobber$" was too far away");
//Probably should be "GotoState('Off')" instead, but no good way to test, so I'll leave it alone.
curFrobber = None;
}
}

TryInvoke


if (IsInState('Off'))
return;

if (!Invoke())
{
GotoState('Off');
}

return;




ConChoiceWindow.uc (extends ButtonWindow)

var Object userObject;

GetUserObject -> Object


return userObject;

InitWindow


Super.InitWindow();

SetUserObject (object newUserObject)


userObject = newUserObject;




ConPlay.uc (extends ConPlayBase)

var ConEvent currentEvent;
var transient HUDConWindowFirst conWinFirst; // Third-Person Conversation Window
var Actor currentSpeaker;
var Actor currentSpeakingTo;
var Bool SetupInitialCamera;
var Actor speakingActor; // Currently Animating speaking Actor
var ConCamera cameraInfo; // Camera Information
var Bool randomCamera; // True if random camera placement
var Bool interactiveCamera; // True when we have interactive camera control
var ConEventMoveCamera pendingCameraEvent;
var Bool bSetupInitialCamera;
var Bool bEndingConversation;
var Bool bWaitingForConWin;
var Bool bActorsTurned;
var Bool bSaveContinueSpeech;
var Bool bSaveNoPlayedFlag;
var Inventory playerInHand;
var Float perCharDelay;
var Float minimumTextPause;
var Font ConversationSpeechFonts[2];
var Font ConversationNameFonts[2];
perCharDelay=0.100000
minimumTextPause=3.000000
ConversationSpeechFonts(0)=Font'DeusExUI.FontConversation'
ConversationSpeechFonts(1)=Font'DeusExUI.FontConversationLarge'
ConversationNameFonts(0)=Font'DeusExUI.FontConversationBold'
ConversationNameFonts(1)=Font'DeusExUI.FontConversationLargeBold'
bHidden=True

BeginState


// Allow input
if (conWinThird != None)
conWinThird.RestrictInput(False);

CloseConWindow();

CloseConWindow


if ( displayMode == DM_FirstPerson )
{
if (conWinFirst != None )
conWinFirst.Close();
}
else
{
if (conWinThird != None)
conWinThird.Close();
}

// Wait for the window to finish
SetTimer(0.2, True);

ConWinFinished


// Nuke the conversation window
if (displayMode == DM_FirstPerson)
{
if (conWinFirst != None)
conWinFirst.Destroy();
}
else
{
if (conWinThird != None)
conWinThird.Destroy();

// Show the hud display if this was a third-person convo
if (!bForcePlay)
rootWindow.hud.Show();
}

PostTerminateConversation();

// Now nuke ourself.
Destroy();

GetCurrentNameFont -> Font


local int resWidth;


resWidth = GetCurrentResolutionWidth();

if ((resWidth > 800) && (resWidth < 1280))
return ConversationNameFonts[1];
else
return ConversationNameFonts[0];

GetCurrentResolutionWidth -> int


local int p;
local int resX;
local int resWidth;
local string CurrentRes;


CurrentRes = player.ConsoleCommand("GetCurrentRes");

resX = InStr(CurrentRes,"x");
resWidth = int(Left(CurrentRes, resX));

return resWidth;

GetCurrentSpeechFont -> Font


local int resWidth;


resWidth = GetCurrentResolutionWidth();

if ((resWidth > 800) && (resWidth < 1280))
return ConversationSpeechFonts[1];
else
return ConversationSpeechFonts[0];

GetDisplayMode -> EDisplayMode


return displayMode;

GetNextEvent -> ConEvent


return currentEvent.nextEvent;

JumpToConversation (Conversation jumpCon, String startLabel)


assert( jumpCon != None );

// If this is a new conversation, assign it to our "Con" variable
// and set the con.conName $ "_Played" flag to True.
if (jumpCon != con)
{
SetPlayedFlag();

// Some cleanup for the existing conversation
con.ClearBindEvents();
con.radiusDistance = saveRadiusDistance;

// Assign the new conversation and bind the events
con = jumpCon;
con.BindEvents(ConActorsBound, startActor);
}

// Get the event to start at, or the beginning if one wasn't
// passed in. However, if a label is passed in *and* it's not
// found, then abort the conversation!!

currentEvent = con.GetEventFromLabel( startLabel );

if (( currentEvent == None ) && ( startLabel != "" ))
{
Log("ConPlay::JumpToConversation() --------------------------------------");
Log(" WARNING! Label [" $ startLabel $ "] NOT FOUND in Conversation [" $ jumpCon.conName $ "]");
log(" Conversation Terminated.");
TerminateConversation();
return;
}

if ( currentEvent == None )
currentEvent = con.eventList;

// Start the conversation!
GotoState('PlayEvent');

PlayChoice (ConChoice choice)


local ConSpeech choiceSpeech;


// First, save the choice text, but only if the DisplayAsSpeech
// flag isn't set, in which case the speech will be setup as a
// speech event and saved that way.

if ( !choice.bDisplayAsSpeech )
{
choiceSpeech = new(None) Class'ConSpeech';
choiceSpeech.speech = choice.choiceText;
choiceSpeech.soundID = choice.soundID;

AddHistoryEvent(player.GetDisplayName(player, True), choiceSpeech );
}

// If this choice has a label, then jump to it. Otherwise just
// continue with the conversation.

if ( choice.choiceLabel != "" )
ProcessAction( EA_JumpToLabel, choice.choiceLabel );
else
ProcessAction( EA_NextEvent, "" );

PlayNextEvent


SetTimer(0, False);
ConWinFinished();

PlaySpeech (int soundID, Actor speaker)


local Sound speech;


speech = con.GetSpeechAudio(soundID);

// Keep a pointer to the current speaking pawn so we can stop
// the speech animation when we're finished.

if (speech != None)
{
// If this is an intro/endgame, force speech to play through
// the player so we can *hear* it.
if (bForcePlay)
{
// Check how close the player is to this actor. If the player is
// close enough to the speaker, play through the speaker.
if ((speaker == None) || (VSize(player.Location - speaker.Location) > 400))
{
playingSoundID = player.PlaySound(speech, SLOT_Talk,,,65536.0);
}
else
{
playingSoundID = speaker.PlaySound(speech, SLOT_Talk,,,65536.0);
}
}
else
{
// If this is a forced conversation (bCannotBeInterrupted = True)
// then set the radius higher. This is a hack. Yes, a hack,
// in some situations where the PC is far from one or more speaking
// NPCs but needs to be able to overhear them. Also, want to make
// this reasonably loud for letterbox convos

if ((con.bCannotBeInterrupted) || (!con.bFirstPerson))
playingSoundID = speaker.PlaySound(speech, SLOT_Talk,,,65536.0);
else
playingSoundID = speaker.PlaySound(speech, SLOT_Talk,,,512.0 + initialRadius);
}
}

StartSpeakingAnimation();

PostTerminateConversation


// Notify the player we're no longer inside
// a conversation

player.EndConversation();

// Remove the highlights
if (cameraInfo != None)
cameraInfo.DestroyHighlights();

// Save the conversation history
if ( history != None )
{
history.next = player.conHistory;
player.conHistory = history;
history = None; // in case we get called more than once!!
}

// If the player was holding something when
// the conversation started, put the item back
// in his hand.
if (playerInHand != None)
player.PutInHand(playerInHand);

Super.TerminateConversation(bSaveContinueSpeech, bSaveNoPlayedFlag);

ProcessAction (EEventAction nextAction, string nextLabel)


// Don't do squat if the currentEvent is NONE
if (currentEvent == None)
return;

switch( nextAction )
{
case EA_NextEvent:
// Proceed to the next event.
lastEvent = currentEvent;
currentEvent = currentEvent.nextEvent;
GotoState('PlayEvent');
break;

case EA_JumpToLabel:
// Use the label passed back and jump to it
lastEvent = currentEvent;
currentEvent = con.GetEventFromLabel( nextLabel );
if ( currentEvent == None )
{
Log("ConPlay::ProcessAction() - EA_JumpToLabel ----------------------------");
Log(" WARNING! Label " $ nextLabel $ " NOT FOUND in Conversation " $ con.conName);
log(" Conversation Terminated.");
}
GotoState('PlayEvent');
break;

case EA_JumpToConversation:
lastEvent = currentEvent;
JumpToConversation( ConEventJump(currentEvent).jumpCon, nextLabel );
break;

case EA_WaitForInput:
// We need to wait for some user input before
// proceeding any further, so jump into a wait state
lastEvent = currentEvent;
GotoState('WaitForInput');
break;

case EA_WaitForSpeech:
// Wait for a piece of audio to finish playing
lastEvent = currentEvent;
GotoState('WaitForSpeech');
break;

case EA_WaitForText:
lastEvent = currentEvent;
GotoState('WaitForText');
break;

case EA_PlayAnim:
lastEvent = currentEvent;
GotoState('ConPlayAnim');
break;

case EA_ConTurnActors:
GotoState('ConTurnActors');
break;

case EA_End:
TerminateConversation();
break;
}

SetCameraActors


// Totally ignore this if "bForcePlay" is set to true
if (bForcePlay)
return;

if ((currentspeaker != None) && (currentSpeakingTo != None))
{
// Update the Actors used by the camera
if (cameraInfo != None)
{
// If we have a pending camera event, then notify the
// camera system with the actors

if (pendingCameraEvent != None)
{
cameraInfo.SetActors(currentSpeaker, currentSpeakingTo);
cameraInfo.SetupCameraFromEvent(pendingCameraEvent);
pendingCameraEvent = None;
bSetupInitialCamera = True;
}

// Otherwise, if we're using a fallback camera and it's a headshot
// then we want to make sure the camera is properly trained on
// the person talking.

else if ((cameraInfo.UsingFallbackCamera()) && (cameraInfo.UsingHeadshot()))
{
cameraInfo.SetActors(currentSpeaker, currentSpeakingTo);
}
}

// If we haven't setup an initial camera then do so,
// because we don't want to play a speech or choice
// event without the camera first having been placed

if ((cameraInfo != None) && (!bSetupInitialCamera))
{
cameraInfo.SetActors(currentSpeaker, currentSpeakingTo);
cameraInfo.SetupFallbackCamera();
bSetupInitialCamera = True;
}
}

SetInHand (Inventory newInHand)


playerInHand = newInHand;

SetupEvent


local EEventAction nextAction;
local String nextLabel;


switch( currentEvent.EventType )
{
case ET_Speech:
if ( !bActorsTurned )
nextAction = SetupEventSpeechPre( ConEventSpeech(currentEvent), nextLabel );
else
nextAction = SetupEventSpeechPost( ConEventSpeech(currentEvent), nextLabel );
break;

case ET_Choice:
// Not allowed in passive mode
if ( playMode == PM_Active )
{
nextAction = SetupEventChoice( ConEventChoice(currentEvent), nextLabel );
}
break;

case ET_SetFlag:
nextAction = SetupEventSetFlag( ConEventSetFlag(currentEvent), nextLabel );
break;

case ET_CheckFlag:
nextAction = SetupEventCheckFlag( ConEventCheckFlag(currentEvent), nextLabel );
break;

case ET_CheckObject:
nextAction = SetupEventCheckObject( ConEventCheckObject(currentEvent), nextLabel );
break;

case ET_TransferObject:
nextAction = SetupEventTransferObject( ConEventTransferObject(currentEvent), nextLabel );
break;

case ET_MoveCamera:
// Not allowed in passive mode
if ( playMode == PM_Active )
{
nextAction = SetupEventMoveCamera( ConEventMoveCamera(currentEvent), nextLabel );
}
break;

case ET_Animation:
nextAction = SetupEventAnimation( ConEventAnimation(currentEvent), nextLabel );
break;

case ET_Trade:
// Not allowed in passive mode
if ( playMode == PM_Active )
{
nextAction = SetupEventTrade( ConEventTrade(currentEvent), nextLabel );
}
break;

case ET_Jump:
nextAction = SetupEventJump( ConEventJump(currentEvent), nextLabel );
break;

case ET_Random:
nextAction = SetupEventRandomLabel( ConEventRandomLabel(currentEvent), nextLabel );
break;

case ET_Trigger:
nextAction = SetupEventTrigger( ConEventTrigger(currentEvent), nextLabel );
break;

case ET_AddGoal:
nextAction = SetupEventAddGoal( ConEventAddGoal(currentEvent), nextLabel );
break;

case ET_AddNote:
nextAction = SetupEventAddNote( ConEventAddNote(currentEvent), nextLabel );
break;

case ET_AddSkillPoints:
nextAction = SetupEventAddSkillPoints( ConEventAddSkillPoints(currentEvent), nextLabel );
break;

case ET_AddCredits:
nextAction = SetupEventAddCredits( ConEventAddCredits(currentEvent), nextLabel );
break;

case ET_CheckPersona:
nextAction = SetupEventCheckPersona( ConEventCheckPersona(currentEvent), nextLabel );
break;

case ET_End:
nextAction = SetupEventEnd( ConEventEnd(currentEvent), nextLabel );
break;
}

// Based on the result of the setup, we either need to jump to another event
// or wait for some input from the user.

ProcessAction( nextAction, nextLabel );

SetupEventChoice (ConEventChoice event, out String nextLabel) -> EEventAction


local ConChoice choice;
local ButtonWindow newButton;
local int choiceCount;
local EEventAction nextAction;


// Notify the conversation window to ignore input until we're done
// creating the choices (this is done to prevent the user from being
// able to make a choice while drawing, only a problem on slow machines)

if (conWinThird != None)
conWinThird.RestrictInput(True);

// For choices, the speaker is always the player. The person being
// spoken to, well, that's more complicated (unless I force that to be
// set in ConEdit). For now we'll assume that the owner of the
// conversation is the person being spoken to.

currentSpeaker = player;
currentSpeakingTo = startActor;

// Update the Actors used by the camera
SetCameraActors();

// Clear the screen if need be
if ( event.bClearScreen )
conWinThird.Clear();

// Okay, we want to create as many buttons as we have choices
// and display them. We'll then return and let conPlay get some
// user input.

choice = event.ChoiceList;
choiceCount = 0;

while( choice != None )
{
// Before we blindly display this choice, we first need to check a
// few things. Specifically:
//
// 1. Check to see if any flags are associated with this choice.
// 2. Check to see if this choice is skill-based.
// 3. If there are *NO* valid choices, skip to the next event
// as a failsafe
//
// If the above conditions are met, then display the choice.

if ( player.CheckFlagRefs( choice.flagRef ) )
{
// Now check the skills
if ( choice.skillNeeded != None )
{
// Does player have it?
if ( player.SkillSystem.IsSkilled(choice.skillNeeded, choice.skillLevelNeeded) )
{
// Display the choice with some feedback!
conWinThird.DisplaySkillChoice( choice );
choiceCount++;
}
}
else
{
// Plain old vanilla choice
conWinThird.DisplayChoice(choice);
choiceCount++;
}
}

choice = choice.nextChoice;
}

nextLabel = "";

if ( choiceCount > 0 )
nextAction = EA_WaitForInput;
else
nextAction = EA_NextEvent;

// Okay to accept user input again
if (conWinThird != None)
conWinThird.RestrictInput(False);

return nextAction;

SetupEventEnd (ConEventEnd event, out String nextLabel) -> EEventAction


nextLabel = "";
return EA_End;

SetupEventMoveCamera (ConEventMoveCamera event, out String nextLabel) -> EEventAction


pendingCameraEvent = event;

nextLabel = "";
return EA_NextEvent;

SetupEventSpeechPost (ConEventSpeech event, out String nextLabel) -> EEventAction


local EEventAction nextAction;
local ConEvent checkEvent;
local String speech;
local bool bHaveSpeechAudio;


bActorsTurned = False;

// Restrict input until we've finished setting up this event
if (conWinThird != None)
conWinThird.RestrictInput(True);

// Keep track of the current speaker and speaking to actors
if ((currentSpeaker != event.speaker) || (currentSpeakingTo != event.speakingTo))
{
// If we're in "Random Camera" mode, then we want to
// pick a new camera position.

if ((randomCamera) && (cameraInfo != None))
cameraInfo.SetupRandomCameraPosition();

// Update our actor variables
currentSpeaker = event.speaker;
currentSpeakingTo = event.speakingTo;

UpdateCameraInfo();
}

// Update the Actors used by the camera
SetCameraActors();

// Cause the speaking actor to turn towards the person he is
// speaking to.
TurnSpeakingActors(event.speaker, event.speakingTo);

// Calculate the length of the text string, this is used later


speech = event.conSpeech.speech;

bHaveSpeechAudio = (event.conSpeech.soundID != -1);

lastSpeechTextLength = len(speech);

// Display the speech text, if:
//
// 1. Player has bSubtitles flag on
// 2. No speech audio exists for the speech

if ((player.bSubtitles) || (!bHaveSpeechAudio))
{
if ( displayMode == DM_FirstPerson )
conWinFirst.Show();

// If we're continuing from the last speech, then we want to Append
// and not Display the first chunk.
if ( event.bContinued == True )
{
if ( displayMode == DM_FirstPerson )
conWinFirst.AppendText( speech );
else
conWinThird.AppendText( speech );
}
else
{
if ( displayMode == DM_FirstPerson )
{
// Clear the window
conWinFirst.Clear();

conWinFirst.DisplayName( player.GetDisplayName(event.speaker) );
conWinFirst.DisplayText( speech, currentSpeaker );
}
else
{
// Clear the window
conWinThird.Clear();

conWinThird.DisplayName( player.GetDisplayName(event.speaker) );
conWinThird.DisplayText( speech, currentSpeaker );
}
}
}
else if (displayMode == DM_FirstPerson)
{
conWinFirst.Hide();
}

// Save this event in the history
AddHistoryEvent(player.GetDisplayName(event.Speaker, True), event.conSpeech);

// If we have speech audio, play it!
if (bHaveSpeechAudio)
{
nextAction = EA_WaitForSpeech;
}
else
{
// Otherwise, we'll wait for the text to play (either in passive mode, which
// means the text will continue on its own, or in ACTIVE mode, in which case
// we'll wait for a keypress before continuing.

if (( playMode == PM_PASSIVE ) || ( displayMode == DM_FirstPerson ))
{
nextAction = EA_WaitForText;
}
else
{
// If we're here, we either have no speech or we're in a text-only mode
//
// We want to wait for input unless the next event is a
// speech event and has the "Continued" flag set, which
// allows for additional speech and choices to
// appear immediately after the current speech.
//
// Choices automatically continue unless they have the "Clear Screen"
// flag set.

checkEvent = GetNextEvent();

if ( (( ConEventChoice(checkEvent) != None ) && ( !ConEventChoice(checkEvent).bClearScreen )) ||
(( ConEventSpeech(checkEvent) != None ) && ( ConEventSpeech(checkEvent).bContinued )) )
nextAction = EA_NextEvent;
else
nextAction = EA_WaitForInput;
}
}

nextLabel = "";
return nextAction;

SetupEventSpeechPre (ConEventSpeech event, out String nextLabel) -> EEventAction


nextLabel = "";
return EA_ConTurnActors;

StartConversation (DeusExPlayer newPlayer, optional Actor newInvokeActor, optional bool bForcePlay) -> Bool


if ( Super.StartConversation(newPlayer, newInvokeActor, bForcePlay) == False )
return False;

bEndingConversation = False;

// Check to see if this conversation uses random camera placement
randomCamera = con.bRandomCamera;

// Based on whether we're in first-person or third-person mode,
// we need to derive our conversation window differently. First-person
// conversation mode is non-interactive and only allows speech, for
// the most part.

if ( con.bFirstPerson )
{
displayMode = DM_FirstPerson;

conWinFirst = rootWindow.hud.CreateConWindowFirst();

// Initialize Windowing System
conWinFirst.conPlay = Self;
}
else
{
displayMode = DM_ThirdPerson;

// Hide the hud display if this is a third-person convo
rootWindow.hud.Hide();

conWinThird = ConWindowActive(rootWindow.NewChild(Class'ConWindowActive', False));
conWinThird.SetForcePlay(bForcePlay);

// Setup default camera information, but only if bForcePlay is set to false
if (!bForcePlay)
{
cameraInfo = con.CreateConCamera();
cameraInfo.InitializeCameraValues(Self);

if ( randomCamera )
cameraInfo.SetupRandomCameraPosition();
}

// Initialize Windowing System
conWinThird.conPlay = Self;

// Align the conversation window
conWinThird.SetWindowAlignments(HALIGN_Full, VALIGN_Full);
conWinThird.Show();
}

// Check to see if this is a passive or interactive conversation
// Passive conversations are beyond the PC's control and do not have
// things like Choices, etc. in them.

if ( con.bNonInteractive )
playMode = PM_Passive;
else
playMode = PM_Active;

// Grab the first event!
currentEvent = con.eventList;

// Create a ConHistory object
if (!bForcePlay)
SetupHistory(player.GetDisplayName(startActor, True));

// Play this event!
GotoState('PlayEvent');

return True;

StartSpeakingAnimation


if ( ConEventSpeech(currentEvent) != None )
speakingActor = Pawn(ConEventSpeech(currentEvent).speaker);
else
speakingActor = player;

if ( speakingActor != None )
{
Pawn(speakingActor).bIsSpeaking = True;
Pawn(speakingActor).bWasSpeaking = True;
}

StopSpeakingAnimation


if ( Pawn(speakingActor) != None )
{
Pawn(speakingActor).bIsSpeaking = False;
speakingActor = None;
}

StopSpeech


Super.StopSpeech();
StopSpeakingAnimation();

TerminateConversation (optional bool bContinueSpeech, optional bool bNoPlayedFlag)


// Save this for when we call Super.TerminateConversation() later
bSaveContinueSpeech = bContinueSpeech;
bSaveNoPlayedFlag = bNoPlayedFlag;

// Some protection to make sure this doesn't happen
// more than once.

if (!bEndingConversation)
{
bEndingConversation = True;

// Tell the Conversation Window to shut down
if ((conWinThird != None) && (!bForcePlay))
GotoState('WaitForConWin');
else
ConWinFinished();
}

Timer


GotoState( 'WaitForText', 'TextFinished' );

ToggleInteractiveCamera


if (cameraInfo != None)
{
interactiveCamera = !interactiveCamera;

if ( interactiveCamera )
{
conWinThird.CreateCameraWindow();
UpdateCameraInfo();
}
else
{
conWinThird.DestroyCameraWindow();
}

cameraInfo.SetInteractiveCamera(interactiveCamera);
}

UpdateCameraInfo


if (conWinThird != None)
conWinThird.UpdateCameraInfo();




ConPlayBark.uc (extends Actor)

var Conversation con;

GetBarkSpeech -> ConSpeech


local ConEvent event;
local ConSpeech outSpeech;


// Abort if we don't have a valid conversation
if (con == None)
return None;

// Default return value
outSpeech = None;

// Loop through the events until we hit some speech
event = con.eventList;

while(event != None)
{
switch(event.eventType)
{
case ET_Speech:
outSpeech = ConEventSpeech(event).conSpeech;
event = None;
break;

case ET_Jump:
event = ProcessEventJump(ConEventJump(event));
break;

case ET_Random:
event = ProcessEventRandomLabel(ConEventRandomLabel(event));
break;

case ET_End:
event = None;
break;

default:
event = event.nextEvent;
break;
}
}

return outSpeech;

ProcessEventJump (ConEventJump event) -> ConEvent


local ConEvent nextEvent;


// Check to see if the jump label is empty. If so, then we just want
// to fall through to the next event. This can happen when jump
// events get inserted during the import process. ConEdit will not
// allow the user to create events like this.

if (event.jumpLabel == "")
{
nextEvent = event.nextEvent;
}
else
{
if ((event.jumpCon != None) && (event.jumpCon != con))
nextEvent = None; // not yet supported
else
nextEvent = con.GetEventFromLabel(event.jumpLabel);
}

return nextEvent;

ProcessEventRandomLabel (ConEventRandomLabel event) -> ConEvent


local String nextLabel;


// Pick a random label
nextLabel = event.GetRandomLabel();

return con.GetEventFromLabel(nextLabel);

SetConversation (Conversation newCon)


con = newCon;




ConPlayBase.uc (extends Actor)

var enum EPlayModes
var enum EDisplayMode
var transient DeusExRootWindow rootWindow; // Scott is that black stuff in the oven
var Conversation con; // Conversation we're working with
var Conversation startCon; // Conversation that was -initially- started
var DeusExPlayer player; // Player Pawn
var Actor invokeActor; // Actor who invoked conversation
var ConEvent currentEvent;
var ConEvent lastEvent; // Last event
var Actor lastActor; // Last Speaking Actor
var Int playingSoundId; // Currently playing speech
var Int lastSpeechTextLength;
var Int missionNumber;
var String missionLocation;
var ConHistory history; // Saved History for this convo
var Actor startActor; // Actor who triggered convo
var int saveRadiusDistance;
var int initialRadius;
var bool bConversationStarted;
var bool bForcePlay;
var transient ConWindowActive conWinThird; // First-Person Conversation Window
var Actor ConActors[10];
var Actor ConActorsBound[10];
var int conActorCount;

ActorDestroyed (Actor destroyedActor)


local int conActorIndex;


for(conActorIndex=0; conActorIndex {
if (ConActorsBound[conActorIndex] == destroyedActor)
{
// First check to see if it's in the ConActors list, in
// which case it needs to be removed before we abort
// (so it doesn't try to do anything with that variable)
IsConActorInList(destroyedActor, True);

// Abort the conversation!!!
TerminateConversation();
break;
}
}

AddConActor (Actor newConActor, bool bFirstPerson)


if ((!bForcePlay) && (newConActor != None))
{
// Only do if we have space and this pawn isn't already speaking
if ((!IsConActorInList(newConActor)) && (conActorCount < 9))
{
ConActors[conActorCount++] = newConActor;

if (newConActor.IsA('ScriptedPawn'))
ScriptedPawn(newConActor).EnterConversationState(bFirstPerson);
else if (newConActor.IsA('DeusExDecoration'))
DeusExDecoration(newConActor).EnterConversationState(bFirstPerson);
}
}

AddHistoryEvent (String eventSpeaker, ConSpeech eventSpeech)


local ConHistoryEvent newEvent;


if (history != None)
{
// First, create a new event
newEvent = player.CreateHistoryEvent();

// Assign variables
newEvent.conSpeaker = eventSpeaker;

newEvent.speech = eventSpeech.speech;
newEvent.soundID = eventSpeech.soundID;

newEvent.next = None;

history.AddEvent(newEvent);
}

CanInterrupt -> bool


if (con != None)
return !con.bCannotBeInterrupted;
else
return False;

ConversationStarted -> bool


return bConversationStarted;

ConvertSpaces (coerce String inString) -> String


local int index;
local String outString;


outString = "";

for(index=0; index {
if (Mid(inString, index, 1) == " ")
outString = outString $ "_";
else
outString = outString $ Mid(inString, index, 1);
}

return outString;

EndConActorStates


local int conActorIndex;


if (!bForcePlay)
{
for(conActorIndex=conActorCount-1; conActorIndex>=0; conActorIndex--)
{
if (ConActors[conActorIndex] != None)
{
ConActors[conActorIndex].EndConversation();
ConActors[conActorIndex] = None;
conActorCount--;
}
}

// Make sure the invoking actor, if a DeusExDecoration or ScriptedPawn,
// is not stuck in the conversation state
if (ScriptedPawn(invokeActor) != None )
ScriptedPawn(invokeActor).EndConversation();
else if (DeusExDecoration(invokeActor) != None )
DeusExDecoration(invokeActor).EndConversation();
}

GetForcePlay -> bool


return bForcePlay;

GetNextEvent -> ConEvent


return currentEvent.nextEvent;

InterruptConversation


SetInterruptedFlag();

IsConActorInList (Actor conActor, optional bool bRemoveActor) -> bool


local int conActorIndex;
local bool bFound;


for(conActorIndex=0; conActorIndex {
if (ConActors[conActorIndex] == conActor)
{
if (bRemoveActor)
ConActors[conActorIndex] = None;

bFound = True;
break;
}
}

return bFound;

RemoveItemFromPlayer (Inventory item)


if ((player != None) && (item != None))
player.RemoveItemDuringConversation(item);

SetConversation (Conversation newCon) -> bool


startCon = newCon;
con = newCon;

saveRadiusDistance = con.radiusDistance;

return True;

SetForcePlay (bool bNewForcePlay)


bForcePlay = bNewForcePlay;

SetInitialRadius (int newInitialRadius)


initialRadius = newInitialRadius;

SetInterruptedFlag


local Name flagName;


if (con != None)
{
flagName = player.rootWindow.StringToName( con.conName $ "_Interrupted" );

// Add a flag noting that we've finished this conversation.

player.flagBase.SetBool(flagName, True);
}

SetOriginalRadius (int newOriginalDistance)


saveRadiusDistance = newOriginalDistance;

SetPlayedFlag


local Name flagName;


if (con != None)
{
// Make a note of when this conversation ended
con.lastPlayedTime = player.Level.TimeSeconds;

flagName = player.rootWindow.StringToName( con.conName $ "_Played" );

// Only set the Played flag if it doesn't already exist
// (some conversations set this intentionally with a longer expiration
// date so they can be relied up on in future missions)

if (!player.flagBase.GetBool(flagName))
{
// Add a flag noting that we've finished this conversation.
player.flagBase.SetBool(flagName, True);
}

// If this was a third-person convo, keep track of when the conversation
// ended and who it was with (this is used to prevent radius convos
// from playing immediately after letterbox convos).
//
// If this was a first-person convo, keep track of the owner and
// play time so we can prevent multiple radius-induced conversations
// from playing without a pause (we don't want them to run into
// each other).

if (con.bFirstPerson)
{
player.lastFirstPersonConvoActor = invokeActor;
player.lastFirstPersonConvoTime = con.lastPlayedTime;
}
else
{
player.lastThirdPersonConvoActor = invokeActor;
player.lastThirdPersonConvoTime = con.lastPlayedTime;
}

}

SetStartActor (Actor newStartActor)


startActor = newStartActor;

SetupEventAddCredits (ConEventAddCredits event, out String nextLabel) -> EEventAction


player.credits += event.creditsToAdd;

// Make sure we haven't gone into the negative
player.credits = Max(player.credits, 0);

nextLabel = "";
return EA_NextEvent;

SetupEventAddGoal (ConEventAddGoal event, out String nextLabel) -> EEventAction


local DeusExGoal goal;


// First check to see if this goal exists
goal = player.FindGoal( event.goalName );

if (( goal == None ) && ( !event.bGoalCompleted ))
{
// Add this goal to the player's goals
goal = player.AddGoal(event.goalName, event.bPrimaryGoal);
goal.SetText(event.goalText);
}
// Check if we're just marking this goal as complete
else if (( goal != None ) && ( event.bGoalCompleted ))
{
player.GoalCompleted(event.goalName);
}

return EA_NextEvent;

SetupEventAddNote (ConEventAddNote event, out String nextLabel) -> EEventAction


// Only add the note if it hasn't been added already (in case the
// PC has the same conversation more than once)

if ( !event.bNoteAdded )
{
// Add the note to the player's list of notes
player.AddNote(event.noteText, False, True);

event.bNoteAdded = True;
}

return EA_NextEvent;

SetupEventAddSkillPoints (ConEventAddSkillPoints event, out String nextLabel) -> EEventAction


player.SkillPointsAdd(event.pointsToAdd);

nextLabel = "";
return EA_NextEvent;

SetupEventAnimation (ConEventAnimation event, out String nextLabel) -> EEventAction


nextLabel = "";
return EA_PlayAnim;

SetupEventCheckFlag (ConEventCheckFlag event, out String nextLabel) -> EEventAction


local ConFlagRef currentRef;
local EEventAction action;


// Default values if we actually make it all the way
// through the while loop below.

nextLabel = event.setLabel;
action = EA_JumpToLabel;

// Loop through our list of FlagRef's, checking the value of each.
// If we hit a bad match, then we'll stop right away since there's
// no point of continuing.

currentRef = event.flagRef;

while( currentRef != None )
{
if ( player.flagBase.GetBool(currentRef.flagName) != currentRef.value )
{
nextLabel = "";
action = EA_NextEvent;
break;
}
currentRef = currentRef.nextFlagRef;
}

return action;

SetupEventCheckObject (ConEventCheckObject event, out String nextLabel) -> EEventAction


local EEventAction nextAction;
local Name keyName;
local bool bHasObject;


// Okay this is some HackyHack stuff here. We want the ability to
// check if the player has a particular nanokey. Sooooooo.

if ((event.checkObject == None) && (Left(event.objectName, 3) == "NK_"))
{
// Look for key
keyName = player.rootWindow.StringToName(Right(event.ObjectName, Len(event.ObjectName) - 3));
bHasObject = ((player.KeyRing != None) && (player.KeyRing.HasKey(keyName)));
}
else
{
bHasObject = (player.FindInventoryType(event.checkObject) != None);
}

// Now branch appropriately

if (bHasObject)
{
nextAction = EA_NextEvent;
nextLabel = "";
}
else
{
nextAction = EA_JumpToLabel;
nextLabel = event.failLabel;
}

return nextAction;

SetupEventCheckPersona (ConEventCheckPersona event, out String nextLabel) -> EEventAction


local EEventAction action;
local int personaValue;
local bool bPass;


// First determine which persona item we're checking
switch(event.personaType)
{
case EP_Credits:
personaValue = player.Credits;
break;

case EP_Health:
player.GenerateTotalHealth();
personaValue = player.Health;
break;

case EP_SkillPoints:
personaValue = player.SkillPointsAvail;
break;
}

// Now decide what to do baby!
switch(event.condition)
{
case EC_Less:
bPass = (personaValue < event.value);
break;

case EC_LessEqual:
bPass = (personaValue <= event.value);
break;

case EC_Equal:
bPass = (personaValue == event.Value);
break;

case EC_GreaterEqual:
bPass = (personaValue >= event.Value);
break;

case EC_Greater:
bPass = (personaValue > event.Value);
break;
}

if (bPass)
{
nextLabel = event.jumpLabel;
action = EA_JumpToLabel;
}
else
{
nextLabel = "";
action = EA_NextEvent;
}

return action;

SetupEventEnd (ConEventEnd event, out String nextLabel) -> EEventAction


nextLabel = "";
return EA_End;

SetupEventJump (ConEventJump event, out String nextLabel) -> EEventAction


local EEventAction nextAction;


// Check to see if the jump label is empty. If so, then we just want
// to fall through to the next event. This can happen when jump
// events get inserted during the import process. ConEdit will not
// allow the user to create events like this.

if ( event.jumpLabel == "" )
{
nextAction = EA_NextEvent;
nextLabel = "";
}
else
{
// Jump to a specific label. We can also jump into another conversation
nextLabel = event.jumpLabel;

if ( event.jumpCon != None )
nextAction = EA_JumpToConversation;
else
nextAction = EA_JumpToLabel;
}

return nextAction;

SetupEventRandomLabel (ConEventRandomLabel event, out String nextLabel) -> EEventAction


// Pick a random label
nextLabel = event.GetRandomLabel();
return EA_JumpToLabel;

SetupEventSetFlag (ConEventSetFlag event, out String nextLabel) -> EEventAction


local ConFlagRef currentRef;


// Just follow the chain of flag references and set the flags to
// the proper value!

currentRef = event.flagRef;

while( currentRef != None )
{
player.flagBase.SetBool(currentRef.flagName, currentRef.value);
player.flagBase.SetExpiration(currentRef.flagName, FLAG_Bool, currentRef.expiration);

currentRef = currentRef.nextFlagRef;

}

nextLabel = "";
return EA_NextEvent;

SetupEventTrade (ConEventTrade event, out String nextLabel) -> EEventAction


nextLabel = "";
return EA_NextEvent;

SetupEventTransferObject (ConEventTransferObject event, out String nextLabel) -> EEventAction


local EEventAction nextAction;
local Inventory invItemFrom;
local Inventory invItemTo;
local ammo AmmoType;
local bool bSpawnedItem;
local bool bSplitItem;
local int itemsTransferred;


/*
log("SetupEventTransferObject()------------------------------------------");
log(" event = " $ event);
log(" event.giveObject = " $ event.giveObject);
log(" event.fromActor = " $ event.fromActor );
log(" event.toActor = " $ event.toActor );
*/
itemsTransferred = 1;

if ( event.failLabel != "" )
{
nextAction = EA_JumpToLabel;
nextLabel = event.failLabel;
}
else
{
nextAction = EA_NextEvent;
nextLabel = "";
}

// First verify that the receiver exists!
if (event.toActor == None)
{
log("SetupEventTransferObject: WARNING! toActor does not exist!");
log(" Conversation = " $ con.conName);
return nextAction;
}

// First, check to see if the giver actually has the object. If not, then we'll
// fabricate it out of thin air. (this is useful when we want to allow
// repeat visits to the same NPC so the player can restock on items in some
// scenarios).
//
// Also check to see if the item already exists in the recipient's inventory

if (event.fromActor != None)
invItemFrom = Pawn(event.fromActor).FindInventoryType(event.giveObject);

invItemTo = Pawn(event.toActor).FindInventoryType(event.giveObject);

//log(" invItemFrom = " $ invItemFrom);
//log(" invItemTo = " $ invItemTo);

// If the player is doing the giving, make sure we remove it from
// the object belt.

// If the giver doesn't have the item then we must spawn a copy of it
if (invItemFrom == None)
{
invItemFrom = Spawn(event.giveObject);
bSpawnedItem = True;
}

// If we're giving this item to the player and he does NOT yet have it,
// then make sure there's enough room in his inventory for the
// object!

if ((invItemTo == None) &&
(DeusExPlayer(event.toActor) != None) &&
(DeusExPlayer(event.toActor).FindInventorySlot(invItemFrom, True) == False))
{
// First destroy the object if we previously Spawned it
if (bSpawnedItem)
invItemFrom.Destroy();

return nextAction;
}

// Okay, there's enough room in the player's inventory or we're not
// transferring to the player in which case it doesn't matter.
//
// Now check if the recipient already has the item. If so, we are just
// going to give it to him, with a few special cases. Otherwise we
// need to spawn a new object.

if (invItemTo != None)
{
// Check if this item was in the player's hand, and if so, remove it
RemoveItemFromPlayer(invItemFrom);

// If this is ammo, then we want to just increment the ammo count
// instead of adding another ammo to the inventory

if (invItemTo.IsA('Ammo'))
{
// If this is Ammo and the player already has it, make sure the player isn't
// already full of this ammo type! (UGH!)
if (!Ammo(invItemTo).AddAmmo(Ammo(invItemFrom).AmmoAmount))
{
invItemFrom.Destroy();
return nextAction;
}

// Destroy our From item
invItemFrom.Destroy();
}

// Pawn cannot have multiple weapons, but we do want to give the
// player any ammo from the weapon
else if ((invItemTo.IsA('Weapon')) && (DeusExPlayer(event.ToActor) != None))
{

AmmoType = Ammo(DeusExPlayer(event.ToActor).FindInventoryType(Weapon(invItemTo).AmmoName));

if ( AmmoType != None )
{
// Special case for Grenades and LAMs. Blah.
if ((AmmoType.IsA('AmmoEMPGrenade')) ||
(AmmoType.IsA('AmmoGasGrenade')) ||
(AmmoType.IsA('AmmoNanoVirusGrenade')) ||
(AmmoType.IsA('AmmoLAM')))
{
if (!AmmoType.AddAmmo(event.TransferCount))
{
invItemFrom.Destroy();
return nextAction;
}
}
else
{
if (!AmmoType.AddAmmo(Weapon(invItemTo).PickUpAmmoCount))
{
invItemFrom.Destroy();
return nextAction;
}

event.TransferCount = Weapon(invItemTo).PickUpAmmoCount;
itemsTransferred = event.TransferCount;
}

if (event.ToActor.IsA('DeusExPlayer'))
DeusExPlayer(event.ToActor).UpdateAmmoBeltText(AmmoType);

// Tell the player he just received some ammo!
invItemTo = AmmoType;
}
else
{
// Don't want to show this as being received in a convo
invItemTo = None;
}

// Destroy our From item
invItemFrom.Destroy();
invItemFrom = None;
}

// Otherwise check to see if we need to transfer more than
// one of the given item
else
{
itemsTransferred = AddTransferCount(invItemFrom, invItemTo, event, Pawn(event.toActor), False);

// If no items were transferred, then the player's inventory is full or
// no more of these items can be stacked, so abort.
if (itemsTransferred == 0)
return nextAction;

// Now destroy the originating object (which we either spawned
// or is sitting in the giver's inventory), but check to see if this
// item still has any copies left first

if (((invItemFrom.IsA('DeusExPickup')) && (DeusExPickup(invItemFrom).bCanHaveMultipleCopies) && (DeusExPickup(invItemFrom).NumCopies <= 0)) ||
((invItemFrom.IsA('DeusExPickup')) && (!DeusExPickup(invItemFrom).bCanHaveMultipleCopies)) ||
(!invItemFrom.IsA('DeusExPickup')))
{
invItemFrom.Destroy();
invItemFrom = None;
}
}
}

// Okay, recipient does *NOT* have the item, so it must be give
// to that pawn and the original destroyed
else
{
// If the item being given is a stackable item and the
// recipient isn't receiving *ALL* the copies, then we
// need to spawn a *NEW* copy and give that to the recipient.
// Otherwise just do a "SpawnCopy", which transfers ownership
// of the object to the new owner.

if ((invItemFrom.IsA('DeusExPickup')) && (DeusExPickup(invItemFrom).bCanHaveMultipleCopies) &&
(DeusExPickup(invItemFrom).NumCopies > event.transferCount))
{
itemsTransferred = event.TransferCount;
invItemTo = Spawn(event.giveObject);
invItemTo.GiveTo(Pawn(event.toActor));
DeusExPickup(invItemFrom).NumCopies -= event.transferCount;
bSplitItem = True;
bSpawnedItem = True;
}
else
{
invItemTo = invItemFrom.SpawnCopy(Pawn(event.toActor));
}

//log(" invItemFrom = "$ invItemFrom);
//log(" invItemTo = " $ invItemTo);

if (DeusExPlayer(event.toActor) != None)
DeusExPlayer(event.toActor).FindInventorySlot(invItemTo);

// Check if this item was in the player's hand *AND* that the player is
// giving the item to someone else.
if ((DeusExPlayer(event.fromActor) != None) && (!bSplitItem))
RemoveItemFromPlayer(invItemFrom);

// If this was a DataVaultImage, then the image needs to be
// properly added to the datavault
if ((invItemTo.IsA('DataVaultImage')) && (event.toActor.IsA('DeusExPlayer')))
{
DeusExPlayer(event.toActor).AddImage(DataVaultImage(invItemTo));

if (conWinThird != None)
conWinThird.ShowReceivedItem(invItemTo, 1);
else
DeusExRootWindow(player.rootWindow).hud.receivedItems.AddItem(invItemTo, 1);

invItemFrom = None;
invItemTo = None;
}

// Special case for Credit Chits also
else if ((invItemTo.IsA('Credits')) && (event.toActor.IsA('DeusExPlayer')))
{
if (conWinThird != None)
conWinThird.ShowReceivedItem(invItemTo, Credits(invItemTo).numCredits);
else
DeusExRootWindow(player.rootWindow).hud.receivedItems.AddItem(invItemTo, Credits(invItemTo).numCredits);

player.Credits += Credits(invItemTo).numCredits;

invItemTo.Destroy();

invItemFrom = None;
invItemTo = None;
}

// Now check to see if the transfer event specified transferring
// more than one copy of the object
else
{
itemsTransferred = AddTransferCount(invItemFrom, invItemTo, event, Pawn(event.toActor), True);

// If no items were transferred, then the player's inventory is full or
// no more of these items can be stacked, so abort.
if (itemsTransferred == 0)
{
invItemTo.Destroy();
return nextAction;
}

// Update the belt text
if (invItemTo.IsA('Ammo'))
player.UpdateAmmoBeltText(Ammo(invItemTo));
else
player.UpdateBeltText(invItemTo);
}
}

// Show the player that he/she/it just received something!
if ((DeusExPlayer(event.toActor) != None) && (conWinThird != None) && (invItemTo != None))
{
if (conWinThird != None)
conWinThird.ShowReceivedItem(invItemTo, itemsTransferred);
else
DeusExRootWindow(player.rootWindow).hud.receivedItems.AddItem(invItemTo, itemsTransferred);
}

nextAction = EA_NextEvent;
nextLabel = "";

return nextAction;

SetupEventTrigger (ConEventTrigger event, out String nextLabel) -> EEventAction


local Actor anActor;


// Loop through all the actors, firing a trigger for each
foreach AllActors(class'Actor', anActor, event.triggerTag)
anActor.Trigger(lastActor, Pawn(lastActor));

return EA_NextEvent;

SetupHistory (String ownerName, optional Bool bInfoLink)


local Name flagName;
local bool bBarkConvo;


// If this conversation has already been played, we don't want
// to record it again
//
// Also ignore Bark conversations.

bBarkConvo = (Left(con.conName, Len(con.conOwnerName) + 5) == (con.conOwnerName $ "_Bark"));
flagName = rootWindow.StringToName(con.conName $ "_Played");

if ((player.flagBase.GetBool(flagName) == False) && (!bBarkConvo))
{
history = player.CreateHistoryObject();

history.conOwnerName = ownerName;
history.strLocation = MissionLocation;
history.strDescription = con.Description;
history.bInfoLink = bInfoLink;
history.firstEvent = None;
history.lastEvent = None;
history.next = None;
}
else
{
history = None;
}

StartConversation (DeusExPlayer newPlayer, optional Actor newInvokeActor, optional bool bForcePlay) -> Bool


local DeusExLevelInfo aDeusExLevelInfo;


// Make sure we have a conversation and a valid Player
if (( con == None ) || ( newPlayer == None ))
return False;

// Make sure the player isn't, uhhrr, you know, DEAD!
if (newPlayer.IsInState('Dying'))
return False;

// Keep a pointer to the player and invoking actor
player = newPlayer;

if (newInvokeActor != None)
invokeActor = newInvokeActor;
else
invokeActor = startActor;

// Bind the conversation events
con.BindEvents(ConActorsBound, invokeActor);

// Check to see if the conversation has multiple owners, in which case we
// want to rebind all the events with this owner. This allows conversations
// to be shared by more than one owner.
if ((con.ownerRefCount > 1) && (invokeActor != None))
con.BindActorEvents(invokeActor);

// Check to see if all the actors are on the level.
// Don't check this for InfoLink conversations, since oftentimes
// the person speaking via InfoLink *won't* be on the map.
//
// If a person speaking on the conversation can't be found
// (say, they were ruthlessly MURDERED!) then abort.
//
// Hi Ken!

if ((!bForcePlay) && (!con.bDataLinkCon) && (!con.CheckActors()))
return False;

// Now check to make sure that all the actors are a reasonable distance
// from one another (excluding the player)
if ((!bForcePlay) && (!con.CheckActorDistances(player)))
return False;

// Save the mission number and location
foreach AllActors(class'DeusExLevelInfo', aDeusExLevelInfo)
{
if (aDeusExLevelInfo != None)
{
missionNumber = aDeusExLevelInfo.missionNumber;
missionLocation = aDeusExLevelInfo.MissionLocation;
break;
}
}

// Save the conversation radius
saveRadiusDistance = con.radiusDistance;

// Initialize Windowing System
rootWindow = DeusExRootWindow(player.rootWindow);

bConversationStarted = True;

return True;

StopSpeech


player.StopSound(playingSoundID);

TerminateConversation (optional bool bContinueSpeech, optional bool bNoPlayedFlag)


// Make sure there's no audio playing
if (!bContinueSpeech)
player.StopSound(playingSoundID);

// Set the played flag
if (!bNoPlayedFlag)
SetPlayedFlag();

// Clear the bound event actors
con.ClearBindEvents();

// Reset the conversation radious
con.radiusDistance = saveRadiusDistance;

// Notify the conversation participants to go about their
// business.
EndConActorStates();

con = None;
currentEvent = None;
lastEvent = None;

TurnActor (Actor turnActor, Actor turnTowards)


// Check to see if each Actor is already in the conversation
// state. If not, they need to be in that state. Just don't
// add the player

if (DeusExPlayer(turnActor) == None)
{
AddConActor(turnActor, con.bFirstPerson);

if ((turnActor != None) && (turnActor.IsA('ScriptedPawn')))
ScriptedPawn(turnActor).ConversationActor = turnTowards;
}
else
DeusExPlayer(turnActor).ConversationActor = turnTowards;

TurnSpeakingActors (Actor speaker, Actor speakingTo)


if (!bForcePlay)
{
TurnActor(speaker, speakingTo);
TurnActor(speakingTo, speaker);
}
else
{
if ((speaker != None) && (speaker.IsA('ScriptedPawn')))
ScriptedPawn(speaker).EnterConversationState(con.bFirstPerson);
if ((speakingTo != None) && (speakingTo.IsA('ScriptedPawn')))
ScriptedPawn(speakingTo).EnterConversationState(con.bFirstPerson);
}




ConWindow.uc (extends DeusExBaseWindow)

var TileWindow lowerConWindow; // Lower letterbox region
var ConWindowSpeech winSpeech; // Speech window
var ConCameraWindow cameraWin; // Camera Stats displayed here
var Texture conTexture; // Background texture for window
var ConPlay conPlay; // Pointer into current conPlay object
var DeusExPlayer player;
var DeusExRootWindow root;
var float conStartTime;
var bool bForcePlay;
conTexture=Texture'DeusExUI.UserInterface.ConWindowBackground'
ScreenType=ST_Conversation

AppendText (string text)


if (winSpeech == None )
CreateSpeechWindow();

winSpeech.AppendSpeech(text);

ChildRequestedReconfiguration (window childWin) -> bool


ConfigurationChanged();

return True;

Clear


DestroyChildren();

Close


Hide();

ConfigurationChanged


local float newHeight;
local float lowerConPosY;


newHeight = height * 0.15;

lowerConPosY = height - newHeight - 30;
lowerConWindow.ConfigureChild(75, lowerConPosY, width - 150, newHeight);

ConfigureCameraWindow(lowerConPosY);

ConfigureCameraWindow (float lowerConPosY)


local float qWidth, qHeight;


// If the camera window is visible, position it right above the lower window
if (cameraWin != None)
{
cameraWin.QueryPreferredSize(qWidth, qHeight);
cameraWin.ConfigureChild(10, lowerConPosY - qHeight - 10, qWidth, qHeight);
}

CreateCameraWindow


if (( cameraWin == None ) && (conPlay != None))
{
cameraWin = ConCameraWindow(NewChild(Class'ConCameraWindow'));
cameraWin.SetConCamera(conPlay.cameraInfo);
}

CreateSpeechWindow


if (winSpeech == None)
{
winSpeech = ConWindowSpeech(lowerConWindow.NewChild(Class'ConWindowSpeech'));
winSpeech.SetSpeechFont(conPlay.GetCurrentSpeechFont());
winSpeech.SetNameFont(conPlay.GetCurrentNameFont());
winSpeech.SetForcePlay(bForcePlay);
}

DestroyCameraWindow


if ( cameraWin != None )
{
cameraWin.Destroy();
cameraWin = None;
}

DestroyChildren


local Window win;


win = lowerConWindow.GetTopChild();
while( win != None )
{
win.Destroy();
win = lowerConWindow.GetTopChild();
}

// Reset variables
winSpeech = None;

DisplayName (string text)


// Don't do this if bForcePlay == True

if (!bForcePlay)
{
if (winSpeech == None )
CreateSpeechWindow();

winSpeech.SetName(text);
}

DisplayText (string text, Actor speakingActor)


if (winSpeech == None )
CreateSpeechWindow();

winSpeech.SetSpeech(text, speakingActor);

InitWindow


Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(DeusExRootWindow(GetRootWindow()).parentPawn);

// Get a pointer to the root window
root = DeusExRootWindow(GetRootWindow());

// Set default mouse focus mode
SetMouseFocusMode(MFocus_Enter);

// Initialize some variables and stuff
conPlay = None;

// Create text window where we'll display the conversation
lowerConWindow = TileWindow(NewChild(Class'TileWindow'));
lowerConWindow.SetBackground(conTexture);
lowerConWindow.SetBackgroundStyle(DSTY_Modulated);
lowerConWindow.SetOrder(ORDER_Down);
lowerConWindow.SetChildAlignments(HALIGN_Full, VALIGN_Top);
lowerConWindow.SetMargins(2, 2);
lowerConWindow.MakeWidthsEqual(False);
lowerConWindow.MakeHeightsEqual(False);
lowerConWindow.SetTileColorRGB(0, 0, 0);

conStartTime = player.level.TimeSeconds;

// lastTick = 0;
// fadeColor = 255;

MouseButtonReleased (float pointX, float pointY, EInputKey button, int numClicks) -> bool


// Ignore the mouse click if we're less than two seconds
// into the conversation

if (player.level.TimeSeconds - conStartTime < 2)
{
return False;
}
else
{
conPlay.PlayNextEvent();
return True;
}

ProcessCameraKey (EInputKey key) -> bool


local float magnitude;
local bool rotationControl;
local ConCamera ci;
local bool bHandled;


// Get a pointer to the Camera Object for shorthand reference
ci = conPlay.cameraInfo;

// Allow the user to hold down shift or ctrl for less/finer
// resolution

if ( IsKeyDown(IK_SHIFT) )
magnitude = 10.0;
else
magnitude = 1.0;

// If the user is holding down Control, then we're toying with
// the camera rotation

rotationControl = IsKeyDown(IK_CTRL);

// Keys are different based on whether we're in Speakers or Actor camera mode.

if (( ci.cameraMode == CT_Actor ) && ( rotationControl == False ))
{
switch( key )
{
// Move Left/Right (X Axis)
case IK_Left:
ci.cameraOffset.X -= (0.10 * magnitude);
bHandled = True;
break;
case IK_Right:
ci.cameraOffset.X += (0.10 * magnitude);
bHandled = True;
break;

// Move Up/Down (Y Axis)
case IK_Up:
ci.cameraOffset.Y -= (0.10 * magnitude);
bHandled = True;
break;
case IK_Down:
ci.cameraOffset.Y += (0.10 * magnitude);
bHandled = True;
break;

// Zoom-In/Out (Z Axis)
case IK_A:
ci.cameraOffset.Z -= (0.10 * magnitude);
bHandled = True;
break;
case IK_Z:
ci.cameraOffset.Z += (0.10 * magnitude);
bHandled = True;
break;
}
}
else if (( ci.cameraMode == CT_Speakers ) && ( rotationControl == False ))
{
switch( key )
{
// Center Modifier
case IK_Left:
ci.centerModifier += (0.10 * magnitude);
bHandled = True;
break;
case IK_Right:
ci.centerModifier -= (0.10 * magnitude);
bHandled = True;
break;

// Camera Height Modifier
case IK_Up:
ci.heightModifier += (0.10 * magnitude);
bHandled = True;
break;
case IK_Down:
ci.heightModifier -= (0.10 * magnitude);
bHandled = True;
break;

// Distance Multiplier
case IK_A:
ci.distanceMultiplier += (0.10 * magnitude);
bHandled = True;
break;
case IK_Z:
ci.distanceMultiplier -= (0.10 * magnitude);
bHandled = True;
break;
}
}

// If the key still hasn't been handled, check to see there's a key
// common to both modes

if ( bHandled == False )
{
// Keys common to both modes
switch( key )
{
// Pitch
case IK_Up:
ci.rotation.pitch += (100 * magnitude);
bHandled = True;
break;
case IK_Down:
ci.rotation.pitch -= (100 * magnitude);
bHandled = True;
break;

// Yaw
case IK_Left:
ci.rotation.yaw += (100 * magnitude);
bHandled = True;
break;
case IK_Right:
ci.rotation.yaw -= (100 * magnitude);
bHandled = True;
break;

// Roll
case IK_A:
ci.rotation.roll += (100 * magnitude);
bHandled = True;
break;
case IK_Z:
ci.rotation.roll -= (100 * magnitude);
bHandled = True;
break;

// Toggle through camera views
case IK_PageUp:
ci.IncCameraMode();
break;

case IK_PageDown:
ci.DecCameraMode();
break;

// Write camera info to log
case IK_SPACE:
ci.LogCameraInfo();
bHandled = True;
break;

// Switch camera modes
case IK_ENTER:
ci.SwitchCameraMode();
bHandled = True;
break;
}
}

// If we processed this key, update the camera window

if (( bHandled ) && (cameraWin != None))
cameraWin.UpdateCameraInfo();

return bHandled;

SetForcePlay (bool bNewForcePlay)


bForcePlay = bNewForcePlay;

ShowReceivedItem (Inventory invItem, int count)

Tick (float deltaSeconds)




//////////////////////////////////////////////////////////////////
// This code is commented out because setting the tile color for
// modulated textures DOES NOT WORK (damn). Someday perhaps we'll
// find a work-around or fix the engine to support this.
//////////////////////////////////////////////////////////////////
/*
if ( lastTick + deltaSeconds > fadeInterval )
{
fadeColor--;
lowerConWindow.SetTileColorRGB(fadeColor, fadeColor, fadeColor);
lastTick = ( lastTick - fadeInterval);

// Stop the tick event once the box is solid black.
if ( fadeColor == 0 )
bTickEnabled = False;
}
else
{
lastTick = lastTick + deltaSeconds;
}
*/

UpdateCameraInfo


if ( cameraWin != None )
cameraWin.UpdateCameraInfo();

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bHandled;


if ( conPlay.interactiveCamera )
bHandled = ProcessCameraKey( key );

// Check for Ctrl-F9, which is a hard-coded key to take a screenshot
if ( IsKeyDown( IK_Ctrl ) && ( key == IK_F9 ))
{
player.ConsoleCommand("SHOT");
return True;
}

// If the key wasn't handled, let's take a look to see if we can
// use it.

if ( bHandled == False )
{
switch( key )
{
// Toggle interactive conversations on/off
// case IK_F1:
// conPlay.ToggleInteractiveCamera();
// bHandled = True;
// break;

case IK_Escape:
case IK_Enter:
case IK_Space:
conPlay.PlayNextEvent();
bHandled = True;
break;
}
}

return bHandled;




ConWindowActive.uc (extends ConWindow)

var Window upperConWindow; // Upper letterbox region
var int numChoices; // Number of choice buttons
var ConChoiceWindow conChoices[10]; // Maximum of ten buttons
var HUDReceivedDisplay winReceived;
var bool bRestrictInput;
var Color colConTextFocus;
var Color colConTextChoice;
var Color colConTextSkill;
var float currentWindowPos;
var float lowerFinalHeightPercent;
var float upperFinalHeightPercent;
var float movePeriod;
var EMoveModes moveMode;
colConTextFocus=(R=255,G=255)
colConTextChoice=(B=255)
colConTextSkill=(R=255)
lowerFinalHeightPercent=0.210000
upperFinalHeightPercent=0.104000
movePeriod=0.600000
conTexture=Texture'DeusExUI.UserInterface.ConWindowActiveBackground'

AbortCinematicConvo


local MissionEndgame script;
local DeusExPlayer localPlayer;


localPlayer = player;

conPlay.TerminateConversation();

foreach localPlayer.AllActors(class'MissionEndgame', script)
break;

if (script != None)
script.FinishCinematic();

AddButton (ConChoiceWindow newButton)


// Turn the cursor on so the user can use the cursor to
// select a choice.
root.ShowCursor(True);

// Add to our button array
conChoices[numChoices++] = newButton;

ButtonActivated (Window buttonPressed) -> bool


local int buttonIndex;


// Abort if we're restricting input
if (bRestrictInput)
return True;

// Restrict input again until we've finished processing this choice
bRestrictInput = True;

// Abort if we're in the process of moving
if ( moveMode != MM_None )
return True;

// Take a look to make sure it's one of our buttons before continuing.
for ( buttonIndex=0; buttonIndex {
if (conChoices[buttonIndex] == buttonPressed)
{
// Turn the cursor back off
root.ShowCursor(False);
conPlay.PlayChoice( ConChoice(conChoices[buttonIndex].GetUserObject()) );

// Clear the screen
Clear();

break;
}
}

return True;

CalculateWindowSizes


local float lowerHeight;
local float upperHeight;
local float lowerCurrentPos;
local float upperCurrentPos;
local float recWidth, recHeight;
local float cinHeight;
local float ratio;
local RootWindow root;


root = GetRootWindow();

// Determine the height of the convo windows, based on available space
if (bForcePlay)
{
// calculate the correct 16:9 ratio
ratio = 0.5625 * (root.width / root.height);
cinHeight = root.height * ratio;

upperCurrentPos = 0;
upperHeight = int(0.5 * (root.height - cinHeight));
lowerCurrentPos = upperHeight + cinHeight;
lowerHeight = upperHeight;

// make sure we don't invert the letterbox if the screen size is strange
if (upperHeight < 0)
root.ResetRenderViewport();
else
root.SetRenderViewport(0, upperHeight, width, cinHeight);
}
else
{
upperHeight = int(height * upperFinalHeightPercent);
lowerHeight = int(height * lowerFinalHeightPercent);

// Compute positions for the convo windows
lowerCurrentPos = int(height - (lowerHeight*currentWindowPos));
upperCurrentPos = int(-upperHeight * (1.0-currentWindowPos));

// Squeeze the rendered area
if (root != None)
root.SetRenderViewport(0, upperCurrentPos+upperHeight,
width, lowerCurrentPos-(upperCurrentPos+upperHeight));
}

// Configure conversation windows
if (upperConWindow != None)
upperConWindow.ConfigureChild(0, upperCurrentPos, width, upperHeight);
if (lowerConWindow != None)
lowerConWindow.ConfigureChild(0, lowerCurrentPos, width, lowerHeight);

// Configure Received Window
if (winReceived != None)
{
winReceived.QueryPreferredSize(recWidth, recHeight);
winReceived.ConfigureChild(10, lowerCurrentPos - recHeight - 5, recWidth, recHeight);
}

ConfigureCameraWindow(lowerCurrentPos);

ChildRequestedReconfiguration (window childWin) -> bool


return False;

Close


moveMode = MM_Exit;
bTickEnabled = True;

ConfigurationChanged


CalculateWindowSizes();

CreateConButton (EHAlign hAlign, Color colTextNormal, Color colTextFocus) -> ConChoiceWindow


local ConChoiceWindow newButton;


newButton = ConChoiceWindow(lowerConWindow.NewChild(Class'ConChoiceWindow'));
newButton.SetTextAlignments(hAlign, VALIGN_Center);
newButton.SetTextMargins(10, 2);
newButton.SetFont(conPlay.GetCurrentSpeechFont());
newButton.SetTextColors( colTextNormal, colTextFocus, colTextFocus, colTextFocus );

return newButton;

CreateReceivedWindow


winReceived = HUDReceivedDisplay(NewChild(Class'HUDReceivedDisplay'));
winReceived.Hide();

DestroyChildren


local int buttonIndex;


Super.DestroyChildren();

// Clear our array as well

for ( buttonIndex=0; buttonIndex conChoices[buttonIndex] = None;

numChoices = 0;

DestroyWindow


// Turn the cursor back on
root.ShowCursor(True);

DisplayChoice (ConChoice choice)


local ConChoiceWindow newButton;


newButton = CreateConButton( HALIGN_Left, colConTextChoice, colConTextFocus );
newButton.SetText( "~ " $ choice.choiceText );
newButton.SetUserObject( choice );

// These next two calls handle highlighting of the choice
newButton.SetButtonTextures(,Texture'Solid', Texture'Solid', Texture'Solid');
newButton.SetButtonColors(,colConTextChoice, colConTextChoice, colConTextChoice);

// Add the button
AddButton( newButton );

DisplaySkillChoice (ConChoice choice)


local ConChoiceWindow newButton;


newButton = CreateConButton( HALIGN_Left, colConTextSkill, colConTextFocus );
newButton.SetText( "~ " $ choice.choiceText $ " (" $ choice.SkillNeeded $ ":" $ choice.SkillLevelNeeded $ ")" );
newButton.SetUserObject( choice );

// Add the button
AddButton( newButton );

InitWindow


Super.InitWindow();

root.ShowCursor(False);

// Modify lower window
lowerConWindow.SetBackgroundStyle(DSTY_Normal);

// Create upper window
upperConWindow = NewChild(Class'Window');
upperConWindow.SetBackground(conTexture);

moveMode = MM_None;

CreateReceivedWindow();

MouseButtonReleased (float pointX, float pointY, EInputKey button, int numClicks) -> bool


// Abort if we're restricting input
if (bRestrictInput)
return True;

// Ignore keys in bForcePlay mode
if (bForcePlay)
{
AbortCinematicConvo();
return True;
}

// Abort if we're in the process of moving
if ( moveMode != MM_None )
return True;

if ( numChoices == 0 )
conPlay.PlayNextEvent();

return True;

RestrictInput (bool bNewRestrictInput)


bRestrictInput = bNewRestrictInput;

SetForcePlay (bool bNewForcePlay)


Super.SetForcePlay(bNewForcePlay);

if (bForcePlay)
movePeriod = 0.0;

ShowReceivedItem (Inventory invItem, int count)


if (winReceived != None)
{
winReceived.AddItem(invItem, count);
}

Tick (float deltaSeconds)


local float increment;


Super.Tick(deltaSeconds);

// Compute how much we should move the windows this frame
increment = deltaSeconds/movePeriod;

// Check to see if we're moving up or down

switch( moveMode )
{
case MM_Enter:
currentWindowPos += increment;
if (currentWindowPos >= 1.0)
{
currentWindowPos = 1.0;
moveMode = MM_None;
}
AskParentForReconfigure();
break;

case MM_Exit:
// Don't increment while the Items Received window
// is still active

if (!winReceived.IsVisible())
{
currentWindowPos -= increment;
if (currentWindowPos <= 0.0)
{
currentWindowPos = 0.0;
moveMode = MM_None;
Hide();
}
AskParentForReconfigure();
}
break;

default:
bTickEnabled = False;
}

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bHandled;

bHandled = True;

// Abort if we're restricting input
if (bRestrictInput)
return True;

// Ignore keys in bForcePlay mode
if (bForcePlay)
{
if (key == IK_Escape)
{
AbortCinematicConvo();
return True;
}
else
{
return False;
}
}

// Check for Ctrl-F9, which is a hard-coded key to take a screenshot
if ( IsKeyDown( IK_Ctrl ) && ( key == IK_F9 ))
{
player.ConsoleCommand("SHOT");
return True;
}

if (( conPlay.interactiveCamera ) && ( key != IK_F1 ))
{
ProcessCameraKey( key );
}
else
{
switch( key )
{
// Toggle interactive conversations on/off
// case IK_F1:
// conPlay.ToggleInteractiveCamera();
// break;

case IK_Escape:
case IK_Enter:
case IK_Space:
if ( numChoices == 0 )
conPlay.PlayNextEvent();
break;

// Let Up and Down arrows through for choices
case IK_Up:
case IK_Down:
bHandled = False;
break;
}
}

return bHandled;

VisibilityChanged (bool bNewVisibility)


local RootWindow root;


Super.VisibilityChanged(bNewVisibility);

// We're visible -- start moving the windows in
if (bNewVisibility)
{
moveMode = MM_Enter;
bTickEnabled = true;
}

// We're *not* visible -- reset everything
else
{
moveMode = MM_None;
bTickEnabled = false;
root = GetRootWindow();
if (root != None)
root.ResetRenderViewport();
}




ConWindowSpeech.uc (extends AlignWindow)

var TextWindow txtName;
var TextWindow txtSpeech;
var bool bForcePlay;
var Color colConTextNormal;
var Color colConTextPlayer;
var Color colConTextName;
colConTextNormal=(G=255,B=255)
colConTextPlayer=(R=255,G=255,B=255)
colConTextName=(R=255,G=255,B=255)

AppendSpeech (String newSpeech)


txtSpeech.AppendText(CR() $ CR() $ newSpeech);

CreateControls


txtName = TextWindow(NewChild(Class'TextWindow', False));
txtName.SetTextColor(colConTextName);
txtName.SetTextAlignments(HALIGN_Left, VALIGN_Top);
txtName.Hide();

txtSpeech = TextWindow(NewChild(Class'TextWindow', False));
txtSpeech.SetTextAlignments(HALIGN_Left, VALIGN_Top);
txtSpeech.Hide();

InitWindow


Super.InitWindow();

SetChildVAlignment(VALIGN_Top);

CreateControls();

SetForcePlay (bool bNewForcePlay)


bForcePlay = bNewForcePlay;

if (bForcePlay)
txtSpeech.SetTextAlignments(HALIGN_Center, VALIGN_Top);

SetName (String newName)


if (newName == "")
{
txtName.SetText("");
txtName.Show(False);
}
else
{
txtName.SetText(newName $ ": ");
txtName.Show(True);
}

SetNameFont (Font newNameFont)


if (txtName != None)
txtName.SetFont(newNameFont);

SetSpeech (String newSpeech, optional Actor speakingActor)


if (newSpeech == "")
{
txtSpeech.SetText("");
txtSpeech.Show(False);
}
else
{
txtSpeech.SetText(newSpeech);

// Use a different color for the player's text
if ((speakingActor != None) && (DeusExPlayer(speakingActor) != None))
txtSpeech.SetTextColor(colConTextPlayer);
else
txtSpeech.SetTextColor(colConTextNormal);

txtSpeech.Show(True);
}

SetSpeechFont (Font newSpeechFont)


if (txtSpeech != None)
txtSpeech.SetFont(newSpeechFont);




Containers.uc (extends DeusExDecoration)

var() int numThings;
var() bool bGenerateTrash;
numThings=1
bFlammable=True
bCanBeBase=True

Destroyed


local actor dropped;
local class tempClass;
local int i;
local Rotator rot;
local Vector loc;
local TrashPaper trash;
local Rat vermin;


// trace down to see if we are sitting on the ground
loc = vect(0,0,0);
loc.Z -= CollisionHeight + 8.0;
loc += Location;

// only generate trash if we are on the ground
if (!FastTrace(loc) && bGenerateTrash)
{
// maybe spawn some paper
for (i=0; i<4; i++)
{
if (FRand() < 0.75)
{
loc = Location;
loc.X += (CollisionRadius / 2) - FRand() * CollisionRadius;
loc.Y += (CollisionRadius / 2) - FRand() * CollisionRadius;
loc.Z += (CollisionHeight / 2) - FRand() * CollisionHeight;
trash = Spawn(class'TrashPaper',,, loc);
if (trash != None)
{
trash.SetPhysics(PHYS_Rolling);
trash.rot = RotRand(True);
trash.rot.Yaw = 0;
trash.dir = VRand() * 20 + vect(20,20,0);
trash.dir.Z = 0;
}
}
}

// maybe spawn a rat
if (FRand() < 0.5)
{
loc = Location;
loc.Z -= CollisionHeight;
vermin = Spawn(class'Rat',,, loc);
if (vermin != None)
vermin.bTransient = true;
}
}

if( (Pawn(Base) != None) && (Pawn(Base).CarriedDecoration == self) )
Pawn(Base).DropDecoration();
if( (Contents!=None) && !Level.bStartup )
{
tempClass = Contents;
if (Content2!=None && FRand()<0.3) tempClass = Content2;
if (Content3!=None && FRand()<0.3) tempClass = Content3;

for (i=0; i {
loc = Location+VRand()*CollisionRadius;
loc.Z = Location.Z;
rot = rot(0,0,0);
rot.Yaw = FRand() * 65535;
dropped = Spawn(tempClass,,, loc, rot);
if (dropped != None)
{
dropped.RemoteRole = ROLE_DumbProxy;
dropped.SetPhysics(PHYS_Falling);
dropped.bCollideWorld = true;
dropped.Velocity = VRand() * 50;
if ( inventory(dropped) != None )
inventory(dropped).GotoState('Pickup', 'Dropped');
}
}
}

Super.Destroyed();




ControlPanel.uc (extends HackableDevices)

ItemName="Electronic Control Panel"
Mesh=LodMesh'DeusExDeco.ControlPanel'
SoundRadius=8
SoundVolume=255
SoundPitch=96
AmbientSound=Sound'DeusExSounds.Generic.ElectronicsHum'
CollisionRadius=14.500000
CollisionHeight=23.230000
Mass=10.000000
Buoyancy=5.000000

HackAction (Actor Hacker, bool bHacked)


local Actor A;


Super.HackAction(Hacker, bHacked);

if (bHacked)
{
if (Event != '')
foreach AllActors(class 'Actor', A, Event)
A.Trigger(Self, Pawn(Hacker));
}

StopHacking


Super.StopHacking();

if (hackStrength == 0.0)
PlayAnim('Open');




ConversationTrigger.uc (extends Trigger)

var() name conversationTag;
var() string BindName;
var() name checkFlag;
var() bool bCheckFalse;
bTriggerOnceOnly=True
CollisionRadius=96.000000

Touch (Actor Other)


local DeusExPlayer player;
local bool bSuccess;
local Actor A, conOwner;


player = DeusExPlayer(Other);
bSuccess = True;

// only works for DeusExPlayers
if (player == None)
return;

if (checkFlag != '')
{
if (!player.flagBase.GetBool(checkFlag))
bSuccess = bCheckFalse;
else
bSuccess = !bCheckFalse;
}

if ((BindName != "") && (conversationTag != ''))
{
foreach AllActors(class'Actor', A)
if (A.BindName == BindName)
{
conOwner = A;
break;
}


if (bSuccess)
if (player.StartConversationByName(conversationTag, conOwner))
Super.Touch(Other);
}

Trigger (Actor Other, Pawn Instigator)


local DeusExPlayer player;
local bool bSuccess;
local Actor A, conOwner;


player = DeusExPlayer(Instigator);
bSuccess = True;

// only works for DeusExPlayers
if (player == None)
return;

if (checkFlag != '')
{
if (!player.flagBase.GetBool(checkFlag))
bSuccess = bCheckFalse;
else
bSuccess = !bCheckFalse;
}

if ((BindName != "") && (conversationTag != ''))
{
foreach AllActors(class'Actor', A)
if (A.BindName == BindName)
{
conOwner = A;
break;
}


if (bSuccess)
if (player.StartConversationByName(conversationTag, conOwner))
Super.Trigger(Other, Instigator);
}




Cop.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.CopCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.750000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.CopTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.CopTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.CopTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.CopTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.CopTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Cop"
FamiliarName="Cop"
UnfamiliarName="Cop"



CopCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.CopTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.CopTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.CopTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.CopTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.CopTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=40.000000



CouchLeather.uc (extends Seat)

var() ESkinColor SkinColor;
sitPoint(0)=(X=-18.000000,Y=-8.000000,Z=0.000000)
sitPoint(1)=(X=18.000000,Y=-8.000000,Z=0.000000)
ItemName="Leather Couch"
Mesh=LodMesh'DeusExDeco.CouchLeather'
CollisionRadius=47.880001
CollisionHeight=23.250000
Mass=100.000000
Buoyancy=110.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Black: Skin = Texture'CouchLeatherTex1'; break;
case SC_Blue: Skin = Texture'CouchLeatherTex1'; break;
case SC_Brown: Skin = Texture'CouchLeatherTex1'; break;
case SC_LitGray: Skin = Texture'CouchLeatherTex1'; break;
case SC_Tan: Skin = Texture'CouchLeatherTex1'; break;
}




CrateBreakableMedCombat.uc (extends Containers)

HitPoints=10
FragType=Class'DeusEx.WoodFragment'
ItemName="Combat Supply Crate"
contents=Class'DeusEx.Ammo10mm'
bBlockSight=True
Skin=Texture'DeusExDeco.Skins.CrateBreakableMedTex3'
Mesh=LodMesh'DeusExDeco.CrateBreakableMed'
CollisionRadius=34.000000
CollisionHeight=24.000000
Mass=50.000000
Buoyancy=60.000000



CrateBreakableMedGeneral.uc (extends Containers)

HitPoints=10
FragType=Class'DeusEx.WoodFragment'
ItemName="General Supply Crate"
contents=Class'DeusEx.Lockpick'
bBlockSight=True
Skin=Texture'DeusExDeco.Skins.CrateBreakableMedTex2'
Mesh=LodMesh'DeusExDeco.CrateBreakableMed'
CollisionRadius=34.000000
CollisionHeight=24.000000
Mass=50.000000
Buoyancy=60.000000



CrateBreakableMedMedical.uc (extends Containers)

HitPoints=10
FragType=Class'DeusEx.WoodFragment'
ItemName="Medical Supply Crate"
contents=Class'DeusEx.MedKit'
bBlockSight=True
Skin=Texture'DeusExDeco.Skins.CrateBreakableMedTex1'
Mesh=LodMesh'DeusExDeco.CrateBreakableMed'
CollisionRadius=34.000000
CollisionHeight=24.000000
Mass=50.000000
Buoyancy=60.000000



CrateExplosiveSmall.uc (extends Containers)

HitPoints=4
bExplosive=True
explosionDamage=300
explosionRadius=800.000000
ItemName="TNT Crate"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.CrateExplosiveSmall'
CollisionRadius=22.500000
CollisionHeight=16.000000
Mass=30.000000
Buoyancy=40.000000



CrateUnbreakableLarge.uc (extends Containers)

bInvincible=True
bFlammable=False
ItemName="Metal Crate"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.CrateUnbreakableLarge'
CollisionRadius=56.500000
CollisionHeight=56.000000
Mass=150.000000
Buoyancy=160.000000



CrateUnbreakableMed.uc (extends Containers)

bInvincible=True
bFlammable=False
ItemName="Metal Crate"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.CrateUnbreakableMed'
CollisionRadius=45.200001
CollisionHeight=32.000000
Mass=80.000000
Buoyancy=90.000000



CrateUnbreakableSmall.uc (extends Containers)

bInvincible=True
bFlammable=False
ItemName="Metal Crate"
bBlockSight=True
Mesh=LodMesh'DeusExDeco.CrateUnbreakableSmall'
CollisionRadius=22.500000
CollisionHeight=16.000000
Mass=40.000000
Buoyancy=50.000000



Credits.uc (extends DeusExPickup)

var() int numCredits;
var localized String msgCreditsAdded;
numCredits=100
msgCreditsAdded="%d credits added"
ItemName="Credit Chit"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.Credits'
PickupViewMesh=LodMesh'DeusExItems.Credits'
ThirdPersonMesh=LodMesh'DeusExItems.Credits'
LandSound=Sound'DeusExSounds.Generic.PlasticHit1'
Icon=Texture'DeusExUI.Icons.BeltIconCredits'
beltDescription="CREDITS"
Mesh=LodMesh'DeusExItems.Credits'
CollisionRadius=7.000000
CollisionHeight=0.550000
Mass=2.000000
Buoyancy=3.000000

Frob (Actor Frobber, Inventory frobWith)


local DeusExPlayer player;


Super.Frob(Frobber, frobWith);

player = DeusExPlayer(Frobber);

if (player != None)
{
player.Credits += numCredits;
player.ClientMessage(Sprintf(msgCreditsAdded, numCredits));
player.FrobTarget = None;
Destroy();
}




CreditsScrollWindow.uc (extends DeusExBaseWindow)

var TileWindow winScroll;
var Window winFadeBottom;
var Window winFadeTop;
var String ScrollMusicString;
var int savedSongSection;
var Bool bRenderingEnabled;
var Float currentScrollSpeed;
var Bool bBold;
var bool bLoadIntro;
var bool bScrolling;
var Name textName;
var Float scrollSpeed;
var Float minScrollSpeed;
var Float maxScrollSpeed;
var Float speedAdjustment;
var Int blankLineHeight;
var Int maxTileWidth;
var Int maxTextWidth;
var Font fontHeader;
var Font fontText;
var Color colHeader;
var Color colText;
currentScrollSpeed=0.040000
bScrolling=True
scrollSpeed=0.040000
minScrollSpeed=0.200000
maxScrollSpeed=0.010000
speedAdjustment=0.010000
blankLineHeight=15
maxTileWidth=600
maxTextWidth=550
fontHeader=Font'DeusExUI.FontConversationLargeBold'
fontText=Font'DeusExUI.FontConversationLarge'
colHeader=(R=255,G=255,B=255)
colText=(R=200,G=200,B=200)
ScreenType=ST_Credits

ConfigurationChanged


local float qWidth, qHeight;


if (winFadeTop != None)
{
winFadeTop.QueryPreferredSize(qWidth, qHeight);
winFadeTop.ConfigureChild(0, 0, width, qHeight);
}

if (winFadeBottom != None)
{
winFadeBottom.QueryPreferredSize(qWidth, qHeight);
winFadeBottom.ConfigureChild(0, height - qHeight, width, qHeight);
}

if (winScroll != None)
{
winScroll.QueryPreferredSize(qWidth, qHeight);
winScroll.ConfigureChild((width / 2) - (qwidth / 2), winScroll.vMargin0, qWidth, qHeight);
}

CreateControls


winScroll = TileWindow(NewChild(Class'TileWindow'));

winScroll.SetWidth(maxTileWidth);
winScroll.SetOrder(ORDER_Down);
winScroll.SetChildAlignments(HALIGN_Center, VALIGN_Top);
winScroll.SetMargins(0, 0);
winScroll.SetMinorSpacing(0);
winScroll.SetMajorSpacing(0);
winScroll.MakeWidthsEqual(False);
winScroll.MakeHeightsEqual(False);
winScroll.SetPos(0, root.Height);
winScroll.FillParent(False);

// Create the two fading windows (top and bottom)

winFadeTop = NewChild(Class'Window');
winFadeTop.SetBackground(Texture'FadeTop');
winFadeTop.SetBackgroundStyle(DSTY_Modulated);

winFadeBottom = NewChild(Class'Window');
winFadeBottom.SetBackground(Texture'FadeBottom');
winFadeBottom.SetBackgroundStyle(DSTY_Modulated);

DestroyWindow


StopMusic();

// Re-enable rendering
if (bRenderingEnabled)
root.EnableRendering(True);

// Show the mousey
root.ShowCursor(True);

Super.DestroyWindow();

FinishedScrolling


root.PopWindow();

InitWindow


Super.InitWindow();

SetWindowAlignments(HALIGN_Full, VALIGN_Full);
SetBackgroundStyle(DSTY_Normal);
SetBackground(Texture'Solid');
SetTileColor(colBlack);

StopRendering();
CreateControls();
StartMusic();
ProcessText();

// Hide the mousey
root.ShowCursor(False);

bTickEnabled = True;

PrintAlignText (String itemLabel, String itemText)


local AlignWindow winAlign;
local TextWindow winText;


winAlign = AlignWindow(winScroll.NewChild(Class'AlignWindow'));
winAlign.SetChildVAlignment(VALIGN_Top);
winAlign.SetChildSpacing(5);
winAlign.SetWidth(maxTextWidth);

winText = TextWindow(winAlign.NewChild(Class'TextWindow'));
winText.SetFont(fontText);
winText.SetTextColor(colText);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winText.SetTextMargins(0, 0);
winText.SetText(itemLabel);

winText = TextWindow(winAlign.NewChild(Class'TextWindow'));
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winText.SetFont(fontText);
winText.SetTextColor(colText);
winText.SetTextMargins(0, 0);
winText.SetWordWrap(True);
winText.SetText(itemText);

PrintGraphic (Texture graphic, int sizeX, int sizeY)


local Window winGraphic;


winGraphic = winScroll.NewChild(Class'Window');
winGraphic.SetSize(sizeX, sizeY);
winGraphic.SetBackground(graphic);

PrintHeader (String headerText)


local TextWindow winText;


winText = TextWindow(winScroll.NewChild(Class'TextWindow'));
winText.SetWidth(maxTextWidth);
winText.SetText(headerText);
winText.SetTextColor(colHeader);
winText.SetFont(fontHeader);
winText.SetTextMargins(0, 0);
winText.SetTextAlignments(HALIGN_Center, VALIGN_Top);

PrintLn


local Window winLine;


winLine = winScroll.NewChild(Class'Window');
winLine.SetSize(4, blankLineHeight);

PrintText (String itemText, optional bool bLeftJustify)


local TextWindow winText;


winText = TextWindow(winScroll.NewChild(Class'TextWindow'));
winText.SetWidth(maxTextWidth);
winText.SetText(itemText);
winText.SetTextColor(colText);
winText.SetFont(fontText);
winText.SetTextMargins(0, 0);

if (bLeftJustify)
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
else
winText.SetTextAlignments(HALIGN_Center, VALIGN_Top);

ProcessFinished

ProcessText


local DeusExTextParser parser;


// First check to see if we have a name
if (textName != '')
{
// Create the text parser
parser = new(None) Class'DeusExTextParser';

// Attempt to find the text object
if (parser.OpenText(textName))
{
while(parser.ProcessText())
ProcessTextTag(parser);

parser.CloseText();
}

CriticalDelete(parser);
}

ProcessFinished();

ProcessTextTag (DeusExTextParser parser)


local String text;
local byte tag;
local Name fontName;
local String textPart;
local String fileStringName;
local String fileStringDesc;


tag = parser.GetTag();

switch(tag)
{
case 0: // TT_Text:
text = parser.GetText();

if (text == "")
{
PrintLn();
}
else
{
if (bBold)
{
bBold = False;
PrintHeader(parser.GetText());
}
else
{
PrintText(parser.GetText());
}
}
break;

case 1: // TT_File (graphic, baby!)
parser.GetFileInfo(fileStringName, fileStringDesc);
// PrintGraphic(Texture(DynamicLoadObject(fileStringName, Class'Texture')));
break;

// Bold
case 19: // header
bBold = True;
break;

case 13: // TT_LeftJustify:
break;

case 12: // TT_CenterText:
break;
}

SetLoadIntro (bool bNewLoadIntro)


bLoadIntro = bNewLoadIntro;

StartMusic


local Music CreditsMusic;


if (ScrollMusicString != "")
{
CreditsMusic = Music(DynamicLoadObject(ScrollMusicString, class'Music'));

if (CreditsMusic != None)
{
savedSongSection = player.SongSection;
player.ClientSetMusic(CreditsMusic, 0, 255, MTRAN_FastFade);
}
}

StopMusic


// Shut down the music
player.ClientSetMusic(player.Level.Song, savedSongSection, 255, MTRAN_FastFade);

StopRendering


// Stop the renderer to speed things up
bRenderingEnabled = root.IsRenderingEnabled();

if (bRenderingEnabled)
root.EnableRendering(False);

Tick (float deltaTime)


local int diff;


if (bScrolling)
{
scrollSpeed -= deltaTime;

diff = 0;
while (scrollSpeed < 0.0)
{
scrollSpeed += currentScrollSpeed;
diff++;
}

if (diff > 0)
{
winScroll.SetPos(winScroll.x, winScroll.y - diff);

// Check to see if we've finished scrolling
if ((winScroll.y + winScroll.height) < 0)
{
bScrolling = False;
FinishedScrolling();
}
}
}

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;

bKeyHandled = Super.VirtualKeyPressed(key, bRepeat);

if ( IsKeyDown( IK_Alt ) || IsKeyDown( IK_Shift ) )
return False;

switch( key )
{
// Decrease print rate
case IK_Down:
case IK_Minus:
if (currentScrollSpeed < minScrollSpeed)
currentScrollSpeed += speedAdjustment;
break;

// Increase print rate
case IK_Equals:
case IK_Up:
if (currentScrollSpeed > maxScrollSpeed)
currentScrollSpeed -= speedAdjustment;
break;

// Pause
case IK_S:
if (IsKeyDown(IK_Ctrl))
bTickEnabled = False;
break;

case IK_Q:
if (IsKeyDown(IK_Ctrl))
bTickEnabled = True;
break;

case IK_Space:
if (bTickEnabled)
bTickEnabled = False;
else
bTickEnabled = True;
break;
}

return bKeyHandled;




CreditsWindow.uc (extends CreditsScrollWindow)

var Texture CreditsBannerTextures[6];
var Texture TeamPhotoTextures[6];
var Float creditsEndSoundLength;
var String easterStrings[7];
var String foundStrings[7];
var String easterSearch;
var Int easterPhraseIndex;
var Float easterEggTimer;
var int maxRandomPhrases;
var bool bShowEasterPhrases;
var int phraseCount;
var int phraseIndex;
var Sound EggBadLetterSounds[8];
var Sound EggGoodLetterSounds[5];
var Sound EggFoundSounds[3];
CreditsBannerTextures(0)=Texture'DeusExUI.UserInterface.CreditsBanner_1'
CreditsBannerTextures(1)=Texture'DeusExUI.UserInterface.CreditsBanner_2'
TeamPhotoTextures(0)=Texture'DeusExUI.UserInterface.TeamFront_1'
TeamPhotoTextures(1)=Texture'DeusExUI.UserInterface.TeamFront_2'
TeamPhotoTextures(2)=Texture'DeusExUI.UserInterface.TeamFront_3'
creditsEndSoundLength=4.000000
easterStrings(0)="QUOTES"
easterStrings(1)="DANCEPARTY"
easterStrings(2)="THEREISNOSPOON"
easterStrings(3)="HUTHUT"
easterStrings(4)="BIGHEAD"
easterStrings(5)="IAMWARREN"
easterStrings(6)="MOREFROGS"
foundStrings(0)="QUOTES ENABLED!"
foundStrings(1)="DANCE PARTY ENABLED!"
foundStrings(2)="MAY TRICKS MODE ENABLED!"
foundStrings(3)="HUT HUT HUT HUT HUT!"
foundStrings(4)="SO YOU THINK YOU'RE SMART?"
foundStrings(5)="GENERAL PROTECTION FAULT!"
foundStrings(6)="I HAVE TEN FINGERS AND TEN TOES!"
easterEggTimer=3.000000
maxRandomPhrases=5
EggBadLetterSounds(0)=Sound'DeusExSounds.Generic.Buzz1'
EggBadLetterSounds(1)=Sound'DeusExSounds.Generic.LargeExplosion1'
EggBadLetterSounds(2)=Sound'DeusExSounds.Generic.GlassBreakLarge'
EggBadLetterSounds(3)=Sound'DeusExSounds.Generic.SplashLarge'
EggBadLetterSounds(4)=Sound'DeusExSounds.Animal.CatDie'
EggBadLetterSounds(5)=Sound'DeusExSounds.NPC.ChildDeath'
EggBadLetterSounds(6)=Sound'DeusExSounds.Special.FlushToilet'
EggGoodLetterSounds(0)=Sound'DeusExSounds.Generic.KeyboardClick1'
EggGoodLetterSounds(1)=Sound'DeusExSounds.Generic.KeyboardClick2'
EggGoodLetterSounds(2)=Sound'DeusExSounds.Generic.KeyboardClick1'
EggGoodLetterSounds(3)=Sound'DeusExSounds.Generic.KeyboardClick2'
EggGoodLetterSounds(4)=Sound'DeusExSounds.Generic.KeyboardClick3'
EggFoundSounds(0)=Sound'DeusExSounds.Special.Airplane2'
EggFoundSounds(1)=Sound'DeusExSounds.Generic.Beep2'
EggFoundSounds(2)=Sound'DeusExSounds.Generic.Foghorn'
ScrollMusicString="Credits_Music.Credits_Music"
textName=DeusExCredits

CreateEasterPhrase


local FadeTextWindow winFade;


winFade = FadeTextWindow(NewChild(Class'FadeTextWindow'));
winFade.SetText(foundStrings[easterPhraseIndex]);
winFade.SetPos(Rand(width) - Rand(100), Rand(height));

DestroyWindow


// Check to see if we need to load the intro
if (bLoadIntro)
{
player.Level.Game.SendPlayer(player, "dxonly");
}

Super.DestroyWindow();

EggFound (int eggIndex)


PlayEggFoundSound();

easterPhraseIndex = eggIndex;
bShowEasterPhrases = True;

// Now act on the phrase
if (easterSearch == "QUOTES")
{
player.bQuotesEnabled = True;
player.SaveConfig();
}
else if (easterSearch == "DANCEPARTY")
{
player.ConsoleCommand("OPEN 99_ENDGAME4");
}
else if (easterSearch == "THEREISNOSPOON")
{
player.Matrix();
}
else if (easterSearch == "HUTHUT")
{
}
else if (easterSearch == "BIGHEAD")
{
}
else if (easterSearch == "IAMWARREN")
{
player.IAmWarren();
}

easterSearch = "";

FinishedScrolling


if (player.bQuotesenabled)
{
// Shut down the music
// player.ClientSetMusic(player.Level.Song, savedSongSection, 255, MTRAN_FastFade);
player.PlaySound(Sound'CreditsEnd');
}
else
{
Super.FinishedScrolling();
}

InvokeQuotesWindow


local QuotesWindow winQuotes;


// Check to see if the
if (player.bQuotesEnabled)
{
winQuotes = QuotesWindow(root.InvokeMenuScreen(Class'QuotesWindow'));
winQuotes.SetLoadIntro(bLoadIntro);
winQuotes.SetClearStack(True);
}

KeyPressed (string key) -> bool


local bool bKeyHandled;


if (IsKeyDown(IK_Alt))
return False;

// Check to see if the key entered is one of the
// easter egg phrases
//
// First check to see if this is an alphanum character

if (player.bCheatsEnabled)
{
if (((key >= "A") && (key <= "Z")) ||
((key >= "a") && (key <= "z")) ||
((key >= "0") && (key <= "9")))
{
bKeyHandled = True;

// Convert lower-case to upper
if ((key >= "a") && (key <= "z"))
key = Chr(Asc(key) - 32);

easterSearch = easterSearch $ key;

// If this egg wasn't found *AND* the string is at
// least two characters found, then play a BZZT sound
if (!ProcessEasterEgg())
{
// If the string is > 1 character, play a BZZT
// sound.
if (Len(easterSearch) > 1)
{
// Play BZZT
PlayEggBadLetter();
}

// Reset string
easterSearch = "";
}
}
}

if (bKeyHandled)
return True;
else
return Super.KeyPressed(key);

PlayEggBadLetter


// Temporary
player.PlaySound(EggBadLetterSounds[Rand(ArrayCount(EggBadLetterSounds))]);

PlayEggFoundSound


// Temporary
player.PlaySound(EggFoundSounds[Rand(ArrayCount(EggFoundSounds))]);

PlayEggGoodLetter


// Temporary
player.PlaySound(EggGoodLetterSounds[Rand(ArrayCount(EggGoodLetterSounds))]);

ProcessEasterEgg -> bool


local Int eggIndex;
local bool bPartialPhrase;
local bool bEggFound;


bPartialPhrase = False;

// Loop through all the eggs and see if we have a matching phrase
for(eggIndex=0; eggIndex {
if (easterstrings[eggIndex] == easterSearch)
{
EggFound(eggIndex);
bEggFound = True;
bPartialPhrase = False;
break;
}

// Do a partial search
if (InStr(easterStrings[eggIndex], easterSearch) != -1)
{
bPartialPhrase = True;
}
}

// If this was a partial match, play a sound
if (bPartialPhrase)
PlayEggGoodLetter();

return (bPartialPhrase || bEggFound);

ProcessFinished


PrintLn();
PrintPicture(TeamPhotoTextures, 3, 1, 600, 236);
Super.ProcessFinished();

ProcessText


PrintPicture(CreditsBannerTextures, 2, 1, 505, 75);
PrintLn();
Super.ProcessText();

Tick (float deltaTime)


Super.Tick(deltaTime);

if (!bScrolling)
{
creditsEndSoundLength -= deltaTime;

if (creditsEndSoundLength < 0.0)
{
bTickEnabled = False;
InvokeQuotesWindow();
}
}

if (bShowEasterPhrases)
{
easterEggTimer -= deltaTime;

phraseCount = Rand(maxRandomPhrases);
// Create a random number of phrases
for(phraseIndex=0; phraseIndex CreateEasterPhrase();

if (easterEggTimer < 0.0)
{
bShowEasterPhrases = False;
easterEggTimer = Default.easterEggTimer;
}
}




Crosshair.uc (extends Window)

InitWindow


local Color col;


Super.InitWindow();

SetBackgroundStyle(DSTY_Masked);
SetBackground(Texture'CrossSquare');
col.R = 255;
col.G = 255;
col.B = 255;
SetCrosshairColor(col);

SetCrosshair (bool bShow)


Show(bShow);

SetCrosshairColor (color newColor)


SetTileColor(newColor);




Cushion.uc (extends Furniture)

FragType=Class'DeusEx.PaperFragment'
bCanBeBase=True
ItemName="Floor Cushion"
Mesh=LodMesh'DeusExDeco.Cushion'
CollisionRadius=27.000000
CollisionHeight=3.190000
Mass=20.000000
Buoyancy=25.000000



DXLogo.uc (extends OutdoorThings)

bStatic=False
Physics=PHYS_Rotating
Texture=Texture'DeusExDeco.Skins.DXLogoTex1'
Mesh=Mesh'DeusExDeco.DXLogo'
DrawScale=2.250000
CollisionRadius=123.639999
CollisionHeight=125.699997
bCollideActors=False
bCollideWorld=False
bBlockActors=False
bBlockPlayers=False
bFixedRotationDir=True
Mass=5000.000000
Buoyancy=500.000000
RotationRate=(Yaw=8192)



DXText.uc (extends OutdoorThings)

Mesh=Mesh'DeusExDeco.DXText'
bUnlit=True
CollisionRadius=100.000000
CollisionHeight=20.000000
bCollideActors=False
bCollideWorld=False
bBlockActors=False
bBlockPlayers=False
Mass=5000.000000
Buoyancy=500.000000



DamageHUDDisplay.uc (extends Window)

var name damageType[3];
var Texture icon;
var bool bActive;
var float initTime;
var float hitDir;
var bool bHitCenter;
var Color color;
var DeusExPlayer player;
var int iconWidth, iconHeight, iconMargin;
var int arrowiconWidth, arrowiconHeight;
var float fadeTime;
var float absorptionPercent;
var sIconInfo iconInfo[7];
var localized String msgAbsorbed;
IconWidth=24
IconHeight=24
iconMargin=2
arrowiconWidth=64
arrowiconHeight=64
fadeTime=2.000000
msgAbsorbed="%d%% Absorb"

AddIcon (name damageType, vector hitOffset)


local int i, j;


if (damageType != '')
{
// save the icon info and startup time
for (i=0; i {
for (j=0; j {
if (damageType == iconInfo[i].damageType[j])
{
iconInfo[i].bActive = True;
iconInfo[i].initTime = player.Level.TimeSeconds;
iconInfo[i].hitDir = Rotator(hitOffset).Yaw;

// check for special case non-locational damage
if (hitOffset == vect(0,0,0))
iconInfo[i].bHitCenter = True;

// range it from 0 to 65535
if (iconInfo[i].hitDir < 0)
iconInfo[i].hitDir += 65536;

Show();
break;
}
}
}
}

ChildRequestedReconfiguration (window child) -> bool


return False;

DrawWindow (GC gc)


local int i;
local float timestamp, alpha, maxalpha;
local bool bVisible;
local bool bCenter, bFront, bRear, bLeft, bRight;
local color col;
local string strInfo;
local float strW, strH, strX, strY;


bVisible = False;
timestamp = player.Level.TimeSeconds;

gc.SetStyle(DSTY_Translucent);
maxalpha = 0;

// go through all the icons and draw them
for (i=0; i {
if (iconInfo[i].bActive)
{
alpha = 1.0 - ((timestamp - iconInfo[i].initTime) / fadeTime);

if (alpha > maxalpha)
maxalpha = alpha;

// if it's faded completely out, delete it
if (alpha <= 0)
{
iconInfo[i].bActive = False;
iconInfo[i].initTime = 0;
iconInfo[i].hitDir = 0;
iconInfo[i].bHitCenter = False;
}
else
{
// fade the color to black
col = iconInfo[i].color;
col.R = int(float(col.R) * alpha);
col.G = int(float(col.G) * alpha);
col.B = int(float(col.B) * alpha);
gc.SetTileColor(col);

// draw the icon
if (iconInfo[i].icon != None)
gc.DrawTexture((width-iconWidth)/2, i*(iconHeight+iconMargin), iconWidth, iconHeight, 0, 0, iconInfo[i].icon);
bVisible = True;

// figure out what side we're hit on
if (iconInfo[i].bHitCenter)
bCenter = True;
else
{
if ((iconInfo[i].hitDir > 53248) || (iconInfo[i].hitDir < 12288))
bFront = True;
if ((iconInfo[i].hitDir > 20480) && (iconInfo[i].hitDir < 45056))
bRear = True;
if ((iconInfo[i].hitDir > 4096) && (iconInfo[i].hitDir < 28672))
bRight = True;
if ((iconInfo[i].hitDir > 36864) && (iconInfo[i].hitDir < 61440))
bLeft = True;
}
}
}
}

// draw the location arrows
col = iconInfo[ArrayCount(iconInfo)-1].color;
col.R = int(float(col.R) * maxalpha);
col.G = int(float(col.G) * maxalpha);
col.B = int(float(col.B) * maxalpha);
gc.SetTileColor(col);

if (bFront)
gc.DrawTexture(iconMargin, ArrayCount(iconInfo)*(iconHeight+iconMargin), arrowiconWidth, arrowiconHeight, 0, 0, Texture'DamageIconUp');
if (bRear)
gc.DrawTexture(iconMargin, ArrayCount(iconInfo)*(iconHeight+iconMargin), arrowiconWidth, arrowiconHeight, 0, 0, Texture'DamageIconDown');
if (bLeft)
gc.DrawTexture(iconMargin, ArrayCount(iconInfo)*(iconHeight+iconMargin), arrowiconWidth, arrowiconHeight, 0, 0, Texture'DamageIconLeft');
if (bRight)
gc.DrawTexture(iconMargin, ArrayCount(iconInfo)*(iconHeight+iconMargin), arrowiconWidth, arrowiconHeight, 0, 0, Texture'DamageIconRight');
if (bCenter)
gc.DrawTexture(iconMargin, ArrayCount(iconInfo)*(iconHeight+iconMargin), arrowiconWidth, arrowiconHeight, 0, 0, Texture'DamageIconCenter');

// draw the damage absorption percent
if (absorptionPercent != 0.0)
{
col.R = 0;
col.G = int(255.0 * maxalpha);
col.B = 0;
gc.EnableTranslucentText(True);
gc.SetTextColor(col);
gc.SetFont(Font'TechSmall');
strInfo = Sprintf(msgAbsorbed, Int(absorptionPercent * 100.0));
gc.GetTextExtent(0, strW, strH, strInfo);
strX = (width - strW) / 2;
strY = height - (arrowIconHeight + strH) / 2;
gc.DrawText(strX, strY, strW, strH, strInfo);
}

if (!bVisible)
{
bFront = False;
bRear = False;
bLeft = False;
bRight = False;
absorptionPercent = 0.0;
}

InitWindow


Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

// couldn't get these to work in the defaultproperties section
iconInfo[0].damageType[0] = 'Shocked';
iconInfo[0].icon = Texture'DamageIconElectricity';
iconInfo[0].color.R = 0;
iconInfo[0].color.G = 196;
iconInfo[0].color.B = 255;
iconInfo[1].damageType[0] = 'EMP';
iconInfo[1].icon = Texture'DamageIconEMP';
iconInfo[1].color.R = 0;
iconInfo[1].color.G = 196;
iconInfo[1].color.B = 255;
iconInfo[2].damageType[0] = 'Burned';
iconInfo[2].damageType[1] = 'Flamed';
iconInfo[2].damageType[2] = 'Exploded';
iconInfo[2].icon = Texture'DamageIconFire';
iconInfo[2].color.R = 255;
iconInfo[2].color.G = 96;
iconInfo[2].color.B = 0;
iconInfo[3].damageType[0] = 'PoisonGas';
iconInfo[3].damageType[1] = 'TearGas';
iconInfo[3].icon = Texture'DamageIconGas';
iconInfo[3].color.R = 0;
iconInfo[3].color.G = 196;
iconInfo[3].color.B = 0;
iconInfo[4].damageType[0] = 'Drowned';
iconInfo[4].damageType[1] = 'HalonGas';
iconInfo[4].icon = Texture'DamageIconOxygen';
iconInfo[4].color.R = 0;
iconInfo[4].color.G = 128;
iconInfo[4].color.B = 255;
iconInfo[5].damageType[0] = 'Radiation';
iconInfo[5].icon = Texture'DamageIconRadiation';
iconInfo[5].color.R = 255;
iconInfo[5].color.G = 255;
iconInfo[5].color.B = 0;
iconInfo[6].damageType[0] = 'Shot';
iconInfo[6].damageType[1] = 'Sabot';
iconInfo[6].icon = None;
iconInfo[6].color.R = 255;
iconInfo[6].color.G = 0;
iconInfo[6].color.B = 0;

Hide();

SetPercent (float percent)


absorptionPercent = percent;

SetVisibility (bool bNewVisibility)


Show(bNewVisibility);




DamageTrigger.uc (extends Trigger)

var() float damageAmount;
var() bool bConstantDamage;
var() float damageInterval;
var() name damageType;
var Actor damagee;
var bool bIsOn;
DamageAmount=5.000000
bConstantDamage=True
damageInterval=0.500000
DamageType=Burned
bIsOn=True

Timer


if (!bIsOn)
{
SetTimer(0.1, False);
return;
}

if (damagee != None)
damagee.TakeDamage(damageAmount, None, Location, vect(0,0,0), damageType);

Touch (Actor Other)


if (!bIsOn)
return;

// should we even pay attention to this actor?
if (!IsRelevant(Other))
return;

damagee = Other;
SetTimer(damageInterval, bConstantDamage);

Super.Touch(Other);

Trigger (Actor Other, Pawn Instigator)


if (!bIsOn)
bIsOn = True;

Super.Trigger(Other, Instigator);

UnTouch (Actor Other)


if (!bIsOn)
return;

damagee = None;
SetTimer(0.1, False);

UnTrigger (Actor Other, Pawn Instigator)


if (bIsOn)
bIsOn = False;

Super.UnTrigger(Other, Instigator);




Dart.uc (extends DeusExProjectile)

var float mpDamage;
mpDamage=20.000000
bBlood=True
bStickToWall=True
DamageType=shot
spawnAmmoClass=Class'DeusEx.AmmoDart'
bIgnoresNanoDefense=True
ItemName="Dart"
ItemArticle="a"
speed=2000.000000
MaxSpeed=3000.000000
Damage=15.000000
MomentumTransfer=1000
ImpactSound=Sound'DeusExSounds.Generic.BulletHitFlesh'
Mesh=LodMesh'DeusExItems.Dart'
CollisionRadius=3.000000
CollisionHeight=0.500000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
Damage = mpDamage;




DartFlare.uc (extends Dart)

var float mpDamage;
mpDamage=10.000000
DamageType=Burned
spawnAmmoClass=Class'DeusEx.AmmoDartFlare'
ItemName="Flare Dart"
Damage=5.000000
bUnlit=True
LightType=LT_Steady
LightEffect=LE_NonIncidence
LightBrightness=255
LightHue=16
LightSaturation=192
LightRadius=4

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
Damage = mpDamage;




DartPoison.uc (extends Dart)

var float mpDamage;
mpDamage=10.000000
DamageType=Poison
spawnAmmoClass=Class'DeusEx.AmmoDartPoison'
ItemName="Tranquilizer Dart"
Damage=5.000000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
Damage = mpDamage;




DataCube.uc (extends InformationDevices)

bAddToVault=True
bInvincible=True
bCanBeBase=True
ItemName="DataCube"
Texture=Texture'DeusExItems.Skins.DataCubeTex2'
Mesh=LodMesh'DeusExItems.DataCube'
CollisionRadius=7.000000
CollisionHeight=1.270000
Mass=2.000000
Buoyancy=3.000000



DataLinkPlay.uc (extends ConPlayBase)

var String BindName;
var String DisplayName;
var HUDInfoLinkDisplay datalink; // Window that displays the datalink
var Sound startSound;
var Float eventTimer;
var Bool bStartTransmission;
var Bool bEndTransmission;
var Float blinkRate;
var Float startDelay;
var Float endDelay;
var Float perCharDelay;
var Bool bSilent;
var S_InfoLinkNames infoLinkNames[17];
var Conversation dataLinkQueue[8];
var DatalinkTrigger datalinkTrigger;
var localized String EndTransmission;
startSound=Sound'DeusExSounds.UserInterface.DataLinkStart'
blinkRate=0.500000
startDelay=1.500000
endDelay=1.000000
perCharDelay=0.030000
infoLinkNames(0)=(BindName="AlexJacobson",displayName="Alex Jacobson")
infoLinkNames(1)=(BindName="AnnaNavarre",displayName="Anna Navarre")
infoLinkNames(2)=(BindName="BobPage",displayName="Bob Page")
infoLinkNames(3)=(BindName="BobPageAug",displayName="Bob Page")
infoLinkNames(4)=(BindName="Daedalus",displayName="Daedalus")
infoLinkNames(5)=(BindName="GarySavage",displayName="Gary Savage")
infoLinkNames(6)=(BindName="GuntherHermann",displayName="Gunther Hermann")
infoLinkNames(7)=(BindName="Helios",displayName="Helios")
infoLinkNames(8)=(BindName="Icarus",displayName="Icarus")
infoLinkNames(9)=(BindName="JaimeReyes",displayName="Jaime Reyes")
infoLinkNames(10)=(BindName="Jock",displayName="Jock")
infoLinkNames(11)=(BindName="MorganEverett",displayName="Morgan Everett")
infoLinkNames(12)=(BindName="PaulDenton",displayName="Paul Denton")
infoLinkNames(13)=(BindName="SamCarter",displayName="Sam Carter")
infoLinkNames(14)=(BindName="StantonDowd",displayName="Stanton Dowd")
infoLinkNames(15)=(BindName="TracerTong",displayName="Tracer Tong")
infoLinkNames(16)=(BindName="WaltonSimons",displayName="Walton Simons")
EndTransmission="END TRANSMISSION..."
bHidden=True

AbortAndSaveHistory


bSilent = True;

// Make sure no sound playing
player.StopSound(playingSoundId);

if ((!bEndTransmission) && (bStartTransmission))
{
bStartTransmission = False;
GotoState('PlayEvent');
SetTimer(0.0, False);
}
else
{
PlayNextEvent();
}


// Make sure there's no audio playing
player.StopSound(playingSoundId);

GotoState('');

SetTimer(0.0, False);

if (dataLink != None)
{
rootWindow.hud.DestroyInfoLinkWindow();
dataLink = None;

// Put the currently playing DataLink at the front of the queue,
// but *only* if the bEndTransmission flag isn't set (which means
// we're just waiting for the "END TRANSMISSION" pause at the end
// of a DataLink).

if (!bEndTransmission)
InsertDataLink(con);
}

con = None;
currentEvent = None;
lastEvent = None;


local Bool bResult;


bResult = False;

con = PopDataLink();
startCon = con;

if ( con != None )
{
StartConversation(player, invokeActor);
bResult = True;
}

return bResult;

GetDisplayName (String bindName) -> String


local int nameIndex;
local string displayName;


displayName = "";

for(nameIndex=0; nameIndex {
if (infoLinkNames[nameIndex].BindName == bindName)
{
displayName = infoLinkNames[nameIndex].DisplayName;
break;
}
}
return displayName;


local Int queueIndex;


// Bump all the existing DataLinks up one. If we already have a
// full stack we'll lose the last one (but this should never happen)

for( queueIndex=7; queueIndex>0; queueIndex-- )
dataLinkQueue[queueIndex] = dataLinkQueue[queueIndex-1];

// Now insert the conversation at the beginning
dataLinkQueue[0] = insertCon;

JumpToConversation (Conversation jumpCon, String startLabel)


assert( jumpCon != None );

// Conversation to switch to
con = jumpCon;

// Get the event to start at, or the beginning if one wasn't
// passed in.

currentEvent = con.GetEventFromLabel( startLabel );
if ( currentEvent == None )
currentEvent = con.eventList;

// Start the conversation!
GotoState('PlayEvent');

NotifyDatalinkTrigger


if (datalinkTrigger != None)
datalinkTrigger.DatalinkFinished();

PlayNextEvent


// Stop any sound that was playing
StopSpeech();

ProcessAction( EA_NextEvent, "" );

PlaySpeech (int soundID)


local Sound speech;


speech = con.GetSpeechAudio(soundID);

if (speech != None)
playingSoundID = player.PlaySound(speech, SLOT_Talk);


local Conversation conResult;
local Int queueIndex;


conResult = None;

if ( dataLinkQueue[0] != None )
{
// Save a pointer to the first entry and move the
// others down.
conResult = dataLinkQueue[0];

for( queueIndex=0; queueIndex<7; queueIndex++ )
dataLinkQueue[queueIndex] = dataLinkQueue[queueIndex+1];

dataLinkQueue[7] = None;
}

return conResult;

ProcessAction (EEventAction nextAction, string nextLabel)


lastEvent = currentEvent;

switch( nextAction )
{
case EA_NextEvent:
// Proceed to the next event.
currentEvent = currentEvent.nextEvent;
GotoState('PlayEvent');
break;

case EA_JumpToLabel:
// Use the label passed back and jump to it
if (con != None)
{
currentEvent = con.GetEventFromLabel( nextLabel );
GotoState('PlayEvent');
}
else
{
currentEvent = None;
TerminateConversation();
}
break;

case EA_JumpToConversation:
if (ConEventJump(currentEvent).jumpCon != None)
{
JumpToConversation( ConEventJump(currentEvent).jumpCon, nextLabel );
}
else
{
currentEvent = None;
TerminateConversation();
}
break;

case EA_WaitForSpeech:
if (!bSilent)
{
// Wait for a piece of audio to finish playing
GotoState('WaitForSpeech');
}
else
{
PlayNextEvent();
}
break;

case EA_End:
// End the Transmission
currentEvent = None;
TerminateConversation();
break;
}


local Int queueIndex;
local Bool bPushed;


bPushed = False;

// If this is the currently playing datalink, don't requeue it
//
// We're using the startCon variable, as we want to check the
// conversation that was -started initially-, as opposed to a
// conversation that was -jumped into-.

if ( queueCon == startCon )
return bPushed;

// Now push this conversation on the stack
for( queueIndex=0; queueIndex<8; queueIndex++ )
{
// If this conversation is already in the queue,
// don't queue it again
if ( dataLinkQueue[queueIndex] == queueCon )
break;

if ( dataLinkQueue[queueIndex] == None )
{
dataLinkQueue[queueIndex] = queueCon;
bPushed = True;
break;
}
}

return bPushed;


SetConversation(PopDataLink());

if ( con != None )
{
StartConversation(player, invokeActor);
}
else
{
if (dataLink != None)
{
rootWindow.hud.DestroyInfoLinkWindow();
dataLink = None;
}
player.dataLinkPlay = None;
Destroy();
}

SetConversation (Conversation newCon) -> bool


local bool bConSet;


// If this is the first conversation, then
// set the 'con' variable.

bConSet = False;

if ((con == None) && (dataLink == None))
{
startCon = newCon;
con = newCon;
bConSet = True;
}
else
{
if (PushDataLink(newCon) && (dataLink != None))
{
dataLink.MessageQueued(True);
bConSet = True;
}
}

return bConSet;

SetTrigger (DataLinkTrigger newDatalinkTrigger)


datalinkTrigger = newDatalinkTrigger;

SetupEvent


local EEventAction nextAction;
local String nextLabel;


switch( currentEvent.EventType )
{
// Unsupported events
case ET_MoveCamera:
case ET_Choice:
case ET_Animation:
case ET_Trade:
break;

case ET_Speech:
nextAction = SetupEventSpeech( ConEventSpeech(currentEvent), nextLabel );
break;

case ET_SetFlag:
nextAction = SetupEventSetFlag( ConEventSetFlag(currentEvent), nextLabel );
break;

case ET_CheckFlag:
nextAction = SetupEventCheckFlag( ConEventCheckFlag(currentEvent), nextLabel );
break;

case ET_CheckObject:
nextAction = SetupEventCheckObject( ConEventCheckObject(currentEvent), nextLabel );
break;

case ET_Jump:
nextAction = SetupEventJump( ConEventJump(currentEvent), nextLabel );
break;

case ET_Random:
nextAction = SetupEventRandomLabel( ConEventRandomLabel(currentEvent), nextLabel );
break;

case ET_Trigger:
nextAction = SetupEventTrigger( ConEventTrigger(currentEvent), nextLabel );
break;

case ET_AddGoal:
nextAction = SetupEventAddGoal( ConEventAddGoal(currentEvent), nextLabel );
break;

case ET_AddNote:
nextAction = SetupEventAddNote( ConEventAddNote(currentEvent), nextLabel );
break;

case ET_AddSkillPoints:
nextAction = SetupEventAddSkillPoints( ConEventAddSkillPoints(currentEvent), nextLabel );
break;

case ET_AddCredits:
nextAction = SetupEventAddCredits( ConEventAddCredits(currentEvent), nextLabel );
break;

case ET_CheckPersona:
nextAction = SetupEventCheckPersona( ConEventCheckPersona(currentEvent), nextLabel );
break;

case ET_TransferObject:
nextAction = SetupEventTransferObject( ConEventTransferObject(currentEvent), nextLabel );
break;

case ET_End:
nextAction = SetupEventEnd( ConEventEnd(currentEvent), nextLabel );
break;
}

// Based on the result of the setup, we either need to jump to another event
// or wait for some input from the user.

ProcessAction( nextAction, nextLabel );

SetupEventSpeech (ConEventSpeech event, out String nextLabel) -> EEventAction


local EEventAction nextAction;
local ConEvent checkEvent;
local String speech;


// Keep track of the last speaker
lastActor = event.speaker;

// Display the first speech chunk.
speech = event.conSpeech.speech;

if (!bSilent)
{
// If we're continuing from the last speech, then we want to Append
// and not Display the first chunk.
if ( event.bContinued == True )
{
datalink.AppendText(speech);
}
else
{
// Clear the window, set the name of the currently speaking
// actor and then start displaying the speech.

datalink.ClearScreen();
datalink.SetSpeaker(event.speakerName, GetDisplayName(event.speakerName));
datalink.ShowPortrait();
datalink.DisplayText(speech);

lastSpeechTextLength = len(speech);
}
}

// Save this event in the history
AddHistoryEvent(GetDisplayName(event.speakerName), event.conSpeech );

nextAction = EA_WaitForSpeech;
nextLabel = "";
return nextAction;

StartConversation (DeusExPlayer newPlayer, optional Actor newInvokeActor, optional bool bForcePlay) -> Bool


local Actor tempActor;


if ( Super.StartConversation(newPlayer, newInvokeActor, bForcePlay) == False )
return False;

// Create the DataLink display if necessary. If it already exists,
// then we're presently in a DataLink and need to queue this one up
// for play after the current DataLink is finished.
//
// Don't play the DataLink if
//
// 1. A First-person conversation is currently playing
// 2. Player is rooting around inside a computer
//
// In these cases we'll just queue it up instead

if ( ( dataLink == None ) &&
((player.conPlay == None) && (NetworkTerminal(rootWindow.GetTopWindow()) == None)))
{
lastSpeechTextLength = 0;
bEndTransmission = False;
eventTimer = 0;

datalink = rootWindow.hud.CreateInfoLinkWindow();

if ( dataLinkQueue[0] != None )
dataLink.MessageQueued(True);
}
else
{
return True;
}

// Grab the first event!
currentEvent = con.eventList;

// Create the history object. Passing in True means
// this is an InfoLink conversation.
SetupHistory(GetDisplayName(con.GetFirstSpeakerDisplayName()), True);

// Play a sound and wait a few seconds before starting
datalink.ShowTextCursor(False);
player.PlaySound(startSound, SLOT_None);
bStartTransmission = True;
SetTimer(blinkRate, True);
return True;

TerminateConversation (optional bool bContinueSpeech, optional bool bNoPlayedFlag)


// Make sure sound is no longer playing
player.StopSound(playingSoundId);

// Save the DataLink history
if ((history != None) && (player != None))
{
history.next = player.conHistory;
player.conHistory = history;
history = None; // in case we get called more than once!!
}

SetTimer(blinkRate, True);

if ((dataLink != None) && (datalink.winName != None))
datalink.winName.SetText(EndTransmission);

bEndTransmission = True;

// Notify the trigger that we've finished
NotifyDatalinkTrigger();

Super.TerminateConversation(bContinueSpeech, bNoPlayedFlag);

Timer


GotoState( 'WaitForSpeech', 'SpeechFinished' );




DataLinkTrigger.uc (extends Trigger)

var() name datalinkTag;
var() name checkFlag;
var() bool bCheckFalse;
var bool bStartedViaTrigger;
var bool bStartedViaTouch;
var bool bCheckFlagTimer;
var float checkFlagTimer;
var DeusExPlayer player;
var Actor triggerOther;
var Pawn triggerInstigator;
checkFlagTimer=1.000000
bTriggerOnceOnly=True
CollisionRadius=96.000000

DatalinkFinished


if (bStartedViaTrigger)
Super.Trigger(triggerOther, triggerInstigator);
else if (bStartedViaTouch)
Super.Touch(triggerOther);

EvaluateFlag -> bool


local bool bSuccess;


if (checkFlag != '')
{
if ((player != None) && (player.flagBase != None))
{
if (!player.flagBase.GetBool(checkFlag))
bSuccess = bCheckFalse;
else
bSuccess = !bCheckFalse;

// If the flag check fails, then make sure the Tick() event
// is active so we can continue to check the flag while
// the player is inside the radius of the trigger.

if (!bSuccess)
{
bCheckFlagTimer = True;
SetTimer(checkFlagTimer, False);
}
}
else
{
bSuccess = False;
}
}
else
{
bSuccess = True;
}

return bSuccess;

Timer


if ((bCheckFlagTimer) && (EvaluateFlag()) && (player != None))
player.StartDataLinkTransmission(String(datalinkTag), Self);

Touch (Actor Other)


// Only set the player if the player isn't already set and
// the "bCheckFlagTimer" variable is false
if ((player == None) || ((player != None) && (bCheckFlagTimer == False)))
player = DeusExPlayer(Other);

// only works for DeusExPlayers
if (player == None)
return;

if (EvaluateFlag())
{
if (player.StartDataLinkTransmission(String(datalinkTag), Self) == True)
{
bStartedViaTouch = True;
triggerOther = Other;
}
}
else if (checkFlag != '')
{
bStartedViaTouch = True;
triggerOther = Other;
}

Trigger (Actor Other, Pawn Instigator)


// Only set the player if the player isn't already set and
// the "bCheckFlagTimer" variable is false
if ((player == None) || ((player != None) && (bCheckFlagTimer == False)))
player = DeusExPlayer(Instigator);

// only works for DeusExPlayers
if (player == None)
return;

if (EvaluateFlag())
{
if (player.StartDataLinkTransmission(String(datalinkTag), Self) == True)
{
bStartedViaTrigger = True;
triggerOther = Other;
triggerInstigator = Instigator;
}
}
else if (checkFlag != '')
{
bStartedViaTrigger = True;
triggerOther = Other;
triggerInstigator = Instigator;
}

UnTouch (actor Other)


bCheckFlagTimer = False;
Super.UnTouch(Other);




DataVaultImage.uc (extends Inventory)

var Texture imageTextures[4];
var Int sizeX;
var Int sizeY;
var localized String imageDescription;
var localized String floorDescription;
var Int sortKey;
var travel DataVaultImageNote firstNote;
var travel DataVaultImage prevImage;
var travel DataVaultImage nextImage;
var travel Bool bPlayerViewedImage;
var Color colNoteTextNormal;
var Color colNoteTextFocus;
var Color colNoteBackground;
SizeX=400
SizeY=400
colNoteTextNormal=(R=200,G=200)
colNoteTextFocus=(R=255,G=255)
bDisplayableInv=False
bRotatingPickup=False
PickupMessage="Image added to DataVault"
PlayerViewMesh=LodMesh'DeusExItems.TestBox'
PickupViewMesh=LodMesh'DeusExItems.TestBox'
ThirdPersonMesh=LodMesh'DeusExItems.TestBox'
Icon=Texture'DeusExUI.Icons.BeltIconDataImage'
beltDescription="IMAGE"
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=15.000000
CollisionHeight=1.420000
bCollideActors=False
Mass=10.000000
Buoyancy=11.000000

AddNote (DataVaultImageNote newNote)


// Insert this note at the beginning

newNote.nextNote = firstNote;
firstNote = newNote;

DeleteNote (DataVaultImageNote deleteNote)


local DataVaultImageNote note;
local DataVaultImageNote prevNote;


note = firstNote;

while( note != None )
{
if ( note == deleteNote )
{
// Update the links and then delete the offending note
if (firstNote == deleteNote)
firstNote = deleteNote.nextNote;

if ( prevNote != None )
prevNote.nextNote = note.nextNote;

CriticalDelete(deleteNote);
deleteNote = None;
break;
}
prevNote = note;
note = note.nextNote;
}

Frob (Actor Other, Inventory frobWith)


if ( DeusExPlayer(Other) != None )
{
bHidden = True;
DeusExPlayer(Other).AddImage(Self);
}
Super.Frob(Other, frobWith);

SpawnCopy (Pawn Other) -> inventory


local Inventory Copy;


Copy = Super.SpawnCopy(Other);

return Copy;

UnloadTextures (DeusExPlayer player)


local int texIndex;


for(texIndex=0; texIndex player.UnloadTexture(imageTextures[texIndex]);




DataVaultImageNote.uc (extends Object)

var travel String noteText;
var travel INT posX;
var travel INT posY;
var travel Bool bExpanded;
var travel DataVaultImageNote nextNote;



DeathMatchGame.uc (extends DeusExMPGame)

var localized String VictoryConString1, VictoryConString2, TimeLimitString1, TimeLimitString2;
VictoryConString1="Objective: First player that reaches "
VictoryConString2=" kills wins the match."
TimeLimitString1="Objective: Score the most kills before the clock ( "
TimeLimitString2=" ) runs out!"
bAutoInstall=False

CheckVictoryConditions (Pawn Killer, Pawn Killee, String Method) -> bool


local Pawn winner;


if ( VictoryCondition ~= "Frags" )
{
GetWinningPlayer( winner );

if ( winner != None )
{
if (( winner.PlayerReplicationInfo.Score == ScoreToWin-(ScoreToWin/5)) && ( ScoreToWin >= 10 ))
NotifyGameStatus( ScoreToWin/5, winner.PlayerReplicationInfo.PlayerName, False, False );
else if (( winner.PlayerReplicationInfo.Score == (ScoreToWin - 1) ) && (ScoreTowin >= 2 ))
NotifyGameStatus( 1, winner.PlayerReplicationInfo.PlayerName, False, True );

if ( winner.PlayerReplicationInfo.Score >= ScoreToWin )
{
PlayerHasWon( winner, Killer, Killee, Method );
return True;
}
}
}
else if ( VictoryCondition ~= "Time" )
{
timeLimit = float(ScoreToWin)*60.0;

if (( Level.Timeseconds >= timeLimit-NotifyMinutes*60.0 ) && ( timeLimit > NotifyMinutes*60.0*2.0 ))
{
GetWinningPlayer( winner );
NotifyGameStatus( int(NotifyMinutes), winner.PlayerReplicationInfo.PlayerName, True, True );
}

if ( Level.Timeseconds >= timeLimit )
{
GetWinningPlayer( winner );
PlayerHasWon( winner, Killer, Killee, Method );
return true;
}
}
return false;

EvaluatePlayerStart (Pawn Player, PlayerStart PointToEvaluate, optional byte InTeam) -> float


local bool bTooClose;
local DeusExPlayer OtherPlayer;
local float Dist;
local Pawn CurPawn;
local float CumulativeDist;


bTooClose = False;

if (PointToEvaluate.bTeamOnlyStart)
return -100000;

//DEUS_EX AMSD Small random factor.
CumulativeDist = FRand();

for (CurPawn = Level.PawnList; CurPawn != None; CurPawn = CurPawn.NextPawn)
{
OtherPlayer = DeusExPlayer(CurPawn);
if ((OtherPlayer != None) && (OtherPlayer != Player))
{
//Get Dist
Dist = VSize(OtherPlayer.Location - PointToEvaluate.Location);

//Do a quick distance check
if (Dist < 100.0)
{
bTooClose = TRUE;
}

//Make it non zero
Dist = Dist + 0.1;
Dist = 10000/Dist;

//Now someone close to you has a really high Dist, and someone far away has a really low dist.
//This should bias away from putting you right next to someone.

//Add in distances of opponents.
CumulativeDist = CumulativeDist - Dist;
}
}

if (bTooClose)
return -100000;
else
return CumulativeDist;

GameOver


Super.GameOver();

GetWinningPlayer (out Pawn curWinner)


local Pawn winner, curPawn, tiePawn;


curPawn = Level.PawnList;
winner = curPawn;
tiePawn = None;

while ( curPawn != None )
{
if ( curPawn.IsA( 'DeusExPlayer' ) )
{
if ( curPawn.PlayerReplicationInfo.Score > winner.PlayerReplicationInfo.Score )
winner = curPawn;
else if (( curPawn.PlayerReplicationInfo.Score == winner.PlayerReplicationInfo.Score ) &&
( curPawn.PlayerReplicationInfo.Deaths < winner.PlayerReplicationInfo.Deaths ) )
winner = curPawn;
else if ( ( curPawn.PlayerReplicationInfo.Score == winner.PlayerReplicationInfo.Score ) &&
( curPawn.PlayerReplicationInfo.Deaths == winner.PlayerReplicationInfo.Deaths ) &&
( curPawn.PlayerReplicationInfo.Streak > winner.PlayerReplicationInfo.Streak) )
winner = curPawn;
else if ( (curPawn != winner) && ( curPawn.PlayerReplicationInfo.Score == winner.PlayerReplicationInfo.Score ) &&
( curPawn.PlayerReplicationInfo.Deaths == winner.PlayerReplicationInfo.Deaths ) &&
( curPawn.PlayerReplicationInfo.Streak == winner.PlayerReplicationInfo.Streak) )
tiePawn = curPawn;

}
curPawn = curPawn.nextPawn;
}
if ( tiePawn != None )
{
if ( ( tiePawn.PlayerReplicationInfo.Score == winner.PlayerReplicationInfo.Score ) &&
( tiePawn.PlayerReplicationInfo.Deaths == winner.PlayerReplicationInfo.Deaths ) &&
( tiePawn.PlayerReplicationInfo.Streak == winner.PlayerReplicationInfo.Streak) )
curWinner = None;
else
curWinner = winner;
}
else
curWinner = winner;

PlayerHasWon (Pawn winPawn, Pawn Killer, Pawn Killee, String Method)


local Pawn curPawn;
local String killerStr, killeeStr;
local int tieFlag;


PreGameOver();

killerStr = ""; killeeStr = "";
if (( Killer != None ) && ( Killee != None ))
{
killerStr = Killer.PlayerReplicationInfo.PlayerName;
killeeStr = Killee.PlayerReplicationInfo.PlayerName;
}

if ( winPawn == None )
tieFlag = TEAM_DRAW;
else
tieFlag = 0;

// Notify all palyers that so-and-so won the match
curPawn = Level.PawnList;
while ( curPawn != None )
{
if ( curPawn.IsA( 'DeusExPlayer' ) )
{
DeusExPlayer(curPawn).ShowMultiplayerWin( winPawn.PlayerReplicationInfo.PlayerName, tieFlag, killerStr, killeeStr, Method );
}
curPawn = curPawn.nextPawn;
}

GameOver();

PreGameOver


Super.PreGameOver();

ShowDMScoreboard (DeusExPlayer thisPlayer, GC gc, float screenWidth, float screenHeight)


local float yoffset, ystart, xlen, ylen;
local String str;
local bool bLocalPlayer;
local int i;


if ( !thisPlayer.PlayerIsClient() )
return;

gc.SetFont(Font'FontMenuSmall');

RefreshScoreArray( thisPlayer );

SortScores();

str = "TEST";
gc.GetTextExtent( 0, xlen, ylen, str );

ystart = screenHeight * PlayerY;
yoffset = ystart;

gc.SetTextColor( WhiteColor );
ShowVictoryConditions( gc, screenWidth, ystart, thisPlayer );
yoffset += (ylen * 2.0);
DrawHeaders( gc, screenWidth, yoffset );
yoffset += (ylen * 1.5);

for ( i = 0; i < scorePlayers; i++ )
{
bLocalPlayer = (scoreArray[i].PlayerID == thisPlayer.PlayerReplicationInfo.PlayerID);

if ( bLocalPlayer )
gc.SetTextColor( GoldColor );
else
gc.SetTextColor( WhiteColor );

yoffset += ylen;
DrawNameAndScore( gc, scoreArray[i], screenWidth, yoffset );
}

ShowVictoryConditions (GC gc, float screenWidth, float yoffset, DeusExPlayer thisPlayer)


local String str, secStr;
local float x, y, w, h;
local int timeLeft, minutesLeft, secondsLeft;
local float ftimeLeft;


if ( VictoryCondition ~= "Frags" )
str = VictoryConString1 $ ScoreToWin $ VictoryConString2;
else if ( VictoryCondition ~= "Time" )
{
timeLeft = ScoreToWin * 60 - Level.Timeseconds - thisPlayer.ServerTimeDiff;
if ( timeLeft < 0 )
timeleft = 0;
minutesLeft = timeLeft/60;
ftimeLeft = float(timeLeft);
secondsLeft = int(ftimeLeft%60);
if ( secondsLeft < 10 )
secStr = "0" $ secondsLeft;
else
secStr = "" $ secondsLeft;

str = TimeLimitString1 $ minutesLeft $ ":" $ secStr $ TimeLimitString2;
}
else
log( "Warning: Unknown victory type:"$VictoryCondition$" " );

gc.GetTextExtent( 0, w, h, str );
x = (screenWidth * 0.5) - (w * 0.5);
gc.DrawText( x, yoffset, w, h, str );




DemoSplashWindow.uc (extends DeusExBaseWindow)

DrawWindow (GC gc)


gc.SetStyle(DSTY_Normal);

gc.DrawIcon( 0, 0, Texture'Demo_Splash_1');
gc.DrawIcon(256, 0, Texture'Demo_Splash_2');
gc.DrawIcon(512, 0, Texture'Demo_Splash_3');
gc.DrawIcon( 0, 256, Texture'Demo_Splash_4');
gc.DrawIcon(256, 256, Texture'Demo_Splash_5');
gc.DrawIcon(512, 256, Texture'Demo_Splash_6');

InitWindow


Super.InitWindow();

SetSize(640, 480);
SetWindowAlignments(HALIGN_Center, VALIGN_Center);

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


player.Level.Game.SendPlayer(player, "dxonly");
return True;




DentonClone.uc (extends DeusExDecoration)

bInvincible=True
bHighlight=False
ItemName="JC Denton Clone"
bPushable=False
bBlockSight=True
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.DentonClone'
CollisionRadius=21.200001
CollisionHeight=45.869999
Mass=150.000000
Buoyancy=145.000000



DeusExAmmo.uc (extends Ammo)

var localized String msgInfoRounds;
var bool bShowInfo;
var int MPMaxAmmo; //Max Ammo in multiplayer.
msgInfoRounds="%d Rounds remaining"
bDisplayableInv=False
PickupMessage="You found"
ItemName="DEFAULT AMMO NAME - REPORT THIS AS A BUG"
ItemArticle=""
LandSound=Sound'DeusExSounds.Generic.PaperHit1'

PlayLandingSound


if (LandSound != None)
{
if (Velocity.Z <= -200)
{
PlaySound(LandSound, SLOT_None, TransientSoundVolume,, 768);
AISendEvent('LoudNoise', EAITYPE_Audio, TransientSoundVolume, 768);
}
}

PostBeginPlay


Super.PostBeginPlay();
if (Level.NetMode != NM_Standalone)
{
if (MPMaxAmmo == 0)
MPMaxAmmo = AmmoAmount * 3;
MaxAmmo = MPMaxAmmo;
}

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.SetTitle(itemName);
winInfo.SetText(Description $ winInfo.CR() $ winInfo.CR());

// number of rounds left
winInfo.AppendText(Sprintf(msgInfoRounds, AmmoAmount));

return True;




DeusExBaseWindow.uc (extends ModalWindow)

var EScreenType ScreenType;
var DeusExRootWindow root;
var DeusExPlayer player;
var Color colRed;
var Color colDarkRed;
var Color colGreen;
var Color colDarkGreen;
var Color colWhite;
var Color colBlack;
var Color colGrey;
var Color colCyan;
var Color colDarkCyan;
var Color colBlue;
var Color colLightBlue;
var Color colDarkBlue;
ScreenType=ST_Other
colRed=(R=255)
colDarkRed=(R=128)
colGreen=(G=255)
colDarkGreen=(G=128)
colWhite=(R=255,G=255,B=255)
colGrey=(R=128,G=128,B=128)
colCyan=(G=200,B=200)
colDarkCyan=(G=100,B=100)
colBlue=(B=255)
colLightBlue=(G=170,B=255)
colDarkBlue=(G=85,B=128)

CanStack -> bool


local bool bCanStack;


switch(ScreenType)
{
case ST_Menu:
bCanStack = TRUE;
break;

case ST_MenuScreen:
bCanStack = TRUE;
break;

case ST_Persona:
bCanStack = FALSE;
break;

case ST_DataVault:
bCanStack = FALSE;
break;

case ST_Conversation:
bCanStack = FALSE;
break;

case ST_Computer:
bCanStack = FALSE;
break;

case ST_HUD:
bCanStack = TRUE;
break;

case ST_Popup:
bCanStack = TRUE;
break;

case ST_Tool:
bCanStack = TRUE;
break;

case ST_Other:
bCanStack = TRUE;
break;
}

return bCanStack;

InitWindow


Super.InitWindow();

// Set default mouse focus mode
SetMouseFocusMode(MFocus_Enter);

// Get a pointer to the root window
root = DeusExRootWindow(GetRootWindow());

// Get a pointer to the player
player = DeusExPlayer(root.parentPawn);

// Center this window
SetWindowAlignments(HALIGN_Center, VALIGN_Center);

RefreshWindow (float DeltaTime)




DeusExCarcass.uc (extends Carcass)

var() class Inventory;
var() int count;
var(Display) mesh Mesh2; // mesh for secondary carcass
var(Display) mesh Mesh3; // mesh for floating carcass
var(Inventory) InventoryItemCarcass InitialInventory[8]; // Initial inventory items held in the carcass
var() bool bHighlight;
var String KillerBindName; // what was the bind name of whoever killed me?
var Name KillerAlliance; // what alliance killed me?
var bool bGenerateFlies; // should we make flies?
var FlyGenerator flyGen;
var Name Alliance; // this body's alliance
var Name CarcassName; // original name of carcass
var int MaxDamage; // maximum amount of cumulative damage
var bool bNotDead; // this body is just unconscious
var() bool bEmitCarcass; // make other NPCs aware of this body
var bool bQueuedDestroy; // For multiplayer, semaphore so you can't doublefrob bodies (since destroy is latent)
var bool bInit;
var bool bSearchMsgPrinted;
var localized string msgSearching;
var localized string msgEmpty;
var localized string msgNotDead;
var localized string msgAnimalCarcass;
var localized string msgCannotPickup;
var localized String msgRecharged;
var localized string itemName; // human readable name
var() bool bInvincible;
var bool bAnimalCarcass;
bHighlight=True
msgSearching="You found:"
msgEmpty="You don't find anything"
msgNotDead="Unconscious"
msgAnimalCarcass="Animal Carcass"
msgCannotPickup="You cannot pickup the %s"
msgRecharged="Recharged %d points"
ItemName="Dead Body"
RemoteRole=ROLE_SimulatedProxy
LifeSpan=0.000000
CollisionRadius=20.000000
CollisionHeight=7.000000
bCollideWorld=False
Mass=150.000000
Buoyancy=170.000000
BindName="DeadBody"
bVisionImportant=True

AddInventory (inventory NewItem) -> bool


local inventory Inv;

// Skip if already in the inventory.

for( Inv=Inventory; Inv!=None; Inv=Inv.Inventory )
if( Inv == NewItem )
return false;

// The item should not have been destroyed if we get here.
assert(NewItem!=None);

// Add to front of inventory chain.
NewItem.SetOwner(Self);
NewItem.Inventory = Inventory;
NewItem.InitialState = 'Idle2';
Inventory = NewItem;

return true;

AddReceivedItem (DeusExPlayer player, Inventory item, int count)


local DeusExWeapon w;
local Inventory altAmmo;


if (!bSearchMsgPrinted)
{
player.ClientMessage(msgSearching);
bSearchMsgPrinted = True;
}

DeusExRootWindow(player.rootWindow).hud.receivedItems.AddItem(item, 1);

// Make sure the object belt is updated
if (item.IsA('Ammo'))
player.UpdateAmmoBeltText(Ammo(item));
else
player.UpdateBeltText(item);

// Deny 20mm and WP rockets off of bodies in multiplayer
if ( Level.NetMode != NM_Standalone )
{
if ( item.IsA('WeaponAssaultGun') || item.IsA('WeaponGEPGun') )
{
w = DeusExWeapon(player.FindInventoryType(item.Class));
if (( Ammo20mm(w.AmmoType) != None ) || ( AmmoRocketWP(w.AmmoType) != None ))
{
altAmmo = Spawn( w.AmmoNames[0] );
DeusExAmmo(altAmmo).AmmoAmount = w.PickupAmmoCount;
altAmmo.Frob(player,None);
altAmmo.Destroy();
w.AmmoType.Destroy();
w.LoadAmmo( 0 );
}
}
}

ChunkUp (int Damage)


local int i;
local float size;
local Vector loc;
local FleshFragment chunk;


// gib the carcass
size = (CollisionRadius + CollisionHeight) / 2;
if (size > 10.0)
{
for (i=0; i {
loc.X = (1-2*FRand()) * CollisionRadius;
loc.Y = (1-2*FRand()) * CollisionRadius;
loc.Z = (1-2*FRand()) * CollisionHeight;
loc += Location;
chunk = spawn(class'FleshFragment', None,, loc);
if (chunk != None)
{
chunk.DrawScale = size / 25;
chunk.SetCollisionSize(chunk.CollisionRadius / chunk.DrawScale, chunk.CollisionHeight / chunk.DrawScale);
chunk.bFixedRotationDir = True;
chunk.RotationRate = RotRand(False);
}
}
}

Super.ChunkUp(Damage);

DeleteInventory (inventory Item) -> bool


local actor Link;

// If this item is in our inventory chain, unlink it.

for( Link = Self; Link!=None; Link=Link.Inventory )
{
if( Link.Inventory == Item )
{
Link.Inventory = Item.Inventory;
break;
}
}
Item.SetOwner(None);

Destroyed


if (flyGen != None)
{
flyGen.StopGenerator();
flyGen = None;
}

Super.Destroyed();

Frob (Actor Frobber, Inventory frobWith)


local Inventory item, nextItem, startItem;
local Pawn P;
local DeusExWeapon W;
local bool bFoundSomething;
local DeusExPlayer player;
local ammo AmmoType;
local bool bPickedItemUp;
local POVCorpse corpse;
local DeusExPickup invItem;
local int itemCount;


//log("DeusExCarcass::Frob()--------------------------------");

// Can we assume only the *PLAYER* would actually be frobbing carci?
player = DeusExPlayer(Frobber);

// No doublefrobbing in multiplayer.
if (bQueuedDestroy)
return;

// if we've already been searched, let the player pick us up
// don't pick up animal carcii
if (!bAnimalCarcass)
{
// DEUS_EX AMSD Since we don't have animations for carrying corpses, and since it has no real use in multiplayer,
// and since the PutInHand propagation doesn't just work, this is work we don't need to do.
// Were you to do it, you'd need to check the respawning issue, destroy the POVcorpse it creates and point to the
// one in inventory (like I did when giving the player starting inventory).
if ((Inventory == None) && (player != None) && (player.inHand == None) && (Level.NetMode == NM_Standalone))
{
if (!bInvincible)
{
corpse = Spawn(class'POVCorpse');
if (corpse != None)
{
// destroy the actual carcass and put the fake one
// in the player's hands
corpse.carcClassString = String(Class);
corpse.KillerAlliance = KillerAlliance;
corpse.KillerBindName = KillerBindName;
corpse.Alliance = Alliance;
corpse.bNotDead = bNotDead;
corpse.bEmitCarcass = bEmitCarcass;
corpse.CumulativeDamage = CumulativeDamage;
corpse.MaxDamage = MaxDamage;
corpse.CorpseItemName = itemName;
corpse.CarcassName = CarcassName;
corpse.Frob(player, None);
corpse.SetBase(player);
player.PutInHand(corpse);
bQueuedDestroy=True;
Destroy();
return;
}
}
}
}

bFoundSomething = False;
bSearchMsgPrinted = False;
P = Pawn(Frobber);
if (P != None)
{
// Make sure the "Received Items" display is cleared
// DEUS_EX AMSD Don't bother displaying in multiplayer. For propagation
// reasons it is a lot more of a hassle than it is worth.
if ( (player != None) && (Level.NetMode == NM_Standalone) )
DeusExRootWindow(player.rootWindow).hud.receivedItems.RemoveItems();

if (Inventory != None)
{

item = Inventory;
startItem = item;

do
{
// log("===>DeusExCarcass:item="$item );

nextItem = item.Inventory;

bPickedItemUp = False;

if (item.IsA('Ammo'))
{
// Only let the player pick up ammo that's already in a weapon
DeleteInventory(item);
item.Destroy();
item = None;
}
else if ( (item.IsA('DeusExWeapon')) )
{
// Any weapons have their ammo set to a random number of rounds (1-4)
// unless it's a grenade, in which case we only want to dole out one.
// DEUS_EX AMSD In multiplayer, give everything away.
W = DeusExWeapon(item);

// Grenades and LAMs always pickup 1
if (W.IsA('WeaponNanoVirusGrenade') ||
W.IsA('WeaponGasGrenade') ||
W.IsA('WeaponEMPGrenade') ||
W.IsA('WeaponLAM'))
W.PickupAmmoCount = 1;
else if (Level.NetMode == NM_Standalone)
W.PickupAmmoCount = Rand(4) + 1;
}

if (item != None)
{
bFoundSomething = True;

if (item.IsA('NanoKey'))
{
if (player != None)
{
player.PickupNanoKey(NanoKey(item));
AddReceivedItem(player, item, 1);
DeleteInventory(item);
item.Destroy();
item = None;
}
bPickedItemUp = True;
}
else if (item.IsA('Credits')) // I hate special cases
{
if (player != None)
{
AddReceivedItem(player, item, Credits(item).numCredits);
player.Credits += Credits(item).numCredits;
P.ClientMessage(Sprintf(Credits(item).msgCreditsAdded, Credits(item).numCredits));
DeleteInventory(item);
item.Destroy();
item = None;
}
bPickedItemUp = True;
}
else if (item.IsA('DeusExWeapon')) // I *really* hate special cases
{
// Okay, check to see if the player already has this weapon. If so,
// then just give the ammo and not the weapon. Otherwise give
// the weapon normally.
W = DeusExWeapon(player.FindInventoryType(item.Class));

// If the player already has this item in his inventory, piece of cake,
// we just give him the ammo. However, if the Weapon is *not* in the
// player's inventory, first check to see if there's room for it. If so,
// then we'll give it to him normally. If there's *NO* room, then we
// want to give the player the AMMO only (as if the player already had
// the weapon).

if ((W != None) || ((W == None) && (!player.FindInventorySlot(item, True))))
{
// Don't bother with this is there's no ammo
if ((Weapon(item).AmmoType != None) && (Weapon(item).AmmoType.AmmoAmount > 0))
{
AmmoType = Ammo(player.FindInventoryType(Weapon(item).AmmoName));

if ((AmmoType != None) && (AmmoType.AmmoAmount < AmmoType.MaxAmmo))
{
AmmoType.AddAmmo(Weapon(item).PickupAmmoCount);
AddReceivedItem(player, AmmoType, Weapon(item).PickupAmmoCount);

// Update the ammo display on the object belt
player.UpdateAmmoBeltText(AmmoType);

// if this is an illegal ammo type, use the weapon name to print the message
if (AmmoType.PickupViewMesh == Mesh'TestBox')
P.ClientMessage(item.PickupMessage @ item.itemArticle @ item.itemName, 'Pickup');
else
P.ClientMessage(AmmoType.PickupMessage @ AmmoType.itemArticle @ AmmoType.itemName, 'Pickup');

// Mark it as 0 to prevent it from being added twice
Weapon(item).AmmoType.AmmoAmount = 0;
}
}

// Print a message "Cannot pickup blah blah blah" if inventory is full
// and the player can't pickup this weapon, so the player at least knows
// if he empties some inventory he can get something potentially cooler
// than he already has.
if ((W == None) && (!player.FindInventorySlot(item, True)))
P.ClientMessage(Sprintf(Player.InventoryFull, item.itemName));

// Only destroy the weapon if the player already has it.
if (W != None)
{
// Destroy the weapon, baby!
DeleteInventory(item);
item.Destroy();
item = None;
}

bPickedItemUp = True;
}
}

else if (item.IsA('DeusExAmmo'))
{
if (DeusExAmmo(item).AmmoAmount == 0)
bPickedItemUp = True;
}

if (!bPickedItemUp)
{
// Special case if this is a DeusExPickup(), it can have multiple copies
// and the player already has it.

if ((item.IsA('DeusExPickup')) && (DeusExPickup(item).bCanHaveMultipleCopies) && (player.FindInventoryType(item.class) != None))
{
invItem = DeusExPickup(player.FindInventoryType(item.class));
itemCount = DeusExPickup(item).numCopies;

// Make sure the player doesn't have too many copies
if ((invItem.MaxCopies > 0) && (DeusExPickup(item).numCopies + invItem.numCopies > invItem.MaxCopies))
{
// Give the player the max #
if ((invItem.MaxCopies - invItem.numCopies) > 0)
{
itemCount = (invItem.MaxCopies - invItem.numCopies);
DeusExPickup(item).numCopies -= itemCount;
invItem.numCopies = invItem.MaxCopies;
P.ClientMessage(invItem.PickupMessage @ invItem.itemArticle @ invItem.itemName, 'Pickup');
AddReceivedItem(player, invItem, itemCount);
}
else
{
P.ClientMessage(Sprintf(msgCannotPickup, invItem.itemName));
}
}
else
{
invItem.numCopies += itemCount;
DeleteInventory(item);

P.ClientMessage(invItem.PickupMessage @ invItem.itemArticle @ invItem.itemName, 'Pickup');
AddReceivedItem(player, invItem, itemCount);
}
}
else
{
// check if the pawn is allowed to pick this up
if ((P.Inventory == None) || (Level.Game.PickupQuery(P, item)))
{
DeusExPlayer(P).FrobTarget = item;
if (DeusExPlayer(P).HandleItemPickup(Item) != False)
{
DeleteInventory(item);

// DEUS_EX AMSD Belt info isn't always getting cleaned up. Clean it up.
item.bInObjectBelt=False;
item.BeltPos=-1;

item.SpawnCopy(P);

// Show the item received in the ReceivedItems window and also
// display a line in the Log
AddReceivedItem(player, item, 1);

P.ClientMessage(Item.PickupMessage @ Item.itemArticle @ Item.itemName, 'Pickup');
PlaySound(Item.PickupSound);
}
}
else
{
DeleteInventory(item);
item.Destroy();
item = None;
}
}
}
}

item = nextItem;
}
until ((item == None) || (item == startItem));
}

//log(" bFoundSomething = " $ bFoundSomething);

if (!bFoundSomething)
P.ClientMessage(msgEmpty);
}

if ((player != None) && (Level.Netmode != NM_Standalone))
{
player.ClientMessage(Sprintf(msgRecharged, 25));

PlaySound(sound'BioElectricHiss', SLOT_None,,, 256);

player.Energy += 25;
if (player.Energy > player.EnergyMax)
player.Energy = player.EnergyMax;
}

Super.Frob(Frobber, frobWith);

if ((Level.Netmode != NM_Standalone) && (Player != None))
{
bQueuedDestroy = true;
Destroy();
}

HandleLanding


local Vector HitLocation, HitNormal, EndTrace;
local Actor hit;
local BloodPool pool;


if (!bNotDead)
{
// trace down about 20 feet if we're not in water
if (!Region.Zone.bWaterZone)
{
EndTrace = Location - vect(0,0,320);
hit = Trace(HitLocation, HitNormal, EndTrace, Location, False);
if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
{
pool = None;
}
else
{
pool = spawn(class'BloodPool',,, HitLocation+HitNormal, Rotator(HitNormal));
}
if (pool != None)
pool.maxDrawScale = CollisionRadius / 40.0;
}

// alert NPCs that I'm food
AIStartEvent('Food', EAITYPE_Visual);
}

// by default, the collision radius is small so there won't be as
// many problems spawning carcii
// expand the collision radius back to where it's supposed to be
// don't change animal carcass collisions
if (!bAnimalCarcass)
SetCollisionSize(40.0, Default.CollisionHeight);

// alert NPCs that I'm really disgusting
if (bEmitCarcass)
AIStartEvent('Carcass', EAITYPE_Visual);

InitFor (Actor Other)


if (Other != None)
{
// set as unconscious or add the pawns name to the description
if (!bAnimalCarcass)
{
if (bNotDead)
itemName = msgNotDead;
else if (Other.IsA('ScriptedPawn'))
itemName = itemName $ " (" $ ScriptedPawn(Other).FamiliarName $ ")";
}

Mass = Other.Mass;
Buoyancy = Mass * 1.2;
MaxDamage = 0.8*Mass;
if (ScriptedPawn(Other) != None)
if (ScriptedPawn(Other).bBurnedToDeath)
CumulativeDamage = MaxDamage-1;

SetScaleGlow();

// Will this carcass spawn flies?
if (bAnimalCarcass)
{
itemName = msgAnimalCarcass;
if (FRand() < 0.2)
bGenerateFlies = true;
}
else if (!Other.IsA('Robot') && !bNotDead)
{
if (FRand() < 0.1)
bGenerateFlies = true;
bEmitCarcass = true;
}

if (Other.AnimSequence == 'DeathFront')
Mesh = Mesh2;

// set the instigator and tag information
if (Other.Instigator != None)
{
KillerBindName = Other.Instigator.BindName;
KillerAlliance = Other.Instigator.Alliance;
}
else
{
KillerBindName = Other.BindName;
KillerAlliance = '';
}
Tag = Other.Tag;
Alliance = Pawn(Other).Alliance;
CarcassName = Other.Name;
}

PostBeginPlay


local int i, j;
local Inventory inv;


bCollideWorld = true;

// Use the carcass name by default
CarcassName = Name;

// Add initial inventory items
for (i=0; i<8; i++)
{
if ((InitialInventory[i].inventory != None) && (InitialInventory[i].count > 0))
{
for (j=0; j {
inv = spawn(InitialInventory[i].inventory, self);
if (inv != None)
{
inv.bHidden = True;
inv.SetPhysics(PHYS_None);
AddInventory(inv);
}
}
}
}

// use the correct mesh
if (Region.Zone.bWaterZone)
{
Mesh = Mesh3;
bNotDead = False; // you will die in water every time
}

if (bAnimalCarcass)
itemName = msgAnimalCarcass;

MaxDamage = 0.8*Mass;
SetScaleGlow();

SetTimer(30.0, False);

Super.PostBeginPlay();

SetScaleGlow


local float pct;


// scaleglow based on damage
pct = FClamp(1.0-float(CumulativeDamage)/MaxDamage, 0.1, 1.0);
ScaleGlow = pct;

TakeDamage (int Damage, Pawn instigatedBy, Vector hitLocation, Vector momentum, name damageType)


local int i;


if (bInvincible)
return;

// only take "gib" damage from these damage types
if ((damageType == 'Shot') || (damageType == 'Sabot') || (damageType == 'Exploded') || (damageType == 'Munch') ||
(damageType == 'Tantalus'))
{
if ((damageType != 'Munch') && (damageType != 'Tantalus'))
{
if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
{
}
else
{
spawn(class'BloodSpurt',,,HitLocation);
spawn(class'BloodDrop',,, HitLocation);
for (i=0; i spawn(class'BloodDrop',,, HitLocation);
}
}

// this section copied from Carcass::TakeDamage() and modified a little
if (!bDecorative)
{
bBobbing = false;
SetPhysics(PHYS_Falling);
}
if ((Physics == PHYS_None) && (Momentum.Z < 0))
Momentum.Z *= -1;
Velocity += 3 * momentum/(Mass + 200);
if (DamageType == 'Shot')
Damage *= 0.4;
CumulativeDamage += Damage;
if (CumulativeDamage >= MaxDamage)
ChunkUp(Damage);
if (bDecorative)
Velocity = vect(0,0,0);
}

SetScaleGlow();

Tick (float deltaSeconds)


if (!bInit)
{
bInit = true;
if (bEmitCarcass)
AIStartEvent('Carcass', EAITYPE_Visual);
}
Super.Tick(deltaSeconds);

Timer


// overrides goddamned lifespan crap
// DEUS_EX AMSD In multiplayer, we want corpses to have lifespans.
if (Level.NetMode == NM_Standalone)
Global.Timer();
else
Super.Timer();

ZoneChange (ZoneInfo NewZone)


Super.ZoneChange(NewZone);

// use the correct mesh for water
if (NewZone.bWaterZone)
Mesh = Mesh3;




DeusExDecal.uc (extends Decal)

var bool bAttached, bStartedLife, bImportant;
bAttached=True
bImportant=True

PostBeginPlay


Super.PostBeginPlay();
SetTimer(1.0, false);

ReattachDecal (optional vector newrot)


DetachDecal();
if (newrot != vect(0,0,0))
AttachDecal(32, newrot);
else
AttachDecal(32);

Timer


// Check for nearby players, if none then destroy self

if ( !bAttached )
{
Destroy();
return;
}

if ( !bStartedLife )
{
RemoteRole = ROLE_None;
bStartedLife = true;
if ( Level.bDropDetail )
SetTimer(5.0 + 2 * FRand(), false);
else
SetTimer(18.0 + 5 * FRand(), false);
return;
}
if ( Level.bDropDetail && (MultiDecalLevel < 6) )
{
if ( (Level.TimeSeconds - LastRenderedTime > 0.35)
|| (!bImportant && (FRand() < 0.2)) )
Destroy();
else
{
SetTimer(1.0, true);
return;
}
}
else if ( Level.TimeSeconds - LastRenderedTime < 1 )
{
SetTimer(5.0, true);
return;
}
Destroy();




DeusExDecoration.uc (extends Decoration)

var() travel int HitPoints;
var() int minDamageThreshold;
var() bool bInvincible;
var() class fragType;
var() bool bFloating;
var rotator origRot;
var() name moverTag;
var() bool bFlammable; // can this object catch on fire?
var() float Flammability; // how long does the object burn?
var() bool bExplosive; // does this object explode when destroyed?
var() int explosionDamage; // how much damage does the explosion cause?
var() float explosionRadius; // how big is the explosion?
var() bool bHighlight; // should this object not highlight when focused?
var() bool bCanBeBase; // can an actor stand on this decoration?
var() bool bGenerateFlies; // does this actor generate flies?
var int pushSoundId; // used to stop playing the push sound
var int gradualHurtSteps; // how many separate explosions for the staggered HurtRadius
var int gradualHurtCounter; // which one are we currently doing
var name NextState; // for queueing states
var name NextLabel; // for queueing states
var FlyGenerator flyGen; // fly generator
var localized string itemArticle;
var localized string itemName; // human readable name
HitPoints=20
FragType=Class'DeusEx.MetalFragment'
Flammability=30.000000
explosionDamage=100
explosionRadius=768.000000
bHighlight=True
ItemArticle="a"
ItemName="DEFAULT DECORATION NAME - REPORT THIS AS A BUG"
bPushable=True
PushSound=Sound'DeusExSounds.Generic.PushMetal'
bStatic=False
bTravel=True
Physics=PHYS_Falling
DrawType=DT_Mesh
bCollideActors=True
bCollideWorld=True
bBlockActors=True
bBlockPlayers=True

BaseChange


bBobbing = false;

if( (base == None) && (bPushable || IsA('Carcass')) && (Physics == PHYS_None) )
SetPhysics(PHYS_Falling);

// make sure if a decoration is accidentally dropped,
// we reset it's parameters correctly
SetCollision(Default.bCollideActors, Default.bBlockActors, Default.bBlockPlayers);
Style = Default.Style;
bUnlit = Default.bUnlit;
ResetScaleGlow();

BeginPlay


local Mover M;


Super.BeginPlay();

if (bFloating)
origRot = Rotation;

// attach us to the mover that was tagged
if (moverTag != '')
foreach AllActors(class'Mover', M, moverTag)
{
SetBase(M);
SetPhysics(PHYS_None);
bInvincible = True;
bCollideWorld = False;
}

if (fragType == class'GlassFragment')
pushSound = sound'PushPlastic';
else if (fragType == class'MetalFragment')
pushSound = sound'PushMetal';
else if (fragType == class'PaperFragment')
pushSound = sound'PushPlastic';
else if (fragType == class'PlasticFragment')
pushSound = sound'PushPlastic';
else if (fragType == class'WoodFragment')
pushSound = sound'PushWood';
else if (fragType == class'Rockchip')
pushSound = sound'PushPlastic';

BeginState


local Fire f;
local int i;
local vector loc;


for (i=0; i<8; i++)
{
loc.X = 0.9*CollisionRadius * (1.0-2.0*FRand());
loc.Y = 0.9*CollisionRadius * (1.0-2.0*FRand());
loc.Z = 0.9*CollisionHeight * (1.0-2.0*FRand());
loc += Location;
f = Spawn(class'Fire', Self,, loc);
if (f != None)
{
f.DrawScale = FRand() + 1.0;
f.LifeSpan = Flammability;

// turn off the sound and lights for all but the first one
if (i > 0)
{
f.AmbientSound = None;
f.LightType = LT_None;
}

// turn on/off extra fire and smoke
if (FRand() < 0.5)
f.smokeGen.Destroy();
if (FRand() < 0.5)
f.AddFire(1.5);
}
}

// set the burn timer
SetTimer(1.0, True);

Bump (actor Other)


local int augLevel, augMult;
local float maxPush, velscale;
local DeusExPlayer player;
local Rotator rot;


player = DeusExPlayer(Other);

// if we are bumped by a burning pawn, then set us on fire
if (Other.IsA('Pawn') && Pawn(Other).bOnFire && !Other.IsA('Robot') && !Region.Zone.bWaterZone && bFlammable)
GotoState('Burning');

// if we are bumped by a burning decoration, then set us on fire
if (Other.IsA('DeusExDecoration') && DeusExDecoration(Other).IsInState('Burning') &&
DeusExDecoration(Other).bFlammable && !Region.Zone.bWaterZone && bFlammable)
GotoState('Burning');

// Check to see if the actor touched is the Player Character
if (player != None)
{
// if we are being carried, ignore Bump()
if (player.CarriedDecoration == Self)
return;

// check for convos
// NO convos on bump
// if ( player.StartConversation(Self, IM_Bump) )
// return;
}

if (bPushable && (PlayerPawn(Other)!=None) && (Other.Mass > 40))// && (Physics != PHYS_Falling))
{
// A little bit of a hack...
// Make sure this decoration isn't being bumped from above or below
if (abs(Location.Z-Other.Location.Z) < (CollisionHeight+Other.CollisionHeight-1))
{
maxPush = 100;
augMult = 1;
if (player != None)
{
if (player.AugmentationSystem != None)
{
augLevel = player.AugmentationSystem.GetClassLevel(class'AugMuscle');
if (augLevel >= 0)
augMult = augLevel+2;
maxPush *= augMult;
}
}

if (Mass <= maxPush)
{
// slow it down based on how heavy it is and what level my augmentation is
velscale = FClamp((50.0 * augMult) / Mass, 0.0, 1.0);
if (velscale < 0.25)
velscale = 0;

// apply more velocity than normal if we're floating
if (bFloating)
Velocity = Other.Velocity;
else
Velocity = Other.Velocity * velscale;

if (Physics != PHYS_Falling)
Velocity.Z = 0;

if (!bFloating && !bPushSoundPlaying && (Mass > 15))
{
pushSoundId = PlaySound(PushSound, SLOT_Misc,,, 128);
AIStartEvent('LoudNoise', EAITYPE_Audio, , 128);
bPushSoundPlaying = True;
}

if (!bFloating && (Physics != PHYS_Falling))
SetPhysics(PHYS_Rolling);

SetTimer(0.2, False);
Instigator = Pawn(Other);

// Impart angular velocity (yaw only) based on where we are bumped from
// NOTE: This is faked, but it looks cool
rot = Rotator((Other.Location - Location) << Rotation);
rot.Pitch = 0;
rot.Roll = 0;

// ignore which side we're pushing from
if (rot.Yaw >= 24576)
rot.Yaw -= 32768;
else if (rot.Yaw >= 8192)
rot.Yaw -= 16384;
else if (rot.Yaw <= -24576)
rot.Yaw += 32768;
else if (rot.Yaw <= -8192)
rot.Yaw += 16384;

// scale it down based on mass and apply the new "rotational force"
rot.Yaw *= velscale * 0.025;
SetRotation(Rotation+rot);
}
}
}

ConBindEvents | native

Destroyed


local DeusExPlayer player;


if (bPushSoundPlaying)
{
StopSound(pushSoundId);
AIEndEvent('LoudNoise', EAITYPE_Audio);
bPushSoundPlaying = False;
}

if (flyGen != None)
{
flyGen.Burst();
flyGen.StopGenerator();
flyGen = None;
}

// Pass a message to conPlay, if it exists in the player, that
// this object has been destroyed. This is used to prevent
// bad things from happening in converseations.

player = DeusExPlayer(GetPlayerPawn());

if ((player != None) && (player.conPlay != None))
{
player.conPlay.ActorDestroyed(Self);
}

if (!IsA('Containers'))
Super.Destroyed();

DropThings


local actor A;


// drop everything that is on us
foreach BasedActors(class'Actor', A)
if (!A.IsA('ParticleGenerator'))
A.SetPhysics(PHYS_Falling);

EndConversation


Super.EndConversation();

Enable('Bump');

GotoState(NextState);

EnterConversationState (bool bFirstPerson, optional bool bAvoidState)


// First check to see if we're already in a conversation state,
// in which case we'll abort immediately

if ((GetStateName() == 'Conversation') || (GetStateName() == 'FirstPersonConversation'))
return;

NextState = GetStateName();

// If bAvoidState is set, then we don't want to jump into the conversaton state
// because bad things might happen otherwise.

if (!bAvoidState)
{
if (bFirstPerson)
GotoState('FirstPersonConversation');
else
GotoState('Conversation');
}

Explode (vector HitLocation)


local ShockRing ring;
local ScorchMark s;
local ExplosionLight light;
local int i;


// make sure we wake up when taking damage
bStasis = False;

// alert NPCs that I'm exploding
AISendEvent('LoudNoise', EAITYPE_Audio, , explosionRadius * 16);

if (explosionRadius <= 128)
PlaySound(Sound'SmallExplosion1', SLOT_None,,, explosionRadius*16);
else
PlaySound(Sound'LargeExplosion1', SLOT_None,,, explosionRadius*16);

// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, HitLocation);
if (explosionRadius < 128)
{
Spawn(class'ExplosionSmall',,, HitLocation);
light.size = 2;
}
else if (explosionRadius < 256)
{
Spawn(class'ExplosionMedium',,, HitLocation);
light.size = 4;
}
else
{
Spawn(class'ExplosionLarge',,, HitLocation);
light.size = 8;
}

// draw a pretty shock ring
ring = Spawn(class'ShockRing',,, HitLocation, rot(16384,0,0));
if (ring != None)
ring.size = explosionRadius / 32.0;
ring = Spawn(class'ShockRing',,, HitLocation, rot(0,0,0));
if (ring != None)
ring.size = explosionRadius / 32.0;
ring = Spawn(class'ShockRing',,, HitLocation, rot(0,16384,0));
if (ring != None)
ring.size = explosionRadius / 32.0;

// spawn a mark
s = spawn(class'ScorchMark', Base,, Location-vect(0,0,1)*CollisionHeight, Rotation+rot(16384,0,0));
if (s != None)
{
s.DrawScale = FClamp(explosionDamage/30, 0.1, 3.0);
s.ReattachDecal();
}

// spawn some rocks
for (i=0; i if (FRand() < 0.8)
spawn(class'Rockchip',,,HitLocation);

GotoState('Exploding');

ExtinguishFire


local Fire f;


if (IsInState('Burning'))
{
foreach BasedActors(class'Fire', f)
f.Destroy();

GotoState('Active');
}

Frag (class FragType, vector Momentum, float DSize, int NumFrags)


local int i;
local actor A, Toucher;
local DeusExFragment s;


if ( bOnlyTriggerable )
return;
if (Event!='')
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Toucher, pawn(Toucher) );
if ( Region.Zone.bDestructive )
{
Destroy();
return;
}
for (i=0 ; i {
s = DeusExFragment(Spawn(FragType, Owner));
if (s != None)
{
s.Instigator = Instigator;
s.CalcVelocity(Momentum,0);
s.DrawScale = DSize*0.5+0.7*DSize*FRand();
s.Skin = GetMeshTexture();
if (bExplosive)
s.bSmoking = True;
}
}

if (!bExplosive)
Destroy();

Frob (Actor Frobber, Inventory frobWith)


local Actor A;
local Pawn P;
local DeusExPlayer Player;


P = Pawn(Frobber);
Player = DeusExPlayer(Frobber);

Super.Frob(Frobber, frobWith);

// First check to see if there's a conversation associated with this
// decoration. If so, trigger the conversation instead of triggering
// the event for this decoration

if ( Player != None )
{
if ( player.StartConversation(Self, IM_Frob) )
return;
}

// Trigger event if we aren't hackable
if (!IsA('HackableDevices'))
if (Event != '')
foreach AllActors(class 'Actor', A, Event)
A.Trigger(Self, P);

Landed (vector HitNormal)


local Rotator rot;
local sound hitSound;


// make it lay flat on the ground
bFixedRotationDir = False;
rot = Rotation;
rot.Pitch = 0;
rot.Roll = 0;
SetRotation(rot);

// play a sound effect if it's falling fast enough
if (Velocity.Z <= -200)
{
if (fragType == class'WoodFragment')
{
if (Mass <= 20)
hitSound = sound'WoodHit1';
else
hitSound = sound'WoodHit2';
}
else if (fragType == class'MetalFragment')
{
if (Mass <= 20)
hitSound = sound'MetalHit1';
else
hitSound = sound'MetalHit2';
}
else if (fragType == class'PlasticFragment')
{
if (Mass <= 20)
hitSound = sound'PlasticHit1';
else
hitSound = sound'PlasticHit2';
}
else if (fragType == class'GlassFragment')
{
if (Mass <= 20)
hitSound = sound'GlassHit1';
else
hitSound = sound'GlassHit2';
}
else // paper sound
{
if (Mass <= 20)
hitSound = sound'PaperHit1';
else
hitSound = sound'PaperHit2';
}

if (hitSound != None)
PlaySound(hitSound, SLOT_None);

// alert NPCs that I've landed
AISendEvent('LoudNoise', EAITYPE_Audio);
}

bWasCarried = false;
bBobbing = false;

// The crouch height is higher in multiplayer, so we need to be more forgiving on the drop velocity to explode
if ( Level.NetMode != NM_Standalone )
{
if ((bExplosive && (VSize(Velocity) > 478)) || (!bExplosive && (Velocity.Z < -500)))
TakeDamage((1-Velocity.Z/30), Instigator, Location, vect(0,0,0), 'fell');
}
else
{
if ((bExplosive && (VSize(Velocity) > 425)) || (!bExplosive && (Velocity.Z < -500)))
TakeDamage((1-Velocity.Z/30), Instigator, Location, vect(0,0,0), 'fell');
}

PostPostBeginPlay


Super.PostPostBeginPlay();

// Bind any conversation events to this DeusExPlayer
ConBindEvents();

PreBeginPlay


Super.PreBeginPlay();

// Bind any conversation events to this Decoration
// ConBindEvents();

if (bGenerateFlies && (FRand() < 0.1))
flyGen = Spawn(Class'FlyGenerator', , , Location, Rotation);
else
flyGen = None;

ResetScaleGlow


if (!bInvincible)
ScaleGlow = float(HitPoints) / float(Default.HitPoints) * 0.9 + 0.1;

SupportActor (Actor standingActor)


local vector newVelocity;
local float angle;
local float zVelocity;
local float baseMass;
local float standingMass;


zVelocity = standingActor.Velocity.Z;
// We've been stomped!
if (zVelocity < -500)
{
standingMass = FMax(1, standingActor.Mass);
baseMass = FMax(1, Mass);
TakeDamage((1 - standingMass/baseMass * zVelocity/30),
standingActor.Instigator, standingActor.Location, 0.2*standingActor.Velocity, 'stomped');
}

if (!bCanBeBase)
{
angle = FRand()*Pi*2;
newVelocity.X = cos(angle);
newVelocity.Y = sin(angle);
newVelocity.Z = 0;
newVelocity *= FRand()*25 + 25;
newVelocity += standingActor.Velocity;
newVelocity.Z = 50;
standingActor.Velocity = newVelocity;
standingActor.SetPhysics(PHYS_Falling);
}
else
standingActor.SetBase(self);

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


local float avg;


if ((DamageType == 'TearGas') || (DamageType == 'PoisonGas') || (DamageType == 'Radiation'))
return;

if ((DamageType == 'EMP') || (DamageType == 'NanoVirus') || (DamageType == 'Shocked'))
return;

if (DamageType == 'HalonGas')
ExtinguishFire();

// if we are already burning, we can't take any more damage
if ((DamageType == 'Burned') || (DamageType == 'Flamed'))
{
HitPoints -= Damage/2;
}
else
{
if (Damage >= minDamageThreshold)
HitPoints -= Damage;
}

if (bExplosive)
HitPoints = 0;

if (HitPoints > 0) // darken it to show damage (from 1.0 to 0.1 - don't go completely black)
{
ResetScaleGlow();
}
else // destroy it!
{
DropThings();

// clear the event to keep Destroyed() from triggering the event
Event = '';
avg = (CollisionRadius + CollisionHeight) / 2;
Frag(fragType, Momentum / 10, avg/20.0, avg/5 + 1);
Instigator = EventInstigator;
if (Instigator != None)
MakeNoise(1.0);

// if we have been blown up, then destroy our contents
if (bExplosive)
{
Contents = None;
Content2 = None;
Content3 = None;
Explode(HitLocation);
}
}

Tick (float deltaTime)


local float ang;
local rotator rot;
local DeusExPlayer player;


Super.Tick(deltaTime);

if (bFloating)
{
ang = 2 * Pi * Level.TimeSeconds / 4.0;
rot = origRot;
rot.Pitch += Sin(ang) * 512;
rot.Roll += Cos(ang) * 512;
rot.Yaw += Sin(ang) * 256;
SetRotation(rot);
}

// BOOGER! This is a hack!
// Ideally, we'd set the base of the fly generator to this decoration,
// but unfortunately this prevents the player from picking up the
// decoration... need to fix!

if (flyGen != None)
{
if ((flyGen.Location != Location) || (flyGen.Rotation != Rotation))
{
flyGen.SetLocation(Location);
flyGen.SetRotation(Rotation);
}
}

// If we have any conversations, check to see if we're close enough
// to the player to start one (and all the other checks that take place
// when a valid conversation can be started);

if (conListItems != None)
{
player = DeusExPlayer(GetPlayerPawn());
if (player != None)
player.StartConversation(Self, IM_Radius);
}

if ((Level.Netmode != NM_Standalone) && (VSize(Velocity) > 0) && (VSize(Velocity) < 5))
{
Velocity *= 0;
}

Timer


if (bPushSoundPlaying)
{
StopSound(pushSoundId);
AIEndEvent('LoudNoise', EAITYPE_Audio);
bPushSoundPlaying = False;
}
TakeDamage(2, None, Location, vect(0,0,0), 'Burned');

TravelPostAccept

Trigger (Actor Other, Pawn Instigator)


if (bExplosive)
{
Explode(Location);
Super.Trigger(Other, Instigator);
}

ZoneChange (ZoneInfo NewZone)


Super.ZoneChange(NewZone);

if (bFloating && !NewZone.bWaterZone)
{
bFloating = False;
SetRotation(origRot);
return;
}

if (NewZone.bWaterZone)
ExtinguishFire();

if (NewZone.bWaterZone && !bFloating && (Buoyancy > Mass))
{
bFloating = True;
origRot = Rotation;
}




DeusExEditWindow.uc (extends EditWindow)

InitWindow


Super.InitWindow();

SetTextAlignments( HALIGN_Left, VALIGN_Top );
SetInsertionPointType(INSTYPE_Insert);
SetEditCursor(Texture'DeusExEditCursor');




DeusExFragment.uc (extends Fragment)

var bool bSmoking;
var Vector lastHitLoc;
var float smokeTime;
var ParticleGenerator smokeGen;
LifeSpan=10.000000

AddSmoke


smokeGen = Spawn(class'ParticleGenerator', Self);
if (smokeGen != None)
{
smokeGen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
smokeGen.particleDrawScale = 0.5;
smokeGen.riseRate = 10.0;
smokeGen.ejectSpeed = 0.0;
smokeGen.particleLifeSpan = 1.0;
smokeGen.bRandomEject = True;
smokeGen.SetBase(Self);
}

BeginState


Super.BeginState();

if (smokeGen != None)
smokeGen.DelayedDestroy();

Destroyed


if (smokeGen != None)
smokeGen.DelayedDestroy();

Super.Destroyed();

HitWall (vector HitNormal, actor HitWall)


// if we are stuck, stop moving
if (lastHitLoc == Location)
Velocity = vect(0,0,0);
else
Velocity = Elasticity*(( Velocity dot HitNormal ) * HitNormal * (-2.0) + Velocity); // Reflect off Wall w/damping
speed = VSize(Velocity);
if (bFirstHit && speed<400)
{
bFirstHit=False;
bRotatetoDesired=True;
bFixedRotationDir=False;
DesiredRotation.Pitch=0;
DesiredRotation.Yaw=FRand()*65536;
DesiredRotation.roll=0;
}
RotationRate.Yaw = RotationRate.Yaw*0.75;
RotationRate.Roll = RotationRate.Roll*0.75;
RotationRate.Pitch = RotationRate.Pitch*0.75;
if ( (Velocity.Z < 50) && (HitNormal.Z > 0.7) )
{
SetPhysics(PHYS_none, HitWall);
if (Physics == PHYS_None)
bBounce = false;
}

if (FRand()<0.5)
PlaySound(ImpactSound, SLOT_None, 0.5+FRand()*0.5,, 512, 0.85+FRand()*0.3);
else
PlaySound(MiscSound, SLOT_None, 0.5+FRand()*0.5,, 512, 0.85+FRand()*0.3);

lastHitLoc = Location;

PostBeginPlay


Super.PostBeginPlay();

// randomize the lifespan a bit so things don't all disappear at once
LifeSpan += FRand()*2.0;

Tick (float deltaTime)


if ((Level.NetMode != NM_Standalone) && (Role == ROLE_Authority))
return;

if (bSmoking && !IsInState('Dying') && (smokeGen == None))
AddSmoke();

// fade out the object smoothly 2 seconds before it dies completely
if (LifeSpan <= 2)
{
if (Style != STY_Translucent)
Style = STY_Translucent;

ScaleGlow = LifeSpan / 2.0;
}




DeusExGameInfo.uc (extends GameInfo)

bMuteSpectators=True
AutoAim=1.000000

ApproveClass (class SpawnClass) -> bool


return false;

CheckPlayerConsole (PlayerPawn CheckPlayer)


// do nothing.

CheckPlayerWindow (PlayerPawn CheckPlayer)


// do nothing.

ClientPlayerPossessed (PlayerPawn CheckPlayer)


CheckPlayerWindow(CheckPlayer);
CheckPlayerConsole(CheckPlayer);

DiscardInventory (Pawn Other)


// do nothing

FailConsoleCheck (PlayerPawn FailPlayer)


// do nothing

FailRootWindowCheck (PlayerPawn FailPlayer)


// do nothing

ScoreKill (pawn Killer, pawn Other)


// do nothing




DeusExGoal.uc (extends Object)

var travel Name goalName; // Goal name, "GOAL_somestring"
var travel String text; // Actual goal text
var travel Bool bPrimaryGoal; // True if Primary Goal
var travel Bool bCompleted; // True if Completed
var travel DeusExGoal next; // Next goal

IsCompleted -> bool


return bCompleted;

IsPrimaryGoal -> bool


return bPrimaryGoal;

SetCompleted


bCompleted = True;

SetName (Name newGoalName)


goalName = newGoalName;

SetPrimaryGoal (Bool bNewPrimaryGoal)


bPrimaryGoal = bNewPrimaryGoal;

SetText (String newText)


text = newText;




DeusExHUD.uc (extends Window)

var Crosshair cross;
var TimerDisplay timer;
var FrobDisplayWindow frobDisplay;
var DamageHUDDisplay damageDisplay;
var AugmentationDisplayWindow augDisplay;
var HUDHitDisplay hit;
var HUDCompassDisplay compass;
var HUDAmmoDisplay ammo;
var HUDObjectBelt belt;
var HUDInformationDisplay info;
var HUDInfoLinkDisplay infolink;
var HUDLogDisplay msgLog;
var HUDConWindowFirst conWindow;
var HUDMissionStartTextDisplay startDisplay;
var HUDActiveItemsDisplay activeItems;
var HUDBarkDisplay barkDisplay;
var HUDReceivedDisplay receivedItems;
var HUDMultiSkills hms;

ChildRequestedReconfiguration (window child) -> bool


ConfigurationChanged();

return TRUE;

ChildRequestedVisibilityChange (window child, bool bNewVisibility)


child.SetChildVisibility(bNewVisibility);

ConfigurationChanged();

ConfigurationChanged


local float qWidth, qHeight;
local float compassWidth, compassHeight;
local float beltWidth, beltHeight;
local float ammoWidth, ammoHeight;
local float hitWidth, hitHeight;
local float infoX, infoY, infoTop, infoBottom;
local float infoWidth, infoHeight, maxInfoWidth, maxInfoHeight;
local float itemsWidth, itemsHeight;
local float damageWidth, damageHeight;
local float conHeight;
local float barkWidth, barkHeight;
local float recWidth, recHeight, recPosY;
local float logTop;


if (ammo != None)
{
if (ammo.IsVisible())
{
ammo.QueryPreferredSize(ammoWidth, ammoHeight);
ammo.ConfigureChild(0, height-ammoHeight, ammoWidth, ammoHeight);
}
else
{
ammoWidth = 0;
ammoHeight = 0;
}
}

if (hit != None)
{
if (hit.IsVisible())
{
hit.QueryPreferredSize(hitWidth, hitHeight);
hit.ConfigureChild(0, 0, hitWidth, hitHeight);
}
}

// Stick the Compass directly under the Hit display
if (compass != None)
{
compass.QueryPreferredSize(compassWidth, compassHeight);
compass.ConfigureChild(0, hitHeight + 4, compassWidth, compassHeight);

if (hitWidth == 0)
hitWidth = compassWidth;
}

if (cross != None)
{
cross.QueryPreferredSize(qWidth, qHeight);
cross.ConfigureChild((width-qWidth)*0.5+0.5, (height-qHeight)*0.5+0.5, qWidth, qHeight);
}
if (belt != None)
{
belt.QueryPreferredSize(beltWidth, beltHeight);
belt.ConfigureChild(width - beltWidth, height - beltHeight, beltWidth, beltHeight);

infoBottom = height - beltHeight;
}
else
{
infoBottom = height;
}

// Damage display
//
// Left side, under the compass

if (damageDisplay != None)
{
// Doesn't check to see if it might bump into the Hit Display
damageDisplay.QueryPreferredSize(damageWidth, damageHeight);
damageDisplay.ConfigureChild(0, hitHeight + compassHeight + 4, damageWidth, damageHeight);
}

// Active Items, includes Augmentations and various charged Items
//
// Upper right corner

if (activeItems != None)
{
itemsWidth = activeItems.QueryPreferredWidth(height - beltHeight);
activeItems.ConfigureChild(width - itemsWidth, 0, itemsWidth, height - beltHeight);
}

// Display the Log in the upper-left corner, to the right of
// the hit display.

if (msgLog != None)
{
qHeight = msgLog.QueryPreferredHeight(width - hitWidth - itemsWidth - 40);
msgLog.ConfigureChild(hitWidth + 20, 10, width - hitWidth - itemsWidth - 40, qHeight);

if (msgLog.IsVisible())
logTop = max(infoTop, 10 + qHeight);
}

// Display the infolink to the right of the hit display
// and underneath the Log window if it's visible.

if (infolink != None)
{
infolink.QueryPreferredSize(qWidth, qHeight);

if ((msgLog != None) && (msgLog.IsVisible()))
infolink.ConfigureChild(hitWidth + 20, msgLog.Height + 20, qWidth, qHeight);
else
infolink.ConfigureChild(hitWidth + 20, 0, qWidth, qHeight);

if (infolink.IsVisible())
infoTop = max(infoTop, 10 + qHeight);
}

// First-person conversation window

if (conWindow != None)
{
qWidth = Min(width - 100, 800);
conHeight = conWindow.QueryPreferredHeight(qWidth);

// Stick it above the belt
conWindow.ConfigureChild(
(width / 2) - (qwidth / 2), (infoBottom - conHeight) - 20,
qWidth, conHeight);
}

// Bark Display. Position where first-person convo window would
// go, or above it if the first-person convo is visible
if (barkDisplay != None)
{
qWidth = Min(width - 100, 800);
barkHeight = barkDisplay.QueryPreferredHeight(qWidth);

barkDisplay.ConfigureChild(
(width / 2) - (qwidth / 2), (infoBottom - barkHeight - conHeight) - 20,
qWidth, barkHeight);
}

// Received Items display
//
// Stick below the crosshair, but above any bark/convo windows that might
// be visible.

if (receivedItems != None)
{
receivedItems.QueryPreferredSize(recWidth, recHeight);

recPosY = (height / 2) + 20;

if ((barkDisplay != None) && (barkDisplay.IsVisible()))
recPosY -= barkHeight;
if ((conWindow != None) && (conWindow.IsVisible()))
recPosY -= conHeight;

receivedItems.ConfigureChild(
(width / 2) - (recWidth / 2), recPosY,
recWidth, recHeight);
}

// Display the timer above the object belt if it's visible

if (timer != None)
{
timer.QueryPreferredSize(qWidth, qHeight);

if ((belt != None) && (belt.IsVisible()))
timer.ConfigureChild(width-qWidth, height-qHeight-beltHeight-10, qWidth, qHeight);
else
timer.ConfigureChild(width-qWidth, height-qHeight, qWidth, qHeight);
}

// Mission Start Text
if (startDisplay != None)
{
// Stick this baby right in the middle of the screen.
startDisplay.QueryPreferredSize(qWidth, qHeight);
startDisplay.ConfigureChild(
(width / 2) - (qWidth / 2), (height / 2) - (qHeight / 2) - 75,
qWidth, qHeight);
}

// Display the Info Window sandwiched between all the other windows. :)

if ((info != None) && (info.IsVisible(False)))
{
// Must redo these formulas
maxInfoWidth = Min(width - 170, 800);
maxInfoHeight = (infoBottom - infoTop) - 20;

info.QueryPreferredSize(infoWidth, infoHeight);

if (infoWidth > maxInfoWidth)
{
infoHeight = info.QueryPreferredHeight(maxInfoWidth);
infoWidth = maxInfoWidth;
}

infoX = (width / 2) - (infoWidth / 2);
infoY = infoTop + (((infoBottom - infoTop) / 2) - (infoHeight / 2)) + 10;

info.ConfigureChild(infoX, infoY, infoWidth, infoHeight);
}

CreateConWindowFirst -> HUDConWindowFirst


local DeusExRootWindow root;


// Get a pointer to the root window
root = DeusExRootWindow(GetRootWindow());

conWindow = HUDConWindowFirst(NewChild(Class'HUDConWindowFirst', False));
conWindow.AskParentForReconfigure();

return conWindow;

CreateInfoLinkWindow -> HUDInfoLinkDisplay


if ( infolink != None )
return None;

infolink = HUDInfoLinkDisplay(NewChild(Class'HUDInfoLinkDisplay'));

// Hide Log window
if ( msgLog != None )
msgLog.Hide();

infolink.AskParentForReconfigure();

return infolink;

CreateTimerWindow -> TimerDisplay


if ( timer != None )
return None;

timer = TimerDisplay(NewChild(Class'TimerDisplay'));
timer.AskParentForReconfigure();

return timer;

DescendantRemoved (Window descendant)


if (descendant == ammo)
ammo = None;
else if (descendant == hit)
hit = None;
else if (descendant == cross)
cross = None;
else if (descendant == belt)
belt = None;
else if (descendant == activeItems)
activeItems = None;
else if (descendant == damageDisplay)
damageDisplay = None;
else if (descendant == infolink)
infolink = None;
else if (descendant == timer)
timer = None;
else if (descendant == msgLog)
msgLog = None;
else if (descendant == info)
info = None;
else if (descendant == conWindow)
conWindow = None;
else if (descendant == frobDisplay)
frobDisplay = None;
else if (descendant == augDisplay)
augDisplay = None;
else if (descendant == compass)
compass = None;
else if (descendant == startDisplay)
startDisplay = None;
else if (descendant == barkDisplay)
barkDisplay = None;
else if (descendant == receivedItems)
receivedItems = None;
else if ( descendant == hms )
hms = None;

DestroyInfoLinkWindow


if ( infoLink != None )
{
infoLink.Destroy();

// If the msgLog window was visible, show it again
if (( msgLog != None ) && ( msgLog.MessagesWaiting() ))
msgLog.Show();
}

InitWindow


local DeusExRootWindow root;
local DeusExPlayer player;


Super.InitWindow();

// Get a pointer to the root window
root = DeusExRootWindow(GetRootWindow());

// Get a pointer to the player
player = DeusExPlayer(root.parentPawn);

SetFont(Font'TechMedium');
SetSensitivity(false);

ammo = HUDAmmoDisplay(NewChild(Class'HUDAmmoDisplay'));
hit = HUDHitDisplay(NewChild(Class'HUDHitDisplay'));
cross = Crosshair(NewChild(Class'Crosshair'));
belt = HUDObjectBelt(NewChild(Class'HUDObjectBelt'));
activeItems = HUDActiveItemsDisplay(NewChild(Class'HUDActiveItemsDisplay'));
damageDisplay = DamageHUDDisplay(NewChild(Class'DamageHUDDisplay'));
compass = HUDCompassDisplay(NewChild(Class'HUDCompassDisplay'));
hms = HUDMultiSkills(NewChild(Class'HUDMultiSkills'));

// Create the InformationWindow
info = HUDInformationDisplay(NewChild(Class'HUDInformationDisplay', False));

// Create the log window
msgLog = HUDLogDisplay(NewChild(Class'HUDLogDisplay', False));
msgLog.SetLogTimeout(player.GetLogTimeout());

frobDisplay = FrobDisplayWindow(NewChild(Class'FrobDisplayWindow'));
frobDisplay.SetWindowAlignments(HALIGN_Full, VALIGN_Full);

augDisplay = AugmentationDisplayWindow(NewChild(Class'AugmentationDisplayWindow'));
augDisplay.SetWindowAlignments(HALIGN_Full, VALIGN_Full);

startDisplay = HUDMissionStartTextDisplay(NewChild(Class'HUDMissionStartTextDisplay', False));
// startDisplay.SetWindowAlignments(HALIGN_Full, VALIGN_Full);

// Bark display
barkDisplay = HUDBarkDisplay(NewChild(Class'HUDBarkDisplay', False));

// Received Items Display
receivedItems = HUDReceivedDisplay(NewChild(Class'HUDReceivedDisplay', False));

ShowInfoWindow -> HUDInformationDisplay


if (info != None)
info.Show();

return info;

UpdateSettings (DeusExPlayer player)


belt.SetVisibility(player.bObjectBeltVisible);
hit.SetVisibility(player.bHitDisplayVisible);
ammo.SetVisibility(player.bAmmoDisplayVisible);
activeItems.SetVisibility(player.bAugDisplayVisible);
damageDisplay.SetVisibility(player.bHitDisplayVisible);
compass.SetVisibility(player.bCompassVisible);
cross.SetCrosshair(player.bCrosshairVisible);

VisibilityChanged (bool bNewVisibility)


Super.VisibilityChanged( bNewVisibility );

if (( msgLog != None ) && ( bNewVisibility ))
{
if (( infoLink == None ) && ( msgLog.MessagesWaiting() ))
msgLog.Show();
}




DeusExLevelInfo.uc (extends Info)

var() String MapName;
var() String MapAuthor;
var() localized String MissionLocation;
var() int missionNumber; // barfy, lowercase "m" due to SHITTY UNREALSCRIPT NAME BUG!
var() Bool bMultiPlayerMap;
var() class Script;
var() int TrueNorth;
var() localized String startupMessage[4]; // printed when the level starts
var() String ConversationPackage; // DEUS_EX STM -- added so SDK users will be able to use their own convos
ConversationPackage="DeusExConversations"
Texture=Texture'Engine.S_ZoneInfo'
bAlwaysRelevant=True

PostBeginPlay


Super.PostBeginPlay();

SpawnScript();

SpawnScript


local MissionScript scr;
local bool bFound;


// check to see if this script has already been spawned
if (Script != None)
{
bFound = False;
foreach AllActors(class'MissionScript', scr)
bFound = True;

if (!bFound)
{
if (Spawn(Script) == None)
log("DeusExLevelInfo - WARNING! - Could not spawn mission script '"$Script$"'");
else
log("DeusExLevelInfo - Spawned new mission script '"$Script$"'");
}
else
log("DeusExLevelInfo - WARNING! - Already found mission script '"$Script$"'");
}




DeusExLog.uc (extends Object)

var String text; // Log msg stored here.
var DeusExLog next; // Next note

SetLogText (String newLogText)


text = newLogText;




DeusExMPGame.uc (extends DeusExGameInfo)

var() globalconfig int SkillsTotal;
var() globalconfig int SkillsAvail;
var() globalconfig int SkillsPerKill; //number of skill points you get when you kill someone
var() globalconfig int InitialAugs; //number of augs you start with
var() globalconfig int AugsPerKill; //number of augs added when you kill someone
var() globalconfig int ScoreToWin; // Summed kills to win
var() globalconfig string VictoryCondition; //type of victory condition
var() globalconfig int MPSkillStartLevel; //starting level of skills in mp game.
var() globalconfig string CurrentMap; //maptype selected (for saving in ui)
var() globalconfig float fFriendlyFireMult; // Friendly fire multiplier
var() globalconfig bool bTrackWeapons; // whether to track weaponstats or not Not that this tracking helps much.
var() int FragLimit;
var() int TimeLimit; // time limit in minutes
var() int GlobalUpgradesPerKill; //number of points all augs go up when you kill someone
var() bool bMultiPlayerBots; //DEUS_EX AMSD No support done for this one.
var() bool bChangeLevels;
var() bool bAutoInstall; //whether augs get autoinstalled when you pick one up
var() bool bDarkHiding; //whether to do special translucency effects for hiding
var() bool bSpawnEffects; // whether or not to spawn things like shell casings and blood.
var() bool bAugsAllowed; //whether or not players have augmentations.
var() float StartHiding; //if bDarkHiding is true, vis value at which player becomes translucent
var() float EndHiding; //if bDarkHiding is true, vis value at which player becomes nontranslucent
var() float CloakEffect; //multiplicative scaleglow if cloak(or adaptive) is on
var bool bCustomizable; //Whether or not the gametype is customizable through the menu interface
var bool bStartWithPistol;
var int PistolShotsFired;
var int PistolShotsHit;
var float PistolAverageHitDamage;
var int StealthPistolShotsFired;
var int StealthPistolShotsHit;
var float StealthPistolAverageHitDamage;
var int AssaultRifleShotsFired;
var int AssaultRifleShotsHit;
var float AssaultRifleAverageHitDamage;
var int AssaultShotgunShotsFired;
var int AssaultShotgunShotsHit;
var float AssaultShotgunAverageHitDamage;
var int SawedOffShotgunShotsFired;
var int SawedOffShotgunShotsHit;
var float SawedOffShotgunAverageHitDamage;
var int SniperRifleShotsFired;
var int SniperRifleShotsHit;
var float SniperRifleAverageHitDamage;
var bool bCycleMap;
var bool bNewMap, bClientNewMap;
var float NewMapTime;
var bool bGameEnded;
var bool bAlreadyChanged;
var bool bSecondaryNotice;
var bool bSecondaryNsf;
var bool bSecondaryUnatco;
var bool bPrimaryNotice;
var bool bPrimaryNsf;
var bool bPrimaryUnatco;
var localized String TooManyPlayers;
var bool bFreezeScores; // Don't modify scoreArray if we are displaying end of game stats
var String PlayerName;
var float score;
var float deaths;
var float streak;
var int team;
var int PlayerID;
var ScoreElement scoreArray[32]; // Array to store the scores
var int scorePlayers; // Number of players in the current scoreArray
var color WhiteColor, SilverColor, RedColor, GreenColor, GoldColor;
var localized String StreakString, KillsString, DeathsString, PlayerString, NewMapSecondsString, WonMatchString;
var localized String EscapeString;
var localized String MatchEnd1String, MatchEnd2String;
var localized String TeamNsfString, TeamUnatcoString, TeamDrawString;
SkillsTotal=2000
SkillsAvail=2000
SkillsPerKill=2000
InitialAugs=2
AugsPerKill=2
ScoreToWin=20
VictoryCondition="Frags"
MPSkillStartLevel=1
CurrentMap="DXMP_Cmd"
fFriendlyFireMult=0.500000
bChangeLevels=True
bAutoInstall=True
bSpawnEffects=True
bAugsAllowed=True
EndHiding=0.010000
bCustomizable=True
TooManyPlayers="Too many players"
WhiteColor=(R=255,G=255,B=255)
SilverColor=(R=138,G=164,B=166)
RedColor=(R=255)
GreenColor=(G=255)
GoldColor=(R=255,G=255)
StreakString="Current Streak"
KillsString="Kills"
DeathsString="Deaths"
PlayerString="Player"
NewMapSecondsString=" seconds to new map."
WonMatchString=" has won the match!"
EscapeString="Press to disconnect."
MatchEnd1String="The match ended with "
MatchEnd2String=" taking out "
TeamNsfString="Team NSF"
TeamUnatcoString="Team Unatco"
TeamDrawString="The match is a draw!"
DefaultPlayerClass=Class'DeusEx.JCDentonMale'
bAlwaysRelevant=True

ApproveClass (class SpawnClass) -> bool


return true;

CanSpectate (pawn Viewer, actor ViewTarget) -> bool


return false;

ChangeTeam (Pawn PawnToChange, int NewTeam) -> bool


return Super.ChangeTeam(PawnToChange,NewTeam);

CheckPlayerConsole (PlayerPawn CheckPlayer)


if (DeusExPlayer(CheckPlayer) != None)
DeusExPlayer(CheckPlayer).VerifyConsole(Class'Engine.Console');

CheckPlayerWindow (PlayerPawn CheckPlayer)


if (DeusExPlayer(CheckPlayer) != None)
DeusExPlayer(CheckPlayer).VerifyRootWindow(Class'DeusEx.DeusExRootWindow');

ContinueMsg (GC gc, float screenWidth, float screenHeight)


local String str;
local float x, y, w, h;
local int t;


if ( bNewMap && !bClientNewMap)
{
NewMapTime = Level.Timeseconds + NewMapDelay - 0.5;
bClientNewMap = True;
}
t = int(NewMapTime - Level.Timeseconds);
if ( t < 0 )
t = 0;

str = t $ NewMapSecondsString;

gc.SetTextColor( WhiteColor );
gc.SetFont(Font'FontMenuTitle');
gc.GetTextExtent( 0, w, h, str );
x = (screenWidth * 0.5) - (w * 0.5);
y = screenHeight * FireContY;
gc.DrawText( x, y, w, h, str );

y += (h*2.0);
str = EscapeString;
gc.GetTextExtent( 0, w, h, str );
x = (screenWidth * 0.5) - (w * 0.5);
gc.DrawText( x, y, w, h, str );

DrawHeaders (GC gc, float screenWidth, float yoffset)


local float x, w, h, barLen;


// Player header
gc.GetTextExtent( 0, w, h, PlayerString );
x = screenWidth * PlayerX;
gc.DrawText( x, yoffset, w, h, PlayerString );

// Kills header
gc.GetTextExtent( 0, w, h, KillsString );
x = screenWidth * KillsX;
gc.DrawText( x, yoffset, w, h, KillsString );

// Deaths header
gc.GetTextExtent( 0, w, h, DeathsString );
x = screenWidth * DeathsX;
gc.DrawText( x, yoffset, w, h, DeathsString );

// Deaths header
gc.GetTextExtent( 0, w, h, StreakString );
x = screenWidth * StreakX;
gc.DrawText( x, yoffset, w, h, StreakString );

gc.SetTileColorRGB(255,255,255);
gc.DrawBox( PlayerX * screenWidth, yoffset+h, (x + w)-(PlayerX*screenWidth), 1, 0, 0, 1, Texture'Solid');

DrawNameAndScore (GC gc, ScoreElement se, float screenWidth, float yoffset)


local float x, w, h, w2, xoffset, killcx, deathcx, streakcx;
local String str;


// Draw Name
str = se.PlayerName;
gc.GetTextExtent( 0, w, h, str );
x = screenWidth * PlayerX;
gc.DrawText( x, yoffset, w, h, str );

// Draw Kills
str = "00";
gc.GetTextExtent( 0, w, h, KillsString );
killcx = screenWidth * KillsX + w * 0.5;
gc.GetTextExtent( 0, w, h, str );
str = int(se.Score) $ "";
gc.GetTextExtent( 0, w2, h, str );
x = killcx + (w * 0.5) - w2;
gc.DrawText( x, yoffset, w2, h, str );

// Draw Deaths
gc.GetTextExtent( 0, w2, h, DeathsString );
deathcx = screenWidth * DeathsX + w2 * 0.5;
str = int(se.Deaths) $ "";
gc.GetTextExtent( 0, w2, h, str );
x = deathcx + (w * 0.5) - w2;
gc.DrawText( x, yoffset, w2, h, str );

// Draw Streak
gc.GetTextExtent( 0, w2, h, StreakString );
streakcx = screenWidth * StreakX + w2 * 0.5;
str = int(se.Streak) $ "";
gc.GetTextExtent( 0, w2, h, str );
x = streakcx + (w * 0.5) - w2;
gc.DrawText( x, yoffset, w2, h, str );

EvaluatePlayerStart (Pawn Player, PlayerStart PointToEvaluate, optional byte InTeam) -> float


local bool bTooClose;
local DeusExPlayer OtherPlayer;
local Pawn CurPawn;
local float Dist;


bTooClose = False;

for (CurPawn = Level.PawnList; CurPawn != None; CurPawn = CurPawn.NextPawn)
{
OtherPlayer = DeusExPlayer(CurPawn);
if ((OtherPlayer != None) && (OtherPlayer != Player))
{
Dist = VSize(OtherPlayer.Location - PointToEvaluate.Location);
if (VSize(OtherPlayer.Location - PointToEvaluate.Location) < 100.0)
{
bTooClose = TRUE;
}
}
}

if (bTooClose)
return -100000;
else
return FRand();

FailConsoleCheck (PlayerPawn FailPlayer)


if (DeusExPlayer(FailPlayer) != None)
DeusExPlayer(FailPlayer).ForceDisconnect("Invalid Console class, disconnecting");

FailRootWindowCheck (PlayerPawn FailPlayer)


if (DeusExPlayer(FailPlayer) != None)
DeusExPlayer(FailPlayer).ForceDisconnect("Invalid RootWindow class, disconnecting");

FindPlayerStart (Pawn Player, optional byte InTeam, optional string incomingName) -> NavigationPoint


local PlayerStart Dest;
local PlayerStart BestDest;
local float BestWeight;
local float CurWeight;


BestWeight = -100001;
BestDest = None;

foreach AllActors( class 'PlayerStart', Dest )
{
if( Dest.bSinglePlayerStart && Dest.bEnabled )
{
CurWeight = EvaluatePlayerStart(Player,Dest,InTeam);
if (CurWeight > BestWeight)
{
BestDest = Dest;
BestWeight = CurWeight;
}
}
}

if (BestDest != None)
return BestDest;

// if none, reenable them all, and just pick one.
log("All single player starts were disabled, reenabling all");
foreach AllActors( class 'PlayerStart', Dest )
{
if( Dest.bSinglePlayerStart )
Dest.bEnabled = true;
}

foreach AllActors( class 'PlayerStart', Dest)
{
if( Dest.bSinglePlayerStart && Dest.bEnabled )
{
Dest.bEnabled = false;
return Dest;
}
}
log( "ERROR! No single player start found" );
return None;

GameOver


if (bTrackWeapons)
{
log("======>Pistol Stats. Shots: "$PistolShotsFired$", Hits: "$PistolShotsHit$", Damage: "$PistolAverageHitDamage);
log("======>StealthPistol Stats. Shots: "$StealthPistolShotsFired$", Hits: "$StealthPistolShotsHit$", Damage: "$StealthPistolAverageHitDamage);
log("======>AssaultRifle Stats. Shots: "$AssaultRifleShotsFired$", Hits: "$AssaultRifleShotsHit$", Damage: "$AssaultRifleAverageHitDamage);
log("======>AssaultShotgun Stats. Shots: "$AssaultShotgunShotsFired$", Hits: "$AssaultShotgunShotsHit$", Damage: "$AssaultShotgunAverageHitDamage);
log("======>SawedOffShotgun Stats. Shots: "$SawedOffShotgunShotsFired$", Hits: "$SawedOffShotgunShotsHit$", Damage: "$SawedOffShotgunAverageHitDamage);
log("======>SniperRifle Stats. Shots: "$SniperRifleShotsFired$", Hits: "$SniperRifleShotsHit$", Damage: "$SniperRifleAverageHitDamage);
}
bNewMap = True;
bCycleMap = True;
SetTimer( NewMapDelay, false );

GetBeaconText -> string


local string Result;

Result = Super.GetBeaconText();
Result = Result $ " (" $ NumPlayers $ "/" $ MaxPlayers $ ")";
return Result;

GetRules -> string


local string ResultSet;


ResultSet = "";

ResultSet = ResultSet $ "\\SkillsAvail\\" $ SkillsAvail;
ResultSet = ResultSet $ "\\SkillsPerKill\\" $ SkillsPerKill;

if (bAugsAllowed)
{
ResultSet = ResultSet $ "\\InitialAugs\\" $ InitialAugs;
ResultSet = ResultSet $ "\\AugsPerKill\\" $ AugsPerKill;
}
else
ResultSet = ResultSet $ "\\AugsAllowed\\" $ bAugsAllowed;

if (VictoryCondition ~= "Frags")
ResultSet = ResultSet $ "\\KillsToWin\\" $ ScoreToWin;
else if (VictoryCondition ~= "Time")
ResultSet = ResultSet $ "\\TimeToWin\\" $ ScoreToWin;

ResultSet = ResultSet $ Super.GetRules();

return ResultSet;

GrantAugs (DeusExPlayer Player, int NumAugs)


Player.GrantAugs(NumAugs);

HandleDeathNotification (Pawn killer, Pawn killee)


local bool killedSelf, valid;


killedSelf = (killer == killee);

if (( killee != None ) && killee.IsA('DeusExPlayer'))
{
valid = DeusExPlayer(killee).killProfile.bValid;

if ( killedSelf )
valid = False;

DeusExPlayer(killee).MultiplayerDeathMsg( killer, killedSelf, valid, DeusExPlayer(killee).killProfile.name, DeusExPlayer(killee).killProfile.methodStr );
}

Killed (pawn Killer, pawn Other, name damageType)


local bool NotifyDeath;
local DeusExPlayer otherPlayer;
local Pawn CurPawn;


if ( bFreezeScores )
return;

NotifyDeath = False;

// Record the death no matter what, and reset the streak counter
if ( Other.bIsPlayer )
{
otherPlayer = DeusExPlayer(Other);
Other.PlayerReplicationInfo.Deaths += 1;
Other.PlayerReplicationInfo.Streak = 0;
// Penalize the player that commits suicide by losing a kill, but don't take them below zero
if ((Killer == Other) || (Killer == None))
{
if ( Other.PlayerReplicationInfo.Score > 0 )
{
if (( DeusExProjectile(otherPlayer.myProjKiller) != None ) && DeusExProjectile(otherPlayer.myProjKiller).bAggressiveExploded )
{
// Don't dock them if it nano exploded in their face
}
else
Other.PlayerReplicationInfo.Score -= 1;
}
}
NotifyDeath = True;
}

//both players...
if ((Killer.bIsPlayer) && (Other.bIsPlayer))
{
//Add to console log as well (with pri id) so that kick/kickban can work better
log(Killer.PlayerReplicationInfo.PlayerName$"("$Killer.PlayerReplicationInfo.PlayerID$") killed "$Other.PlayerReplicationInfo.PlayerName $ otherPlayer.killProfile.methodStr);
for (CurPawn = Level.PawnList; CurPawn != None; CurPawn = CurPawn.NextPawn)
{
if ((CurPawn.IsA('DeusExPlayer')) && (DeusExPlayer(CurPawn).bAdmin))
DeusExPlayer(CurPawn).LocalLog(Killer.PlayerReplicationInfo.PlayerName$"("$Killer.PlayerReplicationInfo.PlayerID$") killed "$Other.PlayerReplicationInfo.PlayerName $ otherPlayer.killProfile.methodStr);
}

if ( otherPlayer.killProfile.methodStr ~= "None" )
BroadcastMessage(Killer.PlayerReplicationInfo.PlayerName$" killed "$Other.PlayerReplicationInfo.PlayerName$".",false,'DeathMessage');
else
BroadcastMessage(Killer.PlayerReplicationInfo.PlayerName$" killed "$Other.PlayerReplicationInfo.PlayerName $ otherPlayer.killProfile.methodStr, false, 'DeathMessage');

if (Killer != Other)
{
// Penalize for killing your teammates
if ((TeamDMGame(Self) != None) && (TeamDMGame(Self).ArePlayersAllied(DeusExPlayer(Other),DeusExPlayer(Killer))))
{
if ( Killer.PlayerReplicationInfo.Score > 0 )
Killer.PlayerReplicationInfo.Score -= 1;
DeusExPlayer(Killer).MultiplayerNotifyMsg( DeusExPlayer(Killer).MPMSG_KilledTeammate, 0, "" );
}
else
{
// Grant the kill to the killer, and increase his streak
Killer.PlayerReplicationInfo.Score += 1;
Killer.PlayerReplicationInfo.Streak += 1;

Reward(Killer);

// Check for victory conditions and end the match if need be
if ( DeathMatchGame(Self) != None )
{
if ( DeathMatchGame(Self).CheckVictoryConditions(Killer, Other, otherPlayer.killProfile.methodStr) )
{
bFreezeScores = True;
NotifyDeath = False;
}
}
if ( TeamDMGame(Self) != None )
{
if ( TeamDMGame(Self).CheckVictoryConditions(Killer, Other, otherPlayer.killProfile.methodStr) )
{
bFreezeScores = True;
NotifyDeath = False;
}
}
}
}
if ( NotifyDeath )
HandleDeathNotification( Killer, Other );
}
else
{
if (NotifyDeath)
HandleDeathNotification( Killer, Other );

Super.Killed(Killer,Other,damageType);
}

Login (string Portal, string Options, out string Error, class SpawnClass) -> PlayerPawn


local PlayerPawn newPlayer;
local DeusExPlayer dxPlayer;


if ((MaxPlayers > 0) && (NumPlayers >= MaxPlayers) )
{
Error = TooManyPlayers;
return None;
}

newPlayer = Super.Login(Portal, Options, Error, SpawnClass);

newPlayer.bAutoActivate = true;

return newPlayer;

Logout (pawn Exiting)


local DeusExPlayer ExitingPlayer;
local Computers CompActor;


ExitingPlayer = DeusExPlayer(Exiting);
if (ExitingPlayer != None)
{
foreach AllActors(class'Computers',CompActor)
{
if ((CompActor.CurFrobber != None) && (CompActor.CurFrobber == ExitingPlayer))
{
log("====>Player logged out while logged in, forcing computer closed");
ExitingPlayer.CloseComputerScreen(CompActor);
}
}
}

Super.Logout(Exiting);

NotifyGameStatus (int param, String winningStr, bool bTimeCondition, bool bPrimary)


local Pawn curPawn;


if (( TeamDMGame(Self) != None ) && (VictoryCondition ~= "Frags"))
{
if ( bPrimary )
{
if ( winningStr ~= TeamNsfString )
{
if ( bPrimaryNsf )
return;
else
bPrimaryNsf = True;
}
if ( winningStr ~= TeamUnatcoString )
{
if ( bPrimaryUnatco )
return;
else
bPrimaryUnatco = True;
}
}
else
{
if ( winningStr ~= TeamNsfString )
{
if ( bSecondaryNsf )
return;
else
bSecondaryNsf = True;
}
if ( winningStr ~= TeamUnatcoString )
{
if ( bSecondaryUnatco )
return;
else
bSecondaryUnatco = True;
}
}
}
else
{
if ( bPrimary )
{
if ( bPrimaryNotice )
return;
else
bPrimaryNotice = True;
}
else
{
if ( bSecondaryNotice )
return;
else
bSecondaryNotice = True;
}
}

for ( curPawn = Level.PawnList; curPawn != None; curPawn = curPawn.nextPawn )
{
if ( curPawn.IsA('DeusExPlayer') )
{
if ( bTimeCondition )
DeusExPlayer(curPawn).MultiplayerNotifyMsg( DeusExPlayer(curPawn).MPMSG_TimeNearEnd, param, winningStr );
else
DeusExPlayer(curPawn).MultiplayerNotifyMsg( DeusExPlayer(curPawn).MPMSG_CloseKills, param, winningStr );
}
}

PostLogin (playerpawn NewPlayer)


local DeusExPlayer DXPlayer;


DXPlayer = DeusExPlayer(NewPlayer);

log("class of new player is "$DXPlayer.Class$", class of game is "$Class$".");
// DEUS_EX AMSD Setup abilities now called when server syncs up with options.
// SetupAbilities(DXPlayer);

// MB I tried putting this in postbeginplay and postpostbeginplay, but PlayerIsListenClient failed to do the right thing at that point
if ( DXPlayer.PlayerIsListenClient() )
{
DXPlayer.CreatePlayerTracker();
if (DXPlayer.ThemeManager == NONE)
{
DXPlayer.CreateColorThemeManager();
DXPlayer.ThemeManager.SetOwner( DXPlayer );
DXPlayer.ThemeManager.SetCurrentHUDColorTheme(DXPlayer.ThemeManager.GetFirstTheme(1));
DXPlayer.ThemeManager.SetCurrentMenuColorTheme(DXPlayer.ThemeManager.GetFirstTheme(0));
DXPlayer.ThemeManager.SetMenuThemeByName(DXPlayer.MenuThemeName);
DXPlayer.ThemeManager.SetHUDThemeByName(DXPlayer.HUDThemeName);
DeusExRootWindow(DXPlayer.rootWindow).ChangeStyle();
}
DXPlayer.ReceiveFirstOptionSync(DXPlayer.AugPrefs[0], DXPlayer.AugPrefs[1], DXPlayer.AugPrefs[2], DXPlayer.AugPrefs[3], DXPlayer.AugPrefs[4]);
DXPlayer.ReceiveSecondOptionSync(DXPlayer.AugPrefs[5], DXPlayer.AugPrefs[6], DXPlayer.AugPrefs[7], DXPlayer.AugPrefs[8]);
DXPlayer.ShieldStatus = SS_Off;
}
Super.PostLogin(NewPlayer);

PreGameOver


local Computers comp;


// Close out any computer screens
foreach AllActors( class'Computers', comp )
{
if ((comp != None ) && ( comp.curFrobber != None ))
{
// This is for the client
comp.curFrobber.CloseThisComputer( comp );
// This is for the server
comp.curFrobber.CloseComputerScreen( comp );
}
}

RefreshScoreArray (DeusExPlayer player)


local PlayerReplicationInfo lpri;
local PlayerPawn pp;
local int i;


pp = player.GetPlayerPawn();
if ( pp == None )
return;

scorePlayers = 0;

for ( i = 0; i < 32; i++ )
{
if ( pp.GameReplicationInfo.PRIArray[i] != None )
{
lpri = pp.GameReplicationInfo.PRIArray[i];
if ( !lpri.bIsSpectator || lpri.bWaitingPlayer )
{
scoreArray[scorePlayers].PlayerName = lpri.PlayerName;
scoreArray[scorePlayers].score = lpri.Score;
scoreArray[scorePlayers].deaths = lpri.Deaths;
scoreArray[scorePlayers].streak = lpri.Streak;
scoreArray[scorePlayers].team = lpri.Team;
scoreArray[scorePlayers].PlayerID = lpri.PlayerID;
scorePlayers += 1;
if ( scorePlayers == ArrayCount(scoreArray) )
break;
}
}
}

ResetNonCustomizableOptions

RestartPlayer (pawn aPlayer) -> bool


local DeusExPlayer PlayerToRestart;
local bool SuperResult;


log("DeusEx Multiplayer Game restart player");
PlayerToRestart = DeusExPlayer(aPlayer);

if (PlayerToRestart == None)
{
log("Trying to restart non Deus Ex player!");
return false;
}

//Restore HUD
PlayerToRestart.ShowHud(True);
//Clear Augmentations
PlayerToRestart.AugmentationSystem.ResetAugmentations();
//Clear Skills
PlayerToRestart.SkillSystem.ResetSkills();

//DEUS_EX AMSD For some reason, reset player to defaults doesn't do all of the spiffy things that it should...
//so some of it will be doneon the side
PlayerToRestart.ResetPlayerToDefaults();

SuperResult = Super.RestartPlayer(aPlayer);

//Restore Augs
PlayerToRestart.ClearAugmentationDisplay();
PlayerToRestart.AugmentationSystem.CreateAugmentations(PlayerToRestart);
PlayerToRestart.AugmentationSystem.AddDefaultAugmentations();
//Restore Bio-Energy
PlayerToRestart.Energy = PlayerToRestart.EnergyMax;
//Restore Skills
PlayerToRestart.SkillSystem.CreateSkills(PlayerToRestart);
//Replace with skill points based on game info.
SetupAbilities(PlayerToRestart);

PlayerToRestart.myProjKiller = None;

return SuperResult;

Reward (pawn Rewardee)


local DeusExPlayer PlayerToReward;


PlayerToReward = DeusExPlayer(Rewardee);
if (PlayerToReward != None)
{
// MB Removed some of this so it's not quite so cluttered
// if (SkillsPerKill > 0)
// PlayerToReward.ClientMessage("Rewarding you with "$SkillsPerKill$" skill points.");
PlayerToReward.SkillPointsAdd(SkillsPerKill);
// if (GlobalUpgradesPerKill > 0)
// PlayerToReward.ClientMessage("Raising all augmentations by "$GlobalUpgradesPerKill$".");

// Took this out because we are now always level 4 augs : MBCODE
// PlayerToReward.AugmentationSystem.IncreaseAllAugs(GlobalUpgradesPerKill);

if ((AugsPerKill > 0) && (bAugsAllowed))
{
// PlayerToReward.ClientMessage("Granting additional augmentations");
GrantAugs(PlayerToReward, AugsPerKill);
}
}

SetupAbilities (DeusExPlayer aPlayer)


if (aPlayer == None)
return;

aPlayer.SkillPointsAvail = SkillsAvail;
aPlayer.SkillPointsAvail = SkillsAvail;

if (bAugsAllowed)
GrantAugs(aPlayer, InitialAugs);

SortScores


local PlayerReplicationInfo tmpri;
local int i, j, max;
local ScoreElement tmpSE;


for ( i = 0; i < scorePlayers-1; i++ )
{
max = i;
for ( j = i+1; j < scorePlayers; j++ )
{
if ( scoreArray[j].score > scoreArray[max].score )
max = j;
else if (( scoreArray[j].score == scoreArray[max].score) && (scoreArray[j].deaths < scoreArray[max].deaths))
max = j;
}
tmpSE = scoreArray[max];
scoreArray[max] = scoreArray[i];
scoreArray[i] = tmpSE;
}

Tick (float deltaTime)


local bool bCheck;
local float timeLimit, notifySec;


bCheck = False;

if ( Role == ROLE_Authority )
{
timeLimit = float(ScoreToWin)*60.0;
notifySec = timeLimit - NotifyMinutes * 60.0;

bCheck = ((VictoryCondition ~= "Time") && (((Level.Timeseconds>timeLimit) && !bCycleMap) || ((Level.Timeseconds>notifySec) && ( timeLimit > NotifyMinutes*60.0*2.0 ) && !bPrimaryNotice)));

if ( bCheck )
{
// Check for victory conditions and end the match if need be
if ( DeathMatchGame(Self) != None )
DeathMatchGame(Self).CheckVictoryConditions( None, None, "" );
if ( TeamDMGame(Self) != None )
TeamDMGame(Self).CheckVictoryConditions( None, None, "" );
}
}
Super.Tick( deltaTime );

Timer


local string URLstr;
local DXMapList mapList;


if ( bCycleMap )
{
mapList = Spawn(class'DXMapList');
URLstr = mapList.GetNextMap();
mapList.Destroy();
bCycleMap = False;
Level.ServerTravel( URLstr, False );
bFreezeScores = False;
}

TrackAssaultRifle (WeaponAssaultGun AssaultRifleUsed, float RawDamage)


AssaultRifleShotsFired++;
if (RawDamage > 0)
{
AssaultRifleShotsHit++;
AssaultRifleAverageHitDamage = (AssaultRifleAverageHitDamage*(AssaultRifleShotsHit - 1) + RawDamage)/AssaultRifleShotsHit;
}

TrackAssaultShotgun (WeaponAssaultShotgun AssaultShotgunUsed, float RawDamage)


AssaultShotgunShotsFired++;
if (RawDamage > 0)
{
AssaultShotgunShotsHit++;
AssaultShotgunAverageHitDamage = (AssaultShotgunAverageHitDamage*(AssaultShotgunShotsHit - 1) + RawDamage)/AssaultShotgunShotsHit;
}

TrackPistol (WeaponPistol PistolUsed, float RawDamage)


PistolShotsFired++;
if (RawDamage > 0)
{
PistolShotsHit++;
PistolAverageHitDamage = (PistolAverageHitDamage*(PistolShotsHit - 1) + RawDamage)/PistolShotsHit;
}

TrackSawedOffShotgun (WeaponSawedOffShotgun SawedOffShotgunUsed, float RawDamage)


SawedOffShotgunShotsFired++;
if (RawDamage > 0)
{
SawedOffShotgunShotsHit++;
SawedOffShotgunAverageHitDamage = (SawedOffShotgunAverageHitDamage*(SawedOffShotgunShotsHit - 1) + RawDamage)/SawedOffShotgunShotsHit;
}

TrackSniperRifle (WeaponRifle SniperRifleUsed, float RawDamage)


SniperRifleShotsFired++;
if (RawDamage > 0)
{
SniperRifleShotsHit++;
SniperRifleAverageHitDamage = (SniperRifleAverageHitDamage*(SniperRifleShotsHit - 1) + RawDamage)/SniperRifleShotsHit;
}

TrackStealthPistol (WeaponStealthPistol StealthPistolUsed, float RawDamage)


StealthPistolShotsFired++;
if (RawDamage > 0)
{
StealthPistolShotsHit++;
StealthPistolAverageHitDamage = (StealthPistolAverageHitDamage*(StealthPistolShotsHit - 1) + RawDamage)/StealthPistolShotsHit;
}

TrackWeapon (DeusExWeapon WeaponUsed, float RawDamage)


if (!bTrackWeapons)
return;

if (WeaponUsed.IsA('WeaponPistol'))
TrackPistol(WeaponPistol(WeaponUsed),RawDamage);

else if (WeaponUsed.IsA('WeaponStealthPistol'))
TrackStealthPistol(WeaponStealthPistol(WeaponUsed),RawDamage);

else if (WeaponUsed.IsA('WeaponAssaultGun'))
TrackAssaultRifle(WeaponAssaultGun(WeaponUsed),RawDamage);

else if (WeaponUsed.IsA('WeaponAssaultShotgun'))
TrackAssaultShotgun(WeaponAssaultShotgun(WeaponUsed),RawDamage);

else if (WeaponUsed.IsA('WeaponRifle'))
TrackSniperRifle(WeaponRifle(WeaponUsed),RawDamage);

else if (WeaponUsed.IsA('WeaponSawedOffShotgun'))
TrackSawedOffShotgun(WeaponSawedOffShotgun(WeaponUsed),RawDamage);




DeusExMover.uc (extends Mover)

var() bool bOneWay; // this door can only be opened from one side
var() bool bLocked; // this door is locked
var() bool bPickable; // this lock can be picked
var() float lockStrength; // "toughness" of the lock on this door - 0.0 is easy, 1.0 is hard
var() float initiallockStrength; // for resetting lock, initial lock strength of door.
var() bool bInitialLocked; // for resetting lock
var() bool bBreakable; // this door can be destroyed
var() float doorStrength; // "toughness" of this door - 0.0 is weak, 1.0 is strong
var() name KeyIDNeeded; // key ID code to open the door
var() bool bHighlight; // should this door highlight when focused?
var() bool bFrobbable; // this door can be frobbed
var bool bPicking; // a lockpick is currently being used
var float pickValue; // how much this lockpick is currently picking
var float pickTime; // how much time it takes to use a single lockpick
var int numPicks; // how many times to reduce hack strength
var float TicksSinceLastPick; //num ticks done since last pickstrength update(includes partials)
var float TicksPerPick; // num ticks needed for a hackstrength update (includes partials)
var float LastTickTime; // Time at which last tick occurred.
var DeusExPlayer pickPlayer; // the player that is picking
var Lockpick curPick; // the lockpick that is being used
var() int minDamageThreshold; // damage below this amount doesn't count
var bool bDestroyed; // has this mover already been destroyed?
var() int NumFragments; // number of fragments to spew on destroy
var() float FragmentScale; // scale of fragments
var() int FragmentSpread; // distance fragments will be thrown
var() class FragmentClass; // which fragment
var() texture FragmentTexture; // what texture to use on fragments
var() bool bFragmentTranslucent; // are these fragments translucent?
var() bool bFragmentUnlit; // are these fragments unlit?
var() sound ExplodeSound1; // small explosion sound
var() sound ExplodeSound2; // large explosion sound
var() bool bDrawExplosion; // should we draw an explosion?
var() bool bIsDoor; // is this mover an actual door?
var() float TimeSinceReset; // how long since we relocked it
var() float TimeToReset; // how long between relocks
var localized string msgKeyLocked; // message when key locked door
var localized string msgKeyUnlocked; // message when key unlocked door
var localized string msgLockpickSuccess; // message when lock is picked
var localized string msgOneWayFail; // message when one-way door can't be opened
var localized string msgLocked; // message when the door is locked
var localized string msgPicking; // message when the door is being picked
var localized string msgAlreadyUnlocked; // message when the door is already unlocked
var localized string msgNoNanoKey; // message when the player doesn't have the right nanokey
bPickable=True
lockStrength=0.200000
doorStrength=0.250000
bHighlight=True
bFrobbable=True
pickTime=4.000000
minDamageThreshold=10
NumFragments=16
FragmentScale=2.000000
FragmentSpread=32
FragmentClass=Class'DeusEx.WoodFragment'
ExplodeSound1=Sound'DeusExSounds.Generic.WoodBreakSmall'
ExplodeSound2=Sound'DeusExSounds.Generic.WoodBreakLarge'
TimeToReset=28.000000
msgKeyLocked="Your NanoKey Ring locked it"
msgKeyUnlocked="Your NanoKey Ring unlocked it"
msgLockpickSuccess="You picked the lock"
msgOneWayFail="It won't open from this side"
msgLocked="It's locked"
msgPicking="Picking the lock..."
msgAlreadyUnlocked="It's already unlocked"
msgNoNanoKey="Your NanoKey Ring doesn't have the right code"
MoverEncroachType=ME_StopWhenEncroach
BumpType=BT_PawnBump
bBlockSight=True
InitialState=TriggerToggle
bDirectional=True

BlowItUp (Pawn instigatedBy)


local int i;
local Fragment frag;
local Actor A;
local DeusExDecal D;
local Vector spawnLoc;
local ExplosionLight light;


// force the mover to stop
if (Leader != None)
Leader.MakeGroupStop();

Instigator = instigatedBy;

// trigger our event
if (Event != '')
foreach AllActors(class'Actor', A, Event)
if (A != None)
A.Trigger(Self, instigatedBy);

// destroy all effects that are on us
foreach BasedActors(class'DeusExDecal', D)
D.Destroy();

DropThings();

// get the origin of the mover
spawnLoc = Location - (PrePivot >> Rotation);

// spawn some fragments and make a sound
for (i=0; i {
frag = Spawn(FragmentClass,,, spawnLoc + FragmentSpread * VRand());
if (frag != None)
{
frag.Instigator = instigatedBy;

// make the last fragment just drop down so we have something to attach the sound to
if (i == NumFragments - 1)
frag.Velocity = vect(0,0,0);
else
frag.CalcVelocity(VRand(), FragmentSpread);

frag.DrawScale = FragmentScale;
if (FragmentTexture != None)
frag.Skin = FragmentTexture;
if (bFragmentTranslucent)
frag.Style = STY_Translucent;
if (bFragmentUnlit)
frag.bUnlit = True;
}
}

// should we draw explosion effects?
if (bDrawExplosion)
{
light = Spawn(class'ExplosionLight',,, spawnLoc);
if (FragmentSpread < 64)
{
Spawn(class'ExplosionSmall',,, spawnLoc);
if (light != None)
light.size = 2;
}
else if (FragmentSpread < 128)
{
Spawn(class'ExplosionMedium',,, spawnLoc);
if (light != None)
light.size = 4;
}
else
{
Spawn(class'ExplosionLarge',,, spawnLoc);
if (light != None)
light.size = 8;
}
}

// alert NPCs that I'm breaking
AISendEvent('LoudNoise', EAITYPE_Audio, 2.0, FragmentSpread * 16);

MakeNoise(2.0);
if (frag != None)
{
if (NumFragments <= 5)
frag.PlaySound(ExplodeSound1, SLOT_None, 2.0,, FragmentSpread*256);
else
frag.PlaySound(ExplodeSound2, SLOT_None, 2.0,, FragmentSpread*256);
}

//DEUS_EX AMSD Mover is dead, make it a dumb proxy so location updates
RemoteRole = ROLE_DumbProxy;
SetLocation(Location+vect(0,0,20000)); // move it out of the way
SetCollision(False, False, False); // and make it non-colliding
bDestroyed = True;

ComputeMovementArea (out vector center, out vector area)


local int i, j;
local float mult;
local int count;
local vector box1, box2;
local vector minVect;
local vector maxVect;
local vector newLocation;
local rotator newRotation;


if (NumKeys > 0) // better safe than silly
{
// Initialize our bounding box
GetBoundingBox(box1, box2, false, KeyPos[0]+BasePos, KeyRot[0]+BaseRot);

// Compute the total area of our bounding box
for (i=1; i {
if (KeyRot[i] == KeyRot[i-1])
count = 1;
else
count = 3;
for (j=0; j {
mult = float(j+1)/count;
newLocation = BasePos + (KeyPos[i]-KeyPos[i-1])*mult + KeyPos[i-1];
newRotation = BaseRot + (KeyRot[i]-KeyRot[i-1])*mult + KeyRot[i-1];
if (GetBoundingBox(minVect, maxVect, false, newLocation, newRotation))
{
// Expand the bounding box
box1.X = FMin(FMin(box1.X, maxVect.X), minVect.X);
box1.Y = FMin(FMin(box1.Y, maxVect.Y), minVect.Y);
box1.Z = FMin(FMin(box1.Z, maxVect.Z), minVect.Z);
box2.X = FMax(FMax(box2.X, maxVect.X), minVect.X);
box2.Y = FMax(FMax(box2.Y, maxVect.Y), minVect.Y);
box2.Z = FMax(FMax(box2.Z, maxVect.Z), minVect.Z);
}
}
}
}

// Fallback
else
{
box1 = vect(0,0,0);
box2 = vect(0,0,0);
}

// Compute center/area of the bounding box and return
center = (box1+box2)/2;
area = box2 - center;


DoOpen


local DeusExMover M;

if (Level.NetMode != NM_Standalone)
{
// In multiplayer, unlock doors that get opened.
// toggle the lock state for all like-tagged movers at once (for double doors and such)
bLocked = false;
TimeSinceReset = 0;
lockStrength = 0.0;
if ((Tag != '') && (Tag != 'DeusExMover'))
foreach AllActors(class'DeusExMover', M, Tag)
if (M != Self)
{
M.bLocked = false;
M.TimeSinceReset = 0;
M.lockStrength = 0;
}
}
Super.DoOpen();

DropThings


local actor A;


// drop everything that is on us
foreach BasedActors(class'Actor', A)
A.SetPhysics(PHYS_Falling);

FinishNotify


local Pawn curPawn;
local vector box1, box2;
local vector center, area;
local float distX, distY, distZ;
local float maxX, maxY, maxZ;
local float dist;
local float maxDist;
local vector tempVect;
local bool bNotify;


Super.FinishNotify();

if ((NumKeys > 0) && (MoverEncroachType == ME_IgnoreWhenEncroach))
{
GetBoundingBox(box1, box2, false, KeyPos[KeyNum]+BasePos, KeyRot[KeyNum]+BaseRot);
center = (box1+box2)/2;
area = box2 - center;
maxDist = VSize(area)+200;
// XXXDEUS_EX AMSD Slow Pawn Iterator
//foreach RadiusActors(Class'Pawn', curPawn, maxDist)
for (CurPawn = Level.PawnList; CurPawn != None; CurPawn = CurPawn.NextPawn)
{
if ((CurPawn != None) && (VSize(CurPawn.Location - Location) < (MaxDist + CurPawn.CollisionRadius)))
{
bNotify = false;
distZ = Abs(center.Z - curPawn.Location.Z);
maxZ = area.Z + curPawn.CollisionHeight;
if (distZ < maxZ)
{
distX = Abs(center.X - curPawn.Location.X);
distY = Abs(center.Y - curPawn.Location.Y);
maxX = area.X + curPawn.CollisionRadius;
maxY = area.Y + curPawn.CollisionRadius;
if ((distX < maxX) && (distY < maxY))
{
if ((distX >= area.X) && (distY >= area.Y))
{
tempVect.X = distX-area.X;
tempVect.Y = distY-area.Y;
tempVect.Z = 0;
if (VSize(tempVect) < CollisionRadius)
bNotify = true;
}
else
bNotify = true;
}
}
if (bNotify)
curPawn.EncroachedByMover(self);
}
}
}

Frob (Actor Frobber, Inventory frobWith)


local Pawn P;
local DeusExPlayer Player;
local bool bOpenIt, bDone;
local string msg;
local Vector X, Y, Z;
local float dotp;
local DeusExMover M;


// if we shouldn't be frobbed, get out
if (!bFrobbable)
return;

// if we are destroyed, don't do anything
if (bDestroyed)
return;

// make sure we frob our leader if we are a slave
if (bSlave)
if (Leader != None)
Leader.Frob(Frobber, frobWith);

P = Pawn(Frobber);
Player = DeusExPlayer(P);
bOpenIt = False;
bDone = False;
msg = msgLocked;

// make sure someone is trying to open the door
if (P == None)
return;

// ugly hack, so animals can't open doors
if (P.IsA('Animal'))
return;

// Let any non-player pawn open any door for now
if (Player == None)
{
bOpenIt = True;
msg = "";
bDone = True;
}

// If we are already trying to pick it, print a message
if (bPicking)
{
msg = msgPicking;
bDone = True;
}

// If the door is not closed, it can always be closed no matter what
if ((KeyNum != 0) || (PrevKeyNum != 0))
{
bOpenIt = True;
msg = "";
bDone = True;
}

// check to see if this is a one-way door
if (!bDone && bOneWay)
{
GetAxes(Rotation, X, Y, Z);
dotp = (Location - Frobber.Location) dot X;

// if we're on the wrong side of the door, then don't open
if (dotp > 0.0)
{
bOpenIt = False;
msg = msgOneWayFail;
bDone = True;
}
}

//
// If the door is locked, the player must do one of the following to open it
// without triggers or explosions:
// 1. Use the KeyIDNeeded
// 2. Use the Lockpick and SkillLockpicking
//
if (!bDone)
{
// Get what's in the player's hand
if (frobWith != None)
{
// check for the use of lockpicks
if (bPickable && frobWith.IsA('Lockpick') && (Player.SkillSystem != None))
{
if (bLocked)
{
// alert NPCs that I'm messing with stuff
AIStartEvent('MegaFutz', EAITYPE_Visual);

pickValue = Player.SkillSystem.GetSkillLevelValue(class'SkillLockpicking');
pickPlayer = Player;
curPick = LockPick(frobWith);
curPick.bBeingUsed = True;
curPick.PlayUseAnim();
bPicking = True;
//DEUS_EX AMSD In multiplayer, slow it down further at low skill levels
numPicks = PickValue * 100;
if (Level.Netmode != NM_Standalone)
pickTime = default.pickTime / (pickValue * pickValue);
TicksPerPick = (PickTime * 10.0) / numPicks;
LastTickTime = Level.TimeSeconds;
TicksSinceLastPick = 0;
SetTimer(0.1, True);
msg = msgPicking;
}
else
{
msg = msgAlreadyUnlocked;
}
}
else if ((KeyIDNeeded != '') && frobWith.IsA('NanoKeyRing') && (lockStrength > 0.0))
{
// check for the correct key use
NanoKeyRing(frobWith).PlayUseAnim();
if (NanoKeyRing(frobWith).HasKey(KeyIDNeeded))
{
bLocked = !bLocked; // toggle the lock state
TimeSinceReset = 0;

// toggle the lock state for all like-tagged movers at once (for double doors and such)
if ((Tag != '') && (Tag != 'DeusExMover'))
foreach AllActors(class'DeusExMover', M, Tag)
if (M != Self)
{
M.bLocked = !M.bLocked;
M.TimeSinceReset = 0;
}

bOpenIt = False;
if (bLocked)
msg = msgKeyLocked;
else
msg = msgKeyUnlocked;
}
else if (bLocked)
{
bOpenIt = False;
msg = msgNoNanoKey;
}
else
{
msg = msgAlreadyUnlocked;
}
}
else if (!bLocked)
{
bOpenIt = True;
msg = "";
}
}
else if (!bLocked)
{
bOpenIt = True;
msg = "";
}
}

// give the player a message
if ((Player != None) && (msg != ""))
Player.ClientMessage(msg);

// open it!
if (bOpenIt)
{
Super.Frob(Frobber, frobWith);
Trigger(Frobber, P);

// trigger all like-tagged movers at once (for double doors and such)
if ((Tag != '') && (Tag != 'DeusExMover'))
foreach AllActors(class'DeusExMover', M, Tag)
if (M != Self)
M.Trigger(Frobber, P);
}

PostBeginPlay


Super.PostBeginPlay();

// keep these within limits
lockStrength = FClamp(lockStrength, 0.0, 1.0);
doorStrength = FClamp(doorStrength, 0.0, 1.0);

if (!bPickable)
lockStrength = 1.0;
if (!bBreakable)
doorStrength = 1.0;

initiallockStrength = lockStrength;
TimeSinceReset = 0.0;
bInitialLocked = bLocked;

StopPicking


// alert NPCs that I'm not messing with stuff anymore
AIEndEvent('MegaFutz', EAITYPE_Visual);
bPicking = False;
if (curPick != None)
{
curPick.StopUseAnim();
curPick.bBeingUsed = False;
curPick.UseOnce();
}
curPick = None;
SetTimer(0.1, False);

SupportActor (Actor standingActor)


local float zVelocity;
local float baseMass;
local float standingMass;


zVelocity = standingActor.Velocity.Z;
// We've been stomped!
if (zVelocity < -500)
{
standingMass = FMax(1, standingActor.Mass);
baseMass = FMax(1, Mass);
TakeDamage((1 - standingMass/baseMass * zVelocity/30),
standingActor.Instigator, standingActor.Location, 0.2*standingActor.Velocity, 'stomped');
}

if (!bDestroyed)
standingActor.SetBase(self);
else
standingActor.SetPhysics(PHYS_Falling);

TakeDamage (int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)


if (bDestroyed)
return;

if ((damageType == 'TearGas') || (damageType == 'PoisonGas') || (damageType == 'HalonGas'))
return;

if ((damageType == 'Stunned') || (damageType == 'Radiation'))
return;

if ((DamageType == 'EMP') || (DamageType == 'NanoVirus') || (DamageType == 'Shocked'))
return;

if (bBreakable)
{
// add up the damage
if (Damage >= minDamageThreshold)
doorStrength -= Damage * 0.01;
// else
// doorStrength -= Damage * 0.001; // damage below the threshold does 1/10th the damage

doorStrength = FClamp(doorStrength, 0.0, 1.0);
if (doorStrength ~= 0.0)
BlowItUp(instigatedBy);
}

Tick (float deltaTime)


TimeSinceReset = TimeSinceReset + deltaTime;
//only reset in multiplayer, if we aren't picking it, and if it has been completely unlocked
if ((!bPicking) && (Level.NetMode != NM_Standalone) && (lockStrength == 0.0) && !(bLocked))
{
if (TimeSinceReset > TimeToReset)
{
lockStrength = initiallockStrength;
TimeSinceReset = 0.0;
if (lockStrength > 0)
{
//Force door closed and locked appropriately.
DoClose();
bLocked = bInitialLocked;
}
}
}
// In multi, force it closed if locked. Keep trying until it closes.
if ((Level.NetMode != NM_Standalone) && (bLocked) && (KeyNum != 0))
DoClose();
Super.Tick(deltaTime);

Timer


local DeusExMover M;


if (bPicking)
{
curPick.PlayUseAnim();

TicksSinceLastPick += (Level.TimeSeconds - LastTickTime) * 10;
LastTickTime = Level.TimeSeconds;
//TicksSinceLastPick = TicksSinceLastPick + 1;
while (TicksSinceLastPick > TicksPerPick)
{
numPicks--;
lockStrength -= 0.01;
TicksSinceLastPick = TicksSinceLastPick - TicksPerPick;
lockStrength = FClamp(lockStrength, 0.0, 1.0);
}

// pick all like-tagged movers at once (for double doors and such)
if ((Tag != '') && (Tag != 'DeusExMover'))
foreach AllActors(class'DeusExMover', M, Tag)
if (M != Self)
M.lockStrength = lockStrength;

// did we unlock it?
if (lockStrength ~= 0.0)
{
lockStrength = 0.0;
bLocked = False;
TimeSinceReset = 0.0;

// unlock all like-tagged movers at once (for double doors and such)
if ((Tag != '') && (Tag != 'DeusExMover'))
foreach AllActors(class'DeusExMover', M, Tag)
if (M != Self)
{
M.bLocked = False;
M.TimeSinceReset = 0;
M.lockStrength = 0.0;
}

pickPlayer.ClientMessage(msgLockpickSuccess);
StopPicking();
}

// are we done with this pick?
else if (numPicks <= 0)
StopPicking();

// check to see if we've moved too far away from the door to continue
else if (pickPlayer.frobTarget != Self)
StopPicking();

// check to see if we've put the lockpick away
else if (pickPlayer.inHand != curPick)
StopPicking();
}

Trigger (actor Other, pawn EventInstigator)


if (!bDestroyed)
Super.Trigger(Other, EventInstigator);




DeusExNote.uc (extends Object)

var travel String text; // Note text stored here.
var travel Bool bUserNote; // True if this is a user-entered note
var travel DeusExNote next; // Next note
var travel Name textTag;

SetTextTag (Name newTextTag)


textTag = newTextTag;

SetUserNote (Bool bNewUserNote)


bUserNote = bNewUserNote;




DeusExPickup.uc (extends Pickup)

var bool bBreakable; // true if we can destroy this item
var class fragType; // fragments created when pickup is destroyed
var int maxCopies; // 0 means unlimited copies
var localized String CountLabel;
var localized String msgTooMany;
FragType=Class'DeusEx.GlassFragment'
CountLabel="COUNT:"
msgTooMany="You can't carry any more of those"
NumCopies=1
PickupMessage="You found"
ItemName="DEFAULT PICKUP NAME - REPORT THIS AS A BUG"
RespawnTime=30.000000
LandSound=Sound'DeusExSounds.Generic.PaperHit1'

BaseChange


Super.BaseChange();

// Make sure we fall if we don't have a base
if ((base == None) && (Owner == None))
SetPhysics(PHYS_Falling);

BreakItSmashIt (class FragType, float size)


local int i;
local DeusExFragment s;


for (i=0; i {
s = DeusExFragment(Spawn(FragType, Owner));
if (s != None)
{
s.Instigator = Instigator;
s.CalcVelocity(Velocity,0);
s.DrawScale = ((FRand() * 0.05) + 0.05) * size;
s.Skin = GetMeshTexture();

// play a good breaking sound for the first fragment
if (i == 0)
s.PlaySound(sound'GlassBreakSmall', SLOT_None,,, 768);
}
}

Destroy();

HandlePickupQuery (inventory Item) -> bool


local DeusExPlayer player;
local Inventory anItem;
local Bool bAlreadyHas;
local Bool bResult;


if ( Item.Class == Class )
{
player = DeusExPlayer(Owner);
bResult = False;

// Check to see if the player already has one of these in
// his inventory
anItem = player.FindInventoryType(Item.Class);

if ((anItem != None) && (bCanHaveMultipleCopies))
{
// don't actually put it in the hand, just add it to the count
NumCopies += DeusExPickup(item).NumCopies;

if ((MaxCopies > 0) && (NumCopies > MaxCopies))
{
NumCopies -= DeusExPickup(item).NumCopies;
player.ClientMessage(msgTooMany);

// abort the pickup
return True;
}
bResult = True;
}

if (bResult)
{
player.ClientMessage(Item.PickupMessage @ Item.itemArticle @ Item.itemName, 'Pickup');

// Destroy me!
// DEUS_EX AMSD In multiplayer, we don't want to destroy the item, we want it to set to respawn
if (Level.NetMode != NM_Standalone)
Item.SetRespawn();
else
Item.Destroy();
}
else
{
bResult = Super.HandlePickupQuery(Item);
}

// Update object belt text
if (bResult)
UpdateBeltText();

return bResult;
}

if ( Inventory == None )
return false;

return Inventory.HandlePickupQuery(Item);

Landed (Vector HitNormal)


Super.Landed(HitNormal);

if (bBreakable)
if (VSize(Velocity) > 400)
BreakItSmashIt(fragType, (CollisionRadius + CollisionHeight) / 2);

PlayLandingSound


if (LandSound != None)
{
if (Velocity.Z <= -200)
{
PlaySound(LandSound, SLOT_None, TransientSoundVolume,, 768);
AISendEvent('LoudNoise', EAITYPE_Audio, TransientSoundVolume, 768);
}
}

UpdateBeltText


local DeusExRootWindow root;


if (DeusExPlayer(Owner) != None)
{
root = DeusExRootWindow(DeusExPlayer(Owner).rootWindow);

// Update object belt text
if ((bInObjectBelt) && (root != None) && (root.hud != None) && (root.hud.belt != None))
root.hud.belt.UpdateObjectText(beltPos);
}

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;
local string str;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.SetTitle(itemName);
winInfo.SetText(Description $ winInfo.CR() $ winInfo.CR());

if (bCanHaveMultipleCopies)
{
// Print the number of copies
str = CountLabel @ String(NumCopies);
winInfo.AppendText(str);
}

return True;

UseOnce


local DeusExPlayer player;


player = DeusExPlayer(Owner);
NumCopies--;

if (!IsA('SkilledTool'))
GotoState('DeActivated');

if (NumCopies <= 0)
{
if (player.inHand == Self)
player.PutInHand(None);
Destroy();
}
else
{
UpdateBeltText();
}




DeusExPlayer.uc (extends PlayerPawnExt)

var travel String TruePlayerName;
var travel int PlayerSkin;
var travel Float CombatDifficulty;
var travel AugmentationManager AugmentationSystem;
var travel SkillManager SkillSystem;
var() travel int SkillPointsTotal;
var() travel int SkillPointsAvail;
var travel int Credits;
var travel float Energy;
var travel float EnergyMax;
var travel float EnergyDrain; // amount of energy left to drain
var travel float EnergyDrainTotal; // total amount of energy to drain
var float MaxRegenPoint; // in multiplayer, the highest that auto regen will take you
var float RegenRate; // the number of points healed per second in mp
var travel NanoKeyRing KeyRing; // Inventory Item
var travel NanoKeyInfo KeyList; // List of Keys
var() float MaxFrobDistance;
var Actor FrobTarget;
var float FrobTime;
var float LastRefreshTime;
var ConPlay conPlay; // Conversation
var DataLinkPlay dataLinkPlay; // Used for DataLinks
var travel ConHistory conHistory; // Conversation History
var travel byte invSlots[30]; // 5x6 grid of inventory slots
var int maxInvRows; // Maximum number of inventory rows
var int maxInvCols; // Maximum number of inventory columns
var travel Inventory inHand; // The current object in hand
var travel Inventory inHandPending; // The pending item waiting to be put in hand
var travel Inventory ClientinHandPending; // Client temporary inhand pending, for mousewheel use.
var travel Inventory LastinHand; // Last object inhand, so we can detect inhand changes on the client.
var travel bool bInHandTransition; // The inHand is being swapped out
var bool bBeltIsMPInventory;
var travel DeusExGoal FirstGoal;
var travel DeusExGoal LastGoal;
var travel DeusExNote FirstNote;
var travel DeusExNote LastNote;
var travel DataVaultImage FirstImage;
var DeusExLog FirstLog;
var DeusExLog LastLog;
var Actor ViewModelActor[8];
var bool bFirstOptionsSynced;
var bool bSecondOptionsSynced;
var travel bool bForceDuck;
var travel bool bCrouchOn; // used by toggle crouch
var travel bool bWasCrouchOn; // used by toggle crouch
var travel byte lastbDuck; // used by toggle crouch
var bool bCanLean;
var float curLeanDist;
var float prevLeanDist;
var bool bToggleWalk;
var float RunSilentValue;
var bool bWarrenEMPField;
var float WarrenTimer;
var int WarrenSlot;
var name FloorMaterial;
var name WallMaterial;
var Vector WallNormal;
var float drugEffectTimer;
var float JoltMagnitude; // magnitude of bounce imposed by heavy footsteps
var float poisonTimer; // time remaining before next poison TakeDamage
var int poisonCounter; // number of poison TakeDamages remaining
var int poisonDamage; // damage taken from poison effect
var float BleedRate; // how profusely the player is bleeding; 0-1
var float DropCounter; // internal; used in tick()
var() float ClotPeriod; // seconds it takes bleedRate to go from 1 to 0
var float FlashTimer; // How long it should take the current flash to fade.
var float swimDuration;
var float swimTimer;
var float swimBubbleTimer;
var Actor ConversationActor;
var Actor lastThirdPersonConvoActor;
var float lastThirdPersonConvoTime;
var Actor lastFirstPersonConvoActor;
var float lastFirstPersonConvoTime;
var Bool bStartingNewGame; // Set to True when we're starting a new game.
var Bool bSavingSkillsAugs;
var bool bSpyDroneActive;
var int spyDroneLevel;
var float spyDroneLevelValue;
var SpyDrone aDrone;
var bool bBuySkills;
var bool bKillerProfile;
var int mpMsgFlags;
var int mpMsgServerFlags;
var int mpMsgCode;
var float mpMsgTime;
var int mpMsgOptionalParam;
var String mpMsgOptionalString;
var String strStartMap;
var travel Bool bStartNewGameAfterIntro;
var travel Bool bIgnoreNextShowMenu;
var String NextMap;
var globalconfig bool bObjectNames; // Object names on/off
var globalconfig bool bNPCHighlighting; // NPC highlighting when new convos
var globalconfig bool bSubtitles; // True if Conversation Subtitles are on
var globalconfig bool bAlwaysRun; // True to default to running
var globalconfig bool bToggleCrouch; // True to let key toggle crouch
var globalconfig float logTimeout; // Log Timeout Value
var globalconfig byte maxLogLines; // Maximum number of log lines visible
var globalconfig bool bHelpMessages; // Multiplayer help messages
var globalconfig byte translucencyLevel; // 0 - 10?
var globalconfig bool bObjectBeltVisible;
var globalconfig bool bHitDisplayVisible;
var globalconfig bool bAmmoDisplayVisible;
var globalconfig bool bAugDisplayVisible;
var globalconfig bool bDisplayAmmoByClip;
var globalconfig bool bCompassVisible;
var globalconfig bool bCrosshairVisible;
var globalconfig bool bAutoReload;
var globalconfig bool bDisplayAllGoals;
var globalconfig bool bHUDShowAllAugs; // TRUE = Always show Augs on HUD
var globalconfig int UIBackground; // 0 = Render 3D, 1 = Snapshot, 2 = Black
var globalconfig bool bDisplayCompletedGoals;
var globalconfig bool bShowAmmoDescriptions;
var globalconfig bool bConfirmSaveDeletes;
var globalconfig bool bConfirmNoteDeletes;
var globalconfig bool bAskedToTrain;
var() globalconfig Name AugPrefs[9]; //List of aug preferences.
var travel BarkManager barkManager;
var travel ColorThemeManager ThemeManager;
var globalconfig String MenuThemeName;
var globalconfig String HUDThemeName;
var globalconfig Bool bHUDBordersVisible;
var globalconfig Bool bHUDBordersTranslucent;
var globalconfig Bool bHUDBackgroundTranslucent;
var globalconfig Bool bMenusTranslucent;
var localized String InventoryFull;
var localized String TooMuchAmmo;
var localized String TooHeavyToLift;
var localized String CannotLift;
var localized String NoRoomToLift;
var localized String CanCarryOnlyOne;
var localized String CannotDropHere;
var localized String HandsFull;
var localized String NoteAdded;
var localized String GoalAdded;
var localized String PrimaryGoalCompleted;
var localized String SecondaryGoalCompleted;
var localized String EnergyDepleted;
var localized String AddedNanoKey;
var localized String HealedPointsLabel;
var localized String HealedPointLabel;
var localized String SkillPointsAward;
var localized String QuickSaveGameTitle;
var localized String WeaponUnCloak;
var localized String TakenOverString;
var localized String HeadString;
var localized String TorsoString;
var localized String LegsString;
var localized String WithTheString;
var localized String WithString;
var localized String PoisonString;
var localized String BurnString;
var localized String NoneString;
var ShieldEffect DamageShield; //visual damage effect for multiplayer feedback
var float ShieldTimer; //for turning shield to fade.
var EShieldStatus ShieldStatus;
var Pawn myBurner;
var Pawn myPoisoner;
var Actor myProjKiller;
var Actor myTurretKiller;
var Actor myKiller;
var KillerProfile killProfile;
var InvulnSphere invulnSph;
var EMusicMode musicMode;
var byte savedSection; // last section playing before interrupt
var float musicCheckTimer;
var float musicChangeTimer;
var travel int saveCount;
var travel Float saveTime;
var DebugInfo GlobalDebugObj;
var globalconfig bool bQuotesEnabled;
var GameInfo DXGame;
var float ServerTimeDiff;
var float ServerTimeLastRefresh;
var float MPDamageMult;
var float NintendoImmunityTime;
var float NintendoImmunityTimeLeft;
var bool bNintendoImmunity;
var Computers ActiveComputer;
TruePlayerName="JC Denton"
CombatDifficulty=1.000000
SkillPointsTotal=5000
SkillPointsAvail=5000
Credits=500
Energy=100.000000
EnergyMax=100.000000
MaxRegenPoint=25.000000
RegenRate=1.500000
MaxFrobDistance=112.000000
maxInvRows=6
maxInvCols=5
bBeltIsMPInventory=True
RunSilentValue=1.000000
ClotPeriod=30.000000
strStartMap="01_NYC_UNATCOIsland"
bObjectNames=True
bNPCHighlighting=True
bSubtitles=True
bAlwaysRun=True
bToggleCrouch=True
logTimeout=10.000000
maxLogLines=4
bHelpMessages=True
bObjectBeltVisible=True
bHitDisplayVisible=True
bAmmoDisplayVisible=True
bAugDisplayVisible=True
bDisplayAmmoByClip=True
bCompassVisible=True
bCrosshairVisible=True
bAutoReload=True
bDisplayAllGoals=True
bHUDShowAllAugs=True
bShowAmmoDescriptions=True
bConfirmSaveDeletes=True
bConfirmNoteDeletes=True
bAskedToTrain=True
AugPrefs(0)=AugBallistic
AugPrefs(1)=AugSpeed
AugPrefs(2)=AugCloak
AugPrefs(3)=AugDefense
AugPrefs(4)=AugCombat
AugPrefs(5)=AugEMP
AugPrefs(6)=AugMuscle
AugPrefs(7)=AugRadarTrans
MenuThemeName="Steel"
HUDThemeName="Amber"
bHUDBordersVisible=True
bHUDBordersTranslucent=True
bHUDBackgroundTranslucent=True
bMenusTranslucent=True
InventoryFull="You don't have enough room in your inventory to pick up the %s"
TooMuchAmmo="You already have enough of that type of ammo"
TooHeavyToLift="It's too heavy to lift"
CannotLift="You can't lift that"
NoRoomToLift="There's no room to lift that"
CanCarryOnlyOne="You can only carry one %s"
CannotDropHere="Can't drop that here"
HandsFull="Your hands are full"
NoteAdded="Note Received - Check DataVault For Details"
GoalAdded="Goal Received - Check DataVault For Details"
PrimaryGoalCompleted="Primary Goal Completed"
SecondaryGoalCompleted="Secondary Goal Completed"
EnergyDepleted="Bio-electric energy reserves depleted"
AddedNanoKey="%s added to Nano Key Ring"
HealedPointsLabel="Healed %d points"
HealedPointLabel="Healed %d point"
SkillPointsAward="%d skill points awarded"
QuickSaveGameTitle="Quick Save"
WeaponUnCloak="Weapon drawn... Uncloaking"
TakenOverString="I've taken over the "
HeadString="Head"
TorsoString="Torso"
LegsString="Legs"
WithTheString=" with the "
WithString=" with "
PoisonString=" with deadly poison"
BurnString=" with excessive burning"
NoneString="None"
MPDamageMult=1.000000
bCanStrafe=True
MeleeRange=50.000000
AccelRate=2048.000000
FovAngle=75.000000
Intelligence=BRAINS_HUMAN
AngularResolution=0.500000
Alliance=Player
DrawType=DT_Mesh
SoundVolume=64
RotationRate=(Pitch=3072,Yaw=65000,Roll=2048)
BindName="JCDenton"
FamiliarName="JC Denton"
UnfamiliarName="JC Denton"

AbortConversation (optional bool bNoPlayedFlag)


if (conPlay != None)
conPlay.TerminateConversation(False, bNoPlayedFlag);

ActivateAllAugs


if (AugmentationSystem != None)
AugmentationSystem.ActivateAll();

ActivateAugmentation (int num)


local Augmentation anAug;
local int count, wantedSlot, slotIndex;
local bool bFound;


if (RestrictInput())
return;

if (Energy == 0)
{
ClientMessage(EnergyDepleted);
PlaySound(AugmentationSystem.FirstAug.DeactivateSound, SLOT_None);
return;
}

if (AugmentationSystem != None)
AugmentationSystem.ActivateAugByKey(num);

ActivateBelt (int objectNum)


local DeusExRootWindow root;


if (RestrictInput())
return;

if ((Level.NetMode != NM_Standalone) && bBuySkills)
{
root = DeusExRootWindow(rootWindow);
if ( root != None )
{
if ( root.hud.hms.OverrideBelt( Self, objectNum ))
return;
}
}

if (CarriedDecoration == None)
{
root = DeusExRootWindow(rootWindow);
if (root != None)
root.ActivateObjectInBelt(objectNum);
}

ActivateKeypadWindow (Keypad KPad, bool bHacked)


KPad.ActivateKeypadWindow(Self, bHacked);

AddAugmentationDisplay (Augmentation aug)


//DEUS_EX AMSD Added none check here.
if ((rootWindow != None) && (aug != None))
DeusExRootWindow(rootWindow).hud.activeItems.AddIcon(aug.SmallIcon, aug);

AddChargedDisplay (ChargedPickup item)


if ( (PlayerIsClient()) || (Level.NetMode == NM_Standalone) )
DeusExRootWindow(rootWindow).hud.activeItems.AddIcon(item.ChargedIcon, item);

AddDamageDisplay (name damageType, vector hitOffset)


DeusExRootWindow(rootWindow).hud.damageDisplay.AddIcon(damageType, hitOffset);

AddGoal (Name goalName, bool bPrimaryGoal) -> DeusExGoal


local DeusExGoal newGoal;


// First check to see if this goal already exists. If so, we'll just
// return it. Otherwise create a new goal

newGoal = FindGoal( goalName );

if ( newGoal == None )
{
newGoal = new(Self) Class'DeusExGoal';
newGoal.SetName( goalName );

// Insert goal at the Top so goals are displayed in
// Newest order first.
if (FirstGoal == None)
LastGoal = newGoal;
else
newGoal.next = FirstGoal;

FirstGoal = newGoal;

newGoal.SetPrimaryGoal( bPrimaryGoal );

ClientMessage(GoalAdded);
DeusExRootWindow(rootWindow).hud.msgLog.PlayLogSound(Sound'LogGoalAdded');
}

return newGoal;

AddImage (DataVaultImage newImage) -> bool


local DataVaultImage image;


if (newImage == None)
return False;

// First make sure the player doesn't already have this image!!
image = FirstImage;
while(image != None)
{
if (newImage.imageDescription == image.imageDescription)
return False;

image = image.NextImage;
}

// If the player doesn't yet have an image, make this his
// first image.
newImage.nextImage = FirstImage;
newImage.prevImage = None;

if (FirstImage != None)
FirstImage.prevImage = newImage;

FirstImage = newImage;

return True;

AddInventory (inventory item) -> bool


local bool retval;
local DeusExRootWindow root;


retval = super.AddInventory(item);

// Force the object be added to the object belt
// unless it's ammo
//
// Don't add Ammo and don't add Images!

if ((item != None) && !item.IsA('Ammo') && (!item.IsA('DataVaultImage')) && (!item.IsA('Credits')))
{
root = DeusExRootWindow(rootWindow);

if ( item.bInObjectBelt )
{
if (root != None)
{
root.hud.belt.AddObjectToBelt(item, item.beltPos, True);
}
}

if (retval)
{
if (root != None)
{
root.AddInventory(item);
}
}
}

return (retval);

AddLog (String logText) -> DeusExLog


local DeusExLog newLog;


newLog = CreateLogObject();
newLog.SetLogText(logText);

// Add this Note to the list of player Notes
if ( FirstLog != None )
LastLog.next = newLog;
else
FirstLog = newLog;

LastLog = newLog;

return newLog;

AddNote (optional String strNote, optional Bool bUserNote, optional bool bShowInLog) -> DeusExNote


local DeusExNote newNote;


newNote = new(Self) Class'DeusExNote';

newNote.text = strNote;
newNote.SetUserNote( bUserNote );

// Insert this new note at the top of the notes list
if (FirstNote == None)
LastNote = newNote;
else
newNote.next = FirstNote;

FirstNote = newNote;

// Optionally show the note in the log
if ( bShowInLog )
{
ClientMessage(NoteAdded);
DeusExRootWindow(rootWindow).hud.msgLog.PlayLogSound(Sound'LogNoteAdded');
}

return newNote;

AddObjectToBelt (Inventory item, int pos, bool bOverride)


if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).hud.belt.AddObjectToBelt(item,pos,bOverride);

AllAugs


local Augmentation anAug;
local int i;


if (!bCheatsEnabled)
return;

if (AugmentationSystem != None)
{
AugmentationSystem.AddAllAugs();
AugmentationSystem.SetAllAugsToMaxLevel();
}

AllCredits


if (!bCheatsEnabled)
return;

Credits = 100000;

AllEnergy


if (!bCheatsEnabled)
return;

Energy = default.Energy;

AllHealth


if (!bCheatsEnabled)
return;

RestoreAllHealth();

AllImages


local Vector loc;
local Inventory item;


if (!bCheatsEnabled)
return;

item = Spawn(class'Image01_GunFireSensor');
item.Frob(Self, None);
item = Spawn(class'Image01_LibertyIsland');
item.Frob(Self, None);
item = Spawn(class'Image01_TerroristCommander');
item.Frob(Self, None);
item = Spawn(class'Image02_Ambrosia_Flyer');
item.Frob(Self, None);
item = Spawn(class'Image02_NYC_Warehouse');
item.Frob(Self, None);
item = Spawn(class'Image02_BobPage_ManOfYear');
item.Frob(Self, None);
item = Spawn(class'Image03_747Diagram');
item.Frob(Self, None);
item = Spawn(class'Image03_NYC_Airfield');
item.Frob(Self, None);
item = Spawn(class'Image03_WaltonSimons');
item.Frob(Self, None);
item = Spawn(class'Image04_NSFHeadquarters');
item.Frob(Self, None);
item = Spawn(class'Image04_UNATCONotice');
item.Frob(Self, None);
item = Spawn(class'Image05_GreaselDisection');
item.Frob(Self, None);
item = Spawn(class'Image05_NYC_MJ12Lab');
item.Frob(Self, None);
item = Spawn(class'Image06_HK_Market');
item.Frob(Self, None);
item = Spawn(class'Image06_HK_MJ12Helipad');
item.Frob(Self, None);
item = Spawn(class'Image06_HK_MJ12Lab');
item.Frob(Self, None);
item = Spawn(class'Image06_HK_Versalife');
item.Frob(Self, None);
item = Spawn(class'Image06_HK_WanChai');
item.Frob(Self, None);
item = Spawn(class'Image08_JoeGreenMIBMJ12');
item.Frob(Self, None);
item = Spawn(class'Image09_NYC_Ship_Bottom');
item.Frob(Self, None);
item = Spawn(class'Image09_NYC_Ship_Top');
item.Frob(Self, None);
item = Spawn(class'Image10_Paris_Catacombs');
item.Frob(Self, None);
item = Spawn(class'Image10_Paris_CatacombsTunnels');
item.Frob(Self, None);
item = Spawn(class'Image10_Paris_Metro');
item.Frob(Self, None);
item = Spawn(class'Image11_Paris_Cathedral');
item.Frob(Self, None);
item = Spawn(class'Image11_Paris_CathedralEntrance');
item.Frob(Self, None);
item = Spawn(class'Image12_Vandenberg_Command');
item.Frob(Self, None);
item = Spawn(class'Image12_Vandenberg_Sub');
item.Frob(Self, None);
item = Spawn(class'Image12_Tiffany_HostagePic');
item.Frob(Self, None);
item = Spawn(class'Image14_OceanLab');
item.Frob(Self, None);
item = Spawn(class'Image14_Schematic');
item.Frob(Self, None);
item = Spawn(class'Image15_Area51Bunker');
item.Frob(Self, None);
item = Spawn(class'Image15_GrayDisection');
item.Frob(Self, None);
item = Spawn(class'Image15_BlueFusionDevice');
item.Frob(Self, None);
item = Spawn(class'Image15_Area51_Sector3');
item.Frob(Self, None);
item = Spawn(class'Image15_Area51_Sector4');
item.Frob(Self, None);

AllSkillPoints


if (!bCheatsEnabled)
return;

SkillPointsTotal = 115900;
SkillPointsAvail = 115900;

AllSkills


if (!bCheatsEnabled)
return;

AllSkillPoints();
SkillSystem.AddAllSkills();

AllWeapons


local Vector loc;


if (!bCheatsEnabled)
return;

loc = Location + 2 * CollisionRadius * Vector(ViewRotation);

Spawn(class'WeaponAssaultGun',,, loc);
Spawn(class'WeaponAssaultShotgun',,, loc);
Spawn(class'WeaponBaton',,, loc);
Spawn(class'WeaponCombatKnife',,, loc);
Spawn(class'WeaponCrowbar',,, loc);
Spawn(class'WeaponEMPGrenade',,, loc);
Spawn(class'WeaponFlamethrower',,, loc);
Spawn(class'WeaponGasGrenade',,, loc);
Spawn(class'WeaponGEPGun',,, loc);
Spawn(class'WeaponHideAGun',,, loc);
Spawn(class'WeaponLAM',,, loc);
Spawn(class'WeaponLAW',,, loc);
Spawn(class'WeaponMiniCrossbow',,, loc);
Spawn(class'WeaponNanoSword',,, loc);
Spawn(class'WeaponNanoVirusGrenade',,, loc);
Spawn(class'WeaponPepperGun',,, loc);
Spawn(class'WeaponPistol',,, loc);
Spawn(class'WeaponPlasmaRifle',,, loc);
Spawn(class'WeaponProd',,, loc);
Spawn(class'WeaponRifle',,, loc);
Spawn(class'WeaponSawedOffShotgun',,, loc);
Spawn(class'WeaponShuriken',,, loc);
Spawn(class'WeaponStealthPistol',,, loc);
Spawn(class'WeaponSword',,, loc);

AugAdd (class aWantedAug)


local Augmentation anAug;


if (!bCheatsEnabled)
return;

if (AugmentationSystem != None)
{
anAug = AugmentationSystem.GivePlayerAugmentation(aWantedAug);

if (anAug == None)
ClientMessage(GetItemName(String(aWantedAug)) $ " is not a valid augmentation!");
}

BeginState


FrobTime = Level.TimeSeconds;
ShowHud(False);
ClientDeath();

Bleed (float deltaTime)


local float dropPeriod;
local float adjustedRate;
local vector bloodVector;


if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
{
bleedrate = 0;
dropCounter = 0;
return;
}

// Copied from ScriptedPawn::Tick()
bleedRate = FClamp(bleedRate, 0.0, 1.0);
if (bleedRate > 0)
{
adjustedRate = (1.0-bleedRate)*1.0+0.1; // max 10 drops per second
dropPeriod = adjustedRate / FClamp(VSize(Velocity)/512.0, 0.05, 1.0);
dropCounter += deltaTime;
while (dropCounter >= dropPeriod)
{
bloodVector = vect(0,0,1)*CollisionHeight*0.5; // so folks don't bleed from the crotch
spawn(Class'BloodDrop',,,bloodVector+Location);
dropCounter -= dropPeriod;
}
bleedRate -= deltaTime/clotPeriod;
}
if (bleedRate <= 0)
{
dropCounter = 0;
bleedRate = 0;
}

BuySkillSound (int code)


local Sound snd;


switch( code )
{
case 0:
snd = Sound'Menu_OK';
break;
case 1:
snd = Sound'Menu_Cancel';
break;
case 2:
snd = Sound'Menu_Focus';
break;
case 3:
snd = Sound'Menu_BuySkills';
break;
}
PlaySound( snd, SLOT_Interface, 0.75 );

BuySkills


if ( Level.NetMode != NM_Standalone )
{
// First turn off scores if we're heading into skill menu
if ( !bBuySkills )
ClientTurnOffScores();

bBuySkills = !bBuySkills;
BuySkillSound( 2 );
}

CalculatePlayerVisibility (ScriptedPawn P) -> float


local float vis;
local AdaptiveArmor armor;


vis = 1.0;
if ((P != None) && (AugmentationSystem != None))
{
if (P.IsA('Robot'))
{
// if the aug is on, give the player full invisibility
if (AugmentationSystem.GetAugLevelValue(class'AugRadarTrans') != -1.0)
vis = 0.0;
}
else
{
// if the aug is on, give the player full invisibility
if (AugmentationSystem.GetAugLevelValue(class'AugCloak') != -1.0)
vis = 0.0;
}

// go through the actor list looking for owned AdaptiveArmor
// since they aren't in the inventory anymore after they are used

if (UsingChargedPickup(class'AdaptiveArmor'))
{
vis = 0.0;
}
}

return vis;

CalculateSkillHealAmount (int baseHealPoints) -> int


local float mult;
local int adjustedHealAmount;


// check skill use
if (SkillSystem != None)
{
mult = SkillSystem.GetSkillLevelValue(class'SkillMedicine');

// apply the skill
adjustedHealAmount = baseHealPoints * mult;
}

return adjustedHealAmount;

CanActorSeePlayer (Actor invokeActor) -> bool


return FastTrace(invokeActor.Location);

CanBeLifted (Decoration deco) -> bool


local int augLevel, augMult;
local float maxLift;


maxLift = 50;
if (AugmentationSystem != None)
{
augLevel = AugmentationSystem.GetClassLevel(class'AugMuscle');
augMult = 1;
if (augLevel >= 0)
augMult = augLevel+2;
maxLift *= augMult;
}

if (!deco.bPushable || (deco.Mass > maxLift) || (deco.StandingCount > 0))
{
if (deco.bPushable)
ClientMessage(TooHeavyToLift);
else
ClientMessage(CannotLift);

return False;
}

return True;

CanStartConversation -> bool


if (((conPlay != None) && (conPlay.CanInterrupt() == False)) ||
((conPlay != None) && (conPlay.con.bFirstPerson != True)) ||
(( bForceDuck == True ) && ((HealthLegLeft > 0) || (HealthLegRight > 0))) ||
( IsInState('Dying') ) ||
( IsInState('PlayerSwimming') ) ||
( IsInState('CheatFlying') ) ||
( Physics == PHYS_Falling ) ||
( Level.bPlayersOnly ) ||
(!DeusExRootWindow(rootWindow).CanStartConversation()))
return False;
else
return True;

CatchFire (Pawn burner)


local Fire f;
local int i;
local vector loc;


myBurner = burner;

burnTimer = 0;

if (bOnFire || Region.Zone.bWaterZone)
return;

bOnFire = True;
burnTimer = 0;

for (i=0; i<8; i++)
{
loc.X = 0.5*CollisionRadius * (1.0-2.0*FRand());
loc.Y = 0.5*CollisionRadius * (1.0-2.0*FRand());
loc.Z = 0.6*CollisionHeight * (1.0-2.0*FRand());
loc += Location;

// DEUS_EX AMSD reduce the number of smoke particles in multiplayer
// by creating smokeless fire (better for server propagation).
if ((Level.NetMode == NM_Standalone) || (i <= 0))
f = Spawn(class'Fire', Self,, loc);
else
f = Spawn(class'SmokelessFire', Self,, loc);

if (f != None)
{
f.DrawScale = 0.5*FRand() + 1.0;

//DEUS_EX AMSD Reduce the penalty in multiplayer
if (Level.NetMode != NM_Standalone)
f.DrawScale = f.DrawScale * 0.5;

// turn off the sound and lights for all but the first one
if (i > 0)
{
f.AmbientSound = None;
f.LightType = LT_None;
}

// turn on/off extra fire and smoke
// MP already only generates a little.
if ((FRand() < 0.5) && (Level.NetMode == NM_Standalone))
f.smokeGen.Destroy();
if ((FRand() < 0.5) && (Level.NetMode == NM_Standalone))
f.AddFire();
}
}

// set the burn timer
SetTimer(1.0, True);

ChargePlayer (int baseChargePoints) -> int


local int chargedPoints;


chargedPoints = Min(EnergyMax - Int(Energy), baseChargePoints);

Energy += chargedPoints;

return chargedPoints;

CheckActiveConversationRadius


local int checkRadius;


// Ignore if conPlay.GetForcePlay() returns True

if ((conPlay != None) && (!conPlay.GetForcePlay()) && (conPlay.ConversationStarted()) && (conPlay.displayMode == DM_FirstPerson) && (conPlay.StartActor != None))
{
// If this was invoked via a radius, then check to make sure the player doesn't
// exceed that radius plus

if (conPlay.con.bInvokeRadius)
checkRadius = conPlay.con.radiusDistance + 100;
else
checkRadius = 300;

// Add the collisioncylinder since some objects are wider than others
checkRadius += conPlay.StartActor.CollisionRadius;

if (VSize(conPlay.startActor.Location - Location) > checkRadius)
{
// Abort the conversation
conPlay.TerminateConversation(True);
}
}

CheckActorDistances -> bool


if ((conPlay != None) && (!conPlay.GetForcePlay()) && (conPlay.ConversationStarted()) && (conPlay.displayMode == DM_ThirdPerson))
{
if (!conPlay.con.CheckActorDistances(Self))
conPlay.TerminateConversation(True);
}

CheckConversationHeightDifference (Actor invokeActor, int heightOffset) -> bool


local Int dist;


dist = Abs(Location.Z - invokeActor.Location.Z) - Abs(Default.CollisionHeight - CollisionHeight);

if (dist > (Abs(CollisionHeight - invokeActor.CollisionHeight) + heightOffset))
return False;
else
return True;

CheckConversationInvokeRadius (Actor invokeActor, Conversation con) -> bool


local Int invokeRadius;
local Int dist;


dist = VSize(Location - invokeActor.Location);

invokeRadius = Max(16, con.radiusDistance);

return (dist <= invokeRadius);

CheckFlagRefs (ConFlagRef flagRef) -> bool


local ConFlagRef currentRef;


// Loop through our list of FlagRef's, checking the value of each.
// If we hit a bad match, then we'll stop right away since there's
// no point of continuing.

currentRef = flagRef;

while( currentRef != None )
{
if ( flagBase.GetBool(currentRef.flagName) != currentRef.value )
return False;

currentRef = currentRef.nextFlagRef;
}

// If we made it this far, then the flags check out.
return True;

ClearAugmentationDisplay


DeusExRootWindow(rootWindow).hud.activeItems.ClearAugmentationDisplay();

ClearBelt


if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).hud.belt.ClearBelt();

ClearInventorySlots


local int slotIndex;


for(slotIndex=0; slotIndex invSlots[slotIndex] = 0;

ClearLog


local DeusExLog log;
local DeusExLog nextLog;


log = FirstLog;

while( log != None )
{
nextLog = log.next;
CriticalDelete(log);
log = nextLog;
}

FirstLog = None;
LastLog = None;

ClearPosition (int pos)


if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).hud.belt.ClearPosition(pos);

ClientDeath


if (!PlayerIsClient())
return;

FlashTimer = 0;

// Reset skill notification
DeusExRootWindow(rootWindow).hud.hms.bNotifySkills = False;

DeusExRootWindow(rootWindow).hud.activeItems.winItemsContainer.RemoveAllIcons();
DeusExRootWindow(rootWindow).hud.belt.ClearBelt();

// This should get rid of the scope death problem in multiplayer
if (( DeusExRootWindow(rootWindow).scopeView != None ) && DeusExRootWindow(rootWindow).scopeView.bViewVisible )
DeusExRootWindow(rootWindow).scopeView.DeactivateView();

if ( DeusExRootWindow(rootWindow).hud.augDisplay != None )
{
DeusExRootWindow(rootWindow).hud.augDisplay.bVisionActive = False;
DeusExRootWindow(rootWindow).hud.augDisplay.activeCount = 0;
}

if ( bOnFire )
ExtinguishFire();

// 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;

// No messages carry over
mpMsgCode = 0;
mpMsgTime = 0;

bleedrate = 0;
dropCounter = 0;


ClientFlash (float scale, vector fog)


DesiredFlashScale += scale;
DesiredFlashFog += 0.001 * fog;

ClientPlayAnimation (Actor src, Name anim, float rate, bool bLoop)


if ( src != None )
{
// if ( bLoop )
// src.LoopAnim(anim, ,rate);
// else
src.PlayAnim(anim, ,rate);
}

ClientPossessed


if (Level.Game.IsA('DeusExGameInfo'))
DeusExGameInfo(Level.Game).ClientPlayerPossessed(Self);

ClientSpawnHits (bool bPenetrating, bool bHandToHand, Vector HitLocation, Vector HitNormal, Actor Other, float Damage)


local TraceHitSpawner hitspawner;


if (bPenetrating)
{
if (bHandToHand)
{
hitspawner = Spawn(class'TraceHitHandSpawner',Other,,HitLocation,Rotator(HitNormal));
}
else
{
hitspawner = Spawn(class'TraceHitSpawner',Other,,HitLocation,Rotator(HitNormal));
hitspawner.HitDamage = Damage;
}
}
else
{
if (bHandToHand)
{
hitspawner = Spawn(class'TraceHitHandNonPenSpawner',Other,,HitLocation,Rotator(HitNormal));
}
else
{
hitspawner = Spawn(class'TraceHitNonPenSpawner',Other,,HitLocation,Rotator(HitNormal));
}
}
if (hitSpawner != None)
hitspawner.HitDamage = Damage;

ClientSpawnProjectile (class ProjClass, Actor owner, Vector Start, Rotator AdjustedAim)


local DeusExProjectile proj;


proj = DeusExProjectile(Spawn(ProjClass, Owner,, Start, AdjustedAim));
if ( proj != None )
{
proj.RemoteRole = ROLE_None;
proj.Damage = 0;
}

ClientTurnOffScores


if ( bShowScores )
bShowScores = False;

CloseComputerScreen (Computers computerToClose)


computerToClose.CloseOut();

CloseThisComputer (Computers comp)


if ((comp != None) && ( comp.termwindow != None ))
comp.termwindow.CloseScreen("EXIT");

ConBindEvents | native

CreateColorThemeManager


if (ThemeManager == None)
{
ThemeManager = Spawn(Class'ColorThemeManager', Self);

// Add all default themes.

// Menus
ThemeManager.AddTheme(Class'ColorThemeMenu_Default');
ThemeManager.AddTheme(Class'ColorThemeMenu_BlueAndGold');
ThemeManager.AddTheme(Class'ColorThemeMenu_CoolGreen');
ThemeManager.AddTheme(Class'ColorThemeMenu_Cops');
ThemeManager.AddTheme(Class'ColorThemeMenu_Cyan');
ThemeManager.AddTheme(Class'ColorThemeMenu_DesertStorm');
ThemeManager.AddTheme(Class'ColorThemeMenu_DriedBlood');
ThemeManager.AddTheme(Class'ColorThemeMenu_Dusk');
ThemeManager.AddTheme(Class'ColorThemeMenu_Earth');
ThemeManager.AddTheme(Class'ColorThemeMenu_Green');
ThemeManager.AddTheme(Class'ColorThemeMenu_Grey');
ThemeManager.AddTheme(Class'ColorThemeMenu_IonStorm');
ThemeManager.AddTheme(Class'ColorThemeMenu_Lava');
ThemeManager.AddTheme(Class'ColorThemeMenu_NightVision');
ThemeManager.AddTheme(Class'ColorThemeMenu_Ninja');
ThemeManager.AddTheme(Class'ColorThemeMenu_Olive');
ThemeManager.AddTheme(Class'ColorThemeMenu_PaleGreen');
ThemeManager.AddTheme(Class'ColorThemeMenu_Pastel');
ThemeManager.AddTheme(Class'ColorThemeMenu_Plasma');
ThemeManager.AddTheme(Class'ColorThemeMenu_Primaries');
ThemeManager.AddTheme(Class'ColorThemeMenu_Purple');
ThemeManager.AddTheme(Class'ColorThemeMenu_Red');
ThemeManager.AddTheme(Class'ColorThemeMenu_Seawater');
ThemeManager.AddTheme(Class'ColorThemeMenu_SoylentGreen');
ThemeManager.AddTheme(Class'ColorThemeMenu_Starlight');
ThemeManager.AddTheme(Class'ColorThemeMenu_Steel');
ThemeManager.AddTheme(Class'ColorThemeMenu_SteelGreen');
ThemeManager.AddTheme(Class'ColorThemeMenu_Superhero');
ThemeManager.AddTheme(Class'ColorThemeMenu_Terminator');
ThemeManager.AddTheme(Class'ColorThemeMenu_Violet');

// HUD
ThemeManager.AddTheme(Class'ColorThemeHUD_Default');
ThemeManager.AddTheme(Class'ColorThemeHUD_Amber');
ThemeManager.AddTheme(Class'ColorThemeHUD_Cops');
ThemeManager.AddTheme(Class'ColorThemeHUD_Cyan');
ThemeManager.AddTheme(Class'ColorThemeHUD_DarkBlue');
ThemeManager.AddTheme(Class'ColorThemeHUD_DesertStorm');
ThemeManager.AddTheme(Class'ColorThemeHUD_DriedBlood');
ThemeManager.AddTheme(Class'ColorThemeHUD_Dusk');
ThemeManager.AddTheme(Class'ColorThemeHUD_Grey');
ThemeManager.AddTheme(Class'ColorThemeHUD_IonStorm');
ThemeManager.AddTheme(Class'ColorThemeHUD_NightVision');
ThemeManager.AddTheme(Class'ColorThemeHUD_Ninja');
ThemeManager.AddTheme(Class'ColorThemeHUD_PaleGreen');
ThemeManager.AddTheme(Class'ColorThemeHUD_Pastel');
ThemeManager.AddTheme(Class'ColorThemeHUD_Plasma');
ThemeManager.AddTheme(Class'ColorThemeHUD_Primaries');
ThemeManager.AddTheme(Class'ColorThemeHUD_Purple');
ThemeManager.AddTheme(Class'ColorThemeHUD_Red');
ThemeManager.AddTheme(Class'ColorThemeHUD_SoylentGreen');
ThemeManager.AddTheme(Class'ColorThemeHUD_Starlight');
ThemeManager.AddTheme(Class'ColorThemeHUD_SteelGreen');
ThemeManager.AddTheme(Class'ColorThemeHUD_Superhero');
ThemeManager.AddTheme(Class'ColorThemeHUD_Terminator');
ThemeManager.AddTheme(Class'ColorThemeHUD_Violet');
}

CreateDataVaultImageNoteObject | native

CreateDrone


local Vector loc;


loc = (2.0 + class'SpyDrone'.Default.CollisionRadius + CollisionRadius) * Vector(ViewRotation);
loc.Z = BaseEyeHeight;
loc += Location;
aDrone = Spawn(class'SpyDrone', Self,, loc, ViewRotation);
if (aDrone != None)
{
aDrone.Speed = 3 * spyDroneLevelValue;
aDrone.MaxSpeed = 3 * spyDroneLevelValue;
aDrone.Damage = 5 * spyDroneLevelValue;
aDrone.blastRadius = 8 * spyDroneLevelValue;
// window construction now happens in Tick()
}

CreateDumpLocationObject | native

CreateGameDirectoryObject | native

CreateHistoryEvent | native

CreateHistoryObject | native

CreateKeyRing


if (KeyRing == None)
{
KeyRing = Spawn(class'NanoKeyRing', Self);
KeyRing.InitialState='Idle2';
KeyRing.GiveTo(Self);
KeyRing.SetBase(Self);
}

CreateKillerProfile (Pawn killer, int damage, name damageType, String bodyPart)


local DeusExPlayer pkiller;
local DeusExProjectile proj;
local DeusExDecoration decProj;
local Augmentation anAug;
local int augCnt;
local DeusExWeapon w;
local Skill askill;
local String wShortString;


if ( killProfile == None )
{
log("Warning:"$Self$" has a killProfile that is None!" );
return;
}
else
killProfile.Reset();

pkiller = DeusExPlayer(killer);

if ( pkiller != None )
{
killProfile.bValid = True;
killProfile.name = pkiller.PlayerReplicationInfo.PlayerName;
w = DeusExWeapon(pkiller.inHand);
GetWeaponName( w, killProfile.activeWeapon );

// What augs the killer was using
if ( pkiller.AugmentationSystem != None )
{
killProfile.numActiveAugs = pkiller.AugmentationSystem.NumAugsActive();
augCnt = 0;
anAug = pkiller.AugmentationSystem.FirstAug;
while ( anAug != None )
{
if ( anAug.bHasIt && anAug.bIsActive && !anAug.bAlwaysActive && (augCnt < ArrayCount(killProfile.activeAugs)))
{
killProfile.activeAugs[augCnt] = anAug.augmentationName;
augCnt += 1;
}
anAug = anAug.next;
}
}
else
killProfile.numActiveAugs = 0;

// My weapon and skill
GetWeaponName( DeusExWeapon(inHand), killProfile.myActiveWeapon );
if ( DeusExWeapon(inHand) != None )
{
if ( SkillSystem != None )
{
askill = SkillSystem.GetSkillFromClass(DeusExWeapon(inHand).GoverningSkill);
killProfile.myActiveSkill = askill.skillName;
killProfile.myActiveSkillLevel = askill.CurrentLevel;
}
}
else
{
killProfile.myActiveWeapon = NoneString;
killProfile.myActiveSkill = NoneString;
killProfile.myActiveSkillLevel = 0;
}
// Fill in my own active augs
if ( AugmentationSystem != None )
{
killProfile.myNumActiveAugs = AugmentationSystem.NumAugsActive();
augCnt = 0;
anAug = AugmentationSystem.FirstAug;
while ( anAug != None )
{
if ( anAug.bHasIt && anAug.bIsActive && !anAug.bAlwaysActive && (augCnt < ArrayCount(killProfile.myActiveAugs)))
{
killProfile.myActiveAugs[augCnt] = anAug.augmentationName;
augCnt += 1;
}
anAug = anAug.next;
}
}
killProfile.streak = (pkiller.PlayerReplicationInfo.Streak + 1);
killProfile.healthLow = pkiller.HealthLegLeft;
killProfile.healthMid = pkiller.HealthTorso;
killProfile.healthHigh = pkiller.HealthHead;
killProfile.remainingBio = pkiller.Energy;
killProfile.damage = damage;
killProfile.bodyLoc = bodyPart;
killProfile.killerLoc = pkiller.Location;
}
else
{
killProfile.bValid = False;
return;
}

killProfile.methodStr = NoneString;

switch( damageType )
{
case 'AutoShot':
killProfile.methodStr = WithTheString $ AutoTurret(myTurretKiller).titleString $ "!";
killProfile.bTurretKilled = True;
killProfile.killerLoc = AutoTurret(myTurretKiller).Location;
if ( pkiller.SkillSystem != None )
{
killProfile.activeSkill = class'SkillComputer'.Default.skillName;
killProfile.activeSkillLevel = pkiller.SkillSystem.GetSkillLevel(class'SkillComputer');
}
break;
case 'PoisonEffect':
killProfile.methodStr = PoisonString $ "!";
killProfile.bPoisonKilled = True;
killProfile.activeSkill = NoneString;
killProfile.activeSkillLevel = 0;
break;
case 'Burned':
case 'Flamed':
if (( WeaponPlasmaRifle(w) != None ) || ( WeaponFlamethrower(w) != None ))
{
// Use the weapon if it's still in hand
}
else
{
killProfile.methodStr = BurnString $ "!";
killProfile.bBurnKilled = True;
killProfile.activeSkill = NoneString;
killProfile.activeSkillLevel = 0;
}
break;
}
if ( killProfile.methodStr ~= NoneString )
{
proj = DeusExProjectile(myProjKiller);
decProj = DeusExDecoration(myProjKiller);

if (( killer != None ) && (proj != None) && (!(proj.itemName ~= "")) )
{
if ( (LAM(myProjKiller) != None) && (LAM(myProjKiller).bProximityTriggered) )
{
killProfile.bProximityKilled = True;
killProfile.killerLoc = LAM(myProjKiller).Location;
killProfile.myActiveSkill = class'SkillDemolition'.Default.skillName;
if ( SkillSystem != None )
killProfile.myActiveSkillLevel = SkillSystem.GetSkillLevel(class'SkillDemolition');
else
killProfile.myActiveSkillLevel = 0;
}
else
killProfile.bProjKilled = True;
killProfile.methodStr = WithString $ proj.itemArticle $ " " $ proj.itemName $ "!";
GetSkillInfoFromProj( pkiller, myProjKiller );
}
else if (( killer != None ) && ( decProj != None ) && (!(decProj.itemName ~= "" )) )
{
killProfile.methodStr = WithString $ decProj.itemArticle $ " " $ decProj.itemName $ "!";
killProfile.bProjKilled = True;
GetSkillInfoFromProj( pkiller, myProjKiller );
}
else if ((killer != None) && (w != None))
{
GetWeaponName( w, wShortString );
killProfile.methodStr = WithString $ w.itemArticle $ " " $ wShortString $ "!";
askill = pkiller.SkillSystem.GetSkillFromClass(w.GoverningSkill);
killProfile.activeSkill = askill.skillName;
killProfile.activeSkillLevel = askill.CurrentLevel;
}
else
log("Warning: Failed to determine killer method killer:"$killer$" damage:"$damage$" damageType:"$damageType$" " );
}
// If we still failed dump this to log, and I'll see if there's a condition slipping through...
if ( killProfile.methodStr ~= NoneString )
{
log("===>Warning: Failed to get killer method:"$Self$" damageType:"$damageType$" " );
killProfile.bValid = False;
}

CreateLogObject | native

CreateNanoKeyInfo -> NanoKeyInfo


local NanoKeyInfo newKey;


newKey = new(Self) Class'NanoKeyInfo';

return newKey;

CreatePlayerTracker


local MPPlayerTrack PlayerTracker;


PlayerTracker = Spawn(class'MPPlayerTrack');
PlayerTracker.AttachedPlayer = Self;

CreateShadow


if (Shadow == None)
{
Shadow = Spawn(class'Shadow', Self,, Location-vect(0,0,1)*CollisionHeight, rot(16384,0,0));
if (Shadow != None)
{
Shadow.RemoteRole = ROLE_None;
}
}

DXDumpInfo


local DumpLocation dumploc;
local DeusExLevelInfo info;
local string userName, mapName, strCopies;
local Inventory item, nextItem;
local DeusExWeapon W;
local Skill skill;
local Augmentation aug;
local bool bHasAugs;


dumploc = CreateDumpLocationObject();
if (dumploc != None)
{
userName = dumploc.GetCurrentUser();
CriticalDelete(dumploc);
}

if (userName == "")
userName = "NO USERNAME";

mapName = "NO MAPNAME";
foreach AllActors(class'DeusExLevelInfo', info)
mapName = info.MapName;

log("");
log("**** DXDumpInfo - User: "$userName$" - Map: "$mapName$" ****");
log("");
log(" Inventory:");

if (Inventory != None)
{
item = Inventory;
do
{
nextItem = item.Inventory;

if (item.bDisplayableInv || item.IsA('Ammo'))
{
W = DeusExWeapon(item);
if ((W != None) && W.bHandToHand && (W.ProjectileClass != None))
strCopies = " ("$W.AmmoType.AmmoAmount$" rds)";
else if (item.IsA('Ammo') && (Ammo(item).PickupViewMesh != Mesh'TestBox'))
strCopies = " ("$Ammo(item).AmmoAmount$" rds)";
else if (item.IsA('Pickup') && (Pickup(item).NumCopies > 1))
strCopies = " ("$Pickup(item).NumCopies$")";
else
strCopies = "";

log(" "$item.GetItemName(String(item.Class))$strCopies);
}
item = nextItem;
}
until (item == None);
}
else
log(" Empty");

GenerateTotalHealth();
log("");
log(" Health:");
log(" Overall - "$Health$"%");
log(" Head - "$HealthHead$"%");
log(" Torso - "$HealthTorso$"%");
log(" Left arm - "$HealthArmLeft$"%");
log(" Right arm - "$HealthArmRight$"%");
log(" Left leg - "$HealthLegLeft$"%");
log(" Right leg - "$HealthLegRight$"%");

log("");
log(" BioElectric Energy:");
log(" "$Int(Energy)$"%");

log("");
log(" Credits:");
log(" "$Credits);

log("");
log(" Skill Points:");
log(" Available - "$SkillPointsAvail);
log(" Total Earned - "$SkillPointsTotal);

log("");
log(" Skills:");
if (SkillSystem != None)
{
skill = SkillSystem.FirstSkill;
while (skill != None)
{
if (skill.SkillName != "")
log(" "$skill.SkillName$" - "$skill.skillLevelStrings[skill.CurrentLevel]);

skill = skill.next;
}
}

bHasAugs = False;
log("");
log(" Augmentations:");
if (AugmentationSystem != None)
{
aug = AugmentationSystem.FirstAug;
while (aug != None)
{
if (aug.bHasIt && (aug.AugmentationLocation != LOC_Default) && (aug.AugmentationName != ""))
{
bHasAugs = True;
log(" "$aug.AugmentationName$" - Location: "$aug.AugLocsText[aug.AugmentationLocation]$" - Level: "$aug.CurrentLevel+1);
}

aug = aug.next;
}
}

if (!bHasAugs)
log(" None");

log("");
log("**** DXDumpInfo - END ****");
log("");

ClientMessage("Info dumped for user "$userName);

DXReduceDamage (int Damage, name damageType, vector hitLocation, out int adjustedDamage, bool bCheckOnly) -> bool


local float newDamage;
local float augLevel, skillLevel;
local float pct;
local HazMatSuit suit;
local BallisticArmor armor;
local bool bReduced;


bReduced = False;
newDamage = Float(Damage);

if ((damageType == 'TearGas') || (damageType == 'PoisonGas') || (damageType == 'Radiation') ||
(damageType == 'HalonGas') || (damageType == 'PoisonEffect') || (damageType == 'Poison'))
{
if (AugmentationSystem != None)
augLevel = AugmentationSystem.GetAugLevelValue(class'AugEnviro');

if (augLevel >= 0.0)
newDamage *= augLevel;

// get rid of poison if we're maxed out
if (newDamage ~= 0.0)
{
StopPoison();
drugEffectTimer -= 4; // stop the drunk effect
if (drugEffectTimer < 0)
drugEffectTimer = 0;
}

// go through the actor list looking for owned HazMatSuits
// since they aren't in the inventory anymore after they are used


//foreach AllActors(class'HazMatSuit', suit)
// if ((suit.Owner == Self) && suit.bActive)
if (UsingChargedPickup(class'HazMatSuit'))
{
skillLevel = SkillSystem.GetSkillLevelValue(class'SkillEnviro');
newDamage *= 0.75 * skillLevel;
}
}

if ((damageType == 'Shot') || (damageType == 'Sabot') || (damageType == 'Exploded') || (damageType == 'AutoShot'))
{
// go through the actor list looking for owned BallisticArmor
// since they aren't in the inventory anymore after they are used
if (UsingChargedPickup(class'BallisticArmor'))
{
skillLevel = SkillSystem.GetSkillLevelValue(class'SkillEnviro');
newDamage *= 0.5 * skillLevel;
}
}

if (damageType == 'HalonGas')
{
if (bOnFire && !bCheckOnly)
ExtinguishFire();
}

if ((damageType == 'Shot') || (damageType == 'AutoShot'))
{
if (AugmentationSystem != None)
augLevel = AugmentationSystem.GetAugLevelValue(class'AugBallistic');

if (augLevel >= 0.0)
newDamage *= augLevel;
}

if (damageType == 'EMP')
{
if (AugmentationSystem != None)
augLevel = AugmentationSystem.GetAugLevelValue(class'AugEMP');

if (augLevel >= 0.0)
newDamage *= augLevel;
}

if ((damageType == 'Burned') || (damageType == 'Flamed') ||
(damageType == 'Exploded') || (damageType == 'Shocked'))
{
if (AugmentationSystem != None)
augLevel = AugmentationSystem.GetAugLevelValue(class'AugShield');

if (augLevel >= 0.0)
newDamage *= augLevel;
}

if (newDamage < Damage)
{
if (!bCheckOnly)
{
pct = 1.0 - (newDamage / Float(Damage));
SetDamagePercent(pct);
ClientFlash(0.01, vect(0, 0, 50));
}
bReduced = True;
}
else
{
if (!bCheckOnly)
SetDamagePercent(0.0);
}


//
// Reduce or increase the damage based on the combat difficulty setting
//
if ((damageType == 'Shot') || (damageType == 'AutoShot'))
{
newDamage *= CombatDifficulty;

// always take at least one point of damage
if ((newDamage <= 1) && (Damage > 0))
newDamage = 1;
}

adjustedDamage = Int(newDamage);

return bReduced;

DamageAll (optional int amount)


if (!bCheatsEnabled)
return;

if (amount == 0)
amount = 1000;

HealthHead -= Min(HealthHead, amount);
HealthTorso -= Min(HealthTorso, amount);
HealthArmLeft -= Min(HealthArmLeft, amount);
HealthArmRight -= Min(HealthArmRight, amount);
HealthLegLeft -= Min(HealthLegLeft, amount);
HealthLegRight -= Min(HealthLegRight, amount);

DamagePart (int partIndex, optional int amount)


if (!bCheatsEnabled)
return;

if (amount == 0)
amount = 1000;

switch(partIndex)
{
case 0: // head
HealthHead -= Min(HealthHead, amount);
break;

case 1: // torso
HealthTorso -= Min(HealthTorso, amount);
break;

case 2: // left arm
HealthArmLeft -= Min(HealthArmLeft, amount);
break;

case 3: // right arm
HealthArmRight -= Min(HealthArmRight, amount);
break;

case 4: // left leg
HealthLegLeft -= Min(HealthLegLeft, amount);
break;

case 5: // right leg
HealthLegRight -= Min(HealthLegRight, amount);
break;
}

DeactivateAllAugs


if (AugmentationSystem != None)
AugmentationSystem.DeactivateAll();

DebugCommand (string teststr)


if (!bCheatsEnabled)
return;

if (GlobalDebugObj == None)
GlobalDebugObj = new(Self) class'DebugInfo';

if (GlobalDebugObj != None)
GlobalDebugObj.Command(teststr);

DeleteAllGoals


local DeusExGoal goal;
local DeusExGoal goalNext;


goal = FirstGoal;

while( goal != None )
{
goalNext = goal.next;
DeleteGoal(goal);
goal = goalNext;
}

FirstGoal = None;
LastGoal = None;

DeleteAllNotes


local DeusExNote note;
local DeusExNote noteNext;


note = FirstNote;

while( note != None )
{
noteNext = note.next;
DeleteNote(note);
note = noteNext;
}

FirstNote = None;
LastNote = None;

DeleteGoal (DeusExGoal goalToDelete) -> Bool


local DeusExGoal goal;
local DeusExGoal previousGoal;
local Bool bGoalDeleted;


bGoalDeleted = False;
goal = FirstGoal;
previousGoal = None;

while( goal != None )
{
if ( goal == goalToDelete )
{
if ( goal == FirstGoal )
FirstGoal = goal.next;

if ( goal == LastGoal )
LastGoal = previousGoal;

if ( previousGoal != None )
previousGoal.next = goal.next;

goal = None;

bGoalDeleted = True;
break;
}
previousGoal = goal;
goal = goal.next;
}

return bGoalDeleted;

DeleteInventory (inventory item) -> bool


local bool retval;
local DeusExRootWindow root;
local PersonaScreenInventory winInv;


// If the item was inHand, clear the inHand
if (inHand == item)
{
SetInHand(None);
SetInHandPending(None);
}

// Make sure the item is removed from the inventory grid
RemoveItemFromSlot(item);

root = DeusExRootWindow(rootWindow);

if (root != None)
{
// If the inventory screen is active, we need to send notification
// that the item is being removed
winInv = PersonaScreenInventory(root.GetTopWindow());
if (winInv != None)
winInv.InventoryDeleted(item);

// Remove the item from the object belt
if (root != None)
root.DeleteInventory(item);
else //In multiplayer, we often don't have a root window when creating corpse, so hand delete
{
item.bInObjectBelt = false;
item.beltPos = -1;
}
}

return Super.DeleteInventory(item);

DeleteNote (DeusExNote noteToDelete) -> Bool


local DeusExNote note;
local DeusExNote previousNote;
local Bool bNoteDeleted;


bNoteDeleted = False;
note = FirstNote;
previousNote = None;

while( note != None )
{
if ( note == noteToDelete )
{
if ( note == FirstNote )
FirstNote = note.next;

if ( note == LastNote )
LastNote = previousNote;

if ( previousNote != None )
previousNote.next = note.next;

note = None;

bNoteDeleted = True;
break;
}
previousNote = note;
note = note.next;
}

return bNoteDeleted;

DeleteSaveGameFiles (optional String saveDirectory) | native

Destroyed


if (GlobalDebugObj != None)
CriticalDelete(GlobalDebugObj);

ClearAugmentationDisplay();

if (Role == ROLE_Authority)
CloseThisComputer(ActiveComputer);
ActiveComputer = None;

Super.Destroyed();

Died (pawn Killer, name damageType, vector HitLocation)


if (conPlay != None)
conPlay.TerminateConversation();

if (bOnFire)
ExtinguishFire();

if (AugmentationSystem != None)
AugmentationSystem.DeactivateAll();

if ((Level.NetMode == NM_DedicatedServer) || (Level.NetMode == NM_ListenServer))
ClientDeath();

Super.Died(Killer, damageType, HitLocation);

DisconnectPlayer


if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).ClearWindowStack();

if (PlayerIsRemoteClient())
ConsoleCommand("disconnect");

if (PlayerIsListenClient())
ConsoleCommand("start dx.dx");

DoFrob (Actor Frobber, Inventory frobWith)


local DeusExRootWindow root;
local Ammo ammo;
local Inventory item;
local Actor A;


// make sure nothing is based on us if we're an inventory
if (FrobTarget.IsA('Inventory'))
foreach FrobTarget.BasedActors(class'Actor', A)
A.SetBase(None);

FrobTarget.Frob(Frobber, frobWith);

// if the object destroyed itself, get out
if (FrobTarget == None)
return;

// if the inventory item aborted it's own pickup, get out
if (FrobTarget.IsA('Inventory') && (FrobTarget.Owner != Self))
return;

// alert NPCs that I'm messing with stuff
if (FrobTarget.bOwned)
AISendEvent('Futz', EAITYPE_Visual);

// play an animation
PlayPickupAnim(FrobTarget.Location);

// set the base so the inventory follows us around correctly
if (FrobTarget.IsA('Inventory'))
FrobTarget.SetBase(Frobber);

DoJump (optional float F)


local DeusExWeapon w;
local float scaleFactor, augLevel;


if ((CarriedDecoration != None) && (CarriedDecoration.Mass > 20))
return;
else if (bForceDuck || IsLeaning())
return;

if (Physics == PHYS_Walking)
{
if ( Role == ROLE_Authority )
PlaySound(JumpSound, SLOT_None, 1.5, true, 1200, 1.0 - 0.2*FRand() );
if ( (Level.Game != None) && (Level.Game.Difficulty > 0) )
MakeNoise(0.1 * Level.Game.Difficulty);
PlayInAir();

Velocity.Z = JumpZ;

if ( Level.NetMode != NM_Standalone )
{
if (AugmentationSystem == None)
augLevel = -1.0;
else
augLevel = AugmentationSystem.GetAugLevelValue(class'AugSpeed');
w = DeusExWeapon(InHand);
if ((augLevel != -1.0) && ( w != None ) && ( w.Mass > 30.0))
{
scaleFactor = 1.0 - FClamp( ((w.Mass - 30.0)/55.0), 0.0, 0.5 );
Velocity.Z *= scaleFactor;
}
}

// reduce the jump velocity if you are crouching
// if (bIsCrouching)
// Velocity.Z *= 0.9;

if ( Base != Level )
Velocity.Z += Base.Velocity.Z;
SetPhysics(PHYS_Falling);
if ( bCountJumps && (Role == ROLE_Authority) )
Inventory.OwnerJumped();
}

DoneReloading (DeusExWeapon weapon)

DrawInvulnShield


if (( InvulnSph != None ) || (Level.NetMode == NM_Standalone))
return;

InvulnSph = Spawn(class'InvulnSphere', Self, , Location, Rotation );
if ( InvulnSph != None )
{
InvulnSph.SetBase( Self );
InvulnSph.RemoteRole = ROLE_None;
InvulnSph.AttachedPlayer = Self;
InvulnSph.LifeSpan = NintendoImmunityTimeLeft;
}

DrawShield


local ShieldEffect shield;


if (DamageShield != None)
{
return;
}

shield = Spawn(class'ShieldEffect', Self,, Location, Rotation);
if (shield != None)
{
shield.SetBase(Self);
shield.RemoteRole = ROLE_None;
shield.AttachedPlayer = Self;
}

DamageShield = shield;

DroneExplode


local AugDrone anAug;


if (aDrone != None)
{
aDrone.Explode(aDrone.Location, vect(0,0,1));
//DEUS_EX AMSD Don't blow up OTHER player drones...
anAug = AugDrone(AugmentationSystem.FindAugmentation(class'AugDrone'));
//foreach AllActors(class'AugDrone', anAug)
if (anAug != None)
anAug.Deactivate();
}

DropDecoration


local Vector X, Y, Z, dropVect, origLoc, HitLocation, HitNormal, extent;
local float velscale, size, mult;
local bool bSuccess;
local Actor hitActor;


bSuccess = False;

if (CarriedDecoration != None)
{
origLoc = CarriedDecoration.Location;
GetAxes(Rotation, X, Y, Z);

// if we are highlighting something, try to place the object on the target
if ((FrobTarget != None) && !FrobTarget.IsA('Pawn'))
{
CarriedDecoration.Velocity = vect(0,0,0);

// try to drop the object about one foot above the target
size = FrobTarget.CollisionRadius - CarriedDecoration.CollisionRadius * 2;
dropVect.X = size/2 - FRand() * size;
dropVect.Y = size/2 - FRand() * size;
dropVect.Z = FrobTarget.CollisionHeight + CarriedDecoration.CollisionHeight + 16;
dropVect += FrobTarget.Location;
}
else
{
// throw velocity is based on augmentation
if (AugmentationSystem != None)
{
mult = AugmentationSystem.GetAugLevelValue(class'AugMuscle');
if (mult == -1.0)
mult = 1.0;
}

if (IsLeaning())
CarriedDecoration.Velocity = vect(0,0,0);
else
CarriedDecoration.Velocity = Vector(ViewRotation) * mult * 500 + vect(0,0,220) + 40 * VRand();

// scale it based on the mass
velscale = FClamp(CarriedDecoration.Mass / 20.0, 1.0, 40.0);

CarriedDecoration.Velocity /= velscale;
dropVect = Location + (CarriedDecoration.CollisionRadius + CollisionRadius + 4) * X;
dropVect.Z += BaseEyeHeight;
}

// is anything blocking the drop point? (like thin doors)
if (FastTrace(dropVect))
{
CarriedDecoration.SetCollision(True, True, True);
CarriedDecoration.bCollideWorld = True;

// check to see if there's space there
extent.X = CarriedDecoration.CollisionRadius;
extent.Y = CarriedDecoration.CollisionRadius;
extent.Z = 1;
hitActor = Trace(HitLocation, HitNormal, dropVect, CarriedDecoration.Location, True, extent);

if ((hitActor == None) && CarriedDecoration.SetLocation(dropVect))
bSuccess = True;
else
{
CarriedDecoration.SetCollision(False, False, False);
CarriedDecoration.bCollideWorld = False;
}
}

// if we can drop it here, then drop it
if (bSuccess)
{
CarriedDecoration.bWasCarried = True;
CarriedDecoration.SetBase(None);
CarriedDecoration.SetPhysics(PHYS_Falling);
CarriedDecoration.Instigator = Self;

// turn off translucency
CarriedDecoration.Style = CarriedDecoration.Default.Style;
CarriedDecoration.bUnlit = CarriedDecoration.Default.bUnlit;
if (CarriedDecoration.IsA('DeusExDecoration'))
DeusExDecoration(CarriedDecoration).ResetScaleGlow();

CarriedDecoration = None;
}
else
{
// otherwise, don't drop it and display a message
CarriedDecoration.SetLocation(origLoc);
ClientMessage(CannotDropHere);
}
}

DropItem (optional Inventory inv, optional bool bDrop) -> bool


local Inventory item;
local Inventory previousItemInHand;
local Vector X, Y, Z, dropVect;
local float size, mult;
local DeusExCarcass carc;
local class carcClass;
local bool bDropped;
local bool bRemovedFromSlots;
local int itemPosX, itemPosY;


bDropped = True;

if (RestrictInput())
return False;

if (inv == None)
{
previousItemInHand = inHand;
item = inHand;
}
else
{
item = inv;
}

if (item != None)
{
GetAxes(Rotation, X, Y, Z);
dropVect = Location + (CollisionRadius + 2*item.CollisionRadius) * X;
dropVect.Z += BaseEyeHeight;

// check to see if we're blocked by terrain
if (!FastTrace(dropVect))
{
ClientMessage(CannotDropHere);
return False;
}

// don't drop it if it's in a strange state
if (item.IsA('DeusExWeapon'))
{
if (!DeusExWeapon(item).IsInState('Idle') && !DeusExWeapon(item).IsInState('Idle2') &&
!DeusExWeapon(item).IsInState('DownWeapon') && !DeusExWeapon(item).IsInState('Reload'))
{
return False;
}
else // make sure the scope/laser are turned off
{
DeusExWeapon(item).ScopeOff();
DeusExWeapon(item).LaserOff();
}
}

// Don't allow active ChargedPickups to be dropped
if ((item.IsA('ChargedPickup')) && (ChargedPickup(item).IsActive()))
{
return False;
}

// don't let us throw away the nanokeyring
if (item.IsA('NanoKeyRing'))
{
return False;
}

// take it out of our hand
if (item == inHand)
PutInHand(None);

// handle throwing pickups that stack
if (item.IsA('DeusExPickup'))
{
// turn it off if it is on
if (DeusExPickup(item).bActive)
DeusExPickup(item).Activate();

DeusExPickup(item).NumCopies--;
UpdateBeltText(item);

if (DeusExPickup(item).NumCopies > 0)
{
// put it back in our hand, but only if it was in our
// hand originally!!!
if (previousItemInHand == item)
PutInHand(previousItemInHand);

item = Spawn(item.Class, Owner);
}
else
{
// Keep track of this so we can undo it
// if necessary
bRemovedFromSlots = True;
itemPosX = item.invPosX;
itemPosY = item.invPosY;

// Remove it from the inventory slot grid
RemoveItemFromSlot(item);

// make sure we have one copy to throw!
DeusExPickup(item).NumCopies = 1;
}
}
else
{
// Keep track of this so we can undo it
// if necessary
bRemovedFromSlots = True;
itemPosX = item.invPosX;
itemPosY = item.invPosY;

// Remove it from the inventory slot grid
RemoveItemFromSlot(item);
}

// if we are highlighting something, try to place the object on the target
if ((FrobTarget != None) && !item.IsA('POVCorpse'))
{
item.Velocity = vect(0,0,0);

// play the correct anim
PlayPickupAnim(FrobTarget.Location);

// try to drop the object about one foot above the target
size = FrobTarget.CollisionRadius - item.CollisionRadius * 2;
dropVect.X = size/2 - FRand() * size;
dropVect.Y = size/2 - FRand() * size;
dropVect.Z = FrobTarget.CollisionHeight + item.CollisionHeight + 16;
if (FastTrace(dropVect))
{
item.DropFrom(FrobTarget.Location + dropVect);
}
else
{
ClientMessage(CannotDropHere);
bDropped = False;
}
}
else
{
// throw velocity is based on augmentation
if (AugmentationSystem != None)
{
mult = AugmentationSystem.GetAugLevelValue(class'AugMuscle');
if (mult == -1.0)
mult = 1.0;
}

if (bDrop)
{
item.Velocity = VRand() * 30;

// play the correct anim
PlayPickupAnim(item.Location);
}
else
{
item.Velocity = Vector(ViewRotation) * mult * 300 + vect(0,0,220) + 40 * VRand();

// play a throw anim
PlayAnim('Attack',,0.1);
}

GetAxes(ViewRotation, X, Y, Z);
dropVect = Location + 0.8 * CollisionRadius * X;
dropVect.Z += BaseEyeHeight;

// if we are a corpse, spawn the actual carcass
if (item.IsA('POVCorpse'))
{
if (POVCorpse(item).carcClassString != "")
{
carcClass = class(DynamicLoadObject(POVCorpse(item).carcClassString, class'Class'));
if (carcClass != None)
{
carc = Spawn(carcClass);
if (carc != None)
{
carc.Mesh = carc.Mesh2;
carc.KillerAlliance = POVCorpse(item).KillerAlliance;
carc.KillerBindName = POVCorpse(item).KillerBindName;
carc.Alliance = POVCorpse(item).Alliance;
carc.bNotDead = POVCorpse(item).bNotDead;
carc.bEmitCarcass = POVCorpse(item).bEmitCarcass;
carc.CumulativeDamage = POVCorpse(item).CumulativeDamage;
carc.MaxDamage = POVCorpse(item).MaxDamage;
carc.itemName = POVCorpse(item).CorpseItemName;
carc.CarcassName = POVCorpse(item).CarcassName;
carc.Velocity = item.Velocity * 0.5;
item.Velocity = vect(0,0,0);
carc.bHidden = False;
carc.SetPhysics(PHYS_Falling);
carc.SetScaleGlow();
if (carc.SetLocation(dropVect))
{
// must circumvent PutInHand() since it won't allow
// things in hand when you're carrying a corpse
SetInHandPending(None);
item.Destroy();
item = None;
}
else
carc.bHidden = True;
}
}
}
}
else
{
if (FastTrace(dropVect))
{
item.DropFrom(dropVect);
item.bFixedRotationDir = True;
item.RotationRate.Pitch = (32768 - Rand(65536)) * 4.0;
item.RotationRate.Yaw = (32768 - Rand(65536)) * 4.0;
}
}
}

// if we failed to drop it, put it back inHand
if (item != None)
{
if (((inHand == None) || (inHandPending == None)) && (item.Physics != PHYS_Falling))
{
PutInHand(item);
ClientMessage(CannotDropHere);
bDropped = False;
}
else
{
item.Instigator = Self;
}
}
}
else if (CarriedDecoration != None)
{
DropDecoration();

// play a throw anim
PlayAnim('Attack',,0.1);
}

// If the drop failed and we removed the item from the inventory
// grid, then we need to stick it back where it came from so
// the inventory doesn't get fucked up.

if ((bRemovedFromSlots) && (item != None) && (!bDropped))
{
//DEUS_EX AMSD Use the function call for this, helps multiplayer
PlaceItemInSlot(item, itemPosX, itemPosY);
}

return bDropped;

DrugEffects (float deltaTime)


local float mult, fov;
local Rotator rot;
local DeusExRootWindow root;


root = DeusExRootWindow(rootWindow);

// random wandering and swaying when drugged
if (drugEffectTimer > 0)
{
if ((root != None) && (root.hud != None))
{
if (root.hud.background == None)
{
root.hud.SetBackground(Texture'DrunkFX');
root.hud.SetBackgroundSmoothing(True);
root.hud.SetBackgroundStretching(True);
root.hud.SetBackgroundStyle(DSTY_Modulated);
}
}

mult = FClamp(drugEffectTimer / 10.0, 0.0, 3.0);
rot.Pitch = 1024.0 * Cos(Level.TimeSeconds * mult) * deltaTime * mult;
rot.Yaw = 1024.0 * Sin(Level.TimeSeconds * mult) * deltaTime * mult;
rot.Roll = 0;

rot.Pitch = FClamp(rot.Pitch, -4096, 4096);
rot.Yaw = FClamp(rot.Yaw, -4096, 4096);

ViewRotation += rot;

if ( Level.NetMode == NM_Standalone )
{
fov = Default.DesiredFOV - drugEffectTimer + Rand(2);
fov = FClamp(fov, 30, Default.DesiredFOV);
DesiredFOV = fov;
}
else
DesiredFOV = Default.DesiredFOV;

drugEffectTimer -= deltaTime;
if (drugEffectTimer < 0)
drugEffectTimer = 0;
}
else
{
if ((root != None) && (root.hud != None))
{
if (root.hud.background != None)
{
root.hud.SetBackground(None);
root.hud.SetBackgroundStyle(DSTY_Normal);
DesiredFOV = Default.DesiredFOV;
}
}
}

DumpInventoryGrid


local int slotsCol;
local int slotsRow;
local String gridRow;


log("DumpInventoryGrid()");
log("=============================================================");

log(" 1 2 3 4 5");
log("-----------------");


for( slotsRow=0; slotsRow < maxInvRows; slotsRow++ )
{
gridRow = "Row #" $ slotsRow $ ": ";

for ( slotsCol=0; slotsCol < maxInvCols; slotsCol++ )
{
if ( invSlots[(slotsRow * maxInvCols) + slotsCol] == 1)
gridRow = gridRow $ "X ";
else
gridRow = gridRow $ " ";
}

log(gridRow);
}
log("=============================================================");

EditFlags


if (!bCheatsEnabled)
return;

InvokeUIScreen(Class'FlagEditWindow');

EndConversation


local DeusExLevelInfo info;


Super.EndConversation();

// If we're in a bForcePlay (cinematic) conversation,
// force the CinematicWindow to be displayd
if ((conPlay != None) && (conPlay.GetForcePlay()))
{
if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).NewChild(class'CinematicWindow');
}

conPlay = None;

// Check to see if we need to resume any DataLinks that may have
// been aborted when we started this conversation
ResumeDataLinks();

StopBlendAnims();

// We might already be dead at this point (someone drop a LAM before
// entering the conversation?) so we want to make sure the player
// doesn't suddenly jump into a non-DEATH state.
//
// Also make sure the player is actually in the Conversation state
// before attempting to kick him out of it.

if ((Health > 0) && ((IsInState('Conversation')) || (IsInState('FirstPersonConversation')) || (NextState == 'Interpolating')))
{
if (NextState == '')
GotoState('PlayerWalking');
else
GotoState(NextState);
}

EndState


conPlay = None;

// Re-enable the PC's detectability
MakePlayerIgnored(false);

MoveTarget = None;
bBehindView = false;
StopBlendAnims();
ConversationActor = None;

ExtinguishFire


local Fire f;


bOnFire = False;
burnTimer = 0;
SetTimer(0, False);

foreach BasedActors(class'Fire', f)
f.Destroy();

FailConsoleCheck


if (Level.Game.IsA('DeusExGameInfo'))
DeusExGameInfo(Level.Game).FailConsoleCheck(Self);

FailRootWindowCheck


if (Level.Game.IsA('DeusExGameInfo'))
DeusExGameInfo(Level.Game).FailRootWindowCheck(Self);

FindGoal (Name goalName) -> DeusExGoal


local DeusExGoal goal;


goal = FirstGoal;

while( goal != None )
{
if ( goalName == goal.goalName )
break;

goal = goal.next;
}

return goal;

FindInventorySlot (Inventory anItem, optional Bool bSearchOnly) -> Bool


local bool bPositionFound;
local int row;
local int col;
local int newSlotX;
local int newSlotY;
local int beltpos;
local ammo foundAmmo;


if (anItem == None)
return False;

// Special checks for objects that do not require phsyical inventory
// in order to be picked up:
//
// - NanoKeys
// - DataVaultImages
// - Credits
// - Ammo

if ((anItem.IsA('DataVaultImage')) || (anItem.IsA('NanoKey')) || (anItem.IsA('Credits')) || (anItem.IsA('Ammo')))
return True;

bPositionFound = False;
// DEUS_EX AMSD In multiplayer, due to propagation delays, the inventory refreshers in the
// personascreeninventory can keep bouncing items back and forth. So just return true and
// place the item where it already was.
if ((anItem.invPosX != -1) && (anItem.invPosY != -1) && (Level.NetMode != NM_Standalone) && (!bSearchOnly))
{
SetInvSlots(anItem,1);
log("Trying to place item "$anItem$" when already placed at "$anItem.invPosX$", "$anItem.invPosY$".");
return True;
}

// Loop through all slots, looking for a fit
for (row=0; row {
if (row + anItem.invSlotsY > maxInvRows)
break;

// Make sure the item can fit vertically
for(col=0; col {
if (IsEmptyItemSlot(anItem, col, row ))
{
bPositionFound = True;
break;
}
}

if (bPositionFound)
break;
}

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
{
bPositionFound = False;
beltpos = 0;
if (DeusExRootWindow(rootWindow) != None)
{
for (beltpos = 0; beltpos < ArrayCount(DeusExRootWindow(rootWindow).hud.belt.objects); beltpos++)
{
if ( (DeusExRootWindow(rootWindow).hud.belt.objects[beltpos].item == None) && (anItem.TestMPBeltSpot(beltpos)) )
{
bPositionFound = True;
}
}
}
else
{
log("no belt to check");
}
}

if ((bPositionFound) && (!bSearchOnly))
{
PlaceItemInSlot(anItem, col, row);
}

return bPositionFound;

FindInventorySlotXY (int invSlotsX, int invSlotsY, out int newSlotX, out int newSlotY) -> Bool


local bool bPositionFound;
local int row;
local int col;


bPositionFound = False;

// Loop through all slots, looking for a fit
for (row=0; row {
if (row + invSlotsY > maxInvRows)
break;

// Make sure the item can fit vertically
for(col=0; col {
if (IsEmptyItemSlotXY(invSlotsX, invSlotsY, col, row))
{
newSlotX = col;
newSlotY = row;

bPositionFound = True;
break;
}
}

if (bPositionFound)
break;
}

return bPositionFound;

Fire (optional float F)


if (RestrictInput())
{
if (bHidden)
ShowMainMenu();
return;
}

Super.Fire(F);

Fly


if (RestrictInput())
return;

if (!bCheatsEnabled)
return;

Super.Fly();

ForceDisconnect (string Message)


player.Console.AddString(Message);
DisconnectPlayer();

ForceDroneOff


local AugDrone anAug;


anAug = AugDrone(AugmentationSystem.FindAugmentation(class'AugDrone'));
//foreach AllActors(class'AugDrone', anAug)
if (anAug != None)
anAug.Deactivate();

GenerateTotalHealth


local float ave, avecrit;


ave = (HealthLegLeft + HealthLegRight + HealthArmLeft + HealthArmRight) / 4.0;

if ((HealthHead <= 0) || (HealthTorso <= 0))
avecrit = 0;
else
avecrit = (HealthHead + HealthTorso) / 2.0;

if (avecrit == 0)
Health = 0;
else
Health = (ave + avecrit) / 2.0;

GetActiveConversation (Actor invokeActor, EInvokeMethod invokeMethod) -> Conversation


local ConListItem conListItem;
local Conversation con;
local Name flagName;
local bool bAbortConversation;


// If we don't have a valid invokeActor or the flagbase
// hasn't yet been initialized, immediately abort.
if ((invokeActor == None) || (flagBase == None))
return None;

bAbortConversation = True;

// Force there to be a one second minimum between conversations
// with the same NPC
if ((invokeActor.LastConEndTime != 0) &&
((Level.TimeSeconds - invokeActor.LastConEndTime) < 1.0))
return None;

// In a loop, go through the conversations, checking each.
conListItem = ConListItem(invokeActor.ConListItems);

while ( conListItem != None )
{
con = conListItem.con;

bAbortConversation = False;

// Ignore Bark conversations, as these are started manually
// by the AI system. Do this by checking to see if the first
// part of the conversation name is in the form,
//
// ConversationOwner_Bark

if (Left(con.conName, Len(con.conOwnerName) + 5) == (con.conOwnerName $ "_Bark"))
bAbortConversation = True;

if (!bAbortConversation)
{
// Now check the invocation method to make sure
// it matches what was passed in

switch( invokeMethod )
{
// Removed Bump conversation starting functionality, all convos
// must now be "Frobbed" to start (excepting Radius, of course).
case IM_Bump:
case IM_Frob:
bAbortConversation = !(con.bInvokeFrob || con.bInvokeBump);
break;

case IM_Sight:
bAbortConversation = !con.bInvokeSight;
break;

case IM_Radius:
if ( con.bInvokeRadius )
{
// Calculate the distance between the player and the owner
// and if the player is inside that radius, we've passed
// this check.

bAbortConversation = !CheckConversationInvokeRadius(invokeActor, con);

// First check to make sure that at least 10 seconds have passed
// before playing a radius-induced conversation after a letterbox
// conversation with the player
//
// Check:
//
// 1. Player finished letterbox convo in last 10 seconds
// 2. Conversation was with this NPC
// 3. This new radius conversation is with same NPC.

if ((!bAbortConversation) &&
((Level.TimeSeconds - lastThirdPersonConvoTime) < 10) &&
(lastThirdPersonConvoActor == invokeActor))
bAbortConversation = True;

// Now check if this conversation ended in the last ten seconds or so
// We want to prevent the user from getting trapped inside the same
// radius conversation

if ((!bAbortConversation) && (con.lastPlayedTime > 0))
bAbortConversation = ((Level.TimeSeconds - con.lastPlayedTime) < 10);

// Now check to see if the player just ended a radius, third-person
// conversation with this NPC in the last 5 seconds. If so, punt,
// because we don't want these to chain together too quickly.

if ((!bAbortConversation) &&
((Level.TimeSeconds - lastFirstPersonConvoTime) < 5) &&
(lastFirstPersonConvoActor == invokeActor))
bAbortConversation = True;
}
else
{
bAbortConversation = True;
}
break;

case IM_Other:
default:
break;
}
}

// Now check to see if these two actors are too far apart on their Z
// axis so we don't get conversations triggered when someone jumps on
// someone else, or when actors are on two different levels.

if (!bAbortConversation)
{
bAbortConversation = !CheckConversationHeightDifference(invokeActor, 20);

// If the height check failed, look to see if the actor has a LOS view
// to the player in which case we'll allow the conversation to continue

if (bAbortConversation)
bAbortConversation = !CanActorSeePlayer(invokeActor);
}

// Check if this conversation is only to be played once
if (( !bAbortConversation ) && ( con.bDisplayOnce ))
{
flagName = rootWindow.StringToName(con.conName $ "_Played");
bAbortConversation = (flagBase.GetBool(flagName) == True);
}

if ( !bAbortConversation )
{
// Then check to make sure all the flags that need to be
// set are.

bAbortConversation = !CheckFlagRefs(con.flagRefList);
}

if ( !bAbortConversation )
break;

conListItem = conListItem.next;
}

if (bAbortConversation)
return None;
else
return con;


local Name flagName;
local ConListItem conListItem;
local Conversation con;
local bool bAbortDataLink;
local bool bDatalinkFound;
local bool bDataLinkNameFound;


// Abort immediately if the flagbase isn't yet initialized
if ((flagBase == None) || (rootWindow == None))
return None;

conListItem = ConListItem(conListItems);

// In a loop, go through the conversations, checking each.
while ( conListItem != None )
{
con = conListItem.con;

if ( Caps(datalinkName) == Caps(con.conName) )
{
// Now check if this DataLink is only to be played
// once

bDataLinkNameFound = True;
bAbortDataLink = False;

if ( con.bDisplayOnce )
{
flagName = rootWindow.StringToName(con.conName $ "_Played");
bAbortDataLink = (flagBase.GetBool(flagName) == True);
}

// Check the flags for this DataLink
if (( !bAbortDataLink ) && ( CheckFlagRefs( con.flagRefList ) == True ))
{
bDatalinkFound = True;
break;
}
}
conListItem = conListItem.next;
}

if (bDatalinkFound)
{
return con;
}
else
{
// Print a warning if this DL couldn't be found based on its name
if (bDataLinkNameFound == False)
{
log("WARNING! INFOLINK NOT FOUND!! Name = " $ datalinkName);
ClientMessage("WARNING! INFOLINK NOT FOUND!! Name = " $ datalinkName);
}
return None;
}

GetAugPriority (Augmentation AugToCheck) -> int


local Name AugName;
local int PriorityIndex;


AugName = AugToCheck.Class.Name;

if (AugToCheck.bHasIt)
return -1;

for (PriorityIndex = 0; PriorityIndex < ArrayCount(AugPrefs); PriorityIndex++)
{
if (AugPrefs[PriorityIndex] == AugName)
{
return PriorityIndex;
}
if (AugPrefs[PriorityIndex] == '')
{
return PriorityIndex;
}
}

return PriorityIndex;

GetCurrentGroundSpeed -> float


local float augValue, speed;


// Remove this later and find who's causing this to Access None MB
if ( AugmentationSystem == None )
return 0;

augValue = AugmentationSystem.GetAugLevelValue(class'AugSpeed');

if (augValue == -1.0)
augValue = 1.0;

if (( Level.NetMode != NM_Standalone ) && Self.IsA('Human') )
speed = Human(Self).mpGroundSpeed * augValue;
else
speed = Default.GroundSpeed * augValue;

return speed;

GetDebug (name cmd)


local string temp;


if (!bCheatsEnabled)
return;

if (GlobalDebugObj == None)
GlobalDebugObj = new(Self) class'DebugInfo';

if (GlobalDebugObj != None)
{
temp=GlobalDebugObj.GetString(String(cmd));
Log("Debug String " $ cmd $ " has value " $ temp);
}

GetDefaultCollisionHeight -> float


return (Default.CollisionHeight-4.5);

GetDeusExVersion | native

GetDisplayName (Actor actor, optional Bool bUseFamiliar) -> String


local String displayName;


// Sanity check
if ((actor == None) || (player == None) || (rootWindow == None))
return "";

// If we've spoken to this person already, use the
// Familiar Name
if ((actor.FamiliarName != "") && ((actor.LastConEndTime > 0) || (bUseFamiliar)))
displayName = actor.FamiliarName;

if ((displayName == "") && (actor.UnfamiliarName != ""))
displayName = actor.UnfamiliarName;

if (displayName == "")
{
if (actor.IsA('DeusExDecoration'))
displayName = DeusExDecoration(actor).itemName;
else
displayName = actor.BindName;
}

return displayName;

GetFloorMaterial -> name


local vector EndTrace, HitLocation, HitNormal;
local actor target;
local int texFlags;
local name texName, texGroup;


// trace down to our feet
EndTrace = Location - CollisionHeight * 2 * vect(0,0,1);

foreach TraceTexture(class'Actor', target, texName, texGroup, texFlags, HitLocation, HitNormal, EndTrace)
{
if ((target == Level) || target.IsA('Mover'))
break;
}

return texGroup;

GetHUDBackgroundTranslucency -> bool


return bHUDBackgroundTranslucent;

GetHUDBorderTranslucency -> bool


return bHUDBordersTranslucent;

GetHUDBordersVisible -> bool


return bHUDBordersVisible;

GetLevelInfo -> DeusExLevelInfo


local DeusExLevelInfo info;


foreach AllActors(class'DeusExLevelInfo', info)
break;

return info;

GetLogTimeout -> Float


if (Level.NetMode == NM_Standalone)
return logTimeout;
else
return (FMax(5.0,logTimeout));

GetMPHitLocation (Vector HitLocation) -> int


local float HeadOffsetZ;
local float HeadOffsetY;
local float ArmOffset;
local vector Offset;


offset = (hitLocation - Location) << Rotation;

// calculate our hit extents
headOffsetZ = CollisionHeight * 0.78;
headOffsetY = CollisionRadius * 0.35;
armOffset = CollisionRadius * 0.35;

if (offset.z > headOffsetZ )
{
// narrow the head region
if ((Abs(offset.x) < headOffsetY) || (Abs(offset.y) < headOffsetY))
{
// Headshot, return 1;
return 1;
}
else
{
return 0;
}
}
else if (offset.z < 0.0) // Leg region
{
if (offset.y > 0.0)
{
//right leg
return 4;
}
else
{
//left leg
return 3;
}
}
else // arms and torso now one region
{
if (offset.y > armOffset)
{
return 6;
}
else if (offset.y < -armOffset)
{
return 5;
}
else
{
return 2;
}
}
return 0;

GetMaxLogLines -> Byte


return maxLogLines;

GetMenuTranslucency -> bool


return bMenusTranslucent;

GetNote (Name textTag) -> DeusExNote


local DeusExNote note;


note = FirstNote;

while( note != None )
{
if (note.textTag == textTag)
break;

note = note.next;
}

return note;

GetSkillInfoFromProj (DeusExPlayer killer, Actor proj)


local class skillClass;


if ( proj.IsA('GasGrenade') || proj.IsA('LAM') || proj.IsA('EMPGrenade') || proj.IsA('TearGas'))
skillClass = class'SkillDemolition';
else if ( proj.IsA('Rocket') || proj.IsA('RocketLAW') || proj.IsA('RocketWP') || proj.IsA('Fireball') || proj.IsA('PlasmaBolt'))
skillClass = class'SkillWeaponHeavy';
else if ( proj.IsA('Dart') || proj.IsA('DartFlare') || proj.IsA('DartPoison') || proj.IsA('Shuriken'))
skillClass = class'SkillWeaponLowTech';
else if ( proj.IsA('HECannister20mm') )
skillClass = class'SkillWeaponRifle';
else if ( proj.IsA('DeusExDecoration') )
{
killProfile.activeSkill = NoneString;
killProfile.activeSkillLevel = 0;
return;
}
if ( killer.SkillSystem != None )
{
killProfile.activeSkill = skillClass.Default.skillName;
killProfile.activeSkillLevel = killer.SkillSystem.GetSkillLevel(skillClass);
}

GetWallMaterial (out vector wallNormal) -> name


local vector EndTrace, HitLocation, HitNormal;
local actor target;
local int texFlags, grabDist;
local name texName, texGroup;


// if we are falling, then increase our grabbing distance
if (Physics == PHYS_Falling)
grabDist = 3.0;
else
grabDist = 1.5;

// trace out in front of us
EndTrace = Location + (Vector(Rotation) * CollisionRadius * grabDist);

foreach TraceTexture(class'Actor', target, texName, texGroup, texFlags, HitLocation, HitNormal, EndTrace)
{
if ((target == Level) || target.IsA('Mover'))
break;
}

wallNormal = HitNormal;

return texGroup;

GetWeaponName (DeusExWeapon w, out String name)


if ( w != None )
{
if ( WeaponGEPGun(w) != None )
name = WeaponGEPGun(w).shortName;
else if ( WeaponLAM(w) != None )
name = WeaponLAM(w).shortName;
else
name = w.itemName;
}
else
name = NoneString;

GetWeaponOrAmmo (Inventory queryItem) -> Inventory


// First check to see if this item is actually a weapon or ammo
if ((Weapon(queryItem) != None) || (Ammo(queryItem) != None))
return FindInventoryType(queryItem.Class);
else
return None;

Ghost


if (RestrictInput())
return;

if (!bCheatsEnabled)
return;

Super.Ghost();

GiveInitialInventory


local Inventory anItem;


// Give the player a pistol.

// spawn it.
if ((!Level.Game.IsA('DeusExMPGame')) || (DeusExMPGame(Level.Game).bStartWithPistol))
{
anItem = Spawn(class'WeaponPistol');
// "frob" it for pickup. This will spawn a copy and give copy to player.
anItem.Frob(Self,None);
// Set it to be in belt (it will be the first inventory item)
inventory.bInObjectBelt = True;
// destroy original.
anItem.Destroy();

// Give some starting ammo.
anItem = Spawn(class'Ammo10mm');
DeusExAmmo(anItem).AmmoAmount=50;
anItem.Frob(Self,None);
anItem.Destroy();
}

// Give the player a medkit.
anItem = Spawn(class'MedKit');
anItem.Frob(Self,None);
inventory.bInObjectBelt = True;
anItem.Destroy();

// Give them a lockpick and a multitool so they can make choices with skills
// when they come across electronics and locks
anItem = Spawn(class'Lockpick');
anItem.Frob(Self,None);
inventory.bInObjectBelt = True;
anItem.Destroy();

anItem = Spawn(class'Multitool');
anItem.Frob(Self,None);
inventory.bInObjectBelt = True;
anItem.Destroy();

GiveNanoKey (Name newKeyID, String newDescription)


if (!bCheatsEnabled)
return;

KeyRing.GiveKey(newKeyID, newDescription);
//DEUS_EX AMSD In multiplayer, propagate the key to the client if the server
if ((Role == ROLE_Authority) && (Level.NetMode != NM_Standalone))
{
KeyRing.GiveClientKey(newKeyID, newDescription);
}


GoalAdd (Name goalName, String goalText, optional bool bPrimaryGoal)


local DeusExGoal newGoal;


if (!bCheatsEnabled)
return;

newGoal = AddGoal( goalName, bPrimaryGoal );
newGoal.SetText( goalText );

GoalCompleted (Name goalName)


local DeusExGoal goal;


// Loop through all the goals until we hit the one we're
// looking for.
goal = FindGoal( goalName );

if ( goal != None )
{
// Only mark a goal as completed once!
if (!goal.IsCompleted())
{
goal.SetCompleted();
DeusExRootWindow(rootWindow).hud.msgLog.PlayLogSound(Sound'LogGoalCompleted');

// Let the player know
if ( goal.bPrimaryGoal )
ClientMessage(PrimaryGoalCompleted);
else
ClientMessage(SecondaryGoalCompleted);
}
}

GoalSetPrimary (Name goalName, bool bPrimaryGoal)


local DeusExGoal goal;


if (!bCheatsEnabled)
return;

goal = FindGoal( goalName );

if ( goal != None )
goal.SetPrimaryGoal( bPrimaryGoal );

GrabDecoration


// can't grab decorations while leaning
if (IsLeaning())
return;

// can't grab decorations while holding something else
if (inHand != None)
{
ClientMessage(HandsFull);
return;
}

if (carriedDecoration == None)
if ((FrobTarget != None) && FrobTarget.IsA('Decoration') && (Weapon == None))
if (CanBeLifted(Decoration(FrobTarget)))
{
CarriedDecoration = Decoration(FrobTarget);
PutCarriedDecorationInHand();
}

GrantAugs (int NumAugs)


local Augmentation CurrentAug;
local int PriorityIndex;
local int AugsLeft;


if (Role < ROLE_Authority)
return;
AugsLeft = NumAugs;

for (PriorityIndex = 0; PriorityIndex < ArrayCount(AugPrefs); PriorityIndex++)
{
if (AugsLeft <= 0)
{
return;
}
if (AugPrefs[PriorityIndex] == '')
{
return;
}
for (CurrentAug = AugmentationSystem.FirstAug; CurrentAug != None; CurrentAug = CurrentAug.next)
{
if ((CurrentAug.Class.Name == AugPrefs[PriorityIndex]) && (CurrentAug.bHasIt == False))
{
AugmentationSystem.GivePlayerAugmentation(CurrentAug.Class);
// Max out aug
if (CurrentAug.bHasIt)
CurrentAug.CurrentLevel = CurrentAug.MaxLevel;
AugsLeft = AugsLeft - 1;
}
}
}

HandleItemPickup (Actor FrobTarget, optional bool bSearchOnly) -> bool


local bool bCanPickup;
local bool bSlotSearchNeeded;
local Inventory foundItem;


bSlotSearchNeeded = True;
bCanPickup = True;

// Special checks for objects that do not require phsyical inventory
// in order to be picked up:
//
// - NanoKeys
// - DataVaultImages
// - Credits

if ((FrobTarget.IsA('DataVaultImage')) || (FrobTarget.IsA('NanoKey')) || (FrobTarget.IsA('Credits')))
{
bSlotSearchNeeded = False;
}
else if (FrobTarget.IsA('DeusExPickup'))
{
// If an object of this type already exists in the player's inventory *AND*
// the object is stackable, then we don't need to search.

if ((FindInventoryType(FrobTarget.Class) != None) && (DeusExPickup(FrobTarget).bCanHaveMultipleCopies))
bSlotSearchNeeded = False;
}
else
{
// If this isn't ammo or a weapon that we already have,
// check if there's enough room in the player's inventory
// to hold this item.

foundItem = GetWeaponOrAmmo(Inventory(FrobTarget));

if (foundItem != None)
{
bSlotSearchNeeded = False;

// if this is an ammo, and we're full of it, abort the pickup
if (foundItem.IsA('Ammo'))
{
if (Ammo(foundItem).AmmoAmount >= Ammo(foundItem).MaxAmmo)
{
ClientMessage(TooMuchAmmo);
bCanPickup = False;
}
}

// If this is a grenade or LAM (what a pain in the ass) then also check
// to make sure we don't have too many grenades already
else if ((foundItem.IsA('WeaponEMPGrenade')) ||
(foundItem.IsA('WeaponGasGrenade')) ||
(foundItem.IsA('WeaponNanoVirusGrenade')) ||
(foundItem.IsA('WeaponLAM')))
{
if (DeusExWeapon(foundItem).AmmoType.AmmoAmount >= DeusExWeapon(foundItem).AmmoType.MaxAmmo)
{
ClientMessage(TooMuchAmmo);
bCanPickup = False;
}
}


// Otherwise, if this is a single-use weapon, prevent the player
// from picking up

else if (foundItem.IsA('Weapon'))
{
// If these fields are set as checked, then this is a
// single use weapon, and if we already have one in our
// inventory another cannot be picked up (puke).

bCanPickup = ! ( (Weapon(foundItem).ReloadCount == 0) &&
(Weapon(foundItem).PickupAmmoCount == 0) &&
(Weapon(foundItem).AmmoName != None) );

if (!bCanPickup)
ClientMessage(Sprintf(CanCarryOnlyOne, foundItem.itemName));

}
}
}

if (bSlotSearchNeeded && bCanPickup)
{
if (FindInventorySlot(Inventory(FrobTarget), bSearchOnly) == False)
{
ClientMessage(Sprintf(InventoryFull, Inventory(FrobTarget).itemName));
bCanPickup = False;
ServerConditionalNotifyMsg( MPMSG_DropItem );
}
}

if (bCanPickup)
{
if ( (Level.NetMode != NM_Standalone) && (FrobTarget.IsA('DeusExWeapon') || FrobTarget.IsA('DeusExAmmo')) )
PlaySound(sound'WeaponPickup', SLOT_Interact, 0.5+FRand()*0.25, , 256, 0.95+FRand()*0.1);
DoFrob(Self, inHand);

// This is bad. We need to reset the number so restocking works
if ( Level.NetMode != NM_Standalone )
{
if ( FrobTarget.IsA('DeusExWeapon') && (DeusExWeapon(FrobTarget).PickupAmmoCount == 0) )
{
DeusExWeapon(FrobTarget).PickupAmmoCount = DeusExWeapon(FrobTarget).Default.mpPickupAmmoCount * 3;
}
}
}

return bCanPickup;

HandleWalking


Super.HandleWalking();

if (bAlwaysRun)
bIsWalking = (bRun != 0) || (bDuck != 0);
else
bIsWalking = (bRun == 0) || (bDuck != 0);

// handle the toggle walk key
if (bToggleWalk)
bIsWalking = !bIsWalking;

if (bToggleCrouch)
{
if (!bCrouchOn && !bWasCrouchOn && (bDuck != 0))
{
bCrouchOn = True;
}
else if (bCrouchOn && !bWasCrouchOn && (bDuck == 0))
{
bWasCrouchOn = True;
}
else if (bCrouchOn && bWasCrouchOn && (bDuck == 0) && (lastbDuck != 0))
{
bCrouchOn = False;
bWasCrouchOn = False;
}

if (bCrouchOn)
{
bIsCrouching = True;
bDuck = 1;
}

lastbDuck = bDuck;
}

HeadZoneChange (ZoneInfo newHeadZone)


local float mult, augLevel;


// hack to get the zone's ambientsound working until Tim fixes it
if (newHeadZone.AmbientSound != None)
newHeadZone.SoundRadius = 255;
if (HeadRegion.Zone.AmbientSound != None)
HeadRegion.Zone.SoundRadius = 0;

if (newHeadZone.bWaterZone && !HeadRegion.Zone.bWaterZone)
{
// make sure we're not crouching when we start swimming
bIsCrouching = False;
bCrouchOn = False;
bWasCrouchOn = False;
bDuck = 0;
lastbDuck = 0;
Velocity = vect(0,0,0);
Acceleration = vect(0,0,0);
mult = SkillSystem.GetSkillLevelValue(class'SkillSwimming');
swimDuration = UnderWaterTime * mult;
swimTimer = swimDuration;
if (( Level.NetMode != NM_Standalone ) && Self.IsA('Human') )
{
if ( AugmentationSystem != None )
augLevel = AugmentationSystem.GetAugLevelValue(class'AugAqualung');
if ( augLevel == -1.0 )
WaterSpeed = Human(Self).Default.mpWaterSpeed * mult;
else
WaterSpeed = Human(Self).Default.mpWaterSpeed * 2.0 * mult;
}
else
WaterSpeed = Default.WaterSpeed * mult;
}

Super.HeadZoneChange(newHeadZone);

HealPart (out int points, out int amt)


local int spill;


points += amt;
spill = points - 100;
if (spill > 0)
points = 100;
else
spill = 0;

amt = spill;

HealPlayer (int baseHealPoints, optional Bool bUseMedicineSkill) -> int


local float mult;
local int adjustedHealAmount, aha2, tempaha;
local int origHealAmount;
local float dividedHealAmount;


if (bUseMedicineSkill)
adjustedHealAmount = CalculateSkillHealAmount(baseHealPoints);
else
adjustedHealAmount = baseHealPoints;

origHealAmount = adjustedHealAmount;

if (adjustedHealAmount > 0)
{
if (bUseMedicineSkill)
PlaySound(sound'MedicalHiss', SLOT_None,,, 256);

// Heal by 3 regions via multiplayer game
if (( Level.NetMode == NM_DedicatedServer ) || ( Level.NetMode == NM_ListenServer ))
{
// DEUS_EX AMSD If legs broken, heal them a little bit first
if (HealthLegLeft == 0)
{
aha2 = adjustedHealAmount;
if (aha2 >= 5)
aha2 = 5;
tempaha = aha2;
adjustedHealAmount = adjustedHealAmount - aha2;
HealPart(HealthLegLeft, aha2);
HealPart(HealthLegRight,tempaha);
mpMsgServerFlags = mpMsgServerFlags & (~MPSERVERFLAG_LostLegs);
}
HealPart(HealthHead, adjustedHealAmount);

if ( adjustedHealAmount > 0 )
{
aha2 = adjustedHealAmount;
HealPart(HealthTorso, aha2);
aha2 = adjustedHealAmount;
HealPart(HealthArmRight,aha2);
HealPart(HealthArmLeft, adjustedHealAmount);
}
if ( adjustedHealAmount > 0 )
{
aha2 = adjustedHealAmount;
HealPart(HealthLegRight, aha2);
HealPart(HealthLegLeft, adjustedHealAmount);
}
}
else
{
HealPart(HealthHead, adjustedHealAmount);
HealPart(HealthTorso, adjustedHealAmount);
HealPart(HealthLegRight, adjustedHealAmount);
HealPart(HealthLegLeft, adjustedHealAmount);
HealPart(HealthArmRight, adjustedHealAmount);
HealPart(HealthArmLeft, adjustedHealAmount);
}

GenerateTotalHealth();

adjustedHealAmount = origHealAmount - adjustedHealAmount;

if (origHealAmount == baseHealPoints)
{
if (adjustedHealAmount == 1)
ClientMessage(Sprintf(HealedPointLabel, adjustedHealAmount));
else
ClientMessage(Sprintf(HealedPointsLabel, adjustedHealAmount));
}
else
{
ClientMessage(Sprintf(HealedPointsLabel, adjustedHealAmount));
}
}

return adjustedHealAmount;

HighlightCenterObject


local Actor target, smallestTarget;
local Vector HitLoc, HitNormal, StartTrace, EndTrace;
local DeusExRootWindow root;
local float minSize;
local bool bFirstTarget;


if (IsInState('Dying'))
return;

root = DeusExRootWindow(rootWindow);

// only do the trace every tenth of a second
if (FrobTime >= 0.1)
{
// figure out how far ahead we should trace
StartTrace = Location;
EndTrace = Location + (Vector(ViewRotation) * MaxFrobDistance);

// adjust for the eye height
StartTrace.Z += BaseEyeHeight;
EndTrace.Z += BaseEyeHeight;

smallestTarget = None;
minSize = 99999;
bFirstTarget = True;

// find the object that we are looking at
// make sure we don't select the object that we're carrying
// use the last traced object as the target...this will handle
// smaller items under larger items for example
// ScriptedPawns always have precedence, though
foreach TraceActors(class'Actor', target, HitLoc, HitNormal, EndTrace, StartTrace)
{
if (IsFrobbable(target) && (target != CarriedDecoration))
{
if (target.IsA('ScriptedPawn'))
{
smallestTarget = target;
break;
}
else if (target.IsA('Mover') && bFirstTarget)
{
smallestTarget = target;
break;
}
else if (target.CollisionRadius < minSize)
{
minSize = target.CollisionRadius;
smallestTarget = target;
bFirstTarget = False;
}
}
}
FrobTarget = smallestTarget;

// reset our frob timer
FrobTime = 0;
}

IAmWarren


if (!bCheatsEnabled)
return;

if (!bWarrenEMPField)
{
bWarrenEMPField = true;
WarrenTimer = 0;
WarrenSlot = 0;
ClientMessage("Warren's EMP Field activated"); // worry about localization?
}
else
{
bWarrenEMPField = false;
ClientMessage("Warren's EMP Field deactivated"); // worry about localization?
}

InConversation -> bool


if ( conPlay == None )
{
return False;
}
else
{
if (conPlay.con != None)
return ((conPlay.con.bFirstPerson == False) && (!conPlay.GetForcePlay()));
else
return False;
}

IncreaseClientFlashLength (float NewFlashTime)


FlashTimer = FMax(NewFlashTime,FlashTimer);

InitializeSubSystems


// Spawn the BarkManager
if (BarkManager == None)
BarkManager = Spawn(class'BarkManager', Self);

// Spawn the Color Manager
CreateColorThemeManager();
ThemeManager.SetOwner(self);

// install the augmentation system if not found
if (AugmentationSystem == None)
{
AugmentationSystem = Spawn(class'AugmentationManager', Self);
AugmentationSystem.CreateAugmentations(Self);
AugmentationSystem.AddDefaultAugmentations();
AugmentationSystem.SetOwner(Self);
}
else
{
AugmentationSystem.SetPlayer(Self);
AugmentationSystem.SetOwner(Self);
}

// install the skill system if not found
if (SkillSystem == None)
{
SkillSystem = Spawn(class'SkillManager', Self);
SkillSystem.CreateSkills(Self);
}
else
{
SkillSystem.SetPlayer(Self);
}

if ((Level.Netmode == NM_Standalone) || (!bBeltIsMPInventory))
{
// Give the player a keyring
CreateKeyRing();
}

InterpolateEnd (Actor Other)


if (InterpolationPoint(Other).bEndOfPath)
if (NextMap != "")
{
// DEUS_EX_DEMO
//
// If this is the demo, show the demo splash screen, which
// will exit the game after the player presses a key/mouseclick
// if (NextMap == "02_NYC_BatteryPark")
// ShowDemoSplash();
// else
Level.Game.SendPlayer(Self, NextMap);
}

InvokeComputerScreen (Computers computerToActivate, float CompHackTime, float ServerLevelTime)


local NetworkTerminal termwindow;
local DeusExRootWindow root;


computerToActivate.LastHackTime = CompHackTime + (Level.TimeSeconds - ServerLevelTime);

ActiveComputer = ComputerToActivate;

//only allow for clients or standalone
if ((Level.NetMode != NM_Standalone) && (!PlayerIsClient()))
{
ActiveComputer = None;
CloseComputerScreen(computerToActivate);
return;
}

root = DeusExRootWindow(rootWindow);
if (root != None)
{
termwindow = NetworkTerminal(root.InvokeUIScreen(computerToActivate.terminalType, True));
if (termwindow != None)
{
computerToActivate.termwindow = termwindow;
termWindow.SetCompOwner(computerToActivate);
// If multiplayer, start hacking if there are no users
if ((Level.NetMode != NM_Standalone) && (!termWindow.bHacked) && (computerToActivate.NumUsers() == 0) &&
(termWindow.winHack != None) && (termWindow.winHack.btnHack != None))
{
termWindow.winHack.StartHack();
termWindow.winHack.btnHack.SetSensitivity(False);
termWindow.FirstScreen=None;
}
termWindow.ShowFirstScreen();
}
}
if ((termWindow == None) || (root == None))
{
CloseComputerScreen(computerToActivate);
ActiveComputer = None;
}

InvokeConWindow


if (!bCheatsEnabled)
return;

InvokeUIScreen(Class'InvokeConWindow');

InvokeUIScreen (Class windowClass)


local DeusExRootWindow root;

root = DeusExRootWindow(rootWindow);
if (root != None)
{
if ( root.IsKeyDown( IK_Alt ) || root.IsKeyDown( IK_Shift ) || root.IsKeyDown( IK_Ctrl ))
return;

root.InvokeUIScreen(windowClass);
}

IsEmptyItemSlot (Inventory anItem, int col, int row) -> Bool


local int slotsCol;
local int slotsRow;
local Bool bEmpty;


if ( anItem == None )
return False;

// First make sure the item can fit horizontally
// and vertically
if (( col + anItem.invSlotsX > maxInvCols ) ||
( row + anItem.invSlotsY > maxInvRows ))
return False;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
return True;

// Now check this and the needed surrounding slots
// to see if all the slots are empty

bEmpty = True;
for( slotsRow=0; slotsRow < anItem.invSlotsY; slotsRow++ )
{
for ( slotsCol=0; slotsCol < anItem.invSlotsX; slotsCol++ )
{
if ( invSlots[((slotsRow + row) * maxInvCols) + (slotsCol + col)] == 1 )
{
bEmpty = False;
break;
}
}

if ( !bEmpty )
break;
}

return bEmpty;

IsEmptyItemSlotXY (int invSlotsX, int invSlotsY, int col, int row) -> Bool


local int slotsCol;
local int slotsRow;
local Bool bEmpty;


// First make sure the item can fit horizontally
// and vertically
if (( col + invSlotsX > maxInvCols ) ||
( row + invSlotsY > maxInvRows ))
return False;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
return True;

// Now check this and the needed surrounding slots
// to see if all the slots are empty

bEmpty = True;
for( slotsRow=0; slotsRow < invSlotsY; slotsRow++ )
{
for ( slotsCol=0; slotsCol < invSlotsX; slotsCol++ )
{
if ( invSlots[((slotsRow + row) * maxInvCols) + (slotsCol + col)] == 1 )
{
bEmpty = False;
break;
}
}

if ( !bEmpty )
break;
}

return bEmpty;

IsFrobbable (actor A) -> bool


if (!A.bHidden)
if (A.IsA('Mover') || A.IsA('DeusExDecoration') || A.IsA('Inventory') ||
A.IsA('ScriptedPawn') || A.IsA('DeusExCarcass') || A.IsA('DeusExProjectile'))
return True;

return False;

IsHighlighted (actor A) -> bool


if (bBehindView)
return False;

if (A != None)
{
if (A.bDeleteMe || A.bHidden)
return False;

if (A.IsA('Pawn'))
{
if (!bNPCHighlighting)
return False;
}

if (A.IsA('DeusExMover') && !DeusExMover(A).bHighlight)
return False;
else if (A.IsA('Mover') && !A.IsA('DeusExMover'))
return False;
else if (A.IsA('DeusExDecoration') && !DeusExDecoration(A).bHighlight)
return False;
else if (A.IsA('DeusExCarcass') && !DeusExCarcass(A).bHighlight)
return False;
else if (A.IsA('ThrownProjectile') && !ThrownProjectile(A).bHighlight)
return False;
else if (A.IsA('DeusExProjectile') && !DeusExProjectile(A).bStuck)
return False;
else if (A.IsA('ScriptedPawn') && !ScriptedPawn(A).bHighlight)
return False;
}

return True;

IsLeaning -> bool


return (curLeanDist != 0);

JoltView (float newJoltMagnitude)


if (Abs(JoltMagnitude) < Abs(newJoltMagnitude))
JoltMagnitude = newJoltMagnitude;

KeypadRunEvents (Keypad KPad, bool bSuccess)


KPad.RunEvents(Self, bSuccess);

KeypadRunUntriggers (Keypad KPad)


KPad.RunUntriggers(Self);

KeypadToggleLocks (Keypad KPad)


KPad.ToggleLocks(Self);

KillShadow


if (Shadow != None)
Shadow.Destroy();
Shadow = None;

KillerProfile


bKillerProfile = !bKillerProfile;

Landed (vector HitNormal)


local vector legLocation;
local int augLevel;
local float augReduce, dmg;


//Note - physics changes type to PHYS_Walking by default for landed pawns
PlayLanded(Velocity.Z);
if (Velocity.Z < -1.4 * JumpZ)
{
MakeNoise(-0.5 * Velocity.Z/(FMax(JumpZ, 150.0)));
if ((Velocity.Z < -700) && (ReducedDamageType != 'All'))
if ( Role == ROLE_Authority )
{
// check our jump augmentation and reduce falling damage if we have it
// jump augmentation doesn't exist anymore - use Speed instaed
// reduce an absolute amount of damage instead of a relative amount
augReduce = 0;
if (AugmentationSystem != None)
{
augLevel = AugmentationSystem.GetClassLevel(class'AugSpeed');
if (augLevel >= 0)
augReduce = 15 * (augLevel+1);
}

dmg = Max((-0.16 * (Velocity.Z + 700)) - augReduce, 0);
legLocation = Location + vect(-1,0,-1); // damage left leg
TakeDamage(dmg, None, legLocation, vect(0,0,0), 'fell');

legLocation = Location + vect(1,0,-1); // damage right leg
TakeDamage(dmg, None, legLocation, vect(0,0,0), 'fell');

dmg = Max((-0.06 * (Velocity.Z + 700)) - augReduce, 0);
legLocation = Location + vect(0,0,1); // damage torso
TakeDamage(dmg, None, legLocation, vect(0,0,0), 'fell');
}
}
else if ( (Level.Game != None) && (Level.Game.Difficulty > 1) && (Velocity.Z > 0.5 * JumpZ) )
MakeNoise(0.1 * Level.Game.Difficulty);
bJustLanded = true;

Legend


if (!bCheatsEnabled)
return;

InvokeUIScreen(Class'BehindTheCurtain');

LoadGame (int saveIndex)


// Reset the FOV
DesiredFOV = Default.DesiredFOV;

DeusExRootWindow(rootWindow).ClearWindowStack();
ClientTravel("?loadgame=" $ saveIndex, TRAVEL_Absolute, False);

LoadMap


if (!bCheatsEnabled)
return;

InvokeUIScreen(Class'LoadMapWindow');

LocalLog (String S)


if (( Player != None ) && ( Player.Console != None ))
Player.Console.AddString(S);

LogMsg (string msg)


Log(msg);

LoopHeadConvoAnim

MaintainEnergy (float deltaTime)


local Float energyUse;
local Float energyRegen;


// make sure we can't continue to go negative if we take damage
// after we're already out of energy
if (Energy <= 0)
{
Energy = 0;
EnergyDrain = 0;
EnergyDrainTotal = 0;
}

energyUse = 0;

// Don't waste time doing this if the player is dead or paralyzed
if ((!IsInState('Dying')) && (!IsInState('Paralyzed')))
{
if (Energy > 0)
{
// Decrement energy used for augmentations
energyUse = AugmentationSystem.CalcEnergyUse(deltaTime);

Energy -= EnergyUse;

// Calculate the energy drain due to EMP attacks
if (EnergyDrain > 0)
{
energyUse = EnergyDrainTotal * deltaTime;
Energy -= EnergyUse;
EnergyDrain -= EnergyUse;
if (EnergyDrain <= 0)
{
EnergyDrain = 0;
EnergyDrainTotal = 0;
}
}
}

//Do check if energy is 0.
// If the player's energy drops to zero, deactivate
// all augmentations
if (Energy <= 0)
{
//If we were using energy, then tell the client we're out.
//Otherwise just make sure things are off. If energy was
//already 0, then energy use will still be 0, so we won't
//spam. DEUS_EX AMSD
if (energyUse > 0)
ClientMessage(EnergyDepleted);
Energy = 0;
EnergyDrain = 0;
EnergyDrainTotal = 0;
AugmentationSystem.DeactivateAll();
}

// If all augs are off, then start regenerating in multiplayer,
// up to 25%.
if ((energyUse == 0) && (Energy <= MaxRegenPoint) && (Level.NetMode != NM_Standalone))
{
energyRegen = RegenRate * deltaTime;
Energy += energyRegen;
}
}

MakeCameraAlly (SecurityCamera camera)


Camera.SafeTarget = Self;
if (Level.Game.IsA('TeamDMGame'))
Camera.Team = PlayerReplicationInfo.Team;
else
Camera.Team = PlayerReplicationInfo.PlayerID;

MakePlayerIgnored (bool bNewIgnore)


bIgnore = bNewIgnore;
// to restore original behavior, uncomment the next line
//bDetectable = !bNewIgnore;

Matrix


if (Sprite == None)
{
Sprite = Texture(DynamicLoadObject("Extras.Matrix_A00", class'Texture'));
ConsoleCommand("RMODE 6");
}
else
{
Sprite = None;
ConsoleCommand("RMODE 5");
}

MoveActor (int xPos, int yPos, int zPos)


local Actor hitActor;
local Vector hitLocation, hitNormal;
local Vector position, line, newPos;


if (!bCheatsEnabled)
return;

position = Location;
position.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 4000;

hitActor = Trace(hitLocation, hitNormal, position+line, position, true);
if (hitActor != None)
{
newPos.x=xPos;
newPos.y=yPos;
newPos.z=zPos;
// hitPawn = ScriptedPawn(hitActor);
Log( "Trying to move " $ hitActor.Name $ " from " $ hitActor.Location $ " to " $ newPos);
hitActor.SetLocation(newPos);
Log( "Ended up at " $ hitActor.Location );
}

MoveDrone (float DeltaTime, Vector loc)


// if the wanted velocity is zero, apply drag so we slow down gradually
if (VSize(loc) == 0)
{
aDrone.Velocity *= 0.9;
}
else
{
aDrone.Velocity += deltaTime * aDrone.MaxSpeed * loc;
}

// add slight bobbing
// DEUS_EX AMSD Only do the bobbing in singleplayer, we want stationary drones stationary.
if (Level.Netmode == NM_Standalone)
aDrone.Velocity += deltaTime * Sin(Level.TimeSeconds * 2.0) * vect(0,0,1);

MultiplayerDeathMsg (Pawn killer, bool killedSelf, bool valid, String killerName, String killerMethod)


local MultiplayerMessageWin mmw;
local DeusExRootWindow root;


myKiller = killer;
if ( killProfile != None )
{
killProfile.bKilledSelf = killedSelf;
killProfile.bValid = valid;
}
root = DeusExRootWindow(rootWindow);
if ( root != None )
{
mmw = MultiplayerMessageWin(root.InvokeUIScreen(Class'MultiplayerMessageWin', True));
if ( mmw != None )
{
mmw.bKilled = true;
mmw.killerName = killerName;
mmw.killerMethod = killerMethod;
mmw.bKilledSelf = killedSelf;
mmw.bValidMethod = valid;
}
}

MultiplayerNotifyMsg (int code, optional int param, optional string str)


if ( !bHelpMessages )
{
switch( code )
{
case MPMSG_TeamUnatco:
case MPMSG_TeamNsf:
case MPMSG_TeamHit:
case MPMSG_TeamSpot:
case MPMSG_FirstPoison:
case MPMSG_FirstBurn:
case MPMSG_TurretInv:
case MPMSG_CameraInv:
case MPMSG_LostLegs:
case MPMSG_DropItem:
case MPMSG_KilledTeammate:
case MPMSG_TeamLAM:
case MPMSG_TeamComputer:
case MPMSG_NoCloakWeapon:
case MPMSG_TeamHackTurret:
return; // Pass on these
case MPMSG_CloseKills:
case MPMSG_TimeNearEnd:
break; // Go ahead with these
}
}

switch( code )
{
case MPMSG_TeamSpot:
if ( (mpMsgFlags & MPFLAG_FirstSpot) == MPFLAG_FirstSpot )
return;
else
mpMsgFlags = mpMsgFlags | MPFLAG_FirstSpot;
break;
case MPMSG_CloseKills:
if ((param == 0) || (str ~= ""))
{
log("Warning: Passed bad params to multiplayer notify msg." );
return;
}
mpMsgOptionalParam = param;
mpMsgOptionalString = str;
break;
case MPMSG_TimeNearEnd:
if ((param == 0) || (str ~= ""))
{
log("Warning: Passed bad params to multiplayer notify msg." );
return;
}
mpMsgOptionalParam = param;
mpMsgOptionalString = str;
break;
case MPMSG_DropItem:
case MPMSG_TeamUnatco:
case MPMSG_TeamNsf:
if (( DeusExRootWindow(rootWindow) != None ) && ( DeusExRootWindow(rootWindow).hud != None ) && (DeusExRootWindow(rootWindow).hud.augDisplay != None ))
DeusExRootWindow(rootWindow).hud.augDisplay.RefreshMultiplayerKeys();
break;
}
mpMsgCode = code;
mpMsgTime = Level.Timeseconds + mpMsgDelay;
if (( code == MPMSG_TeamUnatco ) || ( code == MPMSG_TeamNsf ))
mpMsgTime += 2.0;

MultiplayerTick (float DeltaTime)


local int burnTime;
local float augLevel;


Super.MultiplayerTick(DeltaTime);

//If we've just put away items, reset this.
if ((LastInHand != InHand) && (Level.Netmode == NM_Client) && (inHand == None))
{
ClientInHandPending = None;
}

LastInHand = InHand;

if ((PlayerIsClient()) || (Level.NetMode == NM_ListenServer))
{
if ((ShieldStatus != SS_Off) && (DamageShield == None))
DrawShield();
if ( (NintendoImmunityTimeLeft > 0.0) && ( InvulnSph == None ))
DrawInvulnShield();
if (Style != STY_Translucent)
CreateShadow();
else
KillShadow();
}

if (Role < ROLE_Authority)
return;

UpdateInHand();

UpdatePoison(DeltaTime);

if (lastRefreshTime < 0)
lastRefreshTime = 0;

lastRefreshTime = lastRefreshTime + DeltaTime;

if (bOnFire)
{
if ( Level.NetMode != NM_Standalone )
burnTime = Class'WeaponFlamethrower'.Default.mpBurnTime;
else
burnTime = Class'WeaponFlamethrower'.Default.BurnTime;
burnTimer += deltaTime;
if (burnTimer >= burnTime)
ExtinguishFire();
}

if (lastRefreshTime < 0.25)
return;

if (ShieldTimer > 0)
ShieldTimer = ShieldTimer - lastRefreshTime;

if (ShieldStatus == SS_Fade)
ShieldStatus = SS_Off;

if (ShieldTimer <= 0)
{
if (ShieldStatus == SS_Strong)
ShieldStatus = SS_Fade;
}

// If we have a drone active (post-death etc) and we're not using the aug, kill it off
augLevel = AugmentationSystem.GetAugLevelValue(class'AugDrone');
if (( aDrone != None ) && (augLevel == -1.0))
aDrone.TakeDamage(100, None, aDrone.Location, vect(0,0,0), 'EMP');

if ( Level.Timeseconds > ServerTimeLastRefresh )
{
SetServerTimeDiff( Level.Timeseconds );
ServerTimeLastRefresh = Level.Timeseconds + 10.0;
}

MaintainEnergy(lastRefreshTime);
UpdateTranslucency(lastRefreshTime);
if ( bNintendoImmunity )
{
NintendoImmunityTimeLeft = NintendoImmunityTime - Level.Timeseconds;
if ( Level.Timeseconds > NintendoImmunityTime )
NintendoImmunityEffect( False );
}
RepairInventory();
lastRefreshTime = 0;

NewMultiplayerMatch


DeusExMPGame( DXGame ).RestartPlayer( Self );
PlayerReplicationInfo.Score = 0;
PlayerReplicationInfo.Deaths = 0;
PlayerReplicationInfo.Streak = 0;

NextBeltItem


local DeusExRootWindow root;
local int slot, startSlot;


if (RestrictInput())
return;

if (CarriedDecoration == None)
{
slot = 0;
root = DeusExRootWindow(rootWindow);
if (root != None)
{
if (ClientInHandPending != None)
slot = ClientInHandPending.beltPos;
else if (inHandPending != None)
slot = inHandPending.beltPos;
else if (inHand != None)
slot = inHand.beltPos;

startSlot = slot;
do
{
if (++slot >= 10)
slot = 0;
}
until (root.ActivateObjectInBelt(slot) || (startSlot == slot));

clientInHandPending = root.hud.belt.GetObjectFromBelt(slot);
}
}

NextHUDColorTheme


if (ThemeManager != None)
{
ThemeManager.NextHUDColorTheme();
DeusExRootWindow(rootWindow).ChangeStyle();
}

NextMenuColorTheme


if (ThemeManager != None)
{
ThemeManager.NextMenuColorTheme();
DeusExRootWindow(rootWindow).ChangeStyle();
}

NintendoImmunityEffect (bool on)


bNintendoImmunity = on;

if (bNintendoImmunity)
{
NintendoImmunityTime = Level.Timeseconds + NintendoDelay;
NintendoImmunityTimeLeft = NintendoDelay;
}
else
NintendoImmunityTimeLeft = 0.0;

NoteAdd (String noteText, optional bool bUserNote)


local DeusExNote newNote;


newNote = AddNote( noteText );
newNote.SetUserNote( bUserNote );

OpenSesame


local Actor hitActor;
local Vector hitLocation, hitNormal;
local Vector position, line;
local DeusExMover hitMover;
local DeusExMover triggerMover;
local HackableDevices device;


if (!bCheatsEnabled)
return;

position = Location;
position.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 4000;

hitActor = Trace(hitLocation, hitNormal, position+line, position, true);
hitMover = DeusExMover(hitActor);
device = HackableDevices(hitActor);
if (hitMover != None)
{
if ((hitMover.Tag != '') && (hitMover.Tag != 'DeusExMover'))
{
foreach AllActors(class'DeusExMover', triggerMover, hitMover.Tag)
{
triggerMover.bLocked = false;
triggerMover.Trigger(self, self);
}
}
else
{
hitMover.bLocked = false;
hitMover.Trigger(self, self);
}
}
else if (device != None)
{
if (device.bHackable)
{
if (device.hackStrength > 0)
{
device.hackStrength = 0;
device.HackAction(self, true);
}
}
}

ParseLeftClick


//
// ParseLeftClick deals with things in your HAND
//
// Precedence:
// - Detonate spy drone
// - Fire (handled automatically by user.ini bindings)
// - Use inHand
//

if (RestrictInput())
return;

// if the spy drone augmentation is active, blow it up
if (bSpyDroneActive)
{
DroneExplode();
return;
}

if ((inHand != None) && !bInHandTransition)
{
if (inHand.bActivatable)
inHand.Activate();
else if (FrobTarget != None)
{
// special case for using keys or lockpicks on doors
if (FrobTarget.IsA('DeusExMover'))
if (inHand.IsA('NanoKeyRing') || inHand.IsA('Lockpick'))
DoFrob(Self, inHand);

// special case for using multitools on hackable things
if (FrobTarget.IsA('HackableDevices'))
{
if (inHand.IsA('Multitool'))
{
if (( Level.Netmode != NM_Standalone ) && (TeamDMGame(DXGame) != None) && FrobTarget.IsA('AutoTurretGun') && (AutoTurretGun(FrobTarget).team==PlayerReplicationInfo.team) )
{
MultiplayerNotifyMsg( MPMSG_TeamHackTurret );
return;
}
else
DoFrob(Self, inHand);
}
}
}
}

ParseRightClick


local AutoTurret turret;
local int ViewIndex;
local bool bPlayerOwnsIt;
local Inventory oldFirstItem;
local Inventory oldInHand;
local Decoration oldCarriedDecoration;
local Vector loc;

//
// ParseRightClick deals with things in the WORLD
//
// Precedence:
// - Pickup highlighted Inventory
// - Frob highlighted object
// - Grab highlighted Decoration
// - Put away (or drop if it's a deco) inHand
//


if (RestrictInput())
return;

oldFirstItem = Inventory;
oldInHand = inHand;
oldCarriedDecoration = CarriedDecoration;

if (FrobTarget != None)
loc = FrobTarget.Location;

if (FrobTarget != None)
{
// First check if this is a NanoKey, in which case we just
// want to add it to the NanoKeyRing without disrupting
// what the player is holding

if (FrobTarget.IsA('NanoKey'))
{
PickupNanoKey(NanoKey(FrobTarget));
FrobTarget.Destroy();
FrobTarget = None;
return;
}
else if (FrobTarget.IsA('Inventory'))
{
// If this is an item that can be stacked, check to see if
// we already have one, in which case we don't need to
// allocate more space in the inventory grid.
//
// TODO: This logic may have to get more involved if/when
// we start allowing other types of objects to get stacked.

if (HandleItemPickup(FrobTarget, True) == False)
return;

// if the frob succeeded, put it in the player's inventory
//DEUS_EX AMSD ARGH! Because of the way respawning works, the item I pick up
//is NOT the same as the frobtarget if I do a pickup. So how do I tell that
//I've successfully picked it up? Well, if the first item in my inventory
//changed, I picked up a new item.
if ( ((Level.NetMode == NM_Standalone) && (Inventory(FrobTarget).Owner == Self)) ||
((Level.NetMode != NM_Standalone) && (oldFirstItem != Inventory)) )
{
if (Level.NetMode == NM_Standalone)
FindInventorySlot(Inventory(FrobTarget));
else
FindInventorySlot(Inventory);
FrobTarget = None;
}
}
else if (FrobTarget.IsA('Decoration') && Decoration(FrobTarget).bPushable)
{
GrabDecoration();
}
else
{
if (( Level.NetMode != NM_Standalone ) && ( TeamDMGame(DXGame) != None ))
{
if ( FrobTarget.IsA('LAM') || FrobTarget.IsA('GasGrenade') || FrobTarget.IsA('EMPGrenade'))
{
if ((ThrownProjectile(FrobTarget).team == PlayerReplicationInfo.team) && ( ThrownProjectile(FrobTarget).Owner != Self ))
{
if ( ThrownProjectile(FrobTarget).bDisabled ) // You can re-enable a grenade for a teammate
{
ThrownProjectile(FrobTarget).ReEnable();
return;
}
MultiplayerNotifyMsg( MPMSG_TeamLAM );
return;
}
}
if ( FrobTarget.IsA('ComputerSecurity') && (PlayerReplicationInfo.team == ComputerSecurity(FrobTarget).team) )
{
// Let controlling player re-hack his/her own computer
bPlayerOwnsIt = False;
foreach AllActors(class'AutoTurret',turret)
{
for (ViewIndex = 0; ViewIndex < ArrayCount(ComputerSecurity(FrobTarget).Views); ViewIndex++)
{
if (ComputerSecurity(FrobTarget).Views[ViewIndex].turretTag == turret.Tag)
{
if (( turret.safeTarget == Self ) || ( turret.savedTarget == Self ))
{
bPlayerOwnsIt = True;
break;
}
}
}
}
if ( !bPlayerOwnsIt )
{
MultiplayerNotifyMsg( MPMSG_TeamComputer );
return;
}
}
}
// otherwise, just frob it
DoFrob(Self, None);
}
}
else
{
// if there's no FrobTarget, put away an inventory item or drop a decoration
// or drop the corpse
if ((inHand != None) && inHand.IsA('POVCorpse'))
DropItem();
else
PutInHand(None);
}

if ((oldInHand == None) && (inHand != None))
PlayPickupAnim(loc);
else if ((oldCarriedDecoration == None) && (CarriedDecoration != None))
PlayPickupAnim(loc);

PickupNanoKey (NanoKey newKey)


KeyRing.GiveKey(newKey.KeyID, newKey.Description);
//DEUS_EX AMSD In multiplayer, propagate the key to the client if the server
if ((Role == ROLE_Authority) && (Level.NetMode != NM_Standalone))
{
KeyRing.GiveClientKey(newKey.KeyID, newKey.Description);
}
ClientMessage(Sprintf(AddedNanoKey, newKey.Description));

PlaceItemInSlot (Inventory anItem, int col, int row)


// Save in the original Inventory item also
anItem.invPosX = col;
anItem.invPosY = row;

SetInvSlots(anItem, 1);

PlayBodyThud


PlaySound(sound'BodyThud', SLOT_Interact);

PlayDXTakeDamageHit (float Damage, vector HitLocation, name damageType, vector Momentum, bool DamageReduced)


local float rnd;


PlayHit(Damage,HitLocation,damageType,Momentum);

// if we actually took the full damage, flash the screen and play the sound
// DEUS_EX AMSD DXReduceDamage is slow. Pass in the result from earlier.
if (!DamageReduced)
{
if ( (damage > 0) || (ReducedDamageType == 'All') )
{
// No client flash on plasma bolts in multiplayer
if (( Level.NetMode != NM_Standalone ) && ( myProjKiller != None ) && (PlasmaBolt(myProjKiller)!=None) )
{
}
else
{
rnd = FClamp(Damage, 20, 100);
if (damageType == 'Burned')
ClientFlash(rnd * 0.002, vect(200,100,100));
else if (damageType == 'Flamed')
ClientFlash(rnd * 0.002, vect(200,100,100));
else if (damageType == 'Radiation')
ClientFlash(rnd * 0.002, vect(100,100,0));
else if (damageType == 'PoisonGas')
ClientFlash(rnd * 0.002, vect(50,150,0));
else if (damageType == 'TearGas')
ClientFlash(rnd * 0.002, vect(150,150,0));
else if (damageType == 'Drowned')
ClientFlash(rnd * 0.002, vect(0,100,200));
else if (damageType == 'EMP')
ClientFlash(rnd * 0.002, vect(0,200,200));
else
ClientFlash(rnd * 0.002, vect(50,0,0));
}
ShakeView(0.15 + 0.002 * Damage, Damage * 30, 0.3 * Damage);
}
}

PlayDeathHit (float Damage, vector HitLocation, name damageType, vector Momentum)


PlayDying(damageType, HitLocation);

PlayFootStep


local Sound stepSound;
local float rnd;
local float speedFactor, massFactor;
local float volume, pitch, range;
local float radius, mult;
local float volumeMultiplier;
local DeusExPlayer pp;
local bool bOtherPlayer;


// Only do this on ourself, since this takes into account aug stealth and such
if ( Level.NetMode != NM_StandAlone )
pp = DeusExPlayer( GetPlayerPawn() );

if ( pp != Self )
bOtherPlayer = True;
else
bOtherPlayer = False;

rnd = FRand();

volumeMultiplier = 1.0;
if (IsInState('PlayerSwimming') || (Physics == PHYS_Swimming))
{
volumeMultiplier = 0.5;
if (rnd < 0.5)
stepSound = Sound'Swimming';
else
stepSound = Sound'Treading';
}
else if (FootRegion.Zone.bWaterZone)
{
volumeMultiplier = 1.0;
if (rnd < 0.33)
stepSound = Sound'WaterStep1';
else if (rnd < 0.66)
stepSound = Sound'WaterStep2';
else
stepSound = Sound'WaterStep3';
}
else
{
switch(FloorMaterial)
{
case 'Textile':
case 'Paper':
volumeMultiplier = 0.7;
if (rnd < 0.25)
stepSound = Sound'CarpetStep1';
else if (rnd < 0.5)
stepSound = Sound'CarpetStep2';
else if (rnd < 0.75)
stepSound = Sound'CarpetStep3';
else
stepSound = Sound'CarpetStep4';
break;

case 'Foliage':
case 'Earth':
volumeMultiplier = 0.6;
if (rnd < 0.25)
stepSound = Sound'GrassStep1';
else if (rnd < 0.5)
stepSound = Sound'GrassStep2';
else if (rnd < 0.75)
stepSound = Sound'GrassStep3';
else
stepSound = Sound'GrassStep4';
break;

case 'Metal':
case 'Ladder':
volumeMultiplier = 1.0;
if (rnd < 0.25)
stepSound = Sound'MetalStep1';
else if (rnd < 0.5)
stepSound = Sound'MetalStep2';
else if (rnd < 0.75)
stepSound = Sound'MetalStep3';
else
stepSound = Sound'MetalStep4';
break;

case 'Ceramic':
case 'Glass':
case 'Tiles':
volumeMultiplier = 0.7;
if (rnd < 0.25)
stepSound = Sound'TileStep1';
else if (rnd < 0.5)
stepSound = Sound'TileStep2';
else if (rnd < 0.75)
stepSound = Sound'TileStep3';
else
stepSound = Sound'TileStep4';
break;

case 'Wood':
volumeMultiplier = 0.7;
if (rnd < 0.25)
stepSound = Sound'WoodStep1';
else if (rnd < 0.5)
stepSound = Sound'WoodStep2';
else if (rnd < 0.75)
stepSound = Sound'WoodStep3';
else
stepSound = Sound'WoodStep4';
break;

case 'Brick':
case 'Concrete':
case 'Stone':
case 'Stucco':
default:
volumeMultiplier = 0.7;
if (rnd < 0.25)
stepSound = Sound'StoneStep1';
else if (rnd < 0.5)
stepSound = Sound'StoneStep2';
else if (rnd < 0.75)
stepSound = Sound'StoneStep3';
else
stepSound = Sound'StoneStep4';
break;
}
}

// compute sound volume, range and pitch, based on mass and speed
if (IsInState('PlayerSwimming') || (Physics == PHYS_Swimming))
speedFactor = WaterSpeed/180.0;
else
speedFactor = VSize(Velocity)/180.0;

massFactor = Mass/150.0;
radius = 375.0;
volume = (speedFactor+0.2) * massFactor;
range = radius * volume;
pitch = (volume+0.5);
volume = FClamp(volume, 0, 1.0) * 0.5; // Hack to compensate for increased footstep volume.
range = FClamp(range, 0.01, radius*4);
pitch = FClamp(pitch, 1.0, 1.5);

// AugStealth decreases our footstep volume
volume *= RunSilentValue;

if ( Level.NetMode == NM_Standalone )
PlaySound(stepSound, SLOT_Interact, volume, , range, pitch);
else // special case for multiplayer
{
if ( !bIsWalking )
{
// Tone down player's own footsteps
if ( !bOtherPlayer )
{
volume *= 0.33;
PlaySound(stepSound, SLOT_Interact, volume, , range, pitch);
}
else // Exagerate other players sounds (range slightly greater than distance you see with vision aug)
{
volume *= 2.0;
range = (class'AugVision'.Default.mpAugValue * 1.2);
volume = FClamp(volume, 0, 1.0);
PlaySound(stepSound, SLOT_Interact, volume, , range, pitch);
}
}
}
AISendEvent('LoudNoise', EAITYPE_Audio, volume*volumeMultiplier, range*volumeMultiplier);

PlayHit (float Damage, vector HitLocation, name damageType, vector Momentum)


if ((Damage > 0) && (damageType == 'Shot') || (damageType == 'Exploded') || (damageType == 'AutoShot'))
SpawnBlood(HitLocation, Damage);

PlayTakeHitSound(Damage, damageType, 1);

PlayMusic (String musicToPlay, optional int sectionToPlay)


local Music LoadedMusic;
local EMusicMode newMusicMode;


if (musicToPlay != "")
{
LoadedMusic = Music(DynamicLoadObject(musicToPlay $ "." $ musicToPlay, class'Music'));

if (LoadedMusic != None)
{
switch(sectionToPlay)
{
case 0: newMusicMode = MUS_Ambient; break;
case 1: newMusicMode = MUS_Combat; break;
case 2: newMusicMode = MUS_Conversation; break;
case 3: newMusicMode = MUS_Outro; break;
case 4: newMusicMode = MUS_Dying; break;
default: newMusicMode = MUS_Ambient; break;
}

ClientSetMusic(LoadedMusic, newMusicMode, 255, MTRAN_FastFade);
}
}

PlayMusicWindow


if (!bCheatsEnabled)
return;

InvokeUIScreen(Class'PlayMusicWindow');

PlayPickupAnim (Vector locPickup)


if (Location.Z - locPickup.Z < 16)
PlayAnim('PushButton',,0.1);
else
PlayAnim('Pickup',,0.1);

PlayerCalcView (out actor ViewActor, out vector CameraLocation, out rotator CameraRotation)


// check for spy drone and freeze player's view
if (bSpyDroneActive)
{
if (aDrone != None)
{
// First-person view.
CameraLocation = Location;
CameraLocation.Z += EyeHeight;
CameraLocation += WalkBob;
return;
}
}

// Check if we're in first-person view or third-person. If we're in first-person then
// we'll just render the normal camera view. Otherwise we want to place the camera
// as directed by the conPlay.cameraInfo object.

if ( bBehindView && (!InConversation()) )
{
Super.PlayerCalcView(ViewActor, CameraLocation, CameraRotation);
return;
}

if ( (!InConversation()) || ( conPlay.GetDisplayMode() == DM_FirstPerson ) )
{
// First-person view.
ViewActor = Self;
CameraRotation = ViewRotation;
CameraLocation = Location;
CameraLocation.Z += EyeHeight;
CameraLocation += WalkBob;
return;
}

// Allow the ConCamera object to calculate the camera position and
// rotation for us (in other words, take this sloppy routine and
// hide it elsewhere).

if (conPlay.cameraInfo.CalculateCameraPosition(ViewActor, CameraLocation, CameraRotation) == False)
Super.PlayerCalcView(ViewActor, CameraLocation, CameraRotation);

PlayerInput (float DeltaTime)


if (!InConversation())
Super.PlayerInput(DeltaTime);

PlayerIsClient -> bool


return (PlayerIsListenClient() || PlayerIsRemoteClient());

PlayerIsListenClient -> bool


return ((GetPlayerPawn() == Self) && (Level.NetMode == NM_ListenServer));

PlayerIsRemoteClient -> bool


return ((Level.NetMode == NM_Client) && (Role == ROLE_AutonomousProxy));

PlayerTick (float deltaTime)


local rotator tempRot;
local float yawDelta;


UpdateInHand();
UpdateDynamicMusic(deltaTime);

DrugEffects(deltaTime);
Bleed(deltaTime);
MaintainEnergy(deltaTime);

// must update viewflash manually incase a flash happens during a convo
ViewFlash(deltaTime);

// Check if player has walked outside a first-person convo.
CheckActiveConversationRadius();

// Check if all the people involved in a conversation are
// still within a reasonable radius.
CheckActorDistances();

Super.PlayerTick(deltaTime);
LipSynch(deltaTime);

// Keep turning towards the person we're speaking to
if (ConversationActor != None)
{
LookAtActor(ConversationActor, true, true, true, 0, 0.5);

// Hacky way to force the player to turn...
tempRot = rot(0,0,0);
tempRot.Yaw = (DesiredRotation.Yaw - Rotation.Yaw) & 65535;
if (tempRot.Yaw > 32767)
tempRot.Yaw -= 65536;
yawDelta = RotationRate.Yaw * deltaTime;
if (tempRot.Yaw > yawDelta)
tempRot.Yaw = yawDelta;
else if (tempRot.Yaw < -yawDelta)
tempRot.Yaw = -yawDelta;
SetRotation(Rotation + tempRot);
}

// Update Time Played
UpdateTimePlayed(deltaTime);

PopHealth (float health0, float health1, float health2, float health3, float health4, float health5)


HealthHead = health0;
HealthTorso = health1;
HealthArmRight = health2;
HealthArmLeft = health3;
HealthLegRight = health4;
HealthLegLeft = health5;

Possess


Super.Possess();

if (Level.Netmode == NM_Client)
{
ClientPossessed();
}

PostBeginPlay


local DeusExLevelInfo info;
local int levelInfoCount;


Super.PostBeginPlay();

// Check to make sure there's only *ONE* DeusExLevelInfo and
// go fucking *BOOM* if we find more than one.

levelInfoCount = 0;
foreach AllActors(class'DeusExLevelInfo', info)
levelInfoCount++;

Assert(levelInfoCount <= 1);

// give us a shadow
if (Level.Netmode == NM_Standalone)
CreateShadow();

InitializeSubSystems();
DXGame = Level.Game;
ShieldStatus = SS_Off;
ServerTimeLastRefresh = 0;

// Safeguard so no cheats in multiplayer
if ( Level.NetMode != NM_Standalone )
bCheatsEnabled = False;

PostIntro


if (bStartNewGameAfterIntro)
{
bStartNewGameAfterIntro = False;
StartNewGame(strStartMap);
}
else
{
Level.Game.SendPlayer(Self, "dxonly");
}

PostNetBeginPlay


Super.PostNetBeginPlay();

if (Role == ROLE_SimulatedProxy)
{
DrawShield();
CreatePlayerTracker();
if ( NintendoImmunityTimeLeft > 0.0 )
DrawInvulnShield();
return;
}

//DEUS_EX AMSD In multiplayer, we need to do this for our local theme manager, since
//PostBeginPlay isn't called to set these up, and the Thememanager can be local, it
//doesn't have to sync with the server.
if (ThemeManager == NONE)
{
CreateColorThemeManager();
ThemeManager.SetOwner(self);
ThemeManager.SetCurrentHUDColorTheme(ThemeManager.GetFirstTheme(1));
ThemeManager.SetCurrentMenuColorTheme(ThemeManager.GetFirstTheme(0));
ThemeManager.SetMenuThemeByName(MenuThemeName);
ThemeManager.SetHUDThemeByName(HUDThemeName);
if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).ChangeStyle();
}
ReceiveFirstOptionSync(AugPrefs[0], AugPrefs[1], AugPrefs[2], AugPrefs[3], AugPrefs[4]);
ReceiveSecondOptionSync(AugPrefs[5], AugPrefs[6], AugPrefs[7], AugPrefs[8]);
ShieldStatus = SS_Off;
bCheatsEnabled = False;

ServerSetAutoReload( bAutoReload );

PostPostBeginPlay


Super.PostPostBeginPlay();

// Bind any conversation events to this DeusExPlayer
ConBindEvents();

// Restore colors that the user selected (as opposed to those
// stored in the savegame)
ThemeManager.SetMenuThemeByName(MenuThemeName);
ThemeManager.SetHUDThemeByName(HUDThemeName);

if ((Level.NetMode != NM_Standalone) && ( killProfile == None ))
killProfile = Spawn(class'KillerProfile', Self);

PreTravel


// Set a flag designating that we're traveling,
// so MissionScript can check and not call FirstFrame() for this map.

flagBase.SetBool('PlayerTraveling', True, True, 0);

SaveSkillPoints();

if (dataLinkPlay != None)
dataLinkPlay.AbortAndSaveHistory();

// If the player is burning (Fire! Fire!), extinguish him
// before the map transition. This is done to fix stuff
// that's fucked up.
ExtinguishFire();

PrevBeltItem


local DeusExRootWindow root;
local int slot, startSlot;


if (RestrictInput())
return;

if (CarriedDecoration == None)
{
slot = 1;
root = DeusExRootWindow(rootWindow);
if (root != None)
{
if (ClientInHandPending != None)
slot = ClientInHandPending.beltPos;
else if (inHandPending != None)
slot = inHandPending.beltPos;
else if (inHand != None)
slot = inHand.beltPos;

startSlot = slot;
do
{
if (--slot <= -1)
slot = 9;
}
until (root.ActivateObjectInBelt(slot) || (startSlot == slot));

clientInHandPending = root.hud.belt.GetObjectFromBelt(slot);
}
}

ProcessMove (float DeltaTime, vector newAccel, eDodgeDir DodgeMove, rotator DeltaRot)


local int newSpeed, defSpeed;
local name mat;
local vector HitLocation, HitNormal, checkpoint, downcheck;
local Actor HitActor, HitActorDown;
local bool bCantStandUp;
local Vector loc, traceSize;
local float alpha, maxLeanDist;
local float legTotal, weapSkill;


// if the spy drone augmentation is active
if (bSpyDroneActive)
{
if ( aDrone != None )
{
// put away whatever is in our hand
if (inHand != None)
PutInHand(None);

// make the drone's rotation match the player's view
aDrone.SetRotation(ViewRotation);

// move the drone
loc = Normal((aUp * vect(0,0,1) + aForward * vect(1,0,0) + aStrafe * vect(0,1,0)) >> ViewRotation);

// opportunity for client to translate movement to server
MoveDrone( DeltaTime, loc );

// freeze the player
Velocity = vect(0,0,0);
}
return;
}

defSpeed = GetCurrentGroundSpeed();

// crouching makes you two feet tall
if (bIsCrouching || bForceDuck)
{
if ( Level.NetMode != NM_Standalone )
SetBasedPawnSize(Default.CollisionRadius, 30.0);
else
SetBasedPawnSize(Default.CollisionRadius, 16);

// check to see if we could stand up if we wanted to
checkpoint = Location;
// check normal standing height
checkpoint.Z = checkpoint.Z - CollisionHeight + 2 * GetDefaultCollisionHeight();
traceSize.X = CollisionRadius;
traceSize.Y = CollisionRadius;
traceSize.Z = 1;
HitActor = Trace(HitLocation, HitNormal, checkpoint, Location, True, traceSize);
if (HitActor == None)
bCantStandUp = False;
else
bCantStandUp = True;
}
else
{
// DEUS_EX AMSD Changed this to grab defspeed, because GetCurrentGroundSpeed takes 31k cycles to run.
GroundSpeed = defSpeed;

// make sure the collision height is fudged for the floor problem - CNN
if (!IsLeaning())
{
ResetBasedPawnSize();
}
}

if (bCantStandUp)
bForceDuck = True;
else
bForceDuck = False;

// if the player's legs are damaged, then reduce our speed accordingly
newSpeed = defSpeed;

if ( Level.NetMode == NM_Standalone )
{
if (HealthLegLeft < 1)
newSpeed -= (defSpeed/2) * 0.25;
else if (HealthLegLeft < 34)
newSpeed -= (defSpeed/2) * 0.15;
else if (HealthLegLeft < 67)
newSpeed -= (defSpeed/2) * 0.10;

if (HealthLegRight < 1)
newSpeed -= (defSpeed/2) * 0.25;
else if (HealthLegRight < 34)
newSpeed -= (defSpeed/2) * 0.15;
else if (HealthLegRight < 67)
newSpeed -= (defSpeed/2) * 0.10;

if (HealthTorso < 67)
newSpeed -= (defSpeed/2) * 0.05;
}

// let the player pull themselves along with their hands even if both of
// their legs are blown off
if ((HealthLegLeft < 1) && (HealthLegRight < 1))
{
newSpeed = defSpeed * 0.8;
bIsWalking = True;
bForceDuck = True;
}
// make crouch speed faster than normal
else if (bIsCrouching || bForceDuck)
{
// newSpeed = defSpeed * 1.8; // DEUS_EX CNN - uncomment to speed up crouch
bIsWalking = True;
}

// CNN - Took this out because it sucks ASS!
// if the legs are seriously damaged, increase the head bob
// (unless the player has turned it off)
/* if (Bob > 0.0)
{
legTotal = (HealthLegLeft + HealthLegRight) / 2.0;
if (legTotal < 50)
Bob = Default.Bob * FClamp(0.05*(70 - legTotal), 1.0, 3.0);
else
Bob = Default.Bob;
}
*/
// slow the player down if he's carrying something heavy
// Like a DEAD BODY! AHHHHHH!!!
if (CarriedDecoration != None)
{
newSpeed -= CarriedDecoration.Mass * 2;
}
// don't slow the player down if he's skilled at the corresponding weapon skill
else if ((DeusExWeapon(Weapon) != None) && (Weapon.Mass > 30) && (DeusExWeapon(Weapon).GetWeaponSkill() > -0.25) && (Level.NetMode==NM_Standalone))
{
bIsWalking = True;
newSpeed = defSpeed;
}
else if ((inHand != None) && inHand.IsA('POVCorpse'))
{
newSpeed -= inHand.Mass * 3;
}

// Multiplayer movement adjusters
if ( Level.NetMode != NM_Standalone )
{
if ( Weapon != None )
{
weapSkill = DeusExWeapon(Weapon).GetWeaponSkill();
// Slow down heavy weapons in multiplayer
if ((DeusExWeapon(Weapon) != None) && (Weapon.Mass > 30) )
{
newSpeed = defSpeed;
newSpeed -= ((( Weapon.Mass - 30.0 ) / (class'WeaponGEPGun'.Default.Mass - 30.0 )) * (0.70 + weapSkill) * defSpeed );
}
// Slow turn rate of GEP gun in multiplayer to discourage using it as the most effective close quarters weapon
if ((WeaponGEPGun(Weapon) != None) && (!WeaponGEPGun(Weapon).bZoomed))
TurnRateAdjuster = FClamp( 0.20 + -(weapSkill*0.5), 0.25, 1.0 );
else
TurnRateAdjuster = 1.0;
}
else
TurnRateAdjuster = 1.0;
}

// if we are moving really slow, force us to walking
if ((newSpeed <= defSpeed / 3) && !bForceDuck)
{
bIsWalking = True;
newSpeed = defSpeed;
}

// if we are moving backwards, we should move slower
// DEUS_EX AMSD Turns out this wasn't working right in multiplayer, I have a fix
// for it, but it would change all our balance.
if ((aForward < 0) && (Level.NetMode == NM_Standalone))
newSpeed *= 0.65;

GroundSpeed = FMax(newSpeed, 100);

// if we are moving or crouching, we can't lean
// uncomment below line to disallow leaning during crouch

if ((VSize(Velocity) < 10) && (aForward == 0)) // && !bIsCrouching && !bForceDuck)
bCanLean = True;
else
bCanLean = False;

// check leaning buttons (axis aExtra0 is used for leaning)
maxLeanDist = 40;

if (IsLeaning())
{
if ( PlayerIsClient() || (Level.NetMode == NM_Standalone) )
ViewRotation.Roll = curLeanDist * 20;

if (!bIsCrouching && !bForceDuck)
SetBasedPawnSize(CollisionRadius, GetDefaultCollisionHeight() - Abs(curLeanDist) / 3.0);
}
if (bCanLean && (aExtra0 != 0))
{
// lean
DropDecoration(); // drop the decoration that we are carrying
if (AnimSequence != 'CrouchWalk')
PlayCrawling();

alpha = maxLeanDist * aExtra0 * 2.0 * DeltaTime;

loc = vect(0,0,0);
loc.Y = alpha;
if (Abs(curLeanDist + alpha) < maxLeanDist)
{
// check to make sure the destination not blocked
checkpoint = (loc >> Rotation) + Location;
traceSize.X = CollisionRadius;
traceSize.Y = CollisionRadius;
traceSize.Z = CollisionHeight;
HitActor = Trace(HitLocation, HitNormal, checkpoint, Location, True, traceSize);

// check down as well to make sure there's a floor there
downcheck = checkpoint - vect(0,0,1) * CollisionHeight;
HitActorDown = Trace(HitLocation, HitNormal, downcheck, checkpoint, True, traceSize);
if ((HitActor == None) && (HitActorDown != None))
{
if ( PlayerIsClient() || (Level.NetMode == NM_Standalone))
{
SetLocation(checkpoint);
ServerUpdateLean( checkpoint );
curLeanDist += alpha;
}
}
}
else
{
if ( PlayerIsClient() || (Level.NetMode == NM_Standalone) )
curLeanDist = aExtra0 * maxLeanDist;
}
}
else if (IsLeaning()) //if (!bCanLean && IsLeaning()) // uncomment this to not hold down lean
{
// un-lean
if (AnimSequence == 'CrouchWalk')
PlayRising();

if ( PlayerIsClient() || (Level.NetMode == NM_Standalone))
{
prevLeanDist = curLeanDist;
alpha = FClamp(7.0 * DeltaTime, 0.001, 0.9);
curLeanDist *= 1.0 - alpha;
if (Abs(curLeanDist) < 1.0)
curLeanDist = 0;
}

loc = vect(0,0,0);
loc.Y = -(prevLeanDist - curLeanDist);

// check to make sure the destination not blocked
checkpoint = (loc >> Rotation) + Location;
traceSize.X = CollisionRadius;
traceSize.Y = CollisionRadius;
traceSize.Z = CollisionHeight;
HitActor = Trace(HitLocation, HitNormal, checkpoint, Location, True, traceSize);

// check down as well to make sure there's a floor there
downcheck = checkpoint - vect(0,0,1) * CollisionHeight;
HitActorDown = Trace(HitLocation, HitNormal, downcheck, checkpoint, True, traceSize);
if ((HitActor == None) && (HitActorDown != None))
{
if ( PlayerIsClient() || (Level.NetMode == NM_Standalone))
{
SetLocation( checkpoint );
ServerUpdateLean( checkpoint );
}
}
}

Super.ProcessMove(DeltaTime, newAccel, DodgeMove, DeltaRot);

PunishDetection (int DamageAmount)


if (DamageAmount > 0)
TakeDamage(DamageAmount, None, vect(0,0,0), vect(0,0,0), 'EMP');

PutCarriedDecorationInHand


local vector lookDir, upDir;


if (CarriedDecoration != None)
{
lookDir = Vector(Rotation);
lookDir.Z = 0;
upDir = vect(0,0,0);
upDir.Z = CollisionHeight / 2; // put it up near eye level
CarriedDecoration.SetPhysics(PHYS_Falling);

if ( CarriedDecoration.SetLocation(Location + upDir + (0.5 * CollisionRadius + CarriedDecoration.CollisionRadius) * lookDir) )
{
CarriedDecoration.SetPhysics(PHYS_None);
CarriedDecoration.SetBase(self);
CarriedDecoration.SetCollision(False, False, False);
CarriedDecoration.bCollideWorld = False;

// make it translucent
CarriedDecoration.Style = STY_Translucent;
CarriedDecoration.ScaleGlow = 1.0;
CarriedDecoration.bUnlit = True;

FrobTarget = None;
}
else
{
ClientMessage(NoRoomToLift);
CarriedDecoration = None;
}
}

PutInHand (optional Inventory inv)


if (RestrictInput())
return;

// can't put anything in hand if you're using a spy drone
if ((inHand == None) && bSpyDroneActive)
return;

// can't do anything if you're carrying a corpse
if ((inHand != None) && inHand.IsA('POVCorpse'))
return;

if (inv != None)
{
// can't put ammo in hand
if (inv.IsA('Ammo'))
return;

// Can't put an active charged item in hand
if ((inv.IsA('ChargedPickup')) && (ChargedPickup(inv).IsActive()))
return;
}

if (CarriedDecoration != None)
DropDecoration();

SetInHandPending(inv);

QuickLoad


//Don't allow in multiplayer.

if (Level.Netmode != NM_Standalone)
return;

if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).ConfirmQuickLoad();

QuickLoadConfirmed


if (Level.Netmode != NM_Standalone)
return;
LoadGame(-1);

QuickSave


local DeusExLevelInfo info;


info = GetLevelInfo();

// Don't allow saving if:
//
// 1) The player is dead
// 2) We're on the logo map
// 4) We're interpolating (playing outtro)
// 3) A datalink is playing
// 4) We're in a multiplayer game

if (((info != None) && (info.MissionNumber < 0)) ||
((IsInState('Dying')) || (IsInState('Paralyzed')) || (IsInState('Interpolating'))) ||
(dataLinkPlay != None) || (Level.Netmode != NM_Standalone))
{
return;
}

SaveGame(-1, QuickSaveGameTitle);

ReceiveFirstOptionSync (Name PrefZero, Name PrefOne, Name PrefTwo, Name PrefThree, Name PrefFour)


local int i;
local Name AugPriority[5];


if (bFirstOptionsSynced == true)
{
return;
}

AugPriority[0] = PrefZero;
AugPriority[1] = PrefOne;
AugPriority[2] = PrefTwo;
AugPriority[3] = PrefThree;
AugPriority[4] = PrefFour;

for (i = 0; ((i < ArrayCount(AugPrefs)) && (i < ArrayCount(AugPriority))); i++)
{
AugPrefs[i] = AugPriority[i];
}
bFirstOptionsSynced = true;

if (Role == ROLE_Authority)
{
if ((DeusExMPGame(Level.Game) != None) && (bSecondOptionsSynced))
{
DeusExMPGame(Level.Game).SetupAbilities(self);
}
}

ReceiveSecondOptionSync (Name PrefFive, Name PrefSix, Name PrefSeven, Name PrefEight)


local int i;
local Name AugPriority[9];


if (bSecondOptionsSynced == true)
{
return;
}

AugPriority[5] = PrefFive;
AugPriority[6] = PrefSix;
AugPriority[7] = PrefSeven;
AugPriority[8] = PrefEight;

for (i = 5; ((i < ArrayCount(AugPrefs)) && (i < ArrayCount(AugPriority))); i++)
{
AugPrefs[i] = AugPriority[i];
}
bSecondOptionsSynced = true;

if (Role == ROLE_Authority)
{
if ((DeusExMPGame(Level.Game) != None) && (bFirstOptionsSynced))
{
DeusExMPGame(Level.Game).SetupAbilities(self);
}
}

RefreshChargedPickups


local ChargedPickup anItem;


// Loop through all the ChargedPicksups and look for charged pickups
// that are active. If we find one, add to the user-interface.

foreach AllActors(class'ChargedPickup', anItem)
{
if ((anItem.Owner == Self) && (anItem.IsActive()))
{
// Make sure tech goggles display is refreshed
if (anItem.IsA('TechGoggles'))
TechGoggles(anItem).UpdateHUDDisplay(Self);

AddChargedDisplay(anItem);
}
}

RefreshSystems (float DeltaTime)


local DeusExRootWindow root;


if (Level.NetMode == NM_Standalone)
return;

if (Role == ROLE_Authority)
return;

if (LastRefreshTime < 0)
LastRefreshTime = 0;

LastRefreshTime = LastRefreshTime + DeltaTime;

if (LastRefreshTime < 0.25)
return;

if (AugmentationSystem != None)
AugmentationSystem.RefreshAugDisplay();

root = DeusExRootWindow(rootWindow);
if (root != None)
root.RefreshDisplay(LastRefreshTime);

RepairInventory();

LastRefreshTime = 0;


ReloadWeapon


local DeusExWeapon W;


if (RestrictInput())
return;

W = DeusExWeapon(Weapon);
if (W != None)
W.ReloadAmmo();

Reloading (DeusExWeapon weapon, float reloadTime)


if (!IsLeaning() && !bIsCrouching && (Physics != PHYS_Swimming) && !IsInState('Dying'))
PlayAnim('Reload', 1.0 / reloadTime, 0.1);

RemoveAugmentationDisplay (Augmentation aug)


DeusExRootWindow(rootWindow).hud.activeItems.RemoveIcon(aug);

RemoveChargedDisplay (ChargedPickup item)


if ( (PlayerIsClient()) || (Level.NetMode == NM_Standalone) )
DeusExRootWindow(rootWindow).hud.activeItems.RemoveIcon(item);

RemoveInventoryType (Class removeType)


local Inventory item;


item = FindInventoryType(removeType);

if (item != None)
DeleteInventory(item);

RemoveItemDuringConversation (Inventory item)


if (item != None)
{
// take it out of our hand
if (item == inHand)
PutInHand(None);

// Make sure it's removed from the inventory grid
RemoveItemFromSlot(item);

// Make sure the item is deactivated!
if (item.IsA('DeusExWeapon'))
{
DeusExWeapon(item).ScopeOff();
DeusExWeapon(item).LaserOff();
}
else if (item.IsA('DeusExPickup'))
{
// turn it off if it is on
if (DeusExPickup(item).bActive)
DeusExPickup(item).Activate();
}

if (conPlay != None)
conPlay.SetInHand(None);
}

RemoveItemFromSlot (Inventory anItem)


if (anItem != None)
{
SetInvSlots(anItem, 0);
anItem.invPosX = -1;
anItem.invPosY = -1;
}

RemoveNanoKey (Name KeyToRemove)


if (!bCheatsEnabled)
return;

KeyRing.RemoveKey(KeyToRemove);
if ((Role == ROLE_Authority) && (Level.NetMode != NM_Standalone))
{
KeyRing.RemoveClientKey(KeyToRemove);
}

RemoveObjectFromBelt (Inventory item)


if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).hud.belt.RemoveObjectFromBelt(item);

RenderOverlays (canvas Canvas)


Super.RenderOverlays(Canvas);

if (!IsInState('Interpolating') && !IsInState('Paralyzed'))
if ((inHand != None) && (!inHand.IsA('Weapon')))
inHand.RenderOverlays(Canvas);

RepairInventory


local byte LocalInvSlots[30]; // 5x6 grid of inventory slots
local int i;
local int slotsCol;
local int slotsRow;
local Inventory curInv;


if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
return;

//clean out our temp inventory.
for (i = 0; i < 30; i++)
LocalInvSlots[i] = 0;

// go through our inventory and fill localinvslots
if (Inventory != None)
{
for (curInv = Inventory; curInv != None; curInv = curInv.Inventory)
{
// Make sure this item is located in a valid position
if (( curInv.invPosX != -1 ) && ( curInv.invPosY != -1 ))
{
// fill inventory slots
for( slotsRow=0; slotsRow < curInv.invSlotsY; slotsRow++ )
for ( slotsCol=0; slotsCol < curInv.invSlotsX; slotsCol++ )
LocalInvSlots[((slotsRow + curInv.invPosY) * maxInvCols) + (slotscol + curInv.invPosX)] = 1;
}
}
}

// verify that the 2 inventory grids match
for (i = 0; i < 30; i++)
if (LocalInvSlots[i] < invSlots[i]) //don't stuff slots, that can get handled elsewhere, just clear ones that need it
{
log("ERROR!!! Slot "$i$" should be "$LocalInvSlots[i]$", but isn't!!!!, repairing");
invSlots[i] = LocalInvSlots[i];
}


ResetBasedPawnSize -> bool


return SetBasedPawnSize(Default.CollisionRadius, GetDefaultCollisionHeight());

ResetConversationHistory


if (conHistory != None)
{
CriticalDelete(conHistory);
conHistory = None;
}

ResetGoals


local DeusExGoal goal;
local DeusExGoal goalNext;


goal = FirstGoal;

while( goal != None )
{
goalNext = goal.next;

// Delete:
// 1) Completed Primary Goals
// 2) ALL Secondary Goals

if ((!goal.IsPrimaryGoal()) || (goal.IsPrimaryGoal() && goal.IsCompleted()))
DeleteGoal(goal);

goal = goalNext;
}

ResetPlayer (optional bool bTraining)


local inventory anItem;
local inventory nextItem;


ResetPlayerToDefaults();

// Reset Augmentations
if (AugmentationSystem != None)
{
AugmentationSystem.ResetAugmentations();
AugmentationSystem.Destroy();
AugmentationSystem = None;
}

// Give the player a pistol and a prod
if (!bTraining)
{
anItem = Spawn(class'WeaponPistol');
anItem.Frob(Self, None);
anItem.bInObjectBelt = True;
anItem = Spawn(class'WeaponProd');
anItem.Frob(Self, None);
anItem.bInObjectBelt = True;
anItem = Spawn(class'MedKit');
anItem.Frob(Self, None);
anItem.bInObjectBelt = True;
}

ResetPlayerToDefaults


local inventory anItem;
local inventory nextItem;


// reset the image linked list
FirstImage = None;

if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).ResetFlags();

// Remove all the keys from the keyring before
// it gets destroyed
if (KeyRing != None)
{
KeyRing.RemoveAllKeys();
if ((Role == ROLE_Authority) && (Level.NetMode != NM_Standalone))
{
KeyRing.ClientRemoveAllKeys();
}
KeyRing = None;
}

while(Inventory != None)
{
anItem = Inventory;
DeleteInventory(anItem);
anItem.Destroy();
}

// Clear object belt
if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).hud.belt.ClearBelt();

// clear the notes and the goals
DeleteAllNotes();
DeleteAllGoals();

// Nuke the history
ResetConversationHistory();

// Other defaults
Credits = Default.Credits;
Energy = Default.Energy;
SkillPointsTotal = Default.SkillPointsTotal;
SkillPointsAvail = Default.SkillPointsAvail;

SetInHandPending(None);
SetInHand(None);

bInHandTransition = False;

RestoreAllHealth();
ClearLog();

// Reset save count/time
saveCount = 0;
saveTime = 0.0;

// Reinitialize all subsystems we've just nuked
InitializeSubSystems();

// Give starting inventory.
if (Level.Netmode != NM_Standalone)
{
NintendoImmunityEffect( True );
GiveInitialInventory();
}

RestartLevel


ResetPlayer();
Super.RestartLevel();

RestoreAllHealth


HealthHead = default.HealthHead;
HealthTorso = default.HealthTorso;
HealthLegLeft = default.HealthLegLeft;
HealthLegRight = default.HealthLegRight;
HealthArmLeft = default.HealthArmLeft;
HealthArmRight = default.HealthArmRight;
Health = default.Health;

RestoreScopeView


if (inHand != None)
{
if (inHand.IsA('Binoculars') && (inHand.bActive))
Binoculars(inHand).RefreshScopeDisplay(Self, True);
else if ((DeusExWeapon(inHand) != None) && (DeusExWeapon(inHand).bZoomed))
DeusExWeapon(inHand).RefreshScopeDisplay(Self, True, True);
}

RestoreSkillPoints


local name flagName;


bSavingSkillsAugs = False;

// Get the skill points available
flagName = rootWindow.StringToName("SKTemp_SkillPointsAvail");
if (flagBase.CheckFlag(flagName, FLAG_Int))
{
SkillPointsAvail = flagBase.GetInt(flagName);
flagBase.DeleteFlag(flagName, FLAG_Int);
}

// Get the skill points total
flagName = rootWindow.StringToName("SKTemp_SkillPointsTotal");
if (flagBase.CheckFlag(flagName, FLAG_Int))
{
SkillPointsTotal = flagBase.GetInt(flagName);
flagBase.DeleteFlag(flagName, FLAG_Int);
}

RestrictInput -> bool


if (IsInState('Interpolating') || IsInState('Dying') || IsInState('Paralyzed'))
return True;

return False;


if ( dataLinkPlay != None )
dataLinkPlay.ResumeDataLinks();

SaveGame (int saveIndex, optional String saveDesc) | native

SaveSkillPoints


local name flagName;


// Save/Restore must be done as atomic unit
if (bSavingSkillsAugs)
return;

bSavingSkillsAugs = True;

// Save the skill points available
flagName = rootWindow.StringToName("SKTemp_SkillPointsAvail");
flagBase.SetInt(flagName, SkillPointsAvail);

// Save the skill points available
flagName = rootWindow.StringToName("SKTemp_SkillPointsTotal");
flagBase.SetInt(flagName, SkillPointsTotal);

ServerConditionalNotifyMsg (int code, optional int param, optional string str)


switch( code )
{
case MPMSG_FirstPoison:
if ( (mpMsgServerFlags & MPSERVERFLAG_FirstPoison) == MPSERVERFLAG_FirstPoison )
return;
else
mpMsgServerFlags = mpMsgServerFlags | MPSERVERFLAG_FirstPoison;
break;
case MPMSG_FirstBurn:
if ( (mpMsgServerFlags & MPSERVERFLAG_FirstBurn) == MPSERVERFLAG_FirstBurn )
return;
else
mpMsgServerFlags = mpMsgServerFlags | MPSERVERFLAG_FirstBurn;
break;
case MPMSG_TurretInv:
if ( ( mpMsgServerFlags & MPSERVERFLAG_TurretInv ) == MPSERVERFLAG_TurretInv )
return;
else
mpMsgServerFlags = mpMsgServerFlags | MPSERVERFLAG_TurretInv;
break;
case MPMSG_CameraInv:
if ( ( mpMsgServerFlags & MPSERVERFLAG_CameraInv ) == MPSERVERFLAG_CameraInv )
return;
else
mpMsgServerFlags = mpMsgServerFlags | MPSERVERFLAG_CameraInv;
break;
case MPMSG_LostLegs:
if ( ( mpMsgServerFlags & MPSERVERFLAG_LostLegs) == MPSERVERFLAG_LostLegs )
return;
else
mpMsgServerFlags = mpMsgServerFlags | MPSERVERFLAG_LostLegs;
break;
case MPMSG_DropItem:
if ( ( mpMsgServerFlags & MPSERVERFLAG_DropItem) == MPSERVERFLAG_DropItem )
return;
else
mpMsgServerFlags = mpMsgServerFlags | MPSERVERFLAG_DropItem;
break;
case MPMSG_NoCloakWeapon:
if ( ( mpMsgServerFlags & MPSERVERFLAG_NoCloakWeapon) == MPSERVERFLAG_NoCloakWeapon )
return;
else
mpMsgServerFlags = mpMsgServerFlags | MPSERVERFLAG_NoCloakWeapon;
break;
}
// If we made it here we need to notify
MultiplayerNotifyMsg( code, param, str );

ServerSetAutoReload (bool bAuto)


bAutoReload = bAuto;

ServerUpdateLean (Vector desiredLoc)


local Vector gndCheck, traceSize, HitNormal, HitLocation;
local Actor HitActor, HitActorGnd;


// First check to see if anything is in the way
traceSize.X = CollisionRadius;
traceSize.Y = CollisionRadius;
traceSize.Z = CollisionHeight;
HitActor = Trace( HitLocation, HitNormal, desiredLoc, Location, True, traceSize );

// Make we don't lean off the edge of something
if ( HitActor == None ) // Don't bother if we're going to fail to set anyway
{
gndCheck = desiredLoc - vect(0,0,1) * CollisionHeight;
HitActorGnd = Trace( HitLocation, HitNormal, gndCheck, desiredLoc, True, traceSize );
}

if ( (HitActor == None) && (HitActorGnd != None) )
SetLocation( desiredLoc );

// SetRotation( rot );

SetBasedPawnSize (float newRadius, float newHeight) -> bool


local float oldRadius, oldHeight;
local bool bSuccess;
local vector centerDelta, lookDir, upDir;
local float deltaEyeHeight;
local Decoration savedDeco;


if (newRadius < 0)
newRadius = 0;
if (newHeight < 0)
newHeight = 0;

oldRadius = CollisionRadius;
oldHeight = CollisionHeight;

if ( Level.NetMode == NM_Standalone )
{
if ((oldRadius == newRadius) && (oldHeight == newHeight))
return true;
}

centerDelta = vect(0, 0, 1)*(newHeight-oldHeight);
deltaEyeHeight = GetDefaultCollisionHeight() - Default.BaseEyeHeight;

if ( Level.NetMode != NM_Standalone )
{
if ((oldRadius == newRadius) && (oldHeight == newHeight) && (BaseEyeHeight == newHeight - deltaEyeHeight))
return true;
}

if (CarriedDecoration != None)
savedDeco = CarriedDecoration;

bSuccess = false;
if ((newHeight <= CollisionHeight) && (newRadius <= CollisionRadius)) // shrink
{
SetCollisionSize(newRadius, newHeight);
if (Move(centerDelta))
bSuccess = true;
else
SetCollisionSize(oldRadius, oldHeight);
}
else
{
if (Move(centerDelta))
{
SetCollisionSize(newRadius, newHeight);
bSuccess = true;
}
}

if (bSuccess)
{
// make sure we don't lose our carried decoration
if (savedDeco != None)
{
savedDeco.SetPhysics(PHYS_None);
savedDeco.SetBase(Self);
savedDeco.SetCollision(False, False, False);

// reset the decoration's location
lookDir = Vector(Rotation);
lookDir.Z = 0;
upDir = vect(0,0,0);
upDir.Z = CollisionHeight / 2; // put it up near eye level
savedDeco.SetLocation(Location + upDir + (0.5 * CollisionRadius + CarriedDecoration.CollisionRadius) * lookDir);
}

// PrePivotOffset = vect(0, 0, 1)*(GetDefaultCollisionHeight()-newHeight);
PrePivot -= centerDelta;
// DesiredPrePivot -= centerDelta;
BaseEyeHeight = newHeight - deltaEyeHeight;

// Complaints that eye height doesn't seem like your crouching in multiplayer
if (( Level.NetMode != NM_Standalone ) && (bIsCrouching || bForceDuck) )
EyeHeight -= (centerDelta.Z * 2.5);
else
EyeHeight -= centerDelta.Z;
}
return (bSuccess);

SetBoolFlagFromString (String flagNameString, bool bValue) | native

SetComputerHackTime (Computers computerToSet, float HackTime, float ClientLevelTime)


computerToSet.lastHackTime = HackTime + (Level.TimeSeconds - ClientLevelTime);

SetDamagePercent (float percent)


DeusExRootWindow(rootWindow).hud.damageDisplay.SetPercent(percent);

SetDebug (name cmd, name val)


if (!bCheatsEnabled)
return;

if (GlobalDebugObj == None)
GlobalDebugObj = new(Self) class'DebugInfo';

Log("Want to setting Debug String " $ cmd $ " to " $ val);

if (GlobalDebugObj != None)
GlobalDebugObj.SetString(String(cmd),String(val));

SetHUDBackgroundTranslucency (bool bNewTranslucency)


bHUDBackgroundTranslucent = bNewTranslucency;

SetHUDBorderTranslucency (bool bNewTranslucency)


bHUDBordersTranslucent = bNewTranslucency;

SetHUDBordersVisible (bool bVisible)


bHUDBordersVisible = bVisible;

SetInHand (Inventory newInHand)


local DeusExRootWindow root;


inHand = newInHand;

// Notify the hud
root = DeusExRootWindow(rootWindow);
if (root != None)
root.hud.belt.UpdateInHand();

SetInHandPending (Inventory newInHandPending)


local DeusExRootWindow root;


if ( newInHandPending == None )
ClientInHandPending = None;

inHandPending = newInHandPending;

root = DeusExRootWindow(rootWindow);
if (root != None)
root.hud.belt.UpdateInHand();

SetInvSlots (Inventory anItem, int newValue)


local int slotsCol;
local int slotsRow;


if ( anItem == None )
return;

// Make sure this item is located in a valid position
if (( anItem.invPosX != -1 ) && ( anItem.invPosY != -1 ))
{
// fill inventory slots
for( slotsRow=0; slotsRow < anItem.invSlotsY; slotsRow++ )
for ( slotsCol=0; slotsCol < anItem.invSlotsX; slotsCol++ )
invSlots[((slotsRow + anItem.invPosY) * maxInvCols) + (slotsCol + anItem.invPosX)] = newValue;
}

SetLogTimeout (Float newLogTimeout)


logTimeout = newLogTimeout;

// Update the HUD Log Display
if (DeusExRootWindow(rootWindow).hud != None)
DeusExRootWindow(rootWindow).hud.msgLog.SetLogTimeout(newLogTimeout);

SetMaxLogLines (Byte newLogLines)


maxLogLines = newLogLines;

// Update the HUD Log Display
if (DeusExRootWindow(rootWindow).hud != None)
DeusExRootWindow(rootWindow).hud.msgLog.SetMaxLogLines(newLogLines);

SetMenuTranslucency (bool bNewTranslucency)


bMenusTranslucent = bNewTranslucency;

SetServerTimeDiff (float sTime)


ServerTimeDiff = (sTime - Level.Timeseconds);

SetState (name state)


local ScriptedPawn P;
local Actor hitActor;
local vector loc, line, HitLocation, hitNormal;


if (!bCheatsEnabled)
return;

loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 2000;

hitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);
P = ScriptedPawn(hitActor);
if (P != None)
{
P.GotoState(state);
ClientMessage("Setting "$P.BindName$" to the "$state$" state");
}

SetTurretState (AutoTurret turret, bool bActive, bool bDisabled)


turret.bActive = bActive;
turret.bDisabled = bDisabled;
turret.bComputerReset = False;

SetTurretTrackMode (ComputerSecurity computer, AutoTurret turret, bool bTrackPlayers, bool bTrackPawns)


local String str;


turret.bTrackPlayersOnly = bTrackPlayers;
turret.bTrackPawnsOnly = bTrackPawns;
turret.bComputerReset = False;

//in multiplayer, behave differently
//set the safe target to ourself.
if (Level.NetMode != NM_Standalone)
{
//we abuse the names of the booleans here.
turret.SetSafeTarget( Self );

if (Role == ROLE_Authority)
{
if ( TeamDMGame(DXGame) != None )
{
computer.team = PlayerReplicationInfo.team;
turret.team = PlayerReplicationInfo.Team;
if ( !turret.bDisabled )
{
str = TakenOverString $ turret.titleString $ ".";
TeamSay( str );
}
}
else
{
computer.team = PlayerReplicationInfo.PlayerID;
turret.team = PlayerReplicationInfo.PlayerID;
}
}
}

ShowAcceleration (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowAcceleration(bShow);

ShowArea (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowArea(bShow);

ShowAugmentationAddWindow


if (RestrictInput())
return;

InvokeUIScreen(Class'HUDMedBotAddAugsScreen');

ShowAugmentationsWindow


if (RestrictInput())
return;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
{
ClientMessage("Augmentations screen disabled in multiplayer");
return;
}

InvokeUIScreen(Class'PersonaScreenAugmentations');

ShowBase (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowBase(bShow);

ShowBindName (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowBindName(bShow);

ShowClass (Class newClass)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.SetViewClass(newClass);

ShowConversationsWindow


if (RestrictInput())
return;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
{
ClientMessage("Conversations screen disabled in multiplayer");
return;
}

InvokeUIScreen(Class'PersonaScreenConversations');

ShowCredits (optional bool bLoadIntro)


local DeusExRootWindow root;
local CreditsWindow winCredits;


root = DeusExRootWindow(rootWindow);

if (root != None)
{
// Show the credits screen and force the game not to pause
// if we're showing the credits after the endgame
winCredits = CreditsWindow(root.InvokeMenuScreen(Class'CreditsWindow', bLoadIntro));
winCredits.SetLoadIntro(bLoadIntro);
}

ShowCylinder (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowCylinder(bShow);

ShowData (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowData(bShow);

ShowDemoSplash


local DeusExRootWindow root;


root = DeusExRootWindow(rootWindow);
if (root != None)
root.PushWindow(Class'DemoSplashWindow');

ShowDist (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowDist(bShow);

ShowER (bool bShow)


// Convenience form of ShowEnemyResponse()
ShowEnemyResponse(bShow);

ShowEnemy (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowEnemy(bShow);

ShowEnemyResponse (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowEnemyResponse(bShow);

ShowEyes (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowEyes(bShow);

ShowGoalsWindow


if (RestrictInput())
return;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
{
ClientMessage("Goals screen disabled in multiplayer");
return;
}

InvokeUIScreen(Class'PersonaScreenGoals');

ShowHealth (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowHealth(bShow);

ShowHealthWindow


if (RestrictInput())
return;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
{
ClientMessage("Health screen disabled in multiplayer");
return;
}

InvokeUIScreen(Class'PersonaScreenHealth');

ShowHud (bool bShow)


local DeusExRootWindow root;

root = DeusExRootWindow(rootWindow);
if (root != None)
root.ShowHud(bShow);

ShowImagesWindow


if (RestrictInput())
return;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
{
ClientMessage("Images screen disabled in multiplayer");
return;
}

InvokeUIScreen(Class'PersonaScreenImages');

ShowInstigator (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowInstigator(bShow);

ShowIntro (optional bool bStartNewGame)


if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).ClearWindowStack();

bStartNewGameAfterIntro = bStartNewGame;

// Make sure all augmentations are OFF before going into the intro
AugmentationSystem.DeactivateAll();

// Reset the player
Level.Game.SendPlayer(Self, "00_Intro");

ShowInventoryWindow


if (RestrictInput())
return;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
{
ClientMessage("Inventory screen disabled in multiplayer");
return;
}

InvokeUIScreen(Class'PersonaScreenInventory');

ShowLOS (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowLOS(bShow);

ShowLight (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowLight(bShow);

ShowLogsWindow


if (RestrictInput())
return;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
{
ClientMessage("Logs screen disabled in multiplayer");
return;
}

InvokeUIScreen(Class'PersonaScreenLogs');

ShowMainMenu


local DeusExRootWindow root;
local DeusExLevelInfo info;
local MissionEndgame Script;


if (bIgnoreNextShowMenu)
{
bIgnoreNextShowMenu = False;
return;
}

info = GetLevelInfo();

// Special case baby!
//
// If the Intro map is loaded and we get here, that means the player
// pressed Escape and we want to either A) start a new game
// or B) return to the dx.dx screen. Either way we're going to
// abort the Intro by doing this.
//
// If this is one of the Endgames (which have a mission # of 99)
// then we also want to call the Endgame's "FinishCinematic"
// function

// force the texture caches to flush
ConsoleCommand("FLUSH");

if ((info != None) && (info.MissionNumber == 98))
{
bIgnoreNextShowMenu = True;
PostIntro();
}
else if ((info != None) && (info.MissionNumber == 99))
{
foreach AllActors(class'MissionEndgame', Script)
break;

if (Script != None)
Script.FinishCinematic();
}
else
{
root = DeusExRootWindow(rootWindow);
if (root != None)
root.InvokeMenu(Class'MenuMain');
}

ShowMass (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowMass(bShow);

ShowMesh (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowMesh(bShow);

ShowMultiplayerWin (String winnerName, int winningTeam, String Killer, String Killee, String Method)


local HUDMultiplayer mpScr;
local DeusExRootWindow root;


if (( Player != None ) && ( Player.Console != None ))
Player.Console.ClearMessages();

root = DeusExRootWindow(rootWindow);

if ( root != None )
{
mpScr = HUDMultiplayer(root.InvokeUIScreen(Class'HUDMultiplayer', True));
root.MaskBackground(True);

if ( mpScr != None )
{
mpScr.winnerName = winnerName;
mpScr.winningTeam = winningTeam;
mpScr.winKiller = Killer;
mpScr.winKillee = Killee;
mpScr.winMethod = Method;
}
}

//Do cleanup
if (PlayerIsClient())
{
if (AugmentationSystem != None)
AugmentationSystem.DeactivateAll();
}

ShowPhysics (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowPhysics(bShow);

ShowPlayerPawnList


local pawn curpawn;


for (curpawn = level.pawnlist; curpawn != none; curpawn = curpawn.nextpawn)
log("======>Pawn is "$curpawn);

ShowPos (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowPos(bShow);

ShowProgress


local MultiplayerMessageWin mmw;
local DeusExRootWindow root;


root = DeusExRootWindow(rootWindow);
if (root != None)
{
if (root.GetTopWindow() != None)
mmw = MultiplayerMessageWin(root.GetTopWindow());

if ((mmw != None) && (mmw.bDisplayProgress == false))
{
mmw.Destroy();
mmw = None;
}
if ( mmw == None )
{
mmw = MultiplayerMessageWin(root.InvokeUIScreen(Class'MultiplayerMessageWin', True));
if ( mmw != None )
{
mmw.bKilled = false;
mmw.bDisplayProgress = true;
mmw.lockoutTime = Level.TimeSeconds + 0.2;
}
}
}

ShowQuotesWindow


if (!bCheatsEnabled)
return;

InvokeUIScreen(Class'QuotesWindow');

ShowRGBDialog


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
root.PushWindow(Class'MenuScreenRGB');

ShowScores


if ( bBuySkills && !bShowScores )
BuySkills();

bShowScores = !bShowScores;

ShowSkillsWindow


if (RestrictInput())
return;

if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
{
ClientMessage("Skills screen disabled in multiplayer");
return;
}

InvokeUIScreen(Class'PersonaScreenSkills');

ShowState (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowState(bShow);

ShowVelocity (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowVelocity(bShow);

ShowVisibility (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowVisibility(bShow);

ShowZone (bool bShow)


local DeusExRootWindow root;


if (!bCheatsEnabled)
return;

root = DeusExRootWindow(rootWindow);
if (root != None)
if (root.actorDisplay != None)
root.actorDisplay.ShowZone(bShow);

SkillPointsAdd (int numPoints)


if (numPoints > 0)
{
SkillPointsAvail += numPoints;
SkillPointsTotal += numPoints;

if ((DeusExRootWindow(rootWindow) != None) &&
(DeusExRootWindow(rootWindow).hud != None) &&
(DeusExRootWindow(rootWindow).hud.msgLog != None))
{
ClientMessage(Sprintf(SkillPointsAward, numPoints));
DeusExRootWindow(rootWindow).hud.msgLog.PlayLogSound(Sound'LogSkillPoints');
}
}

SpawnBlood (Vector HitLocation, float Damage)


local int i;


if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
{
return;
}

spawn(class'BloodSpurt',,,HitLocation);
spawn(class'BloodDrop',,,HitLocation);
for (i=0; i spawn(class'BloodDrop',,,HitLocation);

SpawnCarcass -> Carcass


local DeusExCarcass carc;
local Inventory item;
local Vector loc;


// don't spawn a carcass if we've been gibbed
if (Health < -80)
return None;

carc = DeusExCarcass(Spawn(CarcassType));
if (carc != None)
{
carc.Initfor(self);

// move it down to the ground
loc = Location;
loc.z -= CollisionHeight;
loc.z += carc.CollisionHeight;
carc.SetLocation(loc);

if (Player != None)
carc.bPlayerCarcass = true;
MoveTarget = carc; //for Player 3rd person views

// give the carcass the player's inventory
for (item=Inventory; item!=None; item=Inventory)
{
DeleteInventory(item);
carc.AddInventory(item);
}
}

return carc;

SpawnEMPSparks (Actor empActor, Rotator rot)


local ParticleGenerator sparkGen;


if ((empActor == None) || empActor.bDeleteMe)
return;

sparkGen = Spawn(class'ParticleGenerator', empActor,, empActor.Location, rot);
if (sparkGen != None)
{
sparkGen.SetBase(empActor);
sparkGen.LifeSpan = 3;
sparkGen.particleTexture = Texture'Effects.Fire.SparkFX1';
sparkGen.particleDrawScale = 0.1;
sparkGen.bRandomEject = True;
sparkGen.ejectSpeed = 100.0;
sparkGen.bGravity = True;
sparkGen.bParticlesUnlit = True;
sparkGen.frequency = 1.0;
sparkGen.riseRate = 10;
sparkGen.spawnSound = Sound'Spark2';
}

SpawnMass (Name ClassName, optional int TotalCount)


local actor spawnee;
local vector spawnPos;
local vector center;
local rotator direction;
local int maxTries;
local int count;
local int numTries;
local float maxRange;
local float range;
local float angle;
local class spawnClass;
local string holdName;


if (!bCheatsEnabled)
return;

if (!bAdmin && (Level.Netmode != NM_Standalone))
return;

if (instr(ClassName, ".") == -1)
holdName = "DeusEx." $ ClassName;
else
holdName = "" $ ClassName; // barf

spawnClass = class(DynamicLoadObject(holdName, class'Class'));
if (spawnClass == None)
{
ClientMessage("Illegal actor name "$GetItemName(String(ClassName)));
return;
}

if (totalCount <= 0)
totalCount = 10;
if (totalCount > 250)
totalCount = 250;
maxTries = totalCount*2;
count = 0;
numTries = 0;
maxRange = sqrt(totalCount/3.1416)*4*SpawnClass.Default.CollisionRadius;

direction = ViewRotation;
direction.pitch = 0;
direction.roll = 0;
center = Location + Vector(direction)*(maxRange+SpawnClass.Default.CollisionRadius+CollisionRadius+20);
while ((count < totalCount) && (numTries < maxTries))
{
angle = FRand()*3.14159265359*2;
range = sqrt(FRand())*maxRange;
spawnPos.X = sin(angle)*range;
spawnPos.Y = cos(angle)*range;
spawnPos.Z = 0;
spawnee = spawn(SpawnClass,,,center+spawnPos, Rotation);
if (spawnee != None)
count++;
numTries++;
}

ClientMessage(count$" actor(s) spawned");


StartListenGame (string options)


local DeusExRootWindow root;


root = DeusExRootWindow(rootWindow);

if (root != None)
root.ClearWindowStack();

ConsoleCommand("start "$options$"?listen");

StartMultiplayerGame (string command)


local DeusExRootWindow root;


root = DeusExRootWindow(rootWindow);

if (root != None)
root.ClearWindowStack();

ConsoleCommand(command);

StartNewGame (String startMap)


if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).ClearWindowStack();

// Set a flag designating that we're traveling,
// so MissionScript can check and not call FirstFrame() for this map.
flagBase.SetBool('PlayerTraveling', True, True, 0);

SaveSkillPoints();
ResetPlayer();
DeleteSaveGameFiles();

bStartingNewGame = True;

// Send the player to the specified map!
if (startMap == "")
Level.Game.SendPlayer(Self, "01_NYC_UNATCOIsland"); // TODO: Must be stored somewhere!
else
Level.Game.SendPlayer(Self, startMap);

StartPoison (Pawn poisoner, int Damage)


local float augLevel;


if ( Level.NetMode != NM_Standalone )
{
// Don't do poison and drug effects if in multiplayer and AugEnviro is on
augLevel = AugmentationSystem.GetAugLevelValue(class'AugEnviro');
if ( augLevel != -1.0 )
return;
}

myPoisoner = poisoner;

if (Health <= 0) // no more pain -- you're already dead!
return;

if (InConversation()) // kinda hacky...
return;

poisonCounter = 4; // take damage no more than four times (over 8 seconds)
poisonTimer = 0; // reset pain timer
if (poisonDamage < Damage) // set damage amount
poisonDamage = Damage;

drugEffectTimer += 4; // make the player vomit for the next four seconds

// In multiplayer, don't let the effect last longer than 30 seconds
if ( Level.NetMode != NM_Standalone )
{
if ( drugEffectTimer > 30 )
drugEffectTimer = 30;
}

StartTrainingMission


if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).ClearWindowStack();

// Make sure the player isn't asked to do this more than
// once if prompted on the main menu.
if (!bAskedToTrain)
{
bAskedToTrain = True;
SaveConfig();
}

SkillSystem.ResetSkills();
ResetPlayer(True);
DeleteSaveGameFiles();
bStartingNewGame = True;
Level.Game.SendPlayer(Self, "00_Training");

StopPoison


myPoisoner = None;
poisonCounter = 0;
poisonTimer = 0;
poisonDamage = 0;

Summon (string ClassName)


if (!bCheatsEnabled)
return;

if(!bAdmin && (Level.Netmode != NM_Standalone))
return;
if(instr(ClassName, ".") == -1)
ClassName = "DeusEx." $ ClassName;
Super.Summon(ClassName);

SupportActor (Actor standingActor)


local vector newVelocity;
local float angle;
local float zVelocity;
local float baseMass;
local float standingMass;
local vector damagePoint;
local float damage;


zVelocity = standingActor.Velocity.Z;
standingMass = FMax(1, standingActor.Mass);
baseMass = FMax(1, Mass);
damagePoint = Location + vect(0,0,1)*(CollisionHeight-1);
damage = (1 - (standingMass/baseMass) * (zVelocity/100));

// Have we been stomped?
if ((zVelocity*standingMass < -7500) && (damage > 0))
TakeDamage(damage, standingActor.Instigator, damagePoint, 0.2*standingActor.Velocity, 'stomped');

// Bounce the actor off the player
angle = FRand()*Pi*2;
newVelocity.X = cos(angle);
newVelocity.Y = sin(angle);
newVelocity.Z = 0;
newVelocity *= FRand()*25 + 25;
newVelocity += standingActor.Velocity;
newVelocity.Z = 50;
standingActor.Velocity = newVelocity;
standingActor.SetPhysics(PHYS_Falling);

SwitchAmmo


if (inHand.IsA('DeusExWeapon'))
DeusExWeapon(inHand).CycleAmmo();

TakeDamage (int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)


local int actualDamage;
local bool bAlreadyDead, bPlayAnim, bDamageGotReduced;
local Vector offset, dst;
local float headOffsetZ, headOffsetY, armOffset;
local float origHealth, fdst;
local DeusExLevelInfo info;
local DeusExWeapon dxw;
local String bodyString;
local int MPHitLoc;


if ( bNintendoImmunity )
return;

bodyString = "";
origHealth = Health;

if (Level.NetMode != NM_Standalone)
Damage *= MPDamageMult;

// use the hitlocation to determine where the pawn is hit
// transform the worldspace hitlocation into objectspace
// in objectspace, remember X is front to back
// Y is side to side, and Z is top to bottom
offset = (hitLocation - Location) << Rotation;

// add a HUD icon for this damage type
if ((damageType == 'Poison') || (damageType == 'PoisonEffect')) // hack
AddDamageDisplay('PoisonGas', offset);
else
AddDamageDisplay(damageType, offset);

// nanovirus damage doesn't affect us
if (damageType == 'NanoVirus')
return;

// handle poison
if ((damageType == 'Poison') || ((Level.NetMode != NM_Standalone) && (damageType=='TearGas')) )
{
// Notify player if they're getting burned for the first time
if ( Level.NetMode != NM_Standalone )
ServerConditionalNotifyMsg( MPMSG_FirstPoison );

StartPoison( instigatedBy, Damage );
}

// reduce our damage correctly
if (ReducedDamageType == damageType)
actualDamage = float(actualDamage) * (1.0 - ReducedDamagePct);

// check for augs or inventory items
bDamageGotReduced = DXReduceDamage(Damage, damageType, hitLocation, actualDamage, False);

// DEUS_EX AMSD Multiplayer shield
if (Level.NetMode != NM_Standalone)
if (bDamageGotReduced)
{
ShieldStatus = SS_Strong;
ShieldTimer = 1.0;
}

if (ReducedDamageType == 'All') //God mode
actualDamage = 0;

// Multiplayer only code
if ( Level.NetMode != NM_Standalone )
{
if ( ( instigatedBy != None ) && (instigatedBy.IsA('DeusExPlayer')) )
{
// Special case the sniper rifle
if ((DeusExPlayer(instigatedBy).Weapon != None) && ( DeusExPlayer(instigatedBy).Weapon.class == class'WeaponRifle' ))
{
dxw = DeusExWeapon(DeusExPlayer(instigatedBy).Weapon);
if ( (dxw != None ) && ( !dxw.bZoomed ))
actualDamage *= WeaponRifle(dxw).mpNoScopeMult; // Reduce damage if we're not using the scope
}
if ( (TeamDMGame(DXGame) != None) && (TeamDMGame(DXGame).ArePlayersAllied(DeusExPlayer(instigatedBy),Self)) )
{
// Don't notify if the player hurts themselves
if ( DeusExPlayer(instigatedBy) != Self )
{
actualDamage *= TeamDMGame(DXGame).fFriendlyFireMult;
if (( damageType != 'TearGas' ) && ( damageType != 'PoisonEffect' ))
DeusExPlayer(instigatedBy).MultiplayerNotifyMsg( MPMSG_TeamHit );
}
}

}
}

// EMP attacks drain BE energy
if (damageType == 'EMP')
{
EnergyDrain += actualDamage;
EnergyDrainTotal += actualDamage;
PlayTakeHitSound(actualDamage, damageType, 1);
return;
}

bPlayAnim = True;

// if we're burning, don't play a hit anim when taking burning damage
if (damageType == 'Burned')
bPlayAnim = False;

if (Physics == PHYS_None)
SetMovementPhysics();
if (Physics == PHYS_Walking)
momentum.Z = 0.4 * VSize(momentum);
if ( instigatedBy == self )
momentum *= 0.6;
momentum = momentum/Mass;
// AddVelocity( momentum ); // doesn't do anything anyway

// calculate our hit extents
headOffsetZ = CollisionHeight * 0.78;
headOffsetY = CollisionRadius * 0.35;
armOffset = CollisionRadius * 0.35;

// We decided to just have 3 hit locations in multiplayer MBCODE
if (( Level.NetMode == NM_DedicatedServer ) || ( Level.NetMode == NM_ListenServer ))
{
MPHitLoc = GetMPHitLocation(HitLocation);

if (MPHitLoc == 0)
return;
else if (MPHitLoc == 1 )
{
// MP Headshot is 2x damage
// narrow the head region
actualDamage *= 2;
HealthHead -= actualDamage;
bodyString = HeadString;
if (bPlayAnim)
PlayAnim('HitHead', , 0.1);
}
else if ((MPHitLoc == 3) || (MPHitLoc == 4)) // Leg region
{
HealthLegRight -= actualDamage;
HealthLegLeft -= actualDamage;

if (MPHitLoc == 4)
{
if (bPlayAnim)
PlayAnim('HitLegRight', , 0.1);
}
else if (MPHitLoc == 3)
{
if (bPlayAnim)
PlayAnim('HitLegLeft', , 0.1);
}
// Since the legs are in sync only bleed up damage from one leg (otherwise it's double damage)
if (HealthLegLeft < 0)
{
HealthArmRight += HealthLegLeft;
HealthTorso += HealthLegLeft;
HealthArmLeft += HealthLegLeft;
bodyString = TorsoString;
HealthLegLeft = 0;
HealthLegRight = 0;
}
}
else // arms and torso now one region
{
HealthArmLeft -= actualDamage;
HealthTorso -= actualDamage;
HealthArmRight -= actualDamage;

bodyString = TorsoString;

if (MPHitLoc == 6)
{
if (bPlayAnim)
PlayAnim('HitArmRight', , 0.1);
}
else if (MPHitLoc == 5)
{
if (bPlayAnim)
PlayAnim('HitArmLeft', , 0.1);
}
else
{
if (bPlayAnim)
PlayAnim('HitTorso', , 0.1);
}
}
}
else // Normal damage code path for single player
{
if (offset.z > headOffsetZ) // head
{
// narrow the head region
if ((Abs(offset.x) < headOffsetY) || (Abs(offset.y) < headOffsetY))
{
HealthHead -= actualDamage * 2;
if (bPlayAnim)
PlayAnim('HitHead', , 0.1);
}
}
else if (offset.z < 0.0) // legs
{
if (offset.y > 0.0)
{
HealthLegRight -= actualDamage;
if (bPlayAnim)
PlayAnim('HitLegRight', , 0.1);
}
else
{
HealthLegLeft -= actualDamage;
if (bPlayAnim)
PlayAnim('HitLegLeft', , 0.1);
}

// if this part is already dead, damage the adjacent part
if ((HealthLegRight < 0) && (HealthLegLeft > 0))
{
HealthLegLeft += HealthLegRight;
HealthLegRight = 0;
}
else if ((HealthLegLeft < 0) && (HealthLegRight > 0))
{
HealthLegRight += HealthLegLeft;
HealthLegLeft = 0;
}

if (HealthLegLeft < 0)
{
HealthTorso += HealthLegLeft;
HealthLegLeft = 0;
}
if (HealthLegRight < 0)
{
HealthTorso += HealthLegRight;
HealthLegRight = 0;
}
}
else // arms and torso
{
if (offset.y > armOffset)
{
HealthArmRight -= actualDamage;
if (bPlayAnim)
PlayAnim('HitArmRight', , 0.1);
}
else if (offset.y < -armOffset)
{
HealthArmLeft -= actualDamage;
if (bPlayAnim)
PlayAnim('HitArmLeft', , 0.1);
}
else
{
HealthTorso -= actualDamage * 2;
if (bPlayAnim)
PlayAnim('HitTorso', , 0.1);
}

// if this part is already dead, damage the adjacent part
if (HealthArmLeft < 0)
{
HealthTorso += HealthArmLeft;
HealthArmLeft = 0;
}
if (HealthArmRight < 0)
{
HealthTorso += HealthArmRight;
HealthArmRight = 0;
}
}
}

// check for a back hit and play the correct anim
if ((offset.x < 0.0) && bPlayAnim)
{
if (offset.z > headOffsetZ) // head from the back
{
// narrow the head region
if ((Abs(offset.x) < headOffsetY) || (Abs(offset.y) < headOffsetY))
PlayAnim('HitHeadBack', , 0.1);
}
else
PlayAnim('HitTorsoBack', , 0.1);
}

// check for a water hit
if (Region.Zone.bWaterZone)
{
if ((offset.x < 0.0) && bPlayAnim)
PlayAnim('WaterHitTorsoBack',,0.1);
else
PlayAnim('WaterHitTorso',,0.1);
}

GenerateTotalHealth();

if ((damageType != 'Stunned') && (damageType != 'TearGas') && (damageType != 'HalonGas') &&
(damageType != 'PoisonGas') && (damageType != 'Radiation') && (damageType != 'EMP') &&
(damageType != 'NanoVirus') && (damageType != 'Drowned') && (damageType != 'KnockedOut'))
bleedRate += (origHealth-Health)/30.0; // 30 points of damage = bleed profusely

if (CarriedDecoration != None)
DropDecoration();

// don't let the player die in the training mission
info = GetLevelInfo();
if ((info != None) && (info.MissionNumber == 0))
{
if (Health <= 0)
{
HealthTorso = FMax(HealthTorso, 10);
HealthHead = FMax(HealthHead, 10);
GenerateTotalHealth();
}
}

if (Health > 0)
{
if ((Level.NetMode != NM_Standalone) && (HealthLegLeft==0) && (HealthLegRight==0))
ServerConditionalNotifyMsg( MPMSG_LostLegs );

if (instigatedBy != None)
damageAttitudeTo(instigatedBy);
PlayDXTakeDamageHit(actualDamage, hitLocation, damageType, momentum, bDamageGotReduced);
AISendEvent('Distress', EAITYPE_Visual);
}
else
{
NextState = '';
PlayDeathHit(actualDamage, hitLocation, damageType, momentum);
if ( Level.NetMode != NM_Standalone )
CreateKillerProfile( instigatedBy, actualDamage, damageType, bodyString );
if ( actualDamage > mass )
Health = -1 * actualDamage;
Enemy = instigatedBy;
Died(instigatedBy, damageType, HitLocation);
return;
}
MakeNoise(1.0);

if ((DamageType == 'Flamed') && !bOnFire)
{
// Notify player if they're getting burned for the first time
if ( Level.NetMode != NM_Standalone )
ServerConditionalNotifyMsg( MPMSG_FirstBurn );

CatchFire( instigatedBy );
}
myProjKiller = None;

Tantalus


local Actor hitActor;
local Vector hitLocation, hitNormal;
local Vector position, line;
local ScriptedPawn hitPawn;
local DeusExMover hitMover;
local DeusExDecoration hitDecoration;
local bool bTakeDamage;
local int damage;


if (!bCheatsEnabled)
return;

bTakeDamage = false;
damage = 1;
position = Location;
position.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 4000;

hitActor = Trace(hitLocation, hitNormal, position+line, position, true);
if (hitActor != None)
{
hitMover = DeusExMover(hitActor);
hitPawn = ScriptedPawn(hitActor);
hitDecoration = DeusExDecoration(hitActor);
if (hitMover != None)
{
if (hitMover.bBreakable)
{
hitMover.doorStrength = 0;
bTakeDamage = true;
}
}
else if (hitPawn != None)
{
if (!hitPawn.bInvincible)
{
hitPawn.HealthHead = 0;
hitPawn.HealthTorso = 0;
hitPawn.HealthLegLeft = 0;
hitPawn.HealthLegRight = 0;
hitPawn.HealthArmLeft = 0;
hitPawn.HealthArmRight = 0;
hitPawn.Health = 0;
bTakeDamage = true;
}
}
else if (hitDecoration != None)
{
if (!hitDecoration.bInvincible)
{
hitDecoration.HitPoints = 0;
bTakeDamage = true;
}
}
else if (hitActor != Level)
{
damage = 5000;
bTakeDamage = true;
}
}

if (bTakeDamage)
hitActor.TakeDamage(damage, self, hitLocation, line, 'Tantalus');

TeamSay (string Msg)


local Pawn P;
local String str;


if ( TeamDMGame(DXGame) == None )
{
Say(Msg);
return;
}

str = PlayerReplicationInfo.PlayerName $ ": " $ Msg;

if ( Role == ROLE_Authority )
log( "TeamSay>" $ str );

for( P=Level.PawnList; P!=None; P=P.nextPawn )
{
if( P.bIsPlayer && (P.PlayerReplicationInfo.Team == PlayerReplicationInfo.Team) )
{
if ( P.IsA('DeusExPlayer') )
DeusExPlayer(P).ClientMessage( str, 'TeamSay', true );
}
}

Timer


local int damage;


if (!InConversation() && bOnFire)
{
if ( Level.NetMode != NM_Standalone )
damage = Class'WeaponFlamethrower'.Default.mpBurnDamage;
else
damage = Class'WeaponFlamethrower'.Default.BurnDamage;
TakeDamage(damage, myBurner, Location, vect(0,0,0), 'Burned');

if (HealthTorso <= 0)
{
TakeDamage(10, myBurner, Location, vect(0,0,0), 'Burned');
ExtinguishFire();
}
}

ToggleAmmoDisplay


local DeusExRootWindow root;


bAmmoDisplayVisible = !bAmmoDisplayVisible;

root = DeusExRootWindow(rootWindow);
if (root != None)
root.UpdateHud();

ToggleAugDisplay


local DeusExRootWindow root;


bAugDisplayVisible = !bAugDisplayVisible;

root = DeusExRootWindow(rootWindow);
if (root != None)
root.UpdateHud();

ToggleCameraState (SecurityCamera cam, ElectronicDevices compOwner)


if (cam.bActive)
{
cam.UnTrigger(compOwner, self);
cam.team = -1;
}
else
{
MakeCameraAlly(cam);
cam.Trigger(compOwner, self);
}

// Make sure the camera isn't in bStasis=True
// so it responds to our every whim.
cam.bStasis = False;

ToggleCompass


local DeusExRootWindow root;


bCompassVisible = !bCompassVisible;

root = DeusExRootWindow(rootWindow);
if (root != None)
root.UpdateHud();

ToggleCrosshair


local DeusExRootWindow root;


bCrosshairVisible = !bCrosshairVisible;

root = DeusExRootWindow(rootWindow);
if (root != None)
root.UpdateHud();

ToggleHitDisplay


local DeusExRootWindow root;


bHitDisplayVisible = !bHitDisplayVisible;

root = DeusExRootWindow(rootWindow);
if (root != None)
root.UpdateHud();

ToggleLaser


local DeusExWeapon W;


if (RestrictInput())
return;

W = DeusExWeapon(Weapon);
if (W != None)
W.LaserToggle();

ToggleObjectBelt


local DeusExRootWindow root;


bObjectBeltVisible = !bObjectBeltVisible;

root = DeusExRootWindow(rootWindow);
if (root != None)
root.UpdateHud();

ToggleScope


local DeusExWeapon W;


if (RestrictInput())
return;

W = DeusExWeapon(Weapon);
if (W != None)
W.ScopeToggle();

ToggleWalk


if (RestrictInput())
return;

bToggleWalk = !bToggleWalk;

ToggleWinFrames


if (!bCheatsEnabled)
return;

if (rootWindow != None)
rootWindow.ShowFrames(!rootWindow.bShowFrames);

ToggleWinStats


if (!bCheatsEnabled)
return;

if (rootWindow != None)
rootWindow.ShowStats(!rootWindow.bShowStats);

TravelPostAccept


local DeusExLevelInfo info;
local MissionScript scr;
local bool bScriptRunning;
local InterpolationPoint I;


Super.TravelPostAccept();

// reset the keyboard
ResetKeyboard();

info = GetLevelInfo();

if (info != None)
{
// hack for the DX.dx logo/splash level
if (info.MissionNumber == -2)
{
foreach AllActors(class 'InterpolationPoint', I, 'IntroCam')
{
if (I.Position == 1)
{
SetCollision(False, False, False);
bCollideWorld = False;
Target = I;
SetPhysics(PHYS_Interpolating);
PhysRate = 1.0;
PhysAlpha = 0.0;
bInterpolating = True;
bStasis = False;
ShowHud(False);
PutInHand(None);
GotoState('Interpolating');
break;
}
}
return;
}

// hack for the DXOnly.dx splash level
if (info.MissionNumber == -1)
{
ShowHud(False);
GotoState('Paralyzed');
return;
}
}

// Restore colors
if (ThemeManager != None)
{
ThemeManager.SetMenuThemeByName(MenuThemeName);
ThemeManager.SetHUDThemeByName(HUDThemeName);
}

// Make sure any charged pickups that were active
// before travelling are still active.
RefreshChargedPickups();

// Make sure the Skills and Augmentation systems
// are properly initialized and reset.

RestoreSkillPoints();

if (SkillSystem != None)
{
SkillSystem.SetPlayer(Self);
}

if (AugmentationSystem != None)
{
// set the player correctly
AugmentationSystem.SetPlayer(Self);
AugmentationSystem.RefreshAugDisplay();
}

// Nuke any existing conversation
if (conPlay != None)
conPlay.TerminateConversation();

// Make sure any objects that care abou the PlayerSkin
// are notified
UpdatePlayerSkin();

// If the player was carrying a decoration,
// call TravelPostAccept() so it can initialize itself
if (CarriedDecoration != None)
CarriedDecoration.TravelPostAccept();

// If the player was carrying a decoration, make sure
// it's placed back in his hand (since the location
// info won't properly travel)
PutCarriedDecorationInHand();

// Reset FOV
SetFOVAngle(Default.DesiredFOV);

// If the player had a scope view up, make sure it's
// properly restore
RestoreScopeView();

// make sure the mission script has been spawned correctly
if (info != None)
{
bScriptRunning = False;
foreach AllActors(class'MissionScript', scr)
bScriptRunning = True;

if (!bScriptRunning)
info.SpawnScript();
}

// make sure the player's eye height is correct
BaseEyeHeight = CollisionHeight - (GetDefaultCollisionHeight() - Default.BaseEyeHeight);

Trig (name ev)


local Actor A;


if (!bCheatsEnabled)
return;

if (ev != '')
foreach AllActors(class'Actor', A, ev)
A.Trigger(Self, Self);

UnTrig (name ev)


local Actor A;


if (!bCheatsEnabled)
return;

if (ev != '')
foreach AllActors(class'Actor', A, ev)
A.UnTrigger(Self, Self);

UnloadTexture (Texture texture) | native

UpdateAmmoBeltText (Ammo ammo)


local Inventory inv;


inv = Inventory;
while(inv != None)
{
if ((inv.IsA('DeusExWeapon')) && (DeusExWeapon(inv).AmmoType == ammo))
UpdateBeltText(inv);

inv = inv.Inventory;
}

UpdateAugmentationDisplayStatus (Augmentation aug)


DeusExRootWindow(rootWindow).hud.activeItems.UpdateAugIconStatus(aug);

UpdateBeltText (Inventory item)


local DeusExRootWindow root;


root = DeusExRootWindow(rootWindow);

// Update object belt text
if ((item.bInObjectBelt) && (root != None))
root.hud.belt.UpdateObjectText(item.beltPos);

UpdateCameraRotation (SecurityCamera camera, Rotator rot)


camera.DesiredRotation = rot;

UpdateCarcassEvent


if ((inHand != None) && (inHand.IsA('POVCorpse')))
AIStartEvent('Carcass', EAITYPE_Visual);
else
AIEndEvent('Carcass', EAITYPE_Visual);

UpdateDynamicMusic (float deltaTime)


local bool bCombat;
local ScriptedPawn npc;
local Pawn CurPawn;
local DeusExLevelInfo info;


if (Level.Song == None)
return;

// DEUS_EX AMSD In singleplayer, do the old thing.
// In multiplayer, we can come out of dying.
if (!PlayerIsClient())
{
if ((musicMode == MUS_Dying) || (musicMode == MUS_Outro))
return;
}
else
{
if (musicMode == MUS_Outro)
return;
}


musicCheckTimer += deltaTime;
musicChangeTimer += deltaTime;

if (IsInState('Interpolating'))
{
// don't mess with the music on any of the intro maps
info = GetLevelInfo();
if ((info != None) && (info.MissionNumber < 0))
{
musicMode = MUS_Outro;
return;
}

if (musicMode != MUS_Outro)
{
ClientSetMusic(Level.Song, 5, 255, MTRAN_FastFade);
musicMode = MUS_Outro;
}
}
else if (IsInState('Conversation'))
{
if (musicMode != MUS_Conversation)
{
// save our place in the ambient track
if (musicMode == MUS_Ambient)
savedSection = SongSection;
else
savedSection = 255;

ClientSetMusic(Level.Song, 4, 255, MTRAN_Fade);
musicMode = MUS_Conversation;
}
}
else if (IsInState('Dying'))
{
if (musicMode != MUS_Dying)
{
ClientSetMusic(Level.Song, 1, 255, MTRAN_Fade);
musicMode = MUS_Dying;
}
}
else
{
// only check for combat music every second
if (musicCheckTimer >= 1.0)
{
musicCheckTimer = 0.0;
bCombat = False;

// check a 100 foot radius around me for combat
// XXXDEUS_EX AMSD Slow Pawn Iterator
//foreach RadiusActors(class'ScriptedPawn', npc, 1600)
for (CurPawn = Level.PawnList; CurPawn != None; CurPawn = CurPawn.NextPawn)
{
npc = ScriptedPawn(CurPawn);
if ((npc != None) && (VSize(npc.Location - Location) < (1600 + npc.CollisionRadius)))
{
if ((npc.GetStateName() == 'Attacking') && (npc.Enemy == Self))
{
bCombat = True;
break;
}
}
}

if (bCombat)
{
musicChangeTimer = 0.0;

if (musicMode != MUS_Combat)
{
// save our place in the ambient track
if (musicMode == MUS_Ambient)
savedSection = SongSection;
else
savedSection = 255;

ClientSetMusic(Level.Song, 3, 255, MTRAN_FastFade);
musicMode = MUS_Combat;
}
}
else if (musicMode != MUS_Ambient)
{
// wait until we've been out of combat for 5 seconds before switching music
if (musicChangeTimer >= 5.0)
{
// use the default ambient section for this map
if (savedSection == 255)
savedSection = Level.SongSection;

// fade slower for combat transitions
if (musicMode == MUS_Combat)
ClientSetMusic(Level.Song, savedSection, 255, MTRAN_SlowFade);
else
ClientSetMusic(Level.Song, savedSection, 255, MTRAN_Fade);

savedSection = 255;
musicMode = MUS_Ambient;
musicChangeTimer = 0.0;
}
}
}
}

UpdateEyeHeight (float DeltaTime)


Super.UpdateEyeHeight(DeltaTime);

if (JoltMagnitude != 0)
{
if ((Physics == PHYS_Walking) && (Bob != 0))
EyeHeight += (JoltMagnitude * 5);
JoltMagnitude = 0;
}

UpdateInHand


local bool bSwitch;


//sync up clientinhandpending.
if (inHandPending != inHand)
ClientInHandPending = inHandPending;

//DEUS_EX AMSD Don't let clients do this.
if (Role < ROLE_Authority)
return;

if (inHand != inHandPending)
{
bInHandTransition = True;
bSwitch = False;
if (inHand != None)
{
// turn it off if it is on
if (inHand.bActive)
inHand.Activate();

if (inHand.IsA('SkilledTool'))
{
if (inHand.IsInState('Idle'))
{
SkilledTool(inHand).PutDown();
}
else if (inHand.IsInState('Idle2'))
{
bSwitch = True;
}
}
else if (inHand.IsA('DeusExWeapon'))
{
if (inHand.IsInState('Idle') || inHand.IsInState('Reload'))
DeusExWeapon(inHand).PutDown();
else if (inHand.IsInState('DownWeapon') && (Weapon == None))
bSwitch = True;
}
else
{
bSwitch = True;
}
}
else
{
bSwitch = True;
}

// OK to actually switch?
if (bSwitch)
{
SetInHand(inHandPending);
SelectedItem = inHandPending;

if (inHand != None)
{
if (inHand.IsA('SkilledTool'))
SkilledTool(inHand).BringUp();
else if (inHand.IsA('DeusExWeapon'))
SwitchWeapon(DeusExWeapon(inHand).InventoryGroup);
}
}
}
else
{
bInHandTransition = False;

// Added this code because it's now possible to reselect an in-hand
// item while we're putting it down, so we need to bring it back up...

if (inHand != None)
{
// if we put the item away, bring it back up
if (inHand.IsA('SkilledTool'))
{
if (inHand.IsInState('Idle2'))
SkilledTool(inHand).BringUp();
}
else if (inHand.IsA('DeusExWeapon'))
{
if (inHand.IsInState('DownWeapon') && (Weapon == None))
SwitchWeapon(DeusExWeapon(inHand).InventoryGroup);
}
}

}

UpdateCarcassEvent();

UpdatePlayerSkin


local PaulDenton paul;
local PaulDentonCarcass paulCarcass;
local JCDentonMaleCarcass jcCarcass;
local JCDouble jc;


// Paul Denton
foreach AllActors(class'PaulDenton', paul)
break;

if (paul != None)
paul.SetSkin(Self);

// Paul Denton Carcass
foreach AllActors(class'PaulDentonCarcass', paulCarcass)
break;

if (paulCarcass != None)
paulCarcass.SetSkin(Self);

// JC Denton Carcass
foreach AllActors(class'JCDentonMaleCarcass', jcCarcass)
break;

if (jcCarcass != None)
jcCarcass.SetSkin(Self);

// JC's stunt double
foreach AllActors(class'JCDouble', jc)
break;

if (jc != None)
jc.SetSkin(Self);

UpdatePoison (float deltaTime)


if (Health <= 0) // no more pain -- you're already dead!
return;

if (InConversation()) // kinda hacky...
return;

if (poisonCounter > 0)
{
poisonTimer += deltaTime;
if (poisonTimer >= 2.0) // pain every two seconds
{
poisonTimer = 0;
poisonCounter--;
TakeDamage(poisonDamage, myPoisoner, Location, vect(0,0,0), 'PoisonEffect');
}
if ((poisonCounter <= 0) || (Health <= 0))
StopPoison();
}

UpdateTimePlayed (float deltaTime)


saveTime += deltaTime;

UpdateTranslucency (float DeltaTime)


local float DarkVis;
local float CamoVis;
local AdaptiveArmor armor;
local bool bMakeTranslucent;
local DeusExMPGame Game;


// Don't do it in multiplayer.
if (Level.NetMode == NM_Standalone)
return;

Game = DeusExMPGame(Level.Game);
if (Game == None)
{
return;
}

bMakeTranslucent = false;

//DarkVis = AIVisibility(TRUE);
DarkVis = 1.0;

CamoVis = 1.0;

//Check cloaking.
if (AugmentationSystem.GetAugLevelValue(class'AugCloak') != -1.0)
{
bMakeTranslucent = TRUE;
CamoVis = Game.CloakEffect;
}

// If you have a weapon out, scale up the camo and turn off the cloak.
// Adaptive armor leaves you completely invisible, but drains quickly.
if ((inHand != None) && (inHand.IsA('DeusExWeapon')) && (CamoVis < 1.0))
{
CamoVis = 1.0;
bMakeTranslucent=FALSE;
ClientMessage(WeaponUnCloak);
AugmentationSystem.FindAugmentation(class'AugCloak').Deactivate();
}

// go through the actor list looking for owned AdaptiveArmor
// since they aren't in the inventory anymore after they are used
if (UsingChargedPickup(class'AdaptiveArmor'))
{
CamoVis = CamoVis * Game.CloakEffect;
bMakeTranslucent = TRUE;
}

ScaleGlow = Default.ScaleGlow * CamoVis * DarkVis;

//Translucent is < 0.1, untranslucent if > 0.2, not same edge to prevent sharp breaks.
if (bMakeTranslucent)
{
Style = STY_Translucent;
if (Self.IsA('JCDentonMale'))
{
MultiSkins[6] = Texture'BlackMaskTex';
MultiSkins[7] = Texture'BlackMaskTex';
}
}
else if (Game.bDarkHiding)
{
if (CamoVis * DarkVis < Game.StartHiding)
Style = STY_Translucent;
if (CamoVis * DarkVis > Game.EndHiding)
Style = Default.Style;
}
else if (!bMakeTranslucent)
{
if (Self.IsA('JCDentonMale'))
{
MultiSkins[6] = Default.MultiSkins[6];
MultiSkins[7] = Default.MultiSkins[7];
}
Style = Default.Style;
}

UpdateWarrenEMPField (float deltaTime)


local float empRadius;
local Robot curRobot;
local AlarmUnit curAlarm;
local AutoTurret curTurret;
local LaserTrigger curLaser;
local BeamTrigger curBeam;
local SecurityCamera curCamera;
local int option;


if (bWarrenEMPField)
{
WarrenTimer -= deltaTime;
if (WarrenTimer <= 0)
{
WarrenTimer = 0.15;

empRadius = 600;
if (WarrenSlot == 0)
{
foreach RadiusActors(Class'Robot', curRobot, empRadius)
{
if ((curRobot.LastRendered() < 2.0) && (curRobot.CrazedTimer <= 0) &&
(curRobot.EMPHitPoints > 0))
{
if (curRobot.GetPawnAllianceType(self) == ALLIANCE_Hostile)
option = Rand(2);
else
option = 0;
if (option == 0)
curRobot.TakeDamage(curRobot.EMPHitPoints*2, self, curRobot.Location, vect(0,0,0), 'EMP');
else
curRobot.TakeDamage(100, self, curRobot.Location, vect(0,0,0), 'NanoVirus');
SpawnEMPSparks(curRobot, Rotator(Location-curRobot.Location));
}
}
}
else if (WarrenSlot == 1)
{
foreach RadiusActors(Class'AlarmUnit', curAlarm, empRadius)
{
if ((curAlarm.LastRendered() < 2.0) && !curAlarm.bConfused)
{
curAlarm.TakeDamage(100, self, curAlarm.Location, vect(0,0,0), 'EMP');
SpawnEMPSparks(curAlarm, curAlarm.Rotation);
}
}
}
else if (WarrenSlot == 2)
{
foreach RadiusActors(Class'AutoTurret', curTurret, empRadius)
{
if ((curTurret.LastRendered() < 2.0) && !curTurret.bConfused)
{
curTurret.TakeDamage(100, self, curTurret.Location, vect(0,0,0), 'EMP');
SpawnEMPSparks(curTurret, Rotator(Location-curTurret.Location));
}
}
}
else if (WarrenSlot == 3)
{
foreach RadiusActors(Class'LaserTrigger', curLaser, empRadius)
{
if ((curLaser.LastRendered() < 2.0) && !curLaser.bConfused)
{
curLaser.TakeDamage(100, self, curLaser.Location, vect(0,0,0), 'EMP');
SpawnEMPSparks(curLaser, curLaser.Rotation);
}
}
}
else if (WarrenSlot == 4)
{
foreach RadiusActors(Class'BeamTrigger', curBeam, empRadius)
{
if ((curBeam.LastRendered() < 2.0) && !curBeam.bConfused)
{
curBeam.TakeDamage(100, self, curBeam.Location, vect(0,0,0), 'EMP');
SpawnEMPSparks(curBeam, curBeam.Rotation);
}
}
}
else if (WarrenSlot == 5)
{
foreach RadiusActors(Class'SecurityCamera', curCamera, empRadius)
{
if ((curCamera.LastRendered() < 2.0) && !curCamera.bConfused)
{
curCamera.TakeDamage(100, self, curCamera.Location, vect(0,0,0), 'EMP');
SpawnEMPSparks(curCamera, Rotator(Location-curCamera.Location));
}
}
}

WarrenSlot++;
if (WarrenSlot >= 6)
WarrenSlot = 0;
}
}

UsingChargedPickup (class itemclass) -> bool


local inventory CurrentItem;
local bool bFound;


bFound = false;

for (CurrentItem = Inventory; ((CurrentItem != None) && (!bFound)); CurrentItem = CurrentItem.inventory)
{
if ((CurrentItem.class == itemclass) && (CurrentItem.bActive))
bFound = true;
}

return bFound;

VMA (int num, string ClassName)


ViewModelAdd(num, ClassName);

VMBP (int num, name anim, optional float fps, optional int slot)


ViewModelBlendPlay(num, anim, fps, slot);

VMBS (int num)


ViewModelBlendStop(num);

VMD (int num)


ViewModelDestroy(num);

VMGW (int num, string weaponClass)


ViewModelGiveWeapon(num, weaponClass);

VML (int num, name anim, optional float fps)


ViewModelLoop(num, anim, fps);

VMP (int num, name anim, optional float fps)


ViewModelPlay(num, anim, fps);

VerifyConsole (Class ConsoleClass)


local bool bCheckPassed;


bCheckPassed = True;

if (Player.Console == None)
bCheckPassed = False;
else if (Player.Console.Class != ConsoleClass)
bCheckPassed = False;

if (bCheckPassed == False)
FailConsoleCheck();

VerifyRootWindow (Class WindowClass)


local bool bCheckPassed;


bCheckPassed = True;

if (RootWindow == None)
bCheckPassed = False;
else if (RootWindow.Class != WindowClass)
bCheckPassed = False;

if (bCheckPassed == False)
FailRootWindowCheck();

ViewFlash (float DeltaTime)


local float delta;
local vector goalFog;
local float goalscale, ReductionFactor;


ReductionFactor = 2;

if (FlashTimer > 0)
{
if (FlashTimer < Deltatime)
{
FlashTimer = 0;
}
else
{
ReductionFactor = 0;
FlashTimer -= Deltatime;
}
}

if ( bNoFlash )
{
InstantFlash = 0;
InstantFog = vect(0,0,0);
}

delta = FMin(0.1, DeltaTime);
goalScale = 1 + DesiredFlashScale + ConstantGlowScale + HeadRegion.Zone.ViewFlash.X;
goalFog = DesiredFlashFog + ConstantGlowFog + HeadRegion.Zone.ViewFog;
DesiredFlashScale -= DesiredFlashScale * ReductionFactor * delta;
DesiredFlashFog -= DesiredFlashFog * ReductionFactor * delta;
FlashScale.X += (goalScale - FlashScale.X + InstantFlash) * 10 * delta;
FlashFog += (goalFog - FlashFog + InstantFog) * 10 * delta;
InstantFlash = 0;
InstantFog = vect(0,0,0);

if ( FlashScale.X > 0.981 )
FlashScale.X = 1;
FlashScale = FlashScale.X * vect(1,1,1);

if ( FlashFog.X < 0.019 )
FlashFog.X = 0;
if ( FlashFog.Y < 0.019 )
FlashFog.Y = 0;
if ( FlashFog.Z < 0.019 )
FlashFog.Z = 0;

ViewModelAdd (int num, string ClassName)


local class ViewModelClass;
local rotator newrot;
local vector loc;


if (!bCheatsEnabled)
return;

if(instr(ClassName, ".") == -1)
ClassName = "DeusEx." $ ClassName;

if ((num >= 0) && (num <= 8))
{
if (num > 0)
num--;

if (ViewModelActor[num] == None)
{
ViewModelClass = class(DynamicLoadObject(ClassName, class'Class'));
if (ViewModelClass != None)
{
newrot = Rotation;
newrot.Roll = 0;
newrot.Pitch = 0;
loc = Location + (ViewModelClass.Default.CollisionRadius + CollisionRadius + 32) * Vector(newrot);
loc.Z += ViewModelClass.Default.CollisionHeight;
ViewModelActor[num] = Spawn(ViewModelClass,,, loc, newrot);
if (ViewModelActor[num] != None)
ViewModelActor[num].SetPhysics(PHYS_None);
if (ScriptedPawn(ViewModelActor[num]) != None)
ViewModelActor[num].GotoState('Paralyzed');
}
}
else
ClientMessage("There is already a ViewModel in that slot!");
}

ViewModelBlendPlay (int num, name anim, optional float fps, optional int slot)


local int i;


if (!bCheatsEnabled)
return;

if ((num >= 0) && (num <= 8))
{
if (num == 0)
{
for (i=0; i<8; i++)
if (ViewModelActor[i] != None)
{
if (fps == 0)
fps = 1.0;
ViewModelActor[i].PlayBlendAnim(anim, fps, , slot);
}
}
else
{
i = num - 1;
if (ViewModelActor[i] != None)
{
if (fps == 0)
fps = 1.0;
ViewModelActor[i].PlayBlendAnim(anim, fps, , slot);
}
}
}

ViewModelBlendStop (int num)


local int i;


if (!bCheatsEnabled)
return;

if ((num >= 0) && (num <= 8))
{
if (num == 0)
{
for (i=0; i<8; i++)
if (ViewModelActor[i] != None)
ViewModelActor[i].StopBlendAnims();
}
else
{
i = num - 1;
if (ViewModelActor[i] != None)
ViewModelActor[i].StopBlendAnims();
}
}

ViewModelDestroy (int num)


local int i;


if (!bCheatsEnabled)
return;

if ((num >= 0) && (num <= 8))
{
if (num == 0)
{
for (i=0; i<8; i++)
if (ViewModelActor[i] != None)
{
ViewModelActor[i].Destroy();
ViewModelActor[i] = None;
}
}
else
{
i = num - 1;
if (ViewModelActor[i] != None)
{
ViewModelActor[i].Destroy();
ViewModelActor[i] = None;
}
}
}

ViewModelGiveWeapon (int num, string weaponClass)


local class NewClass;
local Actor obj;
local int i;
local ScriptedPawn pawn;


if (!bCheatsEnabled)
return;

if (instr(weaponClass, ".") == -1)
weaponClass = "DeusEx." $ weaponClass;

if ((num >= 0) && (num <= 8))
{
NewClass = class(DynamicLoadObject(weaponClass, class'Class'));

if (NewClass != None)
{
obj = Spawn(NewClass,,, Location + (CollisionRadius+NewClass.Default.CollisionRadius+30) * Vector(Rotation) + vect(0,0,1) * 15);
if ((obj != None) && obj.IsA('DeusExWeapon'))
{
if (num == 0)
{
for (i=0; i<8; i++)
{
pawn = ScriptedPawn(ViewModelActor[i]);
if (pawn != None)
{
DeusExWeapon(obj).GiveTo(pawn);
obj.SetBase(pawn);
pawn.Weapon = DeusExWeapon(obj);
pawn.PendingWeapon = DeusExWeapon(obj);
}
}
}
else
{
i = num - 1;
pawn = ScriptedPawn(ViewModelActor[i]);
if (pawn != None)
{
DeusExWeapon(obj).GiveTo(pawn);
obj.SetBase(pawn);
pawn.Weapon = DeusExWeapon(obj);
pawn.PendingWeapon = DeusExWeapon(obj);
}
}
}
else
{
if (obj != None)
obj.Destroy();
}
}
}

ViewModelLoop (int num, name anim, optional float fps)


local int i;


if (!bCheatsEnabled)
return;

if ((num >= 0) && (num <= 8))
{
if (num == 0)
{
for (i=0; i<8; i++)
if (ViewModelActor[i] != None)
{
if (fps == 0)
fps = 1.0;
ViewModelActor[i].LoopAnim(anim, fps);
}
}
else
{
i = num - 1;
if (ViewModelActor[i] != None)
{
if (fps == 0)
fps = 1.0;
ViewModelActor[i].LoopAnim(anim, fps);
}
}
}

ViewModelPlay (int num, name anim, optional float fps)


local int i;


if (!bCheatsEnabled)
return;

if ((num >= 0) && (num <= 8))
{
if (num == 0)
{
for (i=0; i<8; i++)
if (ViewModelActor[i] != None)
{
if (fps == 0)
fps = 1.0;
ViewModelActor[i].PlayAnim(anim, fps);
}
}
else
{
i = num - 1;
if (ViewModelActor[i] != None)
{
if (fps == 0)
fps = 1.0;
ViewModelActor[i].PlayAnim(anim, fps);
}
}
}

Walk


if (RestrictInput())
return;

if (!bCheatsEnabled)
return;

Super.Walk();

WhereActor (optional int Me)


local Actor hitActor;
local Vector hitLocation, hitNormal;
local Vector position, line, newPos;


if (!bCheatsEnabled)
return;

if (Me==1)
hitActor=self;
else
{
position = Location;
position.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 4000;
hitActor = Trace(hitLocation, hitNormal, position+line, position, true);
}
if (hitActor != None)
{
Log( hitActor.Name $ " is at " $ hitActor.Location );
BroadcastMessage( hitActor.Name $ " is at " $ hitActor.Location );
}

WinFrames (bool bFramesOn)


if (!bCheatsEnabled)
return;

if (rootWindow != None)
rootWindow.ShowFrames(bFramesOn);

WinStats (bool bStatsOn)


if (rootWindow != None)
rootWindow.ShowStats(bStatsOn);

ZoneChange (ZoneInfo NewZone)


// if we jump into water, empty our hands
if (NewZone.bWaterZone)
{
DropDecoration();
if (bOnFire)
ExtinguishFire();
}

Super.ZoneChange(NewZone);




DeusExProjectile.uc (extends Projectile)

var bool bExplodes; // does this projectile explode?
var bool bBlood; // does this projectile cause blood?
var bool bDebris; // does this projectile cause debris?
var bool bStickToWall; // does this projectile stick to walls?
var bool bStuck; // is this projectile stuck to the wall?
var vector initDir; // initial direction of travel
var float blastRadius; // radius to explode
var Actor damagee; // who is being damaged
var name damageType; // type of damage that this projectile does
var int AccurateRange; // maximum accurate range in world units (feet * 16)
var int MaxRange; // maximum range in world units (feet * 16)
var vector initLoc; // initial location for range tracking
var bool bTracking; // should this projectile track a target?
var Actor Target; // what target we are tracking
var float time; // misc. timer
var float MinDrawScale;
var float MaxDrawScale;
var vector LastSeenLoc; // Last known location of target
var vector NetworkTargetLoc; // For network propagation (non relevant targets)
var bool bHasNetworkTarget;
var bool bHadLocalTarget;
var int gradualHurtSteps; // how many separate explosions for the staggered HurtRadius
var int gradualHurtCounter; // which one are we currently doing
var bool bEmitDanger;
var class spawnWeaponClass; // weapon to give the player if this projectile is disarmed and frobbed
var class spawnAmmoClass; // weapon to give the player if this projectile is disarmed and frobbed
var bool bIgnoresNanoDefense; //True if the aggressive defense aug does not blow this up.
var bool bAggressiveExploded; //True if exploded by Aggressive Defense
var localized string itemName; // human readable name
var localized string itemArticle; // article much like those for weapons
AccurateRange=800
maxRange=1600
MinDrawScale=0.050000
maxDrawScale=2.500000
bEmitDanger=True
ItemName="DEFAULT PROJECTILE NAME - REPORT THIS AS A BUG"
ItemArticle="Error"
RemoteRole=ROLE_SimulatedProxy
LifeSpan=60.000000
RotationRate=(Pitch=65536,Yaw=65536)

AcquireMPTargetLocation -> vector


local vector StartTrace, EndTrace, HitLocation, HitNormal;
local Actor hit, retval;


if (Target == None)
{
if (bHasNetworkTarget)
return NetworkTargetLoc;
else
return LastSeenLoc;
}

StartTrace = Location;
EndTrace = Target.Location;

if (!Target.IsA('Pawn'))
return Target.Location;

foreach TraceActors(class'Actor', hit, HitLocation, HitNormal, EndTrace, StartTrace)
{
if (hit == Target)
return Target.Location;
}

// adjust for eye height
EndTrace.Z += Pawn(Target).BaseEyeHeight;

foreach TraceActors(class'Actor', hit, HitLocation, HitNormal, EndTrace, StartTrace)
{
if (hit == Target)
return EndTrace;
}

return LastSeenLoc;

BeginState


local DeusExWeapon W;


initLoc = Location;
initDir = vector(Rotation);
Velocity = speed*initDir;
PlaySound(SpawnSound, SLOT_None);

DamageRing


local Pawn apawn;
local float damageRadius;
local Vector dist;


if ( Level.NetMode != NM_Standalone )
{
damageRadius = (blastRadius / gradualHurtSteps) * gradualHurtCounter;

for ( apawn = Level.PawnList; apawn != None; apawn = apawn.nextPawn )
{
if ( apawn.IsA('DeusExPlayer') )
{
dist = apawn.Location - Location;
if ( VSize(dist) < damageRadius )
{
if ( gradualHurtCounter <= 2 )
{
if ( apawn.FastTrace( apawn.Location, Location ))
DeusExPlayer(apawn).myProjKiller = Self;
}
else
DeusExPlayer(apawn).myProjKiller = Self;
}
}
}
}
//DEUS_EX AMSD Ignore Line of Sight on the lowest radius check, only in multiplayer
HurtRadius
(
(2 * Damage) / gradualHurtSteps,
(blastRadius / gradualHurtSteps) * gradualHurtCounter,
damageType,
MomentumTransfer / gradualHurtSteps,
Location,
((gradualHurtCounter <= 2) && (Level.NetMode != NM_Standalone))
);

DrawExplosionEffects (vector HitLocation, vector HitNormal)


local ShockRing ring;
local SphereEffect sphere;
local ExplosionLight light;
local AnimatedSprite expeffect;


// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, HitLocation);
if (light != None)
light.RemoteRole = ROLE_None;

if (blastRadius < 128)
{
expeffect = Spawn(class'ExplosionSmall',,, HitLocation);
light.size = 2;
}
else if (blastRadius < 256)
{
expeffect = Spawn(class'ExplosionMedium',,, HitLocation);
light.size = 4;
}
else
{
expeffect = Spawn(class'ExplosionLarge',,, HitLocation);
light.size = 8;
}

if (expeffect != None)
expeffect.RemoteRole = ROLE_None;

// draw a pretty shock ring
// For nano defense we are doing something else.
if ((!bAggressiveExploded) || (Level.NetMode == NM_Standalone))
{
ring = Spawn(class'ShockRing',,, HitLocation, rot(16384,0,0));
if (ring != None)
{
ring.RemoteRole = ROLE_None;
ring.size = blastRadius / 32.0;
}
ring = Spawn(class'ShockRing',,, HitLocation, rot(0,0,0));
if (ring != None)
{
ring.RemoteRole = ROLE_None;
ring.size = blastRadius / 32.0;
}
ring = Spawn(class'ShockRing',,, HitLocation, rot(0,16384,0));
if (ring != None)
{
ring.RemoteRole = ROLE_None;
ring.size = blastRadius / 32.0;
}
}
else
{
sphere = Spawn(class'SphereEffect',,, HitLocation, rot(16384,0,0));
if (sphere != None)
{
sphere.RemoteRole = ROLE_None;
sphere.size = blastRadius / 32.0;
}
sphere = Spawn(class'SphereEffect',,, HitLocation, rot(0,0,0));
if (sphere != None)
{
sphere.RemoteRole = ROLE_None;
sphere.size = blastRadius / 32.0;
}
sphere = Spawn(class'SphereEffect',,, HitLocation, rot(0,16384,0));
if (sphere != None)
{
sphere.RemoteRole = ROLE_None;
sphere.size = blastRadius / 32.0;
}
}

Explode (vector HitLocation, vector HitNormal)


local bool bDestroy;
local float rad;


// Reduce damage on nano exploded projectiles
if ((bAggressiveExploded) && (Level.NetMode != NM_Standalone))
Damage = Damage/6;

bDestroy = false;

if (bExplodes)
{
//DEUS_EX AMSD Don't draw effects on dedicated server
if ((Level.NetMode != NM_DedicatedServer) || (Role < ROLE_Authority))
DrawExplosionEffects(HitLocation, HitNormal);

GotoState('Exploding');
}
else
{
// Server side only
if ( Role == ROLE_Authority )
{
if ((damagee != None) && (Tracer(Self) == None)) // Don't even attempt damage with a tracer
{
if ( Level.NetMode != NM_Standalone )
{
if ( damagee.IsA('DeusExPlayer') )
DeusExPlayer(damagee).myProjKiller = Self;
}
damagee.TakeDamage(Damage, Pawn(Owner), HitLocation, MomentumTransfer*Normal(Velocity), damageType);
}
}
if (!bStuck)
bDestroy = true;
}

rad = Max(blastRadius*24, 1024);

// This needs to be outside the simulated call chain
PlayImpactSound();

//DEUS_EX AMSD Only do these server side
if (Role == ROLE_Authority)
{
if (ImpactSound != None)
{
AISendEvent('LoudNoise', EAITYPE_Audio, 2.0, blastRadius*24);
if (bExplodes)
AISendEvent('WeaponFire', EAITYPE_Audio, 2.0, blastRadius*5);
}
}
if (bDestroy)
Destroy();

Frob (Actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

// if the player frobs it and it's stuck, the player can grab it
if (bStuck)
GrabProjectile(DeusExPlayer(Frobber));

GrabProjectile (DeusExPlayer player)


local Inventory item;


if (player != None)
{
if (spawnWeaponClass != None) // spawn the weapon
{
item = Spawn(spawnWeaponClass);
if (item != None)
{
if ( (Level.NetMode != NM_Standalone ) && Self.IsA('Shuriken'))
DeusExWeapon(item).PickupAmmoCount = DeusExWeapon(item).PickupAmmoCount * 3;
else
DeusExWeapon(item).PickupAmmoCount = 1;
}
}
else if (spawnAmmoClass != None) // or spawn the ammo
{
item = Spawn(spawnAmmoClass);
if (item != None)
{
if ( (Level.NetMode != NM_Standalone ) && Self.IsA('Dart'))
Ammo(item).AmmoAmount = Ammo(item).AmmoAmount * 3;
else
Ammo(item).AmmoAmount = 1;
}
}
if (item != None)
{
player.FrobTarget = item;

// check to see if we can pick up the new weapon/ammo
if (player.HandleItemPickup(item))
{
Destroy(); // destroy the projectile on the wall
if ( Level.NetMode != NM_Standalone )
{
if ( item != None )
item.Destroy();
}
}
else
item.Destroy(); // destroy the weapon/ammo if it can't be picked up

player.FrobTarget = None;
}
}

HitWall (vector HitNormal, actor Wall)


if (bStickToWall)
{
Velocity = vect(0,0,0);
Acceleration = vect(0,0,0);
SetPhysics(PHYS_None);
bStuck = True;

// MBCODE: Do this only on server side
if ( Role == ROLE_Authority )
{
if (Level.NetMode != NM_Standalone)
SetTimer(5.0,False);

if (Wall.IsA('Mover'))
{
SetBase(Wall);
Wall.TakeDamage(Damage, Pawn(Owner), Wall.Location, MomentumTransfer*Normal(Velocity), damageType);
}
}
}

if (Wall.IsA('BreakableGlass'))
bDebris = False;

SpawnEffects(Location, HitNormal, Wall);

Super.HitWall(HitNormal, Wall);

PlayImpactSound


local float rad;


if ((Level.NetMode == NM_Standalone) || (Level.NetMode == NM_ListenServer) || (Level.NetMode == NM_DedicatedServer))
{
rad = Max(blastRadius*4, 1024);
PlaySound(ImpactSound, SLOT_None, 2.0,, rad);
}

PostBeginPlay


Super.PostBeginPlay();

if (bEmitDanger)
AIStartEvent('Projectile', EAITYPE_Visual);

ProcessTouch (Actor Other, Vector HitLocation)


if (bStuck)
return;

if ((Other != instigator) && (DeusExProjectile(Other) == None) &&
(Other != Owner))
{
damagee = Other;
Explode(HitLocation, Normal(HitLocation-damagee.Location));

// DEUS_EX AMSD Spawn blood server side only
if (Role == ROLE_Authority)
{
if (damagee.IsA('Pawn') && !damagee.IsA('Robot') && bBlood)
SpawnBlood(HitLocation, Normal(HitLocation-damagee.Location));
}
}

SpawnBlood (Vector HitLocation, Vector HitNormal)


local int i;


if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
return;

spawn(class'BloodSpurt',,,HitLocation+HitNormal);
for (i=0; i {
if (FRand() < 0.5)
spawn(class'BloodDrop',,,HitLocation+HitNormal*4);
}

SpawnEffects (Vector HitLocation, Vector HitNormal, Actor Other)


local int i;
local DeusExDecal mark;
local Rockchip chip;


// don't draw damage art on destroyed movers
if (DeusExMover(Other) != None)
if (DeusExMover(Other).bDestroyed)
ExplosionDecal = None;

// draw the explosion decal here, not in Engine.Projectile
if (ExplosionDecal != None)
{
mark = DeusExDecal(Spawn(ExplosionDecal, Self,, HitLocation, Rotator(HitNormal)));
if (mark != None)
{
mark.DrawScale = FClamp(damage/30, 0.5, 3.0);
mark.ReattachDecal();
}

ExplosionDecal = None;
}

//DEUS_EX AMSD Don't spawn these on the server.
if ((Level.NetMode == NM_DedicatedServer) && (Role == ROLE_Authority))
return;

if (bDebris)
{
for (i=0; i if (FRand() < 0.8)
{
chip = spawn(class'Rockchip',,,HitLocation+HitNormal);
//DEUS_EX AMSD In multiplayer, don't propagate these to
//other players (or from the listen server to clients).
if (chip != None)
chip.RemoteRole = ROLE_None;
}
}

Tick (float deltaTime)


local float dist, size;
local Rotator dir;
local vector TargetLocation;
local vector vel;
local vector NormalHeading;
local vector NormalDesiredHeading;
local float HeadingDiffDot;
local vector zerovec;


if (bStuck)
return;

Super.Tick(deltaTime);

if (VSize(LastSeenLoc) < 1)
{
LastSeenLoc = Location + Normal(Vector(Rotation)) * 10000;
}

if (Role == ROLE_Authority)
{
bHasNetworkTarget = (Target != None);
}
else
{
bHadLocalTarget = (bHadLocalTarget || (Target != None));
}

if (bTracking && ((Target != None) || ((Level.NetMode != NM_Standalone) && (bHasNetworkTarget)) || ((Level.Netmode != NM_Standalone) && (bHadLocalTarget))))
{
// check it's range
dist = Abs(VSize(Target.Location - Location));
if (dist > MaxRange)
{
// if we're out of range, lose the lock and quit tracking
bTracking = False;
Target = None;
return;
}
else
{
// get the direction to the target
if (Level.NetMode == NM_Standalone)
TargetLocation = Target.Location;
else
TargetLocation = AcquireMPTargetLocation();
if (Role == ROLE_Authority)
NetworkTargetLoc = TargetLocation;
LastSeenLoc = TargetLocation;
dir = Rotator(TargetLocation - Location);
dir.Roll = 0;

if (Level.Netmode != NM_Standalone)
{
NormalHeading = Normal(Vector(Rotation));
NormalDesiredHeading = Normal(TargetLocation - Location);
HeadingDiffDot = NormalHeading Dot NormalDesiredHeading;
}

// set our new rotation
bRotateToDesired = True;
DesiredRotation = dir;

// move us in the new direction that we are facing
size = VSize(Velocity);
vel = Normal(Vector(Rotation));

if (Level.NetMode != NM_Standalone)
{
size = FMax(HeadingDiffDot,0.4) * Speed;
}
Velocity = vel * size;
}
}
else
{
// make the rotation match the velocity direction
SetRotation(Rotator(Velocity));
}

dist = Abs(VSize(initLoc - Location));

if (dist > AccurateRange) // start descent due to "gravity"
Acceleration = Region.Zone.ZoneGravity / 2;

if ((Role < ROLE_Authority) && (bAggressiveExploded))
Explode(Location, vect(0,0,1));

Timer


gradualHurtCounter++;
DamageRing();
if (gradualHurtCounter >= gradualHurtSteps)
Destroy();




DeusExRootWindow.uc (extends RootWindow)

var DeusExHUD hud;
var ActorDisplayWindow actorDisplay;
var DeusExScopeView scopeView;
var int MaxWinStack;
var DeusExBaseWindow winStack[6]; // Array of Windows
var int winCount; // Number of Windows
var Bool bIgnoreHotkeys; // Ignore Hotkeys
var Color back; // Background color
var Color face; // Button face color
var Color text; // Text color
var Color titleText; // Title bar text color
var Color titleBar; // Title bar background color
var S_ColorScheme defaultMenuColorSchemes[10];
var S_ColorScheme defaultHUDColorSchemes[10];
var S_ColorScheme menuColorScheme;
var Bool bMenuTranslucency;
var S_ColorScheme HUDColorScheme;
var Bool bHUDTranslucency;
var Color colSnapshot;
var Texture Snapshot;
var Float snapshotWidth;
var Float snapshotHeight;
var Bool bUIPaused;
var String function;
var Class winClass;
var S_DataVaultFunction DataVaultFunctions[8];
var localized String QuickLoadTitle;
var localized String QuickLoadMessage;
MaxWinStack=6
colSnapshot=(R=128,G=128,B=128)
snapshotWidth=256.000000
snapshotHeight=192.000000
DataVaultFunctions(0)=(Function="ShowInventoryWindow",winClass=Class'DeusEx.PersonaScreenInventory')
DataVaultFunctions(1)=(Function="ShowHealthWindow",winClass=Class'DeusEx.PersonaScreenHealth')
DataVaultFunctions(2)=(Function="ShowAugmentationsWindow",winClass=Class'DeusEx.PersonaScreenAugmentations')
DataVaultFunctions(3)=(Function="ShowSkillsWindow",winClass=Class'DeusEx.PersonaScreenSkills')
DataVaultFunctions(4)=(Function="ShowGoalsWindow",winClass=Class'DeusEx.PersonaScreenGoals')
DataVaultFunctions(5)=(Function="ShowConversationsWindow",winClass=Class'DeusEx.PersonaScreenConversations')
DataVaultFunctions(6)=(Function="ShowImagesWindow",winClass=Class'DeusEx.PersonaScreenImages')
DataVaultFunctions(7)=(Function="ShowLogsWindow",winClass=Class'DeusEx.PersonaScreenLogs')
QuickLoadTitle="Quick Load?"
QuickLoadMessage="You will lose your current game in progress, are you sure you wish to Quick Load?"

ActivateObjectInBelt (int pos) -> bool


local Inventory item;
local DeusExPlayer player;
local bool retval;


retval = False;

if (hud != None)
{
if (hud.belt != None)
{
item = hud.belt.GetObjectFromBelt(pos);
player = DeusExPlayer(parentPawn);
if (player != None)
{
// if the object is an ammo box, load the correct ammo into
// the gun if it is the current weapon
if ((item != None) && item.IsA('Ammo') && (player.Weapon != None))
DeusExWeapon(player.Weapon).LoadAmmoType(Ammo(item));
else
{
player.PutInHand(item);
if (item != None)
retval = True;
}
}
}
}

return retval;

AddInventory (inventory item)


if ((item != None) && !item.IsA('DataVaultImage'))
if (hud != None)
if (hud.belt != None)
hud.belt.AddObjectToBelt(item, -1, false);

AtIntroMap -> bool


local DeusExLevelInfo dxInfo;


foreach parentPawn.AllActors(class'DeusExLevelInfo', dxInfo)
break;

if ((dxInfo == None) || ((dxInfo != None) && (dxInfo.missionNumber >= 0)))
return False;
else
return True;

BoxOptionSelected (Window button, int buttonNumber) -> bool


// Destroy the msgbox!
PopWindow();

if (buttonNumber == 0)
DeusExPlayer(parentPawn).QuickLoadConfirmed();

return true;

CanStartConversation -> bool


local DeusExWeapon weapon;
local bool retval;


retval = (WindowStackCount() == 0);

if (retval)
{
weapon = None;
if (GetRootWindow().parentPawn != None)
weapon = DeusExWeapon(GetRootWindow().parentPawn.Weapon);

if (weapon != None)
if (weapon.bZoomed)
retval = False;
}

return ( retval );

ClearWindowStack


while(winCount > 0)
{
if ( winStack[winCount-1] != None )
{
winStack[winCount-1].Destroy();
winStack[winCount-1] = None;
winCount--;
}
}

UnPauseGame();

ConditionalBindMultiplayerKeys


local String keyTalk, keyTeamTalk, keyBuySkills, keyKillDetail, keyScores, keyName, Alias;
local int i;


for ( i = 0; i < 255; i++ )
{
keyName = parentPawn.ConsoleCommand ( "KEYNAME "$i );
if ( keyName != "" )
{
Alias = parentPawn.ConsoleCommand( "KEYBINDING "$keyName );

// Bail out if any key has already been bound
if (( Alias ~= "Talk" ) || ( Alias ~= "TeamTalk" ) || ( Alias ~= "BuySkills" ) || ( Alias ~= "KillerProfile" ) || ( Alias ~= "ShowScores" ))
return;
}
}
if ( !IsKeyAssigned( IK_T, "" ) )
return;
if ( !IsKeyAssigned( IK_Y, "" ) )
return;
if ( !IsKeyAssigned( IK_B, "" ) )
return;
if ( !IsKeyAssigned( IK_K, "" ) )
return;
if ( !IsKeyAssigned( IK_Equals, "" ) )
return;

// Go ahead and set them then
parentPawn.ConsoleCommand("SET InputExt T Talk");
parentPawn.ConsoleCommand("SET InputExt Y TeamTalk");
parentPawn.ConsoleCommand("SET InputExt B BuySkills");
parentPawn.ConsoleCommand("SET InputExt K KillerProfile");
parentPawn.ConsoleCommand("SET InputExt Equals ShowScores");

ConfirmQuickLoad


local MenuUIMessageBoxWindow msgBox;


msgBox = MessageBox(QuickLoadTitle, QuickLoadMessage, 0, False, Self);
msgBox.SetDeferredKeyPress(True);

DeleteInventory (inventory item)


if (item != None)
if (hud != None)
if (hud.belt != None)
hud.belt.RemoveObjectFromBelt(item);


DescendantRemoved (Window descendant)


if ( descendant == hud )
hud = None;

if ( descendant == scopeView )
scopeView = None;

ExitGame


ClearWindowStack();
parentPawn.ConsoleCommand("Exit");

GetCurrentHUDColorScheme -> S_ColorScheme

GetCurrentMenuColorScheme -> S_ColorScheme

GetHUDColorScheme (int schemeIndex) -> S_ColorScheme

GetHUDTranslucency -> bool

GetMenuColorScheme (int schemeIndex) -> S_ColorScheme

GetMenuTranslucency -> bool

GetTopWindow -> DeusExBaseWindow


if ( winCount > 0 )
return winStack[winCount-1];
else
return None;

HideSnapshot


local DeusExPlayer player;


EnableRendering(True);

player = DeusExPlayer(parentPawn);
if ((player != None) && (player.UIBackground == 0))
MaskBackground(False);


InitWindow


Super.InitWindow();

// Initialize variables
winCount = 0;

actorDisplay = ActorDisplayWindow(NewChild(Class'ActorDisplayWindow'));
actorDisplay.SetWindowAlignments(HALIGN_Full, VALIGN_Full);

hud = DeusExHUD(NewChild(Class'DeusExHUD'));
hud.UpdateSettings(DeusExPlayer(parentPawn));
hud.SetWindowAlignments(HALIGN_Full, VALIGN_Full, 0, 0);

scopeView = DeusExScopeView(NewChild(Class'DeusExScopeView', False));
scopeView.SetWindowAlignments(HALIGN_Full, VALIGN_Full, 0, 0);

SetDefaultCursor(Texture'DeusExCursor1', Texture'DeusExCursor1_Shadow');

scopeView.Lower();

ConditionalBindMultiplayerKeys();

InvokeLoadScreen


InvokeMenuScreen(Class'MenuScreenLoadGame');

InvokeMenu (Class newMenu)


// If the top window is a menu, then we want to
// hide it first.

if ( MenuUIMenuWindow(GetTopWindow()) == None )
PushWindow(newMenu, False);
else
PushWindow(newMenu, True);

// Pause the game
UIPauseGame();

InvokeMenuScreen (Class newScreen, optional bool bNoPause) -> DeusExBaseWindow


local DeusExBaseWindow newWindow;


// Check to see if a menu is visible. If so, hide it first.
if (( MenuUIMenuWindow(GetTopWindow()) != None ) || ( MenuUIScreenWindow(GetTopWindow()) != None ))
newWindow = PushWindow(newScreen, True, bNoPause);
else
newWindow = PushWindow(newScreen, False, bNoPause);

// Pause the game
if (!bNoPause)
UIPauseGame();

return newWindow;

InvokeSaveScreen


InvokeMenuScreen(Class'MenuScreenSaveGame');

IsKeyAssigned (EInputKey key, String function) -> bool


local int pos;
local string InputKeyName;
local string Alias;
local DeusExPlayer player;


player = DeusExPlayer(parentPawn);
InputKeyName = mid(string(GetEnum(enum'EInputKey',key)),3);

Alias = player.ConsoleCommand("KEYBINDING " $ InputKeyName);

return (Alias == function);

MaskBackground (bool bMask)


if (bMask)
{
SetBackground(Texture'MaskTexture');
SetBackgroundStyle(DSTY_Modulated);
ShowHud(False);
}
else
{
SetBackground(None);
SetBackgroundStyle(DSTY_None);
ShowHud(True);
}

ProcessDataVaultSelection (EInputKey key) -> bool


local int dvIndex;
local bool bKeyPressed;
local string Alias;


bKeyPressed = False;

// Loop through the functions
for(dvIndex=0; dvIndex {
// Get the key(s) bound to this function
if (IsKeyAssigned(key, DataVaultFunctions[dvIndex].function))
{
// If the screen is already active, then cancel it.
// Otherwise invoke it.

if ((GetTopWindow() != None) && (GetTopWindow().Class == DataVaultFunctions[dvIndex].winClass))
PopWindow();
else
InvokeUIScreen(DataVaultFunctions[dvIndex].winClass);

bKeyPressed = True;
break;
}
}

return bKeyPressed;

RefreshDisplay (float DeltaTime)


if (GetTopWindow() != None)
GetTopWindow().RefreshWindow(DeltaTime);
if (hud != None)
hud.belt.RefreshHUDDisplay(DeltaTime);

ResetFlags


local name flagName;
local name lastFlagName;
local EFlagType flagType;
local EFlagType lastFlagType;
local String flagStringName;
local int flagIterator;


if (DeusExPlayer(parentPawn) != None)
{
flagIterator = DeusExPlayer(parentPawn).flagBase.CreateIterator();

do
{
DeusExPlayer(parentPawn).flagBase.GetNextFlag( flagIterator, flagName, flagType );

// Delete the previous flag (this is gay)
if (lastFlagName != '')
{
flagStringName = "" $ lastFlagName;

// If "SKTemp_" can't be found, then delete the flag
if (InStr(flagStringName, "SKTemp_") == -1)
DeusExPlayer(parentPawn).flagBase.DeleteFlag(lastFlagName, lastFlagType);
}

lastFlagName = flagName;

} until(lastFlagName == '')

DeusExPlayer(parentPawn).flagBase.DestroyIterator(flagIterator);
}

SetHUDTranslucency (bool bNewTranslucency)

SetMenuTranslucency (bool bNewTranslucency)

ShowHud (bool bShow)


if (hud != None)
{
if (bShow)
{
hud.UpdateSettings(DeusExPlayer(parentPawn));
hud.Show();
scopeView.ShowView();
}
else
{
hud.Hide();
scopeView.HideView();
}
}

ShowSnapshot (optional bool bUseExistingSnapshot)


local DeusExPlayer player;
local int UIBackground;


ShowHUD(False);

player = DeusExPlayer(parentPawn);
if (player != None)
UIBackground = player.UIBackground;
else
UIBackground = 0;

// Only do this if we're not at the intro screen
if (!AtIntroMap())
{
if (UIBackground > 0)
{
SetSnapshotSize(snapshotWidth, snapshotHeight);

if (UIBackground == 1)
{
if (!bUseExistingSnapshot)
{
snapshot = GenerateSnapshot();
}
}
else
{
if (snapshot != None)
{
CriticalDelete(snapshot);
snapshot = None;
}
}

SetBackgroundSmoothing(True);
SetBackgroundStretching(True);
SetRawBackground(snapshot, colSnapshot);
SetRawBackgroundSize(snapshotWidth, snapshotHeight);
StretchRawBackground(True);
EnableRendering(False);
}
else
{
EnableRendering(True);
MaskBackground(True);
}
}
else
{
MaskBackground(True);
}

UIPauseGame


// Only do this once
if (!bUIPaused)
{
bUIPaused = True;

if (!AtIntroMap())
{
ShowSnapshot();
parentPawn.ShowMenu();
}
else
{
MaskBackground(True);
}
}

UnPauseGame


bUIPaused = False;

SetBackgroundStyle(DSTY_None);

HideSnapshot();
ShowHud(True);

parentPawn.bShowMenu = false;
parentPawn.Player.Console.GotoState('');
parentPawn.SetPause(False);

UpdateHud


if (hud != None)
hud.UpdateSettings(DeusExPlayer(parentPawn));

UseHUDColorScheme (int schemeIndex)

UseMenuColorScheme (int schemeIndex)

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;
local DeusExPlayer Player;


Player = DeusExPlayer(parentPawn);

bKeyHandled = True;

Super.VirtualKeyPressed(key, bRepeat);

// Check for Ctrl-F9, which is a hard-coded key to take a screenshot
if ( IsKeyDown( IK_Ctrl ) && ( key == IK_F9 ))
{
parentPawn.ConsoleCommand("SHOT");
return True;
}

if ( IsKeyDown( IK_Alt ) || IsKeyDown( IK_Shift ) || IsKeyDown( IK_Ctrl ))
return False;

// When player dies in multiplayer...
if ((Player != None) && (Player.Health <= 0) && (Player.Level.NetMode != NM_Standalone))
{
if (( MultiplayerMessageWin(GetTopWindow()) != None ) && ( key == IK_Escape ))
{
PopWindow();
Player.ShowMainMenu();
}
return True;
}

// Check if this is a DataVault key
if (!ProcessDataVaultSelection(key))
{
switch( key )
{
// Hide the screen if the Escape key is pressed
// Temp: Also if the Return key is pressed
case IK_Escape:
PopWindow();
break;

// We want Print Screen to work in UI screens
case IK_PrintScrn:
parentPawn.ConsoleCommand("SHOT");
break;

// case IK_GreyMinus:
// PushWindow(Class'MenuScreenRGB');
// break;

default:
bKeyHandled = False;
}
}

return bKeyHandled;

WindowStackCount -> int


return winCount;




DeusExSaveInfo.uc (extends Object)

var int Year; // Year.
var int Month; // Month.
var int Day; // Day of month.
var int Hour; // Hour.
var int Minute; // Minute.
var int Second; // Second.
var int DirectoryIndex; // File Index (if saved already, otherwise -1)
var String Description; // User entered description
var String MissionLocation; // Mission Location
var String MapName; // Map Filename
var Texture Snapshot; // Snapshot of game when saved
var int saveCount; // Number of times saved
var int saveTime; // Duration of play, in seconds
var bool bCheatsEnabled; // Set to TRUE If Cheats were enabled!!

UpdateTimeStamp | native




DeusExScopeView.uc (extends Window)

var bool bActive; // is this view actually active?
var DeusExPlayer player;
var Color colLines;
var Bool bBinocs;
var Bool bViewVisible;
var int desiredFOV;

ActivateView (int newFOV, bool bNewBinocs, bool bInstant)


desiredFOV = newFOV;

bBinocs = bNewBinocs;

if (player != None)
{
if (bInstant)
player.SetFOVAngle(desiredFOV);
else
player.desiredFOV = desiredFOV;

bViewVisible = True;
Show();
}

DeactivateView


if (player != None)
{
Player.DesiredFOV = Player.Default.DefaultFOV;
bViewVisible = False;
Hide();
}

DrawWindow (GC gc)


local float fromX, toX;
local float fromY, toY;
local float scopeWidth, scopeHeight;


Super.DrawWindow(gc);

if (GetRootWindow().parentPawn != None)
{
if (player.IsInState('Dying'))
return;
}

// Figure out where to put everything
if (bBinocs)
scopeWidth = 512;
else
scopeWidth = 256;

scopeHeight = 256;

fromX = (width-scopeWidth)/2;
fromY = (height-scopeHeight)/2;
toX = fromX + scopeWidth;
toY = fromY + scopeHeight;

// Draw the black borders
gc.SetTileColorRGB(0, 0, 0);
gc.SetStyle(DSTY_Normal);
if ( Player.Level.NetMode == NM_Standalone ) // Only block out screen real estate in single player
{
gc.DrawPattern(0, 0, width, fromY, 0, 0, Texture'Solid');
gc.DrawPattern(0, toY, width, fromY, 0, 0, Texture'Solid');
gc.DrawPattern(0, fromY, fromX, scopeHeight, 0, 0, Texture'Solid');
gc.DrawPattern(toX, fromY, fromX, scopeHeight, 0, 0, Texture'Solid');
}
// Draw the center scope bitmap
// Use the Header Text color

// gc.SetStyle(DSTY_Masked);
if (bBinocs)
{
gc.SetStyle(DSTY_Modulated);
gc.DrawTexture(fromX, fromY, 256, scopeHeight, 0, 0, Texture'HUDBinocularView_1');
gc.DrawTexture(fromX + 256, fromY, 256, scopeHeight, 0, 0, Texture'HUDBinocularView_2');

gc.SetTileColor(colLines);
gc.SetStyle(DSTY_Masked);
gc.DrawTexture(fromX, fromY, 256, scopeHeight, 0, 0, Texture'HUDBinocularCrosshair_1');
gc.DrawTexture(fromX + 256, fromY, 256, scopeHeight, 0, 0, Texture'HUDBinocularCrosshair_2');
}
else
{
// Crosshairs - Use new scope in multiplayer, keep the old in single player
if ( Player.Level.NetMode == NM_Standalone )
{
gc.SetStyle(DSTY_Modulated);
gc.DrawTexture(fromX, fromY, scopeWidth, scopeHeight, 0, 0, Texture'HUDScopeView');
gc.SetTileColor(colLines);
gc.SetStyle(DSTY_Masked);
gc.DrawTexture(fromX, fromY, scopeWidth, scopeHeight, 0, 0, Texture'HUDScopeCrosshair');
}
else
{
if ( WeaponRifle(Player.inHand) != None )
{
gc.SetStyle(DSTY_Modulated);
gc.DrawTexture(fromX, fromY, scopeWidth, scopeHeight, 0, 0, Texture'HUDScopeView3');
}
else
{
gc.SetStyle(DSTY_Modulated);
gc.DrawTexture(fromX, fromY, scopeWidth, scopeHeight, 0, 0, Texture'HUDScopeView2');
}
}
}

HideView


if (bViewVisible)
{
Hide();
Player.SetFOVAngle(Player.Default.DefaultFOV);
}

InitWindow


Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

bTickEnabled = true;

StyleChanged();

ShowView


if (bViewVisible)
{
Player.SetFOVAngle(desiredFOV);
Show();
}

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colLines = theme.GetColorFromName('HUDColor_HeaderText');

Tick (float deltaSeconds)


local Crosshair cross;
local DeusExRootWindow dxRoot;


dxRoot = DeusExRootWindow(GetRootWindow());
if (dxRoot != None)
{
cross = dxRoot.hud.cross;

if (bActive)
cross.SetCrosshair(false);
else
cross.SetCrosshair(player.bCrosshairVisible);
}




DeusExScrollAreaWindow.uc (extends ScrollAreaWindow)

var Color colScrollBars;
var Color colScale;
colScrollBars=(G=240,B=240)
colScale=(G=180,B=180)

InitWindow


Super.InitWindow();

SetAreaMargins(0, 0);
SetScrollbarDistance(0);

vScale.SetThumbCaps(Texture'ToolWindowVScrollThumb_Top', Texture'ToolWindowVScrollThumb_Bottom', 16, 2, 16, 2);
vScale.SetThumbTexture(Texture'ToolWindowVScrollThumb_Center', 16, 2);
vScale.SetScaleTexture(Texture'ToolWindowVScrollScale', 16, 16);
vScale.SetScaleMargins(0, 0);
vScale.SetScaleColor(colScale);
vScale.SetThumbColor(colScrollBars);
vScale.SetScaleStyle(DSTY_Normal);
vScale.SetThumbStyle(DSTY_Normal);
vScale.SetThumbStep(10);

hScale.SetThumbCaps(Texture'ToolWindowHScrollThumb_Left', Texture'ToolWindowHScrollThumb_Right', 2, 16, 2, 16);
hScale.SetThumbTexture(Texture'ToolWindowHScrollThumb_Center', 2, 16);
hScale.SetScaleTexture(Texture'ToolWindowHScrollScale', 16, 16);
hScale.SetScaleMargins(0, 0);
hScale.SetScaleColor(colScale);
hScale.SetThumbColor(colScrollBars);
hScale.SetScaleStyle(DSTY_Normal);
hScale.SetThumbStyle(DSTY_Normal);
hScale.SetThumbStep(10);

upButton.SetSize(16, 16);
upButton.SetBackgroundStyle(DSTY_Normal);
upButton.SetButtonColors(colScrollBars, colScrollBars, colScrollBars, colScrollBars, colScrollBars, colScrollBars);
upButton.SetButtonTextures(
Texture'ToolWindowScrollUpButton_Normal', Texture'ToolWindowScrollUpButton_Pressed',
Texture'ToolWindowScrollUpButton_Normal', Texture'ToolWindowScrollUpButton_Pressed',
Texture'ToolWindowScrollUpButton_Normal', Texture'ToolWindowScrollUpButton_Pressed');

downButton.SetSize(16, 16);
downButton.SetBackgroundStyle(DSTY_Normal);
downButton.SetButtonColors(colScrollBars, colScrollBars, colScrollBars, colScrollBars, colScrollBars, colScrollBars);
downButton.SetButtonTextures(
Texture'ToolWindowScrollDownButton_Normal', Texture'ToolWindowScrollDownButton_Pressed',
Texture'ToolWindowScrollDownButton_Normal', Texture'ToolWindowScrollDownButton_Pressed',
Texture'ToolWindowScrollDownButton_Normal', Texture'ToolWindowScrollDownButton_Pressed');

leftButton.SetSize(16, 16);
leftButton.SetBackgroundStyle(DSTY_Normal);
leftButton.SetButtonColors(colScrollBars, colScrollBars, colScrollBars, colScrollBars, colScrollBars, colScrollBars);
leftButton.SetButtonTextures(
Texture'ToolWindowScrollLeftButton_Normal', Texture'ToolWindowScrollLeftButton_Pressed',
Texture'ToolWindowScrollLeftButton_Normal', Texture'ToolWindowScrollLeftButton_Pressed',
Texture'ToolWindowScrollLeftButton_Normal', Texture'ToolWindowScrollLeftButton_Pressed');

rightButton.SetSize(16, 16);
rightButton.SetBackgroundStyle(DSTY_Normal);
rightButton.SetButtonColors(colScrollBars, colScrollBars, colScrollBars, colScrollBars, colScrollBars, colScrollBars);
rightButton.SetButtonTextures(
Texture'ToolWindowScrollRightButton_Normal', Texture'ToolWindowScrollRightButton_Pressed',
Texture'ToolWindowScrollRightButton_Normal', Texture'ToolWindowScrollRightButton_Pressed',
Texture'ToolWindowScrollRightButton_Normal', Texture'ToolWindowScrollRightButton_Pressed');




DeusExWeapon.uc (extends Weapon)

var bool bReadyToFire; // true if our bullets are loaded, etc.
var() int LowAmmoWaterMark; // critical low ammo count
var travel int ClipCount; // number of bullets remaining in current clip
var() class GoverningSkill; // skill that affects this weapon
var() travel float NoiseLevel; // amount of noise that weapon makes when fired
var() EEnemyEffective EnemyEffective; // type of enemies that weapon is effective against
var() EEnviroEffective EnviroEffective; // type of environment that weapon is effective in
var() EConcealability Concealability; // concealability of weapon
var() travel bool bAutomatic; // is this an automatic weapon?
var() travel float ShotTime; // number of seconds between shots
var() travel float ReloadTime; // number of seconds needed to reload the clip
var() int HitDamage; // damage done by a single shot (or for shotguns, a single slug)
var() int MaxRange; // absolute maximum range in world units (feet * 16)
var() travel int AccurateRange; // maximum accurate range in world units (feet * 16)
var() travel float BaseAccuracy; // base accuracy (0.0 is dead on, 1.0 is far off)
var bool bCanHaveScope; // can this weapon have a scope?
var() travel bool bHasScope; // does this weapon have a scope?
var() int ScopeFOV; // FOV while using scope
var bool bZoomed; // are we currently zoomed?
var bool bWasZoomed; // were we zoomed? (used during reloading)
var bool bCanHaveLaser; // can this weapon have a laser sight?
var() travel bool bHasLaser; // does this weapon have a laser sight?
var bool bLasing; // is the laser sight currently on?
var LaserEmitter Emitter; // actual laser emitter - valid only when bLasing == True
var bool bCanHaveSilencer; // can this weapon have a silencer?
var() travel bool bHasSilencer; // does this weapon have a silencer?
var() bool bCanTrack; // can this weapon lock on to a target?
var() float LockTime; // how long the target must stay targetted to lock
var float LockTimer; // used for lock checking
var float MaintainLockTimer; // Used for maintaining a lock even after moving off target.
var Actor LockTarget; // Used for maintaining a lock even after moving off target.
var Actor Target; // actor currently targetted
var ELockMode LockMode; // is this target locked?
var string TargetMessage; // message to print during targetting
var float TargetRange; // range to current target
var() Sound LockedSound; // sound to play when locked
var() Sound TrackingSound; // sound to play while tracking a target
var float SoundTimer; // to time the sounds correctly
var() class AmmoNames[3]; // three possible types of ammo per weapon
var() class ProjectileNames[3]; // projectile classes for different ammo
var() EAreaType AreaOfEffect; // area of effect of the weapon
var() bool bPenetrating; // shot will penetrate and cause blood
var() float StunDuration; // how long the shot stuns the target
var() bool bHasMuzzleFlash; // does this weapon have a flash when fired?
var() bool bHandToHand; // is this weapon hand to hand (no ammo)?
var globalconfig vector SwingOffset; // offsets for this weapon swing.
var() travel float recoilStrength; // amount that the weapon kicks back after firing (0.0 is none, 1.0 is large)
var bool bFiring; // True while firing, used for recoil
var bool bOwnerWillNotify; // True if firing hand-to-hand weapons is dependent on the owner's animations
var bool bFallbackWeapon; // If True, only use if no other weapons are available
var bool bNativeAttack; // True if weapon represents a native attack
var bool bEmitWeaponDrawn; // True if drawing this weapon should make NPCs react
var bool bUseWhileCrouched; // True if NPCs should crouch while using this weapon
var bool bUseAsDrawnWeapon; // True if this weapon should be carried by NPCs as a drawn weapon
var bool bWasInFiring;
var bool bNearWall; // used for prox. mine placement
var Vector placeLocation; // used for prox. mine placement
var Vector placeNormal; // used for prox. mine placement
var Mover placeMover; // used for prox. mine placement
var float ShakeTimer;
var float ShakeYaw;
var float ShakePitch;
var float AIMinRange; // minimum "best" range for AI; 0=default min range
var float AIMaxRange; // maximum "best" range for AI; 0=default max range
var float AITimeLimit; // maximum amount of time an NPC should hold the weapon; 0=no time limit
var float AIFireDelay; // Once fired, use as fallback weapon until the timeout expires; 0=no time limit
var float standingTimer; // how long we've been standing still (to increase accuracy)
var float currentAccuracy; // what the currently calculated accuracy is (updated every tick)
var MuzzleFlash flash; // muzzle flash actor
var float MinSpreadAcc; // Minimum accuracy for multiple slug weapons (shotgun). Affects only multiplayer,
var float MinProjSpreadAcc;
var float MinWeaponAcc; // Minimum accuracy for a weapon at all. Affects only multiplayer.
var bool bNeedToSetMPPickupAmmo;
var bool bDestroyOnFinish;
var float mpReloadTime;
var int mpHitDamage;
var float mpBaseAccuracy;
var int mpAccurateRange;
var int mpMaxRange;
var int mpReloadCount;
var int mpPickupAmmoCount;
var bool bCanHaveModBaseAccuracy;
var bool bCanHaveModReloadCount;
var bool bCanHaveModAccurateRange;
var bool bCanHaveModReloadTime;
var bool bCanHaveModRecoilStrength;
var travel float ModBaseAccuracy;
var travel float ModReloadCount;
var travel float ModAccurateRange;
var travel float ModReloadTime;
var travel float ModRecoilStrength;
var localized String msgCannotBeReloaded;
var localized String msgOutOf;
var localized String msgNowHas;
var localized String msgAlreadyHas;
var localized String msgNone;
var localized String msgLockInvalid;
var localized String msgLockRange;
var localized String msgLockAcquire;
var localized String msgLockLocked;
var localized String msgRangeUnit;
var localized String msgTimeUnit;
var localized String msgMassUnit;
var localized String msgNotWorking;
var localized String msgInfoAmmoLoaded;
var localized String msgInfoAmmo;
var localized String msgInfoDamage;
var localized String msgInfoClip;
var localized String msgInfoROF;
var localized String msgInfoReload;
var localized String msgInfoRecoil;
var localized String msgInfoAccuracy;
var localized String msgInfoAccRange;
var localized String msgInfoMaxRange;
var localized String msgInfoMass;
var localized String msgInfoLaser;
var localized String msgInfoScope;
var localized String msgInfoSilencer;
var localized String msgInfoNA;
var localized String msgInfoYes;
var localized String msgInfoNo;
var localized String msgInfoAuto;
var localized String msgInfoSingle;
var localized String msgInfoRounds;
var localized String msgInfoRoundsPerSec;
var localized String msgInfoSkill;
var localized String msgInfoWeaponStats;
var bool bClientReadyToFire, bClientReady, bInProcess, bFlameOn, bLooping;
var int SimClipCount, flameShotCount, SimAmmoAmount;
var float TimeLockSet;
bReadyToFire=True
LowAmmoWaterMark=10
NoiseLevel=1.000000
ShotTime=0.500000
reloadTime=1.000000
HitDamage=10
maxRange=9600
AccurateRange=4800
BaseAccuracy=0.500000
ScopeFOV=10
MaintainLockTimer=1.000000
bPenetrating=True
bHasMuzzleFlash=True
bEmitWeaponDrawn=True
bUseWhileCrouched=True
bUseAsDrawnWeapon=True
MinSpreadAcc=0.250000
MinProjSpreadAcc=1.000000
bNeedToSetMPPickupAmmo=True
msgCannotBeReloaded="This weapon can't be reloaded"
msgOutOf="Out of %s"
msgNowHas="%s now has %s loaded"
msgAlreadyHas="%s already has %s loaded"
msgNone="NONE"
msgLockInvalid="INVALID"
msgLockRange="RANGE"
msgLockAcquire="ACQUIRE"
msgLockLocked="LOCKED"
msgRangeUnit="FT"
msgTimeUnit="SEC"
msgMassUnit="LBS"
msgNotWorking="This weapon doesn't work underwater"
msgInfoAmmoLoaded="Ammo loaded:"
msgInfoAmmo="Ammo type(s):"
msgInfoDamage="Base damage:"
msgInfoClip="Clip size:"
msgInfoROF="Rate of fire:"
msgInfoReload="Reload time:"
msgInfoRecoil="Recoil:"
msgInfoAccuracy="Base Accuracy:"
msgInfoAccRange="Acc. range:"
msgInfoMaxRange="Max. range:"
msgInfoMass="Mass:"
msgInfoLaser="Laser sight:"
msgInfoScope="Scope:"
msgInfoSilencer="Silencer:"
msgInfoNA="N/A"
msgInfoYes="YES"
msgInfoNo="NO"
msgInfoAuto="AUTO"
msgInfoSingle="SINGLE"
msgInfoRounds="RDS"
msgInfoRoundsPerSec="RDS/SEC"
msgInfoSkill="Skill:"
msgInfoWeaponStats="Weapon Stats:"
ReloadCount=10
shakevert=10.000000
Misc1Sound=Sound'DeusExSounds.Generic.DryFire'
AutoSwitchPriority=0
bRotatingPickup=False
PickupMessage="You found"
ItemName="DEFAULT WEAPON NAME - REPORT THIS AS A BUG"
LandSound=Sound'DeusExSounds.Generic.DropSmallWeapon'
bNoSmooth=False
Mass=10.000000
Buoyancy=5.000000

AcquireTarget -> Actor


local vector StartTrace, EndTrace, HitLocation, HitNormal;
local Actor hit, retval;
local Pawn p;


p = Pawn(Owner);
if (p == None)
return None;

StartTrace = p.Location;
if (PlayerPawn(p) != None)
EndTrace = p.Location + (10000 * Vector(p.ViewRotation));
else
EndTrace = p.Location + (10000 * Vector(p.Rotation));

// adjust for eye height
StartTrace.Z += p.BaseEyeHeight;
EndTrace.Z += p.BaseEyeHeight;

foreach TraceActors(class'Actor', hit, HitLocation, HitNormal, EndTrace, StartTrace)
if (!hit.bHidden && (hit.IsA('Decoration') || hit.IsA('Pawn')))
return hit;

return None;

AmmoAvailable (int ammoNum) -> int


local class newAmmoClass;
local Ammo newAmmo;
local Pawn P;


P = Pawn(Owner);

// sorry, only pawns can have weapons
if (P == None)
return 0;

newAmmoClass = AmmoNames[ammoNum];

if (newAmmoClass == None)
return 0;

newAmmo = Ammo(P.FindInventoryType(newAmmoClass));

if (newAmmo == None)
return 0;

return newAmmo.AmmoAmount;

AmmoLeftInClip -> int


if (ReloadCount == 0) // if this weapon is not reloadable
return 1;
else if (AmmoType == None)
return 0;
else if (AmmoType.AmmoAmount == 0) // if we are out of ammo
return 0;
else if (ReloadCount - ClipCount > AmmoType.AmmoAmount) // if we have no clips left
return AmmoType.AmmoAmount;
else
return ReloadCount - ClipCount;

AnimEnd

BaseChange


Super.BaseChange();

// Make sure we fall if we don't have a base
if ((base == None) && (Owner == None))
SetPhysics(PHYS_Falling);

BeginState


// alert NPCs that I'm putting away my gun
AIEndEvent('WeaponDrawn', EAITYPE_Visual);

Super.BeginState();

BringUp


if ( Level.NetMode != NM_Standalone )
ReadyClientToFire( False );

// alert NPCs that I'm whipping it out
if (!bNativeAttack && bEmitWeaponDrawn)
AIStartEvent('WeaponDrawn', EAITYPE_Visual);

// reset the standing still accuracy bonus
standingTimer = 0;

Super.BringUp();

BuildPercentString (Float value) -> String


local string str;


str = String(Int(Abs(value * 100.0)));
if (value < 0.0)
str = "-" $ str;
else
str = "+" $ str;

return ("(" $ str $ "%)");

CR -> String


return Chr(13) $ Chr(10);

CalcDrawOffset -> vector


local vector DrawOffset, WeaponBob;
local ScriptedPawn SPOwner;
local Pawn PawnOwner;


SPOwner = ScriptedPawn(Owner);
if (SPOwner != None)
{
DrawOffset = ((0.9/SPOwner.FOVAngle * PlayerViewOffset) >> SPOwner.ViewRotation);
DrawOffset += (SPOwner.BaseEyeHeight * vect(0,0,1));
}
else
{
// copied from Engine.Inventory to not be FOVAngle dependent
PawnOwner = Pawn(Owner);
DrawOffset = ((0.9/PawnOwner.Default.FOVAngle * PlayerViewOffset) >> PawnOwner.ViewRotation);

DrawOffset += (PawnOwner.EyeHeight * vect(0,0,1));
WeaponBob = BobDamping * PawnOwner.WalkBob;
WeaponBob.Z = (0.45 + 0.55 * BobDamping) * PawnOwner.WalkBob.Z;
DrawOffset += WeaponBob;
}

return DrawOffset;

CalculateAccuracy -> float


local float accuracy; // 0 is dead on, 1 is pretty far off
local float tempacc, div;
local float weapskill; // so we don't keep looking it up (slower).
local int HealthArmRight, HealthArmLeft, HealthHead;
local int BestArmRight, BestArmLeft, BestHead;
local bool checkit;
local DeusExPlayer player;


accuracy = BaseAccuracy; // start with the weapon's base accuracy
weapskill = GetWeaponSkill();

player = DeusExPlayer(Owner);

if (player != None)
{
// check the player's skill
// 0.0 = dead on, 1.0 = way off
accuracy += weapskill;

// get the health values for the player
HealthArmRight = player.HealthArmRight;
HealthArmLeft = player.HealthArmLeft;
HealthHead = player.HealthHead;
BestArmRight = player.Default.HealthArmRight;
BestArmLeft = player.Default.HealthArmLeft;
BestHead = player.Default.HealthHead;
checkit = True;
}
else if (ScriptedPawn(Owner) != None)
{
// update the weapon's accuracy with the ScriptedPawn's BaseAccuracy
// (BaseAccuracy uses higher values for less accuracy, hence we add)
accuracy += ScriptedPawn(Owner).BaseAccuracy;

// get the health values for the NPC
HealthArmRight = ScriptedPawn(Owner).HealthArmRight;
HealthArmLeft = ScriptedPawn(Owner).HealthArmLeft;
HealthHead = ScriptedPawn(Owner).HealthHead;
BestArmRight = ScriptedPawn(Owner).Default.HealthArmRight;
BestArmLeft = ScriptedPawn(Owner).Default.HealthArmLeft;
BestHead = ScriptedPawn(Owner).Default.HealthHead;
checkit = True;
}
else
checkit = False;

// Disabled accuracy mods based on health in multiplayer
if ( Level.NetMode != NM_Standalone )
checkit = False;

if (checkit)
{
if (HealthArmRight < 1)
accuracy += 0.5;
else if (HealthArmRight < BestArmRight * 0.34)
accuracy += 0.2;
else if (HealthArmRight < BestArmRight * 0.67)
accuracy += 0.1;

if (HealthArmLeft < 1)
accuracy += 0.5;
else if (HealthArmLeft < BestArmLeft * 0.34)
accuracy += 0.2;
else if (HealthArmLeft < BestArmLeft * 0.67)
accuracy += 0.1;

if (HealthHead < BestHead * 0.67)
accuracy += 0.1;
}

// increase accuracy (decrease value) if we haven't been moving for awhile
// this only works for the player, because NPCs don't need any more aiming help!
if (player != None)
{
tempacc = accuracy;
if (standingTimer > 0)
{
// higher skill makes standing bonus greater
div = Max(15.0 + 29.0 * weapskill, 0.0);
accuracy -= FClamp(standingTimer/div, 0.0, 0.6);

// don't go too low
if ((accuracy < 0.1) && (tempacc > 0.1))
accuracy = 0.1;
}
}

// make sure we don't go negative
if (accuracy < 0.0)
accuracy = 0.0;

if (Level.NetMode != NM_Standalone)
if (accuracy < MinWeaponAcc)
accuracy = MinWeaponAcc;

return accuracy;

CanLoadAmmoType (Ammo ammo) -> bool


local int ammoIndex;
local bool bCanLoad;


bCanLoad = False;

if (ammo != None)
{
// First check "AmmoName"

if (AmmoName == ammo.Class)
{
bCanLoad = True;
}
else
{
for (ammoIndex=0; ammoIndex<3; ammoIndex++)
{
if (AmmoNames[ammoIndex] == ammo.Class)
{
bCanLoad = True;
break;
}
}
}
}

return bCanLoad;

CanReload -> bool


if ((ClipCount > 0) && (ReloadCount != 0) && (AmmoType != None) && (AmmoType.AmmoAmount > 0) &&
(AmmoType.AmmoAmount > (ReloadCount-ClipCount)))
return true;
else
return false;

ClientActive


bWasInFiring = IsInState('ClientFiring') || IsInState('SimFinishFire');
bClientReadyToFire = False;
GotoState('SimActive');

ClientDownWeapon


bWasInFiring = IsInState('ClientFiring') || IsInState('SimFinishFire');
bClientReadyToFire = False;
GotoState('SimDownWeapon');

ClientFire (float value) -> bool


local bool bWaitOnAnim;
local vector shake;


// check for surrounding environment
if ((EnviroEffective == ENVEFF_Air) || (EnviroEffective == ENVEFF_Vacuum) || (EnviroEffective == ENVEFF_AirVacuum))
{
if (Region.Zone.bWaterZone)
{
if (Pawn(Owner) != None)
{
Pawn(Owner).ClientMessage(msgNotWorking);
if (!bHandToHand)
PlaySimSound( Misc1Sound, SLOT_None, TransientSoundVolume * 2.0, 1024 );
}
return false;
}
}

if ( !bLooping ) // Wait on animations when not looping
{
bWaitOnAnim = ( IsAnimating() && ((AnimSequence == 'Select') || (AnimSequence == 'Shoot') || (AnimSequence == 'ReloadBegin') || (AnimSequence == 'Reload') || (AnimSequence == 'ReloadEnd') || (AnimSequence == 'Down')));
}
else
{
bWaitOnAnim = False;
bLooping = False;
}

if ( (Owner.IsA('DeusExPlayer') && (DeusExPlayer(Owner).NintendoImmunityTimeLeft > 0.01)) ||
(!bClientReadyToFire) || bInProcess || bWaitOnAnim )
{
DeusExPlayer(Owner).bJustFired = False;
bPointing = False;
bFiring = False;
return false;
}

if ( !Self.IsA('WeaponFlamethrower') )
ServerForceFire();

if (bHandToHand)
{
SimAmmoAmount = AmmoType.AmmoAmount - 1;

bClientReadyToFire = False;
bInProcess = True;
GotoState('ClientFiring');
bPointing = True;
if ( PlayerPawn(Owner) != None )
PlayerPawn(Owner).PlayFiring();
PlaySelectiveFiring();
PlayFiringSound();
}
else if ((ClipCount < ReloadCount) || (ReloadCount == 0))
{
if ((ReloadCount == 0) || (AmmoType.AmmoAmount > 0))
{
SimClipCount = ClipCount + 1;

if ( AmmoType != None )
AmmoType.SimUseAmmo();

bFiring = True;
bPointing = True;
bClientReadyToFire = False;
bInProcess = True;
GotoState('ClientFiring');
if ( PlayerPawn(Owner) != None )
{
shake.X = 0.0;
shake.Y = 100.0 * (ShakeTime*0.5);
shake.Z = 100.0 * -(currentAccuracy * ShakeVert);
PlayerPawn(Owner).ClientShake( shake );
PlayerPawn(Owner).PlayFiring();
}
// Don't play firing anim for 20mm
if ( Ammo20mm(AmmoType) == None )
PlaySelectiveFiring();
PlayFiringSound();

if ( bInstantHit && ( Ammo20mm(AmmoType) == None ))
TraceFire(currentAccuracy);
else
{
if ( !bFlameOn && Self.IsA('WeaponFlamethrower'))
{
bFlameOn = True;
StartFlame();
}
ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);
}
}
else
{
if ( Owner.IsA('DeusExPlayer') && DeusExPlayer(Owner).bAutoReload )
{
if ( MustReload() && CanReload() )
{
bClientReadyToFire = False;
bInProcess = False;
if ((AmmoType.AmmoAmount == 0) && (AmmoName != AmmoNames[0]))
CycleAmmo();

ReloadAmmo();
}
}
PlaySimSound( Misc1Sound, SLOT_None, TransientSoundVolume * 2.0, 1024 ); // play dry fire sound
}
}
else
{
if ( Owner.IsA('DeusExPlayer') && DeusExPlayer(Owner).bAutoReload )
{
if ( MustReload() && CanReload() )
{
bClientReadyToFire = False;
bInProcess = False;
if ((AmmoType.AmmoAmount == 0) && (AmmoName != AmmoNames[0]))
CycleAmmo();
ReloadAmmo();
}
}
PlaySimSound( Misc1Sound, SLOT_None, TransientSoundVolume * 2.0, 1024 ); // play dry fire sound
}
return true;

ClientReFire (float value)


bClientReadyToFire = True;
bLooping = True;
bInProcess = False;
ClientFire(0);

ClientReload


bWasInFiring = IsInState('ClientFiring') || IsInState('SimFinishFire');
bClientReadyToFire = False;
GotoState('SimReload');

ComputeProjectileStart (Vector X, Vector Y, Vector Z) -> Vector


local Vector Start;


// if we are instant-hit, non-projectile, then don't offset our starting point by PlayerViewOffset
if (bInstantHit)
Start = Owner.Location + Pawn(Owner).BaseEyeHeight * vect(0,0,1);// - Vector(Pawn(Owner).ViewRotation)*(0.9*Pawn(Owner).CollisionRadius);
else
Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;

return Start;

CycleAmmo


local int i, last;


if (NumAmmoTypesAvailable() < 2)
return;

for (i=0; i if (AmmoNames[i] == AmmoName)
break;

last = i;

do
{
if (++i >= 3)
i = 0;

if (LoadAmmo(i))
break;
} until (last == i);

DestroyOnFinish


bDestroyOnFinish = True;

EraseMuzzleFlashTexture


MultiSkins[2] = None;

Finish


if ( Level.NetMode != NM_Standalone )
ReadyClientToFire( True );

if (bHasMuzzleFlash)
EraseMuzzleFlashTexture();

if ( bChangeWeapon )
{
GotoState('DownWeapon');
return;
}

if (( Level.NetMode != NM_Standalone ) && IsInState('Active'))
{
GotoState('Idle');
return;
}

if (Pawn(Owner) == None)
{
GotoState('Idle');
return;
}
if ( PlayerPawn(Owner) == None )
{
//bFireMem = false;
//bAltFireMem = false;
if ( ((AmmoType==None) || (AmmoType.AmmoAmount<=0)) && ReloadCount!=0 )
{
Pawn(Owner).StopFiring();
Pawn(Owner).SwitchToBestWeapon();
}
else if ( (Pawn(Owner).bFire != 0) && (FRand() < RefireRate) )
Global.Fire(0);
else if ( (Pawn(Owner).bAltFire != 0) && (FRand() < AltRefireRate) )
Global.AltFire(0);
else
{
Pawn(Owner).StopFiring();
GotoState('Idle');
}
return;
}

if (( Level.NetMode == NM_DedicatedServer ) || ((Level.NetMode == NM_ListenServer) && Owner.IsA('DeusExPlayer') && !DeusExPlayer(Owner).PlayerIsListenClient()))
{
GotoState('Idle');
return;
}

if ( ((AmmoType==None) || (AmmoType.AmmoAmount<=0)) || (Pawn(Owner).Weapon != self) )
GotoState('Idle');
else if ( /*bFireMem ||*/ Pawn(Owner).bFire!=0 )
Global.Fire(0);
else if ( /*bAltFireMem ||*/ Pawn(Owner).bAltFire!=0 )
Global.AltFire(0);
else
GotoState('Idle');

Fire (float Value)


local float sndVolume;
local bool bListenClient;


bListenClient = (Owner.IsA('DeusExPlayer') && DeusExPlayer(Owner).PlayerIsListenClient());

sndVolume = TransientSoundVolume;

if ( Level.NetMode != NM_Standalone ) // Turn up the sounds a bit in mulitplayer
{
sndVolume = TransientSoundVolume * 2.0;
if ( Owner.IsA('DeusExPlayer') && (DeusExPlayer(Owner).NintendoImmunityTimeLeft > 0.01) || (!bClientReady && (!bListenClient)) )
{
DeusExPlayer(Owner).bJustFired = False;
bReadyToFire = True;
bPointing = False;
bFiring = False;
return;
}
}
// check for surrounding environment
if ((EnviroEffective == ENVEFF_Air) || (EnviroEffective == ENVEFF_Vacuum) || (EnviroEffective == ENVEFF_AirVacuum))
{
if (Region.Zone.bWaterZone)
{
if (Pawn(Owner) != None)
{
Pawn(Owner).ClientMessage(msgNotWorking);
if (!bHandToHand)
PlaySimSound( Misc1Sound, SLOT_None, sndVolume, 1024 ); // play dry fire sound
}
GotoState('Idle');
return;
}
}


if (bHandToHand)
{
if (ReloadCount > 0)
AmmoType.UseAmmo(1);

if (( Level.NetMode != NM_Standalone ) && !bListenClient )
bClientReady = False;
bReadyToFire = False;
GotoState('NormalFire');
bPointing=True;
if ( Owner.IsA('PlayerPawn') )
PlayerPawn(Owner).PlayFiring();
PlaySelectiveFiring();
PlayFiringSound();
}
// if we are a single-use weapon, then our ReloadCount is 0 and we don't use ammo
else if ((ClipCount < ReloadCount) || (ReloadCount == 0))
{
if ((ReloadCount == 0) || AmmoType.UseAmmo(1))
{
if (( Level.NetMode != NM_Standalone ) && !bListenClient )
bClientReady = False;

ClipCount++;
bFiring = True;
bReadyToFire = False;
GotoState('NormalFire');
if (( Level.NetMode == NM_Standalone ) || ( Owner.IsA('DeusExPlayer') && DeusExPlayer(Owner).PlayerIsListenClient()) )
{
if ( PlayerPawn(Owner) != None ) // shake us based on accuracy
PlayerPawn(Owner).ShakeView(ShakeTime, currentAccuracy * ShakeMag + ShakeMag, currentAccuracy * ShakeVert);
}
bPointing=True;
if ( bInstantHit )
TraceFire(currentAccuracy);
else
ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);

if ( Owner.IsA('PlayerPawn') )
PlayerPawn(Owner).PlayFiring();
// Don't play firing anim for 20mm
if ( Ammo20mm(AmmoType) == None )
PlaySelectiveFiring();
PlayFiringSound();
if ( Owner.bHidden )
CheckVisibility();
}
else
PlaySimSound( Misc1Sound, SLOT_None, sndVolume, 1024 ); // play dry fire sound
}
else
PlaySimSound( Misc1Sound, SLOT_None, sndVolume, 1024 ); // play dry fire sound

// Update ammo count on object belt
if (DeusExPlayer(Owner) != None)
DeusExPlayer(Owner).UpdateBeltText(Self);

ForceAltFire


AltFire(0);

ForceFire


Fire(0);

FormatFloatString (float value, float precision) -> String


local string str;


if (precision == 0.0)
return "ERR";

// build integer part
str = String(Int(value));

// build decimal part
if (precision < 1.0)
{
value -= Int(value);
str = str $ "." $ String(Int((0.5 * precision) + value * (1.0 / precision)));
}

return str;

GenerateBullet


if (AmmoType.UseAmmo(1))
{
if ( bInstantHit )
TraceFire(currentAccuracy);
else
ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);

ClipCount++;
}
else
GotoState('FinishFire');

GetAIVolume (out float volume, out float radius)


volume = 0;
radius = 0;

if (!bHasSilencer && !bHandToHand)
{
volume = NoiseLevel*Pawn(Owner).SoundDampening;
radius = volume * 800.0;
}

GetReloadTime -> float


local float val;


val = ReloadTime;

if (ScriptedPawn(Owner) != None)
{
val = ReloadTime * (ScriptedPawn(Owner).BaseAccuracy*2+1);
}
else if (DeusExPlayer(Owner) != None)
{
// check for skill use if we are the player
val = GetWeaponSkill();
val = ReloadTime + (val*ReloadTime);
}

return val;

GetShotTime -> float


local float mult, sTime;


if (ScriptedPawn(Owner) != None)
return ShotTime * (ScriptedPawn(Owner).BaseAccuracy*2+1);
else
{
// AugCombat decreases shot time
mult = 1.0;
if (bHandToHand && DeusExPlayer(Owner) != None)
{
mult = 1.0 / DeusExPlayer(Owner).AugmentationSystem.GetAugLevelValue(class'AugCombat');
if (mult == -1.0)
mult = 1.0;
}
sTime = ShotTime * mult;
return (sTime);
}

GetSimReloadTime -> float


local float val;


val = ReloadTime;

if (ScriptedPawn(Owner) != None)
{
val = ReloadTime * (ScriptedPawn(Owner).BaseAccuracy*2+1);
}
else if (DeusExPlayer(Owner) != None)
{
// check for skill use if we are the player
val = GetWeaponSkill();
val = ReloadTime + (val*ReloadTime);
}
return val;

GetSimShotTime -> float


local float mult, sTime;


if (ScriptedPawn(Owner) != None)
return ShotTime * (ScriptedPawn(Owner).BaseAccuracy*2+1);
else
{
// AugCombat decreases shot time
mult = 1.0;
if (bHandToHand && DeusExPlayer(Owner) != None)
{
mult = 1.0 / DeusExPlayer(Owner).AugmentationSystem.GetAugLevelValue(class'AugCombat');
if (mult == -1.0)
mult = 1.0;
}
sTime = ShotTime * mult;
return (sTime);
}

GetWallMaterial (vector HitLocation, vector HitNormal) -> name


local vector EndTrace, StartTrace;
local actor target;
local int texFlags;
local name texName, texGroup;


StartTrace = HitLocation + HitNormal*16; // make sure we start far enough out
EndTrace = HitLocation - HitNormal;

foreach TraceTexture(class'Actor', target, texName, texGroup, texFlags, StartTrace, HitNormal, EndTrace)
if ((target == Level) || target.IsA('Mover'))
break;

return texGroup;

GetWeaponSkill -> float


local DeusExPlayer player;
local float value;


value = 0;

if ( Owner != None )
{
player = DeusExPlayer(Owner);
if (player != None)
{
if ((player.AugmentationSystem != None ) && ( player.SkillSystem != None ))
{
// get the target augmentation
value = player.AugmentationSystem.GetAugLevelValue(class'AugTarget');
if (value == -1.0)
value = 0;

// get the skill
value += player.SkillSystem.GetSkillLevelValue(GoverningSkill);
}
}
}
return value;

HandToHandAttack


local bool bOwnerIsPlayerPawn;


if (bOwnerWillNotify)
return;

// The controlling animator should be the one to do the tracefire and projfire
if ( Level.NetMode != NM_Standalone )
{
bOwnerIsPlayerPawn = (DeusExPlayer(Owner) == DeusExPlayer(GetPlayerPawn()));

if (( Role < ROLE_Authority ) && bOwnerIsPlayerPawn )
ServerHandleNotify( bInstantHit, ProjectileClass, ProjectileSpeed, bWarnTarget );
else if ( !bOwnerIsPlayerPawn )
return;
}

if (ScriptedPawn(Owner) != None)
ScriptedPawn(Owner).SetAttackAngle();

if (bInstantHit)
TraceFire(0.0);
else
ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);

// if we are a thrown weapon and we run out of ammo, destroy the weapon
if ( bHandToHand && (ReloadCount > 0) && (SimAmmoAmount <= 0))
{
DestroyOnFinish();
if ( Role < ROLE_Authority )
{
ServerGotoFinishFire();
GotoState('SimQuickFinish');
}
}

HandlePickupQuery (Inventory Item) -> bool


local DeusExWeapon W;
local DeusExPlayer player;
local bool bResult;
local class defAmmoClass;
local Ammo defAmmo;


// make sure that if you pick up a modded weapon that you
// already have, you get the mods
W = DeusExWeapon(Item);
if ((W != None) && (W.Class == Class))
{
if (W.ModBaseAccuracy > ModBaseAccuracy)
ModBaseAccuracy = W.ModBaseAccuracy;
if (W.ModReloadCount > ModReloadCount)
ModReloadCount = W.ModReloadCount;
if (W.ModAccurateRange > ModAccurateRange)
ModAccurateRange = W.ModAccurateRange;

// these are negative
if (W.ModReloadTime < ModReloadTime)
ModReloadTime = W.ModReloadTime;
if (W.ModRecoilStrength < ModRecoilStrength)
ModRecoilStrength = W.ModRecoilStrength;

if (W.bHasLaser)
bHasLaser = True;
if (W.bHasSilencer)
bHasSilencer = True;
if (W.bHasScope)
bHasScope = True;

// copy the actual stats as well
if (W.ReloadCount > ReloadCount)
ReloadCount = W.ReloadCount;
if (W.AccurateRange > AccurateRange)
AccurateRange = W.AccurateRange;

// these are negative
if (W.BaseAccuracy < BaseAccuracy)
BaseAccuracy = W.BaseAccuracy;
if (W.ReloadTime < ReloadTime)
ReloadTime = W.ReloadTime;
if (W.RecoilStrength < RecoilStrength)
RecoilStrength = W.RecoilStrength;
}
player = DeusExPlayer(Owner);

if (Item.Class == Class)
{
if (!( (Weapon(item).bWeaponStay && (Level.NetMode == NM_Standalone)) && (!Weapon(item).bHeldItem || Weapon(item).bTossedOut)))
{
// Only add ammo of the default type
// There was an easy way to get 32 20mm shells, buy picking up another assault rifle with 20mm ammo selected
if ( AmmoType != None )
{
// Add to default ammo only
if ( AmmoNames[0] == None )
defAmmoClass = AmmoName;
else
defAmmoClass = AmmoNames[0];

defAmmo = Ammo(player.FindInventoryType(defAmmoClass));
defAmmo.AddAmmo( Weapon(Item).PickupAmmoCount );

if ( Level.NetMode != NM_Standalone )
{
if (( player != None ) && ( player.InHand != None ))
{
if ( DeusExWeapon(item).class == DeusExWeapon(player.InHand).class )
ReadyToFire();
}
}
}
}
}

bResult = Super.HandlePickupQuery(Item);

// Notify the object belt of the new ammo
if (player != None)
player.UpdateBeltText(Self);

return bResult;

HasAccuracyMod -> bool


return (ModBaseAccuracy != 0.0);

HasClipMod -> bool


return (ModReloadCount != 0.0);

HasMaxAccuracyMod -> bool


return (ModBaseAccuracy == 0.5);

HasMaxClipMod -> bool


return (ModReloadCount == 0.5);

HasMaxRangeMod -> bool


return (ModAccurateRange == 0.5);

HasMaxRecoilMod -> bool


return (ModRecoilStrength == -0.5);

HasMaxReloadMod -> bool


return (ModReloadTime == -0.5);

HasRangeMod -> bool


return (ModAccurateRange != 0.0);

HasRecoilMod -> bool


return (ModRecoilStrength != 0.0);

HasReloadMod -> bool


return (ModReloadTime != 0.0);

IdleFunction


PlayIdleAnim();
bInProcess = False;
if ( bFlameOn )
{
StopFlame();
bFlameOn = False;
}

LaserOff


if (bHasLaser && bLasing)
{
if (Emitter != None)
Emitter.TurnOff();

bLasing = False;
}

LaserOn


if (bHasLaser && !bLasing)
{
// if we don't have an emitter, then spawn one
// otherwise, just turn it on
if (Emitter == None)
{
Emitter = Spawn(class'LaserEmitter', Self, , Location, Pawn(Owner).ViewRotation);
if (Emitter != None)
{
Emitter.SetHiddenBeam(True);
Emitter.AmbientSound = None;
Emitter.TurnOn();
}
}
else
Emitter.TurnOn();

bLasing = True;
}

LaserToggle


if (IsInState('Idle'))
{
if (bHasLaser)
{
if (bLasing)
LaserOff();
else
LaserOn();
}
}

LoadAmmo (int ammoNum) -> bool


local class newAmmoClass;
local Ammo newAmmo;
local Pawn P;


if ((ammoNum < 0) || (ammoNum > 2))
return False;

P = Pawn(Owner);

// sorry, only pawns can have weapons
if (P == None)
return False;

newAmmoClass = AmmoNames[ammoNum];

if (newAmmoClass != None)
{
if (newAmmoClass != AmmoName)
{
newAmmo = Ammo(P.FindInventoryType(newAmmoClass));
if (newAmmo == None)
{
P.ClientMessage(Sprintf(msgOutOf, newAmmoClass.Default.ItemName));
return False;
}

// if we don't have a projectile for this ammo type, then set instant hit
if (ProjectileNames[ammoNum] == None)
{
bInstantHit = True;
bAutomatic = Default.bAutomatic;
ShotTime = Default.ShotTime;
if ( Level.NetMode != NM_Standalone )
{
if (HasReloadMod())
ReloadTime = mpReloadTime * (1.0+ModReloadTime);
else
ReloadTime = mpReloadTime;
}
else
{
if (HasReloadMod())
ReloadTime = Default.ReloadTime * (1.0+ModReloadTime);
else
ReloadTime = Default.ReloadTime;
}
FireSound = Default.FireSound;
ProjectileClass = None;
}
else
{
// otherwise, set us to fire projectiles
bInstantHit = False;
bAutomatic = False;
ShotTime = 1.0;
if (HasReloadMod())
ReloadTime = 2.0 * (1.0+ModReloadTime);
else
ReloadTime = 2.0;
FireSound = None; // handled by the projectile
ProjectileClass = ProjectileNames[ammoNum];
ProjectileSpeed = ProjectileClass.Default.Speed;
}

AmmoName = newAmmoClass;
AmmoType = newAmmo;

// AlexB had a new sound for 20mm but there's no mechanism for playing alternate sounds per ammo type
// Same for WP rocket
if ( Ammo20mm(newAmmo) != None )
FireSound=Sound'AssaultGunFire20mm';
else if ( AmmoRocketWP(newAmmo) != None )
FireSound=Sound'GEPGunFireWP';
else if ( AmmoRocket(newAmmo) != None )
FireSound=Sound'GEPGunFire';

if ( Level.NetMode != NM_Standalone )
SetClientAmmoParams( bInstantHit, bAutomatic, ShotTime, FireSound, ProjectileClass, ProjectileSpeed );

// Notify the object belt of the new ammo
if (DeusExPlayer(P) != None)
DeusExPlayer(P).UpdateBeltText(Self);

ReloadAmmo();

P.ClientMessage(Sprintf(msgNowHas, ItemName, newAmmoClass.Default.ItemName));
return True;
}
else
{
P.ClientMessage(Sprintf(MsgAlreadyHas, ItemName, newAmmoClass.Default.ItemName));
}
}

return False;

LoadAmmoClass (Class ammoClass)


local int i;


if (ammoClass != None)
for (i=0; i<3; i++)
if (AmmoNames[i] == ammoClass)
LoadAmmo(i);

LoadAmmoType (Ammo ammo)


local int i;


if (ammo != None)
for (i=0; i<3; i++)
if (AmmoNames[i] == ammo.Class)
LoadAmmo(i);

MustReload -> bool


if ((AmmoLeftInClip() == 0) && (AmmoType != None) && (AmmoType.AmmoAmount > 0))
return true;
else
return false;

MuzzleFlashLight


local Vector offset, X, Y, Z;


if (!bHasMuzzleFlash)
return;

if ((flash != None) && !flash.bDeleteMe)
flash.LifeSpan = flash.Default.LifeSpan;
else
{
GetAxes(Pawn(Owner).ViewRotation,X,Y,Z);
offset = Owner.Location;
offset += X * Owner.CollisionRadius * 2;
flash = spawn(class'MuzzleFlash',,, offset);
if (flash != None)
flash.SetBase(Owner);
}

NearWallCheck -> bool


local Vector StartTrace, EndTrace, HitLocation, HitNormal;
local Actor HitActor;


// Scripted pawns can't place LAMs
if (ScriptedPawn(Owner) != None)
return False;

// Don't let players place grenades when they have something highlighted
if ( Level.NetMode != NM_Standalone )
{
if ( Owner.IsA('DeusExPlayer') && (DeusExPlayer(Owner).frobTarget != None) )
{
if ( DeusExPlayer(Owner).IsFrobbable( DeusExPlayer(Owner).frobTarget ) )
return False;
}
}

// trace out one foot in front of the pawn
StartTrace = Owner.Location;
EndTrace = StartTrace + Vector(Pawn(Owner).ViewRotation) * 32;

StartTrace.Z += Pawn(Owner).BaseEyeHeight;
EndTrace.Z += Pawn(Owner).BaseEyeHeight;

HitActor = Trace(HitLocation, HitNormal, EndTrace, StartTrace);
if ((HitActor == Level) || ((HitActor != None) && HitActor.IsA('Mover')))
{
placeLocation = HitLocation;
placeNormal = HitNormal;
placeMover = Mover(HitActor);
return True;
}

return False;

NotifyOwner (bool bStart)


local DeusExPlayer player;
local ScriptedPawn pawn;


player = DeusExPlayer(Owner);
pawn = ScriptedPawn(Owner);

if (player != None)
{
if (bStart)
player.Reloading(self, GetReloadTime()+(1.0/AnimRate));
else
{
player.DoneReloading(self);
}
}
else if (pawn != None)
{
if (bStart)
pawn.Reloading(self, GetReloadTime()+(1.0/AnimRate));
else
pawn.DoneReloading(self);
}

NumAmmoTypesAvailable -> int


local int i;


for (i=0; i if (AmmoNames[i] == None)
break;

// to make Al fucking happy
if (i == 0)
i = 1;

return i;

NumClips -> int


if (ReloadCount == 0) // if this weapon is not reloadable
return 0;
else if (AmmoType == None)
return 0;
else if (AmmoType.AmmoAmount == 0) // if we are out of ammo
return 0;
else // compute remaining clips
return ((AmmoType.AmmoAmount-AmmoLeftInClip()) + (ReloadCount-1)) / ReloadCount;

OwnerHandToHandAttack


local bool bOwnerIsPlayerPawn;


if (!bOwnerWillNotify)
return;

// The controlling animator should be the one to do the tracefire and projfire
if ( Level.NetMode != NM_Standalone )
{
bOwnerIsPlayerPawn = (DeusExPlayer(Owner) == DeusExPlayer(GetPlayerPawn()));

if (( Role < ROLE_Authority ) && bOwnerIsPlayerPawn )
ServerHandleNotify( bInstantHit, ProjectileClass, ProjectileSpeed, bWarnTarget );
else if ( !bOwnerIsPlayerPawn )
return;
}

if (ScriptedPawn(Owner) != None)
ScriptedPawn(Owner).SetAttackAngle();

if (bInstantHit)
TraceFire(0.0);
else
ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);

PlaceGrenade


local ThrownProjectile gren;
local float dmgX;


gren = ThrownProjectile(spawn(ProjectileClass, Owner,, placeLocation, Rotator(placeNormal)));
if (gren != None)
{
AmmoType.UseAmmo(1);
if ( AmmoType.AmmoAmount <= 0 )
bDestroyOnFinish = True;

gren.PlayAnim('Open');
gren.PlaySound(gren.MiscSound, SLOT_None, 0.5+FRand()*0.5,, 512, 0.85+FRand()*0.3);
gren.SetPhysics(PHYS_None);
gren.bBounce = False;
gren.bProximityTriggered = True;
gren.bStuck = True;
if (placeMover != None)
gren.SetBase(placeMover);

// up the damage based on the skill
// returned value from GetWeaponSkill is negative, so negate it to make it positive
// dmgX value ranges from 1.0 to 2.4 (max demo skill and max target aug)
dmgX = -2.0 * GetWeaponSkill() + 1.0;
gren.Damage *= dmgX;

// Update ammo count on object belt
if (DeusExPlayer(Owner) != None)
DeusExPlayer(Owner).UpdateBeltText(Self);
}

PlayFiringSound


if (bHasSilencer)
PlaySimSound( Sound'StealthPistolFire', SLOT_None, TransientSoundVolume, 2048 );
else
{
// The sniper rifle sound is heard to it's range in multiplayer
if ( ( Level.NetMode != NM_Standalone ) && Self.IsA('WeaponRifle') )
PlaySimSound( FireSound, SLOT_None, TransientSoundVolume, class'WeaponRifle'.Default.mpMaxRange );
else
PlaySimSound( FireSound, SLOT_None, TransientSoundVolume, 2048 );
}

PlayIdleAnim


local float rnd;


if (bZoomed || bNearWall)
return;

rnd = FRand();

if (rnd < 0.1)
PlayAnim('Idle1',,0.1);
else if (rnd < 0.2)
PlayAnim('Idle2',,0.1);
else if (rnd < 0.3)
PlayAnim('Idle3',,0.1);

PlayLandingSound


if (LandSound != None)
{
if (Velocity.Z <= -200)
{
PlaySound(LandSound, SLOT_None, TransientSoundVolume,, 768);
AISendEvent('LoudNoise', EAITYPE_Audio, TransientSoundVolume, 768);
}
}

PlayLockSound


Owner.PlaySound(LockedSound, SLOT_None);

PlayPostSelect


// let's not zero the ammo count anymore - you must always reload
// ClipCount = 0;

PlaySelectiveFiring


local Pawn aPawn;
local float rnd;
local Name anim;


anim = 'Shoot';

if (bHandToHand)
{
rnd = FRand();
if (rnd < 0.33)
anim = 'Attack';
else if (rnd < 0.66)
anim = 'Attack2';
else
anim = 'Attack3';
}

if (( Level.NetMode == NM_Standalone ) || ( DeusExPlayer(Owner) == DeusExPlayer(GetPlayerPawn())) )
{
if (bAutomatic)
LoopAnim(anim,, 0.1);
else
PlayAnim(anim,,0.1);
}
else if ( Role == ROLE_Authority )
{
for ( aPawn = Level.PawnList; aPawn != None; aPawn = aPawn.nextPawn )
{
if ( aPawn.IsA('DeusExPlayer') && ( DeusExPlayer(Owner) != DeusExPlayer(aPawn) ) )
{
// If they can't see the weapon, don't bother
if ( DeusExPlayer(aPawn).FastTrace( DeusExPlayer(aPawn).Location, Location ))
DeusExPlayer(aPawn).ClientPlayAnimation( Self, anim, 0.1, bAutomatic );
}
}
}

PlaySimSound (Sound snd, ESoundSlot Slot, float Volume, float Radius) -> int


if ( Owner != None )
{
if ( Level.NetMode == NM_Standalone )
return ( Owner.PlaySound( snd, Slot, Volume, , Radius ) );
else
{
Owner.PlayOwnedSound( snd, Slot, Volume, , Radius );
return 1;
}
}
return 0;

PostBeginPlay


Super.PostBeginPlay();
if (Level.NetMode != NM_Standalone)
{
bWeaponStay = True;
if (bNeedToSetMPPickupAmmo)
{
PickupAmmoCount = PickupAmmoCount * 3;
bNeedToSetMPPickupAmmo = False;
}
}

PreBeginPlay


Super.PreBeginPlay();

if ( Default.mpPickupAmmoCount == 0 )
{
Default.mpPickupAmmoCount = Default.PickupAmmoCount;
}

ProcessTraceHit (Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)


local float mult;
local name damageType;
local DeusExPlayer dxPlayer;


if (Other != None)
{
// AugCombat increases our damage if hand to hand
mult = 1.0;
if (bHandToHand && (DeusExPlayer(Owner) != None))
{
mult = DeusExPlayer(Owner).AugmentationSystem.GetAugLevelValue(class'AugCombat');
if (mult == -1.0)
mult = 1.0;
}

// skill also affects our damage
// GetWeaponSkill returns 0.0 to -0.7 (max skill/aug)
mult += -2.0 * GetWeaponSkill();

// Determine damage type
damageType = WeaponDamageType();

if (Other != None)
{
if (Other.bOwned)
{
dxPlayer = DeusExPlayer(Owner);
if (dxPlayer != None)
dxPlayer.AISendEvent('Futz', EAITYPE_Visual);
}
}
if ((Other == Level) || (Other.IsA('Mover')))
{
if ( Role == ROLE_Authority )
Other.TakeDamage(HitDamage * mult, Pawn(Owner), HitLocation, 1000.0*X, damageType);

SelectiveSpawnEffects( HitLocation, HitNormal, Other, HitDamage * mult);
}
else if ((Other != self) && (Other != Owner))
{
if ( Role == ROLE_Authority )
Other.TakeDamage(HitDamage * mult, Pawn(Owner), HitLocation, 1000.0*X, damageType);
if (bHandToHand)
SelectiveSpawnEffects( HitLocation, HitNormal, Other, HitDamage * mult);

if (bPenetrating && Other.IsA('Pawn') && !Other.IsA('Robot'))
SpawnBlood(HitLocation, HitNormal);
}
}
if (DeusExMPGame(Level.Game) != None)
{
if (DeusExPlayer(Other) != None)
DeusExMPGame(Level.Game).TrackWeapon(self,HitDamage * mult);
else
DeusExMPGame(Level.Game).TrackWeapon(self,0);
}

ProjectileFire (class ProjClass, float ProjSpeed, bool bWarn) -> Projectile


local Vector Start, X, Y, Z;
local DeusExProjectile proj;
local float mult;
local float volume, radius;
local int i, numProj;
local Pawn aPawn;


// AugCombat increases our speed (distance) if hand to hand
mult = 1.0;
if (bHandToHand && (DeusExPlayer(Owner) != None))
{
mult = DeusExPlayer(Owner).AugmentationSystem.GetAugLevelValue(class'AugCombat');
if (mult == -1.0)
mult = 1.0;
ProjSpeed *= mult;
}

// skill also affects our damage
// GetWeaponSkill returns 0.0 to -0.7 (max skill/aug)
mult += -2.0 * GetWeaponSkill();

// make noise if we are not silenced
if (!bHasSilencer && !bHandToHand)
{
GetAIVolume(volume, radius);
Owner.AISendEvent('WeaponFire', EAITYPE_Audio, volume, radius);
Owner.AISendEvent('LoudNoise', EAITYPE_Audio, volume, radius);
if (!Owner.IsA('PlayerPawn'))
Owner.AISendEvent('Distress', EAITYPE_Audio, volume, radius);
}

// should we shoot multiple projectiles in a spread?
if (AreaOfEffect == AOE_Cone)
numProj = 3;
else
numProj = 1;

GetAxes(Pawn(owner).ViewRotation,X,Y,Z);
Start = ComputeProjectileStart(X, Y, Z);

for (i=0; i {
// If we have multiple slugs, then lower our accuracy a bit after the first slug so the slugs DON'T all go to the same place
if ((i > 0) && (Level.NetMode != NM_Standalone))
if (currentAccuracy < MinProjSpreadAcc)
currentAccuracy = MinProjSpreadAcc;

AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn);
AdjustedAim.Yaw += currentAccuracy * (Rand(1024) - 512);
AdjustedAim.Pitch += currentAccuracy * (Rand(1024) - 512);


if (( Level.NetMode == NM_Standalone ) || ( Owner.IsA('DeusExPlayer') && DeusExPlayer(Owner).PlayerIsListenClient()) )
{
proj = DeusExProjectile(Spawn(ProjClass, Owner,, Start, AdjustedAim));
if (proj != None)
{
// AugCombat increases our damage as well
proj.Damage *= mult;

// send the targetting information to the projectile
if (bCanTrack && (LockTarget != None) && (LockMode == LOCK_Locked))
{
proj.Target = LockTarget;
proj.bTracking = True;
}
}
}
else
{
if (( Role == ROLE_Authority ) || (DeusExPlayer(Owner) == DeusExPlayer(GetPlayerPawn())) )
{
// Do it the old fashioned way if it can track, or if we are a projectile that we could pick up again
if ( bCanTrack || Self.IsA('WeaponShuriken') || Self.IsA('WeaponMiniCrossbow') || Self.IsA('WeaponLAM') || Self.IsA('WeaponEMPGrenade') || Self.IsA('WeaponGasGrenade'))
{
if ( Role == ROLE_Authority )
{
proj = DeusExProjectile(Spawn(ProjClass, Owner,, Start, AdjustedAim));
if (proj != None)
{
// AugCombat increases our damage as well
proj.Damage *= mult;
// send the targetting information to the projectile
if (bCanTrack && (LockTarget != None) && (LockMode == LOCK_Locked))
{
proj.Target = LockTarget;
proj.bTracking = True;
}
}
}
}
else
{
proj = DeusExProjectile(Spawn(ProjClass, Owner,, Start, AdjustedAim));
if (proj != None)
{
proj.RemoteRole = ROLE_None;
// AugCombat increases our damage as well
if ( Role == ROLE_Authority )
proj.Damage *= mult;
else
proj.Damage = 0;
}
if ( Role == ROLE_Authority )
{
for ( aPawn = Level.PawnList; aPawn != None; aPawn = aPawn.nextPawn )
{
if ( aPawn.IsA('DeusExPlayer') && ( DeusExPlayer(aPawn) != DeusExPlayer(Owner) ))
DeusExPlayer(aPawn).ClientSpawnProjectile( ProjClass, Owner, Start, AdjustedAim );
}
}
}
}
}

}
return proj;

PropagateLockState (ELockMode NewMode, Actor NewTarget)


LockMode = NewMode;
LockTarget = NewTarget;

PutDown -> bool


// alert NPCs that I'm putting away my gun
AIEndEvent('WeaponDrawn', EAITYPE_Visual);
return Super.PutDown();

ReadyClientToFire (bool bReady)


bClientReadyToFire = bReady;

ReadyToFire


if (!bReadyToFire)
{
// BOOGER!
//if (ScriptedPawn(Owner) != None)
// ScriptedPawn(Owner).ReadyToFire();
bReadyToFire = True;
if ( Level.NetMode != NM_Standalone )
ReadyClientToFire( True );
}

RefreshScopeDisplay (DeusExPlayer player, bool bInstant, bool bScopeOn)


if (bScopeOn && (player != None))
{
// Show the Scope View
DeusExRootWindow(player.rootWindow).scopeView.ActivateView(ScopeFOV, False, bInstant);
}
else if (!bScopeOn)
{
DeusExrootWindow(player.rootWindow).scopeView.DeactivateView();
}

ReloadAmmo


// single use or hand to hand weapon if ReloadCount == 0
if (ReloadCount == 0)
{
Pawn(Owner).ClientMessage(msgCannotBeReloaded);
return;
}

if (!IsInState('Reload'))
{
TweenAnim('Still', 0.1);
GotoState('Reload');
}

SawedOffCockSound


if ((AmmoType.AmmoAmount > 0) && (WeaponSawedOffShotgun(Self) != None))
Owner.PlaySound(SelectSound, SLOT_None,,, 1024);

ScopeOff


if (bHasScope && bZoomed && (Owner != None) && Owner.IsA('DeusExPlayer'))
{
bZoomed = False;
// Hide the Scope View
RefreshScopeDisplay(DeusExPlayer(Owner), False, bZoomed);
//DeusExRootWindow(DeusExPlayer(Owner).rootWindow).scopeView.DeactivateView();
}

ScopeOn


if (bHasScope && !bZoomed && (Owner != None) && Owner.IsA('DeusExPlayer'))
{
// Show the Scope View
bZoomed = True;
RefreshScopeDisplay(DeusExPlayer(Owner), False, bZoomed);
}

ScopeToggle


if (IsInState('Idle'))
{
if (bHasScope && (Owner != None) && Owner.IsA('DeusExPlayer'))
{
if (bZoomed)
ScopeOff();
else
ScopeOn();
}
}

SelectiveSpawnEffects (Vector HitLocation, Vector HitNormal, Actor Other, float Damage)


local DeusExPlayer fxOwner;
local Pawn aPawn;


// The normal path before there was multiplayer
if ( Level.NetMode == NM_Standalone )
{
SpawnEffects(HitLocation, HitNormal, Other, Damage);
return;
}

fxOwner = DeusExPlayer(Owner);

if ( Role == ROLE_Authority )
{
SpawnEffectSounds(HitLocation, HitNormal, Other, Damage );

for ( aPawn = Level.PawnList; aPawn != None; aPawn = aPawn.nextPawn )
{
if ( aPawn.IsA('DeusExPlayer') && ( DeusExPlayer(aPawn) != fxOwner ) )
{
if ( DeusExPlayer(aPawn).FastTrace( DeusExPlayer(aPawn).Location, HitLocation ))
DeusExPlayer(aPawn).ClientSpawnHits( bPenetrating, bHandToHand, HitLocation, HitNormal, Other, Damage );
}
}
}
if ( fxOwner == DeusExPlayer(GetPlayerPawn()) )
{
fxOwner.ClientSpawnHits( bPenetrating, bHandToHand, HitLocation, HitNormal, Other, Damage );
SpawnEffectSounds( HitLocation, HitNormal, Other, Damage );
}

ServerDoneReloading


ClipCount = 0;

ServerForceFire


bClientReady = True;
Fire(0);

ServerGenerateBullet


if ( ClipCount < ReloadCount )
GenerateBullet();

ServerGotoFinishFire


GotoState('FinishFire');

ServerHandleNotify (bool bInstantHit, class ProjClass, float ProjSpeed, bool bWarn)


if (bInstantHit)
TraceFire(0.0);
else
ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);

SetClientAmmoParams (bool bInstant, bool bAuto, float sTime, Sound FireSnd, class pClass, float pSpeed)


bInstantHit = bInstant;
bAutomatic = bAuto;
ShotTime = sTime;
FireSound = FireSnd;
ProjectileClass = pClass;
ProjectileSpeed = pSpeed;

SetLockMode (ELockMode NewMode)


if ((LockMode != NewMode) && (Role != ROLE_Authority))
{
if (NewMode != LOCK_Locked)
PropagateLockState(NewMode, None);
else
PropagateLockState(NewMode, Target);
}
TimeLockSet = Level.Timeseconds;
LockMode = NewMode;

SimFinish


ServerGotoFinishFire();

bInProcess = False;
bFiring = False;

if ( bFlameOn )
{
StopFlame();
bFlameOn = False;
}

if (bHasMuzzleFlash)
EraseMuzzleFlashTexture();

if ( Owner.IsA('DeusExPlayer') && DeusExPlayer(Owner).bAutoReload )
{
if ( (SimClipCount >= ReloadCount) && CanReload() )
{
SimClipCount = 0;
bClientReadyToFire = False;
bInProcess = False;
if ((AmmoType.AmmoAmount == 0) && (AmmoName != AmmoNames[0]))
CycleAmmo();
ReloadAmmo();
}
}

if (Pawn(Owner) == None)
{
GotoState('SimIdle');
return;
}
if ( PlayerPawn(Owner) == None )
{
if ( (Pawn(Owner).bFire != 0) && (FRand() < RefireRate) )
ClientReFire(0);
else
GotoState('SimIdle');
return;
}
if ( Pawn(Owner).bFire != 0 )
ClientReFire(0);
else
GotoState('SimIdle');

SimGenerateBullet


if ( Role < ROLE_Authority )
{
if ((ClipCount < ReloadCount) && (ReloadCount != 0))
{
if ( AmmoType != None )
AmmoType.SimUseAmmo();

if ( bInstantHit )
TraceFire(currentAccuracy);
else
ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);

SimClipCount++;

if ( !Self.IsA('WeaponFlamethrower') )
ServerGenerateBullet();
}
else
GotoState('SimFinishFire');
}

SpawnBlood (Vector HitLocation, Vector HitNormal)


if ((DeusExMPGame(Level.Game) != None) && (!DeusExMPGame(Level.Game).bSpawnEffects))
return;

spawn(class'BloodSpurt',,,HitLocation+HitNormal);
spawn(class'BloodDrop',,,HitLocation+HitNormal);
if (FRand() < 0.5)
spawn(class'BloodDrop',,,HitLocation+HitNormal);

SpawnEffectSounds (Vector HitLocation, Vector HitNormal, Actor Other, float Damage)


if (bHandToHand)
{
// if we are hand to hand, play an appropriate sound
if (Other.IsA('DeusExDecoration'))
Owner.PlayOwnedSound(Misc3Sound, SLOT_None,,, 1024);
else if (Other.IsA('Pawn'))
Owner.PlayOwnedSound(Misc1Sound, SLOT_None,,, 1024);
else if (Other.IsA('BreakableGlass'))
Owner.PlayOwnedSound(sound'GlassHit1', SLOT_None,,, 1024);
else if (GetWallMaterial(HitLocation, HitNormal) == 'Glass')
Owner.PlayOwnedSound(sound'BulletProofHit', SLOT_None,,, 1024);
else
Owner.PlayOwnedSound(Misc2Sound, SLOT_None,,, 1024);
}

SpawnEffects (Vector HitLocation, Vector HitNormal, Actor Other, float Damage)


local TraceHitSpawner hitspawner;
local Name damageType;


damageType = WeaponDamageType();

if (bPenetrating)
{
if (bHandToHand)
{
hitspawner = Spawn(class'TraceHitHandSpawner',Other,,HitLocation,Rotator(HitNormal));
}
else
{
hitspawner = Spawn(class'TraceHitSpawner',Other,,HitLocation,Rotator(HitNormal));
}
}
else
{
if (bHandToHand)
{
hitspawner = Spawn(class'TraceHitHandNonPenSpawner',Other,,HitLocation,Rotator(HitNormal));
}
else
{
hitspawner = Spawn(class'TraceHitNonPenSpawner',Other,,HitLocation,Rotator(HitNormal));
}
}
if (hitSpawner != None)
{
hitspawner.HitDamage = Damage;
hitSpawner.damageType = damageType;
}
if (bHandToHand)
{
// if we are hand to hand, play an appropriate sound
if (Other.IsA('DeusExDecoration'))
Owner.PlaySound(Misc3Sound, SLOT_None,,, 1024);
else if (Other.IsA('Pawn'))
Owner.PlaySound(Misc1Sound, SLOT_None,,, 1024);
else if (Other.IsA('BreakableGlass'))
Owner.PlaySound(sound'GlassHit1', SLOT_None,,, 1024);
else if (GetWallMaterial(HitLocation, HitNormal) == 'Glass')
Owner.PlaySound(sound'BulletProofHit', SLOT_None,,, 1024);
else
Owner.PlaySound(Misc2Sound, SLOT_None,,, 1024);
}

StartFlame


flameShotCount = 0;
bFlameOn = True;
GotoState('FlameThrowerOn');

StopFlame


bFlameOn = False;

SwapMuzzleFlashTexture


if (!bHasMuzzleFlash)
return;
if (FRand() < 0.5)
MultiSkins[2] = Texture'FlatFXTex34';
else
MultiSkins[2] = Texture'FlatFXTex37';

MuzzleFlashLight();
SetTimer(0.1, False);

TestMPBeltSpot (int BeltSpot) -> bool


return ((BeltSpot <= 3) && (BeltSpot >= 1));

Tick (float deltaTime)


local vector loc;
local rotator rot;
local float beepspeed, recoil;
local DeusExPlayer player;
local Actor RealTarget;
local Pawn pawn;


player = DeusExPlayer(Owner);
pawn = Pawn(Owner);

Super.Tick(deltaTime);

// don't do any of this if this weapon isn't currently in use
if (pawn == None)
{
LockMode = LOCK_None;
MaintainLockTimer = 0;
LockTarget = None;
LockTimer = 0;
return;
}

if (pawn.Weapon != self)
{
LockMode = LOCK_None;
MaintainLockTimer = 0;
LockTarget = None;
LockTimer = 0;
return;
}

// all this should only happen IF you have ammo loaded
if (ClipCount < ReloadCount)
{
// check for LAM or other placed mine placement
if (bHandToHand && (ProjectileClass != None) && (!Self.IsA('WeaponShuriken')))
{
if (NearWallCheck())
{
if (( Level.NetMode != NM_Standalone ) && IsAnimating() && (AnimSequence == 'Select'))
{
}
else
{
if (!bNearWall || (AnimSequence == 'Select'))
{
PlayAnim('PlaceBegin',, 0.1);
bNearWall = True;
}
}
}
else
{
if (bNearWall)
{
PlayAnim('PlaceEnd',, 0.1);
bNearWall = False;
}
}
}


SoundTimer += deltaTime;

if ( (Level.Netmode == NM_Standalone) || ( (Player != None) && (Player.PlayerIsClient()) ) )
{
if (bCanTrack)
{
Target = AcquireTarget();
RealTarget = Target;

// calculate the range
if (Target != None)
TargetRange = Abs(VSize(Target.Location - Location));

// update our timers
//SoundTimer += deltaTime;
MaintainLockTimer -= deltaTime;

// check target and range info to see what our mode is
if ((Target == None) || IsInState('Reload'))
{
if (MaintainLockTimer <= 0)
{
SetLockMode(LOCK_None);
MaintainLockTimer = 0;
LockTarget = None;
}
else if (LockMode == LOCK_Locked)
{
Target = LockTarget;
}
}
else if ((Target != LockTarget) && (Target.IsA('Pawn')) && (LockMode == LOCK_Locked))
{
SetLockMode(LOCK_None);
LockTarget = None;
}
else if (!Target.IsA('Pawn'))
{
if (MaintainLockTimer <=0 )
{
SetLockMode(LOCK_Invalid);
}
}
else if ( (Target.IsA('DeusExPlayer')) && (Target.Style == STY_Translucent) )
{
//DEUS_EX AMSD Don't allow locks on cloaked targets.
SetLockMode(LOCK_Invalid);
}
else if ( (Target.IsA('DeusExPlayer')) && (Player.DXGame.IsA('TeamDMGame')) && (TeamDMGame(Player.DXGame).ArePlayersAllied(Player,DeusExPlayer(Target))) )
{
//DEUS_EX AMSD Don't allow locks on allies.
SetLockMode(LOCK_Invalid);
}
else
{
if (TargetRange > MaxRange)
{
SetLockMode(LOCK_Range);
}
else
{
// change LockTime based on skill
// -0.7 = max skill
// DEUS_EX AMSD Only do weaponskill check here when first checking.
if (LockTimer == 0)
{
LockTime = FMax(Default.LockTime + 3.0 * GetWeaponSkill(), 0.0);
if ((Level.Netmode != NM_Standalone) && (LockTime < 0.25))
LockTime = 0.25;
}

LockTimer += deltaTime;
if (LockTimer >= LockTime)
{
SetLockMode(LOCK_Locked);
}
else
{
SetLockMode(LOCK_Acquire);
}
}
}

// act on the lock mode
switch (LockMode)
{
case LOCK_None:
TargetMessage = msgNone;
LockTimer -= deltaTime;
break;

case LOCK_Invalid:
TargetMessage = msgLockInvalid;
LockTimer -= deltaTime;
break;

case LOCK_Range:
TargetMessage = msgLockRange @ Int(TargetRange/16) @ msgRangeUnit;
LockTimer -= deltaTime;
break;

case LOCK_Acquire:
TargetMessage = msgLockAcquire @ Left(String(LockTime-LockTimer), 4) @ msgTimeUnit;
beepspeed = FClamp((LockTime - LockTimer) / Default.LockTime, 0.2, 1.0);
if (SoundTimer > beepspeed)
{
Owner.PlaySound(TrackingSound, SLOT_None);
SoundTimer = 0;
}
break;

case LOCK_Locked:
// If maintaining a lock, or getting a new one, increment maintainlocktimer
if ((RealTarget != None) && ((RealTarget == LockTarget) || (LockTarget == None)))
{
if (Level.NetMode != NM_Standalone)
MaintainLockTimer = default.MaintainLockTimer;
else
MaintainLockTimer = 0;
LockTarget = Target;
}
TargetMessage = msgLockLocked @ Int(TargetRange/16) @ msgRangeUnit;
// DEUS_EX AMSD Moved out so server can play it so that client knows for sure when locked.
/*if (SoundTimer > 0.1)
{
Owner.PlaySound(LockedSound, SLOT_None);
SoundTimer = 0;
}*/
break;
}
}
else
{
LockMode = LOCK_None;
TargetMessage = msgNone;
LockTimer = 0;
MaintainLockTimer = 0;
LockTarget = None;
}

if (LockTimer < 0)
LockTimer = 0;
}
}
else
{
LockMode = LOCK_None;
TargetMessage=msgNone;
MaintainLockTimer = 0;
LockTarget = None;
LockTimer = 0;
}

if ((LockMode == LOCK_Locked) && (SoundTimer > 0.1) && (Role == ROLE_Authority))
{
PlayLockSound();
SoundTimer = 0;
}

currentAccuracy = CalculateAccuracy();

if (player != None)
{
// reduce the recoil based on skill
recoil = recoilStrength + GetWeaponSkill() * 2.0;
if (recoil < 0.0)
recoil = 0.0;

// simulate recoil while firing
if (bFiring && IsAnimating() && (AnimSequence == 'Shoot') && (recoil > 0.0))
{
player.ViewRotation.Yaw += deltaTime * (Rand(4096) - 2048) * recoil;
player.ViewRotation.Pitch += deltaTime * (Rand(4096) + 4096) * recoil;
if ((player.ViewRotation.Pitch > 16384) && (player.ViewRotation.Pitch < 32768))
player.ViewRotation.Pitch = 16384;
}
}

// if were standing still, increase the timer
if (VSize(Owner.Velocity) < 10)
standingTimer += deltaTime;
else // otherwise, decrease it slowly based on velocity
standingTimer = FMax(0, standingTimer - 0.03*deltaTime*VSize(Owner.Velocity));

if (bLasing || bZoomed)
{
// shake our view to simulate poor aiming
if (ShakeTimer > 0.25)
{
ShakeYaw = currentAccuracy * (Rand(4096) - 2048);
ShakePitch = currentAccuracy * (Rand(4096) - 2048);
ShakeTimer -= 0.25;
}

ShakeTimer += deltaTime;

if (bLasing && (Emitter != None))
{
loc = Owner.Location;
loc.Z += Pawn(Owner).BaseEyeHeight;

// add a little random jitter - looks cool!
rot = Pawn(Owner).ViewRotation;
rot.Yaw += Rand(5) - 2;
rot.Pitch += Rand(5) - 2;

Emitter.SetLocation(loc);
Emitter.SetRotation(rot);
}

if ((player != None) && bZoomed)
{
player.ViewRotation.Yaw += deltaTime * ShakeYaw;
player.ViewRotation.Pitch += deltaTime * ShakePitch;
}
}

Timer


PlayIdleAnim();

TraceFire (float Accuracy)


local vector HitLocation, HitNormal, StartTrace, EndTrace, X, Y, Z;
local Rotator rot;
local actor Other;
local float dist, alpha, degrade;
local int i, numSlugs;
local float volume, radius;


// make noise if we are not silenced
if (!bHasSilencer && !bHandToHand)
{
GetAIVolume(volume, radius);
Owner.AISendEvent('WeaponFire', EAITYPE_Audio, volume, radius);
Owner.AISendEvent('LoudNoise', EAITYPE_Audio, volume, radius);
if (!Owner.IsA('PlayerPawn'))
Owner.AISendEvent('Distress', EAITYPE_Audio, volume, radius);
}

GetAxes(Pawn(owner).ViewRotation,X,Y,Z);
StartTrace = ComputeProjectileStart(X, Y, Z);
AdjustedAim = pawn(owner).AdjustAim(1000000, StartTrace, 2.75*AimError, False, False);

// check to see if we are a shotgun-type weapon
if (AreaOfEffect == AOE_Cone)
numSlugs = 5;
else
numSlugs = 1;

// if there is a scope, but the player isn't using it, decrease the accuracy
// so there is an advantage to using the scope
if (bHasScope && !bZoomed)
Accuracy += 0.2;
// if the laser sight is on, make this shot dead on
// also, if the scope is on, zero the accuracy so the shake makes the shot inaccurate
else if (bLasing || bZoomed)
Accuracy = 0.0;


for (i=0; i {
// If we have multiple slugs, then lower our accuracy a bit after the first slug so the slugs DON'T all go to the same place
if ((i > 0) && (Level.NetMode != NM_Standalone) && !(bHandToHand))
if (Accuracy < MinSpreadAcc)
Accuracy = MinSpreadAcc;

// Let handtohand weapons have a better swing
if ((bHandToHand) && (NumSlugs > 1) && (Level.NetMode != NM_Standalone))
{
StartTrace = ComputeProjectileStart(X,Y,Z);
StartTrace = StartTrace + (numSlugs/2 - i) * SwingOffset;
}

EndTrace = StartTrace + Accuracy * (FRand()-0.5)*Y*1000 + Accuracy * (FRand()-0.5)*Z*1000 ;
EndTrace += (FMax(1024.0, MaxRange) * vector(AdjustedAim));

Other = Pawn(Owner).TraceShot(HitLocation,HitNormal,EndTrace,StartTrace);

// randomly draw a tracer for relevant ammo types
// don't draw tracers if we're zoomed in with a scope - looks stupid
// DEUS_EX AMSD In multiplayer, draw tracers all the time.
if ( ((Level.NetMode == NM_Standalone) && (!bZoomed && (numSlugs == 1) && (FRand() < 0.5))) ||
((Level.NetMode != NM_Standalone) && (Role == ROLE_Authority) && (numSlugs == 1)) )
{
if ((AmmoName == Class'Ammo10mm') || (AmmoName == Class'Ammo3006') ||
(AmmoName == Class'Ammo762mm'))
{
if (VSize(HitLocation - StartTrace) > 250)
{
rot = Rotator(EndTrace - StartTrace);
if ((Level.NetMode != NM_Standalone) && (Self.IsA('WeaponRifle')))
Spawn(class'SniperTracer',,, StartTrace + 96 * Vector(rot), rot);
else
Spawn(class'Tracer',,, StartTrace + 96 * Vector(rot), rot);
}
}
}

// check our range
dist = Abs(VSize(HitLocation - Owner.Location));

if (dist <= AccurateRange) // we hit just fine
ProcessTraceHit(Other, HitLocation, HitNormal, vector(AdjustedAim),Y,Z);
else if (dist <= MaxRange)
{
// simulate gravity by lowering the bullet's hit point
// based on the owner's distance from the ground
alpha = (dist - AccurateRange) / (MaxRange - AccurateRange);
degrade = 0.5 * Square(alpha);
HitLocation.Z += degrade * (Owner.Location.Z - Owner.CollisionHeight);
ProcessTraceHit(Other, HitLocation, HitNormal, vector(AdjustedAim),Y,Z);
}
}

// otherwise we don't hit the target at all

TravelPostAccept


local int i;


Super.TravelPostAccept();

// make sure the AmmoName matches the currently loaded AmmoType
if (AmmoType != None)
AmmoName = AmmoType.Class;

if (!bInstantHit)
{
if (ProjectileClass != None)
ProjectileSpeed = ProjectileClass.Default.speed;

// make sure the projectile info matches the actual AmmoType
// since we can't "var travel class" (AmmoName and ProjectileClass)
if (AmmoType != None)
{
FireSound = None;
for (i=0; i {
if (AmmoNames[i] == AmmoName)
{
ProjectileClass = ProjectileNames[i];
break;
}
}
}
}

UpdateAmmoInfo (Object winObject, Class ammoClass)


local PersonaInventoryInfoWindow winInfo;
local string str;
local int i;


winInfo = PersonaInventoryInfoWindow(winObject);
if (winInfo == None)
return;

// Ammo loaded
if ((AmmoName != class'AmmoNone') && (!bHandToHand) && (ReloadCount != 0))
winInfo.UpdateAmmoLoaded(AmmoType.itemName);

// ammo info
if ((AmmoName == class'AmmoNone') || bHandToHand || (ReloadCount == 0))
str = msgInfoNA;
else
str = AmmoName.Default.ItemName;
for (i=0; i if ((AmmoNames[i] != None) && (AmmoNames[i] != AmmoName))
str = str $ "|n" $ AmmoNames[i].Default.ItemName;

winInfo.UpdateAmmoTypes(str);

// If this weapon has ammo info, display it here
if (ammoClass != None)
winInfo.UpdateAmmoDescription(ammoClass.Default.ItemName $ "|n" $ ammoClass.Default.description);

UpdateInfo (Object winObject) -> bool


local PersonaInventoryInfoWindow winInfo;
local string str;
local int i, dmg;
local float mod;
local bool bHasAmmo;
local bool bAmmoAvailable;
local class ammoClass;
local Pawn P;
local Ammo weaponAmmo;
local int ammoAmount;


P = Pawn(Owner);
if (P == None)
return False;

winInfo = PersonaInventoryInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.SetTitle(itemName);
winInfo.SetText(msgInfoWeaponStats);
winInfo.AddLine();

// Create the ammo buttons. Start with the AmmoNames[] array,
// which is used for weapons that can use more than one
// type of ammo.

if (AmmoNames[0] != None)
{
for (i=0; i {
if (AmmoNames[i] != None)
{
// Check to make sure the player has this ammo type
// *and* that the ammo isn't empty
weaponAmmo = Ammo(P.FindInventoryType(AmmoNames[i]));

if (weaponAmmo != None)
{
ammoAmount = weaponAmmo.AmmoAmount;
bHasAmmo = (weaponAmmo.AmmoAmount > 0);
}
else
{
ammoAmount = 0;
bHasAmmo = False;
}

winInfo.AddAmmo(AmmoNames[i], bHasAmmo, ammoAmount);
bAmmoAvailable = True;

if (AmmoNames[i] == AmmoName)
{
winInfo.SetLoaded(AmmoName);
ammoClass = class(AmmoName);
}
}
}
}
else
{
// Now peer at the AmmoName variable, but only if the AmmoNames[]
// array is empty
if ((AmmoName != class'AmmoNone') && (!bHandToHand) && (ReloadCount != 0))
{
weaponAmmo = Ammo(P.FindInventoryType(AmmoName));

if (weaponAmmo != None)
{
ammoAmount = weaponAmmo.AmmoAmount;
bHasAmmo = (weaponAmmo.AmmoAmount > 0);
}
else
{
ammoAmount = 0;
bHasAmmo = False;
}

winInfo.AddAmmo(AmmoName, bHasAmmo, ammoAmount);
winInfo.SetLoaded(AmmoName);
ammoClass = class(AmmoName);
bAmmoAvailable = True;
}
}

// Only draw another line if we actually displayed ammo.
if (bAmmoAvailable)
winInfo.AddLine();

// Ammo loaded
if ((AmmoName != class'AmmoNone') && (!bHandToHand) && (ReloadCount != 0))
winInfo.AddAmmoLoadedItem(msgInfoAmmoLoaded, AmmoType.itemName);

// ammo info
if ((AmmoName == class'AmmoNone') || bHandToHand || (ReloadCount == 0))
str = msgInfoNA;
else
str = AmmoName.Default.ItemName;
for (i=0; i if ((AmmoNames[i] != None) && (AmmoNames[i] != AmmoName))
str = str $ "|n" $ AmmoNames[i].Default.ItemName;

winInfo.AddAmmoTypesItem(msgInfoAmmo, str);

// base damage
if (AreaOfEffect == AOE_Cone)
{
if (bInstantHit)
{
if (Level.NetMode != NM_Standalone)
dmg = Default.mpHitDamage * 5;
else
dmg = Default.HitDamage * 5;
}
else
{
if (Level.NetMode != NM_Standalone)
dmg = Default.mpHitDamage * 3;
else
dmg = Default.HitDamage * 3;
}
}
else
{
if (Level.NetMode != NM_Standalone)
dmg = Default.mpHitDamage;
else
dmg = Default.HitDamage;
}

str = String(dmg);
mod = 1.0 - GetWeaponSkill();
if (mod != 1.0)
{
str = str @ BuildPercentString(mod - 1.0);
str = str @ "=" @ FormatFloatString(dmg * mod, 1.0);
}

winInfo.AddInfoItem(msgInfoDamage, str, (mod != 1.0));

// clip size
if ((Default.ReloadCount == 0) || bHandToHand)
str = msgInfoNA;
else
{
if ( Level.NetMode != NM_Standalone )
str = Default.mpReloadCount @ msgInfoRounds;
else
str = Default.ReloadCount @ msgInfoRounds;
}

if (HasClipMod())
{
str = str @ BuildPercentString(ModReloadCount);
str = str @ "=" @ ReloadCount @ msgInfoRounds;
}

winInfo.AddInfoItem(msgInfoClip, str, HasClipMod());

// rate of fire
if ((Default.ReloadCount == 0) || bHandToHand)
{
str = msgInfoNA;
}
else
{
if (bAutomatic)
str = msgInfoAuto;
else
str = msgInfoSingle;

str = str $ "," @ FormatFloatString(1.0/Default.ShotTime, 0.1) @ msgInfoRoundsPerSec;
}
winInfo.AddInfoItem(msgInfoROF, str);

// reload time
if ((Default.ReloadCount == 0) || bHandToHand)
str = msgInfoNA;
else
{
if (Level.NetMode != NM_Standalone )
str = FormatFloatString(Default.mpReloadTime, 0.1) @ msgTimeUnit;
else
str = FormatFloatString(Default.ReloadTime, 0.1) @ msgTimeUnit;
}

if (HasReloadMod())
{
str = str @ BuildPercentString(ModReloadTime);
str = str @ "=" @ FormatFloatString(ReloadTime, 0.1) @ msgTimeUnit;
}

winInfo.AddInfoItem(msgInfoReload, str, HasReloadMod());

// recoil
str = FormatFloatString(Default.recoilStrength, 0.01);
if (HasRecoilMod())
{
str = str @ BuildPercentString(ModRecoilStrength);
str = str @ "=" @ FormatFloatString(recoilStrength, 0.01);
}

winInfo.AddInfoItem(msgInfoRecoil, str, HasRecoilMod());

// base accuracy (2.0 = 0%, 0.0 = 100%)
if ( Level.NetMode != NM_Standalone )
{
str = Int((2.0 - Default.mpBaseAccuracy)*50.0) $ "%";
mod = (Default.mpBaseAccuracy - (BaseAccuracy + GetWeaponSkill())) * 0.5;
if (mod != 0.0)
{
str = str @ BuildPercentString(mod);
str = str @ "=" @ Min(100, Int(100.0*mod+(2.0 - Default.mpBaseAccuracy)*50.0)) $ "%";
}
}
else
{
str = Int((2.0 - Default.BaseAccuracy)*50.0) $ "%";
mod = (Default.BaseAccuracy - (BaseAccuracy + GetWeaponSkill())) * 0.5;
if (mod != 0.0)
{
str = str @ BuildPercentString(mod);
str = str @ "=" @ Min(100, Int(100.0*mod+(2.0 - Default.BaseAccuracy)*50.0)) $ "%";
}
}
winInfo.AddInfoItem(msgInfoAccuracy, str, (mod != 0.0));

// accurate range
if (bHandToHand)
str = msgInfoNA;
else
{
if ( Level.NetMode != NM_Standalone )
str = FormatFloatString(Default.mpAccurateRange/16.0, 1.0) @ msgRangeUnit;
else
str = FormatFloatString(Default.AccurateRange/16.0, 1.0) @ msgRangeUnit;
}

if (HasRangeMod())
{
str = str @ BuildPercentString(ModAccurateRange);
str = str @ "=" @ FormatFloatString(AccurateRange/16.0, 1.0) @ msgRangeUnit;
}
winInfo.AddInfoItem(msgInfoAccRange, str, HasRangeMod());

// max range
if (bHandToHand)
str = msgInfoNA;
else
{
if ( Level.NetMode != NM_Standalone )
str = FormatFloatString(Default.mpMaxRange/16.0, 1.0) @ msgRangeUnit;
else
str = FormatFloatString(Default.MaxRange/16.0, 1.0) @ msgRangeUnit;
}
winInfo.AddInfoItem(msgInfoMaxRange, str);

// mass
winInfo.AddInfoItem(msgInfoMass, FormatFloatString(Default.Mass, 1.0) @ msgMassUnit);

// laser mod
if (bCanHaveLaser)
{
if (bHasLaser)
str = msgInfoYes;
else
str = msgInfoNo;
}
else
{
str = msgInfoNA;
}
winInfo.AddInfoItem(msgInfoLaser, str, bCanHaveLaser && bHasLaser && (Default.bHasLaser != bHasLaser));

// scope mod
if (bCanHaveScope)
{
if (bHasScope)
str = msgInfoYes;
else
str = msgInfoNo;
}
else
{
str = msgInfoNA;
}
winInfo.AddInfoItem(msgInfoScope, str, bCanHaveScope && bHasScope && (Default.bHasScope != bHasScope));

// silencer mod
if (bCanHaveSilencer)
{
if (bHasSilencer)
str = msgInfoYes;
else
str = msgInfoNo;
}
else
{
str = msgInfoNA;
}
winInfo.AddInfoItem(msgInfoSilencer, str, bCanHaveSilencer && bHasSilencer && (Default.bHasSilencer != bHasSilencer));

// Governing Skill
winInfo.AddInfoItem(msgInfoSkill, GoverningSkill.default.SkillName);

winInfo.AddLine();
winInfo.SetText(Description);

// If this weapon has ammo info, display it here
if (ammoClass != None)
{
winInfo.AddLine();
winInfo.AddAmmoDescription(ammoClass.Default.ItemName $ "|n" $ ammoClass.Default.description);
}

return True;

WeaponDamageType -> name


local name damageType;
local Class projClass;


projClass = Class(ProjectileClass);
if (bInstantHit)
{
if (StunDuration > 0)
damageType = 'Stunned';
else
damageType = 'Shot';

if (AmmoType != None)
if (AmmoType.IsA('AmmoSabot'))
damageType = 'Sabot';
}
else if (projClass != None)
damageType = projClass.Default.damageType;
else
damageType = 'None';

return (damageType);




DirectionalTrigger.uc (extends Trigger)

ReTriggerDelay=1.000000
bDirectional=True

Touch (Actor Other)


local Vector X, Y, Z;
local float dotp;
local bool bDoIt;


bDoIt = True;

// should we even pay attention to this actor?
if (!IsRelevant(Other))
return;

if (Other != None)
{
GetAxes(Rotation, X, Y, Z);
dotp = (Location - Other.Location) dot X;

// if we're on the wrong side of the trigger, then don't trigger it
if (dotp > 0.0)
bDoIt = False;
}

if (bDoIt)
Super.Touch(Other);




Doberman.uc (extends Dog)

CarcassType=Class'DeusEx.DobermanCarcass'
WalkingSpeed=0.200000
GroundSpeed=250.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
Health=20
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
HitSound1=Sound'DeusExSounds.Animal.DogLargeGrowl'
HitSound2=Sound'DeusExSounds.Animal.DogLargeBark1'
Die=Sound'DeusExSounds.Animal.DogLargeDie'
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Doberman'
CollisionRadius=30.000000
CollisionHeight=28.000000
Mass=25.000000
BindName="Doberman"
FamiliarName="Doberman"
UnfamiliarName="Doberman"

PlayDogBark


if (FRand() < 0.5)
PlaySound(sound'DogLargeBark2', SLOT_None);
else
PlaySound(sound'DogLargeBark3', SLOT_None);




DobermanCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.DobermanCarcass'
Mesh3=LodMesh'DeusExCharacters.DobermanCarcass'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.DobermanCarcass'
CollisionRadius=30.000000



Doctor.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.DoctorCarcass'
WalkingSpeed=0.213333
BaseAssHeight=-23.000000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.DoctorTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.DoctorTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.DoctorTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Doctor"
FamiliarName="Doctor"
UnfamiliarName="Doctor"



DoctorCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.DoctorTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.DoctorTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.DoctorTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'



Dog.uc (extends Animal)

var float time;
bPlayDying=True
MinHealth=2.000000
InitialAlliances(7)=(AllianceName=Cat,AllianceLevel=-1.000000)
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponDogBite')
BaseEyeHeight=12.500000
Alliance=Dog
Buoyancy=97.000000

PlayAttack


PlayAnimPivot('Attack');

PlayBarking


PlayAnimPivot('Bark');

PlayDogBark


// overridden in subclasses

PlayTakingHit (EHitLocation hitPos)


// nil

Tick (float deltaTime)


Super.Tick(deltaTime);

time += deltaTime;

// check for random noises
if (time > 1.0)
{
time = 0;
if (FRand() < 0.05)
PlayDogBark();
}

TweenToAttack (float tweentime)


TweenAnimPivot('Attack', tweentime);




DumpLocation.uc (extends Object)

var bool bDeleted;
var int LocationID;
var String MapName;
var Vector Location;
var Rotator ViewRotation;
var String GameVersion;
var String Title;
var String Desc;
var native int currentDumpFileLocation;
var native DumpLocationstruct currentDumpLocation;
var native array dumpFileDirectory;
var native int currentDumpFileIndex;
var native int currentDumpLocationIndex;
var native String currentUser;
var native int dumpFile;
var native int dumpLocationCount;
var native DeusExPlayer player;

AddDumpFileLocation (String filename, String newTitle, String newDescription) | native

CloseDumpFile | native

DeleteDumpFile (String filename) | native

DeleteDumpFileLocation (Int dumpLocationID) | native

GetCurrentUser | native

GetDumpFileCount | native

GetDumpFileIndex | native

GetDumpFileLocationCount (String filename) | native

GetDumpFileLocationInfo | native

GetDumpLocationIndex | native

GetFirstDumpFile | native

GetFirstDumpFileLocation | native

GetNextDumpFile | native

GetNextDumpFileLocation | native

GetNextDumpFileLocationID | native

HasLocationBeenSaved | native

LoadLocation | native

OpenDumpFile (String filename) | native

SaveLocation | native

SelectDumpFileLocation (Int dumpLocationID) | native

SetPlayer (DeusExPlayer newPlayer) | native




DumpLocationBaseWindow.uc (extends ToolWindow)

var DumpLocation dumpLoc;
var Bool bSaveDumpLocation;

CreateControls

CreateDumpLoc -> DumpLocation


local DumpLocation newDumpLoc;


if (player != None)
{
// Create our DumpLocation object
newDumpLoc = player.CreateDumpLocationObject();
newDumpLoc.SetPlayer(player);
}

return newDumpLoc;

DestroyDumpLoc


if (dumpLoc != None)
{
CriticalDelete(dumpLoc);
dumpLoc = None;
}

DestroyWindow


if (!bSaveDumpLocation)
DestroyDumpLoc();

EnableButtons

InitWindow


Super.InitWindow();

dumpLoc = CreateDumpLoc();

// Create the controls
CreateControls();

EnableButtons();




DumpLocationEditWindow.uc (extends DumpLocationBaseWindow)

var ToolButtonWindow btnSubmit;
var ToolButtonWindow btnCancel;
var ToolEditWindow editID;
var ToolEditWindow editMapName;
var ToolEditWindow editGameVersion;
var ToolEditWindow editUser;
var ToolEditWindow editLocation;
var ToolEditWindow editViewRotation;
var ToolEditWindow editTitle;
var ToolEditWindow editDescription;
var EEditMode dumpEditMode;
var String username;

BoxOptionSelected (Window msgBoxWindow, int buttonNumber) -> bool


// Nuke the msgbox
root.PopWindow();
root.PopWindow();
return true;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnSubmit:
SubmitDump();
break;

case btnCancel:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated( buttonPressed );

return bHandled;

CreateControls


// Edit Controls
CreateToolLabel(16, 33, "Dump Location ID:");
editID = CreateToolEditWindow(16, 48, 160, 64);
editID.SetSensitivity(False);

CreateToolLabel(16, 73, "Map Name:");
editMapName = CreateToolEditWindow(16, 88, 160, 64);
editMapName.SetSensitivity(False);

CreateToolLabel(16, 113, "User:");
editUser = CreateToolEditWindow(16, 128, 160, 32);
editUser.SetSensitivity(False);

CreateToolLabel(200, 33, "Game Version:");
editGameVersion = CreateToolEditWindow(200, 48, 205, 64);
editGameVersion.SetSensitivity(False);

CreateToolLabel(200, 73, "Player Location:");
editLocation = CreateToolEditWindow(200, 88, 205, 64);
editLocation.SetSensitivity(False);

CreateToolLabel(200, 113, "Player View Rotation:");
editViewRotation = CreateToolEditWindow(200, 128, 205, 64);
editViewRotation.SetSensitivity(False);

CreateToolLabel(16, 153, "Title:");
editTitle = CreateToolEditWindow(16, 168, 410, 128);

CreateToolLabel(16, 193, "Description:");
editDescription = CreateToolEditWindow(16, 208, 410, 2047, 150);
editDescription.EnableSingleLineEditing(False);
editDescription.SetTextAlignments(HAlign_Left, VAlign_Top);

// Buttons
btnSubmit = CreateToolButton(350, 370, "|&Submit");
btnCancel = CreateToolButton(270, 370, "|&Cancel");

DisplayLevelInfoError


root.ToolMessageBox(
"DeusExLevelInfo Not Found!",
"This map does NOT contain a DeusExLevelInfo object. DumpLocation will not work if this object is missing.",
1, True, Self);

DisplayUserError


root.ToolMessageBox(
"CurrentUser not defined!",
"The CurrentUser setting in your User.ini file is not valid. Please fix this before trying to use the DumpLocation functionality.",
1, True, Self);

EnableButtons


if (dumpEditMode == EM_Edit)
btnSubmit.SetSensitivity(False);
else if (Len(editTitle.GetText()) > 0)
btnSubmit.SetSensitivity(True);

GetLocationString (Vector inLocation) -> String


return "X=" $ String(inLocation.x) $
", Y=" $ String(inLocation.y) $
", Z=" $ String(inLocation.z);

GetViewRotationString (Rotator inRotator) -> String


return "pitch=" $ String(inRotator.pitch) $
", yaw=" $ String(inRotator.yaw) $
", roll=" $ String(inRotator.roll);

InitWindow


Super.InitWindow();

// Center this window
SetSize(444, 410);
SetTitle("Add Dump Location");

SetAddMode (optional String newUsername) -> bool


local DeusExLevelInfo dxInfo;


username = newUsername;
dumpEditMode = EM_Add;

// Attempt to open the appropriate file
if (dumpLoc.OpenDumpFile(dumpLoc.GetCurrentUser()) == False)
return False;

foreach player.AllActors(class'DeusExLevelInfo', dxInfo)
break;

if (dxInfo != None)
{
// Setup the fields with default values.
editID.SetText(String(dumpLoc.GetNextDumpFileLocationID()));
editMapName.SetText(dxInfo.mapName);
editGameVersion.SetText(player.GetDeusExVersion());
editUser.SetText(dumpLoc.GetCurrentUser());
editLocation.SetText(GetLocationString(player.Location));
editViewRotation.SetText(GetViewRotationString(player.ViewRotation));

btnCancel.SetButtonText("Cancel");

}
else
{
DisplayLevelInfoError();
}

SetEditMode (String newUsername, int locationID) -> bool


username = newUsername;
dumpEditMode = EM_Edit;

// Attempt to load the info from disk
if (dumpLoc.OpenDumpFile(username) == False)
return False;

if (dumpLoc.SelectDumpFileLocation(locationID) == False)
return False;

editID.SetText(String(locationID));
editMapName.SetText(dumpLoc.currentDumpLocation.MapName);
editGameVersion.SetText(dumpLoc.currentDumpLocation.GameVersion);
editUser.SetText(newUsername);
editLocation.SetText(GetLocationString(dumpLoc.currentDumpLocation.Location));
editViewRotation.SetText(GetViewRotationString(dumpLoc.currentDumpLocation.ViewRotation));
editTitle.SetText(dumpLoc.currentDumpLocation.Title);
editDescription.SetText(dumpLoc.currentDumpLocation.Desc);

// Make the Title and Desc fields read only
editTitle.SetSensitivity(False);
editDescription.SetSensitivity(False);

btnCancel.SetButtonText("Close");

SubmitDump


dumpLoc.AddDumpFileLocation(dumpLoc.GetCurrentUser(), editTitle.GetText(), editDescription.GetText());
root.PopWindow();

TextChanged (window edit, bool bModified) -> bool


EnableButtons();

return false;

VisibilityChanged (bool bNewVisibility)


Super.VisibilityChanged(bNewVisibility);

// Check to make sure the currentUser variable is set.
if ((dumpLoc != None) && (dumpLoc.CurrentUser == ""))
{
DisplayUserError();
DestroyDumpLoc();
}




DumpLocationListLocationsWindow.uc (extends DumpLocationBaseWindow)

var ToolButtonWindow btnView;
var ToolButtonWindow btnDetails;
var ToolButtonWindow btnDelete;
var ToolButtonWindow btnFiles;
var ToolButtonWindow btnCancel;
var ToolListWindow lstLocs;
var String dumpFile;

BoxOptionSelected (Window msgBoxWindow, int buttonNumber) -> bool


// Nuke the msgbox
root.PopWindow();
root.PopWindow();
return true;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnView:
ViewDumpLocation();
break;

case btnDetails:
ViewLocationDetails();
break;

case btnDelete:
DeleteDumpLocation();
break;

case btnFiles:
root.PopWindow();
root.PushWindow(Class'DumpLocationListWindow', True);
break;

case btnCancel:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated( buttonPressed );

return bHandled;

CreateControls


// Buttons
btnView = CreateToolButton(430, 287, "|&View");
btnDetails = CreateToolButton(430, 312, "|&Details");
btnDelete = CreateToolButton(430, 337, "De|&lete");
btnFiles = CreateToolButton(430, 362, "|&Files");
btnCancel = CreateToolButton(430, 387, "|&Close");

CreateLocationsList();

CreateLocationsList


// Now create the List Window
lstLocs = CreateToolList(15, 38, 405, 372);
lstLocs.SetColumns(4);
lstLocs.EnableMultiSelect(False);
lstLocs.EnableAutoExpandColumns(True);

lstLocs.HideColumn(3);

DeleteDumpLocation


local int rowID;
local int rowIndex;


rowID = lstLocs.GetSelectedRow();

// Get the row index so we can highlight it after we delete this item
rowIndex = lstLocs.RowIdToIndex(rowID);

if (rowID > 0)
{
dumpLoc.DeleteDumpFileLocation(Int(lstLocs.GetField(rowID, 3)));

// Remove the row and select the next item
lstLocs.DeleteRow(rowID);

// Attempt to highlight the next row
if ( lstLocs.GetNumRows() > 0 )
{
if ( rowIndex >= lstLocs.GetNumRows() )
rowIndex = lstLocs.GetNumRows() - 1;

rowID = lstLocs.IndexToRowId(rowIndex);

lstLocs.SetRow(rowID);

EnableButtons();
}
else
{
root.PopWindow();
}
}

DisplayOpenFileError


root.ToolMessageBox(
"Error Opening File!",
"An error occured attempting to open the " $ dumpFile $ ".dmp file!",
1, False, Self);

EnableButtons


btnView.SetSensitivity(lstLocs.GetNumSelectedRows() > 0);
btnDetails.SetSensitivity(lstLocs.GetNumSelectedRows() > 0);
btnDelete.SetSensitivity(lstLocs.GetNumSelectedRows() > 0);

InitWindow


Super.InitWindow();

// Center this window
SetSize(520, 430);
SetTitle("Dump File Locations");

ListRowActivated (window list, int rowId) -> bool


ViewDumpLocation();
return TRUE;

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


EnableButtons();

PopulateLocationsList


local int locIndex;
local Bool locationFound;


if (dumpFile == "")
return;

lstLocs.DeleteAllRows();

if (dumpLoc.OpenDumpFile(dumpFile) == False)
{
DisplayOpenFileError();
return;
}

// Loop through all the Locations in this file

locationFound = dumpLoc.GetFirstDumpFileLocation();

while(locationFound)
{
locIndex = dumpLoc.GetDumpLocationIndex();

lstLocs.AddRow(
String(dumpLoc.currentDumpLocation.LocationID) $ ";" $
dumpLoc.currentDumpLocation.MapName $ ";" $
dumpLoc.currentDumpLocation.Title $ ";" $
dumpLoc.currentDumpLocation.LocationID);

locIndex++;
locationFound = dumpLoc.GetNextDumpFileLocation();
}

// Sort the maps by name
lstLocs.Sort();

EnableButtons();

SetDumpFile (String newDumpFile)


dumpFile = newDumpFile;

// Attempt to open the file

PopulateLocationsList();

ViewDumpLocation


local String mapName;
local Int locationID;
local DeusExPlayer localPlayer;
local DeusExLevelInfo dxInfo;


locationID = Int(lstLocs.GetField(lstLocs.GetSelectedRow(), 3));

if (dumpLoc.SelectDumpFileLocation(locationID) == False)
return;

dumpLoc.SaveLocation();
mapName = dumpLoc.currentDumpLocation.MapName;
localPlayer = player;

foreach player.AllActors(class'DeusExLevelInfo', dxInfo)
break;

// Make sure the map isn't already loaded to save time
if ((dxInfo != None) && (dxInfo.MapName == mapName))
{
dumpLoc.LoadLocation();
player.Ghost();
player.SetLocation(dumpLoc.currentDumpLocation.Location);
player.SetRotation(dumpLoc.currentDumpLocation.ViewRotation);
player.ViewRotation = dumpLoc.currentDumpLocation.ViewRotation;
player.ClientSetRotation(dumpLoc.currentDumpLocation.ViewRotation);
root.ClearWindowStack();
}
else
{
root.ClearWindowStack();
player.ConsoleCommand("Open" @ mapName $ "?loadonly");
}

ViewLocationDetails


local DumpLocationEditWindow winLocation;


winLocation = DumpLocationEditWindow(root.PushWindow(Class'DumpLocationEditWindow', True));
winLocation.SetEditMode(dumpFile, Int(lstLocs.GetField(lstLocs.GetSelectedRow(), 3)));

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;

bKeyHandled = True;

if ( IsKeyDown( IK_Alt ) || IsKeyDown( IK_Shift ) || IsKeyDown( IK_Ctrl ))
return False;

switch( key )
{
case IK_Delete:
DeleteDumpLocation();
break;

default:
bKeyHandled = False;
}

if ( !bKeyHandled )
return Super.VirtualKeyPressed(key, bRepeat);
else
return bKeyHandled;




DumpLocationListWindow.uc (extends DumpLocationBaseWindow)

var ToolButtonWindow btnOpen;
var ToolButtonWindow btnDelete;
var ToolButtonWindow btnCancel;
var ToolListWindow lstDumps;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnOpen:
OpenDumpFile();
break;

case btnDelete:
DeleteDumpFile();
break;

case btnCancel:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated( buttonPressed );

return bHandled;

CreateControls


// Flags list box
CreateDumpList();

// Buttons
btnOpen = CreateToolButton(280, 137, "|&Open");
btnDelete = CreateToolButton(280, 162, "|&Delete");
btnCancel = CreateToolButton(280, 187, "|&Close");

CreateDumpList


// Now create the List Window
lstDumps = CreateToolList(15, 38, 255, 172);
lstDumps.SetColumns(3);
lstDumps.EnableMultiSelect(False);
lstDumps.EnableAutoExpandColumns(True);
lstDumps.SetColumnWidth(0, 100);

lstDumps.SetColumnType(2, COLTYPE_Float);
lstDumps.HideColumn(2);

DeleteDumpFile


local int rowID;
local int rowIndex;


rowID = lstDumps.GetSelectedRow();

// Get the row index so we can highlight it after we delete this item
rowIndex = lstDumps.RowIdToIndex(rowID);

if (rowID > 0)
{
dumpLoc.DeleteDumpFile(lstDumps.GetField(RowID, 0));

// Remove the row and select the next item
lstDumps.DeleteRow(rowID);

// Attempt to highlight the next row
if ( lstDumps.GetNumRows() > 0 )
{
if ( rowIndex >= lstDumps.GetNumRows() )
rowIndex = lstDumps.GetNumRows() - 1;

rowID = lstDumps.IndexToRowId(rowIndex);

lstDumps.SetRow(rowID);

EnableButtons();
}
}

EnableButtons


btnOpen.SetSensitivity(lstDumps.GetNumSelectedRows() > 0);
btnDelete.SetSensitivity(lstDumps.GetNumSelectedRows() > 0);

InitWindow


Super.InitWindow();

// Center this window
SetSize(370, 230);
SetTitle("View Dump Files");

PopulateDumpList();

ListRowActivated (window list, int rowId) -> bool


OpenDumpFile();

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


EnableButtons();

OpenDumpFile (optional String dumpFilename)


local DumpLocationListLocationsWindow winLocations;


if (dumpFilename == "")
dumpFilename = lstDumps.GetField(lstDumps.GetSelectedRow(), 0);

winLocations = DumpLocationListLocationsWindow(root.PushWindow(Class'DumpLocationListLocationsWindow', True));
winLocations.SetDumpFile(dumpFilename);

PopulateDumpList


local int dumpIndex;
local String dumpFileName;


lstDumps.DeleteAllRows();

// Loop through all the files

dumpFileName = dumpLoc.GetFirstDumpFile();
dumpFileName = left(dumpFileName, len(dumpFileName) - 4);

while(dumpFileName != "")
{
dumpIndex = dumpLoc.GetDumpFileIndex();
lstDumps.AddRow( dumpFileName $ ";" $
String(dumpLoc.GetDumpFileLocationCount(dumpFileName)) $ ";" $
String(dumpIndex));
dumpFileName = dumpLoc.GetNextDumpFile();
dumpIndex++;
}

// Sort the maps by name
lstDumps.Sort();

EnableButtons();




EMPGrenade.uc (extends ThrownProjectile)

var float mpBlastRadius;
var float mpProxRadius;
var float mpEMPDamage;
var float mpFuselength;
mpBlastRadius=768.000000
mpProxRadius=128.000000
mpEMPDamage=200.000000
mpFuselength=1.500000
fuseLength=3.000000
proxRadius=128.000000
AISoundLevel=0.100000
bBlood=False
bDebris=False
DamageType=EMP
spawnWeaponClass=Class'DeusEx.WeaponEMPGrenade'
ItemName="Electromagnetic Pulse (EMP) Grenade"
speed=1000.000000
MaxSpeed=1000.000000
Damage=100.000000
MomentumTransfer=50000
ImpactSound=Sound'DeusExSounds.Weapons.EMPGrenadeExplode'
LifeSpan=0.000000
Mesh=LodMesh'DeusExItems.EMPGrenadePickup'
CollisionRadius=3.000000
CollisionHeight=1.900000
Mass=5.000000
Buoyancy=2.000000

DrawExplosionEffects (vector HitLocation, vector HitNormal)


local ExplosionLight light;
local int i;
local Rotator rot;
local SphereEffect sphere;
local ExplosionSmall expeffect;


// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, HitLocation);
if (light != None)
{
if (!bDamaged)
light.RemoteRole = ROLE_None;
light.size = 8;
light.LightHue = 128;
light.LightSaturation = 96;
light.LightEffect = LE_Shell;
}

expeffect = Spawn(class'ExplosionSmall',,, HitLocation);
if ((expeffect != None) && (!bDamaged))
expeffect.RemoteRole = ROLE_None;

// draw a cool light sphere
sphere = Spawn(class'SphereEffect',,, HitLocation);
if (sphere != None)
{
if (!bDamaged)
sphere.RemoteRole = ROLE_None;
sphere.size = blastRadius / 32.0;
}

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
blastRadius=mpBlastRadius;
proxRadius=mpProxRadius;
Damage=mpEMPDamage;
fuseLength=mpFuselength;
bIgnoresNanoDefense=True;
}




Earth.uc (extends OutdoorThings)

bStatic=False
Physics=PHYS_Rotating
Mesh=LodMesh'DeusExDeco.Earth'
CollisionRadius=48.000000
CollisionHeight=48.000000
bCollideActors=False
bCollideWorld=False
bFixedRotationDir=True
Mass=10.000000
Buoyancy=5.000000
RotationRate=(Yaw=-128)



EidosLogo.uc (extends OutdoorThings)

Texture=Texture'DeusExDeco.Skins.DXLogoTex1'
Mesh=Mesh'DeusExDeco.EidosLogo'
CollisionRadius=85.720001
CollisionHeight=15.940000
bCollideActors=False
bCollideWorld=False
bBlockActors=False
bBlockPlayers=False
Mass=5000.000000
Buoyancy=500.000000



ElectricityEmitter.uc (extends LaserEmitter)

var() float randomAngle; // random amount to change yaw/pitch
var() int damageAmount; // how much damage does this do?
var() float damageTime; // how often does this do damage?
var() texture beamTexture; // texture for beam
var() bool bInitiallyOn; // is this initially on?
var() bool bFlicker; // randomly flicker on and off?
var() float flickerTime; // how often to check for random flicker?
var() bool bEmitLight; // should I cast light, also?
var Actor lastHitActor;
var float lastDamageTime;
var float lastFlickerTime;
var bool bAlreadyInitialized; // has this item been init'ed yet?
randomAngle=8192.000000
DamageAmount=2
damageTime=0.200000
beamTexture=FireTexture'Effects.Electricity.Nano_SFX'
bInitiallyOn=True
bFlicker=True
flickerTime=0.020000
bEmitLight=True
bRandomBeam=True
bDirectional=True
DrawType=DT_Sprite
Texture=Texture'Engine.S_Inventory'
SoundRadius=64
AmbientSound=Sound'Ambient.Ambient.Electricity4'
LightBrightness=128
LightHue=150
LightSaturation=32
LightRadius=6

CalcTrace (float deltaTime)


local vector StartTrace, EndTrace, HitLocation, HitNormal, loc;
local Rotator rot;
local actor target;
local int texFlags;
local name texName, texGroup;


if (!bHiddenBeam)
{
// set up the random beam stuff
rot.Pitch = Int((0.5 - FRand()) * randomAngle);
rot.Yaw = Int((0.5 - FRand()) * randomAngle);
rot.Roll = Int((0.5 - FRand()) * randomAngle);

StartTrace = Location;
EndTrace = Location + 5000 * vector(Rotation + rot);
HitActor = None;

foreach TraceTexture(class'Actor', target, texName, texGroup, texFlags, HitLocation, HitNormal, EndTrace, StartTrace)
{
if ((target.DrawType == DT_None) || target.bHidden)
{
// do nothing - keep on tracing
}
else if ((target == Level) || target.IsA('Mover'))
{
break;
}
else
{
HitActor = target;
break;
}
}

lastDamageTime += deltaTime;

// shock whatever gets in the beam
if ((HitActor != None) && (lastDamageTime >= damageTime))
{
HitActor.TakeDamage(damageAmount, Instigator, HitLocation, vect(0,0,0), 'Shocked');
lastDamageTime = 0;
}

if (LaserIterator(RenderInterface) != None)
LaserIterator(RenderInterface).AddBeam(0, Location, Rotation + rot, VSize(Location - HitLocation));
}

PostPostBeginPlay


Super.PostPostBeginPlay();

if (bAlreadyInitialized)
return;

if (proxy != None)
proxy.Skin = beamTexture;

DrawType = DT_None;

if (bInitiallyOn)
{
bIsOn = False;
TurnOn();
}
else
{
bIsOn = True;
TurnOff();
}

bAlreadyInitialized = True;

Tick (float deltaTime)


Super.Tick(deltaTime);

if (bIsOn && !bFrozen && bFlicker)
{
lastFlickerTime += deltaTime;

if (lastFlickerTime >= flickerTime)
{
lastFlickerTime = 0;
if (FRand() < 0.5)
{
SetHiddenBeam(True);
SoundVolume = 0;
if (bEmitLight)
LightType = LT_None;
}
else
{
SetHiddenBeam(False);
SoundVolume = 128;
if (bEmitLight)
LightType = LT_Steady;
}
}
}

Trigger (Actor Other, Pawn Instigator)


Super.Trigger(Other, Instigator);

TurnOn();

TurnOff


Super.TurnOff();

if (bEmitLight)
LightType = LT_None;

if (LaserIterator(RenderInterface) != None)
LaserIterator(RenderInterface).DeleteBeam(0);

TurnOn


Super.TurnOn();

if (bEmitLight)
LightType = LT_Steady;

UnTrigger (Actor Other, Pawn Instigator)


Super.UnTrigger(Other, Instigator);

TurnOff();




ElectronicDevices.uc (extends DeusExDecoration)

bInvincible=True
FragType=Class'DeusEx.PlasticFragment'
bPushable=False



ElevatorMover.uc (extends Mover)

var() bool bFollowKeyframes;
var bool bIsMoving;
InitialState=ElevatorMover

BeginPlay


Super.BeginPlay();
bIsMoving = False;

InterpolateEnd (actor Other)


if (bFollowKeyframes)
Super.InterpolateEnd(Other);

SetSeq (int seqnum)


if (bIsMoving)
return;

if (KeyNum != seqnum)
{
KeyNum = seqnum;
GotoState('ElevatorMover', 'Next');
}




EllipseEffect.uc (extends Effects)

LifeSpan=1.000000
DrawType=DT_Mesh
Style=STY_Translucent
Mesh=LodMesh'DeusExItems.EllipseEffect'
bUnlit=True

Tick (float deltaTime)


ScaleGlow = 2.0 * (LifeSpan / Default.LifeSpan);




ExplosionLarge.uc (extends AnimatedSprite)

numFrames=8
frames(0)=Texture'DeusExItems.Skins.FlatFXTex20'
frames(1)=Texture'DeusExItems.Skins.FlatFXTex21'
frames(2)=Texture'DeusExItems.Skins.FlatFXTex22'
frames(3)=Texture'DeusExItems.Skins.FlatFXTex23'
frames(4)=Texture'DeusExItems.Skins.FlatFXTex24'
frames(5)=Texture'DeusExItems.Skins.FlatFXTex25'
frames(6)=Texture'DeusExItems.Skins.FlatFXTex26'
frames(7)=Texture'DeusExItems.Skins.FlatFXTex27'
Texture=Texture'DeusExItems.Skins.FlatFXTex20'

PostBeginPlay


local int i;


Super.PostBeginPlay();

for (i=0; i<6; i++)
Spawn(class'FireComet', None);




ExplosionLight.uc (extends Light)

var int size;
size=1
bStatic=False
bNoDelete=False
bMovable=True
RemoteRole=ROLE_SimulatedProxy
LightEffect=LE_NonIncidence
LightBrightness=255
LightHue=16
LightSaturation=192
LightRadius=1
bVisionImportant=True

PostBeginPlay


Super.PostBeginPlay();

SetTimer(0.1, True);

Timer


if (size > 0)
{
LightRadius = Clamp(size, 1, 16);
size = -1;
}

LightRadius--;
if (LightRadius < 1)
Destroy();




ExplosionMedium.uc (extends AnimatedSprite)

numFrames=6
frames(0)=Texture'DeusExItems.Skins.FlatFXTex14'
frames(1)=Texture'DeusExItems.Skins.FlatFXTex15'
frames(2)=Texture'DeusExItems.Skins.FlatFXTex16'
frames(3)=Texture'DeusExItems.Skins.FlatFXTex17'
frames(4)=Texture'DeusExItems.Skins.FlatFXTex18'
frames(5)=Texture'DeusExItems.Skins.FlatFXTex19'
Texture=Texture'DeusExItems.Skins.FlatFXTex14'

PostBeginPlay


local int i;


Super.PostBeginPlay();

for (i=0; i<3; i++)
Spawn(class'FireComet', None);




ExplosionSmall.uc (extends AnimatedSprite)

numFrames=4
frames(0)=Texture'DeusExItems.Skins.FlatFXTex10'
frames(1)=Texture'DeusExItems.Skins.FlatFXTex11'
frames(2)=Texture'DeusExItems.Skins.FlatFXTex12'
frames(3)=Texture'DeusExItems.Skins.FlatFXTex13'
Texture=Texture'DeusExItems.Skins.FlatFXTex10'

PostBeginPlay


Super.PostBeginPlay();

Spawn(class'FireComet', None);




FadeTextWindow.uc (extends TextWindow)

var float moveRateX;
var float moveRateY;
var float fadeSpeed;
var float fadeTimer;
var float textColor;
var float textLum;
var Color colText;
var float r, g, b;
var int newX, newY;

InitWindow


Super.InitWindow();

SetFont(Font'FontLocation');
EnableTranslucentText(True);

fadeSpeed = FRand() / 20;
fadeTimer = fadeSpeed;
textColor = FRand();
textLum = FRand();
bTickEnabled = True;

Tick (float deltaTime)


// First move the guy
moveRateX -= deltaTime;
if (moveRateX < 0.0)
{
newX = x + Rand(4) - 2;
moveRateX = FRand();
}

moveRateY -= deltaTime;
if (moveRateY < 0.0)
{
newY = y + Rand(4) - 2;
moveRateY = FRand();
}
SetPos(newX, newY);

// Update the color
fadeTimer -= deltaTime;

if (fadeTimer < 0.0)
{
fadeTimer = fadeSpeed;
textLum -= 0.01;

if (textLum <= 0.0)
Destroy();

// HSLToRGB(textColor, 0.7, textLum, r, g, b);
HSLToRGB(textColor, FRand(), textLum, r, g, b);

colText.r = Int(r * 256) - 1;
colText.g = Int(g * 256) - 1;
colText.b = Int(b * 256) - 1;

SetTextColor(colText);
}




FadeViewTrigger.uc (extends Trigger)

var() color fadeColor;
var() float fadeTime;
var() float postFadeTime;
var() bool bFadeDown;
var DeusExPlayer player;
var float time;
fadeColor=(R=255,G=255,B=255)
fadeTime=2.000000
bTriggerOnceOnly=True
CollisionRadius=96.000000

FadeView


player = DeusExPlayer(GetPlayerPawn());
if (player != None)
{
// can't have a negative or zero fadeTime
if (fadeTime < 0.1)
fadeTime = 0.1;

// can't have a negative postFadeTime
if (postFadeTime < 0.0)
postFadeTime = 0.0;

time = fadeTime + postFadeTime;
}

Tick (float deltaTime)


local float alpha;
local vector fadeTo;


Super.Tick(deltaTime);

if (player != None)
{
time -= deltaTime;
if (time < 0.0)
time = 0.0;

alpha = FClamp(1.0 - ((time - postFadeTime) / fadeTime), 0.0, 1.0);
fadeTo.X = float(fadeColor.R) / 255.0;
fadeTo.Y = float(fadeColor.G) / 255.0;
fadeTo.Z = float(fadeColor.B) / 255.0;
if (bFadeDown)
{
alpha = -alpha;
fadeTo.X = float(255 - fadeColor.R) / 255.0;
fadeTo.Y = float(255 - fadeColor.G) / 255.0;
fadeTo.Z = float(255 - fadeColor.B) / 255.0;
}

// fade the view to the selected color
player.InstantFog = alpha * fadeTo;
player.InstantFlash = alpha;

// after fade, delay postFadeTime seconds
if (time <= 0)
Destroy();
}

Touch (Actor Other)


if (!IsRelevant(Other))
return;

Super.Touch(Other);
FadeView();

Trigger (Actor Other, Pawn Instigator)


Super.Trigger(Other, Instigator);
FadeView();




Fan1.uc (extends DeusExDecoration)

bHighlight=False
bCanBeBase=True
ItemName="Fan"
bPushable=False
Physics=PHYS_Rotating
Mesh=LodMesh'DeusExDeco.Fan1'
CollisionRadius=326.000000
CollisionHeight=103.000000
bCollideWorld=False
bFixedRotationDir=True
Mass=500.000000
Buoyancy=100.000000
RotationRate=(Yaw=8192)
BindName="Fan"



Fan1Vertical.uc (extends DeusExDecoration)

bHighlight=False
ItemName="Fan"
bPushable=False
Physics=PHYS_Rotating
Mesh=LodMesh'DeusExDeco.Fan1Vertical'
CollisionRadius=326.000000
CollisionHeight=326.000000
bCollideWorld=False
bFixedRotationDir=True
Mass=500.000000
Buoyancy=100.000000
RotationRate=(Pitch=8192)
BindName="Fan"



Fan2.uc (extends DeusExDecoration)

bHighlight=False
ItemName="Fan"
bPushable=False
Physics=PHYS_Rotating
Mesh=LodMesh'DeusExDeco.Fan2'
CollisionRadius=17.660000
CollisionHeight=16.240000
bCollideWorld=False
bFixedRotationDir=True
Mass=500.000000
Buoyancy=100.000000
RotationRate=(Roll=65535)
BindName="Fan"



Faucet.uc (extends DeusExDecoration)

var() bool bOpen;
var ParticleGenerator waterGen;
bInvincible=True
ItemName="Faucet"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.Faucet'
CollisionRadius=11.200000
CollisionHeight=4.800000
Mass=20.000000
Buoyancy=10.000000

Destroyed


if (waterGen != None)
waterGen.DelayedDestroy();

Super.Destroyed();

Frob (actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

bOpen = !bOpen;
if (bOpen)
{
PlaySound(sound'ValveOpen',,,, 256, 2.0);
PlayAnim('On');

if (waterGen != None)
waterGen.Trigger(Frobber, Pawn(Frobber));

// extinguish the player if he frobbed this
if (DeusExPlayer(Frobber) != None)
if (DeusExPlayer(Frobber).bOnFire)
DeusExPlayer(Frobber).ExtinguishFire();
}
else
{
PlaySound(sound'ValveClose',,,, 256, 2.0);
PlayAnim('Off');

if (waterGen != None)
waterGen.UnTrigger(Frobber, Pawn(Frobber));
}

PostBeginPlay


local Vector loc;


Super.PostBeginPlay();

// spawn a particle generator
// rotate the spray offsets into object coordinate space
loc = vect(0,0,0);
loc.X += CollisionRadius * 0.9;
loc = loc >> Rotation;
loc += Location;

waterGen = Spawn(class'ParticleGenerator', Self,, loc, Rotation-rot(12288,0,0));
if (waterGen != None)
{
waterGen.particleDrawScale = 0.05;
waterGen.checkTime = 0.05;
waterGen.frequency = 1.0;
waterGen.bGravity = True;
waterGen.bScale = False;
waterGen.bFade = True;
waterGen.ejectSpeed = 50.0;
waterGen.particleLifeSpan = 0.5;
waterGen.numPerSpawn = 5;
waterGen.bRandomEject = True;
waterGen.particleTexture = Texture'Effects.Generated.WtrDrpSmall';
waterGen.bAmbientSound = True;
waterGen.AmbientSound = Sound'Sink';
waterGen.SoundRadius = 16;
waterGen.bTriggered = True;
waterGen.bInitiallyOn = bOpen;
waterGen.SetBase(Self);
}

// play the correct startup animation
if (bOpen)
PlayAnim('On', 10.0, 0.001);
else
PlayAnim('Off', 10.0, 0.001);




Female1.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Female1Carcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Female1Tex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Female1Tex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Female1Tex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.Female1Tex1'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Female"
FamiliarName="Female"
UnfamiliarName="Female"



Female1Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Female1Tex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Female1Tex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Female1Tex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.Female1Tex1'



Female2.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Female2Carcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Female2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Female2Tex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Female2Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Female2Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Female2Tex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Female2Tex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Female"
FamiliarName="Female"
UnfamiliarName="Female"



Female2Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Female2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Female2Tex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Female2Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Female2Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Female2Tex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Female2Tex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'



Female3.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Female3Carcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.550000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Female3Tex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Female3Tex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Female3Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Female3"
FamiliarName="Female"
UnfamiliarName="Female"



Female3Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Female3Tex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Female3Tex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Female3Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Female4.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Female4Carcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Female4Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Female4Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Female4Tex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Female4Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Female4Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Female4"
FamiliarName="Female"
UnfamiliarName="Female"



Female4Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Female4Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Female4Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Female4Tex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Female4Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Female4Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Fire.uc (extends Effects)

var ParticleGenerator smokeGen;
var ParticleGenerator fireGen;
var Actor origBase;
var vector BaseOffset; //Where we are relative to Base, so that we can stay synced in mp.
var Actor PrevBase;
DrawType=DT_Sprite
Style=STY_Translucent
Texture=FireTexture'Effects.Fire.OnFire_J'
bUnlit=True
SoundVolume=192
AmbientSound=Sound'Ambient.Ambient.FireSmall1'
LightType=LT_Steady
LightEffect=LE_FireWaver
LightBrightness=255
LightHue=16
LightSaturation=64
LightRadius=4

AddFire (optional float fireLifeSpan)


if (fireLifeSpan == 0.0)
fireLifeSpan = 0.5;

if (fireGen == None)
{
fireGen = Spawn(class'ParticleGenerator', Self,, Location, rot(16384,0,0));
if (fireGen != None)
{
fireGen.particleDrawScale = 0.7;
fireGen.particleLifeSpan = fireLifeSpan;
fireGen.checkTime = 0.075;
fireGen.frequency = 0.9;
fireGen.riseRate = 30.0;
fireGen.ejectSpeed = 20.0;
fireGen.bScale = False;
fireGen.bRandomEject = True;
fireGen.particleTexture = Texture'Effects.Fire.OneFlame_J';
fireGen.SetBase(Self);
}
}

BaseChange


Super.BaseChange();

if (Base == None)
SetBase(origBase);

CorrectLocation


local float SizeDiff;
local float DotDiff;


SizeDiff = VSize(Location - Base.Location) - VSize(BaseOffset);
if (SizeDiff < 0)
SizeDiff = -1 * SizeDiff;

DotDiff = Normal(Location - Base.Location) Dot Normal(BaseOffset);

if ((DotDiff < 0.9) || (SizeDiff > 20))
{
SetLocation(Base.Location + BaseOffset);
}

Destroyed


if (smokeGen != None)
smokeGen.DelayedDestroy();

if (fireGen != None)
fireGen.DelayedDestroy();

Super.Destroyed();

PostBeginPlay


Super.PostBeginPlay();

SetBase(Owner);
origBase = Owner;

PrevBase = Base;
if (Base != None)
SetOffset();

if (Role == ROLE_Authority)
SpawnSmokeEffects();

PostNetBeginPlay


Super.PostNetBeginPlay();

SetBase(Owner);
origBase = Owner;

PrevBase = Base;
if (Base != None)
SetOffset();

if (Role < ROLE_Authority)
SpawnSmokeEffects();

SetOffset


BaseOffset = Location - Base.Location;

SpawnSmokeEffects


smokeGen = Spawn(class'ParticleGenerator', Self,, Location, rot(16384,0,0));
if (smokeGen != None)
{
smokeGen.particleDrawScale = 0.5;
smokeGen.particleLifeSpan = 2.0;
smokeGen.checkTime = 0.15;
smokeGen.frequency = 0.9;
smokeGen.riseRate = 90.0;
smokeGen.ejectSpeed = 40.0;
smokeGen.bRandomEject = True;
smokeGen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
smokeGen.SetBase(Self);
smokeGen.RemoteRole = ROLE_None;
}

Tick (float deltaTime)


Super.Tick(deltaTime);

if ((Base != PrevBase) && (Base != None))
SetOffset();

if ((Role == ROLE_SimulatedProxy) && (Base != None))
CorrectLocation();

// if our owner or base is destroyed, destroy us
if (Owner == None)
Destroy();




FireComet.uc (extends DeusExFragment)

Style=STY_Translucent
Mesh=LodMesh'DeusExItems.FireComet'
ScaleGlow=2.000000
bUnlit=True
CollisionRadius=0.000000
CollisionHeight=0.000000
bBounce=False

BeginState


Velocity = VRand() * 300;
Velocity.Z = FRand() * 200 + 200;
DrawScale = 0.3 + FRand();
SetRotation(Rotator(Velocity));

HitWall (vector HitNormal, actor Wall)


local BurnMark mark;


mark = spawn(class'BurnMark',,, Location, Rotator(HitNormal));
if (mark != None)
{
mark.DrawScale = 0.4*DrawScale;
mark.ReattachDecal();
}
Destroy();

Tick (float deltaTime)


if (Velocity == vect(0,0,0))
{
spawn(class'BurnMark',,, Location, rot(16384,0,0));
Destroy();
}
else
SetRotation(Rotator(Velocity));




FireExtinguisher.uc (extends DeusExPickup)

bActivatable=True
ItemName="Fire Extinguisher"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.FireExtinguisher'
PickupViewMesh=LodMesh'DeusExItems.FireExtinguisher'
ThirdPersonMesh=LodMesh'DeusExItems.FireExtinguisher'
LandSound=Sound'DeusExSounds.Generic.GlassDrop'
Icon=Texture'DeusExUI.Icons.BeltIconFireExtinguisher'
largeIcon=Texture'DeusExUI.Icons.LargeIconFireExtinguisher'
largeIconWidth=25
largeIconHeight=49
Description="A chemical fire extinguisher."
beltDescription="FIRE EXT"
Mesh=LodMesh'DeusExItems.FireExtinguisher'
CollisionRadius=8.000000
CollisionHeight=10.270000
Mass=30.000000
Buoyancy=20.000000

Activate


// can't turn it off

BeginState


local ProjectileGenerator gen;
local Vector loc;
local Rotator rot;


Super.BeginState();

// force-extinguish the player
if (DeusExPlayer(Owner) != None)
if (DeusExPlayer(Owner).bOnFire)
DeusExPlayer(Owner).ExtinguishFire();

// spew halon gas
rot = Pawn(Owner).ViewRotation;
loc = Vector(rot) * Owner.CollisionRadius;
loc.Z += Owner.CollisionHeight * 0.9;
loc += Owner.Location;
gen = Spawn(class'ProjectileGenerator', None,, loc, rot);
if (gen != None)
{
gen.ProjectileClass = class'HalonGas';
gen.SetBase(Owner);
gen.LifeSpan = 3;
gen.ejectSpeed = 300;
gen.projectileLifeSpan = 1.5;
gen.frequency = 0.9;
gen.checkTime = 0.1;
gen.bAmbientSound = True;
gen.AmbientSound = sound'SteamVent2';
gen.SoundVolume = 192;
gen.SoundPitch = 32;
}

// blast for 3 seconds, then destroy
SetTimer(3.0, False);

Timer


Destroy();




FirePlug.uc (extends OutdoorThings)

var() ESkinColor SkinColor;
Mesh=LodMesh'DeusExDeco.FirePlug'
CollisionRadius=8.000000
CollisionHeight=16.500000
Mass=50.000000
Buoyancy=30.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Red: Skin = Texture'FirePlugTex1'; break;
case SC_Orange: Skin = Texture'FirePlugTex2'; break;
case SC_Blue: Skin = Texture'FirePlugTex3'; break;
case SC_Gray: Skin = Texture'FirePlugTex4'; break;
}




Fireball.uc (extends DeusExProjectile)

var() float mpDamage;
mpDamage=5.000000
blastRadius=1.000000
DamageType=Flamed
AccurateRange=320
maxRange=320
bIgnoresNanoDefense=True
ItemName="Fireball"
ItemArticle="a"
speed=800.000000
MaxSpeed=800.000000
Damage=5.000000
MomentumTransfer=500
ExplosionDecal=Class'DeusEx.BurnMark'
LifeSpan=0.500000
DrawType=DT_Sprite
Style=STY_Translucent
Texture=FireTexture'Effects.Fire.flame_b'
DrawScale=0.050000
bUnlit=True
LightType=LT_Steady
LightEffect=LE_NonIncidence
LightBrightness=200
LightHue=16
LightSaturation=32
LightRadius=2

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
Damage = mpDamage;

Tick (float deltaTime)


local float value;
local float sizeMult;


// don't Super.Tick() becuase we don't want gravity to affect the stream
time += deltaTime;

value = 1.0+time;
if (MinDrawScale > 0)
sizeMult = MaxDrawScale/MinDrawScale;
else
sizeMult = 1;

DrawScale = (-sizeMult/(value*value) + (sizeMult+1))*MinDrawScale;
ScaleGlow = Default.ScaleGlow/(value*value*value);

ZoneChange (ZoneInfo NewZone)


Super.ZoneChange(NewZone);

// If the fireball enters water, extingish it
if (NewZone.bWaterZone)
Destroy();




FireballRocket.uc (extends Fireball)

DamageType=Burned
MinDrawScale=0.010000
maxDrawScale=0.500000
speed=0.000000
MaxSpeed=0.000000
Damage=0.000000
LifeSpan=0.100000
LightRadius=1



Fish.uc (extends Fishes)

AttitudeToPlayer=ATTITUDE_Ignore
BindName="Fish"



Fish2.uc (extends Fishes)

WaterSpeed=30.000000
AttitudeToPlayer=ATTITUDE_Ignore
Mesh=LodMesh'DeusExCharacters.Fish2'
CollisionRadius=5.270000
CollisionHeight=4.540000
BindName="Fish2"



Fish2Generator.uc (extends PawnGenerator)

PawnClasses(0)=(Count=10,PawnClass=Class'DeusEx.Fish2')
Alliance=Fish
PawnHomeExtent=400.000000
ActiveArea=1200.000000
Radius=70.000000
MaxCount=10
bPawnsTransient=True
bLOSCheck=False
Focus=0.600000

GenerateCoastPeriod -> float


return (FRand()*5+3);

GenerateRandomVelocity -> vector


local vector newVector;
local float magnitude;


magnitude = VSize(SumVelocities);
if (magnitude < 0.01)
magnitude = 0.01;
newVector = Vector(Rand(32768)*2*rot(0,1,0))*magnitude*1.1;

return newVector;




FishGenerator.uc (extends PawnGenerator)

PawnClasses(0)=(Count=10,PawnClass=Class'DeusEx.Fish')
Alliance=Fish
PawnHomeExtent=400.000000
ActiveArea=1200.000000
Radius=70.000000
MaxCount=10
bPawnsTransient=True
bLOSCheck=False
Focus=0.600000

GenerateCoastPeriod -> float


return (FRand()*3+3);

GenerateRandomVelocity -> vector


local vector newVector;
local float magnitude;


magnitude = VSize(SumVelocities);
if (magnitude < 0.01)
magnitude = 0.01;
newVector = Vector(Rand(32768)*2*rot(0,1,0))*magnitude*1.1;

return newVector;




Fishes.uc (extends Animal)

var float leaderTimer;
var float forwardTimer;
var float bumpTimer;
var float abortTimer;
var float breatheTimer;
var() bool bFlock;
var() bool bStayHorizontal;
bFlock=True
WalkingSpeed=1.000000
bHasShadow=False
bHighlight=False
bSpawnBubbles=False
bCanWalk=False
bCanSwim=True
GroundSpeed=100.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
MaxStepHeight=1.000000
MinHitWall=0.000000
BaseEyeHeight=1.000000
UnderWaterTime=99999.000000
Physics=PHYS_Swimming
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Fish'
CollisionRadius=7.760000
CollisionHeight=3.890000
bBlockActors=False
bBlockPlayers=False
bBounce=True
Mass=1.000000
Buoyancy=1.000000
RotationRate=(Pitch=6000,Yaw=25000)
BindName="Fishes"

BeginState


Super.BeginState();
BlockReactions();
abortTimer = -1;

EndState


Super.EndState();
bBounce = False;

FootZoneChange (ZoneInfo newZone)


local Rotator newRotation;

if (newZone.bWaterZone && !FootRegion.Zone.bWaterZone)
{
if (!bStayHorizontal)
{
newRotation = Rotation;
newRotation.Pitch = -1500;
SetRotation(newRotation);
DesiredRotation = newRotation;
leaderTimer = 1.0;
GotoState('Wandering', 'Moving');
}
}
Super.ZoneChange(newZone);

HitWall (vector HitNormal, actor HitWall)


local rotator dir;
local float elasticity;
local float minVel, maxHVel;
local vector tempVect;


if (Physics == PHYS_Swimming)
{
if (bumpTimer > 0)
return;
bumpTimer = 0.5;

if (bStayHorizontal)
HitNormal = Normal(HitNormal*vect(1,1,0));
elasticity = 1.0;
Velocity = elasticity*((Velocity dot HitNormal) * HitNormal * (-2.0) + Velocity);
dir = Rotator(Velocity);
if (bStayHorizontal)
dir.Pitch = 0;
SetRotation(dir);
DesiredRotation = dir;
Acceleration = Vector(dir)*AccelRate;
}
else
{
elasticity = 0.3;
Velocity = elasticity*((Velocity dot HitNormal) * HitNormal * (-2.0) + Velocity);
minVel = 100;
maxHVel = 20;
Velocity += VRand()*5 * vect(1,1,0);
tempVect = Velocity * vect(1,1,0);
if (VSize(tempVect) > maxHVel)
Velocity = Normal(tempVect)*maxHVel + vect(0,0,1)*Velocity.Z;
if (VSize(Velocity) < minVel)
Velocity = Normal(Velocity)*minVel*(FRand()*0.2+1);
dir = Rotator(VRand());
SetRotation(dir);
DesiredRotation = dir;
}
forwardTimer = -1;
GotoState('Wandering', 'Moving');

IsNearHome (vector position) -> bool


local bool bNear;
local PawnGenerator genOwner;


bNear = true;
if (bUseHome)
{
genOwner = PawnGenerator(Owner);
if (genOwner == None)
{
if (VSize(HomeLoc-((position-Location)+genOwner.FlockCenter)) > HomeExtent)
bNear = false;
}
else
{
if (VSize(HomeLoc-position) > HomeExtent)
bNear = false;
}
}

return bNear;

PickDirection (bool bForward) -> vector


local Actor nearbyActor;
local Fishes nearbyFish;
local PawnGenerator genOwner;
local vector cumVector;
local rotator rot;
local float dist;
local vector centerVector;


if (bForward || IsNearHome(Location))
cumVector = Velocity;
else
cumVector = (homeLoc - Location)*20;
if ((leaderTimer > 0) && !bForward && bFlock)
{
genOwner = PawnGenerator(Owner);
if (genOwner == None)
{
foreach RadiusActors(Class, nearbyActor, 300)
{
nearbyFish = Fishes(nearbyActor);
if ((nearbyFish != None) && (nearbyFish != self) && nearbyFish.bFlock &&
(PawnGenerator(nearbyFish.Owner) == None))
cumVector += nearbyFish.Velocity;
}
}
else
{
cumVector += genOwner.SumVelocities - Velocity;
centerVector = (genOwner.FlockCenter - Location);
dist = VSize(centerVector);
if ((dist > genOwner.Radius) && (dist < genOwner.Radius*4))
cumVector += centerVector*2;
}
}
if (cumVector == vect(0,0,0))
cumVector = Vector(Rotation);
rot = Rotator(cumVector);
if (bStayHorizontal)
rot.Pitch = 0;
if (!bForward)
{
if ((leaderTimer > 1.2) && bFlock)
{
rot.Yaw += Rand(8192)-4096;
if (!bStayHorizontal)
rot.Pitch += Rand(3000)-1500;
}
return vector(rot)*200+Location;
}
else
return vector(rot)*50+Location;

PlayWalking


LoopAnimPivot('Swim');

PostBeginPlay


Super.PostBeginPlay();

ResetLeaderTimer();
forwardTimer = -1;
bumpTimer = 0;
abortTimer = -1;
breatheTimer = 0;

ResetForwardTimer


forwardTimer = FRand()*10.0+2;

ResetLeaderTimer


leaderTimer = FRand()*10.0+5;

Tick (float deltatime)


Super.Tick(deltatime);
leaderTimer -= deltaTime;
forwardTimer -= deltaTime;
bumpTimer -= deltaTime;
if (leaderTimer < -2.0)
ResetLeaderTimer();
if (bumpTimer < 0)
bumpTimer = 0;
if (abortTimer >= 0)
abortTimer += deltaTime;
if (abortTimer > 8.0)
{
abortTimer = -1;
GotoState('Wandering', 'Moving');
}
if (Region.Zone.bWaterZone)
breatheTimer = 0;
else
{
breatheTimer += deltaTime;
if (breatheTimer > 8)
{
TakeDamage(5, None, Location, vect(0,0,0), 'Drowned');
breatheTimer = 6;
}
}

TweenToWalking (float tweentime)


TweenAnimPivot('Swim', tweentime);




FlagAddWindow.uc (extends ToolWindow)

var ToolEditWindow editName;
var ToolEditWindow editExpiration;
var ToolEditWindow editValue;
var ToolButtonWindow btnOK;
var ToolButtonWindow btnCancel;
var ToolRadioButtonWindow btnTrue;
var ToolRadioButtonWindow btnFalse;
var ToolRadioButtonWindow btnTypeBool;
var ToolRadioButtonWindow btnTypeByte;
var ToolRadioButtonWindow btnTypeInt;
var ToolRadioButtonWindow btnTypeFloat;
var ToolRadioButtonWindow btnTypeName;
var RadioBoxWindow radBool;
var RadioBoxWindow radTypes;
var Window winBools;
var Window winTypes;
var FlagEditWindow winFlagList;
var EFlagType flagType; // Type of flag we're editing
var bool bAddMode;
var Name editFlag;

BoxOptionSelected (Window msgBoxWindow, int buttonNumber) -> bool


// Nuke the msgbox
root.PopWindow();

return true;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnOK:
if (ValidateValue())
SendModalComplete(True);
break;

case btnCancel:
SendModalComplete(False);
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated( buttonPressed );

return bHandled;

CreateBoolControls


// Create a RadioBox window for the boolean radiobuttons
radBool = RadioBoxWindow(NewChild(Class'RadioBoxWindow'));
radBool.SetPos(20, 208);
radBool.SetSize(180, 20);
winBools = radBool.NewChild(Class'Window');

// Create the two Radio Buttons
btnTrue = ToolRadioButtonWindow(winBools.NewChild(Class'ToolRadioButtonWindow'));
btnTrue.SetText("True");
btnTrue.SetPos(0, 5);

btnFalse = ToolRadioButtonWindow(winBools.NewChild(Class'ToolRadioButtonWindow'));
btnFalse.SetText("False");
btnFalse.SetPos(80, 5);

CreateControls


CreateToolLabel(16, 33, "Flag Type:");
CreateTypeRadioButtons();

CreateToolLabel(16, 93, "Flag Name:");
editName = CreateToolEditWindow(16, 108, 180, 32);
editName.SetFilter(" ~`!@#$%^&*()=+\|[{]};:,<.>/?'" $ Chr(34));

CreateToolLabel(16, 143, "Mission Expiration (0 = never):");
editExpiration = CreateToolEditWindow(16, 158, 180, 32);
editExpiration.SetFilter(" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()=+\|[{]};:,<.>/?'" $ Chr(34));

CreateToolLabel(16, 193, "Value:");

CreateBoolControls();

btnOK = CreateToolButton(210, 180, "|&OK");
btnCancel = CreateToolButton(210, 205, "|&Cancel");

CreateTypeRadioButtons


// Create a RadioBox window for the boolean radiobuttons
radBool = RadioBoxWindow(NewChild(Class'RadioBoxWindow'));
radBool.SetPos(20, 50);
radBool.SetSize(230, 45);
winTypes = radBool.NewChild(Class'Window');

// Create the five different variable type Radio Buttons
btnTypeBool = ToolRadioButtonWindow(winTypes.NewChild(Class'ToolRadioButtonWindow'));
btnTypeBool.SetText("Bool");
btnTypeBool.SetPos(0, 5);

btnTypeByte = ToolRadioButtonWindow(winTypes.NewChild(Class'ToolRadioButtonWindow'));
btnTypeByte.SetText("Byte");
btnTypeByte.SetPos(70, 5);

btnTypeInt = ToolRadioButtonWindow(winTypes.NewChild(Class'ToolRadioButtonWindow'));
btnTypeInt.SetText("Int");
btnTypeInt.SetPos(140, 5);

btnTypeFloat = ToolRadioButtonWindow(winTypes.NewChild(Class'ToolRadioButtonWindow'));
btnTypeFloat.SetText("Float");
btnTypeFloat.SetPos(0, 25);

btnTypeName = ToolRadioButtonWindow(winTypes.NewChild(Class'ToolRadioButtonWindow'));
btnTypeName.SetText("Name");
btnTypeName.SetPos(70, 25);

CreateValueEditWindow


if (editValue == None)
editValue = CreateToolEditWindow(16, 208, 180, 32);

DestroyValueEditWindow


if (editValue != None)
{
editValue.GetParent().GetParent().GetParent().Destroy();
editValue = None;
}

EditActivated (window edit, bool bModified) -> bool


if ( btnOK.IsSensitive() )
SendModalComplete(True);

return false;

EnableButtons


local bool bFieldsValid;


bFieldsValid = Len(editName.GetText()) > 0;

if ((bFieldsValid) && (editValue != None))
bFieldsValid = Len(editValue.GetText()) > 0;

btnOK.SetSensitivity(bFieldsValid);

GetFlagExpiration -> int


return int(editExpiration.GetText());

GetFlagName -> Name


local String strFlagName;
local Name flagName;


flagName = StringToName(editName.GetText());

return flagName;

GetFlagType -> EFlagType


return flagType;

GetValue -> String


if (editValue != None)
return editValue.GetText();
else
return "";

InitWindow


Super.InitWindow();

// Center this window
SetSize(300, 250);
SetTitle("Edit Flag");

// Create the controls
CreateControls();
EnableButtons();

SendModalComplete (bool bNotifyFlag)


if ( winFlagList != None )
{
winFlagList.ModalComplete(bNotifyFlag, Self);
}

SetAddMode


bAddMode = True;
SetTitle("Add Flag");
SetFlagType(FLAG_Bool);
btnTrue.SetToggle(True);
editExpiration.SetText("0");
editFlag = '';

// Set focus to the Name edit field
SetFocusWindow(editName);

SetEditFlag (Name newEditFlag, EFlagType editFlagType)


local String flagStringName;


editFlag = newEditFlag;
flagType = editFlagType;

// Set the flag Type
SetFlagType(flagType);

// Flag Name
flagStringName = String(editFlag);

editName.SetText(flagStringName);
editName.MoveInsertionPoint(MOVEINSERT_End);

// Mission Expiration
editExpiration.SetText(player.flagBase.GetExpiration(editFlag, flagType));

// Flag Value
switch(editFlagType)
{
case FLAG_Bool:
if (player.flagBase.GetBool(editFlag) == True)
btnTrue.SetToggle(True);
else
btnFalse.SetToggle(True);
break;

case FLAG_Byte:
editValue.SetText(String(player.flagBase.GetByte(editFlag)));
break;

case FLAG_Int:
editValue.SetText(String(player.flagBase.GetInt(editFlag)));
break;

case FLAG_Float:
editValue.SetText(String(player.flagBase.GetFloat(editFlag)));
break;

case FLAG_Name:
editValue.SetText(player.flagBase.GetName(editFlag));
break;
}

// Set focus to the Name edit field
SetFocusWindow(editName);
editName.MoveInsertionPoint(MOVEINSERT_End);

SetFlagListWindow (FlagEditWindow newFlagList)


winFlagList = newFlagList;

SetFlagType (EFlagType newFlagType)


flagType = newFlagType;

switch(flagType)
{
case FLAG_Bool:
radBool.Show(True);
DestroyValueEditWindow();
btnTypeBool.SetToggle(True);
break;

case FLAG_Byte:
radBool.Show(False);
CreateValueEditWindow();
editValue.Show(True);
editValue.SetFilter(" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()=-+\|[{]};:,<.>/?'" $ Chr(34));
editValue.SetMaxSize(3);
editValue.SetText("");
btnTypeByte.SetToggle(True);
break;

case FLAG_Int:
radBool.Show(False);
CreateValueEditWindow();
editValue.SetFilter(" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()=+\|[{]};:,<.>/?'" $ Chr(34));
editValue.SetMaxSize(10);
editValue.SetText("");
btnTypeInt.SetToggle(True);
break;

case FLAG_Float:
radBool.Show(False);
CreateValueEditWindow();
editValue.SetFilter(" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()=+\|[{]};:,<>/?'" $ Chr(34));
editValue.SetMaxSize(10);
editValue.SetText("");
btnTypeFloat.SetToggle(True);
break;

case FLAG_Name:
radBool.Show(False);
CreateValueEditWindow();
editValue.SetFilter(" ~`!@#$%^&*()=+\|[{]};:,<.>/?'" $ Chr(34));
editValue.SetMaxSize(64);
editValue.SetText("");
btnTypeName.SetToggle(True);
break;

default:
radBool.Show(False);
DestroyValueEditWindow();
break;
}

TextChanged (window edit, bool bModified) -> bool


EnableButtons();

return false;

ToggleChanged (Window button, bool bNewToggle) -> bool


if (bNewToggle == True)
{
if (button == btnTypeBool)
SetFlagType(FLAG_Bool);
else if (button == btnTypeByte)
SetFlagType(FLAG_Byte);
else if (button == btnTypeInt)
SetFlagType(FLAG_Int);
else if (button == btnTypeFloat)
SetFlagType(FLAG_Float);
else if (button == btnTypeName)
SetFlagType(FLAG_Name);

return True;
}
else
{
return False;
}

ValidateValue -> bool


local bool bGoodValue;


// Flag Value
switch(flagType)
{
case FLAG_Bool:
bGoodValue = True;
break;

case FLAG_Byte:
if ((Int(editValue.GetText()) >= 0) && (Int(editValue.GetText()) <= 255))
{
bGoodValue = True;
}
else
{
bGoodValue = False;
root.ToolMessageBox(
"Bad Byte Value!",
"Bytes must range in value from 0 to 255",
1, False, Self);
}

break;

case FLAG_Int:
if ((Int(editValue.GetText()) >= -2147483648) && (Int(editValue.GetText()) <= 2147483647))
{
bGoodValue = True;
}
else
{
bGoodValue = False;
root.ToolMessageBox(
"Bad Integer Value!",
"Ints must range in value from -2147483648 to 2147483647",
1, False, Self);
}

break;

case FLAG_Float:
bGoodValue = True;
break;

case FLAG_Name:
bGoodValue = True;
break;
}

return bGoodValue;




FlagEditWindow.uc (extends ToolWindow)

var ToolListWindow lstFlags;
var ToolButtonWindow btnEdit;
var ToolButtonWindow btnDelete;
var ToolButtonWindow btnAdd;
var ToolButtonWindow btnClose;
var RadioBoxWindow radSort;
var Window winSort;
var ToolRadioButtonWindow btnSortName;
var ToolRadioButtonWindow btnSortType;
var EFlagEditMode flagEditMode;
var String saveFlagName;
var EFlagType saveFlagType;
var int saveRowID;

AddFlag


local FlagAddWindow winAdd;


winAdd = FlagAddWindow(root.PushWindow(Class'FlagAddWindow'));
winAdd.SetFlagListWindow(Self);
winAdd.SetAddMode();

flagEditMode = FE_Add;

BuildFlagString (Name flagName, EFlagType flagType) -> String


local String flagString;


flagString = flagName $ ";";

switch( flagType )
{
case FLAG_Bool:
flagString = flagString $ "Bool;";
if ( player.flagBase.GetBool(flagName) )
flagString = flagString $ "True";
else
flagString = flagString $ "False";
break;

case FLAG_Byte:
flagString = flagString $ "Byte;";
flagString = flagString $ String(player.flagBase.GetByte(flagName));
break;

case FLAG_Int:
flagString = flagString $ "Int;";
flagString = flagString $ String(player.flagBase.GetInt(flagName));
break;

case FLAG_Float:
flagString = flagString $ "Float;";
flagString = flagString $ String(player.flagBase.GetFloat(flagName));
break;

case FLAG_Name:
flagString = flagString $ "Name;";
flagString = flagString $ player.flagBase.GetName(flagName);
break;

case FLAG_Vector:
flagString = flagString $ "Vector;";
break;

case FLAG_Rotator:
flagString = flagString $ "Rotator;";
break;
}

flagString = flagString $ ";" $ String(player.flagBase.GetExpiration(flagName, flagType));
flagString = flagString $ ";" $ String(flagType);

return flagString;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnAdd:
AddFlag();
break;

case btnEdit:
EditFlag();
break;

case btnDelete:
DeleteFlag();
break;

case btnClose:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated( buttonPressed );

return bHandled;

CreateControls


CreateSortRadioWindow();

// Flags list box
CreateFlagsList();

// Buttons
btnAdd = CreateToolButton(465, 60, "|&Add");
btnEdit = CreateToolButton(465, 85, "|&Edit");
btnDelete = CreateToolButton(465, 110, "|&Delete");
btnClose = CreateToolButton(465, 368, "|&Close");

CreateFlagsList


// Now create the List Window
lstFlags = CreateToolList(15, 60, 425, 332);

lstFlags.EnableMultiSelect(False);
lstFlags.SetColumns(5);

lstFlags.SetColumnTitle(0, "Flag");
lstFlags.SetColumnTitle(1, "Type");
lstFlags.SetColumnTitle(2, "Value");
lstFlags.SetColumnTitle(3, "Exp.");

lstFlags.EnableAutoExpandColumns(True);
lstFlags.SetColumnWidth(0, 210);
lstFlags.SetColumnWidth(1, 75);
lstFlags.SetColumnWidth(2, 100);

lstFlags.SetSortColumn(0);
lstFlags.AddSortColumn(1);

lstFlags.HideColumn(4);

CreateSortRadioWindow


CreateToolLabel(16, 33, "Sort By:");

// Create a RadioBox window for the boolean radiobuttons
radSort = RadioBoxWindow(NewChild(Class'RadioBoxWindow'));
radSort.SetPos(65, 30);
radSort.SetSize(180, 20);
winSort = radSort.NewChild(Class'Window');

// Create the two Radio Buttons
btnSortName = ToolRadioButtonWindow(winSort.NewChild(Class'ToolRadioButtonWindow'));
btnSortName.SetText("Name");
btnSortName.SetPos(0, 5);

btnSortType = ToolRadioButtonWindow(winSort.NewChild(Class'ToolRadioButtonWindow'));
btnSortType.SetText("Type");
btnSortType.SetPos(65, 5);

btnSortName.SetToggle(True);

DeleteFlag


local int rowID;
local int rowIndex;
local Name flagName;


rowID = lstFlags.GetSelectedRow();

// Get the row index so we can highlight it after we delete this item
rowIndex = lstFlags.RowIdToIndex(rowID);

// Delete the flag from the flagbase
flagName = StringToName(lstFlags.GetField(rowID, 0));
player.flagBase.DeleteFlag(flagName, FLAG_Bool);

// Delete the row
lstFlags.DeleteRow(rowID);

// Attempt to highlight the next row
if ( lstFlags.GetNumRows() > 0 )
{
if ( rowIndex >= lstFlags.GetNumRows() )
rowIndex = lstFlags.GetNumRows() - 1;

rowID = lstFlags.IndexToRowId(rowIndex);

lstFlags.SetRow(rowID);
}

EnableButtons();

EditFlag


local FlagAddWindow winAdd;
local Name flagName;


winAdd = FlagAddWindow(root.PushWindow(Class'FlagAddWindow'));
winAdd.SetFlagListWindow(Self);

// Save the current rowID and name to make it easier to
// edit the flag once the dialog is complete

saveRowID = lstFlags.GetSelectedRow();
saveFlagName = lstFlags.GetField(saveRowID, 0);
saveFlagType = GetFlagTypeFromInt(Int(lstFlags.GetField(saveRowID, 4)));

flagName = StringToName(saveFlagName);
winAdd.SetEditFlag(flagName, saveFlagType);

flagEditMode = FE_Edit;

EnableButtons


btnDelete.SetSensitivity( lstFlags.GetNumSelectedRows() > 0 );
btnEdit.SetSensitivity( lstFlags.GetNumSelectedRows() > 0 );

FindRowFromName (String searchName, EFlagType searchFlagType) -> int


local int rowID;
local int rowIndex;
local bool bNameFound;


for(rowIndex=0; rowIndex {
rowID = lstFlags.IndexToRowId(rowIndex);
if ((lstFlags.GetField(rowID, 0) == searchName)
&& (GetFlagTypeFromInt(Int(lstFlags.GetField(rowID, 4))) == searchFlagType))
{
bNameFound = True;
break;
}
}

if (bNameFound)
return rowID;
else
return -1;

GetFlagTypeFromInt (int intFlagType) -> EFlagType


local EFlagType flagType;


switch(intFlagType)
{
case 0:
flagType = FLAG_Bool;
break;
case 1:
flagType = FLAG_Byte;
break;
case 2:
flagType = FLAG_Int;
break;
case 3:
flagType = FLAG_Float;
break;
case 4:
flagType = FLAG_Name;
break;
case 5:
flagType = FLAG_Vector;
break;
case 6:
flagType = FLAG_Rotator;
break;
}

return flagType;

InitWindow


Super.InitWindow();

// Center this window
SetSize(565, 420);
SetTitle("Edit Flags");

// Create the controls
CreateControls();
PopulateFlagsList();

ListRowActivated (window list, int rowId) -> bool


EditFlag();

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


EnableButtons();

ModalComplete (Bool bResult, Window winCaller)


local FlagAddWindow winAddFlag;
local Name flagName;
local EFlagType flagType;
local int rowID;


if ( bResult )
{
winAddFlag = FlagAddWindow(winCaller);

// If we're editing a flag and the name changed, then we need
// to delete the old flag

if (flagEditMode == FE_Edit)
{
// Delete the existing row
lstFlags.DeleteRow(saverowID);

if (saveFlagName != winAddFlag.editName.GetText())
{
// Delete the old flag
flagName = StringToName(saveFlagName);
player.flagBase.Deleteflag(flagName, saveFlagType);
}
}

// Get the name from the dialog
flagName = winAddFlag.GetFlagName();
flagType = winAddFlag.GetFlagType();

// Make sure the flag doesn't already exist. If it does,
// delete it and remove it from the listbox
if (player.flagBase.DeleteFlag(flagName, flagType))
{
rowID = FindRowFromName(String(flagName), flagType);

if (rowID != -1)
lstFlags.DeleteRow(rowID);
}

switch(flagType)
{
case FLAG_Bool:
player.flagBase.SetBool(flagName, winAddFlag.btnTrue.GetToggle());
break;

case FLAG_Byte:
player.flagBase.SetByte(flagName, Byte(winAddFlag.GetValue()));
break;

case FLAG_Int:
player.flagBase.SetInt(flagName, Int(winAddFlag.GetValue()));
break;

case FLAG_Float:
player.flagBase.SetFloat(flagName, Float(winAddFlag.GetValue()));
break;

case FLAG_Name:
player.flagBase.SetName(flagName, StringToName(winAddFlag.GetValue()));
break;
}

player.flagBase.SetExpiration(flagName, flagType, winAddFlag.GetFlagExpiration());

rowID = lstFlags.AddRow(BuildFlagString(flagName, flagType));

lstFlags.Sort();

// Select the changed item
lstFlags.SetRow(rowID);
}

// Make the Add dialog go bye-bye
root.PopWindow();

EnableButtons();

PopulateFlagsList


local int rowIndex;
local int flagIterator;
local Name flagName;
local EFlagType flagType;



// For now, we're only interested in boolean flags
lstFlags.DeleteAllRows();

flagIterator = player.flagBase.CreateIterator();

while( player.flagBase.GetNextFlag( flagIterator, flagName, flagType ) )
{
rowIndex = lstFlags.AddRow( BuildFlagString(flagName, flagType) );
}

player.flagBase.DestroyIterator(flagIterator);

// Sort the flags by name
lstFlags.Sort();

EnableButtons();

ToggleChanged (Window button, bool bNewToggle) -> bool


if ((bNewToggle) && (lstFlags != None))
{
if (button == btnSortName)
{
lstFlags.SetSortColumn(0);
lstFlags.AddSortColumn(1);
}
else
{
lstFlags.SetSortColumn(1);
lstFlags.AddSortColumn(0);
}

lstFlags.Sort();

return True;
}
else
{
return False;
}




FlagPole.uc (extends DeusExDecoration)

var() travel ESkinColor SkinColor;
FragType=Class'DeusEx.WoodFragment'
ItemName="Flag Pole"
Mesh=LodMesh'DeusExDeco.FlagPole'
CollisionRadius=17.000000
CollisionHeight=56.389999
Mass=40.000000
Buoyancy=30.000000

BeginPlay


Super.BeginPlay();

SetSkin();

SetSkin


switch (SkinColor)
{
case SC_China: Skin = Texture'FlagPoleTex1'; break;
case SC_France: Skin = Texture'FlagPoleTex2'; break;
case SC_President: Skin = Texture'FlagPoleTex3'; break;
case SC_UNATCO: Skin = Texture'FlagPoleTex4'; break;
case SC_USA: Skin = Texture'FlagPoleTex5'; break;
}

TravelPostAccept


Super.TravelPostAccept();

SetSkin();




FlagTrigger.uc (extends Trigger)

var() name flagName;
var() bool flagValue;
var() bool bSetFlag;
var() bool bTrigger;
var() bool bWhileStandingOnly;
var() int flagExpiration;
flagValue=True
bSetFlag=True
flagExpiration=-1
bTriggerOnceOnly=True
CollisionRadius=96.000000

Touch (Actor Other)


local DeusExPlayer player;


if (IsRelevant(Other))
{
player = DeusExPlayer(GetPlayerPawn());
if (player != None)
{
if (bSetFlag)
{
if (flagExpiration == -1)
player.flagBase.SetBool(flagName, flagValue);
else
player.flagBase.SetBool(flagName, flagValue,, flagExpiration);
}

if (bTrigger)
if (player.flagBase.GetBool(flagName) == flagValue)
Super.Touch(Other);
}
}

Trigger (Actor Other, Pawn Instigator)


local DeusExPlayer player;
local Actor A;


player = DeusExPlayer(GetPlayerPawn());
if (player != None)
{
if (bSetFlag)
{
if (flagExpiration == -1)
player.flagBase.SetBool(flagName, flagValue);
else
player.flagBase.SetBool(flagName, flagValue,, flagExpiration);
}

if (bTrigger)
if (player.flagBase.GetBool(flagName) == flagValue)
{
if (Event != '')
foreach AllActors(class 'Actor', A, Event)
A.Trigger(player, Instigator);

Super.Trigger(Other, Instigator);
}
}

UnTouch (Actor Other)


local DeusExPlayer player;


if (bWhileStandingOnly)
{
if (IsRelevant(Other))
{
player = DeusExPlayer(GetPlayerPawn());
if (player != None)
{
if (bTrigger)
if (player.flagBase.GetBool(flagName) == flagValue)
Super.UnTouch(Other);

if (bSetFlag)
{
if (flagExpiration == -1)
player.flagBase.SetBool(flagName, !flagValue);
else
player.flagBase.SetBool(flagName, !flagValue,, flagExpiration);
}
}
}
}

UnTrigger (Actor Other, Pawn Instigator)


local DeusExPlayer player;
local Actor A;


if (bWhileStandingOnly)
{
player = DeusExPlayer(GetPlayerPawn());
if (player != None)
{
if (bTrigger)
if (player.flagBase.GetBool(flagName) == flagValue)
{
if (Event != '')
foreach AllActors(class 'Actor', A, Event)
A.UnTrigger(player, Instigator);

Super.UnTrigger(Other, Instigator);
}

if (bSetFlag)
{
if (flagExpiration == -1)
player.flagBase.SetBool(flagName, !flagValue);
else
player.flagBase.SetBool(flagName, !flagValue,, flagExpiration);
}
}
}




Flare.uc (extends DeusExPickup)

var ParticleGenerator gen;
maxCopies=50
bCanHaveMultipleCopies=True
ExpireMessage="It's already been used"
bActivatable=True
ItemName="Flare"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.Flare'
PickupViewMesh=LodMesh'DeusExItems.Flare'
ThirdPersonMesh=LodMesh'DeusExItems.Flare'
Icon=Texture'DeusExUI.Icons.BeltIconFlare'
largeIcon=Texture'DeusExUI.Icons.LargeIconFlare'
largeIconWidth=42
largeIconHeight=43
Description="A flare."
beltDescription="FLARE"
Mesh=LodMesh'DeusExItems.Flare'
SoundRadius=16
SoundVolume=96
CollisionRadius=6.200000
CollisionHeight=1.200000
LightEffect=LE_TorchWaver
LightBrightness=255
LightHue=16
LightSaturation=96
LightRadius=8
Mass=2.000000
Buoyancy=1.000000

Activate


// can't turn it off

BeginState


local Flare flare;


Super.BeginState();

// Create a Flare and throw it
flare = Spawn(class'Flare', Owner);
flare.LightFlare();

UseOnce();

ExtinguishFlare


LightType = LT_None;
AmbientSound = None;
if (gen != None)
gen.DelayedDestroy();

Frob (Actor Frobber, Inventory frobWith)


// we can't pick it up again if we've already activated it
if (gen == None)
Super.Frob(Frobber, frobWith);
else if (Frobber.IsA('Pawn'))
Pawn(Frobber).ClientMessage(ExpireMessage);

LightFlare


local Vector X, Y, Z, dropVect;
local Pawn P;


if (gen == None)
{
LifeSpan = 30;
bUnlit = True;
LightType = LT_Steady;
AmbientSound = Sound'Flare';

P = Pawn(Owner);
if (P != None)
{
GetAxes(P.ViewRotation, X, Y, Z);
dropVect = P.Location + 0.8 * P.CollisionRadius * X;
dropVect.Z += P.BaseEyeHeight;
Velocity = Vector(P.ViewRotation) * 500 + vect(0,0,220);
bFixedRotationDir = True;
RotationRate = RotRand(False);
DropFrom(dropVect);

// increase our collision height so we light up the ground better
SetCollisionSize(CollisionRadius, CollisionHeight*2);
}

gen = Spawn(class'ParticleGenerator', Self,, Location, rot(16384,0,0));
if (gen != None)
{
gen.attachTag = Name;
gen.SetBase(Self);
gen.LifeSpan = 30;
gen.bRandomEject = True;
gen.ejectSpeed = 20;
gen.riseRate = 20;
gen.checkTime = 0.3;
gen.particleLifeSpan = 10;
gen.particleDrawScale = 0.5;
gen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
}
}

ZoneChange (ZoneInfo NewZone)


if (NewZone.bWaterZone)
ExtinguishFlare();

Super.ZoneChange(NewZone);




Flask.uc (extends DeusExDecoration)

FragType=Class'DeusEx.GlassFragment'
ItemName="Lab Flask"
Mesh=LodMesh'DeusExDeco.Flask'
CollisionRadius=4.300000
CollisionHeight=7.470000
Mass=5.000000
Buoyancy=3.000000



FleshFragment.uc (extends DeusExFragment)

Fragments(0)=LodMesh'DeusExItems.FleshFragment1'
Fragments(1)=LodMesh'DeusExItems.FleshFragment2'
Fragments(2)=LodMesh'DeusExItems.FleshFragment3'
Fragments(3)=LodMesh'DeusExItems.FleshFragment4'
numFragmentTypes=4
elasticity=0.400000
ImpactSound=Sound'DeusExSounds.Generic.FleshHit1'
MiscSound=Sound'DeusExSounds.Generic.FleshHit2'
Mesh=LodMesh'DeusExItems.FleshFragment1'
CollisionRadius=2.000000
CollisionHeight=2.000000
Mass=5.000000
Buoyancy=5.500000
bVisionImportant=True

BeginState


Super.BeginState();

Velocity = VRand() * 300;
DrawScale = FRand() + 1.5;

Tick (float deltaTime)


Super.Tick(deltaTime);

if (!IsInState('Dying'))
if (FRand() < 0.5)
Spawn(class'BloodDrop',,, Location);




Flowers.uc (extends DeusExDecoration)

FragType=Class'DeusEx.PlasticFragment'
ItemName="Flowers"
Mesh=LodMesh'DeusExDeco.Flowers'
CollisionRadius=11.880000
CollisionHeight=9.630000
Mass=20.000000
Buoyancy=10.000000



Fly.uc (extends Animal)

WalkingSpeed=1.000000
bHasShadow=False
bHighlight=False
bSpawnBubbles=False
bCanFly=True
GroundSpeed=100.000000
WaterSpeed=100.000000
AirSpeed=100.000000
AccelRate=500.000000
JumpZ=0.000000
MaxStepHeight=1.000000
MinHitWall=0.000000
BaseEyeHeight=1.000000
Health=1
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Fear
bTransient=True
Physics=PHYS_Flying
DrawType=DT_Mesh
Mesh=Mesh'DeusExCharacters.Fly'
DrawScale=1.400000
SoundRadius=6
SoundVolume=128
AmbientSound=Sound'DeusExSounds.Animal.FlyBuzz'
CollisionRadius=2.000000
CollisionHeight=1.000000
bBlockActors=False
bBlockPlayers=False
bBounce=True
Mass=0.100000
Buoyancy=0.100000
RotationRate=(Pitch=16384,Yaw=100000)
BindName="Fly"
FamiliarName="Fly"
UnfamiliarName="Fly"

BeginState


Super.BeginState();
BlockReactions();
Acceleration = vector(Rotation)*AccelRate;

HitWall (vector HitNormal, actor HitWall)


local rotator dir;
local float elasticity;
local float minVel, maxHVel;
local vector tempVect;


elasticity = 0.3;
Velocity = elasticity*((Velocity dot HitNormal) * HitNormal * (-2.0) + Velocity);
DesiredRotation = Rotation;

IsNearHome (vector position) -> bool


local bool bNear;


bNear = true;
if (bUseHome)
if (VSize(HomeLoc-position) > HomeExtent)
bNear = false;

return bNear;

PickDirection -> vector


local vector dirVector;
local rotator rot;


if (!IsNearHome(Location))
dirVector = Normal(homeLoc - Location)*AirSpeed*4;
else
dirVector = Velocity;
dirVector += VRand()*AirSpeed*2;
dirVector = Normal(dirVector);
rot = Rotator(dirVector);
if (VSize(Velocity) < AirSpeed*0.5)
{
Acceleration = dirVector*AirSpeed;
SetRotation(rot);
}
return vector(rot)*200+Location;

PlayWalking


LoopAnimPivot('Still');

Tick (float deltaTime)


Super.Tick(deltatime);

TweenToWalking (float tweentime)


TweenAnimPivot('Still', tweentime);




FlyGenerator.uc (extends PawnGenerator)

PawnClasses(0)=(Count=8,PawnClass=Class'DeusEx.Fly')
Alliance=Fly
bGeneratorIsHome=True
ActiveArea=700.000000
Radius=50.000000
MaxCount=3
bPawnsTransient=True
bLOSCheck=False

ZoneChange (ZoneInfo NewZone)


Super.ZoneChange(NewZone);

if (NewZone.bWaterZone)
StopGenerator();




FordSchick.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.FordSchickCarcass'
WalkingSpeed=0.213333
bImportant=True
BaseAssHeight=-23.000000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.FordSchickTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.FordSchickTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.FordSchickTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.FordSchickTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.FordSchickTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="FordSchick"
FamiliarName="Ford Schick"
UnfamiliarName="Ford Schick"



FordSchickCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.FordSchickTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.FordSchickTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.FordSchickTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.FordSchickTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.FordSchickTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



FrobDisplayWindow.uc (extends Window)

var float margin;
var float barLength;
var DeusExPlayer player;
var localized string msgLocked;
var localized string msgUnlocked;
var localized string msgLockStr;
var localized string msgDoorStr;
var localized string msgHackStr;
var localized string msgInf;
var localized string msgHacked;
var localized string msgPick;
var localized string msgPicks;
var localized string msgTool;
var localized string msgTools;
var Color colBackground;
var Color colBorder;
var Color colText;
margin=70.000000
barLength=50.000000
msgLocked="Locked"
msgUnlocked="Unlocked"
msgLockStr="Lock Str: "
msgDoorStr="Door Str: "
msgHackStr="Bypass Str: "
msgInf="INF"
msgHacked="Bypassed"
msgPick="pick"
msgPicks="picks"
msgTool="tool"
msgTools="tools"

DrawWindow (GC gc)


local actor frobTarget;
local float infoX, infoY, infoW, infoH;
local string strInfo;
local DeusExMover dxMover;
local Mover M;
local HackableDevices device;
local Vector centerLoc, v1, v2;
local float boxCX, boxCY, boxTLX, boxTLY, boxBRX, boxBRY, boxW, boxH;
local float corner, x, y;
local int i, j, k, offset;
local Color col;
local int numTools;


if (player != None)
{
frobTarget = player.FrobTarget;
if (frobTarget != None)
if (!player.IsHighlighted(frobTarget))
frobTarget = None;

if (frobTarget != None)
{
// move the box in and out based on time
offset = (24.0 * (frobTarget.Level.TimeSeconds % 0.3));

// draw a cornered targetting box
// get the center of the object
M = Mover(frobTarget);
if (M != None)
{
M.GetBoundingBox(v1, v2, False, M.KeyPos[M.KeyNum]+M.BasePos, M.KeyRot[M.KeyNum]+M.BaseRot);
centerLoc = v1 + (v2 - v1) * 0.5;
v1.X = 16;
v1.Y = 16;
v1.Z = 16;
}
else
{
centerLoc = frobTarget.Location;
v1.X = frobTarget.CollisionRadius;
v1.Y = frobTarget.CollisionRadius;
v1.Z = frobTarget.CollisionHeight;
}

ConvertVectorToCoordinates(centerLoc, boxCX, boxCY);

boxTLX = boxCX;
boxTLY = boxCY;
boxBRX = boxCX;
boxBRY = boxCY;

// get the smallest box to enclose actor
// modified from Scott's ActorDisplayWindow
for (i=-1; i<=1; i+=2)
{
for (j=-1; j<=1; j+=2)
{
for (k=-1; k<=1; k+=2)
{
v2 = v1;
v2.X *= i;
v2.Y *= j;
v2.Z *= k;
v2.X += centerLoc.X;
v2.Y += centerLoc.Y;
v2.Z += centerLoc.Z;

if (ConvertVectorToCoordinates(v2, x, y))
{
boxTLX = FMin(boxTLX, x);
boxTLY = FMin(boxTLY, y);
boxBRX = FMax(boxBRX, x);
boxBRY = FMax(boxBRY, y);
}
}
}
}

if (!frobTarget.IsA('Mover'))
{
boxTLX += frobTarget.CollisionRadius / 4.0;
boxTLY += frobTarget.CollisionHeight / 4.0;
boxBRX -= frobTarget.CollisionRadius / 4.0;
boxBRY -= frobTarget.CollisionHeight / 4.0;
}

boxTLX = FClamp(boxTLX, margin, width-margin);
boxTLY = FClamp(boxTLY, margin, height-margin);
boxBRX = FClamp(boxBRX, margin, width-margin);
boxBRY = FClamp(boxBRY, margin, height-margin);

boxW = boxBRX - boxTLX;
boxH = boxBRY - boxTLY;

// scale the corner based on the size of the box
corner = FClamp((boxW + boxH) * 0.1, 4.0, 40.0);

// make sure the box doesn't invert itself
if (boxBRX - boxTLX < corner)
{
boxTLX -= (corner+4);
boxBRX += (corner+4);
}
if (boxBRY - boxTLY < corner)
{
boxTLY -= (corner+4);
boxBRY += (corner+4);
}

// draw the drop shadow first, then normal
gc.SetTileColorRGB(0,0,0);
for (i=1; i>=0; i--)
{
gc.DrawBox(boxTLX+i+offset, boxTLY+i+offset, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(boxTLX+i+offset, boxTLY+i+offset, 1, corner, 0, 0, 1, Texture'Solid');

gc.DrawBox(boxBRX+i-corner-offset, boxTLY+i+offset, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(boxBRX+i-offset, boxTLY+i+offset, 1, corner, 0, 0, 1, Texture'Solid');

gc.DrawBox(boxTLX+i+offset, boxBRY+i-offset, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(boxTLX+i+offset, boxBRY+i-corner-offset, 1, corner, 0, 0, 1, Texture'Solid');

gc.DrawBox(boxBRX+i-corner+1-offset, boxBRY+i-offset, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(boxBRX+i-offset, boxBRY+i-corner-offset, 1, corner, 0, 0, 1, Texture'Solid');

gc.SetTileColor(colText);
}

// draw object-specific info
if (frobTarget.IsA('Mover'))
{
// get the door's lock and strength info
dxMover = DeusExMover(frobTarget);
if ((dxMover != None) && dxMover.bLocked)
{
strInfo = msgLocked $ CR() $ msgLockStr;
if (dxMover.bPickable)
strInfo = strInfo $ FormatString(dxMover.lockStrength * 100.0) $ "%";
else
strInfo = strInfo $ msgInf;

strInfo = strInfo $ CR() $ msgDoorStr;
if (dxMover.bBreakable)
strInfo = strInfo $ FormatString(dxMover.doorStrength * 100.0) $ "%";
else
strInfo = strInfo $ msgInf;
}
else
{
strInfo = msgUnlocked;
}

infoX = boxTLX + 10;
infoY = boxTLY + 10;

gc.SetFont(Font'FontMenuSmall_DS');
gc.GetTextExtent(0, infoW, infoH, strInfo);
infoW += 8;
if ((dxMover != None) && dxMover.bLocked)
infoW += barLength + 2;
infoH += 8;
infoX = FClamp(infoX, infoW/2+10, width-10-infoW/2);
infoY = FClamp(infoY, infoH/2+10, height-10-infoH/2);

// draw a dark background
gc.SetStyle(DSTY_Modulated);
gc.SetTileColorRGB(0, 0, 0);
gc.DrawPattern(infoX, infoY, infoW, infoH, 0, 0, Texture'ConWindowBackground');

// draw colored bars for each value
if ((dxMover != None) && dxMover.bLocked)
{
gc.SetStyle(DSTY_Translucent);
col = GetColorScaled(dxMover.lockStrength);
gc.SetTileColor(col);
gc.DrawPattern(infoX+(infoW-barLength-4), infoY+4+(infoH-8)/3, barLength*dxMover.lockStrength, ((infoH-8)/3)-2, 0, 0, Texture'ConWindowBackground');
col = GetColorScaled(dxMover.doorStrength);
gc.SetTileColor(col);
gc.DrawPattern(infoX+(infoW-barLength-4), infoY+4+2*(infoH-8)/3, barLength*dxMover.doorStrength, ((infoH-8)/3)-2, 0, 0, Texture'ConWindowBackground');
}

// draw the text
gc.SetTextColor(colText);
gc.DrawText(infoX+4, infoY+4, infoW-8, infoH-8, strInfo);

// draw the two highlight boxes
gc.SetStyle(DSTY_Translucent);
gc.SetTileColor(colBorder);
gc.DrawBox(infoX, infoY, infoW, infoH, 0, 0, 1, Texture'Solid');
gc.SetTileColor(colBackground);
gc.DrawBox(infoX+1, infoY+1, infoW-2, infoH-2, 0, 0, 1, Texture'Solid');

// draw the absolute number of lockpicks on top of the colored bar
if ((dxMover != None) && dxMover.bLocked && dxMover.bPickable)
{
numTools = int((dxMover.lockStrength / player.SkillSystem.GetSkillLevelValue(class'SkillLockpicking')) + 0.99);
if (numTools == 1)
strInfo = numTools @ msgPick;
else
strInfo = numTools @ msgPicks;
gc.DrawText(infoX+(infoW-barLength-2), infoY+4+(infoH-8)/3, barLength, ((infoH-8)/3)-2, strInfo);
}
}
else if (frobTarget.IsA('HackableDevices'))
{
// get the devices hack strength info
device = HackableDevices(frobTarget);
strInfo = DeusExDecoration(frobTarget).itemName $ CR() $ msgHackStr;
if (device.bHackable)
{
if (device.hackStrength != 0.0)
strInfo = strInfo $ FormatString(device.hackStrength * 100.0) $ "%";
else
strInfo = DeusExDecoration(frobTarget).itemName $ ": " $ msgHacked;
}
else
strInfo = strInfo $ msgInf;

infoX = boxTLX + 10;
infoY = boxTLY + 10;

gc.SetFont(Font'FontMenuSmall_DS');
gc.GetTextExtent(0, infoW, infoH, strInfo);
infoW += 8;
if (device.hackStrength != 0.0)
infoW += barLength + 2;
infoH += 8;
infoX = FClamp(infoX, infoW/2+10, width-10-infoW/2);
infoY = FClamp(infoY, infoH/2+10, height-10-infoH/2);

// draw a dark background
gc.SetStyle(DSTY_Modulated);
gc.SetTileColorRGB(0, 0, 0);
gc.DrawPattern(infoX, infoY, infoW, infoH, 0, 0, Texture'ConWindowBackground');

// draw a colored bar
if (device.hackStrength != 0.0)
{
gc.SetStyle(DSTY_Translucent);
col = GetColorScaled(device.hackStrength);
gc.SetTileColor(col);
gc.DrawPattern(infoX+(infoW-barLength-4), infoY+infoH/2, barLength*device.hackStrength, infoH/2-6, 0, 0, Texture'ConWindowBackground');
}

// draw the text
gc.SetTextColor(colText);
gc.DrawText(infoX+4, infoY+4, infoW-8, infoH-8, strInfo);

// draw the two highlight boxes
gc.SetStyle(DSTY_Translucent);
gc.SetTileColor(colBorder);
gc.DrawBox(infoX, infoY, infoW, infoH, 0, 0, 1, Texture'Solid');
gc.SetTileColor(colBackground);
gc.DrawBox(infoX+1, infoY+1, infoW-2, infoH-2, 0, 0, 1, Texture'Solid');

// draw the absolute number of multitools on top of the colored bar
if ((device.bHackable) && (device.hackStrength != 0.0))
{
numTools = int((device.hackStrength / player.SkillSystem.GetSkillLevelValue(class'SkillTech')) + 0.99);
if (numTools == 1)
strInfo = numTools @ msgTool;
else
strInfo = numTools @ msgTools;
gc.DrawText(infoX+(infoW-barLength-2), infoY+infoH/2, barLength, infoH/2-6, strInfo);
}
}
else if (!frobTarget.bStatic && player.bObjectNames)
{
// TODO: Check familiar vs. unfamiliar flags
if (frobTarget.IsA('Pawn'))
strInfo = player.GetDisplayName(frobTarget);
else if (frobTarget.IsA('DeusExCarcass'))
strInfo = DeusExCarcass(frobTarget).itemName;
else if (frobTarget.IsA('Inventory'))
strInfo = Inventory(frobTarget).itemName;
else if (frobTarget.IsA('DeusExDecoration'))
strInfo = player.GetDisplayName(frobTarget);
else if (frobTarget.IsA('DeusExProjectile'))
strInfo = DeusExProjectile(frobTarget).itemName;
else
strInfo = "DEFAULT ACTOR NAME - REPORT THIS AS A BUG - " $ frobTarget.GetItemName(String(frobTarget.Class));

infoX = boxTLX + 10;
infoY = boxTLY + 10;

gc.SetFont(Font'FontMenuSmall_DS');
gc.GetTextExtent(0, infoW, infoH, strInfo);
infoW += 8;
infoH += 8;
infoX = FClamp(infoX, infoW/2+10, width-10-infoW/2);
infoY = FClamp(infoY, infoH/2+10, height-10-infoH/2);

// draw a dark background
gc.SetStyle(DSTY_Modulated);
gc.SetTileColorRGB(0, 0, 0);
gc.DrawPattern(infoX, infoY, infoW, infoH, 0, 0, Texture'ConWindowBackground');

// draw the text
gc.SetTextColor(colText);
gc.DrawText(infoX+4, infoY+4, infoW-8, infoH-8, strInfo);

// draw the two highlight boxes
gc.SetStyle(DSTY_Translucent);
gc.SetTileColor(colBorder);
gc.DrawBox(infoX, infoY, infoW, infoH, 0, 0, 1, Texture'Solid');
gc.SetTileColor(colBackground);
gc.DrawBox(infoX+1, infoY+1, infoW-2, infoH-2, 0, 0, 1, Texture'Solid');
}
}
}

FormatString (float num) -> string


local string tempstr;


// round up
num += 0.5;

tempstr = Left(String(num), 3);

if (num < 100.0)
tempstr = Left(String(num), 2);
if (num < 10.0)
tempstr = Left(String(num), 1);

return tempstr;

InitWindow


Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colBackground = theme.GetColorFromName('HUDColor_Background');
colBorder = theme.GetColorFromName('HUDColor_Borders');
colText = theme.GetColorFromName('HUDColor_HeaderText');




Furniture.uc (extends DeusExDecoration)

FragType=Class'DeusEx.WoodFragment'



GameDirectory.uc (extends Object)

var int foo1, foo2, foo3;
var const native EGameDirectoryTypes gameDirectoryType; // Game Directory Type
var const native String currentFilter;
var const native array directoryList;
var const native array loadedSaveInfoPointers;
var const native DeusExSaveInfo tempSaveInfo;

DeleteSaveInfo (DeusExSaveInfo saveInfo) | native

GenerateNewSaveFilename (optional int newIndex) | native

GenerateSaveFilename (int saveIndex) | native

GetDirCount | native

GetDirFilename (int fileIndex) | native

GetGameDirectory | native

GetNewSaveFileIndex | native

GetSaveDirectorySize (int saveIndex) | native

GetSaveFreeSpace | native

GetSaveInfo (int fileIndex) | native

GetSaveInfoFromDirectoryIndex (int DirectoryIndex) | native

GetTempSaveInfo | native

PurgeAllSaveInfo | native

SetDirFilter (String strFilter) | native

SetDirType (EGameDirectoryTypes newDirType) | native




GarySavage.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.GarySavageCarcass'
WalkingSpeed=0.213333
bImportant=True
bInvincible=True
BaseAssHeight=-23.000000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.GarySavageTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(3)=Texture'DeusExCharacters.Skins.GarySavageTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.GarySavageTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex5'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex6'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="GarySavage"
FamiliarName="Gary Savage"
UnfamiliarName="Gary Savage"



GarySavageCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.GarySavageTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(3)=Texture'DeusExCharacters.Skins.GarySavageTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.GarySavageTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex5'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex6'



GasGrenade.uc (extends ThrownProjectile)

var float mpBlastRadius;
var float mpProxRadius;
var float mpGasDamage;
var float mpFuselength;
mpBlastRadius=512.000000
mpProxRadius=128.000000
mpGasDamage=20.000000
mpFuselength=1.500000
fuseLength=3.000000
proxRadius=128.000000
AISoundLevel=0.000000
bBlood=False
bDebris=False
DamageType=TearGas
spawnWeaponClass=Class'DeusEx.WeaponGasGrenade'
ItemName="Gas Grenade"
speed=1000.000000
MaxSpeed=1000.000000
Damage=10.000000
MomentumTransfer=50000
ImpactSound=Sound'DeusExSounds.Weapons.GasGrenadeExplode'
LifeSpan=0.000000
Mesh=LodMesh'DeusExItems.GasGrenadePickup'
CollisionRadius=4.300000
CollisionHeight=1.400000
Mass=5.000000
Buoyancy=2.000000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
blastRadius=mpBlastRadius;
proxRadius=mpProxRadius;
Damage=mpGasDamage;
fuseLength=mpFuseLength;
bIgnoresNanoDefense=True;
}




GeneratorScout.uc (extends Pawn)

bHidden=True
bDetectable=False
CollisionRadius=52.000000
CollisionHeight=50.000000
bCollideActors=False
bCollideWorld=False
bBlockActors=False
bBlockPlayers=False
bProjTarget=False
Mass=0.000000



GilbertRenton.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.GilbertRentonCarcass'
WalkingSpeed=0.213333
bImportant=True
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.GilbertRentonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.GilbertRentonTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.GilbertRentonTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.GilbertRentonTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.GilbertRentonTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="GilbertRenton"
FamiliarName="Gilbert Renton"
UnfamiliarName="Gilbert Renton"



GilbertRentonCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.GilbertRentonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.GilbertRentonTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.GilbertRentonTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.GilbertRentonTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.GilbertRentonTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



GlassFragment.uc (extends DeusExFragment)

Fragments(0)=LodMesh'DeusExItems.GlassFragment1'
Fragments(1)=LodMesh'DeusExItems.GlassFragment2'
Fragments(2)=LodMesh'DeusExItems.GlassFragment3'
numFragmentTypes=3
elasticity=0.300000
ImpactSound=Sound'DeusExSounds.Generic.GlassHit1'
MiscSound=Sound'DeusExSounds.Generic.GlassHit2'
Mesh=LodMesh'DeusExItems.GlassFragment1'
CollisionRadius=6.000000
CollisionHeight=0.000000
Mass=5.000000
Buoyancy=4.000000



GoalCompleteTrigger.uc (extends Trigger)

var() name goalName;
bTriggerOnceOnly=True

Touch (Actor Other)


local DeusExGoal goal;
local DeusExPlayer player;


Super.Touch(Other);

if (IsRelevant(Other))
{
player = DeusExPlayer(GetPlayerPawn());

if (player != None)
{
// First check to see if this goal exists
goal = player.FindGoal(goalName);

if (goal != None)
player.GoalCompleted(goalName);
}
}

Trigger (Actor Other, Pawn Instigator)


local DeusExGoal goal;
local DeusExPlayer player;


Super.Trigger(Other, Instigator);

player = DeusExPlayer(GetPlayerPawn());

if (player != None)
{
// First check to see if this goal exists
goal = player.FindGoal(goalName);

if (goal != None)
player.GoalCompleted(goalName);
}




GordonQuick.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.GordonQuickCarcass'
WalkingSpeed=0.213333
bImportant=True
bInvincible=True
BaseAssHeight=-23.000000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.GordonQuickTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.GordonQuickTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.GordonQuickTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.GordonQuickTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.GordonQuickTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.GordonQuickTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="GordonQuick"
FamiliarName="Gordon Quick"
UnfamiliarName="Gordon Quick"



GordonQuickCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.GordonQuickTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.GordonQuickTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.GordonQuickTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.GordonQuickTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.GordonQuickTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.GordonQuickTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Gray.uc (extends Animal)

var float damageRadius;
var float damageInterval;
var float damageAmount;
var float damageTime;
DamageRadius=256.000000
damageInterval=1.000000
DamageAmount=10.000000
bPlayDying=True
MinHealth=10.000000
CarcassType=Class'DeusEx.GrayCarcass'
WalkingSpeed=0.280000
bCanBleed=True
CloseCombatMult=0.500000
ShadowScale=0.750000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponGraySwipe')
InitialInventory(1)=(Inventory=Class'DeusEx.WeaponGraySpit')
InitialInventory(2)=(Inventory=Class'DeusEx.AmmoGraySpit',Count=9999)
WalkSound=Sound'DeusExSounds.Animal.GrayFootstep'
GroundSpeed=350.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
BaseEyeHeight=25.000000
Health=50
ReducedDamageType=Radiation
ReducedDamagePct=1.000000
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
HitSound1=Sound'DeusExSounds.Animal.GrayPainSmall'
HitSound2=Sound'DeusExSounds.Animal.GrayPainLarge'
Die=Sound'DeusExSounds.Animal.GrayDeath'
Alliance=Gray
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Gray'
AmbientGlow=12
SoundRadius=14
SoundVolume=255
AmbientSound=Sound'Ambient.Ambient.GeigerLoop'
CollisionRadius=28.540001
CollisionHeight=36.000000
LightType=LT_Steady
LightBrightness=32
LightHue=96
LightSaturation=128
LightRadius=5
Mass=120.000000
Buoyancy=97.000000
BindName="Gray"
FamiliarName="Gray"
UnfamiliarName="Gray"

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
else if (damageType == 'Stunned')
GotoNextState();
else if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

PlayAttack


if ((Weapon != None) && Weapon.IsA('WeaponGraySpit'))
PlayAnimPivot('Shoot');
else
PlayAnimPivot('Attack');

PlayCriticalDamageSound


PlaySound(sound'GrayFlee', SLOT_None);

PlayIdleSound


if (FRand() < 0.5)
PlaySound(sound'GrayIdle', SLOT_None);
else
PlaySound(sound'GrayIdle2', SLOT_None);

PlayPanicRunning


PlayRunning();

PlayRunning


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('Run');

PlayScanningSound


if (FRand() < 0.3)
{
if (FRand() < 0.5)
PlaySound(sound'GrayIdle', SLOT_None);
else
PlaySound(sound'GrayIdle2', SLOT_None);
}

PlayTakingHit (EHitLocation hitPos)


local vector pivot;
local name animName;


animName = '';
if (!Region.Zone.bWaterZone)
{
switch (hitPos)
{
case HITLOC_HeadFront:
case HITLOC_TorsoFront:
case HITLOC_LeftArmFront:
case HITLOC_RightArmFront:
case HITLOC_LeftLegFront:
case HITLOC_RightLegFront:
animName = 'HitFront';
break;

case HITLOC_HeadBack:
case HITLOC_TorsoBack:
case HITLOC_LeftArmBack:
case HITLOC_RightArmBack:
case HITLOC_LeftLegBack:
case HITLOC_RightLegBack:
animName = 'HitBack';
break;
}
pivot = vect(0,0,0);
}

if (animName != '')
PlayAnimPivot(animName, , 0.1, pivot);

PlayTargetAcquiredSound


PlaySound(sound'GrayAlert', SLOT_None);

PlayTurning


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('Walk', 0.1);

PlayWaiting


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('BreatheLight', , 0.3);

PlayWalking


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('Walk', , 0.15);

Tick (float deltaTime)


local DeusExPlayer player;


damageTime += deltaTime;

if (damageTime >= damageInterval)
{
damageTime = 0;
foreach VisibleActors(class'DeusExPlayer', player, damageRadius)
if (player != None)
player.TakeDamage(damageAmount, Self, player.Location, vect(0,0,0), 'Radiation');
}

Super.Tick(deltaTime);

TweenToAttack (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
TweenAnimPivot('Attack', tweentime);

TweenToRunning (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
LoopAnimPivot('Run',, tweentime);

TweenToWaiting (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
TweenAnimPivot('BreatheLight', tweentime);

TweenToWalking (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
TweenAnimPivot('Walk', tweentime);




GrayCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GrayCarcass2'
Mesh3=LodMesh'DeusExCharacters.GrayCarcass2'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.GrayCarcass'
AmbientGlow=12
CollisionRadius=36.000000
CollisionHeight=6.240000
LightType=LT_Steady
LightBrightness=10
LightHue=96
LightSaturation=128
LightRadius=5



GraySpit.uc (extends DeusExProjectile)

DamageType=Radiation
AccurateRange=300
maxRange=450
bIgnoresNanoDefense=True
speed=350.000000
MaxSpeed=400.000000
Damage=8.000000
MomentumTransfer=200
SpawnSound=Sound'DeusExSounds.Animal.GrayShoot'
Style=STY_Translucent
Mesh=LodMesh'DeusExItems.GraySpit'
ScaleGlow=2.000000
bFixedRotationDir=True
RotationRate=(Pitch=0,Yaw=0,Roll=131071)

Tick (float deltaTime)


time += deltaTime;

// scale it up as it flies
DrawScale = FClamp(2.5*(time+0.5), 1.0, 6.0);




Greasel.uc (extends Animal)

bPlayDying=True
FoodClass=Class'DeusEx.DeusExCarcass'
FoodDamage=5
FoodHealth=2
bMessyEater=True
MinHealth=20.000000
CarcassType=Class'DeusEx.GreaselCarcass'
WalkingSpeed=0.080000
bCanBleed=True
ShadowScale=1.000000
InitialAlliances(0)=(AllianceName=Karkian,AllianceLevel=1.000000,bPermanent=True)
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponGreaselSpit')
InitialInventory(1)=(Inventory=Class'DeusEx.AmmoGreaselSpit',Count=9999)
WalkSound=Sound'DeusExSounds.Animal.GreaselFootstep'
bSpawnBubbles=False
bCanSwim=True
bCanGlide=False
GroundSpeed=350.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
BaseEyeHeight=12.500000
Health=100
UnderWaterTime=99999.000000
AttitudeToPlayer=ATTITUDE_Ignore
HitSound1=Sound'DeusExSounds.Animal.GreaselPainSmall'
HitSound2=Sound'DeusExSounds.Animal.GreaselPainLarge'
Die=Sound'DeusExSounds.Animal.GreaselDeath'
Alliance=Greasel
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Greasel'
CollisionHeight=17.879999
Mass=40.000000
Buoyancy=40.000000
BindName="Greasel"
FamiliarName="Greasel"
UnfamiliarName="Greasel"

GetChompPosition -> vector


return (Location+Vector(Rotation)*(CollisionRadius+10)+vect(0,0,-10));

GetSwimPivot -> vector


// THIS IS A HIDEOUS, UGLY, MASSIVELY EVIL HACK!!!!
return (vect(0,0,1)*CollisionHeight);

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
else if ((damageType == 'TearGas') || (damageType == 'HalonGas'))
GotoNextState();
else if (damageType == 'Stunned')
GotoNextState();
else if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

PlayAttack


PlayAnimPivot('Attack');

PlayCriticalDamageSound


PlaySound(sound'GreaselFlee', SLOT_None);

PlayEating


PlayAnimPivot('Eat', 2.0, 0.2);

PlayEatingSound


PlaySound(sound'GreaselEat', SLOT_None,,, 384);

PlayIdleSound


if (FRand() < 0.5)
PlaySound(sound'GreaselIdle', SLOT_None);
else
PlaySound(sound'GreaselIdle2', SLOT_None);

PlayPanicRunning


PlayRunning();

PlayRunning


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',1.5,,, GetSwimPivot());
else
LoopAnimPivot('Run', 1.5);

PlayScanningSound


if (FRand() < 0.3)
{
if (FRand() < 0.5)
PlaySound(sound'GreaselIdle', SLOT_None);
else
PlaySound(sound'GreaselIdle2', SLOT_None);
}

PlayTakingHit (EHitLocation hitPos)


local vector pivot;
local name animName;


animName = '';
if (!Region.Zone.bWaterZone)
{
switch (hitPos)
{
case HITLOC_HeadFront:
case HITLOC_TorsoFront:
case HITLOC_LeftArmFront:
case HITLOC_RightArmFront:
case HITLOC_LeftLegFront:
case HITLOC_RightLegFront:
animName = 'HitFront';
break;

case HITLOC_HeadBack:
case HITLOC_TorsoBack:
case HITLOC_LeftArmBack:
case HITLOC_RightArmBack:
case HITLOC_LeftLegBack:
case HITLOC_RightLegBack:
animName = 'HitBack';
break;
}
pivot = vect(0,0,0);
}

if (animName != '')
PlayAnimPivot(animName, , 0.1, pivot);


PlayTargetAcquiredSound


PlaySound(sound'GreaselAlert', SLOT_None);

PlayTurning


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('Walk', 0.1);

PlayWaiting


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',1.5,,, GetSwimPivot());
else
LoopAnimPivot('BreatheLight', , 0.3);

PlayWalking


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('Walk', , 0.15);

SpewBlood (vector Position)


local float size;
local FleshFragment chunk;


size = (CollisionRadius + CollisionHeight) / 2; // yes, we *are* using the Greasel's size... :)
if ((FRand() < 0.5) && (size > 10.0))
{
chunk = spawn(class'FleshFragment', None,, Position);
if (chunk != None)
{
chunk.DrawScale = size / 25;
chunk.SetCollisionSize(chunk.CollisionRadius / chunk.DrawScale, chunk.CollisionHeight / chunk.DrawScale);
chunk.bFixedRotationDir = True;
chunk.RotationRate = RotRand(False);
chunk.Velocity = VRand()*100;
chunk.Velocity.Z = chunk.Velocity.Z + 250;
}
}
else
Super.SpewBlood(Position);

TweenToAttack (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
TweenAnimPivot('Attack', tweentime);

TweenToRunning (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
LoopAnimPivot('Run',, tweentime);

TweenToWaiting (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
TweenAnimPivot('BreatheLight', tweentime);

TweenToWalking (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
TweenAnimPivot('Walk', tweentime);




GreaselCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GreaselCarcass'
Mesh3=LodMesh'DeusExCharacters.GreaselCarcass'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.GreaselCarcass'
CollisionRadius=36.000000
CollisionHeight=6.650000



GreaselSpit.uc (extends DeusExProjectile)

DamageType=Poison
AccurateRange=300
maxRange=450
bIgnoresNanoDefense=True
speed=600.000000
MaxSpeed=800.000000
Damage=8.000000
MomentumTransfer=400
SpawnSound=Sound'DeusExSounds.Animal.GreaselShoot'
Style=STY_Translucent
Mesh=LodMesh'DeusExItems.GreaselSpit'

Tick (float DeltaTime)


local SmokeTrail s;


Super.Tick(DeltaTime);

time += DeltaTime;
if ((time > FRand() * 0.02) && (Level.NetMode != NM_DedicatedServer))
{
time = 0;

// spawn some trails
s = Spawn(class'SmokeTrail',,, Location);
if (s != None)
{
s.DrawScale = FRand() * 0.05;
s.OrigScale = s.DrawScale;
s.Texture = Texture'Effects.Smoke.Gas_Poison_A';
s.Velocity = VRand() * 50;
s.OrigVel = s.Velocity;
}
}




GuntherHermann.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.GuntherHermannCarcass'
WalkingSpeed=0.350000
bImportant=True
bInvincible=True
CloseCombatMult=0.500000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponAssaultGun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCombatKnife')
InitialInventory(3)=(Inventory=Class'DeusEx.WeaponFlamethrower')
InitialInventory(4)=(Inventory=Class'DeusEx.AmmoNapalm',Count=2)
BurnPeriod=0.000000
walkAnimMult=0.750000
GroundSpeed=210.000000
BaseEyeHeight=44.000000
Health=400
HealthHead=600
HealthTorso=400
HealthLegLeft=400
HealthLegRight=400
HealthArmLeft=400
HealthArmRight=400
Texture=Texture'DeusExItems.Skins.BlackMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_B'
DrawScale=1.100000
MultiSkins(0)=Texture'DeusExCharacters.Skins.GuntherHermannTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex9'
MultiSkins(2)=Texture'DeusExCharacters.Skins.GuntherHermannTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.GuntherHermannTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=24.200001
CollisionHeight=55.660000
BindName="GuntherHermann"
FamiliarName="Gunther Hermann"
UnfamiliarName="Gunther Hermann"

BeginState


StandUp();
LastPainTime = Level.TimeSeconds;
LastPainAnim = AnimSequence;
bInterruptState = false;
BlockReactions();
bCanConverse = False;
bStasis = False;
SetDistress(true);
TakeHitTimer = 2.0;
EnemyReadiness = 1.0;
ReactionLevel = 1.0;
bInTransientState = true;

Explode


local SphereEffect sphere;
local ScorchMark s;
local ExplosionLight light;
local int i;
local float explosionDamage;
local float explosionRadius;


explosionDamage = 100;
explosionRadius = 256;

// alert NPCs that I'm exploding
AISendEvent('LoudNoise', EAITYPE_Audio, , explosionRadius*16);
PlaySound(Sound'LargeExplosion1', SLOT_None,,, explosionRadius*16);

// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, Location);
if (light != None)
light.size = 4;

Spawn(class'ExplosionSmall',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionMedium',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionMedium',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionLarge',,, Location + 2*VRand()*CollisionRadius);

sphere = Spawn(class'SphereEffect',,, Location);
if (sphere != None)
sphere.size = explosionRadius / 32.0;

// spawn a mark
s = spawn(class'ScorchMark', Base,, Location-vect(0,0,1)*CollisionHeight, Rotation+rot(16384,0,0));
if (s != None)
{
s.DrawScale = FClamp(explosionDamage/30, 0.1, 3.0);
s.ReattachDecal();
}

// spawn some rocks and flesh fragments
for (i=0; i {
if (FRand() < 0.3)
spawn(class'Rockchip',,,Location);
else
spawn(class'FleshFragment',,,Location);
}

HurtRadius(explosionDamage, explosionRadius, 'Exploded', explosionDamage*100, Location);

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

ShieldDamage (name damageType) -> float


// handle special damage types
if ((damageType == 'Flamed') || (damageType == 'Burned') || (damageType == 'Stunned') ||
(damageType == 'KnockedOut'))
return 0.0;
else if ((damageType == 'TearGas') || (damageType == 'PoisonGas') || (damageType == 'HalonGas') ||
(damageType == 'Radiation') || (damageType == 'Shocked') || (damageType == 'Poison') ||
(damageType == 'PoisonEffect'))
return 0.1;
else
return Super.ShieldDamage(damageType);

SpawnCarcass -> Carcass


if (bStunned)
return Super.SpawnCarcass();

Explode();

return None;




GuntherHermannCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_B_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_B_CarcassC'
Texture=Texture'DeusExItems.Skins.BlackMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_B_Carcass'
DrawScale=1.100000
MultiSkins(0)=Texture'DeusExCharacters.Skins.GuntherHermannTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex9'
MultiSkins(2)=Texture'DeusExCharacters.Skins.GuntherHermannTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.GuntherHermannTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=44.000000
CollisionHeight=7.700000



HECannister20mm.uc (extends DeusExProjectile)

var ParticleGenerator smokeGen;
bExplodes=True
bBlood=True
bDebris=True
blastRadius=512.000000
DamageType=exploded
AccurateRange=400
maxRange=800
ItemName="HE 20mm Shell"
ItemArticle="a"
speed=1000.000000
MaxSpeed=1000.000000
Damage=150.000000
MomentumTransfer=40000
SpawnSound=Sound'DeusExSounds.Weapons.GEPGunFire'
ImpactSound=Sound'DeusExSounds.Generic.MediumExplosion2'
ExplosionDecal=Class'DeusEx.ScorchMark'
Mesh=LodMesh'DeusExItems.HECannister20mm'

Destroyed


if (smokeGen != None)
smokeGen.DelayedDestroy();

Super.Destroyed();

PostBeginPlay


Super.PostBeginPlay();

if (Level.NetMode == NM_DedicatedServer)
return;

SpawnSmokeEffects();

PostNetBeginPlay


Super.PostNetBeginPlay();

if (Role != ROLE_Authority)
SpawnSmokeEffects();

SpawnSmokeEffects


smokeGen = Spawn(class'ParticleGenerator', Self);
if (smokeGen != None)
{
smokeGen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
smokeGen.particleDrawScale = 0.3;
smokeGen.checkTime = 0.02;
smokeGen.riseRate = 8.0;
smokeGen.ejectSpeed = 0.0;
smokeGen.particleLifeSpan = 2.0;
smokeGen.bRandomEject = True;
smokeGen.SetBase(Self);
smokeGen.RemoteRole = ROLE_None;
}




HKBirdcage.uc (extends HangingDecoration)

FragType=Class'DeusEx.WoodFragment'
ItemName="Birdcage"
Mesh=LodMesh'DeusExDeco.HKBirdcage'
PrePivot=(Z=27.000000)
CollisionRadius=10.000000
CollisionHeight=27.000000
Mass=50.000000
Buoyancy=5.000000



HKBuddha.uc (extends HongKongDecoration)

ItemName="Buddha Statue"
Mesh=LodMesh'DeusExDeco.HKBuddha'
CollisionRadius=36.000000
CollisionHeight=53.799999
Mass=200.000000
Buoyancy=5.000000



HKChair.uc (extends Seat)

sitPoint(0)=(X=0.000000,Y=-8.000000,Z=0.000000)
ItemName="Chair"
Mesh=LodMesh'DeusExDeco.HKChair'
CollisionRadius=17.000000
CollisionHeight=32.000000
Mass=50.000000
Buoyancy=5.000000



HKCouch.uc (extends Seat)

sitPoint(0)=(X=0.000000,Y=-10.000000,Z=5.000000)
ItemName="Bench"
Mesh=LodMesh'DeusExDeco.HKCouch'
CollisionRadius=40.000000
CollisionHeight=15.500000
Mass=200.000000
Buoyancy=5.000000



HKHangingLantern.uc (extends HangingDecoration)

FragType=Class'DeusEx.PaperFragment'
ItemName="Paper Lantern"
Mesh=LodMesh'DeusExDeco.HKHangingLantern'
PrePivot=(Z=13.000000)
CollisionRadius=7.000000
CollisionHeight=13.000000
Mass=20.000000
Buoyancy=5.000000



HKHangingLantern2.uc (extends HangingDecoration)

var() ESkinColor SkinColor;
FragType=Class'DeusEx.PaperFragment'
ItemName="Paper Lantern"
Mesh=LodMesh'DeusExDeco.HKHangingLantern2'
PrePivot=(Z=11.000000)
CollisionRadius=7.000000
CollisionHeight=11.000000
Mass=20.000000
Buoyancy=5.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_RedGreen: Skin = Texture'HKHangingLantern2Tex1'; break;
case SC_YellowBlue: Skin = Texture'HKHangingLantern2Tex2'; break;
case SC_BluePurple: Skin = Texture'HKHangingLantern2Tex3'; break;
}




HKHangingPig.uc (extends HangingDecoration)

HitPoints=100
FragType=Class'DeusEx.FleshFragment'
ItemName="Slaughtered Pig"
Mesh=LodMesh'DeusExDeco.HKHangingPig'
PrePivot=(Z=47.000000)
CollisionRadius=10.000000
CollisionHeight=47.000000
Mass=100.000000
Buoyancy=5.000000

SpawnBlood (Vector HitLocation, float Damage)


local int i;


spawn(class'BloodSpurt',,,HitLocation);
spawn(class'BloodDrop',,,HitLocation);
for (i=0; i spawn(class'BloodDrop',,,HitLocation);

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);
if ((DamageType == 'Shot') || (DamageType == 'Exploded'))
SpawnBlood(HitLocation, Damage);




HKIncenseBurner.uc (extends HongKongDecoration)

var ParticleGenerator smokeGen;
FragType=Class'DeusEx.WoodFragment'
bHighlight=True
ItemName="Incense Burner"
Mesh=LodMesh'DeusExDeco.HKIncenseBurner'
SoundRadius=8
SoundVolume=32
SoundPitch=72
AmbientSound=Sound'DeusExSounds.Generic.Flare'
CollisionRadius=13.000000
CollisionHeight=27.000000
Mass=20.000000
Buoyancy=5.000000

Destroyed


if (smokeGen != None)
smokeGen.DelayedDestroy();

Super.Destroyed();

PostBeginPlay


Super.PostBeginPlay();

SetBase(Owner);
smokeGen = Spawn(class'ParticleGenerator', Self,, Location + vect(0,0,1) * CollisionHeight * 0.6, rot(16384,0,0));
if (smokeGen != None)
{
smokeGen.particleDrawScale = 0.2;
smokeGen.checkTime = 0.25;
smokeGen.frequency = 0.9;
smokeGen.riseRate = 0.0;
smokeGen.ejectSpeed = 10.0;
smokeGen.particleLifeSpan = 4.0;
smokeGen.bRandomEject = True;
smokeGen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
smokeGen.SetBase(Self);
}




HKMarketLight.uc (extends HangingDecoration)

FragType=Class'DeusEx.GlassFragment'
ItemName="Hanging Light"
Mesh=LodMesh'DeusExDeco.HKMarketLight'
PrePivot=(Z=24.000000)
bUnlit=True
CollisionRadius=8.000000
CollisionHeight=24.000000
Mass=20.000000
Buoyancy=5.000000



HKMarketTable.uc (extends HongKongDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Table"
Mesh=LodMesh'DeusExDeco.HKMarketTable'
CollisionRadius=39.000000
CollisionHeight=18.799999
Mass=60.000000
Buoyancy=5.000000



HKMarketTarp.uc (extends HongKongDecoration)

var() bool bRandomize;
var bool bBlowing;
bRandomize=True
FragType=Class'DeusEx.PaperFragment'
ItemName="Canvas Tarp"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.HKMarketTarp'
CollisionRadius=72.000000
CollisionHeight=15.000000
Mass=20.000000
Buoyancy=5.000000

BeginPlay


Super.BeginPlay();

if (!bRandomize)
LoopAnim('Blowing');

Tick (float deltaTime)


Super.Tick(deltaTime);

if (!bRandomize)
return;

if (!bBlowing)
{
if (FRand() < 0.001)
{
LoopAnim('Blowing');
bBlowing = True;
}
}
else
{
if (FRand() < 0.001)
{
TweenAnim('Still', 0.1);
bBlowing = False;
}
}




HKMilitary.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.HKMilitaryCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.780000
GroundSpeed=200.000000
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(1)=Texture'DeusExCharacters.Skins.HKMilitaryTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.HKMilitaryTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="HKMilitary"
FamiliarName="Chinese Military"
UnfamiliarName="Chinese Military"



HKMilitaryCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(1)=Texture'DeusExCharacters.Skins.HKMilitaryTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.HKMilitaryTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



HKTable.uc (extends HongKongDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Table"
Mesh=LodMesh'DeusExDeco.HKTable'
CollisionRadius=56.000000
CollisionHeight=21.000000
Mass=400.000000
Buoyancy=5.000000



HKTukTuk.uc (extends HongKongDecoration)

FragType=Class'DeusEx.WoodFragment'
bFloating=True
bCanBeBase=True
ItemName="TukTuk"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.HKTukTuk'
CollisionRadius=140.000000
CollisionHeight=41.000000
Mass=4000.000000
Buoyancy=5000.000000



HUDActiveAug.uc (extends HUDActiveItemBase)

var Color colBlack;
var Color colAugActive;
var Color colAugInactive;
var int hotKeyNum;
var String hotKeyString;
colAugActive=(R=255,G=255)
colAugInactive=(R=100,G=100,B=100)
colItemIcon=(B=0)

DrawHotKey (GC gc)


gc.SetAlignments(HALIGN_Right, VALIGN_Top);
gc.SetFont(Font'FontTiny');

// Draw Dropshadow
gc.SetTextColor(colBlack);
gc.DrawText(16, 1, 15, 8, hotKeyString);

// Draw Dropshadow
gc.SetTextColor(colText);
gc.DrawText(17, 0, 15, 8, hotKeyString);

SetKeyNum (int newNumber)


// Get the function key and set the text
hotKeyNum = newNumber;
hotKeyString = "F" $ String(hotKeyNum);

SetObject (object newClientObject)


if (newClientObject.IsA('Augmentation'))
{
// Get the function key and set the text
SetKeyNum(Augmentation(newClientObject).GetHotKey());
UpdateAugIconStatus();
}

UpdateAugIconStatus


local Augmentation aug;


aug = Augmentation(GetClientObject());

if (aug != None)
{
if (aug.IsActive())
colItemIcon = colAugActive;
else
colItemIcon = colAugInactive;
}




HUDActiveAugsBorder.uc (extends HUDActiveItemsBorderBase)

var int FirstKeyNum;
var int LastKeyNum;
FirstKeyNum=3
LastKeyNum=12
texBorderTop=Texture'DeusExUI.UserInterface.HUDAugmentationsBorder_Top'
texBorderCenter=Texture'DeusExUI.UserInterface.HUDAugmentationsBorder_Center'
texBorderBottom=Texture'DeusExUI.UserInterface.HUDAugmentationsBorder_Bottom'
borderTopMargin=13
borderBottomMargin=9
borderWidth=62
topHeight=37
topOffset=26
bottomHeight=32
bottomOffset=28
tilePosX=20
tilePosY=13

AddIcon (Texture newIcon, Object saveObject)


local HUDActiveAug augItem;


augItem = FindAugWindowByKey(Augmentation(saveObject));

if (augItem != None)
{
augItem.SetIcon(newIcon);
augItem.SetClientObject(saveObject);
augItem.SetObject(saveObject);
augItem.Show();

// Hide if there are no icons visible
if (++iconCount == 1)
Show();

AskParentForReconfigure();
}

ClearAugmentationDisplay


local Window currentWindow;
local Window foundWindow;


// Loop through all our children and check to see if
// we have a match.

currentWindow = winIcons.GetTopChild();
while(currentWindow != None)
{
currentWindow.Hide();
currentWindow.SetClientObject(None);
currentWindow = currentWindow.GetLowerSibling();
}

iconCount = 0;

CreateIcons


local int keyIndex;
local HUDActiveAug iconWindow;


for(keyIndex=FirstKeyNum; keyIndex<=LastKeyNum; keyIndex++)
{
iconWindow = HUDActiveAug(winIcons.NewChild(Class'HUDActiveAug'));
iconWindow.SetKeyNum(keyIndex);
iconWindow.Hide();
}

FindAugWindowByKey (Augmentation anAug) -> HUDActiveAug


local Window currentWindow;
local Window foundWindow;


// Loop through all our children and check to see if
// we have a match.

currentWindow = winIcons.GetTopChild(False);

while(currentWindow != None)
{
if (HUDActiveAug(currentWindow).HotKeyNum == anAug.HotKeyNum)
{
foundWindow = currentWindow;
break;
}

currentWindow = currentWindow.GetLowerSibling(False);
}

return HUDActiveAug(foundWindow);

InitWindow


Super.InitWindow();

// Create *ALL* the icons, but hide them.
CreateIcons();

RemoveObject (Object removeObject)


local HUDActiveAug augItemWindow;


augItemWindow = FindAugWindowByKey(Augmentation(removeObject));

if (augItemWindow != None)
{
augItemWindow.Hide();
augItemWindow.SetClientObject(None);

// Hide if there are no icons visible
if (--iconCount == 0)
Hide();

AskParentForReconfigure();
}

UpdateAugIconStatus (Augmentation aug)


local HUDActiveAug iconWindow;


// First make sure this object isn't already in the window
iconWindow = HUDActiveAug(winIcons.GetTopChild());
while(iconWindow != None)
{
// Abort if this object already exists!!
if (iconWindow.GetClientObject() == aug)
{
iconWindow.UpdateAugIconStatus();
break;
}
iconWindow = HUDActiveAug(iconWindow.GetLowerSibling());
}




HUDActiveItem.uc (extends HUDActiveItemBase)

var ProgressBarWindow winEnergy;
iconDrawStyle=DSTY_Masked

CreateEnergyBar


winEnergy = ProgressBarWindow(NewChild(Class'ProgressBarWindow'));
winEnergy.SetSize(32, 2);
winEnergy.UseScaledColor(True);
winEnergy.SetPos(1, 30);
winEnergy.SetValues(0, 100);
winEnergy.SetCurrentValue(0);
winEnergy.SetVertical(False);

InitWindow


Super.InitWindow();

CreateEnergyBar();

bTickEnabled = TRUE;

Tick (float deltaSeconds)


local ChargedPickup item;


item = ChargedPickup(GetClientObject());

if ((item != None) && (Player.PlayerIsRemoteClient()))
if (!VerifyItemCarried())
{
Player.RemoveChargedDisplay(item);
item = None;
}


if ((item != None) && (winEnergy != None))
{
winEnergy.SetCurrentValue(item.GetCurrentCharge());
}


VerifyItemCarried -> bool


local inventory CurrentItem;
local bool bFound;


bFound = false;

for (CurrentItem = player.Inventory; ((CurrentItem != None) && (!bFound)); CurrentItem = CurrentItem.inventory)
{
if (CurrentItem == GetClientObject())
bFound = true;
}

return bFound;




HUDActiveItemBase.uc (extends HUDBaseWindow)

var Color colItemIcon;
var EDrawStyle iconDrawStyle;
var int iconWidth;
var int iconHeight;
var Texture icon;
var Texture texBackground;
colItemIcon=(R=255,G=255,B=255)
iconDrawStyle=DSTY_Translucent
IconWidth=34
IconHeight=34
texBackground=Texture'DeusExUI.UserInterface.HUDIconsBackground'

DrawBackground (GC gc)


gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawTexture(0, 0, width, height, 0, 0, texBackground);

DrawHotKey (GC gc)

DrawWindow (GC gc)


Super.DrawWindow(gc);

if (icon != None)
{
// Now draw the icon
gc.SetStyle(iconDrawStyle);
gc.SetTileColor(colItemIcon);
gc.DrawTexture(2, 2, 32, 32, 0, 0, icon);
}

DrawHotKey(gc);

InitWindow


Super.InitWindow();

SetSize(iconWidth, iconHeight);

SetIcon (Texture newIcon)


icon = newIcon;

SetIconMasked (bool bNewMask)


if (bNewMask)
iconDrawStyle = DSTY_Masked;
else
iconDrawStyle = DSTY_Translucent;

SetObject (object newClientObject)




HUDActiveItemsBorder.uc (extends HUDActiveItemsBorderBase)

texBorderTop=Texture'DeusExUI.UserInterface.HUDItemsBorder_Top'
texBorderCenter=Texture'DeusExUI.UserInterface.HUDItemsBorder_Center'
texBorderBottom=Texture'DeusExUI.UserInterface.HUDItemsBorder_Bottom'
borderTopMargin=7
borderBottomMargin=6
borderWidth=48
topHeight=36
topOffset=21
bottomHeight=30
bottomOffset=23
tilePosX=6
tilePosY=7



HUDActiveItemsBorderBase.uc (extends HUDBaseWindow)

var TileWindow winIcons;
var int iconCount;
var Texture texBorderTop;
var Texture texBorderCenter;
var Texture texBorderBottom;
var int borderTopMargin;
var int borderBottomMargin;
var int borderWidth;
var int topHeight;
var int topOffset;
var int bottomHeight;
var int bottomOffset;
var int tilePosX;
var int tilePosY;

AddIcon (Texture newIcon, Object saveObject)


local HUDActiveItemBase activeItem;
local HUDActiveItemBase iconWindow;


// First make sure this object isn't already in the window
iconWindow = HUDActiveItemBase(winIcons.GetTopChild());
while(iconWindow != None)
{
// Abort if this object already exists!!
if (iconWindow.GetClientObject() == saveObject)
return;

iconWindow = HUDActiveItemBase(iconWindow.GetLowerSibling());
}

// Hide if there are no icons visible
if (++iconCount == 1)
Show();

if (saveObject.IsA('Augmentation'))
activeItem = HUDActiveItemBase(winIcons.NewChild(Class'HUDActiveAug'));
else
activeItem = HUDActiveItemBase(winIcons.NewChild(Class'HUDActiveItem'));

activeItem.SetIcon(newIcon);
activeItem.SetClientObject(saveObject);
activeItem.SetObject(saveObject);

AskParentForReconfigure();

CreateTileWindow


winIcons = TileWindow(NewChild(Class'TileWindow'));
winIcons.SetMargins(0, 0);
winIcons.SetMinorSpacing(2);
winIcons.SetOrder(ORDER_Down);
winIcons.SetPos(tilePosX, tilePosY);

DrawBorder (GC gc)


if ((bDrawBorder) && (iconCount > 0))
{
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);

// Border is drawn as three pieces
gc.DrawTexture(0, 0, width, topHeight, 0, 0, texBorderTop);
gc.DrawPattern(0, topOffset, width, height - topOffset - bottomOffset, 0, 0, texBorderCenter);
gc.DrawTexture(0, height - bottomHeight, width, bottomHeight, 0, 0, texBorderBottom);
}

InitWindow


Super.InitWindow();

CreateTileWindow();

Hide();

RemoveAllIcons


winIcons.DestroyAllChildren();
iconCount = 0;

RemoveObject (Object removeObject)


local Window currentWindow;
local Window nextWindow;


// Loop through all our children and check to see if
// we have a match.

currentWindow = winIcons.GetTopChild();
while(currentWindow != None)
{
nextWindow = currentWindow.GetLowerSibling();

if (currentWindow.GetClientObject() == removeObject)
{
currentWindow.Destroy();

// Hide if there are no icons visible
if (--iconCount == 0)
Hide();

break;
}

currentWindow = nextWindow;
}

AskParentForReconfigure();




HUDActiveItemsDisplay.uc (extends HUDBaseWindow)

var ESchemeTypes editMode;
var Int itemAugsOffsetX;
var Int itemAugsOffsetY;
var HUDActiveAugsBorder winAugsContainer;
var HUDActiveItemsBorder winItemsContainer;
itemAugsOffsetX=14
itemAugsOffsetY=6

AddIcon (Texture newIcon, Object saveObject)


local HUDActiveItem activeItem;


if (saveObject.IsA('Augmentation'))
winAugsContainer.AddIcon(newIcon, saveObject);
else
winItemsContainer.AddIcon(newIcon, saveObject);

AskParentForReconfigure();

ChildRequestedReconfiguration (window childWin) -> bool


return False;

ClearAugmentationDisplay


winAugsContainer.ClearAugmentationDisplay();

ConfigurationChanged


local float augsWidth, augsHeight;
local float itemsWidth, itemsHeight;
local float itemPosX;


if (winItemsContainer != None)
{
winItemsContainer.QueryPreferredSize(itemsWidth, itemsHeight);
itemPosX = 0;
}

// Position the two windows
if ((winAugsContainer != None) && (winAugsContainer.iconCount > 0))
{
winAugsContainer.QueryPreferredSize(augsWidth, augsHeight);
winAugsContainer.ConfigureChild(itemsWidth, 0, augsWidth, augsHeight);

itemPosX = itemsWidth + itemAugsOffsetX;
}

// Now that we know where the Augmentation window is, position
// the Items window

if (winItemsContainer != None)
{
// First check to see if there's enough room underneat the augs display
// to show the active items.

if ((augsHeight + itemsHeight) > height)
winItemsContainer.ConfigureChild(itemAugsOffsetX, itemAugsOffsetY, itemsWidth, itemsHeight);
else
winItemsContainer.ConfigureChild(itemPosX, augsHeight - 2, itemsWidth, itemsHeight);
}

CreateContainerWindows


winAugsContainer = HUDActiveAugsBorder(NewChild(Class'HUDActiveAugsBorder'));
winItemsContainer = HUDActiveItemsBorder(NewChild(Class'HUDActiveItemsBorder'));

InitWindow


Super.InitWindow();

CreateContainerWindows();

Hide();

RemoveIcon (Object removeObject)


if (removeObject.IsA('Augmentation'))
winAugsContainer.RemoveObject(removeObject);
else
winItemsContainer.RemoveObject(removeObject);

AskParentForReconfigure();

SetVisibility (bool bNewVisibility)


Show(bNewVisibility);

AskParentForReconfigure();

UpdateAugIconStatus (Augmentation aug)


winAugsContainer.UpdateAugIconStatus(aug);




HUDAmmoDisplay.uc (extends HUDBaseWindow)

var Bool bVisible;
var Color colAmmoText; // Ammo count text color
var Color colAmmoLowText; // Color when ammo low
var Color colNormalText; // color for normal weapon messages
var Color colTrackingText; // color when weapon is tracking
var Color colLockedText; // color when weapon is locked
var DeusExPlayer player;
var int infoX;
var localized String NotAvailable;
var localized String msgReloading;
var localized String AmmoLabel;
var localized String ClipsLabel;
var int clipsRemaining;
var int ammoRemaining;
var int ammoInClip;
var DeusExWeapon weapon;
var Texture texBackground;
var Texture texBorder;
colAmmoText=(G=255)
colAmmoLowText=(R=255)
colNormalText=(G=255)
colTrackingText=(R=255,G=255)
colLockedText=(R=255)
infoX=66
NotAvailable="N/A"
msgReloading="---"
AmmoLabel="AMMO"
ClipsLabel="CLIPS"
texBackground=Texture'DeusExUI.UserInterface.HUDAmmoDisplayBackground_1'
texBorder=Texture'DeusExUI.UserInterface.HUDAmmoDisplayBorder_1'

DrawBackground (GC gc)


gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawTexture(13, 13, 80, 54, 0, 0, texBackground);

// Draw the Ammo and Clips text labels
gc.SetFont(Font'FontTiny');
gc.SetTextColor(colText);
gc.SetAlignments(HALIGN_Center, VALIGN_Top);

gc.DrawText(66, 17, 21, 8, AmmoLabel);
gc.DrawText(66, 48, 21, 8, ClipsLabel);

DrawBorder (GC gc)


if (bDrawBorder)
{
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);
gc.DrawTexture(0, 0, 95, 77, 0, 0, texBorder);
}

DrawWindow (GC gc)


Super.DrawWindow(gc);

// No need to draw anything if the player doesn't have
// a weapon selected

if (player != None)
weapon = DeusExWeapon(player.Weapon);

if ( weapon != None )
{
// Draw the weapon icon
gc.SetStyle(DSTY_Masked);
gc.SetTileColorRGB(255, 255, 255);
gc.DrawTexture(22, 20, 40, 35, 0, 0, weapon.icon);

// Draw the ammo count
gc.SetFont(Font'FontTiny');
gc.SetAlignments(HALIGN_Center, VALIGN_Center);
gc.EnableWordWrap(false);

// how much ammo of this type do we have left?
if (weapon.AmmoType != None)
ammoRemaining = weapon.AmmoType.AmmoAmount;
else
ammoRemaining = 0;

if ( ammoRemaining < weapon.LowAmmoWaterMark )
gc.SetTextColor(colAmmoLowText);
else
gc.SetTextColor(colAmmoText);

// Ammo count drawn differently depending on user's setting
if (weapon.ReloadCount > 1 )
{
// how much ammo is left in the current clip?
ammoInClip = weapon.AmmoLeftInClip();
clipsRemaining = weapon.NumClips();

if (weapon.IsInState('Reload'))
gc.DrawText(infoX, 26, 20, 9, msgReloading);
else
gc.DrawText(infoX, 26, 20, 9, ammoInClip);

// if there are no clips (or a partial clip) remaining, color me red
if (( clipsRemaining == 0 ) || (( clipsRemaining == 1 ) && ( ammoRemaining < 2 * weapon.ReloadCount )))
gc.SetTextColor(colAmmoLowText);
else
gc.SetTextColor(colAmmoText);

if (weapon.IsInState('Reload'))
gc.DrawText(infoX, 38, 20, 9, msgReloading);
else
gc.DrawText(infoX, 38, 20, 9, clipsRemaining);
}
else
{
gc.DrawText(infoX, 38, 20, 9, NotAvailable);

if (weapon.ReloadCount == 0)
{
gc.DrawText(infoX, 26, 20, 9, NotAvailable);
}
else
{
if (weapon.IsInState('Reload'))
gc.DrawText(infoX, 26, 20, 9, msgReloading);
else
gc.DrawText(infoX, 26, 20, 9, ammoRemaining);
}
}

// Now, let's draw the targetting information
if (weapon.bCanTrack)
{
if (weapon.LockMode == LOCK_Locked)
gc.SetTextColor(colLockedText);
else if (weapon.LockMode == LOCK_Acquire)
gc.SetTextColor(colTrackingText);
else
gc.SetTextColor(colNormalText);
gc.DrawText(25, 56, 65, 8, weapon.TargetMessage);
}
}

InitWindow


Super.InitWindow();

bTickEnabled = TRUE;

Hide();

player = DeusExPlayer(DeusExRootWindow(GetRootWindow()).parentPawn);

SetSize(95, 77);

SetVisibility (bool bNewVisibility)


bVisible = bNewVisibility;

Tick (float deltaSeconds)


if ((player.Weapon != None) && ( bVisible ))
Show();
else
Hide();




HUDBarkDisplay.uc (extends HUDSharedBorderWindow)

var TileWindow winBarks;
var Int barkCount;

AddBark (string text, float newDisplayTime, Actor speakingActor)


local HUDBarkDisplayItem newBark;


if (TrimSpaces(text) != "")
{
newBark = HUDBarkDisplayItem(winBarks.NewChild(Class'HUDBarkDisplayItem'));
newBark.SetBarkSpeech(text, newDisplayTime, speakingActor);

barkCount++;

Show();

AskParentForReconfigure();
}

DescendantRemoved (Window descendant)


if (descendant.IsA('HUDBarkDisplayItem'))
{
if (--barkCount == 0)
Hide();

AskParentForReconfigure();
}

InitWindow


Super.InitWindow();

// Create text window where we'll display the conversation
winBarks = TileWindow(NewChild(Class'TileWindow'));
winBarks.SetOrder(ORDER_Down);
winBarks.SetChildAlignments(HALIGN_Full, VALIGN_Top);
winBarks.MakeWidthsEqual(True);
winBarks.MakeHeightsEqual(False);
winBarks.SetMargins(20, topMargin);
winBarks.SetMinorSpacing(2);
winBarks.SetWindowAlignments(HALIGN_Full, VALIGN_Top);

TrimSpaces (String trimString) -> String


local int trimIndex;
local int trimLength;


if ( trimString == "" )
return trimString;

trimIndex = Len(trimString) - 1;
while ((trimIndex >= 0) && (Mid(trimString, trimIndex, 1) == " ") )
trimIndex--;

if ( trimIndex < 0 )
return "";

trimString = Mid(trimString, 0, trimIndex + 1);

trimIndex = 0;
while((trimIndex < Len(trimString) - 1) && (Mid(trimString, trimIndex, 1) == " "))
trimIndex++;

trimLength = len(trimString) - trimIndex;
trimString = Right(trimString, trimLength);

return trimString;




HUDBarkDisplayItem.uc (extends AlignWindow)

var DeusExPlayer player;
var TextWindow winName;
var TextWindow winBark;
var Float timeToDisplay;
var Float timeDisplayed;
timeToDisplay=3.000000

InitWindow


Super.InitWindow();

// Defaults for tile window
SetChildVAlignment(VALIGN_Top);

winName = TextWindow(NewChild(Class'TextWindow'));
winName.SetFont(Font'FontMenuHeaders_DS');
winName.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winName.SetTextMargins(0, 0);

winBark = TextWindow(NewChild(Class'TextWindow'));
winBark.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winBark.SetFont(Font'FontMenuSmall_DS');
winBark.SetTextMargins(0, 1);
winBark.SetWordWrap(True);

// Get a pointer to the player
player = DeusExPlayer(GetPlayerPawn());

StyleChanged();

SetBarkSpeech (string text, float newDisplayTime, Actor speakingActor)


winName.SetText(speakingActor.UnfamiliarName $ ": ");
winBark.SetText(text);

timeToDisplay = newDisplayTime;
timeDisplayed = 0;
bTickEnabled = True;

StyleChanged


local ColorTheme theme;
local Color colNameText;
local Color colText;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colNameText = theme.GetColorFromName('HUDColor_HeaderText');
colText = theme.GetColorFromName('HUDColor_NormalText');

winName.SetTextColor(colNameText);
winBark.SetTextColor(colText);

Tick (float deltaSeconds)


timeDisplayed += deltaSeconds;

if (timeDisplayed > timeToDisplay)
{
bTickEnabled = False;
Destroy();
}




HUDBaseWindow.uc (extends Window)

var DeusExPlayer player;
var bool bDrawBorder;
var EDrawStyle borderDrawStyle;
var EDrawStyle backgroundDrawStyle;
var int backgroundWidth;
var int backgroundHeight;
var int backgroundPosX;
var int backgroundPosY;
var Color colBackground;
var Color colBorder;
var Color colHeaderText;
var Color colText;
bDrawBorder=True
colBackground=(R=128,G=128,B=128)
colBorder=(R=128,G=128,B=128)
colText=(R=255,G=255,B=255)

DrawBackground (GC gc)

DrawBorder (GC gc)

DrawWindow (GC gc)


// First draw the background then the border
DrawBackground(gc);
DrawBorder(gc);

InitWindow


Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

RefreshHUDDisplay (float DeltaTime)

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

coLBackground = theme.GetColorFromName('HUDColor_Background');
colBorder = theme.GetColorFromName('HUDColor_Borders');
colText = theme.GetColorFromName('HUDColor_NormalText');
colHeaderText = theme.GetColorFromName('HUDColor_HeaderText');

bDrawBorder = player.GetHUDBordersVisible();

if (player.GetHUDBorderTranslucency())
borderDrawStyle = DSTY_Translucent;
else
borderDrawStyle = DSTY_Masked;

if (player.GetHUDBackgroundTranslucency())
backgroundDrawStyle = DSTY_Translucent;
else
backgroundDrawStyle = DSTY_Masked;




HUDCompassDisplay.uc (extends HUDBaseWindow)

var Color colTickMarks;
var DeusExPlayer player;
var Int mapNorth;
var Float UnitsPerPixel;
var Window winCompass1;
var Window winCompass2;
var Int clipWidth;
var Int clipWidthHalf;
var Int tickWidth;
var int drawPos;
var int wrapPos;
var int lastPlayerYaw;
var Texture texBackground;
var Texture texBorder;
var Texture texTickBox;
colTickMarks=(R=200,G=200,B=200)
clipWidth=55
tickWidth=240
texBackground=Texture'DeusExUI.UserInterface.HUDCompassBackground_1'
texBorder=Texture'DeusExUI.UserInterface.HUDCompassBorder_1'
texTickBox=Texture'DeusExUI.UserInterface.HUDCompassTickBox'

CreateCompassWindow


local Window winCompassClip;


winCompassClip = NewChild(Class'Window');
winCompassClip.SetSize(clipWidth, 22);
winCompassClip.SetPos(13, 7);

// Create the two windows that have the tick marks. We need two
// of these because of the "wrap" point.
winCompass1 = CreateTickWindow(winCompassClip);
winCompass2 = CreateTickWindow(winCompassClip);

// Calculate how many rotation units per pixel
UnitsPerPixel = 65536 / tickWidth;

CreateTickWindow (Window winParent) -> Window


local Window winCompass;


winCompass = winParent.NewChild(Class'Window');
winCompass.SetPos(0, 0);
winCompass.SetSize(tickWidth, 15);
winCompass.SetBackground(Texture'HUDCompassTicks');
winCompass.SetBackgroundStyle(DSTY_Masked);
winCompass.SetTileColor(colTickMarks);

return winCompass;

DrawBackground (GC gc)


gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawTexture(11, 6, 60, 19, 0, 0, texBackground);

DrawBorder (GC gc)


if (bDrawBorder)
{
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);
gc.DrawTexture(0, 0, 73, 40, 0, 0, texBorder);
}

GetMapTrueNorth


local DeusExLevelInfo info;


if (player != None)
{
info = player.GetLevelInfo();

if (info != None)
mapNorth = info.TrueNorth;
}

InitWindow


Super.InitWindow();

Hide();

player = DeusExPlayer(DeusExRootWindow(GetRootWindow()).parentPawn);

SetSize(73, 40);

clipWidthHalf = clipWidth / 2;

GetMapTrueNorth();
CreateCompassWindow();

PostDrawBackground (GC gc)


// Draw the tick box
gc.SetTileColor(colBackground);
gc.SetStyle(DSTY_Masked);
gc.DrawTexture(11, 6, 60, 19, 0, 0, texTickBox);

PostDrawWindow (GC gc)


PostDrawBackground(gc);

SetVisibility (bool bNewVisibility)


Show( bNewVisibility );

bTickEnabled = bNewVisibility;

Tick (float deltaSeconds)


// Only continue if we moved
if (lastPlayerYaw != player.Rotation.Yaw)
{
lastPlayerYaw = player.Rotation.Yaw;

// Based on the player's rotation and the map's True North, calculate
// where to draw the tick marks and letters
drawPos = clipWidthHalf - (((lastPlayerYaw - mapNorth) & 65535) / UnitsPerPixel);

// We have two tickmark windows to compensate what happens with
// the wrap condition.

if ((drawPos > 0) && (drawPos < clipWidth))
wrapPos = drawPos - tickWidth;
else if (drawPos - tickWidth < (clipWidthHalf))
wrapPos = drawPos + tickWidth;
else
wrapPos = 100;

winCompass1.SetPos(drawPos, 0);
winCompass2.SetPos(wrapPos, 0);
}

VisibilityChanged (bool bNewVisibility)


// If we becames visible make sure we enable the tick event so
// the compass position is enabled.
bTickEnabled = bNewVisibility;




HUDConWindowFirst.uc (extends HUDSharedBorderWindow)

var TileWindow lowerConWindow; // Lower letterbox region
var TextWindow nameWindow; // Window displaying Actor name
var TextWindow lastTextWindow; // Most recent text window added
var ConPlay conPlay; // Pointer into current conPlay object
var Color colConTextPlayer;
var Color colConTextName;
var Color colLine;
var Font fontName;
var float conStartTime;
var int txtVertMargin;
FontName=Font'DeusExUI.FontMenuHeaders_DS'
txtVertMargin=10

AppendText (string text)


// Make sure we have a text window
if ( lastTextWindow == None )
return;

lastTextWindow.AppendText(text);

AskParentForReconfigure();

Clear


DestroyChildren();

Close


Hide();

ConfigurationChanged


lowerConWindow.ConfigureChild(0, 0, width, height);

CreateNameWindow


local Window winLine;


// Create the Name Window
nameWindow = TextWindow(lowerConWindow.NewChild(Class'TextWindow'));
nameWindow.SetTextAlignments( HALIGN_Left, VALIGN_Center);
nameWindow.SetTextMargins(0, 2);
nameWindow.SetFont(fontName);
nameWindow.SetTextColor(colConTextName);

// Create line between name and scrolling text
winLine = lowerConWindow.NewChild(Class'Window');
winLine.SetHeight(1);
winLine.SetBackgroundStyle(DSTY_Normal);
winLine.SetBackground(Texture'Solid');
winLine.SetTileColor(colLine);

DestroyChildren


local Window win;


win = lowerConWindow.GetTopChild();
while( win != None )
{
win.Destroy();
win = lowerConWindow.GetTopChild();
}

// Reset variables
lastTextWindow = None;

// Recreate the Name window
CreateNameWindow();

DisplayName (string text)


nameWindow.SetText( text );

DisplayText (string text, Actor speakingActor)


local TextWindow newText;
local float txtWidth;
local GC gc;


newText = TextWindow(lowerConWindow.NewChild(Class'TextWindow'));
newText.SetTextAlignments( HALIGN_Left, VALIGN_Center);
newText.SetTextMargins(10, 5);
newText.SetFont(Font'FontMenuSmall_DS');
newText.SetText(text);

// Use a different color for the player's text
if ( DeusExPlayer(speakingActor) != None )
newText.SetTextColor(colConTextPlayer);
else
newText.SetTextColor(colText);

lastTextWindow = newText;

AskParentForReconfigure();

InitWindow


Super.InitWindow();

// Initialize some variables and stuff
conPlay = None;
lastTextWindow = None;

// Create text window where we'll display the conversation
lowerConWindow = TileWindow(NewChild(Class'TileWindow'));
lowerConWindow.SetOrder(ORDER_Down);
lowerConWindow.SetChildAlignments(HALIGN_Full, VALIGN_Top);
lowerConWindow.MakeWidthsEqual(False);
lowerConWindow.MakeHeightsEqual(False);
lowerConWindow.SetMargins(20, 10);

CreateNameWindow();

conStartTime = player.level.TimeSeconds;

StyleChanged


local ColorTheme theme;


Super.StyleChanged();

theme = player.ThemeManager.GetCurrentHUDColorTheme();

colConTextPlayer = theme.GetColorFromName('HUDColor_NormalText');
colConTextName = theme.GetColorFromName('HUDColor_HeaderText');
colLine = colConTextName;




HUDHitDisplay.uc (extends HUDBaseWindow)

var Window partWindow;
var int lastHealth;
var int healHealth;
var int displayedHealth;
var float damageCounter;
var float healCounter;
var float refreshCounter;
var BodyPart head;
var BodyPart torso;
var BodyPart armLeft;
var BodyPart armRight;
var BodyPart legLeft;
var BodyPart legRight;
var BodyPart armor;
var Color colArmor;
var float damageFlash;
var float healFlash;
var Bool bVisible;
var DeusExPlayer player;
var ProgressBarWindow winBreath;
var bool bUnderwater;
var float breathPercent;
var ProgressBarWindow winEnergy;
var float energyPercent;
var Color colBar;
var int ypos;
var Texture texBackground;
var Texture texBorder;
var localized string O2Text;
var localized string EnergyText;
colArmor=(R=255,G=255,B=255)
texBackground=Texture'DeusExUI.UserInterface.HUDHitDisplayBackground_1'
texBorder=Texture'DeusExUI.UserInterface.HUDHitDisplayBorder_1'
O2Text="O2"
EnergyText="BE"

CreateProgressBar (int posX, int posY) -> ProgressBarWindow


local ProgressBarWindow winProgress;


winProgress = ProgressBarWindow(NewChild(Class'ProgressBarWindow'));
winProgress.UseScaledColor(True);
winProgress.SetSize(5, 55);
winProgress.SetPos(posX, posY);
winProgress.SetValues(0, 100);
winProgress.SetCurrentValue(0);
winProgress.SetVertical(True);

return winProgress;

DrawBackground (GC gc)


gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawTexture(11, 11, 60, 76, 0, 0, texBackground);

DrawBorder (GC gc)


if (bDrawBorder)
{
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);
gc.DrawTexture(0, 0, 84, 106, 0, 0, texBorder);
}

DrawWindow (GC gc)


Super.DrawWindow(gc);

// Draw energy bar
gc.SetFont(Font'FontTiny');
gc.SetTextColor(winEnergy.GetBarColor());
gc.DrawText(13, 74, 8, 8, EnergyText);

// If we're underwater draw the breathometer
if (bUnderwater)
{
ypos = breathPercent * 0.55;

// draw the breath bar
colBar = winBreath.GetBarColor();

// draw the O2 text and blink it if really low
gc.SetFont(Font'FontTiny');
if (breathPercent < 10)
{
if ((player.swimTimer % 0.5) > 0.25)
colBar.r = 255;
else
colBar.r = 0;
}

gc.SetTextColor(colBar);
gc.DrawText(61, 74, 8, 8, O2Text);
}

InitWindow


local window bodyWin;


Super.InitWindow();

bTickEnabled = True;

Hide();

player = DeusExPlayer(DeusExRootWindow(GetRootWindow()).parentPawn);

SetSize(84, 106);

CreateBodyPart(head, Texture'HUDHitDisplay_Head', 39, 17, 4, 7);
CreateBodyPart(torso, Texture'HUDHitDisplay_Torso', 36, 25, 10, 23);
CreateBodyPart(armLeft, Texture'HUDHitDisplay_ArmLeft', 46, 27, 10, 23);
CreateBodyPart(armRight, Texture'HUDHitDisplay_ArmRight', 26, 27, 10, 23);
CreateBodyPart(legLeft, Texture'HUDHitDisplay_LegLeft', 41, 44, 8, 36);
CreateBodyPart(legRight, Texture'HUDHitDisplay_LegRight', 33, 44, 8, 36);

bodyWin = NewChild(Class'Window');
bodyWin.SetBackground(Texture'HUDHitDisplay_Body');
bodyWin.SetBackgroundStyle(DSTY_Translucent);
bodyWin.SetConfiguration(24, 15, 34, 68);
bodyWin.SetTileColor(colArmor);
bodyWin.Lower();

winEnergy = CreateProgressBar(15, 20);
winBreath = CreateProgressBar(61, 20);

damageFlash = 0.4; // seconds
healFlash = 1.0; // seconds

SetHitColor (out BodyPart part, float deltaSeconds, bool bHide, int hitValue)


local Color col;
local float mult;


part.damageCounter -= deltaSeconds;
if (part.damageCounter < 0)
part.damageCounter = 0;
part.healCounter -= deltaSeconds;
if (part.healCounter < 0)
part.healCounter = 0;

part.refreshCounter -= deltaSeconds;

if ((part.healCounter == 0) && (part.damageCounter == 0) && (part.lastHealth == hitValue) && (part.refreshCounter > 0))
return;

if (part.refreshCounter <= 0)
part.refreshCounter = 0.5;

if (hitValue < part.lastHealth)
{
part.damageCounter = damageFlash;
part.displayedHealth = hitValue;
}
else if (hitValue > part.lastHealth)
{
part.healCounter = healFlash;
part.healHealth = part.displayedHealth;
}
part.lastHealth = hitValue;

if (part.healCounter > 0)
{
mult = part.healCounter/healFlash;
part.displayedHealth = hitValue + (part.healHealth-hitValue)*mult;
}
else
{
part.displayedHealth = hitValue;
}

hitValue = part.displayedHealth;
col = winEnergy.GetColorScaled(hitValue/100.0);

if (part.damageCounter > 0)
{
mult = part.damageCounter/damageFlash;
col.r += (255-col.r)*mult;
col.g += (255-col.g)*mult;
col.b += (255-col.b)*mult;
}


if (part.partWindow != None)
{
part.partWindow.SetTileColor(col);
if (bHide)
{
if (hitValue > 0)
part.partWindow.Show();
else
part.partWindow.Hide();
}
}

SetVisibility (bool bNewVisibility)


bVisible = bNewVisibility;

Tick (float deltaSeconds)


// DEUS_EX AMSD Server doesn't need to do this.
if ((player.Level.NetMode != NM_Standalone) && (!Player.PlayerIsClient()))
{
Hide();
return;
}
if ((player != None) && ( bVisible ))
{
SetHitColor(head, deltaSeconds, false, player.HealthHead);
SetHitColor(torso, deltaSeconds, false, player.HealthTorso);
SetHitColor(armLeft, deltaSeconds, false, player.HealthArmLeft);
SetHitColor(armRight, deltaSeconds, false, player.HealthArmRight);
SetHitColor(legLeft, deltaSeconds, false, player.HealthLegLeft);
SetHitColor(legRight, deltaSeconds, false, player.HealthLegRight);

// Calculate the energy bar percentage
energyPercent = 100.0 * (player.Energy / player.EnergyMax);
winEnergy.SetCurrentValue(energyPercent);

// If we're underwater, draw the breath bar
if (bUnderwater)
{
// if we are already underwater
if (player.HeadRegion.Zone.bWaterZone)
{
// if we are still underwater
breathPercent = 100.0 * player.swimTimer / player.swimDuration;
breathPercent = FClamp(breathPercent, 0.0, 100.0);
}
else
{
// if we are getting out of the water
bUnderwater = False;
breathPercent = 100;
}
}
else if (player.HeadRegion.Zone.bWaterZone)
{
// if we just went underwater
bUnderwater = True;
breathPercent = 100;
}

// Now show or hide the breath meter
if (bUnderwater)
{
if (!winBreath.IsVisible())
winBreath.Show();

winBreath.SetCurrentValue(breathPercent);
}
else
{
if (winBreath.IsVisible())
winBreath.Hide();
}

Show();
}
else
Hide();




HUDInfoLinkDisplay.uc (extends HUDBaseWindow)

var Window winLine;
var Window winPortrait;
var StaticWindow winStatic;
var TextWindow winName;
var TextWindow winQueued;
var ComputerWindow winText;
var Color colName;
var Color colCursor;
var Color colQueued;
var Color colLine;
var Font fontName;
var Font fontText;
var int fontTextX;
var int fontTextY;
var Texture speakerPortrait;
var Bool bPortraitVisible;
var Texture texBackgrounds[2];
var Texture texBorders[2];
var localized string strQueued;
var localized string IncomingTransmission;
FontName=Font'DeusExUI.FontMenuHeaders_DS'
fontText=Font'DeusExUI.FontFixedWidthSmall_DS'
fontTextX=7
fontTextY=10
texBackgrounds(0)=Texture'DeusExUI.UserInterface.HUDInfolinkBackground_1'
texBackgrounds(1)=Texture'DeusExUI.UserInterface.HUDInfolinkBackground_2'
texBorders(0)=Texture'DeusExUI.UserInterface.HUDInfolinkBorder_1'
texBorders(1)=Texture'DeusExUI.UserInterface.HUDInfolinkBorder_2'
strQueued="message waiting..."
IncomingTransmission="INCOMING TRANSMISSION..."

AppendText (String newText)


winText.Print(NewText, False);

ClearScreen


winText.ClearScreen();

CreateControls


// Create window for person speaking
winPortrait = NewChild(Class'Window');
winPortrait.SetSize(64, 64);
winPortrait.SetPos(20, 25);
winPortrait.SetBackgroundStyle(DSTY_Normal);

// Window used to display static
winStatic = StaticWindow(NewChild(Class'StaticWindow'));
winStatic.SetSize(64, 64);
winStatic.RandomizeStatic();
winStatic.SetPos(20, 25);
winStatic.SetBackgroundStyle(DSTY_Modulated);
winStatic.Raise();
winStatic.Hide();

// Create the name bar
winName = TextWindow(NewChild(Class'TextWindow'));
winName.SetTextAlignments(HALIGN_Left, VALIGN_Center);
winName.SetSize(293, 15);
winName.SetPos(94, 15);
winName.SetFont(fontName);
winName.SetTextColor(colName);
winName.SetTextMargins(0, 0);
winName.SetText(IncomingTransmission);

// Create the queued bar
winQueued = TextWindow(NewChild(Class'TextWindow'));
winQueued.SetTextAlignments(HALIGN_Right, VALIGN_Center);
winQueued.SetSize(200, 15);
winQueued.SetPos(187, 15);
winQueued.SetFont(fontName);
winQueued.SetTextColor(colQueued);
winQueued.SetTextMargins(0, 0);

// Create the computer window
winText = ComputerWindow(NewChild(Class'ComputerWindow'));
winText.SetPos(94, 36);
winText.SetTextSize(42, 6);
winText.SetTextFont(fontText, fontTextX, fontTextY, colText);
winText.SetTextTiming(0.03);
winText.SetFadeSpeed(0.75);
winText.SetCursorColor(colCursor);
winText.EnableWordWrap(True);

// Create line between name and scrolling text
winLine = NewChild(Class'Window');
winLine.SetSize(293, 1);
winLine.SetPos(94, 32);
winLine.SetBackgroundStyle(DSTY_Normal);
winLine.SetBackground(Texture'Solid');
winLine.SetTileColor(colLine);

DisplayText (String newText)


winText.Print(newText, False);

DrawBackground (GC gc)


gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawTexture( 0, 0, 256, height, 0, 0, texBackgrounds[0]);
gc.DrawTexture(256, 0, 175, height, 0, 0, texBackgrounds[1]);

DrawBorder (GC gc)


if (bDrawBorder)
{
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);
gc.DrawTexture( 0, 0, 256, height, 0, 0, texBorders[0]);
gc.DrawTexture(256, 0, 175, height, 0, 0, texBorders[1]);
}

InitWindow


Super.InitWindow();

// Assign border textures
SetSize(431, 114);

// Create Controls
CreateControls();

MessageQueued (Bool bQueued)


if ( bQueued )
winQueued.SetText(strQueued);
else
winQueued.SetText("");

SetSpeaker (String bindName, String displayName)


local String portraitStringName;
local DeusExLevelInfo info;


winName.SetText(displayName);

// Default portrait name based on bind naem

portraitStringName = "InfoPortraits." $ Left(bindName, 16);

// Okay, we have a special case for Paul Denton who, like JC,
// has five different portraits based on what the player selected
// when starting the game. Therefore we have to pick the right
// portrait.

if (bindName == "PaulDenton")
portraitStringName = portraitStringName $ "_" $ Chr(49 + player.PlayerSkin);

// Another hack for Bob Page, to use a different portrait on Mission15.
if (bindName == "BobPage")
{
info = player.GetLevelInfo();

if ((info != None) && (info.MissionNumber == 15))
portraitStringName = "InfoPortraits.BobPageAug";
}

// Get a pointer to the portrait
speakerPortrait = Texture(DynamicLoadObject(portraitStringName, class'Texture'));

ShowDatalinkIcon (bool bShow)


winPortrait.SetBackground(Texture'DataLinkIcon');
winPortrait.SetBackgroundStyle(DSTY_Masked);
winPortrait.Show(bShow);

bPortraitVisible = False;
bTickEnabled = False;

winStatic.Hide();

ShowPortrait


winPortrait.SetBackground(speakerPortrait);
winPortrait.SetBackgroundStyle(DSTY_Normal);
winPortrait.Show(True);

bPortraitVisible = True;

winStatic.Show();

ShowTextCursor (Bool bShow)


winText.ShowTextCursor(bShow);

StyleChanged


local ColorTheme theme;


Super.StyleChanged();

theme = player.ThemeManager.GetCurrentHUDColorTheme();

colName = theme.GetColorFromName('HUDColor_HeaderText');
colLine = theme.GetColorFromName('HUDColor_NormalText');;
colCursor = colName;
colQueued = theme.GetColorFromName('HUDColor_NormalText');




HUDInformationDisplay.uc (extends HUDSharedBorderWindow)

var TileWindow winTile;
var Color colInfoText;
var Font fontInfo;
var Texture texBackgrounds[9];
var Texture texBorders[9];
colInfoText=(R=250,G=250,B=250)
fontInfo=Font'DeusExUI.FontMenuSmall_DS'

AddTextWindow -> TextWindow


local TextWindow winText;


// Create the Text window containing the message text
winText = TextWindow(winTile.NewChild(Class'TextWindow'));
winText.SetFont(fontInfo);
winText.SetTextColor(colInfoText);
winText.SetWordWrap(True);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winText.SetTextMargins(0, 0);

AskParentForReconfigure();

return winText;

ChildRequestedReconfiguration (window childWin) -> bool


return False;

ClearTextWindows


winTile.DestroyAllChildren();

ConfigurationChanged


winTile.ConfigureChild(0, topMargin, width, height);

InitWindow


Super.InitWindow();

// Create the tile window that will contain all the text windows
winTile = TileWindow(NewChild(Class'TileWindow'));
winTile.SetOrder( ORDER_Down );
winTile.SetChildAlignments( HALIGN_Full, VALIGN_Top );
winTile.SetMargins(20, 0);
winTile.SetMinorSpacing(0);
winTile.MakeWidthsEqual(True);
winTile.MakeHeightsEqual(False);




HUDKeypadButton.uc (extends ButtonWindow)

var DeusExPlayer player;
var bool bBorderTranslucent;
var bool bBackgroundTranslucent;
var bool bDrawBorder;
var Color colBackground;
var Color colBorder;
var Color colHeaderText;
var Color colSensitive;
var Color colInsensitive;
var int num; // what number should I be?
var Texture keypadButtonTextures[2];
colSensitive=(R=255,G=255,B=255)
colInsensitive=(R=64,G=64,B=64)
keypadButtonTextures(0)=Texture'DeusExUI.UserInterface.HUDKeypadButton_Normal'
keypadButtonTextures(1)=Texture'DeusExUI.UserInterface.HUDKeypadButton_Pressed'

DrawWindow (GC gc)


local HUDKeypadWindow parent;


parent = HUDKeypadWindow(GetParent());

// Draw the button graphic
gc.SetTileColor(colBackground);

if (bBackgroundTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

if (bButtonPressed)
gc.DrawTexture(0, 0, width, height, 0, 0, keypadButtonTextures[1]);
else
gc.DrawTexture(0, 0, width, height, 0, 0, keypadButtonTextures[0]);

// Display darker if the button's insensitive
if (bIsSensitive)
gc.SetTextColor(colSensitive);
else
gc.SetTextColor(colInsensitive);

// If the button is currently being depressed, then draw the
// graphic down and to the right one.
gc.SetFont(Font'FontMenuExtraLarge');
gc.SetAlignments(HALIGN_Center, VALIGN_Center);
gc.EnableTranslucentText(True);

if (bButtonPressed)
gc.DrawText(1, 3, width, height, parent.IndexToString(num));
else
gc.DrawText(0, 2, width, height, parent.IndexToString(num));

InitWindow


Super.InitWindow();

SetSize(25, 27);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colBackground = theme.GetColorFromName('HUDColor_Background');

bBorderTranslucent = player.GetHUDBorderTranslucency();
bBackgroundTranslucent = player.GetHUDBackgroundTranslucency();
bDrawBorder = player.GetHUDBordersVisible();




HUDKeypadWindow.uc (extends DeusExBaseWindow)

var bool bFirstFrameDone;
var HUDKeypadButton btnKeys[12];
var TextWindow winText;
var string inputCode;
var bool bInstantSuccess; // we had the skill, so grant access immediately
var bool bWait;
var Keypad keypadOwner; // what keypad owns this window?
var Texture texBackground;
var Texture texBorder;
var bool bBorderTranslucent;
var bool bBackgroundTranslucent;
var bool bDrawBorder;
var Color colBackground;
var Color colBorder;
var Color colHeaderText;
var localized string msgEnterCode;
var localized string msgAccessDenied;
var localized string msgAccessGranted;
texBackground=Texture'DeusExUI.UserInterface.HUDKeypadBackground'
texBorder=Texture'DeusExUI.UserInterface.HUDKeypadBorder'
msgAccessDenied="~~DENIED~~"
msgAccessGranted="~~GRANTED~~"

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;
local int i;


bHandled = False;

for (i=0; i<12; i++)
{
if (buttonPressed == btnKeys[i])
{
PressButton(i);
bHandled = True;
break;
}
}

if (!bHandled)
bHandled = Super.ButtonActivated(buttonPressed);

return bHandled;

CreateInputTextWindow


winText = TextWindow(NewChild(Class'TextWindow'));
winText.SetPos(17, 21);
winText.SetSize(75, 11);
winText.SetTextMargins(0, 0);
winText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winText.SetFont(Font'FontMenuSmall');
winText.SetTextColor(colHeaderText);
winText.SetText(msgEnterCode);

CreateKeypadButtons


local int i, x, y;


for (y=0; y<4; y++)
{
for (x=0; x<3; x++)
{
i = x + y * 3;
btnKeys[i] = HUDKeypadButton(NewChild(Class'HUDKeypadButton'));
btnKeys[i].SetPos((x * 26) + 16, (y * 28) + 35);
btnKeys[i].num = i;
}
}

DestroyWindow


Super.DestroyWindow();

keypadOwner.keypadwindow = None;

DrawBackground (GC gc)


if (bBackgroundTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBackground);

gc.DrawTexture(0, 0, width, height, 0, 0, texBackground);

DrawBorder (GC gc)


if (bDrawBorder)
{
if (bBorderTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBorder);

gc.DrawTexture(0, 0, width, height, 0, 0, texBorder);
}

DrawWindow (GC gc)


// First draw the background then the border
DrawBackground(gc);
DrawBorder(gc);

Super.DrawWindow(gc);

GenerateKeypadDisplay


local int i;


msgEnterCode = "";

for (i=0; i {
if (i == Len(inputCode))
msgEnterCode = msgEnterCode $ "|p5";
msgEnterCode = msgEnterCode $ "~";
}

IndexToString (int num) -> string


local string str;


// buttons 0-8 are ok as is (text 1-9)
// button 9 is *
// button 10 is 0
// button 11 is #
switch (num)
{
case 9: str = "*"; break;
case 10: str = "0"; break;
case 11: str = "#"; break;
default: str = String(num+1); break;
}

return str;

InitData


GenerateKeypadDisplay();

winText.SetTextColor(colHeaderText);
winText.SetText(msgEnterCode);

InitWindow


Super.InitWindow();

SetWindowAlignments(HALIGN_Center, VALIGN_Center);
SetSize(103, 162);
SetMouseFocusMode(MFocus_EnterLeave);

inputCode="";

// Create the buttons
CreateKeypadButtons();
CreateInputTextWindow();

bTickEnabled = True;

StyleChanged();

KeypadDelay (int timerID, int invocations, int clientData)


bWait = False;

// if we entered a valid code, get out
if (inputCode == keypadOwner.validCode)
root.PopWindow();
else
{
inputCode = "";
GenerateKeypadDisplay();
winText.SetTextColor(colHeaderText);
winText.SetText(msgEnterCode);
}

PressButton (int num)


local sound tone;


if (bWait)
return;

if (Len(inputCode) < 16)
{
inputCode = inputCode $ IndexToString(num);
switch (num)
{
case 0: tone = sound'Touchtone1'; break;
case 1: tone = sound'Touchtone2'; break;
case 2: tone = sound'Touchtone3'; break;
case 3: tone = sound'Touchtone4'; break;
case 4: tone = sound'Touchtone5'; break;
case 5: tone = sound'Touchtone6'; break;
case 6: tone = sound'Touchtone7'; break;
case 7: tone = sound'Touchtone8'; break;
case 8: tone = sound'Touchtone9'; break;
case 9: tone = sound'Touchtone10'; break;
case 10: tone = sound'Touchtone0'; break;
case 11: tone = sound'Touchtone11'; break;
}

player.PlaySound(tone, SLOT_None);
}

GenerateKeypadDisplay();
winText.SetTextColor(colHeaderText);
winText.SetText(msgEnterCode);

if (Len(inputCode) == Len(keypadOwner.validCode))
ValidateCode();

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colBackground = theme.GetColorFromName('HUDColor_Background');
colBorder = theme.GetColorFromName('HUDColor_Borders');
colHeaderText = theme.GetColorFromName('HUDColor_HeaderText');

bBorderTranslucent = player.GetHUDBorderTranslucency();
bBackgroundTranslucent = player.GetHUDBackgroundTranslucency();
bDrawBorder = player.GetHUDBordersVisible();

Tick (float deltaTime)


if (!bFirstFrameDone)
{
SetCursorPos(width, height);
bFirstFrameDone = True;

if (bInstantSuccess)
{
inputCode = keypadOwner.validCode;
ValidateCode();
}
}

ValidateCode


local Actor A;
local int i;


if (inputCode == keypadOwner.validCode)
{
if (keypadOwner.Event != '')
{
if (keypadOwner.bToggleLock)
{
// Toggle the locked/unlocked state of the DeusExMover
player.KeypadToggleLocks(keypadOwner);
}
else
{
// Trigger the successEvent
player.KeypadRunEvents(keypadOwner, True);
}
}

// UnTrigger event (if used)
// DEUS_EX AMSD Export to player(and then to keypad), for multiplayer.
player.KeypadRunUntriggers(keypadOwner);

player.PlaySound(keypadOwner.successSound, SLOT_None);
winText.SetTextColor(colGreen);
winText.SetText(msgAccessGranted);
}
else
{
//Trigger failure event
if (keypadOwner.FailEvent != '')
player.KeypadRunEvents(keypadOwner, False);

player.PlaySound(keypadOwner.failureSound, SLOT_None);
winText.SetTextColor(colRed);
winText.SetText(msgAccessDenied);
}

bWait = True;
AddTimer(1.0, False, 0, 'KeypadDelay');

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;


bKeyHandled = True;

if (IsKeyDown(IK_Alt) || IsKeyDown(IK_Ctrl))
return False;

if (!bRepeat)
{
switch(key)
{
case IK_0:
case IK_NUMPAD0: btnKeys[10].PressButton(); break;
case IK_1:
case IK_NUMPAD1: btnKeys[0].PressButton(); break;
case IK_2:
case IK_NUMPAD2: btnKeys[1].PressButton(); break;
case IK_3:
case IK_NUMPAD3: btnKeys[2].PressButton(); break;
case IK_4:
case IK_NUMPAD4: btnKeys[3].PressButton(); break;
case IK_5:
case IK_NUMPAD5: btnKeys[4].PressButton(); break;
case IK_6:
case IK_NUMPAD6: btnKeys[5].PressButton(); break;
case IK_7:
case IK_NUMPAD7: btnKeys[6].PressButton(); break;
case IK_8:
case IK_NUMPAD8: btnKeys[7].PressButton(); break;
case IK_9:
case IK_NUMPAD9: btnKeys[8].PressButton(); break;

default:
bKeyHandled = False;
}
}

if (!bKeyHandled)
return Super.VirtualKeyPressed(key, bRepeat);
else
return bKeyHandled;




HUDLogDisplay.uc (extends HUDSharedBorderWindow)

var Bool bMessagesWaiting;
var Window winIcon;
var TextLogWindow winLog;
var Float displayTime;
var Float lastLogMsg;
var Sound logSoundToPlay;
var Font fontLog;
var Float logMargin;
var int MinLogLines;
var int MaxLogLines;
displayTime=3.000000
fontLog=Font'DeusExUI.FontMenuSmall_DS'
logMargin=10.000000
MinLogLines=4
maxLogLines=10

AddLog (coerce String newLog, Color linecol)


local DeusExRootWindow root;
local PersonaScreenBaseWindow winPersona;


if ( newLog != "" )
{
root = DeusExRootWindow(GetRootWindow());

// If a PersonaBaseWindow is visible, send the log message
// that way as well.

winPersona = PersonaScreenBaseWindow(root.GetTopWindow());
if (winPersona != None)
winPersona.AddLog(newLog);

// If the Hud is not visible, then pause the log
// until we become visible again
//
// Don't show the log if a DataLink is playing

if (( GetParent().IsVisible() ) && ( root.hud.infolink == None ))
{
Show();
}
else
{
bMessagesWaiting = True;
winLog.PauseLog( True );
}

bTickEnabled = TRUE;
winLog.AddLog(newLog, linecol);
lastLogMsg = 0.0;
AskParentForReconfigure();
}

ChildRequestedReconfiguration (window childWin) -> bool


return False;

ConfigurationChanged


local float qWidth, qHeight;
local float windowStart;


winIcon.QueryPreferredSize(windowStart, qHeight);
windowStart += (logMargin * 3);

// Text Log
qHeight = winLog.QueryPreferredHeight(width - windowStart - logMargin);
winLog.ConfigureChild(windowStart, topMargin, width - windowStart - logMargin, qHeight);

CreateControls


// Create the icon in the upper left corner
winIcon = NewChild(Class'Window');
winIcon.SetSize(32, 32);
winIcon.SetPos(logMargin * 2, topMargin + 5);
winIcon.SetBackgroundStyle(DSTY_Masked);
winIcon.SetBackground(Texture'LogIcon');

// Create the text log
winLog = TextLogWindow(NewChild(Class'TextLogWindow'));
winLog.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winLog.SetTextMargins(0, 0);
winLog.SetFont(fontLog);
winLog.SetLines(MinLogLines, MaxLogLines);

InitWindow


Super.InitWindow();

// Create Controls
CreateControls();

StyleChanged();

MessagesWaiting -> Bool


return bMessagesWaiting;

PlayLogSound (Sound newLogSound)


// If the log is visible, play this sound right now.
// Otherwise wait until we become visible

if ( IsVisible() )
{
PlaySound(newLogSound, 0.75);
logSoundToPlay = None;
}
else
{
logSoundToPlay = newLogSound;
}

SetIcon (Texture newIcon)


winIcon.SetBackground(newIcon);

SetLogTimeout (Float newTimeout)


displayTime = newTimeout;
winLog.SetTextTimeout(newTimeout);

SetMaxLogLines (Byte newLogLines)


winLog.SetLines(MinLogLines, newLogLines);

StyleChanged


Super.StyleChanged();

if (winLog != None)
winLog.SetTextColor(colText);

Tick (float deltaSeconds)


// If a DataLink or Conversation is being played, then don't count down,
// so we don't miss any log messages the player might receive.

if ((player.dataLinkPlay == None) &&
((player.conPlay == None) ||
((player.conPlay != None) && (player.conPlay.GetDisplayMode() == DM_FirstPerson))))
{
if (( lastLogMsg > 0.0 ) && ( lastLogMsg + deltaSeconds > displayTime ))
{
bTickEnabled = False;
bMessagesWaiting = False;
Hide();
winLog.PauseLog(False);
AskParentForReconfigure();
}
lastLogMsg = lastLogMsg + deltaSeconds;
}

VisibilityChanged (bool bNewVisibility)


Super.VisibilityChanged( bNewVisibility );

bTickEnabled = bNewVisibility;

if ( winLog != None )
winLog.PauseLog( !bNewVisibility );

// If we just became visible and we have a log sound to play,
// then do it now

if ( bNewVisibility && ( logSoundToPlay != None ))
{
PlaySound(logSoundToPlay, 0.75);
logSoundToPlay = None;
}




HUDMedBotAddAugsScreen.uc (extends PersonaScreenAugmentations)

var MedicalBot medBot;
var PersonaActionButtonWindow btnInstall;
var TileWindow winAugsTile;
var Bool bSkipAnimation;
var Localized String AvailableAugsText;
var Localized String MedbotInterfaceText;
var Localized String InstallButtonLabel;
var Localized String NoCansAvailableText;
var Localized String AlreadyHasItText;
var Localized String SlotFullText;
var Localized String SelectAnotherText;
AvailableAugsText="Available Augmentations"
MedbotInterfaceText="MEDBOT INTERFACE"
InstallButtonLabel="|&Install"
NoCansAvailableText="No Augmentation Cannisters Available!"
AlreadyHasItText="You already have this augmentation, therefore you cannot install it a second time."
SlotFullText="The slot that this augmentation occupies is already full, therefore you cannot install it."
SelectAnotherText="Please select another augmentation to install."
clientTextures(0)=Texture'DeusExUI.UserInterface.HUDMedbotBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.HUDMedbotBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.HUDMedbotBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.HUDMedbotBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.HUDMedbotBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.HUDMedbotBackground_6'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.HUDMedBotAugmentationsBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.HUDMedBotAugmentationsBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.HUDMedBotAugmentationsBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.HUDMedBotAugmentationsBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.HUDMedBotAugmentationsBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.HUDMedBotAugmentationsBorder_6'

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch(buttonPressed)
{
case btnInstall:
InstallAugmentation();
break;

default:
bHandled = False;
break;
}

if (bHandled)
return true;
else
return Super.ButtonActivated(buttonPressed);

return bHandled;

CreateAugCanList


local PersonaScrollAreaWindow winScroll;


// First create the scroll window
winScroll = PersonaScrollAreaWindow(winClient.NewChild(Class'PersonaScrollAreaWindow'));
winScroll.SetPos(348, 34);
winScroll.SetSize(238, 116);

winAugsTile = TileWindow(winScroll.ClipWindow.NewChild(Class'TileWindow'));
winAugsTile.MakeWidthsEqual(False);
winAugsTile.MakeHeightsEqual(False);
winAugsTile.SetMinorSpacing(1);
winAugsTile.SetMargins(0, 0);
winAugsTile.SetOrder(ORDER_Down);

CreateAugsLabel


CreatePersonaHeaderText(349, 15, AvailableAugsText, winClient);

CreateButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(346, 371);
winActionButtons.SetWidth(96);

btnInstall = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnInstall.SetButtonText(InstallButtonLabel);

CreateControls


CreateNavBarWindow();
CreateClientBorderWindow();
CreateClientWindow();

CreateTitleWindow(9, 5, AugmentationsTitleText);
CreateInfoWindow();
CreateButtons();
CreateAugmentationLabels();
CreateAugmentationHighlights();
CreateAugmentationButtons();
CreateOverlaysWindow();
CreateBodyWindow();
CreateAugsLabel();
CreateAugCanList();
CreateMedbotLabel();

CreateInfoWindow


winInfo = PersonaInfoWindow(winClient.NewChild(Class'PersonaInfoWindow'));
winInfo.SetPos(348, 158);
winInfo.SetSize(238, 210);

CreateMedbotLabel


local PersonaHeaderTextWindow txtLabel;


txtLabel = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
txtLabel.SetPos(305, 9);
txtLabel.SetSize(250, 16);
txtLabel.SetTextAlignments(HALIGN_Right, VALIGN_Center);
txtLabel.SetText(MedbotInterfaceText);

CreateNavBarWindow


winNavBar = PersonaNavBarBaseWindow(NewChild(Class'HUDMedBotNavBarWindow'));
winNavBar.SetPos(0, 0);

DestroyAugmentationButtons


local int buttonIndex;


for(buttonIndex=0; buttonIndex {
if (augItems[buttonIndex] != None)
augItems[buttonIndex].Destroy();
}

DestroyWindow


if (medBot != None)
{
if (!bSkipAnimation)
{
medBot.PlayAnim('Stop');
medBot.PlaySound(sound'MedicalBotLowerArm', SLOT_None);
medBot.FollowOrders();
}
}

Super.DestroyWindow();

EnableButtons


// Only enable the Install button if the player has an
// Augmentation Cannister aug button selected

if (HUDMedBotAugItemButton(selectedAugButton) != None)
{
btnInstall.EnableWindow(True);
}
else
{
btnInstall.EnableWindow(False);
}

InitWindow


Super.InitWindow();

HUDMedBotNavBarWindow(winNavBar).btnAugs.SetSensitivity(False);

PopulateAugCanList();

EnableButtons();

InstallAugmentation


local AugmentationCannister augCan;
local Augmentation aug;


if (HUDMedBotAugItemButton(selectedAugButton) == None)
return;

// Get pointers to the AugmentationCannister and the
// Augmentation Class

augCan = HUDMedBotAugItemButton(selectedAugButton).GetAugCan();
aug = HUDMedBotAugItemButton(selectedAugButton).GetAugmentation();

// Add this augmentation (if we can get this far, then the augmentation
// to be added is a valid one, as the checks to see if we already have
// the augmentation and that there's enough space were done when the
// AugmentationAddButtons were created)

player.AugmentationSystem.GivePlayerAugmentation(aug.class);

// play a cool animation
medBot.PlayAnim('Scan');

// Now Destroy the Augmentation cannister
player.DeleteInventory(augCan);

// Now remove the cannister from our list
selectedAugButton.GetParent().Destroy();
selectedAugButton = None;
selectedAug = None;

// Update the Installed Augmentation Icons
DestroyAugmentationButtons();
CreateAugmentationButtons();

// Need to update the aug list
PopulateAugCanList();

PopulateAugCanList


local Inventory item;
local int canCount;
local HUDMedBotAugCanWindow augCanWindow;
local PersonaNormalTextWindow txtNoCans;


winAugsTile.DestroyAllChildren();

// Loop through all the Augmentation Cannisters in the player's
// inventory, adding one row for each can.
item = player.Inventory;

while(item != None)
{
if (item.IsA('AugmentationCannister'))
{
augCanWindow = HUDMedBotAugCanWindow(winAugsTile.NewChild(Class'HUDMedBotAugCanWindow'));
augCanWindow.SetCannister(AugmentationCannister(item));

canCount++;
}
item = item.Inventory;
}

// If we didn't add any cans, then display "No Aug Cannisters Available!"
if (canCount == 0)
{
txtNoCans = PersonaNormalTextWindow(winAugsTile.NewChild(Class'PersonaNormalTextWindow'));
txtNoCans.SetText(NoCansAvailableText);
txtNoCans.SetTextMargins(4, 4);
txtNoCans.SetTextAlignments(HALIGN_Left, VALIGN_Center);
}

SelectAugmentation (PersonaItemButton buttonPressed)


// Don't do extra work.
if (selectedAugButton != buttonPressed)
{
// Deselect current button
if (selectedAugButton != None)
selectedAugButton.SelectButton(False);

selectedAugButton = buttonPressed;
selectedAug = Augmentation(selectedAugButton.GetClientObject());

// Check to see if this augmentation has already been installed
if (HUDMedBotAugItemButton(buttonPressed).bHasIt)
{
winInfo.Clear();
winInfo.SetTitle(selectedAug.AugmentationName);
winInfo.SetText(AlreadyHasItText);
winInfo.SetText(SelectAnotherText);
selectedAug = None;
selectedAugButton = None;
}
else if (HUDMedBotAugItemButton(buttonPressed).bSlotFull)
{
winInfo.Clear();
winInfo.SetTitle(selectedAug.AugmentationName);
winInfo.SetText(SlotFullText);
winInfo.SetText(SelectAnotherText);
selectedAug = None;
selectedAugButton = None;
}
else
{
selectedAug.UsingMedBot(True);
selectedAug.UpdateInfo(winInfo);
selectedAugButton.SelectButton(True);
}

EnableButtons();
}

SetMedicalBot (MedicalBot newBot, optional bool bPlayAnim)


medBot = newBot;

if (medBot != None)
{
medBot.StandStill();

if (bPlayAnim)
{
medBot.PlayAnim('Start');
medBot.PlaySound(sound'MedicalBotRaiseArm', SLOT_None);
}
}

SkipAnimation (bool bNewSkipAnimation)


bSkipAnimation = bNewSkipAnimation;




HUDMedBotAugCanWindow.uc (extends PersonaBaseWindow)

var AugmentationCannister augCan;
var Window winCanIcon;
var PersonaNormalTextWindow txtAugDesc;
var HUDMedBotAugItemButton btnAug1;
var HUDMedBotAugItemButton btnAug2;
var Texture texBorders[9];
var Color colBorder;
var localized String AugContainsText;
texBorders(0)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_TL'
texBorders(1)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_TR'
texBorders(2)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_BL'
texBorders(3)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_BR'
texBorders(4)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Left'
texBorders(5)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Right'
texBorders(6)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Top'
texBorders(7)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Bottom'
texBorders(8)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Center'
AugContainsText="Contains:|n"

CreateControls


winCanIcon = NewChild(Class'Window');
winCanIcon.SetBackgroundStyle(DSTY_Masked);
winCanIcon.SetPos(-7, 1);
winCanIcon.SetSize(42, 37);

txtAugDesc = PersonaNormalTextWindow(NewChild(Class'PersonaNormalTextWindow'));
txtAugDesc.SetPos(29, 2);
txtAugDesc.SetSize(133, 34);
txtAugDesc.SetTextMargins(0, 0);
txtAugDesc.SetWordWrap(False);

btnAug1 = HUDMedBotAugItemButton(NewChild(Class'HUDMedBotAugItemButton'));
btnAug1.SetPos(155, 2);

btnAug2 = HUDMedBotAugItemButton(NewChild(Class'HUDMedBotAugItemButton'));
btnAug2.SetPos(190, 2);

DrawWindow (GC gc)


gc.SetTileColor(colBorder);
gc.SetStyle(DSTY_Translucent);
gc.DrawBorders(0, 0, width, height, 0, 0, 0, 0, texBorders);

GetCannister -> AugmentationCannister


return augCan;

InitWindow


Super.InitWindow();

SetSize(226, 38);

CreateControls();

SetCannister (AugmentationCannister newAugCan)


local String augDesc;


augCan = newAugCan;

winCanIcon.SetBackground(augCan.Icon);
btnAug1.SetAugmentation(augCan.GetAugmentation(0));
btnAug1.SetAugCan(augCan);
btnAug2.SetAugmentation(augCan.GetAugmentation(1));
btnAug2.SetAugCan(augCan);

augDesc = AugContainsText $ " " $ btnAug1.GetAugDesc() $ "|n" $ " " $ btnAug2.GetAugDesc();

txtAugDesc.SetText(augDesc);

StyleChanged


Super.StyleChanged();

colBorder.r = Int(Float(colBackground.r) / 2);
colBorder.g = Int(Float(colBackground.g) / 2);
colBorder.b = Int(Float(colBackground.b) / 2);




HUDMedBotAugItemButton.uc (extends PersonaItemButton)

var AugmentationCannister augCan;
var bool bSlotFull;
var bool bHasIt;
var Color colBorder;
var Color colIconDisabled;
var Color colIconNormal;
colIconDisabled=(R=64,G=64,B=64)
colIconNormal=(R=255,G=255)
iconPosWidth=32
iconPosHeight=32
buttonWidth=34
buttonHeight=34
borderWidth=34
borderHeight=34

DrawWindow (GC gc)


if ((bSlotFull) || (bHasIt))
colIcon = colIconDisabled;
else
colIcon = colIconNormal;

Super.DrawWindow(gc);

// Draw selection border
if (!bSelected)
{
gc.SetTileColor(colBorder);
gc.SetStyle(DSTY_Masked);
gc.DrawBorders(0, 0, borderWidth, borderHeight, 0, 0, 0, 0, texBorders);
}

GetAugCan -> AugmentationCannister


return augCan;

GetAugDesc -> String


if (GetClientObject() != None)
return Augmentation(GetClientObject()).augmentationName;
else
return "";

GetAugmentation -> Augmentation


return Augmentation(GetClientObject());

SetAugCan (AugmentationCannister newAugCan)


augCan = newAugCan;

SetAugmentation (Augmentation newAug)


SetClientObject(newAug);
SetIcon(newAug.smallIcon);

// First check to see if the player already has this augmentation
bHasIt = newAug.bHasIt;

// Now check to see if this augmentation slot is full
bSlotFull = player.AugmentationSystem.AreSlotsFull(newAug);

StyleChanged


local ColorTheme theme;


Super.StyleChanged();

colBorder.r = Int(Float(colBackground.r) * 0.75);
colBorder.g = Int(Float(colBackground.g) * 0.75);
colBorder.b = Int(Float(colBackground.b) * 0.75);




HUDMedBotHealthOverlaysWindow.uc (extends PersonaOverlaysWindow)

defaultSizeX=219
defaultSizeY=357
overlayTextures(0)=Texture'DeusExUI.UserInterface.HUDMedBotOverlays_1'
overlayTextures(1)=Texture'DeusExUI.UserInterface.HUDMedBotOverlays_2'



HUDMedBotHealthScreen.uc (extends PersonaScreenHealth)

var MedicalBot medBot;
var ProgressBarWindow winHealthBar;
var TextWindow winHealthBarText;
var PersonaNormalTextWindow winHealthInfoText;
var Bool bSkipAnimation;
var Localized String MedbotInterfaceText;
var Localized String HealthInfoTextLabel;
var Localized String MedBotRechargingLabel;
var Localized String MedBotReadyLabel;
var Localized String MedBotYouAreHealed;
var Localized String SecondsPluralLabel;
var Localized String SecondsSingularLabel;
var Localized String ReadyLabel;
MedbotInterfaceText="MEDBOT INTERFACE"
HealthInfoTextLabel="The MedBot will heal up to %d units, which are distributed evenly among your damaged body regions."
MedBotRechargingLabel="|nThe MedBot is currently Recharging. Please Wait."
MedBotReadyLabel="|nThe MedBot is Ready, you may now be Healed."
MedBotYouAreHealed="|nYou are currently in Full Health."
SecondsPluralLabel="Recharging: %d seconds"
SecondsSingularLabel="Recharging: %d second"
ReadyLabel="Ready!"
bShowHealButtons=False
HealAllButtonLabel=" H|&eal All "
clientTextures(0)=Texture'DeusExUI.UserInterface.HUDMedbotHealthBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.HUDMedbotHealthBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.HUDMedbotHealthBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.HUDMedbotHealthBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.HUDMedbotHealthBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.HUDMedbotHealthBackground_6'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.HUDMedBotHealthBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.HUDMedBotHealthBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.HUDMedBotHealthBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.HUDMedBotHealthBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.HUDMedBotHealthBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.HUDMedBotHealthBorder_6'

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch(buttonPressed)
{
case btnHealAll:
MedBotHealPlayer();
break;

default:
bHandled = False;
break;
}

if (bHandled)
return True;
else
return Super.ButtonActivated(buttonPressed);

CreateButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(346, 346);
winActionButtons.SetWidth(97);
winActionButtons.FillAllSpace(False);

btnHealAll = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnHealAll.SetButtonText(HealAllButtonLabel);

CreateControls


CreateNavBarWindow();
CreateClientBorderWindow();
CreateClientWindow();

CreateTitleWindow(9, 5, HealthTitleText);
CreateInfoWindow();
CreateOverlaysWindow();
CreateBodyWindow();
CreateRegionWindows();
CreateButtons();
CreatePartButtons();
CreateRegionWindows();
CreateMedbotLabel();
CreateMedBotDisplay();
CreateStatusWindow();

CreateInfoWindow


winInfo = PersonaInfoWindow(winClient.NewChild(Class'PersonaInfoWindow'));
winInfo.SetPos(348, 22);
winInfo.SetSize(238, 243);

CreateMedBotDisplay


winHealthBar = ProgressBarWindow(winClient.NewChild(Class'ProgressBarWindow'));

winHealthBar.SetPos(446, 348);
winHealthBar.SetSize(140, 12);
winHealthBar.SetValues(0, 100);
winHealthBar.UseScaledColor(True);
winHealthBar.SetVertical(False);
winHealthBar.SetScaleColorModifier(0.5);
winHealthBar.SetDrawBackground(False);

winHealthBarText = TextWindow(winClient.NewChild(Class'TextWindow'));
winHealthBarText.SetPos(446, 349);
winHealthBarText.SetSize(140, 12);
winHealthBarText.SetTextMargins(0, 0);
winHealthBarText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winHealthBarText.SetFont(Font'FontMenuSmall_DS');
winHealthBarText.SetTextColorRGB(255, 255, 255);

winHealthInfoText = PersonaNormalTextWindow(winClient.NewChild(Class'PersonaNormalTextWindow'));
winHealthInfoText.SetPos(348, 293);
winHealthInfoText.SetSize(238, 50);
winHealthInfoText.SetTextMargins(2, 0);

CreateMedbotLabel


local PersonaHeaderTextWindow txtLabel;


txtLabel = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
txtLabel.SetPos(305, 9);
txtLabel.SetSize(250, 16);
txtLabel.SetTextAlignments(HALIGN_Right, VALIGN_Center);
txtLabel.SetText(MedbotInterfaceText);

CreateNavBarWindow


winNavBar = PersonaNavBarBaseWindow(NewChild(Class'HUDMedBotNavBarWindow'));
winNavBar.SetPos(0, 0);

CreateOverlaysWindow


winOverlays = PersonaOverlaysWindow(winClient.NewChild(Class'HUDMedBotHealthOverlaysWindow'));
winOverlays.SetPos(24, 36);
winOverlays.Lower();

CreateStatusWindow


winStatus = PersonaStatusLineWindow(winClient.NewChild(Class'PersonaStatusLineWindow'));
winStatus.SetPos(15, 410);
winStatus.SetWidth(291);

DestroyWindow


if (medBot != None)
{
if (!bSkipAnimation)
{
medBot.PlayAnim('Stop');
medBot.PlaySound(sound'MedicalBotLowerArm', SLOT_None);
medBot.FollowOrders();
}
}

Super.DestroyWindow();

EnableButtons


if (medBot != None)
btnHealAll.EnableWindow(medBot.CanHeal() && IsPlayerDamaged());
else
btnHealAll.EnableWindow(False);

InitWindow


Super.InitWindow();

HUDMedBotNavBarWindow(winNavBar).btnHealth.SetSensitivity(False);

bTickEnabled = True;

EnableButtons();

MedBotHealPlayer


medBot.HealPlayer(player);
UpdateMedBotDisplay();
UpdateRegionWindows();

SetMedicalBot (MedicalBot newBot, optional bool bPlayAnim)


medBot = newBot;

if (medBot != None)
{
medBot.StandStill();

if (bPlayAnim)
{
medBot.PlayAnim('Start');
medBot.PlaySound(sound'MedicalBotRaiseArm', SLOT_None);
}
}

SkipAnimation (bool bNewSkipAnimation)


bSkipAnimation = bNewSkipAnimation;

Tick (float deltaTime)


UpdateMedBotDisplay();

UpdateMedBotDisplay


local float barPercent;
local String infoText;
local float secondsRemaining;


if (medBot != None)
{
infoText = Sprintf(HealthInfoTextLabel, medBot.healAmount);

// Update the bar
if (medBot.CanHeal())
{
winHealthBar.SetCurrentValue(100);
winHealthBarText.SetText(ReadyLabel);

if (IsPlayerDamaged())
infoText = infoText $ MedBotReadyLabel;
else
infoText = infoText $ MedBotYouAreHealed;
}
else
{
secondsRemaining = medBot.GetRefreshTimeRemaining();

barPercent = 100 * (1.0 - (secondsRemaining / Float(medBot.healRefreshTime)));

winHealthBar.SetCurrentValue(barPercent);

if (secondsRemaining == 1)
winHealthBarText.SetText(Sprintf(SecondsSingularLabel, Int(secondsRemaining)));
else
winHealthBarText.SetText(Sprintf(SecondsPluralLabel, Int(secondsRemaining)));

if (IsPlayerDamaged())
infoText = infoText $ MedBotRechargingLabel;
else
infoText = infoText $ MedBotYouAreHealed;
}

winHealthInfoText.SetText(infoText);
}

EnableButtons();




HUDMedBotNavBarWindow.uc (extends PersonaNavBarBaseWindow)

var PersonaNavButtonWindow btnHealth;
var PersonaNavButtonWindow btnAugs;
var localized String HealthButtonLabel;
var localized String AugsButtonLabel;
HealthButtonLabel=" |&Health "
AugsButtonLabel=" |&Augmentations "

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;
local HUDMedBotHealthScreen healthScreen;
local HUDMedBotAddAugsScreen augScreen;
local MedicalBot medBot;


bHandled = True;

switch(buttonPressed)
{
case btnHealth:
// Need to be sure the MedBot variable is set in the
// Health Screen when we bring it up

augScreen = HUDMedBotAddAugsScreen(GetParent());
if (augScreen != None)
{
augScreen.SkipAnimation(True);
medBot = augScreen.medBot;
}

// Invoke the health screen
healthScreen = HUDMedBotHealthScreen(root.InvokeUIScreen(Class'HUDMedBotHealthScreen', True));

// Now set the medBot if it's not none
if (medBot != None)
healthScreen.SetMedicalBot(medBot);

break;

case btnAugs:
// Need to be sure the MedBot variable is set in the
// Health Screen when we bring it up

healthScreen = HUDMedBotHealthScreen(GetParent());
if (healthScreen != None)
{
healthScreen.SkipAnimation(True);
medBot = healthScreen.medBot;
}

augScreen = HUDMedBotAddAugsScreen(root.InvokeUIScreen(Class'HUDMedBotAddAugsScreen', True));

// Now set the medBot if it's not none
if (medBot != None)
augScreen.SetMedicalBot(medBot);

break;

default:
bHandled = False;
break;
}

if (bHandled)
return bHandled;
else
return Super.ButtonActivated(buttonPressed);

CreateButtonWindows


Super.CreateButtonWindows();

winNavButtons.FillAllSpace(False);

CreateButtons


btnAugs = CreateNavButton(winNavButtons, AugsButtonLabel);
btnHealth = CreateNavButton(winNavButtons, HealthButtonLabel);

Super.CreateButtons();




HUDMissionStartTextDisplay.uc (extends Window)

var String message;
var int charIndex;
var Font fontText;
var TextWindow winText;
var TextWindow winTextShadow;
var Int shadowDist;
var Bool bSpewingText;
var Float perCharDelay;
var Float displayTime;
var Int maxTextWidth;
var Color colText;
var Color colBlack;
fontText=Font'DeusExUI.FontLocation'
shadowDist=2
perCharDelay=0.100000
displayTime=5.000000
maxTextWidth=500
colText=(R=255,G=255,B=255)

AddMessage (String str)


if (str != "")
{
if (message != "")
{
message = message $ "|n";
}
message = message $ str;
}

ChildRequestedReconfiguration (window childWin) -> bool


return False;

ConfigurationChanged



winText.ConfigureChild(0, 0, width, height);
winTextShadow.ConfigureChild(shadowDist, shadowDist, width, height);

HideMessage


Hide();

InitWindow


Super.InitWindow();

winTextShadow = TextWindow(NewChild(Class'TextWindow'));
winTextShadow.SetFont(fontText);
winTextShadow.SetTextColor(colBlack);
winTextShadow.SetTextMargins(0, 0);
winTextShadow.SetTextAlignments(HALIGN_Left, VALIGN_Top);

winText = TextWindow(NewChild(Class'TextWindow'));
winText.SetFont(fontText);
winText.SetTextColor(colText);
winText.EnableTranslucentText(True);
winText.SetTextMargins(0, 0);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);

PrintNextCharacter


if (charIndex < len(message))
{
if ((mid(message, charIndex, 1) == "|") && (mid(message, charIndex, 2) == "|n"))
{
winText.AppendText("|n");
winTextShadow.AppendText("|n");
charIndex += 2;
}
else
{
winText.AppendText(mid(message, charIndex, 1));
winTextShadow.AppendText(mid(message, charIndex, 1));
charIndex++;
}
}
else
{
// Now more characters to print, so pause and then go away
bSpewingText = False;
}

StartMessage


Show();
AskParentForReconfigure();
bTickEnabled = True;
bSpewingText = True;

Tick (float deltaTime)


if (bSpewingText)
{
PrintNextCharacter();
}
else
{
displayTime -= deltaTime;

if (displayTime <= 0)
{
bTickEnabled = False;
HideMessage();
}
}




HUDMultiSkills.uc (extends HUDBaseWindow)

var localized String ToExitString;
var localized String SkillsAvailableString;
var localized String PressString, PressEndString;
var localized String SkillPointsString;
var localized String SkillString;
var localized String CostString;
var localized String NAString;
var localized String LevelString;
var localized String KeyNotBoundString;
var Color colBlue, colWhite;
var Color colGreen, colLtGreen;
var Color colRed, colLtRed;
var bool bNotifySkills;
var int timeToNotify;
var int curSkillPoints;
var String curKeyName;
ToExitString="> to exit."
SkillsAvailableString="Skills available!"
PressString="Press <"
PressEndString=">"
SkillPointsString="Skill Points: "
skillString="Skill"
CostString="Cost"
NAString="MAX"
LevelString="Level"
KeyNotBoundString="Key Not Bound"
colBlue=(B=255)
colWhite=(R=255,G=255,B=255)
colGreen=(G=128)
colLtGreen=(G=255)
colRed=(R=128)
colLtRed=(R=255)

AttemptBuySkill (DeusExPlayer thisPlayer, Skill askill) -> bool


if ( askill != None )
{
// Already master
if ( askill.CurrentLevel == 3 )
{
thisPlayer.BuySkillSound( 1 );
return ( False );
}
else if ( thisPlayer.SkillPointsAvail >= askill.cost[askill.CurrentLevel] )
{
thisPlayer.BuySkillSound( 0 );
return( askill.IncLevel() );
}
else
{
thisPlayer.BuySkillSound( 1 );
return( False );
}
}

DestroyWindow


Super.DestroyWindow();

DrawLevel (GC gc, float x, float y, int level)


local int i;


if (( level < 0 ) || (level > 3 ))
{
log("Warning:Bad skill level:"$level$" " );
return;
}
for ( i = 0; i < level; i++ )
{
gc.DrawTexture( x, y+2.0, levelBoxSize, levelBoxSize, 0, 0, Texture'Solid');
x += (levelBoxSize + levelBoxSize/2);
}

DrawWindow (GC gc)


local Skill askill;
local float curx, cury, w, h;
local String str, costStr;
local int index;
local bool bHitSwimming;
local float barLen, costx, levelx;


bHitSwimming = False;

if (( Player == None ) || (!Player.PlayerIsClient()) )
return;

if ( Player.bBuySkills )
{
if (( Player != None ) && ( Player.SkillSystem != None ))
{
gc.SetFont(Font'FontMenuSmall_DS');
index = 1;
askill = Player.SkillSystem.FirstSkill;
cury = height * skillListY;
curx = width * skillListX;
costx = width * skillCostX;
levelx = width * skillLevelX;
gc.GetTextExtent( 0, w, h, CostString );
barLen = (costx+(w*1.33))-curx;
gc.DrawBox( curx, cury, barLen, 1, 0, 0, 1, Texture'Solid');
cury += (h*0.25);
str = SkillPointsString $ Player.SkillPointsAvail;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( curx, cury, w, h, str );
cury += h;
gc.DrawBox( curx, cury, barLen, 1, 0, 0, 1, Texture'Solid');
cury += (h*0.25);
str = SkillString;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( curx, cury, w, h, str );
str = LevelString;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( levelx, cury, w, h, str );
str = CostString;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( costx, cury, w, h, str );
cury += h;
gc.DrawBox( curx, cury, barLen, 1, 0, 0, 1, Texture'Solid');
cury += (h*0.25);

while ( askill != None )
{
if ( SkillSwimming(askill) == None )
{
if ( index == 10 )
str = "0. " $ askill.SkillName;
else
str = index $ ". " $ askill.SkillName;

gc.GetTextExtent( 0, w, h, str );
if ( askill.CurrentLevel == 3)
{
gc.SetTileColor( colBlue );
gc.SetTextColor( colBlue );
costStr = NAString;
}
else if ( Player.SkillPointsAvail >= askill.cost[askill.CurrentLevel] )
{
if ( askill.CurrentLevel == 2)
{
gc.SetTextColor( colLtGreen );
gc.SetTileColor( colLtGreen );
}
else
{
gc.SetTextColor( colGreen );
gc.SetTileColor( colGreen );
}
costStr = "" $ askill.cost[askill.CurrentLevel];
}
else
{
if ( askill.CurrentLevel == 2)
{
gc.SetTileColor( colLtRed );
gc.SetTextColor( colLtRed );
}
else
{
gc.SetTileColor( colRed );
gc.SetTextColor( colRed );
}
costStr = "" $ askill.cost[askill.CurrentLevel];
}
gc.DrawText( curx, cury, w, h, str );
DrawLevel( gc, levelx, cury, askill.CurrentLevel );
gc.GetTextExtent( 0, w, h, costStr );
gc.DrawText( costx, cury, w, h, costStr );
cury += h;
index += 1;
}
askill = askill.next;
}
gc.SetTileColor( colWhite );
if ( curKeyName ~= KeyNotBoundString )
RefreshKey();
str = PressString $ curKeyName $ ToExitString;
gc.GetTextExtent( 0, w, h, str );
gc.DrawBox( curx, cury, barLen, 1, 0, 0, 1, Texture'Solid');
cury += (h*0.25);
gc.SetTextColor( colWhite );
gc.DrawText( curx + ((barLen*0.5)-(w*0.5)), cury, w, h, str );
cury += h;
gc.DrawBox( curx, cury, barLen, 1, 0, 0, 1, Texture'Solid');
}
}
else
SkillMessage( gc );

Super.DrawWindow(gc);

GetSkillFromIndex (DeusExPlayer thisPlayer, int index) -> Skill


local Skill askill;
local int curIndex;


// Zero indexed, but min element is 1, 0 is 10
if ( index == 0 )
index = 9;
else
index -= 1;

curIndex = 0;
askill = None;
if ( thisPlayer != None )
{
askill = thisPlayer.SkillSystem.FirstSkill;
while ( askill != None )
{
if ( SkillSwimming(askill) == None )
{
if ( curIndex == index )
return( askill );

curIndex += 1;
}
askill = askill.next;
}
}
return( askill );

InitWindow


Super.InitWindow();
SetWindowAlignments( HALIGN_Full, VALIGN_Full );
bNotifySkills = False;
RefreshKey();

OverrideBelt (DeusExPlayer thisPlayer, int objectNum) -> bool


local Skill askill;


if ( !thisPlayer.bBuySkills )
return False;

askill = GetSkillFromIndex( thisPlayer, objectNum );
if ( AttemptBuySkill( thisPlayer, askill ) )
thisPlayer.bBuySkills = False; // Got our skill, exit out of menu

if ( ( objectNum >= 0 ) && ( objectNum <= 10) )
return True;
else
return False;

RefreshKey


local String KeyName, Alias;
local int i;


curKeyName = "";
for ( i=0; i<255; i++ )
{
KeyName = player.ConsoleCommand ( "KEYNAME "$i );
if ( KeyName != "" )
{
Alias = player.ConsoleCommand( "KEYBINDING "$KeyName );
if ( Alias ~= "BuySkills" )
{
curKeyName = KeyName;
break;
}
}
}
if ( curKeyName ~= "" )
curKeyName = KeyNotBoundString;

SkillMessage (GC gc)


local bool bShowMsg, bSkillAvail;
local Skill askill;
local float curx, cury, w, h, w2, t, offset;
local String str;


if ( curSkillPoints != Player.SkillPointsAvail )
bNotifySkills = False;

bSkillAvail = False;
if ( Player.SkillSystem != None )
{
askill = Player.SkillSystem.FirstSkill;

while ( askill != None )
{
if ( SkillSwimming(askill) == None )
{
if ( askill.CurrentLevel < 3 )
{
if ( Player.SkillPointsAvail >= askill.cost[askill.CurrentLevel] )
{
bSkillAvail = True;
break;
}
}
}
askill = askill.next;
}
if ( bSkillAvail )
{
if ( !bNotifySkills )
{
RefreshKey();
timeToNotify = Player.Level.Timeseconds + TimeDelay;
curSkillPoints = Player.SkillPointsAvail;
Player.BuySkillSound( 3 );
bNotifySkills = True;
}
if ( timeToNotify > Player.Level.Timeseconds )
{
// Flash them to draw a little more attention 1.5 on .5 off
if ( (Player.Level.Timeseconds % 1.5) < 1 )
{
offset = 0;
gc.SetFont(Font'FontMenuSmall_DS');
cury = height * skillMsgY;
curx = width * skillListX;
str = PressString $ curKeyName $ PressEndString;
gc.GetTextExtent( 0, w, h, SkillsAvailableString );
gc.GetTextExtent( 0, w2, h, str );
if ( (curx + ((w-w2)*0.5)) < 0 )
offset = -(curx + ((w-w2)*0.5));
gc.SetTextColor( colLtGreen );
gc.GetTextExtent( 0, w, h, SkillsAvailableString );
gc.DrawText( curx+offset, cury, w, h, SkillsAvailableString );
cury += h;
gc.GetTextExtent( 0, w2, h, str );
curx += ((w-w2)*0.5);
gc.DrawText( curx+offset, cury, w2, h, str );
}
}
}
}




HUDMultiplayer.uc (extends DeusExBaseWindow //)

var String winnerName;
var int winningTeam;
var float inputLockoutTimer; // Don't even try to kill window until timer counts down
var bool bDestroy;
var String winKiller, winKillee, winMethod;

DestroyWindow


root.ShowCursor( True );

// Unfreeze the scoreArray now that we are starting out next game
if ( DeusExMPGame(Player.DXGame) != None )
{
Player.bShowScores = False;
}
inputLockoutTimer = 0;
Super.DestroyWindow();

DrawWindow (GC gc)


if ( Player != None )
{
if ( DeathMatchGame(Player.DXGame) != None )
DeathMatchGame(Player.DXGame).PlayerWinScreen( Player, GC, width, height, winningTeam, winnerName, winKiller, winKillee, winMethod );
else if ( TeamDMGame(Player.DXGame) != None )
TeamDMGame(Player.DXGame).TeamWinScreen( Player, GC, width, height, winningTeam, winKiller, winKillee, winMethod );
}
Super.DrawWindow(gc);

InitWindow


Super.InitWindow();

// Refresh the scoreArray, then freeze the scores so when players jump into next game
// the data doesn't change.
if ( DeusExMPGame(Player.DXGame) != None )
{
DeusExMPGame(Player.DXGame).RefreshScoreArray( Player );
Player.bShowScores = True;
}
SetWindowAlignments(HALIGN_Full, VALIGN_Full);
Show();
root.ShowCursor( False );
inputLockoutTimer = Player.Level.Timeseconds + inputLockoutDelay;
bDestroy = False;

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;
local String KeyName, Alias;


bKeyHandled = False;

if (!bRepeat)
{
switch(key)
{
case IK_Escape:
bKeyHandled = True;
break;
}
}

// Let them send chat messages
KeyName = player.ConsoleCommand("KEYNAME "$key );
Alias = player.ConsoleCommand( "KEYBINDING "$KeyName );

if ( Alias ~= "Talk" )
Player.Player.Console.Talk();
else if ( Alias ~= "TeamTalk" )
Player.Player.Console.TeamTalk();

if ( !bKeyHandled && ( inputLockoutTimer > Player.Level.Timeseconds ))
return True;

if ( bKeyHandled && !bDestroy )
{
bDestroy = True;
Player.DisconnectPlayer();
return True;
}
return True;




HUDObjectBelt.uc (extends HUDBaseWindow)

var TileWindow winSlots; // Window containing slots
var HUDObjectSlot objects[10];
var int KeyRingSlot;
var Bool bInteractive;
var Texture texBackgroundLeft;
var Texture texBackgroundRight;
var Texture texBorder[3];
texBackgroundLeft=Texture'DeusExUI.UserInterface.HUDObjectBeltBackground_Left'
texBackgroundRight=Texture'DeusExUI.UserInterface.HUDObjectBeltBackground_Right'
texBorder(0)=Texture'DeusExUI.UserInterface.HUDObjectBeltBorder_1'
texBorder(1)=Texture'DeusExUI.UserInterface.HUDObjectBeltBorder_2'
texBorder(2)=Texture'DeusExUI.UserInterface.HUDObjectBeltBorder_3'

AddObjectToBelt (Inventory newItem, int pos, bool bOverride) -> bool


local int i;
local int FirstPos;
local bool retval;


retval = true;

if ((newItem != None ) && (newItem.Icon != None))
{
// If this is the NanoKeyRing, force it into slot 0
if (newItem.IsA('NanoKeyRing'))
{
ClearPosition(0);
pos = 0;
}

if ( (!IsValidPos(pos)) ||
( (Player.Level.NetMode != NM_Standalone) &&
(Player.bBeltIsMPInventory) &&
(!newItem.TestMPBeltSpot(pos)) ) )
{
FirstPos = 1;
if ((Player.Level.NetMode != NM_Standalone) && (Player.bBeltIsMPInventory))
FirstPos = 0;
for (i=FirstPos; IsValidPos(i); i++)
{
if ((objects[i].GetItem() == None) && ( (Player.Level.NetMode == NM_Standalone) || (!Player.bBeltIsMPInventory) || (newItem.TestMPBeltSpot(i))))
{
break;
}
}
if (!IsValidPos(i))
{
if (bOverride)
pos = 1;
}
else
{
pos = i;
}
}

if (IsValidPos(pos))
{
// If there's already an object here, remove it
if ( objects[pos].GetItem() != None )
RemoveObjectFromBelt(objects[pos].GetItem());

objects[pos].SetItem(newItem);
}
else
{
retval = false;
}
}
else
retval = false;

// The inventory item needs to know it's in the object
// belt, as well as the location inside the belt. This is used
// when traveling to a new map.

if ((retVal) && (Player.Role == ROLE_Authority))
{
newItem.bInObjectBelt = True;
newItem.beltPos = pos;
}

UpdateInHand();

return (retval);

AssignWinInv (PersonaScreenInventory newWinInventory)


local Int slotIndex;


// Update the individual slots
for (slotIndex=0; slotIndex<10; slotIndex++)
objects[slotIndex].AssignWinInv(newWinInventory);

UpdateInHand();

ClearBelt


local int beltPos;


for(beltPos=0; beltPos<10; beltPos++)
ClearPosition(beltPos);

ClearPosition (int pos)


if (IsValidPos(pos))
objects[pos].SetItem(None);

CreateNanoKeySlot


if (player != None)
{
if (player.KeyRing != None)
{
objects[KeyRingSlot].SetItem(player.KeyRing);
objects[KeyRingSlot].AllowDragging(False);
}
}

CreateSlots


local int i;
local RadioBoxWindow winRadio;


// Radio window used to contain objects so they can be selected
// with the mouse on the inventory screen.

winRadio = RadioBoxWindow(NewChild(Class'RadioBoxWindow'));
winRadio.SetSize(504, 54);
winRadio.SetPos(10, 6);
winRadio.bOneCheck = False;

winSlots = TileWindow(winRadio.NewChild(Class'TileWindow'));
winSlots.SetMargins(0, 0);
winSlots.SetMinorSpacing(0);
winSlots.SetOrder(ORDER_LeftThenUp);

for (i=0; i<10; i++)
{
objects[i] = HUDObjectSlot(winSlots.NewChild(Class'HUDObjectSlot'));
objects[i].SetObjectNumber(i);
objects[i].Lower();

// Last item is a little shorter
if ( i == 0 )
objects[i].SetWidth(44);
}
objects[0].Lower();


DrawBackground (GC gc)


local Color newBackground;


gc.SetStyle(backgroundDrawStyle);

if (( player != None ) && (player.Level.NetMode != NM_Standalone) && ( player.bBuySkills ))
{
newBackground.r = colBackground.r / 2;
newBackground.g = colBackground.g / 2;
newBackground.b = colBackground.b / 2;
gc.SetTileColor(newBackground);
}
else
gc.SetTileColor(colBackground);

gc.DrawTexture( 2, 6, 9, 54, 0, 0, texBackgroundLeft);
gc.DrawTexture(514, 6, 8, 54, 0, 0, texBackgroundRight);

DrawBorder (GC gc)


local Color newCol;


if (bDrawBorder)
{
gc.SetStyle(borderDrawStyle);
if (( player != None ) && ( player.bBuySkills ))
{
newCol.r = colBorder.r / 2;
newCol.g = colBorder.g / 2;
newCol.b = colBorder.b / 2;
gc.SetTileColor(newCol);
}
else
gc.SetTileColor(colBorder);

gc.DrawTexture( 0, 0, 256, 69, 0, 0, texBorder[0]);
gc.DrawTexture(256, 0, 256, 69, 0, 0, texBorder[1]);
gc.DrawTexture(512, 0, 29, 69, 0, 0, texBorder[2]);
}

GetObjectFromBelt (int pos) -> Inventory


if (IsValidPos(pos))
return (objects[pos].GetItem());
else
return (None);

InitWindow


Super.InitWindow();

// Hardcoded size, baby!
SetSize(541, 69);

CreateSlots();
CreateNanoKeySlot();

PopulateBelt();

IsValidPos (int pos) -> bool


// Don't allow NanoKeySlot to be used
if ((pos >= 0) && (pos < 10))
return true;
else
return false;

PopulateBelt


local Inventory anItem;
local HUDObjectBelt belt;
local DeusExPlayer player;


// Get a pointer to the player
player = DeusExPlayer(DeusExRootWindow(GetRootWindow()).parentPawn);

for (anItem=player.Inventory; anItem!=None; anItem=anItem.Inventory)
if (anItem.bInObjectBelt)
{
AddObjectToBelt(anItem, anItem.beltPos, True);
}

RefreshHUDDisplay (float DeltaTime)


ClearBelt();
PopulateBelt();
UpdateInHand();
Super.RefreshHUDDisplay(DeltaTime);

RemoveObjectFromBelt (Inventory item)


local int i;
local int StartPos;


StartPos = 1;
if ( (Player != None) && (Player.Level.NetMode != NM_Standalone) && (Player.bBeltIsMPInventory) )
StartPos = 0;

for (i=StartPos; IsValidPos(i); i++)
{
if (objects[i].GetItem() == item)
{
objects[i].SetItem(None);
item.bInObjectBelt = False;
item.beltPos = -1;

break;
}
}

SetInteractive (bool bNewInteractive)


bInteractive = bNewInteractive;

SetVisibility (bool bNewVisibility)


Show( bNewVisibility );

UpdateInHand


local int slotIndex;


// highlight the slot and unhighlight the other slots
if ((player != None) && (!bInteractive))
{
for (slotIndex=0; slotIndex {
// Highlight the object in the player's hand
if ((player.inHand != None) && (objects[slotIndex].item == player.inHand))
objects[slotIndex].HighlightSelect(True);
else
objects[slotIndex].HighlightSelect(False);

if ((player.inHandPending != None) && //(player.inHandPending != player.inHand) &&
(objects[slotIndex].item == player.inHandPending))
objects[slotIndex].SetToggle(true);
else
objects[slotIndex].SetToggle(false);
}
}

UpdateObjectText (int pos)


// First find the object
if (IsValidPos(pos))
objects[pos].UpdateItemText();




HUDObjectSlot.uc (extends ToggleWindow)

var DeusExPlayer player;
var int objectNum;
var Inventory item;
var Color colObjectNum;
var Color colObjectDesc;
var Color colOutline;
var Color fillColor;
var Color colDropGood;
var Color colDropBad;
var Color colNone;
var Color colSelected;
var Color colSelectionBorder;
var int slotFillWidth;
var int slotFillHeight;
var int borderWidth;
var int borderHeight;
var String itemText;
var PersonaScreenInventory winInv; // Pointer back to the inventory window
var Int clickX;
var Int clickY;
var bool bDragStart;
var bool bDimIcon;
var bool bAllowDragging;
var bool bDragging; // Set to True when we're dragging
var FillModes fillMode;
var Texture slotTextures;
var int slotIconX;
var int slotIconY;
var int slotNumberX;
var int slotNumberY;
var int itemTextPosY;
var EDrawStyle backgroundDrawStyle;
var Texture texBackground;
var Texture mpBorderTex; //For drawing borders between item slot sections in mp
var Color colBackground;
var Texture texBorders[9];
var localized String RoundLabel;
var localized String RoundsLabel;
var localized String CountLabel;
colObjectNum=(G=170,B=255)
colDropGood=(R=32,G=128,B=32)
colDropBad=(R=128,G=32,B=32)
colSelected=(R=60,G=60,B=60)
colSelectionBorder=(R=255,G=255,B=255)
slotFillWidth=42
slotFillHeight=37
borderWidth=44
borderHeight=50
bAllowDragging=True
fillMode=FM_None
slotIconX=1
slotIconY=3
slotNumberX=38
slotNumberY=3
texBackground=Texture'DeusExUI.UserInterface.HUDObjectBeltBackground_Cell'
mpBorderTex=Texture'DeusExUI.UserInterface.HUDObjectBeltBackground_Divider'
texBorders(0)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_TL'
texBorders(1)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_TR'
texBorders(2)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_BL'
texBorders(3)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_BR'
texBorders(4)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Left'
texBorders(5)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Right'
texBorders(6)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Top'
texBorders(7)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Bottom'
texBorders(8)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Center'
RoundLabel="%d Rd"
RoundsLabel="%d Rds"
CountLabel="COUNT:"

AllowDragging (bool bNewAllowDragging)


bAllowDragging = bNewAllowDragging;

AssignWinInv (PersonaScreenInventory newWinInventory)


winInv = newWinInventory;

DrawHUDBackground (GC gc)


local Color newBackground;


gc.SetStyle(backgroundDrawStyle);
if (( player != None ) && (player.Level.NetMode != NM_Standalone) && (player.bBuySkills))
{
newBackground.r = colBackground.r / 2;
newBackground.g = colBackground.g / 2;
newBackground.b = colBackground.b / 2;
gc.SetTileColor(newBackground);
}
else
gc.SetTileColor(colBackground);

// DEUS_EX AMSD Warning. This background delineates specific item locations on the belt, which
// are usually only known to the items themselves.
if ( (player != None) && (Player.Level.Netmode != NM_Standalone) && (Player.bBeltIsMPInventory) && ((objectNum == 3) || (objectNum == 6)) )
{
gc.DrawTexture(0, 0, width, height, 0, 0, mpBorderTex);
}
else
gc.DrawTexture(0, 0, width, height, 0, 0, texBackground);

DrawHUDIcon (GC gc)


gc.SetStyle(DSTY_Masked);
gc.SetTileColorRGB(255, 255, 255);
gc.DrawTexture(slotIconX, slotIconY, slotFillWidth, slotFillHeight, 0, 0, item.Icon);

DrawWindow (GC gc)


// First draw the background
DrawHUDBackground(gc);

// Now fill the area under the icon, which can be different
// colors based on the state of the item.
//
// Don't waste time drawing the fill if the fillMode is set
// to None

if (fillMode != FM_None)
{
SetFillColor();
gc.SetStyle(DSTY_Translucent);
gc.SetTileColor(fillColor);
gc.DrawPattern(
slotIconX, slotIconY,
slotFillWidth, slotFillHeight,
0, 0, Texture'Solid' );
}

// Don't draw any of this if we're dragging
if ((item != None) && (item.Icon != None) && (!bDragging))
{
// Draw the icon
DrawHUDIcon(gc);

// Text defaults
gc.SetAlignments(HALIGN_Center, VALIGN_Center);
gc.EnableWordWrap(false);
gc.SetTextColor(colObjectNum);

// Draw the item description at the bottom
gc.DrawText(1, 42, 42, 7, item.BeltDescription);

// If there's any additional text (say, for an ammo or weapon), draw it
if (itemText != "")
gc.DrawText(slotIconX, itemTextPosY, slotFillWidth, 8, itemText);

// Draw selection border
if (bButtonPressed)
{
gc.SetTileColor(colSelectionBorder);
gc.SetStyle(DSTY_Masked);
gc.DrawBorders(slotIconX - 1, slotIconY - 1, borderWidth, borderHeight, 0, 0, 0, 0, texBorders);
}
}
else if ((item == None) && (player != None) && (player.Level.NetMode != NM_Standalone) && (player.bBeltIsMPInventory))
{
// Text defaults
gc.SetAlignments(HALIGN_Center, VALIGN_Center);
gc.EnableWordWrap(false);
gc.SetTextColor(colObjectNum);

if ((objectNum >=1) && (objectNum <=3))
{
gc.DrawText(1, 42, 42, 7, "WEAPONS");
}
else if ((objectNum >=4) && (objectNum <=6))
{
gc.DrawText(1, 42, 42, 7, "GRENADES");
}
else if ( ((objectNum >=7) && (objectNum <=9)) || (objectNum == 0) )
{
gc.DrawText(1, 42, 42, 7, "TOOLS");
}
}

// Draw the Object Slot Number in upper-right corner
gc.SetAlignments(HALIGN_Right, VALIGN_Center);
gc.SetTextColor(colObjectNum);
gc.DrawText(slotNumberX - 1, slotNumberY, 6, 7, objectNum);

FinishButtonDrag


winInv.FinishButtonDrag();

bDragStart = False;
bDragging = False;

GetIconPos (out int iconPosX, out int iconPosY)


iconPosX = slotIconX;
iconPosY = slotIconY;

GetItem -> Inventory


return (item);

HighlightSelect (bool bHighlight)


if (bHighlight)
fillMode = FM_Selected;
else
fillMode = FM_None;

InitWindow


Super.InitWindow();

objectNum = -1;
item = None;

SetSelectability(false);

SetSize(51, 54);
SetFont(Font'FontTiny');

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

// Position where we'll be drawing the item-dependent text
itemTextPosY = slotFillHeight - 8 + slotIconY;

StyleChanged();

MouseMoved (float newX, float newY)


local Float invX;
local Float invY;


if (bAllowDragging)
{
if (bDragStart)
{
// Only start a drag even if the cursor has moved more than, say,
// two pixels. This prevents problems if the user just wants to
// click on an item to select it but is a little sloppy. :)
if (( Abs(newX - clickX) > 2 ) || ( Abs(newY- clickY) > 2 ))
{
StartButtonDrag();
SetCursorPos(
slotIconX + slotFillWidth/2,
slotIconY + slotFillHeight/2);
}
}

if (bDragging)
{
// Call the InventoryWindow::MouseMoved function, with translated
// coordinates.
ConvertCoordinates(Self, newX, newY, winInv, invX, invY);
winInv.UpdateDragMouse(invX, invY);
}
}

ResetFill


fillMode = FM_None;

SetDropFill (bool bGoodDrop)


if (bGoodDrop)
fillMode = FM_DropGood;
else
fillMode = FM_DropBad;

SetFillColor


switch(fillMode)
{
case FM_Selected:
fillColor = colSelected;
break;
case FM_DropBad:
fillColor = colDropBad;
break;
case FM_DropGood:
fillColor = colDropGood;
break;
case FM_None:
fillColor = colNone;
break;
}

SetItem (Inventory newItem)


item = newItem;
if ( newItem != None )
{
newItem.bInObjectBelt = True;
newItem.beltPos = objectNum;
}
else
{
HighlightSelect(False);
SetToggle(False);
}

// Update the text that will be displayed above the icon (if any)
UpdateItemText();

SetObjectNumber (int newNumber)


objectNum = newNumber;

StartButtonDrag


bDragStart = False;
bDragging = True;

winInv.StartButtonDrag(Self);

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colBackground = theme.GetColorFromName('HUDColor_Background');
colObjectNum = theme.GetColorFromName('HUDColor_NormalText');

colSelected.r = Int(Float(colBackground.r) * 0.50);
colSelected.g = Int(Float(colBackground.g) * 0.50);
colSelected.b = Int(Float(colBackground.b) * 0.50);

if (player.GetHUDBackgroundTranslucency())
backgroundDrawStyle = DSTY_Translucent;
else
backgroundDrawStyle = DSTY_Masked;

ToggleChanged (Window button, bool bNewToggle) -> bool


if ((item == None) && (bNewToggle))
{
SetToggle(False);
return True;
}
else
{
return False;
}

UpdateItemText


local DeusExWeapon weapon;


itemText = "";

if (item != None)
{
if (item.IsA('DeusExWeapon'))
{
// If this is a weapon, show the number of remaining rounds
weapon = DeusExWeapon(item);

// Ammo loaded
if ((weapon.AmmoName != class'AmmoNone') && (!weapon.bHandToHand) && (weapon.ReloadCount != 0) && (weapon.AmmoType != None))
itemText = weapon.AmmoType.beltDescription;

// If this is a grenade
if (weapon.IsA('WeaponNanoVirusGrenade') ||
weapon.IsA('WeaponGasGrenade') ||
weapon.IsA('WeaponEMPGrenade') ||
weapon.IsA('WeaponLAM'))
{
if (weapon.AmmoType.AmmoAmount > 1)
itemText = CountLabel @ weapon.AmmoType.AmmoAmount;
}

}
else if (item.IsA('DeusExPickup') && (!item.IsA('NanoKeyRing')))
{
// If the object is a SkilledTool (but not the NanoKeyRing) then show the
// number of uses
if (DeusExPickup(item).NumCopies > 1)
itemText = DeusExPickup(item).CountLabel @ String(DeusExPickup(item).NumCopies);
}
}




HUDReceivedDisplay.uc (extends HUDSharedBorderWindow)

var TileWindow winTile;
var TextWindow txtReceived;
var Font fontReceived;
var Float displayTimer;
var Float displayLength;
var int topMargin;
var localized string TextReceivedLabel;
fontReceived=Font'DeusExUI.FontMenuHeaders_DS'
displayLength=3.000000
TopMargin=5
TextReceivedLabel="Received:"

AddItem (Inventory invItem, Int count)


local HUDReceivedDisplayItem item;


item = HUDReceivedDisplayItem(winTile.NewChild(Class'HUDReceivedDisplayItem'));
item.SetItem(invItem, count);

displayTimer = 0.0;
Show();
bTickEnabled = True;
AskParentForReconfigure();

ChildRequestedReconfiguration (window child) -> bool


ConfigurationChanged();

return True;

ConfigurationChanged


winTile.ConfigureChild(0, topMargin, width, height);

CreateReceivedLabel


txtReceived = TextWindow(winTile.NewChild(Class'TextWindow'));
txtReceived.SetFont(fontReceived);
txtReceived.SetText(TextReceivedLabel);

CreateTileWindow


winTile = TileWindow(NewChild(Class'TileWindow'));

winTile.SetOrder(ORDER_RightThenDown);
winTile.SetChildAlignments(HALIGN_Left, VALIGN_Center);
winTile.SetPos(0, topMargin);
winTile.SetMargins(10, 10);
winTile.SetMinorSpacing(4);
winTile.MakeWidthsEqual(False);
winTile.MakeHeightsEqual(True);

GetTimeRemaining -> float


if (IsVisible())
return displayLength - displayTimer;
else
return 0.0;

InitWindow


Super.InitWindow();

CreateTileWindow();
CreateReceivedLabel();

StyleChanged();

bTickEnabled = False;

RemoveItems


local Window itemWindow;
local Window nextWindow;


bTickEnabled = False;

itemWindow = winTile.GetTopChild();
while( itemWindow != None )
{
nextWindow = itemWindow.GetLowerSibling();

// Don't destroy the "Received" TextWindow()
if (!itemWindow.IsA('TextWindow'))
{
itemWindow.Destroy();
}

itemWindow = nextWindow;
}

Hide();

StyleChanged


Super.StyleChanged();

if (txtReceived != None)
txtReceived.SetTextColor(colText);

Tick (float deltaSeconds)


displayTimer += deltaSeconds;

if (displayTimer > displayLength)
RemoveItems();




HUDReceivedDisplayItem.uc (extends TileWindow)

var DeusExPlayer player;
var Window winIcon;
var TextWindow winLabel;
var Color colText;
var Font fontLabel;
fontLabel=Font'DeusExUI.FontMenuSmall_DS'

InitWindow


Super.InitWindow();

SetOrder(ORDER_DownThenRight);
SetChildAlignments(HALIGN_Center, VALIGN_Top);
SetMargins(0, 0);
SetMinorSpacing(2);
MakeWidthsEqual(False);
MakeHeightsEqual(False);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

SetItem (Inventory invItem, int count)


local String labelText;


winIcon = NewChild(Class'Window');
winIcon.SetSize(42, 37);
winIcon.SetBackgroundStyle(DSTY_Masked);
winIcon.SetBackground(invItem.Icon);

winLabel = TextWindow(NewChild(Class'TextWindow'));
winLabel.SetFont(fontLabel);
winLabel.SetTextColor(colText);
winLabel.SetTextAlignments(HALIGN_Center, VALIGN_Top);

labelText = invItem.beltDescription;
if (count > 1)
labelText = labelText $ " (" $ String(count) $ ")";

winLabel.SetText(labelText);

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colText = theme.GetColorFromName('HUDColor_NormalText');

if (winLabel != None)
winLabel.SetTextColor(colText);




HUDRechargeWindow.uc (extends DeusExBaseWindow)

var DeusExPlayer player;
var bool bBorderTranslucent;
var bool bBackgroundTranslucent;
var bool bDrawBorder;
var Color colBackground;
var Color colBorder;
var Color colHeaderText;
var Color colText;
var Texture texBackground[2];
var Texture texBorder[2];
var PersonaHeaderTextWindow winTitle;
var PersonaNormalTextWindow winInfo;
var PersonaActionButtonWindow btnRecharge;
var PersonaActionButtonWindow btnClose;
var RepairBot repairBot;
var Float lastRefresh;
var Float refreshInterval;
var ProgressBarWindow winBioBar;
var TextWindow winBioBarText;
var PersonaNormalTextWindow winBioInfoText;
var ProgressBarWindow winRepairBotBar;
var TextWindow winRepairBotBarText;
var PersonaNormalTextWindow winRepairBotInfoText;
var localized String RechargeButtonLabel;
var localized String CloseButtonLabel;
var localized String RechargeTitle;
var localized String RepairBotInfoText;
var localized String RepairBotStatusLabel;
var localized String ReadyLabel;
var Localized String SecondsPluralLabel;
var Localized String SecondsSingularLabel;
var Localized String BioStatusLabel;
var Localized String RepairBotRechargingLabel;
var Localized String RepairBotReadyLabel;
var Localized String RepairBotYouAreHealed;
texBackground(0)=Texture'DeusExUI.UserInterface.HUDRepairbotBackground_1'
texBackground(1)=Texture'DeusExUI.UserInterface.HUDRepairbotBackground_2'
texBorder(0)=Texture'DeusExUI.UserInterface.HUDRepairbotBorder_1'
texBorder(1)=Texture'DeusExUI.UserInterface.HUDRepairbotBorder_2'
refreshInterval=0.200000
RechargeButtonLabel=" |&Recharge "
CloseButtonLabel=" |&Close "
RechargeTitle="REPAIRBOT INTERFACE"
RepairBotInfoText="The RepairBot can restore up to %d points of Bio Electric Energy every %d seconds."
RepairBotStatusLabel="RepairBot Status:"
ReadyLabel="Ready!"
SecondsPluralLabel="Recharging: %d seconds"
SecondsSingularLabel="Recharging: %d second"
BioStatusLabel="Bio Energy:"
RepairBotRechargingLabel="|n|nThe RepairBot is currently Recharging. Please Wait."
RepairBotReadyLabel="|n|nThe RepairBot is Ready, you may now Recharge."
RepairBotYouAreHealed="|n|nYour BioElectric Energy is at Maximum."
ScreenType=ST_Popup

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnClose:
root.PopWindow();
break;

case btnRecharge:
if (repairBot != None)
{
repairBot.ChargePlayer(player);

// play a cool animation
repairBot.PlayAnim('Clamp');

UpdateBioWindows();
UpdateRepairBotWindows();
UpdateInfoText();
EnableButtons();
}
break;
}

if (!bHandled)
bHandled = Super.ButtonActivated(buttonPressed);

return bHandled;

CreateBioWindows


winBioBar = ProgressBarWindow(NewChild(Class'ProgressBarWindow'));

winBioBar.SetPos(114, 91);
winBioBar.SetSize(140, 12);
winBioBar.SetValues(0, 100);
winBioBar.UseScaledColor(True);
winBioBar.SetVertical(False);
winBioBar.SetScaleColorModifier(0.5);
winBioBar.SetDrawBackground(False);

winBioBarText = TextWindow(NewChild(Class'TextWindow'));
winBioBarText.SetPos(114, 93);
winBioBarText.SetSize(140, 12);
winBioBarText.SetTextMargins(0, 0);
winBioBarText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winBioBarText.SetFont(Font'FontMenuSmall_DS');
winBioBarText.SetTextColorRGB(255, 255, 255);

winBioInfoText = PersonaNormalTextWindow(NewChild(Class'PersonaNormalTextWindow'));
winBioInfoText.SetPos(20, 92);
winBioInfoText.SetSize(90, 12);
winBioInfoText.SetTextMargins(0, 0);

UpdateBioWindows();

CreateButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(15, 126);
winActionButtons.SetSize(191, 16);
winActionButtons.FillAllSpace(False);

btnClose = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnClose.SetButtonText(CloseButtonLabel);

btnRecharge = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnRecharge.SetButtonText(RechargeButtonLabel);

CreateControls


CreateTitleWindow();
CreateInfoWindow();
CreateBioWindows();
CreateRepairbotWindows();
CreateButtons();

CreateInfoWindow


winInfo = PersonaNormalTextWindow(NewChild(Class'PersonaNormalTextWindow'));
winInfo.SetTextAlignments(HALIGN_Left, VALIGN_Center);
winInfo.SetPos(20, 39);
winInfo.SetSize(233, 44);

CreateRepairbotWindows


winRepairBotBar = ProgressBarWindow(NewChild(Class'ProgressBarWindow'));

winRepairBotBar.SetPos(114, 111);
winRepairBotBar.SetSize(140, 12);
winRepairBotBar.SetValues(0, 100);
winRepairBotBar.UseScaledColor(True);
winRepairBotBar.SetVertical(False);
winRepairBotBar.SetScaleColorModifier(0.5);
winRepairBotBar.SetDrawBackground(False);

winRepairBotBarText = TextWindow(NewChild(Class'TextWindow'));
winRepairBotBarText.SetPos(114, 113);
winRepairBotBarText.SetSize(140, 12);
winRepairBotBarText.SetTextMargins(0, 0);
winRepairBotBarText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winRepairBotBarText.SetFont(Font'FontMenuSmall_DS');
winRepairBotBarText.SetTextColorRGB(255, 255, 255);

winRepairBotInfoText = PersonaNormalTextWindow(NewChild(Class'PersonaNormalTextWindow'));
winRepairBotInfoText.SetPos(20, 112);
winRepairBotInfoText.SetSize(90, 12);
winRepairBotInfoText.SetTextMargins(0, 0);

CreateTitleWindow


winTitle = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
winTitle.SetTextAlignments(HALIGN_Left, VALIGN_Center);
winTitle.SetText(RechargeTitle);
winTitle.SetPos(20, 20);
winTitle.SetSize(233, 14);

DestroyWindow


if (repairBot != None)
{
repairBot.PlayAnim('Stop');
repairBot.PlaySound(sound'RepairBotLowerArm', SLOT_None);
repairBot.FollowOrders();
}

Super.DestroyWindow();

DrawBackground (GC gc)


if (bBackgroundTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBackground);

gc.DrawTexture(0, 0, 256, height, 0, 0, texBackground[0]);
gc.DrawTexture(256, 0, 9, height, 0, 0, texBackground[1]);

DrawBorder (GC gc)


if (bDrawBorder)
{
if (bBorderTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBorder);

gc.DrawTexture(0, 0, 256, height, 0, 0, texBorder[0]);
gc.DrawTexture(256, 0, 9, height, 0, 0, texBorder[1]);
}

DrawWindow (GC gc)


// First draw the background then the border
DrawBackground(gc);

// Don't call the DrawBorder routines if
// they are disabled
if (bDrawBorder)
DrawBorder(gc);

EnableButtons


if (repairBot != None)
{
if (player.Energy >= player.EnergyMax)
btnRecharge.EnableWindow(False);
else
btnRecharge.EnableWindow(repairBot.CanCharge());
}

InitWindow


Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

SetSize(265, 153);

CreateControls();
EnableButtons();

bTickEnabled = TRUE;

StyleChanged();

SetRepairBot (RepairBot newBot)


repairBot = newBot;

if (repairBot != None)
{
repairBot.StandStill();
repairBot.PlayAnim('Start');
repairBot.PlaySound(sound'RepairBotRaiseArm', SLOT_None);

UpdateInfoText();
UpdateRepairBotWindows();
EnableButtons();
}

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colBackground = theme.GetColorFromName('HUDColor_Background');
colBorder = theme.GetColorFromName('HUDColor_Borders');
colText = theme.GetColorFromName('HUDColor_NormalText');
colHeaderText = theme.GetColorFromName('HUDColor_HeaderText');

bBorderTranslucent = player.GetHUDBorderTranslucency();
bBackgroundTranslucent = player.GetHUDBackgroundTranslucency();
bDrawBorder = player.GetHUDBordersVisible();

Tick (float deltaSeconds)


if (lastRefresh >= refreshInterval)
{
lastRefresh = 0.0;
UpdateRepairBotWindows();
UpdateInfoText();
EnableButtons();
}
else
{
lastRefresh += deltaSeconds;
}

UpdateBioWindows


local float energyPercent;


energyPercent = 100.0 * (player.Energy / player.EnergyMax);
winBioBar.SetCurrentValue(energyPercent);

winBioBarText.SetText(String(Int(energyPercent)) $ "%");

winBioInfoText.SetText(BioStatusLabel);

UpdateInfoText


local String infoText;


if (repairBot != None)
{
infoText = Sprintf(RepairBotInfoText, repairBot.chargeAmount, repairBot.chargeRefreshTime);

if (player.Energy >= player.EnergyMax)
infoText = infoText $ RepairBotYouAreHealed;
else if (repairBot.CanCharge())
infoText = infoText $ RepairBotReadyLabel;
else
infoText = infoText $ RepairBotRechargingLabel;

winInfo.SetText(infoText);
}

UpdateRepairBotWindows


local float barPercent;
local String infoText;
local float secondsRemaining;


if (repairBot != None)
{
// Update the bar
if (repairBot.CanCharge())
{
winRepairBotBar.SetCurrentValue(100);
winRepairBotBarText.SetText(ReadyLabel);
}
else
{
secondsRemaining = repairBot.GetRefreshTimeRemaining();

barPercent = 100 * (1.0 - (secondsRemaining / Float(repairBot.chargeRefreshTime)));

winRepairBotBar.SetCurrentValue(barPercent);

if (secondsRemaining == 1)
winRepairBotBarText.SetText(Sprintf(SecondsSingularLabel, Int(secondsRemaining)));
else
winRepairBotBarText.SetText(Sprintf(SecondsPluralLabel, Int(secondsRemaining)));
}

winRepairBotInfoText.SetText(RepairBotStatusLabel);
}




HUDSharedBorderWindow.uc (extends HUDBaseWindow)

var int minHeight;
var int topMargin;
var int bottomMargin;
var Texture texBackgrounds[9];
var Texture texBorders[9];
MinHeight=40
TopMargin=13
BottomMargin=10
texBackgrounds(0)=Texture'DeusExUI.UserInterface.HUDWindowBackground_TL'
texBackgrounds(1)=Texture'DeusExUI.UserInterface.HUDWindowBackground_TR'
texBackgrounds(2)=Texture'DeusExUI.UserInterface.HUDWindowBackground_BL'
texBackgrounds(3)=Texture'DeusExUI.UserInterface.HUDWindowBackground_BR'
texBackgrounds(4)=Texture'DeusExUI.UserInterface.HUDWindowBackground_Left'
texBackgrounds(5)=Texture'DeusExUI.UserInterface.HUDWindowBackground_Right'
texBackgrounds(6)=Texture'DeusExUI.UserInterface.HUDWindowBackground_Top'
texBackgrounds(7)=Texture'DeusExUI.UserInterface.HUDWindowBackground_Bottom'
texBackgrounds(8)=Texture'DeusExUI.UserInterface.HUDWindowBackground_Center'
texBorders(0)=Texture'DeusExUI.UserInterface.HUDWindowBorder_TL'
texBorders(1)=Texture'DeusExUI.UserInterface.HUDWindowBorder_TR'
texBorders(2)=Texture'DeusExUI.UserInterface.HUDWindowBorder_BL'
texBorders(3)=Texture'DeusExUI.UserInterface.HUDWindowBorder_BR'
texBorders(4)=Texture'DeusExUI.UserInterface.HUDWindowBorder_Left'
texBorders(5)=Texture'DeusExUI.UserInterface.HUDWindowBorder_Right'
texBorders(6)=Texture'DeusExUI.UserInterface.HUDWindowBorder_Top'
texBorders(7)=Texture'DeusExUI.UserInterface.HUDWindowBorder_Bottom'
texBorders(8)=Texture'DeusExUI.UserInterface.HUDWindowBorder_Center'

DrawBackground (GC gc)


gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawBorders(0, 0, width, height, 0, 0, 0, 0, texBackgrounds);

DrawBorder (GC gc)


if (bDrawBorder)
{
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);
gc.DrawBorders(0, 0, width, height, 0, 0, 0, 0, texBorders);
}




HackableDevices.uc (extends ElectronicDevices)

var() bool bHackable; // can this device be hacked?
var() float hackStrength; // "toughness" of the hack on this device - 0.0 is easy, 1.0 is hard
var() float initialhackStrength; // for multiplayer hack resets, this is the initial value
var() name UnTriggerEvent[4]; // event to UnTrigger when hacked
var bool bHacking; // a multitool is currently being used
var float hackValue; // how much this multitool is currently hacking
var float hackTime; // how much time it takes to use a single multitool
var int numHacks; // how many times to reduce hack strength
var float TicksSinceLastHack; // num 0.1 second ticks done since last hackstrength update(includes partials)
var float TicksPerHack; // num 0.1 second ticks needed for a hackstrength update(includes partials)
var float LastTickTime; // time last tick occurred.
var DeusExPlayer hackPlayer; // the player that is hacking
var Multitool curTool; // the multitool that is being used
var float TimeSinceReset; // time since the hackstate was last reset.
var float TimeToReset; // how long between resets
var localized string msgMultitoolSuccess; // message when the device is hacked
var localized string msgNotHacked; // message when the device is not hacked
var localized string msgHacking; // message when the device is being hacked
var localized string msgAlreadyHacked; // message when the device is already hacked
bHackable=True
hackStrength=0.200000
HackTime=4.000000
TimeToReset=28.000000
msgMultitoolSuccess="You bypassed the device"
msgNotHacked="It's secure"
msgHacking="Bypassing the device..."
msgAlreadyHacked="It's already bypassed"
Physics=PHYS_None
bCollideWorld=False

Frob (Actor Frobber, Inventory frobWith)


local Pawn P;
local DeusExPlayer Player;
local bool bHackIt, bDone;
local string msg;
local Vector X, Y, Z;
local float dotp;


P = Pawn(Frobber);
Player = DeusExPlayer(P);
bHackIt = False;
bDone = False;
msg = msgNotHacked;

// make sure someone is trying to hack the device
if (P == None)
return;

// Let any non-player pawn hack the device for now
if (Player == None)
{
bHackIt = True;
msg = "";
bDone = True;
}

// If we are already trying to hack it, print a message
if (bHacking)
{
msg = msgHacking;
bDone = True;
}

if (!bDone)
{
// Get what's in the player's hand
if (frobWith != None)
{
// check for the use of multitools
if (bHackable && frobWith.IsA('Multitool') && (Player.SkillSystem != None))
{
if (hackStrength > 0.0)
{
// alert NPCs that I'm messing with stuff
AIStartEvent('MegaFutz', EAITYPE_Visual);

hackValue = Player.SkillSystem.GetSkillLevelValue(class'SkillTech');
hackPlayer = Player;
curTool = Multitool(frobWith);
curTool.bBeingUsed = True;
curTool.PlayUseAnim();
bHacking = True;
//Number of percentage points to remove
numHacks = hackValue * 100;
if (Level.Netmode != NM_Standalone)
hackTime = default.hackTime / (hackValue * hackValue);
TicksPerHack = (hackTime * 10.0) / numHacks;
LastTickTime = Level.TimeSeconds;
TicksSinceLastHack = 0;
SetTimer(0.1, True);
msg = msgHacking;
}
else
{
bHackIt = True;
msg = msgAlreadyHacked;
}
}
}
else if (hackStrength == 0.0)
{
// if it's open
bHackIt = True;
msg = "";
}
}

// give the player a message
if ((Player != None) && (msg != ""))
Player.ClientMessage(msg);

// if our hands are empty, call HackAction()
if ((Player != None) && (frobWith == None))
HackAction(Frobber, (hackStrength == 0.0));

// trigger the device!
if (bHackIt)
Super.Frob(Frobber, frobWith);

HackAction (Actor Hacker, bool bHacked)


local Actor A;
local int i;


if (bHacked)
{
for (i=0; i if (UnTriggerEvent[i] != '')
foreach AllActors(class'Actor', A, UnTriggerEvent[i])
A.UnTrigger(Hacker, Pawn(Hacker));
}

PostBeginPlay


Super.PostBeginPlay();

// keep this within limits
hackStrength = FClamp(hackStrength, 0.0, 1.0);

if (!bHackable)
hackStrength = 1.0;

initialhackStrength = hackStrength;
TimeSinceReset = 0.0;

StopHacking


// alert NPCs that I'm not messing with stuff anymore
AIEndEvent('MegaFutz', EAITYPE_Visual);
bHacking = False;
if (curTool != None)
{
curTool.StopUseAnim();
curTool.bBeingUsed = False;
curTool.UseOnce();
}
curTool = None;
SetTimer(0.1, False);

Tick (float deltaTime)


TimeSinceReset = TimeSinceReset + deltaTime;
//only reset in multiplayer, if we aren't hacking it, and if it has been completely hacked.
if ((!bHacking) && (Level.NetMode != NM_Standalone) && (hackStrength == 0.0))
{
if (TimeSinceReset > TimeToReset)
{
hackStrength = initialHackStrength;
TimeSinceReset = 0.0;
}
}
Super.Tick(deltaTime);

Timer


if (bHacking)
{
curTool.PlayUseAnim();

TicksSinceLastHack += (Level.TimeSeconds - LastTickTime) * 10;
LastTickTime = Level.TimeSeconds;
//TicksSinceLastHack = TicksSinceLastHack + 1;
while (TicksSinceLastHack > TicksPerHack)
{
numHacks--;
hackStrength -= 0.01;
TicksSinceLastHack = TicksSinceLastHack - TicksPerHack;
hackStrength = FClamp(hackStrength, 0.0, 1.0);
}

// did we hack it?
if (hackStrength ~= 0.0)
{
hackStrength = 0.0;
hackPlayer.ClientMessage(msgMultitoolSuccess);
// Start reset counter from the time you finish hacking it.
TimeSinceReset = 0;
StopHacking();
HackAction(hackPlayer, True);
}

// are we done with this tool?
else if (numHacks <= 0)
StopHacking();

// check to see if we've moved too far away from the device to continue
else if (hackPlayer.frobTarget != Self)
StopHacking();

// check to see if we've put the multitool away
else if (hackPlayer.inHand != curTool)
StopHacking();
}




HalonGas.uc (extends Cloud)

DamageType=HalonGas
maxDrawScale=2.000000
Damage=0.000000
Texture=FireTexture'Effects.Smoke.SmokePuff1'



HangingChicken.uc (extends HangingDecoration)

HitPoints=30
FragType=Class'DeusEx.FleshFragment'
ItemName="Slaughtered Chicken"
Mesh=LodMesh'DeusExDeco.HangingChicken'
PrePivot=(Z=31.680000)
CollisionRadius=15.000000
CollisionHeight=31.680000
Mass=60.000000
Buoyancy=5.000000

SpawnBlood (Vector HitLocation, float Damage)


local int i;


spawn(class'BloodSpurt',,,HitLocation);
spawn(class'BloodDrop',,,HitLocation);
for (i=0; i spawn(class'BloodDrop',,,HitLocation);

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);
if ((DamageType == 'Shot') || (DamageType == 'Exploded'))
SpawnBlood(HitLocation, Damage);




HangingDecoration.uc (extends DeusExDecoration)

var() bool bFixedSwaying;
var() Rotator FixedSwayDirection;
var() float FixedSwayPeriod;
var() bool bRandomize;
var() bool bNoPitch;
var() bool bNoRoll;
var float FixedSwayTimer;
var Rotator sway;
var bool bSwaying;
var float swayDamping;
var float swayPeriod;
var float swayTimer;
var Rotator wind;
var Rotator originalWind;
var float windPeriod;
var float windTimer;
var Rotator origRot;
bHighlight=False
bPushable=False
Physics=PHYS_Rotating
bCollideWorld=False
bFixedRotationDir=True

BeginPlay


Super.BeginPlay();

origRot = Rotation;

if (bRandomize)
Timer();

Bump (actor Other)


Super.Bump(Other);

CalculateHit(Other.Location, Other.Velocity);
bSwaying = True;
if (!bSwaying)
swayTimer = 0;

CalculateHit (vector Loc, vector Vel)


local Rotator rot, newsway;
local float ang;


rot = Rotator(Loc - Location);
ang = 2 * Pi * (rot.Yaw / 65536.0);
newsway.Pitch = -Cos(ang) * VSize(Vel) * 10;
newsway.Roll = Sin(ang) * VSize(Vel) * 10;
newsway.Yaw = 0;

// scale them down to acceptable limits
while (abs(newsway.Pitch) > 8192)
{
newsway.Pitch /= 2;
newsway.Roll /= 2;
};
while (abs(newsway.Roll) > 8192)
{
newsway.Pitch /= 2;
newsway.Roll /= 2;
};

// don't use the new values unless they are larger than the old values
if ((newsway.Pitch > sway.Pitch) && (sway.Pitch >= 0))
sway.Pitch = newsway.Pitch;
else if ((newsway.Pitch < sway.Pitch) && (sway.Pitch <= 0))
sway.Pitch = newsway.Pitch;
if ((newsway.Roll > sway.Roll) && (sway.Roll >= 0))
sway.Roll = newsway.Roll;
else if ((newsway.Roll < sway.Roll) && (sway.Roll <= 0))
sway.Roll = newsway.Roll;
swayDamping = 1.0;
swayPeriod = 2.0;

if (bNoPitch)
sway.Pitch = 0;
if (bNoRoll)
sway.Roll = 0;

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);
if ((DamageType == 'Shot') || (DamageType == 'Exploded'))
{
CalculateHit(HitLocation, Momentum);
bSwaying = True;
}

if (!bSwaying)
swayTimer = 0;

Tick (float deltaTime)


local Rotator rot;
local float ang;


Super.Tick(deltaTime);

rot = origRot;

if (bFixedSwaying || bRandomize)
{
UpdateWind();
windTimer += deltaTime;

ang = 2 * Pi * FixedSwayTimer / FixedSwayPeriod;
rot += wind + FixedSwayDirection * Sin(ang);
FixedSwayTimer += deltaTime;
if (FixedSwayTimer > FixedSwayPeriod)
FixedSwayTimer -= FixedSwayPeriod;
}
if (bSwaying)
{
ang = 2 * Pi * swayTimer / swayPeriod;
rot += sway * Sin(ang) * swayDamping;
swayDamping *= 0.995;
if (swayDamping < 0.001)
{
bSwaying = False;
sway = rot(0,0,0);
}
swayTimer += deltaTime;
if (swayTimer > swayPeriod)
swayTimer -= swayPeriod;
}

SetRotation(rot);

Timer


originalWind.Pitch = 4096 - FRand() * 8192;
originalWind.Yaw = 4096 - FRand() * 8192;
originalWind.Roll = 4096 - FRand() * 8192;
windTimer = 0;
windPeriod = FRand() * 4 + 2;
SetTimer(windPeriod, False);

UpdateWind


if (windTimer < windPeriod/2)
{
wind.Pitch = Smerp(windTimer / windPeriod, 0, originalWind.Pitch);
wind.Yaw = Smerp(windTimer / windPeriod, 0, originalWind.Yaw);
wind.Roll = Smerp(windTimer / windPeriod, 0, originalWind.Roll);
}
else
{
wind.Pitch = Smerp(windTimer / windPeriod, originalWind.Pitch, 0);
wind.Yaw = Smerp(windTimer / windPeriod, originalWind.Yaw, 0);
wind.Roll = Smerp(windTimer / windPeriod, originalWind.Roll, 0);
}




HangingShopLight.uc (extends HangingDecoration)

bNoPitch=True
bInvincible=True
FragType=Class'DeusEx.GlassFragment'
ItemName="Flourescent Light"
Mesh=LodMesh'DeusExDeco.HangingShopLight'
PrePivot=(Z=39.450001)
CollisionRadius=42.500000
CollisionHeight=39.450001
Mass=30.000000
Buoyancy=25.000000



HarleyFilben.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.HarleyFilbenCarcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.HarleyFilbenTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.HarleyFilbenTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex7'
MultiSkins(3)=Texture'DeusExCharacters.Skins.HarleyFilbenTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.HarleyFilbenTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="HarleyFilben"
FamiliarName="Harley Filben"
UnfamiliarName="Bum"



HarleyFilbenCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.HarleyFilbenTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.HarleyFilbenTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex7'
MultiSkins(3)=Texture'DeusExCharacters.Skins.HarleyFilbenTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.HarleyFilbenTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



HazMatSuit.uc (extends ChargedPickup)

skillNeeded=Class'DeusEx.SkillEnviro'
LoopSound=Sound'DeusExSounds.Pickup.SuitLoop'
ChargedIcon=Texture'DeusExUI.Icons.ChargedIconHazMatSuit'
ExpireMessage="HazMatSuit power supply used up"
ItemName="Hazmat Suit"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.HazMatSuit'
PickupViewMesh=LodMesh'DeusExItems.HazMatSuit'
ThirdPersonMesh=LodMesh'DeusExItems.HazMatSuit'
LandSound=Sound'DeusExSounds.Generic.PaperHit2'
Icon=Texture'DeusExUI.Icons.BeltIconHazMatSuit'
largeIcon=Texture'DeusExUI.Icons.LargeIconHazMatSuit'
largeIconWidth=46
largeIconHeight=45
Description="A standard hazardous materials suit that protects against a full range of environmental hazards including radiation, fire, biochemical toxins, electricity, and EMP. Hazmat suits contain an integrated bacterial oxygen scrubber that degrades over time and thus should not be reused."
beltDescription="HAZMAT"
Texture=Texture'DeusExItems.Skins.ReflectionMapTex1'
Mesh=LodMesh'DeusExItems.HazMatSuit'
CollisionRadius=17.000000
CollisionHeight=11.520000
Mass=20.000000
Buoyancy=12.000000



HidePoint.uc (extends NavigationPoint)

var vector faceDirection;
bDirectional=True

PreBeginPlay


Super.PreBeginPlay();

faceDirection = 200 * vector(Rotation);




Highlight.uc (extends Light)

bStatic=False
bNoDelete=False
bMovable=True
LightEffect=LE_NonIncidence
LightBrightness=255
LightRadius=1



HongKongDecoration.uc (extends DeusExDecoration)

bHighlight=False



Hooker1.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Hooker1Carcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_Dress'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Hooker1Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Hooker1Tex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Hooker1Tex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Hooker1Tex3'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Hooker1Tex2'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.Hooker1Tex0'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Hooker"
FamiliarName="Hooker"
UnfamiliarName="Hooker"



Hooker1Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_Dress_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_Dress_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_Dress_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Hooker1Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Hooker1Tex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Hooker1Tex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Hooker1Tex3'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Hooker1Tex2'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.Hooker1Tex0'



Hooker2.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Hooker2Carcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_Dress'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Hooker2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Hooker2Tex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Hooker2Tex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Hooker2Tex3'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Hooker2Tex2'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.Hooker2Tex0'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Hooker"
FamiliarName="Hooker"
UnfamiliarName="Hooker"



Hooker2Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_Dress_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_Dress_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_Dress_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Hooker2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Hooker2Tex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Hooker2Tex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Hooker2Tex3'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Hooker2Tex2'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.Hooker2Tex0'



HowardStrong.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.HowardStrongCarcass'
WalkingSpeed=0.296000
bImportant=True
walkAnimMult=0.750000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.HowardStrongTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.HowardStrongTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.HowardStrongTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.HowardStrongTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="HowardStrong"
FamiliarName="Howard Strong"
UnfamiliarName="Howard Strong"



HowardStrongCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.HowardStrongTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.HowardStrongTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.HowardStrongTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.HowardStrongTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'



Human.uc (extends DeusExPlayer)

var float mpGroundSpeed;
var float mpWaterSpeed;
var float humanAnimRate;
mpGroundSpeed=230.000000
mpWaterSpeed=110.000000
humanAnimRate=1.000000
bIsHuman=True
WaterSpeed=300.000000
AirSpeed=4000.000000
AccelRate=1000.000000
JumpZ=300.000000
BaseEyeHeight=40.000000
UnderWaterTime=20.000000
CollisionRadius=20.000000
CollisionHeight=47.500000
Mass=150.000000
Buoyancy=155.000000
RotationRate=(Pitch=4096,Yaw=50000,Roll=3072)

Gasp


PlaySound(sound'MaleGasp', SLOT_Pain,,,, RandomPitch());

HasTwoHandedWeapon -> Bool


if ((Weapon != None) && (Weapon.Mass >= 30))
return True;
else
return False;

IsFiring -> Bool


if ((Weapon != None) && ( Weapon.IsInState('NormalFire') || Weapon.IsInState('ClientFiring') ) )
return True;
else
return False;

PlayCrawling


// ClientMessage("PlayCrawling()");
if (IsFiring())
LoopAnim('CrouchShoot');
else
LoopAnim('CrouchWalk');

PlayDuck


// ClientMessage("PlayDuck()");
if ((AnimSequence != 'Crouch') && (AnimSequence != 'CrouchWalk'))
{
if (IsFiring())
PlayAnim('CrouchShoot',,0.1);
else
PlayAnim('Crouch',,0.1);
}
else
TweenAnim('CrouchWalk', 0.1);

PlayDying (name damageType, vector hitLoc)


local Vector X, Y, Z;
local float dotp;


// ClientMessage("PlayDying()");
GetAxes(Rotation, X, Y, Z);
dotp = (Location - HitLoc) dot X;

if (Region.Zone.bWaterZone)
{
PlayAnim('WaterDeath',,0.1);
}
else
{
// die from the correct side
if (dotp < 0.0) // shot from the front, fall back
PlayAnim('DeathBack',,0.1);
else // shot from the back, fall front
PlayAnim('DeathFront',,0.1);
}

PlayDyingSound();

PlayDyingSound


if (Region.Zone.bWaterZone)
PlaySound(sound'MaleWaterDeath', SLOT_Pain,,,, RandomPitch());
else
PlaySound(sound'MaleDeath', SLOT_Pain,,,, RandomPitch());

PlayFiring


local DeusExWeapon W;


// ClientMessage("PlayFiring()");

W = DeusExWeapon(Weapon);

if (W != None)
{
if (IsInState('PlayerSwimming') || (Physics == PHYS_Swimming))
LoopAnim('TreadShoot',,0.1);
else if (W.bHandToHand)
{
if (bAnimFinished || (AnimSequence != 'Attack'))
PlayAnim('Attack',,0.1);
}
else if (bIsCrouching || IsLeaning())
LoopAnim('CrouchShoot',,0.1);
else
{
if (HasTwoHandedWeapon())
LoopAnim('Shoot2H',,0.1);
else
LoopAnim('Shoot',,0.1);
}
}

PlayInAir


// ClientMessage("PlayInAir()");
if (!bIsCrouching && (AnimSequence != 'Jump'))
PlayAnim('Jump',3.0,0.1);

PlayLanded (float impactVel)


// ClientMessage("PlayLanded()");
PlayFootStep();
if (!bIsCrouching)
PlayAnim('Land',3.0,0.1);

PlayRising


// ClientMessage("PlayRising()");
PlayAnim('Stand',,0.1);

PlayRunning


// ClientMessage("PlayRunning()");
if (IsFiring())
{
if (aStrafe != 0)
{
if (HasTwoHandedWeapon())
LoopAnim('Strafe2H', humanAnimRate);
else
LoopAnim('Strafe', humanAnimRate);
}
else
{
if (HasTwoHandedWeapon())
LoopAnim('RunShoot2H', humanAnimRate);
else
LoopAnim('RunShoot', humanAnimRate);
}
}
else if (bOnFire)
LoopAnim('Panic', humanAnimRate);
else
{
if (HasTwoHandedWeapon())
LoopAnim('RunShoot2H', humanAnimRate);
else
LoopAnim('Run', humanAnimRate);
}

PlaySwimming


// ClientMessage("PlaySwimming()");
LoopAnim('Tread');

PlayTakeHitSound (int Damage, name damageType, int Mult)


local float rnd;


if ( Level.TimeSeconds - LastPainSound < FRand() + 0.5)
return;

LastPainSound = Level.TimeSeconds;

if (Region.Zone.bWaterZone)
{
if (damageType == 'Drowned')
{
if (FRand() < 0.8)
PlaySound(sound'MaleDrown', SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0),,, RandomPitch());
}
else
PlaySound(sound'MalePainSmall', SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0),,, RandomPitch());
}
else
{
// Body hit sound for multiplayer only
if (((damageType=='Shot') || (damageType=='AutoShot')) && ( Level.NetMode != NM_Standalone ))
{
PlaySound(sound'BodyHit', SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0),,, RandomPitch());
}

if ((damageType == 'TearGas') || (damageType == 'HalonGas'))
PlaySound(sound'MaleEyePain', SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0),,, RandomPitch());
else if (damageType == 'PoisonGas')
PlaySound(sound'MaleCough', SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0),,, RandomPitch());
else
{
rnd = FRand();
if (rnd < 0.33)
PlaySound(sound'MalePainSmall', SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0),,, RandomPitch());
else if (rnd < 0.66)
PlaySound(sound'MalePainMedium', SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0),,, RandomPitch());
else
PlaySound(sound'MalePainLarge', SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0),,, RandomPitch());
}
AISendEvent('LoudNoise', EAITYPE_Audio, FMax(Mult * TransientSoundVolume, Mult * 2.0));
}

PlayTurning


// ClientMessage("PlayTurning()");
if (bForceDuck || bCrouchOn || IsLeaning())
TweenAnim('CrouchWalk', 0.1);
else
{
if (HasTwoHandedWeapon())
TweenAnim('Walk2H', 0.1);
else
TweenAnim('Walk', 0.1);
}

PlayWaiting


// ClientMessage("PlayWaiting()");
if (IsInState('PlayerSwimming') || (Physics == PHYS_Swimming))
{
if (IsFiring())
LoopAnim('TreadShoot');
else
LoopAnim('Tread');
}
else if (IsLeaning() || bForceDuck)
TweenAnim('CrouchWalk', 0.1);
else if (!IsFiring())
{
if (HasTwoHandedWeapon())
LoopAnim('BreatheLight2H');
else
LoopAnim('BreatheLight');
}


PlayWalking


local float newhumanAnimRate;


newhumanAnimRate = humanAnimRate;

// UnPhysic.cpp walk speed changed by proportion 0.7/0.3 (2.33), but that looks too goofy (fast as hell), so we'll try something a little slower
if ( Level.NetMode != NM_Standalone )
newhumanAnimRate = humanAnimRate * 1.75;

// ClientMessage("PlayWalking()");
if (bForceDuck || bCrouchOn)
LoopAnim('CrouchWalk', newhumanAnimRate);
else
{
if (HasTwoHandedWeapon())
LoopAnim('Walk2H', newhumanAnimRate);
else
LoopAnim('Walk', newhumanAnimRate);
}

PlayWeaponSwitch (Weapon newWeapon)


// ClientMessage("PlayWeaponSwitch()");
if (!bIsCrouching && !bForceDuck && !bCrouchOn && !IsLeaning())
PlayAnim('Reload');

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
GroundSpeed = mpGroundSpeed;
WaterSpeed = mpWaterSpeed;
humanAnimRate = (GroundSpeed/320.0);
}

RandomPitch -> float


return (1.1 - 0.2*FRand());

TweenToRunning (float tweentime)


// ClientMessage("TweenToRunning()");
if (bIsWalking)
{
TweenToWalking(0.1);
return;
}

if (IsFiring())
{
if (aStrafe != 0)
{
if (HasTwoHandedWeapon())
PlayAnim('Strafe2H',humanAnimRate, tweentime);
else
PlayAnim('Strafe',humanAnimRate, tweentime);
}
else
{
if (HasTwoHandedWeapon())
PlayAnim('RunShoot2H',humanAnimRate, tweentime);
else
PlayAnim('RunShoot',humanAnimRate, tweentime);
}
}
else if (bOnFire)
PlayAnim('Panic',humanAnimRate, tweentime);
else
{
if (HasTwoHandedWeapon())
PlayAnim('RunShoot2H',humanAnimRate, tweentime);
else
PlayAnim('Run',humanAnimRate, tweentime);
}

TweenToSwimming (float tweentime)


// ClientMessage("TweenToSwimming()");
TweenAnim('Tread', tweentime);

TweenToWaiting (float tweentime)


// ClientMessage("TweenToWaiting()");
if (IsInState('PlayerSwimming') || (Physics == PHYS_Swimming))
{
if (IsFiring())
LoopAnim('TreadShoot');
else
LoopAnim('Tread');
}
else if (IsLeaning() || bForceDuck)
TweenAnim('CrouchWalk', tweentime);
else if (((AnimSequence == 'Pickup') && bAnimFinished) || ((AnimSequence != 'Pickup') && !IsFiring()))
{
if (HasTwoHandedWeapon())
TweenAnim('BreatheLight2H', tweentime);
else
TweenAnim('BreatheLight', tweentime);
}

TweenToWalking (float tweentime)


// ClientMessage("TweenToWalking()");
if (bForceDuck || bCrouchOn)
TweenAnim('CrouchWalk', tweentime);
else
{
if (HasTwoHandedWeapon())
TweenAnim('Walk2H', tweentime);
else
TweenAnim('Walk', tweentime);
}

UpdateAnimRate (float augValue)


if ( Level.NetMode != NM_Standalone )
{
if ( augValue == -1.0 )
humanAnimRate = (Default.mpGroundSpeed/320.0);
else
humanAnimRate = (Default.mpGroundSpeed/320.0) * augValue * 0.85; // Scale back about 15% so were not too fast
}




HumanCivilian.uc (extends ScriptedPawn)

BaseAccuracy=1.200000
maxRange=400.000000
MinHealth=40.000000
bPlayIdle=True
bAvoidAim=False
bReactProjectiles=False
bFearShot=True
bFearIndirectInjury=True
bFearCarcass=True
bFearDistress=True
bFearAlarm=True
EnemyTimeout=1.500000
bCanTurnHead=True
bCanStrafe=False
WaterSpeed=80.000000
AirSpeed=160.000000
AccelRate=500.000000
BaseEyeHeight=40.000000
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
HitSound1=Sound'DeusExSounds.Player.MalePainSmall'
HitSound2=Sound'DeusExSounds.Player.MalePainMedium'
Die=Sound'DeusExSounds.Player.MaleDeath'
VisibilityThreshold=0.010000
DrawType=DT_Mesh
Mass=150.000000
Buoyancy=155.000000
BindName="HumanCivilian"

PostBeginPlay


Super.PostBeginPlay();

// Eventually, these will all be unique sounds per NPC specified in
// the defaultproperties

// change the sounds for chicks
if (bIsFemale)
{
HitSound1 = Sound'FemalePainMedium';
HitSound2 = Sound'FemalePainLarge';
Die = Sound'FemaleDeath';
}

// change the sounds for kids
if (IsA('ChildMale') || IsA('ChildMale2'))
{
HitSound1 = Sound'ChildPainMedium';
HitSound2 = Sound'ChildPainLarge';
Die = Sound'ChildDeath';
}

WillTakeStompDamage (actor stomper) -> bool


// This blows chunks!
if (stomper.IsA('PlayerPawn') && (GetPawnAllianceType(Pawn(stomper)) != ALLIANCE_Hostile))
return false;
else
return true;




HumanMilitary.uc (extends ScriptedPawn)

BaseAccuracy=0.200000
maxRange=1000.000000
MinHealth=20.000000
bPlayIdle=True
bCanCrouch=True
bSprint=True
CrouchRate=1.000000
SprintRate=1.000000
bReactAlarm=True
EnemyTimeout=5.000000
bCanTurnHead=True
WaterSpeed=80.000000
AirSpeed=160.000000
AccelRate=500.000000
BaseEyeHeight=40.000000
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
HitSound1=Sound'DeusExSounds.Player.MalePainSmall'
HitSound2=Sound'DeusExSounds.Player.MalePainMedium'
Die=Sound'DeusExSounds.Player.MaleDeath'
VisibilityThreshold=0.010000
DrawType=DT_Mesh
Mass=150.000000
Buoyancy=155.000000
BindName="HumanMilitary"

PostBeginPlay


Super.PostBeginPlay();

// change the sounds for chicks
if (bIsFemale)
{
HitSound1 = Sound'FemalePainMedium';
HitSound2 = Sound'FemalePainLarge';
Die = Sound'FemaleDeath';
}

WillTakeStompDamage (actor stomper) -> bool


// This blows chunks!
if (stomper.IsA('PlayerPawn') && (GetPawnAllianceType(Pawn(stomper)) != ALLIANCE_Hostile))
return false;
else
return true;




HumanThug.uc (extends ScriptedPawn)

BaseAccuracy=1.200000
maxRange=700.000000
bPlayIdle=True
bAvoidAim=False
bCanCrouch=True
bSprint=True
CrouchRate=0.200000
SprintRate=0.500000
bReactAlarm=True
EnemyTimeout=3.500000
bCanTurnHead=True
WaterSpeed=80.000000
AirSpeed=160.000000
AccelRate=500.000000
BaseEyeHeight=40.000000
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
HitSound1=Sound'DeusExSounds.Player.MalePainSmall'
HitSound2=Sound'DeusExSounds.Player.MalePainMedium'
Die=Sound'DeusExSounds.Player.MaleDeath'
VisibilityThreshold=0.010000
DrawType=DT_Mesh
Mass=150.000000
Buoyancy=155.000000
BindName="HumanThug"

PostBeginPlay


Super.PostBeginPlay();

// change the sounds for chicks
if (bIsFemale)
{
HitSound1 = Sound'FemalePainMedium';
HitSound2 = Sound'FemalePainLarge';
Die = Sound'FemaleDeath';
}

WillTakeStompDamage (actor stomper) -> bool


// This blows chunks!
if (stomper.IsA('PlayerPawn') && (GetPawnAllianceType(Pawn(stomper)) != ALLIANCE_Hostile))
return false;
else
return true;




Image01_GunFireSensor.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image01_GunFireSensor_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image01_GunFireSensor_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image01_GunFireSensor_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image01_GunFireSensor_4'
imageDescription="Gun Fire Sensor"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image01_LibertyIsland.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image01_LibertyIsland_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image01_LibertyIsland_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image01_LibertyIsland_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image01_LibertyIsland_4'
imageDescription="Liberty Island Satellite Photo"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image01_TerroristCommander.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image01_TerroristCommander_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image01_TerroristCommander_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image01_TerroristCommander_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image01_TerroristCommander_4'
imageDescription="Terrorist Commander"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image02_Ambrosia_Flyer.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image02_Ambrosia_Flyer_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image02_Ambrosia_Flyer_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image02_Ambrosia_Flyer_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image02_Ambrosia_Flyer_4'
imageDescription="Ambrosia Flyer"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image02_BobPage_ManOfYear.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image02_BobPage_ManOfYear_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image02_BobPage_ManOfYear_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image02_BobPage_ManOfYear_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image02_BobPage_ManOfYear_4'
imageDescription="Millenium Magazine"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image02_NYC_Warehouse.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image02_NYC_Warehouse_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image02_NYC_Warehouse_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image02_NYC_Warehouse_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image02_NYC_Warehouse_4'
imageDescription="NYC Warehouse"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image03_747Diagram.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image03_747Diagram_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image03_747Diagram_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image03_747Diagram_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image03_747Diagram_4'
imageDescription="747 Diagram"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image03_NYC_Airfield.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image03_NYC_Airfield_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image03_NYC_Airfield_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image03_NYC_Airfield_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image03_NYC_Airfield_4'
imageDescription="NYC Airfield"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image03_WaltonSimons.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image03_WaltonSimons_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image03_WaltonSimons_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image03_WaltonSimons_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image03_WaltonSimons_4'
imageDescription="Walton Simons"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image04_NSFHeadquarters.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image04_NSFHeadquarters_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image04_NSFHeadquarters_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image04_NSFHeadquarters_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image04_NSFHeadquarters_4'
imageDescription="NSF Headquarters"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image04_UNATCONotice.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image04_UNATCONotice_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image04_UNATCONotice_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image04_UNATCONotice_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image04_UNATCONotice_4'
imageDescription="UNATCO Notice"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image05_GreaselDisection.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image05_GreaselDisection_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image05_GreaselDisection_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image05_GreaselDisection_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image05_GreaselDisection_4'
imageDescription="Greasel Disection"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image05_NYC_MJ12Lab.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image05_NYC_MJ12Lab_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image05_NYC_MJ12Lab_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image05_NYC_MJ12Lab_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image05_NYC_MJ12Lab_4'
imageDescription="MJ12 Lab Facility"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image06_HK_MJ12Helipad.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image06_HK_MJ12Helipad_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image06_HK_MJ12Helipad_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image06_HK_MJ12Helipad_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image06_HK_MJ12Helipad_4'
imageDescription="MJ12 Helipad Facility"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image06_HK_MJ12Lab.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image06_HK_MJ12Lab_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image06_HK_MJ12Lab_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image06_HK_MJ12Lab_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image06_HK_MJ12Lab_4'
imageDescription="MJ12 Lab Facility"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image06_HK_Market.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image06_HK_Market_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image06_HK_Market_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image06_HK_Market_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image06_HK_Market_4'
imageDescription="Hong Kong Market"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image06_HK_Versalife.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image06_HK_Versalife_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image06_HK_Versalife_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image06_HK_Versalife_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image06_HK_Versalife_4'
imageDescription="Versalife Building"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image06_HK_WanChai.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image06_HK_WanChai_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image06_HK_WanChai_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image06_HK_WanChai_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image06_HK_WanChai_4'
imageDescription="Hong Kong, Wan Chai District"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image08_JoeGreenMIBMJ12.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image08_JoeGreenMIBMJ12_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image08_JoeGreenMIBMJ12_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image08_JoeGreenMIBMJ12_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image08_JoeGreenMIBMJ12_4'
imageDescription="Joe Greene MIB MJ12"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image09_NYC_Ship_Bottom.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image09_NYC_Ship_Bttm_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image09_NYC_Ship_Bttm_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image09_NYC_Ship_Bttm_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image09_NYC_Ship_Bttm_4'
imageDescription="PCRS Wall Cloud: Lower Decks"
sortKey=1
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image09_NYC_Ship_Top.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image09_NYC_Ship_Top_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image09_NYC_Ship_Top_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image09_NYC_Ship_Top_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image09_NYC_Ship_Top_4'
imageDescription="PCRS Wall Cloud: Upper Decks"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image10_Paris_Catacombs.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image10_Paris_Catacombs_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image10_Paris_Catacombs_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image10_Paris_Catacombs_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image10_Paris_Catacombs_4'
imageDescription="Paris Catacombs"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image10_Paris_CatacombsTunnels.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image10_Paris_CatacombsTunnels_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image10_Paris_CatacombsTunnels_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image10_Paris_CatacombsTunnels_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image10_Paris_CatacombsTunnels_4'
imageDescription="Paris Catacombs - Tunnels"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image10_Paris_Metro.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image10_Paris_Metro_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image10_Paris_Metro_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image10_Paris_Metro_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image10_Paris_Metro_4'
imageDescription="Paris Metro Map"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image11_Paris_Cathedral.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image11_Paris_Cathedral_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image11_Paris_Cathedral_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image11_Paris_Cathedral_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image11_Paris_Cathedral_4'
imageDescription="Paris Cathedral"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image11_Paris_CathedralEntrance.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image11_Paris_CathedralEntrance_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image11_Paris_CathedralEntrance_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image11_Paris_CathedralEntrance_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image11_Paris_CathedralEntrance_4'
imageDescription="Cathedral Entrance"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image12_Tiffany_HostagePic.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image12_Tiffany_HostagePic_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image12_Tiffany_HostagePic_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image12_Tiffany_HostagePic_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image12_Tiffany_HostagePic_4'
imageDescription="Tiffany Hostage Picture"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image12_Vandenberg_Command.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image12_Vandenberg_Command_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image12_Vandenberg_Command_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image12_Vandenberg_Command_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image12_Vandenberg_Command_4'
imageDescription="Vandenberg Command Complex"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image12_Vandenberg_Sub.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image12_Vandenberg_Sub_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image12_Vandenberg_Sub_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image12_Vandenberg_Sub_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image12_Vandenberg_Sub_4'
imageDescription="Vandenberg Sub"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image14_OceanLab.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image14_OceanLab_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image14_OceanLab_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image14_OceanLab_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image14_OceanLab_4'
imageDescription="Ocean Lab"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image14_Schematic.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image14_Schematic_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image14_Schematic_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image14_Schematic_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image14_Schematic_4'
imageDescription="Universal Constructor Component"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image15_Area51Bunker.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image15_Area51Bunker_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image15_Area51Bunker_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image15_Area51Bunker_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image15_Area51Bunker_4'
imageDescription="Area 51 Bunker"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image15_Area51_Sector3.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image15_Area51_Sector3_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image15_Area51_Sector3_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image15_Area51_Sector3_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image15_Area51_Sector3_4'
imageDescription="Area 51 Sector 3"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image15_Area51_Sector4.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image15_Area51_Sector4_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image15_Area51_Sector4_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image15_Area51_Sector4_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image15_Area51_Sector4_4'
imageDescription="Area 51 Sector 4"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image15_BlueFusionDevice.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image15_BlueFusionDevice_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image15_BlueFusionDevice_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image15_BlueFusionDevice_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image15_BlueFusionDevice_4'
imageDescription="Blue Fusion Device"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



Image15_GrayDisection.uc (extends DataVaultImage)

imageTextures(0)=Texture'DeusExUI.UserInterface.Image15_GrayDisection_1'
imageTextures(1)=Texture'DeusExUI.UserInterface.Image15_GrayDisection_2'
imageTextures(2)=Texture'DeusExUI.UserInterface.Image15_GrayDisection_3'
imageTextures(3)=Texture'DeusExUI.UserInterface.Image15_GrayDisection_4'
imageDescription="Gray Disection"
colNoteTextNormal=(R=50,G=50)
colNoteTextFocus=(R=0,G=0)
colNoteBackground=(R=32,G=32)



InformationDevices.uc (extends DeusExDecoration)

var() name textTag;
var() string TextPackage;
var() class imageClass;
var transient HUDInformationDisplay infoWindow; // Window to display the information in
var transient TextWindow winText; // Last text window we added
var Bool bSetText;
var Bool bAddToVault; // True if we need to add this text to the DataVault
var String vaultString;
var DeusExPlayer aReader; // who is reading this?
var localized String msgNoText;
var Bool bFirstParagraph;
var localized String ImageLabel;
var localized String AddedToDatavaultLabel;
TextPackage="DeusExText"
msgNoText="There's nothing interesting to read"
ImageLabel="[Image: %s]"
AddedToDatavaultLabel="Image %s added to DataVault"
FragType=Class'DeusEx.PaperFragment'
bPushable=False

CreateInfoWindow


local DeusExTextParser parser;
local DeusExRootWindow rootWindow;
local DeusExNote note;
local DataVaultImage image;
local bool bImageAdded;


rootWindow = DeusExRootWindow(aReader.rootWindow);

// First check to see if we have a name
if ( textTag != '' )
{
// Create the text parser
parser = new(None) Class'DeusExTextParser';

// Attempt to find the text object
if ((aReader != None) && (parser.OpenText(textTag,TextPackage)))
{
parser.SetPlayerName(aReader.TruePlayerName);

infoWindow = rootWindow.hud.ShowInfoWindow();
infoWindow.ClearTextWindows();

vaultString = "";
bFirstParagraph = True;

while(parser.ProcessText())
ProcessTag(parser);

parser.CloseText();

// Check to see if we need to save this string in the
// DataVault
if (bAddToVault)
{
note = aReader.GetNote(textTag);

if (note == None)
{
note = aReader.AddNote(vaultString,, True);
note.SetTextTag(textTag);
}

vaultString = "";
}
}
CriticalDelete(parser);
}

// do we have any image data to give the player?
if ((imageClass != None) && (aReader != None))
{
image = Spawn(imageClass, aReader);
if (image != None)
{
image.GiveTo(aReader);
image.SetBase(aReader);
bImageAdded = aReader.AddImage(image);

// Display a note to the effect that there's an image here,
// but only if nothing else was displayed
if (infoWindow == None)
{
infoWindow = rootWindow.hud.ShowInfoWindow();
winText = infoWindow.AddTextWindow();
winText.SetText(Sprintf(ImageLabel, image.imageDescription));
}

// Log the fact that the user just got an image.
if (bImageAdded)
{
aReader.ClientMessage(Sprintf(AddedToDatavaultLabel, image.imageDescription));
}
}
}

DestroyWindow


// restore the crosshairs and the other hud elements
if (aReader != None)
{
DeusExRootWindow(aReader.rootWindow).hud.cross.SetCrosshair(aReader.bCrosshairVisible);
DeusExRootWindow(aReader.rootWindow).hud.frobDisplay.Show();
}

if (infoWindow != None)
{
infoWindow.ClearTextWindows();
infoWindow.Hide();
}

infoWindow = None;
winText = None;
aReader = None;

Destroyed


DestroyWindow();

Super.Destroyed();

Frob (Actor Frobber, Inventory frobWith)


local DeusExPlayer player;


Super.Frob(Frobber, frobWith);

player = DeusExPlayer(Frobber);

if (player != None)
{
if (infoWindow == None)
{
aReader = player;
CreateInfoWindow();

// hide the crosshairs if there's text to read, otherwise display a message
if (infoWindow != None)
{
DeusExRootWindow(player.rootWindow).hud.cross.SetCrosshair(False);
DeusExRootWindow(player.rootWindow).hud.frobDisplay.Hide();
}
else
player.ClientMessage(msgNoText);
}
else
{
DestroyWindow();
}
}

ProcessTag (DeusExTextParser parser)


local String text;
local byte tag;
local Name fontName;
local String textPart;

// local EDeusExTextTags tag;

tag = parser.GetTag();

// Make sure we have a text window to operate on.
if (winText == None)
{
winText = infoWindow.AddTextWindow();
bSetText = True;
}

switch(tag)
{
// If a winText window doesn't yet exist, create one.
// Then add the text
case 0: // TT_Text:
case 9: // TT_PlayerName:
case 10: // TT_PlayerFirstName:
text = parser.GetText();

// Add the text
if (bSetText)
winText.SetText(text);
else
winText.AppendText(text);

vaultString = vaultString $ text;
bSetText = False;
break;

// Create a new text window
case 18: // TT_NewParagraph:
// Create a new text window
winText = infoWindow.AddTextWindow();

// Only add a return if this is not the *first*
// paragraph.
if (!bFirstParagraph)
vaultString = vaultString $ winText.CR();

bFirstParagraph = False;

bSetText = True;
break;

case 13: // TT_LeftJustify:
winText.SetTextAlignments(HALIGN_Left, VALIGN_Center);
break;

case 14: // TT_RightJustify:
winText.SetTextAlignments(HALIGN_Right, VALIGN_Center);
break;

case 12: // TT_CenterText:
winText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
break;

case 26: // TT_Font:
// fontName = parser.GetName();
// winText.SetFont(fontName);
break;

case 15: // TT_DefaultColor:
case 16: // TT_TextColor:
case 17: // TT_RevertColor:
winText.SetTextColor(parser.GetColor());
break;
}

Tick (float deltaTime)


// if the reader strays too far from the object, kill the text window
if ((aReader != None) && (infoWindow != None))
if (aReader.FrobTarget != Self)
DestroyWindow();




InterpolateTrigger.uc (extends Trigger)

bTriggerOnceOnly=True
CollisionRadius=96.000000

SendActorOnPath -> bool


local InterpolationPoint I;
local Actor A;


// find the target actors to start on the path
foreach AllActors (class'Actor', A, Event)
if ((A != None) && !A.IsA('InterpolationPoint'))
{
foreach AllActors (class'InterpolationPoint', I, A.Event)
{
if (I.Position == 1) // start at 1 instead of 0 - put 0 at the object's initial position
{
A.SetCollision(False, False, False);
A.bCollideWorld = False;
A.Target = I;
A.SetPhysics(PHYS_Interpolating);
A.PhysRate = 1.0;
A.PhysAlpha = 0.0;
A.bInterpolating = True;
A.bStasis = False;
A.GotoState('Interpolating');
break;
}
}
}

return True;

Touch (Actor Other)


if (!IsRelevant(Other))
return;

if (SendActorOnPath())
if (bTriggerOnceOnly)
Destroy();

Trigger (Actor Other, Pawn Instigator)


if (SendActorOnPath())
{
Super.Trigger(Other, Instigator);
if (bTriggerOnceOnly)
Destroy();
}




InvokeConWindow.uc (extends ToolWindow)

var ToolListWindow lstActors;
var ToolListWindow lstCons;
var ToolListWindow lstFlags;
var ToolButtonWindow btnOK;
var ToolButtonWindow btnCancel;
var ToolButtonwindow btnSetFlags;
var ToolButtonwindow btnEditFlags;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnSetFlags:
SetFlags();
break;

case btnEditFlags:
root.PushWindow(Class'FlagEditWindow');
break;

case btnOK:
root.PopWindow();
break;

case btnCancel:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

return bHandled;

CreateControls (Window winParent)


// List Box Headers
CreateToolLabel(18, 30, "Actors");
CreateToolLabel(195, 30, "Conversations");
CreateToolLabel(18, 255, "Required Flags");

// Create Listboxes
lstActors = CreateToolList( 15, 45, 165, 200);
lstCons = CreateToolList(192, 45, 165, 200);
lstFlags = CreateToolList( 15, 268, 165, 80);

// Buttons
btnSetFlags = CreateToolButton(195, 268, "|&Set Flags");
btnEditFlags = CreateToolButton(195, 298, "|&Edit Flags");
btnOK = CreateToolButton(282, 268, "|&OK");
btnCancel = CreateToolButton(282, 298, "|&Cancel");

EnableButtons


btnSetFlags.SetSensitivity( lstFlags.GetNumRows() > 0 );

InitWindow


Super.InitWindow();

// Center this window
SetSize(375, 364);

// Create the controls
SetTitle("Invoke Conversation");
CreateControls(winContainer);
PopulateActorsList();
EnableButtons();

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


local Object listObject;


listObject = ListWindow(list).GetRowClientObject(focusRowId);

if ( list == lstActors )
PopulateConsList(Actor(listObject));
else if ( list == lstCons )
PopulateFlagsList(Conversation(listObject));

EnableButtons();

return True;

PopulateActorsList


local int rowIndex;
local Conversation conObject;
local Actor anActor;


// For now, we're only interested in boolean flags
lstActors.DeleteAllRows();

// Loop through the conversations and add actors to
// the appropriate list window
foreach player.AllActors(class'Actor', anActor)
{
// Check to see if there's any conversations
if ( anActor.conListItems != None )
{
rowIndex = lstActors.AddRow(anActor.BindName);
lstActors.SetRowClientObject(rowIndex, anActor);
}
}

// Sort the flags by name
lstActors.SetSortColumn(1);
lstActors.Sort();

PopulateConsList (Actor anActor)


local int rowIndex;
local ConListItem conListItem;


// For now, we're only interested in boolean flags
lstCons.DeleteAllRows();

conListItem = ConListItem(anActor.conListItems);

// List through conversations for this actor, adding
// them to the list
while( conListItem != None )
{
rowIndex = lstCons.AddRow(conListItem.con.conName);
lstActors.SetRowClientObject(rowIndex, conListItem.con);

conListItem = conListItem.next;
}

// Sort the conversations by name
lstActors.SetSortColumn(1);
lstActors.Sort();

PopulateFlagsList (Conversation con)


local int rowIndex;
local ConFlagRef flagRef;


lstFlags.DeleteAllRows();

if ( con != None )
{
flagRef = con.flagRefList;

while ( flagRef != None )
{
rowIndex = lstFlags.AddRow( flagRef.flagName );
flagRef = flagRef.nextFlagRef;
}
}
EnableButtons();

SetFlags


local Conversation con;
local ConFlagRef flagRef;


if (( lstCons.GetNumRows() == 0 ) || ( lstCons.GetSelectedRow() == 0 ) )
return;

con = Conversation(lstCons.GetRowClientObject(lstCons.GetSelectedRow()));

// Now loop through the flags
flagRef = con.flagRefList;

while ( flagRef != None )
{
player.flagBase.SetBool(flagRef.flagName, flagRef.value);
flagRef = flagRef.nextFlagRef;
}




InvulnSphere.uc (extends SphereEffect)

var DeusExPlayer AttachedPlayer;
LifeSpan=6.000000

Tick (float deltaTime)


local DeusExPlayer myPlayer;


if (AttachedPlayer == None)
{
Destroy();
return;
}
SetLocation(AttachedPlayer.Location);
DrawScale = size * 1.25;

myPlayer = DeusExPlayer(GetPlayerPawn());
if (myPlayer == AttachedPlayer)
ScaleGlow = FClamp( 0.33 * (LifeSpan / AttachedPlayer.NintendoDelay), 0.0, 0.33);
else
ScaleGlow = 2.0 * (LifeSpan / AttachedPlayer.NintendoDelay);




IonStormLogo.uc (extends OutdoorThings)

Mesh=Mesh'DeusExDeco.IonStormLogo'
DrawScale=6.000000
CollisionRadius=66.239998
CollisionHeight=60.000000
bCollideActors=False
bCollideWorld=False
bBlockActors=False
bBlockPlayers=False
Mass=5000.000000
Buoyancy=500.000000



JCDentonMale.uc (extends Human)

CarcassType=Class'DeusEx.JCDentonMaleCarcass'
JumpSound=Sound'DeusExSounds.Player.MaleJump'
HitSound1=Sound'DeusExSounds.Player.MalePainSmall'
HitSound2=Sound'DeusExSounds.Player.MalePainMedium'
Land=Sound'DeusExSounds.Player.MaleLand'
Die=Sound'DeusExSounds.Player.MaleDeath'
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JCDentonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JCDentonTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JCDentonTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JCDentonTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JCDentonTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JCDentonTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex4'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex5'

TravelPostAccept


local DeusExLevelInfo info;


Super.TravelPostAccept();

switch(PlayerSkin)
{
case 0: MultiSkins[0] = Texture'JCDentonTex0'; break;
case 1: MultiSkins[0] = Texture'JCDentonTex4'; break;
case 2: MultiSkins[0] = Texture'JCDentonTex5'; break;
case 3: MultiSkins[0] = Texture'JCDentonTex6'; break;
case 4: MultiSkins[0] = Texture'JCDentonTex7'; break;
}




JCDentonMaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JCDentonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JCDentonTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JCDentonTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JCDentonTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JCDentonTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JCDentonTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex4'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex5'
CollisionRadius=40.000000

PostPostBeginPlay


local DeusExPlayer player;


Super.PostPostBeginPlay();

foreach AllActors(class'DeusExPlayer', player)
break;

SetSkin(player);

SetSkin (DeusExPlayer player)


if (player != None)
{
switch(player.PlayerSkin)
{
case 0: MultiSkins[0] = Texture'JCDentonTex0'; break;
case 1: MultiSkins[0] = Texture'JCDentonTex4'; break;
case 2: MultiSkins[0] = Texture'JCDentonTex5'; break;
case 3: MultiSkins[0] = Texture'JCDentonTex6'; break;
case 4: MultiSkins[0] = Texture'JCDentonTex7'; break;
}
}




JCDouble.uc (extends HumanMilitary)

WalkingSpeed=0.120000
bInvincible=True
BaseAssHeight=-23.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JCDentonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JCDentonTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JCDentonTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JCDentonTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JCDentonTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JCDentonTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex4'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex5'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="JCDouble"
FamiliarName="JC Denton"
UnfamiliarName="JC Denton"

AddVelocity (vector NewVelocity)

ImpartMomentum (Vector momentum, Pawn instigatedBy)


// to ensure JC's understudy doesn't get impact momentum from damage...

SetSkin (DeusExPlayer player)


if (player != None)
{
switch(player.PlayerSkin)
{
case 0: MultiSkins[0] = Texture'JCDentonTex0'; break;
case 1: MultiSkins[0] = Texture'JCDentonTex4'; break;
case 2: MultiSkins[0] = Texture'JCDentonTex5'; break;
case 3: MultiSkins[0] = Texture'JCDentonTex6'; break;
case 4: MultiSkins[0] = Texture'JCDentonTex7'; break;
}
}




JaimeReyes.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.JaimeReyesCarcass'
WalkingSpeed=0.240000
bImportant=True
bInvincible=True
walkAnimMult=0.850000
GroundSpeed=160.000000
BaseEyeHeight=36.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench_F'
DrawScale=0.900000
MultiSkins(0)=Texture'DeusExCharacters.Skins.JaimeReyesTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JaimeReyesTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JaimeReyesTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=42.799999
BindName="JaimeReyes"
FamiliarName="Jaime Reyes"
UnfamiliarName="Jaime Reyes"



JaimeReyesCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_F_Carcass'
DrawScale=0.900000
MultiSkins(0)=Texture'DeusExCharacters.Skins.JaimeReyesTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JaimeReyesTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JaimeReyesTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



Janitor.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.JanitorCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.780000
GroundSpeed=200.000000
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex3'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JanitorTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JanitorTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SkinTex3'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Janitor"
FamiliarName="Janitor"
UnfamiliarName="Janitor"



JanitorCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex3'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JanitorTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JanitorTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SkinTex3'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



JoJoFine.uc (extends HumanThug)

CarcassType=Class'DeusEx.JoJoFineCarcass'
WalkingSpeed=0.296000
bImportant=True
SprintRate=1.000000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponStealthPistol')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo10mm',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCrowbar')
walkAnimMult=0.750000
GroundSpeed=200.000000
HealthHead=150
Mesh=LodMesh'DeusExCharacters.GM_DressShirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JoJoFineTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JoJoFineTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JoJoFineTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JoJoFineTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="JoJoFine"
FamiliarName="JoJo Fine"
UnfamiliarName="JoJo Fine"



JoJoFineCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JoJoFineTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JoJoFineTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JoJoFineTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JoJoFineTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Jock.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.JockCarcass'
WalkingSpeed=0.296000
bImportant=True
bInvincible=True
BaseAssHeight=-23.000000
walkAnimMult=1.050000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JockTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JockTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JockTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JockTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JockTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex3'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Jock"
FamiliarName="Jock"
UnfamiliarName="Jock"



JockCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JockTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JockTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JockTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JockTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JockTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex3'
CollisionRadius=40.000000



JoeGreene.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.JoeGreeneCarcass'
WalkingSpeed=0.296000
bImportant=True
walkAnimMult=0.750000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JoeGreeneTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JoeGreeneTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JoeGreeneTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="JoeGreene"
FamiliarName="Joe Greene"
UnfamiliarName="Joe Greene"



JoeGreeneCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JoeGreeneTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JoeGreeneTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JoeGreeneTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



JordanShea.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.JordanSheaCarcass'
WalkingSpeed=0.296000
bImportant=True
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponSawedOffShotgun')
InitialInventory(1)=(Inventory=Class'DeusEx.AmmoShell',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCombatKnife')
walkAnimMult=1.000000
bIsFemale=True
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JordanSheaTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JordanSheaTex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JordanSheaTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(7)=Texture'DeusExCharacters.Skins.JordanSheaTex1'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="JordanShea"
FamiliarName="Jordan Shea"
UnfamiliarName="Jordan Shea"



JordanSheaCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JordanSheaTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JordanSheaTex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JordanSheaTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(7)=Texture'DeusExCharacters.Skins.JordanSheaTex1'



JosephManderley.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.JosephManderleyCarcass'
WalkingSpeed=0.213333
bImportant=True
BaseAssHeight=-23.000000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponPistol')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo10mm',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCombatKnife')
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JosephManderleyTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JosephManderleyTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JosephManderleyTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JosephManderleyTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JosephManderleyTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="JosephManderley"
FamiliarName="Joseph Manderley"
UnfamiliarName="Joseph Manderley"



JosephManderleyCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JosephManderleyTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JosephManderleyTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JosephManderleyTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JosephManderleyTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JosephManderleyTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



JuanLebedev.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.JuanLebedevCarcass'
WalkingSpeed=0.213333
bImportant=True
BaseAssHeight=-23.000000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JuanLebedevTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JuanLebedevTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JuanLebedevTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JuanLebedevTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JuanLebedevTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JuanLebedevTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="JuanLebedev"
FamiliarName="Juan Lebedev"
UnfamiliarName="Juan Lebedev"



JuanLebedevCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JuanLebedevTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JuanLebedevTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.JuanLebedevTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JuanLebedevTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JuanLebedevTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JuanLebedevTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



JunkieFemale.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.JunkieFemaleCarcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JunkieFemaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JunkieFemaleTex0'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JunkieFemaleTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.JunkieFemaleTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.JunkieFemaleTex1'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Junkie"
FamiliarName="Junkie"
UnfamiliarName="Junkie"



JunkieFemaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JunkieFemaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.JunkieFemaleTex0'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JunkieFemaleTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.JunkieFemaleTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.JunkieFemaleTex1'



JunkieMale.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.JunkieMaleCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.750000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JunkieMaleTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JunkieMaleTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JunkieMaleTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JunkieMaleTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Junkie"
FamiliarName="Junkie"
UnfamiliarName="Junkie"



JunkieMaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.JunkieMaleTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.JunkieMaleTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JunkieMaleTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.JunkieMaleTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



Karkian.uc (extends Animal)

bPlayDying=True
FoodClass=Class'DeusEx.DeusExCarcass'
bPauseWhenEating=True
bMessyEater=True
bFoodOverridesAttack=True
MinHealth=50.000000
CarcassType=Class'DeusEx.KarkianCarcass'
WalkingSpeed=0.200000
bCanBleed=True
bShowPain=False
ShadowScale=1.000000
InitialAlliances(0)=(AllianceName=Greasel,AllianceLevel=1.000000,bPermanent=True)
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponKarkianBite')
InitialInventory(1)=(Inventory=Class'DeusEx.WeaponKarkianBump')
WalkSound=Sound'DeusExSounds.Animal.KarkianFootstep'
bSpawnBubbles=False
bCanSwim=True
bCanGlide=False
GroundSpeed=400.000000
WaterSpeed=110.000000
AirSpeed=144.000000
AccelRate=500.000000
BaseEyeHeight=12.500000
Health=400
UnderWaterTime=99999.000000
AttitudeToPlayer=ATTITUDE_Ignore
HitSound1=Sound'DeusExSounds.Animal.KarkianPainSmall'
HitSound2=Sound'DeusExSounds.Animal.KarkianPainLarge'
Die=Sound'DeusExSounds.Animal.KarkianDeath'
Alliance=Karkian
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Karkian'
CollisionRadius=54.000000
CollisionHeight=37.099998
Mass=500.000000
Buoyancy=500.000000
RotationRate=(Yaw=30000)
BindName="Karkian"
FamiliarName="Karkian"
UnfamiliarName="Karkian"

Bump (actor Other)


local DeusExWeapon dxWeapon;
local DeusExPlayer dxPlayer;
local float damage;


Super.Bump(Other);

if (IsInState('Attacking') && (Other != None) && (Other == Enemy))
{
// damage both of the player's legs if the karkian "charges"
// just use Shot damage since we don't have a special damage type for charged
// impart a lot of momentum, also
if (VSize(Velocity) > 100)
{
dxWeapon = DeusExWeapon(Weapon);
if ((dxWeapon != None) && dxWeapon.IsA('WeaponKarkianBump') && (FireTimer <= 0))
{
FireTimer = DeusExWeapon(Weapon).AIFireDelay;
damage = VSize(Velocity) / 5;
Other.TakeDamage(damage, Self, Other.Location+vect(1,1,-1), 100*Velocity, 'Shot');
Other.TakeDamage(damage, Self, Other.Location+vect(-1,-1,-1), 100*Velocity, 'Shot');
dxPlayer = DeusExPlayer(Other);
if (dxPlayer != None)
dxPlayer.ShakeView(0.15 + 0.002*damage*2, damage*30*2, 0.3*damage*2);
}
}
}

GetChompPosition -> vector


return (Location+Vector(Rotation)*CollisionRadius - vect(0,0,1)*CollisionHeight*0.5);

GetSwimPivot -> vector


// THIS IS A HIDEOUS, UGLY, MASSIVELY EVIL HACK!!!!
return (vect(0,0,1)*CollisionHeight*1.5);

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
else if ((damageType == 'TearGas') || (damageType == 'HalonGas'))
GotoNextState();
else if (damageType == 'Stunned')
GotoNextState();
else if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

PlayAttack


PlayAnimPivot('Attack');

PlayBeginAttack -> bool


if (FRand() < 0.4)
return PlayRoar();
else
return false;

PlayCriticalDamageSound


PlaySound(sound'KarkianFlee', SLOT_None);

PlayEatingSound


PlaySound(sound'KarkianEat', SLOT_None,,, 384);

PlayIdleSound


PlaySound(sound'KarkianIdle', SLOT_None);

PlayPanicRunning


PlayRunning();

PlayPauseWhenEating


PlayRoar();

PlayRoar -> bool


if (Region.Zone.bWaterZone)
return false;
else
{
PlayAnimPivot('Roar');
return true;
}


PlayRoarSound


PlaySound(Sound'KarkianIdle2', SLOT_Pain, 1.0,,, RandomPitch());

PlayRunning


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('Run');

PlayScanningSound


if (FRand() < 0.3)
PlaySound(sound'KarkianIdle', SLOT_None);

PlayTakingHit (EHitLocation hitPos)


local vector pivot;
local name animName;


animName = '';
if (!Region.Zone.bWaterZone)
{
switch (hitPos)
{
case HITLOC_HeadFront:
case HITLOC_TorsoFront:
case HITLOC_LeftArmFront:
case HITLOC_RightArmFront:
case HITLOC_LeftLegFront:
case HITLOC_RightLegFront:
animName = 'HitFront';
break;

case HITLOC_HeadBack:
case HITLOC_TorsoBack:
case HITLOC_LeftArmBack:
case HITLOC_RightArmBack:
case HITLOC_LeftLegBack:
case HITLOC_RightLegBack:
animName = 'HitBack';
break;
}
pivot = vect(0,0,0);
}

if (animName != '')
PlayAnimPivot(animName, , 0.1, pivot);

PlayTargetAcquiredSound


PlaySound(sound'KarkianAlert', SLOT_None);

PlayTurning


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('Walk', 0.1);

PlayWaiting


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('BreatheLight', , 0.3);

PlayWalking


if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,, GetSwimPivot());
else
LoopAnimPivot('Walk', , 0.15);

ReactToInjury (Pawn instigatedBy, Name damageType, EHitLocation hitPos)


Super.ReactToInjury(instigatedBy, damageType, hitPos);
aggressiveTimer = 10;

TweenToAttack (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
TweenAnimPivot('Attack', tweentime);

TweenToRunning (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
LoopAnimPivot('Run',, tweentime);

TweenToWaiting (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
TweenAnimPivot('BreatheLight', tweentime);

TweenToWalking (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
TweenAnimPivot('Walk', tweentime);




KarkianBaby.uc (extends Karkian)

MinHealth=15.000000
CarcassType=Class'DeusEx.KarkianBabyCarcass'
WalkingSpeed=0.185000
bShowPain=True
InitialInventory(1)=(Inventory=None)
walkAnimMult=2.500000
runAnimMult=2.500000
GroundSpeed=500.000000
WaterSpeed=150.000000
Health=75
DrawScale=0.500000
CollisionRadius=30.000000
CollisionHeight=18.549999
Mass=60.000000
Buoyancy=60.000000
RotationRate=(Yaw=50000)
BindName="KarkianBaby"
FamiliarName="Baby Karkian"
UnfamiliarName="Baby Karkian"



KarkianBabyCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.KarkianCarcass'
Mesh3=LodMesh'DeusExCharacters.KarkianCarcass'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.KarkianCarcass'
DrawScale=0.500000
CollisionRadius=36.279999
CollisionHeight=9.880000



KarkianCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.KarkianCarcass'
Mesh3=LodMesh'DeusExCharacters.KarkianCarcass'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.KarkianCarcass'
CollisionRadius=72.559998
CollisionHeight=19.750000



Keypad.uc (extends HackableDevices)

var() string validCode;
var() sound successSound;
var() sound failureSound;
var() name FailEvent;
var() bool bToggleLock; // if True, toggle the lock state instead of triggering
var HUDKeypadWindow keypadwindow;
validCode="1234"
successSound=Sound'DeusExSounds.Generic.Beep2'
failureSound=Sound'DeusExSounds.Generic.Buzz1'
bToggleLock=True
ItemName="Security Keypad"
Mass=10.000000
Buoyancy=5.000000

ActivateKeypadWindow (DeusExPlayer Hacker, bool bHacked)


local DeusExRootWindow root;


root = DeusExRootWindow(Hacker.rootWindow);
if (root != None)
{
keypadwindow = HUDKeypadWindow(root.InvokeUIScreen(Class'HUDKeypadWindow', True));
root.MaskBackground(True);

// copy the tag data to the actual class
if (keypadwindow != None)
{
keypadwindow.keypadOwner = Self;
keypadwindow.player = Hacker;
keypadwindow.bInstantSuccess = bHacked;
keypadwindow.InitData();
}
}

HackAction (Actor Hacker, bool bHacked)


local DeusExPlayer Player;


// if we're already using this keypad, get out
if (keypadwindow != None)
return;

Player = DeusExPlayer(Hacker);

if (Player != None)
{
// DEUS_EX AMSD if we are in multiplayer, just act based on bHacked
// if you want keypad windows to work in multiplayer, just get rid of this
// if statement. I've already got the windows working, they're just disabled.
if (Level.NetMode != NM_Standalone)
{
if (bHacked)
{
ToggleLocks(Player);
RunEvents(Player,True);
RunUntriggers(Player);
}
return;
}

//DEUS_EX AMSD Must call in player for replication to work.
Player.ActivateKeypadWindow(Self, bHacked);
}

RunEvents (DeusExPlayer Player, bool bSuccess)


local Actor A;


if ((bSuccess) && (Event != ''))
{
foreach AllActors(class 'Actor', A, Event)
A.Trigger(Self, Player);
}
else if ((!bSuccess) && (FailEvent != ''))
{
foreach AllActors(class 'Actor', A, FailEvent)
A.Trigger(Self, Player);
}

RunUntriggers (DeusExPlayer Player)


local Actor A;
local int i;


for (i=0; i {
if (UnTriggerEvent[i] != '')
{
foreach AllActors(class 'Actor', A, UnTriggerEvent[i])
{
A.UnTrigger(Self, Player);
}
}
}

ToggleLocks (DeusExPlayer Player)


local Actor A;

if (bToggleLock)
{
foreach AllActors(class 'Actor', A, Event)
if (A.IsA('DeusExMover'))
DeusExMover(A).bLocked = !DeusExMover(A).bLocked;
}




Keypad1.uc (extends Keypad)

Mesh=LodMesh'DeusExDeco.Keypad1'
CollisionRadius=4.000000
CollisionHeight=6.000000



Keypad2.uc (extends Keypad)

Mesh=LodMesh'DeusExDeco.Keypad2'
CollisionRadius=4.440000
CollisionHeight=7.410000



Keypad3.uc (extends Keypad)

Mesh=LodMesh'DeusExDeco.Keypad3'
CollisionRadius=6.250000
CollisionHeight=4.500000



KillerProfile.uc (extends Info)

var String name;
var String activeWeapon;
var String activeSkill;
var int activeSkillLevel;
var String activeAugs[9];
var int numActiveAugs;
var bool bProximityKilled;
var int streak;
var int healthLow;
var int healthMid;
var int healthHigh;
var int remainingBio;
var int damage;
var String bodyLoc;
var bool bTurretKilled;
var bool bBurnKilled;
var bool bPoisonKilled;
var bool bProjKilled;
var Vector killerLoc;
var String methodStr;
var String myActiveAugs[9];
var int myNumActiveAugs;
var String myActiveWeapon;
var String myActiveSkill;
var int myActiveSkillLevel;
var bool bKilledSelf;
var bool bValid;

Reset


activeWeapon="None";
activeSkill="None";
activeSkillLevel = 0;
bProximityKilled=False;
bTurretKilled=False;
bBurnKilled=False;
bPoisonKilled=False;
bProjKilled=False;
numActiveAugs=0;
myNumActiveAugs=0;




LAM.uc (extends ThrownProjectile)

var float mpBlastRadius;
var float mpProxRadius;
var float mpLAMDamage;
var float mpFuselength;
mpBlastRadius=512.000000
mpProxRadius=128.000000
mpLAMDamage=500.000000
mpFuselength=1.500000
fuseLength=3.000000
proxRadius=128.000000
blastRadius=384.000000
spawnWeaponClass=Class'DeusEx.WeaponLAM'
ItemName="Lightweight Attack Munition (LAM)"
speed=1000.000000
MaxSpeed=1000.000000
Damage=500.000000
MomentumTransfer=50000
ImpactSound=Sound'DeusExSounds.Weapons.LAMExplode'
ExplosionDecal=Class'DeusEx.ScorchMark'
LifeSpan=0.000000
Mesh=LodMesh'DeusExItems.LAMPickup'
CollisionRadius=4.300000
CollisionHeight=3.800000
Mass=5.000000
Buoyancy=2.000000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
blastRadius=mpBlastRadius;
proxRadius=mpProxRadius;
Damage=mpLAMDamage;
fuseLength=mpFuselength;
bIgnoresNanoDefense=True;
}

Tick (float deltaTime)


local float blinkRate;


Super.Tick(deltaTime);

if (bDisabled)
{
Skin = Texture'BlackMaskTex';
return;
}

// flash faster as the time expires
if (fuseLength - time <= 0.75)
blinkRate = 0.1;
else if (fuseLength - time <= fuseLength * 0.5)
blinkRate = 0.3;
else
blinkRate = 0.5;

if ((Level.NetMode == NM_Standalone) || (Role < ROLE_Authority) || (Level.NetMode == NM_ListenServer))
{
if (Abs((fuseLength - time)) % blinkRate > blinkRate * 0.5)
Skin = Texture'BlackMaskTex';
else
Skin = Texture'LAM3rdTex1';
}




Lamp.uc (extends Furniture)

var() bool bOn;
FragType=Class'DeusEx.GlassFragment'
bPushable=False
LightBrightness=255
LightSaturation=255
LightRadius=10

Frob (Actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

if (!bOn)
{
bOn = True;
LightType = LT_Steady;
PlaySound(sound'Switch4ClickOn');
bUnlit = True;
ScaleGlow = 2.0;
}
else
{
bOn = False;
LightType = LT_None;
PlaySound(sound'Switch4ClickOff');
bUnlit = False;
ResetScaleGlow();
}

PostBeginPlay


Super.PostBeginPlay();

if (bOn)
LightType = LT_Steady;




Lamp1.uc (extends Lamp)

ItemName="Table Lamp"
Mesh=LodMesh'DeusExDeco.Lamp1'
CollisionRadius=17.000000
CollisionHeight=24.389999
LightBrightness=192
LightHue=44
LightSaturation=128
LightRadius=8
Mass=40.000000
Buoyancy=10.000000



Lamp2.uc (extends Lamp)

ItemName="Halogen Lamp"
Mesh=LodMesh'DeusExDeco.Lamp2'
CollisionRadius=14.000000
CollisionHeight=47.000000
LightHue=140
LightSaturation=192
Mass=40.000000
Buoyancy=10.000000



Lamp3.uc (extends Lamp)

ItemName="Desk Lamp"
Mesh=LodMesh'DeusExDeco.Lamp3'
CollisionRadius=16.389999
CollisionHeight=10.610000
LightBrightness=192
LightHue=96
LightSaturation=128
LightRadius=4
Mass=30.000000
Buoyancy=10.000000



LaserEmitter.uc (extends Effects)

var LaserSpot spot[2]; // max of 2 reflections
var bool bIsOn;
var actor HitActor;
var bool bFrozen; // are we out of the player's sight?
var bool bRandomBeam;
var bool bBlueBeam; // is this beam blue?
var bool bHiddenBeam; // is this beam hidden?
var LaserProxy proxy;
SoundRadius=16
AmbientSound=Sound'Ambient.Ambient.Laser'
CollisionRadius=40.000000
CollisionHeight=40.000000
RenderIteratorClass=Class'DeusEx.LaserIterator'

CalcTrace (float deltaTime)


local vector StartTrace, EndTrace, HitLocation, HitNormal, Reflection;
local actor target;
local int i, texFlags;
local name texName, texGroup;


StartTrace = Location;
EndTrace = Location + 5000 * vector(Rotation);
HitActor = None;

// trace the path of the reflected beam and draw points at each hit
for (i=0; i {
foreach TraceTexture(class'Actor', target, texName, texGroup, texFlags, HitLocation, HitNormal, EndTrace, StartTrace)
{
if ((target.DrawType == DT_None) || target.bHidden)
{
// do nothing - keep on tracing
}
else if ((target == Level) || target.IsA('Mover'))
{
break;
}
else
{
HitActor = target;
break;
}
}

// draw first beam
if (i == 0)
{
if (LaserIterator(RenderInterface) != None)
LaserIterator(RenderInterface).AddBeam(i, Location, Rotation, VSize(Location - HitLocation));
}
else
{
if (LaserIterator(RenderInterface) != None)
LaserIterator(RenderInterface).AddBeam(i, StartTrace - HitNormal, Rotator(Reflection), VSize(StartTrace - HitLocation - HitNormal));
}

if (spot[i] == None)
{
spot[i] = Spawn(class'LaserSpot', Self, , HitLocation, Rotator(HitNormal));
if (bBlueBeam && (spot[i] != None))
spot[i].Skin = Texture'LaserSpot2';
}
else
{
spot[i].SetLocation(HitLocation);
spot[i].SetRotation(Rotator(HitNormal));
}

// don't reflect any more if we don't hit a mirror
// 0x08000000 is the PF_Mirrored flag from UnObj.h
if ((texFlags & 0x08000000) == 0)
{
// kill all of the other spots after this one
if (i < ArrayCount(spot)-1)
{
do
{
i++;
if (spot[i] != None)
{
spot[i].Destroy();
spot[i] = None;
if (LaserIterator(RenderInterface) != None)
LaserIterator(RenderInterface).DeleteBeam(i);
}
} until (i>=ArrayCount(spot)-1);
}

return;
}

Reflection = MirrorVectorByNormal(Normal(HitLocation - StartTrace), HitNormal);
StartTrace = HitLocation + HitNormal;
EndTrace = Reflection * 10000;
}

Destroyed


TurnOff();

if (proxy != None)
{
proxy.Destroy();
proxy = None;
}

Super.Destroyed();

PostBeginPlay


Super.PostBeginPlay();

// create our proxy laser beam
if (proxy == None)
proxy = Spawn(class'LaserProxy',,, Location, Rotation);

SetBlueBeam


bBlueBeam = True;
if (proxy != None)
proxy.Skin = Texture'LaserBeam2';

SetHiddenBeam (bool bHide)


bHiddenBeam = bHide;
if (proxy != None)
proxy.bHidden = bHide;

Tick (float deltaTime)


local DeusExPlayer player;


// check for visibility
player = DeusExPlayer(GetPlayerPawn());

if (bIsOn)
{
// if we are a weapon's laser sight, do not freeze us
if ((Owner != None) && (Owner.IsA('Weapon') || Owner.IsA('ScriptedPawn')))
bFrozen = False;
else if (proxy != None)
{
// if we are close, say 60 feet
if (proxy.DistanceFromPlayer < 960)
bFrozen = False;
else
{
// can the player see the generator?
if (proxy.LastRendered() <= 2.0)
bFrozen = False;
else
bFrozen = True;
}
}
else
bFrozen = True;

if (bFrozen)
return;

CalcTrace(deltaTime);
}

TurnOff


local int i;


if (bIsOn)
{
for (i=0; i if (spot[i] != None)
{
spot[i].Destroy();
spot[i] = None;
if (LaserIterator(RenderInterface) != None)
LaserIterator(RenderInterface).DeleteBeam(i);
}

HitActor = None;
bIsOn = False;
if (!bHiddenBeam)
proxy.bHidden = True;
SoundVolume = 0;
}

TurnOn


if (!bIsOn)
{
bIsOn = True;
HitActor = None;
CalcTrace(0.0);
if (!bHiddenBeam)
proxy.bHidden = False;
SoundVolume = 128;
}




LaserIterator.uc (extends RenderIterator)

var bool bActive;
var Vector Location;
var Rotator Rotation;
var float Length;
var int numSegments;
var sBeam Beams[8];
var vector prevLoc, prevRand, savedLoc;
var rotator savedRot;
var int nextItem;
var Actor proxy; // used by the C++
var bool bRandomBeam; // used by the C++

AddBeam (int num, Vector loc, Rotator rot, float len)


if ((num >= 0) && (num < ArrayCount(Beams)))
{
// move the beam forward slightly to account for the drawing center
loc += 8 * Vector(rot);
Beams[num].bActive = True;
Beams[num].Location = loc;
Beams[num].Rotation = rot;
Beams[num].Length = len;

if (bRandomBeam)
Beams[num].numSegments = (len / 15) + 1;
else
Beams[num].numSegments = (len / 16) + 1;
}

DeleteBeam (int num)


if ((num >= 0) && (num < ArrayCount(Beams)))
Beams[num].bActive = False;

Init (PlayerPawn Camera)


local LaserEmitter Owner;
local int i;


Owner = LaserEmitter(Outer);
if (Owner != None)
{
MaxItems = 0;
nextItem = 0;
prevLoc = Owner.Location;
prevRand = vect(0,0,0);
savedLoc = Owner.Location;
savedRot = Owner.Rotation;
proxy = Owner.proxy;
bRandomBeam = Owner.bRandomBeam;
if (!Owner.bFrozen && !Owner.bHiddenBeam)
{
// set MaxItems based on length of beams
for (i=0; i if (Beams[i].bActive)
MaxItems += Beams[i].numSegments;

// make sure we render the last one
if (MaxItems > 0)
MaxItems++;
}
}




LaserProxy.uc (extends Effects)

DrawType=DT_Mesh
Style=STY_Translucent
Skin=FireTexture'Effects.Laser.LaserBeam1'
Mesh=LodMesh'DeusExItems.LaserBeam'



LaserSpot.uc (extends Effects)

DrawType=DT_Mesh
Style=STY_Translucent
Skin=FireTexture'Effects.Laser.LaserSpot1'
Mesh=LodMesh'DeusExItems.FlatFX'
DrawScale=0.040000
ScaleGlow=2.000000
bUnlit=True



LaserTrigger.uc (extends Trigger)

var LaserEmitter emitter;
var() bool bIsOn;
var() bool bNoAlarm; // if True, does NOT sound alarm
var actor LastHitActor;
var bool bConfused; // used when hit by EMP
var float confusionTimer; // how long until trigger resumes normal operation
var float confusionDuration; // how long does EMP hit last?
var int HitPoints;
var int minDamageThreshold;
var float lastAlarmTime; // last time the alarm was sounded
var int alarmTimeout; // how long before the alarm silences itself
var actor triggerActor; // actor which last triggered the alarm
var vector actorLocation; // last known location of actor that triggered alarm
bIsOn=True
confusionDuration=10.000000
HitPoints=50
minDamageThreshold=50
alarmTimeout=30
TriggerType=TT_AnyProximity
bHidden=False
bDirectional=True
DrawType=DT_Mesh
Mesh=LodMesh'DeusExDeco.LaserEmitter'
CollisionRadius=2.500000
CollisionHeight=2.500000

BeginAlarm


AmbientSound = Sound'Klaxon2';
SoundVolume = 128;
SoundRadius = 64;
lastAlarmTime = Level.TimeSeconds;
AIStartEvent('Alarm', EAITYPE_Audio, SoundVolume/255.0, 25*(SoundRadius+1));

// make sure we can't go into stasis while we're alarming
bStasis = False;

BeginPlay


Super.BeginPlay();

LastHitActor = None;
emitter = Spawn(class'LaserEmitter');

if (emitter != None)
{
emitter.TurnOn();
bIsOn = True;

// turn off the sound if we should
if (SoundVolume == 0)
emitter.AmbientSound = None;
}
else
bIsOn = False;

Destroyed


if (emitter != None)
{
emitter.Destroy();
emitter = None;
}

Super.Destroyed();

EndAlarm


AmbientSound = None;
lastAlarmTime = 0;
AIEndEvent('Alarm', EAITYPE_Audio);

// reset our stasis info
bStasis = Default.bStasis;

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


local MetalFragment frag;


if (DamageType == 'EMP')
{
confusionTimer = 0;
if (!bConfused)
{
bConfused = True;
PlaySound(sound'EMPZap', SLOT_None,,, 1280);
}
}
else if ((DamageType == 'Exploded') || (DamageType == 'Shot'))
{
if (Damage >= minDamageThreshold)
HitPoints -= Damage;

if (HitPoints <= 0)
{
frag = Spawn(class'MetalFragment', Owner);
if (frag != None)
{
frag.Instigator = EventInstigator;
frag.CalcVelocity(Momentum,0);
frag.DrawScale = 0.5*FRand();
frag.Skin = GetMeshTexture();
}

Destroy();
}
}

Tick (float deltaTime)


local Actor A;
local AdaptiveArmor armor;
local bool bTrigger;


if (emitter != None)
{
// shut off the alarm if the timeout has expired
if (lastAlarmTime != 0)
{
if (Level.TimeSeconds - lastAlarmTime >= alarmTimeout)
EndAlarm();
}

// if we've been EMP'ed, act confused
if (bConfused && bIsOn)
{
confusionTimer += deltaTime;

// randomly turn on/off the beam
if (FRand() > 0.95)
emitter.TurnOn();
else
emitter.TurnOff();

if (confusionTimer > confusionDuration)
{
bConfused = False;
confusionTimer = 0;
emitter.TurnOn();
}

return;
}

emitter.SetLocation(Location);
emitter.SetRotation(Rotation);

if (!bNoAlarm)
{
if ((emitter.HitActor != None) && (LastHitActor != emitter.HitActor))
{
// TT_PlayerProximity actually works with decorations, too
if (IsRelevant(emitter.HitActor) ||
((TriggerType == TT_PlayerProximity) && emitter.HitActor.IsA('Decoration')))
{
bTrigger = True;

if (emitter.HitActor.IsA('DeusExPlayer'))
{
// check for adaptive armor - makes the player invisible
foreach AllActors(class'AdaptiveArmor', armor)
if ((armor.Owner == emitter.HitActor) && armor.bActive)
{
bTrigger = False;
break;
}
}

if (bTrigger)
{
// now, the trigger sounds its own alarm
if (AmbientSound == None)
{
triggerActor = emitter.HitActor;
actorLocation = emitter.HitActor.Location - vect(0,0,1)*(emitter.HitActor.CollisionHeight-1);
BeginAlarm();
}

// play "beam broken" sound
PlaySound(sound'Beep2',,,, 1280, 3.0);
}
}
}
}

LastHitActor = emitter.HitActor;
}

Touch (Actor Other)


// does nothing when touched

Trigger (Actor Other, Pawn Instigator)


if (bConfused)
return;

if (emitter != None)
{
if (!bIsOn)
{
emitter.TurnOn();
bIsOn = True;
LastHitActor = None;
MultiSkins[1] = Texture'LaserSpot1';
}
}

Super.Trigger(Other, Instigator);

UnTrigger (Actor Other, Pawn Instigator)


if (bConfused)
return;

if (emitter != None)
{
if (bIsOn)
{
emitter.TurnOff();
bIsOn = False;
LastHitActor = None;
MultiSkins[1] = Texture'BlackMaskTex';
EndAlarm();
}
}

Super.UnTrigger(Other, Instigator);




LifeSupportBase.uc (extends DeusExDecoration)

bInvincible=True
bHighlight=False
bPushable=False
bBlockSight=True
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.LifeSupportBase'
CollisionRadius=77.000000
CollisionHeight=46.450001
Mass=400.000000
Buoyancy=200.000000



LightSwitch.uc (extends DeusExDecoration)

var bool bOn;
bInvincible=True
ItemName="Switch"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.LightSwitch'
CollisionRadius=3.750000
CollisionHeight=6.250000
Mass=30.000000
Buoyancy=40.000000

Frob (Actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);


if (bOn)
{
PlaySound(sound'Switch4ClickOff');
PlayAnim('Off');
}
else
{
PlaySound(sound'Switch4ClickOn');
PlayAnim('On');
}

bOn = !bOn;




Lightbulb.uc (extends DeusExDecoration)

HitPoints=5
FragType=Class'DeusEx.GlassFragment'
bHighlight=False
ItemName="Light Bulb"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.Lightbulb'
ScaleGlow=2.000000
bUnlit=True
CollisionRadius=1.600000
CollisionHeight=2.900000
LightType=LT_Steady
LightBrightness=255
LightHue=32
LightSaturation=224
LightRadius=8
Mass=3.000000
Buoyancy=2.000000



Liquor40oz.uc (extends DeusExPickup)

var() ESkinColor SkinColor;
bBreakable=True
maxCopies=10
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Forty"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.Liquor40oz'
PickupViewMesh=LodMesh'DeusExItems.Liquor40oz'
ThirdPersonMesh=LodMesh'DeusExItems.Liquor40oz'
LandSound=Sound'DeusExSounds.Generic.GlassHit1'
Icon=Texture'DeusExUI.Icons.BeltIconBeerBottle'
largeIcon=Texture'DeusExUI.Icons.LargeIconBeerBottle'
largeIconWidth=14
largeIconHeight=47
Description="'COLD SWEAT forty ounce malt liquor. Never let 'em see your COLD SWEAT.'"
beltDescription="FORTY"
Mesh=LodMesh'DeusExItems.Liquor40oz'
CollisionRadius=3.000000
CollisionHeight=9.140000
Mass=10.000000
Buoyancy=8.000000

Activate


// can't turn it off

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Super45: Skin = Texture'Liquor40ozTex1'; break;
case SC_Bottle2: Skin = Texture'Liquor40ozTex2'; break;
case SC_Bottle3: Skin = Texture'Liquor40ozTex3'; break;
case SC_Bottle4: Skin = Texture'Liquor40ozTex4'; break;
}

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
{
player.HealPlayer(2, False);
player.drugEffectTimer += 10.0;
}

UseOnce();




LiquorBottle.uc (extends DeusExPickup)

bBreakable=True
maxCopies=10
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Liquor"
ItemArticle="some"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.LiquorBottle'
PickupViewMesh=LodMesh'DeusExItems.LiquorBottle'
ThirdPersonMesh=LodMesh'DeusExItems.LiquorBottle'
LandSound=Sound'DeusExSounds.Generic.GlassHit1'
Icon=Texture'DeusExUI.Icons.BeltIconLiquorBottle'
largeIcon=Texture'DeusExUI.Icons.LargeIconLiquorBottle'
largeIconWidth=20
largeIconHeight=48
Description="The label is torn off, but it looks like some of the good stuff."
beltDescription="LIQUOR"
Mesh=LodMesh'DeusExItems.LiquorBottle'
CollisionRadius=4.620000
CollisionHeight=12.500000
Mass=10.000000
Buoyancy=8.000000

Activate


// can't turn it off

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
{
player.HealPlayer(2, False);
player.drugEffectTimer += 5.0;
}

UseOnce();




LoadMapWindow.uc (extends ToolWindow)

var ToolListWindow lstMaps;
var ToolButtonWindow btnLoad;
var ToolButtonWindow btnCancel;
var ToolCheckboxWindow chkTravel;
var GameDirectory mapDir;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnLoad:
LoadMap(lstMaps.GetSelectedRow());
break;

case btnCancel:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated( buttonPressed );

return bHandled;

CreateControls


// Flags list box
CreateMapList();

// Checkbox
chkTravel = ToolCheckboxWindow(winContainer.NewChild(Class'ToolCheckboxWindow'));
chkTravel.SetPos(280, 66);
chkTravel.SetSize(75, 50);
chkTravel.SetText("|&Travel");
chkTravel.SetToggle(True);

// Buttons
btnLoad = CreateToolButton(280, 362, "|&Load Map");
btnCancel = CreateToolButton(280, 387, "|&Cancel");

CreateMapList


// Now create the List Window
lstMaps = CreateToolList(15, 38, 255, 372);
lstMaps.EnableMultiSelect(False);
lstMaps.EnableAutoExpandColumns(True);

DestroyWindow


CriticalDelete( mapDir );
mapDir = None;

EnableButtons


btnLoad.SetSensitivity( lstMaps.GetNumSelectedRows() > 0 );

InitWindow


Super.InitWindow();

// Create our Map Directory class
mapDir = new(None) Class'GameDirectory';
mapDir.SetDirType(mapDir.EGameDirectoryTypes.GD_Maps);
mapDir.GetGameDirectory();

// Center this window
SetSize(370, 430);
SetTitle("Load Map");

// Create the controls
CreateControls();
PopulateMapList();

ListRowActivated (window list, int rowId) -> bool


LoadMap(rowID);

return true;

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


EnableButtons();

return true;

LoadMap (int rowID)


local String mapFileName;
local DeusExPlayer localPlayer;
local Bool bTravel;


localPlayer = player;

// If a travel map is selected, then we need to set a flag in
// the player before loading the map

mapFileName = lstMaps.GetField(rowID, 0);

mapFileName = mapFileName $ ".dx";
bTravel = chkTravel.GetToggle();

root.ClearWindowStack();

if (bTravel)
localPlayer.ClientTravel(mapFileName, TRAVEL_Relative, True);
else
localPlayer.ConsoleCommand("Open" @ mapFileName $ "?loadonly");

PopulateMapList


local int mapIndex;
local String mapFileName;


lstMaps.DeleteAllRows();

// Loop through all the files, but only display travelmaps if
// the TravelMap checkbox is enabled

for( mapIndex=0; mapIndex {
mapFileName = mapDir.GetDirFilename(mapIndex);
lstMaps.AddRow( left(mapFileName, len(mapFileName) - 3) );
}

// Sort the maps by name
lstMaps.Sort();

EnableButtons();




Lockpick.uc (extends SkilledTool)

UseSound=Sound'DeusExSounds.Generic.LockpickRattling'
maxCopies=20
bCanHaveMultipleCopies=True
ItemName="Lockpick"
PlayerViewOffset=(X=16.000000,Y=8.000000,Z=-16.000000)
PlayerViewMesh=LodMesh'DeusExItems.LockpickPOV'
PickupViewMesh=LodMesh'DeusExItems.Lockpick'
ThirdPersonMesh=LodMesh'DeusExItems.Lockpick3rd'
LandSound=Sound'DeusExSounds.Generic.PlasticHit2'
Icon=Texture'DeusExUI.Icons.BeltIconLockPick'
largeIcon=Texture'DeusExUI.Icons.LargeIconLockPick'
largeIconWidth=45
largeIconHeight=44
Description="A disposable lockpick. The tension wrench is steel, but appropriate needles are formed from fast congealing polymers.|n|n Here's what they don't tell you: despite the product literature, you can use a standard lockpick to bypass all but the most high-class nanolocks. -- Alex Jacobson "
beltDescription="LOCKPICK"
Mesh=LodMesh'DeusExItems.Lockpick'
CollisionRadius=11.750000
CollisionHeight=1.900000
Mass=20.000000
Buoyancy=10.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
MaxCopies = 5;

TestMPBeltSpot (int BeltSpot) -> bool


return (BeltSpot == 7);




LogicTrigger.uc (extends Trigger)

var() name inGroup1, inGroup2;
var() ELogicType Op;
var() bool Not;
var() bool OneShot;
var bool in1, in2, out, outhit;
CollisionRadius=0.000000
bCollideActors=False

Trigger (Actor Other, Pawn Instigator)


local Actor A;


if (Other.Group == inGroup1)
in1 = !in1;
if (Other.Group == inGroup2)
in2 = !in2;

switch(Op)
{
case GATE_AND: out = in1 && in2;
break;
case GATE_OR: out = in1 || in2;
break;
case GATE_XOR: out = bool(int(in1) ^ int(in2)); // why isn't there a boolean XOR?
break;
}

if (Not)
out = !out;

// Trigger event on out==true
if (out && !outhit)
{
if (OneShot)
outhit = True;
if(Event != '')
foreach AllActors(class 'Actor', A, Event)
A.Trigger(Self, Instigator);
}

Super.Trigger(Other, Instigator);




LowerClassFemale.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.LowerClassFemaleCarcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants'
MultiSkins(0)=Texture'DeusExCharacters.Skins.LowerClassFemaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LowerClassFemaleTex0'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LowerClassFemaleTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex6'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LowerClassFemaleTex1'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="LowerClassFemale"
FamiliarName="Lower Class"
UnfamiliarName="Lower Class"



LowerClassFemaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.LowerClassFemaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LowerClassFemaleTex0'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LowerClassFemaleTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex6'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LowerClassFemaleTex1'



LowerClassMale.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.LowerClassMaleCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.750000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LowerClassMaleTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="LowerClassMale"
FamiliarName="Lower Class"
UnfamiliarName="Lower Class"



LowerClassMale2.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.LowerClassMale2Carcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="LowerClassMale"
FamiliarName="Lower Class"
UnfamiliarName="Lower Class"



LowerClassMale2Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.LowerClassMale2Tex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



LowerClassMaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_S_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_S_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LowerClassMaleTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'



LuciusDeBeers.uc (extends DeusExDecoration)

bInvincible=True
bHighlight=False
ItemName="Lucius De Beers in a life support tube"
bPushable=False
BaseEyeHeight=40.000000
bBlockSight=True
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.LuciusDeBeers'
CollisionRadius=44.000000
CollisionHeight=54.139999
Mass=1000.000000
Buoyancy=500.000000



MIB.uc (extends HumanMilitary)

MinHealth=0.000000
CarcassType=Class'DeusEx.MIBCarcass'
WalkingSpeed=0.213333
CloseCombatMult=0.500000
GroundSpeed=180.000000
Health=350
HealthHead=350
HealthTorso=350
HealthLegLeft=350
HealthLegRight=350
HealthArmLeft=350
HealthArmRight=350
Mesh=LodMesh'DeusExCharacters.GM_Suit'
DrawScale=1.100000
MultiSkins(0)=Texture'DeusExCharacters.Skins.MIBTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MIBTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MIBTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MIBTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.LensesTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionHeight=52.250000
BindName="MIB"
FamiliarName="Man In Black"
UnfamiliarName="Man In Black"

Explode


local SphereEffect sphere;
local ScorchMark s;
local ExplosionLight light;
local int i;
local float explosionDamage;
local float explosionRadius;


explosionDamage = 100;
explosionRadius = 256;

// alert NPCs that I'm exploding
AISendEvent('LoudNoise', EAITYPE_Audio, , explosionRadius*16);
PlaySound(Sound'LargeExplosion1', SLOT_None,,, explosionRadius*16);

// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, Location);
if (light != None)
light.size = 4;

Spawn(class'ExplosionSmall',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionMedium',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionMedium',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionLarge',,, Location + 2*VRand()*CollisionRadius);

sphere = Spawn(class'SphereEffect',,, Location);
if (sphere != None)
sphere.size = explosionRadius / 32.0;

// spawn a mark
s = spawn(class'ScorchMark', Base,, Location-vect(0,0,1)*CollisionHeight, Rotation+rot(16384,0,0));
if (s != None)
{
s.DrawScale = FClamp(explosionDamage/30, 0.1, 3.0);
s.ReattachDecal();
}

// spawn some rocks and flesh fragments
for (i=0; i {
if (FRand() < 0.3)
spawn(class'Rockchip',,,Location);
else
spawn(class'FleshFragment',,,Location);
}

HurtRadius(explosionDamage, explosionRadius, 'Exploded', explosionDamage*100, Location);

SpawnCarcass -> Carcass


if (bStunned)
return Super.SpawnCarcass();

Explode();

return None;




MIBCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
DrawScale=1.100000
MultiSkins(0)=Texture'DeusExCharacters.Skins.MIBTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MIBTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MIBTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MIBTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.LensesTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=44.000000
CollisionHeight=7.700000



MJ12Commando.uc (extends HumanMilitary)

MinHealth=0.000000
CarcassType=Class'DeusEx.MJ12CommandoCarcass'
WalkingSpeed=0.296000
bCanCrouch=False
CloseCombatMult=0.500000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponMJ12Commando')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=24)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponMJ12Rocket')
InitialInventory(3)=(Inventory=Class'DeusEx.AmmoRocketMini',Count=10)
BurnPeriod=0.000000
GroundSpeed=200.000000
HealthHead=250
HealthTorso=250
HealthLegLeft=250
HealthLegRight=250
HealthArmLeft=250
HealthArmRight=250
Mesh=LodMesh'DeusExCharacters.GM_ScaryTroop'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MJ12CommandoTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MJ12CommandoTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MJ12CommandoTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MJ12CommandoTex1'
CollisionRadius=28.000000
CollisionHeight=49.880001
BindName="MJ12Commando"
FamiliarName="MJ12 Commando"
UnfamiliarName="MJ12 Commando"

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
else if (!IgnoreDamageType(damageType) && CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

HasTwoHandedWeapon -> Bool


return False;

IgnoreDamageType (Name damageType) -> bool


if ((damageType == 'TearGas') || (damageType == 'PoisonGas'))
return True;
else
return False;

PlayIdle

PlayReload

PlayReloadBegin


TweenAnimPivot('Shoot', 0.1);

PlayReloadEnd

PlayShoot


if (Region.Zone.bWaterZone)
PlayAnimPivot('TreadShoot', , 0, GetSwimPivot());
else
PlayAnimPivot('Shoot2', , 0);

ShieldDamage (Name damageType) -> float


if (IgnoreDamageType(damageType))
return 0.0;
else if ((damageType == 'Burned') || (damageType == 'Flamed'))
return 0.5;
else if ((damageType == 'Poison') || (damageType == 'PoisonEffect'))
return 0.5;
else
return Super.ShieldDamage(damageType);

TweenToShoot (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('TreadShoot', tweentime, GetSwimPivot());
else if (!bCrouching)
TweenAnimPivot('Shoot2', tweentime);




MJ12CommandoCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_ScaryTroop_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_ScaryTroop_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_ScaryTroop_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MJ12CommandoTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MJ12CommandoTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MJ12CommandoTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MJ12CommandoTex1'
CollisionRadius=42.000000
CollisionHeight=7.350000



MJ12Troop.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.MJ12TroopCarcass'
WalkingSpeed=0.296000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponAssaultGun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCombatKnife')
walkAnimMult=0.780000
GroundSpeed=200.000000
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MJ12TroopTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MJ12TroopTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MJ12TroopTex3'
MultiSkins(6)=Texture'DeusExCharacters.Skins.MJ12TroopTex4'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="MJ12Troop"
FamiliarName="MJ12 Troop"
UnfamiliarName="MJ12 Troop"



MJ12TroopCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MJ12TroopTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MJ12TroopTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MJ12TroopTex3'
MultiSkins(6)=Texture'DeusExCharacters.Skins.MJ12TroopTex4'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=40.000000



MaggieChow.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.MaggieChowCarcass'
WalkingSpeed=0.320000
bImportant=True
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MaggieChowTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MaggieChowTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="MaggieChow"
FamiliarName="Maggie Chow"
UnfamiliarName="Maggie Chow"



MaggieChowCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SkinTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MaggieChowTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MaggieChowTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Maid.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.MaidCarcass'
WalkingSpeed=0.320000
BaseAssHeight=-19.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=140.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MaidTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MaidTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MaidTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MaidTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MaidTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Maid"
FamiliarName="Maid"
UnfamiliarName="Maid"



MaidCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MaidTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MaidTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MaidTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MaidTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MaidTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Mailbox.uc (extends Containers)

ItemName="Mailbox"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.Mailbox'
CollisionHeight=36.500000
Mass=400.000000
Buoyancy=200.000000



Male1.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Male1Carcass'
WalkingSpeed=0.296000
walkAnimMult=0.750000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Male1Tex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Male1Tex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Male1Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="GenericMale"
FamiliarName="Male"
UnfamiliarName="Male"



Male1Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Male1Tex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.Male1Tex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Male1Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Male2.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Male2Carcass'
WalkingSpeed=0.296000
walkAnimMult=0.750000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex3'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Male2Tex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SkinTex3'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Male2Tex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Male2"
FamiliarName="Male"
UnfamiliarName="Male"



Male2Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex3'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Male2Tex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SkinTex3'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Male2Tex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'



Male3.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Male3Carcass'
WalkingSpeed=0.296000
walkAnimMult=0.750000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Male3Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Male3"
FamiliarName="Male"
UnfamiliarName="Male"



Male3Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SkinTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.Male3Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Male4.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.Male4Carcass'
WalkingSpeed=0.296000
walkAnimMult=0.780000
GroundSpeed=200.000000
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Male4Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Male4Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Male4Tex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Male4Tex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Male4"
FamiliarName="Male"
UnfamiliarName="Male"



Male4Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.Male4Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.Male4Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.Male4Tex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.Male4Tex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



MapExit.uc (extends NavigationPoint)

var() string DestMap;
var() bool bPlayTransition;
var() name cameraPathTag;
var DeusExPlayer Player;
Texture=Texture'Engine.S_Teleport'
bCollideActors=True

LoadMap (Actor Other)


// use GetPlayerPawn() because convos trigger by who's having the convo
Player = DeusExPlayer(GetPlayerPawn());

if (Player != None)
{
// Make sure we destroy all windows before sending the
// player on his merry way.
DeusExRootWindow(Player.rootWindow).ClearWindowStack();

if (bPlayTransition)
{
PlayTransitionPath();
Player.NextMap = DestMap;
}
else
Level.Game.SendPlayer(Player, DestMap);
}

PlayTransitionPath


local InterpolationPoint I;


if (Player != None)
{
foreach AllActors(class 'InterpolationPoint', I, cameraPathTag)
{
if (I.Position == 1)
{
Player.SetCollision(False, False, False);
Player.bCollideWorld = False;
Player.Target = I;
Player.SetPhysics(PHYS_Interpolating);
Player.PhysRate = 1.0;
Player.PhysAlpha = 0.0;
Player.bInterpolating = True;
Player.bStasis = False;
Player.ShowHud(False);
Player.PutInHand(None);

// if we're in a conversation, set the NextState
// otherwise, goto the correct state
if (Player.conPlay != None)
Player.NextState = 'Interpolating';
else
Player.GotoState('Interpolating');

break;
}
}
}

Touch (Actor Other)


Super.Touch(Other);
LoadMap(Other);

Trigger (Actor Other, Pawn Instigator)


Super.Trigger(Other, Instigator);
LoadMap(Other);




MargaretWilliams.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.MargaretWilliamsCarcass'
WalkingSpeed=0.320000
bImportant=True
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="MargaretWilliams"
FamiliarName="Margaret Williams"
UnfamiliarName="Margaret Williams"



MargaretWilliamsCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MargaretWilliamsTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



MaxChen.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.MaxChenCarcass'
WalkingSpeed=0.213333
bImportant=True
bInvincible=True
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MaxChenTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MaxChenTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MaxChenTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MaxChenTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MaxChenTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MaxChenTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="MaxChen"
FamiliarName="Max Chen"
UnfamiliarName="Max Chen"



MaxChenCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MaxChenTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MaxChenTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MaxChenTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MaxChenTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MaxChenTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MaxChenTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Mechanic.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.MechanicCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.780000
GroundSpeed=200.000000
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex4'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MechanicTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MechanicTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SkinTex4'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.MechanicTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Mechanic"
FamiliarName="Mechanic"
UnfamiliarName="Mechanic"



MechanicCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex4'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MechanicTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MechanicTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SkinTex4'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.MechanicTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



MedKit.uc (extends DeusExPickup)

var int healAmount;
var bool bNoPrintMustBeUsed;
var localized string MustBeUsedOn;
healAmount=30
MustBeUsedOn="Use to heal critical body parts, or use on character screen to direct healing at a certain body part."
maxCopies=15
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Medkit"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.MedKit'
PickupViewMesh=LodMesh'DeusExItems.MedKit'
ThirdPersonMesh=LodMesh'DeusExItems.MedKit3rd'
LandSound=Sound'DeusExSounds.Generic.PlasticHit2'
Icon=Texture'DeusExUI.Icons.BeltIconMedKit'
largeIcon=Texture'DeusExUI.Icons.LargeIconMedKit'
largeIconWidth=39
largeIconHeight=46
Description="A first-aid kit.|n|n The nanomachines of an augmented agent will automatically metabolize the contents of a medkit to efficiently heal damaged areas. An agent with medical training could greatly expedite this process. -- Jaime Reyes "
beltDescription="MEDKIT"
Mesh=LodMesh'DeusExItems.MedKit'
CollisionRadius=7.500000
CollisionHeight=1.000000
Mass=10.000000
Buoyancy=8.000000

Activate


// can't turn it off

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
{
player.HealPlayer(healAmount, True);

// Medkits kill all status effects when used in multiplayer
if ( player.Level.NetMode != NM_Standalone )
{
player.StopPoison();
player.ExtinguishFire();
player.drugEffectTimer = 0;
}
}

UseOnce();

GetHealAmount (int bodyPart, optional float pointsToHeal) -> float


local float amt;


if (pointsToHeal == 0)
pointsToHeal = healAmount;

// CNN - just make all body parts equal to avoid confusion
return pointsToHeal;
/*
switch (bodyPart)
{
case 0: // head
amt = pointsToHeal * 2; break;
break;

case 1: // torso
amt = pointstoHeal;
break;

case 2: // right arm
amt = pointsToHeal * 1.5; break;

case 3: // left arm
amt = pointsToHeal * 1.5; break;

case 4: // right leg
amt = pointsToHeal * 1.5; break;

case 5: // left leg
amt = pointsToHeal * 1.5; break;

default:
amt = pointstoHeal;
}

return amt;*/

NoPrintMustBeUsed


bNoPrintMustBeUsed = True;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
MaxCopies = 5;

TestMPBeltSpot (int BeltSpot) -> bool


return (BeltSpot == 9);

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;
local DeusExPlayer player;
local String outText;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

player = DeusExPlayer(Owner);

if (player != None)
{
winInfo.SetTitle(itemName);
winInfo.SetText(Description $ winInfo.CR() $ winInfo.CR());

if (!bNoPrintMustBeUsed)
{
winInfo.AppendText(winInfo.CR() $ MustBeUsedOn $ winInfo.CR());
}
else
{
bNoPrintMustBeUsed = False;
}

// Print the number of copies
outText = CountLabel @ String(NumCopies);

winInfo.AppendText(winInfo.CR() $ outText);
}

return True;




MedicalBot.uc (extends Robot)

var int healAmount;
var int healRefreshTime;
var int mphealRefreshTime;
var Float lastHealTime;
healAmount=300
healRefreshTime=60
mphealRefreshTime=30
WalkingSpeed=0.200000
GroundSpeed=200.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.MedicalBot'
SoundRadius=16
SoundVolume=128
AmbientSound=Sound'DeusExSounds.Robot.MedicalBotMove'
CollisionRadius=25.000000
CollisionHeight=36.310001
Buoyancy=97.000000
BindName="MedicalBot"
FamiliarName="Medical Bot"
UnfamiliarName="Medical Bot"

CanHeal -> bool


return (Level.TimeSeconds - lastHealTime > healRefreshTime);

Frob (Actor Frobber, Inventory frobWith)


local DeusExPlayer player;
local DeusExRootWindow root;
local HUDMedBotAddAugsScreen winAug;
local HUDMedBotHealthScreen winHealth;
local AugmentationCannister augCan;


Super.Frob(Frobber, frobWith);

player = DeusExPlayer(Frobber);

if (player == None)
return;

// DEUS_EX AMSD In multiplayer, don't pop up the window, just use them
// In singleplayer, do the old thing.
if (Level.NetMode == NM_Standalone)
{
root = DeusExRootWindow(player.rootWindow);
if (root != None)
{
// First check to see if the player has any augmentation cannisters.
// If so, then we'll pull up the Add Augmentations screen.
// Otherwise pull up the Health screen first.

augCan = AugmentationCannister(player.FindInventoryType(Class'AugmentationCannister'));

if (augCan != None)
{
winAug = HUDMedBotAddAugsScreen(root.InvokeUIScreen(Class'HUDMedBotAddAugsScreen', True));
winAug.SetMedicalBot(Self, True);
}
else
{
winHealth = HUDMedBotHealthScreen(root.InvokeUIScreen(Class'HUDMedBotHealthScreen', True));
winHealth.SetMedicalBot(Self, True);
}
root.MaskBackground(True);
}
}
else
{
if (CanHeal())
{
if ( Level.NetMode != NM_Standalone )
{
PlaySound(sound'MedicalHiss', SLOT_None,,, 256);
if ( Frobber.IsA('DeusExPlayer') )
{
DeusExPlayer(Frobber).StopPoison();
DeusExPlayer(Frobber).ExtinguishFire();
DeusExPlayer(Frobber).drugEffectTimer = 0;
}
}
HealPlayer(DeusExPlayer(Frobber));
}
else
{
Pawn(Frobber).ClientMessage("Medbot still charging, "$int(healRefreshTime - (Level.TimeSeconds - lastHealTime))$" seconds to go.");
}
}

GetRefreshTimeRemaining -> Float


return healRefreshTime - (Level.TimeSeconds - lastHealTime);

HealPlayer (DeusExPlayer player) -> int


local int healedPoints;


if (player != None)
{
healedPoints = player.HealPlayer(healAmount);
lastHealTime = Level.TimeSeconds;
}
return healedPoints;

PostBeginPlay


Super.PostBeginPlay();

if (Level.NetMode != NM_Standalone)
{
healRefreshTime = mpHealRefreshTime;
}

if (IsImmobile())
bAlwaysRelevant = True;

lastHealTime = -healRefreshTime;

StandStill


GotoState('Idle', 'Idle');
Acceleration=Vect(0, 0, 0);




numTicks=21
endValue=1.000000
defaultValue=0.500000
choiceControlPosX=290
actionText="|&Brightness"
configSetting="ini:Engine.Engine.ViewportManager Brightness"

player.ConsoleCommand("set" @ configSetting @ saveValue);
player.ConsoleCommand("FLUSH");


saveValue = float(player.ConsoleCommand("get" @ configSetting));

Super.LoadSetting();


Super.ResetToDefault();

player.ConsoleCommand("FLUSH");




Action=MA_MenuScreen
Invoke=Class'DeusEx.MenuScreenAdjustColors'
HelpText="Allows you to adjust the colors of the MENU and in-game HUD screens."
actionText="Adjust Colors..."



HelpText="If set to Enabled, the player will always run"
actionText="|&Always Run"

SetValue(int(!player.bAlwaysRun));


SetValue(int(!player.bAlwaysRun));


player.bAlwaysRun = !bool(GetValue());




Action=MA_MenuScreen
Invoke=Class'DeusEx.MenuScreenBrightness'
actionText="Adjust |&Brightness..."



defaultInfoWidth=88
HelpText="Toggles Crosshairs visibility."
actionText="Cross|&hairs"

SetValue(int(!player.bCrosshairVisible));


SetValue(int(!player.bCrosshairVisible));


player.bCrosshairVisible = !bool(GetValue());




defaultValue=1
defaultInfoWidth=98
HelpText="Disabling Decals may improve performance on slower machines"
actionText="D|&ecals"
configSetting="ini:Engine.Engine.ViewportManager Decals"

local String detailString;
local int enumIndex;
local int detailChoice;


detailString = player.ConsoleCommand("get " $ configSetting);
detailChoice = 0;

for (enumIndex=0; enumIndex {
if (FalseTrue[enumIndex] == detailString)
{
detailChoice = enumIndex;
break;
}
}

SetValue(detailChoice);


player.ConsoleCommand("set " $ configSetting $ " " $ FalseTrue[GetValue()]);




defaultValue=1
defaultInfoWidth=98
HelpText="Disabling Detail Textures may improve performance on slower machines"
actionText="Detail T|&extures"
configSetting="ini:Engine.Engine.GameRenderDevice DetailTextures"

local String detailString;
local int enumIndex;
local int detailChoice;


detailString = player.ConsoleCommand("get " $ configSetting);
detailChoice = 0;

for (enumIndex=0; enumIndex {
if (FalseTrue[enumIndex] == detailString)
{
detailChoice = enumIndex;
break;
}
}

SetValue(detailChoice);


player.ConsoleCommand("set " $ configSetting $ " " $ FalseTrue[GetValue()]);




numTicks=13
startValue=4.000000
endValue=16.000000
defaultValue=16.000000
HelpText="Number of sound effects channels"
actionText="E|&ffects Channels"
configSetting="ini:Engine.Engine.AudioDevice EffectsChannels"

local int enumIndex;
local int counter;


counter = 0;

for(enumIndex=4;enumIndex<17;enumIndex++)
{
SetEnumeration(counter, enumIndex);
counter++;
}




enumText(0)="Enabled"
enumText(1)="Disabled"



Action=MA_Custom
HelpText="Toggle between running the game full-screen or in a window"
actionText="Toggle |&Full-Screen Mode"

ToggleFullScreen();
return True;


player.ConsoleCommand("TOGGLEFULLSCREEN");
// GetScreenResolutions();




enumText(0)="Low"
enumText(1)="Normal"
defaultValue=1
defaultInfoWidth=88
HelpText="Setting to low will remove blood from the game"
actionText="|&Gore Level"

// Check for German system and disable this option
if (player.Level.Game.bVeryLowGore)
btnAction.EnableWindow(False);
else
SetValue(int(!player.Level.Game.bLowGore));


SetValue(defaultValue);


player.Level.Game.bLowGore = !bool(GetValue());
player.Level.Game.SaveConfig();




enumText(0)="Active"
enumText(1)="All Augs"
defaultValue=1
defaultInfoWidth=88
HelpText="This setting determines which Augmentations are displayed in the HUD."
actionText="HUD |&Augmentation Display"

SetValue(int(player.bHUDShowAllAugs));


SetValue(defaultValue);


player.bHUDShowAllAugs = bool(GetValue());
player.AugmentationSystem.RefreshAugDisplay();




defaultValue=1
defaultInfoWidth=97
HelpText="If translucency is enabled, the HUD borders will be translucent"
actionText="HUD |&Borders Translucency"

Super.CycleNextValue();
player.bHUDBordersTranslucent = bool(GetValue());
ChangeStyle();


Super.CyclePreviousValue();
player.bHUDBordersTranslucent = bool(GetValue());
ChangeStyle();


SetValue(int(player.bHUDBordersTranslucent));


player.bHUDBordersTranslucent = bool(defaultValue);
SetValue(defaultValue);
ChangeStyle();


player.bHUDBordersTranslucent = bool(GetValue());




defaultValue=1
defaultInfoWidth=97
HelpText="Determines whether the HUD Borders are displayed"
actionText="HUD Borders |&Visible"

Super.CycleNextValue();
player.bHUDBordersVisible = bool(GetValue());
ChangeStyle();


Super.CyclePreviousValue();
player.bHUDBordersVisible = bool(GetValue());
ChangeStyle();


SetValue(int(player.bHUDBordersVisible));


player.bHUDBordersVisible = bool(defaultValue);
SetValue(defaultValue);
ChangeStyle();


player.bHUDBordersVisible = bool(GetValue());




defaultTheme="Grey"
defaultInfoWidth=97
HelpText="Color scheme used in all the in-game screens."
actionText="|&HUD Color Scheme"

player.ThemeManager.SetCurrentMenuColorTheme(currentTheme);
ChangeStyle();


Super.CycleNextValue();
player.ThemeManager.SetHUDThemeByName(enumText[GetValue()]);
ChangeStyle();


Super.CyclePreviousValue();
player.ThemeManager.SetHUDThemeByName(enumText[GetValue()]);
ChangeStyle();


// Populate the enums!
PopulateThemes(1);

currentTheme = player.ThemeManager.GetCurrentHUDColorTheme();
SetValueFromString(currentTheme.GetThemeName());


local ColorTheme theme;


player.HUDThemeName = defaultTheme;
theme = player.ThemeManager.SetHUDThemeByName(defaultTheme);
theme.ResetThemeToDefault();

SetValueFromString(player.HUDThemeName);

ChangeStyle();


player.HUDThemeName = enumText[GetValue()];




defaultValue=1
defaultInfoWidth=97
HelpText="If translucency is enabled, the background will be visible through the in-game HUD and User-Interface screens."
actionText="HUD Background Tr|&anslucency"

Super.CycleNextValue();
player.bHUDBackgroundTranslucent = bool(GetValue());
ChangeStyle();


Super.CyclePreviousValue();
player.bHUDBackgroundTranslucent = bool(GetValue());
ChangeStyle();


SetValue(int(player.bHUDBackgroundTranslucent));


player.bHUDBackgroundTranslucent = bool(defaultValue);
SetValue(defaultValue);
ChangeStyle();


player.bHUDBackgroundTranslucent = bool(GetValue());




defaultInfoWidth=88
HelpText="If enabled, the player will bob up and down slightly while walking."
actionText="|&Player Bob"

if (player.bob == 0)
SetValue(1);
else
SetValue(0);


if (player.bob == 0)
SetValue(1);
else
SetValue(0);


if (GetValue() == 0)
// player.bob = player.default.bob;
player.bob = 0.016; // for some reason, setting default doesn't work
else
player.bob = 0.0;




HelpText="Inverts the vertical mouse axis so when you push up you look down and vice versa"
actionText="Invert |&Mouse"

SetValue(int(!player.bInvertMouse));


SetValue(int(!player.bInvertMouse));


player.bInvertMouse = !bool(GetValue());




var localized String msgSecond;
msgSecond="s"
numTicks=19
startValue=1.000000
defaultValue=3.000000
HelpText="Select the amount of time log messages remain visible on the screen"
actionText="|&Log Timeout Value"

SetValue(player.GetLogTimeout());


SetValue(defaultValue);


player.SetLogTimeout(GetValue());


local float timeOut;
local int enumIndex;


enumIndex=0;
for(timeOut=1.0; timeOut<=10; timeOut+=0.5)
{
SetEnumeration(enumIndex++, Left(String(timeOut), Instr(String(timeOut), ".") + 2) $ msgSecond);
}




var String englishEnumText[3];
englishEnumText(0)="Low"
englishEnumText(1)="Medium"
englishEnumText(2)="High"
enumText(0)="Low"
enumText(1)="Medium"
enumText(2)="High"



numTicks=13
startValue=3.000000
endValue=15.000000
defaultValue=5.000000
HelpText="Maximum number of log lines visible on the screen at any given time"
actionText="Max. Log Lines"

SetValue(player.GetMaxLogLines());


player.UpdateSensitivity(defaultValue);


player.SetMaxLogLines(GetValue());


local int enumIndex;


for(enumIndex=1;enumIndex<11;enumIndex++)
SetEnumeration(enumIndex-1, enumIndex);




defaultTheme="Grey"
defaultInfoWidth=97
HelpText="Color scheme used in all menus."
actionText="|&Menu Color Scheme"

player.ThemeManager.SetCurrentMenuColorTheme(currentTheme);
ChangeStyle();


Super.CycleNextValue();
player.ThemeManager.SetMenuThemeByName(enumText[GetValue()]);
ChangeStyle();


Super.CyclePreviousValue();
player.ThemeManager.SetMenuThemeByName(enumText[GetValue()]);
ChangeStyle();


// Populate the enums!
PopulateThemes(0);

currentTheme = player.ThemeManager.GetCurrentMenuColorTheme();
SetValueFromString(currentTheme.GetThemeName());


local ColorTheme theme;


player.MenuThemeName = defaultTheme;
theme = player.ThemeManager.SetMenuThemeByName(defaultTheme);
theme.ResetThemeToDefault();

SetValueFromString(player.MenuThemeName);

ChangeStyle();


player.MenuThemeName = enumText[GetValue()];




defaultValue=1
defaultInfoWidth=97
HelpText="If translucency is enabled, the background will be visible through the menus."
actionText="Menu |&Translucency"

Super.CycleNextValue();
player.bMenusTranslucent = bool(GetValue());
ChangeStyle();


Super.CyclePreviousValue();
player.bMenusTranslucent = bool(GetValue());
ChangeStyle();


SetValue(int(player.bMenusTranslucent));


player.bMenusTranslucent = bool(defaultValue);
SetValue(defaultValue);
ChangeStyle();


player.bMenusTranslucent = bool(GetValue());




numTicks=10
startValue=1.000000
defaultValue=3.000000
HelpText="Modifies the mouse sensitivity"
actionText="Mouse |&Sensitivity"

player.UpdateSensitivity(saveValue);


saveValue = player.MouseSensitivity;
SetValue(player.MouseSensitivity);


log("MenuChoice_MouseSensitivy::ResetToDefaults()----------------------");
log(" devaultValue = "$ defaultValue);

player.UpdateSensitivity(defaultValue);
SetValue(player.MouseSensitivity);


local int enumIndex;


for(enumIndex=1;enumIndex<11;enumIndex++)
SetEnumeration(enumIndex-1, enumIndex);




defaultValue=153.000000
HelpText="Adjusts the Music volume."
actionText="|&Music Volume"
configSetting="ini:Engine.Engine.AudioDevice MusicVolume"

Super.CancelSetting();
LoadSetting();


Super.LoadSetting();
Player.SetInstantMusicVolume(GetValue());




defaultInfoWidth=88
HelpText="If enabled, the name of the selected object in the world will be printed"
actionText="|&Object Names"

SetValue(int(!player.bObjectNames));


SetValue(int(!player.bObjectNames));


player.bObjectNames = !bool(GetValue());




var String englishEnumText[2];
englishEnumText(0)="Low"
englishEnumText(1)="High"
enumText(0)="Low"
enumText(1)="High"
defaultInfoWidth=98
HelpText="Change the amount of texture detail on objects"
actionText="|&Object Texture Detail"
configSetting="ini:Engine.Engine.ViewportManager SkinDetail"

local String detailString;
local int enumIndex;
local int detailChoice;


detailString = player.ConsoleCommand("get " $ configSetting);
detailChoice = 0;

for (enumIndex=0; enumIndex {
if (englishEnumText[enumIndex] == detailString)
{
detailChoice = enumIndex;
break;
}
}

SetValue(detailChoice);


player.ConsoleCommand("set " $ configSetting $ " " $ englishEnumText[GetValue()]);




enumText(0)="Off"
enumText(1)="On"



var localized String PromptTitle;
var localized String GamePromptMessage;
var localized String RestartPromptMessage;
PromptTitle="Restart Deus Ex?"
GamePromptMessage="In order to choose a render device, Deus Ex must be restarted. The current game you are playing will be lost if you have not already saved it. Do you still wish to restart?"
RestartPromptMessage="In order to choose a render device, Deus Ex must be restarted. Do you wish to proceed?"
Action=MA_Custom
HelpText="Select the device to use for 3D rendering. Deus Ex must EXIT to allow you to select a 3D hardware device."
actionText="Rendering |&Device..."

local DeusExRootWindow root;


root = DeusExRootWindow(GetRootWindow());

// Destroy the msgbox!
root.PopWindow();

if (buttonNumber == 0)
{
// First save any other changes the user made
// while in this menu before restarting the game!
SaveMenuSettings();

// Restart
player.ConsoleCommand("RELAUNCH -changevideo");
}
return true;


local DeusExLevelInfo info;
local DeusExRootWindow root;


root = DeusExRootWindow(GetRootWindow());

info = player.GetLevelInfo();

// If the game is running, first *PROMPT* the user, becauase
// this will cause the game to quit and restart!!

if (((info != None) && (info.MissionNumber >= 0)) &&
!((player.IsInState('Dying')) || (player.IsInState('Paralyzed'))))
{
root.MessageBox(PromptTitle, GamePromptMessage, 0, False, Self);
}
else
{
root.MessageBox(PromptTitle, RestartPromptMessage, 0, False, Self);
}

return True;




var string CurrentRes;
defaultInfoWidth=98
HelpText="Change the video resolution"
actionText="|&Screen Resolution"

local int p;
local int resX;
local int resWidth;
local int choiceCount;
local string ParseString;
local string Resolutions[16];
local string AvailableRes;
local string resString;
local int resNum;


CurrentRes = player.ConsoleCommand("GetCurrentRes");
AvailableRes = player.ConsoleCommand("GetRes");

resNum = 0;
choiceCount = 0;
ParseString = AvailableRes;

p = InStr(ParseString, " ");
resString = Left(ParseString, p);

while ( ResNum < ArrayCount(Resolutions) )
{
// Only support resolutions >= 640x480
resX = InStr(resString,"x");
resWidth = int(Left(resString, resX));

if ( resWidth >= 640 )
{
enumText[choiceCount] = resString;
choiceCount++;
}

if ( p == -1 )
break;

ParseString = Right(ParseString, Len(ParseString) - p - 1);
p = InStr(ParseString, " ");

if ( p != -1 )
resString = Left(ParseString, p);
else
resString = ParseString;

ResNum++;
}


// Get a pointer to the player. Need to do this here since we
// need access to player in GetScreenResolutions() before
// we can call Super.InitWindow().

player = DeusExPlayer(GetRootWindow().parentPawn);

GetScreenResolutions();

Super.InitWindow();


local int choiceIndex;
local int currentChoice;


currentChoice = 0;

for(choiceIndex=0; choiceIndex {
if (enumText[choiceIndex] == "")
break;

if (enumText[choiceIndex] == CurrentRes)
{
currentChoice = choiceIndex;
break;
}
}

SetValue(currentChoice);


// Reset to the current resolution
LoadSetting();


local String resText;


// Only attempt to change resolutions if the resolution has
// actually changed.
resText = enumText[GetValue()];

if ( resText != player.ConsoleCommand("GetCurrentRes") )
{
player.ConsoleCommand("SetRes " $ resText);
}




defaultInfoWidth=83
HelpText="If enabled, the left and right stereo channels are reversed."
actionText="|&Reverse Stereo"
configSetting="ini:Engine.Engine.AudioDevice ReverseStereo"

LoadSettingBool();


SaveSettingBool();




var bool bMessageDisplayed;
var Localized String RestartTitle;
var Localized String RestartMessage;
RestartTitle="Sound Quality"
RestartMessage="This change will not take effect until you restart Deus Ex."
enumText(0)="11025Hz"
enumText(1)="22050Hz"
enumText(2)="44100Hz"
defaultValue=44100
defaultInfoWidth=83
HelpText="Lower sample rates result in less CPU overhead, but also lower sound quality"
actionText="S|&le Rate"
configSetting="ini:Engine.Engine.AudioDevice OutputRate"

// Destroy the msgbox!
DeusExRootWindow(GetRootWindow()).PopWindow();

return True;


Super.CycleNextValue();

if (!bMessageDisplayed)
{
DeusExRootWindow(GetRootWindow()).MessageBox(RestartTitle, RestartMessage, 1, False, Self);
bMessageDisplayed = True;
}


Super.CyclePreviousValue();

if (!bMessageDisplayed)
{
DeusExRootWindow(GetRootWindow()).MessageBox(RestartTitle, RestartMessage, 1, False, Self);
bMessageDisplayed = True;
}


local int sampleRate;


sampleRate = int(player.ConsoleCommand("get " $ configSetting));
if ( sampleRate == 11025 )
SetValue(0);
else if ( sampleRate == 22050 )
SetValue(1);
else
SetValue(2);


player.ConsoleCommand("set " $ configSetting $ " " $ enumText[GetValue()] );




var bool bMessageDisplayed;
var Localized String RestartTitle;
var Localized String RestartMessage;
RestartTitle="Sound Quality"
RestartMessage="This change will not take effect until you restart Deus Ex."
enumText(0)="8-bit"
enumText(1)="16-bit"
defaultValue=1
defaultInfoWidth=83
HelpText="16-bit sound is higher quality but uses twice as much memory as 8-bit sound, so if you're low on memory, use 8-bit."
actionText="Sound |&Quality"
configSetting="ini:Engine.Engine.AudioDevice LowSoundQuality"

// Destroy the msgbox!
DeusExRootWindow(GetRootWindow()).PopWindow();

return True;


Super.CycleNextValue();

if (!bMessageDisplayed)
{
DeusExRootWindow(GetRootWindow()).MessageBox(RestartTitle, RestartMessage, 1, False, Self);
bMessageDisplayed = True;
}


Super.CyclePreviousValue();

if (!bMessageDisplayed)
{
DeusExRootWindow(GetRootWindow()).MessageBox(RestartTitle, RestartMessage, 1, False, Self);
bMessageDisplayed = True;
}


local String boolString;


boolString = player.ConsoleCommand("get " $ configSetting);

if (boolString == "True")
SetValue(0);
else
SetValue(1);


if (GetValue() == 0)
player.ConsoleCommand("set " $ configSetting $ " True");
else
player.ConsoleCommand("set " $ configSetting $ " False");




defaultValue=204.000000
HelpText="Adjusts the Sound Effects volume."
actionText="Sound |&Effects Volume"
configSetting="ini:Engine.Engine.AudioDevice SoundVolume"

Super.CancelSetting();
LoadSetting();


Super.InitWindow();

btnSlider.winSlider.SetScaleSounds(None, None, None);


Super.LoadSetting();
Player.SetInstantSoundVolume(GetValue());




defaultValue=255.000000
HelpText="Adjusts the Speech volume."
actionText="|&Speech Volume"
configSetting="ini:Engine.Engine.AudioDevice SpeechVolume"

Super.CancelSetting();
LoadSetting();


Super.InitWindow();

btnSlider.winSlider.SetScaleSounds(None, None, None);


Super.LoadSetting();
Player.SetInstantSpeechVolume(GetValue());




defaultValue=1
defaultInfoWidth=88
HelpText="If subtitles are On, conversation dialogue will be displayed on-screen."
actionText="|&Subtitles"

SetValue(int(player.bSubtitles));


SetValue(int(player.bSubtitles));


player.bSubtitles = bool(GetValue());




defaultValue=1
defaultInfoWidth=83
HelpText="Enables Dolby Surround Sound support. Requires a Dolby Pro-Logic Surround Sound Processor."
actionText="|&Dolby Surround Sound"
configSetting="ini:Engine.Engine.AudioDevice UseSurround"

LoadSettingBool();


SaveSettingBool();




var bool bMessageDisplayed;
var String configSetting2;
var Localized String RestartTitle;
var Localized String RestartMessage;
configSetting2="ini:Engine.Engine.ViewportManager WindowedColorBits"
RestartTitle="Texture Color Depth"
RestartMessage="This change will not take effect until you restart Deus Ex."
enumText(0)="16-bit"
enumText(1)="32-bit"
defaultInfoWidth=98
HelpText="Determines the texture color depth. 32-bit textures look better if your hardware supports them."
actionText="|&Texture Color Depth"
configSetting="ini:Engine.Engine.ViewportManager FullscreenColorBits"

// Destroy the msgbox!
DeusExRootWindow(GetRootWindow()).PopWindow();

return True;


Super.CycleNextValue();

if (!bMessageDisplayed)
{
DeusExRootWindow(GetRootWindow()).MessageBox(RestartTitle, RestartMessage, 1, False, Self);
bMessageDisplayed = True;
}


Super.CyclePreviousValue();

if (!bMessageDisplayed)
{
DeusExRootWindow(GetRootWindow()).MessageBox(RestartTitle, RestartMessage, 1, False, Self);
bMessageDisplayed = True;
}


local int detailChoice;


detailChoice = int(player.ConsoleCommand("get " $ configSetting));

if (detailChoice == 16)
SetValue(0);
else
SetValue(1);


LoadSetting();


if (GetValue() == 0)
{
player.ConsoleCommand("set " $ configSetting $ " 16");
player.ConsoleCommand("set " $ configSetting2 $ " 16");
}
else
{
player.ConsoleCommand("set " $ configSetting $ " 32");
player.ConsoleCommand("set " $ configSetting2 $ " 32");
}




var ColorTheme currentTheme;
var String defaultTheme;

local ColorTheme theme;
local int themeIndex;


theme = player.ThemeManager.GetFirstTheme(themeType);

while(theme != None)
{
enumText[themeIndex++] = theme.GetThemeName();
theme = player.ThemeManager.GetNextTheme();
}


local int enumIndex;


for(enumIndex=0; enumIndex {
if (enumText[enumIndex] == stringValue)
{
SetValue(enumIndex);
break;
}
}




HelpText="If set to Enabled, the crouch key will act as a toggle"
actionText="|&Toggle Crouch"

SetValue(int(!player.bToggleCrouch));


SetValue(int(!player.bToggleCrouch));


player.bToggleCrouch = !bool(GetValue());




enumText(0)="Render 3D"
enumText(1)="Snapshot"
enumText(2)="Black"
defaultInfoWidth=88
HelpText="Determines what is displayed under menus and 2D screens. Render 3D is good for fast machines, followed by Snapshot and then Black."
actionText="UI/Menu |&Background"

SetValue(player.UIBackground);


SetValue(defaultValue);


player.UIBackground = GetValue();

if (player.UIBackground == 1)
DeusExRootWindow(player.rootWindow).Hide();

DeusExRootWindow(player.rootWindow).ShowSnapshot();

if (player.UIBackground == 1)
DeusExRootWindow(player.rootWindow).Show();




var bool bMessageDisplayed;
var Localized String RestartTitle;
var Localized String RestartMessage;
RestartTitle="Sound Quality"
RestartMessage="This change will not take effect until you restart Deus Ex."
defaultValue=1
defaultInfoWidth=83
HelpText="Enables Hardware 3D Sound Support."
actionText="|&Hardware 3D Support"
configSetting="ini:Engine.Engine.AudioDevice Use3dHardware"

// Destroy the msgbox!
DeusExRootWindow(GetRootWindow()).PopWindow();

return True;


Super.CycleNextValue();

if (!bMessageDisplayed)
{
DeusExRootWindow(GetRootWindow()).MessageBox(RestartTitle, RestartMessage, 1, False, Self);
bMessageDisplayed = True;
}


Super.CyclePreviousValue();

if (!bMessageDisplayed)
{
DeusExRootWindow(GetRootWindow()).MessageBox(RestartTitle, RestartMessage, 1, False, Self);
bMessageDisplayed = True;
}


LoadSettingBool();


SaveSettingBool();




enumText(0)="Visible"
enumText(1)="Hidden"



var localized String VolumeOffText;
var localized String VolumeMaxText;
VolumeOffText="OFF"
VolumeMaxText="MAX"
endValue=255.000000

// The first sliders use the same enumerations
SetEnumeration(0, VolumeOffText);
SetEnumeration(1, "1");
SetEnumeration(2, "2");
SetEnumeration(3, "3");
SetEnumeration(4, "4");
SetEnumeration(5, "5");
SetEnumeration(6, "6");
SetEnumeration(7, "7");
SetEnumeration(8, "8");
SetEnumeration(9, "9");
SetEnumeration(10, VolumeMaxText);




defaultInfoWidth=88
HelpText="If enabled, weapons will automatically reload when their ammo is depleted."
actionText="|&Weapon Auto-Reload"

SetValue(int(!player.bAutoReload));


SetValue(int(!player.bAutoReload));
if ( player.Level.NetMode != NM_Standalone )
player.ServerSetAutoReload( player.bAutoReload );


player.bAutoReload = !bool(GetValue());
if ( player.Level.NetMode != NM_Standalone )
player.ServerSetAutoReload( player.bAutoReload );




defaultInfoWidth=98
HelpText="Change the amount of texture detail in the world"
actionText="|&World Texture Detail"
configSetting="ini:Engine.Engine.ViewportManager TextureDetail"

local String detailString;
local int enumIndex;
local int detailChoice;


detailString = player.ConsoleCommand("get " $ configSetting);
detailChoice = 0;

for (enumIndex=0; enumIndex {
if (englishEnumText[enumIndex] == detailString)
{
detailChoice = enumIndex;
break;
}
}

SetValue(detailChoice);


player.ConsoleCommand("set " $ configSetting $ " " $ englishEnumText[GetValue()]);




ButtonNames(0)="New Game"
ButtonNames(1)="Save Game"
ButtonNames(2)="Load Game"
ButtonNames(3)="Settings"
ButtonNames(4)="Training"
ButtonNames(5)="Play Intro"
ButtonNames(6)="Credits"
ButtonNames(7)="Back to Game"
ButtonNames(8)="Multiplayer"
ButtonNames(9)="Exit"
buttonXPos=7
buttonWidth=245
buttonDefaults(0)=(Y=13,Action=MA_NewGame)
buttonDefaults(1)=(Y=49,Action=MA_MenuScreen,Invoke=Class'DeusEx.MenuScreenSaveGame')
buttonDefaults(2)=(Y=85,Action=MA_MenuScreen,Invoke=Class'DeusEx.MenuScreenLoadGame')
buttonDefaults(3)=(Y=121,Invoke=Class'DeusEx.MenuSettings')
buttonDefaults(4)=(Y=157,Action=MA_Training)
buttonDefaults(5)=(Y=193,Action=MA_Intro)
buttonDefaults(6)=(Y=229,Action=MA_MenuScreen,Invoke=Class'DeusEx.CreditsWindow')
buttonDefaults(7)=(Y=265,Action=MA_Previous)
buttonDefaults(8)=(Y=301,Action=MA_MenuScreen,Invoke=Class'DeusEx.menumpmain')
buttonDefaults(9)=(Y=359,Action=MA_Quit)
Title="Welcome to DEUS EX"
ClientWidth=258
ClientHeight=400
verticalOffset=2
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuMainBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuMainBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuMainBackground_3'
textureCols=2

Super.InitWindow();

UpdateButtonStatus();
ShowVersionInfo();


local TextWindow version;


version = TextWindow(NewChild(Class'TextWindow'));
version.SetTextMargins(0, 0);
version.SetWindowAlignments(HALIGN_Right, VALIGN_Bottom);
version.SetTextColorRGB(255, 255, 255);
version.SetTextAlignments(HALIGN_Right, VALIGN_Bottom);
version.SetText(player.GetDeusExVersion());


local DeusExLevelInfo info;


info = player.GetLevelInfo();

// Disable the "Save Game" and "Back to Game" menu choices
// if the player's dead or we're on the logo map.
//
// Also don't allow the user to save if a DataLink is playing

// Don't disable in mp if dead.

if (((info != None) && (info.MissionNumber < 0)) ||
((player.IsInState('Dying')) || (player.IsInState('Paralyzed')) || (player.IsInState('Interpolating'))))
{
if (Player.Level.NetMode == NM_Standalone)
{
winButtons[1].SetSensitivity(False);
winButtons[7].SetSensitivity(False);
}
}

// Disable the "Save Game", "New Game", "Intro", "Training" and "Load Game" menu choices if in multiplayer
if (player.Level.Netmode != NM_Standalone)
{
winButtons[0].SetSensitivity(False);
winButtons[1].SetSensitivity(False);
winButtons[2].SetSensitivity(False);
winButtons[4].SetSensitivity(False);
winButtons[5].SetSensitivity(False);
}

// Don't allow saving if a datalink is playing
if (player.dataLinkPlay != None)
winButtons[1].SetSensitivity(False);

// DEUS_EX_DEMO - Uncomment when building demo
//
// Disable the "Play Intro" button for the demo
// winButtons[5].SetSensitivity(False);




var MenuScreenAdjustColorsExample winExample;
choices(0)=Class'DeusEx.MenuChoice_MenuTranslucency'
choices(1)=Class'DeusEx.MenuChoice_MenuColor'
choices(2)=Class'DeusEx.MenuChoice_HUDBordersVisible'
choices(3)=Class'DeusEx.MenuChoice_HUDBorderTranslucency'
choices(4)=Class'DeusEx.MenuChoice_HUDTranslucency'
choices(5)=Class'DeusEx.MenuChoice_HUDColor'
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_OK)
actionButtons(2)=(Action=AB_Reset)
Title="Adjust Colors"
ClientWidth=620
ClientHeight=300
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuColorBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuColorBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuColorBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuColorBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.MenuColorBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.MenuColorBackground_6'
helpPosY=246

winExample = MenuScreenAdjustColorsExample(winClient.NewChild(Class'MenuScreenAdjustColorsExample'));
winExample.SetPos(395, 25);


Super.InitWindow();

CreateExampleWindow();


Super.SaveSettings();
player.SaveConfig();
player.ThemeManager.SaveConfig();




var DeusExPlayer player;
var Color colBackground;
var Color colBorders;
var Color colTitleText;
var Color colHeaderText;
var Color colNormalText;
var Color colButtonTextNormal;
var Color colButtonTextFocus;
var Color colButtonFace;
var Bool bBackgroundTranslucent;
var Bool bBordersTranslucent;
var Bool bBordersVisible;
var localized string TitleBarLabel;
var localized string TextHeaderLabel;
var localized string TextNormalLabel;
var localized string ButtonPressedLabel;
var localized string ButtonNormalLabel;
TitleBarLabel="Title Bar"
TextHeaderLabel="Sample Text"
TextNormalLabel="Sample Text"
ButtonPressedLabel="Pressed"
ButtonNormalLabel="Normal"

// Draw Background
if (bBackgroundTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBackground);
gc.DrawTexture(0, 0, 256, 135, 0, 0, Texture'MenuColorHUDBackground');

// Draw Borders
if (bBordersVisible)
{
if (bBordersTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBorders);
gc.DrawTexture(0, 0, 256, 135, 0, 0, Texture'MenuColorHUDBorders');
}

// Draw Text
gc.SetTextColor(colTitleText);
gc.SetFont(Font'FontMenuHeaders');
gc.DrawText(23, 19, 90, 11, TitleBarLabel);

gc.SetTextColor(colHeaderText);
gc.SetFont(Font'FontMenuHeaders');
gc.DrawText(27, 37, 90, 11, TextHeaderLabel);

gc.SetTextColor(colNormalText);
gc.SetFont(Font'FontMenuSmall');
gc.DrawText(27, 56, 90, 11, TextNormalLabel);

gc.SetTextColor(colButtonTextNormal);
gc.SetFont(Font'FontMenuHeaders');
gc.DrawText(28, 110, 54, 10, ButtonPressedLabel);

gc.SetTextColor(colButtonTextFocus);
gc.SetFont(Font'FontMenuHeaders');
gc.DrawText(94, 110, 54, 10, ButtonNormalLabel);


Super.InitWindow();

SetSize(207, 135);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colBackground = theme.GetColorFromName('HUDColor_Background');
colBorders = theme.GetColorFromName('HUDColor_Borders');
colTitleText = theme.GetColorFromName('HUDColor_TitleText');
colHeaderText = theme.GetColorFromName('HUDColor_HeaderText');
colNormalText = theme.GetColorFromName('HUDColor_NormalText');
colButtonTextNormal = theme.GetColorFromName('HUDColor_ButtonTextNormal');
colButtonTextFocus = theme.GetColorFromName('HUDColor_ButtonTextFocus');
colButtonFace = theme.GetColorFromName('HUDColor_ButtonFace');

bBackgroundTranslucent = player.GetHUDBackgroundTranslucency();
bBordersTranslucent = player.GetHUDBorderTranslucency();
bBordersVisible = player.GetHUDBordersVisible();




var Color colRed;
var Color colGreen;
var Color colBlue;
var Color colWhite;
var localized string helpMessage;
colRed=(R=255)
colGreen=(G=255)
colBlue=(B=255)
colWhite=(R=255,G=255,B=255)
HelpMessage="Adjust the slider so the color bars fade smoothly to pure black at the bottom of the bars."
choices(0)=Class'DeusEx.MenuChoice_AdjustBrightness'
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_OK)
actionButtons(2)=(Action=AB_Reset)
Title="Adjust Brightness"
ClientWidth=556
ClientHeight=283
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuBrightnessBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuBrightnessBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuBrightnessBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuBrightnessBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.MenuBrightnessBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.MenuBrightnessBackground_6'
bHelpAlwaysOn=True
helpPosY=229

Super.CreateControls();

// Create scale textures
CreateScaleWindow(14, colRed);
CreateScaleWindow(144, colGreen);
CreateScaleWindow(274, colBlue);
CreateScaleWindow(404, colWhite);

// Create line
// CreateScaleLine();


local Window winLine;


winLine = winClient.NewChild(Class'Window');
winLine.SetPos(14, 178);
winLine.SetSize(520, 1);
winLine.SetBackground(Texture'Solid');
winLine.SetBackgroundStyle(DSTY_Normal);
winLine.SetTileColor(colWhite);


local Window winScale;


winScale = winClient.NewChild(Class'Window');
winScale.SetPos(posX, 67);
winScale.SetSize(130, 137);
winScale.SetBackground(Texture'MenuBrightnessGradient');
winScale.SetTileColor(colScale);
winScale.SetBackgroundStyle(DSTY_Normal);


root.ShowSnapshot(True);

Super.DestroyWindow();


Super.InitWindow();

ShowHelp(helpMessage);

// Don't mask this window, we want the user to see the
// 3D Scene unmolested to assist when setting the
// brightness.
root.HideSnapshot();




choices(0)=Class'DeusEx.MenuChoice_AlwaysRun'
choices(1)=Class'DeusEx.MenuChoice_ToggleCrouch'
choices(2)=Class'DeusEx.MenuChoice_InvertMouse'
choices(3)=Class'DeusEx.MenuChoice_MouseSensitivity'
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_OK)
actionButtons(2)=(Action=AB_Reset)
Title="Controls"
ClientWidth=537
ClientHeight=228
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuControlsBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuControlsBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuControlsBackground_3'
textureRows=1
helpPosY=174

Super.SaveSettings();
player.SaveConfig();




var MenuUIListHeaderButtonWindow btnHeaderAction;
var MenuUIListHeaderButtonWindow btnHeaderAssigned;
var MenuUIListWindow lstKeys;
var MenuUIScrollAreaWindow winScroll;
var EInputKey inputKey;
var localized String DisplayName;
var localized string FunctionText[61];
var string MenuValues1[61];
var string MenuValues2[61];
var string AliasNames[61];
var string PendingCommands[100];
var localized S_KeyDisplayItem keyDisplayNames[71];
var localized string NoneText;
var int Pending;
var int selection;
var Bool bWaitingForInput;
var localized string strHeaderActionLabel;
var localized string strHeaderAssignedLabel;
var localized string WaitingHelpText;
var localized string InputHelpText;
var localized string ReassignedFromLabel;
FunctionText(0)="Fire Weapon/Use object in hand"
FunctionText(1)="Use object in world"
FunctionText(2)="Drop/Throw Item"
FunctionText(3)="Put Away Item"
FunctionText(4)="Move Forward"
FunctionText(5)="Move Backward"
FunctionText(6)="Turn Left"
FunctionText(7)="Turn Right"
FunctionText(8)="Strafe Left"
FunctionText(9)="Strafe Right"
FunctionText(10)="Lean Left"
FunctionText(11)="Lean Right"
FunctionText(12)="Jump"
FunctionText(13)="Crouch"
FunctionText(14)="Mouse Look"
FunctionText(15)="Look Up"
FunctionText(16)="Look Down"
FunctionText(17)="Center View"
FunctionText(18)="Walk/Run"
FunctionText(19)="Toggle Walk/Run"
FunctionText(20)="Strafe"
FunctionText(21)="Select Next Belt Item"
FunctionText(22)="Select Previous Belt Item"
FunctionText(23)="Reload Weapon"
FunctionText(24)="Toggle Scope"
FunctionText(25)="Toggle Laser Sight"
FunctionText(26)="Activate All Augmentations"
FunctionText(27)="Deactivate All Augmentations"
FunctionText(28)="Change Ammo"
FunctionText(29)="Take Screenshot"
FunctionText(30)="Activate Inventory Screen"
FunctionText(31)="Activate Health Screen"
FunctionText(32)="Activate Augmentations Screen"
FunctionText(33)="Activate Skills Screen"
FunctionText(34)="Activate Goals/Notes Screen"
FunctionText(35)="Activate Conversations Screen"
FunctionText(36)="Activate Images Screen"
FunctionText(37)="Activate Logs Screen"
FunctionText(38)="Quick Save"
FunctionText(39)="Quick Load"
FunctionText(40)="Toggle Crosshairs"
FunctionText(41)="Toggle Hit Display"
FunctionText(42)="Toggle Compass"
FunctionText(43)="Toggle Augmentation Display"
FunctionText(44)="Toggle Object Belt"
FunctionText(45)="Toggle Ammo Display"
FunctionText(46)="F3"
FunctionText(47)="F4"
FunctionText(48)="F5"
FunctionText(49)="F6"
FunctionText(50)="F7"
FunctionText(51)="F8"
FunctionText(52)="F9"
FunctionText(53)="F10"
FunctionText(54)="F11"
FunctionText(55)="F12"
FunctionText(56)="Show Multiplayer Scores"
FunctionText(57)="Send Message To Team"
FunctionText(58)="Send Message To All"
FunctionText(59)="Activate Multiplayer Skill Menu"
FunctionText(60)="Show Multiplayer Kill Details"
AliasNames(0)="ParseLeftClick|Fire"
AliasNames(1)="ParseRightClick"
AliasNames(2)="DropItem"
AliasNames(3)="PutInHand"
AliasNames(4)="MoveForward"
AliasNames(5)="MoveBackward"
AliasNames(6)="TurnLeft"
AliasNames(7)="TurnRight"
AliasNames(8)="StrafeLeft"
AliasNames(9)="StrafeRight"
AliasNames(10)="LeanLeft"
AliasNames(11)="LeanRight"
AliasNames(12)="Jump"
AliasNames(13)="Duck"
AliasNames(14)="Look"
AliasNames(15)="LookUp"
AliasNames(16)="LookDown"
AliasNames(17)="CenterView"
AliasNames(18)="Walking"
AliasNames(19)="ToggleWalk"
AliasNames(20)="Strafe"
AliasNames(21)="NextBeltItem"
AliasNames(22)="PrevBeltItem"
AliasNames(23)="ReloadWeapon"
AliasNames(24)="ToggleScope"
AliasNames(25)="ToggleLaser"
AliasNames(26)="ActivateAllAugs"
AliasNames(27)="DeactivateAllAugs"
AliasNames(28)="SwitchAmmo"
AliasNames(29)="Shot"
AliasNames(30)="ShowInventoryWindow"
AliasNames(31)="ShowHealthWindow"
AliasNames(32)="ShowAugmentationsWindow"
AliasNames(33)="ShowSkillsWindow"
AliasNames(34)="ShowGoalsWindow"
AliasNames(35)="ShowConversationsWindow"
AliasNames(36)="ShowImagesWindow"
AliasNames(37)="ShowLogsWindow"
AliasNames(38)="QuickSave"
AliasNames(39)="QuickLoad"
AliasNames(40)="ToggleCrosshair"
AliasNames(41)="ToggleHitDisplay"
AliasNames(42)="ToggleCompass"
AliasNames(43)="ToggleAugDisplay"
AliasNames(44)="ToggleObjectBelt"
AliasNames(45)="ToggleAmmoDisplay"
AliasNames(46)="DualMapF3"
AliasNames(47)="DualMapF4"
AliasNames(48)="DualMapF5"
AliasNames(49)="DualMapF6"
AliasNames(50)="DualMapF7"
AliasNames(51)="DualMapF8"
AliasNames(52)="DualMapF9"
AliasNames(53)="DualMapF10"
AliasNames(54)="DualMapF11"
AliasNames(55)="DualMapF12"
AliasNames(56)="ShowScores"
AliasNames(57)="TeamTalk"
AliasNames(58)="Talk"
AliasNames(59)="BuySkills"
AliasNames(60)="KillerProfile"
keyDisplayNames(0)=(inputKey=IK_LeftMouse,displayName="Left Mouse Button")
keyDisplayNames(1)=(inputKey=IK_RightMouse,displayName="Right Mouse Button")
keyDisplayNames(2)=(inputKey=IK_MiddleMouse,displayName="Middle Mouse Button")
keyDisplayNames(3)=(inputKey=IK_CapsLock,displayName="CAPS Lock")
keyDisplayNames(4)=(inputKey=IK_PageUp,displayName="Page Up")
keyDisplayNames(5)=(inputKey=IK_PageDown,displayName="Page Down")
keyDisplayNames(6)=(inputKey=IK_PrintScrn,displayName="Print Screen")
keyDisplayNames(7)=(inputKey=IK_GreyStar,displayName="NumPad Asterisk")
keyDisplayNames(8)=(inputKey=IK_GreyPlus,displayName="NumPad Plus")
keyDisplayNames(9)=(inputKey=IK_GreyMinus,displayName="NumPad Minus")
keyDisplayNames(10)=(inputKey=IK_GreySlash,displayName="NumPad Slash")
keyDisplayNames(11)=(inputKey=IK_NumPadPeriod,displayName="NumPad Period")
keyDisplayNames(12)=(inputKey=IK_NumLock,displayName="Num Lock")
keyDisplayNames(13)=(inputKey=IK_ScrollLock,displayName="Scroll Lock")
keyDisplayNames(14)=(inputKey=IK_LShift,displayName="Left Shift")
keyDisplayNames(15)=(inputKey=IK_RShift,displayName="Right Shift")
keyDisplayNames(16)=(inputKey=IK_LControl,displayName="Left Control")
keyDisplayNames(17)=(inputKey=IK_RControl,displayName="Right Control")
keyDisplayNames(18)=(inputKey=IK_MouseWheelUp,displayName="Mouse Wheel Up")
keyDisplayNames(19)=(inputKey=IK_MouseWheelDown,displayName="Mouse Wheel Down")
keyDisplayNames(20)=(inputKey=IK_MouseX,displayName="Mouse X")
keyDisplayNames(21)=(inputKey=IK_MouseY,displayName="Mouse Y")
keyDisplayNames(22)=(inputKey=IK_MouseZ,displayName="Mouse Z")
keyDisplayNames(23)=(inputKey=IK_MouseW,displayName="Mouse W")
keyDisplayNames(24)=(inputKey=IK_LeftBracket,displayName="Left Bracket")
keyDisplayNames(25)=(inputKey=IK_RightBracket,displayName="Right Bracket")
keyDisplayNames(26)=(inputKey=IK_SingleQuote,displayName="Single Quote")
keyDisplayNames(27)=(inputKey=IK_Joy1,displayName="Joystick Button 1")
keyDisplayNames(28)=(inputKey=IK_Joy2,displayName="Joystick Button 2")
keyDisplayNames(29)=(inputKey=IK_Joy3,displayName="Joystick Button 3")
keyDisplayNames(30)=(inputKey=IK_Joy4,displayName="Joystick Button 4")
keyDisplayNames(31)=(inputKey=IK_JoyX,displayName="Joystick X")
keyDisplayNames(32)=(inputKey=IK_JoyY,displayName="Joystick Y")
keyDisplayNames(33)=(inputKey=IK_JoyZ,displayName="Joystick Z")
keyDisplayNames(34)=(inputKey=IK_JoyR,displayName="Joystick R")
keyDisplayNames(35)=(inputKey=IK_JoyU,displayName="Joystick U")
keyDisplayNames(36)=(inputKey=IK_JoyV,displayName="Joystick V")
keyDisplayNames(37)=(inputKey=IK_JoyPovUp,displayName="Joystick Pov Up")
keyDisplayNames(38)=(inputKey=IK_JoyPovDown,displayName="Joystick Pov Down")
keyDisplayNames(39)=(inputKey=IK_JoyPovLeft,displayName="Joystick Pov Left")
keyDisplayNames(40)=(inputKey=IK_JoyPovRight,displayName="Joystick Pov Right")
keyDisplayNames(41)=(inputKey=IK_Ctrl,displayName="Control")
keyDisplayNames(42)=(inputKey=IK_Left,displayName="Left Arrow")
keyDisplayNames(43)=(inputKey=IK_Right,displayName="Right Arrow")
keyDisplayNames(44)=(inputKey=IK_Up,displayName="Up Arrow")
keyDisplayNames(45)=(inputKey=IK_Down,displayName="Down Arrow")
keyDisplayNames(46)=(inputKey=IK_Insert,displayName="Insert")
keyDisplayNames(47)=(inputKey=IK_Home,displayName="Home")
keyDisplayNames(48)=(inputKey=IK_Delete,displayName="Delete")
keyDisplayNames(49)=(inputKey=IK_End,displayName="End")
keyDisplayNames(50)=(inputKey=IK_NumPad0,displayName="NumPad 0")
keyDisplayNames(51)=(inputKey=IK_NumPad1,displayName="NumPad 1")
keyDisplayNames(52)=(inputKey=IK_NumPad2,displayName="NumPad 2")
keyDisplayNames(53)=(inputKey=IK_NumPad3,displayName="NumPad 3")
keyDisplayNames(54)=(inputKey=IK_NumPad4,displayName="NumPad 4")
keyDisplayNames(55)=(inputKey=IK_NumPad5,displayName="NumPad 5")
keyDisplayNames(56)=(inputKey=IK_NumPad6,displayName="NumPad 6")
keyDisplayNames(57)=(inputKey=IK_NumPad7,displayName="NumPad 7")
keyDisplayNames(58)=(inputKey=IK_NumPad8,displayName="NumPad 8")
keyDisplayNames(59)=(inputKey=IK_NumPad9,displayName="NumPad 9")
keyDisplayNames(60)=(inputKey=IK_Period,displayName="Period")
keyDisplayNames(61)=(inputKey=IK_Comma,displayName="Comma")
keyDisplayNames(62)=(inputKey=IK_Backslash,displayName="Backslash")
keyDisplayNames(63)=(inputKey=IK_Semicolon,displayName="Semicolon")
keyDisplayNames(64)=(inputKey=IK_Equals,displayName="Equals")
keyDisplayNames(65)=(inputKey=IK_Slash,displayName="Slash")
keyDisplayNames(66)=(inputKey=IK_Enter,displayName="Enter")
keyDisplayNames(67)=(inputKey=IK_Alt,displayName="Alt")
keyDisplayNames(68)=(inputKey=IK_Backspace,displayName="Backspace")
keyDisplayNames(69)=(inputKey=IK_Shift,displayName="Shift")
keyDisplayNames(70)=(inputKey=IK_Space,displayName="Space")
NoneText="[None]"
strHeaderActionLabel="Action"
strHeaderAssignedLabel="Assigned Key/Button"
WaitingHelpText="Select the function you wish to remap and then press [Enter] or Double-Click. Press [Delete] to remove key bindings."
InputHelpText="Please press the key or button you wish to assign to this function. Press [ESC] to cancel."
ReassignedFromLabel="'%s' reassigned from '%s'"
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_OK)
actionButtons(2)=(Action=AB_Reset)
Title="Keyboard/Mouse Settings"
ClientWidth=384
ClientHeight=366
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuCustomizeKeysBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuCustomizeKeysBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuCustomizeKeysBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuCustomizeKeysBackground_4'
textureCols=2
bHelpAlwaysOn=True
helpPosY=312

PendingCommands[Pending] = newCommand;
Pending++;
if ( Pending == 100 )
ProcessPending();


local int i, j, pos;
local string KeyName;
local string Alias;


// First, clear all the existing keybinding display
// strings in the MenuValues[1|2] arrays

for(i=0; i {
MenuValues1[i] = "";
MenuValues2[i] = "";
}

// Now loop through all the keynames and generate
// human-readable versions of keys that are mapped.

for ( i=0; i<255; i++ )
{
KeyName = player.ConsoleCommand ( "KEYNAME "$i );
if ( KeyName != "" )
{
Alias = player.ConsoleCommand( "KEYBINDING "$KeyName );

if ( Alias != "" )
{
pos = InStr(Alias, " " );
if ( pos != -1 )
Alias = Left(Alias, pos);

for ( j=0; j {
if ( AliasNames[j] == Alias )
{
if ( MenuValues1[j] == "" )
MenuValues1[j] = GetKeyDisplayNameFromKeyName(KeyName);
else if ( MenuValues2[j] == "" )
MenuValues2[j] = GetKeyDisplayNameFromKeyName(KeyName);
}
}
}
}
}


if ((KeyName == "F1") || (KeyName == "F2")) // hack - DEUS_EX STM
return false;
else
return true;


local int rowID;
local int rowIndex;


rowID = lstKeys.GetSelectedRow();

if (rowID != 0)
{
rowIndex = lstKeys.RowIdToIndex(rowID);

if (MenuValues2[rowIndex] != "")
{
if (CanRemapKey(MenuValues2[rowIndex]))
{
AddPending("SET InputExt " $ GetKeyFromDisplayName(MenuValues2[rowIndex]));
MenuValues2[rowIndex] = "";
}
}

if (MenuValues1[rowIndex] != "")
{
if (CanRemapKey(MenuValues1[rowIndex]))
{
AddPending("SET InputExt " $ GetKeyFromDisplayName(MenuValues1[rowIndex]));
MenuValues1[rowIndex] = MenuValues2[rowIndex];
MenuValues2[rowIndex] = "";
}
}

// Update the buttons
RefreshKeyBindings();
}


btnHeaderAction = CreateHeaderButton(10, 3, 162, strHeaderActionLabel, winClient);
btnHeaderAssigned = CreateHeaderButton(175, 3, 157, strHeaderAssignedLabel, winClient);

btnHeaderAction.SetSensitivity(False);
btnHeaderAssigned.SetSensitivity(False);


winScroll = CreateScrollAreaWindow(winClient);

winScroll.SetPos(11, 23);
winScroll.SetSize(369, 268);

lstKeys = MenuUIListWindow(winScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
lstKeys.EnableMultiSelect(False);
lstKeys.EnableAutoExpandColumns(False);
lstKeys.EnableHotKeys(False);

lstKeys.SetNumColumns(2);

lstKeys.SetColumnWidth(0, 164);
lstKeys.SetColumnType(0, COLTYPE_String);
lstKeys.SetColumnWidth(1, 205);
lstKeys.SetColumnType(1, COLTYPE_String);


if ( MenuValues1[keyIndex] == "" )
return NoneText;
else if ( MenuValues2[keyIndex] != "" )
return MenuValues1[keyIndex] $ "," @ MenuValues2[keyIndex];
else
return MenuValues1[keyIndex];


local int keyIndex;


for(keyIndex=0; keyIndex {
if (inputKey == keyDisplayNames[keyIndex].inputKey)
{
return keyDisplayNames[keyIndex].DisplayName;
break;
}
}

return mid(string(GetEnum(enum'EInputKey',inputKey)),3);


local int keyIndex;


for(keyIndex=0; keyIndex {
if (mid(string(GetEnum(enum'EInputKey', keyDisplayNames[keyIndex].inputKey)), 3) == keyName)
{
return keyDisplayNames[keyIndex].DisplayName;
break;
}
}

return keyName;


local int keyIndex;


for(keyIndex=0; keyIndex {
if (displayName == keyDisplayNames[keyIndex].displayName)
{
return mid(String(GetEnum(enum'EInputKey', keyDisplayNames[keyIndex].inputKey)), 3);
break;
}
}

return displayName;


Super.InitWindow();

Pending = 0;
Selection = -1;
bWaitingForInput = False;
BuildKeyBindings();

CreateKeyList();
CreateHeaderButtons();
PopulateKeyList();
ShowHelp(WaitingHelpText);


// Show help
ShowHelp(InputHelpText);

selection = lstKeys.RowIdToIndex(rowId);

WaitingForInput(True);

return True;


local int keyIndex;


// First erase the old list
lstKeys.DeleteAllRows();

for(keyIndex=0; keyIndex lstKeys.AddRow(FunctionText[keyIndex] $ ";" $ GetInputDisplayText(keyIndex));


local int i;


// Some keys CANNOT be assigned:
//
// 1. Escape
// 2. Function keys (used by Augs)
// 3. Number keys (used by Object Belt)
// 4. Tilde (used for console)
// 5. Pause (used to pause game)
// 6. Print Screen (Well, duh)

// Make sure the user enters a valid key (Escape and function
// keys can't be assigned)
if ( (KeyName == "") || (KeyName == "Escape") || // Escape
((KeyNo >= 0x70 ) && (KeyNo <= 0x81)) || // Function keys
((KeyNo >= 48) && (KeyNo <= 57)) || // 0 - 9
(KeyName == "Tilde") || // Tilde
(KeyName == "PrintScrn") || // Print Screen
(KeyName == "Pause") ) // Pause
{
return;
}

// Don't waste our time if this key is already assigned here
if (( MenuValues1[Selection] == keyDisplayName ) ||
( MenuValues2[Selection] == keyDisplayName ))
return;

// Now check to make sure there are no overlapping
// assignments.

for ( i=0; i {
if ( MenuValues2[i] == keyDisplayName )
{
ShowHelp(Sprintf(ReassignedFromLabel, keyDisplayName, FunctionText[i]));
AddPending("SET InputExt " $ GetKeyFromDisplayName(MenuValues2[i]));
MenuValues2[i] = "";
}

if ( MenuValues1[i] == keyDisplayName )
{
ShowHelp(Sprintf(ReassignedFromLabel, keyDisplayName, FunctionText[i]));
AddPending("SET InputExt " $ GetKeyFromDisplayName(MenuValues1[i]));
MenuValues1[i] = MenuValues2[i];
MenuValues2[i] = "";
}
}

// Now assign the key, trying the first space if it's empty,
// but using the second space if necessary. If both slots
// are filled, then move the second entry into the first
// and put the new assignment in the second slot.

if ( MenuValues1[Selection] == "" )
{
MenuValues1[Selection] = keyDisplayName;
}
else if ( MenuValues2[Selection] == "" )
{
MenuValues2[Selection] = keyDisplayName;
}
else
{
if (CanRemapKey(MenuValues1[Selection]))
{
// Undo first key assignment
AddPending("SET InputExt " $ GetKeyFromDisplayName(MenuValues1[Selection]));

MenuValues1[Selection] = MenuValues2[Selection];
MenuValues2[Selection] = keyDisplayName;
}
else if (CanRemapKey(MenuValues2[Selection]))
{
// Undo second key assignment
AddPending("SET InputExt " $ GetKeyFromDisplayName(MenuValues2[Selection]));

MenuValues2[Selection] = keyDisplayName;
}

}

AddPending("SET InputExt "$KeyName$" "$AliasNames[Selection]);

// Update the buttons
RefreshKeyBindings();


local int i;


for ( i=0; i player.ConsoleCommand(PendingCommands[i]);

Pending = 0;


local int keyIndex;
local int rowId;


for(keyIndex=0; keyIndex {
rowId = lstKeys.IndexToRowId(keyIndex);
lstKeys.SetField(rowId, 1, GetInputDisplayText(keyIndex));
}


Pending = 0;
Selection = -1;
bWaitingForInput = False;
BuildKeyBindings();
PopulateKeyList();
ShowHelp(WaitingHelpText);


ProcessPending();


if ( !bWaitingForInput )
{
// If the user presses [Delete] or [Backspace], then
// clear this setting
if ((key == IK_Delete) || (key == IK_Backspace))
{
ClearFunction();
return True;
}
else
{
return Super.VirtualKeyPressed(key, bRepeat);
}
}

// First check to see if we're waiting for the user to select a
// keyboard or mouse/joystick button to override.
WaitingForInput(False);

ProcessKeySelection( key, mid(string(GetEnum(enum'EInputKey',key)),3), GetKeyDisplayName(key) );

return True;


if ( bWaiting )
{
ShowHelp(InputHelpText);

SetSelectability(True);
SetFocusWindow(Self);
GrabMouse();

root.LockMouse(True, False);
root.ShowCursor(False);
}
else
{
ShowHelp(WaitingHelpText);

SetSelectability(False);
UngrabMouse();

root.LockMouse(False, False);
root.ShowCursor(True);

// Set the focus back to the list
SetFocusWindow(lstKeys);
}

bWaitingForInput = bWaiting;




choices(0)=Class'DeusEx.MenuChoice_Brightness'
choices(1)=Class'DeusEx.MenuChoice_FullScreen'
choices(2)=Class'DeusEx.MenuChoice_RenderDevice'
choices(3)=Class'DeusEx.MenuChoice_Resolution'
choices(4)=Class'DeusEx.MenuChoice_TextureColorBits'
choices(5)=Class'DeusEx.MenuChoice_WorldTextureDetail'
choices(6)=Class'DeusEx.MenuChoice_ObjectTextureDetail'
choices(7)=Class'DeusEx.MenuChoice_DetailTextures'
choices(8)=Class'DeusEx.MenuChoice_Decals'
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_OK)
actionButtons(2)=(Action=AB_Reset)
Title="Display Settings"
ClientWidth=391
ClientHeight=408
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuDisplayBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuDisplayBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuDisplayBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuDisplayBackground_4'
textureCols=2
helpPosY=354



var MenuUIListWindow lstGames;
var MenuUILabelWindow winSaveInfo;
var MenuUILabelWindow winFreeSpace;
var Window winSnapshot;
var MenuUIListHeaderButtonWindow btnHeaderName;
var MenuUIListHeaderButtonWindow btnHeaderDate;
var MenuUIScrollAreaWindow winScroll;
var MenuUICheckboxWindow chkConfirmDelete;
var MenuUILabelWindow winCheatsEnabled;
var int saveRowId;
var EMessageBoxModes msgBoxMode;
var bool bNameSortOrder;
var bool bDateSortOrder;
var int freeDiskSpace;
var bool bLoadGamePending;
var int loadGameRowId;
var int minFreeDiskSpace;
var localized string strHeaderNameLabel;
var localized string strHeaderDateLabel;
var localized string NewSaveGameButtonText;
var localized string DeleteGameButtonText;
var localized string LoadGameButtonText;
var localized string OverwriteTitle;
var localized string OverwritePrompt;
var localized string DeleteTitle;
var localized string DeletePrompt;
var localized string LoadGameTitle;
var localized string SaveGameTitle;
var localized string SaveInfoMissing_Label;
var localized string TimeAMLabel;
var localized string TimePMLabel;
var localized string LocationLabel;
var localized string SaveCountLabel;
var localized string PlayTimeLabel;
var localized string FileSizeLabel;
var localized string FreeSpaceLabel;
var localized string ConfirmDeleteLabel;
var localized string CheatsEnabledLabel;
bDateSortOrder=True
minFreeDiskSpace=100
strHeaderNameLabel="Name"
strHeaderDateLabel="Date"
NewSaveGameButtonText="New Save Game"
DeleteGameButtonText="Delete Game"
LoadGameButtonText="Load Game"
OverwriteTitle="Overwrite Savegame?"
OverwritePrompt="Are you sure you wish to overwrite this savegame?"
DeleteTitle="Delete Savegame?"
DeletePrompt="Are you sure you wish to delete this savegame?"
LoadGameTitle="Load Game"
SaveGameTitle="Save Game"
SaveInfoMissing_Label="SAVEINFO.DXS Missing!!!"
TimeAMLabel="am"
TimePMLabel="pm"
LocationLabel="Location: %s|n"
SaveCountLabel="Save Count: %d|n"
PlayTimeLabel="Play Time: %s|n"
FileSizeLabel="File Size: %dMB"
FreeSpaceLabel="Free Space: %dMB"
ConfirmDeleteLabel="Confirm Savegame Deletion"
CheatsEnabledLabel="- CHEATS ENABLED -"
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_Other,Text="|&Load Game",Key="LOAD")
actionButtons(2)=(Action=AB_Other,Text="|&Delete Game",Key="DELETE")
Title="Load Game"
ClientWidth=552
ClientHeight=296
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuLoadSaveBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuLoadSaveBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuLoadSaveBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuLoadSaveBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.MenuLoadSaveBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.MenuLoadSaveBackground_6'
bUsesHelpWindow=False
bEscapeSavesSettings=False

if (saveInfo != None)
{
lstGames.AddRow( saveInfo.Description $ ";" $
BuildTimeStringFromInfo(saveInfo) $ ";" $
BuildTimeJulian(saveInfo) $ ";" $
BuildTimeStringFromInfo(saveInfo) $ ";" $
String(saveInfo.DirectoryIndex));
}


local string newName;


// Destroy the msgbox!
root.PopWindow();

switch(msgBoxMode)
{
case MB_Delete:
if ( buttonNumber == 0 )
{
msgBoxMode = MB_None;
DeleteGame(saveRowId);
}
break;

default:
msgBoxMode = MB_None;

}

return true;


local int minutes;
local int hours;


hours = seconds / 3600;
minutes = (seconds / 60) % 60;
seconds = seconds % 60;

return TwoDigits(hours) $ ":" $ TwoDigits(minutes) $ ":" $ TwoDigits(seconds);


local Float retValue;
local Float seconds;


if ( saveInfo == None )
{
retValue = 0;
}
else
{
retValue = (saveInfo.Year - 1990) * 372;
retValue += (saveInfo.Month * 31) + saveInfo.Day;
retValue *= 100000;

seconds = (saveInfo.Hour * 3600) + (saveInfo.Minute * 60) + saveInfo.Second;

retValue += seconds;
}

return retValue;


local String retValue;



if ( saveInfo == None )
{
retValue = "DeusExLevelInfo Missing";
retValue = "";
}
else
{
retValue = BuildTimeString(
saveInfo.Year, saveInfo.Month, saveInfo.Day,
saveInfo.Hour, saveInfo.Minute);
}

return retValue;


local bool bHandled;


bHandled = True;

if (Super.ButtonActivated(buttonPressed))
return True;

switch( buttonPressed )
{
case btnHeaderName:
bNameSortOrder = !bNameSortOrder;
lstGames.SetSortColumn(0, bNameSortOrder);
lstGames.Sort();
break;

case btnHeaderDate:
bDateSortOrder = !bDateSortOrder;
lstGames.SetSortColumn(2, bDateSortOrder);
lstGames.Sort();
break;

default:
bHandled = False;
break;
}

return bHandled;


saveRowId = rowId;
msgBoxMode = MB_Delete;
root.MessageBox(DeleteTitle, DeletePrompt, 0, False, Self);


chkConfirmDelete = MenuUICheckboxWindow(winClient.NewChild(Class'MenuUICheckboxWindow'));

chkConfirmDelete.SetPos(389, 256);
chkConfirmDelete.SetText(ConfirmDeleteLabel);
chkConfirmDelete.SetFont(Font'FontMenuSmall');
chkConfirmDelete.SetToggle(player.bConfirmSaveDeletes);


Super.CreateControls();

CreateGamesList();
CreateHeaderButtons();
CreateSnapshotWindow();
CreateSaveInfoWindow();
CreateFreeSpaceWindow();
CreateConfirmCheckbox();


winFreeSpace = MenuUILabelWindow(winClient.NewChild(Class'MenuUILabelWindow'));
winFreeSpace.SetFont(Font'FontMenuSmall');
winFreeSpace.SetPos(390, 228);
winFreeSpace.SetSize(155, 12);
winFreeSpace.SetTextMargins(0, 0);


winScroll = CreateScrollAreaWindow(winClient);

winScroll.SetPos(11, 22);
winScroll.SetSize(371, 270);

lstGames = MenuUIListWindow(winScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
lstGames.EnableMultiSelect(False);
lstGames.EnableAutoExpandColumns(False);

lstGames.SetNumColumns(5);

lstGames.SetColumnWidth(0, 240);
lstGames.SetColumnType(0, COLTYPE_String);
lstGames.SetColumnWidth(1, 131);
lstGames.SetColumnType(1, COLTYPE_String);
lstGames.SetColumnFont(1, Font'FontFixedWidthSmall');

lstGames.SetColumnType(2, COLTYPE_Float);
lstGames.SetSortColumn(2, bDateSortOrder);
lstGames.EnableAutoSort(True);

lstGames.SetColumnType(4, COLTYPE_Float);

lstGames.HideColumn(2);
lstGames.HideColumn(3);
lstGames.HideColumn(4);


btnHeaderName = CreateHeaderButton(10, 3, 238, strHeaderNameLabel, winClient);
btnHeaderDate = CreateHeaderButton(251, 3, 131, strHeaderDateLabel, winClient);


winSaveInfo = MenuUILabelWindow(winClient.NewChild(Class'MenuUILabelWindow'));

winSaveInfo.SetFont(Font'FontMenuSmall');
winSaveInfo.SetPos(390, 166);
winSaveInfo.SetSize(155, 60);
winSaveInfo.SetTextMargins(0, 0);
winSaveInfo.SetTextAlignments(HALIGN_Left, VALIGN_Center);


winSnapshot = winClient.NewChild(Class'Window');
winSnapshot.SetPos(387, 24);
winSnapshot.SetSize(160, 120);

winCheatsEnabled = MenuUILabelWindow(winSnapShot.NewChild(Class'MenuUILabelWindow'));
winCheatsEnabled.SetPos(0, 0);
winCheatsEnabled.SetSize(160, 120);
winCheatsEnabled.SetTextMargins(0, 0);
winCheatsEnabled.SetText(CheatsEnabledLabel);
winCheatsEnabled.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winCheatsEnabled.Hide();


local int rowIndex;


player.ConsoleCommand("DeleteGame " $ int(lstGames.GetField(rowID, 4)));

// Get the row index so we can highlight it after we delete this item
rowIndex = lstGames.RowIdToIndex(rowID);

// Delete the row
lstGames.DeleteRow(rowID);

// Attempt to highlight the next row
if ( lstGames.GetNumRows() > 0 )
{
if ( rowIndex >= lstGames.GetNumRows() )
rowIndex = lstGames.GetNumRows() - 1;

rowID = lstGames.IndexToRowId(rowIndex);

lstGames.SetRow(rowID);
}

UpdateFreeDiskSpace();

EnableButtons();


player.SaveConfig();
Super.DestroyWindow();


EnableActionButton(AB_Other, (lstGames.GetNumSelectedRows() > 0), "LOAD");

// Cannot delete rows that have a saveindex < 0
if ((lstGames.GetNumSelectedRows() > 0) && (Int(lstGames.GetField(lstGames.GetSelectedRow(), 4)) >= 0))
EnableActionButton(AB_Other, True, "DELETE");
else
EnableActionButton(AB_Other, False, "DELETE");


local GameDirectory saveDir;


// Create our Map Directory class
saveDir = player.CreateGameDirectoryObject();
saveDir.SetDirType(saveDir.EGameDirectoryTypes.GD_SaveGames);
saveDir.GetGameDirectory();

return saveDir;


Super.InitWindow();

// Create controls
PopulateGames();
EnableButtons();
UpdateFreeDiskSpace();

Show();
SetFocusWindow(lstGames);


if (IsKeyDown(IK_Enter))
{
loadGameRowId = rowId;
bLoadGamePending = True;
}
else
{
LoadGame(rowId);
}

return true;


UpdateSaveInfo(focusRowID);
EnableButtons();
return False;


local DeusExPlayer localPlayer;
local int gameIndex;


localPlayer = player;

gameIndex = int(lstGames.GetField(rowId, 4));

localPlayer.LoadGame(gameIndex);


local int saveIndex;
local DeusExSaveInfo saveInfo;
local GameDirectory saveDir;


lstGames.EnableAutoSort(False);
lstGames.DeleteAllRows();

saveDir = GetSaveGameDirectory();

// First check to see if the QuickLoad game exists
saveInfo = saveDir.GetSaveInfo(-1);

if (saveInfo != None)
{
AddSaveRow(saveInfo, -1);
saveDir.DeleteSaveInfo(saveInfo);
}

// Loop through all the files and strip off the filename
// extension

for( saveIndex=0; saveIndex {
saveInfo = saveDir.GetSaveInfoFromDirectoryIndex(saveIndex);

if (saveInfo == None)
{
lstGames.AddRow(SaveInfoMissing_Label $ ";;;;-2");
}
else
{
AddSaveRow(saveInfo, saveIndex);
saveDir.DeleteSaveInfo(saveInfo);
}
}

// Sort the maps by Date
lstGames.EnableAutoSort(True);

CriticalDelete(saveDir);

EnableButtons();


if (actionKey == "LOAD")
{
if (IsKeyDown(IK_Enter))
{
loadGameRowId = lstGames.GetSelectedRow();
bLoadGamePending = True;
}
else
{
LoadGame(lstGames.GetSelectedRow());
}
}
else if (actionKey == "DELETE")
{
// Only confirm
if (chkConfirmDelete.GetToggle())
ConfirmDeleteGame(lstGames.GetSelectedRow());
else
DeleteGame(lstGames.GetSelectedRow());
}


if ((key == IK_Enter) && (iState == IST_Release) && (bLoadGamePending))
{
LoadGame(loadGameRowId);
return True;
}
else
{
return false; // don't handle
}


if (button == chkConfirmDelete)
{
player.bConfirmSaveDeletes = bNewToggle;
return True;
}
else
{
return False;
}


local int trimIndex;
local int trimLength;


if ( trimString == "" )
return trimString;

trimIndex = Len(trimString) - 1;
while ((trimIndex >= 0) && (Mid(trimString, trimIndex, 1) == " ") )
trimIndex--;

if ( trimIndex < 0 )
return "";

trimString = Mid(trimString, 0, trimIndex + 1);

trimIndex = 0;
while((trimIndex < Len(trimString) - 1) && (Mid(trimString, trimIndex, 1) == " "))
trimIndex++;

trimLength = len(trimString) - trimIndex;
trimString = Right(trimString, trimLength);

return trimString;


if ( number < 10 )
return "0" $ number;
else
return String(number);


local GameDirectory saveDir;


saveDir = player.CreateGameDirectoryObject();
freeDiskSpace = saveDir.GetSaveFreeSpace();
winFreeSpace.SetText(Sprintf(FreeSpaceLabel, freeDiskSpace / 1024));

// If free space is below the minimum, show in RED
if ((freeDiskSpace / 1024) < minFreeDiskSpace)
winFreeSpace.SetTextColorRGB(255, 0, 0);
else
winFreeSpace.StyleChanged();

CriticalDelete(savedir);


local DeusExSaveInfo saveInfo;
local GameDirectory saveDir;
local int fileSize;


saveDir = GetSaveGameDirectory();
if (saveDir != None)
{
saveInfo = saveDir.GetSaveInfo(Int(lstGames.GetField(rowId, 4)));

if (saveInfo != None)
{
winSnapshot.SetBackground(saveInfo.Snapshot);
winSaveInfo.SetText(Sprintf(LocationLabel, saveInfo.MissionLocation));
winSaveInfo.AppendText(Sprintf(SaveCountLabel, saveInfo.SaveCount));
winSaveInfo.AppendText(Sprintf(PlayTimeLabel, BuildElapsedTimeString(saveInfo.saveTime)));

// divide to GetSaveDirectorSize by 1024 to get size of directory in MB
// Round up by one for comfort (and so you don't end up with "0MB", only
// possible with really Tiny maps).

fileSize = (saveDir.GetSaveDirectorySize(Int(lstGames.GetField(rowId, 4))) / 1024) + 1;
winSaveInfo.AppendText(Sprintf(FileSizeLabel, fileSize));

// Show the "Cheats Enabled" text if cheats were enabled for this savegame
winCheatsEnabled.Show(saveInfo.bCheatsEnabled);
}
else
{
winSaveInfo.SetText("");
winSnapshot.SetBackground(None);
winCheatsEnabled.Hide();
}

CriticalDelete(saveDir);
}


local bool bKeyHandled;

bKeyHandled = True;

if ( IsKeyDown( IK_Alt ) || IsKeyDown( IK_Shift ) || IsKeyDown( IK_Ctrl ))
return False;

switch( key )
{
case IK_Delete:
if (IsActionButtonEnabled(AB_Other, "DELETE"))
ProcessAction("DELETE");
break;

default:
bKeyHandled = False;
}

if ( !bKeyHandled )
return Super.VirtualKeyPressed(key, bRepeat);
else
return bKeyHandled;




var MenuUIInfoButtonWindow winNameBorder;
var MenuUIEditWindow editCodeName;
var MenuUIEditWindow editName;
var MenuUIListWindow lstSkills;
var MenuUISkillInfoWindow winSkillInfo;
var MenuUIStaticInfoWindow winSkillPoints;
var MenuUIActionButtonWindow btnUpgrade;
var MenuUIActionButtonWindow btnDowngrade;
var ButtonWindow btnLeftArrow;
var ButtonWindow btnRightArrow;
var ButtonWindow btnPortrait;
var Texture texPortraits[5];
var int portraitIndex;
var Skill selectedSkill;
var int selectedRowId;
var int saveSkillPointsAvail;
var int saveSkillPointsTotal;
var float combatDifficulty;
var String filterString;
var Skill localSkills[32];
var localized string ButtonUpgradeLabel;
var localized string ButtonDowngradeLabel;
var localized string HeaderNameLabel;
var localized string HeaderCodeNameLabel;
var localized string HeaderAppearanceLabel;
var localized string HeaderSkillsLabel;
var localized string HeaderSkillPointsLabel;
var localized string HeaderSkillLevelLabel;
var localized string HeaderPointsNeededLabel;
var localized string NameBlankTitle;
var localized string NameBlankPrompt;
texPortraits(0)=Texture'DeusExUI.UserInterface.MenuNewGameJCDenton_1'
texPortraits(1)=Texture'DeusExUI.UserInterface.MenuNewGameJCDenton_2'
texPortraits(2)=Texture'DeusExUI.UserInterface.MenuNewGameJCDenton_3'
texPortraits(3)=Texture'DeusExUI.UserInterface.MenuNewGameJCDenton_4'
texPortraits(4)=Texture'DeusExUI.UserInterface.MenuNewGameJCDenton_5'
filterString="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 "
ButtonUpgradeLabel="Upg|&rade"
ButtonDowngradeLabel="|&Downgrade"
HeaderNameLabel="Real Name"
HeaderCodeNameLabel="Code Name"
HeaderAppearanceLabel="Appearance"
HeaderSkillsLabel="Skills"
HeaderSkillPointsLabel="Skill Points"
HeaderSkillLevelLabel="Skill Level"
HeaderPointsNeededLabel="Points Needed"
NameBlankTitle="Name Blank!"
NameBlankPrompt="The Real Name cannot be blank, please enter a name."
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_Other,Text="|&Start Game",Key="START")
actionButtons(2)=(Action=AB_Reset)
Title="Start New Game"
ClientWidth=580
ClientHeight=389
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuNewGameBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuNewGameBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuNewGameBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuNewGameBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.MenuNewGameBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.MenuNewGameBackground_6'
bUsesHelpWindow=False
bEscapeSavesSettings=False

local Skill aSkill;
local int skillIndex;


skillIndex = 0;

while(localSkills[skillIndex] != None)
{
aSkill = player.SkillSystem.FirstSkill;
while(aSkill != None)
{
if (aSkill.SkillName == localSkills[skillIndex].SkillName)
{
// Copy the skill
aSkill.CurrentLevel = localSkills[skillIndex].GetCurrentLevel();
break;
}
aSkill = aSkill.next;
}
skillIndex++;
}


// Destroy the msgbox!
root.PopWindow();

editName.SetText(player.TruePlayerName);
editName.MoveInsertionPoint(MOVEINSERT_End);
editName.SetSelectedArea(0, Len(editName.GetText()));
SetFocusWindow(editName);

return True;


local String skillString;
local String levelCost;


if ( aSkill.GetCurrentLevel() == 3 )
levelCost = "--";
else
levelCost = String(aSkill.GetCost());

skillString = aSkill.skillName $ ";" $
aSkill.GetCurrentLevelString() $ ";" $
levelCost;

return skillString;


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnUpgrade:
UpgradeSkill();
break;

case btnDowngrade:
DowngradeSkill();
break;

case btnLeftArrow:
PreviousPortrait();
break;

case btnRightArrow:
NextPortrait();
break;

case btnPortrait:
NextPortrait();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated(buttonPressed);

return bHandled;


RestoreSkillPoints();
Super.CancelScreen();


local Skill aSkill;
local int skillIndex;


skillIndex = 0;

aSkill = player.SkillSystem.FirstSkill;
while(aSkill != None)
{
localSkills[skillIndex] = player.Spawn(aSkill.Class);
skillIndex++;
aSkill = aSkill.next;
}


editCodeName = CreateMenuEditWindow(18, 36, 113, 32, winClient);

editCodeName.SetText(player.FamiliarName);
editCodeName.SetSensitivity(False);


Super.CreateControls();

CreatePortraitButton();
CreateLeftArrowButton();
CreateRightArrowButton();
CreateSkillButtons();
CreateTextHeaders();
CreateCodeNameEditWindow();
CreateNameEditWindow();
CreateSkillsListWindow();
CreateSkillInfoWindow();
CreateSkillPointsButton();


btnLeftArrow = ButtonWindow(winClient.NewChild(Class'ButtonWindow'));

btnLeftArrow.SetPos(102, 316);
btnLeftArrow.SetSize(14, 15);

btnLeftArrow.SetButtonTextures(
Texture'MenuLeftArrow_Normal',
Texture'MenuLeftArrow_Pressed');


editName = CreateMenuEditWindow(18, 92, 113, 32, winClient);

editName.SetText(player.TruePlayerName);
editName.MoveInsertionPoint(MOVEINSERT_End);
editName.SetFilter(filterString);


btnPortrait = ButtonWindow(winClient.NewChild(Class'ButtonWindow'));

btnPortrait.SetSize(114, 161);
btnPortrait.SetPos(18, 152);

btnPortrait.SetBackgroundStyle(DSTY_Masked);


btnRightArrow = ButtonWindow(winClient.NewChild(Class'ButtonWindow'));

btnRightArrow.SetPos(117, 316);
btnRightArrow.SetSize(14, 15);

btnRightArrow.SetButtonTextures(
Texture'MenuRightArrow_Normal',
Texture'MenuRightArrow_Pressed');


btnUpgrade = MenuUIActionButtonWindow(winClient.NewChild(Class'MenuUIActionButtonWindow'));
btnUpgrade.SetButtonText(ButtonUpgradeLabel);
btnUpgrade.SetPos(164, 341);
btnUpgrade.SetWidth(74);

btnDowngrade = MenuUIActionButtonWindow(winClient.NewChild(Class'MenuUIActionButtonWindow'));
btnDowngrade.SetButtonText(ButtonDowngradeLabel);
btnDowngrade.SetPos(241, 341);
btnDowngrade.SetWidth(90);


winSkillInfo = MenuUISkillInfoWindow(winClient.NewChild(Class'MenuUISkillInfoWindow'));
winSkillInfo.SetPos(165, 208);


winSkillPoints = MenuUIStaticInfoWindow(winClient.NewChild(Class'MenuUIStaticInfoWindow'));

winSkillPoints.SetPos(487, 341);
winSkillPoints.SetWidth(83);
winSkillPoints.SetSensitivity(False);


lstSkills = MenuUIListWindow(winClient.NewChild(Class'MenuUIListWindow'));

lstSkills.SetSize(397, 150);
lstSkills.SetPos(172,41);
lstSkills.EnableMultiSelect(False);
lstSkills.EnableAutoExpandColumns(False);
lstSkills.SetNumColumns(3);

lstSkills.SetColumnWidth(0, 262);
lstSkills.SetColumnWidth(1, 66);
lstSkills.SetColumnWidth(2, 60);
lstSkills.SetColumnAlignment(2, HALIGN_Right);

lstSkills.SetColumnFont(0, Font'FontMenuHeaders');
lstSkills.SetSortColumn(0, False);
lstSkills.EnableAutoSort(True);


local MenuUILabelWindow winLabel;


CreateMenuLabel( 21, 17, HeaderCodeNameLabel, winClient);
CreateMenuLabel( 21, 73, HeaderNameLabel, winClient);
CreateMenuLabel( 21, 133, HeaderAppearanceLabel, winClient);
CreateMenuLabel(172, 17, HeaderSkillsLabel, winClient);

winLabel = CreateMenuLabel(430, 18, HeaderSkillLevelLabel, winClient);
winLabel.SetFont(Font'FontMenuSmall');

winLabel = CreateMenuLabel(505, 18, HeaderPointsNeededLabel, winClient);
winLabel.SetFont(Font'FontMenuSmall');

CreateMenuLabel(409, 344, HeaderSkillPointsLabel, winClient);


local int skillIndex;


skillIndex = 0;

while(localSkills[skillIndex] != None)
{
localSkills[skillIndex].Destroy();
localSkills[skillIndex] = None;
skillIndex++;
}


DestroyLocalSkills();


// First make sure we have a skill selected
if ( selectedSkill == None )
return;

selectedSkill.DecLevel(True, Player);
lstSkills.ModifyRow(selectedRowId, BuildSkillString( selectedSkill ));

UpdateSkillPoints();
EnableButtons();


if (IsActionButtonEnabled(AB_Other, "START"))
{
ProcessAction("START");
return True;
}
else
{
return False;
}


// Abort if a skill item isn't selected
if ( selectedSkill == None )
{
btnUpgrade.SetSensitivity( False );
btnDowngrade.SetSensitivity( False );
}
else
{
// Upgrade Skill only available if the skill is not at
// the maximum -and- the user has enough skill points
// available to upgrade the skill

btnUpgrade.EnableWindow(selectedSkill.CanAffordToUpgrade(player.SkillPointsAvail));
btnDowngrade.EnableWindow(selectedSkill.GetCurrentLevel() > 0);
}

// Only enable the OK button if the player has entered a name
if (editName != None)
{
if (editName.GetText() == "")
EnableActionButton(AB_Other, False, "START");
else
EnableActionButton(AB_Other, True, "START");
}


Super.InitWindow();

SaveSkillPoints();
ResetToDefaults();

// Need to do this because of the edit control used for
// saving games.
SetMouseFocusMode(MFOCUS_Click);

Show();
SetFocusWindow(editName);
editName.SetSelectedArea(0, Len(editName.GetText()));
combatDifficulty = player.Default.CombatDifficulty;

StyleChanged();


UpgradeSkill();
return True;


local Skill aSkill;


selectedSkill = Skill(ListWindow(list).GetRowClientObject(focusRowId));
selectedRowId = focusRowId;

winSkillInfo.SetSkill(selectedSkill);

EnableButtons();

return True;


portraitIndex++;

if (portraitIndex == arrayCount(texPortraits))
portraitIndex = 0;

btnPortrait.SetBackground(texPortraits[portraitIndex]);


local int skillIndex;
local int rowIndex;


lstSkills.DeleteAllRows();
skillIndex = 0;

// Iterate through the skills, adding them to our list
while(localSkills[skillIndex] != None)
{
rowIndex = lstSkills.AddRow(BuildSkillString(localSkills[skillIndex]));
lstSkills.SetRowClientObject(rowIndex, localSkills[skillIndex]);

skillIndex++;
}
lstSkills.Sort();
lstSkills.SetRow(lstSkills.IndexToRowId(0), False);


portraitIndex--;

if (portraitIndex < 0)
portraitIndex = arrayCount(texPortraits) - 1;

btnPortrait.SetBackground(texPortraits[portraitIndex]);


local DeusExPlayer localPlayer;
local String localStartMap;
local String playerName;


localPlayer = player;
// localStartMap = strStartMap;

if (actionKey == "START")
{
// Make sure the name isn't blank
playerName = TrimSpaceS(editName.GetText());

if (playerName == "")
{
root.MessageBox(NameBlankTitle, NameBlankPrompt, 1, False, Self);
}
else
{
SaveSettings();

// DEUS_EX_DEMO
//
// Don't show the intro for the demo since that map is not available
localPlayer.ShowIntro(True);
// localPlayer.StartNewGame(localPlayer.strStartMap);
}
}


editName.SetText(player.TruePlayerName);

player.SkillPointsAvail = player.Default.SkillPointsAvail;
player.SkillPointsTotal = player.Default.SkillPointsTotal;

portraitIndex = 0;
btnPortrait.SetBackground(texPortraits[portraitIndex]);

CopySkills();
PopulateSkillsList();
UpdateSkillPoints();
EnableButtons();


player.SkillPointsAvail = saveSkillPointsAvail;
player.SkillPointsAvail = saveSkillPointsTotal;


ApplySkills();
player.TruePlayerName = editName.GetText();
player.PlayerSkin = portraitIndex;
player.CombatDifficulty = combatDifficulty;


saveSkillPointsAvail = player.SkillPointsAvail;
saveSkillPointsTotal = player.SkillPointsAvail;


combatDifficulty = newDifficulty;


local ColorTheme theme;
local Color colButtonFace;


Super.StyleChanged();

theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colButtonFace = theme.GetColorFromName('MenuColor_ButtonFace');

btnLeftArrow.SetButtonColors(colButtonFace, colButtonFace, colButtonFace,
colButtonFace, colButtonFace, colButtonFace);
btnRightArrow.SetButtonColors(colButtonFace, colButtonFace, colButtonFace,
colButtonFace, colButtonFace, colButtonFace);


EnableButtons();

return false;


local int trimIndex;
local int trimLength;


if ( trimString == "" )
return trimString;

trimIndex = Len(trimString) - 1;
while ((trimIndex >= 0) && (Mid(trimString, trimIndex, 1) == " ") )
trimIndex--;

if ( trimIndex < 0 )
return "";

trimString = Mid(trimString, 0, trimIndex + 1);

trimIndex = 0;
while((trimIndex < Len(trimString) - 1) && (Mid(trimString, trimIndex, 1) == " "))
trimIndex++;

trimLength = len(trimString) - trimIndex;
trimString = Right(trimString, trimLength);

return trimString;


winSkillPoints.SetButtonText(String(player.SkillPointsAvail));


// First make sure we have a skill selected
if ( selectedSkill == None )
return;

selectedSkill.IncLevel(player);
lstSkills.ModifyRow(selectedRowId, BuildSkillString( selectedSkill ));

UpdateSkillPoints();
EnableButtons();




choices(0)=Class'DeusEx.MenuChoice_ObjectNames'
choices(1)=Class'DeusEx.MenuChoice_WeaponAutoReload'
choices(2)=Class'DeusEx.MenuChoice_GoreLevel'
choices(3)=Class'DeusEx.MenuChoice_Subtitles'
choices(4)=Class'DeusEx.MenuChoice_Crosshairs'
choices(5)=Class'DeusEx.MenuChoice_HUDAugDisplay'
choices(6)=Class'DeusEx.MenuChoice_UIBackground'
choices(7)=Class'DeusEx.MenuChoice_HeadBob'
choices(8)=Class'DeusEx.MenuChoice_LogTimeoutValue'
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_OK)
actionButtons(2)=(Action=AB_Reset)
Title="Options"
ClientWidth=537
ClientHeight=406
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuGameOptionsBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuGameOptionsBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuGameOptionsBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuGameOptionsBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.MenuGameOptionsBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.MenuGameOptionsBackground_6'
helpPosY=354

Super.SaveSettings();
player.SaveConfig();




var ColorTheme currentTheme;
var Name currentColorName;
var Bool bInitializing;
var EColorThemeTypes themeMode;
var MenuUITabButtonWindow btnTabHUD;
var MenuUITabButtonWindow btnTabMenus;
var MenuUIActionButtonWindow btnActionRed;
var MenuUIActionButtonWindow btnActionGreen;
var MenuUIActionButtonWindow btnActionBlue;
var MenuUIRGBSliderButtonWindow btnSliderRed;
var MenuUIRGBSliderButtonWindow btnSliderGreen;
var MenuUIRGBSliderButtonWindow btnSliderBlue;
var MenuUIListWindow lstColors;
var MenuUILabelWindow txtTheme;
var MenuUICheckboxWindow chkMenuTranslucent;
var MenuUICheckboxWindow chkHUDBackgroundTranslucent;
var MenuUICheckboxWindow chkHUDBordersTranslucent;
var MenuScreenRGB_MenuExample winMenuExample;
var MenuScreenRGB_HUDExample winHUDExample;
var localized string HUDBackgroundTranslucentLabel;
var localized string HUDBordersTranclucentLabel;
var localized string MenusBackgroundTranslucentLabel;
var localized string RedLabel;
var localized string GreenLabel;
var localized string BlueLabel;
var localized string TabHUDLabel;
var localized string TabMenusLabel;
var localized string ThemeLabel;
HUDBackgroundTranslucentLabel="HUD Back|&grounds Translucent"
HUDBordersTranclucentLabel="HUD Bor|&ders Translucent"
MenusBackgroundTranslucentLabel="Menu Back|&grounds Translucent"
RedLabel="R|&ed"
GreenLabel="|&Green"
BlueLabel="|&Blue"
TabHUDLabel="|&HUD"
TabMenusLabel="|&Menus"
ThemeLabel="Theme:"
choiceVerticalGap=27
choiceStartX=19
choiceStartY=20
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Other,Text="|&Close",Key="CLOSE")
actionButtons(1)=(Align=HALIGN_Right,Action=AB_Other,Text="|&Load",Key="LOAD")
actionButtons(2)=(Align=HALIGN_Right,Action=AB_Other,Text="|&Save",Key="SAVE")
actionButtons(3)=(Action=AB_Reset)
Title="Color Selection"
ClientWidth=603
ClientHeight=425
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuRGBBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuRGBBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuRGBBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuRGBBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.MenuRGBBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.MenuRGBBackground_6'

return color.r $ "," $ color.g $ "," $ color.b;


local bool bHandled;


bHandled = True;

Super.ButtonActivated(buttonPressed);

switch( buttonPressed )
{
case btnTabHUD:
SetThemeMode(CTT_HUD);
break;

case btnTabMenus:
SetThemeMode(CTT_Menu);
break;

case btnActionRed:
CycleNextColor(btnSliderRed);
break;

case btnActionGreen:
CycleNextColor(btnSliderGreen);
break;

case btnActionBlue:
CycleNextColor(btnSliderBlue);
break;

default:
bHandled = False;
break;
}

return bHandled;


local bool bHandled;


bHandled = True;

Super.ButtonActivated(buttonPressed);

switch( buttonPressed )
{
case btnActionRed:
CyclePreviousColor(btnSliderRed);
break;

case btnActionGreen:
CyclePreviousColor(btnSliderGreen);
break;

case btnActionBlue:
CyclePreviousColor(btnSliderBlue);
break;

default:
bHandled = False;
break;
}

return bHandled;


Super.CancelScreen();


chkMenuTranslucent = MenuUICheckboxWindow(winClient.NewChild(Class'MenuUICheckboxWindow'));

chkMenuTranslucent.SetPos(77, 136);
chkMenuTranslucent.SetText(MenusBackgroundTranslucentLabel);

chkHUDBackgroundTranslucent = MenuUICheckboxWindow(winClient.NewChild(Class'MenuUICheckboxWindow'));

chkHUDBackgroundTranslucent.SetPos(77, 136);
chkHUDBackgroundTranslucent.SetText(HUDBackgroundTranslucentLabel);

chkHUDBordersTranslucent = MenuUICheckboxWindow(winClient.NewChild(Class'MenuUICheckboxWindow'));

chkHUDBordersTranslucent.SetPos(77, 157);
chkHUDBordersTranslucent.SetText(HUDBordersTranclucentLabel);


local MenuUIActionButtonwindow btnAction;


btnAction = MenuUIActionButtonWindow(winClient.NewChild(Class'MenuUIActionButtonWindow'));
btnAction.SetPos(19, posY + 1);
btnAction.SetSize(54, 19);
btnAction.SetText(textLabel);
btnAction.EnableRightMouseClick();
btnAction.SetCenterText(True);

return btnAction;


local MenuUIRGBSliderButtonWindow btnSlider;


btnSlider = MenuUIRGBSliderButtonWindow(winClient.NewChild(Class'MenuUIRGBSliderButtonWindow'));
btnSlider.SetPos(77, posY);
btnSlider.SetTicks(256, 0, 255);

SetEnumerators(btnSlider);

return btnSlider;


local MenuUIScrollAreaWindow winScroll;


winScroll = CreateScrollAreaWindow(winClient);
winScroll.SetSize(248, 171);
winScroll.SetPos(335, 37);

lstColors = MenuUIListWindow(winScroll.clipWindow.NewChild(Class'MenuUIListWindow'));

lstColors.SetNumColumns(2);
lstColors.SetColumnWidth(0, 181);
lstColors.SetColumnType(0, COLTYPE_String);
lstColors.SetColumnWidth(1, 67);
lstColors.SetColumnType(1, COLTYPE_String);


Super.CreateControls();

CreateTabs();
CreateCheckboxes();
CreateColorsList();

// Create Action Buttons
btnActionRed = CreateColorActionButton(41, RedLabel);
btnActionGreen = CreateColorActionButton(68, GreenLabel);
btnActionBlue = CreateColorActionButton(95, BlueLabel);

// Create Sliders
btnSliderRed = CreateColorSlider(41);
btnSliderGreen = CreateColorSlider(68);
btnSliderBlue = CreateColorSlider(95);

// Theme Label
txtTheme = CreateMenuLabel(336, 12, ThemeLabel, winClient);

// Create Examples
CreateHUDExample();
CreateMenuExample();


winHUDExample = MenuScreenRGB_HUDExample(winClient.NewChild(Class'MenuScreenRGB_HUDExample'));
winHUDExample.SetPos(131, 240);


winMenuExample = MenuScreenRGB_MenuExample(winClient.NewChild(Class'MenuScreenRGB_MenuExample', False));
winMenuExample.SetPos(85, 226);


btnTabHUD = CreateMenuUITab(19, 10, TabHUDLabel);
btnTabMenus = CreateMenuUITab(90, 10, TabMenusLabel);


local int newValue;


if (btnSlider != None)
{
// Get the current slider value and attempt to increment.
// If at the max go back to the beginning

newValue = btnSlider.winSlider.GetTickPosition() + 1;

if (newValue == btnSlider.winSlider.GetNumTicks())
newValue = 0;

btnSlider.winSlider.SetTickPosition(newValue);
}


local int newValue;


if (btnSlider != None)
{
// Get the current slider value and attempt to increment.
// If at the max go back to the beginning

newValue = btnSlider.winSlider.GetTickPosition() - 1;

if (newValue < 0)
newValue = btnSlider.winSlider.GetNumTicks() - 1;

btnSlider.winSlider.SetTickPosition(newValue);
}


bInitializing = True;

Super.InitWindow();

SetThemeMode(CTT_Menu);
SetMouseFocusMode(MFOCUS_Click);

bInitializing = False;


local String colorStringName;
local Name colorName;
local Color color;


// Do this only if a single row is selected
if (lstColors.GetNumSelectedRows() == 1)
{
// Find the color!
colorStringName = lstColors.GetField(lstColors.GetSelectedRow(), 0);

// Store the name away
currentColorName = StringToName(colorStringName);

// Get the color
color = currentTheme.GetColorFromName(currentColorName);

// Apply to sliders
btnSliderRed.winSlider.SetTickPosition(color.r);
btnSliderGreen.winSlider.SetTickPosition(color.g);
btnSliderBlue.winSlider.SetTickPosition(color.b);
}
return True;


local Name colorName;
local Color color;
local int colorIndex;


lstColors.DeleteAllRows();

if (currentTheme != None)
{
for(colorIndex=0; colorIndex {
lstColors.AddRow(currentTheme.GetColorName(colorIndex) $ ";" $
BuildRGBString(currentTheme.GetColor(colorIndex)));
}

// Select the first item in the list
if (lstColors.GetNumRows() > 0)
lstColors.SelectRow(lstColors.IndexToRowId(0));
}


local MenuScreenThemesLoad menuLoad;


if (actionKey == "SAVE")
{
menuLoad = MenuScreenThemesLoad(root.PushWindow(Class'MenuScreenThemesSave', True));
menuLoad.SetRGBWindow(Self);
if (themeMode == CTT_Menu)
menuLoad.SetThemeType(0);
else
menuLoad.SetThemeType(1);
}
else if (actionKey == "LOAD")
{
menuLoad = MenuScreenThemesLoad(root.PushWindow(Class'MenuScreenThemesLoad', True));
menuLoad.SetRGBWindow(Self);
if (themeMode == CTT_Menu)
menuLoad.SetThemeType(0);
else
menuLoad.SetThemeType(1);
}
else if (actionKey == "CLOSE")
{
root.PopWindow();
}
else
{
Super.ProcessAction(actionKey);
}


local ColorTheme theme;


if (currentTheme != None)
{
currentTheme.ResetThemeToDefault();
PopulateColorsList();
ChangeStyle();
lstColors.SelectRow(lstColors.IndexToRowId(0));
}


local int enumIndex;


for(enumIndex=0;enumIndex<256;enumIndex++)
btnSlider.winSlider.SetEnumeration(enumIndex, enumIndex);


currentTheme = newTheme;

if (currentTheme != None)
{
UpdateThemeText();
PopulateColorsList();
UpdateCheckBoxes();
ChangeStyle();
}


local ColorTheme theme;


if (themeMode == CTT_Menu)
theme = player.ThemeManager.SetMenuThemeByName(themeStringName);
else
theme = player.ThemeManager.SetHUDThemeByName(themeStringName);

SetTheme(theme);


themeMode = newThemeMode;

if (themeMode == CTT_Menu)
{
SetTheme(player.ThemeManager.GetCurrentMenuColorTheme());
}
else
{
SetTheme(player.ThemeManager.GetCurrentHUDColorTheme());
}

// Update tabs appopriately
btnTabHUD.EnableWindow(themeMode == CTT_Menu);
btnTabMenus.EnableWindow(themeMode == CTT_HUD);

// Show and Hide the appropriate example
winMenuExample.Show(themeMode == CTT_Menu);
winHUDExample.Show(themeMode == CTT_HUD);


local int value;


value = Clamp(int(TextWindow(edit).GetText()), 0, 255);

if (edit.GetParent() == btnSliderRed)
btnSliderRed.winSlider.SetTickPosition(value);
else if (edit.GetParent() == btnSliderGreen)
btnSliderGreen.winSlider.SetTickPosition(value);
else if (edit.GetParent() == btnSliderBlue)
btnSliderBlue.winSlider.SetTickPosition(value);

return false;


if (button == chkMenuTranslucent)
{
player.SetMenuTranslucency(bToggleValue);
}
else if (button == chkHUDBackgroundTranslucent)
{
player.SetHUDBackgroundTranslucency(bToggleValue);
}
else if (button == chkHUDBordersTranslucent)
{
player.SetHUDBorderTranslucency(bToggleValue);
}

ChangeStyle();


chkHUDBackgroundTranslucent.Show(themeMode == CTT_HUD);
chkHUDBordersTranslucent.Show(themeMode == CTT_HUD);
chkMenuTranslucent.Show(themeMode == CTT_Menu);

if (themeMode == CTT_HUD)
{
chkHUDBackgroundTranslucent.SetToggle(player.GetHUDBackgroundTranslucency());
chkHUDBordersTranslucent.SetToggle(player.GetHUDBorderTranslucency());
}
else
{
chkMenuTranslucent.SetToggle(player.GetMenuTranslucency());
}


if (currentTheme != None)
txtTheme.SetText(ThemeLabel @ currentTheme.GetThemeName());
else
txtTheme.SetText("");




var DeusExPlayer player;
var PersonaTitleTextWindow winTextTitle;
var PersonaHeaderTextWindow winTextHeader;
var PersonaNormalTextWindow winTextNormal;
var TextWindow winTextGoal;
var TextWindow winTextListNormal;
var TextWindow winTextListHighlight;
var TextWindow winTextListFocus;
var TextWindow winTextEditSelected;
var TextWindow winTextButtonDisabled;
var TextWindow winTextButtonNormal;
var TextWindow winTextButtonFocus;
var TextWindow winTextButtonPressed;
var Window winBackground;
var Window winBorder;
var Window winButtonNormal;
var Window winButtonPressed;
var Window winListHighlight;
var Window winListFocus;
var Color colBackground;
var Color colBorders;
var Color colListFocus;
var Texture texListFocusBorders[9];
var bool bBorderTranslucent;
var bool bBackgroundTranslucent;
var localized String TitleLabel;
var localized String HeaderLabel;
var localized String TextNormalLabel;
var localized String GoalCompletedLabel;
var localized String ListLabel;
var localized String ListHighlightLabel;
var localized String ListFocusLabel;
var localized String EditSelectedLabel;
var localized String ButtonDisabledLabel;
var localized String ButtonNormalLabel;
var localized String ButtonFocusLabel;
var localized String ButtonPressedLabel;
texListFocusBorders(0)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(1)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(2)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(3)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(4)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(5)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(6)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(7)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
TitleLabel="Title"
HeaderLabel="Header"
TextNormalLabel="Normal"
GoalCompletedLabel="Completed Goal"
ListLabel="List Item"
ListHighlightLabel="List Highlight"
ListFocusLabel="List Focus"
EditSelectedLabel="Edit Text"
ButtonDisabledLabel="Disabled"
ButtonNormalLabel="Normal"
ButtonFocusLabel="Focus"
ButtonPressedLabel="Pressed"

winButtonNormal = NewChild(Class'Window');
winButtonNormal.SetBackgroundStyle(DSTY_Translucent);
winButtonNormal.SetBackground(Texture'RGB_HUDButton_Normal');
winButtonNormal.SetSize(205, 16);
winButtonNormal.SetPos(23, 131);

winButtonPressed = NewChild(Class'Window');
winButtonPressed.SetBackgroundStyle(DSTY_Translucent);
winButtonPressed.SetBackground(Texture'RGB_HUDButton_Pressed');
winButtonPressed.SetSize(75, 16);
winButtonPressed.SetPos(228, 131);

winListHighlight = NewChild(Class'Window');
winListHighlight.SetBackgroundStyle(DSTY_Normal);
winListHighlight.SetBackground(Texture'Solid');
winListHighlight.SetSize(290, 11);
winListHighlight.SetPos(28, 87);

winListFocus = NewChild(Class'Window');
winListFocus.SetBackgroundStyle(DSTY_Normal);
winListFocus.SetBackground(Texture'Solid');
winListFocus.SetSize(290, 11);
winListFocus.SetPos(28, 99);

// Title
winTextTitle = PersonaTitleTextWindow(NewChild(Class'PersonaTitleTextWindow'));
winTextTitle.SetPos(23, 7);
winTextTitle.SetText(TitleLabel);

// Header
winTextHeader = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
winTextHeader.SetPos(32, 26);
winTextHeader.SetText(HeaderLabel);

// Normal Text
winTextNormal = PersonaNormalTextWindow(NewChild(Class'PersonaNormalTextWindow'));
winTextNormal.SetPos(38, 40);
winTextNormal.SetText(TextNormalLabel);

winTextGoal = CreateTextWindow( 38, 52, GoalCompletedLabel, Font'FontMenuSmall');
winTextListNormal = CreateTextWindow( 32, 75, ListLabel, Font'FontMenuSmall');
winTextListHighlight = CreateTextWindow( 32, 88, ListHighlightLabel, Font'FontMenuSmall');
winTextListFocus = CreateTextWindow( 32, 100, ListFocusLabel, Font'FontMenuSmall');
winTextEditSelected = CreateTextWindow( 32, 113, EditSelectedLabel, Font'FontMenuSmall');
winTextButtonDisabled = CreateTextWindow( 29, 134, ButtonDisabledLabel, Font'FontMenuHeaders');
winTextButtonNormal = CreateTextWindow(104, 134, ButtonNormalLabel, Font'FontMenuHeaders');
winTextButtonFocus = CreateTextWindow(169, 134, ButtonFocusLabel, Font'FontMenuHeaders');
winTextButtonPressed = CreateTextWindow(235, 134, ButtonPressedLabel, Font'FontMenuHeaders');


local TextWindow winText;


winText = TextWindow(NewChild(Class'TextWindow'));
winText.SetPos(posX, posY);
winText.SetText(label);
winText.SetFont(font);
winText.SetTextMargins(0, 0);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);

return winText;


// Draw the borders then the background
if (bBorderTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBorders);
gc.DrawTexture( 0, 0, 256, 153, 0, 0, Texture'RGB_HUDSampleBorder_1');
gc.DrawTexture(256, 0, 90, 153, 0, 0, Texture'RGB_HUDSampleBorder_2');

// Background
if (bBackgroundTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBackground);
gc.DrawTexture( 13, 2, 256, 146, 0, 0, Texture'RGB_HUDSampleBackground_1');
gc.DrawTexture(269, 2, 62, 146, 0, 0, Texture'RGB_HUDSampleBackground_2');


Super.InitWindow();

SetSize(346, 153);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

CreateControls();
StyleChanged();


// List focus border
gc.SetTileColor(colListFocus);
gc.SetStyle(DSTY_Normal);
gc.DrawBorders(28, 99, 290, 12, 0, 0, 0, 0, texListFocusBorders);


local ColorTheme theme;
local Color colText;
local Color colCursor;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colBackground = theme.GetColorFromName('HUDColor_Background');
colBorders = theme.GetColorFromName('HUDColor_Borders');

winButtonNormal.SetTileColor(theme.GetColorFromName('HUDColor_ButtonFace'));
winButtonPressed.SetTileColor(theme.GetColorFromName('HUDColor_ButtonFace'));

winListHighlight.SetTileColor(theme.GetColorFromName('HUDColor_ListHighlight'));
winListFocus.SetTileColor(theme.GetColorFromName('HUDColor_ListHighlight'));
colListFocus = theme.GetColorFromName('HUDColor_ListFocus');

winTextTitle.SetTextColor(theme.GetColorFromName('HUDColor_TitleText'));
winTextHeader.SetTextColor(theme.GetColorFromName('HUDColor_HeaderText'));
winTextNormal.SetTextColor(theme.GetColorFromName('HUDColor_NormalText'));

colText = theme.GetColorFromName('HUDColor_NormalText');
winTextGoal.SetTextColorRGB(colText.r / 2, colText.g / 2, colText.b / 2);

winTextListNormal.SetTextColor(theme.GetColorFromName('HUDColor_ListText'));
winTextListHighlight.SetTextColor(theme.GetColorFromName('HUDColor_ListTextHighlight'));
winTextListFocus.SetTextColor(theme.GetColorFromName('HUDColor_ListTextHighlight'));
winTextEditSelected.SetTextColor(theme.GetColorFromName('HUDColor_ListText'));
winTextButtonDisabled.SetTextColor(theme.GetColorFromName('HUDColor_ButtonTextDisabled'));
winTextButtonNormal.SetTextColor(theme.GetColorFromName('HUDColor_ButtonTextNormal'));
winTextButtonFocus.SetTextColor(theme.GetColorFromName('HUDColor_ButtonTextFocus'));
winTextButtonPressed.SetTextColor(theme.GetColorFromName('HUDColor_ButtonTextNormal'));

// Cursor!
colCursor = theme.GetColorFromName('HUDColor_Cursor');
SetDefaultCursor(Texture'DeusExCursor2', Texture'DeusExCursor2_Shadow', 32, 32, colCursor);

bBorderTranslucent = player.GetHUDBorderTranslucency();
bBackgroundTranslucent = player.GetHUDBackgroundTranslucency();




var DeusExPlayer player;
var Window winTitle;
var Window winTitleBubble;
var Window winActionButtonDisabled;
var Window winActionButtonNormal;
var Window winActionButtonFocus;
var Window winActionButtonPressed;
var Window winMenuButtonDisabled;
var Window winMenuButtonNormal;
var Window winMenuButtonFocus;
var Window winMenuButtonPressed;
var Window winSmallButtonNormal;
var Window winSmallButtonPressed;
var Window winScroll;
var Window winListFocus;
var TextWindow winTextButtonMenuDisabled;
var TextWindow winTextButtonMenuNormal;
var TextWindow winTextButtonMenuFocus;
var TextWindow winTextButtonMenuPressed;
var TextWindow winTextButtonSmallNormal;
var TextWindow winTextButtonSmallPressed;
var TextWindow winTextButtonActionDisabled;
var TextWindow winTextButtonActionNormal;
var TextWindow winTextButtonActionFocus;
var TextWindow winTextButtonActionPressed;
var TextWindow winTextList;
var TextWindow winTextListFocus;
var TextWindow winTextEdit;
var TextWindow winTextTitle;
var Color colBackground;
var Color colListFocus;
var Font fontMenuButtonText;
var Texture texListFocusBorders[9];
var bool bBackgroundTranslucent;
var localized String ButtonMenuDisabledLabel;
var localized String ButtonMenuNormalLabel;
var localized String ButtonMenuFocusLabel;
var localized String ButtonMenuPressedLabel;
var localized String ButtonSmallPressedLabel;
var localized String ButtonSmallNormalLabel;
var localized String ButtonActionDisabledLabel;
var localized String ButtonActionNormalLabel;
var localized String ButtonActionFocusLabel;
var localized String ButtonActionPressedLabel;
var localized String ListNormalLabel;
var localized String ListFocusLabel;
var localized String EditLabel;
var localized String TitleLabel;
texListFocusBorders(0)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(1)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(2)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(3)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(4)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(5)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(6)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
texListFocusBorders(7)=Texture'DeusExUI.UserInterface.RGB_ListSelectionBorder'
ButtonMenuDisabledLabel="Disabled"
ButtonMenuNormalLabel="Normal"
ButtonMenuFocusLabel="Focus"
ButtonMenuPressedLabel="Pressed"
ButtonSmallPressedLabel="Pressed"
ButtonSmallNormalLabel="Normal"
ButtonActionDisabledLabel="Disabled"
ButtonActionNormalLabel="Normal"
ButtonActionFocusLabel="Focus"
ButtonActionPressedLabel="Pressed"
ListNormalLabel="Normal"
ListFocusLabel="Focus"
EditLabel="Edit"
TitleLabel="Title"

local Window winButton;


winButton = NewChild(Class'Window');
winButton.SetPos(posX, posY);
winButton.SetSize(83, 19);
winButton.SetBackgroundStyle(DSTY_Masked);
winButton.SetBackground(buttonBackground);

return winButton;


local TextWindow winText;


winText = TextWindow(NewChild(Class'TextWindow'));
winText.SetPos(posX, posY);
winText.SetTextMargins(0, 0);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winText.SetText(label);
winText.SetFont(Font'FontMenuTitle');

return winText;


local Window winIcon;


// Load the menu font from the DXFonts package
fontMenuButtonText = Font(DynamicLoadObject("DXFonts.MainMenuTrueType", Class'Font'));

// Title bar graphic
winTitle = NewChild(Class'Window');
winTitle.SetPos(0, 0);
winTitle.SetSize(195, 75);
winTitle.SetBackgroundStyle(DSTY_Masked);
winTitle.SetBackground(Texture'RGB_MenuTitleBarBackground');

// Title bar bubble
winTitleBubble = NewChild(Class'Window');
winTitleBubble.SetPos(3, 2);
winTitleBubble.SetSize(168, 18);
winTitleBubble.SetBackgroundStyle(DSTY_Masked);
winTitleBubble.SetBackground(Texture'RGB_MenuTitleBar');

// Title Text
winTextTitle = CreateActionText(32, 5, TitleLabel);

// Title bar icon
winIcon = NewChild(Class'Window');
winIcon.SetPos(12, 3);
winIcon.SetSize(16, 16);
winIcon.SetBackground(Texture'MenuIcon_DeusEx');

// List focus
winListFocus = NewChild(Class'Window');
winListFocus.SetBackgroundStyle(DSTY_Normal);
winListFocus.SetBackground(Texture'Solid');
winListFocus.SetSize(148, 11);
winListFocus.SetPos(252, 64);

// List Text
winTextList = CreateListText(255, 53, ListNormalLabel);
winTextListFocus = CreateListText(255, 65, ListFocusLabel);
winTextEdit = CreateListText(255, 77, EditLabel);

// Scroll bar graphics
winScroll = NewChild(Class'Window');
winScroll.SetPos(401, 50);
winScroll.SetSize(15, 93);
winScroll.SetBackgroundStyle(DSTY_Masked);
winScroll.SetBackground(Texture'RGB_MenuScrollBar');

// Button Menu Backgrounds
winMenuButtonDisabled = CreateMenuButton(17, 31, Texture'RGB_MenuButtonLarge_Normal');
winMenuButtonNormal = CreateMenuButton(17, 61, Texture'RGB_MenuButtonLarge_Normal');
winMenuButtonFocus = CreateMenuButton(17, 91, Texture'RGB_MenuButtonLarge_Focus');
winMenuButtonPressed = CreateMenuButton(17, 121, Texture'RGB_MenuButtonLarge_Pressed');

// Button Menu Text
winTextButtonMenuDisabled = CreateMenuText(32, 32, ButtonMenuDisabledLabel);
winTextButtonMenuNormal = CreateMenuText(32, 62, ButtonMenuNormalLabel);
winTextButtonMenuFocus = CreateMenuText(32, 92, ButtonMenuFocusLabel);
winTextButtonMenuPressed = CreateMenuText(32, 123, ButtonMenuPressedLabel);

// Action Buttons
winActionButtonDisabled = CreateActionButton( 11, 158, Texture'RGB_MenuButtonSmall_Normal');
winActionButtonNormal = CreateActionButton(172, 158, Texture'RGB_MenuButtonSmall_Normal');
winActionButtonFocus = CreateActionButton(256, 158, Texture'RGB_MenuButtonSmall_Normal');
winActionButtonPressed = CreateActionButton(340, 158, Texture'RGB_MenuButtonSmall_Pressed');

// Action Button Text
winTextButtonActionDisabled = CreateActionText( 19, 162, ButtonActionDisabledLabel);
winTextButtonActionNormal = CreateActionText(181, 162, ButtonActionNormalLabel);
winTextButtonActionFocus = CreateActionText(265, 162, ButtonActionFocusLabel);
winTextButtonActionPressed = CreateActionText(349, 162, ButtonActionPressedLabel);

// Small Buttons
winSmallButtonNormal = CreateSmallButton(252, 31, Texture'RGB_MenuButtonHeader_Normal');
winSmallButtonPressed = CreateSmallButton(312, 31, Texture'RGB_MenuButtonHeader_Pressed');
winSmallButtonPressed.SetWidth(74);

// Small Button Text
winTextButtonSmallNormal = CreateSmallText(257, 34, ButtonSmallNormalLabel);
winTextButtonSmallPressed = CreateSmallText(319, 34, ButtonSmallPressedLabel);


local TextWindow winText;


winText = TextWindow(NewChild(Class'TextWindow'));
winText.SetPos(posX, posY);
winText.SetTextMargins(0, 0);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winText.SetText(label);
winText.SetFont(Font'FontMenuSmall');

return winText;


local Window winButton;


winButton = NewChild(Class'Window');
winButton.SetPos(posX, posY);
winButton.SetSize(204, 27);
winButton.SetBackgroundStyle(DSTY_Translucent);
winButton.SetBackground(buttonBackground);

return winButton;


local TextWindow winText;


winText = TextWindow(NewChild(Class'TextWindow'));
winText.SetPos(posX, posY);
winText.SetTextMargins(0, 0);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winText.SetText(label);
winText.SetFont(fontMenuButtonText);
winText.EnableTranslucentText(True);

return winText;


local Window winButton;


winButton = NewChild(Class'Window');
winButton.SetPos(posX, posY);
winButton.SetSize(59, 15);
winButton.SetBackgroundStyle(DSTY_Masked);
winButton.SetBackground(buttonBackground);

return winButton;


local TextWindow winText;


winText = TextWindow(NewChild(Class'TextWindow'));
winText.SetPos(posX, posY);
winText.SetTextMargins(0, 0);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winText.SetText(label);
winText.SetFont(Font'FontMenuHeaders');

return winText;


// Draw client area
if (bBackgroundTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBackground);
gc.DrawTexture( 10, 23, 256, 134, 0, 0, Texture'RGB_MenuSampleBackground_1');
gc.DrawTexture(266, 23, 157, 134, 0, 0, Texture'RGB_MenuSampleBackground_2');


Super.InitWindow();

SetSize(423, 178);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

CreateControls();
StyleChanged();


// List focus border
gc.SetTileColor(colListFocus);
gc.SetStyle(DSTY_Normal);
gc.DrawBorders(252, 64, 148, 11, 0, 0, 0, 0, texListFocusBorders);


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

colBackground = theme.GetColorFromName('MenuColor_Background');

winTitle.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winTitleBubble.SetTileColor(theme.GetColorFromName('MenuColor_TitleBackground'));

colListFocus = theme.GetColorFromName('MenuColor_ListFocus');
winListFocus.SetTileColor(theme.GetColorFromName('MenuColor_ListHighlight'));

winMenuButtonDisabled.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winMenuButtonNormal.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winMenuButtonFocus.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winMenuButtonPressed.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winActionButtonDisabled.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winActionButtonNormal.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winActionButtonFocus.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winActionButtonPressed.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winSmallButtonNormal.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winSmallButtonPressed.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));
winScroll.SetTileColor(theme.GetColorFromName('MenuColor_ButtonFace'));

winTextButtonMenuDisabled.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextDisabled'));
winTextButtonMenuNormal.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextNormal'));
winTextButtonMenuFocus.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextFocus'));
winTextButtonMenuPressed.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextNormal'));
winTextButtonSmallNormal.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextNormal'));
winTextButtonSmallPressed.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextNormal'));
winTextButtonActionDisabled.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextDisabled'));
winTextButtonActionNormal.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextNormal'));
winTextButtonActionFocus.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextFocus'));
winTextButtonActionPressed.SetTextColor(theme.GetColorFromName('MenuColor_ButtonTextNormal'));
winTextList.SetTextColor(theme.GetColorFromName('MenuColor_ListText'));
winTextListFocus.SetTextColor(theme.GetColorFromName('MenuColor_ListTextHighlight'));
winTextEdit.SetTextColor(theme.GetColorFromName('MenuColor_ListText'));
winTextTitle.SetTextColor(theme.GetColorFromName('MenuColor_TitleText'));

bBackgroundTranslucent = player.GetMenuTranslucency();




var ClipWindow clipName;
var MenuUILoadSaveEditWindow editName;
var String currentSaveName;
var int editRowId;
var int newSaveRowId;
var bool bInitializing;
var int tickCount;
var int saveRowID;
var String missionLocation;
var Texture newSaveSnapshot;
var String defaultSaveText;
var Bool bGenerateSnapShot;
var Float snapshotWidth;
var Float snapshotHeight;
var localized String DiskSpaceTitle;
var localized String DiskSpaceMessage;
newSaveSnapshot=Texture'Extension.Solid'
defaultSaveText="ERROR! Report this as a BUG!"
snapshotWidth=160.000000
snapshotHeight=120.000000
DiskSpaceTitle="Disk Space Low"
DiskSpaceMessage="You must have at least 100MB of free disk space before you can save. Please delete some save games or free up space in Windows."
actionButtons(1)=(Text="|&Save Game",Key="SAVE")
Title="Save Game"

local string newName;
local int deleteRowId;


// Destroy the msgbox!
root.PopWindow();

switch(msgBoxMode)
{
case MB_Overwrite:
if ( buttonNumber == 0 )
{
SaveGame(saveRowId);
}
else
{
msgBoxMode = MB_None;
clipName.Show();
SetFocusWindow(editName);
}
break;

case MB_Delete:

if ( buttonNumber == 0 )
{
msgBoxMode = MB_None;
deleteRowId = editRowId;
MoveEditControl(newSaveRowID);
DeleteGame(deleteRowId);
}
else
{
clipName.Show();
SetFocusWindow(editName);
}

break;

case MB_LowSpace:
break;

default:
msgBoxMode = MB_None;
}

return True;


// First check to see how much disk space we have.
// If < the minimum, then notify the user to clear some
// disk space.

if ((freeDiskSpace / 1024) < minFreeDiskSpace)
{
msgBoxMode = MB_LowSpace;
root.MessageBox(DiskSpaceTitle, DiskSpaceMessage, 1, False, Self);
}
else
{
if (editRowId == newSaveRowId)
{
SaveGame(editRowId);
}
else
{
saveRowId = editRowId;
msgBoxMode = MB_Overwrite;
root.MessageBox( OverwriteTitle, OverwritePrompt, 0, False, Self);
}
}


Super.CreateControls();

CreateEditControl();
EnableButtons();


clipName = ClipWindow(lstGames.newChild(Class'ClipWindow'));
clipName.SetWidth(235);
clipName.ForceChildSize(False, True);

editName = MenuUILoadSaveEditWindow(clipName.newChild(Class'MenuUILoadSaveEditWindow'));
clipName.Hide();


// Hide the edit box
clipName.Hide();

editRowId = newSaveRowId;
currentSaveName = missionLocation;

Super.DeleteGame(rowId);


if (newSaveSnapshot != None)
{
CriticalDelete(newSaveSnapshot);
newSaveSnapshot = None;
}
root.ShowSnapshot(True);


if ( edit != editName )
return False;

if ( editName.GetText() != "" )
{
HideEditControl();
lstGames.SetField(editRowId, 0, editName.GetText());
lstGames.SetRow(editRowId);
ConfirmSaveGame();

return True;
}
else
{
return False;
}


// Don't allow delete if we're on the new savegame or the QuickSave
// slot

if ((editRowId != newSaveRowId) && (editRowId != -1))
EnableActionButton(AB_Other, True, "DELETE");
else
EnableActionButton(AB_Other, False, "DELETE");

if (editName != None)
{
if ((editName.IsVisible()) && (editName.GetText() == ""))
EnableActionButton(AB_Other, False, "SAVE");
else
EnableActionButton(AB_Other, True, "SAVE");
}
else
{
EnableActionButton(AB_Other, True, "SAVE");
}


// DEUS_EX CAC - only take screenshot if not using OpenGL
if (GetConfig("Engine.Engine", "GameRenderDevice") != "OpenGlDrv.OpenGLRenderDevice")
{
root.SetSnapshotSize(snapshotWidth, snapshotHeight);
newSaveSnapshot = root.GenerateSnapshot(True);
winSnapshot.SetBackground(newSaveSnapshot);
}


clipName.Hide();
lstGames.EnableAutoSort(True);


bInitializing = True;

Super.InitWindow();

// Need to do this because of the edit control used for
// saving games.
SetMouseFocusMode(MFOCUS_Click);

NewSaveGame();

SetFocusWindow(editName);

// Don't mask this window, as we need to take a snapshot of
// the 3D scene without worry about the snapshot or a black screen.
if (player.UIBackground > 0)
root.HideSnapshot();

root.Hide();

bGenerateSnapShot = True;
bTickEnabled = True;
bInitializing = False;


if (rowId != editRowId)
MoveEditControl(rowId);

return true;


if (!bInitializing)
{
if (focusRowId != editRowId)
{
MoveEditControl(focusRowId);
UpdateSaveInfo(focusRowId);

EnableButtons();
}
}

return false;


local int rowIndex;
local String saveNamePlaceholder;


// Check for valid edit row Id
if (editRowId == -1)
return;

saveNamePlaceholder = lstGames.GetField(rowId, 0);

// Restore the savegame from where we're currently located
if (!bNoSetOldName)
lstGames.SetField(editRowId, 0, currentSaveName);

// Save the rowId so we can restore the list to its previous
// state if the user hits Escape while editing the text
editRowId = rowId;

// Save the current savegame so we can restore it if the user
// hits Escape.
currentSaveName = saveNamePlaceholder;

lstGames.EnableAutoSort(False);
lstGames.SetField(editRowId, 0, "");

// If the user is over the QuickSave slot, then prevent
// him/her/it from modifying the text
editName.EnableEditing(int(lstGames.GetField(lstGames.GetSelectedRow(), 4)) != -1);

// Unselect the row and hide its text
lstGames.SelectRow(editRowId, False);

// Get the physical row location so we can position the
// edit control in the same place as the selected row
rowIndex = lstGames.RowIdToIndex(editRowId);
clipName.SetPos(0, (rowIndex * lstGames.lineSize) + 1);

// Set the edit text, move the cursor to the
// end of the line, and finally show the edit control.
editName.SetText(currentSaveName);
editName.MoveInsertionPoint(MOVEINSERT_End);

// Show the edit control, which should be hidden when
// this function is called.
clipName.Show();
SetFocusWindow(editName);


local String timeString;
local DeusExSaveInfo saveInfo;
local GameDirectory saveDir;


// Save away the mission string
SaveMissionLocationString();

// Create our Map Directory class
saveDir = player.CreateGameDirectoryObject();

saveInfo = saveDir.GetTempSaveInfo();
saveInfo.UpdateTimeStamp();

// Insert a new row at the top of the listbox and move the
// edit window there.

// TODO: Come up with a better default save game name
// (level title and some counter, maybe?)

timeString = BuildTimeString(
saveInfo.Year, saveInfo.Month, saveInfo.Day,
saveInfo.Hour, saveInfo.Minute);

newSaveRowID = lstGames.AddRow(missionLocation $ ";" $ timeString $ ";9999999999;;-2");

lstGames.SetRow(newSaveRowID);
MoveEditControl(newSaveRowID, True);
editName.SetSelectedArea(0, Len(missionLocation));

CriticalDelete(savedir);


local DeusExRootWindow localRoot;
local DeusExPlayer localPlayer;
local int gameIndex;
local String saveName;


// Get the save index if this is an existing savegame
gameIndex = int(lstGames.GetFieldValue(saveRowID, 4));

// If gameIndex is -2, this is our New Save Game and we
// need to set gameIndex to 0, which is not a valid
// gameIndex, in which case the DeusExGameEngine::SaveGame()
// code will be kind and get us a new GameIndex (Really!
// If you don't believe me, go look at the code!)

if (gameIndex == -2)
gameIndex = 0;

saveName = editName.GetText();

localPlayer = player;
localRoot = root;

localRoot.ClearWindowStack();
localPlayer.SaveGame(gameIndex, saveName);
localRoot.Show();


local int deleteRowId;


if (actionKey == "SAVE")
{
ConfirmSaveGame();
}
else if (actionKey == "DELETE")
{
// Only confirm
if (chkConfirmDelete.GetToggle())
{
ConfirmDeleteGame(lstGames.GetSelectedRow());
}
else
{
deleteRowId = editRowId;
MoveEditControl(newSaveRowID);
DeleteGame(deleteRowId);
}
}
else
{
Super.ProcessAction(actionKey);
}


// Okay, we need to do some trickery in order to take a snapshot
// of the game that doesn't have the UI in it!

saveRowID = rowId;

if (player.UIBackground > 0)
root.HideSnapshot();

root.Hide();
bTickEnabled = True;


local DeusExLevelInfo aDeusExLevelInfo;


missionLocation = "";

// Grab the mission location, which we'll use to build a default
// save game string
foreach player.AllActors(class'DeusExLevelInfo', aDeusExLevelInfo)
{
if (aDeusExLevelInfo != None)
{
missionLocation = aDeusExLevelInfo.MissionLocation;
break;
}
}

if (missionLocation == "")
missionLocation = defaultSaveText;


local int rowId;
local int rowIndex;


rowId = lstGames.GetSelectedRow();
rowIndex = lstGames.RowIdToIndex(rowId);

if (rowIndex < lstGames.GetNumRows() - 1)
{
rowIndex++;
rowId = lstGames.IndexToRowId(rowIndex);
lstGames.SelectRow(rowId);
}


local int rowId;
local int rowIndex;


rowId = lstGames.GetSelectedRow();
rowIndex = lstGames.RowIdToIndex(rowId);

if (rowIndex > 0)
{
rowIndex--;
rowId = lstGames.IndexToRowId(rowIndex);
lstGames.SelectRow(rowId);
}


// If this is the quicksave gameslot, don't allow the user
// to edit!!!
if (int(lstGames.GetField(lstGames.GetSelectedRow(), 4)) == -1)
editName.EnableWindow(False);

EnableButtons();

return false;


if (bGenerateSnapShot)
{
if (tickCount++ == 1)
{
bGenerateSnapShot = False;
tickCount = 0;

GenerateNewSnapShot();
root.ShowSnapshot(True);
UpdateSaveInfo(newSaveRowId);
bTickEnabled = False;
root.Show();
Show();
}
}
else
{
if (tickCount++ == 1)
{
root.HideSnapshot();
bTickenabled = False;
PerformSave();
}
}


// If this is the saveRowId, then use our stored away
// snapshot
if (rowId == newSaveRowID)
{
winSnapshot.SetBackground(newSaveSnapshot);
winSaveInfo.SetText(Sprintf(LocationLabel, MissionLocation));
winSaveInfo.AppendText(Sprintf(SaveCountLabel, player.saveCount));
winSaveInfo.AppendText(Sprintf(PlayTimeLabel, BuildElapsedTimeString(Int(player.saveTime))));

// Show the "Cheats Enabled" text if cheats were enabled for this savegame
if (player.bCheatsEnabled)
winCheatsEnabled.Show();
}
else
{
Super.UpdateSaveInfo(rowId);
}


local int keyIndex;
local bool bKeyHandled;


switch(key)
{
case IK_Up:
SelectPreviousRow();
bKeyHandled = True;
break;

case IK_Down:
SelectNextRow();
bKeyHandled = True;
break;

case IK_Enter:
bKeyHandled = True;
ConfirmSaveGame();
break;

default:
bKeyHandled = False;
}

if (bKeyHandled)
return True;
else
return Super.VirtualKeyPressed(key, bRepeat);




choices(0)=Class'DeusEx.MenuChoice_MusicVolume'
choices(1)=Class'DeusEx.MenuChoice_SoundVolume'
choices(2)=Class'DeusEx.MenuChoice_SpeechVolume'
choices(3)=Class'DeusEx.MenuChoice_EffectsChannels'
choices(4)=Class'DeusEx.MenuChoice_SampleRate'
choices(5)=Class'DeusEx.MenuChoice_SoundQuality'
choices(6)=Class'DeusEx.MenuChoice_ReverseStereo'
choices(7)=Class'DeusEx.MenuChoice_SurroundSound'
choices(8)=Class'DeusEx.MenuChoice_Use3DHardware'
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_OK)
actionButtons(2)=(Action=AB_Reset)
Title="Sound Settings"
ClientWidth=537
ClientHeight=408
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuSoundBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuSoundBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuSoundBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuSoundBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.MenuSoundBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.MenuSoundBackground_6'
helpPosY=354

Super.SaveSettings();
player.SaveConfig();




var MenuUIListWindow lstThemes;
var MenuUIScrollAreaWindow winScroll;
var MenuScreenRGB winRGB;
var int themeType;
var localized string LoadHelpText;
LoadHelpText="Choose the color theme to load"
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_Other,Text="|&Load Theme",Key="LOAD")
Title="Load Theme"
ClientWidth=299
ClientHeight=306
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuThemesBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuThemesBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuThemesBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuThemesBackground_4'
textureCols=2
bLeftEdgeActive=False
bHelpAlwaysOn=True
helpPosY=252

winScroll = CreateScrollAreaWindow(winClient);

winScroll.SetPos(11, 22);
winScroll.SetSize(285, 210);

lstThemes = MenuUIListWindow(winScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
lstThemes.EnableMultiSelect(False);


EnableActionButton(AB_Other, (lstThemes.GetNumSelectedRows() > 0), "LOAD");


Super.InitWindow();

CreateThemesList();
ShowHelp(LoadHelpText);
EnableButtons();


SaveSettings();


EnableButtons();
return False;


local ColorTheme theme;


// First erase the old list
lstThemes.DeleteAllRows();

theme = player.ThemeManager.GetFirstTheme(themeType);

while(theme != None)
{
lstThemes.AddRow(theme.GetThemeName());
theme = player.ThemeManager.GetNextTheme();
}


if (actionKey == "LOAD")
{
SaveSettings();
}


local ColorTheme theme;
local String themeName;


if (lstThemes.GetNumSelectedRows() == 1)
{
themeName = lstThemes.GetField(lstThemes.GetSelectedRow(), 0);

if (winRGB != None)
winRGB.SetThemeByName(themeName);
}

root.PopWindow();


winRGB = newRGBWindow;


themeType = newThemeType;
PopulateThemesList();




LoadHelpText="Choose the color theme to save"
actionButtons(1)=(Text="Save Theme",Key="SAVE")
Title="Save Theme"



ButtonNames(0)="Easy"
ButtonNames(1)="Medium"
ButtonNames(2)="Hard"
ButtonNames(3)="Realistic"
ButtonNames(4)="Previous Menu"
buttonXPos=7
buttonWidth=245
buttonDefaults(0)=(Y=13,Action=MA_Custom,Key="EASY")
buttonDefaults(1)=(Y=49,Action=MA_Custom,Key="MEDIUM")
buttonDefaults(2)=(Y=85,Action=MA_Custom,Key="HARD")
buttonDefaults(3)=(Y=121,Action=MA_Custom,Key="REALISTIC")
buttonDefaults(4)=(Y=179,Action=MA_Previous)
Title="Select Combat Difficulty"
ClientWidth=258
ClientHeight=221
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuDifficultyBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuDifficultyBackground_2'
textureRows=1
textureCols=2

Super.InitWindow();


local MenuScreenNewGame newGame;


newGame = MenuScreenNewGame(root.InvokeMenuScreen(Class'MenuScreenNewGame'));

if (newGame != None)
newGame.SetDifficulty(difficulty);


switch(key)
{
case "EASY":
InvokeNewGameScreen(1.0);
break;

case "MEDIUM":
InvokeNewGameScreen(1.5);
break;

case "HARD":
InvokeNewGameScreen(2.0);
break;

case "REALISTIC":
InvokeNewGameScreen(4.0);
break;
}


// Set focus to the Medium button
SetFocusWindow(winButtons[1]);




ButtonNames(0)="Keyboard/Mouse"
ButtonNames(1)="Controls"
ButtonNames(2)="Game Options"
ButtonNames(3)="Display"
ButtonNames(4)="Colors"
ButtonNames(5)="Sound"
ButtonNames(6)="Previous Menu"
buttonXPos=7
buttonWidth=282
buttonDefaults(0)=(Y=13,Action=MA_MenuScreen,Invoke=Class'DeusEx.MenuScreenCustomizeKeys')
buttonDefaults(1)=(Y=49,Action=MA_MenuScreen,Invoke=Class'DeusEx.MenuScreenControls')
buttonDefaults(2)=(Y=85,Action=MA_MenuScreen,Invoke=Class'DeusEx.MenuScreenOptions')
buttonDefaults(3)=(Y=121,Action=MA_MenuScreen,Invoke=Class'DeusEx.MenuScreenDisplay')
buttonDefaults(4)=(Y=157,Action=MA_MenuScreen,Invoke=Class'DeusEx.MenuScreenAdjustColors')
buttonDefaults(5)=(Y=193,Action=MA_MenuScreen,Invoke=Class'DeusEx.MenuScreenSound')
buttonDefaults(6)=(Y=266,Action=MA_Previous)
Title="Settings"
ClientWidth=294
ClientHeight=308
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuOptionsBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuOptionsBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuOptionsBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuOptionsBackground_4'
textureCols=2



var MenuUIActionButtonWindow btn;
var EHALIGN align;
var S_BarButton actionButtons[5];
var int buttonCount;
var int defaultBarHeight;
var int buttonSpacing;
defaultBarHeight=21
buttonSpacing=2

local MenuUIActionButtonWindow newButton;


// Add button to our list of buttons, make sure we don't try to add
// too many buttons
if (buttonCount == arrayCount(actionButtons))
return None;

actionButtons[buttonCount].align = buttonAlignment;

newButton = MenuUIActionButtonWindow(NewChild(Class'MenuUIActionButtonWindow'));
newButton.SetButtonText(buttonLabel);

actionButtons[buttonCount].btn = newButton;

buttonCount++;

AskParentForReconfigure();

return newButton;


return FALSE;


local float qWidth, qHeight;
local int leftX, rightX;
local int buttonIndex;
local int btnPos;
local MenuUIActionButtonWindow btn;


leftX = 0;
rightX = width;

// Loop through all buttons and try to place them
for(buttonIndex=0; buttonIndex {
btn = actionButtons[buttonIndex].btn;

if (btn != None)
{
btn.QueryPreferredSize(qWidth, qHeight);

switch(actionButtons[buttonIndex].align)
{
case HALIGN_Left:
case HALIGN_Center:
case HALIGN_Full:
btnPos = leftX;
leftX += buttonSpacing + qWidth;
break;

case HALIGN_Right:
rightX -= qWidth;
btnPos = rightX;
rightX -= buttonSpacing;
break;
}
btn.ConfigureChild(btnPos, 1, qWidth, qHeight);
}
}


Super.InitWindow();

SetHeight(defaultBarHeight);




Left_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuActionButtonNormal_Left',Width=8)
Left_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuActionButtonPressed_Left',Width=8)
Right_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuActionButtonNormal_Right',Width=11)
Right_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuActionButtonPressed_Right',Width=11)
Center_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuActionButtonNormal_Center',Width=2)
Center_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuActionButtonPressed_Center',Width=2)
fontButtonText=Font'DeusExUI.FontMenuTitle'
buttonHeight=19
minimumButtonWidth=83
textLeftMargin=8



var Texture tex;
var int width;
var DeusExPlayer player;
var String buttonText;
var Bool bTranslucentText;
var S_MenuUIBorderButtonTextures Left_Textures[2];
var S_MenuUIBorderButtonTextures Right_Textures[2];
var S_MenuUIBorderButtonTextures Center_Textures[2];
var Color colButtonFace;
var Color colText[4];
var int textureIndex;
var int textOffset;
var int leftOffset;
var int textColorIndex;
var int buttonVerticalOffset;
var int fontBaseLine;
var int fontAcceleratorLineHeight;
var Font fontButtonText;
var int verticalTextMargin;
var int buttonHeight;
var int minimumButtonWidth;
var int textLeftMargin;
var int maxTextWidth;
var bool bTranslucent;
var bool bUseTextOffset;
var bool bCenterText;
colButtonFace=(R=255,G=255,B=255)
colText(0)=(R=200,G=200,B=200)
colText(1)=(R=255,G=255,B=255)
colText(2)=(R=255,G=255,B=255)
colText(3)=(R=50,G=50,B=50)
fontBaseLine=1
fontAcceleratorLineHeight=1
fontButtonText=Font'DeusExUI.FontMenuSmall'
verticalTextMargin=1
maxTextWidth=200
bUseTextOffset=True

SetButtonMetrics();

// Draw the textures
if (bTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colButtonFace);

// Left
gc.DrawTexture(
leftOffset, buttonVerticalOffset,
Left_Textures[textureIndex].width, buttonHeight,
0, 0,
Left_Textures[textureIndex].tex);

// Center
gc.DrawPattern(
leftOffset + Left_Textures[textureIndex].width, buttonVerticalOffset,
width - Left_Textures[textureIndex].width - Right_Textures[textureIndex].width - leftOffset, buttonHeight,
0, 0,
Center_Textures[textureIndex].tex);

// Right
gc.DrawTexture(
width - Right_Textures[textureIndex].width, buttonVerticalOffset,
Right_Textures[textureIndex].width, buttonHeight,
0, 0,
Right_Textures[textureIndex].tex);

// Draw the text!
gc.SetFont(fontButtonText);
gc.SetTextColor(colText[textColorIndex]);
gc.EnableTranslucentText(bTranslucentText);
gc.SetVerticalAlignment(VALIGN_Center);

if (bCenterText)
gc.SetHorizontalAlignment(HALIGN_Center);
else
gc.SetHorizontalAlignment(HALIGN_Left);

if (bUseTextOffset)
{
gc.DrawText(
textLeftMargin + textOffset, verticalTextMargin + textOffset + buttonVerticalOffset,
width, height, buttonText);
}
else
{
gc.DrawText(
textLeftMargin, verticalTextMargin + buttonVerticalOffset,
width, height, buttonText);
}


Super.InitWindow();

EnableTextAsAccelerator(false);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

SetButtonSounds(None, Sound'Menu_Press');
SetFocusSounds(Sound'Menu_Focus');
SetSoundVolume(0.25);

SetBaselineData(fontBaseLine, fontAcceleratorLineHeight);

StyleChanged();


if (bIsSensitive)
{
if (bButtonPressed) // button pressed
{
textureIndex = 1;
textOffset = 1;
textColorIndex = 2;
}
else if (IsFocusWindow()) // focus
{
textureIndex = 0;
textOffset = 0;
textColorIndex = 1;
}
else // normal
{
textureIndex = 0;
textOffset = 0;
textColorIndex = 0;
}
}
else // disabled
{
textureIndex = 0;
textOffset = 0;
textColorIndex = 3;
}


buttonText = newText;

SetAcceleratorText(newText);

AskParentForReconfigure();


bCenterText = bNewCenter;


buttonVerticalOffset = newButtonVerticalOffset;


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

colButtonFace = theme.GetColorFromName('MenuColor_ButtonFace');
colText[0] = theme.GetColorFromName('MenuColor_ButtonTextNormal');

colText[1] = theme.GetColorFromName('MenuColor_ButtonTextFocus');
colText[2] = colText[1];

colText[3] = theme.GetColorFromName('MenuColor_ButtonTextDisabled');




var DeusExPlayer player;
var Color colText;
var Color colButtonFace;
var Font fontText;
var int fontBaseLine;
var int fontAcceleratorLineHeight;
colText=(R=255,G=255,B=255)
fontText=Font'DeusExUI.FontMenuTitle'
fontBaseLine=1
fontAcceleratorLineHeight=1

Super.InitWindow();

SetFont(fontText);
SetTextAlignments(HALIGN_Left, VALIGN_Center);
SetTextMargins(0, 0);
SetCheckboxTextures(Texture'MenuCheckBox_Off', Texture'MenuCheckBox_On', 13, 13);
SetCheckboxSpacing(6);
SetCheckboxStyle(DSTY_Masked);
SetBaselineData(fontBaseLine, fontAcceleratorLineHeight);

SetButtonSounds(None, Sound'Menu_Press');
SetSoundVolume(0.25);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

colText = theme.GetColorFromName('MenuColor_ButtonTextNormal');
colButtonFace = theme.GetColorFromName('MenuColor_ButtonFace');

SetTextColors(colText, colText, colText, colText);
SetButtonColors(colButtonFace, colButtonFace, colButtonFace,
colButtonFace, colButtonFace, colButtonFace);




var MenuUIChoiceButton btnAction;
var DeusExPlayer player; // Used for saving/loading/default
var int choiceControlPosX;
var int buttonVerticalOffset;
var localized String helpText;
var localized String actionText;
var localized String configSetting;
var localized String FalseTrue[2];
choiceControlPosX=270
actionText="Choice"
FalseTrue(0)="False"
FalseTrue(1)="True"

if (buttonPressed == btnAction)
{
CycleNextValue();
return True;
}
else
{
return Super.ButtonActivated(buttonPressed);
}


if (buttonPressed == btnAction)
{
CyclePreviousValue();
return True;
}
else
{
return Super.ButtonActivated(buttonPressed);
}


btnAction = MenuUIChoiceButton(NewChild(Class'MenuUIChoiceButton'));
btnAction.SetButtonText(actionText);
btnAction.SetVerticalOffset(buttonVerticalOffset);
btnAction.EnableRightMouseClick();


Super.InitWindow();

player = DeusExPlayer(DeusExRootWindow(GetRootWindow()).parentPawn);

SetSize(540, 21);

CreateActionButton();


local MenuUIScreenWindow menuScreen;


menuScreen = MenuUIScreenWindow(GetParent().GetParent());

if (menuScreen != None)
menuScreen.SaveSettings();


if (btnAction != None)
btnAction.SetWidth(newWidth);


local bool bHandled;


if (key == IK_Enter)
return False;
else
return Super.VirtualKeyPressed(key, bRepeat);




var EMenuActions action;
var class invoke;

ProcessMenuAction(action, invoke);
return True;


local bool bHandled;


if (key == IK_Enter)
{
btnAction.PressButton(key);
return True;
}
else
{
return Super.VirtualKeyPressed(key, bRepeat);
}




var String helpText;
verticalTextMargin=0

Super.InitWindow();

SetWidth(243);


helpText = newHelpText;


local bool bHandled;


if (key == IK_Enter)
return False;
else
return Super.VirtualKeyPressed(key, bRepeat);




var MenuUIInfoButtonWindow btnInfo;
var localized String enumText[40];
var int currentEnum;
var int currentValue;
var int defaultValue;
var int defaultInfoWidth;
var int defaultInfoPosX;
defaultInfoWidth=77
defaultInfoPosX=270

if (buttonPressed == btnInfo)
{
CycleNextValue();
return True;
}
else
{
return Super.ButtonActivated(buttonPressed);
}


btnInfo = MenuUIInfoButtonWindow(NewChild(Class'MenuUIInfoButtonWindow'));

btnInfo.SetSelectability(False);
btnInfo.SetSize(defaultInfoWidth, 19);
btnInfo.SetPos(defaultInfoPosX, 0);


local int newValue;


// Cycle to the next value, but make sure we don't exceed the
// bounds of the enumText array. If we do, start back at the
// bottom.

newValue = GetValue() + 1;

if (newValue == arrayCount(enumText))
newValue = 0;
else if (enumText[newValue] == "")
newValue = 0;

SetValue(newValue);


local int newValue;


// Cycle to the next value, but make sure we don't exceed the
// bounds of the enumText array. If we do, start back at the
// bottom.

newValue = GetValue() - 1;

if (newValue < 0)
{
newValue = arrayCount(enumText) - 1;

while((enumText[newValue] == "") && (newValue > 0))
newValue--;
}

SetValue(newValue);


return currentValue;


CreateInfoButton();

Super.InitWindow();


if (configSetting != "")
SetValue(int(player.ConsoleCommand("get " $ configSetting)));
else
ResetToDefault();


local String boolString;


boolString = player.ConsoleCommand("get " $ configSetting);

if (boolString == "True")
setValue(1);
else
setValue(0);


if (configSetting != "")
{
player.ConsoleCommand("set " $ configSetting $ " " $ defaultValue);
LoadSetting();
}


if (configSetting != "")
player.ConsoleCommand("set " $ configSetting $ " " $ GetValue());


player.ConsoleCommand("set " $ configSetting $ " " $ Bool(GetValue()));


currentValue = newValue;
UpdateInfoButton();


btnInfo.SetButtonText(enumText[currentValue]);




var MenuUISliderButtonWindow btnSlider;
var int numTicks;
var float startValue;
var float endValue;
var float defaultValue;
var float saveValue;
var Bool bInitializing;
numTicks=11
endValue=10.000000
buttonVerticalOffset=1
actionText="Slider Choice"

btnSlider = MenuUISliderButtonWindow(NewChild(Class'MenuUISliderButtonWindow'));

btnSlider.SetSelectability(False);
btnSlider.SetPos(choiceControlPosX, 0);
btnSlider.SetTicks(numTicks, startValue, endValue);


local int newValue;


if (btnSlider != None)
{
// Get the current slider value and attempt to increment.
// If at the max go back to the beginning

newValue = btnSlider.winSlider.GetTickPosition() + 1;

if (newValue == btnSlider.winSlider.GetNumTicks())
newValue = 0;

btnSlider.winSlider.SetTickPosition(newValue);
}


local int newValue;


if (btnSlider != None)
{
// Get the current slider value and attempt to increment.
// If at the max go back to the beginning

newValue = btnSlider.winSlider.GetTickPosition() - 1;

if (newValue < 0)
newValue = btnSlider.winSlider.GetNumTicks() - 1;

btnSlider.winSlider.SetTickPosition(newValue);
}


if (btnSlider != None)
return btnSlider.winSlider.GetValue();
else
return 0;


bInitializing=True;

Super.InitWindow();

CreateSlider();
SetEnumerators();

bInitializing=False;


if (configSetting != "")
SetValue(float(player.ConsoleCommand("get " $ configSetting)));
else
ResetToDefault();


if (configSetting != "")
{
player.ConsoleCommand("set " $ configSetting $ " " $ defaultValue);
LoadSetting();
}


if (configSetting != "")
player.ConsoleCommand("set " $ configSetting $ " " $ GetValue());


if (btnSlider != None)
btnSlider.winSlider.SetEnumeration(tickPos, newStr);


if (btnSlider != None)
btnSlider.winSlider.SetValue(newValue);





Super.InitWindow();




var Texture clientTextures[6];
var int texturePosX[6];
var int texturePosY[6];
var int textureRows;
var int textureCols;
var int textureCount;
var int textureIndex;
var DeusExPlayer player;
var EDrawStyle backgroundDrawStyle;
var Color colBackground;

local int rowIndex;
local int colIndex;


textureCount = 0;

for(rowIndex=0; rowIndex {
for(colIndex=0; colIndex {
texturePosX[textureCount] = colIndex * 256;
texturePosY[textureCount] = rowIndex * 256;
textureCount++;
}
}


// Draw window background
gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);

for(textureIndex=0; textureIndex {
gc.DrawIcon(
texturePosX[textureIndex],
texturePosY[textureIndex],
clientTextures[textureIndex]);
}


Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


if ((textureIndex >= 0) && (textureIndex < arrayCount(clientTextures)))
clientTextures[textureIndex] = newTexture;


textureCols = newTextureCols;
textureRows = newTextureRows;

CalculateTexturePositions();


local ColorTheme theme;


// Translucency
if (player.GetMenuTranslucency())
backgroundDrawStyle = DSTY_Translucent;
else
backgroundDrawStyle = DSTY_Masked;

// Background color
theme = player.ThemeManager.GetCurrentMenuColorTheme();

colBackground = theme.GetColorFromName('MenuColor_Background');







var DeusExPlayer player;
var Color colText;
var Color colHighlight;
var Color colCursor;
var Color colBlack;
var Font fontText;
var Int maxHeight;
var String filterString;
fontText=Font'DeusExUI.FontMenuSmall'
maxHeight=11

local int filterIndex;
local bool bResult;


if (filterString == "")
{
bResult = True;
}
else
{
bResult = False;

for(filterIndex=0; filterIndex < Len(filterString); filterIndex++)
{
if ( Mid(filterString, filterIndex, 1) == chStr )
{
bResult = True;
break;
}
}
}

return bResult;


Super.InitWindow();

SetFont(fontText);
SetHeight(maxHeight);
SetInsertionPointType(INSTYPE_Insert);
EnableSingleLineEditing(True);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


filterString = newFilterString;


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colText = theme.GetColorFromName('MenuColor_ListText');
colHighlight = theme.GetColorFromName('MenuColor_ListHighlight');
colCursor = theme.GetColorFromName('MenuColor_Cursor');

SetTextColor(colText);
SetTileColor(colHighlight);
SetSelectedAreaTexture(Texture'Solid', coltext);
SetSelectedAreaTextColor(colBlack);
SetEditCursor(Texture'DeusExEditCursor', Texture'DeusExEditCursor_Shadow', colCursor);
SetInsertionPointTexture(Texture'Solid', colCursor);




fontLabel=Font'DeusExUI.FontMenuHeaders'



var DeusExPlayer player;
var int xMargin;
var int yMargin;
var Color colText;
var Font fontText;
xMargin=10
colText=(R=255,G=255,B=255)
fontText=Font'DeusExUI.FontMenuSmall'

Super.InitWindow();

SetFont(fontText);
SetTextMargins(xMargin, yMargin);
SetTextAlignments(HALIGN_Left, VALIGN_Center);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colText = theme.GetColorFromName('MenuColor_HelpText');

SetTextColor(colText);




Left_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuInfoButton_Left',Width=6)
Left_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuInfoButton_Left',Width=6)
Right_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuInfoButton_Right',Width=11)
Right_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuInfoButton_Right',Width=11)
Center_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuInfoButton_Center',Width=2)
Center_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuInfoButton_Center',Width=2)
fontButtonText=Font'DeusExUI.FontMenuTitle'
buttonHeight=19
textLeftMargin=8
bUseTextOffset=False



var DeusExPlayer player;
var Color colLabel;
var Font fontLabel;
var int fontBaseLine;
var int fontAcceleratorLineHeight;
colLabel=(R=255,G=255,B=255)
fontLabel=Font'DeusExUI.FontMenuTitle'
fontBaseLine=1
fontAcceleratorLineHeight=1

Super.InitWindow();

SetFont(fontLabel);
SetTextMargins(0, 0);
SetTextAlignments(HALIGN_Left, VALIGN_Top);
SetBaselineData(fontBaseLine, fontAcceleratorLineHeight);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colLabel = theme.GetColorFromName('MenuColor_ListText');

SetTextColor(colLabel);




var DeusExPlayer player;
var Texture texture_Top;
var Texture texture_Center;
var Texture texture_Bottom;
var int topHeight;
var int bottomHeight;
var int edgeWidth;
var Color colBackground;
texture_Top=Texture'DeusExUI.UserInterface.MenuLeftBorder_Top'
texture_Center=Texture'DeusExUI.UserInterface.MenuLeftBorder_Center'
texture_Bottom=Texture'DeusExUI.UserInterface.MenuLeftBorder_Bottom'
topHeight=2
bottomHeight=16
edgeWidth=4
colBackground=(R=255,G=255,B=255)

// Draw the textures
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBackground);

// Top
gc.DrawTexture(0, 0, edgeWidth, topHeight, 0, 0, texture_Top);

// Center
gc.DrawPattern(
0, topHeight,
edgeWidth, height - topHeight - bottomHeight,
0, 0,
texture_Center);

// Bottom
gc.DrawTexture(0, height - bottomHeight, edgeWidth, bottomHeight, 0, 0, texture_Bottom);


Super.InitWindow();

SetWidth(edgeWidth);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colBackground = theme.GetColorFromName('MenuColor_ButtonFace');




Left_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuListHeaderButtonNormal_Left',Width=5)
Left_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuListHeaderButtonPressed_Left',Width=5)
Right_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuListHeaderButtonNormal_Right',Width=13)
Right_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuListHeaderButtonPressed_Right',Width=13)
Center_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuListHeaderButtonNormal_Center',Width=2)
Center_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuListHeaderButtonPressed_Center',Width=2)
colText(0)=(R=197,G=225,B=247)
colText(3)=(R=255,G=255,B=255)
fontButtonText=Font'DeusExUI.FontMenuHeaders'
buttonHeight=15
minimumButtonWidth=83
textLeftMargin=8

Super.StyleChanged();

// Override disabled color
colText[3] = colText[2];




var DeusExPlayer player;
var Color colText;
var Color colTextHighlight;
var Color colHighlight;
var Color colFocus;
var Texture texHighlight;
var Texture texFocus;
var Font fontText;
colText=(R=255,G=255,B=255)
colTextHighlight=(R=255,G=255,B=255)
colHighlight=(R=128,G=128,B=128)
colFocus=(R=64,G=64,B=64)
texHighlight=Texture'Extension.Solid'
texFocus=Texture'Extension.Solid'
fontText=Font'DeusExUI.FontMenuSmall'

Super.InitWindow();

SetFont(fontText);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

SetListSounds(Sound'Menu_Press', Sound'Menu_Focus');
SetSoundVolume(0.25);

SetNumColumns(0);
SetNumColumns(1);


local ColorTheme theme;
local Int colIndex;


// Background color
theme = player.ThemeManager.GetCurrentMenuColorTheme();

colText = theme.GetColorFromName('MenuColor_ListText');
colTextHighlight = theme.GetColorFromName('MenuColor_ListTextHighlight');
colHighlight = theme.GetColorFromName('MenuColor_ListHighlight');
colFocus = theme.GetColorFromName('MenuColor_ListFocus');

SetTextColor(colText);
SetHighlightTextColor(colTextHighlight);
SetHighlightTexture(texHighlight);
SetHighlightColor(colHighlight);
SetFocusTexture(texFocus);
SetFocusColor(colFocus);

// Loop through columns, setting text color
for (colIndex=0; colIndex SetColumnColor(colIndex, colText);


local bool retval;


retval = False;

// Handle keys
switch (key)
{
case IK_Space: // toggle selection
retval = true;
break;
}

if (!retval)
retval = Super.VirtualKeyPressed(key, bRepeat);

// Return TRUE if we handled this
return (retval);




var Texture texBackground;
var Color colWhite;
var bool bReadOnly;
texBackground=Texture'Extension.Solid'
colWhite=(R=255,G=255,B=255)

return ((chStr != ";") || (!bReadOnly));


Super.InitWindow();

SetBackground(texBackground);
SetBackgroundStyle(DSTY_Normal);


bReadOnly = bNewReadOnly;


local ColorTheme theme;


Super.StyleChanged();

SetTextColor(colWhite);


local int keyIndex;
local bool bKeyHandled;


bKeyHandled = True;

// If the user hits the up or down arrow keys or the Page Up/Down
// keys, we want to pass them back to the parent window so the
// user can easily scroll between savegames.

if ((key == IK_Up) || (key == IK_Down) || (key == IK_PageUp) || (key == IK_PageDown))
return False;
else
return Super.VirtualKeyPressed(key, bRepeat);




var Texture buttonLights[4];
var int buttonLightWidth;
buttonLights(0)=Texture'DeusExUI.UserInterface.MenuMainLight_Normal'
buttonLights(1)=Texture'DeusExUI.UserInterface.MenuMainLight_Focus'
buttonLights(2)=Texture'DeusExUI.UserInterface.MenuMainLight_Focus'
buttonLights(3)=Texture'DeusExUI.UserInterface.MenuMainLight_Normal'
buttonLightWidth=7
bTranslucentText=True
Left_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuMainButtonNormal_Left',Width=5)
Left_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuMainButtonPressed_Left',Width=5)
Right_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuMainButtonNormal_Right',Width=20)
Right_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuMainButtonPressed_Right',Width=20)
Center_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.MenuMainButtonNormal_Center',Width=2)
Center_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.MenuMainButtonPressed_Center',Width=2)
leftOffset=9
buttonHeight=27
minimumButtonWidth=245
textLeftMargin=-4
bTranslucent=True
bCenterText=True

// Allow the parent to draw the bulk of the button and the text
Super.DrawWindow(gc);

// Now draw the pretty light to the left of the button
gc.DrawTexture(0, 0, buttonLightWidth, buttonHeight, 0, 0, buttonLights[textColorIndex]);


Super.InitWindow();

// Load the menu font from the DXFonts package
fontButtonText = Font(DynamicLoadObject("DXFonts.MainMenuTrueType", Class'Font'));




var int y;
var EMenuActions action;
var class invoke;
var string key;
var MenuUIMenuButtonWindow winButtons[10]; // Up to ten buttons
var localized string ButtonNames[10];
var int buttonXPos;
var int buttonWidth;
var S_MenuButton buttonDefaults[10];
textureRows=2
textureCols=1
bUsesHelpWindow=False
ScreenType=ST_Menu

local bool bHandled;
local int buttonIndex;


bHandled = False;

Super.ButtonActivated(buttonPressed);

// Figure out which button was pressed
for (buttonIndex=0; buttonIndex {
if (buttonPressed == winButtons[buttonIndex])
{
// Check to see if there's somewhere to go
ProcessMenuAction(buttonDefaults[buttonIndex].action, buttonDefaults[buttonIndex].invoke, buttonDefaults[buttonIndex].key);

bHandled = True;
break;
}
}

return bHandled;


local int buttonIndex;


for(buttonIndex=0; buttonIndex {
if (ButtonNames[buttonIndex] != "")
{
winButtons[buttonIndex] = MenuUIMenuButtonWindow(winClient.NewChild(Class'MenuUIMenuButtonWindow'));

winButtons[buttonIndex].SetButtonText(ButtonNames[buttonIndex]);
winButtons[buttonIndex].SetPos(buttonXPos, buttonDefaults[buttonIndex].y);
winButtons[buttonIndex].SetWidth(buttonWidth);
}
else
{
break;
}
}


Super.InitWindow();

CreateMenuButtons();




var Texture texShadows[4];
var int textureIndex;
texShadows(0)=Texture'DeusExUI.UserInterface.MenuMessageBoxShadow1_1'
texShadows(1)=Texture'DeusExUI.UserInterface.MenuMessageBoxShadow1_2'
texShadows(2)=Texture'DeusExUI.UserInterface.MenuMessageBoxShadow2_1'
texShadows(3)=Texture'DeusExUI.UserInterface.MenuMessageBoxShadow2_2'
shadowWidth=316
shadowHeight=154
shadowOffsetX=13
shadowOffsetY=13

local int unloadIndex;


for(unloadIndex=0; unloadIndex player.UnloadTexture(texShadows[unloadIndex]);

Super.DestroyWindow();


gc.SetStyle(DSTY_Modulated);
gc.DrawTexture(0, 0, 256, shadowHeight, 0, 0, texShadows[0 + (textureIndex * 2)]);
gc.DrawTexture(256, 0, shadowWidth - 256, shadowHeight, 0, 0, texShadows[1 + (textureIndex * 2)]);


if ((newButtonCount >= 1) && (newButtonCount <= 2))
textureIndex = newButtonCount - 1;




var Color colTextMessage;
var MenuUIActionButtonWindow btnYes;
var MenuUIActionButtonWindow btnNo;
var MenuUIActionButtonWindow btnOK;
var MenuUIHeaderWindow winText;
var int mbMode;
var bool bDeferredKeyPress;
var bool bKeyPressed;
var Window winNotify;
var int textBorderX;
var int textBorderY;
var int numButtons;
var localized string btnLabelYes;
var localized string btnLabelNo;
var localized string btnLabelOK;
var localized string btnLabelCancel;
textBorderX=20
textBorderY=14
btnLabelYes="|&Yes"
btnLabelNo="|&No"
btnLabelOK="|&OK"
btnLabelCancel="|&Cancel"
ClientWidth=280
ClientHeight=85
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuMessageBoxBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuMessageBoxBackground_2'
textureRows=1
textureCols=2
bActionButtonBarActive=True
bUsesHelpWindow=False
winShadowClass=Class'DeusEx.MenuUIMessageBoxShadowWindow'

local bool bHandled;


bHandled = True;

Super.ButtonActivated(buttonPressed);

switch( buttonPressed )
{
case btnYes:
if ((bDeferredKeyPress) && (IsKeyDown(IK_Enter) || IsKeyDown(IK_Space) || IsKeyDown(IK_Y)))
bKeyPressed = True;
else
PostResult(0); // MR_Yes;

bHandled = True;
break;

case btnNo:
PostResult(1);
break;

case btnOK:
if ((bDeferredKeyPress) && (IsKeyDown(IK_Enter) || IsKeyDown(IK_Space) || IsKeyDown(IK_Y)))
bKeyPressed = True;
else
PostResult(0);

bHandled = True;
break;

default:
bHandled = False;
break;
}

return bHandled;


winText = CreateMenuHeader(21, 13, "", winClient);
winText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winText.SetFont(Font'FontMenuHeaders_DS');
winText.SetWindowAlignments(HALIGN_Full, VALIGN_Full, textBorderX, textBorderY);


return numButtons;


Super.InitWindow();

// Force the title bar to be a certain width;
winTitle.minTitleWidth = 250;

CreateTextWindow();


return True;


if ( winNotify != None )
winNotify.BoxOptionSelected(Self, buttonNumber);


if (((key == IK_Enter) || (key == IK_Space) || (key == IK_Y)) &&
((iState == IST_Release) && (bKeyPressed)))
{
PostResult(0);
return True;
}
else
{
return false; // don't handle
}


bDeferredKeyPress = bNewDeferredKeyPress;


winText.SetText(msgText);

AskParentForReconfigure();


// Store away
mbMode = newMode;

// Now create buttons appropriately

switch( mbMode )
{
case 0: // MB_YesNo:
btnNo = winButtonBar.AddButton(btnLabelNo, HALIGN_Right);
btnYes = winButtonBar.AddButton(btnLabelYes, HALIGN_Right);
numButtons = 2;
SetFocusWindow(btnYes);
break;

case 1: // MB_OK:
btnOK = winButtonBar.AddButton(btnLabelOK, HALIGN_Right);
numButtons = 1;
SetFocusWindow(btnOK);
break;
}

// Tell the shadow which bitmap to use
if (winShadow != None)
MenuUIMessageBoxShadowWindow(winShadow).SetButtonCount(numButtons);


winNotify = newWinNotify;


local bool bHandled;


switch( key )
{
case IK_Escape:
switch( mbMode )
{
case 0: // MB_YesNo:
PostResult(1);
break;
case 1: // MB_OK:
PostResult(0);
break;
}
bHandled = True;
break;

case IK_Enter:
case IK_Space:
if (bDeferredKeyPress)
bKeyPressed = True;
else
PostResult(0);

bHandled = True;
break;

case IK_Y:
if ( mbMode == 0 /*MB_YesNo*/ )
{
if (bDeferredKeyPress)
bKeyPressed = True;
else
PostResult(0);

bHandled = True;
}
break;

case IK_N:
if ( mbMode == 0 /*MB_YesNo*/ )
{
PostResult(1);
bHandled = True;
}
break;
}

return bHandled;





Super.InitWindow();





Super.InitWindow();




var DeusExPlayer player;
var Color colLabel;
var Font fontLabel;
colLabel=(R=255,G=255,B=255)
fontLabel=Font'DeusExUI.FontMenuSmall'

Super.InitWindow();

SetFont(fontLabel);
SetTextMargins(0, 0);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colLabel = theme.GetColorFromName('MenuColor_ListText');

SetTextColor(colLabel);




var DeusExPlayer player;
var ScaleWindow winSlider;
var ScaleManagerWindow winScaleManager;
var MenuUIEditWindow editScaleText;
var MenuUIInfoButtonWindow winEditBorder;
var Texture defaultScaleTexture;
var Texture defaultThumbTexture;
var int defaultWidth;
var int defaultHeight;
defaultScaleTexture=Texture'DeusExUI.UserInterface.MenuSliderBar'
defaultThumbTexture=Texture'DeusExUI.UserInterface.MenuSlider'
DefaultWidth=230
defaultHeight=21

Super.InitWindow();

SetSize(defaultWidth, defaultHeight);

// Create the Scale Manager Window
winScaleManager = ScaleManagerWindow(NewChild(Class'ScaleManagerWindow'));
winScaleManager.SetSize(177, 21);
winScaleManager.SetMarginSpacing(20);

// Create the slider window
winSlider = ScaleWindow(winScaleManager.NewChild(Class'ScaleWindow'));
winSlider.SetScaleOrientation(ORIENT_Horizontal);
winSlider.SetThumbSpan(0);
winSlider.SetScaleTexture(defaultScaleTexture, 177, 21, 8, 8);
winSlider.SetThumbTexture(defaultThumbTexture, 9, 15);

winEditBorder = MenuUIInfoButtonWindow(NewChild(Class'MenuUIInfoButtonWindow'));
winEditBorder.SetWidth(43);
winEditBorder.SetPos(185, 1);
winEditBorder.SetSensitivity(False);

// Create the text window
editScaleText = MenuUIEditWindow(NewChild(Class'MenuUIEditWindow'));
editScaleText.SetSize(39, 10);
editScaleText.SetPos(187, 6);
editScaleText.SetMaxSize(3);

// Tell the Scale Manager wazzup.
winScaleManager.SetScale(winSlider);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


winSlider.SetValueRange(startValue, endValue);
winSlider.SetNumTicks(numTicks);


local ColorTheme theme;
local Color colButtonFace;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colButtonFace = theme.GetColorFromName('MenuColor_ButtonFace');

winSlider.SetThumbColor(colButtonFace);
winSlider.SetScaleColor(colButtonFace);
winSlider.SetTickColor(colButtonFace);




var DeusExPlayer player;
var Texture texture_Top;
var Texture texture_TopLeft;
var Texture texture_TopRight;
var Texture texture_Right;
var Texture texture_Bottom;
var int rightWidth;
var int topLeftWidth;
var int topHeight;
var int bottomRightHeight;
var int topRightHeight;
var int topRightWidth;
var Color colBackground;
texture_Top=Texture'DeusExUI.UserInterface.MenuRightBorder_Top'
texture_TopLeft=Texture'DeusExUI.UserInterface.MenuRightBorder_TopLeft'
texture_TopRight=Texture'DeusExUI.UserInterface.MenuRightBorder_TopRight'
texture_Right=Texture'DeusExUI.UserInterface.MenuRightBorder_Right'
texture_Bottom=Texture'DeusExUI.UserInterface.MenuRightBorder_BottomRight'
rightWidth=4
topLeftWidth=2
topHeight=4
bottomRightHeight=13
topRightHeight=6
topRightWidth=5
colBackground=(R=255,G=255,B=255)

// Draw the textures
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colBackground);

// Top left
gc.DrawTexture(0, 0, topLeftWidth, topHeight, 0, 0, texture_TopLeft);

// Top Edge
gc.DrawPattern(
topLeftwidth, 0,
width - topLeftwidth - topRightWidth, topHeight,
0, 0,
texture_Top);

// Top Right Corner
gc.DrawTexture(width - topRightWidth, 0, topRightWidth, topRightHeight, 0, 0, texture_TopRight);

// Right Edge
gc.DrawPattern(
width - rightWidth, topRightHeight,
rightWidth, height - topRightHeight - bottomRightHeight,
0, 0,
texture_Right);

// Bottom Right
gc.DrawTexture(
width - rightWidth, height - bottomRightHeight,
rightWidth, bottomRightHeight,
0, 0, texture_Bottom);


Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colBackground = theme.GetColorFromName('MenuColor_ButtonFace');




var int choiceVerticalGap;
var int choiceCount;
var int choiceStartX;
var int choiceStartY;
var Class choices[13];
var MenuUIChoice currentChoice;
choiceVerticalGap=36
choiceStartX=7
choiceStartY=27
textureRows=2
textureCols=3
bActionButtonBarActive=True
bLeftEdgeActive=True
bRightEdgeActive=True
ScreenType=ST_MenuScreen

local Window btnChoice;


btnChoice = winClient.GetTopChild();
while(btnChoice != None)
{
if (btnChoice.IsA('MenuUIChoice'))
MenuUIChoice(btnChoice).CancelSetting();

btnChoice = btnChoice.GetLowerSibling();
}

Super.CancelScreen();


local int choiceIndex;
local MenuUIChoice newChoice;


// Loop through the Menu Choices and create the appropriate buttons
for(choiceIndex=0; choiceIndex {
if (choices[choiceIndex] != None)
{
newChoice = MenuUIChoice(winClient.NewChild(choices[choiceIndex]));
newChoice.SetPos(choiceStartX, choiceStartY + (choiceCount * choiceVerticalGap) - newChoice.buttonVerticalOffset);
choiceCount++;
}
}


local MenuUIChoice choice;


if (enterWindow.IsA('MenuUIActionButtonWindow'))
{
// Check to see if the parent is our MenuUIChoice window
choice = MenuUIChoice(enterWindow.GetParent());

if (choice != None)
{
currentChoice = choice;

if ((winHelp != None) && (currentChoice.helpText != ""))
{
winHelp.Show();
winHelp.SetText(currentChoice.helpText);
}
}
}


if ((winHelp != None) && (!bHelpAlwaysOn))
winHelp.Hide();

currentChoice = None;


Super.InitWindow();

CreateChoices();
LoadSettings();


local Window btnChoice;


btnChoice = winClient.GetTopChild();
while(btnChoice != None)
{
if (btnChoice.IsA('MenuUIChoice'))
MenuUIChoice(btnChoice).LoadSetting();

btnChoice = btnChoice.GetLowerSibling();
}


local Window btnChoice;


btnChoice = winClient.GetTopChild();
while(btnChoice != None)
{
if (btnChoice.IsA('MenuUIChoice'))
MenuUIChoice(btnChoice).ResetToDefault();

btnChoice = btnChoice.GetLowerSibling();
}


local Window btnChoice;


btnChoice = winClient.GetTopChild();
while(btnChoice != None)
{
if (btnChoice.IsA('MenuUIChoice'))
MenuUIChoice(btnChoice).SaveSetting();

btnChoice = btnChoice.GetLowerSibling();
}

Super.SaveSettings();


local bool bHandled;

bHandled = True;

if ( IsKeyDown( IK_Alt ) || IsKeyDown( IK_Shift ) || IsKeyDown( IK_Ctrl ))
return False;

switch( key )
{
// If a MenuUIChoice has focus, cycle to previous choice
case IK_Left:
if (currentChoice != None)
{
bHandled = True;
PlaySound(Sound'Menu_Press', 0.25);
currentChoice.CyclePreviousValue();
}
break;

// If a MenuEnumButton has focus, cycle to next choice
case IK_Right:
if (currentChoice != None)
{
bHandled = True;
PlaySound(Sound'Menu_Press', 0.25);
currentChoice.CycleNextValue();
}
break;

default:
bHandled = False;
}

if (!bHandled)
return Super.VirtualKeyPressed(key, bRepeat);
else
return bHandled;




var DeusExPlayer player;
var Color colButtonFace;
colButtonFace=(R=255,G=255,B=255)

Super.InitWindow();
EnableScrolling(False, True);
SetAreaMargins(0, 0);
SetScrollbarDistance(0);

vScale.SetThumbCaps(
Texture'MenuVScrollThumb_Top',
Texture'MenuVScrollThumb_Bottom',
9, 6, 9, 6);

vScale.SetThumbTexture(Texture'MenuVScrollThumb_Center', 9, 2);
vScale.SetScaleTexture(Texture'MenuVScrollScale', 15, 2, 0, 0);
vScale.SetScaleMargins(0, 0);
vScale.SetThumbStyle(DSTY_Masked);
vScale.SetScaleSounds(Sound'Menu_Press', Sound'Menu_Press', Sound'Menu_Slider');
vScale.SetSoundVolume(0.25);

upButton.SetSize(15, 15);
upButton.SetBackgroundStyle(DSTY_Masked);
upButton.SetButtonTextures(
Texture'MenuVScrollUpButton_Normal', Texture'MenuVScrollUpButton_Pressed',
Texture'MenuVScrollUpButton_Normal', Texture'MenuVScrollUpButton_Pressed',
Texture'MenuVScrollUpButton_Normal', Texture'MenuVScrollUpButton_Pressed');
upButton.SetButtonSounds(None, Sound'Menu_Press');
upButton.SetFocusSounds(Sound'Menu_Focus');
upButton.SetSoundVolume(0.25);


downButton.SetSize(15, 15);
downButton.SetBackgroundStyle(DSTY_Masked);
downButton.SetButtonTextures(
Texture'MenuVScrollDownButton_Normal', Texture'MenuVScrollDownButton_Pressed',
Texture'MenuVScrollDownButton_Normal', Texture'MenuVScrollDownButton_Pressed',
Texture'MenuVScrollDownButton_Normal', Texture'MenuVScrollDownButton_Pressed');
downButton.SetButtonSounds(None, Sound'Menu_Press');
downButton.SetFocusSounds(Sound'Menu_Focus');
downButton.SetSoundVolume(0.25);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colButtonFace = theme.GetColorFromName('MenuColor_ButtonFace');

upButton.SetButtonColors(colButtonFace, colButtonFace, colButtonFace,
colButtonFace, colButtonFace, colButtonFace);

downButton.SetButtonColors(colButtonFace, colButtonFace, colButtonFace,
colButtonFace, colButtonFace, colButtonFace);

vScale.SetScaleColor(colButtonFace);
vScale.SetThumbColor(colButtonFace);




var DeusExPlayer player;
var int shadowWidth;
var int shadowHeight;
var int shadowOffsetX;
var int shadowOffsetY;

Super.InitWindow();
SetSize(shadowWidth, shadowHeight);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);




var DeusExPlayer player;
var Skill skill;
var Window winSkillIcon;
var TextWindow winSkillName;
var MenuUIScrollAreaWindow winScroll;
var LargeTextWindow winSkillDescription;
var Color colSkillName;
var Color colSkillDesc;
colSkillName=(R=255,G=255,B=255)
colSkillDesc=(R=200,G=200,B=200)

winSkillIcon = NewChild(Class'Window');
winSkillIcon.SetPos(3, 20);
winSkillIcon.SetSize(24, 24);
winSkillIcon.SetBackgroundStyle(DSTY_Masked);

winSkillName = TextWindow(NewChild(Class'TextWindow'));
winSkillName.SetPos(39, 2);
winSkillName.SetSize(300, 12);
winSkillName.SetTextMargins(0, 0);
winSkillName.SetFont(Font'FontMenuHeaders');
winSkillName.SetTextAlignments(HALIGN_Left, VALIGN_Top);

winScroll = MenuUIScrollAreaWindow(NewChild(Class'MenuUIScrollAreaWindow'));
winScroll.SetPos(39, 20);
winScroll.SetSize(362, 104);

winSkillDescription = LargeTextWindow(winScroll.clipWindow.NewChild(Class'LargeTextWindow'));
winSkillDescription.SetTextMargins(0, 0);
winSkillDescription.SetFont(Font'FontMenuSmall');
winSkillDescription.SetTextAlignments(HALIGN_Left, VALIGN_Top);


Super.InitWindow();

SetSize(405, 130);

// Create controls
CreateControls();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


skill = newSkill;

winSkillIcon.SetBackground(skill.SkillIcon);
winSkillName.SetText(skill.SkillName);
winSkillDescription.SetText(skill.Description);


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colSkillName = theme.GetColorFromName('MenuColor_ButtonFace');
colSkillDesc = theme.GetColorFromName('MenuColor_ButtonFace');

winSkillName.SetTextColor(colSkillName);
winSkillDescription.SetTextColor(colSkillDesc);




var DeusExPlayer player;
var ScaleWindow winSlider;
var ScaleManagerWindow winScaleManager;
var MenuUIInfoButtonWindow winScaleText;
var Texture defaultScaleTexture;
var Texture defaultThumbTexture;
var int defaultWidth;
var int defaultHeight;
var int defaultScaleWidth;
var Bool bUseScaleText;
defaultScaleTexture=Texture'DeusExUI.UserInterface.MenuSliderBar'
defaultThumbTexture=Texture'DeusExUI.UserInterface.MenuSlider'
DefaultWidth=243
defaultHeight=21
defaultScaleWidth=177
bUseScaleText=True

Super.InitWindow();

SetSize(defaultWidth, defaultHeight);

// Create the Scale Manager Window
winScaleManager = ScaleManagerWindow(NewChild(Class'ScaleManagerWindow'));
winScaleManager.SetSize(defaultScaleWidth, 21);
winScaleManager.SetMarginSpacing(20);

// Create the slider window
winSlider = ScaleWindow(winScaleManager.NewChild(Class'ScaleWindow'));
winSlider.SetScaleOrientation(ORIENT_Horizontal);
winSlider.SetThumbSpan(0);
winSlider.SetScaleTexture(defaultScaleTexture, defaultScaleWidth, 21, 8, 8);
winSlider.SetThumbTexture(defaultThumbTexture, 9, 15);
winSlider.SetScaleSounds(Sound'Menu_Press', None, Sound'Menu_Slider');
winSlider.SetSoundVolume(0.25);

// Create the text window
if (bUseScaleText)
{
winScaleText = MenuUIInfoButtonWindow(NewChild(Class'MenuUIInfoButtonWindow'));
winScaleText.SetSelectability(False);
winScaleText.SetWidth(60);
winScaleText.SetPos(184, 1);
}

// Tell the Scale Manager wazzup.
winScaleManager.SetScale(winSlider);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


winSlider.SetValueRange(startValue, endValue);
winSlider.SetNumTicks(numTicks);


local ColorTheme theme;
local Color colButtonFace;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colButtonFace = theme.GetColorFromName('MenuColor_ButtonFace');

winSlider.SetThumbColor(colButtonFace);
winSlider.SetScaleColor(colButtonFace);
winSlider.SetTickColor(colButtonFace);




fontLabel=Font'DeusExUI.FontMenuSmall'



var DeusExPlayer player;
var Texture texNormal;
var Texture texFocus;

Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

SetSize(25, 19);

StyleChanged();


local ColorTheme theme;
local Color colButtonFace;


theme = player.ThemeManager.GetCurrentMenuColorTheme();
colButtonFace = theme.GetColorFromName('MenuColor_ButtonFace');

SetButtonColors(
colButtonFace, colButtonFace, colButtonFace,
colButtonFace, colButtonFace, colButtonFace);





local ColorTheme theme;


Super.StyleChanged();

theme = player.ThemeManager.GetCurrentMenuColorTheme();

colButtonFace = theme.GetColorFromName('MenuColor_ButtonFace');
colText[0] = theme.GetColorFromName('MenuColor_ButtonTextNormal');
colText[1] = colText[0];
colText[2] = colText[0];
colText[3] = colText[0];




var DeusExPlayer player;
var String buttonText;
var Color colText;
var Color colTextDisabled;
var Font fontText;
var int fontBaseLine;
var int fontAcceleratorLineHeight;
fontText=Font'DeusExUI.FontMenuTitle'
fontBaseLine=1
fontAcceleratorLineHeight=1

// Draw the text

// If the button is insensitive, then draw it differently
if (IsSensitive())
gc.SetTextColor(colText);
else
gc.SetTextColor(colTextDisabled);

// If the button is pressed, draw the text down and to the right
if ( bButtonPressed )
gc.DrawText(1, 1, width, height, buttonText);
else
gc.DrawText(0, 0, width, height, buttonText);


Super.InitWindow();

EnableTextAsAccelerator(false);

SetSize(70, 17);
SetFont(fontText);
SetBackgroundStyle(DSTY_Masked);
SetButtonTextures(
Texture'MenuTabButton_Normal', Texture'MenuTabButton_Pressed',
Texture'MenuTabButton_Normal', Texture'MenuTabButton_Pressed',
Texture'MenuTabButton_Normal', Texture'MenuTabButton_Normal');

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

SetBaselineData(fontBaseLine, fontAcceleratorLineHeight);

StyleChanged();


buttonText = newButtonText;

SetAcceleratorText(newButtonText);


local Color colButtonFace;
local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

colButtonFace = theme.GetColorFromName('MenuColor_ButtonFace');
colText = theme.GetColorFromName('MenuColor_ButtonTextNormal');
colTextDisabled = theme.GetColorFromName('MenuColor_ButtonTextFocus');

SetButtonColors(colButtonFace, colButtonFace, colButtonFace,
colButtonFace, colButtonFace, colButtonFace);




var DeusExPlayer player;
var Window winIcon;
var int titleHeight;
var int minTitleWidth;
var int titleLeftMargin;
var int titleRightMargin;
var int maxTextWidth;
var Texture textureAppIcon;
var Font fontTitle;
var String titleText;
var Color colTitle;
var Color colTitleText;
var Color colBubble;
var Texture titleTexture_Left;
var Texture titleTexture_Center;
var Texture titleTexture_Right;
var Texture titleTexture_LeftBottom;
var Texture titleBubble_Left;
var Texture titleBubble_Center;
var Texture titleBubble_Right;
var int leftWidth;
var int rightWidth;
var int centerWidth;
var int leftBottomWidth;
var int leftBottomHeight;
titleHeight=23
minTitleWidth=200
titleLeftMargin=31
titleRightMargin=45
maxTextWidth=400
textureAppIcon=Texture'DeusExUI.UserInterface.MenuIcon_DeusEx'
fontTitle=Font'DeusExUI.FontMenuTitle'
colTitle=(R=255,G=255,B=255)
colTitleText=(R=255,G=255,B=255)
colBubble=(R=255,G=255,B=255)
titleTexture_Left=Texture'DeusExUI.UserInterface.MenuTitleBar_Left'
titleTexture_Center=Texture'DeusExUI.UserInterface.MenuTitleBar_Center'
titleTexture_Right=Texture'DeusExUI.UserInterface.MenuTitleBar_Right'
titleTexture_LeftBottom=Texture'DeusExUI.UserInterface.MenuTitleBar_LeftBottom'
titleBubble_Left=Texture'DeusExUI.UserInterface.MenuTitleBubble_Left'
titleBubble_Center=Texture'DeusExUI.UserInterface.MenuTitleBubble_Center'
titleBubble_Right=Texture'DeusExUI.UserInterface.MenuTitleBubble_Right'
leftWidth=87
rightWidth=100
CenterWidth=8
leftBottomWidth=10
leftBottomHeight=53

winIcon = NewChild(Class'Window');
winIcon.SetPos(12, 3);
winIcon.SetSize(16, 16);
winIcon.SetBackground(textureAppIcon);


// Draw the title Background textures
gc.SetStyle(DSTY_Masked);
gc.SetTileColor(colTitle);

// Left
gc.DrawTexture(0, 0, leftWidth, titleHeight, 0, 0, titleTexture_Left);

// Left bottom
gc.DrawTexture(0, titleHeight - 1, leftBottomWidth, leftBottomHeight, 0, 0, titleTexture_LeftBottom);

// Center
gc.DrawPattern(
leftWidth, 0,
width - leftWidth - rightWidth, titleHeight,
0, 0,
titleTexture_Center);

// Right
gc.DrawTexture(width - rightWidth, 0, rightWidth, titleHeight, 0, 0, titleTexture_Right);

// Now draw the Bubble textures
gc.SetStyle(DSTY_Masked);
gc.SetTileColor(colBubble);

// Left
gc.DrawTexture(0, 0, leftWidth, titleHeight, 0, 0, titleBubble_Left);

// Center
gc.DrawPattern(
leftWidth, 0,
width - leftWidth - rightWidth, titleHeight,
0, 0,
titleBubble_Center);

// Right
gc.DrawTexture(width - rightWidth, 0, rightWidth, titleHeight, 0, 0, titleBubble_Right);

// Draw the text!
gc.SetFont(fontTitle);
gc.SetTextColor(colTitleText);
gc.SetHorizontalAlignment(HALIGN_Left);
gc.SetVerticalAlignment(VALIGN_Center);

gc.DrawText(titleLeftMargin, 0, width - titleLeftMargin, titleHeight, titleText);

Super.DrawWindow(gc);


titleOffsetX = leftBottomWidth;
titleOffsetY = titleHeight;


Super.InitWindow();

CreateIconWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();


titleText = newTitle;

AskParentForReconfigure();


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

// Title colors
colTitle = theme.GetColorFromName('MenuColor_ButtonFace');
colTitleText = theme.GetColorFromName('MenuColor_TitleText');
colBubble = theme.GetColorFromName('MenuColor_TitleBackground');




var EHALIGN align;
var EActionButtonEvents action;
var localized String text;
var String key;
var MenuUIActionButtonWindow btn;
var localized S_ActionButtonDefault actionButtons[5];
var EMessageBoxModes messageBoxMode;
var MenuUITitleWindow winTitle; // Title bar, outside client
var MenuUIClientWindow winClient; // Window that contains all controls
var MenuUIActionButtonBarWindow winButtonBar; // Button Bar Window
var MenuUILeftEdgeWindow winLeftEdge;
var MenuUIRightEdgeWindow winRightEdge;
var MenuUIHelpWindow winHelp;
var Bool bWindowBeingDragged;
var Bool bAllowWindowDragging;
var float windowStartDragX;
var float windowStartDragY;
var localized String title;
var int clientWidth;
var int clientHeight;
var int verticalOffset;
var Texture clientTextures[6];
var int textureRows;
var int textureCols;
var bool bActionButtonBarActive;
var bool bLeftEdgeActive;
var bool bRightEdgeActive;
var bool bUsesHelpWindow;
var bool bHelpAlwaysOn;
var bool bEscapeSavesSettings;
var int helpPosY;
var int defaultHelpLeftOffset;
var int defaultHelpHeight;
var int defaultHelpClientDiffY;
var Class winShadowClass;
var MenuUIShadowWindow winShadow;
var int shadowOffsetX;
var int shadowOffsetY;
var int shadowWidth;
var int shadowHeight;
var localized string btnLabelOK;
var localized string btnLabelCancel;
var localized string btnLabelPrevious;
var localized string btnLabelResetToDefaults;
var localized string MessageBoxTitle;
var localized string ExitMessage;
var localized string TrainingWarningMessage;
var localized string IntroWarningMessage;
var localized string AskToTrainTitle;
var localized string AskToTrainMessage;
bUsesHelpWindow=True
bEscapeSavesSettings=True
defaultHelpLeftOffset=7
defaultHelpHeight=27
defaultHelpClientDiffY=21
btnLabelOK="|&OK"
btnLabelCancel="|&Cancel"
btnLabelPrevious="|&Previous"
btnLabelResetToDefaults="|&Restore Defaults"
MessageBoxTitle="Please Confirm"
ExitMessage="Are you sure you|nwant to exit Deus Ex?"
TrainingWarningMessage="The current game you are playing will be lost if you have not already saved it. Do you still wish to enter the training mission?"
IntroWarningMessage="The current game you are playing will be lost if you have not already saved it. Do you still wish to view the intro?"
AskToTrainTitle="Training Mission"
AskToTrainMessage="Before starting a new game for the first time, we suggest running through the Training Mission. Would you like to do this now?"

// Destroy the msgbox!
root.PopWindow();

switch(messageBoxMode)
{
case MB_Exit:
if ( buttonNumber == 0 )
{
/* TODO: This is what Unreal Does,
player.SaveConfig();
if ( Level.Game != None )
Level.Game.SaveConfig();
*/

root.ExitGame();
}
break;

case MB_AskToTrain:
if (buttonNumber == 0)
player.StartTrainingMission();
else
root.InvokeMenuScreen(Class'MenuSelectDifficulty');
break;

case MB_Training:
if (buttonNumber == 0)
player.StartTrainingMission();
break;

case MB_Intro:
if (buttonNumber == 0)
player.ShowIntro();
break;

case MB_JoinGameWarning:
if (buttonNumber == 0)
{
if (Self.IsA('MenuScreenJoinGame'))
MenuScreenJoinGame(Self).RefreshServerList();
}
break;
}

return true;


local bool bHandled;


bHandled = False;

// Check to see if this was an action button!
if (buttonPressed.IsA('MenuUIActionButtonWindow'))
{
bHandled = ProcessActionButton(MenuUIActionButtonWindow(buttonPressed));
}

if (bHandled)
return bHandled;
else
return Super.ButtonActivated(buttonPressed);


// Play Cancel Sound
PlaySound(Sound'Menu_Cancel', 0.25);

root.PopWindow();


return False;


local float clientWidth, clientHeight;
local float titleWidth, titleHeight, titleTopHeight, titleBarWidth;
local float leftEdgeWidth, leftEdgeHeight;
local float rightEdgeWidth, rightEdgeHeight;
local float buttonBarWidth, buttonBarHeight;
local float rightEdgeX, rightEdgeY;
local float winLeftEdgeGap;
local float rightEdgeGap;
local int titleOffsetX, titleOffsetY;


if (winTitle != None)
winTitle.GetOffsetWidths(titleOffsetX, titleOffsetY);

// Client Window
if (winClient != None)
{
winClient.QueryPreferredSize(clientWidth, clientHeight);
winClient.ConfigureChild(
titleOffsetX + shadowOffsetX, titleOffsetY + shadowOffsetY,
clientWidth, clientHeight);
}

// Title Bar
if (winTitle != None)
{
winTitle.QueryPreferredSize(titleBarWidth, titleHeight);
winTitle.ConfigureChild(
shadowOffsetX, shadowOffsetY,
titleBarWidth, titleHeight);

titleWidth = winTitle.leftBottomWidth;
titleTopHeight = winTitle.titleHeight;
}

// Button Bar
if (winButtonBar != None)
{
// If Right edge active, need to make button bar wider
if (winRightEdge != None)
{
winRightEdge.QueryPreferredSize(rightEdgeWidth, rightEdgeHeight);
rightEdgeWidth = winRightEdge.rightWidth;
rightEdgeGap = 2;
}

if (winLeftEdge != None)
winLeftEdgeGap = 1;

winButtonBar.QueryPreferredSize(buttonBarWidth, buttonBarHeight);
winButtonBar.ConfigureChild(
titleWidth + winLeftEdgeGap + shadowOffsetX, titleTopHeight + clientHeight + shadowOffsetY,
clientWidth - 1 - rightEdgeGap, buttonBarHeight);
}

// Left Edge
if (winLeftEdge != None)
{
winLeftEdge.QueryPreferredSize(LeftEdgeWidth, LeftEdgeHeight);
winLeftEdge.ConfigureChild(
titleWidth - LeftEdgeWidth + shadowOffsetX, titleHeight + shadowOffsetY,
LeftEdgeWidth, clientHeight + buttonBarHeight - (titleHeight - titleTopHeight) - 1);
}

// Right Edge
if (winRightEdge != None)
{
winRightEdge.ConfigureChild(
titleBarWidth + 1 + shadowOffsetX, titleTopHeight - 4 + shadowOffsetY,
clientWidth - (titleBarWidth - titleWidth) - 1 + winRightEdge.rightWidth,
clientHeight + 4 + 14);
}

// Configure Help Window
if (winHelp != None)
{
winHelp.ConfigureChild(
titleWidth + defaultHelpLeftOffset + shadowOffsetX, titleTopHeight + helpPosY + shadowOffsetY,
clientWidth - defaultHelpClientDiffY, defaultHelpHeight);
}


local DeusExLevelInfo info;


info = player.GetLevelInfo();

// If the game is running, first *PROMPT* the user, becauase
// otherwise the current game will be lost

if (((info != None) && (info.MissionNumber >= 0)) &&
!((player.IsInState('Dying')) || (player.IsInState('Paralyzed'))))
{
messageBoxMode = MB_Intro;
root.MessageBox(MessageBoxTitle, IntroWarningMessage, 0, False, Self);
}
else
{
player.ShowIntro();
}


local DeusExLevelInfo info;


info = player.GetLevelInfo();

// If the game is running, first *PROMPT* the user, becauase
// otherwise the current game will be lost

if (((info != None) && (info.MissionNumber >= 0)) &&
!((player.IsInState('Dying')) || (player.IsInState('Paralyzed'))))
{
messageBoxMode = MB_Training;
root.MessageBox(MessageBoxTitle, TrainingWarningMessage, 0, False, Self);
}
else
{
player.StartTrainingMission();
}


// Only create if we're supposed to create it
if (bActionButtonBarActive)
winButtonBar = MenuUIActionButtonBarWindow(NewChild(Class'MenuUIActionButtonBarWindow'));


local int buttonIndex;
local string buttonText;


if (winButtonBar == None)
return;

for(buttonIndex=0; buttonIndex {
if (actionButtons[buttonIndex].action != AB_None)
{
// First get the string
switch(actionButtons[buttonIndex].action)
{
case AB_OK:
buttonText = btnLabelOK;
break;

case AB_Cancel:
buttonText = btnLabelCancel;
break;

case AB_Reset:
buttonText = btnLabelResetToDefaults;
break;

case AB_Previous:
buttonText = btnLabelPrevious;
break;

case AB_Other:
buttonText = actionButtons[buttonIndex].text;
break;
}

actionButtons[buttonIndex].btn =
winButtonBar.AddButton(buttonText, actionButtons[buttonIndex].align);
}
else
{
break;
}
}


local int clientIndex;
local int titleOffsetX, titleOffsetY;


winClient = MenuUIClientWindow(NewChild(class'MenuUIClientWindow'));

winTitle.GetOffsetWidths(titleOffsetX, titleOffsetY);

winClient.SetSize(clientWidth, clientHeight);
winClient.SetTextureLayout(textureCols, textureRows);

// Set background textures
for(clientIndex=0; clientIndex {
winClient.SetClientTexture(clientIndex, clientTextures[clientIndex]);
}


CreateShadowWindow();
CreateTitleWindow();
CreateClientWindow();
CreateActionButtonBar();
CreateActionButtons();
CreateLeftEdgeWindow();
CreateRightEdgeWindow();
CreateHelpWindow();


if (bUsesHelpWindow)
{
winHelp = MenuUIHelpWindow(NewChild(Class'MenuUIHelpWindow'));

if (!bHelpAlwaysOn)
winHelp.Hide();
}


if (bLeftEdgeActive)
winLeftEdge = MenuUILeftEdgeWindow(NewChild(Class'MenuUILeftEdgeWindow'));


local MenuUIInfoButtonWindow btnInfo;
local ClipWindow clipName;
local MenuUIEditWindow newEdit;


// Create an info button behind this sucker
btnInfo = MenuUIInfoButtonWindow(winParent.NewChild(Class'MenuUIInfoButtonWindow'));
btnInfo.SetPos(posX, posY);
btnInfo.SetWidth(editWidth);
btnInfo.SetSensitivity(False);

clipName = ClipWindow(winClient.newChild(Class'ClipWindow'));
clipName.SetWidth(editWidth - 8);
clipName.ForceChildSize(False, True);
clipName.SetPos(posX + 4, posY + 5);

newEdit = MenuUIEditWindow(clipName.NewChild(Class'MenuUIEditWindow'));
newEdit.SetMaxSize(maxChars);

return newEdit;


local MenuUIHeaderWindow newLabel;


newLabel = MenuUIHeaderWindow(winParent.NewChild(Class'MenuUIHeaderWindow'));

newLabel.SetPos(posX, posY);
newLabel.SetText(strLabel);

return newLabel;


local MenuUILabelWindow newLabel;


newLabel = MenuUILabelWindow(winParent.NewChild(Class'MenuUILabelWindow'));

newLabel.SetPos(posX, posY);
newLabel.SetText(strLabel);

return newLabel;


local MenuUITabButtonWindow newButton;


newButton = MenuUITabButtonWindow(winClient.NewChild(Class'MenuUITabButtonWindow'));
newButton.SetPos(posX, posY);
newButton.SetButtonText(buttonText);

return newButton;


if (bRightEdgeActive)
{
winRightEdge = MenuUIRightEdgeWindow(NewChild(Class'MenuUIRightEdgeWindow'));
winRightEdge.Lower();
}


return MenuUIScrollAreaWindow(winParent.NewChild(Class'MenuUIScrollAreaWindow'));


if (winShadowClass != None)
{
winShadow = MenuUIShadowWindow(NewChild(winShadowClass));

// Store these away so we can properly calculate window sizes/positions
shadowOffsetX = winShadow.shadowOffsetX;
shadowOffsetY = winShadow.shadowOffsetY;
shadowWidth = winShadow.shadowWidth;
shadowHeight = winShadow.shadowHeight;
}


winTitle = MenuUITitleWindow(NewChild(Class'MenuUITitleWindow'));
SetTitle(title);


local int texIndex;


for(texIndex=0; texIndex player.UnloadTexture(clientTextures[texIndex]);

Super.DestroyWindow();


if (winHelp != None)
winHelp.Hide();


Super.InitWindow();

bSizeParentToChildren = False; // god damnit

CreateControls();
StyleChanged();

// Play Menu Activated Sound
PlaySound(Sound'Menu_Activate', 0.25);


if ( bWindowBeingDragged )
SetPos( x + (newX - windowStartDragX), y + (newY - windowStartDragY) );


local int buttonIndex;
local bool bHandled;


bHandled = False;

// Find out which button this is in our array

for(buttonIndex=0; buttonIndex {
if (actionButtons[buttonIndex].btn == btnAction)
{
switch(actionButtons[buttonIndex].action)
{
case AB_OK:
SaveSettings();
root.PopWindow();
break;

case AB_Cancel:
CancelScreen();
break;

case AB_Reset:
ResetToDefaults();
break;

case AB_Previous:
SaveSettings();
root.PopWindow();
break;

case AB_Other:
ProcessAction(actionButtons[buttonIndex].key);
break;
}

bHandled = True;
break;
}
}

return bHandled;


// Play OK Sound
PlaySound(Sound'Menu_OK', 0.25);


winTitle.SetTitle(newTitle);


if (winHelp != None)
{
winHelp.Show();
winHelp.SetText(helpMessage);
}


// Check to see if the player has already ran the training mission
// or been prompted
if (player.bAskedToTrain == False)
{
messageBoxMode = MB_AskToTrain;
player.bAskedToTrain = True; // Only prompt ONCE!
player.SaveConfig();
root.MessageBox(AskToTrainTitle, AskToTrainMessage, 0, False, Self);
}
else
{
root.InvokeMenuScreen(Class'MenuSelectDifficulty');
}


local ColorTheme theme;
local Color colCursor;


theme = player.ThemeManager.GetCurrentMenuColorTheme();

colCursor = theme.GetColorFromName('MenuColor_Cursor');

SetDefaultCursor(Texture'DeusExCursor1', Texture'DeusExCursor1_Shadow', 32, 32, colCursor);


local bool bKeyHandled;

bKeyHandled = True;

Super.VirtualKeyPressed(key, bRepeat);

if ( IsKeyDown( IK_Alt ) || IsKeyDown( IK_Shift ) || IsKeyDown( IK_Ctrl ))
return False;

switch( key )
{
// Hide the screen if the Escape key is pressed
// Temp: Also if the Return key is pressed
case IK_Escape:
if (bEscapeSavesSettings)
{
SaveSettings();
root.PopWindow();
}
else
{
CancelScreen();
}
break;

// Enter is the same as clicking OK
case IK_Enter:
SaveSettings();
root.PopWindow();
break;

default:
bKeyHandled = False;
}

return bKeyHandled;




MetalFragment.uc (extends DeusExFragment)

Fragments(0)=LodMesh'DeusExItems.MetalFragment1'
Fragments(1)=LodMesh'DeusExItems.MetalFragment2'
Fragments(2)=LodMesh'DeusExItems.MetalFragment3'
numFragmentTypes=3
elasticity=0.400000
ImpactSound=Sound'DeusExSounds.Generic.MetalHit1'
MiscSound=Sound'DeusExSounds.Generic.MetalHit2'
Mesh=LodMesh'DeusExItems.GlassFragment1'
CollisionRadius=6.000000
CollisionHeight=0.000000
Mass=5.000000
Buoyancy=3.000000



MichaelHamner.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.MichaelHamnerCarcass'
WalkingSpeed=0.213333
bImportant=True
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MichaelHamnerTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MichaelHamnerTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MichaelHamnerTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MichaelHamnerTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MichaelHamnerTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.LensesTex2'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="MichaelHamner"
FamiliarName="Michael Hamner"
UnfamiliarName="Michael Hamner"



MichaelHamnerCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MichaelHamnerTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MichaelHamnerTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MichaelHamnerTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MichaelHamnerTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MichaelHamnerTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.LensesTex2'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



Microscope.uc (extends DeusExDecoration)

ItemName="Microscope"
Mesh=LodMesh'DeusExDeco.Microscope'
CollisionRadius=6.420000
CollisionHeight=10.660000
Mass=20.000000
Buoyancy=10.000000



MilitaryBot.uc (extends Robot)

var() ESkinColor SkinColor;
SearchingSound=Sound'DeusExSounds.Robot.MilitaryBotSearching'
SpeechTargetAcquired=Sound'DeusExSounds.Robot.MilitaryBotTargetAcquired'
SpeechTargetLost=Sound'DeusExSounds.Robot.MilitaryBotTargetLost'
SpeechOutOfAmmo=Sound'DeusExSounds.Robot.MilitaryBotOutOfAmmo'
SpeechCriticalDamage=Sound'DeusExSounds.Robot.MilitaryBotCriticalDamage'
SpeechScanning=Sound'DeusExSounds.Robot.MilitaryBotScanning'
EMPHitPoints=200
explosionSound=Sound'DeusExSounds.Robot.MilitaryBotExplode'
WalkingSpeed=1.000000
bEmitDistress=True
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponRobotMachinegun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=24)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponRobotRocket')
InitialInventory(3)=(Inventory=Class'DeusEx.AmmoRocketRobot',Count=10)
WalkSound=Sound'DeusExSounds.Robot.MilitaryBotWalk'
GroundSpeed=44.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
Health=600
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.MilitaryBot'
CollisionRadius=80.000000
CollisionHeight=79.000000
Mass=2000.000000
Buoyancy=100.000000
RotationRate=(Yaw=10000)
BindName="MilitaryBot"
FamiliarName="Military Bot"
UnfamiliarName="Military Bot"

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_UNATCO: Skin = Texture'MilitaryBotTex1'; break;
case SC_Chinese: Skin = Texture'MilitaryBotTex2'; break;
}

PlayDisabled


local int rnd;


rnd = Rand(3);
if (rnd == 0)
TweenAnimPivot('Disabled1', 0.2);
else if (rnd == 1)
TweenAnimPivot('Disabled2', 0.2);
else
TweenAnimPivot('Still', 0.2);




MiniSub.uc (extends Vehicles)

ItemName="Mini-Submarine"
Texture=Texture'DeusExItems.Skins.ReflectionMapTex1'
Mesh=LodMesh'DeusExDeco.MiniSub'
CollisionRadius=110.629997
CollisionHeight=53.439999
Mass=10000.000000
Buoyancy=10000.000000



Mission00.uc (extends MissionScript)

FirstFrame


local UNATCOTroop troop;
local LAM lam;


Super.FirstFrame();

// zero the player's skill points
Player.SkillPointsTotal = 0;
Player.SkillPointsAvail = 0;

if (localURL == "00_TRAINING")
{
// knock this guy out
foreach AllActors(class'UNATCOTroop', troop, 'Test_Subject')
{
troop.HealthTorso = 0;
troop.Health = 0;
troop.bStunned = True;
troop.TakeDamage(1, troop, troop.Location, vect(0,0,0), 'KnockedOut');
}
}
else if (localURL == "00_TRAININGCOMBAT")
{
// fool a lam into thinking that the player set it
foreach AllActors(class'LAM', lam, 'Bot1LAM')
lam.SetOwner(Player);
}

PreTravel


Super.PreTravel();

RemoveAllInventory


local Inventory item, nextItem, lastItem;


if (Player.Inventory != None)
{
item = Player.Inventory;
nextItem = item.Inventory;
lastItem = item;

do
{
if ((item != None) && item.bDisplayableInv || item.IsA('Ammo'))
{
// make sure everything is turned off
if (item.IsA('DeusExWeapon'))
{
DeusExWeapon(item).ScopeOff();
DeusExWeapon(item).LaserOff();
}
if (item.IsA('DeusExPickup'))
{
if (DeusExPickup(item).bActive)
DeusExPickup(item).Activate();
}

if (item.IsA('ChargedPickup'))
Player.RemoveChargedDisplay(ChargedPickup(item));

Player.DeleteInventory(item);
item.Destroy();
item = Player.Inventory;
}
else
item = nextItem;

if (item != None)
nextItem = item.Inventory;
}
until ((item == None) || (item == lastItem));
}

Timer


local int count;
local Containers crate;
local BobPage Bob;
local JaimeReyes Jaime;
local SecurityBot2 bot;
local LAM lam;
local Skill aSkill;


Super.Timer();

if (localURL == "00_TRAINING")
{
// delete the player's inventory in case he tries to keep it
if (flags.GetBool('MunitionsTrooperReady'))
RemoveAllInventory();

// see if the player has broken all the crates
if (!flags.GetBool('MS_CratesBroken'))
{
count = 0;
foreach AllActors(class'Containers', crate)
if ((crate.Tag == 'Cratepick1') || (crate.Tag == 'Cratepick2'))
count++;

// if the player breaks one of the crates
if (count < 2)
{
Player.StartDataLinkTransmission("DL_Lockpick");
flags.SetBool('MS_CratesBroken', True);
}
}

// hide holo-Bob
if (flags.GetBool('M00MeetPage_Played') &&
!flags.GetBool('MS_PageHidden'))
{
foreach AllActors(class'BobPage', Bob, 'holobob')
Bob.LeaveWorld();

flags.SetBool('MS_PageHidden', True);
}
}
else if (localURL == "00_TRAININGCOMBAT")
{
// delete the player's inventory in case he tries to keep it
if (flags.GetBool('MunitionsTrooperReady'))
RemoveAllInventory();

// start a datalink when a bot is destroyed
if (!flags.GetBool('MS_LAMBot1Destroyed'))
{
count = 0;
foreach AllActors(class'SecurityBot2', bot, 'LAMBot1')
count++;

if (count == 0)
{
Player.StartDataLinkTransmission("DL_ReleaseBot2");
flags.SetBool('MS_LAMBot1Destroyed', True);
}
}

// start a datalink when a bot is destroyed
if (!flags.GetBool('MS_LAMBot2Destroyed'))
{
count = 0;
foreach AllActors(class'SecurityBot2', bot, 'LAMBot2')
count++;

if (count == 0)
{
Player.StartDataLinkTransmission("DL_DemolitionLast");
flags.SetBool('MS_LAMBot2Destroyed', True);
}
}

// start a datalink when all LAMs are destroyed
if (!flags.GetBool('MS_LAMsDestroyed'))
{
count = 0;
foreach AllActors(class'LAM', lam, 'DefuseLAM')
count++;

if (count == 0)
{
Player.StartDataLinkTransmission("DL_DefuseFinish");
flags.SetBool('MS_LAMsDestroyed', True);
}
}

// increase the player's skill
if (flags.GetBool('DL_RifleRangeShot1_Played') &&
!flags.GetBool('MS_SkillIncreased'))
{
// max out the rifle skill
if (Player.SkillSystem != None)
{
aSkill = Player.SkillSystem.GetSkillFromClass(class'SkillWeaponRifle');
if (aSkill != None)
aSkill.CurrentLevel = 3;
}

flags.SetBool('MS_SkillIncreased', True);
}
}
else if (localURL == "00_TRAININGFINAL")
{
// unhide holo-Jaime
if (flags.GetBool('JaimeAppears') &&
!flags.GetBool('MS_ReyesUnhidden'))
{
foreach AllActors(class'JaimeReyes', Jaime, 'holojaime')
Jaime.EnterWorld();

flags.SetBool('MS_ReyesUnhidden', True);
}

// hide holo-Jaime
if (flags.GetBool('JaimeBark_Played') &&
!flags.GetBool('MS_ReyesHidden'))
{
foreach AllActors(class'JaimeReyes', Jaime, 'holojaime')
Jaime.LeaveWorld();

flags.SetBool('MS_ReyesHidden', True);
}
}




Mission01.uc (extends MissionScript)

FirstFrame


local PaulDenton Paul;
local UNATCOTroop troop;
local TerroristCommander cmdr;


Super.FirstFrame();

if (localURL == "01_NYC_UNATCOISLAND")
{
// delete Paul and company after final briefing
if (flags.GetBool('M02Briefing_Played'))
{
foreach AllActors(class'PaulDenton', Paul)
Paul.Destroy();
foreach AllActors(class'UNATCOTroop', troop, 'custodytroop')
troop.Destroy();
foreach AllActors(class'TerroristCommander', cmdr, 'TerroristCommander')
cmdr.Destroy();
}
}

PreTravel


Super.PreTravel();

Timer


local Terrorist T;
local TerroristCarcass carc;
local ScriptedPawn P;
local SpawnPoint SP;
local DeusExMover M;
local PaulDenton Paul;
local AutoTurret turret;
local LaserTrigger laser;
local SecurityCamera cam;
local int count;
local Inventory item, nextItem;


Super.Timer();

if (localURL == "01_NYC_UNATCOISLAND")
{
// count the number of dead terrorists
if (!flags.GetBool('M01PlayerAggressive'))
{
count = 0;

// count the living
foreach AllActors(class'Terrorist', T)
count++;

// add the unconscious ones to the not dead count
// there are 28 terrorists total on the island
foreach AllActors(class'TerroristCarcass', carc)
{
if ((carc.KillerBindName == "JCDenton") && (carc.itemName == "Unconscious"))
count++;
else if (carc.KillerBindName != "JCDenton")
count++;
}

// if the player killed more than 5, set the flag
if (count < 23)
flags.SetBool('M01PlayerAggressive', True,, 6); // don't expire until mission 6
}

// check for the leader being killed
if (!flags.GetBool('MS_DL_Played'))
{
if (flags.GetBool('TerroristCommander_Dead'))
{
if (!flags.GetBool('DL_LeaderNotKilled_Played'))
Player.StartDataLinkTransmission("DL_LeaderKilled");
else
Player.StartDataLinkTransmission("DL_LeaderKilledInSpite");

flags.SetBool('MS_DL_Played', True,, 2);
}
}

// check for player not killing leader
if (!flags.GetBool('PlayerAttackedStatueTerrorist') &&
flags.GetBool('MeetTerrorist_Played') &&
!flags.GetBool('MS_DL2_Played'))
{
Player.StartDataLinkTransmission("DL_LeaderNotKilled");
flags.SetBool('MS_DL2_Played', True,, 2);
}

// remove guys and move Paul
if (!flags.GetBool('MS_MissionComplete'))
{
if (flags.GetBool('StatueMissionComplete'))
{
// open the HQ blast doors and unlock some other doors
foreach AllActors(class'DeusExMover', M)
{
if (M.Tag == 'UN_maindoor')
{
M.bLocked = False;
M.lockStrength = 0.0;
M.Trigger(None, None);
}
else if ((M.Tag == 'StatueRuinDoors') || (M.Tag == 'temp_celldoor'))
{
M.bLocked = False;
M.lockStrength = 0.0;
}
}

// unhide the troop, delete the terrorists, Gunther, and teleport Paul
foreach AllActors(class'ScriptedPawn', P)
{
if (P.IsA('UNATCOTroop') && (P.BindName == "custodytroop"))
P.EnterWorld();
else if (P.IsA('UNATCOTroop') && (P.BindName == "postmissiontroops"))
P.EnterWorld();
else if (P.IsA('ThugMale2') || P.IsA('SecurityBot3'))
P.Destroy();
else if (P.IsA('Terrorist') && (P.BindName != "TerroristCommander"))
{
// actually kill the terrorists instead of destroying them
P.HealthTorso = 0;
P.Health = 0;
P.TakeDamage(1, P, P.Location, vect(0,0,0), 'Shot');

// delete their inventories as well
if (P.Inventory != None)
{
do
{
item = P.Inventory;
nextItem = item.Inventory;
P.DeleteInventory(item);
item.Destroy();
item = nextItem;
}
until (item == None);
}
}
else if (P.BindName == "GuntherHermann")
P.Destroy();
else if (P.BindName == "PaulDenton")
{
SP = GetSpawnPoint('PaulTeleport');
if (SP != None)
{
P.SetLocation(SP.Location);
P.SetRotation(SP.Rotation);
P.SetOrders('Standing',, True);
P.SetHomeBase(SP.Location, SP.Rotation);
}
}
}

// delete all tagged turrets
foreach AllActors(class'AutoTurret', turret)
if ((turret.Tag == 'NSFTurret01') || (turret.Tag == 'NSFTurret02'))
turret.Destroy();

// delete all tagged lasertriggers
foreach AllActors(class'LaserTrigger', laser, 'statue_lasertrap')
laser.Destroy();

// turn off all tagged cameras
foreach AllActors(class'SecurityCamera', cam)
if ((cam.Tag == 'NSFCam01') || (cam.Tag == 'NSFCam02') || (cam.Tag == 'NSFCam03'))
cam.bNoAlarm = True;

flags.SetBool('MS_MissionComplete', True,, 2);
}
}
}
else if (localURL == "01_NYC_UNATCOHQ")
{
// unhide Paul
if (!flags.GetBool('MS_ReadyForBriefing'))
{
if (flags.GetBool('M01ReadyForBriefing'))
{
foreach AllActors(class'PaulDenton', Paul)
Paul.EnterWorld();

flags.SetBool('MS_ReadyForBriefing', True,, 2);
}
}
}




Mission02.uc (extends MissionScript)

FirstFrame


local ScriptedPawn pawn;


Super.FirstFrame();

if (localURL == "02_NYC_STREET")
{
flags.SetBool('M02StreetLoaded', True,, 3);

// if you went to the warehouse without finishing the streets,
// set some flags
if (!flags.GetBool('MS_GuardsWandering') &&
flags.GetBool('WarehouseDistrictEntered'))
{
if (!flags.GetBool('StreetOpened') ||
!flags.GetBool('ClinicCleared'))
{
foreach AllActors(class'ScriptedPawn', pawn)
{
if (pawn.Tag == 'ClinicGuards')
pawn.SetOrders('Wandering', '', True);
else if (pawn.Tag == 'HotelGuards')
pawn.SetOrders('Wandering', '', True);
}
}

flags.SetBool('MS_GuardsWandering', True,, 3);
}

// Manderley will be disappointed if you don't finish the streets
if (!flags.GetBool('M02ManderleyDisappointed') &&
!flags.GetBool('BatteryParkComplete'))
{
flags.SetBool('M02ManderleyDisappointed', True,, 3);
}

// get rid of Sandra if you've talked to her already
if (flags.GetBool('MeetSandraRenton_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn)
if (pawn.IsA('SandraRenton'))
pawn.Destroy();
}

// unhide some hostages if you've rescued them
if (flags.GetBool('EscapeSuccessful'))
{
foreach AllActors(class'ScriptedPawn', pawn)
{
if (pawn.IsA('BumMale') && (pawn.Tag == 'hostageMan'))
pawn.EnterWorld();
else if (pawn.IsA('BumFemale') && (pawn.Tag == 'hostageWoman'))
pawn.EnterWorld();
}
}
}
else if (localURL == "02_NYC_BAR")
{
// unhide Sandra if you've talked to her already
if (flags.GetBool('MeetSandraRenton_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn)
if (pawn.IsA('SandraRenton'))
{
pawn.EnterWorld();
flags.SetBool('MS_SandraInBar', True,, 3);
}
}
}
else if (localURL == "02_NYC_SMUG")
{
// unhide Ford if you've rescued him
if (flags.GetBool('FordSchickRescued'))
{
foreach AllActors(class'ScriptedPawn', pawn)
if (pawn.IsA('FordSchick'))
pawn.EnterWorld();

flags.SetBool('SchickThankedPlayer', True);
}
}

PreTravel


if (localURL == "02_NYC_BATTERYPARK")
{
// if you leave without finishing, set some flags and remove the terrorists
if (!flags.GetBool('MS_MapLeftEarly'))
{
if (!flags.GetBool('AmbrosiaTagged') ||
!flags.GetBool('SubTerroristsDead'))
{
flags.SetBool('MS_MapLeftEarly', True,, 3);
}
}
}
else if (localURL == "02_NYC_UNDERGROUND")
{
// if you leave the level with Ford Schick, set a flag
if (flags.GetBool('MS_FordFollowing') &&
!flags.GetBool('FordSchick_Dead'))
{
flags.SetBool('FordSchickRescued', True,, 9);
}
}

Super.PreTravel();

Timer


local Terrorist T;
local TerroristCarcass carc;
local UNATCOTroop guard;
local ThugMale thug;
local ThugMale2 thug2;
local BumMale bum;
local BlackHelicopter chopper;
local Doctor doc;
local BarrelAmbrosia barrel;
local ScriptedPawn pawn;
local DeusExCarcass carc2;
local GuntherHermann Gunther;
local Actor A;
local SandraRenton Sandra;
local int count;


Super.Timer();

if (localURL == "02_NYC_BATTERYPARK")
{
// after terrorists are dead, set guards to wandering
if (!flags.GetBool('BatteryParkSlaughter'))
{
count = 0;

// count the number of living terrorists
foreach AllActors(class'Terrorist', T, 'ClintonTerrorist')
count++;

// count the number of unconscious terrorists
foreach AllActors(class'TerroristCarcass', carc, 'ClintonTerrorist')
if (carc.itemName == "Unconscious")
count++;

// there are 5 total, player must have killed 2 or more, so
// check to see if there are fewer than 3 still alive or unconscious
if (count <= 3)
{
foreach AllActors(class'UNATCOTroop', guard, 'ClintonGuard')
guard.SetOrders('Wandering', '', True);

flags.SetBool('BatteryParkSlaughter', True,, 6);
}
}

// set guards to wandering after sub terrorists are dead
if (!flags.GetBool('SubTerroristsDead'))
{
count = 0;

foreach AllActors(class'Terrorist', T, 'SubTerrorist')
count++;

if (count == 0)
{
foreach AllActors(class'UNATCOTroop', guard, 'SubGuards')
guard.SetOrders('Wandering', '', True);

Player.GoalCompleted('LiberateBatteryParkSubway');
flags.SetBool('SubTerroristsDead', True,, 6);
}
}

// check to see if hostages are dead
if (!flags.GetBool('HostagesKilled') && flags.GetBool('SubHostageMale_Dead') &&
flags.GetBool('SubHostageFemale_Dead'))
{
flags.SetBool('HostagesKilled', True,, 3);
}

// check a bunch of flags, and start a datalink
if (!flags.GetBool('MS_MapLeftEarly') &&
!flags.GetBool('MS_DL_Played'))
{
if (!flags.GetBool('SubTerroristsDead') &&
flags.GetBool('EscapeSuccessful') &&
!flags.GetBool('HostagesKilled'))
{
Player.StartDataLinkTransmission("DL_SubwayComplete3");
flags.SetBool('MS_DL_Played', True,, 3);
}
else if (flags.GetBool('HostagesKilled'))
{
Player.StartDataLinkTransmission("DL_SubwayComplete2");
flags.SetBool('MS_DL_Played', True,, 3);
}
else if (flags.GetBool('SubTerroristsDead') ||
flags.GetBool('EscapeSuccessful'))
{
Player.StartDataLinkTransmission("DL_SubwayComplete");
flags.SetBool('MS_DL_Played', True,, 3);
}
}

if (!flags.GetBool('ShantyTownSecure'))
{
count = 0;

foreach AllActors(class'Terrorist', T, 'ShantyTerrorists')
count++;

if (count == 0)
flags.SetBool('ShantyTownSecure', True);
}
}
else if (localURL == "02_NYC_STREET")
{
// set guards to wandering after clinc terrorists are dead
if (!flags.GetBool('ClinicCleared'))
{
count = 0;

foreach AllActors(class'Terrorist', T, 'ClinicTerrorist')
count++;

if (count == 0)
{
foreach AllActors(class'UNATCOTroop', guard, 'ClinicGuards')
guard.SetOrders('Wandering', '', True);

flags.SetBool('ClinicCleared', True,, 6);
}
}

// set guards to wandering after street terrorists are dead
if (!flags.GetBool('StreetOpened'))
{
count = 0;

foreach AllActors(class'Terrorist', T, 'StreetTerrorist')
count++;

if (count == 0)
{
foreach AllActors(class'UNATCOTroop', guard, 'HotelGuards')
guard.SetOrders('Wandering', '', True);

flags.SetBool('StreetOpened', True,, 6);

// there are 5 terrorists total
// if player killed 3 or more, call it a slaughter
foreach AllActors(class'TerroristCarcass', carc, 'StreetTerrorist')
{
if ((carc.KillerBindName == "JCDenton") && (carc.itemName != "Unconscious"))
count++;
}

if (count >= 3)
flags.SetBool('TenderloinSlaughter', True,, 6);
}
}

// check to see if player rescued bum
if (!flags.GetBool('MS_ThugsDead'))
{
count = 0;

foreach AllActors(class'ThugMale2', thug2, 'AlleyThug')
count++;

// set the resuced flag if the bum is still alive
if (count == 0)
{
foreach AllActors(class'BumMale', bum, 'AlleyBum')
flags.SetBool('AlleyBumRescued', True,, 3);

flags.SetBool('MS_ThugsDead', True,, 3);
}
}

// if the pimp is dead, set a flag
if (!flags.GetBool('SandrasPimpDone'))
{
count = 0;
foreach AllActors(class'ThugMale', thug, 'Pimp')
count++;

if (count == 0)
{
flags.SetBool('SandrasPimpDone', True,, 3);
Player.GoalCompleted('HelpJaneysFriend');
}
}

// if Sandra is dead, set a flag
if (!flags.GetBool('MS_SandraDead'))
{
count = 0;
foreach AllActors(class'SandraRenton', Sandra)
count++;

if (count == 0)
{
flags.SetBool('MS_SandraDead', True,, 3);
Player.GoalCompleted('HelpJaneysFriend');
}
}

if (flags.GetBool('OverhearAlleyThug_Played') &&
!flags.GetBool('MS_ThugAttacks'))
{
foreach AllActors(class'Actor', A, 'ThugAttacks')
A.Trigger(Self, Player);

flags.SetBool('MS_ThugAttacks', True,, 3);
}
}
else if (localURL == "02_NYC_WAREHOUSE")
{
// start infolink after generator blown
// also unhide the helicopter and Gunther on the roof
if (!flags.GetBool('MS_GeneratorStuff'))
{
if (!flags.GetBool('DL_Pickup_Played') &&
flags.GetBool('GeneratorBlown'))
{
Player.StartDataLinkTransmission("DL_Pickup");

foreach AllActors(class'BlackHelicopter', chopper, 'Helicopter')
chopper.EnterWorld();

foreach AllActors(class'GuntherHermann', Gunther)
Gunther.EnterWorld();

flags.SetBool('MS_GeneratorStuff', True,, 3);
}
}
}
else if (localURL == "02_NYC_FREECLINIC")
{
// make the bum disappear when he gets to his destination
if (flags.GetBool('MS_BumLeaving') &&
!flags.GetBool('MS_BumRemoved'))
{
foreach AllActors(class'BumMale', bum, 'SickBum1')
if (bum.IsInState('Standing'))
bum.Destroy();

flags.SetBool('MS_BumRemoved', True,, 3);
flags.DeleteFlag('MS_BumLeaving', FLAG_Bool);
}

// make the bum leave after talking to the doctor
if (flags.GetBool('Doctor2_Saved') &&
!flags.GetBool('MS_BumRemoved') &&
!flags.GetBool('MS_BumLeaving'))
{
foreach AllActors(class'BumMale', bum, 'SickBum1')
bum.SetOrders('GoingTo', 'SickBumDestination', True);

flags.SetBool('MS_BumLeaving', True,, 3);
}

// make the bum face the doctor
if (flags.GetBool('SickBumInterrupted_Played') &&
!flags.GetBool('Doctor2_Saved') &&
!flags.GetBool('MS_BumTurned'))
{
foreach AllActors(class'Doctor', doc, 'Doctor2')
foreach AllActors(class'BumMale', bum, 'SickBum1')
{
bum.DesiredRotation = Rotator(doc.Location - bum.Location);
break;
}

flags.SetBool('MS_BumTurned', True,, 3);
}
}
else if (localURL == "02_NYC_BAR")
{
// if the player kills anybody in the bar, set a flag
if (!flags.GetBool('M02ViolenceInBar'))
{
count = 0;

foreach AllActors(class'DeusExCarcass', carc2)
count++;

if (count > 0)
flags.SetBool('M02ViolenceInBar', True,, 4);
}
}
else if (localURL == "02_NYC_HOTEL")
{
// if the player kills all the terrorists, set a flag
if (!flags.GetBool('M02HostagesRescued'))
{
count = 0;

foreach AllActors(class'Terrorist', T)
if (T.Tag == 'SecondFloorTerrorist')
count++;

if (count == 0)
flags.SetBool('M02HostagesRescued', True,, 3);
}
}
else if (localURL == "02_NYC_UNDERGROUND")
{
if (flags.GetBool('FordSchick_Dead') &&
!flags.GetBool('FordSchickRescueDone'))
{
flags.SetBool('FordSchickRescueDone', True,, 9);
}
}




Mission03.uc (extends MissionScript)

FirstFrame


local Terrorist T;
local BlackHelicopter chopper;
local SecurityBot3 bot;
local PaulDenton Paul;
local SecurityCamera cam;
local AutoTurret turret;
local GuntherHermann Gunther;
local UNATCOTroop troop;


Super.FirstFrame();

if (localURL == "03_NYC_AIRFIELDHELIBASE")
{
// delete terrorists and unhide reinforcements
if (flags.GetBool('MeetLebedev_Played') ||
flags.GetBool('JuanLebedev_Dead'))
{
foreach AllActors(class'Terrorist', T)
T.Destroy();

foreach AllActors(class'SecurityBot3', bot)
bot.Destroy();

foreach AllActors(class'UNATCOTroop', troop, 'UNATCOTroop')
troop.EnterWorld();
}
}
else if (localURL == "03_NYC_AIRFIELD")
{
// delete terrorists and unhide reinforcements and unhide the helicopter
// also, turn off all security cameras
if (flags.GetBool('MeetLebedev_Played') ||
flags.GetBool('JuanLebedev_Dead'))
{
foreach AllActors(class'Terrorist', T)
T.Destroy();

foreach AllActors(class'SecurityBot3', bot)
bot.Destroy();

foreach AllActors(class'UNATCOTroop', troop, 'UNATCOTroop')
troop.EnterWorld();

foreach AllActors(class'BlackHelicopter', chopper)
chopper.EnterWorld();

foreach AllActors(class'SecurityCamera', cam)
cam.UnTrigger(None, None);

foreach AllActors(class'AutoTurret', turret)
turret.UnTrigger(None, None);

foreach AllActors(class'GuntherHermann', Gunther)
Gunther.EnterWorld();
}
}
else if (localURL == "03_NYC_HANGAR")
{
// delete terrorists and unhide reinforcements
if (flags.GetBool('MeetLebedev_Played') ||
flags.GetBool('JuanLebedev_Dead'))
{
foreach AllActors(class'Terrorist', T)
T.Destroy();

foreach AllActors(class'SecurityBot3', bot)
bot.Destroy();

foreach AllActors(class'PaulDenton', Paul)
Paul.Destroy();

foreach AllActors(class'UNATCOTroop', troop, 'UNATCOTroop')
troop.EnterWorld();
}
}
else if (localURL == "03_NYC_747")
{
// delete terrorists
if (flags.GetBool('MeetLebedev_Played') ||
flags.GetBool('JuanLebedev_Dead'))
{
foreach AllActors(class'Terrorist', T)
T.Destroy();

foreach AllActors(class'SecurityBot3', bot)
bot.Destroy();
}
}

PreTravel


Super.PreTravel();

Timer


local WaltonSimons Walton;
local AnnaNavarre Anna;
local GuntherHermann Gunther;
local JuanLebedev Juan;
local JuanLebedevCarcass carc;
local ThugMale Thug;
local ThugMale2 Thug2;
local ScriptedPawn pawn;
local Terrorist T;
local int count;
local DeusExMover M;
local bool bCarcFound, bJuanFound;


Super.Timer();

if (localURL == "03_NYC_UNATCOHQ")
{
// make Walton Simons walk to the cell
if (!flags.GetBool('MS_SimonsWalking'))
{
if (flags.GetBool('SimonsOverheard_Played'))
{
foreach AllActors(class'WaltonSimons', Walton)
Walton.SetOrders('GoingTo', 'SimonsInterrogating', True);

flags.SetBool('MS_SimonsWalking', True,, 4);
}
}

// set a flag when Walton Simons gets to his point
if (!flags.GetBool('SimonsInterrogating'))
{
if (flags.GetBool('MS_SimonsWalking'))
{
foreach AllActors(class'WaltonSimons', Walton)
if (Walton.IsInState('Standing'))
flags.SetBool('SimonsInterrogating', True,, 4);
}
}

// unlock a door when a flag is set
if (!flags.GetBool('MS_MoverUnlocked') && flags.GetBool('UnlockDoor'))
{
foreach AllActors(class'DeusExMover', M, 'Manderley_Office')
{
M.bLocked = False;
M.lockStrength = 0.0;
}

flags.SetBool('MS_MoverUnlocked', True,, 4);
}

if (flags.GetBool('AnnaAtDesk') &&
!flags.GetBool('MS_AnnaDeskHome'))
{
foreach AllActors(class'AnnaNavarre', Anna)
Anna.SetHomeBase(Anna.Location, Anna.Rotation);
flags.SetBool('MS_AnnaDeskHome', True,, 4);
}

if (flags.GetBool('AnnaInOffice') &&
!flags.GetBool('MS_AnnaOfficeHome'))
{
foreach AllActors(class'AnnaNavarre', Anna)
Anna.SetHomeBase(Anna.Location, Anna.Rotation);
flags.SetBool('MS_AnnaOfficeHome', True,, 4);
}
}
else if (localURL == "03_NYC_AIRFIELDHELIBASE")
{
// check for Ambrosia Barrels being tagged
if (!flags.GetBool('Barrel1Checked'))
{
if (flags.GetBool('HelicopterBaseAmbrosia'))
{
count = 1;
if (flags.GetBool('BoatDocksAmbrosia'))
count++;
if (flags.GetBool('747Ambrosia'))
count++;

if (count == 1)
Player.StartDataLinkTransmission("DL_TaggedOne");
else if (count == 2)
Player.StartDataLinkTransmission("DL_TaggedTwo");
else if (count == 3)
Player.StartDataLinkTransmission("DL_TaggedThree");

flags.SetBool('Barrel1Checked', True,, 4);
}
}
}
else if (localURL == "03_NYC_AIRFIELD")
{
// check for Ambrosia Barrels being tagged
if (!flags.GetBool('Barrel2Checked'))
{
if (flags.GetBool('BoatDocksAmbrosia'))
{
count = 1;
if (flags.GetBool('HelicopterBaseAmbrosia'))
count++;
if (flags.GetBool('747Ambrosia'))
count++;

if (count == 1)
Player.StartDataLinkTransmission("DL_TaggedOne");
else if (count == 2)
Player.StartDataLinkTransmission("DL_TaggedTwo");
else if (count == 3)
Player.StartDataLinkTransmission("DL_TaggedThree");

flags.SetBool('Barrel2Checked', True,, 4);
}
}

// unhide Gunther
if (!flags.GetBool('MS_GuntherUnhidden'))
{
if (flags.GetBool('MeetLebedev_Played') ||
flags.GetBool('JuanLebedev_Dead'))
{
foreach AllActors(class'GuntherHermann', Gunther)
Gunther.EnterWorld();
flags.SetBool('MS_GuntherUnhidden', True,, 4);
}
}
}
else if (localURL == "03_NYC_747")
{
// check for Lebedev's death
if (flags.GetBool('JuanLebedev_Dead') &&
!flags.GetBool('MS_Anna747Unhidden'))
{
foreach AllActors(class'AnnaNavarre', Anna)
Anna.EnterWorld();

flags.SetBool('MS_Anna747Unhidden', True,, 4);
}

// check for Ambrosia Barrels being tagged
if (!flags.GetBool('Barrel3Checked'))
{
if (flags.GetBool('747Ambrosia'))
{
count = 1;
if (flags.GetBool('HelicopterBaseAmbrosia'))
count++;
if (flags.GetBool('BoatDocksAmbrosia'))
count++;

if (count == 1)
Player.StartDataLinkTransmission("DL_TaggedOne");
else if (count == 2)
Player.StartDataLinkTransmission("DL_TaggedTwo");
else if (count == 3)
Player.StartDataLinkTransmission("DL_TaggedThree");

flags.SetBool('Barrel3Checked', True,, 4);
}
}

// unhide Anna
if (!flags.GetBool('MS_AnnaUnhidden'))
{
if (flags.GetBool('MeetLebedev_Played') ||
flags.GetBool('JuanLebedev_Dead'))
{
foreach AllActors(class'AnnaNavarre', Anna)
Anna.EnterWorld();
flags.SetBool('MS_AnnaUnhidden', True,, 4);
}
}

// check to see if the player has killed Lebedev
if (!flags.GetBool('PlayerKilledLebedev') &&
!flags.GetBool('AnnaKilledLebedev'))
{
bCarcFound = False;
foreach AllActors(class'JuanLebedevCarcass', carc)
{
bCarcFound = True;

if ((carc.KillerBindName == "JCDenton") || (carc.KillerBindName == ""))
{
Player.GoalCompleted('AssassinateLebedev');
flags.SetBool('PlayerKilledLebedev', True,, 6);
}
else if (carc.KillerBindName == "AnnaNavarre")
flags.SetBool('AnnaKilledLebedev', True,, 6);
else
flags.SetBool('JuanLebedev_Dead', True,, 0);
}

bJuanFound = False;
foreach AllActors(class'JuanLebedev', Juan)
bJuanFound = True;

if (!bCarcFound && !bJuanFound && flags.GetBool('JuanLebedev_Dead'))
flags.SetBool('PlayerKilledLebedev', True,, 6);
}
}
else if (localURL == "03_NYC_MOLEPEOPLE")
{
// set a flag when there are less than 4 mole people alive
if (!flags.GetBool('MolePeopleSlaughtered'))
{
count = 0;
foreach AllActors(class'ScriptedPawn', pawn, 'MolePeople')
count++;

if (count < 4)
flags.SetBool('MolePeopleSlaughtered', True,, 4);
}

// set a flag when there are less than 3 terrorists alive
if (!flags.GetBool('MoleTerroristsDefeated'))
{
count = 0;
foreach AllActors(class'Terrorist', T, 'MoleTerrorist')
count++;

if (count < 3)
flags.SetBool('MoleTerroristsDefeated', True,, 4);
}
}
else if (localURL == "03_NYC_BROOKLYNBRIDGESTATION")
{
// set a flag when the gang's all dead
if (!flags.GetBool('JugHeadGangDefeated'))
{
count = 0;
foreach AllActors(class'ThugMale2', Thug2, 'ThugMale2')
count++;

if (count == 0)
flags.SetBool('JugHeadGangDefeated', True,, 4);
}
}




Mission04.uc (extends MissionScript)

FirstFrame


local ScriptedPawn pawn;


Super.FirstFrame();

if (localURL == "04_NYC_STREET")
{
// unhide a bunch of stuff on this flag
if (flags.GetBool('TalkedToPaulAfterMessage_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn)
if (pawn.IsA('UNATCOTroop') || pawn.IsA('SecurityBot2'))
pawn.EnterWorld();
}
}
else if (localURL == "04_NYC_FREECLINIC")
{
// unhide a bunch of stuff on this flag
if (flags.GetBool('TalkedToPaulAfterMessage_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn)
if (pawn.IsA('UNATCOTroop'))
pawn.EnterWorld();
}
}
else if (localURL == "04_NYC_HOTEL")
{
// unhide the correct JoJo
if (flags.GetBool('SandraRenton_Dead') ||
flags.GetBool('GilbertRenton_Dead'))
{
if (!flags.GetBool('JoJoFine_Dead'))
foreach AllActors(class'ScriptedPawn', pawn, 'JoJoInLobby')
pawn.EnterWorld();
}
}

PreTravel


Super.PreTravel();

Timer


local ScriptedPawn pawn;
local SatelliteDish dish;
local SandraRenton Sandra;
local GilbertRenton Gilbert;
local GilbertRentonCarcass GilbertCarc;
local SandraRentonCarcass SandraCarc;
local UNATCOTroop troop;
local Actor A;
local PaulDenton Paul;
local int count;


Super.Timer();

// do this for every map in this mission
// if the player is "killed" after a certain flag, he is sent to mission 5
if (!flags.GetBool('MS_PlayerCaptured'))
{
if (flags.GetBool('TalkedToPaulAfterMessage_Played'))
{
if (Player.IsInState('Dying'))
{
flags.SetBool('MS_PlayerCaptured', True,, 5);
Player.GoalCompleted('EscapeToBatteryPark');
Level.Game.SendPlayer(Player, "05_NYC_UNATCOMJ12Lab");
}
}
}

if (localURL == "04_NYC_HOTEL")
{
// check to see if the player has killed either Sandra or Gilbert
if (!flags.GetBool('PlayerKilledRenton'))
{
count = 0;
foreach AllActors(class'SandraRenton', Sandra)
count++;

foreach AllActors(class'GilbertRenton', Gilbert)
count++;

foreach AllActors(class'SandraRentonCarcass', SandraCarc)
if (SandraCarc.KillerBindName == "JCDenton")
count = 0;

foreach AllActors(class'GilbertRentonCarcass', GilbertCarc)
if (GilbertCarc.KillerBindName == "JCDenton")
count = 0;

if (count < 2)
{
flags.SetBool('PlayerKilledRenton', True,, 5);
foreach AllActors(class'Actor', A, 'RentonsHatePlayer')
A.Trigger(Self, Player);
}
}

if (!flags.GetBool('M04RaidTeleportDone') &&
flags.GetBool('ApartmentEntered'))
{
if (flags.GetBool('NSFSignalSent'))
{
foreach AllActors(class'ScriptedPawn', pawn)
{
if (pawn.IsA('UNATCOTroop') || pawn.IsA('MIB'))
pawn.EnterWorld();
else if (pawn.IsA('SandraRenton') || pawn.IsA('GilbertRenton') || pawn.IsA('HarleyFilben'))
pawn.LeaveWorld();
}

foreach AllActors(class'PaulDenton', Paul)
{
Player.StartConversationByName('TalkedToPaulAfterMessage', Paul, False, False);
break;
}

flags.SetBool('M04RaidTeleportDone', True,, 5);
}
}

// make the MIBs mortal
if (!flags.GetBool('MS_MIBMortal'))
{
if (flags.GetBool('TalkedToPaulAfterMessage_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn)
if (pawn.IsA('MIB'))
pawn.bInvincible = False;

flags.SetBool('MS_MIBMortal', True,, 5);
}
}

// unhide the correct JoJo
if (!flags.GetBool('MS_JoJoUnhidden') &&
(flags.GetBool('SandraWaitingForJoJoBarks_Played') ||
flags.GetBool('GilbertWaitingForJoJoBarks_Played')))
{
if (!flags.GetBool('JoJoFine_Dead'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'JoJoUpstairs')
pawn.EnterWorld();

flags.SetBool('MS_JoJoUnhidden', True,, 5);
}
}

// unhide the correct JoJo
if (!flags.GetBool('MS_JoJoUnhidden') &&
(flags.GetBool('M03OverhearSquabble_Played') &&
!flags.GetBool('JoJoOverheard_Played') &&
flags.GetBool('JoJoEntrance')))
{
if (!flags.GetBool('JoJoFine_Dead'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'JoJoUpstairs')
pawn.EnterWorld();

flags.SetBool('MS_JoJoUnhidden', True,, 5);
}
}

// trigger some stuff based on convo flags
if (flags.GetBool('JoJoOverheard_Played') && !flags.GetBool('MS_JoJo1Triggered'))
{
if (flags.GetBool('GaveRentonGun'))
{
foreach AllActors(class'Actor', A, 'GilbertAttacksJoJo')
A.Trigger(Self, Player);
}
else
{
foreach AllActors(class'Actor', A, 'JoJoAttacksGilbert')
A.Trigger(Self, Player);
}

flags.SetBool('MS_JoJo1Triggered', True,, 5);
}

// trigger some stuff based on convo flags
if (flags.GetBool('JoJoAndSandraOverheard_Played') && !flags.GetBool('MS_JoJo2Triggered'))
{
foreach AllActors(class'Actor', A, 'SandraLeaves')
A.Trigger(Self, Player);

flags.SetBool('MS_JoJo2Triggered', True,, 5);
}

// trigger some stuff based on convo flags
if (flags.GetBool('JoJoAndGilbertOverheard_Played') && !flags.GetBool('MS_JoJo3Triggered'))
{
foreach AllActors(class'Actor', A, 'JoJoAttacksGilbert')
A.Trigger(Self, Player);

flags.SetBool('MS_JoJo3Triggered', True,, 5);
}
}
else if (localURL == "04_NYC_NSFHQ")
{
// rotate the dish when the computer sets the flag
if (!flags.GetBool('MS_Dish1Rotated'))
{
if (flags.GetBool('Dish1InPosition'))
{
foreach AllActors(class'SatelliteDish', dish, 'Dish1')
dish.DesiredRotation.Yaw = 49152;

flags.SetBool('MS_Dish1Rotated', True,, 5);
}
}

// rotate the dish when the computer sets the flag
if (!flags.GetBool('MS_Dish2Rotated'))
{
if (flags.GetBool('Dish2InPosition'))
{
foreach AllActors(class'SatelliteDish', dish, 'Dish2')
dish.DesiredRotation.Yaw = 0;

flags.SetBool('MS_Dish2Rotated', True,, 5);
}
}

// rotate the dish when the computer sets the flag
if (!flags.GetBool('MS_Dish3Rotated'))
{
if (flags.GetBool('Dish3InPosition'))
{
foreach AllActors(class'SatelliteDish', dish, 'Dish3')
dish.DesiredRotation.Yaw = 16384;

flags.SetBool('MS_Dish3Rotated', True,, 5);
}
}

// set a flag when all dishes are rotated
if (!flags.GetBool('CanSendSignal'))
{
if (flags.GetBool('Dish1InPosition') &&
flags.GetBool('Dish2InPosition') &&
flags.GetBool('Dish3InPosition'))
flags.SetBool('CanSendSignal', True,, 5);
}

// count non-living troops
if (!flags.GetBool('MostWarehouseTroopsDead'))
{
count = 0;
foreach AllActors(class'UNATCOTroop', troop)
count++;

// if two or less are still alive
if (count <= 2)
flags.SetBool('MostWarehouseTroopsDead', True);
}
}




Mission05.uc (extends MissionScript)

FirstFrame


local PaulDentonCarcass carc;
local PaulDenton Paul;
local Terrorist T;
local Inventory item, nextItem;
local SpawnPoint SP;
local AnnaNavarre Anna;


Super.FirstFrame();

if (localURL == "05_NYC_UNATCOMJ12LAB")
{
// make sure this goal is completed
Player.GoalCompleted('EscapeToBatteryPark');

// delete Paul's carcass if he's still alive
if (!flags.GetBool('PaulDenton_Dead'))
{
foreach AllActors(class'PaulDentonCarcass', carc)
carc.Destroy();
}

// if the player has already talked to Paul, delete him
if (flags.GetBool('M05PaulDentonDone') ||
flags.GetBool('PlayerBailedOutWindow'))
{
foreach AllActors(class'PaulDenton', Paul)
Paul.Destroy();
}

// if Miguel is not following the player, delete him
if (flags.GetBool('MeetMiguel_Played') &&
!flags.GetBool('MiguelFollowing'))
{
foreach AllActors(class'Terrorist', T)
if (T.BindName == "Miguel")
T.Destroy();
}

// remove the player's inventory and put it in a room
// also, heal the player up to 50% of his total health
if (!flags.GetBool('MS_InventoryRemoved'))
{
Player.HealthHead = Max(50, Player.HealthHead);
Player.HealthTorso = Max(50, Player.HealthTorso);
Player.HealthLegLeft = Max(50, Player.HealthLegLeft);
Player.HealthLegRight = Max(50, Player.HealthLegRight);
Player.HealthArmLeft = Max(50, Player.HealthArmLeft);
Player.HealthArmRight = Max(50, Player.HealthArmRight);
Player.GenerateTotalHealth();

if (Player.Inventory != None)
{
item = Player.Inventory;
nextItem = None;

foreach AllActors(class'SpawnPoint', SP, 'player_inv')
{
// Find the next item we can process.
while((item != None) && (item.IsA('NanoKeyRing') || (!item.bDisplayableInv)))
item = item.Inventory;

if (item != None)
{
nextItem = item.Inventory;
Player.DeleteInventory(item);

item.DropFrom(SP.Location);

// restore any ammo amounts for a weapon to default
if (item.IsA('Weapon') && (Weapon(item).AmmoType != None))
Weapon(item).PickupAmmoCount = Weapon(item).Default.PickupAmmoCount;
}

if (nextItem == None)
break;
else
item = nextItem;
}
}

flags.SetBool('MS_InventoryRemoved', True,, 6);
}
}
else if (localURL == "05_NYC_UNATCOHQ")
{
// if Miguel is following the player, unhide him
if (flags.GetBool('MiguelFollowing'))
{
foreach AllActors(class'Terrorist', T)
if (T.BindName == "Miguel")
T.EnterWorld();
}

// make Anna not flee in this mission
foreach AllActors(class'AnnaNavarre', Anna)
Anna.MinHealth = 0;
}
else if (localURL == "05_NYC_UNATCOISLAND")
{
// if Miguel is following the player, unhide him
if (flags.GetBool('MiguelFollowing'))
{
foreach AllActors(class'Terrorist', T)
if (T.BindName == "Miguel")
T.EnterWorld();
}
}

PreTravel


Super.PreTravel();

Timer


local AnnaNavarre Anna;
local WaltonSimons Walton;
local DeusExMover M;


Super.Timer();

if (localURL == "05_NYC_UNATCOHQ")
{
// unlock a door
if (flags.GetBool('CarterUnlock') &&
!flags.GetBool('MS_DoorUnlocked'))
{
foreach AllActors(class'DeusExMover', M, 'supplydoor')
{
M.bLocked = False;
M.lockStrength = 0.0;
}

flags.SetBool('MS_DoorUnlocked', True,, 6);
}

// kill Anna when a flag is set
if (flags.GetBool('annadies') &&
!flags.GetBool('MS_AnnaKilled'))
{
foreach AllActors(class'AnnaNavarre', Anna)
{
Anna.HealthTorso = 0;
Anna.Health = 0;
Anna.TakeDamage(1, Anna, Anna.Location, vect(0,0,0), 'Shot');
}

flags.SetBool('MS_AnnaKilled', True,, 6);
}

// make Anna attack the player after a convo is played
if (flags.GetBool('M05AnnaAtExit_Played') &&
!flags.GetBool('MS_AnnaAttacking'))
{
foreach AllActors(class'AnnaNavarre', Anna)
Anna.SetOrders('Attacking', '', True);

flags.SetBool('MS_AnnaAttacking', True,, 6);
}

// unhide Walton Simons
if (flags.GetBool('simonsappears') &&
!flags.GetBool('MS_SimonsUnhidden'))
{
foreach AllActors(class'WaltonSimons', Walton)
Walton.EnterWorld();

flags.SetBool('MS_SimonsUnhidden', True,, 6);
}

// hide Walton Simons
if ((flags.GetBool('M05MeetManderley_Played') ||
flags.GetBool('M05SimonsAlone_Played')) &&
!flags.GetBool('MS_SimonsHidden'))
{
foreach AllActors(class'WaltonSimons', Walton)
Walton.LeaveWorld();

flags.SetBool('MS_SimonsHidden', True,, 6);
}

// mark a goal as completed
if (flags.GetBool('KnowsAnnasKillphrase1') &&
flags.GetBool('KnowsAnnasKillphrase2') &&
!flags.GetBool('MS_KillphraseGoalCleared'))
{
Player.GoalCompleted('FindAnnasKillphrase');
flags.SetBool('MS_KillphraseGoalCleared', True,, 6);
}

// clear a goal when anna is out of commision
if (flags.GetBool('AnnaNavarre_Dead') &&
!flags.GetBool('MS_EliminateAnna'))
{
Player.GoalCompleted('EliminateAnna');
flags.SetBool('MS_EliminateAnna', True,, 6);
}
}
else if (localURL == "05_NYC_UNATCOMJ12LAB")
{
// After the player talks to Paul, start a datalink
if (!flags.GetBool('MS_DL_Played') &&
flags.GetBool('PaulInMedLab_Played'))
{
Player.StartDataLinkTransmission("DL_Paul");
flags.SetBool('MS_DL_Played', True,, 6);
}
}




Mission06.uc (extends MissionScript)

var float fireTime;

FireMissilesAt (name targetTag)


local int i;
local Vector loc;
local BlackHelicopter chopper;
local RocketLAW rocket;
local Actor A, Target;


foreach AllActors(class'Actor', A, targetTag)
Target = A;

// fire missiles from the helicopter
foreach AllActors(class'BlackHelicopter', chopper, 'chopper')
{
for (i=-1; i<=1; i+=2)
{
loc = (i*chopper.CollisionRadius * vect(0,0.15,0)) >> chopper.Rotation;
loc += chopper.Location;
rocket = Spawn(class'RocketLAW', chopper,, loc, chopper.Rotation);
if (rocket != None)
{
rocket.bTracking = True;
rocket.Target = Target;
rocket.PlaySound(sound'RocketIgnite', SLOT_None, 2.0,, 2048);
}
}
}

FirstFrame


local ScriptedPawn pawn;
local BlackHelicopter chopper;
local MJ12Commando commando;
local DeusExCarcass carc;
local DeusExDecoration deco;
local HKMilitary mil;
local SpiderBot bot;
local BookOpen book;
local float rnd;
local Keypad3 pad;


Super.FirstFrame();

if (localURL == "06_HONGKONG_VERSALIFE")
{
if (flags.GetBool('M07Briefing_Played'))
{
foreach AllActors(class'MJ12Commando', commando)
commando.EnterWorld();
}
}
else if (localURL == "06_HONGKONG_WANCHAI_CANAL")
{
if (!flags.GetBool('Supervisor01_Dead') &&
flags.GetBool('HaveROM'))
{
foreach AllActors(class'DeusExCarcass', carc, 'John_Smith_Body')
carc.bHidden = False;
}
}
else if (localURL == "06_HONGKONG_MJ12LAB")
{
if (flags.GetBool('M07Briefing_Played'))
{
foreach AllActors(class'MJ12Commando', commando)
commando.EnterWorld();
foreach AllActors(class'SpiderBot', bot)
bot.EnterWorld();
foreach AllActors(class'Keypad3', pad)
{
if (pad.Tag == 'DummyKeypad_02')
pad.Destroy();
else if (pad.Tag == 'RealKeypad_02')
pad.bHidden = False;
}
}
}
else if (localURL == "06_HONGKONG_TONGBASE")
{
if (flags.GetBool('Versalife_Done'))
{
foreach AllActors(class'ScriptedPawn', pawn)
{
if (pawn.IsA('PaulDenton'))
pawn.EnterWorld();
else if (pawn.IsA('TriadRedArrow') && (pawn.Tag == 'TriadRedArrow'))
pawn.EnterWorld();
}
}

if (flags.GetBool('JaimeRecruited') &&
flags.GetBool('Versalife_Done'))
{
foreach AllActors(class'ScriptedPawn', pawn)
{
if (pawn.IsA('JaimeReyes'))
pawn.EnterWorld();
}
}

if (flags.GetBool('JacobsonRecruited'))
{
foreach AllActors(class'ScriptedPawn', pawn)
{
if (pawn.IsA('AlexJacobson'))
pawn.EnterWorld();
}
}
}
else if (localURL == "06_HONGKONG_WANCHAI_UNDERWORLD")
{
if (flags.GetBool('QuickLetPlayerIn'))
{
foreach AllActors(class'MJ12Commando', commando, 'MJ12Commando')
commando.EnterWorld();
}

if (flags.GetBool('TriadCeremony_Played'))
{
flags.SetBool('DragonHeadsInLuckyMoney', True,, 8);

foreach AllActors(class'DeusExCarcass', carc)
carc.Destroy();
}

if (flags.GetBool('DragonHeadsInLuckyMoney') &&
!flags.GetBool('MS_ChenTeleported'))
{
foreach AllActors(class'ScriptedPawn', pawn)
{
if (pawn.IsA('GordonQuick'))
pawn.EnterWorld();
else if (pawn.IsA('MaxChen'))
TeleportPawn(pawn, 'ChenAtBar', 'Standing');
}

flags.SetBool('MS_ChenTeleported', True,, 8);
}
}
else if (localURL == "06_HONGKONG_WANCHAI_GARAGE")
{
if (flags.GetBool('M07Briefing_Played'))
{
foreach AllActors(class'HKMilitary', mil, 'RumbleCops')
mil.Destroy();

foreach AllActors(class'DeusExCarcass', carc)
{
if (carc.IsA('HKMilitaryCarcass'))
carc.Destroy();
else if (carc.IsA('TriadLumPathCarcass'))
carc.Destroy();
else if (carc.IsA('TriadLumPath2Carcass'))
carc.Destroy();
}
foreach AllActors(class'DeusExDecoration', deco)
{
if (deco.IsA('Van') && (deco.Tag == 'Van01'))
deco.Destroy();
else if (deco.IsA('CarWrecked'))
deco.Destroy();
else if (deco.IsA('RoadBlock'))
deco.Destroy();
}
}
}
else if (localURL == "06_HONGKONG_WANCHAI_MARKET")
{
// prepare for the ceremony
if (flags.GetBool('Have_ROM') &&
flags.GetBool('MeetTracerTong_Played') &&
!flags.GetBool('TriadCeremony_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn)
{
if (pawn.IsA('GordonQuick'))
TeleportPawn(pawn, 'QuickInTemple', 'Standing');
else if (pawn.IsA('MaxChen'))
TeleportPawn(pawn, 'ChenInTemple', 'Standing');
else if (pawn.Tag == 'MarketMonk01')
pawn.EnterWorld();
else if (pawn.Tag == 'MarketKid')
pawn.Destroy();
}

flags.SetBool('CeremonyReadyToBegin', True,, 8);
}

// remove the secretary
if (flags.GetBool('MarketShopperOverheard_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'MarketShopperFlowers')
pawn.Destroy();
}

// set up the catering situation
if (flags.GetBool('CatererConvo_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'TeaHouseRedArrow')
TeleportPawn(pawn, 'TalkToCaterer', 'Wandering');
}
else if (flags.GetBool('TeaHouseDrama_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'TeaHouseRedArrow')
TeleportPawn(pawn, 'TalkToCaterer', 'Standing');

flags.SetBool('ReadyForCaterer', True,, 8);
}

// remove some people after tea house drama has been played
if (flags.GetBool('TeaHouseDrama_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn)
{
if (pawn.Tag == 'TeaHouseCustomer')
pawn.Destroy();
else if (pawn.Tag == 'TeaHouseWoman')
pawn.Destroy();
}
}

// move the kid around to the correct spot
if (flags.GetBool('KidGetsMoney_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'MarketKid')
TeleportPawn(pawn, 'KidAtNewsStand', 'Wandering');
}
else if (flags.GetBool('KidSetsFire_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'MarketKid')
TeleportPawn(pawn, 'KidAtNewsStand', 'Standing');

flags.SetBool('MarketKidReadyForFifth', True,, 8);
}
else if (flags.GetBool('M06_Fire_Set'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'MarketKid')
TeleportPawn(pawn, 'KidAtLumPath', 'Standing');

flags.SetBool('MarketKidReadyForFourth', True,, 8);
}
else if (flags.GetBool('KidAsksForHelp_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'MarketKid')
TeleportPawn(pawn, 'KidSettingFire', 'Standing');

flags.SetBool('MarketKidReadyForThird', True,, 8);
}
else if (flags.GetBool('KidAsksForWork_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'MarketKid')
TeleportPawn(pawn, 'KidAtLumPath', 'Standing');

flags.SetBool('MarketKidReadyForSecond', True,, 8);
}

// unhide the helicopter if it's time
if (flags.GetBool('M08Briefing_Played'))
{
foreach AllActors(class'BlackHelicopter', chopper)
chopper.EnterWorld();
}

// unhide a book
if (flags.GetBool('M07Briefing_Played'))
{
foreach AllActors(class'BookOpen', book, 'TempleBook')
book.bHidden = False;
}

// randomly place the goth chick
foreach AllActors(class'ScriptedPawn', pawn, 'MarketGoth')
{
rnd = FRand();

if (rnd < 0.33)
{
TeleportPawn(pawn, 'GothAtFlower', 'Standing');
flags.SetBool('GothAtFlower', True,, 8);
flags.SetBool('GothAtButcher', False,, 8);
flags.SetBool('GothAtVase', False,, 8);
}
else if (rnd < 0.66)
{
TeleportPawn(pawn, 'GothAtButcher', 'Standing');
flags.SetBool('GothAtFlower', False,, 8);
flags.SetBool('GothAtButcher', True,, 8);
flags.SetBool('GothAtVase', False,, 8);
}
else
{
TeleportPawn(pawn, 'GothAtVase', 'Standing');
flags.SetBool('GothAtFlower', False,, 8);
flags.SetBool('GothAtButcher', False,, 8);
flags.SetBool('GothAtVase', True,, 8);
}
}
}

PreTravel


Super.PreTravel();

TeleportPawn (ScriptedPawn pawn, name patrolTag, name orders, optional bool bRandom)


local PatrolPoint point;


if (pawn != None)
{
point = GetPatrolPoint(patrolTag, bRandom);
if (point != None)
{
pawn.SetLocation(point.Location);
pawn.SetRotation(point.Rotation);
pawn.SetOrders(orders,, True);
}
}

Timer


local int count;
local DeusExMover M;
local AlarmUnit unit;
local Dispatcher disp;
local MJ12Commando commando;
local HKMilitary hkm;
local TriadRedArrow triadred;
local TriadLumPath triadlum;
local WaltonSimons walton;
local RatGenerator gen;
local LowerClassFemale fem;
local Actor A;
local PatrolPoint PP;
local Keypad1 pad;


Super.Timer();

if (localURL == "06_HONGKONG_WANCHAI_STREET")
{
// unhide Walton Simons
if (flags.GetBool('WaltonAppears') &&
!flags.GetBool('MS_WaltonUnhidden'))
{
foreach AllActors(class'WaltonSimons', walton)
walton.EnterWorld();

flags.SetBool('MS_WaltonUnhidden', True,, 8);
}

// hide Walton Simons
if (flags.GetBool('M06WaltonHolo_Played') &&
!flags.GetBool('MS_WaltonHidden'))
{
foreach AllActors(class'WaltonSimons', walton)
walton.LeaveWorld();

flags.SetBool('MS_WaltonHidden', True,, 8);
}
}
else if (localURL == "06_HONGKONG_WANCHAI_UNDERWORLD")
{
if (flags.GetBool('MaxChenConvinced') &&
!flags.GetBool('MS_CommandosUnhidden'))
{
foreach AllActors(class'MJ12Commando', commando, 'RaidingCommando')
commando.EnterWorld();

flags.SetBool('MS_CommandosUnhidden', True,, 8);
}

// set a flag to False when all the commandos are dead
if (flags.GetBool('Raid_Underway'))
{
count = 0;
foreach AllActors(class'MJ12Commando', commando, 'RaidingCommando')
count++;

if (count == 0)
{
flags.SetBool('Raid_Underway', False,, 8);
flags.SetBool('M06AmbushDone', True,, 8);
}
}

// set a home base
if (flags.GetBool('ReadyForMercedes2') &&
!flags.GetBool('MS_HomeBaseSet'))
{
PP = GetPatrolPoint('PartyGirlInClub02');
if (PP != None)
{
foreach AllActors(class'LowerClassFemale', fem, 'ClubTessa')
fem.SetHomeBase(PP.Location, PP.Rotation);
}
flags.SetBool('MS_HomeBaseSet', True,, 8);
}
}
else if (localURL == "06_HONGKONG_WANCHAI_GARAGE")
{
// count the number of military guys
if (!flags.GetBool('RumbleCops_Lost'))
{
count = 0;
foreach AllActors(class'HKMilitary', hkm, 'RumbleCops')
count++;

if (count == 0)
flags.SetBool('RumbleCops_Lost', True,, 8);
}

// count the number of triads
if (!flags.GetBool('RumbleRedArrow_Lost'))
{
count = 0;
foreach AllActors(class'TriadRedArrow', triadred, 'RumbleRedArrow')
count++;

if (count == 0)
flags.SetBool('RumbleRedArrow_Lost', True,, 8);
}

// count the number of triads
if (!flags.GetBool('RumbleLumPath_Lost'))
{
count = 0;
foreach AllActors(class'TriadLumPath', triadlum, 'RumbleLumPath')
count++;

if (count == 0)
flags.SetBool('RumbleLumPath_Lost', True,, 8);
}
}
else if (localURL == "06_HONGKONG_WANCHAI_MARKET")
{
// release rats
if (flags.GetBool('TeaHouseDrama_Played') &&
!flags.GetBool('MS_RatsReleased'))
{
foreach AllActors(class'RatGenerator', gen)
gen.Trigger(Self, Player);

flags.SetBool('MS_RatsReleased', True,, 8);
}

// trigger something
if (flags.GetBool('CatererConvo_Played') &&
!flags.GetBool('MS_ConvoTrigger1'))
{
foreach AllActors(class'Actor', A, 'TeaHouseRedArrowWanders')
A.Trigger(Self, Player);

flags.SetBool('MS_ConvoTrigger1', True,, 8);
}

// trigger something
if (flags.GetBool('TeaHouseDrama_Played') &&
!flags.GetBool('MS_ConvoTrigger2'))
{
foreach AllActors(class'Actor', A, 'TeaHouseRedArrowPatrol')
A.Trigger(Self, Player);

foreach AllActors(class'Actor', A, 'MarketWaiterWanders')
A.Trigger(Self, Player);

flags.SetBool('MS_ConvoTrigger2', True,, 8);
}

// trigger something
if (flags.GetBool('FlowerShopperOverheard_Played') &&
!flags.GetBool('MS_ConvoTrigger3'))
{
foreach AllActors(class'Actor', A, 'MarketShopperFlowersWanders')
A.Trigger(Self, Player);

flags.SetBool('MS_ConvoTrigger3', True,, 8);
}

// move the kid around to the correct spot
if (flags.GetBool('KidGetsMoney_Played') &&
!flags.GetBool('MS_ConvoTrigger4'))
{
foreach AllActors(class'Actor', A, 'KidWanders')
A.Trigger(Self, Player);

flags.SetBool('MS_ConvoTrigger4', True,, 8);
}
else if (flags.GetBool('KidSetsFire_Played') &&
!flags.GetBool('MS_ConvoTrigger5'))
{
foreach AllActors(class'Actor', A, 'KidGoesToNewsStand')
A.Trigger(Self, Player);

flags.SetBool('MS_ConvoTrigger5', True,, 8);
}
else if (flags.GetBool('KidStealsSomething_Played') &&
!flags.GetBool('MS_ConvoTrigger6'))
{
foreach AllActors(class'Actor', A, 'KidGoesToLumPath')
A.Trigger(Self, Player);

flags.SetBool('MS_ConvoTrigger6', True,, 8);
}
else if (flags.GetBool('KidAsksForHelp_Played') &&
!flags.GetBool('MS_ConvoTrigger7'))
{
foreach AllActors(class'Actor', A, 'KidGoesToNewsStand')
A.Trigger(Self, Player);

flags.SetBool('MS_ConvoTrigger7', True,, 8);
}
else if (flags.GetBool('KidAsksForWork_Played') &&
!flags.GetBool('MS_ConvoTrigger8'))
{
foreach AllActors(class'Actor', A, 'KidGoesToLumPath')
A.Trigger(Self, Player);

flags.SetBool('MS_ConvoTrigger8', True,, 8);
}

// hide/unhide some keypads
if (flags.GetBool('QuickLetPlayerIn') &&
!flags.GetBool('MS_KeypadsMoved'))
{
foreach AllActors(class'Keypad1', pad)
{
if (pad.Tag == 'DummyKeypad01')
pad.Destroy();
else if (pad.Tag == 'GateKeypad')
pad.bHidden = False;
else if (pad.Tag == 'BasementKeypad')
pad.bHidden = False;
}

flags.SetBool('MS_KeypadsMoved', True,, 8);
}
}
else if (localURL == "06_HONGKONG_HELIBASE")
{
// start an InfoLink when helicopter is armed
if (flags.GetBool('helicopter_armed') &&
!flags.GetBool('MS_JockInfoLink'))
{
Player.StartDataLinkTransmission("DL_Jock_02");
flags.SetBool('MS_JockInfoLink', True,, 8);
}

// set the door rubble to be bBreakable
if (flags.GetBool('MS_DoorsBlown') && !flags.GetBool('MS_RubbleBreakable'))
{
// make the rubble breakable
foreach AllActors(class'DeusExMover', M, 'DoorWreckage')
M.bBreakable = True;

flags.SetBool('MS_RubbleBreakable', True,, 8);
}

// check to see if the doors are blown
if (flags.GetBool('MS_HelicopterFired') &&
!flags.GetBool('MS_DoorsBlown'))
{
fireTime += checkTime;
count = 0;
foreach AllActors(class'DeusExMover', M, 'Blast_doors')
if (!M.bDestroyed)
count++;

if (count == 0)
{
// have Jock bark at the player
Player.StartDataLinkTransmission("DL_Jock_03");

// turn on the alarm
foreach AllActors(class'AlarmUnit', unit, 'AlarmUnit')
unit.Trigger(None, None);

// trigger the dispatcher
foreach AllActors(class'Dispatcher', disp, 'Go')
disp.Trigger(None, None);

flags.SetBool('MS_DoorsBlown', True,, 8);
}
else
{
// keep firing every 3 seconds until the doors are gone
if (fireTime > 3)
{
FireMissilesAt('Blast_doors');
fireTime = 0;
}
}
}

// start the helicopter firing sequence when triggered
if (flags.GetBool('helicopter_fire') &&
!flags.GetBool('MS_HelicopterFired'))
{
// have Jock bark at the player
Player.StartDataLinkTransmission("DL_Jock_Fired");

// set the blast doors to be breakable
foreach AllActors(class'DeusExMover', M, 'Blast_doors')
M.bBreakable = True;

fireTime = 0;
FireMissilesAt('Blast_doors');

flags.SetBool('MS_HelicopterFired', True,, 8);
}
}
else if (localURL == "06_HONGKONG_STORAGE")
{
// make the AUC destroyable
if (flags.GetBool('ReadyToDestroyAUC') &&
!flags.GetBool('MS_ReadyAUC'))
{
foreach AllActors(class'DeusExMover', M)
if ((M.Tag == 'Pod01') || (M.Tag == 'Pod02') ||
(M.Tag == 'Pod03') || (M.Tag == 'Pod04') ||
(M.Tag == 'AUC'))
M.bBreakable = True;

flags.SetBool('MS_ReadyAUC', True,, 8);
}
}
else if (localURL == "06_HONGKONG_WANCHAI_CANAL")
{
if (flags.GetBool('Overhear_Canal_Thug1_Played') &&
!flags.GetBool('MS_DrugDealersAttacking'))
{
foreach AllActors(class'Actor', A, 'CanalDrugDealersAttack')
A.Trigger(Self, Player);

flags.SetBool('MS_DrugDealersAttacking', True,, 8);
}
}




Mission08.uc (extends MissionScript)

FirstFrame


local SandraRenton Sandra;
local FordSchick Ford;


Super.FirstFrame();

if (flags.GetBool('SandraWentToCalifornia'))
{
foreach AllActors(class'SandraRenton', Sandra)
Sandra.Destroy();
}

if (localURL == "08_NYC_SMUG")
{
// unhide Ford if you've rescued him
if (flags.GetBool('FordSchickRescued'))
{
foreach AllActors(class'FordSchick', Ford)
Ford.EnterWorld();
}
}

PreTravel


local BlackHelicopter chopper;


Super.PreTravel();

if (localURL == "08_NYC_STREET")
{
// make sure that damn helicopter is gone
foreach AllActors(class'BlackHelicopter', chopper, 'EntranceCopter')
chopper.Destroy();
}

Timer


local ScriptedPawn pawn;
local RiotCop cop;
local UNATCOTroop troop;
local MJ12Troop mj12;
local StantonDowd Stanton;
local ThugMale Thug;
local BlackHelicopter chopper;
local int count;


Super.Timer();

if (localURL == "08_NYC_FREECLINIC")
{
if (flags.GetBool('JoeGreene_Dead') &&
!flags.GetBool('MS_GreeneGoalSet'))
{
Player.GoalCompleted('KillGreene');
flags.SetBool('MS_GreeneGoalSet', True,, 9);
}
}
else if (localURL == "08_NYC_STREET")
{
// spawn reinforcements as cops are killed
if (!flags.GetBool('MS_UnhideTroop1'))
{
count = 0;
foreach AllActors(class'RiotCop', cop, 'Cop1')
count++;

if (count == 0)
{
foreach AllActors(class'UNATCOTroop', troop, 'troop1')
troop.EnterWorld();

flags.SetBool('MS_UnhideTroop1', True,, 9);
}
}
if (!flags.GetBool('MS_UnhideTroop2'))
{
count = 0;
foreach AllActors(class'RiotCop', cop, 'Cop2')
count++;

if (count == 0)
{
foreach AllActors(class'UNATCOTroop', troop, 'troop2')
troop.EnterWorld();

flags.SetBool('MS_UnhideTroop2', True,, 9);
}
}
if (!flags.GetBool('MS_UnhideTroop3'))
{
count = 0;
foreach AllActors(class'RiotCop', cop, 'Cop3')
count++;

if (count == 0)
{
foreach AllActors(class'UNATCOTroop', troop, 'troop3')
troop.EnterWorld();

flags.SetBool('MS_UnhideTroop3', True,, 9);
}
}
if (!flags.GetBool('MS_UnhideTroop4'))
{
count = 0;
foreach AllActors(class'RiotCop', cop, 'Cop4')
count++;

if (count == 0)
{
foreach AllActors(class'UNATCOTroop', troop, 'troop4')
troop.EnterWorld();

flags.SetBool('MS_UnhideTroop4', True,, 9);
}
}
if (!flags.GetBool('MS_UnhideTroop5'))
{
count = 0;
foreach AllActors(class'RiotCop', cop, 'Cop5')
count++;

if (count == 0)
{
foreach AllActors(class'UNATCOTroop', troop, 'troop5')
troop.EnterWorld();

flags.SetBool('MS_UnhideTroop5', True,, 9);
}
}
if (!flags.GetBool('MS_UnhideTroop6'))
{
count = 0;
foreach AllActors(class'RiotCop', cop, 'Cop6')
count++;

if (count == 0)
{
foreach AllActors(class'UNATCOTroop', troop, 'troop6')
troop.EnterWorld();

flags.SetBool('MS_UnhideTroop6', True,, 9);
}
}

// unhide Thomas Dieter
if (!flags.GetBool('MS_ThomasUnhidden'))
{
if (flags.GetBool('HarleyFilben_Dead'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'ThomasDieter')
if (pawn.IsA('Janitor'))
pawn.EnterWorld();

flags.SetBool('MS_ThomasUnhidden', True,, 9);
}
}

// unhide Stanton Dowd
if (!flags.GetBool('MS_StantonUnhidden'))
{
if (flags.GetBool('M08MeetHarleyFilben_Played') ||
flags.GetBool('MeetThomasDieter_Played'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'StantonDowd')
if (pawn.IsA('StantonDowd'))
pawn.EnterWorld();

flags.SetBool('MS_StantonUnhidden', True,, 9);
}
}

// unhide shady guy
if (!flags.GetBool('MS_ShadyGuyUnhidden'))
{
if (flags.GetBool('MS_StantonUnhidden'))
{
if ((flags.GetBool('GreenKnowsAboutDowd') &&
!flags.GetBool('JoeGreen_Dead')) ||
flags.GetBool('SheaKnowsAboutDowd'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'ShadyGuy')
if (pawn.IsA('ThugMale'))
pawn.EnterWorld();

flags.SetBool('MS_ShadyGuyUnhidden', True,, 9);
}
}
}

// spawn MJ12 attack force when Shady Guy gets close (8 feet) to Dowd
if (!flags.GetBool('StantonAmbush'))
{
Stanton = None;
foreach AllActors(class'ScriptedPawn', pawn, 'StantonDowd')
if (pawn.IsA('StantonDowd'))
Stanton = StantonDowd(pawn);

if (Stanton != None)
{
Thug = None;
foreach AllActors(class'ScriptedPawn', pawn, 'ShadyGuy')
Thug = ThugMale(pawn);

if (Thug != None)
{
if (VSize(Thug.Location - Stanton.Location) <= 128)
{
foreach AllActors(class'MJ12Troop', mj12, 'MJ12AttackForce')
mj12.EnterWorld();

flags.SetBool('StantonAmbush', True,, 9);
}
}
}
}

// spawn MJ12 attack force when a flag is set
if (!flags.GetBool('StantonAmbush') &&
flags.GetBool('MJ12Converging'))
{
foreach AllActors(class'MJ12Troop', mj12, 'MJ12AttackForce')
mj12.EnterWorld();

flags.SetBool('StantonAmbush', True,, 9);
}

// if the MJ12 attack force is killed, set a flag
if (flags.GetBool('StantonAmbush') &&
!flags.GetBool('StantonAmbushDefeated'))
{
count = 0;
foreach AllActors(class'MJ12Troop', mj12, 'MJ12AttackForce')
count++;

if (count == 0)
flags.SetBool('StantonAmbushDefeated', True,, 9);
}

// unhide the helicopter when its time
if (flags.GetBool('StantonDowd_Played') &&
flags.GetBool('DL_Exit_Played') &&
!flags.GetBool('MS_Helicopter_Unhidden'))
{
foreach AllActors(class'BlackHelicopter', chopper, 'CopterExit')
chopper.EnterWorld();

flags.SetBool('MS_Helicopter_Unhidden', True,, 9);
}
}




Mission09.uc (extends MissionScript)

FirstFrame


local DeusExMover M;
local BlackHelicopter chopper;


Super.FirstFrame();

if (localURL == "09_NYC_SHIP")
{
if (flags.GetBool('ShipBreech'))
{
foreach AllActors(class'DeusExMover', M)
{
if ((M.Tag == 'SewerGrate') || (M.Tag == 'FrontDoor'))
{
// close and lock the door
if (M.KeyNum != 0)
M.Trigger(None, None);
M.bBreakable = False;
M.bPickable = False;
M.bFrobbable = False;
M.bLocked = True;
}
}
}
}
else if (localURL == "09_NYC_DOCKYARD")
{
if (flags.GetBool('MS_ShipBreeched'))
{
foreach AllActors(class'BlackHelicopter', chopper, 'BlackHelicopter')
chopper.EnterWorld();
}
}

PreTravel


Super.PreTravel();

ShipExplosionEffects (bool bFragments)


local float shakeTime, shakeRoll, shakeVert;
local float size, explosionFreq;
local int i;
local Vector bobble, loc, endloc, HitLocation, HitNormal;
local Actor HitActor;
local HangingDecoration deco;
local Cart cart;
local MetalFragment frag;


if (bFragments)
explosionFreq = 0.33;
else
explosionFreq = 0.1;

if (FRand() < explosionFreq)
{
// pick a random explosion size and modify everything accordingly
size = FRand();
shakeTime = 0.5 + size;
shakeRoll = 512.0 + 1024.0 * size;
shakeVert = 8.0 + 16.0 * size;

// play a sound
if (size < 0.2)
Player.PlaySound(Sound'SmallExplosion1', SLOT_None, 2.0,, 16384);
else if (size < 0.4)
Player.PlaySound(Sound'MediumExplosion1', SLOT_None, 2.0,, 16384);
else if (size < 0.6)
Player.PlaySound(Sound'MediumExplosion2', SLOT_None, 2.0,, 16384);
else if (size < 0.8)
Player.PlaySound(Sound'LargeExplosion1', SLOT_None, 2.0,, 16384);
else
Player.PlaySound(Sound'LargeExplosion2', SLOT_None, 2.0,, 16384);

// shake the view
Player.ShakeView(shakeTime, shakeRoll, shakeVert);

// bobble the player around
bobble = vect(300.0,300.0,200.0) + 500.0 * size * VRand();
Player.Velocity += bobble;

// make all the hanging decorations sway randomly
foreach AllActors(class'HangingDecoration', deco)
{
deco.CalculateHit(deco.Location + 10.0 * FRand() * VRand(), 0.5 * bobble);
deco.bSwaying = True;
}

// make all the carts move randomly
foreach AllActors(class'Cart', cart)
cart.StartRolling(vect(100.0,100.0,0.0) + 200.0 * size * VRand());

// have random metal fragments fall from the ceiling
if (bFragments)
{
for (i=0; i {
loc = Player.Location + 256.0 * VRand();
loc.Z = Player.Location.Z;
endloc = loc;
endloc.Z += 1024.0;
HitActor = Trace(HitLocation, HitNormal, endloc, loc, False);
if (HitActor == None)
HitLocation = endloc;
frag = Spawn(class'MetalFragment',,, HitLocation);
if (frag != None)
{
frag.CalcVelocity(vect(20000,0,0),256);
frag.DrawScale = 0.5 + 2.0 * FRand();
if (FRand() < 0.25)
frag.bSmoking = True;
}
}
}
}

// make sure the player's zone has an alarm ambient sound
if (Player.HeadRegion.Zone != None)
{
Player.HeadRegion.Zone.AmbientSound = sound'Klaxon';
Player.HeadRegion.Zone.SoundRadius = 255;
Player.HeadRegion.Zone.SoundVolume = 255;
}

Timer


local int count;
local DeusExMover M;
local BlackHelicopter chopper;
local MJ12Troop troop;
local Trigger trig;
local MJ12Commando commando;
local WaltonSimons Walton;


Super.Timer();

if (localURL == "09_NYC_SHIP")
{
// unhide Walton Simons
if (!flags.GetBool('MS_SimonsAppeared') &&
flags.GetBool('SummonSimons'))
{
foreach AllActors(class'WaltonSimons', Walton)
Walton.EnterWorld();

flags.SetBool('MS_SimonsAppeared', True,, 10);
}

// hide Walton Simons, and make this convo retriggerable
if (flags.GetBool('MS_SimonsAppeared') &&
flags.GetBool('M09SimonsDisappears'))
{
foreach AllActors(class'WaltonSimons', Walton)
Walton.LeaveWorld();

flags.SetBool('M09SimonsDisappears', False,, 10);
flags.SetBool('MS_SimonsAppeared', False,, 10);
flags.SetBool('SummonSimons', False,, 10);
}

// randomly play explosions and shake the view
// if the ship has been breeched
if (flags.GetBool('MS_ShipBreeched'))
ShipExplosionEffects(False);
}
else if (localURL == "09_NYC_SHIPBELOW")
{
// check for blown up ship
if (!flags.GetBool('MS_ShipBreeched'))
{
count = 0;
foreach AllActors(class'DeusExMover', M, 'ShipBreech')
if (!M.bDestroyed)
count++;

if (count == 0)
{
if (flags.GetBool('Bilge'))
{
Player.StartDataLinkTransmission("DL_AllDone");
flags.SetBool('MS_ShipBreeched', True,, 10);
}
else if (!flags.GetBool('DL_AllPlaced_Played'))
{
Player.StartDataLinkTransmission("DL_AllPlaced");
}
}
}

// randomly play explosions and shake the view
// if the ship has been breeched
if (flags.GetBool('MS_ShipBreeched'))
ShipExplosionEffects(True);
}
else if (localURL == "09_NYC_GRAVEYARD")
{
// unhide the helicopter when the "little device" is destroyed
if (!flags.GetBool('MS_UnhideHelicopter'))
{
if (flags.GetBool('deviceDestroyed') &&
flags.GetBool('M09MeetStantonDowd_Played'))
{
foreach AllActors(class'BlackHelicopter', chopper, 'BlackHelicopter')
chopper.EnterWorld();

Player.StartDataLinkTransmission("DL_ComingIn");

foreach AllActors(class'MJ12Troop', troop, 'TroopSupport')
troop.EnterWorld();

flags.SetBool('MS_UnhideHelicopter', True,, 10);
}
}

// activate a trigger and unhide some troops
// once Stanton Dowd has been talked to
if (!flags.GetBool('MS_TriggerOn') &&
flags.GetBool('M09MeetStantonDowd_Played'))
{
foreach AllActors(class'Trigger', trig, 'TunnelTrigger')
trig.SetCollision(True);

foreach AllActors(class'MJ12Troop', troop, 'TroopInsertion')
troop.EnterWorld();

flags.SetBool('MS_TriggerOn', True,, 10);
}

// spawn some commandos
if (flags.GetBool('GreenKnowsAboutDowd') &&
flags.GetBool('suprisePoint') &&
!flags.GetBool('MS_UnhideCommandos'))
{
foreach AllActors(class'MJ12Commando', commando, 'paratroop')
commando.EnterWorld();

flags.SetBool('MS_UnhideCommandos', True,, 10);
}
}




Mission10.uc (extends MissionScript)

FirstFrame


local NicoletteDuClare Nicolette;
local BlackHelicopter chopper;
local JaimeReyes Jaime;


Super.FirstFrame();

if (localURL == "10_PARIS_METRO")
{
if (flags.GetBool('NicoletteLeftClub'))
{
foreach AllActors(class'NicoletteDuClare', Nicolette)
Nicolette.EnterWorld();

foreach AllActors(class'BlackHelicopter', chopper, 'BlackHelicopter')
chopper.EnterWorld();
}

if (!flags.GetBool('JaimeRecruited'))
{
foreach AllActors(class'JaimeReyes', Jaime)
Jaime.EnterWorld();
}
}
else if (localURL == "10_PARIS_CLUB")
{
if (flags.GetBool('NicoletteLeftClub'))
{
foreach AllActors(class'NicoletteDuClare', Nicolette)
Nicolette.Destroy();
}
}
else if (localURL == "10_PARIS_CHATEAU")
{
flags.SetBool('ClubComplete', True,, 11);
}

PreTravel


if (localURL == "10_PARIS_CLUB")
{
if (flags.GetBool('MeetNicolette_Played') &&
!flags.GetBool('NicoletteLeftClub'))
{
flags.SetBool('NicoletteLeftClub', True,, 11);
}
}

Super.PreTravel();

Timer


local int count;
local int notSafeCount, notDeadCount;
local ScriptedPawn hostage, guard;
local Greasel greasel;
local GuntherHermann gunther;
local MJ12Commando commando;
local Actor A;


Super.Timer();

if (localURL == "10_PARIS_CATACOMBS")
{
// see if the greasels are dead
if (!flags.GetBool('SewerGreaselsDead'))
{
count = 0;
foreach AllActors(class'Greasel', greasel, 'SewerGreasel')
count++;

if (count == 0)
flags.SetBool('SewerGreaselsDead', True,, 11);
}

// check for dead guards
if (!flags.GetBool('defoequestcomplete'))
{
count = 0;
foreach AllActors(class'ScriptedPawn', guard, 'mj12metroguards')
count++;

if (count == 0)
flags.SetBool('defoequestcomplete', True,, 11);
}
}
else if (localURL == "10_PARIS_CATACOMBS_TUNNELS")
{
if (!flags.GetBool('SilhouetteRescueComplete'))
{
// count how many hostages are NOT safe
notSafeCount = 0;
notDeadCount = 0;
foreach AllActors(class'ScriptedPawn', hostage)
{
if (hostage.BindName == "hostage")
{
notDeadCount++;
if (!flags.GetBool('CataMaleSafe'))
notSafeCount++;
}
else if (hostage.BindName == "hostage_female")
{
notDeadCount++;
if (!flags.GetBool('CataFemaleSafe'))
notSafeCount++;
}
}

if ((notSafeCount == 0) || (notDeadCount == 0))
{
flags.SetBool('SilhouetteRescueComplete', True,, 11);
Player.GoalCompleted('EscortHostages');

if (notDeadCount == 0)
flags.SetBool('SilhouetteHostagesDead', True,, 11);
else if (notDeadCount < 2)
flags.SetBool('SilhouetteHostagesSomeRescued', True,, 11);
else
flags.SetBool('SilhouetteHostagesAllRescued', True,, 11);
}
}
}
else if (localURL == "10_PARIS_METRO")
{
// unhide GuntherHermann
if (!flags.GetBool('MS_GuntherUnhidden') &&
flags.GetBool('JockReady_Played'))
{
foreach AllActors(class'GuntherHermann', gunther)
gunther.EnterWorld();

flags.SetBool('MS_GuntherUnhidden', True,, 11);
}

// bark something
if (flags.GetBool('AlleyCopSeesPlayer_Played') &&
!flags.GetBool('MS_CopBarked'))
{
foreach AllActors(class'Actor', A, 'AlleyCopAttacks')
A.Trigger(Self, Player);

flags.SetBool('MS_CopBarked', True,, 11);
}
}
else if (localURL == "10_PARIS_CHATEAU")
{
// unhide MJ12Commandos when an infolink is played
if (!flags.GetBool('MS_CommandosUnhidden') &&
flags.GetBool('everettsignal'))
{
foreach AllActors(class'MJ12Commando', commando)
commando.EnterWorld();

flags.SetBool('MS_CommandosUnhidden', True,, 11);
}
}




Mission11.uc (extends MissionScript)

FirstFrame


Super.FirstFrame();

PreTravel


Super.PreTravel();

Timer


local TobyAtanwe toby;
local GuntherHermann gunther;
local BlackHelicopter chopper;
local AlexJacobson alex;
local WaltonSimons walton;


Super.Timer();

if (localURL == "11_PARIS_UNDERGROUND")
{
// unhide Toby Atanwe
if (flags.GetBool('templar_upload') &&
!flags.GetBool('MS_TobyUnhidden'))
{
foreach AllActors(class'TobyAtanwe', toby)
toby.EnterWorld();

flags.SetBool('MS_TobyUnhidden', True,, 12);
}

// knock out the player and teleport him after this convo
if (flags.GetBool('MeetTobyAtanwe_Played') &&
!flags.GetBool('MS_PlayerTeleported'))
{
flags.SetBool('MS_PlayerTeleported', True,, 12);
Level.Game.SendPlayer(Player, "11_PARIS_EVERETT");
}
}
else if (localURL == "11_PARIS_EVERETT")
{
// unhide the helicopter
if (flags.GetBool('MeetEverett_Played') &&
!flags.GetBool('MS_ChopperUnhidden'))
{
foreach AllActors(class'BlackHelicopter', chopper)
chopper.EnterWorld();

flags.SetBool('MS_ChopperUnhidden', True,, 12);
}

// unhide Alex Jacobson
if (flags.GetBool('AtanweAtEveretts_Played') &&
!flags.GetBool('MS_AlexUnhidden'))
{
foreach AllActors(class'AlexJacobson', alex)
alex.EnterWorld();

flags.SetBool('MS_AlexUnhidden', True,, 12);
}

// set a flag
if (flags.GetBool('Ray_Dead') &&
!flags.GetBool('MS_RayDead'))
{
Player.GoalCompleted('KillMechanic');
flags.SetBool('MS_RayDead', True,, 12);
}
}
else if (localURL == "11_PARIS_CATHEDRAL")
{
// kill Gunther after a convo
if (flags.GetBool('M11MeetGunther_Played') &&
flags.GetBool('KillGunther') &&
!flags.GetBool('MS_GuntherKilled'))
{
foreach AllActors(class'GuntherHermann', gunther)
{
gunther.bInvincible = False;
gunther.HealthTorso = 0;
gunther.Health = 0;
gunther.GotoState('KillswitchActivated');
flags.SetBool('GuntherHermann_Dead', True,, 0);
flags.SetBool('MS_GuntherKilled', True,, 12);
}
}

// unhide Walton Simons
if (flags.GetBool('templar_upload') &&
flags.GetBool('M11NearWalt') &&
!flags.GetBool('MS_M11WaltAppeared'))
{
foreach AllActors(class'WaltonSimons', walton)
walton.EnterWorld();

flags.SetBool('MS_M11WaltAppeared', True,, 12);
}

// hide Walton Simons
if (flags.GetBool('M11WaltonHolo_Played') &&
!flags.GetBool('MS_M11WaltRemoved'))
{
foreach AllActors(class'WaltonSimons', walton)
walton.LeaveWorld();

flags.SetBool('MS_M11WaltRemoved', True,, 12);
}
}




Mission12.uc (extends MissionScript)

FirstFrame


local BlackHelicopter chopper;
local ScriptedPawn pawn;
local SandraRenton Sandra;


Super.FirstFrame();

if (localURL == "12_VANDENBERG_CMD")
{
// unhide the black helicopter, Jock, and TracerTong
if (flags.GetBool('GaryHostageBriefing_Played'))
{
foreach AllActors(class'BlackHelicopter', chopper)
chopper.EnterWorld();

foreach AllActors(class'ScriptedPawn', pawn)
if (pawn.IsA('Jock') || pawn.IsA('TracerTong'))
pawn.EnterWorld();
}
}
else if (localURL == "12_VANDENBERG_GAS")
{
flags.SetBool('RescueBegan', True,, 14);

if (flags.GetBool('SandraWentToCalifornia'))
{
foreach AllActors(class'SandraRenton', Sandra)
Sandra.EnterWorld();
}
}

PreTravel


Super.PreTravel();

Timer


local Robot bot;
local BlackHelicopter chopper;
local ScriptedPawn pawn;
local MJ12Troop troop;
local Earth earth;
local BobPage Bob;
local int count;
local DeusExMover M;


Super.Timer();

if (localURL == "12_VANDENBERG_CMD")
{
// play datalinks when robots are destroyed or disabled
if (!flags.GetBool('MS_DL_Played'))
{
count = 0;
foreach AllActors(class'Robot', bot, 'enemy_bot')
if (bot.EMPHitPoints > 0)
count++;

if (count == 3)
Player.StartDataLinkTransmission("DL_bots_left_3");
else if (count == 2)
Player.StartDataLinkTransmission("DL_bots_left_2");
else if (count == 1)
Player.StartDataLinkTransmission("DL_bots_left_1");
else if (count == 0)
{
Player.StartDataLinkTransmission("DL_command_bots_destroyed");
flags.SetBool('MS_DL_Played', True,, 14);
}
}

// rescue the scientist when the guards are dead
if (!flags.GetBool('CapturedScientistRescued'))
{
count = 0;
foreach AllActors(class'MJ12Troop', troop)
if ((troop.Tag == 'MJ12_hazlab_troop1') || (troop.Tag == 'MJ12_hazlab_troop2'))
count++;

if (count == 0)
flags.SetBool('CapturedScientistRescued', True,, 14);
}
}
else if (localURL == "12_VANDENBERG_GAS")
{
// unhide the black helicopter and destroy the doors
if (!flags.GetBool('MS_ChopperGasUnhidden'))
{
if (flags.GetBool('MeetTiffanySavage_Played') ||
flags.GetBool('TiffanySavage_Dead'))
{
foreach AllActors(class'BlackHelicopter', chopper)
chopper.EnterWorld();

foreach AllActors(Class'DeusExMover', M, 'junkyard_doors')
M.BlowItUp(None);

flags.SetBool('TiffanyRescued', True,, 14);
flags.SetBool('MS_ChopperGasUnhidden', True,, 14);
}
}

if (!flags.GetBool('MS_TiffanyDLPlayed') &&
flags.GetBool('TiffanySavage_Dead'))
{
Player.StartDataLinkTransmission("DL_JockTiffanyDead");
flags.SetBool('MS_TiffanyDLPlayed', True,, 14);
}
}
else if (localURL == "12_VANDENBERG_COMPUTER")
{
// hide the earth and unhide Bob Page
if (!flags.GetBool('MS_M12PageAppeared') &&
flags.GetBool('M12PageAppears'))
{
foreach AllActors(class'Earth', earth)
earth.bHidden = True;

foreach AllActors(class'BobPage', Bob)
Bob.EnterWorld();

flags.SetBool('MS_M12PageAppeared', True,, 14);
}

// unhide the earth and hide Bob Page
if (flags.GetBool('MS_M12PageAppeared') &&
!flags.GetBool('MS_BobPageHidden') &&
flags.GetBool('PageHostageBriefing_Played'))
{
foreach AllActors(class'Earth', earth)
earth.bHidden = False;

foreach AllActors(class'BobPage', Bob)
Bob.LeaveWorld();

flags.SetBool('MS_BobPageHidden', True,, 14);
}
}




Mission14.uc (extends MissionScript)

FirstFrame


Super.FirstFrame();

if (localURL == "14_OCEANLAB_LAB")
{
Player.GoalCompleted('StealSub');
}

PreTravel


Super.PreTravel();

Timer


local int count;
local HowardStrong Howard;
local BlackHelicopter chopper;
local MiniSub sub;
local ScubaDiver diver;
local GarySavage Gary;
local WaltonSimons Walton;
local Actor part;
local BobPage Bob;


Super.Timer();

if (localURL == "14_VANDENBERG_SUB")
{
// when the mission is complete, unhide the chopper and Gary Savage,
// and destroy the minisub and the welding parts
if (!flags.GetBool('MS_DestroySub'))
{
if (flags.GetBool('DL_downloaded_Played'))
{
foreach AllActors(class'MiniSub', sub, 'MiniSub2')
sub.Destroy();

foreach AllActors(class'Actor', part, 'welding_stuff')
part.Destroy();

foreach AllActors(class'BlackHelicopter', chopper, 'BlackHelicopter')
chopper.EnterWorld();

foreach AllActors(class'GarySavage', Gary)
Gary.EnterWorld();

flags.SetBool('MS_DestroySub', True,, 15);
}
}
}
else if (localURL == "14_OCEANLAB_LAB")
{
// when the mission is complete, unhide the minisub and the diver team
if (!flags.GetBool('MS_UnhideSub'))
{
if (flags.GetBool('DL_downloaded_Played'))
{
foreach AllActors(class'WaltonSimons', Walton)
Walton.EnterWorld();

foreach AllActors(class'MiniSub', sub, 'MiniSub2')
sub.EnterWorld();

foreach AllActors(class'ScubaDiver', diver, 'scubateam')
diver.EnterWorld();

flags.SetBool('MS_UnhideSub', True,, 15);
}
}
}
else if (localURL == "14_OCEANLAB_SILO")
{
// when HowardStrong is dead, unhide the helicopter
if (!flags.GetBool('MS_UnhideHelicopter'))
{
count = 0;
foreach AllActors(class'HowardStrong', Howard)
count++;

if (count == 0)
{
foreach AllActors(class'BlackHelicopter', chopper, 'BlackHelicopter')
chopper.EnterWorld();

Player.StartDataLinkTransmission("DL_Dead");
flags.SetBool('MS_UnhideHelicopter', True,, 15);
}
}
}
else if (localURL == "14_OCEANLAB_UC")
{
// when a flag is set, unhide Bob Page
if (!flags.GetBool('MS_UnhideBobPage') &&
flags.GetBool('schematic_downloaded'))
{
foreach AllActors(class'BobPage', Bob)
Bob.EnterWorld();

flags.SetBool('MS_UnhideBobPage', True,, 15);
}

// when a flag is set, hide Bob Page
if (!flags.GetBool('MS_HideBobPage') &&
flags.GetBool('PageTaunt_Played'))
{
foreach AllActors(class'BobPage', Bob)
Bob.LeaveWorld();

flags.SetBool('MS_HideBobPage', True,, 15);
}
}




Mission15.uc (extends MissionScript)

var name spawnTag;
var class spawnClass;
var name Tag;
var name orderTag;
var int count;
var float lastKilledTime;
var sUCData spawnData[12];
var float jockTimer, pageTimer;
var BobPageAugmented page;
spawnData(0)=(SpawnTag=UC_spawn1,SpawnClass=Class'DeusEx.SpiderBot2',Tag=spbot1,OrderTag=spiderbot1_0,lastKilledTime=-1.000000)
spawnData(1)=(SpawnTag=UC_spawn1,SpawnClass=Class'DeusEx.SpiderBot2',Tag=spbot2,OrderTag=spiderbot2_0,lastKilledTime=-1.000000)
spawnData(2)=(SpawnTag=UC_spawn2,SpawnClass=Class'DeusEx.Gray',Tag=gray_1,OrderTag=gray1_0,lastKilledTime=-1.000000)
spawnData(3)=(SpawnTag=UC_spawn2,SpawnClass=Class'DeusEx.Gray',Tag=gray_2,OrderTag=gray2_0,lastKilledTime=-1.000000)
spawnData(4)=(SpawnTag=UC_spawn2,SpawnClass=Class'DeusEx.Gray',Tag=gray_3,OrderTag=gray3_0,lastKilledTime=-1.000000)
spawnData(5)=(SpawnTag=UC_spawn3,SpawnClass=Class'DeusEx.Karkian',Tag=karkian_1,OrderTag=karkian1_0,lastKilledTime=-1.000000)
spawnData(6)=(SpawnTag=UC_spawn3,SpawnClass=Class'DeusEx.Karkian',Tag=karkian_2,OrderTag=karkian2_0,lastKilledTime=-1.000000)
spawnData(7)=(SpawnTag=UC_spawn3,SpawnClass=Class'DeusEx.Karkian',Tag=karkian_3,OrderTag=karkian3_0,lastKilledTime=-1.000000)
spawnData(8)=(SpawnTag=UC_spawn3,SpawnClass=Class'DeusEx.Greasel',Tag=greasel_1,OrderTag=greasel1_0,lastKilledTime=-1.000000)
spawnData(9)=(SpawnTag=UC_spawn3,SpawnClass=Class'DeusEx.Greasel',Tag=greasel_2,OrderTag=greasel2_0,lastKilledTime=-1.000000)
spawnData(10)=(SpawnTag=UC_spawn3,SpawnClass=Class'DeusEx.Greasel',Tag=greasel_3,OrderTag=greasel3_0,lastKilledTime=-1.000000)
spawnData(11)=(SpawnTag=UC_spawn3,SpawnClass=Class'DeusEx.Greasel',Tag=greasel_4,OrderTag=greasel4_0,lastKilledTime=-1.000000)

FirstFrame


local BlackHelicopter chopper;
local InterpolateTrigger trig;


Super.FirstFrame();

if (localURL == "15_AREA51_BUNKER")
{
// unhide a helicopter if a flag is set, and start the countdown
// to Jock's death
if (!flags.GetBool('Ray_dead'))
{
foreach AllActors(class'BlackHelicopter', chopper)
{
if (chopper.Tag == 'heli_sabotaged')
chopper.EnterWorld();
else if (chopper.Tag == 'UN_BlackHeli')
chopper.LeaveWorld();
}

// start the new helicopter interpolating
foreach AllActors(class'InterpolateTrigger', trig, 'InterpolateTrigger')
trig.Trigger(Self, Player);

jockTimer = Level.TimeSeconds;
flags.SetBool('MS_BeginSabotage', True,, 16);
}
}

PageExplosionEffects


local float shakeTime, shakeRoll, shakeVert;
local float size;
local int i;
local Vector bobble, loc, endloc, HitLocation, HitNormal;
local Actor HitActor;
local MetalFragment frag;


// pick a random explosion size and modify everything accordingly
size = 0.5 * FRand() + 0.5;
shakeTime = 0.5 + size;
shakeRoll = 512.0 + 1024.0 * size;
shakeVert = 8.0 + 16.0 * size;

// play a sound
if (size < 0.75)
Player.PlaySound(Sound'MediumExplosion2', SLOT_None, 2.0,, 16384);
else if (size < 0.85)
Player.PlaySound(Sound'LargeExplosion1', SLOT_None, 2.0,, 16384);
else
Player.PlaySound(Sound'LargeExplosion2', SLOT_None, 2.0,, 16384);

// shake the view
Player.ShakeView(shakeTime, shakeRoll, shakeVert);

// bobble the player around
bobble = vect(300.0,300.0,200.0) + 500.0 * size * VRand();
Player.Velocity += bobble;

// have random metal fragments fall from the ceiling
for (i=0; i {
if (page != None)
{
loc = page.Location + 64.0 * VRand();
loc.Z = page.Location.Z;
}
else
{
loc = Player.Location + 256.0 * VRand();
loc.Z = Player.Location.Z;
}
endloc = loc;
endloc.Z += 1024.0;
HitActor = Trace(HitLocation, HitNormal, endloc, loc, False);
if (HitActor == None)
HitLocation = endloc;

// spawn some explosion effects
if (size < 0.75)
Spawn(class'ExplosionMedium',,, HitLocation+8*HitNormal);
else
Spawn(class'ExplosionLarge',,, HitLocation+8*HitNormal);

frag = Spawn(class'MetalFragment',,, HitLocation);
if (frag != None)
{
frag.CalcVelocity(vect(20000,0,0),256);
frag.DrawScale = 0.5 + 2.0 * FRand();
if (FRand() < 0.5)
frag.bSmoking = True;
}
}

PreTravel


Super.PreTravel();

Timer


local ZoneInfo zone;
local Fan1 fan;
local int count, i, j;
local Earth earth;
local MorganEverett Morgan;
local TracerTong Tracer;
local ScriptedPawn pawn;
local SpawnPoint SP;
local BlackHelicopter chopper;
local SphereEffect sphere;
local MetalFragment frag;
local AnimatedSprite explo;
local ElectricityEmitter elec;
local Vector loc;
local Switch2 sw;
local MJ12Commando comm;
local Actor A;
local DeusExMover M;
local LifeSupportBase base;
local BobPageAugmented tempPage;


Super.Timer();

if (localURL == "15_AREA51_BUNKER")
{
// destroy Jock's heli on takeoff if a flag is set
if (flags.GetBool('MS_BeginSabotage') && !flags.GetBool('MS_JockDead'))
{
// 8 seconds after level start, play a datalink
if (!flags.GetBool('DL_JockDeath_Played') && (Level.TimeSeconds - jockTimer >= 8.0))
Player.StartDataLinkTransmission("DL_JockDeath");

// 11 seconds after level start, start to destroy Jock's helicopter
// When the datalink is finished, finish destroying Jock's helicopter
if (flags.GetBool('DL_JockDeath_Played'))
{
// spawn the final explosions and lots of debris
foreach AllActors(class'BlackHelicopter', chopper, 'heli_sabotaged')
{
// large explosion sprites
for (i=0; i<20; i++)
{
loc = chopper.Location + VRand() * chopper.CollisionHeight;
if (FRand() < 0.25)
explo = Spawn(class'ExplosionMedium',,, loc);
else
explo = Spawn(class'ExplosionLarge',,, loc);

if (explo != None)
explo.animSpeed += 0.4 * FRand();
}

// metal fragments
for (i=0; i<20; i++)
{
loc = chopper.Location + VRand() * chopper.CollisionHeight;
frag = Spawn(class'MetalFragment',,, loc);
if (frag != None)
{
frag.CalcVelocity(vect(40000,0,0),512);
frag.DrawScale = 5.0 + 2.0 * FRand();
frag.Skin = chopper.GetMeshTexture();
if (FRand() < 0.5)
frag.bSmoking = True;
}
}

// light sphere
sphere = Spawn(class'SphereEffect',,, loc);
if (sphere != None)
sphere.size = 32.0;

// sound
Player.PlaySound(Sound'LargeExplosion2', SLOT_None, 2.0,, 16384);
Player.ShakeView(1.0, 1024.0, 32.0);
chopper.Destroy();
break;
}

Player.StartDataLinkTransmission("DL_JockDeathTongComment");
flags.SetBool('MS_JockDead', True,, 16);
}
else if (Level.TimeSeconds - jockTimer >= 11.0)
{
// spawn an inital explosion
foreach AllActors(class'BlackHelicopter', chopper, 'heli_sabotaged')
{
// small explosion sprites
for (i=0; i<6; i++)
{
loc = chopper.Location + VRand() * chopper.CollisionHeight;
if (FRand() < 0.25)
explo = Spawn(class'ExplosionSmall',,, loc);
else
explo = Spawn(class'ExplosionMedium',,, loc);

if (explo != None)
explo.animSpeed += 0.3 * FRand();
}

// sound
Player.PlaySound(Sound'MediumExplosion1', SLOT_None, 2.0,, 16384);
break;
}
}
}

// turn off pain zone when fan is destroyed
if (!flags.GetBool('MS_FanDestroyed'))
{
count = 0;
foreach AllActors(class'Fan1', fan, 'Fan_vertical_shaft_1')
count++;

if (count == 0)
{
foreach AllActors(class'ZoneInfo', zone, 'fan')
zone.Trigger(Player, Player);

flags.SetBool('MS_FanDestroyed', True,, 16);
}
}
}
else if (localURL == "15_AREA51_ENTRANCE")
{
// hide the earth and unhide Everett
if (!flags.GetBool('MS_EverettAppeared') &&
flags.GetBool('EverettAppears'))
{
foreach AllActors(class'Earth', earth)
earth.bHidden = True;

foreach AllActors(class'MorganEverett', Morgan)
Morgan.EnterWorld();

flags.SetBool('MS_EverettAppeared', True,, 16);
}

// unhide the earth and hide Everett
if (!flags.GetBool('MS_MorganEverettHidden') &&
flags.GetBool('M15MeetEverett_Played'))
{
foreach AllActors(class'Earth', earth)
earth.bHidden = False;

foreach AllActors(class'MorganEverett', Morgan)
Morgan.LeaveWorld();

flags.SetBool('MS_MorganEverettHidden', True,, 16);
}
}
else if (localURL == "15_AREA51_FINAL")
{
// unhide some commandos
if (flags.GetBool('MeetHelios_Played') &&
!flags.GetBool('MS_CommandosUnhidden'))
{
foreach AllActors(class'MJ12Commando', comm)
if ((comm.Tag == 'commando1') || (comm.Tag == 'commando2') || (comm.Tag == 'commando3'))
comm.EnterWorld();

flags.SetBool('MS_CommandosUnhidden', True,, 16);
}

// hide some buttons
if (!flags.GetBool('MS_ButtonsHidden') && flags.GetBool('coolantcut'))
{
foreach AllActors(class'Switch2', sw)
{
if ((sw.Tag == 'gen_switch1_off') || (sw.Tag == 'gen_switch2_off'))
sw.bHidden = True;
else if ((sw.Tag == 'gen_switch1_on') || (sw.Tag == 'gen_switch2_on'))
sw.bHidden = False;
}

flags.SetBool('MS_ButtonsHidden', True,, 16);
}

// hide the earth and unhide Tong
if (!flags.GetBool('MS_TongAppeared') &&
flags.GetBool('TongAppears'))
{
foreach AllActors(class'Earth', earth)
earth.bHidden = True;

foreach AllActors(class'TracerTong', Tracer)
Tracer.EnterWorld();

flags.SetBool('MS_TongAppeared', True,, 16);
}

// unhide the earth and hide Tong
if (!flags.GetBool('MS_TracerTongHidden') &&
flags.GetBool('M15MeetTong_Played'))
{
foreach AllActors(class'Earth', earth)
earth.bHidden = False;

foreach AllActors(class'TracerTong', Tracer)
Tracer.LeaveWorld();

flags.SetBool('MS_TracerTongHidden', True,, 16);
}

// unhide Paul or Gary
if (!flags.GetBool('MS_PaulOrGaryAppeared') &&
flags.GetBool('PaulAppears'))
{
if (flags.GetBool('PaulDenton_Dead'))
{
foreach AllActors(class'ScriptedPawn', pawn, 'GarySavage')
pawn.EnterWorld();
}
else
{
foreach AllActors(class'ScriptedPawn', pawn, 'PaulDenton')
pawn.EnterWorld();
}

flags.SetBool('MS_PaulOrGaryAppeared', True,, 16);
}

// hide Paul or Gary
if (!flags.GetBool('MS_PaulOrGaryHidden') &&
(flags.GetBool('M15PaulHolo_Played') ||
flags.GetBool('M15GaryHolo_Played')))
{
foreach AllActors(class'ScriptedPawn', pawn)
if ((pawn.Tag == 'PaulDenton') || (pawn.Tag == 'GarySavage'))
pawn.LeaveWorld();

flags.SetBool('MS_PaulOrGaryHidden', True,, 16);
}
}
else if (localURL == "15_AREA51_PAGE")
{
// check for UC respawing
// count the number of monsters that are still alive
foreach AllActors(class'ScriptedPawn', pawn)
for (i=0; i if ((pawn.Class == spawnData[i].spawnClass) && (pawn.Tag == spawnData[i].Tag))
spawnData[i].count++;

// check to see when the last one was killed and set the time correctly
for (i=0; i if ((spawnData[i].count == 0) && (spawnData[i].lastKilledTime == -1))
spawnData[i].lastKilledTime = Level.TimeSeconds;

// spawn any monsters which have been missing for 20 seconds
for (i=0; i {
if ((spawnData[i].count == 0) && (Level.TimeSeconds - spawnData[i].lastKilledTime > 20))
{
SP = GetSpawnPoint(spawnData[i].spawnTag);
if (SP != None)
{
// draw some light effects
Spawn(class'ExplosionLight',,, SP.Location);
Spawn(class'EllipseEffect',,, SP.Location);
sphere = Spawn(class'SphereEffect',,, SP.Location);
if (sphere != None)
sphere.size = 4.0;

// draw some electricity effects
for (j=0; j<4; j++)
{
loc = vect(0,0,0);
loc.Z = 32.0 + 32.0 * j;
elec = Spawn(class'ElectricityEmitter',,, SP.Location + loc, rot(16384,0,0));
if (elec != None)
{
elec.LifeSpan = 1.0;
elec.randomAngle = 32768.0;
}
}

// play a sound
SP.PlaySound(sound'Spark1', SLOT_None, 2.0,, 2048.0, 2.0);

// spawn the actual monster
pawn = Spawn(spawnData[i].spawnClass, None, spawnData[i].Tag, SP.Location, SP.Rotation);
if (pawn != None)
{
pawn.InitializePawn();
pawn.SetOrders('Patrolling', spawnData[i].orderTag);
pawn.ChangeAlly('Player', -1, True);
pawn.ChangeAlly('MJ12', 0, True);
spawnData[i].lastKilledTime = -1;
}
}
}

// reset the count for the next pass
spawnData[i].count = 0;
}

// play datalinks when devices are frobbed
if (!flags.GetBool('MS_DL_Played'))
{
count = 0;

if (flags.GetBool('Node1_Frobbed'))
count++;
if (flags.GetBool('Node2_Frobbed'))
count++;
if (flags.GetBool('Node3_Frobbed'))
count++;
if (flags.GetBool('Node4_Frobbed'))
count++;

if ((count == 1) && (!flags.GetBool('DL_Blue1_Played')))
Player.StartDataLinkTransmission("DL_Blue1");
else if ((count == 2) && (!flags.GetBool('DL_Blue2_Played')))
Player.StartDataLinkTransmission("DL_Blue2");
else if ((count == 3) && (!flags.GetBool('DL_Blue3_Played')))
Player.StartDataLinkTransmission("DL_Blue3");
else if ((count == 4) && (!flags.GetBool('DL_Blue4_Played')))
{
Player.StartDataLinkTransmission("DL_Blue4");
flags.SetBool('MS_DL_Played', True,, 16);
}
}

// spawn a bunch of explosions when page is dead
if (flags.GetBool('killpage') &&
!flags.GetBool('MS_PageExploding'))
{
foreach AllActors(class'BobPageAugmented', tempPage)
page = tempPage;

pageTimer = Level.TimeSeconds;
flags.SetBool('MS_PageExploding', True,, 16);
}

if (flags.GetBool('MS_PageExploding'))
{
if (Level.TimeSeconds - pageTimer >= 3.0)
PageExplosionEffects();

if ((Level.TimeSeconds - pageTimer >= 6.0) && !flags.GetBool('MS_PageDestroyed'))
{
foreach AllActors(class'DeusExMover', M, 'platform_pieces')
M.BlowItUp(Player);
foreach AllActors(class'LifeSupportBase', base)
base.Destroy();

if (page != None)
{
page.Destroy();
page = None;
}

flags.SetBool('MS_PageDestroyed', True,, 16);
}

if (Level.TimeSeconds - pageTimer >= 9.0)
{
foreach AllActors(class'Actor', A, 'start_endgame')
A.Trigger(Self, None);
}
}
}




MissionEndgame.uc (extends MissionScript)

var byte savedSoundVolume;
var float endgameDelays[3];
var float endgameTimer;
var localized string endgameQuote[6];
var HUDMissionStartTextDisplay quoteDisplay;
var bool bQuotePrinted;
endgameDelays(0)=13.000000
endgameDelays(1)=13.500000
endgameDelays(2)=10.500000
endgameQuote(0)="YESTERDAY WE OBEYED KINGS AND BENT OUR NECKS BEFORE EMPERORS. BUT TODAY WE KNEEL ONLY TO TRUTH..."
endgameQuote(1)=" -- KAHLIL GIBRAN"
endgameQuote(2)="IF THERE WERE NO GOD, IT WOULD BE NECESSARY TO INVENT HIM."
endgameQuote(3)=" -- VOLTAIRE"
endgameQuote(4)="BETTER TO REIGN IN HELL, THAN SERVE IN HEAVEN."
endgameQuote(5)=" -- PARADISE LOST, JOHN MILTON"

ExplosionEffects


local float size;
local int i;
local Vector loc, endloc, HitLocation, HitNormal;
local Actor HitActor;
local MetalFragment frag;


if (FRand() < 0.8)
{
// pick a random explosion size and modify everything accordingly
size = FRand();

// play a sound
if (size < 0.5)
Player.PlaySound(Sound'LargeExplosion1', SLOT_None, 2.0,, 16384);
else
Player.PlaySound(Sound'LargeExplosion2', SLOT_None, 2.0,, 16384);

// have random metal fragments fall from the ceiling
if (FRand() < 0.8)
{
for (i=0; i {
loc = Player.Location + 512.0 * VRand();
loc.Z = Player.Location.Z;
endloc = loc;
endloc.Z += 1024.0;
HitActor = Trace(HitLocation, HitNormal, endloc, loc, False);
if (HitActor == None)
HitLocation = endloc;

// spawn some explosion effects
if (size < 0.5)
Spawn(class'ExplosionMedium',,, HitLocation+8*HitNormal);
else
Spawn(class'ExplosionLarge',,, HitLocation+8*HitNormal);

if (FRand() < 0.5)
{
frag = Spawn(class'MetalFragment',,, HitLocation);
if (frag != None)
{
frag.CalcVelocity(vect(20000,0,0),256);
frag.DrawScale = 0.5 + 2.0 * FRand();
if (FRand() < 0.75)
frag.bSmoking = True;
}
}
}
}
}

FinishCinematic


local CameraPoint cPoint;


if (quoteDisplay != None)
{
quoteDisplay.Destroy();
quoteDisplay = None;
}

// Loop through all the CameraPoints and set the "nextPoint"
// to None will will effectively cause them to halt.
// This prevents the screen from fading while the credits are rolling.

foreach player.AllActors(class'CameraPoint', cPoint)
cPoint.nextPoint = None;

flags.SetBool('EndgameExplosions', False);
SetTimer(0, False);
Player.ShowCredits(True);

FirstFrame


Super.FirstFrame();

endgameTimer = 0.0;

if (Player != None)
{
// Make sure all the flags are deleted.
DeusExRootWindow(Player.rootWindow).ResetFlags();

// Start the conversation
if (localURL == "ENDGAME1")
Player.StartConversationByName('Endgame1', Player, False, True);
else if (localURL == "ENDGAME2")
Player.StartConversationByName('Endgame2', Player, False, True);
else if (localURL == "ENDGAME3")
Player.StartConversationByName('Endgame3', Player, False, True);

// turn down the sound so we can hear the speech
savedSoundVolume = SoundVolume;
SoundVolume = 32;
Player.SetInstantSoundVolume(SoundVolume);
}

InitStateMachine


Super.InitStateMachine();

// Destroy all flags!
if (flags != None)
flags.DeleteAllFlags();

// Set the PlayerTraveling flag (always want it set for
// the intro and endgames)
flags.SetBool('PlayerTraveling', True, True, 0);

PreTravel


// restore the sound volume
SoundVolume = savedSoundVolume;
Player.SetInstantSoundVolume(SoundVolume);

Super.PreTravel();

PrintEndgameQuote (int num)


local int i;
local DeusExRootWindow root;


bQuotePrinted = True;
flags.SetBool('EndgameExplosions', False);

root = DeusExRootWindow(Player.rootWindow);
if (root != None)
{
quoteDisplay = HUDMissionStartTextDisplay(root.NewChild(Class'HUDMissionStartTextDisplay', True));
if (quoteDisplay != None)
{
quoteDisplay.displayTime = endgameDelays[num];
quoteDisplay.SetWindowAlignments(HALIGN_Center, VALIGN_Center);

for (i=0; i<2; i++)
quoteDisplay.AddMessage(endgameQuote[2*num+i]);

quoteDisplay.StartMessage();
}
}

Timer


Super.Timer();

if (flags.GetBool('EndgameExplosions'))
ExplosionEffects();

// After the conversation finishes playing, print a quote, delay a
// bit, then scroll the credits and then return to the DXOnly map
if (flags.GetBool('Endgame1_Played'))
{
if (!bQuotePrinted)
PrintEndgameQuote(0);

endgameTimer += checkTime;

if (endgameTimer > endgameDelays[0])
FinishCinematic();
}
else if (flags.GetBool('Endgame2_Played'))
{
if (!bQuotePrinted)
PrintEndgameQuote(1);

endgameTimer += checkTime;

if (endgameTimer > endgameDelays[1])
FinishCinematic();
}
else if (flags.GetBool('Endgame3_Played'))
{
if (!bQuotePrinted)
PrintEndgameQuote(2);

endgameTimer += checkTime;

if (endgameTimer > endgameDelays[2])
FinishCinematic();
}




MissionIntro.uc (extends MissionScript)

var byte savedSoundVolume;

FirstFrame


local BobPage bob;


Super.FirstFrame();

if (player != None)
{
// Make sure all the flags are deleted.
DeusExRootWindow(Player.rootWindow).ResetFlags();

// Find our buddy Bob, because he has the conversation!
foreach AllActors(class'BobPage', bob)
break;

if (bob != None)
{
// Start the conversation
player.StartConversationByName('Intro', bob, False, True);
}

// turn down the sound so we can hear the speech
savedSoundVolume = SoundVolume;
SoundVolume = 32;
Player.SetInstantSoundVolume(SoundVolume);
}

InitStateMachine


Super.InitStateMachine();

// Destroy all flags!
if (flags != None)
flags.DeleteAllFlags();

// Set the PlayerTraveling flag (always want it set for
// the intro and endgames)
flags.SetBool('PlayerTraveling', True, True, 0);

PreTravel


// restore the sound volume
SoundVolume = savedSoundVolume;
Player.SetInstantSoundVolume(SoundVolume);

Super.PreTravel();

Timer


Super.Timer();

// After the Intro conversation is over, tell the player to go on
// to the next map (which will either be the main menu map or
// the first game mission if we're starting a new game.

if (flags.GetBool('Intro_Played'))
{
flags.SetBool('Intro_Played', False,, 1);
player.PostIntro();
}




MissionScript.uc (extends Info)

var float checkTime;
var DeusExPlayer Player;
var FlagBase flags;
var string localURL;
var DeusExLevelInfo dxInfo;
checkTime=1.000000
localURL="NOTHING"

FirstFrame


local name flagName;
local ScriptedPawn P;
local int i;


flags.DeleteFlag('PlayerTraveling', FLAG_Bool);

// Check to see which NPCs should be dead from prevous missions
foreach AllActors(class'ScriptedPawn', P)
{
if (P.bImportant)
{
flagName = Player.rootWindow.StringToName(P.BindName$"_Dead");
if (flags.GetBool(flagName))
P.Destroy();
}
}

// print the mission startup text only once per map
flagName = Player.rootWindow.StringToName("M"$Caps(dxInfo.mapName)$"_StartupText");
if (!flags.GetBool(flagName) && (dxInfo.startupMessage[0] != ""))
{
for (i=0; i DeusExRootWindow(Player.rootWindow).hud.startDisplay.AddMessage(dxInfo.startupMessage[i]);
DeusExRootWindow(Player.rootWindow).hud.startDisplay.StartMessage();
flags.SetBool(flagName, True);
}

flagName = Player.rootWindow.StringToName("M"$dxInfo.MissionNumber$"MissionStart");
if (!flags.GetBool(flagName))
{
// Remove completed Primary goals and all Secondary goals
Player.ResetGoals();

// Remove any Conversation History.
Player.ResetConversationHistory();

// Set this flag so we only get in here once per mission.
flags.SetBool(flagName, True);
}

GetPatrolPoint (Name patrolTag, optional bool bRandom) -> PatrolPoint


local PatrolPoint aPoint;


aPoint = None;

foreach AllActors(class'PatrolPoint', aPoint, patrolTag)
{
if (bRandom && (FRand() < 0.5))
break;
else
break;
}

return aPoint;

GetSpawnPoint (Name spawnTag, optional bool bRandom) -> SpawnPoint


local SpawnPoint aPoint;


aPoint = None;

foreach AllActors(class'SpawnPoint', aPoint, spawnTag)
{
if (bRandom && (FRand() < 0.5))
break;
else
break;
}

return aPoint;

InitStateMachine


local DeusExLevelInfo info;


Player = DeusExPlayer(GetPlayerPawn());

foreach AllActors(class'DeusExLevelInfo', info)
dxInfo = info;

if (Player != None)
{
flags = Player.FlagBase;

// Get the mission number by extracting it from the
// DeusExLevelInfo and then delete any expired flags.
//
// Also set the default mission expiration so flags
// expire in the next mission unless explicitly set
// differently when the flag is created.

if (flags != None)
{
// Don't delete expired flags if we just loaded
// a savegame
if (flags.GetBool('PlayerTraveling'))
flags.DeleteExpiredFlags(dxInfo.MissionNumber);

flags.SetDefaultExpiration(dxInfo.MissionNumber + 1);

localURL = Caps(dxInfo.mapName);

log("**** InitStateMachine() -"@player@"started mission state machine for"@localURL);
}
else
{
log("**** InitStateMachine() - flagBase not set - mission state machine NOT initialized!");
}
}
else
{
log("**** InitStateMachine() - player not set - mission state machine NOT initialized!");
}

PostPostBeginPlay


// start the script
SetTimer(checkTime, True);

PreTravel


// turn off the timer
SetTimer(0, False);

// zero the flags so FirstFrame() gets executed at load
flags = None;

Timer


// make sure our flags are initialized correctly
if (flags == None)
{
InitStateMachine();

// Don't want to do this if the user just loaded a savegame
if ((player != None) && (flags.GetBool('PlayerTraveling')))
FirstFrame();
}




Moon.uc (extends OutdoorThings)

bStatic=False
Physics=PHYS_Rotating
Mesh=LodMesh'DeusExDeco.Moon'
DrawScale=0.100000
CollisionRadius=8.000000
CollisionHeight=8.000000
bCollideActors=False
bCollideWorld=False
bFixedRotationDir=True
Mass=10.000000
Buoyancy=5.000000
RotationRate=(Yaw=-128)



MorganEverett.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.MorganEverettCarcass'
WalkingSpeed=0.296000
bImportant=True
walkAnimMult=0.750000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MorganEverettTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex6'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MorganEverettTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MorganEverettTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="MorganEverett"
FamiliarName="Morgan Everett"
UnfamiliarName="Morgan Everett"



MorganEverettCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MorganEverettTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PantsTex6'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MorganEverettTex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MorganEverettTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



MoverCollider.uc (extends Keypoint)

var() name moverTag;
bStatic=False
bCollideActors=True

BeginPlay


local Mover M;


Super.BeginPlay();

if (moverTag != '')
foreach AllActors(class'Mover', M, moverTag)
{
SetBase(M);
SetPhysics(PHYS_None);
}




MoverHighlight.uc (extends Effects)

bHidden=True
DrawType=DT_Mesh
Style=STY_Translucent
Mesh=LodMesh'DeusExItems.FlatFX'



MovingWindow.uc (extends Window)

var Window winToShow;
var Int startPosX;
var Int startPosY;
var Int endPosX; // Final position
var Int endPosY;
var Int curPosX;
var Int curPosY;
var Float lastMoveX;
var Float lastMoveY;
var Int moveRate; // Pixel move rate / sec.
moveRate=1000

CalculateMovement (out Int curPos, out Float lastMoveTime, Int StartPos, Int endPos)


local Float pixelsToMove;


pixelsToMove = moveRate * lastMoveTime;

if (pixelsToMove > 1)
{
if (endPos < startPos)
curPos = Max(curPos - Int(pixelsToMove), endPos);
else
curPos = Min(curPos + Int(pixelsToMove), endPos);

// lastMoveTime = (pixelsToMove - Int(PixelsToMove)) * moveRate;
lastMoveTime = 0;
}

InitWindow


Super.InitWindow();

SetBackgroundStyle(DSTY_Masked);

Hide();

MoveFinished


if (winToShow != None)
winToShow.Show();

Destroy();

SetImage (Texture anImage, int imageSizeX, int imageSizeY)


SetBackground(anImage);
SetSize(imageSizeX, imageSizeY);

SetMoveRate (Int newMoveRate)


moveRate = newMoveRate;

SetWindowToShow (window aNewWindowToShow)


winToShow = aNewWindowToShow;

if (winToShow != None)
winToShow.Hide();

StartMove


bTickEnabled = True;

curPosX = startPosX;
curPosY = startPosY;

SetPos(curPosX, curPosY);

Show();

Tick (float deltaTime)


/*
log("Tick()-----------------------------------------------");
log(" lastMoveX = " $ lastMoveX);
log(" lastMoveY = " $ lastMoveY);
log(" curPosX = " $ curPosX);
log(" curPosY = " $ curPosY);
log(" startPosX = " $ startPosX);
log(" startPosY = " $ startPosY);
log(" endPosX = " $ endPosX);
log(" endPosY = " $ endPosY);
log(" deltaTime = " $ deltaTime);
*/
lastMoveX += deltaTime;
lastMoveY += deltaTime;

// Look at the current location, end location and
// move rate and calculate what the new position should be.

CalculateMovement(curPosX, lastMoveX, startPosX, endPosX);
CalculateMovement(curPosY, lastMoveY, startPosY, endPosY);

SetPos(curPosX, curPosY);
/*
log(" ---");
log(" lastMoveX = " $ lastMoveX);
log(" lastMoveY = " $ lastMoveY);
log(" curPosX = " $ curPosX);
log(" curPosY = " $ curPosY);
*/
// If we're at the final resting place, end this.
if ((curPosX == endPosX) && (curPosY == endPosY))
MoveFinished();





Mpunatco.uc (extends Human)

CarcassType=Class'DeusEx.UNATCOTroopCarcass'
JumpSound=Sound'DeusExSounds.Player.MaleJump'
HitSound1=Sound'DeusExSounds.Player.MalePainSmall'
HitSound2=Sound'DeusExSounds.Player.MalePainMedium'
Land=Sound'DeusExSounds.Player.MaleLand'
Die=Sound'DeusExSounds.Player.MaleDeath'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'MPCharacters.mp_jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.UNATCOTroopTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.UNATCOTroopTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.UNATCOTroopTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'

TravelPostAccept


local DeusExLevelInfo info;


Super.TravelPostAccept();




MultiMover.uc (extends Mover)

var() int SeqKey1[4];
var() int SeqKey2[4];
var() int SeqKey3[4];
var() int SeqKey4[4];
var() float SeqTime1[4];
var() float SeqTime2[4];
var() float SeqTime3[4];
var() float SeqTime4[4];
var() bool bReverseKeyframes;
var bool bIsMoving;
var int LastSeq;
var int CurrentSeq;
var int i; // why can't I put this in the state?
SeqKey1(0)=-1
SeqKey1(1)=-1
SeqKey1(2)=-1
SeqKey1(3)=-1
SeqKey2(0)=-1
SeqKey2(1)=-1
SeqKey2(2)=-1
SeqKey2(3)=-1
SeqKey3(0)=-1
SeqKey3(1)=-1
SeqKey3(2)=-1
SeqKey3(3)=-1
SeqKey4(0)=-1
SeqKey4(1)=-1
SeqKey4(2)=-1
SeqKey4(3)=-1
bReverseKeyframes=True
LastSeq=-1
CurrentSeq=-1
InitialState=MultiMover

BeginPlay


Super.BeginPlay();
bIsMoving = False;
LastSeq = -1;
CurrentSeq = -1;

InterpolateEnd (actor Other)

SeqKeys (int seq, int which) -> int


switch (seq)
{
case 0: return SeqKey1[which];
case 1: return SeqKey2[which];
case 2: return SeqKey3[which];
case 3: return SeqKey4[which];
}

return -1;

SeqTimes (int seq, int which) -> float


switch (seq)
{
case 0: return SeqTime1[which];
case 1: return SeqTime2[which];
case 2: return SeqTime3[which];
case 3: return SeqTime4[which];
}

return -1;

SetSeq (int seqnum)


if (bIsMoving)
return;

if (CurrentSeq != seqnum)
{
LastSeq = CurrentSeq;
CurrentSeq = seqnum;
GotoState('MultiMover', 'Close');
}




MultiplayerMessageWin.uc (extends DeusExBaseWindow)

var String killerName;
var String killerMethod;
var bool bKilledSelf;
var bool bValidMethod;
var localized String KilledByString, WereKilledString;
var localized String KilledYourselfString;
var localized String FireToContinueMsg;
var localized String ActiveAugsString;
var localized String WeaponString;
var localized String RelevantSkillString;
var localized String LevelString;
var localized String FinalBlowString;
var localized String ToTheString;
var localized String RemHealthString;
var localized String RemHealth2String;
var localized String RemEnergyString;
var localized String RemEnergy2String;
var localized String HealthHeadString;
var localized String HealthMidString;
var localized String HealthLowString;
var localized String StreakString;
var localized String Detail1String;
var localized String Detail2String;
var localized String KeyNotBoundString;
var localized String VSString;
var Color redColor, blueColor, whiteColor, greenColor, BrightRedColor;
var bool bDestroy;
var bool bKilled;
var bool bDisplayProgress;
var float lockoutTime;
var String curDetailKeyName;
KilledByString="You have been killed by "
WereKilledString="You have been killed."
KilledYourselfString="You killed yourself!"
FireToContinueMsg="Press to restart."
ActiveAugsString="Active Augs: "
WeaponString="Current Weapon: "
RelevantSkillString="Relevant Skill: "
LevelString="Skill Level: "
FinalBlowString="The final blow of "
ToTheString=" points of damage was delivered to your "
RemHealthString="At the time of your death, "
RemHealth2String=" had health: "
RemEnergyString=" and "
RemEnergy2String=" points of bio-energy left."
HealthHeadString=" Head: "
HealthMidString=" Mid-Section: "
HealthLowString=" Legs: "
StreakString=" now has a current streak of "
Detail1String="Press <"
Detail2String="> for details."
KeyNotBoundString="Key Not Bound"
VSString="VS"
RedColor=(R=128)
blueColor=(B=255)
WhiteColor=(R=255,G=255,B=255)
GreenColor=(G=255)
BrightRedColor=(R=255)

DestroyWindow


root.ShowCursor( True );
Player.ProgressTimeout = Player.Level.TimeSeconds;
Player.bKillerProfile = False;
lockoutTime = 0.0;
Super.DestroyWindow();

DrawWindow (GC gc)


local float w, h, cury, x, y;
local String str;
local bool bContinueMsg;


// Don't show if match has ended
if (( DeusExMPGame(Player.DXGame) != None ) && DeusExMPGame(Player.DXGame).bClientNewMap )
return;

if (bKilled)
{
if ( bKilledSelf )
{
// Killed self
gc.SetTextColor( RedColor );
gc.SetFont(Font'FontMenuExtraLarge');
str = KilledYourselfString;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( (width*0.5) - (w*0.5), msgY * height, w, h, str );
}
else if ( !bValidMethod )
{
// Unknown death
gc.SetTextColor( RedColor );
gc.SetFont(Font'FontMenuExtraLarge');
str = WereKilledString;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( (width*0.5) - (w*0.5), msgY * height, w, h, str );
}
else
{
// Killed by another
gc.SetTextColor( RedColor );
gc.SetFont(Font'FontMenuExtraLarge');
str = KilledByString $ killerName;
gc.GetTextExtent( 0, w, h, str );
cury = msgY * height;
gc.DrawText( (width*0.5) - (w*0.5), cury, w, h, str );
cury += h;
str = killerMethod;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( (width*0.5) - (w*0.5), cury, w, h, str );
}
if ( Player.Level.Timeseconds > lockoutTime )
{
gc.SetTextColor( whiteColor );
gc.SetFont(Font'FontMenuTitle');
gc.GetTextExtent( 0, w, h, FireToContinueMsg );
x = (width * 0.5) - (w * 0.5);
y = height * 0.88;
gc.DrawText( x, y, w, h, FireToContinueMsg );
if ( !Player.bKillerProfile && Player.killProfile.bValid && (!Player.killProfile.bKilledSelf))
{
y += h;
str = Detail1String $ curDetailKeyName $ Detail2String;
gc.GetTextExtent( 0, w, h, str );
x = (width * 0.5) - (w * 0.5);
gc.DrawText( x, y, w, h, str );
}
}
}
else if ((bDisplayProgress))
{
gc.SetTextColor( BlueColor );
gc.SetFont(Font'FontMenuExtraLarge');

str = Player.ProgressMessage[0];
gc.GetTextExtent( 0, w, h, str );
cury = msgY * height;
gc.DrawText( (width*0.5) - (w*0.5), cury, w, h, str );
cury += h;

str = Player.ProgressMessage[1];
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( (width*0.5) - (w*0.5), cury, w, h, str );
}
if ( Player.bKillerProfile && Player.killProfile.bValid && (!Player.killProfile.bKilledSelf) )
ShowKillerProfile( gc );

Super.DrawWindow(gc);

InitWindow


local int i;
local String KeyName, Alias;


Super.InitWindow();
bDestroy = False;
SetWindowAlignments(HALIGN_Full, VALIGN_Full);
Show();
root.ShowCursor( False );
lockoutTime = Player.Level.Timeseconds + 3.0;
Player.bKillerProfile = False;
curDetailKeyName="";
for ( i=0; i<255; i++ )
{
KeyName = player.ConsoleCommand ( "KEYNAME "$i );
if ( KeyName != "" )
{
Alias = player.ConsoleCommand( "KEYBINDING "$KeyName );
if ( Alias ~= "KillerProfile" )
{
curDetailKeyName = KeyName;
break;
}
}
}
if ( curDetailKeyName ~= "" )
curDetailKeyName=KeyNotBoundString;

MouseButtonReleased (float pointX, float pointY, EInputKey button, int numClicks) -> bool


if ( Player.Level.Timeseconds < lockoutTime )
return True;

if ( ( button == IK_LeftMouse ) || ( button == IK_RightMouse ) )
{
if ( !bDestroy )
{
bDestroy = True;
player.Fire(0);
root.PopWindow();
}
}
return True;

ShowKillerProfile (GC gc)


local float w, h, x, y, w2, oldy, barLen, by, by2;
local String str;
local int i;
local KillerProfile kp;


kp = Player.killProfile;

if ( kp.bValid )
{
gc.SetTextColor( whiteColor );
gc.SetFont(Font'FontMenuSmall_DS');
y = kpStartY * height;
str = FinalBlowString $ kp.damage $ ToTheString $ kp.bodyLoc $ ".";
gc.GetTextExtent(0,w,h,str);
gc.DrawText( width*0.5 - w*0.5, y, w, h, str );
y += h;
str = RemHealthString $ kp.name $ RemHealth2String $ HealthHeadString $ kp.healthHigh $ HealthMidString $ kp.healthMid $ HealthLowString $ kp.healthLow $ RemEnergyString $ kp.remainingBio $ RemEnergy2String;
gc.GetTextExtent(0,w,h,str);
gc.DrawText( width*0.5 - w*0.5, y, w, h, str );
y += h;
str = kp.name $ StreakString $ kp.streak $ ".";
gc.GetTextExtent(0,w,h,str);
gc.DrawText( width*0.5 - w*0.5, y, w, h, str );
y += (2.0*h);

// Enemey profile
gc.SetTextColor( BrightRedColor );
x = kpColumn1X * width;
oldy = y;
str = kp.name;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( x, y, w, h, str );
y += h;
barLen = width * 0.2;
gc.SetTileColor( BrightRedColor );
gc.DrawBox( x, y, barLen, 1, 0, 0, 1, Texture'Solid');
y += (0.25*h);
str = WeaponString $ kp.activeWeapon;
gc.GetTextExtent(0,w,h,str);
gc.DrawText( x, y, w, h, str );
y += h;
str = RelevantSkillString $ kp.activeSkill;
gc.GetTextExtent(0,w,h,str);
gc.DrawText( x, y, w, h, str );
y += h;
str = LevelString $ kp.activeSkillLevel;
gc.GetTextExtent(0,w,h,str);
gc.DrawText( x, y, w, h, str );
y += h;
str = ActiveAugsString $ kp.numActiveAugs;
gc.GetTextExtent(0,w2,h,str);
gc.DrawText( x, y, w2, h, str );
y += h;
for ( i = 0; i < kp.numActiveAugs; i++ )
{
gc.GetTextExtent( 0, w, h, kp.activeAugs[i] );
gc.DrawText( x+(w2*0.25), y, w, h, kp.activeAugs[i] );
y += h;
}
by = y;
// Your profile
y = oldy;
x = kpColumn2X * width;
gc.SetTileColor( greenColor );
gc.SetTextColor( greenColor );
str = Player.PlayerReplicationInfo.PlayerName;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( x, y, w, h, str );
y += h;
barLen = width * 0.2;
gc.DrawBox( x, y, barLen, 1, 0, 0, 1, Texture'Solid');
y += (0.25*h);
str = WeaponString $ kp.myActiveWeapon;
gc.GetTextExtent(0,w,h,str);
gc.DrawText( x, y, w, h, str );
y += h;
str = RelevantSkillString $ kp.myActiveSkill;
gc.GetTextExtent(0,w,h,str);
gc.DrawText( x, y, w, h, str );
y += h;
str = LevelString $ kp.myActiveSkillLevel;
gc.GetTextExtent(0,w,h,str);
gc.DrawText( x, y, w, h, str );
y += h;
str = ActiveAugsString $ kp.myNumActiveAugs;
gc.GetTextExtent(0,w2,h,str);
gc.DrawText( x, y, w2, h, str );
y += h;
for ( i = 0; i < kp.myNumActiveAugs; i++ )
{
gc.GetTextExtent( 0, w, h, kp.myActiveAugs[i] );
gc.DrawText( x+(w2*0.25), y, w, h, kp.myActiveAugs[i] );
y += h;
}
by2 = y;

if ( by2 > y )
y = ((by2 - oldy)*0.4) + oldy;
else
y = ((by - oldy)*0.4) + oldy;
str = VSString;
gc.SetFont(Font'FontMenuTitle');
gc.SetTextColor( whiteColor );
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( 0.5*width-w*0.5, y, w, h, str );
}

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;
local String KeyName, Alias;


bKeyHandled = False;

if ((key == IK_F10) && (bDisplayProgress))
{
Player.ConsoleCommand("CANCEL");
return True;
}

// Let them send chat messages
KeyName = player.ConsoleCommand("KEYNAME "$key );
Alias = player.ConsoleCommand( "KEYBINDING "$KeyName );

if ( Alias ~= "Talk" )
Player.Player.Console.Talk();
else if ( Alias ~= "TeamTalk" )
Player.Player.Console.TeamTalk();

if ( Player.Level.Timeseconds < lockoutTime )
return True;

if ( Alias ~= "KillerProfile" )
{
Player.bKillerProfile = True;
return True;
}
else
return Super.VirtualKeyPressed(key, bRepeat);




Multitool.uc (extends SkilledTool)

UseSound=Sound'DeusExSounds.Generic.MultitoolUse'
maxCopies=20
bCanHaveMultipleCopies=True
ItemName="Multitool"
PlayerViewOffset=(X=20.000000,Y=10.000000,Z=-16.000000)
PlayerViewMesh=LodMesh'DeusExItems.MultitoolPOV'
PickupViewMesh=LodMesh'DeusExItems.Multitool'
ThirdPersonMesh=LodMesh'DeusExItems.Multitool3rd'
LandSound=Sound'DeusExSounds.Generic.PlasticHit2'
Icon=Texture'DeusExUI.Icons.BeltIconMultitool'
largeIcon=Texture'DeusExUI.Icons.LargeIconMultitool'
largeIconWidth=28
largeIconHeight=46
Description="A disposable electronics tool. By using electromagnetic resonance detection and frequency modulation to dynamically alter the flow of current through a circuit, skilled agents can use the multitool to manipulate code locks, cameras, autogun turrets, alarms, or other security systems."
beltDescription="MULTITOOL"
Mesh=LodMesh'DeusExItems.Multitool'
CollisionRadius=4.800000
CollisionHeight=0.860000
Mass=20.000000
Buoyancy=10.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
MaxCopies = 5;


TestMPBeltSpot (int BeltSpot) -> bool


return (BeltSpot == 8);




Mutt.uc (extends Dog)

CarcassType=Class'DeusEx.MuttCarcass'
WalkingSpeed=0.200000
GroundSpeed=250.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
HitSound1=Sound'DeusExSounds.Animal.DogSmallGrowl'
HitSound2=Sound'DeusExSounds.Animal.DogSmallBark1'
Die=Sound'DeusExSounds.Animal.DogSmallDie'
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Mutt'
CollisionRadius=38.000000
CollisionHeight=26.000000
Mass=20.000000
BindName="Mutt"
FamiliarName="Dog"
UnfamiliarName="Dog"

PlayDogBark


if (FRand() < 0.5)
PlaySound(sound'DogSmallBark2', SLOT_None);
else
PlaySound(sound'DogSmallBark3', SLOT_None);




MuttCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.MuttCarcass'
Mesh3=LodMesh'DeusExCharacters.MuttCarcass'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.MuttCarcass'
CollisionRadius=30.000000



MuzzleFlash.uc (extends Effects)

bNetOptional=True
LifeSpan=0.100000
LightType=LT_Steady
LightEffect=LE_NonIncidence
LightBrightness=255
LightHue=28
LightSaturation=160
LightRadius=3

PostNetBeginPlay


Super.PostNetBeginPlay();
if (Level.NetMode != NM_Standalone)
LightRadius = 6;

PreBeginPlay


Super.PreBeginPlay();
if (Level.NetMode != NM_Standalone)
LightRadius = 6;




NYEagleStatue.uc (extends NewYorkDecoration)

bInvincible=True
bPushable=False
bStatic=True
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.NYEagleStatue'
CollisionRadius=119.750000
CollisionHeight=125.959999
Mass=2000.000000
Buoyancy=500.000000



NYLiberty.uc (extends NewYorkDecoration)

bInvincible=True
bPushable=False
bStatic=True
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.NYLiberty'
CollisionRadius=550.000000
CollisionHeight=1144.000000
Mass=40000.000000
Buoyancy=1000.000000



NYLibertyTop.uc (extends NewYorkDecoration)

bInvincible=True
bPushable=False
bStatic=True
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.NYLibertyTop'
CollisionRadius=500.000000
CollisionHeight=390.000000
Mass=10000.000000
Buoyancy=1000.000000



NYLibertyTorch.uc (extends NewYorkDecoration)

bInvincible=True
bPushable=False
bStatic=True
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.NYLibertyTorch'
CollisionRadius=101.910004
CollisionHeight=114.500000
Mass=2000.000000
Buoyancy=500.000000



NYPoliceBoat.uc (extends Vehicles)

bFloating=True
ItemName="Police Boat"
Texture=Texture'DeusExItems.Skins.ReflectionMapTex1'
Mesh=LodMesh'DeusExDeco.NYPoliceBoat'
SoundRadius=64
SoundVolume=192
AmbientSound=Sound'Ambient.Ambient.BoatLargeIdle'
CollisionRadius=314.000000
CollisionHeight=122.000000
Mass=4000.000000
Buoyancy=5000.000000
BindName="BoatPilot"
UnfamiliarName="UNATCO Boat Pilot"



NanoKey.uc (extends DeusExPickup)

var() name KeyID; // unique FName identifier used for movers and such
var() ESkinColor SkinColor;
ItemName="NanoKey"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.NanoKey'
PickupViewMesh=LodMesh'DeusExItems.NanoKey'
ThirdPersonMesh=LodMesh'DeusExItems.NanoKey'
Icon=Texture'DeusExUI.Icons.BeltIconNanoKey'
Description="NO KEY DESCRIPTION - REPORT THIS AS A BUG!"
beltDescription="NANO"
Mesh=LodMesh'DeusExItems.NanoKey'
CollisionRadius=2.050000
CollisionHeight=3.110000
Mass=1.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Level1: MultiSkins[0] = Texture'NanoKeyTex1'; break;
case SC_Level2: MultiSkins[0] = Texture'NanoKeyTex2'; break;
case SC_Level3: MultiSkins[0] = Texture'NanoKeyTex3'; break;
case SC_Level4: MultiSkins[0] = Texture'NanoKeyTex4'; break;
}

GiveTo (pawn Other)


local DeusExPlayer player;


if (Other.IsA('DeusExPlayer'))
{
player = DeusExPlayer(Other);
player.PickupNanoKey(Self);
Destroy();
}
else
{
Super.GiveTo(Other);
}

HandlePickupQuery (inventory Item) -> bool


local DeusExPlayer player;


if ( Item.Class == Class )
{
player = DeusExPlayer(Owner);
player.PickupNanoKey(NanoKey(item));
item.Destroy();

return True;
}

return Super.HandlePickupQuery(Item);




NanoKeyInfo.uc (extends Object)

var travel Name KeyID; // Key Name
var travel String Description; // Key Description
var travel NanoKeyInfo NextKey; // Next NanoKeyInfo Object



NanoKeyRing.uc (extends SkilledTool)

var localized string NoKeys;
var localized string KeysAvailableLabel;
NoKeys="No Nano Keys Available!"
KeysAvailableLabel="Nano Keys Available:"
UseSound=Sound'DeusExSounds.Generic.KeysRattling'
bDisplayableInv=False
ItemName="Nanokey Ring"
ItemArticle="the"
PlayerViewOffset=(X=16.000000,Y=15.000000,Z=-16.000000)
PlayerViewMesh=LodMesh'DeusExItems.NanoKeyRingPOV'
PickupViewMesh=LodMesh'DeusExItems.NanoKeyRing'
ThirdPersonMesh=LodMesh'DeusExItems.NanoKeyRing'
Icon=Texture'DeusExUI.Icons.BeltIconNanoKeyRing'
largeIcon=Texture'DeusExUI.Icons.LargeIconNanoKeyRing'
largeIconWidth=47
largeIconHeight=44
Description="A nanokey ring can read and store the two-dimensional molecular patterns from different nanokeys, and then recreate those patterns on demand."
beltDescription="KEY RING"
bHidden=True
Mesh=LodMesh'DeusExItems.NanoKeyRing'
CollisionRadius=5.510000
CollisionHeight=4.690000
Mass=10.000000
Buoyancy=5.000000

ClientRemoveAllKeys


RemoveAllKeys();

GetKeyCount -> int


local int keyCount;
local NanoKeyInfo aKey;


if (GetPlayer() != None)
{
aKey = GetPlayer().KeyList;

// Loop through all the keys and see if one exists
while(aKey != None)
{
keyCount++;
aKey = aKey.NextKey;
}
}

return keyCount;

GetPlayer -> DeusExPlayer


return DeusExPlayer(Owner);

GiveClientKey (Name newKeyID, String newDescription)


GiveKey(newKeyID, newDescription);

GiveKey (Name newKeyID, String newDescription)


local NanoKeyInfo aKey;


if (GetPlayer() != None)
{
// First check to see if the player already has this key
if (HasKey(newKeyID))
return;

// Spawn a key
aKey = GetPlayer().CreateNanoKeyInfo();

// Set the appropriate fields and
// add to the beginning of our list
aKey.KeyID = newKeyID;
aKey.Description = newDescription;
aKey.NextKey = GetPlayer().KeyList;
GetPlayer().KeyList = aKey;

}

HasKey (Name KeyToLookFor) -> bool


local NanoKeyInfo aKey;
local Bool bHasKey;


bHasKey = False;

if (GetPlayer() != None)
{
aKey = GetPlayer().KeyList;

// Loop through all the keys and see if one exists
while(aKey != None)
{
if (aKey.KeyID == KeyToLookFor)
{
bHasKey = True;
break;
}

aKey = aKey.NextKey;
}
}
return bHasKey;

PutDown

RemoveAllKeys


local NanoKeyInfo aKey;
local NanoKeyInfo deadKey;


if (GetPlayer() != None)
{
aKey = GetPlayer().KeyList;

// Loop through all the keys and see if one exists
while(aKey != None)
{
deadKey = aKey;

CriticalDelete(aKey);
aKey = None;

aKey = deadKey.NextKey;
}

GetPlayer().KeyList = None;
}

RemoveClientKey (Name KeyToRemove)


RemoveKey(KeyToRemove);

RemoveKey (Name KeyToRemove)


local NanoKeyInfo aKey;
local NanoKeyInfo lastKey;


if (GetPlayer() != None)
{
aKey = GetPlayer().KeyList;

// Loop through all the keys and see if one exists
while(aKey != None)
{
if (aKey.KeyID == KeyToRemove)
{
if (lastKey != None)
lastKey.NextKey = aKey.NextKey;

if (GetPlayer().KeyList == aKey)
GetPlayer().KeyList = aKey.NextKey;

CriticalDelete(aKey);
aKey = None;

break;
}

lastKey = aKey;
aKey = aKey.NextKey;
}
}

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;
local NanoKeyInfo keyInfo;
local int keyCount;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.SetTitle(itemName);
winInfo.SetText(KeysAvailableLabel);
winInfo.AddLine();

if (GetPlayer() != None)
{
keyInfo = GetPlayer().KeyList;

if (keyInfo != None)
{
while(keyInfo != None)
{
winInfo.SetText(" " $ keyInfo.Description);
keyInfo = keyInfo.NextKey;
keyCount++;
}
}
}

if (keyCount > 0)
{
winInfo.AddLine();
winInfo.SetText(Description);
}
else
{
winInfo.Clear();
winInfo.SetTitle(itemName);
winInfo.SetText(NoKeys);
}

return True;




NanoVirusGrenade.uc (extends ThrownProjectile)

fuseLength=3.000000
proxRadius=128.000000
AISoundLevel=0.100000
bBlood=False
bDebris=False
DamageType=NanoVirus
spawnWeaponClass=Class'DeusEx.WeaponNanoVirusGrenade'
ItemName="Scramble Grenade"
speed=1000.000000
MaxSpeed=1000.000000
Damage=100.000000
MomentumTransfer=50000
ImpactSound=Sound'DeusExSounds.Weapons.NanoVirusGrenadeExplode'
LifeSpan=0.000000
Mesh=LodMesh'DeusExItems.NanoVirusGrenadePickup'
CollisionRadius=2.630000
CollisionHeight=4.410000
Mass=5.000000
Buoyancy=2.000000

DrawExplosionEffects (vector HitLocation, vector HitNormal)


local ExplosionLight light;
local int i;
local Rotator rot;
local SphereEffect sphere;
local ExplosionSmall expeffect;


// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, HitLocation);
if (light != None)
{
if (!bDamaged)
light.RemoteRole = ROLE_None;
light.size = 8;
light.LightHue = 128;
light.LightSaturation = 96;
light.LightEffect = LE_Shell;
}

expeffect = Spawn(class'ExplosionSmall',,, HitLocation);
if ((expeffect != None) && (!bDamaged))
expeffect.RemoteRole = ROLE_None;

// draw a cool light sphere
sphere = Spawn(class'SphereEffect',,, HitLocation);
if (sphere != None)
{
if (!bDamaged)
sphere.RemoteRole = ROLE_None;
sphere.size = blastRadius / 32.0;
}




NathanMadison.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.NathanMadisonCarcass'
WalkingSpeed=0.213333
bImportant=True
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.NathanMadisonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.NathanMadisonTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.NathanMadisonTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.NathanMadisonTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.NathanMadisonTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="NathanMadison"
FamiliarName="Nathan Madison"
UnfamiliarName="Nathan Madison"



NathanMadisonCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.NathanMadisonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.NathanMadisonTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.NathanMadisonTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.NathanMadisonTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.NathanMadisonTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



NetworkTerminal.uc (extends DeusExBaseWindow)

var ComputerUIWindow winComputer; // Currently active computer screen
var ComputerScreenHack winHack; // Ice Breaker Hack Window
var ShadowWindow winHackShadow;
var ComputerScreenHackAccounts winHackAccounts; // Hack Accounts Window, used for email
var ShadowWindow winHackAccountsShadow;
var ElectronicDevices compOwner; // what computer owns this window?
var Class FirstScreen; // First screen to push
var float loginTime; // time that the user logged in
var float detectionTime; // total time a user may be logged on
var int kickTimerID; // timer ID for kicking the user off
var int skillLevel; // player's computer skill level (0-3)
var bool bHacked; // this computer has been hacked
var bool bNoHack; // this computer has been purposely not hacked
var bool bUsesHackWindow; // True if Hack Window created by default.
var string userName;
var int userIndex;
var int shadowOffsetX;
var int shadowOffsetY;
detectionTime=15.000000
kickTimerID=-1
bUsesHackWindow=True
shadowOffsetX=15
shadowOffsetY=15
ScreenType=ST_Computer

AreSpecialOptionsAvailable (optional bool bCheckActivated) -> bool


local int i;
local bool bOK;


bOK = False;
for (i=0; i {
if (Computers(compOwner).specialOptions[i].Text != "")
{
if ((Computers(compOwner).specialOptions[i].userName == "") || (Caps(Computers(compOwner).specialOptions[i].userName) == userName))
{
// Also check if the "bCheckActivated" bool is set, in which case we also
// want to make sure the item hasn't already been triggered.

if (!((bCheckActivated) && (Computers(compOwner).specialOptions[i].bAlreadyTriggered)))
{
bOK = True;
break;
}
}
}
}

return bOK;

ChangeAccount (int newUserIndex)


userIndex = newUserIndex;

if (compOwner != None)
userName = Computers(compOwner).GetUserName(userIndex);

// Notify the computer window
if (winComputer != None)
winComputer.ChangeAccount();

CloseHackAccountsWindow


if (winHackAccounts != None)
{
winHackAccounts.Destroy();
winHackAccounts = None;

winHackAccountsShadow.Destroy();
winHackAccountsShadow = None;
}

CloseHackWindow


if (winHack != None)
{
winHack.Destroy();
winHack = None;

winHackShadow.Destroy();
winHackShadow = None;
}

CloseScreen (String action)


// First destroy the current screen
if (winComputer != None)
{
winComputer.Destroy();
winComputer = None;
}

// Based on the action, proceed!

if (action == "EXIT")
{
if (Computers(compOwner) != None)
player.CloseComputerScreen(Computers(compOwner));
root.PopWindow();
return;
}

// If the user is logging in and bypassing the Hack screen,
// then destroy the Hack window

if ((action == "LOGIN") && (winHack != None) && (!bHacked))
{
CloseHackWindow();
bNoHack = True;
}

ComputerHacked


bHacked = True;

// Use the first login
userIndex = 0;

if (compOwner.IsA('Computers'))
userName = Computers(compOwner).GetUserName(userIndex);

CloseScreen("LOGIN");

ConfigurationChanged


local float hackWidth, hackHeight;
local float hackAccountsWidth, hackAccountsHeight;
local float compWidth, compHeight;
local float compX;


// First look for the hack window. If it's not visible, then
// our work here is done!

if (winHack != None)
{
winHack.QueryPreferredSize(hackWidth, hackHeight);

// Shove in upper-right hand corner
winHack.ConfigureChild(
width - hackWidth, 0,
hackWidth, hackHeight);

// Place shadow
winHackShadow.ConfigureChild(
width - hackWidth + winHack.backgroundPosX - shadowOffsetX,
winHack.backgroundPosY - shadowOffsetY,
winHack.backgroundWidth + (shadowOffsetX * 2),
winHack.backgroundHeight + (shadowOffsetY * 2));
}

// Check for the Hack Accounts window, which is displayed
// underneath the Hack window. Position under the Hack Window

if (winHackAccounts != None)
{
winHackAccounts.QueryPreferredSize(hackAccountsWidth, hackAccountsHeight);
winHackAccounts.ConfigureChild(
width - hackAccountsWidth, hackHeight + 20,
hackAccountsWidth, hackAccountsHeight);

// Place shadow
winHackAccountsShadow.ConfigureChild(
width - hackAccountsWidth + winHackAccounts.backgroundPosX - shadowOffsetX,
hackHeight + 20 + winHackAccounts.backgroundPosY - shadowOffsetY,
winHackAccounts.backgroundWidth + (shadowOffsetX * 2),
winHackAccounts.backgroundHeight + (shadowOffsetY * 2));
}

// Now check to see if we have a computer screen. If so,
// center it in relation to the hack window. Don't force
// position if the window has been dragged somewhere else
// by the user.

if ((winComputer != None) && (!winComputer.bWindowDragged))
{
winComputer.QueryPreferredSize(compWidth, compHeight);

// Center the window, but move it left if the height of the
// hack window would infringe on the window (unless the
// "bAlwaysCenter" flag is set)

if (((hackHeight + hackAccountsHeight + 20) > ((height / 2) - (compHeight / 2))) &&
(!winComputer.bAlwaysCenter))
{
compX = (width - hackWidth) / 2 - (compWidth / 2);
}
else
{
compX = (width / 2) - (compWidth / 2);
}

winComputer.ConfigureChild(
compX, (height / 2) - (compHeight / 2),
compWidth, compHeight);
}

CreateHackAccountsWindow


if ((bHacked) && (winHackAccounts == None) && (Computers(compOwner).NumUsers() > 1))
{
// First create the shadow window
winHackAccountsShadow = ShadowWindow(NewChild(Class'ShadowWindow'));

winHackAccounts = ComputerScreenHackAccounts(NewChild(Class'ComputerScreenHackAccounts'));
winHackAccounts.SetNetworkTerminal(Self);
winHackAccounts.SetCompOwner(compOwner);
winHackAccounts.AskParentForReconfigure();
}

CreateHackWindow


local Float hackTime;
local Float skillLevelValue;


skillLevelValue = player.SkillSystem.GetSkillLevelValue(class'SkillComputer');
skillLevel = player.SkillSystem.GetSkillLevel(class'SkillComputer');

// Check to see if the player is skilled in Hacking before
// creating the window
if ((skillLevel > 0) && (bUsesHackWindow))
{
// Base the detection and hack time on the skill level
hackTime = detectionTime / (skillLevelValue * 1.5);
detectionTime *= skillLevelValue;

// First create the shadow window
winHackShadow = ShadowWindow(NewChild(Class'ShadowWindow'));

winHack = ComputerScreenHack(NewChild(Class'ComputerScreenHack'));
winHack.SetNetworkTerminal(Self);
winHack.SetDetectionTime(detectionTime, hackTime);
}

DestroyWindow


if ((compOwner.IsA('Computers')) && (compOwner != None))
{
if (Player != Player.GetPlayerPawn())
{
log("==============>Player mismatch!!!!");
}
// Keep track of the last time this computer was hacked
else if (player.ActiveComputer == CompOwner)
{
if (bHacked)
player.SetComputerHackTime(Computers(compOwner),player.level.TimeSeconds, player.level.TimeSeconds);
player.CloseComputerScreen(Computers(compOwner));
player.ActiveComputer = None;
}

Computers(compOwner).termWindow = None;
}
else if (compOwner.IsA('ATM'))
{
// Keep track of the last time this computer was hacked
if (bHacked)
ATM(compOwner).lastHackTime = player.Level.TimeSeconds;

ATM(compOwner).atmWindow = None;
}

// Show the HUD again
root.ShowHUD(True);

// Now finish destroy us.
Super.DestroyWindow();

ForceCloseScreen


// If a screen is active, tell it to exit
if (winComputer != None)
winComputer.CloseScreen(winComputer.escapeAction);

GetSkillLevel -> int


return skillLevel;

GetUserIndex -> int


return userIndex;

GetUserName -> String


return userName;

HackDetected (optional bool bDamageOnly)


if (compOwner.IsA('Computers'))
{
Computers(compOwner).bLockedOut = True;
Computers(compOwner).lockoutTime = player.Level.TimeSeconds;
}
else
{
ATM(compOwner).bLockedOut = True;
ATM(compOwner).lockoutTime = player.Level.TimeSeconds;
}

// Shock the crap out of the player (drain BE and play a sound)
// Highly skilled players take less damage
// DEUS_EX AMSD In multiplayer, don't damage.
if (Player.Level.NetMode == NM_Standalone)
{
player.TakeDamage(200 - 50 * skillLevel, None, vect(0,0,0), vect(0,0,0), 'EMP');
PlaySound(sound'ProdFire');
}
else
{
player.PunishDetection(200 - 50 * skillLevel);
PlaySound(sound'ProdFire');
}

if (!bDamageOnly)
CloseScreen("EXIT");

InitWindow


Super.InitWindow();

SetWindowAlignments(HALIGN_Full, VALIGN_Full);

// Draw a black background for now
SetBackgroundStyle(DSTY_Normal);
SetBackground(Texture'Solid');
SetTileColorRGB(0, 0, 0);

SetMouseFocusMode(MFOCUS_Click);

root.ShowHUD(False);

CreateHackWindow();

bTickEnabled = True;

SetCompOwner (ElectronicDevices newCompOwner)


compOwner = newCompOwner;

if (winComputer != None)
winComputer.SetCompOwner(compOwner);

// Update the hack bar detection time
UpdateHackDetectionTime();

SetHackButtonToReturn


if ((bHacked) && (winHack != None))
winHack.SetHackButtonToReturn();

SetLoginInfo (String newUserName, Int newUserIndex)


userName = newUserName;
userIndex = newUserIndex;

SetSkillLevel (int newSkillLevel)


skillLevel = newSkillLevel;

ShowFirstScreen


ShowScreen(FirstScreen);

ShowScreen (Class newScreen)


// First close any existing screen
if (winComputer != None)
{
winComputer.Destroy();
winComputer = None;
}

// Now invoke the new screen
if (newScreen != None)
{
winComputer = ComputerUIWindow(NewChild(newScreen));
winComputer.SetWindowAlignments(HALIGN_Center, VALIGN_Center);
winComputer.SetNetworkTerminal(Self);
winComputer.SetCompOwner(compOwner);
winComputer.Lower();
}

Tick (float deltaTime)


if ((player != None) && (player.IsInState('Dying')))
{
bTickEnabled = False;
CloseScreen("EXIT");
}
else
{
// DEUS_EX AMSD Put this in an else. Don't do this if you are dead and have
// closed the screen!
// Update the hack bar detection time
UpdateHackDetectionTime();
}

UpdateHackDetectionTime


local Float diff;
local Float detectionTime;


// If the hack window is active, then we need to update
// the detection time
if ((winHack != None) && (!winhack.bHacking) && (compOwner != None) && (!bHacked))
{
detectionTime = winHack.GetSaveDetectionTime();

if (compOwner.IsA('Computers'))
{
diff = player.Level.TimeSeconds - Computers(compOwner).lastHackTime;
}
else
diff = player.Level.TimeSeconds - ATM(compOwner).lastHackTime;

if (diff < detectionTime)
winHack.UpdateDetectionTime(diff + 0.5);
}

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local String KeyName, Alias;
local bool bKeyHandled;


bKeyHandled = False;

if ( Player.Level.NetMode != NM_Standalone )
{
// Let them send chat messages while hacking
KeyName = player.ConsoleCommand("KEYNAME "$key );
Alias = player.ConsoleCommand( "KEYBINDING "$KeyName );

if ( Alias ~= "Talk" )
{
log("===>trying to talk..." );
Player.Player.Console.Talk();
bKeyHandled = True;
}
else if ( Alias ~= "TeamTalk" )
{
log("===>trying to teamtalk..." );
Player.Player.Console.TeamTalk();
bKeyHandled = True;
}
}

if ( bKeyHandled )
return True;
else
return Super.VirtualKeyPressed(key, bRepeat);




NetworkTerminalATM.uc (extends NetworkTerminal)

FirstScreen=Class'DeusEx.ComputerScreenATM'

CloseScreen (String action)


Super.CloseScreen(action);

// Based on the action, proceed!
if (action == "LOGOUT")
{
// If we're hacked into the computer, then exit completely.
if (bHacked)
CloseScreen("EXIT");
else
ShowScreen(FirstScreen);
}
else if (action == "LOGIN")
{
ShowScreen(Class'ComputerScreenATMWithdraw');
}
else if (action == "ATMDISABLED")
{
ShowScreen(Class'ComputerScreenATMDisabled');
}




NetworkTerminalPersonal.uc (extends NetworkTerminal)

FirstScreen=Class'DeusEx.ComputerScreenLogin'

CloseScreen (String action)


Super.CloseScreen(action);

// Based on the action, proceed!
if (action == "LOGOUT")
{
// If we're hacked into the computer, then exit completely.
if (bHacked)
CloseScreen("EXIT");
else
ShowScreen(FirstScreen);
}
else if (action == "LOGIN")
{
// Check to see if there are any "special options" the player
// has not yet invoked, in which case we want to jump straight
// to the special options screen (oh boy, "special" cases!)
if (AreSpecialOptionsAvailable(True))
ShowScreen(Class'ComputerScreenSpecialOptions');
else
ShowScreen(Class'ComputerScreenEmail');
}
else if ((action == "EMAIL") || (action == "RETURN"))
{
ShowScreen(Class'ComputerScreenEmail');
}
else if (action == "SPECIAL")
{
ShowScreen(Class'ComputerScreenSpecialOptions');
}




NetworkTerminalPublic.uc (extends NetworkTerminal)

FirstScreen=Class'DeusEx.ComputerScreenBulletins'
bUsesHackWindow=False

CloseScreen (String action)


Super.CloseScreen(action);

// Based on the action, proceed!
if (action == "LOGOUT")
Super.CloseScreen("EXIT");




NetworkTerminalSecurity.uc (extends NetworkTerminal)

FirstScreen=Class'DeusEx.ComputerScreenLogin'

CloseScreen (String action)


Super.CloseScreen(action);

// Based on the action, proceed!
if (action == "LOGOUT")
{
// If we're hacked into the computer, then exit completely.
if (bHacked)
CloseScreen("EXIT");
else
ShowScreen(FirstScreen);
}
else if (action == "LOGIN")
{
// Check to see if there are any "special options" the player
// has not yet invoked, in which case we want to jump straight
// to the special options screen (oh boy, "special" cases!)
if (AreSpecialOptionsAvailable(True))
ShowScreen(Class'ComputerScreenSpecialOptions');
else
ShowScreen(Class'ComputerScreenSecurity');
}
else if (action == "RETURN")
{
ShowScreen(Class'ComputerScreenSecurity');
}
else if (action == "SPECIAL")
{
ShowScreen(Class'ComputerScreenSpecialOptions');
}




NewYorkDecoration.uc (extends DeusExDecoration)

bHighlight=False



Newspaper.uc (extends InformationDevices)

bCanBeBase=True
ItemName="Newspaper"
Mesh=LodMesh'DeusExDeco.Newspaper'
CollisionRadius=18.000000
CollisionHeight=1.550000
Mass=4.000000
Buoyancy=5.000000



NewspaperOpen.uc (extends InformationDevices)

bCanBeBase=True
ItemName="Newspaper"
Mesh=LodMesh'DeusExDeco.NewspaperOpen'
CollisionRadius=26.000000
CollisionHeight=1.630000
Mass=4.000000
Buoyancy=5.000000



NicoletteDuClare.uc (extends HumanThug)

CarcassType=Class'DeusEx.NicoletteDuClareCarcass'
WalkingSpeed=0.320000
bImportant=True
BaseAssHeight=-18.000000
walkAnimMult=1.460000
bIsFemale=True
GroundSpeed=280.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_Dress'
MultiSkins(0)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex3'
MultiSkins(2)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex0'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex0'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="NicoletteDuClare"
FamiliarName="Nicolette DuClare"
UnfamiliarName="Nicolette DuClare"



NicoletteDuClareCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_Dress_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_Dress_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_Dress_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex3'
MultiSkins(2)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex0'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.NicoletteDuClareTex0'



Nurse.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.NurseCarcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.NurseTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.NurseTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.NurseTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.NurseTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.NurseTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Nurse"
FamiliarName="Nurse"
UnfamiliarName="Nurse"



NurseCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.NurseTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.NurseTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.NurseTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.NurseTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.NurseTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



OfficeChair.uc (extends Seat)

var() ESkinColor SkinColor;
sitPoint(0)=(X=0.000000,Y=-4.000000,Z=0.000000)
ItemName="Swivel Chair"
Mesh=LodMesh'DeusExDeco.OfficeChair'
CollisionRadius=16.000000
CollisionHeight=25.549999
Mass=30.000000
Buoyancy=5.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_GrayLeather: Skin = Texture'OfficeChairTex1'; break;
case SC_BrownLeather: Skin = Texture'OfficeChairTex2'; break;
case SC_BrownCloth: Skin = Texture'OfficeChairTex3'; break;
case SC_GrayCloth: Skin = Texture'OfficeChairTex4'; break;
}




OrdersTrigger.uc (extends Trigger)

var() name Orders;
var() name ordersTag;
bTriggerOnceOnly=True
CollisionRadius=96.000000

StartPatrolling -> bool


local ScriptedPawn P;


// find the target NPC to start on the patrol route
if (Event != '')
foreach AllActors (class'ScriptedPawn', P, Event)
P.SetOrders(Orders, ordersTag, True);

return True;

Touch (Actor Other)


if (!IsRelevant(Other))
return;

if (StartPatrolling())
if (bTriggerOnceOnly)
Destroy();

Trigger (Actor Other, Pawn Instigator)


if (StartPatrolling())
{
Super.Trigger(Other, Instigator);
if (bTriggerOnceOnly)
Destroy();
}




OutdoorThings.uc (extends DeusExDecoration)

bInvincible=True
bHighlight=False
bPushable=False
bStatic=True
Physics=PHYS_None
bAlwaysRelevant=True



POVCorpse.uc (extends DeusExPickup)

var travel String carcClassString;
var travel String KillerBindName;
var travel Name KillerAlliance;
var travel Name Alliance;
var travel bool bNotDead;
var travel bool bEmitCarcass;
var travel int CumulativeDamage;
var travel int MaxDamage;
var travel string CorpseItemName;
var travel Name CarcassName;
MaxDamage=10
bDisplayableInv=False
ItemName="body"
PlayerViewOffset=(X=20.000000,Y=12.000000,Z=-5.000000)
PlayerViewMesh=LodMesh'DeusExItems.POVCorpse'
PickupViewMesh=LodMesh'DeusExItems.TestBox'
LandSound=Sound'DeusExSounds.Generic.FleshHit1'
Mesh=LodMesh'DeusExItems.TestBox'
CollisionRadius=1.000000
CollisionHeight=1.000000
Mass=40.000000
Buoyancy=30.000000



Pan1.uc (extends DeusExDecoration)

bCanBeBase=True
ItemName="Frying Pan"
Mesh=LodMesh'DeusExDeco.Pan1'
CollisionRadius=14.500000
CollisionHeight=1.600000
Mass=20.000000
Buoyancy=5.000000



Pan2.uc (extends DeusExDecoration)

bCanBeBase=True
ItemName="Pot"
Mesh=LodMesh'DeusExDeco.Pan2'
CollisionRadius=12.040000
CollisionHeight=4.060000
Mass=20.000000
Buoyancy=5.000000



Pan3.uc (extends DeusExDecoration)

bCanBeBase=True
ItemName="Frying Pan"
Mesh=LodMesh'DeusExDeco.Pan3'
CollisionRadius=7.460000
CollisionHeight=1.910000
Mass=20.000000
Buoyancy=5.000000



Pan4.uc (extends DeusExDecoration)

bCanBeBase=True
ItemName="Pot"
Mesh=LodMesh'DeusExDeco.Pan4'
CollisionRadius=11.790000
CollisionHeight=6.750000
Mass=20.000000
Buoyancy=5.000000



PaperFragment.uc (extends DeusExFragment)

Fragments(0)=LodMesh'DeusExItems.PaperFragment1'
Fragments(1)=LodMesh'DeusExItems.PaperFragment2'
Fragments(2)=LodMesh'DeusExItems.PaperFragment3'
numFragmentTypes=3
elasticity=0.250000
ImpactSound=Sound'DeusExSounds.Generic.PaperHit1'
MiscSound=Sound'DeusExSounds.Generic.PaperHit2'
Mesh=LodMesh'DeusExItems.PaperFragment1'
CollisionRadius=6.000000
CollisionHeight=0.000000
Mass=2.000000
Buoyancy=3.000000



ParticleGenerator.uc (extends Effects)

var() float frequency; // what's the chance of spewing a particle every checkTime seconds
var() float riseRate; // how fast do the particles rise
var() float ejectSpeed; // how fast do the particles get ejected
var() texture particleTexture; // replacement texture to use (default is smoke)
var() float particleLifeSpan; // how long each particle lives
var() float particleDrawScale; // draw scale for each particle
var() bool bParticlesUnlit; // is each particle unlit?
var() bool bScale; // scale each particle as it rises?
var() bool bFade; // fade each particle as it rises?
var() bool bTriggered; // start by triggering?
var() float spewTime; // how long do I spew after I am triggered?
var() bool bRandomEject; // random eject velocity vector
var() float checkTime; // how often should I spit out particles?
var() bool bTranslucent; // are these particles translucent?
var() bool bGravity; // are these particles affected by gravity?
var() sound spawnSound; // sound to play when spawned
var() bool bAmbientSound; // play the ambient sound?
var() int numPerSpawn; // number of particles to spawn per puff
var() name attachTag; // attach us to this actor
var() bool bInitiallyOn; // if triggered, start on instead of off
var bool bSpewing; // am I spewing?
var bool bFrozen; // are we out of the player's sight?
var float time;
var bool bDying; // don't spew, but continue to update
var() bool bModulated; // are these particles modulated?
var vector pLoc; // Location used for replication, ParticleIterator uses these now
var rotator pRot; // Rotation used for replication, ParticleIterator uses these now
var ParticleProxy proxy;
Frequency=1.000000
RiseRate=10.000000
ejectSpeed=10.000000
particleLifeSpan=4.000000
particleDrawScale=0.100000
bParticlesUnlit=True
bScale=True
bFade=True
checkTime=0.100000
bTranslucent=True
numPerSpawn=1
bInitiallyOn=True
bSpewing=True
bDirectional=True
DrawType=DT_Sprite
Texture=Texture'Engine.S_Inventory'
CollisionRadius=80.000000
CollisionHeight=80.000000
RenderIteratorClass=Class'DeusEx.ParticleIterator'

DelayedDestroy


bDying = True;
SetBase(None);
SetTimer(1.0, True);

Destroyed


if (proxy != None)
{
proxy.Destroy();
proxy = None;
}
Super.Destroyed();

PostBeginPlay


local Actor A;


Super.PostBeginPlay();

DrawType = DT_None;

// create our proxy particle
if (proxy == None)
{
proxy = Spawn(class'ParticleProxy',,, Location, Rotation);
SetProxyData();
}

if (bTriggered && !bInitiallyOn)
{
bSpewing = False;
proxy.bHidden = True;
SoundVolume = 0;
}

// attach us to the actor that was tagged
if (attachTag != '')
foreach AllActors(class'Actor', A, attachTag)
if (A != None)
{
SetOwner(A);
SetBase(A);
}

pLoc = Location;
pRot = Rotation;

SetProxyData


if (proxy != None)
{
proxy.bUnlit = bParticlesUnlit;

if (bModulated)
proxy.Style = STY_Modulated;
else if (bTranslucent)
proxy.Style = STY_Translucent;
else
proxy.Style = STY_Masked;

if (particleTexture != None)
proxy.Texture = particleTexture;
}

Tick (float deltaTime)


local int i;


// Server updates these location and rotation proxies
if ( Role == ROLE_Authority )
{
pLoc = Location;
pRot = Rotation;
}

if (proxy != None)
{
// don't freeze if we're dying
if (bDying)
bFrozen = False;

// if we are close, say 20 feet
else if (proxy.DistanceFromPlayer < 320)
bFrozen = False;

// can the player see the generator?
else if (proxy.LastRendered() <= 2.0)
bFrozen = False;

// can the player see our base?
else if ((Base != None) && (Base != Level) && (Base.LastRendered() <= 2.0))
bFrozen = False;

else
bFrozen = True;
}
else
bFrozen = True;

// check LifeSpan and see if we need to DelayedDestroy()
if ((LifeSpan > 0) && (LifeSpan <= 1.0))
{
LifeSpan = 0;
DelayedDestroy();
}

// are we frozen
if (bFrozen)
return;

Super.Tick(deltaTime);

if (proxy != None)
if (proxy.Texture != particleTexture)
SetProxyData();

// tick the iterator since Objects don't Tick()
if (ParticleIterator(RenderInterface) != None)
ParticleIterator(RenderInterface).Update(deltaTime);

// don't spew anymore if we're dying
if (bDying || !bSpewing)
return;

// if the owner that I'm attached to is dead, kill me
if ((attachTag != '') && (Owner == None))
Destroy();

time += deltaTime;

if (time > checkTime)
{
time = 0;

if (FRand() <= frequency)
{
if (spawnSound != None)
PlaySound(spawnSound, SLOT_Misc,,, 1024);

for (i=0; i if (ParticleIterator(RenderInterface) != None)
ParticleIterator(RenderInterface).AddParticle();
}
}

Timer


if (ParticleIterator(RenderInterface) != None)
{
if (ParticleIterator(RenderInterface).IsListEmpty())
Destroy();
}
else // MB - We are most likely the server with no render interface, so kill it.
Destroy();

Trigger (Actor Other, Pawn EventInstigator)


Super.Trigger(Other, EventInstigator);

// if we are spewing, turn us off
if (bSpewing)
{
bSpewing = False;
proxy.bHidden = True;
if (bAmbientSound && (AmbientSound != None))
SoundVolume = 0;
}
else // otherwise, turn us on
{
bSpewing = True;
proxy.bHidden = False;
LifeSpan = spewTime;
if (bAmbientSound && (AmbientSound != None))
SoundVolume = 255;
}

UnTrigger (Actor Other, Pawn EventInstigator)


Super.UnTrigger(Other, EventInstigator);

// if we are spewing, turn us off
if (bSpewing)
{
bSpewing = False;
proxy.bHidden = True;
if (bAmbientSound && (AmbientSound != None))
SoundVolume = 0;
}




ParticleIterator.uc (extends RenderIterator)

var bool bActive;
var Vector initVel;
var Vector Velocity;
var Vector Location;
var float DrawScale;
var float ScaleGlow;
var float LifeSpan;
var sParticle Particles[64];
var int nextFreeParticle;
var Actor proxy; // used by the C++
var bool bOwnerUsesGravity;
var bool bOwnerScales;
var bool bOwnerFades;
var float OwnerZoneGravity;
var float OwnerRiseRate;
var float OwnerLifeSpan;
var float OwnerDrawScale;
MaxItems=64

AddParticle


local int i, lastFreeParticle;
local ParticleGenerator Owner;


Owner = ParticleGenerator(Outer);
if (Owner != None)
{
if (nextFreeParticle != -1)
{
Particles[nextFreeParticle].Velocity = Owner.ejectSpeed * vector(Owner.pRot);

if (Owner.bRandomEject)
Particles[nextFreeParticle].Velocity += 0.2 * Owner.ejectSpeed * VRand();

Particles[nextFreeParticle].Location = Owner.pLoc;
Particles[nextFreeParticle].initVel = Particles[nextFreeParticle].Velocity;
Particles[nextFreeParticle].DrawScale = Owner.particleDrawScale;
Particles[nextFreeParticle].LifeSpan = Owner.particleLifeSpan;
Particles[nextFreeParticle].bActive = True;

// get the next free particle in the list
lastFreeParticle = nextFreeParticle;
i = nextFreeParticle;
if (++i >= ArrayCount(Particles))
i = 0;
while (i != lastFreeParticle)
{
if (!Particles[i].bActive)
{
nextFreeParticle = i;
break;
}

if (++i >= ArrayCount(Particles))
i = 0;
}

// if we didn't find an empty one, set us to -1
if (lastFreeParticle == nextFreeParticle)
nextFreeParticle = -1;
}
}

DeleteParticle (int i)


if ((i >= 0) && (i < ArrayCount(Particles)))
if (Particles[i].bActive)
{
Particles[i].bActive = False;
nextFreeParticle = i;
}

Init (PlayerPawn Camera)


local ParticleGenerator Owner;


Owner = ParticleGenerator(Outer);
if (Owner != None)
{
proxy = Owner.proxy;
if (Owner.bFrozen)
MaxItems = 0;
else
MaxItems = 64;
}

IsListEmpty -> bool


local int i;


for (i=0; i if (Particles[i].bActive)
return False;

return True;

Update (float deltaTime)


local int i;
local ParticleGenerator Owner;
local bool bNoneActive;


Owner = ParticleGenerator(Outer);
if (Owner != None)
{
bNoneActive = True;

bOwnerUsesGravity = Owner.bGravity;
bOwnerScales = Owner.bScale;
bOwnerFades = Owner.bFade;

OwnerZoneGravity = Owner.Region.Zone.ZoneGravity.Z;
OwnerRiseRate = Owner.riseRate;
OwnerLifeSpan = Owner.particleLifeSpan;
OwnerDrawScale = Owner.particleDrawScale;

// DEUS_EX AMSD Moved to a native call to speed up.
UpdateParticles(deltaTime);
}

UpdateParticles (float DeltaTime) | native




ParticleProxy.uc (extends Effects)

RemoteRole=ROLE_None
DrawType=DT_Sprite
Style=STY_Translucent
Texture=Texture'Engine.S_Light'
DrawScale=0.100000
bCollideWorld=True



PaulDenton.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.PaulDentonCarcass'
WalkingSpeed=0.120000
bImportant=True
bInvincible=True
BaseAssHeight=-23.000000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponAssaultGun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponPlasmaRifle')
InitialInventory(3)=(Inventory=Class'DeusEx.AmmoPlasma')
InitialInventory(4)=(Inventory=Class'DeusEx.WeaponSword')
BurnPeriod=0.000000
bHasCloak=True
CloakThreshold=100
Health=200
HealthHead=200
HealthTorso=200
HealthLegLeft=200
HealthLegRight=200
HealthArmLeft=200
HealthArmRight=200
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.PaulDentonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PaulDentonTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PaulDentonTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.PaulDentonTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.PaulDentonTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="PaulDenton"
FamiliarName="Paul Denton"
UnfamiliarName="Paul Denton"

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

SetSkin (DeusExPlayer player)


if (player != None)
{
switch(player.PlayerSkin)
{
case 0: MultiSkins[0] = Texture'PaulDentonTex0';
MultiSkins[3] = Texture'PaulDentonTex0';
break;
case 1: MultiSkins[0] = Texture'PaulDentonTex4';
MultiSkins[3] = Texture'PaulDentonTex4';
break;
case 2: MultiSkins[0] = Texture'PaulDentonTex5';
MultiSkins[3] = Texture'PaulDentonTex5';
break;
case 3: MultiSkins[0] = Texture'PaulDentonTex6';
MultiSkins[3] = Texture'PaulDentonTex6';
break;
case 4: MultiSkins[0] = Texture'PaulDentonTex7';
MultiSkins[3] = Texture'PaulDentonTex7';
break;
}
}

ShieldDamage (name damageType) -> float


// handle special damage types
if ((damageType == 'Flamed') || (damageType == 'Burned') || (damageType == 'Stunned') ||
(damageType == 'KnockedOut'))
return 0.0;
else if ((damageType == 'TearGas') || (damageType == 'PoisonGas') || (damageType == 'HalonGas') ||
(damageType == 'Radiation') || (damageType == 'Shocked') || (damageType == 'Poison') ||
(damageType == 'PoisonEffect'))
return 0.1;
else
return Super.ShieldDamage(damageType);




PaulDentonCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.PaulDentonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PaulDentonTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PaulDentonTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.PaulDentonTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.PaulDentonTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000

PostPostBeginPlay


local DeusExPlayer player;


Super.PostPostBeginPlay();

foreach AllActors(class'DeusExPlayer', player)
break;

SetSkin(player);

SetSkin (DeusExPlayer player)


if (player != None)
{
switch(player.PlayerSkin)
{
case 0: MultiSkins[0] = Texture'PaulDentonTex0';
MultiSkins[3] = Texture'PaulDentonTex0';
break;
case 1: MultiSkins[0] = Texture'PaulDentonTex4';
MultiSkins[3] = Texture'PaulDentonTex4';
break;
case 2: MultiSkins[0] = Texture'PaulDentonTex5';
MultiSkins[3] = Texture'PaulDentonTex5';
break;
case 3: MultiSkins[0] = Texture'PaulDentonTex6';
MultiSkins[3] = Texture'PaulDentonTex6';
break;
case 4: MultiSkins[0] = Texture'PaulDentonTex7';
MultiSkins[3] = Texture'PaulDentonTex7';
break;
}
}




PawnGenerator.uc (extends Effects)

var() int Count;
var int CurCount;
var() Class PawnClass;
var bool bValid;
var ScriptedPawn Pawn;
var Class PawnClass;
var PawnTypes PawnClasses[8]; // All classes that will be generated
var() Name Orders; // Orders for generated pawns
var() Name OrderTag; // Order tag for generated pawns
var() Name Alliance; // Alliance for generated pawns
var() bool bGeneratorIsHome; // True if this generator should act as a home base
var() float PawnHomeExtent; // Extent of the home area; 0 means the extent is the same as the radius
var() float ActiveArea; // Maximum player distance from generator
var() float Radius; // Radius in which to spawn pawns
var() bool bTriggered; // True if this generator will be triggered
var() int MaxCount; // Maximum number of pawns in existence at any one time
var(Special) bool bPawnsTransient; // True if pawns should disappear when out of range
var(Special) bool bRandomCount; // If True, number of generated pawns will be random
var(Special) bool bRandomTypes; // If True, pawn classes will be randomized (with correct distribution)
var(Special) bool bRepopulate; // True if generator will spawn pawns forever
var bool bLOSCheck; // True if we should check LOS if pawns are transient (OBSOLESCENT!)
var(Special) float Focus; // 0=pawns will face random directions; 1=pawns will face
var int PawnCount; // Current number of pawns in existence
var int PoolCount; // Total number of pawns that will EVER be generated
var PawnData Pawns[32]; // All pawns currently in existence
var GeneratorScout Scout; // Scout pawn used to place pawns
var bool bActive; // True if this generator is active
var float TryTimer; // Timer used to generate pawns
var vector GroundLocation; // Starting point
var bool bDying; // True if no more pawns should be generated
var bool bScoutInit; // True if the scout has been initialized
var vector LastGenLocation; // Last location
var rotator LastGenRotation; // Last rotation
var vector SumVelocities; // Cumulative velocities of all pawns; used for flocking
var vector FlockCenter; // Rough average center point of a flock
var float VelocityTimer; // Timer for checking velocities
var vector RandomVelocity; // Random velocity for turns
var float TurnPeriod; // Amount of time to add a "turn" velocity
var float CoastPeriod; // Amount of time to coast without adding velocity
var float CoastTimer; // Timer for adding random velocities
var float StatusTimer; // Should we do a StatusUpdate this frame
PawnClasses(0)=(Count=1)
PawnClasses(1)=(Count=1)
PawnClasses(2)=(Count=1)
PawnClasses(3)=(Count=1)
PawnClasses(4)=(Count=1)
PawnClasses(5)=(Count=1)
PawnClasses(6)=(Count=1)
PawnClasses(7)=(Count=1)
Orders=Wandering
ActiveArea=2000.000000
Radius=600.000000
bLOSCheck=True
TurnPeriod=0.800000
CoastPeriod=8.000000
bHidden=True
bDirectional=True
DrawType=DT_Sprite
Texture=Texture'Engine.S_Inventory'
CollisionRadius=10.000000
CollisionHeight=6.000000

Burst (optional int count)


local int i;
local bool bProcess;


if (count == 0)
count = MaxCount-PawnCount;

// Spawn a scout for bursting
SpawnScout();

// Make sure we're not wasting our time
bStasis = true;
bProcess = !IsActorUnnecessary(self);
bStasis = false;

// If not, generate a bunch of pawns
if (bProcess)
for (i=0; i GeneratePawn(true);


CheckPawnStatus


local int i;
local int classNum;


// When the scout dies, so do we
if (!IsPawnValid(Scout))
{
Destroy();
return;
}

// Don't do any work if there are no pawns...
if (PawnCount > 0)
{
// Check every pawn in our care...
for (i=0; i {
if (Pawns[i].bValid)
{
if (!IsPawnValid(Pawns[i].Pawn, true)) // pawn has been destroyed
{
if (bRepopulate)
{
if (!bRandomTypes)
if (FindUsedPawnClass(Pawns[i].PawnClass, classNum))
PawnClasses[classNum].CurCount--;
}
InvalidatePawn(i);
}
else if (bPawnsTransient) // pawn is transient -- kill it?
{
if (IsActorUnnecessary(Pawns[i].Pawn) && !PlayerCanSeeActor(Pawns[i].Pawn, false))
{
if (!bRandomTypes)
if (FindUsedPawnClass(Pawns[i].PawnClass, classNum))
PawnClasses[classNum].CurCount--;
if (!bRepopulate)
PoolCount++;
Pawns[i].Pawn.Destroy();
InvalidatePawn(i);
}
}
}
}
}

ComputeGroundLocation


local actor HitActor;
local vector HitLocation, HitNormal;
local vector EndTrace;


// Look for the ground location of this generator
EndTrace = Location;
EndTrace.Z -= 200;
if (Trace(HitLocation, HitNormal, EndTrace, Location, false) != None)
GroundLocation = HitLocation;
else
{
GroundLocation = Location;
GroundLocation.Z -= CollisionHeight;
}


Destroyed


local int i;


// Destroy our scout pawn
if (IsPawnValid(Scout))
{
Scout.Destroy();
Scout = None;
}

// Destroy all our pawns
for (i=0; i {
if (Pawns[i].bValid)
{
if (IsPawnValid(Pawns[i].Pawn))
Pawns[i].Pawn.Destroy();
InvalidatePawn(i);
}
}

Super.Destroyed();


FindUsedPawnClass (Class PawnClass, out int classNum) -> bool


local int i;


// Find a pawn class that's been used
for (i=0; i if ((PawnClasses[i].PawnClass == PawnClass) && (PawnClasses[i].CurCount > 0))
break;
if (i < ArrayCount(PawnClasses))
{
classNum = i;
return true;
}
else
return false;

GenerateCoastPeriod -> float


// Overridden in subclasses
return (CoastPeriod);

GeneratePawn (optional bool bBurst)


local int classNum;
local float dist;
local vector startLocation;
local vector destination;
local vector HitLocation, HitNormal;
local ScriptedPawn spawnee;
local rotator randRot;
local bool bCanSee;
local bool bActorUnnecessary;
local bool bSuccess;
local int i;
local EPhysics newPhysics;
local Class entryActor;
local Sound entrySound;
local bool bSpawn;


bSuccess = false;
spawnee = None;

// No spawn for you!
if (bDying || (PawnCount >= MaxCount) || (PoolCount <= 0) || (Scout == None))
return;

// Pick a class...
if (PickRandomClass(classNum))
{
// Set up our center point...
newPhysics = GetClassPhysics(PawnClasses[classNum].PawnClass);
if (newPhysics == PHYS_Walking)
startLocation = GroundLocation+vect(0,0,1)*(PawnClasses[classNum].PawnClass.Default.CollisionHeight);
else
startLocation = Location;
bSpawn = false;

// Move the scout to the center point
Scout.bCollideWorld = false;
Scout.SetCollisionSize(5, 5);
Scout.SetLocation(startLocation);
Scout.SetCollisionSize(PawnClasses[classNum].PawnClass.Default.CollisionRadius,
PawnClasses[classNum].PawnClass.Default.CollisionHeight);
Scout.SetPhysics(newPhysics);
Scout.bCollideWorld = true;

// If this is business as usual, find a random location for the pawn...
if (!bBurst)
{
// Pick a random scout location
dist = sqrt(FRand())*Radius;
if (dist < PawnClasses[classNum].PawnClass.Default.CollisionRadius*2+1)
dist = PawnClasses[classNum].PawnClass.Default.CollisionRadius*2+1;
if (Scout.AIPickRandomDestination(0, dist, 0, 0, 0, 0, 2, 1.0, destination))
{
// Got a location, but can the player see it?
Scout.SetLocation(destination);
Scout.bHidden = false;
Scout.bDetectable = true;
bCanSee = PlayerCanSeeActor(Scout, true);
bActorUnnecessary = IsActorUnnecessary(Scout);
Scout.bHidden = true;
Scout.bDetectable = false;

// This is a good spot...
if (!bCanSee && !bActorUnnecessary)
bSpawn = true;
}
}

// Otherwise, just use the center point
else
{
destination = startLocation;
bSpawn = true;
}

// Do we have a good location?
if (bSpawn)
{
// Look for an open slot in our pawn list
for (i=0; i if (!Pawns[i].bValid)
break;
if (i < ArrayCount(Pawns))
{
// Finally, try spawning the actual pawn
randRot = RandomBiasedRotation(Rotation.Yaw, focus, Rotation.Pitch, focus);
if (newPhysics == PHYS_Walking)
randRot.Pitch = 0;
entryActor = Scout.FootRegion.Zone.EntryActor; // MAJOR hack!!!
entrySound = Scout.FootRegion.Zone.EntrySound;
Scout.FootRegion.Zone.EntryActor = None;
Scout.FootRegion.Zone.EntrySound = None;
spawnee = Spawn(PawnClasses[classNum].PawnClass, self, , destination, randRot);
Scout.FootRegion.Zone.EntryActor = entryActor;
Scout.FootRegion.Zone.EntrySound = entrySound;
if (spawnee != None)
{
// We are golden! Initialize the pawn and add it to our list
spawnee.InitializePawn();
spawnee.SetMovementPhysics();
spawnee.bTransient = false;
SetPawnHome(spawnee);
spawnee.SetAlliance(Alliance);
spawnee.SetOrders(Orders, OrderTag, true);
spawnee.SetLocation(destination);
bSuccess = true;
Pawns[i].bValid = true;
Pawns[i].Pawn = spawnee;
Pawns[i].PawnClass = PawnClasses[classNum].PawnClass;
PawnCount++;
if (!bRandomTypes)
PawnClasses[classNum].CurCount++;
if (!bRepopulate)
PoolCount--;
}
}
}
}

GenerateRandomVelocity -> vector


// Overridden in subclasses
return (vect(0,0,0));

GetClassPhysics (Class PawnClass) -> EPhysics


local EPhysics newPhysics;


newPhysics = PawnClass.Default.Physics;
if ((newPhysics == PHYS_None) || (newPhysics == PHYS_Falling))
newPhysics = PHYS_Walking;

return (newPhysics);

InvalidatePawn (int slot)


if (Pawns[slot].bValid)
{
Pawns[slot].bValid = false;
Pawns[slot].Pawn = None;
Pawns[slot].PawnClass = None;
PawnCount--;
}

IsActorUnnecessary (Actor testActor) -> bool


// Is this actor in a place we don't care about?
return (testActor.DistanceFromPlayer >= ActiveArea);

IsPawnValid (Pawn testPawn, optional bool bCheckHealth) -> bool


local bool bValid;


// Is this a valid pawn?
if (testPawn == None)
bValid = false;
else if (testPawn.bDeleteMe)
bValid = false;
else if (bCheckHealth && (testPawn.Health <= 0))
bValid = false;
else
bValid = true;

return (bValid);


PickRandomClass (out int classNum) -> bool


local int i;
local int count;
local int randNum;


// Count the number of class slots available
count = 0;
for (i=0; i if (PawnClasses[i].PawnClass != None)
count += (PawnClasses[i].Count - PawnClasses[i].CurCount);

// Randomly pick one of the slots; this scheme maintains class distribution
classNum = -1;
if (count > 0)
{
randNum = Rand(count) + 1;
for (i=0; i {
if (PawnClasses[i].PawnClass != None)
{
randNum -= (PawnClasses[i].Count - PawnClasses[i].CurCount);
if (randNum <= 0)
{
classNum = i;
break;
}
}
}
}

// Return True if we succeeded
if ((classNum < 0) || (classNum >= ArrayCount(PawnClasses)))
return false;
else
return true;

PlayerCanSeeActor (Actor testActor, bool bCreating) -> bool


local bool bCanSee;
local DeusExPlayer P;


// Return True if the player can see this actor
bCanSee = false;
if (bCreating)
{
//DEUS_EX AMSD In multiplayer, we really want, "Can any player see this actor?"
//So iterate over the actors.
//In single player, iter is slow, so just call GetPlayerPawn.
if (Level.NetMode != NM_Standalone)
{
foreach AllActors(class'DeusExPlayer',P)
{
if (P.AICanSee(testActor, 1.0, false, false, true, true) > 0.0)
bCanSee = true;
}
}
else
{
if (GetPlayerPawn().AICanSee(testActor, 1.0, false, false, true, true) > 0.0)
bCanSee = true;
}
}
else
{
if (testActor.LastRendered() <= 5.0)
bCanSee = true;
}

return (bCanSee);

PostBeginPlay


local int i;
local int count;


Super.PostBeginPlay();

// Make sure we have pawns to generate
count = 0;
for (i=0; i if ((PawnClasses[i].PawnClass != None) && (PawnClasses[i].Count > 0))
count += PawnClasses[i].Count;
if (count <= 0)
{
Destroy();
return;
}

// Check the maximum number of pawns in existence
if (MaxCount <= 0)
MaxCount = count;
else if (MaxCount >= ArrayCount(Pawns))
MaxCount = ArrayCount(Pawns);

// Compute random count
if (bRandomCount)
PoolCount = Rand(count) + 1;
else
PoolCount = count;

// Look for the ground location of this generator
ComputeGroundLocation();

// Initialize home base stuff
SetAllHome();

// Set up triggering
if (bTriggered)
bActive = False;
else
bActive = True;

// Set up timer
TryTimer = 0.25+FRand()*0.75;


SetAllHome


local int i;


for (i=0; i if ((Pawns[i].bValid) && (Pawns[i].Pawn != None))
SetPawnHome(Pawns[i].Pawn);

LastGenLocation = Location;
LastGenRotation = Rotation;

SetPawnHome (ScriptedPawn setPawn)


local float homeDist;
local vector homePos;
local EPhysics pawnPhysics;


if (bGeneratorIsHome && IsPawnValid(setPawn))
{
if (!bDying)
{
if (PawnHomeExtent > 0.0)
homeDist = PawnHomeExtent;
else
homeDist = Radius;
pawnPhysics = GetClassPhysics(setPawn.Class);
if (pawnPhysics == PHYS_Walking)
homePos = GroundLocation+vect(0,0,1)*CollisionHeight;
else
homePos = Location;
setPawn.SetHomeBase(homePos, Rotation, homeDist);
}
else
setPawn.ClearHomeBase();
}

SpawnScout -> bool


// Spawn a scout for pawn generation
if (!bScoutInit)
{
bScoutInit = true;

Scout = Spawn(Class'GeneratorScout', , , Location);
if (Scout != None)
{
Scout.SetCollision(false, false, false);
Scout.SetPhysics(PHYS_Flying);
Scout.Health = 100;
}
}

// Return TRUE if we have a scout
return (Scout != None);

StopGenerator


// Set the dying flag, and free all pawns to move away
if (!bDying)
{
bDying = True;
SetAllHome();
}

Tick (float deltaTime)


local Class PawnClass;


Super.Tick(deltaTime);

// Make sure we have a scout
if (!SpawnScout())
{
Destroy();
return;
}

// Destroy dead or transient pawns
StatusTimer += deltaTime;
if (StatusTimer > 1.0)
{
CheckPawnStatus();
StatusTimer = 0;
}

// If no pawns are left, and we're dying, destroy ourselves
if (bDying && (PawnCount <= 0))
{
Destroy();
return;
}

// Update cumulative velocities for flocking
if (PawnCount > 0) // don't bother doing this if we have no pawns
UpdateSumVelocities(deltaTime);

// Reset home base positions for all pawns if we've moved
if ((LastGenLocation != Location) || (LastGenRotation != Rotation))
{
ComputeGroundLocation();
SetAllHome();
}

// Should we try to generate new pawns?
if (bActive && !bDying)
{
if (TryTimer >= 0) // always go down
TryTimer -= deltaTime;
if (TryTimer < 0)
{
if (!IsActorUnnecessary(self))
{
GeneratePawn(); // actually generate a Pawn
TryTimer = 0.25;
}
else
TryTimer = 0;
}
}

Trigger (Actor Other, Pawn EventInstigator)



Super.Trigger(Other, EventInstigator);

// Make this puppy active
bActive = True;


UpdateSumVelocities (float deltaTime)


local int i;
local int count;
local float newCoastTimer;
local float checkPeriod;


checkPeriod = 0.5; // update every 1/2 second

VelocityTimer += deltaTime;
if (VelocityTimer >= checkPeriod)
{
SumVelocities = vect(0,0,0);
FlockCenter = vect(0,0,0);
count = 0;
for (i=0; i {
if ((Pawns[i].bValid) && (Pawns[i].Pawn != None))
{
count++;
SumVelocities += Pawns[i].Pawn.Velocity;
FlockCenter += Pawns[i].Pawn.Location;
}
}

if (count > 0)
FlockCenter /= count;
else
FlockCenter = Location;

newCoastTimer = CoastTimer - VelocityTimer;
if (newCoastTimer < -TurnPeriod) // start to coast
{
newCoastTimer = GenerateCoastPeriod();
RandomVelocity = vect(0,0,0);
}
else if ((CoastTimer >= 0) && (newCoastTimer < 0))
RandomVelocity = GenerateRandomVelocity();
CoastTimer = newCoastTimer;

SumVelocities += RandomVelocity;

VelocityTimer = 0;
}





PedestrianGenerator.uc (extends PawnGenerator)

PawnClasses(0)=(Count=10,PawnClass=Class'DeusEx.Female1')
PawnClasses(1)=(Count=10,PawnClass=Class'DeusEx.Female2')
PawnClasses(2)=(Count=10,PawnClass=Class'DeusEx.Female3')
PawnClasses(3)=(Count=10,PawnClass=Class'DeusEx.Female4')
PawnClasses(4)=(Count=10,PawnClass=Class'DeusEx.Male1')
PawnClasses(5)=(Count=10,PawnClass=Class'DeusEx.Male2')
PawnClasses(6)=(Count=10,PawnClass=Class'DeusEx.Male3')
PawnClasses(7)=(Count=10,PawnClass=Class'DeusEx.Male4')
Alliance=Pedestrian
bGeneratorIsHome=True
ActiveArea=1500.000000
Radius=800.000000
MaxCount=6
bPawnsTransient=True
bRandomTypes=True



PersonaActionButtonWindow.uc (extends PersonaBorderButtonWindow)

Left_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.PersonaActionButtonNormal_Left',Width=4)
Left_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.PersonaActionButtonPressed_Left',Width=4)
Right_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.PersonaActionButtonNormal_Right',Width=8)
Right_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.PersonaActionButtonPressed_Right',Width=8)
Center_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.PersonaActionButtonNormal_Center',Width=2)
Center_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.PersonaActionButtonPressed_Center',Width=2)
buttonHeight=16
minimumButtonWidth=20



PersonaAmmoDetailButton.uc (extends PersonaItemButton)

var Class ammo;
var Bool bDisabledByDefault;
var Bool bLoaded;
var Bool bHasIt;
var int rounds;
var Color colSelectionBorderHalf;
var localized String RoundLabel;
var localized String RoundsLabel;
bDisabledByDefault=True
colSelectionBorderHalf=(R=128,G=128,B=128)
RoundLabel="%d Round"
RoundsLabel="%d Rounds"
iconPosWidth=42
iconPosHeight=37
buttonWidth=44
buttonHeight=44
borderWidth=44
borderHeight=44
bIconTranslucent=False

DrawWindow (GC gc)


local String str, descStr;
local float strWidth, strHeight, strRoundsHeight;


// Draw background
if (bLoaded)
{
// Draw the background
gc.SetStyle(DSTY_Translucent);
gc.SetTileColor(colFillSelected);
gc.DrawPattern(1, 1, width - 2, height - 2, 0, 0, Texture'Solid');
}

// Draw icon
if (icon != None)
{
// Draw the icon
if (bIconTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

if (bHasIt)
gc.SetTileColor(colIcon);
else
gc.SetTileColor(colSelectionBorderHalf);

gc.DrawTexture(((borderWidth) / 2) - (iconPosWidth / 2),
((borderHeight) / 2) - (iconPosHeight / 2),
iconPosWidth, iconPosHeight,
0, 0,
icon);
}

// Draw border
if (!bSelected)
gc.SetTileColor(colSelectionBorderHalf);
else
gc.SetTileColor(colSelectionBorder);

gc.SetStyle(DSTY_Masked);
gc.DrawBorders(0, 0, borderWidth, borderHeight, 0, 0, 0, 0, texBorders);

// Draw the item name
descStr = ammo.Default.beltDescription;

gc.SetFont(Font'FontTiny');
gc.SetAlignments(HALIGN_Center, VALIGN_Top);
gc.GetTextExtent(0, strWidth, strHeight, descStr);

if ((bHasIt) && (rounds > 0))
{
str = String(rounds);

if (str == "1")
str = Sprintf(RoundLabel, str);
else
str = Sprintf(RoundsLabel, str);
}

if (bHasIt)
gc.SetTextColor(colHeaderText);
else
gc.SetTextColor(colSelectionBorderHalf);

if (str != "")
{
gc.GetTextExtent(0, strWidth, strRoundsHeight, str);
gc.DrawText(0, height - strHeight - strRoundsHeight + 2, width, strHeight, descStr);
gc.DrawText(0, height - strRoundsHeight, width, strHeight, str);
}
else
{
gc.DrawText(0, height - strHeight - strRoundsHeight, width, strHeight, descStr);
}

GetAmmo -> Class


return ammo;

InitWindow


Super.InitWindow();
SetSensitivity(bDisabledByDefault);

IsLoaded -> bool


return bLoaded;

SetAmmo (Class newAmmo, bool bNewHasIt, optional int newRounds)


ammo = newAmmo;
bHasIt = bNewHasIt;
rounds = newRounds;

SetClientObject(ammo);
SetIcon(Class(ammo).Default.Icon);
UpdateIconColor(bHasIt);
SetSensitivity(bHasIt);

SetLoaded (bool bNewLoaded)


bLoaded = bNewLoaded;

UpdateIconColor (bool bHasIt)


// Show the ammo in half intensity if the player doesn't have it!
if ((ammo != None) && (bHasIt))
{
colIcon = Default.colIcon;
}
else
{
colIcon.r = Default.colIcon.r / 3;
colIcon.g = Default.colIcon.g / 3;
colIcon.b = Default.colIcon.b / 3;
}




PersonaAugmentationBodyWindow.uc (extends Window)

var Texture bodyTextures[2];
bodyTextures(0)=Texture'DeusExUI.UserInterface.AugmentationsBody_1'
bodyTextures(1)=Texture'DeusExUI.UserInterface.AugmentationsBody_2'

DrawWindow (GC gc)


// Draw window background
gc.SetStyle(DSTY_Masked);

gc.DrawTexture(0, 0, 174, 256, 0, 0, bodyTextures[0]);
gc.DrawTexture(0, 256, 174, 103, 0, 0, bodyTextures[1]);

InitWindow


Super.InitWindow();

SetSize(174, 359);




PersonaAugmentationItemButton.uc (extends PersonaItemButton)

var PersonaLevelIconWindow winLevels;
var bool bActive;
var int hotkeyNumber;
var Color colIconActive;
var Color colIconNormal;
colIconActive=(G=255)
colIconNormal=(R=255,G=255)
buttonHeight=59

CreateControls


winLevels = PersonaLevelIconWindow(NewChild(Class'PersonaLevelIconWindow'));
winLevels.SetPos(30, 54);
winLevels.SetSelected(True);

DrawWindow (GC gc)


local String str;


Super.DrawWindow(gc);

// Draw the hotkey info in lower-left corner
if (hotkeyNumber >= 3)
{
str = "F" $ hotkeyNumber;
gc.SetFont(Font'FontMenuSmall_DS');
gc.SetAlignments(HALIGN_Left, VALIGN_Top);
gc.SetTextColor(colHeaderText);
gc.DrawText(2, iconPosHeight - 9, iconPosWidth - 2, 10, str);
}

InitWindow


Super.InitWindow();

SetActive(False);

SetActive (bool bNewActive)


bActive = bNewActive;

if (bActive)
colIcon = colIconActive;
else
colIcon = colIconNormal;

SetHotkeyNumber (int num)


hotkeyNumber = num;

SetLevel (int newLevel)


if (winLevels != None)
winLevels.SetLevel(newLevel);




PersonaAugmentationOverlaysWindow.uc (extends PersonaOverlaysWindow)

defaultSizeX=174
defaultSizeY=305
overlayTextures(0)=Texture'DeusExUI.UserInterface.AugmentationsOverlays_1'
overlayTextures(1)=Texture'DeusExUI.UserInterface.AugmentationsOverlays_2'



PersonaBaseWindow.uc (extends Window)

var DeusExPlayer player;
var bool bDrawBorder;
var EDrawStyle borderDrawStyle;
var EDrawStyle backgroundDrawStyle;
var Color colBackground;
var Color colBorder;
var Color colHeaderText;
var Color colText;
bDrawBorder=True

DrawBackground (GC gc)

DrawBorder (GC gc)

DrawWindow (GC gc)


// First draw the background then the border
DrawBackground(gc);

// Don't call the DrawBorder routines if
// they are disabled
if (bDrawBorder)
DrawBorder(gc);

InitWindow


Super.InitWindow();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colBackground = theme.GetColorFromName('HUDColor_Background');
colBorder = theme.GetColorFromName('HUDColor_Borders');
colText = theme.GetColorFromName('HUDColor_NormalText');
colHeaderText = theme.GetColorFromName('HUDColor_HeaderText');

bDrawBorder = player.GetHUDBordersVisible();

if (player.GetHUDBorderTranslucency())
borderDrawStyle = DSTY_Translucent;
else
borderDrawStyle = DSTY_Masked;

if (player.GetHUDBackgroundTranslucency())
backgroundDrawStyle = DSTY_Translucent;
else
backgroundDrawStyle = DSTY_Masked;




PersonaBorderButtonWindow.uc (extends ButtonWindow)

var Texture tex;
var int width;
var DeusExPlayer player;
var String buttonText;
var S_MenuUIBorderButtonTextures Left_Textures[2];
var S_MenuUIBorderButtonTextures Right_Textures[2];
var S_MenuUIBorderButtonTextures Center_Textures[2];
var Color colButtonFace;
var Color colText[4];
var int textureIndex;
var int textOffset;
var int leftOffset;
var int textColorIndex;
var int buttonVerticalOffset;
var int leftMargin;
var int rightMargin;
var int fontBaseLine;
var int fontAcceleratorLineHeight;
var Font fontButtonText;
var int verticalTextMargin;
var int buttonHeight;
var bool bBaseWidthOnText;
var int minimumButtonWidth;
var int maxTextWidth;
var bool bTranslucent;
var bool bUseTextOffset;
var bool bCenterText;
colButtonFace=(R=255,G=255,B=255)
colText(0)=(R=200,G=200,B=200)
colText(1)=(R=255,G=255,B=255)
colText(2)=(R=255,G=255,B=255)
colText(3)=(R=50,G=50,B=50)
leftMargin=6
fontBaseLine=1
fontAcceleratorLineHeight=1
fontButtonText=Font'DeusExUI.FontMenuHeaders'
verticalTextMargin=1
maxTextWidth=200
bUseTextOffset=True

CenterText (optional bool bNewCenter)


bCenterText = bNewCenter;

DrawWindow (GC gc)


SetButtonMetrics();

// Draw the textures
if (bTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colButtonFace);

// Left
gc.DrawTexture(
leftOffset, buttonVerticalOffset,
Left_Textures[textureIndex].width, buttonHeight,
0, 0,
Left_Textures[textureIndex].tex);

// Center
gc.DrawPattern(
leftOffset + Left_Textures[textureIndex].width, buttonVerticalOffset,
width - Left_Textures[textureIndex].width - Right_Textures[textureIndex].width - leftOffset, buttonHeight,
0, 0,
Center_Textures[textureIndex].tex);

// Right
gc.DrawTexture(
width - Right_Textures[textureIndex].width, buttonVerticalOffset,
Right_Textures[textureIndex].width, buttonHeight,
0, 0,
Right_Textures[textureIndex].tex);

// Draw the text!
gc.SetFont(fontButtonText);
gc.SetTextColor(colText[textColorIndex]);
gc.SetVerticalAlignment(VALIGN_Center);

if (bCenterText)
{
gc.SetHorizontalAlignment(HALIGN_Center);
leftMargin = 0;
}
else
{
gc.SetHorizontalAlignment(HALIGN_Left);
}

if (bUseTextOffset)
{
gc.DrawText(
leftMargin + textOffset, verticalTextMargin + textOffset + buttonVerticalOffset,
width, height, buttonText);
}
else
{
gc.DrawText(
leftMargin, verticalTextMargin + buttonVerticalOffset,
width, height, buttonText);
}

InitWindow


Super.InitWindow();

EnableTextAsAccelerator(false);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

// TODO: Unique HUD sounds
SetButtonSounds(None, Sound'Menu_Press');
SetFocusSounds(Sound'Menu_Focus');
SetSoundVolume(0.25);

SetBaselineData(fontBaseLine, fontAcceleratorLineHeight);

StyleChanged();

SetButtonMetrics


if (bIsSensitive)
{
if (bButtonPressed) // button pressed
{
textureIndex = 1;
textOffset = 1;
textColorIndex = 2;
}
else if (IsFocusWindow()) // focus
{
textureIndex = 0;
textOffset = 0;
textColorIndex = 1;
}
else // normal
{
textureIndex = 0;
textOffset = 0;
textColorIndex = 0;
}
}
else // disabled
{
textureIndex = 0;
textOffset = 0;
textColorIndex = 3;
}

SetButtonText (String newText)


buttonText = newText;

SetAcceleratorText(newText);

AskParentForReconfigure();

SetVerticalOffset (int newButtonVerticalOffset)


buttonVerticalOffset = newButtonVerticalOffset;

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

bTranslucent = player.GetHUDBackgroundTranslucency();

colButtonFace = theme.GetColorFromName('HUDColor_ButtonFace');
colText[0] = theme.GetColorFromName('HUDColor_ButtonTextNormal');

colText[1] = theme.GetColorFromName('HUDColor_ButtonTextFocus');
colText[2] = colText[1];

colText[3] = theme.GetColorFromName('HUDColor_ButtonTextDisabled');




PersonaButtonBarWindow.uc (extends PersonaBaseWindow)

var int defaultBarHeight;
var int buttonSpacing;
var Window winFiller;
var bool bFillAllSpace;
defaultBarHeight=16
bFillAllSpace=True

ChildRequestedReconfiguration (window child) -> bool


return FALSE;

ConfigurationChanged


local float qWidth, qHeight;
local int leftX;
local int numButtons;
local int remainingSpace;
local int buttonPadding;
local Window winPlace;


leftX = 0;
numButtons = 0;

// Loop through all buttons and try to place them
winPlace = GetTopChild();
while(winPlace != None)
{
if (winPlace.IsA('ButtonWindow'))
{
winPlace.QueryPreferredSize(qWidth, qHeight);

if (!bFillAllSpace)
winPlace.ConfigureChild(leftX, 0, qWidth, qHeight);

numButtons++;

leftX += qWidth;
}

winPlace = winPlace.GetLowerSibling();

if ((winPlace != None) && (winPlace.IsA('ButtonWindow')))
leftX += buttonSpacing;
}

// Now, if we need to make all the buttons an equal width
if (bFillAllSpace)
{
remainingSpace = width - leftX;

// Loop through the buttons again, adding "remaining space / #buttons"
// width to each button

leftX = 0;

winPlace = GetTopChild();
while(winPlace != None)
{
if (winPlace.IsA('ButtonWindow'))
{
winPlace.QueryPreferredSize(qWidth, qHeight);

buttonPadding = (remainingSpace / numButtons);
qWidth += buttonPadding;

winPlace.ConfigureChild(leftX, 0, qWidth, qHeight);

leftX += qWidth;
}

winPlace = winPlace.GetLowerSibling();

if ((winPlace != None) && (winPlace.IsA('ButtonWindow')))
leftX += buttonSpacing;
}
}

// Now calculate the position of the filler window
winFiller.ConfigureChild(leftX, 0, width - leftX, height);

CreateFillerWindow


winFiller = NewChild(Class'Window');
winFiller.SetBackground(Texture'PersonaButtonFiller');

DescendantAdded (Window descendant)


AskParentForReconfigure();

FillAllSpace (bool bFill)


bFillAllSpace = bFill;

InitWindow


Super.InitWindow();

SetHeight(defaultBarHeight);

CreateFillerWindow();
StyleChanged();

StyleChanged


Super.StyleChanged();

if (winFiller != None)
{
winFiller.SetTileColor(colBackground);
winFiller.SetBackgroundStyle(backgroundDrawStyle);
}




PersonaCheckBoxWindow.uc (extends CheckboxWindow)

var DeusExPlayer player;
var Color colText;
var Color colButtonFace;
var Font fontText;
var int fontBaseLine;
var int fontAcceleratorLineHeight;
colText=(R=255,G=255,B=255)
fontText=Font'DeusExUI.FontMenuHeaders'
fontBaseLine=1
fontAcceleratorLineHeight=1

InitWindow


Super.InitWindow();

SetFont(fontText);
SetTextAlignments(HALIGN_Left, VALIGN_Center);
SetTextMargins(0, 0);
SetCheckboxTextures(Texture'PersonaCheckBox_Off', Texture'PersonaCheckBox_On', 12, 12);
SetCheckboxSpacing(6);
SetCheckboxStyle(DSTY_Masked);
SetBaselineData(fontBaseLine, fontAcceleratorLineHeight);

// TODO: Unique HUD sounds
SetButtonSounds(None, Sound'Menu_Press');
SetSoundVolume(0.25);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colText = theme.GetColorFromName('HUDColor_ButtonTextNormal');
colButtonFace = theme.GetColorFromName('HUDColor_ButtonFace');

SetTextColors(colText, colText, colText, colText, colText, colText);
SetCheckboxColor(colText);




PersonaClientBaseWindow.uc (extends PersonaBaseWindow)

var Texture clientTextures[6];
var int texturePosX[6];
var int texturePosY[6];
var int textureRows;
var int textureCols;
var int textureCount;
var int textureIndex;

CalculateTexturePositions


local int rowIndex;
local int colIndex;


textureCount = 0;

for(rowIndex=0; rowIndex {
for(colIndex=0; colIndex {
texturePosX[textureCount] = colIndex * 256;
texturePosY[textureCount] = rowIndex * 256;
textureCount++;
}
}

SetClientTexture (int textureIndex, Texture newTexture)


if ((textureIndex >= 0) && (textureIndex < arrayCount(clientTextures)))
clientTextures[textureIndex] = newTexture;

SetTextureLayout (int newTextureCols, int newTextureRows)


textureCols = newTextureCols;
textureRows = newTextureRows;

CalculateTexturePositions();




PersonaClientBorderWindow.uc (extends PersonaClientBaseWindow)

DrawBorder (GC gc)


if (bDrawBorder)
{
// Draw window background
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);

for(textureIndex=0; textureIndex {
gc.DrawIcon(
texturePosX[textureIndex],
texturePosY[textureIndex],
clientTextures[textureIndex]);
}
}




PersonaClientWindow.uc (extends PersonaClientBaseWindow)

DrawBackground (GC gc)


// Draw window background
gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);

for(textureIndex=0; textureIndex {
gc.DrawIcon(
texturePosX[textureIndex],
texturePosY[textureIndex],
clientTextures[textureIndex]);
}




PersonaEditWindow.uc (extends EditWindow)

var DeusExPlayer player;
var Color colText;
var Color colHighlight;
var Color colCursor;
var Color colBlack;
var Font fontText;
fontText=Font'DeusExUI.FontMenuSmall'

InitWindow


Super.InitWindow();

SetFont(fontText);
SetInsertionPointType(INSTYPE_Insert);
EnableSingleLineEditing(False);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colText = theme.GetColorFromName('HUDColor_ListText');
colHighlight = theme.GetColorFromName('HUDColor_ListHighlight');
colCursor = theme.GetColorFromName('HUDColor_Cursor');

SetTextColor(colText);
SetTileColor(colHighlight);
SetSelectedAreaTexture(Texture'Solid', colText);
SetSelectedAreaTextColor(colBlack);
SetEditCursor(Texture'DeusExEditCursor', Texture'DeusExEditCursor_Shadow', colCursor);
SetInsertionPointTexture(Texture'Solid', colCursor);

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bIgnoreKey;


if (Super.VirtualKeyPressed(key, bRepeat))
return True;

// Return true except for keys we want to be processed
// externally, like Escape an Tab

switch(key)
{
case IK_Tab:
case IK_Escape:
bIgnoreKey = False;
break;

default:
bIgnoreKey = True;
break;
}

return bIgnoreKey;




PersonaGoalItemWindow.uc (extends AlignWindow)

var DeusExPlayer player;
var PersonaGoalTextWindow winBullet;
var PersonaGoalTextWindow winGoalText;
var Bool bCompleted;
var Bool bPrimaryGoal;

CreateTextWindows


winBullet = PersonaGoalTextWindow(NewChild(Class'PersonaGoalTextWindow'));
winGoalText = PersonaGoalTextWindow(NewChild(Class'PersonaGoalTextWindow'));

InitWindow


Super.InitWindow();

SetChildVAlignment(VALIGN_Top);

CreateTextWindows();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

SetGoalProperties (bool bNewPrimaryGoal, bool bNewCompleted, string goalText, optional bool bNoBullet)


bPrimaryGoal = bNewPrimaryGoal;
bCompleted = bNewCompleted;

winGoalText.SetText(goalText);

if (bNoBullet)
winBullet.SetText("");
else
winBullet.SetText("~");

StyleChanged();

StyleChanged


local ColorTheme theme;
local Color colText;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colText = theme.GetColorFromName('HUDColor_NormalText');

// Display completed goals in a different color
if (bCompleted)
{
winBullet.SetTextColorRGB(colText.r / 2, colText.g / 2, colText.b / 2);
winGoalText.SetTextColorRGB(colText.r / 2, colText.g / 2, colText.b / 2);
}
else
{
winBullet.SetTextColor(colText);
winGoalText.SetTextColor(colText);
}




PersonaGoalTextWindow.uc (extends TextWindow)

var Font fontText;
fontText=Font'DeusExUI.FontMenuSmall'

InitWindow


Super.InitWindow();

SetFont(fontText);
SetTextAlignments(HALIGN_Left, VALIGN_Center);
SetTextMargins(5, 2);

StyleChanged




PersonaHeaderLargeTextWindow.uc (extends TextWindow)

var DeusExPlayer player;
var Font fontText;
fontText=Font'DeusExUI.FontMenuHeaders'

InitWindow


Super.InitWindow();

SetFont(fontText);
SetTextMargins(0, 0);
SetTextAlignments(HALIGN_Left, VALIGN_Center);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;
local Color colText;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colText = theme.GetColorFromName('HUDColor_HeaderText');

SetTextColor(colText);




PersonaHeaderTextWindow.uc (extends TextWindow)

var DeusExPlayer player;
var Font fontText;
fontText=Font'DeusExUI.FontMenuHeaders'

InitWindow


Super.InitWindow();

SetFont(fontText);
SetTextMargins(0, 0);
SetTextAlignments(HALIGN_Left, VALIGN_Center);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;
local Color colText;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colText = theme.GetColorFromName('HUDColor_HeaderText');

SetTextColor(colText);




PersonaHealthActionButtonWindow.uc (extends PersonaBorderButtonWindow)

var localized String HealButtonLabel;
var int partIndex;
HealButtonLabel="Heal"
Left_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.HealthButtonNormal_Left',Width=4)
Left_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.HealthButtonPressed_Left',Width=4)
Right_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.HealthButtonNormal_Right',Width=8)
Right_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.HealthButtonPressed_Right',Width=8)
Center_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.HealthButtonNormal_Center',Width=2)
Center_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.HealthButtonPressed_Center',Width=2)
buttonHeight=13
minimumButtonWidth=66

GetPartIndex -> int


return partIndex;

InitWindow


Super.InitWindow();

SetSize(66, 13);
SetButtonText(HealButtonLabel);

SetPartIndex (int newPartIndex)


partIndex = newPartIndex;




PersonaHealthBodyWindow.uc (extends Window)

var Texture bodyTextures[2];
bodyTextures(0)=Texture'DeusExUI.UserInterface.HealthBody_1'
bodyTextures(1)=Texture'DeusExUI.UserInterface.HealthBody_2'

DrawWindow (GC gc)


// Draw window background
gc.SetStyle(DSTY_Masked);

gc.DrawTexture(0, 0, 219, 256, 0, 0, bodyTextures[0]);
gc.DrawTexture(0, 256, 219, 101, 0, 0, bodyTextures[1]);

InitWindow


Super.InitWindow();

SetSize(219, 357);




PersonaHealthItemButton.uc (extends PersonaItemButton)

var int partIndex;
var String desc;
var String title;

GetDesc -> String


return desc;

GetPartIndex -> int


return partIndex;

GetTitle -> String


return title;

SetDesc (String newDesc)


desc = newDesc;

SetPartIndex (int newPartIndex)


partIndex = newPartIndex;

SetTitle (String newTitle)


title = newTitle;




PersonaHealthOverlaysWindow.uc (extends PersonaOverlaysWindow)

defaultSizeX=219
defaultSizeY=357
overlayTextures(0)=Texture'DeusExUI.UserInterface.HealthOverlays_1'
overlayTextures(1)=Texture'DeusExUI.UserInterface.HealthOverlays_2'



PersonaHealthRegionWindow.uc (extends PersonaBaseWindow)

var PersonaNormalTextWindow winTitle;
var ProgressBarWindow winHealthBar;
var TextWindow winHealthBarText;
var PersonaHealthActionButtonWindow btnHeal;
var ButtonWindow btnRegion;
var Bool bUseHealButton;
var int partIndex;
var Float maxHealth;
var Float currentHealth;
var Color colBarBack;
bUseHealButton=True

CreateControls


CreateHealthBar();
CreateTitle();
CreateHealButton();
CreateRegionButton();

CreateHealButton


btnHeal = PersonaHealthActionButtonWindow(NewChild(Class'PersonaHealthActionButtonWindow'));
btnHeal.SetPos(5, 26);
btnHeal.Raise();

CreateHealthBar


winHealthBar = ProgressBarWindow(NewChild(Class'ProgressBarWindow'));
winHealthBar.SetPos(4, 13);
winHealthBar.SetSize(66, 11);
winHealthBar.SetValues(0, 100);
winHealthBar.SetVertical(False);
winHealthBar.SetScaleColorModifier(0.5);
winHealthBar.UseScaledColor(True);
winHealthBar.SetDrawBackground(True);
winHealthBar.SetBackColor(colBarBack);

winHealthBarText = TextWindow(NewChild(Class'TextWindow'));
winHealthBarText.SetPos(4, 14);
winHealthBarText.SetSize(66, 11);
winHealthBarText.SetTextMargins(0, 0);
winHealthBarText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winHealthBarText.SetFont(Font'FontMenuSmall_DS');
winHealthBarText.SetTextColorRGB(255, 255, 255);

CreateRegionButton


btnRegion = ButtonWindow(NewChild(Class'ButtonWindow'));
btnRegion.SetPos(0, 0);
btnRegion.SetSize(98, 25);

CreateTitle


winTitle = PersonaNormalTextWindow(NewChild(Class'PersonaNormalTextWindow'));
winTitle.SetSize(50, 11);
winTitle.SetPos(3, 2);

EnableButtons


local medKit medKit;


// First make sure the player has a medkit
medKit = MedKit(player.FindInventoryType(Class'MedKit'));

btnHeal.EnableWindow((currentHealth < maxHealth) && (medKit != None));

GetPartIndex -> int


return partIndex;

GetTitle -> String


if (winTitle != None)
return winTitle.GetText();
else
return "";

InitWindow


Super.InitWindow();

SetSize(71, 39);

CreateControls();

IsDamaged -> Bool


return (currentHealth < maxHealth);

SetHealth (float newHealth)


currentHealth = newHealth;

winHealthBar.SetCurrentValue(currentHealth);
winHealthBarText.SetText(String(Int(newHealth)) @ "/" @ String(Int(maxHealth)));

SetMaxHealth (float newMaxHealth)


maxHealth = newMaxHealth;

winHealthBar.SetValues(0, maxHealth);

SetPartIndex (int newPartIndex)


partIndex = newPartIndex;

if (btnHeal != None)
btnHeal.SetPartIndex(newPartIndex);

SetTitle (String newTitle)


if (winTitle != None)
winTitle.SetText(newTitle);

ShowHealButton (bool bShow)


if (btnHeal != None)
btnHeal.Show(bShow);




PersonaImageNewLegendLabel.uc (extends TileWindow)

var PersonaHeaderTextWindow winLegend;
var PersonaHeaderTextWindow winIcon;
var localized String NewLegendLabel;
NewLegendLabel=" = New Image"

CreateControls


winIcon = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
winIcon.SetFont(Font'FontHUDWingDings');
winIcon.SetText("C");

winLegend = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
winLegend.SetText(NewLegendLabel);

InitWindow


Super.InitWindow();

SetOrder(ORDER_Right);
SetChildAlignments(HALIGN_Full, VALIGN_Top);
SetMargins(0, 0);
SetMinorSpacing(0);
MakeWidthsEqual(False);
MakeHeightsEqual(True);

CreateControls();




PersonaImageNoteWindow.uc (extends PersonaEditWindow)

var Color colEditTextNormal;
var Color colEditTextFocus;
var Color colEditTextHighlight;
var Color colEditHighlight;
var Color colBackground;
colEditTextNormal=(G=200,B=200)
colEditTextFocus=(R=255,G=255,B=255)
colEditHighlight=(R=255,G=255,B=255)
colBackground=(R=32,G=32,B=32)

GetNote -> DataVaultImageNote


return DataVaultImageNote(GetClientObject());

InitWindow


Super.InitWindow();

SetTextMargins(2, 2);
SetMaxSize(200); // maybe increase this later, probably not.
SetNormalColors();
SetSelectedAreaTexture(Texture'Solid', colEditHighlight);
SetSelectedAreaTextColor(colEditTextHighlight);

SetBackgroundStyle(DSTY_Modulated);
SetTileColor(colBackground);
SetBackground(Texture'NoteEditBackground');

SetFocusColors


SetTextColor(colEditTextFocus);

SetNormalColors


SetTextColor(colEditTextNormal);

SetNote (DataVaultImageNote newNote)


SetPos(newNote.posX, newNote.posY);
SetText(newNote.noteText);
SetClientObject(newNote);

SetTextColors (Color colTextNormal, Color colTextFocus, Color colBack)


colEditTextNormal = colTextNormal;
colEditTextFocus = colTextFocus;
colEditTextHighlight = colBack;
colEditHighlight = colTextFocus;
colBackground = colBack;




PersonaImageWindow.uc (extends PersonaBaseWindow)

var DataVaultImage image;
var DeusExRootWindow root;
var Font fontNoImages;
var Color colTextNoImages;
var int imageSizeX;
var int imageSizeY;
var PersonaImageNoteWindow currentNoteWindow;
var ENoteMode noteMode;
var Bool bShowNotes;
var localized string strNoImages;
var localized string PressSpace;
var localized string EscapeToCancel;
var localized string NewNoteLabel;
fontNoImages=Font'DeusExUI.FontMenuHeaders'
colTextNoImages=(R=255,G=255,B=255)
imageSizeX=400
imageSizeY=400
bShowNotes=True
strNoImages="No Images Available"
PressSpace="Press [ESCAPE] when finished editing note"
EscapeToCancel="Click on image to create note, press [ESCAPE] to cancel"
NewNoteLabel="New Note"

CreateNotes


local DataVaultImageNote imageNote;
local PersonaImageNoteWindow editNote;


imageNote = image.firstNote;

while( imageNote != None )
{
editNote = PersonaImageNoteWindow(NewChild(Class'PersonaImageNoteWindow'));

editNote.SetNote(imageNote);
editNote.Show(bShowNotes);

imageNote = imageNote.nextNote;
}

DeleteNote


if ( currentNoteWindow != None )
{
image.DeleteNote(DataVaultImageNote(currentNoteWindow.GetClientObject()) );
currentNoteWindow.Destroy();
currentNoteWindow = None;
}

DeleteNoteWindows


local Window window;
local Window nextWindow;


window = GetTopChild();
while( window != None )
{
nextWindow = window.GetLowerSibling();

if (PersonaImageNoteWindow(window) != None)
window.Destroy();

window = nextWindow;
}

DrawWindow (GC gc)


if ( image == None )
{
gc.SetHorizontalAlignment(HALIGN_Center);
gc.SetVerticalAlignment(VALIGN_Center);
gc.SetFont(fontNoImages);
gc.SetTextColor(colTextNoImages);
gc.DrawText(0, 0, width, height, strNoImages);
}
else
{
gc.SetStyle(DSTY_Normal);

gc.DrawTexture( 0, 0, 256, 256, 0, 0, image.imageTextures[0]);
gc.DrawTexture(256, 0, 144, 256, 0, 0, image.imageTextures[1]);
gc.DrawTexture( 0, 256, 256, 144, 0, 0, image.imageTextures[2]);
gc.DrawTexture(256, 256, 144, 144, 0, 0, image.imageTextures[3]);
}

FocusEnteredDescendant (Window enterWindow)


// Ignore this even if we're deleting
if ( PersonaImageNoteWindow(enterWindow) != None )
{
if ( currentNoteWindow != None )
currentNoteWindow.SetNormalColors();

currentNoteWindow = PersonaImageNoteWindow(enterWindow);
}

FocusLeftDescendant (Window leaveWindow)


local PersonaImageNoteWindow noteWindow;


noteWindow = PersonaImageNoteWindow(leaveWindow);

if ( noteWindow != None )
SaveNote(noteWindow);

GetImage -> DataVaultImage


return image;

InitWindow


Super.InitWindow();

SetSize(imageSizeX, imageSizeY);

// Get a pointer to the root window
root = DeusExRootWindow(GetRootWindow());

IsNoteSelected -> Bool


return currentNoteWindow != None;

MouseButtonReleased (float pointX, float pointY, EInputKey button, int numClicks) -> bool


local DataVaultImageNote imageNote;
local PersonaImageNoteWindow editNote;
local Bool bHandled;
local int clipX, clipY;


bHandled = False;

// Get the hell out of here if there's no image
if (image == None)
return bHandled;

switch( noteMode )
{
case NM_Normal:
break;

case NM_PreAdd:
// Create a new ImageNote, then add it to the list of notes
// for this image.

imageNote = player.CreateDataVaultImageNoteObject();
imageNote.posX = pointX;
imageNote.posY = pointY;
imageNote.noteText = NewNoteLabel;
image.AddNote(imageNote);

// Now create an edit control that will be the visual representation
// of this note.

ClipWindow(GetParent()).GetChildPosition(clipX, clipY);
editNote = PersonaImageNoteWindow(NewChild(Class'PersonaImageNoteWindow'));
editNote.SetNote(imageNote);
ClipWindow(GetParent()).SetChildPosition(clipX, clipY);

currentNoteWindow = editNote;

SetFocusWindow(editNote);
editNote.SetSelectedArea(0, Len(NewNoteLabel));

bHandled = True;
noteMode = NM_Adding;
break;

case NM_Adding:
break;
}

return bHandled;

SaveNote (PersonaImageNoteWindow noteWindow)


local DataVaultImageNote imageNote;


if ( noteWindow.HasTextChanged() )
{
imageNote = DataVaultImageNote(noteWindow.GetClientObject());
imageNote.noteText = noteWindow.GetText();
}

SetAddNoteMode (Bool bNewAddMode)


noteMode = NM_PreAdd;

SetImage (DataVaultImage newImage)


image = newImage;
currentNoteWindow = None;

// First nuke any existing note buttons
DeleteNoteWindows();

if ( image != None )
{
// Create all the notes
CreateNotes();
}

ShowNotes (bool bNewShowNotes)


local Window window;
local Window nextWindow;


bShowNotes = bNewShowNotes;

if (image != None)
{
window = GetTopChild(False);
while( window != None )
{
nextWindow = window.GetLowerSibling(False);

if (PersonaImageNoteWindow(window) != None)
window.Show(bShowNotes);

window = nextWindow;
}
}

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bHandled;

bHandled = False;

switch( key )
{
case IK_Escape:
if ( noteMode == NM_PreAdd )
{
noteMode = NM_Normal;
bHandled = True;
}
else if ( noteMode == NM_Adding )
{
// Check to see if the note has changed. If the
// user didn't change the default text, then just
// ABORT!
if ((currentNoteWindow.GetText() != NewNoteLabel) && (currentNoteWindow.GetText() != ""))
SaveNote(currentNoteWindow);
else
DeleteNote();

noteMode = NM_Normal;
bHandled = True;
}
break;
}

if ( !bHandled )
return Super.VirtualKeyPressed(key, bRepeat);
else
return bHandled;




PersonaInfoItemWindow.uc (extends AlignWindow)

var DeusExPlayer player;
var TextWindow winLabel;
var TextWindow winText;
var Font fontText;
var Font fontTextHighlight;
var bool bHighlight;
fontText=Font'DeusExUI.FontMenuSmall'
fontTextHighlight=Font'DeusExUI.FontMenuHeaders'

InitWindow


Super.InitWindow();

// Defaults for tile window
SetChildVAlignment(VALIGN_Top);
SetChildSpacing(10);

winLabel = TextWindow(NewChild(Class'TextWindow'));
winLabel.SetFont(fontText);
winLabel.SetTextAlignments(HALIGN_Right, VALIGN_Top);
winLabel.SetTextMargins(0, 0);
winLabel.SetWidth(70);

winText = TextWindow(NewChild(Class'TextWindow'));
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winText.SetFont(fontText);
winText.SetTextMargins(0, 0);
winText.SetWordWrap(True);

// Get a pointer to the player
player = DeusExPlayer(GetPlayerPawn());

StyleChanged();

SetHighlight (bool bNewHighlight)


bHighlight = bNewHighlight;

if (bHighlight)
winText.SetFont(fontTextHighlight);
else
winText.SetFont(fontText);

StyleChanged();

SetItemInfo (coerce String newLabel, coerce String newText, optional bool bNewHighlight)


winLabel.SetText(newLabel);
winText.SetText(newText);
SetHighlight(bNewHighlight);

SetItemText (coerce string newText)


winText.SetText(newText);

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

winLabel.SetTextColor(theme.GetColorFromName('HUDColor_NormalText'));

if (bHighlight)
winText.SetTextColor(theme.GetColorFromName('HUDColor_HeaderText'));
else
winText.SetTextColor(theme.GetColorFromName('HUDColor_NormalText'));




PersonaInfoLineWindow.uc (extends PersonaBaseWindow)

var Color colLine;

DrawWindow (GC gc)


Super.DrawWindow(gc);

gc.SetStyle(DSTY_Normal);
gc.SetTileColor(colLine);
gc.DrawPattern(0, 2, width, 1, 0, 0, Texture'Solid' );

InitWindow


Super.InitWindow();

SetHeight(5);

StyleChanged


local ColorTheme theme;


Super.StyleChanged();

theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colLine = theme.GetColorFromName('HUDColor_NormalText');




PersonaInfoWindow.uc (extends PersonaBaseWindow)

var PersonaScrollAreaWindow winScroll;
var TileWindow winTile;
var PersonaHeaderTextWindow winTitle;
var PersonaNormalLargeTextWindow winText; // Last text
var int textVerticalOffset;
textVerticalOffset=20

AddInfoItem (coerce String newLabel, coerce String newText, optional bool bHighlight) -> PersonaInfoItemWindow


local PersonaInfoItemWindow winItem;


winItem = PersonaInfoItemWindow(winTile.NewChild(Class'PersonaInfoItemWindow'));
winItem.SetItemInfo(newLabel, newText, bHighlight);

return winItem;

AddLine


winTile.NewChild(Class'PersonaInfoLineWindow');

AppendText (String newText)


if (winText != None)
winText.AppendText(newText);
else
SetText(newText);

ChildRequestedReconfiguration (window child) -> bool


ConfigurationChanged();

return True;

Clear


winTitle.SetText("");
winTile.DestroyAllChildren();

ConfigurationChanged


local float qWidth, qHeight;


if (winTitle != None)
{
winTitle.QueryPreferredSize(qWidth, qHeight);
winTitle.ConfigureChild(0, 0, width, qHeight);
}

if (winScroll != None)
{
winScroll.QueryPreferredSize(qWidth, qHeight);
winScroll.ConfigureChild(0, textVerticalOffset, width, height - textVerticalOffset);
}

CreateControls


winTitle = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
winTitle.SetTextMargins(2, 1);

winScroll = PersonaScrollAreaWindow(NewChild(Class'PersonaScrollAreaWindow'));

winTile = TileWindow(winScroll.ClipWindow.NewChild(Class'TileWindow'));
winTile.SetOrder(ORDER_Down);
winTile.SetChildAlignments(HALIGN_Full, VALIGN_Top);
winTile.MakeWidthsEqual(True);
winTile.MakeHeightsEqual(False);
winTile.SetMargins(4, 1);
winTile.SetMinorSpacing(0);
winTile.SetWindowAlignments(HALIGN_Full, VALIGN_Top);

InitWindow


Super.InitWindow();

CreateControls();

SetText (String newText) -> PersonaNormalLargeTextWindow


winText = PersonaNormalLargeTextWindow(winTile.NewChild(Class'PersonaNormalLargeTextWindow'));

winText.SetTextMargins(0, 0);
winText.SetWordWrap(True);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);
winText.SetText(newText);

return winText;

SetTitle (String newTitle)


Clear();
winTitle.SetText(newTitle);




PersonaInventoryCreditsWindow.uc (extends TileWindow)

var PersonaHeaderTextWindow winCredits;
var localized String CreditsLabel;
CreditsLabel="Credits"

CreateControls


local PersonaHeaderTextWindow winLabel;


winLabel = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
winLabel.SetHeight(15);
winLabel.SetText(CreditsLabel);

winCredits = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
winCredits.SetSize(63, 15);
winCredits.SetTextAlignments(HALIGN_Right, VALIGN_Center);

InitWindow


Super.InitWindow();

SetOrder(ORDER_Right);
SetChildAlignments(HALIGN_Full, VALIGN_Top);
SetMargins(0, 0);
SetMinorSpacing(5);
MakeWidthsEqual(False);
MakeHeightsEqual(True);

CreateControls();

SetCredits (int newCredits)


winCredits.SetText(String(newCredits));




PersonaInventoryInfoWindow.uc (extends PersonaInfoWindow)

var TileWindow winTileAmmo;
var localized String AmmoLabel;
var localized String AmmoRoundsLabel;
var localized String ShowAmmoDescriptionsLabel;
var PersonaAmmoDetailButton selectedAmmoButton;
var PersonaInfoItemWindow lastAmmoLoaded;
var PersonaInfoItemWindow lastAmmoTypes;
var PersonaNormalLargeTextWindow lastAmmoDescription;
AmmoLabel="Ammo:"
AmmoRoundsLabel="Rounds:"
ShowAmmoDescriptionsLabel="Show Ammo Descriptions"

AddAmmo (Class ammo, bool bHasIt, optional int newRounds)


local PersonaAmmoDetailButton ammoButton;


if (winTileAmmo == None)
CreateAmmoTileWindow();

ammoButton = PersonaAmmoDetailButton(winTileAmmo.NewChild(Class'PersonaAmmoDetailButton'));
ammoButton.SetAmmo(ammo, bHasIt, newRounds);

AddAmmoCheckbox (bool bChecked)


local PersonaCheckboxWindow winCheck;


winCheck = PersonaCheckboxWindow(winTile.NewChild(Class'PersonaCheckboxWindow'));
winCheck.SetFont(Font'FontMenuSmall');
winCheck.SetText(ShowAmmoDescriptionsLabel);
winCheck.SetToggle(bChecked);

AddAmmoDescription (String newDesc)


lastAmmoDescription = SetText(newDesc);

AddAmmoInfoWindow (DeusExAmmo ammo, bool bShowDescriptions)


local AlignWindow winAmmo;
local PersonaNormalTextWindow winText;
local Window winIcon;


if (ammo != None)
{
winAmmo = AlignWindow(winTile.NewChild(Class'AlignWindow'));
winAmmo.SetChildVAlignment(VALIGN_Top);
winAmmo.SetChildSpacing(4);

// Add icon
winIcon = winAmmo.NewChild(Class'Window');
winIcon.SetBackground(ammo.Icon);
winIcon.SetBackgroundStyle(DSTY_Masked);
winIcon.SetSize(42, 37);

// Add description
winText = PersonaNormalTextWindow(winAmmo.NewChild(Class'PersonaNormalTextWindow'));
winText.SetWordWrap(True);
winText.SetTextMargins(0, 0);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);

if (bShowDescriptions)
{
winText.SetText(ammo.itemName @ "(" $ AmmoRoundsLabel @ ammo.AmmoAmount $ ")|n|n");
winText.AppendText(ammo.description);
}
else
{
winText.SetText(ammo.itemName $ "|n|n" $ AmmoRoundsLabel @ ammo.AmmoAmount);
}
}

AddLine();

AddAmmoLoadedItem (String newLabel, String newText)


lastAmmoLoaded = AddInfoItem(newLabel, newText);

AddAmmoTypesItem (String newLabel, String newText)


lastAmmoTypes = AddInfoItem(newLabel, newText);

Clear


Super.Clear();
winTileAmmo = None;

CreateAmmoTileWindow


local PersonaNormalTextWindow winText;


if (winTileAmmo == None)
{
winTileAmmo = TileWindow(winTile.NewChild(Class'TileWindow'));
winTileAmmo.SetOrder(ORDER_Right);
winTileAmmo.SetChildAlignments(HALIGN_Left, VALIGN_Full);
winTileAmmo.SetWindowAlignments(HALIGN_Full, VALIGN_Top);
winTileAmmo.MakeWidthsEqual(False);
winTileAmmo.MakeHeightsEqual(True);
winTileAmmo.SetMargins(0, 0);
winTileAmmo.SetMinorSpacing(4);

winText = PersonaNormalTextWindow(winTileAmmo.NewChild(Class'PersonaNormalTextWindow'));
winText.SetWidth(70);
winText.SetTextMargins(0, 6);
winText.SetTextAlignments(HALIGN_Right, VALIGN_Center);
winText.SetText(AmmoLabel);
}

GetSelectedAmmo -> Class


local Window currentWindow;


if (selectedAmmoButton != None)
{
return selectedAmmoButton.GetAmmo();
}
else
{
currentWindow = winTileAmmo.GetTopChild();
while(currentWindow != None)
{
if (PersonaAmmoDetailButton(currentWindow) != None)
{
if (PersonaAmmoDetailButton(currentWindow).IsLoaded())
{
return PersonaAmmoDetailButton(currentWindow).GetAmmo();
break;
}
}
currentWindow = currentWindow.GetLowerSibling();
}
}

return None;

SelectAmmoButton (PersonaAmmoDetailButton selectedButton)


local Window currentWindow;


currentWindow = winTileAmmo.GetTopChild();
while(currentWindow != None)
{
if (PersonaAmmoDetailButton(currentWindow) != None)
{
PersonaAmmoDetailButton(currentWindow).SetLoaded(selectedButton == currentWindow);
PersonaAmmoDetailButton(currentWindow).SelectButton(selectedButton == currentWindow);
}
currentWindow = currentWindow.GetLowerSibling();
}

// Keep track of the selected button
selectedAmmoButton = selectedButton;

SetLoaded (Class ammo)


local Window currentWindow;


currentWindow = winTileAmmo.GetTopChild();
while(currentWindow != None)
{
if (PersonaAmmoDetailButton(currentWindow) != None)
{
PersonaAmmoDetailButton(currentWindow).SetLoaded(currentWindow.GetClientObject() == ammo);
PersonaAmmoDetailButton(currentWindow).SelectButton(currentWindow.GetClientObject() == ammo);

// Keep track of the selected button
if (currentWindow.GetClientObject() == ammo)
selectedAmmoButton = PersonaAmmoDetailButton(currentWindow);
}
currentWindow = currentWindow.GetLowerSibling();
}

UpdateAmmoDescription (String newDesc)


if (lastAmmoDescription != None)
lastAmmoDescription.SetText(newDesc);

UpdateAmmoLoaded (String newText)


if (lastAmmoLoaded != None)
lastAmmoLoaded.SetItemText(newText);

UpdateAmmoTypes (String newText)


if (lastAmmoTypes != None)
lastAmmoTypes.SetItemText(newText);




PersonaInventoryItemButton.uc (extends PersonaItemButton)

var bool bEquipped; // True if item Equipped
var bool bDragStart;
var bool bDimIcon;
var bool bAllowDragging;
var bool bDragging;
var bool bValidSlot;
var Int clickX;
var Int clickY;
var Int dragPosX;
var Int dragPosY;
var PersonaScreenInventory winInv; // Pointer back to the window
var FillModes fillMode;
var Color colDragGood;
var Color colDragBad;
var Color colWeaponModTrue;
var Color colWeaponModFalse;
var Color colDropGood;
var Color colDropBad;
var Color colNone;
var Color fillColor;
var Texture fillTexture;
var localized String CountLabel;
var localized String RoundLabel;
var localized String RoundsLabel;
bAllowDragging=True
fillMode=FM_None
colDragGood=(G=255)
colDragBad=(R=255)
colWeaponModTrue=(R=32,G=128,B=32)
colWeaponModFalse=(R=128,G=32,B=32)
colDropGood=(R=32,G=128,B=32)
colDropBad=(R=128,G=32,B=32)
fillTexture=Texture'Extension.Solid'
CountLabel="Count: %d"
RoundLabel="%d Rd"
RoundsLabel="%d Rds"

AllowDragging (bool bNewDragMode)


bAllowDragging = bNewDragMode;

DrawWindow (GC gc)


local Inventory anItem;
local String str;
local DeusExWeapon weapon;
local float strWidth, strHeight;


if (( !bDragging ) || ( bDragging && bValidSlot ))
{
// Draw the background
SetFillColor();
gc.SetStyle(DSTY_Translucent);
gc.SetTileColor(fillColor);
gc.DrawPattern(1, 1, width - 2, height - 2, 0, 0, fillTexture);
}

if ( !bDragging )
{
gc.SetStyle(DSTY_Masked);
gc.SetTileColor(colIcon);

// Draw icon centered in button
gc.DrawTexture(((width) / 2) - (iconPosWidth / 2),
((height) / 2) - (iconPosHeight / 2),
iconPosWidth, iconPosHeight,
0, 0,
icon);

anItem = Inventory(GetClientObject());

// If this item is an inventory item *and* it's in the object
// belt, draw a small number in the
// upper-right corner designating it's position in the belt

if ( anItem.bInObjectBelt )
{
gc.SetFont(Font'FontMenuSmall_DS');
gc.SetAlignments(HALIGN_Right, VALIGN_Center);
gc.SetTextColor(colHeaderText);
gc.GetTextExtent(0, strWidth, strHeight, anItem.beltPos);
gc.DrawText(width - strWidth - 3, 3, strWidth, strHeight, anItem.beltPos);
}

// If this is an ammo or a LAM (or other thrown projectile),
// display the number of rounds remaining
//
// If it's a weapon that takes ammo, then show the type of
// ammo loaded into it

if (anItem.IsA('DeusExAmmo') || anItem.IsA('DeusExWeapon'))
{
weapon = DeusExWeapon(anItem);
str = "";

if ((weapon != None) && weapon.bHandToHand && (weapon.AmmoType != None) && (weapon.AmmoName != class'AmmoNone'))
{
str = String(weapon.AmmoType.AmmoAmount);
if (str == "1")
str = Sprintf(RoundLabel, str);
else
str = Sprintf(RoundsLabel, str);
}
else if (anItem.IsA('DeusExAmmo'))
{
str = String(DeusExAmmo(anItem).AmmoAmount);
if (str == "1")
str = Sprintf(RoundLabel, str);
else
str = Sprintf(RoundsLabel, str);
}
else if ((weapon != None) && (!weapon.bHandToHand))
{
str = weapon.AmmoType.beltDescription;
}

if (str != "")
{
gc.SetFont(Font'FontMenuSmall_DS');
gc.SetAlignments(HALIGN_Center, VALIGN_Center);
gc.SetTextColor(colHeaderText);
gc.GetTextExtent(0, strWidth, strHeight, str);
gc.DrawText(0, height - strHeight, width, strHeight, str);
}
}

// Check to see if we need to print "x copies"
if (anItem.IsA('DeusExPickup') && (!anItem.IsA('NanoKeyRing')))
{
if (DeusExPickup(anItem).NumCopies > 1)
{
str = Sprintf(CountLabel, DeusExPickup(anItem).NumCopies);

gc.SetFont(Font'FontMenuSmall_DS');
gc.SetAlignments(HALIGN_Center, VALIGN_Center);
gc.SetTextColor(colHeaderText);
gc.GetTextExtent(0, strWidth, strHeight, str);
gc.DrawText(0, height - strHeight, width, strHeight, str);
}
}
}

// Draw selection border width/height of button
if (bSelected)
{
gc.SetTileColor(colSelectionBorder);
gc.SetStyle(DSTY_Masked);
gc.DrawBorders(0, 0, width, height, 0, 0, 0, 0, texBorders);
}

FinishButtonDrag


bDragStart = False;
bDragging = False;

winInv.FinishButtonDrag();

HighlightWeapon (bool bNewToggle)


if (bNewToggle)
fillMode = FM_WeaponModTrue;
else
fillMode = FM_WeaponModFalse;

MouseMoved (float newX, float newY)


local Float invX;
local Float invY;


if (bAllowDragging)
{
if (bDragStart)
{
// Only start a drag even if the cursor has moved more than, say,
// two pixels. This prevents problems if the user just wants to
// click on an item to select it but is a little sloppy. :)
if (( Abs(newX - clickX) > 2 ) || ( Abs(newY- clickY) > 2 ))
{
StartButtonDrag();
SetCursorPos(width/2, height/2);
}
}

if (bDragging)
{
// Call the PersonaScreenInventory::MouseMoved function, with translated
// coordinates.
ConvertCoordinates(Self, newX, newY, winInv, invX, invY);

winInv.UpdateDragMouse(invX, invY);
}
}

ResetFill


fillMode = FM_None;

SelectButton (Bool bNewSelected)


bSelected = bNewSelected;

if (bSelected)
fillMode = FM_Selected;
else
fillMode = FM_None;

SetDropFill (bool bGoodDrop)


if (bGoodDrop)
fillMode = FM_DropGood;
else
fillMode = FM_DropBad;

SetEquipped (Bool bNewEquipped)


bEquipped = bNewEquipped;

SetFillColor


switch(fillMode)
{
case FM_WeaponModTrue:
fillColor = colWeaponModTrue;
break;
case FM_WeaponModFalse:
fillColor = colWeaponModFalse;
break;
case FM_Selected:
fillColor = colFillSelected;
break;
case FM_DropBad:
fillColor = colDropBad;
break;
case FM_DropGood:
fillColor = colDropGood;
break;
case FM_None:
fillColor = colNone;
break;
}

SetIconSize (int newWidth, int newHeight)


iconPosWidth = newWidth;
iconPosHeight = newHeight;

// Also draw borders at the same size
borderWidth = newWidth;
borderHeight = newHeight;

SetInventoryWindow (PersonaScreenInventory newWinInv)


winInv = newWinInv;

StartButtonDrag


bDragStart = False;
bDragging = True;

winInv.StartButtonDrag(Self);




PersonaInventoryObjectBelt.uc (extends Window)

var PersonaScreenInventory winInventory; // Pointer to inventory window
var HUDObjectBelt objBelt; // Our local object Belt
var HUDObjectBelt hudBelt; // HUD Object Belt

AddObject (Inventory inv, int objectNum)


// Don't allow this if it's the NanoKeyRing object

if (( inv != None ) && (objectNum != 0))
{
//DEUS_EX AMSD Changed so hudbelt call propagates through player
DeusExPlayer(GetRootWindow().ParentPawn).RemoveObjectFromBelt(inv);
//hudBelt.RemoveObjectFromBelt(inv);
DeusExPlayer(GetRootWindow().ParentPawn).AddObjectToBelt(inv, objectNum, True);
//hudBelt.objects[objectNum].SetItem(inv);
objBelt.RemoveObjectFromBelt(inv);
objBelt.AddObjectToBelt(inv, objectNum, True);
}

AssignObjectBeltByKey (Inventory invItem, EInputKey key)


local int objectNum;


if ((key < IK_1) || ( key > IK_9 ))
return;

// Typecasting EInputKey to int doesn't seem to work.
// All I have to say to that is BAH.

// 0 (Zero) cannot be assigned because that position is used
// by the NanoKeyRing

switch( key )
{
case IK_1:
objectNum = 1;
break;
case IK_2:
objectNum = 2;
break;
case IK_3:
objectNum = 3;
break;
case IK_4:
objectNum = 4;
break;
case IK_5:
objectNum = 5;
break;
case IK_6:
objectNum = 6;
break;
case IK_7:
objectNum = 7;
break;
case IK_8:
objectNum = 8;
break;
case IK_9:
objectNum = 9;
break;
}

AddObject(invItem, objectNum);

CopyObjectBeltInventory


local int objectIndex;


// Now copy the items
for (objectIndex=1;objectIndex<10;objectIndex++)
objBelt.AddObjectToBelt(hudBelt.GetObjectFromBelt(objectIndex), objectIndex, True);

DestroyWindow


hudBelt.AssignWinInv(None);

Super.DestroyWindow();

InitWindow


local DeusExRootWindow root;
local float hudBeltWidth, hudBeltHeight;


Super.InitWindow();

SetSize(631, 69);

hudBelt = DeusExRootWindow(GetRootWindow()).hud.belt;

// Create our local object belt, then get a pointer to the HUD belt
objBelt = HUDObjectBelt(NewChild(Class'HUDObjectBelt'));
objBelt.SetPos(90, 0);
objBelt.SetVisibility(True);
objBelt.SetInteractive(True);

if ( !hudBelt.IsVisible() )
{
hudBelt.Show();
hudBelt.Hide();
}

// Copy the items from HUD belt into our local belt
CopyObjectBeltInventory();

RemoveObject (Inventory inv)


objBelt.RemoveObjectFromBelt(inv);
DeusExPlayer(GetRootWindow().ParentPawn).RemoveObjectFromBelt(inv);
//hudBelt.RemoveObjectFromBelt(inv);

SelectObject (Inventory item, bool bNewToggle)


local int objectIndex;


for (objectIndex=0;objectIndex<10;objectIndex++)
{
if (objBelt.objects[objectIndex].item == item)
{
if (!objBelt.objects[objectIndex].GetToggle())
objBelt.objects[objectIndex].SetToggle(bNewToggle);
}
else
{
// Make sure no other objects are toggled.
objBelt.objects[objectIndex].SetToggle(False);
objBelt.objects[objectIndex].HighlightSelect(False);
}
}

SetInventoryWindow (PersonaScreenInventory newWinInventory)


winInventory = newWinInventory;

// Set all the object belt winInv
objBelt.AssignWinInv(newWinInventory);

SwapObjects (HUDObjectSlot firstSlot, HUDObjectSlot secondSlot)


local int firstSlotNum;
local int secondSlotNum;
local Inventory firstItem;
local Inventory secondItem;


firstSlotNum = firstSlot.ObjectNum;
secondSlotNum = secondSlot.ObjectNum;

firstItem = firstSlot.Item;
secondItem = secondSlot.Item;

RemoveObject(firstSlot.item);

if (secondSlot.Item != None)
RemoveObject(secondSlot.item);

AddObject(firstItem, secondSlotNum);

if (secondItem != None)
AddObject(secondItem, firstSlotNum);

UpdateBeltText (Inventory item)


// Update object belt text
if (item.bInObjectBelt)
objBelt.UpdateObjectText(item.beltPos);




PersonaItemButton.uc (extends ButtonWindow)

var DeusExPlayer player;
var Texture icon; // Icon to draw
var int iconPosWidth;
var int iconPosHeight;
var int buttonWidth;
var int buttonHeight;
var int borderWidth;
var int borderHeight;
var Bool bSelected;
var Bool bIconTranslucent;
var Texture texBorders[9];
var bool bBorderTranslucent;
var bool bBackgroundTranslucent;
var bool bDrawBorder;
var Color colBackground;
var Color colBorder;
var Color colHeaderText;
var Color colText;
var Color colIcon;
var Color colSelectionBorder;
var Color colFillSelected;
iconPosWidth=52
iconPosHeight=52
buttonWidth=54
buttonHeight=54
borderWidth=54
borderHeight=54
bIconTranslucent=True
texBorders(0)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_TL'
texBorders(1)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_TR'
texBorders(2)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_BL'
texBorders(3)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_BR'
texBorders(4)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Left'
texBorders(5)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Right'
texBorders(6)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Top'
texBorders(7)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Bottom'
texBorders(8)=Texture'DeusExUI.UserInterface.PersonaItemHighlight_Center'
colIcon=(R=255,G=255,B=255)
colSelectionBorder=(R=255,G=255,B=255)

CreateControls

DrawWindow (GC gc)


if (icon != None)
{
// Draw the icon
if (bIconTranslucent)
gc.SetStyle(DSTY_Translucent);
else
gc.SetStyle(DSTY_Masked);

gc.SetTileColor(colIcon);
gc.DrawTexture(((borderWidth) / 2) - (iconPosWidth / 2),
((borderHeight) / 2) - (iconPosHeight / 2),
iconPosWidth, iconPosHeight,
0, 0,
icon);
}

// Draw selection border
if (bSelected)
{
gc.SetTileColor(colSelectionBorder);
gc.SetStyle(DSTY_Masked);
gc.DrawBorders(0, 0, borderWidth, borderHeight, 0, 0, 0, 0, texBorders);
}

InitWindow


Super.InitWindow();

SetSize(buttonWidth, buttonHeight);

CreateControls();

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

SelectButton (Bool bNewSelected)


// TODO: Replace with HUD sounds
PlaySound(Sound'Menu_Press', 0.25);

bSelected = bNewSelected;

SetBorderSize (int newWidth, int newHeight)


borderWidth = newWidth;
borderHeight = newHeight;

SetIcon (Texture newIcon)


icon = newIcon;

SetIconSize (int newWidth, int newHeight)


iconPosWidth = newWidth;
iconPosHeight = newHeight;

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colBackground = theme.GetColorFromName('HUDColor_Background');
colBorder = theme.GetColorFromName('HUDColor_Borders');
colText = theme.GetColorFromName('HUDColor_NormalText');
colHeaderText = theme.GetColorFromName('HUDColor_HeaderText');

colFillSelected.r = Int(Float(colBackground.r) * 0.50);
colFillSelected.g = Int(Float(colBackground.g) * 0.50);
colFillSelected.b = Int(Float(colBackground.b) * 0.50);

bBorderTranslucent = player.GetHUDBorderTranslucency();
bBackgroundTranslucent = player.GetHUDBackgroundTranslucency();
bDrawBorder = player.GetHUDBordersVisible();

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


return False;




PersonaItemDetailButton.uc (extends PersonaItemButton)

var DeusExPickup item;
var Bool bIgnoreCount;
var Bool bDisabledByDefault;
var int itemCount;
var localized String CountLabel;
bDisabledByDefault=True
CountLabel="Count: %d"
iconPosWidth=53
iconPosHeight=53
buttonWidth=55
buttonHeight=55
borderWidth=55
borderHeight=55
bIconTranslucent=False

DrawWindow (GC gc)


local String str;
local float strWidth, strHeight;


Super.DrawWindow(gc);

// Don't draw count if we're ignoring
if (!bIgnoreCount)
{
str = Sprintf(CountLabel, itemCount);

gc.SetFont(Font'FontMenuSmall_DS');
gc.SetAlignments(HALIGN_Center, VALIGN_Top);
gc.SetTextColor(colHeaderText);
gc.GetTextExtent(0, strWidth, strHeight, str);
gc.DrawText(0, height - strHeight, width, strHeight, str);
}

InitWindow


Super.InitWindow();

SetItem(None);

SetSensitivity(bDisabledByDefault);

SetCount (int newCount)


itemCount = newCount;

UpdateIconColor();

SetCountLabel (String newLabel)


CountLabel = newLabel;

SetIgnoreCount (bool bIgnore)


bIgnoreCount = bIgnore;
SetItem(Item);

SetItem (DeusExPickup newItem)


item = newItem;

SetClientObject(item);

if (item != None)
itemCount = item.NumCopies;

UpdateIconColor();

UpdateIconColor


// Show the icon in half intensity if the player doesn't have it!
if ((item != None) || (bIgnoreCount) || ((!bIgnoreCount) && (itemCount > 0)))
{
colIcon = Default.colIcon;
}
else
{
colIcon.r = Default.colIcon.r / 2;
colIcon.g = Default.colIcon.g / 2;
colIcon.b = Default.colIcon.b / 2;
}




PersonaItemDetailIconWindow.uc (extends PersonaBaseWindow)

var DeusExPickup item;
var Texture icon;
var int iconWidth;
var int iconHeight;
var Color colIcon;
var Bool bIgnoreCount;
var localized String CountLabel;
IconWidth=42
IconHeight=37
colIcon=(R=255,G=255,B=255)
CountLabel="Count: %d"

DrawWindow (GC gc)


local String str;
local int count;


Super.DrawWindow(gc);

// Draw icon
gc.SetStyle(DSTY_Masked);
gc.SetTileColor(colIcon);

gc.DrawTexture(((width) / 2) - (iconWidth / 2),
((height) / 2) - (iconHeight / 2),
iconWidth, iconHeight,
0, 0,
icon);

// Don't draw count if we're ignoring
if (!bIgnoreCount)
{
// Draw a Count
if (item == None)
count = 0;
else
count = item.NumCopies;

str = Sprintf(CountLabel, count);

gc.SetFont(Font'FontMenuSmall_DS');
gc.SetAlignments(HALIGN_Center, VALIGN_Top);
gc.SetTextColor(colHeaderText);
gc.DrawText(1, height - 10, width, 10, str);
}

InitWindow


Super.InitWindow();

SetItem(None);

SetIcon (Texture newIcon)


icon = newIcon;

SetIgnoreCount (bool bIgnore)


bIgnoreCount = bIgnore;
SetItem(Item);

SetItem (DeusExPickup newItem)


item = newItem;

// Show the icon in half intensity if the player doesn't have it!
if ((item != None) || (bIgnoreCount))
{
colIcon = Default.colIcon;
}
else
{
colIcon.r = Default.colIcon.r / 2;
colIcon.g = Default.colIcon.g / 2;
colIcon.b = Default.colIcon.b / 2;
}




PersonaItemDetailWindow.uc (extends PersonaBaseWindow)

var PersonaItemDetailButton winIcon;
var PersonaNormalTextWindow winText;
var PersonaScrollAreaWindow winScroll;
var PersonaHeaderTextWindow winTitle;
var int defaultHeight;
defaultHeight=55

AppendText (String newText)


winText.AppendText(newText);

ChildRequestedReconfiguration (window child) -> bool


ConfigurationChanged();

return True;

ConfigurationChanged


local float iconWidth, iconHeight;
local float scrollWidth, scrollHeight;


if (winIcon != None)
{
winIcon.QueryPreferredSize(iconWidth, iconHeight);
winIcon.ConfigureChild(0, 0, iconWidth, iconHeight);
}

if (winScroll != None)
{
winScroll.QueryPreferredSize(scrollWidth, scrollHeight);
winScroll.ConfigureChild(
iconWidth + 1, 2,
width - iconWidth - 3, height - 4);
}

CreateControls


winIcon = PersonaItemDetailButton(NewChild(Class'PersonaItemDetailButton'));
winIcon.SetPos(0, 0);

winScroll = PersonaScrollAreaWindow(NewChild(Class'PersonaScrollAreaWindow'));

winText = PersonaNormalTextWindow(winScroll.ClipWindow.NewChild(Class'PersonaNormalTextWindow'));
winText.SetTextMargins(2, 2);
winText.SetWordWrap(True);
winText.SetTextAlignments(HALIGN_Left, VALIGN_Top);

GetItemButton -> PersonaItemDetailButton


return winIcon;

InitWindow


Super.InitWindow();

SetHeight(defaultHeight);

CreateControls();

SetCount (int newCount)


if (winIcon != None)
winIcon.SetCount(newCount);

SetCountLabel (String newLabel)


if (winIcon != None)
winIcon.SetCountLabel(newLabel);

SetIcon (Texture newIcon)


if (winIcon != None)
winIcon.SetIcon(newIcon);

SetIconSensitivity (bool bSensitive)


if (winIcon != None)
winIcon.SetSensitivity(bSensitive);

SetIconSize (int newWidth, int newHeight)


if (winIcon != None)
{
winIcon.iconPosWidth = newWidth;
winIcon.iconPosHeight = newHeight;
}

SetIgnoreCount (bool bIgnore)


if (winIcon != None)
winIcon.SetIgnoreCount(bIgnore);

SetItem (DeusExPickup newItem)


if (winIcon != None)
{
winIcon.SetItem(newItem);
winIcon.SetIconSize(newItem.largeIconWidth, newItem.largeIconHeight);
}

SetText (String newText)


winText.SetText(newText);

SetTextAlignments (EHAlign newHAlign, EVAlign newVAlign)


winText.SetTextAlignments(newHAlign, newVAlign);

SetTextFont (Font newFont)


if (newFont != None)
winText.SetFont(newFont);




PersonaLevelIconWindow.uc (extends PersonaBaseWindow)

var int currentLevel;
var Texture texLevel;
var Bool bSelected;
var int iconSizeX;
var int iconSizeY;
texLevel=Texture'DeusExUI.UserInterface.PersonaSkillsChicklet'
iconSizeX=5
iconSizeY=5

DrawWindow (GC gc)


local int levelCount;


gc.SetTileColor(colText);
gc.SetStyle(DSTY_Masked);

for(levelCount=0; levelCount<=currentLevel; levelCount++)
{
gc.DrawTexture(levelCount * (iconSizeX + 1), 0, iconSizeX, iconSizeY,
0, 0, texLevel);
}

InitWindow


Super.InitWindow();

SetSize(23, 5);

SetLevel (int newLevel)


currentLevel = newLevel;

SetSelected (bool bNewSelected)


bSelected = bNewSelected;
StyleChanged();

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

if (bSelected)
colText = theme.GetColorFromName('HUDColor_ButtonTextFocus');
else
colText = theme.GetColorFromName('HUDColor_ButtonTextNormal');




PersonaListWindow.uc (extends ListWindow)

var DeusExPlayer player;
var Color colText;
var Color colTextHighlight;
var Color colHighlight;
var Color colFocus;
var Texture texHighlight;
var Texture texFocus;
var Font fontText;
colText=(R=255,G=255,B=255)
colTextHighlight=(R=255,G=255,B=255)
colHighlight=(R=128,G=128,B=128)
colFocus=(R=64,G=64,B=64)
texHighlight=Texture'Extension.Solid'
texFocus=Texture'Extension.Solid'
fontText=Font'DeusExUI.FontMenuSmall'

InitWindow


Super.InitWindow();

SetFont(fontText);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

// TODO: Unique HUD sounds
SetListSounds(Sound'Menu_Press', Sound'Menu_Focus');
SetSoundVolume(0.25);

SetNumColumns(0);
SetNumColumns(1);

StyleChanged


local ColorTheme theme;
local Int colIndex;


// Background color
theme = player.ThemeManager.GetCurrentHUDColorTheme();

colText = theme.GetColorFromName('HUDColor_ListText');
colTextHighlight = theme.GetColorFromName('HUDColor_ListTextHighlight');
colHighlight = theme.GetColorFromName('HUDColor_ListHighlight');
colFocus = theme.GetColorFromName('HUDColor_ListFocus');

SetTextColor(colText);
SetHighlightTextColor(colTextHighlight);
SetHighlightTexture(texHighlight);
SetHighlightColor(colHighlight);
SetFocusTexture(texFocus);
SetFocusColor(colFocus);

// Loop through columns, setting text color
for (colIndex=0; colIndex SetColumnColor(colIndex, colText);

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool retval;


// Handle keys
switch (key)
{
case IK_Space: // toggle selection
retval = true;
break;
}

if (!retval)
retval = Super.VirtualKeyPressed(key, bRepeat);

// Return TRUE if we handled this
return (retval);




PersonaNavBarBaseWindow.uc (extends PersonaBaseWindow)

var DeusExRootWindow root;
var PersonaButtonBarWindow winNavButtons;
var PersonaButtonBarWindow winNavExit;
var PersonaNavButtonWindow btnExit;
var Texture texBackgrounds[3];
var Texture texBorders[3];
var int backgroundOffsetX;
var int backgroundOffsetY;
var localized String ExitButtonLabel;
texBackgrounds(0)=Texture'DeusExUI.UserInterface.PersonaNavBarBackground_1'
texBackgrounds(1)=Texture'DeusExUI.UserInterface.PersonaNavBarBackground_2'
texBackgrounds(2)=Texture'DeusExUI.UserInterface.PersonaNavBarBackground_3'
texBorders(0)=Texture'DeusExUI.UserInterface.PersonaNavBarBorder_1'
texBorders(1)=Texture'DeusExUI.UserInterface.PersonaNavBarBorder_2'
texBorders(2)=Texture'DeusExUI.UserInterface.PersonaNavBarBorder_3'
backgroundOffsetX=17
backgroundOffsetY=6
ExitButtonLabel="E|&xit"

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch(buttonPressed)
{
case btnExit:
PersonaScreenBaseWindow(GetParent()).SaveSettings();
root.PopWindow();
break;

default:
bHandled = False;
break;
}

if (bHandled)
return bHandled;
else
return Super.ButtonActivated(buttonPressed);

CreateButtonWindows


// Create the Inventory Items window
winNavButtons = PersonaButtonBarWindow(NewChild(Class'PersonaButtonBarWindow'));

winNavButtons.SetPos(23, 8);
winNavButtons.SetSize(534, 16);
winNavButtons.Lower();

// Create the Inventory Items window
winNavExit = PersonaButtonBarWindow(NewChild(Class'PersonaButtonBarWindow'));

winNavExit.SetPos(573, 8);
winNavExit.SetSize(48, 16);
winNavExit.Lower();

CreateButtons


btnExit = CreateNavButton(winNavExit, ExitButtonLabel);

CreateNavButton (Window winParent, string buttonLabel) -> PersonaNavButtonWindow


local PersonaNavButtonWindow newButton;


newButton = PersonaNavButtonWindow(winParent.NewChild(Class'PersonaNavButtonWindow'));
newButton.SetButtonText(buttonLabel);

return newButton;

DrawBackground (GC gc)


gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawTexture(backgroundOffsetX, backgroundOffsetY, 256, 21, 0, 0, texBackgrounds[0]);
gc.DrawTexture(backgroundOffsetX + 256, backgroundOffsetY, 256, 21, 0, 0, texBackgrounds[1]);
gc.DrawTexture(backgroundOffsetX + 512, backgroundOffsetY, 97, 21, 0, 0, texBackgrounds[2]);

DrawBorder (GC gc)


if (bDrawBorder)
{
gc.SetStyle(borderDrawStyle);
gc.SetTileColor(colBorder);
gc.DrawTexture( 0, 0, 256, height, 0, 0, texBorders[0]);
gc.DrawTexture(256, 0, 256, height, 0, 0, texBorders[1]);
gc.DrawTexture(512, 0, 175, height, 0, 0, texBorders[2]);
}

InitWindow


Super.InitWindow();

// Get a pointer to the root window
root = DeusExRootWindow(GetRootWindow());

SetSize(640, 64);

CreateButtonWindows();
CreateButtons();




PersonaNavBarWindow.uc (extends PersonaNavBarBaseWindow)

var PersonaNavButtonWindow btnInventory;
var PersonaNavButtonWindow btnHealth;
var PersonaNavButtonWindow btnAugs;
var PersonaNavButtonWindow btnSkills;
var PersonaNavButtonWindow btnGoals;
var PersonaNavButtonWindow btnCons;
var PersonaNavButtonWindow btnImages;
var PersonaNavButtonWindow btnLogs;
var localized String InventoryButtonLabel;
var localized String HealthButtonLabel;
var localized String AugsButtonLabel;
var localized String SkillsButtonLabel;
var localized String GoalsButtonLabel;
var localized String ConsButtonLabel;
var localized String ImagesButtonLabel;
var localized String LogsButtonLabel;
InventoryButtonLabel="|&Inventory"
HealthButtonLabel="|&Health"
AugsButtonLabel="|&Augs"
SkillsButtonLabel="|&Skills"
GoalsButtonLabel="|&Goals/Notes"
ConsButtonLabel="|&Conversations"
ImagesButtonLabel="I|&mages"
LogsButtonLabel="|&Logs"

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;
local Class winClass;


bHandled = True;

switch(buttonPressed)
{
case btnInventory:
winClass = Class'PersonaScreenInventory';
break;

case btnHealth:
winClass = Class'PersonaScreenHealth';
break;

case btnAugs:
winClass = Class'PersonaScreenAugmentations';
break;

case btnSkills:
winClass = Class'PersonaScreenSkills';
break;

case btnGoals:
winClass = Class'PersonaScreenGoals';
break;

case btnCons:
winClass = Class'PersonaScreenConversations';
break;

case btnImages:
winClass = Class'PersonaScreenImages';
break;

case btnLogs:
winClass = Class'PersonaScreenLogs';
break;

default:
bHandled = False;
break;
}

if (bHandled)
{
PersonaScreenBaseWindow(GetParent()).SaveSettings();
root.InvokeUIScreen(winClass);
return bHandled;
}
else
{
return Super.ButtonActivated(buttonPressed);
}

CreateButtons


btnLogs = CreateNavButton(winNavButtons, LogsButtonLabel);
btnImages = CreateNavButton(winNavButtons, ImagesButtonLabel);
btnCons = CreateNavButton(winNavButtons, ConsButtonLabel);
btnGoals = CreateNavButton(winNavButtons, GoalsButtonLabel);
btnSkills = CreateNavButton(winNavButtons, SkillsButtonLabel);
btnAugs = CreateNavButton(winNavButtons, AugsButtonLabel);
btnHealth = CreateNavButton(winNavButtons, HealthButtonLabel);
btnInventory = CreateNavButton(winNavButtons, InventoryButtonLabel);

Super.CreateButtons();




PersonaNavButtonWindow.uc (extends PersonaActionButtonWindow)

bBaseWidthOnText=True
bCenterText=True

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

bTranslucent = player.GetHUDBackgroundTranslucency();

colButtonFace = theme.GetColorFromName('HUDColor_ButtonFace');

// Normal button color
colText[0] = theme.GetColorFromName('HUDColor_ButtonTextNormal');

// Focus, pressed
colText[1] = colText[0];
colText[2] = theme.GetColorFromName('HUDColor_ButtonTextFocus');

// Disabled button
colText[3] = theme.GetColorFromName('HUDColor_ButtonTextFocus');




PersonaNormalLargeTextWindow.uc (extends LargeTextWindow)

var DeusExPlayer player;
var Font fontText;
fontText=Font'DeusExUI.FontMenuSmall'

InitWindow


Super.InitWindow();

SetFont(fontText);
SetTextMargins(0, 0);
SetTextAlignments(HALIGN_Left, VALIGN_Center);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;
local Color colText;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colText = theme.GetColorFromName('HUDColor_NormalText');

SetTextColor(colText);




PersonaNormalTextWindow.uc (extends TextWindow)

var DeusExPlayer player;
var Font fontText;
fontText=Font'DeusExUI.FontMenuSmall'

InitWindow


Super.InitWindow();

SetFont(fontText);
SetTextMargins(0, 0);
SetTextAlignments(HALIGN_Left, VALIGN_Center);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;
local Color colText;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colText = theme.GetColorFromName('HUDColor_NormalText');

SetTextColor(colText);




PersonaNotesEditWindow.uc (extends PersonaEditWindow)

var Color colBracket;
var Texture texBordersNormal[9];
var Texture texBordersFocus[9];
texBordersNormal(0)=Texture'DeusExUI.UserInterface.PersonaNoteNormal_TL'
texBordersNormal(1)=Texture'DeusExUI.UserInterface.PersonaNoteNormal_TR'
texBordersNormal(2)=Texture'DeusExUI.UserInterface.PersonaNoteNormal_BL'
texBordersNormal(3)=Texture'DeusExUI.UserInterface.PersonaNoteNormal_BR'
texBordersNormal(4)=Texture'DeusExUI.UserInterface.PersonaNoteNormal_Left'
texBordersNormal(5)=Texture'DeusExUI.UserInterface.PersonaNoteNormal_Right'
texBordersNormal(6)=Texture'DeusExUI.UserInterface.PersonaNoteNormal_Top'
texBordersNormal(7)=Texture'DeusExUI.UserInterface.PersonaNoteNormal_Bottom'
texBordersNormal(8)=Texture'DeusExUI.UserInterface.PersonaNoteNormal_Center'
texBordersFocus(0)=Texture'DeusExUI.UserInterface.PersonaNoteFocus_TL'
texBordersFocus(1)=Texture'DeusExUI.UserInterface.PersonaNoteFocus_TR'
texBordersFocus(2)=Texture'DeusExUI.UserInterface.PersonaNoteFocus_BL'
texBordersFocus(3)=Texture'DeusExUI.UserInterface.PersonaNoteFocus_BR'
texBordersFocus(4)=Texture'DeusExUI.UserInterface.PersonaNoteFocus_Left'
texBordersFocus(5)=Texture'DeusExUI.UserInterface.PersonaNoteFocus_Right'
texBordersFocus(6)=Texture'DeusExUI.UserInterface.PersonaNoteFocus_Top'
texBordersFocus(7)=Texture'DeusExUI.UserInterface.PersonaNoteFocus_Bottom'
texBordersFocus(8)=Texture'DeusExUI.UserInterface.PersonaNoteFocus_Center'

DrawWindow (GC gc)


// Draw the Gamma Scale
gc.SetTileColor(colBracket);
gc.SetStyle(DSTY_Masked);

// Draw background
gc.DrawBorders(0, 0, width, height, 0, 0, 0, 0, texBordersNormal);

FilterChar (out string chStr) -> bool


return (chStr != "\\");

GetNote -> DeusExNote


return DeusExNote(GetClientObject());

InitWindow


Super.InitWindow();

SetTextMargins(10, 5);

SetNote (DeusExNote newNote)


SetClientObject(newNote);

SetText( newNote.text );

StyleChanged


local ColorTheme theme;


Super.StyleChanged();

theme = player.ThemeManager.GetCurrentHUDColorTheme();

colBracket = theme.GetColorFromName('HUDColor_HeaderText');




PersonaOverlaysWindow.uc (extends PersonaBaseWindow)

var int defaultSizeX;
var int defaultSizeY;
var Texture overlayTextures[2];

DrawBackground (GC gc)


// Draw window background
gc.SetStyle(backgroundDrawStyle);
gc.SetTileColor(colBackground);
gc.DrawTexture(0, 0, defaultSizeX, 256, 0, 0, overlayTextures[0]);
gc.DrawTexture(0, 256, defaultSizeX, (defaultSizeY - 256), 0, 0, overlayTextures[1]);

InitWindow


Super.InitWindow();

SetSize(defaultSizeX, defaultSizeY);




PersonaScreenAugmentations.uc (extends PersonaScreenBaseWindow)

var PersonaActionButtonWindow btnActivate;
var PersonaActionButtonWindow btnUpgrade;
var PersonaActionButtonWindow btnUseCell;
var PersonaInfoWindow winInfo;
var PersonaAugmentationBodyWindow winBody;
var PersonaAugmentationOverlaysWindow winOverlays;
var PersonaItemDetailWindow winBioCells;
var PersonaItemDetailWindow winAugCans;
var ProgressBarWindow winBioEnergy;
var TextWindow winBioEnergyText;
var Augmentation selectedAug;
var PersonaItemButton selectedAugButton;
var int x;
var int y;
var AugLoc_S augLocs[7];
var PersonaAugmentationItemButton augItems[12];
var Texture augHighlightTextures[6];
var Window augHighlightWindows[6];
var int augSlotSpacingX;
var int augSlotSpacingY;
var Color colBarBack;
var localized String AugmentationsTitleText;
var localized String UpgradeButtonLabel;
var localized String ActivateButtonLabel;
var localized String DeactivateButtonLabel;
var localized String UseCellButtonLabel;
var localized String AugCanUseText;
var localized String BioCellUseText;
var Localized string AugLocationDefault;
var Localized string AugLocationCranial;
var Localized string AugLocationEyes;
var Localized string AugLocationArms;
var Localized string AugLocationLegs;
var Localized string AugLocationTorso;
var Localized string AugLocationSubdermal;
AugLocs(0)=(X=56,Y=38)
AugLocs(1)=(X=211,Y=38)
AugLocs(2)=(X=246,Y=120)
AugLocs(3)=(X=18,Y=114)
AugLocs(4)=(X=246,Y=322)
AugLocs(5)=(X=18,Y=198)
AugLocs(6)=(X=18,Y=341)
augHighlightTextures(0)=Texture'DeusExUI.UserInterface.AugmentationsLocationCerebral'
augHighlightTextures(1)=Texture'DeusExUI.UserInterface.AugmentationsLocationEyes'
augHighlightTextures(2)=Texture'DeusExUI.UserInterface.AugmentationsLocationTorso'
augHighlightTextures(3)=Texture'DeusExUI.UserInterface.AugmentationsLocationArms'
augHighlightTextures(4)=Texture'DeusExUI.UserInterface.AugmentationsLocationLegs'
augHighlightTextures(5)=Texture'DeusExUI.UserInterface.AugmentationsLocationSubdermal'
augSlotSpacingX=53
augSlotSpacingY=59
AugmentationsTitleText="Augmentations"
UpgradeButtonLabel="|&Upgrade"
ActivateButtonLabel="Acti|&vate"
DeactivateButtonLabel="Deac|&tivate"
UseCellButtonLabel="Us|&e Cell"
AugCanUseText="To upgrade an Augmentation, click on the Augmentation you wish to upgrade, then on the Upgrade button."
BioCellUseText="To replenish Bioelectric Energy for your Augmentations, click on the Use Cell button."
AugLocationDefault="Default"
AugLocationCranial="Cranial"
AugLocationEyes="Eyes"
AugLocationArms="Arms"
AugLocationLegs="Legs"
AugLocationTorso="Torso"
AugLocationSubdermal="Subdermal"
clientBorderOffsetY=32
ClientWidth=596
ClientHeight=427
clientOffsetX=25
clientOffsetY=5
clientTextures(0)=Texture'DeusExUI.UserInterface.AugmentationsBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.AugmentationsBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.AugmentationsBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.AugmentationsBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.AugmentationsBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.AugmentationsBackground_6'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.AugmentationsBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.AugmentationsBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.AugmentationsBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.AugmentationsBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.AugmentationsBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.AugmentationsBorder_6'
clientTextureRows=2
clientTextureCols=3
clientBorderTextureRows=2
clientBorderTextureCols=3

ActivateAugmentation


if (selectedAug == None)
return;

if (selectedAug.IsActive())
selectedAug.Deactivate();
else
selectedAug.Activate();

// If the augmentation activated or deactivated, set the
// button appropriately.

if (selectedAugButton != None)
PersonaAugmentationItemButton(selectedAugButton).SetActive(selectedAug.IsActive());

selectedAug.UpdateInfo(winInfo);

EnableButtons();

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


if (Super.ButtonActivated(buttonPressed))
return True;

bHandled = True;

// Check if this is one of our Augmentation buttons
if (buttonPressed.IsA('PersonaItemButton'))
{
SelectAugmentation(PersonaItemButton(buttonPressed));
}
else
{
switch(buttonPressed)
{
case btnUpgrade:
UpgradeAugmentation();
break;

case btnActivate:
ActivateAugmentation();
break;

case btnUseCell:
UseCell();
break;

default:
bHandled = False;
break;
}
}

return bHandled;

CreateAugButton (Augmentation anAug, int augX, int augY, int slotIndex) -> PersonaAugmentationItemButton


local PersonaAugmentationItemButton newButton;


newButton = PersonaAugmentationItemButton(winClient.NewChild(Class'PersonaAugmentationItemButton'));
newButton.SetPos(augX, augY);
newButton.SetClientObject(anAug);
newButton.SetIcon(anAug.icon);

// set the hotkey number
if (!anAug.bAlwaysActive)
newButton.SetHotkeyNumber(anAug.GetHotKey());

// If the augmentation is currently active, notify the button
newButton.SetActive(anAug.IsActive());
newButton.SetLevel(anAug.GetCurrentLevel());

return newButton;

CreateAugCanWindow


winAugCans = PersonaItemDetailWindow(winClient.NewChild(Class'PersonaItemDetailWindow'));
winAugCans.SetPos(346, 274);
winAugCans.SetWidth(242);
winAugCans.SetIcon(Class'AugmentationUpgradeCannister'.Default.LargeIcon);
winAugCans.SetIconSize(
Class'AugmentationUpgradeCannister'.Default.largeIconWidth,
Class'AugmentationUpgradeCannister'.Default.largeIconHeight);

UpdateAugCans();

CreateAugmentationButtons


local Augmentation anAug;
local int augX, augY;
local int torsoCount;
local int skinCount;
local int defaultCount;
local int slotIndex;
local int augCount;


augCount = 0;
torsoCount = 0;
skinCount = 0;
defaultCount = 0;

// Iterate through the augmentations, creating a unique button for each
anAug = player.AugmentationSystem.FirstAug;
while(anAug != None)
{
if (( anAug.AugmentationName != "" ) && ( anAug.bHasIt ))
{
slotIndex = 0;
augX = augLocs[int(anAug.AugmentationLocation)].x;
augY = augLocs[int(anAug.AugmentationLocation)].y;

// Show the highlight graphic for this augmentation slot as long
// as it's not the Default slot (for which there is no graphic)

if (anAug.AugmentationLocation < arrayCount(augHighlightWindows))
augHighlightWindows[anAug.AugmentationLocation].Show();

if (int(anAug.AugmentationLocation) == 2) // Torso
{
slotIndex = torsoCount;
augY += (torsoCount++ * augSlotSpacingY);
}

if (int(anAug.AugmentationLocation) == 5) // Subdermal
{
slotIndex = skinCount;
augY += (skinCount++ * augSlotSpacingY);
}

if (int(anAug.AugmentationLocation) == 6) // Default
augX += (defaultCount++ * augSlotSpacingX);

augItems[augCount] = CreateAugButton(anAug, augX, augY, slotIndex);

// If the augmentation is active, make sure the button draws it
// appropriately

augItems[augCount].SetActive(anAug.IsActive());

augCount++;
}

anAug = anAug.next;
}

CreateAugmentationHighlights


augHighlightWindows[0] = CreateHighlight(augHighlightTextures[0], 142, 45, 16, 19);
augHighlightWindows[1] = CreateHighlight(augHighlightTextures[1], 161, 63, 19, 12);
augHighlightWindows[2] = CreateHighlight(augHighlightTextures[2], 157, 108, 34, 48);
augHighlightWindows[3] = CreateHighlight(augHighlightTextures[3], 105, 110, 24, 43);
augHighlightWindows[4] = CreateHighlight(augHighlightTextures[4], 165, 222, 32, 94);
augHighlightWindows[5] = CreateHighlight(augHighlightTextures[5], 84, 160, 14, 36);

CreateAugmentationLabels


CreateLabel( 57, 27, AugLocationCranial);
CreateLabel(212, 27, AugLocationEyes);
CreateLabel( 19, 103, AugLocationArms);
CreateLabel( 19, 187, AugLocationSubdermal);
CreateLabel(247, 109, AugLocationTorso);
CreateLabel( 19, 330, AugLocationDefault);
CreateLabel(247, 311, AugLocationLegs);

CreateBioCellBar


winBioEnergy = ProgressBarWindow(winClient.NewChild(Class'ProgressBarWindow'));

winBioEnergy.SetPos(446, 389);
winBioEnergy.SetSize(140, 12);
winBioEnergy.SetValues(0, 100);
winBioEnergy.UseScaledColor(True);
winBioEnergy.SetVertical(False);
winBioEnergy.SetScaleColorModifier(0.5);
winBioEnergy.SetDrawBackground(True);
winBioEnergy.SetBackColor(colBarBack);

winBioEnergyText = TextWindow(winClient.NewChild(Class'TextWindow'));
winBioEnergyText.SetPos(446, 391);
winBioEnergyText.SetSize(140, 12);
winBioEnergyText.SetTextMargins(0, 0);
winBioEnergyText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winBioEnergyText.SetFont(Font'FontMenuSmall_DS');
winBioEnergyText.SetTextColorRGB(255, 255, 255);

UpdateBioEnergyBar();

CreateBioCellWindow


winBioCells = PersonaItemDetailWindow(winClient.NewChild(Class'PersonaItemDetailWindow'));
winBioCells.SetPos(346, 332);
winBioCells.SetWidth(242);
winBioCells.SetIcon(Class'BioelectricCell'.Default.LargeIcon);
winBioCells.SetIconSize(
Class'BioelectricCell'.Default.largeIconWidth,
Class'BioelectricCell'.Default.largeIconHeight);

UpdateBioCells();

CreateBodyWindow


winBody = PersonaAugmentationBodyWindow(winClient.NewChild(Class'PersonaAugmentationBodyWindow'));
winBody.SetPos(72, 28);
winBody.Lower();

CreateButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(13, 407);
winActionButtons.SetWidth(187);
winActionButtons.FillAllSpace(False);

btnUpgrade = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnUpgrade.SetButtonText(UpgradeButtonLabel);

btnActivate = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnActivate.SetButtonText(ActivateButtonLabel);

winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(346, 387);
winActionButtons.SetWidth(97);
winActionButtons.FillAllSpace(False);

btnUseCell = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnUseCell.SetButtonText(UseCellButtonLabel);

CreateControls


Super.CreateControls();

CreateTitleWindow(9, 5, AugmentationsTitleText);
CreateInfoWindow();
CreateButtons();
CreateAugmentationLabels();
CreateAugmentationHighlights();
CreateAugmentationButtons();
CreateOverlaysWindow();
CreateBodyWindow();
CreateBioCellBar();
CreateAugCanWindow();
CreateBioCellWindow();
CreateStatusWindow();

PersonaNavBarWindow(winNavBar).btnAugs.SetSensitivity(False);

CreateInfoWindow


winInfo = PersonaInfoWindow(winClient.NewChild(Class'PersonaInfoWindow'));
winInfo.SetPos(348, 14);
winInfo.SetSize(238, 218);

CreateLabel (int posX, int posY, String strLabel)


local PersonaNormalTextWindow winLabel;


winLabel = PersonaNormalTextWindow(winClient.NewChild(Class'PersonaNormalTextWindow'));
winLabel.SetPos(posX, posY);
winLabel.SetSize(52, 11);
winLabel.SetText(strLabel);
winLabel.SetTextMargins(2, 1);

CreateOverlaysWindow


winOverlays = PersonaAugmentationOverlaysWindow(winClient.NewChild(Class'PersonaAugmentationOverlaysWindow'));
winOverlays.SetPos(72, 28);
winOverlays.Lower();

CreateStatusWindow


winStatus = PersonaStatusLineWindow(winClient.NewChild(Class'PersonaStatusLineWindow'));
winStatus.SetPos(348, 240);

EnableButtons


// Upgrade can only be enabled if the player has an
// AugmentationUpgradeCannister that allows this augmentation to
// be upgraded

if (selectedAug != None)
btnUpgrade.EnableWindow(selectedAug.CanBeUpgraded());
else
btnUpgrade.EnableWindow(False);

// Only allow btnActivate to be active if
//
// 1. We have a selected augmentation
// 2. The player's energy is above 0
// 3. This augmentation isn't "AlwaysActive"

btnActivate.EnableWindow((selectedAug != None) && (player.Energy > 0) && (!selectedAug.IsAlwaysActive()));

if ( selectedAug != None )
{
if ( selectedAug.bIsActive )
btnActivate.SetButtonText(DeactivateButtonLabel);
else
btnActivate.SetButtonText(ActivateButtonLabel);
}

// Use Cell button
//
// Only active if the player has one or more Energy Cells and
// BioElectricEnergy < 100%

btnUseCell.EnableWindow(
(player.Energy < player.EnergyMax) &&
(player.FindInventoryType(Class'BioelectricCell') != None));

InitWindow


Super.InitWindow();

EnableButtons();

RefreshWindow (float DeltaTime)


UpdateAugCans();
UpdateBioCells();
UpdateBioEnergyBar();

if (selectedAugButton != None)
{
PersonaAugmentationItemButton(selectedAugButton).SetLevel(selectedAug.GetCurrentLevel());
PersonaAugmentationItemButton(selectedAugButton).SetActive(selectedAug.IsActive());
}


EnableButtons();

Super.RefreshWindow(DeltaTime);

SelectAugByKey (int keyNum)


local int buttonIndex;
local Augmentation anAug;


for(buttonIndex=0; buttonIndex {
if (augItems[buttonIndex] != None)
{
anAug = Augmentation(augItems[buttonIndex].GetClientObject());

if ((anAug != None) && (anAug.HotKeyNum - 3 == keyNum))
{
SelectAugmentation(augItems[buttonIndex]);
ActivateAugmentation();
break;
}
}
}

SelectAugmentation (PersonaItemButton buttonPressed)


// Don't do extra work.
if (selectedAugButton != buttonPressed)
{
// Deselect current button
if (selectedAugButton != None)
selectedAugButton.SelectButton(False);

selectedAugButton = buttonPressed;
selectedAug = Augmentation(selectedAugButton.GetClientObject());

selectedAug.UpdateInfo(winInfo);
selectedAugButton.SelectButton(True);

EnableButtons();
}

UpdateAugCans


local Inventory anItem;
local int augCanCount;


if (winAugCans != None)
{
winAugCans.SetText(AugCanUseText);

// Loop through the player's inventory and count how many upgrade cans
// the player has
anItem = player.Inventory;

while(anItem != None)
{
if (anItem.IsA('AugmentationUpgradeCannister'))
augCanCount++;

anItem = anItem.Inventory;
}

winAugCans.SetCount(augCanCount);
}

UpdateBioCells


local BioelectricCell bioCell;


if (winBioCells != None)
{
winBioCells.SetText(BioCellUseText);

bioCell = BioelectricCell(player.FindInventoryType(Class'BioelectricCell'));

if (bioCell != None)
winBioCells.SetCount(bioCell.NumCopies);
else
winBioCells.SetCount(0);
}

UpdateBioEnergyBar();

UpdateBioEnergyBar


local float energyPercent;


energyPercent = 100.0 * (player.Energy / player.EnergyMax);

winBioEnergy.SetCurrentValue(energyPercent);
winBioEnergyText.SetText(String(Int(energyPercent)) $ "%");

UpgradeAugmentation


local AugmentationUpgradeCannister augCan;


// First make sure we have a selected Augmentation
if (selectedAug == None)
return;

// Now check to see if we have an upgrade cannister
augCan = AugmentationUpgradeCannister(player.FindInventoryType(Class'AugmentationUpgradeCannister'));

if (augCan != None)
{
// Increment the level and remove the aug cannister from
// the player's inventory

selectedAug.IncLevel();
selectedAug.UpdateInfo(winInfo);

augCan.UseOnce();

// Update the level icons
if (selectedAugButton != None)
PersonaAugmentationItemButton(selectedAugButton).SetLevel(selectedAug.GetCurrentLevel());
}

UpdateAugCans();
EnableButtons();

UseCell


local BioelectricCell bioCell;


bioCell = BioelectricCell(player.FindInventoryType(Class'BioelectricCell'));

if (bioCell != None)
bioCell.Activate();

UpdateBioCells();
EnableButtons();

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;

bKeyHandled = True;

if (Super.VirtualKeyPressed(key, bRepeat))
return True;

switch( key )
{
case IK_F3:
SelectAugByKey(0);
break;
case IK_F4:
SelectAugByKey(1);
break;
case IK_F5:
SelectAugByKey(2);
break;
case IK_F6:
SelectAugByKey(3);
break;
case IK_F7:
SelectAugByKey(4);
break;
case IK_F8:
SelectAugByKey(5);
break;
case IK_F9:
SelectAugByKey(6);
break;
case IK_F10:
SelectAugByKey(7);
break;
case IK_F11:
SelectAugByKey(8);
break;
case IK_F12:
SelectAugByKey(9);
break;

// Enter will toggle an aug on/off
case IK_Enter:
ActivateAugmentation();
break;

default:
bKeyHandled = False;
break;
}

return bKeyHandled;




PersonaScreenBaseWindow.uc (extends DeusExBaseWindow)

var PersonaClientWindow winClient; // Window that contains all controls
var PersonaNavBarBaseWindow winNavBar; // Navigation Button Bar
var PersonaTitleTextWindow txtTitle; // Title Bar Text
var PersonaClientBorderWindow winClientBorder; // Border around client window
var PersonaStatusLineWindow winStatus;
var int screenWidth;
var int screenHeight;
var int clientBorderWidth;
var int clientBorderHeight;
var int clientBorderOffsetX;
var int clientBorderOffsetY;
var int clientWidth;
var int clientHeight;
var int clientOffsetX;
var int clientOffsetY;
var Texture clientTextures[6];
var Texture clientBorderTextures[6];
var int clientTextureRows;
var int clientTextureCols;
var int clientBorderTextureRows;
var int clientBorderTextureCols;
screenWidth=640
screenHeight=480
clientBorderWidth=640
clientBorderHeight=450
clientBorderOffsetY=30
ScreenType=ST_Persona

AddLog (String logText)


if (winStatus != None)
winStatus.AddText(logText);

CreateClientBorderWindow


local int clientBorderIndex;


winClientBorder = PersonaClientBorderWindow(NewChild(class'PersonaClientBorderWindow'));

winClientBorder.SetPos(clientBorderOffsetX, clientBorderOffsetY);
winClientBorder.SetSize(clientBorderWidth, clientBorderHeight);
winClientBorder.SetTextureLayout(clientBorderTextureCols, clientBorderTextureRows);

// Set background textures
for(clientBorderIndex=0; clientBorderIndex {
winClientBorder.SetClientTexture(clientBorderIndex, clientBorderTextures[clientBorderIndex]);
}

CreateClientWindow


local int clientIndex;


winClient = PersonaClientWindow(NewChild(class'PersonaClientWindow'));

winClient.SetPos(clientBorderOffsetX + clientOffsetX, clientBorderOffsetY + clientOffsetY);
winClient.SetSize(clientWidth, clientHeight);
winClient.SetTextureLayout(clientTextureCols, clientTextureRows);

// Set background textures
for(clientIndex=0; clientIndex {
winClient.SetClientTexture(clientIndex, clientTextures[clientIndex]);
}

CreateControls


CreateNavBarWindow();
CreateClientBorderWindow();
CreateClientWindow();

CreateNavBarWindow


winNavBar = PersonaNavBarBaseWindow(NewChild(Class'PersonaNavBarWindow'));
winNavBar.SetPos(0, 0);

CreatePersonaHeaderText (int posX, int posY, String strHeader, Window winParent) -> PersonaHeaderTextWindow


local PersonaHeaderTextWindow newHeader;


newHeader = PersonaHeaderTextWindow(winParent.NewChild(Class'PersonaHeaderTextWindow'));

newHeader.SetPos(posX, posY);
newHeader.SetText(strHeader);

return newHeader;

CreateScrollAreaWindow (Window winParent) -> PersonaScrollAreaWindow


return PersonaScrollAreaWindow(winParent.NewChild(Class'PersonaScrollAreaWindow'));

CreateTileWindow (Window parent) -> TileWindow


local TileWindow tileWindow;


// Create Tile Window inside the scroll window
tileWindow = TileWindow(parent.NewChild(Class'TileWindow'));
tileWindow.SetFont(Font'FontMenuSmall');
tileWindow.SetOrder(ORDER_Down);
tileWindow.SetChildAlignments(HALIGN_Full, VALIGN_Top);
tileWindow.MakeWidthsEqual(False);
tileWindow.MakeHeightsEqual(False);

return tileWindow;

CreateTitleWindow (int posX, int posY, String titleText) -> PersonaTitleTextWindow


local PersonaTitleTextWindow winTitle;


winTitle = PersonaTitleTextWindow(winClient.NewChild(Class'PersonaTitleTextWindow'));
winTitle.SetPos(posX, posY);
winTitle.SetText(titleText);

return winTitle;

DestroyWindow


local int texIndex;


for(texIndex=0; texIndex player.UnloadTexture(clientTextures[texIndex]);

for(texIndex=0; texIndex player.UnloadTexture(clientBorderTextures[texIndex]);

Super.DestroyWindow();

InitWindow


Super.InitWindow();

SetMouseFocusMode(MFOCUS_Click);

SetSize(screenWidth, screenHeight);

CreateControls();

// Play Menu Activated Sound

// TODO: Replace Menu sounds with HUD sounds
PlaySound(Sound'Menu_Activate', 0.25);

StyleChanged();

SaveSettings


// Play OK Sound
// TODO: Change Menu sounds to HUD sounds
PlaySound(Sound'Menu_OK', 0.25);

StyleChanged


local ColorTheme theme;
local Color colCursor;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

colCursor = theme.GetColorFromName('HUDColor_Cursor');

SetDefaultCursor(Texture'DeusExCursor2', Texture'DeusExCursor2_Shadow', 32, 32, colCursor);

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;

bKeyHandled = True;

if ( IsKeyDown( IK_Alt ) || IsKeyDown( IK_Shift ) || IsKeyDown( IK_Ctrl ))
return False;

switch( key )
{
case IK_Escape:
SaveSettings();
root.PopWindow();
break;

default:
bKeyHandled = False;
}

if (bKeyHandled)
return bKeyHandled;
else
return Super.VirtualKeyPressed(key, bRepeat);




PersonaScreenConversations.uc (extends PersonaScreenBaseWindow)

var localized String ConversationsTitleText;
var PersonaListWindow lstCons;
var PersonaScrollAreaWindow winScroll;
var TileWindow conWindow;
var int sortColumn;
var Bool bSortReverse;
var PersonaActionButtonWindow btnActor;
var PersonaActionButtonWindow btnLocation;
var PersonaActionButtonWindow btnType;
var localized string ActorButtonLabel;
var localized string LocationButtonLabel;
var localized string TypeButtonLabel;
ConversationsTitleText="Conversations"
ActorButtonLabel="Contact"
LocationButtonLabel="Location"
TypeButtonLabel="Type"
ClientWidth=426
ClientHeight=407
clientOffsetX=105
clientOffsetY=17
clientTextures(0)=Texture'DeusExUI.UserInterface.ConversationsBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ConversationsBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.ConversationsBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.ConversationsBackground_4'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.ConversationsBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.ConversationsBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.ConversationsBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.ConversationsBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.ConversationsBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.ConversationsBorder_6'
clientTextureRows=2
clientTextureCols=2
clientBorderTextureRows=2
clientBorderTextureCols=3

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


if (Super.ButtonActivated(buttonPressed))
return True;

bHandled = True;

switch(buttonPressed)
{
case btnActor:
SetSortColumn(0);
break;

case btnLocation:
SetSortColumn(1);
break;

case btnType:
SetSortColumn(2);
break;

default:
bHandled = False;
break;
}

return bHandled;

CreateButtons


local PersonaButtonBarWindow winButtonBar;


winButtonBar = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winButtonBar.SetPos(14, 19);
winButtonBar.SetWidth(402);
winButtonBar.FillAllSpace(False);

btnType = CreateBarButton(winButtonBar, 46, TypeButtonLabel);
btnLocation = CreateBarButton(winButtonBar, 194, LocationButtonLabel);
btnActor = CreateBarButton(winButtonBar, 162, ActorButtonLabel);

CreateControls


Super.CreateControls();

CreateTitleWindow(9, 5, ConversationsTitleText);

CreateConversationWindow();
CreateHistoryListWindow();
CreateButtons();

CreateConversationWindow


conWindow = CreateScrollTileWindow(16, 190, 394, 204);

CreateHistoryListWindow


sortColumn = 0;
bSortReverse = False;

winScroll = CreateScrollAreaWindow(winClient);
winScroll.SetPos(16, 38);
winScroll.SetSize(395, 133);

lstCons = PersonaListWindow(winScroll.clipWindow.NewChild(Class'PersonaListWindow'));
lstCons.EnableMultiSelect(False);
lstCons.SetNumColumns(3);
lstCons.SetSortColumn(sortColumn, bSortReverse);
lstCons.EnableAutoSort(False);
lstCons.SetColumnWidth(0, 161);
lstCons.SetColumnWidth(1, 194);
lstCons.SetColumnWidth(2, 40);
lstCons.SetColumnFont(2, Font'FontHUDWingDings');
lstCons.SetColumnAlignment(2, HALIGN_Center);

DisplayHistory (ConHistory history)


local ConHistoryEvent event;
local PersonaHeaderTextWindow txtName;
local PersonaNormalTextWindow txtSpeech;


// First clear out any existing windows in the tile window
conWindow.DestroyAllChildren();

// Now loop through all the events, creating a TextWindow
// for each.

event = history.firstEvent;
while(event != None)
{
// First create a window for the name
txtName = PersonaHeaderTextWindow(conWindow.NewChild(Class'PersonaHeaderTextWindow'));
txtName.SetTextMargins(5, 2);
txtName.SetText(event.conSpeaker);

// Now create a window for the text
txtSpeech = PersonaNormalTextWindow(conWindow.NewChild(Class'PersonaNormalTextWindow'));
txtSpeech.SetTextMargins(10, 2);
txtSpeech.SetText(event.speech);

// If there's another event, create an empty window for spacing
if (event.next != None)
{
txtSpeech = PersonaNormalTextWindow(conWindow.NewChild(Class'PersonaNormalTextWindow'));
txtSpeech.SetSize(10, 5);
txtSpeech.SetSensitivity(False); // Can't be selected
}

// Continue on to the next event
event = event.next;
}

InitWindow


Super.InitWindow();

PersonaNavBarWindow(winNavBar).btnCons.SetSensitivity(False);

PopulateConversations();

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


local ConHistory history;


history = ConHistory(ListWindow(list).GetRowClientObject(focusRowId));
DisplayHistory(history);

return True;

PopulateConversations


local ConHistory history;
local int rowIndex;


// Now loop through all the conversations and add them to the list
history = player.ConHistory;

while( history != None )
{
rowIndex = lstCons.AddRow( history.conOwnerName $ ";" $ history.strLocation );

if (history.bInfoLink)
lstCons.SetField(rowIndex, 2, "B");
else
lstCons.SetField(rowIndex, 2, "A");

lstCons.SetRowClientObject(rowIndex, history);

history = history.next;
}

SetSortColumn (int newSortColumn)


if (newSortColumn == sortColumn)
bSortReverse = !bSortReverse;
else
bSortReverse = False;

sortColumn = newSortColumn;

lstCons.ResetSortColumns(False);
lstCons.SetSortColumn(newSortColumn, bSortReverse);

// Update the button

lstCons.Sort();




PersonaScreenGoals.uc (extends PersonaScreenBaseWindow)

var TileWindow winGoals;
var PersonaCheckBoxWindow chkShowCompletedGoals;
var Bool bDisplayCompletedGoals;
var localized String GoalsTitleText;
var localized String PrimaryGoalsHeader;
var localized String SecondaryGoalsHeader;
var localized String DisplayCompletedGoals;
var localized String NoGoalsLabel;
var localized String GoalCompletedText;
var TileWindow winNotes;
var PersonaCheckBoxWindow chkConfirmNoteDeletion;
var Bool bConfirmNoteDeletes;
var localized String NotesTitleText;
var PersonaActionButtonWindow btnAddNote;
var PersonaActionButtonWindow btnDeleteNote;
var PersonaNotesEditWindow currentNoteWindow;
var PersonaNotesEditWindow firstNoteWindow;
var localized string defaultNoteText;
var localized string ClickToEditNote;
var localized string DeleteNoteTitle;
var localized string DeleteNotePrompt;
var localized string AddButtonLabel;
var localized string DeleteButtonLabel;
var localized string ConfirmNoteDeletionLabel;
GoalsTitleText="Goals"
PrimaryGoalsHeader="Primary Goals"
SecondaryGoalsHeader="Secondary Goals"
DisplayCompletedGoals="Display C|&ompleted Goals"
NoGoalsLabel="None"
GoalCompletedText="[Completed]"
NotesTitleText="Notes"
defaultNoteText="New Note"
ClickToEditNote="Click on a Note to edit it:"
DeleteNoteTitle="Delete Note?"
DeleteNotePrompt="Are you sure you wish to delete this note?"
AddButtonLabel="Add |&Note"
DeleteButtonLabel="|&Delete Note"
ConfirmNoteDeletionLabel="Confirm Note Deletion"
clientBorderOffsetY=29
ClientWidth=604
ClientHeight=433
clientOffsetX=15
clientOffsetY=10
clientTextures(0)=Texture'DeusExUI.UserInterface.GoalsBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.GoalsBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.GoalsBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.GoalsBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.GoalsBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.GoalsBackground_6'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.GoalsBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.GoalsBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.GoalsBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.GoalsBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.GoalsBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.GoalsBorder_6'
clientTextureRows=2
clientTextureCols=3
clientBorderTextureRows=2
clientBorderTextureCols=3

AddNote


local DeusExNote newNote;
local PersonaNotesEditWindow newNoteWindow;


// Create a new note and then a window to display it in
newNote = player.AddNote(defaultNoteText, True);

newNoteWindow = CreateNoteEditWindow(newNote);
newNoteWindow.Lower();
newNoteWindow.SetSelectedArea(0, Len(defaultNoteText));
SetFocusWindow(newNoteWindow);

BoxOptionSelected (Window msgBoxWindow, int buttonNumber) -> bool


// Nuke the msgbox
root.PopWindow();

if ( buttonNumber == 0 )
{
DeleteNote(currentNoteWindow);
currentNoteWindow = None;
EnableButtons();
}

return true;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


if (Super.ButtonActivated(buttonPressed))
return True;

bHandled = True;

switch(buttonPressed)
{
case btnAddNote:
AddNote();
break;

case btnDeleteNote:
if (bConfirmNoteDeletes)
{
root.MessageBox(DeleteNoteTitle, DeleteNotePrompt, 0, False, Self);
}
else
{
DeleteNote(currentNoteWindow);
currentNoteWindow = None;
EnableButtons();
}
break;

default:
bHandled = False;
break;
}

return bHandled;

CreateConfirmNoteDeletionCheckbox


chkConfirmNoteDeletion = PersonaCheckBoxWindow(winClient.NewChild(Class'PersonaCheckBoxWindow'));

bConfirmNoteDeletes = player.bConfirmNoteDeletes;

chkConfirmNoteDeletion.SetText(ConfirmNoteDeletionLabel);
chkConfirmNoteDeletion.SetToggle(bConfirmNoteDeletes);
chkConfirmNoteDeletion.SetWindowAlignments(HALIGN_Right, VALIGN_Top, 13, 412);

CreateControls


Super.CreateControls();

CreateTitleWindow(9, 5, GoalsTitleText);
CreateTitleWindow(9, 209, NotesTitleText);

winGoals = CreateScrollTileWindow(16, 21, 574, 154);

winNotes = CreateScrollTileWindow(16, 226, 574, 182);
winNotes.SetMinorSpacing(4);

CreateShowCompletedGoalsCheckbox();
CreateNotesButtons();
CreateConfirmNoteDeletionCheckbox();

CreateNoteEditWindow (DeusExNote note) -> PersonaNotesEditWindow


local PersonaNotesEditWindow newNoteWindow;


newNoteWindow = PersonaNotesEditWindow(winNotes.NewChild(Class'PersonaNotesEditWindow'));
newNoteWindow.SetNote(note);

return newNoteWindow;

CreateNotesButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(10, 411);
winActionButtons.SetWidth(179);
winActionButtons.FillAllSpace(False);

btnAddNote = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnAddNote.SetButtonText(AddButtonLabel);

btnDeleteNote = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnDeleteNote.SetButtonText(DeleteButtonLabel);

CreateShowCompletedGoalsCheckbox


chkShowCompletedGoals = PersonaCheckBoxWindow(winClient.NewChild(Class'PersonaCheckBoxWindow'));

bDisplayCompletedGoals = player.bDisplayCompletedGoals;

chkShowCompletedGoals.SetText(DisplayCompletedGoals);
chkShowCompletedGoals.SetToggle(bDisplayCompletedGoals);
chkShowCompletedGoals.SetWindowAlignments(HALIGN_Right, VALIGN_Top, 13, 180);

DeleteNote (PersonaNotesEditWindow noteWindow)


if (noteWindow == None)
return;

// Remove it from the collection
player.DeleteNote(noteWindow.GetNote());

// Now remove it from the list
noteWindow.Destroy();

// Set focus to the Delete button
SetFocusWindow(btnAddNote);

DestroyWindow


player.bDisplayCompletedGoals = bDisplayCompletedGoals;
player.bConfirmNoteDeletes = bConfirmNoteDeletes;
player.SaveConfig();

Super.DestroyWindow();

EnableButtons


btnDeleteNote.SetSensitivity(currentNoteWindow != None);

FocusEnteredDescendant (Window enterWindow)


// Ignore this even if we're deleting
if (PersonaNotesEditWindow(enterWindow) != None)
{
currentNoteWindow = PersonaNotesEditWindow(enterWindow);
EnableButtons();
}

FocusLeftDescendant (Window leaveWindow)


local PersonaNotesEditWindow noteWindow;


noteWindow = PersonaNotesEditWindow(leaveWindow);

if (noteWindow != None)
SaveNote(noteWindow);

InitWindow


Super.InitWindow();

PopulateGoals();
PopulateNotes();

PersonaNavBarWindow(winNavBar).btnGoals.SetSensitivity(False);

// Set focus to the AddNote button
SetFocusWindow(btnAddNote);

EnableButtons();

PopulateGoals


// First clear out any existing goals in the two tile windows
winGoals.DestroyAllChildren();

PopulateGoalsByType(True, PrimaryGoalsHeader);
PopulateGoalsByType(False, SecondaryGoalsHeader);

PopulateGoalsByType (Bool bPrimaryGoals, String goalHeaderText)


local DeusExGoal goal;
local bool bGoalsFound;
local PersonaGoalItemWindow goalWindow;
local PersonaHeaderTextWindow goalHeader;


// Create Goals Header
goalHeader = PersonaHeaderTextWindow(winGoals.NewChild(Class'PersonaHeaderTextWindow'));
goalHeader.SetTextAlignments(HALIGN_Left, VALIGN_Center);
goalHeader.SetText(goalHeaderText);

// Loop through all the Goals
goal = player.FirstGoal;
while( goal != None )
{
// Check if this is a primary or secondary goal as specified
// in the bPrimaryGoals parameter above.

if (bPrimaryGoals == goal.bPrimaryGoal)
{
// Check to see if this goal has already been marked as Completed,
// and if so, only display if the chkShowCompletedGoals is true.

if ((!goal.bCompleted) || ((goal.bCompleted) && (chkShowCompletedGoals.GetToggle())))
{
bGoalsFound = True;

// Now create a window for the text
goalWindow = PersonaGoalItemWindow(winGoals.NewChild(Class'PersonaGoalItemWindow'));

// Set goal properties
if (goal.bCompleted)
goalWindow.SetGoalProperties(goal.bPrimaryGoal, goal.bCompleted, goal.text @ GoalCompletedText);
else
goalWindow.SetGoalProperties(goal.bPrimaryGoal, goal.bCompleted, goal.text);
}
}

// Continue on to the next goal
goal = goal.next;
}

// If there are no goals of this type, then print "None"
if (!bGoalsFound)
{
// Now create a window for the text
goalWindow = PersonaGoalItemWindow(winGoals.NewChild(Class'PersonaGoalItemWindow'));
goalWindow.SetGoalProperties(bPrimaryGoals, True, NoGoalsLabel, True);
}

PopulateNotes


local PersonaNotesEditWindow noteWindow;
local DeusExNote note;
local bool bWasVisible;


// Hide the notes, so we don't flood the tile window with ConfigureChanged() events
bWasVisible = winNotes.IsVisible(FALSE);
winNotes.Hide();

// First make sure there aren't already notes
winNotes.DestroyAllChildren();

// Loop through all the notes
note = player.FirstNote;
while(note != None)
{
noteWindow = CreateNoteEditWindow( note );

if (firstNoteWindow == None)
firstNoteWindow = noteWindow;

// Continue on to the next note
note = note.next;
}

// Show the notes again, if they were visible before
winNotes.Show(bWasVisible);

SaveNote (PersonaNotesEditWindow noteWindow)


local DeusExNote note;


if ( noteWindow.HasTextChanged() )
{
note = noteWindow.GetNote();
note.text = noteWindow.GetText();
noteWindow.ClearTextChangedFlag();
}

ToggleChanged (Window button, bool bNewToggle) -> bool


if (button.IsA('PersonaNotesEditWindow'))
{
EnableButtons();
}
else if (button == chkShowCompletedGoals)
{
bDisplayCompletedGoals = bNewToggle;
PopulateGoals();
}
else if (button == chkConfirmNoteDeletion)
{
bConfirmNoteDeletes = bNewToggle;
}

return True;

WindowReady


// Make sure the most recent note is scrolled to the top
if (firstNoteWindow != None)
firstNoteWindow.AskParentToShowArea();




PersonaScreenHealth.uc (extends PersonaScreenBaseWindow)

var PersonaActionButtonWindow btnHealAll;
var PersonaInfoWindow winInfo;
var PersonaItemDetailWindow winMedKits;
var PersonaHealthItemButton selectedHealthButton;
var PersonaOverlaysWindow winOverlays;
var PersonaHealthBodyWindow winBody;
var PersonaHealthItemButton partButtons[6];
var PersonaHealthRegionWindow regionWindows[6];
var localized String HealthPartDesc[4];
var Float playerHealth[6];
var Bool bShowHealButtons;
var localized String MedKitUseText;
var localized String HealthTitleText;
var localized String HealAllButtonLabel;
var localized String HealthLocationHead;
var localized String HealthLocationTorso;
var localized String HealthLocationRightArm;
var localized String HealthLocationLeftArm;
var localized String HealthLocationRightLeg;
var localized String HealthLocationLeftLeg;
var localized String PointsHealedLabel;
HealthPartDesc(0)="Head wounds are fatal in the vast majority of threat scenarios; however, in those cases where death is not instantaneous, agents will often find that head injuries impair vision and aim. Care should be taken to heal such injuries as quickly as possible or death may result.|n|nLight Wounds: Slightly decreased accuracy.|nMedium Wounds: Wavering vision.|nHeavy Wounds: Death."
HealthPartDesc(1)="The torso is by far the portion of the human anatomy able to absorb the most damage, but it is also the easiest to target in close quarters combat. As progressively more damage is inflicted to the torso, agents may find their movements impaired and eventually bleed to death even if a mortal blow to a vital organ is not suffered.|n|nLight Wounds: Slightly impaired movement.|nMedium Wounds: Significantly impaired movement.|nMajor Wounds: Death."
HealthPartDesc(2)="Obviously damage to the arm is of concern in any combat situation as it has a direct effect on the agent's ability to utilize a variety of weapons. Losing the use of one arm will certainly lower the agent's combat efficiency, while the loss of both arms will render it nearly impossible for an agent to present even a nominal threat to most hostiles.|n|nLight Wounds: Slightly decreased accuracy.|nMedium Wounds: Moderately decreased accuracy.|nMajor Wounds: Significantly decreased accuracy."
HealthPartDesc(3)="Injuries to the leg will result in drastically diminished mobility. If an agent in hostile territory is unfortunate enough to lose the use of both legs but still remain otherwise viable, they are ordered to execute UNATCO Special Operations Order 99009 (Self-Termination).|n|nLight Wounds: Slightly impaired movement.|nMedium Wounds: Moderately impaired movement.|nHeavy Wounds: Significantly impaired movement."
bShowHealButtons=True
MedKitUseText="To heal a specific region of the body, click on the region, then click the Heal button."
HealthTitleText="Health"
HealAllButtonLabel="H|&eal All"
HealthLocationHead="Head"
HealthLocationTorso="Torso"
HealthLocationRightArm="Right Arm"
HealthLocationLeftArm="Left Arm"
HealthLocationRightLeg="Right Leg"
HealthLocationLeftLeg="Left Leg"
PointsHealedLabel="%d points healed"
clientBorderOffsetY=32
ClientWidth=596
ClientHeight=427
clientOffsetX=25
clientOffsetY=5
clientTextures(0)=Texture'DeusExUI.UserInterface.HealthBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.HealthBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.HealthBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.HealthBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.HealthBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.HealthBackground_6'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.HealthBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.HealthBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.HealthBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.HealthBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.HealthBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.HealthBorder_6'
clientTextureRows=2
clientTextureCols=3
clientBorderTextureRows=2
clientBorderTextureCols=3

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;
local int pointsHealed;


if (Super.ButtonActivated(buttonPressed))
return True;

bHandled = True;

// Check if this is one of our Augmentation buttons
if (buttonPressed.IsA('PersonaHealthItemButton'))
{
SelectHealth(PersonaHealthItemButton(buttonPressed));
}
else if (buttonPressed.IsA('PersonaHealthActionButtonWindow'))
{
PushHealth();
pointsHealed = HealPart(regionWindows[PersonaHealthActionButtonWindow(buttonPressed).GetPartIndex()]);
player.PopHealth( playerHealth[0],playerHealth[1],playerHealth[2],playerHealth[3],playerHealth[4],playerHealth[5]);
winStatus.AddText(Sprintf(PointsHealedLabel, pointsHealed));

EnableButtons();
}
else if (buttonPressed.GetParent().IsA('PersonaHealthRegionWindow'))
{
partButtons[PersonaHealthRegionWindow(buttonPressed.GetParent()).GetPartIndex()].PressButton(IK_None);
}
else
{
switch(buttonPressed)
{
case btnHealAll:
HealAllParts();
break;

default:
bHandled = False;
break;
}
}

return bHandled;

CreateBodyWindow


winBody = PersonaHealthBodyWindow(winClient.NewChild(Class'PersonaHealthBodyWindow'));
winBody.SetPos(24, 36);
winBody.Lower();

CreateButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(13, 407);
winActionButtons.SetWidth(92);
winActionButtons.FillAllSpace(False);

btnHealAll = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnHealAll.SetButtonText(HealAllButtonLabel);

CreateControls


Super.CreateControls();

CreateTitleWindow(9, 5, HealthTitleText);
CreateInfoWindow();
CreateOverlaysWindow();
CreateBodyWindow();
CreateRegionWindows();
CreateButtons();
CreateMedKitWindow();
CreatePartButtons();
CreateStatusWindow();

PersonaNavBarWindow(winNavBar).btnHealth.SetSensitivity(False);

CreateInfoWindow


winInfo = PersonaInfoWindow(winClient.NewChild(Class'PersonaInfoWindow'));
winInfo.SetPos(348, 22);
winInfo.SetSize(238, 239);

CreateMedKitWindow


winMedKits = PersonaItemDetailWindow(winClient.NewChild(Class'PersonaItemDetailWindow'));
winMedKits.SetPos(346, 307);
winMedKits.SetWidth(242);
winMedKits.SetIcon(Class'MedKit'.Default.LargeIcon);
winMedKits.SetIconSize(
Class'MedKit'.Default.largeIconWidth,
Class'MedKit'.Default.largeIconHeight);

UpdateMedKits();

CreateOverlaysWindow


winOverlays = PersonaOverlaysWindow(winClient.NewChild(Class'PersonaHealthOverlaysWindow'));
winOverlays.SetPos(24, 36);
winOverlays.Lower();

CreatePartButtons


partButtons[0] = CreatePartButton(0, 141, 42, 40, 54, HealthPartDesc[0], HealthLocationHead);
partButtons[1] = CreatePartButton(1, 133, 98, 56, 73, HealthPartDesc[1], HealthLocationTorso);
partButtons[2] = CreatePartButton(2, 90, 131, 28, 65, HealthPartDesc[2], HealthLocationRightArm);
partButtons[3] = CreatePartButton(3, 204, 131, 28, 65, HealthPartDesc[2], HealthLocationLeftArm);
partButtons[4] = CreatePartButton(4, 119, 234, 41, 94, HealthPartDesc[3], HealthLocationRightLeg);
partButtons[5] = CreatePartButton(5, 162, 234, 41, 94, HealthPartDesc[3], HealthLocationLeftLeg);

CreateRegionWindows


regionWindows[0] = CreateRegionWindow(0, 218, 29, player.HealthHead, player.default.HealthHead, HealthLocationHead);
regionWindows[1] = CreateRegionWindow(1, 27, 43, player.HealthTorso, player.default.HealthTorso, HealthLocationTorso);
regionWindows[2] = CreateRegionWindow(2, 19, 237, player.HealthArmRight, player.default.HealthArmRight, HealthLocationRightArm);
regionWindows[3] = CreateRegionWindow(3, 230, 237, player.HealthArmLeft, player.default.HealthArmLeft, HealthLocationLeftArm);
regionWindows[4] = CreateRegionWindow(4, 24, 347, player.HealthLegRight, player.default.HealthLegRight, HealthLocationRightLeg);
regionWindows[5] = CreateRegionWindow(5, 222, 347, player.HealthLegLeft, player.default.HealthLegLeft, HealthLocationLeftLeg);

CreateStatusWindow


winStatus = PersonaStatusLineWindow(winClient.NewChild(Class'PersonaStatusLineWindow'));
winStatus.SetPos(348, 269);

EnableButtons


local int regionIndex;
local medKit medKit;


// First make sure the player has a medkit
medKit = MedKit(player.FindInventoryType(Class'MedKit'));

// Heal All button available as long as one or more
// parts is damaged and the player has at least one
// kit

btnHealAll.EnableWindow((medKit != None) && (IsPlayerDamaged()));

// Loop through the region windows, since they have Heal buttons
// attached to them
for (regionIndex=0; regionIndex regionWindows[regionIndex].EnableButtons();

GetMedKitHealPoints -> int


local MedKit medkit;


medKit = MedKit(player.FindInventoryType(Class'MedKit'));

if (medKit != None)
return player.CalculateSkillHealAmount(medKit.NumCopies * medKit.healAmount);
else
return 0;

HealAllParts -> int


local MedKit medkit;
local int healPointsAvailable;
local int healPointsRemaining;
local int pointsHealed;
local int regionIndex;
local float damageAmount;
local bool bPartDamaged;


pointsHealed = 0;
PushHealth();

// First determine how many medkits the player has
healPointsAvailable = GetMedKitHealPoints();
healPointsRemaining = healPointsAvailable;

// Now loop through all the parts repeatedly until
// we either:
//
// A) Run out of parts to heal or
// B) Run out of points to distribute.

while(healPointsRemaining > 0)
{
bPartDamaged = False;

// Loop through all the parts
for(regionIndex=0; regionIndex {
damageAmount = regionWindows[regionIndex].maxHealth - regionWindows[regionIndex].currentHealth;

if ((damageAmount > 0) && (healPointsRemaining > 0))
{
// Heal this part
pointsHealed += HealPart(regionWindows[regionIndex], 1, True);

healPointsRemaining--;
bPartDamaged = True;
}
}

if (!bPartDamaged)
break;
}

// Now remove any medkits we may have used
RemoveMedKits(healPointsAvailable - healPointsRemaining);

player.PopHealth( playerHealth[0],playerHealth[1],playerHealth[2],playerHealth[3],playerHealth[4],playerHealth[5]);

EnableButtons();

winStatus.AddText(Sprintf(PointsHealedLabel, pointsHealed));

return pointsHealed;

HealPart (PersonaHealthRegionWindow region, optional float pointsToHeal, optional bool bLeaveMedKit) -> int


local float healthAdded;
local float newHealth;
local medKit medKit;


// First make sure the player has a medkit
medKit = MedKit(player.FindInventoryType(Class'MedKit'));

if ((region == None) || (medKit == None))
return 0;

// If a point value was passesd in, use it as the amount of
// points to heal for this body part. Otherwise use the
// medkit's default heal amount.

if (pointsToHeal == 0)
pointsToHeal = player.CalculateSkillHealAmount(medKit.healAmount);

// Heal the selected body part by the number of
// points available in the part


// If our player is in a multiplayer game, heal across 3 hit locations
if ( player.PlayerIsClient() )
{
switch(region.GetPartIndex())
{
case 0: // head
newHealth = FMin(playerHealth[0] + pointsToHeal, player.default.HealthHead);
healthAdded = newHealth - playerHealth[0];
playerHealth[0] = newHealth;
break;

case 1: // torso, right arm, left arm
case 2:
case 3:
pointsToHeal *= 0.333; // Divide heal points among parts
newHealth = FMin(playerHealth[1] + pointsToHeal, player.default.HealthTorso);
healthAdded = newHealth - playerHealth[1];
playerHealth[1] = newHealth;
regionWindows[1].SetHealth(newHealth);
newHealth = FMin(playerHealth[2] + pointsToHeal, player.default.HealthArmRight);
healthAdded = newHealth - playerHealth[2];
playerHealth[2] = newHealth;
regionWindows[2].SetHealth(newHealth);
newHealth = FMin(playerHealth[3] + pointsToHeal, player.default.HealthArmLeft);
healthAdded = newHealth - playerHealth[3];
playerHealth[3] = newHealth;
regionWindows[3].SetHealth(newHealth);
break;
case 4: // right leg, left leg
case 5:
pointsToHeal *= 0.5; // Divide heal points among parts
newHealth = FMin(playerHealth[4] + pointsToHeal, player.default.HealthLegRight);
healthAdded = newHealth - playerHealth[4];
playerHealth[4] = newHealth;
regionWindows[4].SetHealth(newHealth);
newHealth = FMin(playerHealth[5] + pointsToHeal, player.default.HealthLegLeft);
healthAdded = newHealth - playerHealth[5];
playerHealth[5] = newHealth;
regionWindows[5].SetHealth(newHealth);
break;
}
}
else
{
switch(region.GetPartIndex())
{
case 0: // head
newHealth = FMin(playerHealth[0] + pointsToHeal, player.default.HealthHead);
healthAdded = newHealth - playerHealth[0];
playerHealth[0] = newHealth;
break;

case 1: // torso
newHealth = FMin(playerHealth[1] + pointsToHeal, player.default.HealthTorso);
healthAdded = newHealth - playerHealth[1];
playerHealth[1] = newHealth;
break;

case 2: // right arm
newHealth = FMin(playerHealth[2] + pointsToHeal, player.default.HealthArmRight);
healthAdded = newHealth - playerHealth[2];
playerHealth[2] = newHealth;
break;

case 3: // left arm
newHealth = FMin(playerHealth[3] + pointsToHeal, player.default.HealthArmLeft);
healthAdded = newHealth - playerHealth[3];
playerHealth[3] = newHealth;
break;

case 4: // right leg
newHealth = FMin(playerHealth[4] + pointsToHeal, player.default.HealthLegRight);
healthAdded = newHealth - playerHealth[4];
playerHealth[4] = newHealth;
break;

case 5: // left leg
newHealth = FMin(playerHealth[5] + pointsToHeal, player.default.HealthLegLeft);
healthAdded = newHealth - playerHealth[5];
playerHealth[5] = newHealth;
break;
}
}

region.SetHealth(newHealth);

// Remove the item from the player's invenory and this screen
if (!bLeaveMedKit)
UseMedKit(medkit);

return healthAdded;

InitWindow


Super.InitWindow();

EnableButtons();

IsPlayerDamaged -> bool


local int regionIndex;
local bool bDamaged;


bDamaged = False;

for(regionIndex=0; regionIndex {
if (regionWindows[regionIndex].maxHealth > regionWindows[regionIndex].currentHealth)
{
bDamaged = True;
break;
}
}

return bDamaged;

PushHealth


playerHealth[0] = player.HealthHead;
playerHealth[1] = player.HealthTorso;
playerHealth[2] = player.HealthArmRight;
playerHealth[3] = player.HealthArmLeft;
playerHealth[4] = player.HealthLegRight;
playerHealth[5] = player.HealthLegLeft;

RemoveMedKits (int healPointsUsed)


local MedKit medkit;
local int healPointsRemaining;


healPointsRemaining = healPointsUsed;
medKit = MedKit(player.FindInventoryType(Class'MedKit'));

while((medKit != None) && (healPointsRemaining > 0))
{
healPointsRemaining -= player.CalculateSkillHealAmount(medkit.healAmount);
UseMedKit(medkit);
medKit = MedKit(player.FindInventoryType(Class'MedKit'));
}

SelectHealth (PersonaHealthItemButton buttonPressed)


// Don't do extra work.
if (selectedHealthButton != buttonPressed)
{
// Deselect current button
if (selectedHealthButton != None)
selectedHealthButton.SelectButton(False);

selectedHealthButton = buttonPressed;
selectedHealthButton.SelectButton(True);

// Update the display
winInfo.SetTitle(selectedHealthButton.GetTitle());
winInfo.SetText(selectedHealthButton.GetDesc());

EnableButtons();
}

UpdateMedKits


local MedKit medKit;


if (winMedKits != None)
{
winMedKits.SetText(MedKitUseText);

medKit = MedKit(player.FindInventoryType(Class'MedKit'));

if (medKit != None)
winMedKits.SetCount(medKit.NumCopies);
else
winMedKits.SetCount(0);
}

UpdateRegionWindows


local int partIndex;


for(partIndex=0; partIndex regionWindows[partIndex].Destroy();

CreateRegionWindows();

UseMedKit (MedKit medkit)


if (medKit != None)
{
medKit.UseOnce();
UpdateMedKits();

EnableButtons();
}




PersonaScreenImages.uc (extends PersonaScreenBaseWindow)

var PersonaActionButtonWindow btnAddNote;
var PersonaActionButtonWindow btnDeleteNote;
var PersonaCheckBoxWindow chkShowNotes;
var PersonaListWindow lstImages;
var PersonaScrollAreaWindow winScroll;
var PersonaHeaderTextWindow winImageTitle;
var PersonaImageWindow winImage;
var localized String ImagesTitleText;
var localized String DeleteNoteButtonLabel;
var localized String AddNoteButtonLabel;
var localized String ShowNotesLabel;
ImagesTitleText="Images"
DeleteNoteButtonLabel="|&Delete Note"
AddNoteButtonLabel="Add |&Note"
ShowNotesLabel="Show N|&otes"
clientBorderOffsetY=35
ClientWidth=617
ClientHeight=439
clientOffsetX=11
clientOffsetY=2
clientTextures(0)=Texture'DeusExUI.UserInterface.ImagesBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ImagesBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.ImagesBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.ImagesBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.ImagesBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.ImagesBackground_6'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.ImagesBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.ImagesBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.ImagesBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.ImagesBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.ImagesBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.ImagesBorder_6'
clientTextureRows=2
clientTextureCols=3
clientBorderTextureRows=2
clientBorderTextureCols=3

AddNote


// Set a variable so the next place the user clicks inside the
// imgae window a new note is added.
winImage.SetAddNoteMode(True);

EnableButtons();

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch(buttonPressed)
{
case btnAddNote:
AddNote();
break;

case btnDeleteNote:
DeleteNote();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated(buttonPressed);

return bHandled;

ClearViewedImageFlags


local DataVaultImage image;
local int listIndex;
local int rowId;


for(listIndex=0; listIndex {
rowId = lstImages.IndexToRowId(listIndex);

if (lstImages.GetFieldValue(rowId, 2) > 0)
{
image = DataVaultImage(lstImages.GetRowClientObject(rowId));
image.bPlayerViewedImage = True;
}
}

CreateButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(10, 422);
winActionButtons.SetWidth(259);
winActionButtons.FillAllSpace(False);

btnAddNote = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnAddNote.SetButtonText(AddNoteButtonLabel);

btnDeleteNote = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnDeleteNote.SetButtonText(DeleteNoteButtonLabel);

CreateControls


Super.CreateControls();

CreateTitleWindow(9, 5, ImagesTitleText);
CreateImageWindow();
CreateImagesList();
CreateImageTitle();
CreateButtons();
CreateShowNotesCheckbox();
CreateNewLegendLabel();

CreateImageTitle


winImageTitle = PersonaHeaderTextWindow(winClient.NewChild(Class'PersonaHeaderTextWindow'));
winImageTitle.SetPos(214, 6);
winImageTitle.SetWidth(200);
winImageTitle.SetTextAlignments(HALIGN_Right, VALIGN_Center);

CreateImageWindow


winImage = PersonaImageWindow(winClient.NewChild(Class'PersonaImageWindow'));
winImage.SetPos(15, 20);

CreateImagesList


winScroll = CreateScrollAreaWindow(winClient);
winScroll.SetPos(417, 21);
winScroll.SetSize(184, 398);

lstImages = PersonaListWindow(winScroll.clipWindow.NewChild(Class'PersonaListWindow'));
lstImages.EnableMultiSelect(False);
lstImages.EnableAutoExpandColumns(True);
lstImages.SetNumColumns(3);
lstImages.HideColumn(2, True);
lstImages.SetSortColumn(0, True);
lstImages.EnableAutoSort(False);
lstImages.SetColumnWidth(0, 150);
lstImages.SetColumnWidth(1, 34);
lstImages.SetColumnType(2, COLTYPE_Float);
lstImages.SetColumnFont(1, Font'FontHUDWingDings');

CreateNewLegendLabel


local PersonaImageNewLegendLabel newLabel;


newLabel = PersonaImageNewLegendLabel(winClient.NewChild(Class'PersonaImageNewLegendLabel'));
newLabel.SetWindowAlignments(HALIGN_Right, VALIGN_Top, 13, 424);

CreateShowNotesCheckbox


chkShowNotes = PersonaCheckBoxWindow(winClient.NewChild(Class'PersonaCheckBoxWindow'));

chkShowNotes.SetWindowAlignments(HALIGN_Right, VALIGN_Top, 203, 424);
chkShowNotes.SetText(ShowNotesLabel);
chkShowNotes.SetToggle(True);

DeleteNote


winImage.DeleteNote();
EnableButtons();

DestroyImages


local DataVaultImage image;
local int listIndex;
local int rowId;


for(listIndex=0; listIndex {
rowId = lstImages.IndexToRowId(listIndex);

if (lstImages.GetFieldValue(rowId, 2) > 0)
{
image = DataVaultImage(lstImages.GetRowClientObject(rowId));

if (image != None)
image.UnloadTextures(player);
}
}

EnableButtons


local DataVaultImage image;


image = winImage.GetImage();

btnAddNote.SetSensitivity(image != None);
btnDeleteNote.SetSensitivity(winImage.IsNoteSelected());
chkShowNotes.SetSensitivity(image != None);

FocusEnteredDescendant (Window enterWindow)


EnableButtons();

FocusLeftDescendant (Window leaveWindow)


EnableButtons();

InitWindow


Super.InitWindow();

PopulateImagesList();
SetFocusWindow(lstImages);

PersonaNavBarWindow(winNavBar).btnImages.SetSensitivity(False);

EnableButtons();

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


SetImage(DataVaultImage(lstImages.GetRowClientObject(focusRowId)));

// Set a flag to later clear the "*New*" in the second column
lstImages.SetFieldValue(focusRowId, 2, 1);

return True;

PopulateImagesList


local DataVaultImage image;
local int rowId;


// First clear the list
lstImages.DeleteAllRows();

// Loop through all the notes the player currently has in
// his possession

image = Player.FirstImage;
while(image != None)
{
rowId = lstImages.AddRow(image.imageDescription);

// Check to see if we need to display *New* in the second column
if (image.bPlayerViewedImage == False)
lstImages.SetField(rowId, 1, "C");

// Save the image away
lstImages.SetRowClientObject(rowId, image);

image = image.NextImage;
}

SaveSettings


DestroyImages();
ClearViewedImageFlags();

SetImage (DataVaultImage newImage)


winImage.SetImage(newImage);

if ( newImage == None )
winImageTitle.SetText("");
else
winImageTitle.SetText(newImage.imageDescription);

EnableButtons();

ShowNotes (bool bNewShowNotes)


if (winImage != None)
winImage.ShowNotes(bNewShowNotes);

ToggleChanged (window button, bool bToggleValue) -> Bool


if (button == chkShowNotes)
ShowNotes(bToggleValue);




PersonaScreenInventory.uc (extends PersonaScreenBaseWindow)

var PersonaActionButtonWindow btnEquip;
var PersonaActionButtonWindow btnUse;
var PersonaActionButtonWindow btnDrop;
var PersonaActionButtonWindow btnChangeAmmo;
var Window winItems;
var PersonaInventoryInfoWindow winInfo;
var PersonaItemButton selectedItem; // Currently Selected Inventory item
var PersonaInventoryCreditsWindow winCredits;
var PersonaItemDetailWindow winNanoKeyRing;
var PersonaItemDetailWindow winAmmo;
var Bool bUpdatingAmmoDisplay;
var float TimeSinceLastUpdate;
var PersonaInventoryObjectBelt invBelt;
var HUDObjectSlot selectedSlot;
var int invButtonHeight;
var int smallInvWidth; // Small Inventory Button Width
var int smallInvHeight; // Small Inventory Button Heigth
var Bool bDragging;
var ButtonWindow dragButton; // Button we're dragging around
var ButtonWindow lastDragOverButton;
var Window lastDragOverWindow;
var Window destroyWindow; // Used to defer window destroy
var localized String InventoryTitleText;
var localized String EquipButtonLabel;
var localized String UnequipButtonLabel;
var localized String UseButtonLabel;
var localized String DropButtonLabel;
var localized String ChangeAmmoButtonLabel;
var localized String NanoKeyRingInfoText;
var localized String NanoKeyRingLabel;
var localized String DroppedLabel;
var localized String AmmoLoadedLabel;
var localized String WeaponUpgradedLabel;
var localized String CannotBeDroppedLabel;
var localized String AmmoInfoText;
var localized String AmmoTitleLabel;
var localized String NoAmmoLabel;
invButtonWidth=53
invButtonHeight=53
smallInvWidth=40
smallInvHeight=35
InventoryTitleText="Inventory"
EquipButtonLabel="|&Equip"
UnequipButtonLabel="Un|&equip"
UseButtonLabel="|&Use"
DropButtonLabel="|&Drop"
ChangeAmmoButtonLabel="Change Amm|&o"
NanoKeyRingInfoText="Click icon to see a list of Nano Keys."
NanoKeyRingLabel="Keys: %s"
DroppedLabel="%s dropped"
AmmoLoadedLabel="%s loaded"
WeaponUpgradedLabel="%s upgraded"
CannotBeDroppedLabel="%s cannot be dropped here"
AmmoInfoText="Click icon to see a list of Ammo."
AmmoTitleLabel="Ammunition"
NoAmmoLabel="No Ammo Available"
clientBorderOffsetY=33
ClientWidth=585
ClientHeight=361
clientOffsetX=33
clientOffsetY=10
clientTextures(0)=Texture'DeusExUI.UserInterface.InventoryBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.InventoryBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.InventoryBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.InventoryBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.InventoryBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.InventoryBackground_6'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.InventoryBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.InventoryBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.InventoryBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.InventoryBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.InventoryBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.InventoryBorder_6'
clientTextureRows=2
clientTextureCols=3
clientBorderTextureRows=2
clientBorderTextureCols=3

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;
local Class ammoClass;


bHandled = True;

// First check to see if this is an Ammo button
if (buttonPressed.IsA('PersonaAmmoDetailButton'))
{
if (DeusExWeapon(selectedItem.GetClientObject()) != None)
{
// Before doing anything, check to see if this button is already
// selected.

if (!PersonaAmmoDetailButton(buttonPressed).bSelected)
{
winInfo.SelectAmmoButton(PersonaAmmoDetailButton(buttonPressed));
ammoClass = LoadAmmo();
DeusExWeapon(selectedItem.GetClientObject()).UpdateAmmoInfo(winInfo, ammoClass);
EnableButtons();
}
}
}
// Check to see if this is the Ammo button
else if ((buttonPressed.IsA('PersonaItemDetailButton')) &&
(PersonaItemDetailButton(buttonPressed).icon == Class'AmmoShell'.Default.LargeIcon))
{
SelectInventory(PersonaItemButton(buttonPressed));
UpdateAmmoDisplay();
}
// Now check to see if it's an Inventory button
else if (buttonPressed.IsA('PersonaItemButton'))
{
winStatus.ClearText();
SelectInventory(PersonaItemButton(buttonPressed));
}
// Otherwise must be one of our action buttons
else
{
switch( buttonPressed )
{
case btnChangeAmmo:
WeaponChangeAmmo();
break;

case btnEquip:
EquipSelectedItem();
break;

case btnUse:
UseSelectedItem();
break;

case btnDrop:
DropSelectedItem();
break;

default:
bHandled = False;
break;
}
}

if ( !bHandled )
bHandled = Super.ButtonActivated(buttonPressed);

return bHandled;

CleanBelt


local Inventory CurrentItem;


invBelt.hudBelt.ClearBelt();
invBelt.objBelt.ClearBelt();
invBelt.objBelt.PopulateBelt();
if (selectedItem != None)
SelectObjectBeltItem(Inventory(selectedItem.GetClientObject()), True);

ClearSelectedSlot


if (selectedSlot == None)
return;

// Make sure this isn't the NanoKeyRing
if ((selectedSlot.item != None) && (!selectedSlot.item.IsA('NanoKeyRing')))
{
selectedSlot.SetToggle(False);
ClearSlotItem(selectedSlot.item);
selectedSlot = None;

winInfo.Clear();
EnableButtons();
}

ClearSlotItem (Inventory item)


invBelt.RemoveObject(item);

ClearSpecialHighlights


local Window itemWindow;
local PersonaInventoryItemButton itemButton;
local Inventory anItem;


// Loop through all our children and check to see if
// we have a match.

itemWindow = winItems.GetTopChild();
while( itemWindow != None )
{
itemButton = PersonaInventoryItemButton(itemWindow);
if (itemButton != None)
{
itemButton.ResetFill();
}

itemWindow = itemWindow.GetLowerSibling();
}

CreateAmmoWindow


winAmmo = PersonaItemDetailWindow(winClient.NewChild(Class'PersonaItemDetailWindow'));
winAmmo.SetPos(456, 285);
winAmmo.SetWidth(120);
winAmmo.SetIcon(Class'AmmoShell'.Default.LargeIcon);
winAmmo.SetIconSize(Class'AmmoShell'.Default.largeIconWidth, Class'AmmoShell'.Default.largeIconHeight);
winAmmo.SetText(AmmoInfoText);
winAmmo.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winAmmo.SetIgnoreCount(True);
winAmmo.SetIconSensitivity(True);

CreateButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(9, 339);
winActionButtons.SetWidth(267);

btnChangeAmmo = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnChangeAmmo.SetButtonText(ChangeAmmoButtonLabel);

btnDrop = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnDrop.SetButtonText(DropButtonLabel);

btnUse = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnUse.SetButtonText(UseButtonLabel);

btnEquip = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnEquip.SetButtonText(EquipButtonLabel);

CreateControls


Super.CreateControls();

CreateTitleWindow(9, 5, InventoryTitleText);
CreateInfoWindow();
CreateCreditsWindow();
CreateObjectBelt();
CreateButtons();
CreateItemsWindow();
CreateNanoKeyRingWindow();
CreateAmmoWindow();
CreateInventoryButtons();
CreateStatusWindow();

CreateCreditsWindow


winCredits = PersonaInventoryCreditsWindow(winClient.NewChild(Class'PersonaInventoryCreditsWindow'));
winCredits.SetPos(165, 3);
winCredits.SetWidth(108);
winCredits.SetCredits(Player.Credits);

CreateInfoWindow


winInfo = PersonaInventoryInfoWindow(winClient.NewChild(Class'PersonaInventoryInfoWindow'));
winInfo.SetPos(337, 17);
winInfo.SetSize(238, 218);

CreateInventoryButtons


local Inventory anItem;
local PersonaInventoryItemButton newButton;


// First, clear the player's inventory grid.
// DEUS_EX AMSD Due to not being able to guarantee order of delivery for functions,
// do NOT clear inventory in multiplayer, else we risk clearing AFTER a lot of the sets
// below.
if (player.Level.NetMode == NM_Standalone)
player.ClearInventorySlots();

// Iterate through the inventory items, creating a unique button for each
anItem = player.Inventory;

while(anItem != None)
{
if (anItem.bDisplayableInv)
{
// Create another button
newButton = PersonaInventoryItemButton(winItems.NewChild(Class'PersonaInventoryItemButton'));
newButton.SetClientObject(anItem);
newButton.SetInventoryWindow(Self);

// If the item has a large icon, use it. Otherwise just use the
// smaller icon that's also shared by the object belt

if ( anItem.largeIcon != None )
{
newButton.SetIcon(anItem.largeIcon);
newButton.SetIconSize(anItem.largeIconWidth, anItem.largeIconHeight);
}
else
{
newButton.SetIcon(anItem.icon);
newButton.SetIconSize(smallInvWidth, smallInvHeight);
}

newButton.SetSize(
(invButtonWidth * anItem.invSlotsX) + 1,
(invButtonHeight * anItem.invSlotsY) + 1);

// Okeydokey, update the player's inventory grid with this item.
player.SetInvSlots(anItem, 1);

// If this item is currently equipped, notify the button
if ( anItem == player.inHand )
newButton.SetEquipped( True );

// If this inventory item already has a position, use it.
if (( anItem.invPosX != -1 ) && ( anItem.invPosY != -1 ))
{
SetItemButtonPos(newButton, anItem.invPosX, anItem.invPosY);
}
else
{
// Find a place for it.
if (player.FindInventorySlot(anItem))
SetItemButtonPos(newButton, anItem.invPosX, anItem.invPosY);
else
newButton.Destroy(); // Shit!
}
}

anItem = anItem.Inventory;
}

CreateItemsWindow


winItems = winClient.NewChild(Class'Window');
winItems.SetPos(9, 19);
winItems.SetSize(266, 319);

CreateNanoKeyRingWindow


winNanoKeyRing = PersonaItemDetailWindow(winClient.NewChild(Class'PersonaItemDetailWindow'));
winNanoKeyRing.SetPos(335, 285);
winNanoKeyRing.SetWidth(121);
winNanoKeyRing.SetIcon(Class'NanoKeyRing'.Default.LargeIcon);
winNanoKeyRing.SetItem(player.KeyRing);
winNanoKeyRing.SetText(NanoKeyRingInfoText);
winNanoKeyRing.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winNanoKeyRing.SetCountLabel(NanoKeyRingLabel);
winNanoKeyRing.SetCount(player.KeyRing.GetKeyCount());
winNanoKeyRing.SetIconSensitivity(True);

CreateObjectBelt


invBelt = PersonaInventoryObjectBelt(NewChild(Class'PersonaInventoryObjectBelt'));
invBelt.SetWindowAlignments(HALIGN_Right, VALIGN_Bottom, 0, 0);
invBelt.SetInventoryWindow(Self);
// invBelt.AskParentForReconfigure();

CreateStatusWindow


winStatus = PersonaStatusLineWindow(winClient.NewChild(Class'PersonaStatusLineWindow'));
winStatus.SetPos(337, 243);

DeferDestroy (Window newDestroyWindow)


destroyWindow = newDestroyWindow;

if (destroyWindow != None)
bTickEnabled = True;

DropSelectedItem


local Inventory anItem;
local int numCopies;


if (selectedItem == None)
return;

if (Inventory(selectedItem.GetClientObject()) != None)
{
// Now drop it, unless this is the NanoKeyRing
if (!Inventory(selectedItem.GetClientObject()).IsA('NanoKeyRing'))
{
anItem = Inventory(selectedItem.GetClientObject());

// If this is a DeusExPickup, keep track of the number of copies
if (anItem.IsA('DeusExPickup'))
numCopies = DeusExPickup(anItem).NumCopies;

// First make sure the player can drop it!
if (player.DropItem(anItem, True))
{
// Make damn sure there's nothing pending
if ((player.inHandPending == anItem) || (player.inHand == anItem))
player.SetInHandPending(None);

// Remove the item, but first check to see if it was stackable
// and there are more than 1 copies available

if ( (!anItem.IsA('DeusExPickup')) ||
(anItem.IsA('DeusExPickup') && (numCopies <= 1)))
{
RemoveSelectedItem();
}

// Send status message
winStatus.AddText(Sprintf(DroppedLabel, anItem.itemName));

// Update the object belt
invBelt.UpdateBeltText(anItem);

//Force an update
SignalRefresh();
}
else
{
//DEUS_EX AMSD Don't do this in multiplayer, because the way function repl
//works, we'll ALWAYS end up here.
if (player.Level.NetMode == NM_Standalone)
winStatus.AddText(Sprintf(CannotBeDroppedLabel, anItem.itemName));
}
}
}

EnableButtons


local Inventory inv;


// Make sure all the buttons exist!
if ((btnChangeAmmo == None) || (btnDrop == None) || (btnEquip == None) || (btnUse == None))
return;

if ( selectedItem == None )
{
btnChangeAmmo.DisableWindow();
btnDrop.DisableWindow();
btnEquip.DisableWindow();
btnUse.DisableWindow();
}
else
{
btnChangeAmmo.EnableWindow();
btnEquip.EnableWindow();
btnUse.EnableWindow();
btnDrop.EnableWindow();

inv = Inventory(selectedItem.GetClientObject());

if (inv != None)
{
// Anything can be dropped, except the NanoKeyRing
btnDrop.EnableWindow();

if (inv.IsA('WeaponMod'))
{
btnChangeAmmo.DisableWindow();
btnUse.DisableWindow();
}
else if (inv.IsA('NanoKeyRing'))
{
btnChangeAmmo.DisableWindow();
btnDrop.DisableWindow();
btnEquip.DisableWindow();
btnUse.DisableWindow();
}
// Augmentation Upgrade Cannisters cannot be used
// on this screen
else if ( inv.IsA('AugmentationUpgradeCannister') )
{
btnUse.DisableWindow();
btnChangeAmmo.DisableWindow();
}
// Ammo can't be used or equipped
else if ( inv.IsA('Ammo') )
{
btnUse.DisableWindow();
btnEquip.DisableWindow();
}
else
{
if ((inv == player.inHand ) || (inv == player.inHandPending))
btnEquip.SetButtonText(UnequipButtonLabel);
else
btnEquip.SetButtonText(EquipButtonLabel);
}

// If this is a weapon, check to see if this item has more than
// one type of ammo in the player's inventory that can be
// equipped. If so, enable the "AMMO" button.
if ( inv.IsA('DeusExWeapon') )
{
btnUse.DisableWindow();

if ( DeusExWeapon(inv).NumAmmoTypesAvailable() < 2 )
btnChangeAmmo.DisableWindow();
}
else
{
btnChangeAmmo.DisableWindow();
}
}
else
{
btnChangeAmmo.DisableWindow();
btnDrop.DisableWindow();
btnEquip.DisableWindow();
btnUse.DisableWindow();
}
}

EndDragMode


// Make sure the last inventory item dragged over isn't still highlighted
if (lastDragOverButton != None)
{
if (lastDragOverButton.IsA('PersonaInventoryItemButton'))
PersonaInventoryItemButton(lastDragOverButton).ResetFill();
else
HUDObjectSlot(lastDragOverButton).ResetFill();

lastDragOverButton = None;
}

bDragging = False;

// Select the item
if (dragButton != None)
{
if (dragButton.IsA('PersonaInventoryItemButton'))
SelectInventory(PersonaInventoryItemButton(dragButton));
else if (dragButton.IsA('ToggleWindow'))
ToggleWindow(dragButton).SetToggle(True);

dragButton = None;
}

SignalRefresh();

EquipSelectedItem


local Inventory inv;


// If the object's in-hand, then unequip
// it. Otherwise put this object in-hand.

inv = Inventory(selectedItem.GetClientObject());

if ( inv != None )
{
// Make sure the Binoculars aren't activated.
if ((player.inHand != None) && (player.inHand.IsA('Binoculars')))
Binoculars(player.inHand).Activate();
else if ((player.inHandPending != None) && (player.inHandPending.IsA('Binoculars')))
Binoculars(player.inHandPending).Activate();

if ((inv == player.inHand) || (inv == player.inHandPending))
{
UnequipItemInHand();
}
else
{
player.PutInHand(inv);
PersonaInventoryItemButton(selectedItem).SetEquipped(True);
}

EnableButtons();
}

FinishButtonDrag


local int beltSlot;
local Inventory dragInv;
local PersonaInventoryItemButton dragTarget;
local HUDObjectSlot itemSlot;


// Take a look at the last window we were over to determine
// what to do now. If we were over the Inventory Items window,
// then move the item to a new slot. If we were over the Object belt,
// then assign this item to the appropriate key

if (dragButton == None)
{
EndDragMode();
return;
}

if (dragButton.IsA('PersonaInventoryItemButton'))
{
dragInv = Inventory(dragButton.GetClientObject());
dragTarget = PersonaInventoryItemButton(lastDragOverButton);

// Check if this is a weapon mod and we landed on a weapon
if ( (dragInv.IsA('WeaponMod')) && (dragTarget != None) && (dragTarget.GetClientObject().IsA('DeusExWeapon')) )
{
if (WeaponMod(dragInv).CanUpgradeWeapon(DeusExWeapon(dragTarget.GetClientObject())))
{
// 0. Unhighlight highlighted weapons
// 1. Apply the weapon upgrade
// 2. Remove from Object Belt
// 3. Destroy the upgrade (will cause button to be destroyed)
// 4. Highlight the weapon.

WeaponMod(dragInv).ApplyMod(DeusExWeapon(dragTarget.GetClientObject()));

Player.RemoveObjectFromBelt(dragInv);
//invBelt.objBelt.RemoveObjectFromBelt(dragInv);

// Send status message
winStatus.AddText(Sprintf(WeaponUpgradedLabel, DeusExWeapon(dragTarget.GetClientObject()).itemName));

//DEUS_EX AMSD done here for multiplayer propagation.
WeaponMod(draginv).DestroyMod();
//player.DeleteInventory(dragInv);

dragButton = None;
SelectInventory(dragTarget);
}
else
{
// move back to original spot
ReturnButton(PersonaInventoryItemButton(dragButton));
}
}

// Check if this is ammo and we landed on a weapon
else if ((dragInv.IsA('DeusExAmmo')) && (dragTarget != None) && (dragTarget.GetClientObject().IsA('DeusExWeapon')) )
{
if (DeusExWeapon(dragTarget.GetClientObject()).CanLoadAmmoType(DeusExAmmo(dragInv)))
{
// Load this ammo into the weapon
DeusExWeapon(dragTarget.GetClientObject()).LoadAmmoType(DeusExAmmo(dragInv));

// Send status message
winStatus.AddText(Sprintf(AmmoLoadedLabel, DeusExAmmo(dragInv).itemName));

// move back to original spot
ReturnButton(PersonaInventoryItemButton(dragButton));
}
}
else
{
if (dragTarget == dragButton)
{
MoveItemButton(PersonaInventoryItemButton(dragButton), PersonaInventoryItemButton(dragButton).dragPosX, PersonaInventoryItemButton(dragButton).dragPosY );
}
else if ( HUDObjectSlot(lastDragOverButton) != None )
{
beltSlot = HUDObjectSlot(lastDragOverButton).objectNum;

// Don't allow to be moved over NanoKeyRing
if (beltSlot > 0)
{
invBelt.AddObject(dragInv, beltSlot);
}

// Restore item to original slot
ReturnButton(PersonaInventoryItemButton(dragButton));
}
else if (lastDragOverButton != dragButton)
{
// move back to original spot
ReturnButton(PersonaInventoryItemButton(dragButton));
}
}
}
else // 'ObjectSlot'
{
// Check to see if this is a valid drop location (which are only
// other object slots).
//
// Swap the two items and select the one that was dragged
// but make sure the target isn't the NanoKeyRing

itemSlot = HUDObjectSlot(lastDragOverButton);

if (itemSlot != None)
{
if (((itemSlot.Item != None) && (!itemSlot.Item.IsA('NanoKeyRing'))) || (itemSlot.Item == None))
{
invBelt.SwapObjects(HUDObjectSlot(dragButton), itemSlot);
itemSlot.SetToggle(True);
}
}
else
{
// If the player drags the item outside the object belt,
// then remove it.

ClearSlotItem(HUDObjectSlot(dragButton).item);
}
}

EndDragMode();

HighlightAmmoWeapons (DeusExAmmo ammo)


local Window itemWindow;
local PersonaInventoryItemButton itemButton;
local Inventory anItem;


// Loop through all our children and check to see if
// we have a match.

itemWindow = winItems.GetTopChild();
while( itemWindow != None )
{
itemButton = PersonaInventoryItemButton(itemWindow);
if (itemButton != None)
{
anItem = Inventory(itemButton.GetClientObject());
if ((anItem != None) && (anItem.IsA('DeusExWeapon')))
{
if ((ammo != None) && (DeusExWeapon(anItem).CanLoadAmmoType(ammo)))
{
itemButton.HighlightWeapon(True);
}
}
else
{
itemButton.ResetFill();
}
}
itemWindow = itemWindow.GetLowerSibling();
}

HighlightModWeapons (WeaponMod weaponMod)


local Window itemWindow;
local PersonaInventoryItemButton itemButton;
local Inventory anItem;


// Loop through all our children and check to see if
// we have a match.

itemWindow = winItems.GetTopChild();
while( itemWindow != None )
{
itemButton = PersonaInventoryItemButton(itemWindow);
if (itemButton != None)
{
anItem = Inventory(itemButton.GetClientObject());
if ((anItem != None) && (anItem.IsA('DeusExWeapon')))
{
if ((weaponMod != None) && (weaponMod.CanUpgradeWeapon(DeusExWeapon(anItem))))
{
itemButton.HighlightWeapon(True);
}
}
else
{
itemButton.ResetFill();
}
}
itemWindow = itemWindow.GetLowerSibling();
}

HighlightSpecial (Inventory item)


if (item != None)
{
if (item.IsA('WeaponMod'))
HighlightModWeapons(WeaponMod(item));
else if (item.IsA('DeusExAmmo'))
HighlightAmmoWeapons(DeusExAmmo(item));
}

InitWindow


Super.InitWindow();

PersonaNavBarWindow(winNavBar).btnInventory.SetSensitivity(False);

EnableButtons();
//Force an update
SignalRefresh();


InventoryDeleted (Inventory item)


if (item != None)
{
// Remove the item from the screen
RemoveItem(item);
}

LoadAmmo -> Class


local DeusExWeapon aWeapon;
local Class ammo;


aWeapon = DeusExWeapon(selectedItem.GetClientObject());

if ( aWeapon != None )
{
ammo = Class(winInfo.GetSelectedAmmo());

// Only change if this is a different kind of ammo

if ((ammo != None) && (ammo != aWeapon.AmmoName))
{
aWeapon.LoadAmmoClass(ammo);

// Send status message
winStatus.AddText(Sprintf(AmmoLoadedLabel, ammo.Default.itemName));

// Update the object belt
invBelt.UpdateBeltText(aWeapon);
}
}

return ammo;

MoveItemButton (PersonaInventoryItemButton anItemButton, int col, int row)


player.SetInvSlots(Inventory(anItemButton.GetClientObject()), 0);
player.PlaceItemInSlot(Inventory(anItemButton.GetClientObject()), col, row );
SetItemButtonPos(anItemButton, col, row);
//Set it to refresh again
SignalRefresh();

RefreshInventoryItemButtons


local Window itemWindow;
local PersonaInventoryItemButton itemButton;
local Inventory SelectedInventory;


if (winItems == None)
return;

//record selected item
if (selectedItem != None)
SelectedInventory = Inventory(selectedItem.GetClientObject());
else
SelectedInventory = None;

//Delete buttons
itemWindow = winItems.GetTopChild();

selecteditem = None;
while (itemWindow != None)
{
itemButton = PersonaInventoryItemButton(itemWindow);
itemWindow = itemWindow.GetLowerSibling();
if (itemButton != None)
{
itemButton.Destroy();
}
}

//Create buttons
CreateInventoryButtons();

//Select new button version of selected item.
//We don't use the selectinventoryitem call because the constant
//item.update(wininfo) calls cause quite a slowdown when any item
//is selected. Since we aren't really selecting a different item,
//we don't need to do that update.
if (SelectedInventory != None)
{
// Search through the buttons
itemWindow = winItems.GetTopChild();
while(itemWindow != None)
{
itemButton = PersonaInventoryItemButton(itemWindow);
if (itemButton != None)
{
if (itemButton.GetClientObject() == SelectedInventory)
{
selecteditem = itemButton;
selectedItem.SelectButton(True);
break;
}
}

itemWindow = itemWindow.GetLowerSibling();
}
}

// if this does special highlighting, refresh that.
if (SelectedInventory != None)
HighlightSpecial(SelectedInventory);

RefreshWindow (float DeltaTime)


TimeSinceLastUpdate = TimeSinceLastUpdate + DeltaTime;
if (TimeSinceLastUpdate >= 0.25)
{
TimeSinceLastUpdate = 0;
if (!bDragging)
{
RefreshInventoryItemButtons();
CleanBelt();
}
}


Super.RefreshWindow(DeltaTime);

RemoveItem (Inventory item)


local Window itemWindow;


if (item == None)
return;

// Remove it from the object belt
invBelt.RemoveObject(item);

if ((selectedItem != None) && (item == selectedItem.GetClientObject()))
{
RemoveSelectedItem();
}
else
{
// Loop through the PersonaInventoryItemButtons looking for a match
itemWindow = winItems.GetTopChild();
while( itemWindow != None )
{
if (itemWindow.GetClientObject() == item)
{
DeferDestroy(itemWindow);
// itemWindow.Destroy();
break;
}

itemWindow = itemWindow.GetLowerSibling();
}
}

RemoveSelectedItem


local Inventory inv;


if (selectedItem == None)
return;

inv = Inventory(selectedItem.GetClientObject());

if (inv != None)
{
// Destroy the button
selectedItem.Destroy();
selectedItem = None;

// Remove it from the object belt
invBelt.RemoveObject(inv);

// Remove it from the inventory screen
UnequipItemInHand();

ClearSpecialHighlights();

SelectInventory(None);

winInfo.Clear();
EnableButtons();
}

ReturnButton (PersonaInventoryItemButton anItemButton)


local Inventory inv;


inv = Inventory(anItemButton.GetClientObject());

player.PlaceItemInSlot(inv, inv.invPosX, inv.invPosY);
SetItemButtonPos(anItemButton, inv.invPosX, inv.invPosY);

SelectInventory (PersonaItemButton buttonPressed)


local Inventory anItem;


// Don't do extra work.
if (buttonPressed != None)
{
if (selectedItem != buttonPressed)
{
// Deselect current button
if (selectedItem != None)
selectedItem.SelectButton(False);

selectedItem = buttonPressed;

ClearSpecialHighlights();
HighlightSpecial(Inventory(selectedItem.GetClientObject()));
SelectObjectBeltItem(Inventory(selectedItem.GetClientObject()), True);

selectedItem.SelectButton(True);

anItem = Inventory(selectedItem.GetClientObject());

if (anItem != None)
anItem.UpdateInfo(winInfo);

EnableButtons();
}
}
else
{
if (selectedItem != None)
PersonaInventoryItemButton(selectedItem).SelectButton(False);

if (selectedSlot != None)
selectedSlot.SetToggle(False);

selectedItem = None;
}

SelectInventoryItem (Inventory item)


local PersonaInventoryItemButton itemButton;
local Window itemWindow;


// Special case for NanoKeyRing
if (item != None)
{
if (item.IsA('NanoKeyRing'))
{
if (winNanoKeyRing != None)
{
SelectInventory(winNanoKeyRing.GetItemButton());
}
}
else if (winItems != None)
{
// Search through the buttons
itemWindow = winItems.GetTopChild();
while(itemWindow != None)
{
itemButton = PersonaInventoryItemButton(itemWindow);
if (itemButton != None)
{
if (itemButton.GetClientObject() == item)
{
SelectInventory(itemButton);
break;
}
}

itemWindow = itemWindow.GetLowerSibling();
}
}
}

SelectObjectBeltItem (Inventory item, bool bNewToggle)


invBelt.SelectObject(item, bNewToggle);

SetItemButtonPos (PersonaInventoryItemButton moveButton, int slotX, int slotY)


moveButton.dragPosX = slotX;
moveButton.dragPosY = slotY;

moveButton.SetPos(
moveButton.dragPosX * (invButtonWidth),
moveButton.dragPosY * (invButtonHeight)
);

SignalRefresh


//Put it about a quarter of a second back from an update, so that
//server has time to propagate.
TimeSinceLastUpdate = 0;

StartButtonDrag (ButtonWindow newDragButton)


// Show the object belt
dragButton = newDragButton;

ClearSpecialHighlights();

if (dragButton.IsA('PersonaInventoryItemButton'))
{
SelectInventory(None);

// Clear the space used by this button in the grid so we can
// still place the button here.
player.SetInvSlots(Inventory(dragButton.GetClientObject()), 0);
}
else
{
// Make sure no hud icon is selected
if (selectedSlot != None)
selectedSlot.SetToggle(False);
}

SignalRefresh();
bDragging = True;

Tick (float deltaTime)


if (destroyWindow != None)
{
destroyWindow.Destroy();
bTickEnabled = False;
}

ToggleChanged (Window button, bool bNewToggle) -> bool


if (button.IsA('HUDObjectSlot') && (bNewToggle))
{
if ((selectedSlot != None) && (selectedSlot != HUDObjectSlot(button)))
selectedSlot.HighlightSelect(False);

selectedSlot = HUDObjectSlot(button);

// Only allow to be highlighted if the slot isn't empty
if (selectedSlot.item != None)
{
selectedSlot.HighlightSelect(bNewToggle);
SelectInventoryItem(selectedSlot.item);
}
else
{
selectedSlot = None;
}
}
else if (button.IsA('PersonaCheckboxWindow'))
{
player.bShowAmmoDescriptions = bNewToggle;
player.SaveConfig();
UpdateAmmoDisplay();
}

EnableButtons();

return True;

UnequipItemInHand


if ((PersonaInventoryItemButton(selectedItem) != None) && ((player.inHand != None) || (player.inHandPending != None)))
{
player.PutInHand(None);
player.SetInHandPending(None);

PersonaInventoryItemButton(selectedItem).SetEquipped(False);
EnableButtons();
}

UpdateAmmoDisplay


local Inventory inv;
local DeusExAmmo ammo;
local int ammoCount;


if (!bUpdatingAmmoDisplay)
{
bUpdatingAmmoDisplay = True;

winInfo.Clear();

winInfo.SetTitle(AmmoTitleLabel);
winInfo.AddAmmoCheckbox(player.bShowAmmoDescriptions);
winInfo.AddLine();

inv = Player.Inventory;
while(inv != None)
{
ammo = DeusExAmmo(inv);

if ((ammo != None) && (ammo.bShowInfo))
{
winInfo.AddAmmoInfoWindow(ammo, player.bShowAmmoDescriptions);
ammoCount++;
}

inv = inv.Inventory;
}

if (ammoCount == 0)
{
winInfo.Clear();
winInfo.SetTitle(AmmoTitleLabel);
winInfo.SetText(NoAmmoLabel);
}

bUpdatingAmmoDisplay = False;
}

UpdateDragMouse (float newX, float newY)


local Window findWin;
local Float relX, relY;
local Int slotX, slotY;
local PersonaInventoryItemButton invButton;
local HUDObjectSlot objSlot;
local Bool bValidDrop;
local Bool bOverrideButtonColor;


findWin = FindWindow(newX, newY, relX, relY);

// If we're dragging an inventory button, behave one way, if we're
// dragging a hotkey button, behave another

if (dragButton.IsA('PersonaInventoryItemButton'))
{
invButton = PersonaInventoryItemButton(dragButton);

// If we're over the Inventory Items window, check to see
// if there's enough space to deposit this item here.

bValidDrop = False;
bOverrideButtonColor = False;

if ((findWin == winItems) || (findWin == dragButton ))
{
if ( findWin == dragButton )
ConvertCoordinates(Self, newX, newY, winItems, relX, relY);

bValidDrop = CalculateItemPosition(
Inventory(dragButton.GetClientObject()),
relX, relY,
slotX, slotY);

// If the mouse is still in the window, don't actually hide the
// button just yet.

if (bValidDrop && (player.IsEmptyItemSlot(Inventory(invButton.GetClientObject()), slotX, slotY)))
SetItemButtonPos(invButton, slotX, slotY);
}

// Check to see if we're over the Object Belt
else if (HUDObjectSlot(findWin) != None)
{
bValidDrop = True;

if (HUDObjectSlot(findWin).item != None)
if (HUDObjectSlot(findWin).item.IsA('NanoKeyRing'))
bValidDrop = False;

HUDObjectSlot(findWin).SetDropFill(bValidDrop);
}

// Check to see if we're over another inventory item
else if (PersonaInventoryItemButton(findWin) != None)
{
// If we're dragging a weapon mod and we're over a weapon, check to
// see if the mod can be dropped here.
//
// Otherwise this is a bad drop location

PersonaInventoryItemButton(findWin).SetDropFill(False);

// Check for weapon mods being dragged over weapons
if ((dragButton.GetClientObject().IsA('WeaponMod')) && (findWin.GetClientObject().IsA('DeusExWeapon')))
{
if (WeaponMod(invButton.GetClientObject()).CanUpgradeWeapon(DeusExWeapon(findWin.GetClientObject())))
{
bValidDrop = True;
PersonaInventoryItemButton(findWin).SetDropFill(True);
invButton.bValidSlot = False;
invButton.bDimIcon = False;
bOverrideButtonColor = True;

invButton.ResetFill();
}
}

// Check for ammo being dragged over weapons
else if ((dragButton.GetClientObject().IsA('DeusExAmmo')) && (findWin.GetClientObject().IsA('DeusExWeapon')))
{
if (DeusExWeapon(findWin.GetClientObject()).CanLoadAmmoType(DeusExAmmo(dragButton.GetClientObject())))
{
bValidDrop = True;
PersonaInventoryItemButton(findWin).SetDropFill(True);
invButton.bValidSlot = False;
invButton.bDimIcon = False;
bOverrideButtonColor = True;

invButton.ResetFill();
}
}
}

if (!bOverrideButtonColor)
{
invButton.SetDropFill(bValidDrop);
invButton.bDimIcon = !bValidDrop;

if (HUDObjectSlot(findWin) != None)
invButton.bValidSlot = False;
else
invButton.bValidSlot = bValidDrop;
}
}
else
{
// This is an Object Belt item we're dragging

objSlot = HUDObjectSlot(dragButton);
bValidDrop = False;

// Can only be dragged over another object slot
if (findWin.IsA('HUDObjectSlot'))
{
if (HUDObjectSlot(findWin).item != None)
{
if (!HUDObjectSlot(findWin).item.IsA('NanoKeyRing'))
{
bValidDrop = True;
}
}
else
{
bValidDrop = True;
}

HUDObjectSlot(findWin).SetDropFill(bValidDrop);
}

objSlot.bDimIcon = !bValidDrop;
}

// Unhighlight the previous window we were over
if ((lastDragOverButton != None) && (lastDragOverButton != findWin))
{
if (lastDragOverButton.IsA('HUDObjectSlot'))
{
HUDObjectSlot(lastDragOverButton).ResetFill();
}
else if (lastDragOverButton.IsA('PersonaInventoryItemButton'))
{
PersonaInventoryItemButton(lastDragOverButton).ResetFill();
}
}

// Keep track of the last button window we were over
lastDragOverButton = ButtonWindow(findWin);
lastDragOverWindow = findWin;

UpdateWinInfo (Inventory inv)


winInfo.Clear();

if (inv != None)
{
winInfo.SetTitle(inv.ItemName);
winInfo.SetText(inv.Description);
}

UseSelectedItem


local Inventory inv;
local int numCopies;


inv = Inventory(selectedItem.GetClientObject());

if (inv != None)
{
// If this item was equipped in the inventory screen,
// make sure we set inHandPending to None so it's not
// drawn when we exit the Inventory screen

if (player.inHandPending == inv)
player.SetInHandPending(None);

// If this is a binoculars, then it needs to be equipped
// before it can be activated
if (inv.IsA('Binoculars'))
player.PutInHand(inv);

inv.Activate();

// Check to see if this is a stackable item, and keep track of
// the count
if ((inv.IsA('DeusExPickup')) && (DeusExPickup(inv).bCanHaveMultipleCopies))
numCopies = DeusExPickup(inv).NumCopies - 1;
else
numCopies = 0;

// Update the object belt
invBelt.UpdateBeltText(inv);

// Refresh the info!
if (numCopies > 0)
UpdateWinInfo(inv);
}

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local int keyIndex;
local bool bKeyHandled;


bKeyHandled = True;

if ( IsKeyDown( IK_Alt ) || IsKeyDown( IK_Shift ) || IsKeyDown( IK_Ctrl ))
return False;

// If a number key was pressed and we have a selected inventory item,
// then assign the hotkey
if (( key >= IK_1 ) && ( key <= IK_9 ) && (selectedItem != None) && (Inventory(selectedItem.GetClientObject()) != None))
{
invBelt.AssignObjectBeltByKey(Inventory(selectedItem.GetClientObject()), key);
}
else
{
switch( key )
{
// Allow a selected object to be dropped
// TODO: Use the actual key(s) assigned to drop

case IK_Backspace:
DropSelectedItem();
break;

case IK_Delete:
ClearSelectedSlot();
break;

case IK_Enter:
UseSelectedItem();
break;

default:
bKeyHandled = False;
}
}

if (!bKeyHandled)
return Super.VirtualKeyPressed(key, bRepeat);
else
return bKeyHandled;

WeaponChangeAmmo


local DeusExWeapon aWeapon;


aWeapon = DeusExWeapon(selectedItem.GetClientObject());

if ( aWeapon != None )
{
aWeapon.CycleAmmo();

// Send status message and update info window
winStatus.AddText(Sprintf(AmmoLoadedLabel, aWeapon.ammoType.itemName));
aWeapon.UpdateAmmoInfo(winInfo, Class(aWeapon.AmmoName));
winInfo.SetLoaded(aWeapon.AmmoName);

// Update the object belt
invBelt.UpdateBeltText(aWeapon);
}




PersonaScreenLogs.uc (extends PersonaScreenBaseWindow)

var PersonaActionButtonWindow btnClear;
var PersonaListWindow lstLogs;
var PersonaScrollAreaWindow winScroll;
var localized String LogsTitleText;
var localized string ClearButtonLabel;
LogsTitleText="Logs"
ClearButtonLabel="Cl|&ear Log"
ClientWidth=426
ClientHeight=407
clientOffsetX=105
clientOffsetY=17
clientTextures(0)=Texture'DeusExUI.UserInterface.LogsBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.LogsBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.LogsBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.LogsBackground_4'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.ConversationsBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.ConversationsBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.ConversationsBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.ConversationsBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.ConversationsBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.ConversationsBorder_6'
clientTextureRows=2
clientTextureCols=2
clientBorderTextureRows=2
clientBorderTextureCols=3

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


if ( Super.ButtonActivated( buttonPressed ) )
return True;

bHandled = True;

switch( buttonPressed )
{
case btnClear:
ClearLog();
break;

default:
bHandled = False;
break;
}

return bHandled;

ClearLog


lstLogs.DeleteAllRows();
player.ClearLog();
EnableButtons();

CreateButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(10, 385);
winActionButtons.SetWidth(75);

btnClear = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnClear.SetButtonText(ClearButtonLabel);

CreateControls


Super.CreateControls();

CreateTitleWindow(9, 5, LogsTitleText);
CreateLogWindow();
CreateButtons();

CreateLogWindow


winScroll = CreateScrollAreaWindow(winClient);
winScroll.SetPos(16, 21);
winScroll.SetSize(394, 361);

lstLogs = PersonaListWindow(winScroll.clipWindow.NewChild(Class'PersonaListWindow'));
lstLogs.EnableMultiSelect(False);
lstLogs.EnableAutoExpandColumns(True);
lstLogs.SetNumColumns(2);
lstLogs.SetSortColumn(1, True);
lstLogs.SetColumnType(1, COLTYPE_Float);
lstLogs.SetColumnWidth(0, 394);
lstLogs.HideColumn(1);
lstLogs.EnableAutoSort(False);

EnableButtons


btnClear.SetSensitivity(lstLogs.GetNumRows() > 0);

InitWindow


Super.InitWindow();

PopulateLog();

PersonaNavBarWindow(winNavBar).btnLogs.SetSensitivity(False);

EnableButtons();

PopulateLog


local DeusExLog log;
local int rowIndex;
local int logCount;


// Now loop through all the conversations and add them to the list
log = player.FirstLog;
logCount = 0;

while(log != None)
{
rowIndex = lstLogs.AddRow(log.text $ ";" $ logCount++);
log = log.next;
}

lstLogs.Sort();




PersonaScreenSkills.uc (extends PersonaScreenBaseWindow)

var PersonaActionButtonWindow btnUpgrade;
var TileWindow winTile;
var Skill selectedSkill;
var PersonaSkillButtonWindow selectedSkillButton;
var PersonaHeaderTextWindow winSkillPoints;
var PersonaInfoWindow winInfo;
var PersonaSkillButtonWindow skillButtons[15];
var localized String SkillsTitleText;
var localized String UpgradeButtonLabel;
var localized String PointsNeededHeaderText;
var localized String SkillLevelHeaderText;
var localized String SkillPointsHeaderText;
var localized String SkillUpgradedLevelLabel;
SkillsTitleText="Skills"
UpgradeButtonLabel="|&Upgrade"
PointsNeededHeaderText="Points Needed"
SkillLevelHeaderText="Skill Level"
SkillPointsHeaderText="Skill Points"
SkillUpgradedLevelLabel="%s upgraded"
clientBorderOffsetY=33
ClientWidth=604
ClientHeight=361
clientOffsetX=19
clientOffsetY=12
clientTextures(0)=Texture'DeusExUI.UserInterface.SkillsBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.SkillsBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.SkillsBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.SkillsBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.SkillsBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.SkillsBackground_6'
clientBorderTextures(0)=Texture'DeusExUI.UserInterface.SkillsBorder_1'
clientBorderTextures(1)=Texture'DeusExUI.UserInterface.SkillsBorder_2'
clientBorderTextures(2)=Texture'DeusExUI.UserInterface.SkillsBorder_3'
clientBorderTextures(3)=Texture'DeusExUI.UserInterface.SkillsBorder_4'
clientBorderTextures(4)=Texture'DeusExUI.UserInterface.SkillsBorder_5'
clientBorderTextures(5)=Texture'DeusExUI.UserInterface.SkillsBorder_6'
clientTextureRows=2
clientTextureCols=3
clientBorderTextureRows=2
clientBorderTextureCols=3

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


if (Super.ButtonActivated(buttonPressed))
return True;

bHandled = True;

// Check if this is one of our Skills buttons
if (buttonPressed.IsA('PersonaSkillButtonWindow'))
{
SelectSkillButton(PersonaSkillButtonWindow(buttonPressed));
}
else
{
switch(buttonPressed)
{
case btnUpgrade:
UpgradeSkill();
break;

default:
bHandled = False;
break;
}
}

return bHandled;

CreateButtons


local PersonaButtonBarWindow winActionButtons;


winActionButtons = PersonaButtonBarWindow(winClient.NewChild(Class'PersonaButtonBarWindow'));
winActionButtons.SetPos(10, 338);
winActionButtons.SetWidth(149);
winActionButtons.FillAllSpace(False);

btnUpgrade = PersonaActionButtonWindow(winActionButtons.NewChild(Class'PersonaActionButtonWindow'));
btnUpgrade.SetButtonText(UpgradeButtonLabel);

CreateControls


Super.CreateControls();

CreateTitleWindow(9, 5, SkillsTitleText);
CreateInfoWindow();
CreateButtons();
CreateSkillsHeaders();
CreateSkillsTileWindow();
CreateSkillsList();
CreateSkillPointsWindow();
CreateStatusWindow();

CreateInfoWindow


winInfo = PersonaInfoWindow(winClient.NewChild(Class'PersonaInfoWindow'));
winInfo.SetPos(356, 22);
winInfo.SetSize(238, 299);

CreateSkillPointsWindow


local PersonaHeaderTextWindow winText;


winText = PersonaHeaderTextWindow(winClient.NewChild(Class'PersonaHeaderTextWindow'));
winText.SetPos(180, 341);
winText.SetHeight(15);
winText.SetText(SkillPointsHeaderText);

winSkillPoints = PersonaHeaderTextWindow(winClient.NewChild(Class'PersonaHeaderTextWindow'));
winSkillPoints.SetPos(250, 341);
winSkillPoints.SetSize(54, 15);
winSkillPoints.SetTextAlignments(HALIGN_Right, VALIGN_Center);
winSkillPoints.SetText(player.SkillPointsAvail);

CreateSkillsHeaders


local PersonaNormalTextWindow winText;


winText = PersonaNormalTextWindow(winClient.NewChild(Class'PersonaNormalTextWindow'));
winText.SetPos(177, 24);
winText.SetText(SkillLevelHeaderText);

winText = PersonaNormalTextWindow(winClient.NewChild(Class'PersonaNormalTextWindow'));
winText.SetPos(247, 24);
winText.SetText(PointsNeededHeaderText);

CreateSkillsList


local Skill aSkill;
local int buttonIndex;
local PersonaSkillButtonWindow skillButton;
local PersonaSkillButtonWindow firstButton;


// Iterate through the skills, adding them to our list
aSkill = player.SkillSystem.FirstSkill;
while(aSkill != None)
{
if (aSkill.SkillName != "")
{
skillButton = PersonaSkillButtonWindow(winTile.NewChild(Class'PersonaSkillButtonWindow'));
skillButton.SetSkill(aSkill);

skillButtons[buttonIndex++] = skillButton;

if (firstButton == None)
firstButton = skillButton;
}
aSkill = aSkill.next;
}

// Select the first skill
SelectSkillButton(skillButton);

CreateSkillsTileWindow


winTile = TileWindow(winClient.NewChild(Class'TileWindow'));

winTile.SetPos(12, 39);
winTile.SetSize(302, 297);
winTile.SetMinorSpacing(0);
winTile.SetMargins(0, 0);
winTile.SetOrder(ORDER_Down);

CreateStatusWindow


winStatus = PersonaStatusLineWindow(winClient.NewChild(Class'PersonaStatusLineWindow'));
winStatus.SetPos(356, 329);

EnableButtons


// Abort if a skill item isn't selected
if ( selectedSkill == None )
{
btnUpgrade.SetSensitivity(False);
}
else
{
// Upgrade Skill only available if the skill is not at
// the maximum -and- the user has enough skill points
// available to upgrade the skill

btnUpgrade.EnableWindow(selectedSkill.CanAffordToUpgrade(player.SkillPointsAvail));
}

GetCurrentSkillButtonIndex -> int


local int buttonIndex;
local int returnIndex;


returnIndex = -1;

for(buttonIndex=0; buttonIndex {
if (skillButtons[buttonIndex] == selectedSkillButton)
{
returnIndex = buttonIndex;
break;
}
}

return returnIndex;

GetSkillButtonCount -> int


local int buttonIndex;


for(buttonIndex=0; buttonIndex {
if (skillButtons[buttonIndex] == None)
break;
}

return buttonIndex;

InitWindow


Super.InitWindow();

PersonaNavBarWindow(winNavBar).btnSkills.SetSensitivity(False);

EnableButtons();

RefreshWindow (float DeltaTime)


if (selectedSkill != None)
{
selectedSkillButton.RefreshSkillInfo();
}

winSkillPoints.SetText(player.SkillPointsAvail);
EnableButtons();
Super.RefreshWindow(DeltaTime);

SelectNextSkillButton


local int skillIndex;


skillIndex = GetCurrentSkillButtonIndex();

if (++skillIndex >= GetSkillButtonCount())
skillIndex = 0;

skillButtons[skillIndex].ActivateButton(IK_LeftMouse);

SelectPreviousSkillButton


local int skillIndex;


skillIndex = GetCurrentSkillButtonIndex();

if (--skillIndex < 0)
skillIndex = GetSkillButtonCount() - 1;

skillButtons[skillIndex].ActivateButton(IK_LeftMouse);

SelectSkillButton (PersonaSkillButtonWindow buttonPressed)


// Don't do extra work.
if (selectedSkillButton != buttonPressed)
{
// Deselect current button
if (selectedSkillButton != None)
selectedSkillButton.SelectButton(False);

selectedSkillButton = buttonPressed;
selectedSkill = selectedSkillButton.GetSkill();

selectedSkill.UpdateInfo(winInfo);
selectedSkillButton.SelectButton(True);

EnableButtons();
}

UpgradeSkill


// First make sure we have a skill selected
if ( selectedSkill == None )
return;

selectedSkill.IncLevel();
selectedSkillButton.RefreshSkillInfo();

// Send status message
winStatus.AddText(Sprintf(SkillUpgradedLevelLabel, selectedSkill.SkillName));

winSkillPoints.SetText(player.SkillPointsAvail);

EnableButtons();

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bHandled;


bHandled = True;

switch( key )
{
case IK_Up:
SelectPreviousSkillButton();
break;

case IK_Down:
SelectNextSkillButton();
break;

default:
bHandled = False;
break;
}

return bHandled;




PersonaScrollAreaWindow.uc (extends ScrollAreaWindow)

var DeusExPlayer player;
var Color colButtonFace;
colButtonFace=(R=255,G=255,B=255)

InitWindow


Super.InitWindow();
EnableScrolling(False, True);
SetAreaMargins(0, 0);
SetScrollbarDistance(0);

vScale.SetThumbCaps(
Texture'PersonaScrollThumb_Top',
Texture'PersonaScrollThumb_Bottom',
7, 4, 7, 4);

// TODO: Replace Menu sounds with HUD sounds

vScale.SetThumbTexture(Texture'PersonaScrollThumb_Center', 7, 2);
vScale.SetScaleTexture(Texture'PersonaScrollScale', 11, 2, 0, 0);
vScale.SetScaleMargins(0, 0);
vScale.SetScaleStyle(DSTY_Translucent);
vScale.SetThumbStyle(DSTY_Translucent);
vScale.SetThumbStep(10);
vScale.SetScaleSounds(Sound'Menu_Press', Sound'Menu_Press', Sound'Menu_Slider');
vScale.SetSoundVolume(0.25);

upButton.SetSize(11, 12);
upButton.SetBackgroundStyle(DSTY_Translucent);
upButton.SetButtonTextures(
Texture'PersonaScrollUpButton_Normal', Texture'PersonaScrollUpButton_Pressed',
Texture'PersonaScrollUpButton_Focus', Texture'PersonaScrollUpButton_Pressed',
Texture'PersonaScrollUpButton_Normal', Texture'PersonaScrollUpButton_Pressed');
upButton.SetButtonSounds(None, Sound'Menu_Press');
upButton.SetFocusSounds(Sound'Menu_Focus');
upButton.SetSoundVolume(0.25);

downButton.SetSize(11, 12);
downButton.SetBackgroundStyle(DSTY_Translucent);
downButton.SetButtonTextures(
Texture'PersonaScrollDownButton_Normal', Texture'PersonaScrollDownButton_Pressed',
Texture'PersonaScrollDownButton_Focus', Texture'PersonaScrollDownButton_Pressed',
Texture'PersonaScrollDownButton_Normal', Texture'PersonaScrollDownButton_Pressed');
downButton.SetButtonSounds(None, Sound'Menu_Press');
downButton.SetFocusSounds(Sound'Menu_Focus');
downButton.SetSoundVolume(0.25);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colButtonFace = theme.GetColorFromName('HUDColor_ButtonFace');

upButton.SetButtonColors(colButtonFace, colButtonFace, colButtonFace,
colButtonFace, colButtonFace, colButtonFace);

downButton.SetButtonColors(colButtonFace, colButtonFace, colButtonFace,
colButtonFace, colButtonFace, colButtonFace);

vScale.SetScaleColor(colButtonFace);
vScale.SetThumbColor(colButtonFace);




PersonaSkillButtonWindow.uc (extends PersonaBorderButtonWindow)

var Window winIcon;
var PersonaSkillTextWindow winName;
var PersonaSkillTextWindow winLevel;
var PersonaSkillTextWindow winPointsNeeded;
var PersonaLevelIconWindow winLevelIcons;
var Skill skill;
var Bool bSelected;
var Localized String NotAvailableLabel;
NotAvailableLabel="N/A"
Left_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.PersonaSkillsButtonNormal_Left',Width=4)
Left_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.PersonaSkillsButtonFocus_Left',Width=4)
Right_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.PersonaSkillsButtonNormal_Right',Width=8)
Right_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.PersonaSkillsButtonFocus_Right',Width=8)
Center_Textures(0)=(Tex=Texture'DeusExUI.UserInterface.PersonaSkillsButtonNormal_Center',Width=4)
Center_Textures(1)=(Tex=Texture'DeusExUI.UserInterface.PersonaSkillsButtonFocus_Center',Width=4)
fontButtonText=Font'DeusExUI.FontMenuTitle'
buttonHeight=27
minimumButtonWidth=50

CreateControls


winIcon = NewChild(Class'Window');
winIcon.SetBackgroundStyle(DSTY_Masked);
winIcon.SetPos(1, 1);
winIcon.SetSize(24, 24);

winName = PersonaSkillTextWindow(NewChild(Class'PersonaSkillTextWindow'));
winName.SetPos(28, 0);
winName.SetSize(138, 27);
winName.SetFont(Font'FontMenuHeaders');

winLevel = PersonaSkillTextWindow(NewChild(Class'PersonaSkillTextWindow'));
winLevel.SetPos(165, 0);
winLevel.SetSize(54, 27);

winLevelIcons = PersonaLevelIconWindow(NewChild(Class'PersonaLevelIconWindow'));
winLevelIcons.SetPos(229, 11);

winPointsNeeded = PersonaSkillTextWindow(NewChild(Class'PersonaSkillTextWindow'));
winPointsNeeded.SetPos(264, 0);
winPointsNeeded.SetSize(30, 27);
winPointsNeeded.SetTextAlignments(HALIGN_Right, VALIGN_Center);

GetSkill -> Skill


return skill;

InitWindow


Super.InitWindow();

SetWidth(302);

CreateControls();

RefreshSkillInfo


if (skill != None)
{
winIcon.SetBackground(skill.SkillIcon);
winName.SetText(skill.SkillName);
winLevel.SetText(skill.GetCurrentLevelString());
winLevelIcons.SetLevel(skill.GetCurrentLevel());

if (skill.GetCurrentLevel() == 3)
winPointsNeeded.SetText(NotAvailableLabel);
else
winPointsNeeded.SetText(String(skill.GetCost()));
}

SelectButton (Bool bNewSelected)


bSelected = bNewSelected;

// Update text colors
winName.SetSelected(bSelected);
winLevel.SetSelected(bSelected);
winPointsNeeded.SetSelected(bSelected);
winLevelIcons.SetSelected(bSelected);

SetButtonMetrics


if (bIsSensitive)
{
if (bSelected)
{
textureIndex = 1;
textColorIndex = 2;
}
else
{
textureIndex = 0;
textColorIndex = 0;
}
}
else // disabled
{
textureIndex = 0;
textColorIndex = 3;
}

SetSkill (Skill newSkill)


skill = newSkill;

RefreshSkillInfo();




PersonaSkillTextWindow.uc (extends PersonaNormalTextWindow)

var bool bSelected;

SetSelected (bool bNewSelected)


bSelected = bNewSelected;
StyleChanged();

StyleChanged


local ColorTheme theme;
local Color colText;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
if (bSelected)
colText = theme.GetColorFromName('HUDColor_ButtonTextFocus');
else
colText = theme.GetColorFromName('HUDColor_ButtonTextNormal');

SetTextColor(colText);




PersonaStatusLineWindow.uc (extends TextWindow)

var DeusExPlayer player;
var Font fontText;
var Float logDuration;
var Float logTimer;
fontText=Font'DeusExUI.FontMenuSmall'
logDuration=5.000000

AddText (String newText)


SetText(newText);
logTimer = 0.0;
bTickEnabled = True;

ClearText


SetText("");
bTickEnabled = False;

InitWindow


Super.InitWindow();

SetFont(fontText);
SetWidth(238);
SetTextMargins(2, 1);
SetTextAlignments(HALIGN_Left, VALIGN_Top);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;
local Color colText;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colText = theme.GetColorFromName('HUDColor_ListText');

SetTextColor(colText);

Tick (float deltaTime)


logTimer += deltaTime;

if (logTimer > logDuration)
{
SetText("");
bTickEnabled = False;
}




PersonaTitleTextWindow.uc (extends TextWindow)

var DeusExPlayer player;
var Font fontTitle;
fontTitle=Font'DeusExUI.FontMenuHeaders'

InitWindow


Super.InitWindow();

SetFont(fontTitle);
SetTextMargins(0, 0);

// Get a pointer to the player
player = DeusExPlayer(GetRootWindow().parentPawn);

StyleChanged();

StyleChanged


local ColorTheme theme;
local Color colTitle;


theme = player.ThemeManager.GetCurrentHUDColorTheme();

// Title colors
colTitle = theme.GetColorFromName('HUDColor_TitleText');

SetTextColor(colTitle);




PhilipMead.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.PhilipMeadCarcass'
WalkingSpeed=0.213333
bImportant=True
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.PhilipMeadTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PhilipMeadTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PhilipMeadTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.PhilipMeadTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="PhilipMead"
FamiliarName="Philip Mead"
UnfamiliarName="Philip Mead"



PhilipMeadCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.PhilipMeadTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PhilipMeadTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.PhilipMeadTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.PhilipMeadTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



Phone.uc (extends ElectronicDevices)

var() ERingSound RingSound;
var() EAnswerSound AnswerSound;
var() float ringFreq;
var float ringTimer;
var bool bUsing;
ringFreq=0.010000
ItemName="Telephone"
Mesh=LodMesh'DeusExDeco.Phone'
CollisionRadius=11.870000
CollisionHeight=3.780000
Mass=20.000000
Buoyancy=15.000000

Frob (actor Frobber, Inventory frobWith)


local float rnd;


Super.Frob(Frobber, frobWith);

if (bUsing)
return;

SetTimer(3.0, False);
bUsing = True;

rnd = FRand();

if (rnd < 0.1)
PlaySound(sound'PhoneBusy', SLOT_Misc,,, 256);
else if (rnd < 0.2)
PlaySound(sound'PhoneDialtone', SLOT_Misc,,, 256);
else if (rnd < 0.4)
PlaySound(sound'PhoneVoice1', SLOT_Misc,,, 256);
else if (rnd < 0.6)
PlaySound(sound'PhoneVoice2', SLOT_Misc,,, 256);
else if (rnd < 0.8)
PlaySound(sound'PhoneVoice3', SLOT_Misc,,, 256);
else
PlaySound(sound'PhoneVoice4', SLOT_Misc,,, 256);

Tick (float deltaTime)


Super.Tick(deltaTime);

ringTimer += deltaTime;

if (ringTimer >= 1.0)
{
ringTimer -= 1.0;

if (FRand() < ringFreq)
{
switch (RingSound)
{
case RS_Office1: PlaySound(sound'PhoneRing1', SLOT_Misc,,, 256); break;
case RS_Office2: PlaySound(sound'PhoneRing2', SLOT_Misc,,, 256); break;
}
}
}

Timer


bUsing = False;




PickupDistributor.uc (extends Keypoint)

var() name ScriptedPawnTag;
var() name KeyID;
var() localized String Description;
var() ESkinColor SkinColor;
var() localized SNanoKeyInitStruct NanoKeyData[8];
bStatic=False

PostPostBeginPlay


local int i;
local ScriptedPawn P;
local NanoKey key;


Super.PostPostBeginPlay();

for(i=0; i {
if (NanoKeyData[i].ScriptedPawnTag != '')
{
foreach AllActors(class'ScriptedPawn', P, NanoKeyData[i].ScriptedPawnTag)
{
key = spawn(class'NanoKey', P);
if (key != None)
{
key.KeyID = NanoKeyData[i].KeyID;
key.Description = NanoKeyData[i].Description;
// key.SkinColor = NanoKeyData[i].SkinColor;
key.InitialState = 'Idle2';
key.GiveTo(P);
key.SetBase(P);
}
}
}
}

Destroy();




PictureWindow.uc (extends Window)

var Texture PictureTextures[6];
var Int textureIndex;
var Int colIndex, rowIndex;
var Int textureRows;
var Int textureCols;

DrawWindow (GC gc)


// Draw window background
gc.SetStyle(DSTY_Masked);

textureIndex = 0;

for(rowIndex=0; rowIndex {
for(colIndex=0; colIndex {
gc.DrawIcon(colIndex * 256, rowIndex * 256, pictureTextures[textureIndex]);
textureIndex++;
}
}

SetTextures (Texture newPictureTextures[6], int newTextureCols, int newTextureRows)


textureRows = newTextureRows;
textureCols = newTextureCols;

for(textureIndex=0; textureIndex pictureTextures[textureIndex] = newPictureTextures[textureIndex];




Pigeon.uc (extends Bird)

CarcassType=Class'DeusEx.PigeonCarcass'
WalkingSpeed=0.666667
GroundSpeed=24.000000
WaterSpeed=8.000000
AirSpeed=150.000000
AccelRate=500.000000
JumpZ=0.000000
BaseEyeHeight=3.000000
Health=20
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Fear
HealthHead=20
HealthTorso=20
HealthLegLeft=20
HealthLegRight=20
HealthArmLeft=20
HealthArmRight=20
Alliance=Pigeon
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Pigeon'
CollisionRadius=10.000000
CollisionHeight=3.000000
Mass=2.000000
Buoyancy=2.500000
RotationRate=(Pitch=6000)
BindName="Pigeon"
FamiliarName="Pigeon"
UnfamiliarName="Pigeon"



PigeonCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.PigeonCarcass'
Mesh3=LodMesh'DeusExCharacters.PigeonCarcass'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.PigeonCarcass'
CollisionRadius=13.000000
CollisionHeight=2.600000



PigeonGenerator.uc (extends PawnGenerator)

PawnClasses(0)=(Count=10,PawnClass=Class'DeusEx.Pigeon')
Alliance=Pigeon
ActiveArea=1500.000000
Radius=500.000000
MaxCount=8
bPawnsTransient=True



Pillow.uc (extends DeusExDecoration)

FragType=Class'DeusEx.PaperFragment'
ItemName="Pillow"
Mesh=LodMesh'DeusExDeco.Pillow'
CollisionRadius=17.000000
CollisionHeight=4.130000
Mass=5.000000
Buoyancy=6.000000



Pinball.uc (extends ElectronicDevices)

var bool bUsing;
ItemName="Pinball Machine"
Mesh=LodMesh'DeusExDeco.Pinball'
CollisionRadius=37.000000
CollisionHeight=45.000000
Mass=100.000000
Buoyancy=5.000000

Frob (actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

if (bUsing)
return;

SetTimer(2.0, False);
bUsing = True;

PlaySound(sound'PinballMachine',,,, 256);

Timer


bUsing = False;




Plant1.uc (extends DeusExDecoration)

FragType=Class'DeusEx.PlasticFragment'
ItemName="Houseplant"
Mesh=LodMesh'DeusExDeco.Plant1'
CollisionRadius=11.000000
CollisionHeight=34.500000
Mass=10.000000
Buoyancy=15.000000



Plant2.uc (extends DeusExDecoration)

FragType=Class'DeusEx.PlasticFragment'
ItemName="Houseplant"
Mesh=LodMesh'DeusExDeco.Plant2'
CollisionRadius=23.260000
CollisionHeight=43.880001
Mass=50.000000
Buoyancy=20.000000



Plant3.uc (extends DeusExDecoration)

FragType=Class'DeusEx.PlasticFragment'
ItemName="Houseplant"
Mesh=LodMesh'DeusExDeco.Plant3'
CollisionRadius=13.400000
CollisionHeight=10.680000
Mass=10.000000
Buoyancy=15.000000



PlasmaBolt.uc (extends DeusExProjectile)

var ParticleGenerator pGen1;
var ParticleGenerator pGen2;
var float mpDamage;
var float mpBlastRadius;
mpDamage=8.000000
mpBlastRadius=300.000000
bExplodes=True
blastRadius=128.000000
DamageType=Burned
AccurateRange=14400
maxRange=24000
bIgnoresNanoDefense=True
ItemName="Plasma Bolt"
ItemArticle="a"
speed=1500.000000
MaxSpeed=1500.000000
Damage=40.000000
MomentumTransfer=5000
ImpactSound=Sound'DeusExSounds.Weapons.PlasmaRifleHit'
ExplosionDecal=Class'DeusEx.ScorchMark'
Mesh=LodMesh'DeusExItems.PlasmaBolt'
DrawScale=3.000000
bUnlit=True
LightType=LT_Steady
LightEffect=LE_NonIncidence
LightBrightness=200
LightHue=80
LightSaturation=128
LightRadius=3
bFixedRotationDir=True

Destroyed


if (pGen1 != None)
pGen1.DelayedDestroy();
if (pGen2 != None)
pGen2.DelayedDestroy();

Super.Destroyed();

DrawExplosionEffects (vector HitLocation, vector HitNormal)


local ParticleGenerator gen;


// create a particle generator shooting out plasma spheres
gen = Spawn(class'ParticleGenerator',,, HitLocation, Rotator(HitNormal));
if (gen != None)
{
gen.RemoteRole = ROLE_None;
gen.particleDrawScale = 1.0;
gen.checkTime = 0.10;
gen.frequency = 1.0;
gen.ejectSpeed = 200.0;
gen.bGravity = True;
gen.bRandomEject = True;
gen.particleLifeSpan = 0.75;
gen.particleTexture = Texture'Effects.Fire.Proj_PRifle';
gen.LifeSpan = 1.3;
}

PostBeginPlay


Super.PostBeginPlay();

if ((Level.NetMode == NM_Standalone) || (Level.NetMode == NM_ListenServer))
SpawnPlasmaEffects();

PostNetBeginPlay


if (Role < ROLE_Authority)
SpawnPlasmaEffects();

PreBeginPlay


Super.PreBeginPlay();

Damage = mpDamage;
blastRadius = mpBlastRadius;

SpawnPlasmaEffects


local Rotator rot;

rot = Rotation;
rot.Yaw -= 32768;

pGen2 = Spawn(class'ParticleGenerator', Self,, Location, rot);
if (pGen2 != None)
{
pGen2.RemoteRole = ROLE_None;
pGen2.particleTexture = Texture'Effects.Fire.Proj_PRifle';
pGen2.particleDrawScale = 0.1;
pGen2.checkTime = 0.04;
pGen2.riseRate = 0.0;
pGen2.ejectSpeed = 100.0;
pGen2.particleLifeSpan = 0.5;
pGen2.bRandomEject = True;
pGen2.SetBase(Self);
}





PlasticFragment.uc (extends DeusExFragment)

Fragments(0)=LodMesh'DeusExItems.MetalFragment1'
Fragments(1)=LodMesh'DeusExItems.MetalFragment2'
Fragments(2)=LodMesh'DeusExItems.MetalFragment3'
numFragmentTypes=3
ImpactSound=Sound'DeusExSounds.Generic.PlasticHit1'
MiscSound=Sound'DeusExSounds.Generic.PlasticHit2'
Mesh=LodMesh'DeusExItems.MetalFragment1'
CollisionRadius=6.000000
CollisionHeight=0.000000
Mass=4.000000
Buoyancy=5.000000



PlayMusicWindow.uc (extends ToolWindow)

var RadioBoxWindow radSongType;
var Window winSongType;
var ToolListWindow lstSongs;
var ToolButtonWindow btnPlay;
var ToolButtonWindow btnClose;
var ToolRadioButtonWindow btnAmbient;
var ToolRadioButtonWindow btnCombat;
var ToolRadioButtonWindow btnConversation;
var ToolRadioButtonWindow btnOutro;
var ToolRadioButtonWindow btnDying;
var String songList[35];
var String songNames[35];
var int savedSongSection;
songList(0)="Area51 Bunker"
songList(1)="Area51"
songList(2)="Battery Park"
songList(3)="Credits"
songList(4)="Dance Mix"
songList(5)="Endgame 1"
songList(6)="Endgame 2"
songList(7)="Endgame 3"
songList(8)="Hong Kong Club 2"
songList(9)="Hong Kong Club"
songList(10)="Hong Kong Canal"
songList(11)="Hong Kong Helipad"
songList(12)="Hong Kong"
songList(13)="Intro"
songList(14)="Lebedev"
songList(15)="Liberty Island"
songList(16)="MJ12"
songList(17)="Naval Base"
songList(18)="NYC Bar 2"
songList(19)="NYC Streets 2"
songList(20)="NYC Streets"
songList(21)="Ocean Lab 2"
songList(22)="Ocean Lab"
songList(23)="Paris Cathedral"
songList(24)="Paris Chateau"
songList(25)="Paris Club 2"
songList(26)="Paris Club"
songList(27)="Quotes"
songList(28)="Title"
songList(29)="Training"
songList(30)="Tunnels"
songList(31)="UNATCO Return"
songList(32)="UNATCO"
songList(33)="Vandenberg"
songList(34)="VersaLife"
songNames(0)="Area51Bunker_Music"
songNames(1)="Area51_Music"
songNames(2)="BatteryPark_Music"
songNames(3)="Credits_Music"
songNames(4)="DeusExDanceMix_Music"
songNames(5)="Endgame1_Music"
songNames(6)="Endgame2_Music"
songNames(7)="Endgame3_Music"
songNames(8)="HKClub2_Music"
songNames(9)="HKClub_Music"
songNames(10)="HongKongCanal_Music"
songNames(11)="HongKongHelipad_Music"
songNames(12)="HongKong_Music"
songNames(13)="Intro_Music"
songNames(14)="Lebedev_Music"
songNames(15)="LibertyIsland_Music"
songNames(16)="MJ12_Music"
songNames(17)="NavalBase_Music"
songNames(18)="NYCBar2_Music"
songNames(19)="NYCStreets2_Music"
songNames(20)="NYCStreets_Music"
songNames(21)="OceanLab2_Music"
songNames(22)="OceanLab_Music"
songNames(23)="ParisCathedral_Music"
songNames(24)="ParisChateau_Music"
songNames(25)="ParisClub2_Music"
songNames(26)="ParisClub_Music"
songNames(27)="Quotes_Music"
songNames(28)="Title_Music"
songNames(29)="Training_Music"
songNames(30)="Tunnels_Music"
songNames(31)="UNATCOReturn_Music"
songNames(32)="UNATCO_Music"
songNames(33)="Vandenberg_Music"
songNames(34)="VersaLife_Music"

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnPlay:
PlaySong(lstSongs.GetSelectedRow());
break;

case btnClose:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated( buttonPressed );

return bHandled;

CreateControls


// Songslist box
CreateSongsList();

// Create a RadioBox window for the boolean radiobuttons
radSongType = RadioBoxWindow(NewChild(Class'RadioBoxWindow'));
radSongType.SetPos(280, 65);
radSongType.SetSize(100, 130);
winSongType = radSongType.NewChild(Class'Window');

btnAmbient = ToolRadioButtonWindow(winSongType.NewChild(Class'ToolRadioButtonWindow'));
btnAmbient.SetText("|&Ambient");
btnAmbient.SetPos(0, 0);

btnCombat = ToolRadioButtonWindow(winSongType.NewChild(Class'ToolRadioButtonWindow'));
btnCombat.SetText("Co|&mbat");
btnCombat.SetPos(0, 20);

btnConversation = ToolRadioButtonWindow(winSongType.NewChild(Class'ToolRadioButtonWindow'));
btnConversation.SetText("Co|&nvo");
btnConversation.SetPos(0, 40);

btnOutro = ToolRadioButtonWindow(winSongType.NewChild(Class'ToolRadioButtonWindow'));
btnOutro.SetText("|&Outro");
btnOutro.SetPos(0, 60);

btnDying = ToolRadioButtonWindow(winSongType.NewChild(Class'ToolRadioButtonWindow'));
btnDying.SetText("|&Dying");
btnDying.SetPos(0, 80);

btnAmbient.SetToggle(True);

// Buttons
btnPlay = CreateToolButton(280, 362, "Play |&Song");
btnClose = CreateToolButton(280, 387, "|&Close");

CreateSongsList


// Now create the List Window
lstSongs = CreateToolList(15, 38, 255, 372);
lstSongs.EnableMultiSelect(False);
lstSongs.EnableAutoExpandColumns(True);
lstSongs.SetColumns(2);
lstSongs.HideColumn(1);

DestroyWindow


// Shut down the music
player.ClientSetMusic(player.Level.Song, savedSongSection, 255, MTRAN_FastFade);

EnableButtons


btnPlay.SetSensitivity( lstSongs.GetNumSelectedRows() > 0 );

InitWindow


Super.InitWindow();

// Center this window
SetSize(370, 430);
SetTitle("Play Song");

// Create the controls
CreateControls();
PopulateSongsList();

// Save current song playing
savedSongSection = player.SongSection;

ListRowActivated (window list, int rowId) -> bool


PlaySong(rowID);
return true;

ListSelectionChanged (window list, int numSelections, int focusRowId) -> bool


EnableButtons();

return true;

PlaySong (int rowID)


local String songName;
local Int songSection;


// 0 - Ambient 1
// 1 - Dying
// 2 - Ambient 2 (optional)
// 3 - Combat
// 4 - Conversation
// 5 - Outro

if (btnAmbient.GetToggle())
songSection = 0;
else if (btnCombat.GetToggle())
songSection = 3;
else if (btnConversation.GetToggle())
songSection = 4;
else if (btnOutro.GetToggle())
songSection = 5;
else if (btnDying.GetToggle())
songSection = 1;

songName = lstSongs.GetField(rowID, 1);
player.PlayMusic(songName, songSection);

PopulateSongsList


local int songIndex;


lstSongs.DeleteAllRows();

for( songIndex=0; songIndex lstSongs.AddRow(songList[songIndex] $ ";" $ songNames[songIndex]);

// Sort the maps by name
lstSongs.Sort();

EnableButtons();




PoisonGas.uc (extends Cloud)

Texture=WetTexture'Effects.Smoke.Gas_Poison_A'



PoolTableLight.uc (extends HangingDecoration)

bNoPitch=True
FragType=Class'DeusEx.GlassFragment'
ItemName="Hanging Light"
Mesh=LodMesh'DeusExDeco.PoolTableLight'
PrePivot=(Z=31.750000)
bUnlit=True
CollisionRadius=37.000000
CollisionHeight=31.750000
Mass=40.000000
Buoyancy=40.000000



Poolball.uc (extends DeusExDecoration)

var() ESkinColor SkinColor;
var bool bJustHit;
bInvincible=True
ItemName="Poolball"
bPushable=False
Physics=PHYS_Rolling
Mesh=LodMesh'DeusExDeco.Poolball'
CollisionRadius=1.700000
CollisionHeight=1.700000
bBounce=True
Mass=5.000000
Buoyancy=2.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_1: Skin = Texture'PoolballTex1'; break;
case SC_2: Skin = Texture'PoolballTex2'; break;
case SC_3: Skin = Texture'PoolballTex3'; break;
case SC_4: Skin = Texture'PoolballTex4'; break;
case SC_5: Skin = Texture'PoolballTex5'; break;
case SC_6: Skin = Texture'PoolballTex6'; break;
case SC_7: Skin = Texture'PoolballTex7'; break;
case SC_8: Skin = Texture'PoolballTex8'; break;
case SC_9: Skin = Texture'PoolballTex9'; break;
case SC_10: Skin = Texture'PoolballTex10'; break;
case SC_11: Skin = Texture'PoolballTex11'; break;
case SC_12: Skin = Texture'PoolballTex12'; break;
case SC_13: Skin = Texture'PoolballTex13'; break;
case SC_14: Skin = Texture'PoolballTex14'; break;
case SC_15: Skin = Texture'PoolballTex15'; break;
case SC_Cue: Skin = Texture'PoolballTex16'; break;
}

Bump (actor Other)


local Vector HitNormal;


if (Other.IsA('Poolball'))
{
if (!Poolball(Other).bJustHit)
{
PlaySound(sound'PoolballClack', SLOT_None);
HitNormal = Normal(Location - Other.Location);
Velocity = HitNormal * VSize(Other.Velocity);
Velocity.Z = 0;
bJustHit = True;
Poolball(Other).bJustHit = True;
SetTimer(0.02, False);
Poolball(Other).SetTimer(0.02, False);
}
}

Frob (Actor Frobber, Inventory frobWith)


Velocity = Normal(Location - Frobber.Location) * 400;
Velocity.Z = 0;

HitWall (vector HitNormal, actor HitWall)


local Vector newloc;


// if we hit the ground, make sure we are rolling
if (HitNormal.Z == 1.0)
{
SetPhysics(PHYS_Rolling, HitWall);
if (Physics == PHYS_Rolling)
{
bFixedRotationDir = False;
Velocity = vect(0,0,0);
return;
}
}

Velocity = 0.9*((Velocity dot HitNormal) * HitNormal * (-2.0) + Velocity); // Reflect off Wall w/damping
Velocity.Z = 0;
newloc = Location + HitNormal; // move it out from the wall a bit
SetLocation(newloc);

Tick (float deltaTime)


local float speed;


speed = VSize(Velocity);

if ((speed >= 0) && (speed < 5))
{
bFixedRotationDir = False;
Velocity = vect(0,0,0);
}
else if (speed >= 5)
{
bFixedRotationDir = True;
SetRotation(Rotator(Velocity));
RotationRate.Pitch = speed * 60000;
}

Timer


bJustHit = False;




Pot1.uc (extends DeusExDecoration)

bCanBeBase=True
ItemName="Clay Pot"
Mesh=LodMesh'DeusExDeco.Pot1'
CollisionRadius=11.090000
CollisionHeight=7.400000
Mass=20.000000
Buoyancy=5.000000



Pot2.uc (extends DeusExDecoration)

bCanBeBase=True
ItemName="Clay Pot"
Mesh=LodMesh'DeusExDeco.Pot2'
CollisionRadius=7.980000
CollisionHeight=13.000000
Mass=20.000000
Buoyancy=5.000000



ProgressBarWindow.uc (extends Window)

var Float lowValue;
var Float highValue;
var Float currentValue;
var Int barSize;
var Color colBackground;
var Color colForeground;
var Bool bVertical;
var Bool bUseScaledColor;
var Bool bDrawBackground;
var Float scaleColorModifier;
colBackground=(R=255,G=255,B=255)
colForeground=(R=32,G=32,B=32)
scaleColorModifier=1.000000

ConfigurationChanged


UpdateBars();

DrawWindow (GC gc)


Super.DrawWindow(gc);

// First draw the background
if (bDrawBackground)
{
gc.SetTileColor(colBackground);
gc.DrawPattern(0, 0, width, height, 0, 0, Texture'Solid');
}

// Now draw the foreground
gc.SetTileColor(colForeground);

if (bVertical)
gc.DrawPattern(0, height - barSize, width, barSize, 0, 0, Texture'Solid');
else
gc.DrawPattern(0, 0, barSize, height, 0, 0, Texture'Solid');

GetBarColor -> Color


return colForeground;

SetBackColor (Color newBack)


colBackground = newBack;

SetColors (Color newBack, Color newFore)


colBackground = newBack;
colForeground = newFore;

SetCurrentValue (Float newValue)


// First clamp the value
newValue = Max(lowValue, newValue);
newValue = Min(highValue, newValue);

currentValue = newValue;

UpdateBars();

SetDrawBackground (Bool bNewDraw)


bDrawBackground = bNewDraw;

SetScaleColorModifier (Float newModifier)


scaleColorModifier = newModifier;

SetValues (float newLow, float newHigh)


lowValue = newLow;
highValue = newHigh;

// Update bars
UpdateBars();

SetVertical (Bool bNewVertical)


bVertical = bNewVertical;

UpdateBars


local Float valuePercent;


// Now calculate how large the bar is
valuePercent = currentValue / Abs(highValue - lowValue);

if (bVertical)
barSize = valuePercent * height;
else
barSize = valuePercent * width;

// Calculate the bar color
if (bUseScaledColor)
{
colForeground = GetColorScaled(valuePercent);

colForeground.r = Int(Float(colForeground.r) * scaleColorModifier);
colForeground.g = Int(Float(colForeground.g) * scaleColorModifier);
colForeground.b = Int(Float(colForeground.b) * scaleColorModifier);
}
else
{
colForeground = Default.colForeground;
}

UseScaledColor (Bool bNewScaled)


bUseScaledColor = bNewScaled;




ProjectileGenerator.uc (extends Effects)

var() float Frequency; // what's the chance of spewing an actor every checkTime seconds
var() float EjectSpeed; // how fast do the actors get ejected
var() class ProjectileClass; // class to project
var() float ProjectileLifeSpan; // how long each projectile lives
var() bool bTriggered; // start by triggering?
var() float SpewTime; // how long do I spew after I am triggered?
var() bool bRandomEject; // random eject velocity vector
var() float CheckTime; // how often should I spit out particles?
var() sound SpawnSound; // sound to play when spawned
var() float SpawnSoundRadius; // radius of sound
var() bool bAmbientSound; // play the ambient sound?
var() int NumPerSpawn; // number of particles to spawn per puff
var() name AttachTag; // attach us to this actor
var() bool bSpewUnseen; // spew stuff when players can't see us
var() float WaitTime; // amount of time between bursts
var() bool bOnlyOnce; // fire projectiles one time only
var() bool bInitiallyOn; // if triggered, start on instead of off
var bool bSpewing; // am I spewing?
var bool bFrozen; // are we out of the player's sight?
var float period;
var float time;
Frequency=1.000000
ejectSpeed=300.000000
ProjectileClass=Class'DeusEx.Fireball'
checkTime=0.250000
SpawnSoundRadius=1024.000000
numPerSpawn=1
bInitiallyOn=True
bSpewing=True
bHidden=True
bDirectional=True
DrawType=DT_Sprite
Texture=Texture'Engine.S_Inventory'
CollisionRadius=40.000000
CollisionHeight=40.000000

PostBeginPlay


local Actor A;


Super.PostBeginPlay();

if (bTriggered && !bInitiallyOn)
bSpewing = False;

// Attach us to the actor that was tagged
if (attachTag != '')
foreach AllActors(class'Actor', A, attachTag)
if (A != None)
{
SetOwner(A);
SetBase(A);
}

Tick (float deltaTime)


local int i, j;
local int count;
local actor spawnee;
local float speed;
local float timeVal;
local vector dir;


Super.Tick(deltaTime);

// If the owner that I'm attached to is dead, kill me
if ((attachTag != '') && (Owner == None))
Destroy();

// Update timers
time += deltaTime;
period += deltaTime;

// If we're spewing and it's time to stop, stop
if (bSpewing)
{
if (SpewTime > 0)
{
if (period >= SpewTime)
{
period = 0;
time = 0;
bSpewing = False;
}
}
else
period = 0;
}

// If we're not spewing and it's time to start, start
else if (!bOnlyOnce)
{
if (WaitTime > 0)
{
if (period >= WaitTime)
{
period = 0;
time = 0;
bSpewing = True;
}
}
else
period = 0;
}

// CNN - remove optimizaions to fix strange behavior of PlayerCanSeeMe()
/*
// Should we freeze the spewage?
if (bSpewUnseen)
bFrozen = False;
else if (PlayerCanSeeMe())
bFrozen = False;
else
bFrozen = True;
*/
// Are we spewing?
if (!bSpewing || bFrozen)
return;

// Is it time to start spewing?
if (time >= CheckTime)
{
// How many projectiles must we spew?
if (CheckTime > 0)
{
count = int(time/CheckTime);
time = time - count*CheckTime;
}
else
{
count = 1;
time = 0;
}
timeVal = time;

// Sanity check
if (count > 5)
count = 5;

// If frequency < 1, make spewage random
if (FRand() <= frequency)
{
if (spawnSound != None)
PlaySound(spawnSound, SLOT_Misc,,, SpawnSoundRadius);

// Spawn an appropriate number of projectiles
for (i=0; i {
for (j=0; j {
// Wayyy down upon the spawnee river...
spawnee = spawn(ProjectileClass, Owner);
if (spawnee != None)
{
if (bRandomEject)
dir = VRand();
else
dir = vector(Rotation);

speed = EjectSpeed;
if (bRandomEject)
speed *= FRand();

spawnee.SetRotation(rotator(dir));
spawnee.Velocity = speed*dir;
spawnee.Acceleration = dir;
spawnee.SetLocation(spawnee.Velocity*timeVal+Location);

if (ProjectileLifeSpan > 0)
spawnee.LifeSpan = ProjectileLifeSpan;
}
}
timeVal += CheckTime;
}
}
}


Trigger (Actor Other, Pawn EventInstigator)


Super.Trigger(Other, EventInstigator);

// if we are spewing, turn us off
if (bSpewing)
{
bSpewing = False;
period = 0;
time = 0;
if (bAmbientSound && (AmbientSound != None))
SoundVolume = 0;
}
else if (!bOnlyOnce) // otherwise, turn us on
{
bSpewing = True;
period = 0;
time = 0;
if (bAmbientSound && (AmbientSound != None))
SoundVolume = 255;
}




QuotesWindow.uc (extends CreditsScrollWindow)

var Texture TeamPhotoTextures[6];
var bool bClearStack;
TeamPhotoTextures(0)=Texture'DeusExUI.UserInterface.TeamBack_1'
TeamPhotoTextures(1)=Texture'DeusExUI.UserInterface.TeamBack_2'
TeamPhotoTextures(2)=Texture'DeusExUI.UserInterface.TeamBack_3'
ScrollMusicString="Quotes_Music.Quotes_Music"
textName=DeusExQuotes
colHeader=(R=192,B=192)
colText=(R=128,G=255,B=128)

CreateControls


local int logoIndex;


for(logoIndex=0; logoIndex<10; logoIndex++)
CreateLogo();

Super.CreateControls();


local SpinningLogoWindow winLogo;


winLogo = SpinningLogoWindow(NewChild(Class'SpinningLogoWindow'));
winLogo.SetPos(Rand(root.width), Rand(root.height));
winLogo.horizontalDir = Rand(320) - 160;
winLogo.verticalDir = Rand(320) - 160;

winLogo.Lower();

DeleteAllLogos


local Window currentWindow;
local Window nextWindow;


// Loop through the windows and when we find a logo, delete it!

currentWindow = GetTopChild();
while(currentWindow != None)
{
nextWindow = currentWindow.GetLowerSibling();

if (currentWindow.IsA('SpinningLogoWindow'))
{
currentWindow.Destroy();
}

currentWindow = nextWindow;
}


local Window currentWindow;


// Loop through the windows and when we find the first
// logo, delete it then abort

currentWindow = GetTopChild();
while(currentWindow != None)
{
if (currentWindow.IsA('SpinningLogoWindow'))
{
currentWindow.Destroy();
break;
}
currentWindow = currentWindow.GetLowerSibling();
}

DestroyWindow


// Check to see if we need to load the intro
if (bLoadIntro)
{
player.Level.Game.SendPlayer(player, "dxonly");
}
Super.DestroyWindow();

FinishedScrolling


if (bClearStack)
root.ClearWindowStack();
else
Super.FinishedScrolling();

ProcessFinished


PrintLn();
PrintPicture(TeamPhotoTextures, 3, 1, 600, 214);
Super.ProcessFinished();

ProcessQuoteLine (String parseText)


local string personText;
local string quoteText;
local int colonPos;


// Find the colon
colonPos = InStr(parseText, ":");

if (colonPos == -1)
{
PrintText(parseText);
}
else
{
PrintAlignText(Left(parseText, colonPos + 1), Right(parseText, Len(parseText) - colonPos - 1));
}

ProcessTextTag (DeusExTextParser parser)


local String text;
local byte tag;
local bool bTagHandled;


bTagHandled = False;

tag = parser.GetTag();

switch(tag)
{
case 0: // TT_Text:
text = parser.GetText();

if (text == "")
{
PrintLn();
}
else
{
if (bBold)
{
bBold = False;
PrintHeader(parser.GetText());
}
else
{
ProcessQuoteLine(parser.GetText());
}
}
bTagHandled = True;
break;
}

if (!bTagHandled)
Super.ProcessTextTag(parser);

SetClearStack (bool bNewClearStack)


bClearStack = bNewClearStack;

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bKeyHandled;


bKeyHandled = True;

if ( IsKeyDown( IK_Alt ) || IsKeyDown( IK_Shift ) )
return False;

switch( key )
{
case IK_Escape:
FinishedScrolling();
break;

case IK_Insert:
CreateLogo();
break;

case IK_Delete:
DeleteLogo();
break;

case IK_End:
DeleteAllLogos();
break;

default:
bKeyHandled = False;
break;
}

if (bKeyHandled)
return bKeyHandled;
else
return Super.VirtualKeyPressed(key, bRepeat);




RachelMead.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.RachelMeadCarcass'
WalkingSpeed=0.320000
bImportant=True
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.RachelMeadTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.RachelMeadTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.RachelMeadTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.RachelMeadTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.RachelMeadTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.RachelMeadTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="RachelMead"
FamiliarName="Rachel Mead"
UnfamiliarName="Rachel Mead"



RachelMeadCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.RachelMeadTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.RachelMeadTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.RachelMeadTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.RachelMeadTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.RachelMeadTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.RachelMeadTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



RandomEvents.uc (extends Keypoint)

var() Name Events[8];
var() float frequency[8];
var() bool bLOSRequired; // if true, then events only happen when player is looking
var byte num;
var float timer;
Frequency(0)=0.125000
Frequency(1)=0.125000
Frequency(2)=0.125000
Frequency(3)=0.125000
Frequency(4)=0.125000
Frequency(5)=0.125000
Frequency(6)=0.125000
Frequency(7)=0.125000
bLOSRequired=True
bStatic=False

BeginPlay


local int i;


Super.BeginPlay();

num = 0;
timer = 0;
for (i=0; i<8; i++)
{
if (Events[i] == '')
break;
num++;
}

Tick (float deltaTime)


local int i;
local float rnd, freq, diff;
local Actor A;


Super.Tick(deltaTime);

if (bLOSRequired && !PlayerCanSeeMe())
return;

// test for a new event possibility
if (timer >= 1.0)
{
rnd = FRand();
freq = 0;
for (i=0; i {
// make the test percentage cumulative
freq += frequency[i];

if (rnd < freq)
{
// trigger it!
if(Events[i] != '')
foreach AllActors(class 'Actor', A, Events[i])
A.Trigger(Self, None);

timer = 0;
return;
}
}

timer -=1.0;
}

timer += deltaTime;




RandomSounds.uc (extends Keypoint)

var() Sound sounds[8];
var() float frequency[8];
var() byte bAmbient[8];
var() float minDuration[8];
var() float maxDuration[8];
var() byte Volume[8];
var() byte Pitch[8];
var() byte bFade[8];
var() byte bFakeDoppler[8];
var byte num;
var byte cur;
var float timer;
var float duration;
var bool bPlaying;
Frequency(0)=0.125000
Frequency(1)=0.125000
Frequency(2)=0.125000
Frequency(3)=0.125000
Frequency(4)=0.125000
Frequency(5)=0.125000
Frequency(6)=0.125000
Frequency(7)=0.125000
minDuration(0)=4.000000
minDuration(1)=4.000000
minDuration(2)=4.000000
minDuration(3)=4.000000
minDuration(4)=4.000000
minDuration(5)=4.000000
minDuration(6)=4.000000
minDuration(7)=4.000000
maxDuration(0)=8.000000
maxDuration(1)=8.000000
maxDuration(2)=8.000000
maxDuration(3)=8.000000
maxDuration(4)=8.000000
maxDuration(5)=8.000000
maxDuration(6)=8.000000
maxDuration(7)=8.000000
Volume(0)=128
Volume(1)=128
Volume(2)=128
Volume(3)=128
Volume(4)=128
Volume(5)=128
Volume(6)=128
Volume(7)=128
Pitch(0)=64
Pitch(1)=64
Pitch(2)=64
Pitch(3)=64
Pitch(4)=64
Pitch(5)=64
Pitch(6)=64
Pitch(7)=64
bStatic=False
SoundVolume=128

BeginPlay


local int i;


Super.BeginPlay();

num = 0;
timer = 0;
cur = 0;
bPlaying = False;
AmbientSound = None;
for (i=0; i<8; i++)
{
if (sounds[i] == None)
break;
num++;
}

Tick (float deltaTime)


local int i;
local float rnd, freq, diff;


Super.Tick(deltaTime);

// if we are playing, check to see when we should stop
if (bPlaying)
{
// only fade or doppler for ambients
if (bAmbient[cur] > 0)
{
diff = duration - timer;

// fade in until 2 seconds
// scale from 0.0 to 1.0
if ((timer < 2.0) && (bFade[cur] > 0))
SoundVolume = Volume[cur] * (timer / 2.0);

// fade out at 2 seconds left
// scale from 1.0 to 0.0
if ((diff < 2.0) && (bFade[cur] > 0))
SoundVolume = Volume[cur] * (diff / 2.0);

// doppler out at 4 seconds left
// scale from 1.0 to 0.85
if ((diff < 4.0) && (bFakeDoppler[cur] > 0))
SoundPitch = Pitch[cur] * (((diff / 4.0) * 0.15) + 0.85);
}
if (timer > duration)
{
if (bAmbient[cur] > 0)
AmbientSound = None;
timer = 0;
bPlaying = False;
}
}
else if (timer >= 1.0) // otherwise, test for a new sound
{
rnd = FRand();
freq = 0;
for (i=0; i {
// make the test percentage cumulative
freq += frequency[i];

if (rnd < freq)
{
if (bAmbient[i] > 0)
{
AmbientSound = sounds[i];
duration = FRand() * (maxDuration[i] - minDuration[i]) + minDuration[i];
SoundVolume = Volume[i];
SoundPitch = Pitch[i];
}
else
{
PlaySound(sounds[i], SLOT_None);
duration = 2; // 2 seconds for one-shot sounds
}

cur = i;
timer = 0;
bPlaying = True;
return;
}
}

timer -=1.0;
}

timer += deltaTime;




Rat.uc (extends Animal)

var(AI) float MinLightLevel;
var(AI) float MaxLightLevel;
var(AI) float ReactionTime;
var(AI) float MaxWaitTime;
var float ComputedSpeed;
var float LastAgitation;
var float CurrentAgitation;
var float time;
MinLightLevel=0.030000
MaxLightLevel=0.080000
ReactionTime=0.500000
MaxWaitTime=10.000000
bFleeBigPawns=True
Restlessness=0.900000
Wanderlust=0.200000
MinHealth=2.000000
CarcassType=Class'DeusEx.RatCarcass'
WalkingSpeed=0.360000
GroundSpeed=250.000000
WaterSpeed=24.000000
AirSpeed=150.000000
AccelRate=500.000000
JumpZ=0.000000
MaxStepHeight=8.000000
BaseEyeHeight=1.000000
Health=5
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Fear
HitSound1=Sound'DeusExSounds.Animal.RatSqueak1'
HitSound2=Sound'DeusExSounds.Animal.RatSqueak3'
Die=Sound'DeusExSounds.Animal.RatDie'
HealthHead=5
HealthTorso=5
HealthLegLeft=5
HealthLegRight=5
HealthArmLeft=5
HealthArmRight=5
Alliance=Rat
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Rat'
CollisionRadius=16.000000
CollisionHeight=3.500000
bBlockActors=False
Mass=2.000000
Buoyancy=2.000000
RotationRate=(Yaw=65530)
BindName="Rat"
FamiliarName="Rat"
UnfamiliarName="Rat"

BeginState


Super.BeginState();

Bump (actor bumper)


if (bAcceptBump)
{
// If we get bumped by another actor while we wait, start wandering again
bAcceptBump = False;
Disable('AnimEnd');
GotoState('Wandering', 'Wander');
}

// Handle conversations, if need be
Global.Bump(bumper);

EndState


Super.EndState();

HitWall (vector HitNormal, actor Wall)


if (Physics == PHYS_Falling)
return;
Global.HitWall(HitNormal, Wall);
CheckOpenDoor(HitNormal, Wall);

PickDestination


local float magnitude;
local int iterations;
local bool bSuccess;
local Rotator rot;


MoveTarget = None;
destPoint = None;
iterations = 4; // try up to 4 different directions
while (iterations > 0)
{
// How far will we go?
magnitude = (170*FRand()+80) * (FRand()*0.2+0.9); // 80-250, +/-10%

// Choose our destination, based on whether we have a home base
if (!bUseHome)
bSuccess = AIPickRandomDestination(40, magnitude, 0, 0, 0, 0, 1,
FRand()*0.4+0.35, destLoc);
else
{
if (magnitude > HomeExtent)
magnitude = HomeExtent*(FRand()*0.2+0.9);
rot = Rotator(HomeLoc-Location);
bSuccess = AIPickRandomDestination(50, magnitude, rot.Yaw, 0.25, rot.Pitch, 0.25, 1,
FRand()*0.4+0.35, destLoc);
}

// Success? Break out of the iteration loop
if (bSuccess)
if (IsNearHome(destLoc))
break;

// We failed -- try again
iterations--;
}

// If we got a destination, go there
if (iterations <= 0)
destLoc = Location;

SetFall


StartFalling('Wandering', 'ContinueWander');

ShouldBeStartled (Pawn startler) -> bool


local float speed;
local float time;
local float dist;
local float dist2;
local bool bPh33r;


bPh33r = false;
if (startler != None)
{
speed = VSize(startler.Velocity);
if (speed >= 20)
{
dist = VSize(Location - startler.Location);
time = dist/speed;
if (time <= 3.0)
{
dist2 = VSize(Location - (startler.Location+startler.Velocity*time));
if (dist2 < speed*1.5)
bPh33r = true;
}
}
}

return bPh33r;

Tick (float deltaTime)


Super.Tick(deltaTime);

time += deltaTime;

// check for random noises
if (time > 1.0)
{
time = 0;
if (FRand() < 0.05)
PlaySound(sound'RatSqueak2', SLOT_None);
}




RatCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.RatCarcass'
Mesh3=LodMesh'DeusExCharacters.RatCarcass'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.RatCarcass'
CollisionRadius=10.000000
CollisionHeight=3.400000



RatGenerator.uc (extends PawnGenerator)

PawnClasses(0)=(Count=5,PawnClass=Class'DeusEx.Rat')
Alliance=Rat
ActiveArea=1600.000000
Radius=200.000000
MaxCount=5
bPawnsTransient=True



Rebreather.uc (extends ChargedPickup)

skillNeeded=Class'DeusEx.SkillEnviro'
LoopSound=Sound'DeusExSounds.Pickup.RebreatherLoop'
ChargedIcon=Texture'DeusExUI.Icons.ChargedIconRebreather'
ExpireMessage="Rebreather power supply used up"
ItemName="Rebreather"
PlayerViewOffset=(X=30.000000,Z=-6.000000)
PlayerViewMesh=LodMesh'DeusExItems.Rebreather'
PickupViewMesh=LodMesh'DeusExItems.Rebreather'
ThirdPersonMesh=LodMesh'DeusExItems.Rebreather'
LandSound=Sound'DeusExSounds.Generic.PaperHit2'
Icon=Texture'DeusExUI.Icons.BeltIconRebreather'
largeIcon=Texture'DeusExUI.Icons.LargeIconRebreather'
largeIconWidth=44
largeIconHeight=34
Description="A disposable chemical scrubber that can extract oxygen from water during brief submerged operations."
beltDescription="REBREATHR"
Mesh=LodMesh'DeusExItems.Rebreather'
CollisionRadius=6.900000
CollisionHeight=3.610000
Mass=10.000000
Buoyancy=8.000000

ChargedPickupUpdate (DeusExPlayer Player)


Super.ChargedPickupUpdate(Player);

Player.swimTimer = Player.swimDuration;




RepairBot.uc (extends Robot)

var int chargeAmount;
var int chargeRefreshTime;
var int mpChargeRefreshTime;
var int mpChargeAmount;
var Float lastchargeTime;
chargeAmount=75
chargeRefreshTime=60
mpChargeRefreshTime=30
mpChargeAmount=100
GroundSpeed=100.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=100.000000
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.RepairBot'
SoundRadius=16
SoundVolume=128
AmbientSound=Sound'DeusExSounds.Robot.RepairBotMove'
CollisionRadius=34.000000
CollisionHeight=47.470001
Mass=150.000000
Buoyancy=97.000000
BindName="RepairBot"
FamiliarName="Repair Bot"
UnfamiliarName="Repair Bot"

ActivateRepairBotScreens (DeusExPlayer PlayerToDisplay)


local DeusExRootWindow root;
local HUDRechargeWindow winCharge;


root = DeusExRootWindow(PlayerToDisplay.rootWindow);
if (root != None)
{
winCharge = HUDRechargeWindow(root.InvokeUIScreen(Class'HUDRechargeWindow', True));
root.MaskBackground( True );
winCharge.SetRepairBot( Self );
}

CanCharge -> bool


return ( (Level.TimeSeconds - int(lastChargeTime)) > chargeRefreshTime);

ChargePlayer (DeusExPlayer PlayerToCharge) -> int


local int chargedPoints;


if ( CanCharge() )
{
chargedPoints = PlayerToCharge.ChargePlayer( chargeAmount );
lastChargeTime = Level.TimeSeconds;
}
return chargedPoints;

Frob (Actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

if (DeusExPlayer(Frobber) == None)
return;

// DEUS_EX AMSD In multiplayer, don't pop up the window, just use them
// In singleplayer, do the old thing.
if (Level.NetMode == NM_Standalone)
{
ActivateRepairBotScreens(DeusExPlayer(Frobber));
}
else
{
if (CanCharge())
{
PlaySound(sound'PlasmaRifleReload', SLOT_None,,, 256);
ChargePlayer(DeusExPlayer(Frobber));
Pawn(Frobber).ClientMessage("Received Recharge");
}
else
{
Pawn(Frobber).ClientMessage("Repairbot still charging, "$int(chargeRefreshTime - (Level.TimeSeconds - lastChargetime))$" seconds to go.");
}
}

GetAvailableCharge -> Int


if (CanCharge())
return chargeAmount;
else
return 0;

GetRefreshTimeRemaining -> Float


return chargeRefreshTime - (Level.TimeSeconds - lastChargeTime);

PostBeginPlay


Super.PostBeginPlay();

if (Level.NetMode != NM_Standalone)
{
chargeRefreshTime = mpChargeRefreshTime;
chargeAmount = mpChargeAmount;
}

if (IsImmobile())
bAlwaysRelevant = True;

lastChargeTime = -chargeRefreshTime;

StandStill


GotoState('Idle', 'Idle');
Acceleration=Vect(0, 0, 0);




RetinalScanner.uc (extends HackableDevices)

var() localized String msgUsed;
msgUsed="Clearance granted"
ItemName="Retinal Scanner"
Mesh=LodMesh'DeusExDeco.RetinalScanner'
SoundRadius=8
SoundVolume=255
SoundPitch=96
AmbientSound=Sound'DeusExSounds.Generic.SecurityL'
CollisionRadius=10.000000
CollisionHeight=11.430000
Mass=30.000000
Buoyancy=40.000000

HackAction (Actor Hacker, bool bHacked)


local Actor A;


Super.HackAction(Hacker, bHacked);

if (bHacked)
if (Event != '')
{
if (Pawn(Hacker) != None)
Pawn(Hacker).ClientMessage(msgUsed);

foreach AllActors(class 'Actor', A, Event)
A.Trigger(Self, Pawn(Hacker));
}




RiotCop.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.RiotCopCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.780000
GroundSpeed=200.000000
Texture=Texture'DeusExCharacters.Skins.VisorTex1'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.RiotCopTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.RiotCopTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.RiotCopTex3'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="RiotCop"
FamiliarName="Riot Cop"
UnfamiliarName="Riot Cop"

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
else if ((damageType == 'TearGas') || (damageType == 'HalonGas'))
GotoNextState();
else if (damageType == 'Stunned')
GotoState('Stunned');
else if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();




RiotCopCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExCharacters.Skins.VisorTex1'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.RiotCopTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.RiotCopTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.RiotCopTex3'



RoadBlock.uc (extends DeusExDecoration)

HitPoints=75
minDamageThreshold=75
FragType=Class'DeusEx.Rockchip'
ItemName="Concrete Barricade"
Mesh=LodMesh'DeusExDeco.RoadBlock'
CollisionRadius=33.000000
CollisionHeight=23.400000
Mass=200.000000
Buoyancy=50.000000



Robot.uc (extends ScriptedPawn)

var(Sounds) sound SearchingSound;
var(Sounds) sound SpeechTargetAcquired;
var(Sounds) sound SpeechTargetLost;
var(Sounds) sound SpeechOutOfAmmo;
var(Sounds) sound SpeechCriticalDamage;
var(Sounds) sound SpeechScanning;
var(Sounds) sound SpeechAreaSecure;
var() int EMPHitPoints;
var ParticleGenerator sparkGen;
var float crazedTimer;
var(Sounds) sound explosionSound;
EMPHitPoints=50
explosionSound=Sound'DeusExSounds.Robot.RobotExplode'
maxRange=512.000000
MinHealth=0.000000
RandomWandering=0.150000
bCanBleed=False
bShowPain=False
bCanSit=False
bAvoidAim=False
bAvoidHarm=False
bHateShot=False
bReactAlarm=True
bReactProjectiles=False
bEmitDistress=False
RaiseAlarm=RAISEALARM_Never
bMustFaceTarget=False
FireAngle=60.000000
MaxProvocations=0
SurprisePeriod=0.000000
EnemyTimeout=7.000000
walkAnimMult=1.000000
bCanStrafe=False
bCanSwim=False
bIsHuman=False
JumpZ=0.000000
MaxStepHeight=4.000000
Health=50
HitSound1=Sound'DeusExSounds.Generic.Spark1'
HitSound2=Sound'DeusExSounds.Generic.Spark1'
Die=Sound'DeusExSounds.Generic.Spark1'
VisibilityThreshold=0.006000
BindName="Robot"

BeginState


StandUp();
BlockReactions(true);
bCanConverse = False;
SeekPawn = None;

DestroyGenerator


if (sparkGen != None)
{
sparkGen.DelayedDestroy();
sparkGen = None;
}

Destroyed


Super.Destroyed();

DestroyGenerator();

EndState


ResetReactions();
bCanConverse = True;

Explode (vector HitLocation)


local int i, num;
local float explosionRadius;
local Vector loc;
local DeusExFragment s;
local ExplosionLight light;


explosionRadius = (CollisionRadius + CollisionHeight) / 2;
PlaySound(explosionSound, SLOT_None, 2.0,, explosionRadius*32);

if (explosionRadius < 48.0)
PlaySound(sound'LargeExplosion1', SLOT_None,,, explosionRadius*32);
else
PlaySound(sound'LargeExplosion2', SLOT_None,,, explosionRadius*32);

AISendEvent('LoudNoise', EAITYPE_Audio, , explosionRadius*16);

// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, HitLocation);
for (i=0; i {
loc = Location + VRand() * CollisionRadius;
if (explosionRadius < 16)
{
Spawn(class'ExplosionSmall',,, loc);
light.size = 2;
}
else if (explosionRadius < 32)
{
Spawn(class'ExplosionMedium',,, loc);
light.size = 4;
}
else
{
Spawn(class'ExplosionLarge',,, loc);
light.size = 8;
}
}

// spawn some metal fragments
num = FMax(3, explosionRadius/6);
for (i=0; i {
s = Spawn(class'MetalFragment', Owner);
if (s != None)
{
s.Instigator = Instigator;
s.CalcVelocity(Velocity, explosionRadius);
s.DrawScale = explosionRadius*0.075*FRand();
s.Skin = GetMeshTexture();
if (FRand() < 0.75)
s.bSmoking = True;
}
}

// cause the damage
HurtRadius(0.5*explosionRadius, 8*explosionRadius, 'Exploded', 100*explosionRadius, Location);

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
else if (!IgnoreDamageType(damageType) && CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

IgnoreDamageType (Name damageType) -> bool


if ((damageType == 'TearGas') || (damageType == 'HalonGas') || (damageType == 'PoisonGas') || (damageType == 'Radiation'))
return True;
else if ((damageType == 'Poison') || (damageType == 'PoisonEffect'))
return True;
else if (damageType == 'KnockedOut')
return True;
else
return False;

ImpartMomentum (Vector momentum, Pawn instigatedBy)


// nil

InitGenerator


local Vector loc;


if ((sparkGen == None) || (sparkGen.bDeleteMe))
{
loc = Location;
loc.z += CollisionHeight/2;
sparkGen = Spawn(class'ParticleGenerator', Self,, loc, rot(16384,0,0));
if (sparkGen != None)
sparkGen.SetBase(Self);
}

IsImmobile -> bool


local bool bHasReactions;
local bool bHasFears;
local bool bHasHates;


if (Orders != 'Standing')
return false;

bHasReactions = bReactFutz || bReactPresence || bReactLoudNoise || bReactAlarm || bReactShot || bReactCarcass || bReactDistress || bReactProjectiles;

bHasFears = bFearHacking || bFearWeapon || bFearShot || bFearInjury || bFearIndirectInjury || bFearCarcass || bFearDistress || bFearAlarm || bFearProjectiles;

bHasHates = bHateHacking || bHateWeapon || bHateShot || bHateInjury || bHateIndirectInjury || bHateCarcass || bHateDistress;

return (!bHasReactions && !bHasFears && !bHasHates);

PickDestination


local int iterations;
local float magnitude;
local rotator rot1;


iterations = 4;
magnitude = 400*(FRand()*0.4+0.8); // 400, +/-20%
rot1 = Rotator(Location-Enemy.Location);
if (!AIPickRandomDestination(40, magnitude, rot1.Yaw, 0.6, rot1.Pitch, 0.6, iterations,
FRand()*0.4+0.35, destLoc))
destLoc = Location; // we give up

PlayAreaSecureSound


PlaySound(SpeechAreaSecure, SLOT_None,,, 2048);

PlayAttack


PlayAnimPivot('Still');

PlayCrawling


LoopAnimPivot('Still');

PlayCriticalDamageSound


PlaySound(SpeechCriticalDamage, SLOT_None,,, 2048);

PlayDisabled


TweenAnimPivot('Still', 0.2);

PlayDuck


TweenAnimPivot('Still', 0.25);

PlayFalling

PlayFiring


LoopAnimPivot('Still',,0.1);

PlayGoingForAlarmSound

PlayIdleSound

PlayLanded (float impactVel)


bIsWalking = True;

PlayOutOfAmmoSound


PlaySound(SpeechOutOfAmmo, SLOT_None,,, 2048);

PlayReload


PlayAnimPivot('Still');

PlayReloadBegin


PlayAnimPivot('Still',, 0.1);

PlayReloadEnd


PlayAnimPivot('Still',, 0.1);

PlayRising


PlayAnimPivot('Still');

PlayRunning


bIsWalking = False;
LoopAnimPivot('Run');

PlayRunningAndFiring


bIsWalking = FALSE;
LoopAnimPivot('Run');

PlayScanningSound


PlaySound(SearchingSound, SLOT_None,,, 2048);
PlaySound(SpeechScanning, SLOT_None,,, 2048);

PlaySearchingSound


PlaySound(SearchingSound, SLOT_None,,, 2048);
PlaySound(SpeechScanning, SLOT_None,,, 2048);

PlayShoot


PlayAnimPivot('Still');

PlaySwimming


LoopAnimPivot('Still');

PlayTargetAcquiredSound


PlaySound(SpeechTargetAcquired, SLOT_None,,, 2048);

PlayTargetLostSound


PlaySound(SpeechTargetLost, SLOT_None,,, 2048);

PlayTurning


LoopAnimPivot('Walk');

PlayWaiting


PlayAnimPivot('Idle');

PlayWalking


bIsWalking = True;
LoopAnimPivot('Walk');

PlayWeaponSwitch (Weapon newWeapon)

ReactToInjury (Pawn instigatedBy, Name damageType, EHitLocation hitPos)


local Pawn oldEnemy;


if (IgnoreDamageType(damageType))
return;

if (EMPHitPoints > 0)
{
if (damageType == 'NanoVirus')
{
oldEnemy = Enemy;
FindBestEnemy(false);
if (oldEnemy != Enemy)
PlayNewTargetSound();
instigatedBy = Enemy;
}
Super.ReactToInjury(instigatedBy, damageType, hitPos);
}

SetOrders (Name orderName, optional Name newOrderTag, optional bool bImmediate)


if (EMPHitPoints > 0) // ignore orders if disabled
Super.SetOrders(orderName, newOrderTag, bImmediate);

ShouldDropWeapon -> bool


return false;

ShouldFlee -> bool


return (Health <= MinHealth);

SpawnCarcass -> Carcass


Explode(Location);

return None;

TakeDamageBase (int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType, bool bPlayAnim)


local float actualDamage;
local int oldEMPHitPoints;


// Robots are invincible to EMP in multiplayer as well
if (( Level.NetMode != NM_Standalone ) && (damageType == 'EMP') && (Self.IsA('MedicalBot') || Self.IsA('RepairBot')) )
return;

if ( bInvincible )
return;

// robots aren't affected by gas or radiation
if (IgnoreDamageType(damageType))
return;

// enough EMP damage shuts down the robot
if (damageType == 'EMP')
{
oldEMPHitPoints = EMPHitPoints;
EMPHitPoints -= Damage;

// make smoke!
if (EMPHitPoints <= 0)
{
EMPHitPoints = 0;
if (oldEMPHitPoints > 0)
{
PlaySound(sound'EMPZap', SLOT_None,,, (CollisionRadius+CollisionHeight)*8, 2.0);
InitGenerator();
if (sparkGen != None)
{
sparkGen.LifeSpan = 6;
sparkGen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
sparkGen.particleDrawScale = 0.3;
sparkGen.bRandomEject = False;
sparkGen.ejectSpeed = 10.0;
sparkGen.bGravity = False;
sparkGen.bParticlesUnlit = True;
sparkGen.frequency = 0.3;
sparkGen.riseRate = 3;
sparkGen.spawnSound = Sound'Spark2';
}
}
AmbientSound = None;
if (GetStateName() != 'Disabled')
GotoState('Disabled');
}

// make sparks!
else if (sparkGen == None)
{
InitGenerator();
if (sparkGen != None)
{
sparkGen.particleTexture = Texture'Effects.Fire.SparkFX1';
sparkGen.particleDrawScale = 0.2;
sparkGen.bRandomEject = True;
sparkGen.ejectSpeed = 100.0;
sparkGen.bGravity = True;
sparkGen.bParticlesUnlit = True;
sparkGen.frequency = 0.2;
sparkGen.riseRate = 10;
sparkGen.spawnSound = Sound'Spark2';
}
}

return;
}
else if (damageType == 'NanoVirus')
{
CrazedTimer += 0.5*Damage;
return;
}

// play a hit sound
PlayTakeHitSound(Damage, damageType, 1);

// increase the pitch of the ambient sound when damaged
if (SoundPitch == Default.SoundPitch)
SoundPitch += 16;

actualDamage = Level.Game.ReduceDamage(Damage, DamageType, self, instigatedBy);

// robots don't have soft, squishy bodies like humans do, so they're less
// susceptible to gunshots...
if (damageType == 'Shot')
actualDamage *= 0.25; // quarter strength

// hitting robots with a prod won't stun them, and will only do a limited
// amount of damage...
else if ((damageType == 'Stunned') || (damageType == 'KnockedOut'))
actualDamage *= 0.5; // half strength

// flame attacks don't really hurt robots much, either
else if ((damageType == 'Flamed') || (damageType == 'Burned'))
actualDamage *= 0.25; // quarter strength

if ((actualDamage > 0.01) && (actualDamage < 1))
actualDamage = 1;
actualDamage = int(actualDamage+0.5);

if (ReducedDamageType == 'All') //God mode
actualDamage = 0;
else if (Inventory != None) //then check if carrying armor
actualDamage = Inventory.ReduceDamage(int(actualDamage), DamageType, HitLocation);

if (!bInvincible)
Health -= int(actualDamage);

if (Health <= 0)
{
ClearNextState();
//PlayDeathHit(actualDamage, hitLocation, damageType);
if ( actualDamage > mass )
Health = -1 * actualDamage;
Enemy = instigatedBy;
Died(instigatedBy, damageType, HitLocation);
}
MakeNoise(1.0);

ReactToInjury(instigatedBy, damageType, HITLOC_None);

Tick (float deltaTime)


local float pct, mod;


Super.Tick(deltaTime);

// DEUS_EX AMSD All the MP robots have massive numbers of EMP hitpoints, not equal to the default. In multiplayer, at least, only do this if
// they are DAMAGED.
if ((Default.EMPHitPoints != EMPHitPoints) && (EMPHitPoints != 0) && ((Level.Netmode == NM_Standalone) || (EMPHitPoints < Default.EMPHitPoints)))
{
pct = (Default.EMPHitPoints - EMPHitPoints) / Default.EMPHitPoints;
mod = pct * (1.0 - (2.0 * FRand()));
DesiredSpeed = MaxDesiredSpeed + (mod * MaxDesiredSpeed * 0.5);
SoundPitch = Default.SoundPitch + (mod * 8.0);
}

if (CrazedTimer > 0)
{
CrazedTimer -= deltaTime;
if (CrazedTimer < 0)
CrazedTimer = 0;
}

if (CrazedTimer > 0)
bReverseAlliances = true;
else
bReverseAlliances = false;

TweenToAttack (float tweentime)


TweenAnimPivot('Still', tweentime);

TweenToRunning (float tweentime)


bIsWalking = False;
PlayAnimPivot('Run',, tweentime);

TweenToRunningAndFiring (float tweentime)


bIsWalking = FALSE;
TweenAnimPivot('Run', tweentime);

TweenToShoot (float tweentime)


TweenAnimPivot('Still', tweentime);

TweenToSwimming (float tweentime)


TweenAnimPivot('Still', tweentime);

TweenToWaiting (float tweentime)


TweenAnimPivot('Idle', tweentime);

TweenToWalking (float tweentime)


bIsWalking = True;
TweenAnimPivot('Walk', tweentime);




Rockchip.uc (extends DeusExFragment)

Fragments(0)=LodMesh'DeusExItems.Rockchip1'
Fragments(1)=LodMesh'DeusExItems.Rockchip2'
Fragments(2)=LodMesh'DeusExItems.Rockchip3'
numFragmentTypes=3
elasticity=0.400000
ImpactSound=Sound'DeusExSounds.Generic.RockHit1'
MiscSound=Sound'DeusExSounds.Generic.RockHit2'
Mesh=LodMesh'DeusExItems.Rockchip1'
CollisionRadius=0.000000
CollisionHeight=0.000000

BeginState


Super.BeginState();

Velocity = VRand() * 100;
DrawScale = (DrawScale * 0.1) + FRand() * 0.25;




Rocket.uc (extends DeusExProjectile)

var float mpBlastRadius;
var ParticleGenerator fireGen;
var ParticleGenerator smokeGen;
mpBlastRadius=192.000000
bExplodes=True
bBlood=True
bDebris=True
blastRadius=192.000000
DamageType=exploded
AccurateRange=14400
maxRange=24000
bTracking=True
ItemName="GEP Rocket"
ItemArticle="a"
speed=1000.000000
MaxSpeed=1500.000000
Damage=300.000000
MomentumTransfer=10000
SpawnSound=Sound'DeusExSounds.Weapons.GEPGunFire'
ImpactSound=Sound'DeusExSounds.Generic.SmallExplosion1'
ExplosionDecal=Class'DeusEx.ScorchMark'
Mesh=LodMesh'DeusExItems.Rocket'
DrawScale=0.250000
SoundRadius=16
SoundVolume=224
AmbientSound=Sound'DeusExSounds.Special.RocketLoop'
RotationRate=(Pitch=32768,Yaw=32768)

Destroyed


if (smokeGen != None)
smokeGen.DelayedDestroy();
if (fireGen != None)
fireGen.DelayedDestroy();

Super.Destroyed();

PostBeginPlay


Super.PostBeginPlay();

if (Level.NetMode == NM_DedicatedServer)
return;

SpawnRocketEffects();

PostNetBeginPlay


Super.PostNetBeginPlay();

if (Role != ROLE_Authority)
SpawnRocketEffects();

PreBeginPlay


Super.PreBeginPlay();

if ( ( Level.NetMode != NM_Standalone ) && (Class == Class'Rocket') )
{
blastRadius = mpBlastRadius;
speed = 2000.0000;
SetTimer(5,false);
SoundRadius = 64;
}

SpawnRocketEffects


fireGen = Spawn(class'ParticleGenerator', Self);
if (fireGen != None)
{
fireGen.RemoteRole = ROLE_None;
fireGen.particleTexture = Texture'Effects.Fire.Fireball1';
fireGen.particleDrawScale = 0.1;
fireGen.checkTime = 0.01;
fireGen.riseRate = 0.0;
fireGen.ejectSpeed = 0.0;
fireGen.particleLifeSpan = 0.1;
fireGen.bRandomEject = True;
fireGen.SetBase(Self);
}
smokeGen = Spawn(class'ParticleGenerator', Self);
if (smokeGen != None)
{
smokeGen.RemoteRole = ROLE_None;
smokeGen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
smokeGen.particleDrawScale = 0.3;
smokeGen.checkTime = 0.02;
smokeGen.riseRate = 8.0;
smokeGen.ejectSpeed = 0.0;
smokeGen.particleLifeSpan = 2.0;
smokeGen.bRandomEject = True;
smokeGen.SetBase(Self);
}

Timer


if (Level.NetMode != NM_Standalone)
{
Explode(Location, vect(0,0,1));
}




RocketLAW.uc (extends Rocket)

blastRadius=768.000000
ItemName="LAW Rocket"
Damage=1000.000000
MomentumTransfer=40000
SpawnSound=Sound'DeusExSounds.Robot.RobotFireRocket'
Mesh=LodMesh'DeusExItems.RocketLAW'
DrawScale=1.000000
AmbientSound=Sound'DeusExSounds.Weapons.LAWApproach'

PreBeginPlay


Super.PreBeginPlay();

if (( Level.NetMode != NM_Standalone ) && (Class == Class'RocketLAW'))
{
SoundRadius = 64;
}




RocketMini.uc (extends Rocket)

blastRadius=64.000000
bTracking=False
Damage=50.000000
MomentumTransfer=5000
SpawnSound=Sound'DeusExSounds.Robot.RobotFireRocket'
Mesh=LodMesh'DeusExItems.RocketLAW'
DrawScale=0.500000



RocketRobot.uc (extends Rocket)

blastRadius=96.000000
bTracking=False
speed=1400.000000
MaxSpeed=1800.000000
Damage=75.000000
SpawnSound=Sound'DeusExSounds.Robot.RobotFireRocket'
Mesh=LodMesh'DeusExItems.RocketLAW'
DrawScale=0.500000



RocketWP.uc (extends Rocket)

var float mpExplodeDamage;
mpExplodeDamage=75.000000
mpBlastRadius=768.000000
bBlood=False
bDebris=False
blastRadius=512.000000
DamageType=Flamed
ItemName="WP Rocket"
ImpactSound=Sound'DeusExSounds.Generic.SmallExplosion2'
Mesh=LodMesh'DeusExItems.RocketHE'
DrawScale=1.000000
AmbientSound=Sound'DeusExSounds.Weapons.WPApproach'

DrawExplosionEffects (vector HitLocation, vector HitNormal)


local ExplosionLight light;
local ParticleGenerator gen;
local ExplosionSmall expeffect;


// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, HitLocation);
if (light != None)
{
light.RemoteRole = ROLE_None;
light.size = 12;
}

expeffect = Spawn(class'ExplosionSmall',,, HitLocation);
if (expeffect != None)
expeffect.RemoteRole = ROLE_None;

// create a particle generator shooting out white-hot fireballs
gen = Spawn(class'ParticleGenerator',,, HitLocation, Rotator(HitNormal));
if (gen != None)
{
gen.RemoteRole = ROLE_None;
gen.particleDrawScale = 1.0;
gen.checkTime = 0.05;
gen.frequency = 1.0;
gen.ejectSpeed = 200.0;
gen.bGravity = True;
gen.bRandomEject = True;
gen.particleTexture = Texture'Effects.Fire.FireballWhite';
gen.LifeSpan = 2.0;
}

PreBeginPlay


Super.PreBeginPlay();

if ( ( Level.NetMode != NM_Standalone ) && (Class == Class'RocketWP') )
{
speed = 2000.0000;
SetTimer(5,false);
Damage = mpExplodeDamage;
blastRadius = mpBlastRadius;
SoundRadius=76;
}




Sailor.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.SailorCarcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SailorTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SailorTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SailorTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SailorTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SailorTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.SailorTex3'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Sailor"
FamiliarName="Sailor"
UnfamiliarName="Sailor"



SailorCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SailorTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SailorTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SailorTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SailorTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SailorTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.SailorTex3'



SamCarter.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.SamCarterCarcass'
WalkingSpeed=0.296000
bImportant=True
bInvincible=True
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponAssaultShotgun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCombatKnife')
walkAnimMult=0.780000
GroundSpeed=200.000000
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SamCarterTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SamCarterTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SamCarterTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SamCarterTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="SamCarter"
FamiliarName="Sam Carter"
UnfamiliarName="Sam Carter"



SamCarterCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SamCarterTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SamCarterTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SamCarterTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SamCarterTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



SandraRenton.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.SandraRentonCarcass'
WalkingSpeed=0.320000
bImportant=True
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=36.000000
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SandraRentonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SandraRentonTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SandraRentonTex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.SandraRentonTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(7)=Texture'DeusExCharacters.Skins.SandraRentonTex1'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="SandraRenton"
FamiliarName="Sandra Renton"
UnfamiliarName="Sandra Renton"



SandraRentonCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SandraRentonTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SandraRentonTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SandraRentonTex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.SandraRentonTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(7)=Texture'DeusExCharacters.Skins.SandraRentonTex1'



SarahMead.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.SarahMeadCarcass'
WalkingSpeed=0.320000
bImportant=True
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_Dress'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SarahMeadTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SarahMeadTex3'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SarahMeadTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SarahMeadTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SarahMeadTex2'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.SarahMeadTex0'
MultiSkins(7)=Texture'DeusExCharacters.Skins.SarahMeadTex0'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="SarahMead"
FamiliarName="Sarah Mead"
UnfamiliarName="Sarah Mead"



SarahMeadCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_Dress_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_Dress_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_Dress_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SarahMeadTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SarahMeadTex3'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SarahMeadTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SarahMeadTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SarahMeadTex2'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.SarahMeadTex0'
MultiSkins(7)=Texture'DeusExCharacters.Skins.SarahMeadTex0'



SatelliteDish.uc (extends OutdoorThings)

var() bool bRandomRotation;
var float time;
var Rotator origRot;
bRandomRotation=True
bStatic=False
Physics=PHYS_Rotating
Mesh=LodMesh'DeusExDeco.SatelliteDish'
SoundRadius=16
SoundVolume=192
CollisionRadius=84.000000
CollisionHeight=102.199997
bRotateToDesired=True
Mass=5000.000000
Buoyancy=5.000000
RotationRate=(Yaw=1024)

BeginPlay


Super.BeginPlay();

origRot = Rotation;
DesiredRotation = Rotation;

if (Level.Netmode != NM_Standalone)
bRandomRotation=False;

Tick (float deltaTime)


local int newYaw;


time += deltaTime;

// if we're done rotating, stop the ambient sound
if (Rotation.Yaw ~= DesiredRotation.Yaw)
AmbientSound = None;
else
AmbientSound = sound'LargeElevMove';

// check for rotation every 10 seconds
if (bRandomRotation)
{
if (time > 10.0)
{
if (FRand() < 0.15)
{
// how far should we turn?
newYaw = 4096 - Rand(8192);
DesiredRotation.Yaw = origRot.Yaw + newYaw;
if (DesiredRotation.Yaw < 0)
DesiredRotation.Yaw += 65536;
DesiredRotation.Yaw = DesiredRotation.Yaw % 65536;

// play a cool startup sound
PlaySound(sound'LargeElevStart', SLOT_Misc,,, 1024);
}
time = 0;
}
}

Super.Tick(deltaTime);




ScientistFemale.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.ScientistFemaleCarcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ScientistFemaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ScientistFemaleTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ScientistFemaleTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ScientistFemaleTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex3'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ScientistFemaleTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="ScientistFemale"
FamiliarName="Scientist"
UnfamiliarName="Scientist"



ScientistFemaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ScientistFemaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ScientistFemaleTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ScientistFemaleTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ScientistFemaleTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex3'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ScientistFemaleTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'



ScientistMale.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.ScientistMaleCarcass'
WalkingSpeed=0.213333
BaseAssHeight=-23.000000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
DrawScale=0.950000
MultiSkins(0)=Texture'DeusExCharacters.Skins.ScientistMaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ScientistMaleTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex3'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=19.000000
CollisionHeight=45.130001
BindName="ScientistMale"
FamiliarName="Scientist"
UnfamiliarName="Scientist"



ScientistMaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
DrawScale=0.950000
MultiSkins(0)=Texture'DeusExCharacters.Skins.ScientistMaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ScientistMaleTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TrenchShirtTex3'
MultiSkins(5)=Texture'DeusExCharacters.Skins.LabCoatTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=38.000000
CollisionHeight=6.650000



ScorchMark.uc (extends DeusExDecal)

Texture=Texture'DeusExItems.Skins.FlatFXTex38'

BeginPlay


if (FRand() < 0.5)
Texture = Texture'FlatFXTex39';

Super.BeginPlay();




ScriptedPawn.uc (extends Pawn)

var WanderPoint point;
var Actor waypoint;
var float dist;
var HidePoint point;
var Actor waypoint;
var Vector location;
var float score;
var float dist;
var DeusExProjectile projectile;
var vector location;
var float dist;
var float range;
var NearbyProjectile list[8];
var vector center;
var() Name AllianceName;
var() float AllianceLevel;
var() bool bPermanent;
var Name AllianceName;
var float AllianceLevel;
var float AgitationLevel;
var bool bPermanent;
var() class Inventory;
var() int Count;
var WanderPoint lastPoints[2];
var float Restlessness; // 0-1
var float Wanderlust; // 0-1
var float Cowardice; // 0-1
var(Combat) float BaseAccuracy; // 0-1 or thereabouts
var(Combat) float MaxRange;
var(Combat) float MinRange;
var(Combat) float MinHealth;
var(AI) float RandomWandering; // 0-1
var float sleepTime;
var Actor destPoint;
var Vector destLoc;
var Vector useLoc;
var Rotator useRot;
var float seekDistance; // OBSOLETE
var int SeekLevel;
var ESeekType SeekType;
var Pawn SeekPawn;
var float CarcassTimer;
var float CarcassHateTimer; // OBSOLETE
var float CarcassCheckTimer;
var name PotentialEnemyAlliance;
var float PotentialEnemyTimer;
var float BeamCheckTimer;
var bool bSeekPostCombat;
var bool bSeekLocation;
var bool bInterruptSeek;
var bool bAlliancesChanged; // set to True whenever someone changes AlliancesEx[i].AllianceLevel to indicate we must do alliance updating
var bool bNoNegativeAlliances; // True means we know all alliances are currently +, allows us to skip CheckEnemyPresence's slow part
var bool bSitAnywhere;
var bool bSitInterpolation;
var bool bStandInterpolation;
var float remainingSitTime;
var float remainingStandTime;
var vector StandRate;
var float ReloadTimer;
var bool bReadyToReload;
var(Pawn) class CarcassType; // mesh to use when killed from the front
var(Orders) name Orders; // orders a creature is carrying out
var(Orders) name OrderTag; // tag of object referred to by orders
var(Orders) name HomeTag; // tag of object to use as home base
var(Orders) float HomeExtent; // extent of home base
var actor OrderActor; // object referred to by orders (if applicable)
var name NextAnim; // used in states with multiple, sequenced animations
var float WalkingSpeed; // 0-1
var(Combat) float ProjectileSpeed;
var name LastPainAnim;
var float LastPainTime;
var vector DesiredPrePivot;
var float PrePivotTime;
var vector PrePivotOffset;
var bool bCanBleed; // true if an NPC can bleed
var float BleedRate; // how profusely the NPC is bleeding; 0-1
var float DropCounter; // internal; used in tick()
var() float ClotPeriod; // seconds it takes bleedRate to go from 1 to 0
var bool bAcceptBump; // ugly hack
var bool bCanFire; // true if pawn is capable of shooting asynchronously
var(AI) bool bKeepWeaponDrawn; // true if pawn should always keep weapon drawn
var(AI) bool bShowPain; // true if pawn should play pain animations
var(AI) bool bCanSit; // true if pawn can sit
var(AI) bool bAlwaysPatrol; // true if stasis should be disabled during patrols
var(AI) bool bPlayIdle; // true if pawn should fidget while he's standing
var(AI) bool bLeaveAfterFleeing; // true if pawn should disappear after fleeing
var(AI) bool bLikesNeutral; // true if pawn should treat neutrals as friendlies
var(AI) bool bUseFirstSeatOnly; // true if only the nearest chair should be used for
var(AI) bool bCower; // true if fearful pawns should cower instead of fleeing
var HomeBase HomeActor; // home base
var Vector HomeLoc; // location of home base
var Vector HomeRot; // rotation of home base
var bool bUseHome; // true if home base should be used
var bool bInterruptState; // true if the state can be interrupted
var bool bCanConverse; // true if the pawn can converse
var() bool bImportant; // true if this pawn is game-critical
var() bool bInvincible; // true if this pawn cannot be killed
var bool bInitialized; // true if this pawn has been initialized
var(Combat) bool bAvoidAim; // avoid enemy's line of fire
var(Combat) bool bAimForHead; // aim for the enemy's head
var(Combat) bool bDefendHome; // defend the home base
var bool bCanCrouch; // whether we should crouch when firing
var bool bSeekCover; // seek cover
var bool bSprint; // sprint in random directions
var(Combat) bool bUseFallbackWeapons; // use fallback weapons even when others are available
var float AvoidAccuracy; // how well we avoid enemy's line of fire; 0-1
var bool bAvoidHarm; // avoid painful projectiles, gas clouds, etc.
var float HarmAccuracy; // how well we avoid harm; 0-1
var float CrouchRate; // how often the NPC crouches, if bCrouch enabled; 0-1
var float SprintRate; // how often the NPC randomly sprints if bSprint enabled; 0-1
var float CloseCombatMult; // multiplier for how often the NPC sprints in close combat; 0-1
var(Stimuli) bool bHateHacking; // new
var(Stimuli) bool bHateWeapon;
var(Stimuli) bool bHateShot;
var(Stimuli) bool bHateInjury;
var(Stimuli) bool bHateIndirectInjury; // new
var(Stimuli) bool bHateCarcass; // new
var(Stimuli) bool bHateDistress;
var(Reactions) bool bReactFutz; // new
var(Reactions) bool bReactPresence; // React to the presence of an enemy (attacking)
var(Reactions) bool bReactLoudNoise; // Seek the source of a loud noise (seeking)
var(Reactions) bool bReactAlarm; // Seek the source of an alarm (seeking)
var(Reactions) bool bReactShot; // React to a gunshot fired by an enemy (attacking)
var(Reactions) bool bReactCarcass; // React to gore appropriately (seeking)
var(Reactions) bool bReactDistress; // React to distress appropriately (attacking)
var(Reactions) bool bReactProjectiles; // React to harmful projectiles appropriately
var(Fears) bool bFearHacking; // Run away from a hacker
var(Fears) bool bFearWeapon; // Run away from a person holding a weapon
var(Fears) bool bFearShot; // Run away from a person who fires a shot
var(Fears) bool bFearInjury; // Run away from a person who causes injury
var(Fears) bool bFearIndirectInjury; // Run away from a person who causes indirect injury
var(Fears) bool bFearCarcass; // Run away from a carcass
var(Fears) bool bFearDistress; // Run away from a person causing distress
var(Fears) bool bFearAlarm; // Run away from the source of an alarm
var(Fears) bool bFearProjectiles; // Run away from a projectile
var(AI) bool bEmitDistress; // TRUE if NPC should emit distress
var(AI) ERaiseAlarmType RaiseAlarm; // When to raise an alarm
var bool bLookingForEnemy; // TRUE if we're actually looking for enemies
var bool bLookingForLoudNoise; // TRUE if we're listening for loud noises
var bool bLookingForAlarm; // TRUE if we're listening for alarms
var bool bLookingForDistress; // TRUE if we're looking for signs of distress
var bool bLookingForProjectiles; // TRUE if we're looking for projectiles that can harm us
var bool bLookingForFutz; // TRUE if we're looking for people futzing with stuff
var bool bLookingForHacking; // TRUE if we're looking for people hacking stuff
var bool bLookingForShot; // TRUE if we're listening for gunshots
var bool bLookingForWeapon; // TRUE if we're looking for drawn weapons
var bool bLookingForCarcass; // TRUE if we're looking for carcass events
var bool bLookingForInjury; // TRUE if we're looking for injury events
var bool bLookingForIndirectInjury; // TRUE if we're looking for secondary injury events
var bool bFacingTarget; // True if pawn is facing its target
var(Combat) bool bMustFaceTarget; // True if an NPC must face his target to fire
var(Combat) float FireAngle; // TOTAL angle (in degrees) in which a pawn may fire if bMustFaceTarget is false
var(Combat) float FireElevation; // Max elevation distance required to attack (0=elevation doesn't matter)
var(AI) int MaxProvocations;
var float AgitationSustainTime;
var float AgitationDecayRate;
var float AgitationTimer;
var float AgitationCheckTimer;
var float PlayerAgitationTimer; // hack
var float FearSustainTime;
var float FearDecayRate;
var float FearTimer;
var float FearLevel;
var float EnemyReadiness;
var float ReactionLevel;
var float SurprisePeriod;
var float SightPercentage;
var float CycleTimer;
var float CyclePeriod;
var float CycleCumulative;
var Pawn CycleCandidate;
var float CycleDistance;
var AlarmUnit AlarmActor;
var float AlarmTimer;
var float WeaponTimer;
var float FireTimer;
var float SpecialTimer;
var float CrouchTimer;
var float BackpedalTimer;
var bool bHasShadow;
var float ShadowScale;
var bool bDisappear;
var bool bInTransientState; // true if the NPC is in a 3rd-tier (transient) state, like TakeHit
var(Alliances) InitialAllianceInfo InitialAlliances[8];
var AllianceInfoEx AlliancesEx[16];
var bool bReverseAlliances;
var(Pawn) float BaseAssHeight;
var(AI) float EnemyTimeout;
var float CheckPeriod;
var float EnemyLastSeen;
var int SeatSlot;
var Seat SeatActor;
var int CycleIndex;
var int BodyIndex;
var bool bRunningStealthy;
var bool bPausing;
var bool bStaring;
var bool bAttacking;
var bool bDistressed;
var bool bStunned;
var bool bSitting;
var bool bDancing;
var bool bCrouching;
var bool bCanTurnHead;
var(AI) bool bTickVisibleOnly; // Temporary?
var() bool bInWorld;
var vector WorldPosition;
var bool bWorldCollideActors;
var bool bWorldBlockActors;
var bool bWorldBlockPlayers;
var() bool bHighlight; // should this object not highlight when focused?
var(AI) bool bHokeyPokey;
var bool bConvEndState;
var(Inventory) InventoryItem InitialInventory[8]; // Initial inventory items carried by the pawn
var Bool bConversationEndedNormally;
var Bool bInConversation;
var Actor ConversationActor; // Actor currently speaking to or speaking to us
var() sound WalkSound;
var float swimBubbleTimer;
var bool bSpawnBubbles;
var bool bUseSecondaryAttack;
var bool bWalkAround;
var bool bClearedObstacle;
var bool bEnableCheckDest;
var ETurning TurnDirection;
var ETurning NextDirection;
var Actor ActorAvoiding;
var float AvoidWallTimer;
var float AvoidBumpTimer;
var float ObstacleTimer;
var vector LastDestLoc;
var vector LastDestPoint;
var int DestAttempts;
var float DeathTimer;
var float EnemyTimer;
var float TakeHitTimer;
var name ConvOrders;
var name ConvOrderTag;
var float BurnPeriod;
var float FutzTimer;
var float DistressTimer;
var vector SeatLocation;
var Seat SeatHack;
var bool bSeatLocationValid;
var bool bSeatHackUsed;
var bool bBurnedToDeath;
var bool bHasCloak;
var bool bCloakOn;
var int CloakThreshold;
var float CloakEMPTimer;
var float poisonTimer; // time remaining before next poison TakeDamage
var int poisonCounter; // number of poison TakeDamages remaining
var int poisonDamage; // damage taken from poison effect
var Pawn Poisoner; // person who initiated PoisonEffect damage
var Name Carcasses[4]; // list of carcasses seen
var int NumCarcasses; // number of carcasses seen
var float walkAnimMult;
var float runAnimMult;
Restlessness=0.500000
Wanderlust=0.500000
Cowardice=0.500000
maxRange=4000.000000
MinHealth=30.000000
RandomWandering=1.000000
bAlliancesChanged=True
Orders=Wandering
HomeExtent=800.000000
WalkingSpeed=0.400000
bCanBleed=True
ClotPeriod=30.000000
bShowPain=True
bCanSit=True
bLikesNeutral=True
bUseFirstSeatOnly=True
bCanConverse=True
bAvoidAim=True
AvoidAccuracy=0.400000
bAvoidHarm=True
HarmAccuracy=0.800000
CloseCombatMult=0.300000
bHateShot=True
bHateInjury=True
bReactPresence=True
bReactProjectiles=True
bEmitDistress=True
RaiseAlarm=RAISEALARM_BeforeFleeing
bMustFaceTarget=True
FireAngle=360.000000
MaxProvocations=1
AgitationSustainTime=30.000000
AgitationDecayRate=0.050000
FearSustainTime=25.000000
FearDecayRate=0.500000
SurprisePeriod=2.000000
SightPercentage=0.500000
bHasShadow=True
ShadowScale=1.000000
BaseAssHeight=-26.000000
EnemyTimeout=4.000000
bTickVisibleOnly=True
bInWorld=True
bHighlight=True
bHokeyPokey=True
InitialInventory(0)=(Count=1)
InitialInventory(1)=(Count=1)
InitialInventory(2)=(Count=1)
InitialInventory(3)=(Count=1)
InitialInventory(4)=(Count=1)
InitialInventory(5)=(Count=1)
InitialInventory(6)=(Count=1)
InitialInventory(7)=(Count=1)
bSpawnBubbles=True
bWalkAround=True
BurnPeriod=30.000000
DistressTimer=-1.000000
CloakThreshold=50
walkAnimMult=0.700000
runAnimMult=1.000000
bCanStrafe=True
bCanWalk=True
bCanSwim=True
bCanOpenDoors=True
bIsHuman=True
bCanGlide=False
AirSpeed=320.000000
AccelRate=200.000000
JumpZ=120.000000
MinHitWall=9999999827968.000000
HearingThreshold=0.150000
Skill=2.000000
AIHorizontalFov=160.000000
AspectRatio=2.300000
bForceStasis=True
BindName="ScriptedPawn"
FamiliarName="DEFAULT FAMILIAR NAME - REPORT THIS AS A BUG"
UnfamiliarName="DEFAULT UNFAMILIAR NAME - REPORT THIS AS A BUG"

AddCarcass (Name CarcassName) | native

AddVelocity (Vector momentum)


if (VSize(momentum) > 0.001)
Super.AddVelocity(momentum);

AdjustAim (float projSpeed, vector projStart, int aimerror, bool leadTarget, bool warnTarget) -> rotator


local rotator FireRotation;
local vector FireSpot;
local actor HitActor;
local vector HitLocation, HitNormal;
local vector vectorArray[3];
local vector tempVector;
local int i;
local int swap;
local Rotator rot;
local bool bIsThrown;
local DeusExMover dxMover;
local actor Target; // evil fix -- STM


bIsThrown = IsThrownWeapon(DeusExWeapon(Weapon));

// took this line out for evil fix...
// if ( Target == None )

Target = Enemy;
if ( Target == None )
return Rotation;
if ( !Target.IsA('Pawn') )
return rotator(Target.Location - Location);

FireSpot = Target.Location;
if (leadTarget && (projSpeed > 0))
{
if (bIsThrown)
{
// compute target's position 1.5 seconds in the future
FireSpot = target.Location + (target.Velocity*1.5);
}
else
{
//FireSpot += (Target.Velocity * VSize(Target.Location - ProjStart)/projSpeed);
ComputeTargetLead(Pawn(Target), ProjStart, projSpeed, 20.0, FireSpot);
}
}

if (bIsThrown)
{
vectorArray[0] = FireSpot - vect(0,0,1)*(Target.CollisionHeight-5); // floor
vectorArray[1] = vectorArray[0] + Vector(rot(0,1,0)*Rand(65536))*CollisionRadius*1.2;
vectorArray[2] = vectorArray[0] + Vector(rot(0,1,0)*Rand(65536))*CollisionRadius*1.2;

for (i=0; i<3; i++)
{
if (AISafeToThrow(vectorArray[i], ProjStart, 0.025))
break;
}
if (i < 3)
{
FireSpot = vectorArray[i];
FireRotation = ViewRotation;
}
else
FireRotation = Rotator(FireSpot - ProjStart);
}
else
{
dxMover = DeusExMover(Target.Base);
if ((dxMover != None) && dxMover.bBreakable)
{
tempVector = Normal((Location-Target.Location)*vect(1,1,0))*(Target.CollisionRadius*1.01) -
vect(0,0,1)*(Target.CollisionHeight*1.01);
vectorArray[0] = FireSpot + tempVector;
}
else if (bAimForHead)
vectorArray[0] = FireSpot + vect(0,0,1)*(Target.CollisionHeight*0.85); // head
else
vectorArray[0] = FireSpot + vect(0,0,1)*((FRand()*2-1)*Target.CollisionHeight);
vectorArray[1] = FireSpot + vect(0,0,1)*((FRand()*2-1)*Target.CollisionHeight);
vectorArray[2] = FireSpot + vect(0,0,1)*((FRand()*2-1)*Target.CollisionHeight);

for (i=0; i<3; i++)
{
if (AISafeToShoot(HitActor, vectorArray[i], ProjStart))
break;
}
if (i < 3)
FireSpot = vectorArray[i];

FireRotation = Rotator(FireSpot - ProjStart);
}

if (warnTarget && Pawn(Target) != None)
Pawn(Target).WarnTarget(self, projSpeed, vector(FireRotation));

FireRotation.Yaw = FireRotation.Yaw & 65535;
if ( (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) > 8192)
&& (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) < 57343) )
{
if ( (FireRotation.Yaw > Rotation.Yaw + 32768) ||
((FireRotation.Yaw < Rotation.Yaw) && (FireRotation.Yaw > Rotation.Yaw - 32768)) )
FireRotation.Yaw = Rotation.Yaw - 8192;
else
FireRotation.Yaw = Rotation.Yaw + 8192;
}
viewRotation = FireRotation;
return FireRotation;

AdjustJump


local float velZ;
local vector FullVel;


velZ = Velocity.Z;
FullVel = Normal(Velocity) * GroundSpeed;

If (Location.Z > Destination.Z + CollisionHeight + 2 * MaxStepHeight)
{
Velocity = FullVel;
Velocity.Z = velZ;
Velocity = EAdjustJump();
Velocity.Z = 0;
if ( VSize(Velocity) < 0.9 * GroundSpeed )
{
Velocity.Z = velZ;
return;
}
}

Velocity = FullVel;
Velocity.Z = JumpZ + velZ;
Velocity = EAdjustJump();

AgitateAlliance (Name newEnemy, float agitation)


local int i;
local float oldLevel;
local float newLevel;


if (newEnemy != '')
{
for (i=0; i<16; i++)
if ((AlliancesEx[i].AllianceName == newEnemy) || (AlliancesEx[i].AllianceName == ''))
break;

if (i < 16)
{
if ((AlliancesEx[i].AllianceName == '') || !(AlliancesEx[i].bPermanent))
{
if (AlliancesEx[i].AllianceName == '')
AlliancesEx[i].AllianceLevel = 0;
oldLevel = AlliancesEx[i].AgitationLevel;
newLevel = oldLevel + agitation;
if (newLevel > 1.0)
newLevel = 1.0;
AlliancesEx[i].AllianceName = newEnemy;
AlliancesEx[i].AgitationLevel = newLevel;
if ((newEnemy == 'Player') && (oldLevel < 1.0) && (newLevel >= 1.0)) // hack
PlayerAgitationTimer = 2.0;
bAlliancesChanged = True;
}
}
}

AlterDestination


local Rotator dir;
local int avoidYaw;
local int destYaw;
local int moveYaw;
local int angle;
local bool bPointInCylinder;
local float dist1, dist2;
local bool bAround;
local vector tempVect;
local ETurning oldTurnDir;


oldTurnDir = TurnDirection;

// Sanity check -- are we done walking around the actor?
if (TurnDirection != TURNING_None)
{
if (!bWalkAround)
TurnDirection = TURNING_None;
else if (bClearedObstacle)
TurnDirection = TURNING_None;
else if (ActorAvoiding == None)
TurnDirection = TURNING_None;
else if (ActorAvoiding.bDeleteMe)
TurnDirection = TURNING_None;
else if (!IsPointInCylinder(ActorAvoiding, Location,
CollisionRadius*2, CollisionHeight*2))
TurnDirection = TURNING_None;
}

// Are we still turning?
if (TurnDirection != TURNING_None)
{
bAround = false;

// Is our destination point inside the actor we're walking around?
bPointInCylinder = IsPointInCylinder(ActorAvoiding, Destination,
CollisionRadius-8, CollisionHeight-8);
if (bPointInCylinder)
{
dist1 = VSize((Location - ActorAvoiding.Location)*vect(1,1,0));
dist2 = VSize((Location - Destination)*vect(1,1,0));

// Are we on the right side of the actor?
if (dist1 > dist2)
{
// Just make a beeline, if possible
tempVect = Destination - ActorAvoiding.Location;
tempVect.Z = 0;
tempVect = Normal(tempVect) * (ActorAvoiding.CollisionRadius + CollisionRadius);
if (tempVect == vect(0,0,0))
Destination = Location;
else
{
tempVect += ActorAvoiding.Location;
tempVect.Z = Destination.Z;
Destination = tempVect;
}
}
else
bAround = true;
}
else
bAround = true;

// We have a valid destination -- continue to walk around
if (bAround)
{
// Determine the destination-self-obstacle angle
dir = Rotator(ActorAvoiding.Location-Location);
avoidYaw = dir.Yaw;
dir = Rotator(Destination-Location);
destYaw = dir.Yaw;

if (TurnDirection == TURNING_Left)
angle = (avoidYaw - destYaw) & 65535;
else
angle = (destYaw - avoidYaw) & 65535;
if (angle < 0)
angle += 65536;

// If the angle is between 90 and 180 degrees, we've cleared the obstacle
if (bPointInCylinder || (angle < 16384) || (angle > 32768)) // haven't cleared the actor yet
{
if (TurnDirection == TURNING_Left)
moveYaw = avoidYaw - 16384;
else
moveYaw = avoidYaw + 16384;
Destination = Location + Vector(rot(0,1,0)*moveYaw)*400;
}
else // cleared the actor -- move on
TurnDirection = TURNING_None;
}
}

if (TurnDirection == TURNING_None)
{
if (ObstacleTimer > 0)
{
TurnDirection = oldTurnDir;
bClearedObstacle = true;
}
}
else
ObstacleTimer = 1.5;

// Reset if done turning
if (TurnDirection == TURNING_None)
{
NextDirection = TURNING_None;
ActorAvoiding = None;
bAdvancedTactics = false;
ObstacleTimer = 0;
bClearedObstacle = true;

if (oldTurnDir != TURNING_None)
MoveTimer -= 4.0;
}

AnimEnd


PlayWaiting();

BackOff


SetNextState(GetStateName(), 'ContinueFromDoor'); // MASSIVE hackage
SetState('BackingOff');

BaseChange


local float minJumpZ;


Global.BaseChange();

if (Physics == PHYS_Walking)
{
minJumpZ = FMax(JumpZ, 150.0);
bJustLanded = true;
if (Health > 0)
{
if ((Velocity.Z < -0.8 * minJumpZ) || bUpAndOut)
GotoState('FallingState', 'Landed');
else if (Velocity.Z < -0.8 * JumpZ)
GotoState('FallingState', 'FastLanded');
else
GotoState('FallingState', 'Done');
}
}

BeginState


StandUp();
if (Enemy == None)
Disable('EnemyNotVisible');
else
{
Disable('HearNoise');
Disable('SeePlayer');
}
bInterruptState = false;
bCanConverse = False;
bStasis = False;
bInTransientState = true;
EnableCheckDestLoc(false);

BlockReactions (optional bool bBlockInjury)


SetReactions(false, false, false, false, false, false, false, false, false, false, !bBlockInjury, !bBlockInjury);

Bump (actor bumper)


// If we hit the guy we're going to, end the state
if (bumper == OrderActor)
GotoState('RunningTo', 'Done');

// Handle conversations, if need be
Global.Bump(bumper);

CanConverse -> bool


// Return True if this NPC is in a conversable state
return (bCanConverse && bInterruptState && ((Physics == PHYS_Walking) || (Physics == PHYS_Flying)));

CanConverseWithPlayer (DeusExPlayer dxPlayer) -> bool


local name alliance1, alliance2, carcname; // temp vars


if (GetPawnAllianceType(dxPlayer) == ALLIANCE_Hostile)
return false;
else if ((GetStateName() == 'Fleeing') && (Enemy != dxPlayer) && (IsValidEnemy(Enemy, false))) // hack
return false;
else if (GetCarcassData(dxPlayer, alliance1, alliance2, carcname))
return false;
else
return true;

CanShowPain -> bool


if (bShowPain && (TakeHitTimer <= 0))
return true;
else
return false;

CatchFire


local Fire f;
local int i;
local vector loc;


if (bOnFire || Region.Zone.bWaterZone || (BurnPeriod <= 0) || bInvincible)
return;

bOnFire = True;
burnTimer = 0;

EnableCloak(false);

for (i=0; i<8; i++)
{
loc.X = 0.5*CollisionRadius * (1.0-2.0*FRand());
loc.Y = 0.5*CollisionRadius * (1.0-2.0*FRand());
loc.Z = 0.6*CollisionHeight * (1.0-2.0*FRand());
loc += Location;
f = Spawn(class'Fire', Self,, loc);
if (f != None)
{
f.DrawScale = 0.5*FRand() + 1.0;

// turn off the sound and lights for all but the first one
if (i > 0)
{
f.AmbientSound = None;
f.LightType = LT_None;
}

// turn on/off extra fire and smoke
if (FRand() < 0.5)
f.smokeGen.Destroy();
if (FRand() < 0.5)
f.AddFire();
}
}

// set the burn timer
SetTimer(1.0, True);

ChangeAlly (Name newAlly, optional float allyLevel, optional bool bPermanent, optional bool bHonorPermanence)


local int i;


// Members of the same alliance will ALWAYS be friendly to each other
if (newAlly == Alliance)
{
allyLevel = 1;
bPermanent = true;
}

if (bHonorPermanence)
{
for (i=0; i<16; i++)
if (AlliancesEx[i].AllianceName == newAlly)
if (AlliancesEx[i].bPermanent)
break;
if (i < 16)
return;
}

if (allyLevel < -1)
allyLevel = -1;
if (allyLevel > 1)
allyLevel = 1;

for (i=0; i<16; i++)
if ((AlliancesEx[i].AllianceName == newAlly) || (AlliancesEx[i].AllianceName == ''))
break;

if (i >= 16)
for (i=15; i>0; i--)
AlliancesEx[i] = AlliancesEx[i-1];

AlliancesEx[i].AllianceName = newAlly;
AlliancesEx[i].AllianceLevel = allyLevel;
AlliancesEx[i].AgitationLevel = 0;
AlliancesEx[i].bPermanent = bPermanent;

bAlliancesChanged = True;
bNoNegativeAlliances = False;

ChangedWeapon


// do nothing

CheckAttack (bool bPlaySound)


local bool bCriticalDamage;
local bool bOutOfAmmo;
local Pawn oldEnemy;
local bool bAllianceSwitch;


oldEnemy = enemy;

bAllianceSwitch = false;
if (!IsValidEnemy(enemy))
{
if (IsValidEnemy(enemy, false))
bAllianceSwitch = true;
SetEnemy(None, 0, true);
}

if (enemy == None)
{
if (Orders == 'Attacking')
{
FindOrderActor();
SetEnemy(Pawn(OrderActor), 0, true);
}
}
if (ReadyForNewEnemy())
FindBestEnemy(false);
if (enemy == None)
{
Enemy = oldEnemy; // hack
if (bPlaySound)
{
if (bAllianceSwitch)
PlayAllianceFriendlySound();
else
PlayAreaSecureSound();
}
Enemy = None;
if (Orders != 'Attacking')
FollowOrders();
else
GotoState('Wandering');
return;
}

SwitchToBestWeapon();
if (bCrouching && (CrouchTimer <= 0) && !ShouldCrouch())
{
EndCrouch();
TweenToShoot(0.15);
}
bCriticalDamage = False;
bOutOfAmmo = False;
if (ShouldFlee())
bCriticalDamage = True;
else if (Weapon == None)
bOutOfAmmo = True;
else if (Weapon.ReloadCount > 0)
{
if (Weapon.AmmoType == None)
bOutOfAmmo = True;
else if (Weapon.AmmoType.AmmoAmount < 1)
bOutOfAmmo = True;
}
if (bCriticalDamage || bOutOfAmmo)
{
if (bPlaySound)
{
if (bCriticalDamage)
PlayCriticalDamageSound();
else if (bOutOfAmmo)
PlayOutOfAmmoSound();
}
if (RaiseAlarm == RAISEALARM_BeforeFleeing)
GotoState('Alerting');
else
GotoState('Fleeing');
}
else if (bPlaySound && (oldEnemy != Enemy))
PlayNewTargetSound();

CheckBeamPresence (float deltaSeconds) -> bool


local DeusExPlayer player;
local Beam beamActor;
local bool bReactToBeam;


if (bReactPresence && bLookingForEnemy && (BeamCheckTimer <= 0) && (LastRendered() < 5.0))
{
BeamCheckTimer = 1.0;
player = DeusExPlayer(GetPlayerPawn());
if (player != None)
{
bReactToBeam = false;
if (IsValidEnemy(player))
{
foreach RadiusActors(Class'Beam', beamActor, 1200)
{
if ((beamActor.Owner == player) && (beamActor.LightType != LT_None) && (beamActor.LightBrightness > 32))
{
if (VSize(beamActor.Location - Location) < (beamActor.LightRadius+1)*25)
bReactToBeam = true;
else
{
if (AICanSee(beamActor, , false, true, false, false) > 0)
{
if (FastTrace(beamActor.Location, Location+vect(0,0,1)*BaseEyeHeight))
bReactToBeam = true;
}
}
}
if (bReactToBeam)
break;
}
}
if (bReactToBeam)
HandleSighting(player);
}
}

CheckCarcassPresence (float deltaSeconds) -> bool


local Actor carcass;
local Name CarcassName;
local int lastCycle;
local DeusExCarcass body;
local DeusExPlayer player;
local float visibility;
local Name KillerAlliance;
local Name killedAlliance;
local Pawn killer;
local Pawn bestKiller;
local float dist;
local float bestDist;
local float maxCarcassDist;
local int maxCarcassCount;


if (bFearCarcass && !bHateCarcass && !bReactCarcass) // Major hack!
maxCarcassCount = 1;
else
maxCarcassCount = ArrayCount(Carcasses);

//if ((bHateCarcass || bReactCarcass || bFearCarcass) && bLookingForCarcass && (CarcassTimer <= 0))
if ((bHateCarcass || bReactCarcass || bFearCarcass) && (NumCarcasses < maxCarcassCount))
{
maxCarcassDist = 1200;
if (CarcassCheckTimer <= 0)
{
CarcassCheckTimer = 0.1;
carcass = None;
lastCycle = BodyIndex;
foreach CycleActors(Class'DeusExCarcass', body, BodyIndex)
{
if (body.Physics != PHYS_Falling)
{
if (VSize(body.Location-Location) < maxCarcassDist)
{
if (GetCarcassData(body, KillerAlliance, killedAlliance, CarcassName, true))
{
visibility = AICanSee(body, ComputeActorVisibility(body), true, true, true, true);
if (visibility > 0)
carcass = body;
break;
}
}
}
}
if (lastCycle >= BodyIndex)
{
if (carcass == None)
{
player = DeusExPlayer(GetPlayerPawn());
if (player != None)
{
if (VSize(player.Location-Location) < maxCarcassDist)
{
if (GetCarcassData(player, KillerAlliance, killedAlliance, CarcassName, true))
{
visibility = AICanSee(player, ComputeActorVisibility(player), true, true, true, true);
if (visibility > 0)
carcass = player;
}
}
}
}
}
if (carcass != None)
{
CarcassTimer = 120;
AddCarcass(CarcassName);
if (bLookingForCarcass)
{
if (KillerAlliance == 'Player')
killer = GetPlayerPawn();
else
{
bestKiller = None;
bestDist = 0;
foreach AllActors(Class'Pawn', killer) // hack
{
if (killer.Alliance == KillerAlliance)
{
dist = VSize(killer.Location - Location);
if ((bestKiller == None) || (bestDist > dist))
{
bestKiller = killer;
bestDist = dist;
}
}
}
killer = bestKiller;
}
if (bHateCarcass)
{
PotentialEnemyAlliance = KillerAlliance;
PotentialEnemyTimer = 15.0;
bNoNegativeAlliances = false;
}
if (bFearCarcass)
IncreaseFear(killer, 2.0);

if (bFearCarcass && IsFearful() && !IsValidEnemy(killer))
{
SetDistressTimer();
SetEnemy(killer, , true);
GotoState('Fleeing');
}
else
{
SetDistressTimer();
SetSeekLocation(killer, carcass.Location, SEEKTYPE_Carcass);
HandleEnemy();
}
}
}
}
}


CheckCycle -> Pawn


local float attackPeriod;
local float maxAttackPeriod;
local float sustainPeriod;
local float decayPeriod;
local float minCutoff;
local Pawn cycleEnemy;


attackPeriod = 0.5;
maxAttackPeriod = 4.5;
sustainPeriod = 3.0;
decayPeriod = 4.0;

minCutoff = attackPeriod/maxAttackPeriod;

cycleEnemy = None;

if (CycleCumulative <= 0) // no enemies seen during this cycle
{
CycleTimer -= CyclePeriod;
if (CycleTimer <= 0)
{
CycleTimer = 0;
EnemyReadiness -= CyclePeriod/decayPeriod;
if (EnemyReadiness < 0)
EnemyReadiness = 0;
}
}
else // I saw somebody!
{
CycleTimer = sustainPeriod;
CycleCumulative *= 2; // hack
if (CycleCumulative < minCutoff)
CycleCumulative = minCutoff;
else if (CycleCumulative > 1.0)
CycleCumulative = 1.0;
EnemyReadiness += CycleCumulative*CyclePeriod/attackPeriod;
if (EnemyReadiness >= 1.0)
{
EnemyReadiness = 1.0;
if (IsValidEnemy(CycleCandidate))
cycleEnemy = CycleCandidate;
}
else if (EnemyReadiness >= SightPercentage)
if (IsValidEnemy(CycleCandidate))
HandleSighting(CycleCandidate);
}
CycleCumulative = 0;
CyclePeriod = 0;
CycleCandidate = None;
CycleDistance = 0;

return (cycleEnemy);


CheckDestLoc (vector newDestLoc, optional bool bPathnode)


if (VSize(newDestLoc-LastDestLoc) <= 16) // too close
DestAttempts++;
else if (!IsPointInCylinder(self, newDestLoc))
DestAttempts++;
else if (bPathnode && (VSize(newDestLoc-LastDestPoint) <= 16)) // too close
DestAttempts++;
else
DestAttempts = 0;
LastDestLoc = newDestLoc;
if (bPathnode && (DestAttempts == 0))
LastDestPoint = newDestLoc;

if (bEnableCheckDest && (DestAttempts >= 4))
BackOff();

CheckOpenDoor (vector HitNormal, actor Door, optional name Label)


local DeusExMover dxMover;


dxMover = DeusExMover(Door);
if (dxMover != None)
{
if (bCanOpenDoors && !IsDoor(dxMover) && dxMover.bBreakable) // break glass we walk into
{
dxMover.TakeDamage(200, self, dxMover.Location, Velocity, 'Shot');
return;
}

if (dxMover.bInterpolating && (dxMover.MoverEncroachType == ME_IgnoreWhenEncroach))
return;

if (bCanOpenDoors && bInterruptState && !bInTransientState && IsDoor(dxMover, true))
{
if (Label == '')
Label = 'Begin';
if (GetStateName() != 'OpeningDoor')
SetNextState(GetStateName(), 'ContinueFromDoor');
Target = Door;
destLoc = HitNormal;
GotoState('OpeningDoor', 'BeginHitNormal');
}
else if ((Acceleration != vect(0,0,0)) && (Physics == PHYS_Walking) &&
(TurnDirection == TURNING_None))
Destination = Location;
}

CheckWaterJump (out vector WallNormal) -> bool


local actor HitActor;
local vector HitLocation, HitNormal, checkpoint, start, checkNorm, Extent;


if (CarriedDecoration != None)
return false;
checkpoint = vector(Rotation);
checkpoint.Z = 0.0;
checkNorm = Normal(checkpoint);
checkPoint = Location + CollisionRadius * checkNorm;
Extent = CollisionRadius * vect(1,1,0);
Extent.Z = CollisionHeight;
HitActor = Trace(HitLocation, HitNormal, checkpoint, Location, false, Extent);
if ( (HitActor != None) && (Pawn(HitActor) == None) )
{
WallNormal = -1 * HitNormal;
start = Location;
start.Z += 1.1 * MaxStepHeight + CollisionHeight;
checkPoint = start + 2 * CollisionRadius * checkNorm;
HitActor = Trace(HitLocation, HitNormal, checkpoint, start, true, Extent);
if (HitActor == None)
return true;
}

return false;

ClearHomeBase


HomeTag = '';
bUseHome = false;

ClearNextState


NextState = '';
NextLabel = '';

ComputeActorVisibility (actor seeActor) -> float


local float visibility;


if (seeActor.IsA('DeusExPlayer'))
visibility = DeusExPlayer(seeActor).CalculatePlayerVisibility(self);
else
visibility = 1.0;

return (visibility);

ComputeAwayVector (NearbyProjectileList projList) -> vector


local vector awayVect;
local vector tempVect;
local rotator tempRot;
local int i;
local float dist;
local int yaw;
local int absYaw;
local int bestYaw;
local NavigationPoint navPoint;
local NavigationPoint bestPoint;
local float segmentDist;


segmentDist = GroundSpeed*0.5;

awayVect = vect(0, 0, 0);
for (i=0; i {
if ((projList.list[i].projectile != None) &&
(projList.list[i].dist < projList.list[i].range))
{
tempVect = projList.list[i].location - projList.center;
if (projList.list[i].dist > 0)
tempVect /= projList.list[i].dist;
else
tempVect = VRand();
awayVect -= tempVect;
}
}

if (awayVect != vect(0, 0, 0))
{
awayVect += Normal(Velocity*vect(1,1,0))*0.9; // bias to direction already running
yaw = Rotator(awayVect).Yaw;
bestPoint = None;
foreach ReachablePathnodes(Class'NavigationPoint', navPoint, None, dist)
{
tempRot = Rotator(navPoint.Location - Location);
absYaw = (tempRot.Yaw - Yaw) & 65535;
if (absYaw > 32767)
absYaw -= 65536;
absYaw = Abs(absYaw);
if ((bestPoint == None) || (bestYaw > absYaw))
{
bestPoint = navPoint;
bestYaw = absYaw;
}
}
if (bestPoint != None)
awayVect = bestPoint.Location-Location;
else
{
tempRot = Rotator(awayVect);
tempRot.Pitch += Rand(7282)-3641; // +/- 20 degrees
tempRot.Yaw += Rand(7282)-3641; // +/- 20 degrees
awayVect = Vector(tempRot)*segmentDist;
}
}
else
awayVect = VRand()*segmentDist;

return (awayVect);


ComputeBestFiringPosition (out vector newPosition) -> EDestinationType


local float selfMinRange, selfMaxRange;
local float enemyMinRange, enemyMaxRange;
local float temp;
local float dist;
local float innerRange[2], outerRange[2];
local Rotator relativeRotation;
local float hAngle, vAngle;
local int acrossDist;
local float awayDist;
local float extraDist;
local float fudgeMargin;
local int angle;
local float maxDist;
local float distDelta;
local bool bInnerValid, bOuterValid;
local vector tryVector;
local EDestinationType destType;
local float moveMult;
local float reloadMult;
local float minArea;
local float minDist;
local float range;
local float margin;
local NearbyProjectileList projList;
local vector projVector;
local bool bUseProjVector;
local rotator sprintRot;
local vector sprintVect;
local bool bUseSprint;




destType = DEST_Failure;

extraDist = enemy.CollisionRadius*0.5;
fudgeMargin = 100;
minArea = 35;

GetPawnWeaponRanges(self, selfMinRange, selfMaxRange, temp);
GetPawnWeaponRanges(enemy, enemyMinRange, temp, enemyMaxRange);

if (selfMaxRange > 1200)
selfMaxRange = 1200;
if (enemyMaxRange > 1200)
enemyMaxRange = 1200;

// hack, to prevent non-strafing NPCs from trying to back up
if (!bCanStrafe)
selfMinRange = 0;

minDist = enemy.CollisionRadius + CollisionRadius - (extraDist+1);
if (selfMinRange < minDist)
selfMinRange = minDist;
if (selfMinRange < MinRange)
selfMinRange = MinRange;
if (selfMaxRange > MaxRange)
selfMaxRange = MaxRange;

dist = VSize(enemy.Location-Location);

innerRange[0] = selfMinRange;
innerRange[1] = selfMaxRange;
outerRange[0] = selfMinRange;
outerRange[1] = selfMaxRange;

// hack, to prevent non-strafing NPCs from trying to back up

if (selfMaxRange > enemyMinRange)
innerRange[1] = enemyMinRange;
if ((selfMinRange < enemyMaxRange) && bCanStrafe) // hack, to prevent non-strafing NPCs from trying to back up
outerRange[0] = enemyMaxRange;

range = outerRange[1]-outerRange[0];
if (range < minArea)
{
outerRange[0] = 0;
outerRange[1] = 0;
}
range = innerRange[1]-innerRange[0];
if (range < minArea)
{
innerRange[0] = outerRange[0];
innerRange[1] = outerRange[1];
outerRange[0] = 0;
outerRange[1] = 0;
}

// If the enemy can reach us through our entire weapon range, just use the range
if ((innerRange[0] >= innerRange[1]) && (outerRange[0] >= outerRange[1]))
{
innerRange[0] = selfMinRange;
innerRange[1] = selfMaxRange;
}

innerRange[0] += extraDist;
innerRange[1] += extraDist;
outerRange[0] += extraDist;
outerRange[1] += extraDist;

if (innerRange[0] >= innerRange[1])
bInnerValid = false;
else
bInnerValid = true;
if (outerRange[0] >= outerRange[1])
bOuterValid = false;
else
bOuterValid = true;

if (!bInnerValid)
{
// ugly
newPosition = Location;
// return DEST_SameLocation;
return destType;
}

relativeRotation = Rotator(Location - enemy.Location);

hAngle = (relativeRotation.Yaw - enemy.Rotation.Yaw) & 65535;
if (hAngle > 32767)
hAngle -= 65536;
// ignore vertical angle for now

awayDist = dist;
acrossDist = 0;
maxDist = GroundSpeed*0.6; // distance covered in 6/10 second

if (bInnerValid)
{
margin = (innerRange[1]-innerRange[0]) * 0.5;
if (margin > fudgeMargin)
margin = fudgeMargin;
if (awayDist < innerRange[0])
awayDist = innerRange[0]+margin;
else if (awayDist > innerRange[1])
awayDist = innerRange[1]-margin;
}
if (bOuterValid)
{
margin = (outerRange[1]-outerRange[0]) * 0.5;
if (margin > fudgeMargin)
margin = fudgeMargin;
if (awayDist > outerRange[1])
awayDist = outerRange[1]-margin;
}

if (awayDist > dist+maxDist)
awayDist = dist+maxDist;
if (awayDist < dist-maxDist)
awayDist = dist-maxDist;

// Used to determine whether NPCs should sprint/avoid aim
moveMult = 1.0;
if ((dist <= 180) && enemy.bIsPlayer && (enemy.Weapon != None) && (enemyMaxRange < 180))
moveMult = CloseCombatMult;

if (bAvoidAim && !enemy.bIgnore && (FRand() <= AvoidAccuracy*moveMult))
{
if ((awayDist < enemyMaxRange+maxDist+50) && (awayDist < 800) && (Enemy.Weapon != None))
{
if (dist > 0)
angle = int(atan(CollisionRadius*2.0/dist)*32768/Pi);
else
angle = 16384;

if ((hAngle >= -angle) && (hAngle <= angle))
{
if (hAngle < 0)
acrossDist = (-angle-hAngle)-128;
else
acrossDist = (angle-hAngle)+128;
if (Rand(20) == 0)
acrossDist = -acrossDist;
}
}
}

// projList is implicitly initialized to null...

bUseProjVector = false;
if (bAvoidHarm && (FRand() <= HarmAccuracy))
{
if (GetProjectileList(projList, Location) > 0)
{
if (IsLocationDangerous(projList, Location))
{
projVector = ComputeAwayVector(projList);
bUseProjVector = true;
}
}
}

reloadMult = 1.0;
if (IsWeaponReloading() && Enemy.bIsPlayer)
reloadMult = 0.5;

bUseSprint = false;
if (!bUseProjVector && bSprint && bCanStrafe && !enemy.bIgnore && (FRand() <= SprintRate*0.5*moveMult*reloadMult))
{
if (bOuterValid || (innerRange[1] > 100)) // sprint on long-range weapons only
{
sprintRot = Rotator(enemy.Location - Location);
if (Rand(2) == 1)
sprintRot.Yaw += 16384;
else
sprintRot.Yaw += 49152;
sprintRot = RandomBiasedRotation(sprintRot.Yaw, 0.5, 0, 0);
sprintRot.Pitch = 0;
sprintVect = Vector(sprintRot)*GroundSpeed*(FRand()+0.5);
bUseSprint = true;
}
}

if ((acrossDist != 0) || (awayDist != dist) || bUseProjVector || bUseSprint)
{
if (Rand(40) != 0)
{
if ((destType == DEST_Failure) && bUseProjVector)
{
tryVector = projVector + Location;
if (TryLocation(tryVector, CollisionRadius+16))
destType = DEST_NewLocation;
}
if ((destType == DEST_Failure) && (acrossDist != 0) && (awayDist != dist))
{
tryVector = Vector(relativeRotation+(rot(0, 1, 0)*acrossDist))*awayDist + enemy.Location;
if (TryLocation(tryVector, CollisionRadius+16, , projList))
destType = DEST_NewLocation;
}
if ((destType == DEST_Failure) && (awayDist != dist))
{
tryVector = Vector(relativeRotation)*awayDist + enemy.Location;
if (TryLocation(tryVector, CollisionRadius+16, , projList))
destType = DEST_NewLocation;
}
if ((destType == DEST_Failure) && (acrossDist != 0))
{
tryVector = Vector(relativeRotation+(rot(0, 1, 0)*acrossDist))*dist + enemy.Location;
if (TryLocation(tryVector, CollisionRadius+16, , projList))
destType = DEST_NewLocation;
}
if ((destType == DEST_Failure) && bUseSprint)
{
tryVector = sprintVect + Location;
if (TryLocation(tryVector, CollisionRadius+16))
destType = DEST_NewLocation;
}
}
if (destType == DEST_Failure)
{
if ((moveMult >= 0.5) || (FRand() <= moveMult))
{
if (AIPickRandomDestination(CollisionRadius+16, maxDist,
relativeRotation.Yaw+32768, 0.6, -relativeRotation.Pitch, 0.6, 2,
0.9, tryVector))
if (!bDefendHome || IsNearHome(tryVector))
if (!bAvoidHarm || !IsLocationDangerous(projList, tryVector))
destType = DEST_NewLocation;
}
else
destType = DEST_SameLocation;
}
if (destType != DEST_Failure)
newPosition = tryVector;
}
else
destType = DEST_SameLocation;

return destType;

ConBindEvents | native

CreateShadow


if (bHasShadow && bInWorld)
if (Shadow == None)
Shadow = Spawn(class'Shadow', Self,, Location-vect(0,0,1)*CollisionHeight, rot(16384,0,0));

DecreaseAgitation (Actor actorInstigator, float AgitationLevel)


local float newLevel;
local DeusExPlayer player;
local Pawn instigator;


player = DeusExPlayer(GetPlayerPawn());

if (Inventory(actorInstigator) != None)
{
if (Inventory(actorInstigator).Owner != None)
actorInstigator = Inventory(actorInstigator).Owner;
}
else if (DeusExDecoration(actorInstigator) != None)
actorInstigator = player;

instigator = Pawn(actorInstigator);
if ((instigator == None) || (instigator == self))
return;

AgitationTimer = AgitationSustainTime;
if (AgitationLevel > 0)
{
bAlliancesChanged = True;
bNoNegativeAlliances = False;
AgitateAlliance(instigator.Alliance, -AgitationLevel);
}


Destroyed


local DeusExPlayer player;


// Pass a message to conPlay, if it exists in the player, that
// this pawn has been destroyed. This is used to prevent
// bad things from happening in converseations.

player = DeusExPlayer(GetPlayerPawn());

if ((player != None) && (player.conPlay != None))
player.conPlay.ActorDestroyed(Self);

Super.Destroyed();

Died (pawn Killer, name damageType, vector HitLocation)


local DeusExPlayer player;
local name flagName;


// Set a flag when NPCs die so we can possibly check it later
player = DeusExPlayer(GetPlayerPawn());

ExtinguishFire();

// set the instigator to be the killer
Instigator = Killer;

if (player != None)
{
// Abort any conversation we may have been having with the NPC
if (bInConversation)
player.AbortConversation();

// Abort any barks we may have been playing
if (player.BarkManager != None)
player.BarkManager.ScriptedPawnDied(Self);
}

Super.Died(Killer, damageType, HitLocation); // bStunned is set here

if (player != None)
{
if (bImportant)
{
flagName = player.rootWindow.StringToName(BindName$"_Dead");
player.flagBase.SetBool(flagName, True);

// make sure the flag never expires
player.flagBase.SetExpiration(flagName, FLAG_Bool, 0);

if (bStunned)
{
flagName = player.rootWindow.StringToName(BindName$"_Unconscious");
player.flagBase.SetBool(flagName, True);

// make sure the flag never expires
player.flagBase.SetExpiration(flagName, FLAG_Bool, 0);
}
}
}

DistanceToTarget -> float


return (VSize(Location-orderActor.Location));

DistressScore (actor receiver, actor sender, float score) -> float


local ScriptedPawn scriptedSender;
local Pawn pawnSender;


// Cull events received from enemies
sender = InstigatorToPawn(sender); // hack
pawnSender = Pawn(sender);
scriptedSender = ScriptedPawn(sender);
if (pawnSender == None)
score = 0;
else if ((GetPawnAllianceType(pawnSender) != ALLIANCE_Friendly) && !bFearDistress)
score = 0;
else if ((scriptedSender != None) && !scriptedSender.bDistressed)
score = 0;

return score;

DoneReloading (DeusExWeapon reloadWeapon)


if (reloadWeapon == Weapon)
ReloadTimer = 0;

DoorEncroaches -> bool


local bool bEncroaches;
local DeusExMover dxMover;


bEncroaches = true;
dxMover = DeusExMover(Target);
if (dxMover != None)
{
if (IsDoor(dxMover) && (dxMover.MoverEncroachType == ME_IgnoreWhenEncroach))
bEncroaches = false;
}

return bEncroaches;

DrawShield


local EllipseEffect shield;


shield = Spawn(class'EllipseEffect', Self,, Location, Rotation);
if (shield != None)
shield.SetBase(Self);

DropWeapon


local DeusExWeapon dxWeapon;
local Weapon oldWeapon;


if (Weapon != None)
{
dxWeapon = DeusExWeapon(Weapon);
if ((dxWeapon == None) || !dxWeapon.bNativeAttack)
{
oldWeapon = Weapon;
SetWeapon(None);
oldWeapon.DropFrom(Location);
}
}

EnableCheckDestLoc (bool bEnable)


// if (bEnableCheckDest && !bEnable)
ResetDestLoc();
bEnableCheckDest = bEnable;

EnableCollision (bool bSet)


EnableShadow(bSet);

if (bSet)
SetCollision(Default.bCollideActors, Default.bBlockActors, Default.bBlockPlayers);
else
SetCollision(True, False, True);

EnableShadow (bool bEnable)


if (Shadow != None)
{
if (bEnable)
Shadow.AttachDecal(32,vect(0.1,0.1,0));
else
Shadow.DetachDecal();
}

EncroachedBy (actor Other)


// overridden so indestructable NPCs aren't InstaGibbed by stupid movement code

EncroachedByMover (Mover encroacher)


local DeusExMover dxMover;


dxMover = DeusExMover(encroacher);
if (dxMover != None)
if (!dxMover.bInterpolating && IsDoor(dxMover))
FrobDoor(dxMover);

EndConversation


Super.EndConversation();

if ((GetStateName() == 'Conversation') || (GetStateName() == 'FirstPersonConversation'))
{
bConversationEndedNormally = True;

if (!bConvEndState)
FollowOrders();
}

bInConversation = False;

EndCrouch


if (bCrouching)
{
bCrouching = false;
ResetBasedPawnSize();
}

EndState


EnableCheckDestLoc(false);
bUpAndOut = false;
bInterruptState = true;
bCanConverse = True;
bStasis = True;
bInTransientState = false;

EnterConversationState (bool bFirstPerson, optional bool bAvoidState)


// First check to see if we're already in a conversation state,
// in which case we'll abort immediately

if ((GetStateName() == 'Conversation') || (GetStateName() == 'FirstPersonConversation'))
return;

SetNextState(GetStateName(), 'Begin');

// If bAvoidState is set, then we don't want to jump into the conversaton state
// for the ScriptedPawn, because bad things might happen otherwise.

if (!bAvoidState)
{
if (bFirstPerson)
GotoState('FirstPersonConversation');
else
GotoState('Conversation');
}

EnterWorld


PutInWorld(true);

ExtinguishFire


local Fire f;


bOnFire = False;
burnTimer = 0;
SetTimer(0, False);

foreach BasedActors(class'Fire', f)
f.Destroy();

Falling


if (bCanFly)
{
SetPhysics(PHYS_Flying);
return;
}
// SetPhysics(PHYS_Falling); //note - done by default in physics
if (health > 0)
SetFall();

FindAlarmPosition (Actor alarm) -> vector


local vector alarmPos;


alarmPos = alarm.Location;
alarmPos += vector(alarm.Rotation.Yaw*rot(0,1,0))*(CollisionRadius+alarm.CollisionRadius);

return (alarmPos);

FindBackupPoint


local vector hitNorm;
local rotator rot;
local vector center;
local vector area;
local vector relPos;
local float distX, distY;
local float dist;


hitNorm = Normal(destLoc);
rot = Rotator(hitNorm);
DeusExMover(Target).ComputeMovementArea(center, area);
area.X += CollisionRadius + 30;
area.Y += CollisionRadius + 30;
//area.Z += CollisionHeight + 30;
relPos = Location - center;
if ((relPos.X < area.X) && (relPos.X > -area.X) &&
(relPos.Y < area.Y) && (relPos.Y > -area.Y))
{
// hack
if (hitNorm.Y == 0)
hitNorm.Y = 0.00000001;
if (hitNorm.X == 0)
hitNorm.X = 0.00000001;
if (hitNorm.X > 0)
distX = (area.X - relPos.X)/hitNorm.X;
else
distX = (-area.X - relPos.X)/hitNorm.X;
if (hitNorm.Y > 0)
distY = (area.Y - relPos.Y)/hitNorm.Y;
else
distY = (-area.Y - relPos.Y)/hitNorm.Y;
dist = FMin(distX, distY);
if (dist < 45)
dist = 45;
else if (dist > 700)
dist = 700; // sanity check
if (!AIDirectionReachable(Location, rot.Yaw, rot.Pitch, 40, dist, destLoc))
destLoc = Location;
}
else
destLoc = Location;

FindBestEnemy (bool bIgnoreCurrentEnemy)


local Pawn nextPawn;
local Pawn bestPawn;
local float bestDist;
local int bestThreatLevel;
local float newSeenTime;


bestPawn = None;
bestDist = 0;
bestThreatLevel = 0;

if (!bIgnoreCurrentEnemy && (Enemy != None))
CheckEnemyParams(Enemy, bestPawn, bestThreatLevel, bestDist);
foreach RadiusActors(Class'Pawn', nextPawn, 2000) // arbitrary
if (enemy != nextPawn)
CheckEnemyParams(nextPawn, bestPawn, bestThreatLevel, bestDist);

if (bestPawn != Enemy)
newSeenTime = 0;
else
newSeenTime = EnemyLastSeen;

SetEnemy(bestPawn, newSeenTime, true);

EnemyTimer = 0;

FindBestSeat


local Seat curSeat;
local Seat bestSeat;
local float curDist;
local float bestDist;
local int curSlot;
local int bestSlot;
local bool bTry;


if (bUseFirstSeatOnly && bSeatHackUsed)
{
bestSeat = SeatHack; // use the seat hack
bestSlot = -1;
if (!IsSeatValid(bestSeat))
bestSeat = None;
else
{
if (GetNextWaypoint(bestSeat) == None)
bestSeat = None;
else
{
bestSlot = FindBestSlot(bestSeat, curDist);
if (bestSlot < 0)
bestSeat = None;
}
}
}
else
{
bestSeat = Seat(OrderActor); // try the ordered seat first
if (bestSeat != None)
{
if (!IsSeatValid(OrderActor))
bestSeat = None;
else
{
if (GetNextWaypoint(bestSeat) == None)
bestSeat = None;
else
{
bestSlot = FindBestSlot(bestSeat, curDist);
if (bestSlot < 0)
bestSeat = None;
}
}
}
if (bestSeat == None)
{
bestDist = 10001;
bestSlot = -1;
foreach RadiusActors(Class'Seat', curSeat, 10000)
{
if (IsSeatValid(curSeat))
{
curSlot = FindBestSlot(curSeat, curDist);
if (curSlot >= 0)
{
if (bestDist > curDist)
{
if (GetNextWaypoint(curSeat) != None)
{
bestDist = curDist;
bestSeat = curSeat;
bestSlot = curSlot;
}
}
}
}
}
}
}

if (bestSeat != None)
{
bestSeat.sittingActor[bestSlot] = self;
SeatLocation = bestSeat.Location;
bSeatLocationValid = true;
}
else
bSeatLocationValid = false;

if (bUseFirstSeatOnly && !bSeatHackUsed)
{
SeatHack = bestSeat;
bSeatHackUsed = true;
}

SeatActor = bestSeat;
SeatSlot = bestSlot;

FindBestSlot (Seat seatActor, out float slotDist) -> int


local int bestSlot;
local float dist;
local float bestDist;
local int i;


bestSlot = -1;
bestDist = 100;
if (!seatActor.Region.Zone.bWaterZone)
{
for (i=0; i {
if (seatActor.sittingActor[i] == None)
{
dist = VSize(SitPosition(seatActor, i) - Location);
if ((bestSlot < 0) || (bestDist > dist))
{
bestDist = dist;
bestSlot = i;
}
}
}
}

slotDist = bestDist;

return (bestSlot);

FindOrderActor


if (Orders == 'Attacking')
OrderActor = FindTaggedActor(OrderTag, true, Class'Pawn');
else
OrderActor = FindTaggedActor(OrderTag);

FindTaggedActor (Name actorTag, optional bool bRandom, optional Class tagClass) -> Actor


local float dist;
local float bestDist;
local actor bestActor;
local actor tempActor;


bestActor = None;
bestDist = 1000000;

if (tagClass == None)
tagClass = Class'Actor';

// if no tag, then assume the player is the target
if (actorTag == '')
bestActor = GetPlayerPawn();
else
{
foreach AllActors(tagClass, tempActor, actorTag)
{
if (tempActor != self)
{
dist = VSize(tempActor.Location - Location);
if (bRandom)
dist *= FRand()*0.6+0.7; // +/- 30%
if ((bestActor == None) || (dist < bestDist))
{
bestActor = tempActor;
bestDist = dist;
}
}
}
}

return bestActor;

FindTarget -> AlarmUnit


local ScriptedPawn pawnAlly;
local AlarmUnit alarm;
local float dist;
local AlarmUnit bestAlarm;
local float bestDist;


bestAlarm = None;

// Do we have any allies on this level?
foreach AllActors(Class'ScriptedPawn', pawnAlly)
if (GetPawnAllianceType(pawnAlly) == ALLIANCE_Friendly)
break;

// Yes, so look for an alarm box that isn't active...
if (pawnAlly != None)
{
foreach RadiusActors(Class'AlarmUnit', alarm, 2400)
{
if (GetAllianceType(alarm.Alliance) != ALLIANCE_Hostile)
{
dist = VSize((Location-alarm.Location)*vect(1,1,2)); // use squished sphere
if ((bestAlarm == None) || (dist < bestDist))
{
bestAlarm = alarm;
bestDist = dist;
}
}
}

// Is the nearest alarm already going off? And can we reach it?
if (!IsAlarmReady(bestAlarm) || !GetNextAlarmPoint(bestAlarm))
bestAlarm = None;
}

// Return our target alarm box
return (bestAlarm);

FinishFleeing


if (bLeaveAfterFleeing)
GotoState('Wandering');
else
FollowOrders();

FireIfClearShot -> bool


local DeusExWeapon dxWeapon;


dxWeapon = DeusExWeapon(Weapon);
if (dxWeapon != None)
{
if ((dxWeapon.AIFireDelay > 0) && (FireTimer > 0))
return false;
else if (AICanShoot(enemy, true, true, 0.025))
{
Weapon.Fire(0);
FireTimer = dxWeapon.AIFireDelay;
return true;
}
else
return false;
}
else
return false;

FocusDirection -> vector


return (Vector(Rotation)*30+Location);

FollowOrders (optional bool bDefer)


local name tempConvOrders, tempConvOrderTag;


// hack
tempConvOrders = ConvOrders;
tempConvOrderTag = ConvOrderTag;
ResetConvOrders(); // must do this before calling SetOrders(), or recursion will result

if (tempConvOrders != '')
Global.SetOrders(tempConvOrders, tempConvOrderTag, true);
else
Global.FollowOrders(bDefer);

FollowSeatFallbackOrders


FindBestSeat();
if (IsSeatValid(SeatActor))
GotoState('Sitting', 'Begin');
else
GotoState('Wandering');

Frob (Actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

// Check to see if the Frobber is the player. If so, then
// check to see if we need to start a conversation.

if (DeusExPlayer(Frobber) != None)
{
if (DeusExPlayer(Frobber).StartConversation(Self, IM_Frob))
{
ConversationActor = Pawn(Frobber);
return;
}
}

FrobDoor (actor Target) -> bool


local DeusExMover dxMover;
local DeusExMover triggerMover;
local DeusExDecoration trigger;
local float dist;
local DeusExDecoration bestTrigger;
local float bestDist;
local bool bDone;


bDone = false;

dxMover = DeusExMover(Target);
if (dxMover != None)
{
bestTrigger = None;
bestDist = 10000;
foreach AllActors(Class'DeusExDecoration', trigger)
{
if (dxMover.Tag == trigger.Event)
{
dist = VSize(Location - trigger.Location);
if ((bestTrigger == None) || (bestDist > dist))
{
bestTrigger = trigger;
bestDist = dist;
}
}
}
if (bestTrigger != None)
{
foreach AllActors(Class'DeusExMover', triggerMover, dxMover.Tag)
triggerMover.Trigger(bestTrigger, self);
bDone = true;
}
else if (dxMover.bFrobbable)
{
if ((dxMover.WaitingPawn == None) ||
(dxMover.WaitingPawn == self))
{
dxMover.Frob(self, None);
bDone = true;
}
}

if (bDone)
dxMover.WaitingPawn = self;
}
return bDone;


Gasp


PlaySound(sound'MaleGasp', SLOT_Pain,,,, RandomPitch());

GenerateTotalHealth


local float limbDamage, headDamage, torsoDamage;


if (!bInvincible)
{
// Scoring works as follows:
// Disabling the head (100 points damage) will kill you.
// Disabling the torso (100 points damage) will kill you.
// Disabling 2 1/2 limbs (250 points damage) will kill you.
// Combinations can also do you in -- 50 points damage to the head
// and 125 points damage to the limbs, for example.

// Note that this formula can produce numbers less than zero, so we'll clamp our
// health value...

// Compute total limb damage
limbDamage = 0;
if (Default.HealthLegLeft > 0)
limbDamage += float(Default.HealthLegLeft-HealthLegLeft)/Default.HealthLegLeft;
if (Default.HealthLegRight > 0)
limbDamage += float(Default.HealthLegRight-HealthLegRight)/Default.HealthLegRight;
if (Default.HealthArmLeft > 0)
limbDamage += float(Default.HealthArmLeft-HealthArmLeft)/Default.HealthArmLeft;
if (Default.HealthArmRight > 0)
limbDamage += float(Default.HealthArmRight-HealthArmRight)/Default.HealthArmRight;
limbDamage *= 0.4; // 2 1/2 limbs disabled == death

// Compute total head damage
headDamage = 0;
if (Default.HealthHead > 0)
headDamage = float(Default.HealthHead-HealthHead)/Default.HealthHead;

// Compute total torso damage
torsoDamage = 0;
if (Default.HealthTorso > 0)
torsoDamage = float(Default.HealthTorso-HealthTorso)/Default.HealthTorso;

// Compute total health, relative to original health level
Health = FClamp(Default.Health - ((limbDamage+headDamage+torsoDamage)*Default.Health), 0.0, Default.Health);
}
else
{
// Pawn is invincible - reset health to defaults
HealthHead = Default.HealthHead;
HealthTorso = Default.HealthTorso;
HealthArmLeft = Default.HealthArmLeft;
HealthArmRight = Default.HealthArmRight;
HealthLegLeft = Default.HealthLegLeft;
HealthLegRight = Default.HealthLegRight;
Health = Default.Health;
}

GetAllianceType (Name AllianceName) | native

GetCrouchHeight -> float


return (Default.CollisionHeight*0.65);

GetDefaultCollisionHeight -> float


return (Default.CollisionHeight-4.5);

GetDestinationPosition (Seat seatActor, optional float extraDist) -> vector


local Rotator seatRot;
local Vector destPos;


if (seatActor == None)
return (Location);

seatRot = seatActor.Rotation + Rot(0, -16384, 0);
seatRot.Pitch = 0;
destPos = seatActor.Location;
destPos += vect(0,0,1)*(CollisionHeight-seatActor.CollisionHeight);
destPos += Vector(seatRot)*(seatActor.CollisionRadius+CollisionRadius+extraDist);

return (destPos);

GetFloorMaterial -> name


local vector EndTrace, HitLocation, HitNormal;
local actor target;
local int texFlags;
local name texName, texGroup;


// trace down to our feet
EndTrace = Location - CollisionHeight * 2 * vect(0,0,1);

foreach TraceTexture(class'Actor', target, texName, texGroup, texFlags, HitLocation, HitNormal, EndTrace)
{
if ((target == Level) || target.IsA('Mover'))
break;
}

return texGroup;

GetNextAlarmPoint (AlarmUnit alarm) -> bool


local vector alarmPoint;
local bool bValid;


destPoint = None;
destLoc = vect(0,0,0);
bValid = false;

if ((alarm != None) && !alarm.bDeleteMe)
{
alarmPoint = FindAlarmPosition(alarm);
if (PointReachable(alarmPoint))
{
destLoc = alarmPoint;
bValid = true;
}
else
{
MoveTarget = FindPathTo(alarmPoint);
if (MoveTarget != None)
{
destPoint = MoveTarget;
bValid = true;
}
}
}

return (bValid);

GetNextLocation (out vector nextLoc) -> bool


local float dist;
local rotator rotation;
local bool bDone;
local float seekDistance;
local Actor hitActor;
local vector HitLocation, HitNormal;
local vector diffVect;
local bool bLOS;


if (bSeekLocation)
{
if (SeekType == SEEKTYPE_Guess)
seekDistance = (200+FClamp(GroundSpeed*EnemyLastSeen*0.5, 0, 1000));
else
seekDistance = 300;
}
else
seekDistance = 60;

dist = VSize(Location-destLoc);
bDone = false;
bLOS = false;

if (dist < seekDistance)
{
bLOS = true;
foreach TraceVisibleActors(Class'Actor', hitActor, hitLocation, hitNormal,
destLoc, Location+vect(0,0,1)*BaseEyeHeight)
{
if (hitActor != self)
{
if (hitActor == Level)
bLOS = false;
else if (IsPointInCylinder(hitActor, destLoc, 16, 16))
break;
else if (hitActor.bBlockSight && !hitActor.bHidden)
bLOS = false;
}
if (!bLOS)
break;
}
}

if (!bLOS)
{
if (PointReachable(destLoc))
{
rotation = Rotator(destLoc - Location);
if (seekDistance == 0)
nextLoc = destLoc;
else if (!AIDirectionReachable(destLoc, rotation.Yaw, rotation.Pitch, 0, seekDistance, nextLoc))
bDone = true;
if (!bDone && bDefendHome && !IsNearHome(nextLoc))
bDone = true;
if (!bDone) // hack, because Unreal's movement code SUCKS
{
diffVect = nextLoc - Location;
if (Physics == PHYS_Walking)
diffVect *= vect(1,1,0);
if (VSize(diffVect) < 20)
bDone = true;
else if (IsPointInCylinder(self, nextLoc, 10, 10))
bDone = true;
}
}
else
{
MoveTarget = FindPathTo(destLoc);
if (MoveTarget == None)
bDone = true;
else if (bDefendHome && !IsNearHome(MoveTarget.Location))
bDone = true;
else
nextLoc = MoveTarget.Location;
}
}
else
bDone = true;

return (!bDone);

GetNextVector (Actor destination, out vector outVect) -> bool


local bool bValid;
local rotator rot;
local float dist;
local float maxDist;


bValid = true;
if (destination != None)
{
maxDist = 64;
rot = Rotator(destination.Location - Location);
dist = VSize(destination.Location - Location);
if (dist < maxDist)
outVect = destination.Location;
else if (!AIDirectionReachable(Location, rot.Yaw, rot.Pitch,
0, maxDist, outVect))
bValid = false;
}
else
bValid = false;

return (bValid);

GetNextWaypoint (Actor destination) -> Actor


local Actor moveTarget;


if (destination == None)
moveTarget = None;
else if (ActorReachable(destination))
moveTarget = destination;
else
moveTarget = FindPathToward(destination);

return (moveTarget);

GetOvershootDestination (float randomness, optional float focus) -> NavigationPoint


local NavigationPoint navPoint, bestPoint;
local float distance;
local float score, bestScore;
local int yaw;
local rotator rot;
local float yawCutoff;


if (focus <= 0)
focus = 0.6;

yawCutoff = int(32768*focus);
bestPoint = None;
bestScore = 0;

foreach ReachablePathnodes(Class'NavigationPoint', navPoint, None, distance)
{
if (distance < 1)
distance = 1;
rot = Rotator(navPoint.Location-Location);
yaw = rot.Yaw + (16384*randomness);
yaw = (yaw-Rotation.Yaw) & 0xFFFF;
if (yaw > 32767)
yaw -= 65536;
yaw = abs(yaw);
if (yaw <= yawCutoff)
{
score = yaw/distance;
if ((bestPoint == None) || (score < bestScore))
{
bestPoint = navPoint;
bestScore = score;
}
}
}

return bestPoint;

GetPawnAllianceType (Pawn QueryPawn) | native

GetProjectileList (out NearbyProjectileList projList, vector Location) -> int


local float dist;
local int count;
local DeusExProjectile curProj;
local ThrownProjectile throwProj;
local Cloud cloudProj;
local vector HitNormal, HitLocation;
local vector extent;
local vector traceEnd;
local Actor hitActor;
local float range;
local vector pos;
local float time;
local float maxTime;
local float elasticity;
local int i;
local bool bValid;


for (i=0; i projList.list[i].projectile = None;
projList.center = Location;

maxTime = 2.0;
foreach RadiusActors(Class'DeusExProjectile', curProj, 1000)
{
if (IsProjectileDangerous(curProj))
{
throwProj = ThrownProjectile(curProj);
cloudProj = Cloud(curProj);
extent = vect(1,1,0)*curProj.CollisionRadius;
extent.Z = curProj.CollisionHeight;

range = VSize(extent);
if (curProj.bExplodes)
if (range < curProj.blastRadius)
range = curProj.blastRadius;
if (cloudProj != None)
if (range < cloudProj.cloudRadius)
range = cloudProj.cloudRadius;
range += CollisionRadius+60;

if (throwProj != None)
elasticity = throwProj.Elasticity;
else
elasticity = 0.2;

bValid = true;
if (throwProj != None)
if (throwProj.bProximityTriggered) // HACK!!!
bValid = false;

if (((curProj.Physics == PHYS_Falling) || (curProj.Physics == PHYS_Projectile) || (curProj.Physics == PHYS_None)) &&
bValid)
{
pos = curProj.Location;
dist = VSize(Location - curProj.Location);
AddProjectileToList(projList, curProj, pos, dist, range);
if (curProj.Physics == PHYS_Projectile)
{
traceEnd = curProj.Location + curProj.Velocity*maxTime;
hitActor = Trace(HitLocation, HitNormal, traceEnd, curProj.Location, true, extent);
if (hitActor == None)
pos = traceEnd;
else
pos = HitLocation;
dist = VSize(Location - pos);
AddProjectileToList(projList, curProj, pos, dist, range);
}
else if (curProj.Physics == PHYS_Falling)
{
time = ParabolicTrace(pos, curProj.Velocity, curProj.Location, true, extent, maxTime,
elasticity, curProj.bBounce, 60);
if (time > 0)
{
dist = VSize(Location - pos);
AddProjectileToList(projList, curProj, pos, dist, range);
}
}
}
}
}

count = 0;
for (i=0; i if (projList.list[i].projectile != None)
count++;

return (count);


GetSitHeight -> float


return (GetDefaultCollisionHeight()+(BaseAssHeight*0.5));

GetStyleTexture (ERenderStyle newStyle, texture oldTex, optional texture newTex) -> Texture


local texture defaultTex;


if (newStyle == STY_Translucent)
defaultTex = Texture'BlackMaskTex';
else if (newStyle == STY_Modulated)
defaultTex = Texture'GrayMaskTex';
else if (newStyle == STY_Masked)
defaultTex = Texture'PinkMaskTex';
else
defaultTex = Texture'BlackMaskTex';

if (oldTex == None)
return defaultTex;
else if (oldTex == Texture'BlackMaskTex')
return Texture'BlackMaskTex'; // hack
else if (oldTex == Texture'GrayMaskTex')
return defaultTex;
else if (oldTex == Texture'PinkMaskTex')
return defaultTex;
else if (newTex != None)
return newTex;
else
return oldTex;


GetSwimPivot -> vector


// THIS IS A HIDEOUS, UGLY, MASSIVELY EVIL HACK!!!!
return (vect(0,0,1)*CollisionHeight*0.65);

GetWalkingSpeed -> float


if (Physics == PHYS_Swimming)
return MaxDesiredSpeed;
else
return WalkingSpeed;

GoHome -> bool


if (bUseHome && !IsNearHome(Location))
{
destLoc = HomeLoc;
destPoint = None;
if (PointReachable(destLoc))
return true;
else
{
MoveTarget = FindPathTo(destLoc);
if (MoveTarget != None)
return true;
else
return false;
}
}
else
return false;

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
else if ((damageType == 'TearGas') || (damageType == 'HalonGas'))
GotoState('RubbingEyes');
else if (damageType == 'Stunned')
GotoState('Stunned');
else if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

GotoNextState


local bool bSuccess;
local name oldState, oldLabel;


if (HasNextState())
{
oldState = NextState;
oldLabel = NextLabel;
if (oldLabel == '')
oldLabel = 'Begin';

ClearNextState();

GotoState(oldState, oldLabel);
}
else
ClearNextState();

HandToHandAttack


local DeusExWeapon dxWeapon;


dxWeapon = DeusExWeapon(Weapon);
if (dxWeapon != None)
dxWeapon.OwnerHandToHandAttack();

HandleAlarm (Name event, EAIEventState state, XAIParams params)


local AlarmUnit alarm;
local LaserTrigger laser;
local SecurityCamera camera;
local Computers computer;
local Pawn alarmInstigator;
local vector alarmLocation;

// React, Fear


if (state == EAISTATE_Begin || state == EAISTATE_Pulse)
{
alarmInstigator = None;
alarm = AlarmUnit(params.bestActor);
laser = LaserTrigger(params.bestActor);
camera = SecurityCamera(params.bestActor);
computer = Computers(params.bestActor);
if (alarm != None)
{
alarmInstigator = alarm.alarmInstigator;
alarmLocation = alarm.alarmLocation;
}
else if (laser != None)
{
alarmInstigator = Pawn(laser.triggerActor);
if (alarmInstigator == None)
alarmInstigator = laser.triggerActor.Instigator;
alarmLocation = laser.actorLocation;
}
else if (camera != None)
{
alarmInstigator = GetPlayerPawn(); // player is implicit for cameras
alarmLocation = camera.playerLocation;
}
else if (computer != None)
{
alarmInstigator = GetPlayerPawn(); // player is implicit for computers
alarmLocation = computer.Location;
}

if (bFearAlarm)
{
IncreaseFear(alarmInstigator, 2.0);
if (IsFearful())
{
SetDistressTimer();
SetEnemy(alarmInstigator, , true);
GotoState('Fleeing');
}
}

if (alarmInstigator != None)
{
if (alarmInstigator.Health > 0)
{
if (IsValidEnemy(alarmInstigator))
{
AlarmTimer = 120;
SetDistressTimer();
SetSeekLocation(alarmInstigator, alarmLocation, SEEKTYPE_Sound);
HandleEnemy();
}
}
}
}

HandleDamage (int actualDamage, Vector hitLocation, Vector offset, name damageType) -> EHitLocation


local EHitLocation hitPos;
local float headOffsetZ, headOffsetY, armOffset;


// calculate our hit extents
headOffsetZ = CollisionHeight * 0.7;
headOffsetY = CollisionRadius * 0.3;
armOffset = CollisionRadius * 0.35;

hitPos = HITLOC_None;

if (actualDamage > 0)
{
if (offset.z > headOffsetZ) // head
{
// narrow the head region
if ((Abs(offset.x) < headOffsetY) || (Abs(offset.y) < headOffsetY))
{
// don't allow headshots with stunning weapons
if ((damageType == 'Stunned') || (damageType == 'KnockedOut'))
HealthHead -= actualDamage;
else
HealthHead -= actualDamage * 8;
if (offset.x < 0.0)
hitPos = HITLOC_HeadBack;
else
hitPos = HITLOC_HeadFront;
}
else // sides of head treated as torso
{
HealthTorso -= actualDamage * 2;
if (offset.x < 0.0)
hitPos = HITLOC_TorsoBack;
else
hitPos = HITLOC_TorsoFront;
}
}
else if (offset.z < 0.0) // legs
{
if (offset.y > 0.0)
{
HealthLegRight -= actualDamage * 2;
if (offset.x < 0.0)
hitPos = HITLOC_RightLegBack;
else
hitPos = HITLOC_RightLegFront;
}
else
{
HealthLegLeft -= actualDamage * 2;
if (offset.x < 0.0)
hitPos = HITLOC_LeftLegBack;
else
hitPos = HITLOC_LeftLegFront;
}

// if this part is already dead, damage the adjacent part
if ((HealthLegRight < 0) && (HealthLegLeft > 0))
{
HealthLegLeft += HealthLegRight;
HealthLegRight = 0;
}
else if ((HealthLegLeft < 0) && (HealthLegRight > 0))
{
HealthLegRight += HealthLegLeft;
HealthLegLeft = 0;
}

if (HealthLegLeft < 0)
{
HealthTorso += HealthLegLeft;
HealthLegLeft = 0;
}
if (HealthLegRight < 0)
{
HealthTorso += HealthLegRight;
HealthLegRight = 0;
}
}
else // arms and torso
{
if (offset.y > armOffset)
{
HealthArmRight -= actualDamage * 2;
if (offset.x < 0.0)
hitPos = HITLOC_RightArmBack;
else
hitPos = HITLOC_RightArmFront;
}
else if (offset.y < -armOffset)
{
HealthArmLeft -= actualDamage * 2;
if (offset.x < 0.0)
hitPos = HITLOC_LeftArmBack;
else
hitPos = HITLOC_LeftArmFront;
}
else
{
HealthTorso -= actualDamage * 2;
if (offset.x < 0.0)
hitPos = HITLOC_TorsoBack;
else
hitPos = HITLOC_TorsoFront;
}

// if this part is already dead, damage the adjacent part
if (HealthArmLeft < 0)
{
HealthTorso += HealthArmLeft;
HealthArmLeft = 0;
}
if (HealthArmRight < 0)
{
HealthTorso += HealthArmRight;
HealthArmRight = 0;
}
}
}

GenerateTotalHealth();

return hitPos;


HandleDistress (Name event, EAIEventState state, XAIParams params)


local float seeTime;
local Pawn distressee;
local DeusExPlayer distresseePlayer;
local ScriptedPawn distresseePawn;
local Pawn distressor;
local DeusExPlayer distressorPlayer;
local ScriptedPawn distressorPawn;
local bool bDistresseeValid;
local bool bDistressorValid;
local float distressVal;
local name stateName;
local bool bAttacking;
local bool bFleeing;

// React, Fear, Hate


bAttacking = false;
seeTime = 0;

if (state == EAISTATE_Begin || state == EAISTATE_Pulse)
{
distressee = InstigatorToPawn(params.bestActor);
if (distressee != None)
{
if (bFearDistress)
IncreaseFear(distressee.Enemy, 1.0);
bDistresseeValid = false;
bDistressorValid = false;
distresseePlayer = DeusExPlayer(distressee);
distresseePawn = ScriptedPawn(distressee);
if (GetPawnAllianceType(distressee) == ALLIANCE_Friendly)
{
if (distresseePawn != None)
{
if (distresseePawn.bDistressed && (distresseePawn.EnemyLastSeen <= EnemyTimeout))
{
bDistresseeValid = true;
seeTime = distresseePawn.EnemyLastSeen;
}
}
else if (distresseePlayer != None)
bDistresseeValid = true;
}
if (bDistresseeValid)
{
distressor = distressee.Enemy;
distressorPlayer = DeusExPlayer(distressor);
distressorPawn = ScriptedPawn(distressor);
if (distressorPawn != None)
{
if (bHateDistress || (distressorPawn.GetPawnAllianceType(distressee) == ALLIANCE_Hostile))
bDistressorValid = true;
}
else if (distresseePawn != None)
{
if (bHateDistress || (distresseePawn.GetPawnAllianceType(distressor) == ALLIANCE_Hostile))
bDistressorValid = true;
}

// Finally, react
if (bDistressorValid)
{
if (bHateDistress)
IncreaseAgitation(distressor, 1.0);
if (SetEnemy(distressor, seeTime))
{
SetDistressTimer();
HandleEnemy();
bAttacking = true;
}
}
// BOOGER! Make NPCs react by seeking if distressor isn't an enemy?
}

if (!bAttacking && bFearDistress)
{
distressVal = 0;
bFleeing = false;
if (distresseePawn != None)
{
stateName = distresseePawn.GetStateName();
if (stateName == 'Fleeing') // hack -- to prevent infinite fleeing
{
if (distresseePawn.DistressTimer >= 0)
{
if (FearSustainTime - distresseePawn.DistressTimer >= 1)
{
IncreaseFear(distressee.Enemy, 1.0, distresseePawn.DistressTimer);
distressVal = distresseePawn.DistressTimer;
bFleeing = true;
}
}
}
else
{
IncreaseFear(distressee.Enemy, 1.0);
bFleeing = true;
}
}
else
{
IncreaseFear(distressee.Enemy, 1.0);
bFleeing = true;
}
if (bFleeing && IsFearful())
{
if ((DistressTimer > distressVal) || (DistressTimer < 0))
DistressTimer = distressVal;
SetEnemy(distressee.Enemy, , true);
GotoState('Fleeing');
}
}
}
}

HandleEnemy


SetState('HandlingEnemy', 'Begin');

HandleFutz (Name event, EAIEventState state, XAIParams params)


// React

if (state == EAISTATE_Begin || state == EAISTATE_Pulse)
ReactToFutz(); // only players can futz

HandleHacking (Name event, EAIEventState state, XAIParams params)


local Pawn pawnActor;

// Fear, Hate


if (state == EAISTATE_Begin || state == EAISTATE_Pulse)
{
pawnActor = GetPlayerPawn();
if (pawnActor != None)
{
if (bHateHacking)
IncreaseAgitation(pawnActor, 1.0);
if (bFearHacking)
IncreaseFear(pawnActor, 0.51);
if (SetEnemy(pawnActor))
{
SetDistressTimer();
HandleEnemy();
}
else if (bFearHacking && IsFearful())
{
SetDistressTimer();
SetEnemy(pawnActor, , true);
GotoState('Fleeing');
}
else // only players can hack
ReactToFutz();
}
}

HandleLoudNoise (Name event, EAIEventState state, XAIParams params)


local Actor bestActor;
local Pawn instigator;


if (state == EAISTATE_Begin || state == EAISTATE_Pulse)
{
bestActor = params.bestActor;
if ((bestActor != None) && (EnemyLastSeen > 2.0))
{
instigator = Pawn(bestActor);
if (instigator == None)
instigator = bestActor.Instigator;
if (instigator != None)
{
if (IsValidEnemy(instigator))
{
SetSeekLocation(instigator, bestActor.Location, SEEKTYPE_Sound);
destLoc = LastSeenPos;
if (bInterruptSeek)
GotoState('Seeking', 'GoToLocation');
}
}
}
}

HandleProjectiles (Name event, EAIEventState state, XAIParams params)


local DeusExProjectile dxProjectile;

// React, Fear


if (state == EAISTATE_Begin || state == EAISTATE_Pulse)
if (params.bestActor != None)
ReactToProjectiles(params.bestActor);

HandleShot (Name event, EAIEventState state, XAIParams params)


local Pawn pawnActor;

// React, Fear, Hate


if (state == EAISTATE_Begin || state == EAISTATE_Pulse)
{
pawnActor = InstigatorToPawn(params.bestActor);
if (pawnActor != None)
{
if (bHateShot)
IncreaseAgitation(pawnActor);
if (bFearShot)
IncreaseFear(pawnActor, 1.0);
if (SetEnemy(pawnActor))
{
SetDistressTimer();
HandleEnemy();
}
else if (bFearShot && IsFearful())
{
SetDistressTimer();
SetEnemy(pawnActor, , true);
GotoState('Fleeing');
}
else if (pawnActor.bIsPlayer)
ReactToFutz();
}
}

HandleSighting (Pawn pawnSighted)


if ((EnemyLastSeen > 2.0) && IsValidEnemy(pawnSighted))
{
SetSeekLocation(pawnSighted, pawnSighted.Location, SEEKTYPE_Sight);
destLoc = LastSeenPos;
if (bInterruptSeek)
GotoState('Seeking', 'GoToLocation');
}

HandleTurn (Actor Other) -> bool


GotoState('BackingOff', 'Pause');
return false;

HandleWeapon (Name event, EAIEventState state, XAIParams params)


local Pawn pawnActor;

// Fear, Hate


if (state == EAISTATE_Begin || state == EAISTATE_Pulse)
{
pawnActor = InstigatorToPawn(params.bestActor);
if (pawnActor != None)
{
if (bHateWeapon)
IncreaseAgitation(pawnActor);
if (bFearWeapon)
IncreaseFear(pawnActor, 1.0);

// Let presence checking handle enemy sighting

if (!IsValidEnemy(pawnActor))
{
if (bFearWeapon && IsFearful())
{
SetDistressTimer();
SetEnemy(pawnActor, , true);
GotoState('Fleeing');
}
else if (pawnActor.bIsPlayer)
ReactToFutz();
}
}
}

HasEnemyTimedOut -> bool


if (EnemyTimeout > 0)
{
if (EnemyLastSeen > EnemyTimeout)
return true;
else
return false;
}
else
return false;

HasNextState -> bool


if ((NextState == '') || (NextState == GetStateName()))
return false;
else
return true;

HasTwoHandedWeapon -> Bool


if ((Weapon != None) && (Weapon.Mass >= 30))
return True;
else
return False;

HaveSeenCarcass (Name CarcassName) | native

HearNoise (float Loudness, Actor NoiseMaker)


// Do nothing

HitWall (vector HitNormal, actor Wall)


if (Physics == PHYS_Falling)
return;
Global.HitWall(HitNormal, Wall);
if (Target == Wall)
CheckOpenDoor(HitNormal, Wall);

ImpartMomentum (Vector momentum, Pawn instigatedBy)


if (Physics == PHYS_None)
SetMovementPhysics();
if (Physics == PHYS_Walking)
momentum.Z = 0.4 * VSize(momentum);
if ( instigatedBy == self )
momentum *= 0.6;
momentum = momentum/Mass;
AddVelocity( momentum );

IncreaseAgitation (Actor actorInstigator, optional float AgitationLevel)


local Pawn instigator;
local float minLevel;


instigator = InstigatorToPawn(actorInstigator);
if (instigator != None)
{
AgitationTimer = AgitationSustainTime;
if (AgitationCheckTimer <= 0)
{
AgitationCheckTimer = 1.5; // hardcoded for now
if (AgitationLevel == 0)
{
if (MaxProvocations < 0)
MaxProvocations = 0;
AgitationLevel = 1.0/(MaxProvocations+1);
}
if (AgitationLevel > 0)
{
bAlliancesChanged = True;
bNoNegativeAlliances = False;
AgitateAlliance(instigator.Alliance, AgitationLevel);
}
}
}


InitializeAlliances


local int i;


for (i=0; i<8; i++)
if (InitialAlliances[i].AllianceName != '')
ChangeAlly(InitialAlliances[i].AllianceName,
InitialAlliances[i].AllianceLevel,
InitialAlliances[i].bPermanent);


InitializeHomeBase


if (!bUseHome)
{
HomeActor = None;
HomeLoc = Location;
HomeRot = vector(Rotation);
if (HomeTag == 'Start')
bUseHome = true;
else
{
HomeActor = HomeBase(FindTaggedActor(HomeTag, , Class'HomeBase'));
if (HomeActor != None)
{
HomeLoc = HomeActor.Location;
HomeRot = vector(HomeActor.Rotation);
HomeExtent = HomeActor.Extent;
bUseHome = true;
}
}
HomeRot *= 100;
}

InitializeInventory


local int i, j;
local Inventory inv;
local Weapon weapons[8];
local int weaponCount;
local Weapon firstWeapon;


// Add initial inventory items
weaponCount = 0;
for (i=0; i<8; i++)
{
if ((InitialInventory[i].Inventory != None) && (InitialInventory[i].Count > 0))
{
firstWeapon = None;
for (j=0; j {
inv = None;
if (Class(InitialInventory[i].Inventory) != None)
{
inv = FindInventoryType(InitialInventory[i].Inventory);
if (inv != None)
Ammo(inv).AmmoAmount += Class(InitialInventory[i].Inventory).default.AmmoAmount;
}
if (inv == None)
{
inv = spawn(InitialInventory[i].Inventory, self);
if (inv != None)
{
inv.InitialState='Idle2';
inv.GiveTo(Self);
inv.SetBase(Self);
if ((firstWeapon == None) && (Weapon(inv) != None))
firstWeapon = Weapon(inv);
}
}
}
if (firstWeapon != None)
weapons[WeaponCount++] = firstWeapon;
}
}
for (i=0; i {
if ((weapons[i].AmmoType == None) && (weapons[i].AmmoName != None) &&
(weapons[i].AmmoName != Class'AmmoNone'))
{
weapons[i].AmmoType = Ammo(FindInventoryType(weapons[i].AmmoName));
if (weapons[i].AmmoType == None)
{
weapons[i].AmmoType = spawn(weapons[i].AmmoName);
weapons[i].AmmoType.InitialState='Idle2';
weapons[i].AmmoType.GiveTo(Self);
weapons[i].AmmoType.SetBase(Self);
}
}
}

SetupWeapon(false);


InitializePawn


if (!bInitialized)
{
InitializeInventory();
InitializeAlliances();
InitializeHomeBase();

BlockReactions();

if (Alliance != '')
ChangeAlly(Alliance, 1.0, true);

if (!bInWorld)
{
// tricky
bInWorld = true;
LeaveWorld();
}

// hack!
animTimer[1] = 20.0;
PlayTurnHead(LOOK_Forward, 1.0, 0.0001);

bInitialized = true;
}

InstigatorToPawn (Actor eventActor) -> Pawn


local Pawn pawnActor;


if (Inventory(eventActor) != None)
{
if (Inventory(eventActor).Owner != None)
eventActor = Inventory(eventActor).Owner;
}
else if (DeusExDecoration(eventActor) != None)
eventActor = GetPlayerPawn();
else if (DeusExProjectile(eventActor) != None)
eventActor = eventActor.Instigator;

pawnActor = Pawn(eventActor);
if (pawnActor == self)
pawnActor = None;

return pawnActor;


IsAlarmInRange (AlarmUnit alarm) -> bool


local bool bInRange;


bInRange = false;
if ((alarm != None) && !alarm.bDeleteMe)
if ((VSize((alarm.Location-Location)*vect(1,1,0)) <
(CollisionRadius+alarm.CollisionRadius+24)) &&
(Abs(alarm.Location.Z-Location.Z) < (CollisionHeight+alarm.CollisionHeight)))
bInRange = true;

return (bInRange);

IsAlarmReady (Actor actorAlarm) -> bool


local bool bReady;
local AlarmUnit alarm;


bReady = false;
alarm = AlarmUnit(actorAlarm);
if ((alarm != None) && !alarm.bDeleteMe)
if (!alarm.bActive)
if ((alarm.associatedPawn == None) ||
(alarm.associatedPawn == self))
bReady = true;

return bReady;

IsDoor (Actor door, optional bool bWarn) -> bool


local bool bIsDoor;
local DeusExMover dxMover;


bIsDoor = false;

dxMover = DeusExMover(door);
if (dxMover != None)
{
if (dxMover.NumKeys > 1)
{
if (dxMover.bIsDoor)
bIsDoor = true;
/*
else if (bWarn) // hack for now
log("WARNING: NPC "$self$" trying to use door "$dxMover$", but bIsDoor flag is False");
*/
}
}

return bIsDoor;

IsFearful -> bool


if (FearLevel >= 1.0)
return true;
else
return false;

IsHandToHand -> bool


if (Weapon != None)
{
if (DeusExWeapon(Weapon) != None)
{
if (DeusExWeapon(Weapon).bHandToHand)
return true;
else
return false;
}
else
return false;
}
else
return false;

IsIntersectingSeat -> bool


local bool bIntersect;
local vector testVector;


bIntersect = false;
if (SeatActor != None)
bIntersect = IsOverlapping(SeatActor);

return (bIntersect);

IsNearHome (vector position) -> bool


local bool bNear;


bNear = true;
if (bUseHome)
{
if (VSize(HomeLoc-position) <= HomeExtent)
{
if (!FastTrace(position, HomeLoc))
bNear = false;
}
else
bNear = false;
}

return bNear;

IsPrimaryDamageType (name damageType) -> bool


local bool bPrimary;


switch (damageType)
{
case 'Exploded':
case 'TearGas':
case 'HalonGas':
case 'PoisonGas':
case 'PoisonEffect':
case 'Radiation':
case 'EMP':
case 'Drowned':
case 'NanoVirus':
bPrimary = false;
break;

case 'Stunned':
case 'KnockedOut':
case 'Burned':
case 'Flamed':
case 'Poison':
case 'Shot':
case 'Sabot':
default:
bPrimary = true;
break;
}

return (bPrimary);

IsProjectileDangerous (DeusExProjectile projectile) -> bool


local bool bEvil;


if (projectile.IsA('Cloud'))
bEvil = true;
else if (projectile.IsA('ThrownProjectile'))
{
if (projectile.IsA('SpyBot'))
bEvil = false;
else if ((ThrownProjectile(projectile) != None) && (ThrownProjectile(projectile).bProximityTriggered))
bEvil = false;
else
bEvil = true;
}
else
bEvil = false;

return (bEvil);


IsSeatValid (Actor checkActor) -> bool


local PlayerPawn player;
local Seat checkSeat;


checkSeat = Seat(checkActor);
if (checkSeat == None)
return false;
else if (checkSeat.bDeleteMe)
return false;
else if (!bSitAnywhere && (VSize(checkSeat.Location-checkSeat.InitialPosition) > 70))
return false;
else
{
player = GetPlayerPawn();
if (player != None)
{
if (player.CarriedDecoration == checkSeat)
return false;
}
return true;
}

IsThrownWeapon (DeusExWeapon testWeapon) -> bool


local Class throwClass;
local bool bIsThrown;


bIsThrown = false;
if (testWeapon != None)
{
if (!testWeapon.bInstantHit)
{
throwClass = class(testWeapon.ProjectileClass);
if (throwClass != None)
bIsThrown = true;
}
}

return bIsThrown;


IsValidEnemy (Pawn TestEnemy, optional bool bCheckAlliance) | native

IsWeaponReloading -> bool


return (ReloadTimer >= 0.3);

JumpOffPawn


/*
Velocity += (60 + CollisionRadius) * VRand();
Velocity.Z = 180 + CollisionHeight;
SetPhysics(PHYS_Falling);
bJumpOffPawn = true;
SetFall();
*/
//log("ERROR - JumpOffPawn should not be called!");

JumpOutOfWater (vector jumpDir)


Falling();
Velocity = jumpDir * WaterSpeed;
Acceleration = jumpDir * AccelRate;
velocity.Z = 380; //set here so physics uses this for remainder of tick
PlayFalling();
bUpAndOut = true;

KillShadow


if (Shadow != None)
{
Shadow.Destroy();
Shadow = None;
}

Killed (pawn Killer, pawn Other, name damageType)


if ((Enemy == Other) && (Other != None) && !Other.bIsPlayer)
Enemy = None;

Landed (vector HitNormal)


local float landVol, minJumpZ;
local vector legLocation;


minJumpZ = FMax(JumpZ, 150.0);

if ( (Velocity.Z < -0.8 * minJumpZ) || bUpAndOut)
{
PlayLanded(Velocity.Z);
if (Velocity.Z < -700)
{
legLocation = Location + vect(-1,0,-1); // damage left leg
TakeDamage(-0.14 * (Velocity.Z + 700), Self, legLocation, vect(0,0,0), 'fell');
legLocation = Location + vect(1,0,-1); // damage right leg
TakeDamage(-0.14 * (Velocity.Z + 700), Self, legLocation, vect(0,0,0), 'fell');
legLocation = Location + vect(0,0,1); // damage torso
TakeDamage(-0.04 * (Velocity.Z + 700), Self, legLocation, vect(0,0,0), 'fell');
}
landVol = Velocity.Z/JumpZ;
landVol = 0.005 * Mass * FMin(5, landVol * landVol);
if ( !FootRegion.Zone.bWaterZone )
PlaySound(Land, SLOT_Interact, FMin(20, landVol));
}
else if ( Velocity.Z < -0.8 * JumpZ )
PlayLanded(Velocity.Z);

LeaveWorld


PutInWorld(false);

LongFall


SetFall();
GotoState('FallingState', 'LongFall');

LoopBaseConvoAnim


// Special case for sitting
if (bSitting)
{
if (!IsAnimating())
PlaySitting();
}

// Special case for dancing
else if (bDancing)
{
if (!IsAnimating())
PlayDancing();
}

// Otherwise, just do the usual shit
else
Super.LoopBaseConvoAnim();


LoopHeadConvoAnim

LoudNoiseScore (actor receiver, actor sender, float score) -> float


local Pawn pawnSender;


// Cull events received from friends
pawnSender = Pawn(sender);
if (pawnSender == None)
pawnSender = sender.Instigator;
if (pawnSender == None)
score = 0;
else if (!IsValidEnemy(pawnSender))
score = 0;

return score;

MakePawnIgnored (bool bNewIgnore)


if (bNewIgnore)
{
bIgnore = bNewIgnore;
// to restore original behavior, uncomment the next line
//bDetectable = !bNewIgnore;
}
else
{
bIgnore = Default.bIgnore;
// to restore original behavior, uncomment the next line
//bDetectable = Default.bDetectable;
}


MoveFallingBody


local Vector moveDir;
local float totalTime;
local float speed;
local float stopTime;
local int numFrames;


if ((AnimRate > 0) && !IsA('Robot'))
{
totalTime = 1.0/AnimRate; // determine how long the anim lasts
numFrames = int((1.0/(1.0-AnimLast))+0.1); // count frames (hack)

// defaults
moveDir = vect(0,0,0);
stopTime = 0.01;

ComputeFallDirection(totalTime, numFrames, moveDir, stopTime);

speed = VSize(moveDir)/stopTime; // compute speed

// Set variables necessary for movement when walking
if (moveDir == vect(0,0,0))
Acceleration = vect(0,0,0);
else
Acceleration = Normal(moveDir)*AccelRate;
GroundSpeed = speed;
DesiredSpeed = 1.0;
bIsWalking = false;
DeathTimer = stopTime;
}
else
Acceleration = vect(0,0,0);

PainTimer


local float depth;
local PointRegion painRegion;


if ((Health <= 0) || (Level.NetMode == NM_Client))
return;

painRegion = HeadRegion;
if (!painRegion.Zone.bPainZone || (painRegion.Zone.DamageType == ReducedDamageType))
painRegion = Region;
if (!painRegion.Zone.bPainZone || (painRegion.Zone.DamageType == ReducedDamageType))
painRegion = FootRegion;

if (painRegion.Zone.bPainZone && (painRegion.Zone.DamageType != ReducedDamageType))
{
depth = 0;
if (FootRegion.Zone.bPainZone)
depth += 0.3;
if (Region.Zone.bPainZone)
depth += 0.3;
if (HeadRegion.Zone.bPainZone)
depth += 0.4;

if (painRegion.Zone.DamagePerSec > 0)
TakeDamage(int(float(painRegion.Zone.DamagePerSec) * depth), None, Location, vect(0,0,0), painRegion.Zone.DamageType);
// took out healing for NPCs -- we don't use healing zones anyway
/*
else if ( Health < Default.Health )
Health = Min(Default.Health, Health - depth * FootRegion.Zone.DamagePerSec);
*/

if (Health > 0)
PainTime = 1.0;
}
else if (HeadRegion.Zone.bWaterZone && (UnderWaterTime > 0))
{
TakeDamage(5, None, Location, vect(0,0,0), 'Drowned');
if (Health > 0)
PainTime = 2.0;
}

PickDestination -> bool


local bool bSuccess;
local float magnitude;
local rotator rot;


magnitude = 300;

rot = Rotator(Destination-Location);
bSuccess = AIPickRandomDestination(64, magnitude, rot.Yaw+32768, 0.8, -rot.Pitch, 0.8, 3,
0.9, useLoc);

return bSuccess;

PickStartPoint -> PatrolPoint


local NavigationPoint nav;
local PatrolPoint curNav;
local float curDist;
local PatrolPoint closestNav;
local float closestDist;


nav = Level.NavigationPointList;
while (nav != None)
{
nav.visitedWeight = 0;
nav = nav.nextNavigationPoint;
}

closestNav = None;
closestDist = 100000;
nav = Level.NavigationPointList;
while (nav != None)
{
curNav = PatrolPoint(nav);
if ((curNav != None) && (curNav.Tag == OrderTag))
{
while (curNav != None)
{
if (curNav.visitedWeight != 0) // been here before
break;
curDist = VSize(Location - curNav.Location);
if ((closestNav == None) || (closestDist > curDist))
{
closestNav = curNav;
closestDist = curDist;
}
curNav.visitedWeight = 1;
curNav = curNav.NextPatrolPoint;
}
}
nav = nav.nextNavigationPoint;
}

return (closestNav);

PlayAllianceFriendlySound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (Enemy == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_AllianceFriendly);

PlayAllianceHostileSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (Enemy == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_AllianceHostile);

PlayAreaSecureSound


local DeusExPlayer dxPlayer;


// Should we do a player check here?

dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (Enemy == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_AreaSecure);

PlayAttack


if (Region.Zone.bWaterZone)
PlayAnimPivot('Tread',,,GetSwimPivot());
else
{
if (bUseSecondaryAttack)
PlayAnimPivot('AttackSide');
else
PlayAnimPivot('Attack');
}

PlayBeginAttack -> bool


return false;

PlayBodyThud


PlaySound(sound'BodyThud', SLOT_Interact);

PlayCarcassSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (SeekPawn == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_Gore);

PlayChallenge


log("ERROR - PlayChallenge should not be called!");

PlayCowerBegin


// ClientMessage("PlayCowerBegin()");
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,,GetSwimPivot());
else
PlayAnimPivot('CowerBegin');

PlayCowerEnd


// ClientMessage("PlayCowerEnd()");
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,,GetSwimPivot());
else
PlayAnimPivot('CowerEnd');

PlayCowering


// ClientMessage("PlayCowering()");
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,,GetSwimPivot());
else
LoopAnimPivot('CowerStill');

PlayCrawling


// ClientMessage("PlayCrawling()");
LoopAnimPivot('CrouchWalk');

PlayCriticalDamageSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (Enemy == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_CriticalDamage);

PlayCrouchShoot


if (Region.Zone.bWaterZone)
PlayAnimPivot('TreadShoot', , 0, GetSwimPivot());
else
PlayAnimPivot('CrouchShoot', , 0);

PlayDancing


// ClientMessage("PlayDancing()");
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread', , 0.3, , GetSwimPivot());
else
LoopAnimPivot('Dance', FRand()*0.2+0.9, 0.3);

PlayDeathHit (float Damage, vector HitLocation, name damageType, vector Momentum)


log("ERROR - PlayDeathHit should not be called!");

PlayDuck


// ClientMessage("PlayDuck()");
TweenAnimPivot('CrouchWalk', 0.25);
// PlayAnimPivot('Crouch');

PlayDying (name damageType, vector hitLoc)


local Vector X, Y, Z;
local float dotp;


// ClientMessage("PlayDying()");
if (Region.Zone.bWaterZone)
PlayAnimPivot('WaterDeath',, 0.1);
else if (bSitting) // if sitting, always fall forward
PlayAnimPivot('DeathFront',, 0.1);
else
{
GetAxes(Rotation, X, Y, Z);
dotp = (Location - HitLoc) dot X;

// die from the correct side
if (dotp < 0.0) // shot from the front, fall back
PlayAnimPivot('DeathBack',, 0.1);
else // shot from the back, fall front
PlayAnimPivot('DeathFront',, 0.1);
}

// don't scream if we are stunned
if ((damageType == 'Stunned') || (damageType == 'KnockedOut') ||
(damageType == 'Poison') || (damageType == 'PoisonEffect'))
{
bStunned = True;
if (bIsFemale)
PlaySound(Sound'FemaleUnconscious', SLOT_Pain,,,, RandomPitch());
else
PlaySound(Sound'MaleUnconscious', SLOT_Pain,,,, RandomPitch());
}
else
{
bStunned = False;
PlayDyingSound();
}

PlayDyingSound


SetDistressTimer();
PlaySound(Die, SLOT_Pain,,,, RandomPitch());
AISendEvent('LoudNoise', EAITYPE_Audio);
if (bEmitDistress)
AISendEvent('Distress', EAITYPE_Audio);

PlayFalling


// ClientMessage("PlayFalling()");
PlayAnimPivot('Jump', 3, 0.1);

PlayFiring


local DeusExWeapon W;


// ClientMessage("PlayFiring()");

W = DeusExWeapon(Weapon);

if (W != None)
{
if (W.bHandToHand)
{
PlayAnimPivot('Attack',,0.1);
}
else
{
if (W.bAutomatic)
{
if (HasTwoHandedWeapon())
LoopAnimPivot('Shoot2H',,0.1);
else
LoopAnimPivot('Shoot',,0.1);
}
else
{
if (HasTwoHandedWeapon())
PlayAnimPivot('Shoot2H',,0.1);
else
PlayAnimPivot('Shoot',,0.1);
}
}
}

PlayFootStep


local Sound stepSound;
local float rnd;
local name mat;
local float speedFactor, massFactor;
local float volume, pitch, range;
local float radius, maxRadius;
local float volumeMultiplier;
local DeusExPlayer dxPlayer;
local float shakeRadius, shakeMagnitude;
local float playerDist;



rnd = FRand();
mat = GetFloorMaterial();

volumeMultiplier = 1.0;
if (WalkSound == None)
{
if (FootRegion.Zone.bWaterZone)
{
if (rnd < 0.33)
stepSound = Sound'WaterStep1';
else if (rnd < 0.66)
stepSound = Sound'WaterStep2';
else
stepSound = Sound'WaterStep3';
}
else
{
switch(mat)
{
case 'Textile':
case 'Paper':
volumeMultiplier = 0.7;
if (rnd < 0.25)
stepSound = Sound'CarpetStep1';
else if (rnd < 0.5)
stepSound = Sound'CarpetStep2';
else if (rnd < 0.75)
stepSound = Sound'CarpetStep3';
else
stepSound = Sound'CarpetStep4';
break;

case 'Foliage':
case 'Earth':
volumeMultiplier = 0.6;
if (rnd < 0.25)
stepSound = Sound'GrassStep1';
else if (rnd < 0.5)
stepSound = Sound'GrassStep2';
else if (rnd < 0.75)
stepSound = Sound'GrassStep3';
else
stepSound = Sound'GrassStep4';
break;

case 'Metal':
case 'Ladder':
volumeMultiplier = 1.0;
if (rnd < 0.25)
stepSound = Sound'MetalStep1';
else if (rnd < 0.5)
stepSound = Sound'MetalStep2';
else if (rnd < 0.75)
stepSound = Sound'MetalStep3';
else
stepSound = Sound'MetalStep4';
break;

case 'Ceramic':
case 'Glass':
case 'Tiles':
volumeMultiplier = 0.7;
if (rnd < 0.25)
stepSound = Sound'TileStep1';
else if (rnd < 0.5)
stepSound = Sound'TileStep2';
else if (rnd < 0.75)
stepSound = Sound'TileStep3';
else
stepSound = Sound'TileStep4';
break;

case 'Wood':
volumeMultiplier = 0.7;
if (rnd < 0.25)
stepSound = Sound'WoodStep1';
else if (rnd < 0.5)
stepSound = Sound'WoodStep2';
else if (rnd < 0.75)
stepSound = Sound'WoodStep3';
else
stepSound = Sound'WoodStep4';
break;

case 'Brick':
case 'Concrete':
case 'Stone':
case 'Stucco':
default:
volumeMultiplier = 0.7;
if (rnd < 0.25)
stepSound = Sound'StoneStep1';
else if (rnd < 0.5)
stepSound = Sound'StoneStep2';
else if (rnd < 0.75)
stepSound = Sound'StoneStep3';
else
stepSound = Sound'StoneStep4';
break;
}
}
}
else
stepSound = WalkSound;

// compute sound volume, range and pitch, based on mass and speed
speedFactor = VSize(Velocity)/120.0;
massFactor = Mass/150.0;
radius = 768.0;
maxRadius = 2048.0;
// volume = (speedFactor+0.2)*massFactor;
// volume = (speedFactor+0.7)*massFactor;
volume = massFactor*1.5;
range = radius * volume;
pitch = (volume+0.5);
volume = 1.0;
range = FClamp(range, 0.01, maxRadius);
pitch = FClamp(pitch, 1.0, 1.5);

// play the sound and send an AI event
PlaySound(stepSound, SLOT_Interact, volume, , range, pitch);
AISendEvent('LoudNoise', EAITYPE_Audio, volume*volumeMultiplier, range*volumeMultiplier);

// Shake the camera when heavy things tread
if (Mass > 400)
{
dxPlayer = DeusExPlayer(GetPlayerPawn());
if (dxPlayer != None)
{
playerDist = DistanceFromPlayer;
shakeRadius = FClamp((Mass-400)/600, 0, 1.0) * (range*0.5);
shakeMagnitude = FClamp((Mass-400)/1600, 0, 1.0);
shakeMagnitude = FClamp(1.0-(playerDist/shakeRadius), 0, 1.0) * shakeMagnitude;
if (shakeMagnitude > 0)
dxPlayer.JoltView(shakeMagnitude);
}
}

PlayFutzSound


local DeusExPlayer dxPlayer;
local Name conName;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if (dxPlayer != None)
{
if (dxPlayer.barkManager != None)
{
conName = dxPlayer.barkManager.BuildBarkName(self, BM_Futz);
dxPlayer.StartConversationByName(conName, self, !bInterruptState);
}
// dxPlayer.StartAIBarkConversation(self, BM_Futz);
}

PlayGoingForAlarmSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (Enemy == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_GoingForAlarm);

PlayHit (float Damage, vector HitLocation, name damageType, vector Momentum)


log("ERROR - PlayHit should not be called!");

PlayHitAnim (vector HitLocation, float Damage)


log("ERROR - PlayHitAnim should not be called!");

PlayIdle


// ClientMessage("PlayIdle()");
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread', , 0.3, , GetSwimPivot());
else
{
if (HasTwoHandedWeapon())
PlayAnimPivot('Idle12H', , 0.3);
else
PlayAnimPivot('Idle1', , 0.3);
}

PlayIdleSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if (dxPlayer != None)
dxPlayer.StartAIBarkConversation(self, BM_Idle);

PlayLanded (float impactVel)


// ClientMessage("PlayLanded()");
bIsWalking = True;
if (impactVel < -12*CollisionHeight)
PlayAnimPivot('Land');

PlayNewTargetSound


// someday...

PlayOnFireSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if (dxPlayer != None)
dxPlayer.StartAIBarkConversation(self, BM_OnFire);

PlayOutOfAmmoSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if (dxPlayer != None)
dxPlayer.StartAIBarkConversation(self, BM_OutOfAmmo);

PlayPanicRunning


// ClientMessage("PlayPanicRunning()");
bIsWalking = False;
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,,GetSwimPivot());
else
LoopAnimPivot('Panic', runAnimMult);

PlayPostAttackSearchingSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (SeekPawn == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_PostAttackSearching);

PlayPreAttackSearchingSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (SeekPawn == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_PreAttackSearching);

PlayPreAttackSightingSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (SeekPawn == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_PreAttackSighting);

PlayPushing


// ClientMessage("PlayPushing()");
PlayAnimPivot('PushButton', , 0.15);

PlayReload


LoopAnimPivot('Reload',,0.2);

PlayReloadBegin


PlayAnimPivot('ReloadBegin',, 0.1);

PlayReloadEnd


PlayAnimPivot('ReloadEnd',, 0.1);

PlayRising


// ClientMessage("PlayRising()");
PlayAnimPivot('Stand');

PlayRubbingEyes


// ClientMessage("PlayRubbingEyes()");
LoopAnimPivot('RubEyes');

PlayRubbingEyesEnd


// ClientMessage("PlayRubbingEyesEnd()");
PlayAnimPivot('RubEyesStop');

PlayRubbingEyesStart


// ClientMessage("PlayRubbingEyesStart()");
PlayAnimPivot('RubEyesStart', , 0.15);

PlayRunning


// ClientMessage("PlayRunning()");
bIsWalking = False;
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',,,,GetSwimPivot());
else
{
if (HasTwoHandedWeapon())
LoopAnimPivot('RunShoot2H', runAnimMult);
else
LoopAnimPivot('Run', runAnimMult);
}

PlayRunningAndFiring


local DeusExWeapon W;
local vector v1, v2;
local float dotp;


bIsWalking = FALSE;

W = DeusExWeapon(Weapon);

if (W != None)
{
if (Region.Zone.bWaterZone)
{
if (W.bHandToHand)
LoopAnimPivot('Tread',,0.1,,GetSwimPivot());
else
LoopAnimPivot('TreadShoot',,0.1,,GetSwimPivot());
}
else
{
if (W.bHandToHand)
LoopAnimPivot('Run',runAnimMult,0.1);
else
{
v1 = Normal((Enemy.Location - Location)*vect(1,1,0));
if (destPoint != None)
v2 = Normal((destPoint.Location - Location)*vect(1,1,0));
else
v2 = Normal((destLoc - Location)*vect(1,1,0));
dotp = Abs(v1 dot v2);
if (dotp < 0.70710678) // running sideways
{
if (HasTwoHandedWeapon())
LoopAnimPivot('Strafe2H',runAnimMult,0.1);
else
LoopAnimPivot('Strafe',runAnimMult,0.1);
}
else
{
if (HasTwoHandedWeapon())
LoopAnimPivot('RunShoot2H',runAnimMult,0.1);
else
LoopAnimPivot('RunShoot',runAnimMult,0.1);
}
}
}
}

PlayScanningSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if (dxPlayer != None)
dxPlayer.StartAIBarkConversation(self, BM_Scanning);

PlaySearchGiveUpSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (SeekPawn == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_SearchGiveUp);

PlayShoot


if (Region.Zone.bWaterZone)
PlayAnimPivot('TreadShoot', , 0, GetSwimPivot());
else
{
if (HasTwoHandedWeapon())
PlayAnimPivot('Shoot2H', , 0);
else
PlayAnimPivot('Shoot', , 0);
}

PlaySitting


// ClientMessage("PlaySitting()");
LoopAnimPivot('SitBreathe', , 0.15);

PlaySittingDown


// ClientMessage("PlaySittingDown()");
PlayAnimPivot('SitBegin', , 0.15);

PlayStandingUp


// ClientMessage("PlayStandingUp()");
PlayAnimPivot('SitStand', , 0.15);

PlayStunned


// ClientMessage("PlayStunned()");
LoopAnimPivot('Shocked');

PlaySurpriseSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (Enemy == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_Surprise);

PlaySwimming


// ClientMessage("PlaySwimming()");
LoopAnimPivot('Tread', , , , GetSwimPivot());

PlayTakeHitSound (int Damage, name damageType, int Mult)


local Sound hitSound;
local float volume;


if (Level.TimeSeconds - LastPainSound < 0.25)
return;
if (Damage <= 0)
return;

LastPainSound = Level.TimeSeconds;

if (Damage <= 30)
hitSound = HitSound1;
else
hitSound = HitSound2;
volume = FMax(Mult*TransientSoundVolume, Mult*2.0);

SetDistressTimer();
PlaySound(hitSound, SLOT_Pain, volume,,, RandomPitch());
if ((hitSound != None) && bEmitDistress)
AISendEvent('Distress', EAITYPE_Audio, volume);

PlayTakingHit (EHitLocation hitPos)


local vector pivot;
local name animName;


animName = '';
if (!Region.Zone.bWaterZone)
{
switch (hitPos)
{
case HITLOC_HeadFront:
animName = 'HitHead';
break;
case HITLOC_TorsoFront:
animName = 'HitTorso';
break;
case HITLOC_LeftArmFront:
animName = 'HitArmLeft';
break;
case HITLOC_RightArmFront:
animName = 'HitArmRight';
break;

case HITLOC_HeadBack:
animName = 'HitHeadBack';
break;
case HITLOC_TorsoBack:
case HITLOC_LeftArmBack:
case HITLOC_RightArmBack:
animName = 'HitTorsoBack';
break;

case HITLOC_LeftLegFront:
case HITLOC_LeftLegBack:
animName = 'HitLegLeft';
break;

case HITLOC_RightLegFront:
case HITLOC_RightLegBack:
animName = 'HitLegRight';
break;
}
pivot = vect(0,0,0);
}
else
{
switch (hitPos)
{
case HITLOC_HeadFront:
case HITLOC_TorsoFront:
case HITLOC_LeftLegFront:
case HITLOC_RightLegFront:
case HITLOC_LeftArmFront:
case HITLOC_RightArmFront:
animName = 'WaterHitTorso';
break;

case HITLOC_HeadBack:
case HITLOC_TorsoBack:
case HITLOC_LeftLegBack:
case HITLOC_RightLegBack:
case HITLOC_LeftArmBack:
case HITLOC_RightArmBack:
animName = 'WaterHitTorsoBack';
break;
}
pivot = GetSwimPivot();
}

if (animName != '')
PlayAnimPivot(animName, , 0.1, pivot);


PlayTargetAcquiredSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (Enemy == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_TargetAcquired);

PlayTargetLostSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if ((dxPlayer != None) && (SeekPawn == dxPlayer))
dxPlayer.StartAIBarkConversation(self, BM_TargetLost);

PlayTearGasSound


local DeusExPlayer dxPlayer;


dxPlayer = DeusExPlayer(GetPlayerPawn());
if (dxPlayer != None)
dxPlayer.StartAIBarkConversation(self, BM_TearGas);

PlayTurnHead (ELookDirection newLookDir, float rate, float tweentime) -> bool


if (bCanTurnHead)
{
if (Super.PlayTurnHead(newLookDir, rate, tweentime))
{
AIAddViewRotation = rot(0,0,0); // default
switch (newLookDir)
{
case LOOK_Left:
AIAddViewRotation = rot(0,-5461,0); // 30 degrees left
break;
case LOOK_Right:
AIAddViewRotation = rot(0,5461,0); // 30 degrees right
break;
case LOOK_Up:
AIAddViewRotation = rot(5461,0,0); // 30 degrees up
break;
case LOOK_Down:
AIAddViewRotation = rot(-5461,0,0); // 30 degrees down
break;

case LOOK_Forward:
AIAddViewRotation = rot(0,0,0); // 0 degrees
break;
}
}
else
return false;
}
else
return false;

PlayTurning


// ClientMessage("PlayTurning()");
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread', , , , GetSwimPivot());
else
{
if (HasTwoHandedWeapon())
TweenAnimPivot('Walk2H', 0.1);
else
TweenAnimPivot('Walk', 0.1);
}

PlayWaiting


// ClientMessage("PlayWaiting()");
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread', , 0.3, , GetSwimPivot());
else
{
if (HasTwoHandedWeapon())
LoopAnimPivot('BreatheLight2H', , 0.3);
else
LoopAnimPivot('BreatheLight', , 0.3);
}

PlayWalking


// ClientMessage("PlayWalking()");
bIsWalking = True;
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread', , 0.15, , GetSwimPivot());
else
{
if (HasTwoHandedWeapon())
LoopAnimPivot('Walk2H',walkAnimMult, 0.15);
else
LoopAnimPivot('Walk',walkAnimMult, 0.15);
}

PlayWeaponSwitch (Weapon newWeapon)


// ClientMessage("PlayWeaponSwitch()");

PostBeginPlay


Super.PostBeginPlay();

// Set up pain timer
if (Region.Zone.bPainZone || HeadRegion.Zone.bPainZone ||
FootRegion.Zone.bPainZone)
PainTime = 5.0;
else if (HeadRegion.Zone.bWaterZone)
PainTime = UnderWaterTime;

// Handle holograms
if ((Style != STY_Masked) && (Style != STY_Normal))
{
SetSkinStyle(Style, None);
SetCollision(false, false, false);
KillShadow();
bHasShadow = False;
}

PostPostBeginPlay


Super.PostPostBeginPlay();

// Bind any conversation events to this ScriptedPawn
ConBindEvents();

PreBeginPlay


local float saveBaseEyeHeight;


// TODO:
//
// Okay, we need to save the base eye height right now becase it's
// obliterated in Pawn.uc with the following:
//
// EyeHeight = 0.8 * CollisionHeight; //FIXME - if all baseeyeheights set right, use them
// BaseEyeHeight = EyeHeight;
//
// This must be fixed after ECTS.

saveBaseEyeHeight = BaseEyeHeight;

Super.PreBeginPlay();

BaseEyeHeight = saveBaseEyeHeight;

// create our shadow
CreateShadow();

// Set our alliance
SetAlliance(Alliance);

// Set up callbacks
UpdateReactionCallbacks();

PreSetMovement


// Copied from Pawn.uc and overridden so Pawn doesn't erase our walking/swimming/flying physics
if (JumpZ > 0)
bCanJump = true;
// No, no, no!!!
/*
bCanWalk = true;
bCanSwim = false;
bCanFly = false;
MinHitWall = -0.6;
if (Intelligence > BRAINS_Reptile)
bCanOpenDoors = true;
if (Intelligence == BRAINS_Human)
bCanDoSpecial = true;
*/

PutInWorld (bool bEnter)


if (bInWorld && !bEnter)
{
bInWorld = false;
GotoState('Idle');
bHidden = true;
bDetectable = false;
WorldPosition = Location;
bWorldCollideActors = bCollideActors;
bWorldBlockActors = bBlockActors;
bWorldBlockPlayers = bBlockPlayers;
SetCollision(false, false, false);
bCollideWorld = false;
SetPhysics(PHYS_None);
KillShadow();
SetLocation(Location+vect(0,0,20000)); // move it out of the way
}
else if (!bInWorld && bEnter)
{
bInWorld = true;
bHidden = Default.bHidden;
bDetectable = Default.bDetectable;
SetLocation(WorldPosition);
SetCollision(bWorldCollideActors, bWorldBlockActors, bWorldBlockPlayers);
bCollideWorld = Default.bCollideWorld;
SetMovementPhysics();
CreateShadow();
FollowOrders();
}

RandomPitch -> float


return (1.1 - 0.2*FRand());

ReactToFutz


if (bLookingForFutz && bReactFutz && (FutzTimer <= 0) && !bDistressed)
{
FutzTimer = 2.0;
PlayFutzSound();
}

ReactToInjury (Pawn instigatedBy, Name damageType, EHitLocation hitPos)


if ((damageType != 'TearGas') && (damageType != 'HalonGas') && (damageType != 'Stunned'))
Global.ReactToInjury(instigatedBy, damageType, hitPos);

ReactToProjectiles (Actor projectileActor)


local DeusExProjectile dxProjectile;
local Pawn instigator;


if ((bFearProjectiles || bReactProjectiles) && bLookingForProjectiles)
{
dxProjectile = DeusExProjectile(projectileActor);
if ((dxProjectile == None) || IsProjectileDangerous(dxProjectile))
{
instigator = Pawn(projectileActor);
if (instigator == None)
instigator = projectileActor.Instigator;
if (instigator != None)
{
if (bFearProjectiles)
IncreaseFear(instigator, 2.0);
if (SetEnemy(instigator))
{
SetDistressTimer();
HandleEnemy();
}
else if (bFearProjectiles && IsFearful())
{
SetDistressTimer();
SetEnemy(instigator, , true);
GotoState('Fleeing');
}
else if (bAvoidHarm)
SetState('AvoidingProjectiles');
}
}
}

ReadyForNewEnemy -> bool


if ((Enemy == None) || (EnemyTimer > 5.0))
return True;
else
return False;

ReadyForWeapon -> bool


local bool bReady;


bReady = false;
if (DeusExWeapon(weapon) != None)
{
if (DeusExWeapon(weapon).bReadyToFire)
if (!IsWeaponReloading())
bReady = true;
}
if (!bReady)
if (enemy == None)
bReady = true;
if (!bReady)
if (!AICanShoot(enemy, true, false, 0.025))
bReady = true;

return (bReady);

Reloading (DeusExWeapon reloadWeapon, float reloadTime)


Global.Reloading(reloadWeapon, reloadTime);
if (bReadyToReload)
if (IsWeaponReloading())
if (!IsHandToHand())
TweenToShoot(0);

ResetBasedPawnSize


SetBasedPawnSize(Default.CollisionRadius, GetDefaultCollisionHeight());

ResetConvOrders


ConvOrders = '';
ConvOrderTag = '';

ResetDestLoc


DestAttempts = 0;
LastDestLoc = vect(9999,9999,9999); // hack
LastDestPoint = LastDestLoc;

ResetReactions


SetReactions(true, true, true, true, true, true, true, true, true, true, true, true);

ResetSkinStyle


local int i;


for (i=0; i<8; i++)
MultiSkins[i] = Default.MultiSkins[i];
Skin = Default.Skin;
ScaleGlow = Default.ScaleGlow;
Style = Default.Style;

SeePlayer (Actor SeenPlayer)


// Do nothing

SetAlliance (Name newAlliance)


Alliance = newAlliance;

SetAttackAngle


local bool bCanShoot;


bCanShoot = false;
if (Enemy != None)
if (AICanShoot(Enemy, true, false, 0.025))
bCanShoot = true;

if (!bCanShoot)
ViewRotation = Rotation;

SetBasedPawnSize (float newRadius, float newHeight) -> bool


local float oldRadius, oldHeight;
local bool bSuccess;
local vector centerDelta;
local float deltaEyeHeight;


if (newRadius < 0)
newRadius = 0;
if (newHeight < 0)
newHeight = 0;

oldRadius = CollisionRadius;
oldHeight = CollisionHeight;

if ((oldRadius == newRadius) && (oldHeight == newHeight))
return true;

centerDelta = vect(0, 0, 1)*(newHeight-oldHeight);
deltaEyeHeight = GetDefaultCollisionHeight() - Default.BaseEyeHeight;

bSuccess = false;
if ((newHeight <= CollisionHeight) && (newRadius <= CollisionRadius)) // shrink
{
SetCollisionSize(newRadius, newHeight);
if (Move(centerDelta))
bSuccess = true;
else
SetCollisionSize(oldRadius, oldHeight);
}
else
{
if (Move(centerDelta))
{
SetCollisionSize(newRadius, newHeight);
bSuccess = true;
}
}

if (bSuccess)
{
PrePivotOffset = vect(0, 0, 1)*(GetDefaultCollisionHeight()-newHeight);
PrePivot -= centerDelta;
DesiredPrePivot -= centerDelta;
BaseEyeHeight = newHeight - deltaEyeHeight;
}

return (bSuccess);

SetDistress (bool bDistress)


bDistressed = bDistress;
if (bDistress && bEmitDistress)
AIStartEvent('Distress', EAITYPE_Visual);
else
AIEndEvent('Distress', EAITYPE_Visual);

SetDistressTimer


DistressTimer = 0;

SetFall


if (!bUpAndOut)
GotoState('FallingState');

SetHomeBase (vector baseLocation, optional rotator baseRotator, optional float baseExtent)


local vector vectRot;


if (baseExtent == 0)
baseExtent = 800;

HomeTag = '';
HomeActor = None;
HomeLoc = baseLocation;
HomeRot = vector(baseRotator)*100;
HomeExtent = baseExtent;
bUseHome = true;

SetMovementPhysics


// re-implement SetMovementPhysics() in subclass for flying and swimming creatures
if (Physics == PHYS_Falling)
return;

if (Region.Zone.bWaterZone && bCanSwim)
SetPhysics(PHYS_Swimming);
else if (Default.Physics == PHYS_None)
SetPhysics(PHYS_Walking);
else
SetPhysics(Default.Physics);

SetNextState (name newState, optional name newLabel)


if (!bInTransientState || !HasNextState())
{
if ((newState != 'Conversation') && (newState != 'FirstPersonConversation'))
{
NextState = newState;
NextLabel = newLabel;
}
}

SetOrders (Name orderName, optional Name newOrderTag, optional bool bImmediate)


ConvOrders = orderName;
ConvOrderTag = newOrderTag;

SetSeekLocation (Pawn seekCandidate, vector newLocation, ESeekType newSeekType, optional bool bNewPostCombat)


SetEnemy(None, 0, true);
SeekPawn = seekCandidate;
LastSeenPos = newLocation;
bSeekLocation = True;
SeekType = newSeekType;
if (newSeekType == SEEKTYPE_Carcass)
CarcassTimer = 120.0;
if (newSeekType == SEEKTYPE_Sight)
SeekLevel = Max(SeekLevel, 1);
else
SeekLevel = Max(SeekLevel, 3);
if (bNewPostCombat)
bSeekPostCombat = true;

SetSkinStyle (ERenderStyle newStyle, optional texture newTex, optional float newScaleGlow)


local int i;
local texture curSkin;
local texture oldSkin;


if (newScaleGlow == 0)
newScaleGlow = ScaleGlow;

oldSkin = Skin;
for (i=0; i<8; i++)
{
curSkin = GetMeshTexture(i);
MultiSkins[i] = GetStyleTexture(newStyle, curSkin, newTex);
}
Skin = GetStyleTexture(newStyle, Skin, newTex);
ScaleGlow = newScaleGlow;
Style = newStyle;

SetState (Name stateName, optional Name labelName)


if (bInterruptState)
GotoState(stateName, labelName);
else
SetNextState(stateName, labelName);

SetWeapon (Weapon newWeapon)


if (Weapon == newWeapon)
{
if (Weapon != None)
{
if (Weapon.IsInState('DownWeapon'))
Weapon.BringUp();
Weapon.SetDefaultDisplayProperties();
}
if (Inventory != None)
Inventory.ChangedWeapon();
PendingWeapon = None;
return;
}

PlayWeaponSwitch(newWeapon);
if (Weapon != None)
{
Weapon.SetDefaultDisplayProperties();
Weapon.PutDown();
}

Weapon = newWeapon;
if (Inventory != None)
Inventory.ChangedWeapon();
if (Weapon != None)
Weapon.BringUp();

PendingWeapon = None;

SetupWeapon (bool bDrawWeapon, optional bool bForce)


if (bKeepWeaponDrawn && !bForce)
bDrawWeapon = true;

if (ShouldDropWeapon())
DropWeapon();
else if (bDrawWeapon)
{
// if (Weapon == None)
SwitchToBestWeapon();
}
else
SetWeapon(None);

ShieldDamage (Name damageType) -> float


return 1.0;

ShouldBeStartled (Pawn startler) -> bool


return false;

ShouldCrouch -> bool


if (bCanCrouch && !Region.Zone.bWaterZone && !IsHandToHand() &&
((enemy != None) && (VSize(enemy.Location-Location) > 300)) &&
((DeusExWeapon(Weapon) == None) || DeusExWeapon(Weapon).bUseWhileCrouched))
return true;
else
return false;

ShouldDropWeapon -> bool


if (((HealthArmLeft <= 0) || (HealthArmRight <= 0)) && (Health > 0))
return true;
else
return false;

ShouldFlee -> bool


// This may be overridden from subclasses
if (MinHealth > 0)
{
if (Health <= MinHealth)
return true;
else if (HealthArmLeft <= 0)
return true;
else if (HealthArmRight <= 0)
return true;
else if (HealthLegLeft <= 0)
return true;
else if (HealthLegRight <= 0)
return true;
else
return false;
}
else
return false;

ShouldPlayTurn (vector lookdir) -> bool


local Rotator rot;


rot = Rotator(lookdir);
rot.Yaw = (rot.Yaw - Rotation.Yaw) & 65535;
if (rot.Yaw > 32767)
rot.Yaw = 65536 - rot.Yaw; // negate
if (rot.Yaw > 4096)
return true;
else
return false;

ShouldPlayWalk (vector movedir) -> bool


local vector diff;


if (Physics == PHYS_Falling)
return true;
else if (Physics == PHYS_Walking)
{
diff = (movedir - Location) * vect(1,1,0);
if (VSize(diff) < 16)
return false;
else
return true;
}
else if (VSize(movedir-Location) < 16)
return false;
else
return true;

ShouldStrafe -> bool


// This may be overridden from subclasses
//return (AICanSee(enemy, 1.0, false, true, true, true) > 0);
return (AICanShoot(enemy, false, false, 0.025, true));

SitPosition (Seat seatActor, int slot) -> Vector


local float newAssHeight;


newAssHeight = GetDefaultCollisionHeight() + BaseAssHeight;
newAssHeight = -(CollisionHeight - newAssHeight);

return ((seatActor.sitPoint[slot]>>seatActor.Rotation)+seatActor.Location+(vect(0,0,-1)*newAssHeight));

SpawnCarcass -> Carcass


local DeusExCarcass carc;
local vector loc;
local Inventory item, nextItem;
local FleshFragment chunk;
local int i;
local float size;


// if we really got blown up good, gib us and don't display a carcass
if ((Health < -100) && !IsA('Robot'))
{
size = (CollisionRadius + CollisionHeight) / 2;
if (size > 10.0)
{
for (i=0; i {
loc.X = (1-2*FRand()) * CollisionRadius;
loc.Y = (1-2*FRand()) * CollisionRadius;
loc.Z = (1-2*FRand()) * CollisionHeight;
loc += Location;
chunk = spawn(class'FleshFragment', None,, loc);
if (chunk != None)
{
chunk.DrawScale = size / 25;
chunk.SetCollisionSize(chunk.CollisionRadius / chunk.DrawScale, chunk.CollisionHeight / chunk.DrawScale);
chunk.bFixedRotationDir = True;
chunk.RotationRate = RotRand(False);
}
}
}

return None;
}

// spawn the carcass
carc = DeusExCarcass(Spawn(CarcassType));

if ( carc != None )
{
if (bStunned)
carc.bNotDead = True;

carc.Initfor(self);

// move it down to the floor
loc = Location;
loc.z -= Default.CollisionHeight;
loc.z += carc.Default.CollisionHeight;
carc.SetLocation(loc);
carc.Velocity = Velocity;
carc.Acceleration = Acceleration;

// give the carcass the pawn's inventory if we aren't an animal or robot
if (!IsA('Animal') && !IsA('Robot'))
{
if (Inventory != None)
{
do
{
item = Inventory;
nextItem = item.Inventory;
DeleteInventory(item);
if ((DeusExWeapon(item) != None) && (DeusExWeapon(item).bNativeAttack))
item.Destroy();
else
carc.AddInventory(item);
item = nextItem;
}
until (item == None);
}
}
}

return carc;

SpurtBlood


local vector bloodVector;


bloodVector = vect(0,0,1)*CollisionHeight*0.5; // so folks don't bleed from the crotch
spawn(Class'BloodDrop',,,bloodVector+Location);

StandUp (optional bool bInstant)


local vector placeToStand;


if (bSitting)
{
bSitInterpolation = false;
bSitting = false;

EnableCollision(true);
SetBase(None);
SetPhysics(PHYS_Falling);
ResetBasedPawnSize();

if (!bInstant && (SeatActor != None) && IsOverlapping(SeatActor))
{
bStandInterpolation = true;
remainingStandTime = 0.3;
StandRate = (Vector(SeatActor.Rotation+Rot(0, -16384, 0))*CollisionRadius) /
remainingStandTime;
}
else
StopStanding();
}

if (SeatActor != None)
{
if (SeatActor.sittingActor[seatSlot] == self)
SeatActor.sittingActor[seatSlot] = None;
SeatActor = None;
}

if (bDancing)
bDancing = false;

StartCrouch


if (!bCrouching)
{
bCrouching = true;
SetBasedPawnSize(CollisionRadius, GetCrouchHeight());
CrouchTimer = 1.0+FRand()*0.5;
}

StartFalling (Name resumeState, optional Name resumeLabel)


SetNextState(resumeState, resumeLabel);
GotoState('FallingState');

StartPoison (int Damage, Pawn newPoisoner)


if ((Health <= 0) || bDeleteMe) // no more pain -- you're already dead!
return;

poisonCounter = 8; // take damage no more than eight times (over 16 seconds)
poisonTimer = 0; // reset pain timer
Poisoner = newPoisoner;
if (poisonDamage < Damage) // set damage amount
poisonDamage = Damage;

StopBlendAnims


AIAddViewRotation = rot(0, 0, 0);
Super.StopBlendAnims();
PlayTurnHead(LOOK_Forward, 1.0, 1.0);

StopPoison


poisonCounter = 0;
poisonTimer = 0;
poisonDamage = 0;
Poisoner = None;

StopStanding


if (bStandInterpolation)
{
bStandInterpolation = false;
remainingStandTime = 0;
if (Physics == PHYS_Flying)
SetPhysics(PHYS_Falling);
}


StopWaiting


GotoState('OpeningDoor', 'DoorOpened');

SupportActor (Actor standingActor)


local vector newVelocity;
local float angle;
local float zVelocity;
local float baseMass;
local float standingMass;
local vector damagePoint;
local float damage;


standingMass = FMax(1, standingActor.Mass);
baseMass = FMax(1, Mass);
if ((Physics == PHYS_Swimming) && Region.Zone.bWaterZone)
{
newVelocity = standingActor.Velocity;
newVelocity *= 0.5*standingMass/baseMass;
AddVelocity(newVelocity);
}
else
{
zVelocity = standingActor.Velocity.Z;
damagePoint = Location + vect(0,0,1)*(CollisionHeight-1);
damage = (1 - (standingMass/baseMass) * (zVelocity/100));

// Have we been stomped?
if ((zVelocity*standingMass < -7500) && (damage > 0) && WillTakeStompDamage(standingActor))
TakeDamage(damage, standingActor.Instigator, damagePoint, 0.2*standingActor.Velocity, 'stomped');
}

// Bounce the actor off the pawn
angle = FRand()*Pi*2;
newVelocity.X = cos(angle);
newVelocity.Y = sin(angle);
newVelocity.Z = 0;
newVelocity *= FRand()*25 + 25;
newVelocity += standingActor.Velocity;
newVelocity.Z = 50;
standingActor.Velocity = newVelocity;
standingActor.SetPhysics(PHYS_Falling);

SwitchToBestWeapon -> bool


local Inventory inv;
local DeusExWeapon curWeapon;
local float score;
local DeusExWeapon dxWeapon;
local DeusExWeapon bestWeapon;
local float bestScore;
local int fallbackLevel;
local int curFallbackLevel;
local bool bBlockSpecial;
local bool bValid;
local bool bWinner;
local float minRange, accRange;
local float range, centerRange;
local float cutoffRange;
local float enemyRange;
local float minEnemy, accEnemy, maxEnemy;
local ScriptedPawn enemyPawn;
local Robot enemyRobot;
local DeusExPlayer enemyPlayer;
local float enemyRadius;
local bool bEnemySet;
local int loopCount, i; // hack - check for infinite inventory
local Inventory loopInv; // hack - check for infinite inventory


if (ShouldDropWeapon())
{
DropWeapon();
return false;
}

bBlockSpecial = false;
dxWeapon = DeusExWeapon(Weapon);
if (dxWeapon != None)
{
if (dxWeapon.AITimeLimit > 0)
{
if (SpecialTimer <= 0)
{
bBlockSpecial = true;
FireTimer = dxWeapon.AIFireDelay;
}
}
}

bestWeapon = None;
bestScore = 0;
fallbackLevel = 0;
inv = Inventory;

bEnemySet = false;
minEnemy = 0;
accEnemy = 0;
enemyRange = 400; // default
enemyRadius = 0;
enemyPawn = None;
enemyRobot = None;
if (Enemy != None)
{
bEnemySet = true;
enemyRange = VSize(Enemy.Location - Location);
enemyRadius = Enemy.CollisionRadius;
if (DeusExWeapon(Enemy.Weapon) != None)
DeusExWeapon(Enemy.Weapon).GetWeaponRanges(minEnemy, accEnemy, maxEnemy);
enemyPawn = ScriptedPawn(Enemy);
enemyRobot = Robot(Enemy);
enemyPlayer = DeusExPlayer(Enemy);
}

loopCount = 0;
while (inv != None)
{
// THIS IS A MAJOR HACK!!!
loopCount++;
if (loopCount == 9999)
{
log("********** RUNAWAY LOOP IN SWITCHTOBESTWEAPON ("$self$") **********");
loopInv = Inventory;
i = 0;
while (loopInv != None)
{
i++;
if (i > 300)
break;
log(" Inventory "$i$" - "$loopInv);
loopInv = loopInv.Inventory;
}
}

curWeapon = DeusExWeapon(inv);
if (curWeapon != None)
{
bValid = true;
if (curWeapon.ReloadCount > 0)
{
if (curWeapon.AmmoType == None)
bValid = false;
else if (curWeapon.AmmoType.AmmoAmount < 1)
bValid = false;
}

// Ensure we can actually use this weapon here
if (bValid)
{
// lifted from DeusExWeapon...
if ((curWeapon.EnviroEffective == ENVEFF_Air) || (curWeapon.EnviroEffective == ENVEFF_Vacuum) ||
(curWeapon.EnviroEffective == ENVEFF_AirVacuum))
if (curWeapon.Region.Zone.bWaterZone)
bValid = false;
}

if (bValid)
{
GetWeaponBestRange(curWeapon, minRange, accRange);
cutoffRange = minRange+(CollisionRadius+enemyRadius);
range = (accRange - minRange) * 0.5;
centerRange = minRange + range;
if (range < 50)
range = 50;
if (enemyRange < centerRange)
score = (centerRange - enemyRange)/range;
else
score = (enemyRange - centerRange)/range;
if ((minRange >= minEnemy) && (accRange <= accEnemy))
score += 0.5; // arbitrary
if ((cutoffRange >= enemyRange-CollisionRadius) && (cutoffRange >= 256)) // do not use long-range weapons on short-range targets
score += 10000;

curFallbackLevel = 3;
if (curWeapon.bFallbackWeapon && !bUseFallbackWeapons)
curFallbackLevel = 2;
if (!bEnemySet && !curWeapon.bUseAsDrawnWeapon)
curFallbackLevel = 1;
if ((curWeapon.AIFireDelay > 0) && (FireTimer > 0))
curFallbackLevel = 0;
if (bBlockSpecial && (curWeapon.AITimeLimit > 0) && (SpecialTimer <= 0))
curFallbackLevel = 0;

// Adjust score based on opponent and damage type.
// All damage types are listed here, even the ones that aren't used by weapons... :)
// (hacky...)

switch (curWeapon.WeaponDamageType())
{
case 'Exploded':
// Massive explosions are always good
score -= 0.2;
break;

case 'Stunned':
if (enemyPawn != None)
{
if (enemyPawn.bStunned)
score += 1000;
else
score -= 1.5;
}
if (enemyPlayer != None)
score += 10;
break;

case 'TearGas':
if (enemyPawn != None)
{
if (enemyPawn.bStunned)
//score += 1000;
bValid = false;
else
score -= 5.0;
}
if (enemyRobot != None)
//score += 10000;
bValid = false;
break;

case 'HalonGas':
if (enemyPawn != None)
{
if (enemyPawn.bStunned)
//score += 1000;
bValid = false;
else if (enemyPawn.bOnFire)
//score += 10000;
bValid = false;
else
score -= 3.0;
}
if (enemyRobot != None)
//score += 10000;
bValid = false;
break;

case 'PoisonGas':
case 'Poison':
case 'PoisonEffect':
case 'Radiation':
if (enemyRobot != None)
//score += 10000;
bValid = false;
break;

case 'Burned':
case 'Flamed':
case 'Shot':
if (enemyRobot != None)
score += 0.5;
break;

case 'Sabot':
if (enemyRobot != None)
score -= 0.5;
break;

case 'EMP':
case 'NanoVirus':
if (enemyRobot != None)
score -= 5.0;
else if (enemyPlayer != None)
score += 5.0;
else
//score += 10000;
bValid = false;
break;

case 'Drowned':
default:
break;
}

// Special case for current weapon
if ((curWeapon == Weapon) && (WeaponTimer < 10.0))
{
// If we last changed weapons less than five seconds ago,
// keep this weapon
if (WeaponTimer < 5.0)
score = -10;

// If between five and ten seconds, use a sliding scale
else
score -= (10.0 - WeaponTimer)/5.0;
}

// Throw a little randomness into the computation...
else
{
score += FRand()*0.1 - 0.05;
if (score < 0)
score = 0;
}

if (bValid)
{
// ugly
if (bestWeapon == None)
bWinner = true;
else if (curFallbackLevel > fallbackLevel)
bWinner = true;
else if (curFallbackLevel < fallbackLevel)
bWinner = false;
else if (bestScore > score)
bWinner = true;
else
bWinner = false;
if (bWinner)
{
bestScore = score;
bestWeapon = curWeapon;
fallbackLevel = curFallbackLevel;
}
}
}
}
inv = inv.Inventory;
}

// If we're changing weapons, reset the weapon timers
if (Weapon != bestWeapon)
{
if (!bEnemySet)
WeaponTimer = 10; // hack
else
WeaponTimer = 0;
if (bestWeapon != None)
if (bestWeapon.AITimeLimit > 0)
SpecialTimer = bestWeapon.AITimeLimit;
ReloadTimer = 0;
}

SetWeapon(bestWeapon);

return false;

TakeDamage (int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)


TakeDamageBase(Damage, instigatedBy, hitlocation, momentum, damageType, true);

TakeHit (EHitLocation hitPos)


if (hitPos != HITLOC_None)
{
PlayTakingHit(hitPos);
GotoState('TakingHit');
}
else
GotoNextState();

Tick (float deltaSeconds)


Global.Tick(deltaSeconds);

if (DeathTimer > 0)
{
DeathTimer -= deltaSeconds;
if ((DeathTimer <= 0) && (Physics == PHYS_Walking))
Acceleration = vect(0,0,0);
}

Timer


UpdateFire();

Touch (actor toucher)


// If we hit the guy we're going to, end the state
if (toucher == OrderActor)
GotoState('RunningTo', 'Done');

// Handle conversations, if need be
Global.Touch(toucher);

Trigger (actor Other, pawn EventInstigator)


// Do nothing

TriggerAlarm


if ((AlarmActor != None) && !AlarmActor.bDeleteMe)
{
if (AlarmActor.hackStrength > 0) // make sure the alarm hasn't been hacked
AlarmActor.Trigger(self, Enemy);
}

TweenToAttack (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
{
if (bUseSecondaryAttack)
TweenAnimPivot('AttackSide', tweentime);
else
TweenAnimPivot('Attack', tweentime);
}

TweenToCrouchShoot (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('TreadShoot', tweentime, GetSwimPivot());
else
TweenAnimPivot('CrouchShoot', tweentime);

TweenToRunning (float tweentime)


// ClientMessage("TweenToRunning()");
bIsWalking = False;
if (Region.Zone.bWaterZone)
LoopAnimPivot('Tread',, tweentime,, GetSwimPivot());
else
{
if (HasTwoHandedWeapon())
LoopAnimPivot('RunShoot2H', runAnimMult, tweentime);
else
LoopAnimPivot('Run', runAnimMult, tweentime);
}

TweenToShoot (float tweentime)


if (Region.Zone.bWaterZone)
TweenAnimPivot('TreadShoot', tweentime, GetSwimPivot());
else if (!bCrouching)
{
if (!IsWeaponReloading())
{
if (HasTwoHandedWeapon())
TweenAnimPivot('Shoot2H', tweentime);
else
TweenAnimPivot('Shoot', tweentime);
}
else
PlayReload();
}

TweenToSwimming (float tweentime)


// ClientMessage("TweenToSwimming()");
TweenAnimPivot('Tread', tweentime, GetSwimPivot());

TweenToWaiting (float tweentime)


// ClientMessage("TweenToWaiting()");
if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
{
if (HasTwoHandedWeapon())
TweenAnimPivot('BreatheLight2H', tweentime);
else
TweenAnimPivot('BreatheLight', tweentime);
}

TweenToWalking (float tweentime)


// ClientMessage("TweenToWalking()");
bIsWalking = True;
if (Region.Zone.bWaterZone)
TweenAnimPivot('Tread', tweentime, GetSwimPivot());
else
{
if (HasTwoHandedWeapon())
TweenAnimPivot('Walk2H', tweentime);
else
TweenAnimPivot('Walk', tweentime);
}

UpdateAgitation (float deltaSeconds)


local float mult;
local float decrement;
local int i;


if (AgitationCheckTimer > 0)
{
AgitationCheckTimer -= deltaSeconds;
if (AgitationCheckTimer < 0)
AgitationCheckTimer = 0;
}

decrement = 0;
if (AgitationTimer > 0)
{
if (AgitationTimer < deltaSeconds)
{
mult = 1.0 - (AgitationTimer/deltaSeconds);
AgitationTimer = 0;
decrement = mult * (AgitationDecayRate*deltaSeconds);
}
else
AgitationTimer -= deltaSeconds;
}
else
decrement = AgitationDecayRate*deltaSeconds;

if (bAlliancesChanged && (decrement > 0))
{
bAlliancesChanged = False;
for (i=15; i>=0; i--)
{
if ((AlliancesEx[i].AllianceName != '') && (!AlliancesEx[i].bPermanent))
{
if (AlliancesEx[i].AgitationLevel > 0)
{
bAlliancesChanged = true;
AlliancesEx[i].AgitationLevel -= decrement;
if (AlliancesEx[i].AgitationLevel < 0)
AlliancesEx[i].AgitationLevel = 0;
}
}
}
}

UpdateFear (float deltaSeconds)


local float mult;
local float decrement;
local int i;


decrement = 0;
if (FearTimer > 0)
{
if (FearTimer < deltaSeconds)
{
mult = 1.0 - (FearTimer/deltaSeconds);
FearTimer = 0;
decrement = mult * (FearDecayRate*deltaSeconds);
}
else
FearTimer -= deltaSeconds;
}
else
decrement = FearDecayRate*deltaSeconds;

if ((decrement > 0) && (FearLevel > 0))
{
FearLevel -= decrement;
if (FearLevel < 0)
FearLevel = 0;
}

UpdateFire


// continually burn and do damage
HealthTorso -= 5;
GenerateTotalHealth();
if (Health <= 0)
{
TakeDamage(10, None, Location, vect(0,0,0), 'Burned');
ExtinguishFire();
}

UpdatePoison (float deltaTime)


if ((Health <= 0) || bDeleteMe) // no more pain -- you're already dead!
return;

if (poisonCounter > 0)
{
poisonTimer += deltaTime;
if (poisonTimer >= 2.0) // pain every two seconds
{
poisonTimer = 0;
poisonCounter--;
TakeDamage(poisonDamage, Poisoner, Location, vect(0,0,0), 'PoisonEffect');
}
if ((poisonCounter <= 0) || (Health <= 0) || bDeleteMe)
StopPoison();
}

UpdateReactionCallbacks


if (bReactFutz && bLookingForFutz)
AISetEventCallback('Futz', 'HandleFutz', , true, true, false, true);
else
AIClearEventCallback('Futz');

if ((bHateHacking || bFearHacking) && bLookingForHacking)
AISetEventCallback('MegaFutz', 'HandleHacking', , true, true, true, true);
else
AIClearEventCallback('MegaFutz');

if ((bHateWeapon || bFearWeapon) && bLookingForWeapon)
AISetEventCallback('WeaponDrawn', 'HandleWeapon', 'WeaponDrawnScore', true, true, false, true);
else
AIClearEventCallback('WeaponDrawn');

if ((bReactShot || bFearShot || bHateShot) && bLookingForShot)
AISetEventCallback('WeaponFire', 'HandleShot', , true, true, false, true);
else
AIClearEventCallback('WeaponFire');

/*
if ((bHateCarcass || bReactCarcass || bFearCarcass) && bLookingForCarcass)
AISetEventCallback('Carcass', 'HandleCarcass', 'CarcassScore', true, true, false, true);
else
AIClearEventCallback('Carcass');
*/

if (bReactLoudNoise && bLookingForLoudNoise)
AISetEventCallback('LoudNoise', 'HandleLoudNoise', 'LoudNoiseScore');
else
AIClearEventCallback('LoudNoise');

if ((bReactAlarm || bFearAlarm) && bLookingForAlarm)
AISetEventCallback('Alarm', 'HandleAlarm');
else
AIClearEventCallback('Alarm');

if ((bHateDistress || bReactDistress || bFearDistress) && bLookingForDistress)
AISetEventCallback('Distress', 'HandleDistress', 'DistressScore', true, true, false, true);
else
AIClearEventCallback('Distress');

if ((bFearProjectiles || bReactProjectiles) && bLookingForProjectiles)
AISetEventCallback('Projectile', 'HandleProjectiles', , false, true, false, true);
else
AIClearEventCallback('Projectile');

UpdateReactionLevel (bool bRise, float deltaSeconds)


local float surpriseTime;


// Handle surprise levels...
if (bRise)
{
if (ReactionLevel < 1.0)
{
surpriseTime = SurprisePeriod;
if (surpriseTime <= 0)
surpriseTime = 0.00000001;
ReactionLevel += deltaSeconds/surpriseTime;
if (ReactionLevel > 1.0)
ReactionLevel = 1.0;
}
}
else
{
if (ReactionLevel > 0.0)
{
surpriseTime = 7.0;
ReactionLevel -= deltaSeconds/surpriseTime;
if (ReactionLevel <= 0.0)
ReactionLevel = 0.0;
}
}

UpdateStanding (float deltaSeconds)


local float delta;
local vector newPos;


if (bStandInterpolation)
{
if ((Physics == PHYS_Walking) && (Acceleration != vect(0,0,0))) // the bastard's walking now
StopStanding();
else
{
if ((deltaSeconds < remainingStandTime) && (remainingStandTime > 0))
{
delta = deltaSeconds;
remainingStandTime -= deltaSeconds;
}
else
{
delta = remainingStandTime;
StopStanding();
}
newPos = StandRate*delta;
Move(newPos);
}
}

WeaponDrawnScore (actor receiver, actor sender, float score) -> float


local Pawn pawnSender;


// Cull events received from enemies
pawnSender = Pawn(sender);
if (pawnSender == None)
pawnSender = Pawn(sender.Owner);
if (pawnSender == None)
pawnSender = sender.Instigator;
if (pawnSender == None)
score = 0;
else if (IsValidEnemy(pawnSender))
score = 0;

return score;

WillTakeStompDamage (Actor stomper) -> bool


return true;

ZoneChange (ZoneInfo newZone)


Global.ZoneChange(newZone);
if (newZone.bWaterZone)
GotoState('FallingState', 'Splash');




ScubaDiver.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.ScubaDiverCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.780000
GroundSpeed=200.000000
UnderWaterTime=-1.000000
Texture=Texture'DeusExCharacters.Skins.ScubasuitTex1'
Mesh=LodMesh'DeusExCharacters.GM_Scubasuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ScubasuitTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ScubasuitTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ScubasuitTex1'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="ScubaDiver"
FamiliarName="Scuba Diver"
UnfamiliarName="Scuba Diver"



ScubaDiverCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Scubasuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Scubasuit_CarcassC'
Texture=Texture'DeusExCharacters.Skins.ScubasuitTex1'
Mesh=LodMesh'DeusExCharacters.GM_Scubasuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ScubasuitTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ScubasuitTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ScubasuitTex1'



Seagull.uc (extends Bird)

CarcassType=Class'DeusEx.SeagullCarcass'
WalkingSpeed=0.666667
GroundSpeed=24.000000
WaterSpeed=8.000000
AirSpeed=150.000000
AccelRate=500.000000
JumpZ=0.000000
BaseEyeHeight=3.000000
Health=20
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Fear
HealthHead=20
HealthTorso=20
HealthLegLeft=20
HealthLegRight=20
HealthArmLeft=20
HealthArmRight=20
Alliance=Seagull
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.Seagull'
CollisionRadius=16.000000
CollisionHeight=6.500000
Mass=2.000000
Buoyancy=2.500000
RotationRate=(Pitch=8000)
BindName="Seagull"
FamiliarName="Seagull"
UnfamiliarName="Seagull"



SeagullCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.SeagullCarcass'
Mesh3=LodMesh'DeusExCharacters.SeagullCarcass'
bAnimalCarcass=True
Mesh=LodMesh'DeusExCharacters.SeagullCarcass'
CollisionRadius=15.000000
CollisionHeight=2.600000



SeagullGenerator.uc (extends PawnGenerator)

PawnClasses(0)=(Count=12,PawnClass=Class'DeusEx.Seagull')
Alliance=Seagull
ActiveArea=1500.000000
Radius=500.000000
MaxCount=8
bPawnsTransient=True



Seat.uc (extends Furniture)

var() Vector sitPoint[4];
var Actor sittingActor[4];
var int numSitPoints;
var vector InitialPosition;
sitPoint(0)=(X=-1000.000000,Y=-1000.000000,Z=-1000.000000)
sitPoint(1)=(X=-1000.000000,Y=-1000.000000,Z=-1000.000000)
sitPoint(2)=(X=-1000.000000,Y=-1000.000000,Z=-1000.000000)
sitPoint(3)=(X=-1000.000000,Y=-1000.000000,Z=-1000.000000)
bCanBeBase=True

BeginPlay


local int i;


// count how many sitpoints are valid
for(i=0; i {
if (sitPoint[i] != vect(-1000,-1000,-1000))
numSitPoints++;
else
break;
}

InitialPosition = Location;

Bump (actor Other)


local ScriptedPawn sitter;
local bool bInUse;
local int i;


bInUse = false;
for (i=0; i {
if (sittingActor[i] != None)
{
if ((sittingActor[i] == Other) ||
((ScriptedPawn(sittingActor[i]) != None) &&
ScriptedPawn(sittingActor[i]).bSitting))
{
bInUse = true;
break;
}
}
}

// If we're in use, ignore bump (no pushing)
if (!bInUse)
Super.Bump(Other);




SecretService.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.SecretServiceCarcass'
WalkingSpeed=0.213333
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SecretServiceTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SecretServiceTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SecretServiceTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SecretServiceTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SecretServiceTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.LensesTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="SecretService"
FamiliarName="Secret Service Agent"
UnfamiliarName="Secret Service Agent"



SecretServiceCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SecretServiceTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SecretServiceTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SecretServiceTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SecretServiceTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SecretServiceTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.LensesTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



Secretary.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.SecretaryCarcass'
WalkingSpeed=0.320000
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SecretaryTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SecretaryTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SecretaryTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SecretaryTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.SecretaryTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="Secretary"
FamiliarName="Secretary"
UnfamiliarName="Secretary"



SecretaryCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SecretaryTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SecretaryTex0'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SecretaryTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SecretaryTex2'
MultiSkins(5)=Texture'DeusExCharacters.Skins.SecretaryTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex2'



SecurityBot2.uc (extends Robot)

var() ESkinColor SkinColor;
SearchingSound=Sound'DeusExSounds.Robot.SecurityBot2Searching'
SpeechTargetAcquired=Sound'DeusExSounds.Robot.SecurityBot2TargetAcquired'
SpeechTargetLost=Sound'DeusExSounds.Robot.SecurityBot2TargetLost'
SpeechOutOfAmmo=Sound'DeusExSounds.Robot.SecurityBot2OutOfAmmo'
SpeechCriticalDamage=Sound'DeusExSounds.Robot.SecurityBot2CriticalDamage'
SpeechScanning=Sound'DeusExSounds.Robot.SecurityBot2Scanning'
EMPHitPoints=100
explosionSound=Sound'DeusExSounds.Robot.SecurityBot2Explode'
WalkingSpeed=1.000000
bEmitDistress=True
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponRobotMachinegun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=50)
WalkSound=Sound'DeusExSounds.Robot.SecurityBot2Walk'
GroundSpeed=95.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
Health=250
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.SecurityBot2'
CollisionRadius=62.000000
CollisionHeight=58.279999
Mass=800.000000
Buoyancy=100.000000
BindName="SecurityBot2"
FamiliarName="Security Bot"
UnfamiliarName="Security Bot"

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_UNATCO: MultiSkins[1] = Texture'SecurityBot2Tex1'; break;
case SC_Chinese: MultiSkins[1] = Texture'SecurityBot2Tex2'; break;
}

PlayDisabled


local int rnd;


rnd = Rand(3);
if (rnd == 0)
TweenAnimPivot('Disabled1', 0.2);
else if (rnd == 1)
TweenAnimPivot('Disabled2', 0.2);
else
TweenAnimPivot('Still', 0.2);




SecurityBot3.uc (extends Robot)

var() ESkinColor SkinColor;
SpeechTargetAcquired=Sound'DeusExSounds.Robot.SecurityBot3TargetAcquired'
SpeechTargetLost=Sound'DeusExSounds.Robot.SecurityBot3TargetLost'
SpeechOutOfAmmo=Sound'DeusExSounds.Robot.SecurityBot3OutOfAmmo'
SpeechCriticalDamage=Sound'DeusExSounds.Robot.SecurityBot3CriticalDamage'
SpeechScanning=Sound'DeusExSounds.Robot.SecurityBot3Scanning'
EMPHitPoints=40
WalkingSpeed=1.000000
bEmitDistress=True
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponRobotMachinegun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=50)
GroundSpeed=95.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
Health=150
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.SecurityBot3'
SoundRadius=16
SoundVolume=128
AmbientSound=Sound'DeusExSounds.Robot.SecurityBot3Move'
CollisionRadius=25.350000
CollisionHeight=28.500000
Mass=1000.000000
Buoyancy=100.000000
BindName="SecurityBot3"
FamiliarName="Security Bot"
UnfamiliarName="Security Bot"

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_UNATCO: Skin = Texture'SecurityBot3Tex1'; break;
case SC_Chinese: Skin = Texture'SecurityBot3Tex2'; break;
}




SecurityBot4.uc (extends Robot)

SpeechTargetAcquired=Sound'DeusExSounds.Robot.SecurityBot3TargetAcquired'
SpeechTargetLost=Sound'DeusExSounds.Robot.SecurityBot3TargetLost'
SpeechOutOfAmmo=Sound'DeusExSounds.Robot.SecurityBot3OutOfAmmo'
SpeechCriticalDamage=Sound'DeusExSounds.Robot.SecurityBot3CriticalDamage'
SpeechScanning=Sound'DeusExSounds.Robot.SecurityBot3Scanning'
WalkingSpeed=1.000000
bEmitDistress=True
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponRobotMachinegun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=50)
GroundSpeed=95.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
Health=150
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.SecurityBot4'
SoundRadius=16
SoundVolume=128
AmbientSound=Sound'DeusExSounds.Robot.SecurityBot4Move'
CollisionRadius=27.500000
CollisionHeight=28.500000
Mass=1000.000000
Buoyancy=100.000000
BindName="SecurityBot4"
FamiliarName="Security Bot"
UnfamiliarName="Security Bot"



SecurityCamera.uc (extends HackableDevices)

var() bool bSwing;
var() int swingAngle;
var() float swingPeriod;
var() int cameraFOV;
var() int cameraRange;
var float memoryTime;
var() bool bActive;
var() bool bNoAlarm; // if True, does NOT sound alarm
var Rotator origRot;
var Rotator ReplicatedRotation; // for net propagation
var bool bTrackPlayer;
var bool bPlayerSeen;
var bool bEventTriggered;
var bool bFoundCurPlayer; // in multiplayer, if we found a player this tick.
var float lastSeenTimer;
var float playerCheckTimer;
var float swingTimer;
var bool bConfused; // used when hit by EMP
var float confusionTimer; // how long until camera resumes normal operation
var float confusionDuration; // how long does EMP hit last?
var float triggerDelay; // how long after seeing the player does it trigger?
var float triggerTimer; // timer used for above
var vector playerLocation; // last seen position of player
var Actor curTarget; // current view target
var Actor prevTarget; // target we had last tick.
var Pawn safeTarget; // in multiplayer, this actor is strictly off-limits
var localized string msgActivated;
var localized string msgDeactivated;
var int team; // Keep track of team the camera is on
swingAngle=8192
swingPeriod=8.000000
cameraFOV=4096
cameraRange=1024
memoryTime=5.000000
bActive=True
confusionDuration=10.000000
triggerDelay=4.000000
msgActivated="Camera activated"
msgDeactivated="Camera deactivated"
Team=-1
HitPoints=50
minDamageThreshold=50
bInvincible=False
FragType=Class'DeusEx.MetalFragment'
ItemName="Surveillance Camera"
Physics=PHYS_Rotating
Texture=Texture'DeusExDeco.Skins.SecurityCameraTex2'
Mesh=LodMesh'DeusExDeco.SecurityCamera'
SoundRadius=48
SoundVolume=192
AmbientSound=Sound'DeusExSounds.Generic.CameraHum'
CollisionRadius=10.720000
CollisionHeight=11.000000
LightType=LT_Steady
LightBrightness=120
LightHue=80
LightSaturation=100
LightRadius=1
bRotateToDesired=True
Mass=20.000000
Buoyancy=5.000000
RotationRate=(Pitch=65535,Yaw=65535)
bVisionImportant=True

AcquireMultiplayerTarget -> Actor


local Pawn apawn;
local DeusExPlayer aplayer;
local Vector dist;


//DEUS_EX AMSD See if our old target is still valid.
if ((prevtarget != None) && (prevtarget != safetarget) && (Pawn(prevtarget) != None))
{
if (Pawn(prevtarget).AICanSee(self, 1.0, false, false, false, true) > 0)
{
if (DeusExPlayer(prevtarget) == None)
{
curtarget = prevtarget;
return curtarget;
}
else
{
if (DeusExPlayer(prevtarget).AugmentationSystem.GetAugLevelValue(class'AugRadarTrans') == -1.0)
{
curtarget = prevtarget;
return curtarget;
}
}
}
}
// MB Optimized to use pawn list, previous way used foreach VisibleActors
apawn = Level.PawnList;
while ( apawn != None )
{
if (apawn.bDetectable && !apawn.bIgnore && apawn.IsA('DeusExPlayer'))
{
aplayer = DeusExPlayer(apawn);

dist = aplayer.Location - Location;

if ( VSize(dist) < CameraRange )
{
// Only players we can see
if ( aplayer.FastTrace( aplayer.Location, Location ))
{
//only track players who aren't the safetarget.
//we already know prevtarget not valid.
if ((aplayer != safeTarget) && (aplayer != prevTarget))
{
if (! ( (TeamDMGame(aplayer.DXGame) != None) && (safeTarget != None) && (TeamDMGame(aplayer.DXGame).ArePlayersAllied( DeusExPlayer(safeTarget),aplayer)) ) )
{
// If the player's RadarTrans aug is off, the turret can see him
if (aplayer.AugmentationSystem.GetAugLevelValue(class'AugRadarTrans') == -1.0)
{
curTarget = apawn;
break;
}
}
}
}
}
}
apawn = apawn.nextPawn;
}
return curtarget;

BeginPlay


Super.BeginPlay();

origRot = Rotation;
DesiredRotation = origRot;

playerLocation = Location;

if (Level.NetMode != NM_Standalone)
{
bInvincible=True;
HackStrength = 0.6;
}

CheckPlayerVisibility (DeusExPlayer player)


local float yaw, pitch, dist;
local Actor hit;
local Vector HitLocation, HitNormal;
local Rotator rot;


if (player == None)
return;
dist = Abs(VSize(player.Location - Location));

// if the player is in range
if (player.bDetectable && !player.bIgnore && (dist <= cameraRange))
{
hit = Trace(HitLocation, HitNormal, player.Location, Location, True);
if (hit == player)
{
// If the player's RadarTrans aug is on, the camera can't see him
// DEUS_EX AMSD In multiplayer, we've already done this test with
// AcquireMultiplayerTarget
if (Level.Netmode == NM_Standalone)
{
if (player.AugmentationSystem.GetAugLevelValue(class'AugRadarTrans') != -1.0)
return;
}

// figure out if we can see the player
rot = Rotator(player.Location - Location);
rot.Roll = 0;
yaw = (Abs(Rotation.Yaw - rot.Yaw)) % 65536;
pitch = (Abs(Rotation.Pitch - rot.Pitch)) % 65536;

// center the angles around zero
if (yaw > 32767)
yaw -= 65536;
if (pitch > 32767)
pitch -= 65536;

// if we are in the camera's FOV
if ((Abs(yaw) < cameraFOV) && (Abs(pitch) < cameraFOV))
{
// rotate to face the player
if (bTrackPlayer)
DesiredRotation = rot;

lastSeenTimer = 0;
bPlayerSeen = True;
bTrackPlayer = True;
bFoundCurPlayer = True;

playerLocation = player.Location - vect(0,0,1)*(player.CollisionHeight-5);

// trigger the event if we haven't yet for this sighting
if (!bEventTriggered && (triggerTimer >= triggerDelay) && (Level.Netmode == NM_Standalone))
TriggerEvent(True);

return;
}
}
}

HackAction (Actor Hacker, bool bHacked)


local ComputerSecurity CompOwner;
local ComputerSecurity TempComp;
local AutoTurret turret;
local name Turrettag;
local int ViewIndex;


if (bConfused)
return;

Super.HackAction(Hacker, bHacked);

if (bHacked)
{
if (Level.NetMode == NM_Standalone)
{
if (bActive)
UnTrigger(Hacker, Pawn(Hacker));
else
Trigger(Hacker, Pawn(Hacker));
}
else
{
//DEUS_EX AMSD Reset the hackstrength afterwards
if (hackStrength == 0.0)
hackStrength = 0.6;
if (bActive)
UnTrigger(Hacker, Pawn(Hacker));
//Find the associated computer.
foreach AllActors(class'ComputerSecurity',TempComp)
{
for (ViewIndex = 0; ViewIndex < ArrayCount(TempComp.Views); ViewIndex++)
{
if (TempComp.Views[ViewIndex].cameraTag == self.Tag)
{
CompOwner = TempComp;

//find associated turret
Turrettag = TempComp.Views[ViewIndex].Turrettag;
if (Turrettag != '')
{
foreach AllActors(class'AutoTurret', turret, TurretTag)
{
break;
}
}
}
}
}

if (CompOwner != None)
{
//Turn off the associated turret as well
if ( (Hacker.IsA('DeusExPlayer')) && (Turret != None))
{
Turret.bDisabled = True;
Turret.gun.HackStrength = 0.6;
}
}
}
}

TakeDamage (int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)


local float mindmg;


if (DamageType == 'EMP')
{
// duration is based on daamge
// 10 seconds min to 30 seconds max
mindmg = Max(Damage - 15.0, 0.0);
confusionDuration += mindmg / 5.0;
confusionTimer = 0;
if (!bConfused)
{
bConfused = True;
LightHue = 40;
MultiSkins[2] = Texture'YellowLightTex';
SoundPitch = 128;
PlaySound(sound'EMPZap', SLOT_None,,, 1280);
}
return;
}
if (( Level.NetMode != NM_Standalone ) && (EventInstigator.IsA('DeusExPlayer')))
DeusExPlayer(EventInstigator).ServerConditionalNotifyMsg( DeusExPlayer(EventInstigator).MPMSG_CameraInv );

Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);

Tick (float deltaTime)


local float ang;
local Rotator rot;
local DeusExPlayer curplayer;


Super.Tick(deltaTime);

curTarget = None;

// if this camera is not active, get out
if (!bActive)
{
// DEUS_EX AMSD For multiplayer
ReplicatedRotation = DesiredRotation;

MultiSkins[2] = Texture'BlackMaskTex';
return;
}

// if we've been EMP'ed, act confused
if (bConfused)
{
confusionTimer += deltaTime;

// pick a random facing at random
if (confusionTimer % 0.25 > 0.2)
{
DesiredRotation.Pitch = origRot.Pitch + 0.5*swingAngle - Rand(swingAngle);
DesiredRotation.Yaw = origRot.Yaw + 0.5*swingAngle - Rand(swingAngle);
}

if (confusionTimer > confusionDuration)
{
bConfused = False;
confusionTimer = 0;
confusionDuration = Default.confusionDuration;
LightHue = 80;
MultiSkins[2] = Texture'GreenLightTex';
SoundPitch = 64;
DesiredRotation = origRot;
}

return;
}

// check the player's visibility every 0.1 seconds
if (!bNoAlarm)
{
playerCheckTimer += deltaTime;

if (playerCheckTimer > 0.1)
{
playerCheckTimer = 0;
if (Level.NetMode == NM_Standalone)
CheckPlayerVisibility(DeusExPlayer(GetPlayerPawn()));
else
{
curPlayer = DeusExPlayer(AcquireMultiplayerTarget());
if (curPlayer != None)
CheckPlayerVisibility(curPlayer);
}
}
}

// forget about the player after a set amount of time
if (bPlayerSeen)
{
// if the player has been seen, but the camera hasn't triggered yet,
// provide some feedback to the player (light and sound)
if (!bEventTriggered)
{
triggerTimer += deltaTime;

if (triggerTimer % 0.5 > 0.4)
{
LightHue = 0;
MultiSkins[2] = Texture'RedLightTex';
PlaySound(Sound'Beep6',,,, 1280);
}
else
{
LightHue = 80;
MultiSkins[2] = Texture'GreenLightTex';
}
}

if (lastSeenTimer < memoryTime)
lastSeenTimer += deltaTime;
else
{
lastSeenTimer = 0;
bPlayerSeen = False;

// untrigger the event
TriggerEvent(False);
}

return;
}

swingTimer += deltaTime;
MultiSkins[2] = Texture'GreenLightTex';

// swing back and forth if all is well
if (bSwing && !bTrackPlayer)
{
ang = 2 * Pi * swingTimer / swingPeriod;
rot = origRot;
rot.Yaw += Sin(ang) * swingAngle;
DesiredRotation = rot;
}

// DEUS_EX AMSD For multiplayer
ReplicatedRotation = DesiredRotation;

Trigger (Actor Other, Pawn Instigator)


if (bConfused)
return;

Super.Trigger(Other, Instigator);

if (!bActive)
{
if (Instigator != None)
Instigator.ClientMessage(msgActivated);
bActive = True;
LightType = LT_Steady;
LightHue = 80;
MultiSkins[2] = Texture'GreenLightTex';
AmbientSound = sound'CameraHum';
}

TriggerEvent (bool bTrigger)


bEventTriggered = bTrigger;
bTrackPlayer = bTrigger;
triggerTimer = 0;

// now, the camera sounds its own alarm
if (bTrigger)
{
AmbientSound = Sound'Klaxon2';
SoundVolume = 128;
SoundRadius = 64;
LightHue = 0;
MultiSkins[2] = Texture'RedLightTex';
AIStartEvent('Alarm', EAITYPE_Audio, SoundVolume/255.0, 25*(SoundRadius+1));

// make sure we can't go into stasis while we're alarming
bStasis = False;
}
else
{
AmbientSound = Sound'CameraHum';
SoundRadius = 48;
SoundVolume = 192;
LightHue = 80;
MultiSkins[2] = Texture'GreenLightTex';
AIEndEvent('Alarm', EAITYPE_Audio);

// reset our stasis info
bStasis = Default.bStasis;
}

UnTrigger (Actor Other, Pawn Instigator)


if (bConfused)
return;

Super.UnTrigger(Other, Instigator);

if (bActive)
{
if (Instigator != None)
Instigator.ClientMessage(msgDeactivated);
TriggerEvent(False);
bActive = False;
LightType = LT_None;
AmbientSound = None;
DesiredRotation = origRot;
hackStrength = 0.0;
}




SenseTrigger.uc (extends Trigger)

var() class KeyNeeded;
var() Name failedEvent;
ReTriggerDelay=1.000000

Touch (Actor Other)


local bool bDoIt;
local Pawn P;
local Inventory inv;
local Actor A;


bDoIt = False;

// should we even pay attention to this actor?
if (!IsRelevant(Other))
return;

P = Pawn(Other);
if (P == None)
return;

for (inv=P.Inventory; inv!=None; inv=inv.Inventory)
if (KeyNeeded == inv.Class)
bDoIt = True;

if (bDoIt)
Super.Touch(Other);
else
if (failedEvent != '')
foreach AllActors(class'Actor', A, failedEvent)
A.Trigger(Other, Other.Instigator);




SequenceEvents.uc (extends Keypoint)

var() Name Events[8];
var() float Delays[8];
var() float RestartTime; // time delay before restarting if looping
var() bool bLoop; // set to loop forever
var() bool bLOSRequired; // if true, then events only happen when player is looking
var byte num;
var int i;
var Actor A;
Delays(0)=1.000000
Delays(1)=1.000000
Delays(2)=1.000000
Delays(3)=1.000000
Delays(4)=1.000000
Delays(5)=1.000000
Delays(6)=1.000000
Delays(7)=1.000000
RestartTime=2.000000
bLoop=True
bLOSRequired=True
bStatic=False



SequenceTrigger.uc (extends Trigger)

var() int SeqNum;
CollisionRadius=0.000000
bCollideActors=False

CheckMovers


local Mover M;


if (Event != '')
foreach AllActors(class'Mover', M, Event)
{
if (MultiMover(M) != None)
MultiMover(M).SetSeq(SeqNum);
else if (ElevatorMover(M) != None)
ElevatorMover(M).SetSeq(SeqNum);
}

Touch (Actor Other)


CheckMovers();
Super.Touch(Other);

Trigger (Actor Other, Pawn Instigator)


CheckMovers();
Super.Trigger(Other, Instigator);




Shadow.uc (extends Decal)

var vector lastLocation;
var bool bHasDecal;
bHasDecal=True
Texture=Texture'DeusExItems.Skins.FlatFXTex40'

Tick (float deltaTime)


local vector EndTrace, HitLocation, HitNormal;
local Actor hit;
local float dist;
local ScriptedPawn pawnOwner;
local bool recentlyDrewShadow, recentlyDrewOwner;
local bool doDraw;


Super.Tick(deltaTime);

if (Owner == None)
{
Destroy();
return;
}

// don't update if our owner is in stasis or isn't moving
if (Owner.InStasis() || (VSize(Owner.Location - lastLocation) < 0.1))
if (bHasDecal) // we are doing nothing, we have a decal, we are fine
return;

// in our dream world, these two would be "last frame" not "recently"
recentlyDrewShadow = (lastRendered()<1.0);
recentlyDrewOwner = (Owner.lastRendered()<1.0);
doDraw = recentlyDrewShadow || recentlyDrewOwner;

if (bHasDecal)
{
DetachDecal();
bHasDecal=False;
}

// temp until this works better
if (Owner.IsA('DeusExPlayer'))
doDraw = True;

if (!doDraw)
return;

// save our location to check next frame - only if we move the shadow, however
lastLocation = Owner.Location;

// trace down about 30 feet
EndTrace = Owner.Location - vect(0,0,480);
hit = Trace(HitLocation, HitNormal, EndTrace, Owner.Location, True);

if (hit != None)
{
dist = VSize(HitLocation - Owner.Location);
DrawScale = (Owner.CollisionRadius / 15.0) - ((dist - Owner.CollisionHeight) / 130.0);

pawnOwner = ScriptedPawn(Owner);
if (pawnOwner != None)
DrawScale *= pawnOwner.ShadowScale;

if (DrawScale < 0)
DrawScale = 0;
SetLocation(HitLocation);
SetRotation(Rotator(HitNormal));

AttachDecal(32,vect(0.1,0.1,0));
bHasDecal=True;
}




ShadowWindow.uc (extends Window)

var Texture texShadows[9];
texShadows(0)=Texture'DeusExUI.UserInterface.WindowShadow_TL'
texShadows(1)=Texture'DeusExUI.UserInterface.WindowShadow_TR'
texShadows(2)=Texture'DeusExUI.UserInterface.WindowShadow_BL'
texShadows(3)=Texture'DeusExUI.UserInterface.WindowShadow_BR'
texShadows(4)=Texture'DeusExUI.UserInterface.WindowShadow_Left'
texShadows(5)=Texture'DeusExUI.UserInterface.WindowShadow_Right'
texShadows(6)=Texture'DeusExUI.UserInterface.WindowShadow_Top'
texShadows(7)=Texture'DeusExUI.UserInterface.WindowShadow_Bottom'
texShadows(8)=Texture'DeusExUI.UserInterface.WindowShadow_Center'

DrawWindow (GC gc)


gc.SetStyle(DSTY_Modulated);
gc.DrawBorders(0, 0, width, height, 0, 0, 0, 0, texShadows);




ShakeTrigger.uc (extends Trigger)

var() float shakeTime;
var() float shakeRollMagnitude;
var() float shakeVertMagnitude;
shaketime=1.000000
shakeRollMagnitude=1024.000000
shakeVertMagnitude=16.000000

Touch (Actor Other)


local DeusExPlayer player;


if (IsRelevant(Other))
{
player = DeusExPlayer(Other);
if (player != None)
player.ShakeView(shakeTime, shakeRollMagnitude, shakeVertMagnitude);

Super.Touch(Other);
}

Trigger (Actor Other, Pawn Instigator)


Instigator.ShakeView(shakeTime, shakeRollMagnitude, shakeVertMagnitude);

Super.Trigger(Other, Instigator);




ShellCasing.uc (extends DeusExFragment)

Fragments(0)=LodMesh'DeusExItems.ShellCasing'
numFragmentTypes=1
elasticity=0.400000
ImpactSound=Sound'DeusExSounds.Generic.ShellHit'
MiscSound=Sound'DeusExSounds.Generic.ShellHit'
Mesh=LodMesh'DeusExItems.ShellCasing'
CollisionRadius=0.600000
CollisionHeight=0.300000



ShellCasing2.uc (extends DeusExFragment)

Fragments(0)=LodMesh'DeusExItems.ShellCasing2'
numFragmentTypes=1
elasticity=0.400000
ImpactSound=Sound'DeusExSounds.Generic.ShellHit'
MiscSound=Sound'DeusExSounds.Generic.ShellHit'
Mesh=LodMesh'DeusExItems.ShellCasing2'
CollisionRadius=2.570000
CollisionHeight=0.620000



ShellCasingSilent.uc (extends ShellCasing)

ImpactSound=None
MiscSound=None
Skin=Texture'DeusExItems.Skins.ShellCasingTex2'



ShipsWheel.uc (extends DeusExDecoration)

var bool bSpinning;
var float spinTime, spinDuration;
var int spinDir, spinSpeed;
FragType=Class'DeusEx.WoodFragment'
ItemName="Ship's Wheel"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.ShipsWheel'
CollisionRadius=21.000000
CollisionHeight=21.000000
Mass=50.000000
Buoyancy=5.000000

Frob (actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

// spin the wheel in a random direction for a random amount of time at a random speed
if (FRand() < 0.5)
spinDir = -1;
else
spinDir = 1;
spinSpeed = Rand(64) * 1024;
spinDuration = FRand() * 5 + 2;
spinTime = 0;
bSpinning = True;

Tick (float deltaTime)


local Rotator rot;


Super.Tick(deltaTime);

if (bSpinning)
{
rot = Rotation;
rot.Roll += spinDir * spinSpeed * deltaTime * (spinDuration - spinTime) / spinDuration;
SetRotation(rot);
spinTime += deltaTime;
if (spinTime >= spinDuration)
bSpinning = False;
}




ShockRing.uc (extends Effects)

var float size;
size=5.000000
LifeSpan=0.500000
DrawType=DT_Mesh
Style=STY_Translucent
Skin=Texture'DeusExItems.Skins.FlatFXTex41'
Mesh=LodMesh'DeusExItems.FlatFX'
bUnlit=True

PostBeginPlay


Super.PostBeginPlay();

if (size > 5)
Skin = Texture'FlatFXTex43';

Tick (float deltaTime)


DrawScale = size * (Default.LifeSpan - LifeSpan) / Default.LifeSpan;
ScaleGlow = LifeSpan / Default.LifeSpan;




ShopLight.uc (extends DeusExDecoration)

FragType=Class'DeusEx.GlassFragment'
bHighlight=False
ItemName="Flourescent Light"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.ShopLight'
CollisionRadius=42.500000
CollisionHeight=4.000000
Mass=30.000000
Buoyancy=25.000000



ShowClassWindow.uc (extends ToolWindow)

var ToolEditWindow editClassName;
var ToolCheckboxWindow chkEyes;
var ToolCheckboxWindow chkArea;
var ToolCheckboxWindow chkCylinder;
var ToolCheckboxWindow chkMesh;
var ToolCheckboxWindow chkLOS;
var ToolCheckboxWindow chkVisibility;
var ToolCheckboxWindow chkState;
var ToolCheckboxWindow chkLight;
var ToolCheckboxWindow chkDist;
var ToolCheckboxWindow chkPos;
var ToolCheckboxWindow chkHealth;
var ToolButtonWindow btnCancel;
var ToolButtonWindow btnOK;
var ActorDisplayWindow actorDisplay;

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case btnOK:
SaveSettings();
root.PopWindow();
break;

case btnCancel:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated( buttonPressed );

return bHandled;

CreateControls


// Labels
CreateToolLabel(18, 30, "Current View Class:");

// Edit Control
editClassName = CreateToolEditWindow(15, 50, 185, 64);

// Checkboxes
chkEyes = CreateToolCheckbox(15, 90, "Show |&Eyes", actorDisplay.AreEyesVisible());
chkArea = CreateToolCheckbox(15, 115, "Show |&Area", actorDisplay.IsAreaVisible());
chkCylinder = CreateToolCheckbox(15, 140, "Show C|&ylinder", actorDisplay.IsCylinderVisible());
chkMesh = CreateToolCheckbox(15, 165, "Show |&Mesh", actorDisplay.IsMeshVisible());
chkLOS = CreateToolCheckbox(15, 190, "Show |&Line of Sight", actorDisplay.IsLOSVisible());
chkVisibility = CreateToolCheckbox(15, 215, "Show |&Visibility", actorDisplay.IsVisibilityVisible());
chkState = CreateToolCheckbox(15, 240, "Sho|&w State", actorDisplay.IsStateVisible());
chkLight = CreateToolCheckbox(15, 265, "Show Li|&ght Level", actorDisplay.IsLightVisible());
chkDist = CreateToolCheckbox(15, 290, "Show |&Distance", actorDisplay.IsDistVisible());
chkPos = CreateToolCheckbox(15, 315, "Show |&Position", actorDisplay.IsPosVisible());
chkHealth = CreateToolCheckbox(15, 340, "Show |&Health", actorDisplay.IsHealthVisible());

// Buttons
btnOK = CreateToolButton(25, 373, "|&OK");
btnCancel = CreateToolButton(118, 373, "|&Cancel");

EditActivated (window edit, bool bModified) -> bool


SaveSettings();
root.PopWindow();
return True;

InitWindow


local String displayClass;


Super.InitWindow();

// Center this window
SetSize(215, 420);
SetTitle("Show Class");

// Get a pointer to the ActorDisplayWindow
actorDisplay = root.actorDisplay;

// Create the controls
CreateControls();

// Set focus to the edit control and highlight the text in it.
if ( actorDisplay.GetViewClass() != None )
{
displayClass = String(actorDisplay.GetViewClass());
editClassName.SetText(displayClass);
editClassName.SetInsertionPoint(Len(displayClass) - 1);
editClassName.SetSelectedArea(0, Len(displayClass));
}
SetFocusWindow(editClassName);

SaveSettings


if ( editClassName.GetText() == "" )
actorDisplay.SetViewClass(None);
else
// let UnrealScript parse the class name for us
GetPlayerPawn().ConsoleCommand("ShowClass "$editClassName.GetText());

actorDisplay.ShowEyes(chkEyes.GetToggle());
actorDisplay.ShowArea(chkArea.GetToggle());
actorDisplay.ShowCylinder(chkCylinder.GetToggle());
actorDisplay.ShowMesh(chkMesh.GetToggle());
actorDisplay.ShowLOS(chkLOS.GetToggle());
actorDisplay.ShowVisibility(chkVisibility.GetToggle());
actorDisplay.ShowState(chkState.GetToggle());
actorDisplay.ShowLight(chkLight.GetToggle());
actorDisplay.ShowDist(chkDist.GetToggle());
actorDisplay.ShowPos(chkPos.GetToggle());
actorDisplay.ShowHealth(chkHealth.GetToggle());




ShowerFaucet.uc (extends DeusExDecoration)

var() bool bOpen;
var ParticleGenerator waterGen[4];
var Vector sprayOffsets[4];
sprayOffsets(0)=(X=2.000000,Z=2.000000)
sprayOffsets(1)=(Y=-2.000000)
sprayOffsets(2)=(X=-2.000000,Z=-2.000000)
sprayOffsets(3)=(Y=2.000000)
bInvincible=True
ItemName="Shower Faucet"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.ShowerFaucet'
CollisionRadius=6.800000
CollisionHeight=6.410000
Mass=20.000000
Buoyancy=10.000000

Destroyed


local int i;


for (i=0; i<4; i++)
if (waterGen[i] != None)
waterGen[i].DelayedDestroy();

Super.Destroyed();

Frob (actor Frobber, Inventory frobWith)


local int i;


Super.Frob(Frobber, frobWith);

bOpen = !bOpen;
if (bOpen)
{
PlaySound(sound'ValveOpen',,,, 256, 2.0);
PlayAnim('On');

for (i=0; i<4; i++)
if (waterGen[i] != None)
waterGen[i].Trigger(Frobber, Pawn(Frobber));

// extinguish the player if he frobbed this
if (DeusExPlayer(Frobber) != None)
if (DeusExPlayer(Frobber).bOnFire)
DeusExPlayer(Frobber).ExtinguishFire();
}
else
{
PlaySound(sound'ValveClose',,,, 256, 2.0);
PlayAnim('Off');

for (i=0; i<4; i++)
if (waterGen[i] != None)
waterGen[i].UnTrigger(Frobber, Pawn(Frobber));
}

PostBeginPlay


local ShowerHead head, linkedHead;
local Vector loc;
local int i;


Super.PostBeginPlay();

// find the matching shower head
linkedHead = None;
if (Tag != '')
foreach AllActors(class'ShowerHead', head, Tag)
linkedHead = head;

// spawn a particle generator
if (linkedHead != None)
{
for (i=0; i<4; i++)
{
// rotate the spray offsets into object coordinate space
loc = sprayOffsets[i];
loc.X += linkedHead.CollisionRadius * 0.7;
loc.Z -= linkedHead.CollisionHeight * 0.85;
loc = loc >> linkedHead.Rotation;
loc += linkedHead.Location;

waterGen[i] = Spawn(class'ParticleGenerator', linkedHead,, loc, linkedHead.Rotation-rot(8192,0,0));
if (waterGen[i] != None)
{
waterGen[i].particleDrawScale = 0.05;
waterGen[i].checkTime = 0.05;
waterGen[i].frequency = 1.0;
waterGen[i].bGravity = True;
waterGen[i].bScale = False;
waterGen[i].bFade = True;
waterGen[i].ejectSpeed = 100.0;
waterGen[i].particleLifeSpan = 1.5;
waterGen[i].numPerSpawn = 3;
waterGen[i].bRandomEject = True;
waterGen[i].particleTexture = Texture'Effects.Generated.WtrDrpSmall';
waterGen[i].bTriggered = True;
waterGen[i].bInitiallyOn = bOpen;
waterGen[i].SetBase(linkedHead);

// only have sound on one of them
if (i == 0)
{
waterGen[i].bAmbientSound = True;
waterGen[i].AmbientSound = Sound'Shower';
waterGen[i].SoundRadius = 16;
}
}
}
}

// play the correct startup animation
if (bOpen)
PlayAnim('On', 10.0, 0.001);
else
PlayAnim('Off', 10.0, 0.001);




ShowerHead.uc (extends DeusExDecoration)

bInvincible=True
ItemName="Shower Head"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.ShowerHead'
CollisionRadius=9.480000
CollisionHeight=8.410000
Mass=20.000000
Buoyancy=10.000000



Shuriken.uc (extends DeusExProjectile)

var float mpDamage;
var int mpAccurateRange;
var int mpMaxRange;
mpDamage=17.000000
mpAccurateRange=640
mpMaxRange=640
bBlood=True
bStickToWall=True
DamageType=shot
AccurateRange=640
maxRange=1280
spawnWeaponClass=Class'DeusEx.WeaponShuriken'
bIgnoresNanoDefense=True
ItemName="Throwing Knife"
ItemArticle="a"
speed=750.000000
MaxSpeed=750.000000
Damage=15.000000
MomentumTransfer=1000
ImpactSound=Sound'DeusExSounds.Generic.BulletHitFlesh'
Mesh=LodMesh'DeusExItems.ShurikenPickup'
CollisionRadius=5.000000
CollisionHeight=0.300000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
Damage = mpDamage;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
}

Tick (float deltaTime)


local Rotator rot;


if (bStuck)
return;

Super.Tick(deltaTime);

if (Level.Netmode != NM_DedicatedServer)
{
rot = Rotation;
rot.Roll += 16384;
rot.Pitch -= 16384;
SetRotation(rot);
}




SignFloor.uc (extends DeusExDecoration)

FragType=Class'DeusEx.PlasticFragment'
ItemName="Caution Sign"
Mesh=LodMesh'DeusExDeco.SignFloor'
CollisionRadius=12.500000
CollisionHeight=15.380000
Mass=10.000000
Buoyancy=12.000000



Skill.uc (extends Actor)

var() localized string SkillName;
var() localized string Description;
var Texture SkillIcon;
var() bool bAutomatic;
var() bool bConversationBased;
var() int Cost[3];
var() float LevelValues[4];
var travel int CurrentLevel; // 0 is unskilled, 3 is master
var() class itemNeeded;
var DeusExPlayer Player;
var travel Skill next;
var Localized string skillLevelStrings[4];
var localized string SkillAtMaximum;
skillLevelStrings(0)="UNTRAINED"
skillLevelStrings(1)="TRAINED"
skillLevelStrings(2)="ADVANCED"
skillLevelStrings(3)="MASTER"
SkillAtMaximum="Skill at Maximum Level"
bHidden=True
bTravel=True
NetUpdateFrequency=5.000000

CanAffordToUpgrade (int skillPointsAvailable) -> bool


if ( CurrentLevel == 3 )
return False;
else if ( Cost[CurrentLevel] > skillPointsAvailable )
return False;
else
return True;

GetCost -> int


return Cost[CurrentLevel];

GetCurrentLevel -> int


return CurrentLevel;

GetCurrentLevelString -> String


return skillLevelStrings[currentLevel];

IncLevel (optional DeusExPlayer usePlayer) -> bool


local DeusExPlayer localPlayer;


// First make sure we're not maxed out
if (CurrentLevel < 3)
{
// If "usePlayer" is passed in, then we want to use this
// as the basis for making our calculations, temporarily
// overriding whatever this skill's player is set to.

if (usePlayer != None)
localPlayer = usePlayer;
else
localPlayer = Player;

// Now, if a player is defined, then check to see if there enough
// skill points available. If no player is defined, just do it.
if (localPlayer != None)
{
if ((localPlayer.SkillPointsAvail >= Cost[CurrentLevel]))
{
// decrement the cost and increment the current skill level
localPlayer.SkillPointsAvail -= GetCost();
CurrentLevel++;
return True;
}
}
else
{
CurrentLevel++;
return True;
}
}

return False;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( (Level.NetMode != NM_StandAlone ) && (Level.Game != None) && (Level.Game.IsA('DeusExMPGame')) )
{
CurrentLevel = DeusExMPGame(Level.Game).MPSkillStartLevel;
}

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.Clear();
winInfo.SetTitle(SkillName);
winInfo.SetText(Description);

return True;

Use -> bool


local bool bDoIt;


bDoIt = True;

if (itemNeeded != None)
{
bDoIt = False;

if ((Player.inHand != None) && (Player.inHand.Class == itemNeeded))
{
SkilledTool(Player.inHand).PlayUseAnim();

// alert NPCs that I'm messing with stuff
if (Player.FrobTarget != None)
if (Player.FrobTarget.bOwned)
Player.FrobTarget.AISendEvent('MegaFutz', EAITYPE_Visual);

bDoIt = True;
}
}

return bDoIt;




SkillAwardTrigger.uc (extends Trigger)

var() int skillPointsAdded;
var() localized String awardMessage;
skillPointsAdded=10
awardMessage="DEFAULT SKILL AWARD MESSAGE - REPORT THIS AS A BUG"
bTriggerOnceOnly=True

Touch (Actor Other)


local DeusExPlayer player;


Super.Touch(Other);

if (IsRelevant(Other))
{
player = DeusExPlayer(Other);

if (player != None)
{
player.SkillPointsAdd(skillPointsAdded);
player.ClientMessage(awardMessage);
}
}

Trigger (Actor Other, Pawn Instigator)


local DeusExPlayer player;


Super.Trigger(Other, Instigator);

player = DeusExPlayer(Instigator);

if (player != None)
{
player.SkillPointsAdd(skillPointsAdded);
player.ClientMessage(awardMessage);
}




SkillComputer.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=1000
mpCost2=1000
mpCost3=1000
mpLevel0=0.400000
mpLevel1=0.400000
mpLevel2=1.000000
mpLevel3=5.000000
SkillName="Computer"
Description="The covert manipulation of computers and security consoles.|n|nUNTRAINED: An agent can use terminals to read bulletins and news.|n|nTRAINED: An agent can hack ATMs, computers, and security consoles.|n|nADVANCED: An agent achieves a moderate increase in detection countdowns and a moderate decrease in lockout times, as well as gaining the ability to control automated gun turrets.|n|nMASTER: An agent is an elite hacker that few systems can withstand."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconComputer'
cost(0)=1125
cost(1)=2250
cost(2)=3750
LevelValues(0)=1.000000
LevelValues(1)=1.000000
LevelValues(2)=2.000000
LevelValues(3)=4.000000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkillDemolition.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=1000
mpCost2=1000
mpCost3=1000
mpLevel1=-0.100000
mpLevel2=-0.300000
mpLevel3=-0.500000
SkillName="Weapons: Demolition"
Description="The use of thrown explosive devices, including LAMs, gas grenades, EMP grenades, and even electronic scramble grenades.|n|nUNTRAINED: An agent can throw grenades, attach them to a surface as a proximity device, or attempt to disarm and remove a previously armed proximity device.|n|nTRAINED: Grenade accuracy and damage increases slightly, as does the safety margin for disarming proximity devices.|n|nADVANCED: Grenade accuracy and damage increases moderately, as does the safety margin for disarming proximity devices.|n|nMASTER: An agent is an expert at all forms of demolition."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconDemolition'
cost(0)=900
cost(1)=1800
cost(2)=3000
LevelValues(1)=-0.100000
LevelValues(2)=-0.250000
LevelValues(3)=-0.500000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkillEnviro.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=1000
mpCost2=1000
mpCost3=1000
mpLevel0=1.000000
mpLevel1=0.750000
mpLevel2=0.500000
mpLevel3=0.250000
SkillName="Environmental Training"
Description="Experience with using hazmat suits, ballistic armor, thermoptic camo, and rebreathers in a number of dangerous situations.|n|nUNTRAINED: An agent can use hazmat suits, ballistic armor, thermoptic camo, and rebreathers.|n|nTRAINED: Armor, suits, camo, and rebreathers can be used slightly longer and more efficiently.|n|nADVANCED: Armor, suits, camo, and rebreathers can be used moderately longer and more efficiently.|n|nMASTER: An agent wears suits and armor like a second skin."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconEnviro'
bAutomatic=True
cost(0)=675
cost(1)=1350
cost(2)=2250
LevelValues(0)=1.000000
LevelValues(1)=0.750000
LevelValues(2)=0.500000
LevelValues(3)=0.250000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkillLockpicking.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=1000
mpCost2=1000
mpCost3=1000
mpLevel0=0.100000
mpLevel1=0.400000
mpLevel2=0.550000
mpLevel3=0.950000
SkillName="Lockpicking"
Description="Lockpicking is as much art as skill, but with intense study it can be mastered by any agent with patience and a set of lockpicks.|n|nUNTRAINED: An agent can pick locks.|n|nTRAINED: The efficiency with which an agent picks locks increases slightly.|n|nADVANCED: The efficiency with which an agent picks locks increases moderately.|n|nMASTER: An agent can defeat almost any mechanical lock."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconLockPicking'
cost(0)=1800
cost(1)=3600
cost(2)=6000
LevelValues(0)=0.100000
LevelValues(1)=0.250000
LevelValues(2)=0.400000
LevelValues(3)=0.750000
itemNeeded=Class'DeusEx.Lockpick'

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkillManager.uc (extends Actor)

var DeusExPlayer Player;
var Class skillClasses[15];
var travel Skill FirstSkill; // Pointer to first Skill
var localized string NoToolMessage;
var localized string NoSkillMessage;
var localized string SuccessMessage;
var localized string YourSkillLevelAt;
skillClasses(0)=Class'DeusEx.SkillWeaponHeavy'
skillClasses(1)=Class'DeusEx.SkillWeaponPistol'
skillClasses(2)=Class'DeusEx.SkillWeaponRifle'
skillClasses(3)=Class'DeusEx.SkillWeaponLowTech'
skillClasses(4)=Class'DeusEx.SkillDemolition'
skillClasses(5)=Class'DeusEx.SkillEnviro'
skillClasses(6)=Class'DeusEx.SkillLockpicking'
skillClasses(7)=Class'DeusEx.SkillTech'
skillClasses(8)=Class'DeusEx.SkillMedicine'
skillClasses(9)=Class'DeusEx.SkillComputer'
skillClasses(10)=Class'DeusEx.SkillSwimming'
NoToolMessage="You need the %s"
NoSkillMessage="%s skill level insufficient to use the %s"
SuccessMessage="Success!"
YourSkillLevelAt="Your skill level at %s is now %d"
bHidden=True
bTravel=True

AddAllSkills


local Skill aSkill;
local int levelIndex;


aSkill = FirstSkill;
while(aSkill != None)
{
for (levelIndex=0; levelIndex<3; levelIndex++)
AddSkill(aSkill);

aSkill = aSkill.next;
}

AddSkill (Skill aNewSkill)


if (aNewSkill.IncLevel())
Player.ClientMessage(Sprintf(YourSkillLevelAt, aNewSkill.SkillName, aNewSkill.CurrentLevel));

CreateSkills (DeusExPlayer newPlayer)


local int skillIndex;
local Skill aSkill;
local Skill lastSkill;


FirstSkill = None;
LastSkill = None;

player = newPlayer;

for(skillIndex=0; skillIndex {
if (skillClasses[skillIndex] != None)
{
aSkill = Spawn(skillClasses[skillIndex], Self);
aSkill.Player = player;

// Manage our linked list
if (aSkill != None)
{
if (FirstSkill == None)
{
FirstSkill = aSkill;
}
else
{
LastSkill.next = aSkill;
}

LastSkill = aSkill;
}
}
}

ResetSkills


local Skill aSkill;


aSkill = FirstSkill;
while(aSkill != None)
{
aSkill.CurrentLevel = aSkill.Default.CurrentLevel;
aSkill = aSkill.next;
}

SetPlayer (DeusExPlayer newPlayer)


local Skill aSkill;


Player = newPlayer;

aSkill = FirstSkill;
while(aSkill != None)
{
aSkill.player = newPlayer;
aSkill = aSkill.next;
}




SkillMedicine.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=1000
mpCost2=1000
mpCost3=1000
mpLevel0=1.000000
mpLevel1=1.000000
mpLevel2=2.000000
mpLevel3=3.000000
SkillName="Medicine"
Description="Practical knowledge of human physiology can be applied by an agent in the field allowing more efficient use of medkits.|n|nUNTRAINED: An agent can use medkits.|n|nTRAINED: An agent can heal slightly more damage and reduce the period of toxic poisoning.|n|nADVANCED: An agent can heal moderately more damage and further reduce the period of toxic poisoning.|n|nMASTER: An agent can perform a heart bypass with household materials."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconMedicine'
cost(0)=900
cost(1)=1800
cost(2)=3000
LevelValues(0)=1.000000
LevelValues(1)=2.000000
LevelValues(2)=2.500000
LevelValues(3)=3.000000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkillRadioBox.uc (extends RadioBoxWindow)

var TileWindow skillWindow;

InitWindow


Super.InitWindow();

skillWindow = TileWindow(NewChild(Class'TileWindow'));




SkillSwimming.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=1000
mpCost2=1000
mpCost3=1000
mpLevel0=1.000000
mpLevel1=1.250000
mpLevel2=1.500000
mpLevel3=2.250000
SkillName="Swimming"
Description="Underwater operations require their own unique set of skills that must be developed by an agent with extreme physical dedication.|n|nUNTRAINED: An agent can swim normally.|n|nTRAINED: The swimming speed and lung capacity of an agent increases slightly.|n|nADVANCED: The swimming speed and lung capacity of an agent increases moderately.|n|nMASTER: An agent moves like a dolphin underwater."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconSwimming'
bAutomatic=True
cost(0)=675
cost(1)=1350
cost(2)=2250
LevelValues(0)=1.000000
LevelValues(1)=1.500000
LevelValues(2)=2.000000
LevelValues(3)=2.500000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkillTech.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
var localized String MultitoolString;
mpCost1=1000
mpCost2=1000
mpCost3=1000
mpLevel0=0.100000
mpLevel1=0.400000
mpLevel2=0.550000
mpLevel3=0.950000
MultitoolString="Multitooling"
SkillName="Electronics"
Description="By studying electronics and its practical application, agents can more efficiently bypass a number of security systems using multitools.|n|nUNTRAINED: An agent can bypass security systems.|n|nTRAINED: The efficiency with which an agent bypasses security increases slightly.|n|nADVANCED: The efficiency with which an agent bypasses security increases moderately.|n|nMASTER: An agent encounters almost no security systems of any challenge."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconTech'
cost(0)=1800
cost(1)=3600
cost(2)=6000
LevelValues(0)=0.100000
LevelValues(1)=0.250000
LevelValues(2)=0.400000
LevelValues(3)=0.750000
itemNeeded=Class'DeusEx.Multitool'

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
skillName=MultitoolString;
}




SkillWeaponHeavy.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=2000
mpCost2=2000
mpCost3=2000
mpLevel0=-0.100000
mpLevel1=-0.250000
mpLevel2=-0.370000
mpLevel3=-0.500000
SkillName="Weapons: Heavy"
Description="The use of heavy weaponry, including flamethrowers, LAWs, and the experimental plasma and GEP guns.|n|nUNTRAINED: An agent can use heavy weaponry, but their accuracy is low and movement is difficult.|n|nTRAINED: Accuracy and damage increases slightly, while reloading and movement is somewhat faster.|n|nADVANCED: Accuracy and damage increases moderately, while reloading and movement is even more rapid.|n|nMASTER: An agent is a walking tank when equipped with heavy weaponry."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconWeaponHeavy'
cost(0)=1350
cost(1)=2700
cost(2)=4500
LevelValues(1)=-0.100000
LevelValues(2)=-0.250000
LevelValues(3)=-0.500000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkillWeaponLowTech.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=2000
mpCost2=2000
mpCost3=2000
mpLevel0=-0.100000
mpLevel1=-0.250000
mpLevel2=-0.370000
mpLevel3=-0.500000
SkillName="Weapons: Low-Tech"
Description="The use of melee weapons such as knives, throwing knives, swords, pepper guns, and prods.|n|nUNTRAINED: An agent can use melee weaponry.|n|nTRAINED: Accuracy, damage, and rate of attack all increase slightly.|n|nADVANCED: Accuracy, damage, and rate of attack all increase moderately.|n|nMASTER: An agent can render most opponents unconscious or dead with a single blow."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconWeaponLowTech'
cost(0)=1350
cost(1)=2700
cost(2)=4500
LevelValues(1)=-0.100000
LevelValues(2)=-0.250000
LevelValues(3)=-0.500000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkillWeaponPistol.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=2000
mpCost2=2000
mpCost3=2000
mpLevel0=-0.100000
mpLevel1=-0.250000
mpLevel2=-0.370000
mpLevel3=-0.500000
SkillName="Weapons: Pistol"
Description="The use of hand-held weapons, including the standard 10mm pistol, its stealth variant, and the mini-crossbow.|n|nUNTRAINED: An agent can use pistols.|n|nTRAINED: Accuracy and damage increases slightly, while reloading is faster.|n|nADVANCED: Accuracy and damage increases moderately, while reloading is even more rapid.|n|nMASTER: An agent is lethally precise with pistols."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconWeaponPistol'
cost(0)=1575
cost(1)=3150
cost(2)=5250
LevelValues(1)=-0.100000
LevelValues(2)=-0.250000
LevelValues(3)=-0.500000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode == NM_Standalone )
CurrentLevel = 1;

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkillWeaponRifle.uc (extends Skill)

var int mpCost1;
var int mpCost2;
var int mpCost3;
var float mpLevel0;
var float mpLevel1;
var float mpLevel2;
var float mpLevel3;
mpCost1=2000
mpCost2=2000
mpCost3=2000
mpLevel0=-0.100000
mpLevel1=-0.250000
mpLevel2=-0.370000
mpLevel3=-0.500000
SkillName="Weapons: Rifle"
Description="The use of rifles, including assault rifles, sniper rifles, and shotguns.|n|nUNTRAINED: An agent can use rifles.|n|nTRAINED: Accuracy and damage increases slightly, while reloading is faster.|n|nADVANCED: Accuracy and damage increases moderately, while reloading is even more rapid.|n|nMASTER: An agent can take down a target a mile away with one shot."
SkillIcon=Texture'DeusExUI.UserInterface.SkillIconWeaponRifle'
cost(0)=1575
cost(1)=3150
cost(2)=5250
LevelValues(1)=-0.100000
LevelValues(2)=-0.250000
LevelValues(3)=-0.500000

PreBeginPlay


Super.PreBeginPlay();

if ( Level.NetMode != NM_Standalone )
{
cost[0] = mpCost1;
cost[1] = mpCost2;
cost[2] = mpCost3;
LevelValues[0] = mpLevel0;
LevelValues[1] = mpLevel1;
LevelValues[2] = mpLevel2;
LevelValues[3] = mpLevel3;
}




SkilledTool.uc (extends DeusExPickup)

var() sound useSound;
var bool bBeingUsed;
CountLabel="Uses:"

BringUp


if (!IsInState('Idle'))
GotoState('Idle');

PickupFunction (Pawn Other)


GotoState('Idle2');

PlayIdleAnim


local float rnd;


rnd = FRand();

if (rnd < 0.1)
PlayAnim('Idle1');
else if (rnd < 0.2)
PlayAnim('Idle2');
else if (rnd < 0.3)
PlayAnim('Idle3');

PlayUseAnim


if (!IsInState('UseIt'))
GotoState('UseIt');

PreBeginPlay


Super.PreBeginPlay();

// Decrease the volume and radius for mp
if ( Level.NetMode != NM_Standalone )
{
SoundVolume = 96;
SoundRadius = 16;
}

PutDown

StopUseAnim


if (IsInState('UseIt'))
GotoState('StopIt');

Timer


PlayIdleAnim();




SmokeTrail.uc (extends Effects)

var() float RiseRate;
var() bool bGravity;
var float OrigLifeSpan;
var float OrigScale;
var vector OrigVel;
var bool bScale;
var bool bFade;
var bool bFrozen;
RiseRate=2.000000
bScale=True
bFade=True
Physics=PHYS_Projectile
LifeSpan=1.000000
DrawType=DT_Sprite
Style=STY_Translucent
Texture=FireTexture'Effects.Smoke.SmokePuff1'
DrawScale=0.100000

BeginState


Super.BeginState();

OrigScale = DrawScale;
OrigVel = Velocity;
OrigLifeSpan = LifeSpan;

Tick (float deltaTime)


// if we are frozen, don't update
if (bFrozen && (Owner != None))
{
LifeSpan += deltaTime;
return;
}

Velocity.X = OrigVel.X + 2 - FRand() * 5;
Velocity.Y = OrigVel.Y + 2 - FRand() * 5;

if (bGravity)
Velocity.Z += Region.Zone.ZoneGravity.Z * deltaTime * 0.2;
else
Velocity.Z = OrigVel.Z + (RiseRate * (OrigLifeSpan - LifeSpan)) * (FRand() * 0.2 + 0.9);

if (bScale)
{
if ( Level.NetMode != NM_Standalone )
DrawScale = FClamp(OrigScale * (1.0 + (OrigLifeSpan - LifeSpan)), 0.4, 4.0);
else
DrawScale = FClamp(OrigScale * (1.0 + (OrigLifeSpan - LifeSpan)), 0.01, 4.0);
}
if (bFade)
ScaleGlow = LifeSpan / OrigLifeSpan; // this actually sets the alpha from 1.0 to 0.0




Smuggler.uc (extends HumanThug)

CarcassType=Class'DeusEx.SmugglerCarcass'
WalkingSpeed=0.213333
BaseAssHeight=-23.000000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponPistol')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo10mm',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCrowbar')
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SmugglerTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SmugglerTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SmugglerTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SmugglerTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.SmugglerTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex1'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Smuggler"
FamiliarName="Smuggler"
UnfamiliarName="Smuggler"



SmugglerCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SmugglerTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SmugglerTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SmugglerTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.SmugglerTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.SmugglerTex2'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex1'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex1'
CollisionRadius=40.000000



Sodacan.uc (extends DeusExPickup)

maxCopies=10
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Soda"
ItemArticle="some"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.Sodacan'
PickupViewMesh=LodMesh'DeusExItems.Sodacan'
ThirdPersonMesh=LodMesh'DeusExItems.Sodacan'
LandSound=Sound'DeusExSounds.Generic.MetalHit1'
Icon=Texture'DeusExUI.Icons.BeltIconSodaCan'
largeIcon=Texture'DeusExUI.Icons.LargeIconSodaCan'
largeIconWidth=24
largeIconHeight=45
Description="The can is blank except for the phrase 'PRODUCT PLACEMENT HERE.' It is unclear whether this is a name or an invitation."
beltDescription="SODA"
Mesh=LodMesh'DeusExItems.Sodacan'
CollisionRadius=3.000000
CollisionHeight=4.500000
Mass=5.000000
Buoyancy=3.000000

Activate


// can't turn it off

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
player.HealPlayer(2, False);

PlaySound(sound'MaleBurp');
UseOnce();




Soldier.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.SoldierCarcass'
WalkingSpeed=0.296000
walkAnimMult=0.780000
GroundSpeed=200.000000
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SoldierTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SoldierTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SoldierTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SoldierTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.SoldierTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Soldier"
FamiliarName="Soldier"
UnfamiliarName="Soldier"



SoldierCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SoldierTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.SoldierTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.SoldierTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SoldierTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.SoldierTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



SoyFood.uc (extends DeusExPickup)

maxCopies=10
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Soy Food"
ItemArticle="some"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.SoyFood'
PickupViewMesh=LodMesh'DeusExItems.SoyFood'
ThirdPersonMesh=LodMesh'DeusExItems.SoyFood'
Icon=Texture'DeusExUI.Icons.BeltIconSoyFood'
largeIcon=Texture'DeusExUI.Icons.LargeIconSoyFood'
largeIconWidth=42
largeIconHeight=46
Description="Fine print: 'Seasoned with nanoscale mechanochemical generators, this TSP (textured soy protein) not only tastes good but also self-heats when its package is opened.'"
beltDescription="SOY FOOD"
Mesh=LodMesh'DeusExItems.SoyFood'
CollisionRadius=8.000000
CollisionHeight=0.980000
Mass=3.000000
Buoyancy=4.000000

Activate


// can't turn it off

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
player.HealPlayer(5, False);

UseOnce();




Spark.uc (extends Effects)

var Rotator rot;
bNetOptional=True
LifeSpan=0.250000
DrawType=DT_Mesh
Style=STY_Translucent
Skin=FireTexture'Effects.Fire.SparkFX1'
Mesh=LodMesh'DeusExItems.FlatFX'
DrawScale=0.100000
bUnlit=True
bCollideWorld=True
bBounce=True
bFixedRotationDir=True

BeginState


Velocity = vect(0,0,0);
rot = Rotation;
rot.Roll += FRand() * 65535;
SetRotation(rot);




SpawnPoint.uc (extends NavigationPoint)

bDirectional=True
Texture=Texture'Engine.S_Flag'



SphereEffect.uc (extends Effects)

var float size;
size=5.000000
LifeSpan=0.500000
DrawType=DT_Mesh
Style=STY_Translucent
Mesh=LodMesh'DeusExItems.SphereEffect'
bUnlit=True

Tick (float deltaTime)


DrawScale = 3.0 * size * (Default.LifeSpan - LifeSpan) / Default.LifeSpan;
ScaleGlow = 2.0 * (LifeSpan / Default.LifeSpan);




SpiderBot.uc (extends Robot)

EMPHitPoints=100
maxRange=1400.000000
WalkingSpeed=1.000000
bEmitDistress=True
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponSpiderBot')
InitialInventory(1)=(Inventory=Class'DeusEx.AmmoBattery',Count=99)
WalkSound=Sound'DeusExSounds.Robot.SpiderBotWalk'
GroundSpeed=80.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
Health=400
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.SpiderBot'
CollisionRadius=111.930000
CollisionHeight=50.790001
Mass=1000.000000
Buoyancy=100.000000
BindName="SpiderBot"
FamiliarName="SpiderBot"
UnfamiliarName="SpiderBot"



SpiderBot2.uc (extends Robot)

EMPHitPoints=25
maxRange=640.000000
MinRange=200.000000
WalkingSpeed=1.000000
bEmitDistress=True
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponSpiderBot2')
InitialInventory(1)=(Inventory=Class'DeusEx.AmmoBattery',Count=99)
WalkSound=Sound'DeusExSounds.Robot.SpiderBot2Walk'
GroundSpeed=300.000000
WaterSpeed=50.000000
AirSpeed=144.000000
AccelRate=500.000000
Health=80
UnderWaterTime=20.000000
AttitudeToPlayer=ATTITUDE_Ignore
DrawType=DT_Mesh
Mesh=LodMesh'DeusExCharacters.SpiderBot2'
CollisionRadius=33.580002
CollisionHeight=15.240000
Mass=200.000000
Buoyancy=50.000000
BindName="MiniSpiderBot"
FamiliarName="Mini-SpiderBot"
UnfamiliarName="Mini-SpiderBot"



SpinningLogoWindow.uc (extends Window)

var Font logoFont;
var Int dxLogoFrame;
var Float dxLogoTimer;
var Int dxLogoMaxFrames;
var Float colorTimer;
var Int colorValue;
var float gravity;
var float verticalDir;
var float horizontalDir;
var Color colLogo;
logoFont=Font'DeusExUI.FontSpinningDX'
dxLogoTimer=0.100000
dxLogoMaxFrames=48
colorTimer=0.100000
gravity=120.000000
horizontalDir=160.000000
colLogo=(R=255,G=255,B=255)

DrawWindow (GC gc)


gc.SetFont(logoFont);
gc.SetTextColor(colLogo);
gc.DrawText(0, 0, 32, 32, Chr(Asc("0") + dxLogoFrame));

InitWindow


Super.InitWindow();

SetSize(32, 32);

colorValue = Rand(256);

bTickEnabled = True;

Tick (float deltaTime)


local float newX, newY;
local float loss;
local float r, g, b;
local float fColorValue;


dxLogoTimer -= deltaTime;

if (dxLogoTimer < 0.0)
{
dxLogoTimer = Default.dxLogoTimer;
dxLogoFrame = ((dxLogoFrame + 1) % dxLogoMaxFrames);
}

colorTimer -= deltaTime;

if (colorTimer < 0.0)
{
colorTimer = Default.colorTimer;
colorValue = ((colorValue + 1) % 256);
fColorValue = (Float(colorValue) / 256.0);

HSLToRGB(fColorValue, 0.7, 0.7, r, g, b);

colLogo.r = Int(r * 256) - 1;
colLogo.g = Int(g * 256) - 1;
colLogo.b = Int(b * 256) - 1;
}

// Now update the location
// (1.0=perfectly elastic, <1.0=lossy, >1.0=*increases* energy w/each bounce)

loss = 1.0;

newX = x + horizontalDir * deltaTime;

if (newX > winParent.width-width)
{
newX = 2*(winParent.width-width) - newX;
horizontalDir = -horizontalDir;
}
else if (newX < 0)
{
newX = -newX;
horizontalDir = -horizontalDir;
}

newY = y + verticalDir * deltaTime;

if (newY > winParent.height-height)
{
newY = 2*(winParent.height-height) - newY;
verticalDir = -(verticalDir*loss);
}
else if (newY < 0)
{
newY = -newY;
verticalDir = -(verticalDir*loss);
}

verticalDir += gravity * deltaTime;

SetPos(newX, newY);




SpyDrone.uc (extends ThrownProjectile)

elasticity=0.200000
fuseLength=0.000000
proxRadius=128.000000
bHighlight=False
bBlood=False
bDebris=False
blastRadius=128.000000
DamageType=EMP
bEmitDanger=False
ItemName="Remote Spy Drone"
MaxSpeed=0.000000
Damage=20.000000
ImpactSound=Sound'DeusExSounds.Generic.SmallExplosion2'
Physics=PHYS_Projectile
RemoteRole=ROLE_DumbProxy
LifeSpan=0.000000
Mesh=LodMesh'DeusExCharacters.SpyDrone'
SoundRadius=24
SoundVolume=192
AmbientSound=Sound'DeusExSounds.Augmentation.AugDroneLoop'
CollisionRadius=13.000000
CollisionHeight=2.760000
Mass=10.000000
Buoyancy=2.000000

BeginPlay


// do nothing

Destroyed


if ( DeusExPlayer(Owner) != None )
DeusExPlayer(Owner).aDrone = None;

Super.Destroyed();

HitWall (vector HitNormal, actor HitWall)


// do nothing

ProcessTouch (Actor Other, Vector HitLocation)


// do nothing

TakeDamage (int Damage, Pawn instigatedBy, Vector HitLocation, Vector Momentum, name damageType)


// fall to the ground if EMP'ed
if ((DamageType == 'EMP') && !bDisabled)
{
SetPhysics(PHYS_Falling);
bBounce = True;
LifeSpan = 10.0;
}

if ( Level.NetMode != NM_Standalone )
{
if ( DeusExPlayer(Owner) != None )
DeusExPlayer(Owner).ForceDroneOff();
else
log("Warning:Drone with no owner?" );
}
Super.TakeDamage(Damage, instigatedBy, HitLocation, Momentum, damageType);

Tick (float deltaTime)


// do nothing




StantonDowd.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.StantonDowdCarcass'
WalkingSpeed=0.213333
bImportant=True
bInvincible=True
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.StantonDowdTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.StantonDowdTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.StantonDowdTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.StantonDowdTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.StantonDowdTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="StantonDowd"
FamiliarName="Stanton Dowd"
UnfamiliarName="Stanton Dowd"



StantonDowdCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.StantonDowdTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.StantonDowdTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.StantonDowdTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.StantonDowdTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.StantonDowdTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



StaticWindow.uc (extends Window)

var Float lineInterval;
var Float lastLine;
var int currentLinePosY;
var Bool bLinePauseDelay;
var Bool bLineVisible;
var Float linePauseDelay;
lineInterval=0.020000
currentLinePosY=-6
bLineVisible=True
linePauseDelay=1.000000

DrawWindow (GC gc)


// First draw the static
gc.SetStyle(DSTY_Translucent);
gc.DrawPattern(0, 0, width, height, rand(128), rand(128), Texture'Static');

// Now draw the line
if (bLineVisible)
{
gc.SetStyle(DSTY_Modulated);
gc.DrawPattern(0, currentLinePosY, width, 6, 0, 0, Texture'StaticLine');
}

InitWindow


Super.InitWindow();

// 20% chance that the line won't be visible
bLineVisible = (FRand() > 0.20);

Hide();

RandomizeStatic


lineInterval = (FRand() / 15);
linePauseDelay = (FRand() / 2) + 0.75;
currentLinePosY = (Rand(hardcodedHeight) - 6);

Tick (float deltaSeconds)


lastLine += deltaSeconds;

if (bLinePauseDelay)
{
if (lastLine > linePauseDelay)
{
bLinePauseDelay = False;
lastLine = 0.0;
}
}
else
{
if (lastLine > LineInterval)
{
lastLine = 0.0;

currentLinePosY += 1;

if (currentLinePosY > Height)
{
currentLinePosY = -6;
bLinePauseDelay = True;
}
}
}

VisibilityChanged (bool bNewVisibility)


bTickEnabled = (bNewVisibility && bLineVisible);




StatueLion.uc (extends OutdoorThings)

Mesh=LodMesh'DeusExDeco.StatueLion'
CollisionRadius=104.000000
CollisionHeight=81.300003
Mass=2000.000000
Buoyancy=500.000000



SubwayControlPanel.uc (extends DeusExDecoration)

bInvincible=True
ItemName="Subway Control Panel"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.SubwayControlPanel'
SoundRadius=8
SoundVolume=255
SoundPitch=72
AmbientSound=Sound'DeusExSounds.Generic.ElectronicsHum'
CollisionRadius=6.000000
CollisionHeight=8.400000
Mass=40.000000
Buoyancy=30.000000



SuperBall.uc (extends DeusExFragment)

numFragmentTypes=1
elasticity=1.000000
LifeSpan=0.000000
bUnlit=True
CollisionRadius=1.000000
CollisionHeight=1.000000
bCollideActors=True

BeginState


local DeusExPlayer P;


Super.BeginState();

foreach AllActors(class'DeusExPlayer', P)
if (P != None)
break;

Velocity = Vector(P.ViewRotation) * 300 + vect(0,0,200) + VRand() * 20;
RotationRate = RotRand(True);

HitWall (vector HitNormal, actor HitWall)


Super.HitWall(HitNormal, HitWall);

Velocity += vect(0.5, 0.5, 0.5) - VRand();
bRotateToDesired = False;
bFixedRotationDir = True;
RotationRate = RotRand(True);




Switch1.uc (extends DeusExDecoration)

var bool bOn;
bInvincible=True
ItemName="Switch"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.Switch1'
CollisionRadius=2.630000
CollisionHeight=2.970000
Mass=10.000000
Buoyancy=12.000000

Frob (Actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

if (bOn)
{
PlaySound(sound'Switch4ClickOff');
PlayAnim('Off');
}
else
{
PlaySound(sound'Switch4ClickOn');
PlayAnim('On');
}

bOn = !bOn;




Switch2.uc (extends DeusExDecoration)

var bool bOn;
bInvincible=True
ItemName="Switch"
bPushable=False
Physics=PHYS_None
Skin=Texture'DeusExDeco.Skins.Switch1Tex2'
Mesh=LodMesh'DeusExDeco.Switch1'
DrawScale=2.000000
CollisionRadius=5.260000
CollisionHeight=5.940000
Mass=10.000000
Buoyancy=12.000000

Frob (Actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

if (bOn)
{
PlaySound(sound'Switch4ClickOff');
PlayAnim('Off');
}
else
{
PlaySound(sound'Switch4ClickOn');
PlayAnim('On');
}

bOn = !bOn;




TAD.uc (extends ElectronicDevices)

var() float beepInterval;
var() sound beepSound;
var HighLight light;
var bool bOn;
beepInterval=2.000000
beepSound=Sound'DeusExSounds.Generic.Beep5'
ItemName="Telephone Answering Machine"
Mesh=LodMesh'DeusExDeco.TAD'
CollisionRadius=7.400000
CollisionHeight=2.130000
Mass=10.000000
Buoyancy=5.000000

PostBeginPlay


Super.PostBeginPlay();

SetTimer(beepInterval*0.5, True);

Timer


local DeusExPlayer player;


player = DeusExPlayer(GetPlayerPawn());
if (player != None)
{
if (light == None)
{
light = Spawn(class'HighLight', Self,, Location+vect(0,0,32));
light.LightType = LT_None;
light.LightBrightness = 128;
light.LightHue = 0;
light.LightSaturation = 16;
}

if (player.GetActiveConversation(Self, IM_Frob) != None)
{
// beep periodically
if (!IsInState('Conversation'))
{
bOn = !bOn;
if (bOn)
{
PlaySound(beepSound, SLOT_Misc,,, 512);
if (light != None)
light.LightType = LT_Steady;
Skin = Texture'TADTex2';
}
else
{
if (light != None)
light.LightType = LT_None;
Skin = Texture'TADTex1';
}
}
else
{
if (light != None)
light.LightType = LT_None;
Skin = Texture'TADTex1';
}
}
else
{
// turn off the light
if (light != None)
light.Destroy();
Skin = Texture'TADTex1';
SetTimer(0.1, False);
}
}




TeamDMGame.uc (extends DeusExMPGame)

var int TeamScore[2];
var localized String EnemiesString, AlliesString, VictoryConString1, VictoryConString2, TimeLimitString1, TimeLimitString2;
var localized String TeamScoreString;
var ScoreElement teamSE[32]; // Local array to keep track of team lists
EnemiesString="Enemies"
AlliesString="Allies"
VictoryConString1="Objective: First team that reaches "
VictoryConString2=" kills wins the match."
TimeLimitString1="Objective: Score the most kills before the clock ( "
TimeLimitString2=" ) runs out!"
TeamScoreString=" Team Score:"
SkillsTotal=5000
SkillsAvail=5000
SkillsPerKill=0
InitialAugs=0
AugsPerKill=0
bAutoInstall=False
bTeamGame=True
DefaultPlayerClass=Class'DeusEx.Mpunatco'

ApproveTeam (int CheckTeam) -> bool


if (CheckTeam == TEAM_UNATCO)
return true;
if (CheckTeam == TEAM_NSF)
return true;
if (CheckTeam == TEAM_AUTO)
return true;

return false;

ArePlayersAllied (DeusExPlayer FirstPlayer, DeusExPlayer SecondPlayer) -> bool


if ((FirstPlayer == None) || (SecondPlayer == None))
return false;
return (FirstPlayer.PlayerReplicationInfo.team == SecondPlayer.PlayerReplicationInfo.team);

CalcTeamScores


local DeusExPlayer curPlayer;
local Pawn curPawn;


TeamScore[TEAM_NSF] = 0;
TeamScore[TEAM_UNATCO] = 0;

// This only happens once per kill on the server
curPawn = Level.PawnList;
while ( curPawn != None )
{
if ( curPawn.IsA('DeusExPlayer') )
{
if ( DeusExPlayer(curPawn).PlayerReplicationInfo.team == TEAM_NSF )
TeamScore[TEAM_NSF] += int(DeusExPlayer(curPawn).PlayerReplicationInfo.Score);
if ( DeusExPlayer(curPawn).PlayerReplicationInfo.team == TEAM_UNATCO )
TeamScore[TEAM_UNATCO] += int(DeusExPlayer(curPawn).PlayerReplicationInfo.Score);
}
curPawn = curPawn.nextPawn;
}

ChangeOption (out string Options, string OptionKey, string NewValue)


local string NewOptions;//new option string
local string CurOption;
local string CurKey;
local string CurValue;


NewOptions = "";

while (GrabOption(Options,CurOption))
{
GetKeyValue(CurOption, CurKey, CurValue);
if (CurKey ~= OptionKey)
CurValue = NewValue;
NewOptions = NewOptions $ "?" $ CurKey $ "=" $ CurValue;
}

Options = NewOptions;

ChangeTeam (Pawn PawnToChange, int NewTeam) -> bool


local int iSkin;
local int CurTeam;
local DeusExPlayer PlayerToChange;


if (!ApproveTeam(NewTeam))
NewTeam = TEAM_AUTO;

//DEUS_EX AMSD Autoteam midmatch shouldn't change my team.
if (NewTeam == TEAM_AUTO)
{
if (PlayerPawn(PawnToChange) != None)
{
CurTeam = PlayerPawn(PawnToChange).PlayerReplicationInfo.Team;
NewTeam = CurTeam;
}
else
return false;
}

if (!Super.ChangeTeam(PawnToChange, NewTeam))
return false;

PlayerToChange = DeusExPlayer(PawnToChange);
if (PlayerToChange == None)
return false;

if (NewTeam == TEAM_UNATCO)
{
for (iSkin = 0; iSkin < ArrayCount(PlayerToChange.MultiSkins); iSkin++)
{
PlayerToChange.MultiSkins[iSkin] = class'mpunatco'.Default.MultiSkins[iSkin];
}
PlayerToChange.CarcassType = class'mpunatco'.Default.CarcassType;
PlayerToChange.Mesh = class'mpunatco'.Default.Mesh;
}
else if (NewTeam == TEAM_NSF)
{
for (iSkin = 0; iSkin < ArrayCount(PlayerToChange.MultiSkins); iSkin++)
{
PlayerToChange.MultiSkins[iSkin] = class'mpnsf'.Default.MultiSkins[iSkin];
}
PlayerToChange.CarcassType = class'mpnsf'.Default.CarcassType;
PlayerToChange.Mesh = class'mpnsf'.Default.Mesh;
}
else
{
return false;
}

return true;

CheckVictoryConditions (Pawn Killer, Pawn Killee, String Method) -> bool


local float timeLimit;


CalcTeamScores();

if ( VictoryCondition ~= "Frags" )
{
if (( TeamScore[TEAM_UNATCO] == ScoreToWin-(ScoreToWin/5)) && ( ScoreToWin >= 10 ))
NotifyGameStatus( ScoreToWin/5, TeamUnatcoString, False, False );
if (( TeamScore[TEAM_UNATCO] == ScoreToWin - 1 ) && (ScoreTowin >= 2 ))
NotifyGameStatus( 1, TeamUnatcoString, False, True );
if (( TeamScore[TEAM_NSF] == ScoreToWin-(ScoreToWin/5)) && ( ScoreToWin >= 10 ))
NotifyGameStatus( ScoreToWin/5, TeamNsfString, False, False );
if (( TeamScore[TEAM_NSF] == ScoreToWin-1 ) && (ScoreTowin >= 2 ))
NotifyGameStatus( 1, TeamNsfString, False, True );

if ( TeamScore[TEAM_UNATCO] >= ScoreToWin )
{
TeamHasWon( TEAM_UNATCO, Killer, Killee, Method );
return true;
}
if ( TeamScore[TEAM_NSF] >= ScoreToWin )
{
TeamHasWon( TEAM_NSF, Killer, Killee, Method );
return true;
}
}
else if ( VictoryCondition ~= "Time" )
{
timeLimit = float(ScoreToWin)*60.0;

if (( Level.Timeseconds >= (timeLimit-NotifyMinutes*60.0) ) && ( timeLimit >= NotifyMinutes*60.0*2.0 ))
{
if ( TeamScore[TEAM_UNATCO] > TeamScore[TEAM_NSF] )
NotifyGameStatus( int(NotifyMinutes), TeamUnatcoString, True, True );
else if ( TeamScore[TEAM_UNATCO] == TeamScore[TEAM_NSF] )
NotifyGameStatus( int(NotifyMinutes), "Tied", True, True );
else
NotifyGameStatus( int(NotifyMinutes), TeamNsfString, True, True );
}

if ( Level.Timeseconds >= timeLimit )
{
if ( TeamScore[TEAM_UNATCO] > TeamScore[TEAM_NSF] )
{
TeamHasWon( TEAM_UNATCO, Killer, Killee, Method );
return true;
}
else if ( TeamScore[TEAM_UNATCO] < TeamScore[TEAM_NSF] )
{
TeamHasWon( TEAM_NSF, Killer, Killee, Method );
return true;
}
else
{
TeamHasWon( TEAM_DRAW, Killer, Killee, Method );
return true;
}
}
}
else
log( "Warning: Unknown victory type:"$VictoryCondition$" " );

return false;

EvaluatePlayerStart (Pawn Player, PlayerStart PointToEvaluate, optional byte InTeam) -> float


local bool bTooClose;
local DeusExPlayer OtherPlayer;
local Pawn CurPawn;
local float Dist;
local float Cost;
local float CumulativeDist;


bTooClose = False;

if (PointToEvaluate.bNonTeamOnlyStart)
{
return -100000;
}

//DEUS_EX AMSD Small random factor.
CumulativeDist = FRand();

for (CurPawn = Level.PawnList; CurPawn != None; CurPawn = CurPawn.NextPawn)
{
OtherPlayer = DeusExPlayer(CurPawn);
if ((OtherPlayer != None) && (OtherPlayer != Player))
{
//Get Dist
Dist = VSize(OtherPlayer.Location - PointToEvaluate.Location);

//Do a quick distance check
if (Dist < 100.0)
{
bTooClose = TRUE;
}

//Make it non zero
Dist = Dist + 0.1;
Cost = 0;

if (dist < 200)
cost = 300;
else if (dist < 400)
cost = 250;
else if (dist < 800)
cost = 175;
else if (dist < 1600)
cost = 100;
else if (dist < 3200)
cost = 25;
else
cost = 0;
//Cost = 10000/Dist;

//Now someone close to you has a really high Dist, and someone far away has a really low dist.
//This should bias away from putting you right next to someone.


//Subract distances of opponents, add distance of friends.
//If first spawn, just put you someplace.
if ( ((DeusExPlayer(Player) != None) && (!ArePlayersAllied(DeusExPlayer(Player),OtherPlayer))) ||
((InTeam != 255) && (InTeam != OtherPlayer.PlayerReplicationInfo.Team)) )
{
CumulativeDist = CumulativeDist - 5*Cost;
}
else
{
CumulativeDist = CumulativeDist + Cost;
}
}
}

if (bTooClose)
{
return -100000;
}
else
{
return CumulativeDist;
}

GameOver


Super.GameOver();

GetAutoTeam -> int


local int NumUNATCO;
local int NumNSF;
local int CurTeam;
local Pawn CurPawn;


NumUNATCO = 0;
NumNSF = 0;

for (CurPawn = Level.Pawnlist; CurPawn != None; CurPawn = CurPawn.NextPawn)
{
if ((PlayerPawn(CurPawn) != None) && (PlayerPawn(CurPawn).PlayerReplicationInfo != None))
{

CurTeam = PlayerPawn(CurPawn).PlayerReplicationInfo.Team;
if (CurTeam == TEAM_UNATCO)
{
NumUNATCO++;
}
else if (CurTeam == TEAM_NSF)
{
NumNSF++;
}
}
}

if (NumUNATCO < NumNSF)
return TEAM_UNATCO;
else if (NumUNATCO > NumNSF)
return TEAM_NSF;
else
return TEAM_UNATCO;

GetTeamList (DeusExPlayer player, bool Allies) -> int


local int i, numTeamList;


if ( player == None )
return( 0 );

numTeamList = 0;

for ( i = 0; i < scorePlayers; i++ )
{
if ( (Allies && (scoreArray[i].Team == player.PlayerReplicationInfo.Team) ) ||
(!Allies && (scoreArray[i].Team != player.PlayerReplicationInfo.Team) ) )
{
teamSE[numTeamList] = scoreArray[i];
numTeamList += 1;
}
}
return( numTeamList );

LocalGetTeamTotals (int teamSECnt, out float score, out float deaths, out float streak)


local int i;


score = 0; deaths = 0; streak = 0;
for ( i = 0; i < teamSECnt; i++ )
{
score += teamSE[i].Score;
deaths += teamSE[i].Deaths;
streak += teamSE[i].Streak;
}

Login (string Portal, string Options, out string Error, class SpawnClass) -> PlayerPawn


local PlayerPawn newPlayer;
local int TeamOption;
local string StringTeamOption;


TeamOption = TEAM_AUTO;
if (HasOption(Options,"Team"))
{
StringTeamOption = ParseOption(Options,"Team");
if (StringTeamOption != "")
TeamOption = int(StringTeamOption);
}

if (!ApproveTeam(TeamOption))
TeamOption = TEAM_AUTO;

if (TeamOption == TEAM_AUTO)
TeamOption = GetAutoTeam();

if (TeamOption == TEAM_UNATCO)
SpawnClass = class'MPUnatco';
else if (TeamOption == TEAM_NSF)
SpawnClass = class'MPNSF';

ChangeOption(Options,"Team",string(TeamOption));

newPlayer = Super.Login(Portal, Options, Error, SpawnClass);

newPlayer.bAutoActivate = true;

return newPlayer;

PostLogin (playerpawn NewPlayer)


local DeusExPlayer DXPlayer;


DXPlayer = DeusExPlayer(NewPlayer);

// Set teams up if in a team game
SetTeam( DXPlayer );

Super.PostLogin(NewPlayer);

PreGameOver


Super.PreGameOver();

SetTeam (DeusExPlayer player)


if ( player.IsA('MPUnatco'))
{
player.PlayerReplicationInfo.Team = TEAM_UNATCO;
player.MultiplayerNotifyMsg( player.MPMSG_TeamUnatco );
}
else if ( player.IsA('MPNsf'))
{
player.PlayerReplicationInfo.Team = TEAM_NSF;
player.MultiplayerNotifyMsg( player.MPMSG_TeamNsf );
}
else
log( "Warning: Player:"$player$" has chosen an invalid team!" );

ShowTeamDMScoreboard (DeusExPlayer thisPlayer, GC gc, float screenWidth, float screenHeight)


local float yoffset, ystart, xlen, ylen, w, h, w2;
local bool bLocalPlayer;
local int i, allyCnt, enemyCnt, barLen;
local ScoreElement fakeSE;
local String str, teamStr;


if ( !thisPlayer.PlayerIsClient() )
return;

// Always use this font
gc.SetFont(Font'FontMenuSmall');
str = "TEST";
gc.GetTextExtent( 0, xlen, ylen, str );

// Refresh out local array
RefreshScoreArray( thisPlayer );

// Just allies
allyCnt = GetTeamList( thisPlayer, True );
SortTeamScores( allyCnt );

ystart = screenHeight * PlayerY;
yoffset = ystart;

// Headers
gc.SetTextColor( WhiteColor );
ShowVictoryConditions( gc, screenWidth, ystart, thisPlayer );
yoffset += (ylen * 2.0);
DrawHeaders( gc, screenWidth, yoffset );
yoffset += (ylen * 1.5);

if ( thisPlayer.PlayerReplicationInfo.team == TEAM_UNATCO )
teamStr = TeamUnatcoString;
else
teamStr = TeamNsfString;

// Allies
gc.SetTextColor( GreenColor );
fakeSE.PlayerName = AlliesString $ " (" $ teamStr $ ")";
LocalGetTeamTotals( allyCnt, fakeSE.score, fakeSE.deaths, fakeSE.streak );
DrawNameAndScore( gc, fakeSE, screenWidth, yoffset );
gc.GetTextExtent( 0, w, h, StreakString );
barLen = (screenWidth * StreakX + w)-(PlayerX*screenWidth);
gc.SetTileColorRGB(0,255,0);
gc.DrawBox( PlayerX * screenWidth, yoffset+h, barLen, 1, 0, 0, 1, Texture'Solid');
yoffset += ( h * 0.25 );
for ( i = 0; i < allyCnt; i++ )
{
bLocalPlayer = (teamSE[i].PlayerID == thisPlayer.PlayerReplicationInfo.PlayerID);
if ( bLocalPlayer )
gc.SetTextColor( GoldColor );
else
gc.SetTextColor( GreenColor );
yoffset += ylen;
DrawNameAndScore( gc, teamSE[i], screenWidth, yoffset );
}

yoffset += (ylen*2);

if ( thisPlayer.PlayerReplicationInfo.team == TEAM_UNATCO )
teamStr = TeamNsfString;
else
teamStr = TeamUnatcoString;

// Enemies
enemyCnt = GetTeamList( thisPlayer, False );
SortTeamScores( enemyCnt );
gc.SetTextColor( RedColor );
gc.GetTextExtent( 0, w, h, EnemiesString );
gc.DrawText( PlayerX * screenWidth, yoffset, w, h, EnemiesString );
fakeSE.PlayerName = EnemiesString $ " (" $ teamStr $ ")";
LocalGetTeamTotals( enemyCnt, fakeSE.score, fakeSE.deaths, fakeSE.streak );
DrawNameAndScore( gc, fakeSE, screenWidth, yoffset );
gc.SetTileColorRGB(255,0,0);
gc.DrawBox( PlayerX * screenWidth, yoffset+h, barLen, 1, 0, 0, 1, Texture'Solid');
yoffset += ( h * 0.25 );

for ( i = 0; i < enemyCnt; i++ )
{
yoffset += ylen;
DrawNameAndScore( gc, teamSE[i], screenWidth, yoffset );
}

ShowVictoryConditions (GC gc, float screenWidth, float yoffset, DeusExPlayer thisPlayer)


local String str, secStr;
local float x, y, w, h;
local int minutesLeft, secondsLeft, timeLeft;
local float ftimeLeft;


if ( VictoryCondition ~= "Frags" )
str = VictoryConString1 $ ScoreToWin $ VictoryConString2;
else if ( VictoryCondition ~= "Time" )
{
timeLeft = ScoreToWin * 60 - Level.Timeseconds - thisPlayer.ServerTimeDiff;
if ( timeLeft < 0 )
timeleft = 0;
minutesLeft = timeLeft/60;
ftimeLeft = float(timeLeft);
secondsLeft = int(ftimeLeft%60);
if ( secondsLeft < 10 )
secStr = "0" $ secondsLeft;
else
secStr = "" $ secondsLeft;

str = TimeLimitString1 $ minutesLeft $ ":" $ secStr $ TimeLimitString2;
}
else
log( "Warning: Unknown victory type:"$VictoryCondition$" " );

gc.GetTextExtent( 0, w, h, str );
x = (screenWidth * 0.5) - (w * 0.5);
gc.DrawText( x, yoffset, w, h, str );

SortTeamScores (int PlayerCount)


local ScoreElement tmpSE;
local int i, j, max;


for ( i = 0; i < PlayerCount-1; i++ )
{
max = i;
for ( j = i+1; j < PlayerCount; j++ )
{
if ( teamSE[j].Score > teamSE[max].Score )
max = j;
else if (( teamSE[j].Score == teamSE[max].Score) && (teamSE[j].Deaths < teamSE[max].Deaths))
max = j;
}
tmpSE = teamSE[max];
teamSE[max] = teamSE[i];
teamSE[i] = tmpSE;
}

TeamFinalCheckScores -> bool


local int i, nsfScore, unatcoScore;


nsfScore = 0;
unatcoScore = 0;
for ( i = 0; i < scorePlayers; i++ )
{
if ( scoreArray[i].team == TEAM_NSF )
nsfScore += (scoreArray[i].score);
else if ( scoreArray[i].team == TEAM_UNATCO )
unatcoScore += (scoreArray[i].score);
}
if ( (nsfScore >= ScoreToWin) || (unatcoScore >= ScoreToWin))
return True;
else
return False;

TeamHasWon (int team, Pawn Killer, Pawn Killee, String Method)


local Pawn curPawn;
local String str, killerStr, killeeStr;


PreGameOver();

killerStr = ""; killeeStr = "";
if (( Killer != None ) && ( Killee != None ))
{
killerStr = Killer.PlayerReplicationInfo.PlayerName;
killeeStr = Killee.PlayerReplicationInfo.PlayerName;
}

if ( team == TEAM_UNATCO )
str = TeamUnatcoString;
else
str = TeamNsfString;

curPawn = Level.PawnList;
while ( curPawn != None )
{
if ( curPawn.IsA('DeusExPlayer') )
{
DeusExPlayer(curPawn).ShowMultiplayerWin( str, team, killerStr, killeeStr, Method );
}
curPawn = curPawn.nextPawn;
}

GameOver();




TearGas.uc (extends Cloud)

DamageType=TearGas
maxDrawScale=2.000000
Texture=WetTexture'Effects.Smoke.Gas_Tear_A'



TechGoggles.uc (extends ChargedPickup)

LoopSound=Sound'DeusExSounds.Pickup.TechGogglesLoop'
ChargedIcon=Texture'DeusExUI.Icons.ChargedIconGoggles'
ExpireMessage="TechGoggles power supply used up"
ItemName="Tech Goggles"
ItemArticle="some"
PlayerViewOffset=(X=20.000000,Z=-6.000000)
PlayerViewMesh=LodMesh'DeusExItems.GogglesIR'
PickupViewMesh=LodMesh'DeusExItems.GogglesIR'
ThirdPersonMesh=LodMesh'DeusExItems.GogglesIR'
Charge=500
LandSound=Sound'DeusExSounds.Generic.PaperHit2'
Icon=Texture'DeusExUI.Icons.BeltIconTechGoggles'
largeIcon=Texture'DeusExUI.Icons.LargeIconTechGoggles'
largeIconWidth=49
largeIconHeight=36
Description="Tech goggles are used by many special ops forces throughout the world under a number of different brand names, but they all provide some form of portable light amplification in a disposable package."
beltDescription="GOGGLES"
Mesh=LodMesh'DeusExItems.GogglesIR'
CollisionRadius=8.000000
CollisionHeight=2.800000
Mass=10.000000
Buoyancy=5.000000

ChargedPickupBegin (DeusExPlayer Player)


Super.ChargedPickupBegin(Player);

DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount++;
UpdateHUDDisplay(Player);

ChargedPickupEnd (DeusExPlayer Player)


Super.ChargedPickupEnd(Player);

if (--DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount == 0)
DeusExRootWindow(Player.rootWindow).hud.augDisplay.bVisionActive = False;

UpdateHUDDisplay (DeusExPlayer Player)


if ((DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount == 0) && (IsActive()))
DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount++;

DeusExRootWindow(Player.rootWindow).hud.augDisplay.bVisionActive = True;
DeusExRootWindow(Player.rootWindow).hud.augDisplay.visionLevel = 0;
DeusExRootWindow(Player.rootWindow).hud.augDisplay.visionLevelValue = 0;




Terrorist.uc (extends HumanMilitary)

MinHealth=40.000000
CarcassType=Class'DeusEx.TerroristCarcass'
WalkingSpeed=0.296000
AvoidAccuracy=0.100000
CrouchRate=0.250000
SprintRate=0.250000
walkAnimMult=0.780000
GroundSpeed=200.000000
Health=75
HealthHead=75
HealthTorso=75
HealthLegLeft=75
HealthLegRight=75
HealthArmLeft=75
HealthArmRight=75
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TerroristTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TerroristTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TerroristTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TerroristTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TerroristTex0'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.GogglesTex1'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Terrorist"
FamiliarName="Terrorist"
UnfamiliarName="Terrorist"



TerroristCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TerroristTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TerroristTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TerroristTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TerroristTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TerroristTex0'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.GogglesTex1'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



TerroristCommander.uc (extends HumanThug)

CarcassType=Class'DeusEx.TerroristCommanderCarcass'
WalkingSpeed=0.213333
bImportant=True
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BartenderTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TrenchCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BartenderTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JuanLebedevTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.TrenchCoatTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="TerroristCommander"
FamiliarName="Terrorist Commander"
UnfamiliarName="Terrorist Commander"



TerroristCommanderCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.BartenderTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TrenchCoatTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(3)=Texture'DeusExCharacters.Skins.BartenderTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.JuanLebedevTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.TrenchCoatTex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



ThrownProjectile.uc (extends DeusExProjectile)

var() float Elasticity;
var() float fuseLength;
var() class FragmentClass;
var() bool bProximityTriggered;
var() float proxRadius;
var() bool bArmed;
var bool bFirstHit;
var float proxCheckTime;
var float beepTime;
var float skillTime;
var float skillAtSet;
var() bool bDisabled;
var() bool bHighlight; // should this object not highlight when focused?
var() float AISoundLevel; // sound level at which to alert AI (0.0 to 1.0)
var() bool bDamaged; // was this blown up via damage?
elasticity=0.500000
fuseLength=5.000000
FragmentClass=Class'DeusEx.Rockchip'
proxRadius=64.000000
bFirstHit=True
bHighlight=True
AISoundLevel=1.000000
bExplodes=True
bBlood=True
bDebris=True
blastRadius=512.000000
DamageType=exploded
ItemName="ERROR ThrownProjectile Default-Report as bug!"
ItemArticle="a"
ImpactSound=Sound'DeusExSounds.Generic.LargeExplosion1'
MiscSound=Sound'DeusExSounds.Generic.MetalBounce1'
Physics=PHYS_Falling
CollisionRadius=2.000000
CollisionHeight=2.000000
bBounce=True
bFixedRotationDir=True

BeginPlay


local DeusExPlayer aplayer;


Super.BeginPlay();

Velocity = Speed * Vector(Rotation);
RotationRate = RotRand(True);
SetTimer(fuseLength, False);
SetCollision(True, True, True);

// What team is the owner if in team game
if (( Level.NetMode != NM_Standalone ) && (Role == ROLE_Authority))
{
aplayer = DeusExPlayer(Owner);
if (( aplayer != None ) && ( TeamDMGame(aplayer.DXGame) != None ))
team = aplayer.PlayerReplicationInfo.team;

skillAtSet = aplayer.SkillSystem.GetSkillLevelValue(class'SkillDemolition');
}

// don't beep at the start of a level if we've been preplaced
if (Owner == None)
{
time = fuseLength;
bStuck = True;
}

Explode (vector HitLocation, vector HitNormal)


local ShockRing ring;
local DeusExPlayer player;
local float dist;


// flash the screen white based on how far away the explosion is
// player = DeusExPlayer(GetPlayerPawn());
// MBCODE: Reference projectile owner to get player
// because sever fails to get it the old way
player = DeusExPlayer(Owner);

dist = Abs(VSize(player.Location - Location));

// if you are at the same location, blind the player
if (dist ~= 0)
dist = 10.0;
else
dist = 2.0 * FClamp(blastRadius/dist, 0.0, 4.0);

if (damageType == 'EMP')
player.ClientFlash(dist, vect(0,200,1000));
else if (damageType == 'TearGas')
player.ClientFlash(dist, vect(0,1000,100));
else
player.ClientFlash(dist, vect(1000,1000,900));

//DEUS_EX AMSD Only do visual effects if client or if destroyed via damage (since the client can't detect that)
if ((Level.NetMode != NM_DedicatedServer) || (Role < ROLE_Authority) || bDamaged)
{
SpawnEffects(HitLocation, HitNormal, None);
DrawExplosionEffects(HitLocation, HitNormal);
}

if ((damageType=='TearGas') && (Role==ROLE_Authority))
SpawnTearGas();

PlayImpactSound();

if ( AISoundLevel > 0.0 )
AISendEvent('LoudNoise', EAITYPE_Audio, 2.0, AISoundLevel*blastRadius*16);

GotoState('Exploding');

Frob (Actor Frobber, Inventory frobWith)


// if the player frobs it and it's disabled, the player can grab it
if (bDisabled)
Super.Frob(Frobber, frobWith);
else if (bProximityTriggered && bArmed && (skillTime >= 0))
{
// if the player frobs it and has the demolition skill, disarm the explosive
PlaySound(sound'Beep4',SLOT_None,,, 1280, 0.5);
bDisabled = True;
}

HitWall (vector HitNormal, actor HitWall)


local Rotator rot;
local float volume;


Velocity = Elasticity*(( Velocity dot HitNormal ) * HitNormal * (-2.0) + Velocity); // Reflect off Wall w/damping
speed = VSize(Velocity);
if (bFirstHit && speed<400)
bFirstHit=False;
RotationRate = RotRand(True);
if ( (speed < 60) && (HitNormal.Z > 0.7) )
{
volume = 0.5+FRand()*0.5;
PlaySound(MiscSound, SLOT_None, volume,, 512, 0.85+FRand()*0.3);

// I know this is a little cheesy, but certain grenade types should
// not alert AIs unless they are really really close - CNN
if (AISoundLevel > 0.0)
AISendEvent('LoudNoise', EAITYPE_Audio, volume, AISoundLevel*256);
SetPhysics(PHYS_None, HitWall);
if (Physics == PHYS_None)
{
rot = Rotator(HitNormal);
rot.Yaw = Rand(65536);
SetRotation(rot);
bBounce = False;
bStuck = True;
}
}
else If (speed > 50)
{
PlaySound(MiscSound, SLOT_None, 0.5+FRand()*0.5,, 512, 0.85+FRand()*0.3);
}

PlayBeepSound (float Range, float Pitch, float volume)


if ( Level.NetMode != NM_Standalone )
PlaySound( sound'Beep4',SLOT_None, volume,, Range, Pitch );
else
PlaySound( sound'Beep4',SLOT_None,,, Range, Pitch );

PlayImpactSound


PlaySound(ImpactSound, SLOT_None, 2.0,, blastRadius*16);

ReEnable


bDisabled = False;

SpawnEffects (Vector HitLocation, Vector HitNormal, Actor Other)


local int i;
local SmokeTrail puff;
local TearGas gas;
local Fragment frag;
local ParticleGenerator gen;
local ProjectileGenerator projgen;
local vector loc;
local rotator rot;
local ExplosionLight light;
local DeusExDecal mark;
local AnimatedSprite expeffect;


rot.Pitch = 16384 + FRand() * 16384 - 8192;
rot.Yaw = FRand() * 65536;
rot.Roll = 0;

if ((damageType == 'Exploded') && bStuck)
{
gen = spawn(class'ParticleGenerator',,, HitLocation, rot);
if (gen != None)
{
//DEUS_EX AMSD Don't send this to clients unless really spawned server side.
if (bDamaged)
gen.RemoteRole = ROLE_SimulatedProxy;
else
gen.RemoteRole = ROLE_None;
gen.LifeSpan = FRand() * 10 + 10;
gen.CheckTime = 0.25;
gen.particleDrawScale = 0.4;
gen.RiseRate = 20.0;
gen.bRandomEject = True;
gen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
}
}

// don't draw damage art on destroyed movers
if (DeusExMover(Other) != None)
if (DeusExMover(Other).bDestroyed)
ExplosionDecal = None;

if (ExplosionDecal != None)
{
mark = DeusExDecal(Spawn(ExplosionDecal, Self,, HitLocation, Rotator(HitNormal)));
if (mark != None)
{
mark.DrawScale = FClamp(damage/30, 0.1, 3.0);
mark.ReattachDecal();
if (!bDamaged)
mark.RemoteRole = ROLE_None;
}
}

for (i=0; i {
if (FRand() < 0.9)
{
if (bDebris && bStuck)
{
frag = spawn(FragmentClass,,, HitLocation);
if (!bDamaged)
frag.RemoteRole = ROLE_None;
if (frag != None)
frag.CalcVelocity(VRand(), blastRadius);
}

loc = Location;
loc.X += FRand() * blastRadius - blastRadius * 0.5;
loc.Y += FRand() * blastRadius - blastRadius * 0.5;

if (damageType == 'Exploded')
{
puff = spawn(class'SmokeTrail',,, loc);
if (puff != None)
{
if (!bDamaged)
puff.RemoteRole = ROLE_None;
else
puff.RemoteRole = ROLE_SimulatedProxy;
puff.RiseRate = FRand() + 1;
puff.DrawScale = FRand() + 3.0;
puff.OrigScale = puff.DrawScale;
puff.LifeSpan = FRand() * 10 + 10;
puff.OrigLifeSpan = puff.LifeSpan;
}

light = Spawn(class'ExplosionLight',,, HitLocation);
if ((light != None) && (!bDamaged))
light.RemoteRole = ROLE_None;

if (FRand() < 0.5)
{
expeffect = spawn(class'ExplosionSmall',,, loc);
light.size = 2;
}
else
{
expeffect = spawn(class'ExplosionMedium',,, loc);
light.size = 4;
}
if ((expeffect != None) && (!bDamaged))
expeffect.RemoteRole = ROLE_None;
}
else if (damageType == 'EMP')
{
light = Spawn(class'ExplosionLight',,, HitLocation);
if (light != None)
{
if (!bDamaged)
light.RemoteRole = ROLE_None;
light.size = 6;
light.LightHue = 170;
light.LightSaturation = 64;
}
}
}
}

SpawnTearGas


local Vector loc;
local TearGas gas;
local int i;


if ( Role < ROLE_Authority )
return;

for (i=0; i {
if (FRand() < 0.9)
{
loc = Location;
loc.X += FRand() * blastRadius - blastRadius * 0.5;
loc.Y += FRand() * blastRadius - blastRadius * 0.5;
loc.Z += 32;
gas = spawn(class'TearGas', None,, loc);
if (gas != None)
{
gas.Velocity = vect(0,0,0);
gas.Acceleration = vect(0,0,0);
gas.DrawScale = FRand() * 0.5 + 2.0;
gas.LifeSpan = FRand() * 10 + 30;
if ( Level.NetMode != NM_Standalone )
gas.bFloating = False;
else
gas.bFloating = True;
gas.Instigator = Instigator;
}
}
}

TakeDamage (int Damage, Pawn instigatedBy, Vector HitLocation, Vector Momentum, name damageType)


local ParticleGenerator gen;


if ((DamageType == 'TearGas') || (DamageType == 'PoisonGas') || (DamageType == 'Radiation'))
return;

if (DamageType == 'NanoVirus')
return;

if ( Role == ROLE_Authority )
{
// EMP damage disables explosives
if (DamageType == 'EMP')
{
if (!bDisabled)
{
PlaySound(sound'EMPZap', SLOT_None,,, 1280);
bDisabled = True;
gen = Spawn(class'ParticleGenerator', Self,, Location, rot(16384,0,0));
if (gen != None)
{
gen.checkTime = 0.25;
gen.LifeSpan = 2;
gen.particleDrawScale = 0.3;
gen.bRandomEject = True;
gen.ejectSpeed = 10.0;
gen.bGravity = False;
gen.bParticlesUnlit = True;
gen.frequency = 0.5;
gen.riseRate = 10.0;
gen.spawnSound = Sound'Spark2';
gen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
gen.SetBase(Self);
}
}
return;
}
bDamaged = True;
}
Explode(Location, Vector(Rotation));

Tick (float deltaTime)


local ScriptedPawn P;
local DeusExPlayer Player;
local Vector dist, HitLocation, HitNormal;
local float blinkRate, mult, skillDiff;
local float proxRelevance;
local Pawn curPawn;
local bool pass;
local Actor HitActor;


time += deltaTime;

if ( Role == ROLE_Authority )
{
Super.Tick(deltaTime);

if (bDisabled)
return;

if ( (Owner == None) && ((Level.NetMode == NM_DedicatedServer) || (Level.NetMode == NM_ListenServer)) )
{
// Owner has logged out
bDisabled = True;
team = -1;
}

if (( Owner != None ) && (DeusExPlayer(Owner) != None ))
{
if ( TeamDMGame(DeusExPlayer(Owner).DXGame) != None )
{
// If they switched sides disable the grenade
if ( DeusExPlayer(Owner).PlayerReplicationInfo.team != team )
{
bDisabled = True;
team = -1;
}
}
}

// check for proximity
if (bProximityTriggered)
{
if (bArmed)
{
proxCheckTime += deltaTime;

// beep based on skill
if (skillTime != 0)
{
if (time > fuseLength)
{
if (skillTime % 0.3 > 0.25)
PlayBeepSound( 1280, 2.0, 3.0 );
}
}

// if we have been triggered, count down based on skill
if (skillTime > 0)
skillTime -= deltaTime;

// explode if time < 0
if (skillTime < 0)
{
bDoExplode = True;
bArmed = False;
}
// DC - new ugly way of doing it - old way was "if (proxCheckTime > 0.25)"
// new way: weight the check frequency based on distance from player
proxRelevance=DistanceFromPlayer/2000.0; // at 500 units it behaves as it did before
if (proxRelevance<0.25)
proxRelevance=0.25; // low bound 1/4
else if (proxRelevance>10.0)
proxRelevance=20.0; // high bound 30
else
proxRelevance=proxRelevance*2; // out past 1.0s, double the timing
if (proxCheckTime>proxRelevance)
{
proxCheckTime = 0;

// pre-placed explosives are only prox triggered by the player
if (Owner == None)
{
foreach RadiusActors(class'DeusExPlayer', Player, proxRadius*4)
{
// the owner won't set it off, either
if (Player != Owner)
{
dist = Player.Location - Location;
if (VSize(dist) < proxRadius)
if (skillTime == 0)
skillTime = FClamp(-20.0 * Player.SkillSystem.GetSkillLevelValue(class'SkillDemolition'), 1.0, 10.0);
}
}
}
else
{
// If in multiplayer, check other players
if (( Level.NetMode == NM_DedicatedServer) || ( Level.NetMode == NM_ListenServer))
{
curPawn = Level.PawnList;

while ( curPawn != None )
{
pass = False;

if ( curPawn.IsA('DeusExPlayer') )
{
Player = DeusExPlayer( curPawn );

// Pass on owner
if ( Player == Owner )
pass = True;
// Pass on team member
else if ( (TeamDMGame(Player.DXGame) != None) && (team == player.PlayerReplicationInfo.team) )
pass = True;
// Pass if radar transparency on
else if ( Player.AugmentationSystem.GetClassLevel( class'AugRadarTrans' ) == 3 )
pass = True;

// Finally, make sure we can see them (no exploding through thin walls)
if ( !pass )
{
// Only players we can see : changed this to Trace from FastTrace so doors are included
HitActor = Trace( HitLocation, HitNormal, Player.Location, Location, True );
if (( HitActor == None ) || (DeusExPlayer(HitActor) == Player))
{
}
else
pass = True;
}

if ( !pass )
{
dist = Player.Location - Location;
if ( VSize(dist) < proxRadius )
{
if (skillTime == 0)
{
skillDiff = -skillAtSet + Player.SkillSystem.GetSkillLevelValue(class'SkillDemolition');
if ( skillDiff >= 0.0 ) // Scale goes 1.0, 1.6, 2.8, 4.0
skillTime = FClamp( 1.0 + skillDiff * 6.0, 1.0, 2.5 );
else // Scale goes 1.0, 1.4, 2.2, 3.0
skillTime = FClamp( 1.0 + (-Player.SkillSystem.GetSkillLevelValue(class'SkillDemolition') * 4.0), 1.0, 3.0 );
}
}
}
}
curPawn = curPawn.nextPawn;
}
}
else // Only have scripted pawns set off promixity grenades in single player
{
foreach RadiusActors(class'ScriptedPawn', P, proxRadius*4)
{
// only "heavy" pawns will set this off
if ((P != None) && (P.Mass >= 40))
{
// the owner won't set it off, either
if (P != Owner)
{
dist = P.Location - Location;
if (VSize(dist) < proxRadius)
if (skillTime == 0)
skillTime = 1.0;
}
}
}
}
}
}
}
}

// beep faster as the time expires
beepTime += deltaTime;

if (fuseLength - time <= 0.75)
blinkRate = 0.1;
else if (fuseLength - time <= fuseLength * 0.5)
blinkRate = 0.3;
else
blinkRate = 0.5;

if (time < fuseLength)
{
if (beepTime > blinkRate)
{
beepTime = 0;
PlayBeepSound( 1280, 1.0, 0.5 );
}
}
}
if ( bDoExplode ) // Keep the simulated chain going
Explode(Location, Vector(Rotation));

Timer


if ( Role == ROLE_Authority )
{
if (bProximityTriggered)
bArmed = True;
else
{
if ( !bDisabled )
bDoExplode = True;
}
}
if ( bDoExplode )
Explode(Location, Vector(Rotation));

ZoneChange (ZoneInfo NewZone)


local float splashsize;
local actor splash;


if ( NewZone.bWaterZone )
{
Velocity = 0.2 * Velocity;
splashSize = 0.0005 * (250 - 0.5 * Velocity.Z);
if ( Level.NetMode != NM_DedicatedServer )
{
if ( NewZone.EntrySound != None )
PlaySound(NewZone.EntrySound, SLOT_None, splashSize);
if ( NewZone.EntryActor != None )
{
splash = Spawn(NewZone.EntryActor);
if ( splash != None )
splash.DrawScale = 4 * splashSize;
}
}
if (bFirstHit)
bFirstHit=False;

RotationRate = 0.2 * RotationRate;
}




ThugMale.uc (extends HumanThug)

CarcassType=Class'DeusEx.ThugMaleCarcass'
WalkingSpeed=0.213333
BaseAssHeight=-23.000000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponPistol')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo10mm',Count=6)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCrowbar')
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ThugMaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ThugMaleTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ThugMaleTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ThugMaleTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ThugMaleTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Thug"
FamiliarName="Thug"
UnfamiliarName="Thug"



ThugMale2.uc (extends HumanThug)

CarcassType=Class'DeusEx.ThugMale2Carcass'
WalkingSpeed=0.296000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponPistol')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo10mm',Count=6)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCrowbar')
walkAnimMult=0.800000
GroundSpeed=200.000000
Mesh=LodMesh'DeusExCharacters.GM_DressShirt'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ThugMale2Tex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ThugMale2Tex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ThugMale2Tex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ThugMale2Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="Thug"
FamiliarName="Thug"
UnfamiliarName="Thug"



ThugMale2Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ThugMale2Tex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ThugMale2Tex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ThugMale2Tex0'
MultiSkins(5)=Texture'DeusExCharacters.Skins.ThugMale2Tex1'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



ThugMale3.uc (extends HumanThug)

CarcassType=Class'DeusEx.ThugMale3Carcass'
WalkingSpeed=0.350000
walkAnimMult=0.750000
GroundSpeed=210.000000
Texture=Texture'DeusExItems.Skins.BlackMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_B'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ThugMale3Tex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ThugMale3Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ThugMale3Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ThugMale3Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ThugMale3Tex3'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="ThugMale3"
FamiliarName="Thug"
UnfamiliarName="Thug"



ThugMale3Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_DressShirt_B_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_DressShirt_B_CarcassC'
Texture=Texture'DeusExItems.Skins.BlackMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_DressShirt_B_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ThugMale3Tex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ThugMale3Tex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ThugMale3Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ThugMale3Tex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ThugMale3Tex3'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



ThugMaleCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.ThugMaleTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.ThugMaleTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.ThugMaleTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.ThugMaleTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.ThugMaleTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=40.000000



TiffanySavage.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.TiffanySavageCarcass'
WalkingSpeed=0.320000
bImportant=True
BaseAssHeight=-18.000000
walkAnimMult=0.650000
bIsFemale=True
GroundSpeed=120.000000
BaseEyeHeight=38.000000
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TiffanySavageTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TiffanySavageTex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.TiffanySavageTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.TiffanySavageTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.TiffanySavageTex1'
CollisionRadius=20.000000
CollisionHeight=43.000000
BindName="TiffanySavage"
FamiliarName="Tiffany Savage"
UnfamiliarName="Tiffany Savage"



TiffanySavageCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_TShirtPants_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_TShirtPants_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TiffanySavageTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TiffanySavageTex0'
MultiSkins(3)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(4)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.TiffanySavageTex0'
MultiSkins(6)=Texture'DeusExCharacters.Skins.TiffanySavageTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.TiffanySavageTex1'



Timer.uc (extends Keypoint)

var() bool bCountDown; // count down?
var() float startTime; // what time do we start from?
var() float criticalTime; // when does the text turn red?
var() float destroyDelay; // after timer has expired, how long until we destroy the window
var() string message; // message to print on timer window
var TimerDisplay timerWin;
var float time;
var bool bDone;
bCountDown=True
StartTime=60.000000
criticalTime=10.000000
destroyDelay=5.000000
Message="Countdown"
bStatic=False

Tick (float deltaTime)


if (timerWin != None)
{
if (bDone)
{
timerWin.bFlash = True;
return;
}

if (bCountDown)
{
time -= deltaTime;
if (time < 0)
time = 0;

if (time <= criticalTime)
timerWin.bCritical = True;
}
else
{
time += deltaTime;

if (time >= criticalTime)
timerWin.bCritical = True;
}

timerWin.time = time;
}

Timer


timerWin.Destroy();

Trigger (Actor Other, Pawn EventInstigator)


local DeusExPlayer player;


player = DeusExPlayer(EventInstigator);

if (player == None)
return;

Super.Trigger(Other, EventInstigator);

if (timerWin == None)
{
if (bCountDown)
time = startTime;
else
time = 0;

timerWin = DeusExRootWindow(player.rootWindow).hud.CreateTimerWindow();
timerWin.time = time;
timerWin.bCritical = False;
timerWin.message = message;
bDone = False;
PlaySound(sound'Beep3', SLOT_Misc);
player.ClientMessage("Timer started");
}
else if (!bDone && (timerWin != None))
{
bDone = True;
SetTimer(destroyDelay, False);
PlaySound(sound'Beep3', SLOT_Misc);
player.ClientMessage("Timer stopped");
}




TimerDisplay.uc (extends Window)

var Texture timerBackground;
var Color colNormal, colCritical, colBlack;
var bool bCritical;
var bool bFlash;
var float time;
var float flashTime;
var string message;
timerBackground=Texture'DeusExUI.UserInterface.ConWindowBackground'
colNormal=(G=255)
colCritical=(R=255)

DrawWindow (GC gc)


local string str;
local int mins;
local float secs;


Super.DrawWindow(gc);

// Draw the timer
gc.SetFont(Font'FontComputer8x20_B');
gc.SetAlignments(HALIGN_Center, VALIGN_Bottom);
gc.EnableWordWrap(False);

if (bCritical)
gc.SetTextColor(colCritical);
else
gc.SetTextColor(colNormal);

// print the time nicely
mins = time / 60;
secs = time % 60;

if (mins < 10)
str = "0";
str = str $ mins $ ":";
if (secs < 10)
str = str $ "0";
str = str $ secs;

if (bFlash && (flashTime >= 0.75))
{
gc.SetTextColor(colBlack);
if (flashTime >= 1.0)
flashTime = 0;
}

gc.DrawText(0, 0, width, height, str);

// draw title
gc.SetFont(Font'TechSmall');
gc.SetAlignments(HALIGN_Left, VALIGN_Top);
gc.DrawText(2, 2, width-2, height-2, message);

InitWindow


Super.InitWindow();

bTickEnabled = True;
SetBackgroundStyle(DSTY_Modulated);
SetBackground(timerBackground);
SetTileColorRGB(0, 0, 0);
SetSize(80, 36);

time = 0;
flashTime = 0;

Tick (float deltaTime)


if (bFlash)
flashTime += deltaTime;




TobyAtanwe.uc (extends HumanThug)

CarcassType=Class'DeusEx.TobyAtanweCarcass'
WalkingSpeed=0.213333
bImportant=True
walkAnimMult=0.750000
GroundSpeed=180.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench_F'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TobyAtanweTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TobyAtanweTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TobyAtanweTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TobyAtanweTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.TobyAtanweTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="TobyAtanwe"
FamiliarName="Toby Atanwe"
UnfamiliarName="Toby Atanwe"



TobyAtanweCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_F_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_F_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_F_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TobyAtanweTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TobyAtanweTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex8'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TobyAtanweTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TobyAtanweTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.TobyAtanweTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Toilet.uc (extends DeusExDecoration)

var() ESkinColor SkinColor;
var bool bUsing;
bInvincible=True
ItemName="Toilet"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.Toilet'
CollisionRadius=28.000000
CollisionHeight=28.000000
Mass=100.000000
Buoyancy=5.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Clean: Skin = Texture'ToiletTex1'; break;
case SC_Filthy: Skin = Texture'ToiletTex2'; break;
}

Frob (actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

if (bUsing)
return;

SetTimer(9.0, False);
bUsing = True;

PlaySound(sound'FlushToilet',,,, 256);
PlayAnim('Flush');

Timer


bUsing = False;




Toilet2.uc (extends DeusExDecoration)

var() ESkinColor SkinColor;
var bool bUsing;
bInvincible=True
ItemName="Urinal"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.Toilet2'
CollisionRadius=18.000000
CollisionHeight=31.000000
Mass=100.000000
Buoyancy=5.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Clean: Skin = Texture'Toilet2Tex1'; break;
case SC_Filthy: Skin = Texture'Toilet2Tex2'; break;
}

Frob (actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

if (bUsing)
return;

SetTimer(2.0, False);
bUsing = True;

PlaySound(sound'FlushUrinal',,,, 256);
PlayAnim('Flush');

Timer


bUsing = False;




ToolBorderWindow.uc (extends BorderWindow)

InitWindow


Super.InitWindow();

SetBorders(
Texture'ToolWindowListBorder_TL', Texture'ToolWindowListBorder_TR',
Texture'ToolWindowListBorder_BL', Texture'ToolWindowListBorder_BR',
Texture'ToolWindowListBorder_L', Texture'ToolWindowListBorder_R',
Texture'ToolWindowListBorder_T', Texture'ToolWindowListBorder_B');

SetBorderStyle(DSTY_Normal);
BaseMarginsFromBorder(True);




ToolButtonWindow.uc (extends ButtonWindow)

var String buttonText;
var Color colBackgroundColor;
var Color colText;
var Color colTextDisabledBack;
var Color colTextDisabledFore;
var Font fontText;
var int fontBaseLine;
var int fontAcceleratorLineHeight;
colBackgroundColor=(R=192,G=192,B=192)
colTextDisabledBack=(R=255,G=255,B=255)
colTextDisabledFore=(R=128,G=128,B=128)
fontText=Font'DeusExUI.FontSansSerif_8'
fontBaseLine=1
fontAcceleratorLineHeight=1

DrawWindow (GC gc)


// Draw the text

// If the button is insensitive, then draw it differently
if ( bIsSensitive )
{
gc.SetTextColor(colText);

// If the button is pressed, draw the text down and to the right
if ( bButtonPressed )
gc.DrawText(1, 1, width, height, buttonText);
else
gc.DrawText(0, 0, width, height, buttonText);
}
else
{
gc.SetTextColor(colTextDisabledBack);
gc.DrawText(1, 1, width, height, buttonText);
gc.SetTextColor(colTextDisabledFore);
gc.DrawText(0, 0, width, height, buttonText);
}

InitWindow


Super.InitWindow();

EnableTextAsAccelerator(false);

// Center this window
SetSize(75, 23);
SetFont(fontText);
SetTextColors(colText, colText, colText, colText, colText, colText);
SetButtonTextures(
Texture'ToolButtonWindow_Normal', Texture'ToolButtonWindow_Normal',
Texture'ToolButtonWindow_NormalFocus', Texture'ToolButtonWindow_PressedFocus',
Texture'ToolButtonWindow_Normal', Texture'ToolButtonWindow_Normal');

SetBaselineData(fontBaseLine, fontAcceleratorLineHeight);

SetButtonText (String newButtonText)


buttonText = newButtonText;

SetAcceleratorText(newButtonText);




ToolCheckboxWindow.uc (extends CheckboxWindow)

var Color colText;
var Font fontText;
var int fontBaseLine;
var int fontAcceleratorLineHeight;
fontText=Font'DeusExUI.FontSansSerif_8'
fontBaseLine=1
fontAcceleratorLineHeight=1

InitWindow


Super.InitWindow();

SetFont(fontText);
SetTextColors(colText, colText, colText, colText);
SetTextAlignments(HALIGN_Left, VALIGN_Center);
SetTextMargins(0, 0);
SetCheckboxTextures(Texture'ToolWindowCheckbox_Off', Texture'ToolWindowCheckbox_On', 13, 13);
SetCheckboxSpacing(6);
SetCheckboxStyle(DSTY_Normal);
SetBaselineData(fontBaseLine, fontAcceleratorLineHeight);




ToolEditWindow.uc (extends EditWindow)

var Color colBackgroundSensitive;
var Color colBackgroundInsensitive;
var Color colText;
var Color colTextSelected;
var Color colInsert;
var Color colHighlight;
var Texture textureInsert;
var Font fontText;
var String filterString;
colBackgroundSensitive=(R=255,G=255,B=255)
colBackgroundInsensitive=(R=192,G=192,B=192)
colTextSelected=(R=255,G=255,B=255)
colHighlight=(B=128)
textureInsert=Texture'DeusExUI.UserInterface.ToolInsertCursor'
fontText=Font'DeusExUI.FontSansSerif_8'

FilterChar (out string chStr) -> bool


local int filterIndex;
local bool bResult;


bResult = True;

for(filterIndex=0; filterIndex < Len(filterString); filterIndex++)
{
if ( Mid(filterString, filterIndex, 1) == chStr )
{
bResult = False;
break;
}
}

return bResult;

InitWindow


Super.InitWindow();

SetBackground(Texture'Solid');
SetTileColor(colBackgroundSensitive);

SetFont(fontText);
SetTextColor(colText);
SetInsertionPointType(INSTYPE_Insert);
EnableSingleLineEditing(True);
SetInsertionPointTexture(textureInsert, colInsert);
SetSelectedAreaTexture(Texture'Solid', colHighlight);
SetSelectedAreaTextColor(colTextSelected);
SetEditCursor(Texture'ToolMouseInsertCursor');
SetTextAlignments(HALIGN_Left, VALIGN_Center);

SensitivityChanged (bool bNewSensitivity)


if (bNewSensitivity)
SetTileColor(colBackgroundSensitive);
else
SetTileColor(colBackgroundInsensitive);

SetFilter (String newFilter)


filterString = newFilter;




ToolListWindow.uc (extends ListWindow)

var Color colBackground;
var Color colText;
var Color colTextHighlight;
var Color colFocus;
var Color colHighlight;
var Font fontText;
colBackground=(R=255,G=255,B=255)
colTextHighlight=(R=255,G=255,B=255)
colHighlight=(B=128)
fontText=Font'DeusExUI.FontSansSerif_8'

InitWindow


Super.InitWindow();

SetHighlightTextColor(colTextHighlight);
SetHighlightTexture(Texture'Solid');
SetHighlightColor(colHighlight);
SetFocusTexture(Texture'Dithered');
SetFocusColor(colFocus);
SetBackgroundStyle(DSTY_Normal);
SetBackground(Texture'Solid');
SetTileColor(colBackground);
SetColumnColor(0, colText);
SetColumnFont(0, fontText);

SetColumns (int newColumnCount)


local int colIndex;


SetNumColumns(newColumnCount);

for (colIndex=0; colIndex {
SetColumnColor(colIndex, colText);
SetColumnFont(colIndex, fontText);
}




ToolMessageBoxWindow.uc (extends ToolWindow)

var Color colTextMessage;
var Font fontMessageText;
var ToolButtonWindow btnYes;
var ToolButtonWindow btnNo;
var ToolButtonWindow btnOK;
var TextWindow winText;
var int mbMode;
var Window winNotify;
fontMessageText=Font'DeusExUI.FontSansSerif_8'

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

Super.ButtonActivated(buttonPressed);

switch( buttonPressed )
{
case btnYes:
PostResult(0); // MR_Yes;
break;

case btnNo:
PostResult(1);
break;

case btnOK:
PostResult(0);
break;

default:
bHandled = False;
break;
}

return bHandled;

InitWindow


Super.InitWindow();

SetSize(200, 150);

winText = CreateToolLabel(10, 40, "");
winText.SetSize(175, 60);

MouseButtonReleased (float pointX, float pointY, EInputKey button, int numClicks) -> bool


return True;

PostResult (int buttonNumber)


if ( winNotify != None )
winNotify.BoxOptionSelected(Self, buttonNumber);

SetMessageText (String msgText)


winText.SetText(msgText);

SetMode (int newMode)


// Store away
mbMode = newMode;

// Now create buttons appropriately

switch( mbMode )
{
case 0: // MB_YesNo:
btnYes = CreateToolButton( 20, 110, "Yes" );
btnNo = CreateToolButton( 106, 110, "No" );
SetFocusWindow(btnYes);
break;

case 1: // MB_OK:
btnOK = CreateToolButton( 63, 110, "OK" );
SetFocusWindow(btnOK);
break;
}

SetNotifyWindow (Window newWinNotify)


winNotify = newWinNotify;

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bHandled;


switch( key )
{
case IK_Escape:
switch( mbMode )
{
case 0: // MB_YesNo:
PostResult(1);
break;
case 1: // MB_OK:
PostResult(0);
break;
}
bHandled = True;
break;

case IK_Enter:
case IK_Space:
PostResult(0);
bHandled = True;
break;

case IK_Y:
if ( mbMode == 0 /*MB_YesNo*/ )
{
PostResult(0);
bHandled = True;
}
break;

case IK_N:
if ( mbMode == 0 /*MB_YesNo*/ )
{
PostResult(1);
bHandled = True;
}
break;
}

return bHandled;




ToolRadioButtonWindow.uc (extends ToolCheckboxWindow)

InitWindow


Super.InitWindow();

SetCheckboxTextures(Texture'ToolRadioButton_Off', Texture'ToolRadioButton_On', 12, 12);
SetCheckboxStyle(DSTY_Masked);




ToolScrollAreaWindow.uc (extends ScrollAreaWindow)

InitWindow


Super.InitWindow();

EnableScrolling(True, True);
SetAreaMargins(0, 0);
SetScrollbarDistance(0);

vScale.SetThumbCaps(Texture'ToolWindowVScrollThumb_Top', Texture'ToolWindowVScrollThumb_Bottom', 16, 2, 16, 2);
vScale.SetThumbTexture(Texture'ToolWindowVScrollThumb_Center', 16, 2);
vScale.SetScaleTexture(Texture'ToolWindowVScrollScale', 16, 16);
vScale.SetScaleMargins(0, 0);
vScale.SetThumbStyle(DSTY_Normal);

hScale.SetThumbCaps(Texture'ToolWindowHScrollThumb_Left', Texture'ToolWindowHScrollThumb_Right', 2, 16, 2, 16);
hScale.SetThumbTexture(Texture'ToolWindowHScrollThumb_Center', 2, 16);
hScale.SetScaleTexture(Texture'ToolWindowHScrollScale', 16, 16);
hScale.SetScaleMargins(0, 0);
hScale.SetThumbStyle(DSTY_Normal);

upButton.SetSize(16, 16);
upButton.SetBackgroundStyle(DSTY_Normal);
upButton.SetButtonTextures(
Texture'ToolWindowScrollUpButton_Normal', Texture'ToolWindowScrollUpButton_Pressed',
Texture'ToolWindowScrollUpButton_Normal', Texture'ToolWindowScrollUpButton_Pressed',
Texture'ToolWindowScrollUpButton_Normal', Texture'ToolWindowScrollUpButton_Pressed');

downButton.SetSize(16, 16);
downButton.SetBackgroundStyle(DSTY_Normal);
downButton.SetButtonTextures(
Texture'ToolWindowScrollDownButton_Normal', Texture'ToolWindowScrollDownButton_Pressed',
Texture'ToolWindowScrollDownButton_Normal', Texture'ToolWindowScrollDownButton_Pressed',
Texture'ToolWindowScrollDownButton_Normal', Texture'ToolWindowScrollDownButton_Pressed');

leftButton.SetSize(16, 16);
leftButton.SetBackgroundStyle(DSTY_Normal);
leftButton.SetButtonTextures(
Texture'ToolWindowScrollLeftButton_Normal', Texture'ToolWindowScrollLeftButton_Pressed',
Texture'ToolWindowScrollLeftButton_Normal', Texture'ToolWindowScrollLeftButton_Pressed',
Texture'ToolWindowScrollLeftButton_Normal', Texture'ToolWindowScrollLeftButton_Pressed');

rightButton.SetSize(16, 16);
rightButton.SetBackgroundStyle(DSTY_Normal);
rightButton.SetButtonTextures(
Texture'ToolWindowScrollRightButton_Normal', Texture'ToolWindowScrollRightButton_Pressed',
Texture'ToolWindowScrollRightButton_Normal', Texture'ToolWindowScrollRightButton_Pressed',
Texture'ToolWindowScrollRightButton_Normal', Texture'ToolWindowScrollRightButton_Pressed');




ToolTitleBarWindow.uc (extends Window)

var ButtonWindow btnClose;
var Window btnAppIcon;
var String titleBarText;
var Color colTitleBarActive;
var Color colTitleBarInactive;
var Color colTitleBarTextActive;
var Color colTitleBarTextInactive;
var Font fontTitleBar;
var Texture textureAppIcon;
colTitleBarActive=(B=128)
colTitleBarInactive=(R=128,G=128,B=128)
colTitleBarTextActive=(R=255,G=255,B=255)
colTitleBarTextInactive=(R=192,G=192,B=192)
fontTitleBar=Font'DeusExUI.FontSansSerif_8_Bold'
textureAppIcon=Texture'DeusExUI.UserInterface.DeusExSmallIcon'

DrawWindow (GC gc)


// We want to use different colors dependent on whether this is
// the active modal window.

gc.SetStyle(DSTY_Normal);
gc.SetFont(fontTitleBar);
gc.SetHorizontalAlignment(HALIGN_Left);
gc.SetVerticalAlignment(VALIGN_Center);

if ( GetModalWindow().IsCurrentModal() )
{
gc.SetTextColor(colTitleBarTextActive);
gc.SetTileColor(colTitleBarActive);
}
else
{
gc.SetTextColor(colTitleBarTextInactive);
gc.SetTileColor(colTitleBarInactive);
}

// Now draw the background and then the text
gc.DrawPattern(0, 0, width, height, 0, 0, Texture'Solid');
gc.DrawText(21, 0, width - 21, height, titleBarText);

InitWindow


Super.InitWindow();

SetWindowAlignments(HALIGN_Full, VALIGN_Top, 2, 2);
SetHeight(18);

// Add a Close Button
btnClose = ButtonWindow(NewChild(Class'ButtonWindow'));
btnClose.SetSelectability(False);
btnClose.SetSize(16, 14);
btnClose.SetWindowAlignments(HAlign_Right, VAlign_Top, 2, 2);
btnClose.SetButtonTextures(Texture'ToolWindowButtonClose_Normal', Texture'ToolWindowButtonClose_Pressed',
Texture'ToolWindowButtonClose_Normal', Texture'ToolWindowButtonClose_Pressed');

// Now add the Application Icon (Deus Ex, Baby!)
btnAppIcon = NewChild(Class'Window');
btnAppIcon.SetSize(16, 16);
btnAppIcon.SetWindowAlignments(HAlign_Left, VAlign_Top, 2, 1);
btnAppIcon.SetBackground(textureAppIcon);
btnAppIcon.SetSensitivity(True);

SetAppIcon (Texture newAppIcon)


btnAppIcon.SetBackground(newAppIcon);

SetTitleBarText (String newTitleBarText)


titleBarText = newTitleBarText;




ToolWindow.uc (extends DeusExBaseWindow)

var Window winContainer;
var ToolTitleBarWindow winTitleBar;
var Bool bWindowBeingDragged;
var Bool bTitleBarVisible;
var Bool bAllowWindowDragging;
var float windowStartDragX;
var float windowStartDragY;
var Color colBackgroundColor;
var Color colText;
var Font fontText;
var Texture textureMouse;
colBackgroundColor=(R=192,G=192,B=192)
fontText=Font'DeusExUI.FontSansSerif_8'
textureMouse=Texture'DeusExUI.UserInterface.ToolWindowCursor'
ScreenType=ST_Tool

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case winTitleBar.btnClose:
root.PopWindow();
break;

default:
bHandled = False;
break;
}

return bHandled;

CreateToolBorderContainer (int posX, int posY, int sizeX, int sizeY, Window winParent) -> Window


local ToolBorderWindow winBorder;
local Window winContainer;


winBorder = ToolBorderWindow(winParent.NewChild(Class'ToolBorderWindow'));
winBorder.SetPos( posX, posY );
winBorder.SetSize( sizeX, sizeY );

winContainer = winBorder.NewChild(Class'Window');

return winContainer;

CreateToolButton (int posX, int posY, String caption, optional Window winParent) -> ToolButtonWindow


local ToolButtonWindow newButton;


if ( winParent == None )
newButton = ToolButtonWindow(winContainer.NewChild(Class'ToolButtonWindow'));
else
newButton = ToolButtonWindow(winParent.NewChild(Class'ToolButtonWindow'));

newButton.SetPos(posX, posY);
newButton.SetButtonText(caption);

return newButton;

CreateToolCheckbox (int posX, int posY, String label, bool bDefaultValue) -> ToolCheckboxWindow


local ToolCheckboxWindow newCheckbox;


newCheckbox = ToolCheckboxWindow(winContainer.NewChild(Class'ToolCheckboxWindow'));
newCheckbox.SetPos(posX, posY);
newCheckbox.SetText(label);
newCheckbox.SetToggle(bDefaultValue);

return newCheckbox;

CreateToolEditWindow (int posX, int posY, int width, int maxChars, optional int height) -> ToolEditWindow


local ToolEditWindow newEdit;
local Window winEditContainer;
local ClipWindow editClip;


if (height == 0)
height = 20;

// First, create our border window
winEditContainer = CreateToolBorderContainer(posX, posY, width, height, winContainer);
winEditContainer.SetTileColorRGB(255, 255, 255);

// Now create our clip window
editClip = ClipWindow(winEditContainer.NewChild(Class'ClipWindow'));
editClip.ForceChildSize(False, True);

// Scott said he should have explained this better
editClip.SetWindowAlignments(HALIGN_Full, VALIGN_Full);

// Finally, create the edit window
newEdit = ToolEditWindow(editClip.NewChild(Class'ToolEditWindow'));
newEdit.SetMaxSize(maxChars);

return newEdit;

CreateToolLabel (int posX, int posY, String strLabel, optional Window winParent) -> TextWindow


local TextWindow newText;


if ( winParent == None )
newText = TextWindow(winContainer.NewChild(Class'TextWindow'));
else
newText = TextWindow(winParent.NewChild(Class'TextWindow'));

newText.SetPos(posX, posY);
newText.SetFont(fontText);
newText.SetTextColor(colText);
newText.SetTextMargins(0, 0);
newText.SetText(strLabel);

return newText;

CreateToolList (int posX, int posY, int width, int height) -> ToolListWindow


local ToolListWindow newList;
local Window winListContainer;
local ToolScrollAreaWindow winScroll;
local int colIndex;


// First, create our border window
winListContainer = CreateToolBorderContainer(posX, posY, width, height, winContainer);

// First, create the scrolling region
winScroll = ToolScrollAreaWindow(winListContainer.NewChild(Class'ToolScrollAreaWindow'));
winScroll.SetSize(width - 4, height - 4);
winScroll.ClipWindow.SetBackground(Texture'Solid');
winScroll.ClipWindow.SetTileColorRGB(255, 255, 255);

// Now create the List Window
newList = ToolListWindow(winScroll.clipWindow.NewChild(Class'ToolListWindow'));

return newList;

CreateToolWindowContainer (Window winParent) -> Window


local BorderWindow winBorder;
local Window winContainer;


winBorder = BorderWindow(winParent.NewChild(Class'BorderWindow'));
winBorder.SetWindowAlignments(HALIGN_Full, VALIGN_Full);

// Assign border textures
winBorder.SetBorders(Texture'ToolWindowBorder_TL', Texture'ToolWindowBorder_TR',
Texture'ToolWindowBorder_BL', Texture'ToolWindowBorder_BR',
Texture'ToolWindowBorder_L', Texture'ToolWindowBorder_R',
Texture'ToolWindowBorder_T', Texture'ToolWindowBorder_B');
// Texture'ToolWindowBorder_Center');

winBorder.SetTileColor(colWhite);
winBorder.SetBorderStyle(DSTY_Normal);
winBorder.BaseMarginsFromBorder(True);

winContainer = winBorder.NewChild(Class'Window');

return winContainer;

InitWindow


Super.InitWindow();

bWindowBeingDragged = False;
bAllowWindowDragging = False;

// Center this window
SetBackground(Texture'Solid');
SetTileColor(colBackgroundColor);
SetBackgroundStyle(DSTY_Normal);
SetWindowAlignments(HALIGN_Center, VALIGN_Center);
SetMouseFocusMode(MFOCUS_Click);
bSizeChildrenToParent = False;

// Create BorderWindow
winContainer = CreateToolWindowContainer(Self);

// Only want to respond to a max. of two mouse clicks
maxClicks = 2;

// Create the Title Bar
winTitleBar = ToolTitleBarWindow(winContainer.NewChild(Class'ToolTitleBarWindow'));

// Set a Windows-style Cursor
SetDefaultCursor(textureMouse, None, 0, 0);

MouseMoved (float newX, float newY)


if ( bWindowBeingDragged )
SetPos( x + (newX - windowStartDragX), y + (newY - windowStartDragY) );

SetAppIcon (Texture newAppIcon)


winTitleBar.SetAppIcon(newAppIcon);

SetTitle (String newTitleText)


winTitleBar.SetTitleBarText(newTitleText);

SetTitleBarVisibility (Bool bNewVisibility)


bTitleBarVisible = bNewVisibility;
winTitleBar.Show(bTitleBarVisible);

SetWindowDragging (Bool bNewDragging)


bAllowWindowDragging = bNewDragging;




TraceHitNonPenSpawner.uc (extends TraceHitSpawner)

bPenetrating=False



TraceHitSpawner.uc (extends Actor)

var float HitDamage;
var bool bPenetrating; // shot that hit was a penetrating shot
var bool bHandToHand; // shot that hit was hand to hand
var bool bInstantHit;
var Name damageType;
HitDamage=-1.000000
bPenetrating=True
bInstantHit=True
RemoteRole=ROLE_None
DrawType=DT_None
bGameRelevant=True
CollisionRadius=0.000000
CollisionHeight=0.000000

PlayHitSound (actor destActor, Actor hitActor)


local float rnd;
local sound snd;


// don't ricochet unless it's hit by a bullet
if ((damageType != 'Shot') && (damageType != 'Sabot'))
return;

rnd = FRand();

if (rnd < 0.25)
snd = sound'Ricochet1';
else if (rnd < 0.5)
snd = sound'Ricochet2';
else if (rnd < 0.75)
snd = sound'Ricochet3';
else
snd = sound'Ricochet4';

// play a different ricochet sound if the object isn't damaged by normal bullets
if (hitActor != None)
{
if (hitActor.IsA('DeusExDecoration') && (DeusExDecoration(hitActor).minDamageThreshold > 10))
snd = sound'ArmorRicochet';
else if (hitActor.IsA('Robot'))
snd = sound'ArmorRicochet';
}
if (destActor != None)
destActor.PlaySound(snd, SLOT_None,,, 1024, 1.1 - 0.2*FRand());

PostBeginPlay


Super.PostBeginPlay();

if (Owner == None)
SetOwner(Level);
SpawnEffects(Owner,HitDamage);

SpawnEffects (Actor Other, float Damage)


local SmokeTrail puff;
local int i;
local BulletHole hole;
local RockChip chip;
local Rotator rot;
local DeusExMover mov;
local Spark spark;


SetTimer(0.1,False);
if (Level.NetMode == NM_DedicatedServer)
return;

if (bPenetrating && !bHandToHand && !Other.IsA('DeusExDecoration'))
{
// Every hit gets a puff in multiplayer
if ( Level.NetMode != NM_Standalone )
{
puff = spawn(class'SmokeTrail',,,Location+(Vector(Rotation)*1.5), Rotation);
if ( puff != None )
{
puff.DrawScale = 1.0;
puff.OrigScale = puff.DrawScale;
puff.LifeSpan = 1.0;
puff.OrigLifeSpan = puff.LifeSpan;
puff.RemoteRole = ROLE_None;
}
}
else
{
if (FRand() < 0.5)
{
puff = spawn(class'SmokeTrail',,,Location+Vector(Rotation), Rotation);
if (puff != None)
{
puff.DrawScale *= 0.3;
puff.OrigScale = puff.DrawScale;
puff.LifeSpan = 0.25;
puff.OrigLifeSpan = puff.LifeSpan;
puff.RemoteRole = ROLE_None;
}
}
}
if (!Other.IsA('DeusExMover'))
for (i=0; i<2; i++)
if (FRand() < 0.8)
{
chip = spawn(class'Rockchip',,,Location+Vector(Rotation));
if (chip != None)
chip.RemoteRole = ROLE_None;
}
}

if ((!bHandToHand) && bInstantHit && bPenetrating)
{
hole = spawn(class'BulletHole', Other,, Location+Vector(Rotation), Rotation);
if (hole != None)
hole.RemoteRole = ROLE_None;

if ( !Other.IsA('DeusExPlayer') ) // Sparks on people look bad
{
spark = spawn(class'Spark',,,Location+Vector(Rotation), Rotation);
if (spark != None)
{
spark.RemoteRole = ROLE_None;
if ( Level.NetMode != NM_Standalone )
spark.DrawScale = 0.25;
else
spark.DrawScale = 0.05;
PlayHitSound(spark, Other);
}
}
}

// draw the correct damage art for what we hit
if (bPenetrating || bHandToHand)
{
if (Other.IsA('DeusExMover'))
{
mov = DeusExMover(Other);
if ((mov != None) && (hole == None))
{
hole = spawn(class'BulletHole', Other,, Location+Vector(Rotation), Rotation);
if (hole != None)
hole.remoteRole = ROLE_None;
}

if (hole != None)
{
if (mov.bBreakable && (mov.minDamageThreshold <= Damage))
{
// don't draw damage art on destroyed movers
if (mov.bDestroyed)
hole.Destroy();
else if (mov.FragmentClass == class'GlassFragment')
{
// glass hole
if (FRand() < 0.5)
hole.Texture = Texture'FlatFXTex29';
else
hole.Texture = Texture'FlatFXTex30';

hole.DrawScale = 0.1;
hole.ReattachDecal();
}
else
{
// non-glass crack
if (FRand() < 0.5)
hole.Texture = Texture'FlatFXTex7';
else
hole.Texture = Texture'FlatFXTex8';

hole.DrawScale = 0.4;
hole.ReattachDecal();
}
}
else
{
if (!bPenetrating || bHandToHand)
hole.Destroy();
}
}
}
}

Timer


Destroy();




Tracer.uc (extends DeusExProjectile)

AccurateRange=16000
maxRange=16000
bIgnoresNanoDefense=True
speed=4000.000000
MaxSpeed=4000.000000
Mesh=LodMesh'DeusExItems.Tracer'
ScaleGlow=2.000000
bUnlit=True



TracerTong.uc (extends HumanCivilian)

CarcassType=Class'DeusEx.TracerTongCarcass'
WalkingSpeed=0.320000
bImportant=True
bInvincible=True
walkAnimMult=1.000000
GroundSpeed=250.000000
WaterSpeed=64.000000
AirSpeed=144.000000
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TracerTongTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TracerTongTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TracerTongTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TracerTongTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=16.000000
CollisionHeight=46.000000
Buoyancy=97.000000
BindName="TracerTong"
FamiliarName="Tracer Tong"
UnfamiliarName="Tracer Tong"



TracerTongCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TracerTongTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TracerTongTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TracerTongTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TracerTongTex0'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=40.000000



TrafficLight.uc (extends HangingDecoration)

ItemName="Traffic Light"
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.TrafficLight'
PrePivot=(Z=36.549999)
CollisionRadius=15.600000
CollisionHeight=36.549999
Mass=60.000000
Buoyancy=50.000000



Trash.uc (extends DeusExDecoration)

var Vector dir;
var Rotator rot;
var float time;
var float rnd;
var bool bStopped;
var Vector lastLoc;
Time=1.000000
rnd=1.000000
bHighlight=False
bPushable=False
LifeSpan=30.000000
bBlockActors=False
bBlockPlayers=False
bFixedRotationDir=True
Mass=2.000000
Buoyancy=3.000000

BeginPlay


Super.BeginPlay();

lastLoc = Location + vect(100,0,0);
if (IsA('TrashPaper'))
LoopAnim('Blowing');


HitWall (vector HitNormal, actor Wall)


Velocity = (Velocity dot HitNormal) * HitNormal * (-2.0) + Velocity;

StopMoving


dir = vect(0,0,0);
Velocity = dir;
RotationRate = rot(0,0,0);
rot = rot(0,0,0);
rot.Yaw = FRand() * 65535;
SetRotation(rot);
bFixedRotationDir = False;
SetCollisionSize(Default.CollisionRadius, 0.1);
SetPhysics(PHYS_Falling);
PlayAnim('Still');
bStopped = True;

// die after some random time
SetTimer(10*FRand()+20, False);

Tick (float deltaTime)


Super.Tick(deltaTime);

if (!bFloating && !bStopped)
{
Velocity = dir * rnd;

if (time >= 1.0)
{
rnd = FRand() * 0.2 + 0.8;
RotationRate = rot * rnd;
time = 0;
}
time += deltaTime;

// if we haven't moved much since the last frame, stop moving
if (VSize(Location - lastLoc) < 0.1)
StopMoving();

lastLoc = Location;
}

Timer


Destroy();

ZoneChange (ZoneInfo NewZone)


if (NewZone.bWaterZone)
StopMoving();

Super.ZoneChange(NewZone);




TrashCan1.uc (extends Containers)

bGenerateTrash=True
ItemName="Trashcan"
Mesh=LodMesh'DeusExDeco.TrashCan1'
CollisionRadius=19.250000
CollisionHeight=33.000000
Mass=50.000000
Buoyancy=60.000000



TrashCan3.uc (extends Containers)

bGenerateTrash=True
bGenerateFlies=True
ItemName="Trashcan"
Mesh=LodMesh'DeusExDeco.TrashCan3'
CollisionRadius=24.000000
CollisionHeight=30.500000
Mass=40.000000
Buoyancy=50.000000



TrashCan4.uc (extends Containers)

bGenerateTrash=True
bGenerateFlies=True
ItemName="Trashcan"
Mesh=LodMesh'DeusExDeco.TrashCan4'
CollisionRadius=24.000000
CollisionHeight=29.000000
Mass=40.000000
Buoyancy=50.000000



TrashGenerator.uc (extends Effects)

var() float Frequency; // use very small numbers (~0.001)
var() float WindSpeed; // wind speed in ft/sec
var() ETrashType TrashType;
var float timer;
Frequency=0.001000
WindSpeed=100.000000
bHidden=True
bDirectional=True
DrawType=DT_Sprite
Texture=Texture'Engine.S_Inventory'

Tick (float deltaTime)


local Trash trash;


if (timer > 0.1)
{
timer = 0;

if (FRand() < Frequency)
{
if (TrashType == TT_Paper)
trash = Spawn(class'TrashPaper');
else if (TrashType == TT_Tumbleweed)
trash = Spawn(class'Tumbleweed');

if (trash != None)
{
trash.SetPhysics(PHYS_Rolling);
trash.rot = RotRand(True);
trash.rot.Yaw = 0;
trash.dir = Vector(Rotation) * WindSpeed;
trash.dir.x += 5 * FRand();
trash.dir.y += 5 * FRand();
trash.dir.z = -2 * FRand();
}
}
}

timer += deltaTime;

Super.Tick(deltaTime);




TrashPaper.uc (extends Trash)

ItemName="Paper"
Mesh=LodMesh'DeusExDeco.TrashPaper'
CollisionRadius=6.000000
CollisionHeight=6.000000



Trashbag.uc (extends Containers)

bGenerateTrash=True
HitPoints=10
FragType=Class'DeusEx.PaperFragment'
bGenerateFlies=True
ItemName="Trashbag"
Mesh=LodMesh'DeusExDeco.Trashbag'
CollisionRadius=26.360001
CollisionHeight=26.760000
Mass=30.000000
Buoyancy=40.000000



Trashbag2.uc (extends Containers)

bGenerateTrash=True
HitPoints=10
FragType=Class'DeusEx.PaperFragment'
bGenerateFlies=True
ItemName="Trashbag"
Mesh=LodMesh'DeusExDeco.Trashbag2'
CollisionRadius=19.610001
CollisionHeight=16.700001
Mass=30.000000
Buoyancy=40.000000



Trashcan2.uc (extends Containers)

bGenerateTrash=True
ItemName="Trashcan"
Mesh=LodMesh'DeusExDeco.Trashcan2'
CollisionRadius=14.860000
CollisionHeight=24.049999
Mass=40.000000
Buoyancy=50.000000



Tree.uc (extends OutdoorThings)

var() float soundFreq; // chance of making a sound every 5 seconds
soundFreq=0.200000
bStatic=False
Mass=2000.000000
Buoyancy=5.000000

PostBeginPlay


Super.PostBeginPlay();
SetTimer(4.0 + 2.0 * FRand(), True);

Timer


if (FRand() < soundFreq)
{
// play wind sounds at random pitch offsets
if (FRand() < 0.5)
PlaySound(sound'WindGust1', SLOT_Misc,,, 2048, 0.7 + 0.6 * FRand());
else
PlaySound(sound'WindGust2', SLOT_Misc,,, 2048, 0.7 + 0.6 * FRand());
}




Tree1.uc (extends Tree)

var() ESkinColor SkinColor;
Mesh=LodMesh'DeusExDeco.Tree1'
CollisionRadius=10.000000
CollisionHeight=125.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Tree1: Skin = Texture'Tree2Tex1'; break;
case SC_Tree2: Skin = Texture'Tree2Tex2'; break;
case SC_Tree3: Skin = Texture'Tree2Tex3'; break;
}




Tree2.uc (extends Tree)

var() ESkinColor SkinColor;
Mesh=LodMesh'DeusExDeco.Tree2'
CollisionRadius=10.000000
CollisionHeight=182.369995

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Tree1: Skin = Texture'Tree2Tex1'; break;
case SC_Tree2: Skin = Texture'Tree2Tex2'; break;
case SC_Tree3: Skin = Texture'Tree2Tex3'; break;
}




Tree3.uc (extends Tree)

Mesh=LodMesh'DeusExDeco.Tree3'
CollisionRadius=30.000000
CollisionHeight=124.339996



Tree4.uc (extends Tree)

Mesh=LodMesh'DeusExDeco.Tree4'
CollisionRadius=40.000000
CollisionHeight=188.600006



TriadLumPath.uc (extends HumanThug)

CarcassType=Class'DeusEx.TriadLumPathCarcass'
WalkingSpeed=0.300000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponPistol')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo10mm',Count=2)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponSword')
walkAnimMult=1.200000
GroundSpeed=200.000000
WaterSpeed=240.000000
AirSpeed=144.000000
BaseEyeHeight=32.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TriadLumPathTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex10'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TriadLumPathTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TriadLumPathTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TriadLumPathTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=16.000000
CollisionHeight=46.500000
Buoyancy=97.000000
BindName="TriadLuminousPathMember"
FamiliarName="Gang Member"
UnfamiliarName="Gang Member"



TriadLumPath2.uc (extends HumanThug)

CarcassType=Class'DeusEx.TriadLumPath2Carcass'
WalkingSpeed=0.300000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponPistol')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo10mm',Count=2)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponSword')
walkAnimMult=1.200000
GroundSpeed=200.000000
WaterSpeed=240.000000
AirSpeed=144.000000
BaseEyeHeight=32.000000
Mesh=LodMesh'DeusExCharacters.GM_Suit'
DrawScale=1.050000
MultiSkins(0)=Texture'DeusExCharacters.Skins.TriadLumPath2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex10'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TriadLumPath2Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TriadLumPathTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TriadLumPathTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.PonytailTex1'
CollisionRadius=16.799999
CollisionHeight=48.830002
Buoyancy=97.000000
BindName="TriadLuminousPathLeader"
FamiliarName="Gang Leader"
UnfamiliarName="Gang Leader"



TriadLumPath2Carcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
DrawScale=1.050000
MultiSkins(0)=Texture'DeusExCharacters.Skins.TriadLumPath2Tex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex10'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TriadLumPath2Tex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TriadLumPathTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TriadLumPathTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExCharacters.Skins.PonytailTex1'
CollisionRadius=42.000000
CollisionHeight=7.350000



TriadLumPathCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Suit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Suit_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Suit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TriadLumPathTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex10'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TriadLumPathTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TriadLumPathTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TriadLumPathTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



TriadRedArrow.uc (extends HumanThug)

CarcassType=Class'DeusEx.TriadRedArrowCarcass'
WalkingSpeed=0.300000
BaseAssHeight=-23.000000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponPistol')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo10mm',Count=2)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponSword')
walkAnimMult=1.200000
GroundSpeed=200.000000
WaterSpeed=240.000000
AirSpeed=144.000000
BaseEyeHeight=36.000000
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TriadRedArrowTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TriadRedArrowTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TriadRedArrowTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TriadRedArrowTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TriadRedArrowTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.TriadRedArrowTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=14.000000
CollisionHeight=47.500000
Buoyancy=97.000000
BindName="TriadRedArrowMember"
FamiliarName="Gang Member"
UnfamiliarName="Gang Member"



TriadRedArrowCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TriadRedArrowTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TriadRedArrowTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TriadRedArrowTex3'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TriadRedArrowTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TriadRedArrowTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.TriadRedArrowTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



Trophy.uc (extends DeusExDecoration)

ItemName="Trophy Cup"
Mesh=LodMesh'DeusExDeco.Trophy'
CollisionRadius=11.030000
CollisionHeight=10.940000
Mass=40.000000
Buoyancy=10.000000



Tumbleweed.uc (extends Trash)

ItemName="Tumbleweed"
Mesh=LodMesh'DeusExDeco.Tumbleweed'
CollisionRadius=33.000000
CollisionHeight=21.570000



UNATCOTroop.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.UNATCOTroopCarcass'
WalkingSpeed=0.296000
InitialInventory(0)=(Inventory=Class'DeusEx.WeaponAssaultGun')
InitialInventory(1)=(Inventory=Class'DeusEx.Ammo762mm',Count=12)
InitialInventory(2)=(Inventory=Class'DeusEx.WeaponCombatKnife')
walkAnimMult=0.780000
GroundSpeed=200.000000
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.UNATCOTroopTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.UNATCOTroopTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.UNATCOTroopTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="UNATCOTroop"
FamiliarName="UNATCO Troop"
UnfamiliarName="UNATCO Troop"



UNATCOTroopCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Jumpsuit_CarcassC'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'DeusExCharacters.GM_Jumpsuit_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.UNATCOTroopTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.UNATCOTroopTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(4)=Texture'DeusExCharacters.Skins.MiscTex1'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.UNATCOTroopTex3'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
CollisionRadius=40.000000



UnTrigger.uc (extends Trigger)

Touch (Actor Other)


local Actor A;


// UnTrigger event
if (IsRelevant(Other))
if(Event != '')
foreach AllActors(class 'Actor', A, Event)
A.UnTrigger(Other, Pawn(Other));

Trigger (Actor Other, Pawn Instigator)


local Actor A;


// UnTrigger event
if(Event != '')
foreach AllActors(class 'Actor', A, Event)
A.UnTrigger(Other, Instigator);




Valve.uc (extends DeusExDecoration)

var() bool bOpen;
bInvincible=True
ItemName="Valve"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.Valve'
SoundRadius=6
SoundVolume=48
SoundPitch=96
AmbientSound=Sound'Ambient.Ambient.WaterRushing'
CollisionRadius=7.200000
CollisionHeight=1.920000
Mass=20.000000
Buoyancy=10.000000

Frob (actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

bOpen = !bOpen;
if (bOpen)
{
PlaySound(sound'ValveOpen',,,, 256);
PlayAnim('Open',, 0.001);
}
else
{
PlaySound(sound'ValveClose',,,, 256);
PlayAnim('Close',, 0.001);
}

PostBeginPlay


Super.PostBeginPlay();

if (bOpen)
PlayAnim('Open', 10.0, 0.001);
else
PlayAnim('Close', 10.0, 0.001);




Van.uc (extends Vehicles)

ItemName="Black Van"
Mesh=LodMesh'DeusExDeco.Van'
CollisionRadius=145.000000
CollisionHeight=66.470001
Mass=4000.000000
Buoyancy=2000.000000



Vase1.uc (extends DeusExDecoration)

FragType=Class'DeusEx.GlassFragment'
ItemName="Vase"
Mesh=LodMesh'DeusExDeco.Vase1'
CollisionRadius=6.700000
CollisionHeight=14.810000
Mass=20.000000
Buoyancy=15.000000



Vase2.uc (extends DeusExDecoration)

FragType=Class'DeusEx.GlassFragment'
ItemName="Vase"
Mesh=LodMesh'DeusExDeco.Vase2'
CollisionRadius=7.540000
CollisionHeight=5.080000
Mass=20.000000
Buoyancy=15.000000



Vehicles.uc (extends DeusExDecoration)

var() bool bInWorld;
var vector WorldPosition;
bInWorld=True
bInvincible=True
bPushable=False
Physics=PHYS_None

EnterWorld


PutInWorld(true);

InterpolateEnd (Actor Other)


Super.InterpolateEnd(Other);

if (InterpolationPoint(Other).bEndOfPath)
Destroy();

LeaveWorld


PutInWorld(false);

PostBeginPlay


Super.PostBeginPlay();

if (!bInWorld)
{
// tricky
bInWorld = true;
LeaveWorld();
}

PutInWorld (bool bEnter)


if (bInWorld && !bEnter)
{
bInWorld = false;
bHidden = true;
bDetectable = false;
WorldPosition = Location;
SetCollision(false, false, false);
bCollideWorld = false;
SetPhysics(PHYS_None);
SetLocation(Location+vect(0,0,20000)); // move it out of the way
}
else if (!bInWorld && bEnter)
{
bInWorld = true;
bHidden = Default.bHidden;
bDetectable = Default.bDetectable;
SetLocation(WorldPosition);
SetCollision(Default.bCollideActors, Default.bBlockActors, Default.bBlockPlayers);
bCollideWorld = Default.bCollideWorld;
SetPhysics(Default.Physics);
}




VendingMachine.uc (extends ElectronicDevices)

var() ESkinColor SkinColor;
var localized String msgDispensed;
var localized String msgNoCredits;
var int numUses;
var localized String msgEmpty;
msgDispensed="2 credits deducted from your account"
msgNoCredits="Costs 2 credits..."
numUses=10
msgEmpty="It's empty"
bCanBeBase=True
ItemName="Vending Machine"
Mesh=LodMesh'DeusExDeco.VendingMachine'
SoundRadius=8
SoundVolume=96
AmbientSound=Sound'Ambient.Ambient.HumLow3'
CollisionRadius=34.000000
CollisionHeight=50.000000
Mass=150.000000
Buoyancy=100.000000

BeginPlay


Super.BeginPlay();

switch (SkinColor)
{
case SC_Drink: Skin = Texture'VendingMachineTex1'; break;
case SC_Snack: Skin = Texture'VendingMachineTex2'; break;
}

Frob (actor Frobber, Inventory frobWith)


local DeusExPlayer player;
local Vector loc;
local Pickup product;


Super.Frob(Frobber, frobWith);

player = DeusExPlayer(Frobber);

if (player != None)
{
if (numUses <= 0)
{
player.ClientMessage(msgEmpty);
return;
}

if (player.Credits >= 2)
{
PlaySound(sound'VendingCoin', SLOT_None);
loc = Vector(Rotation) * CollisionRadius * 0.8;
loc.Z -= CollisionHeight * 0.7;
loc += Location;

if (SkinColor == SC_Drink)
product = Spawn(class'Sodacan', None,, loc);
else
product = Spawn(class'Candybar', None,, loc);

if (product != None)
{
if (product.IsA('Sodacan'))
PlaySound(sound'VendingCan', SLOT_None);
else
PlaySound(sound'VendingSmokes', SLOT_None);

product.Velocity = Vector(Rotation) * 100;
product.bFixedRotationDir = True;
product.RotationRate.Pitch = (32768 - Rand(65536)) * 4.0;
product.RotationRate.Yaw = (32768 - Rand(65536)) * 4.0;
}

player.Credits -= 2;
player.ClientMessage(msgDispensed);
numUses--;
}
else
player.ClientMessage(msgNoCredits);
}




VialAmbrosia.uc (extends DeusExPickup)

var localized String msgNoEffect;
msgNoEffect="Strange...nothing happens..."
maxCopies=10
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Ambrosia Vial"
ItemArticle="an"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.VialAmbrosia'
PickupViewMesh=LodMesh'DeusExItems.VialAmbrosia'
ThirdPersonMesh=LodMesh'DeusExItems.VialAmbrosia'
LandSound=Sound'DeusExSounds.Generic.GlassHit1'
Icon=Texture'DeusExUI.Icons.BeltIconVialAmbrosia'
largeIcon=Texture'DeusExUI.Icons.LargeIconVialAmbrosia'
largeIconWidth=18
largeIconHeight=44
Description="The only known vaccine against the 'Gray Death.' Unfortunately, it is quickly metabolized by the body making its effects temporary at best."
beltDescription="AMBROSIA"
Mesh=LodMesh'DeusExItems.VialAmbrosia'
CollisionRadius=2.200000
CollisionHeight=4.890000
Mass=2.000000
Buoyancy=3.000000

Activate


// can't turn it off

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
player.ClientMessage(msgNoEffect);

UseOnce();




VialCrack.uc (extends DeusExPickup)

maxCopies=20
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Zyme Vial"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.VialCrack'
PickupViewMesh=LodMesh'DeusExItems.VialCrack'
ThirdPersonMesh=LodMesh'DeusExItems.VialCrack'
LandSound=Sound'DeusExSounds.Generic.GlassHit1'
Icon=Texture'DeusExUI.Icons.BeltIconVial_Crack'
largeIcon=Texture'DeusExUI.Icons.LargeIconVial_Crack'
largeIconWidth=24
largeIconHeight=43
Description="A vial of zyme, brewed up in some basement lab."
beltDescription="ZYME"
Mesh=LodMesh'DeusExItems.VialCrack'
CollisionRadius=0.910000
CollisionHeight=1.410000
Mass=2.000000
Buoyancy=3.000000

Activate


// can't turn it off

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
{
player.drugEffectTimer += 60.0;
player.HealPlayer(-10, False);
}

UseOnce();




WHBenchEast.uc (extends Seat)

sitPoint(0)=(X=-5.000000,Y=0.000000,Z=0.000000)
sitPoint(1)=(X=5.000000,Y=0.000000,Z=0.000000)
ItemName="Bench"
Mesh=LodMesh'DeusExDeco.WHBenchEast'
CollisionRadius=27.000000
CollisionHeight=17.000000
Mass=25.000000
Buoyancy=5.000000



WHBenchLibrary.uc (extends Seat)

sitPoint(0)=(X=0.000000,Y=0.000000,Z=0.000000)
ItemName="Bench"
Mesh=LodMesh'DeusExDeco.WHBenchLibrary'
CollisionRadius=56.000000
CollisionHeight=34.000000
Mass=25.000000
Buoyancy=5.000000



WHBookstandLibrary.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
ItemName="Bookstand"
Mesh=LodMesh'DeusExDeco.WHBookstandLibrary'
CollisionRadius=18.000000
CollisionHeight=27.000000
Mass=25.000000
Buoyancy=5.000000



WHCabinet.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
ItemName="Cabinet"
Mesh=LodMesh'DeusExDeco.WHCabinet'
CollisionRadius=32.000000
CollisionHeight=60.000000
Mass=125.000000
Buoyancy=50.000000



WHChairDining.uc (extends Seat)

sitPoint(0)=(X=0.000000,Y=0.000000,Z=0.000000)
ItemName="Chair"
Mesh=LodMesh'DeusExDeco.WHChairDining'
CollisionRadius=20.000000
CollisionHeight=36.000000
Mass=25.000000
Buoyancy=5.000000



WHChairOvalOffice.uc (extends Seat)

sitPoint(0)=(X=0.000000,Y=0.000000,Z=0.000000)
ItemName="Leather Chair"
Mesh=LodMesh'DeusExDeco.WHChairOvalOffice'
CollisionRadius=29.000000
CollisionHeight=33.810001
Mass=40.000000
Buoyancy=20.000000



WHChairPink.uc (extends Seat)

var() ESeatColor SeatColor;
var() EBackColor BackColor;
BackColor=SC_WoodBars
sitPoint(0)=(X=0.000000,Y=0.000000,Z=0.000000)
ItemName="Chair"
Mesh=LodMesh'DeusExDeco.WHChairPink'
CollisionRadius=16.000000
CollisionHeight=24.000000
Mass=25.000000
Buoyancy=5.000000

BeginPlay


Super.BeginPlay();

switch (SeatColor)
{
case SC_Pink: MultiSkins[0] = Texture'WHChairPinkBaseTex1'; break;
case SC_Blue: MultiSkins[0] = Texture'WHChairPinkBaseTex2'; break;
case SC_Green: MultiSkins[0] = Texture'WHChairPinkBaseTex3'; break;
case SC_Red: MultiSkins[0] = Texture'WHChairPinkBaseTex4'; break;
case SC_BlueFancy: MultiSkins[0] = Texture'WHChairPinkBaseTex5'; break;
case SC_RedFancy: MultiSkins[0] = Texture'WHChairPinkBaseTex6'; break;
}

switch (BackColor)
{
case SC_Blue: MultiSkins[1] = Texture'WHChairPinkBackTex1'; break;
case SC_Green: MultiSkins[1] = Texture'WHChairPinkBackTex2'; break;
case SC_Red: MultiSkins[1] = Texture'WHChairPinkBackTex3'; break;
case SC_Wood: MultiSkins[1] = Texture'WHChairPinkBackTex4'; break;
case SC_WoodBars: MultiSkins[1] = Texture'WHChairPinkBackTex5'; break;
case SC_WoodX: MultiSkins[1] = Texture'WHChairPinkBackTex6'; break;
}




WHDeskLibrarySmall.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Desk"
Mesh=LodMesh'DeusExDeco.WHDeskLibrarySmall'
CollisionRadius=44.000000
CollisionHeight=27.000000
Mass=75.000000
Buoyancy=50.000000



WHDeskOvalOffice.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Desk"
bPushable=False
Mesh=LodMesh'DeusExDeco.WHDeskOvalOffice'
CollisionRadius=47.000000
CollisionHeight=21.000000
Mass=200.000000
Buoyancy=50.000000



WHEndtableLibrary.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Table"
Mesh=LodMesh'DeusExDeco.WHEndtableLibrary'
CollisionRadius=20.000000
CollisionHeight=24.000000
Mass=25.000000
Buoyancy=5.000000



WHFireplaceGrill.uc (extends WashingtonDecoration)

ItemName="Fireplace Grating"
Mesh=LodMesh'DeusExDeco.WHFireplaceGrill'
CollisionRadius=34.000000
CollisionHeight=15.250000
Mass=50.000000
Buoyancy=5.000000



WHFireplaceLog.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
ItemName="Log"
bPushable=False
Mesh=LodMesh'DeusExDeco.WHFireplaceLog'
CollisionHeight=3.000000
Mass=25.000000
Buoyancy=5.000000



WHPhone.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.PlasticFragment'
ItemName="Telephone"
Mesh=LodMesh'DeusExDeco.WHPhone'
CollisionRadius=7.000000
CollisionHeight=1.500000
Mass=20.000000
Buoyancy=5.000000



WHPiano.uc (extends WashingtonDecoration)

var bool bUsing;
FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Grand Piano"
bPushable=False
Mesh=LodMesh'DeusExDeco.WHPiano'
CollisionRadius=100.000000
CollisionHeight=32.500000
Mass=750.000000
Buoyancy=100.000000

Frob (actor Frobber, Inventory frobWith)


local float rnd;


Super.Frob(Frobber, frobWith);

if (bUsing)
return;

SetTimer(2.0, False);
bUsing = True;

rnd = FRand();

if (rnd < 0.5)
PlaySound(sound'Piano1', SLOT_Misc,,, 256);
else
PlaySound(sound'Piano2', SLOT_Misc,,, 256);

Timer


bUsing = False;




WHRedCandleabra.uc (extends WashingtonDecoration)

ItemName="Candelabra"
bPushable=False
Mesh=LodMesh'DeusExDeco.WHRedCandleabra'
CollisionRadius=6.000000
CollisionHeight=11.750000
Mass=20.000000
Buoyancy=5.000000



WHRedCouch.uc (extends Seat)

sitPoint(0)=(X=-5.000000,Y=0.000000,Z=0.000000)
sitPoint(1)=(X=5.000000,Y=0.000000,Z=0.000000)
ItemName="Couch"
Mesh=LodMesh'DeusExDeco.WHRedCouch'
CollisionRadius=55.000000
CollisionHeight=26.000000
Mass=200.000000
Buoyancy=5.000000



WHRedEagleTable.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Table"
Mesh=LodMesh'DeusExDeco.WHRedEagleTable'
CollisionRadius=32.000000
CollisionHeight=25.250000
Mass=75.000000
Buoyancy=5.000000



WHRedLampTable.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Table"
Mesh=LodMesh'DeusExDeco.WHRedLampTable'
CollisionRadius=24.000000
CollisionHeight=24.750000
Mass=50.000000
Buoyancy=5.000000



WHRedOvalTable.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Table"
Mesh=LodMesh'DeusExDeco.WHRedOvalTable'
CollisionRadius=23.000000
CollisionHeight=26.000000
Mass=75.000000
Buoyancy=5.000000



WHRedVase.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.GlassFragment'
ItemName="Vase"
Mesh=LodMesh'DeusExDeco.WHRedVase'
CollisionRadius=5.000000
CollisionHeight=11.000000
Mass=5.000000
Buoyancy=5.000000



WHTableBlue.uc (extends WashingtonDecoration)

FragType=Class'DeusEx.WoodFragment'
bCanBeBase=True
ItemName="Table"
Mesh=LodMesh'DeusExDeco.WHTableBlue'
CollisionRadius=28.000000
CollisionHeight=24.000000
Mass=100.000000
Buoyancy=5.000000



WIB.uc (extends HumanMilitary)

MinHealth=0.000000
CarcassType=Class'DeusEx.WIBCarcass'
WalkingSpeed=0.296000
CloseCombatMult=0.500000
BaseAssHeight=-18.000000
walkAnimMult=0.870000
bIsFemale=True
GroundSpeed=200.000000
Health=300
HealthHead=300
HealthTorso=300
HealthLegLeft=300
HealthLegRight=300
HealthArmLeft=300
HealthArmRight=300
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt'
DrawScale=1.100000
MultiSkins(0)=Texture'DeusExCharacters.Skins.WIBTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.WIBTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.WIBTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.WIBTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex3'
CollisionHeight=47.299999
BindName="WIB"
FamiliarName="Woman In Black"
UnfamiliarName="Woman In Black"

Explode


local SphereEffect sphere;
local ScorchMark s;
local ExplosionLight light;
local int i;
local float explosionDamage;
local float explosionRadius;


explosionDamage = 100;
explosionRadius = 256;

// alert NPCs that I'm exploding
AISendEvent('LoudNoise', EAITYPE_Audio, , explosionRadius*16);
PlaySound(Sound'LargeExplosion1', SLOT_None,,, explosionRadius*16);

// draw a pretty explosion
light = Spawn(class'ExplosionLight',,, Location);
if (light != None)
light.size = 4;

Spawn(class'ExplosionSmall',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionMedium',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionMedium',,, Location + 2*VRand()*CollisionRadius);
Spawn(class'ExplosionLarge',,, Location + 2*VRand()*CollisionRadius);

sphere = Spawn(class'SphereEffect',,, Location);
if (sphere != None)
sphere.size = explosionRadius / 32.0;

// spawn a mark
s = spawn(class'ScorchMark', Base,, Location-vect(0,0,1)*CollisionHeight, Rotation+rot(16384,0,0));
if (s != None)
{
s.DrawScale = FClamp(explosionDamage/30, 0.1, 3.0);
s.ReattachDecal();
}

// spawn some rocks and flesh fragments
for (i=0; i {
if (FRand() < 0.3)
spawn(class'Rockchip',,,Location);
else
spawn(class'FleshFragment',,,Location);
}


HurtRadius(explosionDamage, explosionRadius, 'Exploded', explosionDamage*100, Location);

SpawnCarcass -> Carcass


if (bStunned)
return Super.SpawnCarcass();

Explode();

return None;




WIBCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GFM_SuitSkirt_CarcassC'
Mesh=LodMesh'DeusExCharacters.GFM_SuitSkirt_Carcass'
DrawScale=1.100000
MultiSkins(0)=Texture'DeusExCharacters.Skins.WIBTex0'
MultiSkins(1)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(2)=Texture'DeusExCharacters.Skins.WIBTex0'
MultiSkins(3)=Texture'DeusExCharacters.Skins.LegsTex2'
MultiSkins(4)=Texture'DeusExCharacters.Skins.WIBTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.WIBTex1'
MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex2'
MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex3'
CollisionRadius=44.000000
CollisionHeight=7.700000



WaltonSimons.uc (extends HumanMilitary)

CarcassType=Class'DeusEx.WaltonSimonsCarcass'
WalkingSpeed=0.333333
bImportant=True
bInvincible=True
CloseCombatMult=0.500000
BaseAssHeight=-23.000000
BurnPeriod=0.000000
bHasCloak=True
CloakThreshold=150
walkAnimMult=1.400000
GroundSpeed=240.000000
Health=600
HealthHead=900
HealthTorso=600
HealthLegLeft=600
HealthLegRight=600
HealthArmLeft=600
HealthArmRight=600
Mesh=LodMesh'DeusExCharacters.GM_Trench'
MultiSkins(0)=Texture'DeusExCharacters.Skins.WaltonSimonsTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.WaltonSimonsTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.WaltonSimonsTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.WaltonSimonsTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.WaltonSimonsTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'
CollisionRadius=20.000000
CollisionHeight=47.500000
BindName="WaltonSimons"
FamiliarName="Walton Simons"
UnfamiliarName="Walton Simons"

GotoDisabledState (name damageType, EHitLocation hitPos)


if (!bCollideActors && !bBlockActors && !bBlockPlayers)
return;
if (CanShowPain())
TakeHit(hitPos);
else
GotoNextState();

ShieldDamage (name damageType) -> float


// handle special damage types
if ((damageType == 'Flamed') || (damageType == 'Burned') || (damageType == 'Stunned') ||
(damageType == 'KnockedOut'))
return 0.0;
else if ((damageType == 'TearGas') || (damageType == 'PoisonGas') || (damageType == 'HalonGas') ||
(damageType == 'Radiation') || (damageType == 'Shocked') || (damageType == 'Poison') ||
(damageType == 'PoisonEffect'))
return 0.1;
else
return Super.ShieldDamage(damageType);




WaltonSimonsCarcass.uc (extends DeusExCarcass)

Mesh2=LodMesh'DeusExCharacters.GM_Trench_CarcassB'
Mesh3=LodMesh'DeusExCharacters.GM_Trench_CarcassC'
Mesh=LodMesh'DeusExCharacters.GM_Trench_Carcass'
MultiSkins(0)=Texture'DeusExCharacters.Skins.WaltonSimonsTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.WaltonSimonsTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.PantsTex5'
MultiSkins(3)=Texture'DeusExCharacters.Skins.WaltonSimonsTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.WaltonSimonsTex1'
MultiSkins(5)=Texture'DeusExCharacters.Skins.WaltonSimonsTex2'
MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(7)=Texture'DeusExItems.Skins.BlackMaskTex'



WanderPoint.uc (extends NavigationPoint)

var() name gazeTag;
var actor gazeItem;
var vector gazeDirection;
var() float gazeDuration;
gazeDuration=6.000000
bDirectional=True

PreBeginPlay


Super.PreBeginPlay();

if (gazeTag != 'None')
{
foreach AllActors(Class'Actor', gazeItem, gazeTag)
break;
}

gazeDirection = 200 * vector(Rotation);




WashingtonDecoration.uc (extends DeusExDecoration)




WaterCooler.uc (extends DeusExDecoration)

var bool bUsing;
var int numUses;
var localized String msgEmpty;
numUses=10
msgEmpty="It's out of water"
FragType=Class'DeusEx.PlasticFragment'
bCanBeBase=True
ItemName="Water Cooler"
bPushable=False
Mesh=LodMesh'DeusExDeco.WaterCooler'
CollisionRadius=14.070000
CollisionHeight=41.570000
Mass=70.000000
Buoyancy=100.000000

Destroyed


local Vector HitLocation, HitNormal, EndTrace;
local Actor hit;
local WaterPool pool;


// trace down about 20 feet if we're not in water
if (!Region.Zone.bWaterZone)
{
EndTrace = Location - vect(0,0,320);
hit = Trace(HitLocation, HitNormal, EndTrace, Location, False);
pool = spawn(class'WaterPool',,, HitLocation+HitNormal, Rotator(HitNormal));
if (pool != None)
pool.maxDrawScale = CollisionRadius / 20.0;
}

Super.Destroyed();

Frob (Actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

if (bUsing)
return;

if (numUses <= 0)
{
if (Pawn(Frobber) != None)
Pawn(Frobber).ClientMessage(msgEmpty);
return;
}

SetTimer(2.0, False);
bUsing = True;

// heal the frobber a small bit
if (DeusExPlayer(Frobber) != None)
DeusExPlayer(Frobber).HealPlayer(1);

PlayAnim('Bubble');
AmbientSound = sound'WaterBubbling';
numUses--;

Timer


bUsing = False;
AmbientSound = None;




WaterDrips.uc (extends ParticleGenerator)

Frequency=0.100000
ejectSpeed=0.000000
particleTexture=Texture'Effects.Generated.WtrDrpSmall'
particleDrawScale=0.075000
bScale=False
bFade=False
checkTime=0.500000
bGravity=True



WaterFountain.uc (extends DeusExDecoration)

var bool bUsing;
var int numUses;
var localized String msgEmpty;
numUses=10
msgEmpty="It's out of water"
ItemName="Water Fountain"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.WaterFountain'
CollisionRadius=20.000000
CollisionHeight=24.360001
Mass=70.000000
Buoyancy=100.000000

Frob (Actor Frobber, Inventory frobWith)


Super.Frob(Frobber, frobWith);

if (numUses <= 0)
{
if (Pawn(Frobber) != None)
Pawn(Frobber).ClientMessage(msgEmpty);
return;
}

if (bUsing)
return;

SetTimer(2.0, False);
bUsing = True;

// heal the frobber a small bit
if (DeusExPlayer(Frobber) != None)
DeusExPlayer(Frobber).HealPlayer(1);

LoopAnim('Use');
AmbientSound = sound'WaterBubbling';
numUses--;

Timer


bUsing = False;
PlayAnim('Still');
AmbientSound = None;




WaterPool.uc (extends DeusExDecal)

var float spreadTime;
var float maxDrawScale;
var float time;
spreadTime=5.000000
maxDrawScale=1.500000
Texture=Texture'DeusExItems.Skins.FlatFXTex47'

Tick (float deltaTime)


time += deltaTime;
if (time <= spreadTime)
{
DrawScale = maxDrawScale * time / spreadTime;
ReattachDecal(vect(0.1,0.1,0));
}




WaterRing.uc (extends Effects)

var bool bScaleOnce;
var float extraRingTimer;
var bool bNoExtraRings;
LifeSpan=0.500000
DrawType=DT_Mesh
Style=STY_Translucent
Skin=Texture'DeusExItems.Skins.FlatFXTex46'
Mesh=LodMesh'DeusExItems.FlatFX'
bUnlit=True

PostBeginPlay


local Rotator rot;


Super.PostBeginPlay();

extraRingTimer = 0;
rot.Pitch = 16384;
rot.Roll = 0;
rot.Yaw = Rand(65535);
SetRotation(rot);

Tick (float deltaTime)


local WaterRing ring;


if (!bNoExtraRings)
{
extraRingTimer += deltaTime;
// spawn two more rings
if (extraRingTimer >= 0.2)
{
extraRingTimer = 0;
ring = Spawn(class'WaterRing');
if (ring != None)
ring.bNoExtraRings = True;
}
}

// cut the scale in half the first time we draw
if (!bScaleOnce)
{
DrawScale *= 0.5;
bScaleOnce = True;
}

DrawScale += 2.0 * deltaTime;
ScaleGlow = LifeSpan / Default.LifeSpan;




WaterZone.uc (extends ZoneInfo)

EntrySound=Sound'DeusExSounds.Generic.SplashMedium'
ExitSound=Sound'DeusExSounds.Generic.WaterOut'
EntryActor=Class'DeusEx.WaterRing'
ExitActor=Class'DeusEx.WaterRing'
bWaterZone=True
ViewFog=(Y=0.050000,Z=0.100000)
SoundRadius=0
AmbientSound=Sound'Ambient.Ambient.Underwater'



WeaponAssaultGun.uc (extends DeusExWeapon)

var float mpRecoilStrength;
LowAmmoWaterMark=30
GoverningSkill=Class'DeusEx.SkillWeaponRifle'
EnviroEffective=ENVEFF_Air
Concealability=CONC_Visual
bAutomatic=True
ShotTime=0.100000
reloadTime=3.000000
HitDamage=3
BaseAccuracy=0.700000
bCanHaveLaser=True
bCanHaveSilencer=True
AmmoNames(0)=Class'DeusEx.Ammo762mm'
AmmoNames(1)=Class'DeusEx.Ammo20mm'
ProjectileNames(1)=Class'DeusEx.HECannister20mm'
recoilStrength=0.500000
MinWeaponAcc=0.200000
mpReloadTime=0.500000
mpHitDamage=9
mpBaseAccuracy=1.000000
mpAccurateRange=2400
mpMaxRange=2400
mpReloadCount=30
bCanHaveModBaseAccuracy=True
bCanHaveModReloadCount=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
bCanHaveModRecoilStrength=True
AmmoName=Class'DeusEx.Ammo762mm'
ReloadCount=30
PickupAmmoCount=30
bInstantHit=True
FireOffset=(X=-16.000000,Y=5.000000,Z=11.500000)
shakemag=200.000000
FireSound=Sound'DeusExSounds.Weapons.AssaultGunFire'
AltFireSound=Sound'DeusExSounds.Weapons.AssaultGunReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.AssaultGunReload'
SelectSound=Sound'DeusExSounds.Weapons.AssaultGunSelect'
InventoryGroup=4
ItemName="Assault Rifle"
ItemArticle="an"
PlayerViewOffset=(X=16.000000,Y=-5.000000,Z=-11.500000)
PlayerViewMesh=LodMesh'DeusExItems.AssaultGun'
PickupViewMesh=LodMesh'DeusExItems.AssaultGunPickup'
ThirdPersonMesh=LodMesh'DeusExItems.AssaultGun3rd'
LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconAssaultGun'
largeIcon=Texture'DeusExUI.Icons.LargeIconAssaultGun'
largeIconWidth=94
largeIconHeight=65
invSlotsX=2
invSlotsY=2
Description="The 7.62x51mm assault rifle is designed for close-quarters combat, utilizing a shortened barrel and 'bullpup' design for increased maneuverability. An additional underhand 20mm HE launcher increases the rifle's effectiveness against a variety of targets."
beltDescription="ASSAULT"
Mesh=LodMesh'DeusExItems.AssaultGunPickup'
CollisionRadius=15.000000
CollisionHeight=1.100000
Mass=30.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;

// Tuned for advanced -> master skill system (Monte & Ricardo's number) client-side
recoilStrength = 0.75;
}




WeaponAssaultShotgun.uc (extends DeusExWeapon)

LowAmmoWaterMark=12
GoverningSkill=Class'DeusEx.SkillWeaponRifle'
EnviroEffective=ENVEFF_Air
bAutomatic=True
ShotTime=0.700000
reloadTime=4.500000
HitDamage=4
maxRange=2400
AccurateRange=1200
BaseAccuracy=0.800000
AmmoNames(0)=Class'DeusEx.AmmoShell'
AmmoNames(1)=Class'DeusEx.AmmoSabot'
AreaOfEffect=AOE_Cone
recoilStrength=0.700000
mpReloadTime=0.500000
mpHitDamage=5
mpBaseAccuracy=0.200000
mpAccurateRange=1800
mpMaxRange=1800
mpReloadCount=12
bCanHaveModReloadCount=True
bCanHaveModReloadTime=True
bCanHaveModRecoilStrength=True
AmmoName=Class'DeusEx.AmmoShell'
ReloadCount=12
PickupAmmoCount=12
bInstantHit=True
FireOffset=(X=-30.000000,Y=10.000000,Z=12.000000)
shakemag=50.000000
FireSound=Sound'DeusExSounds.Weapons.AssaultShotgunFire'
AltFireSound=Sound'DeusExSounds.Weapons.AssaultShotgunReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.AssaultShotgunReload'
SelectSound=Sound'DeusExSounds.Weapons.AssaultShotgunSelect'
InventoryGroup=7
ItemName="Assault Shotgun"
ItemArticle="an"
PlayerViewOffset=(Y=-10.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.AssaultShotgun'
PickupViewMesh=LodMesh'DeusExItems.AssaultShotgunPickup'
ThirdPersonMesh=LodMesh'DeusExItems.AssaultShotgun3rd'
LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconAssaultShotgun'
largeIcon=Texture'DeusExUI.Icons.LargeIconAssaultShotgun'
largeIconWidth=99
largeIconHeight=55
invSlotsX=2
invSlotsY=2
Description="The assault shotgun (sometimes referred to as a 'street sweeper') combines the best traits of a normal shotgun with a fully automatic feed that can clear an area of hostiles in a matter of seconds. Particularly effective in urban combat, the assault shotgun accepts either buckshot or sabot shells."
beltDescription="SHOTGUN"
Mesh=LodMesh'DeusExItems.AssaultShotgunPickup'
CollisionRadius=15.000000
CollisionHeight=8.000000
Mass=30.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
}




WeaponBaton.uc (extends DeusExWeapon)

LowAmmoWaterMark=0
GoverningSkill=Class'DeusEx.SkillWeaponLowTech'
NoiseLevel=0.050000
reloadTime=0.000000
HitDamage=7
maxRange=80
AccurateRange=80
BaseAccuracy=1.000000
bPenetrating=False
bHasMuzzleFlash=False
bHandToHand=True
bFallbackWeapon=True
bEmitWeaponDrawn=False
AmmoName=Class'DeusEx.AmmoNone'
ReloadCount=0
bInstantHit=True
FireOffset=(X=-24.000000,Y=14.000000,Z=17.000000)
shakemag=20.000000
FireSound=Sound'DeusExSounds.Weapons.BatonFire'
SelectSound=Sound'DeusExSounds.Weapons.BatonSelect'
Misc1Sound=Sound'DeusExSounds.Weapons.BatonHitFlesh'
Misc2Sound=Sound'DeusExSounds.Weapons.BatonHitHard'
Misc3Sound=Sound'DeusExSounds.Weapons.BatonHitSoft'
InventoryGroup=24
ItemName="Baton"
PlayerViewOffset=(X=24.000000,Y=-14.000000,Z=-17.000000)
PlayerViewMesh=LodMesh'DeusExItems.Baton'
PickupViewMesh=LodMesh'DeusExItems.BatonPickup'
ThirdPersonMesh=LodMesh'DeusExItems.Baton3rd'
Icon=Texture'DeusExUI.Icons.BeltIconBaton'
largeIcon=Texture'DeusExUI.Icons.LargeIconBaton'
largeIconWidth=46
largeIconHeight=47
Description="A hefty looking baton, typically used by riot police and national security forces to discourage civilian resistance."
beltDescription="BATON"
Mesh=LodMesh'DeusExItems.BatonPickup'
CollisionRadius=14.000000
CollisionHeight=1.000000

WeaponDamageType -> name


return 'KnockedOut';




WeaponCatScratch.uc (extends WeaponNPCMelee)

ShotTime=0.500000
HitDamage=3
maxRange=80
AccurateRange=80



WeaponCombatKnife.uc (extends DeusExWeapon)

LowAmmoWaterMark=0
GoverningSkill=Class'DeusEx.SkillWeaponLowTech'
NoiseLevel=0.050000
EnemyEffective=ENMEFF_Organic
Concealability=CONC_Visual
reloadTime=0.000000
HitDamage=5
maxRange=80
AccurateRange=80
BaseAccuracy=1.000000
bHasMuzzleFlash=False
bHandToHand=True
bFallbackWeapon=True
mpHitDamage=20
mpBaseAccuracy=1.000000
mpAccurateRange=96
mpMaxRange=96
AmmoName=Class'DeusEx.AmmoNone'
ReloadCount=0
bInstantHit=True
FireOffset=(X=-5.000000,Y=8.000000,Z=14.000000)
shakemag=20.000000
FireSound=Sound'DeusExSounds.Weapons.CombatKnifeFire'
SelectSound=Sound'DeusExSounds.Weapons.CombatKnifeSelect'
Misc1Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitFlesh'
Misc2Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitHard'
Misc3Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitSoft'
InventoryGroup=11
ItemName="Combat Knife"
PlayerViewOffset=(X=5.000000,Y=-8.000000,Z=-14.000000)
PlayerViewMesh=LodMesh'DeusExItems.CombatKnife'
PickupViewMesh=LodMesh'DeusExItems.CombatKnifePickup'
ThirdPersonMesh=LodMesh'DeusExItems.CombatKnife3rd'
Icon=Texture'DeusExUI.Icons.BeltIconCombatKnife'
largeIcon=Texture'DeusExUI.Icons.LargeIconCombatKnife'
largeIconWidth=49
largeIconHeight=45
Description="An ultra-high carbon stainless steel knife."
beltDescription="KNIFE"
Mesh=LodMesh'DeusExItems.CombatKnifePickup'
CollisionRadius=12.650000
CollisionHeight=0.800000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
}




WeaponCrowbar.uc (extends DeusExWeapon)

LowAmmoWaterMark=0
GoverningSkill=Class'DeusEx.SkillWeaponLowTech'
NoiseLevel=0.050000
reloadTime=0.000000
HitDamage=6
maxRange=80
AccurateRange=80
BaseAccuracy=1.000000
bPenetrating=False
bHasMuzzleFlash=False
bHandToHand=True
bFallbackWeapon=True
bEmitWeaponDrawn=False
mpHitDamage=12
mpBaseAccuracy=1.000000
mpAccurateRange=96
mpMaxRange=96
AmmoName=Class'DeusEx.AmmoNone'
ReloadCount=0
bInstantHit=True
FireOffset=(X=-40.000000,Y=15.000000,Z=8.000000)
shakemag=20.000000
FireSound=Sound'DeusExSounds.Weapons.CrowbarFire'
SelectSound=Sound'DeusExSounds.Weapons.CrowbarSelect'
Misc1Sound=Sound'DeusExSounds.Weapons.CrowbarHitFlesh'
Misc2Sound=Sound'DeusExSounds.Weapons.CrowbarHitHard'
Misc3Sound=Sound'DeusExSounds.Weapons.CrowbarHitSoft'
InventoryGroup=10
ItemName="Crowbar"
PlayerViewOffset=(X=40.000000,Y=-15.000000,Z=-8.000000)
PlayerViewMesh=LodMesh'DeusExItems.Crowbar'
PickupViewMesh=LodMesh'DeusExItems.CrowbarPickup'
ThirdPersonMesh=LodMesh'DeusExItems.Crowbar3rd'
LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconCrowbar'
largeIcon=Texture'DeusExUI.Icons.LargeIconCrowbar'
largeIconWidth=101
largeIconHeight=43
invSlotsX=2
Description="A crowbar. Hit someone or something with it. Repeat.|n|n Many crowbars we call 'murder of crowbars.' Always have one for kombat. Ha. -- Gunther Hermann "
beltDescription="CROWBAR"
Mesh=LodMesh'DeusExItems.CrowbarPickup'
CollisionRadius=19.000000
CollisionHeight=1.050000
Mass=15.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
}




WeaponDogBite.uc (extends WeaponNPCMelee)

ShotTime=0.500000
HitDamage=5
maxRange=80
AccurateRange=80
Misc1Sound=Sound'DeusExSounds.Animal.DogAttack1'
Misc2Sound=Sound'DeusExSounds.Animal.DogAttack1'
Misc3Sound=Sound'DeusExSounds.Animal.DogAttack2'



WeaponEMPGrenade.uc (extends DeusExWeapon)

LowAmmoWaterMark=2
GoverningSkill=Class'DeusEx.SkillDemolition'
EnemyEffective=ENMEFF_Robot
Concealability=CONC_Visual
ShotTime=0.300000
reloadTime=0.100000
HitDamage=0
maxRange=4800
AccurateRange=2400
BaseAccuracy=1.000000
bPenetrating=False
StunDuration=60.000000
bHasMuzzleFlash=False
bHandToHand=True
bUseAsDrawnWeapon=False
AITimeLimit=3.500000
AIFireDelay=5.000000
bNeedToSetMPPickupAmmo=False
mpReloadTime=0.100000
mpBaseAccuracy=1.000000
mpAccurateRange=2400
mpMaxRange=2400
AmmoName=Class'DeusEx.AmmoEMPGrenade'
ReloadCount=1
PickupAmmoCount=1
FireOffset=(Y=10.000000,Z=20.000000)
ProjectileClass=Class'DeusEx.EMPGrenade'
shakemag=50.000000
SelectSound=Sound'DeusExSounds.Weapons.EMPGrenadeSelect'
InventoryGroup=22
ItemName="Electromagnetic Pulse (EMP) Grenade"
ItemArticle="an"
PlayerViewOffset=(X=24.000000,Y=-15.000000,Z=-19.000000)
PlayerViewMesh=LodMesh'DeusExItems.EMPGrenade'
PickupViewMesh=LodMesh'DeusExItems.EMPGrenadePickup'
ThirdPersonMesh=LodMesh'DeusExItems.EMPGrenade3rd'
Icon=Texture'DeusExUI.Icons.BeltIconEMPGrenade'
largeIcon=Texture'DeusExUI.Icons.LargeIconEMPGrenade'
largeIconWidth=31
largeIconHeight=49
Description="The EMP grenade creates a localized pulse that will temporarily disable all electronics within its area of effect, including cameras and security grids.|n|n While nanotech augmentations are largely unaffected by EMP, experiments have shown that it WILL cause the spontaneous dissipation of stored bioelectric energy. -- Jaime Reyes "
beltDescription="EMP GREN"
Mesh=LodMesh'DeusExItems.EMPGrenadePickup'
CollisionRadius=3.000000
CollisionHeight=2.430000
Mass=5.000000
Buoyancy=2.000000

BecomePickup


Super.BecomePickup();
if (Level.NetMode != NM_Standalone)
if (bTossedOut)
Lifespan = 0.0;

Fire (float Value)


// if facing a wall, affix the EMPGrenade to the wall
if (Pawn(Owner) != None)
{
if (bNearWall)
{
bReadyToFire = False;
GotoState('NormalFire');
bPointing = True;
PlayAnim('Place',, 0.1);
return;
}
}

// otherwise, throw as usual
Super.Fire(Value);

PostBeginPlay


Super.PostBeginPlay();
bWeaponStay=False;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
}

ProjectileFire (class ProjClass, float ProjSpeed, bool bWarn) -> Projectile


local Projectile proj;


proj = Super.ProjectileFire(ProjClass, ProjSpeed, bWarn);

if (proj != None)
proj.PlayAnim('Open');

TestMPBeltSpot (int BeltSpot) -> bool


return (BeltSpot == 4);




WeaponFlamethrower.uc (extends DeusExWeapon)

var int BurnTime, BurnDamage;
var int mpBurnTime;
var int mpBurnDamage;
burnTime=30
BurnDamage=5
mpBurnTime=15
mpBurnDamage=2
LowAmmoWaterMark=50
GoverningSkill=Class'DeusEx.SkillWeaponHeavy'
EnviroEffective=ENVEFF_Air
bAutomatic=True
ShotTime=0.100000
reloadTime=5.500000
HitDamage=2
maxRange=320
AccurateRange=320
BaseAccuracy=0.900000
bHasMuzzleFlash=False
mpReloadTime=0.500000
mpHitDamage=5
mpBaseAccuracy=0.900000
mpAccurateRange=320
mpMaxRange=320
mpReloadCount=100
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
AmmoName=Class'DeusEx.AmmoNapalm'
ReloadCount=100
PickupAmmoCount=100
FireOffset=(Y=10.000000,Z=10.000000)
ProjectileClass=Class'DeusEx.Fireball'
shakemag=10.000000
FireSound=Sound'DeusExSounds.Weapons.FlamethrowerFire'
AltFireSound=Sound'DeusExSounds.Weapons.FlamethrowerReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.FlamethrowerReload'
SelectSound=Sound'DeusExSounds.Weapons.FlamethrowerSelect'
InventoryGroup=15
ItemName="Flamethrower"
PlayerViewOffset=(X=20.000000,Y=-14.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.Flamethrower'
PickupViewMesh=LodMesh'DeusExItems.FlamethrowerPickup'
ThirdPersonMesh=LodMesh'DeusExItems.Flamethrower3rd'
LandSound=Sound'DeusExSounds.Generic.DropLargeWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconFlamethrower'
largeIcon=Texture'DeusExUI.Icons.LargeIconFlamethrower'
largeIconWidth=203
largeIconHeight=69
invSlotsX=4
invSlotsY=2
Description="A portable flamethrower that discards the old and highly dangerous backpack fuel delivery system in favor of pressurized canisters of napalm. Inexperienced agents will find that a flamethrower can be difficult to maneuver, however."
beltDescription="FLAMETHWR"
Mesh=LodMesh'DeusExItems.FlamethrowerPickup'
CollisionRadius=20.500000
CollisionHeight=4.400000
Mass=40.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy=mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
BurnTime = mpBurnTime;
BurnDamage = mpBurnDamage;
PickupAmmoCount = mpReloadCount;
}




WeaponGEPGun.uc (extends DeusExWeapon)

var localized String shortName;
ShortName="GEP Gun"
LowAmmoWaterMark=4
GoverningSkill=Class'DeusEx.SkillWeaponHeavy'
NoiseLevel=2.000000
EnviroEffective=ENVEFF_Air
ShotTime=2.000000
reloadTime=2.000000
HitDamage=300
maxRange=24000
AccurateRange=14400
bCanHaveScope=True
bCanTrack=True
LockTime=2.000000
LockedSound=Sound'DeusExSounds.Weapons.GEPGunLock'
TrackingSound=Sound'DeusExSounds.Weapons.GEPGunTrack'
AmmoNames(0)=Class'DeusEx.AmmoRocket'
AmmoNames(1)=Class'DeusEx.AmmoRocketWP'
ProjectileNames(0)=Class'DeusEx.Rocket'
ProjectileNames(1)=Class'DeusEx.RocketWP'
bHasMuzzleFlash=False
recoilStrength=1.000000
bUseWhileCrouched=False
mpHitDamage=40
mpAccurateRange=14400
mpMaxRange=14400
mpReloadCount=1
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
AmmoName=Class'DeusEx.AmmoRocket'
ReloadCount=1
PickupAmmoCount=4
FireOffset=(X=-46.000000,Y=22.000000,Z=10.000000)
ProjectileClass=Class'DeusEx.Rocket'
shakemag=500.000000
FireSound=Sound'DeusExSounds.Weapons.GEPGunFire'
CockingSound=Sound'DeusExSounds.Weapons.GEPGunReload'
SelectSound=Sound'DeusExSounds.Weapons.GEPGunSelect'
InventoryGroup=17
ItemName="Guided Explosive Projectile (GEP) Gun"
PlayerViewOffset=(X=46.000000,Y=-22.000000,Z=-10.000000)
PlayerViewMesh=LodMesh'DeusExItems.GEPGun'
PickupViewMesh=LodMesh'DeusExItems.GEPGunPickup'
ThirdPersonMesh=LodMesh'DeusExItems.GEPGun3rd'
LandSound=Sound'DeusExSounds.Generic.DropLargeWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconGEPGun'
largeIcon=Texture'DeusExUI.Icons.LargeIconGEPGun'
largeIconWidth=203
largeIconHeight=77
invSlotsX=4
invSlotsY=2
Description="The GEP gun is a relatively recent invention in the field of armaments: a portable, shoulder-mounted launcher that can fire rockets and laser guide them to their target with pinpoint accuracy. While suitable for high-threat combat situations, it can be bulky for those agents who have not grown familiar with it."
beltDescription="GEP GUN"
Mesh=LodMesh'DeusExItems.GEPGunPickup'
CollisionRadius=27.000000
CollisionHeight=6.600000
Mass=50.000000

PostBeginPlay


Super.PostBeginPlay();

// don't let NPC geps lock on to targets
if ((Owner != None) && !Owner.IsA('DeusExPlayer'))
bCanTrack = False;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
bHasScope = True;
}




WeaponGasGrenade.uc (extends DeusExWeapon)

LowAmmoWaterMark=2
GoverningSkill=Class'DeusEx.SkillDemolition'
EnemyEffective=ENMEFF_Organic
EnviroEffective=ENVEFF_Air
Concealability=CONC_All
ShotTime=0.300000
reloadTime=0.100000
HitDamage=0
maxRange=4800
AccurateRange=2400
BaseAccuracy=1.000000
bPenetrating=False
StunDuration=60.000000
bHasMuzzleFlash=False
bHandToHand=True
bUseAsDrawnWeapon=False
AITimeLimit=4.000000
AIFireDelay=20.000000
bNeedToSetMPPickupAmmo=False
mpReloadTime=0.100000
mpHitDamage=2
mpBaseAccuracy=1.000000
mpAccurateRange=2400
mpMaxRange=2400
AmmoName=Class'DeusEx.AmmoGasGrenade'
ReloadCount=1
PickupAmmoCount=1
FireOffset=(Y=10.000000,Z=20.000000)
ProjectileClass=Class'DeusEx.GasGrenade'
shakemag=50.000000
SelectSound=Sound'DeusExSounds.Weapons.GasGrenadeSelect'
InventoryGroup=21
ItemName="Gas Grenade"
PlayerViewOffset=(Y=-13.000000,Z=-19.000000)
PlayerViewMesh=LodMesh'DeusExItems.GasGrenade'
PickupViewMesh=LodMesh'DeusExItems.GasGrenadePickup'
ThirdPersonMesh=LodMesh'DeusExItems.GasGrenade3rd'
Icon=Texture'DeusExUI.Icons.BeltIconGasGrenade'
largeIcon=Texture'DeusExUI.Icons.LargeIconGasGrenade'
largeIconWidth=23
largeIconHeight=46
Description="Upon detonation, the gas grenade releases a large amount of CS (a military-grade 'tear gas' agent) over its area of effect. CS will cause irritation to all exposed mucous membranes leading to temporary blindness and uncontrolled coughing. Like a LAM, gas grenades can be attached to any surface."
beltDescription="GAS GREN"
Mesh=LodMesh'DeusExItems.GasGrenadePickup'
CollisionRadius=2.300000
CollisionHeight=3.300000
Mass=5.000000
Buoyancy=2.000000

BecomePickup


Super.BecomePickup();
if (Level.NetMode != NM_Standalone)
if (bTossedOut)
Lifespan = 0.0;

Fire (float Value)


// if facing a wall, affix the GasGrenade to the wall
if (Pawn(Owner) != None)
{
if (bNearWall)
{
bReadyToFire = False;
GotoState('NormalFire');
bPointing = True;
PlayAnim('Place',, 0.1);
return;
}
}

// otherwise, throw as usual
Super.Fire(Value);

PostBeginPlay


Super.PostBeginPlay();
bWeaponStay=False;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
}

TestMPBeltSpot (int BeltSpot) -> bool


return (BeltSpot == 5);




WeaponGraySpit.uc (extends WeaponNPCRanged)

HitDamage=8
maxRange=450
AccurateRange=300
AreaOfEffect=AOE_Cone
bHandToHand=True
AmmoName=Class'DeusEx.AmmoGraySpit'
PickupAmmoCount=4
ProjectileClass=Class'DeusEx.GraySpit'



WeaponGraySwipe.uc (extends WeaponNPCMelee)

ShotTime=0.500000
HitDamage=6
maxRange=120
AccurateRange=120
BaseAccuracy=0.000000
Misc1Sound=Sound'DeusExSounds.Animal.GrayAttack'
Misc2Sound=Sound'DeusExSounds.Animal.GrayAttack'
Misc3Sound=Sound'DeusExSounds.Animal.GrayAttack'



WeaponGreaselSpit.uc (extends WeaponNPCRanged)

ShotTime=1.500000
HitDamage=15
maxRange=450
AccurateRange=300
bHandToHand=True
AmmoName=Class'DeusEx.AmmoGreaselSpit'
PickupAmmoCount=4
ProjectileClass=Class'DeusEx.GreaselSpit'



WeaponHideAGun.uc (extends DeusExWeapon)

LowAmmoWaterMark=0
GoverningSkill=Class'DeusEx.SkillWeaponPistol'
NoiseLevel=0.010000
Concealability=CONC_All
ShotTime=0.300000
reloadTime=0.000000
HitDamage=25
maxRange=24000
AccurateRange=14400
BaseAccuracy=0.000000
bHasMuzzleFlash=False
bEmitWeaponDrawn=False
bUseAsDrawnWeapon=False
AmmoName=Class'DeusEx.AmmoNone'
ReloadCount=0
FireOffset=(X=-20.000000,Y=10.000000,Z=16.000000)
ProjectileClass=Class'DeusEx.PlasmaBolt'
shakemag=50.000000
FireSound=Sound'DeusExSounds.Weapons.PlasmaRifleFire'
SelectSound=Sound'DeusExSounds.Weapons.HideAGunSelect'
ItemName="PS20"
PlayerViewOffset=(X=20.000000,Y=-10.000000,Z=-16.000000)
PlayerViewMesh=LodMesh'DeusExItems.HideAGun'
PickupViewMesh=LodMesh'DeusExItems.HideAGunPickup'
ThirdPersonMesh=LodMesh'DeusExItems.HideAGun3rd'
Icon=Texture'DeusExUI.Icons.BeltIconHideAGun'
largeIcon=Texture'DeusExUI.Icons.LargeIconHideAGun'
largeIconWidth=29
largeIconHeight=47
Description="The PS20 is a disposable, plasma-based weapon developed by an unknown security organization as a next generation stealth pistol. Unfortunately, the necessity of maintaining a small physical profile restricts the weapon to a single shot. Despite its limited functionality, the PS20 can be lethal at close range."
beltDescription="PS20"
Mesh=LodMesh'DeusExItems.HideAGunPickup'
CollisionRadius=3.300000
CollisionHeight=0.600000
Mass=5.000000
Buoyancy=2.000000



WeaponKarkianBite.uc (extends WeaponNPCMelee)

ShotTime=0.100000
HitDamage=15
maxRange=120
AccurateRange=120
BaseAccuracy=0.000000
bFallbackWeapon=True
Misc1Sound=Sound'DeusExSounds.Animal.KarkianAttack'
Misc2Sound=Sound'DeusExSounds.Animal.KarkianAttack'
Misc3Sound=Sound'DeusExSounds.Animal.KarkianAttack'



WeaponKarkianBump.uc (extends WeaponNPCMelee)

ShotTime=0.100000
HitDamage=15
maxRange=80
AccurateRange=80
BaseAccuracy=0.000000
AITimeLimit=10.000000
AIFireDelay=8.000000
Misc1Sound=Sound'DeusExSounds.Animal.KarkianAttack'
Misc2Sound=Sound'DeusExSounds.Animal.KarkianAttack'
Misc3Sound=Sound'DeusExSounds.Animal.KarkianAttack'



WeaponLAM.uc (extends DeusExWeapon)

var localized String shortName;
ShortName="LAM"
LowAmmoWaterMark=2
GoverningSkill=Class'DeusEx.SkillDemolition'
EnviroEffective=ENVEFF_AirWater
Concealability=CONC_All
ShotTime=0.300000
reloadTime=0.100000
HitDamage=50
maxRange=4800
AccurateRange=2400
BaseAccuracy=1.000000
bHasMuzzleFlash=False
bHandToHand=True
bUseAsDrawnWeapon=False
AITimeLimit=3.500000
AIFireDelay=5.000000
bNeedToSetMPPickupAmmo=False
mpReloadTime=0.100000
mpHitDamage=50
mpBaseAccuracy=1.000000
mpAccurateRange=2400
mpMaxRange=2400
AmmoName=Class'DeusEx.AmmoLAM'
ReloadCount=1
PickupAmmoCount=1
FireOffset=(Y=10.000000,Z=20.000000)
ProjectileClass=Class'DeusEx.LAM'
shakemag=50.000000
SelectSound=Sound'DeusExSounds.Weapons.LAMSelect'
InventoryGroup=20
ItemName="Lightweight Attack Munitions (LAM)"
PlayerViewOffset=(X=24.000000,Y=-15.000000,Z=-17.000000)
PlayerViewMesh=LodMesh'DeusExItems.LAM'
PickupViewMesh=LodMesh'DeusExItems.LAMPickup'
ThirdPersonMesh=LodMesh'DeusExItems.LAM3rd'
Icon=Texture'DeusExUI.Icons.BeltIconLAM'
largeIcon=Texture'DeusExUI.Icons.LargeIconLAM'
largeIconWidth=35
largeIconHeight=45
Description="A multi-functional explosive with electronic priming system that can either be thrown or attached to any surface with its polyhesive backing and used as a proximity mine.|n|n Disarming a proximity device should only be attempted with the proper demolitions training. Trust me on this. -- Sam Carter "
beltDescription="LAM"
Mesh=LodMesh'DeusExItems.LAMPickup'
CollisionRadius=3.800000
CollisionHeight=3.500000
Mass=5.000000
Buoyancy=2.000000

BecomePickup


Super.BecomePickup();
if (Level.NetMode != NM_Standalone)
if (bTossedOut)
Lifespan = 0.0;

Fire (float Value)


// if facing a wall, affix the LAM to the wall
if (Pawn(Owner) != None)
{
if (bNearWall)
{
bReadyToFire = False;
GotoState('NormalFire');
bPointing = True;
PlayAnim('Place',, 0.1);
return;
}
}

// otherwise, throw as usual
Super.Fire(Value);

PostBeginPlay


Super.PostBeginPlay();
bWeaponStay=False;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
}

TestMPBeltSpot (int BeltSpot) -> bool


return (BeltSpot == 6);




WeaponLAW.uc (extends DeusExWeapon)

LowAmmoWaterMark=0
GoverningSkill=Class'DeusEx.SkillWeaponHeavy'
NoiseLevel=2.000000
EnviroEffective=ENVEFF_Air
ShotTime=0.300000
reloadTime=0.000000
HitDamage=100
maxRange=24000
AccurateRange=14400
BaseAccuracy=0.600000
bHasMuzzleFlash=False
recoilStrength=1.000000
mpHitDamage=100
mpBaseAccuracy=0.600000
mpAccurateRange=14400
mpMaxRange=14400
AmmoName=Class'DeusEx.AmmoNone'
ReloadCount=0
FireOffset=(X=28.000000,Y=12.000000,Z=4.000000)
ProjectileClass=Class'DeusEx.RocketLAW'
shakemag=500.000000
FireSound=Sound'DeusExSounds.Weapons.LAWFire'
SelectSound=Sound'DeusExSounds.Weapons.LAWSelect'
InventoryGroup=16
ItemName="Light Anti-Tank Weapon (LAW)"
PlayerViewOffset=(X=18.000000,Y=-18.000000,Z=-7.000000)
PlayerViewMesh=LodMesh'DeusExItems.LAW'
PickupViewMesh=LodMesh'DeusExItems.LAWPickup'
ThirdPersonMesh=LodMesh'DeusExItems.LAW3rd'
LandSound=Sound'DeusExSounds.Generic.DropLargeWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconLAW'
largeIcon=Texture'DeusExUI.Icons.LargeIconLAW'
largeIconWidth=166
largeIconHeight=47
invSlotsX=4
Description="The LAW provides cheap, dependable anti-armor capability in the form of an integrated one-shot rocket and delivery system, though at the expense of any laser guidance. Like other heavy weapons, the LAW can slow agents who have not trained with it extensively."
beltDescription="LAW"
Mesh=LodMesh'DeusExItems.LAWPickup'
CollisionRadius=25.000000
CollisionHeight=6.800000
Mass=50.000000

BecomePickup


Super.BecomePickup();
if (Level.NetMode != NM_Standalone)
if (bTossedOut)
Lifespan = 0.0;

PostBeginPlay


Super.PostBeginPlay();
bWeaponStay=False;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
}




WeaponMJ12Commando.uc (extends WeaponNPCRanged)

ShotTime=0.200000
reloadTime=1.000000
HitDamage=15
BaseAccuracy=0.400000
bHasMuzzleFlash=True
AmmoName=Class'DeusEx.Ammo762mm'
PickupAmmoCount=50
bInstantHit=True
FireSound=Sound'DeusExSounds.Robot.RobotFireGun'
CockingSound=Sound'DeusExSounds.Weapons.AssaultGunReload'
SelectSound=Sound'DeusExSounds.Weapons.AssaultGunSelect'
PlayerViewOffset=(Y=-24.000000,Z=-12.000000)

Fire (float Value)


PlayerViewOffset.Y = -PlayerViewOffset.Y;
Super.Fire(Value);




WeaponMJ12Rocket.uc (extends WeaponNPCRanged)

ShotTime=0.500000
HitDamage=50
AIMinRange=500.000000
AIMaxRange=2000.000000
AmmoName=Class'DeusEx.AmmoRocketMini'
PickupAmmoCount=20
ProjectileClass=Class'DeusEx.RocketMini'
PlayerViewOffset=(Y=-24.000000,Z=-12.000000)

Fire (float Value)


PlayerViewOffset.Y = -PlayerViewOffset.Y;
Super.Fire(Value);




WeaponMiniCrossbow.uc (extends DeusExWeapon)

LowAmmoWaterMark=4
GoverningSkill=Class'DeusEx.SkillWeaponPistol'
NoiseLevel=0.050000
EnemyEffective=ENMEFF_Organic
Concealability=CONC_All
ShotTime=0.800000
reloadTime=2.000000
HitDamage=25
maxRange=1600
AccurateRange=800
BaseAccuracy=0.800000
bCanHaveScope=True
ScopeFOV=15
bCanHaveLaser=True
bHasSilencer=True
AmmoNames(0)=Class'DeusEx.AmmoDartPoison'
AmmoNames(1)=Class'DeusEx.AmmoDart'
AmmoNames(2)=Class'DeusEx.AmmoDartFlare'
ProjectileNames(0)=Class'DeusEx.DartPoison'
ProjectileNames(1)=Class'DeusEx.Dart'
ProjectileNames(2)=Class'DeusEx.DartFlare'
StunDuration=10.000000
bHasMuzzleFlash=False
mpReloadTime=0.500000
mpHitDamage=30
mpBaseAccuracy=0.100000
mpAccurateRange=2000
mpMaxRange=2000
mpReloadCount=6
mpPickupAmmoCount=6
bCanHaveModBaseAccuracy=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
AmmoName=Class'DeusEx.AmmoDartPoison'
ReloadCount=4
PickupAmmoCount=4
FireOffset=(X=-25.000000,Y=8.000000,Z=14.000000)
ProjectileClass=Class'DeusEx.DartPoison'
shakemag=30.000000
FireSound=Sound'DeusExSounds.Weapons.MiniCrossbowFire'
AltFireSound=Sound'DeusExSounds.Weapons.MiniCrossbowReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.MiniCrossbowReload'
SelectSound=Sound'DeusExSounds.Weapons.MiniCrossbowSelect'
InventoryGroup=9
ItemName="Mini-Crossbow"
PlayerViewOffset=(X=25.000000,Y=-8.000000,Z=-14.000000)
PlayerViewMesh=LodMesh'DeusExItems.MiniCrossbow'
PickupViewMesh=LodMesh'DeusExItems.MiniCrossbowPickup'
ThirdPersonMesh=LodMesh'DeusExItems.MiniCrossbow3rd'
Icon=Texture'DeusExUI.Icons.BeltIconCrossbow'
largeIcon=Texture'DeusExUI.Icons.LargeIconCrossbow'
largeIconWidth=47
largeIconHeight=46
Description="The mini-crossbow was specifically developed for espionage work, and accepts a range of dart types (normal, tranquilizer, or flare) that can be changed depending upon the mission requirements."
beltDescription="CROSSBOW"
Mesh=LodMesh'DeusExItems.MiniCrossbowPickup'
CollisionRadius=8.000000
CollisionHeight=1.000000
Mass=15.000000

BeginState


if (ClipCount >= ReloadCount)
MultiSkins[3] = Texture'PinkMaskTex';

if ((AmmoType != None) && (AmmoType.AmmoAmount <= 0))
MultiSkins[3] = Texture'PinkMaskTex';

Super.BeginState();

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
PickupAmmoCount = mpReloadCount;
}

Tick (float deltaTime)


if (MultiSkins[3] != None)
if ((AmmoType != None) && (AmmoType.AmmoAmount > 0) && (ClipCount < ReloadCount))
MultiSkins[3] = None;

Super.Tick(deltaTime);




WeaponMod.uc (extends DeusExPickup)

var() Float WeaponModifier;
var localized String DragToUpgrade;
DragToUpgrade="Drag over weapon to upgrade. Weapons highlighted in GREEN can be upgraded with this mod."
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.WeaponMod'
PickupViewMesh=LodMesh'DeusExItems.WeaponMod'
ThirdPersonMesh=LodMesh'DeusExItems.WeaponMod'
LandSound=Sound'DeusExSounds.Generic.PlasticHit1'
largeIconWidth=34
largeIconHeight=49
Mesh=LodMesh'DeusExItems.WeaponMod'
CollisionRadius=3.500000
CollisionHeight=4.420000
Mass=1.000000

ApplyMod (DeusExWeapon weapon)

CanUpgradeWeapon (DeusExWeapon weapon) -> bool

DestroyMod


Destroy();

PostBeginPlay


Super.PostBeginPlay();

LoopAnim('Cycle');

UpdateInfo (Object winObject) -> bool


local PersonaInfoWindow winInfo;


winInfo = PersonaInfoWindow(winObject);
if (winInfo == None)
return False;

winInfo.Clear();
winInfo.SetTitle(itemName);
winInfo.SetText(Description $ winInfo.CR() $ winInfo.CR());

winInfo.AppendText(DragToUpgrade);

return True;




WeaponModAccuracy.uc (extends WeaponMod)

WeaponModifier=0.100000
ItemName="Weapon Modification (Accuracy)"
Icon=Texture'DeusExUI.Icons.BeltIconWeaponModAccuracy'
largeIcon=Texture'DeusExUI.Icons.LargeIconWeaponModAccuracy'
Description="When clamped to the frame of most projectile weapons, a harmonic balancer will dampen the vertical motion produced by firing a projectile, resulting in increased accuracy.|n|n Almost any weapon that has a significant amount of vibration can be modified with a balancer; I've even seen it work with the mini-crossbow and a prototype plasma gun. -- Sam Carter "
beltDescription="MOD ACCRY"
Skin=Texture'DeusExItems.Skins.WeaponModTex2'

ApplyMod (DeusExWeapon weapon)


if (weapon != None)
{
if (weapon.BaseAccuracy == 0.0)
weapon.BaseAccuracy -= WeaponModifier;
else
weapon.BaseAccuracy -= (weapon.Default.BaseAccuracy * WeaponModifier);
weapon.ModBaseAccuracy += WeaponModifier;
}

CanUpgradeWeapon (DeusExWeapon weapon) -> bool


if (weapon != None)
return (weapon.bCanHaveModBaseAccuracy && !weapon.HasMaxAccuracyMod());
else
return False;




WeaponModClip.uc (extends WeaponMod)

WeaponModifier=0.100000
ItemName="Weapon Modification (Clip)"
Icon=Texture'DeusExUI.Icons.BeltIconWeaponModClip'
largeIcon=Texture'DeusExUI.Icons.LargeIconWeaponModClip'
Description="An extended magazine that increases clip capacity beyond the factory default."
beltDescription="MOD CLIP"
Skin=Texture'DeusExItems.Skins.WeaponModTex3'

ApplyMod (DeusExWeapon weapon)


local int diff;


if (weapon != None)
{
diff = Float(weapon.Default.ReloadCount) * WeaponModifier;

// make sure we add at least one
if (diff < 1)
diff = 1;

weapon.ReloadCount += diff;
weapon.ModReloadCount += WeaponModifier;
}

CanUpgradeWeapon (DeusExWeapon weapon) -> bool


if (weapon != None)
return (weapon.bCanHaveModReloadCount && !weapon.HasMaxClipMod());
else
return False;




WeaponModLaser.uc (extends WeaponMod)

ItemName="Weapon Modification (Laser)"
Icon=Texture'DeusExUI.Icons.BeltIconWeaponModLaser'
largeIcon=Texture'DeusExUI.Icons.LargeIconWeaponModLaser'
Description="A laser targeting dot eliminates any inaccuracy resulting from the inability to visually guage a projectile's point of impact."
beltDescription="MOD LASER"
Skin=Texture'DeusExItems.Skins.WeaponModTex4'

ApplyMod (DeusExWeapon weapon)


if (weapon != None)
weapon.bHasLaser = True;

CanUpgradeWeapon (DeusExWeapon weapon) -> bool


if (weapon != None)
return (weapon.bCanHaveLaser && !weapon.bHasLaser);
else
return False;




WeaponModRange.uc (extends WeaponMod)

WeaponModifier=0.100000
ItemName="Weapon Modification (Range)"
Icon=Texture'DeusExUI.Icons.BeltIconWeaponModRange'
largeIcon=Texture'DeusExUI.Icons.LargeIconWeaponModRange'
Description="By lubricating the firing path with synthetic synovial fluid, the drag on fired projectiles is greatly reduced with a consequent increase in range.|n|n Coating the primary valve system of a flamethrower or plasma gun in synovial lubricant and then over-pressuring the delivery system will also result in an increase in range. Little trick I learned during field testing. -- Sam Carter "
beltDescription="MOD RANGE"
Skin=Texture'DeusExItems.Skins.WeaponModTex1'

ApplyMod (DeusExWeapon weapon)


if (weapon != None)
{
weapon.AccurateRange += (weapon.Default.AccurateRange * WeaponModifier);
weapon.ModAccurateRange += WeaponModifier;
}

CanUpgradeWeapon (DeusExWeapon weapon) -> bool


if (weapon != None)
return (weapon.bCanHaveModAccurateRange && !weapon.HasMaxRangeMod());
else
return False;




WeaponModRecoil.uc (extends WeaponMod)

WeaponModifier=-0.100000
ItemName="Weapon Modification (Recoil)"
Icon=Texture'DeusExUI.Icons.BeltIconWeaponModRecoil'
largeIcon=Texture'DeusExUI.Icons.LargeIconWeaponModRecoil'
Description="A stock cushioned with polycellular shock absorbing material will significantly reduce perceived recoil."
beltDescription="MOD RECOL"
Skin=Texture'DeusExItems.Skins.WeaponModTex5'

ApplyMod (DeusExWeapon weapon)


if (weapon != None)
{
weapon.recoilStrength += (weapon.Default.recoilStrength * WeaponModifier);
if (weapon.recoilStrength < 0.0)
weapon.recoilStrength = 0.0;
weapon.ModRecoilStrength += WeaponModifier;
}

CanUpgradeWeapon (DeusExWeapon weapon) -> bool


if (weapon != None)
return (weapon.bCanHaveModRecoilStrength && !weapon.HasMaxRecoilMod());
else
return False;




WeaponModReload.uc (extends WeaponMod)

WeaponModifier=-0.100000
ItemName="Weapon Modification (Reload)"
Icon=Texture'DeusExUI.Icons.BeltIconWeaponModReload'
largeIcon=Texture'DeusExUI.Icons.LargeIconWeaponModReload'
Description="A speed loader greatly decreases the time required to reload a weapon."
beltDescription="MOD RELOD"
Skin=Texture'DeusExItems.Skins.WeaponModTex6'

ApplyMod (DeusExWeapon weapon)


if (weapon != None)
{
weapon.ReloadTime += (weapon.Default.ReloadTime * WeaponModifier);
if (weapon.ReloadTime < 0.0)
weapon.ReloadTime = 0.0;
weapon.ModReloadTime += WeaponModifier;
}

CanUpgradeWeapon (DeusExWeapon weapon) -> bool


if (weapon != None)
return (weapon.bCanHaveModReloadTime && !weapon.HasMaxReloadMod());
else
return False;




WeaponModScope.uc (extends WeaponMod)

ItemName="Weapon Modification (Scope)"
Icon=Texture'DeusExUI.Icons.BeltIconWeaponModScope'
largeIcon=Texture'DeusExUI.Icons.LargeIconWeaponModScope'
Description="A telescopic scope attachment provides zoom capability and increases accuracy against distant targets."
beltDescription="MOD SCOPE"
Skin=Texture'DeusExItems.Skins.WeaponModTex8'

ApplyMod (DeusExWeapon weapon)


if (weapon != None)
weapon.bHasScope = True;

CanUpgradeWeapon (DeusExWeapon weapon) -> bool


if (weapon != None)
return (weapon.bCanHaveScope && !weapon.bHasScope);
else
return False;




WeaponModSilencer.uc (extends WeaponMod)

ItemName="Weapon Modification (Silencer)"
Icon=Texture'DeusExUI.Icons.BeltIconWeaponModSilencer'
largeIcon=Texture'DeusExUI.Icons.LargeIconWeaponModSilencer'
Description="A silencer will muffle the muzzle crack caused by rapidly expanding gases left in the wake of a bullet leaving the gun barrel.|n|n Obviously, a silencer is only effective with firearms. -- Sam Carter "
beltDescription="MOD SLNCR"
Skin=Texture'DeusExItems.Skins.WeaponModTex7'

ApplyMod (DeusExWeapon weapon)


if (weapon != None)
weapon.bHasSilencer = True;

CanUpgradeWeapon (DeusExWeapon weapon) -> bool


if (weapon != None)
return (weapon.bCanHaveSilencer && !weapon.bHasSilencer);
else
return False;




WeaponNPCMelee.uc (extends DeusExWeapon)

LowAmmoWaterMark=0
NoiseLevel=0.100000
EnemyEffective=ENMEFF_Organic
ShotTime=0.300000
reloadTime=0.000000
BaseAccuracy=1.000000
bHasMuzzleFlash=False
bHandToHand=True
bOwnerWillNotify=True
bNativeAttack=True
AmmoName=Class'DeusEx.AmmoNone'
ReloadCount=0
bInstantHit=True
shakemag=0.000000
Misc1Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitFlesh'
Misc2Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitHard'
Misc3Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitSoft'
InventoryGroup=99
PlayerViewOffset=(X=0.000000,Z=0.000000)
PlayerViewMesh=LodMesh'DeusExItems.InvisibleWeapon'
PickupViewMesh=LodMesh'DeusExItems.InvisibleWeapon'
ThirdPersonMesh=LodMesh'DeusExItems.InvisibleWeapon'
Icon=None
largeIconWidth=1
largeIconHeight=1
Mesh=LodMesh'DeusExItems.InvisibleWeapon'
CollisionRadius=1.000000
CollisionHeight=1.000000



WeaponNPCRanged.uc (extends DeusExWeapon)

LowAmmoWaterMark=0
EnemyEffective=ENMEFF_Organic
ShotTime=0.300000
reloadTime=0.000000
BaseAccuracy=0.300000
bHasMuzzleFlash=False
bOwnerWillNotify=True
bNativeAttack=True
ReloadCount=159
shakemag=0.000000
Misc1Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitFlesh'
Misc2Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitHard'
Misc3Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitSoft'
InventoryGroup=99
PlayerViewOffset=(X=0.000000,Z=0.000000)
PlayerViewMesh=LodMesh'DeusExItems.InvisibleWeapon'
PickupViewMesh=LodMesh'DeusExItems.InvisibleWeapon'
ThirdPersonMesh=LodMesh'DeusExItems.InvisibleWeapon'
Icon=None
largeIconWidth=1
largeIconHeight=1
Mesh=LodMesh'DeusExItems.InvisibleWeapon'
CollisionRadius=1.000000
CollisionHeight=1.000000
Mass=5.000000



WeaponNanoSword.uc (extends DeusExWeapon)

LowAmmoWaterMark=0
GoverningSkill=Class'DeusEx.SkillWeaponLowTech'
NoiseLevel=0.050000
reloadTime=0.000000
HitDamage=20
maxRange=96
AccurateRange=96
BaseAccuracy=1.000000
AreaOfEffect=AOE_Cone
bHasMuzzleFlash=False
bHandToHand=True
SwingOffset=(X=24.000000,Z=2.000000)
mpHitDamage=10
mpBaseAccuracy=1.000000
mpAccurateRange=150
mpMaxRange=150
AmmoName=Class'DeusEx.AmmoNone'
ReloadCount=0
bInstantHit=True
FireOffset=(X=-21.000000,Y=16.000000,Z=27.000000)
shakemag=20.000000
FireSound=Sound'DeusExSounds.Weapons.NanoSwordFire'
SelectSound=Sound'DeusExSounds.Weapons.NanoSwordSelect'
Misc1Sound=Sound'DeusExSounds.Weapons.NanoSwordHitFlesh'
Misc2Sound=Sound'DeusExSounds.Weapons.NanoSwordHitHard'
Misc3Sound=Sound'DeusExSounds.Weapons.NanoSwordHitSoft'
InventoryGroup=14
ItemName="Dragon's Tooth Sword"
ItemArticle="the"
PlayerViewOffset=(X=21.000000,Y=-16.000000,Z=-27.000000)
PlayerViewMesh=LodMesh'DeusExItems.NanoSword'
PickupViewMesh=LodMesh'DeusExItems.NanoSwordPickup'
ThirdPersonMesh=LodMesh'DeusExItems.NanoSword3rd'
LandSound=Sound'DeusExSounds.Generic.DropLargeWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconDragonTooth'
largeIcon=Texture'DeusExUI.Icons.LargeIconDragonTooth'
largeIconWidth=205
largeIconHeight=46
invSlotsX=4
Description="The true weapon of a modern warrior, the Dragon's Tooth is not a sword in the traditional sense, but a nanotechnologically constructed blade that is dynamically 'forged' on command into a non-eutactic solid. Nanoscale whetting devices insure that the blade is both unbreakable and lethally sharp."
beltDescription="DRAGON"
Mesh=LodMesh'DeusExItems.NanoSwordPickup'
CollisionRadius=32.000000
CollisionHeight=2.400000
LightType=LT_Steady
LightEffect=LE_WateryShimmer
LightBrightness=224
LightHue=160
LightSaturation=64
LightRadius=4
Mass=20.000000

BeginState


Super.BeginState();
LightType = LT_Steady;

EndState


Super.EndState();
LightType = LT_None;

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
}




WeaponNanoVirusGrenade.uc (extends DeusExWeapon)

LowAmmoWaterMark=2
GoverningSkill=Class'DeusEx.SkillDemolition'
EnemyEffective=ENMEFF_Robot
Concealability=CONC_All
ShotTime=0.300000
reloadTime=0.100000
HitDamage=0
maxRange=4800
AccurateRange=2400
BaseAccuracy=1.000000
bPenetrating=False
bHasMuzzleFlash=False
bHandToHand=True
bUseAsDrawnWeapon=False
AITimeLimit=3.500000
AIFireDelay=5.000000
AmmoName=Class'DeusEx.AmmoNanoVirusGrenade'
ReloadCount=1
PickupAmmoCount=1
FireOffset=(Y=10.000000,Z=20.000000)
ProjectileClass=Class'DeusEx.NanoVirusGrenade'
shakemag=50.000000
SelectSound=Sound'DeusExSounds.Weapons.NanoVirusGrenadeSelect'
InventoryGroup=23
ItemName="Scramble Grenade"
PlayerViewOffset=(X=24.000000,Y=-15.000000,Z=-19.000000)
PlayerViewMesh=LodMesh'DeusExItems.NanoVirusGrenade'
PickupViewMesh=LodMesh'DeusExItems.NanoVirusGrenadePickup'
ThirdPersonMesh=LodMesh'DeusExItems.NanoVirusGrenade3rd'
Icon=Texture'DeusExUI.Icons.BeltIconWeaponNanoVirus'
largeIcon=Texture'DeusExUI.Icons.LargeIconWeaponNanoVirus'
largeIconWidth=24
largeIconHeight=49
Description="The detonation of a GUARDIAN scramble grenade broadcasts a short-range, polymorphic broadband assault on the command frequencies used by almost all bots manufactured since 2028. The ensuing electronic storm causes bots within its radius of effect to indiscriminately attack other bots until command control can be re-established. Like a LAM, scramble grenades can be attached to any surface."
beltDescription="SCRM GREN"
Mesh=LodMesh'DeusExItems.NanoVirusGrenadePickup'
CollisionRadius=3.000000
CollisionHeight=2.430000
Mass=5.000000
Buoyancy=2.000000

Fire (float Value)


// if facing a wall, affix the NanoVirusGrenade to the wall
if (Pawn(Owner) != None)
{
if (bNearWall)
{
bReadyToFire = False;
GotoState('NormalFire');
bPointing = True;
PlayAnim('Place',, 0.1);
return;
}
}

// otherwise, throw as usual
Super.Fire(Value);

ProjectileFire (class ProjClass, float ProjSpeed, bool bWarn) -> Projectile


local Projectile proj;


proj = Super.ProjectileFire(ProjClass, ProjSpeed, bWarn);

if (proj != None)
proj.PlayAnim('Open');




WeaponPepperGun.uc (extends DeusExWeapon)

LowAmmoWaterMark=50
GoverningSkill=Class'DeusEx.SkillWeaponLowTech'
NoiseLevel=0.200000
EnemyEffective=ENMEFF_Organic
EnviroEffective=ENVEFF_AirVacuum
Concealability=CONC_Visual
bAutomatic=True
ShotTime=0.075000
reloadTime=4.000000
HitDamage=0
maxRange=100
AccurateRange=100
BaseAccuracy=0.700000
AreaOfEffect=AOE_Sphere
bPenetrating=False
StunDuration=15.000000
bHasMuzzleFlash=False
mpReloadTime=4.000000
mpBaseAccuracy=0.700000
mpAccurateRange=100
mpMaxRange=100
AmmoName=Class'DeusEx.AmmoPepper'
ReloadCount=100
PickupAmmoCount=100
FireOffset=(X=8.000000,Y=4.000000,Z=14.000000)
ProjectileClass=Class'DeusEx.TearGas'
shakemag=10.000000
FireSound=Sound'DeusExSounds.Weapons.PepperGunFire'
AltFireSound=Sound'DeusExSounds.Weapons.PepperGunReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.PepperGunReload'
SelectSound=Sound'DeusExSounds.Weapons.PepperGunSelect'
InventoryGroup=18
ItemName="Pepper Gun"
PlayerViewOffset=(X=16.000000,Y=-10.000000,Z=-16.000000)
PlayerViewMesh=LodMesh'DeusExItems.PepperGun'
PickupViewMesh=LodMesh'DeusExItems.PepperGunPickup'
ThirdPersonMesh=LodMesh'DeusExItems.PepperGun3rd'
Icon=Texture'DeusExUI.Icons.BeltIconPepperSpray'
largeIcon=Texture'DeusExUI.Icons.LargeIconPepperSpray'
largeIconWidth=46
largeIconHeight=40
Description="The pepper gun will accept a number of commercially available riot control agents in cartridge form and disperse them as a fine aerosol mist that can cause blindness or blistering at short-range."
beltDescription="PEPPER"
Mesh=LodMesh'DeusExItems.PepperGunPickup'
CollisionRadius=7.000000
CollisionHeight=1.500000
Mass=7.000000
Buoyancy=2.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
}




WeaponPistol.uc (extends DeusExWeapon)

LowAmmoWaterMark=6
GoverningSkill=Class'DeusEx.SkillWeaponPistol'
EnviroEffective=ENVEFF_Air
Concealability=CONC_Visual
ShotTime=0.600000
reloadTime=2.000000
HitDamage=14
maxRange=4800
AccurateRange=2400
BaseAccuracy=0.700000
bCanHaveScope=True
ScopeFOV=25
bCanHaveLaser=True
recoilStrength=0.300000
mpReloadTime=2.000000
mpHitDamage=20
mpBaseAccuracy=0.200000
mpAccurateRange=1200
mpMaxRange=1200
mpReloadCount=9
bCanHaveModBaseAccuracy=True
bCanHaveModReloadCount=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
bCanHaveModRecoilStrength=True
AmmoName=Class'DeusEx.Ammo10mm'
ReloadCount=6
PickupAmmoCount=6
bInstantHit=True
FireOffset=(X=-22.000000,Y=10.000000,Z=14.000000)
shakemag=50.000000
FireSound=Sound'DeusExSounds.Weapons.PistolFire'
CockingSound=Sound'DeusExSounds.Weapons.PistolReload'
SelectSound=Sound'DeusExSounds.Weapons.PistolSelect'
InventoryGroup=2
ItemName="Pistol"
PlayerViewOffset=(X=22.000000,Y=-10.000000,Z=-14.000000)
PlayerViewMesh=LodMesh'DeusExItems.Glock'
PickupViewMesh=LodMesh'DeusExItems.GlockPickup'
ThirdPersonMesh=LodMesh'DeusExItems.Glock3rd'
Icon=Texture'DeusExUI.Icons.BeltIconPistol'
largeIcon=Texture'DeusExUI.Icons.LargeIconPistol'
largeIconWidth=46
largeIconHeight=28
Description="A standard 10mm pistol."
beltDescription="PISTOL"
Mesh=LodMesh'DeusExItems.GlockPickup'
CollisionRadius=7.000000
CollisionHeight=1.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
}




WeaponPlasmaRifle.uc (extends DeusExWeapon)

LowAmmoWaterMark=12
GoverningSkill=Class'DeusEx.SkillWeaponHeavy'
EnviroEffective=ENVEFF_AirVacuum
reloadTime=2.000000
HitDamage=35
maxRange=24000
AccurateRange=14400
BaseAccuracy=0.600000
bCanHaveScope=True
ScopeFOV=20
bCanHaveLaser=True
AreaOfEffect=AOE_Cone
bPenetrating=False
recoilStrength=0.300000
mpReloadTime=0.500000
mpHitDamage=20
mpBaseAccuracy=0.500000
mpAccurateRange=8000
mpMaxRange=8000
mpReloadCount=12
bCanHaveModBaseAccuracy=True
bCanHaveModReloadCount=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
bCanHaveModRecoilStrength=True
AmmoName=Class'DeusEx.AmmoPlasma'
ReloadCount=12
PickupAmmoCount=12
ProjectileClass=Class'DeusEx.PlasmaBolt'
shakemag=50.000000
FireSound=Sound'DeusExSounds.Weapons.PlasmaRifleFire'
AltFireSound=Sound'DeusExSounds.Weapons.PlasmaRifleReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.PlasmaRifleReload'
SelectSound=Sound'DeusExSounds.Weapons.PlasmaRifleSelect'
InventoryGroup=8
ItemName="Plasma Rifle"
PlayerViewOffset=(X=18.000000,Z=-7.000000)
PlayerViewMesh=LodMesh'DeusExItems.PlasmaRifle'
PickupViewMesh=LodMesh'DeusExItems.PlasmaRiflePickup'
ThirdPersonMesh=LodMesh'DeusExItems.PlasmaRifle3rd'
LandSound=Sound'DeusExSounds.Generic.DropLargeWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconPlasmaRifle'
largeIcon=Texture'DeusExUI.Icons.LargeIconPlasmaRifle'
largeIconWidth=203
largeIconHeight=66
invSlotsX=4
invSlotsY=2
Description="An experimental weapon that is currently being produced as a series of one-off prototypes, the plasma gun superheats slugs of magnetically-doped plastic and accelerates the resulting gas-liquid mix using an array of linear magnets. The resulting plasma stream is deadly when used against slow-moving targets."
beltDescription="PLASMA"
Mesh=LodMesh'DeusExItems.PlasmaRiflePickup'
CollisionRadius=15.600000
CollisionHeight=5.200000
Mass=50.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
}




WeaponProd.uc (extends DeusExWeapon)

LowAmmoWaterMark=4
GoverningSkill=Class'DeusEx.SkillWeaponLowTech'
NoiseLevel=0.050000
EnemyEffective=ENMEFF_Organic
EnviroEffective=ENVEFF_Air
Concealability=CONC_Visual
ShotTime=1.000000
reloadTime=3.000000
HitDamage=15
maxRange=80
AccurateRange=80
bPenetrating=False
StunDuration=10.000000
bHasMuzzleFlash=False
mpReloadTime=3.000000
mpHitDamage=15
mpBaseAccuracy=0.500000
mpAccurateRange=80
mpMaxRange=80
mpReloadCount=4
AmmoName=Class'DeusEx.AmmoBattery'
ReloadCount=4
PickupAmmoCount=4
bInstantHit=True
FireOffset=(X=-21.000000,Y=12.000000,Z=19.000000)
shakemag=20.000000
FireSound=Sound'DeusExSounds.Weapons.ProdFire'
AltFireSound=Sound'DeusExSounds.Weapons.ProdReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.ProdReload'
SelectSound=Sound'DeusExSounds.Weapons.ProdSelect'
InventoryGroup=19
ItemName="Riot Prod"
PlayerViewOffset=(X=21.000000,Y=-12.000000,Z=-19.000000)
PlayerViewMesh=LodMesh'DeusExItems.Prod'
PickupViewMesh=LodMesh'DeusExItems.ProdPickup'
ThirdPersonMesh=LodMesh'DeusExItems.Prod3rd'
Icon=Texture'DeusExUI.Icons.BeltIconProd'
largeIcon=Texture'DeusExUI.Icons.LargeIconProd'
largeIconWidth=49
largeIconHeight=48
Description="The riot prod has been extensively used by security forces who wish to keep what remains of the crumbling peace and have found the prod to be an valuable tool. Its short range tetanizing effect is most effective when applied to the torso or when the subject is taken by surprise."
beltDescription="PROD"
Mesh=LodMesh'DeusExItems.ProdPickup'
CollisionRadius=8.750000
CollisionHeight=1.350000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
}




WeaponRatBite.uc (extends WeaponNPCMelee)

ShotTime=0.500000
HitDamage=1
maxRange=80
AccurateRange=80



WeaponRifle.uc (extends DeusExWeapon)

var float mpNoScopeMult;
mpNoScopeMult=0.350000
LowAmmoWaterMark=6
GoverningSkill=Class'DeusEx.SkillWeaponRifle'
NoiseLevel=2.000000
EnviroEffective=ENVEFF_Air
ShotTime=1.500000
reloadTime=2.000000
HitDamage=25
maxRange=48000
AccurateRange=28800
bCanHaveScope=True
bHasScope=True
bCanHaveLaser=True
bCanHaveSilencer=True
bHasMuzzleFlash=False
recoilStrength=0.400000
bUseWhileCrouched=False
mpReloadTime=2.000000
mpHitDamage=25
mpAccurateRange=28800
mpMaxRange=28800
mpReloadCount=6
bCanHaveModBaseAccuracy=True
bCanHaveModReloadCount=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
bCanHaveModRecoilStrength=True
AmmoName=Class'DeusEx.Ammo3006'
ReloadCount=6
PickupAmmoCount=6
bInstantHit=True
FireOffset=(X=-20.000000,Y=2.000000,Z=30.000000)
shakemag=50.000000
FireSound=Sound'DeusExSounds.Weapons.RifleFire'
AltFireSound=Sound'DeusExSounds.Weapons.RifleReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.RifleReload'
SelectSound=Sound'DeusExSounds.Weapons.RifleSelect'
InventoryGroup=5
ItemName="Sniper Rifle"
PlayerViewOffset=(X=20.000000,Y=-2.000000,Z=-30.000000)
PlayerViewMesh=LodMesh'DeusExItems.SniperRifle'
PickupViewMesh=LodMesh'DeusExItems.SniperRiflePickup'
ThirdPersonMesh=LodMesh'DeusExItems.SniperRifle3rd'
LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconRifle'
largeIcon=Texture'DeusExUI.Icons.LargeIconRifle'
largeIconWidth=159
largeIconHeight=47
invSlotsX=4
Description="The military sniper rifle is the superior tool for the interdiction of long-range targets. When coupled with the proven 30.06 round, a marksman can achieve tight groupings at better than 1 MOA (minute of angle) depending on environmental conditions."
beltDescription="SNIPER"
Mesh=LodMesh'DeusExItems.SniperRiflePickup'
CollisionRadius=26.000000
CollisionHeight=2.000000
Mass=30.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
bHasMuzzleFlash = True;
ReloadCount = 1;
ReloadTime = ShotTime;
}




WeaponRobotMachinegun.uc (extends WeaponNPCRanged)

ShotTime=0.100000
reloadTime=1.000000
HitDamage=6
BaseAccuracy=0.600000
bHasMuzzleFlash=True
AmmoName=Class'DeusEx.Ammo762mm'
PickupAmmoCount=50
bInstantHit=True
FireSound=Sound'DeusExSounds.Robot.RobotFireGun'
CockingSound=Sound'DeusExSounds.Weapons.AssaultGunReload'
SelectSound=Sound'DeusExSounds.Weapons.AssaultGunSelect'



WeaponRobotRocket.uc (extends WeaponNPCRanged)

ShotTime=1.000000
HitDamage=100
AIMinRange=500.000000
AIMaxRange=2000.000000
AmmoName=Class'DeusEx.AmmoRocketRobot'
PickupAmmoCount=20
ProjectileClass=Class'DeusEx.RocketRobot'
PlayerViewOffset=(Y=-46.000000,Z=36.000000)

Fire (float Value)


PlayerViewOffset.Y = -PlayerViewOffset.Y;
Super.Fire(Value);




WeaponSawedOffShotgun.uc (extends DeusExWeapon)

LowAmmoWaterMark=4
GoverningSkill=Class'DeusEx.SkillWeaponRifle'
EnviroEffective=ENVEFF_Air
Concealability=CONC_Visual
ShotTime=0.300000
reloadTime=3.000000
HitDamage=5
maxRange=2400
AccurateRange=1200
BaseAccuracy=0.600000
AmmoNames(0)=Class'DeusEx.AmmoShell'
AmmoNames(1)=Class'DeusEx.AmmoSabot'
AreaOfEffect=AOE_Cone
recoilStrength=0.500000
mpReloadTime=0.500000
mpHitDamage=9
mpBaseAccuracy=0.200000
mpAccurateRange=1200
mpMaxRange=1200
mpReloadCount=6
mpPickupAmmoCount=12
bCanHaveModReloadCount=True
bCanHaveModReloadTime=True
bCanHaveModRecoilStrength=True
AmmoName=Class'DeusEx.AmmoShell'
ReloadCount=4
PickupAmmoCount=4
bInstantHit=True
FireOffset=(X=-11.000000,Y=4.000000,Z=13.000000)
shakemag=50.000000
FireSound=Sound'DeusExSounds.Weapons.SawedOffShotgunFire'
AltFireSound=Sound'DeusExSounds.Weapons.SawedOffShotgunReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.SawedOffShotgunReload'
SelectSound=Sound'DeusExSounds.Weapons.SawedOffShotgunSelect'
InventoryGroup=6
ItemName="Sawed-off Shotgun"
PlayerViewOffset=(X=11.000000,Y=-4.000000,Z=-13.000000)
PlayerViewMesh=LodMesh'DeusExItems.Shotgun'
PickupViewMesh=LodMesh'DeusExItems.ShotgunPickup'
ThirdPersonMesh=LodMesh'DeusExItems.Shotgun3rd'
LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconShotgun'
largeIcon=Texture'DeusExUI.Icons.LargeIconShotgun'
largeIconWidth=131
largeIconHeight=45
invSlotsX=3
Description="The sawed-off, pump-action shotgun features a truncated barrel resulting in a wide spread at close range and will accept either buckshot or sabot shells."
beltDescription="SAWED-OFF"
Mesh=LodMesh'DeusExItems.ShotgunPickup'
CollisionRadius=12.000000
CollisionHeight=0.900000
Mass=15.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
PickupAmmoCount = 12; //to match assaultshotgun
}




WeaponShuriken.uc (extends DeusExWeapon)

LowAmmoWaterMark=5
GoverningSkill=Class'DeusEx.SkillWeaponLowTech'
NoiseLevel=0.050000
EnemyEffective=ENMEFF_Organic
EnviroEffective=ENVEFF_AirVacuum
Concealability=CONC_Visual
ShotTime=0.200000
reloadTime=0.200000
HitDamage=15
maxRange=1280
AccurateRange=640
BaseAccuracy=0.900000
bHasMuzzleFlash=False
bHandToHand=True
mpReloadTime=0.200000
mpHitDamage=35
mpBaseAccuracy=0.100000
mpAccurateRange=640
mpMaxRange=640
mpPickupAmmoCount=7
AmmoName=Class'DeusEx.AmmoShuriken'
ReloadCount=1
PickupAmmoCount=5
FireOffset=(X=-10.000000,Y=14.000000,Z=22.000000)
ProjectileClass=Class'DeusEx.Shuriken'
shakemag=5.000000
InventoryGroup=12
ItemName="Throwing Knives"
ItemArticle="some"
PlayerViewOffset=(X=24.000000,Y=-12.000000,Z=-21.000000)
PlayerViewMesh=LodMesh'DeusExItems.Shuriken'
PickupViewMesh=LodMesh'DeusExItems.ShurikenPickup'
ThirdPersonMesh=LodMesh'DeusExItems.Shuriken3rd'
Icon=Texture'DeusExUI.Icons.BeltIconShuriken'
largeIcon=Texture'DeusExUI.Icons.LargeIconShuriken'
largeIconWidth=36
largeIconHeight=45
Description="A favorite weapon of assassins in the Far East for centuries, throwing knives can be deadly when wielded by a master but are more generally used when it becomes desirable to send a message. The message is usually 'Your death is coming on swift feet.'"
beltDescription="THW KNIFE"
Texture=Texture'DeusExItems.Skins.ReflectionMapTex1'
Mesh=LodMesh'DeusExItems.ShurikenPickup'
CollisionRadius=7.500000
CollisionHeight=0.300000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
PickupAmmoCount = 7;
}




WeaponSpiderBot.uc (extends WeaponNPCRanged)

var ElectricityEmitter emitter;
var float zapTimer;
var vector lastHitLocation;
var int shockDamage;
shockDamage=15
ShotTime=1.500000
HitDamage=25
maxRange=1280
AccurateRange=640
BaseAccuracy=0.000000
AmmoName=Class'DeusEx.AmmoBattery'
PickupAmmoCount=20
bInstantHit=True
FireSound=Sound'DeusExSounds.Weapons.ProdFire'

Destroyed


if (emitter != None)
{
emitter.Destroy();
emitter = None;
}

Super.Destroyed();

PostBeginPlay


Super.PostBeginPlay();

zapTimer = 0;
emitter = Spawn(class'ElectricityEmitter', Self);
if (emitter != None)
{
emitter.bFlicker = False;
emitter.randomAngle = 1024;
emitter.damageAmount = shockDamage;
emitter.TurnOff();
emitter.Instigator = Pawn(Owner);
}

ProcessTraceHit (Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)


Super.ProcessTraceHit(Other, HitLocation, HitNormal, X, Y, Z);

zapTimer = 0.5;
if (emitter != None)
{
emitter.SetLocation(Owner.Location);
emitter.SetRotation(Rotator(HitLocation - emitter.Location));
emitter.TurnOn();
emitter.SetBase(Owner);
lastHitLocation = HitLocation;
}

Tick (float deltaTime)


Super.Tick(deltaTime);

if (zapTimer > 0)
{
zapTimer -= deltaTime;

// update the rotation of the emitter
emitter.SetRotation(Rotator(lastHitLocation - emitter.Location));

// turn off the electricity after the timer has expired
if (zapTimer < 0)
{
zapTimer = 0;
emitter.TurnOff();
}
}

WeaponDamageType -> name


return 'EMP';




WeaponSpiderBot2.uc (extends WeaponSpiderBot)

shockDamage=8
ShotTime=1.000000
HitDamage=5
maxRange=640
AccurateRange=320



WeaponStealthPistol.uc (extends DeusExWeapon)

GoverningSkill=Class'DeusEx.SkillWeaponPistol'
NoiseLevel=0.010000
EnviroEffective=ENVEFF_Air
Concealability=CONC_All
ShotTime=0.150000
reloadTime=1.500000
HitDamage=8
maxRange=4800
AccurateRange=2400
BaseAccuracy=0.800000
bCanHaveScope=True
ScopeFOV=25
bCanHaveLaser=True
recoilStrength=0.100000
mpReloadTime=1.500000
mpHitDamage=12
mpBaseAccuracy=0.200000
mpAccurateRange=1200
mpMaxRange=1200
mpReloadCount=12
bCanHaveModBaseAccuracy=True
bCanHaveModReloadCount=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
AmmoName=Class'DeusEx.Ammo10mm'
PickupAmmoCount=10
bInstantHit=True
FireOffset=(X=-24.000000,Y=10.000000,Z=14.000000)
shakemag=50.000000
FireSound=Sound'DeusExSounds.Weapons.StealthPistolFire'
AltFireSound=Sound'DeusExSounds.Weapons.StealthPistolReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.StealthPistolReload'
SelectSound=Sound'DeusExSounds.Weapons.StealthPistolSelect'
InventoryGroup=3
ItemName="Stealth Pistol"
PlayerViewOffset=(X=24.000000,Y=-10.000000,Z=-14.000000)
PlayerViewMesh=LodMesh'DeusExItems.StealthPistol'
PickupViewMesh=LodMesh'DeusExItems.StealthPistolPickup'
ThirdPersonMesh=LodMesh'DeusExItems.StealthPistol3rd'
Icon=Texture'DeusExUI.Icons.BeltIconStealthPistol'
largeIcon=Texture'DeusExUI.Icons.LargeIconStealthPistol'
largeIconWidth=47
largeIconHeight=37
Description="The stealth pistol is a variant of the standard 10mm pistol with a larger clip and integrated silencer designed for wet work at very close ranges."
beltDescription="STEALTH"
Mesh=LodMesh'DeusExItems.StealthPistolPickup'
CollisionRadius=8.000000
CollisionHeight=0.800000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
}




WeaponSword.uc (extends DeusExWeapon)

LowAmmoWaterMark=0
GoverningSkill=Class'DeusEx.SkillWeaponLowTech'
NoiseLevel=0.050000
EnemyEffective=ENMEFF_Organic
reloadTime=0.000000
maxRange=64
AccurateRange=64
BaseAccuracy=1.000000
bHasMuzzleFlash=False
bHandToHand=True
bFallbackWeapon=True
mpHitDamage=20
mpBaseAccuracy=1.000000
mpAccurateRange=100
mpMaxRange=100
AmmoName=Class'DeusEx.AmmoNone'
ReloadCount=0
bInstantHit=True
FireOffset=(X=-25.000000,Y=10.000000,Z=24.000000)
shakemag=20.000000
FireSound=Sound'DeusExSounds.Weapons.SwordFire'
SelectSound=Sound'DeusExSounds.Weapons.SwordSelect'
Misc1Sound=Sound'DeusExSounds.Weapons.SwordHitFlesh'
Misc2Sound=Sound'DeusExSounds.Weapons.SwordHitHard'
Misc3Sound=Sound'DeusExSounds.Weapons.SwordHitSoft'
InventoryGroup=13
ItemName="Sword"
PlayerViewOffset=(X=25.000000,Y=-10.000000,Z=-24.000000)
PlayerViewMesh=LodMesh'DeusExItems.Sword'
PickupViewMesh=LodMesh'DeusExItems.SwordPickup'
ThirdPersonMesh=LodMesh'DeusExItems.Sword3rd'
LandSound=Sound'DeusExSounds.Generic.DropLargeWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconSword'
largeIcon=Texture'DeusExUI.Icons.LargeIconSword'
largeIconWidth=130
largeIconHeight=40
invSlotsX=3
Description="A rather nasty-looking sword."
beltDescription="SWORD"
Texture=Texture'DeusExItems.Skins.ReflectionMapTex1'
Mesh=LodMesh'DeusExItems.SwordPickup'
CollisionRadius=26.000000
CollisionHeight=0.500000
Mass=20.000000

PreBeginPlay


Super.PreBeginPlay();

// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
}




WineBottle.uc (extends DeusExPickup)

bBreakable=True
maxCopies=10
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Wine"
ItemArticle="some"
PlayerViewOffset=(X=30.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.WineBottle'
PickupViewMesh=LodMesh'DeusExItems.WineBottle'
ThirdPersonMesh=LodMesh'DeusExItems.WineBottle'
LandSound=Sound'DeusExSounds.Generic.GlassHit1'
Icon=Texture'DeusExUI.Icons.BeltIconWineBottle'
largeIcon=Texture'DeusExUI.Icons.LargeIconWineBottle'
largeIconWidth=36
largeIconHeight=48
Description="A nice bottle of wine."
beltDescription="WINE"
Mesh=LodMesh'DeusExItems.WineBottle'
CollisionRadius=4.060000
CollisionHeight=16.180000
Mass=10.000000
Buoyancy=8.000000

Activate


// can't turn it off

BeginState


local DeusExPlayer player;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
{
player.HealPlayer(2, False);
player.drugEffectTimer += 5.0;
}

UseOnce();




WoodFragment.uc (extends DeusExFragment)

Fragments(0)=LodMesh'DeusExItems.WoodFragment1'
Fragments(1)=LodMesh'DeusExItems.WoodFragment2'
Fragments(2)=LodMesh'DeusExItems.WoodFragment3'
numFragmentTypes=3
elasticity=0.400000
ImpactSound=Sound'DeusExSounds.Generic.WoodHit1'
MiscSound=Sound'DeusExSounds.Generic.WoodHit2'
Mesh=LodMesh'DeusExItems.WoodFragment1'
CollisionRadius=6.000000
CollisionHeight=1.000000
Mass=5.000000
Buoyancy=6.000000



advteamdmgame.uc (extends TeamDMGame)

SkillsTotal=2000
SkillsAvail=2000
SkillsPerKill=2000
InitialAugs=2
AugsPerKill=2
bCustomizable=False

PreBeginPlay


Super.PreBeginPlay();
ResetNonCustomizableOptions();

ResetNonCustomizableOptions


Super.ResetNonCustomizableOptions();

if (!bCustomizable)
{
// DEUS_EX AMSD Values set by hand because otherwise it just loads the config settings.
SkillsTotal = 2000;
SkillsAvail = 2000;
SkillsPerKill = 2000;
InitialAugs = 2;
AugsPerKill = 2;
MPSkillStartLevel = 1;
SaveConfig();
}




ammocrate.uc (extends Containers)

var localized String AmmoReceived;
AmmoReceived="Ammo restocked"
HitPoints=4000
bFlammable=False
ItemName="Ammo Crate"
bPushable=False
bBlockSight=True
Mesh=LodMesh'DeusExItems.DXMPAmmobox'
bAlwaysRelevant=True
CollisionRadius=22.500000
CollisionHeight=16.000000
Mass=3000.000000
Buoyancy=40.000000

Frob (Actor Frobber, Inventory frobWith)


local Actor A;
local Pawn P;
local DeusExPlayer Player;
local Inventory CurInventory;


//Don't call superclass frob.

P = Pawn(Frobber);
Player = DeusExPlayer(Frobber);

if (Player != None)
{
CurInventory = Player.Inventory;
while (CurInventory != None)
{
if (CurInventory.IsA('DeusExWeapon'))
RestockWeapon(Player,DeusExWeapon(CurInventory));
CurInventory = CurInventory.Inventory;
}
Player.ClientMessage(AmmoReceived);
PlaySound(sound'WeaponPickup', SLOT_None, 0.5+FRand()*0.25, , 256, 0.95+FRand()*0.1);
}

RestockWeapon (DeusExPlayer Player, DeusExWeapon WeaponToStock)


local Ammo AmmoType;

if (WeaponToStock.AmmoType != None)
{
if (WeaponToStock.AmmoNames[0] == None)
AmmoType = Ammo(Player.FindInventoryType(WeaponToStock.AmmoName));
else
AmmoType = Ammo(Player.FindInventoryType(WeaponToStock.AmmoNames[0]));

if ((AmmoType != None) && (AmmoType.AmmoAmount < WeaponToStock.PickupAmmoCount))
{
AmmoType.AddAmmo(WeaponToStock.PickupAmmoCount - AmmoType.AmmoAmount);
}
}




basicteamdmgame.uc (extends TeamDMGame)

SkillsTotal=0
SkillsAvail=0
InitialAugs=9
MPSkillStartLevel=3
bCustomizable=False

PreBeginPlay


Super.PreBeginPlay();
ResetNonCustomizableOptions();

ResetNonCustomizableOptions


Super.ResetNonCustomizableOptions();

if (!bCustomizable)
{
SkillsTotal = 0;
SkillsAvail = 0;
SkillsPerKill = 0;
InitialAugs = 9;
AugsPerKill = 0;
MPSkillStartLevel = 3;
SaveConfig();
}




deusexgspylink.uc (extends UBrowserBufferedTcpLink)

var MenuScreenJoinGame OwnerWindow;
var IpAddr MasterServerIpAddr;
var bool bOpened;
var string MasterServerAddress; // Address of the master server
var int MasterServerTCPPort; // Optional port that the master server is listening on
var int Region; // Region of the game server
var int MasterServerTimeout;
var string GameName;
var localized string ResolveFailedError;
var localized string TimeOutError;
var localized string CouldNotConnectError;
ResolveFailedError="The master server could not be resolved: "
TimeOutError="Timeout talking to the master server"
CouldNotConnectError="Connecting to the master server timed out: "

BeginPlay


Disable('Tick');
Super.BeginPlay();

Closed

Destroyed


OwnerWindow = None;
Super.Destroyed();

DoBufferQueueIO


Super.DoBufferQueueIO();

GotMatch (int MatchData)



switch(MatchData)
{
case FoundSecureRequest:
Enable('Tick');
WaitForCount(6, 5, FoundSecret);
break;
case FoundSecret:
Enable('Tick');
SendBufferedData("\\gamename\\"$GameName$"\\location\\"$Region$"\\validate\\"$Validate(WaitResult, GameName)$"\\final\\");
GotoState('FoundSecretState');
break;
case NextIP:
Enable('Tick');
if(WaitResult == "final\\")
{
OwnerWindow.QueryFinished(True);
GotoState('Done');
}
else
WaitFor("\\", 10, NextAddress);
break;
case NextAddress:
Enable('Tick');
HandleServer(WaitResult);
WaitFor("\\", 5, NextIP);
break;
default:
break;
}

GotMatchTimeout (int MatchData)


Log("Timed out in master server protocol. Waiting for "$WaitingFor$" in state "$MatchData);
OwnerWindow.QueryFinished(False, TimeOutError);
GotoState('Done');

HandleServer (string Text)


local string Address;
local string Port;


Address = ParseDelimited(Text, ":", 1);
Port = ParseDelimited(ParseDelimited(Text, ":", 2), "\\", 1);

OwnerWindow.FoundServer(Address, int(Port), "", GameName);

Opened


bOpened = True;
Enable('Tick');

WaitFor("\\basic\\\\secure\\", 5, FoundSecureRequest);

ResolveFailed


Log("DeusExGSpyLink: Failed to resolve master server address, aborting.");
OwnerWindow.QueryFinished(False, ResolveFailedError$MasterServerAddress);
GotoState('Done');

Resolved (IpAddr Addr)


// Set the address
MasterServerIpAddr.Addr = Addr.Addr;

// Handle failure.
if( MasterServerIpAddr.Addr == 0 )
{
Log( "DeusExGSpyLink: Invalid master server address, aborting." );
return;
}

// Display success message.
Log( "DeusExGSpyLink: Master Server is "$MasterServerAddress$":"$MasterServerIpAddr.Port );

// Bind the local port.
if( BindPort() == 0 )
{
Log( "DeusExGSpyLink: Error binding local port, aborting." );
return;
}

Open( MasterServerIpAddr );
SetTimer(MasterServerTimeout, False);

Start


ResetBuffer();

MasterServerIpAddr.Port = MasterServerTCPPort;

if( MasterServerAddress=="" )
MasterServerAddress = "master"$Region$".gamespy.com";

Resolve( MasterServerAddress );

Tick (float Delta)


Global.Tick(Delta);

// Hack for 0 servers in server list
if(!IsConnected() && WaitResult == "\\final\\")
{
OwnerWindow.QueryFinished(True);
GotoState('Done');
}

Timer


if(!bOpened)
{
Log("DeusExGSpyLink: Couldn't connect to master server.");
OwnerWindow.QueryFinished(False, CouldNotConnectError$MasterServerAddress);
GotoState('Done');
}




deusexlocallink.uc (extends UdpLink)

var MenuScreenJoinGame OwnerWindow;
var config string BeaconProduct;
var config int ServerBeaconPort;
BeaconProduct="DeusEx"
ServerBeaconPort=8777

BroadcastBeacon


local IpAddr Addr;
local int i;


Addr.Addr = BroadcastAddr;

for(i=0;i<10;i++)
{
Addr.Port = ServerBeaconPort + i;
SendText( Addr, "REPORTQUERY" );
}

Destroyed


OwnerWindow = None;
Super.Destroyed();

ReceivedText (IpAddr Addr, string Text)


local int n;
local int QueryPort;
local string Address;


n = len(BeaconProduct);
if( Left(Text,n+1) ~= (BeaconProduct$" ") )
{
QueryPort = int(Mid(Text, n+1));
Address = IpAddrToString(Addr);
Address = Left(Address, InStr(Address, ":"));
OwnerWindow.FoundServer(Address, QueryPort, "", BeaconProduct);
}

Start


local int p;


if( BindPort() == 0 )
{
OwnerWindow.QueryFinished(False, "DeusExLocalLink: Could not bind to a free port.");
return;
}
BroadcastBeacon();

Timer


OwnerWindow.QueryFinished(True);




deusexserverlist.uc (extends UWindowList)

var int TotalServers;
var int TotalPlayers;
var int TotalMaxPlayers;
var bool bNeedUpdateCount;
var config int MaxSimultaneousPing;
var string IP;
var int QueryPort;
var string Category; // Master server categorization
var string GameName; // Unreal, Unreal Tournament
var DeusExServerPing ServerPing;
var bool bPinging;
var bool bPingFailed;
var bool bPinged;
var bool bNoInitalPing;
var bool bOldServer;
var UBrowserRulesList RulesList;
var UBrowserPlayerList PlayerList;
var bool bKeepDescription; // don't overwrite HostName
var int PlayerListSortColumn;
var bool bLocalServer;
var float Ping;
var string HostName;
var int GamePort;
var string MapName;
var string MapTitle;
var string MapDisplayName;
var string GameType;
var string GameMode;
var int NumPlayers;
var int MaxPlayers;
var int GameVer;
var int MinNetVer;
MaxSimultaneousPing=10
PlayerListSortColumn=1

AppendItem (UWindowList L)


Super.AppendItem(L);
DeusExServerList(Sentinel).bNeedUpdateCount = True;

CancelPing


if(bPinging && ServerPing != None && ServerPing.bJustThisServer)
PingDone(False, True, False, True);

Compare (UWindowList T, UWindowList B) -> int


return 0;
//CompareCount++; //*********
//return DeusExServerList(Sentinel).Owner.Grid.Compare(DeusExServerList(T), DeusExServerList(B));

CopyExistingListItem (Class ItemClass, UWindowList SourceItem) -> UWindowList


local DeusExServerList L;


L = DeusExServerList(Super.CopyExistingListItem(ItemClass, SourceItem));

L.bLocalServer = DeusExServerList(SourceItem).bLocalServer;
L.IP = DeusExServerList(SourceItem).IP;
L.QueryPort = DeusExServerList(SourceItem).QueryPort;
L.Ping = DeusExServerList(SourceItem).Ping;
L.HostName = DeusExServerList(SourceItem).HostName;
L.GamePort = DeusExServerList(SourceItem).GamePort;
L.MapName = DeusExServerList(SourceItem).MapName;
L.MapTitle = DeusExServerList(SourceItem).MapTitle;
L.MapDisplayName= DeusExServerList(SourceItem).MapDisplayName;
L.MapName = DeusExServerList(SourceItem).MapName;
L.GameType = DeusExServerList(SourceItem).GameType;
L.GameMode = DeusExServerList(SourceItem).GameMode;
L.NumPlayers = DeusExServerList(SourceItem).NumPlayers;
L.MaxPlayers = DeusExServerList(SourceItem).MaxPlayers;
L.GameVer = DeusExServerList(SourceItem).GameVer;
L.MinNetVer = DeusExServerList(SourceItem).MinNetVer;
L.bKeepDescription = DeusExServerList(SourceItem).bKeepDescription;

return L;

DecodeServerProperties (string Data) -> bool


return True;

DestroyListItem


Owner = None;

if(ServerPing != None)
{
ServerPing.Destroy();
ServerPing = None;
}
Super.DestroyListItem();

FindExistingServer (string FindIP, int FindQueryPort) -> DeusExServerList


local UWindowList l;


for(l = Next;l != None;l = l.Next)
{
if(DeusExServerList(l).IP == FindIP && DeusExServerList(l).QueryPort == FindQueryPort)
return DeusExServerList(l);
}
return None;

GetPlayerOwner -> PlayerPawn


return DeusExServerList(Sentinel).Owner.GetPlayerPawn();

InvalidatePings


local DeusExServerList l;


for(l = DeusExServerList(Next);l != None;l = DeusExServerList(l.Next))
l.Ping = 9999;

PingDone (bool bInitial, bool bJustThisServer, bool bSuccess, bool bNoSort)


local MenuScreenJoinGame W;
local DeusExServerList OldSentinel;


// Destroy the UdpLink
if(ServerPing != None)
ServerPing.Destroy();

ServerPing = None;

bPinging = False;
bPingFailed = !bSuccess;
bPinged = True;

OldSentinel = DeusExServerList(Sentinel);
if(!bNoSort)
{
Remove();

// Move to the ping list
if(!bPingFailed || (OldSentinel != None && OldSentinel.Owner != None && OldSentinel.Owner.bShowFailedServers))
{
if(OldSentinel.Owner.PingedList != None)
OldSentinel.Owner.PingedList.AppendItem(Self);
}
}
else
{
if(OldSentinel != None && OldSentinel.Owner != None && OldSentinel != OldSentinel.Owner.PingedList)
Log("Unsorted PingDone lost as it's not in ping list!");
}

if(Sentinel != None)
{
DeusExServerList(Sentinel).bNeedUpdateCount = True;

// if(bInitial)
//ConsiderForSubsets();
}

if(!bJustThisServer)
if(OldSentinel != None)
{
W = OldSentinel.Owner;

if(W.bPingSuspend)
{
W.bPingResume = True;
W.bPingResumeInitial = bInitial;
}
else
OldSentinel.PingNext(bInitial, bNoSort);
}

OldSentinel.Owner.ListPingDone(self);

PingNext (bool bInitial, bool bNoSort)


local int TotalPinging;
local DeusExServerList l;
local bool bDone;


TotalPinging = 0;

bDone = True;
for(l = DeusExServerList(Next);l != None;l = DeusExServerList(l.Next))
{
if(!l.bPinged)
bDone = False;
if(l.bPinging)
TotalPinging ++;
}

if(bDone && Owner != None)
{
bPinging = False;
Owner.PingFinished();
}
else
if(TotalPinging < MaxSimultaneousPing)
{
for(l = DeusExServerList(Next);l != None;l = DeusExServerList(l.Next))
{
if( !l.bPinging
&& !l.bPinged
&& (!bInitial || !l.bNoInitalPing)
&& TotalPinging < MaxSimultaneousPing
)
{
TotalPinging ++;
l.PingServer(bInitial, False, bNoSort);
}

if(TotalPinging >= MaxSimultaneousPing)
break;
}
}

PingServer (bool bInitial, bool bJustThisServer, bool bNoSort)


// Create the UdpLink to ping the server
ServerPing = GetPlayerOwner().GetEntryLevel().Spawn(class'DeusExServerPing');
ServerPing.Server = Self;
ServerPing.StartQuery('GetInfo', 2);
ServerPing.bInitial = bInitial;
ServerPing.bJustThisServer = bJustThisServer;
ServerPing.bNoSort = bNoSort;
bPinging = True;

PingServers (bool bInitial, bool bNoSort)


local DeusExServerList l;


bPinging = False;

for(l = DeusExServerList(Next);l != None;l = DeusExServerList(l.Next))
{
l.bPinging = False;
l.bPingFailed = False;
l.bPinged = False;
}

PingNext(bInitial, bNoSort);

QueryFinished (UBrowserServerListFactory Fact, bool bSuccess, optional string ErrorMsg)


//DEUS_EX AMSD Call to owner for callback
Owner.ListQueryFinished(Fact, bSuccess, ErrorMsg); //*******

Remove


local DeusExServerList S;


S = DeusExServerList(Sentinel);
Super.Remove();

if(S != None)
S.bNeedUpdateCount = True;

ServerStatus


// Create the UdpLink to ping the server
ServerPing = GetPlayerOwner().GetEntryLevel().Spawn(class'DeusExServerPing');
ServerPing.Server = Self;
ServerPing.StartQuery('GetStatus', 2);
bPinging = True;

StatusDone (bool bSuccess)


// Destroy the UdpLink
ServerPing.Destroy();
ServerPing = None;

bPinging = False;

RulesList.Sort();
PlayerList.Sort();
DeusExServerList(Sentinel).Owner.PingStatusDone(Self);

UpdateServerCount


local DeusExServerList l;


TotalServers = 0;
TotalPlayers = 0;
TotalMaxPlayers = 0;

for(l = DeusExServerList(Next);l != None;l = DeusExServerList(l.Next))
{
TotalServers++;
TotalPlayers += l.NumPlayers;
TotalMaxPlayers += l.MaxPlayers;
}




deusexserverping.uc (extends UdpLink)

var DeusExServerList Server;
var IpAddr ServerIPAddr;
var float RequestSentTime;
var float LastDelta;
var name QueryState;
var bool bInitial;
var bool bJustThisServer;
var bool bNoSort;
var int PingAttempts;
var int AttemptNumber;
var int BindAttempts;
var localized string AdminEmailText;
var localized string AdminNameText;
var localized string ChangeLevelsText;
var localized string MultiplayerBotsText;
var localized string FragLimitText;
var localized string TimeLimitText;
var localized string GameModeText;
var localized string GameTypeText;
var localized string GameVersionText;
var localized string WorldLogText;
var localized string MutatorsText;
var localized string TrueString;
var localized string FalseString;
var localized string ServerAddressText;
var localized string GoalTeamScoreText;
var localized string MinPlayersText;
var localized string PlayersText;
var localized string MaxTeamsText;
var localized string BalanceTeamsText;
var localized string PlayersBalanceTeamsText;
var localized string FriendlyFireText;
var localized string MinNetVersionText;
var localized string BotSkillText;
var localized string TournamentText;
var localized string ServerModeText;
var localized string DedicatedText;
var localized string NonDedicatedText;
var localized string WorldLogWorkingText;
var localized string WorldLogWorkingTrue;
var localized string WorldLogWorkingFalse;
var localized string StartingSkillsText;
var localized string SkillsPerKillText;
var localized string StartingAugsText;
var localized string AugsPerKillText;
var localized string AugsAllowedText;
var localized string TargetKillsText;
var localized string TargetTimeText;
var localized string PasswordText;
var config int MaxBindAttempts;
var config int BindRetryTime;
var config int PingTimeout;
var config bool bUseMapName;
AdminEmailText="Admin Email"
AdminNameText="Admin Name"
ChangeLevelsText="Change Levels"
MultiplayerBotsText="Bots in Multiplayer"
FragLimitText="Frag Limit"
TimeLimitText="Time Limit"
GameModeText="Game Mode"
GameTypeText="Game Type"
GameVersionText="Game Version"
WorldLogText="ngWorldStats"
MutatorsText="Mutators"
TrueString="Enabled"
FalseString="Disabled"
ServerAddressText="Server Address"
GoalTeamScoreText="Required Team Score"
MinPlayersText="Bots Enter Game for Min. of"
PlayersText="Players"
MaxTeamsText="Max Teams"
BalanceTeamsText="Bots Balance Teams"
PlayersBalanceTeamsText="Force Team Balance"
FriendlyFireText="Friendly Fire Damage"
MinNetVersionText="Min. Compatible Version"
BotSkillText="Bot Skill"
TournamentText="Tournament Mode"
ServerModeText="Server Mode"
DedicatedText="Dedicated"
NonDedicatedText="Non-Dedicated"
WorldLogWorkingText="ngWorldStats Status"
WorldLogWorkingTrue="Processing Stats Correctly"
WorldLogWorkingFalse="Not Processing Stats Correctly"
StartingSkillsText="Skill points at start"
SkillsPerKillText="Skill points per kill"
StartingAugsText="Augmentations at start"
AugsPerKillText="Augmentations per kill"
AugsAllowedText="Augmentations"
TargetKillsText="Frag limit"
TargetTimeText="Time limit(minutes)"
PasswordText="Password protected"
MaxBindAttempts=5
BindRetryTime=10
PingTimeout=5

AddRule (string Rule, string Value)


local UBrowserRulesList RulesList;


ValidateServer();

for(RulesList = UBrowserRulesList(Server.RulesList.Next); RulesList != None; RulesList = UBrowserRulesList(RulesList.Next))
if(RulesList.Rule == Rule)
return; // Rule already exists

// Add the rule
RulesList = UBrowserRulesList(Server.RulesList.Append(class'UBrowserRulesList'));
RulesList.Rule = Rule;
RulesList.Value = Value;

GetNextValue (string In, out string Out, out string Result) -> bool


local int i;
local bool bFoundStart;


Result = "";
bFoundStart = False;

for(i=0;i {
if(bFoundStart)
{
if(Mid(In, i, 1) == "\\")
{
Out = Right(In, Len(In) - i);
return True;
}
else
{
Result = Result $ Mid(In, i, 1);
}
}
else
{
if(Mid(In, i, 1) == "\\")
{
bFoundStart = True;
}
}
}

return False;

LocalizeBoolValue (string Value) -> string


if(Value ~= "True")
return TrueString;

if(Value ~= "False")
return FalseString;

return Value;

LocalizeSkin (string SkinName) -> string


local string MeshName, Junk, SkinDesc;


MeshName = Left(SkinName, InStr(SkinName, "."));

GetNextSkin(MeshName, SkinName$"1", 0, Junk, SkinDesc);
if(Junk == "")
GetNextSkin(MeshName, SkinName, 0, Junk, SkinDesc);
if(Junk == "")
return GetItemName(SkinName);

return SkinDesc;

LocalizeTeam (string TeamNum) -> string


if(TeamNum == "255")
return "";

return TeamNum;

ParseReply (string Text, string Key) -> string


local int i;
local string Temp;


i=InStr(Text, "\\"$Key$"\\");
Temp = Mid(Text, i + Len(Key) + 2);
return Left(Temp, InStr(Temp, "\\"));

ReceivedText (IpAddr Addr, string Text)


local string Temp;
local float ElapsedTime;


// Make sure this packet really is for us.
Temp = IpAddrToString(Addr);
if(Server.IP != Left(Temp, InStr(Temp, ":")))
return;

ValidateServer();
ElapsedTime = (Level.TimeSeconds - RequestSentTime) * Level.TimeDilation;
Server.Ping = Max(1000*ElapsedTime - (0.5*LastDelta) - 10, 4); // subtract avg client and server frametime from ping.
if(!Server.bKeepDescription)
Server.HostName = Server.IP;
Server.GamePort = 0;
Server.MapName = "";
Server.MapTitle = "";
Server.MapDisplayName = "";
Server.GameType = "";
Server.GameMode = "";
Server.NumPlayers = 0;
Server.MaxPlayers = 0;
Server.GameVer = 0;
Server.MinNetVer = 0;

Temp = ParseReply(Text, "hostname");
if(Temp != "" && !Server.bKeepDescription)
Server.HostName = Temp;

Temp = ParseReply(Text, "hostport");
if(Temp != "")
Server.GamePort = Int(Temp);

Temp = ParseReply(Text, "mapname");
if(Temp != "")
Server.MapName = Temp;

Temp = ParseReply(Text, "maptitle");
if(Temp != "")
{
Server.MapTitle = Temp;
Server.MapDisplayName = Server.MapTitle;
if(Server.MapTitle == "" || Server.MapTitle ~= "Untitled" || bUseMapName)
Server.MapDisplayName = Server.MapName;
}

Temp = ParseReply(Text, "gametype");
if(Temp != "")
Server.GameType = Temp;

Temp = ParseReply(Text, "numplayers");
if(Temp != "")
Server.NumPlayers = Int(Temp);

Temp = ParseReply(Text, "maxplayers");
if(Temp != "")
Server.MaxPlayers = Int(Temp);

Temp = ParseReply(Text, "gamemode");
if(Temp != "")
Server.GameMode = Temp;

Temp = ParseReply(Text, "gamever");
if(Temp != "")
Server.GameVer = Int(Temp);

Temp = ParseReply(Text, "minnetver");
if(Temp != "")
Server.MinNetVer = Int(Temp);

if( Server.DecodeServerProperties(Text) )
{
Server.PingDone(bInitial, bJustThisServer, True, bNoSort);
Disable('Tick');
}

Resolved (IpAddr Addr)


ServerIPAddr.Addr = Addr.Addr;

GotoState('Binding');

StartQuery (name S, int InPingAttempts)


QueryState = S;
ValidateServer();
ServerIPAddr.Port = Server.QueryPort;
GotoState('Resolving');
PingAttempts=InPingAttempts;
AttemptNumber=1;

Tick (Float DeltaTime)


LastDelta = DeltaTime;

Timer


ValidateServer();
if(AttemptNumber < PingAttempts)
{
Log("Ping Timeout from "$Server.IP$". Attempt "$AttemptNumber);
AttemptNumber++;
GotoState(QueryState);
}
else
{
Log("Ping Timeout from "$Server.IP$" Giving Up");

Server.Ping = 9999;
Server.GamePort = 0;
Server.MapName = "";
Server.MapDisplayName = "";
Server.MapTitle = "";
Server.GameType = "";
Server.GameMode = "";
Server.NumPlayers = 0;
Server.MaxPlayers = 0;

Disable('Tick');

Server.PingDone(bInitial, bJustThisServer, False, bNoSort);
}

ValidateServer


if(Server.ServerPing != Self)
{
Log("ORPHANED: "$Self);
Destroy();
}




dxmaplist.uc (extends Maplist)

var(Maps) globalconfig string Maps[32];
var globalconfig string MapSizes[32];
var globalconfig int MapNum;
var localized string CycleNames[10];
var globalconfig int CycleType;
var int NumTypes;
Maps(0)="DXMP_Silo"
Maps(1)="DXMP_Area51Bunker"
Maps(2)="DXMP_Cathedral"
Maps(3)="DXMP_Cmd"
Maps(4)="DXMP_Smuggler"
MapSizes(0)="(6-10)"
MapSizes(1)="(8-14)"
MapSizes(2)="(8-14)"
MapSizes(3)="(12-16)"
MapSizes(4)="(2-6)"
CycleNames(0)="Repeat map"
CycleNames(1)="Random map"
CycleNames(2)="Loop maps"
NumTypes=3

GetNextMap -> string


local string CurrentMap;
local int NumMaps;
local int i;


CurrentMap = GetURLMap();
if ( CurrentMap != "" )
{
//Strip off any .dx
if ( Right(CurrentMap,3) ~= ".dx" )
CurrentMap = Left(CurrentMap,Len(CurrentMap)-3);
else
CurrentMap = CurrentMap;

for ( i=0; i {
if ( CurrentMap ~= Maps[i] )
{
MapNum = i;
break;
}
}
}

//Count number of maps
for (i = 0; ( (i < ArrayCount(Maps)) && (Maps[i] != "") ); i++);
NumMaps = i;

if (CycleType == MCT_STATIC)
{
MapNum = MapNum;
}
else if (CycleType == MCT_RANDOM)
{
MapNum = FRand() * NumMaps;
if (MapNum >= NumMaps)
MapNum = 0;
}
else if (CycleType == MCT_CYCLE)
{
MapNum++;
if (MapNum >= NumMaps)
MapNum = 0;
}

//save out our current mapnum
SaveConfig();

return Maps[MapNum];




numTicks=10
endValue=9.000000
defaultValue=2.000000
choiceControlPosX=203
HelpText="Sets the initial number of augmentations a player has."
actionText="Initial Augmentations"
configSetting="DeusExMPGame InitialAugs"

Super.InitWindow();

SetActionButtonWidth(179);

btnSlider.winSlider.SetValueFormat("%1.0f");




numTicks=10
endValue=9.000000
defaultValue=2.000000
choiceControlPosX=203
HelpText="Sets the number of additional augs granted to a player for a kill."
actionText="Augmentations Per Kill"
configSetting="DeusExMPGame AugsPerKill"

Super.InitWindow();

SetActionButtonWidth(179);

btnSlider.winSlider.SetValueFormat("%1.0f");




defaultValue=1
defaultInfoWidth=178
defaultInfoPosX=204
HelpText="Sets whether players receive starting augmentations and augmentations for kills."
actionText="Augmentations"
configSetting="DeusExMPGame bAugsAllowed"

Super.InitWindow();

SetActionButtonWidth(179);


local String SettingString;
local int enumIndex;
local int SettingChoice;


SettingString = player.ConsoleCommand("get " $ configSetting);
SettingChoice = 0;

for (enumIndex=0; enumIndex {
if (FalseTrue[enumIndex] == SettingString)
{
SettingChoice = enumIndex;
break;
}
}

SetValue(SettingChoice);


player.ConsoleCommand("set " $ configSetting $ " " $ FalseTrue[GetValue()]);




var globalconfig string ClassClasses[24]; //Actual classes of classes (sigh)
var localized String ClassNames[24]; //Human readable class names.
var ButtonWindow btnPortrait;
var globalconfig Texture texPortraits[24];
var int PortraitIndex;
ClassClasses(0)="DeusEx.JCDentonMale"
ClassClasses(1)="DeusEx.MPNSF"
ClassClasses(2)="DeusEx.MPUnatco"
ClassClasses(3)="DeusEx.MPMJ12"
ClassNames(0)="JC Denton"
ClassNames(1)="NSF Terrorist"
ClassNames(2)="UNATCO Trooper"
ClassNames(3)="Majestic-12 Agent"
texPortraits(0)=Texture'DeusExUI.UserInterface.menuplayersetupjcdenton'
texPortraits(1)=Texture'DeusExUI.UserInterface.menuplayersetupnsf'
texPortraits(2)=Texture'DeusExUI.UserInterface.menuplayersetupunatco'
texPortraits(3)=Texture'DeusExUI.UserInterface.menuplayersetupmj12'
defaultInfoWidth=153
defaultInfoPosX=170
HelpText="Model for your character in non-team games."
actionText="Non-Team Model"

btnPortrait = ButtonWindow(NewChild(Class'ButtonWindow'));

btnPortrait.SetSize(116, 163);
btnPortrait.SetPos(19, 27);

btnPortrait.SetBackgroundStyle(DSTY_Masked);


return (ClassClasses[ClassIndex]);


PopulateClassChoices();
CreatePortraitButton();

Super.InitWindow();

SetInitialClass();

SetActionButtonWidth(153);

btnAction.SetHelpText(HelpText);
btnInfo.SetPos(0,195);


local string TypeString;
local int typeIndex;


TypeString = player.GetDefaultURL("Class");

for (typeIndex = 0; typeIndex < arrayCount(ClassNames); typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}
UpdatePortrait();


local int typeIndex;


for (typeIndex = 0; typeIndex < arrayCount(ClassNames); typeIndex++)
{
enumText[typeIndex]=ClassNames[typeIndex];
}


player.UpdateURL("Class", GetModuleName(defaultValue), true);
player.SaveConfig();
LoadSetting();


player.UpdateURL("Class", GetModuleName(currentValue), true);
player.SaveConfig();


local string TypeString;
local int typeIndex;



TypeString = player.GetDefaultURL("Class");

for (typeIndex = 0; typeIndex < arrayCount(ClassNames); typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}


Super.SetValue(newValue);
UpdatePortrait();


btnPortrait.SetBackground(texPortraits[CurrentValue]);




var int ConnectionSpeeds[2]; //Speeds (bytes per second) for connections
var localized String ConnectionNames[2]; //Human readable connection speed names.
ConnectionSpeeds(0)=2600
ConnectionSpeeds(1)=20000
ConnectionNames(0)="Modem"
ConnectionNames(1)="DSL or better"
defaultInfoWidth=153
defaultInfoPosX=170
HelpText="Type of Internet Connection"
actionText="Connection Type"
configSetting="Player ConfiguredInternetSpeed"

return (string(ConnectionSpeeds[ConnectionIndex]));


PopulateConnectionSpeeds();

Super.InitWindow();

SetInitialConnection();

SetActionButtonWidth(153);

btnAction.SetHelpText(HelpText);


local string TypeString;
local int typeIndex;


TypeString = player.ConsoleCommand("get" @ configsetting);

for (typeIndex = 0; typeIndex < arrayCount(ConnectionNames); typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}


local int typeIndex;


for (typeIndex = 0; typeIndex < arrayCount(ConnectionNames); typeIndex++)
{
enumText[typeIndex]=ConnectionNames[typeIndex];
}


player.ConsoleCommand("set " $ configSetting $ " " $ GetModuleName(defaultValue));
LoadSetting();


player.ConsoleCommand("set" @ configsetting @ GetModuleName(currentValue));


local string TypeString;
local int typeIndex;



TypeString = player.ConsoleCommand("get" @ configsetting);

for (typeIndex = 0; typeIndex < arrayCount(ConnectionNames); typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}




var DXMapList MapList;
defaultInfoWidth=243
defaultInfoPosX=203
HelpText="Determines how the server picks the next map when the current map is done"
actionText="Map Cycling"
configSetting="DXMapList CycleType"

Super.InitWindow();

PopulateCycleTypes();

SetInitialCycleType();

SetActionButtonWidth(179);


local int CurrentType;


CurrentType = int(player.ConsoleCommand("get" @ configsetting));

SetValue(CurrentType);


local int typeIndex;


MapList = player.Spawn(class'DXMapList');

if (MapList == None)
{
return;
}

for (typeIndex = 0; typeIndex < MapList.NumTypes; typeIndex++)
{
enumText[typeIndex] = MapList.CycleNames[typeIndex];
}

MapList.Destroy();


player.ConsoleCommand("set " $ configSetting $ " " $ defaultvalue);
LoadSetting();


player.ConsoleCommand("set" @ configsetting @ currentvalue);


local int CurrentType;


CurrentType = int(player.ConsoleCommand("get" @ configsetting));

SetValue(CurrentType);




endValue=1.000000
defaultValue=0.500000
choiceControlPosX=203
HelpText="Percentage of full damage received from friendly fire."
actionText="Friendly Fire"
configSetting="DeusExMPGame fFriendlyFireMult"

Super.InitWindow();

SetActionButtonWidth(179);

btnSlider.winSlider.SetValueFormat("%1.1f");




var MenuScreenHostGame hostparent;
var globalconfig int NumGameTypes; // Number of gametypes
var globalconfig String gameTypes[24]; //Class names for game types
var localized String gameNames[24]; //Human readable gametype names.
NumGameTypes=4
gameTypes(0)="DeusEx.DeathMatchGame"
gameTypes(1)="DeusEx.BasicTeamDMGame"
gameTypes(2)="DeusEx.AdvTeamDMGame"
gameTypes(3)="DeusEx.TeamDMGame"
gameNames(0)="Deathmatch"
gameNames(1)="Basic Team Deathmatch"
gameNames(2)="Advanced Team Deathmatch"
gameNames(3)="Custom Team Deathmatch"
defaultInfoWidth=243
defaultInfoPosX=203
HelpText="Type of game to play"
actionText="Game Type"
configSetting="MenuScreenHostGame CurrentGameType"

return (gameTypes[GameIndex]);


PopulateGameTypes();

Super.InitWindow();

SetInitialGameType();

SetActionButtonWidth(179);


local string TypeString;
local int typeIndex;


TypeString = player.ConsoleCommand("get" @ configsetting);

for (typeIndex = 0; typeIndex < NumGameTypes; typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}


local int typeIndex;


for (typeIndex = 0; typeIndex < NumGameTypes; typeIndex++)
{
enumText[typeIndex]=gameNames[typeIndex];
}


player.ConsoleCommand("set " $ configSetting $ " " $ GetModuleName(defaultValue));
LoadSetting();


player.ConsoleCommand("set" @ configsetting @ GetModuleName(currentValue));


local string TypeString;
local int typeIndex;


TypeString = player.ConsoleCommand("get" @ configsetting);

for (typeIndex = 0; typeIndex < NumGameTypes; typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}


local Class TypeClass;
local GameInfo CurrentType;
local bool bCanCustomize;



Super.SetValue(newValue);

bCanCustomize = True;
if ( (hostParent != None) && (GameTypes[NewValue] != "") )
{
TypeClass = class( Player.DynamicLoadObject( GetModuleName(newValue), class'Class' ) );
if (TypeClass != None)
CurrentType = Player.Spawn(TypeClass);
if (DeusExMPGame(CurrentType) != None)
bCanCustomize = DeusExMPGame(CurrentType).bCustomizable;

hostParent.SetCustomizable(bCanCustomize);
if (CurrentType != None)
CurrentType.Destroy();
}




var DXMapList MapList;
defaultInfoWidth=243
defaultInfoPosX=203
HelpText="Map on which to begin play(includes suggested number of players for that map)"
actionText="Map"
configSetting="DXMapList MapNum"

Super.InitWindow();

PopulateMapFiles();

SetInitialMap();

SetActionButtonWidth(179);


local int CurrentMapNum;


CurrentMapNum = int(player.ConsoleCommand("get" @ configsetting));

SetValue(CurrentMapNum);


local int typeIndex;


MapList = player.Spawn(class'DXMapList');

if (MapList == None)
{
return;
}

for (typeIndex = 0; ((typeIndex < arrayCount(MapList.Maps)) && (MapList.Maps[typeIndex] != "")); typeIndex++)
{
enumText[typeIndex] = MapList.Maps[typeIndex] @ MapList.MapSizes[typeIndex];
}

MapList.Destroy();


player.ConsoleCommand("set " $ configSetting $ " " $ defaultvalue);
LoadSetting();


player.ConsoleCommand("set" @ configsetting @ currentvalue);


local int CurrentMapNum;


CurrentMapNum = int(player.ConsoleCommand("get" @ configsetting));

SetValue(CurrentMapNum);




numTicks=16
startValue=1.000000
endValue=16.000000
defaultValue=8.000000
choiceControlPosX=203
HelpText="Sets the maximum number of players allowed in the game."
actionText="Maximum # of Players"
configSetting="DeusExMPGame MaxPlayers"

Super.InitWindow();

SetActionButtonWidth(179);

btnSlider.winSlider.SetValueFormat("%1.0f");




defaultValue=1
defaultInfoWidth=153
defaultInfoPosX=170
HelpText="Whether or not to display messages during multiplayer games to inform you about gameplay rules."
actionText="Help Messages"
configSetting="DeusExPlayer bHelpMessages"

Super.InitWindow();

SetActionButtonWidth(153);

btnAction.SetHelpText(HelpText);


local String SettingString;
local int enumIndex;
local int SettingChoice;


SettingString = player.ConsoleCommand("get " $ configSetting);
SettingChoice = 0;

for (enumIndex=0; enumIndex {
if (FalseTrue[enumIndex] == SettingString)
{
SettingChoice = enumIndex;
break;
}
}

SetValue(SettingChoice);


player.ConsoleCommand("set " $ configSetting $ " " $ FalseTrue[GetValue()]);




var int ServerModes; //const value for server modes
var localized String ModeNames[2]; //Human readable server mode names.
ModeNames(0)="Dedicated"
ModeNames(1)="Non-Dedicated"
defaultValue=1
defaultInfoWidth=243
defaultInfoPosX=203
HelpText="Type of server to run. Dedicated servers do not have a local player, but run faster."
actionText="Server Mode"
configSetting="MenuScreenHostGame ServerMode"

PopulateServerModes();

Super.InitWindow();

SetInitialServerMode();

SetActionButtonWidth(179);


local int ModeSetting;


ModeSetting = int(player.ConsoleCommand("get" @ configsetting));

SetValue(ModeSetting);


local int modeIndex;


for (modeIndex = 0; modeIndex < arrayCount(ModeNames); modeIndex++)
{
enumText[modeIndex]=ModeNames[modeIndex];
}


player.ConsoleCommand("set " $ configSetting $ " " $ defaultValue);
LoadSetting();


player.ConsoleCommand("set" @ configsetting @ currentValue);


local int ModeSetting;


ModeSetting = int(player.ConsoleCommand("get" @ configsetting));

SetValue(ModeSetting);




numTicks=21
endValue=10000.000000
defaultValue=2000.000000
choiceControlPosX=203
HelpText="Sets the number of additional skill points granted to a player for a kill."
actionText="Skill Points Per Kill"
configSetting="DeusExMPGame SkillsPerKill"

Super.InitWindow();

SetActionButtonWidth(179);

btnSlider.winSlider.SetValueFormat("%1.0f");




var int SkillLevel; //const value for starting skill level
var localized String LevelNames[3]; //Human readable skill level names
LevelNames(0)="Trained(1)"
LevelNames(1)="Advanced(2)"
LevelNames(2)="Master(3)"
defaultInfoWidth=243
defaultInfoPosX=203
HelpText="Starting level for player skills, Trained, Advanced, or Master."
actionText="Starting Skill Level"
configSetting="DeusExMPGame MPSkillStartLevel"

PopulateSkillLevels();

Super.InitWindow();

SetInitialSkillLevel();

SetActionButtonWidth(179);


local int LevelSetting;


LevelSetting = int(player.ConsoleCommand("get" @ configsetting));
LevelSetting--;

SetValue(LevelSetting);


local int LevelIndex;


for (LevelIndex = 0; LevelIndex < arrayCount(LevelNames); LevelIndex++)
{
enumText[LevelIndex]=LevelNames[LevelIndex];
}


player.ConsoleCommand("set " $ configSetting $ " " $ (defaultValue + 1));
LoadSetting();


player.ConsoleCommand("set" @ configsetting @ (currentValue + 1));


local int LevelSetting;


LevelSetting = int(player.ConsoleCommand("get" @ configsetting));

SetValue(LevelSetting);




endValue=10000.000000
defaultValue=2000.000000
choiceControlPosX=203
HelpText="Sets the initial number of skill points a player has."
actionText="Initial Skill Points"
configSetting="DeusExMPGame SkillsAvail"

Super.InitWindow();

SetActionButtonWidth(179);

btnSlider.winSlider.SetValueFormat("%1.0f");




var globalconfig string TeamNumber[24]; //Team numbers (matches teamdmgame.uc)
var localized String TeamNames[24]; //Human readable Team names.
var ButtonWindow btnPortrait;
var globalconfig Texture texPortraits[24];
var int PortraitIndex;
TeamNumber(0)="0"
TeamNumber(1)="1"
TeamNumber(2)="128"
TeamNames(0)="UNATCO"
TeamNames(1)="NSF"
TeamNames(2)="AUTO"
texPortraits(0)=Texture'DeusExUI.UserInterface.menuplayersetupunatco'
texPortraits(1)=Texture'DeusExUI.UserInterface.menuplayersetupnsf'
texPortraits(2)=Texture'DeusExUI.UserInterface.menuplayersetupautoteam'
defaultValue=2
defaultInfoWidth=153
defaultInfoPosX=170
HelpText="Choice of team on which to play."
actionText="Team Model"

btnPortrait = ButtonWindow(NewChild(Class'ButtonWindow'));

btnPortrait.SetSize(116, 163);
btnPortrait.SetPos(19, 27);

btnPortrait.SetBackgroundStyle(DSTY_Masked);


return (TeamNumber[TeamIndex]);


PopulateTeamChoices();
CreatePortraitButton();

Super.InitWindow();

SetInitialTeam();

SetActionButtonWidth(153);

btnAction.SetHelpText(HelpText);
btnInfo.SetPos(0,195);


local string TypeString;
local int typeIndex;


TypeString = player.GetDefaultURL("Team");

SetValue(DefaultValue);

if (TypeString == "")
return;

for (typeIndex = 0; typeIndex < arrayCount(TeamNames); typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}

//Make sure it has a valid number.
SaveSetting();


local int typeIndex;


for (typeIndex = 0; typeIndex < arrayCount(TeamNames); typeIndex++)
{
enumText[typeIndex]=TeamNames[typeIndex];
}


player.UpdateURL("Team", GetModuleName(defaultValue), true);
player.SaveConfig();
LoadSetting();


player.UpdateURL("Team", GetModuleName(currentValue), true);
player.ChangeTeam(int(TeamNumber[currentValue]));
player.SaveConfig();


local string TypeString;
local int typeIndex;


TypeString = player.GetDefaultURL("Team");

SetValue(defaultValue);

if (TypeString == "")
return;

for (typeIndex = 0; typeIndex < arrayCount(TeamNames); typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}


Super.SetValue(newValue);
UpdatePortrait();


btnPortrait.SetBackground(texPortraits[CurrentValue]);




var String VictoryTypes[2]; //Class names for victory types
var localized String VictoryNames[2]; //Human readable VictoryType names.
var MenuScreenHostGame hostparent;
VictoryTypes(0)="Frags"
VictoryTypes(1)="Time"
VictoryNames(0)="Kill Limit"
VictoryNames(1)="Time Limit"
defaultInfoWidth=243
defaultInfoPosX=203
HelpText="Determines under what circumstances the game ends."
actionText="Victory Condition"
configSetting="DeusEXMPGame VictoryCondition"

return (VictoryTypes[GameIndex]);


PopulateVictoryTypes();

Super.InitWindow();

SetInitialVictoryType();

SetActionButtonWidth(179);


local string TypeString;
local int typeIndex;


TypeString = player.ConsoleCommand("get" @ configsetting);

for (typeIndex = 0; typeIndex < arrayCount(VictoryTypes); typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}


local int typeIndex;


for (typeIndex = 0; typeIndex < arrayCount(VictoryNames); typeIndex++)
{
enumText[typeIndex]=VictoryNames[typeIndex];
}


player.ConsoleCommand("set " $ configSetting $ " " $ GetModuleName(defaultValue));
LoadSetting();


player.ConsoleCommand("set" @ configsetting @ GetModuleName(currentValue));


local string TypeString;
local int typeIndex;


TypeString = player.ConsoleCommand("get" @ configsetting);

for (typeIndex = 0; typeIndex < arrayCount(VictoryTypes); typeIndex++)
{
if (TypeString==GetModuleName(typeIndex))
SetValue(typeIndex);
}


Super.SetValue(newValue);

if ( (hostParent != None) && (hostParent.VictoryValueChoice != None) )
hostParent.VictoryValueChoice.SetVictoryType(GetModuleName(newValue));




var MenuScreenHostGame hostparent;
var localized string TimeLimitActionText;
var localized string FragLimitActionText;
var localized string TimeLimitHelpText;
var localized string FragLimitHelpText;
TimeLimitActionText="Time Limit(minutes)"
FragLimitActionText="Kill Limit"
TimeLimitHelpText="Number of minutes until game ends"
FragLimitHelpText="Number of kills needed to win"
numTicks=40
startValue=1.000000
endValue=40.000000
defaultValue=20.000000
choiceControlPosX=203
actionText=""
configSetting="DeusExMPGame ScoreToWin"

Super.InitWindow();

SetVictoryType(player.ConsoleCommand("get DeusExMPGame VictoryCondition"));

SetActionButtonWidth(179);

btnSlider.winSlider.SetValueFormat("%1.0f");


local int TickValue;
local float TickPercent;


log("Setting victory type");
TickValue = btnSlider.winSlider.GetTickPosition();
log("Tick value is "$TickValue);

TickPercent = float(TickValue)/float(NumTicks);
log("TickPercent is "$TickPercent);

if (VictoryType ~= "Frags")
{
startvalue = 1;
numTicks = 40;
endValue = 40;
actionText = FragLimitActionText;
helpText = FragLimitHelpText;
}
else if (VictoryType ~= "Time")
{
startvalue = 1;
numTicks = 20;
endValue= 20;
actionText=TimeLimitActionText;
helpText=TimeLimitHelpText;
}

btnAction.SetButtonText(actionText);
btnSlider.SetTicks(numTicks, startValue, endValue);

TickValue = TickPercent * NumTicks;
log("new tick value is "$TickValue);
if (TickValue < 0)
TickValue = 0;
if (TickValue == NumTicks)
TickValue = NumTicks - 1;

btnSlider.winSlider.SetTickPosition(TickValue);




ButtonNames(0)="Internet Game"
ButtonNames(1)="LAN Game"
ButtonNames(2)="Player Setup"
ButtonNames(3)="Augmentations"
ButtonNames(4)="Disconnect"
ButtonNames(5)="Previous Menu"
buttonXPos=7
buttonWidth=245
buttonDefaults(0)=(Y=13,Action=MA_MenuScreen,Invoke=Class'DeusEx.menuscreenjoininternet')
buttonDefaults(1)=(Y=49,Action=MA_MenuScreen,Invoke=Class'DeusEx.menuscreenjoinlan')
buttonDefaults(2)=(Y=85,Action=MA_MenuScreen,Invoke=Class'DeusEx.menuscreenplayersetup')
buttonDefaults(3)=(Y=121,Action=MA_MenuScreen,Invoke=Class'DeusEx.menuscreenaugsetup')
buttonDefaults(4)=(Y=157,Action=MA_Custom,Key="DISCONNECT")
buttonDefaults(5)=(Y=215,Action=MA_Previous)
Title="Multiplayer Main Menu"
ClientWidth=258
ClientHeight=257
verticalOffset=2
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuMultiplayerBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuMultiplayerBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuMultiplayerBackground_3'
textureCols=2

Super.InitWindow();

UpdateButtonStatus();


switch(key)
{
case "DISCONNECT":
Player.DisconnectPlayer();
break;
}


if (player.Level.Netmode != NM_Standalone)
{
winButtons[0].SetSensitivity(False);
winButtons[1].SetSensitivity(False);
}
else
{
winButtons[4].SetSensitivity(False);
}




var String ChosenAugs[9]; //List of chosen augs
var localized string HeaderPlayerNameLabel;
var string FilterString;
var localized string HeaderAugChosenLabel;
var MenuUIScrollAreaWindow ChosenScroll;
var MenuUIListWindow ChosenAugList;
var MenuUISpecialButtonWindow btnAugUp;
var MenuUISpecialButtonWindow btnAugDown;
var MenuUIChoiceButton btnAugChoice[18];
var String ChoiceNames[18];
var int ChosenRowID;
var Name AugPrefs[9];
filterString="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890[]()"
HeaderAugChosenLabel="Augmentation Priorities"
AugPrefs(0)=AugVision
AugPrefs(1)=AugHealing
AugPrefs(2)=AugSpeed
AugPrefs(3)=AugDefense
AugPrefs(4)=AugBallistic
AugPrefs(5)=AugShield
AugPrefs(6)=AugEMP
AugPrefs(7)=AugStealth
AugPrefs(8)=AugAqualung
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_Reset)
actionButtons(2)=(Action=AB_OK)
Title="Multiplayer Augmentation Setup"
ClientWidth=537
ClientHeight=311
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuAugsBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuAugsBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuAugsBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuAugsBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.MenuAugsBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.MenuAugsBackground_6'
helpPosY=251

local Augmentation anAug;


if (AugStringName == "")
return "";
else
{
anAug = GetAugFromStringName(AugStringName);
if (anAug == None)
return "";
else
return anAug.default.AugmentationName;
}


local bool bHandled;
local int iButtonIndex;


bHandled = True;

switch( buttonPressed )
{
case btnAugUp:
ShiftAugmentation(-1);
break;

case btnAugDown:
ShiftAugmentation(1);
break;

default:
bHandled = False;
break;
}

for (iButtonIndex = 0; iButtonIndex {
if (buttonPressed == btnAugChoice[iButtonIndex])
{
HandleAugPress(iButtonIndex);
bHandled = True;
}
}

if ( !bHandled )
bHandled = Super.ButtonActivated(buttonPressed);

return bHandled;


chosenRowID = focusRowID;

if (focusRowID == 0)
return;

if ((ChosenAugList.IsRowSelected(focusRowID)))
{
ChosenAugList.EnableMultiSelect(False);
}

EnableButtons();

return;


local int TargetAugIndex;
local int SourceAugIndex;
local string SwapTemp;


for (TargetAugIndex = 0; TargetAugIndex < ArrayCount(ChosenAugs); TargetAugIndex++)
{
if (ChosenAugs[TargetAugIndex] == "")
{
for (SourceAugIndex = ArrayCount(ChosenAugs) - 1; SourceAugIndex > TargetAugIndex; SourceAugIndex--)
{
if (ChosenAugs[SourceAugIndex] != "")
{
SwapTemp = ChosenAugs[TargetAugIndex];
ChosenAugs[TargetAugIndex] = ChosenAugs[SourceAugIndex];
ChosenAugs[SourceAugIndex] = SwapTemp;
}
}
}
}


local int iButtonIndex;
local MenuUIChoiceButton CurButton;
local bool bShiftRight;
local AugmentationManager AugSys;
local Augmentation CurAug;


AugSys = Player.AugmentationSystem;

if (AugSys == None)
return;

for (CurAug = AugSys.FirstAug; CurAug != None; CurAug = CurAug.Next)
{
if ((CurAug.MPConflictSlot < 1) || (CurAug.MPConflictSlot >=10))
continue;
iButtonIndex = (CurAug.mpConflictSlot-1) * 2;
bShiftRight = btnAugChoice[iButtonIndex] != None;
if (bShiftRight)
iButtonIndex++;

if (btnAugChoice[iButtonIndex] == None)
{
btnAugChoice[iButtonIndex] = MenuUIChoiceButton(winClient.NewChild(Class'MenuUIChoiceButton'));
btnaugChoice[iButtonIndex].SetButtonText(curAug.augmentationName);
if (iButtonIndex < 16)
{
if (!bShiftRight)
{
btnAugChoice[iButtonIndex].SetPos(6, 4 + 23 * CurAug.mpConflictSlot);
}
else
{
btnAugChoice[iButtonIndex].SetPos(172, 4 + 23 * CurAug.mpConflictSlot);
}
}
else // Last button is aqualung, centered
{
btnAugChoice[iButtonIndex].SetPos(92, 4 + 23 * CurAug.mpConflictSlot);
}
btnAugChoice[iButtonIndex].SetWidth(163);
btnAugChoice[iButtonIndex].SetHelpText(curAug.MPInfo);
btnAugChoice[iButtonIndex].fontButtonText = font'FontMenuSmall';

ChoiceNames[iButtonIndex] = String(CurAug.Class.Name);
}
}


CreateMenuLabel( 381, 12, HeaderAugChosenLabel, winClient );


ChosenScroll = CreateScrollAreaWindow(winClient);

ChosenScroll.SetPos(390, 29);
ChosenScroll.SetSize(134, 152);

ChosenAugList = MenuUIListWindow(ChosenScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
ChosenAugList.EnableMultiSelect(False);
ChosenAugList.EnableAutoExpandColumns(False);
ChosenAugList.EnableHotKeys(False);

ChosenAugList.SetNumColumns(1);

ChosenAugList.SetColumnWidth(0, 140);
ChosenAugList.SetColumnType(0, COLTYPE_String);



Super.CreateControls();

CreateAugChosenHeader();
CreateAugButtons();
CreatePriorityButtons();


btnAugUp = CreateSpecialButton(357, 107, Texture'SecurityButtonPanUp_Normal', Texture'SecurityButtonPanUp_Pressed');
btnAugDown = CreateSpecialButton(357, 127, Texture'SecurityButtonPanDown_Normal', Texture'SecurityButtonPanDown_Pressed');


local MenuUISpecialButtonWindow winButton;


winButton = MenuUISpecialButtonWindow(winClient.NewChild(Class'MenuUISpecialButtonWindow'));
winButton.SetPos(posX, posY);
winButton.SetButtonTextures(texNormal, texPressed, texNormal, texPressed, texNormal, texPressed);

return winButton;


local int iButtonIndex;
local int iChosenIndex;
local bool bLeftChoice;


//Turn off other buttons if no single other skill is selected.
if ( (ChosenRowId == 0) || (!ChosenAugList.IsRowSelected(ChosenRowID)) || (ChosenAugList.IsMultiSelectEnabled()) || (ChosenAugs[ChosenAugList.RowIDToIndex(ChosenRowID)]=="") )
{
btnAugUp.SetSensitivity(False);
btnAugDown.SetSensitivity(False);
}
else
{
btnAugUp.SetSensitivity(True);
btnAugDown.SetSensitivity(True);
}

bLeftChoice = false;

for (iButtonIndex=0; iButtonIndex {
SetPressedState(iButtonIndex,False);
}

for (iButtonIndex=0; iButtonIndex {
bLeftChoice = !bLeftChoice;
for (iChosenIndex=0; iChosenIndex < ArrayCount(ChosenAugs); iChosenIndex++)
{
if ( (btnAugChoice[iButtonIndex] != None) && (ChoiceNames[iButtonIndex] == ChosenAugs[iChosenIndex]) )
{
SetPressedState(iButtonIndex,True);
if (bLeftChoice)
{
if (btnAugChoice[iButtonIndex+1] != None)
SetPressedState(iButtonIndex+1,False);
}
else
{
if (btnAugChoice[iButtonIndex-1] != None)
SetPressedState(iButtonIndex-1,False);
}
}
}
}


local int AugIndex;
local int FoundAug;


FoundAug = -1;

if (AugName == "")
return FoundAug;

for (AugIndex = 0; AugIndex < ArrayCount(ChosenAugs); AugIndex++)
{
if (AugName == ChosenAugs[AugIndex])
FoundAug = AugIndex;
}

return FoundAug;


if (enterWindow.IsA('MenuUIChoiceButton'))
{
if ((winHelp != None) && (MenuUIChoiceButton(enterWindow).helpText != ""))
{
winHelp.Show();
winHelp.SetText(MenuUIChoiceButton(enterWindow).helpText);
}
}


if ((winHelp != None) && (!bHelpAlwaysOn))
winHelp.Hide();


local Augmentation anAug;


if (AugStringName == "")
return None;

anAug = player.AugmentationSystem.FirstAug;
while (anAug != None)
{
if (AugStringName == string(anAug.Class.Name))
break;
anAug = anAug.next;
}
return anAug;


local int iChosenIndex;
local int iUnChosenIndex;
local int iOppositeIndex;


iUnChosenIndex = -1;

if ( 2 * (iButtonIndex / 2) == iButtonIndex )
iOppositeIndex = iButtonIndex + 1;
else
iOppositeIndex = iButtonIndex - 1;

iChosenIndex = FindAugInChosenList(ChoiceNames[iButtonIndex]);

//If we just are adding aug, make sure the other side isn't pressed.
if ((btnAugChoice[iOppositeIndex] != None) && (iChosenIndex == -1))
{
iUnChosenIndex = FindAugInChosenList(ChoiceNames[iOppositeIndex]);

if (iUnChosenIndex != -1)
{
ChosenAugs[iUnChosenIndex] = "";
}
}

if (iChosenIndex == -1)
{
if (iUnChosenIndex != -1)
ChosenAugs[iUnChosenIndex] = ChoiceNames[iButtonIndex];
else
ChosenAugs[ArrayCount(ChosenAugs) - 1] = ChoiceNames[iButtonIndex];
}
else
{
ChosenAugs[iChosenIndex] = "";
}

CompressChosenList();
PopulateChosenList();
EnableButtons();


Super.InitWindow();

ReadChosenAugs();

CreateChosenList();
PopulateChosenList();

ChosenAugList.SetFocusRow(0);
ChosenAugList.SelectAllRows(False);

EnableButtons();

winHelp.Hide();


return (btnAugChoice[iButtonIndex].Left_Textures[0].tex == btnAugChoice[iButtonIndex].default.Left_Textures[0].tex);


if (list == ChosenAugList)
{
ChosenSelectionChanged(numSelections, focusRowId);
}
return False;


local int AugIndex;


// First erase the old list
ChosenAugList.DeleteAllRows();

for(AugIndex=0; AugIndex if (ChosenAugs[AugIndex] != "")
ChosenAugList.AddRow(AugFamiliarName(ChosenAugs[AugIndex]));


local int AugIndex;


for (AugIndex = 0; AugIndex < ArrayCount(ChosenAugs); AugIndex++)
ChosenAugs[AugIndex] = "";

for (AugIndex = 0; ((AugIndex < ArrayCount(ChosenAugs)) && (AugIndex < ArrayCount(player.AugPrefs))); AugIndex++)
{
ChosenAugs[AugIndex] = string(player.AugPrefs[augIndex]);
if (ChosenAugs[AugIndex] == "None")
ChosenAugs[AugIndex] = "";
}

CompressChosenList();


local int AugIndex;


Super.ResetToDefaults();

for (AugIndex = 0; AugIndex < ArrayCount(player.AugPrefs); AugIndex++)
player.AugPrefs[AugIndex] = default.AugPrefs[AugIndex];

player.SaveConfig();

ReadChosenAugs();
CompressChosenList();
PopulateChosenList();


local int AugIndex;
local Augmentation CurAug;


Super.SaveSettings();

// Clear player augprefs, copy Chosen augs over
for (AugIndex = 0; AugIndex < ArrayCount(player.AugPrefs); AugIndex++)
{
player.AugPrefs[AugIndex] = '';
}

for (AugIndex = 0; ((AugIndex < ArrayCount(ChosenAugs)) && (AugIndex < ArrayCount(player.AugPrefs))); AugIndex++)
{
CurAug = GetAugFromStringName(ChosenAugs[AugIndex]);
if (CurAug != None)
player.AugPrefs[AugIndex] = CurAug.Class.Name;
}

player.SaveConfig();


local int AugIndex;
local int AugRowID;


AugIndex = RealIndex;

if (AugIndex < 0)
AugIndex = 0;
if (AugIndex >= ArrayCount(ChosenAugs))
AugIndex = (ArrayCount(ChosenAugs) - 1);

if ( ChosenAugList.GetNumRows() > 0 )
{
if ( AugIndex >= ChosenAugList.GetNumRows() )
AugIndex = ChosenAugList.GetNumRows() - 1;

AugRowID = ChosenAugList.IndexToRowId(AugIndex);

ChosenAugList.SetRow(AugRowID,True);
}
EnableButtons();


local int iNewMainTexture;
local int iNewSecondTexture;


iNewMainTexture = 0;
iNewSecondTexture = 1;

if (bPressed)
{
iNewMainTexture = 1;
iNewSecondTexture = 0;
}

if (BtnAugChoice[iButtonIndex] == None)
return;

btnAugChoice[iButtonIndex].Left_Textures[0].tex=btnAugChoice[iButtonIndex].default.Left_Textures[iNewMainTexture].tex;
btnAugChoice[iButtonIndex].Left_Textures[1].tex=btnAugChoice[iButtonIndex].default.Left_Textures[iNewSecondTexture].tex;

btnAugChoice[iButtonIndex].Right_Textures[0].tex=btnAugChoice[iButtonIndex].default.Right_Textures[iNewMainTexture].tex;
btnAugChoice[iButtonIndex].Right_Textures[1].tex=btnAugChoice[iButtonIndex].default.Right_Textures[iNewSecondTexture].tex;

btnAugChoice[iButtonIndex].Center_Textures[0].tex=btnAugChoice[iButtonIndex].default.Center_Textures[iNewMainTexture].tex;
btnAugChoice[iButtonIndex].Center_Textures[1].tex=btnAugChoice[iButtonIndex].default.Center_Textures[iNewSecondTexture].tex;


local int AugIndex;
local int AltAugIndex;
local string SwapTemp;


// Get the aug index for swapping
AugIndex = ChosenAugList.RowIdToIndex(chosenRowID);

AltAugIndex = AugIndex + dir;
if (AltAugIndex < 0)
AltAugIndex = 0;
if (AltAugIndex >= ArrayCount(ChosenAugs))
AltAugIndex = (ArrayCount(ChosenAugs) - 1);

SwapTemp = ChosenAugs[AugIndex];
ChosenAugs[AugIndex] = ChosenAugs[AltAugIndex];
ChosenAugs[AltAugIndex] = SwapTemp;

CompressChosenList();
PopulateChosenList();
SelectChosenAug(AltAugIndex);




var() globalconfig string CurrentGameType; //gametype selected (for saving in ui)
var() globalconfig int ServerMode;
var() bool bLanOnly;
var MenuChoice_VictoryType VictoryTypeChoice;
var MenuChoice_VictoryValue VictoryValueChoice;
var MenuChoice_GameType GameTypeChoice;
CurrentGameType="DeusEx.DeathMatchGame"
ServerMode=1
choiceVerticalGap=28
choiceStartY=17
choices(0)=Class'DeusEx.menuchoice_gametype'
choices(1)=Class'DeusEx.menuchoice_map'
choices(2)=Class'DeusEx.menuchoice_maxplayers'
choices(3)=Class'DeusEx.menuchoice_friendlyfire'
choices(4)=Class'DeusEx.menuchoice_Startingaugs'
choices(5)=Class'DeusEx.menuchoice_augbonus'
choices(6)=Class'DeusEx.menuchoice_skilllevel'
choices(7)=Class'DeusEx.menuchoice_startingskills'
choices(8)=Class'DeusEx.menuchoice_skillbonus'
choices(9)=Class'DeusEx.menuchoice_victorytype'
choices(10)=Class'DeusEx.menuchoice_victoryvalue'
choices(11)=Class'DeusEx.menuchoice_cycle'
choices(12)=Class'DeusEx.menuchoice_servermode'
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_Reset)
actionButtons(2)=(Action=AB_Other,Text="Start Game",Key="BEGINHOST")
Title="Host Multiplayer Game"
ClientWidth=461
ClientHeight=427
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuHostBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuHostBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuHostBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuHostBackground_4'
textureCols=2
helpPosY=377

local string mapname;
local string gametype;
local int configservermode;


//Save all settings so that they can be read.
SaveSettings();

mapname = GetGameType();
configservermode = int(player.ConsoleCommand("get MenuScreenHostGame ServerMode"));
gametype = player.ConsoleCommand("get MenuScreenHostGame CurrentGameType");

if (configservermode == MODE_DEDICATED)
player.ConsoleCommand("Relaunch " $mapname$ "?game=" $gametype$ "?-server?log=server.log");
else
player.StartListenGame(mapname $ "?game=" $ gametype);


local DXMapList MapList;
local string mapname;


MapList = player.Spawn(class'DXMapList');

if (MapList == None)
return "";

mapname = MapList.Maps[MapList.MapNum];

MapList.Destroy();

return mapname;


Super.InitWindow();

SetChoiceInfo();


local String ChoiceConfigSetting;
local String GameTypeName;
local String PropertyName;
local Class TypeClass;
local GameInfo CurrentType;
local String PropertyValue;


GameTypeName = GameTypeChoice.GameTypes[GameTypeChoice.CurrentValue];
ChoiceConfigSetting = SetButton.ConfigSetting;
PropertyName = "";

if ( (GameTypeName != "") && (ChoiceConfigSetting != "") )
{
if ( Caps(Left(ChoiceConfigSetting,Len("DeusExMPGame "))) == Caps("DeusExMPGame ") )
PropertyName = Right(ChoiceConfigSetting,Len(ChoiceConfigSetting) - Len("DeusExMPGame "));
}

if (PropertyName == "")
return;

TypeClass = class( Player.DynamicLoadObject( GameTypeName, class'Class' ) );
if (TypeClass != None)
CurrentType = Player.Spawn(TypeClass);

if (CurrentType == None)
return;

PropertyValue = CurrentType.GetPropertyText(PropertyName);

player.ConsoleCommand("set" @ SetButton.ConfigSetting @ PropertyValue);
SetButton.LoadSetting();

if (CurrentType.IsA('DeusExMPGame'))
DeusExMPGame(CurrentType).ResetNonCustomizableOptions();

CurrentType.Destroy();


if (actionKey == "BEGINHOST")
{
BeginHost();
}


local UdpServerUplink TempLink;

Super.SaveSettings();

TempLink = Player.Spawn(Class'UdpServerUplink');
if (TempLink != None)
{
TempLink.DoUplink = !bLanOnly;
TempLink.SaveConfig();
TempLink.Destroy();
}


local Window btnChoice;


btnChoice = winClient.GetTopChild();
while(btnChoice != None)
{
if (btnChoice.IsA('MenuChoice_VictoryType'))
{
VictoryTypeChoice = MenuChoice_VictoryType(btnChoice);
VictoryTypeChoice.hostParent = Self;
}

if (btnChoice.IsA('MenuChoice_VictoryValue'))
{
VictoryValueChoice = MenuChoice_VictoryValue(btnChoice);
VictoryValueChoice.hostParent = Self;
}

if (btnChoice.IsA('MenuChoice_GameType'))
{
GameTypeChoice = MenuChoice_GameType(btnChoice);
GameTypeChoice.hostParent = Self;
GameTypeChoice.SetValue(GameTypeChoice.CurrentValue);
}

btnChoice = btnChoice.GetLowerSibling();
}


local Window btnChoice;
local int iChoiceIndex;


btnChoice = winClient.GetTopChild();
while (btnChoice != None)
{
if (btnChoice.IsA('MenuUIChoice'))
{
iChoiceIndex = 0;
for (iChoiceIndex = 4; iChoiceIndex<=8; iChoiceIndex++)
{
if (btnChoice.Class == choices[iChoiceIndex])
{
MenuUIChoice(btnChoice).btnAction.SetSensitivity(bCanCustomize);
if (btnChoice.IsA('MenuUIChoiceSlider'))
MenuUIChoiceSlider(btnChoice).btnSlider.SetSensitivity(bCanCustomize);
if (!bCanCustomize)
LockButtonSetting(MenuUIChoice(btnChoice));
}
}
}
btnChoice = btnChoice.GetLowerSibling();
}




bLanOnly=True
Title="Host LAN Game"



Title="Host Internet Game"



var MenuUIChoiceButton HostButton;
var MenuUIChoiceButton JoinButton;
var MenuUIChoiceButton RefreshButton;
var localized string HeaderIPWindowLabel;
var MenuUIEditWindow IPWindow;
var localized string HostButtonName;
var localized string JoinButtonName;
var localized string RefreshButtonName;
var string FilterString;
var localized string HostButtonHelpText;
var localized string JoinButtonHelpText;
var localized string RefreshButtonHelpText;
var() config string MasterServerAddress; // Address of the master server
var() config int MasterServerTCPPort; // Optional port that the master server is listening on
var() config int Region; // Region of the game server
var() config int MasterServerTimeout;
var() config string GameName;
var MenuUIScrollAreaWindow ServerScroll;
var MenuUIListWindow ServerList;
var DeusExServerList PingedList;
var DeusExServerList UnPingedList;
var bool bShowFailedServers;
var bool bPingSuspend;
var bool bPingResume;
var bool bPingResumeInitial;
var MenuUIListHeaderButtonWindow btnHeaderHostName;
var MenuUIListHeaderButtonWindow btnHeaderMapName;
var MenuUIListHeaderButtonWindow btnHeaderGameType;
var MenuUIListHeaderButtonWindow btnHeaderNumPlayers;
var MenuUIListHeaderButtonWindow btnHeaderPing;
var bool bHostNameSortOrder;
var bool bMapNameSortOrder;
var bool bGameTypeSortOrder;
var bool bNumPlayersSortOrder;
var bool bPingSortOrder;
var localized string strHostNameLabel;
var localized string strMapNameLabel;
var localized string strGameTypeLabel;
var localized string strNumPlayersLabel;
var localized string strPingLabel;
var MenuUIScrollAreaWindow GameInfoScroll;
var MenuUIListWindow GameInfoList;
var MenuUICheckboxWindow chkShowGameTypeOne;
var MenuUICheckboxWindow chkShowGameTypeTwo;
var MenuUICheckboxWindow chkShowAllGameTypes;
var localized string GameTypeOneLabel;
var localized string GameTypeTwoLabel;
var localized string ShowAllGameTypesLabel;
var string GameTypeOneClassName;
var string GameTypeTwoClassName;
var globalconfig String GameClassNames[24];
var globalconfig String GamePackages[24];
var localized String GameHumanNames[24];
var bool bShowGameTypeOne;
var bool bShowGameTypeTwo;
var bool bShowAllGameTypes;
var float ClickTimer; //for double clicks
var float TimeToClick; // for double clicks
var int ClickRowID;
var localized String FullServerWarningTitle;
var localized String FullServerWarningMessage;
HeaderIPWindowLabel="IP Address"
HostButtonName="Host Game"
JoinButtonName="Join Game"
RefreshButtonName="Refresh"
filterString="01234567890:."
HostButtonHelpText="Host a multiplayer game"
JoinButtonHelpText="Join the currently selected game"
RefreshButtonHelpText="Refresh the list of servers"
MasterServerAddress="master.333networks.com"
MasterServerTCPPort=28900
MasterServerTimeout=10
GameName="deusex"
bShowFailedServers=True
strHostNameLabel="HostName"
strMapNameLabel="Map"
strGameTypeLabel="Game Type"
strNumPlayersLabel="Players"
strPingLabel="Ping"
GameTypeOneLabel="Show Deathmatch Games"
GameTypeTwoLabel="Show Team Deathmatch Games"
ShowAllGameTypesLabel="Show All Games"
GameTypeOneClassName="Deathmatchgame"
GameTypeTwoClassName="teamdmgame"
GameClassNames(0)="Deathmatchgame"
GameClassNames(1)="TeamDMGame"
GameClassNames(2)="AdvTeamDMGame"
GameClassNames(3)="BasicTeamDMGame"
GamePackages(0)="DeusEx"
GamePackages(1)="DeusEx"
GamePackages(2)="DeusEx"
GamePackages(3)="DeusEx"
GameHumanNames(0)="Deathmatch"
GameHumanNames(1)="Team Deathmatch"
GameHumanNames(2)="Adv. Team DM"
GameHumanNames(3)="Basic Team DM"
bShowGameTypeOne=True
bShowGameTypeTwo=True
bShowAllGameTypes=True
TimeToClick=0.200000
FullServerWarningTitle="Server Full"
FullServerWarningMessage="The selected server is detected as full. Refresh list?"
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
Title="Start Multiplayer Game"
ClientWidth=614
ClientHeight=420
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuJoinBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuJoinBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuJoinBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuJoinBackground_4'
clientTextures(4)=Texture'DeusExUI.UserInterface.MenuJoinBackground_5'
clientTextures(5)=Texture'DeusExUI.UserInterface.MenuJoinBackground_6'
helpPosY=378
bTickEnabled=True

local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case HostButton:
ProcessMenuAction(MA_MenuScreen,Class'MenuScreenHostGame');
break;

case JoinButton:
HandleJoinGame();
break;

case RefreshButton:
RefreshServerList();
break;

case btnHeaderHostName:
bHostNameSortOrder = !bHostNameSortOrder;
ServerList.SetSortColumn(0, bHostNameSortOrder);
ServerList.Sort();
break;

case btnHeaderMapName:
bMapNameSortOrder = !bMapNameSortOrder;
ServerList.SetSortColumn(1, bMapNameSortOrder);
ServerList.Sort();
break;

case btnHeaderGameType:
bGameTypeSortOrder = !bGameTypeSortOrder;
ServerList.SetSortColumn(2, bGameTypeSortOrder);
ServerList.Sort();
break;

case btnHeaderNumPlayers:
bNumPlayersSortOrder = !bNumPlayersSortOrder;
ServerList.SetSortColumn(3, bNumPlayersSortOrder);
ServerList.Sort();
break;

case btnHeaderPing:
bPingSortOrder = !bPingSortOrder;
ServerList.SetSortColumn(4, bPingSortOrder);
ServerList.Sort();
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated(buttonPressed);

return bHandled;


local Class GameClass;
local GameInfo RemoteGame;
local Class TestClass;
local GameInfo TestGame;
local string GameLoadString;
local string TypePackage;


if (bShowAllGameTypes)
return True;

TypePackage = GameTypePackage(GameTypeClassName);
if (TypePackage != "")
GameLoadString = TypePackage $ "." $ GameTypeClassName;
else
GameLoadString = GameTypeClassName;

GameClass = class( Player.DynamicLoadObject( GameLoadString, class'Class', true) );
if (GameClass == None)
return false;

RemoteGame = Player.Spawn(GameClass);

if (RemoteGame == None)
return false;

// Test gametype one
TestClass = class( Player.DynamicLoadObject( "DeusEx." $ GameTypeOneClassName, class'Class', true) );
if (TestClass != None)
{
if (RemoteGame.IsA(TestClass.Name))
{
RemoteGame.Destroy();
return bShowGameTypeOne;
}
}

TestClass = class( Player.DynamicLoadObject( "DeusEx." $ GameTypeTwoClassName, class'Class', true) );
if (TestClass != None)
{
if (RemoteGame.IsA(TestClass.Name))
{
RemoteGame.Destroy();
return bShowGameTypeTwo;
}
}

RemoteGame.Destroy();
return false;


local int iClassIndex;


for (iClassIndex = 0; iClassIndex < ArrayCount(GameClassNames); iClassIndex++)
{
if ((GameClassNames[iClassIndex] ~= GameTypeClassName) && (GameHumanNames[iClassIndex] != ""))
return GameHumanNames[iClassIndex];
}

return GameTypeClassName;


chkShowGameTypeOne = MenuUICheckboxWindow(winClient.NewChild(Class'MenuUICheckboxWindow'));

chkShowGameTypeOne.SetPos(154, 333);
chkShowGameTypeOne.SetText(GameTypeOneLabel);
chkShowGameTypeOne.SetFont(Font'FontMenuSmall');
chkShowGameTypeOne.SetToggle(bShowGameTypeOne);

chkShowGameTypeTwo = MenuUICheckboxWindow(winClient.NewChild(Class'MenuUICheckboxWindow'));

chkShowGameTypeTwo.SetPos(154, 347);
chkShowGameTypeTwo.SetText(GameTypeTwoLabel);
chkShowGameTypeTwo.SetFont(Font'FontMenuSmall');
chkShowGameTypeTwo.SetToggle(bShowGameTypeTwo);

chkShowAllGameTypes = MenuUICheckboxWindow(winClient.NewChild(Class'MenuUICheckboxWindow'));

chkShowAllGameTypes.SetPos(154, 360);
chkShowAllGameTypes.SetText(ShowAllGameTypesLabel);
chkShowAllGameTypes.SetFont(Font'FontMenuSmall');
chkShowAllGameTypes.SetToggle(bShowAllGameTypes);


GameInfoScroll = CreateScrollAreaWindow(winClient);

GameInfoScroll.SetPos(144, 241);
GameInfoScroll.SetSize(464, 85);

GameInfoList = MenuUIListWindow(GameInfoScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
GameInfoList.EnableMultiSelect(False);
GameInfoList.EnableAutoExpandColumns(False);

GameInfoList.SetNumColumns(1);

GameInfoList.SetColumnWidth(0, 345);
GameInfoList.SetColumnType(0, COLTYPE_String);
GameInfoList.EnableAutoSort(False);

GameInfoList.SetSensitivity(False);


ServerScroll = CreateScrollAreaWindow(winClient);

ServerScroll.SetPos(7, 40);
ServerScroll.SetSize(611, 188);

ServerList = MenuUIListWindow(ServerScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
ServerList.EnableMultiSelect(False);
ServerList.EnableAutoExpandColumns(False);

ServerList.SetNumColumns(8);

ServerList.SetColumnWidth(0, 225);
ServerList.SetColumnType(0, COLTYPE_String);

ServerList.SetSortColumn(0, True);
ServerList.EnableAutoSort(True);

ServerList.SetColumnWidth(1, 154);
ServerList.SetColumnType(1, COLTYPE_String);

ServerList.SetColumnWidth(2, 96);
ServerList.SetColumnType(2, COLTYPE_String);

ServerList.SetColumnWidth(3, 72);
ServerList.SetColumnType(3, COLTYPE_String);

ServerList.SetColumnWidth(4, 52);
ServerList.SetColumnType(4, COLTYPE_Float, "%.0f");

ServerList.SetColumnWidth(5, 10);
ServerList.SetColumnType(5, COLTYPE_String);

ServerList.HideColumn(5);

ServerList.SetColumnWidth(6,10);
ServerList.SetColumnType(6, COLTYPE_String);

ServerList.HideColumn(6);

ServerList.SetColumnWidth(7,10);
ServerList.SetColumnType(7, COLTYPE_String);

ServerList.HideColumn(7);


btnHeaderHostName = CreateHeaderButton(7, 17, 224, strHostNameLabel, winClient);
btnHeaderMapName = CreateHeaderButton(234, 17, 151, strMapNameLabel, winClient);
btnHeaderGameType = CreateHeaderButton(388, 17, 94, strGameTypeLabel, winClient);
btnHeaderNumPlayers = CreateHeaderButton(485, 17, 68, strNumPlayersLabel, winClient);
btnHeaderPing = CreateHeaderButton(556, 17, 54, strPingLabel, winClient);


//Create label
CreateMenuLabel( 7, 322, HeaderIPWindowLabel, winClient );


//Create edit window
IPWindow = CreateMenuEditWindow(7, 337, 121, 24, winClient);

IPWindow.SetText("");
IPWindow.SetFilter(filterString);


//Create Host Game button
HostButton = MenuUIChoiceButton(winClient.NewChild(Class'MenuUIChoiceButton'));
HostButton.SetButtonText(HostButtonName);
HostButton.SetPos(7, 239);
HostButton.SetWidth(121);
HostButton.SetHelpText(HostButtonHelpText);

//Create Join Game Button
JoinButton = MenuUIChoiceButton(winClient.NewChild(Class'MenuUIChoiceButton'));
JoinButton.SetButtonText(JoinButtonName);
JoinButton.SetPos(7, 267);
JoinButton.SetWidth(121);
JoinButton.SetHelpText(JoinButtonHelpText);
JoinButton.SetSensitivity(False);

//Create Refresh button
RefreshButton = MenuUIChoiceButton(winClient.NewChild(Class'MenuUIChoiceButton'));
RefreshButton.SetButtonText(RefreshButtonName);
RefreshButton.SetPos(527,337);
RefreshButton.SetWidth(83);
RefreshButton.SetHelpText(RefreshButtonHelpText);


if (UnpingedList == None)
UnpingedList = New(None) class'DeusExServerList';

UnpingedList.Owner = Self;
UnpingedList.SetupSentinel(False);

if (PingedList == None)
PingedList = New(None) class'DeusExServerList';

PingedList.Owner = Self;
PingedList.SetupSentinel(True);


if(UnpingedList != None)
{
UnpingedList.DestroyList();
}

if(PingedList != None)
{
PingedList.DestroyList();
}


ShutdownLink();

DestroyPingLists();

UnPingedList = None;
PingedList = None;

Super.DestroyWindow();


if (enterWindow.IsA('MenuUIChoiceButton'))
{
if ((winHelp != None) && (MenuUIChoiceButton(enterWindow).helpText != ""))
{
winHelp.Show();
winHelp.SetText(MenuUIChoiceButton(enterWindow).helpText);
}
}


if ((winHelp != None) && (!bHelpAlwaysOn))
winHelp.Hide();


local DeusExServerList NewListEntry;


NewListEntry = UnPingedList.FindExistingServer(IP, QueryPort);

if (NewListEntry == None)
NewListEntry = PingedList.FindExistingServer(IP, QueryPort);

// Don't add if it's already in the existing list
if(NewListEntry == None)
{
// Add it to the server list(s)
NewListEntry = New(None) class'DeusExServerList';

NewListEntry.IP = IP;
NewListEntry.QueryPort = QueryPort;

NewListEntry.Ping = 9999;
if(HostName != "")
NewListEntry.HostName = HostName;
else
NewListEntry.HostName = IP;
NewListEntry.Category = Category;
NewListEntry.GameName = GameName;
NewListEntry.bLocalServer = False;

UnPingedList.AppendItem(NewListEntry);
}

NewListEntry.bOldServer = False;


local int iClassIndex;


for (iClassIndex = 0; iClassIndex < ArrayCount(GameClassNames); iClassIndex++)
{
if ((GameClassNames[iClassIndex] ~= GameTypeClassName) && (GamePackages[iClassIndex] != ""))
return GamePackages[iClassIndex];
}

return "";


return "";


local string ServerIP;
local int ServerQueryPort;
local int ServerGamePort;
local DeusExServerList ListEntry;
local String FullString;


ServerIP = ServerList.GetField(ServerList.GetFocusRow(),6);
ServerQueryPort = int(ServerList.GetField(ServerList.GetFocusRow(),5));
ServerGamePort = int(ServerList.GetField(ServerList.GetFocusRow(),7));

if (ServerGamePort == 0)
FullString = ServerIP;
else
FullString = ServerIP$":"$ServerGamePort;

ListEntry = PingedList.FindExistingServer(ServerIP,ServerQueryPort);
if ((ListEntry != None) && (IPWindow.GetText() ~= FullString))
{
//check max players.
if (ListEntry.NumPlayers >= ListEntry.MaxPlayers)
{
messageBoxMode = MB_JoinGameWarning;
root.MessageBox(FullServerWarningTitle, FullServerWarningMessage, 0, False, Self);
return;
}

}

player.StartMultiplayerGame("open " $ IpWindow.GetText() $ GetExtraJoinOptions());


Super.InitWindow();

CreateJoinMenuButtons();
CreateIPEditWindow();
CreateGamesList();
CreatePingLists();
CreateHeaderButtons();
PopulateServerList();
CreateGameInfoList();
CreateGameFilterBoxes();
Query();

bTickEnabled = Default.bTickEnabled;


PopulateServerList();


if ((list == ServerList) && (FocusRowID == ClickRowID) && (JoinButton.IsSensitive()))
{
HandleJoinGame();
return false;
}

if (list == ServerList)
{
ClickRowID = focusRowID;
ClickTimer = 0;
UpdateSelectionInfo(focusRowID);
}
return False;


return;


local string ServerIP;
local int ServerQueryPort;
local DeusExServerList ListEntry;


ServerIP = ServerList.GetField(ServerList.GetFocusRow(),6);
ServerQueryPort = int(ServerList.GetField(ServerList.GetFocusRow(),5));

if ((DoneList.IP == ServerIP) && (DoneList.QueryPort == ServerQueryPort))
UpdateGameInfo(DoneList);


local DeusExServerList CurrentServer;


CurrentServer = UnpingedList;

UnPingedList.PingServers(True,False);


local DeusExServerList CurrentServer;
local string ServerGameType;
local string ServerName;
local int ServerPing;


ServerList.DeleteAllRows();

CurrentServer = PingedList;
if (CurrentServer != None)
CurrentServer = DeusExServerList(PingedList.Next); //skip sentinel

while (CurrentServer != None)
{
if (CanShowGame(CurrentServer.GameType))
{
ServerGameType = ConvertGameType(CurrentServer.GameType);
ServerPing = CurrentServer.Ping;
if (CurrentServer.HostName == "")
ServerName = CurrentServer.IP;
else
ServerName = CurrentServer.HostName;
ServerList.AddRow(ServerName$";"$CurrentServer.MapName$";"$ServerGameType$";"$CurrentServer.NumPlayers$"/"$CurrentServer.MaxPlayers$";"$ServerPing$";"$CurrentServer.QueryPort$";"$CurrentServer.IP$";"$CurrentServer.GamePort);
}
CurrentServer = DeusExServerList(CurrentServer.Next);
}


if ((key == IK_Enter) && (iState == IST_Release))
{
HandleJoinGame();
return True;
}
else
{
return Super.RawKeyPressed(key,iState,bRepeat);
}


ShutdownLink();
DestroyPingLists();
CreatePingLists();
PopulateServerList();
Query();


if (ChangedWindow == IPWindow)
{
if (IPWindow.GetText() == "")
{
JoinButton.SetSensitivity(False);
}
else
{
JoinButton.SetSensitivity(True);
}
return true;
}
return false;


PingedList.Tick(Delta);

ClickTimer += Delta;

if (ClickTimer > TimeToClick)
{
ClickRowID = -1;
}

if(PingedList.bNeedUpdateCount)
{
PingedList.UpdateServerCount();
PingedList.bNeedUpdateCount = False;
}



if (button == chkShowGameTypeOne)
{
bShowGameTypeOne = bNewToggle;
if (bShowAllGameTypes && !bShowGameTypeOne)
{
bShowAllGameTypes = false;
chkShowAllGameTypes.SetToggle(bShowAllGameTypes);
}
chkShowGameTypeOne.SetToggle(bShowGameTypeOne);
PopulateServerList();
return True;
}
else if (button == chkShowGameTypeTwo)
{
bShowGameTypeTwo = bNewToggle;
if (bShowAllGameTypes && !bShowGameTypeTwo)
{
bShowAllGameTypes = false;
chkShowAllGameTypes.SetToggle(bShowAllGameTypes);
}
chkShowGameTypeTwo.SetToggle(bShowGameTypeTwo);
PopulateServerList();
return True;
}
else if (button == chkShowAllGameTypes)
{
bShowAllGameTypes = bNewToggle;
if (bShowAllGameTypes)
{
bShowGameTypeOne = True;
bShowGameTypeTwo = True;
}
chkShowGameTypeOne.SetToggle(bShowGameTypeOne);
chkShowGameTypeTwo.SetToggle(bShowGameTypeTwo);
PopulateServerList();
return True;
}
else
{
return False;
}


local UBrowserRulesList CurrentRule;


GameInfoList.DeleteAllRows();
if (ListEntry == None)
return;

CurrentRule = ListEntry.RulesList;

//skip sentinel
if (CurrentRule != None)
CurrentRule = UBrowserRulesList(CurrentRule.Next);

while (CurrentRule != None)
{
GameInfoList.AddRow(CurrentRule.Rule$": "$CurrentRule.Value);
CurrentRule = UBrowserRulesList(CurrentRule.Next);
}



local string ServerIP;
local int ServerQueryPort;
local int ServerGamePort;
local DeusExServerList ListEntry;


ServerIP = ServerList.GetField(RowID,6);
ServerQueryPort = int(ServerList.GetField(RowID,5));
ServerGamePort = int(ServerList.GetField(RowID,7));
if (ServerGamePort == 0)
IPWindow.SetText(ServerIP);
else
IPWindow.SetText(ServerIP$":"$ServerGamePort);

ListEntry = PingedList.FindExistingServer(ServerIP,ServerQueryPort);
if (ListEntry != None)
{
ListEntry.ServerStatus();
}

UpdateGameInfo(ListEntry);




var DeusExGSpyLink Link;
Title="Start Multiplayer Internet Game"

local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case HostButton:
ProcessMenuAction(MA_MenuScreen,Class'MenuScreenHostNet');
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated(buttonPressed);

return bHandled;


Link = GetPlayerPawn().GetEntryLevel().Spawn(class'DeusExGSpyLink');

Link.MasterServerAddress = MasterServerAddress;
Link.MasterServerTCPPort = MasterServerTCPPort;
Link.Region = Region;
Link.MasterServerTimeout = MasterServerTimeout;
Link.GameName = GameName;
Link.OwnerWindow = Self;

Link.Start();


Link.Destroy();
Link = None;

PingUnpingedServers();


if(Link != None)
Link.Destroy();
Link = None;




var DeusExLocalLink Link;
var string BeaconProduct;
var int ServerBeaconPort;
Title="Start Multiplayer LAN Game"

local bool bHandled;


bHandled = True;

switch( buttonPressed )
{
case HostButton:
ProcessMenuAction(MA_MenuScreen,Class'MenuScreenHostLan');
break;

default:
bHandled = False;
break;
}

if ( !bHandled )
bHandled = Super.ButtonActivated(buttonPressed);

return bHandled;


return Super.GetExtraJoinOptions() $ "?lan";


Link = GetPlayerPawn().GetEntryLevel().Spawn(class'DeusExLocalLink');

Link.OwnerWindow = Self;
Link.Start();
Link.SetTimer(1.0,False);


Link.Destroy();
Link = None;

PingUnpingedServers();


if(Link != None)
Link.Destroy();
Link = None;




var MenuUIEditWindow PlayerNameEditor;
var localized string HeaderPlayerNameLabel;
var string FilterString;
var MenuChoice_Connection ConnectionChoice;
var MenuChoice_Team TeamChoice;
var MenuChoice_Class ClassChoice;
var MenuChoice_MultiHelp HelpChoice;
HeaderPlayerNameLabel="Player Name"
filterString="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890[]()"
actionButtons(0)=(Align=HALIGN_Right,Action=AB_Cancel)
actionButtons(1)=(Align=HALIGN_Right,Action=AB_Reset)
actionButtons(2)=(Action=AB_OK)
Title="Multiplayer Player Setup"
ClientWidth=343
ClientHeight=415
clientTextures(0)=Texture'DeusExUI.UserInterface.MenuPlayerSetupBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.MenuPlayerSetupBackground_2'
clientTextures(2)=Texture'DeusExUI.UserInterface.MenuPlayerSetupBackground_3'
clientTextures(3)=Texture'DeusExUI.UserInterface.MenuPlayerSetupBackground_4'
textureCols=2
helpPosY=353

ClassChoice = MenuChoice_Class(winClient.NewChild(Class'MenuChoice_Class'));
ClassChoice.SetPos(6, 120);
ClassChoice.SetSize(153,213);


ConnectionChoice = MenuChoice_Connection(winClient.NewChild(Class'MenuChoice_Connection'));
ConnectionChoice.SetPos(6, 54);


Super.CreateControls();

CreateClassChoice();

CreateTeamChoice();

CreatePlayerNameHeader();

CreateConnectionChoice();

CreateHelpChoice();

CreatePlayerNameEditor();


HelpChoice = MenuChoice_MultiHelp(winClient.NewChild(Class'MenuChoice_MultiHelp'));
HelpChoice.SetPos(6, 81);


PlayerNameEditor = CreateMenuEditWindow(177, 27, 153, 18, winClient);

PlayerNameEditor.SetText(GetMultiplayerName());
PlayerNameEditor.MoveInsertionPoint(MOVEINSERT_End);
PlayerNameEditor.SetFilter(filterString);


CreateMenuLabel( 7, 31, HeaderPlayerNameLabel, winClient );


TeamChoice = MenuChoice_Team(winClient.NewChild(Class'MenuChoice_Team'));
TeamChoice.SetPos(176, 120);
TeamChoice.SetSize(153,213);


if (enterWindow.IsA('MenuUIChoiceButton'))
{
if ((winHelp != None) && (MenuUIChoiceButton(enterWindow).helpText != ""))
{
winHelp.Show();
winHelp.SetText(MenuUIChoiceButton(enterWindow).helpText);
}
}


if ((winHelp != None) && (!bHelpAlwaysOn))
winHelp.Hide();


local string mpname;


mpname = player.PlayerReplicationInfo.PlayerName;

if (mpname == "")
{
mpname = "Player";
SetMultiplayerName(mpname);
}

return mpname;


Super.InitWindow();

winHelp.Hide();


Super.ResetToDefaults();

//Setting "" will set to default.
SetMultiplayerName("");

PlayerNameEditor.SetText(GetMultiplayerName());

player.SaveConfig();


Super.SaveSettings();

SetMultiplayerName(PlayerNameEditor.GetText());

player.SaveConfig();


local string mpname;


if (newname == "")
mpname = "Player";
else
mpname = newname;

player.SetName(mpname);




mpmj12.uc (extends Human)

CarcassType=Class'DeusEx.MJ12TroopCarcass'
JumpSound=Sound'DeusExSounds.Player.MaleJump'
HitSound1=Sound'DeusExSounds.Player.MalePainSmall'
HitSound2=Sound'DeusExSounds.Player.MalePainMedium'
Land=Sound'DeusExSounds.Player.MaleLand'
Die=Sound'DeusExSounds.Player.MaleDeath'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'MPCharacters.mp_jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(1)=Texture'DeusExCharacters.Skins.MJ12TroopTex1'
MultiSkins(2)=Texture'DeusExCharacters.Skins.MJ12TroopTex2'
MultiSkins(3)=Texture'DeusExCharacters.Skins.SkinTex1'
MultiSkins(4)=Texture'DeusExItems.Skins.PinkMaskTex'
MultiSkins(5)=Texture'DeusExCharacters.Skins.MJ12TroopTex3'
MultiSkins(6)=Texture'DeusExCharacters.Skins.MJ12TroopTex4'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'

TravelPostAccept


local DeusExLevelInfo info;


Super.TravelPostAccept();




mpnsf.uc (extends Human)

CarcassType=Class'DeusEx.TerroristCarcass'
JumpSound=Sound'DeusExSounds.Player.MaleJump'
HitSound1=Sound'DeusExSounds.Player.MalePainSmall'
HitSound2=Sound'DeusExSounds.Player.MalePainMedium'
Land=Sound'DeusExSounds.Player.MaleLand'
Die=Sound'DeusExSounds.Player.MaleDeath'
Texture=Texture'DeusExItems.Skins.PinkMaskTex'
Mesh=LodMesh'MPCharacters.mp_jumpsuit'
MultiSkins(0)=Texture'DeusExCharacters.Skins.TerroristTex0'
MultiSkins(1)=Texture'DeusExCharacters.Skins.TerroristTex2'
MultiSkins(2)=Texture'DeusExCharacters.Skins.TerroristTex1'
MultiSkins(3)=Texture'DeusExCharacters.Skins.TerroristTex0'
MultiSkins(4)=Texture'DeusExCharacters.Skins.TerroristTex0'
MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.GogglesTex1'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'

TravelPostAccept


local DeusExLevelInfo info;


Super.TravelPostAccept();




mpplayertrack.uc (extends Actor)

var DeusExPlayer AttachedPlayer;
var float TimeSinceCloak;
TimeSinceCloak=10.000000
bHidden=True
Style=STY_None
bUnlit=True
CollisionRadius=0.000000
CollisionHeight=0.000000

HandleNintendoEffect (DeusExPlayer OtherPlayer)


local DeusExPlayer MyPlayer;


MyPlayer = DeusExPlayer(GetPlayerPawn());

if (OtherPlayer == None)
return;

if (MyPlayer == None)
return;

if (OtherPlayer == MyPlayer)
return;

if ( OtherPlayer.NintendoImmunityTimeLeft > 0.0 )
OtherPlayer.DrawInvulnShield();
else
OtherPlayer.InvulnSph = None;

HandlePlayerCloak (DeusExPlayer OtherPlayer, float DeltaTime)


local float OldGlow;
local DeusExPlayer MyPlayer;
local bool bAllied;


MyPlayer = DeusExPlayer(GetPlayerPawn());

TimeSinceCloak += DeltaTime;

if (OtherPlayer == None)
return;

if (MyPlayer == None)
return;

if (OtherPlayer.Style != STY_Translucent)
{
TimeSinceCloak = 0;
OtherPlayer.CreateShadow();
if (OtherPlayer.IsA('JCDentonMale'))
{
OtherPlayer.MultiSkins[6] = OtherPlayer.Default.MultiSkins[6];
OtherPlayer.MultiSkins[7] = OtherPlayer.Default.MultiSkins[7];
}
return;
}

if (OtherPlayer == MyPlayer)
return;

if (!(MyPlayer.DXGame.IsA('DeusExMPGame')))
return;

if (OtherPlayer.IsA('JCDentonMale'))
{
OtherPlayer.MultiSkins[6] = Texture'BlackMaskTex';
OtherPlayer.MultiSkins[7] = Texture'BlackMaskTex';
}

bAllied = False;

if ( (MyPlayer.DXGame.IsA('TeamDMGame')) && ((TeamDMGame(MyPlayer.DXGame).ArePlayersAllied(OtherPlayer,MyPlayer))) )
bAllied = True;

OtherPlayer.KillShadow();

if (!bAllied)
{
//DEUS_EX AMSD Do a gradual cloak fade.
OtherPlayer.ScaleGlow = OtherPlayer.Default.ScaleGlow * (0.01 / TimeSinceCloak);
if (OtherPlayer.ScaleGlow <= (DeusExMPGame(MyPlayer.DXGame).CloakEffect + 0.02))
OtherPlayer.ScaleGlow = DeusExMPGame(MyPlayer.DXGame).CloakEffect;
}
else
OtherPlayer.ScaleGlow = 0.25;

return;

Tick (float deltaTime)


if (AttachedPlayer == None)
{
Destroy();
return;
}
HandleNintendoEffect( AttachedPlayer );
HandlePlayerCloak(AttachedPlayer, deltaTime);




shieldeffect.uc (extends Effects)

var float TimeSinceStrong;
var DeusExPlayer AttachedPlayer;
DrawType=DT_Mesh
Style=STY_Translucent
Mesh=LodMesh'DeusExItems.EllipseEffect'
bUnlit=True

Tick (float deltaTime)


if (AttachedPlayer == None)
{
Destroy();
return;
}

if (AttachedPlayer.ShieldStatus == SS_Strong)
TimeSinceStrong = 1.0;
else
TimeSinceStrong = TimeSinceStrong - deltaTime;

if (TimeSinceStrong < 0)
TimeSinceStrong = 0;

// DEUS_EX AMSD Won't work right on listen server yet, but this will be low bandwidth for
// the moment for dedicated server.
ScaleGlow = 0.5 * (TimeSinceStrong / 1.0);

SetLocation(AttachedPlayer.Location);




smokelessfire.uc (extends Fire)

SpawnSmokeEffects


return;




snipertracer.uc (extends Tracer)

speed=10000.000000
MaxSpeed=10000.000000



tracehithandnonpenspawner.uc (extends TraceHitNonPenSpawner)

bHandToHand=True



tracehithandspawner.uc (extends TraceHitSpawner)

bHandToHand=True