Skip to content

Commit

Permalink
Merge branch 'master' into ball-comp
Browse files Browse the repository at this point in the history
  • Loading branch information
Deaod committed Jul 30, 2024
2 parents 1284ca7 + 1d370fd commit 513c7c5
Show file tree
Hide file tree
Showing 23 changed files with 264 additions and 79 deletions.
32 changes: 18 additions & 14 deletions Classes/ClientSettings.uc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ var CrosshairLayer TopLayer;

var config float MenuX, MenuY, MenuWidth, MenuHeight;

var Sound DefaultHitSound[16];
var Sound LoadedHitSound[16];

simulated function AppendLayer(CrosshairLayer L) {
if (BottomLayer == none) {
BottomLayer = L;
Expand Down Expand Up @@ -164,21 +167,22 @@ simulated function CreateCrosshairLayers() {
}
}

simulated function CheckConfig(string PackageBaseName) {
simulated function LoadHitSounds() {
local int i;
local string PackageName;

PackageName = class'StringUtils'.static.GetPackage();

for (i = 0; i < arraycount(sHitSound); i++) {
if (Left(sHitSound[i], Len(PackageBaseName)) ~= PackageBaseName) {
sHitSound[i] = class'StringUtils'.static.GetPackage()$Mid(sHitSound[i], InStr(sHitSound[i], "."));
}
if (sHitSound[i] == "" && sHitSound[i] != default.sHitSound[i]) {
sHitSound[i] = default.sHitSound[i];
}
if (sHitSound[i] != "" && (sHitSound[i] ~= "none") == false)
LoadedHitSound[i] = Sound(DynamicLoadObject(sHitSound[i], class'Sound', true));
else
LoadedHitSound[i] = none;

if (LoadedHitSound[i] == none && DefaultHitSound[i] != none)
LoadedHitSound[i] = DefaultHitSound[i];
}
}

simulated function CheckConfig() {
LoadHitSounds();
CreateCrosshairLayers();

if (FPSCounterSmoothingStrength <= 0)
Expand Down Expand Up @@ -425,10 +429,10 @@ defaultproperties
SelectedTeamHitSound=2
HitSoundVolume=4
HitSoundTeamVolume=4
sHitSound(0)="InstaGibPlusAssets_v1.HitSound"
sHitSound(1)="UnrealShare.StingerFire"
sHitSound(2)="InstaGibPlusAssets_v1.HitSoundFriendly"
sHitSound(3)="InstaGibPlusAssets_v1.HitSound1"
DefaultHitSound(0)=Sound'HitSound'
DefaultHitSound(1)=Sound'StingerFire'
DefaultHitSound(2)=Sound'HitSoundFriendly'
DefaultHitSound(3)=Sound'HitSound1'
cShockBeam=1
bHideOwnBeam=False
bBeamEnableLight=True
Expand Down
2 changes: 2 additions & 0 deletions Classes/IGPlus_CrosshairSettingsContent.uc
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ function Created() {
Edit_OffsetX.SetDelayedNotify(true);
Edit_OffsetX.SetNumericOnly(true);
Edit_OffsetX.SetNumericFloat(false);
Edit_OffsetX.SetNumericNegative(true);
Edit_OffsetX.EditBoxWidthFraction = (1.0/3.0);
Edit_OffsetX.EditBoxWidth = 50;

Expand All @@ -217,6 +218,7 @@ function Created() {
Edit_OffsetY.SetDelayedNotify(true);
Edit_OffsetY.SetNumericOnly(true);
Edit_OffsetY.SetNumericFloat(false);
Edit_OffsetY.SetNumericNegative(true);
Edit_OffsetY.EditBoxWidthFraction = (1.0/3.0);
Edit_OffsetY.EditBoxWidth = 50;

Expand Down
43 changes: 43 additions & 0 deletions Classes/IGPlus_EditBox.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
class IGPlus_EditBox extends UWindowEditBox;

var bool bNumericNegative;

function KeyType(int Key, float MouseX, float MouseY) {
if (bCanEdit == false || bKeyDown == false)
return;

if (bControlDown)
return;

if (bAllSelected)
Clear();

bAllSelected = False;

if (bNumericOnly) {
if (Key >= 0x30 && Key <= 0x39)
Insert(Key);
if (bNumericNegative) {
if (Key == 0x2D && Left(Value, 1) != "-") {
Value = "-"$Value;
CaretOffset += 1;

if (bDelayedNotify)
bChangePending = true;
else
Notify(DE_Change);
} else if (Key == 0x2B && Left(Value, 1) == "-") {
Value = Mid(Value, 1);
CaretOffset -= 1;

if (bDelayedNotify)
bChangePending = true;
else
Notify(DE_Change);
}
}
} else {
if (Key >= 0x20 && Key < 0x80)
Insert(Key);
}
}
16 changes: 16 additions & 0 deletions Classes/IGPlus_EditControl.uc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@ var float EditBoxMinWidth;
var float EditBoxMaxWidth;
var float EditBoxWidthFraction;

function Created() {
Super.Created();

EditBox = IGPlus_EditBox(CreateWindow(class'IGPlus_EditBox', 0, 0, WinWidth, WinHeight));
EditBox.NotifyOwner = Self;
EditBox.bSelectOnFocus = True;

EditBoxWidth = WinWidth / 2;

SetEditTextColor(LookAndFeel.EditBoxTextColor);
}

function AfterCreate() {
EditBoxWidthFraction = FClamp(EditBoxWidth / WinWidth, 0.05, 0.95);
EditBoxMinWidth = WinWidth * EditBoxWidthFraction;
EditBoxMaxWidth = WinWidth * EditBoxWidthFraction;
}

function SetNumericNegative(bool bEnable) {
IGPlus_EditBox(EditBox).bNumericNegative = bEnable;
}

function MouseLeave() {
Super.MouseLeave();
if(HelpText != "") ToolTip("");
Expand Down
14 changes: 2 additions & 12 deletions Classes/IGPlus_HitFeedbackTracker.uc
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,7 @@ function bool HandlePickupQuery(Inventory Item) {
return false;
}

function int ArmorPriority(name DamageType) {
return MaxInt;
}

function int ArmorAbsorbDamage(int Damage, name DamageType, vector HitLocation) {
function Inventory PrioritizeArmor(int Damage, name DamageType, vector HitLocation) {
LastDamage = Damage;
return Damage;
}

defaultproperties {
bIsAnArmor=True
ArmorAbsorption=0
Charge=0
return super.PrioritizeArmor(Damage, DamageType, HitLocation);
}
8 changes: 3 additions & 5 deletions Classes/IGPlus_SettingsContent.uc
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ function SetUpHitSoundComboBox(IGPlus_ComboBox Cmb) {
Cmb.EditBox.bDelayedNotify = true;
Cmb.Clear();
for (i = 0; i < arraycount(Settings.sHitSound); ++i)
Cmb.AddItem(Settings.sHitSound[i], string(i));
Cmb.AddItem(string(Settings.LoadedHitSound[i]), string(i));
}

function SetUpHitSourceComboBox(IGPlus_ComboBox Cmb) {
Expand Down Expand Up @@ -772,6 +772,7 @@ function SaveHitSounds() {
Settings.sHitSound[i++] = Item.Value;
Item = UWindowComboListItem(Item.Next);
}
Settings.LoadHitSounds();
}

function ShowCrosshairFactoryDialog() {
Expand Down Expand Up @@ -907,6 +908,7 @@ function Created() {
Cmb_HitMarkerColorMode.AddItem(HitMarkerColorModeTeamColor);
Edit_HitMarkerSize = CreateEdit(ECT_Integer, HitMarkerSizeText, HitMarkerSizeHelp, , 64);
Edit_HitMarkerOffset = CreateEdit(ECT_Integer, HitMarkerOffsetText, HitMarkerOffsetHelp, , 64);
Edit_HitMarkerOffset.SetNumericNegative(true);
Edit_HitMarkerDuration = CreateEdit(ECT_Real, HitMarkerDurationText, HitMarkerDurationHelp, , 64);
Edit_HitMarkerDecayExponent = CreateEdit(ECT_Real, HitMarkerDecayExponentText, HitMarkerDecayExponentHelp, , 64);
Chk_EnableHitMarker = CreateCheckbox(EnableHitMarkerText, EnableHitMarkerHelp);
Expand Down Expand Up @@ -1147,10 +1149,6 @@ function Save() {
Settings.HitSoundTeamVolume = float(Edit_HitSoundTeamVolume.GetValue());
Settings.SelectedTeamHitSound = Cmb_SelectedTeamHitSound.GetSelectedIndex2();

// force reloading of hit sounds in case the selected ones changed
class'bbPlayerStatics'.default.PlayedHitSound = none;
class'bbPlayerStatics'.default.PlayedTeamHitSound = none;

SaveHitSounds();

Settings.bEnableKillCam = Chk_EnableKillCam.bChecked;
Expand Down
2 changes: 1 addition & 1 deletion Classes/ST_FlakSlug.uc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function NewExplode(vector HitLocation, vector HitNormal, bool bDirect)
local vector start;
local ST_UTChunkInfo CI;

if (STM.WeaponSettings.bEnableEnhancedSplash) {
if (STM.WeaponSettings.bEnableEnhancedSplashFlakSlug) {
STM.EnhancedHurtRadius(
self,
STM.WeaponSettings.FlakSlugDamage,
Expand Down
39 changes: 33 additions & 6 deletions Classes/ST_Mutator.uc
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,6 @@ function bool CheckHeadShot(Pawn P, vector HitLocation, vector Direction) {
if (P == none)
return false;

if (WeaponSettings.bEnhancedHeadshotDetection == false)
return (HitLocation.Z - P.Location.Z > 0.62 * P.CollisionHeight);

if (HitLocation.Z - P.Location.Z <= 0.3 * P.CollisionHeight)
return false;

Expand Down Expand Up @@ -475,9 +472,6 @@ function bool CheckBodyShot(Pawn P, vector HitLocation, vector Direction) {
if (P == none)
return false;

if (WeaponSettings.bEnhancedHeadshotDetection == false)
return CheckHeadShot(P, HitLocation, Direction) == false;

if (CollChecker == none || CollChecker.bDeleteMe) {
CollChecker = Spawn(class'ST_HitTestHelper',self, , P.Location);
CollChecker.bCollideWorld = false;
Expand Down Expand Up @@ -510,6 +504,39 @@ function bool CheckBodyShot(Pawn P, vector HitLocation, vector Direction) {
return Result;
}

function Actor TraceShot(out vector HitLocation, out vector HitNormal, vector EndTrace, vector StartTrace, Pawn PawnOwner) {
local Actor A, Other;
local Pawn P;
local bool bSProjBlocks;
local bool bWeaponShock;
local vector Dir;

bSProjBlocks = WeaponSettings.ShockProjectileBlockBullets;
bWeaponShock = (PawnOwner.Weapon != none && PawnOwner.Weapon.IsA('ShockRifle'));
Dir = Normal(EndTrace - StartTrace);

foreach TraceActors(class'Actor', A, HitLocation, HitNormal, EndTrace, StartTrace) {
P = Pawn(A);
if (P != none) {
if (P == PawnOwner)
continue;
if (P.AdjustHitLocation(HitLocation, EndTrace - StartTrace) == false)
continue;
if (CheckBodyShot(P, HitLocation, Dir) == false && CheckHeadShot(P, HitLocation, Dir) == false)
continue;

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;
}

defaultproperties {
DefaultWeapon=Class'ST_ImpactHammer'

Expand Down
4 changes: 2 additions & 2 deletions Classes/ST_Razor2.uc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ auto state Flying
Dir = Normal(Velocity);
if (bCanHitInstigator || (Other != Instigator)) {
if (Role == ROLE_Authority) {
if (Other.bIsPawn && STM.CheckHeadshot(Pawn(Other), HitLocation, Dir) &&
if (Other.bIsPawn && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight) &&
(!Instigator.IsA('Bot') || !Bot(Instigator).bNovice)
) {
Other.TakeDamage(
Expand All @@ -37,7 +37,7 @@ auto state Flying
STM.WeaponSettings.RipperHeadshotMomentum * MomentumTransfer * Dir,
'decapitated'
);
} else if (Other.bIsPawn == false || STM.CheckBodyShot(Pawn(Other), HitLocation, Dir)) {
} else {
Other.TakeDamage(
STM.WeaponSettings.RipperPrimaryDamage,
instigator,
Expand Down
2 changes: 1 addition & 1 deletion Classes/ST_Razor2Alt.uc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ auto state Flying
local float damageScale, dist;
local vector dir;

if (STM.WeaponSettings.bEnableEnhancedSplash) {
if (STM.WeaponSettings.bEnableEnhancedSplashRipperSecondary) {
STM.EnhancedHurtRadius(
self,
STM.WeaponSettings.RipperSecondaryDamage,
Expand Down
2 changes: 1 addition & 1 deletion Classes/ST_RocketMk2.uc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ auto state Flying

function BlowUp(vector HitLocation)
{
if (STM.WeaponSettings.bEnableEnhancedSplash) {
if (STM.WeaponSettings.bEnableEnhancedSplashRockets) {
STM.EnhancedHurtRadius(
self,
STM.WeaponSettings.RocketDamage,
Expand Down
4 changes: 2 additions & 2 deletions Classes/ST_ShockProj.uc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ simulated event Tick(float Delta) {
}

function SuperExplosion() {
if (STM.WeaponSettings.bEnableEnhancedSplashCombo) {
if (STM.WeaponSettings.bEnableEnhancedSplashShockCombo) {
STM.EnhancedHurtRadius(
self,
STM.WeaponSettings.ShockComboDamage,
Expand All @@ -71,7 +71,7 @@ function SuperExplosion() {

function Explode(vector HitLocation,vector HitNormal) {
PlaySound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand());
if (STM.WeaponSettings.bEnableEnhancedSplash) {
if (STM.WeaponSettings.bEnableEnhancedSplashShockProjectile) {
STM.EnhancedHurtRadius(
self,
STM.WeaponSettings.ShockProjectileDamage,
Expand Down
33 changes: 33 additions & 0 deletions Classes/ST_ShockRifle.uc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,39 @@ function PostBeginPlay()
break; // Find master :D
}

function TraceFire(float Accuracy) {
local vector HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z;
local actor Other;
local Pawn PawnOwner;

PawnOwner = Pawn(Owner);

Owner.MakeNoise(PawnOwner.SoundDampening);
GetAxes(PawnOwner.ViewRotation,X,Y,Z);
StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.Y * Y + FireOffset.Z * Z;
EndTrace = StartTrace + (Accuracy * (FRand() - 0.5 )* Y * 1000) + (Accuracy * (FRand() - 0.5 ) * Z * 1000);

if (bBotSpecialMove && (Tracked != None) && (
((Owner.Acceleration == vect(0,0,0)) && (VSize(Owner.Velocity) < 40)) ||
(Normal(Owner.Velocity) Dot Normal(Tracked.Velocity) > 0.95)
)
) {
EndTrace += 10000 * Normal(Tracked.Location - StartTrace);
} else {
AdjustedAim = PawnOwner.AdjustAim(1000000, StartTrace, 2.75*AimError, False, False);
EndTrace += (10000 * vector(AdjustedAim));
}

Tracked = None;
bBotSpecialMove = false;

if (STM.WeaponSettings.ShockBeamUseReducedHitbox)
Other = STM.TraceShot(HitLocation, HitNormal, EndTrace, StartTrace, PawnOwner);
else
Other = PawnOwner.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace);
ProcessTraceHit(Other, HitLocation, HitNormal, vector(AdjustedAim),Y,Z);
}

function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{
local PlayerPawn PlayerOwner;
Expand Down
Loading

0 comments on commit 513c7c5

Please sign in to comment.