-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSoloRocket.uc
54 lines (42 loc) · 1.31 KB
/
SoloRocket.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
class SoloRocket extends RocketMk2;
var string Sinner;
auto state Flying {
simulated function ProcessTouch(Actor Other, Vector HitLocation) {
Explode(HitLocation, Normal(HitLocation - Other.Location));
}
simulated function Explode(vector HitLocation, vector HitNormal) {
local UT_SpriteBallExplosion s;
s = Spawn(class'UT_SpriteBallExplosion',,, HitLocation + HitNormal * 16);
s.RemoteRole = ROLE_None;
BlowUpSinner(HitLocation);
Destroy();
}
function BlowUpSinner(vector HitLocation) {
local actor Victims;
local float damageScale, dist;
local vector dir;
foreach VisibleCollidingActors(class'Actor', Victims, 220, HitLocation) {
if (
PlayerPawn(Victims) != none &&
PlayerPawn(Victims).PlayerReplicationInfo.PlayerName == Sinner
) {
dir = Victims.Location - HitLocation;
dist = FMax(1, VSize(dir));
dir = dir / dist;
damageScale = 1 - FMax(0, (dist - Victims.CollisionRadius) / 220);
Victims.TakeDamage(
damageScale * Damage,
Instigator,
Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * dir,
damageScale * MomentumTransfer * dir,
MyDamageType
);
break;
}
}
MakeNoise(1);
}
}
DefaultProperties {
ExplosionDecal=none
}