Skip to content

Commit

Permalink
Add WeaponSetting ShockProjectileBlockBullets
Browse files Browse the repository at this point in the history
  • Loading branch information
Deaod committed Mar 23, 2024
1 parent fc3af74 commit ffc44af
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Classes/UTPure.uc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ var StringUtils StringUtils;
var Object SettingsHelper;
var ServerSettings Settings;

var ST_Mutator StatTrack;
var bool bStatTrackSearched;

replication
{
unreliable if (Role == ROLE_Authority)
Expand Down Expand Up @@ -84,6 +87,18 @@ function PrintVersionInfo() {
xxLog("#"$StringUtils.CenteredString(LongStr, 29, " ")$"#");
}

function ST_Mutator GetStatTrack() {
if (bStatTrackSearched)
return StatTrack;

foreach AllActors(class'ST_Mutator', StatTrack)
break;

bStatTrackSearched = true;

return StatTrack;
}

function string GetAllOptions() {
local string O;
local int Pos;
Expand Down
2 changes: 2 additions & 0 deletions Classes/WeaponSettings.uc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ var config float ShockBeamMomentum;
var config float ShockProjectileDamage;
var config float ShockProjectileHurtRadius;
var config float ShockProjectileMomentum;
var config bool ShockProjectileBlockBullets;
var config float ShockComboDamage;
var config float ShockComboMomentum;
var config float ShockComboHurtRadius;
Expand Down Expand Up @@ -238,6 +239,7 @@ defaultproperties
ShockProjectileDamage=55
ShockProjectileHurtRadius=70
ShockProjectileMomentum=1.0
ShockProjectileBlockBullets=True
ShockComboDamage=165
ShockComboHurtRadius=250
ShockComboMomentum=1.0
Expand Down
28 changes: 28 additions & 0 deletions Classes/bbPlayer.uc
Original file line number Diff line number Diff line change
Expand Up @@ -3484,6 +3484,34 @@ simulated function actor NN_TraceShot(out vector HitLocation, out vector HitNorm
return Other;
}

function Actor TraceShot(out vector HitLocation, out vector HitNormal, vector EndTrace, vector StartTrace)
{
local Actor A, Other;
local ST_Mutator STM;
local bool bSProjBlocks;
local bool bWeaponShock;

STM = zzUTPure.GetStatTrack();
bSProjBlocks = true;
if (STM != none)
bSProjBlocks = STM.WeaponSettings.ShockProjectileBlockBullets;
bWeaponShock = (Weapon != none && Weapon.IsA('ShockRifle'));

foreach TraceActors( class'Actor', A, HitLocation, HitNormal, EndTrace, StartTrace) {
if (Pawn(A) != none) {
if ((A != self) && Pawn(A).AdjustHitLocation(HitLocation, EndTrace - StartTrace))
Other = A;
} else if ((A == Level) || (Mover(A) != None) || A.bProjTarget || (A.bBlockPlayers && A.bBlockActors)) {
if (bSProjBlocks || A.IsA('ShockProj') == false || bWeaponShock)
Other = A;
}

if (Other != none)
break;
}
return Other;
}

simulated function xxEnableCarcasses()
{
local Carcass C;
Expand Down

0 comments on commit ffc44af

Please sign in to comment.