Cleaning up.

This commit is contained in:
Mari the Deer 2023-02-11 17:03:43 +01:00
commit 35b8b986db
15 changed files with 127 additions and 109 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r754 \cu(Sat 11 Feb 13:19:03 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r754 \cu(2023-02-11 13:19:04)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r755 \cu(Sat 11 Feb 17:03:43 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r755 \cu(2023-02-11 17:03:43)\c-";

View file

@ -328,7 +328,7 @@ Class SWWMLevelCompatibility : LevelPostProcessor
SetLineSpecial(23,Door_Open,668,16);
AddSectorTag(25,668);
// hide the secret sector lines
for ( int i=164; i<=175; i++ )
for ( uint i=164; i<=175; i++ )
{
if ( i == 168 ) continue;
SetLineFlags(i,Line.ML_DONTDRAW);
@ -488,71 +488,71 @@ Class SWWMLevelCompatibility : LevelPostProcessor
}
switch ( checksum )
{
// ALL of Equinox
case '9705315427A2F951A538B23C39199236':
case '54E9953A3C1A88641E00AA353BAF46E9':
case 'DD3986E184829DAB73160F4C122155F9':
case 'B3E6CAE9983EA1DC4D9544DA26118569':
case '3E4DFC55EAE85A7FE02DD21ED33AABCA':
case 'ECCB69F1BBF91D8F67D8583EA2546863':
case 'E66BCCFAD7AC40EFB21E2A19131E1522':
case 'A0B6B83DC8BD50FC84170572840DE585':
case '9BA1ACB72D878AFA3CB22B810D6CCD9A':
case 'A26749D9B9CD70ECED5C7B6BAB6D859E':
case '3805A661D5C4523AFF7BF86991071043':
case 'F91E3FE225F10EECBE21486E1BB14834':
case '838BA30EB0B003C070414093BFDFA72A':
// replace certain animated flats with duplicates
// this avoids unintended TERRAIN defs from applying to them
level.ReplaceTextures("SLIME01","EQNXSL01",0);
level.ReplaceTextures("SLIME02","EQNXSL02",0);
level.ReplaceTextures("SLIME03","EQNXSL03",0);
level.ReplaceTextures("SLIME04","EQNXSL04",0);
level.ReplaceTextures("SLIME09","EQNXSL09",0);
level.ReplaceTextures("SLIME10","EQNXSL10",0);
level.ReplaceTextures("SLIME11","EQNXSL11",0);
level.ReplaceTextures("SLIME12","EQNXSL12",0);
level.ReplaceTextures("BLOOD1","EQNXBLD1",0);
level.ReplaceTextures("BLOOD2","EQNXBLD2",0);
level.ReplaceTextures("BLOOD3","EQNXBLD3",0);
level.ReplaceTextures("RROCK05","EQNXRR05",0);
level.ReplaceTextures("RROCK06","EQNXRR06",0);
level.ReplaceTextures("RROCK07","EQNXRR07",0);
level.ReplaceTextures("RROCK08","EQNXRR08",0);
break;
// ALL of Doom Vacation
case 'D07842872226058F93D0957EA46ED782':
case 'F286BABF0D152259CD6B996E8920CA70':
case '7E2707328B6BCF0ACDC2E80049E21167':
case '8AA3E9B8E816E72A04368404402DD8E3':
case '8B28736D01492F3701CCD736C97EF125':
case '10D3C12050518E806801B12057437403':
case '48A7FC1AF2D1CCBFE7C6EFB4EEE97A50':
case '73B317A0DA2C75BD903E895A27EEEDB9':
case '62158F76FC56B62007C1F167A7921304':
case '0D33878E4C8164A792AECCDA56F08D60':
case 'A52BD2038CF814101AAB7D9C78F9ACE2':
case 'F6413AFAEB73B3848A82F70C2A01E47D':
case 'F8CBDC96A7E08CAFC5D7C0E711551E40':
case '3E821CC90C38B7D71DDEB0324D3900CC':
case '05D0AA06742B3C7DCD79E5F659267656':
case '8F6710E3570C2056FDCA591EF89B31A9':
case '382E99BBFA9301110630CD5F8F8056DA':
case '480F6AD2D2E266DA745FD8FA75EC327D':
case '968D97F5952E55DB2464274A8EE5F529':
case '5669E396BEDDEA6D90EF5AF5EC892811':
// get rid of these dumb skulltag ctf actors
for ( uint i=0; i<GetThingCount(); i++ )
{
int ednum = GetThingEdNum(i);
if ( (ednum == 5130) || (ednum == 5131)
|| (ednum == 5080) || (ednum == 5081) )
SetThingEdNum(i,0);
}
// get rid of moan switches
level.ReplaceTextures("SW1ZIM","-noflat-",0);
level.ReplaceTextures("SW1TEK","-noflat-",0);
break;
// ALL of Equinox
case '9705315427A2F951A538B23C39199236':
case '54E9953A3C1A88641E00AA353BAF46E9':
case 'DD3986E184829DAB73160F4C122155F9':
case 'B3E6CAE9983EA1DC4D9544DA26118569':
case '3E4DFC55EAE85A7FE02DD21ED33AABCA':
case 'ECCB69F1BBF91D8F67D8583EA2546863':
case 'E66BCCFAD7AC40EFB21E2A19131E1522':
case 'A0B6B83DC8BD50FC84170572840DE585':
case '9BA1ACB72D878AFA3CB22B810D6CCD9A':
case 'A26749D9B9CD70ECED5C7B6BAB6D859E':
case '3805A661D5C4523AFF7BF86991071043':
case 'F91E3FE225F10EECBE21486E1BB14834':
case '838BA30EB0B003C070414093BFDFA72A':
// replace certain animated flats with duplicates
// this avoids unintended TERRAIN defs from applying to them
level.ReplaceTextures("SLIME01","EQNXSL01",0);
level.ReplaceTextures("SLIME02","EQNXSL02",0);
level.ReplaceTextures("SLIME03","EQNXSL03",0);
level.ReplaceTextures("SLIME04","EQNXSL04",0);
level.ReplaceTextures("SLIME09","EQNXSL09",0);
level.ReplaceTextures("SLIME10","EQNXSL10",0);
level.ReplaceTextures("SLIME11","EQNXSL11",0);
level.ReplaceTextures("SLIME12","EQNXSL12",0);
level.ReplaceTextures("BLOOD1","EQNXBLD1",0);
level.ReplaceTextures("BLOOD2","EQNXBLD2",0);
level.ReplaceTextures("BLOOD3","EQNXBLD3",0);
level.ReplaceTextures("RROCK05","EQNXRR05",0);
level.ReplaceTextures("RROCK06","EQNXRR06",0);
level.ReplaceTextures("RROCK07","EQNXRR07",0);
level.ReplaceTextures("RROCK08","EQNXRR08",0);
break;
// ALL of Doom Vacation
case 'D07842872226058F93D0957EA46ED782':
case 'F286BABF0D152259CD6B996E8920CA70':
case '7E2707328B6BCF0ACDC2E80049E21167':
case '8AA3E9B8E816E72A04368404402DD8E3':
case '8B28736D01492F3701CCD736C97EF125':
case '10D3C12050518E806801B12057437403':
case '48A7FC1AF2D1CCBFE7C6EFB4EEE97A50':
case '73B317A0DA2C75BD903E895A27EEEDB9':
case '62158F76FC56B62007C1F167A7921304':
case '0D33878E4C8164A792AECCDA56F08D60':
case 'A52BD2038CF814101AAB7D9C78F9ACE2':
case 'F6413AFAEB73B3848A82F70C2A01E47D':
case 'F8CBDC96A7E08CAFC5D7C0E711551E40':
case '3E821CC90C38B7D71DDEB0324D3900CC':
case '05D0AA06742B3C7DCD79E5F659267656':
case '8F6710E3570C2056FDCA591EF89B31A9':
case '382E99BBFA9301110630CD5F8F8056DA':
case '480F6AD2D2E266DA745FD8FA75EC327D':
case '968D97F5952E55DB2464274A8EE5F529':
case '5669E396BEDDEA6D90EF5AF5EC892811':
// get rid of these dumb skulltag ctf actors
for ( uint i=0; i<GetThingCount(); i++ )
{
int ednum = GetThingEdNum(i);
if ( (ednum == 5130) || (ednum == 5131)
|| (ednum == 5080) || (ednum == 5081) )
SetThingEdNum(i,0);
}
// get rid of moan switches
level.ReplaceTextures("SW1ZIM","-noflat-",0);
level.ReplaceTextures("SW1TEK","-noflat-",0);
break;
}
// [Hexen] force Mystic Ambit Incants to spawn outside coop
if ( gameinfo.gametype&GAME_Hexen )

View file

@ -3,7 +3,6 @@
extend Class SWWMHandler
{
bool nugflip; // h/a nugget flip-flop spawn counter
bool equinoxhack; // hackaround for UseInventory
private Class<Actor> GetDRLAReplacee( Class<Actor> a )
{
@ -700,7 +699,7 @@ extend Class SWWMHandler
}
else if ( (e.Replacee is 'RedCard') && !(e.Replacee is 'ChexRedCard') )
{
if ( !equinoxhack && (level.GetChecksum() ~== "3805A661D5C4523AFF7BF86991071043") )
if ( level.GetChecksum() ~== "3805A661D5C4523AFF7BF86991071043" )
{
if ( profiling ) ProfileTock(PT_CHECKREPLACEMENT);
return; // don't replace red key in Equinox MAP13

View file

@ -89,8 +89,7 @@ Class SWWMStaticHandler : StaticEventHandler
for ( int i=0; i<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || !(players[i].mo is 'Demolitionist') ) continue;
let demo = Demolitionist(players[i].mo);
demo.CheckUnderwaterAmb(true);
Demolitionist(players[i].mo).CheckUnderwaterAmb(true);
}
}
SWWMHandler.ClearAllShaders();
@ -139,7 +138,7 @@ Class SWWMStaticHandler : StaticEventHandler
// fix voice type cvar
int lmp;
Array<String> types;
for ( lmp = Wads.FindLumpFullName("swwmvoicepack.txt"); lmp != -1; lmp = Wads.FindLumpFullName("swwmvoicepack.txt",lmp+1) )
for ( lmp = Wads.FindLumpFullName("swwmvoicepack",0,true); lmp != -1; lmp = Wads.FindLumpFullName("swwmvoicepack",lmp+1,true) )
{
Array<String> lst;
lst.Clear();
@ -159,7 +158,7 @@ Class SWWMStaticHandler : StaticEventHandler
else LoadAchievements();
// precache fonts
Array<String> fonts;
for ( lmp = Wads.FindLumpFullName("precachefonts.txt"); lmp != -1; lmp = Wads.FindLumpFullName("precachefonts.txt",lmp+1) )
for ( lmp = Wads.FindLumpFullName("precachefonts",0,true); lmp != -1; lmp = Wads.FindLumpFullName("precachefonts",lmp+1,true) )
{
Array<String> lst;
lst.Clear();
@ -180,7 +179,7 @@ Class SWWMStaticHandler : StaticEventHandler
S_StartSound("compat/warn",CHAN_YOUDONEFUCKEDUP,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1,ATTN_NONE);
}
// warning for unsupported
if ( Wads.FindLumpFullName("swwmgamesupported.txt") != -1 ) return;
if ( Wads.FindLumpFullName("swwmgamesupported",0,true) != -1 ) return;
Console.Printf(
"\cx┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\c-\n"
"\cx┃ \cr[\cgWARNING\cr] \cx┃\c-\n"

View file

@ -596,6 +596,11 @@ Class SWWMStatusBar : BaseStatusBar
}
Super.Draw(state,TicFrac);
FrameTime = (CurFrame-PrevFrame)/1000.;
if ( (state != HUD_StatusBar) && (state != HUD_Fullscreen) )
{
PrevFrame = CurFrame;
return;
}
if ( !hnd ) hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.);
ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);

View file

@ -281,7 +281,6 @@ Class MagAmmo : Inventory abstract
meta Class<Ammo> ParentAmmo;
Ammo pamo;
meta int ClipSize;
int countdown;
meta String PickupTag;
int BackpackAmount;

View file

@ -197,7 +197,6 @@ Mixin Class SWWMPickupGlow
Class SWWMItemOverlay : SWWMNonInteractiveActor
{
Default
{
RenderStyle "Add";
@ -231,7 +230,6 @@ Mixin Class SWWMRotatingPickup
{
+INTERPOLATEANGLES;
}
override void Tick()
{
Super.Tick();

View file

@ -50,7 +50,7 @@ Class Omnisight : Inventory
Inventory.PickupSound "misc/p_pkup";
Inventory.PickupMessage "$I_OMNISIGHT";
Inventory.RestrictedTo "Demolitionist";
Inventory.PickupFlash "SWWMPurplePickupFlash";
Inventory.PickupFlash "SWWMCyanPickupFlash";
+INVENTORY.ALWAYSPICKUP;
+COUNTITEM;
+INVENTORY.BIGPOWERUP;
@ -166,7 +166,7 @@ Class SafetyTether : Inventory
safepos.z = s.floorplane.ZAtPoint(safepos.xy);
}
bFailed = (level.Vec3Diff(Owner.pos,safepos).length() < 400);
if ( (Owner.player == players[consoleplayer]) || bBigPowerup ) Owner.A_StartSound(bFailed?"powerup/tetherfail":"powerup/tetheruse",CHAN_ITEMEXTRA,CHANF_OVERLAP);
Owner.A_StartSound(bFailed?"powerup/tetherfail":"powerup/tetheruse",CHAN_ITEMEXTRA,CHANF_OVERLAP);
// don't consume on use, will happen later
Amount++;
return true;
@ -182,7 +182,7 @@ Class SafetyTether : Inventory
Inventory.PickupMessage "$T_SAFETY";
Inventory.MaxAmount 5;
Inventory.InterHubAmount 5;
Inventory.PickupFlash "SWWMPurplePickupFlash";
Inventory.PickupFlash "SWWMCyanPickupFlash";
+INVENTORY.ALWAYSPICKUP;
+INVENTORY.AUTOACTIVATE;
+INVENTORY.INVBAR;

View file

@ -1309,7 +1309,7 @@ Class BarrierPower : PowerIronFeet
endlv = true;
break;
}
if ( !endlv && (Owner.pos.z <= Owner.floorz) )
if ( !endlv && ((Owner.pos.z == Owner.CurSector.floorplane.ZAtPoint(Owner.pos.xy)) || Owner.waterlevel) )
{
bool damageterrain = false;
if ( (Owner.CurSector.damageamount > 0) && (Owner.CurSector.damageinterval > 0) ) damageterrain = true;
@ -1421,7 +1421,6 @@ Class EBarrier : Inventory
terrainwait = 0;
Owner.UseInventory(self);
}
Default
{
Tag "$T_BARRIER";
@ -1432,11 +1431,10 @@ Class EBarrier : Inventory
Inventory.PickupMessage "$T_BARRIER";
Inventory.MaxAmount 5;
Inventory.InterHubAmount 5;
Inventory.PickupFlash "SWWMPurplePickupFlash";
Inventory.PickupFlash "SWWMCyanPickupFlash";
+INVENTORY.ALWAYSPICKUP;
+INVENTORY.AUTOACTIVATE;
+INVENTORY.INVBAR;
+INVENTORY.BIGPOWERUP;
+FLOATBOB;
+DONTGIB;
FloatBobStrength 0.25;

View file

@ -565,15 +565,15 @@ Class ListMenuItemSWWMStaticTextM : ListMenuItem
else scl = 2;
if ( w == ListMenuDescriptor.CleanScale )
{
double x = (320-mFont.StringWidth(text)*scl)/2;
double x = (320-font.StringWidth(text)*scl)/2;
double y = mYpos;
SWWMUtility.AdjustClean_1(x,y);
Screen.DrawText(mFont,mColor,x,y,text,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl);
Screen.DrawText(font,mColor,x,y,text,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl);
}
else
{
double x = (w-mFont.StringWidth(text)*scl)/2;
Screen.DrawText(mFont,mColor,x,mYpos,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl);
double x = (w-font.StringWidth(text)*scl)/2;
Screen.DrawText(font,mColor,x,mYpos,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl);
}
}
}

View file

@ -102,7 +102,7 @@ extend Class Demolitionist
// Give the weapon only if it is set in a weapon slot.
if ( !player.weapons.LocateWeapon(type) ) continue;
readonly<Weapon> def = GetDefaultByType(type);
if ( !def.bCheatNotWeapon && def.CanPickup(self) )
if ( !def.bCheatNotWeapon && def.ShouldSpawn() && def.CanPickup(self) )
GiveInventory(type,1,true);
}
}
@ -157,6 +157,29 @@ extend Class Demolitionist
if ( !item.CallTryPickup(self) ) item.Destroy();
}
}
bool CheatGive_Item( Class<Inventory> type, int amount = 0 )
{
if ( amount <= 0 ) amount = GetDefaultByType(type).Amount;
let itm = FindInventory(type);
if ( itm )
{
int oldamt = itm.Amount;
itm.Amount += amount;
if ( (itm.Amount < oldamt) || (itm.Amount > itm.MaxAmount) )
itm.Amount = itm.MaxAmount;
return true;
}
itm = Inventory(Spawn(type));
if ( !itm.CallTryPickup(self) )
{
// just in case it was a count item
itm.ClearCounters();
itm.Destroy();
return false;
}
itm.Amount = amount;
return true;
}
override void CheatGive( String name, int amount )
{
if ( !player.mo || (player.health <= 0) ) return;
@ -194,7 +217,8 @@ extend Class Demolitionist
ingivecheat = false;
return;
}
GiveInventory(type,amount,true);
if ( !CheatGive_Item(type,amount) && CheckLocalView() )
Console.Printf("Cannot give '%s'",name);
}
ingivecheat = false;
}
@ -318,7 +342,6 @@ extend Class Demolitionist
i = next;
}
}
override void CheatTake( String name, int amount )
{
if ( !player.mo || (player.health <= 0) ) return;

View file

@ -149,7 +149,6 @@ extend Class Demolitionist
override bool UseInventory( Inventory item )
{
let itemtype = item.GetClass();
if ( (player.cheats&CF_TOTALLYFROZEN) || isFrozen() ) return false;
if ( !Actor.UseInventory(item) )
{

View file

@ -1472,7 +1472,7 @@ Class SWWMBloodSplash : SWWMBaseSplash
puff.accel = (0,0,-.03*str);
level.SpawnParticle(puff);
}
A_AlertMonsters(swwm_uncapalert?0:1200);
A_AlertMonsters(swwm_uncapalert?0:1200,AMF_EMITFROMTARGET);
}
}
Class SWWMBloodSplash2 : SWWMBaseSplash
@ -1526,7 +1526,7 @@ Class SWWMSludgeSplash : SWWMBaseSplash
puff.accel = (0,0,-.03*str);
level.SpawnParticle(puff);
}
A_AlertMonsters(swwm_uncapalert?0:1200);
A_AlertMonsters(swwm_uncapalert?0:1200,AMF_EMITFROMTARGET);
}
}
Class SWWMSludgeSplash2 : SWWMBaseSplash
@ -1580,7 +1580,7 @@ Class SWWMMudSplash : SWWMBaseSplash
puff.accel = (0,0,-.03*str);
level.SpawnParticle(puff);
}
A_AlertMonsters(swwm_uncapalert?0:1200);
A_AlertMonsters(swwm_uncapalert?0:1200,AMF_EMITFROMTARGET);
}
}
Class SWWMMudSplash2 : SWWMBaseSplash
@ -1636,7 +1636,7 @@ Class SWWMSlimeSplash : SWWMBaseSplash
puff.accel = (0,0,-.03*str);
level.SpawnParticle(puff);
}
A_AlertMonsters(swwm_uncapalert?0:1200);
A_AlertMonsters(swwm_uncapalert?0:1200,AMF_EMITFROMTARGET);
}
}
Class SWWMSlimeSplash2 : SWWMBaseSplash

View file

@ -248,6 +248,15 @@ extend Class SWWMUtility
return -atan2(diff.z,diff.xy.length());
}
// box intersection check, for collision detection
static bool BoxIntersect( Actor a, Actor b, Vector3 ofs = (0,0,0), int pad = 0 )
{
Vector3 diff = level.Vec3Diff(level.Vec3Offset(a.pos,ofs),b.pos);
if ( (abs(diff.x) > (a.radius+b.radius+pad)) || (abs(diff.y) > (a.radius+b.radius+pad)) ) return false;
if ( (diff.z > a.height+pad) || (diff.z < -(b.height+pad)) ) return false;
return true;
}
// extruded box intersection check, useful when checking things that might be hit along a path
static bool ExtrudeIntersect( Actor a, Actor b, Vector3 range, int steps, int pad = 0 )
{
@ -261,15 +270,6 @@ extend Class SWWMUtility
return false;
}
// box intersection check, for collision detection
static bool BoxIntersect( Actor a, Actor b, Vector3 ofs = (0,0,0), int pad = 0 )
{
Vector3 diff = level.Vec3Diff(level.Vec3Offset(a.pos,ofs),b.pos);
if ( (abs(diff.x) > (a.radius+b.radius+pad)) || (abs(diff.y) > (a.radius+b.radius+pad)) ) return false;
if ( (diff.z > a.height+pad) || (diff.z < -(b.height+pad)) ) return false;
return true;
}
// sphere intersection check, useful for proximity detection
static bool SphereIntersect( Actor a, Vector3 p, double radius )
{

View file

@ -348,8 +348,6 @@ Class SWWMWeapon : Weapon abstract
bINVISIBLE = true;
SetState(FindState("HideDoomish"));
tics = 1050;
if ( (self is 'Ammo') || (self is 'MagAmmo') )
tics -= 350;
if ( self.bBIGPOWERUP || SWWMUtility.IsVIPItem(self) )
tics += 1050;
if ( RespawnTics != 0 ) tics = RespawnTics;
@ -613,7 +611,7 @@ Class SWWMWeapon : Weapon abstract
}
if ( tooltipsent ) return;
tooltipsent = true;
if ( Owner.player == players[consoleplayer] )
if ( (tooptip != "") && (Owner.player == players[consoleplayer]) )
SWWMUtility.SendTooltip(GetClass());
}
action void A_SWWMFlash( StateLabel flashlabel = null )