Infinite Ammo Powerup should work as expected now
[k8zan.git] / decorate / Weapons / PainGun.txt
blob26f7be204d32b0b784a40a903878dedd1fa79d9a
1 ////////////////////////////////////////////////////////////////////////////////
2 Actor Zan_PaingunBulletCasingSpawn {
3   Speed 20
4   +ClientSideOnly
5   +DontSplash
6   +DropOff
7   +Missile
8   +NoBlockmap
9   +NoClip
10   +NoExtremeDeath
11   +NoGravity
12   +NoTeleport
13   +NoTrigger
14   +ThruActors
15   +ThruGhost
16   +k8ServerSideOnly
17   +k8AllowSimpleTick
18   States {
19   Spawn:
20     TNT1 A 0
21     TNT1 A 1 A_CustomMissile("Zan_PainGunEmptyBrass", -5, 0, random(-80, -100), CMF_AIMDIRECTION, random(45, 80))
22     Stop
23   }
27 Actor Zan_PainGunEmptyBrass : Zan_CasingBase {
28   BounceFactor 0.3
29   Height 2
30   Mass 4
31   Radius 2
32   Scale 0.15
33   Speed 8
34   BounceSound "Ammo/BulletBounce"
36   States {
37     Spawn:
38       TNT1 A 0
39       ZPGX ABCDEFGHABCDEFGHABCDEFGHABCDEFGH 3
40         {
41           A_JumpIf(waterlevel > 1, "Splash");
42           if (!A_k8JumpIfOnFloorSky("Disappear")) {
43             A_k8JumpIfOnLiquidFloor("Death");
44           }
45         }
46       Stop
48     Disappear:
49       TNT1 A 0
50       Stop
52     Death:
53       TNT1 A 0
54         {
55           A_ChangeFlag("DoomBounce", false);
56           A_ChangeFlag("NoInteraction", true);
57         }
58       TNT1 A 0 A_Jump(256, "Rest1", "Rest2", "Rest3", "Rest4", "Rest5", "Rest6", "Rest7", "Rest8")
59       Goto Rest1
61     RestMain:
62       "####" "#" 60
63       "####" "#" 0
64         {
65           if (!A_k8JumpIfOnFloorSky("Disappear")) {
66             A_k8JumpIfOnLiquidFloor("Stopping");
67           }
68           A_SetPitch(0);
69         }
70       //"####" "#" 0 A_SetTics(GetCVar("ZanExOpt_EmptyCasingTime")*35*60+10)
71       // become non-scripted instead
72       "####" "#" -1 A_BecomeK8VavoomInternalNoTickGrav(GetCVar("ZanExOpt_EmptyCasingTime")*60+frandom(1, 4), frandom(64, 90)/35.0/10.0)
73     FadeOut:
74       "####" "#" random(10, 15) A_FadeOut(0.01)
75       Loop
77     Rest1:
78       ZPGX I 1
79       Goto RestMain
80     Rest2:
81       ZPGX J 1
82       Goto RestMain
83     Rest3:
84       ZPGX K 1
85       Goto RestMain
86     Rest4:
87       ZPGX L 1
88       Goto RestMain
89     Rest5:
90       ZPGX M 1
91       Goto RestMain
92     Rest6:
93       ZPGX I 1
94       Goto RestMain
95     Rest7:
96       ZPGX J 1
97       Goto RestMain
98     Rest8:
99       ZPGX K 1
100       Goto RestMain
102     Splash:
103       TNT1 A 0
104       TNT1 A 0 A_SpawnItem("Zan_PainGunUnderwaterEmptyBrass")
105       Stop
107     Stopping:
108       "####" "#" 15
109         {
110           A_ChangeFlag("NoInteraction", true);
111           A_ChangeVelocity(0, 0, -14, CVF_REPLACE);
112         }
113       Stop
114   }
118 Actor Zan_PainGunUnderwaterEmptyBrass : Zan_PainGunEmptyBrass {
119   +k8AllowSimpleTick
120   Speed 0
121   Mass 1
122   -DoomBounce
123   SeeSound "none"
124   States {
125     Spawn:
126       TNT1 A 0
127       TNT1 A 0 ThrustThingZ(0, 7, 1, 0)
128       ZPGX ABCD 3
129       TNT1 A 0 ThrustThingZ(0, 7, 1, 0)
130       ZPGX EFGH 3
131       TNT1 A 0 ThrustThingZ(0, 7, 1, 0)
132       ZPGX ABCD 3
133       TNT1 A 0 ThrustThingZ(0, 7, 1, 0)
134       ZPGX EFGH 3
135       TNT1 A 0 A_SpawnItem("UnderwaterBubble")
136       //Loop
137       Stop
138   }
142 ACTOR PaingunBulletCasing {
143   Radius 1
144   Height 1
145   Scale 0.05
146   Gravity 0.85
147   +MOVEWITHSECTOR
148   +MISSILE
149   +NOBLOCKMAP
150   +BOUNCEONFLOORS
151   +BOUNCEONWALLS
152   +BOUNCEONCEILINGS
153   +ALLOWBOUNCEONACTORS
154   +BOUNCEONACTORS
155   +NOTONAUTOMAP
156   +FORCEXYBILLBOARD
157   +NoTeleport
158   +k8AllowSimpleTick
159   BounceType Doom
160   BounceFactor 0.3
161   BounceCount 2
162   //BounceSound "Ammo/BulletBounce"
164   States {
165     Spawn:
166     ACAS A 6
167     TNT1 A 0 A_SetScale(0.15, 0.15)
168     ACAS ABC 6
169     ACAS D 1000
170     Stop
172   Death:
173     //TNT1 A 0 A_PlaySound("Ammo/BulletBounce", CHAN_AUTO, 1.0, 0, 2)
174     TNT1 A 0 A_PlaySoundEx("Ammo/BulletBounce", "SoundSlot5", 0, -1)
175   DeathLoop:
176     ACAS D 105 A_CheckSight("Remove")
177     TNT1 A 0 A_Jump(50, "Remove")
178     Goto DeathLoop
180   Remove:
181     ACAS E 4
182     ACAS F 4
183     Stop
184   }
188 ////////////////////////////////////////////////////////////////////////////////
189 ACTOR AmmoBox : Ammo replaces ClipBox {
190   Radius 20
191   Height 18
192   Scale 0.3
193   Inventory.Amount 100
194   Inventory.MaxAmount 450
195   Ammo.BackpackAmount 300
196   Ammo.BackpackMaxAmount 666
197   //Inventory.Icon "SPMGA0"
198   Inventory.Icon "ABULB0"
199   Inventory.PickupMessage "Picked up an Ammo Box."
200   Inventory.PickupSound "Ammo/AmmoBoxPick"
202   States {
203   Spawn:
204     ABUL A -1
205     Stop
206   }
210 Actor AmmoBelt : AmmoBox /*replaces Clip*/ {
211   Scale 0.2
212   Inventory.Amount 30
213   Inventory.PickupMessage "Picked up an Ammo Belt."
214   Inventory.PickupSound "Ammo/AmmoBeltPick"
215   //Inventory.Icon "SPMGA0"
216   Inventory.Icon "ABULC0"
218   States {
219   Spawn:
220     ABUL B -1
221     Stop
222   }
226 Actor AmmoBullet : AmmoBox /*10936*/ {
227   Height 10
228   Radius 10
229   Scale 0.15
230   Health 99999
231   Inventory.Amount 6  // 1
232   Inventory.PickupMessage "Picked up a Bullet."
233   Inventory.PickupSound "Ammo/BulletBounce"
234   //Inventory.Icon "SPMGA0"
235   Inventory.Icon "ABULC0"
237   +SHOOTABLE
238   +BRIGHT
240   States {
241   Spawn:
242     ABUL C -1
243     Stop
245   Crush:
246   Death:
247     TNT1 A 0
248     Stop
249   }
253 ACTOR Paingun : Weapon replaces Chaingun {
254   Xscale 0.45
255   Yscale 0.40
256   Radius 28
257   Height 18
258   +INVENTORY.UNDROPPABLE
259   +WEAPON.NOALERT
260   //+WEAPON.NO_AUTO_SWITCH
261   +WEAPON.AMMO_OPTIONAL
262   //+WEAPON.ALT_USES_BOTH
263   Inventory.PickupMessage "Got a Paingun."
264   Inventory.PickupSound "Weapons/PaingunPick"
265   Inventory.Icon "WPAIA0"
266   Tag "Paingun"
267   Weapon.SelectionOrder 3
268   //Weapon.MinSelectionAmmo1 0
269   //Weapon.MinSelectionAmmo2 0
270   Weapon.AmmoType1 "AmmoBox"
271   //Weapon.AmmoGive1 40
272   Weapon.AmmoGive1 80
273   Weapon.AmmoUse1 1
274   Weapon.AmmoType2 "none"
275   Weapon.AmmoGive2 0
276   Weapon.AmmoUse2 0
277   Weapon.SlotNumber 4
278   Weapon.SlotPriority 1
279   Weapon.PlayerSpeedScale 0.64
280   Weapon.Kickback 136   // slightly bigger than the default
281   //+Weapon.DisablePlayerRun
283   var float user_FireAngle;
284   var float user_FirePitch;
285   var bool user_DropShell;
287   States {
288   Spawn:
289     WPAI B -1
290     Stop
292   Select:
293     stateinclude "QuickKick/QuickKickOnSelectDeselect.txt"
294     TNT1 A 0 A_GiveInventory("HoldingPaingun", 1)
295     TNT1 A 0 { if (GetCVarB('k8ZanMod_CustomCrosshairs')) A_SetCrosshair(14); }
296     TNT1 A 0 A_Raise(666)
297     Goto Ready
299   Deselect:
300     stateinclude "QuickKick/QuickKickOnSelectDeselect.txt"
301     WPAR A 1 Offset(-15, 40)
302     WPAR A 1 Offset(-30, 50)
303     WPAR A 1 Offset(-50, 65)
304     WPAR A 1 Offset(-70, 80)
305     Goto DeselectLoop
307   DeselectLoop:
308     TNT1 A 0 A_TakeInventory("BarrelIsSpinning", 1)
309     TNT1 A 0 A_TakeInventory("HoldingPaingun", 1)
310     TNT1 A 1 A_Lower(666)
311     Loop
313   Ready:
314     TNT1 A 8
315     TNT1 A 0 A_PlaySound("Weapons/PaingunReady", CHAN_WEAPON, 0.6)
316     WPAR A 1 Offset(-70, 80)
317     WPAR A 1 Offset(-50, 65)
318     WPAR A 1 Offset(-30, 50)
319     WPAR A 1 Offset(-15, 40)
320     TNT1 A 0 A_TakeInventory("QuickKickDisabled")
321     Goto ReadyIdle
323   ReadyIdle:
324     WPAR A 8 {
325       A_PlayerWeaponSpeedScale(0.64);
326       A_PlayerWeaponJumpScale(0.62);
327       A_PlayerWeaponDisableRun(false);
328       A_WeaponReady(WRF_ALLOWRELOAD);
329     }
330     Loop
332   Fire:
333     TNT1 A 0 A_JumpIfNoAmmo("Reload")
334     TNT1 A 0 A_JumpIf(waterlevel==3, "Reload")
335     TNT1 A 0 A_JumpIfInventory("BarrelIsSpinning", 1, "Firing")
336     WPAF A 4 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
337     WPAF B 4
338     WPAF C 3
339     WPAF A 3 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
340     WPAF B 3
341     WPAF C 2
342     WPAF A 2 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
343     WPAF B 2
344     WPAF C 2
345     WPAF A 1 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
346     WPAF B 1
347     WPAF C 1
348     TNT1 A 0 A_Refire("Firing")
349     WPAF A 1 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
350     WPAF B 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
351     WPAF C 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
352     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
353     WPAF A 2 A_WeaponReady(WRF_ALLOWRELOAD)
354     WPAF B 2 A_WeaponReady(WRF_ALLOWRELOAD)
355     WPAF C 2 A_WeaponReady(WRF_ALLOWRELOAD)
356     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
357     TNT1 A 0 A_TakeInventory("BarrelIsSpinning", 1)
358     WPAF A 3 A_WeaponReady
359     WPAF B 3 A_WeaponReady
360     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
361     WPAF C 4 A_WeaponReady
362     Goto ReadyIdle
364   Firing:
365     TNT1 A 0 A_JumpIfNoAmmo("Reload")
366     TNT1 A 0 A_JumpIf(waterlevel==3, "Reload")
367     //TNT1 A 0 A_Overlay(3, "MuzzleFlash")
368     TNT1 A 0 A_GunFlash("MuzzleFlash")
370     WPAF A 1
371       {
372         A_AlertMonsters();
373         A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6");
375         A_PlayerWeaponSpeedScale(0.56);
376         A_PlayerWeaponJumpScale(0.56);
377         //A_PlayerWeaponDisableRun(true);
379         // each five bullet is a tracer
381         if (IsPlayerRunning()) {
382           // running
383           user_FireAngle = frandom(-6.2, 6.2);
384           user_FirePitch = frandom(-6.2, 6.2);
385         } else if (!IsPlayerStanding()) {
386           if (IsPlayerCrouching()) {
387             // crouch-moving
388             user_FireAngle = frandom(-2.6, 2.6);
389             user_FirePitch = frandom(-2.6, 2.6);
390           } else {
391             // walking
392             user_FireAngle = frandom(-3.2, 3.2);
393             user_FirePitch = frandom(-3.2, 3.2);
394           }
395         } else if (IsPlayerCrouching()) {
396           // crouch-standing
397           user_FireAngle = frandom(-1.2, 1.2);
398           user_FirePitch = frandom(-1.2, 1.2);
399         } else {
400           // standing
401           user_FireAngle = frandom(-2.2, 2.2);
402           user_FirePitch = frandom(-2.2, 2.2);
403         }
405         if (CountInv("AmmoBox")%5 != 0) {
406           A_FireProjectile("PaingunBullet", user_FireAngle, 1, /*5*/0, 0, FPF_NOAUTOAIM, user_FirePitch);
407         } else {
408           A_FireProjectile("PaingunTracer", user_FireAngle, 1, /*5*/0, 0, FPF_NOAUTOAIM, user_FirePitch);
409         }
410         A_PlaySound("Weapons/PaingunFire", CHAN_WEAPON);
412         A_SetPitch(-0.35+pitch);
413         A_SetAngle(-0.20+angle);
415       }
417     WPAF B 1
418       {
419         // drop shell
420         if (GetCVarB('k8ZanMod_PainCasing')) {
421           if (GetCVarB('r_models')) {
422             A_FireCustomMissileEx("Zan_PaingunBulletCasingSpawn", 5, false, 4+randompick(0, 1, 2, 3), -6, -6, FPF_NOAUTOAIM);
423           } else {
424             A_SpawnItemEx("PaingunBulletCasing", 10, 8, 58, frandom(1, 2), frandom(4, 5), frandom(3, 4), 0, SXF_NOCHECKPOSITION, 0);
425           }
426         }
428         if (CountInv("AmmoBox") != 0) {
429           user_DropShell = true;
431           if (IsPlayerRunning()) {
432             // running
433             user_FireAngle = frandom(-6.2, 6.2);
434             user_FirePitch = frandom(-6.2, 6.2);
435           } else if (!IsPlayerStanding()) {
436             if (IsPlayerCrouching()) {
437               // crouch-moving
438               user_FireAngle = frandom(-2.6, 2.6);
439               user_FirePitch = frandom(-2.6, 2.6);
440             } else {
441               // walking
442               user_FireAngle = frandom(-3.2, 3.2);
443               user_FirePitch = frandom(-3.2, 3.2);
444             }
445           } else if (IsPlayerCrouching()) {
446             // crouch-standing
447             user_FireAngle = frandom(-1.2, 1.2);
448             user_FirePitch = frandom(-1.2, 1.2);
449           } else {
450             // standing
451             user_FireAngle = frandom(-2.2, 2.2);
452             user_FirePitch = frandom(-2.2, 2.2);
453           }
455           if (CountInv("AmmoBox")%5 != 0) {
456             A_FireProjectile("PaingunBullet", user_FireAngle, 1, /*5*/0, 0, FPF_NOAUTOAIM, user_FirePitch);
457           } else {
458             A_FireProjectile("PaingunTracer", user_FireAngle, 1, /*5*/0, 0, FPF_NOAUTOAIM, user_FirePitch);
459           }
460           A_PlaySound("Weapons/PaingunFire", CHAN_WEAPON);
461         } else {
462           user_DropShell = false;
463         }
464       }
466     WPAF C 1
467       {
468         // drop shell
469         if (user_DropShell) {
470           if (GetCVarB('k8ZanMod_PainCasing')) {
471             if (GetCVarB('r_models')) {
472               A_FireCustomMissileEx("Zan_PaingunBulletCasingSpawn", 5, false, 4+randompick(0, 1, 2, 3), -6, -6, FPF_NOAUTOAIM);
473             } else {
474               A_SpawnItemEx("PaingunBulletCasing", 10, 8, 58, frandom(1, 2), frandom(4, 5), frandom(3, 4), 0, SXF_NOCHECKPOSITION, 0);
475             }
476           }
477         }
479         if (CountInv("AmmoBox") != 0) {
480           user_DropShell = true;
482           if (IsPlayerRunning()) {
483             // running
484             user_FireAngle = frandom(-6.2, 6.2);
485             user_FirePitch = frandom(-6.2, 6.2);
486           } else if (!IsPlayerStanding()) {
487             if (IsPlayerCrouching()) {
488               // crouch-moving
489               user_FireAngle = frandom(-2.6, 2.6);
490               user_FirePitch = frandom(-2.6, 2.6);
491             } else {
492               // walking
493               user_FireAngle = frandom(-3.2, 3.2);
494               user_FirePitch = frandom(-3.2, 3.2);
495             }
496           } else if (IsPlayerCrouching()) {
497             // crouch-standing
498             user_FireAngle = frandom(-1.2, 1.2);
499             user_FirePitch = frandom(-1.2, 1.2);
500           } else {
501             // standing
502             user_FireAngle = frandom(-2.2, 2.2);
503             user_FirePitch = frandom(-2.2, 2.2);
504           }
506           if (CountInv("AmmoBox")%5 != 0) {
507             A_FireProjectile("PaingunBullet", user_FireAngle, 1, /*5*/0, 0, FPF_NOAUTOAIM, user_FirePitch);
508           } else {
509             A_FireProjectile("PaingunTracer", user_FireAngle, 1, /*5*/0, 0, FPF_NOAUTOAIM, user_FirePitch);
510           }
511           A_PlaySound("Weapons/PaingunFire", CHAN_WEAPON);
512         } else {
513           user_DropShell = false;
514         }
516         A_SetPitch(0.35+pitch);
517         A_SetAngle(0.20+angle);
518       }
520     WPAF C 1
521       {
522         // drop shell
523         if (user_DropShell) {
524           if (GetCVarB('k8ZanMod_PainCasing')) {
525             if (GetCVarB('r_models')) {
526               A_FireCustomMissileEx("Zan_PaingunBulletCasingSpawn", 5, false, 4+randompick(0, 1, 2, 3), -6, -6, FPF_NOAUTOAIM);
527             } else {
528               A_SpawnItemEx("PaingunBulletCasing", 10, 8, 58, frandom(1, 2), frandom(4, 5), frandom(3, 4), 0, SXF_NOCHECKPOSITION, 0);
529             }
530           }
531         }
532       }
534     TNT1 A 0 A_Refire("Firing")
535     WPAF A 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
536     WPAF B 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
537     WPAF C 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
538     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
539     WPAF A 2 A_WeaponReady(WRF_ALLOWRELOAD)
540     WPAF B 2 A_WeaponReady(WRF_ALLOWRELOAD)
541     WPAF C 2 A_WeaponReady(WRF_ALLOWRELOAD)
542     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
543     TNT1 A 0 A_TakeInventory("BarrelIsSpinning", 1)
544     WPAF A 3 A_WeaponReady
545     WPAF B 3 A_WeaponReady
546     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
547     WPAF C 4 A_WeaponReady
548     Goto ReadyIdle
550   MuzzleFlash:
551     WPFL A 1 A_Light2
552     WPFL B 1 A_Light2
553     WPFL C 1 A_Light1
554     TNT1 A 0 A_Light0
555     Goto LightDone
557   AltFire:
558     TNT1 A 0 A_JumpIfNoAmmo("Reload")
559     TNT1 A 0 A_JumpIf(waterlevel==3, "Reload")
560     TNT1 A 0 A_JumpIfInventory("BarrelIsSpinning", 1, "Altfiring")
561     WPAF A 3 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
562     WPAF C 2
563     WPAF B 2
564     WPAF A 1 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
565     WPAF C 1
566     WPAF B 1
567     TNT1 A 0 A_Refire("Altfiring")
568     WPAF A 1 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
569     WPAF C 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
570     WPAF B 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
571     TNT1 A 0 A_TakeInventory("BarrelIsSpinning", 1)
572     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
573     WPAF A 2 A_WeaponReady
574     WPAF C 2 A_WeaponReady
575     WPAF B 2 A_WeaponReady
576     Goto ReadyIdle
578   Altfiring:
579     TNT1 A 0 A_JumpIfNotInventory("AmmoBox", "Reload")
580     TNT1 A 0 A_JumpIf(waterlevel==3, "Reload")
581     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
582     //TNT1 A 0 A_Overlay(3, "MuzzleGas")
583     TNT1 A 0 A_GunFlash("MuzzleGas")
585     WPAF A 1
586       {
587         A_AlertMonsters();
588         if (!HasSpecialPowerup(PWRT_INFAMMO)) A_TakeInventory("AmmoBox", 1);
590         A_PlayerWeaponSpeedScale(0.56);
591         A_PlayerWeaponJumpScale(0.56);
592         //A_PlayerWeaponDisableRun(true);
594         // each five bullet is "alt-bullet"
596         if (IsPlayerRunning()) {
597           user_FireAngle = frandom(-4.8, 4.8);
598           user_FirePitch = frandom(-4.8, 4.8);
599         } else if (IsPlayerCrouching()) {
600           user_FireAngle = frandom(-0.8, 0.8);
601           user_FirePitch = frandom(-0.8, 0.8);
602         } else if (!IsPlayerStanding()) {
603           user_FireAngle = frandom(-1.8, 1.8);
604           user_FirePitch = frandom(-1.8, 1.8);
605         } else {
606           user_FireAngle = frandom(-1.2, 1.2);
607           user_FirePitch = frandom(-1.2, 1.2);
608         }
610         if (IsPlayerRunning()) {
611           // running
612           user_FireAngle = frandom(-4.8, 4.8);
613           user_FirePitch = frandom(-4.8, 4.8);
614         } else if (!IsPlayerStanding()) {
615           if (IsPlayerCrouching()) {
616             // crouch-moving
617             user_FireAngle = frandom(-1.4, 1.4);
618             user_FirePitch = frandom(-1.4, 1.4);
619           } else {
620             // walking
621             user_FireAngle = frandom(-1.8, 1.8);
622             user_FirePitch = frandom(-1.8, 1.8);
623           }
624         } else if (IsPlayerCrouching()) {
625           // crouch-standing
626           user_FireAngle = frandom(-0.8, 0.8);
627           user_FirePitch = frandom(-0.8, 0.8);
628         } else {
629           // standing
630           user_FireAngle = frandom(-1.2, 1.2);
631           user_FirePitch = frandom(-1.2, 1.2);
632         }
634         if (CountInv("AmmoBox")%5 != 0) {
635           A_FireProjectile("PaingunTracer", user_FireAngle, 1, /*5*/0, 0, FPF_NOAUTOAIM, user_FirePitch);
636         } else {
637           A_FireProjectile("PaingunBulletAlt", user_FireAngle, 1, /*5*/0, 0, FPF_NOAUTOAIM, user_FirePitch);
638         }
639         A_PlaySound("Weapons/PaingunFire", CHAN_WEAPON);
641         A_SetPitch(-0.25+pitch);
642         A_SetAngle(-0.1+angle);
643       }
645     WPAF C 1
646       {
647         // drop shell
648         if (GetCVarB('k8ZanMod_PainCasing')) {
649           if (GetCVarB('r_models')) {
650             A_FireCustomMissileEx("Zan_PaingunBulletCasingSpawn", 5, false, 4+randompick(0, 1, 2, 3), -6, -6, FPF_NOAUTOAIM);
651           } else {
652             A_SpawnItemEx("PaingunBulletCasing", 10, 8, 58, frandom(1, 2), frandom(4, 5), frandom(3, 4), 0, SXF_NOCHECKPOSITION, 0);
653           }
654         }
655       }
657     WPAF B 1
658       {
659         A_SetPitch(0.25+pitch);
660         A_SetAngle(0.1+angle);
661       }
663     TNT1 A 0 A_Refire("Altfiring")
664     WPAF A 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
665     WPAF C 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
666     WPAF B 1 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWRELOAD)
667     TNT1 A 0 A_TakeInventory("BarrelIsSpinning", 1)
668     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
669     WPAF A 2 A_WeaponReady
670     WPAF C 2 A_WeaponReady
671     WPAF B 2 A_WeaponReady
672     Goto ReadyIdle
674   MuzzleGas:
675     WPFL D 2 A_Light2
676     WPFL F 2 A_Light1
677     WPFL E 2 A_Light0
678     Goto LightDone
680   Reload:
681     TNT1 A 0 A_JumpIfInventory("BarrelIsSpinning", 1, "ReloadSpinning")
682     WPAF A 4
683       {
684         A_PlayerWeaponSpeedScale(0.56);
685         A_PlayerWeaponJumpScale(0.56);
686         A_PlayerWeaponDisableRun(false);
687         A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6");
688       }
689     WPAF B 4
690     WPAF C 3
691     WPAF A 3 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
692     WPAF B 3
693     WPAF C 2
694     WPAF A 2 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
695     WPAF B 2
696     WPAF C 2
697     TNT1 A 0 A_GiveInventory("BarrelIsSpinning", 1)
698   ReloadSpinning:
699     WPAF A 1
700       {
701         A_PlayerWeaponSpeedScale(0.56);
702         A_PlayerWeaponJumpScale(0.56);
703         A_PlayerWeaponDisableRun(false);
704         A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6");
705       }
706     WPAF B 1
707     WPAF C 1
708     WPAF A 1 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
709     WPAF B 1
710     WPAF C 1
711     WPAF B 1 A_WeaponReady(WRF_ALLOWRELOAD)
712     // stop spinning
713     TNT1 A 0 A_TakeInventory("BarrelIsSpinning", 1)
714     WPAF B 1 A_WeaponReady
715     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
716     WPAF B 2 A_WeaponReady
717     WPAF C 2 A_WeaponReady
718     TNT1 A 0 A_PlaySoundEx("Weapons/PaingunSpin", "SoundSlot6")
719     WPAF A 3 A_WeaponReady
720     WPAF B 3 A_WeaponReady
721     WPAF C 4 A_WeaponReady
722     Goto ReadyIdle
724     stateinclude "QuickKick/QuickKickInclude.txt"
725   }
729 ACTOR PaingunBullet : FastProjectile {
730   Scale 0.15
731   Radius 2
732   Height 2
733   Speed 250
734   Projectile
735   Damage (2*random(7, 10))
736   DamageType "Paingun"
737   +k8MissileHeadshots
738   +k8MissileHitscan  // block by "block hitscan" line flag, not by "block projectile" flag
739   +DONTREFLECT
740   +THRUGHOST
741   +BLOODSPLATTER
742   +THRUSPECIES
743   +EXTREMEDEATH
744   +NoTeleport
745   +k8AllowSimpleTick
746   //SeeSound "Ammo/BulletCrack"
747   //DeathSound "Ammo/BulletCrack"
748   Obituary "%o was shredded down by %k."
749   Decal "PaingunBulletDecal"
750   Species "ZanSpecie"
752   States {
753   Spawn:
754     PBUL A 8
755     Loop
757   Death:
758     TNT1 A 0 A_Jump(150, 4)
759     TNT1 A 0 A_SetScale(1.0, 1.0)
760     PBUL B 1 bright
761     TNT1 A 0 A_SetScale(1.3, 1.3)
762     PBUL C 1 bright
763     Stop
764   }
768 ACTOR PaingunBulletAlt : PaingunBullet {
769   -EXTREMEDEATH
770   Damage (2*random(9, 12))
774 ACTOR PaingunTracer : PaingunBullet {
775   -EXTREMEDEATH
776   +BRIGHT
778   States {
779   Spawn:
780     PTRA A 4 Bright
781     Loop
783   Death:
784     TNT1 A 0
785     Stop
786   }
790 ACTOR BarrelIsSpinning : Inventory {
791   Inventory.Amount 1
792   Inventory.MaxAmount 1
793   Inventory.InterHubAmount 0
795   States {
796   Spawn:
797     TNT1 A -1
798     Stop
799   }
803 // heretic
804 Actor (optional) Zan_SkullRodAmmoBelt : AmmoBelt Replaces SkullRodAmmo {}
805 Actor (optional) Zan_SkullRodAmmoBox : AmmoBox Replaces SkullRodHefty {}
807 Actor (optional) Zan_SkullRodPaingun : Paingun Replaces SkullRod {}
808 Actor (optional) Zan_SkullRodPoweredPaingun : Paingun Replaces SkullRodPowered {}
810 Actor (optional) Zan_TPH_AmmoChaingun : AmmoBox Replaces AmmoChaingun {}
811 Actor (optional) Zan_TPH_TPHBulletDispenser : Paingun Replaces TPHBulletDispenser {}