-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhookLAWProj.uc
79 lines (67 loc) · 2.91 KB
/
hookLAWProj.uc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Author : Shtoyan
* Home Repo : https://github.com/InsultingPros/KFPatcher
* License : https://www.gnu.org/licenses/gpl-3.0.en.html
*/
class hookLAWProj extends LAWProj;
// https://github.com/InsultingPros/KillingFloor/blob/main/KFMod/Classes/LAWProj.uc#L218
// removed SirenScream damage type check since 90% of the time they don't disentigrate anyway...
// also prevents detonation from fire or other explosives
function TakeDamage(int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType, optional int HitIndex)
{
if (!bDud
&& DamageType != class'DamTypeFlamethrower'
&& DamageType != class'DamTypeFrag'
&& DamageType != class'DamTypeLaw'
&& DamageType != class'DamTypeM203Grenade'
&& DamageType != class'DamTypeM32Grenade'
&& DamageType != class'DamTypeM79Grenade'
&& DamageType != class'DamTypePipeBomb'
&& DamageType != class'DamTypeSealSquealExplosion'
&& DamageType != class'DamTypeSeekerSixRocket'
&& DamageType != class'DamTypeSPGrenade'
&& DamageType != class'SirenScreamDamage'
&& !ClassIsChildOf(damageType, class'DamTypeBurned'))
{
Explode(HitLocation, vect(0,0,0));
}
}
// https://github.com/InsultingPros/KillingFloor/blob/main/KFMod/Classes/LAWProj.uc#L392
// RepInfo == none fix
simulated function ProcessTouch(Actor Other, Vector HitLocation)
{
// Don't let it hit this player, or blow up on another player
// added bBlockHitPointTraces check
if (Other == none || Other == Instigator || Other.Base == Instigator || !Other.bBlockHitPointTraces)
return;
// Don't collide with bullet whip attachments
if (KFBulletWhipAttachment(Other) != none)
return;
// Don't allow hits on poeple on the same team
// fixing RepInfo == none error, and using KFPawn instead of KFHumanPawn
if (KFPawn(Other) != none && Instigator != none && KFPawn(Other).GetTeamNum() == Instigator.GetTeamNum())
return;
// Use the instigator's location if it exists. This fixes issues with
// the original location of the projectile being really far away from
// the real Origloc due to it taking a couple of milliseconds to
// replicate the location to the client and the first replicated location has
// already moved quite a bit.
if (Instigator != none)
OrigLoc = Instigator.Location;
if (!bDud && ((VSizeSquared(Location - OrigLoc) < ArmDistSquared) || OrigLoc == vect(0,0,0)))
{
if (Role == ROLE_Authority)
{
AmbientSound = none;
PlaySound(sound'ProjectileSounds.PTRD_deflect04',,2.0);
Other.TakeDamage(ImpactDamage, Instigator, HitLocation, Normal(Velocity), ImpactDamageType);
}
bDud = true;
Velocity = vect(0,0,0);
LifeSpan = 1.0;
SetPhysics(PHYS_Falling);
}
if (!bDud)
Explode(HitLocation,Normal(HitLocation-Other.Location));
}
defaultproperties{}