From 80d3f5d278a99abcfc2ab9b991a6bcf386a976b8 Mon Sep 17 00:00:00 2001 From: ketmar Date: Tue, 15 Jun 2021 09:18:38 +0000 Subject: [PATCH] added full shard reloading and low ammo sound to crylance FossilOrigin-Name: 8d51371bb8fd7d5881d09455a08a5bf3ea0649c1a7f6f4c2345c8a6e904d6775 --- decorate/Weapons/Crylance.txt | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/decorate/Weapons/Crylance.txt b/decorate/Weapons/Crylance.txt index 5a5ec81..a029a38 100644 --- a/decorate/Weapons/Crylance.txt +++ b/decorate/Weapons/Crylance.txt @@ -87,6 +87,11 @@ ACTOR Crylance : Weapon replaces BFG9000 { Weapon.AmmoUse2 0 Weapon.SlotNumber 7 + var int user_lowPauseCount; + // temps + var int user_LoadCount; + var int user_ClipCount; + States { Spawn: WCRY B -1 @@ -123,13 +128,30 @@ ACTOR Crylance : Weapon replaces BFG9000 { Goto ReadyIdle ReadyIdle: + TNT1 A 0 + { + // low ammo sound + if (CountInv("CrylanceLoaded") < 8) { + user_lowPauseCount -= 1; + if (user_lowPauseCount < 1) { + if (GetCVarB("k8ZanMod_WarnLowAmmo")) { + A_PlaySound("weapons/zanweapon/lowammo", CHAN_VOICE, 1.0); + } + if (CountInv("CrylanceLoaded") > 5) user_lowPauseCount = 40/8; + else if (CountInv("CrylanceLoaded") > 3) user_lowPauseCount = 30/8; + else if (CountInv("CrylanceLoaded") > 0) user_lowPauseCount = 20/8; + else user_lowPauseCount = 10; // no need to divide here + } + } + } TNT1 A 0 A_JumpIf(CountInv("CrylanceLoaded")==0, "ReadyEmptyGun") WCLR A 8 A_WeaponReady(WRF_ALLOWRELOAD) Loop ReadyEmptyGun: WCLR B 1 A_WeaponReady(WRF_ALLOWRELOAD) - Loop + //Loop + Goto ReadyIdle // for sounds Fire: TNT1 A 0 A_JumpIfNoAmmo("Reload") @@ -237,9 +259,10 @@ ACTOR Crylance : Weapon replaces BFG9000 { WCLL G 3 WCLL H 3 WCLR A 3 - Goto ReloadLoop + //Goto ReloadLoop ReloadLoop: + /* TNT1 A 0 { A_TakeInventory("DepletedShard", 1); @@ -248,6 +271,22 @@ ACTOR Crylance : Weapon replaces BFG9000 { TNT1 A 0 A_JumpIfInventory("CrylanceLoaded", 25, "ReloadFinish") TNT1 A 0 A_JumpIfInventory("DepletedShard", 1, "ReloadLoop") Goto ReloadFinish + */ + TNT1 A 0 + { + // if reload in not cheating, drop unused ammo + if (!GetCVar("k8ZanMod_CheatReload")) { + A_TakeInventory("CrylanceLoaded", 666); + } + user_ClipCount = CountInv("DepletedShard"); + user_LoadCount = 25-CountInv("CrylanceLoaded"); + if (user_LoadCount > 0) { + if (user_LoadCount > user_ClipCount) user_LoadCount = user_ClipCount; + A_TakeInventory("DepletedShard", user_LoadCount); + A_GiveInventory("CrylanceLoaded", user_LoadCount); + } + user_lowPauseCount = 0; + } ReloadFinish: TNT1 A 0 -- 2.11.4.GIT