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

MultiDodging2k4v4.MultiDodgingRules


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
/**
MultiDodging2k4v4.MultiDodgingRules

Creation date: 2014-01-04 19:43
Last change: $Id$
Copyright (c) 2014, Wormbo
*/

class MultiDodgingRules extends GameRules;


//=============================================================================
// Configuration
//=============================================================================

var int  MaxDodgesPerJump;
var bool bAlwaysAllowDodgeDoubleJump;
var bool bEnableBoostDodge;
var bool bFastDodging;


var transient Controller LastPlayer;
var transient float LastTimeSeconds;


function PreBeginPlay()
{
	MaxDodgesPerJump = class'MutMultiDodging'.default.MaxDodgesPerJump;
	bAlwaysAllowDodgeDoubleJump = class'MutMultiDodging'.default.bAlwaysAllowDodgeDoubleJump;
	bEnableBoostDodge = class'MutMultiDodging'.default.bEnableBoostDodge;
	bFastDodging = class'MutMultiDodging'.default.bFastDodging;
	
	AddToPackageMap();
	Level.Game.AddGameModifier(Self);
	Super.PreBeginPlay();
}

function NavigationPoint FindPlayerStart(Controller Player, optional byte InTeam, optional string IncomingName)
{
	local DodgeHandler DH;
	
	if (Player != None && (Player != LastPlayer || Level.TimeSeconds != LastTimeSeconds))
	{
		LastPlayer = Player;
		LastTimeSeconds = Level.TimeSeconds;
		
		if (bEnableBoostDodge)
			Enable('Tick');
		
		foreach Player.ChildActors(class'DodgeHandler', DH)
		{
			break;
		}
		
		if (DH == None)
		{
			DH = Spawn(class'DodgeHandler', Player);
			DH.MaxDodgesPerJump = MaxDodgesPerJump;
			DH.bAlwaysAllowDodgeDoubleJump = bAlwaysAllowDodgeDoubleJump;
			DH.bFastDodging = bFastDodging;
		}
	}
	
	return Super.FindPlayerStart(Player, InTeam, IncomingName);
}

function Tick(float DeltaTime)
{
	local xPawn P;
	
	if (bEnableBoostDodge)
	{
		foreach DynamicActors(class'xPawn', P)
		{
			P.bCanBoostDodge = True;
		}
	}
	Disable('Tick');
}


//=============================================================================
// Default values
//=============================================================================

defaultproperties
{
     MaxDodgesPerJump=-1
     bAlwaysAllowDodgeDoubleJump=True
     bFastDodging=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sa 4.1.2014 21:13:42.000 - Creation time: Do 14.8.2014 09:58:44.778 - Created with UnCodeX