Don't mind me.

This commit is contained in:
Mari the Deer 2021-07-01 12:43:08 +02:00
commit 9ddaa01545
10 changed files with 86 additions and 41 deletions

View file

@ -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-";

View file

@ -72,7 +72,7 @@ Class AmmoFabricator : Inventory abstract
let rep = GetReplacement(type2);
if ( (rep != type2) && !(rep is "DehackedPickup") ) continue;
readonly<Weapon> 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<Weapon> 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);

View file

@ -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;

View file

@ -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.Size(); i++ )
{
let w = (Class<Weapon>)(AllActorClasses[i]);
if ( !w ) continue;
if ( w is 'SWWMWeapon' )
{
let def = GetDefaultByType((Class<SWWMWeapon>)(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<Inventory> type )
{
let copy = Inventory(Spawn(type,Owner.Pos,NO_REPLACE));

View file

@ -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<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || !players[i].mo || players[i].mo.FindInventory(GetClass()) ) continue;
if ( !playeringame[i] || !players[i].mo || !(players[i].mo is 'Demolitionist') || players[i].mo.FindInventory(GetClass()) ) continue;
let o = Inventory(Spawn(GetClass()));
o.ClearCounters();
o.AttachToOwner(players[i].mo);

View file

@ -140,7 +140,7 @@ Class DemolitionistMenu : GenericMenu
oldloresiz = lorelib.ent.Size();
tradelib = SWWMTradeHistory.Find(players[consoleplayer]);
stats = SWWMStats.Find(players[consoleplayer]);
tmsg = "$SWWM_MAINCONTROLS";
tmsg = StringTable.Localize("$SWWM_MAINCONTROLS");
tmsgtic = gametic+70;
lasttuid = Random[TUID]();
hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
@ -2890,7 +2890,7 @@ Class DemolitionistMenu : GenericMenu
Screen.DrawText(TewiFont,Font.CR_FIRE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
// draw bottom messages
yy = 386;
if ( gametic < tmsgtic ) str = StringTable.Localize(tmsg);
if ( gametic < tmsgtic ) str = tmsg;
else str = CrimeTime();
xx = 4;
Screen.DrawText(fnt,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);

View file

@ -386,6 +386,7 @@ Class SWWMGesture : SWWMWeapon
+WEAPON.CHEATNOTWEAPON;
+WEAPON.NO_AUTO_SWITCH;
+WEAPON.WIMPY_WEAPON;
//+WEAPON.NOAUTOSWITCHTO;
+SWWMWEAPON.HIDEINMENU;
+INVENTORY.UNDROPPABLE;
+INVENTORY.UNTOSSABLE;
@ -721,6 +722,7 @@ Class SWWMItemGesture : SWWMWeapon abstract
+WEAPON.CHEATNOTWEAPON;
+WEAPON.NO_AUTO_SWITCH;
+WEAPON.WIMPY_WEAPON;
//+WEAPON.NOAUTOSWITCHTO;
+SWWMWEAPON.HIDEINMENU;
+INVENTORY.UNDROPPABLE;
+INVENTORY.UNTOSSABLE;

View file

@ -161,7 +161,7 @@ Class Demolitionist : PlayerPawn
let rep = GetReplacement(type2);
if ( (rep != type2) && !(rep is "DehackedPickup") ) continue;
readonly<Weapon> 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<Weapon> 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<Weapon> 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<Inventory>)(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;
}

View file

@ -334,6 +334,7 @@ Class DeepImpact : SWWMWeapon
DeepImpact.ClipCount 100;
+WEAPON.MELEEWEAPON;
+WEAPON.WIMPY_WEAPON;
//+WEAPON.NOAUTOSWITCHTO;
+SWWMWEAPON.NOSWAPWEAPON;
}

View file

@ -263,6 +263,7 @@ Class PusherWeapon : SWWMWeapon
Weapon.SelectionOrder 1500;
Stamina 10000;
+WEAPON.MELEEWEAPON;
//+WEAPON.NOAUTOSWITCHTO;
Radius 20;
Height 32;
}