-
Notifications
You must be signed in to change notification settings - Fork 0
/
SubBossPatriarchDK.uc
318 lines (274 loc) · 17.1 KB
/
SubBossPatriarchDK.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
class SubBossPatriarchDK extends HardPat;
var bool bHasBoss;
function ClawDamageTarget()
{
local vector PushDir;
local name Anim;
local float frame,rate;
local float UsedMeleeDamage;
local bool bDamagedSomeone;
local KFHumanPawn P;
local Actor OldTarget;
if(MeleeDamage > 1)
UsedMeleeDamage =(MeleeDamage -(MeleeDamage * 0.05))+(MeleeDamage *(FRand()* 0.1));
else
UsedMeleeDamage=MeleeDamage;
GetAnimParams(1, Anim,frame,rate);
MeleeRange=ClawMeleeDamageRange;
if(Controller!=none && Controller.Target!=none)
PushDir =(damageForce * Normal(Controller.Target.Location - Location));
else
PushDir=damageForce * vector(Rotation);
//Flame. Damage to turrets and other actors
if(!Controller.Target.IsA('KFHumanPawn'))
MeleeDamageTarget(UsedMeleeDamage, PushDir);
//
// Begin Balance Round 1(damages everyone in Round 2 and added seperate code path for MeleeImpale in Round 3)
OldTarget=Controller.Target;
foreach DynamicActors(class'KFHumanPawn', P)
{
if((P.Location - Location)dot PushDir > 0.0)// Added dot Product check in Balance Round 3
{
Controller.Target=P;
bDamagedSomeone=bDamagedSomeone || MeleeDamageTarget(UsedMeleeDamage, damageForce * Normal(P.Location - Location)); // Always pushing players away added in Balance Round 3
}
}
Controller.Target=OldTarget;
MeleeRange=Default.MeleeRange;
// End Balance Round 1, 2, and 3
if(bDamagedSomeone)
PlaySound(MeleeAttackHitSound, SLOT_Interact, 2.0);
}
function bool MakeGrandEntry()
{
return false; // никаких роликов о появлении патриарха. Это не финальная волна, и он появится незамеченным.
}
State Escaping
{
function BeginHealing()
{
Destroyed();
Destroy(); // вместо того чтобы похилиться, он исчезает с карты.
}
}
function Died(Controller Killer, class<DamageType> damageType, vector HitLocation)
{
Super(KFMonster).Died(Killer,damageType,HitLocation); // По идее его не должны убить, но если уж случится, не должно быть никаких зед таймов и видов сбоку.
}
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
HealingLevels[0] = Health * 0.00; // Начнёт убегать, когда отнимут 100% хп.
HealingLevels[1] = Health * 0.00;
HealingLevels[2] = Health * 0.00;
}
function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType, optional int HitIndex)
{
local float DamagerDistSq;
local float UsedPipeBombDamScale;
local KFHumanPawn P;
local int NumPlayersSurrounding;
local bool bDidRadialAttack;
local float HeadShotCheckScale;
HeadShotCheckScale *= 1.5;
// Do larger headshot checks if it is a melee attach
if( class<KFProjectileWeaponDamageType>(damageType) != none )
{
HeadShotCheckScale *= 1.5;
}
//log(GetStateName()$" Took damage. Health="$Health$" Damage = "$Damage$" HealingLevels "$HealingLevels[SyringeCount]);
// Check for melee exploiters trying to surround the patriarch
if( Level.TimeSeconds - LastMeleeExploitCheckTime > 1.0 && (class<DamTypeMelee>(damageType) != none
|| class<KFProjectileWeaponDamageType>(damageType) != none) )
{
LastMeleeExploitCheckTime = Level.TimeSeconds;
NumLumberJacks = 0;
NumNinjas = 0;
foreach DynamicActors(class'KFHumanPawn', P)
{
// look for guys attacking us within 3 meters
if ( VSize(P.Location - Location) < 150 )
{
NumPlayersSurrounding++;
if( P != none && P.Weapon != none )
{
if( Axe(P.Weapon) != none || Chainsaw(P.Weapon) != none )
{
NumLumberJacks++;
}
else if( Katana(P.Weapon) != none )
{
NumNinjas++;
}
}
if( !bDidRadialAttack && NumPlayersSurrounding >= 3 )
{
bDidRadialAttack = true;
GotoState('RadialAttack');
break;
}
}
}
}
if ( class<DamTypeCrossbow>(damageType) == none && class<DamTypeCrossbowHeadShot>(damageType) == none )
{
bOnlyDamagedByCrossbow = false;
}
// Scale damage from the pipebomb down a bit if lots of pipe bomb damage happens
// at around the same times. Prevent players from putting all thier pipe bombs
// in one place and owning the patriarch in one blow.
if ( class<DamTypePipeBomb>(damageType) != none )
{
UsedPipeBombDamScale = FMax(0,(1.0 - PipeBombDamageScale));
PipeBombDamageScale += 0.075;
if( PipeBombDamageScale > 1.0 )
{
PipeBombDamageScale = 1.0;
}
Damage *= UsedPipeBombDamScale;
}
Super(KFMonster).TakeDamage(Damage,instigatedBy,hitlocation,Momentum,damageType);
if( Level.TimeSeconds - LastDamageTime > 10 )
{
ChargeDamage = 0;
}
else
{
LastDamageTime = Level.TimeSeconds;
ChargeDamage += Damage;
}
if( ShouldChargeFromDamage() && ChargeDamage > 200 )
{
// If someone close up is shooting us, just charge them
if( InstigatedBy != none )
{
DamagerDistSq = VSizeSquared(Location - InstigatedBy.Location);
if( DamagerDistSq < (700 * 700) )
{
SetAnimAction('transition');
ChargeDamage=0;
LastForceChargeTime = Level.TimeSeconds;
GoToState('Charging');
return;
}
}
}
if(Health<=0 || IsInState('RadialAttack'))
Return;
}
state FireMissile
{
function RangedAttack(Actor A)
{
if( SyringeCount>=2 )
{
Controller.Target = A;
Controller.Focus = A;
}
}
function BeginState()
{
MissilesLeft = SyringeCount+Rand(SyringeCount);
Acceleration = vect(0,0,0);
}
function AnimEnd( int Channel )
{
local vector Start;
local Rotator R;
Start = GetBoneCoords('tip').Origin;
if( Controller.Target==None )
Controller.Target = Controller.Enemy;
if ( !SavedFireProperties.bInitialized )
{
SavedFireProperties.AmmoClass = MyAmmo.Class;
SavedFireProperties.ProjectileClass = Class'BossLAWProj';
SavedFireProperties.WarnTargetPct = 0.15;
SavedFireProperties.MaxRange = 10000;
SavedFireProperties.bTossed = False;
SavedFireProperties.bLeadTarget = True;
SavedFireProperties.bInitialized = true;
}
SavedFireProperties.bInstantHit = (SyringeCount<1);
SavedFireProperties.bTrySplash = (SyringeCount>=2);
R = AdjustAim(SavedFireProperties,Start,100);
PlaySound(RocketFireSound,SLOT_Interact,2.0,,TransientSoundRadius,,false);
Spawn(Class'BossLAWProj',,,Start,R);
bShotAnim = true;
Acceleration = vect(0,0,0);
SetAnimAction('FireEndMissile');
HandleWaitForAnim('FireEndMissile');
// Randomly send out a message about Patriarch shooting a rocket(5% chance)
if ( FRand() < 0.05 && Controller.Enemy != none && PlayerController(Controller.Enemy.Controller) != none )
{
PlayerController(Controller.Enemy.Controller).Speech('AUTO', 10, "");
}
if( MissilesLeft==0 )
GoToState('');
else
{
--MissilesLeft;
GoToState(,'SecondMissile');
}
}
Begin:
while ( true )
{
Acceleration = vect(0,0,0);
Sleep(0.1);
}
SecondMissile:
Acceleration = vect(0,0,0);
Sleep(0.5f);
AnimEnd(0);
}
function float NumPlayersHealthModifer() // Свои отдельные настройки хп в зависимости от игроков.
{
local float AdjustedModifier;
local int NumEnemies,CurLevel;
local Controller C;
AdjustedModifier = 0.0;
For( C=Level.ControllerList; C!=None; C=C.NextController )
{
if( C.bIsPlayer && C.Pawn!=None && C.Pawn.Health > 0 )
{
NumEnemies++;
CurLevel = KFPlayerReplicationInfo(C.PlayerReplicationInfo).ClientVeteranSkillLevel;
if ( CurLevel < 9 )
{
AdjustedModifier += 1.0;
}
else if ( CurLevel < 10 )
{
AdjustedModifier += 1.1;
}
else if ( CurLevel < 11 )
{
AdjustedModifier += 1.25;
}
else if ( CurLevel < 12 )
{
AdjustedModifier += 2.0;
}
else if ( CurLevel < 13 )
{
AdjustedModifier += 2.5;
}
else //if ( CurLevel > 12 )
{
AdjustedModifier += 3.0;
}
}
}
AdjustedModifier = AdjustedModifier / float(NumEnemies);
AdjustedModifier = AdjustedModifier * PlayerCountHealthScale;
return AdjustedModifier;
}
defaultproperties
{
Health=12000
HealthMax=12000
PlayerCountHealthScale=0.4
MenuName="Phantom of Kevin Clamelly"
bBoss=False
bHasBoss=False
}