Skip to content

Commit

Permalink
Add ShockProjectileBlockFlakChunk & ShockProjectileBlockFlakSlug
Browse files Browse the repository at this point in the history
These two settings control whether Flak Cannon primary fire chunks and secondary fire slugs can pass through Shock Balls.
  • Loading branch information
rxut authored Oct 17, 2024
1 parent 18d6d61 commit c040075
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 10 deletions.
28 changes: 26 additions & 2 deletions Classes/ST_FlakSlug.uc
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,35 @@
class ST_FlakSlug extends flakslug;

var ST_Mutator STM;
var WeaponSettingsRepl WSettings;

simulated final function WeaponSettingsRepl FindWeaponSettings() {
local WeaponSettingsRepl S;

foreach AllActors(class'WeaponSettingsRepl', S)
return S;

return none;
}

simulated final function WeaponSettingsRepl GetWeaponSettings() {
if (WSettings != none)
return WSettings;

WSettings = FindWeaponSettings();
return WSettings;
}

function ProcessTouch (Actor Other, vector HitLocation)
{
if ( Other != instigator )
NewExplode(HitLocation,Normal(HitLocation-Other.Location), Other.IsA('Pawn'));

if (Other == Instigator)
return;

if (Other.IsA('ShockProj') && GetWeaponSettings().ShockProjectileBlockFlakSlug == false)
return; // If ShockProjectileBlockFlakSlug is False, we do nothing and the flak slug passes through

NewExplode(HitLocation, Normal(HitLocation-Other.Location), Other.IsA('Pawn'));
}

function NewExplode(vector HitLocation, vector HitNormal, bool bDirect)
Expand Down
4 changes: 2 additions & 2 deletions Classes/ST_UTChunk.uc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ function ProcessTouch (Actor Other, vector HitLocation)
if (Physics == PHYS_None)
return;

// For ShockProjectileBlockFlak
if (ShockProj(Other) != None && Chunkie.STM.WeaponSettings.ShockProjectileBlockFlak)
// For ShockProjectileBlockFlakChunk
if (ShockProj(Other) != None && Chunkie.STM.WeaponSettings.ShockProjectileBlockFlakChunk)
return;

if ( (Chunk(Other) == None) && ((Physics == PHYS_Falling) || (Other != Instigator)) )
Expand Down
6 changes: 4 additions & 2 deletions Classes/WeaponSettings.uc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ var config float ShockProjectileDamage;
var config float ShockProjectileHurtRadius;
var config float ShockProjectileMomentum;
var config bool ShockProjectileBlockBullets;
var config bool ShockProjectileBlockFlak;
var config bool ShockProjectileBlockFlakChunk;
var config bool ShockProjectileBlockFlakSlug;
var config bool ShockProjectileTakeDamage;
var config bool ShockProjectileCompensatePing;
var config float ShockProjectileHealth;
Expand Down Expand Up @@ -258,7 +259,8 @@ defaultproperties
ShockProjectileHurtRadius=70
ShockProjectileMomentum=1.0
ShockProjectileBlockBullets=True
ShockProjectileBlockFlak=True
ShockProjectileBlockFlakChunk=True
ShockProjectileBlockFlakSlug=True
ShockProjectileTakeDamage=False
ShockProjectileCompensatePing=False
ShockProjectileHealth=30
Expand Down
13 changes: 9 additions & 4 deletions Classes/WeaponSettingsRepl.uc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ var float ShockProjectileDamage;
var float ShockProjectileHurtRadius;
var float ShockProjectileMomentum;
var bool ShockProjectileBlockBullets;
var bool ShockProjectileBlockFlak;
var bool ShockProjectileBlockFlakChunk;
var bool ShockProjectileBlockFlakSlug;
var bool ShockProjectileTakeDamage;
var bool ShockProjectileCompensatePing;
var float ShockProjectileHealth;
Expand Down Expand Up @@ -202,7 +203,8 @@ replication {
ShockProjectileHurtRadius,
ShockProjectileMomentum,
ShockProjectileBlockBullets,
ShockProjectileBlockFlak,
ShockProjectileBlockFlakChunk,
ShockProjectileBlockFlakSlug,
ShockProjectileTakeDamage,
ShockProjectileCompensatePing,
ShockProjectileHealth,
Expand Down Expand Up @@ -528,7 +530,9 @@ function InitFromWeaponSettings(WeaponSettings S) {
ShockProjectileHurtRadius = S.ShockProjectileHurtRadius;
ShockProjectileMomentum = S.ShockProjectileMomentum;
ShockProjectileBlockBullets = S.ShockProjectileBlockBullets;
ShockProjectileBlockFlak = S.ShockProjectileBlockFlak;
ShockProjectileBlockFlakChunk = S.ShockProjectileBlockFlakChunk;
ShockProjectileBlockFlakSlug = S.ShockProjectileBlockFlakSlug;

ShockProjectileTakeDamage = S.ShockProjectileTakeDamage;
ShockProjectileCompensatePing = S.ShockProjectileCompensatePing;
ShockProjectileHealth = S.ShockProjectileHealth;
Expand Down Expand Up @@ -694,7 +698,8 @@ defaultproperties
ShockProjectileHurtRadius=70
ShockProjectileMomentum=1.0
ShockProjectileBlockBullets=True
ShockProjectileBlockFlak=True
ShockProjectileBlockFlakChunk=True
ShockProjectileBlockFlakSlug=True
ShockProjectileTakeDamage=False
ShockProjectileCompensatePing=False
ShockProjectileHealth=30
Expand Down

0 comments on commit c040075

Please sign in to comment.