added cheating options to emulate old "don't hurt self" bug; it is possible to plant...
[k8zan.git] / decorate / Weapons / FragfireGun.txt
blob9c04fbd16971d2c179e131bc4c2db1bda144f650
1 ACTOR FragfireCan : Ammo {
2   Radius 14
3   Height 14
4   Scale 0.60
5   Inventory.Amount 80
6   Inventory.MaxAmount 240
7   Ammo.BackpackAmount 160
8   Ammo.BackpackMaxAmount 400
9   Inventory.Icon "AFRAA0"
10   Inventory.PickupMessage "Picked up a Fragfire Can."
11   Inventory.PickupSound "Ammo/FragfireCanPick"
15 ACTOR FragfireCanBox : FragfireCan replaces ShellBox {
16   Inventory.Amount 80
17   Inventory.PickupMessage "Picked up a Fragfire Can."
18   Inventory.PickupSound "Ammo/FragfireCanPick"
20   States {
21   Spawn:
22     AFRA A -1
23     Stop
24   }
28 Actor FragfireCanHalf : FragfireCan replaces Shell {
29   Inventory.Amount 40
30   Inventory.PickupMessage "Picked up a half full Fragfire Can."
32   States {
33   Spawn:
34     AFRA D -1
35     Stop
36   }
40 ACTOR FragfireCanDropped {
41   Radius 1
42   Height 1
43   Scale 0.60
44   Gravity 0.85
45   +MOVEWITHSECTOR
46   +MISSILE
47   +NOBLOCKMAP
48   +BOUNCEONFLOORS
49   +BOUNCEONWALLS
50   +BOUNCEONCEILINGS
51   +ALLOWBOUNCEONACTORS
52   +BOUNCEONACTORS
53   +NoTeleport
54   +k8AllowSimpleTick
55   BounceType Doom
56   BounceFactor 0.7
57   BounceCount 3
58   BounceSound "Ammo/FragfireCanBounce"
60   States {
61   Spawn:
62     AFRA B 16
63     AFRA C 1000
64     Stop
66   Death:
67     AFRA C -1
68     Stop
69   }
73 ACTOR FragfireGunLoaded : Ammo {
74   Inventory.Amount 0
75   Inventory.MaxAmount 80
76   Ammo.BackpackAmount 0
77   Ammo.BackpackMaxAmount 80
78   +INVENTORY.IGNORESKILL
82 ACTOR FragfireGun : Weapon replaces Shotgun {
83   Xscale 0.45
84   Yscale 0.40
85   Radius 25
86   Height 18
87   +INVENTORY.UNDROPPABLE
88   +WEAPON.NOALERT
89   //+WEAPON.NO_AUTO_SWITCH
90   +WEAPON.AMMO_OPTIONAL
91   //+WEAPON.ALT_USES_BOTH
92   Inventory.PickupMessage "Got a Fragfire Gun."
93   Inventory.PickupSound "Ammo/FragfireGunPick"
94   //Inventory.Icon "WFRAA0"
95   Tag "Fragfire Gun"
96   Weapon.SelectionOrder 1
97   //Weapon.MinSelectionAmmo1 0
98   //Weapon.MinSelectionAmmo2 1
99   Weapon.AmmoType1 "FragfireGunLoaded"
100   Weapon.AmmoGive1 0
101   Weapon.AmmoUse1 1
102   Weapon.AmmoType2 "FragfireCan"
103   Weapon.AmmoGive2 40
104   Weapon.AmmoUse2 0
105   Weapon.SlotNumber 3
107   var int user_lowPauseCount;
109   States {
110   Spawn:
111     WFRA B -1
112     Stop
114   PickupWeapon:
115     // always has some loaded ammo on first pickup
116     TNT1 A 0 A_GiveInventory("FragfireGunLoaded", random(1, 6)*10)
117     Stop
119   Select:
120     stateinclude "QuickKick/QuickKickOnSelectDeselect.txt"
121     TNT1 A 0
122       {
123         A_GiveInventory("HoldingFragfireGun", 1);
124         if (GetCVarB('k8ZanMod_CustomCrosshairs')) A_SetCrosshair(4);
125       }
126     TNT1 A 0 A_Raise(666)
127     Goto Ready
129   Deselect:
130     stateinclude "QuickKick/QuickKickOnSelectDeselect.txt"
131     WFRR A 1 Offset(-15, 40)
132     WFRR A 1 Offset(-30, 50)
133     WFRR A 1 Offset(-50, 65)
134     WFRR A 1 Offset(-70, 80)
135     Goto DeselectLoop
137   DeselectLoop:
138     TNT1 A 0 A_TakeInventory("HoldingFragfireGun", 1)
139     TNT1 A 1 A_Lower(666)  // was zero duration
140     Loop
142   Ready:
143     TNT1 A 8
144     TNT1 A 0 A_PlaySound("Ammo/FragfireGunPick", CHAN_WEAPON, 0.6)
145     WFRR A 1 Offset(-70, 80)
146     WFRR A 1 Offset(-50, 65)
147     WFRR A 1 Offset(-30, 50)
148     WFRR A 1 Offset(-15, 40)
149     TNT1 A 0 A_TakeInventory("QuickKickDisabled")
150     Goto ReadyIdle
152   ReadyIdle:
153     TNT1 A 0
154       {
155         // low ammo sound
156         if (CountInv("FragfireGunLoaded") <= 3*8) {
157           user_lowPauseCount -= 1;
158           if (user_lowPauseCount < 1) {
159             if (user_lowPauseCount > -666 && GetCVarB("k8ZanMod_WarnLowAmmo")) {
160               A_PlaySound("weapons/zanweapon/lowammo", CHAN_VOICE, 1.0);
161             }
162             local ammoCount = CountInv("FragfireGunLoaded");
163                  if (ammoCount > 2*8) user_lowPauseCount = 40/8;
164             else if (ammoCount > 1*8) user_lowPauseCount = 30/8;
165             else if (ammoCount > 0*8) user_lowPauseCount = 20/8;
166             else user_lowPauseCount = 10; // one frame
167           }
168         }
169       }
170     TNT1 A 0 Offset(-15, 40) A_JumpIf(CountInv("FragfireGunLoaded")==0, "ReadyEmptyGun")
171     WFRR AA 4 A_WeaponReady(WRF_ALLOWRELOAD)
172     Loop
174   ReadyEmptyGun:
175     WFRR B 1 Offset(-15, 40) A_WeaponReady(WRF_ALLOWRELOAD)
176     //Loop
177     Goto ReadyIdle  // for sound
179   Fire:
180     TNT1 A 0 A_JumpIfNoAmmo("Reload")
181     TNT1 A 0 A_JumpIf(waterlevel==3, "UnderwaterDryFire")
182     SPGH A 0
183       {
184         user_lowPauseCount = -666;
185         A_GunFlash("Flash");
186         A_PlaySound("Weapons/FragfireGunFire", CHAN_WEAPON);
187         A_SetPitch(-1.0+pitch);
188         A_FireProjectile("FragShot", frandom(-2.5, 2.5), 1, /*3*/0, 0, FPF_NOAUTOAIM, frandom(-1, 3));
189       }
190     TNT1 A 0 A_JumpIfNoAmmo("OutOfPellets")
191     TNT1 A 0
192       {
193         A_SetPitch(-1.0+pitch);
194         A_FireProjectile("FragShot", frandom(-2.5, 2.5), 1, /*3*/0, 0, FPF_NOAUTOAIM, frandom(0, 4));
195       }
196     TNT1 A 0 A_JumpIfNoAmmo("OutOfPellets")
197     TNT1 A 0
198       {
199         A_SetPitch(-1.0+pitch);
200         A_FireProjectile("FragShot", frandom(-2.5, 2.5), 1, /*3*/0, 0, FPF_NOAUTOAIM, frandom(1, 5));
201       }
202     TNT1 A 0 A_JumpIfNoAmmo("OutOfPellets")
203     TNT1 A 0
204       {
205         A_SetPitch(-1.0+pitch);
206         A_FireProjectile("FragShot", frandom(-2.5, 2.5), 1, /*3*/0, 0, FPF_NOAUTOAIM, frandom(2, 6));
207       }
208     TNT1 A 0 A_JumpIfNoAmmo("OutOfPellets")
209     TNT1 A 0
210       {
211         A_SetPitch(-1.0+pitch);
212         A_FireProjectile("FragShot", frandom(-2.5, 2.5), 1, /*3*/0, 0, FPF_NOAUTOAIM, frandom(3, 7));
213       }
214     TNT1 A 0 A_JumpIfNoAmmo("OutOfPellets")
215     TNT1 A 0
216       {
217         A_SetPitch(-1.0+pitch);
218         A_FireProjectile("FragShot", frandom(-2.5, 2.5), 1, /*3*/0, 0, FPF_NOAUTOAIM, frandom(4, 8));
219       }
220     TNT1 A 0 A_JumpIfNoAmmo("OutOfPellets")
221     TNT1 A 0
222       {
223         A_SetPitch(-1.0+pitch);
224         A_FireProjectile("FragShot", frandom(-2.5, 2.5), 1, /*3*/0, 0, FPF_NOAUTOAIM, frandom(5, 9));
225       }
226     TNT1 A 0 A_JumpIfNoAmmo("OutOfPellets")
227     TNT1 A 0
228       {
229         A_SetPitch(-1.0+pitch);
230         A_FireProjectile("FragShot", frandom(-2.5, 2.5), 1, /*3*/0, 0, FPF_NOAUTOAIM, frandom(6, 10));
231       }
232     WFRR A 8 //Offset(0, 33)
233     WFRR A 2 A_SetPitch(1.50+pitch)
234     WFRF A 1 //A_PlaySound("Weapons/FragfireGunPump", CHAN_WEAPON)
235     WFRF A 1 A_SetPitch(1.50+pitch)
236     WFRF B 2 A_SetPitch(1.50+pitch)
237     WFRF C 2 A_SetPitch(1.50+pitch)
238     WFRF D 2 A_PlaySound("Weapons/FragfireGunPump", CHAN_WEAPON)
239     WFRF C 2 A_SetPitch(1.00+pitch)
240     WFRF B 2 A_SetPitch(1.00+pitch)
241     WFRF A 2 A_AlertMonsters
242     Goto ReadyIdle
244   OutofPellets:
245     WFRR B 1 A_SetPitch(1.00+pitch)
246     WFRR B 1 A_SetPitch(1.00+pitch)
247     WFRR B 1 A_SetPitch(1.00+pitch)
248     Goto ReadyIdle
250   AltFire:
251     //TNT1 A 0 A_JumpIfNoAmmo("Reload")
252     TNT1 A 0 A_JumpIf(CountInv("FragfireGunLoaded")==0, "Reload")
253     TNT1 A 0 A_JumpIf(waterlevel==3, "UnderwaterDryFire")
254     TNT1 A 0
255       {
256         user_lowPauseCount = -666;
257         A_TakeInventory("FragfireGunLoaded", 1);
258         A_GunFlash("Flash");
259         A_SetPitch(-0.3+pitch);
260         A_FireCustomMissile("FlameShot", frandom(-3, 3), 0, 4, -3, FPF_NOAUTOAIM, frandom(-3, 3));
261       }
262     WFRR A 2 //Offset(0, 33)
263     TNT1 A 0
264       {
265         A_SetPitch(0.15+pitch);
266         A_AlertMonsters;
267       }
268     WFRR A 1 A_SetPitch(0.15+pitch)
269     TNT1 A 0 A_ReFire
270     Goto ReadyIdle
272   UnderwaterDryFire:
273     TNT1 A 0 A_PlaySound("Ammo/SpikeGunPick", CHAN_WEAPON, 0.4)
274     WFRR A 24
275     Goto ReadyIdle
277   DryFire:
278     TNT1 A 0 A_PlaySound("Ammo/SpikeGunPick", CHAN_WEAPON, 0.2)
279     WFRR B 16
280     Goto ReadyIdle
282   Flash:
283     WFRH B 1 A_Light2
284     WFRH A 1 A_Light2
285     WFRH B 1 A_Light1
286     TNT1 A 0 A_Light0
287     Goto LightDone
289   Reload:
290     WFRR A 0 A_JumpIfInventory("FragfireGunLoaded", 80, "ReloadFinish")
291     WFRR A 0 A_JumpIfInventory("FragfireCan", 1, "ReloadWork")
292     TNT1 A 0 A_JumpIfNoAmmo("DryFire")
293     //WFRR B 1 A_JumpIf(CountInv("FragfireCan")==0, "ReadyIdle")
294     Goto ReadyIdle
296   ReloadWork:
297     WFRF B 2 A_PlaySound("Weapons/FragReloadA", CHAN_WEAPON);
298     WFRF C 2
299     WFRF D 2
300     WFRL A 3
301     WFRL B 3
302     WFRL C 3 A_SpawnItem("FragfireCanDropped", -1, 16, 0)
303     WFRL C 7
304     WFRL D 3 A_PlaySound("Weapons/FragReloadB", CHAN_WEAPON)
305     WFRL E 2
306     WFRL F 2
307     WFRL G 3
308     WFRF A 4
309     WFRF B 2 A_PlaySound("Weapons/FragfireGunPump", CHAN_WEAPON)
310     WFRF C 2
311     WFRF D 2
312     WFRF C 2
313     WFRF B 2
314     //Goto ReloadLoop
316   ReloadLoop:
317     TNT1 A 0
318       {
319         // if reload in not cheating, drop unused ammo
320         if (!GetCVar("k8ZanMod_CheatReload")) {
321           A_TakeInventory("FragfireGunLoaded", 666);
322         }
323         local clipCount = CountInv("FragfireCan");
324         local loadCount = 80-CountInv("FragfireGunLoaded");
325         if (loadCount > 0) {
326           if (loadCount > clipCount) loadCount = clipCount;
327           A_TakeInventory("FragfireCan", loadCount);
328           A_GiveInventory("FragfireGunLoaded", loadCount);
329         }
330         user_lowPauseCount = 0;
331       }
333   ReloadFinish:
334     TNT1 A 0
335     Goto ReadyIdle
337     stateinclude "QuickKick/QuickKickInclude.txt"
338   }
342 ACTOR FragShot : FastProjectile {
343   Scale 0.7
344   Radius 5
345   //Height 10
346   //k8: i set it to 8
347   Height 8
348   Speed 120
349   Projectile
350   ProjectileKickBack 280
351   Damage(12*random(1, 1))
352   DamageType "FragfireGun"
353   +k8MissileHeadshots
354   +k8MissileHitscan  // block by "block hitscan" line flag, not by "block projectile" flag
355   +THRUGHOST
356   +NOBLOCKMAP
357   +BLOODSPLATTER
358   //+EXTREMEDEATH
359   DeathSound "Weapons/SpikeShotDeath"
360   //SeeSound "Weapons/FragfireGunFire"
361   Obituary "%o was turned into a charred pile of gore by %k's frag shot."
362   Decal "FragDecalHot"
364   States {
365   Spawn:
366     PFRA A 1 Bright A_SpawnItemEx("ProjectileFragShotTrail", Random(-24, -8), 0, 0, random(1, 4), 0, 0, 0, SXF_TRANSFERPITCH, 0)
367     Loop
369   Death:
370     TNT1 A 0 A_SpawnItemEx("SparkDie", 0, 0, 0, Random(-4, 4), Random(-4, 4), Random(-3, 5), 0, 0, 100)
371     TNT1 A 0 A_SpawnItemEx("SparkDie", 0, 0, 0, Random(-5, 5), Random(-5, 5), Random(-2, 6), 0, 0, 200)
372     Stop
373   }
377 ACTOR FlameShot /*: FastProjectile*/ {
378   Radius 12
379   Height 8
380   Speed 25
381   Mass 5
382   Scale 0.7
383   Damage (1*random(2, 6))
384   DamageType "Fire"
385   Projectile
386   ProjectileKickBack 0
387   //+RIPPER
388   +DONTREFLECT
389   +DONTTHRUST
390   +NOEXTREMEDEATH
391   +RANDOMIZE
392   //+PAINLESS
393   -BLOODSPLATTER
394   +BLOODLESSIMPACT
395   +NOBLOOD
396   +BLOODLESSIMPACT
397   +DONTSPLASH
398   +NOBLOCKMAP
399   -ACTIVATEIMPACT
400   SeeSound "Weapons/FlameShot"
401   DeathSound "Weapons/FlameDeath"
402   Obituary "%o got roasted by %k."
403   Decal "BurnDecalHot"
405   States {
406   Spawn:
407     PFRA B 3 bright
408     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
409     PFRA C 3 bright
410     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
411     PFRA D 3 bright
412     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
413     PFRA E 3 bright
414     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
415     PFRA F 3 bright
416     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
417     PFRA G 3 bright
418     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
419     PFRA H 3 bright
420     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
421     PFRA I 2 bright
422     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
423     PFRA J 2 bright
424     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
425     PFRA K 2 bright
426     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
427     PFRA L 2 bright
428     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
429     PFRA M 2 bright
430     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
431     PFRA N 2 bright
432     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
433     PFRA O 2 bright
434     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
435     PFRA P 2 bright
436     TNT1 A 0 A_JumpIf(waterlevel>=1, "WaterDeath")
437     PFRA Q 2 bright
438     Stop
440   Death:
441     TNT1 A 0 A_SpawnItemEx("FireTinyDie1", 0, 0, 1, 0, 0, 0, 0, 0, 190)
442     TNT1 A 0 A_SpawnItemEx("FireTinyDie2", 0, 0, 1, 0, 0, 0, 0, 0, 180)
443     TNT1 A 0 A_SpawnItemEx("FireTinyDie3", 0, 0, 1, 0, 0, 0, 0, 0, 170)
444     TNT1 A 0 A_SpawnItemEx("SteamPuffMedium", 0, 0, -25)
445     TNT1 A 0 A_PlaySound("Weapons/FlameDeath", CHAN_WEAPON)
446     PFRA M 2 bright A_Explode(random(8, 12), 160, 0, false, 80)
447     PFRA NOPQ 2 bright
448     Stop
450   WaterDeath:
451     PFRA Q 2 bright A_PlaySound("Weapons/SteamHiss", CHAN_WEAPON)
452     TNT1 A 0 A_SpawnItemEx("SteamPuffSmall")
453     TNT1 A 0 A_SpawnItemEx("SteamPuffMedium")
454     //TNT1 A 0 A_PlaySound("Weapons/SteamHiss", CHAN_WEAPON)
455     Stop
456   }
460 ACTOR ProjectileFragShotTrail {
461   Radius 5
462   Height 5
463   Scale 0.1
464   +DONTSPLASH
465   +NOGRAVITY
466   +NoTeleport
467   +k8AllowSimpleTick
469   States {
470   Spawn:
471     TNT1 A 0 A_JumpIf(waterlevel>1, "WaterDeath")
472     PFRA B 3 bright
473     Stop
475   WaterDeath:
476     TNT1 A -1
477     Stop
478   }
483 actor (optional) ZanSSGReplacer : RandomSpawner replaces SuperShotgun {
484   DropItem "FragfireGun"
489 // heretic
490 Actor (optional) Zan_CrossbowFragfireCan : FragfireCanBox Replaces CrossbowAmmo {}
491 Actor (optional) Zan_CrossbowFragfireCanBox : FragfireCanBox Replaces CrossbowHefty {}
493 Actor (optional) Zan_CrossbowFragfireGun : FragfireGun Replaces Crossbow {}
494 Actor (optional) Zan_CrossbowPoweredFragfireGun : FragfireGun Replaces CrossbowPowered {}
497 // hexen
498 Actor (optional) Zan_Mana2FragfireCan : FragfireCanBox Replaces Mana2 {}
500 Actor (optional) Zan_TPH_AmmoShotgun : FragfireCanBox Replaces AmmoShotgun {}
501 //Actor (optional) Zan_TPH_TPHShotgun : FragfireGun Replaces TPHShotgun {} //SSG
502 Actor (optional) Zan_TPH_TPHRifle : FragfireGun Replaces TPHRifle {}