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

KFMod.KFSPLevelInfo


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
// By : Alex.
// Support for non Survival based gameplay.

class KFSPLevelInfo extends LevelGameRules;

var () int PlayerStartHealth; // Amount of starting HP for all players
var () int PlayerStartArmor; // Amount of starting armor for all players.
var () bool bUseVisionOverlay;  // Enable / disable Zone-Modulated HUD colors .
var () bool bHUDShowCash; // Enable / Disable Cash display on HUD .
var () array< Class<Inventory> > RequiredPlayerEquipment;  // Defines starting equipment for players

var () Array<String> MissionObjectives;

simulated function PostBeginPlay()
{
	Super.PostBeginPlay();
	if( KFSGameReplicationInfo(Level.GRI)!=None )
		KFSGameReplicationInfo(Level.GRI).KFPLevel = Self;
}
simulated function SetGRI(GameReplicationInfo GRI)
{
	if( KFSGameReplicationInfo(GRI)!=None )
		KFSGameReplicationInfo(GRI).KFPLevel = Self;
}

function ModifyPlayer( Pawn Other )
{
	if( PlayerStartHealth>0 )
		Other.Health = PlayerStartHealth;
	if( PlayerStartArmor>0 )
		Other.AddShieldStrength(PlayerStartArmor);
}
function AddGameInv( Pawn Other )
{
	local int i;
	local Inventory Inv;

	For( i=0; i<RequiredPlayerEquipment.Length; i++ )
	{
		if( RequiredPlayerEquipment[i]==None )
			Continue;
		if( Other.FindInventoryType(RequiredPlayerEquipment[i])==None )
		{
			Inv = Spawn(RequiredPlayerEquipment[i]);
			if( Inv != None )
			{
				Inv.GiveTo(Other);
				if ( Inv != None )
					Inv.PickupFunction(Other);
			}
		}
	}
}

defaultproperties
{
     bUseVisionOverlay=True
     bNoDelete=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fri 13-10-2023 03:17:26.000 - Creation time: Fri 13-10-2023 03:19:04.134 - Created with UnCodeX