-
Notifications
You must be signed in to change notification settings - Fork 0
/
PatGunFire.uc
139 lines (131 loc) · 4.38 KB
/
PatGunFire.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
class PatGunFire extends KFHighROFFire;
function DoTrace(Vector Start, Rotator Dir)
{
local Vector X,Y,Z, End, HitLocation, HitNormal, ArcEnd;
local Actor Other;
local byte HitCount,HCounter;
local float HitDamage;
local array<int> HitPoints;
local KFPawn HitPawn;
local array<Actor> IgnoreActors;
local Actor DamageActor;
local KFPlayerReplicationInfo KFPRI;
local int i;
MaxRange();
Weapon.GetViewAxes(X, Y, Z);
// DamageType = SRPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.static.GetPatgunDamageType(SRPlayerReplicationInfo(Instigator.PlayerReplicationInfo));
KFPRI = KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if ( KFPRI != none && KFPRI.ClientVeteranSkill == Class'SRVetFirebug' )
DamageType=default.DamageType;
else
DamageType=Class'DamTypePG';
// ProjPerFire=default.ProjPerFire;
if ( Weapon.WeaponCentered() )
{
ArcEnd = (Instigator.Location + Weapon.EffectOffset.X * X + 1.5 * Weapon.EffectOffset.Z * Z);
}
else
{
ArcEnd = (Instigator.Location + Instigator.CalcDrawOffset(Weapon) + Weapon.EffectOffset.X * X +
Weapon.Hand * Weapon.EffectOffset.Y * Y + Weapon.EffectOffset.Z * Z);
}
X = Vector(Dir);
End = Start + TraceRange * X;
HitDamage = DamageMax;
While( (HitCount++)<10 )
{
DamageActor = none;
Other = Instigator.HitPointTrace(HitLocation, HitNormal, End, HitPoints, Start,, 1);
if( Other==None )
{
Break;
}
else if( Other==Instigator || Other.Base == Instigator )
{
IgnoreActors[IgnoreActors.Length] = Other;
Other.SetCollision(false);
Start = HitLocation;
Continue;
}
if( ExtendedZCollision(Other)!=None && Other.Owner!=None )
{
IgnoreActors[IgnoreActors.Length] = Other;
IgnoreActors[IgnoreActors.Length] = Other.Owner;
Other.SetCollision(false);
Other.Owner.SetCollision(false);
DamageActor = Pawn(Other.Owner);
}
if ( !Other.bWorldGeometry && Other!=Level )
{
HitPawn = KFPawn(Other);
if ( HitPawn != none )
{
if(!HitPawn.bDeleteMe)
HitPawn.ProcessLocationalDamage(int(HitDamage), Instigator, HitLocation, Momentum*X,DamageType,HitPoints);
IgnoreActors[IgnoreActors.Length] = Other;
IgnoreActors[IgnoreActors.Length] = HitPawn.AuxCollisionCylinder;
Other.SetCollision(false);
HitPawn.AuxCollisionCylinder.SetCollision(false);
DamageActor = Other;
}
else
{
if( KFMonster(Other)!=None )
{
IgnoreActors[IgnoreActors.Length] = Other;
Other.SetCollision(false);
DamageActor = Other;
}
else if( DamageActor == none )
{
DamageActor = Other;
}
Other.TakeDamage(int(HitDamage), Instigator, HitLocation, Momentum*X, DamageType);
}
if( (HCounter++)>=4 || Pawn(DamageActor)==None )
{
Break;
}
HitDamage*=0.8;
Start = HitLocation;
}
else if ( HitScanBlockingVolume(Other)==None )
{
if( KFWeaponAttachment(Weapon.ThirdPersonActor)!=None )
KFWeaponAttachment(Weapon.ThirdPersonActor).UpdateHit(Other,HitLocation,HitNormal);
Break;
}
}
for (i=0; i<IgnoreActors.Length; i++)
{
if(IgnoreActors[i]!=none)
IgnoreActors[i].SetCollision(true);
}
}
defaultproperties
{
FireEndSound=Sound'KF_BasePatriarch.Attack.Kev_MG_TurbineWindDown'
AmbientFireSound=Sound'KF_BasePatriarch.Attack.Kev_MG_GunfireLoop'
RecoilRate=0.005000
maxVerticalRecoilAngle=10
maxHorizontalRecoilAngle=10
RecoilVelocityScale=0.000000
ShellEjectClass=Class'ServerPerksDZ.PattyShellEject'
ShellEjectBoneName="Barrel"
DamageType=Class'ServerPerksDZ.DamTypePGF'
DamageMax=300
Momentum=5500.000000
FireLoopAnim="FireLoop"
FireEndAnim="FireLoopEnd"
FireRate=0.100000
AmmoClass=Class'ServerPerksDZ.PatGunAmmo'
ShakeRotMag=(X=25.000000,Y=25.000000,Z=125.000000)
ShakeRotRate=(X=10000.000000,Y=10000.000000,Z=10000.000000)
ShakeRotTime=0.000000
ShakeOffsetMag=(X=4.000000,Y=2.500000,Z=5.000000)
ShakeOffsetRate=(X=1000.000000,Y=1000.000000,Z=1000.000000)
ShakeOffsetTime=1.250000
FlashEmitterClass=Class'ROEffects.MuzzleFlash1stMG'
Spread=0.005
SpreadStyle=SS_Random
}