From b9478d3fef9f67cd265127772910d46554864910 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Mon, 7 Oct 2019 17:30:57 +0200 Subject: [PATCH] Release Candidate 1: - Adjusted ammo giving behaviour for weapons with clip count. - Fixed dual naming of automag/betamag. --- zscript/automag.zsc | 21 ++++++++++++++++----- zscript/betamag.zsc | 6 ++++-- zscript/biggun.zsc | 1 + zscript/olsmp.zsc | 1 + zscript/unrealcommon.zsc | 21 +++++++++++++++++++++ 5 files changed, 43 insertions(+), 7 deletions(-) diff --git a/zscript/automag.zsc b/zscript/automag.zsc index 64fe301..a82dd16 100644 --- a/zscript/automag.zsc +++ b/zscript/automag.zsc @@ -37,12 +37,21 @@ Class Automag : UnrealWeapon } override bool HandlePickup( Inventory item ) { - if ( sting_automags && (item.GetClass() == GetClass()) ) + if ( item.GetClass() == GetClass()) { - SetTag(StringTable.Localize("$T_AUTOMAG2")); - return Super.HandlePickup(item); + if ( MaxAmount > 1 ) + { + if ( Amount == 1 ) Weapon(item).AmmoGive1 = Weapon(item).AmmoGive2 = 0; + if ( Weapon(item).PickupForAmmo(self) ) item.bPickupGood = true; + let rslt = Inventory.HandlePickup(item); + if ( rslt ) SetTag(StringTable.Localize("$T_AUTOMAG2")); + return rslt; + } + else if ( Weapon(item).PickupForAmmo(self) ) + item.bPickupGood = true; + return true; } - return Super.HandlePickup(item); + return false; } override String PickupMessage() { @@ -287,6 +296,7 @@ Class Automag : UnrealWeapon } } Amount = 1; + SetTag(StringTable.Localize("$T_AUTOMAG")); } override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount ) { @@ -308,11 +318,12 @@ Class Automag : UnrealWeapon Weapon.AmmoUse 1; Weapon.AmmoType2 "UMiniAmmo"; Weapon.AmmoUse2 1; - Weapon.AmmoGive 30; + Weapon.AmmoGive 20; Weapon.Kickback 180; UTWeapon.DropAmmo 10; Automag.ClipCount 20; Automag.SlaveClipCount 20; + +UNREALWEAPON.NOFIRSTGIVE; } States { diff --git a/zscript/betamag.zsc b/zscript/betamag.zsc index f881a90..d23d56e 100644 --- a/zscript/betamag.zsc +++ b/zscript/betamag.zsc @@ -15,8 +15,9 @@ Class Betamag : UnrealWeapon { if ( sting_protomags && (item.GetClass() == GetClass()) ) { - SetTag(StringTable.Localize("$T_PROTOMAG2")); - return Super.HandlePickup(item); + let rslt = Super.HandlePickup(item); + if ( rslt ) SetTag(StringTable.Localize("$T_PROTOMAG2")); + return rslt; } return Super.HandlePickup(item); } @@ -289,6 +290,7 @@ Class Betamag : UnrealWeapon } } Amount = 1; + SetTag(StringTable.Localize("$T_AUTOMAG")); } Default { diff --git a/zscript/biggun.zsc b/zscript/biggun.zsc index 379e126..f74ca5d 100644 --- a/zscript/biggun.zsc +++ b/zscript/biggun.zsc @@ -406,6 +406,7 @@ Class BigGun : UnrealWeapon UTWeapon.DropAmmo 4; BigGun.ClipCount 4; +EXTREMEDEATH; + +UNREALWEAPON.NOFIRSTGIVE; } States { diff --git a/zscript/olsmp.zsc b/zscript/olsmp.zsc index fe1572f..506a64b 100644 --- a/zscript/olsmp.zsc +++ b/zscript/olsmp.zsc @@ -235,6 +235,7 @@ Class OLSMP : UnrealWeapon Weapon.Kickback 320; UTWeapon.DropAmmo 50; OLSMP.ClipCount 100; + +UNREALWEAPON.NOFIRSTGIVE; } States { diff --git a/zscript/unrealcommon.zsc b/zscript/unrealcommon.zsc index f9b4099..d91c06e 100644 --- a/zscript/unrealcommon.zsc +++ b/zscript/unrealcommon.zsc @@ -184,12 +184,14 @@ Class UPlayer : UTPlayer // force akimbo let t = FindInventory(type); if ( t ) t.Amount = 2; + t.SetTag(StringTable.Localize("$T_AUTOMAG2")); } else if ( (type is 'Betamag') && sting_protomags ) { // force akimbo let t = FindInventory(type); if ( t ) t.Amount = 2; + t.SetTag(StringTable.Localize("$T_PROTOMAG2")); } else if ( type is 'DispersionPistol' ) { @@ -801,6 +803,25 @@ Class UTeleParticle : UTMeshParticle Class UnrealWeapon : UTWeapon { + private int UWeaponFlags; + + FlagDef NoFirstGive : UWeaponFlags, 0; // don't give ammo on first pickup (for weapons with a clip count) + + override void AttachToOwner (Actor other) + { + Inventory.AttachToOwner(other); + Ammo1 = AddAmmo(Owner,AmmoType1,bNoFirstGive?0:AmmoGive1); + Ammo2 = AddAmmo(Owner,AmmoType2,bNoFirstGive?0:AmmoGive2); + SisterWeapon = AddWeapon(SisterWeaponType); + if ( Owner.player ) + { + if ( !Owner.player.GetNeverSwitch() && !bNo_Auto_Switch ) + Owner.player.PendingWeapon = self; + if ( Owner.player.mo == players[consoleplayer].camera ) + StatusBar.ReceivedWeapon(self); + } + GivenAsMorphWeapon = false; + } override void FireEffect() { Super.FireEffect();