Jump to content

Rx_Mutator_Deck 0.0.1

   (0 reviews)

1 Screenshot

About This File

*  This mutator will add functions to the Renegade X game    *
*


 

Version 0.0.1

Compatible with Renegade X v5.282  

Mutator :

Rx_Mutator_Deck.u (Download)

Source :

Spoiler

 

Rx_Mutator_Deck.uc (Download)

Spoiler


/******************************************************************************
*  Modified by Ukill, this can contain parts of code written by Jessica\Yosh  *
*           This mutator will add function to the Renegade X game             *
*******************************************************************************
* Rx_Mutator_Deck                                                             *
******************************************************************************/

class Rx_Mutator_Deck extends UTMutator;

// Rx_Mutator_LowGrav
/* Gravity along Z axis applied to objects in physics volumes which had default gravity. */
var()	float	GravityZ;

// Rx_Mutator_SpeedFreak
/** Game speed modifier. */
var()	float	GameSpeed;

// Rx_Mutator_MaxPlayers
var int max_players;

//Fort
var Rx_CapturableMCT_MC MC;

// Rx_Mutator_Weapondrop
// var bool allow_weapondrop;

function InitMutator(string Options, out string ErrorMessage)
{
	// Rx_Mutator_LowGrav
	WorldInfo.WorldGravityZ = GravityZ;
	
	// Rx_Mutator_SpeedFreak
	WorldInfo.Game.SetGameSpeed(GameSpeed);
	
	// Rx_Mutator_MaxPlayers
	WorldInfo.Game.MaxPlayersAllowed = max_players;
	WorldInfo.Game.MaxPlayers = max_players;
	
	// Rx_Mutator_Weapondrop
	// Rx_Game(WorldInfo.Game).bAllowWeaponDrop
	
	Super.InitMutator(Options, ErrorMessage);
}


//Fort
simulated function PostBeginPlay()
{
	Super.PostBeginPlay();
	// fix check if buildings exist
	foreach AllActors(class 'Rx_CapturableMCT_MC',MC)
		break;
	SetTimer(2, true);
}

// Fort
simulated function Timer()
{
	local Rx_Pawn Player;

	foreach DynamicActors(class 'Rx_Pawn', Player)
	{
		if (Player.GetTeamNum() == MC.GetTeamNum())
		{
			if(Player.HealthMax <= 100)
				Player.HealthMax = Player.HealthMax + 50;
			if (Player.Health+1 <= Player.HealthMax)
				Player.Health++;
			if (Player.HealthMax > 150)
				Player.HealthMax = 150;
			if (Player.Health > Player.HealthMax)
				Player.Health = Player.HealthMax;
		}else if (Player.GetTeamNum() != MC.GetTeamNum() && Player.HealthMax>100)
		{
			Player.HealthMax = 100;
			if (Player.Health > Player.HealthMax)
				Player.Health = Player.HealthMax;
		}
	}
}

function bool CheckReplacement(Actor Other) {
	
	// Rx_Mutator_InfiniteAmmo
	if (Rx_Weapon(Other) != None && Rx_Weapon_Deployable(Other) == None && Rx_Weapon_Grenade(Other) == None)
		Rx_Weapon(Other).bHasInfiniteAmmo = true;
	//	return true;
	
	// Rx_Mutator_NormalizeHealth
	// if (Rx_Game(WorldInfo.Game) != None)
	if(Other.IsA('Rx_TeamInfo')) {
		// Rx_Mutator_DoubleJump_Controller, Rx_Mutator_NormalizeHealth_Pawn
		Rx_Game(WorldInfo.Game).DefaultPawnClass = class'Rx_Mutator_Deck_Pawn';
		
		// Rx_Mutator_DoubleJump_Controller
		Rx_Game(WorldInfo.Game).PlayerControllerClass = class'Rx_Mutator_Deck_Controller'; }
	
	return true;
}

DefaultProperties
{
	// Rx_Mutator_LowGrav
	GroupNames[0]="JUMPING"
	GravityZ=-300.0

	// Rx_Mutator_SpeedFreak
	GroupNames[1]="GAMESPEED"
	GameSpeed=1.25

	// Rx_Mutator_MaxPlayers
	GroupNames[2]="MAXPLAYERS"
    max_players=256
	
	// Rx_Mutator_Weapondrop
	// GroupNames[3]="WEAPONDROP"
	// allow_weapondrop=true
} 


 

Rx_Mutator_Deck_Controller.uc (Download)

Spoiler


/******************************************************************************
*  Modified by Ukill, this can contain parts of code written by Jessica\Yosh  *
*           This mutator will add function to the Renegade X game             *
*******************************************************************************
* Rx_Mutator_Deck_Controller                                                  *
******************************************************************************/

// Rx_Mutator_DoubleJump_Controller
class Rx_Mutator_Deck_Controller extends Rx_Controller;

/*
// Rx_Mutator_DoubleJump_Controller
function ChangeToSBH(bool sbh) {
	local pawn p; local vector l; local rotator r; 
	p = Pawn; l = Pawn.Location; r = Pawn.Rotation; 
	if(self.Pawn.class != class'Rx_Mutator_Deck_Pawn' ) { UnPossess(); p.Destroy(); p = Spawn( class'Rx_Mutator_Deck_Pawn', , ,l,r); } Possess(p, false); }
*/

// Rx_Mutator_DoubleJump_Controller
function CheckJumpOrDuck() { 
	if ( Pawn == None ) { return; } 
	if ( bDoubleJump && (bUpdating || ((Rx_Pawn(Pawn) != None) && Rx_Pawn(Pawn).CanDoubleJump())) ) { Rx_Pawn(Pawn).DoDoubleJump( bUpdating ); bDoubleJump = false; }
    else if ( bPressedJump ) { Pawn.DoJump( bUpdating ); } 
	if ( Pawn.Physics != PHYS_Falling && Pawn.bCanCrouch ) { Pawn.ShouldCrouch(bDuck != 0); }
}

//Rx_Mutator_ArcadeMove_Controller
state PlayerWalking { 
	exec function StartFire( optional byte FireModeNum ) { if(Rx_Pawn(Pawn) != None && Rx_Pawn(Pawn).bSprinting && Rx_Weapon(Pawn.Weapon) != None && Rx_Weapon(Pawn.Weapon).bIronsightActivated ) { Rx_Pawn(Pawn).StopSprinting(); } super.StartFire(FireModeNum); } 
	exec function StartSprint() { if (Rx_Pawn(Pawn) != None) Rx_Pawn(Pawn).StartSprint(); } 
	exec function StopSprinting() { if (Rx_Pawn(Pawn) != None) Rx_Pawn(Pawn).StopSprinting(); }
	exec function StartWalking() { if (Rx_Pawn(Pawn) != None) Rx_Pawn(Pawn).StartWalking(); }
	exec function StopWalking() { if (Rx_Pawn(Pawn) != None) Rx_Pawn(Pawn).StopWalking(); }
	exec function ToggleNightVision() { if (Rx_Pawn(Pawn) != None) Rx_Pawn(Pawn).ToggleNightVision(); }
	//SetTimer(1.0, false, nameof(ServerEndGame)); //ServerEndGame(); 
	exec function EndGame() { }
	exec function AllRelevant(int i) { if(i == 2492) ServerAllRelevant(); }
	function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot) { if(!Rx_Pawn(Pawn).bDodging) { Super.ProcessMove(DeltaTime,NewAccel,DoubleClickMove,DeltaRot); } }	
	function PlayerMove( float DeltaTime ) {
		local vector			X,Y,Z, NewAccel;
		local eDoubleClickDir	DoubleClickMove;
		local rotator			OldRotation;
		local bool				bSaveJump;
		GroundPitch = 0; // from UTPlayerController.PlayerMove()
		if( Pawn == None ) { GotoState('Dead'); }
		else { GetAxes(Pawn.Rotation,X,Y,Z); 
			// Update acceleration.
			NewAccel = PlayerInput.aForward*X + PlayerInput.aStrafe*Y;
			NewAccel.Z	= 0;
			NewAccel = Pawn.AccelRate * Normal(NewAccel);
			if (IsLocalPlayerController()) { AdjustPlayerWalkingMoveAccel(NewAccel); } DoubleClickMove = CheckForOneClickDodge();
			if(DoubleClickMove == DCLICK_None) DoubleClickMove = PlayerInput.CheckForDoubleClickMove( DeltaTime/WorldInfo.TimeDilation );
			// Update rotation.
			OldRotation = Rotation; UpdateRotation( DeltaTime );
			if (bPressedJump && Pawn.CannotJumpNow() ) { bSaveJump = true; bPressedJump = false; }
			else {bSaveJump = false; }
			// then save this move and replicate it
			if( Role < ROLE_Authority ) { ReplicateMove(DeltaTime, NewAccel, DoubleClickMove, OldRotation - Rotation); }
			else { ProcessMove(DeltaTime, NewAccel, DoubleClickMove, OldRotation - Rotation); } bPressedJump = bSaveJump;
			// Update Parachute
			if (Rx_Pawn(Pawn) != none) { Rx_Pawn(Pawn).TargetParachuteAnimState.X =  FClamp(PlayerInput.aForward, -1,1); Rx_Pawn(Pawn).TargetParachuteAnimState.Y =  FClamp(PlayerInput.aStrafe, -1,1); }
		}
	}
}



 


 

Rx_Mutator_Deck_Pawn.uc (Download)

Spoiler


/******************************************************************************
*  Modified by Ukill, this can contain parts of code written by Jessica\Yosh  *
*           This mutator will add function to the Renegade X game             *
*******************************************************************************
* Rx_Mutator_Deck_Controller                                                  *
******************************************************************************/

// Rx_Mutator_DoubleJump_Controller
class Rx_Mutator_Deck_Controller extends Rx_Controller;

/*
// Rx_Mutator_DoubleJump_Controller
function ChangeToSBH(bool sbh) {
	local pawn p; local vector l; local rotator r; 
	p = Pawn; l = Pawn.Location; r = Pawn.Rotation; 
	if(self.Pawn.class != class'Rx_Mutator_Deck_Pawn' ) { UnPossess(); p.Destroy(); p = Spawn( class'Rx_Mutator_Deck_Pawn', , ,l,r); } Possess(p, false); }
*/

// Rx_Mutator_DoubleJump_Controller
function CheckJumpOrDuck() { 
	if ( Pawn == None ) { return; } 
	if ( bDoubleJump && (bUpdating || ((Rx_Pawn(Pawn) != None) && Rx_Pawn(Pawn).CanDoubleJump())) ) { Rx_Pawn(Pawn).DoDoubleJump( bUpdating ); bDoubleJump = false; }
    else if ( bPressedJump ) { Pawn.DoJump( bUpdating ); } 
	if ( Pawn.Physics != PHYS_Falling && Pawn.bCanCrouch ) { Pawn.ShouldCrouch(bDuck != 0); }
}


 

 

  • Like 1

User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
×
×
  • Create New...