diff --git a/README.md b/README.md index 8dda62e28..b6c08e3e0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This is mainly a project that focuses on reworking the very outdated platform fo It will contain both much needed fixes that are simply unable to be implemented on the older sourcemod versions as well as incompatible and outdated files being updated to working versions. > **Included Matchmodes:** -* **Zonemod 2.8.4** +* **Zonemod 2.8.7** * **Zonemod Hunters** * **Zonemod Retro** * **NeoMod 0.4a** diff --git a/addons/sourcemod/configs/matchmodes.txt b/addons/sourcemod/configs/matchmodes.txt index 381b9061e..4e5e4870e 100644 --- a/addons/sourcemod/configs/matchmodes.txt +++ b/addons/sourcemod/configs/matchmodes.txt @@ -4,11 +4,11 @@ { "zonemod" { - "name" "ZoneMod 2.8.6" + "name" "ZoneMod 2.8.7" } "zoneretro" { - "name" "ZoneMod Retro 2.8.6" + "name" "ZoneMod Retro 2.8.7" } "zm3v3" { @@ -109,7 +109,7 @@ { "zonehunters" { - "name" "ZoneHunters 2.8.6" + "name" "ZoneHunters 2.8.7" } "zh3v3" { diff --git a/addons/sourcemod/plugins/optional/l4d2_godframes_control_merge.smx b/addons/sourcemod/plugins/optional/l4d2_godframes_control_merge.smx index 84c260729..d583b2272 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_godframes_control_merge.smx and b/addons/sourcemod/plugins/optional/l4d2_godframes_control_merge.smx differ diff --git a/addons/sourcemod/scripting/l4d2_godframes_control_merge.sp b/addons/sourcemod/scripting/l4d2_godframes_control_merge.sp index cebfa51ab..ec0e3f25e 100644 --- a/addons/sourcemod/scripting/l4d2_godframes_control_merge.sp +++ b/addons/sourcemod/scripting/l4d2_godframes_control_merge.sp @@ -52,6 +52,8 @@ ConVar g_hSmoker = null, g_hJockey = null, g_hCharger = null, + g_hChargerStagger = null, + g_hChargerFlags = null, g_hSpitFlags = null, g_hCommonFlags = null, g_hGodframeGlows = null, @@ -92,7 +94,11 @@ bool //fake godframes float - g_fFakeGodframeEnd[MAXPLAYERS + 1] = {0.0, ...}; + g_fFakeGodframeEnd[MAXPLAYERS + 1] = {0.0, ...}, + g_fFakeChargeGodframeEnd[MAXPLAYERS + 1] = {0.0, ...}; + +Handle + g_hTimer[MAXPLAYERS + 1] = {null, ...}; int g_iLastSI[MAXPLAYERS + 1] = {0, ...}, @@ -115,8 +121,8 @@ public APLRes AskPluginLoad2(Handle hMyself, bool bLate, char[] sError, int iErr public Plugin myinfo = { name = "L4D2 Godframes Control combined with FF Plugins", - author = "Stabby, CircleSquared, Tabun, Visor, dcx, Sir, Spoon, A1m`", - version = "0.6.8", + author = "Stabby, CircleSquared, Tabun, Visor, dcx, Sir, Spoon, A1m`, Sir", + version = "0.6.9", description = "Allows for control of what gets godframed and what doesnt along with integrated FF Support from l4d2_survivor_ff (by dcx and Visor) and l4d2_shotgun_ff (by Visor)" }; @@ -135,6 +141,8 @@ public void OnPluginStart() g_hJockey = CreateConVar("gfc_jockey_duration", "0.0", "How long should godframes after a ride last?", _, true, 0.0, true, 3.0); g_hSmoker = CreateConVar("gfc_smoker_duration", "0.0", "How long should godframes after a pull or choke last?", _, true, 0.0, true, 3.0); g_hCharger = CreateConVar("gfc_charger_duration", "2.1", "How long should godframes after a pummel last?", _, true, 0.0, true, 3.0); + g_hChargerStagger = CreateConVar("gfc_charger_stagger_extra_time", "0.0", "Additional godframe time before damage from ChargerFlags is allowed.", _, true, 0.0, true, 3.0); + g_hChargerFlags = CreateConVar("gfc_charger_stagger_flags", "0", "What will be affected by extra charger stagger protection time. 1 - Common. 2 - Spit.", _, true, 0.0, true, 3.0); g_hSpitFlags = CreateConVar("gfc_spit_zc_flags", "6", "Which classes will be affected by extra spit protection time. 1 - Hunter. 2 - Smoker. 4 - Jockey. 8 - Charger.", _, true, 0.0, true, 15.0); g_hCommonFlags= CreateConVar("gfc_common_zc_flags", "0", "Which classes will be affected by extra common protection time. 1 - Hunter. 2 - Smoker. 4 - Jockey. 8 - Charger.", _, true, 0.0, true, 15.0); @@ -169,6 +177,10 @@ public void OnPluginStart() HookEvent("pounce_end", PostSurvivorRelease); HookEvent("jockey_ride_end", PostSurvivorRelease); HookEvent("charger_pummel_end", PostSurvivorRelease); + + //Pass over stuff on passover to and from bots + HookEvent("bot_player_replace", Event_Replaced); + HookEvent("player_bot_replace", Event_Replaced); HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy); @@ -194,7 +206,9 @@ public void Event_RoundStart(Event hEvent, const char[] sEventName, bool bDontBr { for (int i = 1; i <= MaxClients; i++) { //clear both fake and real just because g_fFakeGodframeEnd[i] = 0.0; + g_fFakeChargeGodframeEnd[i] = 0.0; g_bBuckshot[i] = false; + if (g_hTimer[i] != null) delete g_hTimer[i]; } } @@ -223,15 +237,41 @@ public void PostSurvivorRelease(Event hEvent, const char[] sEventName, bool bDon g_iLastSI[iVictim] = 8; } - if (g_fFakeGodframeEnd[iVictim] > fNow && g_hGodframeGlows.BoolValue) { - // make player transparent/red while godframed - SetEntityRenderMode(iVictim, RENDER_GLOW); - SetEntityRenderColor(iVictim, 255, 0, 0, 200); - - CreateTimer(g_fFakeGodframeEnd[iVictim] - fNow, Timed_ResetGlow, iVictim, TIMER_FLAG_NO_MAPCHANGE); + SetGodFrameGlows(iVictim); +} + +public void L4D2_OnStagger_Post(int client, int source) +{ + // Charger Impact handling, source is always null. + if (IsValidSurvivor(client) && source == -1 && g_hChargerStagger.FloatValue > 0.0) + { + float fNow = GetGameTime(); + + // In case of multi-charger configs/modes. + if (g_fFakeChargeGodframeEnd[client] > fNow) + fNow = g_fFakeChargeGodframeEnd[client]; + + g_fFakeChargeGodframeEnd[client] = fNow += g_hChargerStagger.FloatValue; } } +public void Event_Replaced(Event hEvent, char[] name, bool dontBroadcast) +{ + bool bBotReplaced = (!strncmp(name, "b", 1)); + int replaced = bBotReplaced ? GetClientOfUserId(hEvent.GetInt("bot")) : GetClientOfUserId(hEvent.GetInt("player")); + int replacer = bBotReplaced ? GetClientOfUserId(hEvent.GetInt("player")) : GetClientOfUserId(hEvent.GetInt("bot")); + + g_fFakeGodframeEnd[replacer] = g_fFakeGodframeEnd[replaced]; + g_fFakeChargeGodframeEnd[replacer] = g_fFakeChargeGodframeEnd[replaced]; + g_iLastSI[replacer] = g_iLastSI[replaced]; + + // Use 500 IQ to re-create 'accurate' timer on the replacer. + if (g_hTimer[replaced] != null) delete g_hTimer[replaced]; + float fRemainingFakeGodFrames = g_fFakeGodframeEnd[replacer] - GetGameTime(); + if (fRemainingFakeGodFrames > 0.0) + SetGodFrameGlows(replacer); +} + public void OnClientPutInServer(int iClient) { SDKHook(iClient, SDKHook_OnTakeDamage, OnTakeDamage); @@ -287,12 +327,22 @@ public Action OnTakeDamage(int iVictim, int &iAttacker, int &iInflictor, float & float fTimeLeft = g_fFakeGodframeEnd[iVictim] - GetGameTime(); - if (StrEqual(sClassname, "infected") && (g_iLastSI[iVictim] & g_hCommonFlags.IntValue)){ //commons + if (StrEqual(sClassname, "infected") && (g_iLastSI[iVictim] & g_hCommonFlags.IntValue)) { //commons fTimeLeft += g_hCommon.FloatValue; + + if (1 & g_hChargerFlags.IntValue && fTimeLeft <= 0.0) { + float charginTime = g_fFakeChargeGodframeEnd[iVictim] - GetGameTime(); + fTimeLeft = charginTime > 0.0 ? charginTime : fTimeLeft; + } } if (StrEqual(sClassname, "insect_swarm") && (g_iLastSI[iVictim] & g_hSpitFlags.IntValue)) { //spit fTimeLeft += g_hSpit.FloatValue; + + if (2 & g_hChargerFlags.IntValue && fTimeLeft <= 0.0) { + float charginTime = g_fFakeChargeGodframeEnd[iVictim] - GetGameTime(); + fTimeLeft = charginTime > 0.0 ? charginTime : fTimeLeft; + } } if (IsValidSurvivor(iAttacker)) { //friendly fire @@ -967,13 +1017,23 @@ public int Native_GiveClientGodFrames(Handle hPlugin, int iNumParams) g_fFakeGodframeEnd[iClient] = fNow + fGodFrameTime; //godFrameTime g_iLastSI[iClient] = iAttackerClass; //attackerClass - if (g_fFakeGodframeEnd[iClient] > fNow && g_hGodframeGlows.BoolValue) { - // make player transparent/red while godframed - SetEntityRenderMode(iClient, RENDER_GLOW); - SetEntityRenderColor(iClient, 255, 0, 0, 200); - - CreateTimer(g_fFakeGodframeEnd[iClient] - fNow, Timed_ResetGlow, iClient, TIMER_FLAG_NO_MAPCHANGE); - } + SetGodFrameGlows(iClient); return 1; } + +void SetGodFrameGlows(int client) +{ + float fNow = GetGameTime(); + if (g_fFakeGodframeEnd[client] > fNow && g_hGodframeGlows.BoolValue) + { + // make player transparent/red while godframed + SetEntityRenderMode(client, RENDER_GLOW); + SetEntityRenderColor(client, 255, 0, 0, 200); + + if (g_hTimer[client] != null) + delete g_hTimer[client]; + + g_hTimer[client] = CreateTimer(g_fFakeGodframeEnd[client] - fNow, Timed_ResetGlow, client, TIMER_FLAG_NO_MAPCHANGE); + } +} \ No newline at end of file diff --git a/cfg/cfgogl/zh1v1/confogl.cfg b/cfg/cfgogl/zh1v1/confogl.cfg index 6a251c095..68faabe3f 100644 --- a/cfg/cfgogl/zh1v1/confogl.cfg +++ b/cfg/cfgogl/zh1v1/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "1v1 [Zone]Hunters v2.8.6" +l4d_ready_cfg_name "1v1 [Zone]Hunters v2.8.7" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zh2v2/confogl.cfg b/cfg/cfgogl/zh2v2/confogl.cfg index 929d305d1..09dafc53c 100644 --- a/cfg/cfgogl/zh2v2/confogl.cfg +++ b/cfg/cfgogl/zh2v2/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "2v2 [Zone]Hunters v2.8.6" +l4d_ready_cfg_name "2v2 [Zone]Hunters v2.8.7" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zh3v3/confogl.cfg b/cfg/cfgogl/zh3v3/confogl.cfg index d831afcd1..1ff85df5c 100644 --- a/cfg/cfgogl/zh3v3/confogl.cfg +++ b/cfg/cfgogl/zh3v3/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "3v3 [Zone]Hunters v2.8.6" +l4d_ready_cfg_name "3v3 [Zone]Hunters v2.8.7" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zm1v1/confogl.cfg b/cfg/cfgogl/zm1v1/confogl.cfg index fbaaab997..919f01c72 100644 --- a/cfg/cfgogl/zm1v1/confogl.cfg +++ b/cfg/cfgogl/zm1v1/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "1v1 Zonemod v2.8.6" +l4d_ready_cfg_name "1v1 Zonemod v2.8.7" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zm2v2/confogl.cfg b/cfg/cfgogl/zm2v2/confogl.cfg index 93be1eb0f..e482846cb 100644 --- a/cfg/cfgogl/zm2v2/confogl.cfg +++ b/cfg/cfgogl/zm2v2/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "2v2 Zonemod v2.8.6" +l4d_ready_cfg_name "2v2 Zonemod v2.8.7" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zm3v3/confogl.cfg b/cfg/cfgogl/zm3v3/confogl.cfg index 12d1e3d12..81117eb55 100644 --- a/cfg/cfgogl/zm3v3/confogl.cfg +++ b/cfg/cfgogl/zm3v3/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "3v3 Zonemod v2.8.6" +l4d_ready_cfg_name "3v3 Zonemod v2.8.7" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zonehunters/confogl.cfg b/cfg/cfgogl/zonehunters/confogl.cfg index ef1187831..f03da2b97 100644 --- a/cfg/cfgogl/zonehunters/confogl.cfg +++ b/cfg/cfgogl/zonehunters/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "[Zone]Hunters v2.8.6" +l4d_ready_cfg_name "[Zone]Hunters v2.8.7" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zonemod/confogl.cfg b/cfg/cfgogl/zonemod/confogl.cfg index f930a6637..67e4efa4d 100644 --- a/cfg/cfgogl/zonemod/confogl.cfg +++ b/cfg/cfgogl/zonemod/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "ZoneMod v2.8.6" +l4d_ready_cfg_name "ZoneMod v2.8.7" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. @@ -17,8 +17,8 @@ confogl_addcvar confogl_pills_limit 2 // Limits the number of pain pills on each // ZoneMod 4v4 Cvars confogl_addcvar z_common_limit 30 -confogl_addcvar z_ghost_delay_min 15 -confogl_addcvar z_ghost_delay_max 15 +confogl_addcvar z_ghost_delay_min 16 +confogl_addcvar z_ghost_delay_max 16 confogl_addcvar z_mega_mob_size 50 confogl_addcvar z_mob_spawn_min_size 15 confogl_addcvar z_mob_spawn_max_size 15 diff --git a/cfg/cfgogl/zonemod/shared_plugins.cfg b/cfg/cfgogl/zonemod/shared_plugins.cfg index b793c1c2f..b0068a43a 100644 --- a/cfg/cfgogl/zonemod/shared_plugins.cfg +++ b/cfg/cfgogl/zonemod/shared_plugins.cfg @@ -137,6 +137,7 @@ sm plugins load optional/panel_text.smx sm plugins load optional/spechud.smx sm plugins load optional/slots_vote.smx sm plugins load optional/witch_and_tankifier.smx +sm plugins load optional/l4d2_magnum_incap.smx // Letzzzz go. sm plugins load confoglcompmod.smx diff --git a/cfg/cfgogl/zonemod/shared_settings.cfg b/cfg/cfgogl/zonemod/shared_settings.cfg index 2b51f5c54..03361237a 100644 --- a/cfg/cfgogl/zonemod/shared_settings.cfg +++ b/cfg/cfgogl/zonemod/shared_settings.cfg @@ -74,6 +74,9 @@ confogl_addcvar infected_fire_immunity 3 // [l4d2_nosecondchances.smx] confogl_addcvar bot_kick_delay 0 +// [l4d2_magnum_incap.smx] +confogl_addcvar l4d2_replace_magnum_incap 2 + // [l4d2_saferoom_item_remove.smx] confogl_addcvar sm_safeitemkill_saferooms 3 confogl_addcvar sm_safeitemkill_items 13 @@ -160,6 +163,8 @@ confogl_addcvar gfc_jockey_duration 0 confogl_addcvar gfc_smoker_duration 0 confogl_addcvar gfc_charger_duration 2.1 // frames: 85, fps 30, length: 2.833 confogl_addcvar gfc_long_charger_duration 3.1 // wall-slam: 3.867, ground-slam: 3.967 +confogl_addcvar gfc_charger_stagger_extra_time 0.5 +confogl_addcvar gfc_charger_stagger_flags 2 confogl_addcvar gfc_common_zc_flags 9 confogl_addcvar gfc_spit_zc_flags 6 confogl_addcvar gfc_godframe_glows 1 diff --git a/cfg/cfgogl/zoneretro/confogl.cfg b/cfg/cfgogl/zoneretro/confogl.cfg index cee781555..4862fefe9 100644 --- a/cfg/cfgogl/zoneretro/confogl.cfg +++ b/cfg/cfgogl/zoneretro/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "ZoneMod Retro v2.8.6" +l4d_ready_cfg_name "ZoneMod Retro v2.8.7" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config.