-
Notifications
You must be signed in to change notification settings - Fork 0
/
PatGunAttachment.uc
132 lines (123 loc) · 3.89 KB
/
PatGunAttachment.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
//=============================================================================
// HuskGunAttachment
//=============================================================================
// Husk Gun third person attachment class
//=============================================================================
// Killing Floor Source
// Copyright (C) 2011 Tripwire Interactive LLC
// - John "Ramm-Jaeger" Gibson
//=============================================================================
class PatGunAttachment extends KFWeaponAttachment;
var byte HuskGunCharge, OldHuskGunCharge;
var() class<Emitter> ChargeEmitterClass;
var() Emitter ChargeEmitter;
replication
{
// Things the server should send to the client.
reliable if( bNetDirty && (!bNetOwner || bDemoRecording || bRepClientDemo) && (Role==ROLE_Authority) )
HuskGunCharge;
}
simulated function PostNetReceive()
{
if( HuskGunCharge!=OldHuskGunCharge )
{
OldHuskGunCharge = HuskGunCharge;
UpdateHuskGunCharge();
}
}
simulated function UpdateHuskGunCharge()
{
local float ChargeScale;
if( Level.NetMode == NM_DedicatedServer )
{
return;
}
if( HuskGunCharge == 0 )
{
DestroyChargeEffect();
}
else
{
InitChargeEffect();
ChargeScale = float(HuskGunCharge)/255.0;
ChargeEmitter.Emitters[0].SizeScale[1].RelativeSize = Lerp( ChargeScale, 1, 3 );
ChargeEmitter.Emitters[1].StartVelocityRadialRange.Min = Lerp( ChargeScale, 10, 75 );
ChargeEmitter.Emitters[1].StartVelocityRadialRange.Max = Lerp( ChargeScale, 10, 75 );
ChargeEmitter.Emitters[1].SizeScale[0].RelativeSize = Lerp( ChargeScale, 1, 3 );
}
}
simulated function Destroyed()
{
DestroyChargeEffect();
Super.Destroyed();
}
simulated function InitChargeEffect()
{
// don't even spawn on server
if ( Level.NetMode == NM_DedicatedServer)
return;
if ( (ChargeEmitterClass != None) && ((ChargeEmitter == None) || ChargeEmitter.bDeleteMe) )
{
ChargeEmitter = Spawn(ChargeEmitterClass);
if ( ChargeEmitter != None )
AttachToBone(ChargeEmitter, 'tip');
}
}
simulated function DestroyChargeEffect()
{
if (ChargeEmitter != None)
ChargeEmitter.Destroy();
}
defaultproperties
{
ChargeEmitterClass=Class'ROEffects.ChargeUp3rdHusk'
mMuzFlashClass=Class'ROEffects.MuzzleFlash3rdNadeL'
MovementAnims(0)="JogF_HuskGun"
MovementAnims(1)="JogB_HuskGun"
MovementAnims(2)="JogL_HuskGun"
MovementAnims(3)="JogR_HuskGun"
TurnLeftAnim="TurnL_HuskGun"
TurnRightAnim="TurnR_HuskGun"
CrouchAnims(0)="CHWalkF_HuskGun"
CrouchAnims(1)="CHWalkB_HuskGun"
CrouchAnims(2)="CHWalkL_HuskGun"
CrouchAnims(3)="CHWalkR_HuskGun"
WalkAnims(0)="WalkF_HuskGun"
WalkAnims(1)="WalkB_HuskGun"
WalkAnims(2)="WalkL_HuskGun"
WalkAnims(3)="WalkR_HuskGun"
CrouchTurnRightAnim="CH_TurnR_HuskGun"
CrouchTurnLeftAnim="CH_TurnL_HuskGun"
IdleCrouchAnim="CHIdle_HuskGun"
IdleWeaponAnim="Idle_HuskGun"
IdleRestAnim="Idle_HuskGun"
IdleChatAnim="Idle_HuskGun"
IdleHeavyAnim="Idle_HuskGun"
IdleRifleAnim="Idle_HuskGun"
FireAnims(0)="Fire_HuskGun"
FireAnims(1)="Fire_HuskGun"
FireAnims(2)="Fire_HuskGun"
FireAnims(3)="Fire_HuskGun"
FireAltAnims(0)="Fire_HuskGun"
FireAltAnims(1)="Fire_HuskGun"
FireAltAnims(2)="Fire_HuskGun"
FireAltAnims(3)="Fire_HuskGun"
FireCrouchAnims(0)="CHFire_HuskGun"
FireCrouchAnims(1)="CHFire_HuskGun"
FireCrouchAnims(2)="CHFire_HuskGun"
FireCrouchAnims(3)="CHFire_HuskGun"
FireCrouchAltAnims(0)="CHFire_HuskGun"
FireCrouchAltAnims(1)="CHFire_HuskGun"
FireCrouchAltAnims(2)="CHFire_HuskGun"
FireCrouchAltAnims(3)="CHFire_HuskGun"
HitAnims(0)="HitF_HuskGun"
HitAnims(1)="HitB_HuskGun"
HitAnims(2)="HitL_HuskGun"
HitAnims(3)="HitR_HuskGun"
PostFireBlendStandAnim="Blend_HuskGun"
PostFireBlendCrouchAnim="CHBlend_HuskGun"
WeaponAmbientScale=2.000000
Mesh=SkeletalMesh'PatGun_A.PatGunMesh_3rd'
DrawScale=1.250000
Skins(0)=Texture'kf_fx_trip_t.Gore.Patriarch_Gore_Limbs_Diff'
}