From 308636000f048ad9c4fbf21ee974565535a65582 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Sun, 24 Dec 2023 17:56:05 +0100 Subject: [PATCH] More Eviternity 2 MAP33 compat work. --- language.version | 4 +- zscript/compat/swwm_compat.zsc | 41 ++++++++ zscript/handler/swwm_handler_worldload.zsc | 8 ++ zscript/handler/swwm_handler_worldtick.zsc | 13 +++ zscript/hud/swwm_hud.zsc | 2 +- zscript/player/swwm_player_think.zsc | 107 ++++++++++----------- 6 files changed, 117 insertions(+), 58 deletions(-) diff --git a/language.version b/language.version index 254fbc9f3..cd6fe7775 100644 --- a/language.version +++ b/language.version @@ -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-"; diff --git a/zscript/compat/swwm_compat.zsc b/zscript/compat/swwm_compat.zsc index 357fa4b76..9562a5730 100644 --- a/zscript/compat/swwm_compat.zsc +++ b/zscript/compat/swwm_compat.zsc @@ -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 ) { diff --git a/zscript/handler/swwm_handler_worldload.zsc b/zscript/handler/swwm_handler_worldload.zsc index d6abc1085..8283486de 100644 --- a/zscript/handler/swwm_handler_worldload.zsc +++ b/zscript/handler/swwm_handler_worldload.zsc @@ -51,6 +51,7 @@ extend Class SWWMHandler bool maphaskeys; bool nogroundanchor; + int allclearsector; // weird optimization Array 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 skipme; skipme.Clear(); diff --git a/zscript/handler/swwm_handler_worldtick.zsc b/zscript/handler/swwm_handler_worldtick.zsc index 37ec33e1f..f43b2dc94 100644 --- a/zscript/handler/swwm_handler_worldtick.zsc +++ b/zscript/handler/swwm_handler_worldtick.zsc @@ -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 0) ) { restartmus--; diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index 38b37709f..b3f1c6301 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -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()); diff --git a/zscript/player/swwm_player_think.zsc b/zscript/player/swwm_player_think.zsc index 84c7a8ded..915e6a9dc 100644 --- a/zscript/player/swwm_player_think.zsc +++ b/zscript/player/swwm_player_think.zsc @@ -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; } }