diff --git a/language.version b/language.version index 9375cba9e..d19f3bbd8 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1086 \cu(Tue 16 Jan 00:18:15 CET 2024)\c-"; -SWWM_SHORTVER="\cw1.3pre r1086 \cu(2024-01-16 00:18:15)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1087 \cu(Tue 16 Jan 10:17:28 CET 2024)\c-"; +SWWM_SHORTVER="\cw1.3pre r1087 \cu(2024-01-16 10:17:28)\c-"; diff --git a/zscript/handler/swwm_handler_cheats.zsc b/zscript/handler/swwm_handler_cheats.zsc index 9aac7f669..748ecfc4e 100644 --- a/zscript/handler/swwm_handler_cheats.zsc +++ b/zscript/handler/swwm_handler_cheats.zsc @@ -20,9 +20,9 @@ extend Class SWWMHandler Console.Printf("\cyLOADSAMONEY!\c-"); S_StartSound("menu/buyinv",CHAN_ITEM,CHANF_UI); S_StartSound("misc/emone",CHAN_VOICE,CHANF_UI); + SWWMScoreObj.SpawnAtActorFromHandler(self,999999999,players[e.Args[0]].mo); } SWWMCredits.Give(players[e.Args[0]],999999999); - SWWMScoreObj.SpawnFromHandler(self,999999999,players[e.Args[0]].mo.Vec3Offset(0,0,players[e.Args[0]].mo.Height/2)); } else if ( e.Name ~== "swwmlorecheat" ) { diff --git a/zscript/handler/swwm_handler_damage.zsc b/zscript/handler/swwm_handler_damage.zsc index 068789b8b..d844020d5 100644 --- a/zscript/handler/swwm_handler_damage.zsc +++ b/zscript/handler/swwm_handler_damage.zsc @@ -57,7 +57,7 @@ extend Class SWWMHandler // damage numbers, combat tracking, etc. private void DoDamageHandling( WorldEvent e ) { - SWWMDamNum.SpawnFromHandler(self,e.Damage,level.Vec3Offset(e.Thing.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,e.Thing.Height/2)),e.DamageType); + SWWMDamNum.SpawnAtActorFromHandler(self,e.Damage,e.Thing,e.DamageType); // combat tracker updates if either an ally of the player is hit, or an ally hit this enemy // (this automatically also does the same for the player itself, of course) for ( int i=0; i 0) ) { Amount += default.Amount; + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(default.Amount,Owner,Font.CR_GREEN); Owner.TakeInventory(parent,1); // absorb the extra damage too saved = HandleDamage(damage,damageType,flags); @@ -168,6 +170,8 @@ Class SWWMSpareArmor : Inventory abstract } Owner.GiveInventory(giveme,GetDefaultByType(giveme).Amount); SWWMHandler.ArmorFlash(Owner.PlayerNumber()); + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(GetDefaultByType(giveme).Amount,Owner,Font.CR_GREEN); return true; } return false; diff --git a/zscript/items/swwm_basehealth.zsc b/zscript/items/swwm_basehealth.zsc index dcbf31435..50f1d901c 100644 --- a/zscript/items/swwm_basehealth.zsc +++ b/zscript/items/swwm_basehealth.zsc @@ -93,6 +93,8 @@ Class SWWMHealth : Inventory abstract } SWWMHandler.HealthFlash(Owner.PlayerNumber()); Owner.GiveInventory(giveme,GetDefaultByType(giveme).Amount); + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(GetDefaultByType(giveme).Amount,Owner,Font.CR_BLUE); AutoUseExtra(false); return true; } @@ -141,6 +143,8 @@ Class SWWMHealth : Inventory abstract while ( (Amount > 0) && (newdamage > 0) ) { newdamage = newdamage-GetDefaultByType(giveme).Amount; + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(GetDefaultByType(giveme).Amount,Owner,Font.CR_BLUE); if ( newdamage < 0 ) Owner.GiveBody(-newdamage,GetDefaultByType(giveme).MaxAmount); newdamage = max(0,newdamage); if ( !morethanonce ) SWWMHandler.HealthFlash(Owner.PlayerNumber()); diff --git a/zscript/items/swwm_baseitem.zsc b/zscript/items/swwm_baseitem.zsc index d4a3e9923..146ae8f89 100644 --- a/zscript/items/swwm_baseitem.zsc +++ b/zscript/items/swwm_baseitem.zsc @@ -15,14 +15,18 @@ Mixin Class SWWMAutoUseFix // sell excess if there's a price if ( !deathmatch && bALWAYSPICKUP && (Amount+item.Amount > MaxAmount) && (Stamina != 0) ) { - int sellprice = abs(Stamina)/2; - SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2))); - SWWMCredits.Give(Owner.player,sellprice); if ( Owner.player ) { - if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + int sellprice = abs(Stamina)/2; + SWWMCredits.Give(Owner.player,sellprice); + if ( Owner.player == players[consoleplayer] ) + { + SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner); + Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + } else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice); } + item.bPickupGood = true; } } return Super.HandlePickup(item); diff --git a/zscript/items/swwm_collectibles.zsc b/zscript/items/swwm_collectibles.zsc index 5104651e7..320f5a73d 100644 --- a/zscript/items/swwm_collectibles.zsc +++ b/zscript/items/swwm_collectibles.zsc @@ -94,7 +94,7 @@ Class SWWMCollectible : Inventory abstract // give credit if ( other.player && (Stamina > 0) ) { - SWWMScoreObj.Spawn(Stamina,level.Vec3Offset(other.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,other.Height/2))); + if ( other.player == players[consoleplayer] ) SWWMScoreObj.SpawnAtActorBunch(Stamina,other); SWWMCredits.Give(other.player,Stamina); } // send to all other players diff --git a/zscript/items/swwm_health.zsc b/zscript/items/swwm_health.zsc index a3181a558..fcad6103d 100644 --- a/zscript/items/swwm_health.zsc +++ b/zscript/items/swwm_health.zsc @@ -56,6 +56,8 @@ Class RefresherRegen : Powerup if ( !Owner || (Owner.health <= 0) || ((EffectTics-5)%175) ) return; if ( !Owner.GiveBody(int(Strength),500) ) return; SWWMHandler.DoFlash(Owner,Color(32,224,128,255),10); + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(int(Strength),Owner,Font.CR_BLUE); Owner.A_StartSound("powerup/refresher",CHAN_ITEMEXTRA,CHANF_LOCAL|CHANF_OVERLAP,.4); if ( Owner is 'Demolitionist' ) Demolitionist(Owner).lastbump *= 0.99; @@ -70,16 +72,16 @@ Class HealthNuggetItem : SWWMHealth SWWMLoreLibrary.Add(Owner.player,"Nugget"); bool bUsed = Super.Use(pickup); // sell excess - if ( !bUsed ) + if ( !bUsed && Owner.player ) { int sellprice = abs(Stamina)/2; - SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2))); SWWMCredits.Give(Owner.player,sellprice); - if ( Owner.player ) + if ( Owner.player == players[consoleplayer] ) { - if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); - else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice); + SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner); + Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); } + else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice); } return bUsed; } diff --git a/zscript/items/swwm_lamp.zsc b/zscript/items/swwm_lamp.zsc index 9546fee6a..3cc16f15e 100644 --- a/zscript/items/swwm_lamp.zsc +++ b/zscript/items/swwm_lamp.zsc @@ -529,12 +529,15 @@ Class SWWMLamp : Inventory if ( (Charge >= Default.Charge) && (Amount+item.Amount > MaxAmount) ) { // sell excess - int sellprice = abs(Stamina)/2; - SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2))); - SWWMCredits.Give(Owner.player,sellprice); if ( Owner.player ) { - if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + int sellprice = abs(Stamina)/2; + SWWMCredits.Give(Owner.player,sellprice); + if ( Owner.player == players[consoleplayer] ) + { + SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner); + Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + } else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice); } } diff --git a/zscript/items/swwm_powerups.zsc b/zscript/items/swwm_powerups.zsc index 3ded163a6..585518c7e 100644 --- a/zscript/items/swwm_powerups.zsc +++ b/zscript/items/swwm_powerups.zsc @@ -43,17 +43,34 @@ Class GrilledCheeseSandwich : Inventory SWWMHandler.DoFlash(Owner,Color(64,255,255,64),10); Owner.A_QuakeEx(9.,9.,9.,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:1.); Owner.GiveBody(1000,1000); + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(1000,Owner,Font.CR_BLUE); if ( Owner is 'Demolitionist' ) { let n = Owner.FindInventory("ArmorNugget"); if ( !n ) Owner.GiveInventory("ArmorNugget",GetDefaultByType("ArmorNugget").MaxAmount); - else n.Amount = n.MaxAmount; + else + { + n.Amount = n.MaxAmount; + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(n.MaxAmount,Owner,Font.CR_GREEN); + } let b = Owner.FindInventory("BlastSuit"); if ( !b ) Owner.GiveInventory("BlastSuit",GetDefaultByType("BlastSuit").MaxAmount); - else b.Amount = b.MaxAmount; + else + { + b.Amount = b.MaxAmount; + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(b.MaxAmount,Owner,Font.CR_GREEN); + } let w = Owner.FindInventory("WarArmor"); if ( !w ) Owner.GiveInventory("WarArmor",GetDefaultByType("WarArmor").MaxAmount); - else w.Amount = w.MaxAmount; + else + { + w.Amount = w.MaxAmount; + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(w.MaxAmount,Owner,Font.CR_GREEN); + } SWWMLoreLibrary.Add(Owner.player,"Nugget"); SWWMLoreLibrary.Add(Owner.player,"BlastSuit"); SWWMLoreLibrary.Add(Owner.player,"WarArmor"); @@ -1044,8 +1061,12 @@ Class RagekitPower : Powerup SWWMHandler.DoFlash(Owner,Color(16,255,0,0),5); Owner.GiveBody(1,100); Owner.A_AlertMonsters(swwm_uncapalert?0:2000); - if ( (Owner.player == players[consoleplayer]) && (gametic > lastrage) && (swwm_mutevoice < 2) ) - lastrage = SWWMHandler.AddOneliner("ragekit",2,5)+20; + if ( Owner.player == players[consoleplayer] ) + { + SWWMScoreObj.SpawnAtActorBunch(1,Owner,Font.CR_BLUE); + if ( (gametic > lastrage) && (swwm_mutevoice < 2) ) + lastrage = SWWMHandler.AddOneliner("ragekit",2,5)+20; + } Owner.A_QuakeEx(1.5,1.5,1.5,Random[Rage](1,2),0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.5); lastpulse = max(lastpulse,gametic+10); Demolitionist(Owner).lastbump *= .995; @@ -1078,8 +1099,12 @@ Class RagekitPower : Powerup Owner.A_AlertMonsters(swwm_uncapalert?0:5000); SWWMHandler.DoFlash(Owner,Color(64,255,0,0),10); Owner.A_QuakeEx(8.,8.,8.,Random[Rage](3,8),0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:1.); - if ( (Owner.player == players[consoleplayer]) && (gametic > lastrage) && (swwm_mutevoice < 2) ) - lastrage = SWWMHandler.AddOneliner("ragekit",2,5)+40; + if ( Owner.player == players[consoleplayer] ) + { + SWWMScoreObj.SpawnAtActorBunch(5,Owner,Font.CR_BLUE); + if ( (gametic > lastrage) && (swwm_mutevoice < 2) ) + lastrage = SWWMHandler.AddOneliner("ragekit",2,5)+40; + } Owner.A_StartSound("powerup/ragekithit",CHAN_POWERUP,CHANF_OVERLAP); lasteffect = level.maptime; lastpulse = max(lastpulse,gametic+35); @@ -1120,6 +1145,8 @@ Class Ragekit : Inventory if ( pickup && !deathmatch ) return false; if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA); Owner.GiveBody(100,100); + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(100,Owner,Font.CR_BLUE); SWWMUtility.AchievementProgressInc("rage",1,Owner.player); if ( !(Owner is 'Demolitionist') ) { diff --git a/zscript/items/swwm_powerups_vip.zsc b/zscript/items/swwm_powerups_vip.zsc index cf47d4738..ad7d8b293 100644 --- a/zscript/items/swwm_powerups_vip.zsc +++ b/zscript/items/swwm_powerups_vip.zsc @@ -1172,6 +1172,8 @@ Class DivineSpriteEffect : Inventory { healcnt = 0; Owner.GiveBody(1000,1000); + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(1000,Owner,Font.CR_BLUE); SWWMHandler.DoFlash(Owner,Color(40,255,255,255),20); if ( Owner is 'Demolitionist' ) Demolitionist(Owner).lastbump *= 0.97; @@ -1180,6 +1182,8 @@ Class DivineSpriteEffect : Inventory else if ( !(healcnt%5) ) { Owner.GiveBody(500,10000); + if ( Owner.player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(500,Owner,Font.CR_BLUE); Owner.A_StartSound("powerup/divinehit",CHAN_ITEMEXTRA,CHANF_OVERLAP); } } diff --git a/zscript/player/swwm_player.zsc b/zscript/player/swwm_player.zsc index cab1f37e0..f3f683358 100644 --- a/zscript/player/swwm_player.zsc +++ b/zscript/player/swwm_player.zsc @@ -593,7 +593,7 @@ Class Demolitionist : PlayerPawn } else Console.Printf(StringTable.Localize("$SWWM_FINDSECRETREM"),player.GetUserName(),score); SWWMCredits.Give(player,score); - SWWMScoreObj.Spawn(score,Vec3Offset(0,0,Height/2)); + if ( player == players[consoleplayer] ) SWWMScoreObj.SpawnAtActorBunch(score,self); // somehow ongivesecret can be called BEFORE PostBeginPlay (wat) if ( !mystats ) mystats = SWWMStats.Find(player); mystats.secrets++; diff --git a/zscript/player/swwm_player_cheats.zsc b/zscript/player/swwm_player_cheats.zsc index 60ad2fb4b..81799bed9 100644 --- a/zscript/player/swwm_player_cheats.zsc +++ b/zscript/player/swwm_player_cheats.zsc @@ -5,6 +5,8 @@ extend Class Demolitionist void CheatGive_Health( int amount = 0 ) { player.health = health = (amount>0)?(health+amount):default.health; + if ( player == players[consoleplayer] && ((amount > 0) || ((health-default.health) > 0)) ) + SWWMScoreObj.SpawnAtActorBunch((amount>0)?amount:(health-default.health),self,Font.CR_BLUE); } void CheatGive_Backpack() { @@ -60,6 +62,8 @@ extend Class Demolitionist armo.AttachToOwner(self); } armo.Amount = armo.MaxAmount; + if ( player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(armo.MaxAmount,self,Font.CR_GREEN); } } void CheatGive_Keys() @@ -225,6 +229,7 @@ extend Class Demolitionist void CheatTake_Health( int amount = 0 ) { + if ( amount > 0 ) SWWMDamNum.SpawnAtActor(amount,self); if ( amount >= health ) { CheatSuicide(); diff --git a/zscript/player/swwm_player_inventory.zsc b/zscript/player/swwm_player_inventory.zsc index def718fdb..43ecb8114 100644 --- a/zscript/player/swwm_player_inventory.zsc +++ b/zscript/player/swwm_player_inventory.zsc @@ -98,7 +98,7 @@ extend Class Demolitionist if ( player == players[consoleplayer] ) Console.Printf(StringTable.Localize("$SWWM_FINDKEY"),item.GetTag(),score); else Console.Printf(StringTable.Localize("$SWWM_FINDKEYREM"),player.GetUserName(),item.GetTag(),score); SWWMCredits.Give(player,score); - SWWMScoreObj.Spawn(100,player.mo.Vec3Offset(0,0,Height/2)); + if ( player == players[consoleplayer] ) SWWMScoreObj.SpawnAtActorBunch(100,self); if ( !ingivecheat ) { if ( !Random[DemoLines](0,5) && diff --git a/zscript/player/swwm_player_think.zsc b/zscript/player/swwm_player_think.zsc index ea31a4b3d..3631ff6ad 100644 --- a/zscript/player/swwm_player_think.zsc +++ b/zscript/player/swwm_player_think.zsc @@ -316,6 +316,8 @@ extend Class Demolitionist if ( hasrevived ) SWWMUtility.MarkAchievement("sekiro",player); hasrevived = true; player.Resurrect(); + if ( player == players[consoleplayer] ) + SWWMScoreObj.SpawnAtActorBunch(player.health,self,Font.CR_BLUE); player.damagecount = 0; player.bonuscount = 0; player.poisoncount = 0; diff --git a/zscript/utility/swwm_utility_string.zsc b/zscript/utility/swwm_utility_string.zsc index 3225093d7..063ef7f9a 100644 --- a/zscript/utility/swwm_utility_string.zsc +++ b/zscript/utility/swwm_utility_string.zsc @@ -83,7 +83,7 @@ extend Class SWWMUtility return str; } - static void ObscureText( out String str, int seed, bool alnum = false ) + static void ObscureText( out String str, int seed, bool alnum = false, bool minihud = false ) { int len = str.CodePointCount(); String newstr = ""; @@ -96,10 +96,19 @@ extend Class SWWMUtility newstr.AppendCharacter(ch); else if ( alnum ) { + // only uppercase letters and numbers int sd = abs(seed%36); if ( sd >= 10 ) sd += 7; newstr.AppendCharacter(sd+48); } + else if ( minihud ) + { + // exclude forward/backward slashes as they're wider + int sd = abs(seed%93); + if ( sd >= 15 ) sd++; + if ( sd >= 60 ) sd++; + newstr.AppendCharacter(sd+32); + } else newstr.AppendCharacter((abs(seed)%95)+32); } str = newstr; diff --git a/zscript/weapons/swwm_baseweapon.zsc b/zscript/weapons/swwm_baseweapon.zsc index c0ebcacee..0bedd59b2 100644 --- a/zscript/weapons/swwm_baseweapon.zsc +++ b/zscript/weapons/swwm_baseweapon.zsc @@ -336,12 +336,15 @@ Class SWWMWeapon : Weapon abstract if ( !deathmatch && (Amount+item.Amount > MaxAmount) && (item.Stamina != 0) ) { // sell excess - int sellprice = abs(item.Stamina)/2; - SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2))); - SWWMCredits.Give(Owner.player,sellprice); if ( Owner.player ) { - if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + int sellprice = abs(item.Stamina)/2; + SWWMCredits.Give(Owner.player,sellprice); + if ( Owner.player == players[consoleplayer] ) + { + SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner); + Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + } else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice); } item.bPickupGood = true; diff --git a/zscript/weapons/swwm_splode.zsc b/zscript/weapons/swwm_splode.zsc index 4d1e4339c..ca1053e27 100644 --- a/zscript/weapons/swwm_splode.zsc +++ b/zscript/weapons/swwm_splode.zsc @@ -27,12 +27,15 @@ Class ExplodiumGun : SWWMWeapon if ( !deathmatch && (Amount+item.Amount > MaxAmount) && (item.Stamina != 0) ) { // sell excess - int sellprice = abs(item.Stamina)/2; - SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2))); - SWWMCredits.Give(Owner.player,sellprice); if ( Owner.player ) { - if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + int sellprice = abs(item.Stamina)/2; + SWWMCredits.Give(Owner.player,sellprice); + if ( Owner.player == players[consoleplayer] ) + { + SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner); + Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + } else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice); } item.bPickupGood = true; @@ -55,7 +58,7 @@ Class ExplodiumGun : SWWMWeapon DualExplodiumGun(SisterWeapon).clipcount = DualExplodiumGun(SisterWeapon).default.clipcount; } // autoswitch if enabled - if ( !Owner.player.GetNeverSwitch() ) + if ( Owner.player && !Owner.player.GetNeverSwitch() ) Owner.player.PendingWeapon = SisterWeapon; // add the oneliner let demo = Demolitionist(Owner); diff --git a/zscript/weapons/swwm_tastytreat.zsc b/zscript/weapons/swwm_tastytreat.zsc index 87bca0378..b9fc987b1 100644 --- a/zscript/weapons/swwm_tastytreat.zsc +++ b/zscript/weapons/swwm_tastytreat.zsc @@ -25,12 +25,15 @@ Class CandyGun : SWWMWeapon if ( !deathmatch && !spareget ) { // sell excess - int sellprice = abs(item.Stamina)/2; - SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2))); - SWWMCredits.Give(Owner.player,sellprice); if ( Owner.player ) { - if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + int sellprice = abs(item.Stamina)/2; + SWWMCredits.Give(Owner.player,sellprice); + if ( Owner.player == players[consoleplayer] ) + { + SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner); + Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice); + } else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice); } item.bPickupGood = true;