// Munch Innovations Explodium Gun (from SWWM series) // Slot 2, replaces Pistol, Elven Wand, Hexen starting weapons Class ExplodiumCasing : SWWMCasing {} Class ExplodiumMag : SWWMCasing { Default { Mass 10; BounceFactor 0.4; WallBounceFactor 0.4; BounceSound "explodium/mag"; } override void PostBeginPlay() { Super.PostBeginPlay(); heat = 0; } States { Death: XZW1 BC -1 { pitch = roll = 0; angle = FRandom[Junk](0,360); frame = RandomPick[Junk](1,2); } Stop; } } Class ExplodiumMagArm : Actor { Default { Obituary "$O_EXPLODIUM"; PROJECTILE; +THRUACTORS; +BOUNCEONWALLS; +BOUNCEONFLOORS; +BOUNCEONCEILINGS; +NODAMAGETHRUST; +FORCERADIUSDMG; -NOGRAVITY; Gravity 0.35; BounceFactor 1.0; Radius 4; Height 4; } override void PostBeginPlay() { Super.PostBeginPlay(); reactiontime = Random[ExploS](10,15); double ang, pt; ang = FRandom[ExploS](0,360); pt = FRandom[ExploS](-90,90); vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[ExploS](8.,20.); } States { Spawn: TNT1 A 1 { A_CountDown(); Spawn("ExplodiumMagTrail",pos); SWWMUtility.DoExplosion(self,2+reactiontime/3,3000+500*reactiontime,40+3*reactiontime,20); Vector3 pvel = (FRandom[ExploS](-1,1),FRandom[ExploS](-1,1),FRandom[ExploS](-1,1)).unit()*FRandom[ExploS](1,5); let s = Spawn("SWWMHalfSmoke",pos); s.vel = pvel+vel*.2; s.SetShade(Color(1,1,1)*Random[ExploS](64,224)); s.special1 = Random[ExploS](1,3); s.scale *= 2.4; s.alpha *= 0.1+.4*(ReactionTime/15.); } Wait; } } Class ExplodiumMagTrail : Actor { Default { RenderStyle "Add"; +NOBLOCKMAP; +NOGRAVITY; +FORCEXYBILLBOARD; +NOTELEPORT; +NOINTERACTION; Scale 1.1; } States { Spawn: XEX1 ADGJMPSVY\ 1 Bright; Stop; } } Class ExplodiumMagProj : Actor { double pitchvel, anglevel; Vector3 cvel; Default { Obituary "$O_EXPLODIUM"; DamageType "Explodium"; Radius 6; Height 6; Gravity 0.5; Speed 30; PROJECTILE; -NOGRAVITY; +ROLLSPRITE; +ROLLCENTER; +INTERPOLATEANGLES; +NODAMAGETHRUST; +FORCERADIUSDMG; +FORCEXYBILLBOARD; } override void PostBeginPlay() { Super.PostBeginPlay(); pitchvel = FRandom[Junk](10,30)*RandomPick[Junk](-1,1); anglevel = FRandom[Junk](10,30)*RandomPick[Junk](-1,1); } void A_BlowUp() { angle = atan2(cvel.y,cvel.x); pitch = asin(-cvel.z); bNOGRAVITY = true; A_SetRenderStyle(1.,STYLE_Add); Scale *= 2.+.2*special1; A_AlertMonsters(6000); SWWMUtility.DoExplosion(self,20+15*special1,80000+8000*special1,90+10*special1,60,DE_EXTRAZTHRUST); A_QuakeEx(9,9,9,30,0,400+80*special1,"",QF_RELATIVE|QF_SCALEDOWN,falloff:300,rollintensity:2.); A_StartSound("explodium/maghit",CHAN_VOICE,attenuation:.35); A_StartSound("explodium/maghit",CHAN_WEAPON,attenuation:.2); A_SprayDecal("BigScorch",172); Scale *= FRandom[ExploS](0.8,1.1); Scale.x *= RandomPick[ExploS](-1,1); Scale.y *= RandomPick[ExploS](-1,1); int numpt = Random[ExploS](16,32); for ( int i=0; i 0. ) cvel = vel.unit(); } Wait; Death: TNT1 A 0 A_BlowUp(); XEX1 ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] 1 Bright; Stop; } } Class ExploLight : PaletteLight { Default { ReactionTime 15; } } Class ExploLight2 : PaletteLight { Default { ReactionTime 30; Args 0,0,0,120; } } Class ExplodiumBulletImpact : Actor { Default { Obituary "$O_EXPLODIUM"; DamageType "Explodium"; RenderStyle "Add"; Scale 1.2; +NOGRAVITY; +NOBLOCKMAP; +NODAMAGETHRUST; +FORCERADIUSDMG; +FORCEXYBILLBOARD; +NOTELEPORT; +NOINTERACTION; } override void PostBeginPlay() { Super.PostBeginPlay(); A_AlertMonsters(3000); SWWMUtility.DoExplosion(self,25,80000,90,40,DE_EXTRAZTHRUST); A_QuakeEx(4,4,4,10,0,250,"",QF_RELATIVE|QF_SCALEDOWN,falloff:150,rollintensity:0.2); A_StartSound("explodium/hit",CHAN_VOICE,attenuation:.6); A_StartSound("explodium/hit",CHAN_WEAPON,attenuation:.3); A_SprayDecal("Scorch",-172); Scale *= FRandom[ExploS](0.8,1.1); Scale.x *= RandomPick[ExploS](-1,1); Scale.y *= RandomPick[ExploS](-1,1); int numpt = Random[ExploS](10,20); for ( int i=0; i 0) && !invoker.chambered ) player.SetPSprite(PSP_WEAPON,ResolveState("Slide")); else A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWUSER1|WRF_ALLOWRELOAD); } Wait; Fire: XZW2 A 1 A_Schutt(); XZW2 IJKLMNOPQR 1; XZW2 S 2 A_DropCasing(); Goto Ready; AltFire: XZW2 A 2 { A_PlayerReload(); return A_JumpIf(invoker.clipcount<=0,"Reload"); } XZW5 NO 2; XZW5 P 1 A_StartSound("explodium/magpin",CHAN_WEAPON,CHANF_OVERLAP); XZW5 QRSTUVWXYZ 1; XZW6 A 1 A_StartSound("explodium/slideback",CHAN_WEAPON,CHANF_OVERLAP); XZW6 B 1; XZW6 C 1 { A_StartSound("explodium/magout",CHAN_WEAPON,CHANF_OVERLAP); invoker.special1 = invoker.clipcount; invoker.clipcount = 0; } XZW6 D 1 { A_StartSound("explodium/throwmag",CHAN_WEAPON,CHANF_OVERLAP); A_PlayerMelee(); } XZW6 EFGHIJKLMNOPRS 1; XZW6 T 1 A_ThrowMag(); XZW6 UV 2; XZW6 W 2 A_PlayerReload(); XZW6 XY 2; XZW6 Z 4; Goto ReloadEnd; Reload: XZW2 A 1 { if ( invoker.clipcount >= invoker.default.clipcount ) return ResolveState("CheckBullet"); A_PlayerReload(); if ( invoker.clipcount <= 0 ) return ResolveState("ReloadEmpty"); return ResolveState(null); } XZW2 TUVWXYZ 1; XZW3 A 1 A_StartSound("explodium/slideback",CHAN_WEAPON,CHANF_OVERLAP,.3); XZW3 B 1 { invoker.clipcount = 0; } XZW3 C 1; XZW3 D 1 A_StartSound("explodium/magout",CHAN_WEAPON,CHANF_OVERLAP); XZW3 EFGH 1; XZW3 I 1 A_DropMag(); Goto ReloadEnd; ReloadEmpty: XZW2 A 1; XZW3 JKLMNOP 1; XZW3 Q 1 A_StartSound("explodium/slideback",CHAN_WEAPON,CHANF_OVERLAP,.3); XZW3 RS 1; XZW3 T 1 A_StartSound("explodium/magout",CHAN_WEAPON,CHANF_OVERLAP); XZW3 UVWX 1; XZW3 Y 1 A_DropMag(); Goto ReloadEnd; ReloadEnd: XZW3 Z 1; XZW4 ABCDE 1; XZW4 F 1 A_StartSound("explodium/magin",CHAN_WEAPON,CHANF_OVERLAP); XZW4 GHIJKLMNOPQ 1; XZW4 R 1 { A_StartSound("explodium/jamitin",CHAN_WEAPON,CHANF_OVERLAP); invoker.clipcount = invoker.default.clipcount; } XZW4 STUV 1; XZW2 A 1 A_JumpIf(!invoker.chambered,"Slide"); Goto Ready; Slide: XZW2 A 1; XZW4 WXY 1; XZW5 A 1 A_StartSound("explodium/slideback",CHAN_WEAPON,CHANF_OVERLAP,.3); XZW5 BC 1; XZW5 D 1 { invoker.chambered = true; invoker.clipcount--; } XZW5 EFG 1; XZW5 H 1 A_StartSound("explodium/slideforward",CHAN_WEAPON,CHANF_OVERLAP); XZW5 IJKLM 1; Goto Ready; Zoom: XZW2 A 1 { A_PlayerCheckGun(); return A_Jump(256,"Zoom1","Zoom2","Zoom2"); } Goto Ready; CheckBullet: XZW2 A 1; XZW7 ABCDE 1; XZW7 F 1 A_StartSound("explodium/slideback",CHAN_WEAPON,CHANF_OVERLAP); XZW7 GHIJKLMNOP 1; XZW7 Q 1 A_StartSound("explodium/slideforward",CHAN_WEAPON,CHANF_OVERLAP); XZW7 RS 1; Goto Ready; User1: XZW2 A 1; XZW7 TU 1; User1Hold: XZW7 V 1 { A_PlayerMelee(true); A_StartSound("demolitionist/swing",CHAN_WEAPON,CHANF_OVERLAP); A_Parry(9); } XZW7 WX 1; XZW7 Y 1 A_Melee(); XZW7 Z 2; XZW8 ABCDE 2; XZW8 F 1 A_JumpIf(player.cmd.buttons&BT_USER1,"User1Hold"); XZW2 B 0 { invoker.PlayUpSound(self); } Goto Select; Zoom1: XZW2 A 2 A_StartSound("explodium/checkout",CHAN_WEAPON,CHANF_OVERLAP); XZW8 GHIJKLMNOPQRSTUVWXYZ 2; Goto Ready; Zoom2: XZW2 A 1 A_StartSound("explodium/speen",CHAN_WEAPON,CHANF_OVERLAP); XZW9 ABCDEFGHIJKLMNOPQRSTUVW 1; Goto Ready; Deselect: XZW2 A 2 A_StartSound("explodium/deselect",CHAN_WEAPON,CHANF_OVERLAP); XZWA TUVW 2; XZW2 B 2; XZW2 B -1 A_FullLower(); Stop; Flash: XZWZ A 2 { let psp = player.GetPSprite(PSP_FLASH); psp.frame = Random[GunFlash](0,9); let l = Spawn("SWWMWeaponLight",pos); l.target = self; } Stop; } } // TODO Dual Explodium Guns (eventually) /* Class DualExplodiumGun : ExplodiumGun { override bool CheckAmmo( int firemode, bool autoswitch, bool requireammo, int ammocount ) { if ( (firemode == PrimaryFire) || (firemode == AltFire) ) return (SisterWeapon&&(SisterWeapon.Amount > 1)); return Super.CheckAmmo(firemode,autoswitch,requireammo,ammocount); } Default { Tag "$T_EXPLODIUM2"; Weapon.SisterWeapon "ExplodiumGun"; Weapon.SlotPriority 2.; Weapon.SelectionOrder 950; } }*/