diff --git a/language.version b/language.version index 878f5ab56..0b5181835 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r567 \cu(Thu 1 Jul 10:09:16 CEST 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r567 \cu(2021-07-01 10:09:16)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r568 \cu(Thu 1 Jul 12:43:08 CEST 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r568 \cu(2021-07-01 12:43:08)\c-"; diff --git a/zscript/items/swwm_ammoextra.zsc b/zscript/items/swwm_ammoextra.zsc index 72200b2fd..0d2af65d7 100644 --- a/zscript/items/swwm_ammoextra.zsc +++ b/zscript/items/swwm_ammoextra.zsc @@ -72,7 +72,7 @@ Class AmmoFabricator : Inventory abstract let rep = GetReplacement(type2); if ( (rep != type2) && !(rep is "DehackedPickup") ) continue; readonly weap = GetDefaultByType(type2); - if ( !Owner.player || !Owner.player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon ) continue; + if ( !Owner.player || !Owner.player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon || !weap.CanPickup(Owner) ) continue; let ready = weap.FindState("Ready"); if ( !ready || !ready.ValidateSpriteFrame() ) continue; validweapons.Push(type2); @@ -341,7 +341,7 @@ Class HammerspaceEmbiggener : Inventory let rep = GetReplacement(type2); if ( (rep != type2) && !(rep is "DehackedPickup") ) continue; readonly weap = GetDefaultByType(type2); - if ( !other.player || !other.player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon ) continue; + if ( !other.player || !other.player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon || !weap.CanPickup(other) ) continue; let ready = weap.FindState("Ready"); if ( !ready || !ready.ValidateSpriteFrame() ) continue; validweapons.Push(type2); diff --git a/zscript/items/swwm_armor.zsc b/zscript/items/swwm_armor.zsc index 27493aaa8..a69a9ea0f 100644 --- a/zscript/items/swwm_armor.zsc +++ b/zscript/items/swwm_armor.zsc @@ -87,6 +87,7 @@ Class BlastSuit : SWWMArmor Inventory.Amount 150; Inventory.MaxAmount 150; Inventory.InterHubAmount 150; + Inventory.RestrictedTo "Demolitionist"; SWWMArmor.ArmorPriority 2; SWWMArmor.DrainMessage "$D_BLASTSUIT"; SWWMArmor.GiverArmor "BlastSuitItem"; @@ -118,6 +119,7 @@ Class BlastSuitItem : SWWMSpareArmor Inventory.Icon "graphics/HUD/Icons/I_BlastSuit.png"; Inventory.PickupMessage "$T_BLASTSUIT"; Inventory.UseSound "armor/blastsuit"; + Inventory.RestrictedTo "Demolitionist"; SWWMSpareArmor.GiveArmor "BlastSuit"; Radius 12; Height 30; @@ -138,6 +140,7 @@ Class WarArmor : SWWMArmor Inventory.Amount 250; Inventory.MaxAmount 250; Inventory.InterHubAmount 250; + Inventory.RestrictedTo "Demolitionist"; SWWMArmor.ArmorPriority 6; SWWMArmor.DrainMessage "$D_WARARMOR"; SWWMArmor.GiverArmor "WarArmorItem"; @@ -172,6 +175,7 @@ Class WarArmorItem : SWWMSpareArmor Inventory.Icon "graphics/HUD/Icons/I_WarArmor.png"; Inventory.PickupMessage "$T_WARARMOR"; Inventory.UseSound "armor/wararmor"; + Inventory.RestrictedTo "Demolitionist"; SWWMSpareArmor.GiveArmor "WarArmor"; Radius 16; Height 32; diff --git a/zscript/items/swwm_baseammo.zsc b/zscript/items/swwm_baseammo.zsc index 3d897a0ea..82ca26f47 100644 --- a/zscript/items/swwm_baseammo.zsc +++ b/zscript/items/swwm_baseammo.zsc @@ -172,6 +172,31 @@ Mixin Class SWWMAmmo } } + override bool CanPickup( Actor toucher ) + { + // don't allow picking up ammo for weapons we can't pick up + // (future-proofing for player classes) + if ( !Super.CanPickup(toucher) ) return false; + for ( int i=0; i)(AllActorClasses[i]); + if ( !w ) continue; + if ( w is 'SWWMWeapon' ) + { + let def = GetDefaultByType((Class)(w)); + if ( !def.UsesAmmo(GetClass()) ) continue; + if ( !def.CanPickup(toucher) ) return false; + } + else + { + let def = GetDefaultByType(w); + if ( (def.AmmoType1 != GetClass()) && (def.AmmoType2 != GetClass()) ) continue; + if ( !def.CanPickup(toucher) ) return false; + } + } + return true; + } + default { +INVENTORY.IGNORESKILL; @@ -236,6 +261,15 @@ Class MagAmmo : Inventory abstract return Super.HandlePickup(item); } + override bool CanPickup( Actor toucher ) + { + // don't allow picking up ammo for weapons we can't pick up + // (future-proofing for player classes) + if ( !Super.CanPickup(toucher) ) return false; + let def = GetDefaultByType(ParentAmmo); + return def.CanPickup(toucher); + } + private Inventory DoDrop( Class type ) { let copy = Inventory(Spawn(type,Owner.Pos,NO_REPLACE)); diff --git a/zscript/items/swwm_powerups.zsc b/zscript/items/swwm_powerups.zsc index 111cd45e3..8257aef72 100644 --- a/zscript/items/swwm_powerups.zsc +++ b/zscript/items/swwm_powerups.zsc @@ -42,30 +42,40 @@ Class GrilledCheeseSandwich : Inventory Owner.A_QuakeEx(9,9,9,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:1.); Owner.GiveBody(1000,1000); SWWMScoreObj.Spawn(1000,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health); - if ( swwm_accdamage ) - SWWMScoreObj.Spawn(600,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor); + if ( Owner is 'Demolitionist' ) + { + if ( swwm_accdamage ) + SWWMScoreObj.Spawn(600,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor); + else + { + SWWMScoreObj.Spawn(200,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor); + SWWMScoreObj.Spawn(150,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor); + SWWMScoreObj.Spawn(250,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor); + } + let n = Owner.FindInventory("ArmorNugget"); + if ( !n ) Owner.GiveInventory("ArmorNugget",GetDefaultByType("ArmorNugget").MaxAmount); + else n.Amount = n.MaxAmount; + let b = Owner.FindInventory("BlastSuit"); + if ( !b ) Owner.GiveInventory("BlastSuit",GetDefaultByType("BlastSuit").MaxAmount); + else b.Amount = b.MaxAmount; + let w = Owner.FindInventory("WarArmor"); + if ( !w ) Owner.GiveInventory("WarArmor",GetDefaultByType("WarArmor").MaxAmount); + else w.Amount = w.MaxAmount; + SWWMLoreLibrary.Add(Owner.player,"Nugget"); + SWWMLoreLibrary.Add(Owner.player,"BlastSuit"); + SWWMLoreLibrary.Add(Owner.player,"WarArmor"); + Demolitionist(Owner).lastbump *= 1.2; + } else { SWWMScoreObj.Spawn(200,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor); - SWWMScoreObj.Spawn(150,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor); - SWWMScoreObj.Spawn(250,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor); + let n = Owner.FindInventory("ArmorNugget"); + if ( !n ) Owner.GiveInventory("ArmorNugget",GetDefaultByType("ArmorNugget").MaxAmount); + else n.Amount = n.MaxAmount; + SWWMLoreLibrary.Add(Owner.player,"Nugget"); } - let n = Owner.FindInventory("ArmorNugget"); - if ( !n ) Owner.GiveInventory("ArmorNugget",GetDefaultByType("ArmorNugget").MaxAmount); - else n.Amount = n.MaxAmount; - let b = Owner.FindInventory("BlastSuit"); - if ( !b ) Owner.GiveInventory("BlastSuit",GetDefaultByType("BlastSuit").MaxAmount); - else b.Amount = b.MaxAmount; - let w = Owner.FindInventory("WarArmor"); - if ( !w ) Owner.GiveInventory("WarArmor",GetDefaultByType("WarArmor").MaxAmount); - else w.Amount = w.MaxAmount; let f = Spawn("SWWMItemFog",Owner.Vec3Offset(0,0,Owner.Height/2)); f.bAMBUSH = true; - SWWMLoreLibrary.Add(Owner.player,"Nugget"); - SWWMLoreLibrary.Add(Owner.player,"BlastSuit"); - SWWMLoreLibrary.Add(Owner.player,"WarArmor"); - if ( Owner is 'Demolitionist' ) - Demolitionist(Owner).lastbump *= 1.2; if ( !extrasafe ) return; let s = Owner.FindInventory("GrilledCheeseSafeguard"); if ( !s ) Owner.GiveInventory("GrilledCheeseSafeguard",1); @@ -336,7 +346,6 @@ Class GhostPower : PowerInvisibility +CANTSEEK; } - override void InitEffect() { Super.InitEffect(); @@ -1152,6 +1161,7 @@ Class Ragekit : Inventory if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA); if ( Owner.GiveBody(100,100) ) SWWMScoreObj.Spawn(100,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health); + SWWMUtility.AchievementProgressInc('swwm_progress_rage',1,Owner.player); if ( !(Owner is 'Demolitionist') ) { SWWMHandler.DoFlash(Owner,Color(64,255,0,0),30); @@ -1168,7 +1178,6 @@ Class Ragekit : Inventory Demolitionist(Owner).lastbump *= .95; } else Owner.GiveInventory("RagekitPower",1); - SWWMUtility.AchievementProgressInc('swwm_progress_rage',1,Owner.player); return true; } override void Travelled() @@ -1247,7 +1256,7 @@ Class Omnisight : Inventory // spread to all players for ( int i=0; i weap = GetDefaultByType(type2); - if ( !player || !player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon ) continue; + if ( !player || !player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon || !weap.CanPickup(self) ) continue; let ready = weap.FindState("Ready"); if ( !ready || !ready.ValidateSpriteFrame() ) continue; validweapons.Push(type2); @@ -216,7 +216,7 @@ Class Demolitionist : PlayerPawn let rep = GetReplacement(type2); if ( (rep != type2) && !(rep is "DehackedPickup") ) continue; readonly weap = GetDefaultByType(type2); - if ( !player.weapons.LocateWeapon(type2) || (weap.bCheatNotWeapon && (giveall != ALL_YESYES)) ) continue; + if ( !player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon || !weap.CanPickup(self) ) continue; let ready = weap.FindState("Ready"); if ( !ready || !ready.ValidateSpriteFrame() ) continue; if ( (type2 is 'SWWMWeapon') && SWWMWeapon(weap).UsesAmmo(pamo) ) @@ -299,7 +299,7 @@ Class Demolitionist : PlayerPawn // iwad restrictions (vanilla doesn't care, but here they'll show in the inventory) if ( !(gameinfo.gametype&GAME_HERETIC) && ((rep is 'SWWMKeyGreen') || (rep is 'SWWMKeyBlue') || (rep is 'SWWMKeyYellow')) ) continue; - if ( !(gameinfo.gametype&GAME_DOOMCHEX) && ((rep is 'SWWMRedCard') || (rep is 'SWWMBlueCard') || (rep is 'SWWMYellowCard')) ) + if ( !(gameinfo.gametype&GAME_DOOM) && ((rep is 'SWWMRedCard') || (rep is 'SWWMBlueCard') || (rep is 'SWWMYellowCard')) ) continue; let item = Inventory(Spawn(rep)); SWWMHandler.KeyTagFix(item); @@ -328,7 +328,7 @@ Class Demolitionist : PlayerPawn // Give the weapon only if it is set in a weapon slot. if ( !player.weapons.LocateWeapon(type) ) continue; readonly def = GetDefaultByType(type); - if ( (giveall == ALL_YESYES) || !def.bCheatNotWeapon ) + if ( !def.bCheatNotWeapon && def.CanPickup(self) ) GiveInventory(type,1,true); } } @@ -342,7 +342,7 @@ Class Demolitionist : PlayerPawn let type = (class)(AllActorClasses[i]); if ( !type ) continue; // no fabricators before hexen - if ( !(gameinfo.gametype&GAME_Hexen) && (type is 'AmmoFabricator') ) continue; + if ( !(gameinfo.gametype&GAME_HEXEN) && (type is 'AmmoFabricator') ) continue; // no barriers outside doom if ( !(gameinfo.gametype&GAME_DOOM) && (type is 'EBarrier') ) continue; // no gravity outside raven @@ -352,11 +352,7 @@ Class Demolitionist : PlayerPawn if ( owned && (owned.Amount >= owned.MaxAmount) ) continue; let def = GetDefaultByType (type); if ( def.Icon.isValid() && !(type is "PuzzleItem") && !(type is "Powerup") && !(type is "Ammo") && !(type is "MagAmmo") && !(type is "Armor") && !(type is "Key") ) - { - // Do not give replaced items unless using "give everything" - if ( (giveall == ALL_YESYES) || (GetReplacement(type) == type) ) - GiveInventory(type,(amount<=0)?def.MaxAmount:amount,true); - } + GiveInventory(type,(amount<=0)?def.MaxAmount:amount,true); } if ( !giveall ) return; } @@ -368,9 +364,7 @@ Class Demolitionist : PlayerPawn if ( !type ) continue; let def = GetDefaultByType(type); if ( !def.Icon.isValid() ) continue; - // Do not give replaced items unless using "give everything" - if ( (giveall == ALL_YESYES) || (GetReplacement(type) == type) ) - GiveInventory(type,(amount<=0)?def.MaxAmount:amount,true); + GiveInventory(type,(amount<=0)?def.MaxAmount:amount,true); } if ( !giveall ) return; } diff --git a/zscript/weapons/swwm_deepdarkimpact.zsc b/zscript/weapons/swwm_deepdarkimpact.zsc index d19f116cc..2ad188988 100644 --- a/zscript/weapons/swwm_deepdarkimpact.zsc +++ b/zscript/weapons/swwm_deepdarkimpact.zsc @@ -334,6 +334,7 @@ Class DeepImpact : SWWMWeapon DeepImpact.ClipCount 100; +WEAPON.MELEEWEAPON; +WEAPON.WIMPY_WEAPON; + //+WEAPON.NOAUTOSWITCHTO; +SWWMWEAPON.NOSWAPWEAPON; } diff --git a/zscript/weapons/swwm_jackhammer.zsc b/zscript/weapons/swwm_jackhammer.zsc index 201c42262..209686b3f 100644 --- a/zscript/weapons/swwm_jackhammer.zsc +++ b/zscript/weapons/swwm_jackhammer.zsc @@ -263,6 +263,7 @@ Class PusherWeapon : SWWMWeapon Weapon.SelectionOrder 1500; Stamina 10000; +WEAPON.MELEEWEAPON; + //+WEAPON.NOAUTOSWITCHTO; Radius 20; Height 32; }