Skip to content

Commit

Permalink
Fixes and ComboGib
Browse files Browse the repository at this point in the history
Removed XC_ImpactEvents, replaced by better ECM_ImpactPush.

Fixed bug in LC sub-engine.

Added LCComboGib mutator.
  • Loading branch information
CacoFFF committed Dec 13, 2019
1 parent 90cbae1 commit 8628d6e
Show file tree
Hide file tree
Showing 13 changed files with 222 additions and 216 deletions.
Binary file added System/ECM.u
Binary file not shown.
6 changes: 4 additions & 2 deletions System/LCWeapons.int
@@ -1,3 +1,5 @@
[Public]
Object=(Name=LCWeapons_0022.LCMutator,Class=Class,MetaClass=Engine.Mutator,Description="Lag Compensator")
Object=(Name=LCWeapons_0022.FV_ColoredShock,Class=Class,MetaClass=Engine.Mutator,Description="LC: ColoredShock, Requires Lag Compensator mutator loaded!")
Object=(Name=LCWeapons_0024.LCMutator,Class=Class,MetaClass=Engine.Mutator,Description="Lag Compensator")
Object=(Name=LCWeapons_0024.LCComboGib,Class=Class,MetaClass=Engine.Mutator,Description="LC: ComboGib, Requires Lag Compensator mutator loaded!")
Object=(Name=LCWeapons_0024.FV_ColoredShock,Class=Class,MetaClass=Engine.Mutator,Description="LC: ColoredShock, Requires Lag Compensator mutator loaded!")

Binary file removed System/LCWeapons_0022.u
Binary file not shown.
56 changes: 56 additions & 0 deletions classes/ECM_ImpactPush.uc
@@ -0,0 +1,56 @@
//=============================================================================
// ECM_ImpactPush.
// ECM Element containing a fixed velocity push event.
// TODO: Move to base ECM
//=============================================================================
class ECM_ImpactPush expands ECM_Element;

var float PushTimeStamp;
var vector PushVelocity;


event Tick( float DeltaTime)
{
if ( ECM == None || ECM.LocalPlayer == None )
Error( "Bad client ECM");

if ( ECM.LocalPlayer.CurrentTimeStamp >= PushTimeStamp )
{
bActive = false;
Destroy();
}
}

function ClientUpdatePosition( PlayerPawn Client, SavedMove CurrentMove)
{
local float NextTimeStamp;

if ( CurrentMove.NextMove != None )
NextTimeStamp = CurrentMove.NextMove.TimeStamp;
else
NextTimeStamp = Level.TimeSeconds;

if ( (PushTimeStamp >= CurrentMove.TimeStamp) && (PushTimeStamp < NextTimeStamp) )
ProcessPush( Client);
}

function SetupPush( vector NewPushVel)
{
PushTimeStamp = Level.TimeSeconds;
PushVelocity = NewPushVel;
ProcessPush( ECM.LocalPlayer);
}

function ProcessPush( PlayerPawn Client)
{
if ( Client.Physics == PHYS_Walking )
Client.SetPhysics( PHYS_Falling);
Client.Velocity += PushVelocity;
}



defaultproperties
{
bActive=True
}
70 changes: 34 additions & 36 deletions classes/LCArenaMutator.uc
Expand Up @@ -30,54 +30,52 @@ var bool bForceCustomXLoc;
var string wProp[8], wValue[8];
var int iWp;

function Weapon GiveWeapon( Pawn PlayerPawn, class<Weapon> WeaponClass )
function Weapon GiveWeapon( Pawn PlayerPawn, class<Weapon> WeaponClass, optional bool bNoProps )
{
local int i;
local Weapon NewWeapon;

newWeapon = Weapon(PlayerPawn.FindInventoryType(WeaponClass));
if ( newWeapon != None )
return newWeapon;
newWeapon = Spawn(WeaponClass);
if( newWeapon != None )
NewWeapon = Weapon(PlayerPawn.FindInventoryType(WeaponClass));
if ( NewWeapon == None )
{
if ( LCMutator.bTeamShock && (newWeapon.Class == class'LCShockRifle') )
newWeapon.SetPropertyText("bTeamColor", "1" ); //Not the best implementation
newWeapon.RespawnTime = 0.0;
newWeapon.GiveTo(PlayerPawn);
newWeapon.bHeldItem = true;
newWeapon.GiveAmmo(PlayerPawn);
newWeapon.SetSwitchPriority(PlayerPawn);
newWeapon.WeaponSet(PlayerPawn);
newWeapon.AmbientGlow = 0;
if ( PlayerPawn.IsA('PlayerPawn') )
newWeapon.SetHand(PlayerPawn(PlayerPawn).Handedness);
else
newWeapon.GotoState('Idle');
PlayerPawn.Weapon.GotoState('DownWeapon');
PlayerPawn.PendingWeapon = None;
PlayerPawn.Weapon = newWeapon;
return newWeapon;
NewWeapon = Spawn(WeaponClass);
if( NewWeapon != None )
{
if ( LCMutator.bTeamShock && (NewWeapon.Class == class'LCShockRifle') )
NewWeapon.SetPropertyText("bTeamColor", "1" ); //Not the best implementation
NewWeapon.RespawnTime = 0.0;
NewWeapon.GiveTo(PlayerPawn);
NewWeapon.bHeldItem = true;
NewWeapon.GiveAmmo(PlayerPawn);
NewWeapon.SetSwitchPriority(PlayerPawn);
NewWeapon.WeaponSet(PlayerPawn);
NewWeapon.AmbientGlow = 0;
if ( PlayerPawn.IsA('PlayerPawn') )
NewWeapon.SetHand(PlayerPawn(PlayerPawn).Handedness);
else
NewWeapon.GotoState('Idle');
PlayerPawn.Weapon.GotoState('DownWeapon');
PlayerPawn.PendingWeapon = None;
PlayerPawn.Weapon = NewWeapon;
}
}
if ( !bNoProps && (NewWeapon != None) )
While ( i<iWp )
{
NewWeapon.SetPropertyText( wProp[i], wValue[i]);
i++;
}

return NewWeapon;
}


function ModifyPlayer( Pawn Other)
{
local Weapon W;
local int i;

if ( bForceCustomXLoc && ((DeathMatchPlus(Level.Game) == none) || !DeathMatchPlus(Level.Game).bUseTranslocator) )
GiveWeapon( Other, CustomXLocClass);
GiveWeapon( Other, CustomXLocClass, true);
if ( bGiveWeaponOnSpawn )
{
W = GiveWeapon( Other, MainWeapClass);
if ( W != none )
While ( i<iWp )
{
W.SetPropertyText( wProp[i], wValue[i]);
i++;
}
}
GiveWeapon( Other, MainWeapClass);

if ( NextMutator != None )
NextMutator.ModifyPlayer(Other);
Expand Down
101 changes: 101 additions & 0 deletions classes/LCComboGib.uc
@@ -0,0 +1,101 @@
//=============================================================================
// LCComboGib.
// Noob coders, noob coders everywhere
//=============================================================================
class LCComboGib expands LCArenaMutator
config(LCWeapons);

var() config float ForceBallDamage;
var() config float LolPushChance; //Push a player's corpse far away instead of gibbing(0-100)
var() config bool bLolAffectsTeam;
var() config bool bKeepBoots;
var() config int LimitBalls; //It doesn't make a bit of difference guys, the balls are inert - Piccolo


function AddMutator( Mutator M)
{
if ( LCMutator(M) != None )
LCMutator = LCMutator(M);
Super.AddMutator(M);
}

event PostBeginPlay()
{
SetupWeaponReplace( class'ShockRifle', class'LCShockRifle');
SetupWeaponRespawn( true, true, true, true, true, true);
SetupPickups( true, true, !bKeepBoots, false);
AddPropertyWeapon("bNoAmmoDeplete","1");
AddPropertyWeapon("MyDamageType","joltedgib");
NextDamageMutator = Level.Game.DamageMutator;
Level.Game.DamageMutator = self;
SetTimer(20,true);
SaveConfig();
}

event Timer()
{
default.ForceBallDamage = ForceBallDamage;
SaveConfig(); //Save config every 20 seconds
//This mutator's config is applied entirely on the fly
//Meaning it can be edited ingame and the effects will be seen and saved
}

function Weapon GiveWeapon( Pawn PlayerPawn, class<Weapon> WeaponClass, optional bool bNoProps )
{
local Weapon NewWeapon;

NewWeapon = Super.GiveWeapon( PlayerPawn, WeaponClass,bNoProps);
if ( !bNoProps && (FRand()*100.0 < LolPushChance) )
{
NewWeapon.MyDamageType = 'joltedlol';
if ( ShockRifle(NewWeapon) != None )
ShockRifle(NewWeapon).HitDamage = 10;
if ( LCShockRifle(NewWeapon) != None )
LCShockRifle(NewWeapon).bLolRifle = true;
}
return NewWeapon;
}

function MutatorTakeDamage( out int ActualDamage, Pawn Victim, Pawn InstigatedBy, out Vector HitLocation,
out Vector Momentum, name DamageType)
{
local float BallDamage;

if ( DamageType == 'joltedlol' )
{
if ( bLolAffectsTeam || ActualDamage > 0 )
{
if ( ActualDamage > 0 )
ActualDamage = Clamp( Victim.Health, 25, 300);
Momentum *= 7;
}
}
else if ( DamageType == 'joltedgib' ) //Ensure kill
{
if ( ActualDamage > 0 )
ActualDamage = 999;
}
else if ( ActualDamage > 0 && DamageType == 'jolted' ) //Combos and other jolted damages
{
BallDamage = 55;
if ( (DeathMatchPlus(Level.Game) != None) && DeathMatchPlus(Level.Game).bHardcoreMode )
BallDamage *= 1.5;

if ( ActualDamage > BallDamage )
ActualDamage = ForceBallDamage + (ActualDamage - BallDamage) * 5;
else if ( ForceBallDamage > 0 )
ActualDamage = ForceBallDamage;
}

if ( NextDamageMutator != None )
NextDamageMutator.MutatorTakeDamage( ActualDamage, Victim, InstigatedBy, HitLocation, Momentum, DamageType );
}


defaultproperties
{
LolPushChance=10
LimitBalls=4
ForceBallDamage=0.100000
bKeepBoots=true
}
15 changes: 5 additions & 10 deletions classes/LCImpactHammer.uc
Expand Up @@ -3,7 +3,6 @@ class LCImpactHammer expands ImpactHammer;
var XC_CompensatorChannel LCChan;
var int LCMode;

var XC_ImpactEvents ImpactEvents;
var bool bFireRelease;
var rotator BufferedDir;
var int ShootFlags;
Expand All @@ -20,10 +19,8 @@ simulated event KillCredit( actor Other)
{
if ( XC_CompensatorChannel(Other) != none )
LCChan = XC_CompensatorChannel(Other);
if ( (Level.NetMode == NM_Client) && (ImpactEvents == none) )
ForEach AllActors (class'XC_ImpactEvents', ImpactEvents)
break;
}

simulated function PlayPostSelect()
{
if ( Level.NetMode == NM_Client )
Expand Down Expand Up @@ -285,17 +282,15 @@ simulated function ProcessTraceHit( Actor Other, Vector HitLocation, Vector HitN

simulated function PlayerHitVel( vector Momentum)
{
if ( ImpactEvents == none )
ImpactEvents = Spawn(class'XC_ImpactEvents');
local ECM_ImpactPush Push;

if (Owner.Physics == PHYS_Walking)
Momentum.Z = FMax(Momentum.Z, 0.4 * VSize(Momentum));
Momentum = Momentum * 0.6 / Owner.Mass;

ImpactEvents.AddNewPush( Momentum);
Owner.Velocity += Momentum;
if ( Owner.Physics == PHYS_Walking )
Owner.SetPhysics( PHYS_Falling);
Push = Spawn( class'ECM_ImpactPush');
if ( Push != None )
Push.SetupPush( Momentum);
}


Expand Down
3 changes: 3 additions & 0 deletions classes/LCKicker.uc
Expand Up @@ -30,6 +30,9 @@ function LCKicker ServerSetup( Kicker Other)

simulated event PostNetBeginPlay()
{
//UT v469 doesn't need LCKickers
if ( int(Level.EngineVersion) >= 469 )
LifeSpan = 0.1;
SetCollision( True, False, False);
SetTimer( 1, false);
}
Expand Down
15 changes: 11 additions & 4 deletions classes/LCMutator.uc
@@ -1,12 +1,13 @@
//Keep all basic weapon replacement and standalone implementations here
class LCMutator expands XC_LagCompensation;

var Weapon ReplaceThis, ReplaceWith;
var Weapon ReplaceThis, ReplaceThisWith;
var LCSpawnNotify ReplaceSN;
var bool bApplySNReplace;
var bool bTeamShock;
var string LoadedClasses;


//Find known custom arenas, replace with LC arenas
event PreBeginPlay()
{
Expand Down Expand Up @@ -42,6 +43,13 @@ function AddMutator(Mutator M)
return;
}

if ( LCArenaMutator(M) != None )
{
LCArenaMutator(M).LCMutator = self;
ChainMutatorBeforeThis(M);
return;
}

if ( FV_ColoredShock(M) != none )
{
bTeamShock = true;
Expand All @@ -63,7 +71,6 @@ event PostBeginPlay()

function ModifyPlayer( Pawn Other)
{
local XC_LagCompensator XCLC;
Super.ModifyPlayer(Other);

if ( ffFindCompFor(Other) == none )
Expand Down Expand Up @@ -245,8 +252,8 @@ function int DoReplace
function SetReplace( Weapon Other, Weapon With)
{
ReplaceThis = Other;
ReplaceWith = With;
if ( ReplaceThis != none && ReplaceWith != none)
ReplaceThisWith = With;
if ( (ReplaceThis != none) && (ReplaceThisWith != none) )
ReplaceSN.ActorClass = ReplaceThis.class;
else
ReplaceSN.ActorClass = class'LCDummyWeapon';
Expand Down
5 changes: 4 additions & 1 deletion classes/LCShockRifle.uc
Expand Up @@ -11,6 +11,7 @@ var int LCMode;
var bool bLoaderSetup;
var bool bNoAmmoDeplete;
var bool bTeamColor;
var bool bLolRifle;
var bool bCombo;
var bool bInstantFlash;
var float ffRefireTimer; //This will enforce security checks
Expand All @@ -23,7 +24,7 @@ var class<Effects> ExplosionClass;
replication
{
reliable if ( Role == ROLE_Authority )
bTeamColor;
bTeamColor, bLolRifle;
}


Expand Down Expand Up @@ -249,6 +250,8 @@ simulated function EditBeam( ShockBeam Beam)
FV_AdaptiveBeam(Beam).AdaptFrom( BeamPrototype);
if ( bTeamColor )
Beam.Texture = Class'FVTeamShock'.default.BeamTex[ Class'LCStatics'.static.FVTeam( Pawn(Owner)) ];
if ( bLolRifle )
Beam.DrawScale *= 0.3;
}

simulated function EditExplosion( Effects Explo)
Expand Down
4 changes: 2 additions & 2 deletions classes/LCSpawnNotify.uc
Expand Up @@ -14,10 +14,10 @@ Begin:

event Actor SpawnNotification( actor A)
{
if ( (Mutator.ReplaceThis == A) && (Mutator.ReplaceWith != none) )
if ( (Mutator.ReplaceThis == A) && (Mutator.ReplaceThisWith != none) )
{
A.Destroy();
A = Mutator.ReplaceWith;
A = Mutator.ReplaceThisWith;
Mutator.SetReplace(none,none);
}
return A;
Expand Down

0 comments on commit 8628d6e

Please sign in to comment.