Skip to content

Commit e7c926f

Browse files
prakhunovDeaod
authored andcommitted
NewNet SDOM
1 parent 171fac9 commit e7c926f

12 files changed

Lines changed: 630 additions & 308 deletions

Classes/ClientShockBeam.uc

Lines changed: 165 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,166 @@
1-
class ClientShockBeam extends Effects;
2-
3-
// Settings
4-
var int Team;
5-
var float Size;
6-
var float Curve;
7-
var float Duration;
8-
var vector MoveAmount;
9-
var int NumPuffs;
10-
var bool bBeamEnableLight;
11-
12-
//
13-
var float TimeLeft;
14-
15-
var ClientShockBeam Next;
16-
var ClientShockBeam Free;
17-
18-
simulated function Tick(float DeltaTime) {
19-
if (Level.NetMode != NM_DedicatedServer) {
20-
ScaleGlow = (TimeLeft / Duration) ** Curve;
21-
22-
AmbientGlow = ScaleGlow * 210;
23-
if (Team >= 0)
24-
LightBrightness = ScaleGlow * 128;
25-
26-
TimeLeft -= DeltaTime;
27-
if (TimeLeft <= 0.0) {
28-
FreeBeam(self);
29-
}
30-
}
31-
}
32-
33-
simulated function SetProperties(int pTeam, float pSize, float pCurve, float pDuration, vector pMoveAmount, int pNumPuffs, bool pbBeamEnableLight) {
34-
Team = pTeam;
35-
Size = pSize;
36-
Duration = pDuration;
37-
Curve = pCurve;
38-
MoveAmount = pMoveAmount;
39-
NumPuffs = pNumPuffs;
40-
bBeamEnableLight = pbBeamEnableLight;
41-
42-
if (Team >= 0) {
43-
Mesh = LodMesh'Botpack.Shockbm';
44-
if (bBeamEnableLight && Level.bHighDetailMode)
45-
LightType = LT_Steady;
46-
else
47-
LightType = LT_None;
48-
LightEffect = LE_NonIncidence;
49-
LightBrightness = 192;
50-
LightSaturation = 64;
51-
LightRadius = 6;
52-
}
53-
54-
switch (Team) {
55-
case -1:
56-
// Dont
57-
break;
58-
59-
case 0:
60-
Texture = Texture'BotPack.Translocator.Tranglow';
61-
LightHue = 0;
62-
breaK;
63-
64-
case 1:
65-
Texture = Texture'BotPack.Translocator.Tranglowb';
66-
LightHue = 150;
67-
LightBrightness = 224;
68-
break;
69-
70-
case 2:
71-
Texture = Texture'BotPack.Translocator.Tranglowg';
72-
LightHue = 75;
73-
break;
74-
75-
case 3:
76-
Texture = Texture'BotPack.Translocator.Tranglowy';
77-
LightHue = 40;
78-
break;
79-
}
80-
DrawScale = 0.44 * Size;
81-
TimeLeft = Duration;
82-
83-
if (Level.NetMode != NM_DedicatedServer)
84-
SetTimer(0.05, false);
85-
}
86-
87-
simulated function Timer() {
88-
local ClientShockBeam r;
89-
90-
if (NumPuffs > 0) {
91-
r = AllocBeam(PlayerPawn(Owner));
92-
r.SetLocation(Location + MoveAmount);
93-
r.SetRotation(Rotation);
94-
r.SetProperties(Team,Size,Curve,Duration,MoveAmount, NumPuffs - 1, bBeamEnableLight);
95-
}
96-
}
97-
98-
static final function ResetBeam(ClientShockBeam Beam) {
99-
Beam.Texture = default.Texture;
100-
Beam.Mesh = default.Mesh;
101-
Beam.LightType = default.LightType;
102-
Beam.LightEffect = default.LightEffect;
103-
Beam.LightBrightness = default.LightBrightness;
104-
Beam.LightSaturation = default.LightSaturation;
105-
Beam.LightRadius = default.LightRadius;
106-
Beam.LightHue = default.LightHue;
107-
}
108-
109-
static final function ClientShockBeam AllocBeam(PlayerPawn P) {
110-
local ClientShockBeam Beam;
111-
112-
if (default.Free != none) {
113-
Beam = default.Free;
114-
default.Free = Beam.Next;
115-
Beam.Next = none;
116-
117-
Beam.bHidden = false;
118-
Beam.Enable('Tick');
119-
} else {
120-
Beam = P.Spawn(class'ClientShockBeam', P);
121-
}
122-
123-
ResetBeam(Beam);
124-
return Beam;
125-
}
126-
127-
static final function FreeBeam(ClientShockBeam Beam) {
128-
Beam.bHidden = true;
129-
Beam.LightType = LT_None;
130-
Beam.Disable('Tick');
131-
132-
Beam.Next = default.Free;
133-
default.Free = Beam;
134-
}
135-
136-
static final function Cleanup() {
137-
default.Free = none;
138-
}
139-
140-
defaultproperties
141-
{
142-
Physics=PHYS_Rotating
143-
RemoteRole=ROLE_None
144-
LifeSpan=0.000000
145-
Rotation=(Roll=20000)
146-
DrawType=DT_Mesh
147-
Style=STY_Translucent
148-
Texture=Texture'Botpack.Effects.jenergy2'
149-
Mesh=LodMesh'Botpack.Shockbm'
150-
DrawScale=0.440000
151-
bUnlit=True
152-
bParticles=True
153-
bFixedRotationDir=True
154-
RotationRate=(Roll=1000000)
155-
DesiredRotation=(Roll=20000)
1+
class ClientShockBeam extends Effects;
2+
3+
// Settings
4+
var int Team;
5+
var float Size;
6+
var float Curve;
7+
var float Duration;
8+
var vector MoveAmount;
9+
var int NumPuffs;
10+
var bool bBeamEnableLight;
11+
12+
//
13+
var float TimeLeft;
14+
15+
var ClientShockBeam Next;
16+
var ClientShockBeam Free;
17+
18+
simulated function Tick(float DeltaTime) {
19+
if (Level.NetMode != NM_DedicatedServer) {
20+
ScaleGlow = (TimeLeft / Duration) ** Curve;
21+
22+
AmbientGlow = ScaleGlow * 210;
23+
if (Team >= 0)
24+
LightBrightness = ScaleGlow * 128;
25+
26+
TimeLeft -= DeltaTime;
27+
if (TimeLeft <= 0.0) {
28+
FreeBeam(self);
29+
}
30+
}
31+
}
32+
33+
simulated function SetProperties(int pTeam, float pSize, float pCurve, float pDuration, vector pMoveAmount, int pNumPuffs, bool pbBeamEnableLight) {
34+
Team = pTeam;
35+
Size = pSize;
36+
Duration = pDuration;
37+
Curve = pCurve;
38+
MoveAmount = pMoveAmount;
39+
NumPuffs = pNumPuffs;
40+
bBeamEnableLight = pbBeamEnableLight;
41+
42+
if (Team >= 0) {
43+
Mesh = LodMesh'Botpack.Shockbm';
44+
if (bBeamEnableLight && Level.bHighDetailMode)
45+
LightType = LT_Steady;
46+
else
47+
LightType = LT_None;
48+
LightEffect = LE_NonIncidence;
49+
LightBrightness = 192;
50+
LightSaturation = 64;
51+
LightRadius = 6;
52+
}
53+
54+
switch (Team) {
55+
case -1:
56+
// Dont
57+
break;
58+
59+
case 0:
60+
Texture = Texture'BotPack.Translocator.Tranglow';
61+
LightHue = 0;
62+
break;
63+
64+
case 1:
65+
Texture = Texture'BotPack.Translocator.Tranglowb';
66+
LightHue = 150;
67+
LightBrightness = 224;
68+
break;
69+
70+
case 2:
71+
Texture = Texture'BotPack.Translocator.Tranglowg';
72+
LightHue = 75;
73+
break;
74+
75+
case 3:
76+
Texture = Texture'BotPack.Translocator.Tranglowy';
77+
LightHue = 40;
78+
break;
79+
}
80+
DrawScale = 0.44 * Size;
81+
TimeLeft = Duration;
82+
83+
if (Level.NetMode != NM_DedicatedServer)
84+
SetTimer(0.05, false);
85+
}
86+
87+
simulated function Timer() {
88+
local ClientShockBeam r;
89+
90+
if (NumPuffs > 0) {
91+
r = AllocBeam(PlayerPawn(Owner));
92+
r.SetLocation(Location + MoveAmount);
93+
r.SetRotation(Rotation);
94+
r.SetProperties(Team,Size,Curve,Duration,MoveAmount, NumPuffs - 1, bBeamEnableLight);
95+
}
96+
}
97+
98+
static final function ResetBeam(ClientShockBeam Beam) {
99+
Beam.Texture = default.Texture;
100+
Beam.Mesh = default.Mesh;
101+
Beam.LightType = default.LightType;
102+
Beam.LightEffect = default.LightEffect;
103+
Beam.LightBrightness = default.LightBrightness;
104+
Beam.LightSaturation = default.LightSaturation;
105+
Beam.LightRadius = default.LightRadius;
106+
Beam.LightHue = default.LightHue;
107+
}
108+
109+
static final function ClientShockBeam AllocBeam(PlayerPawn P) {
110+
local ClientShockBeam Beam;
111+
112+
if (default.Free != none) {
113+
Beam = default.Free;
114+
default.Free = Beam.Next;
115+
Beam.Next = none;
116+
117+
Beam.bHidden = false;
118+
Beam.Enable('Tick');
119+
} else {
120+
Beam = P.Spawn(class'ClientShockBeam', P);
121+
}
122+
123+
ResetBeam(Beam);
124+
return Beam;
125+
}
126+
127+
static final function FreeBeam(ClientShockBeam Beam) {
128+
Beam.bHidden = true;
129+
Beam.LightType = LT_None;
130+
Beam.Disable('Tick');
131+
132+
Beam.Next = default.Free;
133+
default.Free = Beam;
134+
}
135+
136+
static final function Cleanup() {
137+
default.Free = none;
138+
}
139+
140+
141+
defaultproperties
142+
{
143+
Team=0
144+
Size=0.0000000
145+
Curve=0.0000000
146+
duration=0.0000000
147+
MoveAmount=(X=0.0000000,Y=0.0000000,Z=0.0000000)
148+
NumPuffs=0
149+
bBeamEnableLight=false
150+
TimeLeft=0.0000000
151+
Next=none
152+
Free=none
153+
Physics=5
154+
RemoteRole=0
155+
Rotation=(Pitch=0,Yaw=0,Roll=20000)
156+
DrawType=2
157+
Style=3
158+
Texture=Texture'Botpack.Effects.jenergy2'
159+
Mesh=LodMesh'Botpack.Shockbm'
160+
DrawScale=0.4400000
161+
bUnlit=true
162+
bParticles=true
163+
bFixedRotationDir=true
164+
RotationRate=(Pitch=0,Yaw=0,Roll=1000000)
165+
DesiredRotation=(Pitch=0,Yaw=0,Roll=20000)
156166
}

Classes/NN_ShockDOMRifle.uc

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
class NN_ShockDOMRifle extends NN_ShockRifle;
2+
3+
simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
4+
{
5+
local bbPlayer bbP;
6+
if (Owner.IsA('Bot'))
7+
return false;
8+
9+
bbP = bbPlayer(Owner);
10+
if (bbP == none) return false;
11+
12+
super.NN_ProcessTraceHit(Other, HitLocation, HitNormal, X, Y, Z);
13+
class'bbPlayerStatics'.static.PlayClientHitResponse(Pawn(Owner), Other, HitDamage, MyDamageType);
14+
15+
return false;
16+
}
17+
18+
simulated function RenderOverlays(Canvas Canvas)
19+
{
20+
local bbPlayer bbP;
21+
22+
Super(ShockRifle).RenderOverlays(Canvas);
23+
24+
yModInit();
25+
26+
bbP = bbPlayer(Owner);
27+
if (bNewNet && Role < ROLE_Authority && bbP != None)
28+
{
29+
if (bbP.bFire != 0 && !IsInState('ClientFiring'))
30+
ClientFire(1);
31+
else if (bbP.bAltFire != 0 && !IsInState('ClientFiring'))
32+
ClientFire(1);
33+
}
34+
}
35+
36+
function AltFire( float Value )
37+
{
38+
Fire(Value);
39+
}
40+
41+
simulated function bool ClientAltFire(float Value)
42+
{
43+
return ClientFire(Value);
44+
}
45+
46+
simulated function PlaySelect ()
47+
{
48+
return;
49+
}
50+
51+
defaultproperties
52+
{
53+
bNewNet=True
54+
PickupAmmoCount=50
55+
AmmoName=Class'ST_ShockCoreSDOM'
56+
}

Classes/NN_ShockProj.uc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ function SuperDuperExplosion() // aka, combo.
5050
local UT_SuperComboRing Ring;
5151

5252
bbP = bbPlayer(Owner);
53+
54+
// TODO: I think this means combos don't do damage?
5355
/* if (bbP != None && bbP.bNewNet)
5456
{
5557
if (Level.NetMode == NM_Client && !IsA('NN_ShockProjOwnerHidden'))
@@ -77,6 +79,7 @@ simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo.
7779
bbP = bbPlayer(Pwner);
7880
Tater = Pwner.ViewRotation;
7981

82+
// TODO: I think this means combos don't do damage?
8083
/* if (bbP != None && bbP.bNewNet)
8184
{
8285
if (Level.NetMode == NM_Client)

0 commit comments

Comments
 (0)