Prepare fixtures
This commit is contained in:
parent
797e5ea192
commit
9c94356263
6021 changed files with 722805 additions and 22 deletions
293
kf_sources/Engine/Classes/AIController.uc
Normal file
293
kf_sources/Engine/Classes/AIController.uc
Normal file
|
|
@ -0,0 +1,293 @@
|
|||
//=============================================================================
|
||||
// AIController, the base class of AI.
|
||||
//
|
||||
// Controllers are non-physical actors that can be attached to a pawn to control
|
||||
// its actions. AIControllers implement the artificial intelligence for the pawns they control.
|
||||
//
|
||||
// This is a built-in Unreal class and it shouldn't be modified.
|
||||
//=============================================================================
|
||||
class AIController extends Controller
|
||||
native;
|
||||
|
||||
var bool bHunting; // tells navigation code that pawn is hunting another pawn,
|
||||
// so fall back to finding a path to a visible pathnode if none
|
||||
// are reachable
|
||||
var bool bAdjustFromWalls; // auto-adjust around corners, with no hitwall notification for controller or pawn
|
||||
// if wall is hit during a MoveTo() or MoveToward() latent execution.
|
||||
var bool bPlannedJump; // set when doing voluntary jump
|
||||
|
||||
var AIScript MyScript;
|
||||
var float Skill; // skill, scaled by game difficulty (add difficulty to this value)
|
||||
|
||||
native(510) final latent function WaitToSeeEnemy(); // return when looking directly at visible enemy
|
||||
|
||||
event PreBeginPlay()
|
||||
{
|
||||
Super.PreBeginPlay();
|
||||
if ( bDeleteMe )
|
||||
return;
|
||||
|
||||
if ( Level.Game != None )
|
||||
Skill += Level.Game.GameDifficulty;
|
||||
Skill = FClamp(Skill, 0, 3);
|
||||
}
|
||||
|
||||
function Reset()
|
||||
{
|
||||
bHunting = false;
|
||||
bPlannedJump = false;
|
||||
Super.Reset();
|
||||
}
|
||||
|
||||
simulated function float RateWeapon(Weapon w)
|
||||
{
|
||||
return (W.GetAIRating() + FRand() * 0.05);
|
||||
}
|
||||
|
||||
function Trigger( actor Other, pawn EventInstigator )
|
||||
{
|
||||
TriggerScript(Other,EventInstigator);
|
||||
}
|
||||
|
||||
/* WeaponFireAgain()
|
||||
Notification from weapon when it is ready to fire (either just finished firing,
|
||||
or just finished coming up/reloading).
|
||||
Returns true if weapon should fire.
|
||||
If it returns false, can optionally set up a weapon change
|
||||
*/
|
||||
function bool WeaponFireAgain(float RefireRate, bool bFinishedFire)
|
||||
{
|
||||
if ( Pawn.PressingFire() && (FRand() < RefireRate) )
|
||||
{
|
||||
Pawn.Weapon.BotFire(bFinishedFire);
|
||||
return true;
|
||||
}
|
||||
StopFiring();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* TriggerScript()
|
||||
trigger AI script (this may enable it)
|
||||
*/
|
||||
function bool TriggerScript( actor Other, pawn EventInstigator )
|
||||
{
|
||||
if ( MyScript != None )
|
||||
{
|
||||
MyScript.Trigger(EventInstigator,pawn);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* DisplayDebug()
|
||||
list important controller attributes on canvas
|
||||
*/
|
||||
function DisplayDebug(Canvas Canvas, out float YL, out float YPos)
|
||||
{
|
||||
local int i;
|
||||
local string T;
|
||||
|
||||
Super.DisplayDebug(Canvas,YL, YPos);
|
||||
|
||||
Canvas.DrawColor.B = 255;
|
||||
if ( (Pawn != None) && (MoveTarget != None) && Pawn.ReachedDestination(MoveTarget) )
|
||||
Canvas.DrawText(" Skill "$Skill$" NAVIGATION MoveTarget "$GetItemName(String(MoveTarget))$"(REACHED) PendingMover "$PendingMover$" MoveTimer "$MoveTimer, false);
|
||||
else
|
||||
Canvas.DrawText(" Skill "$Skill$" NAVIGATION MoveTarget "$GetItemName(String(MoveTarget))$" PendingMover "$PendingMover$" MoveTimer "$MoveTimer, false);
|
||||
YPos += YL;
|
||||
Canvas.SetPos(4,YPos);
|
||||
|
||||
T = " Destination "$Destination$" Focus "$GetItemName(string(Focus));
|
||||
if ( bPreparingMove )
|
||||
T = T$" (Preparing Move)";
|
||||
Canvas.DrawText(T, false);
|
||||
YPos += YL;
|
||||
Canvas.SetPos(4,YPos);
|
||||
|
||||
Canvas.DrawText(" RouteGoal "$GetItemName(string(RouteGoal))$" RouteDist "$RouteDist, false);
|
||||
YPos += YL;
|
||||
Canvas.SetPos(4,YPos);
|
||||
|
||||
for ( i=0; i<16; i++ )
|
||||
{
|
||||
if ( RouteCache[i] == None )
|
||||
{
|
||||
if ( i > 5 )
|
||||
T = T$"--"$GetItemName(string(RouteCache[i-1]));
|
||||
break;
|
||||
}
|
||||
else if ( i < 5 )
|
||||
T = T$GetItemName(string(RouteCache[i]))$"-";
|
||||
}
|
||||
|
||||
Canvas.DrawText("RouteCache: "$T, false);
|
||||
YPos += YL;
|
||||
Canvas.SetPos(4,YPos);
|
||||
}
|
||||
|
||||
function float AdjustDesireFor(Pickup P)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* GetFacingDirection()
|
||||
returns direction faced relative to movement dir
|
||||
|
||||
0 = forward
|
||||
16384 = right
|
||||
32768 = back
|
||||
49152 = left
|
||||
*/
|
||||
function int GetFacingDirection()
|
||||
{
|
||||
local float strafeMag;
|
||||
local vector Focus2D, Loc2D, Dest2D, Dir, LookDir, Y;
|
||||
|
||||
// check for strafe or backup
|
||||
Focus2D = FocalPoint;
|
||||
Focus2D.Z = 0;
|
||||
Loc2D = Pawn.Location;
|
||||
Loc2D.Z = 0;
|
||||
Dest2D = Destination;
|
||||
Dest2D.Z = 0;
|
||||
lookDir = Normal(Focus2D - Loc2D);
|
||||
Dir = Normal(Dest2D - Loc2D);
|
||||
strafeMag = lookDir dot Dir;
|
||||
Y = (lookDir Cross vect(0,0,1));
|
||||
if ((Y Dot (Dest2D - Loc2D)) < 0)
|
||||
return ( 49152 + 16384 * strafeMag );
|
||||
else
|
||||
return ( 16384 - 16384 * strafeMag );
|
||||
}
|
||||
|
||||
// AdjustView() called if Controller's pawn is viewtarget of a player
|
||||
function AdjustView(float DeltaTime)
|
||||
{
|
||||
local float TargetYaw, TargetPitch;
|
||||
local rotator OldViewRotation,ViewRotation;
|
||||
|
||||
Super.AdjustView(DeltaTime);
|
||||
if( !Pawn.bUpdateEyeHeight )
|
||||
return;
|
||||
|
||||
// update viewrotation
|
||||
ViewRotation = Rotation;
|
||||
OldViewRotation = Rotation;
|
||||
|
||||
if ( Enemy == None )
|
||||
{
|
||||
ViewRotation.Roll = 0;
|
||||
if ( DeltaTime < 0.2 )
|
||||
{
|
||||
OldViewRotation.Yaw = OldViewRotation.Yaw & 65535;
|
||||
OldViewRotation.Pitch = OldViewRotation.Pitch & 65535;
|
||||
TargetYaw = float(Rotation.Yaw & 65535);
|
||||
if ( Abs(TargetYaw - OldViewRotation.Yaw) > 32768 )
|
||||
{
|
||||
if ( TargetYaw < OldViewRotation.Yaw )
|
||||
TargetYaw += 65536;
|
||||
else
|
||||
TargetYaw -= 65536;
|
||||
}
|
||||
TargetYaw = float(OldViewRotation.Yaw) * (1 - 5 * DeltaTime) + TargetYaw * 5 * DeltaTime;
|
||||
ViewRotation.Yaw = int(TargetYaw);
|
||||
|
||||
TargetPitch = float(Rotation.Pitch & 65535);
|
||||
if ( Abs(TargetPitch - OldViewRotation.Pitch) > 32768 )
|
||||
{
|
||||
if ( TargetPitch < OldViewRotation.Pitch )
|
||||
TargetPitch += 65536;
|
||||
else
|
||||
TargetPitch -= 65536;
|
||||
}
|
||||
TargetPitch = float(OldViewRotation.Pitch) * (1 - 5 * DeltaTime) + TargetPitch * 5 * DeltaTime;
|
||||
ViewRotation.Pitch = int(TargetPitch);
|
||||
SetRotation(ViewRotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SetOrders(name NewOrders, Controller OrderGiver);
|
||||
|
||||
function actor GetOrderObject()
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
function name GetOrders()
|
||||
{
|
||||
return 'None';
|
||||
}
|
||||
|
||||
/* PrepareForMove()
|
||||
Give controller a chance to prepare for a move along the navigation network, from
|
||||
Anchor (current node) to Goal, given the reachspec for that movement.
|
||||
|
||||
Called if the reachspec doesn't support the pawn's current configuration.
|
||||
By default, the pawn will crouch when it hits an actual obstruction. However,
|
||||
Pawns with complex behaviors for setting up their smaller collision may want
|
||||
to call that behavior from here
|
||||
*/
|
||||
event PrepareForMove(NavigationPoint Goal, ReachSpec Path);
|
||||
|
||||
/* WaitForMover()
|
||||
Wait for Mover M to tell me it has completed its move
|
||||
*/
|
||||
function WaitForMover(Mover M)
|
||||
{
|
||||
if ( (Enemy != None) && (Level.TimeSeconds - LastSeenTime < 3.0) )
|
||||
Focus = Enemy;
|
||||
PendingMover = M;
|
||||
bPreparingMove = true;
|
||||
Pawn.Acceleration = vect(0,0,0);
|
||||
}
|
||||
|
||||
/* MoverFinished()
|
||||
Called by Mover when it finishes a move, and this pawn has the mover
|
||||
set as its PendingMover
|
||||
*/
|
||||
function MoverFinished()
|
||||
{
|
||||
if ( PendingMover.MyMarker.ProceedWithMove(Pawn) )
|
||||
{
|
||||
PendingMover = None;
|
||||
bPreparingMove = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* UnderLift()
|
||||
called by mover when it hits a pawn with that mover as its pendingmover while moving to its destination
|
||||
*/
|
||||
function UnderLift(Mover M)
|
||||
{
|
||||
local NavigationPoint N;
|
||||
|
||||
bPreparingMove = false;
|
||||
PendingMover = None;
|
||||
|
||||
// find nearest lift exit and go for that
|
||||
if ( (MoveTarget == None) || MoveTarget.IsA('LiftCenter') )
|
||||
for ( N=Level.NavigationPointList; N!=None; N=N.NextNavigationPoint )
|
||||
if ( N.IsA('LiftExit') && (LiftExit(N).LiftTag == M.Tag)
|
||||
&& ActorReachable(N) )
|
||||
{
|
||||
MoveTarget = N;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function bool PriorityObjective()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function Startle(Actor A);
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bAdjustFromWalls=true
|
||||
PlayerReplicationInfoClass=Class'Engine.PlayerReplicationInfo'
|
||||
bCanOpenDoors=true
|
||||
bCanDoSpecial=true
|
||||
MinHitWall=-0.5f
|
||||
}
|
||||
18
kf_sources/Engine/Classes/AIMarker.uc
Normal file
18
kf_sources/Engine/Classes/AIMarker.uc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//=============================================================================
|
||||
// AIMarker.
|
||||
//=============================================================================
|
||||
class AIMarker extends SmallNavigationPoint
|
||||
native;
|
||||
|
||||
cpptext
|
||||
{
|
||||
virtual UBOOL IsIdentifiedAs(FName ActorName);
|
||||
}
|
||||
|
||||
var AIScript markedScript;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bCollideWhenPlacing=False
|
||||
bHiddenEd=true
|
||||
}
|
||||
57
kf_sources/Engine/Classes/AIScript.uc
Normal file
57
kf_sources/Engine/Classes/AIScript.uc
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
//=============================================================================
|
||||
// AIScript - used by Level Designers to specify special AI scripts for pawns
|
||||
// placed in a level, and to change which type of AI controller to use for a pawn.
|
||||
// AIScripts can be shared by one or many pawns.
|
||||
// Game specific subclasses of AIScript will have editable properties defining game specific behavior and AI
|
||||
// This is a built-in Unreal class and it shouldn't be modified.
|
||||
//=============================================================================
|
||||
class AIScript extends Keypoint
|
||||
native
|
||||
placeable;
|
||||
|
||||
#exec Texture Import File=Textures\AIScript.pcx Name=S_AIScript Mips=Off MASKED=1
|
||||
|
||||
var() class<AIController> ControllerClass;
|
||||
var bool bNavigate; // if true, put an associated path in the navigation network
|
||||
var bool bLoggingEnabled;
|
||||
var AIMarker myMarker;
|
||||
|
||||
cpptext
|
||||
{
|
||||
virtual INT AddMyMarker(AActor *S);
|
||||
virtual void ClearMarker();
|
||||
}
|
||||
|
||||
/* SpawnController()
|
||||
Spawn and initialize an AI Controller (called by a non-player controlled Pawn at level startup)
|
||||
*/
|
||||
function SpawnControllerFor(Pawn P)
|
||||
{
|
||||
local AIController C;
|
||||
|
||||
if ( ControllerClass == None )
|
||||
{
|
||||
if ( P.ControllerClass == None )
|
||||
return;
|
||||
C = Spawn(P.ControllerClass,,,P.Location, P.Rotation);
|
||||
}
|
||||
else
|
||||
C = Spawn(ControllerClass,,,P.Location, P.Rotation);
|
||||
C.MyScript = self;
|
||||
C.Possess(P);
|
||||
}
|
||||
|
||||
function Actor GetMoveTarget()
|
||||
{
|
||||
if ( MyMarker != None )
|
||||
return MyMarker;
|
||||
return self;
|
||||
}
|
||||
|
||||
function TakeOver(Pawn P);
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Texture=S_AIScript
|
||||
DrawScale=+0.5
|
||||
}
|
||||
612
kf_sources/Engine/Classes/AccessControl.uc
Normal file
612
kf_sources/Engine/Classes/AccessControl.uc
Normal file
|
|
@ -0,0 +1,612 @@
|
|||
//=============================================================================
|
||||
// AccessControl.
|
||||
//
|
||||
// AccessControl is a helper class for GameInfo.
|
||||
// The AccessControl class determines whether or not the player is allowed to
|
||||
// login in the PreLogin() function, and also controls whether or not a player
|
||||
// can enter as a spectator or a game administrator.
|
||||
//
|
||||
//=============================================================================
|
||||
class AccessControl extends Info Config;
|
||||
|
||||
struct AdminPlayer
|
||||
{
|
||||
var xAdminUser User;
|
||||
var PlayerReplicationInfo PRI;
|
||||
};
|
||||
|
||||
var xAdminUserList Users;
|
||||
var xAdminGroupList Groups;
|
||||
var protected array<AdminPlayer> LoggedAdmins;
|
||||
var config array< class<xPrivilegeBase> > PrivClasses;
|
||||
var array<xPrivilegeBase> PrivManagers;
|
||||
var string AllPrivs;
|
||||
|
||||
var globalconfig array<string> IPPolicies;
|
||||
var localized string IPBanned;
|
||||
var localized string WrongPassword;
|
||||
var localized string NeedPassword;
|
||||
var localized string SessionBanned;
|
||||
var localized string KickedMsg;
|
||||
var localized string DefaultKickReason;
|
||||
var localized string IdleKickReason;
|
||||
var class<AdminBase> AdminClass;
|
||||
|
||||
var bool bReplyToGUI;
|
||||
var bool bDontAddDefaultAdmin;
|
||||
|
||||
var private string AdminName;
|
||||
var private globalconfig string AdminPassword; // Password to receive bAdmin privileges.
|
||||
var private globalconfig string GamePassword; // Password to enter game.
|
||||
var globalconfig float LoginDelaySeconds; // Delay between login attempts
|
||||
|
||||
var globalconfig bool bBanByID; // Set to true to ban by CDKey hash
|
||||
var globalconfig Array<string> BannedIDs; // Holds information about how got banned
|
||||
|
||||
var transient Array<string> SessionIPPolicies; // sjs
|
||||
var transient array<string> SessionBannedIDs;
|
||||
|
||||
const PROPNUM = 4;
|
||||
var localized string ACDisplayText[PROPNUM];
|
||||
var localized string ACDescText[PROPNUM];
|
||||
|
||||
event PreBeginPlay()
|
||||
{
|
||||
local xAdminUser NewUser;
|
||||
|
||||
Super.PreBeginPlay();
|
||||
|
||||
assert( Users == None );
|
||||
Users = new(Level.xLevel) class'xAdminUserList';
|
||||
assert( Groups == None );
|
||||
Groups = new(Level.xLevel) class'xAdminGroupList';
|
||||
|
||||
if (!bDontAddDefaultAdmin)
|
||||
{
|
||||
Groups.Add(Groups.CreateGroup("Admin", "", 255));
|
||||
NewUser = Users.Create(AdminName, AdminPassword, "");
|
||||
NewUser.AddGroup(Groups.FindByName("Admin"));
|
||||
Users.Add(NewUser);
|
||||
AdminName = "Admin";
|
||||
}
|
||||
InitPrivs();
|
||||
}
|
||||
|
||||
function InitPrivs();
|
||||
|
||||
function SaveAdmins()
|
||||
{
|
||||
AdminPassword = Users.Get(0).Password;
|
||||
}
|
||||
|
||||
//if _RO_
|
||||
function bool AdminLoginSilent( PlayerController P, string Username, string Password)
|
||||
{
|
||||
if ( ValidLogin(Username, Password) )
|
||||
{
|
||||
P.PlayerReplicationInfo.bSilentAdmin = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//end _RO_
|
||||
|
||||
function bool AdminLogin( PlayerController P, string Username, string Password)
|
||||
{
|
||||
if ( ValidLogin(Username, Password) )
|
||||
{
|
||||
P.PlayerReplicationInfo.bAdmin = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool AdminLogout( PlayerController P )
|
||||
{
|
||||
//if _RO_
|
||||
if (P.PlayerReplicationInfo.bAdmin || P.PlayerReplicationInfo.bSilentAdmin)
|
||||
//else
|
||||
//if (P.PlayerReplicationInfo.bAdmin)
|
||||
//end _RO_
|
||||
{
|
||||
P.PlayerReplicationInfo.bAdmin = false;
|
||||
//if _RO_
|
||||
P.PlayerReplicationInfo.bSilentAdmin = false;
|
||||
//end _RO_
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function AdminEntered( PlayerController P, string Username)
|
||||
{
|
||||
Log(P.PlayerReplicationInfo.PlayerName@"logged in as Administrator.");
|
||||
Level.Game.Broadcast( P, P.PlayerReplicationInfo.PlayerName@"logged in as a server administrator." );
|
||||
}
|
||||
|
||||
function AdminExited( PlayerController P )
|
||||
{
|
||||
Log(P.PlayerReplicationInfo.PlayerName@"logged out.");
|
||||
Level.Game.Broadcast( P, P.PlayerReplicationInfo.PlayerName@"gave up administrator abilities.");
|
||||
}
|
||||
|
||||
function bool IsAdmin(PlayerController P)
|
||||
{
|
||||
return P.PlayerReplicationInfo.bAdmin;
|
||||
}
|
||||
|
||||
function SetAdminFromURL(string N, string P)
|
||||
{
|
||||
local xAdminUser NewUser;
|
||||
local xAdminGroup NewGroup;
|
||||
|
||||
Log("SetAdminFromURL called");
|
||||
NewGroup = Groups.CreateGroup("URL::Admin", "", 255);
|
||||
NewGroup.bMasterAdmin = true;
|
||||
Groups.Add(NewGroup);
|
||||
NewUser = Users.Create(N, P, "");
|
||||
NewUser.AddGroup(NewGroup);
|
||||
Users.Add(NewUser);
|
||||
AdminName = N;
|
||||
SetAdminPassword(P);
|
||||
}
|
||||
|
||||
function bool SetAdminPassword(string P)
|
||||
{
|
||||
AdminPassword = P;
|
||||
return true;
|
||||
}
|
||||
|
||||
function SetGamePassword(string P)
|
||||
{
|
||||
GamePassword = P;
|
||||
}
|
||||
|
||||
function bool RequiresPassword()
|
||||
{
|
||||
return GamePassword != "";
|
||||
}
|
||||
|
||||
function xAdminUser GetAdmin( PlayerController PC)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
function string GetAdminName( PlayerController PC)
|
||||
{
|
||||
return AdminName;
|
||||
}
|
||||
|
||||
function Kick( string S )
|
||||
{
|
||||
local Controller C, NextC;
|
||||
|
||||
for ( C=Level.ControllerList; C!=None; C=NextC )
|
||||
{
|
||||
NextC = C.NextController;
|
||||
if ( C.PlayerReplicationInfo != None && C.PlayerReplicationInfo.PlayerName~=S )
|
||||
{
|
||||
if (PlayerController(C) != None)
|
||||
KickPlayer(PlayerController(C));
|
||||
else if ( C.PlayerReplicationInfo.bBot )
|
||||
{
|
||||
if (C.Pawn != none && Vehicle(C.Pawn) == none)
|
||||
C.Pawn.Destroy();
|
||||
if (C != None)
|
||||
C.Destroy();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SessionKickBan( string S ) // sjs
|
||||
{
|
||||
local PlayerController P;
|
||||
|
||||
ForEach DynamicActors(class'PlayerController', P)
|
||||
if ( P.PlayerReplicationInfo.PlayerName~=S
|
||||
&& (NetConnection(P.Player)!=None) )
|
||||
{
|
||||
BanPlayer(P, true);
|
||||
}
|
||||
}
|
||||
|
||||
function KickBan( string S )
|
||||
{
|
||||
local PlayerController P;
|
||||
|
||||
ForEach DynamicActors(class'PlayerController', P)
|
||||
if ( P.PlayerReplicationInfo.PlayerName~=S
|
||||
&& (NetConnection(P.Player)!=None) )
|
||||
{
|
||||
BanPlayer(P);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function bool KickPlayer(PlayerController C)
|
||||
{
|
||||
// Do not kick logged admins
|
||||
if (C != None && !IsAdmin(C) && NetConnection(C.Player)!=None )
|
||||
{
|
||||
// TODO implement a way for admins to specify the reason
|
||||
C.ClientNetworkMessage("AC_Kicked",DefaultKickReason);
|
||||
if (C.Pawn != none && Vehicle(C.Pawn) == none)
|
||||
C.Pawn.Destroy();
|
||||
if (C != None)
|
||||
C.Destroy();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool BanPlayer(PlayerController C, optional bool bSession)
|
||||
{
|
||||
local string IP;
|
||||
|
||||
if (IsAdmin(C))
|
||||
return false;
|
||||
|
||||
IP = C.GetPlayerNetworkAddress();
|
||||
if( CheckIPPolicy(IP) == 0 )
|
||||
{
|
||||
IP = Left(IP, InStr(IP, ":"));
|
||||
if (bSession)
|
||||
{
|
||||
Log("Adding Session Ban for: "$IP@C.GetPlayerIDHash()@C.PlayerReplicationInfo.PlayerName);
|
||||
|
||||
if (bBanByID)
|
||||
SessionBannedIDs[SessionBannedIDs.Length] = C.GetPlayerIDHash()@C.PlayerReplicationInfo.PlayerName;
|
||||
else
|
||||
SessionIPPolicies[SessionIPPolicies.Length] = "DENY;"$IP;
|
||||
|
||||
SaveConfig();
|
||||
C.ClientNetworkMessage("AC_SessionBan",Level.Game.GameReplicationInfo.AdminEmail);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log("Adding Global Ban for: "$IP@C.GetPlayerIDHash()@C.PlayerReplicationInfo.PlayerName);
|
||||
|
||||
if (bBanByID)
|
||||
BannedIDs[BannedIDs.Length] = C.GetPlayerIDHash()@C.PlayerReplicationInfo.PlayerName;
|
||||
else
|
||||
IPPolicies[IPPolicies.Length] = "DENY;"$IP;
|
||||
|
||||
SaveConfig();
|
||||
C.ClientNetworkMessage("AC_Ban",Level.Game.GameReplicationInfo.AdminEmail);
|
||||
}
|
||||
|
||||
if ( C.Pawn != None && Vehicle(C.Pawn) == none )
|
||||
C.Pawn.Destroy();
|
||||
C.Destroy();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool KickBanPlayer(PlayerController P)
|
||||
{
|
||||
local string IP;
|
||||
|
||||
if (!IsAdmin(P))
|
||||
{
|
||||
IP = P.GetPlayerNetworkAddress();
|
||||
if( CheckIPPolicy(IP) == 0 )
|
||||
{
|
||||
IP = Left(IP, InStr(IP, ":"));
|
||||
Log("Adding Global Ban for: "$IP@P.GetPlayerIDHash()@P.PlayerReplicationInfo.PlayerName);
|
||||
|
||||
if (bBanById)
|
||||
BannedIDs[BannedIDs.Length] = P.GetPlayerIDHash()@P.PlayerReplicationInfo.PlayerName;
|
||||
else
|
||||
IPPolicies[IPPolicies.Length] = "DENY;"$IP;
|
||||
|
||||
SaveConfig();
|
||||
P.ClientNetworkMessage("AC_Ban",Level.Game.GameReplicationInfo.AdminEmail);
|
||||
}
|
||||
else P.ClientNetworkMessage("AC_Kicked",DefaultKickReason);
|
||||
if ( P.Pawn != None && Vehicle(P.Pawn) == none)
|
||||
P.Pawn.Destroy();
|
||||
|
||||
P.Destroy();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool CheckOptionsAdmin( string Options)
|
||||
{
|
||||
local string InAdminName, InPassword;
|
||||
|
||||
InPassword = Level.Game.ParseOption( Options, "Password" );
|
||||
InAdminName= Level.Game.ParseOption( Options, "AdminName" );
|
||||
return ValidLogin(InAdminName, InPassword);
|
||||
}
|
||||
|
||||
function bool ValidLogin(string UserName, string Password)
|
||||
{
|
||||
return (AdminPassword != "" && Password==AdminPassword);
|
||||
}
|
||||
|
||||
function xAdminUser GetLoggedAdmin(PlayerController P)
|
||||
{
|
||||
return Users.Get(0);
|
||||
}
|
||||
|
||||
function xAdminUser GetUser(string uname)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
//
|
||||
// Accept or reject a player on the server.
|
||||
// Fails login if you set the Error to a non-empty string.
|
||||
//
|
||||
event PreLogin
|
||||
(
|
||||
string Options,
|
||||
string Address,
|
||||
string PlayerID,
|
||||
out string Error,
|
||||
out string FailCode,
|
||||
bool bSpectator
|
||||
)
|
||||
{
|
||||
// Do any name or password or name validation here.
|
||||
local string InPassword;
|
||||
local bool bAdmin;
|
||||
local int Result;
|
||||
|
||||
Error="";
|
||||
InPassword = Level.Game.ParseOption( Options, "Password" );
|
||||
bAdmin = CheckOptionsAdmin(Options);
|
||||
|
||||
if( (Level.NetMode != NM_Standalone) && !bAdmin && Level.Game.AtCapacity(bSpectator) )
|
||||
{
|
||||
// TODO: Check Login to make room for Master Admins if not enuff specs.
|
||||
|
||||
FailCode="SERVERFULL";
|
||||
// Error=Level.Game.GameMessageClass.Default.MaxedOutMessage;
|
||||
|
||||
// Must clear error string so that client doesn't receive additional connection failed messages
|
||||
Error = "";
|
||||
}
|
||||
else if ( GamePassword!="" && caps(InPassword)!=caps(GamePassword) && !bAdmin )
|
||||
{
|
||||
if( InPassword == "" )
|
||||
{
|
||||
Error = "";
|
||||
FailCode = "NEEDPW";
|
||||
}
|
||||
else
|
||||
{
|
||||
Error = "";
|
||||
FailCode = "WRONGPW";
|
||||
}
|
||||
}
|
||||
|
||||
Result = CheckIPPolicy(Address);
|
||||
if ( Result == 0 && bBanByID )
|
||||
Result = CheckID(PlayerID);
|
||||
|
||||
if ( Result > 0 )
|
||||
{
|
||||
if ( Result == 1 )
|
||||
{
|
||||
Error = "";
|
||||
FailCode = "SESSIONBAN";
|
||||
}
|
||||
|
||||
else if ( Result == 2 )
|
||||
{
|
||||
Error = "";
|
||||
FailCode = "LOCALBAN";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 0 - accept, 1 - sessionban, 2 - permanent ban
|
||||
function int CheckIPPolicy(string Address, optional bool bSilent)
|
||||
{
|
||||
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<IPPolicies.Length; i++)
|
||||
{
|
||||
if ( Divide( IPPolicies[i], ";", Policy, Mask ) )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
if ( !bSilent )
|
||||
Log("Denied connection for "$Address$" with IP policy "$IPPolicies[LastMatchingPolicy]);
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
// check session polices
|
||||
for(i=0; i<SessionIPPolicies.Length && SessionIPPolicies[i] != ""; i++ )
|
||||
{
|
||||
Divide( SessionIPPolicies[i], ";", Policy, Mask );
|
||||
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 )
|
||||
{
|
||||
if ( !bSilent )
|
||||
Log("Denied connection for "$Address$" with Session IP policy "$SessionIPPolicies[LastMatchingPolicy]);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Stubs in preparation of multi-admin system
|
||||
function bool CanPerform(PlayerController P, string Action)
|
||||
{
|
||||
// Filter out any Admin Users/Group/commands
|
||||
if (!AllowPriv(Action))
|
||||
return false;
|
||||
|
||||
// Standard Admin actions only performed by Admin
|
||||
//if _RO_
|
||||
return P.PlayerReplicationInfo.bAdmin || P.PlayerReplicationInfo.bSilentAdmin;
|
||||
//else
|
||||
//return P.PlayerReplicationInfo.bAdmin;
|
||||
//end _RO_
|
||||
}
|
||||
|
||||
function bool AllowPriv(string priv)
|
||||
{
|
||||
if (Left(priv, 1) ~= "A" || Left(priv, 1) ~= "G")
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static function FillPlayInfo(PlayInfo PlayInfo)
|
||||
{
|
||||
local int i;
|
||||
|
||||
Super.FillPlayInfo(PlayInfo); // Always begin with calling parent
|
||||
|
||||
i=0;
|
||||
PlayInfo.AddSetting(default.ServerGroup, "GamePassword", default.ACDisplayText[i++], 240, 1, "Text", "16",,True,True);
|
||||
PlayInfo.AddSetting(default.ServerGroup, "IPPolicies", default.ACDisplayText[i++], 254, 1, "Text", "15",,True,True);
|
||||
PlayInfo.AddSetting(default.ServerGroup, "AdminPassword", default.ACDisplayText[i++], 255, 1, "Text", "16",,True,True);
|
||||
PlayInfo.AddSetting(default.ServerGroup, "LoginDelaySeconds", default.ACDisplayText[i++], 200, 1, "Text", "3;0:999",,True,True);
|
||||
}
|
||||
|
||||
static event string GetDescriptionText(string PropName)
|
||||
{
|
||||
switch (PropName)
|
||||
{
|
||||
case "GamePassword": return default.ACDescText[0];
|
||||
case "IPPolicies": return default.ACDescText[1];
|
||||
case "AdminPassword": return default.ACDescText[2];
|
||||
case "LoginDelaySeconds": return default.ACDescText[3];
|
||||
}
|
||||
|
||||
return Super.GetDescriptionText(PropName);
|
||||
}
|
||||
|
||||
// 0 - ok, 1 - session, 2 - perm
|
||||
// STEAM AUTH Minor changes to handle steamids justin h
|
||||
function int CheckID(string CDHash)
|
||||
{
|
||||
local int i;
|
||||
local string id;
|
||||
|
||||
//log("AccessControl::CheckID "$CDHash);
|
||||
|
||||
// IF _RO_
|
||||
// if ( class'LevelInfo'.static.IsDemoBuild() )
|
||||
// return 0;
|
||||
|
||||
|
||||
for (i=0;i<BannedIDs.Length;i++)
|
||||
{
|
||||
id = Left(BannedIDs[i], InStr(BannedIDs[i], " "));
|
||||
|
||||
// Use the old system if the Steam system isn't enabled
|
||||
if( id == "" )
|
||||
id = Left(BannedIDs[i],32);
|
||||
|
||||
if ( CDHash ~= id)//STEAMAUTH -- ~=Left(BannedIDs[i],32) )
|
||||
return 2;
|
||||
}
|
||||
|
||||
for (i=0;i<SessionBannedIDs.Length;i++)
|
||||
{
|
||||
id = Left(SessionBannedIDs[i], InStr(SessionBannedIDs[i], " "));
|
||||
|
||||
// Use the old system if the Steam system isn't enabled
|
||||
if( id == "" )
|
||||
id = Left(SessionBannedIDs[i],32);
|
||||
|
||||
if ( CDHash ~= id)//STEAMAUTH -- ~=Left(SessionBannedIDs[i],32) )
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DefaultKickReason="None specified"
|
||||
IdleKickReason="Kicked for idling."
|
||||
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."
|
||||
SessionBanned="Your IP address has been banned from the current game session."
|
||||
IPPolicies(0)="ACCEPT;*"
|
||||
AdminClass=class'Engine.Admin'
|
||||
KickedMsg="You have been forcibly removed from the game."
|
||||
ACDisplayText(0)="Game Password"
|
||||
ACDisplayText(1)="Access Policies"
|
||||
ACDisplayText(2)="Admin Password"
|
||||
ACDisplayText(3)="Login Delay"
|
||||
ACDescText(0)="If this password is set, players will have to enter it to join this server."
|
||||
ACDescText(1)="Specifies IP addresses or address ranges which have been banned."
|
||||
ACDescText(2)="Password required to login with administrator privileges on this server."
|
||||
ACDescText(3)="Number of seconds user must wait after an unsuccessful login attempt before able to login again."
|
||||
}
|
||||
18
kf_sources/Engine/Classes/ActionMoveCamera.uc
Normal file
18
kf_sources/Engine/Classes/ActionMoveCamera.uc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//=============================================================================
|
||||
// ActionMoveCamera:
|
||||
//
|
||||
// Moves the camera to a specified interpolation point.
|
||||
//=============================================================================
|
||||
class ActionMoveCamera extends MatAction
|
||||
native;
|
||||
|
||||
var(Path) config enum EPathStyle
|
||||
{
|
||||
PATHSTYLE_Linear,
|
||||
PATHSTYLE_Bezier,
|
||||
} PathStyle;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
PathStyle=PATHSTYLE_Linear
|
||||
}
|
||||
11
kf_sources/Engine/Classes/ActionPause.uc
Normal file
11
kf_sources/Engine/Classes/ActionPause.uc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
//=============================================================================
|
||||
// ActionPause:
|
||||
//
|
||||
// Pauses for X seconds.
|
||||
//=============================================================================
|
||||
class ActionPause extends MatAction
|
||||
native;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
2130
kf_sources/Engine/Classes/Actor.uc
Normal file
2130
kf_sources/Engine/Classes/Actor.uc
Normal file
File diff suppressed because it is too large
Load diff
26
kf_sources/Engine/Classes/AdAsset.uc
Normal file
26
kf_sources/Engine/Classes/AdAsset.uc
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
class AdAsset extends Object
|
||||
native;
|
||||
|
||||
enum AdAssetState
|
||||
{
|
||||
ADASSET_STATE_CREATED,
|
||||
ADASSET_STATE_DOWNLOADING,
|
||||
ADASSET_STATE_DOWNLOADED,
|
||||
ADASSET_STATE_ERROR,
|
||||
};
|
||||
|
||||
var() string InventoryName;
|
||||
var() string ZoneName;
|
||||
var() string DownloadPath;
|
||||
var const transient pointer Subscriber;
|
||||
|
||||
native final function string GetLastErrorString();
|
||||
native final function SetVisible(bool visible, int width, int height);
|
||||
native final function Displayed();
|
||||
native final function bool HasBeenDisplayed();
|
||||
native final function AdAssetState GetState();
|
||||
|
||||
event OnStateChanged()
|
||||
{
|
||||
}
|
||||
49
kf_sources/Engine/Classes/Admin.uc
Normal file
49
kf_sources/Engine/Classes/Admin.uc
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
class Admin extends AdminBase;
|
||||
|
||||
//if _RO_
|
||||
// Execute an administrative console command on the server.
|
||||
function DoLoginSilent( string Username, string Password)
|
||||
{
|
||||
if (Level.Game.AccessControl.AdminLoginSilent(Outer, Username, Password))
|
||||
{
|
||||
bAdmin = true;
|
||||
Outer.ReceiveLocalizedMessage(Level.Game.GameMessageClass, 20);
|
||||
}
|
||||
}
|
||||
//end _RO_
|
||||
|
||||
// Execute an administrative console command on the server.
|
||||
function DoLogin( string Username, string Password )
|
||||
{
|
||||
if (Level.Game.AccessControl.AdminLogin(Outer, Username, Password))
|
||||
{
|
||||
bAdmin = true;
|
||||
Level.Game.AccessControl.AdminEntered(Outer, "");
|
||||
}
|
||||
}
|
||||
|
||||
function DoLogout()
|
||||
{
|
||||
//if _RO_
|
||||
local bool bWasSilent;
|
||||
|
||||
bWasSilent = Outer.PlayerReplicationInfo.bSilentAdmin;
|
||||
//end _RO_
|
||||
|
||||
if (Level.Game.AccessControl.AdminLogout(Outer))
|
||||
{
|
||||
bAdmin = false;
|
||||
//if _RO_
|
||||
if (bWasSilent)
|
||||
Outer.ReceiveLocalizedMessage(Level.Game.GameMessageClass, 21);
|
||||
else
|
||||
Level.Game.AccessControl.AdminExited(Outer);
|
||||
//else
|
||||
//Level.Game.AccessControl.AdminExited(Outer);
|
||||
//end _RO_
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
475
kf_sources/Engine/Classes/AdminBase.uc
Normal file
475
kf_sources/Engine/Classes/AdminBase.uc
Normal file
|
|
@ -0,0 +1,475 @@
|
|||
// ====================================================================
|
||||
// Class: Engine.AdminBase
|
||||
// Parent: Core.Object
|
||||
//
|
||||
// <Enter a description here>
|
||||
// ====================================================================
|
||||
|
||||
class AdminBase extends Object Within PlayerController
|
||||
abstract native;
|
||||
|
||||
var bool bAdmin;
|
||||
var AccessControl Manager;
|
||||
|
||||
var localized string Msg_PlayerList;
|
||||
var localized string Msg_AllGameMaps;
|
||||
var localized string Msg_AllMapLists;
|
||||
var localized string Msg_MapRotationList;
|
||||
var localized string Msg_NoMapsAdded;
|
||||
var localized string Msg_AddedMapToList;
|
||||
var localized string Msg_NoMapsRemoved;
|
||||
var localized string Msg_RemovedFromList;
|
||||
var localized string Msg_PlayerBanned;
|
||||
var localized string Msg_SessionBanned;
|
||||
var localized string Msg_PlayerKicked;
|
||||
var localized string Msg_NextMapNotFound;
|
||||
var localized string Msg_ChangingMapTo;
|
||||
var localized string Msg_NoMapInRotation;
|
||||
var localized string Msg_NoMapsFound;
|
||||
var localized string Msg_MapIsInRotation;
|
||||
var localized string Msg_MapNotInRotation;
|
||||
var localized string Msg_UnknownParam;
|
||||
var localized string Msg_NoParamsFound;
|
||||
var localized string Msg_ParamModified;
|
||||
var localized string Msg_ParamNotModified;
|
||||
var localized string Msg_MapListAdded;
|
||||
var localized string Msg_MapListRemoved;
|
||||
var localized string Msg_MapIsNotInRotation;
|
||||
var localized string Msg_EditingMapList;
|
||||
|
||||
|
||||
function Created()
|
||||
{
|
||||
if (Level.Game.AccessControl != None)
|
||||
Manager = Level.Game.AccessControl;
|
||||
}
|
||||
|
||||
//if _RO_
|
||||
function DoLoginSilent( string Username, string Password );
|
||||
//end _RO_
|
||||
|
||||
function DoLogin( string UserName, string Password );
|
||||
function DoLogout();
|
||||
function DoSwitch( string URL)
|
||||
{
|
||||
Level.ServerTravel( URL, false );
|
||||
}
|
||||
|
||||
function GoToNextMap()
|
||||
{
|
||||
if (bAdmin)
|
||||
{
|
||||
Level.Game.bChangeLevels=true;
|
||||
Level.Game.bAlreadyChanged=false;
|
||||
Level.Game.RestartGame();
|
||||
}
|
||||
}
|
||||
|
||||
function ShowCurrentMapList()
|
||||
{
|
||||
local int i, c;
|
||||
local array<string> Ar;
|
||||
|
||||
i = MapHandler.GetGameIndex(string(Level.Game.Class));
|
||||
c = MapHandler.GetActiveList(i);
|
||||
|
||||
Ar = MapHandler.GetCacheMapList( Level.Game.Acronym );
|
||||
SendComplexMsg(Ar, Msg_AllGameMaps@MapHandler.GetMapListTitle(i,c));
|
||||
}
|
||||
|
||||
function array<string> GetMapListNames(string GameType)
|
||||
{
|
||||
local int i;
|
||||
local array<string> Ar;
|
||||
|
||||
i = MapHandler.GetGameIndex(GameType);
|
||||
Ar = MapHandler.GetMapListNames(i);
|
||||
return Ar;
|
||||
}
|
||||
|
||||
function MaplistCommand( string Cmd, string Extra )
|
||||
{
|
||||
local array<string> Values;
|
||||
local string Str;
|
||||
local int i, c;
|
||||
|
||||
if (CanPerform("Ml"))
|
||||
{
|
||||
Cmd = Caps(Cmd);
|
||||
i = MapHandler.GetGameIndex(string(Level.Game.Class));
|
||||
|
||||
switch (Cmd)
|
||||
{
|
||||
case "LIST":
|
||||
Values = MapHandler.GetMapListNames(i);
|
||||
SendComplexMsg(Values, Repl(Msg_AllMapLists, "%gametype%", string(Level.Game.Class)));
|
||||
break;
|
||||
|
||||
case "USED":
|
||||
if (Extra == "")
|
||||
c = MapHandler.GetActiveList(i);
|
||||
else c = int(Extra);
|
||||
Str = MapHandler.GetMapListTitle(i, c);
|
||||
|
||||
Values = MapHandler.GetMapList(i, c);
|
||||
SendComplexMsg(Values, Repl(Msg_MapRotationList, "%maplist%", Str));
|
||||
break;
|
||||
|
||||
case "SWITCH":
|
||||
if (Extra == "")
|
||||
c = MapHandler.GetActiveList(i);
|
||||
else c = int(Extra);
|
||||
Str = MapHandler.GetMapListTitle(i, c);
|
||||
|
||||
case "ADD":
|
||||
c = MapHandler.GetActiveList(i);
|
||||
Split(Extra, ",", Values);
|
||||
if (Values.Length == 0)
|
||||
ClientMessage( Repl(Msg_NoMapsAdded, "%maplist%", MapHandler.GetMapListTitle(i,c)) );
|
||||
else
|
||||
{
|
||||
for ( i = Values.Length - 1; i >= 0; i-- )
|
||||
{
|
||||
if ( !MapHandler.AddMap(i,c,Values[i]) )
|
||||
Values.Remove(i,1);
|
||||
}
|
||||
|
||||
SendComplexMsg(Values, Msg_AddedMapToList @ MapHandler.GetMapListTitle(i, c));
|
||||
}
|
||||
break;
|
||||
|
||||
case "DEL":
|
||||
c = MapHandler.GetActiveList(i);
|
||||
Split(Extra, ",", Values);
|
||||
if ( Values.Length == 0 )
|
||||
ClientMessage( Repl(Msg_NoMapsRemoved, "%maplist%", MapHandler.GetMaplistTitle(i,c)) );
|
||||
else
|
||||
{
|
||||
for ( i = Values.Length - 1; i >= 0; i-- )
|
||||
{
|
||||
if ( !MapHandler.RemoveMap(i,c,Values[i]) )
|
||||
Values.Remove(i,1);
|
||||
}
|
||||
|
||||
SendComplexMsg(Values, Msg_RemovedFromList @ MapHandler.GetMapListTitle(i, c));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function RestartCurrentMap()
|
||||
{
|
||||
Level.ServerTravel("?restart",false);
|
||||
}
|
||||
|
||||
// =====================================================================================================================
|
||||
// =====================================================================================================================
|
||||
// Console Commands
|
||||
// =====================================================================================================================
|
||||
// =====================================================================================================================
|
||||
|
||||
exec function PlayerList()
|
||||
{
|
||||
local PlayerReplicationInfo PRI;
|
||||
|
||||
if ( CanPerform("Xp") )
|
||||
{
|
||||
log(Msg_PlayerList);
|
||||
ForEach DynamicActors(class'PlayerReplicationInfo', PRI)
|
||||
log(PRI.PlayerName@"( ping"@PRI.Ping$")");
|
||||
}
|
||||
}
|
||||
|
||||
exec function Kick( string Cmd, string Extra )
|
||||
{
|
||||
local array<string> Params;
|
||||
local array<PlayerReplicationInfo> AllPRI;
|
||||
local Controller C, NextC;
|
||||
local int i;
|
||||
|
||||
if (CanPerform("Kp") || CanPerform("Kb")) // Kp = Kick Players, Kb = Kick/Ban
|
||||
{
|
||||
if (Cmd ~= "List")
|
||||
{
|
||||
// Get the list of players to kick by showing their PlayerID
|
||||
// TODO: Display Fixed Playername (no garbage chars in name)?
|
||||
// TODO: Display Sorted ?
|
||||
Level.Game.GameReplicationInfo.GetPRIArray(AllPRI);
|
||||
for (i = 0; i<AllPRI.Length; i++)
|
||||
{
|
||||
if( PlayerController(AllPRI[i].Owner) != none && AllPRI[i].PlayerName != "WebAdmin")
|
||||
ClientMessage(Right(" "$AllPRI[i].PlayerID, 3)$")"@AllPRI[i].PlayerName@" "$PlayerController(AllPRI[i].Owner).GetPlayerIDHash());
|
||||
else
|
||||
ClientMessage(Right(" "$AllPRI[i].PlayerID, 3)$")"@AllPRI[i].PlayerName);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (Cmd ~= "Ban" || Cmd ~= "Session")
|
||||
Params = SplitParams(Extra);
|
||||
|
||||
else if (Extra != "")
|
||||
Params = SplitParams(Cmd@Extra);
|
||||
|
||||
else
|
||||
Params = SplitParams(Cmd);
|
||||
|
||||
// go thru all Players
|
||||
for (C = Level.ControllerList; C != None; C = NextC)
|
||||
{
|
||||
NextC = C.NextController;
|
||||
// Allow to kick bots too, for now i dont
|
||||
// What about Spectators ?? hummm ...
|
||||
if (C != Owner && PlayerController(C) != None && C.PlayerReplicationInfo != None)
|
||||
{
|
||||
for (i = 0; i<Params.Length; i++)
|
||||
{
|
||||
if ((IsNumeric(Params[i]) && C.PlayerReplicationInfo.PlayerID == int(Params[i]))
|
||||
|| MaskedCompare(C.PlayerReplicationInfo.PlayerName, Params[i]))
|
||||
{
|
||||
// Kick that player
|
||||
if (Cmd ~= "Ban")
|
||||
{
|
||||
ClientMessage(Repl(Msg_PlayerBanned, "%Player%", C.PlayerReplicationInfo.PlayerName));
|
||||
Manager.BanPlayer(PlayerController(C));
|
||||
}
|
||||
else if (Cmd ~= "Session")
|
||||
{
|
||||
ClientMessage(Repl(Msg_SessionBanned, "%Player%", C.PlayerReplicationInfo.PlayerName));
|
||||
Manager.BanPlayer(PlayerController(C), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Manager.KickPlayer(PlayerController(C));
|
||||
ClientMessage(Repl(Msg_PlayerKicked, "%Player%", C.PlayerReplicationInfo.PlayerName));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exec function KickBan(string s)
|
||||
{
|
||||
Kick("ban", s);
|
||||
}
|
||||
|
||||
exec function RestartMap()
|
||||
{
|
||||
RestartCurrentMap();
|
||||
}
|
||||
|
||||
exec function NextMap()
|
||||
{
|
||||
GotoNextMap();
|
||||
}
|
||||
|
||||
exec function Map( string Cmd )
|
||||
{
|
||||
if (Cmd ~= "Restart")
|
||||
{
|
||||
ConsoleCommand("RestartMap");
|
||||
}
|
||||
else if (Cmd ~= "Next")
|
||||
{
|
||||
GotoNextMap();
|
||||
}
|
||||
else if (Cmd ~= "List")
|
||||
{
|
||||
ShowCurrentMapList();
|
||||
}
|
||||
else
|
||||
{
|
||||
DoSwitch(Cmd);
|
||||
}
|
||||
}
|
||||
|
||||
exec function Maplist( string Cmd, string Extra )
|
||||
{
|
||||
MaplistCommand( Cmd, Extra );
|
||||
}
|
||||
|
||||
exec function Switch( string URL )
|
||||
{
|
||||
DoSwitch(URL);
|
||||
}
|
||||
|
||||
// =====================================================================================================================
|
||||
// =====================================================================================================================
|
||||
// Utility functions
|
||||
// =====================================================================================================================
|
||||
// =====================================================================================================================
|
||||
|
||||
protected function bool CanPerform(string priv)
|
||||
{
|
||||
return Manager.CanPerform(Outer, Priv);
|
||||
}
|
||||
|
||||
protected function string FindGameType(string GameType)
|
||||
{
|
||||
local int i;
|
||||
local array<CacheManager.GameRecord> Records;
|
||||
|
||||
class'CacheManager'.static.GetGameTypeList(Records);
|
||||
|
||||
for ( i = 0; i < Records.Length; i++ )
|
||||
{
|
||||
if (GameType ~= Records[i].ClassName) break;
|
||||
if (GameType ~= Records[i].GameAcronym) break;
|
||||
if (GameType ~= Records[i].TextName) break;
|
||||
if (Right(Records[i].ClassName, Len(GameType)+1) ~= ("."$GameType)) break;
|
||||
if (Right(Records[i].TextName, Len(GameType)+1) ~= ("."$GameType)) break;
|
||||
}
|
||||
|
||||
if ( i < Records.Length )
|
||||
return Records[i].ClassName;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
protected function SendComplexMsg(array<string> Arr, string Title)
|
||||
{
|
||||
local int i, Longest;
|
||||
local string Line, Border;
|
||||
local string Prefix, Suffix;
|
||||
|
||||
|
||||
|
||||
for (i = 0; i < Arr.Length; i++)
|
||||
if ( Len(Arr[i]) > Longest )
|
||||
Longest = Len(Arr[i]);
|
||||
|
||||
// Account for borders
|
||||
Longest += 8;
|
||||
for (Border = ""; Len(Border) < Longest; Border = Border $ "-");
|
||||
|
||||
ClientMessage(Title);
|
||||
ClientMessage(Border);
|
||||
|
||||
for (i = 0; i < Arr.Length; i++)
|
||||
{
|
||||
Prefix = Right("[] "$i, 4)$")";
|
||||
Suffix = " []";
|
||||
Line = Prefix $ Arr[i] $ Suffix;
|
||||
while (Len(Line) < Longest)
|
||||
{
|
||||
Suffix = " " $ Suffix;
|
||||
Line = Prefix $ Arr[i] $ Suffix;
|
||||
}
|
||||
ClientMessage(Line);
|
||||
}
|
||||
ClientMessage(Border);
|
||||
}
|
||||
|
||||
// Mask can be *|*Name|Name*|*Name*|Name
|
||||
protected function bool MaskedCompare(string SettingName, string Mask)
|
||||
{
|
||||
local bool bMaskLeft, bMaskRight;
|
||||
local int MaskLen;
|
||||
|
||||
if (Mask == "*" || Mask == "**")
|
||||
return true;
|
||||
|
||||
MaskLen = Len(Mask);
|
||||
bMaskLeft = Left(Mask, 1) == "*";
|
||||
bMaskRight = Right(Mask, 1) == "*";
|
||||
|
||||
if (bMaskLeft && bMaskRight)
|
||||
return Instr(Caps(SettingName), Mid(Caps(Mask), 1, MaskLen-2)) >= 0;
|
||||
|
||||
if (bMaskLeft)
|
||||
return Left(SettingName, MaskLen -1) ~= Left(Mask, MaskLen - 1);
|
||||
|
||||
if (bMaskRight)
|
||||
return Right(SettingName, MaskLen -1) ~= Right(Mask, MaskLen - 1);
|
||||
|
||||
return SettingName ~= Mask;
|
||||
}
|
||||
|
||||
// TODO: Add support for bPositiveOnly
|
||||
function bool IsNumeric(string Param, optional bool bPositiveOnly)
|
||||
{
|
||||
local int p;
|
||||
|
||||
p=0;
|
||||
while (Mid(Param, p, 1) == " ") p++;
|
||||
while (Mid(Param, p, 1) >= "0" && Mid(Param, p, 1) <= "9") p++;
|
||||
while (Mid(Param, p, 1) == " ") p++;
|
||||
|
||||
if (Mid(Param, p) != "")
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function array<string> SplitParams(string Params)
|
||||
{
|
||||
local array<string> Splitted;
|
||||
local string Delim;
|
||||
local int p, start;
|
||||
|
||||
while (Params != "")
|
||||
{
|
||||
p = 0;
|
||||
while (Mid(Params, p, 1) == " ") p++;
|
||||
if (Mid(Params, p) == "")
|
||||
break;
|
||||
|
||||
// Special case: Delimited string
|
||||
start = p;
|
||||
if (Mid(Params, p, 1) == "\"")
|
||||
{
|
||||
p++;
|
||||
start++;
|
||||
while (Mid(Params, p, 1) != "" && Mid(Params, p, 1) != "\"")
|
||||
p++;
|
||||
|
||||
// Do not accept unfinished quoted strings
|
||||
if (Mid(Params, p, 1) == "\"")
|
||||
{
|
||||
Splitted[Splitted.Length] = Mid(Params, start, p-start);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (Mid(Params, p, 1) != "" && Mid(Params, p, 1) != Delim)
|
||||
p++;
|
||||
Splitted[Splitted.Length] = Mid(Params, start, p-start);
|
||||
}
|
||||
Params = Mid(Params, p);
|
||||
}
|
||||
return Splitted;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Msg_AllGameMaps="Maps that are valid (can be added) to"
|
||||
Msg_AllMapLists="Available maplists for %gametype%."
|
||||
Msg_MapRotationList="Active maps for maplist %maplist%."
|
||||
Msg_NoMapsAdded="No maps added to the maplist %maplist%."
|
||||
Msg_AddedMapToList="Maps successfully added to maplist"
|
||||
Msg_NoMapsRemoved="No maps were removed from the maplist %maplist%."
|
||||
Msg_RemovedFromList="Maps successfully removed from maplist"
|
||||
Msg_NextMapNotFound="Next map not found; Restarting same map"
|
||||
Msg_ChangingMapTo="Changing Map to %NextMap%"
|
||||
Msg_PlayerBanned="%Player% has been banned from this server"
|
||||
Msg_SessionBanned="%Player% has been banned for this match"
|
||||
Msg_PlayerKicked="%Player% has been kicked"
|
||||
Msg_NoMapInRotation="No maps configured for %maplist%."
|
||||
Msg_NoMapsFound="No matching maps in maplist %maplist% were found."
|
||||
Msg_MapIsInRotation="Matching %maplist% maps"
|
||||
Msg_MapNotInRotation="Matching maps which are not members of %maplist%."
|
||||
Msg_UnknownParam="Unknown Parameter : %Value%"
|
||||
Msg_NoParamsFound="No Parameters found!"
|
||||
Msg_ParamModified="Modification Successful"
|
||||
Msg_ParamNotModified="Could not Modify Parameter"
|
||||
Msg_EditingMapList="Now editing maplist"
|
||||
Msg_MapListAdded="Maplist %listname% successfully added for gametype"
|
||||
Msg_MapListRemoved="Maplist %listname% successfully removed from gametype"
|
||||
Msg_PlayerList="Player List:"
|
||||
}
|
||||
48
kf_sources/Engine/Classes/AmbientSound.uc
Normal file
48
kf_sources/Engine/Classes/AmbientSound.uc
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
//=============================================================================
|
||||
// Ambient sound -- Extended to support random interval sound emitters (gam).
|
||||
// Copyright 2001 Digital Extremes - All Rights Reserved.
|
||||
// Confidential.
|
||||
//=============================================================================
|
||||
class AmbientSound extends Keypoint
|
||||
native
|
||||
exportstructs
|
||||
hidecategories(Movement,Collision,Lighting,LightColor,Karma,Force,Wind);
|
||||
|
||||
cpptext
|
||||
{
|
||||
virtual void PostBeginPlay();
|
||||
virtual UBOOL Tick( FLOAT DeltaTime, enum ELevelTick TickType );
|
||||
}
|
||||
|
||||
#exec Texture Import File=Textures\Ambient.pcx Name=S_Ambient Mips=Off MASKED=1
|
||||
|
||||
// Sound will trigger every EmitInterval +/- Rand(EmitVariance) seconds.
|
||||
|
||||
struct SoundEmitter
|
||||
{
|
||||
var() float EmitInterval;
|
||||
var() float EmitVariance;
|
||||
|
||||
var transient float EmitTime;
|
||||
|
||||
var() Sound EmitSound; // Manually re-order because Dan turned off property sorting and broke binary compatibility.
|
||||
};
|
||||
|
||||
var(Sound) Array<SoundEmitter> SoundEmitters;
|
||||
var globalconfig float AmbientVolume; // ambient volume multiplier (scaling)
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Texture=S_Ambient
|
||||
|
||||
AmbientVolume=+0.3
|
||||
SoundRadius=100
|
||||
SoundVolume=100
|
||||
SoundPitch=64
|
||||
|
||||
RemoteRole=ROLE_None
|
||||
bStatic=false
|
||||
bNoDelete=true
|
||||
bNotOnDedServer=true
|
||||
bFullVolume=false
|
||||
}
|
||||
86
kf_sources/Engine/Classes/Ammo.uc
Normal file
86
kf_sources/Engine/Classes/Ammo.uc
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
//=============================================================================
|
||||
// Ammo.
|
||||
//=============================================================================
|
||||
class Ammo extends Pickup
|
||||
abstract
|
||||
native;
|
||||
|
||||
#exec Texture Import File=Textures\Ammo.pcx Name=S_Ammo Mips=Off MASKED=1
|
||||
|
||||
var() int AmmoAmount;
|
||||
|
||||
simulated static function UpdateHUD(HUD H)
|
||||
{
|
||||
H.LastPickupTime = H.Level.TimeSeconds;
|
||||
H.LastAmmoPickupTime = H.LastPickupTime;
|
||||
}
|
||||
|
||||
/* DetourWeight()
|
||||
value of this path to take a quick detour (usually 0, used when on route to distant objective, but want to grab inventory for example)
|
||||
*/
|
||||
function float DetourWeight(Pawn Other,float PathWeight)
|
||||
{
|
||||
local Inventory inv;
|
||||
local Weapon W;
|
||||
local float Desire;
|
||||
|
||||
if ( Other.Weapon.AIRating >= 0.5 )
|
||||
return 0;
|
||||
|
||||
for ( Inv=Other.Inventory; Inv!=None; Inv=Inv.Inventory )
|
||||
{
|
||||
W = Weapon(Inv);
|
||||
if ( W != None )
|
||||
{
|
||||
Desire = W.DesireAmmo(InventoryType, true);
|
||||
if ( Desire != 0 )
|
||||
return Desire * MaxDesireability/PathWeight;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function float BotDesireability(Pawn Bot)
|
||||
{
|
||||
local Inventory inv;
|
||||
local Weapon W;
|
||||
local float Desire;
|
||||
local Ammunition M;
|
||||
|
||||
if ( Bot.Controller.bHuntPlayer )
|
||||
return 0;
|
||||
for ( Inv=Bot.Inventory; Inv!=None; Inv=Inv.Inventory )
|
||||
{
|
||||
W = Weapon(Inv);
|
||||
if ( W != None )
|
||||
{
|
||||
Desire = W.DesireAmmo(InventoryType, false);
|
||||
if ( Desire != 0 )
|
||||
return Desire * MaxDesireability;
|
||||
}
|
||||
}
|
||||
M = Ammunition(Bot.FindInventoryType(InventoryType));
|
||||
if ( (M != None) && (M.AmmoAmount >= M.MaxAmmo) )
|
||||
return -1;
|
||||
return 0.25 * MaxDesireability;
|
||||
}
|
||||
|
||||
function inventory SpawnCopy( Pawn Other )
|
||||
{
|
||||
local Inventory Copy;
|
||||
|
||||
Copy = Super.SpawnCopy(Other);
|
||||
Ammunition(Copy).AmmoAmount = AmmoAmount;
|
||||
return Copy;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
PickupMessage="You picked up some ammo."
|
||||
RespawnTime=+00030.000000
|
||||
MaxDesireability=+00000.200000
|
||||
Texture=Engine.S_Ammo
|
||||
CollisionRadius=22.000000
|
||||
AmbientGlow=128
|
||||
CullDistance=+4000.0
|
||||
}
|
||||
125
kf_sources/Engine/Classes/Ammunition.uc
Normal file
125
kf_sources/Engine/Classes/Ammunition.uc
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
//=============================================================================
|
||||
// Ammunition: the base class of weapon ammunition
|
||||
//
|
||||
// This is a built-in Unreal class and it shouldn't be modified.
|
||||
//=============================================================================
|
||||
|
||||
class Ammunition extends Inventory
|
||||
abstract
|
||||
native
|
||||
nativereplication;
|
||||
|
||||
var travel int MaxAmmo; // Max amount of ammo
|
||||
var travel int AmmoAmount;
|
||||
var int InitialAmount; // sjs // Amount of Ammo current available
|
||||
var travel int PickupAmmo; // Amount of Ammo to give when this is picked up for the first time
|
||||
|
||||
// Used by Bot AI
|
||||
|
||||
var bool bRecommendSplashDamage;
|
||||
var bool bTossed;
|
||||
var bool bTrySplash;
|
||||
var bool bLeadTarget;
|
||||
var bool bInstantHit;
|
||||
var bool bSplashDamage;
|
||||
var bool bTryHeadShot;
|
||||
|
||||
|
||||
// Damage and Projectile information
|
||||
|
||||
var class<Projectile> ProjectileClass;
|
||||
var class<DamageType> MyDamageType;
|
||||
var float WarnTargetPct;
|
||||
var float RefireRate;
|
||||
|
||||
var Sound FireSound;
|
||||
|
||||
var float MaxRange; // for autoaim
|
||||
var() Material IconFlashMaterial;
|
||||
|
||||
// Network replication
|
||||
//
|
||||
|
||||
replication
|
||||
{
|
||||
// Things the server should send to the client.
|
||||
reliable if( bNetOwner && bNetDirty && (Role==ROLE_Authority) )
|
||||
AmmoAmount;
|
||||
}
|
||||
|
||||
simulated function CheckOutOfAmmo()
|
||||
{
|
||||
if (AmmoAmount <= 0)
|
||||
Pawn(Owner).Weapon.OutOfAmmo();
|
||||
}
|
||||
|
||||
simulated function bool UseAmmo(int AmountNeeded, optional bool bAmountNeededIsMax)
|
||||
{
|
||||
if (bAmountNeededIsMax && AmmoAmount < AmountNeeded)
|
||||
AmountNeeded = AmmoAmount;
|
||||
|
||||
if (AmmoAmount < AmountNeeded)
|
||||
{
|
||||
CheckOutOfAmmo();
|
||||
return false; // Can't do it
|
||||
}
|
||||
|
||||
AmmoAmount -= AmountNeeded;
|
||||
NetUpdateTime = Level.TimeSeconds - 1;
|
||||
|
||||
if (Level.NetMode == NM_StandAlone || Level.NetMode == NM_ListenServer)
|
||||
CheckOutOfAmmo();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
simulated function bool HasAmmo()
|
||||
{
|
||||
return ( AmmoAmount > 0 );
|
||||
}
|
||||
|
||||
simulated function DisplayDebug(Canvas Canvas, out float YL, out float YPos)
|
||||
{
|
||||
Canvas.DrawText("Ammunition "$GetItemName(string(self))$" amount "$AmmoAmount$" Max "$MaxAmmo);
|
||||
YPos += YL;
|
||||
Canvas.SetPos(4,YPos);
|
||||
}
|
||||
|
||||
function bool HandlePickupQuery( pickup Item )
|
||||
{
|
||||
if ( class == item.InventoryType )
|
||||
{
|
||||
if (AmmoAmount==MaxAmmo)
|
||||
return true;
|
||||
item.AnnouncePickup(Pawn(Owner));
|
||||
AddAmmo(Ammo(item).AmmoAmount);
|
||||
item.SetRespawn();
|
||||
return true;
|
||||
}
|
||||
if ( Inventory == None )
|
||||
return false;
|
||||
|
||||
return Inventory.HandlePickupQuery(Item);
|
||||
}
|
||||
|
||||
// If we can, add ammo and return true.
|
||||
// If we are at max ammo, return false
|
||||
//
|
||||
function bool AddAmmo(int AmmoToAdd)
|
||||
{
|
||||
if ( Level.GRI.WeaponBerserk > 1.0 )
|
||||
AmmoAmount = MaxAmmo;
|
||||
else if ( AmmoAmount < MaxAmmo )
|
||||
AmmoAmount = Min(MaxAmmo, AmmoAmount+AmmoToAdd);
|
||||
NetUpdateTime = Level.TimeSeconds - 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
MyDamageType=class'DamageType'
|
||||
RefireRate=0.500000
|
||||
InitialAmount=10
|
||||
WarnTargetPct=+0.5
|
||||
NetUpdateFrequency=1
|
||||
}
|
||||
16
kf_sources/Engine/Classes/AnimNotify.uc
Normal file
16
kf_sources/Engine/Classes/AnimNotify.uc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
class AnimNotify extends Object
|
||||
native
|
||||
abstract
|
||||
editinlinenew
|
||||
hidecategories(Object)
|
||||
collapsecategories;
|
||||
|
||||
var transient int Revision;
|
||||
|
||||
cpptext
|
||||
{
|
||||
// AnimNotify interface.
|
||||
virtual void Notify( UMeshInstance *Instance, AActor *Owner ) {};
|
||||
// UObject interface.
|
||||
virtual void PostEditChange();
|
||||
}
|
||||
16
kf_sources/Engine/Classes/AnimNotify_DestroyEffect.uc
Normal file
16
kf_sources/Engine/Classes/AnimNotify_DestroyEffect.uc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
class AnimNotify_DestroyEffect extends AnimNotify
|
||||
native;
|
||||
|
||||
var() name DestroyTag;
|
||||
var() bool bExpireParticles;
|
||||
|
||||
cpptext
|
||||
{
|
||||
// AnimNotify interface.
|
||||
virtual void Notify( UMeshInstance *Instance, AActor *Owner );
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bExpireParticles=True
|
||||
}
|
||||
25
kf_sources/Engine/Classes/AnimNotify_Effect.uc
Normal file
25
kf_sources/Engine/Classes/AnimNotify_Effect.uc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
class AnimNotify_Effect extends AnimNotify
|
||||
native;
|
||||
|
||||
var() class<Actor> EffectClass;
|
||||
var() name Bone;
|
||||
var() vector OffsetLocation;
|
||||
var() rotator OffsetRotation;
|
||||
var() bool Attach;
|
||||
var() name Tag;
|
||||
var() float DrawScale;
|
||||
var() vector DrawScale3D;
|
||||
|
||||
var private transient Actor LastSpawnedEffect; // Valid only in the editor.
|
||||
|
||||
cpptext
|
||||
{
|
||||
// AnimNotify interface.
|
||||
virtual void Notify( UMeshInstance *Instance, AActor *Owner );
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DrawScale3D=(X=1,Y=1,Z=1)
|
||||
DrawScale=+00001.000000
|
||||
}
|
||||
25
kf_sources/Engine/Classes/AnimNotify_LIPSinc.uc
Normal file
25
kf_sources/Engine/Classes/AnimNotify_LIPSinc.uc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
// ifdef WITH_LIPSinc
|
||||
|
||||
class AnimNotify_LIPSinc extends AnimNotify
|
||||
native;
|
||||
|
||||
var() name LIPSincAnimName;
|
||||
var() float Volume;
|
||||
var() int Radius;
|
||||
var() float Pitch;
|
||||
|
||||
cpptext
|
||||
{
|
||||
// AnimNotify interface.
|
||||
virtual void Notify( UMeshInstance *Instance, AActor *Owner );
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Radius=80
|
||||
Volume=1.0
|
||||
Pitch=1.0
|
||||
}
|
||||
|
||||
// endif
|
||||
10
kf_sources/Engine/Classes/AnimNotify_MatSubAction.uc
Normal file
10
kf_sources/Engine/Classes/AnimNotify_MatSubAction.uc
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class AnimNotify_MatSubAction extends AnimNotify
|
||||
native;
|
||||
|
||||
var() editinline MatSubAction SubAction;
|
||||
|
||||
cpptext
|
||||
{
|
||||
// AnimNotify interface.
|
||||
virtual void Notify( UMeshInstance *Instance, AActor *Owner );
|
||||
}
|
||||
10
kf_sources/Engine/Classes/AnimNotify_Script.uc
Normal file
10
kf_sources/Engine/Classes/AnimNotify_Script.uc
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class AnimNotify_Script extends AnimNotify
|
||||
native;
|
||||
|
||||
var() name NotifyName;
|
||||
|
||||
cpptext
|
||||
{
|
||||
// AnimNotify interface.
|
||||
virtual void Notify( UMeshInstance *Instance, AActor *Owner );
|
||||
}
|
||||
11
kf_sources/Engine/Classes/AnimNotify_Scripted.uc
Normal file
11
kf_sources/Engine/Classes/AnimNotify_Scripted.uc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class AnimNotify_Scripted extends AnimNotify
|
||||
native
|
||||
abstract;
|
||||
|
||||
event Notify( Actor Owner );
|
||||
|
||||
cpptext
|
||||
{
|
||||
// AnimNotify interface.
|
||||
virtual void Notify( UMeshInstance *Instance, AActor *Owner );
|
||||
}
|
||||
18
kf_sources/Engine/Classes/AnimNotify_Sound.uc
Normal file
18
kf_sources/Engine/Classes/AnimNotify_Sound.uc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class AnimNotify_Sound extends AnimNotify
|
||||
native;
|
||||
|
||||
var() sound Sound;
|
||||
var() float Volume;
|
||||
var() int Radius;
|
||||
|
||||
cpptext
|
||||
{
|
||||
// AnimNotify interface.
|
||||
virtual void Notify( UMeshInstance *Instance, AActor *Owner );
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Radius=0
|
||||
Volume=1.0
|
||||
}
|
||||
9
kf_sources/Engine/Classes/AnimNotify_Trigger.uc
Normal file
9
kf_sources/Engine/Classes/AnimNotify_Trigger.uc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
class AnimNotify_Trigger extends AnimNotify_Scripted;
|
||||
|
||||
var() name EventName;
|
||||
|
||||
event Notify( Actor Owner )
|
||||
{
|
||||
Owner.TriggerEvent( EventName, Owner, Pawn(Owner) );
|
||||
}
|
||||
|
||||
186
kf_sources/Engine/Classes/AnnouncerQueueManager.uc
Normal file
186
kf_sources/Engine/Classes/AnnouncerQueueManager.uc
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
//==============================================================================
|
||||
// AnnouncerQueueManager
|
||||
//==============================================================================
|
||||
// Queues Announcer messages and/or critical events
|
||||
//=============================================================================
|
||||
// Created by Laurent Delayen
|
||||
// © 2003, Epic Games, Inc. All Rights Reserved
|
||||
//==============================================================================
|
||||
|
||||
class AnnouncerQueueManager extends Info;
|
||||
|
||||
enum EAPriority
|
||||
{
|
||||
AP_Normal, // Queue
|
||||
AP_NoDuplicates, // Queue if not already in Queue
|
||||
AP_InstantPlay, // Skip if Queue is not empty
|
||||
AP_InstantOrQueueSwitch, // Queue only if queue is empty, or if queue is filled with items ONLY of the same switch (used for countdowns)
|
||||
};
|
||||
|
||||
struct QueueItem
|
||||
{
|
||||
var Name Voice; // Announcer Sound
|
||||
var float Delay; // Delay until next Item is processed
|
||||
var byte Switch; // HUD notification
|
||||
};
|
||||
|
||||
var Array<QueueItem> Queue;
|
||||
var float LastTimerCheck;
|
||||
var float GapTime; // Time between playing 2 announcer sounds
|
||||
|
||||
var PlayerController Receiver;
|
||||
|
||||
|
||||
simulated function PostBeginPlay()
|
||||
{
|
||||
super.PostBeginPlay();
|
||||
|
||||
LastTimerCheck = Level.TimeSeconds;
|
||||
SetTimer( 0.1, true );
|
||||
}
|
||||
|
||||
simulated function InitFor( PlayerController PC )
|
||||
{
|
||||
Receiver = PC;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Interface
|
||||
//
|
||||
|
||||
/* Add Item to Queue */
|
||||
function bool AddItemToQueue( Name ASound, optional EAPriority Priority, optional byte Switch )
|
||||
{
|
||||
local QueueItem NewItem;
|
||||
|
||||
if ( Receiver == None )
|
||||
return false;
|
||||
|
||||
if ( Priority == AP_InstantPlay && IsQueueing() )
|
||||
return false;
|
||||
|
||||
if ( Priority == AP_InstantOrQueueSwitch && !IsQueueingSwitch( Switch ) )
|
||||
return false;
|
||||
|
||||
if ( Priority == AP_NoDuplicates && CanFindSoundInQueue( ASound ) )
|
||||
return false;
|
||||
|
||||
NewItem.Voice = ASound;
|
||||
NewItem.Switch = Switch;
|
||||
|
||||
if ( Priority == AP_InstantOrQueueSwitch ) // do not queue for these, but play instantly
|
||||
NewItem.Delay = 0.01;
|
||||
else if ( (ASound != '') && (Receiver.StatusAnnouncer != None) )
|
||||
NewItem.Delay = GetSoundDuration( Receiver.StatusAnnouncer.GetSound(ASound) ) + GapTime;
|
||||
else
|
||||
NewItem.Delay = GapTime;
|
||||
|
||||
if ( Queue.Length == 0 )
|
||||
{
|
||||
LastTimerCheck = Level.TimeSeconds;
|
||||
ProcessQueueItem( NewItem );
|
||||
}
|
||||
|
||||
Queue[Queue.Length] = NewItem;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
final function bool CanFindSoundInQueue( name DaSoundName )
|
||||
{
|
||||
local int i;
|
||||
|
||||
for (i=0; i<Queue.Length; i++)
|
||||
{
|
||||
if ( Queue[i].Voice == DaSoundName )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
final function bool IsQueueing()
|
||||
{
|
||||
return( Queue.Length > 0 );
|
||||
}
|
||||
|
||||
final function bool IsQueueingSwitch( byte Switch )
|
||||
{
|
||||
local int i;
|
||||
|
||||
if ( Queue.Length == 0 )
|
||||
return true;
|
||||
|
||||
for (i=0; i<Queue.Length; i++)
|
||||
{
|
||||
if ( Queue[i].Switch != Switch )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
final function float GetQueueWaitTime()
|
||||
{
|
||||
local int i;
|
||||
local float WaitTime;
|
||||
|
||||
if ( !IsQueueing() )
|
||||
return 0.f;
|
||||
|
||||
for (i=0; i<Queue.Length; i++)
|
||||
WaitTime += Queue[i].Delay;
|
||||
|
||||
return WaitTime;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Internal
|
||||
//
|
||||
|
||||
|
||||
function Timer()
|
||||
{
|
||||
local float DeltaTime;
|
||||
|
||||
DeltaTime = (Level.TimeSeconds - LastTimerCheck) / Level.TimeDilation;
|
||||
|
||||
if ( Queue.Length > 0 )
|
||||
{
|
||||
Queue[0].Delay -= DeltaTime;
|
||||
if ( Queue[0].Delay <= 0 )
|
||||
{
|
||||
if ( Queue.Length > 1 )
|
||||
ProcessQueueItem( Queue[1] );
|
||||
|
||||
Queue.Remove(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
LastTimerCheck = Level.TimeSeconds;
|
||||
}
|
||||
|
||||
|
||||
function ProcessQueueItem( QueueItem Item )
|
||||
{
|
||||
if ( Receiver == None )
|
||||
return;
|
||||
|
||||
if ( Item.Voice != '' )
|
||||
Receiver.PlayStatusAnnouncement(Item.Voice, 0, true);
|
||||
|
||||
if ( Item.Switch > 0 )
|
||||
Receiver.myHUD.AnnouncementPlayed( Item.Voice, Item.Switch ); // HUD event
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// defaultproperties
|
||||
//=============================================================================
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
GapTime=0.1
|
||||
}
|
||||
155
kf_sources/Engine/Classes/AnnouncerVoice.uc
Normal file
155
kf_sources/Engine/Classes/AnnouncerVoice.uc
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
class AnnouncerVoice extends Info
|
||||
abstract
|
||||
native;
|
||||
|
||||
var cache string SoundPackage;
|
||||
var cache string FallbackSoundPackage;
|
||||
var string AlternateFallbackSoundPackage;
|
||||
|
||||
var cache localized string AnnouncerName;
|
||||
|
||||
struct CachedSound
|
||||
{
|
||||
var name CacheName;
|
||||
var sound CacheSound;
|
||||
};
|
||||
|
||||
var array<CachedSound> CachedSounds; // sounds which had to be gotten from backup package
|
||||
var bool bPrecachedBaseSounds;
|
||||
var bool bPrecachedGameSounds;
|
||||
|
||||
var const cache bool bEnglishOnly;
|
||||
|
||||
function sound GetSound(name AName)
|
||||
{
|
||||
local sound NewSound;
|
||||
local int i;
|
||||
|
||||
// check fallback sounds
|
||||
for ( i=0; i<CachedSounds.Length; i++ )
|
||||
if ( AName == CachedSounds[i].CacheName)
|
||||
return CachedSounds[i].CacheSound;
|
||||
|
||||
// DLO is cheap if already loaded
|
||||
NewSound = Sound(DynamicLoadObject(SoundPackage$"."$AName, class'Sound', true));
|
||||
|
||||
if ( NewSound == None )
|
||||
NewSound = PrecacheSound(AName);
|
||||
|
||||
return NewSound;
|
||||
}
|
||||
|
||||
function sound PrecacheSound(name AName)
|
||||
{
|
||||
local sound NewSound;
|
||||
|
||||
NewSound = Sound(DynamicLoadObject(SoundPackage$"."$AName, class'Sound', true));
|
||||
|
||||
if ( (NewSound == None) && (FallBackSoundPackage != "" ) )
|
||||
NewSound = PrecacheFallbackPackage( FallBackSoundPackage, AName );
|
||||
|
||||
if ( (NewSound == None) && (AlternateFallbackSoundPackage != "" ) )
|
||||
NewSound = PrecacheFallbackPackage( AlternateFallbackSoundPackage, AName );
|
||||
|
||||
if ( NewSound == None )
|
||||
warn("Could not find "$AName$" in "$SoundPackage$" nor in fallback package "$FallBackSoundPackage $ "nor in Alternate" $ AlternateFallbackSoundPackage );
|
||||
|
||||
return NewSound;
|
||||
}
|
||||
|
||||
function Sound PrecacheFallbackPackage( string Package, name AName )
|
||||
{
|
||||
local sound NewSound;
|
||||
local int i;
|
||||
|
||||
NewSound = Sound(DynamicLoadObject(Package$"."$AName, class'Sound', true));
|
||||
if ( NewSound != None )
|
||||
{
|
||||
for ( i=0; i<CachedSounds.Length; i++ )
|
||||
if ( CachedSounds[i].CacheName == AName )
|
||||
{
|
||||
CachedSounds[i].CacheSound = NewSound;
|
||||
return NewSound;
|
||||
}
|
||||
|
||||
CachedSounds.Length = CachedSounds.Length + 1;
|
||||
CachedSounds[CachedSounds.Length-1].CacheName = AName;
|
||||
CachedSounds[CachedSounds.Length-1].CacheSound = NewSound;
|
||||
|
||||
return NewSound;
|
||||
}
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
function PrecacheAnnouncements( bool bRewardSounds )
|
||||
{
|
||||
local class<GameInfo> GameClass;
|
||||
local Actor A;
|
||||
|
||||
if ( !bPrecachedGameSounds )
|
||||
{
|
||||
bPrecachedGameSounds = ( (Level.GRI != None) && (Level.GRI.GameClass != "") );
|
||||
GameClass = Level.GetGameClass();
|
||||
GameClass.Static.PrecacheGameAnnouncements(self, bRewardSounds);
|
||||
}
|
||||
|
||||
ForEach DynamicActors(class'Actor', A)
|
||||
A.PrecacheAnnouncer(self, bRewardSounds);
|
||||
|
||||
if ( !bPrecachedBaseSounds )
|
||||
{
|
||||
bPrecachedBaseSounds = true;
|
||||
|
||||
if ( bRewardSounds )
|
||||
{
|
||||
PrecacheSound('Headshot');
|
||||
PrecacheSound('Headhunter');
|
||||
PrecacheSound('Berzerk');
|
||||
PrecacheSound('Booster');
|
||||
PrecacheSound('FlackMonkey');
|
||||
PrecacheSound('Combowhore');
|
||||
PrecacheSound('Invisible');
|
||||
PrecacheSound('Speed');
|
||||
PrecacheSound('Camouflaged');
|
||||
PrecacheSound('Pint_sized');
|
||||
PrecacheSound('first_blood');
|
||||
PrecacheSound('adrenalin');
|
||||
PrecacheSound('Double_Kill');
|
||||
PrecacheSound('MultiKill');
|
||||
PrecacheSound('MegaKill');
|
||||
PrecacheSound('UltraKill');
|
||||
PrecacheSound('MonsterKill_F');
|
||||
PrecacheSound('LudicrousKill_F');
|
||||
PrecacheSound('HolyShit_F');
|
||||
PrecacheSound('Killing_Spree');
|
||||
PrecacheSound('Rampage');
|
||||
PrecacheSound('Dominating');
|
||||
PrecacheSound('Unstoppable');
|
||||
PrecacheSound('GodLike');
|
||||
PrecacheSound('WhickedSick');
|
||||
}
|
||||
else
|
||||
{
|
||||
PrecacheSound('one');
|
||||
PrecacheSound('two');
|
||||
PrecacheSound('three');
|
||||
PrecacheSound('four');
|
||||
PrecacheSound('five');
|
||||
PrecacheSound('six');
|
||||
PrecacheSound('seven');
|
||||
PrecacheSound('eight');
|
||||
PrecacheSound('nine');
|
||||
PrecacheSound('ten');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
// if RO_
|
||||
AlternateFallbackSoundPackage=""
|
||||
// else
|
||||
// AlternateFallbackSoundPackage="AnnouncerAssault"
|
||||
}
|
||||
|
||||
59
kf_sources/Engine/Classes/AntiPortalActor.uc
Normal file
59
kf_sources/Engine/Classes/AntiPortalActor.uc
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
//=============================================================================
|
||||
// AntiPortalActor.
|
||||
//=============================================================================
|
||||
|
||||
class AntiPortalActor extends Actor
|
||||
native
|
||||
placeable;
|
||||
|
||||
//
|
||||
// TriggerControl
|
||||
//
|
||||
|
||||
state() TriggerControl
|
||||
{
|
||||
// Trigger
|
||||
|
||||
simulated event Trigger(Actor Other,Pawn EventInstigator)
|
||||
{
|
||||
SetDrawType(DT_None);
|
||||
}
|
||||
|
||||
// UnTrigger
|
||||
|
||||
simulated event UnTrigger(Actor Other,Pawn EventInstigator)
|
||||
{
|
||||
SetDrawType(DT_AntiPortal);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// TriggerToggle
|
||||
//
|
||||
|
||||
state() TriggerToggle
|
||||
{
|
||||
// Trigger
|
||||
|
||||
simulated event Trigger(Actor Other,Pawn EventInstigator)
|
||||
{
|
||||
if (DrawType == DT_AntiPortal)
|
||||
SetDrawType(DT_None);
|
||||
else if(DrawType == DT_None)
|
||||
SetDrawType(DT_AntiPortal);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Default properties
|
||||
//
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bNoDelete=true
|
||||
RemoteRole=ROLE_None
|
||||
DrawType=DT_AntiPortal
|
||||
bEdShouldSnap=True
|
||||
bCollideActors=False
|
||||
bBlockActors=False
|
||||
}
|
||||
107
kf_sources/Engine/Classes/Armor.uc
Normal file
107
kf_sources/Engine/Classes/Armor.uc
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
class Armor extends Powerups
|
||||
abstract;
|
||||
|
||||
var() class<DamageType> ProtectionType; // Protects against DamageType (None if non-armor).
|
||||
var() int ArmorAbsorption; // Percent of damage item absorbs 0-100.
|
||||
var() int AbsorptionPriority; // Which items absorb damage first (higher=first).
|
||||
var armor NextArmor; // Temporary list created by Armors to prioritize damage absorption.
|
||||
|
||||
//
|
||||
// Absorb damage.
|
||||
//
|
||||
function int ArmorAbsorbDamage(int Damage, class<DamageType> DamageType, vector HitLocation)
|
||||
{
|
||||
local int ArmorDamage;
|
||||
|
||||
if ( DamageType.default.bArmorStops )
|
||||
ArmorImpactEffect(HitLocation);
|
||||
if( (DamageType!=None) && (ProtectionType==DamageType) )
|
||||
return 0;
|
||||
|
||||
if ( !DamageType.default.bArmorStops ) Return Damage;
|
||||
|
||||
ArmorDamage = (Damage * ArmorAbsorption) / 100;
|
||||
if( ArmorDamage >= Charge )
|
||||
{
|
||||
ArmorDamage = Charge;
|
||||
Destroy();
|
||||
}
|
||||
else
|
||||
Charge -= ArmorDamage;
|
||||
return (Damage - ArmorDamage);
|
||||
}
|
||||
|
||||
//
|
||||
// Return armor value.
|
||||
//
|
||||
function int ArmorPriority(class<DamageType> DamageType)
|
||||
{
|
||||
if ( DamageType.default.bArmorStops )
|
||||
return 0;
|
||||
if( (DamageType!=None) && (ProtectionType==DamageType) )
|
||||
return 1000000;
|
||||
|
||||
return AbsorptionPriority;
|
||||
}
|
||||
|
||||
//
|
||||
// This function is called by ArmorAbsorbDamage and displays a visual effect
|
||||
// for an impact on an armor.
|
||||
//
|
||||
function ArmorImpactEffect(vector HitLocation);
|
||||
|
||||
state Activated
|
||||
{
|
||||
function BeginState()
|
||||
{
|
||||
Super.BeginState();
|
||||
if ( ProtectionType != None )
|
||||
Pawn(Owner).ReducedDamageType = ProtectionType;
|
||||
}
|
||||
|
||||
function EndState()
|
||||
{
|
||||
Super.EndState();
|
||||
if ( (Pawn(Owner) != None) && (ProtectionType != Pawn(Owner).ReducedDamageType) )
|
||||
Pawn(Owner).ReducedDamageType = None;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Return the best armor to use.
|
||||
//
|
||||
function armor PrioritizeArmor( int Damage, class<DamageType> DamageType, vector HitLocation )
|
||||
{
|
||||
local Armor FirstArmor, InsertAfter;
|
||||
|
||||
if ( Inventory != None )
|
||||
FirstArmor = Inventory.PrioritizeArmor(Damage, DamageType, HitLocation);
|
||||
else
|
||||
FirstArmor = None;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
46
kf_sources/Engine/Classes/ArmorPickup.uc
Normal file
46
kf_sources/Engine/Classes/ArmorPickup.uc
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
class ArmorPickup extends Pickup
|
||||
abstract;
|
||||
|
||||
function float BotDesireability( pawn Bot )
|
||||
{
|
||||
local Inventory AlreadyHas;
|
||||
local Armor AlreadyHasArmor;
|
||||
local float desire;
|
||||
local bool bChecked;
|
||||
|
||||
desire = MaxDesireability;
|
||||
|
||||
if ( RespawnTime < 10 )
|
||||
{
|
||||
bChecked = true;
|
||||
AlreadyHas = Bot.FindInventoryType(InventoryType);
|
||||
if ( AlreadyHas != None )
|
||||
{
|
||||
if ( Inventory != None )
|
||||
{
|
||||
if( Inventory.Charge <= AlreadyHas.Charge )
|
||||
return -1;
|
||||
}
|
||||
else if ( InventoryType.Default.Charge <= AlreadyHas.Charge )
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !bChecked )
|
||||
AlreadyHasArmor = Armor(Bot.FindInventoryType(InventoryType));
|
||||
if ( AlreadyHasArmor != None )
|
||||
desire *= (1 - AlreadyHasArmor.Charge * AlreadyHasArmor.ArmorAbsorption * 0.00003);
|
||||
|
||||
if ( Armor(Inventory) != None )
|
||||
{
|
||||
// pointing to specific, existing item
|
||||
desire *= (Inventory.Charge * 0.005);
|
||||
desire *= (Armor(Inventory).ArmorAbsorption * 0.01);
|
||||
}
|
||||
else
|
||||
{
|
||||
desire *= (InventoryType.default.Charge * 0.005);
|
||||
desire *= (class<Armor>(InventoryType).default.ArmorAbsorption * 0.01);
|
||||
}
|
||||
return desire;
|
||||
}
|
||||
12
kf_sources/Engine/Classes/AutoDoor.uc
Normal file
12
kf_sources/Engine/Classes/AutoDoor.uc
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/*=============================================================================
|
||||
// AutoDoor - automatically placed Door
|
||||
============================================================================= */
|
||||
|
||||
class AutoDoor extends Door
|
||||
notplaceable
|
||||
native;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bCollideWhenPlacing=false
|
||||
}
|
||||
17
kf_sources/Engine/Classes/AutoLadder.uc
Normal file
17
kf_sources/Engine/Classes/AutoLadder.uc
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/*=============================================================================
|
||||
// AutoLadder - automatically placed at top and bottom of LadderVolume
|
||||
============================================================================= */
|
||||
|
||||
class AutoLadder extends Ladder
|
||||
notplaceable
|
||||
native;
|
||||
|
||||
cpptext
|
||||
{
|
||||
virtual UBOOL IsIdentifiedAs(FName ActorName);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bCollideWhenPlacing=false
|
||||
}
|
||||
38
kf_sources/Engine/Classes/AvoidMarker.uc
Normal file
38
kf_sources/Engine/Classes/AvoidMarker.uc
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//=============================================================================
|
||||
// AvoidMarker.
|
||||
// Creatures will tend to back away when near this spot
|
||||
//=============================================================================
|
||||
class AvoidMarker extends Triggers
|
||||
native
|
||||
notPlaceable;
|
||||
|
||||
var byte TeamNum;
|
||||
|
||||
function Touch( actor Other )
|
||||
{
|
||||
if ( (Pawn(Other) != None)&& RelevantTo(Pawn(Other)) )
|
||||
Pawn(Other).Controller.FearThisSpot(self);
|
||||
}
|
||||
|
||||
function bool RelevantTo(Pawn P)
|
||||
{
|
||||
return ( (AIController(P.Controller) != None)
|
||||
&& ((P.Controller.PlayerReplicationInfo == None) || (P.Controller.PlayerReplicationInfo.Team == None) || (P.Controller.PlayerReplicationInfo.Team.TeamIndex != TeamNum)) );
|
||||
}
|
||||
|
||||
function StartleBots()
|
||||
{
|
||||
local Pawn P;
|
||||
|
||||
ForEach CollidingActors(class'Pawn', P, CollisionRadius)
|
||||
if ( RelevantTo(P) )
|
||||
AIController(P.Controller).Startle(self);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
TeamNum=255
|
||||
bStatic=false
|
||||
CollisionRadius=+100.000
|
||||
RemoteRole=ROLE_None
|
||||
}
|
||||
57
kf_sources/Engine/Classes/B4SParser.uc
Normal file
57
kf_sources/Engine/Classes/B4SParser.uc
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
//==============================================================================
|
||||
// Created on: 10/27/2003
|
||||
// Specialized parser for WinAmp B4U playlists
|
||||
//
|
||||
// Written by Ron Prestenback
|
||||
// © 2003, Epic Games, Inc. All Rights Reserved
|
||||
//==============================================================================
|
||||
|
||||
class B4SParser extends PlaylistParserBase;
|
||||
|
||||
function ParseLines()
|
||||
{
|
||||
local int i, pos;
|
||||
local string Str;
|
||||
|
||||
Super.ParseLines();
|
||||
if ( Lines.Length == 0 )
|
||||
return;
|
||||
|
||||
for ( i = 0; i < Lines.Length; i++ )
|
||||
{
|
||||
if ( InStr(Lines[i], "</playlist>") != -1 || Lines[i] == "" )
|
||||
break;
|
||||
|
||||
if ( PlaylistName == "" )
|
||||
{
|
||||
pos = InStr(Lines[i], "num_entries");
|
||||
if ( pos == -1 )
|
||||
continue;
|
||||
|
||||
pos = InStr(Lines[i], "label");
|
||||
if ( pos == -1 )
|
||||
{
|
||||
PlaylistName = DefaultPlaylistName;
|
||||
continue;
|
||||
}
|
||||
|
||||
PlaylistName = GetValue(Mid(Lines[i], pos));
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( InStr(Lines[i], "<entry ") != -1 )
|
||||
{
|
||||
Str = GetValue(Lines[i]);
|
||||
if ( Str == "" || Left(Str,5) != "file:" )
|
||||
continue;
|
||||
|
||||
Paths[Paths.Length] = HtmlDecode(Mid(Str, 5));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
|
||||
}
|
||||
91
kf_sources/Engine/Classes/BaseGUIController.uc
Normal file
91
kf_sources/Engine/Classes/BaseGUIController.uc
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
// ====================================================================
|
||||
// Class: Engine.BaseGUIController
|
||||
//
|
||||
// This is just a stub class that should be subclassed to support menus.
|
||||
//
|
||||
// Written by Joe Wilcox
|
||||
// (c) 2002, Epic Games, Inc. All Rights Reserved
|
||||
// ====================================================================
|
||||
|
||||
class BaseGUIController extends Interaction
|
||||
Native
|
||||
transient;
|
||||
|
||||
cpptext
|
||||
{
|
||||
virtual void ResolutionChanged(int ResX, int ResY) {}
|
||||
virtual void ResetInput() {}
|
||||
}
|
||||
|
||||
#exec TEXTURE IMPORT NAME=MenuWhite FILE=Textures\White.tga MIPS=0
|
||||
#exec TEXTURE IMPORT NAME=MenuBlack FILE=Textures\Black.tga MIPS=0
|
||||
#exec TEXTURE IMPORT NAME=MenuGray FILE=Textures\Gray.tga MIPS=0
|
||||
|
||||
var Material DefaultPens[3]; // Contain to hold some default pens for drawing purposes
|
||||
|
||||
// Default work menus
|
||||
|
||||
var config string NetworkMsgMenu; // Menu used for network messages
|
||||
var config string QuestionMenuClass; // Menu that appears for questions
|
||||
|
||||
// Delegates
|
||||
Delegate OnAdminReply(string Reply); // Called By PlayerController
|
||||
|
||||
//ifdef _KF_
|
||||
function string SteamGetUserName();
|
||||
function string SteamGetUserID();
|
||||
//endif
|
||||
|
||||
// ================================================
|
||||
// OpenMenu - Opens a new menu and places it on top of the stack
|
||||
|
||||
event bool OpenMenu(string NewMenuName, optional string Param1, optional string Param2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ================================================
|
||||
// Create a bunch of menus at start up
|
||||
|
||||
event AutoLoadMenus(); // Subclass me
|
||||
|
||||
// ================================================
|
||||
// Replaces a menu in the stack. returns true if success
|
||||
|
||||
event bool ReplaceMenu(string NewMenuName, optional string Param1, optional string Param2, optional bool bCancelled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
event bool CloseMenu(optional bool bCanceled) // Close the top menu. returns true if success.
|
||||
{
|
||||
return true;
|
||||
}
|
||||
event CloseAll(bool bCancel, optional bool bForced);
|
||||
|
||||
function SetControllerStatus(bool On)
|
||||
{
|
||||
bActive = On;
|
||||
bVisible = On;
|
||||
bRequiresTick=On;
|
||||
|
||||
// Add code to pause/unpause/hide/etc the game here.
|
||||
|
||||
}
|
||||
|
||||
event InitializeController(); // Should be subclassed.
|
||||
|
||||
event bool NeedsMenuResolution(); // Big Hack that should be subclassed
|
||||
event SetRequiredGameResolution(string GameRes);
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bNativeEvents=True
|
||||
bActive=False
|
||||
bRequiresTick=False
|
||||
bVisible=False
|
||||
DefaultPens(0)=texture'MenuWhite'
|
||||
DefaultPens(1)=texture'MenuBlack'
|
||||
DefaultPens(2)=texture'MenuGray'
|
||||
}
|
||||
86
kf_sources/Engine/Classes/BeamEmitter.uc
Normal file
86
kf_sources/Engine/Classes/BeamEmitter.uc
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
//=============================================================================
|
||||
// BeamEmitter: An Unreal Beam Particle Emitter.
|
||||
//=============================================================================
|
||||
class BeamEmitter extends ParticleEmitter
|
||||
native;
|
||||
|
||||
|
||||
enum EBeamEndPointType
|
||||
{
|
||||
PTEP_Velocity,
|
||||
PTEP_Distance,
|
||||
PTEP_Offset,
|
||||
PTEP_Actor,
|
||||
PTEP_TraceOffset,
|
||||
PTEP_OffsetAsAbsolute,
|
||||
PTEP_DynamicDistance // Length can be scaled by Size.Y and Distance can be changed in realtime through code.
|
||||
};
|
||||
|
||||
struct ParticleBeamData
|
||||
{
|
||||
var vector Location;
|
||||
var float t;
|
||||
};
|
||||
|
||||
struct ParticleBeamEndPoint
|
||||
{
|
||||
var () name ActorTag;
|
||||
var () rangevector Offset;
|
||||
var () float Weight;
|
||||
};
|
||||
|
||||
struct ParticleBeamScale
|
||||
{
|
||||
var () vector FrequencyScale;
|
||||
var () float RelativeLength;
|
||||
};
|
||||
|
||||
var (Beam) range BeamDistanceRange;
|
||||
var (Beam) array<ParticleBeamEndPoint> BeamEndPoints;
|
||||
var (Beam) EBeamEndPointType DetermineEndPointBy;
|
||||
var (Beam) float BeamTextureUScale;
|
||||
var (Beam) float BeamTextureVScale;
|
||||
var (Beam) int RotatingSheets;
|
||||
var (Beam) bool TriggerEndpoint;
|
||||
|
||||
var (BeamNoise) rangevector LowFrequencyNoiseRange;
|
||||
var (BeamNoise) int LowFrequencyPoints;
|
||||
var (BeamNoise) rangevector HighFrequencyNoiseRange;
|
||||
var (BeamNoise) int HighFrequencyPoints;
|
||||
var (BeamNoise) array<ParticleBeamScale> LFScaleFactors;
|
||||
var (BeamNoise) array<ParticleBeamScale> HFScaleFactors;
|
||||
var (BeamNoise) float LFScaleRepeats;
|
||||
var (BeamNoise) float HFScaleRepeats;
|
||||
var (BeamNoise) bool UseHighFrequencyScale;
|
||||
var (BeamNoise) bool UseLowFrequencyScale;
|
||||
var (BeamNoise) bool NoiseDeterminesEndPoint;
|
||||
var (BeamNoise) rangevector DynamicHFNoiseRange;
|
||||
var (BeamNoise) range DynamicHFNoisePointsRange;
|
||||
var (BeamNoise) range DynamicTimeBetweenNoiseRange;
|
||||
|
||||
var (BeamBranching) bool UseBranching;
|
||||
var (BeamBranching) range BranchProbability;
|
||||
var (BeamBranching) range BranchHFPointsRange;
|
||||
var (BeamBranching) int BranchEmitter;
|
||||
var (BeamBranching) range BranchSpawnAmountRange;
|
||||
var (BeamBranching) bool LinkupLifetime;
|
||||
|
||||
var transient int SheetsUsed;
|
||||
var transient int VerticesPerParticle;
|
||||
var transient int IndicesPerParticle;
|
||||
var transient int PrimitivesPerParticle;
|
||||
var transient float BeamValueSum;
|
||||
var transient array<ParticleBeamData> HFPoints;
|
||||
var transient array<vector> LFPoints;
|
||||
var transient array<actor> HitActors;
|
||||
var transient float TimeSinceLastDynamicNoise;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
HighFrequencyPoints=10
|
||||
LowFrequencyPoints=3
|
||||
BeamTextureUScale=1
|
||||
BeamTextureVScale=1
|
||||
BranchEmitter=-1
|
||||
BranchHFPointsRange=(Min=0,Max=1000)
|
||||
}
|
||||
4
kf_sources/Engine/Classes/Bitmap.uc
Normal file
4
kf_sources/Engine/Classes/Bitmap.uc
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class Bitmap extends Object;
|
||||
|
||||
// Deprecated
|
||||
|
||||
36
kf_sources/Engine/Classes/BitmapMaterial.uc
Normal file
36
kf_sources/Engine/Classes/BitmapMaterial.uc
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
class BitmapMaterial extends RenderedMaterial
|
||||
abstract
|
||||
native
|
||||
noexport;
|
||||
|
||||
var(TextureFormat) const editconst enum ETextureFormat
|
||||
{
|
||||
TEXF_P8,
|
||||
TEXF_RGBA7,
|
||||
TEXF_RGB16,
|
||||
TEXF_DXT1,
|
||||
TEXF_RGB8,
|
||||
TEXF_RGBA8,
|
||||
TEXF_NODATA,
|
||||
TEXF_DXT3,
|
||||
TEXF_DXT5,
|
||||
TEXF_L8,
|
||||
TEXF_G16,
|
||||
TEXF_RRRGGGBBB,
|
||||
} Format;
|
||||
|
||||
var(Texture) enum ETexClampMode
|
||||
{
|
||||
TC_Wrap,
|
||||
TC_Clamp,
|
||||
} UClampMode, VClampMode;
|
||||
|
||||
var const byte UBits, VBits;
|
||||
var const int USize, VSize;
|
||||
var(Texture) const int UClamp, VClamp;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
// MT_BitmapMaterial
|
||||
MaterialType=64
|
||||
}
|
||||
29
kf_sources/Engine/Classes/BlockingVolume.uc
Normal file
29
kf_sources/Engine/Classes/BlockingVolume.uc
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//=============================================================================
|
||||
// BlockingVolume: a bounding volume
|
||||
// used to block certain classes of actors
|
||||
// primary use is to provide collision for non-zero extent traces around static meshes
|
||||
|
||||
//=============================================================================
|
||||
|
||||
class BlockingVolume extends Volume
|
||||
native;
|
||||
|
||||
cpptext // sjs
|
||||
{
|
||||
virtual UBOOL ShouldTrace(AActor *SourceActor, DWORD TraceFlags);
|
||||
}
|
||||
|
||||
var() bool bClampFluid;
|
||||
var() bool bClassBlocker; // sjs
|
||||
var() Array< class<Actor> > BlockedClasses; // sjs
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bBlockZeroExtentTraces=false
|
||||
bWorldGeometry=true
|
||||
bCollideActors=True
|
||||
bBlockActors=True
|
||||
bBlockKarma=True
|
||||
bClampFluid=True
|
||||
bClassBlocker=false
|
||||
}
|
||||
247
kf_sources/Engine/Classes/BroadcastHandler.uc
Normal file
247
kf_sources/Engine/Classes/BroadcastHandler.uc
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
//=============================================================================
|
||||
// BroadcastHandler
|
||||
//
|
||||
// Message broadcasting is delegated to BroadCastHandler by the GameInfo.
|
||||
// The BroadCastHandler handles both text messages (typed by a player) and
|
||||
// localized messages (which are identified by a LocalMessage class and id).
|
||||
// GameInfos produce localized messages using their DeathMessageClass and
|
||||
// GameMessageClass classes.
|
||||
//
|
||||
// This is a built-in Unreal class and it shouldn't be modified.
|
||||
//=============================================================================
|
||||
class BroadcastHandler extends Info
|
||||
config;
|
||||
|
||||
// rjp -- Generally, you should only need to override the 'Accept' functions
|
||||
var BroadcastHandler NextBroadcastHandler;
|
||||
var class<BroadcastHandler> NextBroadcastHandlerClass;
|
||||
// -- rjp
|
||||
|
||||
var int SentText;
|
||||
var globalconfig bool bMuteSpectators; // Whether spectators are allowed to speak.
|
||||
var globalconfig bool bPartitionSpectators; // Whether spectators are can only speak to spectators.
|
||||
|
||||
const PROPNUM = 2;
|
||||
var localized string BHDisplayText[PROPNUM];
|
||||
var localized string BHDescText[PROPNUM];
|
||||
|
||||
function UpdateSentText()
|
||||
{
|
||||
SentText = 0;
|
||||
}
|
||||
|
||||
static function FillPlayInfo(PlayInfo PlayInfo)
|
||||
{
|
||||
Super.FillPlayInfo(PlayInfo); // Always begin with calling parent
|
||||
|
||||
PlayInfo.AddSetting(default.ChatGroup, "bMuteSpectators", default.BHDisplayText[0], 0, 1, "Check",,,True,True);
|
||||
PlayInfo.AddSetting(default.ChatGroup, "bPartitionSpectators", default.BHDisplayText[1], 1, 1, "Check",,,True,True);
|
||||
|
||||
if ( default.NextBroadcastHandlerClass != None )
|
||||
{
|
||||
default.NextBroadcastHandlerClass.static.FillPlayInfo(PlayInfo);
|
||||
PlayInfo.PopClass();
|
||||
}
|
||||
}
|
||||
|
||||
static event string GetDescriptionText(string PropName)
|
||||
{
|
||||
switch (PropName)
|
||||
{
|
||||
case "bMuteSpectators": return default.BHDescText[0];
|
||||
case "bPartitionSpectators":return default.BHDescText[1];
|
||||
}
|
||||
|
||||
return Super.GetDescriptionText(PropName);
|
||||
}
|
||||
|
||||
/* Whether actor is allowed to broadcast messages now.
|
||||
*/
|
||||
function bool AllowsBroadcast( actor broadcaster, int Len )
|
||||
{
|
||||
if ( bMuteSpectators && (PlayerController(Broadcaster) != None)
|
||||
&& !PlayerController(Broadcaster).PlayerReplicationInfo.bAdmin
|
||||
//if _RO_
|
||||
&& !PlayerController(Broadcaster).PlayerReplicationInfo.bSilentAdmin
|
||||
//end _RO_
|
||||
&& (PlayerController(Broadcaster).PlayerReplicationInfo.bOnlySpectator
|
||||
|| PlayerController(Broadcaster).PlayerReplicationInfo.bOutOfLives) )
|
||||
return false;
|
||||
|
||||
SentText += Len;
|
||||
|
||||
if ( NextBroadcastHandler != None && !NextBroadcastHandler.HandlerAllowsBroadcast(Broadcaster, SentText) )
|
||||
return false;
|
||||
|
||||
return ( (Level.Pauser != None) || (SentText < 200) );
|
||||
}
|
||||
|
||||
function bool HandlerAllowsBroadcast( Actor Broadcaster, int SentTextNum )
|
||||
{
|
||||
if ( NextBroadcastHandler != None )
|
||||
return NextBroadcastHandler.HandlerAllowsBroadcast(Broadcaster, SentTextNum);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function BroadcastText( PlayerReplicationInfo SenderPRI, PlayerController Receiver, coerce string Msg, optional name Type )
|
||||
{
|
||||
if ( !AcceptBroadcastText(Receiver, SenderPRI, Msg, Type) )
|
||||
return;
|
||||
|
||||
if ( NextBroadcastHandler != None )
|
||||
NextBroadcastHandler.BroadcastText( SenderPRI, Receiver, Msg, Type );
|
||||
else Receiver.TeamMessage( SenderPRI, Msg, Type );
|
||||
}
|
||||
|
||||
function BroadcastLocalized( Actor Sender, PlayerController Receiver, class<LocalMessage> Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject )
|
||||
{
|
||||
if ( !AcceptBroadcastLocalized(Receiver, Sender, Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject) )
|
||||
return;
|
||||
|
||||
if ( NextBroadcastHandler != None )
|
||||
NextBroadcastHandler.BroadcastLocalized( Sender, Receiver, Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );
|
||||
else Receiver.ReceiveLocalizedMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );
|
||||
}
|
||||
|
||||
function Broadcast( Actor Sender, coerce string Msg, optional name Type )
|
||||
{
|
||||
local Controller C;
|
||||
local PlayerController P;
|
||||
local PlayerReplicationInfo PRI;
|
||||
|
||||
// see if allowed (limit to prevent spamming)
|
||||
if ( !AllowsBroadcast(Sender, Len(Msg)) )
|
||||
return;
|
||||
|
||||
if ( Pawn(Sender) != None )
|
||||
PRI = Pawn(Sender).PlayerReplicationInfo;
|
||||
else if ( Controller(Sender) != None )
|
||||
PRI = Controller(Sender).PlayerReplicationInfo;
|
||||
|
||||
if ( bPartitionSpectators && !Level.Game.bGameEnded && (PRI != None) && !PRI.bAdmin && (PRI.bOnlySpectator || PRI.bOutOfLives) )
|
||||
{
|
||||
For ( C=Level.ControllerList; C!=None; C=C.NextController )
|
||||
{
|
||||
P = PlayerController(C);
|
||||
if ( (P != None) && (P.PlayerReplicationInfo.bOnlySpectator || P.PlayerReplicationInfo.bOutOfLives) )
|
||||
BroadcastText(PRI, P, Msg, Type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
For ( C=Level.ControllerList; C!=None; C=C.NextController )
|
||||
{
|
||||
P = PlayerController(C);
|
||||
if ( P != None )
|
||||
BroadcastText(PRI, P, Msg, Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function BroadcastTeam( Controller Sender, coerce string Msg, optional name Type )
|
||||
{
|
||||
local Controller C;
|
||||
local PlayerController P;
|
||||
|
||||
// see if allowed (limit to prevent spamming)
|
||||
if ( !AllowsBroadcast(Sender, Len(Msg)) )
|
||||
return;
|
||||
|
||||
if ( bPartitionSpectators && !Level.Game.bGameEnded && (Sender != None) && !Sender.PlayerReplicationInfo.bAdmin && (Sender.PlayerReplicationInfo.bOnlySpectator || Sender.PlayerReplicationInfo.bOutOfLives) )
|
||||
{
|
||||
For ( C=Level.ControllerList; C!=None; C=C.NextController )
|
||||
{
|
||||
P = PlayerController(C);
|
||||
if ( (P != None) && (P.PlayerReplicationInfo.Team == Sender.PlayerReplicationInfo.Team)
|
||||
&& (P.PlayerReplicationInfo.bOnlySpectator || P.PlayerReplicationInfo.bOutOfLives) )
|
||||
BroadcastText(Sender.PlayerReplicationInfo, P, Msg, Type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
For ( C=Level.ControllerList; C!=None; C=C.NextController )
|
||||
{
|
||||
P = PlayerController(C);
|
||||
if ( (P != None) && (P.PlayerReplicationInfo.Team == Sender.PlayerReplicationInfo.Team) )
|
||||
BroadcastText(Sender.PlayerReplicationInfo, P, Msg, Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Broadcast a localized message to all players.
|
||||
Most messages deal with 0 to 2 related PRIs.
|
||||
The LocalMessage class defines how the PRI's and optional actor are used.
|
||||
*/
|
||||
event AllowBroadcastLocalized( actor Sender, class<LocalMessage> Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject )
|
||||
{
|
||||
local Controller C;
|
||||
local PlayerController P;
|
||||
|
||||
For ( C=Level.ControllerList; C!=None; C=C.NextController )
|
||||
{
|
||||
P = PlayerController(C);
|
||||
if ( P != None )
|
||||
BroadcastLocalized(Sender, P, Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject);
|
||||
}
|
||||
}
|
||||
|
||||
// rjp --- Linked list for broadcast handlers
|
||||
function RegisterBroadcastHandler(BroadcastHandler NewBH)
|
||||
{
|
||||
if ( NextBroadcastHandler == None )
|
||||
{
|
||||
NextBroadcastHandler = NewBH;
|
||||
default.NextBroadcastHandlerClass = NewBH.Class;
|
||||
}
|
||||
|
||||
else NextBroadcastHandler.RegisterBroadcastHandler(NewBH);
|
||||
}
|
||||
|
||||
function bool AcceptBroadcastText( PlayerController Receiver, PlayerReplicationInfo SenderPRI, out string Msg, optional name Type )
|
||||
{
|
||||
if ( NextBroadcastHandler != None )
|
||||
return NextBroadcastHandler.AcceptBroadcastText(Receiver, SenderPRI, Msg, Type);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool AcceptBroadcastLocalized(PlayerController Receiver, Actor Sender, class<LocalMessage> Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object Obj)
|
||||
{
|
||||
if ( NextBroadcastHandler != None )
|
||||
return NextBroadcastHandler.AcceptBroadcastLocalized(Receiver, Sender, Message, Switch, RelatedPRI_1, RelatedPRI_2, Obj);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool AcceptBroadcastSpeech(PlayerController Receiver, PlayerReplicationInfo SenderPRI)
|
||||
{
|
||||
if ( NextBroadcastHandler != None )
|
||||
return NextBroadcastHandler.AcceptBroadcastSpeech(Receiver, SenderPRI);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool AcceptBroadcastVoice(PlayerController Receiver, PlayerReplicationInfo SenderPRI)
|
||||
{
|
||||
if ( NextBroadcastHandler != None )
|
||||
return NextBroadcastHandler.AcceptBroadcastVoice(Receiver, SenderPRI);
|
||||
|
||||
return true;
|
||||
}
|
||||
// --- rjp
|
||||
|
||||
event Destroyed()
|
||||
{
|
||||
default.NextBroadcastHandlerClass = None;
|
||||
Super.Destroyed();
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
BHDisplayText(0)="Mute Spectators"
|
||||
BHDisplayText(1)="Partition Spectators"
|
||||
BHDescText(0)="Check this option to prevent spectators from chatting during the game."
|
||||
BHDescText(1)="Check this option to separate spectator chat from player chat."
|
||||
}
|
||||
49
kf_sources/Engine/Classes/Brush.uc
Normal file
49
kf_sources/Engine/Classes/Brush.uc
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
//=============================================================================
|
||||
// The brush class.
|
||||
// This is a built-in Unreal class and it shouldn't be modified.
|
||||
//=============================================================================
|
||||
class Brush extends Actor
|
||||
native;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Variables.
|
||||
|
||||
// CSG operation performed in editor.
|
||||
var() enum ECsgOper
|
||||
{
|
||||
CSG_Active, // Active brush.
|
||||
CSG_Add, // Add to world.
|
||||
CSG_Subtract, // Subtract from world.
|
||||
CSG_Intersect, // Form from intersection with world.
|
||||
CSG_Deintersect, // Form from negative intersection with world.
|
||||
} CsgOper;
|
||||
|
||||
// Outdated.
|
||||
var const object UnusedLightMesh;
|
||||
var vector PostPivot;
|
||||
|
||||
// Scaling.
|
||||
// Outdated : these are only here to allow the "ucc mapconvert" commandlet to work.
|
||||
// They are NOT used by the engine/editor for anything else.
|
||||
var scale MainScale;
|
||||
var scale PostScale;
|
||||
var scale TempScale;
|
||||
|
||||
// Information.
|
||||
var() color BrushColor;
|
||||
var() int PolyFlags;
|
||||
var() bool bColored;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
MainScale=(Scale=(X=1,Y=1,Z=1),SheerRate=0,SheerAxis=SHEER_None)
|
||||
PostScale=(Scale=(X=1,Y=1,Z=1),SheerRate=0,SheerAxis=SHEER_None)
|
||||
TempScale=(Scale=(X=1,Y=1,Z=1),SheerRate=0,SheerAxis=SHEER_None)
|
||||
bStatic=True
|
||||
bHidden=True
|
||||
bNoDelete=True
|
||||
bEdShouldSnap=True
|
||||
DrawType=DT_Brush
|
||||
bFixedRotationDir=True
|
||||
bUseDynamicLights=true
|
||||
}
|
||||
142
kf_sources/Engine/Classes/CacheManager.uc
Normal file
142
kf_sources/Engine/Classes/CacheManager.uc
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
//==============================================================================
|
||||
// This class manages all cached record types for the game.
|
||||
//
|
||||
// Written by Ron Prestenback
|
||||
// © 2003, Epic Games, Inc. All Rights Reserved
|
||||
//==============================================================================
|
||||
class CacheManager extends Object
|
||||
native
|
||||
noexport
|
||||
transient;
|
||||
|
||||
struct native init GameRecord
|
||||
{
|
||||
var() const string ClassName;
|
||||
var() const string GameName;
|
||||
var() const string Description;
|
||||
var() const string TextName; // deco reference
|
||||
var() const string GameAcronym;
|
||||
var() const string MapListClassName;
|
||||
var() const string MapPrefix;
|
||||
var() const string ScreenshotRef; // Gametype screenshot
|
||||
var() const string HUDMenu; // Optional custom HUD settings menu for a gametype
|
||||
var() const string RulesMenu; // Optional custom rule menu for a gametype
|
||||
var() const bool bTeamGame; // Whether this is a team gametype
|
||||
var() const byte GameTypeGroup; // 0 - UT2003, 1 - Bonus Pack, 2 - UT2004, 3 - Custom
|
||||
var const int RecordIndex;
|
||||
};
|
||||
|
||||
struct native init MutatorRecord
|
||||
{
|
||||
var() const string ClassName;
|
||||
var() const string FriendlyName;
|
||||
var() const string Description;
|
||||
var() const string IconMaterialName;
|
||||
var() const string ConfigMenuClassName;
|
||||
var() const string GroupName;
|
||||
var const int RecordIndex;
|
||||
var const byte bActivated;
|
||||
};
|
||||
|
||||
struct native init MapRecord
|
||||
{
|
||||
var() const string Acronym;
|
||||
var() const string MapName; // Full map filename (no extension)
|
||||
var() const string TextName; // deco text reference
|
||||
var() const string FriendlyName; // optional mapname
|
||||
var() const string Author; // Author's name
|
||||
var() const string Description; // Filled by deco text, or levelsummary
|
||||
var() const int PlayerCountMin; // Recommended minplayer count
|
||||
var() const int PlayerCountMax; // Recommended maxplayer count
|
||||
var() const string ScreenshotRef;
|
||||
var() const string ExtraInfo;
|
||||
var const int RecordIndex;
|
||||
};
|
||||
|
||||
struct native init WeaponRecord
|
||||
{
|
||||
var() const string ClassName;
|
||||
var() const string PickupClassName;
|
||||
var() const string AttachmentClassName;
|
||||
var() const string Description;
|
||||
var() const string TextName;
|
||||
var() const string FriendlyName;
|
||||
var const int RecordIndex;
|
||||
};
|
||||
|
||||
struct native init VehicleRecord
|
||||
{
|
||||
var() const string ClassName;
|
||||
var() const string FriendlyName;
|
||||
var() const string Description;
|
||||
var const int RecordIndex;
|
||||
};
|
||||
|
||||
struct native init CrosshairRecord
|
||||
{
|
||||
var() const string FriendlyName;
|
||||
var() const texture CrosshairTexture;
|
||||
var const int RecordIndex;
|
||||
};
|
||||
|
||||
struct native init AnnouncerRecord
|
||||
{
|
||||
var() const string ClassName;
|
||||
var() const string FriendlyName;
|
||||
var() const string PackageName;
|
||||
var() const string FallbackPackage;
|
||||
var() const bool bEnglishOnly;
|
||||
var const int RecordIndex;
|
||||
};
|
||||
|
||||
struct native Standard
|
||||
{
|
||||
var() const array<string> Classes, Maps;
|
||||
};
|
||||
|
||||
var() private const array<Standard> DefaultContent;
|
||||
var() private const array<MutatorRecord> CacheMutators;
|
||||
var() private const array<MapRecord> CacheMaps;
|
||||
var() private const array<WeaponRecord> CacheWeapons;
|
||||
var() private const array<VehicleRecord> CacheVehicles;
|
||||
var() private const array<CrosshairRecord> CacheCrosshairs;
|
||||
var() private const array<GameRecord> CacheGameTypes;
|
||||
var() private const array<AnnouncerRecord> CacheAnnouncers;
|
||||
|
||||
var protected const native pointer FileManager;
|
||||
var protected const native pointer Tracker;
|
||||
|
||||
native(800) final static function InitCache();
|
||||
|
||||
native(801) final simulated static function bool Is2003Content( string Item );
|
||||
native(802) final simulated static function bool Is2004Content( string Item );
|
||||
native(803) final simulated static function bool IsBPContent( string Item );
|
||||
native(830) final simulated static function bool IsDefaultContent( string Item );
|
||||
|
||||
// 0 - UT2003, 1 - Bonus Pack, 2 - UT2004, 3 - Custom
|
||||
native(804) final simulated static function GetGameTypeList( out array<GameRecord> GameRecords, optional string FilterType );
|
||||
native(805) final simulated static function GetMapList( out array<MapRecord> MapRecords, optional string Acronym );
|
||||
native(806) final simulated static function GetWeaponList( out array<WeaponRecord> WeaponRecords );
|
||||
native(807) final simulated static function GetVehicleList( out array<VehicleRecord> VehicleRecords );
|
||||
native(808) final simulated static function GetCrosshairList( out array<CrosshairRecord> CrosshairRecords );
|
||||
native(809) final simulated static function GetMutatorList( out array<MutatorRecord> MutatorRecords );
|
||||
native(810) final simulated static function GetAnnouncerList( out array<AnnouncerRecord> AnnouncerRecords );
|
||||
|
||||
// Not actually hooked up to cache (.int search)
|
||||
native(811) final simulated static function GetTeamSymbolList(out array<string> SymbolNames, optional bool bNoSinglePlayer);
|
||||
|
||||
native(818) final simulated static function GameRecord GetGameRecord ( coerce string ClassName);
|
||||
native(819) final simulated static function MapRecord GetMapRecord ( string MapName );
|
||||
native(880) final simulated static function MutatorRecord GetMutatorRecord( coerce string ClassName );
|
||||
native(881) final simulated static function WeaponRecord GetWeaponRecord( coerce string ClassName );
|
||||
native(882) final simulated static function VehicleRecord GetVehicleRecord( coerce string ClassName );
|
||||
native(883) final simulated static function AnnouncerRecord GetAnnouncerRecord( coerce string ClassName );
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
// ReplaceME: this stuff needs to be our content
|
||||
DefaultContent(0)=(Classes=("UTClassic.MutUTClassic","UnrealGame.MutLowGrav","UnrealGame.MutBigHead","XGame.xTeamGame","XGame.xDeathMatch","XGame.xCTFGame","XGame.InstagibCTF","XGame.xVehicleCTFGame","XGame.xDoubleDom","XGame.xBombingRun","XGame.MutRegen","XGame.MutInstaGib","XGame.MutQuadJump","XGame.MutSpeciesStats","XGame.MutVampire","XGame.MutSlomoDeath","XGame.MutNoAdrenaline","XGame.MutZoomInstagib","XWeapons.Translauncher","XWeapons.ShockRifle","XWeapons.LinkGun","XWeapons.MutArena","XWeapons.Minigun","XWeapons.BioRifle","XWeapons.FlakCannon","XWeapons.RocketLauncher","XWeapons.ShieldGun","XWeapons.SniperRifle","XWeapons.Painter","XWeapons.MutNoSuperWeapon","XWeapons.AssaultRifle","XWeapons.Redeemer","Vehicles.Bulldog"),Maps=("BR-Anubis","BR-Bifrost","BR-Disclosure","BR-IceFields","BR-Skyline","BR-Slaughterhouse","BR-TwinTombs","CTF-Chrome","CTF-Citadel","CTF-December","CTF-Face3","CTF-Geothermal","CTF-Lostfaith","CTF-Magma","CTF-Maul","CTF-Orbital2","DM-Antalus","DM-Asbestos","DM-Compressed","DM-Flux2","DM-Gael","DM-Inferno","DM-Insidious","DM-Leviathan","DM-Oceanic","DM-Phobos2","DM-Plunge","DM-1on1-Serpentine","DM-TokaraForest","DM-TrainingDay","DOM-Core","DOM-OutRigger","DOM-Ruination","DOM-ScorchedEarth","DOM-SepukkuGorge","DOM-Suntemple","TUT-BR","TUT-CTF","TUT-DM","TUT-DOM2"))
|
||||
DefaultContent(1)=(Classes=("BonusPack.xLastManStandingGame","BonusPack.xMutantGame","BonusPack.MutCrateCombo","SkaarjPack.Invasion"),Maps=("BR-Canyon","CTF-Avaris","CTF-DoubleDammage","DM-1on1-Crash","DM-1on1-Mixer","DM-Icetomb","DM-Injector","DM-IronDeity","DM-Rustatorium","DOM-Junkyard","BR-DE-ElecFields","CTF-DE-ElecFields","CTF-DE-LavaGiant2","DM-DE-GrendelKeep","DM-DE-Ironic","DM-DE-Osiris2"))
|
||||
DefaultContent(2)=(Classes=("XInterface.DefaultCrosshairs","Onslaught.ONSCrosshairs","UTClassic.MutUseSniper","UTClassic.MutUseLightning","Onslaught.ONSOnslaughtGame","Onslaught.MutOnslaughtWeapons","Onslaught.ONSAVRiL","Onslaught.ONSGrenadeLauncher","Onslaught.ONSMineLayer","Onslaught.MutLightweightVehicles","UT2k4Assault.ASGameInfo","UTClassic.ClassicSniperRifle","UnrealGame.FemaleAnnouncer","UnrealGame.MaleAnnouncer","UnrealGame.SexyFemaleAnnouncer"),Maps=("AS-Convoy","AS-FallenCity","AS-Glacier","AS-MotherShip","AS-RobotFactory","AS-Junkyard","BR-BridgeOfFate","BR-Colossus","BR-Serenity","CTF-AbsoluteZero","CTF-Colossus","CTF-Grendelkeep","CTF-MoonDragon","DM-1on1-Albatross","DM-1on1-Idoma","DM-1on1-Irondust","DM-1on1-Roughinery","DM-1on1-Spirit","DM-1on1-Squader","DM-1on1-Trite","DM-1on1-Desolation","DM-Corrugation","DM-Gestalt","DM-Goliath","DM-Hyperblast2","DM-Junkyard","DM-Metallurgy","DM-Morpheus3","DM-Rankin","DM-Rrajigar","DM-Sulphur","DOM-Atlantis","DOM-Aswan","DOM-Conduit","DOM-Renascent","ONS-ArcticStronghold","ONS-Crossfire","ONS-Torlan","CTF-1on1-Joust","CTF-BridgeOfFate","CTF-Grassyknoll","CTF-Smote","DM-DesertIsle","DOM-Access","ONS-Dria","ONS-Severance","ONS-RedPlanet","ONS-Dawn","CTF-FaceClassic","CTF-January","DM-Curse4","DM-Deck17","ONS-Frostbite","TUT-ONS","CTF-TwinTombs","ONS-Primeval","ONS-Adara","ONS-Aridoom","ONS-Ascendancy","ONS-IslandHop","ONS-Tricky","ONS-Urban"))
|
||||
DefaultContent(3)=(Classes=("OnslaughtFull.MutVehicleArena","OnslaughtFull.ONSBomber","OnslaughtFull.ONSPainter","OnslaughtFull.ONSMobileAssaultStation","UT2k4AssaultFull.ASVehicle_SpaceFighter_Human","UT2k4AssaultFull.ASVehicle_SpaceFighter_Skaarj","XGame.MutUDamageReward","UTV2004s.utvMutator"),Maps=("MOV-UT2004-Intro","Mov-UT2-intro"))
|
||||
}
|
||||
20
kf_sources/Engine/Classes/Camera.uc
Normal file
20
kf_sources/Engine/Classes/Camera.uc
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
//=============================================================================
|
||||
// A camera, used in UnrealEd.
|
||||
//=============================================================================
|
||||
class Camera extends PlayerController
|
||||
native;
|
||||
|
||||
// Sprite.
|
||||
#exec Texture Import File=Textures\S_Camera.pcx Name=S_Camera Mips=Off MASKED=1
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Location=(X=-500.000000,Y=-300.000000,Z=300.000000)
|
||||
Texture=S_Camera
|
||||
CollisionRadius=+00016.000000
|
||||
CollisionHeight=+00039.000000
|
||||
LightBrightness=100
|
||||
LightRadius=16
|
||||
bDirectional=1
|
||||
}
|
||||
|
||||
19
kf_sources/Engine/Classes/CameraEffect.uc
Normal file
19
kf_sources/Engine/Classes/CameraEffect.uc
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class CameraEffect extends Object
|
||||
abstract
|
||||
native
|
||||
noexport
|
||||
noteditinlinenew;
|
||||
|
||||
var float Alpha; // Used to transition camera effects. 0 = no effect, 1 = full effect
|
||||
var bool FinalEffect; // Forces the renderer to ignore effects on the stack below this one.
|
||||
|
||||
var int cameraeffect_dummy; // hammer padding. --ryan.
|
||||
|
||||
//
|
||||
// Default properties
|
||||
//
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Alpha=1.0
|
||||
}
|
||||
14
kf_sources/Engine/Classes/CameraOverlay.uc
Normal file
14
kf_sources/Engine/Classes/CameraOverlay.uc
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class CameraOverlay extends CameraEffect
|
||||
native
|
||||
noexport
|
||||
editinlinenew
|
||||
collapsecategories;
|
||||
|
||||
var() color OverlayColor;
|
||||
var() Material OverlayMaterial;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
OverlayColor=(R=255,G=255,B=255,A=255)
|
||||
FinalEffect=False
|
||||
}
|
||||
315
kf_sources/Engine/Classes/Canvas.uc
Normal file
315
kf_sources/Engine/Classes/Canvas.uc
Normal file
|
|
@ -0,0 +1,315 @@
|
|||
//=============================================================================
|
||||
// Canvas: A drawing canvas.
|
||||
// This is a built-in Unreal class and it shouldn't be modified.
|
||||
//
|
||||
// Notes.
|
||||
// To determine size of a drawable object, set Style to STY_None,
|
||||
// remember CurX, draw the thing, then inspect CurX and CurYL.
|
||||
//=============================================================================
|
||||
class Canvas extends Object
|
||||
native
|
||||
noexport;
|
||||
|
||||
// added for drawing solid primatives.
|
||||
#exec TEXTURE IMPORT NAME=WhiteTexture FILE=Textures\White.tga MIPS=0
|
||||
#exec TEXTURE IMPORT NAME=BlackTexture FILE=Textures\Black.tga MIPS=0
|
||||
#exec TEXTURE IMPORT NAME=GrayTexture FILE=Textures\Gray.tga MIPS=0
|
||||
|
||||
// simple default font, so various stuff doesn't crash
|
||||
#exec Font Import File=Textures\SmallFont.bmp Name="DefaultFont"
|
||||
|
||||
// Modifiable properties.
|
||||
var font Font; // Font for DrawText.
|
||||
var float FontScaleX, FontScaleY; // Scale for DrawText & DrawTextClipped. // gam
|
||||
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 Plane ColorModulate; // sjs - Modulate all colors by this before rendering
|
||||
var bool bForceAlpha; // Force all drawing to be alpha'ed
|
||||
var float ForcedAlpha; // How much to force
|
||||
|
||||
var bool bRenderLevel; // gam - Will render the level if enabled.
|
||||
|
||||
// Stock fonts.
|
||||
var font TinyFont, SmallFont, MedFont;
|
||||
var localized string TinyFontName, SmallFontName, MedFontName;
|
||||
|
||||
// Internal.
|
||||
var const viewport Viewport; // Viewport that owns the canvas.
|
||||
var const pointer pCanvasUtil; // sjs
|
||||
|
||||
// native functions.
|
||||
native(464) final function StrLen( coerce string String, out float XL, out float YL ); // Wrapped!
|
||||
native(465) final function DrawText( coerce string Text, optional bool CR );
|
||||
native(466) final function DrawTile( material Mat, float XL, float YL, float U, float V, float UL, float VL );
|
||||
native(467) final function DrawActor( Actor A, bool WireFrame, optional bool ClearZ, optional float DisplayFOV );
|
||||
native(468) final function DrawTileClipped( Material Mat, float XL, float YL, float U, float V, float UL, float VL );
|
||||
native(469) final function DrawTextClipped( coerce string Text, optional bool bCheckHotKey );
|
||||
native(470) final function TextSize( coerce string String, out float XL, out float YL ); // Clipped!
|
||||
native(480) final function DrawPortal( int X, int Y, int Width, int Height, actor CamActor, vector CamLocation, rotator CamRotation, optional int FOV, optional bool ClearZ );
|
||||
native final function vector WorldToScreen( vector WorldLoc );
|
||||
native final function GetCameraLocation( out vector CameraLocation, out rotator CameraRotation );
|
||||
|
||||
native final function SetScreenLight( int index, vector Position, color lightcolor, float radius );
|
||||
native final function SetScreenProjector( int index, vector Position, color color, float radius, texture tex );
|
||||
native final function DrawScreenActor( Actor A, optional float FOV, optional bool WireFrame, optional bool ClearZ );
|
||||
native final function Clear(optional bool ClearRGB, optional bool ClearZ);
|
||||
native final function WrapStringToArray(string Text, out array<string> OutArray, float dx, optional string EOL);
|
||||
static native final function WrapText( out String Text, out String Line, float dx, Font F, float FontScaleX );
|
||||
|
||||
|
||||
// jmw - These are two helper functions. The use the whole texture only. If you need better support, use DrawTile
|
||||
|
||||
native final function DrawTilePartialStretched( Material Mat, float XL, float YL ); // rjp
|
||||
native final function DrawTileStretched(material Mat, float XL, float YL);
|
||||
native final function DrawTileJustified(material Mat, byte Justification, float XL, float YL);
|
||||
native final function DrawTileScaled(material Mat, float XScale, float YScale);
|
||||
native final function DrawTextJustified(coerce string String, byte Justification, float x1, float y1, float x2, float y2);
|
||||
native final function DrawActorClipped( Actor A, bool WireFrame, float Left, float Top, float Width, float Height, optional bool ClearZ, optional float DisplayFOV);
|
||||
|
||||
// UnrealScript functions.
|
||||
event Reset()
|
||||
{
|
||||
Font = Default.Font;
|
||||
FontScaleX = Default.FontScaleX; // gam
|
||||
FontScaleY = Default.FontScaleY; // gam
|
||||
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;
|
||||
ColorModulate = Default.ColorModulate; // sjs
|
||||
}
|
||||
final function SetPos( float X, float Y )
|
||||
{
|
||||
CurX = X;
|
||||
CurY = Y;
|
||||
}
|
||||
final function SetOrigin( float X, float Y )
|
||||
{
|
||||
OrgX = X;
|
||||
OrgY = Y;
|
||||
}
|
||||
final function SetClip( float X, float Y )
|
||||
{
|
||||
ClipX = X;
|
||||
ClipY = Y;
|
||||
}
|
||||
final function DrawPattern( material Tex, float XL, float YL, float Scale )
|
||||
{
|
||||
DrawTile( Tex, XL, YL, (CurX-OrgX)*Scale, (CurY-OrgY)*Scale, XL*Scale, YL*Scale );
|
||||
}
|
||||
final function DrawIcon( texture Tex, float Scale )
|
||||
{
|
||||
if ( Tex != None )
|
||||
DrawTile( Tex, Tex.USize*Scale, Tex.VSize*Scale, 0, 0, Tex.USize, Tex.VSize );
|
||||
}
|
||||
final function DrawRect( texture Tex, float RectX, float RectY )
|
||||
{
|
||||
DrawTile( Tex, RectX, RectY, 0, 0, Tex.USize, Tex.VSize );
|
||||
}
|
||||
|
||||
final function SetDrawColor(byte R, byte G, byte B, optional byte A)
|
||||
{
|
||||
local Color C;
|
||||
|
||||
C.R = R;
|
||||
C.G = G;
|
||||
C.B = B;
|
||||
if ( A == 0 )
|
||||
A = 255;
|
||||
C.A = A;
|
||||
DrawColor = C;
|
||||
}
|
||||
|
||||
static final function Color MakeColor(byte R, byte G, byte B, optional byte A)
|
||||
{
|
||||
local Color C;
|
||||
|
||||
C.R = R;
|
||||
C.G = G;
|
||||
C.B = B;
|
||||
if ( A == 0 )
|
||||
A = 255;
|
||||
C.A = A;
|
||||
return C;
|
||||
}
|
||||
|
||||
// Draw a vertical line
|
||||
final function DrawVertical(float X, float height)
|
||||
{
|
||||
local float cX,cY;
|
||||
|
||||
CX = CurX; CY = CurY;
|
||||
CurX = X;
|
||||
DrawTile(Texture'engine.WhiteSquareTexture', 2, height, 0, 0, 2, 2);
|
||||
CurX = CX; CurY = CY;
|
||||
}
|
||||
|
||||
// Draw a horizontal line
|
||||
final function DrawHorizontal(float Y, float width)
|
||||
{
|
||||
local float cx,cy;
|
||||
CX = CurX; CY = CurY;
|
||||
CurY = Y;
|
||||
DrawTile(Texture'engine.WhiteSquareTexture', width, 2, 0, 0, 2, 2);
|
||||
CurX = CX; CurY = CY;
|
||||
}
|
||||
|
||||
// Draw Line is special as it saves it's original position
|
||||
|
||||
final function DrawLine(int direction, float size)
|
||||
{
|
||||
local float cx,cy;
|
||||
CX = CurX; CY = CurY;
|
||||
|
||||
switch (direction)
|
||||
{
|
||||
case 0:
|
||||
CurY-=Size;
|
||||
DrawVertical(CurX,size);
|
||||
break;
|
||||
case 1:
|
||||
DrawVertical(CurX,size);
|
||||
break;
|
||||
case 2:
|
||||
CurX-=Size;
|
||||
DrawHorizontal(CurY,size);
|
||||
break;
|
||||
case 3:
|
||||
DrawHorizontal(CurY,size);
|
||||
break;
|
||||
}
|
||||
CurX = CX; CurY = CY;
|
||||
}
|
||||
|
||||
final simulated function DrawBracket(float width, float height, float bracket_size)
|
||||
{
|
||||
local float x,y;
|
||||
Width = max(width,5);
|
||||
Height = max(height,5);
|
||||
|
||||
x = curX; Y = curY;
|
||||
|
||||
DrawHorizontal(CurY,bracket_size);
|
||||
DrawHorizontal(CurY+Height,bracket_size);
|
||||
DrawVertical(CurX,bracket_size);
|
||||
DrawVertical(CurX+Width,bracket_size);
|
||||
|
||||
CurY = Y + Height-bracket_size;
|
||||
DrawVertical(CurX,Bracket_size);
|
||||
DrawVertical(CurX+Width,Bracket_Size);
|
||||
|
||||
CurX = X+Width-Bracket_Size;
|
||||
DrawHorizontal(Y,Bracket_Size);
|
||||
DrawHorizontal(Y+Height, Bracket_Size);
|
||||
|
||||
}
|
||||
|
||||
final simulated function DrawBox(canvas canvas, float width, float height)
|
||||
{
|
||||
DrawHorizontal(CurY,Width);
|
||||
DrawHorizontal(CurY+Height,Width);
|
||||
DrawVertical(CurX,Height);
|
||||
DrawVertical(CurX+Width,Height);
|
||||
}
|
||||
|
||||
simulated function DrawScreenText (String Text, float X, float Y, EDrawPivot Pivot)
|
||||
{
|
||||
local int TextScreenWidth, TextScreenHeight;
|
||||
local float UL, VL;
|
||||
|
||||
X *= SizeX;
|
||||
Y *= SizeY;
|
||||
|
||||
TextSize (Text, UL, VL);
|
||||
|
||||
TextScreenWidth = UL;
|
||||
TextScreenHeight = VL;
|
||||
|
||||
switch (Pivot)
|
||||
{
|
||||
case DP_UpperLeft:
|
||||
break;
|
||||
|
||||
case DP_UpperMiddle:
|
||||
X -= TextScreenWidth / 2;
|
||||
break;
|
||||
|
||||
case DP_UpperRight:
|
||||
X -= TextScreenWidth;
|
||||
break;
|
||||
|
||||
case DP_MiddleRight:
|
||||
X -= TextScreenWidth;
|
||||
Y -= TextScreenHeight / 2;
|
||||
break;
|
||||
|
||||
case DP_LowerRight:
|
||||
X -= TextScreenWidth;
|
||||
Y -= TextScreenHeight;
|
||||
break;
|
||||
|
||||
case DP_LowerMiddle:
|
||||
X -= TextScreenWidth / 2;
|
||||
Y -= TextScreenHeight;
|
||||
break;
|
||||
|
||||
case DP_LowerLeft:
|
||||
Y -= TextScreenHeight;
|
||||
break;
|
||||
|
||||
case DP_MiddleLeft:
|
||||
Y -= TextScreenHeight / 2;
|
||||
break;
|
||||
|
||||
case DP_MiddleMiddle:
|
||||
X -= TextScreenWidth / 2;
|
||||
Y -= TextScreenHeight / 2;
|
||||
break;
|
||||
}
|
||||
|
||||
SetPos (X, Y);
|
||||
DrawTextClipped (Text);
|
||||
}
|
||||
|
||||
// if _RO_
|
||||
// https://udn.epicgames.com/Two/DrawPositionedActor --
|
||||
native function DrawPositionedActor( Actor A, bool WireFrame, optional bool ClearZ, optional float DisplayFOV, optional Rotator cameraRot, optional vector DrawOffset );
|
||||
// -- https://udn.epicgames.com/Two/DrawPositionedActor
|
||||
// end _RO_
|
||||
|
||||
// if _RO_
|
||||
native function DrawBoundActor(Actor A, bool WireFrame, optional bool ClearZ, optional float DisplayFOV, optional rotator cameraRot, optional rotator actorRotOffset, optional vector DrawOffset);
|
||||
// end _RO_
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Style=1
|
||||
FontScaleX=1.0
|
||||
FontScaleY=1.0
|
||||
Z=1
|
||||
DrawColor=(R=127,G=127,B=127,A=255)
|
||||
TinyFontName="ROFonts.ROBtsrmVr7"//"UT2003Fonts.FontMono"
|
||||
SmallFontName="ROFonts.ROBtsrmVr7"//"UT2003Fonts.FontMono"
|
||||
MedFontName="ROFonts.ROBtsrmVr8"//"UT2003Fonts.FontMono800x600"
|
||||
pCanvasUtil=0
|
||||
ColorModulate=(X=1.0,Y=1.0,Z=1.0,W=1.0)
|
||||
bRenderLevel=true
|
||||
Font=DefaultFont
|
||||
}
|
||||
70
kf_sources/Engine/Classes/ChatRoomMessage.uc
Normal file
70
kf_sources/Engine/Classes/ChatRoomMessage.uc
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
//==============================================================================
|
||||
// Created on: 08/18/2003
|
||||
// This class handles localized messages dealing with voice chatrooms.
|
||||
//
|
||||
// Written by Ron Prestenback
|
||||
// © 2003, Epic Games, Inc. All Rights Reserved
|
||||
//==============================================================================
|
||||
class ChatRoomMessage extends LocalMessage;
|
||||
|
||||
var localized string AnonText;
|
||||
var localized string ChatRoomString[16];
|
||||
|
||||
static function string AssembleMessage(
|
||||
int Index,
|
||||
string ChannelTitle,
|
||||
optional PlayerReplicationInfo RelatedPRI
|
||||
)
|
||||
{
|
||||
local string Text;
|
||||
|
||||
if ( RelatedPRI != None )
|
||||
Text = Repl( default.ChatRoomString[Index], "%pri%", RelatedPRI.PlayerName );
|
||||
else if ( InStr(default.ChatRoomString[Index], "%pri%") != -1 )
|
||||
Text = Repl(default.ChatRoomString[Index], "%pri%", default.AnonText);
|
||||
else
|
||||
Text = default.ChatRoomString[Index];
|
||||
|
||||
if ( ChannelTitle != "" )
|
||||
return Repl( Text, "%title%", ChannelTitle );
|
||||
|
||||
else return Text;
|
||||
}
|
||||
|
||||
static function bool IsConsoleMessage( int Index )
|
||||
{
|
||||
switch ( Index )
|
||||
{
|
||||
case 1:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
return False;
|
||||
}
|
||||
|
||||
return Super.IsConsoleMessage(Index);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
AnonText="Someone"
|
||||
ChatRoomString(0)="Invalid channel or channel couldn't be found: '%title%'"
|
||||
ChatRoomString(1)="Already a member of channel '%title%'"
|
||||
ChatRoomString(2)="Channel '%title%' requires a password!"
|
||||
ChatRoomString(3)="Incorrect password specified for channel '%title%'"
|
||||
ChatRoomString(4)="You have been banned from channel '%title%'"
|
||||
ChatRoomString(5)="Couldn't join channel '%title%'. Channel full!"
|
||||
ChatRoomString(6)="You are not allowed to join channel '%title%'"
|
||||
ChatRoomString(7)="Successfully joined channel '%title%'"
|
||||
ChatRoomString(8)="You left channel '%title%'"
|
||||
ChatRoomString(9)="Now speaking on channel '%title%'"
|
||||
ChatRoomString(10)="No longer speaking on channel '%title%'"
|
||||
ChatRoomString(11)="'%pri%' joined channel '%title%'"
|
||||
ChatRoomString(12)="'%pri%' left channel '%title%'"
|
||||
ChatRoomString(13)="Successfully banned '%pri%' from your personal chat channel"
|
||||
ChatRoomString(14)="Voice-chat ban action not successful. No player with the specified ID was found"
|
||||
ChatRoomString(15)="Voice chat is not enabled on this server"
|
||||
}
|
||||
702
kf_sources/Engine/Classes/CheatManager.uc
Normal file
702
kf_sources/Engine/Classes/CheatManager.uc
Normal file
|
|
@ -0,0 +1,702 @@
|
|||
//=============================================================================
|
||||
// CheatManager
|
||||
// Object within playercontroller that manages "cheat" commands
|
||||
// only spawned in single player mode
|
||||
//=============================================================================
|
||||
|
||||
class CheatManager extends Object within PlayerController
|
||||
native;
|
||||
|
||||
var rotator LockedRotation;
|
||||
|
||||
var bool bCheatsEnabled;
|
||||
|
||||
/* Used for correlating game situation with log file
|
||||
*/
|
||||
|
||||
exec function ReviewJumpSpots(name TestLabel)
|
||||
{
|
||||
if ( TestLabel == 'Transloc' )
|
||||
TestLabel = 'Begin';
|
||||
else if ( TestLabel == 'Jump' )
|
||||
TestLabel = 'Finished';
|
||||
else if ( TestLabel == 'Combo' )
|
||||
TestLabel = 'FinishedJumping';
|
||||
else if ( TestLabel == 'LowGrav' )
|
||||
TestLabel = 'FinishedComboJumping';
|
||||
log("TestLabel is "$TestLabel);
|
||||
Level.Game.ReviewJumpSpots(TestLabel);
|
||||
}
|
||||
|
||||
exec function ListDynamicActors()
|
||||
{
|
||||
local Actor A;
|
||||
local int i;
|
||||
|
||||
ForEach DynamicActors(class'Actor',A)
|
||||
{
|
||||
i++;
|
||||
log(i@A);
|
||||
}
|
||||
log("Num dynamic actors: "$i);
|
||||
}
|
||||
|
||||
exec function FreezeFrame(float delay)
|
||||
{
|
||||
Level.Game.SetPause(true,outer);
|
||||
Level.PauseDelay = Level.TimeSeconds + delay;
|
||||
}
|
||||
|
||||
exec function WriteToLog( string Param )
|
||||
{
|
||||
log("NOW!" $ Eval(Param != "", " '" $ Param $ "'", ""));
|
||||
}
|
||||
|
||||
exec function SetFlash(float F)
|
||||
{
|
||||
FlashScale.X = F;
|
||||
}
|
||||
|
||||
exec function SetFogR(float F)
|
||||
{
|
||||
FlashFog.X = F;
|
||||
}
|
||||
|
||||
exec function SetFogG(float F)
|
||||
{
|
||||
FlashFog.Y = F;
|
||||
}
|
||||
|
||||
exec function SetFogB(float F)
|
||||
{
|
||||
FlashFog.Z = F;
|
||||
}
|
||||
|
||||
exec function KillViewedActor()
|
||||
{
|
||||
if ( ViewTarget != None )
|
||||
{
|
||||
if ( (Pawn(ViewTarget) != None) && (Pawn(ViewTarget).Controller != None) )
|
||||
Pawn(ViewTarget).Controller.Destroy();
|
||||
ViewTarget.Destroy();
|
||||
SetViewTarget(None);
|
||||
ReportCheat("KillViewedActor");
|
||||
}
|
||||
}
|
||||
|
||||
/* LogScriptedSequences()
|
||||
Toggles logging of scripted sequences on and off
|
||||
*/
|
||||
exec function LogScriptedSequences()
|
||||
{
|
||||
local AIScript S;
|
||||
|
||||
ForEach AllActors(class'AIScript',S)
|
||||
S.bLoggingEnabled = !S.bLoggingEnabled;
|
||||
}
|
||||
|
||||
/* Teleport()
|
||||
Teleport to surface player is looking at
|
||||
*/
|
||||
exec function Teleport()
|
||||
{
|
||||
local actor HitActor;
|
||||
local vector HitNormal, HitLocation;
|
||||
if (!areCheatsEnabled()) return;
|
||||
|
||||
HitActor = Trace(HitLocation, HitNormal, ViewTarget.Location + 10000 * vector(Rotation),ViewTarget.Location, true);
|
||||
if ( HitActor == None )
|
||||
HitLocation = ViewTarget.Location + 10000 * vector(Rotation);
|
||||
else
|
||||
HitLocation = HitLocation + ViewTarget.CollisionRadius * HitNormal;
|
||||
|
||||
ViewTarget.SetLocation(HitLocation);
|
||||
ReportCheat("Teleport");
|
||||
}
|
||||
|
||||
/*
|
||||
Scale the player's size to be F * default size
|
||||
*/
|
||||
exec function ChangeSize( float F )
|
||||
{
|
||||
if ( Pawn.SetCollisionSize(Pawn.Default.CollisionRadius * F,Pawn.Default.CollisionHeight * F) )
|
||||
{
|
||||
Pawn.SetDrawScale(F);
|
||||
Pawn.SetLocation(Pawn.Location);
|
||||
}
|
||||
}
|
||||
|
||||
exec function LockCamera()
|
||||
{
|
||||
local vector LockedLocation;
|
||||
local rotator LockedRot;
|
||||
local actor LockedActor;
|
||||
|
||||
if ( !bCameraPositionLocked )
|
||||
{
|
||||
PlayerCalcView(LockedActor,LockedLocation,LockedRot);
|
||||
Outer.SetLocation(LockedLocation);
|
||||
LockedRotation = LockedRot;
|
||||
SetViewTarget(outer);
|
||||
}
|
||||
else
|
||||
SetViewTarget(Pawn);
|
||||
|
||||
bCameraPositionLocked = !bCameraPositionLocked;
|
||||
bBehindView = bCameraPositionLocked;
|
||||
bFreeCamera = false;
|
||||
}
|
||||
|
||||
exec function SetCameraDist( float F )
|
||||
{
|
||||
CameraDist = FMax(F,2);
|
||||
}
|
||||
|
||||
/* Stop interpolation
|
||||
*/
|
||||
exec function EndPath()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Camera and pawn aren't rotated together in behindview when bFreeCamera is true
|
||||
*/
|
||||
exec function FreeCamera( bool B )
|
||||
{
|
||||
bFreeCamera = B;
|
||||
bBehindView = B;
|
||||
}
|
||||
|
||||
|
||||
exec function CauseEvent( name EventName )
|
||||
{
|
||||
TriggerEvent( EventName, Pawn, Pawn);
|
||||
}
|
||||
|
||||
|
||||
exec function Amphibious()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
Pawn.UnderwaterTime = +999999.0;
|
||||
ReportCheat("Amphibious");
|
||||
}
|
||||
|
||||
exec function Fly()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
if ( (Pawn != None) && Pawn.CheatFly() )
|
||||
{
|
||||
ClientMessage("You feel much lighter");
|
||||
bCheatFlying = true;
|
||||
Outer.GotoState('PlayerFlying');
|
||||
ReportCheat("Fly");
|
||||
}
|
||||
}
|
||||
|
||||
exec function Walk()
|
||||
{
|
||||
bCheatFlying = false;
|
||||
if ( (Pawn != None) && Pawn.CheatWalk() )
|
||||
ClientReStart(Pawn);
|
||||
}
|
||||
|
||||
exec function Ghost()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
if ( (Pawn != None) && Pawn.CheatGhost() )
|
||||
{
|
||||
ClientMessage("You feel ethereal");
|
||||
bCheatFlying = true;
|
||||
Outer.GotoState('PlayerFlying');
|
||||
ReportCheat("Ghost");
|
||||
}
|
||||
}
|
||||
|
||||
exec function AllAmmo()
|
||||
{
|
||||
local Inventory Inv;
|
||||
if (!areCheatsEnabled()) return;
|
||||
|
||||
for( Inv=Pawn.Inventory; Inv!=None; Inv=Inv.Inventory )
|
||||
if ( Weapon(Inv)!=None )
|
||||
Weapon(Inv).SuperMaxOutAmmo();
|
||||
|
||||
AwardAdrenaline( 999 );
|
||||
ReportCheat("AllAmmo");
|
||||
}
|
||||
|
||||
exec function Invisible(bool B)
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
Pawn.bHidden = B;
|
||||
|
||||
if (B)
|
||||
Pawn.Visibility = 0;
|
||||
else
|
||||
Pawn.Visibility = Pawn.Default.Visibility;
|
||||
ReportCheat("Invisible");
|
||||
}
|
||||
|
||||
exec function Phil()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
if( !bGodMode )
|
||||
{
|
||||
bGodMode = true;
|
||||
ClientMessage("phil == god");
|
||||
ReportCheat("God");
|
||||
}
|
||||
else
|
||||
{
|
||||
bGodMode = false;
|
||||
ClientMessage("you're not phil!");
|
||||
}
|
||||
}
|
||||
|
||||
exec function God()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
if ( bGodMode )
|
||||
{
|
||||
bGodMode = false;
|
||||
ClientMessage("God mode off");
|
||||
return;
|
||||
}
|
||||
|
||||
bGodMode = true;
|
||||
ClientMessage("God Mode on");
|
||||
ReportCheat("God");
|
||||
}
|
||||
|
||||
exec function SloMo( float T )
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
Level.Game.SetGameSpeed(T);
|
||||
Level.Game.SaveConfig();
|
||||
Level.Game.GameReplicationInfo.SaveConfig();
|
||||
ReportCheat("SloMo");
|
||||
}
|
||||
|
||||
exec function SetJumpZ( float F )
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
Pawn.JumpZ = F;
|
||||
ReportCheat("SetJumpZ");
|
||||
}
|
||||
|
||||
exec function SetGravity( float F )
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
PhysicsVolume.Gravity.Z = F;
|
||||
ReportCheat("SetGravity");
|
||||
}
|
||||
|
||||
exec function SetSpeed( float F )
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
Pawn.GroundSpeed = Pawn.Default.GroundSpeed * f;
|
||||
Pawn.WaterSpeed = Pawn.Default.WaterSpeed * f;
|
||||
ReportCheat("SetSpeed");
|
||||
}
|
||||
|
||||
exec function KillPawns()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
KillAllPawns(class'Pawn');
|
||||
ReportCheat("KillPawns");
|
||||
}
|
||||
|
||||
/* Avatar()
|
||||
Possess a pawn of the requested class
|
||||
*/
|
||||
exec function Avatar( string ClassName )
|
||||
{
|
||||
local class<actor> NewClass;
|
||||
local Pawn P;
|
||||
|
||||
NewClass = class<actor>( DynamicLoadObject( ClassName, class'Class' ) );
|
||||
if( NewClass!=None )
|
||||
{
|
||||
Foreach DynamicActors(class'Pawn',P)
|
||||
{
|
||||
if ( (P.Class == NewClass) && (P != Pawn) )
|
||||
{
|
||||
if ( Pawn.Controller != None )
|
||||
Pawn.Controller.PawnDied(Pawn);
|
||||
Possess(P);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exec function Summon( string ClassName )
|
||||
{
|
||||
local class<actor> NewClass;
|
||||
local vector SpawnLoc;
|
||||
|
||||
if (!areCheatsEnabled()) return;
|
||||
|
||||
log( "Fabricate " $ ClassName );
|
||||
NewClass = class<actor>( DynamicLoadObject( ClassName, class'Class' ) );
|
||||
if( NewClass!=None )
|
||||
{
|
||||
if ( Pawn != None )
|
||||
SpawnLoc = Pawn.Location;
|
||||
else
|
||||
SpawnLoc = Location;
|
||||
Spawn( NewClass,,,SpawnLoc + 72 * Vector(Rotation) + vect(0,0,1) * 15 );
|
||||
}
|
||||
ReportCheat("Summon");
|
||||
}
|
||||
|
||||
exec function PlayersOnly()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
Level.bPlayersOnly = !Level.bPlayersOnly;
|
||||
ReportCheat("PlayersOnly");
|
||||
}
|
||||
|
||||
exec function FreezeAll()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
Level.bPlayersOnly = !Level.bPlayersOnly;
|
||||
Level.bFreezeKarma = Level.bPlayersOnly;
|
||||
ReportCheat("FreezeAll");
|
||||
}
|
||||
|
||||
exec function ClearAllDebugLines()
|
||||
{
|
||||
local actor A;
|
||||
|
||||
foreach AllActors(class'Actor', A)
|
||||
A.ClearStayingDebugLines();
|
||||
}
|
||||
|
||||
exec function CheatView( class<actor> aClass, optional bool bQuiet )
|
||||
{
|
||||
ViewClass(aClass,bQuiet, true);
|
||||
}
|
||||
|
||||
// ***********************************************************
|
||||
// Navigation Aids (for testing)
|
||||
|
||||
// remember spot for path testing (display path using ShowDebug)
|
||||
exec function RememberSpot()
|
||||
{
|
||||
if ( Pawn != None )
|
||||
Destination = Pawn.Location;
|
||||
else
|
||||
Destination = Location;
|
||||
}
|
||||
|
||||
// ***********************************************************
|
||||
// Changing viewtarget
|
||||
|
||||
exec function ViewSelf(optional bool bQuiet)
|
||||
{
|
||||
bBehindView = false;
|
||||
bViewBot = false;
|
||||
if ( Pawn != None )
|
||||
SetViewTarget(Pawn);
|
||||
else
|
||||
SetViewtarget(outer);
|
||||
if (!bQuiet )
|
||||
ClientMessage(OwnCamera, 'Event');
|
||||
FixFOV();
|
||||
}
|
||||
|
||||
exec function ViewPlayer( string S )
|
||||
{
|
||||
local Controller P;
|
||||
|
||||
for ( P=Level.ControllerList; P!=None; P= P.NextController )
|
||||
if ( P.bIsPlayer && (P.PlayerReplicationInfo.PlayerName ~= S) )
|
||||
break;
|
||||
|
||||
if ( P.Pawn != None )
|
||||
{
|
||||
ClientMessage(ViewingFrom@P.PlayerReplicationInfo.PlayerName, 'Event');
|
||||
SetViewTarget(P.Pawn);
|
||||
}
|
||||
|
||||
bBehindView = ( ViewTarget != Pawn );
|
||||
if ( bBehindView )
|
||||
ViewTarget.BecomeViewTarget();
|
||||
}
|
||||
|
||||
exec function ViewActor( name ActorName)
|
||||
{
|
||||
local Actor A;
|
||||
|
||||
ForEach AllActors(class'Actor', A)
|
||||
if ( A.Name == ActorName )
|
||||
{
|
||||
SetViewTarget(A);
|
||||
bBehindView = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
exec function ViewFlag()
|
||||
{
|
||||
local Controller C;
|
||||
|
||||
For ( C=Level.ControllerList; C!=None; C=C.NextController )
|
||||
if ( C.IsA('AIController') && (C.PlayerReplicationInfo != None) && (C.PlayerReplicationInfo.HasFlag != None) )
|
||||
{
|
||||
SetViewTarget(C.Pawn);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
exec function ViewBot()
|
||||
{
|
||||
local actor first;
|
||||
local bool bFound;
|
||||
local Controller C;
|
||||
|
||||
bViewBot = true;
|
||||
For ( C=Level.ControllerList; C!=None; C=C.NextController )
|
||||
if ( C.IsA('Bot') && (C.Pawn != None) )
|
||||
{
|
||||
if ( bFound || (first == None) )
|
||||
{
|
||||
first = C;
|
||||
if ( bFound )
|
||||
break;
|
||||
}
|
||||
if ( C == RealViewTarget )
|
||||
bFound = true;
|
||||
}
|
||||
|
||||
if ( first != None )
|
||||
{
|
||||
SetViewTarget(first);
|
||||
bBehindView = true;
|
||||
ViewTarget.BecomeViewTarget();
|
||||
FixFOV();
|
||||
}
|
||||
else
|
||||
ViewSelf(true);
|
||||
}
|
||||
|
||||
exec function ViewTurret()
|
||||
{
|
||||
local actor first;
|
||||
local bool bFound;
|
||||
local Controller C;
|
||||
|
||||
bViewBot = true;
|
||||
For ( C=Level.ControllerList; C!=None; C=C.NextController )
|
||||
if ( C.IsA('AIController') && (C.Pawn != None) && !C.IsA('Bot') )
|
||||
{
|
||||
if ( bFound || (first == None) )
|
||||
{
|
||||
first = C.Pawn;
|
||||
if ( bFound )
|
||||
break;
|
||||
}
|
||||
if ( C.Pawn == ViewTarget )
|
||||
bFound = true;
|
||||
}
|
||||
|
||||
if ( first != None )
|
||||
{
|
||||
SetViewTarget(first);
|
||||
bBehindView = true;
|
||||
ViewTarget.BecomeViewTarget();
|
||||
FixFOV();
|
||||
}
|
||||
else
|
||||
ViewSelf(true);
|
||||
}
|
||||
|
||||
exec function ViewClass( class<actor> aClass, optional bool bQuiet, optional bool bCheat )
|
||||
{
|
||||
local actor other, first;
|
||||
local bool bFound;
|
||||
|
||||
if ( !bCheat && (Level.Game != None) && !Level.Game.bCanViewOthers )
|
||||
return;
|
||||
|
||||
first = None;
|
||||
|
||||
ForEach AllActors( aClass, other )
|
||||
{
|
||||
if ( bFound || (first == None) )
|
||||
{
|
||||
first = other;
|
||||
if ( bFound )
|
||||
break;
|
||||
}
|
||||
if ( other == ViewTarget )
|
||||
bFound = true;
|
||||
}
|
||||
|
||||
if ( first != None )
|
||||
{
|
||||
if ( !bQuiet )
|
||||
{
|
||||
if ( Pawn(first) != None )
|
||||
ClientMessage(ViewingFrom@First.GetHumanReadableName(), 'Event');
|
||||
else
|
||||
ClientMessage(ViewingFrom@first, 'Event');
|
||||
}
|
||||
SetViewTarget(first);
|
||||
bBehindView = ( ViewTarget != outer );
|
||||
|
||||
if ( bBehindView )
|
||||
ViewTarget.BecomeViewTarget();
|
||||
|
||||
FixFOV();
|
||||
}
|
||||
else
|
||||
ViewSelf(bQuiet);
|
||||
}
|
||||
|
||||
exec function Loaded()
|
||||
{
|
||||
local Inventory Inv;
|
||||
if (!areCheatsEnabled()) return;
|
||||
|
||||
if( Level.Netmode!=NM_Standalone )
|
||||
return;
|
||||
|
||||
AllWeapons();
|
||||
AllAmmo();
|
||||
|
||||
if ( Pawn != None )
|
||||
For ( Inv=Pawn.Inventory; Inv!=None; Inv=Inv.Inventory )
|
||||
if ( Weapon(Inv) != None )
|
||||
Weapon(Inv).Loaded();
|
||||
ReportCheat("Loaded");
|
||||
}
|
||||
|
||||
exec function AllWeapons()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
if( (Level.Netmode!=NM_Standalone) || (Pawn == None) || (Vehicle(Pawn) != None) )
|
||||
return;
|
||||
|
||||
Pawn.GiveWeapon("XWeapons.AssaultRifle");
|
||||
Pawn.GiveWeapon("XWeapons.RocketLauncher");
|
||||
Pawn.GiveWeapon("XWeapons.ShockRifle");
|
||||
Pawn.GiveWeapon("XWeapons.ShieldGun");
|
||||
Pawn.GiveWeapon("XWeapons.LinkGun");
|
||||
Pawn.GiveWeapon("XWeapons.SniperRifle");
|
||||
Pawn.GiveWeapon("XWeapons.FlakCannon");
|
||||
Pawn.GiveWeapon("XWeapons.MiniGun");
|
||||
Pawn.GiveWeapon("XWeapons.TransLauncher");
|
||||
Pawn.GiveWeapon("XWeapons.Painter");
|
||||
Pawn.GiveWeapon("XWeapons.BioRifle");
|
||||
Pawn.GiveWeapon("XWeapons.Redeemer");
|
||||
Pawn.GiveWeapon("UTClassic.ClassicSniperRifle");
|
||||
Pawn.GiveWeapon("Onslaught.ONSGrenadeLauncher");
|
||||
Pawn.GiveWeapon("Onslaught.ONSAVRiL");
|
||||
Pawn.GiveWeapon("Onslaught.ONSMineLayer");
|
||||
Pawn.GiveWeapon("OnslaughtFull.ONSPainter");
|
||||
|
||||
ReportCheat("AllWeapons");
|
||||
}
|
||||
|
||||
// Win and skip the current ladder match, if in single-player mode
|
||||
exec function SkipMatch()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
if( (Level.Netmode!=NM_Standalone) || (Pawn == None) )
|
||||
return;
|
||||
|
||||
ReportCheat("SkipMatch");
|
||||
if ( Level.Game.CurrentGameProfile != none ) {
|
||||
Level.Game.CurrentGameProfile.CheatSkipMatch(Level.Game);
|
||||
}
|
||||
}
|
||||
|
||||
// jump to a specific match in the ladders
|
||||
// combine the ladder/rung into one number, i.e., 54 = ladder 5, rung 4
|
||||
exec function JumpMatch(int ladderrung)
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
if( (Level.Netmode!=NM_Standalone) || (Pawn == None) )
|
||||
return;
|
||||
|
||||
if (ladderrung < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
ReportCheat("JumpMatch");
|
||||
if ( Level.Game.CurrentGameProfile != none ) {
|
||||
Level.Game.CurrentGameProfile.CheatJumpMatch(Level.Game, ladderrung);
|
||||
}
|
||||
}
|
||||
|
||||
exec function WinMatch()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
ReportCheat("WinMatch");
|
||||
if (PlayerReplicationInfo.Team != none)
|
||||
{
|
||||
PlayerReplicationInfo.Team.Score = Level.Game.GoalScore;
|
||||
}
|
||||
else {
|
||||
PlayerReplicationInfo.Score = Level.Game.GoalScore;
|
||||
}
|
||||
Level.Game.CheckScore(PlayerReplicationInfo);
|
||||
}
|
||||
|
||||
exec function EnableCheats()
|
||||
{
|
||||
bCheatsEnabled=true;
|
||||
ClientMessage("Cheats enabled");
|
||||
}
|
||||
|
||||
/** check if cheats are enabled, if not playing a SP game always return true */
|
||||
function bool areCheatsEnabled()
|
||||
{
|
||||
if ( Level.Game.CurrentGameProfile != none )
|
||||
{
|
||||
if (!bCheatsEnabled)
|
||||
{
|
||||
ClientMessage("Cheats are NOT enabled, to enable cheats type: EnableCheats");
|
||||
ClientMessage("Enabling cheats prevents you from unlocking the bonus characters");
|
||||
}
|
||||
return bCheatsEnabled;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// report the cheat used
|
||||
function ReportCheat(optional string cheat)
|
||||
{
|
||||
if ( Level.Game.CurrentGameProfile != none ) {
|
||||
Level.Game.CurrentGameProfile.ReportCheat(outer, cheat);
|
||||
}
|
||||
}
|
||||
|
||||
exec function WeakObjectives()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
ReportCheat("WeakObjectives");
|
||||
Level.Game.WeakObjectives();
|
||||
}
|
||||
|
||||
exec function DisableNextObjective()
|
||||
{
|
||||
if (!areCheatsEnabled()) return;
|
||||
ReportCheat("DisableNextObjective");
|
||||
Level.Game.DisableNextObjective();
|
||||
}
|
||||
exec function ruler()
|
||||
{
|
||||
local NavigationPoint N;
|
||||
|
||||
ForEach AllActors(class'NavigationPoint',N)
|
||||
if ( N.IsA('ONSPowerCore') )
|
||||
N.Bump(Pawn);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bCheatsEnabled=false
|
||||
}
|
||||
24
kf_sources/Engine/Classes/ClientMover.uc
Normal file
24
kf_sources/Engine/Classes/ClientMover.uc
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
class ClientMover Extends Mover;
|
||||
|
||||
function PostBeginPlay()
|
||||
{
|
||||
Super.PostBeginPlay();
|
||||
|
||||
if ( Level.NetMode == NM_DedicatedServer )
|
||||
{
|
||||
GotoState('ServerIdle');
|
||||
SetTimer(0,false);
|
||||
SetPhysics(PHYS_None);
|
||||
}
|
||||
}
|
||||
|
||||
State ServerIdle
|
||||
{
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bAlwaysRelevant=false
|
||||
RemoteRole=ROLE_None
|
||||
bClientAuthoritative=true
|
||||
}
|
||||
25
kf_sources/Engine/Classes/ClipMarker.uc
Normal file
25
kf_sources/Engine/Classes/ClipMarker.uc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//=============================================================================
|
||||
// ClipMarker.
|
||||
//
|
||||
// These are markers for the brush clip mode. You place 2 or 3 of these in
|
||||
// the level and that defines your clipping plane.
|
||||
//
|
||||
// These should NOT be manually added to the level. The editor adds and
|
||||
// deletes them on it's own.
|
||||
//
|
||||
//=============================================================================
|
||||
class ClipMarker extends Keypoint
|
||||
placeable
|
||||
native;
|
||||
|
||||
#exec Texture Import File=Textures\S_ClipMarker.pcx Name=S_ClipMarker Mips=Off MASKED=1
|
||||
#exec Texture Import File=Textures\S_ClipMarker1.pcx Name=S_ClipMarker1 Mips=Off MASKED=1
|
||||
#exec Texture Import File=Textures\S_ClipMarker2.pcx Name=S_ClipMarker2 Mips=Off MASKED=1
|
||||
#exec Texture Import File=Textures\S_ClipMarker3.pcx Name=S_ClipMarker3 Mips=Off MASKED=1
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bEdShouldSnap=True
|
||||
Texture=Texture'Engine.S_ClipMarker'
|
||||
bStatic=True
|
||||
}
|
||||
16
kf_sources/Engine/Classes/ColorModifier.uc
Normal file
16
kf_sources/Engine/Classes/ColorModifier.uc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
class ColorModifier extends Modifier
|
||||
noteditinlinenew
|
||||
native;
|
||||
|
||||
var() color Color;
|
||||
var() bool RenderTwoSided;
|
||||
var() bool AlphaBlend;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Color=(R=255,G=255,B=255,A=255)
|
||||
RenderTwoSided=true
|
||||
AlphaBlend=true
|
||||
// MT_Modifier | MT_ColorModifier
|
||||
MaterialType=9
|
||||
}
|
||||
42
kf_sources/Engine/Classes/Combiner.uc
Normal file
42
kf_sources/Engine/Classes/Combiner.uc
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
class Combiner extends Material
|
||||
editinlinenew
|
||||
native;
|
||||
|
||||
enum EColorOperation
|
||||
{
|
||||
CO_Use_Color_From_Material1,
|
||||
CO_Use_Color_From_Material2,
|
||||
CO_Multiply,
|
||||
CO_Add,
|
||||
CO_Subtract,
|
||||
CO_AlphaBlend_With_Mask,
|
||||
CO_Add_With_Mask_Modulation,
|
||||
CO_Use_Color_From_Mask,
|
||||
};
|
||||
|
||||
enum EAlphaOperation
|
||||
{
|
||||
AO_Use_Mask,
|
||||
AO_Multiply,
|
||||
AO_Add,
|
||||
AO_Use_Alpha_From_Material1,
|
||||
AO_Use_Alpha_From_Material2,
|
||||
};
|
||||
|
||||
var int combiner_dummy; // hammer padding. --ryan.
|
||||
|
||||
var() EColorOperation CombineOperation;
|
||||
var() EAlphaOperation AlphaOperation;
|
||||
var() editinlineuse Material Material1;
|
||||
var() editinlineuse Material Material2;
|
||||
var() editinlineuse Material Mask;
|
||||
var() bool InvertMask;
|
||||
var() bool Modulate2X;
|
||||
var() bool Modulate4X;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
AlphaOperation=AO_Use_Mask;
|
||||
// MT_Combiner
|
||||
MaterialType=2
|
||||
}
|
||||
425
kf_sources/Engine/Classes/Console.uc
Normal file
425
kf_sources/Engine/Classes/Console.uc
Normal file
|
|
@ -0,0 +1,425 @@
|
|||
//=============================================================================
|
||||
// Console: handles command input and manages menus.
|
||||
// Copyright 2001 Digital Extremes - All Rights Reserved.
|
||||
// Confidential.
|
||||
class Console extends Interaction;
|
||||
|
||||
var config byte ConsoleHotKey; // The key used to bring the console up.
|
||||
|
||||
var int HistoryTop, HistoryBot, HistoryCur;
|
||||
var string TypedStr, History[16]; // Holds the current command, and the history
|
||||
var int TypedStrPos; //Current position in TypedStr
|
||||
var bool bTyping; // Turn when someone is typing on the console
|
||||
var bool bIgnoreKeys; // Ignore Key presses until a new KeyDown is received
|
||||
|
||||
var() transient bool bRunningDemo;
|
||||
var() transient bool bHoldingStart;
|
||||
var() transient bool bHoldingBack;
|
||||
|
||||
var() transient float TimeIdle; // Time since last input.
|
||||
var() transient float TimeHoldingReboot; // If start+back are held for this long it'll reboot.
|
||||
|
||||
var() globalconfig float TimePerTitle; // Time spent at title screen.
|
||||
var() globalconfig float TimePerDemo; // Time spent running in attract mode.
|
||||
var() globalconfig float TimeTooIdle; // Time allowed idle players in locked interactive demo.
|
||||
var() globalconfig float TimeBeforeReboot; // If start+back are held for this long it'll reboot.
|
||||
|
||||
var() globalconfig float TimePerSoak; // TimePerDemo while soaking.
|
||||
|
||||
var() globalconfig String DemoLevels[64];
|
||||
|
||||
var array<string> BufferedConsoleCommands; // If this is blank, perform the command at Tick
|
||||
|
||||
event Initialized()
|
||||
{
|
||||
if( IsSoaking() )
|
||||
{
|
||||
TimePerTitle = 1;
|
||||
TimePerDemo = TimePerSoak;
|
||||
}
|
||||
}
|
||||
|
||||
event ViewportInitialized()
|
||||
{
|
||||
if ( ViewportOwner.ConfiguredInternetSpeed == 0 )
|
||||
ViewportOwner.ResetConfig("ConfiguredInternetSpeed");
|
||||
|
||||
if ( ViewportOwner.ConfiguredLanSpeed == 0 )
|
||||
ViewportOwner.ResetConfig("ConfiguredLanSpeed");
|
||||
}
|
||||
|
||||
event NativeConsoleOpen()
|
||||
{
|
||||
}
|
||||
|
||||
function UnPressButtons()
|
||||
{
|
||||
local PlayerController PC;
|
||||
|
||||
if (ViewportOwner != none)
|
||||
{
|
||||
PC = ViewportOwner.Actor;
|
||||
if ( PC != None )
|
||||
PC.UnPressButtons();
|
||||
}
|
||||
}
|
||||
|
||||
exec function Type()
|
||||
{
|
||||
TypedStr="";
|
||||
TypedStrPos=0;
|
||||
TypingOpen();
|
||||
}
|
||||
|
||||
exec function Talk()
|
||||
{
|
||||
TypedStr="Say ";
|
||||
TypedStrPos=4;
|
||||
TypingOpen();
|
||||
}
|
||||
|
||||
exec function TeamTalk()
|
||||
{
|
||||
TypedStr="TeamSay ";
|
||||
TypedStrPos=8;
|
||||
TypingOpen();
|
||||
}
|
||||
|
||||
exec function ConsoleOpen();
|
||||
exec function ConsoleClose();
|
||||
exec function ConsoleToggle();
|
||||
|
||||
exec function StartRollingDemo()
|
||||
{
|
||||
local int i, tryCount;
|
||||
|
||||
return;
|
||||
|
||||
TimeIdle = 0;
|
||||
tryCount = 1024;
|
||||
|
||||
do
|
||||
{
|
||||
i = int ( FRand() * float (ArrayCount(DemoLevels)) );
|
||||
|
||||
tryCount--;
|
||||
|
||||
if (tryCount < 0)
|
||||
{
|
||||
log ("Couldn't find a random level to StartRollingDemo", 'Error');
|
||||
return;
|
||||
}
|
||||
|
||||
} until (DemoLevels[i] != "")
|
||||
|
||||
bRunningDemo = true;
|
||||
|
||||
if( InStr( DemoLevels[i], "NumBots" ) >= 0 )
|
||||
ViewportOwner.Actor.ClientTravel( DemoLevels[i] $ "?SpectatorOnly=1", TRAVEL_Absolute, false );
|
||||
else
|
||||
ViewportOwner.Actor.ClientTravel( DemoLevels[i] $ "?SpectatorOnly=1?bAutoNumBots=true", TRAVEL_Absolute, false );
|
||||
}
|
||||
|
||||
exec function StopRollingDemo()
|
||||
{
|
||||
bRunningDemo = false;
|
||||
TimeIdle = 0;
|
||||
ConsoleCommand( "DISCONNECT" );
|
||||
}
|
||||
|
||||
event NotifyLevelChange()
|
||||
{
|
||||
ConsoleClose();
|
||||
}
|
||||
|
||||
function DelayedConsoleCommand(string command)
|
||||
{
|
||||
BufferedConsoleCommands.Length = BufferedConsoleCommands.Length+1;
|
||||
BufferedConsoleCommands[BufferedConsoleCommands.Length-1] = Command;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Message - By default, the console ignores all output.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function Chat(coerce string Msg, float MsgLife, PlayerReplicationInfo PRI);
|
||||
event Message( coerce string Msg, float MsgLife);
|
||||
|
||||
event bool KeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta )
|
||||
{
|
||||
if (Action!=IST_Press)
|
||||
return false;
|
||||
|
||||
if (Key==ConsoleHotKey && Action==IST_Release)
|
||||
{
|
||||
ConsoleOpen();
|
||||
return true;
|
||||
}
|
||||
|
||||
if( Action == IST_Press )
|
||||
{
|
||||
TimeIdle = 0;
|
||||
|
||||
if( bRunningDemo && !IsSoaking() )
|
||||
{
|
||||
StopRollingDemo();
|
||||
return( true );
|
||||
}
|
||||
}
|
||||
|
||||
return( false );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
// State used while typing a command on the console.
|
||||
|
||||
function TypingOpen()
|
||||
{
|
||||
bTyping = true;
|
||||
|
||||
if( (ViewportOwner != None) && (ViewportOwner.Actor != None) )
|
||||
ViewportOwner.Actor.Typing( bTyping );
|
||||
|
||||
//TypedStr = "";
|
||||
|
||||
GotoState('Typing');
|
||||
}
|
||||
|
||||
function TypingClose()
|
||||
{
|
||||
bTyping = false;
|
||||
|
||||
if( (ViewportOwner != None) && (ViewportOwner.Actor != None) )
|
||||
ViewportOwner.Actor.Typing( bTyping );
|
||||
|
||||
TypedStr="";
|
||||
TypedStrPos=0;
|
||||
|
||||
if( GetStateName() == 'Typing' )
|
||||
GotoState( '' );
|
||||
}
|
||||
|
||||
state Typing
|
||||
{
|
||||
exec function Type()
|
||||
{
|
||||
TypedStr="";
|
||||
TypedStrPos=0;
|
||||
TypingClose();
|
||||
}
|
||||
function bool KeyType( EInputKey Key, optional string Unicode )
|
||||
{
|
||||
if (bIgnoreKeys)
|
||||
return true;
|
||||
|
||||
if( Key>=0x20 )
|
||||
{
|
||||
if( Unicode != "" )
|
||||
TypedStr = Left(TypedStr, TypedStrPos) $ Unicode $ Right(TypedStr, Len(TypedStr) - TypedStrPos);
|
||||
else
|
||||
TypedStr = Left(TypedStr, TypedStrPos) $ Chr(Key) $ Right(TypedStr, Len(TypedStr) - TypedStrPos);
|
||||
TypedStrPos++;
|
||||
return( true );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool KeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta )
|
||||
{
|
||||
local string Temp;
|
||||
|
||||
if (Action== IST_PRess)
|
||||
{
|
||||
bIgnoreKeys=false;
|
||||
}
|
||||
|
||||
if( Key==IK_Escape )
|
||||
{
|
||||
if( TypedStr!="" )
|
||||
{
|
||||
TypedStr="";
|
||||
TypedStrPos=0;
|
||||
HistoryCur = HistoryTop;
|
||||
return( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
TypingClose();
|
||||
return( true );
|
||||
}
|
||||
}
|
||||
else if( Action != IST_Press )
|
||||
{
|
||||
return( false );
|
||||
}
|
||||
else if( Key==IK_Enter )
|
||||
{
|
||||
if( TypedStr!="" )
|
||||
{
|
||||
History[HistoryTop] = TypedStr;
|
||||
HistoryTop = (HistoryTop+1) % ArrayCount(History);
|
||||
|
||||
if ( ( HistoryBot == -1) || ( HistoryBot == HistoryTop ) )
|
||||
HistoryBot = (HistoryBot+1) % ArrayCount(History);
|
||||
|
||||
HistoryCur = HistoryTop;
|
||||
|
||||
// Make a local copy of the string.
|
||||
Temp=TypedStr;
|
||||
TypedStr="";
|
||||
TypedStrPos=0;
|
||||
|
||||
if( !ConsoleCommand( Temp ) )
|
||||
Message( Localize("Errors","Exec","Core"), 6.0 );
|
||||
|
||||
Message( "", 6.0 );
|
||||
}
|
||||
|
||||
TypingClose();
|
||||
|
||||
return( true );
|
||||
}
|
||||
else if( Key==IK_Up )
|
||||
{
|
||||
if ( HistoryBot >= 0 )
|
||||
{
|
||||
if (HistoryCur == HistoryBot)
|
||||
HistoryCur = HistoryTop;
|
||||
else
|
||||
{
|
||||
HistoryCur--;
|
||||
if (HistoryCur<0)
|
||||
HistoryCur = ArrayCount(History)-1;
|
||||
}
|
||||
|
||||
TypedStr = History[HistoryCur];
|
||||
TypedStrPos = Len(TypedStr);
|
||||
}
|
||||
return( true );
|
||||
}
|
||||
else if( Key==IK_Down )
|
||||
{
|
||||
if ( HistoryBot >= 0 )
|
||||
{
|
||||
if (HistoryCur == HistoryTop)
|
||||
HistoryCur = HistoryBot;
|
||||
else
|
||||
HistoryCur = (HistoryCur+1) % ArrayCount(History);
|
||||
|
||||
TypedStr = History[HistoryCur];
|
||||
TypedStrPos = Len(TypedStr);
|
||||
}
|
||||
|
||||
}
|
||||
else if( Key==IK_Backspace )
|
||||
{
|
||||
if( TypedStrPos > 0 )
|
||||
{
|
||||
TypedStr = Left(TypedStr,TypedStrPos-1)$Right(TypedStr, Len(TypedStr) - TypedStrPos);
|
||||
TypedStrPos--;
|
||||
}
|
||||
return( true );
|
||||
}
|
||||
else if ( Key==IK_Delete )
|
||||
{
|
||||
if ( TypedStrPos < Len(TypedStr) )
|
||||
TypedStr = Left(TypedStr,TypedStrPos)$Right(TypedStr, Len(TypedStr) - TypedStrPos - 1);
|
||||
return true;
|
||||
}
|
||||
else if ( Key==IK_Left )
|
||||
{
|
||||
TypedStrPos = Max(0, TypedStrPos - 1);
|
||||
return true;
|
||||
}
|
||||
else if ( Key==IK_Right )
|
||||
{
|
||||
TypedStrPos = Min(Len(TypedStr), TypedStrPos + 1);
|
||||
return true;
|
||||
}
|
||||
else if ( Key==IK_Home )
|
||||
{
|
||||
TypedStrPos = 0;
|
||||
return true;
|
||||
}
|
||||
else if ( Key==IK_End )
|
||||
{
|
||||
TypedStrPos = Len(TypedStr);
|
||||
return true;
|
||||
}
|
||||
return( true );
|
||||
}
|
||||
|
||||
function BeginState()
|
||||
{
|
||||
bTyping = true;
|
||||
bVisible= true;
|
||||
bIgnoreKeys = true;
|
||||
HistoryCur = HistoryTop;
|
||||
}
|
||||
function EndState()
|
||||
{
|
||||
ConsoleCommand("toggleime 0");
|
||||
bTyping = false;
|
||||
bVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
simulated event Tick( float Delta )
|
||||
{
|
||||
|
||||
while (BufferedConsoleCommands.Length>0)
|
||||
{
|
||||
ViewportOwner.Actor.ConsoleCommand(BufferedConsoleCommands[0]);
|
||||
BufferedConsoleCommands.Remove(0,1);
|
||||
}
|
||||
|
||||
/*
|
||||
if( bRunningDemo )
|
||||
{
|
||||
if( (TimePerDemo > 0.0) && (TimeIdle > TimePerDemo) && (curMenu == None) )
|
||||
StopRollingDemo();
|
||||
}
|
||||
else if
|
||||
(
|
||||
(ViewportOwner.Actor.Level == ViewportOwner.Actor.GetEntryLevel()) &&
|
||||
(curMenu != None) && (curMenu.IsA('MenuMain')) &&
|
||||
(ViewportOwner.Actor.Level.LevelAction == LEVACT_None) &&
|
||||
(ViewportOwner.Actor.Level.Pauser == None)
|
||||
)
|
||||
{
|
||||
if ( (TimePerTitle > 0.0) && (TimeIdle > TimePerTitle) )
|
||||
StartRollingDemo();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
event ConnectFailure(string FailCode,string URL);
|
||||
|
||||
function SetMusic(string NewSong);
|
||||
|
||||
function string SetInitialMusic(string NewSong)
|
||||
{
|
||||
return NewSong;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bActive=True
|
||||
bVisible=False
|
||||
bRequiresTick=True
|
||||
HistoryBot=-1
|
||||
|
||||
TimeIdle=0.0
|
||||
TimeHoldingReboot=0.0
|
||||
|
||||
bRunningDemo=false
|
||||
bHoldingStart=false
|
||||
bHoldingBack=false
|
||||
|
||||
TimeBeforeReboot=5.0
|
||||
|
||||
TimePerTitle=0.0
|
||||
TimePerDemo=300.0
|
||||
TimeTooIdle=60.0
|
||||
}
|
||||
13
kf_sources/Engine/Classes/ConstantColor.uc
Normal file
13
kf_sources/Engine/Classes/ConstantColor.uc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class ConstantColor extends ConstantMaterial
|
||||
native
|
||||
editinlinenew;
|
||||
|
||||
cpptext
|
||||
{
|
||||
//
|
||||
// UConstantMaterial interface
|
||||
//
|
||||
virtual FColor GetColor(FLOAT TimeSeconds) { return Color; }
|
||||
}
|
||||
|
||||
var() Color Color;
|
||||
18
kf_sources/Engine/Classes/ConstantMaterial.uc
Normal file
18
kf_sources/Engine/Classes/ConstantMaterial.uc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class ConstantMaterial extends RenderedMaterial
|
||||
editinlinenew
|
||||
abstract
|
||||
native;
|
||||
|
||||
cpptext
|
||||
{
|
||||
//
|
||||
// UConstantMaterial interface
|
||||
//
|
||||
virtual FColor GetColor(FLOAT TimeSeconds) { return FColor(0,0,0,0); }
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
// MT_ConstantMaterial
|
||||
MaterialType=1024
|
||||
}
|
||||
1101
kf_sources/Engine/Classes/Controller.uc
Normal file
1101
kf_sources/Engine/Classes/Controller.uc
Normal file
File diff suppressed because it is too large
Load diff
25
kf_sources/Engine/Classes/CrosshairPack.uc
Normal file
25
kf_sources/Engine/Classes/CrosshairPack.uc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//==============================================================================
|
||||
// Meta class for custom crosshair texture packs
|
||||
// In order for your custom crosshair texture packages to appear in the game, you must
|
||||
// export the crosshairs to cache files, using the 'exportcache' commandlet.
|
||||
//
|
||||
// For details on using the 'exportcache' commandlet, see Engine.Mutator or type
|
||||
// 'ucc help exportcache' at the command prompt.
|
||||
//
|
||||
// Created by Ron Prestenback
|
||||
// © 2003, Epic Games, Inc. All Rights Reserved
|
||||
//==============================================================================
|
||||
class CrosshairPack extends Object
|
||||
native
|
||||
abstract
|
||||
notplaceable
|
||||
CacheExempt;
|
||||
|
||||
struct native CrosshairItem
|
||||
{
|
||||
var() localized string FriendlyName; // Name of crosshair, as it will appear in drop-down list
|
||||
var() texture CrosshairTexture;
|
||||
};
|
||||
|
||||
var() const protected cache array<CrosshairItem> Crosshair;
|
||||
|
||||
14
kf_sources/Engine/Classes/Crushed.uc
Normal file
14
kf_sources/Engine/Classes/Crushed.uc
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class Crushed extends DamageType
|
||||
abstract;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DeathString="%o was crushed by %k."
|
||||
MaleSuicide="%o was crushed."
|
||||
FemaleSuicide="%o was crushed."
|
||||
|
||||
bAlwaysGibs=true
|
||||
GibPerterbation=1.0
|
||||
bLocationalHit=false
|
||||
bArmorStops=false
|
||||
}
|
||||
8
kf_sources/Engine/Classes/Cubemap.uc
Normal file
8
kf_sources/Engine/Classes/Cubemap.uc
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
class Cubemap extends Texture
|
||||
native
|
||||
noexport;
|
||||
|
||||
var() Texture Faces[6];
|
||||
|
||||
|
||||
var transient pointer CubemapRenderInterface;
|
||||
32
kf_sources/Engine/Classes/CustomSoundNotify.uc
Normal file
32
kf_sources/Engine/Classes/CustomSoundNotify.uc
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//===================================================================
|
||||
// CustomSoundNotify
|
||||
// Copyright (C) 2005 Tripwire Interactive LLC
|
||||
// John "Ramm-Jaeger" Gibson
|
||||
//
|
||||
// Custom sound notify class. Had to add this because the
|
||||
// stock UT ones don't play correctly when your standing on BSP
|
||||
//===================================================================
|
||||
|
||||
class CustomSoundNotify extends AnimNotify
|
||||
native
|
||||
abstract;
|
||||
|
||||
var() sound Sound;
|
||||
var() float Volume;
|
||||
var() int Radius;
|
||||
var() bool bAttenuate;
|
||||
|
||||
event Notify( Actor Owner );
|
||||
|
||||
cpptext
|
||||
{
|
||||
// AnimNotify interface.
|
||||
virtual void Notify( UMeshInstance *Instance, AActor *Owner );
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Radius=0
|
||||
Volume=1.0
|
||||
bAttenuate=false
|
||||
}
|
||||
17
kf_sources/Engine/Classes/DamRanOver.uc
Normal file
17
kf_sources/Engine/Classes/DamRanOver.uc
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class DamRanOver extends DamageType
|
||||
abstract;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DeathString="%k ran over %o"
|
||||
MaleSuicide="%o ran over himself"
|
||||
FemaleSuicide="%o ran over herself"
|
||||
|
||||
GibPerterbation=0.5
|
||||
GibModifier=2.0
|
||||
bLocationalHit=false
|
||||
bNeverSevers=true
|
||||
bKUseTearOffMomentum=true
|
||||
bExtraMomentumZ=false
|
||||
bVehicleHit=true
|
||||
}
|
||||
15
kf_sources/Engine/Classes/DamTypeTelefragged.uc
Normal file
15
kf_sources/Engine/Classes/DamTypeTelefragged.uc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
class DamTypeTelefragged extends DamageType
|
||||
abstract;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DeathString="%o was telefragged by %k"
|
||||
MaleSuicide="%o was telefragged by %k"
|
||||
FemaleSuicide="%o was telefragged by %k"
|
||||
|
||||
bAlwaysSevers=true
|
||||
bAlwaysGibs=true
|
||||
GibPerterbation=1.0
|
||||
bLocationalHit=false
|
||||
bArmorStops=false
|
||||
}
|
||||
213
kf_sources/Engine/Classes/DamageType.uc
Normal file
213
kf_sources/Engine/Classes/DamageType.uc
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
//=============================================================================
|
||||
// DamageType, the base class of all damagetypes.
|
||||
// this and its subclasses are never spawned, just used as information holders
|
||||
//=============================================================================
|
||||
class DamageType extends Actor
|
||||
native
|
||||
abstract;
|
||||
|
||||
// Description of a type of damage.
|
||||
var() localized string DeathString; // string to describe death by this type of damage
|
||||
var() localized string FemaleSuicide, MaleSuicide;
|
||||
var() float ViewFlash; // View flash to play.
|
||||
var() vector ViewFog; // View fog to play.
|
||||
var() class<effects> DamageEffect; // Special effect.
|
||||
var() string DamageWeaponName; // weapon that caused this damage
|
||||
var() bool bArmorStops; // does regular armor provide protection against this damage
|
||||
var() bool bInstantHit; // done by trace hit weapon
|
||||
var() bool bFastInstantHit; // done by fast repeating trace hit weapon
|
||||
var() bool bAlwaysGibs;
|
||||
var() bool bLocationalHit;
|
||||
var() bool bAlwaysSevers;
|
||||
var() bool bSpecial;
|
||||
var() bool bDetonatesGoop;
|
||||
var() bool bSkeletize; // swap model to skeleton
|
||||
var() bool bCauseConvulsions;
|
||||
var() bool bSuperWeapon; // if true, also damages teammates even if no friendlyfire
|
||||
var() bool bCausesBlood;
|
||||
var() bool bKUseOwnDeathVel; // For ragdoll death. Rather than using default - use death velocity specified in this damage type.
|
||||
var() bool bKUseTearOffMomentum; // For ragdoll death. Add entirety of killing hit's momentum to ragdoll's initial velocity.
|
||||
var bool bDelayedDamage; // for delayed damage damagetypes that set Pawn's DelayedDamageInstigatorController
|
||||
var bool bNeverSevers;
|
||||
var bool bThrowRagdoll;
|
||||
var bool bRagdollBullet;
|
||||
var bool bLeaveBodyEffect;
|
||||
var bool bExtraMomentumZ; // Add extra Z to momentum on walking pawns
|
||||
var bool bFlaming;
|
||||
var bool bRubbery;
|
||||
var bool bCausedByWorld; //this damage was caused by the world (falling off level, into lava, etc)
|
||||
var bool bDirectDamage;
|
||||
var bool bBulletHit;
|
||||
var bool bVehicleHit; // caused by vehicle running over you
|
||||
|
||||
var() float GibModifier;
|
||||
|
||||
// these effects should be none if should use the pawn's blood effects
|
||||
var() class<Effects> PawnDamageEffect; // effect to spawn when pawns are damaged by this damagetype
|
||||
var() class<Emitter> PawnDamageEmitter; // effect to spawn when pawns are damaged by this damagetype
|
||||
var() array<Sound> PawnDamageSounds; // Sound Effect to Play when Damage occurs
|
||||
|
||||
var() class<Effects> LowGoreDamageEffect; // effect to spawn when low gore
|
||||
var() class<Emitter> LowGoreDamageEmitter; // Emitter to use when it's low gore
|
||||
var() array<Sound> LowGoreDamageSounds; // Sound Effects to play with Damage occurs with low gore
|
||||
|
||||
var() class<Effects> LowDetailEffect; // Low Detail effect
|
||||
var() class<Emitter> LowDetailEmitter; // Low Detail emitter
|
||||
|
||||
var() float FlashScale; //for flashing victim's screen
|
||||
var() vector FlashFog;
|
||||
|
||||
var() int DamageDesc; // Describes the damage
|
||||
var() int DamageThreshold; // How much damage much occur before playing effects
|
||||
var() vector DamageKick;
|
||||
var() Material DamageOverlayMaterial; // for changing player's shader when hit
|
||||
var() Material DeathOverlayMaterial; // for changing player's shader when hit
|
||||
var() float DamageOverlayTime; // timing for this
|
||||
var() float DeathOverlayTime; // timing for this
|
||||
|
||||
var() float GibPerterbation; // When gibbing, the chunks will fly off in random directions.
|
||||
|
||||
var(Karma) float KDamageImpulse; // magnitude of impulse applied to KActor due to this damage type.
|
||||
var(Karma) float KDeathVel; // How fast ragdoll moves upon death
|
||||
var(Karma) float KDeathUpKick; // Amount of upwards kick ragdolls get when they die
|
||||
|
||||
// if _RO_
|
||||
// These are needed for the karma on already dead bodies since it has to be handled differently than initial dead karma
|
||||
var(Karma) float KDeadLinZVelScale; // Scaling factor for the Linear Z axis velocity for effecting dead players.
|
||||
var(Karma) float KDeadLinVelScale; // Scaling factor for the Linear velocity for effecting dead players.
|
||||
var(Karma) float KDeadAngVelScale; // Scaling factor for the Angular velocity for effecting dead players.
|
||||
// end _RO_
|
||||
|
||||
var float VehicleDamageScaling; // multiply damage by this for vehicles
|
||||
var float VehicleMomentumScaling;
|
||||
|
||||
// if _RO_
|
||||
var() int HumanObliterationThreshhold; // if the damage is above this amount, it will obliterate a human
|
||||
|
||||
static function IncrementKills(Controller Killer);
|
||||
|
||||
static function ScoreKill(Controller Killer, Controller Killed)
|
||||
{
|
||||
IncrementKills(Killer);
|
||||
}
|
||||
|
||||
static function string DeathMessage(PlayerReplicationInfo Killer, PlayerReplicationInfo Victim)
|
||||
{
|
||||
return Default.DeathString;
|
||||
}
|
||||
|
||||
static function string SuicideMessage(PlayerReplicationInfo Victim)
|
||||
{
|
||||
if ( Victim.bIsFemale )
|
||||
return Default.FemaleSuicide;
|
||||
else
|
||||
return Default.MaleSuicide;
|
||||
}
|
||||
|
||||
static function class<Effects> GetPawnDamageEffect( vector HitLocation, float Damage, vector Momentum, Pawn Victim, bool bLowDetail )
|
||||
{
|
||||
if ( class'GameInfo'.static.UseLowGore() )
|
||||
{
|
||||
if ( Default.LowGoreDamageEffect != None )
|
||||
return Default.LowGoreDamageEffect;
|
||||
else
|
||||
return Victim.LowGoreBlood;
|
||||
}
|
||||
else if ( bLowDetail )
|
||||
{
|
||||
if ( Default.LowDetailEffect != None )
|
||||
return Default.LowDetailEffect;
|
||||
else
|
||||
return Victim.BloodEffect;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Default.PawnDamageEffect != None )
|
||||
return Default.PawnDamageEffect;
|
||||
else
|
||||
return Victim.BloodEffect;
|
||||
}
|
||||
}
|
||||
|
||||
static function class<Emitter> GetPawnDamageEmitter( vector HitLocation, float Damage, vector Momentum, Pawn Victim, bool bLowDetail )
|
||||
{
|
||||
if ( class'GameInfo'.static.NoBlood() ) //UseLowGore()
|
||||
{
|
||||
if ( Default.LowGoreDamageEmitter != None )
|
||||
return Default.LowGoreDamageEmitter;
|
||||
else
|
||||
return none;
|
||||
}
|
||||
else if ( bLowDetail )
|
||||
{
|
||||
|
||||
if ( Default.LowDetailEmitter != None )
|
||||
return Default.LowDetailEmitter;
|
||||
else
|
||||
return none;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Default.PawnDamageEmitter != None )
|
||||
return Default.PawnDamageEmitter;
|
||||
else
|
||||
return none;
|
||||
}
|
||||
}
|
||||
|
||||
static function Sound GetPawnDamageSound()
|
||||
{
|
||||
if ( class'GameInfo'.static.UseLowGore() )
|
||||
{
|
||||
if (Default.LowGoreDamageSounds.Length>0)
|
||||
return Default.LowGoreDamageSounds[Rand(Default.LowGoreDamageSounds.Length)];
|
||||
else
|
||||
return none;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Default.PawnDamageSounds.Length>0)
|
||||
return Default.PawnDamageSounds[Rand(Default.PawnDamageSounds.Length)];
|
||||
else
|
||||
return none;
|
||||
}
|
||||
}
|
||||
|
||||
static function bool IsOfType(int Description)
|
||||
{
|
||||
local int result;
|
||||
|
||||
result = Description & Default.DamageDesc;
|
||||
return (result == Description);
|
||||
}
|
||||
|
||||
static function GetHitEffects( out class<xEmitter> HitEffects[4], int VictemHealth );
|
||||
|
||||
static function string GetWeaponClass()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DeathString="%o was killed by %k."
|
||||
FemaleSuicide="%o killed herself."
|
||||
MaleSuicide="%o killed himself."
|
||||
bArmorStops=true
|
||||
GibModifier=+1.0
|
||||
FlashScale=0.3
|
||||
FlashFog=(X=900.00000,Y=0.000000,Z=0.00000)
|
||||
DamageDesc=1
|
||||
DamageThreshold=0
|
||||
GibPerterbation=0.06
|
||||
bLocationalHit=true
|
||||
bCausesBlood=true
|
||||
KDamageImpulse=8000
|
||||
VehicleDamageScaling=+1.0
|
||||
VehicleMomentumScaling=+1.0
|
||||
bExtraMomentumZ=true
|
||||
DeathOverlayTime=+6.0
|
||||
|
||||
// _RO_
|
||||
HumanObliterationThreshhold=1000000
|
||||
}
|
||||
3
kf_sources/Engine/Classes/Decal.uc
Normal file
3
kf_sources/Engine/Classes/Decal.uc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class Decal extends Actor;
|
||||
|
||||
// DEPRECATED
|
||||
19
kf_sources/Engine/Classes/DecoVolumeObject.uc
Normal file
19
kf_sources/Engine/Classes/DecoVolumeObject.uc
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//=============================================================================
|
||||
// DecoVolumeObject.
|
||||
//
|
||||
// A class that allows staticmesh actors to get spawned inside of
|
||||
// deco volumes. These are the actors that you actually see in the level.
|
||||
//=============================================================================
|
||||
class DecoVolumeObject extends Actor
|
||||
native;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bStatic=False
|
||||
DrawType=DT_StaticMesh
|
||||
bWorldGeometry=false
|
||||
bCollideActors=false
|
||||
bBlockActors=false
|
||||
CollisionRadius=0
|
||||
CollisionHeight=0
|
||||
}
|
||||
225
kf_sources/Engine/Classes/Decoration.uc
Normal file
225
kf_sources/Engine/Classes/Decoration.uc
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
//=============================================================================
|
||||
// Decoration.
|
||||
//=============================================================================
|
||||
class Decoration extends Actor
|
||||
abstract
|
||||
placeable
|
||||
native;
|
||||
|
||||
// If set, the pyrotechnic or explosion when item is damaged.
|
||||
var() class<actor> EffectWhenDestroyed;
|
||||
var() bool bPushable;
|
||||
var() bool bDamageable;
|
||||
var bool bPushSoundPlaying;
|
||||
var bool bSplash;
|
||||
|
||||
var() sound PushSound, EndPushSound;
|
||||
var const int numLandings; // Used by engine physics.
|
||||
var() class<inventory> contents; // spawned when destroyed
|
||||
|
||||
var() int NumFrags; // number of fragments to spawn when destroyed
|
||||
var() texture FragSkin; // skin to use for fragments
|
||||
var() class<Fragment> FragType; // type of fragment to use
|
||||
var vector FragMomentum; // momentum to be imparted to frags when destroyed
|
||||
var() int Health;
|
||||
var() float SplashTime;
|
||||
|
||||
var const NavigationPoint LastAnchor; // recent nearest path
|
||||
var float LastValidAnchorTime; // last time a valid anchor was found
|
||||
|
||||
event NotReachableBy(Pawn P); // called when FindPathToward this decoration fails (used by GameObjects)
|
||||
|
||||
function bool CanSplash()
|
||||
{
|
||||
if ( (Level.TimeSeconds - SplashTime > 0.25)
|
||||
&& (Physics == PHYS_Falling)
|
||||
&& (Abs(Velocity.Z) > 100) )
|
||||
{
|
||||
SplashTime = Level.TimeSeconds;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function Drop(vector newVel);
|
||||
|
||||
function Landed(vector HitNormal)
|
||||
{
|
||||
local rotator NewRot;
|
||||
|
||||
if (Velocity.Z<-500)
|
||||
TakeDamage(100,Pawn(Owner),HitNormal,HitNormal*10000,class'Crushed');
|
||||
Velocity = vect(0,0,0);
|
||||
NewRot = Rotation;
|
||||
NewRot.Pitch = 0;
|
||||
NewRot.Roll = 0;
|
||||
SetRotation(NewRot);
|
||||
}
|
||||
|
||||
function HitWall (vector HitNormal, actor Wall)
|
||||
{
|
||||
Landed(HitNormal);
|
||||
}
|
||||
|
||||
function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation,
|
||||
Vector momentum, class<DamageType> damageType, optional int HitIndex)
|
||||
{
|
||||
Instigator = InstigatedBy;
|
||||
if (!bDamageable || (Health<0) )
|
||||
Return;
|
||||
if ( Instigator != None )
|
||||
MakeNoise(1.0);
|
||||
Health -= NDamage;
|
||||
FragMomentum = Momentum;
|
||||
if (Health <0)
|
||||
Destroy();
|
||||
else
|
||||
{
|
||||
SetPhysics(PHYS_Falling);
|
||||
Momentum.Z = 1000;
|
||||
Velocity=Momentum/Mass;
|
||||
}
|
||||
}
|
||||
|
||||
singular function PhysicsVolumeChange( PhysicsVolume NewVolume )
|
||||
{
|
||||
if( NewVolume.bWaterVolume )
|
||||
{
|
||||
if( bSplash && !PhysicsVolume.bWaterVolume && Mass<=Buoyancy
|
||||
&& ((Abs(Velocity.Z) < 100) || (Mass == 0)) && (FRand() < 0.05) && !PlayerCanSeeMe() )
|
||||
{
|
||||
bSplash = false;
|
||||
SetPhysics(PHYS_None);
|
||||
}
|
||||
}
|
||||
if( PhysicsVolume.bWaterVolume && (Buoyancy > Mass) )
|
||||
{
|
||||
if( Buoyancy > 1.1 * Mass )
|
||||
Buoyancy = 0.95 * Buoyancy; // waterlog
|
||||
else if( Buoyancy > 1.03 * Mass )
|
||||
Buoyancy = 0.99 * Buoyancy;
|
||||
}
|
||||
}
|
||||
|
||||
function Trigger( actor Other, pawn EventInstigator )
|
||||
{
|
||||
Instigator = EventInstigator;
|
||||
TakeDamage( 1000, Instigator, Location, Vect(0,0,1)*900, class'Crushed');
|
||||
}
|
||||
|
||||
singular function BaseChange()
|
||||
{
|
||||
if( Velocity.Z < -500 )
|
||||
TakeDamage( (1-Velocity.Z/30),Instigator,Location,vect(0,0,0) , class'Crushed');
|
||||
|
||||
if( base == None )
|
||||
{
|
||||
if ( !bInterpolating && bPushable && (Physics == PHYS_None) )
|
||||
SetPhysics(PHYS_Falling);
|
||||
}
|
||||
else if( Pawn(Base) != None )
|
||||
{
|
||||
Base.TakeDamage( (1-Velocity.Z/400)* mass/Base.Mass,Instigator,Location,0.5 * Velocity , class'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 )
|
||||
{
|
||||
Base.TakeDamage((1 - Mass/Base.Mass * Velocity.Z/30), Instigator, Location, 0.2 * Velocity, class'Crushed');
|
||||
Velocity.Z = 100;
|
||||
if (FRand() < 0.5)
|
||||
Velocity.X += 70;
|
||||
else
|
||||
Velocity.Y += 70;
|
||||
SetPhysics(PHYS_Falling);
|
||||
}
|
||||
else
|
||||
instigator = None;
|
||||
}
|
||||
|
||||
simulated function Destroyed()
|
||||
{
|
||||
local inventory dropped;
|
||||
local int i;
|
||||
local Fragment s;
|
||||
local float BaseSize;
|
||||
|
||||
if ( Role == ROLE_Authority )
|
||||
{
|
||||
if( (Contents!=None) && !Level.bStartup )
|
||||
{
|
||||
dropped = Spawn(Contents);
|
||||
dropped.DropFrom(Location);
|
||||
}
|
||||
|
||||
TriggerEvent( Event, Self, None);
|
||||
|
||||
if ( bPushSoundPlaying )
|
||||
PlaySound(EndPushSound, SLOT_Misc);
|
||||
}
|
||||
|
||||
if ( (Level.NetMode != NM_DedicatedServer )
|
||||
&& !PhysicsVolume.bDestructive
|
||||
&& (NumFrags > 0) && (FragType != None) )
|
||||
{
|
||||
// spawn fragments
|
||||
BaseSize = 0.8 * sqrt(CollisionRadius*CollisionHeight)/NumFrags;
|
||||
for ( i=0; i<numfrags; i++ )
|
||||
{
|
||||
s = Spawn( FragType, Owner,,Location + CollisionRadius * VRand());
|
||||
s.CalcVelocity(FragMomentum);
|
||||
if ( FragSkin != None )
|
||||
s.Skins[0] = FragSkin;
|
||||
s.SetDrawScale(BaseSize * (0.5+0.7*FRand()));
|
||||
}
|
||||
}
|
||||
|
||||
Super.Destroyed();
|
||||
}
|
||||
|
||||
function Timer()
|
||||
{
|
||||
PlaySound(EndPushSound, SLOT_Misc);
|
||||
bPushSoundPlaying=False;
|
||||
}
|
||||
|
||||
function Bump( actor Other )
|
||||
{
|
||||
local float speed, oldZ;
|
||||
if( bPushable && (Pawn(Other)!=None) && (Other.Mass > 40) )
|
||||
{
|
||||
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);
|
||||
bPushSoundPlaying = True;
|
||||
}
|
||||
}
|
||||
else
|
||||
Velocity.Z = oldZ;
|
||||
SetPhysics(PHYS_Falling);
|
||||
SetTimer(0.3,False);
|
||||
Instigator = Pawn(Other);
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bCanBeDamaged=true
|
||||
bStatic=True
|
||||
bStasis=True
|
||||
Mass=100.000000
|
||||
DrawType=DT_Mesh
|
||||
bOrientOnSlope=true
|
||||
bShouldBaseAtStartup=true
|
||||
NetUpdateFrequency=10
|
||||
}
|
||||
27
kf_sources/Engine/Classes/DecorationList.uc
Normal file
27
kf_sources/Engine/Classes/DecorationList.uc
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
//=============================================================================
|
||||
// DecorationList: Defines a list of decorations which can be attached to volumes
|
||||
//=============================================================================
|
||||
|
||||
class DecorationList extends KeyPoint
|
||||
placeable
|
||||
native;
|
||||
|
||||
#exec Texture Import File=Textures\DecorationList.pcx Name=S_DecorationList Mips=Off MASKED=1
|
||||
|
||||
struct DecorationType
|
||||
{
|
||||
var() StaticMesh StaticMesh;
|
||||
var() range Count;
|
||||
var() range DrawScale;
|
||||
var() int bAlign;
|
||||
var() int bRandomPitch;
|
||||
var() int bRandomYaw;
|
||||
var() int bRandomRoll;
|
||||
};
|
||||
|
||||
var(List) array<DecorationType> Decorations;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Texture=S_DecorationList
|
||||
}
|
||||
19
kf_sources/Engine/Classes/DefaultPhysicsVolume.uc
Normal file
19
kf_sources/Engine/Classes/DefaultPhysicsVolume.uc
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//=============================================================================
|
||||
// DefaultPhysicsVolume: the default physics volume for areas of the level with
|
||||
// no physics volume specified
|
||||
//=============================================================================
|
||||
class DefaultPhysicsVolume extends PhysicsVolume
|
||||
native
|
||||
notplaceable;
|
||||
|
||||
function Destroyed()
|
||||
{
|
||||
log(self$" destroyed!");
|
||||
assert(false);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bStatic=false
|
||||
bNoDelete=false
|
||||
}
|
||||
129
kf_sources/Engine/Classes/Door.uc
Normal file
129
kf_sources/Engine/Classes/Door.uc
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
/*=============================================================================
|
||||
Door.
|
||||
Used to mark a door on the Navigation network (a door is a mover that may act
|
||||
as an obstruction).
|
||||
=============================================================================
|
||||
*/
|
||||
class Door extends NavigationPoint
|
||||
placeable
|
||||
native;
|
||||
|
||||
#exec Texture Import File=Textures\Door.pcx Name=S_Door Mips=Off MASKED=1
|
||||
|
||||
var() name DoorTag; // tag of mover associated with this node
|
||||
var mover MyDoor;
|
||||
var() name DoorTrigger; // recommended trigger to use (if door is triggerable)
|
||||
var actor RecommendedTrigger;
|
||||
var() bool bInitiallyClosed; // if true, means that the initial position of the mover blocks navigation
|
||||
var() bool bBlockedWhenClosed; // don't even try to go through this path if door is closed
|
||||
var bool bDoorOpen;
|
||||
var bool bTempNoCollide; // used during path building
|
||||
|
||||
function PostBeginPlay()
|
||||
{
|
||||
local vector Dist;
|
||||
|
||||
if ( DoorTrigger != '' )
|
||||
{
|
||||
ForEach AllActors(class'Actor', RecommendedTrigger, DoorTrigger )
|
||||
break;
|
||||
// ignore recommended trigger if door is within its radius
|
||||
// (DoorTrigger shouldn't have been set)
|
||||
if ( RecommendedTrigger != None )
|
||||
{
|
||||
Dist = Location - RecommendedTrigger.Location;
|
||||
if ( abs(Dist.Z) < RecommendedTrigger.CollisionHeight )
|
||||
{
|
||||
Dist.Z = 0;
|
||||
if ( VSize(Dist) < RecommendedTrigger.CollisionRadius )
|
||||
RecommendedTrigger = None;
|
||||
}
|
||||
}
|
||||
}
|
||||
bBlocked = ( bInitiallyClosed && bBlockedWhenClosed );
|
||||
bDoorOpen = !bInitiallyClosed;
|
||||
Super.PostBeginPlay();
|
||||
}
|
||||
|
||||
function MoverOpened()
|
||||
{
|
||||
bBlocked = ( !bInitiallyClosed && bBlockedWhenClosed );
|
||||
bDoorOpen = bInitiallyClosed;
|
||||
}
|
||||
|
||||
function MoverClosed()
|
||||
{
|
||||
bBlocked = ( bInitiallyClosed && bBlockedWhenClosed );
|
||||
bDoorOpen = !bInitiallyClosed;
|
||||
}
|
||||
|
||||
/* SpecialHandling is called by the navigation code when the next path has been found.
|
||||
It gives that path an opportunity to modify the result based on any special considerations
|
||||
*/
|
||||
|
||||
function Actor SpecialHandling(Pawn Other)
|
||||
{
|
||||
if ( MyDoor == None )
|
||||
return self;
|
||||
|
||||
if ( MyDoor.BumpType == BT_PlayerBump && !Other.IsPlayerPawn() )
|
||||
return None;
|
||||
|
||||
if ( bInitiallyClosed == (bDoorOpen || MyDoor.bOpening || MyDoor.bDelaying) )
|
||||
return self;
|
||||
|
||||
if ( RecommendedTrigger != None )
|
||||
{
|
||||
if ( Trigger(RecommendedTrigger) != None )
|
||||
return RecommendedTrigger.SpecialHandling(Other);
|
||||
return RecommendedTrigger;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
function bool ProceedWithMove(Pawn Other)
|
||||
{
|
||||
if ( MyDoor.bDamageTriggered && (Other.Controller.Focus == MyDoor) )
|
||||
Other.Controller.StopFiring();
|
||||
|
||||
if ( bDoorOpen || !MyDoor.bDamageTriggered )
|
||||
return true;
|
||||
|
||||
// door still needs to be shot
|
||||
Other.ShootSpecial(MyDoor);
|
||||
MyDoor.Trigger(Other,Other);
|
||||
Other.Controller.WaitForMover(MyDoor);
|
||||
return false;
|
||||
}
|
||||
|
||||
event bool SuggestMovePreparation(Pawn Other)
|
||||
{
|
||||
if ( bDoorOpen )
|
||||
return false;
|
||||
if ( MyDoor.bOpening || MyDoor.bDelaying )
|
||||
{
|
||||
Other.Controller.WaitForMover(MyDoor);
|
||||
return true;
|
||||
}
|
||||
if ( MyDoor.bDamageTriggered )
|
||||
{
|
||||
// handle shootable doors
|
||||
Other.ShootSpecial(MyDoor);
|
||||
MyDoor.Trigger(Other,Other);
|
||||
Other.Controller.WaitForMover(MyDoor);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Texture=S_Door
|
||||
RemoteRole=ROLE_None
|
||||
bNoDelete=true
|
||||
ExtraCost=100
|
||||
bInitiallyClosed=true
|
||||
bSpecialMove=true
|
||||
}
|
||||
13
kf_sources/Engine/Classes/DynamicProjector.uc
Normal file
13
kf_sources/Engine/Classes/DynamicProjector.uc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class DynamicProjector extends Projector;
|
||||
|
||||
function Tick(float DeltaTime)
|
||||
{
|
||||
DetachProjector();
|
||||
AttachProjector();
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bStatic=False
|
||||
bDynamicAttach=True
|
||||
}
|
||||
28
kf_sources/Engine/Classes/EFFECT_WaterVolume.uc
Normal file
28
kf_sources/Engine/Classes/EFFECT_WaterVolume.uc
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
//=============================================================================
|
||||
// EFFECT_WaterVolume
|
||||
//=============================================================================
|
||||
|
||||
class EFFECT_WaterVolume extends I3DL2Listener
|
||||
editinlinenew;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
EnvironmentSize=1.8;
|
||||
EnvironmentDiffusion=1.0;
|
||||
Room=-1000;
|
||||
RoomHF=-4000;
|
||||
DecayTime=1.49;
|
||||
DecayHFRatio=0.1;
|
||||
Reflections=-449;
|
||||
ReflectionsDelay=0.007;
|
||||
Reverb=1700;
|
||||
ReverbDelay=0.011;
|
||||
RoomRolloffFactor=0.0;
|
||||
AirAbsorptionHF=-5;
|
||||
bDecayTimeScale=true;
|
||||
bReflectionsScale=true;
|
||||
bReflectionsDelayScale=true;
|
||||
bReverbScale=true;
|
||||
bReverbDelayScale=true;
|
||||
bDecayHFLimit=true;
|
||||
}
|
||||
18
kf_sources/Engine/Classes/Effects.uc
Normal file
18
kf_sources/Engine/Classes/Effects.uc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//=============================================================================
|
||||
// Effects, the base class of all gratuitous special effects.
|
||||
//
|
||||
//=============================================================================
|
||||
class Effects extends Actor;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DrawType=DT_Sprite
|
||||
Physics=PHYS_None
|
||||
bUnlit=True
|
||||
bNetTemporary=true
|
||||
bGameRelevant=true
|
||||
CollisionRadius=+0.00000
|
||||
CollisionHeight=+0.00000
|
||||
RemoteRole=ROLE_None
|
||||
bNetInitialRotation=true
|
||||
}
|
||||
92
kf_sources/Engine/Classes/Emitter.uc
Normal file
92
kf_sources/Engine/Classes/Emitter.uc
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
//=============================================================================
|
||||
// Emitter: An Unreal Emitter Actor.
|
||||
//=============================================================================
|
||||
class Emitter extends Actor
|
||||
native
|
||||
placeable;
|
||||
|
||||
#exec Texture Import File=Textures\S_Emitter.pcx Name=S_Emitter Mips=Off MASKED=1
|
||||
|
||||
|
||||
var() export editinline array<ParticleEmitter> Emitters;
|
||||
|
||||
var (Global) rangevector GlobalOffsetRange;
|
||||
var (Global) range TimeTillResetRange;
|
||||
var (Global) bool AutoDestroy;
|
||||
var (Global) bool AutoReset;
|
||||
var (Global) bool DisableFogging;
|
||||
|
||||
var transient vector OldLocation; // Laurent -- for ptcl location interpolation
|
||||
var transient vector GlobalOffset;
|
||||
var transient vector AbsoluteVelocity;
|
||||
var transient int Initialized;
|
||||
var transient box BoundingBox;
|
||||
var transient float EmitterRadius;
|
||||
var transient float EmitterHeight;
|
||||
var transient float TimeTillReset;
|
||||
var transient bool UseParticleProjectors;
|
||||
var transient bool DeleteParticleEmitters;
|
||||
var transient bool ActorForcesEnabled;
|
||||
var transient ParticleMaterial ParticleMaterial;
|
||||
|
||||
// shutdown the emitter and make it auto-destroy when the last active particle dies.
|
||||
native function Kill();
|
||||
|
||||
simulated function UpdatePrecacheMaterials()
|
||||
{
|
||||
local int i;
|
||||
|
||||
super.UpdatePrecacheMaterials();
|
||||
|
||||
for( i=0; i<Emitters.Length; i++ )
|
||||
{
|
||||
if( Emitters[i] != None )
|
||||
{
|
||||
if( Emitters[i].Texture != None )
|
||||
Level.AddPrecacheMaterial(Emitters[i].Texture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
simulated event Trigger( Actor Other, Pawn EventInstigator )
|
||||
{
|
||||
local int i;
|
||||
for( i=0; i<Emitters.Length; i++ )
|
||||
{
|
||||
if( Emitters[i] != None )
|
||||
Emitters[i].Trigger();
|
||||
}
|
||||
}
|
||||
|
||||
simulated event SpawnParticle( int Amount )
|
||||
{
|
||||
local int i;
|
||||
for( i=0; i<Emitters.Length; i++ )
|
||||
{
|
||||
if( Emitters[i] != None )
|
||||
Emitters[i].SpawnParticle(Amount);
|
||||
}
|
||||
}
|
||||
|
||||
simulated function Reset()
|
||||
{
|
||||
local int i;
|
||||
|
||||
for( i=0; i<Emitters.Length; i++ )
|
||||
{
|
||||
if ( Emitters[i] != None )
|
||||
Emitters[i].Reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
RemoteRole=ROLE_None
|
||||
Style=STY_Particle
|
||||
DrawType=DT_Particle
|
||||
Texture=S_Emitter
|
||||
bNoDelete=true
|
||||
bUnlit=true
|
||||
bNotOnDedServer=true
|
||||
}
|
||||
119
kf_sources/Engine/Classes/Engine.uc
Normal file
119
kf_sources/Engine/Classes/Engine.uc
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
//=============================================================================
|
||||
// Engine: The base class of the global application object classes.
|
||||
// This is a built-in Unreal class and it shouldn't be modified.
|
||||
//=============================================================================
|
||||
class Engine extends Subsystem
|
||||
native
|
||||
noexport
|
||||
transient;
|
||||
|
||||
// Variables.
|
||||
var primitive Cylinder;
|
||||
var const client Client;
|
||||
var const audiosubsystem Audio;
|
||||
var const renderdevice GRenDev;
|
||||
var const advertisingsubsystem AdClient;
|
||||
|
||||
// Stats.
|
||||
var int bShowFrameRate;
|
||||
var int bShowRenderStats;
|
||||
var int bShowHardwareStats;
|
||||
var int bShowGameStats;
|
||||
var int bShowNetStats;
|
||||
var int bShowAnimStats; // Show animation statistics.
|
||||
|
||||
// ifdef WITH_LIPSINC
|
||||
var int bShowLIPSincStats; // Show LIPSinc statistics.
|
||||
// endif
|
||||
|
||||
var int bShowHistograph;
|
||||
var int bShowXboxMemStats;
|
||||
var int bShowMatineeStats; // Show Matinee specific information
|
||||
var int bShowAudioStats;
|
||||
var int bShowLightStats; // Show dynamic lighting statistics.
|
||||
|
||||
var int TickCycles, GameCycles, ClientCycles;
|
||||
var(Settings) config int CacheSizeMegs;
|
||||
var(Settings) config bool UseSound;
|
||||
var(Settings) config bool UseStaticMeshBatching;
|
||||
var(Settings) config bool ServerReadsStdin;
|
||||
var(Settings) config bool bSlowRefChecking; // toggle object ref checking on cleanupdestroyed
|
||||
|
||||
var(Settings) float CurrentTickRate;
|
||||
var config int DetectedVideoMemory;
|
||||
|
||||
// Color preferences.
|
||||
var(Colors) config color
|
||||
C_WorldBox,
|
||||
C_GroundPlane,
|
||||
C_GroundHighlight,
|
||||
C_BrushWire,
|
||||
C_Pivot,
|
||||
C_Select,
|
||||
C_Current,
|
||||
C_AddWire,
|
||||
C_SubtractWire,
|
||||
C_GreyWire,
|
||||
C_BrushVertex,
|
||||
C_BrushSnap,
|
||||
C_Invalid,
|
||||
C_ActorWire,
|
||||
C_ActorHiWire,
|
||||
C_Black,
|
||||
C_White,
|
||||
C_Mask,
|
||||
C_SemiSolidWire,
|
||||
C_NonSolidWire,
|
||||
C_WireBackground,
|
||||
C_WireGridAxis,
|
||||
C_ActorArrow,
|
||||
C_ScaleBox,
|
||||
C_ScaleBoxHi,
|
||||
C_ZoneWire,
|
||||
C_Mover,
|
||||
C_OrthoBackground,
|
||||
C_StaticMesh,
|
||||
C_VolumeBrush,
|
||||
C_ConstraintLine,
|
||||
C_AnimMesh,
|
||||
C_TerrainWire;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
CacheSizeMegs=2
|
||||
UseSound=True
|
||||
C_WorldBox=(R=0,G=0,B=107,A=255)
|
||||
C_GroundPlane=(R=0,G=0,B=63,A=255)
|
||||
C_GroundHighlight=(R=0,G=0,B=127,A=255)
|
||||
C_BrushWire=(R=255,G=63,B=63,A=255)
|
||||
C_Pivot=(R=0,G=255,B=0,A=255)
|
||||
C_Select=(R=0,G=0,B=127,A=255)
|
||||
C_AddWire=(R=127,G=127,B=255,A=255)
|
||||
C_SubtractWire=(R=255,G=192,B=63,A=255)
|
||||
C_GreyWire=(R=163,G=163,B=163,A=255)
|
||||
C_Invalid=(R=163,G=163,B=163,A=255)
|
||||
C_ActorWire=(R=127,G=63,B=0,A=255)
|
||||
C_ActorHiWire=(R=255,G=127,B=0,A=255)
|
||||
C_White=(R=255,G=255,B=255,A=255)
|
||||
C_SemiSolidWire=(R=127,G=255,B=0,A=255)
|
||||
C_NonSolidWire=(R=63,G=192,B=32,A=255)
|
||||
C_WireGridAxis=(R=119,G=119,B=119,A=255)
|
||||
C_ActorArrow=(R=163,G=0,B=0,A=255)
|
||||
C_ScaleBox=(R=151,G=67,B=11,A=255)
|
||||
C_ScaleBoxHi=(R=223,G=149,B=157,A=255)
|
||||
C_Mover=(R=255,G=0,B=255,A=255)
|
||||
C_OrthoBackground=(R=163,G=163,B=163,A=255)
|
||||
C_Current=(R=0,G=0,B=0,A=255)
|
||||
C_BrushVertex=(R=0,G=0,B=0,A=255)
|
||||
C_BrushSnap=(R=0,G=0,B=0,A=255)
|
||||
C_Black=(R=0,G=0,B=0,A=255)
|
||||
C_Mask=(R=0,G=0,B=0,A=255)
|
||||
C_WireBackground=(R=0,G=0,B=0,A=255)
|
||||
C_ZoneWire=(R=0,G=0,B=0,A=255)
|
||||
C_StaticMesh=(R=0,G=255,B=255,A=255)
|
||||
C_VolumeBrush=(R=255,G=196,B=225,A=255)
|
||||
C_AnimMesh=(R=221,G=221,B=28,A=255)
|
||||
C_ConstraintLine=(R=0,G=255,B=0,A=255)
|
||||
C_TerrainWire=(R=255,G=255,B=255,A=255)
|
||||
UseStaticMeshBatching=True
|
||||
}
|
||||
4
kf_sources/Engine/Classes/Engine.upkg
Normal file
4
kf_sources/Engine/Classes/Engine.upkg
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[Flags]
|
||||
AllowDownload=False
|
||||
ClientOptional=False
|
||||
ServerSideOnly=False
|
||||
28
kf_sources/Engine/Classes/FadeColor.uc
Normal file
28
kf_sources/Engine/Classes/FadeColor.uc
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
class FadeColor extends ConstantMaterial
|
||||
native
|
||||
editinlinenew;
|
||||
|
||||
cpptext
|
||||
{
|
||||
//
|
||||
// UConstantMaterial interface
|
||||
//
|
||||
virtual FColor GetColor(FLOAT TimeSeconds);
|
||||
}
|
||||
|
||||
enum EColorFadeType
|
||||
{
|
||||
FC_Linear,
|
||||
FC_Sinusoidal,
|
||||
};
|
||||
|
||||
var() Color Color1;
|
||||
var() Color Color2;
|
||||
var() float FadePeriod;
|
||||
var() float FadePhase;
|
||||
var() EColorFadeType ColorFadeType;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
ColorFadeType=FC_Linear
|
||||
}
|
||||
43
kf_sources/Engine/Classes/FailedConnect.uc
Normal file
43
kf_sources/Engine/Classes/FailedConnect.uc
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
class FailedConnect extends LocalMessage
|
||||
abstract;
|
||||
|
||||
var localized string FailMessage[4];
|
||||
|
||||
static function int GetFailSwitch(string FailString)
|
||||
{
|
||||
if ( FailString ~= "NEEDPW" )
|
||||
return 0;
|
||||
|
||||
if ( FailString ~= "WRONGPW" )
|
||||
return 1;
|
||||
|
||||
if ( FailString ~="GAMESTARTED" )
|
||||
return 2;
|
||||
|
||||
return 3;
|
||||
}
|
||||
|
||||
static function string GetString(
|
||||
optional int Switch,
|
||||
optional PlayerReplicationInfo RelatedPRI_1,
|
||||
optional PlayerReplicationInfo RelatedPRI_2,
|
||||
optional Object OptionalObject
|
||||
)
|
||||
{
|
||||
return Default.FailMessage[Clamp(Switch,0,3)];
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bBeep=false
|
||||
bFadeMessage=True
|
||||
bIsUnique=True
|
||||
|
||||
DrawColor=(R=255,G=0,B=128,A=255)
|
||||
FontSize=1
|
||||
|
||||
FailMessage(0)="FAILED TO JOIN GAME. NEED PASSWORD."
|
||||
FailMessage(1)="FAILED TO JOIN GAME. WRONG PASSWORD."
|
||||
FailMessage(2)="FAILED TO JOIN GAME. GAME HAS STARTED."
|
||||
FailMessage(3)="FAILED TO JOIN GAME."
|
||||
}
|
||||
15
kf_sources/Engine/Classes/FellLava.uc
Normal file
15
kf_sources/Engine/Classes/FellLava.uc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
class FellLava extends Fell
|
||||
abstract;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DeathString="%k made %o take a deadly swim."
|
||||
MaleSuicide="%o crashed and burned"
|
||||
FemaleSuicide="%o crashed and burned"
|
||||
|
||||
bSkeletize=true
|
||||
GibPerterbation=0.5
|
||||
GibModifier=2.0
|
||||
bLocationalHit=false
|
||||
bCausedByWorld=true
|
||||
}
|
||||
38
kf_sources/Engine/Classes/FileLog.uc
Normal file
38
kf_sources/Engine/Classes/FileLog.uc
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// ====================================================================
|
||||
// Class: Engine.FileLog
|
||||
// Parent: Engine.Info
|
||||
//
|
||||
// Creates a log device.
|
||||
// Important notes about this class since version 2225:
|
||||
// - the log file is always closed when destroyed
|
||||
// - open log files have the extention .tmp and change to .log when
|
||||
// closed
|
||||
// - old .tmp files will be overwritten
|
||||
// - limited freedom in file extentions, allowed extentions:
|
||||
// log, txt, html, htm
|
||||
// ====================================================================
|
||||
|
||||
class FileLog extends Info
|
||||
Native;
|
||||
|
||||
cpptext
|
||||
{
|
||||
void FinishLog();
|
||||
void Destroy();
|
||||
}
|
||||
|
||||
// Internal
|
||||
var pointer LogAr; // FArchive*
|
||||
|
||||
// File Names
|
||||
var const string LogFileName;
|
||||
var const string TempFileName;
|
||||
|
||||
// File Manipulation
|
||||
native final function OpenLog(string FName, optional string FExt, optional bool bOverwrite); // no extention in FName
|
||||
native final function CloseLog();
|
||||
native final function Logf( string LogString );
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
32
kf_sources/Engine/Classes/FinalBlend.uc
Normal file
32
kf_sources/Engine/Classes/FinalBlend.uc
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
class FinalBlend extends Modifier
|
||||
showcategories(Material)
|
||||
native;
|
||||
|
||||
enum EFrameBufferBlending
|
||||
{
|
||||
FB_Overwrite,
|
||||
FB_Modulate,
|
||||
FB_AlphaBlend,
|
||||
FB_AlphaModulate_MightNotFogCorrectly,
|
||||
FB_Translucent,
|
||||
FB_Darken,
|
||||
FB_Brighten,
|
||||
FB_Invisible,
|
||||
};
|
||||
|
||||
var() EFrameBufferBlending FrameBufferBlending;
|
||||
var() bool ZWrite;
|
||||
var() bool ZTest;
|
||||
var() bool AlphaTest;
|
||||
var() bool TwoSided;
|
||||
var() byte AlphaRef;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
FrameBufferBlending=FB_Overwrite
|
||||
ZWrite=True
|
||||
ZTest=True
|
||||
TwoSided=False
|
||||
// MT_Modifier | MT_FinalBlend
|
||||
MaterialType=17
|
||||
}
|
||||
205
kf_sources/Engine/Classes/FluidSurfaceInfo.uc
Normal file
205
kf_sources/Engine/Classes/FluidSurfaceInfo.uc
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
#exec Texture Import File=Textures\S_FluidSurf.pcx Name=S_FluidSurf Mips=Off MASKED=1
|
||||
|
||||
class FluidSurfaceInfo extends Info
|
||||
showcategories(Movement,Collision,Lighting,LightColor,Karma,Force)
|
||||
native
|
||||
noexport
|
||||
placeable;
|
||||
|
||||
var () enum EFluidGridType
|
||||
{
|
||||
FGT_Square,
|
||||
FGT_Hexagonal
|
||||
} FluidGridType;
|
||||
|
||||
var () float FluidGridSpacing; // distance between grid points
|
||||
var () int FluidXSize; // num vertices in X direction
|
||||
var () int FluidYSize; // num vertices in Y direction
|
||||
|
||||
var () float FluidHeightScale; // vertical scale factor
|
||||
|
||||
var () float FluidSpeed; // wave speed
|
||||
var () float FluidTimeScale;
|
||||
var () float FluidDamping; // between 0 and 1
|
||||
|
||||
var () float FluidNoiseFrequency;
|
||||
var () range FluidNoiseStrength;
|
||||
|
||||
var () bool TestRipple;
|
||||
var () float TestRippleSpeed;
|
||||
var () float TestRippleStrength;
|
||||
var () float TestRippleRadius;
|
||||
|
||||
var () float UTiles;
|
||||
var () float UOffset;
|
||||
var () float VTiles;
|
||||
var () float VOffset;
|
||||
var () float AlphaCurveScale;
|
||||
var () float AlphaHeightScale;
|
||||
var () byte AlphaMax;
|
||||
|
||||
var () float ShootStrength; // How hard to ripple water when shot
|
||||
var () float ShootRadius; // How large a radius is affected when water is shot
|
||||
|
||||
// How much to ripple the water when interacting with actors
|
||||
var () float RippleVelocityFactor;
|
||||
var () float TouchStrength;
|
||||
|
||||
// Class of effect spawned when water surface it shot or touched by an actor
|
||||
var () class<Actor> ShootEffect;
|
||||
var () bool OrientShootEffect;
|
||||
|
||||
var () class<Actor> TouchEffect;
|
||||
var () bool OrientTouchEffect;
|
||||
|
||||
// Bitmap indicating which water verts are 'clamped' ie. dont move
|
||||
var const array<int> ClampBitmap;
|
||||
|
||||
// Terrain used for auto-clamping water verts if below terrain level.
|
||||
var () edfindable TerrainInfo ClampTerrain;
|
||||
|
||||
var () bool bShowBoundingBox;
|
||||
var () bool bUseNoRenderZ;
|
||||
var () float NoRenderZ;
|
||||
|
||||
// Amount of time to simulate during postload before water is first displayed
|
||||
var () float WarmUpTime;
|
||||
|
||||
// Rate at which fluid sim will be updated
|
||||
var () float UpdateRate;
|
||||
|
||||
var () color FluidColor;
|
||||
|
||||
// Sim storage
|
||||
var transient const array<float> Verts0;
|
||||
var transient const array<float> Verts1;
|
||||
var transient const array<byte> VertAlpha;
|
||||
|
||||
var transient const int LatestVerts;
|
||||
|
||||
var transient const box FluidBoundingBox; // Current world-space AABB
|
||||
var transient const vector FluidOrigin; // Current bottom-left corner
|
||||
|
||||
var transient const float TimeRollover;
|
||||
//var transient const float AverageTimeStep;
|
||||
//var transient const int StepCount;
|
||||
var transient const float TestRippleAng;
|
||||
|
||||
var transient const FluidSurfacePrimitive Primitive;
|
||||
var transient const array<FluidSurfaceOscillator> Oscillators;
|
||||
var transient const bool bHasWarmedUp;
|
||||
|
||||
// Functions
|
||||
|
||||
// Ripple water at a particlar location.
|
||||
// Ignores 'z' componenet of position.
|
||||
native final function Pling(vector Position, float Strength, optional float Radius);
|
||||
|
||||
// default behaviour when shot is to apply an impulse and kick the KActor.
|
||||
// if _RO_
|
||||
simulated function TakeDamage(int Damage, Pawn instigatedBy, Vector hitlocation,
|
||||
vector momentum, class<DamageType> damageType, optional int HitIndex)
|
||||
// else UT
|
||||
// simulated function TakeDamage(int Damage, Pawn instigatedBy, Vector hitlocation,
|
||||
// Vector momentum, class<DamageType> damageType)
|
||||
{
|
||||
//Log("FS TakeDam:"$hitlocation@damageType);
|
||||
if (damageType.default.FluidSurfaceShootStrengthMod ~= 0)
|
||||
return;
|
||||
|
||||
// Vibrate water at hit location.
|
||||
Pling(hitLocation, ShootStrength * damageType.default.FluidSurfaceShootStrengthMod, ShootRadius);
|
||||
|
||||
// If present, spawn splashy hit effect.
|
||||
if( (ShootEffect != None) && EffectIsRelevant(HitLocation,false) )
|
||||
{
|
||||
if(OrientShootEffect)
|
||||
spawn(ShootEffect, self, , hitLocation, rotator(momentum));
|
||||
else
|
||||
spawn(ShootEffect, self, , hitLocation);
|
||||
}
|
||||
}
|
||||
|
||||
simulated function Touch(Actor Other)
|
||||
{
|
||||
local vector touchLocation;
|
||||
|
||||
Super.Touch(Other);
|
||||
|
||||
if( (Other == None) || !Other.bDisturbFluidSurface )
|
||||
return;
|
||||
|
||||
touchLocation = Other.Location;
|
||||
|
||||
// Now projectiles affect water by Touch instead of TakeDamage, use ShootStrength here.
|
||||
Pling(touchLocation, ShootStrength * Other.FluidSurfaceShootStrengthMod, Other.CollisionRadius);
|
||||
|
||||
// JTODO: Fix for non-horizontal fluid
|
||||
touchLocation.Z = Location.Z;
|
||||
if( (TouchEffect != None) && EffectIsRelevant(touchLocation,false) )
|
||||
{
|
||||
if(OrientTouchEffect)
|
||||
spawn(TouchEffect, self, , touchLocation, rotator(Other.Velocity));
|
||||
else
|
||||
spawn(TouchEffect, self, , touchLocation);
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DrawType=DT_FluidSurface
|
||||
Texture=S_FluidSurf
|
||||
|
||||
FluidGridType=FGT_Hexagonal
|
||||
FluidGridSpacing=24
|
||||
FluidXSize=48
|
||||
FluidYSize=48
|
||||
FluidHeightScale=1
|
||||
|
||||
FluidSpeed=170
|
||||
FluidTimeScale=1.0
|
||||
FluidDamping=0.5
|
||||
|
||||
ShootStrength=-50
|
||||
ShootRadius=0
|
||||
TouchStrength=-50
|
||||
|
||||
RippleVelocityFactor=-0.05
|
||||
|
||||
UpdateRate=50
|
||||
|
||||
FluidNoiseFrequency=60
|
||||
FluidNoiseStrength=(Min=-70,Max=70)
|
||||
|
||||
TestRipple=False
|
||||
TestRippleSpeed=3000
|
||||
TestRippleStrength=-20
|
||||
TestRippleRadius=48
|
||||
|
||||
AlphaCurveScale=0
|
||||
AlphaHeightScale=10
|
||||
AlphaMax=128
|
||||
UTiles=1
|
||||
UOffset=0
|
||||
VTiles=1
|
||||
VOffset=0
|
||||
|
||||
bShowBoundingBox=False
|
||||
WarmUpTime=2
|
||||
|
||||
FluidColor=(R=0,G=0,B=0,A=0)
|
||||
|
||||
bUnlit=True
|
||||
bHidden=False
|
||||
bStatic=False
|
||||
bNoDelete=True
|
||||
bStaticLighting=False
|
||||
bCollideActors=True
|
||||
bCollideWorld=False
|
||||
bProjTarget=False
|
||||
bBlockActors=False
|
||||
bBlockNonZeroExtentTraces=True
|
||||
bBlockZeroExtentTraces=True
|
||||
bWorldGeometry=False
|
||||
bEdShouldSnap=True
|
||||
}
|
||||
34
kf_sources/Engine/Classes/FluidSurfaceOscillator.uc
Normal file
34
kf_sources/Engine/Classes/FluidSurfaceOscillator.uc
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#exec Texture Import File=Textures\S_FluidSurfOsc.pcx Name=S_FluidSurfOsc Mips=Off MASKED=1
|
||||
|
||||
//=============================================================================
|
||||
// FluidSurfaceOscillator.
|
||||
//=============================================================================
|
||||
class FluidSurfaceOscillator extends Actor
|
||||
native
|
||||
placeable;
|
||||
|
||||
cpptext
|
||||
{
|
||||
void UpdateOscillation( FLOAT DeltaTime );
|
||||
virtual void PostEditChange();
|
||||
virtual void Destroy();
|
||||
}
|
||||
|
||||
// FluidSurface to oscillate
|
||||
var() edfindable FluidSurfaceInfo FluidInfo;
|
||||
var() float Frequency;
|
||||
var() byte Phase;
|
||||
var() float Strength;
|
||||
var() float Radius;
|
||||
|
||||
var transient const float OscTime;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Texture=S_FluidSurfOsc
|
||||
bHidden=true
|
||||
Frequency=1
|
||||
Phase=0
|
||||
Strength=10
|
||||
Radius=0
|
||||
}
|
||||
31
kf_sources/Engine/Classes/FlyingPathNode.uc
Normal file
31
kf_sources/Engine/Classes/FlyingPathNode.uc
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//=============================================================================
|
||||
// FlyingPathNode
|
||||
// Useful for flying or swimming
|
||||
//=============================================================================
|
||||
|
||||
#exec Texture Import File=Textures\FlyingApple.tga Name=S_FlyingPath Mips=Off MASKED=1
|
||||
|
||||
class FlyingPathNode extends PathNode
|
||||
native;
|
||||
|
||||
cpptext
|
||||
{
|
||||
INT ProscribedPathTo(ANavigationPoint *Nav);
|
||||
virtual UBOOL ReachedBy( APawn * P, FVector Loc );
|
||||
virtual UBOOL NoReachDistance();
|
||||
virtual UBOOL BigAnchor(APawn * P, FVector Loc);
|
||||
virtual void addReachSpecs(APawn * Scout, UBOOL bOnlyChanged);
|
||||
virtual UBOOL ShouldBeBased();
|
||||
virtual void InitForPathFinding();
|
||||
UBOOL ReviewPath(APawn* Scout);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Texture=S_FlyingPath
|
||||
SoundVolume=128
|
||||
bNoAutoConnect=true
|
||||
DrawScale=+0.4
|
||||
bFlyingPreferred=true
|
||||
bVehicleDestination=true
|
||||
}
|
||||
153
kf_sources/Engine/Classes/Fragment.uc
Normal file
153
kf_sources/Engine/Classes/Fragment.uc
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
//=============================================================================
|
||||
// Fragment.
|
||||
//=============================================================================
|
||||
class Fragment extends Effects;
|
||||
|
||||
var() MESH Fragments[11];
|
||||
var int numFragmentTypes;
|
||||
var bool bFirstHit;
|
||||
var() sound ImpactSound, AltImpactSound;
|
||||
var() float SplashTime;
|
||||
|
||||
function bool CanSplash()
|
||||
{
|
||||
if ( (Level.TimeSeconds - SplashTime > 0.25)
|
||||
&& (Physics == PHYS_Falling)
|
||||
&& (Abs(Velocity.Z) > 100) )
|
||||
{
|
||||
SplashTime = Level.TimeSeconds;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
simulated function CalcVelocity(vector Momentum)
|
||||
{
|
||||
local float ExplosionSize;
|
||||
|
||||
ExplosionSize = 0.011 * VSize(Momentum);
|
||||
Velocity = 0.0033 * Momentum + 0.7 * VRand()*(ExplosionSize+FRand()*100.0+100.0);
|
||||
Velocity.z += 0.5 * ExplosionSize;
|
||||
}
|
||||
|
||||
simulated function HitWall (vector HitNormal, actor HitWall)
|
||||
{
|
||||
local float speed;
|
||||
|
||||
Velocity = 0.5*(( 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 ( (speed < 60) && (HitNormal.Z > 0.7) )
|
||||
{
|
||||
SetPhysics(PHYS_none);
|
||||
bBounce = false;
|
||||
GoToState('Dying');
|
||||
}
|
||||
else if (speed > 80)
|
||||
{
|
||||
if (FRand()<0.5)
|
||||
PlaySound(ImpactSound, SLOT_None,,, 300, 0.85+FRand()*0.3,true);
|
||||
else
|
||||
PlaySound(AltImpactSound, SLOT_None,,, 300, 0.85+FRand()*0.3,true);
|
||||
}
|
||||
}
|
||||
|
||||
simulated final function RandSpin(float spinRate)
|
||||
{
|
||||
DesiredRotation = RotRand();
|
||||
RotationRate.Yaw = spinRate * 2 *FRand() - spinRate;
|
||||
RotationRate.Pitch = spinRate * 2 *FRand() - spinRate;
|
||||
RotationRate.Roll = spinRate * 2 *FRand() - spinRate;
|
||||
}
|
||||
|
||||
auto state Flying
|
||||
{
|
||||
simulated function timer()
|
||||
{
|
||||
GoToState('Dying');
|
||||
}
|
||||
|
||||
simulated singular function PhysicsVolumeChange( PhysicsVolume NewVolume )
|
||||
{
|
||||
if ( NewVolume.bWaterVolume )
|
||||
{
|
||||
Velocity = 0.2 * Velocity;
|
||||
if (bFirstHit)
|
||||
{
|
||||
bFirstHit=False;
|
||||
bRotatetoDesired=True;
|
||||
bFixedRotationDir=False;
|
||||
DesiredRotation.Pitch=0;
|
||||
DesiredRotation.Yaw=FRand()*65536;
|
||||
DesiredRotation.roll=0;
|
||||
}
|
||||
|
||||
RotationRate = 0.2 * RotationRate;
|
||||
GotoState('Dying');
|
||||
}
|
||||
}
|
||||
|
||||
simulated function BeginState()
|
||||
{
|
||||
RandSpin(125000);
|
||||
if (abs(RotationRate.Pitch)<10000)
|
||||
RotationRate.Pitch=10000;
|
||||
if (abs(RotationRate.Roll)<10000)
|
||||
RotationRate.Roll=10000;
|
||||
LinkMesh(Fragments[int(FRand()*numFragmentTypes)]);
|
||||
if ( Level.NetMode == NM_Standalone )
|
||||
LifeSpan = 20 + 40 * FRand();
|
||||
SetTimer(5.0,True);
|
||||
}
|
||||
}
|
||||
|
||||
state Dying
|
||||
{
|
||||
function TakeDamage( int Dam, Pawn instigatedBy, Vector hitlocation,
|
||||
Vector momentum, class<DamageType> damageType, optional int HitIndex)
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
simulated function timer()
|
||||
{
|
||||
if ( !PlayerCanSeeMe() )
|
||||
Destroy();
|
||||
}
|
||||
|
||||
simulated function BeginState()
|
||||
{
|
||||
SetTimer(1 + FRand(),True);
|
||||
SetCollision(true, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bDestroyInPainVolume=true
|
||||
bFirstHit=True
|
||||
CollisionRadius=+00018.000000
|
||||
CollisionHeight=+00004.000000
|
||||
Physics=PHYS_Falling
|
||||
bBounce=True
|
||||
bFixedRotationDir=True
|
||||
bCollideActors=false
|
||||
bCollideWorld=True
|
||||
LifeSpan=+00020.000000
|
||||
DrawType=DT_Mesh
|
||||
SoundVolume=0
|
||||
RemoteRole=ROLE_None
|
||||
}
|
||||
|
||||
50
kf_sources/Engine/Classes/GameEngine.uc
Normal file
50
kf_sources/Engine/Classes/GameEngine.uc
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
//=============================================================================
|
||||
// GameEngine: The game subsystem.
|
||||
// This is a built-in Unreal class and it shouldn't be modified.
|
||||
//=============================================================================
|
||||
class GameEngine extends Engine
|
||||
native
|
||||
noexport
|
||||
transient;
|
||||
|
||||
// URL structure.
|
||||
struct URL
|
||||
{
|
||||
var string Protocol, // Protocol, i.e. "unreal" or "http".
|
||||
Host; // Optional hostname, i.e. "204.157.115.40" or "unreal.epicgames.com", blank if local.
|
||||
var int Port; // Optional host port.
|
||||
var string Map; // Map name, i.e. "SkyCity", default is "Index".
|
||||
var array<string> Op; // Options.
|
||||
var string Portal; // Portal to enter through, default is "".
|
||||
var int Valid;
|
||||
};
|
||||
|
||||
var Level GLevel,
|
||||
GEntry;
|
||||
var PendingLevel GPendingLevel;
|
||||
var URL LastURL;
|
||||
var config array<string> ServerActors,
|
||||
ServerPackages;
|
||||
|
||||
var array<object> DummyArray; // Do not modify
|
||||
var object DummyObject; // Do not modify
|
||||
var string DummyString; // Do not modify
|
||||
|
||||
var globalconfig String MainMenuClass; // Menu that appears when you first start
|
||||
var globalconfig string SinglePlayerMenuClass; // Menu that appears when you return from a single player match after a cinematic game
|
||||
var globalconfig String ConnectingMenuClass; // Menu that appears when you are connecting
|
||||
var globalconfig String DisconnectMenuClass; // Menu that appears when you are disconnected
|
||||
var globalconfig String LoadingClass; // Loading screen that appears
|
||||
|
||||
var bool bCheatProtection;
|
||||
var(Settings) config bool ColorHighDetailMeshes;
|
||||
var(Settings) config bool ColorSlowCollisionMeshes;
|
||||
var(Settings) config bool ColorNoCollisionMeshes;
|
||||
var(Settings) config bool ColorWorldTextures;
|
||||
var(Settings) config bool ColorPlayerAndWeaponTextures;
|
||||
var(Settings) config bool ColorInterfaceTextures;
|
||||
|
||||
var(VoiceChat) globalconfig bool VoIPAllowVAD;
|
||||
|
||||
|
||||
|
||||
2879
kf_sources/Engine/Classes/GameInfo.uc
Normal file
2879
kf_sources/Engine/Classes/GameInfo.uc
Normal file
File diff suppressed because it is too large
Load diff
137
kf_sources/Engine/Classes/GameMessage.uc
Normal file
137
kf_sources/Engine/Classes/GameMessage.uc
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
class GameMessage extends LocalMessage;
|
||||
|
||||
var(Message) localized string SwitchLevelMessage;
|
||||
var(Message) localized string LeftMessage;
|
||||
var(Message) localized string FailedTeamMessage;
|
||||
var(Message) localized string FailedPlaceMessage;
|
||||
var(Message) localized string FailedSpawnMessage;
|
||||
var(Message) localized string EnteredMessage;
|
||||
var(Message) localized string MaxedOutMessage;
|
||||
var(Message) localized string OvertimeMessage;
|
||||
var(Message) localized string GlobalNameChange;
|
||||
var(Message) localized string NewTeamMessage;
|
||||
var(Message) localized string NewTeamMessageTrailer;
|
||||
var(Message) localized string NoNameChange;
|
||||
var(Message) localized string VoteStarted;
|
||||
var(Message) localized string VotePassed;
|
||||
var(Message) localized string MustHaveStats;
|
||||
var(Message) localized string CantBeSpectator;
|
||||
var(Message) localized string CantBePlayer;
|
||||
var(Message) localized string BecameSpectator;
|
||||
|
||||
var localized string NewPlayerMessage;
|
||||
var localized string KickWarning;
|
||||
var localized string NewSpecMessage, SpecEnteredMessage;
|
||||
|
||||
//
|
||||
// Messages common to GameInfo derivatives.
|
||||
//
|
||||
static function string GetString(
|
||||
optional int Switch,
|
||||
optional PlayerReplicationInfo RelatedPRI_1,
|
||||
optional PlayerReplicationInfo RelatedPRI_2,
|
||||
optional Object OptionalObject
|
||||
)
|
||||
{
|
||||
switch (Switch)
|
||||
{
|
||||
case 0:
|
||||
return Default.OverTimeMessage;
|
||||
break;
|
||||
case 1:
|
||||
if (RelatedPRI_1 == None)
|
||||
return Default.NewPlayerMessage;
|
||||
|
||||
return RelatedPRI_1.playername$Default.EnteredMessage;
|
||||
break;
|
||||
case 2:
|
||||
if (RelatedPRI_1 == None)
|
||||
return "";
|
||||
|
||||
return RelatedPRI_1.OldName@Default.GlobalNameChange@RelatedPRI_1.PlayerName;
|
||||
break;
|
||||
case 3:
|
||||
if (RelatedPRI_1 == None)
|
||||
return "";
|
||||
if (OptionalObject == None)
|
||||
return "";
|
||||
|
||||
return RelatedPRI_1.playername@Default.NewTeamMessage@TeamInfo(OptionalObject).GetHumanReadableName()$Default.NewTeamMessageTrailer;
|
||||
break;
|
||||
case 4:
|
||||
if (RelatedPRI_1 == None)
|
||||
return "";
|
||||
|
||||
return RelatedPRI_1.playername$Default.LeftMessage;
|
||||
break;
|
||||
case 5:
|
||||
return Default.SwitchLevelMessage;
|
||||
break;
|
||||
case 6:
|
||||
return Default.FailedTeamMessage;
|
||||
break;
|
||||
case 7:
|
||||
return Default.MaxedOutMessage;
|
||||
break;
|
||||
case 8:
|
||||
return Default.NoNameChange;
|
||||
break;
|
||||
case 9:
|
||||
return RelatedPRI_1.playername@Default.VoteStarted;
|
||||
break;
|
||||
case 10:
|
||||
return Default.VotePassed;
|
||||
break;
|
||||
case 11:
|
||||
return Default.MustHaveStats;
|
||||
break;
|
||||
case 12:
|
||||
return Default.CantBeSpectator;
|
||||
break;
|
||||
case 13:
|
||||
return Default.CantBePlayer;
|
||||
break;
|
||||
case 14:
|
||||
return RelatedPRI_1.PlayerName@Default.BecameSpectator;
|
||||
break;
|
||||
case 15:
|
||||
return Default.KickWarning;
|
||||
break;
|
||||
case 16:
|
||||
if (RelatedPRI_1 == None)
|
||||
return Default.NewSpecMessage;
|
||||
|
||||
return RelatedPRI_1.playername$Default.SpecEnteredMessage;
|
||||
break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
NewPlayerMessage="A new player entered the game."
|
||||
NewSpecMessage="A spectator entered the game/"
|
||||
OverTimeMessage="Score tied at the end of regulation. Sudden Death Overtime!!!"
|
||||
GlobalNameChange="changed name to"
|
||||
NewTeamMessage="is now on"
|
||||
NewTeamMessageTrailer=""
|
||||
SwitchLevelMessage="Switching Levels"
|
||||
MaxedOutMessage="Server is already at capacity."
|
||||
EnteredMessage=" entered the game."
|
||||
SpecEnteredMessage=" joined as a spectator."
|
||||
FailedTeamMessage="Could not find team for player"
|
||||
FailedPlaceMessage="Could not find a starting spot"
|
||||
FailedSpawnMessage="Could not spawn player"
|
||||
LeftMessage=" left the game."
|
||||
NoNameChange="Name is already in use."
|
||||
MustHaveStats="Must have stats enabled to join this server."
|
||||
VoteStarted="started a vote."
|
||||
VotePassed="Vote passed."
|
||||
CantBeSpectator="Sorry, you cannot become a spectator at this time."
|
||||
CantBePlayer="Sorry, you cannot become an active player at this time."
|
||||
BecameSpectator="became a spectator."
|
||||
bIsSpecial=false
|
||||
bIsConsoleMessage=true
|
||||
|
||||
KickWarning="You are about to be kicked for idling!"
|
||||
}
|
||||
425
kf_sources/Engine/Classes/GameProfile.uc
Normal file
425
kf_sources/Engine/Classes/GameProfile.uc
Normal file
|
|
@ -0,0 +1,425 @@
|
|||
class GameProfile extends Object
|
||||
native;
|
||||
|
||||
var() string PackageName;
|
||||
var() int ManifestIndex;
|
||||
|
||||
|
||||
enum EPlayerPos
|
||||
{
|
||||
POS_Auto,
|
||||
POS_Defense,
|
||||
POS_Offense,
|
||||
POS_Roam,
|
||||
/*POS_Captain, Not handy for dropdown display */
|
||||
POS_Supporting
|
||||
};
|
||||
const NUM_POSITIONS = 5;
|
||||
var localized string PositionName[5]; // text names of these positions
|
||||
|
||||
var EPlayerPos PlayerPositions[7]; // only need positions for AI team, so 7 max
|
||||
const TEAM_SIZE = 7;
|
||||
var() array<string> PlayerTeam; // Player team members
|
||||
var int PlayerLineup[4]; // Lineup for current match. Stores index into PlayerTeam array.
|
||||
const LINEUP_SIZE = 4;
|
||||
var string EnemyTeam; // Opponent team name for pending/current match
|
||||
var string TeamName; // Player team name
|
||||
var string TeamSymbolName; // name of team symbol
|
||||
|
||||
var() float BaseDifficulty; // configured at start of single player
|
||||
var() float Difficulty;
|
||||
|
||||
var int SalaryCap; // allowable salary cap for team roster
|
||||
|
||||
// stored here, but also passed separately on URL
|
||||
var string PlayerName;
|
||||
var string PlayerCharacter;
|
||||
|
||||
// player's stats - individual experience
|
||||
var() int Kills;
|
||||
var() int Goals;
|
||||
var() int Deaths;
|
||||
var() int Wins;
|
||||
var() int Matches;
|
||||
|
||||
// Ladders: -1 = Locked
|
||||
var int LadderRung[6];
|
||||
const NUM_LADDERS = 6;
|
||||
|
||||
var string SpecialEvent;
|
||||
var string GameLadderName;
|
||||
var class<LadderInfo> GameLadder;
|
||||
|
||||
// current match
|
||||
var int CurrentLadder;
|
||||
var transient int CurrentMenuRung; // set by menu system, used for starting a match, in LadderInfo. if -1, use next match in order
|
||||
var transient Object NextMatchObject; // Used by GUI SP Pages for holding the Button for Next Match
|
||||
var transient Object ChampBorderObject; // Used by GUI SP Pages for holding the border for Championship.
|
||||
// Sad hack, but easiest way to communicate GUI objects between Ladder and Qual tabs
|
||||
var bool bInLadderGame; // Used to see if we should return to the SP menu after the match has finished,
|
||||
// also used to check if we should use the LoadingClass vignette
|
||||
var bool bWonMatch;
|
||||
|
||||
|
||||
// constructor: set up the GameLadder
|
||||
function Initialize(GameInfo currentGame, string pn)
|
||||
{
|
||||
local Controller C;
|
||||
|
||||
if (GameLadder == none)
|
||||
{
|
||||
GameLadder = class<LadderInfo>(DynamicLoadObject(GameLadderName, class'Class'));
|
||||
}
|
||||
PackageName=pn;
|
||||
PlayerName=pn;
|
||||
|
||||
// set character, player in current game
|
||||
for ( C=currentGame.Level.ControllerList; C!=None; C=C.NextController )
|
||||
{
|
||||
if ( PlayerController(C) != None )
|
||||
{
|
||||
currentGame.ChangeName (PlayerController(C), PlayerName, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
NextMatchObject=None;
|
||||
ChampBorderObject=None;
|
||||
}
|
||||
|
||||
// skip this rung of the ladder without saving
|
||||
function CheatSkipMatch(GameInfo CurrentGame)
|
||||
{
|
||||
SpecialEvent = GameLadder.static.UpdateLadders(self,CurrentLadder); // updates LadderRungs appropriately
|
||||
ContinueSinglePlayerGame(CurrentGame.Level);
|
||||
}
|
||||
|
||||
// skip directly to a certain ladder/rung
|
||||
// takes a single number (54) and splits into ladder 5, match 4
|
||||
function CheatJumpMatch(GameInfo currentGame, int param) {
|
||||
local Controller C;
|
||||
local int newladder, newrung;
|
||||
|
||||
newladder = param/10;
|
||||
newrung = param-(newladder*10);
|
||||
if (newladder < 0 || newladder >= NUM_LADDERS || newrung < 0)
|
||||
return;
|
||||
bInLadderGame=true;
|
||||
CurrentLadder = newladder;
|
||||
LadderRung[CurrentLadder] = newrung;
|
||||
CurrentMenuRung=newrung;
|
||||
|
||||
// open game
|
||||
for ( C=currentGame.Level.ControllerList; C!=None; C=C.NextController )
|
||||
{
|
||||
if ( PlayerController(C) != None )
|
||||
{
|
||||
PlayerController(C).ConsoleCommand("START"@GameLadder.static.MakeURLFor(self));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// robust checks are in LadderInfo, returns none if not found
|
||||
function MatchInfo GetMatchInfo(int ladder, int rung) {
|
||||
if ( GameLadder != none )
|
||||
{
|
||||
return GameLadder.static.GetMatchInfo(ladder,rung);
|
||||
}
|
||||
else
|
||||
{
|
||||
return none;
|
||||
}
|
||||
}
|
||||
|
||||
// After a game is completed, this function should be called to
|
||||
// record the player's statistics and update the ladder.
|
||||
// Currently called from Deathmatch 'MatchOver' state
|
||||
function RegisterGame(GameInfo currentGame, PlayerReplicationInfo PRI)
|
||||
{
|
||||
Log("SINGLEPLAYER GameProfile::RegisterGame for profile"@self.packagename);
|
||||
Kills += PRI.Kills;
|
||||
Goals += PRI.GoalsScored;
|
||||
Deaths += PRI.Deaths;
|
||||
Matches++;
|
||||
if ( bWonMatch ) {
|
||||
//Log("SINGLEPLAYER GameProfile::RegisterGame player won the match.");
|
||||
SpecialEvent = GameLadder.static.UpdateLadders(self,CurrentLadder); // updates LadderRungs appropriately
|
||||
Wins++;
|
||||
}
|
||||
bWonMatch = false;
|
||||
}
|
||||
|
||||
// Send the player to the next match in the given ladder
|
||||
function StartNewMatch(int PickedLadder, LevelInfo CurrentLevel)
|
||||
{
|
||||
local Controller C;
|
||||
|
||||
bWonMatch = false;
|
||||
bInLadderGame=true;
|
||||
CurrentLadder = PickedLadder;
|
||||
CurrentLevel.Game.SavePackage(PackageName);
|
||||
|
||||
// open game
|
||||
for ( C=currentLevel.ControllerList; C!=None; C=C.NextController )
|
||||
{
|
||||
if ( PlayerController(C) != None )
|
||||
{
|
||||
PlayerController(C).ConsoleCommand("START"@GameLadder.static.MakeURLFor(self));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handy helper function to find the player's first unfinished ladder
|
||||
// If no ladders are unfinished, return 0 for DM ladder
|
||||
function int FindFirstUnfinishedLadder() {
|
||||
local int i;
|
||||
|
||||
for (i=0; i<6; i++)
|
||||
{
|
||||
// 6 is magic from number of ladders, declared above
|
||||
if (LadderRung[i] < GameLadder.static.LengthOfLadder(i)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// override in subclasses!
|
||||
function ContinueSinglePlayerGame(LevelInfo level, optional bool bReplace)
|
||||
{
|
||||
Level.Game.SavePackage(PackageName);
|
||||
|
||||
// the direct call to startnewmatch is to avoid using a game-specific menu system
|
||||
StartNewMatch(FindFirstUnfinishedLadder(), level);
|
||||
}
|
||||
|
||||
// Used in menus: this is the gametype info for the next match
|
||||
function string GetMatchDescription()
|
||||
{
|
||||
return GameLadder.static.GetMatchDescription(self);
|
||||
}
|
||||
|
||||
// accessor
|
||||
function static int GetNumPositions()
|
||||
{
|
||||
return NUM_POSITIONS;
|
||||
}
|
||||
|
||||
// return number of teammates needed for currently selected match
|
||||
// assumes player team always gets an odd player
|
||||
function int GetNumTeammatesForMatch()
|
||||
{
|
||||
local MatchInfo M;
|
||||
|
||||
M = GameLadder.static.GetCurrentMatchInfo(self);
|
||||
|
||||
if ( M.GameType ~= "xGame.xDeathmatch" || M.GameType ~= "xGame.BossDM" )
|
||||
return 0;
|
||||
else
|
||||
return M.NumBots / 2;
|
||||
}
|
||||
|
||||
|
||||
function static string TextPositionDescription(int posnval)
|
||||
{
|
||||
local string retval;
|
||||
|
||||
if (posnval < 0 || posnval > NUM_POSITIONS) // magic number based on team size of 7
|
||||
return "Error";
|
||||
|
||||
switch (posnval) {
|
||||
case EPlayerPos.POS_Auto:
|
||||
retval = default.PositionName[0];
|
||||
break;
|
||||
case EPlayerPos.POS_Defense:
|
||||
retval = default.PositionName[1];
|
||||
break;
|
||||
case EPlayerPos.POS_Offense:
|
||||
retval = default.PositionName[2];
|
||||
break;
|
||||
case EPlayerPos.POS_Roam:
|
||||
retval = default.PositionName[3];
|
||||
break;
|
||||
/* case EPlayerPos.POS_Captain:
|
||||
retval = "CAPTAIN";
|
||||
break;*/
|
||||
case EPlayerPos.POS_Supporting:
|
||||
retval = default.PositionName[4];
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
function static EPlayerPos EnumPositionDescription(string posnval)
|
||||
{
|
||||
local EPlayerPos retval;
|
||||
|
||||
if (posnval == default.PositionName[0]) {
|
||||
retval = EPlayerPos.POS_Auto;
|
||||
} else if (posnval == default.PositionName[1]) {
|
||||
retval = EPlayerPos.POS_Defense;
|
||||
} else if (posnval == default.PositionName[2]) {
|
||||
retval = EPlayerPos.POS_Offense;
|
||||
} else if (posnval == default.PositionName[3]) {
|
||||
retval = EPlayerPos.POS_Roam;
|
||||
} else if (posnval == default.PositionName[4]) {
|
||||
retval = EPlayerPos.POS_Supporting;
|
||||
} else
|
||||
retval = EPlayerPos.POS_Auto;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
function string GetPositionDescription(int playernum)
|
||||
{
|
||||
if (playernum < 0 || playernum >= TEAM_SIZE)
|
||||
return "Error";
|
||||
return TextPositionDescription(PlayerPositions[playernum]);
|
||||
}
|
||||
|
||||
// takes a lineup position (1-4) and sets that player's game position
|
||||
function SetPosition (int lineupnum, string posn)
|
||||
{
|
||||
if ((lineupnum >= 0) && (lineupnum < 4))
|
||||
PlayerPositions[PlayerLineup[lineupnum]] = EnumPositionDescription(posn);
|
||||
}
|
||||
|
||||
// called when adjusting the lineup
|
||||
// takes lineup position (1-4) and team position (1-7) and makes it all work
|
||||
function SetLineup (int lineuppos, int teampos)
|
||||
{
|
||||
local int oldlineuppos, oldteammate, i;
|
||||
|
||||
// check bounds
|
||||
if ( lineuppos < 0 || lineuppos > LINEUP_SIZE )
|
||||
return;
|
||||
if ( teampos < 0 || teampos >= TEAM_SIZE )
|
||||
return;
|
||||
if ( PlayerLineup[lineuppos] == teampos ) // no-op
|
||||
return;
|
||||
|
||||
// check to see if player 'teampos' was already in the lineup
|
||||
oldlineuppos=-1;
|
||||
for ( i=0; i<LINEUP_SIZE; i++ )
|
||||
{
|
||||
if ( PlayerLineup[i] == teampos )
|
||||
{
|
||||
oldlineuppos = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( oldlineuppos >= 0 ) {
|
||||
oldteammate = PlayerLineup[lineuppos];
|
||||
}
|
||||
PlayerLineup[lineuppos] = teampos;
|
||||
if ( oldlineuppos >= 0 ) {
|
||||
PlayerLineup[oldlineuppos] = oldteammate;
|
||||
}
|
||||
}
|
||||
|
||||
// add teammate to the next available position on the team
|
||||
// return false if not added because already on team or no room
|
||||
// assumes it's a legal player record
|
||||
function bool AddTeammate(string botname)
|
||||
{
|
||||
local int i;
|
||||
|
||||
if ( botname == "" )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for ( i=0; i<TEAM_SIZE; i++ )
|
||||
{
|
||||
if ( i >= PlayerTeam.Length || PlayerTeam[i] == "" )
|
||||
{
|
||||
Playerteam[i] = botname;
|
||||
return true;
|
||||
}
|
||||
if ( PlayerTeam[i] ~= botname )
|
||||
{
|
||||
// already on team
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false; // never found space
|
||||
}
|
||||
|
||||
// remove teammate from the team
|
||||
// return false if not removed because not on team
|
||||
function bool ReleaseTeammate(string botname)
|
||||
{
|
||||
local int i, j;
|
||||
|
||||
if ( botname == "" )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for ( i=0; i<PlayerTeam.Length; i++ )
|
||||
{
|
||||
if ( PlayerTeam[i] ~= botname )
|
||||
{
|
||||
// player is on team, shuffle list
|
||||
for ( j=i; j<PlayerTeam.Length-1; j++ )
|
||||
{
|
||||
PlayerTeam[j] = PlayerTeam[j+1];
|
||||
}
|
||||
PlayerTeam[PlayerTeam.Length-1] = "";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false; // never found botname
|
||||
}
|
||||
|
||||
function ClearTeammates()
|
||||
{
|
||||
local int i;
|
||||
for ( i=0; i<PlayerTeam.Length; i++ )
|
||||
{
|
||||
PlayerTeam[i] = "";
|
||||
}
|
||||
}
|
||||
|
||||
function ReportCheat(PlayerController Cheater, string cheat);
|
||||
|
||||
function bool CanChangeTeam(Controller Other, int NewTeam)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
GameLadderName="Engine.LadderInfo"
|
||||
LadderRung(0)=0
|
||||
LadderRung(1)=-1
|
||||
LadderRung(2)=-1
|
||||
LadderRung(3)=-1
|
||||
LadderRung(4)=-1
|
||||
LadderRung(5)=-1
|
||||
|
||||
PositionName(0)="AUTO-ASSIGN"
|
||||
PositionName(1)="DEFENSE"
|
||||
PositionName(2)="OFFENSE"
|
||||
PositionName(3)="ROAM"
|
||||
PositionName(4)="SUPPORT"
|
||||
|
||||
PlayerLineup(0)=0
|
||||
PlayerLineup(1)=1
|
||||
PlayerLineup(2)=2
|
||||
PlayerLineup(3)=3
|
||||
|
||||
BaseDifficulty=1
|
||||
PlayerName="Name"
|
||||
PlayerCharacter="Roc"
|
||||
PlayerTeam="TeamName"
|
||||
PackageName="Default"
|
||||
Kills=0
|
||||
Goals=0
|
||||
Deaths=0
|
||||
bInLadderGame=false
|
||||
}
|
||||
345
kf_sources/Engine/Classes/GameReplicationInfo.uc
Normal file
345
kf_sources/Engine/Classes/GameReplicationInfo.uc
Normal file
|
|
@ -0,0 +1,345 @@
|
|||
//=============================================================================
|
||||
// GameReplicationInfo.
|
||||
//=============================================================================
|
||||
class GameReplicationInfo extends ReplicationInfo
|
||||
native nativereplication exportstructs;
|
||||
|
||||
var string GameName; // Assigned by GameInfo.
|
||||
var string GameClass; // Assigned by GameInfo.
|
||||
var bool bTeamGame; // Assigned by GameInfo.
|
||||
var bool bStopCountDown;
|
||||
var bool bMatchHasBegun;
|
||||
var bool bTeamSymbolsUpdated;
|
||||
var bool bNoTeamSkins;
|
||||
var bool bForceTeamSkins;
|
||||
var bool bForceNoPlayerLights;
|
||||
var bool bAllowPlayerLights;
|
||||
var bool bFastWeaponSwitching;
|
||||
var bool bNoTeamChanges;
|
||||
|
||||
var int RemainingTime, ElapsedTime, RemainingMinute;
|
||||
var float SecondCount;
|
||||
var int GoalScore;
|
||||
var int TimeLimit;
|
||||
var int MaxLives;
|
||||
var int MinNetPlayers;
|
||||
var float WeaponBerserk;
|
||||
|
||||
var TeamInfo Teams[2];
|
||||
|
||||
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 ServerRegion; // Region of the game server.
|
||||
|
||||
var() globalconfig string MessageOfTheDay;
|
||||
var() deprecated string MOTDLine1, MOTDLine2, MOTDLine3, MOTDLine4;
|
||||
|
||||
var Actor Winner; // set by gameinfo when game ends
|
||||
var VoiceChatReplicationInfo VoiceReplicationInfo;
|
||||
|
||||
var() texture TeamSymbols[2];
|
||||
var() array<PlayerReplicationInfo> PRIArray;
|
||||
|
||||
// mc - localized PlayInfo descriptions & extra info
|
||||
const PROPNUM = 4;
|
||||
var localized string GRIPropsDisplayText[PROPNUM];
|
||||
var localized string GRIPropDescText[PROPNUM];
|
||||
|
||||
var vector FlagPos; // replicated 2D position of one object
|
||||
var EFlagState FlagState[2];
|
||||
var PlayerReplicationInfo FlagHolder[2]; // hack to work around flag holder replication FIXME remove when break net compatibility
|
||||
var PlayerReplicationInfo FlagTarget; // used by Bombing Run (targeted player)
|
||||
|
||||
// stats
|
||||
var int MatchID;
|
||||
|
||||
var int BotDifficulty; // for bPlayersVsBots
|
||||
|
||||
// Red Orchestra replication. Moved here to take advantage of native replication
|
||||
// if _RO_
|
||||
|
||||
// Round system
|
||||
var int RoundStartTime; // Time that the current round state started
|
||||
var int PreStartTime; // Waiting period for players to join and settle
|
||||
var int RoundDuration; // Length of a round
|
||||
var int LastReinforcementTime[2]; // Time when reinforcements are allowed for both sides
|
||||
var int ReinforcementInterval[2]; // Interval between reinforcement waves
|
||||
var byte bReinforcementsComing[2]; // Set to 1 if reinforcements are on the way
|
||||
var int ElapsedQuarterMinute; // Hack to sync the client time that works alright
|
||||
var byte SpawnCount[2];
|
||||
var int RoundLimit; // Number of rounds required to win the map
|
||||
|
||||
// Artillery system
|
||||
var int LastArtyStrikeTime[2]; // Last time an artillery strike was called
|
||||
var byte bArtilleryAvailable[2]; // Set to 1 if an artillery strike is available
|
||||
var int ArtilleryStrikeLimit[2]; // Number of strikes available for this team
|
||||
var int TotalStrikes[2]; // Total strikes that this team has called
|
||||
|
||||
var byte AlliesRoleCount[10]; // Total number of players with this role
|
||||
var byte AxisRoleCount[10]; // Total number of players with this role
|
||||
var byte AlliesRoleBotCount[10]; // Total number of bots with this role
|
||||
var byte AxisRoleBotCount[10]; // Total number of bots with this role
|
||||
var byte NationIndex[2];
|
||||
|
||||
// Map
|
||||
var string UnitName[2]; // Tells the client what units are involved in the battle
|
||||
var Material UnitInsignia[2];
|
||||
var Material MapImage;
|
||||
var vector NorthEastBounds; // This is the saved location of the Northeast corner of the map bounds
|
||||
var vector SouthWestBounds; // This is the saved location of the Southwest corner of the map bounds
|
||||
var int OverheadOffset; // The offset that the real map is relative to the overhead map
|
||||
|
||||
var bool bPlayerMustReady; // This game uses "ready to start" code
|
||||
|
||||
var byte MaxPlayers; // Maximum amount of players allowed in the game(Read from GameInfo's MaxPlayers setting)
|
||||
|
||||
// end _RO_
|
||||
|
||||
|
||||
replication
|
||||
{
|
||||
reliable if ( bNetDirty && (Role == ROLE_Authority) )
|
||||
bStopCountDown, Winner, Teams, FlagPos, FlagState, bMatchHasBegun, MatchID, FlagTarget;
|
||||
|
||||
reliable if ( !bNetInitial && bNetDirty && (Role == ROLE_Authority) )
|
||||
RemainingMinute;
|
||||
|
||||
reliable if ( bNetInitial && (Role==ROLE_Authority) )
|
||||
GameName, GameClass, bTeamGame, bNoTeamSkins, bForceTeamSkins, bForceNoPlayerLights, WeaponBerserk, bAllowPlayerLights, bFastWeaponSwitching,
|
||||
RemainingTime, ElapsedTime, MessageOfTheDay, ServerName, ShortName, AdminName,
|
||||
AdminEmail, ServerRegion, GoalScore, MaxLives, TimeLimit, TeamSymbols,
|
||||
VoiceReplicationInfo, MinNetPlayers, bNoTeamChanges,BotDifficulty;
|
||||
|
||||
// if _RO_
|
||||
reliable if (bNetDirty && (Role == ROLE_Authority))
|
||||
RoundStartTime, LastReinforcementTime, bReinforcementsComing, ElapsedQuarterMinute, SpawnCount, LastArtyStrikeTime,
|
||||
bArtilleryAvailable, TotalStrikes, AlliesRoleCount, AxisRoleCount, AlliesRoleBotCount, AxisRoleBotCount, MaxPlayers;
|
||||
|
||||
reliable if (bNetInitial && (Role == ROLE_Authority))
|
||||
PreStartTime, RoundDuration, ReinforcementInterval, UnitName, MapImage, UnitInsignia, NationIndex, OverheadOffset,
|
||||
ArtilleryStrikeLimit, bPlayerMustReady, NorthEastBounds, SouthWestBounds, RoundLimit;
|
||||
|
||||
// end _RO_
|
||||
}
|
||||
|
||||
simulated function PostNetBeginPlay()
|
||||
{
|
||||
local PlayerReplicationInfo PRI;
|
||||
|
||||
|
||||
Level.GRI = self;
|
||||
|
||||
if ( VoiceReplicationInfo == None )
|
||||
foreach DynamicActors(class'VoiceChatReplicationInfo', VoiceReplicationInfo)
|
||||
break;
|
||||
|
||||
ForEach DynamicActors(class'PlayerReplicationInfo',PRI)
|
||||
AddPRI(PRI);
|
||||
|
||||
if ( Level.NetMode == NM_Client )
|
||||
TeamSymbolNotify();
|
||||
}
|
||||
|
||||
simulated function TeamSymbolNotify()
|
||||
{
|
||||
local Actor A;
|
||||
if ( TeamSymbols[0] == None )
|
||||
return;
|
||||
bTeamSymbolsUpdated = true;
|
||||
ForEach AllActors(class'Actor', A)
|
||||
A.SetGRI(self);
|
||||
}
|
||||
|
||||
simulated function UpdatePrecacheMaterials()
|
||||
{
|
||||
Level.AddPrecacheMaterial(TeamSymbols[0]);
|
||||
Level.AddPrecacheMaterial(TeamSymbols[1]);
|
||||
}
|
||||
|
||||
simulated function PostBeginPlay()
|
||||
{
|
||||
super.PostBeginPlay();
|
||||
MessageOfTheDay = repl(MessageOfTheDay, chr(160),' ');
|
||||
|
||||
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 = "";
|
||||
MessageOfTheDay = "";
|
||||
}
|
||||
|
||||
SecondCount = Level.TimeSeconds;
|
||||
SetTimer(Level.TimeDilation, true);
|
||||
}
|
||||
|
||||
/* Reset()
|
||||
reset actor to initial state - used when restarting level without reloading.
|
||||
*/
|
||||
function Reset()
|
||||
{
|
||||
Super.Reset();
|
||||
Winner = None;
|
||||
}
|
||||
|
||||
simulated function Timer()
|
||||
{
|
||||
local int i;
|
||||
local PlayerReplicationInfo OldHolder[2];
|
||||
local Controller C;
|
||||
|
||||
if ( Level.NetMode == NM_Client )
|
||||
{
|
||||
ElapsedTime++;
|
||||
if ( RemainingMinute != 0 )
|
||||
{
|
||||
RemainingTime = RemainingMinute;
|
||||
RemainingMinute = 0;
|
||||
}
|
||||
if ( (RemainingTime > 0) && !bStopCountDown )
|
||||
RemainingTime--;
|
||||
if ( !bTeamSymbolsUpdated )
|
||||
TeamSymbolNotify();
|
||||
SetTimer(Level.TimeDilation, true);
|
||||
}
|
||||
else if ( Level.NetMode != NM_Standalone )
|
||||
{
|
||||
OldHolder[0] = FlagHolder[0];
|
||||
OldHolder[1] = FlagHolder[1];
|
||||
FlagHolder[0] = None;
|
||||
FlagHolder[1] = None;
|
||||
for ( i=0; i<PRIArray.length; i++ )
|
||||
if ( (PRIArray[i].HasFlag != None) && (PRIArray[i].Team != None) )
|
||||
FlagHolder[PRIArray[i].Team.TeamIndex] = PRIArray[i];
|
||||
|
||||
for ( i=0; i<2; i++ )
|
||||
if ( OldHolder[i] != FlagHolder[i] )
|
||||
{
|
||||
for ( C=Level.ControllerList; C!=None; C=C.NextController )
|
||||
if ( PlayerController(C) != None )
|
||||
PlayerController(C).ClientUpdateFlagHolder(FlagHolder[i],i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
simulated function PlayerReplicationInfo FindPlayerByID( int PlayerID )
|
||||
{
|
||||
local int i;
|
||||
|
||||
for( i=0; i<PRIArray.Length; i++ )
|
||||
{
|
||||
if( PRIArray[i].PlayerID == PlayerID )
|
||||
return PRIArray[i];
|
||||
}
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
simulated function AddPRI(PlayerReplicationInfo PRI)
|
||||
{
|
||||
local byte NewVoiceID;
|
||||
local int i;
|
||||
|
||||
if ( Level.NetMode == NM_ListenServer || Level.NetMode == NM_DedicatedServer )
|
||||
{
|
||||
for (i = 0; i < PRIArray.Length; i++)
|
||||
{
|
||||
if ( PRIArray[i].VoiceID == NewVoiceID )
|
||||
{
|
||||
i = -1;
|
||||
NewVoiceID++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( NewVoiceID >= 32 )
|
||||
NewVoiceID = 0;
|
||||
|
||||
PRI.VoiceID = NewVoiceID;
|
||||
}
|
||||
|
||||
PRIArray[PRIArray.Length] = PRI;
|
||||
}
|
||||
|
||||
simulated function RemovePRI(PlayerReplicationInfo PRI)
|
||||
{
|
||||
local int i;
|
||||
|
||||
for (i=0; i<PRIArray.Length; i++)
|
||||
{
|
||||
if (PRIArray[i] == PRI)
|
||||
{
|
||||
PRIArray.Remove(i,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
log("GameReplicationInfo::RemovePRI() pri="$PRI$" not found.", 'Error');
|
||||
}
|
||||
|
||||
simulated function GetPRIArray(out array<PlayerReplicationInfo> pris)
|
||||
{
|
||||
local int i;
|
||||
local int num;
|
||||
|
||||
pris.Remove(0, pris.Length);
|
||||
for (i=0; i<PRIArray.Length; i++)
|
||||
{
|
||||
if (PRIArray[i] != None)
|
||||
pris[num++] = PRIArray[i];
|
||||
}
|
||||
}
|
||||
|
||||
static function FillPlayInfo(PlayInfo PlayInfo)
|
||||
{
|
||||
local int i;
|
||||
|
||||
Super.FillPlayInfo(PlayInfo); // Always begin with calling parent
|
||||
|
||||
PlayInfo.AddSetting(default.ServerGroup, "ServerName", default.GRIPropsDisplayText[i++], 255, 1, "Text", "60",,True);
|
||||
PlayInfo.AddSetting(default.ServerGroup, "AdminName", default.GRIPropsDisplayText[i++], 255, 1, "Text", "40",,True,True);
|
||||
PlayInfo.AddSetting(default.ServerGroup, "AdminEmail", default.GRIPropsDisplayText[i++], 255, 1, "Text", "60",,True,True);
|
||||
PlayInfo.AddSetting(default.ServerGroup, "MessageOfTheDay", default.GRIPropsDisplayText[i++], 251, 1, "Custom","255;;GUI2K4.MOTDConfigPage",,True,True);
|
||||
}
|
||||
|
||||
static event string GetDescriptionText(string PropName)
|
||||
{
|
||||
switch (PropName)
|
||||
{
|
||||
case "ServerName": return default.GRIPropDescText[0];
|
||||
case "AdminName": return default.GRIPropDescText[1];
|
||||
case "AdminEmail": return default.GRIPropDescText[2];
|
||||
case "MessageOfTheDay": return default.GRIPropDescText[3];
|
||||
}
|
||||
|
||||
return Super.GetDescriptionText(PropName);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
FlagState[0]=FLAG_Home
|
||||
FlagState[1]=FLAG_Home
|
||||
bStopCountDown=true
|
||||
RemoteRole=ROLE_SimulatedProxy
|
||||
bAlwaysRelevant=True
|
||||
ServerName="Killing Floor Server"
|
||||
ShortName="Server"
|
||||
MessageOfTheDay=""
|
||||
AdminEmail="Non-disclosed"
|
||||
|
||||
GRIPropsDisplayText(0)="Server Name"
|
||||
GRIPropsDisplayText(1)="Admin Name"
|
||||
GRIPropsDisplayText(2)="Admin E-Mail"
|
||||
GRIPropsDisplayText(3)="MOTD"
|
||||
|
||||
GRIPropDescText(0)="Server name shown on server browser."
|
||||
GRIPropDescText(1)="Server administrator's name"
|
||||
GRIPropDescText(2)="Server administrator's email address."
|
||||
GRIPropDescText(3)="Message of the Day"
|
||||
WeaponBerserk=+1.0
|
||||
|
||||
BotDifficulty=-1
|
||||
}
|
||||
135
kf_sources/Engine/Classes/GameRules.uc
Normal file
135
kf_sources/Engine/Classes/GameRules.uc
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
//=============================================================================
|
||||
// GameRules.
|
||||
//
|
||||
// The GameRules class handles game rule modifications for the GameInfo such as scoring,
|
||||
// finding player starts, and damage modification.
|
||||
//
|
||||
//=============================================================================
|
||||
class GameRules extends Info;
|
||||
|
||||
var GameRules NextGameRules;
|
||||
|
||||
function AddGameRules(GameRules GR)
|
||||
{
|
||||
if ( NextGameRules == None )
|
||||
NextGameRules = GR;
|
||||
else
|
||||
NextGameRules.AddGameRules(GR);
|
||||
}
|
||||
|
||||
/* Override GameInfo FindPlayerStart() - called by GameInfo.FindPlayerStart()
|
||||
if a NavigationPoint is returned, it will be used as the playerstart
|
||||
*/
|
||||
function NavigationPoint FindPlayerStart( Controller Player, optional byte InTeam, optional string incomingName )
|
||||
{
|
||||
if ( NextGameRules != None )
|
||||
return NextGameRules.FindPlayerStart(Player,InTeam,incomingName);
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
/* return string containing game rules information
|
||||
*/
|
||||
function string GetRules()
|
||||
{
|
||||
local string ResultSet;
|
||||
|
||||
if ( NextGameRules == None )
|
||||
ResultSet = ResultSet$NextGameRules.GetRules();
|
||||
|
||||
return ResultSet;
|
||||
}
|
||||
|
||||
//
|
||||
// server querying
|
||||
// append the mutator name- only used if mutator adds me and deletes itself.
|
||||
function GetServerDetails( out GameInfo.ServerResponseLine ServerState );
|
||||
|
||||
//
|
||||
// Restart the game.
|
||||
//
|
||||
function bool HandleRestartGame()
|
||||
{
|
||||
if ( (NextGameRules != None) && NextGameRules.HandleRestartGame() )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* CheckEndGame()
|
||||
Allows modification of game ending conditions. Return false to prevent game from ending
|
||||
*/
|
||||
function bool CheckEndGame(PlayerReplicationInfo Winner, string Reason)
|
||||
{
|
||||
if ( NextGameRules != None )
|
||||
return NextGameRules.CheckEndGame(Winner,Reason);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* CheckScore()
|
||||
see if this score means the game ends
|
||||
return true to override gameinfo checkscore, or if game was ended (with a call to Level.Game.EndGame() )
|
||||
*/
|
||||
function bool CheckScore(PlayerReplicationInfo Scorer)
|
||||
{
|
||||
if ( NextGameRules != None )
|
||||
return NextGameRules.CheckScore(Scorer);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* OverridePickupQuery()
|
||||
when pawn wants to pickup something, gamerules given a chance to modify it. If this function
|
||||
returns true, bAllowPickup will determine if the object can be picked up.
|
||||
*/
|
||||
function bool OverridePickupQuery(Pawn Other, Pickup item, out byte bAllowPickup)
|
||||
{
|
||||
if ( (NextGameRules != None) && NextGameRules.OverridePickupQuery(Other, item, bAllowPickup) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool PreventDeath(Pawn Killed, Controller Killer, class<DamageType> damageType, vector HitLocation)
|
||||
{
|
||||
if ( (NextGameRules != None) && NextGameRules.PreventDeath(Killed,Killer, damageType,HitLocation) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool PreventSever(Pawn Killed, Name boneName, int Damage, class<DamageType> DamageType)
|
||||
{
|
||||
if ( (NextGameRules != None) && NextGameRules.PreventSever(Killed, boneName, Damage, DamageType) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function ScoreObjective(PlayerReplicationInfo Scorer, Int Score)
|
||||
{
|
||||
if ( NextGameRules != None )
|
||||
NextGameRules.ScoreObjective(Scorer,Score);
|
||||
}
|
||||
|
||||
function ScoreKill(Controller Killer, Controller Killed)
|
||||
{
|
||||
if ( NextGameRules != None )
|
||||
NextGameRules.ScoreKill(Killer,Killed);
|
||||
}
|
||||
|
||||
function bool CriticalPlayer(Controller Other)
|
||||
{
|
||||
if ( (NextGameRules != None) && (NextGameRules.CriticalPlayer(Other)) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
|
||||
{
|
||||
if ( NextGameRules != None )
|
||||
return NextGameRules.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
|
||||
return Damage;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
394
kf_sources/Engine/Classes/GameStats.uc
Normal file
394
kf_sources/Engine/Classes/GameStats.uc
Normal file
|
|
@ -0,0 +1,394 @@
|
|||
// ====================================================================
|
||||
// Class: Engine.GameStats
|
||||
// Parent: Engine.Info
|
||||
//
|
||||
// the GameStats object is used to send individual stat events to the
|
||||
// stats server. Each game should spawn a GameStats object if it
|
||||
// wishes to have stat logging.
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
class GameStats extends Info
|
||||
Native Config;
|
||||
|
||||
var FileLog TempLog;
|
||||
var GameReplicationInfo GRI;
|
||||
var bool bShowBots;
|
||||
|
||||
var string Tab;
|
||||
|
||||
/** create local stat logs */
|
||||
var globalconfig bool bLocalLog;
|
||||
/** filename to use, check GetLogFilename() for replacements */
|
||||
var globalconfig string LogFileName;
|
||||
|
||||
native final function string GetStatsIdentifier( Controller C );
|
||||
native final function string GetMapFileName(); // Returns the name of the current map
|
||||
|
||||
/////////////////////////////////////
|
||||
// GameStats interface
|
||||
|
||||
function Init()
|
||||
{
|
||||
if (bLocalLog)
|
||||
{
|
||||
TempLog = spawn(class 'FileLog');
|
||||
if (TempLog != None)
|
||||
{
|
||||
TempLog.OpenLog(GetLogFilename());
|
||||
}
|
||||
else {
|
||||
Warn("Could not create output file");
|
||||
}
|
||||
}
|
||||
}
|
||||
function Shutdown()
|
||||
{
|
||||
if (TempLog!=None)
|
||||
TempLog.Destroy();
|
||||
}
|
||||
function Logf(string LogString)
|
||||
{
|
||||
if (TempLog!=None)
|
||||
TempLog.Logf(LogString);
|
||||
}
|
||||
|
||||
/////////////////////////////////////
|
||||
// Internals
|
||||
|
||||
event PostBeginPlay()
|
||||
{
|
||||
Super.PostBeginPlay();
|
||||
|
||||
Tab = Chr(9);
|
||||
Init();
|
||||
}
|
||||
|
||||
event Destroyed()
|
||||
{
|
||||
Shutdown();
|
||||
Super.Destroyed();
|
||||
}
|
||||
|
||||
function string TimeStamp()
|
||||
{
|
||||
local string seconds;
|
||||
seconds = string(Level.TimeSeconds);
|
||||
|
||||
// Remove the centiseconds
|
||||
if( InStr(seconds,".") != -1 )
|
||||
seconds = Left( seconds, InStr(seconds,".") );
|
||||
|
||||
return seconds;
|
||||
}
|
||||
|
||||
function string Header()
|
||||
{
|
||||
return TimeStamp()$Tab;
|
||||
}
|
||||
|
||||
function String FullTimeDate() // Date/Time in MYSQL format
|
||||
{
|
||||
return Level.Year$"-"$Level.Month$"-"$Level.Day$" "$Level.Hour$":"$Level.Minute$":"$Level.Second;
|
||||
}
|
||||
|
||||
function String TimeZone() // Timezone (offset) of game server's local time to GTM, e.g. -4 or +5
|
||||
{
|
||||
return "0"; // FIXME Jack - currently pretending GMT
|
||||
}
|
||||
|
||||
function String MapName()
|
||||
{
|
||||
local string mapname;
|
||||
|
||||
mapname = GetMapFileName();
|
||||
|
||||
// Remove the file name extention .ut2
|
||||
if( InStr(mapname,".ut2") != -1 )
|
||||
mapname = Left( mapname, InStr(mapname,".ut2") );
|
||||
|
||||
ReplaceText(mapname, tab, "_");
|
||||
|
||||
return mapname;
|
||||
}
|
||||
|
||||
|
||||
// Stat Logging functions
|
||||
function NewGame()
|
||||
{
|
||||
local string out, tmp;
|
||||
local string ngTitle, ngAuthor, ngGameGameName;
|
||||
local int i;
|
||||
local mutator MyMutie;
|
||||
local GameRules MyRules;
|
||||
|
||||
ngTitle = Level.Title; // Making local copies
|
||||
ngAuthor = Level.Author;
|
||||
ngGameGameName = Level.Game.GameName;
|
||||
ReplaceText(ngTitle, tab, "_"); // Replacing tabs with _
|
||||
ReplaceText(ngAuthor, tab, "_");
|
||||
ReplaceText(ngGameGameName, tab, "_");
|
||||
|
||||
GRI = Level.Game.GameReplicationInfo;
|
||||
out = Header()$"NG"$Tab; // "NewGame"
|
||||
out $= FullTimeDate()$Tab; // Game server's local time
|
||||
out $= TimeZone()$Tab; // Game server's time zone (offset to GMT)
|
||||
out $= MapName()$Tab; // Map file name without map extention .ut2
|
||||
out $= ngTitle$Tab;
|
||||
out $= ngAuthor$Tab;
|
||||
out $= Level.Game.Class$Tab;
|
||||
out $= ngGameGameName;
|
||||
|
||||
tmp = "";
|
||||
i = 0;
|
||||
foreach AllActors(class'Mutator',MyMutie)
|
||||
{
|
||||
if (tmp != "")
|
||||
tmp $= "|" $ MyMutie.Class;
|
||||
else
|
||||
tmp $= MyMutie.Class;
|
||||
|
||||
i++;
|
||||
}
|
||||
foreach AllActors(class'GameRules',MyRules)
|
||||
{
|
||||
if (tmp!="")
|
||||
tmp $= "|"$MyRules.Class;
|
||||
else
|
||||
tmp $= MyRules.Class;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i>0)
|
||||
{
|
||||
ReplaceText(tmp, tab, "_");
|
||||
out $= Tab $ "Mutators=" $ tmp;
|
||||
}
|
||||
Logf(out);
|
||||
}
|
||||
|
||||
function ServerInfo()
|
||||
{
|
||||
local string out, flags;
|
||||
local string siServerName, siAdminName, siAdminEmail;
|
||||
local GameInfo.ServerResponseLine ServerState;
|
||||
local int i;
|
||||
|
||||
siServerName = GRI.ServerName; // Making local copies
|
||||
siAdminName = GRI.AdminName;
|
||||
siAdminEmail = GRI.AdminEmail;
|
||||
ReplaceText(siServerName, tab, "_");
|
||||
ReplaceText(siAdminName, tab, "_");
|
||||
ReplaceText(siAdminEmail, tab, "_");
|
||||
|
||||
out = Header() $ "SI" $ Tab; // "SeverInfo"
|
||||
out $= siServerName $ Tab; // Server name
|
||||
out $= TimeZone()$Tab; // Timezone
|
||||
out $= siAdminName$Tab; // Admin name
|
||||
out $= siAdminEmail$Tab; // Admin email
|
||||
out $= Tab; // IP:port (filled in by Master Server)
|
||||
|
||||
flags = ""; // Server flag / key combos
|
||||
Level.Game.GetServerDetails( ServerState );
|
||||
for( i=0;i<ServerState.ServerInfo.Length;i++ )
|
||||
flags $= "\\"$ServerState.ServerInfo[i].Key$"\\"$ServerState.ServerInfo[i].Value;
|
||||
|
||||
ReplaceText(flags, tab, "_");
|
||||
out $= flags;
|
||||
Logf(out);
|
||||
}
|
||||
|
||||
function StartGame()
|
||||
{
|
||||
Logf( Header()$"SG" ); // "StartGame"
|
||||
}
|
||||
|
||||
|
||||
// Send stats for the end of the game
|
||||
function EndGame(string Reason)
|
||||
{
|
||||
local string out;
|
||||
local int i,j;
|
||||
local array<PlayerReplicationInfo> PRIs;
|
||||
local PlayerReplicationInfo PRI,t;
|
||||
|
||||
out = Header()$"EG"$Tab$Reason; // "EndGame"
|
||||
|
||||
// Quick cascade sort.
|
||||
for (i=0;i<GRI.PRIArray.Length;i++)
|
||||
{
|
||||
PRI = GRI.PRIArray[i];
|
||||
if ( !PRI.bOnlySpectator && !PRI.bBot )
|
||||
{
|
||||
PRIs.Length = PRIs.Length+1;
|
||||
for (j=0;j<Pris.Length-1;j++)
|
||||
{
|
||||
if (PRIs[j].Score < PRI.Score ||
|
||||
(PRIs[j].Score == PRI.Score && PRIs[j].Deaths > PRI.Deaths) )
|
||||
{
|
||||
t = PRIs[j];
|
||||
PRIs[j] = PRI;
|
||||
PRI = t;
|
||||
}
|
||||
}
|
||||
PRIs[j] = PRI;
|
||||
}
|
||||
}
|
||||
|
||||
// Minimal scoreboard, shows Playernumbers in order of Score
|
||||
for (i=0;i<PRIs.Length;i++)
|
||||
out $= Tab$Controller(PRIs[i].Owner).PlayerNum;
|
||||
|
||||
Logf(out);
|
||||
}
|
||||
|
||||
|
||||
// Connect Events get fired every time a player connects to a server
|
||||
function ConnectEvent(PlayerReplicationInfo Who)
|
||||
{
|
||||
local string out;
|
||||
if ( Who.bBot || Who.bOnlySpectator ) // Spectators should never show up in stats!
|
||||
return;
|
||||
|
||||
// C 0 11d8944d9e138a5aa688d503e0e4c3e0
|
||||
out = Header()$"C"$Tab$Controller(Who.Owner).PlayerNum$Tab;
|
||||
|
||||
// Login identifier
|
||||
out $= GetStatsIdentifier(Controller(Who.Owner));
|
||||
|
||||
Logf(out);
|
||||
}
|
||||
|
||||
// Connect Events get fired every time a player connects or leaves from a server
|
||||
function DisconnectEvent(PlayerReplicationInfo Who)
|
||||
{
|
||||
local string out;
|
||||
if ( Who.bBot || Who.bOnlySpectator ) // Spectators should never show up in stats!
|
||||
return;
|
||||
|
||||
// D 0
|
||||
out = Header()$"D"$Tab$Controller(Who.Owner).PlayerNum; //"Disconnect"
|
||||
|
||||
Logf(out);
|
||||
}
|
||||
|
||||
|
||||
// Scoring Events occur when a player's score changes
|
||||
function ScoreEvent(PlayerReplicationInfo Who, float Points, string Desc)
|
||||
{
|
||||
if ( Who.bBot || Who.bOnlySpectator ) // Just to be totally safe Spectators sends nothing
|
||||
return;
|
||||
Logf( Header()$"S"$Tab$Controller(Who.Owner).PlayerNum$Tab$Points$Tab$Desc ); //"Score"
|
||||
}
|
||||
|
||||
|
||||
function TeamScoreEvent(int Team, float Points, string Desc)
|
||||
{
|
||||
Logf( Header()$"T"$Tab$Team$Tab$Points$Tab$Desc ); //"TeamScore"
|
||||
}
|
||||
|
||||
|
||||
// KillEvents occur when a player kills, is killed, suicides
|
||||
function KillEvent(string Killtype, PlayerReplicationInfo Killer, PlayerReplicationInfo Victim, class<DamageType> Damage)
|
||||
{
|
||||
local string out;
|
||||
|
||||
if ( Victim.bBot || Victim.bOnlySpectator || ((Killer != None) && Killer.bBot) )
|
||||
return;
|
||||
|
||||
out = Header()$Killtype$Tab;
|
||||
|
||||
// KillerNumber and KillerDamagetype
|
||||
if (Killer!=None)
|
||||
{
|
||||
out $= Controller(Killer.Owner).PlayerNum$Tab;
|
||||
// KillerWeapon no longer used, using damagetype
|
||||
out $= GetItemName(string(Damage))$Tab;
|
||||
}
|
||||
else
|
||||
out $= "-1"$Tab$GetItemName(string(Damage))$Tab; // No PlayerNum -> -1, Environment "deaths"
|
||||
|
||||
// VictimNumber and VictimWeapon
|
||||
out $= Controller(Victim.Owner).PlayerNum$Tab$GetItemName(string(Controller(Victim.Owner).GetLastWeapon()));
|
||||
|
||||
// Type killers tracked as player event (redundant Typing, removed from kill line)
|
||||
if ( PlayerController(Victim.Owner)!= None && PlayerController(Victim.Owner).bIsTyping)
|
||||
{
|
||||
if ( PlayerController(Killer.Owner) != PlayerController(Victim.Owner) )
|
||||
SpecialEvent(Killer, "type_kill"); // Killer killed typing victim
|
||||
}
|
||||
|
||||
Logf(out);
|
||||
}
|
||||
|
||||
|
||||
// Special Events are everything else regarding the player
|
||||
function SpecialEvent(PlayerReplicationInfo Who, string Desc)
|
||||
{
|
||||
local string out;
|
||||
if (Who != None)
|
||||
{
|
||||
if ( Who.bBot || Who.bOnlySpectator ) // Avoid spectator suicide on console "type_kill"
|
||||
return;
|
||||
out = string(Controller(Who.Owner).PlayerNum);
|
||||
}
|
||||
else
|
||||
out = "-1";
|
||||
|
||||
Logf( Header()$"P"$Tab$out$Tab$Desc ); //"PSpecial"
|
||||
}
|
||||
|
||||
|
||||
// Special events regarding the game
|
||||
function GameEvent(string GEvent, string Desc, PlayerReplicationInfo Who)
|
||||
{
|
||||
local string out, geDesc;
|
||||
|
||||
if (Who != None)
|
||||
{
|
||||
if ( Who.bBot || Who.bOnlySpectator ) // Specator could cause NameChange, TeamChange! No longer.
|
||||
return;
|
||||
out = string(Controller(Who.Owner).PlayerNum);
|
||||
}
|
||||
else
|
||||
out = "-1";
|
||||
|
||||
geDesc = Desc;
|
||||
ReplaceText(geDesc, tab, "_"); // geDesc, can be the nickname!
|
||||
|
||||
Logf( Header()$"G"$Tab$GEvent$Tab$out$Tab$geDesc ); //"GSpecial"
|
||||
}
|
||||
|
||||
/**
|
||||
return the filename to use for the log file. The following formatting rules are accepted:
|
||||
%P server port
|
||||
%Y year
|
||||
%M month
|
||||
%D day
|
||||
%H hour
|
||||
%I minute
|
||||
%S second
|
||||
%W day of the week
|
||||
*/
|
||||
function string GetLogFilename()
|
||||
{
|
||||
local string result;
|
||||
result = LogFileName;
|
||||
ReplaceText(result, "%P", string(Level.Game.GetServerPort()));
|
||||
ReplaceText(result, "%N", Level.Game.GameReplicationInfo.ServerName);
|
||||
ReplaceText(result, "%Y", Right("0000"$string(Level.Year), 4));
|
||||
ReplaceText(result, "%M", Right("00"$string(Level.Month), 2));
|
||||
ReplaceText(result, "%D", Right("00"$string(Level.Day), 2));
|
||||
ReplaceText(result, "%H", Right("00"$string(Level.Hour), 2));
|
||||
ReplaceText(result, "%I", Right("00"$string(Level.Minute), 2));
|
||||
ReplaceText(result, "%W", Right("0"$string(Level.DayOfWeek), 1));
|
||||
ReplaceText(result, "%S", Right("00"$string(Level.Second), 2));
|
||||
return result;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bLocalLog=false
|
||||
LogFileName="Stats_%P_%Y_%M_%D_%H_%I_%S"
|
||||
}
|
||||
14
kf_sources/Engine/Classes/Gibbed.uc
Normal file
14
kf_sources/Engine/Classes/Gibbed.uc
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class Gibbed extends DamageType
|
||||
abstract;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DeathString="%o exploded in a shower of body parts"
|
||||
MaleSuicide="%o exploded in a shower of body parts"
|
||||
FemaleSuicide="%o exploded in a shower of body parts"
|
||||
|
||||
bAlwaysGibs=true
|
||||
GibPerterbation=1.0
|
||||
bLocationalHit=false
|
||||
bArmorStops=false
|
||||
}
|
||||
978
kf_sources/Engine/Classes/HUD.uc
Normal file
978
kf_sources/Engine/Classes/HUD.uc
Normal file
|
|
@ -0,0 +1,978 @@
|
|||
class Hud extends Actor
|
||||
native
|
||||
config(user)
|
||||
transient
|
||||
exportstructs;
|
||||
|
||||
var() PlayerController PlayerOwner;
|
||||
var() Pawn PawnOwner;
|
||||
var() PlayerReplicationInfo PawnOwnerPRI;
|
||||
var() Console PlayerConsole;
|
||||
|
||||
var() Scoreboard ScoreBoard;
|
||||
var() Scoreboard LocalStatsScreen;
|
||||
|
||||
// mini hud-menus
|
||||
var() Actor VoteMenu; // hook for mod authors
|
||||
|
||||
var color WhiteColor, RedColor, GreenColor, CyanColor, BlueColor, GoldColor, PurpleColor, TurqColor, GrayColor, BlackColor;
|
||||
|
||||
var() bool bShowVoteMenu;
|
||||
var() globalconfig bool bHideHUD;
|
||||
var() bool bShowScoreBoard; // Display current score-board instead of Hud elements
|
||||
var() bool bShowDebugInfo; // if true, show properties of current ViewTarget
|
||||
var() bool bShowBadConnectionAlert; // Display indication of bad connection
|
||||
var() globalconfig bool bMessageBeep;
|
||||
var() globalconfig bool bShowWeaponInfo;
|
||||
var() globalconfig bool bShowPersonalInfo;
|
||||
var() globalconfig bool bShowPoints;
|
||||
var() globalconfig bool bShowWeaponBar;
|
||||
var() globalconfig bool bCrosshairShow;
|
||||
// if _RO_
|
||||
// those arn't config variables in RO
|
||||
var() bool bShowPortrait;
|
||||
var() bool bShowPortraitVC; // show portrait for voice chat
|
||||
// else
|
||||
//var() globalconfig bool bShowPortrait;
|
||||
//var() globalconfig bool bShowPortraitVC; // show portrait for voice chat
|
||||
// end if _RO_
|
||||
var globalconfig bool bNoEnemyNames;
|
||||
var globalconfig bool bSmallWeaponBar;
|
||||
|
||||
var bool bBuiltMOTD; // Set to true when the MOTD has been set
|
||||
var bool bShowLocalStats;
|
||||
|
||||
var() Color ConsoleColor;
|
||||
var PlayerReplicationInfo PortraitPRI;
|
||||
|
||||
var() localized string ProgressFontName;
|
||||
var() Font ProgressFontFont;
|
||||
var() localized string OverrideConsoleFontName;
|
||||
var() Font OverrideConsoleFont;
|
||||
var() float ProgressFadeTime;
|
||||
var() Color MOTDColor;
|
||||
|
||||
var() globalconfig float HudScale; // Global Scale for all widgets
|
||||
var() globalconfig float HudOpacity; // make everything transparent
|
||||
var() globalconfig float HudCanvasScale; // Specifies amount of screen-space to use (for TV's).
|
||||
var() globalconfig int CrosshairStyle;
|
||||
var() globalconfig float CrosshairScale;
|
||||
var() globalconfig float CrosshairOpacity;
|
||||
var() globalconfig color CrossHairColor;
|
||||
|
||||
var transient float ResScaleX, ResScaleY;
|
||||
var globalconfig int ConsoleMessageCount;
|
||||
var globalconfig int ConsoleFontSize;
|
||||
var globalconfig int MessageFontOffset;
|
||||
|
||||
struct ConsoleMessage
|
||||
{
|
||||
var string Text;
|
||||
var color TextColor;
|
||||
var float MessageLife;
|
||||
var PlayerReplicationInfo PRI;
|
||||
};
|
||||
var ConsoleMessage TextMessages[8];
|
||||
|
||||
var() float ConsoleMessagePosX, ConsoleMessagePosY; // DP_LowerLeft
|
||||
|
||||
var localized string FontArrayNames[9];
|
||||
var Font FontArrayFonts[9];
|
||||
var int FontScreenWidthMedium[9];
|
||||
var int FontScreenWidthSmall[9];
|
||||
|
||||
var string MOTD[4]; // Holds the expanded MOTD Lines
|
||||
var int MOTDState;
|
||||
var float LastPickupTime, LastAmmoPickupTime, LastWeaponPickupTime, LastHealthPickupTime, LastArmorPickupTime;
|
||||
|
||||
/* Voice Chat - all are set natively
|
||||
*/
|
||||
var const float LastVoiceGain;
|
||||
var const float LastVoiceGainTime;
|
||||
var int LastPlayerIDTalking;
|
||||
var const float LastPlayerIDTalkingTime;
|
||||
|
||||
var SceneSubtitles SubTitles;
|
||||
|
||||
var array<HudOverlay> Overlays;
|
||||
|
||||
/* Draw3DLine()
|
||||
draw line in world space. Should be used when engine calls RenderWorldOverlays() event.
|
||||
*/
|
||||
native final function Draw3DLine(vector Start, vector End, color LineColor);
|
||||
native final function DrawCanvasLine(float X1, float Y1, float X2, float Y2, color LineColor);
|
||||
native static final function StaticDrawCanvasLine( Canvas C, float X1, float Y1, float X2, float Y2, color LineColor );
|
||||
|
||||
delegate OnPostRender(HUD Sender, Canvas C); // Called when PostRender is finished
|
||||
delegate OnBuildMOTD(HUD Sender); // Called when building the message of the day
|
||||
|
||||
function DrawCustomBeacon(Canvas C, Pawn P, float ScreenLocX, float ScreenLocY)
|
||||
{
|
||||
local texture BeaconTex;
|
||||
local float XL,YL;
|
||||
|
||||
BeaconTex = PlayerOwner.TeamBeaconTexture;
|
||||
if ( (BeaconTex == None) || (P.PlayerReplicationInfo == None) )
|
||||
return;
|
||||
|
||||
if ( P.PlayerReplicationInfo.Team != None )
|
||||
C.DrawColor = class'PlayerController'.Default.TeamBeaconTeamColors[P.PlayerReplicationInfo.Team.TeamIndex];
|
||||
else
|
||||
C.DrawColor = class'PlayerController'.Default.TeamBeaconTeamColors[0];
|
||||
|
||||
C.StrLen(P.PlayerReplicationInfo.PlayerName, XL, YL);
|
||||
C.SetPos(ScreenLocX - 0.5*XL , ScreenLocY - 0.125 * BeaconTex.VSize - YL);
|
||||
C.DrawText(P.PlayerReplicationInfo.PlayerName,true);
|
||||
|
||||
C.SetPos(ScreenLocX - 0.125 * BeaconTex.USize, ScreenLocY - 0.125 * BeaconTex.VSize);
|
||||
C.DrawTile(BeaconTex,
|
||||
0.25 * BeaconTex.USize,
|
||||
0.25 * BeaconTex.VSize,
|
||||
0.0,
|
||||
0.0,
|
||||
BeaconTex.USize,
|
||||
BeaconTex.VSize);
|
||||
}
|
||||
|
||||
simulated function BuildMOTD()
|
||||
{
|
||||
local int i;
|
||||
local array<string> InMOTD;
|
||||
|
||||
if (!bBuiltMOTD)
|
||||
OnBuildMOTD(self);
|
||||
|
||||
if (bBuiltMOTD || PlayerOwner==None || PlayerOwner.GameReplicationInfo==None)
|
||||
return;
|
||||
|
||||
bBuiltMOTD = true;
|
||||
PlayerOwner.SetProgressTime(6);
|
||||
|
||||
Split(PlayerOwner.GameReplicationInfo.MessageOfTheDay, "|", InMOTD);
|
||||
for ( i = 0; i < InMOTD.Length && i < ArrayCount(MOTD); i++ )
|
||||
MOTD[i] = InMOTD[i];
|
||||
}
|
||||
|
||||
|
||||
simulated event PostBeginPlay()
|
||||
{
|
||||
Super.PostBeginPlay();
|
||||
LinkActors ();
|
||||
CreateKeyMenus();
|
||||
|
||||
ForEach AllActors(class'SceneSubTitles', SubTitles)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Reset()
|
||||
reset actor to initial state - used when restarting level without reloading.
|
||||
*/
|
||||
function Reset()
|
||||
{
|
||||
bShowVoteMenu = false;
|
||||
bShowScoreboard = false;
|
||||
Super.Reset();
|
||||
}
|
||||
|
||||
simulated function CreateKeyMenus();
|
||||
|
||||
simulated event Destroyed()
|
||||
{
|
||||
if( ScoreBoard != None )
|
||||
{
|
||||
ScoreBoard.Destroy();
|
||||
ScoreBoard = None;
|
||||
}
|
||||
|
||||
if( VoteMenu != None )
|
||||
{
|
||||
VoteMenu.Destroy();
|
||||
VoteMenu = None;
|
||||
}
|
||||
|
||||
Super.Destroyed();
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Execs
|
||||
|
||||
/* toggles displaying scoreboard
|
||||
*/
|
||||
exec function ShowScores()
|
||||
{
|
||||
bShowScoreboard = !bShowScoreboard;
|
||||
}
|
||||
|
||||
exec function ShowStats()
|
||||
{
|
||||
bShowLocalStats = !bShowLocalStats;
|
||||
}
|
||||
|
||||
exec function NextStats()
|
||||
{
|
||||
if ( LocalStatsScreen != None )
|
||||
LocalStatsScreen.NextStats();
|
||||
}
|
||||
|
||||
/* toggles displaying properties of player's current viewtarget
|
||||
*/
|
||||
exec function ShowDebug()
|
||||
{
|
||||
if( Level.NetMode != NM_Standalone )
|
||||
return;
|
||||
|
||||
bShowDebugInfo = !bShowDebugInfo;
|
||||
}
|
||||
|
||||
simulated event WorldSpaceOverlays()
|
||||
{
|
||||
if ( bShowDebugInfo && Pawn(PlayerOwner.ViewTarget) != None )
|
||||
DrawRoute();
|
||||
}
|
||||
|
||||
function CheckCountdown(GameReplicationInfo GRI);
|
||||
|
||||
event ConnectFailure(string FailCode, string URL)
|
||||
{
|
||||
PlayerOwner.ReceiveLocalizedMessage(class'FailedConnect', class'FailedConnect'.Static.GetFailSwitch(FailCode));
|
||||
}
|
||||
|
||||
function GetLocalStatsScreen();
|
||||
|
||||
simulated event PostRenderActors(canvas Canvas)
|
||||
{
|
||||
if ( PawnOwner != None )
|
||||
{
|
||||
if ( !PlayerOwner.bBehindView )
|
||||
{
|
||||
if ( PlayerOwner.bDemoOwner || ((Level.NetMode == NM_Client) && (PlayerOwner.Pawn != PawnOwner)) )
|
||||
PawnOwner.GetDemoRecordingWeapon();
|
||||
else
|
||||
CanvasDrawActors( Canvas, false );
|
||||
}
|
||||
else
|
||||
CanvasDrawActors( Canvas, false );
|
||||
}
|
||||
}
|
||||
|
||||
simulated event PostRender( canvas Canvas )
|
||||
{
|
||||
local float XPos, YPos;
|
||||
local plane OldModulate,OM;
|
||||
local color OldColor;
|
||||
local int i;
|
||||
|
||||
BuildMOTD();
|
||||
|
||||
OldModulate = Canvas.ColorModulate;
|
||||
OldColor = Canvas.DrawColor;
|
||||
|
||||
Canvas.ColorModulate.X = 1;
|
||||
Canvas.ColorModulate.Y = 1;
|
||||
Canvas.ColorModulate.Z = 1;
|
||||
Canvas.ColorModulate.W = HudOpacity/255;
|
||||
|
||||
LinkActors();
|
||||
|
||||
ResScaleX = Canvas.SizeX / 640.0;
|
||||
ResScaleY = Canvas.SizeY / 480.0;
|
||||
|
||||
CheckCountDown(PlayerOwner.GameReplicationInfo);
|
||||
|
||||
if ( PawnOwner != None && PawnOwner.bSpecialHUD )
|
||||
PawnOwner.DrawHud(Canvas);
|
||||
if ( bShowDebugInfo )
|
||||
{
|
||||
Canvas.Font = GetConsoleFont(Canvas);
|
||||
Canvas.Style = ERenderStyle.STY_Alpha;
|
||||
Canvas.DrawColor = ConsoleColor;
|
||||
|
||||
PlayerOwner.ViewTarget.DisplayDebug(Canvas, XPos, YPos);
|
||||
if (PlayerOwner.ViewTarget != PlayerOwner && (Pawn(PlayerOwner.ViewTarget) == None || Pawn(PlayerOwner.ViewTarget).Controller == None))
|
||||
{
|
||||
YPos += XPos * 2;
|
||||
Canvas.SetPos(4, YPos);
|
||||
Canvas.DrawText("----- VIEWER INFO -----");
|
||||
YPos += XPos;
|
||||
Canvas.SetPos(4, YPos);
|
||||
PlayerOwner.DisplayDebug(Canvas, XPos, YPos);
|
||||
}
|
||||
}
|
||||
else if( !bHideHud )
|
||||
{
|
||||
if ( bShowLocalStats )
|
||||
{
|
||||
if ( LocalStatsScreen == None )
|
||||
GetLocalStatsScreen();
|
||||
if ( LocalStatsScreen != None )
|
||||
{
|
||||
OM = Canvas.ColorModulate;
|
||||
Canvas.ColorModulate = OldModulate;
|
||||
LocalStatsScreen.DrawScoreboard(Canvas);
|
||||
DisplayMessages(Canvas);
|
||||
Canvas.ColorModulate = OM;
|
||||
}
|
||||
}
|
||||
else if (bShowScoreBoard)
|
||||
{
|
||||
if (ScoreBoard != None)
|
||||
{
|
||||
OM = Canvas.ColorModulate;
|
||||
Canvas.ColorModulate = OldModulate;
|
||||
ScoreBoard.DrawScoreboard(Canvas);
|
||||
if ( Scoreboard.bDisplayMessages )
|
||||
DisplayMessages(Canvas);
|
||||
Canvas.ColorModulate = OM;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (PlayerOwner == None) || (PawnOwner == None) || (PawnOwnerPRI == None) || (PlayerOwner.IsSpectating() && PlayerOwner.bBehindView) )
|
||||
DrawSpectatingHud(Canvas);
|
||||
else if( !PawnOwner.bHideRegularHUD )
|
||||
DrawHud(Canvas);
|
||||
|
||||
for (i = 0; i < Overlays.length; i++)
|
||||
Overlays[i].Render(Canvas);
|
||||
|
||||
if (!DrawLevelAction (Canvas))
|
||||
{
|
||||
if (PlayerOwner!=None)
|
||||
{
|
||||
if (PlayerOwner.ProgressTimeOut > Level.TimeSeconds)
|
||||
{
|
||||
DisplayProgressMessages (Canvas);
|
||||
}
|
||||
else if (MOTDState==1)
|
||||
MOTDState=2;
|
||||
}
|
||||
}
|
||||
|
||||
if (bShowBadConnectionAlert)
|
||||
DisplayBadConnectionAlert (Canvas);
|
||||
DisplayMessages(Canvas);
|
||||
|
||||
}
|
||||
|
||||
if( bShowVoteMenu && VoteMenu!=None )
|
||||
VoteMenu.RenderOverlays(Canvas);
|
||||
}
|
||||
else if ( PawnOwner != None )
|
||||
DrawInstructionGfx(Canvas);
|
||||
|
||||
|
||||
PlayerOwner.RenderOverlays(Canvas);
|
||||
|
||||
if (PlayerOwner.bViewingMatineeCinematic)
|
||||
DrawCinematicHUD(Canvas);
|
||||
|
||||
if ((PlayerConsole != None) && PlayerConsole.bTyping)
|
||||
DrawTypingPrompt(Canvas, PlayerConsole.TypedStr, PlayerConsole.TypedStrPos);
|
||||
|
||||
Canvas.ColorModulate=OldModulate;
|
||||
Canvas.DrawColor = OldColor;
|
||||
|
||||
OnPostRender(Self, Canvas);
|
||||
}
|
||||
|
||||
// called when viewing a Matinee cinematic
|
||||
simulated function DrawCinematicHUD( Canvas C )
|
||||
{
|
||||
local int i;
|
||||
|
||||
if (!bHideHUD && !bShowLocalStats && !bShowScoreBoard)
|
||||
return; //already rendered any overlays
|
||||
|
||||
for (i = 0; i < Overlays.length; i++)
|
||||
Overlays[i].Render(C);
|
||||
}
|
||||
|
||||
simulated function DrawInstructionGfx( Canvas C );
|
||||
simulated function SetInstructionText( string text );
|
||||
simulated function SetInstructionKeyText( string text );
|
||||
|
||||
/* Specific function to use Canvas.DrawActor()
|
||||
Clear Z-Buffer once, prior to rendering all actors */
|
||||
function CanvasDrawActors( Canvas C, bool bClearedZBuffer )
|
||||
{
|
||||
if ( !PlayerOwner.bBehindView && PawnOwner.Weapon != None )
|
||||
{
|
||||
if ( !bClearedZBuffer)
|
||||
C.DrawActor(None, false, true); // Clear the z-buffer here
|
||||
|
||||
PawnOwner.Weapon.RenderOverlays( C );
|
||||
}
|
||||
}
|
||||
|
||||
simulated function DrawRoute()
|
||||
{
|
||||
local int i;
|
||||
local Controller C;
|
||||
local vector Start, End, RealStart;;
|
||||
local bool bPath;
|
||||
|
||||
C = Pawn(PlayerOwner.ViewTarget).Controller;
|
||||
if ( C == None )
|
||||
return;
|
||||
if ( C.CurrentPath != None )
|
||||
Start = C.CurrentPath.Start.Location;
|
||||
else
|
||||
Start = PlayerOwner.ViewTarget.Location;
|
||||
RealStart = Start;
|
||||
|
||||
if ( C.bAdjusting )
|
||||
{
|
||||
Draw3DLine(C.Pawn.Location, C.AdjustLoc, class'Canvas'.Static.MakeColor(255,0,255));
|
||||
Start = C.AdjustLoc;
|
||||
}
|
||||
|
||||
// show where pawn is going
|
||||
if ( (C == PlayerOwner)
|
||||
|| (C.MoveTarget == C.RouteCache[0]) && (C.MoveTarget != None) )
|
||||
{
|
||||
if ( (C == PlayerOwner) && (C.Destination != vect(0,0,0)) )
|
||||
{
|
||||
if ( C.PointReachable(C.Destination) )
|
||||
{
|
||||
Draw3DLine(C.Pawn.Location, C.Destination, class'Canvas'.Static.MakeColor(255,255,255));
|
||||
return;
|
||||
}
|
||||
C.FindPathTo(C.Destination);
|
||||
}
|
||||
for ( i=0; i<16; i++ )
|
||||
{
|
||||
if ( C.RouteCache[i] == None )
|
||||
break;
|
||||
bPath = true;
|
||||
Draw3DLine(Start,C.RouteCache[i].Location,class'Canvas'.Static.MakeColor(0,255,0));
|
||||
Start = C.RouteCache[i].Location;
|
||||
}
|
||||
if ( bPath )
|
||||
Draw3DLine(RealStart,C.Destination,class'Canvas'.Static.MakeColor(255,255,255));
|
||||
}
|
||||
else if ( PlayerOwner.ViewTarget.Velocity != vect(0,0,0) )
|
||||
Draw3DLine(RealStart,C.Destination,class'Canvas'.Static.MakeColor(255,255,255));
|
||||
|
||||
if ( C == PlayerOwner )
|
||||
return;
|
||||
|
||||
// show where pawn is looking
|
||||
if ( C.Focus != None )
|
||||
End = C.Focus.Location;
|
||||
else
|
||||
End = C.FocalPoint;
|
||||
Draw3DLine(PlayerOwner.ViewTarget.Location + Pawn(PlayerOwner.ViewTarget).BaseEyeHeight * vect(0,0,1),End,class'Canvas'.Static.MakeColor(255,0,0));
|
||||
}
|
||||
|
||||
simulated function DisplayProgressMessages (Canvas C)
|
||||
{
|
||||
local int i, LineCount;
|
||||
local GameReplicationInfo GRI;
|
||||
local float FontDX, FontDY;
|
||||
local float X, Y;
|
||||
local int Alpha;
|
||||
local float TimeLeft;
|
||||
|
||||
TimeLeft = PlayerOwner.ProgressTimeOut - Level.TimeSeconds;
|
||||
|
||||
if( TimeLeft >= ProgressFadeTime )
|
||||
Alpha = 255;
|
||||
else
|
||||
Alpha = (255 * TimeLeft) / ProgressFadeTime;
|
||||
|
||||
GRI = PlayerOwner.GameReplicationInfo;
|
||||
|
||||
LineCount = 0;
|
||||
|
||||
for (i = 0; i < ArrayCount (PlayerOwner.ProgressMessage); i++)
|
||||
{
|
||||
if (PlayerOwner.ProgressMessage[i] == "")
|
||||
continue;
|
||||
|
||||
LineCount++;
|
||||
}
|
||||
|
||||
if (bBuiltMOTD && MOTDState<2)
|
||||
{
|
||||
if (MOTD[0] != "") LineCount++;
|
||||
if (MOTD[1] != "") LineCount++;
|
||||
if (MOTD[2] != "") LineCount++;
|
||||
if (MOTD[3] != "") LineCount++;
|
||||
}
|
||||
|
||||
|
||||
C.Font = LoadProgressFont();
|
||||
|
||||
C.Style = ERenderStyle.STY_Alpha;
|
||||
|
||||
C.TextSize ("A", FontDX, FontDY);
|
||||
|
||||
X = (0.5 * HudCanvasScale * C.SizeX) + (((1.0 - HudCanvasScale) / 2.0) * C.SizeX);
|
||||
Y = (0.5 * HudCanvasScale * C.SizeY) + (((1.0 - HudCanvasScale) / 2.0) * C.SizeY);
|
||||
|
||||
Y -= FontDY * (float (LineCount) / 2.0);
|
||||
|
||||
for (i = 0; i < ArrayCount (PlayerOwner.ProgressMessage); i++)
|
||||
{
|
||||
if (PlayerOwner.ProgressMessage[i] == "")
|
||||
continue;
|
||||
|
||||
C.DrawColor = PlayerOwner.ProgressColor[i];
|
||||
C.DrawColor.A = Alpha;
|
||||
|
||||
C.TextSize (PlayerOwner.ProgressMessage[i], FontDX, FontDY);
|
||||
C.SetPos (X - (FontDX / 2.0), Y);
|
||||
C.DrawText (PlayerOwner.ProgressMessage[i]);
|
||||
|
||||
Y += FontDY;
|
||||
}
|
||||
|
||||
if( (GRI != None) && (Level.NetMode != NM_StandAlone) && (MOTDState<2) )
|
||||
{
|
||||
MOTDState=1;
|
||||
C.DrawColor = MOTDColor;
|
||||
C.DrawColor.A = Alpha;
|
||||
|
||||
for (i=0;i<4;i++)
|
||||
{
|
||||
C.TextSize (MOTD[i], FontDX, FontDY);
|
||||
C.SetPos (X - (FontDX / 2.0), Y);
|
||||
C.DrawText (MOTD[i]);
|
||||
Y += FontDY;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function DrawHud (Canvas C);
|
||||
function DrawSpectatingHud (Canvas C);
|
||||
function bool DrawLevelAction (Canvas C);
|
||||
|
||||
/* DisplayBadConnectionAlert()
|
||||
Warn user that net connection is bad
|
||||
*/
|
||||
function DisplayBadConnectionAlert (Canvas C);
|
||||
|
||||
function bool IsInCinematic();
|
||||
|
||||
simulated function LocalizedMessage( class<LocalMessage> Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject, optional string CriticalString );
|
||||
|
||||
simulated function DrawTypingPrompt (Canvas C, String Text, optional int Pos)
|
||||
{
|
||||
local float XPos, YPos;
|
||||
local float XL, YL;
|
||||
|
||||
C.Font = GetConsoleFont(C);
|
||||
C.Style = ERenderStyle.STY_Alpha;
|
||||
C.DrawColor = ConsoleColor;
|
||||
|
||||
C.TextSize ("A", XL, YL);
|
||||
|
||||
XPos = (ConsoleMessagePosX * HudCanvasScale * C.SizeX) + (((1.0 - HudCanvasScale) * 0.5) * C.SizeX);
|
||||
YPos = (ConsoleMessagePosY * HudCanvasScale * C.SizeY) + (((1.0 - HudCanvasScale) * 0.5) * C.SizeY) - YL;
|
||||
|
||||
C.SetPos (XPos, YPos);
|
||||
//C.DrawTextClipped ("(>"@Left(Text, Pos)$"_"$Right(Text, Len(Text) - Pos), false);
|
||||
C.DrawTextClipped("(>"@Left(Text, Pos)$chr(4)$Eval(Pos < Len(Text), Mid(Text, Pos), "_"), true);
|
||||
}
|
||||
|
||||
simulated function SetScoreBoardClass (class<Scoreboard> ScoreBoardClass)
|
||||
{
|
||||
if (ScoreBoard != None )
|
||||
ScoreBoard.Destroy();
|
||||
|
||||
if (ScoreBoardClass == None)
|
||||
ScoreBoard = None;
|
||||
else
|
||||
{
|
||||
ScoreBoard = Spawn (ScoreBoardClass, Owner);
|
||||
|
||||
if (ScoreBoard == None)
|
||||
log ("Hud::SetScoreBoard(): Could not spawn a scoreboard of class "$ScoreBoardClass, 'Error');
|
||||
}
|
||||
}
|
||||
|
||||
exec function ShowHud()
|
||||
{
|
||||
bHideHud = !bHideHud;
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
simulated function LinkActors()
|
||||
{
|
||||
PlayerOwner = PlayerController (Owner);
|
||||
|
||||
if (PlayerOwner == None)
|
||||
{
|
||||
PlayerConsole = None;
|
||||
PawnOwner = None;
|
||||
PawnOwnerPRI = None;
|
||||
return;
|
||||
}
|
||||
|
||||
if (PlayerOwner.Player != None)
|
||||
PlayerConsole = PlayerOwner.Player.Console;
|
||||
else
|
||||
PlayerConsole = None;
|
||||
|
||||
if ( (Pawn(PlayerOwner.ViewTarget) != None) &&
|
||||
(Pawn(PlayerOwner.ViewTarget).Health > 0) )
|
||||
PawnOwner = Pawn(PlayerOwner.ViewTarget);
|
||||
else if (PlayerOwner.Pawn != None )
|
||||
PawnOwner = PlayerOwner.Pawn;
|
||||
else
|
||||
PawnOwner = None;
|
||||
|
||||
if ( (PawnOwner != None) && (PawnOwner.PlayerReplicationInfo != None) )
|
||||
PawnOwnerPRI = PawnOwner.PlayerReplicationInfo;
|
||||
else
|
||||
PawnOwnerPRI = PlayerOwner.PlayerReplicationInfo;
|
||||
}
|
||||
|
||||
simulated function Message( PlayerReplicationInfo PRI, coerce string Msg, name MsgType )
|
||||
{
|
||||
if ( bMessageBeep )
|
||||
PlayerOwner.PlayBeepSound();
|
||||
if ( (MsgType == 'Say') || (MsgType == 'TeamSay') )
|
||||
Msg = PRI.PlayerName$": "$Msg;
|
||||
AddTextMessage(Msg,class'LocalMessage',PRI);
|
||||
}
|
||||
|
||||
function DisplayPortrait(PlayerReplicationInfo PRI);
|
||||
|
||||
function DisplayMessages(Canvas C)
|
||||
{
|
||||
local int i, j, XPos, YPos,MessageCount;
|
||||
local float XL, YL;
|
||||
|
||||
for( i = 0; i < ConsoleMessageCount; i++ )
|
||||
{
|
||||
if ( TextMessages[i].Text == "" )
|
||||
break;
|
||||
else if( TextMessages[i].MessageLife < Level.TimeSeconds )
|
||||
{
|
||||
TextMessages[i].Text = "";
|
||||
|
||||
if( i < ConsoleMessageCount - 1 )
|
||||
{
|
||||
for( j=i; j<ConsoleMessageCount-1; j++ )
|
||||
TextMessages[j] = TextMessages[j+1];
|
||||
}
|
||||
TextMessages[j].Text = "";
|
||||
break;
|
||||
}
|
||||
else
|
||||
MessageCount++;
|
||||
}
|
||||
|
||||
XPos = (ConsoleMessagePosX * HudCanvasScale * C.SizeX) + (((1.0 - HudCanvasScale) / 2.0) * C.SizeX);
|
||||
YPos = (ConsoleMessagePosY * HudCanvasScale * C.SizeY) + (((1.0 - HudCanvasScale) / 2.0) * C.SizeY);
|
||||
|
||||
C.Font = GetConsoleFont(C);
|
||||
C.DrawColor = ConsoleColor;
|
||||
|
||||
C.TextSize ("A", XL, YL);
|
||||
|
||||
YPos -= YL * MessageCount+1; // DP_LowerLeft
|
||||
YPos -= YL; // Room for typing prompt
|
||||
|
||||
for( i=0; i<MessageCount; i++ )
|
||||
{
|
||||
if ( TextMessages[i].Text == "" )
|
||||
break;
|
||||
|
||||
C.StrLen( TextMessages[i].Text, XL, YL );
|
||||
C.SetPos( XPos, YPos );
|
||||
C.DrawColor = TextMessages[i].TextColor;
|
||||
C.DrawText( TextMessages[i].Text, false );
|
||||
YPos += YL;
|
||||
}
|
||||
}
|
||||
|
||||
function AddTextMessage(string M, class<LocalMessage> MessageClass, PlayerReplicationInfo PRI)
|
||||
{
|
||||
local int i;
|
||||
|
||||
|
||||
if( bMessageBeep && MessageClass.Default.bBeep )
|
||||
PlayerOwner.PlayBeepSound();
|
||||
|
||||
for( i=0; i<ConsoleMessageCount; i++ )
|
||||
{
|
||||
if ( TextMessages[i].Text == "" )
|
||||
break;
|
||||
}
|
||||
|
||||
if( i == ConsoleMessageCount )
|
||||
{
|
||||
for( i=0; i<ConsoleMessageCount-1; i++ )
|
||||
TextMessages[i] = TextMessages[i+1];
|
||||
}
|
||||
|
||||
TextMessages[i].Text = M;
|
||||
TextMessages[i].MessageLife = Level.TimeSeconds + MessageClass.Default.LifeTime;
|
||||
TextMessages[i].TextColor = MessageClass.static.GetConsoleColor(PRI);
|
||||
TextMessages[i].PRI = PRI;
|
||||
}
|
||||
|
||||
exec function GrowHUD()
|
||||
{
|
||||
if( !bShowWeaponInfo )
|
||||
bShowWeaponInfo = true;
|
||||
else if( !bShowPersonalInfo )
|
||||
bShowPersonalInfo = true;
|
||||
else if( !bShowPoints )
|
||||
bShowPoints = true;
|
||||
else if ( !bShowWeaponBar )
|
||||
bShowWeaponBar = true;
|
||||
else if ( bSmallWeaponBar )
|
||||
bSmallWeaponBar = false;
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
exec function ShrinkHUD()
|
||||
{
|
||||
if ( !bSmallWeaponBar )
|
||||
bSmallWeaponBar = true;
|
||||
else if ( bShowWeaponBar )
|
||||
bShowWeaponBar = false;
|
||||
else if( bShowPoints )
|
||||
bShowPoints = false;
|
||||
else if( bShowPersonalInfo )
|
||||
bShowPersonalInfo = false;
|
||||
else if( bShowWeaponInfo )
|
||||
bShowWeaponInfo = false;
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
function FadeZoom();
|
||||
|
||||
simulated function SetTargeting( bool bShow, optional Vector TargetLocation, optional float Size );
|
||||
simulated function DrawCrosshair(Canvas C);
|
||||
simulated function SetCropping( bool Active );
|
||||
|
||||
|
||||
static function Font LoadFontStatic(int i)
|
||||
{
|
||||
if( default.FontArrayFonts[i] == None )
|
||||
{
|
||||
default.FontArrayFonts[i] = Font(DynamicLoadObject(default.FontArrayNames[i], class'Font'));
|
||||
if( default.FontArrayFonts[i] == None )
|
||||
Log("Warning: "$default.Class$" Couldn't dynamically load font "$default.FontArrayNames[i]);
|
||||
}
|
||||
|
||||
return default.FontArrayFonts[i];
|
||||
}
|
||||
|
||||
simulated function Font LoadFont(int i)
|
||||
{
|
||||
if( FontArrayFonts[i] == None )
|
||||
{
|
||||
FontArrayFonts[i] = Font(DynamicLoadObject(FontArrayNames[i], class'Font'));
|
||||
if( FontArrayFonts[i] == None )
|
||||
Log("Warning: "$Self$" Couldn't dynamically load font "$FontArrayNames[i]);
|
||||
}
|
||||
return FontArrayFonts[i];
|
||||
}
|
||||
|
||||
|
||||
static function font GetConsoleFont(Canvas C)
|
||||
{
|
||||
local int FontSize;
|
||||
|
||||
if( default.OverrideConsoleFontName != "" )
|
||||
{
|
||||
if( default.OverrideConsoleFont != None )
|
||||
return default.OverrideConsoleFont;
|
||||
default.OverrideConsoleFont = Font(DynamicLoadObject(default.OverrideConsoleFontName, class'Font'));
|
||||
if( default.OverrideConsoleFont != None )
|
||||
return default.OverrideConsoleFont;
|
||||
Log("Warning: HUD couldn't dynamically load font "$default.OverrideConsoleFontName);
|
||||
default.OverrideConsoleFontName = "";
|
||||
}
|
||||
|
||||
FontSize = Default.ConsoleFontSize;
|
||||
if ( C.ClipX < 640 )
|
||||
FontSize++;
|
||||
if ( C.ClipX < 800 )
|
||||
FontSize++;
|
||||
if ( C.ClipX < 1024 )
|
||||
FontSize++;
|
||||
if ( C.ClipX < 1280 )
|
||||
FontSize++;
|
||||
if ( C.ClipX < 1600 )
|
||||
FontSize++;
|
||||
return LoadFontStatic(Min(8,FontSize));
|
||||
}
|
||||
|
||||
function Font GetFontSizeIndex(Canvas C, int FontSize)
|
||||
{
|
||||
if ( C.ClipX >= 512 )
|
||||
FontSize++;
|
||||
if ( C.ClipX >= 640 )
|
||||
FontSize++;
|
||||
if ( C.ClipX >= 800 )
|
||||
FontSize++;
|
||||
if ( C.ClipX >= 1024 )
|
||||
FontSize++;
|
||||
if ( C.ClipX >= 1280 )
|
||||
FontSize++;
|
||||
if ( C.ClipX >= 1600 )
|
||||
FontSize++;
|
||||
|
||||
return LoadFont(Clamp( 8-FontSize, 0, 8));
|
||||
}
|
||||
|
||||
static function Font GetMediumFontFor(Canvas Canvas)
|
||||
{
|
||||
local int i;
|
||||
|
||||
for ( i=0; i<8; i++ )
|
||||
{
|
||||
if ( Default.FontScreenWidthMedium[i] <= Canvas.ClipX )
|
||||
return LoadFontStatic(i);
|
||||
}
|
||||
return LoadFontStatic(8);
|
||||
}
|
||||
|
||||
function Font GetMediumFont( float Size )
|
||||
{
|
||||
local int i;
|
||||
|
||||
for ( i=0; i<8; i++ )
|
||||
{
|
||||
if ( Default.FontScreenWidthMedium[i] <= Size )
|
||||
return LoadFontStatic(i);
|
||||
}
|
||||
return LoadFontStatic(8);
|
||||
}
|
||||
|
||||
static function Font LargerFontThan(Font aFont)
|
||||
{
|
||||
local int i;
|
||||
|
||||
for ( i=0; i<7; i++ )
|
||||
if ( LoadFontStatic(i) == aFont )
|
||||
return LoadFontStatic(Max(0,i-4));
|
||||
return LoadFontStatic(5);
|
||||
}
|
||||
|
||||
simulated function font LoadProgressFont()
|
||||
{
|
||||
if( ProgressFontFont == None )
|
||||
{
|
||||
ProgressFontFont = Font(DynamicLoadObject(ProgressFontName, class'Font'));
|
||||
if( ProgressFontFont == None )
|
||||
{
|
||||
Log("Warning: "$Self$" Couldn't dynamically load font "$ProgressFontName);
|
||||
ProgressFontFont = Font'DefaultFont';
|
||||
}
|
||||
}
|
||||
return ProgressFontFont;
|
||||
}
|
||||
|
||||
event AnnouncementPlayed( Name AnnouncerSound, byte Switch );
|
||||
|
||||
simulated function DrawTargeting( Canvas C );
|
||||
|
||||
function DisplayHit(vector HitDir, int Damage, class<DamageType> damageType)
|
||||
{
|
||||
if ( (PawnOwner != None) && (PawnOwner.ShieldStrength > 0) )
|
||||
PlayerOwner.ClientFlash(0.5,vect(700,700,0));
|
||||
else if ( Damage > 1 )
|
||||
PlayerOwner.ClientFlash(DamageType.Default.FlashScale,DamageType.Default.FlashFog);
|
||||
}
|
||||
|
||||
simulated function AddHudOverlay(HudOverlay Overlay)
|
||||
{
|
||||
local int i;
|
||||
|
||||
for (i = 0; i < Overlays.Length; i++)
|
||||
if (Overlays[i] == Overlay)
|
||||
return;
|
||||
|
||||
Overlays[Overlays.length] = Overlay;
|
||||
Overlay.SetOwner(self);
|
||||
}
|
||||
|
||||
simulated function RemoveHudOverlay(HudOverlay Overlay)
|
||||
{
|
||||
local int i;
|
||||
|
||||
for (i = 0; i < Overlays.length; i++)
|
||||
if (Overlays[i] == Overlay)
|
||||
{
|
||||
Overlays.Remove(i, 1);
|
||||
Overlay.SetOwner(None);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if _RO_
|
||||
// G15 Support - implemented in subclasses
|
||||
simulated event HandleG15SoftButtonPress( int PressedButton ){}
|
||||
|
||||
function ShowPopupNotification(float DisplayTime, int FontSize, string Text, optional texture Icon);
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bMessageBeep=true
|
||||
bHidden=True
|
||||
RemoteRole=ROLE_None
|
||||
|
||||
bHideHUD=false
|
||||
|
||||
ConsoleColor=(R=153,G=216,B=253,A=255)
|
||||
|
||||
ProgressFontName="ROFonts.ROBtsrmVr12"//"UT2003Fonts.FontEurostile12"
|
||||
MOTDColor=(R=255,G=255,B=255,A=255)
|
||||
ProgressFadeTime=1.0
|
||||
|
||||
HudCanvasScale=0.95
|
||||
HudScale=1.0
|
||||
|
||||
bShowWeaponInfo=true
|
||||
bShowPersonalInfo=true
|
||||
bShowPoints=true
|
||||
bShowWeaponBar=true
|
||||
bShowPortrait=true
|
||||
|
||||
bCrosshairShow=true
|
||||
CrosshairScale=1.0
|
||||
CrosshairOpacity=1.0
|
||||
CrosshairStyle=0
|
||||
CrossHairColor=(R=255,G=255,B=255,A=255)
|
||||
|
||||
ConsoleMessagePosX=0.00
|
||||
ConsoleMessagePosY=1.00
|
||||
|
||||
WhiteColor=(R=255,G=255,B=255,A=255)
|
||||
RedColor=(R=255,G=0,B=0,A=255)
|
||||
BlueColor=(R=0,G=0,B=255,A=255)
|
||||
GreenColor=(R=0,G=255,B=0,A=255)
|
||||
GoldColor=(R=255,G=255,B=0,A=255)
|
||||
TurqColor=(R=0,G=128,B=255,A=255)
|
||||
GrayColor=(R=200,G=200,B=200,A=255)
|
||||
CyanColor=(R=0,G=255,B=255,A=255)
|
||||
PurpleColor=(R=255,G=0,B=255,A=255)
|
||||
BlackColor=(R=0,G=0,B=0,A=255)
|
||||
|
||||
FontArrayNames(0)="Engine.DefaultFont"
|
||||
FontArrayNames(1)="Engine.DefaultFont"
|
||||
FontArrayNames(2)="Engine.DefaultFont"
|
||||
FontArrayNames(3)="Engine.DefaultFont"
|
||||
FontArrayNames(4)="Engine.DefaultFont"
|
||||
FontArrayNames(5)="Engine.DefaultFont"
|
||||
FontArrayNames(6)="Engine.DefaultFont"
|
||||
FontArrayNames(7)="Engine.DefaultFont"
|
||||
FontArrayNames(8)="Engine.DefaultFont"
|
||||
|
||||
HudOpacity=255
|
||||
ConsoleMessageCount=4
|
||||
ConsoleFontSize=5
|
||||
MessageFontOffset=0
|
||||
|
||||
bBuiltMOTD=false
|
||||
bShowPortraitVC=True
|
||||
}
|
||||
26
kf_sources/Engine/Classes/HoverPathNode.uc
Normal file
26
kf_sources/Engine/Classes/HoverPathNode.uc
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class HoverPathNode extends RoadPathNode
|
||||
native;
|
||||
|
||||
cpptext
|
||||
{
|
||||
virtual UBOOL NotReachableBy(APawn *P);
|
||||
}
|
||||
|
||||
event int SpecialCost(Pawn Other, ReachSpec Path)
|
||||
{
|
||||
if ( Other.bCanFly || (Vehicle(Other) != None && Vehicle(Other).bCanHover) )
|
||||
return 0;
|
||||
|
||||
return 100000000;
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
bForcedOnly=true
|
||||
bSpecialForced=true
|
||||
bNotBased=True
|
||||
CollisionHeight=120
|
||||
}
|
||||
24
kf_sources/Engine/Classes/HudOverlay.uc
Normal file
24
kf_sources/Engine/Classes/HudOverlay.uc
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// ====================================================================
|
||||
// Class: Engine.HudOverlay
|
||||
// Parent: Engine.Actor
|
||||
//
|
||||
// HudOverlays are used to display alternate information on the hud
|
||||
// ====================================================================
|
||||
|
||||
class HudOverlay extends Actor;
|
||||
|
||||
simulated function Render(Canvas C);
|
||||
|
||||
simulated function Destroyed()
|
||||
{
|
||||
if (HUD(Owner) != None)
|
||||
HUD(Owner).RemoveHudOverlay(self);
|
||||
|
||||
Super.Destroyed();
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bHidden=true
|
||||
RemoteRole=ROLE_None
|
||||
}
|
||||
75
kf_sources/Engine/Classes/I3DL2Listener.uc
Normal file
75
kf_sources/Engine/Classes/I3DL2Listener.uc
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
//=============================================================================
|
||||
// I3DL2Listener: Base class for I3DL2 room effects.
|
||||
//=============================================================================
|
||||
|
||||
class I3DL2Listener extends Object
|
||||
abstract
|
||||
editinlinenew
|
||||
native;
|
||||
|
||||
|
||||
var() float EnvironmentSize;
|
||||
var() float EnvironmentDiffusion;
|
||||
var() int Room;
|
||||
var() int RoomHF;
|
||||
var() int RoomLF;
|
||||
var() float DecayTime;
|
||||
var() float DecayHFRatio;
|
||||
var() float DecayLFRatio;
|
||||
var() int Reflections;
|
||||
var() float ReflectionsDelay;
|
||||
var() vector ReflectionsPan;
|
||||
var() int Reverb;
|
||||
var() float ReverbDelay;
|
||||
var() vector ReverbPan;
|
||||
var() float EchoTime;
|
||||
var() float EchoDepth;
|
||||
var() float ModulationTime;
|
||||
var() float ModulationDepth;
|
||||
var() float RoomRolloffFactor;
|
||||
var() float AirAbsorptionHF;
|
||||
var() float HFReference;
|
||||
var() float LFReference;
|
||||
var() bool bDecayTimeScale;
|
||||
var() bool bReflectionsScale;
|
||||
var() bool bReflectionsDelayScale;
|
||||
var() bool bReverbScale;
|
||||
var() bool bReverbDelayScale;
|
||||
var() bool bEchoTimeScale;
|
||||
var() bool bModulationTimeScale;
|
||||
var() bool bDecayHFLimit;
|
||||
|
||||
var transient int Environment;
|
||||
var transient int Updated;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
// Texture=S_Emitter
|
||||
EnvironmentSize=7.5
|
||||
EnvironmentDiffusion=1.0
|
||||
Room=-1000
|
||||
RoomHF=-100
|
||||
RoomLF=0
|
||||
DecayTime=1.49
|
||||
DecayHFRatio=0.83
|
||||
DecayLFRatio=1.00
|
||||
Reflections=-2602
|
||||
ReflectionsDelay=0.007
|
||||
Reverb=200
|
||||
ReverbDelay=0.011
|
||||
EchoTime=0.25
|
||||
EchoDepth=0.0
|
||||
ModulationTime=0.25
|
||||
ModulationDepth=0.0
|
||||
RoomRolloffFactor=0.0
|
||||
AirAbsorptionHF=-5
|
||||
HFReference=5000
|
||||
LFReference=250
|
||||
bDecayTimeScale=true
|
||||
bReflectionsScale=true
|
||||
bReflectionsDelayScale=true
|
||||
bReverbScale=true
|
||||
bReverbDelayScale=true
|
||||
bEchoTimeScale=true
|
||||
bDecayHFLimit=true
|
||||
}
|
||||
63
kf_sources/Engine/Classes/Info.uc
Normal file
63
kf_sources/Engine/Classes/Info.uc
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
//=============================================================================
|
||||
// Info, the root of all information holding classes.
|
||||
//=============================================================================
|
||||
class Info extends Actor
|
||||
abstract
|
||||
hidecategories(Movement,Collision,Lighting,LightColor,Karma,Force)
|
||||
native;
|
||||
|
||||
// Standard PlayInfo groups
|
||||
|
||||
var const localized string RulesGroup,
|
||||
GameGroup,
|
||||
ServerGroup,
|
||||
ChatGroup,
|
||||
BotsGroup,
|
||||
MapVoteGroup,
|
||||
KickVoteGroup;
|
||||
|
||||
// mc: Fill a PlayInfoData structure to allow easy access to
|
||||
static function FillPlayInfo(PlayInfo PlayInfo)
|
||||
{
|
||||
PlayInfo.AddClass(default.Class);
|
||||
}
|
||||
|
||||
static event bool AcceptPlayInfoProperty(string PropertyName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// rjp-- Can I remove a class from playinfo?
|
||||
// Called when PlayInfo.RemoveClass is called on this class
|
||||
// Only called if you have called PopClass() after calling FillPlayInfo() on this class
|
||||
static event bool AllowClassRemoval()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static event byte GetSecurityLevel(string PropName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static event string GetDescriptionText(string PropName)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
RemoteRole=ROLE_None
|
||||
NetUpdateFrequency=10
|
||||
bHidden=True
|
||||
bOnlyDirtyReplication=true
|
||||
bSkipActorPropertyReplication=true
|
||||
|
||||
RulesGroup="Rules"
|
||||
GameGroup="Game"
|
||||
ServerGroup="Server"
|
||||
ChatGroup="Chat"
|
||||
BotsGroup="Bots"
|
||||
MapVoteGroup="Map Voting"
|
||||
KickVoteGroup="Kick Voting"
|
||||
}
|
||||
130
kf_sources/Engine/Classes/Interaction.uc
Normal file
130
kf_sources/Engine/Classes/Interaction.uc
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
// ====================================================================
|
||||
// Class: Engine.Interaction
|
||||
//
|
||||
// Each individual Interaction is a jumping point in UScript. The should
|
||||
// be the foundatation for any subsystem that requires interaction with
|
||||
// the player (such as a menu).
|
||||
//
|
||||
// Interactions take on two forms, the Global Interaction and the Local
|
||||
// Interaction. The GI get's to process data before the LI and get's
|
||||
// render time after the LI, so in essence the GI wraps the LI.
|
||||
//
|
||||
// A dynamic array of GI's are stored in the InteractionMaster while
|
||||
// each Viewport contains an array of LIs.
|
||||
//
|
||||
//
|
||||
// (c) 2001, Epic Games, Inc. All Rights Reserved
|
||||
// ====================================================================
|
||||
|
||||
class Interaction extends Interactions
|
||||
native;
|
||||
|
||||
var bool bActive; // Is this interaction Getting Input
|
||||
var bool bVisible; // Is this interaction being Displayed
|
||||
var bool bRequiresTick; // Does this interaction require game TICK
|
||||
var bool bNativeEvents; // This interaction requests native events
|
||||
|
||||
// These entries get filled out upon creation.
|
||||
|
||||
var Player ViewportOwner; // Pointer to the ViewPort that "Owns" this interaction or none if it's Global
|
||||
var InteractionMaster Master; // Pointer to the Interaction Master
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// natives.
|
||||
|
||||
native function Initialize(); // setup the state system and stack frame
|
||||
native function bool ConsoleCommand( coerce string S ); // Executes a console command
|
||||
|
||||
// WorldToScreen converts a vector in the world
|
||||
|
||||
// ====================================================================
|
||||
// WorldToScreen - Returns the X/Y screen coordinates in to a viewport of a given vector
|
||||
// in the world.
|
||||
// ====================================================================
|
||||
native function vector WorldToScreen(vector Location, optional vector CameraLocation, optional rotator CameraRotation);
|
||||
|
||||
// ====================================================================
|
||||
// ScreenToWorld - Converts an X/Y screen coordinate in to a world vector
|
||||
// ====================================================================
|
||||
native function vector ScreenToWorld(vector Location, optional vector CameraLocation, optional rotator CameraRotation);
|
||||
|
||||
// ====================================================================
|
||||
// Initialized - Called directly after an Interaction Object has been created
|
||||
// and Initialized. Should be subclassed
|
||||
// ====================================================================
|
||||
|
||||
event Initialized();
|
||||
|
||||
event NotifyLevelChange();
|
||||
// ====================================================================
|
||||
// Message - This event allows interactions to receive messages
|
||||
// ====================================================================
|
||||
|
||||
function Message( coerce string Msg, float MsgLife)
|
||||
{
|
||||
} // Message
|
||||
|
||||
// ====================================================================
|
||||
// ====================================================================
|
||||
// Input Routines - These two routines are the entry points for input. They both
|
||||
// return true if the data has been processed and should now discarded.
|
||||
|
||||
// Both functions should be handled in a subclass of Interaction
|
||||
// ====================================================================
|
||||
// ====================================================================
|
||||
|
||||
function bool KeyType( out EInputKey Key, optional string Unicode )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function bool KeyEvent( out EInputKey Key, out EInputAction Action, FLOAT Delta )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ====================================================================
|
||||
// ====================================================================
|
||||
// Render Routines - All Interactions recieve both PreRender and PostRender
|
||||
// calls.
|
||||
|
||||
// Both functions should be handled in a subclass of Interaction
|
||||
// ====================================================================
|
||||
// ====================================================================
|
||||
|
||||
|
||||
function PreRender( canvas Canvas );
|
||||
function PostRender( canvas Canvas );
|
||||
|
||||
// ====================================================================
|
||||
// SetFocus - This function cases the Interaction to gain "focus" in the interaction
|
||||
// system. Global interactions's focus superceed locals.
|
||||
// ====================================================================
|
||||
|
||||
function SetFocus()
|
||||
{
|
||||
Master.SetFocusTo(self,ViewportOwner);
|
||||
|
||||
} // SetFocus
|
||||
|
||||
// ====================================================================
|
||||
// Tick - By default, Interactions do not get ticked, but you can
|
||||
// simply turn on bRequiresTick.
|
||||
// ====================================================================
|
||||
|
||||
function Tick(float DeltaTime);
|
||||
|
||||
|
||||
// ====================================================================
|
||||
function StreamFinished( int Handle, EStreamFinishReason Reason );
|
||||
event NotifyMusicChange();
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bActive=True
|
||||
bRequiresTick=False
|
||||
bVisible=False
|
||||
bNativeEvents=False
|
||||
}
|
||||
303
kf_sources/Engine/Classes/InteractionMaster.uc
Normal file
303
kf_sources/Engine/Classes/InteractionMaster.uc
Normal file
|
|
@ -0,0 +1,303 @@
|
|||
// ====================================================================
|
||||
// Class: Engine.InteractionMaster
|
||||
//
|
||||
// The InteractionMaster controls the entire interaction system. It's
|
||||
// job is to take input and Pre/PostRender call and route them to individual
|
||||
// Interactions and/or viewports.
|
||||
//
|
||||
// The stubs here in script are for just the GlobalInteracations as those
|
||||
// are the only Interactions the IM routes directly too. A new stub is
|
||||
// created in order to limit the number of C++ -> Uscript switches.
|
||||
//
|
||||
// (c) 2001, Epic Games, Inc. All Rights Reserved
|
||||
// ====================================================================
|
||||
|
||||
class InteractionMaster extends Interactions
|
||||
transient
|
||||
Native;
|
||||
|
||||
var transient Client Client;
|
||||
|
||||
var transient const Interaction BaseMenu; // Holds a pointer to the base menu system
|
||||
var transient const Interaction Console; // Holds the special Interaction that acts as the console
|
||||
var transient array<Interaction> GlobalInteractions; // Holds a listing of all global Interactions
|
||||
var transient bool bRequireRawJoystick;
|
||||
|
||||
native function Travel(string URL); // Setup a travel to a new map
|
||||
|
||||
// ====================================================================
|
||||
// Control functions
|
||||
// ====================================================================
|
||||
|
||||
event Interaction AddInteraction(string InteractionName, optional Player AttachTo) // Adds an Interaction
|
||||
{
|
||||
local Interaction NewInteraction;
|
||||
local class<Interaction> NewInteractionClass;
|
||||
|
||||
NewInteractionClass = class<Interaction>(DynamicLoadObject(InteractionName, class'Class'));
|
||||
|
||||
if (NewInteractionClass!=None)
|
||||
{
|
||||
NewInteraction = new NewInteractionClass;
|
||||
if (NewInteraction != None)
|
||||
{
|
||||
|
||||
// Place the Interaction in the proper array
|
||||
|
||||
if (AttachTo != None) // Handle location Interactions
|
||||
{
|
||||
AttachTo.LocalInteractions.Length = AttachTo.LocalInteractions.Length + 1;
|
||||
AttachTo.LocalInteractions[AttachTo.LocalInteractions.Length-1] = NewInteraction;
|
||||
NewInteraction.ViewportOwner = AttachTo;
|
||||
}
|
||||
else // Handle Global Interactions
|
||||
{
|
||||
GlobalInteractions.Length = GlobalInteractions.Length + 1;
|
||||
GlobalInteractions[GlobalInteractions.Length-1] = NewInteraction;
|
||||
}
|
||||
|
||||
// Initialize the Interaction
|
||||
|
||||
NewInteraction.Initialize();
|
||||
NewInteraction.Master = Self;
|
||||
|
||||
return NewInteraction;
|
||||
|
||||
}
|
||||
else
|
||||
Log("Could not create interaction ["$InteractionName$"]",'IMaster');
|
||||
|
||||
}
|
||||
else
|
||||
Log("Could not load interaction ["$InteractionName$"]",'IMaster');
|
||||
|
||||
return none;
|
||||
|
||||
} // AddInteraction
|
||||
|
||||
event RemoveInteraction(interaction RemoveMe) // Removes a Interaction
|
||||
{
|
||||
local int Index;
|
||||
|
||||
// Grab the array to work with
|
||||
|
||||
if (RemoveMe.ViewportOwner != None)
|
||||
{
|
||||
for (Index = 0; Index < RemoveMe.ViewPortOwner.LocalInteractions.Length; Index++)
|
||||
{
|
||||
if ( RemoveMe.ViewPortOwner.LocalInteractions[Index] == RemoveMe )
|
||||
{
|
||||
RemoveMe.ViewPortOwner.LocalInteractions.Remove(Index,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Index = 0; Index < GlobalInteractions.Length; Index++)
|
||||
{
|
||||
if ( GlobalInteractions[Index] == RemoveMe )
|
||||
{
|
||||
GlobalInteractions.Remove(Index,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Find the Interaction to delete
|
||||
|
||||
Log("Could not remove interaction ["$RemoveMe$"] (Not Found)", 'IMaster');
|
||||
|
||||
} // RemoveInteraction
|
||||
|
||||
// ====================================================================
|
||||
// SetFocusTo - This function will cause a window to adjust it's position
|
||||
// in it's array so that it processes input first and displays last.
|
||||
// ====================================================================
|
||||
|
||||
event SetFocusTo(Interaction Inter, optional Player ViewportOwner)
|
||||
{
|
||||
local array<Interaction> InteractionArray;
|
||||
local Interaction temp;
|
||||
local int i,iIndex;
|
||||
|
||||
|
||||
if (ViewportOwner != none)
|
||||
InteractionArray = ViewportOwner.LocalInteractions;
|
||||
else
|
||||
InteractionArray = GlobalInteractions;
|
||||
|
||||
if (InteractionArray.Length == 0)
|
||||
{
|
||||
Log("Attempt to SetFocus on an empty Array.",'IMaster');
|
||||
return;
|
||||
}
|
||||
|
||||
// Search for the Interaction
|
||||
|
||||
iIndex = -1;
|
||||
for ( i=0; i<InteractionArray.Length; i++ )
|
||||
{
|
||||
if (InteractionArray[i] == Inter)
|
||||
{
|
||||
iIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Was it found?
|
||||
|
||||
if (iIndex<0)
|
||||
{
|
||||
log("Interaction "$Inter$" is not in "$ViewportOwner$".",'IMaster');
|
||||
return;
|
||||
}
|
||||
else if (iIndex==0)
|
||||
return; // Already has focus
|
||||
|
||||
|
||||
// Move it to the top.
|
||||
|
||||
temp = InteractionArray[iIndex];
|
||||
for ( i=0; i<iIndex; i++)
|
||||
InteractionArray[i+1] = InteractionArray[i];
|
||||
|
||||
InteractionArray[0] = temp;
|
||||
InteractionArray[0].bActive = true; // Give it Input
|
||||
InteractionArray[0].bVisible = true; // Make it visible
|
||||
|
||||
} // SetFocusTo
|
||||
|
||||
// ====================================================================
|
||||
// Input Functions
|
||||
//
|
||||
// The Process functions are here to limit the # of switches from C++ to Script.
|
||||
// ====================================================================
|
||||
|
||||
event bool Process_KeyType( array<Interaction> InteractionArray, out EInputKey Key, optional string Unicode ) // Process a single key press
|
||||
{
|
||||
local int Index;
|
||||
|
||||
// Chain through the Interactions
|
||||
|
||||
for ( Index=0; Index<InteractionArray.Length; Index++)
|
||||
{
|
||||
// Give each Interaction the chance to process the key event
|
||||
|
||||
if ( ( InteractionArray[Index].bActive ) && (!InteractionArray[Index].bNativeEvents) && ( InteractionArray[Index].KeyType(key,Unicode) ) )
|
||||
return true; // and break the chain if processed
|
||||
|
||||
}
|
||||
return false; // Keep processing
|
||||
|
||||
} // Process_KeyType
|
||||
|
||||
event bool Process_KeyEvent( array<Interaction> InteractionArray,
|
||||
out EInputKey Key, out EInputAction Action, FLOAT Delta ) // Process the range of input events
|
||||
{
|
||||
local int Index;
|
||||
|
||||
// Chain through the Interactions
|
||||
|
||||
for ( Index=0; Index<InteractionArray.Length; Index++)
|
||||
{
|
||||
// Give each Interaction the chance to process the key event
|
||||
|
||||
if ( ( InteractionArray[Index].bActive ) && (!InteractionArray[Index].bNativeEvents) && ( InteractionArray[Index].KeyEvent(Key, Action, Delta ) ) )
|
||||
{
|
||||
return true; // and break the chain if processed
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
} // Process_KeyEvent
|
||||
|
||||
// ====================================================================
|
||||
// Render functions only occure on local interactions. The process
|
||||
// the array in reverse order so that the objects that have focus
|
||||
// are drawn last.
|
||||
// ====================================================================
|
||||
|
||||
event Process_PreRender( array<Interaction> InteractionArray, canvas Canvas )
|
||||
{
|
||||
local int index;
|
||||
|
||||
// Chain through the Interactions
|
||||
|
||||
for ( Index=InteractionArray.Length; Index>0; Index--) // Give each Interaction PreRender time
|
||||
{
|
||||
if ( (InteractionArray[Index-1].bVisible ) && (!InteractionArray[Index-1].bNativeEvents) )
|
||||
InteractionArray[Index-1].PreRender(canvas);
|
||||
}
|
||||
|
||||
} // Process_PreRender
|
||||
|
||||
event Process_PostRender( array<Interaction> InteractionArray, canvas Canvas )
|
||||
{
|
||||
local int index;
|
||||
|
||||
// Chain through the Interactions
|
||||
|
||||
for ( Index=InteractionArray.Length; Index>0; Index--) // Give each Interaction PreRender time
|
||||
{
|
||||
if ( (InteractionArray[Index-1].bVisible ) && (!InteractionArray[Index-1].bNativeEvents) )
|
||||
InteractionArray[Index-1].PostRender(canvas);
|
||||
}
|
||||
|
||||
} // Process_PostRender
|
||||
|
||||
// ====================================================================
|
||||
// Tick - Interactions can request access to be ticked.
|
||||
// ====================================================================
|
||||
|
||||
event Process_Tick( array<Interaction> InteractionArray, float DeltaTime )
|
||||
{
|
||||
local int Index;
|
||||
|
||||
// Chain through the Interactions
|
||||
|
||||
for ( Index=0; Index<InteractionArray.Length; Index++)
|
||||
{
|
||||
// Give each Interaction that requires it tick
|
||||
if ( (InteractionArray[Index].bRequiresTick ) && (!InteractionArray[Index].bNativeEvents) )
|
||||
InteractionArray[Index].Tick(DeltaTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ====================================================================
|
||||
// Message - The IM is responsible for sending Message events to all
|
||||
// interactions.
|
||||
// ====================================================================
|
||||
|
||||
event Process_Message( coerce string Msg, float MsgLife, array<Interaction> InteractionArray)
|
||||
{
|
||||
local int Index;
|
||||
|
||||
// Chain through the Interactions
|
||||
|
||||
for ( Index=0; Index<InteractionArray.Length; Index++)
|
||||
{
|
||||
// Give each Interaction the message
|
||||
|
||||
InteractionArray[Index].Message(Msg, MsgLife);
|
||||
}
|
||||
|
||||
} // Message
|
||||
|
||||
|
||||
event NotifyLevelChange(array<Interaction> InteractionArray)
|
||||
{
|
||||
local int Index;
|
||||
|
||||
for (Index=0;Index<InteractionArray.Length; Index++)
|
||||
InteractionArray[Index].NotifyLevelChange();
|
||||
}
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
||||
112
kf_sources/Engine/Classes/Interactions.uc
Normal file
112
kf_sources/Engine/Classes/Interactions.uc
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
// ====================================================================
|
||||
// Class: Engine.Interactions
|
||||
//
|
||||
// This is an abstract class for the interaction sub-system. This new
|
||||
// sub-system is responsible for tunneling input and Pre/Post rendering
|
||||
// time to individual viewports and interactions.
|
||||
//
|
||||
// (c) 2001, Epic Games, Inc. All Rights Reserved
|
||||
// ====================================================================
|
||||
|
||||
class Interactions extends Object
|
||||
abstract
|
||||
native;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Input.
|
||||
|
||||
|
||||
// Input system states.
|
||||
enum EInputAction
|
||||
{
|
||||
IST_None, // Not performing special input processing.
|
||||
IST_Press, // Handling a keypress or button press.
|
||||
IST_Hold, // Handling holding a key or button.
|
||||
IST_Release, // Handling a key or button release.
|
||||
IST_Axis, // Handling analog axis movement.
|
||||
};
|
||||
|
||||
// Input keys.
|
||||
enum EInputKey
|
||||
{
|
||||
/*00*/ IK_None ,IK_LeftMouse ,IK_RightMouse ,IK_Cancel ,
|
||||
/*04*/ IK_MiddleMouse ,IK_Unknown05 ,IK_Unknown06 ,IK_Unknown07 ,
|
||||
/*08*/ IK_Backspace ,IK_Tab ,IK_Unknown0A ,IK_Unknown0B ,
|
||||
/*0C*/ IK_Unknown0C ,IK_Enter ,IK_Unknown0E ,IK_Unknown0F ,
|
||||
/*10*/ IK_Shift ,IK_Ctrl ,IK_Alt ,IK_Pause ,
|
||||
/*14*/ IK_CapsLock ,IK_Unknown15 ,IK_Unknown16 ,IK_Unknown17 ,
|
||||
/*18*/ IK_Unknown18 ,IK_Unknown19 ,IK_Unknown1A ,IK_Escape ,
|
||||
/*1C*/ IK_Unknown1C ,IK_Unknown1D ,IK_Unknown1E ,IK_Unknown1F ,
|
||||
/*20*/ IK_Space ,IK_PageUp ,IK_PageDown ,IK_End ,
|
||||
/*24*/ IK_Home ,IK_Left ,IK_Up ,IK_Right ,
|
||||
/*28*/ IK_Down ,IK_Select ,IK_Print ,IK_Execute ,
|
||||
/*2C*/ IK_PrintScrn ,IK_Insert ,IK_Delete ,IK_Help ,
|
||||
/*30*/ IK_0 ,IK_1 ,IK_2 ,IK_3 ,
|
||||
/*34*/ IK_4 ,IK_5 ,IK_6 ,IK_7 ,
|
||||
/*38*/ IK_8 ,IK_9 ,IK_Unknown3A ,IK_Unknown3B ,
|
||||
/*3C*/ IK_Unknown3C ,IK_Unknown3D ,IK_Unknown3E ,IK_Unknown3F ,
|
||||
/*40*/ IK_Unknown40 ,IK_A ,IK_B ,IK_C ,
|
||||
/*44*/ IK_D ,IK_E ,IK_F ,IK_G ,
|
||||
/*48*/ IK_H ,IK_I ,IK_J ,IK_K ,
|
||||
/*4C*/ IK_L ,IK_M ,IK_N ,IK_O ,
|
||||
/*50*/ IK_P ,IK_Q ,IK_R ,IK_S ,
|
||||
/*54*/ IK_T ,IK_U ,IK_V ,IK_W ,
|
||||
/*58*/ IK_X ,IK_Y ,IK_Z ,IK_Unknown5B ,
|
||||
/*5C*/ IK_Unknown5C ,IK_Unknown5D ,IK_Unknown5E ,IK_Unknown5F ,
|
||||
/*60*/ IK_NumPad0 ,IK_NumPad1 ,IK_NumPad2 ,IK_NumPad3 ,
|
||||
/*64*/ IK_NumPad4 ,IK_NumPad5 ,IK_NumPad6 ,IK_NumPad7 ,
|
||||
/*68*/ IK_NumPad8 ,IK_NumPad9 ,IK_GreyStar ,IK_GreyPlus ,
|
||||
/*6C*/ IK_Separator ,IK_GreyMinus ,IK_NumPadPeriod,IK_GreySlash ,
|
||||
/*70*/ IK_F1 ,IK_F2 ,IK_F3 ,IK_F4 ,
|
||||
/*74*/ IK_F5 ,IK_F6 ,IK_F7 ,IK_F8 ,
|
||||
/*78*/ IK_F9 ,IK_F10 ,IK_F11 ,IK_F12 ,
|
||||
/*7C*/ IK_F13 ,IK_F14 ,IK_F15 ,IK_F16 ,
|
||||
/*80*/ IK_F17 ,IK_F18 ,IK_F19 ,IK_F20 ,
|
||||
/*84*/ IK_F21 ,IK_F22 ,IK_F23 ,IK_F24 ,
|
||||
/*88*/ IK_Unknown88 ,IK_Unknown89 ,IK_Unknown8A ,IK_Unknown8B ,
|
||||
/*8C*/ IK_Unknown8C ,IK_Unknown8D ,IK_Unknown8E ,IK_Unknown8F ,
|
||||
/*90*/ IK_NumLock ,IK_ScrollLock ,IK_Unknown92 ,IK_Unknown93 ,
|
||||
/*94*/ IK_Unknown94 ,IK_Unknown95 ,IK_Unknown96 ,IK_Unknown97 ,
|
||||
/*98*/ IK_Unknown98 ,IK_Unknown99 ,IK_Unknown9A ,IK_Unknown9B ,
|
||||
/*9C*/ IK_Unknown9C ,IK_Unknown9D ,IK_Unknown9E ,IK_Unknown9F ,
|
||||
/*A0*/ IK_LShift ,IK_RShift ,IK_LControl ,IK_RControl ,
|
||||
/*A4*/ IK_UnknownA4 ,IK_UnknownA5 ,IK_UnknownA6 ,IK_UnknownA7 ,
|
||||
/*A8*/ IK_UnknownA8 ,IK_UnknownA9 ,IK_UnknownAA ,IK_UnknownAB ,
|
||||
/*AC*/ IK_UnknownAC ,IK_UnknownAD ,IK_UnknownAE ,IK_UnknownAF ,
|
||||
/*B0*/ IK_UnknownB0 ,IK_UnknownB1 ,IK_UnknownB2 ,IK_UnknownB3 ,
|
||||
/*B4*/ IK_UnknownB4 ,IK_UnknownB5 ,IK_UnknownB6 ,IK_UnknownB7 ,
|
||||
/*B8*/ IK_UnknownB8 ,IK_Unicode ,IK_Semicolon ,IK_Equals ,
|
||||
/*BC*/ IK_Comma ,IK_Minus ,IK_Period ,IK_Slash ,
|
||||
/*C0*/ IK_Tilde ,IK_Mouse4 ,IK_Mouse5 ,IK_Mouse6 ,
|
||||
/*C4*/ IK_Mouse7 ,IK_Mouse8 ,IK_UnknownC6 ,IK_UnknownC7 ,
|
||||
/*C8*/ IK_Joy1 ,IK_Joy2 ,IK_Joy3 ,IK_Joy4 ,
|
||||
/*CC*/ IK_Joy5 ,IK_Joy6 ,IK_Joy7 ,IK_Joy8 ,
|
||||
/*D0*/ IK_Joy9 ,IK_Joy10 ,IK_Joy11 ,IK_Joy12 ,
|
||||
/*D4*/ IK_Joy13 ,IK_Joy14 ,IK_Joy15 ,IK_Joy16 ,
|
||||
/*D8*/ IK_UnknownD8 ,IK_UnknownD9 ,IK_UnknownDA ,IK_LeftBracket ,
|
||||
/*DC*/ IK_Backslash ,IK_RightBracket,IK_SingleQuote ,IK_UnknownDF ,
|
||||
/*E0*/ IK_UnknownE0 ,IK_UnknownE1 ,IK_UnknownE2 ,IK_UnknownE3 ,
|
||||
/*E4*/ IK_MouseX ,IK_MouseY ,IK_MouseZ ,IK_MouseW ,
|
||||
/*E8*/ IK_JoyU ,IK_JoyV ,IK_JoySlider1 ,IK_JoySlider2 ,
|
||||
/*EC*/ IK_MouseWheelUp ,IK_MouseWheelDown,IK_Unknown10E,UK_Unknown10F ,
|
||||
/*F0*/ IK_JoyX ,IK_JoyY ,IK_JoyZ ,IK_JoyR ,
|
||||
/*F4*/ IK_UnknownF4 ,IK_UnknownF5 ,IK_Attn ,IK_CrSel ,
|
||||
/*F8*/ IK_ExSel ,IK_ErEof ,IK_Play ,IK_Zoom ,
|
||||
/*FC*/ IK_NoName ,IK_PA1 ,IK_OEMClear
|
||||
};
|
||||
|
||||
enum EStreamFinishReason
|
||||
{
|
||||
STREAMFINISH_EOF,
|
||||
STREAMFINISH_Error
|
||||
};
|
||||
|
||||
static function string GetFriendlyName( EInputKey iKey )
|
||||
{
|
||||
return Mid( GetEnum(enum'EInputKey', iKey), 3 );
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
||||
26
kf_sources/Engine/Classes/InternetInfo.uc
Normal file
26
kf_sources/Engine/Classes/InternetInfo.uc
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//=============================================================================
|
||||
// InternetInfo: Parent class for Internet connection classes
|
||||
//=============================================================================
|
||||
class InternetInfo extends Info
|
||||
native
|
||||
transient;
|
||||
|
||||
// gam ---
|
||||
function int GetBeaconCount()
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
// --- gam
|
||||
|
||||
function string GetBeaconAddress( int i );
|
||||
function string GetBeaconText( int i );
|
||||
|
||||
//ifdef _RO_
|
||||
function Init(string Address, string Request);
|
||||
delegate bool OnServerConnectTimeout();
|
||||
delegate OnServerResponded(string Response);
|
||||
//endif
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
15
kf_sources/Engine/Classes/InterpolationPoint.uc
Normal file
15
kf_sources/Engine/Classes/InterpolationPoint.uc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
//=============================================================================
|
||||
// InterpolationPoint.
|
||||
// Used as destinations to move the camera to in Matinee scenes.
|
||||
//=============================================================================
|
||||
class InterpolationPoint extends Keypoint
|
||||
native;
|
||||
|
||||
#exec Texture Import File=Textures\InterpolationPoint.pcx Name=S_Interp Mips=Off MASKED=1
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DrawScale=+0.35
|
||||
bDirectional=True
|
||||
Texture=S_Interp
|
||||
}
|
||||
375
kf_sources/Engine/Classes/Inventory.uc
Normal file
375
kf_sources/Engine/Classes/Inventory.uc
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
//=============================================================================
|
||||
// Inventory
|
||||
//
|
||||
// Inventory is the parent class of all actors that can be carried by other actors.
|
||||
// Inventory items are placed in the holding actor's inventory chain, a linked list
|
||||
// of inventory actors. Each inventory class knows what pickup can spawn it (its
|
||||
// PickupClass). When tossed out (using the DropFrom() function), inventory items
|
||||
// replace themselves with an actor of their Pickup class.
|
||||
//
|
||||
//=============================================================================
|
||||
class Inventory extends Actor
|
||||
abstract
|
||||
native
|
||||
nativereplication;
|
||||
|
||||
#exec Texture Import File=Textures\Inventry.pcx Name=S_Inventory Mips=Off MASKED=1
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
var byte InventoryGroup; // The weapon/inventory set, 0-9.
|
||||
var byte GroupOffset; // position within inventory group. (used by prevweapon and nextweapon)
|
||||
var bool bDisplayableInv; // Item displayed in HUD.
|
||||
var bool bTossedOut; // true if weapon/inventory was tossed out (so players can't cheat w/ weaponstay)
|
||||
var cache class<Pickup> PickupClass; // what class of pickup is associated with this inventory item
|
||||
var() travel int Charge; // Charge (for example, armor remaining if an armor)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Rendering information.
|
||||
|
||||
// Player view rendering info.
|
||||
var vector PlayerViewOffset; // Offset from view center.
|
||||
var(FirstPerson) rotator PlayerViewPivot; // additive rotation offset for tweaks
|
||||
var() bool bDrawingFirstPerson;
|
||||
var() float BobDamping; // how much to damp view bob
|
||||
|
||||
// 3rd person mesh.
|
||||
var actor ThirdPersonActor;
|
||||
var cache class<InventoryAttachment> AttachmentClass;
|
||||
|
||||
// HUD graphics
|
||||
|
||||
var() Material IconMaterial;
|
||||
var() IntBox IconCoords;
|
||||
var() localized cache String ItemName;
|
||||
|
||||
// Network replication.
|
||||
replication
|
||||
{
|
||||
// Things the server should send to the client.
|
||||
reliable if( bNetOwner && bNetDirty && (Role==ROLE_Authority) )
|
||||
Charge,ThirdPersonActor;
|
||||
}
|
||||
|
||||
function AttachToPawn(Pawn P)
|
||||
{
|
||||
local name BoneName;
|
||||
|
||||
Instigator = P;
|
||||
if ( ThirdPersonActor == None )
|
||||
{
|
||||
ThirdPersonActor = Spawn(AttachmentClass,Owner);
|
||||
InventoryAttachment(ThirdPersonActor).InitFor(self);
|
||||
}
|
||||
else
|
||||
ThirdPersonActor.NetUpdateTime = Level.TimeSeconds - 1;
|
||||
BoneName = P.GetWeaponBoneFor(self);
|
||||
if ( BoneName == '' )
|
||||
{
|
||||
ThirdPersonActor.SetLocation(P.Location);
|
||||
ThirdPersonActor.SetBase(P);
|
||||
}
|
||||
else
|
||||
P.AttachToBone(ThirdPersonActor,BoneName);
|
||||
}
|
||||
|
||||
// if _RO_
|
||||
// Attach to the pawn, but keep the attachement hidden
|
||||
function AttachToPawnHidden(Pawn P)
|
||||
{
|
||||
local name BoneName;
|
||||
|
||||
Instigator = P;
|
||||
if ( ThirdPersonActor == None )
|
||||
{
|
||||
ThirdPersonActor = Spawn(AttachmentClass,Owner);
|
||||
ThirdPersonActor.bHidden = true;
|
||||
InventoryAttachment(ThirdPersonActor).InitFor(self);
|
||||
}
|
||||
else
|
||||
{
|
||||
ThirdPersonActor.bHidden = true;
|
||||
ThirdPersonActor.NetUpdateTime = Level.TimeSeconds - 1;
|
||||
}
|
||||
BoneName = P.GetWeaponBoneFor(self);
|
||||
if ( BoneName == '' )
|
||||
{
|
||||
ThirdPersonActor.SetLocation(P.Location);
|
||||
ThirdPersonActor.SetBase(P);
|
||||
}
|
||||
else
|
||||
P.AttachToBone(ThirdPersonActor,BoneName);
|
||||
}
|
||||
// end _RO_
|
||||
|
||||
/* UpdateRelative()
|
||||
For tweaking weapon positioning. Pass in a new relativerotation, and use the weapon editactor
|
||||
properties sheet to modify the relativelocation
|
||||
*/
|
||||
exec function updaterelative(int pitch, int yaw, int roll)
|
||||
{
|
||||
local rotator NewRot;
|
||||
|
||||
NewRot.Pitch = pitch;
|
||||
NewRot.Yaw = yaw;
|
||||
NewRot.Roll = roll;
|
||||
ThirdPersonActor.SetRelativeLocation(ThirdPersonActor.Default.RelativeLocation);
|
||||
ThirdPersonActor.SetRelativeRotation(NewRot);
|
||||
}
|
||||
|
||||
function DetachFromPawn(Pawn P)
|
||||
{
|
||||
if ( ThirdPersonActor != None )
|
||||
{
|
||||
ThirdPersonActor.Destroy();
|
||||
ThirdPersonActor = None;
|
||||
}
|
||||
}
|
||||
|
||||
/* RenderOverlays() - Draw first person view of inventory
|
||||
Most Inventory actors are never rendered. The common exception is Weapon actors.
|
||||
Inventory actors may be rendered in the first person view of the player holding them
|
||||
using the RenderOverlays() function.
|
||||
*/
|
||||
simulated event RenderOverlays( canvas Canvas )
|
||||
{
|
||||
if ( (Instigator == None) || (Instigator.Controller == None))
|
||||
return;
|
||||
SetLocation( Instigator.Location + Instigator.CalcDrawOffset(self) );
|
||||
SetRotation( Instigator.GetViewRotation() );
|
||||
Canvas.DrawActor(self, false);
|
||||
}
|
||||
|
||||
simulated function String GetHumanReadableName()
|
||||
{
|
||||
if ( ItemName == "" )
|
||||
ItemName = GetItemName(string(Class));
|
||||
|
||||
return ItemName;
|
||||
}
|
||||
|
||||
function PickupFunction(Pawn Other);
|
||||
|
||||
//=============================================================================
|
||||
// AI inventory functions.
|
||||
simulated function Weapon RecommendWeapon( out float rating )
|
||||
{
|
||||
if ( inventory != None )
|
||||
return inventory.RecommendWeapon(rating);
|
||||
else
|
||||
{
|
||||
rating = -1;
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Inventory travelling across servers.
|
||||
|
||||
//
|
||||
// Called after a travelling inventory item has been accepted into a level.
|
||||
//
|
||||
event TravelPreAccept()
|
||||
{
|
||||
Super.TravelPreAccept();
|
||||
GiveTo( Pawn(Owner) );
|
||||
}
|
||||
|
||||
function TravelPostAccept()
|
||||
{
|
||||
Super.TravelPostAccept();
|
||||
PickupFunction(Pawn(Owner));
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// General inventory functions.
|
||||
|
||||
//
|
||||
// Called by engine when destroyed.
|
||||
//
|
||||
function Destroyed()
|
||||
{
|
||||
// Remove from owner's inventory.
|
||||
if( Pawn(Owner)!=None )
|
||||
Pawn(Owner).DeleteInventory( Self );
|
||||
if ( ThirdPersonActor != None )
|
||||
ThirdPersonActor.Destroy();
|
||||
}
|
||||
|
||||
//
|
||||
// Give this inventory item to a pawn.
|
||||
//
|
||||
function GiveTo( pawn Other, optional Pickup Pickup )
|
||||
{
|
||||
Instigator = Other;
|
||||
if ( Other.AddInventory( Self ) )
|
||||
GotoState('');
|
||||
else
|
||||
Destroy();
|
||||
}
|
||||
|
||||
//
|
||||
// Function which lets existing items in a pawn's inventory
|
||||
// prevent the pawn from picking something up. Return true to abort pickup
|
||||
// or if item handles pickup, otherwise keep going through inventory list.
|
||||
//
|
||||
function bool HandlePickupQuery( pickup Item )
|
||||
{
|
||||
if ( Item.InventoryType == Class )
|
||||
return true;
|
||||
if ( Inventory == None )
|
||||
return false;
|
||||
|
||||
return Inventory.HandlePickupQuery(Item);
|
||||
}
|
||||
|
||||
//
|
||||
// Select first activatable powerup.
|
||||
//
|
||||
function Powerups SelectNext()
|
||||
{
|
||||
if ( Inventory != None )
|
||||
return Inventory.SelectNext();
|
||||
else
|
||||
return None;
|
||||
}
|
||||
|
||||
//
|
||||
// Toss this item out.
|
||||
//
|
||||
function DropFrom(vector StartLocation)
|
||||
{
|
||||
local Pickup P;
|
||||
|
||||
if ( Instigator != None )
|
||||
{
|
||||
DetachFromPawn(Instigator);
|
||||
Instigator.DeleteInventory(self);
|
||||
}
|
||||
SetDefaultDisplayProperties();
|
||||
Instigator = None;
|
||||
StopAnimating();
|
||||
GotoState('');
|
||||
|
||||
P = spawn(PickupClass,,,StartLocation);
|
||||
if ( P == None )
|
||||
{
|
||||
destroy();
|
||||
return;
|
||||
}
|
||||
P.InitDroppedPickupFor(self);
|
||||
P.Velocity = Velocity;
|
||||
Velocity = vect(0,0,0);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Using.
|
||||
|
||||
function Use( float Value );
|
||||
|
||||
//=============================================================================
|
||||
// Weapon functions.
|
||||
|
||||
// Find a weapon in inventory that has an Inventory Group matching F.
|
||||
|
||||
simulated function Weapon WeaponChange( byte F, bool bSilent )
|
||||
{
|
||||
if( Inventory == None)
|
||||
return None;
|
||||
else
|
||||
return Inventory.WeaponChange( F, bSilent );
|
||||
}
|
||||
|
||||
// Find the previous weapon (using the Inventory group)
|
||||
simulated function Weapon PrevWeapon(Weapon CurrentChoice, Weapon CurrentWeapon)
|
||||
{
|
||||
if ( Inventory == None )
|
||||
return CurrentChoice;
|
||||
else
|
||||
return Inventory.PrevWeapon(CurrentChoice,CurrentWeapon);
|
||||
}
|
||||
|
||||
// Find the next weapon (using the Inventory group)
|
||||
simulated function Weapon NextWeapon(Weapon CurrentChoice, Weapon CurrentWeapon)
|
||||
{
|
||||
if ( Inventory == None )
|
||||
return CurrentChoice;
|
||||
else
|
||||
return Inventory.NextWeapon(CurrentChoice,CurrentWeapon);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Armor functions.
|
||||
|
||||
//
|
||||
// Return the best armor to use.
|
||||
//
|
||||
function armor PrioritizeArmor( int Damage, class<DamageType> DamageType, vector HitLocation )
|
||||
{
|
||||
local Armor FirstArmor;
|
||||
|
||||
if ( Inventory != None )
|
||||
FirstArmor = Inventory.PrioritizeArmor(Damage, DamageType, HitLocation);
|
||||
else
|
||||
FirstArmor = None;
|
||||
|
||||
return FirstArmor;
|
||||
}
|
||||
|
||||
//
|
||||
// Used to inform inventory when owner event occurs (for example jumping or weapon change)
|
||||
//
|
||||
function OwnerEvent(name EventName)
|
||||
{
|
||||
if( Inventory != None )
|
||||
Inventory.OwnerEvent(EventName);
|
||||
}
|
||||
|
||||
// used to ask inventory if it needs to affect its owners display properties
|
||||
function SetOwnerDisplay()
|
||||
{
|
||||
if( Inventory != None )
|
||||
Inventory.SetOwnerDisplay();
|
||||
}
|
||||
|
||||
static function string StaticItemName()
|
||||
{
|
||||
return Default.ItemName;
|
||||
}
|
||||
|
||||
/* Begin KFStory Mod*/
|
||||
|
||||
/* Modifier to apply to carrying pawn's movement speed */
|
||||
simulated function float GetMovementModifierFor(Pawn InPawn)
|
||||
{
|
||||
return 1.f;
|
||||
}
|
||||
|
||||
simulated function bool IsThrowable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* end KFStory Mod */
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bOnlyDirtyReplication=true
|
||||
bOnlyRelevantToOwner=true
|
||||
AttachmentClass=class'InventoryAttachment'
|
||||
BobDamping=0.960000
|
||||
bTravel=True
|
||||
DrawType=DT_None
|
||||
AmbientGlow=0
|
||||
RemoteRole=ROLE_SimulatedProxy
|
||||
NetPriority=1.4
|
||||
bOnlyOwnerSee=true
|
||||
bHidden=true
|
||||
bClientAnim=true
|
||||
Physics=PHYS_None
|
||||
bReplicateMovement=false
|
||||
bAcceptsProjectors=True
|
||||
bDrawingFirstPerson=false
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue