Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UPak.UPakGame


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
//=============================================================================
// UPakGame.uc
// $Author: Deb $
// $Date: 4/23/99 12:14p $
// $Revision: 1 $
//=============================================================================
class UPakGame expands DeathMatchGame;

function PostBeginPlay()
{
local ZoneInfo ZI;
	
	bHardCoreMode = false;
	bMegaSpeed = false;
	foreach allactors( class'ZoneInfo', ZI )
	{
		if( !ZI.bWaterZone && !ZI.IsA( 'SkyZoneInfo' ) && !ZI.IsA( 'Waterzone' ) && !ZI.IsA( 'LavaZone' ) )
		{
			ZI.bGravityZone = true;
			ZI.ZoneGravity = vect(0, 0, -100 );
		}
	}

	InitialBots = 4;
	BotConfig = spawn(class'UPakSMBotInfo');
	RemainingTime = 120;
	bMultiPlayerBots = false;
	if( (Level.NetMode == NM_Standalone) || bMultiPlayerBots )
		RemainingBots = InitialBots;
	FragLimit = 25;
	UPakGameSetup();

	Super.PostBeginPlay();
}

event playerpawn Login
(
	string Portal,
	string Options,
	out string Error,
	class<PlayerPawn> SpawnClass
)
{
	local playerpawn NewPlayer;
	
	if( (MaxPlayers > 0) && (NumPlayers >= MaxPlayers) )
	{
		Error = MaxedOutMessage;
		return None;
	}

	NewPlayer = Super.Login(Portal, Options, Error, SpawnClass );
	
	if ( NewPlayer != None )
	{
		NumPlayers++;
	}

	NewPlayer.bAutoActivate = true;
		
	return NewPlayer;
}

function UPakGameSetup()
{
	Class'CloakMatch'.Static.TerranWeaponSetup(Self);
}

// Monitor killed messages for fraglimit
function Killed(pawn killer, pawn Other, name damageType)
{
	Super.Killed(killer, Other, damageType);

	if( Killer != none && UPakReplicationInfo(Killer.PlayerReplicationInfo)!=none && UPakPlayer(Killer)!=None )
	{
		if( Killer.Weapon.IsA('CARifle') )
			UPakPlayer( Killer ).CARKills++;
		else if( Killer.Weapon.IsA('RocketLauncher') )
			UPakReplicationInfo(Killer.PlayerReplicationInfo).RLKills++;
		else if( Killer.Weapon.IsA('GrenadeLauncher') )
			UPakReplicationInfo(Killer.PlayerReplicationInfo).GLKills++;
		else UPakReplicationInfo(Killer.PlayerReplicationInfo).OtherKills++;
		UPakReplicationInfo(Killer.PlayerReplicationInfo).TotalKills++;
	}
	if ( (killer == None) || (Other == None) )
		return;
	if ( (FragLimit > 0) && (killer.PlayerReplicationInfo.Score >= FragLimit) )
		EndGame("FragLimit");

	if ( BotConfig.bAdjustSkill && (killer.IsA('PlayerPawn') || Other.IsA('PlayerPawn')) )
	{
		if ( killer.IsA('Bots') )
			Bots(killer).AdjustSkill(true);
		if ( Other.IsA('Bots') )
			Bots(Other).AdjustSkill(false);
	}
}	

function bool AddBot()
{
	local NavigationPoint StartSpot;
	local bots NewBot;
	local int BotN;

	BotN = BotConfig.ChooseBotInfo();
	
	// Find a start spot.
	StartSpot = FindPlayerStart(0);
	if( StartSpot == None )
	{
		log("Could not find starting spot for Bot");
		return false;
	}

	// Try to spawn the player.
	NewBot = Spawn(BotConfig.GetBotClass(BotN),,,StartSpot.Location,StartSpot.Rotation);
	if ( NewBot == None )
		return false;

	if ( (bHumansOnly || Level.bHumansOnly) && !NewBot.bIsHuman )
	{
		NewBot.Destroy();
		log("Failed to spawn bot");
		return false;
	}

	StartSpot.PlayTeleportEffect(NewBot, true);

	// Init player's information.
	BotConfig.Individualize(NewBot, BotN, NumBots);
	NewBot.ViewRotation = StartSpot.Rotation;

	// broadcast a welcome message.
	BroadcastMessage( NewBot.PlayerReplicationInfo.PlayerName$EnteredMessage, true );

	AddDefaultInventory( NewBot );
	NumBots++;
	return true;
}

defaultproperties
{
				DefaultPlayerClass=Class'UPak.UPakMaleOne'
				DefaultWeapon=Class'UPak.CARifle'
				ScoreBoardType=Class'UPak.UPakDMScoreBoard'
				HUDType=Class'UPak.UPakHUD'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:30.000 - Creation time: zo 11-11-2012 21:14:22.444 - Created with UnCodeX