Minigun implemented. Some minor adjustments to weapon model offsets.

Allow armor/pads to replace shield belt when it's not at max capacity (emulating UT behavior).
This commit is contained in:
Marisa the Magician 2018-05-28 18:49:00 +02:00
commit 4f0cb3e73f
24 changed files with 756 additions and 32 deletions

View file

@ -32,7 +32,7 @@ Model "UTChainsaw"
SurfaceSkin 0 2 "Jchainsaw3.png"
SurfaceSkin 0 3 "Jchainsaw4.png"
Scale -0.24 0.12 0.24
Offset 5.6 -14.8 -7.2
Offset 6.4 -14.8 -7.2
// these adjustments are my own so it looks right, otherwise it just clips through the screen
// this kinda happens in UT too, since it was made without widescreen in mind
AngleOffset 5

View file

@ -758,8 +758,8 @@ Model "FlakCannon"
SurfaceSkin 0 4 "flakammoledbase.png"
AngleOffset 90
PitchOffset 180
RollOffset 174.35
Scale 0.28 -0.12 0.28
RollOffset 174.375
Scale 0.28 -0.14 0.28
Offset 8.6 -10.4 -12.8
// select

View file

@ -262,7 +262,7 @@ Model "BioRifle"
AngleOffset 94.21875
RollOffset 8.4375
Scale 0.125 -0.06 0.125
Offset 9.8 -17.6 -10.4
Offset 9.8 -17.6 -9.4
// select
FrameIndex BIOS A 0 0

View file

@ -33,7 +33,7 @@ Model "ImpactHammer"
AngleOffset 90
RollOffset -85
Scale 0.1 -0.05 0.1
Offset 5.8 -12.8 -7.7
Offset 4.8 -11.8 -6.7
// select
FrameIndex IMPS A 0 0

View file

@ -10,6 +10,19 @@ Model "MiniAmmo"
FrameIndex MAMO A 0 0
}
Model "MinigunTracer"
{
Path "models"
Model 0 "MiniTrace_d.3d"
Skin 0 "JUT_Tracer_01.png"
Scale 0.6 0.2 0.24
USEACTORPITCH
USEACTORROLL
DONTCULLBACKFACES
FrameIndex TRAC A 0 0
}
Model "Minigun"
{
Path "models"
@ -33,3 +46,239 @@ Model "Minigun"
FrameIndex MGNP B 1 0
}
Model "Minigun"
{
Path "models"
Model 2 "Flat_d.3d"
Skin 2 "Muz1.png"
Scale 0.08 0.08 0.08
Offset 5.0 -32.0 -8.0
AngleOffset 90
PitchOffset 90
FrameIndex MMUZ A 2 0
}
Model "Minigun"
{
Path "models"
Model 2 "Flat_d.3d"
Skin 2 "Muz2.png"
Scale 0.08 0.08 0.08
Offset 5.0 -32.0 -8.0
AngleOffset 90
PitchOffset 90
FrameIndex MMUZ B 2 0
}
Model "Minigun"
{
Path "models"
Model 2 "Flat_d.3d"
Skin 2 "Muz3.png"
Scale 0.08 0.08 0.08
Offset 5.0 -32.0 -8.0
AngleOffset 90
PitchOffset 90
FrameIndex MMUZ C 2 0
}
Model "Minigun"
{
Path "models"
Model 2 "Flat_d.3d"
Skin 2 "Muz4.png"
Scale 0.08 0.08 0.08
Offset 5.0 -32.0 -8.0
AngleOffset 90
PitchOffset 90
FrameIndex MMUZ D 2 0
}
Model "Minigun"
{
Path "models"
Model 2 "Flat_d.3d"
Skin 2 "Muz5.png"
Scale 0.08 0.08 0.08
Offset 5.0 -32.0 -8.0
AngleOffset 90
PitchOffset 90
FrameIndex MMUZ E 2 0
}
Model "Minigun"
{
Path "models"
Model 2 "Flat_d.3d"
Skin 2 "Muz6.png"
Scale 0.08 0.08 0.08
Offset 5.0 -32.0 -8.0
AngleOffset 90
PitchOffset 90
FrameIndex MMUZ F 2 0
}
Model "Minigun"
{
Path "models"
Model 2 "Flat_d.3d"
Skin 2 "Muz7.png"
Scale 0.08 0.08 0.08
Offset 5.0 -32.0 -8.0
AngleOffset 90
PitchOffset 90
FrameIndex MMUZ G 2 0
}
Model "Minigun"
{
Path "models"
Model 2 "Flat_d.3d"
Skin 2 "Muz8.png"
Scale 0.08 0.08 0.08
Offset 5.0 -32.0 -8.0
AngleOffset 90
PitchOffset 90
FrameIndex MMUZ H 2 0
}
Model "Minigun"
{
Path "models"
Model 2 "Flat_d.3d"
Skin 2 "Muz9.png"
Scale 0.08 0.08 0.08
Offset 5.0 -32.0 -8.0
AngleOffset 90
PitchOffset 90
FrameIndex MMUZ I 2 0
}
Model "Minigun"
{
Path "models"
Model 0 "Minigun2m_d.3d"
SurfaceSkin 0 0 "Mini_t1.png"
SurfaceSkin 0 1 "Mini_t2.png"
SurfaceSkin 0 2 "Mini_t3.png"
SurfaceSkin 0 3 "Mini_t4.png"
SurfaceSkin 0 4 "miniammoledbase.png"
Scale 0.12 -0.06 0.12
Offset 0.0 -15.5 -12.8
AngleOffset 90
// Select
FrameIndex MGNS A 0 0
FrameIndex MGNS B 0 1
FrameIndex MGNS C 0 2
FrameIndex MGNS D 0 3
FrameIndex MGNS E 0 4
FrameIndex MGNS F 0 5
FrameIndex MGNS G 0 6
FrameIndex MGNS H 0 7
FrameIndex MGNS I 0 8
FrameIndex MGNS J 0 9
FrameIndex MGNS K 0 10
FrameIndex MGNS L 0 11
FrameIndex MGNS M 0 12
FrameIndex MGNS N 0 13
FrameIndex MGNS O 0 14
FrameIndex MGNS P 0 15
FrameIndex MGNS Q 0 16
FrameIndex MGNS R 0 17
FrameIndex MGNS S 0 18
FrameIndex MGNS T 0 19
// Fire
FrameIndex MGNF A 0 61
FrameIndex MGNF B 0 62
FrameIndex MGNF C 0 63
FrameIndex MGNF D 0 64
FrameIndex MGNF E 0 65
FrameIndex MGNF F 0 66
FrameIndex MGNF G 0 67
FrameIndex MGNF H 0 68
FrameIndex MGNF I 0 69
FrameIndex MGNF J 0 70
FrameIndex MGNF K 0 71
FrameIndex MGNF L 0 72
FrameIndex MGNF M 0 73
FrameIndex MGNF N 0 74
FrameIndex MGNF O 0 75
FrameIndex MGNF P 0 76
FrameIndex MGNF Q 0 77
FrameIndex MGNF R 0 78
FrameIndex MGNF S 0 79
// Unwind
FrameIndex MGNU A 0 80
FrameIndex MGNU B 0 81
FrameIndex MGNU C 0 82
FrameIndex MGNU D 0 83
FrameIndex MGNU E 0 84
FrameIndex MGNU F 0 85
FrameIndex MGNU G 0 86
FrameIndex MGNU H 0 87
FrameIndex MGNU I 0 88
FrameIndex MGNU J 0 89
FrameIndex MGNU K 0 90
FrameIndex MGNU L 0 91
FrameIndex MGNU M 0 92
FrameIndex MGNU N 0 93
FrameIndex MGNU O 0 94
FrameIndex MGNU P 0 95
FrameIndex MGNU Q 0 96
FrameIndex MGNU R 0 97
FrameIndex MGNU S 0 98
FrameIndex MGNU T 0 99
FrameIndex MGNU U 0 100
FrameIndex MGNU V 0 101
FrameIndex MGNU W 0 102
FrameIndex MGNU X 0 103
FrameIndex MGNU Y 0 104
FrameIndex MGNU Z 0 105
FrameIndex MGU2 A 0 106
FrameIndex MGU2 B 0 107
FrameIndex MGU2 C 0 108
FrameIndex MGU2 D 0 109
FrameIndex MGU2 E 0 110
FrameIndex MGU2 F 0 111
FrameIndex MGU2 G 0 112
FrameIndex MGU2 H 0 113
FrameIndex MGU2 I 0 114
FrameIndex MGU2 J 0 115
FrameIndex MGU2 K 0 116
FrameIndex MGU2 L 0 117
FrameIndex MGU2 M 0 118
// Idle
FrameIndex MGNI A 0 121
FrameIndex MGNI B 0 122
FrameIndex MGNI C 0 123
FrameIndex MGNI D 0 124
FrameIndex MGNI E 0 125
FrameIndex MGNI F 0 126
FrameIndex MGNI G 0 127
FrameIndex MGNI H 0 128
FrameIndex MGNI I 0 129
FrameIndex MGNI J 0 130
FrameIndex MGNI K 0 131
FrameIndex MGNI L 0 132
FrameIndex MGNI M 0 133
FrameIndex MGNI N 0 134
FrameIndex MGNI O 0 135
FrameIndex MGNI P 0 136
FrameIndex MGNI Q 0 137
FrameIndex MGNI R 0 138
FrameIndex MGNI S 0 139
// Down
FrameIndex MGND A 0 141
FrameIndex MGND B 0 142
FrameIndex MGND C 0 143
FrameIndex MGND D 0 144
FrameIndex MGND E 0 145
FrameIndex MGND F 0 146
FrameIndex MGND G 0 147
FrameIndex MGND H 0 148
FrameIndex MGND I 0 149
FrameIndex MGND J 0 150
}

View file

@ -86,7 +86,7 @@ Model "Ripper2"
SurfaceSkin 0 3 "JRazor5.png"
SurfaceSkin 0 4 "JRazor3.png"
Scale 0.16 -0.08 0.16
Offset 7.4 -10.8 -8.9
Offset 6.4 -9.8 -7.9
AngleOffset 90
// Select

View file

@ -167,7 +167,7 @@ Model "ShockRifle"
SurfaceSkin 0 4 "asmd_t4.png"
AngleOffset 90
Scale 0.15 -0.12 0.15
Offset 4.9 -16.6 -7.1
Offset 3.9 -17.6 -6.1
// select
FrameIndex ASMS A 0 0
@ -254,7 +254,7 @@ Model "EnhancedShockRifle"
SurfaceSkin 0 4 "sasmd_t4.png"
AngleOffset 90
Scale 0.15 -0.12 0.15
Offset 4.9 -16.6 -7.1
Offset 3.9 -17.6 -6.1
// select
FrameIndex ASMS A 0 0

View file

@ -47,7 +47,7 @@ Model "Translocator"
SurfaceSkin 0 2 "tloc3.png"
SurfaceSkin 0 3 "tloc4.png"
Scale 0.11 -0.055 0.11
Offset -19.8 -22.8 -33.2
Offset -19.8 -22.8 -31.2
AngleOffset -94.21875
PitchOffset 3.55555555556

View file

@ -82,9 +82,9 @@ Model "WarheadLauncher"
SurfaceSkin 0 3 "jwarhead4.png"
Scale 0.2 -0.12 0.2
AngleOffset 90
PitchOffset 22.5
PitchOffset 33.5
RollOffset -87.1875
Offset 7.9 -15.6 -9.2
Offset 6.2 -15.6 -6.2
// select
FrameIndex WARS A 0 0

BIN
models/Muz1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
models/Muz2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
models/Muz3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
models/Muz4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
models/Muz5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
models/Muz6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
models/Muz7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
models/Muz8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
models/Muz9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -36,10 +36,10 @@ Currently implemented:
- Dual Enforcers (slot 2)
- Ripper (slot 6)
- Jump Boots (radsuit, has "iron boots" powerup effect to compensate)
- Minigun (slot 7)
In progress:
- Minigun (slot 7)
- Rocket Launcher (slot 9)
- Sniper Rifle (slot 0)

View file

@ -183,6 +183,11 @@ ripper/hit bladehit
ripper/flesh bladethk
ripper/althit expl03
minigun/select minisel
minigun/fire m2regf
minigun/altfire m2altf
minigun/unwind m2wdown
flak/select pdown
flak/load hidraul2
flak/reload load1

View file

@ -1,3 +1,120 @@
Sprite "MAMOA0",1,1{}
Sprite "MGNPA0",1,1{}
Sprite "MGNPB0",1,1{}
Sprite "MGNSA0",1,1{}
Sprite "MGNSB0",1,1{}
Sprite "MGNSC0",1,1{}
Sprite "MGNSD0",1,1{}
Sprite "MGNSE0",1,1{}
Sprite "MGNSF0",1,1{}
Sprite "MGNSG0",1,1{}
Sprite "MGNSH0",1,1{}
Sprite "MGNSI0",1,1{}
Sprite "MGNSJ0",1,1{}
Sprite "MGNSK0",1,1{}
Sprite "MGNSL0",1,1{}
Sprite "MGNSM0",1,1{}
Sprite "MGNSN0",1,1{}
Sprite "MGNSO0",1,1{}
Sprite "MGNSP0",1,1{}
Sprite "MGNSQ0",1,1{}
Sprite "MGNSR0",1,1{}
Sprite "MGNSS0",1,1{}
Sprite "MGNST0",1,1{}
Sprite "MGNFA0",1,1{}
Sprite "MGNFB0",1,1{}
Sprite "MGNFC0",1,1{}
Sprite "MGNFD0",1,1{}
Sprite "MGNFE0",1,1{}
Sprite "MGNFF0",1,1{}
Sprite "MGNFG0",1,1{}
Sprite "MGNFH0",1,1{}
Sprite "MGNFI0",1,1{}
Sprite "MGNFJ0",1,1{}
Sprite "MGNFK0",1,1{}
Sprite "MGNFL0",1,1{}
Sprite "MGNFM0",1,1{}
Sprite "MGNFN0",1,1{}
Sprite "MGNFO0",1,1{}
Sprite "MGNFP0",1,1{}
Sprite "MGNFQ0",1,1{}
Sprite "MGNFR0",1,1{}
Sprite "MGNFS0",1,1{}
Sprite "MGNUA0",1,1{}
Sprite "MGNUB0",1,1{}
Sprite "MGNUC0",1,1{}
Sprite "MGNUD0",1,1{}
Sprite "MGNUE0",1,1{}
Sprite "MGNUF0",1,1{}
Sprite "MGNUG0",1,1{}
Sprite "MGNUH0",1,1{}
Sprite "MGNUI0",1,1{}
Sprite "MGNUJ0",1,1{}
Sprite "MGNUK0",1,1{}
Sprite "MGNUL0",1,1{}
Sprite "MGNUM0",1,1{}
Sprite "MGNUN0",1,1{}
Sprite "MGNUO0",1,1{}
Sprite "MGNUP0",1,1{}
Sprite "MGNUQ0",1,1{}
Sprite "MGNUR0",1,1{}
Sprite "MGNUS0",1,1{}
Sprite "MGNUT0",1,1{}
Sprite "MGNUU0",1,1{}
Sprite "MGNUV0",1,1{}
Sprite "MGNUW0",1,1{}
Sprite "MGNUX0",1,1{}
Sprite "MGNUY0",1,1{}
Sprite "MGNUZ0",1,1{}
Sprite "MGU2A0",1,1{}
Sprite "MGU2B0",1,1{}
Sprite "MGU2C0",1,1{}
Sprite "MGU2D0",1,1{}
Sprite "MGU2E0",1,1{}
Sprite "MGU2F0",1,1{}
Sprite "MGU2G0",1,1{}
Sprite "MGU2H0",1,1{}
Sprite "MGU2I0",1,1{}
Sprite "MGU2J0",1,1{}
Sprite "MGU2K0",1,1{}
Sprite "MGU2L0",1,1{}
Sprite "MGU2M0",1,1{}
Sprite "MGNIA0",1,1{}
Sprite "MGNIB0",1,1{}
Sprite "MGNIC0",1,1{}
Sprite "MGNID0",1,1{}
Sprite "MGNIE0",1,1{}
Sprite "MGNIF0",1,1{}
Sprite "MGNIG0",1,1{}
Sprite "MGNIH0",1,1{}
Sprite "MGNII0",1,1{}
Sprite "MGNIJ0",1,1{}
Sprite "MGNIK0",1,1{}
Sprite "MGNIL0",1,1{}
Sprite "MGNIM0",1,1{}
Sprite "MGNIN0",1,1{}
Sprite "MGNIO0",1,1{}
Sprite "MGNIP0",1,1{}
Sprite "MGNIQ0",1,1{}
Sprite "MGNIR0",1,1{}
Sprite "MGNIS0",1,1{}
Sprite "MGNDA0",1,1{}
Sprite "MGNDB0",1,1{}
Sprite "MGNDC0",1,1{}
Sprite "MGNDD0",1,1{}
Sprite "MGNDE0",1,1{}
Sprite "MGNDF0",1,1{}
Sprite "MGNDG0",1,1{}
Sprite "MGNDH0",1,1{}
Sprite "MGNDI0",1,1{}
Sprite "MGNDJ0",1,1{}
Sprite "MMUZA0",1,1{}
Sprite "MMUZB0",1,1{}
Sprite "MMUZC0",1,1{}
Sprite "MMUZD0",1,1{}
Sprite "MMUZE0",1,1{}
Sprite "MMUZF0",1,1{}
Sprite "MMUZG0",1,1{}
Sprite "MMUZH0",1,1{}
Sprite "MMUZI0",1,1{}
Sprite "TRACA0",1,1{}

View file

@ -31,8 +31,6 @@ Class UTArmorBonus : UTArmor replaces ArmorBonus
{
Tag "Armor Bonus";
+COUNTITEM;
+INVENTORY.AUTOACTIVATE;
+INVENTORY.UNTOSSABLE;
+INVENTORY.ALWAYSPICKUP;
Inventory.Amount 5;
Inventory.MaxAmount 50;
@ -114,14 +112,21 @@ Class UTShieldBelt : UTArmor replaces Megasphere
}
override bool HandlePickup( Inventory item )
{
if ( (item is 'UTThighPads') || (item is 'UTBodyArmor') ) return true;
if ( (item is 'UTThighPads') || (item is 'UTBodyArmor') )
{
if ( amount < maxamount )
{
DepleteOrDestroy();
return Super.HandlePickup(item);
}
else return true;
}
return Super.HandlePickup(item);
}
Default
{
Tag "Shield Belt";
+COUNTITEM;
+INVENTORY.ALWAYSPICKUP;
+INVENTORY.BIGPOWERUP;
Inventory.Amount 150;
Inventory.MaxAmount 150;

View file

@ -285,27 +285,17 @@ Class Enforcer : UTWeapon replaces Pistol
A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true);
A_OverlayRenderstyle(-2,STYLE_Add);
}
Vector3 x, y, z;
double a;
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x;
int ydir = slave?-1:1;
if ( alt ) origin = origin-z*9.0+ydir*y*1.0;
else origin = origin-z*2.0+ydir*y*6.0;
double ang = angle;
double pt = BulletSlope();
if ( alt )
{
ang += FRandom[Enforcer](-3,3);
pt += FRandom[Enforcer](-3,3);
}
else
{
ang += FRandom[Enforcer](-0.4,0.4);
pt += FRandom[Enforcer](-0.4,0.4);
}
double a = FRandom[Enforcer](0,360), s = FRandom[Enforcer](0,alt?0.08:0.004);
[x2, y2, z2] = Matrix4.GetAxes(BulletSlope(),angle,roll);
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
FLineTraceData d;
LineTrace(ang,10000,pt,TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
if ( d.HitType == TRACE_HitActor )
{
int dmg = Random[Enforcer](15,20);

View file

@ -44,13 +44,137 @@ Class MiniAmmo : Ammo
}
}
Class MinigunLight : EnforcerLight
{
override void PostBeginPlay()
{
Super.PostBeginPlay();
args[LIGHT_INTENSITY] = Random[Minigun](120,180);
}
}
Class MinigunTracer : Actor
{
Vector3 dest;
Default
{
RenderStyle "Add";
Radius 0.1;
Height 0;
+NOCLIP;
+NOGRAVITY;
+DONTSPLASH;
}
override void Tick()
{
Super.Tick();
Vector3 dir = level.Vec3Diff(pos,dest);
if ( dir.length() < 200 )
{
Destroy();
return;
}
dir = dir.unit();
SetOrigin(Vec3Offset(dir.x*200,dir.y*200,dir.z*200),true);
A_SetAngle(atan2(dir.y,dir.x),SPF_INTERPOLATE);
A_SetPitch(asin(-dir.z),SPF_INTERPOLATE);
A_SetRoll(roll+60,SPF_INTERPOLATE);
}
States
{
Spawn:
TRAC A -1 Bright;
Stop;
}
}
Class Minigun : UTWeapon
{
int bcnt;
action void A_FireBullet( bool alt = false )
{
Weapon weap = Weapon(invoker);
if ( !weap ) return;
if ( weap.Ammo1.Amount <= 0 ) return;
A_Overlay(-2,"MuzzleFlash",true);
A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true);
A_OverlayRenderstyle(-2,STYLE_Add);
if ( alt ) invoker.bcnt = min(invoker.bcnt,3);
if ( invoker.bcnt-- > 0 ) return;
invoker.bcnt = alt?3:5;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
invoker.FireEffect();
UTMainHandler.DoFlash(self,Color(64,255,255,0),1);
A_AlertMonsters();
if ( alt ) A_QuakeEx(3,3,3,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.12);
else A_QuakeEx(2,2,2,5,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.08);
let l = Spawn("MinigunLight",pos);
l.target = self;
if ( !alt ) MinigunLight(l).cnt--;
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+y*4.0-z*6.0;
double a = FRandom[Minigun](0,360), s = FRandom[Minigun](0,alt?0.05:0.02);
[x2, y2, z2] = Matrix4.GetAxes(BulletSlope(),angle,roll);
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
FLineTraceData d;
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
if ( d.HitType == TRACE_HitActor )
{
int dmg = Random[Minigun](9,15); // fun fact: the Minigun is one of the few weapons that has actual RNG damage in UT (and it's exactly this damage)
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'shot');
if ( d.HitActor.bNOBLOOD )
{
let p = Spawn("BulletImpact",d.HitLocation-d.HitDir*4);
p.angle = atan2(d.HitDir.y,d.HitDir.x);
p.pitch = asin(-d.HitDir.z);
}
else
{
d.HitActor.TraceBleed(dmg,self);
d.HitActor.SpawnBlood(d.HitLocation,atan2(d.HitDir.y,d.HitDir.x)+180,dmg);
}
}
else if ( d.HitType != TRACE_HitNone )
{
let p = Spawn("BulletImpact",d.HitLocation-d.HitDir*4);
p.angle = atan2(d.HitDir.y,d.HitDir.x);
p.pitch = asin(-d.HitDir.z);
if ( d.HitLine ) d.HitLine.RemoteActivate(self,d.LineSide,SPAC_Impact,d.HitLocation);
}
if ( !Random[Minigun](0,1) )
{
let t = Spawn("MinigunTracer",origin+x*20.0);
t.angle = atan2(dir.y,dir.x);
t.pitch = asin(-dir.z);
MinigunTracer(t).dest = d.HitLocation;
}
origin += x*8.0+y*4.0-z*2.0;
let c = Spawn("UTCasing",origin);
c.vel = x*FRandom[Junk](-2,2)+y*FRandom[Junk](3,6)+z*FRandom[Junk](3,5);
c.Scale *= 0.5;
}
action void A_MinigunRefire( statelabel flash = null )
{
Weapon weap = Weapon(invoker);
if ( !weap || !player ) return;
if ( weap.Ammo1.Amount <= 0 )
{
A_ClearRefire();
player.setpsprite(PSP_WEAPON,weap.FindState("Unwind"));
return;
}
A_Refire(flash);
}
Default
{
Tag "Minigun";
Obituary "%k's Minigun turned %o into a leaky piece of meat.";
Inventory.PickupMessage "You got the Minigun.";
Weapon.UpSound "";
Weapon.UpSound "minigun/select";
Weapon.SlotNumber 7;
Weapon.SelectionOrder 3;
Weapon.AmmoType "MiniAmmo";
@ -66,5 +190,239 @@ Class Minigun : UTWeapon
Stop;
MGNP B -1;
Stop;
Select:
MGNS A 1 A_Raise(int.max);
Wait;
Ready:
MGNS ABCDEFGHIJKLMNOPQRST 1;
Idle:
MGNI ABCDEFGHIJKLMNOPQRS 5
{
A_CheckReload();
A_WeaponReady();
}
Loop;
Fire:
AltFire:
MGNI A 3 { invoker.bcnt = 5; }
Hold:
MGNF A 1
{
A_PlaySound("minigun/fire",CHAN_WEAPON,1.0,true);
A_FireBullet();
}
MGNF B 0 A_MinigunRefire(1);
Goto Unwind;
MGNF B 1 A_FireBullet();
MGNF C 0 A_MinigunRefire(1);
Goto Unwind;
MGNF C 1 A_FireBullet();
MGNF D 0 A_MinigunRefire(1);
Goto Unwind;
MGNF D 1 A_FireBullet();
MGNF E 0 A_MinigunRefire(1);
Goto Unwind;
MGNF E 1 A_FireBullet();
MGNF F 0 A_MinigunRefire(1);
Goto Unwind;
MGNF F 1 A_FireBullet();
MGNF G 0 A_MinigunRefire(1);
Goto Unwind;
MGNF G 1 A_FireBullet();
MGNF H 0 A_MinigunRefire(1);
Goto Unwind;
MGNF H 1 A_FireBullet();
MGNF I 0 A_MinigunRefire(1);
Goto Unwind;
MGNF I 1 A_FireBullet();
MGNF J 0 A_MinigunRefire(1);
Goto Unwind;
MGNF J 1 A_FireBullet();
MGNF K 0 A_MinigunRefire(1);
Goto Unwind;
MGNF K 1 A_FireBullet();
MGNF L 0 A_MinigunRefire(1);
Goto Unwind;
MGNF L 1 A_FireBullet();
MGNF M 0 A_MinigunRefire(1);
Goto Unwind;
MGNF M 1 A_FireBullet();
MGNF N 0 A_MinigunRefire(1);
Goto Unwind;
MGNF N 1 A_FireBullet();
MGNF O 0 A_MinigunRefire(1);
Goto Unwind;
MGNF O 1 A_FireBullet();
MGNF P 0 A_MinigunRefire(1);
Goto Unwind;
MGNF P 1 A_FireBullet();
MGNF Q 0 A_MinigunRefire(1);
Goto Unwind;
MGNF Q 1 A_FireBullet();
MGNF R 0 A_MinigunRefire(1);
Goto Unwind;
MGNF R 1 A_FireBullet();
MGNF S 0 A_MinigunRefire(1);
Goto Unwind;
MGNF S 1 A_FireBullet();
MGNF A 0
{
if ( invoker.bAltFire ) A_MinigunRefire(1);
else A_MinigunRefire("Hold");
}
Goto Unwind;
AltFire2:
MGNF A 1 A_FireBullet();
MGNF B 0 A_MinigunRefire(1);
Goto Unwind;
MGNF B 1 A_FireBullet();
MGNF C 0 A_MinigunRefire(1);
Goto Unwind;
MGNF C 1 A_FireBullet();
MGNF D 0 A_MinigunRefire(1);
Goto Unwind;
MGNF D 1 A_FireBullet();
MGNF E 0 A_MinigunRefire(1);
Goto Unwind;
MGNF E 1 A_FireBullet();
MGNF F 0 A_MinigunRefire(1);
Goto Unwind;
MGNF F 1 A_FireBullet();
MGNF G 0 A_MinigunRefire(1);
Goto Unwind;
MGNF G 1 A_FireBullet();
MGNF H 0 A_MinigunRefire(1);
Goto Unwind;
MGNF H 1 A_FireBullet();
MGNF I 0 A_MinigunRefire(1);
Goto Unwind;
MGNF I 1 A_FireBullet();
MGNF J 0 A_MinigunRefire(1);
Goto Unwind;
MGNF J 1 A_FireBullet();
MGNF K 0 A_MinigunRefire(1);
Goto Unwind;
MGNF K 1 A_FireBullet();
MGNF L 0 A_MinigunRefire(1);
Goto Unwind;
MGNF L 1 A_FireBullet();
MGNF M 0 A_MinigunRefire(1);
Goto Unwind;
MGNF M 1 A_FireBullet();
MGNF N 0 A_MinigunRefire(1);
Goto Unwind;
MGNF N 1 A_FireBullet();
MGNF O 0 A_MinigunRefire(1);
Goto Unwind;
MGNF O 1 A_FireBullet();
MGNF P 0 A_MinigunRefire(1);
Goto Unwind;
MGNF P 1 A_FireBullet();
MGNF Q 0 A_MinigunRefire(1);
Goto Unwind;
MGNF Q 1 A_FireBullet();
MGNF R 0 A_MinigunRefire(1);
Goto Unwind;
MGNF R 1 A_FireBullet();
MGNF S 0 A_MinigunRefire(1);
Goto Unwind;
MGNF S 1 A_FireBullet();
MGNF A 0 A_MinigunRefire(1);
Goto Unwind;
AltHold:
MGNF A 1
{
A_PlaySound("minigun/altfire",CHAN_WEAPON,1.0,true);
A_FireBullet(true);
}
MGNF D 0 A_MinigunRefire(1);
Goto Unwind;
MGNF D 1 A_FireBullet(true);
MGNF G 0 A_MinigunRefire(1);
Goto Unwind;
MGNF G 1 A_FireBullet(true);
MGNF J 0 A_MinigunRefire(1);
Goto Unwind;
MGNF J 1 A_FireBullet(true);
MGNF M 0 A_MinigunRefire(1);
Goto Unwind;
MGNF M 1 A_FireBullet(true);
MGNF P 0 A_MinigunRefire(1);
Goto Unwind;
MGNF P 1 A_FireBullet(true);
MGNF S 0 A_MinigunRefire(1);
Goto Unwind;
MGNF S 1 A_FireBullet(true);
MGNF C 0 A_MinigunRefire(1);
Goto Unwind;
MGNF C 1 A_FireBullet(true);
MGNF F 0 A_MinigunRefire(1);
Goto Unwind;
MGNF F 1 A_FireBullet(true);
MGNF I 0 A_MinigunRefire(1);
Goto Unwind;
MGNF I 1 A_FireBullet(true);
MGNF L 0 A_MinigunRefire(1);
Goto Unwind;
MGNF L 1 A_FireBullet(true);
MGNF O 0 A_MinigunRefire(1);
Goto Unwind;
MGNF O 1 A_FireBullet(true);
MGNF R 0 A_MinigunRefire(1);
Goto Unwind;
MGNF R 1 A_FireBullet(true);
MGNF B 0 A_MinigunRefire(1);
Goto Unwind;
MGNF B 1 A_FireBullet(true);
MGNF E 0 A_MinigunRefire(1);
Goto Unwind;
MGNF E 1 A_FireBullet(true);
MGNF H 0 A_MinigunRefire(1);
Goto Unwind;
MGNF H 1 A_FireBullet(true);
MGNF K 0 A_MinigunRefire(1);
Goto Unwind;
MGNF K 1 A_FireBullet(true);
MGNF N 0 A_MinigunRefire(1);
Goto Unwind;
MGNF N 1 A_FireBullet(true);
MGNF Q 0 A_MinigunRefire(1);
Goto Unwind;
MGNF Q 1 A_FireBullet(true);
MGNF A 0 A_MinigunRefire("AltHold");
Goto Unwind;
Unwind:
MGNU A 0 A_PlaySound("minigun/unwind",CHAN_WEAPON);
MGNU ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
MGU2 ABCDEFGHIJKLM 1;
Goto Idle;
Deselect:
MGND ABCDEFGHIJ 2;
MGND J 1 A_Lower(int.max);
Wait;
MuzzleFlash:
TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8,9);
Stop;
MMUZ A 2 Bright;
Stop;
MMUZ B 2 Bright;
Stop;
MMUZ C 2 Bright;
Stop;
MMUZ D 2 Bright;
Stop;
MMUZ E 2 Bright;
Stop;
MMUZ F 2 Bright;
Stop;
MMUZ G 2 Bright;
Stop;
MMUZ H 2 Bright;
Stop;
MMUZ I 2 Bright;
Stop;
Dummy:
MMUZ ABCDEFGHI -1;
Stop;
}
}