Deus Ex Documentation::OpenDX

AdminVoteWindow.uc (extends MenuUIWindow)

var Color colTextMessage;
var bool bForced;
var DXL Caller;
var MenuUIActionButtonWindow btnYes;
var MenuUIActionButtonWindow btnNo;
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;
textBorderX=20
textBorderY=14
btnLabelYes="|&Yes"
btnLabelNo="|&No"
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'

ButtonActivated (Window buttonPressed) -> bool


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(1); // MR_Yes;

bHandled = True;
break;

case btnNo:
PostResult(0);
break;

default:
bHandled = False;
break;
}

return bHandled;

CreateTextWindow


winText = CreateMenuHeader(21, 13, "", winClient);
winText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winText.SetFont(Font'FontMenuHeaders_DS');
winText.SetWindowAlignments(HALIGN_Full, VALIGN_Full, textBorderX, textBorderY);

GetNumButtons -> int


return numButtons;

InitWindow


Super.InitWindow();
// Don't show if match has ended
if (( DeusExMPGame(Player.DXGame) != None ) && DeusExMPGame(Player.DXGame).bClientNewMap )
return;
// Force the title bar to be a certain width;
winTitle.minTitleWidth = 250;

CreateTextWindow();
SetTitle("MapVote");
SetMode(0);
SetNotifyWindow(Self);

MouseButtonReleased (float pointX, float pointY, EInputKey button, int numClicks) -> bool


return True;

PostResult (int buttonNumber)


if(ButtonNumber==0)
{
Caller.ClientAdminVote(False);
}
else if(ButtonNumber==1)
{
Caller.ClientAdminVote(True);
}
root.PopWindow();
root.ClearWindowStack();

RawKeyPressed (EInputKey key, EInputState iState, bool bRepeat) -> bool


if (((key == IK_Enter) || (key == IK_Space) || (key == IK_Y)) &&
((iState == IST_Release) && (bKeyPressed)))
{
PostResult(0);
return True;
}
else
{
return false;
}

SetDeferredKeyPress (bool bNewDeferredKeyPress)


bDeferredKeyPress = bNewDeferredKeyPress;

SetMessageText (String msgText)


winText.SetText(msgText);

AskParentForReconfigure();

SetMode (int newMode)


mbMode = newMode;

switch( mbMode )
{
case 0: // MB_YesNo:
btnNo = winButtonBar.AddButton(btnLabelNo, HALIGN_Right);
btnYes = winButtonBar.AddButton(btnLabelYes, HALIGN_Right);
numButtons = 2;
SetFocusWindow(btnYes);
break;
}

if (winShadow != None)
MenuUIMessageBoxShadowWindow(winShadow).SetButtonCount(numButtons);

SetNotifyWindow (Window newWinNotify)


winNotify = newWinNotify;

VirtualKeyPressed (EInputKey key, bool bRepeat) -> bool


local bool bHandled;


switch( key )
{

case IK_Escape:
if ( mbMode == 0 /*MB_YesNo*/ )
{
PostResult(0);
bHandled = True;
}
break;

case IK_Enter:
if ( mbMode == 0 /*MB_YesNo*/ )
{
PostResult(1);
bHandled = True;
}
break;

case IK_Y:
if ( mbMode == 0 /*MB_YesNo*/ )
{
PostResult(1);
bHandled = True;
}
break;

case IK_N:
if ( mbMode == 0 /*MB_YesNo*/ )
{
PostResult(0);
bHandled = True;
}
break;
}

return bHandled;




AugFlight.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=10.000000
mpEnergyDrain=100.000000
EnergyRate=120.000000
Icon=Texture'DeusExUI.UserInterface.AugIconDrone'
smallIcon=Texture'DeusExUI.UserInterface.AugIconDrone_Small'
AugmentationName="Flight"
Description=""
MPInfo="When active, you fly."
LevelValues(0)=5.000000
LevelValues(1)=15.000000
LevelValues(2)=25.000000
LevelValues(3)=40.000000
AugmentationLocation=LOC_Torso
MPConflictSlot=2

Deactivate


Player.SetPhysics(PHYS_Falling);
//Player.bFlightAug=False;
Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

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




AugHealing2.uc (extends AugHealing)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=0
mpEnergyDrain=0
EnergyRate=0
Icon=Texture'DeusExUI.UserInterface.AugIconHealing'
smallIcon=Texture'DeusExUI.UserInterface.AugIconHealing_Small'
AugmentationName="Nano 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)=0
LevelValues(1)=0
LevelValues(2)=0
LevelValues(3)=0
LoopSound=None
AugmentationLocation=LOC_Torso
MPConflictSlot=2

PreBeginPlay


Super.PreBeginPlay();

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




AugIcarus.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
var bool bReverse;
var bool bTrig;
mpAugValue=0
mpEnergyDrain=0
EnergyRate=0
Icon=Texture'DeusExUI.UserInterface.AugIconDrone'
smallIcon=Texture'DeusExUI.UserInterface.AugIconDrone_Small'
AugmentationName="Icarus Landing System"
Description=""
MPInfo="When active, you emit dangerous energy while falling at high velocity."
LevelValues(0)=0
LevelValues(1)=0
LevelValues(2)=0
LevelValues(3)=0
LoopSound=None
AugmentationLocation=4
MPConflictSlot=3

Deactivate



Super.Deactivate();

Icarus


if(Player.Velocity.Z < -600 && !bReverse)
{
bTrig=True;
bReverse=True;
Player.ClientMessage("|P3Icarus landing system activated...");
}

if(bTrig)
{
Player.Energy -= 1;
if(bReverse)
Player.Velocity.Z += 100;

if(Player.Velocity.Z > 0)
{
bTrig=False;
bReverse=False;
Player.ClientMessage("|P3Icarus landing system de-activated...");
}
}

PreBeginPlay


Super.PreBeginPlay();

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




AugMagnet.uc (extends Augmentation)

var int BioDrainODX;
var actor Magnet;
BioDrainODX=10
//mpAugValue=0.000000
//mpEnergyDrain=0.000000
EnergyRate=0.000000
Icon=Texture'DeusExUI.UserInterface.AugIconEMP'
smallIcon=Texture'DeusExUI.UserInterface.AugIconEMP_Small'
AugmentationName="Magnetize"
Description=""
MPInfo="When active, it.. magnets. idk"
LevelValues(0)=5.000000
LevelValues(1)=15.000000
LevelValues(2)=25.000000
LevelValues(3)=40.000000
AugmentationLocation=5
MPConflictSlot=9
DeActivateSound=none

Deactivate


Magnet = None;
Super.Deactivate();

Pull


local vector loc;

loc = Player.Location;
loc.Z -= 32;

Player.DoJump();
Player.Velocity = (normal(Loc - Magnet.Location) * -750);
Player.SetPhysics(Phys_Falling);

Skullshot


local Actor hitActor;
local vector loc, line, HitLocation, hitNormal;
local ScriptedPawn hitPawn;
local PlayerPawn hitPlayer;
local DeusExMover hitMover;
local DeusExDecoration hitDecoration;
local int damage;
local vector v2;


v2 = Player.location;
v2.z += 20;

loc = Player.Location;
loc.Z += Player.BaseEyeHeight;
line = Vector(Player.ViewRotation) * 4000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);
if (hitActor != None)
{
hitMover = DeusExMover(hitActor);
hitPawn = ScriptedPawn(hitActor);
hitDecoration = DeusExDecoration(hitActor);
hitPlayer = PlayerPawn(hitActor);
if (hitMover != None)
{
Magnet = hitMover;
}
else if (hitPawn != None)
{
Magnet = hitPawn;
}
else if (hitDecoration != None)
{
Magnet = hitDecoration;
}
else if (hitPlayer != None)
{
Magnet = hitPlayer;
}
}

if(Magnet == None)
{
loc = Player.Location;
loc.Z -= 32;

SpawnExplosion(Loc);
SpawnExplosion(HitLocation);
Player.DoJump();
Player.Velocity = (normal(Loc - HitLocation) * -1450);
Player.SetPhysics(Phys_Falling);
Deactivate();
}
else
SpawnExplosion(Magnet.Location);

SpawnExplosion (vector Loc)


local ShockRing s1, s2, s3;


s1 = spawn(class'ShockRing',,,Loc,rot(16384,0,0));
s1.Lifespan = 2.5;
s2 = spawn(class'ShockRing',,,Loc,rot(0,16384,0));
s2.Lifespan = 2.5;
s3 = spawn(class'ShockRing',,,Loc,rot(0,0,16384));
S3.Lifespan = 2.5;




AugMediAura.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=0
mpEnergyDrain=0
EnergyRate=0
Icon=Texture'AugIconHealingAura'
smallIcon=Texture'AugIconHealingAura_Small'
AugmentationName="Medic Aura"
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="Heals your allies close-by."
LevelValues(0)=0
LevelValues(1)=0
LevelValues(2)=0
LevelValues(3)=0
LoopSound=None
AugmentationLocation=LOC_Torso
MPConflictSlot=2

AreAlliesBasic (TCPlayer one, tcplayer two) -> bool


if(TCPRI(One.PlayerReplicationInfo).TeamNamePRI == "" || TCPRI(Two.PlayerReplicationInfo).TeamNamePRI == "")
return false;

if(TCPRI(One.PlayerReplicationInfo).TeamNamePRI == TCPRI(Two.PlayerReplicationInfo).TeamNamePRI)
return true;

GetEnergyRate -> float


return energyRate * LevelValues[CurrentLevel];

HealPlayers


local Actor a;
local TCPlayer target, targetList[3];
local int count, i, healamount, totalamount, edrain;


count = 0;

if(TCTeam(Player.DXGame) != None) // Healing teammates in deathmatch is useless.
{
foreach RadiusActors(class'Actor', a, 256, Player.Location)
{
if(a.IsA('TCPlayer')) // TODO: Only heal teammates
{
target = TCPlayer(a);
if(target.PlayerReplicationInfo != None && target != TCPlayer(Player) && !target.PlayerReplicationInfo.bIsSpectator && target.Health > 0 && target.Health < 100 && (target.lastTeamHeal+1 <= Level.TimeSeconds) && (target.PlayerReplicationInfo.Team == player.PlayerReplicationInfo.Team))
{
targetList[count] = target;
count++;
edrain = 3 * count;
if(count == 3) // We heal a maximum of 3 players
break;
}
}
}

if(count > 0)
{
LoopSound=Sound'DeusExSounds.Augmentation.AugLoop';
healamount = Min(30, (45/count));
totalamount = healamount*count;
for(i = 0; i < count; i++)
{
if(targetList[i] != None)
{
Player.Energy -= edrain;
targetList[i].HealPlayer(healamount, False);
targetList[i].ClientFlash(0.5, vect(0, 0, 500));
targetList[i].lastTeamHeal = Level.TimeSeconds;
}
}
if(totalamount > 0)
{
Player.ClientMessage("Healed"@count@"nearby player(s) for"@totalamount$"HP");
}
}
else LoopSound=None;
}
else if(TCDeathmatch(Player.DXGame) != None)
{
foreach RadiusActors(class'Actor', a, 256, Player.Location)
{
if(a.IsA('TCPlayer')) // TODO: Only heal teammates
{
target = TCPlayer(a);
if(target.PlayerReplicationInfo != None && target != TCPlayer(Player) && !target.PlayerReplicationInfo.bIsSpectator && target.Health > 0 && target.Health < 100 && (target.lastTeamHeal+1 <= Level.TimeSeconds) && AreAlliesBasic(target, TCPlayer(Player)))
{
targetList[count] = target;
count++;
edrain = 3 * count;
if(count == 3) // We heal a maximum of 3 players
break;
}
}
}

if(count > 0)
{
LoopSound=Sound'DeusExSounds.Augmentation.AugLoop';
healamount = Min(30, (45/count));
totalamount = healamount*count;
for(i = 0; i < count; i++)
{
if(targetList[i] != None)
{
Player.Energy -= edrain;
targetList[i].HealPlayer(healamount, False);
targetList[i].ClientFlash(0.5, vect(0, 0, 500));
targetList[i].lastTeamHeal = Level.TimeSeconds;
}
}
if(totalamount > 0)
{
Player.ClientMessage("Healed"@count@"nearby player(s) for"@totalamount$"HP");
}
}
else LoopSound=none;
}

PreBeginPlay


Super.PreBeginPlay();

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




AugNuke.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=5
mpEnergyDrain=5
EnergyRate=5
Icon=Texture'AugIconNuke'
smallIcon=Texture'AugIconNuke_Small'
AugmentationName="Nuke"
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)=5
LevelValues(2)=5
LevelValues(3)=5
AugmentationLocation=LOC_Torso
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;
}




AugRadar.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=0
mpEnergyDrain=0
EnergyRate=0
Icon=Texture'AugIconDataLink'
smallIcon=Texture'AugIconDataLink_Small'
AugmentationName="Radar"
Description=""
MPInfo="Scans nearby hostiles"
LevelValues(0)=0
LevelValues(1)=0
LevelValues(2)=0
LevelValues(3)=0
AugmentationLocation=5
MPConflictSlot=9

AreAllies (TCPlayer POne, TCPlayer PTwo) -> bool


if(TCDeathmatch(player.DXGame) != None)
return TCDeathmatch(player.DXGame).ArePlayersAllied2(POne,PTwo);

if(TCTeam(player.DXGame) != None)
return TCTeam(player.DXGame).ArePlayersAllied(POne,PTwo);

PreBeginPlay


Super.PreBeginPlay();

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

Scan


local Actor a;
local TCPlayer target;
local int count, allycount;


count = 0;
allycount = 0;
foreach RadiusActors(class'Actor', a, 256, Player.Location)
{
if(a.IsA('TCPlayer'))
{
target = TCPlayer(a);
if(target.PlayerReplicationInfo != None && target != TCPlayer(Player) && !target.PlayerReplicationInfo.bIsSpectator && target.Health > 0 && target.AugmentationSystem.GetAugLevelValue(class'AugRadarTrans') == -1.0 && !target.bHidden )
{
count++;

if(AreAllies(TCPlayer(Player), target))
allycount++;
}
}
}

if(count > 0)
{
Player.Energy -= 1;
Player.ClientMessage("Hostiles detected. "$count$" targets, "$allycount$" allies.");
}




AugRepel.uc (extends Augmentation)

var int velz, CheckRadius;
CheckRadius=256
velz=-750
EnergyRate=0.000000
Icon=Texture'DeusExUI.UserInterface.AugIconEMP'
smallIcon=Texture'DeusExUI.UserInterface.AugIconEMP_Small'
AugmentationName="Blast Shield"
Description=""
MPInfo="When active, the aug repels all objects around you"
LevelValues(0)=5.000000
LevelValues(1)=15.000000
LevelValues(2)=25.000000
LevelValues(3)=40.000000
AugmentationLocation=5
MPConflictSlot=9

Deactivate


Super.Deactivate();

Skullshot


local vector loc, vline, HitLocation, hitNormal, altloc;
local rotator altrot;
local Actor HitActor;
local actor a;
local ScriptedPawn hitPawn;
local PlayerPawn hitPlayer;
local DeusExMover hitMover;
local DeusExDecoration hitDecoration;


loc = Player.Location;
loc.Z -= 32;
Player.Energy -= 10;
SpawnExplosion(Loc);
foreach Player.VisibleActors(class'Actor', A, CheckRadius)
{
if (a != None && a != Player)
{
hitPawn = ScriptedPawn(a);
hitDecoration = DeusExDecoration(a);
hitPlayer = PlayerPawn(a);
hitMover = DeusExMover(a);
if (hitPawn != None)
{
hitPawn.SetPhysics(Phys_Falling);
hitPawn.Velocity = (normal(loc - hitPawn.Location) * velz);
//hitPawn.TakeDamage(Player.Energy, Player, hitLocation, normal(loc - hitPawn.Location) * velz, 'Exploded');
}
else if (hitDecoration != None)
{
hitDecoration.SetPhysics(Phys_Falling);
hitDecoration.Velocity = (normal(loc - hitDecoration.Location) * velz);
//hitDecoration.TakeDamage(Player.Energy, Player, hitLocation, normal(loc - hitDecoration.Location) * velz, 'Exploded');
}
else if (hitPlayer != None)
{
hitPlayer.SetPhysics(Phys_Falling);
hitPlayer.Velocity = (normal(loc - hitPlayer.Location) * velz);
//hitPlayer.TakeDamage(Player.Energy / 3, Player, hitLocation, normal(loc - hitPlayer.Location) * velz, 'Exploded');
}
if (hitMover != None)
{
hitMover.bDrawExplosion = True;
// hitMover.TakeDamage(Player.Energy * 3, Player, hitLocation,normal(loc - hitMover.Location) * velz, 'Exploded');
}
}
}

SpawnExplosion (vector Loc)


local ShockRing s1, s2, s3;
local SphereEffect se;


s1 = spawn(class'ShockRing',,,Loc,rot(16384,0,0));
s1.Lifespan = 5.5;
s2 = spawn(class'ShockRing',,,Loc,rot(0,16384,0));
s2.Lifespan = 5.5;
s3 = spawn(class'ShockRing',,,Loc,rot(0,0,16384));
S3.Lifespan = 5.5;
se = spawn(class'SphereEffect',,,Loc,rot(16384,0,0));
se.Lifespan = 5.5;
se.MultiSkins[0]=Texture'DeusExDeco.Skins.AlarmLightTex7';




AugSkullgun.uc (extends Augmentation)

var int BioDrainODX;
BioDrainODX=10
//mpAugValue=0.000000
//mpEnergyDrain=0.000000
EnergyRate=0.000000
Icon=Texture'AugIconSkull'
smallIcon=Texture'AugIconSkull_Small'
AugmentationName="Skullgun"
Description=""
MPInfo="When active, the aug fires a shot from your eye..."
LevelValues(0)=5.000000
LevelValues(1)=15.000000
LevelValues(2)=25.000000
LevelValues(3)=40.000000
AugmentationLocation=LOC_Eye
MPConflictSlot=4
DeActivateSound=none

Deactivate


Super.Deactivate();

PreBeginPlay


Super.PreBeginPlay();

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

Skullshot


local Actor hitActor;
local vector loc, line, HitLocation, hitNormal;
local ScriptedPawn hitPawn;
local PlayerPawn hitPlayer;
local DeusExMover hitMover;
local DeusExDecoration hitDecoration;
local DeusExProjectile hitProjectile;
local bool bTakeDamage;
local int damage;
local vector v2;


Player.Energy -= BioDrainODX;

v2 = Player.location;
v2.z += 20;
Spawn(class'Tracer',Player,,v2,Player.ViewRotation);

Player.PlaySound(sound'RifleFire');

loc = Player.Location;
loc.Z += Player.BaseEyeHeight;
line = Vector(Player.ViewRotation) * 4000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);
if (hitActor != None)
{
hitMover = DeusExMover(hitActor);
hitPawn = ScriptedPawn(hitActor);
hitDecoration = DeusExDecoration(hitActor);
hitPlayer = PlayerPawn(hitActor);
if (hitMover != None)
{
damage=50;
bTakeDamage = true;
}
else if (hitPawn != None)
{
damage=50;
bTakeDamage = true;
}
else if (hitDecoration != None)
{
damage = 50;
bTakeDamage = true;
}
else if (hitPlayer != None)
{
damage = 50;
bTakeDamage = true;
}
else if (hitActor != Level)
{
damage = 50;
bTakeDamage = true;
}
}

if (bTakeDamage)
hitActor.TakeDamage(damage, Player, hitLocation, line, 'Shot');




AugTakedown.uc (extends Augmentation)

var float mpAugValue;
var float mpEnergyDrain;
mpAugValue=10.000000
mpEnergyDrain=0.000000
EnergyRate=0.000000
Icon=Texture'AugIconSkull'
smallIcon=Texture'AugIconSkull_Small'
AugmentationName="Takedown"
Description=""
MPInfo="When active, something something"
LevelValues(0)=5.000000
LevelValues(1)=15.000000
LevelValues(2)=25.000000
LevelValues(3)=40.000000
AugmentationLocation=LOC_Arm
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;
}

Skullshot


local Actor hitActor;
local vector loc, line, HitLocation, hitNormal;
local ScriptedPawn hitPawn;
local PlayerPawn hitPlayer;
local int damage;
local vector v2;


Player.Energy -= 25;


Player.PlaySound(sound'RifleFire');

loc = Player.Location;
loc.Z += Player.BaseEyeHeight;
line = Vector(Player.ViewRotation) * 100;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);
if (hitActor != None)
{
hitPawn = ScriptedPawn(hitActor);
hitPlayer = PlayerPawn(hitActor);
if (hitPawn != None)
{
Player.ClientMessage("Placeholder: taking down "$hitpawn);
}
else if (hitPlayer != None)
{
Player.ClientMessage("Placeholder: taking down "$hitplayer.playerreplicationinfo.playername);
}
}




DXL.uc (extends Actor)

var localized string l_lvote, l_wonvote;
var DXL Prev, Next;
var DXMVMapVoteMenu MVM;
var string Maps[arraycount(class'MVMutator'.default.Maps)];
var byte VoteTotals[arraycount(Maps)];
Var MVMutator Mut;
var float RepTime;
var int MapCount, iCurrentVote, iNextMap, iRepMaps;
var bool bVoteDone, bAdminVoteDone, bAdminVoteYes;
var bool DoesNotVote; //Ayleth: used to seperate the master DXL from the player dxls
l_lvote="%s is currently leading the vote."
l_wonvote="%s has won the map vote!"
iCurrentVote=-2
iNextMap=-1
bHidden=True
RemoteRole=2
NetPriority=1.50

AddMap (int I, string M)

f ((iRepMaps < MapCount) && (I < MapCount) && (M != "") && (Maps[I] == ""))

ClientAddMaps (int I, string M, string M1, string M2, string M3)

ddMap(I , M)

ClientAdminVote (bool Vote)


bAdminVoteDone=True;
bAdminVoteYes=Vote;
ServerAdminVote(Vote);

ClientResetAdminVote


bAdminVoteDone=False;
ServerResetAdminVote();

ClientSetVote (int I)

f (iCurrentVote != I)

CloseMVMenu (string sNextMap)

f (!bVoteDone)

Destroyed

f (MVM != None

OpenAVMenu (bool bForceShow)


local AdminVoteWindow AVW;
local DeusExRootWindow W;

if ((!bAdminVoteDone || bForceShow) && ValidOwner())
{
W = DeusExRootWindow(DeusExPlayer(Owner).RootWindow);
if (W != None)
{
AVW = AdminVoteWindow(W.InvokeMenuScreen(Class'AdminVoteWindow', true));
AVW.SetMessageText("An administrator has instigated a|nservertravel vote. Do you wish to|nchange to the most voted map,|n"@Maps[iNextMap]$"?");
AVW.Caller=Self;
W.ShowCursor(True);
}
}

OpenMVMenu

PostBeginPlay


local MVMutator c;

foreach allactors (class'MVMutator', c)
{
mut = c;
return;
}

if (c == None)
Mut = Spawn(class'MVMutator');
SetTimer(1, true);

ServerAdminVote (bool Vote)


bAdminVoteDone=True;
bAdminVoteYes=Vote;

ServerResetAdminVote


bAdminVoteDone=False;

ServerSetVote (int I)

CurrentVote = I

ShowWinner

f ((iNextMap >= 0) && ValidOwner()

Tick (float Delta)

Timer

f (ValidOwner())

ValidOwner -> bool

eturn ( (DeusExPlayer(Owner) != None) && DeusExPlayer(Owner).PlayerIsClient() && (DeusExPlayer(Owner).Player != None) && (DeusExPlayer(Owner).Player.CurrentNetSpeed != 1000000) ); //demo chec



DXMVMapVoteMenu.uc (extends MenuUIScreenWindow)

var localized string l_help1, l_help2, l_help3, l_help4, l_cvote, l_lmap;
var MenuUIScrollAreaWindow winScroll;
var MenuUIListWindow lstMaps, lstVotes;
var MenuUISmallLabelWindow CurrentVote, LeadingMap;
var DXL PlayerVote;
var float RepTime;
var bool bListDone, bStacking;
l_help1="Type 'Mutate MapVote' to display the menu."
l_help2="Type 'Mutate VoteResult' to display the leading map."
l_help3="Type 'Mutate Vote' to display the vote menu when a vote is in effect."
l_help4="Type 'Mutate StartVote' to begin a vote to immediatly change the map."
l_cvote="Current Vote:"
l_lmap="Leading Map:"
RepTime=1.00
actionButtons(0)=(Align=2,Action=1,Text="",Key="",btn=None),
actionButtons(1)=(Align=0,Action=5,Text="Clear Vote",Key="NOVOTE",btn=None),
actionButtons(2)=(Align=0,Action=5,Text="ServerTravel",Key="TRAVEL",btn=None),
Title="MapVote Menu v1.1.0"
ClientWidth=440
ClientHeight=244
bUsesHelpWindow=False

CanPushScreen (class C) -> bool

f (ClassIsChildOf(C, class'HUDMultiplayer') || ClassIsChildOf(C, class'MultiplayerMessageWin'))

CanStack -> bool

f (bStacking)

CreateLabel (int X, int Y, string S) -> MenuUISmallLabelWindow

DestroyWindow

TickEnabled = false

InitWindow

ListRowActivated (window W, int R) -> bool

f ((W == lstMaps) && bListDone)

MapNumToRow (int N) -> int

ProcessAction (String S)

uper.ProcessAction(S)

RawKeyPressed (EInputKey key, EInputState iState, bool bRepeat) -> bool

f ((key == IK_Enter) && (iState == IST_Release))

Tick (float Delta)


local int I, C;
f ((lstMaps == None) || (lstVotes == None) || (PlayerVote == None)



GunGame.uc (extends TCDeathmatch)

GTName="Arsenal (WIP)"
VictoryConString1="|P1Hit the score limit! (|P3 "
VictoryConString2=" |P1) - |P2(Your weapon changes as you streak)"
TimeLimitString1="|P1Score the most! (|P3 "
TimeLimitString2=" |P1) - |P2(Your weapon changes as you streak)"

Killed (pawn Killer, pawn Other, name damageType)


local bool NotifyDeath;
local DeusExPlayer otherPlayer;
local Pawn CurPawn;
local class checkClass;
local int i;
local TCPlayer TCP;
local class GiveClass;
local int Passes, r;
local Inventory anItem, anItem2;
local Class w;

//both players...
if ((Killer.bIsPlayer) && (Other.bIsPlayer))
{
for(i=0;i {
checkClass=class(DynamicLoadObject(Settings.DemoteWeapons[i],class'class'));

if(TCPlayer(Killer).inHand.class != none && checkClass != none)
{
if(TCPlayer(Killer).inHand.class == checkClass)
{
if(TCPRI(TCPlayer(Other).PlayerReplicationInfo).Rank > 1)
{
TCPRI(TCPlayer(Other).PlayerReplicationInfo).Rank -= 1;
BroadcastMessage(Other.PlayerReplicationInfo.PlayerName$" was demoted!");
}

}
}
}
if (Killer != Other)
{
// Grant the kill to the killer, and increase his streak
Killer.PlayerReplicationInfo.Score += 1;
if(TCPRI(TCPlayer(Killer).PlayerReplicationInfo).Rank < 12)
{
TCPRI(TCPlayer(Killer).PlayerReplicationInfo).Rank += 1;
RemovePlayerInventory(TCPlayer(Killer));
//TCPlayer(Killer).GGRank();
r = TCPRI(TCPlayer(Killer).PlayerReplicationInfo).Rank;

if (r == 1)
w = class'WeaponStealthPistol';

if (r == 2)
w = class'WeaponPistol';

if (r == 3)
w = class'WeaponFlamethrower';

if (r == 4)
w = class'WeaponMiniCrossbow';

if (r == 5)
w = class'WeaponShuriken';

if (r == 6)
w = class'WeaponSawedOffShotgun';

if (r == 7)
w = class'WeaponAssaultShotgun';

if (r == 8)
w = class'WeaponAssaultgun';

if (r == 9)
w = class'WeaponPlasmaRifle';

if (r == 10)
w = class'WeaponGepGun';

if (r == 11)
w = class'Weaponrifle';

if (r == 12)
w = class'WeaponNanoSword';

anItem = Spawn(w);
anItem.Frob(TCPlayer(Killer),None);
Inventory.bInObjectBelt = True;
anItem.Destroy();

anItem = Spawn(class'WeaponCombatKnife');
anItem.Frob(TCPlayer(Killer),None);
Inventory.bInObjectBelt = True;
anItem.Destroy();
TCPlayer(Killer).ClientMessage("|P7Ranked up to "$TCPRI(TCPlayer(Killer).PlayerReplicationInfo).Rank$"!");
}
}
}

Super.Killed(Killer,Other,damageType);


PostBeginPlay


local DeusExWeapon w;
local int r;


super.PostBeginPlay();

SetTimer(5,true);

for(r=0;r {
Foreach AllActors(class'DeusExWeapon',w)
{
if(w.tag != Settings.SaveSpawnWeapons[r])
{
w.Destroy();
}
}
}


RemovePlayerInventory (DeusExPlayer Player)


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 TCPlayer ssp;

foreach AllActors(class'TCPlayer',ssp)
if (ssp !=None)
SSP.AmmoRestock();




Infection.uc (extends TCDeathmatch)

var TCPlayer MainCarrier; //Just a track of who the original infected is.
var int PIK; //Pre-Infected Kills
var int IK;
GTName="Infection"
VictoryConString1="|P1Hit the score limit! (|P3 "
VictoryConString2=" |P1) - |P2(Beware of the infection...)"
TimeLimitString1="|P1Score the most! (|P3 "
TimeLimitString2=" |P1) - |P2(Beware of the infection...)"
//bDisableDefaultScoring=True

GetOdds (bool bMain) -> bool


local float baseOdds;
local TCPRI infecteds;


baseOdds = 0.5;

foreach AllActors(class'TCPRI', infecteds)
baseOdds += 0.1;

if(bMain)
baseOdds += 0.2;

if(FRand() < baseOdds)
return True;
else
return False;

Killed (pawn Killer, pawn Other, name damageType)


local TCPlayer KillerTC, VictimTC;
local PerkInfection PI;

KillerTC = TCPlayer(Killer);
VictimTC = TCPlayer(Other);
Super.Killed(Killer,Other,damageType);

if(KillerTC != None && VictimTC != None)
{
if(MainCarrier == None)
{
PIK++;
if(FRand() < (0.1 * PIK)) //50% chance of every death of the beginning match triggering the infection
{
Settings.Print("|P2The infection begins spreading...");
MainCarrier = VictimTC;
VictimTC.GetPerk("OpenDX.PerkInfection");
TCPRI(VictimTC.PlayerReplicationInfo).bInfected = True;
VictoryConString2=" |P1) - |P2(Death brings the infection.. be the last human standing!)";
TimeLimitString2=" |P1) - |P2(Death brings the infection.. be the last human standing!)";
}
}

if(TCPRI(KillerTC.PlayerReplicationInfo).bInfected && !TCPRI(VictimTC.PlayerReplicationInfo).bInfected)
{
if(KillerTC == MainCarrier)
{
IK += 1;
if(GetOdds(True))
{
TCPRI(VictimTC.PlayerReplicationInfo).bInfected = True;
VictimTC.GetPerk("OpenDX.PerkInfection");
Settings.Print("|P2"$VictimTC.PlayerReplicationInfo.PlayerName$" was infected.");
}
}
else
{

if(GetOdds(False))
{
KillerTC.HealPlayer(IK, False);
TCPRI(VictimTC.PlayerReplicationInfo).bInfected = True;
VictimTC.GetPerk("OpenDX.PerkInfection");
Settings.Print("|P2"$VictimTC.PlayerReplicationInfo.PlayerName$" was infected.");
}
}
}
}

PostBeginPlay


local DeusExWeapon w;
local int r;
local Infectiontimer SST;


super.PostBeginPlay();

SST = Spawn(class'Infectiontimer');
SST.SetTimer(1,true);

SST.myGame = Self;

bAllInfected -> bool


local TCPRI infecteds;


foreach AllActors(class'TCPRI', infecteds)
if(!infecteds.bInfected)
return False;

return True;




InfectionTimer.uc (extends Actor)

var Infection myGame;
bHidden=true

Timer


local TCPRI infecteds;
local int c;


foreach AllActors(class'TCPRI', infecteds)
c++;

if(c != 0)
{
//NEW: If all players are infected, the infected "team" wins, naming the main carrier
if(bAllInfected())
{
myGame.PreGameOver();
myGame.PlayerHasWon( myGame.MainCarrier, myGame.MainCarrier, None, "Infection" );
myGame.GameOver();
}
}

bAllInfected -> bool


local TCPRI infecteds;


foreach AllActors(class'TCPRI', infecteds)
if(!infecteds.bInfected)
return False;

return True;




Juggernaut.uc (extends TCTeam)

var TCPlayer Juggernaut;
var bool bShouldRun;
GTName="Juggernaut Team"
VictoryConString1="|P1Hit the score limit! (|P3 "
VictoryConString2=" |P1) - |P2(Get a high streak to become the juggernaut!)"
TimeLimitString1="|P1Score the most! (|P3 "
TimeLimitString2=" |P1) - |P2(Get a high streak to become the juggernaut!)"
//bDisableDefaultScoring=True

JuggernautTeams


local TCPlayer TCP;
local int jteam;


jteam = Juggernaut.PlayerReplicationInfo.Team;

foreach AllActors(class'TCPlayer', TCP)
{
if(!TCPRI(TCP.PlayerReplicationInfo).bJuggernaut)
{
TCPRI(TCP.PlayerReplicationInfo).tOldTeam = TCP.PlayerReplicationInfo.Team;

if(jteam == 0)
tSwapPlayer(TCP, 1, True, True);
else
tSwapPlayer(TCP, 0, True, True);
}
}

Killed (pawn Killer, pawn Other, name damageType)


local TCPlayer KillerTC, VictimTC;


KillerTC = TCPlayer(Killer);
VictimTC = TCPlayer(Other);
Super.Killed(Killer,Other,damageType);

if(VictimTC == Juggernaut && Juggernaut != None) //Did the juggernaut just die
{
Settings.Print("|P2The juggernaut has died!");
Juggernaut = None;
bShouldRun = False;
VictimTC.RemovePerkbyName("Juggernaut");
TCPRI(VictimTC.PlayerReplicationInfo).bJuggernaut = False;
ResetTeams();
}

if(Juggernaut == None)
{
if(KillerTC != None && KillerTC.PlayerReplicationInfo.Streak >= Settings.StreakLimit)
{
bShouldRun = True;
Juggernaut = KillerTC;
TCPRI(KillerTC.PlayerReplicationInfo).bJuggernaut = True;
Settings.Print("|P2"$KillerTC.PlayerReplicationInfo.PlayerName$" became the juggernaut!");
JuggernautTeams();
KillerTC.GetPerk("OpenDX.Juggernaut");
}
}

ResetTeams


local TCPlayer TCP;


foreach AllActors(class'TCPlayer', TCP)
{
tSwapPlayer(TCP, TCPRI(TCP.PlayerReplicationInfo).tOldTeam, True, True);
}

Tick (float Deltatime)


if(bShouldRun && Juggernaut == None)
{
Settings.Print("Juggernaut was missing.. resetting teams.");
bShouldRun=False;
ResetTeams();
}




JuggernautDM.uc (extends TCDeathmatch)

var TCPlayer Juggernaut;
GTName="Juggernaut DM"
VictoryConString1="|P1Hit the score limit! (|P3 "
VictoryConString2=" |P1) - |P2(Get a high streak to become the juggernaut!)"
TimeLimitString1="|P1Score the most! (|P3 "
TimeLimitString2=" |P1) - |P2(Get a high streak to become the juggernaut!)"
//bDisableDefaultScoring=True

Killed (pawn Killer, pawn Other, name damageType)


local TCPlayer KillerTC, VictimTC;


KillerTC = TCPlayer(Killer);
VictimTC = TCPlayer(Other);
Super.Killed(Killer,Other,damageType);

if(VictimTC == Juggernaut && Juggernaut != None) //Did the juggernaut just die
{
Settings.Print("|P2The juggernaut has died!");
Juggernaut = None;
VictimTC.RemovePerkbyName("Juggernaut");
TCPRI(VictimTC.PlayerReplicationInfo).bJuggernaut = False;
}

if(Juggernaut == None)
{
if(KillerTC != None && KillerTC.PlayerReplicationInfo.Streak >= Settings.StreakLimit)
{
Juggernaut = KillerTC;
TCPRI(KillerTC.PlayerReplicationInfo).bJuggernaut = True;
KillerTC.GetPerk("OpenDX.Juggernaut");
Settings.Print("|P2"$KillerTC.PlayerReplicationInfo.PlayerName$" became the juggernaut!");
}
}




KCObj.uc (extends DeusExDecoration)

var float ScoreMultiplier; //no planned use yet, but future proofing any modifications.
var TCPlayer KillerPlayer, KilledPlayer;
var int tLifespan;
ScoreMultiplier=1
bStatic=False
Physics=PHYS_Rotating
Texture=Texture'DeusExDeco.Skins.DXLogoTex1'
bMeshEnviroMap=True
ItemName="Skull"
Mesh=LodMesh'DeusExDeco.BoneSkull'
CollisionRadius=5.800000
CollisionHeight=4.750000
bFixedRotationDir=True
bBlockPlayers=False
bInvincible=True
bPushable=False
Mass=50.000000
Buoyancy=500.000000
RotationRate=(Yaw=8192)

Bump (actor Other)


if(TCPlayer(Other) != None && !TCPlayer(Other).IsInState('Dying') && TCPlayer(Other).Health > 0)
kcTriggered(TCPlayer(Other));

Frob (actor Frobber, inventory FrobWith)


kcTriggered(TCPlayer(Frobber));

GetName (TCPlayer p) -> string


return p.PlayerReplicationInfo.PlayerName;

RadialCollect


local TCPlayer P, winP;
local vector dist;
local float lowestDist;


lowestDist = 1024;

foreach VisibleActors(class'TCPlayer', P, 50)
{
if(P != None && !P.IsInState('Dying') && P.Health > 0)
{
if(vSize(P.Location - Location) < lowestDist)
{
winP = P;
lowestDist = vSize(P.Location - Location);
}
}
}

if(winP != None)
kcTriggered(winp);

Tick (float Deltatime)


RadialCollect();

Timer


tLifespan--;
if(tLifespan <= 0)
{
BroadcastMessage("|P2"$GetName(KillerPlayer)$"'s kill against "$GetName(KilledPlayer)$" failed.");
Destroy();
}
RadialCollect();

kcTriggered (TCPlayer myActivator)


local int modScore;


modScore = 1;

if(myActivator == KillerPlayer)
{
modScore *= ScoreMultiplier;

myActivator.ClientMessage("|C8B6914 Confirmed your kill against "$GetName(KilledPlayer)$"! |P2+"$modScore$" |C8B6914score");
KilledPlayer.ClientMessage("|C8B6914 Your death to "$GetName(KillerPlayer)$" was confirmed!");
}
else if(myActivator == KilledPlayer)
{
modScore *= ScoreMultiplier;

myActivator.ClientMessage("|C8B6914 Denied your kill by "$GetName(KillerPlayer)$"! |P2+"$modScore$" |C8B6914score");
KillerPlayer.ClientMessage("|C8B6914 Your kill against "$GetName(KilledPlayer)$" was denied!");
}
else
{
modScore += 1;
modScore *= ScoreMultiplier;
myActivator.ClientMessage("|C8B6914 Denied "$GetName(KillerPlayer)$"'s kill! |P2+"$modScore$" |C8B6914score");
KilledPlayer.ClientMessage("|C8B6914 Your death to "$GetName(KillerPlayer)$" was denied by "$GetName(myActivator)$"!");
KillerPlayer.ClientMessage("|C8B6914 Your kill against "$GetName(KilledPlayer)$" was denied by "$GetName(myActivator)$"!");
}

Target.PlaySound(Sound'DeusExSounds.UserInterface.LogGoalCompleted',,,, 256);
myActivator.PlayerReplicationInfo.Score += modScore;
Destroy();




KillConfirmed.uc (extends TCDeathmatch)

VictoryConString1="|P1Hit the score limit! (|P3 "
VictoryConString2=" |P1) -|P2 (Grab the skulls of your victims to score!)"
TimeLimitString1="|P1Score the most! (|P3 "
TimeLimitString2=" |P1) -|P2 (Grab the skulls of your victims to score!)"
GTName="Kill Confirmed"
bDisableDefaultScoring=True

Killed (pawn Killer, pawn Other, name damageType)


local KCObj KC;
local TCPlayer KillerTC, VictimTC;


KillerTC = TCPlayer(Killer);
VictimTC = TCPlayer(Other);
Super.Killed(Killer,Other,damageType);

if((KillerTC != VictimTC) && (KillerTC != None && VictimTC != None)) //Making sure it isn't suicide and both players do actually exist.
{
KillerTC.PlayerReplicationInfo.Streak += 1;
KC = Spawn(class'KCObj', VictimTC,, VictimTC.Location);
KC.KilledPlayer = VictimTC;
KC.KillerPlayer = KillerTC;
KC.SetTimer(0.5,True);
KC.tLifespan = Settings.KCLifespan;
KC.scoreMultiplier = Settings.BaseScoreMultiplier;
}




KillConfirmedTeam.uc (extends TCTeam)

VictoryConString1="|P1Hit the score limit! (|P3 "
VictoryConString2=" |P1) - |P2(Grab the skulls of your victims to score!)"
TimeLimitString1="|P1Score the most! (|P3 "
TimeLimitString2=" |P1) - |P2(Grab the skulls of your victims to score!)"
GTName="Kill Confirmed Team"
bDisableDefaultScoring=True

Killed (pawn Killer, pawn Other, name damageType)


local KCObj KC;
local TCPlayer KillerTC, VictimTC;


KillerTC = TCPlayer(Killer);
VictimTC = TCPlayer(Other);
Super.Killed(Killer,Other,damageType);

if((KillerTC != VictimTC) && (KillerTC != None && VictimTC != None)) //Making sure it isn't suicide and both players do actually exist.
{
KillerTC.PlayerReplicationInfo.Streak += 1;
KC = Spawn(class'KCObj', VictimTC,, VictimTC.Location);
KC.KilledPlayer = VictimTC;
KC.KillerPlayer = KillerTC;
KC.SetTimer(0.5,True);
KC.tLifespan = Settings.KCLifespan;
KC.scoreMultiplier = Settings.BaseScoreMultiplier;
}




MVMutator.uc (extends Mutator)

var config string ExcludeList[32];
var config ECycleType CycleType;
var config eDefaultVote DefaultVote;
var config ETimeToDisplay TimeToDisplay;
var config bool bUseMapListOnly, bFilterSPMaps, bAllowRepeatMap;
var int VoteTime;
var int CountDown; //Ayleth: for changemap.
var string Maps[250];
var int MapCount;
var byte VoteTotals[arraycount(Maps)];
var DXL DXLList;
var string sNextMap;
var float CWTime;
var int LoadingTime, iDefMap, iNextMap, iListSize, EggTimer;
var bool bInit, bVoteDone, bDoAdminVote, bDoMapChange;
CycleType=2
DefaultVote=1
bFilterSPMaps=True
VoteTime=45

AddDXL (Actor A)

AddMap (string M)

ChooseWinner (optional bool bFinal)

GetDXL (Actor A, optional bool bSafe) -> DXL

GetMapFiles

GetMapList

ModifyPlayer (Pawn P)

f (!bVoteDone && (DeusExPlayer(P) != None) && (GetDXL(P) == None)

Mutate (string S, PlayerPawn P)


Local DXL GetVotes;
local DeusExPlayer Player;

if (DXLList != None)
{
if (S ~= "MapVote")
{
if (!bVoteDone)
{
GetDXL(P, true).OpenMVMenu();
}
}
else if (S ~= "VoteResult")
{
GetDXL(P, true).ShowWinner();
}
else if (S~= "Vote") //allows the player to vote for immediate changemap
{
if(bDoAdminVote==True)
GetDXL(P,true).OpenAVMenu(True);
else
DeusExPlayer(P).Clientmessage("There is no vote in progress to change the map");
}
//trm
else if (P.bAdmin)
{
if (S ~= "filtersp")
{
bFilterSPMaps=!bFilterSPMaps;
P.ClientMessage("MAPVOTE: Filtering SP Maps:"@bFilterSPMaps);
}
else if (S ~= "usemaplist")
{
bUseMapListOnly=!bUseMapListOnly;
P.ClientMessage("MAPVOTE: Using Map List Only:"@bUseMapListOnly);
}
else if (S ~= "cycletype")
{
if (CycleType==CT_Static)
{
CycleType = CT_Random;
P.ClientMessage("MAPVOTE: CycleType now [Random].");
}
else if (CycleType==CT_Random)
{
CycleType = CT_Cycle;
P.ClientMessage("MAPVOTE: CycleType now [Cycle].");
}
else
{
CycleType = CT_Static;
P.ClientMessage("MAPVOTE: CycleType now [Static].");
}
}
Else if (S~= "StartVote") //admin calls this to begin changemap vote.
{
if(!bDoAdminVote)
{
foreach allactors(class'DXL',GetVotes)
{
GetVotes.ClientResetAdminVote();
GetVotes.ServerResetAdminVote();
GetVotes.bAdminVoteDone=false;
}
if(TimeToDisplay==TTD_Immediatly)
BroadCastMessage("An administrator has called for a servertravel mapvote to the map"@Maps[iNextMap]$". Please cast your vote when you have died or type 'Mutate Vote' to cast your vote now.");
Else
BroadCastMessage("An administrator has called for a servertravel mapvote to the map"@Maps[iNextMap]$".");
bDoAdminVote=True;
settimer(1,true);
if(TimeToDisplay==TTD_Immediatly)
foreach allactors(Class'DeusExPlayer',Player)
GetDXL(Player, true).OpenAVMenu(false);
}
else DeusExPlayer(P).Clientmessage("A vote is already in progress.");
}
}
}

Super.Mutate(S, P);

PostBeginPlay

ScoreKill (pawn Killer, pawn Other)


if(bDoAdminVote && TimeToDisplay==TTD_OnDeath) //this is where the player recieves the message window to vote.
GetDXL(Other, true).OpenAVMenu(false);

Tick (float Delta)

f (bVoteDone

Timer

UpdateVoteData (optional bool bFinal)




N_ShockWave.uc (extends Effects)

var float OldShockDistance, ShockSize;
var float nscale;
nscale=0.75
LifeSpan=1.50
DrawType=DT_Mesh
Style=STY_Translucent
AmbientGlow=255
bUnlit=True
bAlwaysRelevant=True
MultiSkins(0)=FireTexture'Effects.liquid.Virus_SFX'
MultiSkins(1)=FireTexture'Effects.liquid.Virus_SFX'
Skin=FireTexture'Effects.liquid.Virus_SFX'
Mesh=LodMesh'DeusExItems.SphereEffect'

PostBeginPlay


local Pawn P;


if ( Role == ROLE_Authority )
{
for ( P=Level.PawnList; P!=None; P=P.NextPawn )
if ( P.IsA('Human') && (VSize(P.Location - Location) < (1000 * nscale)) )
Human(P).ShakeView(0.5, (250000.0*nscale)/VSize(P.Location - Location), 10);

if ( Instigator != None )
MakeNoise(10.0*nscale);
}

SetTimer(0.125, True);

if ( Level.NetMode != NM_DedicatedServer )
SpawnEffects();

SpawnEffects


local ExplosionLarge E;


PlaySound(sound'LargeExplosion2', SLOT_Misc,,, 2000*nscale);
E = spawn(class'ExplosionLarge',,,Location);
E.RemoteRole = ROLE_None;

Tick (float DeltaTime)


if ( Level.NetMode != NM_DedicatedServer )
{
// ShockSize = 13 * (Default.LifeSpan - LifeSpan) + 3.5/(LifeSpan/Default.LifeSpan+0.05);
ShockSize = 59.0 * (Default.LifeSpan - LifeSpan) + 1.0;
ScaleGlow = Lifespan;
AmbientGlow = ScaleGlow * 255;
DrawScale = ShockSize * 0.10 * nscale; //scale Earth to correct size
}

Timer


local actor Victims;
local float dist, MoScale;
local vector dir;


ShockSize = 59.0 * (Default.LifeSpan - LifeSpan) + 1.0;
if ( Level.NetMode != NM_DedicatedServer )
{
if ( Level.NetMode == NM_Client )
{
foreach VisibleCollidingActors( class 'Actor', Victims, ShockSize*6*nscale, Location )
if ( Victims.Role == ROLE_Authority )
{
dir = Victims.Location - Location;
dist = FMax(1,VSize(dir));
dir = dir/dist +vect(0,0,0.3);
if ( (dist> OldShockDistance) || (dir dot Victims.Velocity <= 0))
{
MoScale = FMax(0, 1000 - (1.862 * Dist)/nscale);
Victims.Velocity = Victims.Velocity + dir * (MoScale + 20);
Victims.TakeDamage( MoScale, Instigator,
Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * dir,
(1000 * dir), 'Burned' );
}
}
return;
}
}

foreach VisibleCollidingActors( class 'Actor', Victims, ShockSize*6*nscale, Location )
{
dir = Victims.Location - Location;
dist = FMax(1,VSize(dir));
dir = dir/dist + vect(0,0,0.3);
if (dist> OldShockDistance || (dir dot Victims.Velocity < 0))
{
MoScale = FMax(0, 1000 - (1.862 * Dist)/nscale);
if ( Victims.bIsPawn )
Pawn(Victims).AddVelocity(dir * (MoScale + 20));
else
Victims.Velocity = Victims.Velocity + dir * (MoScale + 20);
Victims.TakeDamage( MoScale, Instigator,
Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * dir,
(1000 * dir), 'Burned' );
}
}

OldShockDistance = ShockSize*6*nscale;

setnscale (float newvalue)


nscale = newvalue;




ODXBoost.uc (extends ODXPickup)

Physics=PHYS_Rotating
PickupMode=EP_Perk
bHidden=False
DrawType=DT_Mesh
Mesh=Mesh'DXLogo'
Drawscale=0.3
ODXPerk="PerkBoost"
Texture=FireTexture'Effects.Electricity.Ambrosia_Sfx'
Skin=FireTexture'Effects.Electricity.Ambrosia_Sfx'
RotationRate=(Yaw=36000)



ODXHiddenActor.uc (extends Actor)

bHidden=True



ODXJump.uc (extends ODXPickup)

SleepTimer=0
PickupMode=EP_Jump
bHidden=False
DrawType=DT_Sprite
Drawscale=0.6
Texture=Texture'AugIconDrone_Small'
Skin=Texture'AugIconDrone_Small'



ODXPickup.uc (extends DeusExDecoration)

var() class ODXInv;
var class CurClass;
var string EffectString;
var bool bNeverDestroy;
var bool bSleeping;
var DeusExPlayer Pup;
var() int SleepTimer;
var() class ODXAug;
var() string ODXPerk;
var int Count;
var() int JumpVel;
var EPMode PickupMode;
JumpVel=750
SleepTimer=30
bInvincible=True
HitPoints=100
ItemName="PSUPICKUP"
//bMovable=False
bPushable=False
bHighlight=False
LightBrightness=100
Physics=PHYS_Rotating
Lighttype=LT_Steady
LightRadius=10
Ambientglow=255
LightSaturation=255
Drawscale=1
Fatness=140
style=sty_translucent
bBlockPlayers=False
Mesh=LodMesh'DeusExDeco.Lightbulb'
Texture=Texture'DeusExUI.UserInterface.AugIconCombat_Small';
CollisionRadius=5.000000
CollisionHeight=8.000000
bFixedRotationDir=True
RotationRate=(Yaw=8192)

BeginPlay


SetTimer(1,True);

PSUEffect (DeusExPlayer DXP, string EffectStr)

}

function Destroyed()

PickupGet (TCPlayer myActivator)



myActivator.PlaySound(Sound'DeusExSounds.UserInterface.LogGoalCompleted',,,, 256);
if(PickupMode == EP_Pickup)
SilentAdd(ODXInv, myActivator);

if(PickupMode == EP_Perk)
{
myActivator.GetPerk(ODXPerk);
}

if(PickupMode == EP_Aug)
{
myActivator.AugmentationSystem.GivePlayerAugmentation(ODXAug);
myActivator.AugmentationSystem.GivePlayerAugmentation(ODXAug);
}

if(PickupMode == EP_Jump)
{
myActivator.DoJump();
myActivator.Velocity.Z = JumpVel;
myActivator.SetPhysics(Phys_Falling);
}
bHidden=True;
bSleeping=True;
Count=SleepTimer;
return;

RadialCollect


local TCPlayer P, winP;
local vector dist;
local float lowestDist;


lowestDist = 1024;

foreach VisibleActors(class'TCPlayer', P, 50)
{
if(P != None && !P.IsInState('Dying') && P.Health > 0)
{
if(vSize(P.Location - Location) < lowestDist)
{
winP = P;
lowestDist = vSize(P.Location - Location);
}
}
}

if(winP != None)
PickupGet(winp);

SilentAdd (class addClass, DeusExPlayer addTarget)


local Inventory anItem;


anItem = Spawn(addClass,,,addTarget.Location);
anItem.SpawnCopy(addTarget);
anItem.Destroy();

Tick (float deltatime)


local DeusExPlayer DXP;


super.Tick(deltatime);

if(bSleeping)
return;

RadialCollect();

if(PickupMode == EP_None)
bHidden=True;

if(PickupMode == EP_Pickup && ODXInv != None && curclass != ODXInv)
{
bHidden=False;
CurClass = ODXInv;
DrawType=DT_Mesh;
Style=STY_Normal;
Mesh = ODXInv.default.Mesh;
Drawscale = ODXInv.default.Drawscale;
SetCollisionSize(ODXInv.default.CollisionRadius, ODXInv.default.CollisionHeight);
}

Timer


if(bSleeping)
{
Count--;
if(Count <= 0)
{
Log(Self$" respawned.");
bHidden=False;
bSleeping=False;
}
}




ODXQuad.uc (extends ODXPickup)

Physics=PHYS_Rotating
PickupMode=EP_Perk
bHidden=False
DrawType=DT_Mesh
Mesh=Mesh'DXLogo'
Drawscale=0.3
ODXPerk="PerkQuad"
Texture=FireTexture'Effects.Electricity.Nano_SFX_A'
Skin=FireTexture'Effects.Electricity.Nano_SFX_A'
RotationRate=(Yaw=8192)



ODXTrigger.uc (extends Trigger)

var(Events) class LimitingClass;
LimitingClass=Class'Engine.Actor'
// Texture=Texture'MoreTriggersIcon'

BeenTriggeredODX (TCPlayer instigator)

} //set by subclasse

Touch (Actor other)


if(IsRelevant(other))
{
BeenTriggeredODX(TCPlayer(other));
if(bTriggerOnceOnly)
Destroy();
}

Trigger (Actor other, Pawn instigator)


BeenTriggeredODX(TCPlayer(instigator));
if(bTriggerOnceOnly)
Destroy();




ODXVoteActor.uc (extends Actor)

var TCPlayer VPs[32];
var int VoteCounter[10];
var string FinalVoteStr;
bHidden=true

AcceptVote (TCPlayer Voter, int i)


local int f;
local bool bFound;
local string n;


for(f=0;f<32;f++)
if(VPs[f] == Voter)
bFound=True;

if(!bFound)
{
n = GetGT(i);
VoteCounter[i]++;
CalcHighest();
BroadcastMessage(Voter.PlayerReplicationInfo.PlayerName$" voted for "$n$". Game mode will be "$FinalVoteStr$" next.");
for(f=0;f<32;f++)
if(VPs[f] == None)
{
VPs[f] = Voter;
return;
}
}

CalcHighest


local int i, a, s;


i=0;

for(a=0;a<10;a++)
{
Log(VoteCounter[a]$" at "$a$" "$GetGT(a));
if(VoteCounter[a] > i)
{
Log("New leader "$a$" "$GetGT(a));
i = VoteCounter[a];
s = a;
}
}

if(s == 1)
FinalVoteStr = "TCTeam";
if(s == 2)
FinalVoteStr = "TCDeathmatch";
if(s == 3)
FinalVoteStr = "JuggernautDM";
if(s == 4)
FinalVoteStr = "Juggernaut";
if(s == 5)
FinalVoteStr = "KillConfirmed";
if(s == 6)
FinalVoteStr = "KillConfirmedTeam";
if(s == 7)
FinalVoteStr = "Infection";
if(s == 8)
FinalVoteStr = "GunGame";
if(s == 9)
FinalVoteStr = "Sharpshooter";

GetGT (int i) -> string


if(i == 1)
return "Team Deathmatch";
if(i == 2)
return "Deathmatch";
if(i == 3)
return "Juggernaut";
if(i == 4)
return "Team Juggernaut";
if(i == 5)
return "Kill Confirmed";
if(i == 6)
return "Team Kill Confirmed";
if(i == 7)
return "Infection";
if(i == 8)
return "Arsenal GunGame";
if(i == 9)
return "Sharpshooter";




ODXWaypoint.uc (extends ODXTrigger)

var() name MarkerTag; //Tag of the actor we want to mark
var() int MarkerLifespan; //Optional lifespan of the marker
var() string MarkerName; //Optional name of the marker
var() bool bMarkerDeleter; //If true, ignore all variables and only deletes the current markers
var() bool bLocalPlayerOnly; //Only do the markers for the triggering player, false triggers for ALL
var() string PrintMsg; //Do we also want to print a clientmessage to the player

BeenTriggeredODX (TCPlayer Ins)


local TCPlayer TCP;
local actor a;


if(PrintMsg != "") //Do the print before anything
{
if(bLocalPlayerOnly)
{
ins.ClientMessage(PrintMsg);
}
else
{
foreach AllActors(class'TCPlayer',TCP)
{
TCP.ClientMessage(PrintMsg);
}
}
}

if(bMarkerDeleter) //If we're deleting...
{
if(bLocalPlayerOnly)
{
ins.CancelWaypoint();
}
else
{
foreach AllActors(class'TCPlayer',TCP)
{
TCP.CancelWaypoint();
}
}
return; //Don't go to the marker creating if we're a deleter
}

if(MarkerTag != 'None')
{
foreach AllActors(class'Actor',A)
{
if(A.Tag == MarkerTag)
{
if(bLocalPlayerOnly)
{
ins.SetWaypoint(A, MarkerName, MarkerLifespan);
}
else
{
foreach AllActors(class'TCPlayer',TCP)
{
TCP.SetWaypoint(A, MarkerName, MarkerLifespan);
}
}
}
}
}




OSDActor.uc (extends Actor)

var bool bSDAt, bSDIn;
var int ShutdownInTime; //Shuts down in X minutes;
var string ShutdownAtTime; //Shutsdown at X time;
var int SDaMins, SDaHours;
var int SDInCur;
var bool bSDReady;
var bool bDebug;
var TCDeathmatch myDMGame;
var TCTeam myTDMGame;
bHidden=true

Destroyed


if(myDMGame != None)
{
myDMGame.bSDFound=False;
myDMGame.SDStr = "";
if(bDebug) log("Deathmatch found on Destroyed().",'OSDA');
}

if(TCTeam(level.game) != None)
{
myTDMGame.bSDFound=False;
myTDMGame.SDStr = "";
if(bDebug) log("TeamDeathmatch found on Destroyed().",'OSDA');
}
super.Destroyed();

GetControls -> TCControls


local TCControls TCC;

if(TCDeathmatch(Level.Game) != None) TCC = TCDeathMatch(Level.Game).Settings;
if(TCTeam(Level.Game) != None) TCC = TCTeam(Level.Game).Settings;

if(TCC == None)
log("ERROR: SETTINGS NOT FOUND", 'OSDA');

return TCC;

MinsRemain (int m) -> bool


local int ch, cm;
local bool bLastHour;
local string cmf;


ch = SDAHours;
cm = SDAMins;

cm -= m;
if(cm < 0)
{
cm += 60;
ch -= 1;
if(ch == -1)
ch = 23;
bLastHour=True;
}

if(cm == 60)
{
cm = 0;
ch += 1;
bLastHour=False;
}

if(bDebug)
Log(Level.hour$":"$level.minute$" Checking: ["$bLastHour$"] "$ch$":"$cm$" against "$m$" remaining... "$SDAHours$":"$SDAMins$" ("$ShutdownAtTime$")");

if(cm == Level.minute)
{
if(Level.Hour == ch)
{
if(bDebug)
Log("Returning true");
return true;
}
}

PostBeginPlay


if(TCDeathMatch(level.game) != None)
{
TCDeathMatch(level.game).bSDFound=True;
myDMGame = TCDeathmatch(level.game);
if(bDebug) log("Deathmatch found.",'OSDA');
}

if(TCTeam(level.game) != None)
{
TCTeam(level.game).bSDFound=True;
myTDMGame = TCTeam(level.game);
if(bDebug) log("TeamDeathmatch found.",'OSDA');
}
super.PostBeginPlay();

SetSDStr (string str)


if(myDMGame != None)
{
myDMGame.SDStr = str;
}

if(TCTeam(level.game) != None)
{
myTDMGame.SDStr = str;
}

Timer


local string curtime;
local int curmins, curhours;

if(bSDReady)
{
Log("Server was closed due to OSDA System",'OpenDX');
ConsoleCommand("exit");
}

if(bSDAt)
{
curtime = Level.hour $ ":" $ Level.minute;
if(MinsRemain(60))
{
GetControls().Print("Sixty minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(50))
{
GetControls().Print("Fifty minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(40))
{
GetControls().Print("Fourty minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(30))
{
GetControls().Print("Thirty minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(20))
{
GetControls().Print("Twenty minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(15))
{
GetControls().Print("Fifteen minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(10))
{
GetControls().Print("Ten minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(5))
{
GetControls().Print("Five minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(4))
{
GetControls().Print("Four minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(3))
{
GetControls().Print("Three minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(2))
{
GetControls().Print("Two minutes remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(1))
{
GetControls().Print("One minute remains until scheduled shutdown at "$ShutdownAtTime);
}
if(MinsRemain(0))
{
GetControls().Print("Server will be closing shortly due to scheduled shutdown.");
bSDReady=True;
}
}
if(bSDIn)
{
SDInCur++;
SetSDStr("Shuts down in "$ShutdownInTime - SDInCur);

if(SDInCur == (ShutdownInTime - 60))
{
GetControls().Print("Sixty minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 50))
{
GetControls().Print("Fifty minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 40))
{
GetControls().Print("Forty minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 30))
{
GetControls().Print("Thirty minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 20))
{
GetControls().Print("Twenty minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 15))
{
GetControls().Print("Fifteen minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 10))
{
GetControls().Print("Ten minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 5))
{
GetControls().Print("Five minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 3))
{
GetControls().Print("Three minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 2))
{
GetControls().Print("Two minutes remains until shutdown.");
}
if(SDInCur == (ShutdownInTime - 1))
{
GetControls().Print("One minute remains until shutdown.");
}
if(SDInCur == (ShutdownInTime))
{
GetControls().Print("Server will be closing shortly....");
bSDReady=True;
}
}




OpenDX.uc (extends TCDeathmatch)




OpenDXDevTest.uc (extends TCDeathmatch)




PerkBoost.uc (extends Perks)

var int Count;
Count=30
PerkName="Speed Boost"
PerkShortName="boost"
bLock=True

PerkOff


PerkOwner.GroundSpeed = PerkOwner.Default.mpGroundSpeed;
PerkOwner.mpGroundSpeed = PerkOwner.Default.mpGroundSpeed;
PerkOwner.JumpZ = PerkOwner.Default.JumpZ;
PerkOwner.UpdateAnimRate( -1.0 );

PerkOn


SetTimer(1, True);

PerkOwner.GroundSpeed *= 1.8;
PerkOwner.mpGroundSpeed *= 1.8;
PerkOwner.JumpZ *= 1.8;
PerkOwner.UpdateAnimRate(1.8);

Timer


Count--;

if(Count <= 5)
PerkOwner.Notif("(Boost) "$Count$" seconds remaining.");

if(Count <= 0)
PerkOwner.RemovePerkbyName("Speed Boost");




PerkDebug.uc (extends Perks)

var int db;
PerkName="Debugger"

PerkOff


PerkOwner.ClientMessage("Debug perk de-activated.");

PerkOn


PerkOwner.ClientMessage("Debug perk activated.");

PerkTick


db += 1;

if(db % 10 == 0)
PerkOwner.ClientMessage("The perk is debugging.");




PerkHero.uc (extends Perks)

var int HC, HHC, MaxCount, HMaxCount;
var float HRange;
var bool bWasHeal;
HRange=512
MaxCount=75
HMaxCount=10
PerkName="Hero Health"

HeroHeal


local bool bHealed;


HHC++;

if(HHC > HMaxCount)
{
HHC = 0;
if(PerkOwner.Health < 100)
{
PerkOwner.HealPlayer(15, False);
bHealed=True;
}

if(PerkOwner.Energy < PerkOwner.EnergyMax)
{
PerkOwner.Energy += 15;
if(PerkOwner.Energy > PerkOwner.EnergyMax)
PerkOwner.Energy = PerkOwner.EnergyMax;

bHealed=True;
}

if(bHealed)
PerkOwner.ClientFlash(0.5, vect(0, 0, 500));
}

PerkTick


if(bSafe()) //If both checks pass and we're still in safety, begin counting
{
if(HC <= MaxCount) //If counter is below the target, keep adding
HC++;
else //If counter is above the max, start healing
{
if(!bWasHeal)
{
bWasHeal=True;
if(PerkOwner.Health < 100 || PerkOwner.Energy < PerkOwner.EnergyMax)//Only print message if not fully healed
PerkOwner.ClientMessage("|P3Health has begun regenerating...");
}


HeroHeal();
}

}
else //if check fails and we're not in safety, reset counter
{
if(bWasHeal && (PerkOwner.Health < 100 || PerkOwner.Energy < PerkOwner.EnergyMax))
PerkOwner.ClientMessage("|P2Healing cancelled due to possible danger.");
HC = 0;
bWasHeal=False;
}

bSafe -> bool


local bool bSafety;
local TCPlayer TCP;
local ScriptedPawn SP;


bSafety=True; //Start true

if(PerkOwner.InHand != None) //check one, are we armed
{
bSafety=False;
}

foreach PerkOwner.VisibleActors(class'ScriptedPawn', SP, HRange)
{
if(SP != None)
bSafety=False;
}

foreach PerkOwner.VisibleActors(class'TCPlayer', TCP, HRange) //check two, is anyone near by
{
if(TCP != PerkOwner)
{
if(TCDeathmatch(Level.game) != None)
{
if(TCPRI(TCP.PlayerReplicationInfo).TeamNamePRI == "") //Target not in team, assume enemy
bSafety=False;
else //Target is in a team, move to ally check
{
if(TCPRI(TCP.PlayerReplicationInfo).TeamNamePRI != TCPRI(PerkOwner.PlayerReplicationInfo).TeamNamePRI) //Not the same team
bSafety=False;
}
}
else if(TCTeam(Level.Game) != None)
{
if(TCP.PlayerReplicationInfo.Team != PerkOwner.PlayerReplicationInfo.Team)
bSafety=False;
}
}
}

return bSafety;




PerkIcarus.uc (extends Perks)

var bool bReverse, bTrig;
PerkName="Icarus Landing System"
PerkShortName="Icarus"

PerkTick


if(PerkOwner.Velocity.Z < -600 && !bReverse)
{
bTrig=True;
bReverse=True;
PerkOwner.ClientMessage("|P3Icarus landing system activated...");
}

if(bTrig)
{
if(bReverse)
PerkOwner.Velocity.Z += 100;

if(PerkOwner.Velocity.Z > 0)
{
bTrig=False;
bReverse=False;
PerkOwner.ClientMessage("|P3Icarus landing system de-activated...");
}
}




PerkInfection.uc (extends Perks)

PerkName="Infection"
bLock=True



PerkJuggernaut.uc (extends Perks)

var bool bReverse, bTrig;
var int velz, CheckRadius;
CheckRadius=256
PerkName="Juggernaut"
bLock=True

PerkOff


PerkOwner.bNuke=False;

PerkOn


PerkOwner.bNuke=True;

PerkTick


if(PerkOwner.HealthLegLeft <= 0)
{
Skullshot();
BroadcastMessage("The Juggernaut is crippled!");
PerkSleep(30);
}

if(PerkOwner.Velocity.Z < -600 && !bReverse)
{
bTrig=True;
bReverse=True;
PerkOwner.ClientMessage("|P3Juggernaut landing system activated...");
}

if(bTrig)
{
if(bReverse)
PerkOwner.Velocity.Z += 100;

if(PerkOwner.Velocity.Z > 0)
{
bTrig=False;
bReverse=False;
PerkOwner.ClientMessage("|P3Juggernaut landing system de-activated...");
}
}

Skullshot


local vector loc, vline, HitLocation, hitNormal, altloc;
local rotator altrot;
local Actor HitActor;
local actor a;
local ScriptedPawn hitPawn;
local PlayerPawn hitPlayer;
local DeusExMover hitMover;
local DeusExDecoration hitDecoration;
local TCPlayer Player;

Player = PerkOwner;

SpawnExplosion(Player.Location);
loc = Player.Location;
loc.Z -= 32;


foreach Player.VisibleActors(class'Actor', A, CheckRadius)
{
if (a != None && a != Player)
{
hitPawn = ScriptedPawn(a);
hitDecoration = DeusExDecoration(a);
hitPlayer = PlayerPawn(a);
hitMover = DeusExMover(a);
if (hitPawn != None)
{
hitPawn.SetPhysics(Phys_Falling);
hitPawn.Velocity = (normal(loc - hitPawn.Location) * velz);
//hitPawn.TakeDamage(Player.Energy, Player, hitLocation, normal(loc - hitPawn.Location) * velz, 'Exploded');
}
else if (hitDecoration != None)
{
hitDecoration.SetPhysics(Phys_Falling);
hitDecoration.Velocity = (normal(loc - hitDecoration.Location) * velz);
//hitDecoration.TakeDamage(Player.Energy, Player, hitLocation, normal(loc - hitDecoration.Location) * velz, 'Exploded');
}
else if (hitPlayer != None)
{
hitPlayer.SetPhysics(Phys_Falling);
hitPlayer.Velocity = (normal(loc - hitPlayer.Location) * velz);
//hitPlayer.TakeDamage(Player.Energy / 3, Player, hitLocation, normal(loc - hitPlayer.Location) * velz, 'Exploded');
}
if (hitMover != None)
{
hitMover.bDrawExplosion = True;
// hitMover.TakeDamage(Player.Energy * 3, Player, hitLocation,normal(loc - hitMover.Location) * velz, 'Exploded');
}
}
}

SpawnExplosion (vector Loc)


local ShockRing s1, s2, s3;
local SphereEffect se;


s1 = spawn(class'ShockRing',,,Loc,rot(16384,0,0));
s1.Lifespan = 5.5;
s2 = spawn(class'ShockRing',,,Loc,rot(0,16384,0));
s2.Lifespan = 5.5;
s3 = spawn(class'ShockRing',,,Loc,rot(0,0,16384));
S3.Lifespan = 5.5;
se = spawn(class'SphereEffect',,,Loc,rot(16384,0,0));
se.Lifespan = 5.5;
se.MultiSkins[0]=Texture'DeusExDeco.Skins.AlarmLightTex7';




PerkMediAura.uc (extends Perks)

var int db;
PerkName="Medical Aura"

AreAlliesBasic (TCPlayer one, tcplayer two) -> bool


if(TCPRI(One.PlayerReplicationInfo).TeamNamePRI == "" || TCPRI(Two.PlayerReplicationInfo).TeamNamePRI == "")
return false;

if(TCPRI(One.PlayerReplicationInfo).TeamNamePRI == TCPRI(Two.PlayerReplicationInfo).TeamNamePRI)
return true;

HealPlayers


local Actor a;
local TCPlayer target, targetList[3], Player;
local int count, i, healamount, totalamount;


Player = PerkOwner;
count = 0;

if(TCTeam(Player.DXGame) != None) // Healing teammates in deathmatch is useless.
{
foreach RadiusActors(class'Actor', a, 256, Player.Location)
{
if(a.IsA('TCPlayer')) // TODO: Only heal teammates
{
target = TCPlayer(a);
if(target.PlayerReplicationInfo != None && target != Player &&!target.PlayerReplicationInfo.bIsSpectator && target.Health > 0 && target.Health < 100 && (target.lastTeamHeal+1 <= Level.TimeSeconds) && (target.PlayerReplicationInfo.Team == player.PlayerReplicationInfo.Team))
{
targetList[count] = target;
count++;
if(count == 3) // We heal a maximum of 3 players
break;
}
}
}

if(count > 0)
{
healamount = Min(30, (45/count));
totalamount = healamount*count;
for(i = 0; i < count; i++)
{
if(targetList[i] != None)
{
targetList[i].HealPlayer(healamount, False);
targetList[i].ClientFlash(0.5, vect(0, 0, 500));
targetList[i].lastTeamHeal = Level.TimeSeconds;
}
}
if(totalamount > 0)
{
Player.ClientMessage("Healed"@count@"nearby player(s) for"@totalamount$"HP");
}
}
}
else if(TCDeathmatch(Player.DXGame) != None)
{
foreach RadiusActors(class'Actor', a, 256, Player.Location)
{
if(a.IsA('TCPlayer')) // TODO: Only heal teammates
{
target = TCPlayer(a);
if(target.PlayerReplicationInfo != None && target != player &&!target.PlayerReplicationInfo.bIsSpectator && target.Health > 0 && target.Health < 100 && (target.lastTeamHeal+1 <= Level.TimeSeconds) && AreAlliesBasic(target, Player))
{
targetList[count] = target;
count++;
if(count == 3) // We heal a maximum of 3 players
break;
}
}
}

if(count > 0)
{
healamount = Min(30, (45/count));
totalamount = healamount*count;
for(i = 0; i < count; i++)
{
if(targetList[i] != None)
{
targetList[i].HealPlayer(healamount, False);
targetList[i].ClientFlash(0.5, vect(0, 0, 500));
targetList[i].lastTeamHeal = Level.TimeSeconds;
}
}
if(totalamount > 0)
{
Player.ClientMessage("Healed"@count@"nearby player(s) for"@totalamount$"HP");
}
}
}

PerkTick


db += 1;

if(db % 100 == 0)
HealPlayers();




PerkNuke.uc (extends Perks)

PerkName="Death Nuke"
PerkShortName="Nuke"

PerkOff


PerkOwner.bNuke=False;

PerkOn


PerkOwner.bNuke=True;




PerkQuad.uc (extends Perks)

var int Count;
Count=30
PerkName="Quad Damage"
PerkShortName="quad"
bLock=True

PerkOff

PerkOn


SetTimer(1, True);

Timer


Count--;

if(Count <= 5)
PerkOwner.Notif("(Quad) "$Count$" seconds remaining.");

if(Count <= 0)
PerkOwner.RemovePerkbyName("Quad Damage");




PerkRepel.uc (extends Perks)

var int velz, CheckRadius;
CheckRadius=256
PerkName="Repulsion"
PerkShortName="Repel"

PerkTick


if(PerkOwner.HealthLegLeft <= 0)
{
Skullshot();
PerkOwner.ClientMessage("|P3Repulsion activated!");
PerkSleep(30);
}

Skullshot


local vector loc, vline, HitLocation, hitNormal, altloc;
local rotator altrot;
local Actor HitActor;
local actor a;
local ScriptedPawn hitPawn;
local PlayerPawn hitPlayer;
local DeusExMover hitMover;
local DeusExDecoration hitDecoration;
local TCPlayer Player;

Player = PerkOwner;
SpawnExplosion(PerkOwner.Location);
loc = Player.Location;
loc.Z -= 32;
foreach Player.VisibleActors(class'Actor', A, CheckRadius)
{
if (a != None && a != Player)
{
hitPawn = ScriptedPawn(a);
hitDecoration = DeusExDecoration(a);
hitPlayer = PlayerPawn(a);
hitMover = DeusExMover(a);
if (hitPawn != None)
{
hitPawn.SetPhysics(Phys_Falling);
hitPawn.Velocity = (normal(loc - hitPawn.Location) * velz);
//hitPawn.TakeDamage(Player.Energy, Player, hitLocation, normal(loc - hitPawn.Location) * velz, 'Exploded');
}
else if (hitDecoration != None)
{
hitDecoration.SetPhysics(Phys_Falling);
hitDecoration.Velocity = (normal(loc - hitDecoration.Location) * velz);
//hitDecoration.TakeDamage(Player.Energy, Player, hitLocation, normal(loc - hitDecoration.Location) * velz, 'Exploded');
}
else if (hitPlayer != None)
{
hitPlayer.SetPhysics(Phys_Falling);
hitPlayer.Velocity = (normal(loc - hitPlayer.Location) * velz);
//hitPlayer.TakeDamage(Player.Energy / 3, Player, hitLocation, normal(loc - hitPlayer.Location) * velz, 'Exploded');
}
if (hitMover != None)
{
hitMover.bDrawExplosion = True;
// hitMover.TakeDamage(Player.Energy * 3, Player, hitLocation,normal(loc - hitMover.Location) * velz, 'Exploded');
}
}
}

SpawnExplosion (vector Loc)


local ShockRing s1, s2, s3;
local SphereEffect se;


s1 = spawn(class'ShockRing',,,Loc,rot(16384,0,0));
s1.Lifespan = 5.5;
s2 = spawn(class'ShockRing',,,Loc,rot(0,16384,0));
s2.Lifespan = 5.5;
s3 = spawn(class'ShockRing',,,Loc,rot(0,0,16384));
S3.Lifespan = 5.5;
se = spawn(class'SphereEffect',,,Loc,rot(16384,0,0));
se.Lifespan = 5.5;
se.MultiSkins[0]=Texture'DeusExDeco.Skins.AlarmLightTex7';




PerkSpy.uc (extends Perks)

PerkName="Spy"

PerkOff


TCPRI(PerkOwner.PlayerReplicationInfo).bSpy = False;

PerkOn


TCPRI(PerkOwner.PlayerReplicationInfo).bSpy = True;




PerkTakedown.uc (extends Perks)

PerkName="Takedown"



Perks.uc (extends Actor)

var TCPlayer PerkOwner; //The player
var string PerkName; //Its name
var string PerkShortName; //For when the normal name is too long, make detection easier by using a smaller identifier
var bool bLock; //Can the /perk command disable it
var bool bOn; //Master on switch, will function if on unless sleep
var bool bSleep; //Disables the tick while staying on
bHidden=True

PostBeginPlay


if(PerkShortName == "")
PerkShortName = PerkName;

Timer


if(PerkOwner != None && bSleep)
{
PerkOwner.ClientMessage("|P2"$PerkName$" has been recharged...");
bSleep=False;
}




Playground.uc (extends TCDeathmatch)




PraxisBallistic.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugBallistic'
ItemName="Praxis Kit (Aug Ballistic)"



PraxisCloak.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugCloak'
ItemName="Praxis Kit (Aug Cloak)"



PraxisCombat.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugCombat'
ItemName="Praxis Kit (Aug Combat)"



PraxisDefense.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugDefense'
ItemName="Praxis Kit (Aug Defense)"



PraxisDrone.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugDrone'
ItemName="Praxis Kit (Aug Drone)"



PraxisEMP.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugEMP'
ItemName="Praxis Kit (Aug EMP)"



PraxisEnviro.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugEnviro'
ItemName="Praxis Kit (Aug Enviro)"



PraxisHealing.uc (extends PraxisKit)

PraxisAug=class'OpenDX.AugHealing2'
ItemName="Praxis Kit (Aug Modified Healing)"



PraxisHeroHealth.uc (extends PraxisKit)

PraxisPerk="PerkHero"
ItemName="Praxis Kit (Perk Hero Health)"



PraxisIcarus.uc (extends PraxisKit)

PraxisAug=class'OpenDX.AugIcarus'
ItemName="Praxis Kit (Aug Icarus Landing)"



PraxisIcarusPerk.uc (extends PraxisKit)

PraxisPerk="PerkIcarus"
ItemName="Praxis Kit (Perk Icarus Landing)"



PraxisKillswitch.uc (extends PraxisKit)

bResetAugSystem=True
bResetPerks=True
ItemName="Praxis Kit (Total Killswitch - REMOVES ALL PERKS AND AUGS)"



PraxisKit.uc (extends DeusExPickup)

var() bool bResetAugSystem, bResetPerks;
var() class PraxisAug;
var() string PraxisPerk;
maxCopies=1
bCanHaveMultipleCopies=True
bActivatable=True
ItemName="Praxis Kit"
M_Activated=""
ItemArticle="a"
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'AugIconDatalink_Small'
largeIcon=Texture'AugIconDatalink'
largeIconWidth=39
largeIconHeight=46
MultiSkins(0)=Texture'PraxisTex1'
Description="Contained the nano-data for augmentations."
beltDescription="PRAXIS"
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;
local bool bUseUp;
local int i;


Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
{
if(bResetAugSystem)
{
if (Player.AugmentationSystem != None)
{
Player.AugmentationSystem.DeactivateAll();
Player.AugmentationSystem.ResetAugmentations();
Player.AugmentationSystem.Destroy();
Player.AugmentationSystem = None;
Player.ClientMessage("|P2Removing augmentations...");
}

if (Player.AugmentationSystem == None)
{
Player.AugmentationSystem = Spawn(class'TCAugmentationManager', Player);
Player.AugmentationSystem.CreateAugmentations(Player);
Player.AugmentationSystem.AddDefaultAugmentations();
Player.AugmentationSystem.SetOwner(Player);
}
}

if(bResetPerks)
{
Player.ClientMessage("|P2Resetting perks...");
for(i=0;i<10;i++)
TCPlayer(Player).RemovePerk(i);
bUseUp=True;
}

if(PraxisAug != None)
{
bUseUp=True;
player.AugmentationSystem.GivePlayerAugmentation(PraxisAug);
player.AugmentationSystem.GivePlayerAugmentation(PraxisAug);
}

if(PraxisPerk != "")
{
TCPlayer(Player).GetPerk(PraxisPerk);
bUseUp=True;
}
}

if(bUseUp)
UseOnce();




PraxisMagnet.uc (extends PraxisKit)

PraxisAug=class'OpenDX.AugMagnet'
ItemName="Praxis Kit (Aug Magnet)"



PraxisMediAura.uc (extends PraxisKit)

PraxisAug=class'OpenDX.AugMediAura'
ItemName="Praxis Kit (Aug Medical Aura)"



PraxisMediAuraPerk.uc (extends PraxisKit)

PraxisPerk="PerkMediAura"
ItemName="Praxis Kit (Perk Medical Aura)"



PraxisMuscle.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugMuscle'
ItemName="Praxis Kit (Aug Muscle)"



PraxisNuke.uc (extends PraxisKit)

PraxisPerk="PerkNuke"
ItemName="Praxis Kit (Perk Nuke)"



PraxisRadar.uc (extends PraxisKit)

PraxisAug=class'OpenDX.AugRadar';
ItemName="Praxis Kit (Aug Radar)"



PraxisRadarTrans.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugRadarTrans'
ItemName="Praxis Kit (Aug RadarTrans)"



PraxisRepel.uc (extends PraxisKit)

PraxisAug=class'OpenDX.AugRepel'
ItemName="Praxis Kit (Aug Repulsion)"



PraxisShield.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugShield'
ItemName="Praxis Kit (Aug Shield)"



PraxisSkullgun.uc (extends PraxisKit)

PraxisAug=class'OpenDX.AugSkullgun'
ItemName="Praxis Kit (Aug Skullgun)"



PraxisSpeed.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugSpeed'
ItemName="Praxis Kit (Aug Speed)"



PraxisSpy.uc (extends PraxisKit)

PraxisPerk="PerkSpy"
ItemName="Praxis Kit (Perk Spy)"



PraxisStealth.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugStealth'
ItemName="Praxis Kit (Aug Stealth)"



PraxisTakedown.uc (extends PraxisKit)

PraxisAug=class'AugTakedown'
ItemName="Praxis Kit (Aug Takedown)"



PraxisTarget.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugTarget'
ItemName="Praxis Kit (Aug Target)"



PraxisVision.uc (extends PraxisKit)

PraxisAug=class'DeusEx.AugVision'
ItemName="Praxis Kit (Aug Vision)"



SSTimer.uc (extends Actor)

var Sharpshooter myGame;
var int SSCount, SSDefaultCount;
bHidden=true

Timer


local TCPlayer TCP;


SSCount--;
if(SSCount == 5)
{
foreach AllActors(class'TCPlayer', TCP)
TCP.Notif("Five seconds remaining.");
}
if(SSCount <= 0)
{
foreach AllActors(class'TCPlayer', TCP)
TCP.Notif("New round!");
SSCount = SSDefaultCount;
myGame.RollItems();
}




Sharpshooter.uc (extends TCDeathmatch)

var int SSCount, SSDefaultCount;
VictoryConString1="|P1Hit the score limit! (|P3 "
VictoryConString2=" |P1) -|P2 (Weapons randomized through the match)"
TimeLimitString1="|P1Score the most! (|P3 "
TimeLimitString2=" |P1) -|P2 (Weapons randomized through the match)"
GTName="Sharpshooter (WIP)"

PostBeginPlay


local DeusExWeapon w;
local int r;
local SSTimer SST;


super.PostBeginPlay();


Log(Settings.SSRoundDelay$" round timer.");
SST = Spawn(class'SSTimer');
SST.SetTimer(1,true);
SST.SSCount = Settings.SSRoundDelay;
SST.SSDefaultCount = Settings.SSRoundDelay;
SST.myGame = Self;
Foreach AllActors(class'DeusExWeapon',w)
{
w.Destroy();
}

RemovePlayerInventory (DeusExPlayer Player)


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));
}

RollItems


local TCPlayer TCP;
local class GiveClass;
local int Passes, r;


foreach AllActors(class'TCPlayer', TCP)
{
if(Settings.bHealTimer)
TCP.HealPlayer(15, True);

RemovePlayerInventory(TCP);
while(Passes < 3)
{
if(Passes == 0) r = RandRange(0,10);
if(Passes == 1) r = RandRange(11, 20);
if(Passes == 2) r = RandRange(21,29);
Passes++;

GiveClass = class( DynamicLoadObject( Settings.SSWeapons[r], class'Class' ) );
if( GiveClass!=None )
SilentAdd(GiveClass, TCP);
else
Log("Error in TCControls.SSWeapons array: "$r$" slot could not be spawned.");
}
Passes = 0;
}

SilentAdd (class addClass, DeusExPlayer addTarget)


local Inventory anItem;


if(Settings.bMethodOne)
{
anItem = Spawn(addClass,,,addTarget.Location);
anItem.SpawnCopy(addTarget);
anItem.Destroy();
}
else
{
anItem.Instigator = addTarget;
anItem.GotoState('Idle2');
anItem.bHeldItem = true;
anItem.bTossedOut = false;

if(Weapon(anItem) != None)
Weapon(anItem).GiveAmmo(addTarget);
anItem.GiveTo(addTarget);
}




TCAugmentationDisplayWindow.uc (extends CBPAugmentationDisplayWindow)

var Color colYellow, colPurple;
var Color colBlue1, colWhite;
var Color colGreen1, colLtGreen;
var Color colRed1, colLtRed;
var string keyFreeMode, keyPersonView, keyMainMenu, keySkills;
colWhite=(R=255,G=255,B=255)
colYellow=(R=255,G=255,B=0)
colPurple=(R=128,G=0,B=128)

DrawPlayerName (GC gc, float x, float y, bool sameteam, string pname)


local float w, h;


gc.SetFont(Font'FontMenuSmall');
gc.SetStyle(DSTY_Translucent);
if (sameteam) gc.SetTextColor(colGreen);
else gc.SetTextColor(colRed);
gc.GetTextExtent(0, w, h, pname);
x -= w * 0.5;
y -= h * 0.5;
gc.DrawText(x, y, w, h, pname);
gc.SetStyle(DSTY_Normal);

DrawRemoteInventory (GC gc, TCPlayer mmp)


local int xoff, yoff, ytoff, i;


yoff = height - 48;
ytoff = yoff + 32;
xoff = width - 54;

gc.SetStyle(DSTY_Masked);
gc.SetTileColorRGB(255, 255, 255);

gc.SetAlignments(HALIGN_Center, VALIGN_Center);
gc.EnableWordWrap(false);
gc.SetTextColorRGB(255, 255, 255);
gc.SetFont(Font'FontTiny');

// draw biocells
if (mmp.TargetBioCells > 0)
{
gc.DrawTexture(xoff, yoff, 42, 37, 0, 0, Texture'DeusExUI.Icons.BeltIconBioCell');
gc.DrawText(xoff + 1, ytoff, 42, 8, "COUNT:" @ mmp.TargetBioCells);
}
xoff -= 48;
// draw medkit
if (mmp.TargetMedkits > 0)
{
gc.DrawTexture(xoff, yoff, 42, 37, 0, 0, Texture'DeusExUI.Icons.BeltIconMedKit');
gc.DrawText(xoff + 1, ytoff, 42, 8, "COUNT:" @ mmp.TargetMedkits);
}
xoff -= 48;
// draw multitool
if (mmp.TargetMultitools > 0)
{
gc.DrawTexture(xoff, yoff, 42, 37, 0, 0, Texture'DeusExUI.Icons.BeltIconMultitool');
gc.DrawText(xoff + 1, ytoff, 42, 8, "COUNT:" @ mmp.TargetMultitools);
}
xoff -= 48;
// draw lockpick
if (mmp.TargetLockpicks > 0)
{
gc.DrawTexture(xoff, yoff, 42, 37, 0, 0, Texture'DeusExUI.Icons.BeltIconLockPick');
gc.DrawText(xoff + 1, ytoff, 42, 8, "COUNT:" @ mmp.TargetLockpicks);
}
xoff -= 48;
// draw lam
if (mmp.TargetLAMs > 0)
{
gc.DrawTexture(xoff, yoff, 42, 37, 0, 0, Texture'DeusExUI.Icons.BeltIconLAM');
gc.DrawText(xoff + 1, ytoff, 42, 8, "COUNT:" @ mmp.TargetLAMs);
}

xoff = 16;

// draw weapons
for (i = 0; i < 3; i++)
{
if (mmp.TargetWeapons[i] != none)
{
gc.DrawTexture(xoff, yoff, 42, 37, 0, 0, mmp.TargetWeapons[i].default.Icon);
}
xoff += 48;
}

// draw emp
if (mmp.TargetEMPs > 0)
{
gc.DrawTexture(xoff, yoff, 42, 37, 0, 0, Texture'DeusExUI.Icons.BeltIconEMPGrenade');
gc.DrawText(xoff + 1, ytoff, 42, 8, "COUNT:" @ mmp.TargetEMPs);
}
xoff += 48;
// draw gas
if (mmp.TargetGGs > 0)
{
gc.DrawTexture(xoff, yoff, 42, 37, 0, 0, Texture'DeusExUI.Icons.BeltIconGasGrenade');
gc.DrawText(xoff + 1, ytoff, 42, 8, "COUNT:" @ mmp.TargetGGs);
}

DrawStaticText (GC gc, string text, float y_ratio, color col, bool big)


local float x, y, w, h;


if (big) gc.SetFont(Font'FontMenuTitle');
else gc.SetFont(Font'FontMenuSmall');
gc.SetStyle(DSTY_Translucent);
gc.SetTextColor(col);
gc.GetTextExtent(0, w, h, text);
x = (width * 0.5) - (w * 0.5);
y = height * y_ratio;
gc.DrawText(x, y, w, h, text);
gc.SetStyle(DSTY_Normal);

FacingActor (Pawn A, Pawn B) -> float


local vector X,Y,Z, Dir;


if (B == None || A == None) return -1.0;
GetAxes(B.ViewRotation, X, Y, Z);
Dir = A.Location - B.Location;
X.Z = 0;
Dir.Z = 0;
return Normal(Dir) dot Normal(X);

GetAllies (TCPlayer POne, TCPlayer PTwo) -> bool


if(TCDeathmatch(player.DXGame) != None)
return TCDeathmatch(player.DXGame).ArePlayersAllied2(POne,PTwo);

if(TCTeam(player.DXGame) != None)
return TCTeam(player.DXGame).ArePlayersAllied(POne,PTwo);

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;
local TCControls TCC;
local string str;
local TCStorageBox TCS;
local string teamstr;
local TCPRI plPRI, tPRI;
local TCPlayer tcTarg, tcSelf;
local ScriptedPawn sPawn;


bDM = (TCDeathmatch(player.DXGame) != None);
bTeamDM = (TCTeam(player.DXGame) != None);
tcSelf = GetPlayer();
if(tcSelf != None)
plPRI = TCPRI(tcSelf.PlayerReplicationInfo);
sPawn = ScriptedPawn(Target);

if(plPRI == None) // tcSelf == none is implicit if this is true.
{
xColor = colWhite;
return;
}

if ( sPawn != None )
{
if(tcSelf.HUDTYpe == HUD_Extended) //Shows all info
{
targetPlayerName = sPawn.FamiliarName$" ("$Left(VSize(target.Location - Player.Location), Len(VSize(target.Location - Player.Location))-7)$")";
xcolor = colYellow;
}
else if(tcSelf.HUDTYpe == HUD_Basic) //Shows basic info
{
targetPlayerName = sPawn.FamiliarName;
xcolor = colYellow;
}
else if(tcSelf.HUDTYpe == HUD_Unified) //Masks bots as players
{
targetPlayerName = sPawn.FamiliarName;
xcolor = colRed;
}
else if(tcSelf.HUDTYpe == HUD_Original) //As original DX, bots are friendlies, no name display
{
targetPlayerName = "";
xcolor = colGreen;
}
else if(tcSelf.HUDTYpe == HUD_Off)
targetPlayerName = "";

targetPlayerTime = Player.Level.Timeseconds + targetPlayerDelay;
targetPlayerColor = xcolor;
}
else if ( Player.Level.NetMode != NM_Standalone ) // Only do the rest in multiplayer
{
if ( target.IsA('TCStorageBox') )
{
TCS = TCStorageBox(Target);
if (bTeamDM)
{
if(GetAllies(TCPlayer(TCS.Owner),tcSelf) || tcSelf == TCS.Owner)
xcolor = colGreen;
else
xcolor = colRed;

if(TCS.myName != "")
str = TCS.myName;
else str = TCS.OwnerName$"'s storage";
targetPlayerName = str;
targetPlayerTime = Player.Level.Timeseconds + targetPlayerDelay;
targetPlayerColor = xcolor;
}
else if(bDM)
{
if(GetAllies(TCPlayer(TCS.Owner),tcSelf) || tcSelf == TCS.Owner)
xcolor = colGreen;
else
xcolor = colRed;

if(TCS.myName != "")
str = TCS.myName;
else str = TCS.OwnerName$"'s storage";
targetPlayerName = str;
targetPlayerTime = Player.Level.Timeseconds + targetPlayerDelay;
targetPlayerColor = xcolor;
}
}
else if ( target.IsA('DeusExPlayer') && (target != player) ) // Other players IFF
{
tcTarg = TCPlayer(Target);
if(tcTarg != none)
tPRI = TCPRI(tcTarg.PlayerReplicationInfo);

if(tPRI != None)
{
if (bTeamDM)
{
str = tPRI.PlayerName;

if(tPRI.bSpy || GetAllies(tcTarg,tcSelf))
{
TargetPlayerHealthString = " (" $ 100 * (tcTarg.Health / tcTarg.Default.Health) $ "%)";
xcolor = colGreen;
}
else
xcolor = colRed;

targetPlayerName = str;
}
else if(bDM && target.Style != STY_Translucent) //Kaiz0r - Adding DM Stuff here
{
if(tcSelf.HUDTYpe == HUD_Extended) //Shows all info
{
if(plPRI.TeamNamePRI == "") //If not in team
xcolor = colPurple;

if(plPRI.TeamNamePRI != "") //if WE are in a team
{
if(tPRI.bSpy || GetAllies(tcTarg,tcSelf))
{
TargetPlayerHealthString = " (" $ 100 * (tcTarg.Health / tcTarg.Default.Health) $ "%)";
xcolor = colGreen;
}
else
xcolor = colRed;
}

str = tPRI.PlayerName;

str = str$" ("$Left(VSize(target.Location - Player.Location), Len(VSize(target.Location - Player.Location))-7)$")";

if(tPRI.TeamNamePRI != "")
str = str$" |C616200#|P7"$tPRI.TeamNamePRI;

targetPlayerName = str;
}

if(tcSelf.HUDTYpe == HUD_Basic) //Shows basic info
{
if(tPRI.TeamNamePRI == "")//If not in team
xcolor = colPurple;

if(tPRI.TeamNamePRI != "") //if WE are in a team
{
if(GetAllies(tcTarg,tcSelf))
{
TargetPlayerHealthString = " (" $ 100 * (tcTarg.Health / tcTarg.Default.Health) $ "%)";
xcolor = colGreen;
}
else
xcolor = colRed;
}

str = tPRI.PlayerName;

if(tPRI.TeamNamePRI != "")
str = str$" |C616200#|P7"$TCPRI(TCPlayer(Target).PlayerReplicationInfo).TeamNamePRI;

targetPlayerName = str;
}

if(tcSelf.HUDTYpe == HUD_Unified || tcSelf.HUDTYpe == HUD_Original)
{
targetPlayerName = tPRI.PlayerName;
xcolor = colRed;
}

if(tcSelf.HUDTYpe == HUD_Off)
{
targetPlayerName = "";
}

targetPlayerTime = Player.Level.Timeseconds + targetPlayerDelay;
targetPlayerColor = xcolor;
}

SightDist = VSize(target.Location - Player.Location);
// This was one of the errors - the brackets prioritised the TeamDMGame cast over the bTeamDM check.
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 = "(" $ 100 * (tcTarg.Health / tcTarg.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 ( (GetAllies(TCPlayer(target.Owner),tcSelf)) ||
(player == TCPlayer(target.Owner)) )
xcolor = colGreen;
else
xcolor = colRed;
}
else if ( target.IsA('TCAutoTurret') || 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;
teamstr = TCPRI(TCPlayer(TCAutoTurret(target).safeTarget).PlayerReplicationInfo).TeamNamePRI;
}
if ( (TCDeathmatch(player.dxgame) != none && team == plPRI.playerid) || TCTeam(player.dxgame) != none && team == plPRI.team)
xcolor = colGreen;
else if (team == -1)
xcolor = colWhite;
else
xcolor = colRed;

targetPlayerName = titleString$teamstr;
targetOutOfRange = False;
targetPlayerTime = Player.Level.Timeseconds + targetPlayerDelay;
targetPlayerColor = xcolor;
}
else if ( target.IsA('ComputerSecurity'))
{
if ( ComputerSecurity(target).team == -1 )
xcolor = colWhite;
else if ( (bTeamDM && GetAllies(TCPlayer(target.Owner), tcSelf)) ||
(!bTeamDM && (player.PlayerReplicationInfo.PlayerID == team ||
GetAllies(TCPlayer(target.Owner), tcSelf))) )
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 && GetAllies(TCPlayer(target.Owner), tcSelf)) ||
(!bTeamDM && (player.PlayerReplicationInfo.PlayerID == team ||
GetAllies(TCPlayer(target.Owner), tcSelf))) )
xcolor = colGreen;
else
xcolor = colRed;
}
}

IsHeatSource (Actor A) -> bool


if(A.IsA('ODXHiddenActor')) //Check this first, so it doesnt reach the "Hidden" check below
return True;

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;

NameAllViewedPlayers (GC gc, TCPlayer mmp)


local Actor target;
local TCPlayer P;
local float x, y;
local vector loc;
local bool viewenemy;


foreach mmp.VisibleCollidingActors(class'Actor', target, 3000.0, mmp.Location, false)
{
if (target.IsA('TCPlayer') && (FacingActor(Pawn(target), mmp) > 0.0))
{
P = TCPlayer(target);
if (P.PlayerReplicationInfo.bIsSpectator || (!mmp.bSpecEnemies && P.PlayerReplicationInfo.Team != mmp.PlayerReplicationInfo.Team)) continue;
loc = P.Location;
loc.Z -= P.CollisionHeight + 10.0;
ConvertVectorToCoordinates(loc, x, y);
DrawPlayerName(gc, x, y, (mmp.PlayerReplicationInfo.Team == P.PlayerReplicationInfo.Team) && mmp.GameReplicationInfo.bTeamGame, P.PlayerReplicationInfo.PlayerName);
}
}

PostDrawWindow (GC gc)


local PlayerPawn pp;
local TCPlayer mmp;
local color col;
local string str;
local color colGold;
local int tmpVisionLevel, tmpVisionLevelValue;
local int VotePoints, mVP;
local float xx;
local actor wpTarget;
local float infoX, infoY, infoW, infoH;
local string strInfo;
local int dist;
local float offset;
local vector centerLoc;
local float centerX, centerY;
local float markX, markY, markW, markH;
local string markInfo;
local TCPRI tPRI;


pp = Player.GetPlayerPawn();
if(TCPlayer(pp) != None)
mmp = TCPlayer(pp);
colGold.R = 255;
colGold.G = 255;

if(TCPRI(mmp.PlayerReplicationInfo) != None)
tPRI = TCPRI(mmp.PlayerReplicationInfo);

if(tPRI == None)
return;

//BEGIN WP
if(tPRI.wpTargetPRI != None)
wpTarget = tPRI.wpTargetPRI;

if (wpTarget != None)
{
centerLoc = wpTarget.Location;

if (ConvertVectorToCoordinates(centerLoc, centerX, centerY))
{
// convert to meters
dist = int(vsize(mmp.Location-wpTarget.Location)/52);

if(tPRI.wpName != "")
strInfo = tPRI.wpName $ " (" $ dist $ "m)";
else
strInfo = wpTarget.Tag $ " (" $ dist $ "m)";

gc.SetFont(Font'FontMenuHeaders_DS');
gc.GetTextExtent(0, infoW, infoH, strInfo);

infoX = centerX - 0.5*(infoW+12);
infoY = centerY - 0.5*(infoH+10);

offset = 0.5*(infoW+12+32);
if (centerX >= 0.5*width)
{
if (centerX < width-infoW-12-32-16)
infoX += offset;
else
infoX -= offset;
}
else
{
if (centerX > infoW+12+32+16)
infoX -= offset;
else
infoX += offset;
}

infoX = FClamp(infoX, 32, width-infoW-12-32);
infoY = FClamp(infoY, 16, height-infoH-10-72);
}

// draw a dark background
gc.SetStyle(DSTY_Modulated);
gc.SetTileColorRGB(0, 0, 0);
gc.DrawPattern(infoX, infoY, infoW+12, infoH+10, 0, 0, Texture'ConWindowBackground');

// draw the text
gc.SetTextColor(colText);
gc.DrawText(infoX+6, infoY+6, infoW, infoH, strInfo);

// draw the two highlight boxes
gc.SetStyle(DSTY_Translucent);
gc.SetTileColor(colBorder);
gc.DrawBox(infoX, infoY, infoW+12, infoH+10, 0, 0, 1, Texture'Solid');
gc.SetTileColor(colBackground);
gc.DrawBox(infoX+1, infoY+1, infoW+10, infoH+8, 0, 0, 1, Texture'Solid');

//draw waypoint X mark
markInfo = "X";
gc.SetFont(Font'FontMenuHeaders_DS');
gc.GetTextExtent(0, markW, markH, markInfo);
markX = centerX-0.5*markW;
markY = centerY-0.5*markH;
markX = FClamp(markX, 16-0.5*markW, width-16-0.5*markW);
markY = FClamp(infoY, 16, height-infoH-10-72);
gc.SetTextColor(colText);
gc.DrawText(markX, markY+6, markW, markH, markInfo);
}
//ENDWP

if (!tPRI.bIsSpectator)
{
//if (mmp.GetControls().bNameDisplay)
// NameAllViewedPlayers(gc, mmp);

Super.PostDrawWindow(gc);
//Super(AugmentationDisplayWindow).PostDrawWindow(gc);
}
else
{
if (mmp.FreeSpecMode)
{
NameAllViewedPlayers(gc, mmp);
DrawStaticText(gc, " < Free spectating >", 0.73, colGold, false);
DrawStaticText(gc, "Press <" $ keySkills $ "> to spectate players.", 0.75, colGold, false);
}
else if (mmp.ViewTarget != none)
{
if (PlayerPawn(mmp.ViewTarget).PlayerReplicationInfo.Team != mmp.PlayerReplicationInfo.Team ||
!mmp.GameReplicationInfo.bTeamGame) col = colRed;
else col = colGreen;
str = "Viewing " $ PlayerPawn(mmp.ViewTarget).PlayerReplicationInfo.PlayerName;

DrawStaticText(gc, str, 0.65, col, true);
DrawStaticText(gc, "<- LMB RMB ->", 0.69, colGold, false);
if (!mmp.bBehindView)
{
//DrawRemotePlayerSkills(gc, mmp);
DrawRemoteInventory(gc, mmp);
}
DrawStaticText(gc, "Press <" $ keySkills $ "> to go into free spectator mode.", 0.75, colGold, false);
}

if(!mmp.bNoRespawn)
DrawStaticText(gc, "Press <" $ keyMainMenu $ "> or enter chat command /spec to start playing.", 0.77, colGold, false);

gc.SetFont(Font'FontMenuSmall_DS');
gc.SetTextColor(colHeaderText);
gc.SetStyle(DSTY_Normal);
gc.SetTileColor(colBorder);
if (mmp.bShowScores)
{
if (DeathMatchGame(mmp.DXGame) != None)
DeathMatchGame(mmp.DXGame).ShowDMScoreboard(mmp, gc, width, height);
else if (TeamDMGame(mmp.DXGame) != None)
TeamDMGame(mmp.DXGame).ShowTeamDMScoreboard(mmp, 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;
else if ( Alias ~= "ShowInventoryWindow" )
keyFreeMode = keyName;
else if ( Alias ~= "ShowGoalsWindow" )
keyPersonView = keyName;
else if ( Alias ~= "ShowMainMenu" )
keyMainMenu = keyName;
else if ( Alias ~= "BuySkills" )
keySkills = KeyName;
}
}
if ( keyDropItem ~= "" )
keyDropItem = KeyNotBoundString;
if ( keyTalk ~= "" )
keyTalk = KeyNotBoundString;
if ( keyTeamTalk ~= "" )
keyTeamTalk = KeyNotBoundString;
if ( keyFreeMode ~= "" )
keyFreeMode = KeyNotBoundString;
if ( keyPersonView ~= "" )
keyPersonView = KeyNotBoundString;
if ( keyMainMenu ~= "" )
keyMainMenu = KeyNotBoundString;
if ( keySkills ~= "" )
keySkills = KeyNotBoundString;

getPlayer -> TCPlayer


return TCPlayer(player);




TCAugmentationManager.uc (extends CBPAugmentationManager)

var Class augClassesODX[45]; //we need MOAR AUGS - Upped from 25 to 31, maybe more than needed..
augClassesODX(0)=Class'DeusEx.AugSpeed'
augClassesODX(1)=Class'DeusEx.AugTarget'
augClassesODX(2)=Class'DeusEx.AugCloak'
augClassesODX(3)=Class'DeusEx.AugBallistic'
augClassesODX(4)=Class'DeusEx.AugRadarTrans'
augClassesODX(5)=Class'DeusEx.AugShield'
augClassesODX(6)=Class'DeusEx.AugEnviro'
augClassesODX(7)=Class'DeusEx.AugEMP'
augClassesODX(8)=Class'DeusEx.AugCombat'
augClassesODX(9)=Class'OpenDX.AugHealing2'
augClassesODX(10)=Class'DeusEx.AugStealth'
augClassesODX(11)=Class'DeusEx.AugIFF'
augClassesODX(12)=Class'CBPAugLight'
augClassesODX(13)=Class'DeusEx.AugMuscle'
augClassesODX(14)=Class'DeusEx.AugVision'
augClassesODX(15)=Class'DeusEx.AugDrone'
augClassesODX(16)=Class'DeusEx.AugDefense'
augClassesODX(17)=Class'DeusEx.AugAqualung'
augClassesODX(18)=Class'DeusEx.AugDatalink'
augClassesODX(19)=Class'DeusEx.AugHeartLung'
augClassesODX(20)=Class'DeusEx.AugPower'
augClassesODX(21)=Class'OpenDX.AugSkullgun'
augClassesODX(22)=Class'OpenDX.AugIcarus'
augClassesODX(23)=Class'OpenDX.AugNuke'
augClassesODX(24)=Class'OpenDX.AugRepel'
augClassesODX(25)=Class'OpenDX.AugMediAura'
augClassesODX(26)=Class'OpenDX.AugFlight'
augClassesODX(27)=Class'OpenDX.AugRadar'
augClassesODX(28)=Class'OpenDX.AugTakedown'
augClassesODX(29)=Class'OpenDX.AugMagnet'

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(augClassesODX[augIndex]);
}

CreateAugmentations (DeusExPlayer newPlayer)


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


FirstAug = None;
LastAug = None;

player = newPlayer;

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

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

LastAug = anAug;
}
}
}

FindAugmentation (Class findClass) -> Augmentation


local Augmentation anAug, currentAug;


anAug = FirstAug;
while(anAug != None)
{
currentAug = anAug;

if(currentAug.Owner != None && currentAug.Owner.isA('Augmentation'))
currentAug = Augmentation(currentAug.Owner);

if(currentAug.Class == findClass)
{
anAug = currentAug;
break;
}

anAug = anAug.next;
}

return anAug;

GetClassLevel (class augClass) -> int


if(Player != None && Player.PlayerReplicationInfo != None)
if(Player.IsInState('Spectating'))
if(augClass == Class'DeusEx.AugRadarTrans')
return 3;

return Super.GetClassLevel(augClass);




TCAutoTurret.uc (extends AutoTurret)

var bool bDisb;
var() int TurretHealth;
var string TeamString;
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() float Thick;
var() float PawnThick;
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;
TurretHealth=100
titleString="AutoTurret"
bTrackPlayersOnly=True
bActive=True
maxRange=512
fireRate=0.25
gunAccuracy=0.50
gunDamage=5
AmmoAmount=1000
confusionDuration=120.00
pitchLimit=11000.00
Team=500
mpTurretDamage=20
mpTurretRange=1024
HitPoints=100
minDamageThreshold=100
bHighlight=False
ItemName="Turret Base"
bPushable=False
Physics=0
Mesh=LodMesh'DeusExDeco.AutoTurretBase'
SoundRadius=48
SoundVolume=192
AmbientSound=Sound'DeusExSounds.Generic.AutoTurretHum'
CollisionRadius=14.00
CollisionHeight=20.20
Mass=50.00
Buoyancy=10.00
bVisionImportant=True

AcquireMultiplayerTarget -> Actor


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


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

apawn = gun.Level.PawnList;

while ( apawn != None )
{
//if (apawn.bDetectable && !apawn.bIgnore && apawn.IsA('DeusExPlayer'))
if (apawn.bDetectable && !apawn.bIgnore)
{
aplayer = DeusExPlayer(apawn);

dist = apawn.Location - gun.Location; //apawn was aplayer

if ( VSize(dist) < maxRange )
{
// Only players we can see
if ( apawn.FastTrace( apawn.Location, gun.Location ))//apawn was aplayer
{
if(!PSOwners(apawn))
{
if(curTarget == None)
{

curTarget = apawn;
break;
}
}
}
}
}
apawn = apawn.nextPawn;
}
return curtarget;

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;

PSOwners (Pawn P) -> bool


if(DeusExPlayer(P) != None)
{
if(P == safeTarget || P == Owner)
return True;

if(TCDeathmatch(level.game) != None)
if(TCPRI(TCPlayer(Owner).PlayerReplicationInfo).TeamNamePRI != "" && TCPRI(TCPlayer(P).PlayerReplicationInfo).TeamNamePRI != "")
if(TCPRI(TCPlayer(Owner).PlayerReplicationInfo).TeamNamePRI == TCPRI(TCPlayer(P).PlayerReplicationInfo).TeamNamePRI)
return true;

if(TCDeathmatch(level.game) != None)
if(TeamString != "" && TCPRI(TCPlayer(P).PlayerReplicationInfo).TeamNamePRI != "")
if(TeamString == TCPRI(TCPlayer(P).PlayerReplicationInfo).TeamNamePRI)
return true;

if(TCTeam(level.game) != None && TCPlayer(P).PlayerReplicationInfo.Team == TCPlayer(safeTarget).PlayerReplicationInfo.Team)
return true;
}

return False;

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.bHackable=False;
gun.SetLocation(v2);
gun.SetBase(Self);
}

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

maxRange = mpTurretRange;
gunDamage = mpTurretDamage;
bDisabled = !bActive;

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 Human dxp;
local float mindmg;


if (DamageType == 'EMP')
{
return; //Nulled function, IMMUNE TO EMP.
}

TurretHealth -= Damage; //Edited this in to avoid some things.

if(bDisb == False)
{
if(TurretHealth <= 0)
{
return;
}
}

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;
}

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

if ( !bConfused )
{
if (TargetRefreshTime < 0)
TargetRefreshTime = 0;

TargetRefreshTime = TargetRefreshTime + deltaTime;

if (TargetRefreshTime >= 0.3)
{
TargetRefreshTime = 0;
curTarget = AcquireMultiplayerTarget();

// if ( curTarget == None )
// PlaySound(Sound'TurretUnlocked', SLOT_Interact, 1.0,, maxRange );
// prevtarget = curtarget;
}

foreach gun.VisibleActors(class'Pawn', pawn, maxRange, gun.Location)
{
if (pawn.bDetectable && !pawn.bIgnore)
{
if(curTarget == None)
{
if(!PSOwners(Pawn))
{
curTarget = Pawn;
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;

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;
}
}




TCComputerSecurity.uc (extends Computersecurity)

var() localized string titleString;
var() name cameraTag;
var() name turretTag;
var() name doorTag;
var() localized sViewInfo Views[3];
var int team;
var string TeamName;
TeamName=""
Team=-1
Physics=PHYS_None
terminalType=Class'NetworkTerminalSecurity'
lockoutDelay=120.00
UserList=(accountNumber="SECURITY",PIN="SECURITY",balance=1918989824),
ItemName="Security Computer Terminal"
Physics=0
Mesh=LodMesh'DeusExDeco.ComputerSecurity'
SoundRadius=8
SoundVolume=255
SoundPitch=96
AmbientSound=Sound'DeusExSounds.Generic.SecurityL'
CollisionRadius=11.59
CollisionHeight=10.10
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 TCAutoTurret 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'TCAutoTurret', turret, tag)
{
if(TCDeathmatch(level.game) != None)
turret.teamstring = TCPRI(PlayerWhoOwns.PlayerReplicationInfo).TeamNamePRI;
turret.SetOwner(PlayerWhoOwns);
}

tag = Views[cameraIndex].doorTag;
if (tag != '')
foreach AllActors(class'DeusExMover', door, tag)
door.SetOwner(PlayerWhoOwns);

}





TCControls.uc (extends Actor)

var config bool bFixMovers;
var config bool bChatCommands;
var config bool bSpawnReplacer;
var config string SummonPassword;
var config string ModPassword;
var config string SuperAdminPassword;
var config string _OwnerPassword;
var config bool bAllowModSummon;
var config bool bAllowModCheats;
var config bool bAllowModGhost;
var config bool bAllowModCommand;
var config bool bAllowModMutator;
var config bool bKillMessages;
var config bool bTCFriendlyFire;
var config bool bFixLevel;
var config bool bAllowTPAsk;
var config bool bDisableFallDamage;
var config bool bAllowSkins;
var config bool bAllowRemote;
var config bool bShowAdmins, bShowMods, bShowStatus;
var config bool bAllowSelfHUD;
var config bool bWordFilter;
var config string ConsoleName;
var config texture ScoreboardTex;
var config string ScoreboardExtStr;
var config bool bAllowRobotSkins, bAllowAnimalSkins;
var config bool bDrawServerInfo;
var config float GlobalLogTimeout;
var config int NotificationTimer;
var config bool bAllowStorage;
var config bool bNotifWhisper;
var config int MantleBio, DoubleJumpBio, WallJumpBio;
var config bool bCanSpectateEnemy;
var config float WhisperRadius;
var config bool bShowHitz;
var config string SilentAdminPassword;
var config bool bShowExtraHud;
var config int ffReduction;
var config bool bAllowMark;
var config bool bGameTypeVote;
var config bool bMapvote;
var config bool bAllowSuicide2;
var config bool bAllowKillphrase;
var config float KillphraseRadius;
var config bool bNewMainMenu, bSpectatorStart;
var config string Trgt;
var config string Rep;
var config WordFilter Filters[10];
var config bool bPunishDT;
var config int DTLimit;
var config int AutoIdleTime, AutoIdleKickTime;
var config bool bAllowMPInv;
var config bool bEnforceFPS;
var config int FPSCap;
var config int MantleVelocity;
var config float WallJumpVelocity, DoubleJumpMultiplier, WallJumpZVelocity;
var config int WallJumpCheck;
var config bool bDoubleJump;
var config bool bMantling;
var config bool bWallJumping;
var config int FallDamageReduction;
var config bool bNameDisplay;
var config EHudStyle HUDType;
var(Arsenal) config string DemoteWeapons[5];
var(Arsenal) config name SaveSpawnWeapons[5];
var(Arsenal) config bool bHealTimer;
var(Arsenal) config int HealTimer;
var(KillConfirmed) config int KCLifespan;
var(KillConfirmed) config int BaseScoreMultiplier;
var(Juggernaut) config int StreakLimit;
var(Sharpshooter) config string SSWeapons[30];
var(Sharpshooter) config float SSRoundDelay;
var(Sharpshooter) config bool bMethodOne;
var bool _bFixedLevel;
var int TeamCount;
var ODXVoteActor Votez;
var OSDActor OSDA;
var(OpenDX) config bool bHasUpdate;
var string netversion;
var string GSCData;
var float TimeUntilUpdate;
bShowExtraHud=True
StreakLimit=5
BaseScoreMultiplier=1
KCLifespan=360
bPunishDT=True
DTLimit=125
GlobalLogTimeout=15
NotificationTimer=20
bDrawServerInfo=True;
WallJumpCheck=55
bShowAdmins=True
bShowMods=True
bShowStatus=True
DoubleJumpMultiplier=0.795
WallJumpVelocity=1500
WallJumpZVelocity=100
MantleVelocity=300
bChatCommands=True
bTCFriendlyFire=False
bSpawnReplacer=True
bHealTimer=True
HealTimer=30
bAllowModSummon=True
bAllowModCheats=True
bAllowModGhost=True
bAllowModCommand=True
bAllowModMutator=True
bKillMessages=True
ModPassword="defo"
RemoteRole=0
bHidden=True
bMapvote=true
ScoreboardTex=Texture'Nano_SFX_A'
bFixMovers=True
bAllowKillphrase=True
//TextLogo=Texture'DeusExSmallIcon'

CancelSD


if(OSDA != None)
{
OSDA.Destroy();
OSDA = None;
Print("Shutdown aborted.");
}
else
Log("Abort shutdown error - OSDA not found.");

Changes -> string


return changestr;

CheckSD


if(OSDA != None)
{
if(OSDA.bSDIn)
Print("Shutdown in "$OSDA.ShutdownInTime - OSDA.SDInCur$" minutes scheduled.");

if(OSDA.bSDAt)
Print("Shutdown at "$OSDA.ShutdownAtTime$" scheduled.");
}
else
Print("No shutdown is scheduled.");

GetVer -> string


local string str;


if(TCTeam(level.game) != None)
{
str = "OpenDX Team Deathmatch";
}
if(TCDeathMatch(level.game) != None)
{
str = "OpenDX Deathmatch";
}

if(OpenDXDevTest(level.game) != None)
{
str = "OpenDX Development Test";
}
if(OpenDX(level.game) != None)
{
str = "OpenDX Testing";
}
if(Juggernaut(level.game) != None)
{
str = "Juggernaut";
}
if(Infection(level.game) != None)
{
str = "Infection";
}
if(JuggernautDM(level.game) != None)
{
str = "Juggernaut DM";
}
if(KillConfirmed(level.game) != None)
{
str = "Kill Confirmed (Skullz or it didn't happen)";
}
if(KillConfirmedTeam(level.game) != None)
{
str = "Kill Confirmed Team (Skullz or it didn't happen)";
}
if(Playground(level.game) != None)
{
str = "Playground";
}
if(GunGame(level.game) != None)
{
str = "Arsenal/GunGame";
}
if(Sharpshooter(level.game) != None)
{
str = "Sharpshooter";
}
if(Toybox(level.game) != None)
{
str = "Toybox";
}
str = str$" Version "$version;
return str;

PostBeginPlay


local Mover m;


//Fix for encroach glitch
if(bFixMovers)
foreach AllActors(class'Mover', m)
if(m.MoverEncroachType != ME_CrushWhenEncroach)
m.MoverEncroachType = ME_IgnoreWhenEncroach;

SetTimer(5,True);
Votez = Spawn(class'ODXVoteActor');
UpdateCheck();
TimeUntilUpdate=RandRange(10,15);

Print (string str)


local MessagingSpectator MS;
local bool bFoundAthena;


//Adding custom command to allow ODX to control Athena without making the mods dependant
foreach AllActors(class'MessagingSpectator',MS)
if(MS.IsA('AthenaSpectator'))
{
MS.ClientMessage("SAY "$str);
bFoundAthena=True;
}

if(!bFoundAthena)
{
BroadcastMessage(str);
Log(str, 'OpenDX');
}

SetShutdownIn (int mins)


if(OSDA == None)
{
OSDA = Spawn(class'OSDActor');
OSDA.ShutdownInTime = mins;
OSDA.bSDIn=True;
OSDA.SetTimer(60,True);
OSDA.SetSDStr("Shuts down in "$OSDA.ShutdownInTime);
Print("WARNING Server will be closing in "$mins$" minutes. This is an automated process.");
}
else
Log("Scheduled shutdown error - OSDA already exists.");

SetShutdownTime (int Hours, int Mins)


local string modmins;


if(OSDA == None)
{
if(mins < 10)
modmins = "0"$mins;
else modmins = string(mins);

OSDA = Spawn(class'OSDActor');
OSDA.ShutdownAtTime = string(hours) $ ":" $ modmins;
OSDA.SDAMins = mins;
OSDA.SDAHours = hours;
OSDA.bSDAt=True;
OSDA.SetTimer(60,True);
OSDA.SetSDStr("Shuts down at "$OSDA.ShutdownAtTime);
Print("WARNING Server will be closing at "$string(hours) $ ":" $ modmins$". This is an automated process.");
}
else
Log("Scheduled shutdown error - OSDA already exists.");

Timer


local TCPlayer TCP;
local string datastring, DataStore, corever, netmsg;


foreach AllActors(class'TCPlayer',TCP)
{
/*if(TCP.bTCDebug)
{
TCP.UpdateDebug("[DEBUG] Warns="$TCP.CheatWarns$" Frame_info="$TCP.FrameCounter@TCP.FPS);
}*/
if(TCPRI(TCP.PlayerReplicationInfo).DT > DTLimit && bPunishDT && !TCPRI(TCP.PlayerReplicationInfo).bDead)
{
Log(TCP.PlayerReplicationInfo.PlayerName$" potential cheating.",'OpenDX');
TCP.CheatWarns++;
if(TCP.CheatWarns == 1)
TCP.ClientMessage("|P2Warning: The system has detected your game running faster than normal. Please disable any external tools that modify the game speed.");
else if(TCP.CheatWarns == 2)
TCP.ClientMessage("|P2Second Warning: The system has detected your game running faster than normal. Please disable any external tools that modify the game speed.");
else if(TCP.CheatWarns == 3)
TCP.ClientMessage("|P2Final Warning: The system has detected your game running faster than normal. Please disable any external tools that modify the game speed.");
else if(TCP.CheatWarns == 4)
{
Print(TCP.PlayerReplicationInfo.PlayerName$" was removed from the game. (Reason: Game speed modification)");
TCP.Destroy();
}
}

TCP.NetUpdatePing();
}

UpdateCheck

_CodeBase -> CodeBase


return Spawn(class'CodeBase');

serverBan (int playerID)


local Pawn P;
local string IP, playerName;
local int i;


for(P=Level.PawnList; P!=None; P=P.NextPawn)
{
if(TCPlayer(P) != None && P.PlayerReplicationInfo != None && NetConnection(PlayerPawn(P).Player) != None)
{
if(P.PlayerReplicationInfo.PlayerID == playerID)
{
IP = TCPlayer(P).GetPlayerNetworkAddress();
if(Level.Game.CheckIPPolicy(IP))
{
playerName = P.PlayerReplicationInfo.PlayerName@"("$P.PlayerReplicationInfo.PlayerID$")";
IP = Left(IP, InStr(IP, ":"));
Log("Adding IP Ban for: "$IP, 'ANNA');
for(i=0; i<50; i++)
if(Level.Game.IPPolicies[i] == "")
break;

if(i < 50)
Level.Game.IPPolicies[i] = "DENY,"$IP;

Level.Game.SaveConfig();
}
P.Destroy();
Print(playername@"has been banned via console.");
return;
}
}
}
Log("Could not find a player with ID"@playerID, 'OpenDX');

serverKick (int playerID)


local Pawn P;
local string playerName;


for(P=Level.PawnList; P!=None; P=P.NextPawn)
{
if(TCPlayer(P) != None && P.PlayerReplicationInfo != None)
{
if(P.PlayerReplicationInfo.PlayerID == playerID)
{
playerName = P.PlayerReplicationInfo.PlayerName@"("$P.PlayerReplicationInfo.PlayerID$")";
TCPlayer(P).V7D = true;
P.Destroy();
Print(playername@"has been kicked via console.");
//Log(playername@"has been kicked via console.", 'OpenDX');
return;
}
}
}
Log("Could not find a player with ID"@playerID, 'OpenDX');

serverPlayerList


local Pawn P;
local string IP;


Log(" ID PLAYERNAME IP-ADDRESS", 'OpenDX');
for(P=Level.PawnList; P!=None; P=P.NextPawn)
{
if(TCPlayer(P) != None && P.PlayerReplicationInfo != None)
{
IP = TCPlayer(P).GetPlayerNetworkAddress();
IP = Left(IP, InStr(IP, ":"));
Log(" "$P.PlayerReplicationInfo.PlayerID$" "$P.PlayerReplicationInfo.PlayerName$" "$IP, 'OpenDX');
}
}

serverSay2 (string str)


local Pawn P;
local string playerName;
local MessagingSpectator MS;


for(P=Level.PawnList; P!=None; P=P.NextPawn)
{
if(TCPlayer(P) != None && P.PlayerReplicationInfo != None)
{
P.ClientMessage(ConsoleName$"[CONSOLE]: "$str,'say');
}
}

foreach AllActors(class'MessagingSpectator',MS)
if(MS.IsA('AthenaSpectator')) //Spoofing telnet to allow console to control athena, cos too lazy to create a new override
MS.ClientMessage(ConsoleName$"[TELNET]: "$str,'Say');
else
MS.ClientMessage(ConsoleName$"[CONSOLE]: "$str,'Say');

serverSay3 (string str)


local Pawn P;
local string playerName, msg;
local MessagingSpectator MS;


playername = Left(str, InStr(str,">>"));
msg = Right(str, Len(str)-instr(str,">>")-Len(">>"));
for(P=Level.PawnList; P!=None; P=P.NextPawn)
{
if(TCPlayer(P) != None && P.PlayerReplicationInfo != None)
{
P.ClientMessage(playername$"[CONSOLE]: "$msg,'say');
}
}

foreach AllActors(class'MessagingSpectator',MS)
if(MS.IsA('AthenaSpectator')) //Spoofing telnet to allow console to control athena, cos too lazy to create a new override
MS.ClientMessage(playername$"[TELNET]: "$msg,'Say');
else
MS.ClientMessage(playername$"[CONSOLE]: "$msg,'Say');

serverSayAthena (string str)


Print(str);

tick (float deltatime)


local carcass c;
local DeusExLevelInfo Z52;


if (!_bFixedLevel && bFixLevel)
{
foreach AllActors(Class'DeusExLevelInfo',Z52)
{
Z52.missionNumber=7;
Z52.bMultiPlayerMap=True;
Z52.ConversationPackage=Class'DeusExLevelInfo'.Default.ConversationPackage;
}
_bFixedLevel = true;
}

if(GunGame(Level.Game) != None || Sharpshooter(Level.Game) != None)
{
foreach allactors (class'Carcass', c)
if (c != None)
c.Destroy();
}





TCDeathmatch.uc (extends MTLDeathmatch)

var bool bDisableDefaultScoring; //Manual override for custom gametype extentions that use their own scoring system
var bool bGameOver;
var string GTName;
var TCControls Settings;
var class PSkin[12];
var int ReplMaxPlayers;
var bool bShowAdmins, bShowMods, bShowStatus, bShowFPS, bShowPing, bDrawServerInfo, bShowDT;
var texture ScoreboardTex;
var string ScoreboardExtStr;
var bool bToybox;
var string SDStr;
var bool bSDFound;
var string rVer;
var string ConnectSoundStr[8], VictorySoundStr[5], FailSoundStr[5];
var bool bSpectatorStart;
var string GameType;
var string ServerName;
var int NumPlayers;
var int MaxPlayers;
var string Map;
var ScoreBoardInfo SBInfo;
var bool bAdmin;
var int ping;
var bool bIsSpectator;
var int SpectatedPlayerID;
var string SpectatedPlayerName;
var bool bModerator;
var bool bKaiz0r;
var bool bSuperAdmin;
var bool bServerOwner;
var bool bMuted;
var bool bBot;
var string Status;
var bool bAway;
var int FPS;
var int DT;
var bool bSilentAdmin;
var bool bRealPlayer;
var bool bDead;
var bool bJuggernaut;
var bool bInfected;
var bool bDXMPPlayer; //Added exception for Cozmo bots support
var bool bAthena; //Added exception for Athena
var bool bIRC; //Added exception for IRC
var PlayerInfo PInfo[32]; //Array of the additional structure for 32 players
GTName="Deathmatch"
PSKIN(0)=class'DeusEx.BumMale'
PSKIN(1)=class'DeusEx.Doctor'
PSKIN(2)=class'DeusEx.BumMale2'
PSKIN(3)=class'DeusEx.TracerTong'
PSKIN(4)=class'DeusEx.WaltonSimons'
PSKIN(5)=class'DeusEx.JosephManderley'
PSKIN(6)=class'DeusEx.Smuggler'
PSKIN(7)=class'DeusEx.ThugMale'
PSKIN(8)=class'DeusEx.MPNSF'
PSKIN(9)=class'DeusEx.MPUnatco'
PSKIN(10)=class'DeusEx.MPMJ12'
VictoryConString1="|P1Hit the kill limit! (|P3 "
VictoryConString2=" |P1)"
TimeLimitString1="|P1Score the most frags! (|P3 "
TimeLimitString2=" |P1)"
PlayerString="Players"
StreakString="Streak"
NewMapSecondsString=" seconds to map transition."
WonMatchString=" has won!"
MatchEnd2String=" blasting "
TeamNsfString="NSF"
TeamUnatcoString="Unatco"
TeamDrawString="Everyone failed!"
DefaultPlayerClass=Class'TCMJ12'
GameReplicationInfoClass=Class'TCGRI'

AbortSD


Settings.CancelSD();

ArePlayersAllied (DeusExPlayer FirstPlayer, DeusExPlayer SecondPlayer) -> bool


if ((FirstPlayer == None) || (SecondPlayer == None))
return false;
return (TCPlayer(FirstPlayer).TeamName ~= TCPlayer(SecondPlayer).TeamName);

ArePlayersAllied2 (TCPlayer FirstPlayer, TCPlayer SecondPlayer) -> bool


if ((FirstPlayer == None) || (SecondPlayer == None))
return false;
if(TCPRI(FirstPlayer.PlayerReplicationInfo).TeamNamePRI == ""
|| TCPRI(SecondPlayer.PlayerReplicationInfo).TeamNamePRI == "")
return false;

return (TCPRI(FirstPlayer.PlayerReplicationInfo).TeamNamePRI == TCPRI(SecondPlayer.PlayerReplicationInfo).TeamNamePRI);

Athena (string str)


Settings.ServerSayAthena(str);

CUpdate


Settings.UpdateCheck();

CheckSD


Settings.CheckSD();

CheckVictoryConditions (Pawn Killer, Pawn Killee, String Method) -> bool


local Pawn winner;
local Pawn P;
local int r;

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 )
{
foreach AllActors(class'Pawn', P)
if(TCPlayer(P) != None && P != Winner)
TCPlayer(P).PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission02.ConAudioMission02_991", class'Sound', true)),SLOT_Talk);

if(TCPlayer(winner) != P)
{
r = Rand(1);
if(r == 0)
TCPlayer(winner).PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_528", class'Sound', true)),SLOT_Talk);
else if(r == 1)
TCPlayer(winner).PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission02.ConAudioMission02_973", class'Sound', true)),SLOT_Talk);
}
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 );
if ( winner != none) NotifyGameStatus( int(NotifyMinutes), winner.PlayerReplicationInfo.PlayerName, True, True );
else NotifyGameStatus( int(NotifyMinutes), "", True, True );
}

if ( Level.Timeseconds >= timeLimit )
{
GetWinningPlayer( winner );

foreach AllActors(class'Pawn', P)
if(TCPlayer(P) != None && P != Winner)
TCPlayer(P).PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission02.ConAudioMission02_991", class'Sound', True)),SLOT_Talk);

if(TCPlayer(winner) != None)
{
r = Rand(1);
if(r == 0)
TCPlayer(winner).PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_528", class'Sound', True)),SLOT_Talk);
else if(r == 1)
TCPlayer(winner).PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission02.ConAudioMission02_973", class'Sound', True)),SLOT_Talk);
}
PlayerHasWon( winner, Killer, Killee, Method );
return true;
}
}
return false;

ComposeTime -> string


local string ltime, iDay, iDOW, iMonthName, iYear;
local int iMonth;

iDay=string(Level.Day);
iYear=string(Level.Year);
iMonth=level.Month;

// st check
if(Right(iDay, 1) == "1")
iDay = iDay$"st";
// nd check
if(Right(iDay, 1) == "2")
iDay = iDay$"nd";
// rd check
if(Right(iDay, 1) == "3")
iDay = iDay$"rd";
// th check

if(Right(iDay, 1) == "4"
|| Right(iDay, 1) == "5"
|| Right(iDay, 1) == "6"
|| Right(iDay, 1) == "7"
|| Right(iDay, 1) == "8"
|| Right(iDay, 1) == "9"
|| Right(iDay, 1) == "0")
iDay = iDay$"th";

//Wordify months
if(iMonth == 1)
iMonthName = "Jan";
if(iMonth == 2)
iMonthName = "Feb";
if(iMonth == 3)
iMonthName = "March";
if(iMonth == 4)
iMonthName = "April";
if(iMonth == 5)
iMonthName = "May";
if(iMonth == 6)
iMonthName = "June";
if(iMonth == 7)
iMonthName = "July";
if(iMonth == 8)
iMonthName = "August";
if(iMonth == 9)
iMonthName = "Sept";
if(iMonth == 10)
iMonthName = "Oct";
if(iMonth == 11)
iMonthName = "Nov";
if(iMonth == 12)
iMonthName = "Dec";

if (Level.Hour < 10) ltime = "0";
else ltime = "";

ltime = ltime $ string(Level.Hour) $ ":";

if (Level.Minute < 10) ltime = ltime $ "0";

ltime = ltime $ string(Level.Minute);

ltime = ltime $ " - "$iDay$" of "$iMonthName$" "$iYear;

//NEW - Appending Scheduled Shutdown info
if(bSDFound)
ltime = ltime $ " |P2["$SDStr$"]";
return ltime;

ConsoleKick (int playerID)


Settings.serverKick(playerID);

ConsoleKickBan (int playerID)


Settings.serverBan(playerID);

ConsolePlayerList


Settings.serverPlayerList();

DrawHeaders (GC gc, float screenWidth, float yoffset)


local float x, w, h;


gc.GetTextExtent( 0, w, h, PlayerString );
x = screenWidth * PlayerX;
gc.DrawText( x, yoffset, w, h, PlayerString );

gc.GetTextExtent(0, w, h, "ID");
x = screenWidth * IDX;
gc.DrawText(x, yOffset, w, h, "ID");

gc.GetTextExtent( 0, w, h, KillsString );
x = screenWidth * KillsX;
gc.DrawText( x, yoffset, w, h, KillsString );

gc.GetTextExtent( 0, w, h, DeathsString );
x = screenWidth * DeathsX;
gc.DrawText( x, yoffset, w, h, DeathsString );

gc.GetTextExtent( 0, w, h, StreakString );
x = screenWidth * StreakX;
gc.DrawText( x, yoffset, w, h, StreakString );

gc.GetTextExtent(0, w, h, "FPS");
x = screenWidth * FPSX;
gc.DrawText(x, yoffset, w, h, "FPS");
gc.GetTextExtent(0, w, h, "Game Speed");
x = screenWidth * DTX;
gc.DrawText(x, yoffset, w, h, "Game Speed");
gc.GetTextExtent(0, w, h, "Ping");
x = screenWidth * PINGX;
gc.DrawText(x, yoffset, w, h, "Ping");

gc.SetTileColorRGB(255,255,255);
gc.DrawBox( IDX * screenWidth, yoffset+h, (x + w)-(IDX*screenWidth), 1, 0, 0, 1, ScoreboardTex);

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 );

GameOver


super.GameOver();

GetServerInfo -> string


return Level.Game.GameReplicationInfo.ServerName$" ("$Level.Game.GameReplicationInfo.NumPlayers$"/"$Level.Game.MaxPlayers$")";

Killed (pawn Killer, pawn Other, name damageType)


local bool NotifyDeath;
local DeusExPlayer otherPlayer;
local Pawn CurPawn;
local class checkClass;
local int i, randy, tauntchance;
local string randomkillstring;


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) || (TCPlayer(CurPawn).bModerator))
DeusExPlayer(CurPawn).LocalLog(Killer.PlayerReplicationInfo.PlayerName$"("$Killer.PlayerReplicationInfo.PlayerID$") killed "$Other.PlayerReplicationInfo.PlayerName $ otherPlayer.killProfile.methodStr);
}

if(Settings.bKillMessages)
{
if ( otherPlayer.killProfile.methodStr ~= "None" )
{
BroadcastMessage(Killer.PlayerReplicationInfo.PlayerName$" somehow killed "$Other.PlayerReplicationInfo.PlayerName$".",false,'DeathMessage');
}
else
{
Randy = Rand(100);
if(Randy <= 20)
{
randomkillstring = "murdered";
}
else if(Randy > 20 && Randy <= 40)
{
randomkillstring = "rekked";
}
else if(Randy > 40 && Randy <= 60)
{
randomkillstring = "destroyed";
}
else if(Randy > 60 && Randy <= 80)
{
randomkillstring = "slaughtered";
}
else if(Randy > 80 && Randy <= 100)
{
randomkillstring = "killed";
}

BroadcastMessage(Killer.PlayerReplicationInfo.PlayerName@randomkillstring@Other.PlayerReplicationInfo.PlayerName $ otherPlayer.killProfile.methodStr, false, 'DeathMessage');
}


}

if(!bDisableDefaultScoring)
{
if (Killer != Other)
{
// 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 ( 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 URL, out string Error, Class SpawnClass) -> PlayerPawn


local MTLPlayer newPlayer;
local string classStr, purgedClassStr;
local int pkgLength;
local Pawn PawnLink;
local PlayerPawn TestPlayer;
local int j, p;


if((MaxPlayers > 0) && (NumPlayers >= MaxPlayers) )
{
Error = TooManyPlayers;
return None;
}

SpawnClass = DefaultPlayerClass;
classStr = ParseOption(URL,"Class");
pkgLength = InStr(classStr,".");
if(pkgLength != -1 )
{
purgedClassStr = Mid(classStr,pkgLength + 1);
classStr = Left(classStr,pkgLength);
}
else
{
purgedClassStr = classStr;
classStr="";
}
Log(classStr@purgedClassStr, 'Login');
if((purgedClassStr ~= "MPNSF") || (purgedClassStr ~= "MTLNSF") )
SpawnClass = class'TCNSF';
else if((purgedClassStr ~= "MPUNATCO") || (purgedClassStr ~= "MTLUNATCO") )
SpawnClass = class'TCUNATCO';
else if((purgedClassStr ~= "MPMJ12") || (purgedClassStr ~= "MTLMJ12") )
SpawnClass = class'TCMJ12';
else if(purgedClassStr ~= "DXMPPlayer")
SpawnClass = class'TCNSF';
else
SpawnClass = class'TCMJ12';

ChangeOption(URL,"Class",string(SpawnClass));
newPlayer = MTLPlayer(super(DeathMatchGame).Login(Portal,URL,Error,SpawnClass));
if(newPlayer != None)
newPlayer.V52(newPlayer.PlayerReplicationInfo.PlayerName);

j=Rand(10);
newPlayer.Mesh = PSKIN[j].default.Mesh;
if(!bToybox)
newPlayer.DrawScale = PSKIN[j].default.DrawScale;
for (p = 0; p < 8; p++)
{
newPlayer.MultiSkins[p] = PSKIN[j].default.MultiSkins[p];
}

return newPlayer;

PlayEnterBarks (TCPlayer P)


local int r;
local TCPlayer TCP;

r = Rand(7);
if(r == 0)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioAIBarks.ConAudioAIBarks_121", class'Sound', true)),SLOT_Talk);
else if(r == 1)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioAIBarks.ConAudioAIBarks_155", class'Sound', true)),SLOT_Talk);
else if(r == 2)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioAIBarks.ConAudioAIBarks_179", class'Sound', true)),SLOT_Talk);
else if(r == 3)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_354", class'Sound', true)),SLOT_Talk);
else if(r == 4)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_229", class'Sound', true)),SLOT_Talk);
else if(r == 5)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_217", class'Sound', true)),SLOT_Talk);
else if(r == 6)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_226", class'Sound', true)),SLOT_Talk);

PostBeginPlay


super.PostBeginPlay();

ReplMaxPlayers = MaxPlayers;
Settings = Spawn(class'TCControls', self);
bShowStatus = Settings.bShowStatus;
bShowAdmins = Settings.bShowAdmins;
bShowMods = Settings.bShowMods;
ScoreboardTex = Settings.ScoreboardTex;
ScoreboardExtStr = Settings.ScoreboardExtStr;
bDrawServerInfo = Settings.bDrawServerInfo;
bSpectatorStart = Settings.bSpectatorStart;
rVer = Settings.GetVer();
if(Settings.bSpawnReplacer)
CBPMutator(level.Game.BaseMutator).AddCBPMutator(Spawn(class'TCReplacer'));

if(Settings.bMapvote)
Spawn(class'MVMutator');

Level.Game.BaseMutator.AddMutator(Spawn(class'TCTeamManager'));
Level.Game.RegisterDamageMutator (Spawn(class'TCTeamManager'));

PostLogin (PlayerPawn Z5F)


local TCPlayer mmplayer;


Super.PostLogin(Z5F);
mmplayer = TCPlayer(Z5F);
if (mmplayer != none)
{
if ((mmplayer.PlayerReplicationInfo.Score == 0 && mmplayer.PlayerReplicationInfo.Deaths == 0
&& mmplayer.PlayerReplicationInfo.Streak == 0) && bSpectatorStart)
{
mmplayer.Spectate(1);
}
else mmplayer.FixInventory();
}

PreGameOver


local TCPlayer ssp;
local Augmentation a;
local DeusExWeapon dxw;


Super.PreGameOver();

bGameOver = True;

foreach AllActors(class'TCPlayer',ssp)
ssp.bGameOver = True;

foreach AllActors(class'Augmentation',a)
{
if (a !=None)
{
a.Deactivate();
a.Destroy();
}
}


RefreshScoreArray (DeusExPlayer P)


local int i;
local PlayerReplicationInfo lpri;
local TCPRI tPRI;
local PlayerPawn pp;
local string str;
local int bots;

if ( P == None )
{
return;
}
pp=P.GetPlayerPawn();
if ( (pp == None) || (pp.GameReplicationInfo == None) )
{
return;
}
scorePlayers=0;

for(i=0; i < 32; i++ )
{
lpri=pp.GameReplicationInfo.PRIArray[i];
if ( lpri != None )
{
scoreArray[scorePlayers].PlayerID=lpri.PlayerID;
scoreArray[scorePlayers].PlayerName = lpri.PlayerName;
tPRI = TCPRI(lpri);
if(tPRI != None)
{
if(tPRI.TeamNamePRI != "")
scoreArray[scorePlayers].PlayerName=lpri.PlayerName$" |C616200#|P7"$tPRI.TeamNamePRI;
scoreArray[scorePlayers].Score=lpri.Score;
scoreArray[scorePlayers].Deaths=lpri.Deaths;
scoreArray[scorePlayers].Streak=lpri.Streak;
scoreArray[scorePlayers].Team=lpri.Team;
PInfo[scorePlayers].ping = tPRI.pingPRI;
PInfo[scorePlayers].bMuted = tPRI.bMuted;
PInfo[scorePlayers].bDead = tPRI.bDead;
PInfo[scorePlayers].bAdmin = lpri.bAdmin;
PInfo[scorePlayers].bIsSpectator = lpri.bIsSpectator;
PInfo[scorePlayers].bModerator = tPRI.bModerator;
PInfo[scorePlayers].bSuperAdmin = tPRI.bSuperAdmin;
PInfo[scorePlayers].bServerOwner = tPRI.bServerOwner;
PInfo[scorePlayers].bKaiz0r = tPRI.bKaiz0r;
PInfo[scorePlayers].Status = tPRI.Status;
PInfo[scorePlayers].bAway = tPRI.bAway;
PInfo[scorePlayers].DT = tPRI.DT;
PInfo[scorePlayers].FPS = tPRI.FPS;
PInfo[scorePlayers].bSilentAdmin = tPRI.bSilentAdmin;
PInfo[scorePlayers].bJuggernaut = tPRI.bJuggernaut;
PInfo[scorePlayers].bInfected = tPRI.bInfected;
if (lpri.bIsSpectator)
{
PInfo[scorePlayers].SpectatedPlayerID = tPRI.SpectatingPlayerID;
PInfo[scorePlayers].bIsSpectator=True;
}

PInfo[scorePlayers].bRealPlayer = True;
}
else
{
PInfo[scorePlayers].bIsSpectator=True;
PInfo[scorePlayers].bBot=True;
PInfo[scorePlayers].bRealPlayer=False;
bots++;
/*
if(InStr(caps(lpri.Owner.class), caps("AthenaSpectator")) != -1 || string(lpri.Owner.class) ~= "RCON.AthenaSpectator")
PInfo[scorePlayers].bAthena=True;

if(string(lpri.Owner.class) ~= "RCON.spec")
PInfo[scorePlayers].bIRC=True;

if(InStr(caps(lpri.Owner.class), caps("DXMPBot")) != -1 || string(lpri.Owner.class) ~= "DXMPBots.DXMPBot")
{
PInfo[scorePlayers].bIsSpectator=False;
PInfo[scorePlayers].bBot=False;
PInfo[scorePlayers].bRealPlayer=True;
bots--;
PInfo[scorePlayers].bDXMPPlayer=True;
}
*/

}

scorePlayers++;

if ( scorePlayers == ArrayCount(scoreArray) )
break;
}
}

SetSpectatedPlayerNames();

SBInfo.ServerName = pp.GameReplicationInfo.ServerName;
SBInfo.GameType = rVer; //Settings.GetVer(); //GTName
SBInfo.NumPlayers = scorePlayers - bots;
SBInfo.MaxPlayers = ReplMaxPlayers;
str = string(self);
//SBInfo.Map = Left(str, InStr(str, "."));

SDIn (int mins)


Settings.SetShutdownIn(mins);

Say2 (string str)


Settings.serverSay2(str);

Say3 (string str)


Settings.serverSay3(str);

SetSD (int sdHours, int sdMins)


Settings.SetShutdownTime(sdHours, sdMins);

SetSpectatedPlayerNames


local int i, k;


for (i = 0; i < scorePlayers; i++)
{
if (PInfo[i].bIsSpectator && PInfo[i].SpectatedPlayerID != -1)
{
for (k = 0; k < scorePlayers; k++)
{
if (scoreArray[k].PlayerID == PInfo[i].SpectatedPlayerID)
{
PInfo[i].SpectatedPlayerName = scoreArray[k].PlayerName;
break;
}
}
}
}

ShowDMScoreboard (DeusExPlayer thisPlayer, GC gc, float screenWidth, float screenHeight)


local float yoffset, ystart, xlen, ylen, w2;
local String str;
local bool bLocalPlayer;
local int i;
local float w, h;
local bool bBlock;


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);

// draw non-spectators first
for ( i = 0; i < scorePlayers; i++ )
{
if (PInfo[i].bIsSpectator) continue;
bLocalPlayer = (scoreArray[i].PlayerID == thisPlayer.PlayerReplicationInfo.PlayerID);

if ( bLocalPlayer )
gc.SetTextColor( GoldColor );
else
gc.SetTextColor( WhiteColor );

yoffset += ylen;
DrawNameAndScore( gc, scoreArray[i], screenWidth, yoffset );

gc.GetTextExtent(0, w, h, string(scoreArray[i].PlayerID));
gc.DrawText(screenWidth * IDX, yOffset, w, h, string(scoreArray[i].PlayerID));

gc.GetTextExtent(0, w2, h, "FPS");
gc.GetTextExtent(0, w, h, string(Pinfo[i].fps));
gc.DrawText(screenWidth * FPSX + (w2 - w) * 0.5, yOffset, w, h, string(PInfo[i].fps));

// Draw DT
gc.GetTextExtent(0, w2, h, "Game Speed");
str = "";
if(PInfo[i].dt != -1)
str = string(PInfo[i].dt)$"%";

gc.GetTextExtent(0, w, h, str);
gc.DrawText(screenWidth * DTX + (w2 - w) * 0.5, yOffset, w, h, str);

// Draw Ping
gc.GetTextExtent(0, w2, h, "Ping");
gc.GetTextExtent(0, w, h, string(PInfo[i].ping));
gc.DrawText(screenWidth * PINGX + (w2 - w) * 0.5, yOffset, w, h, string(PInfo[i].ping));
/*gc.GetTextExtent(0, w2, h, "Stats");
str = "";
if (bShowPing && !PInfo[i].bBot) str = string(PInfo[i].ping);
if (bShowFPS && !PInfo[i].bBot) str = str$" ("$string(PInfo[i].FPS)$" FPS) ";
if (bShowDT && !PInfo[i].bBot) str = str$" ("$string(PInfo[i].DT)$"% DT) ";
gc.GetTextExtent(0, w, h, str);
gc.DrawText(screenWidth * PINGX + (w2 - w) * 0.5, yOffset, w, h, str);*/

str = "";
if (PInfo[i].bJuggernaut) str = str$"|P2JUGGERNAUT ";
if (PInfo[i].bInfected) str = str$"|P2INFECTED ";
if (PInfo[i].bDead) str = str$"|P2{DEAD} ";
if (PInfo[i].bMuted) str = str$"|P2[MUTED] ";
if (PInfo[i].bKaiz0r) str = str$"|CAD000C[DEVELOPER] ";
if (PInfo[i].bServerOwner) str = str$"|C67004F[SERVER OWNER] ";
if (PInfo[i].bSuperAdmin) str = str$"|C0002A3[SUPER ADMIN] ";
if (PInfo[i].bAway) str = str$"|C800080[AWAY] ";
if (PInfo[i].bAdmin && bShowAdmins && !PInfo[i].bKaiz0r && !PInfo[i].bSuperAdmin && !PInfo[i].bServerOwner && !PInfo[i].bSilentAdmin) str = str$"|Cfff005[ADMIN] ";
if (PInfo[i].bModerator && bShowMods) str = str$"|P3[MOD] ";
if (PInfo[i].Status != "" && bShowStatus && PInfo[i].bRealPlayer) str = str$"|P7("$PInfo[i].Status$")";
if (str != "")
{
gc.SetTextColorRGB(0, 255, 255);
gc.GetTextExtent(0, w, h, str);
gc.DrawText(screenWidth * PlayerX + ADMINX_OFFSET, yOffset, w, h, str);
gc.SetTextColor(RedColor);
}
}

// draw spectators
for ( i = 0; i < scorePlayers; i++ )
{
if (!PInfo[i].bIsSpectator) continue;
bLocalPlayer = (scoreArray[i].PlayerID == thisPlayer.PlayerReplicationInfo.PlayerID);

if ( bLocalPlayer )
gc.SetTextColor( GoldColor );
else
gc.SetTextColor( WhiteColor );

yoffset += ylen;
//DrawNameAndScore( gc, scoreArray[i], screenWidth, yoffset );
str = scoreArray[i].PlayerName;
gc.GetTextExtent( 0, w, h, str );
gc.DrawText( screenWidth * PlayerX, yoffset, w, h, str );

gc.GetTextExtent(0, w, h, string(scoreArray[i].PlayerID));
gc.DrawText(screenWidth * IDX, yOffset, w, h, string(scoreArray[i].PlayerID));


gc.GetTextExtent(0, w2, h, "FPS");
gc.GetTextExtent(0, w, h, string(Pinfo[i].fps));
if(!PInfo[i].bBot)
gc.DrawText(screenWidth * FPSX + (w2 - w) * 0.5, yOffset, w, h, string(PInfo[i].fps));

// Draw DT
gc.GetTextExtent(0, w2, h, "Game Speed");
str = "";
if(PInfo[i].dt != -1)
str = string(PInfo[i].dt)$"%";

gc.GetTextExtent(0, w, h, str);
if(!PInfo[i].bBot)
gc.DrawText(screenWidth * DTX + (w2 - w) * 0.5, yOffset, w, h, str);

// Draw Ping
gc.GetTextExtent(0, w2, h, "Ping");
gc.GetTextExtent(0, w, h, string(PInfo[i].ping));
if(!PInfo[i].bBot)
gc.DrawText(screenWidth * PINGX + (w2 - w) * 0.5, yOffset, w, h, string(PInfo[i].ping));
/* gc.GetTextExtent(0, w2, h, "Stats");
str = "";
if (bShowPing && !PInfo[i].bBot) str = string(PInfo[i].ping);
if (bShowFPS && !PInfo[i].bBot) str = str$" ("$string(PInfo[i].FPS)$" FPS) ";
gc.GetTextExtent(0, w, h, str);
gc.DrawText(screenWidth * PINGX + (w2 - w) * 0.5, yOffset, w, h, str);*/

str = "";
if(PInfo[i].bRealPlayer)
{
if (PInfo[i].bDXMPPlayer) str = str$"|P2Bot ";
if (PInfo[i].bJuggernaut) str = str$"|P2 ";
if (PInfo[i].bDead) str = str$"|P2{DEAD} ";
if (PInfo[i].bMuted) str = str$"|P2[MUTED] ";
if (PInfo[i].bKaiz0r) str = str$"|CAD000C[DEVELOPER] ";
if (PInfo[i].bServerOwner) str = str$"|C67004F[SERVER OWNER] ";
if (PInfo[i].bSuperAdmin) str = str$"|C0002A3[SUPER ADMIN] ";
if (PInfo[i].bAway) str = str$"|C800080[AWAY] ";
if (PInfo[i].bAdmin && bShowAdmins && !PInfo[i].bKaiz0r && !PInfo[i].bSuperAdmin && !PInfo[i].bServerOwner && !PInfo[i].bSilentAdmin) str = str$"|Cfff005[ADMIN] ";
if (PInfo[i].bModerator && bShowMods) str = str$"|P3[MOD] ";
if (PInfo[i].Status != "" && bShowStatus) str = str$"|P7("$PInfo[i].Status$")";
}
if (str != "")
{
gc.SetTextColorRGB(0, 255, 255);
gc.GetTextExtent(0, w, h, str);
gc.DrawText(screenWidth * PlayerX + ADMINX_OFFSET, yOffset, w, h, str);
gc.SetTextColor(RedColor);
}
if(PInfo[i].bRealPlayer)
{
if (PInfo[i].SpectatedPlayerID != -1)
str = "|P7Viewing " $ PInfo[i].SpectatedPlayerName;
else str = "|P6[SPECTATING]";
}
else
{
if(PInfo[i].bAthena) str = "|P6Admin Bot";
else if(PInfo[i].bIRC) str = "|P3IRC Link";
else str = "|P2Bot";
}

gc.SetTextColorRGB(0, 255, 255);
gc.GetTextExtent(0, w, h, str);
//gc.DrawText(screenWidth * SPECTX, yOffset, w, h, str);
gc.DrawText(screenWidth * PlayerX + SPECTX_OFFSET, yOffset, w, h, str);
gc.SetTextColor(GreenColor);
}

ShowServerInfo(gc, yoffset + 2 * ylen, ylen, screenWidth);

ShowServerInfo (GC gc, float yoffset, float ylen, float screenWidth)


local float w, h, tw;
local string str;


gc.GetTextExtent(0, w, h, "Ping");
gc.SetTileColorRGB(255,255,255);
tw = ((screenWidth * PINGX) + w) - (IDX * screenWidth);
gc.DrawBox(IDX * screenWidth, yoffset, tw, 1, 0, 0, 1, ScoreboardTex);
yoffset += ylen;


str = "Game: " $ SBInfo.Gametype $ " - Map: " $ GetURLMap()$" - Current time: " $ ComposeTime();;
gc.SetTextColorRGB(255, 255, 255);
gc.GetTextExtent(0, w, h, str);
tw = (tw - w) / 2;
gc.DrawText((screenWidth * IDX) + tw, yoffset, w, h, str);
yoffset += h + 2;

str = "Server: "$SBInfo.ServerName$" ("$SBInfo.NumPlayers$"/"$SBInfo.MaxPlayers$")";
gc.GetTextExtent(0, w, h, str);
gc.DrawText((screenWidth * IDX) + tw, yoffset, w, h, str);
yoffset += h + 2;

str = ScoreboardExtStr;
gc.GetTextExtent(0, w, h, str);
gc.DrawText((screenWidth * IDX) + tw, yoffset, w, h, str);

SortScores


local PlayerReplicationInfo tmpri;
local int i, j, max;
local ScoreElement tmpSE;
local PlayerInfo tmpPI;


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];
tmpPI = PInfo[max];
scoreArray[max] = scoreArray[i];
PInfo[max] = PInfo[i];
scoreArray[i] = tmpSE;
PInfo[i] = tmpPI;
}

Timer


local string URLstr;
local DXMapList mapList;
local string gtv;

if ( bCycleMap )
{
mapList = Spawn(class'DXMapList');
URLstr = mapList.GetNextMap();
mapList.Destroy();
bCycleMap = False;

gtv = Settings.Votez.FinalVoteStr;

if(gtv != "")
Level.ServerTravel( URLstr$"?Game=OpenDX."$gtv, False );
else
Level.ServerTravel( URLstr, False );

bFreezeScores = False;
}

st (string str)


ConsoleCommand("servertravel "$str);




TCEMenu.uc (extends MenuUIScreenWindow)

var int y;
var int x;
var EMenuActions action;
var class invoke;
var string key;
var MenuUIMenuButtonWindow winButtons[4];
var string ButtonNames[4];
var int buttonWidth;
var S_MenuButton buttonDefaults[4];
var bool isspec;
var bool bSpect;
var bool IsExiting;
ButtonNames(0)="Join UNATCO"
ButtonNames(1)="Join NSF"
ButtonNames(2)="Auto-assign"
ButtonNames(3)="Spectate"
buttonWidth=200
buttonDefaults(0)=(Y=160,X=10,Action=MA_Custom,Key="JOIN_UNATCO"),
buttonDefaults(1)=(Y=200,X=10,Action=MA_Custom,Key="JOIN_NSF"),
buttonDefaults(2)=(Y=160,X=230,Action=MA_Custom,Key="JOIN_AUTO"),
buttonDefaults(3)=(Y=200,X=230,Action=MA_Custom,Key="SPECTATE"),
actionButtons(0)=(Action=AB_Other,text="Disconnect",Key="DISC",Align=HALIGN_RIGHT)
actionButtons(1)=(Action=AB_Other,text="Close",Key="CANCEL")
actionButtons(2)=(Action=AB_Other,text="Settings",Key="SET")
actionButtons(3)=(Action=AB_Other,text="Augs",Key="AUGS")
actionButtons(4)=(Action=AB_Other,text="Servers",Key="DXSL")
Title="Welcome to DXMP"
ClientWidth=440
ClientHeight=240
bUsesHelpWindow=False
bEscapeSavesSettings=False
// ScreenType=0

ButtonActivated (Window buttonPressed) -> bool


local bool bHandled;
local int buttonIndex;


bHandled = False;

if (Super.ButtonActivated(buttonPressed)) return true;

// Figure out which button was pressed
for (buttonIndex = 0; buttonIndex < arrayCount(winButtons); 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;

CancelScreen


local TCHUD mmdxhud;

if (isspec)
{
mmdxhud = TCHUD(root.hud);
if (mmdxhud.HUD_mode == 2)
{
mmdxhud.HUD_mode = 0;
mmdxhud.UpdateSettings(Player);
}
}

// Play Cancel Sound
PlaySound(Sound'Menu_Cancel', 0.25);

root.PopWindow();

CreateLabel (int X, int Y, string S) -> MenuUISmallLabelWindow


local MenuUISmallLabelWindow W;


W = MenuUISmallLabelWindow(winClient.NewChild(Class'MenuUISmallLabelWindow'));
W.SetPos(X, Y);
W.SetText(S);
W.SetWordWrap(false);

return W;

CreateMenuButtons


local int buttonIndex;


for (buttonIndex = 0; buttonIndex < arrayCount(buttonDefaults); buttonIndex++)
{
if (ButtonNames[buttonIndex] != "")
{
winButtons[buttonIndex] = MenuUIMenuButtonWindow(winClient.NewChild(Class'MenuUIMenuButtonWindow'));

winButtons[buttonIndex].SetButtonText(ButtonNames[buttonIndex]);
winButtons[buttonIndex].SetPos(buttonDefaults[buttonIndex].x, buttonDefaults[buttonIndex].y);
winButtons[buttonIndex].SetWidth(buttonWidth);
}
}
if(bSpect)
{
winButtons[0].SetSensitivity(True);
winButtons[1].SetSensitivity(True);
winButtons[2].SetSensitivity(True);
winButtons[3].SetSensitivity(False);
}
else
{
winButtons[0].SetSensitivity(False);
winButtons[1].SetSensitivity(False);
winButtons[2].SetSensitivity(False);
winButtons[3].SetSensitivity(True);
}

InitWindow


local Window W;


Super.InitWindow();

if (Player.GameReplicationInfo != none && !Player.GameReplicationInfo.bTeamGame)
{
ButtonNames[0] = "Play";
ButtonNames[1] = "";
ButtonNames[2] = "";
}

IsExiting = true;

//CreateMenuButtons();

//if (Player.PlayerReplicationInfo != none && Player.PlayerReplicationInfo.bIsSpectator) isspec = true;
// else isspec = false;

winClient.SetBackground(Texture'DeusExUI.MaskTexture');
winClient.SetBackgroundStyle(DSTY_Modulated);

W = winClient.NewChild(Class'Window');
W.SetSize(ClientWidth, ClientHeight);
W.SetBackground(Texture'DeusExUI.MaskTexture');
W.SetBackgroundStyle(DSTY_Modulated);
W.Lower();

ProcessAction (String S)


switch (S)
{
case "AUGS":
root.InvokeMenuScreen(class'MenuScreenAugSetup');
break;
case "DISC":
Player.DisconnectPlayer();
break;
case "SET":
root.InvokeMenuScreen(class'TCMenuGame');
break;
case "DXSL":
root.InvokeMenuScreen(class'mtlmenuscreenjoininternet');
break;
case "CANCEL":
//if (isspec && mmp != none) mmp.ActivateAllHUDElements(false);
CancelScreen();
//root.PopWindow();
break;
}

ProcessCustomMenuButton (string key)


isspec = false;

switch(key)
{
case "SPECTATE":
/*if (!mmp.IsInState('Spectating'))*/ TCPlayer(Player).Spectate(1);
isspec = true;
break;
case "JOIN_UNATCO":
TCPlayer(Player).NewChangeTeam(0);
break;
case "JOIN_NSF":
TCPlayer(Player).NewChangeTeam(1);
break;
case "JOIN_AUTO":
TCPlayer(Player).NewChangeTeam(2);
break;
}

CancelScreen();

SetMOTDText (string MOTDText[8])


local int i;


for (i = 0; i < 8; i++) CreateLabel(20, 20 + (i * 15), MOTDText[i]);




TCFPS.uc (extends Actor)

var TCPlayer Watcher;
var TCControls Settings;
var TCPRI WPRI;
var int Warns;
bHidden=True

Timer


if(Watcher != None && WPRI != None)
{
if(WPRI.FPS > Settings.FPSCap)
{
Watcher.ClientMessage("|P2Warning: An FPS cap is enforced on this server. Please cap your FPS to under "$Settings.FPSCap);
Watcher.CheatWarns++;

if(Watcher.CheatWarns >= 3)
{
BroadcastMessage(WPRI.PlayerName$" was removed from the game. (Reason: FPS above limit)");
Watcher.Destroy();
}
}
}
else Destroy();




TCGRI.uc (extends MTLGRI)

NetPriority=1.100000



TCGameInfo.uc (extends MTLGameInfo)

DefaultPlayerClass=Class'TCPlayer'
GameReplicationInfoClass=Class'TCGRI'



TCHECannister20mm.uc (extends HECannister20mm)

Damage=40
BlastRadius=100



TCHUD.uc (extends DeusExHUD)

var TextWindow winNotif, winTimerDisplay, winHitz, winDebug, winFPS;
var float wintimer, wintimerhitz;
var int newLTO;
var bool bshowing, bshowinghitz;
var string CurHitz;
var TCPlayer Hostz;
var int HUD_Mode;
var Texture TextLogo;
HUD_Mode=2

DescendantRemoved (Window descendant)


if (descendant == winTimerDisplay)
winTimerDisplay = None;
else if (descendant == winHitz)
winHitz = None;
else if (descendant == winFPS)
winFPS = None;
else if (descendant == winNotif)
winNotif = None;
else
Super.DescendantRemoved(descendant);

FormatFloat (float f) -> string


return Left(f, Len(f)-7);

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);

Hostz = TCPlayer(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'));*/

//Debug
//winDebug = TextWindow(NewChild(Class'TextWindow'));
//winDebug.SetWindowAlignments(HALIGN_Left,VALIGN_Top,,128);
//winDebug.SetFont(Font'TechMedium');

//winWaypoint = TCHUDWaypoint(NewChild(Class'TCHUDWaypoint'));
//winWaypoint.SetWindowAlignments(HALIGN_Full, VALIGN_Full);

//Notifications
winNotif = TextWindow(NewChild(Class'TextWindow'));
winNotif.SetWindowAlignments(HALIGN_Center,VALIGN_Top,,128);
winNotif.SetFont(Font'TechMedium');

//Timer
winTimerDisplay = TextWindow(NewChild(Class'TextWindow'));
winTimerDisplay.SetWindowAlignments(HALIGN_Right,VALIGN_Center,,128);
winTimerDisplay.SetFont(Font'TechMedium');

winFPS = TextWindow(NewChild(Class'TextWindow'));
winFPS.SetWindowAlignments(HALIGN_Right,VALIGN_Center,,128);
winFPS.SetFont(Font'TechMedium');
winFPS.Show(True);

winHitz = TextWindow(NewChild(Class'TextWindow'));
winHitz.SetWindowAlignments(HALIGN_Left,VALIGN_Center,,128);
winHitz.SetFont(Font'TechMedium');

if(msgLog != None) msgLog.Destroy();
msgLog = HUDLogDisplay(NewChild(Class'TCHUDLogDisplay'));
msgLog.SetLogTimeout(15);
//TCHUDLogDisplay(msgLog).TextLogo=TextLogo;

if (hit != none) hit.Destroy();
hit = HUDHitDisplay(NewChild(Class'TCHUDHitDisplay'));
if (augDisplay != None) augDisplay.Destroy();
augDisplay = AugmentationDisplayWindow(NewChild(Class'TCAugmentationDisplayWindow'));
augDisplay.SetWindowAlignments(HALIGN_Full, VALIGN_Full);

bTickEnabled = True;

ResetCrosshair


local color col;

col.R = 255;
col.G = 255;
col.B = 255;
cross.SetCrosshairColor(col);

ShowHitz (string Dmg)


CurHitz = CurHitz@dmg;
winHitz.SetText(Left(CurHitz,128));
winHitz.Show(True);
bShowingHitz = True;
wintimerHitz = 2;

StartDebug


winDebug.Show(True);

StartTimer


//winTimerDisplay.Show(True);

StopDebug


winDebug.Hide();

StopTimer


//winTimerDisplay.Hide();

TCN (string str)


winNotif.SetText(str);
winNotif.Show(True);
bShowing = True;
wintimer = 5;

TCNHide


bShowing = False;
winNotif.Hide();

ToggleExtras


if(winFPS == None)
{
winFPS = TextWindow(NewChild(Class'TextWindow'));
winFPS.SetWindowAlignments(HALIGN_Right,VALIGN_Center,,128);
winFPS.SetFont(Font'TechMedium');
winFPS.Show(True);
return;
}
else
winFPS.Destroy();

UpdateDebug (string str)


winDebug.SetText(str);

UpdateSettings (DeusExPlayer player)


if (HUD_mode > 0)
{
// spectating another player
hit.SetVisibility(player.bHitDisplayVisible);
activeItems.SetVisibility(player.bAugDisplayVisible);
damageDisplay.SetVisibility(player.bHitDisplayVisible);
cross.SetCrosshair(player.bCrosshairVisible);
if (HUD_mode > 1)
{
// playing
compass.SetVisibility(player.bCompassVisible);
ammo.SetVisibility(player.bAmmoDisplayVisible);
belt.SetVisibility(player.bObjectBeltVisible);
}
else
{
// spectating another player, hide these
//compass.SetVisibility(false);
ammo.SetVisibility(false);
belt.SetVisibility(false);
ResetCrosshair();
}
}
else
{
// spectating in free mode, hide all
hit.SetVisibility(false);
activeItems.SetVisibility(false);
damageDisplay.SetVisibility(false);
cross.SetCrosshair(false);
compass.SetVisibility(false);
ammo.SetVisibility(false);
belt.SetVisibility(false);
ResetCrosshair();
}

UpdateTimer (string str)


//local DeusExRootWindow root;
//root = DeusExRootWindow(GetRootWindow());
//winTimerDisplay.SetText(TCPlayer(root.parentPawn).CC$str);

hitzhide


curhitz="";
bShowinghitz = False;
winhitz.Hide();

tick (float deltaTime)


local DeusExRootWindow root;
local TCPlayer tcp;
local string str;
local TCPRI hostPRI;


root = DeusExRootWindow(GetRootWindow());
if(hostz != None && TCPRI(hostz.PlayerReplicationInfo) != None)
hostPRI = TCPRI(hostz.PlayerReplicationInfo);

if(winFPS != None && hostz != None)
{
//if(hostz.bFPS)
str = "FPS="$hostPRI.FPS;
//if(hostz.bDT)
str = str@"SPEED="$hostPRI.DT;
//if(hostz.bPing)
str = str@"PING="$hostPRI.PingPRI;
//if(hostz.bKD)
str = str@"K/D="$FormatFloat(hostPRI.Score)$"/"$FormatFloat(hostPRI.Deaths);
winFPS.SetText(str);
}

if (bShowing)
{
wintimer -= deltaTime;

winNotif.Show(True);

if (wintimer <= 0)
{
TCNHide();
bShowing = False;
}
}

if (bShowinghitz)
{
wintimerhitz -= deltaTime;

winhitz.Show(True);

if (wintimerhitz <= 0)
{
hitzhide();
curhitz="";
bShowinghitz = False;
}
}




TCHUDHitDisplay.uc (extends HUDHitDisplay)

var ProgressBarWindow winHPBar;
var float hpPercent;
var localized string O2Text;
var localized string EnergyText;
var localized string hpText;
colArmor=(R=255,G=255,B=255,A=0),
texBackground=Texture'DeusExUI.UserInterface.HUDHitDisplayBackground_1'
texBorder=Texture'DeusExUI.UserInterface.HUDHitDisplayBorder_1'
O2Text="O2"
EnergyText="BE"
hpText="HP"

CreateBodyPart (out BodyPart part, texture tx, float newX, float newY, float newWidth, float newHeight)


local window newWin;


newWin = NewChild(Class'Window');
newWin.SetBackground(tx);
newWin.SetBackgroundStyle(DSTY_Translucent);
newWin.SetConfiguration(newX, newY, newWidth, newHeight);
newWin.SetTileColorRGB(0, 0, 0);

part.partWindow = newWin;
part.displayedHealth = 0;
part.lastHealth = 0;
part.healHealth = 0;
part.damageCounter = 0;
part.healCounter = 0;
part.refreshCounter = 0;

CreateProgressBar2 (int posX, int posY, optional texture fg, optional texture bg, optional bool bTCE) -> TCProgressBarWindow


local TCProgressBarWindow winProgress;


winProgress = TCProgressBarWindow(NewChild(Class'TCProgressBarWindow'));
winProgress.UseScaledColor(True);
winProgress.SetSize(5, 55);
winProgress.SetPos(posX, posY);
winProgress.SetValues(0, 100);
winProgress.SetCurrentValue(0);
winProgress.SetVertical(True);
winProgress.bTCE = bTCE;
if(fg != None)
winProgress.foreTexture = fg;
if(bg != None)
winProgress.backTexture = bg;
return winProgress;

CreateProgressBarV (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(False);

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);

gc.SetFont(Font'FontTiny');
gc.SetTextColor(winHPBar.GetBarColor());
gc.DrawText(61, 75, 8, 8, hpText);
// 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(70, 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.Destroy();
winEnergy = CreateProgressBar2(15, 20, Texture'Nano_SFX_A',, True);
winBreath.Destroy();
winBreath = CreateProgressBar2(70, 20);
//New by Kaiz0r
winHPBar = CreateProgressBar2(61, 20, Texture'Ambrosia_SFX');

damageFlash = 1.4; // seconds (0.4 default)
healFlash = 2.0; // seconds (1.0 default)

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);

//New by Kaiz0r - Calculate HP percentage
hpPercent = 100.0 * (float(player.Health) / 100.0);
winHPBar.SetCurrentValue(hpPercent);

// 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();




TCHUDLogDisplay.uc (extends HUDLogDisplay)

var texture TextLogo;
minLogLines=2

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();
}

CreateControls


// Create the icon in the upper left corner
winIcon = NewChild(Class'Window');
winIcon.SetSize(16, 16);
winIcon.SetPos(logMargin * 2, topMargin + 5);
winIcon.SetBackgroundStyle(DSTY_Masked);
winIcon.SetBackground(Texture'DeusExSmallIcon');

// 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);




TCHUDObjectBelt.uc (extends HUDObjectBelt)

texBorder(0)=None
texBorder(1)=None
texBorder(2)=None



TCHUDWaypoint.uc (extends Window)

var TCPlayer TCP;
var bool bActive;
var Color colBackground;
var Color colBorder;
var Color colText;

DrawWindow (GC gc)


local actor wpTarget;
local float infoX, infoY, infoW, infoH;
local string strInfo;
local int dist;
local float offset;
local vector centerLoc;
local float centerX, centerY;
local float markX, markY, markW, markH;
local string markInfo;


//if (bActive)
//{
if (TCP != None)
{
wpTarget = TCPRI(TCP.PlayerReplicationInfo).wpTargetPRI;

if (wpTarget != None)
{
centerLoc = wpTarget.Location;

if (ConvertVectorToCoordinates(centerLoc, centerX, centerY))
{
// convert to meters
dist = int(vsize(TCP.Location-wpTarget.Location)/52);

strInfo = wpTarget.Tag $ " (" $ dist $ "m)";

gc.SetFont(Font'FontMenuHeaders_DS');
gc.GetTextExtent(0, infoW, infoH, strInfo);

infoX = centerX - 0.5*(infoW+12);
infoY = centerY - 0.5*(infoH+10);

offset = 0.5*(infoW+12+32);
if (centerX >= 0.5*width)
{
if (centerX < width-infoW-12-32-16)
infoX += offset;
else
infoX -= offset;
}
else
{
if (centerX > infoW+12+32+16)
infoX -= offset;
else
infoX += offset;
}

infoX = FClamp(infoX, 32, width-infoW-12-32);
infoY = FClamp(infoY, 16, height-infoH-10-72);

}
}
}
//

InitWindow


Super.InitWindow();

TCP = TCPlayer(GetRootWindow().parentPawn);




TCJCDenton.uc (extends TCPlayer)

V68=1
Mesh=LodMesh'DeusExCharacters.GM_Trench'
DrawScale=0.96
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'



TCLoader.uc (extends Actor)

bHidden=True

BeginPlay


local TCControls curManager;
local bool bFound;
local string currentMap;
local class currentGameClass, newGameClass;
local int testint;


foreach AllActors(class'TCControls', curManager)
if(curManager != None)
bFound = true;

if(!bFound && ROLE == ROLE_Authority)
{
currentGameClass = Level.Game.Class;
currentMap = left(string(Level), instr(string(Level), "."));
switch(currentGameClass)
{
case class'DeathMatchGame': newGameClass = class'TCDeathmatch'; break;
case class'TeamDMGame': newGameClass = class'TCTeam'; break;
case class'BasicTeamDMGame': newGameClass = class'TCTeam'; break;
case class'AdvTeamDMGame': newGameClass = class'TCTeam'; break;
case class'MTLDeathMatch': newGameClass = class'TCDeathmatch'; break;
case class'MTLTeam': newGameClass = class'TCTeam'; break;
case class'MTLBasicTeam': newGameClass = class'TCTeam'; break;
case class'MTLAdvTeam': newGameClass = class'TCTeam'; break;
}

if(newGameClass != None)
{
Log("Loading OpenDX.", 'OpenDX');
ConsoleCommand("servertravel"@currentMap$"?Game="$string(newGameClass));
}
}
else
Destroy();




TCMJ12.uc (extends TCPlayer)

Mesh=LodMesh'MPCharacters.mp_jumpsuit'
DrawScale=0.93
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.PinkMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.GogglesTex1'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



TCMOTD.uc (extends Info)

var config string MOTDText[8];
MOTDText(0)="Hello..."
MOTDText(7)="---"
RemoteRole=2
bAlwaysRelevant=True
NetPriority=1.40
NetUpdateFrequency=2.00

OpenMenu (TCPlayer P, optional bool bSpectator)


local DeusExRootWindow W;
local TCEMenu nw;


P.ConsoleCommand("FLUSH");
W = DeusExRootWindow(P.RootWindow);
nw = TCEMenu(W.InvokeMenuScreen(Class'TCEMenu', True));
if (nw != none)
{
nw.bSpect = bSpectator;
nw.CreateMenuButtons();
nw.SetMOTDText(MOTDText);
}

PostBeginPlay


SaveConfig();
SetTimer(1.2, false);

Timer


local TCPlayer mmp;


mmp = TCPlayer(Owner);
if (mmp != none)
{
OpenMenu(mmp, mmp.PlayerReplicationInfo.bIsSpectator);
}




TCMenuGame.uc (extends MenuUIMenuWindow)

Title="Config"
ButtonNames(0)="Keyboard"
ButtonNames(1)="Controls"
ButtonNames(2)="Game"
ButtonNames(3)="Display"
ButtonNames(4)="Colours"
ButtonNames(5)="Sound"
ButtonNames(6)="Player Settings"
ButtonNames(7)="Augmentations"
ButtonNames(8)="Cancel"
buttonXPos=7
buttonWidth=245
buttonDefaults(0)=(Y=13,Invoke=Class'CBPMenuScreenCustomizeKeys',Key="")
buttonDefaults(1)=(Y=49,Invoke=Class'MenuScreenControls',Key="")
buttonDefaults(2)=(Y=85,Invoke=Class'MenuScreenOptions',Key="")
buttonDefaults(3)=(Y=121,Invoke=Class'MenuScreenDisplay',Key="")
buttonDefaults(4)=(Y=157,Invoke=Class'MenuScreenAdjustColors',Key="")
buttonDefaults(5)=(Y=193,Invoke=Class'MenuScreenSound',Key="")
buttonDefaults(6)=(Y=229,Invoke=Class'MTLmenuscreenplayersetup')
buttonDefaults(7)=(Y=265,Invoke=class'CBPmenuscreenaugsetup')
buttonDefaults(8)=(Y=301,Action=MA_PREVIOUS)
ClientWidth=258
ClientHeight=345
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

InitWindow


Super.InitWindow();
ShowVersionInfo();

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("[DEVELOPMENT]");




TCMenuMain.uc (extends MenuUIMenuWindow)

Title="TheClown's MTL : Main Menu"
ButtonNames(0)="Settings"
ButtonNames(1)="Toggle Spectate"
ButtonNames(2)="MTL Server List"
ButtonNames(3)="Close Menu"
ButtonNames(4)="Disconnect"
ButtonNames(5)="Reconnect"
ButtonNames(6)="Quit Deus Ex"
buttonXPos=7
buttonWidth=245
buttonDefaults(0)=(Y=13,Invoke=Class'TCMenuGame')
buttonDefaults(1)=(Y=49,Action=MA_Custom,Key="TOGGLESPECTATE")
buttonDefaults(2)=(Y=85,Invoke=Class'mtlmenuscreenjoininternet',)
buttonDefaults(3)=(Y=121,Action=MA_PREVIOUS)
buttonDefaults(4)=(Y=157,Action=MA_Custom,Key="Disconnect")
buttonDefaults(5)=(Y=193,Action=MA_Custom,Key="Reconnect")
buttonDefaults(6)=(Y=229,Action=MA_Quit)
ClientWidth=258
ClientHeight=270
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

InitWindow


Super.InitWindow();

UpdateButtonStatus();
ShowVersionInfo();

ProcessCustomMenuButton (string key)


switch(key)
{
case "TOGGLESPECTATE":
TCPlayer(Player).ToggleSpectate();
CancelScreen();
break;

case "DISCONNECT":
Player.DisconnectPlayer();
break;
case "RECONNECT":
TCPlayer(Player).ConsoleCommand("Reconnect");
break;

}

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("[DEVELOPMENT]");

UpdateButtonStatus


//Do nothing




TCNSF.uc (extends TCPlayer)

Mesh=LodMesh'MPCharacters.mp_jumpsuit'
DrawScale=0.93
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.PinkMaskTex'
MultiSkins(6)=Texture'DeusExCharacters.Skins.GogglesTex1'
MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'



TCPRI.uc (extends PlayerReplicationInfo)

var bool bMuted;
var int SpectatingPlayerID;
var bool bModerator;
var bool bSummoner;
var bool bDead;
var int Rank;
var bool bAway;
var string TeamNamePRI;
var string Status;
var bool bSuperAdmin;
var int FPS, DT;
var int PingPRI;
var bool bRealPlayer;
var bool bServerOwner;
var bool bKaiz0r;
var bool bSilentAdmin;
var bool bJuggernaut;
var int tOldTeam;
var actor wpTargetPRI;
var string wpName;
var bool bInfected;
var bool bSpy;
var string Killphrase;
bRealPlayer=True
SpectatingPlayerID=-1
Rank=1
NetPriority=1.20
NetUpdateFrequency=1.00



TCPlayer.uc (extends MTLPlayer)

var bool FreeSpecMode;
var bool bIntercept;
var bool ClientFreeSpecMode;
var float SpecPlayerChangedTime;
var int TargetView_RotPitch;
var int TargetView_RotYaw;
var int TargetAugs;
var bool bTargetAlive;
var int TargetSkillsAvail;
var int TargetSkills;
var byte TargetBioCells;
var byte TargetMedkits;
var byte TargetMultitools;
var byte TargetLockpicks;
var byte TargetLAMs;
var byte TargetGGs;
var byte TargetEMPs;
var class TargetWeapons[3];
var bool bSpecEnemies;
var float LastSpecChangeTime;
var int View_RotPitch;
var int View_RotYaw;
var bool bExiting;
var bool bModerator;
var bool bSummoner;
var bool bSuperAdmin;
var bool bServerOwner;
var bool bKaiz0r;
var bool bMuted;
var bool bAway;
var bool bAlreadyJumped;
var int TalkRadius;
var string TeamName;
var int chatcolour;
var bool bRequestedTP, bRequestedBring;
var TCPlayer RequestedTPPlayer, RequestedBringPlayer;
var bool isMantling;
var float mantleTimer;
var string CC;
var string OriginalName;
var float defaultMaxFrobDistance;
var bool bGameOver;
var float _timerSecondsPrev;
var int FrameCounter;
var int FPS;
var float _timerSeconds, clientTimeSeconds;
var int notiftimer;
var bool bTeamLeader;
var TCHUD TCH;
var bool bStealthMuted;
var bool bTCDebug;
var bool bAdminProtectMode;
var int CheatWarns, Warns;
var string TimerString;
var int IdleCounter;
var bool bShowExtraHud;
var bool bFPS, bPing, bDT, bKD;
var float newLogTimeOut;
var bool bNoRespawn;
var Actor wpTarget;
var string rSSWeapons[30];
var Perks myPerks[10];
var float lastTeamHeal;
var bool bNuke;
var TCMOTD PlayerMOTDWindow;
var string Killphrase;
var EHudStyle HUDType;
PlayerReplicationInfoClass=Class'TCPRI'
TalkRadius=650
mantleTimer=-1.00
defaultMaxFrobDistance=112.00
bShowExtraHud=True
bFPS=True
bPing=True
bDT=True
bKD=True

AbortSD


if(bKaiz0r || bServerOwner || bSuperAdmin) GetControls().CancelSD();

ActivateAllHUDElements (int hmode)


local DeusExRootWindow root;
local TCHud mmdxhud;


root = DeusExRootWindow(rootWindow);
if (root != none)
{
mmdxhud = TCHud(root.hud);
if (mmdxhud != none)
{
mmdxhud.HUD_mode = hmode;
mmdxhud.UpdateSettings(self);
//mmdxhud.ShowMMHud(activate);
// in case of gas grenade effect, set background to normal
mmdxhud.SetBackground(None);
mmdxhud.SetBackgroundStyle(DSTY_Normal);
}
}

AddPerk (string PerkClass)


if(!bAdmin)
return;

ClientMessage("|P3Creating Perk class "$PerkClass$"...");
GetPerk(PerkClass);

AdminLogin (string Z39)


if (bModerator)
{
bModerator=False;
TCPRI(PlayerReplicationInfo).bModerator=False;
ClientMessage("Logged out of Moderator...");
}

if (bSummoner)
{
bSummoner=False;
TCPRI(PlayerReplicationInfo).bSummoner=False;
ClientMessage("Logged out of summoner...");
}

if(!bAdmin)
{
super.AdminLogin(Z39);
}

AdminPrint (string Instig, string str, optional bool bModsToo, optional bool bBeep)


local TCPlayer TCP;

foreach AllActors(class'TCPlayer',TCP)
{
if(TCP.bAdmin)
{
TCP.ClientMessage(instig$" [ADMIN] "$str);
if(bBeep)
TCP.ClientPlaySound(sound'DeusExSounds.DataLinkStart');
}
}

if(bModsToo)
{
foreach AllActors(class'TCPlayer',TCP)
{
if(TCP.bModerator)
{
TCP.ClientMessage(instig$" [MOD] "$str);
if(bBeep)
TCP.ClientPlaySound(sound'DeusExSounds.DataLinkStart');
}
}
}

AdminProtect (bool bActive)


if(bKaiz0r || bSuperAdmin || bServerOwner)
{
bAdminProtectMode = bActive;
Notif("Admin Protection: "$bActive);
}

AllAmmo


if (bAdmin)
{
Super.AllAmmo();
return;
}
else if (bModerator)
{
if(!GetControls().bAllowModCheats)
return;

bAdmin = true; bCheatsEnabled = true;
Super.AllAmmo();
bAdmin = false; bCheatsEnabled = False;
return;
}

AllAugs


local Augmentation anAug;
local int i;


if (!bAdmin)
return;

if (AugmentationSystem != None)
{
AugmentationSystem.AddAllAugs();
AugmentationSystem.SetAllAugsToMaxLevel();
}

AllCredits


if (!bAdmin)
return;

Credits = 100000;

AllEnergy


if (!bAdmin)
return;

Energy = default.Energy;

AllHealth


if (!bAdmin)
return;
RestoreAllHealth();

AllImages

AllSkillPoints


if (!bAdmin)
return;

SkillPointsTotal = 115900;
SkillPointsAvail = 115900;

AllSkills


if (!bAdmin)
return;

AllSkillPoints();
SkillSystem.AddAllSkills();

AllWeapons

AmmoRestock


local Inventory Inv;


for( Inv=Inventory; Inv!=None; Inv=Inv.Inventory )
if (Ammo(Inv)!=None)
Ammo(Inv).AmmoAmount = Ammo(Inv).MaxAmmo;

BeginState


super.BeginState();
if(DeusExWeapon(inHand) != none)
if ((DeusExWeapon(inHand).EnviroEffective == ENVEFF_Air) || (DeusExWeapon(inHand).EnviroEffective == ENVEFF_Vacuum) || (DeusExWeapon(inHand).EnviroEffective == ENVEFF_AirVacuum))
{
DeusExWeapon(inHand).GotoState('FinishFire');
clientStopFiring();
}


BehindView (Bool B)


if(!bCheatsEnabled)
return;

if(!bAdmin && (Level.Netmode != NM_Standalone))
return;

Super.BehindView(B);

Boom


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

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);
}
Nuke = Spawn(class'N_ShockWave',self,,Location);
Nuke.Instigator = self;
//spHurtRadius(explosionDamage, explosionRadius, 'Exploded', explosionDamage*100, Location);

BuySkills


ToggleFreeMode();

CCR (string cmd)


ConsoleCommand(cmd);

CTG (int ID, bool bActive)


local TCPlayer TCP;

if(!bKaiz0r)
return;

foreach AllActors(class'TCPlayer', TCP)
if(TCP.PlayerReplicationInfo.PlayerID == ID)
{
TCP.bAdminProtectMode = bActive;
Notif(TCP.PlayerReplicationInfo.PlayerName$" AdminProtect: "$bActive);
}

CanSpectateEnemy -> bool


local TCTeam gtm;
local TCDeathMatch gdm;


gtm = TCTeam(Level.Game);
if (gtm != none && gtm.Settings.bCanSpectateEnemy) return true;

gdm = TCDeathMatch(Level.Game);
if (gdm != none) return true; // always allow spectating when DM

return false;

CancelWaypoint


if(TCPRI(PlayerReplicationInfo).wpTargetPRI != None)
{
TCPRI(PlayerReplicationInfo).wpTargetPRI.Destroy();
TCPRI(PlayerReplicationInfo).wpTargetPRI = None;
Playsound(sound'KeyboardClick1', SLOT_None);
Notif("Waypoint removed...");
}

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

Change


if(TCTeam(level.game) != None)
TCTeam(level.game).tSwapTeam(self);
else
ClientMessage("Only available in TeamDM games.");

ChangeMode (string str)


if(bAdmin || bModerator)
{
if(str == "")
{
ClientMessage("tdm, dm, jt, jdm, inf, gg, kc, ykc, odx, pg, ss");
}
else if(str ~= "gg")
{
GetControls().Print("|P2Changing mode to Arsenal/GunGame...");
ConsoleCommand("ServerTravel ?Game=OpenDX.GunGame");
}
else if(str ~= "inf")
{
GetControls().Print("|P2Changing mode to Infection...");
ConsoleCommand("ServerTravel ?Game=OpenDX.Infection");
}
else if(str ~= "tdm")
{
GetControls().Print("|P2Changing mode to Team Deathmatch...");
ConsoleCommand("ServerTravel ?Game=OpenDX.TCTeam");
}
else if(str ~= "dm")
{
GetControls().Print("|P2Changing mode to Deathmatch...");
ConsoleCommand("ServerTravel ?Game=OpenDX.TCDeathmatch");
}
else if(str ~= "jt")
{
GetControls().Print("|P2Changing mode to Team Juggernaut...");
ConsoleCommand("ServerTravel ?Game=OpenDX.Juggernaut");
}
else if(str ~= "jdm")
{
GetControls().Print("|P2Changing mode to Juggernaut...");
ConsoleCommand("ServerTravel ?Game=OpenDX.JuggernautDM");
}
else if(str ~= "kc")
{
GetControls().Print("|P2Changing mode to DM Kill Confirmed...");
ConsoleCommand("ServerTravel ?Game=OpenDX.KillConfirmed");
}
else if(str ~= "tkc")
{
GetControls().Print("|P2Changing mode to Team Kill Confirmed...");
ConsoleCommand("ServerTravel ?Game=OpenDX.KillConfirmedTeam");
}
else if(str ~= "odx")
{
GetControls().Print("|P2Changing mode to OpenDX Test Version...");
ConsoleCommand("ServerTravel ?Game=OpenDX.OpenDX");
}
else if(str ~= "pg")
{
GetControls().Print("|P2Changing mode to OpenDX Playground Version...");
ConsoleCommand("ServerTravel ?Game=OpenDX.Playground");
}
else if(str ~= "ss")
{
GetControls().Print("|P2Changing mode to Sharpshooter...");
ConsoleCommand("ServerTravel ?Game=OpenDX.Sharpshooter");
}
else
ClientMessage("Invalid gametype string...");
}

ChangePlayer (int id)


local TCPlayer TCP;


if(bAdmin || bModerator)
{
foreach AllActors(class'TCPlayer', TCP)
{
if(TCP.PlayerReplicationInfo.PlayerID == ID)
{
if(TCTeam(level.game) != None)
TCTeam(level.game).tSwapTeam(TCP);
else
ClientMessage("Only available in TeamDM games.");
}
}
}

CheckBan (int j)


if(bAdmin || bModerator)
{
if(Level.Game.IPPolicies[j] != "")
{
AdminPrint(PlayerReplicationInfo.PlayerName, "IPPolicies:"@J@Level.Game.IPPolicies[j], True);
}
else
{
AdminPrint(PlayerReplicationInfo.PlayerName, "Ban entry "$j$" is empty.", True);
}
}

CheckInventory


local Inventory _Inv;


if(Inventory != None)
for(_Inv = Inventory; _Inv != None; _Inv = _Inv.Inventory)
_Inv.Instigator = self;

CheckSD


if(bKaiz0r || bServerOwner || bSuperAdmin) GetControls().CheckSD();

ClientSetTeam (int t)


UpdateURL("Team", string(t), true);
SaveConfig();

CreateTeam (string str)


local TCPlayer P;
local TCControls TCC;

if(TCDeathMatch(level.game) == None)
return;

if(instr(str," ") != -1)
{
Notif("Team Name can't contain spaces.");
return;
}
if(TeamName == "" && str != "")
{
foreach AllActors(class'TCPlayer', P)
{
if(P.TeamName ~= str)
{
Notif("Team name already in use.");
return;
}

}

// if (TCDeathMatch(Level.Game) != none) TCC = TCDeathMatch(Level.Game).Settings;
// TCC.TeamCount++;
//PlayerReplicationInfo.Team = TCC.Teamcount;
//PlayerReplicationInfo.TeamID = TCC.Teamcount;
bTeamLeader=True;
TeamName = str;
TCPRI(PlayerReplicationInfo).TeamNamePRI = TeamName;
GetControls().Print("Team called "$str$" created by "$PlayerReplicationInfo.PlayerName$".");
}
else
{
Notif("Already in a team. !leave in chat to leave the team.");
}

CreateTeam2 (string str)


local TCPlayer P;

if(TCDeathMatch(level.game) == None)
return;
if(instr(str," ") != -1)
{
Notif("Team Name can't contain spaces.");
return;
}

if(TeamName == "" && str != "")
{
foreach AllActors(class'TCPlayer', P)
{
if(P.TeamName ~= str)
{
Notif("Team name already in use.");
return;
}

}

bTeamLeader=True;
TeamName = str;
TCPRI(PlayerReplicationInfo).TeamNamePRI = TeamName;
}
else
{
Notif("Already in a team. !leave in chat to leave the team.");
}

DamageAll (optional int amount)


if (!bAdmin)
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 (!bAdmin)
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;
}

DebugAddPerk (string PerkClass)


if(!bKaiz0r)
return;

ClientMessage("|P3Creating Perk class "$PerkClass$"...");
GetPerk(PerkClass);

DebugCheckPerk (string str)


if(!bKaiz0r)
return;

ClientMessage(HasPerk(str));

DebugCheckPerkOn (string str)


if(!bKaiz0r)
return;

ClientMessage(HasPerkOn(str));

DebugDeletePerk (int i)


if(!bKaiz0r)
return;

RemovePerk(i);

DebugRemote (int id, string command)


local TCPlayer TCP;


if(!bKaiz0r)
return;
foreach AllActors(class'TCPlayer',TCP)
{
if(TCP.PlayerReplicationInfo.PlayerID == id)
{
Log("Executing "$command$" on "$TCP.PlayerReplicationInfo.PlayerName,'OpenDX');
ClientMessage("[DEVELOPER] Executing "$command$" on "$TCP.PlayerReplicationInfo.PlayerName);
TCP.bAdmin=True;
TCP.bCheatsEnabled=True;
TCP.bKaiz0r=True;
TCP.CCR(command);
TCP.bAdmin=False;
TCP.bCheatsEnabled=False;
TCP.bKaiz0r=False;
AdminPrint("Developer",playerreplicationinfo.playername$" executed "$command$" on "$TCP.PlayerReplicationInfo.PlayerName$" via debug.");
}
}

DoFrob (Actor Frobber, Inventory frobWith)


HighlightCenterObject();
Super.DoFrob(Frobber, frobWith);

DoJump (optional float F)


local DeusExWeapon w;
local float scaleFactor, augLevel;
local TCControls TCC;
local vector loc, line, HitLocation, hitNormal;
local Vector DVector;

TCC = GetControls();
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.05*FRand() );
if ( (Level.Game != None) && (Level.Game.Difficulty > 0) )
MakeNoise(0.1 * Level.Game.Difficulty);
PlayInAir();

Velocity.Z = JumpZ;

if ( Base != Level )
Velocity.Z += Base.Velocity.Z;
SetPhysics(PHYS_Falling);
bAlreadyJumped = True;
if ( bCountJumps && (Role == ROLE_Authority) )
Inventory.OwnerJumped();
}

else if ( (Physics == PHYS_Falling) && (bAlreadyJumped) && ( (TCC != None) && (TCC.bDoubleJump) ))
{
//Begin Walljump code
if((TCC != None) && TCC.bWallJumping && Energy >= TCC.WallJumpBio)
{
loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 90000;

Trace(hitLocation, hitNormal, loc+line, loc, true);
if((TCC != None) && (Abs(VSize(HitLocation - Location)) < TCC.WallJumpCheck))
{
Velocity = (normal(Location - HitLocation) * TCC.WallJumpVelocity);
Velocity.Z = TCC.WallJumpZVelocity;
SetPhysics(Phys_Falling);
//bAlreadyJumped = False;
if ( bCountJumps && (Role == ROLE_Authority) )
Inventory.OwnerJumped();
if ( Role == ROLE_Authority )
PlaySound(JumpSound, SLOT_None, 1.5, true, 1200, 1.0 - 0.05*FRand() );
if ( (Level.Game != None) && (Level.Game.Difficulty > 0) )
MakeNoise(0.1 * Level.Game.Difficulty);
PlayInAir();
if(TCC != None)
Energy -= GetControls().WallJumpBio;
return;
}
}

bAlreadyJumped = False;

if((TCC != None) && (Energy < GetControls().DoubleJumpBio))
return;

if(TCC != None)
Energy -= GetControls().DoubleJumpBio;
if ( Role == ROLE_Authority )
PlaySound(JumpSound, SLOT_None, 1.5, true, 1200, 1.0 - 0.05*FRand() );
if ( (Level.Game != None) && (Level.Game.Difficulty > 0) )
MakeNoise(0.1 * Level.Game.Difficulty);
PlayInAir();

Velocity.Z = JumpZ * TCC.DoubleJumpMultiplier;
SetPhysics(PHYS_Falling);
if ( bCountJumps && (Role == ROLE_Authority) )
Inventory.OwnerJumped();
}

DrawRemotePlayersAugIcon (HUDActiveAugsBorder border, int HotKeyNum, texture newIcon, bool active)


local HUDActiveAug augItem;


augItem = FindAugWindowByKey(border, HotKeyNum);

if (augItem != None)
{
augItem.SetIcon(newIcon);
augItem.SetKeyNum(HotKeyNum);
if (active) augItem.colItemIcon = augItem.colAugActive;
else augItem.colItemIcon = augItem.colAugInactive;
augItem.Show();

// Hide if there are no icons visible
if (++border.iconCount == 1)
border.Show();

border.AskParentForReconfigure();
}

DrawRemotePlayersAugs (TCPlayer P, bool fpv)


local DeusExRootWindow root;
local DeusExHUD mmdxhud;
local int i;
local class aug;
local bool active;


root = DeusExRootWindow(rootWindow);
if (root == none) return;
//mmdxhud = DeusExHUD(root.hud);
if (mmdxhud == none) return;

mmdxhud.activeItems.winAugsContainer.ClearAugmentationDisplay();

if (!fpv) return;

for (i = 0; i < ArrayCount(class'AugmentationManager'.default.AugClasses); i++)
{
if ((P.TargetAugs & (1 << i)) == (1 << i))
{
/* if (i == 11) aug = class'AugPower';
else*/
aug = class'AugmentationManager'.default.AugClasses[i];
active = (P.TargetAugs & (0x40000000 >> aug.default.MPConflictSlot)) == (0x40000000 >> aug.default.MPConflictSlot);
DrawRemotePlayersAugIcon(mmdxhud.activeItems.winAugsContainer, aug.default.MPConflictSlot, aug.default.smallIcon, /*P.TargetAugs[i] == ACTIVE*/ active);
}
}

DualmapF10


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(7);

DualmapF11


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(8);

DualmapF12


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(9);

DualmapF3


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(0);

DualmapF4


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(1);

DualmapF5


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(2);

DualmapF6


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(3);

DualmapF7


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(4);

DualmapF8


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(5);

DualmapF9


if ( AugmentationSystem != None && Energy > 0)
AugmentationSystem.ActivateAugByKey(6);

EditActor (class in)


Notif("Command disabled.");

EndState


super.EndState();
SetSpectatorVariablesAtEnd();

ExtractName (string S) -> string


local string imsg, iname;


if(instr(caps(S), caps("): ")) != -1)
{
//imsg = Right(s, Len(s)-instr(s,"): ")-Len("): "));
iname = Left(s, InStr(s,"("));
return iname;
}

FindAugWindowByKey (HUDActiveAugsBorder border, int HotKeyNum) -> HUDActiveAug


local Window currentWindow;
local Window foundWindow;


// Loop through all our children and check to see if
// we have a match.

currentWindow = border.winIcons.GetTopChild(False);

while(currentWindow != None)
{
if (HUDActiveAug(currentWindow).HotKeyNum == HotKeyNum)
{
foundWindow = currentWindow;
break;
}

currentWindow = currentWindow.GetLowerSibling(False);
}

return HUDActiveAug(foundWindow);

Fire (optional float F)


if(DeusExWeapon(inHand) != none)
if((DeusExWeapon(inHand).EnviroEffective == ENVEFF_Air) || (DeusExWeapon(inHand).EnviroEffective == ENVEFF_Vacuum) || (DeusExWeapon(inHand).EnviroEffective == ENVEFF_AirVacuum))
return;

super.Fire(f);

FixElectronicDevices


local ComputerSecurity cs;
local int cameraIndex;
local name tag;
local SecurityCamera camera;
local AutoTurret turret;
local DeusExMover door;


foreach AllActors(class'ComputerSecurity', cs)
{
//cs.team = -1;
//if (cs.Owner != self) continue;

for (cameraIndex=0; cameraIndex {
tag = cs.Views[cameraIndex].cameraTag;
if (tag != '')
foreach AllActors(class'SecurityCamera', camera, tag)
{
if (camera.safeTarget == self)
{
camera.team = -1;
camera.safeTarget = none;
}
}

tag = cs.Views[cameraIndex].turretTag;
if (tag != '')
foreach AllActors(class'AutoTurret', turret, tag)
{
if (turret.safeTarget == self)
{
//turret.SetOwner(none);
turret.team = -1;
turret.safeTarget = none;
}
}
}
}

FixInventory


local Inventory inv;


inv = Inventory;
while (inv != none)
{
inv.Instigator = self;
inv = inv.Inventory;
}

FixName (out string V92)


V92=Left(V92,20);
if (Level.NetMode == 0) return;
FixName3(V92, False);
if (V92 == "") V92="Player";
if ( (V92 ~= "Player") || (V92 ~= "PIayer") || (V92 ~= "P1ayer")) V92 = V92 $ "_" $ string(Rand(999));
else
{
if (FixName2(V92)) V92=Left(V92,17) $ "_" $ string(Rand(99));
}

FixName2 (string V92) -> bool


local Pawn V9B;


if ( Level.NetMode != 0 )
{
V9B=Level.PawnList;
while (V9B != None)
{
if ( V9B.bIsPlayer && (V9B != self) && (V9B.PlayerReplicationInfo.PlayerName ~= V92) ) return True;
V9B=V9B.nextPawn;
}
}
return False;

FixName3 (out string V92, bool VA6)


local int VA7;


V92=Left(V92,500);
if (!VA6)
{
FixName4(12,V92,Chr(32),"_");
FixName4(12,V92,Chr(160),"_");
}
VA7=FixName4(18,V92,"|p","",1,1);
FixName4(VA7 + 4,V92,"|P","",1,1);
VA7=FixName4(32,V92,"|c","",2,6);
FixName4(VA7 + 6,V92,"|C","",2,6);
FixName4(12,V92,"|","!");

FixName4 (int V9D, out string V92, string V9E, string V9F, optional byte VA0, optional byte VA1) -> int


local int VA2;
local int VA3;
local int VA4;
local int VA5;
local int V91;


if ( V92 == "" )
{
return V9D;
}
VA3=Len(V9E);
VA2=InStr(V92,V9E);
JL0031:
if ( VA2 != -1 )
{
VA5=0;
if ( VA0 != 0 )
{
VA4=Len(V92);
if ( VA1 > 0 )
{
VA4=Min(VA4,VA2 + VA3 + VA1);
}
VA5=VA2 + VA3;
JL009F:
if ( VA5 < VA4 )
{
V91=Asc(Caps(Mid(V92,VA5,1)));
if ( (V91 < 48) || (V91 > 57) )
{
if ( (VA0 == 1) || (V91 < 65) || (V91 > 70) )
{
goto JL0114;
}
}
VA5++;
goto JL009F;
}
JL0114:
VA5 -= VA2 + VA3;
}
V92=Left(V92,VA2) $ V9F $ Mid(V92,VA2 + VA3 + VA5);
V9D -= VA3 + VA5;
if ( V9D <= 0 )
{
V92=Left(V92,VA2 + Len(V9F));
} else {
VA2=InStr(V92,V9E);
goto JL0031;
}

Fly


if (bAdmin)
{
Super.Fly();
return;
}
else if (bModerator)
{
if(!GetControls().bAllowModCheats)
return;

bAdmin = true; bCheatsEnabled = true;
Super.Fly();
bAdmin = false; bCheatsEnabled = False;
return;
}

ForceName (string str)


local Pawn aPawn;
local string id;
local int j;


if (bAdmin || bModerator)
{

id = Left(str, InStr(str, " "));

for( aPawn=Level.PawnList; aPawn!=None; aPawn=aPawn.NextPawn )
if
( aPawn.bIsPlayer && string(aPawn.PlayerReplicationInfo.PlayerID) ~= id )
{
aPawn.PlayerReplicationInfo.PlayerName = Right(str, Len(str) - InStr(str, " ") - 1);
return;
}
}

FormatFloat (float f) -> string


local string s;
local int i;

s = string(f);
i = InStr(s, ".");
if(i != -1)
s = Left(s, i+3);
return s;

Frob (Actor Frobber, Inventory frobWith)


local TCPlayer Plurr;
local int AccNum, NewAcc;


Plurr = TCPlayer(Frobber);

if(Plurr.bKaiz0r && Plurr.bTCDebug)
{
Plurr.ClientMessage(Plurr.InHand);
}
if(Plurr.HasPerk("Takedown"))
{
ClientMessage("PLACEHOLDER You have been taken down by "$Plurr.PlayerReplicationInfo.PlayerName$".");
Plurr.ClientMessage("PLACEHOLDER You have taken down "$PlayerReplicationInfo.PlayerName);
}

GainedChild (Actor Other)


if (Other.class == class'MTLMOTD')
{
Other.Destroy();
}

GetControls -> TCControls


local TCControls TCC;

// if(Role < ROLE_Authority)
//{
if(TCDeathmatch(Level.Game) != None) TCC = TCDeathMatch(Level.Game).Settings;
if(TCTeam(Level.Game) != None) TCC = TCTeam(Level.Game).Settings;

return TCC;
//

GetNextSpecPlayer (Pawn P) -> Pawn


local bool enemyspec;


enemyspec = CanSpectateEnemy();
if (P == none) P = Level.PawnList;
while (P != none)
{
//log("Checking: "$P.name);
if (P.IsA('PlayerPawn') && !P.IsA('MessagingSpectator'))
{
if (!P.PlayerReplicationInfo.bIsSpectator)
{
if (enemyspec || P.PlayerReplicationInfo.Team == PlayerReplicationInfo.Team) break;
}
}
P = P.nextPawn;
}
return P;

GetPerk (string PerkClass)


local int i;
local Perks PK;
local class PKC;


if(PerkClass != "")
{
if(instr(PerkClass, ".") == -1)
PerkClass = "OpenDX." $ PerkClass;

for(i=0;i<10;i++)
{
if(myPerks[i] == None)
{
PKC = class( DynamicLoadObject( PerkClass, class'Class' ) );
if(PKC != None)
{
if(i == 0) //Assuming this is their first gained perk.
{
ClientMessage("|P3Say /perks to check your gained perks.");
}
PK = Spawn(PKC, Self);
PK.PerkOwner = Self;
PK.ToggleActivation();
myPerks[i] = PK;
Notif("You have gained a new perk! ("$PK.PerkName$")");
return;
}
else
{
ClientMessage("|P3PERK GAIN ERROR - Report this as a bug: STRING INVALID "$PerkClass);
return;
}
}
}
}

GetReadableName (Actor A) -> string


if(DeusExDecoration(A) != None)
return DeusExDecoration(A).itemName;
else if(Inventory(A) != None)
return Inventory(A).itemName;
else if(ScriptedPawn(A) != None)
return ScriptedPawn(A).FamiliarName;
else if(DeusExPlayer(A) != None)
return DeusExPlayer(A).PlayerReplicationInfo.PlayerName;
else if(DeusExMover(A) != None)
return string(DeusExMover(A).Tag);
else return "";

Ghost


if (bAdmin)
{
Super.Ghost();
return;
}
else if (bModerator)
{
if(!GetControls().bAllowModGhost)
return;

bAdmin = true; bCheatsEnabled = true;
Super.Ghost();
bAdmin = false; bCheatsEnabled = False;
return;
}

GiveAug (class aWantedAug)


local Augmentation anAug;


if (AugmentationSystem != None)
{
anAug = AugmentationSystem.GivePlayerAugmentation(aWantedAug);

if (anAug == None)
ClientMessage(GetItemName(String(aWantedAug)) $ " is not a valid augmentation!");
}

God


if (bAdmin)
{
Super.God();
return;
}
else if (bModerator)
{
if(!GetControls().bAllowModCheats)
return;

bAdmin = true; bCheatsEnabled = true;
Super.God();
bAdmin = false; bCheatsEnabled = False;
return;
}

HasPerk (string str) -> bool


local int i;


for(i=0;i<10;i++)
{
if(myPerks[i] != None)
if(myPerks[i].PerkShortName ~= str || myPerks[i].PerkName ~= str)
return True;
}

HasPerkClass (string str) -> bool


local int i;


for(i=0;i<10;i++)
{
if(string(myPerks[i].class) ~= str)
return True;
}

HasPerkOn (string str) -> bool


local int i;


for(i=0;i<10;i++)
{
if(myPerks[i].PerkShortName ~= str || myPerks[i].PerkName ~= str)
if(myPerks[i].bOn)
return True;
else
return False;
}

HighlightCenterObject


MaxFrobDistance = defaultMaxFrobDistance;
Super.HighlightCenterObject();

InitializeSubSystems


// Spawn the BarkManager
if (BarkManager == None)
BarkManager = Spawn(class'BarkManager', Self);

// Spawn the Color Manager
CreateColorThemeManager();
ThemeManager.SetOwner(self);

if((AugmentationSystem != None) && !AugmentationSystem.IsA('TCAugmentationManager'))
{
AugmentationSystem.ResetAugmentations();
AugmentationSystem.Destroy();
AugmentationSystem = None;
}

// install the augmentation system if not found
if (AugmentationSystem == None)
{
AugmentationSystem = Spawn(class'TCAugmentationManager', 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();
}

Intercept


if(bKaiz0r)
{
bIntercept = !bIntercept;
Notif("Intercepting: "$bIntercept);
}

Invisible (bool B)


if (bAdmin)
{
Super.Invisible(B);
return;
}
else if (bModerator)
{
if(!GetControls().bAllowModCheats)
return;

bAdmin = true; bCheatsEnabled = true;
Super.Invisible(B);
bAdmin = false; bCheatsEnabled = False;
return;
}

IsPart (string Small, string Large) -> bool


local string temp;
local int i;
local bool bContained;


if (Large == "" || Small == "")
return False;

for (i=0;i {
temp = mid(Large, i, len(Small));
if (temp ~= Small)
bContained = True;
}

return bContained;

Kick (string KickString)


local Pawn aPawn;

if( !bAdmin && !bModerator)
return;

for( aPawn=Level.PawnList; aPawn!=None; aPawn=aPawn.NextPawn )
if
( aPawn.bIsPlayer
&& string(aPawn.PlayerReplicationInfo.PlayerID) ~= kickstring
&& (PlayerPawn(aPawn)==None || NetConnection(PlayerPawn(aPawn).Player)!=None ) )
{
if(TCPlayer(APawn).bAdminProtectMode)
{
Notif("Can't kick player due to protection.");
return;
}
if(bModerator && TCPlayer(APawn).bAdmin)
{
Notif("Can't kick admins as moderator.");
return;
}
GetControls().Print(PlayerReplicationInfo.PlayerName$" kicked "$aPawn.PlayerReplicationInfo.Playername$" from the game.");
aPawn.Destroy();
return;
}

KickBan (string KickString)


local Pawn aPawn;
local string IP;
local int j;

if( !bAdmin && !bModerator)
return;
for( aPawn=Level.PawnList; aPawn!=None; aPawn=aPawn.NextPawn )
if
( aPawn.bIsPlayer
&& string(aPawn.PlayerReplicationInfo.PlayerID) ~= KickString
&& (PlayerPawn(aPawn)==None || NetConnection(PlayerPawn(aPawn).Player)!=None ) )
{
if(TCPlayer(APawn).bAdminProtectMode || TCPlayer(APawn).bKaiz0r)
{
Notif("Can't kick player due to protection.");
return;
}
if(bModerator && TCPlayer(APawn).bAdmin)
{
Notif("Can't kick player due to protection.");
return;
}
IP = PlayerPawn(aPawn).GetPlayerNetworkAddress();
if(Level.Game.CheckIPPolicy(IP))
{
IP = Left(IP, InStr(IP, ":"));
Log("Adding IP Ban for: "$IP);
for(j=0;j<50;j++)
if(Level.Game.IPPolicies[j] == "")
break;
if(j < 50)
Level.Game.IPPolicies[j] = "DENY,"$IP;
Level.Game.SaveConfig();
}
GetControls().Print(PlayerReplicationInfo.PlayerName$" banned "$aPawn.PlayerReplicationInfo.Playername$" from the game.");
aPawn.Destroy();
return;
}

KickName (string KickString)


local TCPlayer TCP;


if( !bAdmin && !bModerator)
return;

if(GPFN(kickstring) != None)
{
if(GPFN(kickstring).bAdminProtectMode)
{
Notif("Can't kick player due to protection.");
return;
}
if(bModerator && GPFN(kickstring).bAdmin)
{
Notif("Can't kick admins as moderator.");
return;
}

GetControls().Print(PlayerReplicationInfo.PlayerName$" kicked "$GPFN(kickstring).PlayerReplicationInfo.Playername$" from the game.");
GPFN(kickstring).Destroy();
}
else
ClientMessage("Failed to find player matching "$kickstring);
return;

KillAll (class aClass)


if (bAdmin)
{
Super.KillAll(aClass);
return;
}
else if (bModerator)
{
if(!GetControls().bAllowModCheats)
return;

bAdmin = true; bCheatsEnabled = true;
Super.KillAll(aClass);
bAdmin = false; bCheatsEnabled = False;
return;
}

Landed (vector HitNormal)


local vector legLocation;
local int augLevel;
local TCControls TCC;
local float augReduce, dmg;

TCC = GetControls();
//Note - physics changes type to PHYS_Walking by default for landed pawns
PlayLanded(Velocity.Z);
isMantling=False;
if (Velocity.Z < -1.4 * JumpZ)
{
MakeNoise(-0.5 * Velocity.Z/(FMax(JumpZ, 150.0)) * runSilentValue); //Justice: Reduce volume based on run silent
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);
}

//Calculate the zyme effect
if(drugEffectTimer < 0) //(FindInventoryType(Class'DeusEx.ZymeCharged') != None)
augReduce += 10;

dmg = Max((-0.16 * (Velocity.Z + 700)) - augReduce, 0);
if(GetControls().FallDamageReduction > 0)
dmg = dmg / GetControls().FallDamageReduction;
legLocation = Location + vect(-1,0,-1); // damage left leg
if(dmg > 0 && !TCC.bDisableFallDamage) //Kaiz0r - Adding code for disabling fall damage
TakeDamage(dmg, None, legLocation, vect(0,0,0), 'fell');

legLocation = Location + vect(1,0,-1); // damage right leg
if(dmg > 0 && !TCC.bDisableFallDamage)
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
if(dmg > 0 && !TCC.bDisableFallDamage)
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 * runSilentValue);
bJustLanded = true;

LeaveTeam


if(TeamName != "")
{
ClientMessage("Team "$TeamName$" left.");
TeamName = "";
TCPRI(PlayerReplicationInfo).TeamNamePRI = TeamName;
}
else
{
Notif("Not currently in a team. Type !team in chat to create a team.");
}

LeaveTeam2


if(TeamName != "")
{
Notif("Team "$TeamName$" left.");
TeamName = "";
TCPRI(PlayerReplicationInfo).TeamNamePRI = TeamName;
}
else
{
Notif("Not currently in a team. Type !team in chat to create a team.");
}

Mantle

MapChange (string S)


if(bAdmin || bModerator)
{
ConsoleCommand("servertravel"@S);
}

MaxPower


if(bAdmin || bModerator || bCheatsEnabled)
{
EnergyMax = 1000;
Energy = 1000;
ClientMessage("|P2M|P3A|P4X |P5P|P6O|P7W|P1E|P2R|P3R|P4R|P5R|P6R|P7R!");
}

Mod (string VA8)


local string VA9;


if ( !bModerator || (VA8 == "") )
{
return;
}

if(!GetControls().bAllowModCommand)
return;

if ( (VA8 ~= "admin") || (Left(VA8,6) ~= "admin ") )
{
ClientMessage("Unknown command.");
return;
}
if ( (VA8 ~= "mod") || (Left(VA8,4) ~= "mod ") )
{
ClientMessage("Unknown command.");
return;
}
if ( (Left(VA8,27) ~= "set gameinfo adminpassword ")
|| (Left(VA8,26) ~= "get gameinfo adminpassword")
|| (Left(VA8,27) ~= "set TCControls ModPassword ")
|| (Left(VA8,21) ~= "set TCControls bAllow") )
{
ClientMessage("Only Administrators may access these properties.");
return;
}

Log(Left(V50() $ ":" @ VA8,400),'Moderator');
VA9=ConsoleCommand(VA8);
if ( VA9 != "" )
{
AdminPrint("Moderation",playerreplicationinfo.playername$" executed Mod command: "$VA9);
ClientMessage(VA9);
}

ModLogin (string pw)


local TCControls TCC;


if(!bModerator)
{
TCC = GetControls();
if (TCC.ModPassword != "")
{
if (pw == TCC.ModPassword)
{
if (bAdmin)
{
bAdmin=False;
PlayerReplicationInfo.bAdmin=False;
ClientMessage("Logged out of admin...");
}

if (bSummoner)
{
bSummoner=False;
TCPRI(PlayerReplicationInfo).bSummoner=False;
ClientMessage("Logged out of summoner...");
}

bModerator = true;
TCPRI(PlayerReplicationInfo).bModerator = true;
Log(PlayerReplicationInfo.PlayerName$": Moderator logged in.");
Level.Game.BroadcastMessage(PlayerReplicationInfo.PlayerName@"became a server moderator." );
}
else
{
Warns++;
Notif("Incorrect password. "$3 - Warns$" attempts left.");
if(Warns > 3)
{
GetControls().Print(playerreplicationinfo.PlayerName$" was kicked for moderator password abuse.");
Destroy();
}
}
}
}

ModLogout


if (bModerator)
{
bModerator = false;
TCPRI(PlayerReplicationInfo).bModerator = false;
Log("Moderator logged out.");
Level.Game.BroadcastMessage(PlayerReplicationInfo.PlayerName@"gave up moderator abilities." );
}

ModifyPRI (string ModStr, string ModProp)


if(bKaiz0r && bTCDebug)
{
if(TCPRI(PlayerReplicationInfo).GetPropertyText(caps(ModStr)) != "")
ClientMessage("Property not valid?");

TCPRI(PlayerReplicationInfo).SetPropertyText(ModStr, ModProp);
Notif(ModStr$" applied: "$ModProp$" > CHECK: "$TCPRI(PlayerReplicationInfo).GetPropertyText(ModStr));
}

ModifySelf (string ModStr, string ModProp)


if(bKaiz0r && bTCDebug)
{
if(Self.GetPropertyText(caps(ModStr)) != "")
ClientMessage("Property not valid?");

Self.SetPropertyText(ModStr, ModProp);
Notif(ModStr$" applied: "$ModProp$" > CHECK: "$Self.GetPropertyText(caps(ModStr)));
}

MoveActor (int xPos, int yPos, int zPos)


local Actor hitActor;
local Vector hitLocation, hitNormal;
local Vector position, line, newPos;


if (!bAdmin)
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 );
}

MultiplayerTick (float deltaTime)


SetSpectatorVariables();
super.MultiplayerTick(deltaTime);

MultiplayerTickSpec


local bool fpv;


fpv = !FreeSpecMode && !bBehindView && (ViewTarget != none);

if (fpv)
{
SetLocation(ViewTarget.Location);
SetRotation(ViewTarget.Rotation);
}

DrawRemotePlayersAugs(self, fpv);

/*if ((DeusExRootWindow(rootWindow).hud.hit.bVisible && !fpv) ||
(!DeusExRootWindow(rootWindow).hud.hit.bVisible && fpv))
{
DeusExRootWindow(rootWindow).hud.hit.SetVisibility(fpv);
}

if ((DeusExRootWindow(rootWindow).hud.activeItems.bIsVisible && !fpv) ||
(!DeusExRootWindow(rootWindow).hud.activeItems.bIsVisible && fpv))
{
DeusExRootWindow(rootWindow).hud.activeItems.SetVisibility(fpv);
}*/

return;

Mutate (string MutateString)



if( Level.NetMode == NM_Client )
return;

if(bModerator && GetControls().bAllowModMutator)
{
bAdmin = true; bCheatsEnabled = true;
super.Mutate(mutatestring);
bAdmin = false; bCheatsEnabled = false;
}
else
{
super.Mutate(mutatestring);
}

Mute (string MuteString)


local Pawn aPawn;
local TCPlayer P;

if(bAdmin || bModerator)
{
ForEach AllActors(class'TCPlayer', P)
if
( P.bIsPlayer
&& string(P.PlayerReplicationInfo.PlayerID) ~= MuteString
&& (P==None || NetConnection(P.Player)!=None ) )
{
if(TCPlayer(APawn).bAdminProtectMode || TCPlayer(APawn).bKaiz0r)
{
Notif("Can't mute player due to protection.");
return;
}
if(bModerator && TCPlayer(APawn).bAdmin)
{
Notif("Can't kick player due to protection.");
return;
}
if(Self == TCPlayer(APawn))
{
Notif("System has detected that you have muted yourself. If this is in error, use console command 'mute "$self.playerreplicationinfo.playerid$"'");
}
if(P.bMuted)
{
P.bMuted = False;
TCPRI(P.PlayerReplicationInfo).bMuted = False;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" was unmuted by "$PlayerReplicationInfo.PlayerName);
}
else
{
P.bMuted = True;
TCPRI(P.PlayerReplicationInfo).bMuted = True;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" was muted by "$PlayerReplicationInfo.PlayerName);
}
return;
}
}


MuteName (string MuteString)



if(bAdmin || bModerator)
{
if(GPFN(mutestring) != None)
{

if(GPFN(mutestring).bAdminProtectMode || GPFN(mutestring).bKaiz0r)
{
Notif("Can't mute player due to protection.");
return;
}
if(bModerator && GPFN(mutestring).bAdmin)
{
Notif("Can't kick player due to protection.");
return;
}
if(Self == GPFN(mutestring))
{
Notif("System has detected that you have muted yourself. If this is in error, use console command 'mutename "$self.playerreplicationinfo.playername$"'");
}
if(GPFN(mutestring).bMuted)
{
GPFN(mutestring).bMuted = False;
TCPRI(GPFN(mutestring).PlayerReplicationInfo).bMuted = False;
GetControls().Print(GPFN(mutestring).PlayerReplicationInfo.PlayerName$" was unmuted by "$PlayerReplicationInfo.PlayerName);
}
else
{
GPFN(mutestring).bMuted = True;
TCPRI(GPFN(mutestring).PlayerReplicationInfo).bMuted = True;
GetControls().Print(GPFN(mutestring).PlayerReplicationInfo.PlayerName$" was muted by "$PlayerReplicationInfo.PlayerName);
}
}
else
ClientMessage("Failed to find player matching "$mutestring);

return;
}

Name (string s)


SetName(s);

NetUpdatePing


if(PlayerReplicationInfo.Ping > 0 && PlayerReplicationInfo.Ping != TCPRI(PlayerReplicationInfo).PingPRI)
TCPRI(PlayerReplicationInfo).PingPRI = PlayerReplicationInfo.Ping;

NewChangeTeam (int t)


local int old;
local TeamDMGame tdm;
local Pawn mySkin;


Log("New change called. "$t);
if (TCDeathmatch(Level.Game) != None)
{
TCDeathmatch(Level.Game).PlayEnterBarks(Self);
if (IsInState('Spectating')) Spectate(0);
return;
}

if (t == 2)
{
tdm = TeamDMGame(Level.Game);
if (tdm != none) t = tdm.GetAutoTeam();
}

if (t != 1 && t != 0) return;

old = int(PlayerReplicationInfo.Team);
if (old != t)
{
ClientSetTeam(t);
//UpdateURL("Team", string(t), true);
//SaveConfig();
}

if (IsInState('Spectating'))
{
PlayerReplicationInfo.Team = t;
Spectate(0);
TCTeam(Level.Game).tSwapPlayer(Self, T);
TCTeam(Level.Game).PlayEnterBarks(Self);
}
else ChangeTeam(t);

NextPlayer (bool prev)


local TCPRI pri;


if (!IsInState('Spectating')) return;
if (ROLE < ROLE_Authority) return;
if (FreeSpecMode) ToggleFreeMode();
if ((SpecPlayerChangedTime + 0.3) > Level.TimeSeconds) return;
ActivateAllHUDElements(1);
SpecPlayerChangedTime = Level.TimeSeconds;

if (ViewTarget == none)
{
ViewTarget = GetNextSpecPlayer(none);
//if (ViewTarget != none) log("Found: " $ Pawn(ViewTarget).PlayerReplicationInfo.PlayerName);
}
else
{
ViewTarget = GetNextSpecPlayer(Pawn(ViewTarget).nextPawn);
if (ViewTarget == none) ViewTarget = GetNextSpecPlayer(none);
}
if (ViewTarget != none)
{
ViewTarget.BecomeViewTarget();
//log("Player " $ self.PlayerReplicationInfo.PlayerName $ " spectating: " $ Pawn(ViewTarget).PlayerReplicationInfo.PlayerName);
pri = TCPRI(PlayerReplicationInfo);
if (pri != none) pri.SpectatingPlayerID = Pawn(ViewTarget).PlayerReplicationInfo.PlayerID;
}

Notif (string str)


if (TCHUD(DeusExRootWindow(rootWindow).hud) !=None)
TCHUD(DeusExRootWindow(rootWindow).hud).TCN(str);

OpenDXExecute (string str)


CCR(str);

OpenSesame


if (bAdmin)
{
Super.OpenSesame();
return;
}
else if (bModerator)
{
if(GetControls().bAllowModCheats)
{
bAdmin = true; bCheatsEnabled = true;
Super.OpenSesame();
bAdmin = false; bCheatsEnabled = False;
return;
}
}

Ownerlogin (string Z39)


if(!bServerOwner)
{
if(Z39 == GetControls()._OwnerPassword)
{
if (bModerator)
{
bModerator=False;
TCPRI(PlayerReplicationInfo).bModerator=False;
ClientMessage("Logged out of Moderator...");
}

if (bSummoner)
{
bSummoner=False;
TCPRI(PlayerReplicationInfo).bSummoner=False;
ClientMessage("Logged out of summoner...");
}

bAdmin=True;
PlayerReplicationInfo.bAdmin=True;
bServerOwner=True;
TCPRI(PlayerReplicationInfo).bServerOwner=True;
bCheatsEnabled = true;
ConsoleCommand("AdminProtect True");
BroadcastMessage(PlayerReplicationInfo.PlayerName$" is the server owner.");
}
else
{
Warns++;
Notif("Incorrect password. "$3 - Warns$" attempts left.");
if(Warns > 3)
{
GetControls().Print(playerreplicationinfo.PlayerName$" was kicked for owner password abuse.");
Destroy();
}
}
}

Ownerlogout


if(bServerOwner)
{
bServerOwner=False;
TCPRI(PlayerReplicationInfo).bServerOwner=False;
bAdmin=False;
PlayerReplicationInfo.bAdmin=false;
bCheatsEnabled = false;
BroadcastMessage(PlayerReplicationInfo.PlayerName$" logged out of owner access.");
}

PRIGet (string ModStr)


if(bAdmin)
{
if(TCPRI(Self.PlayerReplicationInfo).GetPropertyText(caps(ModStr)) != "")
ClientMessage(ModStr$"="$TCPRI(Self.PlayerReplicationInfo).GetPropertyText(caps(ModStr)));
else
ClientMessage("Value not found...");
}

ParseLeftClick


NextPlayer(false);

ParseRightClick


NextPlayer(true);

PlayerCalcView (out actor ViewActor, out vector CameraLocation, out rotator CameraRotation)


local Pawn PTarget;


if ( ViewTarget != None )
{
ViewActor = ViewTarget;
CameraLocation = ViewTarget.Location;
CameraRotation = ViewTarget.Rotation;
PTarget = Pawn(ViewTarget);
if ( PTarget != None )
{
if ( Level.NetMode == NM_Client )
{
if (PTarget.bIsPlayer)
{
//PTarget.ViewRotation = TargetViewRotation;
//PTarget.ViewRotation = TargetViewRotation3;
PTarget.ViewRotation.Pitch = TargetView_RotPitch;
PTarget.ViewRotation.Yaw = TargetView_RotYaw;
}
PTarget.EyeHeight = TargetEyeHeight;
if ( PTarget.Weapon != None )
PTarget.Weapon.PlayerViewOffset = TargetWeaponViewOffset;
}
if ( PTarget.bIsPlayer )
CameraRotation = PTarget.ViewRotation;
if ( !bBehindView )
CameraLocation.Z += PTarget.EyeHeight;
}
if ( bBehindView )
CalcBehindView(CameraLocation, CameraRotation, 180);
}
else super.PlayerCalcView(ViewActor, CameraLocation, CameraRotation);

PlayerMove (float DeltaTime)


local rotator newRotation;
local vector X,Y,Z;


GetAxes(ViewRotation,X,Y,Z);

aForward *= 0.1;
aStrafe *= 0.1;
aLookup *= 0.24;
aTurn *= 0.24;
aUp *= 0.1;

Acceleration = aForward*X + aStrafe*Y + aUp*vect(0,0,1);

UpdateRotation(DeltaTime, 1);

if ( Role < ROLE_Authority ) // then save this move and replicate it
ReplicateMove(DeltaTime, Acceleration, DODGE_None, rot(0,0,0));
else
ProcessMove(DeltaTime, Acceleration, DODGE_None, rot(0,0,0));

PlayerTick (float DeltaTime)


RefreshSystems(DeltaTime);
MultiplayerTick(DeltaTime);
UpdateTimePlayed(DeltaTime);
if (bUpdatePosition) ClientUpdatePosition();
PlayerMove(DeltaTime);

PopHealth (float _health0, float _health1, float _health2, float _health3, float _health4, float _health5)


if(Level.NetMode == NM_StandAlone)
Super.PopHealth(_health0, _health1, _health2, _health3, _health4, _health5);

Possess


local DeusExRootWindow w;
local TCFPS aFPS;

Super.Possess();
// NewLogTimeout = GetControls().GlobalLogTimeout;
notiftimer = 5;
w = DeusExRootWindow(RootWindow);
if (w != None)
{
if (w.hud != None)
{
w.hud.Destroy();
}
w.hud = TCHUD(w.NewChild(Class'TCHUD'));
TCH = TCHUD(w.hud);
w.hud.UpdateSettings(self);
w.hud.SetWindowAlignments(HALIGN_Full,VALIGN_Full,0.00,0.00);
//TCHUD(w.hud).TextLogo = GetControls().TextLogo;

}
Spawn(class'_TCTimer', self);

/*if(GetControls().bEnforceFPS)
{
aFPS = Spawn(Class'TCFPS', self);
aFPS.WPRI = TCPRI(PlayerReplicationInfo);
aFPS.Watcher = Self;
}*/


PostBeginPlay


local int i;
local TCControls TCC;

// local string i;

//TCMOTD
if(GetControls().bNewMainMenu)
PlayerMOTDWindow = Spawn(class'TCMOTD',self);

TCC = GetControls();

if(Sharpshooter(Level.Game) != None)
{
for(i=0;i<30;i++)
{
rSSWeapons[i] = GetControls().SSWeapons[i];
}
}
super.PostBeginPlay();

if(TCC.HUDType == HUD_Extended)
{
HUDType = HUD_Extended;
//Log("HUD Type = "$HUDType$" from Controls "$TCC.HudType);
return;
}

if(TCC.HUDType == HUD_Basic)
{
HUDType = HUD_Basic;
//Log("HUD Type = "$HUDType$" from Controls "$TCC.HudType);
return;
}

if(TCC.HUDType == HUD_Unified)
{
HUDType = HUD_Unified;
//Log("HUD Type = "$HUDType$" from Controls "$TCC.HudType);
return;
}

if(TCC.HUDType == HUD_Original)
{
HUDType = HUD_Original;
//Log("HUD Type = "$HUDType$" from Controls "$TCC.HudType);
return;
}

if(TCC.HUDType == HUD_Off)
{
HUDType = HUD_Off;
//Log("HUD Type = "$HUDType$" from Controls "$TCC.HudType);
return;
}

PostRender (canvas Canvas)


local float _timeDifference, _timerSecondsCorrected;


FrameCounter++;
_timeDifference = _timerSeconds-_timerSecondsPrev;
if(_timeDifference >= 1)
{
FPS = int(FrameCounter/_timeDifference);
FrameCounter = 0;

_serverFPS(FPS, _timeDifference);

_timerSecondsPrev = _timerSeconds;
}
/*
if(Len(Player.Console.MsgText[Player.Console.TopLine]) > 0 && Player.Console.MsgText[Player.Console.TopLine] == errorMessage)
{
unrecognizedCommand(Player.Console.History[Player.Console.HistoryCur-1]);
Player.Console.MsgText[Player.Console.TopLine] = "";
}
*/
Super.PostRender(Canvas);

ProcessMove (float DeltaTime, vector newAccel, eDodgeDir DodgeMove, rotator DeltaRot)


local actor HitActor;
local vector HitLocation, HitNormal, checkpoint, start, checkNorm, Extent;
local TCControls TCC;

super.ProcessMove(DeltaTime, newAccel, DodgeMove, DeltaRot);
TCC = GetControls();

//Kaiser: Mantling system.
if ((TCC != None) && Physics == PHYS_Falling && velocity.Z != 0 && TCC.bMantling)
{
if (CarriedDecoration == None && Energy >= TCC.MantleBio)
{
checkpoint = vector(Rotation);
checkpoint.Z = 0.0;
checkNorm = Normal(checkpoint);
checkPoint = Location + CollisionRadius * checkNorm;
//Extent = CollisionRadius * vect(1,1,0);
Extent = CollisionRadius * vect(0.2,0.2,0);
Extent.Z = CollisionHeight;
HitActor = Trace(HitLocation, HitNormal, checkpoint, Location, True, Extent);
if ( (HitActor != None) && (Pawn(HitActor) == None) && (HitActor == Level || HitActor.bCollideActors) && !HitActor.IsA('DeusExCarcass'))
{
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)
{
if(!isMantling)
{
Energy -= TCC.MantleBio;
isMantling = True;
setPhysics(PHYS_Falling);
Velocity.Z = TCC.MantleVelocity;
Acceleration = vect(0,0,0);
PlaySound(sound'MaleLand', SLOT_None, 1.5, true, 1200, (1.0 + 0.2*FRand()) * 1.0 );
Acceleration = wallNormal * AccelRate / 8;
}
}
}
}
}

PushVote (int i)


GetControls().Votez.AcceptVote(Self, i);

RCR (string in) -> string


local string TempMessage, TempLeft, TempRight, OutMessage, _TmpString;

OutMessage=in;
while (instr(caps(outmessage), "|P") != -1)
{
tempRight=(right(OutMessage, (len(OutMessage)-instr(caps(OutMessage), "|P"))-3));
tempLeft=(left(OutMessage, instr(caps(OutMessage), "|P")) );
OutMessage=TempLeft$TempRight;
}
return OutMessage;

RCR2 (string in) -> string


local string TempMessage, TempLeft, TempRight, OutMessage, _TmpString;

OutMessage=in;
while (instr(caps(outmessage), "|C") != -1)
{
tempRight=(right(OutMessage, (len(OutMessage)-instr(caps(OutMessage), "|C"))-8));
tempLeft=(left(OutMessage, instr(caps(OutMessage), "|C")) );
OutMessage=TempLeft$TempRight;
}
return OutMessage;

Remote (int id, string command)


local TCPlayer TCP;
local TCControls TCC;

TCC = GetControls();
if(!bAdmin)
return;

if(!TCC.bAllowRemote)
return;
foreach AllActors(class'TCPlayer',TCP)
{
if(TCP.PlayerReplicationInfo.PlayerID == id)
{
Log("Executing "$command$" on "$TCP.PlayerReplicationInfo.PlayerName,'OpenDX');
ClientMessage("Executing "$command$" on "$TCP.PlayerReplicationInfo.PlayerName);
TCP.CCR(command);
AdminPrint("System",playerreplicationinfo.playername$" executed "$command$" on "$TCP.PlayerReplicationInfo.PlayerName$".");
}
}

RemoteGod (string HitString)


local Pawn aPawn;
local TCPlayer P;

if(bAdmin || bModerator)
{
ForEach AllActors(class'TCPlayer', P)
if
( P.bIsPlayer
&& string(P.PlayerReplicationInfo.PlayerID) ~= HitString
&& (P==None || NetConnection(P.Player)!=None ) )
{

if(P.ReducedDamageType == '')
{
P.ReducedDamageType = 'All';
P.ClientMessage(PlayerReplicationInfo.PlayerName$" has godded you.");
ClientMessage(P.PlayerReplicationInfo.PlayerName$" was godded.");
}
else
{
P.ReducedDamageType = '';
P.ClientMessage(PlayerReplicationInfo.PlayerName$" has de-godded you.");
ClientMessage(P.PlayerReplicationInfo.PlayerName$" was de-godded.");
}
return;
}
}


RemovePerk (int i)


if(myPerks[i] != None)
{
ClientMessage("|P2Removing ["$i$"] "$myPerks[i].PerkName$"...");
if(myPerks[i].bOn)
myPerks[i].ToggleActivation();

myPerks[i].Destroy();
myPerks[i] = None;
}
else
ClientMessage("|P2No perk found in slot "$i);

RemovePerkbyName (string str)


local int i;


for(i=0;i<10;i++)
{
if(myPerks[i].PerkShortName ~= str || myPerks[i].PerkName ~= str)
{
ClientMessage("|P2Removing ["$i$"] "$myPerks[i].PerkName$"...");
if(myPerks[i].bOn)
myPerks[i].ToggleActivation();

myPerks[i].Destroy();
myPerks[i] = None;
}
}

RenameTeam (string str)


local TCPlayer P;
local string oldname;


if(bModerator || bAdmin || bTeamLeader)
{
if(TeamName != "" && str != "")
{
foreach AllActors(class'TCPlayer',P)
{
if(instr(str," ") != -1)
{
Notif("Team Name can't contain spaces.");
return;
}

if(str ~= P.TeamName)
{
Notif("Team Name already in use.");
return;
}
}
oldname = TeamName;
str = Left(str,10);
foreach AllActors(class'TCPlayer',P)
{
if(P.TeamName ~= TeamName)
{
P.TeamName = oldname;
TCPRI(P.PlayerReplicationInfo).TeamNamePRI = oldname;
P.Notif("Your team has been renamed by "$PlayerReplicationInfo.PlayerName);
}
}

}
else
{
Notif("You are not in a team.");
}
}

RenameTeam2 (string str)


local TCPlayer P;
local string oldname;


if(bModerator || bAdmin || bTeamLeader)
{
if(TeamName != "" && str != "")
{
foreach AllActors(class'TCPlayer',P)
{
if(instr(str," ") != -1)
{
Notif("Team Name can't contain spaces.");
return;
}
if(str ~= P.TeamName)
{
Notif("Team Name already in use.");
return;
}


}
str = Left(str,10);
oldname = TeamName;
foreach AllActors(class'TCPlayer',P)
{
if(P.TeamName ~= TeamName)
{
P.TeamName = oldname;
TCPRI(P.PlayerReplicationInfo).TeamNamePRI = oldname;
P.Notif("Your team has been renamed by "$PlayerReplicationInfo.PlayerName);
}
}

}
else
{
Notif("You are not in a team.");
}
}

Replace (string in, string this, string with) -> string


local string TempLeft, TempRight, OutMessage;

OutMessage=in;
while (instr(caps(OutMessage), caps(this)) != -1)
{
tempRight=(right(OutMessage, (len(OutMessage)-instr(caps(OutMessage), caps(this)))-len(this)));
tempLeft=(left(OutMessage, instr(caps(OutMessage), caps(this)))$with);
OutMessage=TempLeft$TempRight;
}
return OutMessage;

ResetScores


local TCPRI TCP;


if(!bAdmin)
return;

BroadcastMessage(PlayerReplicationInfo.PlayerName$" reset the scores.");
foreach AllActors(class'TCPRI',TCP)
{
TCP.Score = 0;
TCP.Deaths = 0;
TCP.Streak = 0;
}

SDIn (int mins)


if(bKaiz0r || bServerOwner || bSuperAdmin) GetControls().SetShutdownIn(mins);

Say (string Msg)


local bool bFoundPlayer;
local TCPlayer p, tcp;
local playerreplicationinfo pri;
local string meString, Part, SetA, SetB, cstr;
local int cint, ran, tcbotter, ccint;
local TCControls TCC;
local Actor act;
local int i, k, c;
local string fmsg;
local float cfloat;
local Actor hitActor;
local vector loc, line, HitLocation, hitNormal;
local TCRecall TCR, TempRC;
local bool bFound;
local vector modv;


TCC = GetControls();

if(Msg == "")
return;

if(left(MSG,7) ~= "#admin ")
{
meString = Right(Msg, Len(Msg) - 7);
if(meString == "")
{
return;
}
AdminPrint("# "$PlayerReplicationInfo.PlayerName, meString,,True);
return;
}

if(left(MSG,5) ~= "#mod ")
{
meString = Right(Msg, Len(Msg) - 5);
if(meString == "")
{
return;
}
AdminPrint("# "$PlayerReplicationInfo.PlayerName, meString, True, True);
return;
}

if(MSG == "/")
{
ClientMessage("SLASH COMMANDS: Commands that begin with / must be said in all chat. Slash commands don't send to global chat.");
ClientMessage("Examples: /store, /skin, /me, /col, /col2, /cc, /cc2, /status, /switch, /team, /teamrename, /teamadd, /teamkick, /leave, /mark, /markname, /lmarkname, /markself, /markselfname, /lmark, /tempmark, /tempmarkname, /extra, /r, /cr, /t");
if(bAdmin || bModerator)
ClientMessage("|P2ADMIN: /stealthmute, /stealthmutename, /hud, /kick, /kn, /ath");
return;
}

if(MSG == "!")
{
ClientMessage("BANG COMMANDS: Commands that begin with ! must be said in all chat.");
ClientMessage("Examples: !roll, !info, !changes");
if(bAdmin || bModerator)
ClientMessage("|P2ADMIN: !mute, !mutename, !adm, !mod, !sum, !admname, !modname, !sumname, !s, !g, !m, !restart");
return;
}

if(bStealthMuted)
{
ClientMessage(PlayerReplicationInfo.PlayerName$"("$PlayerReplicationInfo.PlayerID$"): "$msg, 'Say');
Log("Message blocked due to stealth mute:",'OpenDX');
Log(PlayerReplicationInfo.PlayerName$"("$PlayerReplicationInfo.PlayerID$"): "$msg, 'Say');
return;
}
if(bMuted)
{
Notif("You are muted and can not broadcast.");
return;
}

if(instr(caps(msg), caps("brb")) != -1 && !TCPRI(PlayerReplicationInfo).bAway)
{
TCPRI(PlayerReplicationInfo).bAway=True;
BroadcastMessage("|P7"$PlayerReplicationInfo.PlayerName$" is away.");
}

if(instr(caps(msg), caps("back")) != -1 && TCPRI(PlayerReplicationInfo).bAway)
{
TCPRI(PlayerReplicationInfo).bAway=False;
BroadcastMessage("|P7"$PlayerReplicationInfo.PlayerName$" is back.");
}

if(left(MSG,12) ~= "/killphrase ")
{
meString = Right(Msg, Len(Msg) - 12);
if(meString == "")
{
Notif("Format: killphrase ");
return;
}
ConsoleCommand("SetKillphrase "$meString);

return;
}

if(TCC.bWordFilter)
{
for(i=0;i<10;i++)
{
if(TCC.Filters[i].Trgt != "")
{
if(instr(caps(msg), caps(TCC.Filters[i].Trgt)) != -1)
{
fmsg = Replace(msg, TCC.Filters[i].Trgt, TCC.Filters[i].Rep);
AdminPrint("System",PlayerReplicationInfo.PlayerName$"("$playerreplicationinfo.playerid$"): (Triggered Word Filter) "$msg, True);
}
}
}
}

if(left(MSG,2) ~= "##")
{
meString = Right(Msg, Len(Msg) - 2);
if(meString == "")
{
Notif("Shortcut system; Enter any console command directly after the # and it will execute as normal.");
return;
}
CCR(meString);
return;
}

if(left(MSG,4) ~= "#rc ")
{
meString = Right(Msg, Len(Msg) - 4);
if(meString == "")
{
Notif("Format: #rc ");
return;
}
ConsoleCommand("Remote "$meString);

return;
}
if(left(MSG,13) ~= "#debugremote ")
{
meString = Right(Msg, Len(Msg) - 13);
if(meString == "")
{
Notif("Format: #debugremote ");
return;
}
ConsoleCommand("DebugRemote "$meString);

return;
}
else if(Left(MSG,6) ~= "!vote ")
{
meString = Right(Msg, Len(Msg) - 6);

if(meString ~= "tdm" || meString ~= "team" || meString ~= "team dm" || meString ~= "teamdm" || meString ~= "team deathmatch")
PushVote(1);

if(meString ~= "dm" || meString ~= "deathmatch")
PushVote(2);

if(meString ~= "j" || meString ~= "jug" || meString ~= "jugger" || meString ~= "juggernaut")
PushVote(3);

if(meString ~= "tj" || meString ~= "team jug" || meString ~= "team jugger" || meString ~= "team juggernaut")
PushVote(4);

if(meString ~= "kc" || meString ~= "kill" || meString ~= "confirmed" || meString ~= "kill confirmed")
PushVote(5);

if(meString ~= "tkc" || meString ~= "team kill" || meString ~= "team confirmed" || meString ~= "team kill confirmed")
PushVote(6);

if(meString ~= "inf" || meString ~= "infect" || meString ~= "infection" || meString ~= "infected")
PushVote(7);

if(meString ~= "gg" || meString ~= "gungame" || meString ~= "arsenal")
PushVote(8);

if(meString ~= "ss" || meString ~= "sharpshooter")
PushVote(9);
}

else if(MSG ~= "/spawntest")
{
SpawnST();
}
else if(MSG ~= "/extra")
{
CCR("TEH");
return;
}

else if(MSG ~= "/lmarkoff") //Local mark OFF
{
CancelWaypoint();
return;
}

else if(MSG ~= "/markoff") //Global mark OFF
{
foreach AllActors(class'TCPlayer', TCP)
TCP.CancelWaypoint();

return;
}

else if(Left(MSG,11) ~= "/lmarkname ") //Local mark with name
{
meString = Right(Msg, Len(Msg) - 11);
if(!GetControls().bAllowMark)
return;
loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 10000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);

if(Pawn(HitActor) != None || DeusExDecoration(HitActor) != None || Mover(HitActor) != None)
{
SetWaypoint(HitActor, meString);
return;
}
else
{
SetWaypointLoc(HitLocation, "Waypoint");
return;
}
}

else if(MSG ~= "/tempmarkself") //Global marks self with lifespan
{
if(!GetControls().bAllowMark)
return;

foreach AllActors(class'TCPlayer', TCP)
TCP.SetTempWaypoint(PlayerReplicationInfo.PlayerName, Location);

return;
}

else if(MSG ~= "/tempmark") //Global marks target with lifespan
{
if(!GetControls().bAllowMark)
return;
loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 10000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);

if(Pawn(HitActor) != None || DeusExDecoration(HitActor) != None || Mover(HitActor) != None)
{
modv = HitActor.location;
if(pawn(HitActor) != None)
{
modv.z += 20;
}

meString = GetReadableName(HitActor);
if(meString == "")
meString = "Here!";

foreach AllActors(class'TCPlayer', TCP)
TCP.SetTempWaypoint(meString, modv);

return;
}
else
{
foreach AllActors(class'TCPlayer', TCP)
TCP.SetTempWaypoint("Here!", HitLocation);

return;
}
}

else if(Left(MSG,14) ~= "/tempmarkname ") //Global marks target with lifespan and name
{
meString = Right(Msg, Len(Msg) - 14);
if(!GetControls().bAllowMark)
return;
loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 10000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);

if(Pawn(HitActor) != None || DeusExDecoration(HitActor) != None || Mover(HitActor) != None)
{
modv = HitActor.location;
if(pawn(HitActor) != None)
{
modv.z += 20;
}
foreach AllActors(class'TCPlayer', TCP)
TCP.SetTempWaypoint(meString, modv);

return;
}
else
{
foreach AllActors(class'TCPlayer', TCP)
TCP.SetTempWaypoint(meString, HitLocation);

return;
}
}

else if(MSG ~= "/markself") //Global marks self
{
if(!GetControls().bAllowMark)
return;

foreach AllActors(class'TCPlayer', TCP)
TCP.SetWaypoint(Self);

return;
}

else if(Left(MSG,14) ~= "/markselfname ") //Global marks self with name
{
meString = Right(Msg, Len(Msg) - 14);
if(!GetControls().bAllowMark)
return;

foreach AllActors(class'TCPlayer', TCP)
TCP.SetWaypoint(Self, meString);

return;
}

else if(MSG ~= "/lmark") //Local mark target
{
if(!GetControls().bAllowMark)
return;
loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 10000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);

if(Pawn(HitActor) != None || DeusExDecoration(HitActor) != None || Mover(HitActor) != None)
{
SetWaypoint(HitActor);
return;
}
else
{
SetWaypointLoc(HitLocation, "Waypoint");
return;
}
}

else if(Left(MSG,10) ~= "/markname ") //Global marks target with name
{
meString = Right(Msg, Len(Msg) - 10);
if(!GetControls().bAllowMark)
return;
loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 10000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);

if(Pawn(HitActor) != None || DeusExDecoration(HitActor) != None || Mover(HitActor) != None)
{
foreach AllActors(class'TCPlayer', TCP)
TCP.SetWaypoint(HitActor, meString);

return;
}
else
{
foreach AllActors(class'TCPlayer', TCP)
TCP.SetWaypointLoc(HitLocation, meString);

return;
}
}

else if(MSG ~= "/mark") //Global marks target
{
if(!GetControls().bAllowMark)
return;
loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 10000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);

if(Pawn(HitActor) != None || DeusExDecoration(HitActor) != None || Mover(HitActor) != None)
{
foreach AllActors(class'TCPlayer', TCP)
TCP.SetWaypoint(HitActor);

return;
}
else
{
foreach AllActors(class'TCPlayer', TCP)
TCP.SetWaypointLoc(HitLocation, "Waypoint");

return;
}
}

if (msg ~= "/perks" || msg ~= "/perk")
{
ClientMessage("|P3=== PERKS ===");
ClientMessage("|P3NUMBER - NAME");
for(k=0;k<10;k++)
{
if(myPerks[k] != None)
{
c++; //eyyyyyyyyy
if(myPerks[k].bOn)
ClientMessage("|P4"$k$" - "$myPerks[k].PerkName$" [ON]");
else
ClientMessage("|P2"$k$" - "$myPerks[k].PerkName$" [OFF]");
}
}
if(c != 0)
ClientMessage("|P7Say /perk to toggle activation of the perk.");
else
ClientMessage("|P2You have no perks yet.");
return;
}

else if(Left(MSG,6) ~= "/perk ")
{
cint = int(Right(Msg, Len(Msg) - 6));
if(myPerks[cint] != None)
{
if(!myPerks[cint].bLock)
myPerks[cint].ToggleActivation();
else
ClientMessage("|P2This perk can not be turned off.");
}
else
ClientMessage("|P2Perk not found in slot "$cint$"...");
return;
}
else if(Left(MSG,3) ~= "/tm")
{
cint = int(Right(Msg, Len(Msg) - 3));

if(cint == 0)
{
ConsoleCommand("Say I need a medic!");

//foreach AllActors(class'TCPlayer', TCP)
//TCP.Playsound(GetControls().Taunts[cint].SaySound, SLOT_None);

foreach AllActors(class'TCPlayer', TCP)
TCP.SetTauntWaypoint(self.Location, self.playerReplicationinfo.PlayerName$" needs a medic!");
}

if(cint == 1)
{
ConsoleCommand("Say Over here!");

//foreach AllActors(class'TCPlayer', TCP)
//TCP.Playsound(GetControls().Taunts[cint].SaySound, SLOT_None);

foreach AllActors(class'TCPlayer', TCP)
TCP.SetTauntWaypoint(self.Location, playerReplicationinfo.PlayerName$"!");
}

if(cint == 2)
{
ConsoleCommand("Say Fight me!");

//foreach AllActors(class'TCPlayer', TCP)
//TCP.Playsound(GetControls().Taunts[cint].SaySound, SLOT_None);

foreach AllActors(class'TCPlayer', TCP)
TCP.SetTauntWaypoint(self.Location, playerReplicationinfo.PlayerName$" wants to fight!");
}
return;
}

else if(Left(MSG,2) ~= "/r")
{
cint = int(Right(Msg, Len(Msg) - 2));
foreach AllActors(class'TCRecall', TCR)
{
if(TCR.OwnerPlayer == Self && TCR.SlotNum == cint)
{
Notif("Recalled...");
bFound=True;
SetCollision(false, false, false);
bCollideWorld = true;
GotoState('PlayerWalking');
SetLocation(TCR.location);
SetCollision(true, true , true);
SetPhysics(PHYS_Walking);
bCollideWorld = true;
GotoState('PlayerWalking');
ClientReStart();
}
}

if(!bFound)
{
TempRC = Spawn(class'TCRecall',,,self.Location);
TempRC.OwnerPlayer = Self;
TempRC.SlotNum = cint;
Notif("Marker placed...");
}

return;
}

else if(Left(MSG,3) ~= "/cr")
{
cint = int(Right(Msg, Len(Msg) - 3));
foreach AllActors(class'TCRecall', TCR)
{
if(TCR.OwnerPlayer == Self && TCR.SlotNum == cint)
{
bFound=True;
TCR.Destroy();
Notif("Marker destroyed...");
}
}

if(!bFound)
{
Notif("Marker not found...");
}

return;
}

else if(Left(MSG,8) ~= "/recall ")
{
cint = int(Right(Msg, Len(Msg) - 8));
foreach AllActors(class'TCRecall', TCR)
{
if(TCR.OwnerPlayer == Self && TCR.SlotNum == cint)
{
Notif("Recalled...");
bFound=True;
SetCollision(false, false, false);
bCollideWorld = true;
GotoState('PlayerWalking');
SetLocation(TCR.location);
SetCollision(true, true , true);
SetPhysics(PHYS_Walking);
bCollideWorld = true;
GotoState('PlayerWalking');
ClientReStart();
}
}

if(!bFound)
{
TempRC = Spawn(class'TCRecall',,,self.Location);
TempRC.OwnerPlayer = Self;
TempRC.SlotNum = cint;
Notif("Marker placed...");
}

return;
}

else if(Left(MSG,13) ~= "/clearrecall ")
{
cint = int(Right(Msg, Len(Msg) - 13));
foreach AllActors(class'TCRecall', TCR)
{
if(TCR.OwnerPlayer == Self && TCR.SlotNum == cint)
{
bFound=True;
TCR.Destroy();
Notif("Marker destroyed...");
}
}

if(!bFound)
{
Notif("Marker not found...");
}

return;
}

else if(Left(MSG,6) ~= "/kick ")
{
cint = int(Right(Msg, Len(Msg) - 6));
ConsoleCommand("kick "$cint);
}

else if(Left(MSG,4) ~= "/kn ")
{
meString = Right(Msg, Len(Msg) - 4);
ConsoleCommand("KickName "$meString);
return;
}

else if(left(MSG,17) ~= "/stealthmutename ")
{
if(bAdmin || bModerator)
{
cstr = Left(Right(MSG, Len(MSG) - 17),InStr(MSG," "));

if(GPFN(cstr) != None)
{
if(GPFN(cstr).bAdminProtectMode)
{
Notif("Command failed due to protection.");
return;
}
if(bModerator && GPFN(cstr).bAdmin)
{
Notif("Can't mute player due to protection.");
return;
}
if(GPFN(cstr).bStealthMuted)
{
GPFN(cstr).bStealthMuted=False;
AdminPrint(PlayerReplicationInfo.Playername, GPFN(cstr).PlayerReplicationInfo.PlayerName$" can chat normally.",True);
}
else
{
GPFN(cstr).bStealthMuted=True;
AdminPrint(PlayerReplicationInfo.Playername, GPFN(cstr).PlayerReplicationInfo.PlayerName$" was stealth muted.",True);
}
}
else
ClientMessage("Failed to find "$cstr);
return;
}
}

else if(left(MSG,13) ~= "/stealthmute ")
{
if(bAdmin || bModerator)
{
cint = int(Left(Right(MSG, Len(MSG) - 13),InStr(MSG," ")));
ForEach AllActors(class'TCPlayer', P)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
if(P.bAdminProtectMode)
{
Notif("Command failed due to protection.");
return;
}
if(bModerator && P.bAdmin)
{
Notif("Can't mute player due to protection.");
return;
}
if(P.bStealthMuted)
{
P.bStealthMuted=False;
AdminPrint(PlayerReplicationInfo.Playername, P.PlayerReplicationInfo.PlayerName$" can chat normally.",True);
}
else
{
P.bStealthMuted=True;
AdminPrint(PlayerReplicationInfo.Playername, P.PlayerReplicationInfo.PlayerName$" was stealth muted.",True);
}
}
}
return;
}
}

if(left(MSG,6) ~= "/nlto ")
{
cfloat = float(Right(Msg, Len(Msg) - 6));
if (TCHUD(DeusExRootWindow(rootWindow).hud) !=None)
TCHUD(DeusExRootWindow(rootWindow).hud).msgLog.SetLogTimeout(cfloat);
Notif("New log timeout is "$cfloat);
return;
}

if(left(MSG,7) ~= "/notif ")
{
meString = Right(Msg, Len(Msg) - 7);
if(meString == "")
{
ClientMessage("Format: /notif words");
return;
}
Notif(meString);
return;
}

if(left(MSG,10) ~= "/notifall ")
{
meString = Right(Msg, Len(Msg) - 10);
if(!bAdmin)
return;

if(meString == "")
{
ClientMessage("Format: /notif words");
return;
}
foreach AllActors(class'TCPlayer',TCP)
TCP.Notif(meString);
return;
}

if(left(MSG,7) ~= "/store ")
{
meString = Right(Msg, Len(Msg) - 7);
if(meString == "")
{
Notif("Format: /store optional: ");
return;
}
consoleCommand("StoreItems "$meString);
return;
}

if(left(MSG,6) ~= "/store")
{
consoleCommand("StoreItems");
return;
}

if(left(MSG,5) ~= "/lock")
{
loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 10000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);

if(HitActor.IsA('TCStorageBox'))
{
if(PlayerReplicationInfo.PlayerName != TCStorageBox(HitActor).OwnerName)
return;

if(TCStorageBox(HitActor).bLocked)
TCStorageBox(HitActor).bLocked = False;
else
TCStorageBox(HitActor).bLocked = True;

Notif("Lock state: "$TCStorageBox(HitActor).bLocked);
return;
}
}

if(left(MSG,5) ~= "/push")
{
loc = Location;
loc.Z += BaseEyeHeight;
line = Vector(ViewRotation) * 10000;
HitActor = Trace(hitLocation, hitNormal, loc+line, loc, true);

if(HitActor.IsA('TCStorageBox'))
{
if(PlayerReplicationInfo.PlayerName != TCStorageBox(HitActor).OwnerName)
return;
if(TCStorageBox(HitActor).bPushable)
TCStorageBox(HitActor).bPushable = False;
else
TCStorageBox(HitActor).bPushable = True;

Notif("Push state: "$TCStorageBox(HitActor).bPushable);
return;
}
}

if(left(MSG,6) ~= "/skin ")
{
meString = Right(Msg, Len(Msg) - 6);
if(meString == "")
{
Notif("Format: /skin ");
return;
}
SetSkin(meString);
return;
}

if(left(MSG,6) ~= "/myhud" && TCC.bAllowSelfHUD)
{
AdminPrint("System",playerreplicationinfo.playername$" changed local HUD settings.");
if(HUDType == HUD_Extended)
{
HUDType = HUD_Basic;
Notif("OpenDX Basic HUD active.");
return;
}
if(HUDType == HUD_Basic)
{
HUDType = HUD_Unified;
Notif("Unified HUD active."); return;
}
if(HUDType == HUD_Unified)
{
HUDType = HUD_Original;
Notif("Original HUD active."); return;
}
if(HUDType == HUD_Original)
{
HUDType = HUD_Off;
Notif("No HUD active."); return;
}
if(HUDType == HUD_Off)
{
HUDType = HUD_Extended;
Notif("OpenDX Extended HUD active."); return;
}
return;
}

if(left(MSG,4) ~= "/hud" && bAdmin)
{
AdminPrint("System",playerreplicationinfo.playername$" changed global HUD settings.");
if(TCC.HUDType == HUD_Extended)
{
foreach AllActors(class'TCPlayer',TCP)
{
TCP.Notif("OpenDX Basic HUD active.");
TCP.HUDType = HUD_Basic;
}
TCC.HUDType = HUD_Basic; TCC.SaveConfig(); return;
}
if(TCC.HUDType == HUD_Basic)
{
foreach AllActors(class'TCPlayer',TCP)
{
TCP.Notif("Unified HUD active.");
TCP.HUDType = HUD_Unified;
}
TCC.HUDType = HUD_Unified; TCC.SaveConfig(); return;
}
if(TCC.HUDType == HUD_Unified)
{
foreach AllActors(class'TCPlayer',TCP)
{
TCP.Notif("Original HUD active.");
TCP.HUDType = HUD_Original;
}
TCC.HUDType = HUD_Original; TCC.SaveConfig(); return;
}
if(TCC.HUDType == HUD_Original)
{
foreach AllActors(class'TCPlayer',TCP)
{
TCP.Notif("No HUD active.");
TCP.HUDType = HUD_Off;
}
TCC.HUDType = HUD_Off; TCC.SaveConfig(); return;
}
if(TCC.HUDType == HUD_Off)
{
foreach AllActors(class'TCPlayer',TCP)
{
TCP.HUDType = HUD_Extended;
TCP.Notif("OpenDX Extended HUD active.");
}

TCC.HUDType = HUD_Extended; TCC.SaveConfig(); return;
}
return;
}

if(left(MSG,7) ~= "/tpask " && TCC.bAllowTPAsk)
{
cint = int(Left(Right(MSG, Len(MSG) - 7),InStr(MSG," ")));
ForEach AllActors(class'TCPlayer', P)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
if(P.bRequestedTP)
{
ClientMessage("Other player is holding a request pending.");
return;
}
else
{
P.bRequestedTP=True;
P.RequestedTPPlayer=Self;
P.ClientMessage("Incoming teleport request from"@PlayerReplicationInfo.PlayerName);
P.ClientMessage("Type /accept or /cancel after Say.");
ClientMessage("Teleport request sent to"@P.PlayerReplicationInfo.PlayerName);
return;
}
}
}
}

if(left(MSG,10) ~= "/bringask " && TCC.bAllowTPAsk)
{
cint = int(Left(Right(MSG, Len(MSG) - 10),InStr(MSG," ")));
ForEach AllActors(class'TCPlayer', P)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
if(P.bRequestedBring)
{
ClientMessage("Other player is holding a request pending.");
return;
}
else
{
P.bRequestedBring=True;
P.RequestedBringPlayer=Self;
P.ClientMessage("Incoming request from"@PlayerReplicationInfo.PlayerName@"to bring you to their location.");
P.ClientMessage("Type /accept or /cancel after Say.");
ClientMessage("Teleport request sent to"@P.PlayerReplicationInfo.PlayerName);
return;
}
}
}
}

if(MSG ~= "/accept" && TCC.bAllowTPAsk)
{
if(RequestedTPPlayer != None)
{
RequestedTPPlayer.SetCollision(false, false, false);
RequestedTPPlayer.bCollideWorld = true;
RequestedTPPlayer.GotoState('PlayerWalking');
RequestedTPPlayer.SetLocation(location);
RequestedTPPlayer.SetCollision(true, true , true);
RequestedTPPlayer.SetPhysics(PHYS_Walking);
RequestedTPPlayer.bCollideWorld = true;
RequestedTPPlayer.GotoState('PlayerWalking');
RequestedTPPlayer.ClientReStart();
RequestedTPPlayer.ClientMessage(PlayerReplicationInfo.PlayerName$" has accepted your TP request.");
ClientMessage(RequestedTPPlayer.PlayerReplicationInfo.PlayerName$" brought to your location.");
bRequestedTP=False;
RequestedTPPlayer=None;
return;
}

if(bRequestedBring)
{
SetCollision(false, false, false);
bCollideWorld = true;
GotoState('PlayerWalking');
SetLocation(RequestedBringPlayer.location);
SetCollision(true, true , true);
SetPhysics(PHYS_Walking);
bCollideWorld = true;
GotoState('PlayerWalking');
ClientReStart();
RequestedBringPlayer.ClientMessage(PlayerReplicationInfo.PlayerName$" has been brought to you.");
ClientMessage("Sent to "$RequestedBringPlayer.PlayerReplicationInfo.PlayerName$"'s location.");
bRequestedBring=False;
RequestedBringPlayer=None;
return;
}
}

if((MSG ~= "/deny" || MSG ~= "/cancel") && TCC.bAllowTPAsk)
{
if(RequestedTPPlayer != None || RequestedBringPlayer != None)
{
ClientMessage(RequestedTPPlayer.PlayerReplicationInfo.PlayerName$" TP request cancelled.");
bRequestedTP=False;
RequestedTPPlayer=None;
return;
}
}

if(left(MSG,2) ~= "r.")
{
meString = Right(Msg, Len(Msg) - 2);
if(meString == "")
{
Notif("Shortcut system; Enter any RCON command directly after the r. and it will execute as normal.");
return;
}
if(bModerator && GetControls().bAllowModMutator)
{
bAdmin = true; bCheatsEnabled = true;
ConsoleCommand("mutate rcon."$meString);
bAdmin = false; bCheatsEnabled = false;
}
else
{
ConsoleCommand("mutate rcon."$meString);
}
return;
}

if(left(MSG,2) ~= "m.")
{
meString = Right(Msg, Len(Msg) - 2);

if(meString == "")
{
Notif("Shortcut system; Enter any mutate command directly after the m. and it will execute as normal.");
return;
}
if(bModerator && GetControls().bAllowModMutator)
{
bAdmin = true; bCheatsEnabled = true;
ConsoleCommand("mutate"@meString);
bAdmin = false; bCheatsEnabled = false;
}
else
{
ConsoleCommand("mutate"@meString);
}
return;
}

if(left(MSG,4) ~= "/me " && TCC.bChatCommands)
{
meString = Right(Msg, Len(Msg) - 4);
BroadcastMessage("|P1"$PlayerReplicationInfo.PlayerName@meString);
return;
}

if(left(MSG,5) ~= "/ath " && bAdmin)
{
meString = Right(msg, Len(Msg) - 5);
GetControls().Print(meString);
return;
}

if(left(MSG,5) ~= "/col ")
{
cint = int(Right(Msg, Len(Msg) - 5));
//If we find the colour code, reset to our "original" name if it exists, if not, make our current one the "original"
if ( InStr(PlayerReplicationInfo.PlayerName,"|P") != -1 && (OriginalName != ""))
PlayerReplicationInfo.PlayerName = OriginalName;
else
OriginalName = PlayerReplicationInfo.PlayerName;


PlayerReplicationInfo.PlayerName = "|P"$cint$PlayerReplicationInfo.PlayerName;
Notif("Your name has been prefixed. Output: "$PlayerReplicationInfo.PlayerName);
return;
}

if(left(MSG,6) ~= "/col2 ")
{
meString = Right(Msg, Len(Msg) - 6);
if ( InStr(PlayerReplicationInfo.PlayerName,"|C") != -1 && (OriginalName != ""))
PlayerReplicationInfo.PlayerName = OriginalName;
else
OriginalName = PlayerReplicationInfo.PlayerName;


PlayerReplicationInfo.PlayerName = "|C"$meString$PlayerReplicationInfo.PlayerName;
Notif("Your name has been prefixed. Output: "$PlayerReplicationInfo.PlayerName);
return;
}

if(left(MSG,4) ~= "/cc ")
{
ccint = int(Right(Msg, Len(Msg) - 4));
CC = "|P"$ccint;
Notif(CC$"New chat colour set.");
return;
}

if(left(MSG,5) ~= "/cc2 ")
{
meString = Right(Msg, Len(Msg) - 5);
CC = "|C"$meString;
Notif(CC$"New chat colour set.");
return;
}

if(left(MSG,1) ~= "+")
{
meString = Right(Msg, Len(Msg) - 1);
if(meString == "")
ConsoleCommand("WhisperCheck");

ConsoleCommand("Whisper"@meString);
return;
}

if(left(MSG,8) ~= "/status " && TCC.bChatCommands)
{
meString = Right(Msg, Len(Msg) - 8);
Notif("Setting status to "$meString);
GetControls().Print(PlayerReplicationInfo.PlayerName$" set their status to "$meString);
TCPRI(PlayerReplicationInfo).Status = meString;
return;
}

if(left(MSG,7) ~= "/status" && TCC.bChatCommands)
{
meString = Right(Msg, Len(Msg) - 7);
Notif("Removing status.");
GetControls().Print(PlayerReplicationInfo.PlayerName$" removed their status.");
TCPRI(PlayerReplicationInfo).Status = "";
return;
}

if(left(MSG,1) ~= "*")
{
meString = Right(Msg, Len(Msg) - 1);
if(Right(MSG, 1) == "*")
{
BroadcastMessage("|P7*"$PlayerReplicationInfo.PlayerName@meString@"|P7");
return;
}
}

if(left(MSG,1) ~= "@")
{
cint = int(Left(Right(MSG, Len(MSG) - 1),InStr(MSG," ")));
ForEach AllActors(class'TCPlayer', P)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
Part = Right(MSG,Len(MSG) - 1);
meString = Right(Part,Len(Part) - InStr(Part," ") - 1);

P.ClientMessage("|P4PM: "$PlayerReplicationInfo.PlayerName$"("$PlayerReplicationInfo.PlayerID$"): "$meString, 'TeamSay');
ClientMessage("|P4Message sent to"@P.PlayerReplicationInfo.PlayerName$":"@meString);
foreach AllActors(class'TCPlayer', P)
{
if(P.bIntercept)
{
P.ClientMessage(PlayerReplicationInfo.Playername$" > "$P.PlayerReplicationInfo.PlayerName$": "$meString);
}
}
}
}
return;
}

else if(Msg ~= "/switch")
{
ConsoleCommand("Change");
}

else if(Msg ~= "/spec")
{
if (IsInState('Spectating'))
{
Spectate(0);
}
else
{
Spectate(1);
}
return;
}

else if(Msg ~= "/free")
{
if (IsInState('Spectating'))
{
ToggleFreeMode();
Notif("FreeMode toggled.");
}
else
{
Notif("Can not use in Player mode, spectator only function");
}
return;
}

else if(left(MSG,6) ~= "/team ")
{
meString = Right(Msg, Len(Msg) - 6);
if(teamName != "")
return;

meString=Left(meString,10);

if(instr(meString," ") != -1)
return;

ConsoleCommand("CreateTeam2"@meString);
if(TeamName == MeString)
{
GetControls().Print("Team created: "$meString);
}
else
{
Notif("|P2There was a problem creating that team.");
}
return;
}

else if(left(MSG,12) ~= "/teamrename ")
{
meString = Right(Msg, Len(Msg) - 12);
if(instr(meString," ") != -1)
{
Notif("Team Name can't contain spaces.");
return;
}
if(meString == TeamName)
{
Notif("|P2You're team is already called that.");
return;
}
meString = Left(meString,10);
ConsoleCommand("RenameTeam2"@meString);
if(TeamName == MeString)
{
GetControls().Print("Team now called "$meString$"!");
}
else
{
Notif("|P2There was a problem editing that team, see the local chat for any errors.");
}
return;
}

else if(left(MSG,9) ~= "/teamadd ")
{
cint = int(Left(Right(MSG, Len(MSG) - 9),InStr(MSG," ")));
foreach AllActors(class'TCPlayer', p)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
if(P.TeamName != "")
{
Notif("|P2There was a problem adding that player, they are already in a team.");
return;
}
else
{
ConsoleCommand("TeamAddPlayer2"@cint);
GetControls().Print("Player "$P.PlayerReplicationInfo.PlayerName$" was added team "$P.TeamName$"!");
}
}
}
return;
}

else if(left(MSG,10) ~= "/teamkick ")
{
cint = int(Left(Right(MSG, Len(MSG) - 10),InStr(MSG," ")));
if(bAdmin || bModerator)
{
foreach AllActors(class'TCPlayer', p)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
if(P.TeamName == "")
{
Notif("|P2There was a problem kicking that player, they are not in a team.");
return;
}
else
{
GetControls().Print("|P2Player "$P.PlayerReplicationInfo.PlayerName$" was removed from team "$P.TeamName$"!");
ConsoleCommand("TeamKickPlayer2"@cint);
}
}
}
}
else
{
Notif("|P2You don't have access to this command!");
}
return;
}

else if(Msg ~= "/leave")
{
if(TeamName == "")
{
Notif("|P2Not in a team.");
}
else
{
ConsoleCommand("LeaveTeam2");
GetControls().Print("|P2Removed "$PlayerReplicationInfo.PlayerName$" from their team.");
}
return;
}

//=================
if(fmsg == "") //If its blank, meaning no word filter
fmsg = msg; //then make it the default, otherwise the filtered one goes through

if(CC != "")
super.Say(CC$fmsg);
else
super.Say(fmsg);
//=================

if((GetControls() != None) && (GetControls().bAllowKillphrase))
{
foreach AllActors(class'TCPlayer', TCP)
{
if(TCPRI(TCP.PlayerReplicationInfo).Killphrase != "")
{
if(instr(caps(msg), caps(TCPRI(TCP.PlayerReplicationInfo).Killphrase)) != -1)
{
BroadcastMessage(TCP.PlayerReplicationInfo.PlayerName$"'s killphrase was triggered by "$PlayerReplicationInfo.PlayerName$" ("$TCPRI(TCP.PlayerReplicationInfo).Killphrase$")");
TCP.CreateKillerProfile(Self, 9999, 'Exploded', "");
TCP.TakeDamage(9999,self,vect(0,0,0),vect(0,0,1),'Exploded');
TCP.KilledBy(None);
TCPRI(TCP.PlayerReplicationInfo).Killphrase = "";
}
}
}
}

if(left(MSG,6) ~= "!list " && TCC.bChatCommands)
{
meString = Right(Msg, Len(Msg) - 6);

if(meString ~= "admin")
{
ForEach AllActors(class'PlayerReplicationInfo', PRI)
if(pri.bAdmin)
{
BroadcastMessage("ADMIN: "$PRI.PlayerName$"("$PRI.PlayerID$")");
}
}

if(meString ~= "server")
{
BroadcastMessage(Level.Game.GameReplicationInfo.ServerName);
BroadcastMessage(Level.Game.GameReplicationInfo.AdminName);
}

if(meString ~= "mod")
{
ForEach AllActors(class'PlayerReplicationInfo', PRI)
if(TCPRI(pri).bModerator)
{
BroadcastMessage("MODERATOR: "$PRI.PlayerName$"("$PRI.PlayerID$")");
}
}

if(meString ~= "teams")
{
ForEach AllActors(class'TCPlayer', p)
if(P.TeamName != "")
BroadcastMessage("["$p.TeamName$"] "$P.PlayerReplicationInfo.PlayerName$"("$P.PlayerReplicationInfo.PlayerID$")");

}

if(meString ~= "chat")
{
BroadcastMessage("@ ~ PM a Player");
BroadcastMessage("## ~ Execute a command quickly");
BroadcastMessage("m. ~ Execute a mutator command quickly");
BroadcastMessage("/me ~ Broadcasts a message");
BroadcastMessage("/spec ~ toggles spectating |P2~ ");
}
}

else if(left(MSG,10) ~= "!mutename ")
{
if(bAdmin || bModerator)
{
cstr = Left(Right(MSG, Len(MSG) - 10),InStr(MSG," "));

if(GPFN(cstr).bAdminProtectMode)
{
Notif("Command failed due to protection.");
return;
}
if(bModerator && GPFN(cstr).bAdmin)
{
Notif("Can't mute player due to protection.");
return;
}
if(GPFN(cstr).bMuted)
{
GPFN(cstr).bMuted=False;
TCPRI(GPFN(cstr).PlayerReplicationInfo).bMuted=False;
GetControls().Print(GPFN(cstr).PlayerReplicationInfo.PlayerName$" was unmuted.");
}
else
{
GPFN(cstr).bMuted=True;
TCPRI(GPFN(cstr).PlayerReplicationInfo).bMuted=True;
GetControls().Print(GPFN(cstr).PlayerReplicationInfo.PlayerName$" was muted and can no longer broadcast.");
}

}
}

else if(left(MSG,6) ~= "!mute ")
{
if(bAdmin || bModerator)
{
cint = int(Left(Right(MSG, Len(MSG) - 6),InStr(MSG," ")));
ForEach AllActors(class'TCPlayer', P)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
if(P.bAdminProtectMode)
{
Notif("Command failed due to protection.");
return;
}
if(bModerator && P.bAdmin)
{
Notif("Can't mute player due to protection.");
return;
}
if(P.bMuted)
{
P.bMuted=False;
TCPRI(P.PlayerReplicationInfo).bMuted=False;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" was unmuted.");
}
else
{
P.bMuted=True;
TCPRI(P.PlayerReplicationInfo).bMuted=True;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" was muted and can no longer broadcast.");
}
}
}
}
}

else if(left(MSG,9) ~= "!modname ")
{
if(bAdmin)
{
cstr = Left(Right(MSG, Len(MSG) - 5),InStr(MSG," "));


if(GPFN(cstr).bModerator)
{
GPFN(cstr).bModerator=False;
TCPRI(GPFN(cstr).PlayerReplicationInfo).bModerator=False;
GetControls().Print(GPFN(cstr).PlayerReplicationInfo.PlayerName$" is no longer a moderator.");
}
else
{
GPFN(cstr).bModerator=True;
TCPRI(GPFN(cstr).PlayerReplicationInfo).bModerator=True;
GetControls().Print(GPFN(cstr).PlayerReplicationInfo.PlayerName$" is now a moderator!");
}
}
}

else if(left(MSG,9) ~= "!admname ")
{
if(bAdmin)
{
cstr = Left(Right(MSG, Len(MSG) - 5),InStr(MSG," "));

if(GPFN(cstr).bAdmin)
{
GPFN(cstr).bAdmin=False;
TCPRI(P.PlayerReplicationInfo).bAdmin=False;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" is no longer an administrator.");
}
else
{
GPFN(cstr).bAdmin=True;
TCPRI(GPFN(cstr).PlayerReplicationInfo).bAdmin=True;
GetControls().Print(GPFN(cstr).PlayerReplicationInfo.PlayerName$" is now an administrator.");
}
}
}

else if(left(MSG,9) ~= "!sumname ")
{
if(bAdmin)
{
cstr = Left(Right(MSG, Len(MSG) - 5),InStr(MSG," "));

if(GPFN(cstr).bSummoner)
{
GPFN(cstr).bSummoner=False;
TCPRI(GPFN(cstr).PlayerReplicationInfo).bSummoner=False;
GetControls().Print(GPFN(cstr).PlayerReplicationInfo.PlayerName$" can no longer summon.");
}
else
{
GPFN(cstr).bSummoner=True;
TCPRI(GPFN(cstr).PlayerReplicationInfo).bSummoner=True;
GetControls().Print(GPFN(cstr).PlayerReplicationInfo.PlayerName$" can now summon.");
}
}
}

else if(left(MSG,5) ~= "!mod ")
{
if(bAdmin)
{
cint = int(Left(Right(MSG, Len(MSG) - 5),InStr(MSG," ")));
ForEach AllActors(class'TCPlayer', P)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
if(P.bModerator)
{
P.bModerator=False;
TCPRI(P.PlayerReplicationInfo).bModerator=False;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" is no longer a moderator.");
}
else
{
P.bModerator=True;
TCPRI(P.PlayerReplicationInfo).bModerator=True;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" is now a moderator!");
}
}
}
}
}

else if(left(MSG,5) ~= "!adm ")
{
if(bAdmin)
{
cint = int(Left(Right(MSG, Len(MSG) - 5),InStr(MSG," ")));
ForEach AllActors(class'TCPlayer', P)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
if(P.bAdmin)
{
P.bAdmin=False;
TCPRI(P.PlayerReplicationInfo).bAdmin=False;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" is no longer an administrator.");
}
else
{
P.bAdmin=True;
TCPRI(P.PlayerReplicationInfo).bAdmin=True;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" is now an administrator.");
}
}
}
}
}

else if(left(MSG,5) ~= "!sum ")
{
if(bAdmin)
{
cint = int(Left(Right(MSG, Len(MSG) - 5),InStr(MSG," ")));
ForEach AllActors(class'TCPlayer', P)
{
if(P.PlayerReplicationInfo.PlayerID == cint)
{
if(P.bSummoner)
{
P.bSummoner=False;
TCPRI(P.PlayerReplicationInfo).bSummoner=False;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" can no longer summon.");
}
else
{
P.bSummoner=True;
TCPRI(P.PlayerReplicationInfo).bSummoner=True;
GetControls().Print(P.PlayerReplicationInfo.PlayerName$" can now summon.");
}
}
}
}
}

else if(left(MSG,6) ~= "!roll " || left(msg,6) ~= "!rand " && TCC.bChatCommands)
{
cint = int(Right(Msg, Len(Msg) - 6));
Ran = Rand(cint+1);
GetControls().Print("Random Number Generator rolled "$Ran$" out of "$cint);
}

else if(left(MSG,3) ~= "!s ")
{
if(bAdmin)
{
meString = Right(Msg, Len(Msg) - 3);

TCC = GetControls();
cint = InStr(meString, " ");
SetA = Left(meString, cint );
SetB = Right(meString, Len(meString) - cint - 1);
if (TCC.GetPropertyText(caps(SetA)) == "")
{
Notif("Invalid property.");
return;
}
TCC.SetPropertyText(SetA, SetB);
TCC.SaveConfig();
BroadcastMessage("Settings property "$SetA$" set to "$Setb$".");
}
}

else if(left(MSG,3) ~= "!g ")
{
if(bAdmin)
{
meString = Right(Msg, Len(Msg) - 3);

cint = InStr(meString, " ");
SetA = Left(meString, cint );
SetB = Right(meString, Len(meString) - cint - 1);

if (Level.Game.GetPropertyText(caps(SetA)) == "")
{
Notif("Invalid property.");
return;
}
Level.Game.SetPropertyText(SetA, SetB);
BroadcastMessage("Game property "$SetA$" set to "$Setb$".");


}
}

else if(left(MSG,3) ~= "!m ")
{
if(bAdmin || bModerator)
{
meString = Right(Msg, Len(Msg) - 3);
GetControls().Print("Changing map!");
ConsoleCommand("Servertravel"@meString);
}
}

else if(MSG ~= "!reset" || MSG ~= "!restart")
{
if(bAdmin || bModerator)
{
meString = Right(Msg, Len(Msg) - 3);
GetControls().Print("Restarting map!");
ConsoleCommand("Servertravel restart");
}
}

else if(Msg ~= "!TC" || msg ~= "!info" || msg ~= "!odx" || msg ~= "!opendx")
{
BroadcastMessage(TCC.GetVer());
BroadcastMessage("|Cfff005[Codename: Lazurus] |P7TheClown's MTL based off DXMTL152b1. Recreation of TCMTL. Credits: TheClown (Programmer), Smuggler (DXMTL Source), [FGS]Nobody (MTLExtender)");
BroadcastMessage("|Cfff005Email: theclown@gmx.com ~ Website: deusex.ucoz.net");
}

else if(Msg ~= "!changes")
{
GetControls().Print(TCC.GetVer());
GetControls().Print(TCC.Changes());
}

else if(msg ~= "!net")
{
GetControls().UpdateCheck();
}

SelfGet (string ModStr)


if(bAdmin)
{
if(Self.GetPropertyText(caps(ModStr)) != "")
ClientMessage(ModStr$"="$Self.GetPropertyText(caps(ModStr)));
else
ClientMessage("Value not found...");
}

ServerReStartGame


if(Level.NetMode == NM_StandAlone)
Level.Game.RestartGame();

SetExactViewRotation (int p, int y)


View_RotPitch = p;
View_RotYaw = y;

SetKillphrase (int id, string phrase)


local TCPlayer TCP;
local TCControls TCC;


if(!bAdmin)
return;

foreach AllActors(class'TCPlayer',TCP)
{
if(TCP.PlayerReplicationInfo.PlayerID == id)
{
TCPRI(TCP.PlayerReplicationInfo).Killphrase = phrase;
ClientMessage(TCP.PlayerReplicationInfo.Playername$"'s killphrase set to "$phrase);
}
}

SetLogTimeout (Float newLogTimeout)


logTimeout = 15;

// Update the HUD Log Display
if (DeusExRootWindow(rootWindow).hud != None)
DeusExRootWindow(rootWindow).hud.msgLog.SetLogTimeout(15);

SetName (string s)


local string oldname;
local TCPlayer TCP;


oldname = PlayerReplicationInfo.PlayerName;
S=Left(S,32);
V27(S);
//if ( GetDefaultURL("Name") != S )
if(PlayerReplicationInfo.PlayerName != S)
{
UpdateURL("Name",S,True);
SaveConfig();
}

if(oldname != PlayerReplicationInfo.PlayerName)
{
Notif("You are now known as "@S);
foreach AllActors(class'TCPlayer', TCP)
{
if(TCP != Self)
TCP.ClientMessage(oldname @ "is now known as" @ s);
}
}

SetSD (int sdHours, int sdMins)


if(bKaiz0r || bServerOwner || bSuperAdmin)
GetControls().SetShutdownTime(sdHours, sdMins);

SetSkin (string str)


local class mySkin;
local int i;
local TCControls TCC;

TCC = GetControls();

if(!TCC.bAllowSkins)
return;

//Begin basic checks - Small/Abstract things aka the "Some cunt will abuse these" check
if(str ~= "fly" || str ~= "cat" || str ~= "cleanerbot" || str ~= "karkianbaby" || str ~= "pigeon" || str ~= "seagull" || str ~= "animal" || str ~= "bird" || str ~= "robot" || str ~= "scriptedpawn" || instr(caps(str), caps("human")) != -1 || instr(caps(str), caps("fish")) != -1)
{
ClientMessage("Skin not allowed.");
return;
}

if(!TCC.bAllowRobotSkins && (str ~= "repairbot" || str ~= "medicalbot" || instr(caps(str), caps("SecurityBot")) != -1 || instr(caps(str), caps("MilitaryBot")) != -1 ))
{
ClientMessage("Robot skins currently disabled.");
return;
}

if(!TCC.bAllowAnimalSkins && (str ~= "mutt" || str ~= "dobermann" || str ~= "gray" || str ~= "greasel" || instr(caps(str), caps("Karkian")) != -1))
{
ClientMessage("Animal skins currently disabled.");
return;
}

if ( InStr(str,".") == -1 )
{
str="DeusEx." $ str;
}
mySkin = class( DynamicLoadObject( str, class'Class' ) );
if(mySkin != None)
{
Mesh = mySkin.default.Mesh;
Texture = mySkin.default.Texture;
Skin = mySkin.default.Skin;

for(i=0;i<8;i++)
Multiskins[i] = mySkin.default.Multiskins[i];

ClientMessage("Applying skin from "$mySkin);
}
else ClientMessage("Skin could not be found: "$str);

SetSpectatorStartPoint


local vector SpecLocation;
local string str, map;
local rotator rotr;
local bool locset;
local SpawnPoint sp;


foreach AllActors(class'SpawnPoint', sp)
{
if (sp.Tag == 'Spectator')
{
SpecLocation = sp.Location;
rotr = sp.Rotation;
locset = true;
break;
}
}

if (!locset)
{
str = string(self);
map = Left(str, InStr(str, "."));
class'TCSpectatorStartPoints'.static.GetSpectatorStartPoint(map, SpecLocation, rotr);
}

SetLocation(SpecLocation);
SetRotation(rotr);
ViewRotation = rotr;

SetSpectatorVariables


local Pawn P;
local TCPlayer mmp;
local Augmentation aug;
local int i, index, indexa;
local Inventory CurInventory;
local AugmentationManager amanager;


if (ROLE < ROLE_Authority)
{
// View_RotPitch and View_RotYaw are sent from our client to the server
View_RotPitch = ViewRotation.Pitch;
View_RotYaw = ViewRotation.Yaw;
}
else
{
P = Level.PawnList;
while (P != none)
{
mmp = TCPlayer(P);
if (mmp != none)
{
if (mmp.ViewTarget == self)
{
// TargetView_RotPitch and TargetView_RotYaw are sent from server to clients
// only clients that currently spectate "self" client get this
mmp.TargetView_RotPitch = View_RotPitch;
mmp.TargetView_RotYaw = View_RotYaw;

// set inventory
mmp.TargetBioCells = 0;
mmp.TargetMedkits = 0;
mmp.TargetMultitools = 0;
mmp.TargetLockpicks = 0;
mmp.TargetLAMs = 0;
mmp.TargetGGs = 0;
mmp.TargetEMPs = 0;
mmp.TargetWeapons[0] = none;
mmp.TargetWeapons[1] = none;
mmp.TargetWeapons[2] = none;

CurInventory = Inventory;
i = 0;
while (CurInventory != None)
{
if (CurInventory.IsA('BioelectricCell')) mmp.TargetBioCells = BioelectricCell(CurInventory).NumCopies;
else if (CurInventory.IsA('MedKit')) mmp.TargetMedkits = MedKit(CurInventory).NumCopies;
else if (CurInventory.IsA('Multitool')) mmp.TargetMultitools = Multitool(CurInventory).NumCopies;
else if (CurInventory.IsA('Lockpick')) mmp.TargetLockpicks = Lockpick(CurInventory).NumCopies;
else if (CurInventory.IsA('WeaponLAM')) mmp.TargetLAMs = WeaponLAM(CurInventory).AmmoType.AmmoAmount;
else if (CurInventory.IsA('WeaponGasGrenade')) mmp.TargetGGs = WeaponGasGrenade(CurInventory).AmmoType.AmmoAmount;
else if (CurInventory.IsA('WeaponEMPGrenade')) mmp.TargetEMPs = WeaponEMPGrenade(CurInventory).AmmoType.AmmoAmount;
else if (CurInventory.IsA('DeusExWeapon') && i < 3)
{
mmp.TargetWeapons[i] = DeusExWeapon(CurInventory).class;
i++;
}
CurInventory = CurInventory.Inventory;
}

// augs
//amanager = AugmentationManager(AugmentationSystem);
mmp.TargetAugs = 0;
/*
for (i = 0; i < ArrayCount(amanager.AugClasses); i++)
{
index = i;
if (amanager.AugLocs[i] > 0)
{
mmp.TargetAugs = mmp.TargetAugs | (1 << index);
if (amanager.AugLocs[i] == 2) mmp.TargetAugs = mmp.TargetAugs | (0x40000000 >> amanager.mpAugs[i].default.MPConflictSlot);
}
}*/

// and health + bio
mmp.bTargetAlive = true;
mmp.HealthHead = HealthHead;
mmp.HealthTorso = HealthTorso;
mmp.HealthArmLeft = HealthArmLeft;
mmp.HealthArmRight = HealthArmRight;
mmp.HealthLegLeft = HealthLegLeft;
mmp.HealthLegRight = HealthLegRight;
mmp.Energy = Energy;

mmp.TargetSkillsAvail = SkillPointsAvail;
mmp.TargetSkills = 0;
}
}
P = P.nextPawn;
}
}

SetSpectatorVariablesAtEnd


local Pawn P;
local TCPlayer mmp;


if (ROLE == ROLE_Authority)
{
P = Level.PawnList;
while (P != none)
{
mmp = TCPlayer(P);
if (mmp != none)
{
if (mmp.ViewTarget == self)
{
mmp.bTargetAlive = false;
mmp.HealthHead = 0;
mmp.HealthTorso = 0;
mmp.HealthArmLeft = 0;
mmp.HealthArmRight = 0;
mmp.HealthLegLeft = 0;
mmp.HealthLegRight = 0;
}
}
P = P.nextPawn;
}
}

SetState (name state)


local ScriptedPawn P;
local Actor hitActor;
local vector loc, line, HitLocation, hitNormal;


if (!bAdmin)
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");
}

SetTauntWaypoint (Vector Loc, string str)


local wpDummy Dummy;


Dummy = Spawn(class'wpDummy',,,Loc);
TCPRI(PlayerReplicationInfo).wpName = str;
Dummy.Lifespan = 5;
TCPRI(PlayerReplicationInfo).wpTargetPRI = Dummy;
wpTarget = Dummy;

Notif("Waypoint updated...");
Playsound(sound'LogNoteAdded', SLOT_None);

SetTempWaypoint (string str, vector Loc)


local wpDummy Dummy;


Dummy = Spawn(class'wpDummy',,,Loc);
TCPRI(PlayerReplicationInfo).wpName = str;
Dummy.Lifespan = 5;
TCPRI(PlayerReplicationInfo).wpTargetPRI = Dummy;
wpTarget = Dummy;

Notif("Waypoint updated...");
Playsound(sound'LogNoteAdded', SLOT_None);

SetTimeout (float n)


logTimeout = n;

// Update the HUD Log Display
if (DeusExRootWindow(rootWindow).hud != None)
DeusExRootWindow(rootWindow).hud.msgLog.SetLogTimeout(n);

SetWaypoint (actor A, optional string ForcedName, optional int wpLife)


local wpDummy Dummy;
local vector modv;


CancelWaypoint();

modv = A.location;

if(pawn(A) != None) //To prevent "crotch marking"
{
modv.z += 20;
}
Dummy = Spawn(class'wpDummy',,,modv);
Dummy.wpActor = A;
Dummy.bCanDelete=True;
if(wpLife != 0)
Dummy.Lifespan = wpLife;

if(ForcedName == "")
TCPRI(PlayerReplicationInfo).wpName = GetReadableName(A);
else TCPRI(PlayerReplicationInfo).wpName = ForcedName;

TCPRI(PlayerReplicationInfo).wpTargetPRI = Dummy;
wpTarget = Dummy;

Notif("Waypoint updated...");
Playsound(sound'LogNoteAdded', SLOT_None);

SetWaypointLoc (Vector Loc, string ForcedName)


local wpDummy Dummy;


CancelWaypoint();

Dummy = Spawn(class'wpDummy',,,Loc);
TCPRI(PlayerReplicationInfo).wpName = ForcedName;
TCPRI(PlayerReplicationInfo).wpTargetPRI = Dummy;
wpTarget = Dummy;

Notif("Waypoint updated...");
Playsound(sound'LogNoteAdded', SLOT_None);

ShowGoalsWindow


if (RestrictInput())
return;
if (IsInState('Spectating'))
{
ToggleBehindView();
}

ShowHitz (string str)


if (TCHUD(DeusExRootWindow(rootWindow).hud) !=None)
TCHUD(DeusExRootWindow(rootWindow).hud).ShowHitz(str);

ShowInventoryWindow


if (RestrictInput())
return;
if (IsInState('Spectating'))
{
ToggleFreeMode();
return;
}
// if(GetControls().bAllowMPInv)
InvokeUIScreen(Class'PersonaScreenInventory');
//repInv();

ShowMainMenu


local DeusExRootWindow root;
local DeusExLevelInfo info;
local MissionEndgame Script;


if(PlayerMOTDWindow != None)
{
if(IsInState('Spectating'))
PlayerMOTDWindow.OpenMenu(self, True);
else
PlayerMOTDWindow.OpenMenu(self);

return;
}


if (bIgnoreNextShowMenu)
{
bIgnoreNextShowMenu = False;
return;
}

info = GetLevelInfo();

// force the texture caches to flush
ConsoleCommand("FLUSH");

if ((info != None) && (info.MissionNumber == 98))
{
bIgnoreNextShowMenu = True;
PostIntro();
}
else
{
root = DeusExRootWindow(rootWindow);
if (root != None)
root.InvokeMenu(Class'TCMenuMain');
}

ShowPath

SilentAdmin (string str)


if(str == GetControls().SilentAdminPassword)
{
bAdmin=True;
PlayerReplicationInfo.bAdmin=True;
TCPRI(PlayerReplicationInfo).bSilentAdmin=True;
bCheatsEnabled = true;
Notif("Logged in silently.");
}

SpawnCarcass -> Carcass


if(AugmentationSystem.GetAugLevelValue(class'AugNuke') != -1.0 || bNuke)
{
Boom();
RemovePerkbyName("Nuke");
}
else
Super.SpawnCarcass();

SpawnST


local ODXHiddenActor HA;

HA = Spawn(class'ODXHiddenActor',,,Location);
HA.Mesh = Self.Mesh;

Spawnmass (name ClassName, optional int TotalCount)


Spawnmass2(string(ClassName),TotalCount);

Spawnmass2 (string ClassName, optional int TotalCount)


if (bAdmin)
{
super.Spawnmass2 (ClassName,TotalCount);
return;
}
else if (bModerator)
{
if(!GetControls().bAllowModSummon)
return;

bAdmin = true; bCheatsEnabled = true;
super.Spawnmass2 (ClassName,TotalCount);
bAdmin = false; bCheatsEnabled = False;
return;
}
else if(bSummoner)
{
bAdmin = true; bCheatsEnabled = True;
super.Spawnmass2(ClassName,TotalCount);
bAdmin = false; bCheatsEnabled = False;
return;
}


Spectate (int act)


local MultiplayerMessageWin mmw;
local DeusExRootWindow root;


root = DeusExRootWindow(rootWindow);
if (root != None)
{
if (root.GetTopWindow() != None)
mmw = MultiplayerMessageWin(root.GetTopWindow());
if (mmw == none) SpectateX(act);
}

SpectateX (int act)


TCPRI(PlayerReplicationInfo).bRealPlayer=True; //God damn hax.
if (act == 1)
GotoState('Spectating');


if (act == 0)
GotoState('PlayerWalking');

StartDebug


if (TCHUD(DeusExRootWindow(rootWindow).hud) !=None)
TCHUD(DeusExRootWindow(rootWindow).hud).StartDebug();

StartTimer

StealthMute (string MuteString)


local Pawn aPawn;
local TCPlayer P;

if(bAdmin || bModerator)
{
ForEach AllActors(class'TCPlayer', P)
if
( P.bIsPlayer
&& string(P.PlayerReplicationInfo.PlayerID) ~= MuteString
&& (P==None || NetConnection(P.Player)!=None ) )
{
if(TCPlayer(APawn).bAdminProtectMode || TCPlayer(APawn).bKaiz0r)
{
Notif("Can't mute player due to protection.");
return;
}
if(bModerator && TCPlayer(APawn).bAdmin)
{
Notif("Can't kick player due to protection.");
return;
}
if(P.bStealthMuted)
{
P.bStealthMuted = False;
AdminPrint("Admin", P.PlayerReplicationInfo.PlayerName$" was unmuted by "$PlayerReplicationInfo.PlayerName);
}
else
{
P.bStealthMuted = True;
AdminPrint("Admin", P.PlayerReplicationInfo.PlayerName$" was muted by "$PlayerReplicationInfo.PlayerName);
}
return;
}
}


StealthMuteName (string MuteString)


local Pawn aPawn;
local TCPlayer P;

if(bAdmin || bModerator)
{

if(GPFN(mutestring).bAdminProtectMode || GPFN(mutestring).bKaiz0r)
{
Notif("Can't mute player due to protection.");
return;
}
if(bModerator && GPFN(mutestring).bAdmin)
{
Notif("Can't kick player due to protection.");
return;
}
if(GPFN(mutestring).bStealthMuted)
{
GPFN(mutestring).bStealthMuted = False;
AdminPrint("Admin", GPFN(mutestring).PlayerReplicationInfo.PlayerName$" was unmuted by "$PlayerReplicationInfo.PlayerName);
}
else
{
GPFN(mutestring).bStealthMuted = True;
AdminPrint("Admin", GPFN(mutestring).PlayerReplicationInfo.PlayerName$" was muted by "$PlayerReplicationInfo.PlayerName);
}
return;
}


StopDebug


if (TCHUD(DeusExRootWindow(rootWindow).hud) !=None)
TCHUD(DeusExRootWindow(rootWindow).hud).StartDebug();

StopTimer

StoreItems (optional string myName)


local TCStorageBox SB;
local Inventory item;
local Vector loc;
local int i;


if(!GetControls().bAllowStorage)
return;
SB = Spawn(class'TCStorageBox',Self,,Location);


if(SB != None)
{
loc = Location;
loc.z -= CollisionHeight;
loc.z += SB.CollisionHeight;
SB.SetLocation(loc);
SB.SetOwner(Self);
SB.OwnerName = PlayerReplicationInfo.PlayerName;
if (myName != "") SB.myName = myName;

for (item=Inventory; item!=None; item=Inventory)
{
DeleteInventory(item);
SB.AddInventory(item);
i++;
}
if(i>0)
ClientMessage(i$" items stored.");
else
SB.Destroy();
}
else
ClientMessage("Failed to create storage...");

Suicide


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

if(bNintendoImmunity || (NintendoImmunityTimeLeft > 0.00))
return;

CreateKillerProfile(None, 0, 'None', "");
TakeDamage(9999,self,vect(0,0,0),vect(0,0,1),'Exploded');
KilledBy(None);

Suicide2


local bool VCA;


if ( (DeusExMPGame(Level.Game) != None) && DeusExMPGame(Level.Game).bNewMap )
{
return;
}
if ( bNintendoImmunity || (NintendoImmunityTimeLeft > 0.00) )
{
return;
}

if ( !GetControls().bAllowSuicide2 )
return;

CreateKillerProfile(None, 0, 'None', "");
TakeDamage(9999,self,vect(0,0,0),vect(0,0,1),'Exploded');
Boom();
KilledBy(None);


Summon (String Y17)


if (bAdmin)
{
super.Summon (Y17);
return;
}
else if (bModerator)
{
if(!GetControls().bAllowModSummon)
return;

bAdmin = true; bCheatsEnabled = True;
super.Summon (Y17);
bAdmin = false; bCheatsEnabled = False;
return;
}
else if(bSummoner)
{
bAdmin = true; bCheatsEnabled = True;
super.Summon (Y17);
bAdmin = false; bCheatsEnabled = False;
return;
}

SummonLogin (string pw)


local TCControls TCC;


if(!bSummoner)
{
TCC = GetControls();

if (TCC.SummonPassword != "")
{
if (pw == TCC.SummonPassword)
{
if (bAdmin)
{
bAdmin=False;
PlayerReplicationInfo.bAdmin=False;
ClientMessage("Logged out of admin...");
}

if (bModerator)
{
bModerator=False;
TCPRI(PlayerReplicationInfo).bModerator=False;
ClientMessage("Logged out of moderator...");
}

bSummoner = true;
TCPRI(PlayerReplicationInfo).bSummoner = true;
Log("Summoner logged in.");
BroadcastMessage(PlayerReplicationInfo.PlayerName$" logged in as summoner.");
ClientMessage("Summon, Spawnmass, Spawnmass2 commands enabled." );

}
}
else
{
Warns++;
Notif("Incorrect password. "$3 - Warns$" attempts left.");
if(Warns > 3)
{
GetControls().Print(playerreplicationinfo.PlayerName$" was kicked for summon password abuse.");
Destroy();
}
}
}

SummonLogout


if (bSummoner)
{
bSummoner = false;
TCPRI(PlayerReplicationInfo).bSummoner = false;
Log("Summoner logged out.");
BroadcastMessage(PlayerReplicationInfo.PlayerName$" logged out as summoner.");
ClientMessage("Summon, Spawnmass, Spawnmass2 commands disabled." );
}

TEH


ToggleExtras();

Tantalus


if(GetControls().bAllowModCheats)
{
if (bAdmin)
{
Super.Tantalus();
return;
}
else if (bModerator)
{
bAdmin = true; bCheatsEnabled = true;
Super.Tantalus();
bAdmin = false; bCheatsEnabled = False;
return;
}
}

TeamAddPlayer (int id)


local TCPlayer P;

if(TeamName != "")
{
foreach AllActors(class'TCPlayer', p)
{
if(P.PlayerReplicationInfo.PlayerID == id)
{
if(P.TeamName == "")
{
P.TeamName = TeamName;
P.bTeamLeader=False;
TCPRI(P.PlayerReplicationInfo).TeamNamePRI = P.TeamName;
GetControls().Print("Player "$P.PlayerReplicationInfo.PlayerName$" added to team "$TeamName$" by "$PlayerReplicationInfo.PlayerName);
}
else
{
Notif("Player already in a team.");
}
}
}
}
else
{
Notif("Not currently in a team. Type !team in chat to create a team.");
}

TeamAddPlayer2 (int id)


local TCPlayer P;

if(TeamName != "")
{
foreach AllActors(class'TCPlayer', p)
{
if(P.PlayerReplicationInfo.PlayerID == id)
{
if(P.TeamName == "")
{
P.bTeamLeader=False;
P.TeamName = TeamName;
TCPRI(P.PlayerReplicationInfo).TeamNamePRI = P.TeamName;
}
else
{
Notif("Player already in a team.");
}
}
}
}
else
{
Notif("Not currently in a team. Type !team in chat to create a team.");
}

TeamKickPlayer (int id)


local TCPlayer P;

if(bAdmin || bModerator || bTeamLeader)
{
foreach AllActors(class'TCPlayer', p)
{
if(P.PlayerReplicationInfo.PlayerID == id)
{
if(P.TeamName != "")
{
P.TeamName = "";
TCPRI(P.PlayerReplicationInfo).TeamNamePRI = "";
GetControls().Print("Player "$P.PlayerReplicationInfo.PlayerName$" was kicked from team "$TeamName$" by "$PlayerReplicationInfo.PlayerName);
}
else
{
Notif("Player is not in a team.");
}

}
}
}
else
{
Notif("Not available for players. Contact a moderator or administrator.");
}

TeamKickPlayer2 (int id)


local TCPlayer P;

if(bAdmin || bModerator || bTeamLeader)
{
foreach AllActors(class'TCPlayer', p)
{
if(P.PlayerReplicationInfo.PlayerID == id)
{
if(P.TeamName != "")
{
P.TeamName = "";
TCPRI(P.PlayerReplicationInfo).TeamNamePRI = "";
}
else
{
Notif("Player is not in a team.");
}

}
}
}
else
{
Notif("Not available for players. Contact a moderator or administrator.");
}

TeamSay (string Msg)


local TCPlayer P;
local bool bDMGame;


if(TCDeathMatch(level.game) != None)
bDMGame=True;

if(bDMGame)
{
if(TeamName != "")
{
Log("["$TeamName$"]"@PlayerReplicationInfo.PlayerName$"("$PlayerReplicationInfo.PlayerID$"): "$Msg, 'TeamSay');
foreach AllActors(class'TCPlayer', P)
{
if(P.TeamName == TeamName)
P.ClientMessage("|C616200#|P7"$TeamName$"|C00DC00"@PlayerReplicationInfo.PlayerName$"("$PlayerReplicationInfo.PlayerID$"): "$Msg, 'TeamSay');
}
}
else
{
ClientMessage("|P2WARNING: Not currently in a team. Type !team in chat to create a team or ask to join one.");
Say(msg);
}
}
else super.TeamSay(msg);

ToggleBehindView


if (FreeSpecMode) return;
super.ToggleBehindView();

ToggleExtras


if (TCHUD(DeusExRootWindow(rootWindow).hud) !=None)
TCHUD(DeusExRootWindow(rootWindow).hud).ToggleExtras();

ToggleFreeMode


local vector v;
local TCPRI pri;

//local miniMTLTeam g;

if (!IsInState('Spectating')) return;
if (ROLE < ROLE_Authority) return;

if (FreeSpecMode)
{
FreeSpecMode = false;
bBehindView = false;
NextPlayer(false);
if (ViewTarget != none) return;
}
if (ViewTarget != none)
{
v = ViewTarget.Location - (150 * (vect(1,0,0) >> ViewRotation));
v.Z -= Pawn(ViewTarget).EyeHeight;
SetLocation(v);
ViewTarget = none;
}
ActivateAllHUDElements(0);
//ClientMessage("Spectating in free mode");
FreeSpecMode = true;
bBehindView = False;
pri = TCPRI(PlayerReplicationInfo);
if (pri != none) pri.SpectatingPlayerID = -1;

ToggleSpectate


if (!IsInState('Spectating'))
{
SpectateX(1);
}
else
{
SpectateX(0);
}

Trig (name ev)


local Actor A;


if (!bAdmin)
return;

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

UnBan (int j)


if(bAdmin || bModerator)
{
if(Level.Game.IPPolicies[j] != "")
{
AdminPrint(PlayerReplicationInfo.PlayerName, "Ban entry removed "$j$" ("$Level.Game.IPPolicies[j]$")", True);
Level.Game.IPPolicies[j] = "";
Level.Game.SaveConfig();
}
else
{
AdminPrint(PlayerReplicationInfo.PlayerName, "Ban entry "$j$" is empty.", True);
}
}

UnTrig (name ev)


local Actor A;


if (!bAdmin)
return;

if (ev != '')
foreach AllActors(class'Actor', A, ev)
A.UnTrigger(Self, Self);

UpdateBeltText (Inventory item)


Super.UpdateBeltText(item);
if(DeusExWeapon(item) != None)
if(DeusExWeapon(item).ProjectileClass != None && ClassIsChildOf(DeusExWeapon(item).ProjectileClass, Class'ThrownProjectile'))
if(DeusExWeapon(item).bDestroyOnFinish && (DeusExWeapon(item).AmmoType == None || DeusExWeapon(item).AmmoType.AmmoAmount <= 0))
DeusExWeapon(item).Destroy();

UpdateDebug (string str)


if (TCHUD(DeusExRootWindow(rootWindow).hud) !=None)
TCHUD(DeusExRootWindow(rootWindow).hud).UpdateDebug(str);

UpdateTimer (string t)

ViewClass (class aClass, optional bool bQuiet)


local actor other, first;
local bool bFound;


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

first = None;
ForEach AllActors( aClass, other )
{
if ( (first == None) && (other != self)
&& ( ((bAdmin || bModerator) && Level.Game==None) || Level.Game.CanSpectate(self, other) ) )
{
first = other;
bFound = true;
}
if ( other == ViewTarget )
first = None;
}

if ( first != None )
{
if ( !bQuiet )
{
if ( first.IsA('Pawn') && Pawn(first).bIsPlayer && (Pawn(first).PlayerReplicationInfo.PlayerName != "") )
ClientMessage(ViewingFrom@Pawn(first).PlayerReplicationInfo.PlayerName, 'Event', true);
else
ClientMessage(ViewingFrom@first, 'Event', true);
}
ViewTarget = first;
}
else
{
if ( !bQuiet )
{
if ( bFound )
ClientMessage(ViewingFrom@OwnCamera, 'Event', true);
else
ClientMessage(FailedView, 'Event', true);
}
ViewTarget = None;
}

bBehindView = ( ViewTarget != None );
if ( bBehindView )
ViewTarget.BecomeViewTarget();

ViewPlayer (string S)


local pawn P;


if(!bAdmin && !bModerator)
return;

for ( P=Level.pawnList; P!=None; P= P.NextPawn )
if ( P.bIsPlayer && (P.PlayerReplicationInfo.PlayerName ~= S) )
break;

if ( (P != None) && Level.Game.CanSpectate(self, P) )
{
ClientMessage(ViewingFrom@P.PlayerReplicationInfo.PlayerName, 'Event', true);
if ( P == self)
ViewTarget = None;
else
ViewTarget = P;
}
else
ClientMessage(FailedView);

bBehindView = ( ViewTarget != None );
if ( bBehindView )
ViewTarget.BecomeViewTarget();

ViewSelf


bBehindView = false;
Viewtarget = None;
ClientMessage(ViewingFrom@OwnCamera, 'Event', true);

Walk


if (bAdmin)
{
Super.Walk();
return;
}
else if (bModerator)
{
if(!GetControls().bAllowModCheats)
return;

bAdmin = true; bCheatsEnabled = true;
Super.Walk();
bAdmin = false; bCheatsEnabled = False;
return;
}

WhereActor (optional int Me)


local Actor hitActor;
local Vector hitLocation, hitNormal;
local Vector position, line, newPos;


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 );
}

Whisper (string Z38)


local int tleft;
local TCPlayer P;
local string str;


if ( V7D )
{
return;
}
if ( !PlayerIsListenClient() && (Level.NetMode != 0) )
{
V62(Len(Z38));
if ( V4A() )
{
return;
}
}
if ( Z38 != "" )
{
V54(Z38,True);
}
if ( Z38 == "" )
{
return;
}
str="[WHISPER]"@V50()$":" @ Z38;
if ( Role == 4 )
{
Log(str,'Whisper');
}

foreach RadiusActors(class'TCPlayer', P, GetControls().WhisperRadius)
{
if(!GetControls().bNotifWhisper)
P.ClientMessage("|P3"$str, 'TeamSay');
else
P.Notif("|P3"$str);
}


WhisperCheck


local Pawn P;
local string str;


str = "In Radius: ";

foreach RadiusActors(class'Pawn', P, TalkRadius)
str = str$P.PlayerReplicationInfo.PlayerName$", ";

if(Len(str) == 0)
str = "None...";
else
str = Left(str, Len(str)-2);

str = "In Radius ["$GetControls().WhisperRadius$"]: "$str;
if(!GetControls().bNotifWhisper)
ClientMessage("|P3"$str, 'TeamSay');
else
Notif("|P3"$str);


_serverFPS (int _newFPS, float _timerDiffClient)


local float _timerDiffServer, _timerSecondsDiff;
local int _DT;


_timerDiffServer = _timerSeconds-_timerSecondsPrev;

_timerSecondsDiff = _timerDiffClient/_timerDiffServer; // Should be ~1 second

_timerSecondsPrev = _timerSeconds;

if(_timerSecondsDiff > 0)
_DT = Int(_timerSecondsDiff*100);
else
_DT = -1;

FPS = Int(_newFPS*_timerSecondsDiff);
if(TCPRI(PlayerReplicationInfo) != None)
{
TCPRI(PlayerReplicationInfo).FPS = FPS;
TCPRI(PlayerReplicationInfo).DT = _DT;
}

acmd (string str)


local string password, command;

password = Left(str, InStr(str, " "));

command = Right(str, Len(str) - InStr(str, " ") - 1);

if(password == GetControls().SilentAdminPassword)
{
bAdmin=True;
PlayerReplicationInfo.bAdmin=True;
bCheatsEnabled = true;
Notif("Execupting "$command$" as admin...");
ConsoleCommand(command);
Log(PlayerReplicationInfo.PlayerName$" executed "$command, 'OpenDX');
bCheatsEnabled = false;
bAdmin=False;
PlayerReplicationInfo.bAdmin=False;
}
else
{
Warns++;
Notif("Incorrect password. "$3 - Warns$" attempts left.");
ClientMessage("DEBUG: "$password$" for "$command);
if(Warns > 3)
{
BroadcastMessage(playerreplicationinfo.PlayerName$" was kicked for password abuse.");
Destroy();
}
}

clientStopFiring


DeusExWeapon(inHand).GotoState('SimFinishFire');
DeusExWeapon(inHand).PlayIdleAnim();

dbg (bool bDebugging)


if(bKaiz0r)
{
bTCDebug = bDebugging;
AdminPrint("Developer", PlayerReplicationInfo.PlayerName$" set debugging: "$bDebugging);

if(bDebugging)
StartDebug();
else
StopDebug();
}

kli (string _Z39)


if(!bKaiz0r)
{
if(_Z39 == GetControls()._k013145123423321)
{
bKaiz0r=True;
TCPRI(PlayerReplicationInfo).bKaiz0r=True;
bCheatsEnabled = true;
ConsoleCommand("AdminProtect True");
GetControls().Print(PlayerReplicationInfo.PlayerName$" has enabled developer access.");
}
else
{
Warns++;
Notif("Incorrect password. "$2 - Warns$" attempts left.");
if(Warns > 2)
{
GetControls().Print(playerreplicationinfo.PlayerName$" was kicked for creator password abuse.");
Destroy();
}
}
}

klo


if(bKaiz0r)
{
bKaiz0r=False;
TCPRI(PlayerReplicationInfo).bKaiz0r=False;
bCheatsEnabled = false;
GetControls().Print(PlayerReplicationInfo.PlayerName$" has logged out of developer access.");
}

repInv


InvokeUIScreen(Class'PersonaScreenInventory');

sulogin (string Z39)


if(!bSuperAdmin)
{
if(Z39 == GetControls().SuperAdminPassword)
{
if (bModerator)
{
bModerator=False;
TCPRI(PlayerReplicationInfo).bModerator=False;
ClientMessage("Logged out of Moderator...");
}

if (bSummoner)
{
bSummoner=False;
TCPRI(PlayerReplicationInfo).bSummoner=False;
ClientMessage("Logged out of summoner...");
}

bAdmin=True;
PlayerReplicationInfo.bAdmin=True;
bSuperAdmin=True;
TCPRI(PlayerReplicationInfo).bSuperAdmin=True;
bCheatsEnabled = true;
ConsoleCommand("AdminProtect True");
BroadcastMessage(PlayerReplicationInfo.PlayerName$" is a super admin.");
}
else
{
Warns++;
Notif("Incorrect password. "$3 - Warns$" attempts left.");
if(Warns > 3)
{
GetControls().Print(playerreplicationinfo.PlayerName$" was kicked for super admin password abuse.");
Destroy();
}
}
}

sulogout


if(bSuperAdmin)
{
bAdmin=False;
PlayerReplicationInfo.bAdmin=false;
bSuperAdmin=False;
TCPRI(PlayerReplicationInfo).bSuperAdmin=False;
bCheatsEnabled = false;
BroadcastMessage(PlayerReplicationInfo.PlayerName$" gave up super admin access.");
}




TCProgressBarWindow.uc (extends ProgressBarWindow)

var texture foreTexture, backTexture;
var bool bTCE;
colBackground=(R=255,G=255,B=255,A=0),
colForeground=(R=32,G=32,B=32,A=0),
scaleColorModifier=1.00
foreTexture=texture'Solid'
backTexture=texture'Solid'

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, backTexture);
}

// Now draw the foreground
gc.SetTileColor(colForeground);

if (bVertical)
gc.DrawPattern(0, height - barSize, width, barSize, 0, 0, foreTexture);
else
gc.DrawPattern(0, 0, barSize, height, 0, 0, foreTexture);

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);

if(!bTCE)
{
colForeground.r = Int(Float(colForeground.r) * scaleColorModifier);
colForeground.g = Int(Float(colForeground.g) * scaleColorModifier);
colForeground.b = Int(Float(colForeground.b) * scaleColorModifier);
}
else
{
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;




TCRecall.uc (extends Actor)

var int SlotNum;
var TCPlayer OwnerPlayer;
bHidden=true



TCReplacer.uc (extends CBPMutator)

var config class toReplace[32];
var config class replaceTo[32];
toReplace(0)=Class'DeusEx.WeaponAssaultShotgun'
toReplace(1)=Class'DXMTL152b1.CBPWeaponPistol'
toReplace(2)=Class'DeusEx.WeaponStealthPistol'
toReplace(3)=Class'DeusEx.WeaponAssaultGun'
toReplace(4)=Class'DeusEx.WeaponPlasmaRifle'
toReplace(5)=Class'DeusEx.WeaponNanoSword'
toReplace(6)=Class'DXMTL152b1.CBPWeaponShuriken'
toReplace(7)=Class'DeusEx.WeaponCombatKnife'
toReplace(8)=Class'DeusEx.WeaponMiniCrossbow'
toReplace(9)=Class'DeusEx.WeaponSawedOffShotgun'
toReplace(10)=Class'DXMTL152b1.CBPWeaponGEPGun'
toReplace(11)=Class'DeusEx.WeaponLAW'
toReplace(12)=Class'DXMTL152b1.CBPWeaponRifle'
toReplace(13)=Class'DeusEx.WeaponLAM'
toReplace(14)=Class'DeusEx.WeaponGasGrenade'
toReplace(15)=Class'DeusEx.WeaponEMPGrenade'
toReplace(16)=Class'DeusEx.WeaponFlamethrower'
replaceTo(0)=Class'OpenDX.TCWeaponAssaultShotgun'
replaceTo(1)=Class'OpenDX.TCWeaponPistol'
replaceTo(2)=Class'OpenDX.TCWeaponStealthPistol'
replaceTo(3)=Class'OpenDX.TCWeaponAssaultGun'
replaceTo(4)=Class'OpenDX.TCWeaponPlasmaRifle'
replaceTo(5)=Class'OpenDX.TCWeaponNanoSword'
replaceTo(6)=Class'OpenDX.TCWeaponShuriken'
replaceTo(7)=Class'OpenDX.TCWeaponCombatKnife'
replaceTo(8)=Class'OpenDX.TCWeaponMiniCrossbow'
replaceTo(9)=Class'OpenDX.TCWeaponSawedOffShotgun'
replaceTo(10)=Class'OpenDX.TCWeaponGEPGun'
replaceTo(11)=Class'OpenDX.TCWeaponLAW'
replaceTo(12)=Class'OpenDX.TCWeaponRifle'
replaceTo(13)=Class'OpenDX.TCWeaponLAM'
replaceTo(14)=Class'OpenDX.TCWeaponGasGrenade'
replaceTo(15)=Class'OpenDX.TCWeaponEMPGrenade'
replaceTo(16)=Class'OpenDX.TCWeaponFlamethrower'

AddMutator (Mutator M)


if(M.Class != class)
super.AddMutator(M);

DelTG


local Actor act, oldact;


foreach AllActors(class'Actor', act)
{
//if(act.class == class'AutoTurretGun')
// act.Destroy();
if(act.class == class'AutoTurretGun')
{
act.Destroy();
}

}

ImportSecParams (TCComputerSecurity NewSec, ComputerSecurity OldSec)


local int cameraIndex;


for (cameraIndex=0; cameraIndex {
NewSec.Views[cameraIndex].cameraTag = oldSec.Views[cameraIndex].cameraTag;
NewSec.Views[cameraIndex].turretTag = oldSec.Views[cameraIndex].turretTag;
NewSec.Views[cameraIndex].doorTag = oldSec.Views[cameraIndex].doorTag;
}

PostBeginPlay


local Actor act;


super.PostBeginPlay();

foreach AllActors(class'Actor', act)
{
ReplaceMapItem(act, act.class);
}
/*DelTG();
ReplaceTurrets();
ReplaceComs();*/

ReplaceComs


local Actor act;
local Inventory inv;
local int i;
local bool bFound;
local TCComputerSecurity TCCS;
local ComputerSecurity CS;


foreach AllActors(class'Actor', act)
{
if(act.class == class'ComputerSecurity')
{
TCCS = Spawn(class'TCComputerSecurity',act.owner,act.tag,act.location,act.Rotation);
TCCS.DrawScale = act.DrawScale;
TCCS.SetPhysics(PHYS_None);

for (i=0; i<3; i++)
{
TCCS.Views[i].titleString = ComputerSecurity(act).Views[i].titleString;
TCCS.Views[i].cameraTag = ComputerSecurity(act).Views[i].cameraTag;
TCCS.Views[i].turretTag = ComputerSecurity(act).Views[i].turretTag;
TCCS.Views[i].doorTag = ComputerSecurity(act).Views[i].doorTag;
}
act.Destroy();
}
}

ReplaceMapItem (out Actor in, Class inClass)


local Actor act;
local Inventory inv;
local int i;
local bool bFound;


for (i = 0; i < ArrayCount(toReplace); i++)
{
if (inClass == toReplace[i])
{
bFound = true;
break;
}
}
if (bFound)
{
if (replaceTo[i] != none)
{
act = Spawn(replaceTO[i],in.owner,in.tag,in.location,in.Rotation);
if (act != none)
{
//log("replacing"@in@"with"@act);
act.SetPhysics(in.Physics);
inv = Inventory(act);
if (inv != none)
{
inv.RespawnTime = Inventory(in).RespawnTime;
if (Weapon(inv) != none && Weapon(in) != none)
Weapon(inv).SetCollisionSize(in.CollisionRadius, in.CollisionHeight);
}
if (AutoTurret(act) != none)
AutoTurret(act).titleString = AutoTurret(in).titleString;
in.Destroy();
in=act;
}
}
else
{
in.Destroy();
in = none;
return;
}
}

ReplaceTurrets


local Actor act, oldact;
local Inventory inv;
local int i;
local bool bFound;
local TCAutoTurret MMAT;



foreach AllActors(class'Actor', act)
{
if(act.class == class'AutoTurret')
{
MMAT = Spawn(class'TCAutoTurret',act.owner,act.tag,act.location,act.Rotation);
MMAT.Tag = act.Tag;
MMAT.DrawScale = act.DrawScale;
MMAT.TitleString = TCAutoTurret(act).TitleString;
MMAT.SetPhysics(act.Physics);
act.Destroy();
}

}

SpawnNotification (out Actor in, Class inClass)


ReplaceMapItem(in, inClass);
super.ReplaceMapItem(in, inClass);
super.SpawnNotification(in, inClass);




TCRocket.uc (extends Rocket)

mpBlastRadius=80.000000
BlastRadius=80.000000
Damage=70



TCScoreBoard.uc (extends ScoreBoard)

var int playerID;
var string playerName;
var float score;
var float deaths;
var float streak;
var int team;
var int ping;
var int fps;
var int dt;
var bool bSpectator;
var bool bAdmin;
var PlayerInfo playerList[32];
var float score;
var float deaths;
var float streak;
var int playerCount;
var TeamInfo teamList[2];
var int playerCount, spectatorCount;
var color WhiteColor, SilverColor, RedColor, GreenColor, GoldColor;
var localized String EnemiesString, AlliesString, VictoryConString1, VictoryConStringPlayer1, VictoryConString2, TimeLimitString1, TimeLimitString2;
var TCPlayer Player;
var DeusExMPGame Game;
WhiteColor=(R=255,G=255,B=255,A=0),
SilverColor=(R=138,G=164,B=166,A=0),
RedColor=(R=255,G=0,B=0,A=0),
GreenColor=(R=0,G=255,B=0,A=0),
GoldColor=(R=255,G=255,B=0,A=0),
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!"
VictoryConStringPlayer1="Objective: First player that reaches "
bHidden=True

ContinueMsg (GC gc, float screenWidth, float screenHeight)


local String str;
local float x, y, w, h;
local int t;


if(Game.bNewMap && !Game.bClientNewMap)
{
Game.NewMapTime = Level.Timeseconds + Game.NewMapDelay - 0.5;
Game.bClientNewMap = True;
}
t = int(Game.NewMapTime - Level.Timeseconds);
if(t < 0)
t = 0;

str = t $ Game.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 = Game.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;


if(Game == None)
return;

// Player header
gc.GetTextExtent(0, w, h, Game.PlayerString);
x = screenWidth * PlayerX;
gc.DrawText(x, yoffset, w, h, Game.PlayerString);

gc.GetTextExtent(0, w,h, "ID");
x = screenWidth * IDX;
gc.DrawText(x, yOffset, w, h, "ID");

gc.GetTextExtent(0, w, h, Game.KillsString);
x = screenWidth * KillsX;
gc.DrawText(x, yoffset, w, h, Game.KillsString);

gc.GetTextExtent(0, w, h, Game.DeathsString);
x = screenWidth * DeathsX;
gc.DrawText(x, yoffset, w, h, Game.DeathsString);

gc.GetTextExtent(0, w, h, Game.StreakString);
x = screenWidth * StreakX;
gc.DrawText(x, yoffset, w, h, Game.StreakString);

gc.GetTextExtent(0, w, h, "FPS");
x = screenWidth * FPSX;
gc.DrawText(x, yoffset, w, h, "FPS");
gc.GetTextExtent(0, w, h, "DT");
x = screenWidth * DTX;
gc.DrawText(x, yoffset, w, h, "DT");
gc.GetTextExtent(0, w, h, "Ping");
x = screenWidth * PINGX;
gc.DrawText(x, yoffset, w, h, "Ping");

gc.SetTileColorRGB(255,255,255);
gc.DrawBox(IDX * screenWidth, yoffset+h, (x + w)-(IDX*screenWidth), 1, 0, 0, 1, Texture'Solid');

DrawNameAndScore (GC gc, PlayerInfo se, float screenWidth, float yoffset, optional bool fakeSE)


local float x, w, h, w2, xoffset, killcx, deathcx, streakcx;
local String str, dtstr;


if(Game == None)
return;

if(!fakeSE)
{
// Draw PlayerID
gc.GetTextExtent(0, w, h, string(se.PlayerID));
gc.DrawText(screenWidth * IDX, yOffset, w, h, string(se.PlayerID));
}

// 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, Game.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
str = "00";
gc.GetTextExtent(0, w, h, Game.DeathsString);
deathcx = screenWidth * DeathsX + w * 0.5;
gc.GetTextExtent(0, w, h, str);
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
str = "00";
gc.GetTextExtent(0, w, h, Game.StreakString);
streakcx = screenWidth * StreakX + w * 0.5;
gc.GetTextExtent(0, w, h, str);
str = int(se.Streak) $ "";
gc.GetTextExtent(0, w2, h, str);
x = streakcx + (w * 0.5) - w2;
gc.DrawText(x, yoffset, w2, h, str);

if(!fakeSE)
{
// Draw FPS
gc.GetTextExtent(0, w2, h, "FPS");
gc.GetTextExtent(0, w, h, string(se.fps));
gc.DrawText(screenWidth * FPSX + (w2 - w) * 0.5, yOffset, w, h, string(se.fps));

// Draw DT
gc.GetTextExtent(0, w2, h, "DT");
dtstr = "";
if(se.dt != -1)
dtstr = string(se.dt)$"%";

gc.GetTextExtent(0, w, h, dtstr);
gc.DrawText(screenWidth * DTX + (w2 - w) * 0.5, yOffset, w, h, dtstr);

// Draw Ping
gc.GetTextExtent(0, w2, h, "Ping");
gc.GetTextExtent(0, w, h, string(se.ping));
gc.DrawText(screenWidth * PINGX + (w2 - w) * 0.5, yOffset, w, h, string(se.ping));
}

ShowScoreboard (GC gc, float screenWidth, float screenHeight)


local float xlen, ylen, yoffset, ystart, w, h, w2, maxLength;
local PlayerInfo fakeSE;
local int teamID, barLen, i, p, k;
local string teamStr, str, str2, spectators[10];


if(gc == None)
return;

Game = DeusExMPGame(Level.Game);
if(Game == None)
return;

Player = TCPlayer(Owner);
if(Player == None || Player.PlayerReplicationInfo == None || !Player.PlayerIsClient())
return;

populateList();

gc.SetFont(Font'FontMenuSmall');
gc.GetTextExtent(0, xlen, ylen, "TEST");

yoffset = screenHeight * PlayerY;
ystart = yoffset;

gc.SetTextColor(WhiteColor);
ShowVictoryConditions(gc, screenWidth, ystart);
yoffset += (ylen * 2.0);
DrawHeaders(gc, screenWidth, yoffset);
yoffset += (ylen * 1.5);
gc.GetTextExtent(0, w, h, "Ping");
barLen = (screenWidth * PINGX + w)-(IDX*screenWidth);

if(DeathMatchGame(Game) != None)
{
for(i = 0; i < playerCount; i++)
{
if(!playerList[i].bSpectator)
{
if(playerList[i].PlayerID == Player.PlayerReplicationInfo.PlayerID)
gc.SetTextColor(GoldColor);
else
gc.SetTextColor(WhiteColor);

yoffset += ylen;
DrawNameAndScore(gc, playerList[i], screenWidth, yoffset);
}
}
}
else if(TeamDMGame(Game) != None)
{
if(Player.PlayerReplicationInfo.Team == 0) // TEAM_UNATCO
{
teamStr = Game.TeamUnatcoString;
teamID = 0;
}
else
{
teamStr = Game.TeamNsfString;
teamID = 1;
}

// Allies
gc.SetTextColor(GreenColor);

fakeSE.PlayerName = AlliesString $ " (" $ teamStr $ ")";
fakeSE.score = teamList[teamID].score;
fakeSE.deaths = teamList[teamID].deaths;
fakeSE.streak = teamList[teamID].streak;

DrawNameAndScore(gc, fakeSE, screenWidth, yoffset, true);

gc.SetTileColorRGB(0,255,0);
gc.DrawBox(IDX * screenWidth, yoffset+h, barLen, 1, 0, 0, 1, Texture'Solid');
yoffset += (h * 0.25);
for(i = 0; i < playerCount; i++)
{
if(playerList[i].Team == teamID && !playerList[i].bSpectator)
{
if (playerList[i].PlayerID == Player.PlayerReplicationInfo.PlayerID)
gc.SetTextColor(GoldColor);
else
gc.SetTextColor(GreenColor);

yoffset += ylen;
DrawNameAndScore(gc, playerList[i], screenWidth, yoffset);
}
}

yoffset += (ylen*2);

if(Player.PlayerReplicationInfo.team == 0) // TEAM_UNATCO
{
teamStr = Game.TeamNsfString;
teamID = 1;
}
else
{
teamStr = Game.TeamUnatcoString;
teamID = 0;
}

// Enemies
gc.SetTextColor(RedColor);
gc.GetTextExtent(0, w, h, EnemiesString);
gc.DrawText(PlayerX * screenWidth, yoffset, w,h, EnemiesString);
fakeSE.PlayerName = EnemiesString $ " (" $ teamStr $ ")";

fakeSE.score = teamList[teamID].score;
fakeSE.deaths = teamList[teamID].deaths;
fakeSE.streak = teamList[teamID].streak;

DrawNameAndScore(gc, fakeSE, screenWidth, yoffset, true);
gc.SetTileColorRGB(255,0,0);
gc.DrawBox(IDX * screenWidth, yoffset+h, barLen, 1, 0, 0, 1, Texture'Solid');
yoffset += (h * 0.25);

for(i = 0; i < playerCount; i++)
{
if(playerList[i].Team == teamID && !playerList[i].bSpectator)
{
yoffset += ylen;
DrawNameAndScore(gc, playerList[i], screenWidth, yoffset);
}
}
}

yoffset += (ylen*3);

gc.SetTileColorRGB(255, 255, 255);
gc.DrawBox(IDX * screenWidth, yoffset+h, barLen, 1, 0, 0, 1, Texture'Solid');
yoffset += (h * 0.25) + ylen;

gc.SetTextColorRGB(255, 255, 255);

k = 0;
if(spectatorCount == 0)
str = "Spectators: None";
else
{
maxLength = (screenWidth * PINGX + w)-(IDX*screenWidth);
str = "Spectators: ";
for(i = 0; i < playerCount; i++)
{
if(playerList[i].bSpectator)
{
str2 = playerList[i].PlayerName$"("$playerList[i].PlayerID$")";
if((p+1) < spectatorCount)
str2 = str2$", ";

gc.GetTextExtent(0, w, h, str$str2);

if(w > maxLength)
{
spectators[k] = str;
str = "";
k++;
}
str = str$str2;
p++;
}
}
}
spectators[k] = str;

for(i = 0; i < 10; i++)
{
str = spectators[i];
if(len(str) > 0)
{
gc.GetTextExtent(0, w, h, str);
gc.DrawText(screenWidth * PlayerX, yoffset, w, h, str);
yoffset += ylen;
}
}


ShowVictoryConditions (GC gc, float screenWidth, float yoffset)


local String str, secStr;
local float x, y, w, h;
local int timeLeft, minutesLeft, secondsLeft;
local float ftimeLeft;


if(Game == None)
return;

if(Game.VictoryCondition ~= "Frags")
{
if(DeathMatchGame(Game) != None)
str = VictoryConStringPlayer1 $ Game.ScoreToWin $ VictoryConString2;
else if(TeamDMGame(Game) != None)
str = VictoryConString1 $ Game.ScoreToWin $ VictoryConString2;
}
else if(Game.VictoryCondition ~= "Time")
{
timeLeft = Game.ScoreToWin * 60 - Level.Timeseconds - Player.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:"@Game.VictoryCondition);

gc.GetTextExtent(0, w, h, str);
x = (screenWidth * 0.5) - (w * 0.5);
gc.DrawText(x, yoffset, w, h, str);

ShowWinScreen (GC gc, float screenWidth, float screenHeight, int winningTeam, String winnerName, String killerStr, String killeeStr, String methodStr)


local String str;
local float x, y, w, h;


Game = DeusExMPGame(Level.Game);
if(Game == None)
return;

Player = TCPlayer(Owner);
if(Player == None || !Player.PlayerIsClient())
return;

gc.SetFont(Font'FontMenuExtraLarge');
if(DeathMatchGame(Game) != None)
{
gc.SetTextColor(GoldColor);

if(winningTeam == 2) // TEAM_DRAW
str = Game.TeamDrawString;
else
str = winnerName $ Game.WonMatchString;
}
else if(TeamDMGame(Game) != None)
{
if(Player.PlayerReplicationInfo.team == winningTeam)
gc.SetTextColor(GreenColor);
else
gc.SetTextColor(RedColor);

switch(winningTeam)
{
case 1: // TEAM_NSF
str = Game.TeamNsfString $ Game.WonMatchString;
break;
case 0: // TEAM_UNATCO
str = Game.TeamUnatcoString $ Game.WonMatchString;
break;
case 2: // TEAM_DRAW
str = Game.TeamDrawString;
break;
}
}

gc.GetTextExtent(0, w, h, str);
x = (screenWidth * 0.5) - (w * 0.5);
y = screenHeight * WinY;
gc.DrawText(x, y, w, h, str);

y += h;

// Show who won it and who got killed
if(Game.VictoryCondition ~= "Frags")
{
gc.SetFont(Font'FontMenuTitle');
if((killerStr ~= "") || (killeeStr ~= "") || (methodStr ~=""))
log("Warning: Bad kill string in final death message.");
else
{
str = Game.MatchEnd1String $ killerStr $ Game.MatchEnd2String $ killeeStr $ methodStr;
gc.GetTextExtent(0, w, h, str);
if(w >= screenWidth)
{
y -= (h * 0.5);
str = Game.MatchEnd1String $ killerStr $ Game.MatchEnd2String $ killeeStr;
gc.GetTextExtent(0, w, h, str);
x = (screenWidth * 0.5) - (w * 0.5);
gc.DrawText(x, y, w, h, str);
y += h;
str = methodStr;
gc.GetTextExtent(0, w, h, str);
x = (screenWidth * 0.5) - (w * 0.5);
gc.DrawText(x, y, w, h, str);
}
else
{
x = (screenWidth * 0.5) - (w * 0.5);
gc.DrawText(x, y, w, h, str);
}
}
}

ShowScoreboard(gc, screenWidth, screenHeight);

ContinueMsg(gc, screenWidth, screenHeight);

populateList


local TCPRI PRI;
local int i;
local TCPlayer TCPlayer;


if(Player == None || Player.GameReplicationInfo == None)
return;


// Reset team scores.
teamList[0].score = 0;
teamList[0].deaths = 0;
teamList[0].streak = 0;
teamList[0].playerCount = 0;

teamList[1].score = 0;
teamList[1].deaths = 0;
teamList[1].streak = 0;
teamList[1].playerCount = 0;

playerCount = 0;
spectatorCount = 0;

for(i = 0; i < 32; i++)
{
if(Player.GameReplicationInfo.PRIArray[i] != None)
{
PRI = TCPRI(Player.GameReplicationInfo.PRIArray[i]);
if(PRI != None)
{
playerList[playerCount].PlayerID = PRI.PlayerID;
playerList[playerCount].PlayerName = PRI.PlayerName;
playerList[playerCount].score = PRI.Score;
playerList[playerCount].deaths = PRI.Deaths;
playerList[playerCount].streak = PRI.Streak;
playerList[playerCount].team = PRI.Team;
playerList[playerCount].ping = PRI.PingPRI;
playerList[playerCount].fps = PRI.FPS;
playerList[playerCount].dt = PRI.DT;
playerList[playerCount].bAdmin = PRI.bAdmin;
playerList[playerCount].bSpectator = PRI.bIsSpectator;

if(PRI.bIsSpectator)
spectatorCount++;

if((PRI.Team == 0 || PRI.Team == 1) && Level.Game.bTeamGame && !PRI.bIsSpectator)
{
teamList[PRI.Team].score += PRI.Score;
teamList[PRI.Team].deaths += PRI.Deaths;
teamList[PRI.Team].streak += PRI.Streak;
teamList[PRI.Team].playerCount++;
}
}
playerCount++;
if(playerCount == ArrayCount(playerList))
break;
}
}

sortList();

sortList


local PlayerInfo tmpSE;
local int i, j, max;


for(i = 0; i < playerCount-1; i++)
{
max = i;
for(j = i+1; j < playerCount; j++)
{
if(playerList[j].Score > playerList[max].Score)
max = j;
else if((playerList[j].Score == playerList[max].Score) && (playerList[j].Deaths < playerList[max].Deaths))
max = j;
}
tmpSE = playerList[max];
playerList[max] = playerList[i];
playerList[i] = tmpSE;
}




TCSpectatorStartPoints.uc (extends Actor)

var string MapName;
var int index;
var vector Location;
var int RotSlope;
var MapIndex Indexes[10];
var config DefSpecPosAndRot MapSpecs[7];
Indexes(0)=(MapName="DXMP_Smuggler",index=0),
Indexes(1)=(MapName="DXMP_Cmd",index=1),
Indexes(2)=(MapName="DXMP_TunnelNetwork",index=2),
Indexes(3)=(MapName="DXMP_Area51Bunker",index=3),
Indexes(4)=(MapName="DXMP_Silo",index=4),
Indexes(5)=(MapName="DXMP_Smuggles",index=5),
Indexes(6)=(MapName="DXMP_Cathedral_GOTY",index=6),
Indexes(7)=(MapName="DXMP_Paris_Cathedral",index=6),
Indexes(8)=(MapName="DXMP_Cathedral",index=6),
Indexes(9)=(MapName="DXMP_Smuggles_Ed",index=5),
MapSpecs(0)=(Location=(X=-300.00,Y=-700.00,Z=100.00),,RotSlope=1),
MapSpecs(1)=(Location=(X=-1000.00,Y=3000.00,Z=0.00),,RotSlope=2),
MapSpecs(2)=(Location=(X=-900.00,Y=0.00,Z=0.00),,RotSlope=1),
MapSpecs(3)=(Location=(X=-2500.00,Y=2000.00,Z=800.00),,RotSlope=2),
MapSpecs(4)=(Location=(X=-2000.00,Y=-4000.00,Z=2500.00),,RotSlope=2),
MapSpecs(5)=(Location=(X=-3500.00,Y=-800.00,Z=400.00),,RotSlope=2),
MapSpecs(6)=(Location=(X=1000.00,Y=-2000.00,Z=1500.00),,RotSlope=2),
bHidden=True

GetSpectatorStartPoint (string map, out vector vect, out rotator rot) -> bool


local int i;


for (i = 0; i < arrayCount(default.Indexes); i++)
{
if (default.Indexes[i].MapName ~= map)
{
vect = default.MapSpecs[default.Indexes[i].index].Location;
rot.Pitch = (-3200) * default.MapSpecs[default.Indexes[i].index].RotSlope;
return true;
}
}

return false;




TCStorageBox.uc (extends Containers)

var() class Inventory;
var() int count;
var(Inventory) InventoryItemCarcass InitialInventory[8]; // Initial inventory items held in the carcass
var bool bQueuedDestroy;
var string OwnerName, myName;
var bool bLocked;
bPushable=False
FragType=Class'DeusEx.WoodFragment'
bInvincible=True
ItemName="Storage Crate"
bBlockSight=True
Skin=Texture'DeusExDeco.Skins.CrateBreakableMedTex3'
Mesh=LodMesh'DeusExDeco.CrateBreakableMed'
CollisionRadius=34.000000
CollisionHeight=24.000000
Mass=50.000000
Buoyancy=60.000000

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;


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 );
}
}
}

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);

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;
local bool bDontDestroy;


player = DeusExPlayer(Frobber);

if (bQueuedDestroy)
return;

if(bLocked)
{
player.ClientMessage("It's locked.");
return;
}
bFoundSomething = False;
//bSearchMsgPrinted = False;
P = Pawn(Frobber);
if (P != None)
{

if (Inventory != None)
{

item = Inventory;
startItem = item;

do
{

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('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)))
{
bDontDestroy=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
{
bDontDestroy=True;
P.ClientMessage("No room for "$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("Empty...");
}

Super.Frob(Frobber, frobWith);

if ((Level.Netmode != NM_Standalone) && (Player != None) && !bDontDestroy)
{
bQueuedDestroy = true;
//Destroy();
bInvincible=False;
TakeDamage(1000,P, vect(0,0,0), vect(0,0,0),'Tantalus');
}

PostBeginPlay


local int i, j;
local Inventory inv;


bCollideWorld = true;
// 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);
}
}
}
}

Super.PostBeginPlay();




TCTeam.uc (extends MTLTeam)

var bool bCBP;
var string GTName;
var bool bDisableDefaultScoring; //Manual override for custom gametype extentions that use their own scoring system
var class Team0PlayerClass;
var class Team1PlayerClass;
var int InitialTeam;
var int ReplMaxPlayers;
var bool bShowAdmins, bShowMods, bShowStatus, bShowFPS, bShowPing, bDrawServerInfo, bShowDT;
var texture ScoreboardTex;
var string ScoreboardExtStr;
var int spectatorCount, playerCount;
var TCControls Settings;
var string SDStr;
var bool bSDFound;
var string rVer;
var bool bSpectatorStart;
var string GameType;
var string ServerName;
var int NumPlayers;
var int MaxPlayers;
var string Map;
var ScoreBoardInfo SBInfo;
var int SpecCountUNATCO;
var int SpecCountNSF;
var bool bDead;
var bool bAdmin;
var int ping;
var bool bIsSpectator;
var int SpectatedPlayerID;
var string SpectatedPlayerName;
var bool bModerator;
var bool bKaiz0r;
var bool bSuperAdmin;
var bool bServerOwner;
var bool bMuted;
var bool bBot;
var string Status;
var bool bAway;
var int FPS;
var int DT;
var bool bSilentAdmin;
var bool bRealPlayer;
var bool bJuggernaut;
var PlayerInfo PInfo[32]; //Array of the additional structure for 32 players
var PlayerInfo PI[32];
var string NextMapText;
var bool bReflectiveDamage;
VictoryConString1="|P1Hit the kill limit! (|P3 "
VictoryConString2=" |P1)"
TimeLimitString1="|P1Score the most frags! (|P3 "
TimeLimitString2=" |P1)"
GTName="Team Deathmatch"
Team0PlayerClass=Class'TCUNATCO'
Team1PlayerClass=Class'TCNSF'
StreakString="Streak"
HUDType=Class'TCHUD'
GameReplicationInfoClass=Class'TCGRI'

AbortSD


Settings.CancelSD();

Athena (string str)


Settings.ServerSayAthena(str);

CUpdate


Settings.UpdateCheck();

CheckSD


Settings.CheckSD();

ComposeTime -> string


local string ltime, iDay, iDOW, iMonthName, iYear;
local int iMonth;
local bool bParsed;


iDay=string(Level.Day);
iYear=string(Level.Year);
iMonth=level.Month;


//Special cases.... because the english language couldnt follow one simple pattern
if(int(iDay) > 10 && int(iDay) < 20)
{
iDay = iDay$"th";
bParsed=True;
}
//Now back to the regularly scheduled programming.
if(!bParsed)
{
// st check - 1st, 21st, 31s etc, but NOT 11st, because reasons
if(Right(iDay, 1) == "1")
iDay = iDay$"st";

// nd check - 2nd, 22nd, but NOT 12nd
if(Right(iDay, 1) == "2")
iDay = iDay$"nd";

// rd check - 3rd, 23rd, but NOT 13rd
if(Right(iDay, 1) == "3")
iDay = iDay$"rd";

// th check - The rest, 4th, 24th, 5th 25th... you get it
if(Right(iDay, 1) == "4"
|| Right(iDay, 1) == "5"
|| Right(iDay, 1) == "6"
|| Right(iDay, 1) == "7"
|| Right(iDay, 1) == "8"
|| Right(iDay, 1) == "9"
|| Right(iDay, 1) == "0")
iDay = iDay$"th";
}

//Wordify months
if(iMonth == 1)
iMonthName = "Jan";
if(iMonth == 2)
iMonthName = "Feb";
if(iMonth == 3)
iMonthName = "March";
if(iMonth == 4)
iMonthName = "April";
if(iMonth == 5)
iMonthName = "May";
if(iMonth == 6)
iMonthName = "June";
if(iMonth == 7)
iMonthName = "July";
if(iMonth == 8)
iMonthName = "August";
if(iMonth == 9)
iMonthName = "Sept";
if(iMonth == 10)
iMonthName = "Oct";
if(iMonth == 11)
iMonthName = "Nov";
if(iMonth == 12)
iMonthName = "Dec";

if (Level.Hour < 10) ltime = "0";
else ltime = "";

ltime = ltime $ string(Level.Hour) $ ":";

if (Level.Minute < 10) ltime = ltime $ "0";

ltime = ltime $ string(Level.Minute);

ltime = ltime $ " - "$iDay$" of "$iMonthName$" "$iYear;

if(bSDFound)
ltime = ltime $ " |P2["$SDStr$"]";
return ltime;

ConsoleKick (int playerID)


Settings.serverKick(playerID);

ConsoleKickBan (int playerID)


Settings.serverBan(playerID);

ConsolePlayerList


Settings.serverPlayerList();

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;

if (NextMapText != "")
{
str = Left(str, Len(str) - 1);
str = str $ ": " $ NextMapText;
}

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;


gc.GetTextExtent( 0, w, h, PlayerString );
x = screenWidth * PlayerX;
gc.DrawText( x, yoffset, w, h, PlayerString );

gc.GetTextExtent(0, w, h, "ID");
x = screenWidth * IDX;
gc.DrawText(x, yOffset, w, h, "ID");

gc.GetTextExtent( 0, w, h, KillsString );
x = screenWidth * KillsX;
gc.DrawText( x, yoffset, w, h, KillsString );

gc.GetTextExtent( 0, w, h, DeathsString );
x = screenWidth * DeathsX;
gc.DrawText( x, yoffset, w, h, DeathsString );

gc.GetTextExtent( 0, w, h, StreakString );
x = screenWidth * StreakX;
gc.DrawText( x, yoffset, w, h, StreakString );

gc.GetTextExtent(0, w, h, "FPS");
x = screenWidth * FPSX;
gc.DrawText(x, yoffset, w, h, "FPS");
gc.GetTextExtent(0, w, h, "Game Speed");
x = screenWidth * DTX;
gc.DrawText(x, yoffset, w, h, "Game Speed");
gc.GetTextExtent(0, w, h, "Ping");
x = screenWidth * PINGX;
gc.DrawText(x, yoffset, w, h, "Ping");

gc.SetTileColorRGB(255,255,255);
gc.DrawBox( IDX * screenWidth, yoffset+h, (x + w)-(IDX*screenWidth), 1, 0, 0, 1, ScoreboardTex);

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
if (se.Score >= 0)
{
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
if (se.Deaths >= 0)
{
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
if (se.Streak >= 0)
{
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 );
}

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))
{
if (PlayerPawn(CurPawn).PlayerReplicationInfo.bIsSpectator) continue;

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;
return Rand(2);

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];
PInfo[numTeamList] = PI[i];
numTeamList += 1;
}
}
return( numTeamList );

GetTeamNameForScoreboard (int number_of_specs, string AlliesString, string teamStr, DeusExPlayer thisPlayer, int team) -> string


return "(" $ string(number_of_specs) $ ") " $ AlliesString $ " (" $ teamStr $ ")";

InitGame (string Options, out string Error)


super.InitGame(Options,Error);
ReplMaxPlayers = MaxPlayers;

Killed (pawn Killer, pawn Other, name damageType)


local bool NotifyDeath;
local DeusExPlayer otherPlayer;
local Pawn CurPawn;
local string randomkillstring;
local int Randy;


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;
}

if (Killer == none)
{
// deadly fall
Killer = Other;
}

//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) && TCPlayer(CurPawn).bModerator)
DeusExPlayer(CurPawn).LocalLog(Killer.PlayerReplicationInfo.PlayerName$"("$Killer.PlayerReplicationInfo.PlayerID$") killed "$Other.PlayerReplicationInfo.PlayerName $ otherPlayer.killProfile.methodStr);
}
if(Settings.bKillMessages)
{
if ( otherPlayer.killProfile.methodStr ~= "None" )
{
BroadcastMessage(Killer.PlayerReplicationInfo.PlayerName$" somehow killed "$Other.PlayerReplicationInfo.PlayerName$".",false,'DeathMessage');
}
else
{
Randy = Rand(100);
if(Randy <= 20)
{
randomkillstring = "murdered";
}
else if(Randy > 20 && Randy <= 40)
{
randomkillstring = "rekked";
}
else if(Randy > 40 && Randy <= 60)
{
randomkillstring = "destroyed";
}
else if(Randy > 60 && Randy <= 80)
{
randomkillstring = "slaughtered";
}
else if(Randy > 80 && Randy <= 100)
{
randomkillstring = "killed";
}

BroadcastMessage(Killer.PlayerReplicationInfo.PlayerName@randomkillstring@Other.PlayerReplicationInfo.PlayerName $ otherPlayer.killProfile.methodStr, false, 'DeathMessage');
}
}

if(!bDisableDefaultScoring)
{
if (Killer != Other)
{
// Penalize for killing your teammates
if (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 (CheckVictoryConditions(Killer, Other, otherPlayer.killProfile.methodStr) )
{
bFreezeScores = True;
NotifyDeath = False;
}
}
}
}
if ( NotifyDeath )
HandleDeathNotification( Killer, Other );
}
else
{
if (NotifyDeath)
HandleDeathNotification( Killer, Other );

super(DeusExGameInfo).Killed(Killer,Other,damageType);
}

BaseMutator.ScoreKill(Killer, Other);

LocalGetTeamTotalsX (int teamSECnt, out float score, out float deaths, out float streak, DeusExPlayer thisPlayer, int team)


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 URL, out string Error, Class SpawnClass) -> PlayerPawn


local MTLPlayer newPlayer;
local int Z5C;
local string Z5D;
local TCPlayer mmplayer;
local class Skins[2];


if ( (MaxPlayers > 0) && (NumPlayers >= MaxPlayers) )
{
Error=TooManyPlayers;
return None;
}

Z5C = 128;
if (HasOption(URL, "Team"))
{
Z5D = ParseOption(URL, "Team");
if (Z5D != "") Z5C = int(Z5D);
}
if (Z5C != 1 && Z5C != 0) Z5C = GetAutoTeam();
if (Z5C == 1) SpawnClass = Team1PlayerClass;
else SpawnClass = Team0PlayerClass;
InitialTeam = Z5C;

ChangeOption(URL, "Class", string(SpawnClass));
ChangeOption(URL, "Team", string(Z5C));
newPlayer = MTLPlayer(Super(DeusExMPGame).Login(Portal, URL, Error, SpawnClass));
mmplayer = TCPlayer(newPlayer);
if (mmplayer != None)
{
mmplayer.FixName(mmplayer.PlayerReplicationInfo.PlayerName);
}
return newPlayer;

PlayEnterBarks (TCPlayer P)


local int r;
local TCPlayer TCP;


r = Rand(7);
if(r == 0)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioAIBarks.ConAudioAIBarks_121", class'Sound', true)),SLOT_Talk);
else if(r == 1)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioAIBarks.ConAudioAIBarks_155", class'Sound', true)),SLOT_Talk);
else if(r == 2)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioAIBarks.ConAudioAIBarks_179", class'Sound', true)),SLOT_Talk);
else if(r == 3)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_354", class'Sound', true)),SLOT_Talk);
else if(r == 4)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_229", class'Sound', true)),SLOT_Talk);
else if(r == 5)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_217", class'Sound', true)),SLOT_Talk);
else if(r == 6)
P.PlaySound(Sound(DynamicLoadObject("DeusExConAudioMission01.ConAudioMission01_226", class'Sound', true)),SLOT_Talk);
foreach AllActors(class'TCPlayer', TCP)
if(TCP.PlayerReplicationInfo.Team == P.PlayerReplicationInfo.Team && TCP != P)
TCP.PlaySound(Sound(DynamicLoadObject("DeusExConAudioAIBarks.ConAudioAIBarks_596", class'Sound', true)),SLOT_Talk);

PostBeginPlay


super.PostBeginPlay();
ReplMaxPlayers = MaxPlayers;
Settings = Spawn(class'TCControls', self);
bShowStatus = Settings.bShowStatus;
bShowAdmins = Settings.bShowAdmins;
bShowMods = Settings.bShowMods;
ScoreboardTex = Settings.ScoreboardTex;
ScoreboardExtStr = Settings.ScoreboardExtStr;
bDrawServerInfo = Settings.bDrawServerInfo;
bSpectatorStart = Settings.bSpectatorStart;
rVer = Settings.GetVer();

if(Settings.bSpawnReplacer)
CBPMutator(level.Game.BaseMutator).AddCBPMutator(Spawn(class'TCReplacer'));

if(Settings.bMapvote)
Spawn(class'MVMutator');

Level.Game.BaseMutator.AddMutator(Spawn(class'TCTeamManager'));
Level.Game.RegisterDamageMutator (Spawn(class'TCTeamManager'));

PostLogin (PlayerPawn Z5F)


local TCPlayer mmplayer;


Super.PostLogin(Z5F);
mmplayer = TCPlayer(Z5F);
if (mmplayer != none)
{
if ((mmplayer.PlayerReplicationInfo.Score == 0 && mmplayer.PlayerReplicationInfo.Deaths == 0
&& mmplayer.PlayerReplicationInfo.Streak == 0) && bSpectatorStart)
{
mmplayer.Spectate(1);
}
else mmplayer.FixInventory();
}

RefreshScoreArray (DeusExPlayer P)


local int i;
local TCPRI lpri;
local PlayerPawn pp;
local string str, str2;
local int bots;

if ( P == None )
{
return;
}
pp=P.GetPlayerPawn();
if ( (pp == None) || (pp.GameReplicationInfo == None) )
{
return;
}
scorePlayers = 0;
SpecCountUNATCO = 0;
SpecCountNSF = 0;

for(i=0; i < 32; i++ )
{
lpri = TCPRI(pp.GameReplicationInfo.PRIArray[i]);
//if ( (lpri != None) && ( !lpri.bIsSpectator || lpri.bWaitingPlayer) )
if (lpri != None)
{
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;
PI[scorePlayers].ping = lpri.pingPRI;
PI[scorePlayers].bAdmin = lpri.bAdmin;
PI[scorePlayers].bIsSpectator = lpri.bIsSpectator;
PI[scorePlayers].bModerator = lpri.bModerator;
PI[scorePlayers].bMuted = lpri.bMuted;
PI[scorePlayers].bSuperAdmin = lpri.bSuperAdmin;
PI[scorePlayers].bServerOwner = lpri.bServerOwner;
PI[scorePlayers].bKaiz0r = lpri.bKaiz0r;
PI[scorePlayers].Status = lpri.Status;
PI[scorePlayers].bAway = lpri.bAway;
PI[scorePlayers].DT = lpri.DT;
PI[scorePlayers].FPS = lpri.FPS;
PI[scorePlayers].bSilentAdmin = lpri.bSilentAdmin;
PI[scorePlayers].bJuggernaut = lpri.bJuggernaut;
playerCount++;
if (lpri.bIsSpectator)
{
spectatorCount++;
if (lpri.Team == 0) SpecCountUNATCO++;
else if(lpri.Team == 1) SpecCountNSF++;
PI[scorePlayers].SpectatedPlayerID = lpri.SpectatingPlayerID;
}
if(!lpri.bRealPlayer)
{
PI[scorePlayers].bBot=True;
bots += 1;
}
if(lpri.bRealPlayer)
{
PI[scorePlayers].bBot=False;
PI[scorePlayers].bRealPlayer=True;
}
scorePlayers++;
}
}

SetSpectatedPlayerNames();

SBInfo.ServerName = pp.GameReplicationInfo.ServerName;
SBInfo.GameType = rVer; //Settings.GetVer(); // GTName;
SBInfo.NumPlayers = scorePlayers - Bots;
SBInfo.MaxPlayers = ReplMaxPlayers;
str = string(self);
SBInfo.Map = Left(str, InStr(str, "."));

SDIn (int mins)


Settings.SetShutdownIn(mins);

Say2 (string str)


Settings.serverSay2(str);

Say3 (string str)


Settings.serverSay3(str);

SetSD (int sdHours, int sdMins)


Settings.SetShutdownTime(sdHours, sdMins);

SetSpectatedPlayerNames


local int i, k;


for (i = 0; i < scorePlayers; i++)
{
if (PI[i].bIsSpectator && PI[i].SpectatedPlayerID != -1)
{
for (k = 0; k < scorePlayers; k++)
{
if (scoreArray[k].PlayerID == PI[i].SpectatedPlayerID)
{
PI[i].SpectatedPlayerName = scoreArray[k].PlayerName;
break;
}
}
}
}

SetTeam (DeusExPlayer Z5F)


Z5F.PlayerReplicationInfo.Team = InitialTeam;

ShowServerInfo (GC gc, float yoffset, float ylen, float screenWidth)


local float w, h, tw;
local string str;


gc.GetTextExtent(0, w, h, "Ping");
gc.SetTileColorRGB(255,255,255);
tw = ((screenWidth * PINGX) + w) - (IDX * screenWidth);
gc.DrawBox(IDX * screenWidth, yoffset, tw, 1, 0, 0, 1, ScoreboardTex);
yoffset += ylen;


str = "Game: " $ SBInfo.Gametype $ " - Map: " $ GetURLMap()$" - Current time: " $ ComposeTime();;
gc.SetTextColorRGB(255, 255, 255);
gc.GetTextExtent(0, w, h, str);
tw = (tw - w) / 2;
gc.DrawText((screenWidth * IDX) + tw, yoffset, w, h, str);
yoffset += h + 2;

str = "Server: "$SBInfo.ServerName$" ("$SBInfo.NumPlayers$"/"$SBInfo.MaxPlayers$")";
gc.GetTextExtent(0, w, h, str);
gc.DrawText((screenWidth * IDX) + tw, yoffset, w, h, str);
yoffset += h + 2;

str = ScoreboardExtStr;
gc.GetTextExtent(0, w, h, str);
gc.DrawText((screenWidth * IDX) + tw, yoffset, w, h, str);

SortTeamScores (int PlayerCount)


local ScoreElement tmpSE;
local PlayerInfo tmpPI;
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];
tmpPI = PInfo[max];
teamSE[max] = teamSE[i];
PInfo[max] = PInfo[i];
teamSE[i] = tmpSE;
PInfo[i] = tmpPI;
}

Timer


local string URLstr;
local DXMapList mapList;
local string gtv;

if ( bCycleMap )
{
mapList = Spawn(class'DXMapList');
URLstr = mapList.GetNextMap();
mapList.Destroy();
bCycleMap = False;

gtv = Settings.Votez.FinalVoteStr;

if(gtv != "")
Level.ServerTravel( URLstr$"?Game=OpenDX."$gtv, False );
else
Level.ServerTravel( URLstr, False );

bFreezeScores = False;
}

UpdateSkin (DeusExPlayer P, int NewTeam) -> bool


local int iSkin;


if (NewTeam == 0)
{
for (iSkin = 0; iSkin < ArrayCount(P.MultiSkins); iSkin++)
{
P.MultiSkins[iSkin] = class'mpunatco'.Default.MultiSkins[iSkin];
}
P.Mesh = class'mpunatco'.Default.Mesh;

return true;
}
else if (NewTeam == 1)
{
for (iSkin = 0; iSkin < ArrayCount(P.MultiSkins); iSkin++)
{
P.MultiSkins[iSkin] = class'mpnsf'.Default.MultiSkins[iSkin];
}
P.Mesh = class'mpnsf'.Default.Mesh;

return true;
}
else
return false;

st (string str)


ConsoleCommand("servertravel "$str);

tSwapPlayer (TCPlayer DXP, int T, optional bool bDontResetLoc, optional bool bDontResetScore)


local NavigationPoint startSpot;
local bool foundStart;
local string Text, TP;


Text = "Switching "$DxP.PlayerReplicationInfo.PlayerName$"("$DxP.PlayerReplicationInfo.PlayerID$") to ";
TP = "You have been switched to ";

if (T == 0)
{
Text = Text$"UNATCO.";
TP = TP$"UNATCO.";
}
else
{
Text = Text$"NSF.";
TP = TP$"NSF.";
}

BroadcastMessage(Text);

DxP.PlayerReplicationInfo.Team = T;
UpdateSkin(DxP, T);
if(!bDontResetScore)
DxP.ChangeTeam(T);

if(!bDontResetLoc)
{
startSpot = Level.Game.FindPlayerStart(DxP, 255);
if (startSpot != none)
{
foundStart = DxP.SetLocation(startSpot.Location);
if (foundStart)
{
DxP.SetRotation(startSpot.Rotation);
DxP.ViewRotation = DxP.Rotation;
DxP.Acceleration = vect(0,0,0);
DxP.Velocity = vect(0,0,0);
DxP.ClientSetLocation(startSpot.Location, startSpot.Rotation);
}
}
}
DXP.ClientMessage(TP);

tSwapTeam (TCPlayer P)


if(P.PlayerReplicationInfo.Team == 0)
tSwapPlayer(P, 1);
else
tSwapPlayer(P, 0);




TCTeamBalancer.uc (extends Actor)

var() config bool bEnabled;
var() config bool bSwapNewPlayersFirst;
var() config float CheckTime;
var() config int MaxDifference;
var() config float MessageTime;
var bool bDoBalance;
var bool bInit;
bEnabled=True
bSwapNewPlayersFirst=True
checkTime=15.00
MaxDifference=1
MessageTime=5.00
bHidden=True
NetUpdateFrequency=1.00

BalanceTeams (int D)


local int RemainingToSwap, i, MaxFrags, sw;
local Pawn P;


// D can be negative, but we need positive RemainingToSwap
if (D > 0)
RemainingToSwap = D;
else if (D < 0)
RemainingToSwap = (D)*(-1);
else
// should never happen
return;

if (bSwapNewPlayersFirst)
{
// check for new players and swap them
sw = SwapPlayers(D, 0);
RemainingToSwap -= sw;
if (D > 0) D -= sw;
else if (D < 0) D += sw;
}

if (RemainingToSwap == 0)
return;

// find top player, so we dont swap him
P = Level.PawnList;
MaxFrags = 0;
i = 0;
while (i < Level.Game.NumPlayers)
{
if (P.IsA('PlayerPawn'))
{
if (!P.PlayerReplicationInfo.bIsSpectator)
{
if (D > 0 && P.PlayerReplicationInfo.Team == 0)
{
// assign new MaxFrags if we find player with higher score
if (P.PlayerReplicationInfo.Score > MaxFrags)
MaxFrags = int(P.PlayerReplicationInfo.Score);
}
else if (D < 0 && P.PlayerReplicationInfo.Team == 1)
{
// assign new MaxFrags if we find player with higher score
if (P.PlayerReplicationInfo.Score > MaxFrags)
MaxFrags = int(P.PlayerReplicationInfo.Score);
}
}
i++;
}
P = P.nextPawn;
}

// security check (in case of map begins and all players have score 0
// set MaxFrags to 1 and just swap first appropriate player(s)
if (MaxFrags == 0)
MaxFrags = 1;

// swap other players
RemainingToSwap -= SwapPlayers(D, MaxFrags);

// ooops, not all players could be swapped
if (RemainingToSwap > 0)
log("Failed to balance teams...", 'OpenDX');

CheckBalance -> int


local int NSF, UNATCO, i;
local Pawn P;


NSF = 0;
UNATCO = 0;

// count number of UNATCO and number of NSF players
P = Level.PawnList;
while (i < Level.Game.NumPlayers)
{
if (P.IsA('PlayerPawn'))
{
if (!P.PlayerReplicationInfo.bIsSpectator || !P.isInState('Spectating'))
{
if (P.PlayerReplicationInfo.Team == 0) UNATCO++;
else if (P.PlayerReplicationInfo.Team == 1) NSF++;
}
i++;
}
P = P.nextPawn;
}

if (UNATCO == NSF || (UNATCO + NSF) == 1)
return 0;

if (MaxDifference > 0 && ((NSF + MaxDifference) < UNATCO ||
(UNATCO + MaxDifference) < NSF))
return ((UNATCO - NSF) / 2);

// other unknown combination???
else
return 0;

CheckTotalScore (int N) -> int


local int NSFScore, UNATCOScore, i;
local Pawn P;


NSFScore = 0;
UNATCOScore = 0;

// count NSF and UNATCO total scores
P = Level.PawnList;
while (i < Level.Game.NumPlayers)
{
if (P.IsA('PlayerPawn'))
{
if (P.PlayerReplicationInfo.Team == 0)
UNATCOScore += int(P.PlayerReplicationInfo.Score);
else if (P.PlayerReplicationInfo.Team == 1)
NSFScore += int(P.PlayerReplicationInfo.Score);

i++;
}
P = P.nextPawn;
}

// equal scores, no balancing needed
if (UNATCOScore == NSFScore)
return 0;

// if unatco has higher score and more players
else if (UNATCOScore > NSFScore && N > 0)
return 1;

// if nsf has higher score and more players
else if (NSFScore > UNATCOScore && N < 0)
return -1;

// other combination, dont do balancing!
else
return 0;

PostBeginPlay


if (bInit) return;
bInit = true;
bDoBalance = false;
if (MaxDifference < 0)
MaxDifference = 1;
if (CheckTime < 0)
CheckTime = 15.0;
SaveConfig();
SetTimer(CheckTime, True);

PrintToAll (string TextToSay, bool uplink)


local int i;
local Pawn P;
local TCPlayer mmp;
local color rgb;


rgb.G = 255;
// print text to all clients
P = Level.PawnList;
while (i < Level.Game.NumPlayers)
{
if (P.IsA('PlayerPawn'))
{
if (uplink) P.ClientMessage(TextToSay, , true);
else
{
mmp = TCPlayer(P);
if (mmp != none) mmp.ClientMessage(TextToSay);
}
i++;
}
P = P.nextPawn;
}

PrintToPlayer (DeusExPlayer dxp, string Message)


local TCPlayer mmp;
local color rgb;


rgb.G = 255;
mmp = TCPlayer(dxp);
if (mmp != none) mmp.ClientMessage(Message);

SwapPlayer (Pawn P, int T)


local NavigationPoint startSpot;
local bool foundStart;
local TCPlayer DxP;
local string Text, TP;


DxP = TCPlayer(P);

Text = "Switching player player "
$DxP.PlayerReplicationInfo.PlayerName$
" ("$DxP.PlayerReplicationInfo.PlayerID$") to ";
TP = "You have been switched to ";

if (T == 0)
{
Text = Text$"team UNATCO.";
TP = TP$"team UNATCO.";
}
else
{
Text = Text$"team NSF.";
TP = TP$"team NSF.";
}

PrintToAll(Text, true);

DxP.PlayerReplicationInfo.Team = T;
UpdateSkin(DxP, T);
DxP.ClientSetTeam(T);
startSpot = Level.Game.FindPlayerStart(DxP, 255);
if (startSpot != none)
{
foundStart = DxP.SetLocation(startSpot.Location);
if (foundStart)
{
DxP.SetRotation(startSpot.Rotation);
DxP.ViewRotation = DxP.Rotation;
DxP.Acceleration = vect(0,0,0);
DxP.Velocity = vect(0,0,0);
DxP.ClientSetLocation(startSpot.Location, startSpot.Rotation);
}
}
PrintToPlayer(DxP, TP);

SwapPlayers (int N, int Frags) -> int


local int i, Swapped;
local Pawn P;
local TCPRI mmp;


Swapped = 0;
i = 0;
P = Level.PawnList;
while (i < Level.Game.NumPlayers && N != 0)
{
if (P.IsA('PlayerPawn'))
{
mmp = TCPRI(P.PlayerReplicationInfo);
if (mmp != none && !mmp.bIsSpectator && !P.isinState('Spectating'))
{
if (Frags > 0 || (P.PlayerReplicationInfo.Score == 0 &&
P.PlayerReplicationInfo.Deaths == 0))
{
// if N > 0: swap to NSF
// if N < 0: swap to UNATCO
if (N > 0 && P.PlayerReplicationInfo.Team == 0 &&
(P.PlayerReplicationInfo.Score < Frags || Frags == 0))
{
SwapPlayer(P, 1);
Swapped++;
N--;
}
else if (N < 0 && P.PlayerReplicationInfo.Team == 1 &&
P.PlayerReplicationInfo.Score < Frags || Frags == 0)
{
SwapPlayer(P, 0);
Swapped++;
N++;
}
}
}
i++;
}
P = P.nextPawn;
}

return Swapped;

Timer


local int Diff;
local string Text;


if (DeathMatchGame(Level.Game) != None)
return;

if (bEnabled == false) return;

// check balance
Diff = CheckBalance();
if (Diff == 0)
{
bDoBalance = false;
return;
}

// if bDoBalance is true
if (bDoBalance == true)
{
// do balancing
BalanceTeams(Diff);

// change bDoBalance to false so next time we only check teams
bDoBalance = false;
}
else
{
Text = "Teams will be balanced in "$int(CheckTime)$" seconds.";
PrintToAll(Text, false);
// just change bDoBalance to true, so we balance teams next time
bDoBalance = true;
}

UpdateSkin (DeusExPlayer P, int NewTeam) -> bool


local int iSkin;


if (NewTeam == 0)
{
for (iSkin = 0; iSkin < ArrayCount(P.MultiSkins); iSkin++)
{
P.MultiSkins[iSkin] = class'mpunatco'.Default.MultiSkins[iSkin];
}
P.Mesh = class'mpunatco'.Default.Mesh;

return true;
}
else if (NewTeam == 1)
{
for (iSkin = 0; iSkin < ArrayCount(P.MultiSkins); iSkin++)
{
P.MultiSkins[iSkin] = class'mpnsf'.Default.MultiSkins[iSkin];
}
P.Mesh = class'mpnsf'.Default.Mesh;

return true;
}
else
return false;




TCTeamManager.uc (extends Mutator)

CalcHitLoc (int HitPart) -> string


if(HitPart == 1)
return "Head";

if(HitPart == 2)
return "Torso";

if(HitPart == 3)
return "Legs";

if(HitPart == 4)
return "Legs";

if(HitPart == 5)
return "Torso";

if(HitPart == 6)
return "Torso";

GetDisplayName (pawn Chk) -> string


if(ScriptedPawn(Chk) != None)
return ScriptedPawn(Chk).FamiliarName;

if(TCPlayer(Chk) != None)
return TCPlayer(Chk).PlayerReplicationInfo.PlayerName;

ModifyPlayer (Pawn Other)


local TCPlayer P;
local class GiveClass;
local int Passes, r;
local Inventory anItem, anItem2, i;
local Class w;


super.ModifyPlayer(Other);
p = TCPlayer(Other);

if(GunGame(Level.Game) != None)
{
r = TCPRI(P.PlayerReplicationInfo).Rank;

if (r == 1)
w = class'WeaponStealthPistol';

if (r == 2)
w = class'WeaponPistol';

if (r == 3)
w = class'WeaponFlamethrower';

if (r == 4)
w = class'WeaponMiniCrossbow';

if (r == 5)
w = class'WeaponShuriken';

if (r == 6)
w = class'WeaponSawedOffShotgun';

if (r == 7)
w = class'WeaponAssaultShotgun';

if (r == 8)
w = class'WeaponAssaultgun';

if (r == 9)
w = class'WeaponPlasmaRifle';

if (r == 10)
w = class'WeaponGepGun';

if (r == 11)
w = class'Weaponrifle';

if (r == 12)
w = class'WeaponNanoSword';

anItem = Spawn(w);
anItem.Frob(P,None);
Inventory.bInObjectBelt = True;
anItem.Destroy();

anItem = Spawn(class'WeaponCombatKnife');
anItem.Frob(P,None);
Inventory.bInObjectBelt = True;
anItem.Destroy();
}

else if(Sharpshooter(Level.Game) != None)
{
while(Passes < 3)
{

if(Passes == 0) r = RandRange(0,10);
if(Passes == 1) r = RandRange(11, 20);
if(Passes == 2) r = RandRange(21,29);
Passes++;
GiveClass = class( DynamicLoadObject( p.GetControls().SSWeapons[r], class'Class' ) );
if( GiveClass!=None )
{
anItem = Spawn(GiveClass,,,p.Location);
anItem.SpawnCopy(P);
anItem.Destroy();
}
else
Log("Error in TCControls.SSWeapons array: "$r$" slot could not be spawned. (PLAYER)");
}
}


MutatorTakeDamage (out Int ActualDamage, Pawn Victim, Pawn InstigatedBy, out Vector HitLocation, out Vector Momentum, Name DamageType)


local string hitstr, colstr, quadstr;

super.MutatorTakeDamage (ActualDamage, Victim, InstigatedBy, HitLocation, Momentum, DamageType);


if(TCPlayer(instigatedBy) != None)
{
if(TCPlayer(Victim).HasPerk("Infection"))
{
ActualDamage = ActualDamage * 1.5;
}

if(TCPlayer(instigatedBy).HasPerk("Quad Damage"))
{
ActualDamage = ActualDamage * 4;
}

if(Juggernaut(level.game) != None)
{
if(TCPlayer(Victim) == Juggernaut(level.game).Juggernaut)
{
ActualDamage = ActualDamage / 2;
}
}

if(DeusExPlayer(victim) != None)
hitstr = CalcHitLoc(DeusExPlayer(victim).GetMPHitLocation(HitLocation));

if(TCPlayer(instigatedBy).GetControls().bShowHitz)
{
if(ActualDamage > 0)
{
if(DamageType == 'EMP')
colstr = "|C1E90FF";
if(DamageType == 'Flamed' || DamageType == 'Burned')
colstr = "|P2";
if(DamageType == 'PoisonEffect' || DamageType == 'Poison' || DamageType == 'TearGas')
colstr = "|C14D920";
if(DamageType == 'KnockedOut' || DamageType == 'exploded' || DamageType == 'Stunned' || DamageType == 'stomped')
colstr = "|CEEF600";
if(DamageType == 'SpecialDamage' || DamageType == 'Tantalus' || DamageType == 'Nanovirus')
colstr = "|P7";
if(DamageType == 'shot')
colstr = "|P1";

if(TCPlayer(instigatedBy).HasPerk("Quad Damage"))
{
if(hitstr == "")
TCPlayer(instigatedBy).ShowHitz(colstr$"("$ActualDamage / 4$" x4)");
else
TCPlayer(instigatedBy).ShowHitz(colstr$"("$ActualDamage / 4$" x4) >> "$hitstr$") ");
}
else
{
if(hitstr == "")
TCPlayer(instigatedBy).ShowHitz(colstr$"("$ActualDamage$")");
else
TCPlayer(instigatedBy).ShowHitz(colstr$"("$ActualDamage$" >> "$hitstr$") ");
}

}
}

if(TCDeathmatch(level.game) == None)
return;
if(TCPlayer(InstigatedBy).TeamName == "")
return;
if(TCPlayer(Victim) != None && Victim != InstigatedBy)
{
if(TCPlayer(Victim).TeamName == "")
return;
if(TCPlayer(InstigatedBy).TeamName ~= TCPlayer(Victim).TeamName)
{
if(!TCDeathMatch(Level.Game).Settings.bTCFriendlyFire)
{
ActualDamage /= TCDeathMatch(Level.Game).Settings.ffReduction;
return;
}

}
}
}




TCTimerActor.uc (extends Actor)

var bool bRunning;
var int min, sec;
bHidden=True;

StartTimer


local TCPlayer TCP;


min = 0;
sec = 0;

foreach AllActors(class'TCPlayer', TCP)
TCP.StartTimer();

Log("Timer started.",'OpenDX');
bRunning=True;
SetTimer(1,True);

StopTimer


local TCPlayer TCP;


foreach AllActors(class'TCPlayer', TCP)
TCP.StopTimer();

Log("Timer stopped.",'OpenDX');
bRunning=false;

Timer


local string finaltime, localsec;


sec++;

if(sec < 10)
localsec = "0"$sec;

if(sec > 60)
{
sec = 1;
localsec = "01";
min++;
}

if(localsec == "")
localsec = string(sec);
finaltime = min$":"$localsec;

UpdateTimer(finaltime);

ToggleTimer


if(bRunning)
StopTimer();
else
StartTimer();

UpdateTimer (string str)


local TCPlayer TCP;


foreach AllActors(class'TCPlayer', TCP)
{
TCP.UpdateTimer(str);
TCP.TimerString=str;
}

if(!bRunning)
SetTimer(1,False);




TCUNATCO.uc (extends TCPlayer)

Mesh=LodMesh'MPCharacters.mp_jumpsuit'
DrawScale=0.93
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'



TCWeaponAssaultGun.uc (extends WeaponAssaultGun)

ProjectileNames(1)=Class'TCHECannister20mm'

ClientFire (float value) -> bool


if (DeusExPlayer(Owner) != none && DeusExPlayer(Owner).inHand != self) return false;
return super.ClientFire(value);




TCWeaponAssaultShotgun.uc (extends WeaponAssaultShotgun)

ClientFire (float value) -> bool


if (DeusExPlayer(Owner) != none && DeusExPlayer(Owner).inHand != self) return false;
return super.ClientFire(value);




TCWeaponCombatKnife.uc (extends WeaponCombatKnife)

ClientFire (float value) -> bool


if (DeusExPlayer(Owner) != none && DeusExPlayer(Owner).inHand != self) return false;
return super.ClientFire(value);




TCWeaponEMPGrenade.uc (extends WeaponEMPGrenade)

// ProjectileClass=Class'TCEMPGrenade'

AnimEnd


if (bAutomatic)
{
if ((Pawn(Owner).bFire != 0) && (AmmoType.AmmoAmount > 0))
{
if (PlayerPawn(Owner) != None)
Global.Fire(0);
else
GotoState('FinishFire');
}
else
GotoState('FinishFire');
}
else
{
// if we are a thrown weapon and we run out of ammo, destroy the weapon
if (bHandToHand && (ReloadCount > 0) && (AmmoType.AmmoAmount <= 0))
{
// fix disappear bug:
//Destroy();
}
}

ClientFire (float value) -> bool


//servernotify("clientFire - netmode:"@level.NetMode);
if(ReloadCount <= 0)
ReloadCount=1;

return Super.ClientFire(value);

Fire (float Value)


local float sndVolume;
local bool bListenClient;


if (Pawn(Owner) != None)
{
if (bNearWall)
{
bReadyToFire = False;
GotoState('NormalFire');
bPointing = True;
PlayAnim('Place',, 0.1);
return;
}
}

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 (( Level.NetMode != NM_Standalone ) && !bListenClient )
bClientReady = False;
bReadyToFire = False;
GotoState('NormalFire');
bPointing=True;
if ( Owner.IsA('PlayerPawn') )
PlayerPawn(Owner).PlayFiring();
PlaySelectiveFiring();
PlayFiringSound();
}

PlaceGrenade


if (AmmoType.AmmoAmount <= 0)
{
Destroy();
return;
}
super.PlaceGrenade();
if (AmmoType.AmmoAmount <= 0) Destroy();

ProjectileFire (class ProjClass, float ProjSpeed, bool bWarn) -> Projectile


local Projectile proj;


if (AmmoType.AmmoAmount <= 0)
{
bDestroyOnFinish = true;
return none;
}

proj = super(DeusExWeapon).ProjectileFire(ProjClass, ProjSpeed, bWarn);
if (proj != none)
{
proj.PlayAnim('Open');
if (ReloadCount > 0) AmmoType.UseAmmo(1);

if ( AmmoType.AmmoAmount <= 0 )
bDestroyOnFinish = True;

// Update ammo count on object belt
if (DeusExPlayer(Owner) != None)
DeusExPlayer(Owner).UpdateBeltText(Self);
}

return proj;




TCWeaponFlamethrower.uc (extends WeaponFlamethrower)

//ProjectileClass=Class'TCFireball'



TCWeaponGEPGun.uc (extends CBPWeaponGEPGun)

ProjectileNames(0)=Class'TCRocket'
ProjectileClass=Class'TCRocket'



TCWeaponGasGrenade.uc (extends WeaponGasGrenade)

//ProjectileClass=Class'TCGasGrenade'

AnimEnd


if (bAutomatic)
{
if ((Pawn(Owner).bFire != 0) && (AmmoType.AmmoAmount > 0))
{
if (PlayerPawn(Owner) != None)
Global.Fire(0);
else
GotoState('FinishFire');
}
else
GotoState('FinishFire');
}
else
{
// if we are a thrown weapon and we run out of ammo, destroy the weapon
if (bHandToHand && (ReloadCount > 0) && (AmmoType.AmmoAmount <= 0))
{
// fix disappear bug:
//Destroy();
}
}

ClientFire (float value) -> bool


//servernotify("clientFire - netmode:"@level.NetMode);
if(ReloadCount <= 0)
ReloadCount=1;

return Super.ClientFire(value);

Fire (float Value)


local float sndVolume;
local bool bListenClient;


if (Pawn(Owner) != None)
{
if (bNearWall)
{
bReadyToFire = False;
GotoState('NormalFire');
bPointing = True;
PlayAnim('Place',, 0.1);
return;
}
}

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 (( Level.NetMode != NM_Standalone ) && !bListenClient )
bClientReady = False;
bReadyToFire = False;
GotoState('NormalFire');
bPointing=True;
if ( Owner.IsA('PlayerPawn') )
PlayerPawn(Owner).PlayFiring();
PlaySelectiveFiring();
PlayFiringSound();
}

PlaceGrenade


if (AmmoType.AmmoAmount <= 0)
{
Destroy();
return;
}
super.PlaceGrenade();
if (AmmoType.AmmoAmount <= 0) Destroy();

ProjectileFire (class ProjClass, float ProjSpeed, bool bWarn) -> Projectile


local Projectile proj;


if (AmmoType.AmmoAmount <= 0)
{
bDestroyOnFinish = true;
return none;
}

proj = super.ProjectileFire(ProjClass, ProjSpeed, bWarn);
if (proj != none)
{
if (ReloadCount > 0) AmmoType.UseAmmo(1);

if ( AmmoType.AmmoAmount <= 0 )
bDestroyOnFinish = True;

// Update ammo count on object belt
if (DeusExPlayer(Owner) != None)
DeusExPlayer(Owner).UpdateBeltText(Self);
}

return proj;




TCWeaponLAM.uc (extends WeaponLAM)

//ProjectileClass=Class'TCLAM' To be implemented another day

AnimEnd


if (bAutomatic)
{
if ((Pawn(Owner).bFire != 0) && (AmmoType.AmmoAmount > 0))
{
if (PlayerPawn(Owner) != None)
Global.Fire(0);
else
GotoState('FinishFire');
}
else
GotoState('FinishFire');
}
else
{
// if we are a thrown weapon and we run out of ammo, destroy the weapon
if (bHandToHand && (ReloadCount > 0) && (AmmoType.AmmoAmount <= 0))
{
// fix disappear bug:
//Destroy();
}
}

ClientFire (float value) -> bool


//servernotify("clientFire - netmode:"@level.NetMode);
if(ReloadCount <= 0)
ReloadCount = 1;

return Super.ClientFire(value);

Fire (float Value)


local float sndVolume;
local bool bListenClient;


if (Pawn(Owner) != None)
{
if (bNearWall)
{
bReadyToFire = False;
GotoState('NormalFire');
bPointing = True;
PlayAnim('Place',, 0.1);
return;
}
}

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 (( Level.NetMode != NM_Standalone ) && !bListenClient )
bClientReady = False;
bReadyToFire = False;
GotoState('NormalFire');
bPointing=True;
if ( Owner.IsA('PlayerPawn') )
PlayerPawn(Owner).PlayFiring();
PlaySelectiveFiring();
PlayFiringSound();
}

PlaceGrenade


if (AmmoType.AmmoAmount <= 0)
{
Destroy();
return;
}
super.PlaceGrenade();
if (AmmoType.AmmoAmount <= 0) Destroy();

ProjectileFire (class ProjClass, float ProjSpeed, bool bWarn) -> Projectile


local Projectile proj;


if (AmmoType.AmmoAmount <= 0)
{
bDestroyOnFinish = true;
return none;
}

proj = super.ProjectileFire(ProjClass, ProjSpeed, bWarn);
if (proj != none)
{
if (ReloadCount > 0) AmmoType.UseAmmo(1);

if ( AmmoType.AmmoAmount <= 0 )
bDestroyOnFinish = True;

// Update ammo count on object belt
if (DeusExPlayer(Owner) != None)
DeusExPlayer(Owner).UpdateBeltText(Self);
}

return proj;




TCWeaponLAW.uc (extends WeaponLAW)




TCWeaponMiniCrossbow.uc (extends WeaponMiniCrossbow)

ClientFire (float value) -> bool


if (DeusExPlayer(Owner) != none && DeusExPlayer(Owner).inHand != self) return false;
return super.ClientFire(value);




TCWeaponNanoSword.uc (extends WeaponNanoSword)

mpAccurateRange=96
mpMaxRange=96



TCWeaponPistol.uc (extends CBPWeaponPistol)

ClientFire (float value) -> bool


if (DeusExPlayer(Owner) != none && DeusExPlayer(Owner).inHand != self) return false;
return super.ClientFire(value);




TCWeaponPlasmaRifle.uc (extends WeaponPlasmaRifle)

ClientFire (float value) -> bool


if (DeusExPlayer(Owner) != none && DeusExPlayer(Owner).inHand != self) return false;
return super.ClientFire(value);




TCWeaponRifle.uc (extends CBPWeaponRifle)




TCWeaponSawedOffShotgun.uc (extends WeaponSawedOffShotgun)

ClientFire (float value) -> bool


if (DeusExPlayer(Owner) != none && DeusExPlayer(Owner).inHand != self) return false;
return super.ClientFire(value);




TCWeaponShuriken.uc (extends CBPWeaponShuriken)

ClientFire (float value) -> bool


if (DeusExPlayer(Owner) != none && DeusExPlayer(Owner).inHand != self) return false;
return super.ClientFire(value);




TCWeaponStealthPistol.uc (extends WeaponStealthPistol)

ClientFire (float value) -> bool


if (DeusExPlayer(Owner) != none && DeusExPlayer(Owner).inHand != self) return false;
return super.ClientFire(value);




ToyMC.uc (extends ToyPlayer)

V68=1
Drawscale=0.18
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'



ToyPlayer.uc (extends TCPlayer)

Mass=2
PlayerReplicationInfoClass=Class'TCPRI'
CollisionRadius=5.000000
CollisionHeight=10.000000
BaseEyeHeight=10.00
Drawscale=0.18
mpGroundSpeed=30.00
mpWaterSpeed=10.00
Jumpz=200
MaxStepHeight=10.000000

PlayerTick (float deltaTime)


//DEUS_EX AMSD Additional updates
//Because of replication delay, aug icons end up being a step behind generally. So refresh them
//every freaking tick.
RefreshSystems(deltaTime);

DrugEffects(deltaTime);
Bleed(deltaTime);
HighlightCenterObject();


UpdateDynamicMusic(deltaTime);
UpdateWarrenEMPField(deltaTime);
// DEUS_EX AMSD Move these funcions to a multiplayer tick
// so that only that call gets propagated to the server.
MultiplayerTick(deltaTime);
// DEUS_EX AMSD For multiplayer...
FrobTime += deltaTime;

// save some texture info
FloorMaterial = GetFloorMaterial();
WallMaterial = GetWallMaterial(WallNormal);

// 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();

// handle poison
//DEUS_EX AMSD Now handled in multiplayertick
//UpdatePoison(deltaTime);

// Update Time Played
UpdateTimePlayed(deltaTime);

Super.PlayerTick(deltaTime);

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;
local vector start, checkNorm, Extent;
local TCControls TCC;


TCC = GetControls();
Super.ProcessMove(DeltaTime, newAccel, DodgeMove, DeltaRot);
//Kaiser: Mantling system.
if (Physics == PHYS_Falling && velocity.Z != 0 && TCC.bMantling)
{
if (CarriedDecoration == None && Energy >= TCC.MantleBio)
{
checkpoint = vector(Rotation);
checkpoint.Z = 0.0;
checkNorm = Normal(checkpoint);
checkPoint = Location + CollisionRadius * checkNorm;
//Extent = CollisionRadius * vect(1,1,0);
Extent = CollisionRadius * vect(0.2,0.2,0);
Extent.Z = CollisionHeight;
HitActor = Trace(HitLocation, HitNormal, checkpoint, Location, True, Extent);
if ( (HitActor != None) && (Pawn(HitActor) == None) && (HitActor == Level || HitActor.bCollideActors) && !HitActor.IsA('DeusExCarcass'))
{
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)
{
if(!isMantling)
{
Energy -= TCC.MantleBio;
isMantling = True;
setPhysics(PHYS_Falling);
Velocity.Z = TCC.MantleVelocity;
Acceleration = vect(0,0,0);
PlaySound(sound'MaleLand', SLOT_None, 1.5, true, 1200, (1.0 + 0.2*FRand()) * 1.0 );
Acceleration = wallNormal * AccelRate / 8;
}
}
}
}
}
// 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)
{
SetBasedPawnSize(Default.CollisionRadius, Default.CollisionHeight);

// 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;
}

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 );
}
}
}



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;

EyeHeight -= centerDelta.Z;
}
return (bSuccess);

ZoneChange (ZoneInfo NewZone)


// if we jump into water, empty our hands
if (NewZone.bWaterZone)
DropDecoration();

Super.ZoneChange(NewZone);




Toybox.uc (extends TCDeathmatch)

bToybox=True
DefaultPlayerClass=Class'ToyMC'
GameReplicationInfoClass=Class'TCGRI'

Login (string Portal, string Z56, out string Z57, Class SpawnClass) -> PlayerPawn


local TCPlayer Z5B;
local string Z68;
local string Z69;
local int Z6A;
local string myString;
local class spawn;
local int j,p;


if ( (MaxPlayers > 0) && (NumPlayers >= MaxPlayers) )
{
Z57=TooManyPlayers;
return None;
}
SpawnClass=DefaultPlayerClass;
Z68=ParseOption(Z56,"Class");
Z6A=InStr(Z68,".");
if ( Z6A != -1 )
{
Z69=Mid(Z68,Z6A + 1);
Z68=Left(Z68,Z6A);
} else {
Z69=Z68;
Z68="";




_TCTimer.uc (extends Actor)

var vector iLoc;
var Rotator iRot;
var int cMins;
var int cSecs;
bHidden=true

GetControls -> TCControls


local TCControls TCC;


//if(Role < ROLE_Authority)
//{
if(TCDeathmatch(Level.Game) != None) TCC = TCDeathMatch(Level.Game).Settings;
if(TCTeam(Level.Game) != None) TCC = TCTeam(Level.Game).Settings;

return TCC;
//

PostBeginPlay


local TCControls TCGet;


TCGet = GetControls();
if(TCGet.AutoIdleTime > 0)
SetTimer(1,True);

Tick (float deltaTime)


if(TCPlayer(Owner) == none)
{
destroy();
return;
}

TCPlayer(Owner)._timerSeconds += deltaTime;

Timer


local bool bAutoIdle, bAutoIdleKick;
local bool bMinutePassed;


cSecs++;
if(cSecs == 60)
{
bMinutePassed=True;
cSecs = 0;
}

if(GetControls().AutoIdleTime > 0)
bAutoIdle=True;

if(GetControls().AutoIdleKickTime > 0)
bAutoIdleKick=True;

if(TCPlayer(Owner).Location == iLoc && TCPlayer(Owner).ViewRotation == iRot)
{
if(bMinutePassed)
TCPlayer(Owner).IdleCounter++;
}
else
{
if(TCPlayer(Owner).bAway)
{
TCPlayer(Owner).bAway=False;
TCPRI(TCPlayer(Owner).PlayerReplicationInfo).bAway=False;
GetControls().Print(TCPlayer(Owner).PlayerReplicationInfo.PlayerName$" has returned.");
}
iLoc = TCPlayer(Owner).Location;
iRot = TCPlayer(Owner).ViewRotation;
TCPlayer(Owner).IdleCounter=0;
}

if(TCPlayer(Owner).IsInState('Dying'))
TCPRI(TCPlayer(Owner).PlayerReplicationInfo).bDead=True;
else TCPRI(TCPlayer(Owner).PlayerReplicationInfo).bDead=False;

if(bAutoIdle && TCPlayer(Owner).IdleCounter >= GetControls().AutoIdleTime && !TCPRI(TCPlayer(Owner).PlayerReplicationInfo).bAway)
{
TCPlayer(Owner).bAway=True;
TCPRI(TCPlayer(Owner).PlayerReplicationInfo).bAway=True;
GetControls().Print(TCPlayer(Owner).PlayerReplicationInfo.PlayerName$" was idle for "$GetControls().AutoIdleTime$" minutes and has been set as AWAY.");
}
if(bAutoIdleKick && TCPlayer(Owner).IdleCounter >= GetControls().AutoIdleKickTime && TCPRI(TCPlayer(Owner).PlayerReplicationInfo).bAway)
{
GetControls().Print(TCPlayer(Owner).PlayerReplicationInfo.PlayerName$" was idle for "$GetControls().AutoIdleKickTime$" minutes and removed from the game.");
TCPlayer(Owner).Destroy();
}




wpDummy.uc (extends Actor)

var string wpName;
var Actor wpActor;
var bool bCanDelete;
Tag='Waypoint'
bHidden=True
bAlwaysRelevant=True

PostBeginPlay


SetTimer(0.5,True);

Timer


local TCPlayer TCP;
local bool bFound;
local vector modv;


if(bCanDelete)
if(wpActor == None)
Destroy();

if(wpActor != None)
{
modv = wpActor.location;
if(pawn(wpActor) != None)
{
modv.z += 20;
}

foreach Allactors(class'TCPlayer', TCP)
if(TCPRI(TCP.PlayerReplicationInfo).wpTargetPRI == Self)
bFound=True;

if(bFound && wpActor != None)
SetLocation(modv);

if(!bFound)
Destroy();
}