More Eviternity 2 MAP33 compat work.

This commit is contained in:
Mari the Deer 2023-12-24 17:56:05 +01:00
commit 308636000f
6 changed files with 117 additions and 58 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1069 \cu(Sun 24 Dec 15:34:12 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r1069 \cu(2023-12-24 15:34:12)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1070 \cu(Sun 24 Dec 17:56:05 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r1070 \cu(2023-12-24 17:56:05)\c-";

View file

@ -484,6 +484,47 @@ Class SWWMLevelCompatibility : LevelPostProcessor
for ( int i=0; i<13; i++ )
AddThing(4206900+i,(1472+64*i,640,0),0,SKILLS_ALL,MTF_SINGLE|MTF_COOPERATIVE);
break;
// Eviternity 2 MAP33 (RC5)
case '043FE06534270E95882CA128AF7B0402':
// add autosave triggers to a couple sections
// (because why the heck not)
if ( G_SkillPropertyInt(SKILLP_ACSReturn) <= 1 )
{
// <=easy, autosaves...
// after first laser section
SetLineSpecial(819,Autosave,0,0,0,0);
SetLineActivation(819,SPAC_Cross);
// after first lava section
SetLineSpecial(1710,Autosave,0,0,0,0);
SetLineActivation(1710,SPAC_Cross);
}
if ( G_SkillPropertyInt(SKILLP_ACSReturn) <= 2 )
{
// <=medium, autosaves...
// after third laser section
SetLineSpecial(4859,Autosave,0,0,0,0);
SetLineActivation(4859,SPAC_Cross);
}
if ( G_SkillPropertyInt(SKILLP_ACSReturn) <= 3 )
{
// <=hard, autosaves...
// after second laser section
SetLineSpecial(2390,Autosave,0,0,0,0);
SetLineActivation(2390,SPAC_Cross);
// after second lava section
SetLineSpecial(6031,Autosave,0,0,0,0);
SetLineActivation(6031,SPAC_Cross);
}
if ( G_SkillPropertyInt(SKILLP_ACSReturn) <= 4 )
{
// <=hardcore, autosaves...
SetLineSpecial(507,Autosave,0,0,0,0);
SetLineActivation(507,SPAC_Cross);
SetLineSpecial(59893,Autosave,0,0,0,0);
SetLineActivation(59893,SPAC_Cross);
}
// above hardcore, you get nothing, good luck
break;
}
switch ( checksum )
{

View file

@ -51,6 +51,7 @@ extend Class SWWMHandler
bool maphaskeys;
bool nogroundanchor;
int allclearsector;
// weird optimization
Array<SectorBounds> sbounds;
@ -120,6 +121,9 @@ extend Class SWWMHandler
if ( s.nazicleanup == 3 )
SWWMUtility.MarkAchievement("trash",s.myplayer);
}
// re-enable retries after Eviternity 2 MAP33
if ( level.GetChecksum() ~== "043FE06534270E95882CA128AF7B0402" )
gdat.disablerevive = false;
// reset score on dead players (death exit™)
for ( int i=0; i<MAXPLAYERS; i++ )
{
@ -416,7 +420,11 @@ extend Class SWWMHandler
// segments impossible due to the player's feet immediately
// touching the instant-kill lava
if ( level.GetChecksum() ~== "043FE06534270E95882CA128AF7B0402" )
{
nogroundanchor = true;
allclearsector = 18414; // only check all-clear if the player is standing in this sector
gdat.disablerevive = true; // ONE TRY
}
// for skipping over merged exit lines (sharing vertices)
Array<Line> skipme;
skipme.Clear();

View file

@ -141,6 +141,19 @@ extend Class SWWMHandler
if ( deathmatch ) return;
// not in Hexen, due to its fully hub-based nature
if ( gameinfo.gametype&GAME_Hexen ) return;
// not unless at least one player is standing in this sector
// (used for Eviternity 2 MAP33)
if ( allclearsector )
{
bool insector = false;
for ( int i=0; i<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || !players[i].mo ) continue;
if ( players[i].mo.CurSector.Index() == allclearsector )
insector = true;
}
if ( !insector ) return;
}
if ( !mapclear && (restartmus > 0) )
{
restartmus--;

View file

@ -542,7 +542,7 @@ Class SWWMStatusBar : BaseStatusBar
int len;
double xx, yy;
double deadtimer = (goner?goner.deadtimer:demo.deadtimer)+fractic;
if ( goner || (demo.player.viewheight <= 6) )
if ( goner || (deadtimer > 0) )
{
double dimalph = goner?1.:min(deadtimer/80.,.8);
Screen.Dim("Black",dimalph,0,0,Screen.GetWidth(),Screen.GetHeight());

View file

@ -198,6 +198,7 @@ extend Class Demolitionist
override void PlayerThink()
{
if ( player.playerstate != PST_DEAD ) deadtimer = 0;
oldangles = (angle,pitch,roll);
if ( player && (player.mo == self) && (player.playerstate != PST_DEAD) && (player.cmd.buttons&BT_USE) )
{
@ -285,70 +286,66 @@ extend Class Demolitionist
if ( multiplayer || level.AllowRespawn || sv_singleplayerrespawn || G_SkillPropertyInt(SKILLP_PlayerRespawn) )
bSolid = false;
else bSolid = true;
if ( player.viewheight <= 6 )
deadtimer++;
if ( (deadtimer == 60) && (player == players[consoleplayer]) )
A_StartSound("demolitionist/youdied",CHAN_DEMOVOICE,CHANF_OVERLAP|CHANF_UI);
if ( !hnd ) hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( multiplayer || level.AllowRespawn || sv_singleplayerrespawn || G_SkillPropertyInt(SKILLP_PlayerRespawn) )
{
deadtimer++;
if ( (deadtimer == 60) && (player == players[consoleplayer]) )
A_StartSound("demolitionist/youdied",CHAN_DEMOVOICE,CHANF_OVERLAP|CHANF_UI);
if ( !hnd ) hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( multiplayer || level.AllowRespawn || sv_singleplayerrespawn || G_SkillPropertyInt(SKILLP_PlayerRespawn) )
// standard behaviour, respawn normally
if ( (((player.cmd.buttons&BT_USE) || ((deathmatch || alwaysapplydmflags) && sv_forcerespawn)) && !sv_norespawn)
&& ((Level.maptime >= player.respawn_time) || ((player.cmd.buttons&BT_USE) && !player.Bot)) )
{
// standard behaviour, respawn normally
if ( (((player.cmd.buttons&BT_USE) || ((deathmatch || alwaysapplydmflags) && sv_forcerespawn)) && !sv_norespawn)
&& ((Level.maptime >= player.respawn_time) || ((player.cmd.buttons&BT_USE) && !player.Bot)) )
{
player.cls = null;
player.playerstate = PST_REBORN;
if ( special1 > 2 ) special1 = 0;
}
}
else if ( (player.cmd.buttons&BT_USE) && (deadtimer > 120) )
{
// reload save
player.cls = null;
player.playerstate = PST_ENTER;
player.playerstate = PST_REBORN;
if ( special1 > 2 ) special1 = 0;
}
else if ( (player.cmd.buttons&BT_ATTACK) && (deadtimer > 120) && (!hnd || !hnd.gdat.disablerevive) && swwm_revive )
}
else if ( (player.cmd.buttons&BT_USE) && (deadtimer > 120) )
{
// reload save
player.cls = null;
player.playerstate = PST_ENTER;
if ( special1 > 2 ) special1 = 0;
}
else if ( (player.cmd.buttons&BT_ATTACK) && (deadtimer > 120) && (!hnd || !hnd.gdat.disablerevive) && swwm_revive )
{
// reboot (if possible)
if ( !FindInventory("ReviveCooldown") && (((swwm_revivecooldown >= 0) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 4)) || !hasrevived) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 6) )
{
// reboot (if possible)
if ( !FindInventory("ReviveCooldown") && (((swwm_revivecooldown >= 0) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 4)) || !hasrevived) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 6) )
if ( hasrevived ) SWWMUtility.MarkAchievement("sekiro",player);
hasrevived = true;
player.Resurrect();
player.damagecount = 0;
player.bonuscount = 0;
player.poisoncount = 0;
blinktime = 30;
SetState(FindState("Spawn")+1); // skip tweening
roll = 0;
let s = Spawn("DemolitionistShockwave",pos);
s.target = self;
s.special1 = 30;
ReactionTime = 17;
A_Stop();
A_AlertMonsters(swwm_uncapalert?0:2500);
if ( player == players[consoleplayer] )
{
if ( hasrevived ) SWWMUtility.MarkAchievement("sekiro",player);
hasrevived = true;
player.Resurrect();
player.damagecount = 0;
player.bonuscount = 0;
player.poisoncount = 0;
blinktime = 30;
SetState(FindState("Spawn")+1); // skip tweening
roll = 0;
let s = Spawn("DemolitionistShockwave",pos);
s.target = self;
s.special1 = 30;
ReactionTime = 17;
A_Stop();
A_AlertMonsters(swwm_uncapalert?0:2500);
if ( player == players[consoleplayer] )
{
A_StartSound("demolitionist/hardland",CHAN_FOOTSTEP,CHANF_OVERLAP);
A_StartSound("demolitionist/hardland",CHAN_FOOTSTEP,CHANF_OVERLAP,pitch:.7);
A_StartSound("demolitionist/hardland",CHAN_FOOTSTEP,CHANF_OVERLAP,pitch:.4);
}
lastbump *= 1.5;
SWWMHandler.DoFlash(self,Color(255,255,255,255),10);
SWWMHandler.DoFlash(self,Color(255,128,192,255),30);
if ( special1 > 2 ) special1 = 0;
if ( (swwm_revivecooldown > 0) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 4) )
GiveInventory("ReviveCooldown",1);
}
else if ( level.maptime > revivefail )
{
if ( player == players[consoleplayer] ) A_StartSound("menu/fail",CHAN_ITEM,CHANF_UI);
revivefail = level.maptime+120;
A_StartSound("demolitionist/hardland",CHAN_FOOTSTEP,CHANF_OVERLAP);
A_StartSound("demolitionist/hardland",CHAN_FOOTSTEP,CHANF_OVERLAP,pitch:.7);
A_StartSound("demolitionist/hardland",CHAN_FOOTSTEP,CHANF_OVERLAP,pitch:.4);
}
lastbump *= 1.5;
SWWMHandler.DoFlash(self,Color(255,255,255,255),10);
SWWMHandler.DoFlash(self,Color(255,128,192,255),30);
if ( special1 > 2 ) special1 = 0;
if ( (swwm_revivecooldown > 0) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 4) )
GiveInventory("ReviveCooldown",1);
}
else if ( level.maptime > revivefail )
{
if ( player == players[consoleplayer] ) A_StartSound("menu/fail",CHAN_ITEM,CHANF_UI);
revivefail = level.maptime+120;
}
}
else deadtimer = 0;
}
}