diff --git a/GunLore.md b/GunLore.md index 08d2879..d42a550 100644 --- a/GunLore.md +++ b/GunLore.md @@ -15,8 +15,8 @@ until the end of time. ## Automag -A very reliable gunpowder-based firearm, chambered in 9mm. Uses two 10-round -clips in tandem. +A very reliable gunpowder-based firearm, chambered in 9mm. Magazine feeds off +two 10-round clips in tandem. Primary fire: The typical. Hold for automatic fire. @@ -145,6 +145,15 @@ Primary fire: A rapid barrage of bullets. Secondary fire: A much faster, but less accurate rain of pain. +## SMP 7243 + +A limited edition, gold-plated rapid fire Automag. Magazine holds 100 rounds, +but believe it or not, they won't last very long. + +Primary fire: Full auto, semi-accurate. Empties mag in 9 seconds. + +Secondary fire: Fuller auto, extremely inaccurate. Empties mag in 3 seconds. + # Prototype weapons ## Stunner @@ -216,7 +225,7 @@ higher velocity, resulting in increased damage. The special trait of this weapon comes into play when you realize that there's no need to reload. An experimental entanglement unit inside the gun's internal -clip locates spare ammunition carried by the user and automatically loads it. +mag locates spare ammunition carried by the user and automatically loads it. Since there's no need to reload, pressing the reload button makes use of the gun's weight to beat the crap out of your enemies up close. diff --git a/Readme.md b/Readme.md index 15ad36c..13d1583 100644 --- a/Readme.md +++ b/Readme.md @@ -43,6 +43,7 @@ Doom Tournament (currently the devel branch is required). - GES Bio Rifle (slot 8) (replaces plasma rifle) - Rifle (slot 9) (replaces plasma rifle) - Minigun (slot 0) (replaces chaingun) + - SMP 7243 (slot 0) (replaces bfg9000) - Flashlight (replaces light amplifier) - Searchlight (must be placed manually for balance reasons) diff --git a/cvarinfo.txt b/cvarinfo.txt index 6b7a9e6..734f662 100644 --- a/cvarinfo.txt +++ b/cvarinfo.txt @@ -18,3 +18,5 @@ server bool sting_dpistol = false; // d.pistol altfire always level 0 server bool sting_pshield = false; // p.shield does not drain over time user bool sting_transext = false; // use an extended translator graphic // to fit more text +server bool sting_olsmp = false; // adds the stupid oldskool SMP 7243 to + // the BFG/Redeemer replacement pool diff --git a/gldefs.txt b/gldefs.txt index 769eed0..eabc7cc 100644 --- a/gldefs.txt +++ b/gldefs.txt @@ -670,3 +670,15 @@ HardwareShader Texture "models/AsmdPBeam.png" { Shader "shaders/glsl/AsmdPBeam.fp" } +HardwareShader Texture "models/OLSMP.png" +{ + Shader "shaders/glsl/MeshEnviroMapMasked.fp" + Texture "masktex" "models/OLSMP_m.png" + texture "envtex" "models/OLSMP_env.png" +} +HardwareShader Texture "models/OLSMP_.png" +{ + Shader "shaders/glsl/MeshEnviroMapMasked_AmbientGlow.fp" + Texture "masktex" "models/OLSMP_m.png" + texture "envtex" "models/OLSMP_env.png" +} diff --git a/graphics/hud083/ammo/OLSMP083.png b/graphics/hud083/ammo/OLSMP083.png new file mode 100644 index 0000000..3f335ca Binary files /dev/null and b/graphics/hud083/ammo/OLSMP083.png differ diff --git a/graphics/icons/I_OLSMP.png b/graphics/icons/I_OLSMP.png new file mode 100644 index 0000000..f2ec145 Binary files /dev/null and b/graphics/icons/I_OLSMP.png differ diff --git a/language.txt b/language.txt index dfa066f..0040e9d 100644 --- a/language.txt +++ b/language.txt @@ -34,6 +34,7 @@ O_BIGGUN = "%k blew a hole through %o with the Demolisher."; O_SMINI = "%o got blasted into steaming chunks by %k's Autocannon."; O_SENTRY = "%o shouldn't have walked into the sights of %k's Sentry."; O_STINGERX = "%o ate flaming Tarydium death thanks to %k."; +O_OLSMP = "%o didn't stand a chance against %k's SMP 7243."; /* Pickup messages */ I_WPOWERUP = "You got a Dispersion Pistol Powerup."; I_STINGERAMMOL = "You picked up "; @@ -95,6 +96,8 @@ I_SHEALTH = "You picked up the Super Health Pack."; I_FLASHLIGHT = "You picked up a Flashlight."; I_DETECTOR = "You got the Motion Detector."; I_SCUBA = "You picked up the SCUBA Gear."; +I_OLSMP = "You got the SMP 7243. Time to kick ass!"; +I_OLSMPAMMO = "You picked up a SMP 7243 Magazine."; /* Tags */ T_WPOWERUP = "Dispersion Pistol Powerup"; T_STINGERAMMO = "Tarydium Shards"; @@ -156,6 +159,8 @@ T_LFLARES = "Light Flare"; T_DFLARES = "Darkness Flare"; T_DETECTOR = "Motion Detector"; T_SCUBA = "SCUBA Gear"; +T_OLSMP = "SMP 7243"; +T_OLSMPAMMO = "SMP 7243 Magazine"; /* Miscellaneous */ TR_NOMSG = "No new messages"; TR_NEWMSG = "New Translator message"; @@ -200,6 +205,7 @@ STING_PROTODUAL = "Protomags"; STING_UOPTS = "Compatibility options"; STING_DPISTOL = "Dispersion Pistol altfire isn't upgraded"; STING_PSHIELD = "Power Shield does not drain over time"; +STING_OLSMP = "Enable SMP 7243 from Oldskool Amp'd"; STING_MCREDS = "Unreal Credits"; STING_CDR = "Doomreal"; STING_CLEAD = "Development Lead:"; @@ -243,6 +249,7 @@ O_BIGGUN = "%k abrió un hoyo a través de %o con el Demoledor."; O_SMINI = "%o fue reventad@[ao_esp] en pedazos humeantes por el Autocañón de %k."; O_SENTRY = "%o no debería haberse metido en el punto de mira de la Torreta de %k."; O_STINGERX = "%o tragó muerte ardiente de Tarydium gracias a %k."; +O_OLSMP = "%o no tenía ninguna oportunidad contra el SMP 7243 de %k."; /* Pickup messages */ I_WPOWERUP = "Has obtenido una Mejora para la Pistola de Dispersión."; I_STINGERAMMOL = "Has recogido "; @@ -304,6 +311,8 @@ I_SHEALTH = "Has recogido el Paquete de Supersalud."; I_FLASHLIGHT = "Has recogido una Linterna."; I_DETECTOR = "Has obtenido el Detector de Movimiento."; I_SCUBA = "Has recogido el Kit de Buceo."; +I_OLSMP = "Has obtenido el SMP 7243. ¡Hora de patear traseros!"; +I_OLSMPAMMO = "Has recogido un Cargador de SMP 7243."; /* Tags */ T_WPOWERUP = "Mejora para Pistola de Dispersión"; T_STINGERAMMO = "Fragmentos de Tarydium"; @@ -361,6 +370,7 @@ T_LFLARES = "Bengala Luminosa"; T_DFLARES = "Bengala Oscura"; T_DETECTOR = "Detector de Movimiento"; T_SCUBA = "Kit de Buceo"; +T_OLSMPAMMO = "Cargador de SMP 7243"; /* Miscellaneous */ TR_NOMSG = "No hay mensajes nuevos"; TR_NEWMSG = "Nuevo mensaje de Traductor"; @@ -392,6 +402,7 @@ STING_PROTODUAL = "Protoarmas"; STING_UOPTS = "Opciones de compatibilidad"; STING_DPISTOL = "El fuego alternativo de la Pistola de Dispersión no es mejorado"; STING_PSHIELD = "El Escudo de Fuerza no pierde carga con el tiempo"; +STING_OLSMP = "Habilitar SMP 7243 de Oldskool Amp'd"; STING_MCREDS = "Créditos de Unreal"; STING_CDR = "Doomreal"; STING_CLEAD = "Desarrolladora Jefe:"; diff --git a/menudef.txt b/menudef.txt index 4302f94..277bf3c 100644 --- a/menudef.txt +++ b/menudef.txt @@ -39,6 +39,7 @@ OptionMenu "UnrealOptionMenu" StaticText "$STING_UOPTS", "Gold" Option "$STING_DPISTOL", "sting_dpistol", "YesNo" Option "$STING_PSHIELD", "sting_pshield", "YesNo" + Option "$STING_OLSMP", "sting_olsmp", "YesNo" } AddOptionMenu "OptionsMenu" diff --git a/modeldef.olsmp b/modeldef.olsmp new file mode 100644 index 0000000..7bb2ae8 --- /dev/null +++ b/modeldef.olsmp @@ -0,0 +1,183 @@ +Model "OLSMPAmmo" +{ + Path "models" + Model 0 "OLSMPAmmo_d.3d" + Skin 0 "OLSMP_.png" + Scale 0.08 -0.08 0.096 + ZOffset 1 + + FrameIndex UCLP A 0 0 +} + +Model "OLSMP" +{ + Path "models" + Model 1 "OLSMPPick_d.3d" + Skin 1 "OLSMP_.png" + Scale 0.08 -0.08 0.096 + AngleOffset -90 + ZOffset 19 + + FrameIndex AUTP B 1 0 + + ZOffset 21 + ROTATING + FrameIndex AUTP A 1 0 +} + +Model "OLSMP" +{ + Path "models" + Model 2 "Flat_d.3d" + AngleOffset 90 + Scale 0.04 0.04 0.04 + Offset 12.4 -30.0 -3.9 + + Skin 2 "Muz1.png" + FrameIndex AMUZ A 2 0 + Skin 2 "Muz2.png" + FrameIndex AMUZ B 2 0 + Skin 2 "Muz3.png" + FrameIndex AMUZ C 2 0 + Skin 2 "Muz4.png" + FrameIndex AMUZ D 2 0 + Skin 2 "Muz5.png" + FrameIndex AMUZ E 2 0 + Skin 2 "Muz6.png" + FrameIndex AMUZ F 2 0 + Skin 2 "Muz7.png" + FrameIndex AMUZ G 2 0 + Skin 2 "Muz8.png" + FrameIndex AMUZ H 2 0 + Skin 2 "Muz9.png" + FrameIndex AMUZ I 2 0 +} + +Model "OLSMP" +{ + Path "models" + Model 0 "OLSMPR_d.3d" + SurfaceSkin 0 1 "OLSMP.png" + Scale 0.12 -0.06 0.084 + Offset 6.9 -16.8 -11.1 + AngleOffset 90 + RollOffset -90 + + // Fire + FrameIndex AUTF A 0 1 + FrameIndex AUTF B 0 1 + FrameIndex AUTF C 0 2 + FrameIndex AUTF D 0 3 + // Fire0 + FrameIndex AUTF E 0 4 + FrameIndex AUTF F 0 5 + FrameIndex AUTF G 0 6 + // Fire1 + FrameIndex AUTF H 0 7 + FrameIndex AUTF I 0 8 + FrameIndex AUTF J 0 9 + // Fire2 + FrameIndex AUTF K 0 10 + FrameIndex AUTF L 0 11 + FrameIndex AUTF M 0 12 + // Release + FrameIndex AUTF N 0 13 + FrameIndex AUTF O 0 14 + FrameIndex AUTF P 0 15 + FrameIndex AUTF Q 0 16 + FrameIndex AUTF R 0 17 + FrameIndex AUTF S 0 18 + FrameIndex AUTF T 0 19 + // Twiddle + FrameIndex AUTT A 0 20 + FrameIndex AUTT B 0 21 + FrameIndex AUTT C 0 22 + FrameIndex AUTT D 0 23 + FrameIndex AUTT E 0 24 + FrameIndex AUTT F 0 25 + FrameIndex AUTT G 0 26 + FrameIndex AUTT H 0 27 + FrameIndex AUTT I 0 28 + FrameIndex AUTT J 0 29 + FrameIndex AUTT K 0 30 + FrameIndex AUTT L 0 31 + FrameIndex AUTT M 0 32 + FrameIndex AUTT N 0 33 + FrameIndex AUTT O 0 34 + FrameIndex AUTT P 0 35 + FrameIndex AUTT Q 0 36 + FrameIndex AUTT R 0 37 + FrameIndex AUTT S 0 38 + FrameIndex AUTT T 0 39 + FrameIndex AUTT U 0 40 + FrameIndex AUTT V 0 41 + FrameIndex AUTT W 0 42 + FrameIndex AUTT X 0 43 + FrameIndex AUTT Y 0 44 + // Sway + FrameIndex AUTI A 0 20 + FrameIndex AUTI B 0 21 + // Eject + FrameIndex AUTR A 0 45 + FrameIndex AUTR B 0 46 + FrameIndex AUTR C 0 47 + FrameIndex AUTR D 0 48 + FrameIndex AUTR E 0 49 + FrameIndex AUTR F 0 50 + FrameIndex AUTR G 0 51 + FrameIndex AUTR H 0 52 + FrameIndex AUTR I 0 53 + FrameIndex AUTR J 0 54 + FrameIndex AUTR K 0 55 + FrameIndex AUTR L 0 56 + FrameIndex AUTR M 0 57 + FrameIndex AUTR N 0 58 + FrameIndex AUTR O 0 59 + FrameIndex AUTR P 0 60 + FrameIndex AUTR Q 0 61 + FrameIndex AUTR R 0 62 + FrameIndex AUTR S 0 63 + FrameIndex AUTR T 0 64 + FrameIndex AUTR U 0 65 + FrameIndex AUTR V 0 66 + FrameIndex AUTR W 0 67 + FrameIndex AUTR X 0 68 + FrameIndex AUTR Y 0 69 + // Down + FrameIndex AUTD A 0 70 + FrameIndex AUTD B 0 71 + FrameIndex AUTD C 0 72 + FrameIndex AUTD D 0 73 + FrameIndex AUTD E 0 74 + // Select + FrameIndex AUTS A 0 75 + FrameIndex AUTS B 0 76 + FrameIndex AUTS C 0 77 + FrameIndex AUTS D 0 78 + FrameIndex AUTS E 0 79 + FrameIndex AUTS F 0 80 + FrameIndex AUTS G 0 81 + FrameIndex AUTS H 0 82 + FrameIndex AUTS I 0 83 + FrameIndex AUTS J 0 84 + FrameIndex AUTS K 0 85 + FrameIndex AUTS L 0 86 + FrameIndex AUTS M 0 87 + FrameIndex AUTS N 0 88 + FrameIndex AUTS O 0 89 + FrameIndex AUTS P 0 90 + FrameIndex AUTS Q 0 91 + FrameIndex AUTS R 0 92 + FrameIndex AUTS S 0 93 + FrameIndex AUTS T 0 94 + FrameIndex AUTS U 0 95 + FrameIndex AUTS V 0 96 + FrameIndex AUTS W 0 97 + FrameIndex AUTS X 0 98 + FrameIndex AUTS Y 0 99 + FrameIndex AUTS Z 0 100 + FrameIndex AUS2 A 0 101 + FrameIndex AUS2 B 0 102 + FrameIndex AUS2 C 0 103 + FrameIndex AUS2 D 0 104 +} \ No newline at end of file diff --git a/models/AutoMagSpentClip_a.3d b/models/AutoMagSpentClip_a.3d new file mode 100644 index 0000000..c4486a0 Binary files /dev/null and b/models/AutoMagSpentClip_a.3d differ diff --git a/models/AutoMagSpentClip_d.3d b/models/AutoMagSpentClip_d.3d new file mode 100644 index 0000000..020a4a9 Binary files /dev/null and b/models/AutoMagSpentClip_d.3d differ diff --git a/models/OLSMP.png b/models/OLSMP.png new file mode 100644 index 0000000..3240443 Binary files /dev/null and b/models/OLSMP.png differ diff --git a/models/OLSMPAmmo_a.3d b/models/OLSMPAmmo_a.3d new file mode 100644 index 0000000..bc63077 Binary files /dev/null and b/models/OLSMPAmmo_a.3d differ diff --git a/models/OLSMPAmmo_d.3d b/models/OLSMPAmmo_d.3d new file mode 100644 index 0000000..05d1d30 Binary files /dev/null and b/models/OLSMPAmmo_d.3d differ diff --git a/models/OLSMPPick_a.3d b/models/OLSMPPick_a.3d new file mode 100644 index 0000000..8dbcc7b Binary files /dev/null and b/models/OLSMPPick_a.3d differ diff --git a/models/OLSMPPick_d.3d b/models/OLSMPPick_d.3d new file mode 100644 index 0000000..ce09ab4 Binary files /dev/null and b/models/OLSMPPick_d.3d differ diff --git a/models/OLSMPR_a.3d b/models/OLSMPR_a.3d new file mode 100644 index 0000000..37e3cfc Binary files /dev/null and b/models/OLSMPR_a.3d differ diff --git a/models/OLSMPR_d.3d b/models/OLSMPR_d.3d new file mode 100644 index 0000000..5bd81d9 Binary files /dev/null and b/models/OLSMPR_d.3d differ diff --git a/models/OLSMPSpentClip_a.3d b/models/OLSMPSpentClip_a.3d new file mode 100644 index 0000000..ac7549c Binary files /dev/null and b/models/OLSMPSpentClip_a.3d differ diff --git a/models/OLSMPSpentClip_d.3d b/models/OLSMPSpentClip_d.3d new file mode 100644 index 0000000..2a4147f Binary files /dev/null and b/models/OLSMPSpentClip_d.3d differ diff --git a/models/OLSMP_.png b/models/OLSMP_.png new file mode 100644 index 0000000..3240443 Binary files /dev/null and b/models/OLSMP_.png differ diff --git a/models/OLSMP_env.png b/models/OLSMP_env.png new file mode 100644 index 0000000..459464c Binary files /dev/null and b/models/OLSMP_env.png differ diff --git a/models/OLSMP_m.png b/models/OLSMP_m.png new file mode 100644 index 0000000..5ab6bcc Binary files /dev/null and b/models/OLSMP_m.png differ diff --git a/shaders/glsl/MeshEnviroMapMasked.fp b/shaders/glsl/MeshEnviroMapMasked.fp new file mode 100644 index 0000000..c77c27f --- /dev/null +++ b/shaders/glsl/MeshEnviroMapMasked.fp @@ -0,0 +1,9 @@ +// imitation of the Unreal Engine 1.x bMeshEnviroMap effect, not 1:1 but gets close +vec4 ProcessTexel() +{ + vec4 base = getTexel(vTexCoord.st); + float mask = texture(masktex,vTexCoord.st).x; + vec3 eyedir = normalize(uCameraPos.xyz-pixelpos.xyz); + vec3 norm = reflect(eyedir,normalize(vWorldNormal.xyz)); + return vec4(base.rgb+texture(envtex,norm.xz*0.5).rgb*mask,base.a); +} diff --git a/shaders/glsl/MeshEnviroMapMasked_AmbientGlow.fp b/shaders/glsl/MeshEnviroMapMasked_AmbientGlow.fp new file mode 100644 index 0000000..c92719f --- /dev/null +++ b/shaders/glsl/MeshEnviroMapMasked_AmbientGlow.fp @@ -0,0 +1,17 @@ +// imitation of the Unreal Engine 1.x ambient glow effect, timing may be off +#define PI 3.14159265 +vec4 ProcessLight( vec4 color ) +{ + float glow = (1.0+sin(timer*2*PI))*0.25; + return vec4(min(color.rgb+vec3(glow),1.0),color.a); +} + +// imitation of the Unreal Engine 1.x bMeshEnviroMap effect, not 1:1 but gets close +vec4 ProcessTexel() +{ + vec4 base = getTexel(vTexCoord.st); + float mask = texture(masktex,vTexCoord.st).x; + vec3 eyedir = normalize(uCameraPos.xyz-pixelpos.xyz); + vec3 norm = reflect(eyedir,normalize(vWorldNormal.xyz)); + return vec4(base.rgb+texture(envtex,norm.xz*0.5).rgb*mask,base.a); +} diff --git a/zscript.txt b/zscript.txt index f016170..4273e7f 100644 --- a/zscript.txt +++ b/zscript.txt @@ -29,3 +29,4 @@ version "4.3" #include "zscript/unrealhud.zsc" #include "zscript/unrealmenus.zsc" #include "zscript/dtspawners.zsc" +#include "zscript/olsmp.zsc" diff --git a/zscript/miscitems.zsc b/zscript/miscitems.zsc index 5223417..7d5775a 100644 --- a/zscript/miscitems.zsc +++ b/zscript/miscitems.zsc @@ -708,6 +708,13 @@ Class BetaFlare : UnrealInventory if ( !sting_flares ) return false; // not allowed return Super.TryPickup(toucher); } + override void Tick() + { + Super.Tick(); + if ( sting_flares ) return; + if ( Owner ) Owner.RemoveInventory(self); + Destroy(); + } Default { Inventory.MaxAmount 1; diff --git a/zscript/olsmp.zsc b/zscript/olsmp.zsc new file mode 100644 index 0000000..b11fa59 --- /dev/null +++ b/zscript/olsmp.zsc @@ -0,0 +1,393 @@ +/* + usaar33 is a wiener + + now watch as I turn this trash fire into a better weapon +*/ +Class OLSMPAmmo : Ammo +{ + override bool TryPickup( in out Actor toucher ) + { + if ( !sting_olsmp ) return false; // not allowed + return Super.TryPickup(toucher); + } + override void Tick() + { + Super.Tick(); + if ( sting_olsmp ) return; + if ( !Owner ) + { + let r = Spawn("CellPack",pos,ALLOW_REPLACE); + r.spawnangle = spawnangle; + r.spawnpoint = spawnpoint; + r.angle = angle; + r.pitch = pitch; + r.roll = roll; + r.special = special; + r.args[0] = args[0]; + r.args[1] = args[1]; + r.args[2] = args[2]; + r.args[3] = args[3]; + r.args[4] = args[4]; + r.ChangeTid(tid); + r.SpawnFlags = SpawnFlags&~MTF_SECRET; + r.HandleSpawnFlags(); + r.SpawnFlags = SpawnFlags; + r.bCountSecret = SpawnFlags&MTF_SECRET; + r.vel = vel; + r.master = master; + r.target = target; + r.tracer = tracer; + r.bDropped = bDropped; + Destroy(); + } + else + { + Owner.RemoveInventory(self); + Destroy(); + } + } + Default + { + Tag "$T_OLSMPAMMO"; + Inventory.Icon "I_OLSMP"; + Inventory.PickupMessage "$I_OLSMPAMMO"; + Inventory.Amount 100; + Inventory.MaxAmount 300; + Ammo.BackpackAmount 0; + Ammo.BackpackMaxAmount 900; + Ammo.DropAmount 100; + } + States + { + Spawn: + UCLP A -1; + Stop; + } +} + +Class OLSMP : UnrealWeapon +{ + int ClipCount; + double AltAccuracy; + + property ClipCount : ClipCount; + + override void PlayUpSound( Actor origin ) + { + origin.A_PlaySound(upsound,CHAN_WEAPON,Dampener.Active(origin)?.1:1.,pitch:0.8); + } + override bool TryPickup( in out Actor toucher ) + { + if ( !sting_olsmp ) return false; // not allowed + return Super.TryPickup(toucher); + } + override void Tick() + { + Super.Tick(); + if ( sting_olsmp ) return; + if ( !Owner ) + { + let r = Spawn("BFG9000",pos,ALLOW_REPLACE); + r.spawnangle = spawnangle; + r.spawnpoint = spawnpoint; + r.angle = angle; + r.pitch = pitch; + r.roll = roll; + r.special = special; + r.args[0] = args[0]; + r.args[1] = args[1]; + r.args[2] = args[2]; + r.args[3] = args[3]; + r.args[4] = args[4]; + r.ChangeTid(tid); + r.SpawnFlags = SpawnFlags&~MTF_SECRET; + r.HandleSpawnFlags(); + r.SpawnFlags = SpawnFlags; + r.bCountSecret = SpawnFlags&MTF_SECRET; + r.vel = vel; + r.master = master; + r.target = target; + r.tracer = tracer; + r.bDropped = bDropped; + Destroy(); + } + else + { + Owner.RemoveInventory(self); + Destroy(); + } + } + action void A_OLSMPRefire( statelabel flash = null, bool slave = false ) + { + Weapon weap = Weapon(invoker); + if ( !weap || !player ) return; + if ( invoker.altaccuracy < 0.2 ) invoker.altaccuracy += 0.01; + if ( invoker.clipcount < 35 ) A_PlaySound("automag/click",CHAN_ITEM,!Dampener.Active(self)?1.:.35,pitch:1.6); + if ( (invoker.clipcount <= 0) || (weap.Ammo1.Amount <= 0) ) + { + A_ClearRefire(); + return; + } + A_Refire(flash); + } + action void A_OLSMPFire( bool alt = false ) + { + Weapon weap = Weapon(invoker); + if ( !weap ) return; + if ( weap.Ammo1.Amount <= 0 ) return; + if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return; + invoker.clipcount--; + invoker.FireEffect(); + UTMainHandler.DoFlash(self,Color(32,255,128,0),1); + A_PlaySound("automag/fire",CHAN_WEAPON,!Dampener.Active(self)?1.:.2,pitch:FRandom[Automag](1.2,1.8)*(alt?2.5:1.)); + if ( !Dampener.Active(self) ) A_AlertMonsters(); + A_QuakeEx(1,1,1,8,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.15); + A_Overlay(-2,"MuzzleFlash"); + A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true); + A_OverlayRenderstyle(-2,STYLE_Add); + UTMainHandler.DoSwing(self,(FRandom[Automag](-2.,-5.)*invoker.altaccuracy,FRandom[Automag](-3.,2.)*invoker.altaccuracy),3,1,2,SWING_Spring,1,2); + Vector3 x, y, z, x2, y2, z2; + [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); + if ( alt ) + { + vel -= x*(player.onground?2.:0.8); + vel.z += (player.onground?.3:.08); + } + else + { + vel -= x*(player.onground?4.:1.5); + vel.z += (player.onground?.5:.15); + } + Vector3 origin = Vec2OffsetZ(0,0,player.viewz)+10.0*x; + origin = origin-z*1.0+y*4.0; + double a = FRandom[Automag](0,360), s = FRandom[Automag](0,alt?(0.05+invoker.altaccuracy):0.05); + [x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll); + Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit(); + FLineTraceData d; + LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); + if ( d.HitType == TRACE_HitActor ) + { + int dmg = 17; + dmg = d.HitActor.DamageMobj(invoker,self,dmg,'shot',DMG_USEANGLE|DMG_THRUSTLESS,atan2(d.HitDir.y,d.HitDir.x)); + double mm = 3000; + if ( FRandom[Automag](0,1) < 0.2 ) mm *= 5; + UTMainHandler.DoKnockback(d.HitActor,d.HitDir,mm); + if ( d.HitActor.bNOBLOOD ) + { + let p = Spawn("BulletImpact",d.HitLocation); + p.angle = atan2(d.HitDir.y,d.HitDir.x)+180; + p.pitch = asin(d.HitDir.z); + } + else + { + d.HitActor.TraceBleed(dmg,self); + d.HitActor.SpawnBlood(d.HitLocation,atan2(d.HitDir.y,d.HitDir.x)+180,dmg); + } + } + else if ( d.HitType != TRACE_HitNone ) + { + Vector3 hitnormal = -d.HitDir; + if ( d.HitType == TRACE_HitFloor ) hitnormal = d.HitSector.floorplane.Normal; + else if ( d.HitType == TRACE_HitCeiling ) hitnormal = d.HitSector.ceilingplane.Normal; + else if ( d.HitType == TRACE_HitWall ) + { + hitnormal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit(); + if ( !d.LineSide ) hitnormal *= -1; + } + let p = Spawn("BulletImpact",d.HitLocation+hitnormal*0.01); + p.angle = atan2(hitnormal.y,hitnormal.x); + p.pitch = asin(-hitnormal.z); + if ( d.HitLine ) d.HitLine.RemoteActivate(self,d.LineSide,SPAC_Impact,d.HitLocation); + } + for ( int i=0; i<3; i++ ) + { + let s = Spawn("UTViewSmoke",origin); + UTViewSmoke(s).ofs = (10,4,-1); + s.target = self; + s.alpha *= 0.5; + } + origin += x*8.0+y*6.0-z*2.0; + let c = Spawn("UCasing",origin); + c.vel = x*FRandom[Junk](-1.5,1.5)+y*FRandom[Junk](2,4)+z*FRandom[Junk](2,3); + } + Default + { + Tag "$T_OLSMP"; + Inventory.PickupMessage "$I_OLSMP"; + Weapon.UpSound "automag/select"; + Weapon.SlotNumber 0; + Weapon.SelectionOrder 9; + Weapon.AmmoType "OLSMPAmmo"; + Weapon.AmmoUse 1; + Weapon.AmmoType2 "OLSMPAmmo"; + Weapon.AmmoUse2 1; + Weapon.AmmoGive 100; + Weapon.Kickback 320; + UTWeapon.DropAmmo 50; + OLSMP.ClipCount 100; + } + States + { + Spawn: + AUTP A -1; + Stop; + AUTP B -1; + Stop; + Select: + AUTS A 1 A_Raise(int.max); + Ready: + AUTS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_WeaponReady(WRF_NOFIRE); + AUS2 ABCD 1 A_WeaponReady(WRF_NOFIRE); + Idle: + AUTI A 0 A_Overlay(-9999,"Dummy"); + AUTI AB 30; + AUTI A 0 A_Jump(50,"Twiddle"); + Goto Idle+1; + Twiddle: + AUTT ABCDEFGHIJKLMNOPQRSTUVWXY 2; + Goto Idle+1; + Dummy: + TNT1 A 1 + { + if ( (invoker.clipcount <= 0) && (invoker.Ammo1.Amount > 0) ) A_Overlay(PSP_WEAPON,"Reload"); + else if ( invoker.clipcount < min(invoker.default.clipcount,invoker.Ammo1.Amount) ) A_WeaponReady(WRF_ALLOWRELOAD); + else A_WeaponReady(); + } + Wait; + Fire: + AUTF A 1 A_Overlay(-9999,null); + AUTF BCD 1; + Hold: + AUTF E 1 A_OLSMPFire(); + AUTF F 1; + AUTF G 0 A_OLSMPRefire(1); + Goto Release1; + AUTF G 1; + AUTF H 1 A_OLSMPFire(); + AUTF I 1; + AUTF J 0 A_OLSMPRefire(1); + Goto Release2; + AUTF J 1; + AUTF K 1 A_OLSMPFire(); + AUTF L 1; + AUTF M 0 A_OLSMPRefire(1); + Goto Release3; + AUTF M 1; + Goto Hold; + Release1: + AUTF G 1; + Goto Release; + Release2: + AUTF J 1; + Goto Release; + Release3: + AUTF M 1; + Goto Release; + Release: + AUTF NOPQRST 1; + AUTI A 0; + Goto Idle; + AltFire: + AUTF A 1 A_Overlay(-9999,null); + AUTF BCD 1; + AltHold: + AUTF E 1 A_OLSMPFire(true); + AUTF H 0 A_OLSMPRefire(1); + Goto AltRelease1; + AUTF H 1 A_OLSMPFire(true); + AUTF K 0 A_OLSMPRefire(1); + Goto AltRelease2; + AUTF K 1 A_OLSMPFire(true); + AUTF E 0 A_OLSMPRefire("AltHold"); + Goto AltRelease3; + AltRelease1: + AUTF FG 1; + Goto Release; + AltRelease2: + AUTF IJ 1; + Goto Release; + AltRelease3: + AUTF LM 1; + Goto Release; + Reload: + AUTR A 0 A_JumpIf(invoker.clipcount>=min(invoker.default.clipcount,invoker.Ammo1.Amount),"Idle"); + AUTR A 0 + { + invoker.clipcount = Min(invoker.default.clipcount,invoker.Ammo1.Amount); + A_Overlay(-9999,null); + A_WeaponOffset(0,32); // fix sudden psprite lowering + A_PlaySound("automag/click",CHAN_WEAPON,!Dampener.Active(self)?1.:.1,pitch:0.8); + } + AUTR ABCDEFGHIJKLMNOPQRSTUVWXY 1; + AUTD ABCD 1; + AUTD E 30 + { + A_PlaySound("automag/reload",CHAN_WEAPON,!Dampener.Active(self)?1.:.1,pitch:0.8); + if ( self is 'UTPlayer' ) + UTPlayer(self).PlayReloading(); + } + AUTS A 0 A_PlaySound("automag/select",CHAN_WEAPON,!Dampener.Active(self)?1.:.1,pitch:0.8); + Goto Ready; + Deselect: + AUTD A 1 A_Overlay(-9999,null); + AUTD BCD 1; + AUTD E 1 A_Lower(int.max); + Wait; + MuzzleFlash: + TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8,9); + AMUZ A 2 Bright + { + let l = Spawn("EnforcerLight",pos); + l.target = self; + } + Stop; + AMUZ B 2 Bright + { + let l = Spawn("EnforcerLight",pos); + l.target = self; + } + Stop; + AMUZ C 2 Bright + { + let l = Spawn("EnforcerLight",pos); + l.target = self; + } + Stop; + AMUZ D 2 Bright + { + let l = Spawn("EnforcerLight",pos); + l.target = self; + } + Stop; + AMUZ E 2 Bright + { + let l = Spawn("EnforcerLight",pos); + l.target = self; + } + Stop; + AMUZ F 2 Bright + { + let l = Spawn("EnforcerLight",pos); + l.target = self; + } + Stop; + AMUZ G 2 Bright + { + let l = Spawn("EnforcerLight",pos); + l.target = self; + } + Stop; + AMUZ H 2 Bright + { + let l = Spawn("EnforcerLight",pos); + l.target = self; + } + Stop; + AMUZ I 2 Bright + { + let l = Spawn("EnforcerLight",pos); + l.target = self; + } + Stop; + } +} diff --git a/zscript/unrealcommon.zsc b/zscript/unrealcommon.zsc index a9cf00b..7b3cc28 100644 --- a/zscript/unrealcommon.zsc +++ b/zscript/unrealcommon.zsc @@ -793,7 +793,8 @@ Class UnrealMainHandler : EventHandler } else if ( (e.Replacee == 'BFG9000') || (e.Replacee == 'Mace') ) { - if ( Random[Replacements](0,1) ) e.Replacement = 'SMiniGun'; + if ( sting_olsmp && Random[Replacements](0,1) ) e.Replacement = 'OLSMP'; + else if ( Random[Replacements](0,1) ) e.Replacement = 'SMiniGun'; else e.Replacement = 'BigGun'; } else if ( (e.Replacee == 'Clip') || (e.Replacee == 'GoldWandAmmo') || (e.Replacee == 'GoldWandHefty') ) e.Replacement = 'UClip'; @@ -890,6 +891,7 @@ Class UnrealMainHandler : EventHandler else e.Replacement = 'BigAmmo2'; } else if ( !Random[Replacements](0,3) ) e.Replacement = 'ImpalerAmmo'; + else if ( sting_olsmp && !Random[Replacements](0,2) ) e.Replacement = 'OLSMPAmmo'; else if ( Random[Replacements](0,1) ) e.Replacement = 'UBioAmmo'; else e.Replacement = 'URifleAmmo'; } @@ -1004,15 +1006,7 @@ Class UnrealMainHandler : EventHandler } override void PlayerRespawned( PlayerEvent e ) { - if ( flak_translocator ) - players[e.playernumber].mo.TakeInventory("Translocator",1); - if ( sting_telegun ) - players[e.playernumber].mo.GiveInventory("UTranslocator",1); - if ( sting_flares ) - { - players[e.playernumber].mo.GiveInventory("LightFlare",1); - players[e.playernumber].mo.GiveInventory("DarkFlare",1); - } + PlayerEntered(e); } override void NetworkProcess( ConsoleEvent e ) { @@ -1032,13 +1026,6 @@ Class UnrealMainHandler : EventHandler players[i].mo.GiveInventory("UTranslocator",1); } } - else - { - for ( int i=0; i OldAmmoType[18]; + String OldAmmo[19]; + Class OldAmmoType[19]; String OldArmor[6]; Class OldArmorType[6]; String OldKeys[7]; @@ -106,6 +106,7 @@ Class UnrealHUD : BaseStatusBar OldAmmo[15] = "Big083"; OldAmmo[16] = "Smini083"; OldAmmo[17] = "Peace083"; + OldAmmo[18] = "OLSMP083"; OldAmmoType[0] = "DefaultAmmo"; OldAmmoType[1] = "UMiniAmmo"; OldAmmoType[2] = "StingerAmmo"; @@ -124,6 +125,7 @@ Class UnrealHUD : BaseStatusBar OldAmmoType[15] = "BigAmmo"; OldAmmoType[16] = "SMiniAmmo"; OldAmmoType[17] = "PeaceAmmo"; + OldAmmoType[18] = "OLSMPAmmo"; OldArmor[0] = "Armor083"; OldArmor[1] = "Kev083"; OldArmor[2] = "Asb083"; @@ -646,7 +648,7 @@ Class UnrealHUD : BaseStatusBar if ( Ammo1 ) { if ( Ammo1.Amount ) DrawString(mOldDigits,FormatNumber(Ammo1.Amount,3),(549,366),DI_TEXT_ALIGN_RIGHT); - for ( int i=0; i<18; i++ ) + for ( int i=0; i<19; i++ ) { // match by ammo if ( (OldAmmoType[i] is 'Ammo') && !(Ammo1 is OldAmmoType[i]) ) continue; diff --git a/zscript/utranslocator.zsc b/zscript/utranslocator.zsc index 68fa73a..b4c83f1 100644 --- a/zscript/utranslocator.zsc +++ b/zscript/utranslocator.zsc @@ -9,6 +9,13 @@ Class UTranslocatorAmmo : Ammo Ammo.BackpackMaxAmount 2; +INVENTORY.IGNORESKILL; } + override void Tick() + { + Super.Tick(); + if ( sting_telegun ) return; + if ( Owner ) Owner.RemoveInventory(self); + Destroy(); + } } Class UTranslocator : UnrealWeapon @@ -18,6 +25,13 @@ Class UTranslocator : UnrealWeapon if ( !sting_telegun ) return false; // not allowed return Super.TryPickup(toucher); } + override void Tick() + { + Super.Tick(); + if ( sting_telegun ) return; + if ( Owner ) Owner.RemoveInventory(self); + Destroy(); + } Default { Tag "$T_TELEGUN";