From 04b0ab2f6857a1641c52fd7884c5b838009bee68 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Thu, 11 Mar 2021 21:44:28 +0100 Subject: [PATCH] Allow Explodium/Candy mags to bounce at certain angles. --- language.version | 4 +-- zscript/weapons/swwm_splode_fx.zsc | 31 ++++++++++++++++++--- zscript/weapons/swwm_tastytreat_fx.zsc | 38 ++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/language.version b/language.version index 692bf4324..142cec0ca 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r347 \cu(Thu 11 Mar 20:26:33 CET 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r347 \cu(2021-03-11 20:26:33)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r347 \cu(Thu 11 Mar 21:44:28 CET 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r347 \cu(2021-03-11 21:44:28)\c-"; diff --git a/zscript/weapons/swwm_splode_fx.zsc b/zscript/weapons/swwm_splode_fx.zsc index 4bfc41b2f..b866bc67a 100644 --- a/zscript/weapons/swwm_splode_fx.zsc +++ b/zscript/weapons/swwm_splode_fx.zsc @@ -129,6 +129,12 @@ Class ExplodiumMagProj : Actor +NODAMAGETHRUST; +FORCERADIUSDMG; +FORCEXYBILLBOARD; + +BOUNCEONFLOORS; + +BOUNCEONCEILINGS; + +BOUNCEONWALLS; + +USEBOUNCESTATE; + BounceFactor 0.4; + WallBounceFactor 0.4; } override void PostBeginPlay() { @@ -152,7 +158,7 @@ Class ExplodiumMagProj : Actor 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); + int numpt = Random[ExploS](16,24); for ( int i=0; i 4) && (vel.unit() dot cvel > .5) ) + { + bHITOWNER = true; + A_StartSound("explodium/mag"); + return; + } + ExplodeMissile(); + } States { Spawn: @@ -196,6 +212,9 @@ Class ExplodiumMagProj : Actor if ( vel.length() > 0. ) cvel = vel.unit(); } Wait; + Bounce: + XZW1 A 0 A_CheckBounce(); + Goto Spawn; Death: TNT1 A 0 A_BlowUp(); XEX1 ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] 1 Bright; @@ -260,6 +279,10 @@ Class ExplodiumMagAttach : ExplodiumMagProj default { +MOVEWITHSECTOR; + -BOUNCEONFLOORS; + -BOUNCEONCEILINGS; + -BOUNCEONWALLS; + -USEBOUNCESTATE; Speed 15; } diff --git a/zscript/weapons/swwm_tastytreat_fx.zsc b/zscript/weapons/swwm_tastytreat_fx.zsc index b602b09e4..da5c19a58 100644 --- a/zscript/weapons/swwm_tastytreat_fx.zsc +++ b/zscript/weapons/swwm_tastytreat_fx.zsc @@ -525,6 +525,12 @@ Class CandyGunProj : Actor +FORCERADIUSDMG; +FORCEXYBILLBOARD; +FOILINVUL; + +BOUNCEONFLOORS; + +BOUNCEONCEILINGS; + +BOUNCEONWALLS; + +USEBOUNCESTATE; + BounceFactor 0.3; + WallBounceFactor 0.3; } override void PostBeginPlay() { @@ -583,6 +589,16 @@ Class CandyGunProj : Actor Spawn("CandyRing3",pos); if ( swwm_omnibust ) BusterWall.ProjectileBust(self,5000+900*special1,cvel); } + void A_CheckBounce() + { + if ( (vel.length() > 4) && (vel.unit() dot cvel > .5) ) + { + bHITOWNER = true; + A_StartSound("explodium/mag"); + return; + } + ExplodeMissile(); + } States { Spawn: @@ -593,6 +609,9 @@ Class CandyGunProj : Actor if ( vel.length() > 0. ) cvel = vel.unit(); } Wait; + Bounce: + XZW1 A 0 A_CheckBounce(); + Goto Spawn; Death: TNT1 A 0 A_BlowUp(); XEX3 AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSS 1 Bright @@ -641,6 +660,12 @@ Class CandyMagProj : Actor +FORCERADIUSDMG; +FORCEXYBILLBOARD; +FOILINVUL; + +BOUNCEONFLOORS; + +BOUNCEONCEILINGS; + +BOUNCEONWALLS; + +USEBOUNCESTATE; + BounceFactor 0.4; + WallBounceFactor 0.4; } override void PostBeginPlay() { @@ -699,6 +724,16 @@ Class CandyMagProj : Actor Spawn("CandyRing2",pos); if ( swwm_omnibust ) BusterWall.ProjectileBust(self,1000+900*special1,cvel); } + void A_CheckBounce() + { + if ( (vel.length() > 4) && (vel.unit() dot cvel > .5) ) + { + bHITOWNER = true; + A_StartSound("explodium/mag"); + return; + } + ExplodeMissile(); + } States { Spawn: @@ -709,6 +744,9 @@ Class CandyMagProj : Actor if ( vel.length() > 0. ) cvel = vel.unit(); } Wait; + Bounce: + XZW1 A 0 A_CheckBounce(); + Goto Spawn; Death: TNT1 A 0 A_BlowUp(); XEX3 AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSS 1 Bright