diff --git a/gldefs.txt b/gldefs.txt index ad8f228..d7ec01a 100644 --- a/gldefs.txt +++ b/gldefs.txt @@ -775,6 +775,10 @@ HardwareShader Texture "models/Glass2.png" Texture "masktex" "models/Glass2_m.png" Texture "envtex" "models/NyLeve_env.png" } +HardwareShader Texture "models/ElecFX.png" +{ + Shader "shaders/glsl/ElecFX.fp" +} // PP shaders HardwareShader PostProcess scene { diff --git a/modeldef.impaler b/modeldef.impaler index 1d935f9..c20753c 100644 --- a/modeldef.impaler +++ b/modeldef.impaler @@ -41,3 +41,211 @@ Model "Impaler" ROTATING FrameIndex IMPP A 1 0 } + +Model "Impaler" +{ + Path "models" + Model 2 "Impaler_d.3d" + SurfaceSkin 2 1 "JImpale1.png" + Scale 0.2 -0.2 0.2 + AngleOffset 180 + Offset 8 -15 -12 + DONTCULLBACKFACES + + // GemUp + FrameIndex IMGS A 2 42 + FrameIndex IMGS B 2 43 + FrameIndex IMGS C 2 44 + FrameIndex IMGS D 2 45 + FrameIndex IMGS E 2 46 + // GemIdle + FrameIndex IMGI A 2 47 + FrameIndex IMGI B 2 48 + FrameIndex IMGI C 2 49 + FrameIndex IMGI D 2 50 + FrameIndex IMGI E 2 51 + FrameIndex IMGI F 2 52 + FrameIndex IMGI G 2 53 + FrameIndex IMGI H 2 54 + // GemDown + FrameIndex IMGD A 2 0 + FrameIndex IMGD B 2 1 + FrameIndex IMGD C 2 2 + FrameIndex IMGD D 2 3 + FrameIndex IMGD E 2 4 + // GemAltFire + FrameIndex IMGA A 2 55 + FrameIndex IMGA B 2 56 + FrameIndex IMGA C 2 57 + FrameIndex IMGA D 2 58 + FrameIndex IMGA E 2 59 + FrameIndex IMGA F 2 60 + FrameIndex IMGA G 2 61 + FrameIndex IMGA H 2 62 + // GemAltHold + FrameIndex IMGA I 2 63 + FrameIndex IMGA J 2 64 + FrameIndex IMGA K 2 65 + FrameIndex IMGA L 2 66 + FrameIndex IMGA M 2 67 + FrameIndex IMGA N 2 68 + FrameIndex IMGA O 2 69 + FrameIndex IMGA P 2 70 + // GemAltRelease + FrameIndex IMGA Q 2 71 + FrameIndex IMGA R 2 72 + FrameIndex IMGA S 2 73 + FrameIndex IMGA T 2 74 + FrameIndex IMGA U 2 75 + FrameIndex IMGA V 2 76 + FrameIndex IMGA W 2 77 + FrameIndex IMGA X 2 78 +} + +Model "Impaler" +{ + Path "models" + Model 3 "Impaler_d.3d" + SurfaceSkin 3 2 "ElecFX.png" + Scale 0.2 -0.2 0.2 + AngleOffset 180 + Offset 8 -15 -12 + DONTCULLBACKFACES + + // GemUp + FrameIndex IMZS A 3 42 + FrameIndex IMZS B 3 43 + FrameIndex IMZS C 3 44 + FrameIndex IMZS D 3 45 + FrameIndex IMZS E 3 46 + // GemIdle + FrameIndex IMZI A 3 47 + FrameIndex IMZI B 3 48 + FrameIndex IMZI C 3 49 + FrameIndex IMZI D 3 50 + FrameIndex IMZI E 3 51 + FrameIndex IMZI F 3 52 + FrameIndex IMZI G 3 53 + FrameIndex IMZI H 3 54 + // GemDown + FrameIndex IMZD A 3 0 + FrameIndex IMZD B 3 1 + FrameIndex IMZD C 3 2 + FrameIndex IMZD D 3 3 + FrameIndex IMZD E 3 4 + // GemAltFire + FrameIndex IMZA A 3 55 + FrameIndex IMZA B 3 56 + FrameIndex IMZA C 3 57 + FrameIndex IMZA D 3 58 + FrameIndex IMZA E 3 59 + FrameIndex IMZA F 3 60 + FrameIndex IMZA G 3 61 + FrameIndex IMZA H 3 62 + // GemAltHold + FrameIndex IMZA I 3 63 + FrameIndex IMZA J 3 64 + FrameIndex IMZA K 3 65 + FrameIndex IMZA L 3 66 + FrameIndex IMZA M 3 67 + FrameIndex IMZA N 3 68 + FrameIndex IMZA O 3 69 + FrameIndex IMZA P 3 70 + // GemAltRelease + FrameIndex IMZA Q 3 71 + FrameIndex IMZA R 3 72 + FrameIndex IMZA S 3 73 + FrameIndex IMZA T 3 74 + FrameIndex IMZA U 3 75 + FrameIndex IMZA V 3 76 + FrameIndex IMZA W 3 77 + FrameIndex IMZA X 3 78 +} + +Model "Impaler" +{ + Path "models" + Model 0 "Impaler_d.3d" + SurfaceSkin 0 0 "JImpale1.png" + Scale 0.2 -0.2 0.2 + AngleOffset 180 + Offset 8 -15 -12 + + // GemToggle + FrameIndex IMPG A 0 0 + FrameIndex IMPG B 0 1 + FrameIndex IMPG C 0 2 + FrameIndex IMPG D 0 3 + FrameIndex IMPG E 0 4 + // Down + FrameIndex IMPD A 0 5 + FrameIndex IMPD B 0 6 + FrameIndex IMPD C 0 7 + FrameIndex IMPD D 0 8 + FrameIndex IMPD E 0 9 + FrameIndex IMPD F 0 10 + // Select + FrameIndex IMPS A 0 10 + FrameIndex IMPS B 0 11 + FrameIndex IMPS C 0 12 + FrameIndex IMPS D 0 13 + FrameIndex IMPS E 0 14 + FrameIndex IMPS F 0 15 + // Idle + FrameIndex IMPI A 0 15 + FrameIndex IMPI B 0 16 + FrameIndex IMPI C 0 17 + FrameIndex IMPI D 0 18 + FrameIndex IMPI E 0 19 + FrameIndex IMPI F 0 20 + FrameIndex IMPI G 0 21 + FrameIndex IMPI H 0 22 + // Fire + FrameIndex IMPF A 0 23 + FrameIndex IMPF B 0 24 + FrameIndex IMPF C 0 25 + FrameIndex IMPF D 0 26 + FrameIndex IMPF E 0 27 + FrameIndex IMPF F 0 28 + FrameIndex IMPF G 0 29 + FrameIndex IMPF H 0 30 + FrameIndex IMPF I 0 31 + // Stab + FrameIndex IMPM A 0 32 + FrameIndex IMPM B 0 33 + FrameIndex IMPM C 0 34 + FrameIndex IMPM D 0 35 + FrameIndex IMPM E 0 36 + FrameIndex IMPM F 0 37 + FrameIndex IMPM G 0 38 + FrameIndex IMPM H 0 39 + FrameIndex IMPM I 0 40 + FrameIndex IMPM J 0 41 + // AltFire + FrameIndex IMPA A 0 55 + FrameIndex IMPA B 0 56 + FrameIndex IMPA C 0 57 + FrameIndex IMPA D 0 58 + FrameIndex IMPA E 0 59 + FrameIndex IMPA F 0 60 + FrameIndex IMPA G 0 61 + FrameIndex IMPA H 0 62 + // AltHold + FrameIndex IMPA I 0 63 + FrameIndex IMPA J 0 64 + FrameIndex IMPA K 0 65 + FrameIndex IMPA L 0 66 + FrameIndex IMPA M 0 67 + FrameIndex IMPA N 0 68 + FrameIndex IMPA O 0 69 + FrameIndex IMPA P 0 70 + // AltRelease + FrameIndex IMPA Q 0 71 + FrameIndex IMPA R 0 72 + FrameIndex IMPA S 0 73 + FrameIndex IMPA T 0 74 + FrameIndex IMPA U 0 75 + FrameIndex IMPA V 0 76 + FrameIndex IMPA W 0 77 + FrameIndex IMPA X 0 78 +} diff --git a/modeldef.stunner b/modeldef.stunner index 3ee0b2c..4dddc2b 100644 --- a/modeldef.stunner +++ b/modeldef.stunner @@ -12,3 +12,138 @@ Model "Stunner" ROTATING FrameIndex STNP A 1 0 } + +Model "Stunner" +{ + Path "models" + Model 2 "Stunner_d.3d" + SurfaceSkin 2 0 "Stunner.png" + AngleOffset -90 + RollOffset -5 + Scale 0.2 -0.2 0.2 + Offset 0 -20 -12 + DONTCULLBACKFACES + + // Sparks + FrameIndex STFF A 2 3 + FrameIndex STFF B 2 4 + FrameIndex STFF C 2 5 + FrameIndex STFF D 2 6 + FrameIndex STFF E 2 7 + FrameIndex STFF F 2 8 + FrameIndex STFF G 2 9 + FrameIndex STFF H 2 10 + FrameIndex STFF I 2 11 + FrameIndex STFF J 2 12 + FrameIndex STFF K 2 13 + FrameIndex STFF L 2 14 + FrameIndex STFF M 2 15 + FrameIndex STFF N 2 16 + FrameIndex STFF O 2 17 + FrameIndex STFF P 2 18 + FrameIndex STFF Q 2 19 + FrameIndex STFF R 2 20 + FrameIndex STFF S 2 21 +} + +Model "Stunner" +{ + Path "models" + Model 0 "Stunner_d.3d" + SurfaceSkin 0 1 "Stunner.png" + AngleOffset -90 + RollOffset -5 + Scale 0.2 -0.2 0.2 + Offset 0 -20 -12 + + // Idle + FrameIndex STNI A 0 1 + // Fire + FrameIndex STNF A 0 2 + FrameIndex STNF B 0 3 + FrameIndex STNF C 0 4 + FrameIndex STNF D 0 5 + FrameIndex STNF E 0 6 + FrameIndex STNF F 0 7 + FrameIndex STNF G 0 8 + FrameIndex STNF H 0 9 + FrameIndex STNF I 0 10 + FrameIndex STNF J 0 11 + FrameIndex STNF K 0 12 + FrameIndex STNF L 0 13 + FrameIndex STNF M 0 14 + FrameIndex STNF N 0 15 + FrameIndex STNF O 0 16 + FrameIndex STNF P 0 17 + FrameIndex STNF Q 0 18 + FrameIndex STNF R 0 19 + FrameIndex STNF S 0 20 + FrameIndex STNF T 0 21 + // Release + FrameIndex STNR A 0 22 + FrameIndex STNR B 0 23 + FrameIndex STNR C 0 24 + // Hold + FrameIndex STNH A 0 25 + FrameIndex STNH B 0 26 + FrameIndex STNH C 0 27 + FrameIndex STNH D 0 28 + FrameIndex STNH E 0 29 + FrameIndex STNH F 0 30 + FrameIndex STNH G 0 31 + FrameIndex STNH H 0 32 + FrameIndex STNH I 0 33 + FrameIndex STNH J 0 34 + FrameIndex STNH K 0 35 + FrameIndex STNH L 0 36 + FrameIndex STNH M 0 37 + FrameIndex STNH N 0 38 + FrameIndex STNH O 0 39 + FrameIndex STNH P 0 40 + FrameIndex STNH Q 0 41 + FrameIndex STNH R 0 42 + // Down + FrameIndex STND A 0 45 + FrameIndex STND B 0 46 + FrameIndex STND C 0 47 + FrameIndex STND D 0 48 + FrameIndex STND E 0 49 + FrameIndex STND F 0 50 + FrameIndex STND G 0 51 + FrameIndex STND H 0 52 + FrameIndex STND I 0 53 + FrameIndex STND J 0 54 + FrameIndex STND K 0 55 + FrameIndex STND L 0 56 + // Select + FrameIndex STNS A 0 56 + FrameIndex STNS B 0 57 + FrameIndex STNS C 0 58 + FrameIndex STNS D 0 59 + FrameIndex STNS E 0 60 + FrameIndex STNS F 0 61 + FrameIndex STNS G 0 62 + FrameIndex STNS H 0 63 + FrameIndex STNS I 0 64 + FrameIndex STNS J 0 65 + FrameIndex STNS K 0 66 + FrameIndex STNS L 0 67 + FrameIndex STNS M 0 68 + FrameIndex STNS N 0 69 + FrameIndex STNS O 0 70 + FrameIndex STNS P 0 71 + FrameIndex STNS Q 0 72 + FrameIndex STNS R 0 73 + FrameIndex STNS S 0 74 + FrameIndex STNS T 0 75 + FrameIndex STNS U 0 76 + FrameIndex STNS V 0 77 + FrameIndex STNS W 0 78 + FrameIndex STNS X 0 79 + // Release2 + FrameIndex STR2 A 0 82 + FrameIndex STR2 B 0 83 + FrameIndex STR2 C 0 84 + FrameIndex STR2 D 0 85 + FrameIndex STR2 E 0 86 +} \ No newline at end of file diff --git a/models/Impaler_d.3d b/models/Impaler_d.3d index 0215a66..1bea2d1 100644 Binary files a/models/Impaler_d.3d and b/models/Impaler_d.3d differ diff --git a/shaders/glsl/ElecFX.fp b/shaders/glsl/ElecFX.fp new file mode 100644 index 0000000..b8f1dbb --- /dev/null +++ b/shaders/glsl/ElecFX.fp @@ -0,0 +1,22 @@ +vec4 ProcessTexel() +{ + vec2 uv = vTexCoord.st; + uv.x += 1.; + float ang = timer*5.; + vec2 uv2 = vec2(uv.x*cos(ang)-uv.y*sin(ang),uv.y*cos(ang)+uv.x*sin(ang))*1.3; + vec4 col = getTexel(fract(uv2)); + uv.y -= 2.; + ang = timer*3.; + uv2 = vec2(uv.x*cos(ang)-uv.y*sin(ang),uv.y*cos(ang)+uv.x*sin(ang))*1.5; + col += getTexel(fract(uv2)); + uv.x -= 3.; + ang = timer*4.; + uv2 = vec2(uv.x*cos(ang)-uv.y*sin(ang),uv.y*cos(ang)+uv.x*sin(ang))*1.6; + col += getTexel(fract(uv2)); + uv.y += 4.; + ang = timer*2.; + uv2 = vec2(uv.x*cos(ang)-uv.y*sin(ang),uv.y*cos(ang)+uv.x*sin(ang))*1.2; + col += getTexel(fract(uv2)); + col *= .5; + return col; +} diff --git a/sndinfo.txt b/sndinfo.txt index b8f5478..56a5328 100644 --- a/sndinfo.txt +++ b/sndinfo.txt @@ -265,6 +265,25 @@ peace/fly brufly1 telehand/throw peacethr +stun/select stunsel +stun/charge stunchrg +stun/fire stunfire +stun/hit stunhit + +impaler/select impsel +impaler/gem impidle +impaler/gemdown impdown +impaler/fire impalerf +impaler/stab1 impstab1 +impaler/stab2 impstab2 +impaler/stab3 impstab3 +$random impaler/stab { impaler/stab1 impaler/stab2 impaler/stab3 } +impaler/flesh impflesh +impaler/wall impwall +impaler/altfire impboltl +impaler/hit imphit +impaler/beam ele04 + translator/event transa3 detector/start detact diff --git a/sounds/ImpalerF.ogg b/sounds/ImpalerF.ogg index b5f25ae..78c0fdd 100644 Binary files a/sounds/ImpalerF.ogg and b/sounds/ImpalerF.ogg differ diff --git a/zscript.txt b/zscript.txt index 4273e7f..695c62e 100644 --- a/zscript.txt +++ b/zscript.txt @@ -2,24 +2,24 @@ version "4.3" #include "zscript/unrealcommon.zsc" #include "zscript/dispersionpistol.zsc" -#include "zscript/utranslocator.zsc" -#include "zscript/stunner.zsc" -#include "zscript/bonesaw.zsc" #include "zscript/automag.zsc" -#include "zscript/betamag.zsc" #include "zscript/stinger.zsc" -#include "zscript/quadshot.zsc" #include "zscript/asmd.zsc" -#include "zscript/impaler.zsc" #include "zscript/ueightball.zsc" -#include "zscript/peacemaker.zsc" #include "zscript/uflakcannon.zsc" #include "zscript/razorjack.zsc" #include "zscript/ubiorifle.zsc" -#include "zscript/napalm.zsc" -#include "zscript/flamegun.zsc" #include "zscript/rifle.zsc" #include "zscript/uminigun.zsc" +#include "zscript/utranslocator.zsc" +#include "zscript/bonesaw.zsc" +#include "zscript/betamag.zsc" +#include "zscript/quadshot.zsc" +#include "zscript/stunner.zsc" +#include "zscript/flamegun.zsc" +#include "zscript/napalm.zsc" +#include "zscript/impaler.zsc" +#include "zscript/peacemaker.zsc" #include "zscript/gatling.zsc" #include "zscript/biggun.zsc" #include "zscript/uhealitems.zsc" diff --git a/zscript/asmd.zsc b/zscript/asmd.zsc index 333f063..b82ed12 100644 --- a/zscript/asmd.zsc +++ b/zscript/asmd.zsc @@ -741,6 +741,7 @@ Class ASMD : UnrealWeapon Weapon.UpSound "shock/select"; Weapon.SlotNumber 4; Weapon.SelectionOrder 4; + Weapon.SlotPriority 1; Weapon.AmmoType "ASMDAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "ASMDAmmo"; diff --git a/zscript/automag.zsc b/zscript/automag.zsc index 0d0daad..38d5e82 100644 --- a/zscript/automag.zsc +++ b/zscript/automag.zsc @@ -273,6 +273,7 @@ Class Automag : UnrealWeapon Weapon.UpSound "automag/select"; Weapon.SlotNumber 2; Weapon.SelectionOrder 2; + Weapon.SlotPriority 1; Weapon.AmmoType "UMiniAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "UMiniAmmo"; diff --git a/zscript/betamag.zsc b/zscript/betamag.zsc index 1dbed99..68c62ac 100644 --- a/zscript/betamag.zsc +++ b/zscript/betamag.zsc @@ -276,6 +276,7 @@ Class Betamag : UnrealWeapon Weapon.UpSound "betamag/select"; Weapon.SlotNumber 2; Weapon.SelectionOrder 1; + Weapon.SlotPriority 0.9; Weapon.AmmoType "UMiniAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "UMiniAmmo"; diff --git a/zscript/biggun.zsc b/zscript/biggun.zsc index 82164cc..45ef69f 100644 --- a/zscript/biggun.zsc +++ b/zscript/biggun.zsc @@ -165,6 +165,7 @@ Class BigGun : UnrealWeapon Weapon.UpSound "big/select"; Weapon.SlotNumber 9; Weapon.SelectionOrder 0; + Weapon.SlotPriority 0.8; Weapon.AmmoType "BigAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "BigAmmo"; diff --git a/zscript/bonesaw.zsc b/zscript/bonesaw.zsc index 5d7f9f8..b8726ac 100644 --- a/zscript/bonesaw.zsc +++ b/zscript/bonesaw.zsc @@ -48,6 +48,7 @@ Class Bonesaw : UnrealWeapon Weapon.UpSound "bonesaw/select"; Weapon.SlotNumber 1; Weapon.SelectionOrder 9; + Weapon.SlotPriority 0.9; +WEAPON.MELEEWEAPON; +FORCEPAIN; +NOEXTREMEDEATH; diff --git a/zscript/dispersionpistol.zsc b/zscript/dispersionpistol.zsc index dc65784..d196804 100644 --- a/zscript/dispersionpistol.zsc +++ b/zscript/dispersionpistol.zsc @@ -73,8 +73,7 @@ Class DefaultAmmo : Ammo { Super.Tick(); if ( !Owner ) return; - if ( Amount < 10 ) rechargespeed = 1.1; - else rechargespeed = 0.11*Amount; + rechargespeed = max(1.1,0.11*Amount); rechargephase += 1./rechargespeed; if ( rechargephase < 35 ) return; rechargephase = 0; @@ -664,7 +663,8 @@ Class DispersionPistol : UnrealWeapon Inventory.PickupMessage "$I_DPISTOL"; Weapon.UpSound "dpistol/select"; Weapon.SlotNumber 1; - Weapon.SelectionOrder 1; + Weapon.SelectionOrder 2; + Weapon.SlotPriority 1; Weapon.AmmoType "DefaultAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "DefaultAmmo"; diff --git a/zscript/flamegun.zsc b/zscript/flamegun.zsc index 4177404..a2e0dec 100644 --- a/zscript/flamegun.zsc +++ b/zscript/flamegun.zsc @@ -15,6 +15,7 @@ Class FlameGun : UnrealWeapon Weapon.UpSound "flamegun/select"; Weapon.SlotNumber 5; Weapon.SelectionOrder 2; + Weapon.SlotPriority 0.9; Weapon.AmmoType "FlameAmmo"; Weapon.AmmoUse 10; Weapon.AmmoType2 "FlameAmmo"; diff --git a/zscript/gatling.zsc b/zscript/gatling.zsc index 8681245..2d9aab9 100644 --- a/zscript/gatling.zsc +++ b/zscript/gatling.zsc @@ -76,6 +76,7 @@ Class SMiniGun : UnrealWeapon Weapon.UpSound "smini/select"; Weapon.SlotNumber 0; Weapon.SelectionOrder 1; + Weapon.SlotPriority 0.9; Weapon.AmmoType "SMiniAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "SMiniAmmo"; diff --git a/zscript/impaler.zsc b/zscript/impaler.zsc index ebbac2f..fa673f2 100644 --- a/zscript/impaler.zsc +++ b/zscript/impaler.zsc @@ -45,6 +45,15 @@ Class ImpalerCharge : Ammo Class Impaler : UnrealWeapon { + bool HasGem; + + override void DoEffect() + { + Super.DoEffect(); + if ( Owner.player.ReadyWeapon != self ) return; + let psp = Owner.player.FindPSprite(-2); + if ( psp ) psp.alpha = clamp(Ammo2.Amount/double(Ammo2.MaxAmount),0.,1.); + } Default { Tag "$T_IMPALER"; @@ -52,6 +61,7 @@ Class Impaler : UnrealWeapon Weapon.UpSound "impaler/select"; Weapon.SlotNumber 7; Weapon.SelectionOrder 0; + Weapon.SlotPriority 0.9; Weapon.AmmoType "ImpalerAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "ImpalerCharge"; @@ -69,5 +79,144 @@ Class Impaler : UnrealWeapon Stop; IMPP B -1; Stop; + Select: + IMPS A 1 A_Raise(int.max); + Wait; + Ready: + IMPS ABCDEF 3 A_WeaponReady(WRF_NOFIRE); + IMPI A 0 A_JumpIfNoAmmo("Idle"); + Goto Reload; + Dummy: + TNT1 A 1 + { + let weap = Weapon(invoker); + int flags = 0; + if ( weap.Ammo1.Amount > 0 ) flags |= WRF_ALLOWRELOAD; + if ( weap.Ammo2.Amount <= 0 ) flags |= WRF_NOSECONDARY; + A_WeaponReady(flags); + } + Wait; + Idle: + IMPI A 0 A_Overlay(-9999,"Dummy"); + IMPI ABCDEFGH 10; + Goto Idle+1; + Melee: + IMPM A 0 A_Overlay(-9999,"Null"); + IMPM ABCDEFGHIJ 2; + Goto Idle; + Fire: + IMPF A 0 + { + if ( !invoker.HasGem ) + return ResolveState("Melee"); + A_Overlay(-9999,"Null"); + A_Overlay(-3,"Null"); + A_Overlay(-2,"Null"); + A_PlaySound("impaler/fire",CHAN_WEAPON); + invoker.HasGem = false; + return ResolveState(null); + } + IMPF ABCDEFGHI 2; + IMPI A 0 A_JumpIfNoAmmo("Idle"); + Goto Reload; + AltFire: + IMPA A 0 + { + if ( !invoker.HasGem ) + return ResolveState("Melee"); + A_Overlay(-9999,"Null"); + A_Overlay(-3,"GemAltFire"); + A_Overlay(-2,"ZapAltFire"); + A_PlaySound("impaler/altfire",CHAN_WEAPON,looping:true); + return ResolveState(null); + } + IMPA ABCDEFGH 2; + Goto AltHold; + AltHold: + IMPA IJKLMNOP 2; + Goto AltRelease; + AltRelease: + IMPA Q 0 + { + A_Overlay(-3,"GemAltRelease"); + A_Overlay(-2,"ZapAltRelease"); + A_PlaySound("impaler/gem",CHAN_WEAPON,looping:true); + } + IMPA QRSTUVWX 2; + Goto Idle; + Reload: + IMPG A 0 + { + A_Overlay(-9999,"Null"); + invoker.HasGem = !invoker.HasGem; + if ( invoker.HasGem ) + { + A_Overlay(-3,"GemUp"); + A_Overlay(-2,"ZapUp"); + A_OverlayFlags(-2,PSPF_RenderStyle|PSPF_Alpha,true); + A_OverlayRenderStyle(-2,STYLE_Add); + A_PlaySound("impaler/gem",CHAN_WEAPON,looping:true); + } + else + { + A_Overlay(-3,"GemDown"); + A_Overlay(-2,"ZapDown"); + A_PlaySound("impaler/gemdown",CHAN_WEAPON); + } + } + IMPG ABCDE 2; + Goto Idle; + Deselect: + IMPD A 0 A_Overlay(-9999,"Null"); + IMPD A 0 A_JumpIf(!invoker.HasGem,"FullDeselect"); + IMPG A 0 + { + invoker.HasGem = false; + A_Overlay(-3,"GemDown"); + A_Overlay(-2,"ZapDown"); + A_PlaySound("impaler/gemdown",CHAN_WEAPON); + } + IMPG ABCDE 2; + Goto FullDeselect; + FullDeselect: + IMPD ABCDEF 2; + IMPD F 1 A_Lower(int.max); + Wait; + GemUp: + IMGS ABCDE 2; + Goto GemIdle; + GemIdle: + IMGI ABCDEFGH 10; + Loop; + GemDown: + IMGD ABCDE 2; + Stop; + GemAltFire: + IMGA ABCDEFGH 2; + Goto GemAltHold; + GemAltHold: + IMGA IJKLMNOP 2; + Loop; + GemAltRelease: + IMGA QRSTUVWX 2; + Goto GemIdle; + ZapUp: + IMZS ABCDE 2 Bright; + Goto ZapIdle; + ZapIdle: + IMZI ABCDEFGH 10 Bright; + Loop; + ZapDown: + IMZD ABCDE 2 Bright; + Stop; + ZapAltFire: + IMZA ABCDEFGH 2 Bright; + Goto ZapAltHold; + ZapAltHold: + IMZA IJKLMNOP 2 Bright; + Loop; + ZapAltRelease: + IMZA QRSTUVWX 2 Bright; + Goto ZapIdle; } } diff --git a/zscript/napalm.zsc b/zscript/napalm.zsc index 8dfa203..d6c85ea 100644 --- a/zscript/napalm.zsc +++ b/zscript/napalm.zsc @@ -36,6 +36,7 @@ Class UFlamethrower : UnrealWeapon Weapon.UpSound "flamet/select"; Weapon.SlotNumber 6; Weapon.SelectionOrder 4; + Weapon.SlotPriority 0.9; Weapon.AmmoType "FlameAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "FlameAmmo"; diff --git a/zscript/olsmp.zsc b/zscript/olsmp.zsc index a867a72..42a41e0 100644 --- a/zscript/olsmp.zsc +++ b/zscript/olsmp.zsc @@ -221,6 +221,7 @@ Class OLSMP : UnrealWeapon Weapon.UpSound "automag/select"; Weapon.SlotNumber 0; Weapon.SelectionOrder 9; + Weapon.SlotPriority 0.95; Weapon.AmmoType "OLSMPAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "OLSMPAmmo"; diff --git a/zscript/peacemaker.zsc b/zscript/peacemaker.zsc index b030bc2..7fe27a5 100644 --- a/zscript/peacemaker.zsc +++ b/zscript/peacemaker.zsc @@ -446,6 +446,7 @@ Class Peacemaker : UnrealWeapon Weapon.UpSound "peace/select"; Weapon.SlotNumber 8; Weapon.SelectionOrder 1; + Weapon.SlotPriority 0.9; Weapon.AmmoType "PeaceAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "PeaceAmmo"; diff --git a/zscript/quadshot.zsc b/zscript/quadshot.zsc index 2fc0805..aea3734 100644 --- a/zscript/quadshot.zsc +++ b/zscript/quadshot.zsc @@ -249,6 +249,7 @@ Class QuadShot : UnrealWeapon Weapon.UpSound "quadshot/select"; Weapon.SlotNumber 3; Weapon.SelectionOrder 2; + Weapon.SlotPriority 0.9; Weapon.AmmoType "UShells"; Weapon.AmmoUse 1; Weapon.AmmoType2 "UShells"; diff --git a/zscript/razorjack.zsc b/zscript/razorjack.zsc index 1c87d7c..dc765e0 100644 --- a/zscript/razorjack.zsc +++ b/zscript/razorjack.zsc @@ -246,6 +246,7 @@ Class Razorjack : UnrealWeapon Weapon.UpSound "ripper/select"; Weapon.SlotNumber 7; Weapon.SelectionOrder 7; + Weapon.SlotPriority 1; Weapon.AmmoType "RazorAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "RazorAmmo"; diff --git a/zscript/rifle.zsc b/zscript/rifle.zsc index 898c871..d968bd4 100644 --- a/zscript/rifle.zsc +++ b/zscript/rifle.zsc @@ -224,6 +224,7 @@ Class URifle : UnrealWeapon Weapon.UpSound "sniper/select"; Weapon.SlotNumber 9; Weapon.SelectionOrder 9; + Weapon.SlotPriority 1; Weapon.AmmoType "URifleAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "URifleAmmo"; diff --git a/zscript/stinger.zsc b/zscript/stinger.zsc index c70f60f..53abc0b 100644 --- a/zscript/stinger.zsc +++ b/zscript/stinger.zsc @@ -494,6 +494,7 @@ Class Stinger : UnrealWeapon Weapon.UpSound "stinger/select"; Weapon.SlotNumber 3; Weapon.SelectionOrder 7; + Weapon.SlotPriority 1; Weapon.AmmoType "StingerAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "StingerAmmo"; diff --git a/zscript/stunner.zsc b/zscript/stunner.zsc index 33149d0..19ef1c1 100644 --- a/zscript/stunner.zsc +++ b/zscript/stunner.zsc @@ -14,8 +14,7 @@ Class StunnerAmmo : Ammo { Super.Tick(); if ( !Owner ) return; - if ( Amount < 10 ) rechargespeed = 1.1; - else rechargespeed = 0.11*Amount; + rechargespeed = max(2.,.2*Amount); rechargephase += 1./rechargespeed; if ( rechargephase < 7 ) return; rechargephase = 0; @@ -33,6 +32,66 @@ Class StunProj : Actor Class Stunner : UnrealWeapon { + double chargesize, count; + bool bCharging; + + action void A_StunnerFire() + { + Weapon weap = Weapon(invoker); + if ( !weap ) return; + A_WeaponOffset(0,32); + invoker.bCharging = false; + if ( self is 'UTPlayer' ) + UTPlayer(self).PlayAttacking3(); + StunnerAmmo(weap.Ammo1).rechargephase = 0; + A_PlaySound("stun/fire",CHAN_WEAPON,Dampener.Active(self)?.4:1.); + double mult = Amplifier.GetMult(self,int(invoker.ChargeSize*50)+50); + invoker.FireEffect(); + A_Overlay(-2,"Null"); + } + action void A_BeginCharge() + { + let weap = Weapon(invoker); + invoker.bCharging = true; + weap.DepleteAmmo(weap.bAltFire,true,1); + invoker.count = 0; + invoker.chargesize = .6; + A_PlaySound("stun/charge",CHAN_WEAPON,Dampener.Active(self)?.15:1.); + A_Overlay(-2,"Sparks"); + A_OverlayFlags(-2,PSPF_RenderStyle,true); + A_OverlayRenderStyle(-2,STYLE_Add); + StunnerAmmo(weap.Ammo1).rechargephase = 0; + if ( !Dampener.Active(self) ) A_AlertMonsters(); + } + action State A_ChargeUp() + { + if ( !(player.cmd.buttons&(BT_ATTACK|BT_ALTATTACK)) ) + return ResolveState("Release"); + Weapon weap = Weapon(invoker); + if ( !weap ) return ResolveState(null); + StunnerAmmo(weap.Ammo1).rechargephase = 0; + UTMainHandler.DoSwing(self,(FRandom[Stunner](-1,1),FRandom[Stunner](-1,1)),0.02*invoker.chargesize,0,2,SWING_Spring); + A_WeaponOffset(FRandom[Stunner](-1,1)*1.2*invoker.chargesize,32+FRandom[Stunner](-1,1)*1.2*invoker.chargesize); + if ( !Dampener.Active(self) ) A_AlertMonsters(); + if ( invoker.chargesize >= 6. ) + { + invoker.count += 1./35.; + if ( invoker.count > 1.5 ) return ResolveState("Release"); + return ResolveState(null); + } + invoker.chargesize += 2./35.; + invoker.count += 1./35.; + if ( invoker.count < 0.14 ) return ResolveState(null); + invoker.count = 0; + if ( !(sv_infiniteammo || (FindInventory('PowerInfiniteAmmo',true))) ) + { + if ( weap.Ammo1.Amount < 1 ) + return ResolveState("Release"); + weap.Ammo1.Amount--; + } + return ResolveState(null); + } + Default { Tag "$T_STUNNER"; @@ -40,6 +99,7 @@ Class Stunner : UnrealWeapon Weapon.UpSound "stun/select"; Weapon.SlotNumber 4; Weapon.SelectionOrder 9; + Weapon.SlotPriority 0.9; Weapon.AmmoType "StunnerAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "StunnerAmmo"; @@ -54,5 +114,46 @@ Class Stunner : UnrealWeapon Stop; STNP B -1; Stop; + Select: + STNS A 1 A_Raise(int.max); + Wait; + Ready: + STNS ABCDEFGHIJKLMNOPQRSTUVWX 2 A_WeaponReady(WRF_NOFIRE); + Goto Idle; + Idle: + STNI A 1 + { + A_CheckReload(); + let weap = Weapon(invoker); + if ( weap && weap.Ammo1.Amount > 0 ) A_WeaponReady(); + else A_WeaponReady(WRF_NOFIRE); + } + Wait; + Fire: + AltFire: + #### # 2 A_BeginCharge(); + STNF ABCDEFGHIJKLMNOPQRST 2 A_ChargeUp(); + Goto Hold; + Hold: + STNH R 1 A_ChargeUp(); + Wait; + Release: + #### # 2; + STNR A 0 A_StunnerFire(); + STNR ABC 1; + STR2 ABCDE 2; + STNF TRPNLJHFDB 1 A_WeaponReady(WRF_NOSWITCH|WRF_DISABLESWITCH); + Goto Idle; + Deselect: + STND ABCDEFGHIJKL 1; + STND L 1 A_Lower(int.max); + Wait; + Sparks: + TNT1 A 8; + STFF ABCDEFGHIJKLMNOPQRS 2 Bright; + STFF J 0 A_JumpIf(invoker.chargesize>=5.,1); + Goto Sparks+10; + STFF JIHGFEDCBA 2 Bright; + Stop; } } diff --git a/zscript/ubiorifle.zsc b/zscript/ubiorifle.zsc index 1951e90..b2b5f44 100644 --- a/zscript/ubiorifle.zsc +++ b/zscript/ubiorifle.zsc @@ -668,6 +668,7 @@ Class UBioRifle : UnrealWeapon Weapon.UpSound "ges/select"; Weapon.SlotNumber 8; Weapon.SelectionOrder 8; + Weapon.SlotPriority 1; Weapon.AmmoType "UBioAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "UBioAmmo"; diff --git a/zscript/ueightball.zsc b/zscript/ueightball.zsc index 06f6015..32daa05 100644 --- a/zscript/ueightball.zsc +++ b/zscript/ueightball.zsc @@ -495,6 +495,7 @@ Class Eightball : UnrealWeapon Weapon.UpSound "utrl/select"; Weapon.SlotNumber 5; Weapon.SelectionOrder 5; + Weapon.SlotPriority 1; Weapon.AmmoType "URocketAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "URocketAmmo"; diff --git a/zscript/uflakcannon.zsc b/zscript/uflakcannon.zsc index 18a9f33..b5eed97 100644 --- a/zscript/uflakcannon.zsc +++ b/zscript/uflakcannon.zsc @@ -291,6 +291,7 @@ Class UFlakCannon : UnrealWeapon Weapon.UpSound "flak/select"; Weapon.SlotNumber 6; Weapon.SelectionOrder 4; + Weapon.SlotPriority 1; Weapon.AmmoType "UFlakBox"; Weapon.AmmoUse 1; Weapon.AmmoType2 "UFlakBox"; diff --git a/zscript/uminigun.zsc b/zscript/uminigun.zsc index 8f05dee..eb5525c 100644 --- a/zscript/uminigun.zsc +++ b/zscript/uminigun.zsc @@ -150,6 +150,7 @@ Class UMinigun : UnrealWeapon Weapon.UpSound "minigun/select"; Weapon.SlotNumber 0; Weapon.SelectionOrder 10; + Weapon.SlotPriority 1; Weapon.AmmoType "UMiniAmmo"; Weapon.AmmoUse 1; Weapon.AmmoType2 "UMiniAmmo"; diff --git a/zscript/unrealcommon.zsc b/zscript/unrealcommon.zsc index c7066d4..da202a2 100644 --- a/zscript/unrealcommon.zsc +++ b/zscript/unrealcommon.zsc @@ -176,7 +176,37 @@ Class UPlayer : UTPlayer if ( !player.weapons.LocateWeapon(type) ) continue; readonly def = GetDefaultByType(type); if ( (giveall == ALL_YESYES) || !def.bCheatNotWeapon ) + { GiveInventory(type,1,true); + if ( (type is 'Automag') && sting_automags ) + { + // force akimbo + let t = FindInventory(type); + if ( t ) t.Amount = 2; + } + else if ( (type is 'Betamag') && sting_protomags ) + { + // force akimbo + let t = FindInventory(type); + if ( t ) t.Amount = 2; + } + else if ( type is 'DispersionPistol' ) + { + // force upgrade + let dsp = DispersionPistol(FindInventory('DispersionPistol')); + if ( dsp ) + { + dsp.Ammo1.MaxAmount = 90; + if ( player.ReadyWeapon == dsp ) + dsp.pendingupgrade = 4; + else + { + dsp.upgradelevel = 4; + dsp.MainUse = min(6,dsp.upgradelevel+1); + } + } + } + } } } player.PendingWeapon = savedpending; @@ -1154,6 +1184,14 @@ Class UnrealMainHandler : EventHandler if ( t ) t.Use(false); } } + private static bool CmpWeapon( Class a, Class b ) + { + let defa = GetDefaultByType(a); + let defb = GetDefaultByType(b); + if ( defa.SlotPriority <= defb.SlotPriority ) return true; + if ( defa.SlotNumber > defb.SlotNumber ) return true; + return false; + } override void WorldLoaded( WorldEvent e ) { // More "authentic" Unreal flavor of these edits @@ -1167,8 +1205,9 @@ Class UnrealMainHandler : EventHandler level.ReplaceTextures("uAlnWl2b","C_WAL19A",0); level.ReplaceTextures("xAlnWl2b","C_WAL19F",0); } - // populate ammo-by-slot array - AmmoSlots.Clear(); + // populate weapons array + Array > SortedWeapons; + SortedWeapons.Clear(); for ( int i=0; i)(AllActorClasses[i]); @@ -1179,6 +1218,31 @@ Class UnrealMainHandler : EventHandler int wslot = def.SlotNumber; if ( wslot == -1 ) continue; if ( !def.AmmoType1 ) continue; + SortedWeapons.Push(type); + } + // sort weapons array + for ( int i=0; i 0) && CmpWeapon(SortedWeapons[k-1],SortedWeapons[k]) ) + { + Class tmp = SortedWeapons[k]; + SortedWeapons[k] = SortedWeapons[k-1]; + SortedWeapons[k-1] = tmp; + k--; + } + j++; + } + } + // populate ammo-by-slot array + AmmoSlots.Clear(); + for ( int i=0; i def = GetDefaultByType(SortedWeapons[i]); + int wslot = def.SlotNumber; int found = -1; for ( int j=0; j