Deus Ex Documentation::Engine

Actor.uc (extends Object)

var actor BestActor;
var float Score;
var float Visibility;
var float Volume;
var float Smell;
var(Advanced) const bool bStatic; // Does not move or change over time.
var(Advanced) bool bHidden; // Is hidden during gameplay.
var(Advanced) const bool bNoDelete; // Cannot be deleted during play.
var bool bAnimFinished; // Unlooped animation sequence has finished.
var bool bAnimLoop; // Whether animation is looping.
var bool bAnimNotify; // Whether a notify is applied to the current sequence.
var bool bAnimByOwner; // Animation dictated by owner.
var const bool bDeleteMe; // About to be deleted.
var transient const bool bAssimilated; // Actor dynamics are assimilated in world geometry.
var transient const bool bTicked; // Actor has been updated.
var transient bool bLightChanged; // Recalculate this light's lighting now.
var bool bDynamicLight; // Temporarily treat this as a dynamic light.
var bool bTimerLoop; // Timer loops (else is one-shot).
var(Advanced) bool bCanTeleport; // This actor can be teleported.
var(Advanced) bool bIsSecretGoal; // This actor counts in the "secret" total.
var(Advanced) bool bIsKillGoal; // This actor counts in the "death" toll.
var(Advanced) bool bIsItemGoal; // This actor counts in the "item" count.
var(Advanced) bool bCollideWhenPlacing; // This actor collides with the world when placing.
var(Advanced) bool bTravel; // Actor is capable of travelling among servers.
var(Advanced) bool bMovable; // Actor is capable of travelling among servers.
var(Advanced) bool bHighDetail; // Only show up on high-detail.
var(Advanced) bool bStasis; // In StandAlone games, turn off if not in a recently rendered zone turned off if bCanStasis and physics = PHYS_None or PHYS_Rotating.
var(Advanced) bool bForceStasis; // Force stasis when not recently rendered, even if physics not none or rotating.
var const bool bIsPawn; // True only for pawns.
var(Advanced) const bool bNetTemporary; // Tear-off simulation in network play.
var(Advanced) const bool bNetOptional; // Actor should only be replicated if bandwidth available.
var(Advanced) bool bBlockSight; // True if pawns can't see through this actor.
var(Advanced) bool bDetectable; // True if this actor can be detected (by sight, sound, etc).
var(Advanced) bool bTransient; // True if this actor should be destroyed when it goes into stasis
var bool bIgnore; // True if this actor should be generally ignored; compliance is voluntary
var(Movement) const enum EPhysics
var ENetRole Role;
var(Networking) ENetRole RemoteRole;
var float LastRenderTime;
var float DistanceFromPlayer;
var const Actor Owner; // Owner actor.
var(Object) name InitialState;
var(Object) name Group;
var float TimerRate; // Timer event, 0=no timer.
var const float TimerCounter; // Counts up until it reaches TimerRate.
var(Advanced) float LifeSpan; // How old the object lives before dying, 0=forever.
var(Display) name AnimSequence; // Animation sequence we're playing.
var(Display) float AnimFrame; // Current animation frame, 0.0 to 1.0.
var(Display) float AnimRate; // Animation rate in frames per second, 0=none, negative=velocity scaled.
var float TweenRate; // Tween-into rate.
var(Display) float LODBias;
var name BlendAnimSequence[4];
var float BlendAnimFrame[4];
var float BlendAnimRate[4];
var float BlendTweenRate[4];
var zoneinfo Zone; // Zone.
var int iLeaf; // Bsp leaf.
var byte ZoneNumber; // Zone number.
var const LevelInfo Level; // Level this actor is on.
var transient const Level XLevel; // Level object.
var(Events) name Tag; // Actor's tag name.
var(Events) name Event; // The event this actor causes.
var Actor Target; // Actor we're aiming at (other uses as well).
var Pawn Instigator; // Pawn responsible for damage.
var travel Inventory Inventory; // Inventory chain. (DEUS_EX STM - added "travel")
var const Actor Base; // Moving brush actor we're standing on.
var const PointRegion Region; // Region this actor is in.
var(Movement) name AttachTag;
var const byte StandingCount; // Count of actors standing on this actor.
var const byte MiscNumber; // Internal use.
var const byte LatentByte; // Internal latent function use.
var const int LatentInt; // Internal latent function use.
var const float LatentFloat; // Internal latent function use.
var const actor LatentActor; // Internal latent function use.
var const actor Touching[4]; // List of touching actors.
var const actor Deleted; // Next actor in just-deleted chain.
var const transient int CollisionTag, LightingTag, NetTag, OtherTag, ExtraTag, SpecialTag;
var(Movement) const vector Location; // Actor's location; use Move to set.
var(Movement) const rotator Rotation; // Rotation.
var const vector OldLocation; // Actor's old location one tick ago.
var const vector ColLocation; // Actor's old location one move ago.
var(Movement) vector Velocity; // Velocity.
var vector Acceleration; // Acceleration.
var(Advanced) bool bHiddenEd; // Is hidden during editing.
var(Advanced) bool bDirectional; // Actor shows direction arrow during editing.
var const bool bSelected; // Selected in UnrealEd.
var const bool bMemorized; // Remembered in UnrealEd.
var const bool bHighlighted; // Highlighted in UnrealEd.
var bool bEdLocked; // Locked in editor (no movement or rotation).
var(Advanced) bool bEdShouldSnap; // Snap to grid in editor.
var transient bool bEdSnap; // Should snap to grid in UnrealEd.
var transient const bool bTempEditor; // Internal UnrealEd.
var(Filter) bool bDifficulty0; // Appear in difficulty 0.
var(Filter) bool bDifficulty1; // Appear in difficulty 1.
var(Filter) bool bDifficulty2; // Appear in difficulty 2.
var(Filter) bool bDifficulty3; // Appear in difficulty 3.
var(Filter) bool bSinglePlayer; // Appear in single player.
var(Filter) bool bNet; // Appear in regular network play.
var(Filter) bool bNetSpecial; // Appear in special network play mode.
var(Filter) float OddsOfAppearing; // 0-1 - chance actor will appear in relevant game modes.
var(Display) enum EDrawType
var(Display) enum ERenderStyle
var(Display) texture Sprite; // Sprite texture if DrawType=DT_Sprite.
var(Display) texture Texture; // Misc texture.
var(Display) texture Skin; // Special skin or enviro map texture.
var(Display) mesh Mesh; // Mesh if DrawType=DT_Mesh.
var const export model Brush; // Brush if DrawType=DT_Brush.
var(Display) float DrawScale; // Scaling factor, 1.0=normal size.
var(Display) float ScaleGlow; // Multiplies lighting.
var(Display) byte AmbientGlow; // Ambient brightness, or 255=pulsing.
var(Display) byte Fatness; // Fatness (mesh distortion).
var(Display) bool bUnlit; // Lights don't affect actor.
var(Display) bool bNoSmooth; // Don't smooth actor's texture.
var(Display) bool bParticles; // Mesh is a particle system.
var(Display) bool bRandomFrame; // Particles use a random texture from among the default texture and the multiskins textures
var(Display) bool bMeshEnviroMap; // Environment-map the mesh.
var(Display) bool bMeshCurvy; // Curvy mesh.
var(Display) float VisibilityRadius;// Actor is drawn if viewer is within its visibility
var(Display) float VisibilityHeight;// cylinder. Zero=infinite visibility.
var(Display) bool bShadowCast; // Casts shadows.
var(Advanced) bool bOwnerNoSee; // Everything but the owner can see this actor.
var(Advanced) bool bOnlyOwnerSee; // Only owner can see this actor.
var Const bool bIsMover; // Is a mover.
var(Advanced) bool bAlwaysRelevant; // Always relevant for network.
var Const bool bAlwaysTick; // Update even when players-only.
var(Advanced) bool bGameRelevant; // Always relevant for game
var(Display) texture MultiSkins[8];
var(Sound) byte SoundRadius; // Radius of ambient sound.
var(Sound) byte SoundVolume; // Volume of amient sound.
var(Sound) byte SoundPitch; // Sound pitch shift, 64.0=none.
var(Sound) sound AmbientSound; // Ambient sound effect.
var(Sound) float TransientSoundVolume;
var(Sound) float TransientSoundRadius;
var(Collision) const float CollisionRadius; // Radius of collision cyllinder.
var(Collision) const float CollisionHeight; // Half-height cyllinder.
var(Collision) const bool bCollideActors; // Collides with other actors.
var(Collision) bool bCollideWorld; // Collides with the world.
var(Collision) bool bBlockActors; // Blocks other nonplayer actors.
var(Collision) bool bBlockPlayers; // Blocks other player actors.
var(Collision) bool bProjTarget; // Projectiles should potentially target this actor.
var(Lighting) enum ELightType
var(Lighting) enum ELightEffect
var(LightColor) byte
var(Lighting) byte
var(Lighting) bool bSpecialLit; // Only affects special-lit surfaces.
var(Lighting) bool bActorShadows; // Light casts actor shadows.
var(Lighting) bool bCorona; // Light uses Skin as a corona.
var(Lighting) bool bLensFlare; // Whether to use zone lens flare.
var(Movement) bool bBounce; // Bounces when hits ground fast.
var(Movement) bool bFixedRotationDir; // Fixed direction of rotation.
var(Movement) bool bRotateToDesired; // Rotate to DesiredRotation.
var bool bInterpolating; // Performing interpolating.
var enum EDodgeDir
var(Movement) float Mass; // Mass of this actor.
var(Movement) float Buoyancy; // Water buoyancy.
var(Movement) rotator RotationRate; // Change in rotation per second.
var(Movement) rotator DesiredRotation; // Physics will rotate pawn to this if bRotateToDesired.
var float PhysAlpha; // Interpolating position, 0.0-1.0.
var float PhysRate; // Interpolation rate per second.
var float AnimLast; // Last frame.
var float AnimMinRate; // Minimum rate for velocity-scaled animation.
var float BlendAnimLast[4]; // Last frame.
var float BlendAnimMinRate[4]; // Minimum rate for velocity-scaled animation.
var(Conversation) String BindName; // Used to bind conversations
var(Conversation) String BarkBindName; // Used to bind Barks!
var(Conversation) localized String FamiliarName; // For display in Conversations
var(Conversation) localized String UnfamiliarName; // For display in Conversations
var transient Object ConListItems; // List of ConListItems for this Actor
var(Conversation) float ConStartInterval; // Amount of time required between two convos.
var(Smell) class SmellClass;
var SmellNode LastSmellNode;
var(Advanced) bool bOwned;
var bool bVisionImportant;
var(Networking) float NetPriority; // Higher priorities means update it more frequently.
var(Networking) float NetUpdateFrequency; // How many seconds between net updates.
var(Networking) float RelevantRadius; //Radius in which things are always relevant.
var const bool bNetInitial; // Initial network update.
var const bool bNetOwner; // Player owns this actor.
var const bool bNetRelevant; // Actor is currently relevant. Only valid server side, only when replicating variables.
var const bool bNetSee; // Player sees it in network play.
var const bool bNetHear; // Player hears it in network play.
var const bool bNetFeel; // Player collides with/feels it in network play.
var const bool bSimulatedPawn; // True if Pawn and simulated proxy.
var const bool bDemoRecording; // True we are currently demo recording
var const bool bClientDemoRecording;// True we are currently recording a client-side demo
var const bool bClientDemoNetFunc;// True if we're client-side demo recording and this call originated from the remote.
var(Display) class RenderIteratorClass; // class to instantiate as the actor's RenderInterface
var transient RenderIterator RenderInterface; // abstract iterator initialized in the Rendering engine
bMovable=True
bDetectable=True
Role=ROLE_Authority
RemoteRole=ROLE_DumbProxy
LastRenderTime=-10.000000
LODBias=1.000000
bDifficulty0=True
bDifficulty1=True
bDifficulty2=True
bDifficulty3=True
bSinglePlayer=True
bNet=True
bNetSpecial=True
OddsOfAppearing=1.000000
DrawType=DT_Sprite
Style=STY_Normal
Texture=Texture'Engine.S_Actor'
DrawScale=1.000000
ScaleGlow=1.000000
Fatness=128
SoundRadius=32
SoundVolume=128
SoundPitch=64
TransientSoundVolume=1.000000
CollisionRadius=22.000000
CollisionHeight=22.000000
bJustTeleported=True
Mass=100.000000
ConStartInterval=5.000000
NetPriority=1.000000
NetUpdateFrequency=100.000000

AIClearEvent (name eventName) | native

AIClearEventCallback (name eventName) | native

AIEndEvent (name eventName, EAIEventType eventType) | native

AIGetLightLevel (vector Location) | native

AIVisibility (optional bool bIncludeVelocity) | native

AllActors (class BaseClass, out actor Actor, optional name MatchTag) | native

AnimEnd

Attach (Actor Other)

AutonomousPhysics (float DeltaSeconds) | native

BaseChange

BasedActors (class BaseClass, out actor Actor) | native

BecomeViewTarget

BeginEvent

BeginPlay

BroadcastLocalizedMessage (class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)


local Pawn P;


for ( P=Level.PawnList; P != None; P=P.nextPawn )
if ( P.bIsPlayer || P.IsA('MessagingSpectator') )
P.ReceiveLocalizedMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );

BroadcastMessage (coerce string Msg, optional bool bBeep, optional name Type)


local Pawn P;


if (Type == '')
Type = 'Event';

// if ( Level.Game.AllowsBroadcast(self, Len(Msg)) )
for( P=Level.PawnList; P!=None; P=P.nextPawn )
if( P.bIsPlayer || P.IsA('MessagingSpectator') )
P.ClientMessage( Msg, Type, bBeep );

Bump (Actor Other)

BumpWall (vector HitLocation, vector HitNormal)

ChildActors (class BaseClass, out actor Actor) | native

ConsoleCommand (string Command) -> string | native

CycleActors (class BaseClass, out actor Actor, out int Index) | native

Destroy | native

Destroyed

Detach (Actor Other)

EncroachedBy (actor Other)

EncroachingOn (actor Other) -> bool

EndConversation


LastConEndTime = Level.TimeSeconds;

EndEvent

EndedRotation

Error (coerce string S) | native

Expired

Falling

FellOutOfWorld


SetPhysics(PHYS_None);
Destroy();

FinishAnim | native

FinishInterpolation | native

Frob (Actor Frobber, Inventory frobWith)

GainedChild (Actor Other)

GetAnimGroup (name Sequence) | native

GetHumanName -> String


return GetItemName(string(class));

GetItemName (string FullName) -> String


local int pos;


pos = InStr(FullName, ".");
While ( pos != -1 )
{
FullName = Right(FullName, Len(FullName) - pos - 1);
pos = InStr(FullName, ".");
}

return FullName;

GetMapName (string NameEnding, string MapName, int Dir) | native

GetMeshTexture (optional int texnum) | native

GetNextInt (string ClassName, int Num) -> string | native

GetNextIntDesc (string ClassName, int Num, out string Entry, out string Description) | native

GetNextSkin (string Prefix, string CurrentSkin, int Dir, out string SkinName, out string SkinDesc) | native

GetPlayerPawn | native

GetSoundDuration (sound Sound) -> float | native

GetURLMap | native

HasAnim (name Sequence) | native

HitWall (vector HitNormal, actor HitWall)

HurtRadius (float DamageAmount, float DamageRadius, name DamageName, float Momentum, vector HitLocation, optional bool bIgnoreLOS)


local actor Victims;
local float damageScale, dist;
local vector dir;
local Mover M;


// DEUS_EX CNN

if( bHurtEntry )
return;

bHurtEntry = true;
if (!bIgnoreLOS)
{
foreach VisibleCollidingActors( class 'Actor', Victims, DamageRadius, HitLocation )
{
if( Victims != self )
{
dir = Victims.Location - HitLocation;
dist = FMax(1,VSize(dir));
dir = dir/dist;
damageScale = 1 - FMax(0,(dist - Victims.CollisionRadius)/DamageRadius);
Victims.TakeDamage
(
damageScale * DamageAmount,
Instigator,
Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * dir,
(damageScale * Momentum * dir),
DamageName
);
}
}
}
else
{
foreach RadiusActors(class 'Actor', Victims, DamageRadius, HitLocation )
{
if( Victims != self )
{
dir = Victims.Location - HitLocation;
dist = FMax(1,VSize(dir));
dir = dir/dist;
damageScale = 1 - FMax(0,(dist - Victims.CollisionRadius)/DamageRadius);
Victims.TakeDamage
(
damageScale * DamageAmount,
Instigator,
Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * dir,
(damageScale * Momentum * dir),
DamageName
);
}
}
}

//
// DEUS_EX - CNN - damage the movers, also
//
foreach RadiusActors(class 'Mover', M, DamageRadius, HitLocation)
{
if( M != self )
{
dir = M.Location - HitLocation;
dist = FMax(1,VSize(dir));
dir = dir/dist;
damageScale = 1 - FMax(0,(dist - M.CollisionRadius)/DamageRadius);
M.TakeDamage
(
damageScale * DamageAmount,
Instigator,
M.Location - 0.5 * (M.CollisionHeight + M.CollisionRadius) * dir,
(damageScale * Momentum * dir),
DamageName
);
}
}

bHurtEntry = false;

InStasis | native

InterpolateEnd (actor Other)

IsAnimating | native

IsOverlapping (actor checkActor) | native

KillCredit (Actor Other)

KilledBy (pawn EventInstigator)

Landed (vector HitNormal)

LastRendered | native

LoopAnim (name Sequence, optional float Rate, optional float TweenTime, optional float MinRate) | native

LostChild (Actor Other)

MakeNoise (float Loudness) | native

Move (vector Delta) | native

MoveSmooth (vector Delta) | native

PlayAnim (name Sequence, optional float Rate, optional float TweenTime) | native

PlayBlendAnim (name Sequence, optional float Rate, optional float TweenTime, optional int BlendSlot) | native

PlayerCanSeeMe | native

PostBeginPlay

PostNetBeginPlay

PostPostBeginPlay

PostTeleport (Teleporter OutTeleporter)

PreBeginPlay


// fake shrink to fix faked collision with floor problems - DEUS_EX CNN
if ((IsA('Decoration') || IsA('Inventory')) && (CollisionHeight > 0.75))
SetCollisionSize(CollisionRadius, CollisionHeight - 0.75);
else if (IsA('Pawn'))
{
if (CollisionHeight > 9)
SetCollisionSize(CollisionRadius, CollisionHeight - 4.5);
else
SetCollisionSize(CollisionRadius, CollisionHeight*0.5);
}

// Handle autodestruction if desired.
if( !bGameRelevant && (Level.NetMode != NM_Client) && !Level.Game.IsRelevant(Self) )
Destroy();

PreTeleport (Teleporter InTeleporter) -> bool

RadiusActors (class BaseClass, out actor Actor, float Radius, optional vector Loc) | native

RenderOverlays (canvas Canvas)

RenderTexture (ScriptedTexture Tex)

SetBase (actor NewBase) | native

SetCollision (optional bool NewColActors, optional bool NewBlockActors, optional bool NewBlockPlayers) | native

SetCollisionSize (float NewRadius, float NewHeight) | native

SetDefaultDisplayProperties


Style = Default.Style;
texture = Default.Texture;
bUnlit = Default.bUnlit;
bMeshEnviromap = Default.bMeshEnviromap;

SetDisplayProperties (ERenderStyle NewStyle, texture NewTexture, bool bLighting, bool bEnviroMap)


Style = NewStyle;
texture = NewTexture;
bUnlit = bLighting;
bMeshEnviromap = bEnviromap;

SetInitialState


if( InitialState!='' )
GotoState( InitialState );
else
GotoState( 'Auto' );

SetInstantMusicVolume (byte newMusicVolume) | native

SetInstantSoundVolume (byte newSoundVolume) | native

SetInstantSpeechVolume (byte newSpeechVolume) | native

SetLocation (vector NewLocation) | native

SetOwner (actor NewOwner) | native

SetPhysics (EPhysics newPhysics, optional Actor newFloor) | native

SetRotation (rotator NewRotation) | native

SetTimer (float NewTimerRate, bool bLoop) | native

Sleep (float Seconds) | native

Spawned

SpecialHandling (Pawn Other) -> Actor

StopBlendAnims


local int i;


for (i=0; i BlendAnimSequence[i] = '';

StopSound (int Id) | native

SupportActor (actor StandingActor)


StandingActor.SetBase( self );

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

Tick (float DeltaTime)

Timer

Touch (Actor Other)

TouchingActors (class BaseClass, out actor Actor) | native

TraceActors (class BaseClass, out actor Actor, out vector HitLoc, out vector HitNorm, vector End, optional vector Start, optional vector Extent) | native

TraceTexture (class BaseClass, out actor Actor, out name texName, out name texGroup, out int flags, out vector HitLoc, out vector HitNorm, vector End, optional vector Start, optional vector Extent) | native

TraceVisibleActors (class BaseClass, out actor Actor, out vector HitLoc, out vector HitNorm, vector End, optional vector Start, optional vector Extent) | native

TravelPostAccept

TravelPreAccept

Trigger (Actor Other, Pawn EventInstigator)

TweenAnim (name Sequence, float Time) | native

TweenBlendAnim (name Sequence, float Time, optional int BlendSlot) | native

UnTouch (Actor Other)

UnTrigger (Actor Other, Pawn EventInstigator)

VisibleActors (class BaseClass, out actor Actor, optional float Radius, optional vector Loc) | native

VisibleCollidingActors (class BaseClass, out actor Actor, optional float Radius, optional vector Loc, optional bool bIgnoreHidden) | native

ZoneChange (ZoneInfo NewZone)




AmbientSound.uc (extends Keypoint)

Texture=Texture'Engine.S_Ambient'
SoundRadius=64
SoundVolume=190



Ambushpoint.uc (extends NavigationPoint)

var vector lookdir; //direction to look while ambushing
var byte survivecount; //used when picking ambushpoint
var() float SightRadius; // How far bot at this point should look for enemies
var() bool bSniping; // bots should snipe from this position
SightRadius=5000.000000
bDirectional=True
SoundVolume=128

PreBeginPlay


lookdir = 2000 * vector(Rotation);

Super.PreBeginPlay();




Ammo.uc (extends Pickup)

var() travel int AmmoAmount;
var() travel int MaxAmmo;
var() class ParentAmmo; // Class of ammo to be represented in inventory
var() byte UsedInWeaponSlot[10];
var ammo PAmmo;
PickupMessage="You picked up some ammo."
RespawnTime=30.000000
MaxDesireability=0.200000
Texture=Texture'Engine.S_Ammo'
bCollideActors=False

AddAmmo (int AmmoToAdd) -> bool


If (AmmoAmount >= MaxAmmo) return false;
AmmoAmount += AmmoToAdd;
if (AmmoAmount > MaxAmmo) AmmoAmount = MaxAmmo;
return true;

BotDesireability (Pawn Bot) -> float


local Ammo AlreadyHas;


if ( ParentAmmo != None )
AlreadyHas = Ammo(Bot.FindInventoryType(ParentAmmo));
else
AlreadyHas = Ammo(Bot.FindInventoryType(Class));
if ( AlreadyHas == None )
return (0.35 * MaxDesireability);
if ( AlreadyHas.AmmoAmount == 0 )
return MaxDesireability;
if (AlreadyHas.AmmoAmount >= AlreadyHas.MaxAmmo)
return -1;

return ( MaxDesireability * FMin(1, 0.15 * MaxAmmo/AlreadyHas.AmmoAmount) );

HandlePickupQuery (inventory Item) -> bool


if ( (class == item.class) ||
(ClassIsChildOf(item.class, class'Ammo') && (class == Ammo(item).parentammo)) )
{
if (AmmoAmount==MaxAmmo) return true;
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogPickup(Item, Pawn(Owner));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogPickup(Item, Pawn(Owner));
if (Item.PickupMessageClass == None)
// DEUS_EX CNN - use the itemArticle and itemName
// Pawn(Owner).ClientMessage( Item.PickupMessage, 'Pickup' );
Pawn(Owner).ClientMessage( Item.PickupMessage @ Item.itemArticle @ Item.ItemName, 'Pickup' );
else
Pawn(Owner).ReceiveLocalizedMessage( Item.PickupMessageClass, 0, None, None, item.Class );
item.PlaySound( item.PickupSound );
AddAmmo(Ammo(item).AmmoAmount);
item.SetRespawn();
return true;
}
if ( Inventory == None )
return false;

return Inventory.HandlePickupQuery(Item);

SimUseAmmo -> bool

SpawnCopy (Pawn Other) -> inventory


local Inventory Copy;


if ( parentammo != None )
{
Copy = spawn(parentammo,Other,,,rot(0,0,0));
Copy.Tag = Tag;
Copy.Event = Event;
Copy.Instigator = Other;
Ammo(Copy).AmmoAmount = AmmoAmount;
Copy.BecomeItem();
Other.AddInventory( Copy );
Copy.GotoState('');
if ( Level.Game.ShouldRespawn(self) )
GotoState('Sleeping');
else
Destroy();
return Copy;
}
Copy = Super.SpawnCopy(Other);
Ammo(Copy).AmmoAmount = AmmoAmount;
return Copy;

UseAmmo (int AmountNeeded) -> bool


if (AmmoAmount < AmountNeeded) return False; // Can't do it
AmmoAmount -= AmountNeeded;
return True;




Bitmap.uc (extends Object)

var const enum ETextureFormat
var(Texture) palette Palette;
var const byte UBits, VBits;
var const int USize, VSize;
var(Texture) const int UClamp, VClamp;
var const color MipZero;
var const color MaxColor;
var const int InternalTime[2];
MipZero=(R=64,G=128,B=64)
MaxColor=(R=255,G=255,B=255,A=255)



BlockAll.uc (extends Keypoint)

bCollideActors=True
bBlockActors=True
bBlockPlayers=True



BlockMonsters.uc (extends Keypoint)

bCollideActors=True
bBlockActors=True



BlockPlayer.uc (extends Keypoint)

bBlockPlayers=True



Brush.uc (extends Actor)

var() enum ECsgOper
var const object UnusedLightMesh;
var vector PostPivot;
var() scale MainScale;
var() scale PostScale;
var scale TempScale;
var() color BrushColor;
var() int PolyFlags;
var() bool bColored;
MainScale=(Scale=(X=1.000000,Y=1.000000,Z=1.000000))
PostScale=(Scale=(X=1.000000,Y=1.000000,Z=1.000000))
TempScale=(Scale=(X=1.000000,Y=1.000000,Z=1.000000))
bStatic=True
bNoDelete=True
bEdShouldSnap=True
DrawType=DT_Brush
bFixedRotationDir=True



ButtonMarker.uc (extends NavigationPoint)




Camera.uc (extends PlayerPawn)

Location=(X=-500.000000,Y=-300.000000,Z=300.000000)
Texture=Texture'Engine.S_Camera'
CollisionRadius=16.000000
CollisionHeight=39.000000
LightBrightness=100
LightRadius=16



CameraPoint.uc (extends Keypoint)

var() ECameraCommand cmd; // what command to execute
var() float value; // parameter for command
var() name eventName; // used by CAMCMD_WAIT_EVENT
var() float timeSmooth; // execute command smoothly over time (0 = instant)
var() float timeWaitPost; // delay after executing command
var() bool bParallel; // execute the next command simultaneously
var() bool bRandom; // the next point is chosen at random from other bRandoms
var() int randomCount; // number of times to choose randomly
var() int postRandomNum; // sequence to start at after random sequence
var() const int sequenceNum; // assigned in editor automatically
var CameraPoint nextPoint; // next point to be executed - points linked at runtime
var CameraPoint prevPoint; // point that was just executed - used by bParallel
var float curTime; // timer used by movement routines
var vector startLoc; // init location at beginning of command
var rotator startRot; // init rotation at beginning of command
var float startFOV; // init FOV at beginning of command
var vector endLoc; // dest location
var rotator endRot; // dest rotation
var float endFOV; // dest FOV
var PlayerPawn Player; // which player is being controlled
var bool bTickReady; // can we tick now?
var bool bFirstRandom; // are we the first random point in this sequence?
var int randomRemain; // how many random choices are left?
var CameraPoint continuePoint; // where we continue after a random sequence
randomRemain=-1
bStatic=False
bDirectional=True
Texture=Texture'Engine.S_Camera'

EvaluateCommand -> bool


local vector loc;
local Actor A;


loc = vect(0,0,0);

// init the movement timer
curTime = 0.0;

// log("** CameraPoint.EvaluateCommand - "$sequenceNum$" - cmd = "$cmd$" value = "$value$" eventName = "$eventName);

switch (cmd)
{
case CAMCMD_MOVE: endLoc = Location;
endRot = Rotation;
break;

case CAMCMD_PUSH: loc.X = value;
endLoc += (loc >> Player.ViewRotation);
break;

case CAMCMD_FOV: endFOV += value;
break;

case CAMCMD_TILT: endRot.Pitch += value;
break;

case CAMCMD_PAN: endRot.Yaw += value;
break;

case CAMCMD_ROLL: endRot.Roll += value;
break;

case CAMCMD_WAIT: if (eventName != '')
{
Tag = eventName;
GoToSleep();
}
else
SetTimer(timeSmooth, False);
break;

case CAMCMD_TRIGGER: if (eventName != '')
{
foreach AllActors(class'Actor', A, eventName)
A.Trigger(None, None);
}
break;
}

// if we are running in parallel with the previous point,
// add its parameters to ours
if (prevPoint != None)
{
endLoc += prevPoint.endLoc - prevPoint.startLoc;
endRot += prevPoint.endRot - prevPoint.startRot;
endFOV += prevPoint.endFOV - prevPoint.startFOV;
}

GoToSleep


if (IsInState('Running'))
GotoState('Idle', 'Wait');
else
log("** WARNING - CameraPoint.GoToSleep() - "$sequenceNum$" - already sleeping!");

InitAllPoints


local CameraPoint cur, next;
local int num;
local rotator rot;


cur = Self;
num = 0;
while (num != 999999)
{
num = 999999;
foreach AllActors(class'CameraPoint', next)
{
// clamp the rotation
rot.Pitch = Rotation.Pitch % 65536;
rot.Yaw = Rotation.Yaw % 65536;
rot.Roll = Rotation.Roll % 65536;
SetRotation(rot);

// find the next highest number in the sequence
if ((next.sequenceNum < num) && (next.sequenceNum > cur.sequenceNum))
{
num = next.sequenceNum;
cur.nextPoint = next;
}
}

if (num != 999999)
{
// log("** CameraPoint.InitAllPoints - linked "$cur.sequenceNum$" to "$num);
cur = cur.nextPoint;
}
}

Next


GotoState('Running', 'Next');

SetContinuePoint


local CameraPoint point;


foreach AllActors(class'CameraPoint', point)
if (point.sequenceNum == postRandomNum)
{
continuePoint = point;
break;
}

Tick (float deltaTime)


local float alpha, beta;
local vector loc;
local rotator rot, diffrot;
local float fov;


if (!bTickReady)
return;

Super.Tick(deltaTime);

// update the timer and see if we're done
curTime += deltaTime;

if (curTime >= timeSmooth)
{
Player.ViewRotation = endRot;
Player.SetLocation(endLoc);
Player.SetFOVAngle(endFOV);
Player.DesiredFOV = endFOV;
Next();
}
else
{
alpha = curTime / timeSmooth;

// make sure we rotate the shortest direction
diffrot = endRot - startRot;

if (diffrot.Pitch >= 32768)
diffrot.Pitch = diffrot.Pitch - 65536;
else if (diffrot.Pitch <= -32768)
diffrot.Pitch = diffrot.Pitch + 65536;

if (diffrot.Yaw >= 32768)
diffrot.Yaw = diffrot.Yaw - 65536;
else if (diffrot.Yaw <= -32768)
diffrot.Yaw = diffrot.Yaw + 65536;

if (diffrot.Roll >= 32768)
diffrot.Roll = diffrot.Roll - 65536;
else if (diffrot.Roll <= -32768)
diffrot.Roll = diffrot.Roll + 65536;

// calculate our smoothing coefficient
beta = 3.0*alpha*alpha - 2.0*alpha*alpha*alpha;

// smooth the camera rotation, movement, and FOV
rot = startRot + beta * diffrot;
loc = startLoc + beta * (endLoc - startLoc);
fov = startFOV + beta * (endFOV - startFOV);

Player.SetLocation(loc);
Player.ViewRotation = rot;
Player.SetFOVAngle(fov);
Player.DesiredFOV = fov;
}

Timer


Next();

Trigger (Actor Other, Pawn Instigator)


Super.Trigger(Other, Instigator);
Tag = '';
Next();

WakeUp


GotoState('Running', 'Begin');

WakeUpRandomPoint


local CameraPoint point;
local int count, rnd;


// count how many there are
count = 0;
foreach AllActors(class'CameraPoint', point)
if (point.bRandom)
count++;

// pick one at random
rnd = Rand(count);
count = 0;
foreach AllActors(class'CameraPoint', point)
if (point.bRandom && (count++ == rnd))
{
point.randomRemain = randomRemain - 1;
point.continuePoint = continuePoint;
point.WakeUp();
break;
}




Canvas.uc (extends Object)

var font Font; // Font for DrawText.
var float SpaceX, SpaceY; // Spacing for after Draw*.
var float OrgX, OrgY; // Origin for drawing.
var float ClipX, ClipY; // Bottom right clipping region.
var float CurX, CurY; // Current position for drawing.
var float Z; // Z location. 1=no screenflash, 2=yes screenflash.
var byte Style; // Drawing style STY_None means don't draw.
var float CurYL; // Largest Y size since DrawText.
var color DrawColor; // Color for drawing.
var bool bCenter; // Whether to center the text.
var bool bNoSmooth; // Don't bilinear filter.
var const int SizeX, SizeY; // Zero-based actual dimensions.
var font SmallFont; // Small system font.
var font MedFont; // Medium system font.
var font BigFont; // Big system font.
var font LargeFont; // Large system font.
var const viewport Viewport; // Viewport that owns the canvas.
var const int FramePtr; // Scene frame pointer.
var const int RenderPtr; // Render device pointer, only valid during UGameEngine::Draw
Z=1.000000
Style=1
DrawColor=(R=127,G=127,B=127)
SmallFont=Font'Engine.SmallFont'
MedFont=Font'Engine.MedFont'
BigFont=Font'Engine.BigFont'
LargeFont=Font'Engine.LargeFont'

DrawActor (Actor A, bool WireFrame, optional bool ClearZ) | native

DrawClippedActor (Actor A, bool WireFrame, int X, int Y, int XB, int YB, optional bool ClearZ) | native

DrawIcon (texture Tex, float Scale)


if ( Tex != None )
DrawTile( Tex, Tex.USize*Scale, Tex.VSize*Scale, 0, 0, Tex.USize, Tex.VSize );

DrawPattern (texture Tex, float XL, float YL, float Scale)


DrawTile( Tex, XL, YL, (CurX-OrgX)*Scale, (CurY-OrgY)*Scale, XL*Scale, YL*Scale );

DrawPortal (int X, int Y, int Width, int Height, actor CamActor, vector CamLocation, rotator CamRotation, optional int FOV, optional bool ClearZ) | native

DrawRect (texture Tex, float RectX, float RectY)


DrawTile( Tex, RectX, RectY, 0, 0, Tex.USize, Tex.VSize );

DrawText (coerce string Text, optional bool CR) | native

DrawTextClipped (coerce string Text, optional bool bCheckHotKey) | native

DrawTile (texture Tex, float XL, float YL, float U, float V, float UL, float VL) | native

DrawTileClipped (texture Tex, float XL, float YL, float U, float V, float UL, float VL) | native

Reset


Font = Default.Font;
SpaceX = Default.SpaceX;
SpaceY = Default.SpaceY;
OrgX = Default.OrgX;
OrgY = Default.OrgY;
CurX = Default.CurX;
CurY = Default.CurY;
Style = Default.Style;
DrawColor = Default.DrawColor;
CurYL = Default.CurYL;
bCenter = false;
bNoSmooth = false;
Z = 1.0;

SetClip (float X, float Y)


ClipX = X;
ClipY = Y;

SetOrigin (float X, float Y)


OrgX = X;
OrgY = Y;

SetPos (float X, float Y)


CurX = X;
CurY = Y;

StrLen (coerce string String, out float XL, out float YL) | native

TextSize (coerce string String, out float XL, out float YL) | native




Carcass.uc (extends Decoration)

var bool bPlayerCarcass;
var() byte flies;
var() byte rats;
var() bool bReducedHeight;
var bool bDecorative;
var bool bSlidingCarcass;
var int CumulativeDamage;
var PlayerReplicationInfo PlayerOwner;
var Pawn Bugs;
bDecorative=True
bStatic=False
bStasis=False
Physics=PHYS_Falling
LifeSpan=180.000000
AnimSequence=Dead
AnimFrame=0.900000
DrawType=DT_Mesh
Texture=Texture'Engine.S_Corpse'
CollisionRadius=18.000000
CollisionHeight=4.000000
bCollideActors=True
bCollideWorld=True
bProjTarget=True
Mass=180.000000
Buoyancy=105.000000

AddFliesAndRats

AllowChunk (int N, name A) -> bool


return true;

BeginState


if ( bDecorative )
lifespan = 0.0;
else
SetTimer(18.0, false);

CheckZoneCarcasses

ChunkUp (int Damage)


destroy();

CreateReplacement


if (Bugs != None)
Bugs.Destroy();

Destroyed


local Actor A;


if (Bugs != None)
Bugs.Destroy();

Super.Destroyed();

Initfor (actor Other)


//implemented in subclasses

Timer


local bool bSeen;
local Pawn aPawn;
local float dist;


if ( Region.Zone.NumCarcasses <= Region.Zone.MaxCarcasses )
{
if ( !PlayerCanSeeMe() )
Destroy();
else
SetTimer(2.0, false);
}
else
Destroy();




Console.uc (extends Object)

var private const int vtblOut;
var viewport Viewport;
var int HistoryTop, HistoryBot, HistoryCur;
var string TypedStr, History[16];
var int Scrollback, NumLines, TopLine, TextLines;
var float MsgTime, MsgTickTime;
var string MsgText[64];
var name MsgType[64];
var PlayerReplicationInfo MsgPlayer[64];
var float MsgTick[64];
var int BorderSize;
var int ConsoleLines, BorderLines, BorderPixels;
var float ConsolePos, ConsoleDest;
var float FrameX, FrameY;
var texture ConBackground, Border;
var bool bNoStuff, bTyping;
var bool bNoDrawWorld;
var bool bTimeDemo;
var bool bStartTimeDemo;
var bool bRestartTimeDemo;
var bool bSaveTimeDemoToFile;
var float StartTime;
var float ExtraTime;
var float LastFrameTime;
var float LastSecondStartTime;
var int FrameCount;
var int LastSecondFrameCount;
var float MinFPS;
var float MaxFPS;
var float LastSecFPS;
var Font TimeDemoFont;
var localized string LoadingMessage;
var localized string SavingMessage;
var localized string ConnectingMessage;
var localized string PausedMessage;
var localized string PrecachingMessage;
var localized string FrameRateText;
var localized string AvgText;
var localized string LastSecText;
var localized string MinText;
var localized string MaxText;
var localized string fpsText;
var localized string SecondsText;
var localized string FramesText;
ConBackground=Texture'Engine.ConsoleBack'
Border=Texture'Engine.Border'
TimeDemoFont=Font'Engine.SmallFont'
LoadingMessage="LOADING"
SavingMessage="SAVING"
ConnectingMessage="CONNECTING"
PausedMessage="PAUSED"
PrecachingMessage="PRECACHING"
FrameRateText="Frame Rate"
AvgText="Avg"
LastSecText="Last Sec"
MinText="Min"
MaxText="Max"
fpsText="fps"
SecondsText="seconds."
FramesText="frames rendered in"

AddString (coerce string Msg)


if( Msg!="" )
{
TopLine = (TopLine+1) % MaxLines;
NumLines = Min(NumLines+1,MaxLines-1);
MsgType[TopLine] = 'Event';
MsgTime = 6.0;
TextLines++;
MsgText[TopLine] = Msg;
MsgPlayer[TopLine] = None;
MsgTick[TopLine] = MsgTickTime + MsgTime;
}

BeginState


//log( "Console entering KeyMenuing" );

ClearMessages


local int i;


for (i=0; i {
MsgText[i] = "";
MsgType[i] = '';
MsgPlayer[i] = None;
MsgTick[i] = 0.0;
}
MsgTime = 0.0;

ConnectFailure (string FailCode, string URL)

ConsoleCommand (coerce string S) -> bool | native

DrawConsoleView (Canvas C)


local int Y, I, Line;
local float XL, YL;


// Console is visible; display console view.
Y = ConsoleLines - 1;
MsgText[(TopLine + 1 + MaxLines) % MaxLines] = "(>"@TypedStr;
for ( I = Scrollback; I < (NumLines + 1); I++ )
{
// Display all text in the buffer.
Line = (TopLine + MaxLines*2 - (I-1)) % MaxLines;

C.DrawColor.R = 255;
C.DrawColor.G = 255;
C.DrawColor.B = 255;
C.Font = C.MedFont;

if (( MsgType[Line] == 'Say' ) || ( MsgType[Line] == 'TeamSay' ))
C.StrLen( MsgPlayer[Line].PlayerName$":"@MsgText[Line], XL, YL );
else
C.StrLen( MsgText[Line], XL, YL );

// Half-space blank lines.
if ( YL == 0 )
YL = 5;

Y -= YL;
if ( (Y + YL) < 0 )
break;
C.SetPos(4, Y);
C.Font = C.MedFont;

if (( MsgType[Line] == 'Say' ) || ( MsgType[Line] == 'TeamSay' ))
C.DrawText( MsgPlayer[Line].PlayerName$":"@MsgText[Line], false );
else
C.DrawText( MsgText[Line], false );
}

DrawLevelAction (canvas C)


local string BigMessage;


// DEUS_EX AJY - don't want to print any text
// if the game is paused because we're in a menu
if (Viewport.Actor.bShowMenu )
{
BigMessage = "";
return;
}
if ( (Viewport.Actor.Level.Pauser != "") && (Viewport.Actor.Level.LevelAction == LEVACT_None) )
{
C.Font = C.BigFont;
C.Style = 1;
C.DrawColor.R = 255;
C.DrawColor.G = 255;
C.DrawColor.B = 255;

BigMessage = PausedMessage; // Add pauser name?
PrintActionMessage(C, BigMessage);
return;
}
else if ( Viewport.Actor.Level.LevelAction == LEVACT_Loading )
BigMessage = LoadingMessage;
else if ( Viewport.Actor.Level.LevelAction == LEVACT_Saving )
BigMessage = SavingMessage;
else if ( Viewport.Actor.Level.LevelAction == LEVACT_Connecting )
BigMessage = ConnectingMessage;
else if ( Viewport.Actor.Level.LevelAction == LEVACT_Precaching )
BigMessage = PrecachingMessage;

if ( BigMessage != "" )
{
C.Style = 3;
C.DrawColor.R = 0;
C.DrawColor.G = 0;
C.DrawColor.B = 255;
C.Font = C.LargeFont;
PrintActionMessage(C, BigMessage);
}

DrawSingleView (Canvas C)


local string TypingPrompt;
local int I, J;
local float XL, YL;
local string ShortMessages[4];
local int ExtraSpace;



// Console is hidden; display single-line view.

C.SetOrigin(0.0, 0.0);

// Ask the HUD to deal with messages.
if ( Viewport.Actor.myHUD != None
&& Viewport.Actor.myHUD.DisplayMessages(C) )
return;

C.DrawColor.R = 255;
C.DrawColor.G = 255;
C.DrawColor.B = 255;

// If the HUD doesn't deal with messages, use the default behavior
if (!Viewport.Actor.bShowMenu)
{
if ( bTyping )
{
TypingPrompt = "(>"@TypedStr$"_";
C.Font = C.MedFont;
C.StrLen( TypingPrompt, XL, YL );
C.SetPos( 2, FrameY - ConsoleLines - YL - 1 );
C.DrawText( TypingPrompt, false );
}
}

if ( TextLines > 0 && (!Viewport.Actor.bShowMenu || Viewport.Actor.bShowScores) )
{
J = TopLine;
I = 0;
while ((I < 4) && (J >= 0))
{
if ((MsgText[J] != "") && (MsgTick[J] > 0.0) && (MsgTick[J] > MsgTickTime) )
{
if (MsgType[J] == 'Say')
ShortMessages[I] = MsgPlayer[J].PlayerName$":"@MsgText[J];
else
ShortMessages[I] = MsgText[J];
I++;
}
J--;
}

J = 0;
C.Font = C.MedFont;
for ( I = 0; I < 4; I++ )
{
if (ShortMessages[3 - I] != "")
{
C.SetPos(4, 2 + (10 * J) + (10 * ExtraSpace));
C.StrLen( ShortMessages[3 - I], XL, YL );
C.DrawText( ShortMessages[3 - I], false );
if ( YL == 18.0 )
ExtraSpace++;
J++;
}
}
}

EndState


//log( "Console leaving KeyMenuing" );

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;

GetMsgPlayer (int Index) -> PlayerReplicationInfo


return MsgPlayer[Index];

GetMsgText (int Index) -> string


return MsgText[Index];

GetMsgTick (int Index) -> float


return MsgTick[Index];

GetMsgType (int Index) -> name


return MsgType[Index];

KeyEvent (EInputKey Key, EInputAction Action, FLOAT Delta) -> bool


if( Action==IST_Press )
{
ConsoleDest=0.0;
if( Viewport.Actor.myHUD!=None && Viewport.Actor.myHUD.MainMenu!=None )
Viewport.Actor.myHUD.MainMenu.ProcessMenuKey( Key, mid(string(GetEnum(enum'EInputKey',Key)),3) );
Scrollback=0;
GotoState( 'Menuing' );
return true;
}

KeyType (EInputKey Key) -> bool


ConsoleDest=0.0;
if( Viewport.Actor.myHUD!=None && Viewport.Actor.myHUD.MainMenu!=None )
Viewport.Actor.myHUD.MainMenu.ProcessMenuKey( Key, Chr(Key) );
Scrollback=0;
GotoState( 'Menuing' );

Message (PlayerReplicationInfo PRI, coerce string Msg, name N)


if( Msg!="" )
{
TopLine = (TopLine+1) % MaxLines;
NumLines = Min(NumLines+1,MaxLines-1);
MsgType[TopLine] = N;
MsgTime = 6.0;
TextLines++;
MsgText[TopLine] = Msg;
MsgPlayer[TopLine] = PRI;
MsgTick[TopLine] = MsgTickTime + MsgTime;
}

NotifyLevelChange


bRestartTimeDemo = True;
ClearMessages();

PostRender (canvas C)


local int YStart, YEnd, Y, I, J, Line, iLine;


if(bNoDrawWorld)
{
C.SetPos(0,0);
C.DrawPattern( Texture'Border', C.ClipX, C.ClipY, 1.0 );
}

if( bTimeDemo )
{
TimeDemoCalc();
TimeDemoRender( C );
}

// call overridable "level action" rendering code to draw the "big message"
DrawLevelAction( C );

// If the console has changed since the previous frame, draw it.
if ( ConsoleLines > 0 )
{
// DEUS_EX AJY
C.Style = 1;
C.DrawColor.R = 128;
C.DrawColor.G = 128;
C.DrawColor.B = 128;
C.SetPos(0.0, ConsoleLines - FrameY);
C.SetOrigin(0.0, 0.0);
C.DrawTile(ConBackground, FrameX, FrameY, 0.0, 0.0, FrameX, FrameY);

}

// Draw border.
if ( BorderLines > 0 || BorderPixels > 0 )
{
YStart = BorderLines + ConsoleLines;
YEnd = FrameY - BorderLines;
if ( BorderLines > 0 )
{
C.SetOrigin(0.0, 0.0);
C.SetPos(0.0, 0.0);
C.DrawPattern( Border, FrameX, BorderLines, 1.0 );
C.SetPos(0.0, YEnd);
C.DrawPattern( Border, FrameX, BorderLines, 1.0 );
}
if ( BorderPixels > 0 )
{
C.SetOrigin(0.0, 0.0);
C.SetPos(0.0, YStart);
C.DrawPattern( Border, BorderPixels, YEnd - YStart, 1.0 );
C.SetPos( FrameX - BorderPixels, YStart );
C.DrawPattern( Border, BorderPixels, YEnd - YStart, 1.0 );
}
}

// Draw console text.
C.SetOrigin(0.0, 0.0);
if ( ConsoleLines > 0 )
DrawConsoleView( C );
else
DrawSingleView( C );

PreRender (canvas C)

PrintActionMessage (Canvas C, string BigMessage)


local float XL, YL;


C.bCenter = false;
C.StrLen( BigMessage, XL, YL );
C.SetPos(FrameX/2 - XL/2, FrameY/2 - YL/2);
C.DrawText( BigMessage, false );

PrintTimeDemoResult


local LevelInfo Entry;
local float Avg;
local float Delta;
local string AvgString;
local string Temp;


Entry = Viewport.Actor.GetEntryLevel();

Delta = Entry.TimeSeconds - StartTime - ExtraTime;
if(Delta <= 0)
Avg = 0;
else
Avg = FrameCount / Delta;

AvgString = string(FrameCount)@FramesText@FormatFloat(delta)@SecondsText@MinText@FormatFloat(MinFPS)@MaxText@FormatFloat(MaxFPS)@AvgText@FormatFloat(Avg)@fpsText$".";
Viewport.Actor.ClientMessage(AvgString);
Log(AvgString);
if(bSaveTimeDemoToFile)
{
Temp =
FormatFloat(Avg) $ " Unreal "$ Viewport.Actor.Level.EngineVersion $ Chr(13) $ Chr(10) $
FormatFloat(MinFPS) $ " Min"$ Chr(13) $ Chr(10) $
FormatFloat(MaxFPS) $ " Max"$ Chr(13) $ Chr(10);

SaveTimeDemo(Temp);
}

SaveTimeDemo (string S) | native

SetMsgPlayer (int Index, PlayerReplicationInfo NewMsgPlayer)


MsgPlayer[Index] = NewMsgPlayer;

SetMsgText (int Index, string NewMsgText)


MsgText[Index] = NewMsgText;

SetMsgTick (int Index, int NewMsgTick)


MsgTick[Index] = NewMsgTick;

SetMsgType (int Index, name NewMsgType)


MsgType[Index] = NewMsgType;

StartTimeDemo


if(bTimeDemo)
return;
bTimeDemo = True;
bStartTimeDemo = True;

StopTimeDemo


if(!bTimeDemo)
return;
bTimeDemo = False;
PrintTimeDemoResult();

Talk


TypedStr="Say ";
bNoStuff = true;
GotoState( 'Typing' );

TeamTalk


TypedStr="TeamSay ";
bNoStuff = true;
GotoState( 'Typing' );

Tick (float Delta)


local int I;

MsgTickTime += Delta;

// Slide console up or down.
if( ConsolePos < ConsoleDest )
ConsolePos = FMin(ConsolePos+Delta,ConsoleDest);
else if( ConsolePos > ConsoleDest )
ConsolePos = FMax(ConsolePos-Delta,ConsoleDest);

// Update status message.
if( ((MsgTime-=Delta) <= 0.0) && (TextLines > 0) )
TextLines--;

// Update progress messages.
if (Viewport.Actor.ProgressTimeOut > Viewport.Actor.Level.TimeSeconds)
{
Viewport.Actor.ShowProgress();
}

TimeDemo (bool bEnabled, optional bool bSaveToFile)


bSaveTimeDemoToFile = bSaveToFile;
if(bEnabled)
StartTimeDemo();
else
StopTimeDemo();

TimeDemoCalc


local LevelInfo Entry;
local float Delta;

Entry = Viewport.Actor.GetEntryLevel();

if( bRestartTimeDemo )
{
StopTimeDemo();
StartTimeDemo();
bRestartTimeDemo = False;
}

if( bStartTimeDemo )
{
bStartTimeDemo = False;
StartTime = Entry.TimeSeconds;
ExtraTime = 0;
LastFrameTime = StartTime;
LastSecondStartTime = StartTime;
FrameCount = 0;
LastSecondFrameCount = 0;
MinFPS = 0;
MaxFPS = 0;
LastSecFPS = 0;
return;
}

Delta = Entry.TimeSeconds - LastFrameTime;

// If delta time is more than a half of a second, ignore frame entirely (precaching, loading etc)
if( Delta > 0.5 )
{
ExtraTime += Delta;
LastSecondStartTime = Entry.TimeSeconds;
LastSecondFrameCount = 0;
LastFrameTime = Entry.TimeSeconds;
return;
}

FrameCount++;
LastSecondFrameCount++;

if( Entry.TimeSeconds - LastSecondStartTime > 1)
{
LastSecFPS = LastSecondFrameCount / (Entry.TimeSeconds - LastSecondStartTime);
if( MinFPS == 0 || LastSecFPS < MinFPS )
MinFPS = LastSecFPS;
if( LastSecFPS > MaxFPS )
MaxFPS = LastSecFPS;
LastSecondFrameCount = 0;
LastSecondStartTime = Entry.TimeSeconds;
}

LastFrameTime = Entry.TimeSeconds;

TimeDemoRender (Canvas C)


local string AText, LText;
local float W, H;


C.Font = TimeDemoFont;
C.DrawColor.R = 255;
C.DrawColor.G = 255;
C.DrawColor.B = 255;

AText = AvgText @ FormatFloat(FrameCount / (Viewport.Actor.GetEntryLevel().TimeSeconds - StartTime - ExtraTime));
LText = LastSecText @ FormatFloat(LastSecFPS);

C.TextSize(AText, W, H);
C.SetPos(C.ClipX - W, 0.3*C.ClipY);
C.DrawText(AText);
C.TextSize(LText, W, H);
C.SetPos(C.ClipX - W, 0.3*C.ClipY+H);
C.DrawText(LText);

Type


TypedStr="";
gotoState( '' );

VideoChange

ViewDown


// BorderSize = Clamp( BorderSize+1, 0, MaxBorder );

ViewUp


// BorderSize = Clamp( BorderSize-1, 0, MaxBorder );




Counter.uc (extends Triggers)

var() byte NumToCount; // Number to count down from.
var() bool bShowMessage; // Display count message?
var() localized string CountMessage; // Human readable count message.
var() localized string CompleteMessage; // Completion message.
var byte OriginalNum; // Number to count at startup time.
NumToCount=2
CountMessage="Only %i more to go..."
CompleteMessage="Completed!"
Texture=Texture'Engine.S_Counter'

BeginPlay


OriginalNum = NumToCount;

Reset


NumToCount = OriginalNum;

Trigger (actor Other, pawn EventInstigator)


local string S;
local string Num;
local int i;
local actor A;


if( NumToCount > 0 )
{
if( --NumToCount == 0 )
{
// Trigger all matching actors.
if( bShowMessage && CompleteMessage != "" )
EventInstigator.ClientMessage( CompleteMessage );
if( Event != '' )
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Other, EventInstigator );
}
else if( bShowMessage && CountMessage != "" )
{
// Still counting down.
switch( NumToCount )
{
case 1: Num="one"; break;
case 2: Num="two"; break;
case 3: Num="three"; break;
case 4: Num="four"; break;
case 5: Num="five"; break;
case 6: Num="six"; break;
default: Num=string(NumToCount); break;
}
S = CountMessage;
while( InStr(S, "%i") >= 0 )
{
i = InStr(S, "%i");
S = Left(S,i) $ Num $ Mid(S,i+2);
}
EventInstigator.ClientMessage( S );
}
}




DamageType.uc (extends Actor)

var() localized string Name; // Description of damage.
var() localized string AltName; // Alternative description.
var() float ViewFlash; // View flash to play.
var() vector ViewFog; // View fog to play.
var() class DamageEffect; // Special effect.
AltName="killed"

DeathMessage -> string


if( FRand() < 0.5 )
return Default.Name;
else
return Default.AltName;




Decal.uc (extends Actor)

var int MultiDecalLevel;
var float LastRenderedTime;
var const array SurfList;
MultiDecalLevel=4
bHighDetail=True
bNetTemporary=True
bNetOptional=True
RemoteRole=ROLE_None
DrawType=DT_None
bUnlit=True
bGameRelevant=True
CollisionRadius=0.000000
CollisionHeight=0.000000

BeginPlay


if(!AttachDecal(100)) // trace 100 units ahead in direction of current rotation
Destroy();

Destroyed


DetachDecal();
Super.Destroyed();

Update (Actor L)




Decoration.uc (extends Actor)

var() class EffectWhenDestroyed;
var() bool bPushable;
var() bool bOnlyTriggerable;
var bool bSplash;
var bool bBobbing;
var bool bWasCarried;
var() sound PushSound;
var const int numLandings; // Used by engine physics.
var() class contents;
var() class content2;
var() class content3;
var() sound EndPushSound;
var bool bPushSoundPlaying;
var Float BaseEyeHeight;
bStatic=True
bStasis=True
Texture=None
Mass=0.000000

BaseChange


local float decorMass, decorMass2;


decormass= FMax(1, Mass);
bBobbing = false;
if( Velocity.Z < -500 )
TakeDamage( (1-Velocity.Z/30),Instigator,Location,vect(0,0,0) , 'crushed');

if( (base == None) && (bPushable || IsA('Carcass')) && (Physics == PHYS_None) )
SetPhysics(PHYS_Falling);
else if( (Pawn(base) != None) && (Pawn(Base).CarriedDecoration != self) )
{
Base.TakeDamage( (1-Velocity.Z/400)* decormass/Base.Mass,Instigator,Location,0.5 * Velocity , 'crushed');
Velocity.Z = 100;
if (FRand() < 0.5)
Velocity.X += 70;
else
Velocity.Y += 70;
SetPhysics(PHYS_Falling);
}
else if( Decoration(Base)!=None && Velocity.Z<-500 )
{
decorMass2 = FMax(Decoration(Base).Mass, 1);
Base.TakeDamage((1 - decorMass/decorMass2 * Velocity.Z/30), Instigator, Location, 0.2 * Velocity, 'stomped');
Velocity.Z = 100;
if (FRand() < 0.5)
Velocity.X += 70;
else
Velocity.Y += 70;
SetPhysics(PHYS_Falling);
}
else
instigator = None;

Bump (actor Other)


local float speed, oldZ;

if( bPushable && (Pawn(Other)!=None) && (Other.Mass > 40) )
{
bBobbing = false;
oldZ = Velocity.Z;
speed = VSize(Other.Velocity);
Velocity = Other.Velocity * FMin(120.0, 20 + speed)/speed;
if ( Physics == PHYS_None ) {
Velocity.Z = 25;
if (!bPushSoundPlaying) PlaySound(PushSound, SLOT_Misc,0.25);
bPushSoundPlaying = True;
}
else
Velocity.Z = oldZ;
SetPhysics(PHYS_Falling);
SetTimer(0.3,False);
Instigator = Pawn(Other);

Destroyed


local actor dropped, A;
local class tempClass;


if( (Pawn(Base) != None) && (Pawn(Base).CarriedDecoration == self) )
Pawn(Base).DropDecoration();
if( (Contents!=None) && !Level.bStartup )
{
tempClass = Contents;
if (Content2!=None && FRand()<0.3) tempClass = Content2;
if (Content3!=None && FRand()<0.3) tempClass = Content3;
dropped = Spawn(tempClass);
dropped.RemoteRole = ROLE_DumbProxy;
dropped.SetPhysics(PHYS_Falling);
dropped.bCollideWorld = true;
if ( inventory(dropped) != None )
inventory(dropped).GotoState('Pickup', 'Dropped');
}

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

if ( bPushSoundPlaying )
PlaySound(EndPushSound, SLOT_Misc,0.0);

Super.Destroyed();

Drop (vector newVel)

FollowHolder (Actor Other)

Frag (class FragType, vector Momentum, float DSize, int NumFrags)


local int i;
local actor A, Toucher;
local Fragment s;


if ( bOnlyTriggerable )
return;
if (Event!='')
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Toucher, pawn(Toucher) );
if ( Region.Zone.bDestructive )
{
Destroy();
return;
}
for (i=0 ; i {
s = Spawn( FragType, Owner);
s.CalcVelocity(Momentum,0);
s.DrawScale = DSize*0.5+0.7*DSize*FRand();
}

Destroy();

Landed (vector HitNormall)


if( bWasCarried && !SetLocation(Location) )
{
if( Instigator!=None && (VSize(Instigator.Location - Location) < CollisionRadius + Instigator.CollisionRadius) )
SetLocation(Instigator.Location);
TakeDamage( 1000, Instigator, Location, Vect(0,0,1)*900,'exploded' );
}
bWasCarried = false;
bBobbing = false;

Timer


PlaySound(EndPushSound, SLOT_Misc,0.0);
bPushSoundPlaying=False;

Trigger (actor Other, pawn EventInstigator)


Instigator = EventInstigator;
TakeDamage( 1000, Instigator, Location, Vect(0,0,1)*900,'exploded' );

ZoneChange (ZoneInfo NewZone)


local float splashsize;
local actor splash;


if( NewZone.bWaterZone )
{
if( bSplash && !Region.Zone.bWaterZone && Mass<=Buoyancy
&& ((Abs(Velocity.Z) < 100) || (Mass == 0)) && (FRand() < 0.05) && !PlayerCanSeeMe() )
{
bSplash = false;
SetPhysics(PHYS_None);
}
else if( !Region.Zone.bWaterZone && (Velocity.Z < -200) )
{
// Else play a splash.
splashSize = FClamp(0.0001 * Mass * (250 - 0.5 * FMax(-600,Velocity.Z)), 1.0, 3.0 );
if( NewZone.EntrySound != None )
PlaySound(NewZone.EntrySound, SLOT_Interact, splashSize);
if( NewZone.EntryActor != None )
{
splash = Spawn(NewZone.EntryActor);
if ( splash != None )
splash.DrawScale = splashSize;
}
}
bSplash = true;
}
else if( Region.Zone.bWaterZone && (Buoyancy > Mass) )
{
// bBobbing = true; // removed (looked stupid) - DEUS_EX CNN
if( Buoyancy > 1.1 * Mass )
Buoyancy = 0.95 * Buoyancy; // waterlog
else if( Buoyancy > 1.03 * Mass )
Buoyancy = 0.99 * Buoyancy;
}

if( NewZone.bPainZone && (NewZone.DamagePerSec > 0) )
TakeDamage(100, None, location, vect(0,0,0), NewZone.DamageType);

skinnedFrag (class FragType, texture FragSkin, vector Momentum, float DSize, int NumFrags)


local int i;
local actor A, Toucher;
local Fragment s;


if ( bOnlyTriggerable )
return;
if (Event!='')
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Toucher, pawn(Toucher) );
if ( Region.Zone.bDestructive )
{
Destroy();
return;
}
for (i=0 ; i {
s = Spawn( FragType, Owner);
s.CalcVelocity(Momentum/100,0);
s.Skin = FragSkin;
s.DrawScale = DSize*0.5+0.7*DSize*FRand();
}

Destroy();




DemoRecSpectator.uc (extends MessagingSpectator)

var PlayerPawn PlaybackActor;
var GameReplicationInfo PlaybackGRI;

ClientMessage (coerce string S, optional name Type, optional bool bBeep)


RepClientMessage( S, Type, bBeep );

ClientVoiceMessage (PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID)


RepClientVoiceMessage(Sender, Recipient, messagetype, messageID);

ReceiveLocalizedMessage (class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)


RepReceiveLocalizedMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );

RepClientMessage (coerce string S, optional name Type, optional bool bBeep)


if(PlaybackActor != None && PlaybackActor.Role == ROLE_Authority)
PlaybackActor.ClientMessage( S, Type, bBeep );

RepClientVoiceMessage (PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID)


if(PlaybackActor != None && PlaybackActor.Role == ROLE_Authority)
PlaybackActor.ClientVoiceMessage(Sender, Recipient, messagetype, messageID);

RepReceiveLocalizedMessage (class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)


if(PlaybackActor != None && PlaybackActor.Role == ROLE_Authority)
PlaybackActor.ReceiveLocalizedMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );

RepTeamMessage (PlayerReplicationInfo PRI, coerce string S, name Type)


if(PlaybackActor != None && PlaybackActor.Role == ROLE_Authority)
PlaybackActor.TeamMessage( PRI, S, Type );

TeamMessage (PlayerReplicationInfo PRI, coerce string S, name Type, optional bool bBeep)


RepTeamMessage( PRI, S, Type );

Tick (float Delta)


local PlayerPawn p;
local GameReplicationInfo g;


// find local playerpawn and attach.
if(Level.NetMode == NM_Client)
{
if(PlaybackActor == None)
{
foreach AllActors(class'PlayerPawn', p)
{
if( p.Player.IsA('Viewport') )
{
PlaybackActor = p;
if(PlaybackGRI != None)
PlaybackActor.GameReplicationInfo = PlaybackGRI;

Log("Attached to player "$p);

break;
}
}
}

if(PlaybackGRI == None)
{
foreach AllActors(class'GameReplicationInfo', g)
{
PlaybackGRI = g;
if(PlaybackActor != None)
PlaybackActor.GameReplicationInfo = PlaybackGRI;
break;
}
}

if(PlaybackActor != None && PlaybackGRI != None)
Disable('Tick');

}
else
{
Disable('Tick');
}




Dispatcher.uc (extends Triggers)

var() name OutEvents[8]; // Events to generate.
var() float OutDelays[8]; // Relative delays before generating events.
var int i; // Internal counter.
Texture=Texture'Engine.S_Dispatcher'

Trigger (actor Other, pawn EventInstigator)


Instigator = EventInstigator;
gotostate('Dispatch');




Effects.uc (extends Actor)

var() sound EffectSound1;
var() sound EffectSound2;
var() bool bOnlyTriggerable;
RemoteRole=ROLE_SimulatedProxy
DrawType=DT_None
bGameRelevant=True
CollisionRadius=0.000000
CollisionHeight=0.000000



Engine.uc (extends Subsystem)

var config class GameRenderDevice;
var(Drivers) config class AudioDevice;
var(Drivers) config class Console;
var(Drivers) config class NetworkDevice;
var(Drivers) config class Language;
var primitive Cylinder;
var const client Client;
var const renderbase Render;
var const audiosubsystem Audio;
var int TickCycles, GameCycles, ClientCycles;
var(Settings) config int CacheSizeMegs;
var(Settings) config bool UseSound;
var(Settings) float CurrentTickRate;
Console=Class'Engine.Console'
CacheSizeMegs=2
UseSound=True



Fragment.uc (extends Projectile)

var() MESH Fragments[11];
var int numFragmentTypes;
var bool bFirstHit;
var() float Elasticity;
bFirstHit=True
elasticity=0.500000
bNetOptional=True
Physics=PHYS_Falling
RemoteRole=ROLE_SimulatedProxy
LifeSpan=20.000000
CollisionRadius=18.000000
CollisionHeight=4.000000
bCollideActors=False
bBounce=True
bFixedRotationDir=True
NetPriority=1.400000

BeginState


// SetTimer(1.5,True); // Removed - DEUS_EX CNN
SetCollision(true, false, false);

CalcVelocity (vector Momentum, float ExplosionSize)


Velocity = VRand()*(ExplosionSize+FRand()*150.0+100.0 + VSize(Momentum)/80);

HitWall (vector HitNormal, actor HitWall)


// Added elasticity - DEUS_EX CNN
Velocity = Elasticity*(( Velocity dot HitNormal ) * HitNormal * (-2.0) + Velocity); // Reflect off Wall w/damping
speed = VSize(Velocity);
if (bFirstHit && speed<400)
{
bFirstHit=False;
bRotatetoDesired=True;
bFixedRotationDir=False;
DesiredRotation.Pitch=0;
DesiredRotation.Yaw=FRand()*65536;
DesiredRotation.roll=0;
}
RotationRate.Yaw = RotationRate.Yaw*0.75;
RotationRate.Roll = RotationRate.Roll*0.75;
RotationRate.Pitch = RotationRate.Pitch*0.75;
if ( (Velocity.Z < 50) && (HitNormal.Z > 0.7) )
{
SetPhysics(PHYS_none);
bBounce = false;
}
else If (speed > 80)
{
if (FRand()<0.5) PlaySound(ImpactSound, SLOT_None, 0.5+FRand()*0.5,, 300, 0.85+FRand()*0.3);
else PlaySound(MiscSound, SLOT_None, 0.5+FRand()*0.5,, 300, 0.85+FRand()*0.3);
}

PostBeginPlay


if ( Region.Zone.bDestructive )
Destroy();
else
Super.PostBeginPlay();

Touch (actor Other)


if (Pawn(Other)==None) Return;
if (!Pawn(Other).bIsPlayer) Destroy();

ZoneChange (ZoneInfo NewZone)


local float splashsize;
local actor splash;


if ( NewZone.bWaterZone )
{
Velocity = 0.2 * Velocity;
splashSize = 0.0005 * (250 - 0.5 * Velocity.Z);
if ( Level.NetMode != NM_DedicatedServer )
{
if ( NewZone.EntrySound != None )
PlaySound(NewZone.EntrySound, SLOT_Interact, splashSize);
if ( NewZone.EntryActor != None )
{
splash = Spawn(NewZone.EntryActor);
if ( splash != None )
splash.DrawScale = 4 * splashSize;
}
}
if (bFirstHit)
{
bFirstHit=False;
bRotatetoDesired=True;
bFixedRotationDir=False;
DesiredRotation.Pitch=0;
DesiredRotation.Yaw=FRand()*65536;
DesiredRotation.roll=0;
}

RotationRate = 0.2 * RotationRate;
GotoState('Dying');
}
if ( NewZone.bPainZone && (NewZone.DamagePerSec > 0) )
Destroy();

timer


if (!PlayerCanSeeMe())
Destroy();




GameInfo.uc (extends Info)

var int ItemGoals, KillGoals, SecretGoals; // Special game goals.
var byte Difficulty; // 0=easy, 1=medium, 2=hard, 3=very hard.
var() config bool bNoMonsters; // Whether monsters are allowed in this play mode.
var() globalconfig bool bMuteSpectators; // Whether spectators are allowed to speak.
var() config bool bHumansOnly; // Whether non human player models are allowed.
var() bool bRestartLevel;
var() bool bPauseable; // Whether the level is pauseable.
var() config bool bCoopWeaponMode; // Whether or not weapons stay when picked up.
var() config bool bClassicDeathmessages; // Weapon deathmessages if false.
var globalconfig bool bLowGore; // Whether or not to reduce gore.
var() bool bTeamGame; // This is a teamgame.
var() globalconfig bool bNoCheating; // Disallows cheating. Hehe.
var() globalconfig bool bAllowFOV; // Allows FOV changes in net games
var() bool bDeathMatch; // This game is some type of deathmatch (where players can respawn during gameplay)
var localized bool bAlternateMode;
var() globalconfig float AutoAim; // How much autoaiming to do (1 = none, 0 = always).
var() globalconfig float GameSpeed; // Scale applied to game rate.
var float StartTime;
var() class DefaultPlayerClass;
var() class DefaultWeapon; // Default weapon given to player at start.
var() globalconfig int MaxSpectators; // Maximum number of spectators.
var() private globalconfig string AdminPassword; // Password to receive bAdmin privileges.
var() private globalconfig string GamePassword; // Password to enter game.
var() class ScoreBoardType; // Type of scoreboard this game uses.
var() class GameMenuType; // Type of oldstyle game options menu to display.
var() string BotMenuType; // Type of bot menu to display.
var() string RulesMenuType; // Type of rules menu to display.
var() string SettingsMenuType; // Type of settings menu to display.
var() string GameUMenuType; // Type of Game dropdown to display.
var() string MultiplayerUMenuType; // Type of Multiplayer dropdown to display.
var() string GameOptionsMenuType; // Type of options dropdown to display.
var() class HUDType; // HUD class this game uses.
var() class MapListType; // Maplist this game uses.
var() string MapPrefix; // Prefix characters for names of maps for this game type.
var() string BeaconName; // Identifying string used for finding LAN servers.
var() string SpecialDamageString;
var localized string SwitchLevelMessage;
var localized string DefaultPlayerName;
var localized string LeftMessage;
var localized string FailedSpawnMessage;
var localized string FailedPlaceMessage;
var localized string FailedTeamMessage;
var localized string NameChangedMessage;
var localized string EnteredMessage;
var localized string GameName;
var() globalconfig int MaxPlayers;
var int NumPlayers;
var int CurrentID;
var() globalconfig string IPPolicies[50];
var class DeathMessageClass;
var class DMMessageClass;
var class MutatorClass;
var Mutator BaseMutator;
var Mutator DamageMutator; // linked list of mutators which affect damage
var class WaterZoneType;
var name DefaultPlayerState;
var() class GameReplicationInfoClass;
var GameReplicationInfo GameReplicationInfo;
var globalconfig string ServerLogName;
var StatLog LocalLog;
var StatLog WorldLog;
var globalconfig bool bLocalLog;
var globalconfig bool bWorldLog;
var globalconfig bool bBatchLocal;
var bool bLoggingGame; // Does this gametype log?
var string LocalLogFileName;
var string WorldLogFileName;
var class StatLogClass;
var globalconfig int DemoBuild;
var globalconfig int DemoHasTuts;
Difficulty=1
bRestartLevel=True
bPauseable=True
bCanChangeSkin=True
bNoCheating=True
bCanViewOthers=True
AutoAim=0.930000
GameSpeed=1.000000
MaxSpectators=2
BotMenuType="UMenu.UMenuBotConfigSClient"
RulesMenuType="UMenu.UMenuGameRulesSClient"
SettingsMenuType="UMenu.UMenuGameSettingsSClient"
GameUMenuType="UMenu.UMenuGameMenu"
MultiplayerUMenuType="UMenu.UMenuMultiplayerMenu"
GameOptionsMenuType="UMenu.UMenuOptionsMenu"
SwitchLevelMessage="Switching Levels"
DefaultPlayerName="Player"
LeftMessage=" left the game."
FailedSpawnMessage="Failed to spawn player actor"
FailedPlaceMessage="Could not find starting spot (level might need a 'PlayerStart' actor)"
FailedTeamMessage="Could not find team for player"
NameChangedMessage="Name changed to "
EnteredMessage=" entered the game."
GameName="Game"
MaxedOutMessage="Server is already at capacity."
WrongPassword="The password you entered is incorrect."
NeedPassword="You need to enter a password to join this game."
IPBanned="Your IP address has been banned on this server."
MaxPlayers=16
IPPolicies(0)="ACCEPT,*"
DeathMessageClass=Class'Engine.LocalMessage'
MutatorClass=Class'Engine.Mutator'
DefaultPlayerState=PlayerWalking
ServerLogName="server.log"
bLocalLog=True
bWorldLog=True
StatLogClass=Class'Engine.StatLogFile'

AcceptInventory (pawn PlayerPawn)


local inventory inv;

//default accept all inventory except default weapon (spawned explicitly)


// Initialize the inventory.
AddDefaultInventory( PlayerPawn );

log( "All inventory from" @ PlayerPawn.PlayerReplicationInfo.PlayerName @ "is accepted" );

AddBot -> bool

AddDefaultInventory (pawn PlayerPawn)


local Weapon newWeapon;
local class WeapClass;


PlayerPawn.JumpZ = PlayerPawn.Default.JumpZ * PlayerJumpZScaling();

if( PlayerPawn.IsA('Spectator') )
return;

// Spawn default weapon.
WeapClass = BaseMutator.MutatedDefaultWeapon();
if( (WeapClass!=None) && (PlayerPawn.FindInventoryType(WeapClass)==None) )
{
newWeapon = Spawn(WeapClass);
if( newWeapon != None )
{
newWeapon.Instigator = PlayerPawn;
newWeapon.BecomeItem();
newWeapon.GiveAmmo(PlayerPawn);
PlayerPawn.AddInventory(newWeapon);
newWeapon.BringUp();
newWeapon.SetSwitchPriority(PlayerPawn);
newWeapon.WeaponSet(PlayerPawn);
}
}
BaseMutator.ModifyPlayer(PlayerPawn);

AdminLogin (PlayerPawn P, string Password)


if (AdminPassword == "")
return;

if (Password == AdminPassword)
{
P.bAdmin = True;
P.PlayerReplicationInfo.bAdmin = P.bAdmin;
Log("Administrator logged in.");
BroadcastMessage( P.PlayerReplicationInfo.PlayerName@"became a server administrator." );
}

AdminLogout (PlayerPawn P)


if (AdminPassword == "")
return;

if (P.bAdmin)
{
P.bAdmin = False;
P.PlayerReplicationInfo.bAdmin = P.bAdmin;
Log("Administrator logged out.");
BroadcastMessage( P.PlayerReplicationInfo.PlayerName@"gave up administrator abilities." );
}

AllowsBroadcast (actor broadcaster, int Len) -> bool


SentText += Len;

return (SentText < 260);

AtCapacity (string Options) -> bool


return ( (MaxPlayers>0) && (NumPlayers>=MaxPlayers) );

BroadcastRegularDeathMessage (pawn Killer, pawn Other, name damageType)


BroadcastLocalizedMessage(DeathMessageClass, 0, Killer.PlayerReplicationInfo, Other.PlayerReplicationInfo, Killer.Weapon.Class);

CanSpectate (pawn Viewer, actor ViewTarget) -> bool


return true;

ChangeName (Pawn Other, coerce string S, bool bNameChange)


if( S == "" )
return;
if (LocalLog != None)
LocalLog.LogNameChange(Other);
if (WorldLog != None)
WorldLog.LogNameChange(Other);
Other.PlayerReplicationInfo.PlayerName = S;
if( bNameChange )
Other.ClientMessage( NameChangedMessage $ Other.PlayerReplicationInfo.PlayerName );

ChangeTeam (Pawn Other, int N) -> bool


Other.PlayerReplicationInfo.Team = N;
if (LocalLog != None)
LocalLog.LogTeamChange(Other);
if (WorldLog != None)
WorldLog.LogTeamChange(Other);
return true;

CheckIPPolicy (string Address) -> bool


local int i, j, LastMatchingPolicy;
local string Policy, Mask;
local bool bAcceptAddress, bAcceptPolicy;


// strip port number
j = InStr(Address, ":");
if(j != -1)
Address = Left(Address, j);

bAcceptAddress = True;
for(i=0; i<50 && IPPolicies[i] != ""; i++)
{
j = InStr(IPPolicies[i], ",");
if(j==-1)
continue;
Policy = Left(IPPolicies[i], j);
Mask = Mid(IPPolicies[i], j+1);
if(Policy ~= "ACCEPT")
bAcceptPolicy = True;
else
if(Policy ~= "DENY")
bAcceptPolicy = False;
else
continue;

j = InStr(Mask, "*");
if(j != -1)
{
if(Left(Mask, j) == Left(Address, j))
{
bAcceptAddress = bAcceptPolicy;
LastMatchingPolicy = i;
}
}
else
{
if(Mask == Address)
{
bAcceptAddress = bAcceptPolicy;
LastMatchingPolicy = i;
}
}
}

if(!bAcceptAddress)
Log("Denied connection for "$Address$" with IP policy "$IPPolicies[LastMatchingPolicy]);

return bAcceptAddress;

CreatureKillMessage (name damageType, pawn Other) -> string


return " was killed by a ";

DetailChange


local actor A;
local zoneinfo Z;
local skyzoneinfo S;

if( !Level.bHighDetailMode )
{
foreach AllActors(class'Actor', A)
{
if( A.bHighDetail && !A.bGameRelevant )
A.Destroy();
}
}
foreach AllActors(class'ZoneInfo', Z)
Z.LinkToSkybox();

DiscardInventory (Pawn Other)


local actor dropped;
local inventory Inv;
local weapon weap;
local float speed;


if( Other.DropWhenKilled != None )
{
dropped = Spawn(Other.DropWhenKilled,,,Other.Location);
Inv = Inventory(dropped);
if ( Inv != None )
{
Inv.RespawnTime = 0.0; //don't respawn
Inv.BecomePickup();
}
if ( dropped != None )
{
dropped.RemoteRole = ROLE_DumbProxy;
dropped.SetPhysics(PHYS_Falling);
dropped.bCollideWorld = true;
dropped.Velocity = Other.Velocity + VRand() * 280;
}
if ( Inv != None )
Inv.GotoState('PickUp', 'Dropped');
}
if( (Other.Weapon!=None) && (Other.Weapon.Class!=Level.Game.BaseMutator.MutatedDefaultWeapon())
&& Other.Weapon.bCanThrow )
{
speed = VSize(Other.Velocity);
weap = Other.Weapon;
if (speed != 0)
weap.Velocity = Normal(Other.Velocity/speed + 0.5 * VRand()) * (speed + 280);
else {
weap.Velocity.X = 0;
weap.Velocity.Y = 0;
weap.Velocity.Z = 0;
}
Other.TossWeapon();
if ( weap.PickupAmmoCount == 0 )
weap.PickupAmmoCount = 1;

EndGame (string Reason)


local actor A;


// don't end game if not really ready
if ( !SetEndCams(Reason) )
{
bOverTime = true;
return;
}
bGameEnded = true;
foreach AllActors(class'Actor', A, 'EndGame')
A.trigger(self, none);

if (LocalLog != None)
{
LocalLog.LogGameEnd(Reason);
LocalLog.StopLog();
if (bBatchLocal)
LocalLog.ExecuteSilentLogBatcher();
LocalLog.Destroy();
LocalLog = None;
}
if (WorldLog != None)
{
WorldLog.LogGameEnd(Reason);
WorldLog.StopLog();
WorldLog.ExecuteWorldLogBatcher();
WorldLog.Destroy();
WorldLog = None;
}

FindPlayerStart (Pawn Player, optional byte InTeam, optional string incomingName) -> NavigationPoint


local PlayerStart Dest;
local Teleporter Tel;

if( incomingName!="" )
foreach AllActors( class 'Teleporter', Tel )
if( string(Tel.Tag)~=incomingName )
return Tel;
foreach AllActors( class 'PlayerStart', Dest )
if( Dest.bSinglePlayerStart && Dest.bEnabled )
return Dest;

// if none, check for any that aren't enabled
log("WARNING: All single player starts were disabled - picking one anyway!");
foreach AllActors( class 'PlayerStart', Dest )
if( Dest.bSinglePlayerStart )
return Dest;
log( "No single player start found" );
return None;

ForceAddBot -> bool

GameEnding


if (LocalLog != None)
{
LocalLog.LogGameEnd("serverquit");
LocalLog.StopLog();
LocalLog.Destroy();
LocalLog = None;
}

if (WorldLog != None)
{
WorldLog.LogGameEnd("serverquit");
WorldLog.StopLog();
WorldLog.Destroy();
WorldLog = None;
}

GetBeaconText -> string


return
Level.ComputerName
$ " "
$ Left(Level.Title,24)
$ " "
$ BeaconName
$ " "
$ NumPlayers
$ "/"
$ MaxPlayers;

GetInfo -> string


local string ResultSet;


if (GamePassword != "")
ResultSet = "\\password\\True";
else
ResultSet = "\\password\\False";


return ResultSet;

GetIntOption (string Options, string ParseString, int CurrentValue) -> int


local string InOpt;


InOpt = ParseOption( Options, ParseString );
if ( InOpt != "" )
{
log(ParseString@InOpt);
return int(InOpt);
}
return CurrentValue;

GetKeyValue (string Pair, out string Key, out string Value)


if( InStr(Pair,"=")>=0 )
{
Key = Left(Pair,InStr(Pair,"="));
Value = Mid(Pair,InStr(Pair,"=")+1);
}
else
{
Key = Pair;
Value = "";
}

GetNetworkNumber -> string | native

GetRules -> string


local string ResultSet;
local Mutator M;
local string NextMutator, NextDesc;
local string EnabledMutators;
local int Num, i;


ResultSet = "";

EnabledMutators = "";
for (M = BaseMutator.NextMutator; M != None; M = M.NextMutator)
{
Num = 0;
NextMutator = "";
GetNextIntDesc("Engine.Mutator", 0, NextMutator, NextDesc);
while( (NextMutator != "") && (Num < 50) )
{
if(NextMutator ~= string(M.Class))
{
i = InStr(NextDesc, ",");
if(i != -1)
NextDesc = Left(NextDesc, i);

if(EnabledMutators != "")
EnabledMutators = EnabledMutators $ ", ";
EnabledMutators = EnabledMutators $ NextDesc;
break;
}

Num++;
GetNextIntDesc("Engine.Mutator", Num, NextMutator, NextDesc);
}
}
if(EnabledMutators != "")
ResultSet = ResultSet $ "\\mutators\\"$EnabledMutators;

ResultSet = ResultSet $ "\\listenserver\\"$string(Level.NetMode==NM_ListenServer);

if (GamePassword != "")
ResultSet = ResultSet $ "\\password\\True";
else
ResultSet = ResultSet $ "\\password\\False";

return ResultSet;

GetServerPort -> int


local string S;
local int i;


// Figure out the server's port.
S = Level.GetAddressURL();
i = InStr( S, ":" );
assert(i>=0);
return int(Mid(S,i+1));

GrabOption (out string Options, out string Result) -> bool


if( Left(Options,1)=="?" )
{
// Get result.
Result = Mid(Options,1);
if( InStr(Result,"?")>=0 )
Result = Left( Result, InStr(Result,"?") );

// Update options.
Options = Mid(Options,1);
if( InStr(Options,"?")>=0 )
Options = Mid( Options, InStr(Options,"?") );
else
Options = "";

return true;
}
else return false;

HasOption (string Options, string InKey) -> bool


local string Pair, Key, Value;

while( GrabOption( Options, Pair ) )
{
GetKeyValue( Pair, Key, Value );
if( Key ~= InKey )
return true;
}
return false;

InitGame (string Options, out string Error)


local string InOpt, LeftOpt;
local int pos;
local class MClass;


log( "InitGame:" @ Options );
MaxPlayers = Min( 32,GetIntOption( Options, "MaxPlayers", MaxPlayers ));
InOpt = ParseOption( Options, "Difficulty" );
if( InOpt != "" )
Difficulty = int(InOpt);

InOpt = ParseOption( Options, "AdminPassword");
if( InOpt!="" )
AdminPassword = InOpt;

InOpt = ParseOption( Options, "GameSpeed");
if( InOpt != "" )
{
log("GameSpeed"@InOpt);
SetGameSpeed(float(InOpt));
}

BaseMutator = spawn(MutatorClass);
log("Base Mutator is "$BaseMutator);
InOpt = ParseOption( Options, "Mutator");
if ( InOpt != "" )
{
log("Mutators"@InOpt);
while ( InOpt != "" )
{
pos = InStr(InOpt,",");
if ( pos > 0 )
{
LeftOpt = Left(InOpt, pos);
InOpt = Right(InOpt, Len(InOpt) - pos - 1);
}
else
{
LeftOpt = InOpt;
InOpt = "";
}
log("Add mutator "$LeftOpt);
MClass = class(DynamicLoadObject(LeftOpt, class'Class'));
BaseMutator.AddMutator(Spawn(MClass));
}
}

InOpt = ParseOption( Options, "GamePassword");
if( InOpt != "" )
{
GamePassWord = InOpt;
log( "GamePassword" @ InOpt );
}

InOpt = ParseOption( Options, "LocalLog");
if( InOpt ~= "true" )
bLocalLog = True;

InOpt = ParseOption( Options, "WorldLog");
if( InOpt ~= "true" )
bWorldLog = True;

InitGameReplicationInfo


GameReplicationInfo.bTeamGame = bTeamGame;
GameReplicationInfo.GameName = GameName;
GameReplicationInfo.GameClass = string(Class);
GameReplicationInfo.bClassicDeathmessages = bClassicDeathmessages;

InitLogging


local Mutator M;


if (bLocalLog && bLoggingGame)
{
Log("Initiating local logging...");
LocalLog = spawn(StatLogClass);
LocalLog.bWorld = False;
LocalLog.StartLog();
LocalLog.LogStandardInfo();
LocalLog.LogServerInfo();
LocalLog.LogMapParameters();
for (M = BaseMutator; M != None; M = M.NextMutator)
LocalLog.LogMutator(M);
LogGameParameters(LocalLog);
LocalLogFileName = LocalLog.GetLogFileName();
}

// Setup world statistics logging.
if ((Level.NetMode != NM_DedicatedServer) && (Level.NetMode != NM_ListenServer))
return;

if (bWorldLog && bLoggingGame)
{
Log("Initiating world logging...");
WorldLog = spawn(StatLogClass);
WorldLog.bWorld = True;
WorldLog.StartLog();
WorldLog.LogStandardInfo();
WorldLog.LogServerInfo();
WorldLog.LogMapParameters();
WorldLog.InitialCheck(Self);
for (M = BaseMutator; M != None; M = M.NextMutator)
WorldLog.LogMutator(M);
LogGameParameters(WorldLog);
WorldLogFileName = WorldLog.GetLogFileName();
}

IsRelevant (actor Other) -> bool


local byte bSuperRelevant;


// let the mutators mutate the actor or choose to remove it
if ( BaseMutator.AlwaysKeep(Other) )
return true;
if ( BaseMutator.IsRelevant(Other, bSuperRelevant) )
{
if ( bSuperRelevant == 1 ) // mutator wants to override any logic in here
return true;
}
else return false;

if
( (Difficulty==0 && !Other.bDifficulty0 )
|| (Difficulty==1 && !Other.bDifficulty1 )
|| (Difficulty==2 && !Other.bDifficulty2 )
|| (Difficulty==3 && !Other.bDifficulty3 )
|| (!Other.bSinglePlayer && (Level.NetMode==NM_Standalone) )
|| (!Other.bNet && ((Level.NetMode == NM_DedicatedServer) || (Level.NetMode == NM_ListenServer)) )
|| (!Other.bNetSpecial && (Level.NetMode==NM_Client)) )
return False;

if( bNoMonsters && (Pawn(Other) != None) && !Pawn(Other).bIsPlayer )
return False;

if( FRand() > Other.OddsOfAppearing )
return False;

// Update the level info goal counts.
if( Other.bIsSecretGoal )
SecretGoals++;

if( Other.bIsItemGoal )
ItemGoals++;

if( Other.bIsKillGoal )
KillGoals++;

return True;

KillMessage (name damageType, pawn Other) -> string


return " died.";

Killed (pawn Killer, pawn Other, name damageType)


local String Message, KillerWeapon, OtherWeapon;
local bool bSpecialDamage;


if (Other.bIsPlayer)
{
if ( (Killer != None) && (!Killer.bIsPlayer) )
{
if ( Level.NetMode != NM_Standalone )
{
Message = Other.PlayerReplicationInfo.PlayerName$Killer.KillMessage(damageType, Other);
BroadcastMessage( Message, false, 'DeathMessage');
}
if ( LocalLog != None )
LocalLog.LogSuicide(Other, DamageType, None);
if ( WorldLog != None )
WorldLog.LogSuicide(Other, DamageType, None);
return;
}
if ( (DamageType == 'SpecialDamage') && (SpecialDamageString != "") )
{
if ( Level.NetMode != NM_Standalone )
{
BroadcastMessage( ParseKillMessage(
Killer.PlayerReplicationInfo.PlayerName,
Other.PlayerReplicationInfo.PlayerName,
Killer.Weapon.ItemName,
SpecialDamageString
),
false, 'DeathMessage');
}
bSpecialDamage = True;
}
if ( (Killer == Other) || (Killer == None) )
{
// Suicide
if (damageType == '')
{
if ( LocalLog != None )
LocalLog.LogSuicide(Other, 'Unknown', Killer);
if ( WorldLog != None )
WorldLog.LogSuicide(Other, 'Unknown', Killer);
} else {
if ( LocalLog != None )
LocalLog.LogSuicide(Other, damageType, Killer);
if ( WorldLog != None )
WorldLog.LogSuicide(Other, damageType, Killer);
}
if (!bSpecialDamage)
{
if ( damageType == 'Fell' )
BroadcastLocalizedMessage(DeathMessageClass, 2, Other.PlayerReplicationInfo, None);
else if ( damageType == 'Eradicated' )
BroadcastLocalizedMessage(DeathMessageClass, 3, Other.PlayerReplicationInfo, None);
else if ( damageType == 'Drowned' )
BroadcastLocalizedMessage(DeathMessageClass, 4, Other.PlayerReplicationInfo, None);
else if ( damageType == 'Burned' )
BroadcastLocalizedMessage(DeathMessageClass, 5, Other.PlayerReplicationInfo, None);
else if ( damageType == 'Corroded' )
BroadcastLocalizedMessage(DeathMessageClass, 6, Other.PlayerReplicationInfo, None);
else if ( damageType == 'Mortared' )
BroadcastLocalizedMessage(DeathMessageClass, 7, Other.PlayerReplicationInfo, None);
else
BroadcastLocalizedMessage(DeathMessageClass, 1, Other.PlayerReplicationInfo, None);
}
}
else
{
// Increment deaths if you were killed by another player. (But not for suicides.)
Other.PlayerReplicationInfo.Deaths += 1;
if ( Killer.bIsPlayer )
{
KillerWeapon = "None";
if (Killer.Weapon != None)
KillerWeapon = Killer.Weapon.ItemName;
OtherWeapon = "None";
if (Other.Weapon != None)
OtherWeapon = Other.Weapon.ItemName;
if ( Killer.PlayerReplicationInfo.Team == Other.PlayerReplicationInfo.Team )
{
if ( LocalLog != None )
LocalLog.LogTeamKill(
Killer.PlayerReplicationInfo.PlayerID,
Other.PlayerReplicationInfo.PlayerID,
KillerWeapon,
OtherWeapon,
damageType
);
if ( WorldLog != None )
WorldLog.LogTeamKill(
Killer.PlayerReplicationInfo.PlayerID,
Other.PlayerReplicationInfo.PlayerID,
KillerWeapon,
OtherWeapon,
damageType
);
} else {
if ( LocalLog != None )
LocalLog.LogKill(
Killer.PlayerReplicationInfo.PlayerID,
Other.PlayerReplicationInfo.PlayerID,
KillerWeapon,
OtherWeapon,
damageType
);
if ( WorldLog != None )
WorldLog.LogKill(
Killer.PlayerReplicationInfo.PlayerID,
Other.PlayerReplicationInfo.PlayerID,
KillerWeapon,
OtherWeapon,
damageType
);
}
if (!bSpecialDamage && (Other != None))
{
BroadcastRegularDeathMessage(Killer, Other, damageType);
}
}

LogGameParameters (StatLog StatLog)


if (StatLog == None)
return;

StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"GameName"$Chr(9)$GameName);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"GameClass"$Chr(9)$Class);// <-- Move to c++
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"GameVersion"$Chr(9)$Level.EngineVersion);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"MinNetVersion"$Chr(9)$Level.MinNetVersion);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"NoMonsters"$Chr(9)$bNoMonsters);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"MuteSpectators"$Chr(9)$bMuteSpectators);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"HumansOnly"$Chr(9)$bHumansOnly);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"WeaponsStay"$Chr(9)$bCoopWeaponMode);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"ClassicDeathmessages"$Chr(9)$bClassicDeathmessages);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"LowGore"$Chr(9)$bLowGore);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"VeryLowGore"$Chr(9)$bVeryLowGore);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"TeamGame"$Chr(9)$bTeamGame);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"GameSpeed"$Chr(9)$int(GameSpeed*100));
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"MaxSpectators"$Chr(9)$MaxSpectators);
StatLog.LogEventString(StatLog.GetTimeStamp()$Chr(9)$"game"$Chr(9)$"MaxPlayers"$Chr(9)$MaxPlayers);

Logout (pawn Exiting)


local bool bMessage;


bMessage = true;
if ( Exiting.IsA('PlayerPawn') )
{
if ( Exiting.IsA('Spectator') )
{
bMessage = false;
if ( Level.NetMode == NM_DedicatedServer )
NumSpectators--;
}
else
NumPlayers--;
}
if( bMessage && (Level.NetMode==NM_DedicatedServer || Level.NetMode==NM_ListenServer) )
BroadcastMessage( Exiting.PlayerReplicationInfo.PlayerName$LeftMessage, false );

if ( LocalLog != None )
LocalLog.LogPlayerDisconnect(Exiting);
if ( WorldLog != None )
WorldLog.LogPlayerDisconnect(Exiting);

ParseKillMessage (string KillerName, string VictimName, string WeaponName, string DeathMessage) -> string

ParseOption (string Options, string InKey) -> string


local string Pair, Key, Value;

while( GrabOption( Options, Pair ) )
{
GetKeyValue( Pair, Key, Value );
if( Key ~= InKey )
return Value;
}
return "";

PickupQuery (Pawn Other, Inventory item) -> bool


if ( Other.Inventory == None )
return true;
else
return !Other.Inventory.HandlePickupQuery(Item);

PlaySpawnEffect (inventory Inv) -> float


return 0.3;

PlayTeleportEffect (actor Incoming, bool bOut, bool bSound)

PlayerJumpZScaling -> float


return 1.0;

PlayerKillMessage (name damageType, PlayerReplicationInfo Other) -> string


local string message;


message = " was killed by ";
return message;

PostBeginPlay


local ZoneInfo W;


if ( bAlternateMode )
{
bLowGore = true;
bVeryLowGore = true;
}

if ( bVeryLowGore )
bLowGore = true;

if ( WaterZoneType != None )
{
ForEach AllActors(class'ZoneInfo', W )
if ( W.bWaterZone )
{
if( W.EntryActor == None )
W.EntryActor = WaterZoneType.Default.EntryActor;
if( W.ExitActor == None )
W.ExitActor = WaterZoneType.Default.ExitActor;
if( W.EntrySound == None )
W.EntrySound = WaterZoneType.Default.EntrySound;
if( W.ExitSound == None )
W.ExitSound = WaterZoneType.Default.ExitSound;
}
}

// Setup local statistics logging.
InitLogging();

Super.PostBeginPlay();

PostLogin (playerpawn NewPlayer)


local Pawn P;

// Start player's music.
NewPlayer.ClientSetMusic( Level.Song, Level.SongSection, Level.CdTrack, MTRAN_Fade );
if ( Level.NetMode != NM_Standalone )
{
// replicate skins
for ( P=Level.PawnList; P!=None; P=P.NextPawn )
if ( P.bIsPlayer && (P != NewPlayer) )
{
if ( P.bIsMultiSkinned )
NewPlayer.ClientReplicateSkins(P.MultiSkins[0], P.MultiSkins[1], P.MultiSkins[2], P.MultiSkins[3]);
else
NewPlayer.ClientReplicateSkins(P.Skin);

if ( (P.PlayerReplicationInfo != None) && P.PlayerReplicationInfo.bWaitingPlayer && P.IsA('PlayerPawn') )
{
if ( NewPlayer.bIsMultiSkinned )
PlayerPawn(P).ClientReplicateSkins(NewPlayer.MultiSkins[0], NewPlayer.MultiSkins[1], NewPlayer.MultiSkins[2], NewPlayer.MultiSkins[3]);
else
PlayerPawn(P).ClientReplicateSkins(NewPlayer.Skin);
}
}
}

PreBeginPlay


StartTime = 0;
SetGameSpeed(GameSpeed);
Level.bNoCheating = bNoCheating;
Level.bAllowFOV = bAllowFOV;

if (GameReplicationInfoClass != None)
GameReplicationInfo = Spawn(GameReplicationInfoClass);
else
GameReplicationInfo = Spawn(class'GameReplicationInfo');
InitGameReplicationInfo();

ProcessServerTravel (string URL, bool bItems)


local playerpawn P, LocalPlayer;


if (LocalLog != None)
{
LocalLog.LogGameEnd("mapchange");
LocalLog.StopLog();
LocalLog.Destroy();
LocalLog = None;
}

if (WorldLog != None)
{
WorldLog.LogGameEnd("mapchange");
WorldLog.StopLog();
WorldLog.Destroy();
WorldLog = None;
}

// Notify clients we're switching level and give them time to receive.
// We call PreClientTravel directly on any local PlayerPawns (ie listen server)
log("ProcessServerTravel:"@URL);
foreach AllActors( class'PlayerPawn', P )
if( NetConnection(P.Player)!=None )
P.ClientTravel( URL, TRAVEL_Relative, bItems );
else
{
LocalPlayer = P;
P.PreClientTravel();
}

if ( (Level.NetMode == NM_ListenServer) && (LocalPlayer != None) )
Level.NextURL = Level.NextURL$"?Skin="$LocalPlayer.GetDefaultURL("Skin")
$"?Face="$LocalPlayer.GetDefaultURL("Face")
$"?Team="$LocalPlayer.GetDefaultURL("Team")
$"?Name="$LocalPlayer.GetDefaultURL("Name")
$"?Class="$LocalPlayer.GetDefaultURL("Class");

// Switch immediately if not networking.
if( Level.NetMode!=NM_DedicatedServer && Level.NetMode!=NM_ListenServer )
Level.NextSwitchCountdown = 0.0;

ReduceDamage (int Damage, name DamageType, pawn injured, pawn instigatedBy) -> int


if( injured.Region.Zone.bNeutralZone )
return 0;
return Damage;

RegisterDamageMutator (Mutator M)


M.NextDamageMutator = DamageMutator;
DamageMutator = M;

ResetGame

RestartGame


Level.ServerTravel( "?Restart", false );

RestartPlayer (pawn aPlayer) -> bool


local NavigationPoint startSpot;
local bool foundStart;


if( bRestartLevel && Level.NetMode!=NM_DedicatedServer && Level.NetMode!=NM_ListenServer )
return true;

startSpot = FindPlayerStart(aPlayer, 255);
if( startSpot == None )
{
log(" Player start not found!!!");
return false;
}
foundStart = aPlayer.SetLocation(startSpot.Location);
if( foundStart )
{
startSpot.PlayTeleportEffect(aPlayer, true);
aPlayer.SetRotation(startSpot.Rotation);
aPlayer.ViewRotation = aPlayer.Rotation;
aPlayer.Acceleration = vect(0,0,0);
aPlayer.Velocity = vect(0,0,0);
aPlayer.Health = aPlayer.Default.Health;
aPlayer.SetCollision( true, true, true );
aPlayer.ClientSetLocation( startSpot.Location, startSpot.Rotation );
aPlayer.bHidden = false;
aPlayer.DamageScaling = aPlayer.Default.DamageScaling;
aPlayer.SoundDampening = aPlayer.Default.SoundDampening;
AddDefaultInventory(aPlayer);
}
else
log(startspot$" Player start not useable!!!");
return foundStart;

ScoreEvent (name EventName, actor EventActor, pawn InstigatedBy)

ScoreKill (pawn Killer, pawn Other)


Other.DieCount++;
if( (killer == Other) || (killer == None) )
Other.PlayerReplicationInfo.Score -= 1;
else if ( killer != None )
{
killer.killCount++;
if ( killer.PlayerReplicationInfo != None )
killer.PlayerReplicationInfo.Score += 1;
}

BaseMutator.ScoreKill(Killer, Other);

SendPlayer (PlayerPawn aPlayer, string URL)


aPlayer.ClientTravel( URL, TRAVEL_Relative, true );

SetEndCams (string Reason) -> bool


local pawn aPawn;


for ( aPawn=Level.PawnList; aPawn!=None; aPawn=aPawn.NextPawn )
if ( aPawn.bIsPlayer )
{
aPawn.GotoState('GameEnded');
aPawn.ClientGameEnded();
}

return true;

SetGameSpeed (Float T)


GameSpeed = FMax(T, 0.1);
Level.TimeDilation = GameSpeed;
SetTimer(Level.TimeDilation, true);

SetPause (BOOL bPause, PlayerPawn P) -> bool


if( bPauseable || P.bAdmin || Level.Netmode==NM_Standalone )
{
if( bPause )
Level.Pauser=P.PlayerReplicationInfo.PlayerName;
else
Level.Pauser="";
return True;
}
else return False;

ShouldRespawn (actor Other) -> bool


if( Level.NetMode == NM_StandAlone )
return false;
return Inventory(Other)!=None && Inventory(Other).ReSpawnTime!=0.0;

StartPlayer (PlayerPawn Other)


if( Level.NetMode==NM_DedicatedServer || Level.NetMode==NM_ListenServer || !bRestartLevel )
Other.GotoState(Other.PlayerRestartState);
else
Other.ClientTravel( "?restart", TRAVEL_Relative, false );

Timer


SentText = 0;




GameReplicationInfo.uc (extends ReplicationInfo)

var string GameName; // Assigned by GameInfo.
var string GameClass; // Assigned by GameInfo.
var bool bTeamGame; // Assigned by GameInfo.
var bool bClassicDeathMessages;
var bool bStopCountDown;
var int RemainingTime, ElapsedTime, RemainingMinute;
var float SecondCount;
var int NumPlayers;
var int SumFrags;
var float UpdateTimer;
var() globalconfig string ServerName; // Name of the server, i.e.: Bob's Server.
var() globalconfig string ShortName; // Abbreviated name of server, i.e.: B's Serv (stupid example)
var() globalconfig string AdminName; // Name of the server admin.
var() globalconfig string AdminEmail; // Email address of the server admin.
var() globalconfig int Region; // Region of the game server.
var() globalconfig string MOTDLine1; // Message
var() globalconfig string MOTDLine2; // Of
var() globalconfig string MOTDLine3; // The
var() globalconfig string MOTDLine4; // Day
var string GameEndedComments; // set by gameinfo when game ends
var PlayerReplicationInfo PRIArray[32];
bStopCountDown=True
ServerName="Kaiser trying to make DXMP work"
RemoteRole=ROLE_SimulatedProxy
NetUpdateFrequency=4.000000

PostBeginPlay


if( Level.NetMode == NM_Client )
{
// clear variables so we don't display our own values if the server has them left blank
ServerName = "";
AdminName = "";
AdminEmail = "";
MOTDLine1 = "";
MOTDLine2 = "";
MOTDLine3 = "";
MOTDLine4 = "";
}

SecondCount = Level.TimeSeconds;
SetTimer(0.2, true);

Timer


local PlayerReplicationInfo PRI;
local int i, FragAcc;


if ( Level.NetMode == NM_Client )
{
if (Level.TimeSeconds - SecondCount >= Level.TimeDilation)
{
ElapsedTime++;
if ( RemainingMinute != 0 )
{
RemainingTime = RemainingMinute;
RemainingMinute = 0;
}
if ( (RemainingTime > 0) && !bStopCountDown )
RemainingTime--;
SecondCount += Level.TimeDilation;
}
}

for (i=0; i<32; i++)
PRIArray[i] = None;
i=0;
foreach AllActors(class'PlayerReplicationInfo', PRI)
{
PRIArray[i++] = PRI;
}

// Update various information.
UpdateTimer = 0;
for (i=0; i<32; i++)
if (PRIArray[i] != None)
FragAcc += PRIArray[i].Score;
SumFrags = FragAcc;

if ( Level.Game != None )
NumPlayers = Level.Game.NumPlayers;




HUD.uc (extends Actor)

var globalconfig int HudMode;
var globalconfig int Crosshair;
var() class MainMenuType;
var() string HUDConfigWindowType;
var color WhiteColor;
var Mutator HUDMutator;
var PlayerPawn PlayerOwner; // always the actual owner
var Class Message;
var int Switch;
var PlayerReplicationInfo RelatedPRI;
var Object OptionalObject;
var float EndOfLife;
var float LifeTime;
var bool bDrawing;
var int numLines;
var string StringMessage;
var color DrawColor;
var font StringFont;
var float XL, YL;
var float YPos;
HUDConfigWindowType="UMenu.UMenuHUDConfigCW"
WhiteColor=(G=128,B=255)
bHidden=True
RemoteRole=ROLE_SimulatedProxy

ChangeCrosshair (int d)

ChangeHud (int d)

ClearMessage (out HUDLocalizedMessage M)


M.Message = None;
M.Switch = 0;
M.RelatedPRI = None;
M.OptionalObject = None;
M.EndOfLife = 0;
M.StringMessage = "";
M.DrawColor = WhiteColor;
M.XL = 0;
M.bDrawing = false;

CopyMessage (out HUDLocalizedMessage M1, HUDLocalizedMessage M2)


M1.Message = M2.Message;
M1.Switch = M2.Switch;
M1.RelatedPRI = M2.RelatedPRI;
M1.OptionalObject = M2.OptionalObject;
M1.EndOfLife = M2.EndOfLife;
M1.StringMessage = M2.StringMessage;
M1.DrawColor = M2.DrawColor;
M1.XL = M2.XL;
M1.YL = M2.YL;
M1.YPos = M2.YPos;
M1.bDrawing = M2.bDrawing;
M1.LifeTime = M2.LifeTime;
M1.numLines = M2.numLines;

DisplayMessages (canvas Canvas) -> bool


return false;

DrawCrossHair (canvas Canvas, int StartX, int StartY)

InputNumber (byte F)

LocalizedMessage (class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject, optional string CriticalString)

Message (PlayerReplicationInfo PRI, coerce string Msg, name N)

PlayReceivedMessage (string S, string PName, ZoneInfo PZone)


PlayerPawn(Owner).ClientMessage(S);
if (PlayerPawn(Owner).bMessageBeep)
PlayerPawn(Owner).PlayBeepSound();

PostRender (canvas Canvas)

PreRender (canvas Canvas)




HomeBase.uc (extends NavigationPoint)

var() float extent; //how far the base extends from central point (in line of sight)
Extent=700.000000
Texture=Texture'Engine.S_Flag'
SoundVolume=128

PreBeginPlay


lookdir = 200 * vector(Rotation);
Super.PreBeginPlay();




Info.uc (extends Actor)

bHidden=True



InternetInfo.uc (extends Info)

GetBeaconAddress (int i) -> string

GetBeaconText (int i) -> string




InterpolationPoint.uc (extends Keypoint)

var() int Position;
var() float RateModifier;
var() float GameSpeedModifier;
var() float FovModifier;
var() bool bEndOfPath;
var() bool bSkipNextPath;
var() float ScreenFlashScale;
var() vector ScreenFlashFog;
var InterpolationPoint Prev, Next;
RateModifier=1.000000
GameSpeedModifier=1.000000
FovModifier=1.000000
ScreenFlashScale=1.000000
bStatic=False
bDirectional=True
Texture=Texture'Engine.S_Interp'

BeginPlay


Super.BeginPlay();

// Try to find previous.
foreach AllActors( class 'InterpolationPoint', Prev, Tag )
if( Prev.Position == Position-1 )
break;
if( Prev != None )
Prev.Next = Self;

// Try to find next.
foreach AllActors( class 'InterpolationPoint', Next, Tag )
if( Next.Position == Position+1 )
break;
if( Next == None )
foreach AllActors( class 'InterpolationPoint', Next, Tag )
if( Next.Position == 0 )
break;
if( Next != None )
Next.Prev = Self;

InterpolateEnd (actor Other)


if( bEndOfPath )
{
if( Pawn(Other)!=None && Pawn(Other).bIsPlayer )
{
Other.bCollideWorld = True;
Other.bInterpolating = false;
if ( Pawn(Other).Health > 0 )
{
Other.SetCollision(true,true,true);
Other.SetPhysics(PHYS_Falling);
Other.AmbientSound = None;
// DEUS_EX CNN - removed by CNN - don't change the player state
// the player will handle that itself
// if ( Other.IsA('PlayerPawn') )
// Other.GotoState('PlayerWalking');
}
}
else if (Other != None)
{
// DEUS_EX - added by CNN - lets non players interpolate also
Other.bInterpolating = False;
Other.SetPhysics(PHYS_Falling);
}
}

PostBeginPlay


Super.PostBeginPlay();
//log( "Interpolation point" @ Tag @ Position $ ":" );
//if( Prev != None )
// log( " Prev # " $ Prev.Position );
//if( Next != None )
// log( " Next # " $ Next.Position );




Inventory.uc (extends Actor)

var() travel byte AutoSwitchPriority; // Autoswitch value, 0=never autoswitch.
var() byte InventoryGroup; // The weapon/inventory set, 1-9 (0=none).
var() bool bActivatable; // Whether item can be activated.
var() bool bDisplayableInv; // Item displayed in HUD.
var(Display) bool bAmbientGlow; // Whether to glow or not.
var() bool bInstantRespawn; // Can be tagged so this item respawns instantly.
var() bool bRotatingPickup; // Rotates when in pickup state.
var() localized string PickupMessage; // Human readable description when picked up.
var() localized string ItemName; // Human readable name of item
var() localized string ItemArticle; // Human readable article (e.g. "a", "an")
var() float RespawnTime; // Respawn after this time, 0 for instant.
var name PlayerLastTouched; // Player who last touched this item.
var() vector PlayerViewOffset; // Offset from view center.
var() mesh PlayerViewMesh; // Mesh to render.
var() float PlayerViewScale; // Mesh scale.
var() float BobDamping; // how much to damp view bob
var() mesh PickupViewMesh; // Mesh to render.
var() float PickupViewScale; // Mesh scale.
var() mesh ThirdPersonMesh; // Mesh to render.
var() float ThirdPersonScale; // Mesh scale.
var() texture StatusIcon; // Icon used with ammo/charge/power count.
var() name ProtectionType1; // Protects against DamageType (None if non-armor).
var() name ProtectionType2; // Secondary protection type (None if non-armor).
var() travel int Charge; // Amount of armor or charge if not an armor (charge in time*10).
var() int ArmorAbsorption; // Percent of damage item absorbs 0-100.
var() bool bIsAnArmor; // Item will protect player.
var() int AbsorptionPriority; // Which items absorb damage first (higher=first).
var() inventory NextArmor; // Temporary list created by Armors to prioritize damage absorption.
var() float MaxDesireability; // Maximum desireability this item will ever have.
var bool bSteadyFlash3rd;
var bool bFirstFrame;
var(MuzzleFlash) bool bMuzzleFlashParticles;
var(MuzzleFlash) bool bToggleSteadyFlash;
var bool bSteadyToggle;
var byte FlashCount, OldFlashCount;
var(MuzzleFlash) ERenderStyle MuzzleFlashStyle;
var(MuzzleFlash) mesh MuzzleFlashMesh;
var(MuzzleFlash) float MuzzleFlashScale;
var(MuzzleFlash) texture MuzzleFlashTexture;
var() sound PickupSound, ActivateSound, DeActivateSound, RespawnSound;
var sound LandSound;
var() texture Icon;
var() localized String M_Activated;
var() localized String M_Selected;
var() localized String M_Deactivated;
var() class PickupMessageClass;
var() class ItemMessageClass;
var bool bCanUseObjectBelt; // Can this object be placed on the object belt?
var texture largeIcon; // Larger-than-usual icon for the inventory window
var int largeIconWidth; // Width of graphic in texture
var int largeIconHeight; // Height of graphic in texture
var int invSlotsX; // Number of horizontal inv. slots this item takes
var int invSlotsY; // Number of vertical inv. slots this item takes
var travel int invPosX; // X position on the inventory window
var travel int invPosY; // Y position on the inventory window
var travel bool bInObjectBelt; // Is this object actually in the object belt?
var travel int beltPos; // Position on the object belt
var() localized String description; // Description
var localized String beltDescription; // Description used on the object belt
bDisplayableInv=True
bRotatingPickup=True
PickupMessage="Snagged an item"
ItemArticle="a"
PlayerViewScale=1.000000
BobDamping=0.960000
PickupViewScale=1.000000
ThirdPersonScale=1.000000
MaxDesireability=0.005000
bFirstFrame=True
bToggleSteadyFlash=True
M_Activated=" activated"
M_Selected=" selected"
M_Deactivated=" deactivated"
bCanUseObjectBelt=True
invSlotsX=1
invSlotsY=1
invPosX=-1
invPosY=-1
beltPos=-1
Description="Made by the ABC Widget ACME Corporation"
bIsItemGoal=True
bTravel=True
Physics=PHYS_Falling
RemoteRole=ROLE_SimulatedProxy
DrawType=DT_Mesh
Texture=Texture'Engine.S_Inventory'
CollisionRadius=30.000000
CollisionHeight=30.000000
bCollideActors=True
bBlockActors=True
bFixedRotationDir=True
NetPriority=1.400000

Activate


if ( (Pawn(Owner) != None) && (M_Deactivated != "") )
Pawn(Owner).ClientMessage(ItemName$M_Deactivated);
GoToState('DeActivated');

ActivateTranslator (bool bHint)


if( Inventory!=None )
Inventory.ActivateTranslator( bHint );

AltFire (float Value)

ArmorAbsorbDamage (int Damage, name DamageType, vector HitLocation) -> int


local int ArmorDamage;


if ( DamageType != 'Drowned' )
ArmorImpactEffect(HitLocation);
if( (DamageType!='None') && ((ProtectionType1==DamageType) || (ProtectionType2==DamageType)) )
return 0;

if (DamageType=='Drowned') Return Damage;

ArmorDamage = (Damage * ArmorAbsorption) / 100;
if( ArmorDamage >= Charge )
{
ArmorDamage = Charge;
Destroy();
}
else
Charge -= ArmorDamage;
return (Damage - ArmorDamage);

ArmorPriority (name DamageType) -> int


if ( DamageType == 'Drowned' )
return 0;
if( (DamageType!='None')
&& ((ProtectionType1==DamageType) || (ProtectionType2==DamageType)) )
return 1000000;

return AbsorptionPriority;

BecomeItem


RemoteRole = ROLE_SimulatedProxy;
Mesh = PlayerViewMesh;
DrawScale = PlayerViewScale;
bOnlyOwnerSee = true;
bHidden = true;
bCarriedItem = true;
NetPriority = 1.4;
SetCollision( false, false, false );
SetPhysics(PHYS_None);
// SetTimer(0.0,False); // DEUS_EX CNN - removed
AmbientGlow = 0;

BecomePickup


if ( Physics != PHYS_Falling )
RemoteRole = ROLE_SimulatedProxy;
Mesh = PickupViewMesh;
DrawScale = PickupViewScale;
bOnlyOwnerSee = false;
bHidden = false;
bCarriedItem = false;
NetPriority = 1.4;
SetCollision( true, true, false ); // make things block actors as well - DEUS_EX CNN

BeginState


BecomePickup();
bHidden = true;

BotDesireability (pawn Bot) -> float


local Inventory AlreadyHas;
local float desire;
local bool bChecked;


desire = MaxDesireability;

if ( RespawnTime < 10 )
{
bChecked = true;
AlreadyHas = Bot.FindInventoryType(class);
if ( (AlreadyHas != None)
&& (AlreadyHas.Charge >= Charge) )
return -1;
}

if( bIsAnArmor )
{
if ( !bChecked )
AlreadyHas = Bot.FindInventoryType(class);
if ( AlreadyHas != None )
desire *= (1 - AlreadyHas.Charge * AlreadyHas.ArmorAbsorption * 0.00003);

desire *= (Charge * 0.005);
desire *= (ArmorAbsorption * 0.01);
return desire;
}
else return desire;

CalcDrawOffset -> vector


local vector DrawOffset, WeaponBob;
local Pawn PawnOwner;


PawnOwner = Pawn(Owner);
DrawOffset = ((0.9/PawnOwner.FOVAngle * PlayerViewOffset) >> PawnOwner.ViewRotation);

if ( (Level.NetMode == NM_DedicatedServer)
|| ((Level.NetMode == NM_ListenServer) && (Owner.RemoteRole == ROLE_AutonomousProxy)) )
DrawOffset += (PawnOwner.BaseEyeHeight * vect(0,0,1));
else
{
DrawOffset += (PawnOwner.EyeHeight * vect(0,0,1));
WeaponBob = BobDamping * PawnOwner.WalkBob;
WeaponBob.Z = (0.45 + 0.55 * BobDamping) * PawnOwner.WalkBob.Z;
DrawOffset += WeaponBob;
}
return DrawOffset;

ChangedWeapon


if( Inventory != None )
Inventory.ChangedWeapon();

CheckTouching


local int i;


bSleepTouch = false;
for ( i=0; i<4; i++ )
if ( (Touching[i] != None) && Touching[i].IsA('Pawn') )
Touch(Touching[i]);

Destroyed


if (MyMarker != None )
MyMarker.markedItem = None;
// Remove from owner's inventory.
if( Pawn(Owner)!=None )
Pawn(Owner).DeleteInventory( Self );

DrawStatusIconAt (canvas Canvas, int X, int Y, optional float Scale)


if( Scale == 0.0 )
Scale = 1.0;
Canvas.SetPos( X, Y );
Canvas.DrawIcon( StatusIcon, Scale );

DropFrom (vector StartLocation)


if ( !SetLocation(StartLocation) )
return;
RespawnTime = 0.0; //don't respawn
SetPhysics(PHYS_Falling);
RemoteRole = ROLE_DumbProxy;
BecomePickup();
NetPriority = 2.5;
bCollideWorld = true;
if ( Pawn(Owner) != None )
Pawn(Owner).DeleteInventory(self);
Inventory = None;
GotoState('PickUp', 'Dropped');

DropInventory

EndState


local int i;


bSleepTouch = false;
for ( i=0; i<4; i++ )
if ( (Touching[i] != None) && Touching[i].IsA('Pawn') )
bSleepTouch = true;

Fire (float Value)

Frob (Actor Other, Inventory frobWith)

/ function Touch( actor Other

GetHumanName -> String


return ItemArticle@ItemName;

GiveTo (pawn Other)


Instigator = Other;
BecomeItem();
Other.AddInventory( Self );
GotoState('Idle2');

HandlePickupQuery (inventory Item) -> bool


if ( Item.Class == Class )
return true;
if ( Inventory == None )
return false;

return Inventory.HandlePickupQuery(Item);

InventoryCapsFloat (name Property, pawn Other, actor Test) -> float

InventoryCapsString (name Property, pawn Other, actor Test) -> string

Landed (Vector HitNormal)


local rotator newRot;

newRot = Rotation;
newRot.pitch = 0;
SetRotation(newRot);
PlayLandingSound(); // DEUS_EX STM - added
// SetTimer(2.0, false); // DEUS_EX CNN - removed

OwnerJumped


if( Inventory != None )
Inventory.OwnerJumped();

PlayLandingSound


if (LandSound != None)
PlaySound(LandSound);

PostBeginPlay


PickupMessageClass = None;
if ( ItemName == "" )
ItemName = GetItemName(string(Class));

// DEUS_EX CNN - scale since network passes vector components as ints
PlayerViewOffset = Default.PlayerViewOffset * 100;

Super.PostBeginPlay();

PrioritizeArmor (int Damage, name DamageType, vector HitLocation) -> inventory


local Inventory FirstArmor, InsertAfter;


if ( Inventory != None )
FirstArmor = Inventory.PrioritizeArmor(Damage, DamageType, HitLocation);
else
FirstArmor = None;

if ( bIsAnArmor)
{
if ( FirstArmor == None )
{
nextArmor = None;
return self;
}

// insert this armor into the prioritized armor list
if ( FirstArmor.ArmorPriority(DamageType) < ArmorPriority(DamageType) )
{
nextArmor = FirstArmor;
return self;
}
InsertAfter = FirstArmor;
while ( (InsertAfter.nextArmor != None)
&& (InsertAfter.nextArmor.ArmorPriority(DamageType) > ArmorPriority(DamageType)) )
InsertAfter = InsertAfter.nextArmor;

nextArmor = InsertAfter.nextArmor;
InsertAfter.nextArmor = self;
}
return FirstArmor;

RecommendWeapon (out float rating, out int bUseAltMode) -> Weapon


if ( inventory != None )
return inventory.RecommendWeapon(rating, bUseAltMode);
else
{
rating = -1;
return None;
}

ReduceDamage (int Damage, name DamageType, vector HitLocation) -> int


local Inventory FirstArmor;
local int ReducedAmount,ArmorDamage;


if( Damage<0 )
return 0;

ReducedAmount = Damage;
FirstArmor = PrioritizeArmor(Damage, DamageType, HitLocation);
while( (FirstArmor != None) && (ReducedAmount > 0) )
{
ReducedAmount = FirstArmor.ArmorAbsorbDamage(ReducedAmount, DamageType, HitLocation);
FirstArmor = FirstArmor.nextArmor;
}
return ReducedAmount;

RenderOverlays (canvas Canvas)


if ( Owner == None )
return;
if ( (Level.NetMode == NM_Client) && (!Owner.IsA('PlayerPawn') || (PlayerPawn(Owner).Player == None)) )
return;
SetLocation( Owner.Location + CalcDrawOffset() );
SetRotation( Pawn(Owner).ViewRotation );
Canvas.DrawActor(self, false);

SelectNext -> Inventory


if ( bActivatable )
{
if ( M_Selected != "" )
Pawn(Owner).ClientMessage(ItemName$M_Selected);
return self;
}
if ( Inventory != None )
return Inventory.SelectNext();
else
return None;

SetOwnerDisplay


if( Inventory != None )
Inventory.SetOwnerDisplay();

SetRespawn


if( Level.Game.ShouldRespawn(self) )
GotoState('Sleeping');
else
Destroy();

SpawnCopy (pawn Other) -> inventory


local inventory Copy;

if( Level.Game.ShouldRespawn(self) )
{
Copy = spawn(Class,Other,,,rot(0,0,0));
Copy.Tag = Tag;
Copy.Event = Event;
GotoState('Sleeping');
}
else
Copy = self;

Copy.RespawnTime = 0.0;
Copy.bHeldItem = true;
Copy.GiveTo( Other );
return Copy;

TestMPBeltSpot (int BeltSpot) -> bool


return ((BeltSpot <= 3) && (BeltSpot > 0));

Timer


if ( RemoteRole != ROLE_SimulatedProxy )
{
NetPriority = 1.4;
RemoteRole = ROLE_SimulatedProxy;

// DEUS_EX STM - ick
// if ( bHeldItem )
// SetTimer(40.0, false);

if ( bHeldItem )
{
if ( bTossedOut )
SetTimer(15.0, false);
else
SetTimer(40.0, false);
}
return;
}

// DEUS_EX CNN
// if ( bHeldItem )
// Destroy();

if ( bHeldItem )
{
if ( (FRand() < 0.1) || !PlayerCanSeeMe() )
Destroy();
else
SetTimer(3.0, true);
}

TravelPreAccept


Super.TravelPreAccept();
GiveTo( Pawn(Owner) );
if( bActive )
Activate();

UpdateInfo (Object winObject) -> bool


return False;

Use (pawn User)

ValidTouch (actor Other) -> bool


local Actor A;


if( Other.bIsPawn && Pawn(Other).bIsPlayer && (Pawn(Other).Health > 0) && Level.Game.PickupQuery(Pawn(Other), self) )
{
if( Event != '' )
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Other, Other.Instigator );
return true;
}
return false;

WeaponChange (byte F) -> Weapon


if( Inventory == None)
return None;
else
return Inventory.WeaponChange( F );

ZoneChange (ZoneInfo NewZone)


local float splashsize;
local actor splash;


if( NewZone.bWaterZone && !Region.Zone.bWaterZone )
{
splashSize = 0.000025 * Mass * (250 - 0.5 * Velocity.Z);
if ( NewZone.EntrySound != None )
PlaySound(NewZone.EntrySound, SLOT_Interact, splashSize);
if ( NewZone.EntryActor != None )
{
splash = Spawn(NewZone.EntryActor);
if ( splash != None )
splash.DrawScale = 2 * splashSize;
}
}




InventorySpot.uc (extends NavigationPoint)

var Inventory markedItem;
bEndPointOnly=True
bCollideWhenPlacing=False
bHiddenEd=True
CollisionRadius=20.000000
CollisionHeight=40.000000



Keypoint.uc (extends Actor)

bStatic=True
bHidden=True
Texture=Texture'Engine.S_Keypoint'
SoundVolume=0
CollisionRadius=10.000000
CollisionHeight=10.000000



LevelInfo.uc (extends ZoneInfo)

var() float TimeDilation; // Normally 1 - scales real time passage.
var float TimeSeconds; // Time in seconds since level began play.
var transient int Year; // Year.
var transient int Month; // Month.
var transient int Day; // Day of month.
var transient int DayOfWeek; // Day of week.
var transient int Hour; // Hour.
var transient int Minute; // Minute.
var transient int Second; // Second.
var transient int Millisecond; // Millisecond.
var() localized string Title;
var() string Author; // Who built it.
var() localized string IdealPlayerCount;// Ideal number of players for this level. I.E.: 6-8
var() int RecommendedEnemies; // number of enemy bots recommended (used by rated games)
var() int RecommendedTeammates; // number of friendly bots recommended (used by rated games)
var() localized string LevelEnterText; // Message to tell players when they enter.
var() string LocalizedPkg; // Package to look in for localizations.
var string Pauser; // If paused, name of person pausing the game.
var levelsummary Summary;
var() bool bLonePlayer; // No multiplayer coordination, i.e. for entranceways.
var bool bBegunPlay; // Whether gameplay has begun.
var bool bPlayersOnly; // Only update players.
var bool bHighDetailMode; // Client high-detail mode.
var bool bDropDetail; // frame rate is below DesiredFrameRate, so drop high detail actors
var bool bAggressiveLOD; // frame rate is well below DesiredFrameRate, so make LOD more aggressive
var bool bStartup; // Starting gameplay.
var() bool bHumansOnly; // Only allow "human" player pawns in this level
var bool bNoCheating;
var bool bAllowFOV;
var(Audio) const music Song; // Default song for level.
var(Audio) const byte SongSection; // Default song order for level.
var(Audio) const byte CdTrack; // Default CD track for level.
var(Audio) float PlayerDoppler; // Player doppler shift, 0=none, 1=full.
var() float Brightness;
var() texture Screenshot;
var texture DefaultTexture;
var int HubStackLevel;
var transient enum ELevelAction
var() bool bNeverPrecache;
var enum ENetMode
var string ComputerName; // Machine's name according to the OS.
var string EngineVersion; // Engine version.
var string MinNetVersion; // Min engine version that is net compatible.
var() class DefaultGameType;
var GameInfo Game;
var const NavigationPoint NavigationPointList;
var const Pawn PawnList;
var const EventManager EventManager;
var string NextURL;
var bool bNextItems;
var float NextSwitchCountdown;
var int AIProfile[8]; // TEMP statistics
var float AvgAITime; //moving average of Actor time
var() bool bCheckWalkSurfaces; // enable texture-specific physics code for Pawns.
var SpawnNotify SpawnNotify;
TimeDilation=1.000000
Title="Untitled"
bHighDetailMode=True
CdTrack=255
Brightness=1.000000
DefaultTexture=Texture'Engine.DefaultTexture'
bHiddenEd=True

GetAddressURL -> string | native

GetLocalURL -> string | native

InitEventManager | native

PreBeginPlay


Super.PreBeginPlay();
InitEventManager();

ServerTravel (string URL, bool bItems)


if (NetMode == NM_Standalone)
return;
if( NextURL=="" )
{
bNextItems = bItems;
NextURL = URL;
if( Game!=None )
Game.ProcessServerTravel( URL, bItems );
else
NextSwitchCountdown = 0;
}




LevelSummary.uc (extends Object)

var() localized string Title;
var() string Author;
var() localized string IdealPlayerCount;
var() int RecommendedEnemies;
var() int RecommendedTeammates;
var() localized string LevelEnterText;



LiftCenter.uc (extends NavigationPoint)

var() name LiftTag;
var() name LiftTrigger;
var trigger RecommendedTrigger;
var float LastTriggerTime;
var() float MaxZDiffAdd; //added threshold for Z difference between pawn and lift (for lifts which are at the end of a ramp or stairs)
var() float MaxDist2D;
var vector LiftOffset;
MaxDist2D=400.000000
ExtraCost=400
bStatic=False
bNoDelete=True
RemoteRole=ROLE_None

PostBeginPlay


if ( LiftTag != '' )
ForEach AllActors(class'Mover', MyLift, LiftTag )
{
MyLift.myMarker = self;
SetBase(MyLift);
LiftOffset = Location - MyLift.Location;
if ( MyLift.InitialState == 'BumpOpenTimed' )
log("Warning: "$MyLift$" is BumpOpenTimed. Bots don't understand this well - use StandOpenTimed instead!");
break;
}
// log(self$" attached to "$MyLift);
if ( LiftTrigger != '' )
ForEach AllActors(class'Trigger', RecommendedTrigger, LiftTrigger )
break;
Super.PostBeginPlay();

SpecialHandling (Pawn Other) -> Actor


local float dist2d;
local NavigationPoint N, Exit;


if ( MyLift == None )
return self;
if ( Other.base == MyLift )
{
if ( (RecommendedTrigger != None)
&& (myLift.SavedTrigger == None)
&& (Level.TimeSeconds - LastTriggerTime > 5) )
{
Other.SpecialGoal = RecommendedTrigger;
LastTriggerTime = Level.TimeSeconds;
return RecommendedTrigger;
}

return self;
}

if ( (LiftExit(Other.MoveTarget) != None)
&& (LiftExit(Other.MoveTarget).RecommendedTrigger != None)
&& (LiftExit(Other.MoveTarget).LiftTag == LiftTag)
&& (Level.TimeSeconds - LiftExit(Other.MoveTarget).LastTriggerTime > 5)
&& (MyLift.SavedTrigger == None)
&& (Abs(Other.Location.X - Other.MoveTarget.Location.X) < Other.CollisionRadius)
&& (Abs(Other.Location.Y - Other.MoveTarget.Location.Y) < Other.CollisionRadius)
&& (Abs(Other.Location.Z - Other.MoveTarget.Location.Z) < Other.CollisionHeight) )
{
LiftExit(Other.MoveTarget).LastTriggerTime = Level.TimeSeconds;
Other.SpecialGoal = LiftExit(Other.MoveTarget).RecommendedTrigger;
return LiftExit(Other.MoveTarget).RecommendedTrigger;
}

SetLocation(MyLift.Location + LiftOffset);
SetBase(MyLift);
dist2d = square(Location.X - Other.Location.X) + square(Location.Y - Other.Location.Y);
if ( (Location.Z - CollisionHeight - MaxZDiffAdd < Other.Location.Z - Other.CollisionHeight + Other.MaxStepHeight)
&& (Location.Z - CollisionHeight > Other.Location.Z - Other.CollisionHeight - 1200)
&& ( dist2D < MaxDist2D * MaxDist2D) )
{
return self;
}

if ( MyLift.BumpType == BT_PlayerBump && !Other.bIsPlayer )
return None;
Other.SpecialGoal = None;

// make sure Other is at valid lift exit
if ( LiftExit(Other.MoveTarget) == None )
{
for ( N=Level.NavigationPointList; N!=None; N=N.NextNavigationPoint )
if ( N.IsA('LiftExit') && (LiftExit(N).LiftTag == LiftTag)
&& (Abs(Other.Location.X - N.Location.X) < Other.CollisionRadius)
&& (Abs(Other.Location.Y - N.Location.Y) < Other.CollisionRadius)
&& (Abs(Other.Location.Z - N.Location.Z) < Other.CollisionHeight) )
{
Exit = N;
break;
}
if ( Exit == None )
return self;
}

MyLift.HandleDoor(Other);
MyLift.RecommendedTrigger = None;

if ( (Other.SpecialGoal == MyLift) || (Other.SpecialGoal == None) )
Other.SpecialGoal = self;

return Other.SpecialGoal;




LiftExit.uc (extends NavigationPoint)

var() name LiftTag;
var() name LiftTrigger;
var trigger RecommendedTrigger;
var float LastTriggerTime;

PostBeginPlay


if ( LiftTag != '' )
ForEach AllActors(class'Mover', MyLift, LiftTag )
break;
//log(self$" attached to "$MyLift);
if ( LiftTrigger != '' )
ForEach AllActors(class'Trigger', RecommendedTrigger, LiftTrigger )
break;
Super.PostBeginPlay();

SpecialHandling (Pawn Other) -> Actor



if ( (Other.Base == MyLift) && (MyLift != None) )
{
if ( (self.Location.Z < Other.Location.Z + Other.CollisionHeight)
&& Other.LineOfSightTo(self) )
return self;
Other.SpecialGoal = None;
Other.DesiredRotation = rotator(Location - Other.Location);
MyLift.HandleDoor(Other);

if ( (Other.SpecialGoal == MyLift) || (Other.SpecialGoal == None) )
Other.SpecialGoal = MyLift.myMarker;
return Other.SpecialGoal;
}
return self;




Light.uc (extends Actor)

bStatic=True
bHidden=True
bNoDelete=True
bMovable=False
Texture=Texture'Engine.S_Light'
CollisionRadius=24.000000
CollisionHeight=24.000000
LightType=LT_Steady
LightBrightness=64
LightSaturation=255
LightRadius=64
LightPeriod=32
LightCone=128
VolumeBrightness=64



LocalMessage.uc (extends Info)

var bool bComplexString; // Indicates a multicolor string message class.
var bool bIsSpecial; // If true, don't add to normal queue.
var bool bIsUnique; // If true and special, only one can be in the HUD queue at a time.
var bool bIsConsoleMessage; // If true, put a GetString on the console.
var bool bFadeMessage; // If true, use fade out effect on message.
var bool bBeep; // If true, beep!
var bool bOffsetYPos; // If the YPos indicated isn't where the message appears.
var int Lifetime; // # of seconds to stay in HUD message queue.
var class ChildMessage; // In some cases, we need to refer to a child message.
var bool bFromBottom; // Subtract YPos.
var color DrawColor; // Color to display message with.
var float XPos, YPos; // Coordinates to print message at.
var bool bCenter; // Whether or not to center the message.
Lifetime=3
DrawColor=(R=255,G=255,B=255)

GetFontSize (int Switch) -> int

GetOffset (int Switch, float YL, float ClipY) -> float


return Default.YPos;




MapList.uc (extends Info)

var(Maps) globalconfig string Maps[32];
var globalconfig int MapNum;

GetNextMap -> string


local string CurrentMap;
local int i;


CurrentMap = GetURLMap();
if ( CurrentMap != "" )
{
if ( Right(CurrentMap,4) ~= ".unr" )
CurrentMap = CurrentMap;
else
CurrentMap = CurrentMap$".unr";

for ( i=0; i {
if ( CurrentMap ~= Maps[i] )
{
MapNum = i;
break;
}
}
}

// search vs. w/ or w/out .unr extension

MapNum++;
if ( MapNum > ArrayCount(Maps) - 1 )
MapNum = 0;
if ( Maps[MapNum] == "" )
MapNum = 0;

SaveConfig();
return Maps[MapNum];




var Menu ParentMenu;
var int Selection;
var() int MenuLength;
var bool bConfigChanged;
var bool bExitAllMenus;
var PlayerPawn PlayerOwner;
var() localized string HelpMessage[24];
var() localized string MenuList[24];
var() localized string LeftString;
var() localized string RightString;
var() localized string CenterString;
var() localized string EnabledString;
var() localized string DisabledString;
var() localized string MenuTitle;
var() localized string YesString;
var() localized string NoString;
Selection=1
HelpMessage(1)="This menu has not yet been implemented."
LeftString="Left"
RightString="Right"
CenterString="Center"
EnabledString="Enabled"
DisabledString="Disabled"
YesString="yes"
NoString="no"
bHidden=True

while ( Hud(Owner).MainMenu != None )
Hud(Owner).MainMenu.ExitMenu();


Hud(Owner).MainMenu = ParentMenu;
if ( bConfigChanged )
SaveConfigs();
if ( ParentMenu == None )
{
PlayerOwner.bShowMenu = false;
PlayerOwner.Player.Console.GotoState('');
if( Level.Netmode == NM_Standalone )
PlayerOwner.SetPause(False);
}

Destroy();


if ( KeyNum == EInputKey.IK_Escape )
{
PlayEnterSound();
ExitMenu();
return;
}
else if ( KeyNum == EInputKey.IK_Up )
{
PlaySelectSound();
Selection--;
if ( Selection < 1 )
Selection = MenuLength;
}
else if ( KeyNum == EInputKey.IK_Down )
{
PlaySelectSound();
Selection++;
if ( Selection > MenuLength )
Selection = 1;
}
else if ( KeyNum == EInputKey.IK_Enter )
{
bConfigChanged=true;
if ( ProcessSelection() )
PlayEnterSound();
}
else if ( KeyNum == EInputKey.IK_Left )
{
bConfigChanged=true;
if ( ProcessLeft() )
PlayModifySound();
}
else if ( KeyNum == EInputKey.IK_Right )
{
bConfigChanged=true;
if ( ProcessRight() )
PlayModifySound();
}
else if ( Chr(KeyNum) ~= left(YesString, 1) )
{
bConfigChanged=true;
if ( ProcessYes() )
PlayModifySound();
}
else if ( Chr(KeyNum) ~= left(NoString, 1) )
{
bConfigChanged=true;
if ( ProcessNo() )
PlayModifySound();
}

if ( bExitAllMenus )
ExitAllMenus();



if ( bBright )
{
Canvas.DrawColor.R = 255;
Canvas.DrawColor.G = 255;
Canvas.DrawColor.B = 255;
}
else
Canvas.DrawColor = Canvas.Default.DrawColor;




MessagingSpectator.uc (extends Spectator)

PostBeginPlay


Super.PostBeginPlay();
bIsPlayer = False;




Mover.uc (extends Brush)

var() enum EMoverEncroachType
var() enum EMoverGlideType
var() enum EBumpType
var() byte KeyNum; // Current or destination keyframe.
var byte PrevKeyNum; // Previous keyframe.
var() const byte NumKeys; // Number of keyframes in total (0-3).
var() const byte WorldRaytraceKey; // Raytrace the world with the brush here.
var() const byte BrushRaytraceKey; // Raytrace the brush here.
var() float MoveTime; // Time to spend moving between keyframes.
var() float StayOpenTime; // How long to remain open before closing.
var() float OtherTime; // TriggerPound stay-open time.
var() int EncroachDamage; // How much to damage encroached actors.
var() bool bTriggerOnceOnly; // Go dormant after first trigger.
var() bool bSlave; // This brush is a slave.
var() bool bUseTriggered; // Triggered by player grab
var() bool bDamageTriggered; // Triggered by taking damage
var() bool bDynamicLightMover; // Apply dynamic lighting to mover.
var() name PlayerBumpEvent; // Optional event to cause when the player bumps the mover.
var() name BumpEvent; // Optional event to cause when any valid bumper bumps the mover.
var actor SavedTrigger; // Who we were triggered by.
var() float DamageThreshold; // minimum damage to trigger
var() name ReturnGroup; // if none, same as tag
var() float DelayTime; // delay before starting to open
var(MoverSounds) sound OpeningSound; // When start opening.
var(MoverSounds) sound OpenedSound; // When finished opening.
var(MoverSounds) sound ClosingSound; // When start closing.
var(MoverSounds) sound ClosedSound; // When finish closing.
var(MoverSounds) sound MoveAmbientSound; // Optional ambient sound when moving.
var vector KeyPos[8];
var rotator KeyRot[8];
var vector BasePos, OldPos, OldPrePivot, SavedPos;
var rotator BaseRot, OldRot, SavedRot;
var NavigationPoint myMarker;
var rotator RealRotation;
MoverEncroachType=ME_ReturnWhenEncroach
MoverGlideType=MV_GlideByTime
NumKeys=2
MoveTime=1.000000
StayOpenTime=4.000000
bStatic=False
Physics=PHYS_MovingBrush
RemoteRole=ROLE_SimulatedProxy
InitialState=BumpOpenTimed
bIsMover=True
bAlwaysRelevant=True
SoundVolume=228
TransientSoundVolume=3.000000
CollisionRadius=160.000000
CollisionHeight=160.000000
bCollideActors=True
bBlockActors=True
bBlockPlayers=True
NetPriority=2.700000

Attach (actor Other)


local pawn P;


P = Pawn(Other);
if ( (BumpType != BT_AnyBump) && (P == None) )
return;
if ( (BumpType == BT_PlayerBump) && !P.bIsPlayer )
return;
if ( (BumpType == BT_PawnBump) && (Other.Mass < 10) )
return;
SavedTrigger = None;
GotoState( 'StandOpenTimed', 'Open' );

BeginEvent


bSlave=true;

BeginPlay


local rotator R;


// timer updates real position every second in network play
if ( Level.NetMode != NM_Standalone )
{
if ( Level.NetMode == NM_Client )
settimer(4.0, true);
else
settimer(1.0, true);
if ( Role < ROLE_Authority )
return;
}

if ( Level.NetMode != NM_Client )
{
RealPosition = Location;
RealRotation = Rotation;
}

// Init key info.
Super.BeginPlay();
KeyNum = Clamp( KeyNum, 0, ArrayCount(KeyPos)-1 );
PhysAlpha = 0.0;

// Set initial location.
Move( BasePos + KeyPos[KeyNum] - Location );

// Initial rotation.
SetRotation( BaseRot + KeyRot[KeyNum] );

// find movers in same group
if ( ReturnGroup == '' )
ReturnGroup = tag;

BeginState


numTriggerEvents = 0;

Bump (actor Other)


if ( (BumpType != BT_AnyBump) && (Pawn(Other) == None) )
return;
if ( (BumpType == BT_PlayerBump) && !Pawn(Other).bIsPlayer )
return;
if ( (BumpType == BT_PawnBump) && (Other.Mass < 10) )
return;
Global.Bump( Other );
SavedTrigger = Other;
Instigator = Pawn( Other );
GotoState( 'BumpButton', 'Open' );

DoClose


local actor A;


bOpening = false;
bDelaying = false;
InterpolateTo( Max(0,KeyNum-1), MoveTime );
// PlaySound( ClosingSound, SLOT_None );
// DEUS_EX CNN - make the sounds use SoundRadius and SoundVolume
PlaySound( ClosingSound, SLOT_None, TransientSoundVolume*SoundVolume/255.0,, 25.0*(SoundRadius+1) );
if( Event != '' )
foreach AllActors( class 'Actor', A, Event )
A.UnTrigger( Self, Instigator );
AmbientSound = MoveAmbientSound;

DoOpen


bOpening = true;
bDelaying = false;
InterpolateTo( 1, MoveTime );
// PlaySound( OpeningSound, SLOT_None );
// DEUS_EX CNN - make the sounds use SoundRadius and SoundVolume
PlaySound( OpeningSound, SLOT_None, TransientSoundVolume*SoundVolume/255.0,, 25.0*(SoundRadius+1) );
AmbientSound = MoveAmbientSound;

EncroachingOn (actor Other) -> bool


local Pawn P;

if ( Other.IsA('Carcass') || Other.IsA('Decoration') )
{
Other.TakeDamage(10000, None, Other.Location, vect(0,0,0), 'Crushed');
return false;
}
// DEUS_EX CNN - Don't destroy inventory items when encroached!
// if ( Other.IsA('Fragment') || (Other.IsA('Inventory') && (Other.Owner == None)) )
if (Other.IsA('Fragment'))
{
Other.Destroy();
return false;
}

// DEUS_EX CNN - make based actors not stop movers
if (Other.Base == Self)
{
return False;
}

// Damage the encroached actor.
if( EncroachDamage != 0 )
Other.TakeDamage( EncroachDamage, Instigator, Other.Location, vect(0,0,0), 'Crushed' );

// If we have a bump-player event, and Other is a pawn, do the bump thing.
P = Pawn(Other);
if( P!=None && P.bIsPlayer )
{
if ( PlayerBumpEvent!='' )
Bump( Other );
if ( (MyMarker != None) && (P.Base != self)
&& (P.Location.Z < MyMarker.Location.Z - P.CollisionHeight - 0.7 * MyMarker.CollisionHeight) )
// pawn is under lift - tell him to move
P.UnderLift(self);
}

// Stop, return, or whatever.
if( MoverEncroachType == ME_StopWhenEncroach )
{
Leader.MakeGroupStop();
return true;
}
else if( MoverEncroachType == ME_ReturnWhenEncroach )
{
Leader.MakeGroupReturn();
if ( Other.IsA('Pawn') )
{
if ( Pawn(Other).bIsPlayer )
Pawn(Other).PlaySound(Pawn(Other).Land, SLOT_None); // DEUS_EX CNN - Changed from SLOT_Talk
else
Pawn(Other).PlaySound(Pawn(Other).HitSound1, SLOT_None); // DEUS_EX CNN - Changed from SLOT_Talk
}
return true;
}
else if( MoverEncroachType == ME_CrushWhenEncroach )
{
// Kill it.
Other.KilledBy( Instigator );
return false;
}
else if( MoverEncroachType == ME_IgnoreWhenEncroach )
{
// Ignore it.
return false;
}

EndEvent


bSlave = false;
Instigator = None;
GotoState( 'BumpButton', 'Close' );

FindTriggerActor


local Actor A;


TriggerActor = None;
TriggerActor2 = None;
ForEach AllActors(class 'Actor', A)
if ( (A.Event == Tag) && (A.IsA('Trigger') || A.IsA('Mover')) )
{
if ( A.IsA('Counter') || A.IsA('Pawn') )
{
bPlayerOnly = true;
return; //FIXME - handle counters
}
if (TriggerActor == None)
TriggerActor = A;
else if ( TriggerActor2 == None )
TriggerActor2 = A;
}

if ( TriggerActor == None )
{
bPlayerOnly = (BumpType == BT_PlayerBump);
return;
}

bPlayerOnly = ( TriggerActor.IsA('Trigger') && (Trigger(TriggerActor).TriggerType == TT_PlayerProximity) );
if ( bPlayerOnly && ( TriggerActor2 != None) )
{
bPlayerOnly = ( TriggerActor2.IsA('Trigger') && (Trigger(TriggerActor).TriggerType == TT_PlayerProximity) );
if ( !bPlayerOnly )
{
A = TriggerActor;
TriggerActor = TriggerActor2;
TriggerActor2 = A;
}
}

FinishNotify


local Pawn P;


if ( StandingCount > 0 )
for ( P=Level.PawnList; P!=None; P=P.nextPawn )
if ( P.Base == self )
{
P.StopWaiting();
if ( (P.SpecialGoal == self) || (P.SpecialGoal == myMarker) )
P.SpecialGoal = None;
if ( P == WaitingPawn )
WaitingPawn = None;
}

if ( WaitingPawn != None )
{
WaitingPawn.StopWaiting();
if ( (WaitingPawn.SpecialGoal == self) || (WaitingPawn.SpecialGoal == myMarker) )
WaitingPawn.SpecialGoal = None;
WaitingPawn = None;
}

FinishedClosing


// Update sound effects.
// PlaySound( ClosedSound, SLOT_None );
// DEUS_EX CNN - make the sounds use SoundRadius and SoundVolume
PlaySound( ClosedSound, SLOT_None, TransientSoundVolume*SoundVolume/255.0,, 25.0*(SoundRadius+1) );

// Notify our triggering actor that we have completed.
if( SavedTrigger != None )
SavedTrigger.EndEvent();
SavedTrigger = None;
Instigator = None;
FinishNotify();

FinishedOpening


local actor A;


// Update sound effects.
// PlaySound( OpenedSound, SLOT_None );
// DEUS_EX CNN - make the sounds use SoundRadius and SoundVolume
PlaySound( OpenedSound, SLOT_None, TransientSoundVolume*SoundVolume/255.0,, 25.0*(SoundRadius+1) );

// Trigger any chained movers.
if( Event != '' )
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Self, Instigator );

FinishNotify();

HandleDoor (pawn Other) -> bool


if ( bPlayerOnly && !Other.bIsPlayer )
return false;
Other.SpecialPause = 2.5;
WaitingPawn = Other;
if ( Other.Base == self )
Attach(Other);
return true;

HandleTriggerDoor (pawn Other) -> bool


local bool bOne, bTwo;
local float DP1, DP2, Dist1, Dist2;


if ( bOpening || bDelaying )
{
WaitingPawn = Other;
Other.SpecialPause = 2.5;
return true;
}
if ( bPlayerOnly && !Other.bIsPlayer )
return false;
if ( bUseTriggered )
{
WaitingPawn = Other;
Other.SpecialPause = 2.5;
Trigger(Other, Other);
return true;
}
if ( (BumpEvent == tag) || (Other.bIsPlayer && (PlayerBumpEvent == tag)) )
{
WaitingPawn = Other;
Other.SpecialPause = 2.5;
if ( Other.Base == Self )
Trigger(Other, Other);
return true;
}
if ( bDamageTriggered )
{
WaitingPawn = Other;
Other.SpecialGoal = self;
if ( !Other.bCanDoSpecial || (Other.Weapon == None) )
return false;

Other.Target = self;
Other.bShootSpecial = true;
Other.FireWeapon();
Trigger(Self, Other);
Other.bFire = 0;
Other.bAltFire = 0;
return true;
}

if ( RecommendedTrigger != None )
{
Other.SpecialGoal = RecommendedTrigger;
Other.MoveTarget = RecommendedTrigger;
return True;
}

bOne = ( (TriggerActor != None)
&& (!TriggerActor.IsA('Trigger') || Trigger(TriggerActor).IsRelevant(Other)) );
bTwo = ( (TriggerActor2 != None)
&& (!TriggerActor2.IsA('Trigger') || Trigger(TriggerActor2).IsRelevant(Other)) );

if ( bOne && bTwo )
{
// Dotp, dist
Dist1 = VSize(TriggerActor.Location - Other.Location);
Dist2 = VSize(TriggerActor2.Location - Other.Location);
if ( Dist1 < Dist2 )
{
if ( (Dist1 < 500) && Other.ActorReachable(TriggerActor) )
bTwo = false;
}
else if ( (Dist2 < 500) && Other.ActorReachable(TriggerActor2) )
bOne = false;

if ( bOne && bTwo )
{
DP1 = Normal(Location - Other.Location) Dot (TriggerActor.Location - Other.Location)/Dist1;
DP2 = Normal(Location - Other.Location) Dot (TriggerActor2.Location - Other.Location)/Dist2;
if ( (DP1 > 0) && (DP2 < 0) )
bOne = false;
else if ( (DP1 < 0) && (DP2 > 0) )
bTwo = false;
else if ( Dist1 < Dist2 )
bTwo = false;
else
bOne = false;
}
}

if ( bOne )
{
Other.SpecialGoal = TriggerActor;
Other.MoveTarget = TriggerActor;
return True;
}
else if ( bTwo )
{
Other.SpecialGoal = TriggerActor2;
Other.MoveTarget = TriggerActor2;
return True;
}
return false;

InterpolateEnd (actor Other)


local byte OldKeyNum;


OldKeyNum = PrevKeyNum;
PrevKeyNum = KeyNum;
PhysAlpha = 0;
ClientUpdate--;

// If more than two keyframes, chain them.
if( KeyNum>0 && KeyNum {
// Chain to previous.
InterpolateTo(KeyNum-1,MoveTime);
}
else if( KeyNumOldKeyNum )
{
// Chain to next.
InterpolateTo(KeyNum+1,MoveTime);
}
else
{
// Finished interpolating.
AmbientSound = None;
if ( (ClientUpdate == 0) && (Level.NetMode != NM_Client) )
{
RealPosition = Location;
RealRotation = Rotation;
}
}

InterpolateTo (byte NewKeyNum, float Seconds)


NewKeyNum = Clamp( NewKeyNum, 0, ArrayCount(KeyPos)-1 );
if( NewKeyNum==PrevKeyNum && KeyNum!=PrevKeyNum )
{
// Reverse the movement smoothly.
PhysAlpha = 1.0 - PhysAlpha;
OldPos = BasePos + KeyPos[KeyNum];
OldRot = BaseRot + KeyRot[KeyNum];
}
else
{
// Start a new movement.
OldPos = Location;
OldRot = Rotation;
PhysAlpha = 0.0;
}

// Setup physics.
SetPhysics(PHYS_MovingBrush);
bInterpolating = true;
PrevKeyNum = KeyNum;
KeyNum = NewKeyNum;
PhysRate = 1.0 / FMax(Seconds, 0.005);

ClientUpdate++;
SimOldPos = OldPos;
SimOldRotYaw = OldRot.Yaw;
SimOldRotPitch = OldRot.Pitch;
SimOldRotRoll = OldRot.Roll;
SimInterpolate.X = 100 * PhysAlpha;
SimInterpolate.Y = 100 * FMax(0.01, PhysRate);
SimInterpolate.Z = 256 * PrevKeyNum + KeyNum;

MakeGroupReturn


// Abort move and reverse course.
bInterpolating = false;
AmbientSound = None;
if( KeyNum GotoState( , 'Open' );
else
GotoState( , 'Close' );

if ( Follower != None )
Follower.MakeGroupReturn();

MakeGroupStop


// Stop moving immediately.
bInterpolating = false;
AmbientSound = None;
GotoState( , '' );

if ( Follower != None )
Follower.MakeGroupStop();

PostBeginPlay


local mover M;


//brushes can't be deleted, so if not relevant, make it invisible and non-colliding
if ( !Level.Game.IsRelevant(self) )
{
SetCollision(false, false, false);
SetLocation(Location + vect(0,0,20000)); // temp since still in bsp
bHidden = true;
}
else
{
FindTriggerActor();
// Initialize all slaves.
if( !bSlave )
{
foreach AllActors( class 'Mover', M, Tag )
{
if( M.bSlave )
{
M.GotoState('');
M.SetBase( Self );
}
}
}
if ( Leader == None )
{
Leader = self;
ForEach AllActors( class'Mover', M )
if ( (M != self) && (M.ReturnGroup == ReturnGroup) )
{
M.Leader = self;
M.Follower = Follower;
Follower = M;
}
}
}

SetKeyframe (byte NewKeyNum, vector NewLocation, rotator NewRotation)


KeyNum = Clamp( NewKeyNum, 0, ArrayCount(KeyPos)-1 );
KeyPos[KeyNum] = NewLocation;
KeyRot[KeyNum] = NewRotation;

SpecialHandling (Pawn Other) -> Actor


if ( bDamageTriggered )
{
if ( !Other.bCanDoSpecial || (Other.Weapon == None) )
return None;

Other.Target = self;
Other.bShootSpecial = true;
Other.FireWeapon();
Other.bFire = 0;
Other.bAltFire = 0;
return self;
}

if ( BumpType == BT_PlayerBump && !Other.bIsPlayer )
return None;

return self;

Timer


if ( Velocity != vect(0,0,0) )
{
bClientPause = false;
return;
}
if ( Level.NetMode == NM_Client )
{
if ( ClientUpdate == 0 ) // not doing a move
{
if ( bClientPause )
{
if ( VSize(RealPosition - Location) > 3 )
SetLocation(RealPosition);
else
RealPosition = Location;
SetRotation(RealRotation);
bClientPause = false;
}
else if ( RealPosition != Location )
bClientPause = true;
}
else
bClientPause = false;
}
else
{
RealPosition = Location;
RealRotation = Rotation;
}

Trigger (actor Other, pawn EventInstigator)


numTriggerEvents++;
SavedTrigger = Other;
Instigator = EventInstigator;
GotoState( 'TriggerPound', 'Open' );

UnTrigger (actor Other, pawn EventInstigator)


numTriggerEvents--;
if ( numTriggerEvents <= 0 )
{
numTriggerEvents = 0;
SavedTrigger = None;
Instigator = None;
GotoState( 'TriggerPound', 'Close' );
}




MusicEvent.uc (extends Triggers)

var() music Song;
var() byte SongSection;
var() byte CdTrack;
var() EMusicTransition Transition;
var() bool bSilence;
var() bool bOnceOnly;
var() bool bAffectAllPlayers;
CdTrack=255
Transition=MTRAN_Fade
bAffectAllPlayers=True

BeginPlay


if( Song==None )
{
Song = Level.Song;
}
if( bSilence )
{
SongSection = 255;
CdTrack = 255;
}

Trigger (actor Other, pawn EventInstigator)


local PlayerPawn P;
local Pawn A;


if( bAffectAllPlayers )
{
A = Level.PawnList;
While ( A != None )
{
if ( A.IsA('PlayerPawn') )
PlayerPawn(A).ClientSetMusic( Song, SongSection, CdTrack, Transition );
A = A.nextPawn;
}
}
else
{
// Only affect the one player.
P = PlayerPawn(EventInstigator);
if( P==None )
return;

// Go to music.
P.ClientSetMusic( Song, SongSection, CdTrack, Transition );
}

// Turn off if once-only.
if( bOnceOnly )
{
SetCollision(false,false,false);
disable( 'Trigger' );
}




Mutator.uc (extends Info)

var Mutator NextMutator;
var Mutator NextDamageMutator;
var class DefaultWeapon;

AddMutator (Mutator M)


if ( NextMutator == None )
NextMutator = M;
else
NextMutator.AddMutator(M);

AlwaysKeep (Actor Other) -> bool


if ( NextMutator != None )
return ( NextMutator.AlwaysKeep(Other) );
return false;

CheckReplacement (Actor Other, out byte bSuperRelevant) -> bool


return true;

IsRelevant (Actor Other, out byte bSuperRelevant) -> bool


local bool bResult;


// allow mutators to remove actors
bResult = CheckReplacement(Other, bSuperRelevant);
if ( bResult && (NextMutator != None) )
bResult = NextMutator.IsRelevant(Other, bSuperRelevant);

return bResult;

ModifyPlayer (Pawn Other)


// called by GameInfo.RestartPlayer()
if ( NextMutator != None )
NextMutator.ModifyPlayer(Other);

Mutate (string MutateString, PlayerPawn Sender)


if ( NextMutator != None )
NextMutator.Mutate(MutateString, Sender);

MutatedDefaultWeapon -> Class


local Class W;


if ( NextMutator != None )
{
W = NextMutator.MutatedDefaultWeapon();
if ( W == Level.Game.DefaultWeapon )
W = MyDefaultWeapon();
}
else
W = MyDefaultWeapon();
return W;

MyDefaultWeapon -> Class


if ( DefaultWeapon != None )
return DefaultWeapon;
else
return Level.Game.DefaultWeapon;

PostRender (canvas Canvas)

PreBeginPlay


//Don't call Actor PreBeginPlay()

ReplaceWith (actor Other, string aClassName) -> bool


local Actor A;
local class aClass;


if ( Other.IsA('Inventory') && (Other.Location == vect(0,0,0)) )
return false;
aClass = class(DynamicLoadObject(aClassName, class'Class'));
if ( aClass != None )
A = Spawn(aClass,,Other.tag,Other.Location, Other.Rotation);
if ( Other.IsA('Inventory') )
{
if ( Inventory(Other).MyMarker != None )
{
Inventory(Other).MyMarker.markedItem = Inventory(A);
if ( Inventory(A) != None )
{
Inventory(A).MyMarker = Inventory(Other).MyMarker;
A.SetLocation(A.Location
+ (A.CollisionHeight - Other.CollisionHeight) * vect(0,0,1));
}
Inventory(Other).MyMarker = None;
}
else if ( A.IsA('Inventory') )
{
Inventory(A).bHeldItem = true;
Inventory(A).Respawntime = 0.0;
}
}
if ( A != None )
{
A.event = Other.event;
A.tag = Other.tag;
return true;
}
return false;

ScoreKill (Pawn Killer, Pawn Other)


// called by GameInfo.ScoreKill()
if ( NextMutator != None )
NextMutator.ScoreKill(Killer, Other);




var() name ownerTeam; //creature clan owning this area (area visible from this point)
var bool taken; //set when a creature is occupying this spot
var int upstreamPaths[16];
var int Paths[16]; //index of reachspecs (used by C++ Navigation code)
var int PrunedPaths[16];
var NavigationPoint VisNoReachPaths[16]; //paths that are visible but not directly reachable
var int visitedWeight;
var actor routeCache;
var const int bestPathWeight;
var const NavigationPoint nextNavigationPoint;
var const NavigationPoint nextOrdered;
var const NavigationPoint prevOrdered;
var const NavigationPoint startPath;
var const NavigationPoint previousPath;
var int cost; //added cost to visit this pathnode
var() int ExtraCost;
var() bool bPlayerOnly; //only players should use this path
var bool bEndPoint; //used by C++ navigation code
var bool bEndPointOnly; //only used as an endpoint in routing network
var bool bSpecialCost; //if true, navigation code will call SpecialCost function for this navigation point
var() bool bOneWayPath; //reachspecs from this path only in the direction the path is facing (180 degrees)
var() bool bNeverUseStrafing; // shouldn't use bAdvancedTactics going to this point
upstreamPaths(0)=-1
upstreamPaths(1)=-1
upstreamPaths(2)=-1
upstreamPaths(3)=-1
upstreamPaths(4)=-1
upstreamPaths(5)=-1
upstreamPaths(6)=-1
upstreamPaths(7)=-1
upstreamPaths(8)=-1
upstreamPaths(9)=-1
upstreamPaths(10)=-1
upstreamPaths(11)=-1
upstreamPaths(12)=-1
upstreamPaths(13)=-1
upstreamPaths(14)=-1
upstreamPaths(15)=-1
Paths(0)=-1
Paths(1)=-1
Paths(2)=-1
Paths(3)=-1
Paths(4)=-1
Paths(5)=-1
Paths(6)=-1
Paths(7)=-1
Paths(8)=-1
Paths(9)=-1
Paths(10)=-1
Paths(11)=-1
Paths(12)=-1
Paths(13)=-1
Paths(14)=-1
Paths(15)=-1
PrunedPaths(0)=-1
PrunedPaths(1)=-1
PrunedPaths(2)=-1
PrunedPaths(3)=-1
PrunedPaths(4)=-1
PrunedPaths(5)=-1
PrunedPaths(6)=-1
PrunedPaths(7)=-1
PrunedPaths(8)=-1
PrunedPaths(9)=-1
PrunedPaths(10)=-1
PrunedPaths(11)=-1
PrunedPaths(12)=-1
PrunedPaths(13)=-1
PrunedPaths(14)=-1
PrunedPaths(15)=-1
bStatic=True
bHidden=True
bCollideWhenPlacing=True
SoundVolume=0
CollisionRadius=12.000000
CollisionHeight=15.000000

// Move the actor here.
taken = Incoming.SetLocation( Location + vect (0,0,20));
if (taken)
{
Incoming.Velocity = vect(0,0,0);
Incoming.SetRotation(Rotation);
}
// Play teleport-in effect.
PlayTeleportEffect(Incoming, true);
return taken;


Level.Game.PlayTeleportEffect(Incoming, bOut, false);




Palette.uc (extends Object)

var native const array Colors;



PathNode.uc (extends NavigationPoint)

Texture=Texture'Engine.S_Pickup'
SoundVolume=128



PatrolPoint.uc (extends NavigationPoint)

var() name Nextpatrol; //next point to go to
var() float pausetime; //how long to pause here
var() name PatrolAnim;
var() sound PatrolSound;
var() byte numAnims;
var int AnimCount;
var PatrolPoint NextPatrolPoint;
bDirectional=True
Texture=Texture'Engine.S_Patrol'
SoundVolume=128

PreBeginPlay


local PatrolPoint CurPoint;


lookdir = 200 * vector(Rotation);

//find the patrol point with the tag specified by Nextpatrol
NextPatrolPoint = None;
if (NextPatrol != '')
{
foreach AllActors(class 'PatrolPoint', CurPoint, Nextpatrol)
{
if (CurPoint != self)
{
NextPatrolPoint = CurPoint;
break;
}
}
}

Super.PreBeginPlay();




Pawn.uc (extends Actor)

var bool bBehindView; // Outside-the-player view.
var bool bIsPlayer; // Pawn is a player or a player-bot.
var bool bJustLanded; // used by eyeheight adjustment
var bool bUpAndOut; // used by swimming
var bool bIsWalking;
var const bool bHitSlopedWall; // used by Physics
var globalconfig bool bNeverSwitchOnPickup; // if true, don't automatically switch to picked up weapon
var bool bWarping; // Set when travelling through warpzone (so shouldn't telefrag)
var bool bUpdatingDisplay; // to avoid infinite recursion through inventory setdisplay
var(Combat) bool bCanStrafe;
var(Orders) bool bFixedStart;
var const bool bReducedSpeed; //used by movement natives
var const bool bLOSflag; // used for alternating LineOfSight traces
var bool bFromWall;
var const float AvgPhysicsTime;
var PointRegion FootRegion;
var PointRegion HeadRegion;
var float MoveTimer;
var Actor MoveTarget; // set by movement natives
var(Combat) float MeleeRange; // Max range for melee attack (not including collision radii)
var(Movement) float GroundSpeed; // The maximum ground speed.
var(Movement) float WaterSpeed; // The maximum swimming speed.
var(Movement) float AirSpeed; // The maximum flying speed.
var(Movement) float AccelRate; // max acceleration rate
var(Movement) float JumpZ; // vertical acceleration w/ jump
var(Movement) float MaxStepHeight; // Maximum size of upward/downward step.
var(Movement) float AirControl; // amount of AirControl available to the pawn
var() byte Visibility; //How visible is the pawn? 0 = invisible.
var(AI) float SightRadius; //Maximum seeing distance.
var(AI) float PeripheralVision;//Cosine of limits of peripheral vision.
var(AI) float HearingThreshold; //Minimum noise loudness for hearing
var travel Weapon Weapon; // The pawn's current weapon.
var Weapon PendingWeapon; // Will become weapon once current weapon is put down
var travel Inventory SelectedItem; // currently selected inventory item
var rotator ViewRotation; // View rotation.
var vector WalkBob;
var() float BaseEyeHeight; // Base eye height above collision center.
var float EyeHeight; // Current eye height, adjusted for bobbing and stairs.
var float SplashTime; // time of last splash
var float OrthoZoom; // Orthogonal/map view zoom factor.
var() float FovAngle; // X field of view angle in degrees, usually 90.
var int DieCount, ItemCount, KillCount, SecretCount, Spree;
var() travel int Health; // Health: 100 = normal maximum
var() string SelectionMesh;
var() string SpecialMesh;
var() name ReducedDamageType; //Either a damagetype name or 'All', 'AllEnvironment' (Burned, Corroded, Frozen)
var() float ReducedDamagePct;
var() class DropWhenKilled;
var(Movement) float UnderWaterTime; //how much time pawn can go without air (in seconds)
var(AI) enum EAttitude //important - order in decreasing importance
var(AI) enum EIntelligence //important - order in increasing intelligence
var(AI) float Skill; // skill, scaled by game difficulty (add difficulty to this value)
var const vector noise1spot;
var const float noise1time;
var const pawn noise1other;
var const float noise1loudness;
var const vector noise2spot;
var const float noise2time;
var const pawn noise2other;
var const float noise2loudness;
var const pawn nextPawn;
var(Sounds) sound HitSound1;
var(Sounds) sound HitSound2;
var(Sounds) sound Land;
var(Sounds) sound Die;
var(Sounds) sound WaterStep;
var input byte
var(Combat) float CombatStyle; // -1 to 1 = low means tends to stay off and snipe, high means tends to charge and melee
var NavigationPoint home; //set when begin play, used for retreating and attitude checks
var name NextState; //for queueing states
var name NextLabel; //for queueing states
var float SoundDampening;
var float DamageScaling;
var(Orders) name AlarmTag; // tag of object to go to when see player
var(Orders) name SharedAlarmTag;
var Name PlayerReStartState;
var() localized string MenuName; //Name used for this pawn type in menus (e.g. player selection)
var() localized string NameArticle; //article used in conjunction with this class (e.g. "a", "an")
var() byte VoicePitch; //for speech
var() string VoiceType; //for speech
var float OldMessageTime; //to limit frequency of voice messages
var NavigationPoint RouteCache[16];
var() class PlayerReplicationInfoClass;
var PlayerReplicationInfo PlayerReplicationInfo;
var Decal Shadow;
var() travel int HealthHead;
var() travel int HealthTorso;
var() travel int HealthLegLeft;
var() travel int HealthLegRight;
var() travel int HealthArmLeft;
var() travel int HealthArmRight;
var bool bIsSpeaking; // are we speaking now
var bool bWasSpeaking; // were we speaking last frame? (should we close our mouth?)
var string lastPhoneme; // phoneme last spoken
var string nextPhoneme; // phoneme to speak next
var float animTimer[4]; // misc. timers for ambient anims (blink, head, etc.)
var bool bOnFire;
var float burnTimer;
var(AI) float AIHorizontalFov; // degrees
var(AI) float AspectRatio; // horizontal/vertical ratio
var(AI) float AngularResolution; // degrees
var float MinAngularSize; // tan(AngularResolution)^2
var(AI) float VisibilityThreshold; // lowest visible brightness (0-1)
var(AI) float SmellThreshold; // lowest smellable odor (0-1)
var(Alliances) Name Alliance; // alliance tag
var Rotator AIAddViewRotation; // rotation added to view rotation for AICanSee()
bCanGlide=True
AvgPhysicsTime=0.100000
MaxDesiredSpeed=1.000000
GroundSpeed=320.000000
WaterSpeed=200.000000
AccelRate=500.000000
JumpZ=325.000000
MaxStepHeight=25.000000
AirControl=0.050000
Visibility=128
SightRadius=2500.000000
OrthoZoom=40000.000000
FovAngle=90.000000
Health=100
AttitudeToPlayer=ATTITUDE_Hate
Intelligence=BRAINS_MAMMAL
noise1time=-10.000000
noise2time=-10.000000
SoundDampening=1.000000
DamageScaling=1.000000
PlayerReStartState=PlayerWalking
NameArticle=" a "
PlayerReplicationInfoClass=Class'Engine.PlayerReplicationInfo'
HealthHead=100
HealthTorso=100
HealthLegLeft=100
HealthLegRight=100
HealthArmLeft=100
HealthArmRight=100
AIHorizontalFov=75.000000
AspectRatio=1.333333
AngularResolution=1.000000
SmellThreshold=0.500000
bCanTeleport=True
bIsKillGoal=True
bStasis=True
bIsPawn=True
RemoteRole=ROLE_SimulatedProxy
AnimSequence=Fighter
bDirectional=True
Texture=Texture'Engine.S_Pawn'
SoundRadius=9
SoundVolume=240
TransientSoundVolume=2.000000
bCollideActors=True
bCollideWorld=True
bBlockActors=True
bBlockPlayers=True
bProjTarget=True
bRotateToDesired=True
RotationRate=(Pitch=4096,Yaw=50000,Roll=3072)
bVisionImportant=True
NetPriority=2.000000

AICanHear (actor other, optional float Volume, optional float Radius) | native

AICanSmell (actor other, optional float smell) | native

AddInventory (inventory NewItem) -> bool


local inventory Inv;

// Skip if already in the inventory.

// The item should not have been destroyed if we get here.
if (NewItem ==None )
log("tried to add none inventory to "$self);

for( Inv=Inventory; Inv!=None; Inv=Inv.Inventory )
if( Inv == NewItem )
return false;

// DEUS_EX AJY
// Update the previous owner's inventory chain
if (NewItem.Owner != None)
Pawn(NewItem.Owner).DeleteInventory(NewItem);

// Add to front of inventory chain.
NewItem.SetOwner(Self);
NewItem.Inventory = Inventory;
Inventory = NewItem;


return true;

AddPawn | native

AddVelocity (vector NewVelocity)


if (Physics == PHYS_Walking)
SetPhysics(PHYS_Falling);
if ( (Velocity.Z > 380) && (NewVelocity.Z > 0) )
NewVelocity.Z *= 0.5;
Velocity += NewVelocity;

AdjustAim (float projSpeed, vector projStart, int aimerror, bool bLeadTarget, bool bWarnTarget) -> rotator


return ViewRotation;

AdjustDesireFor (Inventory Inv) -> float


return 0;

AdjustHitLocation (out vector HitLocation, vector TraceDir) -> bool


local float adjZ, maxZ;


TraceDir = Normal(TraceDir);
HitLocation = HitLocation + 0.4 * CollisionRadius * TraceDir;

/* DEUS_EX STM -- took this out because it fucks up crouching
if ( (GetAnimGroup(AnimSequence) == 'Ducking') && (AnimFrame > -0.03) )
{
maxZ = Location.Z + 0.25 * CollisionHeight;
if ( HitLocation.Z > maxZ )
{
if ( TraceDir.Z >= 0 )
return false;
adjZ = (maxZ - HitLocation.Z)/TraceDir.Z;
HitLocation.Z = maxZ;
HitLocation.X = HitLocation.X + TraceDir.X * adjZ;
HitLocation.Y = HitLocation.Y + TraceDir.Y * adjZ;
if ( VSize(HitLocation - Location) > CollisionRadius )
return false;
}
}
*/

return true;

AdjustToss (float projSpeed, vector projStart, int aimerror, bool bLeadTarget, bool bWarnTarget) -> rotator


return ViewRotation;

BaseChange


local float decorMass;


if ( (base == None) && (Physics == PHYS_None) )
SetPhysics(PHYS_Falling);
else if (Pawn(Base) != None)
{
Base.TakeDamage( (1-Velocity.Z/400)* Mass/Base.Mass, Self,Location,0.5 * Velocity , 'stomped');
JumpOffPawn();
}
else if ( (Decoration(Base) != None) && (Velocity.Z < -400) )
{
decorMass = FMax(Decoration(Base).Mass, 1);
Base.TakeDamage((-2* Mass/decorMass * Velocity.Z/400), Self, Location, 0.5 * Velocity, 'stomped');
}

BecomeViewTarget


bViewTarget = true;

BeginState


SetPhysics(PHYS_None);
HidePlayer();

BotVoiceMessage (name messagetype, byte MessageID, Pawn Sender)

CanSee (actor Other) | native

ChangedWeapon


local Weapon OldWeapon;


OldWeapon = Weapon;

if (Weapon == PendingWeapon)
{
if ( Weapon == None )
SwitchToBestWeapon();
else if ( Weapon.IsInState('DownWeapon') )
Weapon.BringUp();
if ( Weapon != None )
Weapon.SetDefaultDisplayProperties();
Inventory.ChangedWeapon(); // tell inventory that weapon changed (in case any effect was being applied)
PendingWeapon = None;
return;
}
// removed these lines so you don't automatically pick another weapon - DEUS_EX CNN
// if ( PendingWeapon == None )
// PendingWeapon = Weapon;

PlayWeaponSwitch(PendingWeapon);
if ( (PendingWeapon != None) && (PendingWeapon.Mass > 20) && (carriedDecoration != None) )
DropDecoration();
if ( Weapon != None )
Weapon.SetDefaultDisplayProperties();

Weapon = PendingWeapon;
Inventory.ChangedWeapon(); // tell inventory that weapon changed (in case any effect was being applied)
if ( Weapon != None )
{
Weapon.RaiseUp(OldWeapon);
if ( (Level.Game != None) && (Level.Game.Difficulty > 1) )
MakeNoise(0.1 * Level.Game.Difficulty);
}
PendingWeapon = None;

CheckFutureSight (float DeltaTime) -> bool


return true;

CheckWaterJump (out vector WallNormal) -> bool


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


if (CarriedDecoration != None)
return false;
checkpoint = vector(Rotation);
checkpoint.Z = 0.0;
checkNorm = Normal(checkpoint);
checkPoint = Location + CollisionRadius * checkNorm;
Extent = CollisionRadius * vect(1,1,0);
Extent.Z = CollisionHeight;
HitActor = Trace(HitLocation, HitNormal, checkpoint, Location, true, Extent);
if ( (HitActor != None) && (Pawn(HitActor) == None) )
{
WallNormal = -1 * HitNormal;
start = Location;
start.Z += 1.1 * MaxStepHeight;
checkPoint = start + 2 * CollisionRadius * checkNorm;
HitActor = Trace(HitLocation, HitNormal, checkpoint, start, true);
if (HitActor == None)
return true;
}

return false;

ClearPaths | native

ClientDying (name DamageType, vector HitLocation)


PlayDying(DamageType, HitLocation);
GotoState('Dying');

ClientGameEnded


GotoState('GameEnded');

ClientMessage (coerce string S, optional name Type, optional bool bBeep)

ClientPutDown (Weapon Current, Weapon Next)


Current.ClientPutDown(Next);

ClientReStart


//log("client restart");

Velocity = vect(0,0,0);
Acceleration = vect(0,0,0);
BaseEyeHeight = Default.BaseEyeHeight;
EyeHeight = BaseEyeHeight;
PlayWaiting();

if ( Region.Zone.bWaterZone && (PlayerRestartState == 'PlayerWalking') )
{
if (HeadRegion.Zone.bWaterZone)
PainTime = UnderWaterTime;
setPhysics(PHYS_Swimming);
GotoState('PlayerSwimming');
}
else
GotoState(PlayerReStartState);

ClientSetLocation (vector NewLocation, rotator NewRotation)


local Pawn P;


ViewRotation = NewRotation;
If ( (ViewRotation.Pitch > RotationRate.Pitch) && (ViewRotation.Pitch < 65536 - RotationRate.Pitch) )
{
If (ViewRotation.Pitch < 32768)
NewRotation.Pitch = RotationRate.Pitch;
else
NewRotation.Pitch = 65536 - RotationRate.Pitch;
}

NewRotation.Roll = 0;
SetRotation( NewRotation );
SetLocation( NewLocation );

ClientSetRotation (rotator NewRotation)


local Pawn P;


ViewRotation = NewRotation;
NewRotation.Pitch = 0;
NewRotation.Roll = 0;
SetRotation( NewRotation );

ClientVoiceMessage (PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID)

ComputePathnodeDistances (optional actor startActor) | native

DeleteInventory (inventory Item) -> bool


local actor Link;

// If this item is in our inventory chain, unlink it.

if ( Item == Weapon )
Weapon = None;
if ( Item == SelectedItem )
SelectedItem = None;
for( Link = Self; Link!=None; Link=Link.Inventory )
{
if( Link.Inventory == Item )
{
Link.Inventory = Item.Inventory;
break;
}
}
Item.SetOwner(None);

Destroyed


local Inventory Inv;
local Pawn OtherPawn;


if ( Shadow != None )
Shadow.Destroy();
RemovePawn();
if ( Role < ROLE_Authority )
return;

for( Inv=Inventory; Inv!=None; Inv=Inv.Inventory )
Inv.Destroy();
Weapon = None;
Inventory = None;
if ( bIsPlayer && (Level.Game != None) )
Level.Game.logout(self);
if ( PlayerReplicationInfo != None )
PlayerReplicationInfo.Destroy();
for ( OtherPawn=Level.PawnList; OtherPawn!=None; OtherPawn=OtherPawn.nextPawn )
OtherPawn.Killed(None, self, '');
Super.Destroyed();

Died (pawn Killer, name damageType, vector HitLocation)


local pawn OtherPawn;
local actor A;


if ( bDeleteMe )
return; //already destroyed
Health = Min(0, Health);
for ( OtherPawn=Level.PawnList; OtherPawn!=None; OtherPawn=OtherPawn.nextPawn )
OtherPawn.Killed(Killer, self, damageType);
if ( CarriedDecoration != None )
DropDecoration();
level.game.Killed(Killer, self, damageType);
//log(class$" dying");
if( Event != '' )
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Self, Killer );
Level.Game.DiscardInventory(self);
Velocity.Z *= 1.3;
if ( Gibbed(damageType) )
{
SpawnGibbedCarcass();
if ( bIsPlayer )
HidePlayer();
else
Destroy();
}
PlayDying(DamageType, HitLocation);
if ( Level.Game.bGameEnded )
return;
if ( RemoteRole == ROLE_AutonomousProxy )
ClientDying(DamageType, HitLocation);
GotoState('Dying');

DropDecoration


if (CarriedDecoration != None)
{
CarriedDecoration.bWasCarried = true;
CarriedDecoration.SetBase(None);
CarriedDecoration.SetPhysics(PHYS_Falling);
CarriedDecoration.Velocity = Velocity + 10 * VRand();
CarriedDecoration.Instigator = self;

// turn off translucency - DEUS_EX CNN
CarriedDecoration.Style = CarriedDecoration.Default.Style;
CarriedDecoration.ScaleGlow = CarriedDecoration.Default.ScaleGlow;
CarriedDecoration.bUnlit = CarriedDecoration.Default.bUnlit;

CarriedDecoration = None;
}

EAdjustJump | native

EncroachedBy (actor Other)


if ( Pawn(Other) != None )
gibbedBy(Other);


EncroachingOn (actor Other) -> bool


if ( (Other.Brush != None) || (Brush(Other) != None) )
return true;

if ( (!bIsPlayer || bWarping) && (Pawn(Other) != None))
return true;

return false;

EnemyNotVisible

Falling


//SetPhysics(PHYS_Falling); //Note - physics changes type to PHYS_Falling by default
//log(class$" Falling");
PlayInAir();

FearThisSpot (Actor ASpot)

FellOutOfWorld


Health = -1;
SetPhysics(PHYS_None);
Weapon = None;
Died(None, 'Fell', Location);

FindBestInventoryPath (out float MinWeight, bool bPredictRespawns) | native

FindRandomDest (optional bool bClearPaths) | native

FindStairRotation (float DeltaTime) | native

FireWeapon

FootZoneChange (ZoneInfo newFootZone)


local actor HitActor;
local vector HitNormal, HitLocation;
local float splashSize;
local actor splash;


if ( Level.NetMode == NM_Client )
return;
if ( Level.TimeSeconds - SplashTime > 0.25 )
{
SplashTime = Level.TimeSeconds;
if (Physics == PHYS_Falling)
MakeNoise(1.0);
else
MakeNoise(0.3);
if ( FootRegion.Zone.bWaterZone )
{
if ( !newFootZone.bWaterZone && (Role==ROLE_Authority) )
{
if ( FootRegion.Zone.ExitSound != None )
PlaySound(FootRegion.Zone.ExitSound, SLOT_Interact, 1);
if ( FootRegion.Zone.ExitActor != None )
Spawn(FootRegion.Zone.ExitActor,,,Location - CollisionHeight * vect(0,0,1));
}
}
else if ( newFootZone.bWaterZone && (Role==ROLE_Authority) )
{
splashSize = FClamp(0.000025 * Mass * (300 - 0.5 * FMax(-500, Velocity.Z)), 1.0, 4.0 );
if ( newFootZone.EntrySound != None )
{
HitActor = Trace(HitLocation, HitNormal,
Location - (CollisionHeight + 40) * vect(0,0,0.8), Location - CollisionHeight * vect(0,0,0.8), false);
if ( HitActor == None )
PlaySound(newFootZone.EntrySound, SLOT_Misc, 2 * splashSize);
else
PlaySound(WaterStep, SLOT_Misc, 1.5 + 0.5 * splashSize);
}
if( newFootZone.EntryActor != None )
{
splash = Spawn(newFootZone.EntryActor,,,Location - CollisionHeight * vect(0,0,1));
if ( splash != None )
splash.DrawScale = splashSize;
}
//log("Feet entering water");
}
}

if (FootRegion.Zone.bPainZone)
{
if ( !newFootZone.bPainZone && !HeadRegion.Zone.bWaterZone )
PainTime = -1.0;
}
else if (newFootZone.bPainZone)
PainTime = 0.01;

Gasp

GetHumanName -> String


if ( PlayerReplicationInfo != None )
return PlayerReplicationInfo.PlayerName;
return NameArticle$MenuName;

GetMultiSkin (Actor SkinActor, out string SkinName, out string FaceName)


SkinName = String(SkinActor.Skin);
FaceName = "";

GetRating -> float


return 1000;

Gibbed (name damageType) -> bool


return false;

GrabDecoration


local vector lookDir, HitLocation, HitNormal, T1, T2, extent;
local actor HitActor;


if ( carriedDecoration == None )
{
//first trace to find it
lookDir = vector(Rotation);
lookDir.Z = 0;
T1 = Location + BaseEyeHeight * vect(0,0,1) + lookDir * 0.8 * CollisionRadius;
T2 = T1 + lookDir * 1.2 * CollisionRadius;
HitActor = Trace(HitLocation, HitNormal, T2, T1, true);
if ( HitActor == None )
{
T1 = T2 - (BaseEyeHeight + CollisionHeight - 2) * vect(0,0,1);
HitActor = Trace(HitLocation, HitNormal, T1, T2, true);
}
else if ( HitActor == Level )
{
T2 = HitLocation - lookDir;
T1 = T2 - (BaseEyeHeight + CollisionHeight - 2) * vect(0,0,1);
HitActor = Trace(HitLocation, HitNormal, T1, T2, true);
}
if ( (HitActor == None) || (HitActor == Level) )
{
extent.X = CollisionRadius;
extent.Y = CollisionRadius;
extent.Z = CollisionHeight;
HitActor = Trace(HitLocation, HitNormal, Location + lookDir * 1.2 * CollisionRadius, Location, true, extent);
}

if ( Mover(HitActor) != None )
{
if ( Mover(HitActor).bUseTriggered )
HitActor.Trigger( self, self );
}
else if ( (Decoration(HitActor) != None) && ((weapon == None) || (weapon.Mass < 20)) )
{
CarriedDecoration = Decoration(HitActor);
if ( !CarriedDecoration.bPushable || (CarriedDecoration.Mass > 40)
|| (CarriedDecoration.StandingCount > 0) )
{
CarriedDecoration = None;
return;
}
lookDir.Z = 0;
if ( CarriedDecoration.SetLocation(Location + (0.5 * CollisionRadius + CarriedDecoration.CollisionRadius) * lookDir) )
{
CarriedDecoration.SetPhysics(PHYS_None);
CarriedDecoration.SetBase(self);

// make it translucent - DEUS_EX CNN
CarriedDecoration.Style = STY_Translucent;
CarriedDecoration.ScaleGlow = 1.0;
CarriedDecoration.bUnlit = True;
}
else
CarriedDecoration = None;
}
}

HandleHelpMessageFrom (Pawn Other)

HeadZoneChange (ZoneInfo newHeadZone)


if ( Level.NetMode == NM_Client )
return;
if (HeadRegion.Zone.bWaterZone)
{
if (!newHeadZone.bWaterZone)
{
if ( bIsPlayer && (PainTime > 0) && (PainTime < 8) )
Gasp();
if ( Inventory != None )
Inventory.ReduceDamage(0, 'Breathe', Location); //inform inventory of zone change
bDrowning = false;
if ( !FootRegion.Zone.bPainZone )
PainTime = -1.0;
}
}
else
{
if (newHeadZone.bWaterZone)
{
if ( !FootRegion.Zone.bPainZone )
PainTime = UnderWaterTime;
if ( Inventory != None )
Inventory.ReduceDamage(0, 'Drowned', Location); //inform inventory of zone change
//log("Can't breathe");
}
}

HearNoise (float Loudness, Actor NoiseMaker)

HidePlayer


SetCollision(false, false, false);
TweenToFighter(0.01);
bHidden = true;

InitPlayerReplicationInfo


if (PlayerReplicationInfo.PlayerName == "")
PlayerReplicationInfo.PlayerName = class'GameInfo'.Default.DefaultPlayerName;

JumpOffPawn


Velocity += 60 * VRand();
Velocity.Z = 180;
SetPhysics(PHYS_Falling);

KillMessage (name damageType, pawn Other) -> string


local string message;


message = Level.Game.CreatureKillMessage(damageType, Other);
return (message$namearticle$menuname);

Killed (pawn Killer, pawn Other, name damageType)


if ( Enemy == Other )
Enemy = None;

Landed (vector HitNormal)


SetPhysics(PHYS_None);

LineOfSightTo (actor Other, optional bool bIgnoreDistance) | native

LipSynch (float deltaTime)


local name animseq;
local float rnd;
local float tweentime;


// update the animation timers that we are using
animTimer[0] += deltaTime;
animTimer[1] += deltaTime;
animTimer[2] += deltaTime;

if (bIsSpeaking)
{
// if our framerate is high enough (>20fps), tween the lips smoothly
if (Level.TimeSeconds - animTimer[3] < 0.05)
tweentime = 0.1;
else
tweentime = 0.0;

// the last animTimer slot is used to check framerate
animTimer[3] = Level.TimeSeconds;

if (nextPhoneme == "A")
animseq = 'MouthA';
else if (nextPhoneme == "E")
animseq = 'MouthE';
else if (nextPhoneme == "F")
animseq = 'MouthF';
else if (nextPhoneme == "M")
animseq = 'MouthM';
else if (nextPhoneme == "O")
animseq = 'MouthO';
else if (nextPhoneme == "T")
animseq = 'MouthT';
else if (nextPhoneme == "U")
animseq = 'MouthU';
else if (nextPhoneme == "X")
animseq = 'MouthClosed';

if (animseq != '')
{
if (lastPhoneme != nextPhoneme)
{
lastPhoneme = nextPhoneme;
TweenBlendAnim(animseq, tweentime);
}
}
}
else if (bWasSpeaking)
{
bWasSpeaking = False;
TweenBlendAnim('MouthClosed', tweentime);
}

// blink randomly
if (animTimer[0] > 2.0)
{
animTimer[0] = 0;
if (FRand() < 0.4)
PlayBlendAnim('Blink', 1.0, 0.1, 1);
}

LoopHeadConvoAnim();
LoopBaseConvoAnim();

LongFall

LoopBaseConvoAnim


local float rnd;


rnd = FRand();

// move arms randomly
if (bIsSpeaking)
{
if (animTimer[2] > 2.5)
{
animTimer[2] = 0;
if (rnd < 0.1)
PlayAnim('GestureLeft', 0.35, 0.4);
else if (rnd < 0.2)
PlayAnim('GestureRight', 0.35, 0.4);
else if (rnd < 0.3)
PlayAnim('GestureBoth', 0.35, 0.4);
}
}

// if we're not playing an animation, loop the breathe
if (!IsAnimating())
LoopAnim('BreatheLight',, 0.4);

LoopHeadConvoAnim


local float rnd;


rnd = FRand();

// move head randomly (only while not speaking)
if (!bIsSpeaking && (animTimer[1] > 0.5))
{
if (rnd < 0.01)
PlayTurnHead(LOOK_Left, 1.0, 2.0);
else if (rnd < 0.02)
PlayTurnHead(LOOK_Right, 1.0, 2.0);
else
PlayTurnHead(LOOK_Forward, 1.0, 1.0);
}

MoveTo (vector NewDestination, optional float speed) | native

MoveToward (actor NewTarget, optional float speed) | native

NextItem


local Inventory Inv;


// DEUS_EX CNN - this function is EVIL!
return;

if (SelectedItem==None) {
SelectedItem = Inventory.SelectNext();
Return;

PainTimer


local float depth;


//log("Pain Timer");
if ( (Health < 0) || (Level.NetMode == NM_Client) )
return;

if ( FootRegion.Zone.bPainZone )
{
depth = 0.4;
if (Region.Zone.bPainZone)
depth += 0.4;
if (HeadRegion.Zone.bPainZone)
depth += 0.2;

if (FootRegion.Zone.DamagePerSec > 0)
{
if ( IsA('PlayerPawn') )
Level.Game.SpecialDamageString = FootRegion.Zone.DamageString;
TakeDamage(int(float(FootRegion.Zone.DamagePerSec) * depth), None, Location, vect(0,0,0), FootRegion.Zone.DamageType);
}
else if ( Health < Default.Health )
Health = Min(Default.Health, Health - depth * FootRegion.Zone.DamagePerSec);

if (Health > 0)
PainTime = 1.0;
}
else if ( HeadRegion.Zone.bWaterZone )
{
// DEUS_EX CNN - make drowning damage happen from center
TakeDamage(5, None, Location, vect(0,0,0), 'Drowned');
if ( Health > 0 )
PainTime = 2.0;
}

PickAnyTarget (out float bestAim, out float bestDist, vector FireDir, vector projStart) | native

PickTarget (out float bestAim, out float bestDist, vector FireDir, vector projStart) | native

PickWallAdjust | native

PlayBigDeath (name DamageType)

PlayCrawling

PlayDeathHit (float Damage, vector HitLocation, name damageType, vector Momentum)

PlayDive

PlayDuck

PlayDying (name DamageType, vector HitLoc)


local vector X,Y,Z, HitVec, HitVec2D;
local float dotp;


if ( Velocity.Z > 250 )
{
PlayBigDeath(DamageType);
return;
}

if ( DamageType == 'Decapitated' )
{
PlayHeadDeath(DamageType);
return;
}

GetAxes(Rotation,X,Y,Z);
X.Z = 0;
HitVec = Normal(HitLoc - Location);
HitVec2D= HitVec;
HitVec2D.Z = 0;
dotp = HitVec2D dot X;

//first check for head hit
if ( HitLoc.Z - Location.Z > 0.5 * CollisionHeight )
{
if (dotp > 0)
PlayHeadDeath(DamageType);
else
PlayGutDeath(DamageType);
return;
}

if (dotp > 0.71) //then hit in front
PlayGutDeath(DamageType);
else
{
dotp = HitVec dot Y;
if (dotp > 0.0)
PlayLeftDeath(DamageType);
else
PlayRightDeath(DamageType);
}

PlayFiring

PlayGutDeath (name DamageType)

PlayGutHit (float tweentime)


log("Error - play gut hit must be implemented in subclass of"@class);

PlayHeadDeath (name DamageType)

PlayHeadHit (float tweentime)


PlayGutHit(tweentime);

PlayHit (float Damage, vector HitLocation, name damageType, vector Momentum)

PlayInAir

PlayLanded (float impactVel)


local float landVol;

//default - do nothing (keep playing existing animation)
landVol = impactVel/JumpZ;
landVol = 0.005 * Mass * landVol * landVol;
PlaySound(Land, SLOT_Interact, FMin(20, landVol));

PlayLeftDeath (name DamageType)

PlayLeftHit (float tweentime)


PlayGutHit(tweentime);

PlayMovingAttack


////log("Error - PlayMovingAttack should be implemented in subclass");
//Note - must restart attack timer when done with moving attack
PlayRunning();

PlayOutOfWater


TweenToFalling();

PlayPatrolStop


PlayWaiting();

PlayRecoil (float Rate)

PlayRightDeath (name DamageType)

PlayRightHit (float tweentime)


PlayGutHit(tweentime);

PlayRunning


////log("Error - PlayRunning should be implemented in subclass of"@class);

PlayTakeHit (float tweentime, vector HitLoc, int damage)


local vector X,Y,Z, HitVec, HitVec2D;
local float dotp;


GetAxes(Rotation,X,Y,Z);
X.Z = 0;
HitVec = Normal(HitLoc - Location);
HitVec2D= HitVec;
HitVec2D.Z = 0;
dotp = HitVec2D dot X;

//first check for head hit
if ( HitLoc.Z - Location.Z > 0.5 * CollisionHeight )
{
if (dotp > 0)
PlayHeadHit(tweentime);
else
PlayGutHit(tweentime);
return;
}

if (dotp > 0.71) //then hit in front
PlayGutHit( tweentime);
else if (dotp < -0.71) // then hit in back
PlayHeadHit(tweentime);
else
{
dotp = HitVec dot Y;
if (dotp > 0.0)
PlayLeftHit(tweentime);
else
PlayRightHit(tweentime);
}

PlayTakeHitSound (int Damage, name damageType, int Mult)


if ( Level.TimeSeconds - LastPainSound < 0.25 )
return;

if (HitSound1 == None)return;
LastPainSound = Level.TimeSeconds;
if (FRand() < 0.5)
PlaySound(HitSound1, SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0));
else
PlaySound(HitSound2, SLOT_Pain, FMax(Mult * TransientSoundVolume, Mult * 2.0));

PlayThreatening


TweenToFighter(0.1);

PlayTurnHead (ELookDirection dir, float rate, float tweentime) -> bool


local name lookName;
local bool bSuccess;


if (dir == LOOK_Left)
lookName = 'HeadLeft';
else if (dir == LOOK_Right)
lookName = 'HeadRight';
else if (dir == LOOK_Up)
lookName = 'HeadUp';
else if (dir == LOOK_Down)
lookName = 'HeadDown';
else
lookName = 'Still';

bSuccess = false;
if (BlendAnimSequence[3] != lookName)
{
if (animTimer[1] > 0.00)
{
animTimer[1] = 0;
if (BlendAnimSequence[3] == '')
BlendAnimSequence[3] = 'Still';
PlayBlendAnim(lookName, rate, tweentime, 3);
bSuccess = true;
}
}

return (bSuccess);

PlayTurning


TweenToFighter(0.1);

PlayVictoryDance


TweenToFighter(0.1);

PlayWaiting


////log("Error - PlayWaiting should be implemented in subclass");

PlayWaitingAmbush


PlayWaiting();

PlayWalking


PlayRunning();

PlayWeaponSwitch (Weapon NewWeapon)

PlayerTimeOut


if (Health > 0)
Died(None, 'Suicided', Location);

PostBeginPlay


Super.PostBeginPlay();
SplashTime = 0;

PostNetBeginPlay


local pawn CurPawn;
local bool bAlreadyAdded;


Super.PostNetBeginPlay();
bAlreadyAdded = false;
for (CurPawn = Level.PawnList; CurPawn != None; CurPawn = CurPawn.NextPawn)
{
if (CurPawn == Self)
{
bAlreadyAdded = true;
break;
}
}
if (!bAlreadyAdded)
{
AddPawn();
}
return;

PreBeginPlay


AddPawn();
Super.PreBeginPlay();
if ( bDeleteMe )
return;

// Added angular size computation - DEUS_EX STM
MinAngularSize = tan(AngularResolution*0.5*Pi/180.0);
MinAngularSize *= MinAngularSize;

// Set instigator to self.
Instigator = Self;
DesiredRotation = Rotation;
SightCounter = 0.2 * FRand(); //offset randomly
if ( Level.Game != None )
Skill += Level.Game.Difficulty;
Skill = FClamp(Skill, 0, 3);
PreSetMovement();

if ( DrawScale != Default.Drawscale )
{
SetCollisionSize(CollisionRadius*DrawScale/Default.DrawScale, CollisionHeight*DrawScale/Default.DrawScale);
Health = Health * DrawScale/Default.DrawScale;
}

if (bIsPlayer)
{
if (PlayerReplicationInfoClass != None)
PlayerReplicationInfo = Spawn(PlayerReplicationInfoClass, Self,,vect(0,0,0),rot(0,0,0));
else
PlayerReplicationInfo = Spawn(class'PlayerReplicationInfo', Self,,vect(0,0,0),rot(0,0,0));
InitPlayerReplicationInfo();
}

if (!bIsPlayer)
{
if ( BaseEyeHeight == 0 )
BaseEyeHeight = 0.8 * CollisionHeight;
EyeHeight = BaseEyeHeight;
if (Fatness == 0) //vary monster fatness slightly if at default
Fatness = 120 + Rand(8) + Rand(8);
}

if ( menuname == "" )
menuname = GetItemName(string(class));

if (SelectionMesh == "")
SelectionMesh = string(Mesh);

PreSetMovement


if (JumpZ > 0)
bCanJump = true;
bCanWalk = true;
bCanSwim = false;
bCanFly = false;
MinHitWall = -0.6;
if (Intelligence > BRAINS_Reptile)
bCanOpenDoors = true;
if (Intelligence == BRAINS_Human)
bCanDoSpecial = true;

ReceiveLocalizedMessage (class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)

RemovePawn | native

RenderOverlays (canvas Canvas)


if ( Weapon != None )
Weapon.RenderOverlays(Canvas);

RestartPlayer

SeePlayer (actor Seen)

SendGlobalMessage (PlayerReplicationInfo Recipient, name MessageType, byte MessageID, float Wait)


SendVoiceMessage(PlayerReplicationInfo, Recipient, MessageType, MessageID, 'GLOBAL');

SendTeamMessage (PlayerReplicationInfo Recipient, name MessageType, byte MessageID, float Wait)


SendVoiceMessage(PlayerReplicationInfo, Recipient, MessageType, MessageID, 'TEAM');

SendVoiceMessage (PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID, name broadcasttype)


local Pawn P;
local bool bNoSpeak;


if ( Level.TimeSeconds - OldMessageTime < 2.5 )
bNoSpeak = true;
else
OldMessageTime = Level.TimeSeconds;

for ( P=Level.PawnList; P!=None; P=P.NextPawn )
{
if ( P.IsA('PlayerPawn') )
{
if ( !bNoSpeak )
{
if ( (broadcasttype == 'GLOBAL') || !Level.Game.bTeamGame )
P.ClientVoiceMessage(Sender, Recipient, messagetype, messageID);
else if ( Sender.Team == P.PlayerReplicationInfo.Team )
P.ClientVoiceMessage(Sender, Recipient, messagetype, messageID);
}
}
else if ( (P.PlayerReplicationInfo == Recipient) || ((messagetype == 'ORDER') && (Recipient == None)) )
P.BotVoiceMessage(messagetype, messageID, self);
}

SetDefaultDisplayProperties


Style = Default.Style;
texture = Default.Texture;
bUnlit = Default.bUnlit;
bMeshEnviromap = Default.bMeshEnviromap;
if ( Weapon != None )
Weapon.SetDisplayProperties(Weapon.Default.Style, Weapon.Default.Texture, Weapon.Default.bUnlit, Weapon.Default.bMeshEnviromap);

if ( !bUpdatingDisplay && (Inventory != None) )
{
bUpdatingDisplay = true;
Inventory.SetOwnerDisplay();
}
bUpdatingDisplay = false;

SetDisplayProperties (ERenderStyle NewStyle, texture NewTexture, bool bLighting, bool bEnviroMap)


Style = NewStyle;
texture = NewTexture;
bUnlit = bLighting;
bMeshEnviromap = bEnviromap;
if ( Weapon != None )
Weapon.SetDisplayProperties(Style, Texture, bUnlit, bMeshEnviromap);

if ( !bUpdatingDisplay && (Inventory != None) )
{
bUpdatingDisplay = true;
Inventory.SetOwnerDisplay();
}
bUpdatingDisplay = false;

SetMovementPhysics


//implemented in sub-class

SetMultiSkin (actor SkinActor, string SkinName, string FaceName, byte TeamNum)


local Texture NewSkin;


if(SkinName != "")
{
NewSkin = texture(DynamicLoadObject(SkinName, class'Texture'));
if ( NewSkin != None )
SkinActor.Skin = NewSkin;
}

SetSkinElement (Actor SkinActor, int SkinNo, string SkinName, string DefaultSkinName) -> bool


local Texture NewSkin;


NewSkin = Texture(DynamicLoadObject(SkinName, class'Texture'));
if ( NewSkin != None )
{
SkinActor.Multiskins[SkinNo] = NewSkin;
return True;
}
else
{
log("Failed to load "$SkinName);
if(DefaultSkinName != "")
{
NewSkin = Texture(DynamicLoadObject(DefaultSkinName, class'Texture'));
SkinActor.Multiskins[SkinNo] = NewSkin;
}
return False;
}

ShakeView (float shaketime, float RollMag, float vertmag)

SpawnCarcass -> Carcass


log(self$" should never call base spawncarcass");
return None;

SpawnGibbedCarcass

SpecialFire

SpeechTimer

StopFiring

StopWaiting | native

SwitchToBestWeapon -> bool


local float rating;
local int usealt;


if ( Inventory == None )
return false;

PendingWeapon = Inventory.RecommendWeapon(rating, usealt);
if ( PendingWeapon == Weapon )
PendingWeapon = None;
if ( PendingWeapon == None )
return false;

if ( Weapon == None )
ChangedWeapon();
if ( Weapon != PendingWeapon )
Weapon.PutDown();

return (usealt > 0);

TakeFallingDamage


if (Velocity.Z < -1.4 * JumpZ)
{
MakeNoise(-0.5 * Velocity.Z/(FMax(JumpZ, 150.0)));
if (Velocity.Z <= -750 - JumpZ)
{
if ( (Velocity.Z < -1650 - JumpZ) && (ReducedDamageType != 'All') )
TakeDamage(1000, None, Location, vect(0,0,0), 'Fell');
else if ( Role == ROLE_Authority )
TakeDamage(-0.15 * (Velocity.Z + 700 + JumpZ), None, Location, vect(0,0,0), 'Fell');
ShakeView(0.175 - 0.00007 * Velocity.Z, -0.85 * Velocity.Z, -0.002 * Velocity.Z);
}
}
else if ( Velocity.Z > 0.5 * Default.JumpZ )
MakeNoise(0.35);

TeamBroadcast (coerce string Msg)


local Pawn P;
local bool bGlobal;


if ( Left(Msg, 1) ~= "@" )
{
Msg = Right(Msg, Len(Msg)-1);
bGlobal = true;
}

if ( Left(Msg, 1) ~= "." )
Msg = "."$VoicePitch$Msg;

if ( bGlobal || !Level.Game.bTeamGame )
{
if ( Level.Game.AllowsBroadcast(self, Len(Msg)) )
for( P=Level.PawnList; P!=None; P=P.nextPawn )
if( P.bIsPlayer || P.IsA('MessagingSpectator') )
P.TeamMessage( PlayerReplicationInfo, Msg, 'Say' );
return;
}

if ( Level.Game.AllowsBroadcast(self, Len(Msg)) )
for( P=Level.PawnList; P!=None; P=P.nextPawn )
if( P.bIsPlayer && (P.PlayerReplicationInfo.Team == PlayerReplicationInfo.Team) )
{
if ( P.IsA('PlayerPawn') )
P.TeamMessage( PlayerReplicationInfo, Msg, 'TeamSay' );
}

TeamMessage (PlayerReplicationInfo PRI, coerce string S, name Type, optional bool bBeep)

Timer


if ( !bHidden )
{
bHidden = true;
SpawnCarcass();
if ( bIsPlayer )
HidePlayer();
else
Destroy();
}

TossWeapon


local vector X,Y,Z;

if ( Weapon == None )
return;
GetAxes(Rotation,X,Y,Z);
Weapon.DropFrom(Location + 0.8 * CollisionRadius * X + - 0.5 * CollisionRadius * Y);

TraceShot (out vector HitLocation, out vector HitNormal, vector EndTrace, vector StartTrace) -> actor


local vector realHit;
local actor Other;

Other = Trace(HitLocation,HitNormal,EndTrace,StartTrace,True);
if ( Pawn(Other) != None )
{
realHit = HitLocation;
if ( !Pawn(Other).AdjustHitLocation(HitLocation, EndTrace - StartTrace) )
Other = Pawn(Other).TraceShot(HitLocation,HitNormal,EndTrace,realHit);
}
return Other;

TurnTo (vector NewFocus) | native

TurnToward (actor NewTarget) | native

TweenToFalling

TweenToFighter (float tweentime)

TweenToPatrolStop (float tweentime)


TweenToFighter(tweentime);

TweenToRunning (float tweentime)


TweenToFighter(0.1);

TweenToSwimming (float tweentime)

TweenToWaiting (float tweentime)


TweenToFighter(tweentime);

TweenToWalking (float tweentime)


TweenToRunning(tweentime);

UnderLift (Mover M)

UpdateEyeHeight (float DeltaTime)

WaitForLanding | native

WalkTexture (texture Texture, vector StepLocation, vector StepNormal)

WarnTarget (Pawn shooter, float projSpeed, vector FireDir)


// AI controlled creatures may duck
// if not falling, and projectile time is long enough
// often pick opposite to current direction (relative to shooter axis)

actorReachable (actor anActor) | native

damageAttitudeTo (pawn Other)

gibbedBy (actor Other)


local pawn instigatedBy;


instigatedBy = pawn(Other);
if (instigatedBy == None)
instigatedBy = Other.instigator;
health = -1000; //make sure gibs
Died(instigatedBy, 'Gibbed', Location);

pointReachable (vector aPoint) | native




Pickup.uc (extends Inventory)

var inventory Inv;
var travel int NumCopies;
var() bool bCanHaveMultipleCopies; // if player can possess more than one of this
var() bool bCanActivate; // Item can be selected and activated
var() localized String ExpireMessage; // Messages shown when pickup charge runs out
var() bool bAutoActivate;
bRotatingPickup=False

Activate


if ( (Pawn(Owner) != None) && Pawn(Owner).bAutoActivate
&& bAutoActivate && (Charge>0) )
return;

Super.Activate();

BeginState


Super.BeginState();

// NumCopies = 1 means we have ONE of this item now
// DEUS_EX AJY

// NumCopies = 0;

Frob (Actor Other, Inventory frobWith)

/ function Touch( actor Other

HandlePickupQuery (inventory Item) -> bool


if (item.class == class)
{
if (bCanHaveMultipleCopies)
{ // for items like Artifact
NumCopies++;
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogPickup(Item, Pawn(Owner));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogPickup(Item, Pawn(Owner));
if ( Item.PickupMessageClass == None )
// DEUS_EX CNN - use the itemArticle and itemName
// Pawn(Owner).ClientMessage(item.PickupMessage, 'Pickup');
Pawn(Owner).ClientMessage(item.PickupMessage @ item.itemArticle @ item.itemName, 'Pickup');
else
Pawn(Owner).ReceiveLocalizedMessage( item.PickupMessageClass, 0, None, None, item.Class );
Item.PlaySound (Item.PickupSound,,2.0);
Item.SetRespawn();
}
/* DEUS_EX AJY
else if ( bDisplayableInv )
{
if ( Charge Charge= Item.Charge;
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogPickup(Item, Pawn(Owner));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogPickup(Item, Pawn(Owner));
if ( Item.PickupMessageClass == None )
Pawn(Owner).ClientMessage(item.PickupMessage, 'Pickup');
else
Pawn(Owner).ReceiveLocalizedMessage( item.PickupMessageClass, 0, None, None, item.Class );
Item.PlaySound (item.PickupSound,,2.0);
Item.SetReSpawn();
}
*/
else if ( bDisplayableInv )
return false;

return true;

PickupFunction (Pawn Other)

SetRespawn


if( Level.Game.ShouldRespawn(self) )
{
GotoState('Sleeping');
}
else
{
//because of latent destroy, we just need to make sure num copies is 0 and then
//you at least won't be able to doublefrob.
NumCopies = 0;
Destroy();
}

SpawnCopy (pawn Other) -> inventory


local inventory Copy;


Copy = Super.SpawnCopy(Other);
Copy.Charge = Charge;
return Copy;

TravelPostAccept


Super.TravelPostAccept();
PickupFunction(Pawn(Owner));

UseCharge (float Amount) -> float

UsedUp


if ( Pawn(Owner) != None )
{
bActivatable = false;
Pawn(Owner).NextItem();
if (Pawn(Owner).SelectedItem == Self) {
Pawn(Owner).NextItem();
if (Pawn(Owner).SelectedItem == Self) Pawn(Owner).SelectedItem=None;
}
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogItemDeactivate(Self, Pawn(Owner));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogItemDeactivate(Self, Pawn(Owner));
if ( ItemMessageClass != None )
Pawn(Owner).ReceiveLocalizedMessage( ItemMessageClass, 0, None, None, Self.Class );
else
Pawn(Owner).ClientMessage(ExpireMessage);




Player.uc (extends Object)

var native const int vfOut;
var native const int vfExec;
var transient const playerpawn Actor;
var transient const console Console;
var transient const bool bWindowsMouseAvailable;
var bool bShowWindowsMouse;
var bool bSuspendPrecaching;
var transient const float WindowsMouseX;
var transient const float WindowsMouseY;
var int CurrentNetSpeed;
var globalconfig int ConfiguredInternetSpeed, ConfiguredLanSpeed;
var float StaticUpdateInterval, DynamicUpdateInterval;
var byte SelectedCursor;
ConfiguredInternetSpeed=2600
ConfiguredLanSpeed=20000



PlayerPawn.uc (extends Pawn)

var const player Player;
var(Movement) globalconfig float DodgeClickTime;
var(Movement) globalconfig float Bob;
var float bobtime;
var int ShowFlags;
var int RendMap;
var int Misc1;
var int Misc2;
var actor ViewTarget;
var vector FlashScale, FlashFog;
var HUD myHUD;
var ScoreBoard Scoring;
var class HUDType;
var class ScoringType;
var float DesiredFlashScale, ConstantGlowScale, InstantFlash;
var vector DesiredFlashFog, ConstantGlowFog, InstantFog;
var globalconfig float DesiredFOV;
var globalconfig float DefaultFOV;
var music Song;
var byte SongSection;
var byte CdTrack;
var EMusicTransition Transition;
var float shaketimer; // player uses this for shaking view
var int shakemag; // max magnitude in degrees of shaking
var float shakevert; // max vertical shake magnitude
var float maxshake;
var float verttimer;
var(Pawn) class CarcassType;
var travel float MyAutoAim;
var travel globalconfig float Handedness;
var(Sounds) sound JumpSound;
var bool bAdmin;
var() globalconfig bool bLookUpStairs; // look up/down stairs (player)
var() globalconfig bool bSnapToLevel; // Snap to level eyeheight when not mouselooking
var() globalconfig bool bAlwaysMouseLook;
var globalconfig bool bKeyboardLook; // no snapping when true
var bool bWasForward; // used for dodge move
var bool bWasBack;
var bool bWasLeft;
var bool bWasRight;
var bool bEdgeForward;
var bool bEdgeBack;
var bool bEdgeLeft;
var bool bEdgeRight;
var bool bIsCrouching;
var bool bAnimTransition;
var bool bIsTurning;
var bool bFrozen;
var bool bBadConnectionAlert;
var globalconfig bool bInvertMouse;
var bool bShowScores;
var bool bShowMenu;
var bool bSpecialMenu;
var bool bWokeUp;
var bool bPressedJump;
var bool bUpdatePosition;
var bool bDelayedCommand;
var bool bRising;
var bool bReducedVis;
var bool bCenterView;
var() globalconfig bool bMaxMouseSmoothing;
var bool bMouseZeroed;
var bool bReadyToPlay;
var bool bNoFlash;
var globalconfig bool bNoVoices;
var globalconfig bool bMessageBeep;
var bool bZooming;
var() bool bSinglePlayer; // this class allowed in single player
var bool bJustFired;
var bool bJustAltFired;
var bool bIsTyping;
var bool bFixedCamera;
var globalconfig bool bNeverAutoSwitch; // if true, don't automatically switch to picked up weapon
var bool bJumpStatus; // used in net games
var bool bCheatsEnabled; // DEUS_EX STM - added globalconfig (CNN - removed for command line cheats)
var float ZoomLevel;
var const Actor AdditionalViews[3]; // If the pawn can see from the point of view of any additional actors.
var class SpecialMenu;
var string DelayedCommand;
var globalconfig float MouseSensitivity;
var globalconfig name WeaponPriority[20]; //weapon class priorities (9 is highest)
var float SmoothMouseX, SmoothMouseY, BorrowedMouseX, BorrowedMouseY;
var() globalconfig float MouseSmoothThreshold;
var float MouseZeroTime;
var input float
var SavedMove SavedMoves;
var SavedMove FreeMoves;
var SavedMove PendingMove;
var float CurrentTimeStamp,LastUpdateTime,ServerTimeStamp,TimeMargin, ClientUpdateTime;
var globalconfig float MaxTimeMargin;
var string ProgressMessage[8];
var color ProgressColor[8];
var float ProgressTimeOut;
var localized string QuickSaveString;
var localized string NoPauseMessage;
var localized string ViewingFrom;
var localized string OwnCamera;
var localized string FailedView;
var GameReplicationInfo GameReplicationInfo;
var() globalconfig string ngWorldSecret;
var() globalconfig bool ngSecretSet;
var rotator TargetViewRotation;
var float TargetEyeHeight;
var vector TargetWeaponViewOffset;
var int DemoViewPitch;
var int DemoViewYaw;
var float LastPlaySound;
var float TurnRateAdjuster;
Password="momsblend"
DodgeClickTime=0.100000
FlashScale=(X=1.000000,Y=1.000000,Z=1.000000)
DesiredFOV=90.000000
DefaultFOV=90.000000
CdTrack=255
MyAutoAim=1.000000
Handedness=-1.000000
bAlwaysMouseLook=True
bKeyboardLook=True
bNoFlash=True
bMessageBeep=True
MouseSensitivity=3.000000
WeaponPriority(0)=WeaponEMPGrenade
WeaponPriority(1)=WeaponGasGrenade
WeaponPriority(2)=WeaponLAM
WeaponPriority(3)=CBPWeaponRifle
WeaponPriority(4)=NailGun
WeaponPriority(5)=WeaponDesertEagle
MouseSmoothThreshold=0.160000
MaxTimeMargin=1.000000
QuickSaveString="Quick Saving"
NoPauseMessage="Game is not pauseable"
ViewingFrom="Now viewing from"
OwnCamera="own camera"
FailedView="Failed to change view."
TurnRateAdjuster=1.000000
bIsPlayer=True
bCanJump=True
bViewTarget=True
DesiredSpeed=0.300000
SightRadius=4100.000000
bTravel=True
bStasis=False
NetPriority=3.000000

ActivateHint


if ( bShowMenu || Level.Pauser!="" )
return;
If (Inventory!=None) Inventory.ActivateTranslator(True);

ActivateItem


if( bShowMenu || Level.Pauser!="" )
return;
if (SelectedItem!=None)
SelectedItem.Activate();

ActivateTranslator


if ( bShowMenu || Level.Pauser!="" )
return;
If (Inventory!=None) Inventory.ActivateTranslator(False);

AddBots (int N)


ServerAddBots(N);

AdjustAim (float projSpeed, vector projStart, int aimerror, bool bLeadTarget, bool bWarnTarget) -> rotator


local vector FireDir, AimSpot, HitNormal, HitLocation;
local actor BestTarget;
local float bestAim, bestDist;
local actor HitActor;


FireDir = vector(ViewRotation);
HitActor = Trace(HitLocation, HitNormal, projStart + 4000 * FireDir, projStart, true);
if ( (HitActor != None) && HitActor.bProjTarget )
{
if ( bWarnTarget && HitActor.IsA('Pawn') )
Pawn(HitActor).WarnTarget(self, projSpeed, FireDir);
return ViewRotation;
}

bestAim = FMin(0.93, MyAutoAim);
BestTarget = PickTarget(bestAim, bestDist, FireDir, projStart);

if ( bWarnTarget && (Pawn(BestTarget) != None) )
Pawn(BestTarget).WarnTarget(self, projSpeed, FireDir);

if ( (Level.NetMode != NM_Standalone) || (Level.Game.Difficulty > 2)
|| bAlwaysMouseLook || ((BestTarget != None) && (bestAim < MyAutoAim)) || (MyAutoAim >= 1) )
return ViewRotation;

if ( BestTarget == None )
{
bestAim = MyAutoAim;
BestTarget = PickAnyTarget(bestAim, bestDist, FireDir, projStart);
if ( BestTarget == None )
return ViewRotation;
}

AimSpot = projStart + FireDir * bestDist;
AimSpot.Z = BestTarget.Location.Z + 0.3 * BestTarget.CollisionHeight;

return rotator(AimSpot - projStart);

AdjustHitLocation (out vector HitLocation, vector TraceDir) -> bool


local float adjZ, maxZ, scale;
local Vector adjTraceDir;


if ( Level.NetMode != NM_Standalone )
{
TraceDir = Normal(TraceDir);
AdjTraceDir = TraceDir;
AdjTraceDir.Z = 0.0;
AdjTraceDir = Normal(AdjTraceDir);
scale = TraceDir dot AdjTraceDir;
HitLocation = HitLocation + ( CollisionRadius * 0.60 * TraceDir ) / scale;
if ( BaseEyeHeight == Default.BaseEyeHeight )
return true;

maxZ = Location.Z + EyeHeight + 0.25 * CollisionHeight;
if ( HitLocation.Z > maxZ )
{
if ( TraceDir.Z >= 0 )
return false;
adjZ = (maxZ - HitLocation.Z)/TraceDir.Z;
HitLocation.Z = maxZ;
HitLocation.X = HitLocation.X + TraceDir.X * adjZ;
HitLocation.Y = HitLocation.Y + TraceDir.Y * adjZ;
if ( VSize(HitLocation - Location) > CollisionRadius )
return false;
}
}
else
{
TraceDir = Normal(TraceDir);
HitLocation = HitLocation + 0.5 * CollisionRadius * TraceDir;
if ( BaseEyeHeight == Default.BaseEyeHeight )
return true;
maxZ = Location.Z + EyeHeight + 0.25 * CollisionHeight;
if ( HitLocation.Z > maxZ )
{
if ( TraceDir.Z >= 0 )
return false;
adjZ = (maxZ - HitLocation.Z)/TraceDir.Z;
HitLocation.Z = maxZ;
HitLocation.X = HitLocation.X + TraceDir.X * adjZ;
HitLocation.Y = HitLocation.Y + TraceDir.Y * adjZ;
if ( VSize(HitLocation - Location) > CollisionRadius )
return false;
}
}
return true;

Admin (string CommandLine)


local string Result;

if( bAdmin )
Result = ConsoleCommand( CommandLine );
if( Result!="" )
ClientMessage( Result );

AdminLogin (string Password)


Level.Game.AdminLogin( Self, Password );

AdminLogout


Level.Game.AdminLogout( Self );

AllAmmo


local Inventory Inv;


if( !bCheatsEnabled )
return;

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

// DEUS_EX CNN - make this be limited by the MaxAmmo per ammo instead of 999
for( Inv=Inventory; Inv!=None; Inv=Inv.Inventory )
if (Ammo(Inv)!=None)
Ammo(Inv).AmmoAmount = Ammo(Inv).MaxAmmo;

AltFire (optional float F)


Fire(F);

AlwaysMouseLook (Bool B)


ChangeAlwaysMouseLook(B);
SaveConfig();

Amphibious


if( !bCheatsEnabled )
return;

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

AnimEnd


PlaySwimming();

AttitudeTo (Pawn Other) -> eAttitude


if (Other.bIsPlayer)
return AttitudeToPlayer;
else
return Other.AttitudeToPlayer;

BeginState


EndZoom();
AnimRate = 0.0;
SimAnim.Y = 0;
bFire = 0;
bAltFire = 0;
SetCollision(false,false,false);
bShowScores = true;
bFrozen = true;
if ( !bFixedCamera )
{
FindGoodView();
bBehindView = true;
}
SetTimer(1.5, false);
SetPhysics(PHYS_None);

BehindView (Bool B)


// DEUS_EX CNN - This needs to be here!
if (!bCheatsEnabled)
return;

bBehindView = B;

CalcBehindView (out vector CameraLocation, out rotator CameraRotation, float Dist)


local vector View,HitLocation,HitNormal;
local float ViewDist;


CameraRotation = ViewRotation;
View = vect(1,0,0) >> CameraRotation;
if( Trace( HitLocation, HitNormal, CameraLocation - (Dist + 30) * vector(CameraRotation), CameraLocation ) != None )
ViewDist = FMin( (CameraLocation - HitLocation) Dot View, Dist );
else
ViewDist = Dist;
CameraLocation -= (ViewDist - 30) * View;

CallForHelp


local Pawn P;


if ( !Level.Game.bTeamGame || (Enemy == None) || (Enemy.Health <= 0) )
return;

for ( P=Level.PawnList; P!=None; P=P.NextPawn )
if ( P.bIsPlayer && (P.PlayerReplicationInfo.Team == PlayerReplicationInfo.Team) )
P.HandleHelpMessageFrom(self);

CauseEvent (name N)


local actor A;

if( !bCheatsEnabled )
return;
if( (bAdmin || (Level.Netmode == NM_Standalone)) && (N != '') )
foreach AllActors( class 'Actor', A, N )
A.Trigger( Self, Self );

ChangeAlwaysMouseLook (Bool B)


bAlwaysMouseLook = B;
if ( bAlwaysMouseLook )
bLookUpStairs = false;

ChangeAutoAim (float F)


MyAutoAim = FMax(Level.Game.AutoAim, F);

ChangeCrosshair


if ( myHud != None )
myHUD.ChangeCrosshair(1);
myHUD.SaveConfig();

ChangeDodgeClickTime (float F)


DodgeClickTime = FMin(0.3, F);

ChangeHud


if ( myHud != None )
myHUD.ChangeHud(1);
myHUD.SaveConfig();

ChangeName (coerce string S)


Level.Game.ChangeName( self, S, false );

ChangeSetHand (string S)


if ( S ~= "Left" )
Handedness = 1;
else if ( S~= "Right" )
Handedness = -1;
else if ( S ~= "Center" )
Handedness = 0;
else if ( S ~= "Hidden" )
Handedness = 2;
ServerSetHandedness(Handedness);

ChangeSnapView (bool B)


bSnapToLevel = B;

ChangeStairLook (bool B)


bLookUpStairs = B;
if ( bLookUpStairs )
bAlwaysMouseLook = false;

ChangeTeam (int N)


Level.Game.ChangeTeam(self, N);

ChangedWeapon


Weapon = None;
Inventory.ChangedWeapon();

CheckBob (float DeltaTime, float Speed2D, vector Y)


local float OldBobTime;


OldBobTime = BobTime;
if ( Speed2D < 10 )
BobTime += 0.2 * DeltaTime;
else
BobTime += DeltaTime * (0.3 + 0.7 * Speed2D/GroundSpeed);
WalkBob = Y * 0.65 * Bob * Speed2D * sin(6 * BobTime);
AppliedBob = AppliedBob * (1 - FMin(1, 16 * deltatime));
if ( LandBob > 0.01 )
{
AppliedBob += FMin(1, 16 * deltatime) * LandBob;
LandBob *= (1 - 8*Deltatime);
}
if ( Speed2D < 10 )
WalkBob.Z = 0; // AppliedBob + Bob * 30 * sin(12 * BobTime); // take out the "breathe" effect - DEUS_EX CNN
else
WalkBob.Z = AppliedBob + Bob * Speed2D * sin(12 * BobTime);

ClearProgressMessages


local int i;


for (i=0; i<8; i++)
{
ProgressMessage[i] = "";
ProgressColor[i].R = 255;
ProgressColor[i].G = 255;
ProgressColor[i].B = 255;
}

ClientAdjustGlow (float scale, vector fog)


ConstantGlowScale += scale;
ConstantGlowFog += 0.001 * fog;

ClientChangeTeam (int N)


local Pawn P;


if ( PlayerReplicationInfo != None )
PlayerReplicationInfo.Team = N;

// if listen server, this may be called for non-local players that are logging in
// if so, don't update URL
if ( (Level.NetMode == NM_ListenServer) && (Player == None) )
{
// check if any other players exist
for ( P=Level.PawnList; P!=None; P=P.NextPawn )
if ( P.IsA('PlayerPawn') && (ViewPort(PlayerPawn(P).Player) != None) )
return;
}

UpdateURL("Team",string(N), true);

ClientFlash (float scale, vector fog)


DesiredFlashScale = scale;
DesiredFlashFog = 0.001 * fog;

ClientInstantFlash (float scale, vector fog)


InstantFlash = scale;
InstantFog = 0.001 * fog;

ClientMessage (coerce string S, optional Name Type, optional bool bBeep)


if (Player == None)
return;

if (Type == '')
Type = 'Event';

if (Player.Console != None)
Player.Console.Message( PlayerReplicationInfo, S, Type );

if (bBeep && bMessageBeep)
PlayBeepSound();
if ( myHUD != None )
myHUD.Message( PlayerReplicationInfo, S, Type );

ClientPlaySound (sound ASound, optional bool bInterrupt, optional bool bVolumeControl)


local actor SoundPlayer;


LastPlaySound = Level.TimeSeconds; // so voice messages won't overlap
if ( ViewTarget != None )
SoundPlayer = ViewTarget;
else
SoundPlayer = self;

SoundPlayer.PlaySound(ASound, SLOT_None, 16.0, bInterrupt);
SoundPlayer.PlaySound(ASound, SLOT_Interface, 16.0, bInterrupt);
SoundPlayer.PlaySound(ASound, SLOT_Misc, 16.0, bInterrupt);
SoundPlayer.PlaySound(ASound, SLOT_Talk, 16.0, bInterrupt);

ClientReliablePlaySound (sound ASound, optional bool bInterrupt, optional bool bVolumeControl)


ClientPlaySound(ASound, bInterrupt, bVolumeControl);

ClientReplicateSkins (texture Skin1, optional texture Skin2, optional texture Skin3, optional texture Skin4)


// do nothing (just loading other player skins onto client)
log("Getting "$Skin1$", "$Skin2$", "$Skin3$", "$Skin4);
return;

ClientSetMusic (music NewSong, byte NewSection, byte NewCdTrack, EMusicTransition NewTransition)


Song = NewSong;
SongSection = NewSection;
CdTrack = NewCdTrack;
Transition = NewTransition;

ClientShake (vector shake)


if ( (shakemag < shake.X) || (shaketimer <= 0.01 * shake.Y) )
{
shakemag = shake.X;
shaketimer = 0.01 * shake.Y;
maxshake = 0.01 * shake.Z;
verttimer = 0;
ShakeVert = -1.1 * maxshake;
}

ClientTravel (string URL, ETravelType TravelType, bool bItems) | native

ClientUpdatePosition


local SavedMove CurrentMove;
local int realbRun, realbDuck;
local bool bRealJump;
local float AdjPCol, SavedRadius, TotalTime;
local pawn SavedPawn, P;
local vector Dist;



bUpdatePosition = false;
realbRun= bRun;
realbDuck = bDuck;
bRealJump = bPressedJump;
CurrentMove = SavedMoves;
bUpdating = true;
while ( CurrentMove != None )
{
if ( CurrentMove.TimeStamp <= CurrentTimeStamp )
{
SavedMoves = CurrentMove.NextMove;
CurrentMove.NextMove = FreeMoves;
FreeMoves = CurrentMove;
FreeMoves.Clear();
CurrentMove = SavedMoves;
}
else
{
// adjust radius of nearby players with uncertain location
if ( TotalTime > 0 )
// XXXDEUS_EX AMSD Slow Pawn Iterator
//ForEach AllActors(class'Pawn', P)
for (p = Level.PawnList; p != None; p = p.NextPawn)
if ( (P != self) && (P.Velocity != vect(0,0,0)) && P.bBlockPlayers )
{
Dist = P.Location - Location;
AdjPCol = 0.0004 * PlayerReplicationInfo.Ping * ((P.Velocity - Velocity) Dot Normal(Dist));
if ( VSize(Dist) < AdjPCol + P.CollisionRadius + CollisionRadius + CurrentMove.Delta * GroundSpeed * (Normal(Velocity) Dot Normal(Dist)) )
{
SavedPawn = P;
SavedRadius = P.CollisionRadius;
Dist.Z = 0;
P.SetCollisionSize(FClamp(AdjPCol + P.CollisionRadius, 0.5 * P.CollisionRadius, VSize(Dist) - CollisionRadius - P.CollisionRadius), P.CollisionHeight);
break;
}
}
TotalTime += CurrentMove.Delta;
MoveAutonomous(CurrentMove.Delta, CurrentMove.bRun, CurrentMove.bDuck, CurrentMove.bPressedJump, CurrentMove.DodgeMove, CurrentMove.Acceleration, rot(0,0,0));
CurrentMove = CurrentMove.NextMove;
if ( SavedPawn != None )
{
SavedPawn.SetCollisionSize(SavedRadius, P.CollisionHeight);
SavedPawn = None;
}
}
// DEUS_EX AMSD Must also do the pending move that we've been building up.
if ((CurrentMove == None) && (PendingMove != None))
{
CurrentMove = PendingMove;
PendingMove = None;
}
}
bUpdating = false;
bDuck = realbDuck;
bRun = realbRun;
bPressedJump = bRealJump;
//DEUS_EX AMSD Whenever we adjust our position, we need to reset pending moves as well.
PendingMove = None;
//log("Client adjusted "$self$" stamp "$CurrentTimeStamp$" location "$Location$" dodge "$DodgeDir);

ClientVoiceMessage (PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID)


local VoicePack V;


if ( (Sender.voicetype == None) || (Player.Console == None) )
return;

V = Spawn(Sender.voicetype, self);
if ( V != None )
V.ClientInitialize(Sender, Recipient, messagetype, messageID);

ClientWeaponEvent (name EventType)


if ( Weapon != None )
Weapon.ClientWeaponEvent(EventType);

CompressAccel (int C) -> int


if ( C >= 0 )
C = Min(C, 127);
else
C = Min(abs(C), 127) + 128;
return C;

ConsoleCommand (string Command) -> string | native

CopyToClipboard (string Text) | native

Destroyed


Super.Destroyed();
if ( myHud != None )
myHud.Destroy();
if ( Scoring != None )
Scoring.Destroy();

While ( FreeMoves != None )
{
FreeMoves.Destroy();
FreeMoves = FreeMoves.NextMove;
}

While ( SavedMoves != None )
{
SavedMoves.Destroy();
SavedMoves = SavedMoves.NextMove;
}

Died (pawn Killer, name damageType, vector HitLocation)


StopZoom();

Super.Died(Killer, damageType, HitLocation);

DoJump (optional float F)


if ( CarriedDecoration != None )
return;
if ( !bIsCrouching && (Physics == PHYS_Walking) )
{
if ( !bUpdating )
PlayOwnedSound(JumpSound, SLOT_Talk, 1.5, true, 1200, 1.0 );
if ( (Level.Game != None) && (Level.Game.Difficulty > 0) )
MakeNoise(0.1 * Level.Game.Difficulty);
PlayInAir();
if ( bCountJumps && (Role == ROLE_Authority) && (Inventory != None) )
Inventory.OwnerJumped();
Velocity.Z = JumpZ;
if ( (Base != Level) && (Base != None) )
Velocity.Z += Base.Velocity.Z;
SetPhysics(PHYS_Falling);
}

Dodge (eDodgeDir DodgeMove)


local vector X,Y,Z;


if ( bIsCrouching || (Physics != PHYS_Walking) )
return;

GetAxes(Rotation,X,Y,Z);
if (DodgeMove == DODGE_Forward)
Velocity = 1.5*GroundSpeed*X + (Velocity Dot Y)*Y;
else if (DodgeMove == DODGE_Back)
Velocity = -1.5*GroundSpeed*X + (Velocity Dot Y)*Y;
else if (DodgeMove == DODGE_Left)
Velocity = 1.5*GroundSpeed*Y + (Velocity Dot X)*X;
else if (DodgeMove == DODGE_Right)
Velocity = -1.5*GroundSpeed*Y + (Velocity Dot X)*X;

Velocity.Z = 160;
PlayOwnedSound(JumpSound, SLOT_Talk, 1.0, true, 800, 1.0 );
PlayDodge(DodgeMove);
DodgeDir = DODGE_Active;
SetPhysics(PHYS_Falling);

EndState


// clean out saved moves
while ( SavedMoves != None )
{
SavedMoves.Destroy();
SavedMoves = SavedMoves.NextMove;
}
if ( PendingMove != None )
{
PendingMove.Destroy();
PendingMove = None;
}
Velocity = vect(0,0,0);
Acceleration = vect(0,0,0);
bBehindView = false;
bShowScores = false;
bJustFired = false;
bJustAltFired = false;
bPressedJump = false;
if ( Carcass(ViewTarget) != None )
ViewTarget = None;
//Log(self$" exiting dying with remote role "$RemoteRole$" and role "$Role);

EndZoom


bZooming = false;
DesiredFOV = DefaultFOV;

FOV (float F)


SetDesiredFOV(F);

Falling


//SetPhysics(PHYS_Falling); //Note - physics changes type to PHYS_Falling by default
//log(class$" Falling");
PlayInAir();

FeignDeath


if ( Physics == PHYS_Walking )
{
ServerFeignDeath();
Acceleration = vect(0,0,0);
GotoState('FeigningDeath');
}

FindGoodView


local vector cameraLoc;
local rotator cameraRot;
local int tries, besttry;
local float bestdist, newdist;
local int startYaw;
local actor ViewActor;


ViewRotation.Pitch = 56000;
tries = 0;
besttry = 0;
bestdist = 0.0;
startYaw = ViewRotation.Yaw;

for (tries=0; tries<16; tries++)
{
if ( ViewTarget != None )
cameraLoc = ViewTarget.Location;
else
cameraLoc = Location;
PlayerCalcView(ViewActor, cameraLoc, cameraRot);
newdist = VSize(cameraLoc - Location);
if (newdist > bestdist)
{
bestdist = newdist;
besttry = tries;
}
ViewRotation.Yaw += 4096;
}

ViewRotation.Yaw = startYaw + besttry * 4096;

Fire (optional float F)


if ( Role < ROLE_Authority)
return;
if ( !bFrozen )
ServerReStartGame();
else if ( TimerRate <= 0 )
SetTimer(1.5, false);

Fly


if( !bCheatsEnabled )
return;

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

UnderWaterTime = Default.UnderWaterTime;
ClientMessage("You feel much lighter");
SetCollision(true, true , true);
bCollideWorld = true;
GotoState('CheatFlying');

FunctionKey (byte Num)

GetDefaultURL (string Option) -> string | native

GetEntryLevel -> LevelInfo | native

GetFreeMove -> SavedMove


local SavedMove s;


if ( FreeMoves == None )
return Spawn(class'SavedMove');
else
{
s = FreeMoves;
FreeMoves = FreeMoves.NextMove;
s.NextMove = None;
return s;
}

GetPlayerNetworkAddress -> string | native

Ghost


if( !bCheatsEnabled )
return;

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

UnderWaterTime = -1.0;
ClientMessage("You feel ethereal");
SetCollision(false, false, false);
bCollideWorld = false;
GotoState('CheatFlying');

Gibbed (name damageType) -> bool


if ( (damageType == 'decapitated') || (damageType == 'shot') )
return false;
if ( (Health < -80) || ((Health < -40) && (FRand() < 0.6)) )
return true;
return false;

God


if( !bCheatsEnabled )
return;

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

if ( ReducedDamageType == 'All' )
{
ReducedDamageType = '';
ClientMessage("God mode off");
return;
}

ReducedDamageType = 'All';
ClientMessage("God Mode on");

Grab


if (CarriedDecoration == None)
GrabDecoration();
else
DropDecoration();

HandleWalking


local rotator carried;


// this is changed from Unreal -- default is now walk - DEUS_EX CNN
bIsWalking = ((bRun == 0) || (bDuck != 0)) && !Region.Zone.IsA('WarpZoneInfo');

if ( CarriedDecoration != None )
{
if ( (Role == ROLE_Authority) && (standingcount == 0) )
CarriedDecoration = None;
if ( CarriedDecoration != None ) //verify its still in front
{
bIsWalking = true;
if ( Role == ROLE_Authority )
{
carried = Rotator(CarriedDecoration.Location - Location);
carried.Yaw = ((carried.Yaw & 65535) - (Rotation.Yaw & 65535)) & 65535;
if ( (carried.Yaw > 3072) && (carried.Yaw < 62463) )
DropDecoration();
}
}
}

InitPlayerReplicationInfo


Super.InitPlayerReplicationInfo();

PlayerReplicationInfo.bAdmin = bAdmin;

InvertMouse (bool B)


bInvertMouse = B;
SaveConfig();

Invisible (bool B)


if( !bCheatsEnabled )
return;

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

if (B)
{
bHidden = true;
Visibility = 0;
// DEUS_EX STM - added AI invisibility
bDetectable = false;
// DEUS_EX CNN - added message
ClientMessage("Player is now invisible");
}
else
{
bHidden = false;
Visibility = Default.Visibility;
// DEUS_EX STM - added AI invisibility
bDetectable = true;
// DEUS_EX CNN - added message
ClientMessage("Player is now visible");
}

Jump (optional float F)

JumpOffPawn


Velocity += 60 * VRand();
Velocity.Z = 120;
SetPhysics(PHYS_Falling);

Kick (string KickString)


local Pawn aPawn;

if( !bAdmin )
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 ) )
{
aPawn.Destroy();
return;
}

KickBan (string KickString)


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

if( !bAdmin )
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 ) )
{
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();
}
aPawn.Destroy();
return;
}

KillAll (class aClass)


local Actor A;


if( !bCheatsEnabled )
return;
if ( !bAdmin && (Level.Netmode != NM_Standalone) )
return;
ForEach AllActors(class 'Actor', A)
if ( ClassIsChildOf(A.class, aClass) )
A.Destroy();

KillMessage (name damageType, pawn Other) -> string


return ( Level.Game.PlayerKillMessage(damageType, Other.PlayerReplicationInfo)$PlayerReplicationInfo.PlayerName );

KillPawns


local Pawn P;


if( !bCheatsEnabled )
return;
if ( !bAdmin && (Level.Netmode != NM_Standalone) )
return;
ForEach AllActors(class 'Pawn', P)
if (PlayerPawn(P) == None)
P.Destroy();

KilledBy (pawn EventInstigator)


Health = 0;
Died( EventInstigator, 'Suicided', Location );

Landed (vector HitNormal)


if ( !bUpdating )
{
//log(class$" Landed while swimming");
PlayLanded(Velocity.Z);
TakeFallingDamage();
bJustLanded = true;
}
if ( Region.Zone.bWaterZone )
SetPhysics(PHYS_Swimming);
else
{
GotoState('PlayerWalking');
AnimEnd();
}

LocalTravel (string URL)


if( bAdmin || Level.Netmode==NM_Standalone )
ClientTravel( URL, TRAVEL_Relative, true );

MultiplayerTick (float DeltaTime)

Mutate (string MutateString)


if( Level.NetMode == NM_Client )
return;
Level.Game.BaseMutator.Mutate(MutateString, Self);

Name (coerce string S)


SetName(S);

NeverSwitchOnPickup (bool B)


bNeverAutoSwitch = B;
bNeverSwitchOnPickup = B;
ServerNeverSwitchOnPickup(B);
SaveConfig();

NextWeapon


local int nextGroup;
local Inventory inv;
local Weapon realWeapon, w, Prev;
local bool bFoundWeapon;


if( bShowMenu || Level.Pauser!="" )
return;
if ( Weapon == None )
{
SwitchToBestWeapon();
return;
}
nextGroup = 100;
realWeapon = Weapon;
if ( PendingWeapon != None )
Weapon = PendingWeapon;
PendingWeapon = None;

for (inv=Inventory; inv!=None; inv=inv.Inventory)
{
w = Weapon(inv);
if ( w != None )
{
if ( w.InventoryGroup == Weapon.InventoryGroup )
{
if ( w == Weapon )
bFoundWeapon = true;
else if ( bFoundWeapon && ((w.AmmoType == None) || (w.AmmoType.AmmoAmount>0)) )
{
PendingWeapon = W;
break;
}
}
else if ( (w.InventoryGroup > Weapon.InventoryGroup)
&& ((w.AmmoType == None) || (w.AmmoType.AmmoAmount>0))
&& (w.InventoryGroup < nextGroup) )
{
nextGroup = w.InventoryGroup;
PendingWeapon = w;
}
}
}

bFoundWeapon = false;
nextGroup = Weapon.InventoryGroup;
if ( PendingWeapon == None )
for (inv=Inventory; inv!=None; inv=inv.Inventory)
{
w = Weapon(Inv);
if ( w != None )
{
if ( w.InventoryGroup == Weapon.InventoryGroup )
{
if ( w == Weapon )
{
bFoundWeapon = true;
if ( Prev != None )
PendingWeapon = Prev;
}
else if ( !bFoundWeapon && (PendingWeapon == None) && ((w.AmmoType == None) || (w.AmmoType.AmmoAmount>0)) )
Prev = W;
}
else if ( (w.InventoryGroup < nextGroup)
&& ((w.AmmoType == None) || (w.AmmoType.AmmoAmount>0)) )
{
nextGroup = w.InventoryGroup;
PendingWeapon = w;
}
}
}

Weapon = realWeapon;
if ( PendingWeapon == None )
return;

Weapon.PutDown();

PasteFromClipboard -> string | native

Pause


// Don't pause in multiplayer
if ( Level.NetMode == NM_Standalone )
{
if ( bShowMenu )
return;
if( !SetPause(Level.Pauser=="") )
ClientMessage(NoPauseMessage);
}

Ping


ClientMessage("Current ping is"@PlayerReplicationInfo.Ping);

PlayBeepSound

PlayChatting

PlayDodge (eDodgeDir DodgeMove)


PlayDuck();

PlayDying (name DamageType, vector HitLocation)


BaseEyeHeight = Default.BaseEyeHeight;

PlayFeignDeath

PlayHit (float Damage, vector HitLocation, name damageType, vector Momentum)


Level.Game.SpecialDamageString = "";

PlayRising

PlaySwimming


PlayRunning();

PlayTakeHit (float tweentime, vector HitLoc, int Damage)


if ( IsAnimating() )
{
Enable('AnimEnd');
Global.PlayTakeHit(tweentime, HitLoc, Damage);
}

PlayTurning

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


local vector View,HitLocation,HitNormal, FirstHit, spot;
local float DesiredDist, ViewDist, WallOutDist;
local actor HitActor;
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.EyeHeight = TargetEyeHeight;
if ( PTarget.Weapon != None )
PTarget.Weapon.PlayerViewOffset = TargetWeaponViewOffset;
}
if ( PTarget.bIsPlayer )
CameraRotation = PTarget.ViewRotation;
CameraLocation.Z += PTarget.EyeHeight;
}

if ( Carcass(ViewTarget) != None )
{
if ( bBehindView || (ViewTarget.Physics == PHYS_None) )
CameraRotation = ViewRotation;
else
ViewRotation = CameraRotation;
if ( bBehindView )
CalcBehindView(CameraLocation, CameraRotation, 190);
}
else if ( bBehindView )
CalcBehindView(CameraLocation, CameraRotation, 180);

return;
}

// View rotation.
CameraRotation = ViewRotation;
DesiredFOV = DefaultFOV;
ViewActor = self;
if( bBehindView ) //up and behind (for death scene)
CalcBehindView(CameraLocation, CameraRotation, 180);
else
{
// First-person view.
CameraLocation = Location;
CameraLocation.Z += Default.BaseEyeHeight;
}

PlayerInput (float DeltaTime)


local float SmoothTime, FOVScale, MouseScale, AbsSmoothX, AbsSmoothY, MouseTime;


if ( bShowMenu && (myHud != None) )
{
if ( myHud.MainMenu != None )
myHud.MainMenu.MenuTick( DeltaTime );
// clear inputs
bEdgeForward = false;
bEdgeBack = false;
bEdgeLeft = false;
bEdgeRight = false;
bWasForward = false;
bWasBack = false;
bWasLeft = false;
bWasRight = false;
aStrafe = 0;
aTurn = 0;
aForward = 0;
aLookUp = 0;
return;
}
else if ( bDelayedCommand )
{
bDelayedCommand = false;
ConsoleCommand(DelayedCommand);
}

// Check for Dodge move
// flag transitions
bEdgeForward = (bWasForward ^^ (aBaseY > 0));
bEdgeBack = (bWasBack ^^ (aBaseY < 0));
bEdgeLeft = (bWasLeft ^^ (aStrafe > 0));
bEdgeRight = (bWasRight ^^ (aStrafe < 0));
bWasForward = (aBaseY > 0);
bWasBack = (aBaseY < 0);
bWasLeft = (aStrafe > 0);
bWasRight = (aStrafe < 0);

// Smooth and amplify mouse movement
SmoothTime = FMin(0.2, 3 * DeltaTime * Level.TimeDilation);
FOVScale = DesiredFOV * 0.01111;
MouseScale = MouseSensitivity * FOVScale;

aMouseX *= MouseScale;
aMouseY *= MouseScale;

//************************************************************************

//log("X "$aMouseX$" Smooth "$SmoothMouseX$" Borrowed "$BorrowedMouseX$" zero time "$(Level.TimeSeconds - MouseZeroTime)$" vs "$MouseSmoothThreshold);
AbsSmoothX = SmoothMouseX;
AbsSmoothY = SmoothMouseY;
MouseTime = (Level.TimeSeconds - MouseZeroTime)/Level.TimeDilation;
if ( bMaxMouseSmoothing && (aMouseX == 0) && (MouseTime < MouseSmoothThreshold) )
{
SmoothMouseX = 0.5 * (MouseSmoothThreshold - MouseTime) * AbsSmoothX/MouseSmoothThreshold;
BorrowedMouseX += SmoothMouseX;
}
else
{
if ( (SmoothMouseX == 0) || (aMouseX == 0)
|| ((SmoothMouseX > 0) != (aMouseX > 0)) )
{
SmoothMouseX = aMouseX;
BorrowedMouseX = 0;
}
else
{
SmoothMouseX = 0.5 * (SmoothMouseX + aMouseX - BorrowedMouseX);
if ( (SmoothMouseX > 0) != (aMouseX > 0) )
{
if ( AMouseX > 0 )
SmoothMouseX = 1;
else
SmoothMouseX = -1;
}
BorrowedMouseX = SmoothMouseX - aMouseX;
}
AbsSmoothX = SmoothMouseX;
}
if ( bMaxMouseSmoothing && (aMouseY == 0) && (MouseTime < MouseSmoothThreshold) )
{
SmoothMouseY = 0.5 * (MouseSmoothThreshold - MouseTime) * AbsSmoothY/MouseSmoothThreshold;
BorrowedMouseY += SmoothMouseY;
}
else
{
if ( (SmoothMouseY == 0) || (aMouseY == 0)
|| ((SmoothMouseY > 0) != (aMouseY > 0)) )
{
SmoothMouseY = aMouseY;
BorrowedMouseY = 0;
}
else
{
SmoothMouseY = 0.5 * (SmoothMouseY + aMouseY - BorrowedMouseY);
if ( (SmoothMouseY > 0) != (aMouseY > 0) )
{
if ( AMouseY > 0 )
SmoothMouseY = 1;
else
SmoothMouseY = -1;
}
BorrowedMouseY = SmoothMouseY - aMouseY;
}
AbsSmoothY = SmoothMouseY;
}
if ( (aMouseX != 0) || (aMouseY != 0) )
MouseZeroTime = Level.TimeSeconds;

// adjust keyboard and joystick movements
aLookUp *= FOVScale;
aTurn *= FOVScale;

// Remap raw x-axis movement.
if( bStrafe!=0 )
{
// Strafe.
aStrafe += aBaseX + SmoothMouseX;
aBaseX = 0;
}
else
{
// Forward.
aTurn += aBaseX * FOVScale + SmoothMouseX;
if ( Level.NetMode != NM_Standalone )
aTurn *= TurnRateAdjuster;
aBaseX = 0;
}

// Remap mouse y-axis movement.
if( (bStrafe == 0) && (bAlwaysMouseLook || (bLook!=0)) )
{
// Look up/down.
if ( bInvertMouse )
aLookUp -= SmoothMouseY;
else
aLookUp += SmoothMouseY;
if ( Level.NetMode != NM_Standalone )
aLookUp *= TurnRateAdjuster;
}
else
{
// Move forward/backward.
aForward += SmoothMouseY;
}
SmoothMouseX = AbsSmoothX;
SmoothMouseY = AbsSmoothY;

if ( bSnapLevel != 0 )
{
bCenterView = true;
bKeyboardLook = false;
}
else if (aLookUp != 0)
{
bCenterView = false;
bKeyboardLook = true;
}
else if ( bSnapToLevel && !bAlwaysMouseLook )
{
bCenterView = true;
bKeyboardLook = false;
}

// Remap other y-axis movement.
if ( bFreeLook != 0 )
{
bKeyboardLook = true;
aLookUp += 0.5 * aBaseY * FOVScale;
}
else
aForward += aBaseY;

aBaseY = 0;

// Handle walking.
HandleWalking();

PlayerList


local PlayerReplicationInfo PRI;


log("Player List:");
ForEach AllActors(class'PlayerReplicationInfo', PRI)
ClientMessage(PRI.PlayerName$"("$PRI.PlayerID$")");

PlayerMove (float DeltaTime)


local vector X,Y,Z;


GetAxes(ViewRotation,X,Y,Z);
// Update view rotation.

if ( !bFixedCamera )
{
aLookup *= 0.24;
aTurn *= 0.24;
ViewRotation.Yaw += 32.0 * DeltaTime * aTurn;
ViewRotation.Pitch += 32.0 * DeltaTime * aLookUp;
ViewRotation.Pitch = ViewRotation.Pitch & 65535;
If ((ViewRotation.Pitch > 18000) && (ViewRotation.Pitch < 49152))
{
If (aLookUp > 0)
ViewRotation.Pitch = 18000;
else
ViewRotation.Pitch = 49152;
}
}
else if ( ViewTarget != None )
ViewRotation = ViewTarget.Rotation;

ViewShake(DeltaTime);
ViewFlash(DeltaTime);

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

PlayerTick (float DeltaTime)


if ( bUpdatePosition )
ClientUpdatePosition();

PlayerMove(DeltaTime);

PlayerTimeOut


if (Health > 0)
Died(None, 'Suicided', Location);

PlayersOnly


// DEUS_EX CNN - This needs to be here!
if (!bCheatsEnabled)
return;

if ( Level.Netmode != NM_Standalone )
return;

Level.bPlayersOnly = !Level.bPlayersOnly;

Possess


if ( Level.Netmode == NM_Client )
{
// replicate client weapon preferences to server
ServerNeverSwitchOnPickup(bNeverAutoSwitch);
ServerSetHandedness(Handedness);
UpdateWeaponPriorities();
}
ServerUpdateWeapons();
bIsPlayer = true;
DodgeClickTime = FMin(0.3, DodgeClickTime);
EyeHeight = BaseEyeHeight;
NetPriority = 3;
StartWalk();

PostBeginPlay


Super.PostBeginPlay();
if (Level.LevelEnterText != "" )
ClientMessage(Level.LevelEnterText);
if ( Level.NetMode != NM_Client )
{
HUDType = Level.Game.HUDType;
ScoringType = Level.Game.ScoreboardType;
MyAutoAim = FMax(MyAutoAim, Level.Game.AutoAim);
}
bIsPlayer = true;
DodgeClickTime = FMin(0.3, DodgeClickTime);
DesiredFOV = DefaultFOV;
EyeHeight = BaseEyeHeight;
if ( Level.Game.IsA('SinglePlayer') && (Level.NetMode == NM_Standalone) )
FlashScale = vect(0,0,0);

PostRender (canvas Canvas)


if ( myHud != None )
myHUD.PostRender(Canvas);
else if ( (Viewport(Player) != None) && (HUDType != None) )
myHUD = spawn(HUDType, self);

PostRenderFlash (canvas Canvas)

PreBeginPlay


bIsPlayer = true;
Super.PreBeginPlay();

PreClientTravel

PreRender (canvas Canvas)


if ( myHud != None )
myHUD.PreRender(Canvas);
else if ( (Viewport(Player) != None) && (HUDType != None) )
myHUD = spawn(HUDType, self);

PrevItem


local Inventory Inv, LastItem;


// DEUS_EX CNN - this function is EVIL!
return;

if ( bShowMenu || Level.Pauser!="" )
return;
if (SelectedItem==None) {
SelectedItem = Inventory.SelectNext();
Return;

PrevWeapon


local int prevGroup;
local Inventory inv;
local Weapon realWeapon, w, Prev;
local bool bFoundWeapon;


if( bShowMenu || Level.Pauser!="" )
return;
if ( Weapon == None )
{
SwitchToBestWeapon();
return;
}
prevGroup = 0;
realWeapon = Weapon;
if ( PendingWeapon != None )
Weapon = PendingWeapon;
PendingWeapon = None;

for (inv=Inventory; inv!=None; inv=inv.Inventory)
{
w = Weapon(inv);
if ( w != None )
{
if ( w.InventoryGroup == Weapon.InventoryGroup )
{
if ( w == Weapon )
{
bFoundWeapon = true;
if ( Prev != None )
{
PendingWeapon = Prev;
break;
}
}
else if ( !bFoundWeapon && ((w.AmmoType == None) || (w.AmmoType.AmmoAmount>0)) )
Prev = W;
}
else if ( (w.InventoryGroup < Weapon.InventoryGroup)
&& ((w.AmmoType == None) || (w.AmmoType.AmmoAmount>0))
&& (w.InventoryGroup >= prevGroup) )
{
prevGroup = w.InventoryGroup;
PendingWeapon = w;
}
}
}
bFoundWeapon = false;
prevGroup = Weapon.InventoryGroup;
if ( PendingWeapon == None )
for (inv=Inventory; inv!=None; inv=inv.Inventory)
{
w = Weapon(inv);
if ( w != None )
{
if ( w.InventoryGroup == Weapon.InventoryGroup )
{
if ( w == Weapon )
bFoundWeapon = true;
else if ( bFoundWeapon && (PendingWeapon == None) && ((w.AmmoType == None) || (w.AmmoType.AmmoAmount>0)) )
PendingWeapon = W;
}
else if ( (w.InventoryGroup > PrevGroup)
&& ((w.AmmoType == None) || (w.AmmoType.AmmoAmount>0)) )
{
prevGroup = w.InventoryGroup;
PendingWeapon = w;
}
}
}

Weapon = realWeapon;
if ( PendingWeapon == None )
return;

Weapon.PutDown();

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


Acceleration = NewAccel;
MoveSmooth(Acceleration * DeltaTime);

Profile


//TEMP for performance measurement

log("Average AI Time"@Level.AvgAITime);
log(" < 5% "$Level.AIProfile[0]);
log(" < 10% "$Level.AIProfile[1]);
log(" < 15% "$Level.AIProfile[2]);
log(" < 20% "$Level.AIProfile[3]);
log(" < 25% "$Level.AIProfile[4]);
log(" < 30% "$Level.AIProfile[5]);
log(" < 35% "$Level.AIProfile[6]);
log(" > 35% "$Level.AIProfile[7]);

QuickLoad


if ( (Level.NetMode == NM_Standalone)
&& !Level.Game.bDeathMatch )
ClientTravel( "?load=9", TRAVEL_Absolute, false);

QuickSave


if ( (Health > 0)
&& (Level.NetMode == NM_Standalone)
&& !Level.Game.bDeathMatch )
{
ClientMessage(QuickSaveString);
ConsoleCommand("SaveGame 9");
}

ReceiveLocalizedMessage (class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)


Message.Static.ClientReceive( Self, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );

RememberSpot


//remember spot
Destination = Location;

RenderOverlays (canvas Canvas)


if ( Weapon != None )
Weapon.RenderOverlays(Canvas);

if ( myHUD != None )
myHUD.RenderOverlays(Canvas);

ResetKeyboard | native

RestartLevel


if( bAdmin || Level.Netmode==NM_Standalone )
ClientTravel( "?restart", TRAVEL_Relative, false );

Rise


if ( !bRising )
{
Enable('AnimEnd');
BaseEyeHeight = Default.BaseEyeHeight;
bRising = true;
PlayRising();
}

SShot


local float b;

b = float(ConsoleCommand("get ini:Engine.Engine.ViewportManager Brightness"));
ConsoleCommand("set ini:Engine.Engine.ViewportManager Brightness 1");
ConsoleCommand("flush");
ConsoleCommand("shot");
ConsoleCommand("set ini:Engine.Engine.ViewportManager Brightness "$string(B));
ConsoleCommand("flush");

Say (string Msg)


local Pawn P;
local String str;


str = PlayerReplicationInfo.PlayerName $ ": " $ Msg;

if ( Role == ROLE_Authority )
log( "Say>" $ str );

for( P = Level.PawnList; P != None; P = P.nextPawn )
{
if( P.bIsPlayer )
P.ClientMessage( str, 'Say', true );
}

return;

SendVoiceMessage (PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID, name broadcasttype)

ServerAddBots (int N)


local int i;


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

if ( !Level.Game.bDeathMatch )
return;

for ( i=0; i Level.Game.ForceAddBot();

ServerChangeSkin (coerce string SkinName, coerce string FaceName, byte TeamNum)


local string MeshName;


MeshName = GetItemName(string(Mesh));
if ( Level.Game.bCanChangeSkin )
{
Self.static.SetMultiSkin(Self, SkinName, FaceName, TeamNum );
}

ServerFeignDeath


local Weapon W;


W = Weapon;
PendingWeapon = None;
if ( Weapon != None )
Weapon.PutDown();
PendingWeapon = W;
GotoState('FeigningDeath');

ServerNeverSwitchOnPickup (bool B)


bNeverSwitchOnPickup = B;

ServerReStartGame


Level.Game.RestartGame();

ServerReStartPlayer


//log("calling restartplayer in dying with netmode "$Level.NetMode);
if ( Level.NetMode == NM_Client )
return;
if( Level.Game.RestartPlayer(self) )
{
ServerTimeStamp = 0;
TimeMargin = 0;
Enemy = None;
Level.Game.StartPlayer(self);
if ( Mesh != None )
PlayWaiting();
ClientReStart();
}
else
log("Restartplayer failed");

ServerSetHandedness (float hand)


Handedness = hand;
if ( Weapon != None )
{
Weapon.SetHand(Handedness);
if (( Level.NetMode != NM_Standalone ) && ( Role == ROLE_Authority ))
Weapon.ClientSetHandedness(Handedness);
}

ServerSetSloMo (float T)


if ( bAdmin || (Level.Netmode == NM_Standalone) )
{
Level.Game.SetGameSpeed(T);
Level.Game.SaveConfig();
Level.Game.GameReplicationInfo.SaveConfig();
}

ServerSetWeaponPriority (byte i, name WeaponName)


local inventory inv;


WeaponPriority[i] = WeaponName;

for ( inv=Inventory; inv!=None; inv=inv.inventory )
if ( inv.class.name == WeaponName )
Weapon(inv).SetSwitchPriority(self);

ServerTaunt (name Sequence)


PlayAnim(Sequence, 0.7, 0.2);

ServerUpdateWeapons


local inventory Inv;


For ( Inv=Inventory; Inv!=None; Inv=Inv.Inventory )
if ( Inv.IsA('Weapon') )
Weapon(Inv).SetSwitchPriority(self);

SetAutoAim (float F)


ChangeAutoAim(F);
SaveConfig();

SetBob (float F)


UpdateBob(F);
SaveConfig();

SetDesiredFOV (float F)


if( (F >= 80.0) || Level.bAllowFOV || bAdmin || (Level.Netmode==NM_Standalone) )
{
DefaultFOV = FClamp(F, 1, 170);
DesiredFOV = DefaultFOV;
SaveConfig();
}

SetDodgeClickTime (float F)


ChangeDodgeClickTime(F);
SaveConfig();

SetFOVAngle (float newFOV)


FOVAngle = newFOV;

SetFriction (float F)


local ZoneInfo Z;

if ( !bAdmin && (Level.Netmode != NM_Standalone) )
return;
ForEach AllActors(class'ZoneInfo', Z)
Z.ZoneGroundFriction = F;

SetHand (string S)


ChangeSetHand(S);
SaveConfig();

SetJumpZ (float F)


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

SetMaxMouseSmoothing (bool B)


bMaxMouseSmoothing = B;
SaveConfig();

SetMouseSmoothThreshold (float F)


MouseSmoothThreshold = FClamp(F, 0, 0.1);
SaveConfig();

SetName (coerce string S)


ChangeName(S);
UpdateURL("Name", S, true);
SaveConfig();

SetPause (BOOL bPause) -> bool


return Level.Game.SetPause(bPause, self);

SetProgressColor (color C, int Index)


if (Index < 8)
ProgressColor[Index] = C;

SetProgressMessage (string S, int Index)


if (Index < 8)
ProgressMessage[Index] = S;

SetProgressTime (float T)


ProgressTimeOut = T + Level.TimeSeconds;

SetSensitivity (float F)


UpdateSensitivity(F);
SaveConfig();

SetSpeed (float F)


if( !bCheatsEnabled )
return;
if ( !bAdmin && (Level.Netmode != NM_Standalone) )
return;
GroundSpeed = Default.GroundSpeed * f;
WaterSpeed = Default.WaterSpeed * f;

SetViewFlash (bool B)


bNoFlash = !B;

SetWeaponStay (bool B)


local Weapon W;


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

Level.Game.bCoopWeaponMode = B;
ForEach AllActors(class'Weapon', W)
{
W.bWeaponStay = false;
W.SetWeaponStay();
}

ShakeView (float shaketime, float RollMag, float vertmag)


local vector shake;


shake.X = RollMag;
shake.Y = 100 * shaketime;
shake.Z = 100 * vertmag;
ClientShake(shake);

ShowInventory


local Inventory Inv;


if( Weapon!=None )
log( " Weapon: " $ Weapon.Class );
for( Inv=Inventory; Inv!=None; Inv=Inv.Inventory )
log( "Inv: "$Inv $ " state "$Inv.GetStateName());
if ( SelectedItem != None )
log( "Selected Item"@SelectedItem@"Charge"@SelectedItem.Charge );

ShowLoadMenu


ShowMenu();

ShowMenu


WalkBob = vect(0,0,0);
bShowMenu = true; // menu is responsible for turning this off
Player.Console.GotoState('Menuing');

if( Level.Netmode == NM_Standalone )
SetPause(true);

ShowPath


local Actor node;

//find next path to remembered spot
node = FindPathTo(Destination);
if (node != None)
{
log("found path");
Spawn(class 'WayBeacon', self, '', node.location);
}
else
log("didn't find path");

ShowProgress

ShowSpecialMenu (string ClassName)


local class aMenuClass;


aMenuClass = class( DynamicLoadObject( ClassName, class'Class' ) );
if( aMenuClass!=None )
{
bSpecialMenu = true;
SpecialMenu = aMenuClass;
ShowMenu();
}

ShowUpgradeMenu

SloMo (float T)


// DEUS_EX CNN - This needs to be here!
if (!bCheatsEnabled)
return;

ServerSetSloMo(T);

SnapView (bool B)


ChangeSnapView(B);
SaveConfig();

SpawnCarcass -> Carcass


local carcass carc;


carc = Spawn(CarcassType);
if ( carc == None )
return None;
carc.Initfor(self);
if (Player != None)
carc.bPlayerCarcass = true;
if ( !Level.Game.bGameEnded && (Carcass(ViewTarget) == None) )
ViewTarget = carc; //for Player 3rd person views
return carc;

SpawnGibbedCarcass


local carcass carc;


carc = Spawn(CarcassType);
if ( carc != None )
{
carc.Initfor(self);
carc.ChunkUp(-1 * Health);
}

Speech (int Type, int Index, int Callsign)


local VoicePack V;


V = Spawn( PlayerReplicationInfo.VoiceType, Self );
if (V != None)
V.PlayerSpeech( Type, Index, Callsign );

StairLook (bool B)


ChangeStairLook(B);
SaveConfig();

StartWalk


UnderWaterTime = Default.UnderWaterTime;
SetCollision(true, true , true);
SetPhysics(PHYS_Walking);
bCollideWorld = true;
ClientReStart();

StartZoom


ZoomLevel = 0.0;
bZooming = true;

StopZoom


bZooming = false;

Suicide

Summon (string ClassName)


local class NewClass;

if( !bCheatsEnabled )
return;
if( !bAdmin && (Level.Netmode != NM_Standalone) )
return;
log( "Fabricate " $ ClassName );
NewClass = class( DynamicLoadObject( ClassName, class'Class' ) );
if( NewClass!=None )
// DEUS_EX STM
//Spawn( NewClass,,,Location + 72 * Vector(Rotation) + vect(0,0,1) * 15 );
Spawn( NewClass,,,Location + (CollisionRadius+NewClass.Default.CollisionRadius+30) * Vector(Rotation) + vect(0,0,1) * 15 );

SwimAnimUpdate (bool bNotForward)


if ( !bAnimTransition && (GetAnimGroup(AnimSequence) != 'Gesture') )
{
if ( bNotForward )
{
if ( GetAnimGroup(AnimSequence) != 'Waiting' )
TweenToWaiting(0.1);
}
else if ( GetAnimGroup(AnimSequence) == 'Waiting' )
TweenToSwimming(0.1);
}

SwitchCoopLevel (string URL)


if( bAdmin || Level.NetMode==NM_Standalone || Level.netMode==NM_ListenServer )
Level.ServerTravel( URL, true );

SwitchLevel (string URL)


if( bAdmin || Level.NetMode==NM_Standalone || Level.netMode==NM_ListenServer )
Level.ServerTravel( URL, false );

SwitchWeapon (byte F)


local weapon newWeapon;


if ( bShowMenu || Level.Pauser!="" )
{
if ( myHud != None )
myHud.InputNumber(F);
return;
}
if ( Inventory == None )
return;
if ( (Weapon != None) && (Weapon.Inventory != None) )
newWeapon = Weapon.Inventory.WeaponChange(F);
else
newWeapon = None;
if ( newWeapon == None )
newWeapon = Inventory.WeaponChange(F);
if ( newWeapon == None )
return;

if ( Weapon == None )
{
PendingWeapon = newWeapon;
ChangedWeapon();
}
else if ( Weapon != newWeapon )
{
PendingWeapon = newWeapon;
if ( !Weapon.PutDown() )
PendingWeapon = None;
}

Taunt (name Sequence)


if ( Health > 0 )
Global.Taunt(Sequence);

TeamMessage (PlayerReplicationInfo PRI, coerce string S, name Type, optional bool bBeep)


if (Player.Console != None)
Player.Console.Message ( PRI, S, Type );
if (bBeep && bMessageBeep)
PlayBeepSound();
if ( myHUD != None )
myHUD.Message( PRI, S, Type );

ThrowWeapon

Timer


bFrozen = false;

ToggleZoom


if ( DefaultFOV != DesiredFOV )
EndZoom();
else
StartZoom();

TravelPostAccept


if ( Health <= 0 )
Health = Default.Health;

Type


if (!bCheatsEnabled)
return;

Player.Console.TypedStr="";
Player.Console.GotoState( 'Typing' );

Typing (bool bTyping)


bIsTyping = bTyping;
if (bTyping)
{
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogTypingEvent(True, Self);
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogTypingEvent(True, Self);
PlayChatting();
}
else
{
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogTypingEvent(False, Self);
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogTypingEvent(False, Self);
}

UnPossess


log(Self$" being unpossessed");
if ( myHUD != None )
myHUD.Destroy();
bIsPlayer = false;
EyeHeight = 0.8 * CollisionHeight;

UpdateBob (float F)


Bob = FClamp(F,0,0.032);

UpdateEyeHeight (float DeltaTime)


local float smooth, bound;


// smooth up/down stairs
if( !bJustLanded )
{
smooth = FMin(1.0, 10.0 * DeltaTime/Level.TimeDilation);
EyeHeight = (EyeHeight - Location.Z + OldLocation.Z) * (1 - smooth) + ( ShakeVert + BaseEyeHeight) * smooth;
bound = -0.5 * CollisionHeight;
if (EyeHeight < bound)
EyeHeight = bound;
else
{
bound = CollisionHeight + FClamp((OldLocation.Z - Location.Z), 0.0, MaxStepHeight);
if ( EyeHeight > bound )
EyeHeight = bound;
}
}
else
{
smooth = FClamp(10.0 * DeltaTime/Level.TimeDilation, 0.35, 1.0);
bJustLanded = false;
EyeHeight = EyeHeight * ( 1 - smooth) + (BaseEyeHeight + ShakeVert) * smooth;
}

// teleporters affect your FOV, so adjust it back down
if ( FOVAngle != DesiredFOV )
{
if ( FOVAngle > DesiredFOV )
FOVAngle = FOVAngle - FMax(7, 0.9 * DeltaTime * (FOVAngle - DesiredFOV));
else
FOVAngle = FOVAngle - FMin(-7, 0.9 * DeltaTime * (FOVAngle - DesiredFOV));
if ( Abs(FOVAngle - DesiredFOV) <= 10 )
FOVAngle = DesiredFOV;
}

// adjust FOV for weapon zooming
if ( bZooming )
{
ZoomLevel += DeltaTime * 1.0;
if (ZoomLevel > 0.9)
ZoomLevel = 0.9;
DesiredFOV = FClamp(90.0 - (ZoomLevel * 88.0), 1, 170);
}

UpdateRotation (float DeltaTime, float maxPitch)


local rotator newRotation;


DesiredRotation = ViewRotation; //save old rotation
ViewRotation.Pitch += 32.0 * DeltaTime * aLookUp;
ViewRotation.Pitch = ViewRotation.Pitch & 65535;
If ((ViewRotation.Pitch > 18000) && (ViewRotation.Pitch < 49152))
{
If (aLookUp > 0)
ViewRotation.Pitch = 18000;
else
ViewRotation.Pitch = 49152;
}
ViewRotation.Yaw += 32.0 * DeltaTime * aTurn;
ViewShake(deltaTime);
ViewFlash(deltaTime);

newRotation = Rotation;
newRotation.Yaw = ViewRotation.Yaw;
newRotation.Pitch = ViewRotation.Pitch;
If ( (newRotation.Pitch > maxPitch * RotationRate.Pitch) && (newRotation.Pitch < 65536 - maxPitch * RotationRate.Pitch) )
{
If (ViewRotation.Pitch < 32768)
newRotation.Pitch = maxPitch * RotationRate.Pitch;
else
newRotation.Pitch = 65536 - maxPitch * RotationRate.Pitch;
}
// added to keep the player's model from pitching or rolling - DEUS_EX CNN
newRotation.Pitch = 0;
newRotation.Roll = 0;

setRotation(newRotation);

UpdateSensitivity (float F)


MouseSensitivity = FMax(0,F);

UpdateURL (string NewOption, string NewValue, bool bSaveDefault) | native

UpdateWeaponPriorities


local byte i;


// send new priorities to server
if ( Level.Netmode == NM_Client )
for ( i=0; i ServerSetWeaponPriority(i, WeaponPriority[i]);

VelocityChanged (vector OldVel, vector NewVel) -> bool


local float NormDot, OldSize, NewSize;


OldSize = VSize(OldVel);
NewSize = VSize(NewVel);

// If both are tiny, just return (also handles zero case where the normal is zero).
if ((OldSize < 1) && (NewSize < 1))
{
return false;
}

if (OldSize > 1.1 * NewSize)
return true;

if (NewSize > 1.1 * OldSize)
return true;

NormDot = Normal(OldVel) dot Normal(NewVel);

// if they are close to each other, don't bother with the update.
return (NormDot < 0.99);

ViewClass (class aClass, optional bool bQuiet)

ViewFlash (float DeltaTime)


local vector goalFog;
local float goalscale, delta;


if ( bNoFlash )
{
InstantFlash = 0;
InstantFog = vect(0,0,0);
}

delta = FMin(0.1, DeltaTime);
goalScale = 1 + DesiredFlashScale + ConstantGlowScale + HeadRegion.Zone.ViewFlash.X;
goalFog = DesiredFlashFog + ConstantGlowFog + HeadRegion.Zone.ViewFog;
DesiredFlashScale -= DesiredFlashScale * 2 * delta;
DesiredFlashFog -= DesiredFlashFog * 2 * delta;
FlashScale.X += (goalScale - FlashScale.X + InstantFlash) * 10 * delta;
FlashFog += (goalFog - FlashFog + InstantFog) * 10 * delta;
InstantFlash = 0;
InstantFog = vect(0,0,0);

if ( FlashScale.X > 0.981 )
FlashScale.X = 1;
FlashScale = FlashScale.X * vect(1,1,1);

if ( FlashFog.X < 0.019 )
FlashFog.X = 0;
if ( FlashFog.Y < 0.019 )
FlashFog.Y = 0;
if ( FlashFog.Z < 0.019 )
FlashFog.Z = 0;

ViewPlayer (string S)

ViewPlayerNum (optional int num)


local Pawn P;


if ( !PlayerReplicationInfo.bIsSpectator && !Level.Game.bTeamGame )
return;
if ( num >= 0 )
{
P = Pawn(ViewTarget);
if ( (P != None) && P.bIsPlayer && (P.PlayerReplicationInfo.TeamID == num) )
{
ViewTarget = None;
bBehindView = false;
return;
}
for ( P=Level.PawnList; P!=None; P=P.NextPawn )
if ( P.bIsPlayer && (P.PlayerReplicationInfo.Team == PlayerReplicationInfo.Team)
&& !P.PlayerReplicationInfo.bIsSpectator
&& (P.PlayerReplicationInfo.TeamID == num) )
{
if ( P != self )
{
ViewTarget = P;
bBehindView = true;
}
return;
}
return;
}
if ( Role == ROLE_Authority )
{
ViewClass(class'Pawn', true);
While ( (ViewTarget != None)
&& (!Pawn(ViewTarget).bIsPlayer || Pawn(ViewTarget).PlayerReplicationInfo.bIsSpectator) )
ViewClass(class'Pawn', true);

if ( ViewTarget != None )
ClientMessage(ViewingFrom@Pawn(ViewTarget).PlayerReplicationInfo.PlayerName, 'Event', true);
else
ClientMessage(ViewingFrom@OwnCamera, 'Event', true);
}

ViewSelf


bBehindView = false;
Viewtarget = None;
ClientMessage(ViewingFrom@OwnCamera, 'Event', true);

ViewShake (float DeltaTime)


if (shaketimer > 0.0) //shake view
{
shaketimer -= DeltaTime;
if ( verttimer == 0 )
{
verttimer = 0.1;
ShakeVert = -1.1 * maxshake;
}
else
{
verttimer -= DeltaTime;
if ( verttimer < 0 )
{
verttimer = 0.2 * FRand();
shakeVert = (2 * FRand() - 1) * maxshake;
}
}
ViewRotation.Roll = ViewRotation.Roll & 65535;
if (bShakeDir)
{
ViewRotation.Roll += Int( 10 * shakemag * FMin(0.1, DeltaTime));
bShakeDir = (ViewRotation.Roll > 32768) || (ViewRotation.Roll < (0.5 + FRand()) * shakemag);
if ( (ViewRotation.Roll < 32768) && (ViewRotation.Roll > 1.3 * shakemag) )
{
ViewRotation.Roll = 1.3 * shakemag;
bShakeDir = false;
}
else if (FRand() < 3 * DeltaTime)
bShakeDir = !bShakeDir;
}
else
{
ViewRotation.Roll -= Int( 10 * shakemag * FMin(0.1, DeltaTime));
bShakeDir = (ViewRotation.Roll > 32768) && (ViewRotation.Roll < 65535 - (0.5 + FRand()) * shakemag);
if ( (ViewRotation.Roll > 32768) && (ViewRotation.Roll < 65535 - 1.3 * shakemag) )
{
ViewRotation.Roll = 65535 - 1.3 * shakemag;
bShakeDir = true;
}
else if (FRand() < 3 * DeltaTime)
bShakeDir = !bShakeDir;
}
}
else
{
ShakeVert = 0;
ViewRotation.Roll = ViewRotation.Roll & 65535;
if (ViewRotation.Roll < 32768)
{
if ( ViewRotation.Roll > 0 )
ViewRotation.Roll = Max(0, ViewRotation.Roll - (Max(ViewRotation.Roll,500) * 10 * FMin(0.1,DeltaTime)));
}
else
{
ViewRotation.Roll += ((65536 - Max(500,ViewRotation.Roll)) * 10 * FMin(0.1,DeltaTime));
if ( ViewRotation.Roll > 65534 )
ViewRotation.Roll = 0;
}
}

Walk


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

StartWalk();

ZoneChange (ZoneInfo NewZone)


local actor HitActor;
local vector HitLocation, HitNormal, checkpoint;


if (!NewZone.bWaterZone)
{
SetPhysics(PHYS_Falling);
if (bUpAndOut && CheckWaterJump(HitNormal)) //check for waterjump
{
velocity.Z = 330 + 2 * CollisionRadius; //set here so physics uses this for remainder of tick
PlayDuck();
GotoState('PlayerWalking');
}
else if (!FootRegion.Zone.bWaterZone || (Velocity.Z > 160) )
{
GotoState('PlayerWalking');
AnimEnd();
}
else //check if in deep water
{
checkpoint = Location;
checkpoint.Z -= (CollisionHeight + 6.0);
HitActor = Trace(HitLocation, HitNormal, checkpoint, Location, false);
if (HitActor != None)
{
GotoState('PlayerWalking');
AnimEnd();
}
else
{
Enable('Timer');
SetTimer(0.7,false);
}
}
//log("Out of water");
}
else
{
Disable('Timer');
SetPhysics(PHYS_Swimming);
}

damageAttitudeTo (pawn Other)


if ( Other != Self )
Enemy = Other;




PlayerReplicationInfo.uc (extends ReplicationInfo)

var string PlayerName; // Player name, or blank if none.
var string OldName; // Temporary value.
var int PlayerID; // Unique id number.
var string TeamName; // Team name, or blank if none.
var byte Team; // Player Team, 255 = None for player.
var int TeamID; // Player position in team.
var float Score; // Player's current score.
var float Deaths; // Number of player's deaths.
var class VoiceType;
var Decoration HasFlag;
var int Ping;
var byte PacketLoss;
var bool bIsFemale;
var bool bFeigningDeath;
var bool bIsSpectator;
var bool bWaitingPlayer;
var bool bAdmin;
var Texture TalkTexture;
var ZoneInfo PlayerZone;
var LocationID PlayerLocation;
var int StartTime;
var int TimeAcc;
var float Streak;
Team=255
NetUpdateFrequency=5.000000

PostBeginPlay


StartTime = Level.TimeSeconds;
Timer();
SetTimer(2.0, true);
bIsFemale = Pawn(Owner).bIsFemale;

Timer


local float MinDist, Dist;
local LocationID L;


MinDist = 1000000;
PlayerLocation = None;
if ( PlayerZone != None )
for ( L=PlayerZone.LocationID; L!=None; L=L.NextLocation )
{
Dist = VSize(Owner.Location - L.Location);
if ( (Dist < L.Radius) && (Dist < MinDist) )
{
PlayerLocation = L;
MinDist = Dist;
}
}
if ( FRand() < 0.65 )
return;

if (PlayerPawn(Owner) != None)
Ping = int(PlayerPawn(Owner).ConsoleCommand("GETPING"));

if (PlayerPawn(Owner) != None)
PacketLoss = int(PlayerPawn(Owner).ConsoleCommand("GETLOSS"));




PlayerStart.uc (extends NavigationPoint)

var() byte TeamNumber;
var() bool bSinglePlayerStart;
var() bool bTeamOnlyStart;
var() bool bNonTeamOnlyStart;
var() bool bCoopStart;
var() bool bEnabled;
bSinglePlayerStart=True
bCoopStart=True
bEnabled=True
bDirectional=True
Texture=Texture'Engine.S_Player'
SoundVolume=128
CollisionRadius=18.000000
CollisionHeight=40.000000

PlayTeleportEffect (actor Incoming, bool bOut)


if ( Level.Game.bDeathMatch && Incoming.IsA('PlayerPawn') )
PlayerPawn(Incoming).SetFOVAngle(135);
Level.Game.PlayTeleportEffect(Incoming, bOut, Level.Game.bDeathMatch );

Trigger (actor Other, pawn EventInstigator)


bEnabled = !bEnabled;




Projectile.uc (extends Actor)

var() float Speed; // Initial speed of projectile.
var() float MaxSpeed; // Limit on speed of projectile (0 means no limit)
var() float Damage;
var() int MomentumTransfer; // Momentum imparted by impacting projectile.
var() name MyDamageType;
var() sound SpawnSound; // Sound made when projectile is spawned.
var() sound ImpactSound; // Sound made when projectile hits something.
var() sound MiscSound; // Miscellaneous Sound.
var() float ExploWallOut; // distance to move explosions out from wall
var() class ExplosionDecal;
MaxSpeed=2000.000000
bReplicateInstigator=True
Physics=PHYS_Projectile
LifeSpan=140.000000
bDirectional=True
DrawType=DT_Mesh
Texture=Texture'Engine.S_Camera'
bGameRelevant=True
SoundVolume=0
CollisionRadius=0.000000
CollisionHeight=0.000000
bCollideActors=True
bCollideWorld=True
NetPriority=2.500000

EncroachingOn (actor Other) -> bool


if ( (Other.Brush != None) || (Brush(Other) != None) )
return true;

return false;

Explode (vector HitLocation, vector HitNormal)


Destroy();

HitWall (vector HitNormal, actor Wall)


if ( Role == ROLE_Authority )
{
if ( (Mover(Wall) != None) && Mover(Wall).bDamageTriggered )
Wall.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), '');

MakeNoise(1.0);
}
Explode(Location + ExploWallOut * HitNormal, HitNormal);
if ( ExplosionDecal != None )
Spawn(ExplosionDecal,self,,Location, rotator(HitNormal));

ProcessTouch (Actor Other, Vector HitLocation)


//should be implemented in subclass

RandSpin (float spinRate)


DesiredRotation = RotRand();
RotationRate.Yaw = spinRate * 2 *FRand() - spinRate;
RotationRate.Pitch = spinRate * 2 *FRand() - spinRate;
RotationRate.Roll = spinRate * 2 *FRand() - spinRate;

Touch (Actor Other)


local actor HitActor;
local vector HitLocation, HitNormal, TestLocation;


if ( Other.IsA('BlockAll') )
{
HitWall( Normal(Location - Other.Location), Other);
return;
}
if ( Other.bProjTarget || (Other.bBlockActors && Other.bBlockPlayers) )
{
//get exact hitlocation
HitActor = Trace(HitLocation, HitNormal, Location, OldLocation, true);
if (HitActor == Other)
{
if ( Other.bIsPawn
&& !Pawn(Other).AdjustHitLocation(HitLocation, Velocity) )
return;
ProcessTouch(Other, HitLocation);
}
else
ProcessTouch(Other, Other.Location + Other.CollisionRadius * Normal(Location - Other.Location));
}




RenderIterator.uc (extends Object)

var int MaxItems;
var int Index;
var PlayerPawn Observer;

CurrentItem -> Actor

Init (PlayerPawn Camera)

IsDone -> bool




ReplicationInfo.uc (extends Info)

bAlwaysRelevant=True



RoundRobin.uc (extends Triggers)

var() name OutEvents[16]; // Events to generate.
var() bool bLoop; // Whether to loop when get to end.
var int i; // Internal counter.

Trigger (actor Other, pawn EventInstigator)


local actor A;

if( OutEvents[i] != '' )
{
foreach AllActors( class 'Actor', A, OutEvents[i] )
{
A.Trigger( Self, EventInstigator );
}
if( ++i>=ArrayCount(OutEvents) || OutEvents[i]=='' )
{
if( bLoop ) i=0;
else
SetCollision(false,false,false);
}
}




SavedMove.uc (extends Info)

var SavedMove NextMove; // Next move in linked list.
var float TimeStamp; // Time of this move.
var float Delta; // Distance moved.
var bool bRun;
var bool bDuck;
var bool bPressedJump;
var bool bFire;
var bool bAltFire;
var bool bForceFire;
var bool bForceAltFire;
var EDodgeDir DodgeMove; // Dodge info.

Clear


TimeStamp = 0;
Delta = 0;
DodgeMove = DODGE_None;
Acceleration = vect(0,0,0);
bFire = false;
bRun = false;
bDuck = false;
bAltFire = false;
bPressedJump = false;
bForceFire = false;
bForceAltFire = false;




ScaledSprite.uc (extends Decoration)

Texture=Texture'Engine.S_Pickup'



ScoreBoard.uc (extends Info)

var font RegFont;
var HUD OwnerHUD;

PreBeginPlay

ShowMiniScores (Canvas Canvas)

ShowScores (canvas Canvas)




Scout.uc (extends Pawn)

AccelRate=1.000000
SightRadius=4100.000000
CombatStyle=4363467783093056784302080.000000
CollisionRadius=52.000000
CollisionHeight=50.000000
bCollideActors=False
bCollideWorld=False
bBlockActors=False
bBlockPlayers=False
bProjTarget=False

PreBeginPlay


Destroy(); //scouts shouldn't exist during play




ScriptedTexture.uc (extends Texture)

var Actor NotifyActor;
var() Texture SourceTexture;
var transient const int Junk1; // C++ stuff
var transient const int Junk2; // C++ stuff
var transient const int Junk3; // C++ stuff
var transient const float LocalTime; // C++ stuff

DrawColoredText (float X, float Y, string Text, Font Font, color FontColor) | native

DrawText (float X, float Y, string Text, Font Font) | native

DrawTile (float X, float Y, float XL, float YL, float U, float V, float UL, float VL, Texture Tex, bool bMasked) | native

ReplaceTexture (Texture Tex) | native

TextSize (string Text, out float XL, out float YL, Font Font) | native




SkyZoneInfo.uc (extends ZoneInfo)

RemoteRole=ROLE_SimulatedProxy



SmellNode.uc (extends Actor)

var(Smell) byte MaxSmellRadius;
var(Smell) byte Strength;
var(Smell) bool Communicable;
var SmellNode nextNode;
var SmellNode prevNode;
var Actor Owner;



SpawnNotify.uc (extends Actor)

var class ActorClass;
var SpawnNotify Next;
ActorClass=Class'Engine.Actor'
bHidden=True
bNetTemporary=True
bAlwaysRelevant=True

Destroyed


local SpawnNotify N;


if(Level.SpawnNotify == Self)
{
Level.SpawnNotify = Next;
Next = None;
}
else
{
for(N = Level.SpawnNotify; N != None && N.Next != None; N = N.Next)
{
if(N.Next == Self)
{
N.Next = Next;
Next = None;
return;
}
}
}

PostBeginPlay


local SpawnNotify N;


for(N = Level.SpawnNotify; N != None; N = N.Next)
if(N == Self)
return;

Next = Level.SpawnNotify;
Level.SpawnNotify = Self;

SpawnNotification (Actor A) -> Actor


return A;




SpecialEvent.uc (extends Triggers)

var() int Damage; // For DamagePlayer state.
var() name DamageType;
var() localized string DamageString;
var() sound Sound; // For PlaySoundEffect state.
var() localized string Message; // For all states.
var() bool bBroadcast; // To broadcast the message to all players.
var() bool bPlayerViewRot; // Whether player can rotate the view while pathing.
Texture=Texture'Engine.S_SpecialEvent'

Trigger (actor Other, pawn EventInstigator)


local InterpolationPoint i;

Global.Trigger( Self, EventInstigator );
if( EventInstigator!=None && EventInstigator.bIsPlayer && (Level.NetMode == NM_Standalone) )
{
foreach AllActors( class 'InterpolationPoint', i, Event )
{
if( i.Position == 0 )
{
EventInstigator.GotoState('');
EventInstigator.SetCollision(True,false,false);
EventInstigator.bCollideWorld = False;
EventInstigator.Target = i;
EventInstigator.SetPhysics(PHYS_Interpolating);
EventInstigator.PhysRate = 1.0;
EventInstigator.PhysAlpha = 0.0;
EventInstigator.bInterpolating = true;
EventInstigator.AmbientSound = AmbientSound;
}
}
}




Spectator.uc (extends PlayerPawn)

var bool bChaseCam;
bChaseCam=True
AirSpeed=400.000000
Visibility=0
AttitudeToPlayer=ATTITUDE_Friendly
MenuName="Spectator"
bHidden=True
bCollideActors=False
bCollideWorld=False
bBlockActors=False
bBlockPlayers=False
bProjTarget=False

AltFire (optional float F)


bBehindView = false;
Viewtarget = None;
ClientMessage(ViewingFrom@OwnCamera, 'Event', true);

BehindView (Bool B)


bBehindView = B;
bChaseCam = bBehindView;
if ( ViewTarget == None )
bBehindView = false;

CallForHelp

ChangeTeam (int N)


Level.Game.ChangeTeam(self, N);

ClientReStart


//log("client restart");
Velocity = vect(0,0,0);
Acceleration = vect(0,0,0);
BaseEyeHeight = Default.BaseEyeHeight;
EyeHeight = BaseEyeHeight;

GotoState('CheatFlying');

Fire (optional float F)


ViewPlayerNum(-1);
bBehindView = bChaseCam;
if ( ViewTarget == None )
bBehindView = false;

Fly


UnderWaterTime = -1;
SetCollision(false, false, false);
bCollideWorld = true;
GotoState('CheatFlying');

ClientRestart();

FootZoneChange (ZoneInfo newFootZone)

Grab

HeadZoneChange (ZoneInfo newHeadZone)

InitPlayerReplicationInfo


Super.InitPlayerReplicationInfo();
PlayerReplicationInfo.bIsSpectator = true;

NextItem

PlayerTimeOut


if (Health > 0)
Died(None, 'dropped', Location);

Possess


bIsPlayer = true;
DodgeClickTime = FMin(0.3, DodgeClickTime);
EyeHeight = BaseEyeHeight;
NetPriority = 2;
Weapon = None;
Inventory = None;
Fly();

PostBeginPlay


if (Level.LevelEnterText != "" )
ClientMessage(Level.LevelEnterText);
bIsPlayer = true;
FlashScale = vect(1,1,1);
if ( Level.NetMode != NM_Client )
ScoringType = Level.Game.ScoreboardType;

PrevItem

RestartLevel

Say (string S)


if ( Len(S) > 63 )
S = Left(S,63);
if ( !Level.Game.bMuteSpectators )
BroadcastMessage( PlayerReplicationInfo.PlayerName$":"$S, true );

ServerChangeSkin (coerce string SkinName, coerce string FaceName, byte TeamNum)

Suicide

SwitchWeapon (byte F)

Taunt (name Sequence)

ThrowWeapon

Walk




Spotlight.uc (extends Light)

bDirectional=True
LightEffect=LE_Spotlight



StatLog.uc (extends Info)

var int Context;
var bool bWorld;
var() string LocalStandard; // The standard this log is compliant to.
var() string WorldStandard; // The standard this log is compliant to.
var() string LogVersion; // Version of the log standard.
var() string LogInfoURL; // URL to info on logging standard.
var() string GameName; // Name of this game.
var() string GameCreator; // Name of game creator.
var() string GameCreatorURL; // URL to info on game creator.
var() string DecoderRingURL; // URL to log format decoder ring.
var() globalconfig string LocalBatcherURL; // Batcher URL.
var() globalconfig string LocalBatcherParams; // Batcher command line parameters.
var() globalconfig string LocalStatsURL; // URL to local stats information.
var() globalconfig string WorldBatcherURL; // Batcher URL.
var() globalconfig string WorldBatcherParams; // Batcher command line parameters.
var() globalconfig string WorldStatsURL; // URL to world stats information.
var() globalconfig string LocalLogDir;
var() globalconfig string WorldLogDir;
LocalStandard="ngLog"
WorldStandard="ngLog"
LogVersion="1.2"
LogInfoURL="http://www.netgamesusa.com/ngLog/"
GameName="Unreal"
GameCreator="Epic MegaGames, Inc."
GameCreatorURL="http://www.epicgames.com/"
DecoderRingURL="http://unreal.epicgames.com/Unreal_Log_Decoder_Ring.html"
LocalBatcherURL="../NetGamesUSA.com/ngStats/ngStatsUT.exe"
LocalStatsURL="../NetGamesUSA.com/ngStats/html/ngStats_Main.html"
WorldBatcherURL="../NetGamesUSA.com/ngWorldStats/bin/ngWorldStats.exe"
WorldBatcherParams="-d ../NetGamesUSA.com/ngWorldStats/logs -g UT"
WorldStatsURL="http://www.netgamesusa.com"
LocalLogDir="../Logs"
WorldLogDir="../NetGamesUSA.com/ngWorldStats/logs"

BatchLocal | native

BeginPlay


SetTimer(30.0, True);

BrowseRelativeLocalURL (string URL) | native

ExecuteLocalLogBatcher | native

ExecuteSilentLogBatcher | native

ExecuteWorldLogBatcher | native

FlushLog


// Implemented in subclass.

GetAbsoluteTime -> string


local string AbsoluteTime;
local string GMTRef;


AbsoluteTime = string(Level.Year);

if (Level.Month < 10)
AbsoluteTime = AbsoluteTime$".0"$Level.Month;
else
AbsoluteTime = AbsoluteTime$"."$Level.Month;

if (Level.Day < 10)
AbsoluteTime = AbsoluteTime$".0"$Level.Day;
else
AbsoluteTime = AbsoluteTime$"."$Level.Day;

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

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

if (Level.Second < 10)
AbsoluteTime = AbsoluteTime$".0"$Level.Second;
else
AbsoluteTime = AbsoluteTime$"."$Level.Second;

if (Level.Millisecond < 10)
AbsoluteTime = AbsoluteTime$".0"$Level.Millisecond;
else
AbsoluteTime = AbsoluteTime$"."$Level.Millisecond;

GMTRef = GetGMTRef();

AbsoluteTime = AbsoluteTime$"."$GMTRef;

TimeStamp = 0;

return AbsoluteTime;

GetGMTRef -> string | native

GetLogFileName -> string


return "";

GetMapFileName -> string | native

GetPlayerChecksum (PlayerPawn P, out string Checksum) | native

GetShortAbsoluteTime -> string


local string AbsoluteTime;


AbsoluteTime = string(Level.Year);

if (Level.Month < 10)
AbsoluteTime = AbsoluteTime$".0"$Level.Month;
else
AbsoluteTime = AbsoluteTime$"."$Level.Month;

if (Level.Day < 10)
AbsoluteTime = AbsoluteTime$".0"$Level.Day;
else
AbsoluteTime = AbsoluteTime$"."$Level.Day;

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

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

if (Level.Second < 10)
AbsoluteTime = AbsoluteTime$".0"$Level.Second;
else
AbsoluteTime = AbsoluteTime$"."$Level.Second;

TimeStamp = 0;

return AbsoluteTime;

GetTimeStamp -> string


local string Time;
local int Pos;


Time = string(TimeStamp);
Time = Left(Time, InStr(Time, ".") + 3);
return Time;

InitialCheck (GameInfo Game) | native

LogEventString (string EventString)


Log( EventString );

LogGameEnd (string Reason)


LogEventString(GetTimeStamp()$Chr(9)$"game_end"$Chr(9)$Reason);

LogGameSpecial (String SpecialID, String SpecialParam)


LogEventString(GetTimeStamp()$Chr(9)$"game"$Chr(9)$SpecialID$Chr(9)$SpecialParam);

LogGameSpecial2 (String SpecialID, String SpecialParam, String SpecialParam2)


LogEventString(GetTimeStamp()$Chr(9)$"game"$Chr(9)$SpecialID$Chr(9)$SpecialParam$Chr(9)$SpecialParam2);

LogGameStart


LogEventString(GetTimeStamp()$Chr(9)$"game_start");

LogItemActivate (Inventory Item, Pawn Other)


if ( (Other == None) || (Other.PlayerReplicationInfo == None) || (Item == None) )
return;
LogEventString(GetTimeStamp()$Chr(9)$"item_activate"$Chr(9)$Item.ItemName$Chr(9)$Other.PlayerReplicationInfo.PlayerID);

LogItemDeactivate (Inventory Item, Pawn Other)


LogEventString(GetTimeStamp()$Chr(9)$"item_deactivate"$Chr(9)$Item.ItemName$Chr(9)$Other.PlayerReplicationInfo.PlayerID);

LogKill (int KillerID, int VictimID, string KillerWeaponName, string VictimWeaponName, name DamageType)


LogEventString(GetTimeStamp()$Chr(9)$"kill"$Chr(9)$KillerID$Chr(9)$KillerWeaponName$Chr(9)$VictimID$Chr(9)$VictimWeaponName$Chr(9)$DamageType);

LogMapParameters


local string MapName;


MapName = GetMapFileName();

LogEventString(GetTimeStamp()$Chr(9)$"map"$Chr(9)$"Name"$Chr(9)$MapName);
LogEventString(GetTimeStamp()$Chr(9)$"map"$Chr(9)$"Title"$Chr(9)$Level.Title);
LogEventString(GetTimeStamp()$Chr(9)$"map"$Chr(9)$"Author"$Chr(9)$Level.Author);
LogEventString(GetTimeStamp()$Chr(9)$"map"$Chr(9)$"IdealPlayerCount"$Chr(9)$Level.IdealPlayerCount);
LogEventString(GetTimeStamp()$Chr(9)$"map"$Chr(9)$"LevelEnterText"$Chr(9)$Level.LevelEnterText);

LogMutator (Mutator M) | native

LogNameChange (Pawn Other)


LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Rename"$Chr(9)$Other.PlayerReplicationInfo.PlayerName$Chr(9)$Other.PlayerReplicationInfo.PlayerID);

LogPickup (Inventory Item, Pawn Other)


if (Item.ItemName != "")
LogEventString(GetTimeStamp()$Chr(9)$"item_get"$Chr(9)$Item.ItemName$Chr(9)$Other.PlayerReplicationInfo.PlayerID);
else
LogEventString(GetTimeStamp()$Chr(9)$"item_get"$Chr(9)$Item.Class$Chr(9)$Other.PlayerReplicationInfo.PlayerID);

LogPings


local PlayerReplicationInfo PRI;


foreach AllActors(class'PlayerReplicationInfo', PRI)
LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Ping"$Chr(9)$PRI.PlayerID$Chr(9)$PRI.Ping);

LogPlayerConnect (Pawn Player, optional string Checksum)


if (Player.IsA('PlayerPawn'))
LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Connect"$Chr(9)$Player.PlayerReplicationInfo.PlayerName$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$PlayerPawn(Player).bAdmin);
else
LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Connect"$Chr(9)$Player.PlayerReplicationInfo.PlayerName$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$False);
LogPlayerInfo(Player);

LogPlayerDisconnect (Pawn Player)


LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Disconnect"$Chr(9)$Player.PlayerReplicationInfo.PlayerID);

LogPlayerInfo (Pawn Player)


LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"TeamName"$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$Player.PlayerReplicationInfo.TeamName);
LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Team"$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$Player.PlayerReplicationInfo.Team);
LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"TeamID"$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$Player.PlayerReplicationInfo.TeamID);
LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Ping"$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$Player.PlayerReplicationInfo.Ping);
LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"IsABot"$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$Player.PlayerReplicationInfo.bIsABot);
LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Skill"$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$Player.Skill);

LogServerInfo


local string NetworkNumber;


NetworkNumber = Level.Game.GetNetworkNumber();

LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_ServerName"$Chr(9)$Level.Game.GameReplicationInfo.ServerName);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_AdminName"$Chr(9)$Level.Game.GameReplicationInfo.AdminName);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_AdminEmail"$Chr(9)$Level.Game.GameReplicationInfo.AdminEmail);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_Region"$Chr(9)$Level.Game.GameReplicationInfo.Region);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_MOTDLine1"$Chr(9)$Level.Game.GameReplicationInfo.MOTDLine1);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_MOTDLine2"$Chr(9)$Level.Game.GameReplicationInfo.MOTDLine2);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_MOTDLine3"$Chr(9)$Level.Game.GameReplicationInfo.MOTDLine3);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_MOTDLine4"$Chr(9)$Level.Game.GameReplicationInfo.MOTDLine4);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_IP"$Chr(9)$NetworkNumber);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Server_Port"$Chr(9)$Level.Game.GetServerPort());

LogSpecialEvent (string EventType, optional coerce string Arg1, optional coerce string Arg2, optional coerce string Arg3, optional coerce string Arg4)


local string Event;


Event = EventType;
if (Arg1 != "")
Event = Event$Chr(9)$Arg1;
if (Arg2 != "")
Event = Event$Chr(9)$Arg2;
if (Arg3 != "")
Event = Event$Chr(9)$Arg3;
if (Arg4 != "")
Event = Event$Chr(9)$Arg4;

LogEventString(GetTimeStamp()$Chr(9)$Event);

LogStandardInfo


if (bWorld)
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Log_Standard"$Chr(9)$WorldStandard);
else
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Log_Standard"$Chr(9)$LocalStandard);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Log_Version"$Chr(9)$LogVersion);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Log_Info_URL"$Chr(9)$LogInfoURL);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Game_Name"$Chr(9)$GameName);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Game_Version"$Chr(9)$Level.EngineVersion);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Game_Creator"$Chr(9)$GameCreator);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Game_Creator_URL"$Chr(9)$GameCreatorURL);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Game_Decoder_Ring_URL"$Chr(9)$DecoderRingURL);
LogEventString(GetTimeStamp()$Chr(9)$"info"$Chr(9)$"Absolute_Time"$Chr(9)$GetAbsoluteTime());

LogSuicide (Pawn Killed, name DamageType, Pawn Instigator)


local int KilledID;
local string InstigatorString;


if (Killed == None)
return;

KilledID = Killed.PlayerReplicationInfo.PlayerID;
if (Instigator == None)
InstigatorString = "None";
else
InstigatorString = "Self";

if (Killed.Weapon != None)
LogEventString(GetTimeStamp()$Chr(9)$"suicide"$Chr(9)$KilledID$Chr(9)$Killed.Weapon.ItemName$Chr(9)$DamageType$Chr(9)$InstigatorString);
else
LogEventString(GetTimeStamp()$Chr(9)$"suicide"$Chr(9)$KilledID$Chr(9)$"None"$Chr(9)$DamageType$Chr(9)$InstigatorString);

LogTeamChange (Pawn Other)


LogEventString(GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Teamchange"$Chr(9)$Other.PlayerReplicationInfo.PlayerID$Chr(9)$Other.PlayerReplicationInfo.Team);

LogTeamKill (int KillerID, int VictimID, string KillerWeaponName, string VictimWeaponName, name DamageType)


LogEventString(GetTimeStamp()$Chr(9)$"teamkill"$Chr(9)$KillerID$Chr(9)$KillerWeaponName$Chr(9)$VictimID$Chr(9)$VictimWeaponName$Chr(9)$DamageType);

LogTypingEvent (bool bTyping, Pawn Other)


LogEventString(GetTimeStamp()$Chr(9)$"typing"$Chr(9)$bTyping$Chr(9)$Other.PlayerReplicationInfo.PlayerID);

StartLog


// Implemented in subclass.

StopLog


// Implemented in subclass.

Tick (float Delta)


TimeStamp += Delta;

Timer


LogPings();




StatLogFile.uc (extends StatLog)

var bool bWatermark;
var int LogAr; // C++ FArchive*.
var string StatLogFile;
var string StatLogFinal;
StatLogFile="../Logs/unreal.ngStats.Unknown.log"

CloseLog | native

FileFlush | native

FileLog (string EventString) | native

FlushLog


FileFlush();

GetChecksum (out string Checksum) | native

GetLogFileName -> string


return StatLogFinal;

LogEventString (string EventString)


if( bWatermark )
Watermark( EventString );
FileLog( EventString );
FlushLog();

LogGameEnd (string Reason)


local string Checksum;


if( bWorld )
{
bWatermark = False;
GetChecksum( Checksum );
LogEventString(GetTimeStamp()$Chr(9)$"game_end"$Chr(9)$Reason$Chr(9)$Checksum$"");
}
else Super.LogGameEnd(Reason);

LogPlayerConnect (Pawn Player, optional string Checksum)


if( bWorld )
{
if( Player.PlayerReplicationInfo.bIsABot )
Checksum = "IsABot";
if (Player.IsA('PlayerPawn'))
LogEventString( GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Connect"$Chr(9)$Player.PlayerReplicationInfo.PlayerName$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$PlayerPawn(Player).bAdmin$Chr(9)$Checksum );
else
LogEventString( GetTimeStamp()$Chr(9)$"player"$Chr(9)$"Connect"$Chr(9)$Player.PlayerReplicationInfo.PlayerName$Chr(9)$Player.PlayerReplicationInfo.PlayerID$Chr(9)$False$Chr(9)$Checksum );
LogPlayerInfo( Player );
}
else Super.LogPlayerConnect( Player, Checksum );

OpenLog | native

StartLog


local string FileName;
local string AbsoluteTime;


SaveConfig();

AbsoluteTime = GetShortAbsoluteTime();
if (!bWorld)
{
FileName = LocalLogDir$"/"$GameName$"."$LocalStandard$"."$AbsoluteTime$"."$Level.Game.GetServerPort();
StatLogFile = FileName$".tmp";
StatLogFinal = FileName$".log";
} else {
FileName = WorldLogDir$"/"$GameName$"."$WorldStandard$"."$AbsoluteTime$"."$Level.Game.GetServerPort();
StatLogFile = FileName$".tmp";
StatLogFinal = FileName$".log";
bWatermark = True;

StopLog


FlushLog();
CloseLog();

Watermark (string EventString) | native




Teleporter.uc (extends NavigationPoint)

var() string URL;
var() name ProductRequired;
var() bool bChangesVelocity; // Set velocity to TargetVelocity.
var() bool bChangesYaw; // Sets yaw to teleporter's Rotation.Yaw
var() bool bReversesX; // Reverses X-component of velocity.
var() bool bReversesY; // Reverses Y-component of velocity.
var() bool bReversesZ; // Reverses Z-component of velocity.
var() bool bEnabled; // Teleporter is turned on;
var() vector TargetVelocity; // If bChangesVelocity, set target's velocity to this.
var Actor TriggerActor; //used to tell AI how to trigger me
var Actor TriggerActor2;
var float LastFired;
bChangesYaw=True
bEnabled=True
RemoteRole=ROLE_SimulatedProxy
bDirectional=True
Texture=Texture'Engine.S_Teleport'
SoundVolume=128
CollisionRadius=18.000000
CollisionHeight=40.000000
bCollideActors=True

Accept (actor Incoming, Actor Source) -> bool


local rotator newRot, oldRot;
local int oldYaw;
local float mag;
local vector oldDir;
local pawn P;


// Move the actor here.
Disable('Touch');
//log("Move Actor here "$tag);
newRot = Incoming.Rotation;
if (bChangesYaw)
{
oldRot = Incoming.Rotation;
newRot.Yaw = Rotation.Yaw;
if ( Source != None )
newRot.Yaw += (32768 + Incoming.Rotation.Yaw - Source.Rotation.Yaw);
}

if ( Pawn(Incoming) != None )
{
//tell enemies about teleport
if ( Role == ROLE_Authority )
{
P = Level.PawnList;
While ( P != None )
{
if (P.Enemy == Incoming)
P.LastSeenPos = Incoming.Location;
P = P.nextPawn;
}
}
Pawn(Incoming).SetLocation(Location);
if ( (Role == ROLE_Authority)
|| (Level.TimeSeconds - LastFired > 0.5) )
{
Pawn(Incoming).SetRotation(newRot);
Pawn(Incoming).ViewRotation = newRot;
LastFired = Level.TimeSeconds;
}
Pawn(Incoming).MoveTimer = -1.0;
Pawn(Incoming).MoveTarget = self;
PlayTeleportEffect( Incoming, false);
}
else
{
if ( !Incoming.SetLocation(Location) )
{
Enable('Touch');
return false;
}
if ( bChangesYaw )
Incoming.SetRotation(newRot);
}

Enable('Touch');


if (bChangesVelocity)
Incoming.Velocity = TargetVelocity;
else
{
if ( bChangesYaw )
{
if ( Incoming.Physics == PHYS_Walking )
OldRot.Pitch = 0;
oldDir = vector(OldRot);
mag = Incoming.Velocity Dot oldDir;
Incoming.Velocity = Incoming.Velocity - mag * oldDir + mag * vector(Incoming.Rotation);
}
if ( bReversesX )
Incoming.Velocity.X *= -1.0;
if ( bReversesY )
Incoming.Velocity.Y *= -1.0;
if ( bReversesZ )
Incoming.Velocity.Z *= -1.0;
}

// Play teleport-in effect.

return true;

FindTriggerActor


local Actor A;


TriggerActor = None;
TriggerActor2 = None;
ForEach AllActors(class 'Actor', A)
if ( A.Event == Tag)
{
if ( Counter(A) != None )
return; //FIXME - handle counters
if (TriggerActor == None)
TriggerActor = A;
else
{
TriggerActor2 = A;
return;
}
}

PlayTeleportEffect (actor Incoming, bool bOut)


if ( Incoming.IsA('Pawn') )
{
Incoming.MakeNoise(1.0);
Level.Game.PlayTeleportEffect(Incoming, bOut, true);
}

PostBeginPlay


if (URL ~= "")
SetCollision(false, false, false); //destination only

if ( !bEnabled )
FindTriggerActor();
Super.PostBeginPlay();

SpecialHandling (Pawn Other) -> Actor


local int i;
local vector Dist2D;

if ( bEnabled && (Other.RouteCache[1] != None)
&& Other.RouteCache[1].IsA('Teleporter') && (string(Other.RouteCache[1].tag)~=URL) )
{
if ( Abs(Location.Z - Other.Location.Z) < CollisionHeight + Other.CollisionHeight )
{
Dist2D = Location - Other.Location;
Dist2D.Z = 0;
if ( VSize(Dist2D) < CollisionRadius + Other.CollisionRadius )
Touch(Other);
}
return self;
}

if (TriggerActor == None)
{
FindTriggerActor();
if (TriggerActor == None)
return None;
}

if ( (TriggerActor2 != None)
&& (VSize(TriggerActor2.Location - Other.Location) < VSize(TriggerActor.Location - Other.Location)) )
return TriggerActor2;

return TriggerActor;

Touch (actor Other)


local Teleporter Dest;
local int i;
local Actor A;


if ( !bEnabled )
return;

if( Other.bCanTeleport && Other.PreTeleport(Self)==false )
{
if( (InStr( URL, "/" ) >= 0) || (InStr( URL, "#" ) >= 0) )
{
// Teleport to a level on the net.
if( (Role == ROLE_Authority) && (PlayerPawn(Other) != None) )
Level.Game.SendPlayer(PlayerPawn(Other), URL);
}
else
{
// Teleport to a random teleporter in this local level, if more than one pick random.

foreach AllActors( class 'Teleporter', Dest )
if( string(Dest.tag)~=URL && Dest!=Self )
i++;
i = rand(i);
foreach AllActors( class 'Teleporter', Dest )
if( string(Dest.tag)~=URL && Dest!=Self && i-- == 0 )
break;
if( Dest != None )
{
// Teleport the actor into the other teleporter.
if ( Other.IsA('Pawn') )
PlayTeleportEffect( Pawn(Other), false);
Dest.Accept( Other, self );
if( (Event != '') && (Other.IsA('Pawn')) )
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Other, Other.Instigator );
}
else if ( Role == ROLE_Authority )
Pawn(Other).ClientMessage( "Teleport destination for "$self$" not found!" );
}
}

Trigger (actor Other, pawn EventInstigator)


local int i;


bEnabled = !bEnabled;
if ( bEnabled ) //teleport any pawns already in my radius
for (i=0;i<4;i++)
if ( Touching[i] != None )
Touch(Touching[i]);




TestInfo.uc (extends Info)

var() bool bTrue1;
var() bool bFalse1;
var() bool bTrue2;
var() bool bFalse2;
var bool bBool1;
var bool bBool2;
var() int xnum;
var float ppp;
var string sxx;
var int MyArray[2];
var vector v1,v2;
var string TestRepStr;
var struct STest
var bool b1;
var int i;
var bool b2;
var bool b3;
bTrue1=True
bTrue2=True
xnum=777
ppp=3.140000
sxx="Tim"
bHidden=False
RemoteRole=ROLE_SimulatedProxy
bAlwaysRelevant=True

BeginPlay


local testobj to;
local object oo;

to = new class'TestObj';
to = new()class'TestObj';
to = new(self)class'TestObj';
to = new(self,'')class'TestObj';
to = new(self,'',0)class'TestObj';
to.Test();
TestStructBools();

OtherStatic (int i) -> int


assert(i==246);
assert(default.xnum==777);
return 555;

PostBeginPlay


local object o;
local actor TempActor;

log("!!BEGIN");

default.v1=vect(5,4,3);
assert(default.v1==vect(5,4,3));
test();
assert(default.v1==vect(1,2,3));

BroadcastMessage(Tag);
BroadcastMessage(string(Tag));
BroadcastMessage("test "$string(Tag));
assert(IsA('Actor'));
assert(IsA('TestInfo'));
assert(IsA('Info'));
assert(!IsA('LevelInfo'));
assert(!IsA('Texture'));
//o=dynamicloadobject( "UnrealShare.AutoMag.Reload", class'object' );
//assert(o!=None);
//assert(o==None);
log("!!END");

RecurseTest -> bool


bBool1=true;
return false;

SubTestOptionalOut (optional out int a, optional out int b, optional out int c)


a *= 2;
b = b*2;
c += c;

TestContinueDoUntil


local int i;

log("TestContinue");
do
{
i++;
log("iteration "$i);
if(i==7||i==9||i>18)
continue;
log("...");
} until( i>20 );
log("DoneContinue");

TestContinueFor


local int i;

log("TestContinue");
for( i=0; i<20; i++ )
{
log("iteration "$i);
if(i==7||i==9||i==19)
continue;
log("...");
}
log("DoneContinue");

TestContinueForEach


local actor a;

log("TestContinue");
foreach AllActors( class'Actor', a )
{
log("actor "$a);
if(light(a)==none)
continue;
log("...");
}
log("DoneContinue");

TestContinueWhile


local int i;

log("TestContinue");
while( ++i <= 20 )
{
log("iteration "$i);
if(i==7||i==9)
continue;
log("...");
}
log("DoneContinue");

TestNullContext (actor a)


bHidden = a.bHidden;
a.bHidden = bHidden;

TestOptionalOut


local int a,b,c;

a=1; b=2; c=3;

SubTestOptionalOut(a,b,c);
assert(a==2); assert(b==4); assert(c==6);

SubTestOptionalOut(a,b);
assert(a==4); assert(b==8); assert(c==6);

SubTestOptionalOut(,b,c);
assert(a==4); assert(b==16); assert(c==12);

SubTestOptionalOut();
assert(a==4); assert(b==16); assert(c==12);

SubTestOptionalOut(a,b,c);
assert(a==8); assert(b==32); assert(c==24);

log("TestOptionalOut ok!");

TestQ


local vector v;

v.x = 2;
v.y = 3;
v.z = 4;
assert(v==vect(2,3,4));
assert(v.z==4);
assert(v.y==3);
assert(v.x==2);

TestStatic (int i) -> int


assert(i==123);
assert(default.xnum==777);
assert(OtherStatic(i*2)==555);

TestStructBools


assert(ST.b1==false);
assert(ST.b2==false);
assert(ST.b3==false);

ST.b1=true;
assert(ST.b1==true);
assert(ST.b2==false);
assert(ST.b3==false);

ST.b2=true;
assert(ST.b1==true);
assert(ST.b2==true);
assert(ST.b3==false);

ST.b3=true;
assert(ST.b1==true);
assert(ST.b2==true);
assert(ST.b3==true);

ST.b1=false;
ST.b2=false;
ST.b3=false;

TestSwitch


local string s;
local int i;
local bool b;

s="Tim";
i=2;
switch( i )
{
case 0:
assert(false);
break;
case 2:
b=true;
break;
default:
assert(false);
break;
}
assert(b);
switch( s )
{
case "":
assert(false);
break;
case "xyzzy":
assert(false);
break;
default:
b=false;
break;
}
assert(!b);
log("testswitch succeeded");

TestX (bool bResource)


local int n;

n = int(bResource);
MyArray[ int(bResource) ] = 0;
MyArray[ int(bResource) ]++;

Tick (float DeltaTime)


local class C;
local class TC;
local actor a;


log("time="$Level.TimeSeconds);

TestOptionalOut();
TestNullContext( self );
TestNullContext( None );
TestSwitch();

v1=vect(1,2,3);
v2=vect(2,4,6);
assert(v1!=v2);
assert(!(v1==v2));
assert(v1==vect(1,2,3));
assert(v2==vect(2,4,6));
assert(vect(1,2,5)!=v1);
assert(v1*2==v2);
assert(v1==v2/2);

assert(Pie==3.14);
assert(Pie!=2);
assert(Str=="Tim");
assert(Str!="Bob");
assert(Lotus==vect(1,2,3));

assert(GetPropertyText("sxx")=="Tim");
assert(GetPropertyText("ppp")!="123");
assert(GetPropertyText("bogus")=="");
xnum=345;
assert(GetPropertyText("xnum")=="345");
SetPropertyText("xnum","999");
assert(xnum==999);
assert(xnum!=666);

assert(bTrue1==true);
assert(bFalse1==false);
assert(bTrue2==true);
assert(bFalse2==false);

assert(default.bTrue1==true);
assert(default.bFalse1==false);
assert(default.bTrue2==true);
assert(default.bFalse2==false);

assert(class'TestInfo'.default.bTrue1==true);
assert(class'TestInfo'.default.bFalse1==false);
assert(class'TestInfo'.default.bTrue2==true);
assert(class'TestInfo'.default.bFalse2==false);

TC=Class;
assert(TC.default.bTrue1==true);
assert(TC.default.bFalse1==false);
assert(TC.default.bTrue2==true);
assert(TC.default.bFalse2==false);

C=Class;
assert(class(C).default.bTrue1==true);
assert(class(C).default.bFalse1==false);
assert(class(C).default.bTrue2==true);
assert(class(C).default.bFalse2==false);

assert(default.xnum==777);
TestStatic(123);
TC.static.TestStatic(123);
class(C).static.TestStatic(123);

bBool2=RecurseTest();
assert(bBool2==false);

TestStructBools();
TestQ();

log( "All tests passed" );

f

temp


local int i;
local playerpawn PlayerOwner;
local name LeftList[20];

for( i=0; i<20; i++ )
PlayerOwner.WeaponPriority[i] = LeftList[i+1];
temp();

test


class'testinfo'.default.v1 = vect(1,2,3);




TestObj.uc (extends Object)

Test


log( "TestObj.Test" );




Texture.uc (extends Bitmap)

var(Texture) texture BumpMap; // Bump map to illuminate this texture with.
var(Texture) texture DetailTexture; // Detail texture to apply.
var(Texture) texture MacroTexture; // Macrotexture to apply, not currently used.
var(Texture) float Diffuse; // Diffuse lighting coefficient.
var(Texture) float Specular; // Specular lighting coefficient.
var(Texture) float Alpha; // Alpha.
var(Texture) float DrawScale; // Scaling relative to parent.
var(Texture) float Friction; // Surface friction coefficient, 1.0=none, 0.95=some.
var(Texture) float MipMult; // Mipmap multiplier.
var() sound FootstepSound; // Footstep sound.
var() sound HitSound; // Sound when the texture is hit with a projectile.
var bool bInvisible;
var(Surface) editconst bool bMasked;
var(Surface) bool bTransparent;
var bool bNotSolid;
var(Surface) bool bEnvironment;
var bool bSemisolid;
var(Surface) bool bModulate;
var(Surface) bool bFakeBackdrop;
var(Surface) bool bTwoSided;
var(Surface) bool bAutoUPan;
var(Surface) bool bAutoVPan;
var(Surface) bool bNoSmooth;
var(Surface) bool bBigWavy;
var(Surface) bool bSmallWavy;
var(Surface) bool bWaterWavy;
var bool bLowShadowDetail;
var bool bNoMerge;
var(Surface) bool bCloudWavy;
var bool bDirtyShadows;
var bool bHighLedge;
var bool bSpecialLit;
var bool bGouraud;
var(Surface) bool bUnlit;
var bool bHighShadowDetail;
var bool bPortal;
var const bool bMirrored, bX2, bX3;
var const bool bX4, bX5, bX6, bX7;
var(Quality) private bool bHighColorQuality; // High color quality hint.
var(Quality) private bool bHighTextureQuality; // High color quality hint.
var private bool bRealtime; // Texture changes in realtime.
var private bool bParametric; // Texture data need not be stored.
var private transient bool bRealtimeChanged; // Changed since last render.
var private bool bHasComp; // Whether a compressed version exists.
var(Quality) enum ELODSet
var(Animation) texture AnimNext;
var transient texture AnimCurrent;
var(Animation) byte PrimeCount;
var transient byte PrimeCurrent;
var(Animation) float MinFrameRate, MaxFrameRate;
var transient float Accumulator;
var private native const array Mips, CompMips;
var const ETextureFormat CompFormat;
Diffuse=1.000000
Specular=1.000000
DrawScale=1.000000
Friction=1.000000
MipMult=1.000000
LODSet=LODSET_World



Trigger.uc (extends Triggers)

var() enum ETriggerType
var() localized string Message;
var() bool bTriggerOnceOnly;
var() bool bInitiallyActive;
var() class ClassProximityType;
var() float RepeatTriggerTime; //if > 0, repeat trigger message at this interval is still touching other
var() float ReTriggerDelay; //minimum time before trigger can be triggered again
var() float DamageThreshold; //minimum damage to trigger if TT_Shoot
var actor TriggerActor2;
bInitiallyActive=True
InitialState=NormalTrigger
Texture=Texture'Engine.S_Trigger'

CheckTouchList


local int i;


for (i=0;i<4;i++)
if ( Touching[i] != None )
Touch(Touching[i]);

FindTriggerActor


local Actor A;


TriggerActor = None;
TriggerActor2 = None;
ForEach AllActors(class 'Actor', A)
if ( A.Event == Tag)
{
if ( Counter(A) != None )
return; //FIXME - handle counters
if (TriggerActor == None)
TriggerActor = A;
else
{
TriggerActor2 = A;
return;
}
}

IsRelevant (actor Other) -> bool


if( !bInitiallyActive )
return false;

// DEUS_EX STM -- added cheat
if( (Other != None) && (!Other.bDetectable) )
return false;

switch( TriggerType )
{
case TT_PlayerProximity:
return Pawn(Other)!=None && Pawn(Other).bIsPlayer;
case TT_PawnProximity:
return Pawn(Other)!=None && ( Pawn(Other).Intelligence > BRAINS_None );
case TT_ClassProximity:
return ClassIsChildOf(Other.Class, ClassProximityType);
case TT_AnyProximity:
return true;
case TT_Shoot:
return ( (Projectile(Other) != None) && (Projectile(Other).Damage >= DamageThreshold) );
}

PostBeginPlay


if ( !bInitiallyActive )
FindTriggerActor();
if ( TriggerType == TT_Shoot )
{
bHidden = false;
bProjTarget = true;
DrawType = DT_None;
}

Super.PostBeginPlay();

SpecialHandling (Pawn Other) -> Actor


local int i;


if ( bTriggerOnceOnly && !bCollideActors )
return None;

if ( (TriggerType == TT_PlayerProximity) && !Other.bIsPlayer )
return None;

if ( !bInitiallyActive )
{
if ( TriggerActor == None )
FindTriggerActor();
if ( TriggerActor == None )
return None;
if ( (TriggerActor2 != None)
&& (VSize(TriggerActor2.Location - Other.Location) < VSize(TriggerActor.Location - Other.Location)) )
return TriggerActor2;
else
return TriggerActor;
}

// is this a shootable trigger?
if ( TriggerType == TT_Shoot )
{
if ( !Other.bCanDoSpecial || (Other.Weapon == None) )
return None;

Other.Target = self;
Other.bShootSpecial = true;
Other.FireWeapon();
Other.bFire = 0;
Other.bAltFire = 0;
return Other;
}

// can other trigger it right away?
if ( IsRelevant(Other) )
{
for (i=0;i<4;i++)
if (Touching[i] == Other)
Touch(Other);
return self;
}

return self;

Timer


local bool bKeepTiming;
local int i;


bKeepTiming = false;

for (i=0;i<4;i++)
if ( (Touching[i] != None) && IsRelevant(Touching[i]) )
{
bKeepTiming = true;
Touch(Touching[i]);
}

if ( bKeepTiming )
SetTimer(RepeatTriggerTime, false);

Touch (actor Other)


local actor A;
local bool restoreGroup; // DEUS_EX CNN


if( IsRelevant( Other ) )
{
if ( ReTriggerDelay > 0 )
{
if ( Level.TimeSeconds - TriggerTime < ReTriggerDelay )
return;
TriggerTime = Level.TimeSeconds;
}
// Broadcast the Trigger message to all matching actors.
if( Event != '' )
foreach AllActors( class 'Actor', A, Event )
{
// DEUS_EX CNN
// If the triggering actor doesn't have a group, then
// we copy the trigger's group into the group of the triggerer
// This will make LogicTriggers work correctly and won't
// affect anything else
if (Other.Group == '')
{
Other.Group = Group;
restoreGroup = True;
}
else
restoreGroup = False;

A.Trigger( Other, Other.Instigator );

// DEUS_EX CNN
if (restoreGroup)
Other.Group = '';
}

if ( Other.IsA('Pawn') && (Pawn(Other).SpecialGoal == self) )
Pawn(Other).SpecialGoal = None;

if( Message != "" )
// Send a string message to the toucher.
Other.Instigator.ClientMessage( Message );

if( bTriggerOnceOnly )
// Ignore future touches.
SetCollision(False);
else if ( RepeatTriggerTime > 0 )
SetTimer(RepeatTriggerTime, false);
}

Trigger (actor Other, pawn EventInstigator)


bInitiallyActive = false;

UnTouch (actor Other)


local actor A;

if( IsRelevant( Other ) )
{
// Untrigger all matching actors.
if( Event != '' )
foreach AllActors( class 'Actor', A, Event )
A.UnTrigger( Other, Other.Instigator );
}




TriggerLight.uc (extends Light)

var() float ChangeTime; // Time light takes to change from on to off.
var() bool bInitiallyOn; // Whether it's initially on.
var() bool bDelayFullOn; // Delay then go full-on.
var() float RemainOnTime; // How long the TriggerPound effect lasts
var float InitialBrightness; // Initial brightness.
var float Alpha, Direction;
var actor SavedTrigger;
var float poundTime;
bStatic=False
bHidden=False
bMovable=True
RemoteRole=ROLE_SimulatedProxy

BeginPlay


// Remember initial light type and set new one.
Disable( 'Tick' );
InitialBrightness = LightBrightness;
if( bInitiallyOn )
{
Alpha = 1.0;
Direction = 1.0;
}
else
{
Alpha = 0.0;
Direction = -1.0;
}
DrawType = DT_None;

Tick (float DeltaTime)


Alpha += Direction * DeltaTime / ChangeTime;
if( Alpha > 1.0 )
{
Alpha = 1.0;
Disable( 'Tick' );
if( SavedTrigger != None )
SavedTrigger.EndEvent();
}
else if( Alpha < 0.0 )
{
Alpha = 0.0;
Disable( 'Tick' );
if( SavedTrigger != None )
SavedTrigger.EndEvent();
}
if( !bDelayFullOn )
LightBrightness = Alpha * InitialBrightness;
else if( (Direction>0 && Alpha!=1) || Alpha==0 )
LightBrightness = 0;
else
LightBrightness = InitialBrightness;

// DEUS_EX CNN - Hide the corona when turned off
if (LightBrightness == 0)
{
MultiSkins[1] = Skin;
Skin = None;
}
else
{
Skin = MultiSkins[1];
MultiSkins[1] = None;
}

Timer

Trigger (actor Other, pawn EventInstigator)



if( SavedTrigger!=None )
SavedTrigger.EndEvent();
SavedTrigger = Other;
SavedTrigger.BeginEvent();
Direction = 1;
poundTime = ChangeTime; // how much time will pass till reversal
SetTimer (ChangeTime, false); // wake up when it's time to reverse
Enable ('Timer');
Enable ('Tick');

UnTrigger (actor Other, pawn EventInstigator)


if( SavedTrigger!=None )
SavedTrigger.EndEvent();
SavedTrigger = Other;
SavedTrigger.BeginEvent();
if( bInitiallyOn ) Direction = 1.0;
else Direction = -1.0;
Enable( 'Tick' );




TriggerMarker.uc (extends NavigationPoint)




Triggers.uc (extends Actor)

bHidden=True
CollisionRadius=40.000000
CollisionHeight=40.000000
bCollideActors=True



VoicePack.uc (extends Info)

RemoteRole=ROLE_None
LifeSpan=10.000000

(exec function to do ServerVoiceMessage, and use in OrdersMenu)

ClientInitialize (PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageIndex)

PlayerSpeech (int Type, int Index, int Callsign)




WarpZoneInfo.uc (extends ZoneInfo)

var() string OtherSideURL;
var() name ThisTag;
var() bool bNoTeleFrag;
var const int iWarpZone;
var const coords WarpCoords;
var transient WarpZoneInfo OtherSideActor;
var transient object OtherSideLevel;
var() string Destinations[8];
var int numDestinations;
MaxCarcasses=0

ActorEntered (actor Other)


local vector L;
local rotator R;
local Pawn P;


//if ( Other.Role == ROLE_AutonomousProxy )
// return; // don't simulate for client players
Super.ActorEntered( Other );
if( !Other.bJustTeleported )
{
Generate();
if( OtherSideActor != None )
{
// This needs to also perform a coordinate system transformation,
// in case the portals aren't directionally aligned. This is easy to
// do but UnrealScript doesn't provide coordinate system operators yet.
Other.Disable('Touch');
Other.Disable('UnTouch');

L = Other.Location;
if( Other.IsA('PlayerPawn') )
R = PlayerPawn(Other).ViewRotation;
else
R = Other.Rotation;

UnWarp( L, Other.Velocity, R );
OtherSideActor.Warp( L, Other.Velocity, R );

if( Other.IsA('Pawn') )
{
Pawn(Other).bWarping = bNoTelefrag;
if ( Other.SetLocation(L) )
{
//tell enemies about teleport
if ( Role == ROLE_Authority )
{
P = Level.PawnList;
While ( P != None )
{
if (P.Enemy == Other)
P.LastSeenPos = Other.Location;
P = P.nextPawn;
}
}
R.Roll = 0;
Pawn(Other).ViewRotation = R;
Pawn(Other).ClientSetLocation(L, R );
Pawn(Other).MoveTimer = -1.0;
}
else
{
// set up to keep trying to teleport
GotoState('DelayedWarp');
}
}
else
{
Other.SetLocation(L);
Other.SetRotation( R );
}
Other.Enable('Touch');
Other.Enable('UnTouch');
// Change rotation according to portal's rotational change.
}
}

ActorLeaving (actor Other)


Super.ActorLeaving(Other);
If ( Other.IsA('Pawn') )
Pawn(Other).bWarping = false;

ForceGenerate


if( InStr(OtherSideURL,"/") >= 0 )
{
// Remote level.
//log( "Warpzone " $ Self $ " remote" );
OtherSideLevel = None;
OtherSideActor = None;
}
else
{
// Local level.
OtherSideLevel = XLevel;
foreach AllActors( class 'WarpZoneInfo', OtherSideActor )
if( string(OtherSideActor.ThisTag)~=OtherSideURL && OtherSideActor!=Self )
break;
//log( "Warpzone " $ Self $ " local, connected to " $ OtherSideActor );
}

Generate


if( OtherSideLevel != None )
return;
ForceGenerate();

PreBeginPlay


Super.PreBeginPlay();

// Generate the local connection.
Generate();

// Setup destination list.
numDestinations = 0;
While( numDestinations < 8 )
if (Destinations[numDestinations] != "")
numDestinations++;
else
numDestinations = 8;

// Generate URL if necessary.
if( numDestinations>0 && (OtherSideURL == "") )
OtherSideURL = Destinations[0];

Tick (float DeltaTime)


local Pawn P;
local bool bFound;


For ( P=Level.PawnList; P!=None; P=P.NextPawn )
if ( P.bWarping && (P.Region.Zone == Self) )
{
bFound = true;
ActorEntered(P);
}

If ( !bFound )
GotoState('');

Trigger (actor Other, pawn EventInstigator)


local int nextPick;

if (numDestinations == 0)
return;

nextPick = 0;
While( (nextPick < 8) && (Destinations[nextPick] != OtherSideURL ) )
nextPick++;

nextPick++;
if ( (nextPick > 7) || (Destinations[nextPick] == "") )
nextPick = 0;

OtherSideURL = Destinations[nextPick];
ForceGenerate();

UnWarp (out vector Loc, out vector Vel, out rotator R) | native

Warp (out vector Loc, out vector Vel, out rotator R) | native




WarpZoneMarker.uc (extends NavigationPoint)

var WarpZoneInfo markedWarpZone;
var Actor TriggerActor; //used to tell AI how to trigger me
var Actor TriggerActor2;
bCollideWhenPlacing=False
bHiddenEd=True
CollisionRadius=20.000000
CollisionHeight=40.000000

FindTriggerActor


local ZoneTrigger Z;

ForEach AllActors(class 'ZoneTrigger', Z)
if ( Z.Event == markedWarpZone.ZoneTag)
{
TriggerActor = Z;
return;
}

PostBeginPlay


if ( markedWarpZone.numDestinations > 1 )
FindTriggerActor();
Super.PostBeginPlay();

SpecialHandling (Pawn Other) -> Actor


if (Other.Region.Zone == markedWarpZone)
markedWarpZone.ActorEntered(Other);
return self;




WayBeacon.uc (extends Keypoint)

bStatic=False
bHidden=False
RemoteRole=ROLE_None
LifeSpan=6.000000
DrawType=DT_Mesh
DrawScale=0.500000
AmbientGlow=40
bOnlyOwnerSee=True
bCollideActors=True
LightType=LT_Steady
LightBrightness=125
LightSaturation=125

PostBeginPlay


local class NewClass;


Super.PostBeginPlay();
NewClass = class( DynamicLoadObject( "Unreali.Lamp4", class'Class' ) );
if( NewClass!=None )
Mesh = NewClass.Default.Mesh;

touch (actor other)


if (other == owner)
{
if ( Owner.IsA('PlayerPawn') )
PlayerPawn(owner).ShowPath();
Destroy();
}




Weapon.uc (extends Inventory)

var() float MaxTargetRange; // Maximum distance to target.
var() class AmmoName; // Type of ammo used.
var() travel byte ReloadCount; // Amount of ammo depletion before reloading. 0 if no reloading is done.
var() int PickupAmmoCount; // Amount of ammo initially in pick-up item.
var travel ammo AmmoType; // Inventory Ammo being used.
var() travel bool bInstantHit; // If true, instant hit rather than projectile firing weapon
var() bool bAltInstantHit; // If true, instant hit rather than projectile firing weapon for AltFire
var(WeaponAI) bool bWarnTarget; // When firing projectile, warn the target
var(WeaponAI) bool bAltWarnTarget; // When firing alternate projectile, warn the target
var bool bWeaponUp; // Used in Active State
var bool bChangeWeapon; // Used in Active State
var bool bLockedOn;
var(WeaponAI) bool bSplashDamage; // used by bot AI
var() bool bCanThrow; //if true, player can toss this weapon out
var(WeaponAI) bool bRecommendSplashDamage; //if true, bot preferentially tries to use splash damage
var(WeaponAI) bool bRecommendAltSplashDamage; //if true, bot preferentially tries to use splash damage
var() bool bWeaponStay;
var() bool bOwnsCrosshair; // this weapon is responsible for drawing its own crosshair (in its postrender function)
var(WeaponAI) bool bMeleeWeapon; //Weapon is only a melee weapon
var() bool bRapidFire; // used by human animations in determining firing animation (for still firing)
var() float FiringSpeed; // used by human animations in determining firing speed
var() vector FireOffset; // Offset from drawing location for projectile/trace start
var() class ProjectileClass;
var() class AltProjectileClass;
var() name MyDamageType;
var() name AltDamageType;
var() float ShakeMag;
var() float ShakeTime;
var() float ShakeVert;
var(WeaponAI) float AIRating;
var(WeaponAI) float RefireRate;
var(WeaponAI) float AltRefireRate;
var() sound FireSound;
var() sound AltFireSound;
var() sound CockingSound;
var() sound SelectSound;
var() sound Misc1Sound;
var() sound Misc2Sound;
var() sound Misc3Sound;
var() Localized string MessageNoAmmo;
var() Localized string DeathMessage;
var() Color NameColor; // used when drawing name on HUD
var Rotator AdjustedAim;
var bool bSetFlashTime;
var(MuzzleFlash) bool bDrawMuzzleFlash;
var byte bMuzzleFlash;
var float FlashTime;
var(MuzzleFlash) float MuzzleScale, FlashY, FlashO, FlashC, FlashLength;
var(MuzzleFlash) int FlashS; // size of (square) texture/2
var(MuzzleFlash) texture MFTexture;
var(MuzzleFlash) texture MuzzleFlare;
var(MuzzleFlash) float FlareOffset;
MaxTargetRange=4096.000000
bCanThrow=True
ProjectileSpeed=1000.000000
AltProjectileSpeed=1000.000000
aimerror=550.000000
shakemag=300.000000
shaketime=0.100000
shakevert=5.000000
AIRating=0.100000
RefireRate=0.500000
AltRefireRate=0.500000
MessageNoAmmo=" has no ammo."
DeathMessage="%o was killed by %k's %w."
NameColor=(R=255,G=255,B=255)
MuzzleScale=4.000000
FlashLength=0.100000
AutoSwitchPriority=1
InventoryGroup=1
PickupMessage="You got a weapon"
ItemName="Weapon"
RespawnTime=30.000000
PlayerViewOffset=(X=30.000000,Z=-5.000000)
MaxDesireability=0.500000
Icon=Texture'Engine.S_Weapon'
Texture=Texture'Engine.S_Weapon'
bNoSmooth=True

AltFire (float F)

AnimEnd


PlayIdleAnim();

BecomeItem


Super.BecomeItem();
Lifespan = 0;

BecomePickup


Super.BecomePickup();
SetDisplayProperties(Default.Style, Default.Texture, Default.bUnlit, Default.bMeshEnviromap );
if (Level.NetMode != NM_Standalone)
if (bTossedOut)
Lifespan = 5.0;

BeginState


bChangeWeapon = false;
bMuzzleFlash = 0;
Pawn(Owner).ClientPutDown(self, Pawn(Owner).PendingWeapon);

BotDesireability (Pawn Bot) -> float


local Weapon AlreadyHas;
local float desire;


desire = MaxDesireability + Bot.AdjustDesireFor(self);
AlreadyHas = Weapon(Bot.FindInventoryType(class));
if ( AlreadyHas != None )
{
if ( (RespawnTime < 10)
&& ( bHidden || (AlreadyHas.AmmoType == None)
|| (AlreadyHas.AmmoType.AmmoAmount < AlreadyHas.AmmoType.MaxAmmo)) )
return 0;
if ( (!bHeldItem || bTossedOut) && bWeaponStay )
return 0;
if ( AlreadyHas.AmmoType == None )
return 0.25 * desire;

if ( AlreadyHas.AmmoType.AmmoAmount > 0 )
return FMax( 0.25 * desire,
AlreadyHas.AmmoType.MaxDesireability
* FMin(1, 0.15 * AlreadyHas.AmmoType.MaxAmmo/AlreadyHas.AmmoType.AmmoAmount) );
else
return 0.05;
}
if ( (Bot.Weapon == None) || (Bot.Weapon.AIRating <= 0.4) )
return 2*desire;

return desire;

BringUp


if ( Owner.IsA('PlayerPawn') )
{
SetHand(PlayerPawn(Owner).Handedness);
if (( Level.NetMode != NM_Standalone ) && (Role == ROLE_Authority))
ClientSetHandedness( PlayerPawn(Owner).Handedness );
PlayerPawn(Owner).EndZoom();
}
bWeaponUp = false;
PlaySelect();
GotoState('Active');

CheckVisibility


local Pawn PawnOwner;


PawnOwner = Pawn(Owner);
if( Owner.bHidden && (PawnOwner.Health > 0) && (PawnOwner.Visibility < PawnOwner.Default.Visibility) )
{
Owner.bHidden = false;
PawnOwner.Visibility = PawnOwner.Default.Visibility;
}

ClientAltFire (float Value) -> bool


return true;

ClientFire (float Value) -> bool


return true;

ClientPutDown (Weapon NextWeapon)

ClientSetHandedness (float Hand)


setHand( Hand );

ClientWeaponEvent (name EventType)

Destroyed


Super.Destroyed();
if( (Pawn(Owner)!=None) && (Pawn(Owner).Weapon == self) )
Pawn(Owner).Weapon = None;

DropFrom (vector StartLocation)


if ( !SetLocation(StartLocation) )
return;
AIRating = Default.AIRating;
bMuzzleFlash = 0;
//
// DEUS_EX CNN - ALERT! HUGE HACK ALERT!!!
//
// Basically, you don't want to drop all of your ammo unless you are dropping
// a grenade of some sort. The only way to check for a grenade is to check the
// PickupViewMesh for the illegal mesh TestBox. But since TestBox is in the DeusExItems
// package, we can't directly access the mesh, so we have to cast the mesh to a string
// and check it that way.
//
// Hate Hate Hate.
//
if (AmmoType != None)
{
if (String(AmmoType.PickupViewMesh) == "DeusExItems.TestBox")
{
PickupAmmoCount = AmmoType.AmmoAmount;
AmmoType.AmmoAmount = 0;
}
else
PickupAmmoCount = 0;
}
if (Level.Netmode != NM_Standalone)
bTossedOut = true;
Super.DropFrom(StartLocation);

Finish


local Pawn PawnOwner;


if ( bChangeWeapon )
{
GotoState('DownWeapon');
return;
}

PawnOwner = Pawn(Owner);
if ( PlayerPawn(Owner) == None )
{
if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) )
{
PawnOwner.StopFiring();
PawnOwner.SwitchToBestWeapon();
if ( bChangeWeapon )
GotoState('DownWeapon');
}
else if ( (PawnOwner.bFire != 0) && (FRand() < RefireRate) )
Global.Fire(0);
else if ( (PawnOwner.bAltFire != 0) && (FRand() < AltRefireRate) )
Global.AltFire(0);
else
{
PawnOwner.StopFiring();
GotoState('Idle');
}
return;
}
if ( ((AmmoType != None) && (AmmoType.AmmoAmount<=0)) || (PawnOwner.Weapon != self) )
GotoState('Idle');
else if ( PawnOwner.bFire!=0 )
Global.Fire(0);
else if ( PawnOwner.bAltFire!=0 )
Global.AltFire(0);
else
GotoState('Idle');

Fire (float F)

ForceAltFire

ForceFire

GiveAmmo (Pawn Other)


if ( AmmoName == None )
return;
AmmoType = Ammo(Other.FindInventoryType(AmmoName));
if ( AmmoType != None )
AmmoType.AddAmmo(PickUpAmmoCount);
else
{
AmmoType = Spawn(AmmoName); // Create ammo type required
Other.AddInventory(AmmoType); // and add to player's inventory
AmmoType.BecomeItem();
AmmoType.AmmoAmount = PickUpAmmoCount;
AmmoType.GotoState('Idle2');
}

HandlePickupQuery (inventory Item) -> bool


local int OldAmmo;
local Pawn P;


if (Item.Class == Class)
{
if ( Weapon(item).bWeaponStay && (!Weapon(item).bHeldItem || Weapon(item).bTossedOut) )
return true;
P = Pawn(Owner);
// if ( AmmoType != None )
// {
// OldAmmo = AmmoType.AmmoAmount;
//
// // DEUS_EX CNN - never switch weapons automatically, but do add the ammo
// AmmoType.AddAmmo(Weapon(Item).PickupAmmoCount);
// if ( AmmoType.AddAmmo(Weapon(Item).PickupAmmoCount) && (OldAmmo == 0)
// && (P.Weapon.class != item.class) && !P.bNeverSwitchOnPickup )
// WeaponSet(P);
// }
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogPickup(Item, Pawn(Owner));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogPickup(Item, Pawn(Owner));
if (Item.PickupMessageClass == None)
// DEUS_EX CNN - use the itemArticle and itemName
// P.ClientMessage(Item.PickupMessage, 'Pickup');
P.ClientMessage(Item.PickupMessage @ Item.itemArticle @ Item.itemName, 'Pickup');
else
P.ReceiveLocalizedMessage( Item.PickupMessageClass, 0, None, None, item.Class );
Item.PlaySound(Item.PickupSound);
Item.SetRespawn();
return true;

PlayAltFiring


//Play alt firing animation and sound

PlayFiring


//Play firing animation and sound

PlayIdleAnim

PlayPostSelect

PlaySelect


PlayAnim('Select',1.0,0.0);
Owner.PlaySound(SelectSound, SLOT_Misc, Pawn(Owner).SoundDampening);

PostBeginPlay


Super.PostBeginPlay();
SetWeaponStay();
MaxDesireability = 1.2 * AIRating;
if ( ProjectileClass != None )
{
ProjectileSpeed = ProjectileClass.Default.Speed;
MyDamageType = ProjectileClass.Default.MyDamageType;
}
if ( AltProjectileClass != None )
{
AltProjectileSpeed = AltProjectileClass.Default.Speed;
AltDamageType = AltProjectileClass.Default.MyDamageType;
}

PostRender (canvas Canvas)

PreRender (canvas Canvas)

ProcessTraceHit (Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)


//Spawn appropriate effects at hit location, any weapon lights, and damage hit actor

ProjectileFire (class ProjClass, float ProjSpeed, bool bWarn) -> Projectile


local Vector Start, X,Y,Z;
local Pawn PawnOwner;


PawnOwner = Pawn(Owner);
Owner.MakeNoise(PawnOwner.SoundDampening);
GetAxes(PawnOwner.ViewRotation,X,Y,Z);
Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
AdjustedAim = PawnOwner.AdjustAim(ProjSpeed, Start, AimError, True, bWarn);
return Spawn(ProjClass,,, Start,AdjustedAim);

PutDown -> bool


bChangeWeapon = true;
GotoState('DownWeapon'); // DEUS_EX CNN - added to force the weapon down
return true;

RaiseUp (Weapon OldWeapon)


BringUp();

RateSelf (out int bUseAltMode) -> float


if ( (AmmoType != None) && (AmmoType.AmmoAmount <=0) )
return -2;
bUseAltMode = int(FRand() < 0.4);
return (AIRating + FRand() * 0.05);

RecommendWeapon (out float rating, out int bUseAltMode) -> Weapon


local Weapon Recommended;
local float oldRating, oldFiring;
local int oldMode;


if ( Owner.IsA('PlayerPawn') )
rating = SwitchPriority();
else
{
rating = RateSelf(bUseAltMode);
if ( (self == Pawn(Owner).Weapon) && (Pawn(Owner).Enemy != None)
&& ((AmmoType == None) || (AmmoType.AmmoAmount > 0)) )
rating += 0.21; // tend to stick with same weapon
}
if ( inventory != None )
{
Recommended = inventory.RecommendWeapon(oldRating, oldMode);
if ( (Recommended != None) && (oldRating > rating) )
{
rating = oldRating;
bUseAltMode = oldMode;
return Recommended;
}
}
return self;

RenderOverlays (canvas Canvas)


local rotator NewRot;
local bool bPlayerOwner;
local int Hand;
local PlayerPawn PlayerOwner;


if ( bHideWeapon || (Owner == None) )
return;

PlayerOwner = PlayerPawn(Owner);

if ( PlayerOwner != None )
{
if ( PlayerOwner.DesiredFOV != PlayerOwner.DefaultFOV )
return;
bPlayerOwner = true;
Hand = PlayerOwner.Handedness;

if ( (Level.NetMode == NM_Client) && (Hand == 2) )
{
bHideWeapon = true;
return;
}
}

if ( !bPlayerOwner || (PlayerOwner.Player == None) )
Pawn(Owner).WalkBob = vect(0,0,0);

if ( (bMuzzleFlash > 0) && bDrawMuzzleFlash && Level.bHighDetailMode && (MFTexture != None) )
{
MuzzleScale = Default.MuzzleScale * Canvas.ClipX/640.0;
if ( !bSetFlashTime )
{
bSetFlashTime = true;
FlashTime = Level.TimeSeconds + FlashLength;
}
else if ( FlashTime < Level.TimeSeconds )
bMuzzleFlash = 0;
if ( bMuzzleFlash > 0 )
{
if ( Hand == 0 )
Canvas.SetPos(Canvas.ClipX/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipX * (-0.2 * Default.FireOffset.Y * FlashO), Canvas.ClipY/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipY * (FlashY + FlashC));
else
Canvas.SetPos(Canvas.ClipX/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipX * (Hand * Default.FireOffset.Y * FlashO), Canvas.ClipY/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipY * FlashY);

Canvas.Style = 3;
Canvas.DrawIcon(MFTexture, MuzzleScale);
Canvas.Style = 1;
}
}
else
bSetFlashTime = false;

SetLocation( Owner.Location + CalcDrawOffset() );
NewRot = Pawn(Owner).ViewRotation;

if ( Hand == 0 )
newRot.Roll = -2 * Default.Rotation.Roll;
else
newRot.Roll = Default.Rotation.Roll * Hand;

setRotation(newRot);
Canvas.DrawActor(self, false);

SetSwitchPriority (pawn Other)


local int i;
local name temp, carried;


if ( PlayerPawn(Other) != None )
{
for ( i=0; i<20; i++)
if ( PlayerPawn(Other).WeaponPriority[i] == class.name )
{
AutoSwitchPriority = i;
return;
}
// else, register this weapon
carried = class.name;
for ( i=AutoSwitchPriority; i<20; i++ )
{
if ( PlayerPawn(Other).WeaponPriority[i] == '' )
{
PlayerPawn(Other).WeaponPriority[i] = carried;
return;
}
else if ( i<19 )
{
temp = PlayerPawn(Other).WeaponPriority[i];
PlayerPawn(Other).WeaponPriority[i] = carried;
carried = temp;
}
}
}

SetWeaponStay


bWeaponStay = bWeaponStay || Level.Game.bCoopWeaponMode;

SpawnCopy (pawn Other) -> inventory


local inventory Copy;
local Weapon newWeapon;


if( Level.Game.ShouldRespawn(self) )
{
Copy = spawn(Class,Other,,,rot(0,0,0));
Copy.Tag = Tag;
Copy.Event = Event;
if ( !bWeaponStay )
GotoState('Sleeping');
}
else
Copy = self;

Copy.RespawnTime = 0.0;
Copy.bHeldItem = true;
Copy.bTossedOut = false;

// DEUS_EX AJY
// Give weapon ammo before giving to player
Weapon(Copy).GiveAmmo(Other);
Copy.GiveTo( Other );

newWeapon = Weapon(Copy);
newWeapon.Instigator = Other;
newWeapon.SetSwitchPriority(Other);
// DEUS_EX CNN - Don't autoswitch weapons
// if ( !Other.bNeverSwitchOnPickup )
// newWeapon.WeaponSet(Other);
newWeapon.AmbientGlow = 0;
return newWeapon;

SplashJump -> bool


return false;

SuggestAttackStyle -> float


return 0.0;

SuggestDefenseStyle -> float


return 0.0;

SwitchPriority -> float


local float temp;
local int bTemp;


if ( !Owner.IsA('PlayerPawn') )
return RateSelf(bTemp);
else if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) )
{
if ( Pawn(Owner).Weapon == self )
return -0.5;
else
return -1;
}
else
return AutoSwitchPriority;

TraceFire (float Accuracy)


local vector HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z;
local actor Other;
local Pawn PawnOwner;


PawnOwner = Pawn(Owner);

Owner.MakeNoise(PawnOwner.SoundDampening);
GetAxes(PawnOwner.ViewRotation,X,Y,Z);
StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
AdjustedAim = PawnOwner.AdjustAim(1000000, StartTrace, 2*AimError, False, False);
EndTrace = StartTrace + Accuracy * (FRand() - 0.5 )* Y * 1000
+ Accuracy * (FRand() - 0.5 ) * Z * 1000;
X = vector(AdjustedAim);
EndTrace += (10000 * X);
Other = PawnOwner.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace);
ProcessTraceHit(Other, HitLocation, HitNormal, X,Y,Z);

TravelPostAccept


Super.TravelPostAccept();
if ( Pawn(Owner) == None )
return;
if ( AmmoName != None )
{
// DEUS_EX CNN - if AmmoType isn't already set (through a travel),
// find the default in the inventory list
if ( AmmoType == None )
{
AmmoType = Ammo(Pawn(Owner).FindInventoryType(AmmoName));
if (AmmoType == None)
{
AmmoType = Spawn(AmmoName); // Create ammo type required
Pawn(Owner).AddInventory(AmmoType); // and add to player's inventory
AmmoType.BecomeItem();
AmmoType.AmmoAmount = PickUpAmmoCount;
AmmoType.GotoState('Idle2');
}
}
}
if ( self == Pawn(Owner).Weapon )
BringUp();
else GoToState('Idle2');

TweenDown


if ( (AnimSequence != '') && (GetAnimGroup(AnimSequence) == 'Select') )
TweenAnim( AnimSequence, AnimFrame * 0.4 );
else
{
// Have the put away animation play twice as fast in multiplayer
if ( Level.NetMode != NM_Standalone )
PlayAnim('Down', 2.0, 0.05);
else
PlayAnim('Down', 1.0, 0.05);
}

TweenSelect


TweenAnim('Select',0.001);

TweenToStill

WeaponChange (byte F) -> Weapon


local Weapon newWeapon;


if ( InventoryGroup == F )
{
/* we want you to change weapons even if you're out of ammo - DEUS_EX CNN
if ( (AmmoType != None) && (AmmoType.AmmoAmount <= 0) )
{
if ( Inventory == None )
newWeapon = None;
else
newWeapon = Inventory.WeaponChange(F);
if ( newWeapon == None )
Pawn(Owner).ClientMessage( ItemName$MessageNoAmmo );
return newWeapon;
}
else
*/
return self;
}
else if ( Inventory == None )
return None;
else
return Inventory.WeaponChange(F);

WeaponSet (Pawn Other) -> bool


local bool bSwitch,bHaveAmmo;
local Inventory Inv;
local weapon W;


if ( Other.Weapon == self)
return false;

if ( Other.Weapon == None )
{
Other.PendingWeapon = self;
Other.ChangedWeapon();
return true;
}
else if ( Other.Weapon.SwitchPriority() < SwitchPriority() )
{
W = Other.PendingWeapon;
Other.PendingWeapon = self;
GotoState('');

if ( Other.Weapon.PutDown() )
return true;
Other.PendingWeapon = W;
return false;
}
else
{
GoToState('');
return false;
}

setHand (float Hand)


if ( Hand == 2 )
{
PlayerViewOffset.Y = 0;
FireOffset.Y = 0;
bHideWeapon = true;
return;
}
else
bHideWeapon = false;

if ( Hand == 0 )
{
PlayerViewOffset.X = Default.PlayerViewOffset.X * 0.88;
PlayerViewOffset.Y = -0.2 * Default.PlayerViewOffset.Y;
PlayerViewOffset.Z = Default.PlayerViewOffset.Z * 1.12;
}
else
{
PlayerViewOffset.X = Default.PlayerViewOffset.X;
PlayerViewOffset.Y = Default.PlayerViewOffset.Y * Hand;
PlayerViewOffset.Z = Default.PlayerViewOffset.Z;
}
PlayerViewOffset *= 100; //scale since network passes vector components as ints
FireOffset.Y = Default.FireOffset.Y * Hand;




ZoneInfo.uc (extends Info)

var() name ZoneTag;
var() vector ZoneGravity;
var() vector ZoneVelocity;
var() float ZoneGroundFriction;
var() float ZoneFluidFriction;
var() float ZoneTerminalVelocity;
var() name ZonePlayerEvent;
var int ZonePlayerCount;
var int NumCarcasses;
var() int DamagePerSec;
var() name DamageType;
var() localized string DamageString;
var(LocationStrings) localized string ZoneName;
var LocationID LocationID;
var() int MaxCarcasses;
var() sound EntrySound; //only if waterzone
var() sound ExitSound; // only if waterzone
var() class EntryActor; // e.g. a splash (only if water zone)
var() class ExitActor; // e.g. a splash (only if water zone)
var skyzoneinfo SkyZone; // Optional sky zone containing this zone's sky.
var() bool bWaterZone; // Zone is water-filled.
var() const bool bFogZone; // Zone is fog-filled.
var() const bool bKillZone; // Zone instantly kills those who enter.
var() bool bNeutralZone; // Players can't take damage in this zone.
var() bool bGravityZone; // Use ZoneGravity.
var() bool bPainZone; // Zone causes pain.
var() bool bDestructive; // Destroys carcasses.
var() bool bNoInventory;
var() bool bMoveProjectiles; // this velocity zone should impart velocity to projectiles and effects
var() bool bBounceVelocity; // this velocity zone should bounce actors that land in it
var(ZoneLight) byte AmbientBrightness, AmbientHue, AmbientSaturation;
var(ZoneLight) color FogColor;
var(ZoneLight) float FogDistance;
var(ZoneLight) const texture EnvironmentMap;
var(ZoneLight) float TexUPanSpeed, TexVPanSpeed;
var(ZoneLight) vector ViewFlash, ViewFog;
var(Reverb) bool bReverbZone;
var(Reverb) bool bRaytraceReverb;
var(Reverb) float SpeedOfSound;
var(Reverb) byte MasterGain;
var(Reverb) int CutoffHz;
var(Reverb) byte Delay[6];
var(Reverb) byte Gain[6];
var(LensFlare) texture LensFlare[12];
var(LensFlare) float LensFlareOffset[12];
var(LensFlare) float LensFlareScale[12];
var() byte MinLightCount; // minimum number of lights to use (when MaxLightingPolyCount is exceeded)
var() byte MaxLightCount; // maximum number of lights to use (when MeshPolyCount drops below MinLightingPolyCount)
var() int MinLightingPolyCount;
var() int MaxLightingPolyCount;
ZoneGravity=(Z=-950.000000)
ZoneGroundFriction=8.000000
ZoneFluidFriction=1.200000
ZoneTerminalVelocity=2500.000000
MaxCarcasses=3
bMoveProjectiles=True
AmbientSaturation=255
TexUPanSpeed=1.000000
TexVPanSpeed=1.000000
SpeedOfSound=8000.000000
MasterGain=100
CutoffHz=6000
Delay(0)=20
Delay(1)=34
Gain(0)=150
Gain(1)=70
MinLightCount=6
MaxLightCount=6
MinLightingPolyCount=1000
MaxLightingPolyCount=5000
bStatic=True
bNoDelete=True
Texture=Texture'Engine.S_ZoneInfo'
bAlwaysRelevant=True
NetUpdateFrequency=4.000000

ActorEntered (actor Other)


local actor A;
local vector AddVelocity;


if ( bNoInventory && Other.IsA('Inventory') && (Other.Owner == None) )
{
Other.LifeSpan = 1.5;
return;
}

if( Pawn(Other)!=None && Pawn(Other).bIsPlayer )
if( ++ZonePlayerCount==1 && ZonePlayerEvent!='' )
foreach AllActors( class 'Actor', A, ZonePlayerEvent )
A.Trigger( Self, Pawn(Other) );

if ( bMoveProjectiles && (ZoneVelocity != vect(0,0,0)) )
{
if ( Other.Physics == PHYS_Projectile )
Other.Velocity += ZoneVelocity;
else if ( Other.IsA('Effects') && (Other.Physics == PHYS_None) )
{
Other.SetPhysics(PHYS_Projectile);
Other.Velocity += ZoneVelocity;
}
}

ActorLeaving (actor Other)


local actor A;

if( Pawn(Other)!=None && Pawn(Other).bIsPlayer )
if( --ZonePlayerCount==0 && ZonePlayerEvent!='' )
foreach AllActors( class 'Actor', A, ZonePlayerEvent )
A.UnTrigger( Self, Pawn(Other) );

LinkToSkybox


local skyzoneinfo TempSkyZone;


// SkyZone.
foreach AllActors( class 'SkyZoneInfo', TempSkyZone, '' )
SkyZone = TempSkyZone;
foreach AllActors( class 'SkyZoneInfo', TempSkyZone, '' )
if( TempSkyZone.bHighDetail == Level.bHighDetailMode )
SkyZone = TempSkyZone;

PreBeginPlay


Super.PreBeginPlay();

// DEUS_EX CNN - set the SoundRadius to ZERO to fix the zone AmbientSound problem
SoundRadius = 0;

// call overridable function to link this ZoneInfo actor to a skybox
LinkToSkybox();

Trigger (actor Other, pawn EventInstigator)


// modified to toggle instead of just set to true - DEUS_EX CNN
// modified to start the pain timer if you are alread in the zone - DEUS_EX CNN
if (DamagePerSec != 0)
{
// bPainZone = true;
bPainZone = !bPainZone;
if (bPainZone)
EventInstigator.PainTimer();
}


ZoneActors (class BaseClass, out actor Actor) | native




ZoneTrigger.uc (extends Trigger)

Touch (actor Other)


local ZoneInfo Z;

if( IsRelevant( Other ) )
{
// Broadcast the Trigger message to all matching actors.
if( Event != '' )
foreach AllActors( class 'ZoneInfo', Z )
if ( Z.ZoneTag == Event )
Z.Trigger( Other, Other.Instigator );

if( Message != "" )
// Send a string message to the toucher.
Other.Instigator.ClientMessage( Message );

if( bTriggerOnceOnly )
// Ignore future touches.
SetCollision(False);
}

UnTouch (actor Other)


local ZoneInfo Z;

if( IsRelevant( Other ) )
{
// Untrigger all matching actors.
if( Event != '' )
foreach AllActors( class 'ZoneInfo', Z )
if ( Z.ZoneTag == Event )
Z.UnTrigger( Other, Other.Instigator );
}




locationid.uc (extends KeyPoint)

var() localized string LocationName;
var() float Radius;
var LocationID NextLocation;

PostBeginPlay


local LocationID L;

Super.PostBeginPlay();

// add self to zone list
if ( Region.Zone.LocationID == None )
{
Region.Zone.LocationID = self;
return;
}

for ( L=Region.Zone.LocationID; L!=None; L=L.NextLocation )
if ( L.NextLocation == None )
{
L.NextLocation = self;
return;
}