From 3e54ce676d62d2ffa1673108204850d5a3a960b8 Mon Sep 17 00:00:00 2001 From: Mentrillum <42941613+Mentrillum@users.noreply.github.com> Date: Mon, 8 Mar 2021 01:40:45 -0700 Subject: [PATCH] 1.6.04 --- .../configs/sf2/profiles_documentation.cfg | 17 ++ addons/sourcemod/scripting/sf2.sp | 38 ++-- addons/sourcemod/scripting/sf2/client.sp | 164 ++++++++-------- addons/sourcemod/scripting/sf2/menus.sp | 1 + .../sourcemod/scripting/sf2/npc/npc_chaser.sp | 5 +- addons/sourcemod/scripting/sf2/profiles.sp | 6 - .../sourcemod/scripting/sf2/specialround.sp | 182 +++++------------- addons/sourcemod/translations/sf2.phrases.txt | 2 +- 8 files changed, 174 insertions(+), 241 deletions(-) diff --git a/addons/sourcemod/configs/sf2/profiles_documentation.cfg b/addons/sourcemod/configs/sf2/profiles_documentation.cfg index 958bd226..67417d0a 100644 --- a/addons/sourcemod/configs/sf2/profiles_documentation.cfg +++ b/addons/sourcemod/configs/sf2/profiles_documentation.cfg @@ -987,6 +987,23 @@ // "cloak_off_sound" - String (256) - Determines the sound that plays when the boss decloaks. Defaults to "weapons/medi_shield_retract.wav". // // ============================================================= +// PROXY WEAPONS +// ============================================================= +// This system is intended to provide Proxies with a single additional weapon to make life harder for RED. +// Stats are based on the TF2Items format for assigning attributes. An example: " ; ". +// ";" is used as the divider between each number in a sequence. There can only be a set amount of attributes assigned (8?). +// Here is a list of resources to help with obtaining the required data for this system. +// Attribute List: https://wiki.teamfortress.com/wiki/List_of_item_attributes +// Item Index & Class List: https://wiki.alliedmods.net/Team_fortress_2_item_definition_indexes +// Proxies will gain their weapons 1 second after spawning to avoid any possible item restrictions. +// ----------------------------------------------------------------------------------------------------------------------------------------------------- +// "proxies_weapon" - Boolean (0/1) - Determins if the boss provides weapons to it's proxies. Defaults to ("0"). +// +// "proxies_weapon_class_" - String (128) - Determins the class type for the weapon. (Must be set). +// "proxies_weapon_stats_" - String (128) - Determins the attribute stats for the weapon. (Optional). +// "proxies_weapon_index_" - Int - Determins the index for the weapon. (Must be set & must match the weapon slot). +// +// ============================================================= // DAMAGE EFFECTS // ============================================================= // Upon attacking a boss, these values will be checked to determin if the boss should apply some form of condition to the player. diff --git a/addons/sourcemod/scripting/sf2.sp b/addons/sourcemod/scripting/sf2.sp index ac6a3d01..bd04b085 100644 --- a/addons/sourcemod/scripting/sf2.sp +++ b/addons/sourcemod/scripting/sf2.sp @@ -7,6 +7,7 @@ #include #include #include +#include #pragma semicolon 1 @@ -32,8 +33,8 @@ bool steamworks; #include #pragma newdecls required -#define PLUGIN_VERSION "1.6.03 Modified" -#define PLUGIN_VERSION_DISPLAY "1.6.03 Modified" +#define PLUGIN_VERSION "1.6.04 Modified" +#define PLUGIN_VERSION_DISPLAY "1.6.04 Modified" #define TFTeam_Spectator 1 #define TFTeam_Red 2 @@ -163,7 +164,7 @@ public Plugin myinfo = #define NULLSOUND "misc/null.wav" -//#define NINETYSMUSIC "slender/sf2modified_runninginthe90s.wav" +#define NINETYSMUSIC "slender/sf2modified_runninginthe90s_v2.wav" #define TRIPLEBOSSESMUSIC "slender/sf2modified_triplebosses_v2.wav" #define TRAP_DEPLOY "slender/modified_traps/beartrap/trap_deploy.mp3" @@ -619,10 +620,9 @@ Handle g_hPlayer20DollarsMusicTimer[MAXPLAYERS + 1][MAX_BOSSES]; int g_iPlayer20DollarsMusicMaster[MAXPLAYERS + 1] = { -1, ... }; -//char g_strPlayer90sMusic[MAXPLAYERS + 1][PLATFORM_MAX_PATH]; -//float g_flPlayer90sMusicVolumes[MAXPLAYERS + 1]; -//Handle g_hPlayer90sMusicTimer[MAXPLAYERS + 1]; -//int g_iPlayer90sMusicMaster[MAXPLAYERS + 1]; +char g_strPlayer90sMusic[MAXPLAYERS + 1][PLATFORM_MAX_PATH]; +float g_flPlayer90sMusicVolumes[MAXPLAYERS + 1]; +Handle g_hPlayer90sMusicTimer[MAXPLAYERS + 1]; SF2RoundState g_iRoundState = SF2RoundState_Invalid; @@ -1709,16 +1709,6 @@ static void StartPlugin() hCvar = FindConVar("tf_base_boss_max_turn_rate"); if (hCvar != view_as(INVALID_HANDLE) && GetConVarInt(hCvar) < 720) SetConVarInt(hCvar, 720); - //New CollisionHooks, or replacement, I don't judge. - hCvar = FindConVar("tf_avoidteammates"); - if (hCvar != view_as(INVALID_HANDLE)) SetConVarBool(hCvar, true); - - hCvar = FindConVar("tf_avoidteammates_pushaway"); - if (hCvar != view_as(INVALID_HANDLE)) SetConVarBool(hCvar, false); - - hCvar = FindConVar("sv_noclipspeed"); - if (hCvar != view_as(INVALID_HANDLE) && GetConVarInt(hCvar) < 2) SetConVarInt(hCvar, 2); - g_flGravity = GetConVarFloat(g_cvGravity); g_b20Dollars = GetConVarBool(g_cv20Dollars); @@ -1895,7 +1885,7 @@ static void PrecacheStuff() PrecacheSound2(SNATCHER_APOLLYON_2); PrecacheSound2(SNATCHER_APOLLYON_3); - //PrecacheSound2(NINETYSMUSIC); + PrecacheSound2(NINETYSMUSIC); PrecacheSound2(TRIPLEBOSSESMUSIC); PrecacheSound2(TRAP_CLOSE); @@ -2059,7 +2049,7 @@ public void CleanTimerHandles() g_hPlayerCampingTimer[i] = INVALID_HANDLE; g_hPlayerBlinkTimer[i] = INVALID_HANDLE; g_hPlayerMusicTimer[i] = INVALID_HANDLE; - //g_hPlayer90sMusicTimer[i] = INVALID_HANDLE; + g_hPlayer90sMusicTimer[i] = INVALID_HANDLE; g_hPlayerFlashlightBatteryTimer[i] = INVALID_HANDLE; } for (int iBossIndex = 0; iBossIndex < MAX_BOSSES; iBossIndex++) @@ -5268,7 +5258,7 @@ public void OnClientPutInServer(int iClient) ClientChaseMusicSeeReset(iClient); ClientAlertMusicReset(iClient); Client20DollarsMusicReset(iClient); - //Client90sMusicReset(iClient); + Client90sMusicReset(iClient); ClientMusicReset(iClient); ClientResetProxy(iClient); ClientResetHints(iClient); @@ -6604,7 +6594,7 @@ void SetPageCount(int iNum) { flAverageTime += (flTimes[i3]/GetRandomFloat(10.0, 20.0)); } - PrintToChatAll("%f", flAverageTime); + PrintToChatAll("Time before bosses spawn: %f seconds", flAverageTime); CreateTimer(flAverageTime, Timer_SlaughterRunSpawnBosses, _, TIMER_FLAG_NO_MAPCHANGE); } } @@ -7405,7 +7395,7 @@ public Action Event_PlayerSpawn(Handle event, const char[] name, bool dB) ClientChaseMusicSeeReset(iClient); ClientAlertMusicReset(iClient); Client20DollarsMusicReset(iClient); - //Client90sMusicReset(iClient); + Client90sMusicReset(iClient); ClientMusicReset(iClient); ClientResetProxy(iClient); ClientResetHints(iClient); @@ -7486,7 +7476,7 @@ public Action Event_PlayerSpawn(Handle event, const char[] name, bool dB) ClientChaseMusicSeeReset(iClient); ClientAlertMusicReset(iClient); Client20DollarsMusicReset(iClient); - //Client90sMusicReset(iClient); + Client90sMusicReset(iClient); ClientMusicReset(iClient); ClientResetProxy(iClient); ClientResetHints(iClient); @@ -7911,7 +7901,7 @@ public Action Event_PlayerDeath(Handle event, const char[] name, bool dB) ClientChaseMusicSeeReset(iClient); ClientAlertMusicReset(iClient); Client20DollarsMusicReset(iClient); - //Client90sMusicReset(iClient); + Client90sMusicReset(iClient); ClientMusicReset(iClient); ClientResetFlashlight(iClient); diff --git a/addons/sourcemod/scripting/sf2/client.sp b/addons/sourcemod/scripting/sf2/client.sp index 25237450..be8a5084 100644 --- a/addons/sourcemod/scripting/sf2/client.sp +++ b/addons/sourcemod/scripting/sf2/client.sp @@ -124,6 +124,54 @@ public MRESReturn Hook_ClientWantsLagCompensationOnEntity(int client, Handle hRe return MRES_Supercede; } +public Action CH_ShouldCollide(int ent1,int ent2, bool &result) +{ + SF2RoundState state = GetRoundState(); + if (state == SF2RoundState_Intro || state == SF2RoundState_Outro) return Plugin_Continue; + + if (MaxClients >= ent1 > 0) + { + if (IsClientInGhostMode(ent1)) + { + result = false; + return Plugin_Changed; + } + } + if (MaxClients >= ent2 > 0) + { + if (IsClientInGhostMode(ent2)) + { + result = false; + return Plugin_Changed; + } + } + return Plugin_Continue; +} + +public Action CH_PassFilter(int ent1,int ent2, bool &result) +{ + SF2RoundState state = GetRoundState(); + if (state == SF2RoundState_Intro || state == SF2RoundState_Outro) return Plugin_Continue; + + if (MaxClients >= ent1 > 0) + { + if (IsClientInGhostMode(ent1)) + { + result = false; + return Plugin_Changed; + } + } + if (MaxClients >= ent2 > 0) + { + if (IsClientInGhostMode(ent2)) + { + result = false; + return Plugin_Changed; + } + } + return Plugin_Continue; +} + float ClientGetScareBoostEndTime(int client) { return g_flPlayerScareBoostEndTime[client]; @@ -185,6 +233,7 @@ public void Hook_ClientPreThink(int client) if (!g_bPlayerProxy[client] && GetClientTeam(client) == TFTeam_Red) { + if (TF2_IsPlayerInCondition(client,TFCond_Disguised)) TF2_RemoveCondition(client,TFCond_Disguised); if (iRoundState == 4) { if (IsClientInDeathCam(client)) @@ -388,7 +437,7 @@ public void Hook_ClientPreThink(int client) } else { - SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", flSprintSpeed*2.5); + if (SF_IsBoxingMap() || SF_IsRaidMap()) SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", flSprintSpeed*2.5); } SetEntPropFloat(client, Prop_Send, "m_flCurrentTauntMoveSpeed", flSprintSpeed-220.0); } @@ -414,7 +463,7 @@ public void Hook_ClientPreThink(int client) } else { - SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", flWalkSpeed*2.5); + if (SF_IsBoxingMap() || SF_IsRaidMap()) SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", flWalkSpeed*2.5); } SetEntPropFloat(client, Prop_Send, "m_flCurrentTauntMoveSpeed", flWalkSpeed-75.0); } @@ -1064,7 +1113,7 @@ void ClientEscape(int client) ClientChaseMusicSeeReset(client); ClientAlertMusicReset(client); Client20DollarsMusicReset(client); - //Client90sMusicReset(client); + Client90sMusicReset(client); ClientMusicReset(client); ClientResetProxy(client); ClientResetHints(client); @@ -2982,7 +3031,7 @@ void ClientStartSprint(int client) TriggerTimer(g_hPlayerSprintTimer[client], true); if (SF_SpecialRound(SPECIALROUND_RUNNINGINTHE90S)) { - //Client90sMusicStart(client); + Client90sMusicStart(client); } SDKHook(client, SDKHook_PreThink, Hook_ClientSprintingPreThink); @@ -3029,7 +3078,7 @@ void ClientStopSprint(int client) ClientSprintTimer(client, true); if (SF_SpecialRound(SPECIALROUND_RUNNINGINTHE90S)) { - //Client90sMusicStop(client); + Client90sMusicStop(client); } SDKHook(client, SDKHook_PreThink, Hook_ClientRechargeSprintPreThink); @@ -3564,63 +3613,27 @@ public Action Timer_GiveWeaponAll(Handle timer, any userid) if (!IsValidClient(client) || !g_bPlayerProxy[client]) return; - int iBossIndex = g_iPlayerProxyMaster[client]; + int iBossIndex = NPCGetFromUniqueID(g_iPlayerProxyMaster[client]); - if (NPCGetUniqueID(iBossIndex) == -1) return; + if (iBossIndex == -1) return; char sProfile[SF2_MAX_PROFILE_NAME_LENGTH]; NPCGetProfile(iBossIndex, sProfile, sizeof(sProfile)); - if (view_as(GetProfileNum(sProfile,"proxies_weapon",0))) - { - int iWeaponIndex; - char sWeaponName[PLATFORM_MAX_PATH], sWeaponStats[PLATFORM_MAX_PATH], sClassName[64], sSectionName[64], sWeaponStatsNew[PLATFORM_MAX_PATH]; - TF2_GetClassName(TF2_GetPlayerClass(client), sClassName, sizeof(sClassName)); - FormatEx(sSectionName, sizeof(sSectionName), "proxies_weapon_class_%s", sClassName); - GetProfileString(sProfile, sSectionName, sWeaponName, sizeof(sWeaponName)); - FormatEx(sSectionName, sizeof(sSectionName), "proxies_weapon_stats_%s", sClassName); - GetProfileString(sProfile, sSectionName, sWeaponStats, sizeof(sWeaponStats)); - FormatEx(sSectionName, sizeof(sSectionName), "proxies_weapon_index_%s", sClassName); - iWeaponIndex = GetProfileNum(sProfile, sSectionName, 0); + int iWeaponIndex; + char sWeaponName[PLATFORM_MAX_PATH], sWeaponStats[PLATFORM_MAX_PATH], sClassName[64], sSectionName[64]; + TF2_GetClassName(TF2_GetPlayerClass(client), sClassName, sizeof(sClassName)); + FormatEx(sSectionName, sizeof(sSectionName), "proxies_weapon_class_%s", sClassName); + GetProfileString(sProfile, sSectionName, sWeaponName, sizeof(sWeaponName)); + FormatEx(sSectionName, sizeof(sSectionName), "proxies_weapon_stats_%s", sClassName); + GetProfileString(sProfile, sSectionName, sWeaponStats, sizeof(sWeaponStats)); + FormatEx(sSectionName, sizeof(sSectionName), "proxies_weapon_index_%s", sClassName); + iWeaponIndex = GetProfileNum(sProfile, sSectionName, 0); - int iWeapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Melee); - if (iWeapon && iWeapon != INVALID_ENT_REFERENCE) TF2_RemoveWeaponSlot(client, TFWeaponSlot_Melee); //The boss has a melee weapon to replace for proxies - - if (strcmp(sClassName, "sniper", false) == 0) - { - FormatEx(sWeaponStatsNew, sizeof(sWeaponStatsNew), "42 ; 1 ; %s", sWeaponStats); //Fucking headshots, go away - Handle hWeapon = PrepareItemHandle(sWeaponName, iWeaponIndex, 0, 0, sWeaponStatsNew); - int iEnt = TF2Items_GiveNamedItem(client, hWeapon); - delete hWeapon; - EquipPlayerWeapon(client, iEnt); - } - else if (strcmp(sClassName, "spy", false) == 0) - { - if (iWeaponIndex == 61) - { - FormatEx(sWeaponStatsNew, sizeof(sWeaponStatsNew), "42 ; 1 ; %s", sWeaponStats); //Fucking headshots, go away - Handle hWeapon = PrepareItemHandle(sWeaponName, iWeaponIndex, 0, 0, sWeaponStatsNew); - int iEnt = TF2Items_GiveNamedItem(client, hWeapon); - delete hWeapon; - EquipPlayerWeapon(client, iEnt); - } - else - { - Handle hWeapon = PrepareItemHandle(sWeaponName, iWeaponIndex, 0, 0, sWeaponStats); - int iEnt = TF2Items_GiveNamedItem(client, hWeapon); - delete hWeapon; - EquipPlayerWeapon(client, iEnt); - } - } - else - { - Handle hWeapon = PrepareItemHandle(sWeaponName, iWeaponIndex, 0, 0, sWeaponStats); - int iEnt = TF2Items_GiveNamedItem(client, hWeapon); - delete hWeapon; - EquipPlayerWeapon(client, iEnt); - } - } - else return; + Handle hWeapon = PrepareItemHandle(sWeaponName, iWeaponIndex, 0, 0, sWeaponStats); + int iEnt = TF2Items_GiveNamedItem(client, hWeapon); + delete hWeapon; + EquipPlayerWeapon(client, iEnt); } public bool Hook_ClientProxyShouldCollide(int ent,int collisiongroup,int contentsmask, bool originalResult) @@ -4618,7 +4631,7 @@ void ClientSetGhostModeState(int client, bool bState) TF2_RemoveCondition(client, TFCond_Stealthed); SetEntityGravity(client, 1.0); SetEntProp(client, Prop_Send, "m_CollisionGroup", COLLISION_GROUP_PLAYER); - SetEntityMoveType(client, MOVETYPE_WALK); + //SetEntityMoveType(client, MOVETYPE_WALK); Client_ModelOverrides(client); } } @@ -4685,9 +4698,12 @@ void ClientHandleGhostMode(int client, bool bForceSpawn=false) SetEntProp(client, Prop_Data, "m_takedamage", DAMAGE_NO); SetEntData(client, g_offsCollisionGroup, 2, 4, true); SetEntProp(client, Prop_Data, "m_CollisionGroup", COLLISION_GROUP_DEBRIS); - SetEntityMoveType(client, MOVETYPE_NOCLIP); Client_ModelOverrides(client, g_iGhostModelIndex); - + SetEntPropFloat(client, Prop_Send, "m_flModelScale", 1.0); + SetEntPropFloat(client, Prop_Send, "m_flHeadScale", 1.0); + SetEntPropFloat(client, Prop_Send, "m_flTorsoScale", 1.0); + SetEntPropFloat(client, Prop_Send, "m_flHandScale", 1.0); + // Set first observer target. ClientGhostModeNextTarget(client); ClientActivateUltravision(client); @@ -5363,8 +5379,7 @@ stock void ClientUpdateMusicSystem(int client, bool bInitialize=false) int iOldChasingSeeBoss = g_iPlayerChaseMusicSeeMaster[client]; int iOldAlertBoss = g_iPlayerAlertMusicMaster[client]; int iOld20DollarsBoss = g_iPlayer20DollarsMusicMaster[client]; - //int iOld90sSprint = g_iPlayer20DollarsMusicMaster[client]; - + float flAnger = -1.0; float flSeeAnger = -1.0; float flAlertAnger = -1.0; @@ -6105,16 +6120,12 @@ stock void ClientMusicChaseSeeStop(int client,int iBossIndex) TriggerTimer(g_hPlayerChaseMusicSeeTimer[client][iBossIndex], true); } -/*stock void Client90sMusicReset(int client) +stock void Client90sMusicReset(int client) { char sOldMusic[PLATFORM_MAX_PATH]; strcopy(sOldMusic, sizeof(sOldMusic), g_strPlayer90sMusic[client]); g_strPlayer90sMusic[client][0] = '\0'; if (IsValidClient(client) && sOldMusic[0]) StopSound(client, MUSIC_CHAN, sOldMusic); - - g_iPlayer90sMusicMaster[client] = -1; - - char sProfile[SF2_MAX_PROFILE_NAME_LENGTH]; g_hPlayer90sMusicTimer[client] = INVALID_HANDLE; g_flPlayer90sMusicVolumes[client] = 0.0; @@ -6134,17 +6145,10 @@ stock void Client90sMusicStart(int client) sBuffer = NINETYSMUSIC; if (!sBuffer[0]) return; - - g_iPlayer90sMusicMaster[client] = 1; - + strcopy(g_strPlayer90sMusic[client], sizeof(g_strPlayer90sMusic[]), sBuffer); g_hPlayer90sMusicTimer[client] = CreateTimer(0.01, Timer_PlayerFadeIn90sMusic, GetClientUserId(client), TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); TriggerTimer(g_hPlayer90sMusicTimer[client], true); - - if (client != -1) - { - Client90sMusicStop(client); - } } stock void Client90sMusicStop(int client) @@ -6153,13 +6157,12 @@ stock void Client90sMusicStop(int client) if (!IsClientSprinting(client)) { - g_iPlayer90sMusicMaster[client] = -1; g_strPlayer90sMusic[client][0] = '\0'; } g_hPlayer90sMusicTimer[client]= CreateTimer(0.01, Timer_PlayerFadeOut90sMusic, GetClientUserId(client), TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); TriggerTimer(g_hPlayer90sMusicTimer[client], true); -}*/ +} public Action Timer_PlayerFadeInMusic(Handle timer, any userid) { @@ -6505,12 +6508,14 @@ public Action Timer_PlayerFadeOutChaseMusicSee(Handle timer, any userid) return Plugin_Continue; } -/* + public Action Timer_PlayerFadeIn90sMusic(Handle timer, any userid) { int client = GetClientOfUserId(userid); if (client <= 0) return Plugin_Stop; + if (g_hPlayer90sMusicTimer[client] != timer) return Plugin_Stop; + g_flPlayer90sMusicVolumes[client] += 0.28; if (g_flPlayer90sMusicVolumes[client] > 0.5) g_flPlayer90sMusicVolumes[client] = 0.5; @@ -6530,6 +6535,8 @@ public Action Timer_PlayerFadeOut90sMusic(Handle timer, any userid) int client = GetClientOfUserId(userid); if (client <= 0) return Plugin_Stop; + if (g_hPlayer90sMusicTimer[client] != timer) return Plugin_Stop; + char sBuffer[PLATFORM_MAX_PATH]; sBuffer = NINETYSMUSIC; @@ -6552,7 +6559,7 @@ public Action Timer_PlayerFadeOut90sMusic(Handle timer, any userid) return Plugin_Continue; } -*/ + stock bool ClientHasMusicFlag(int client,int iFlag) { return view_as(g_iPlayerMusicFlags[client] & iFlag); @@ -6886,6 +6893,7 @@ public Action Hook_ConstantGlowSetTransmitVersion2(int ent, int other) int iOwner = GetEntPropEnt(ent, Prop_Send, "moveparent"); if (iOwner == other) return Plugin_Handled; if (!IsValidClient(other)) return Plugin_Handled; + if (!IsPlayerAlive(other)) return Plugin_Handled; if (g_bPlayerProxy[other]) return Plugin_Continue; if (IsClientInGhostMode(other)) return Plugin_Continue; if (SF_SpecialRound(SPECIALROUND_WALLHAX) && ((GetClientTeam(other) == TFTeam_Red && !g_bPlayerEscaped[other] && !g_bPlayerEliminated[other]) || (g_bPlayerProxy[other]))) return Plugin_Continue; diff --git a/addons/sourcemod/scripting/sf2/menus.sp b/addons/sourcemod/scripting/sf2/menus.sp index 9f1b8642..f8bf0c33 100644 --- a/addons/sourcemod/scripting/sf2/menus.sp +++ b/addons/sourcemod/scripting/sf2/menus.sp @@ -179,6 +179,7 @@ void SetupMenus() StrCat(buffer, sizeof(buffer), "Simply Delicious - For the awesome camera overlay\n"); StrCat(buffer, sizeof(buffer), "Jason278 -Page models"); StrCat(buffer, sizeof(buffer), "Hydra X9K Music - Triple Bosses Music composer (Never Let Up Remix)\n"); + StrCat(buffer, sizeof(buffer), "Dj-Rec0il - Running In the 90s Remix composer\n"); SetMenuTitle(g_hMenuCredits1, buffer); AddMenuItem(g_hMenuCredits1, "0", "Next"); diff --git a/addons/sourcemod/scripting/sf2/npc/npc_chaser.sp b/addons/sourcemod/scripting/sf2/npc/npc_chaser.sp index 196b7c27..0c92a447 100644 --- a/addons/sourcemod/scripting/sf2/npc/npc_chaser.sp +++ b/addons/sourcemod/scripting/sf2/npc/npc_chaser.sp @@ -2047,6 +2047,7 @@ public Action Timer_SlenderChaseBossThink(Handle timer, any entref) int iBestNewTarget = INVALID_ENT_REFERENCE; float flSearchRange = NPCGetSearchRadius(iBossIndex, iDifficulty); + float flSearchSoundRange = NPCGetHearingRadius(iBossIndex, iDifficulty); float flBestNewTargetDist = SquareFloat(flSearchRange); int iState = iOldState; @@ -2235,7 +2236,7 @@ public Action Timer_SlenderChaseBossThink(Handle timer, any entref) } } - if (NPCChaserCanAutoChaseSprinters(iBossIndex) && IsClientReallySprinting(i) && GetVectorSquareMagnitude(flTraceStartPos, flTraceEndPos) <= SquareFloat(flSearchRange) && g_flNPCAutoChaseSprinterCooldown[iBossIndex] <= GetGameTime() && iState != STATE_CHASE && iState != STATE_ATTACK && iState != STATE_STUN) + if (NPCChaserCanAutoChaseSprinters(iBossIndex) && IsClientReallySprinting(i) && GetVectorSquareMagnitude(flTraceStartPos, flTraceEndPos) <= SquareFloat(flSearchSoundRange) && g_flNPCAutoChaseSprinterCooldown[iBossIndex] <= GetGameTime() && iState != STATE_CHASE && iState != STATE_ATTACK && iState != STATE_STUN) { bPlayerMadeNoise[i] = true; g_bNPCInAutoChase[iBossIndex] = true; @@ -4381,7 +4382,7 @@ public Action Timer_DestroyProjectile(Handle timer, any entref) public Action Hook_ManglerTouch(int entity, int iOther) { - if (MAX_BOSSES >= NPCGetFromEntIndex(iOther) > -1) return Plugin_Continue; + //if (IsValidEntity(NPCGetEntIndex(iOther))) return Plugin_Continue; int iDifficulty = GetConVarInt(g_cvDifficulty); int iRandomSound = GetRandomInt(0, 2); float flEntPos[3], flOtherPos[3]; diff --git a/addons/sourcemod/scripting/sf2/profiles.sp b/addons/sourcemod/scripting/sf2/profiles.sp index 77f3bf27..d7046823 100644 --- a/addons/sourcemod/scripting/sf2/profiles.sp +++ b/addons/sourcemod/scripting/sf2/profiles.sp @@ -927,12 +927,6 @@ static bool LoadBossProfile(KeyValues kv, const char[] sProfile, char[] sLoadFai float flBossJumpscareCooldownNightmare = KvGetFloat(kv, "jumpscare_cooldown_nightmare", flBossJumpscareCooldownInsane); float flBossJumpscareCooldownApollyon = KvGetFloat(kv, "jumpscare_cooldown_apollyon", flBossJumpscareCooldownNightmare); - /*Deprecated stuff*/ - if (KvGetFloat(kv, "jump_cooldown", 0.0) != 0.0) - { - PrintToServer("\"jump_cooldown\" is marked as deprecated, please remove it from the profile."); - } - float flBossDefaultSpeed = KvGetFloat(kv, "speed", 150.0); float flBossSpeedEasy = KvGetFloat(kv, "speed_easy", flBossDefaultSpeed); float flBossSpeedHard = KvGetFloat(kv, "speed_hard", flBossDefaultSpeed); diff --git a/addons/sourcemod/scripting/sf2/specialround.sp b/addons/sourcemod/scripting/sf2/specialround.sp index 20b8286c..871f7449 100644 --- a/addons/sourcemod/scripting/sf2/specialround.sp +++ b/addons/sourcemod/scripting/sf2/specialround.sp @@ -19,7 +19,6 @@ static float g_flSpecialRoundCycleEndTime = -1.0; static bool g_bStarted = false; static int doubleroulettecount = 0; static int g_iSpecialRoundType = 0; - void ReloadSpecialRounds() { if (g_hSpecialRoundCycleNames == INVALID_HANDLE) @@ -100,7 +99,7 @@ stock void SpecialRoundGetDescriptionChat(int iSpecialRound, char[] buffer,int b if (g_hSpecialRoundsConfig == INVALID_HANDLE) return; KvRewind(g_hSpecialRoundsConfig); - char sSpecialRound[45]; + char sSpecialRound[64]; IntToString(iSpecialRound, sSpecialRound, sizeof(sSpecialRound)); if (!KvJumpToKey(g_hSpecialRoundsConfig, sSpecialRound)) return; @@ -946,8 +945,6 @@ void SpecialRoundStart() AddProfile(sBuffer,_,_,_,false); GetArrayString(hSelectableBosses, GetRandomInt(0, GetArraySize(hSelectableBosses) - 1), sBuffer, sizeof(sBuffer)); AddProfile(sBuffer,_,_,_,false); - GetArrayString(hSelectableBosses, GetRandomInt(0, GetArraySize(hSelectableBosses) - 1), sBuffer, sizeof(sBuffer)); - AddProfile(sBuffer,_,_,_,false); } delete hSelectableBosses; SF_AddSpecialRound(SPECIALROUND_2DOOM); @@ -1013,141 +1010,66 @@ void SpecialCreateVote() FormatEx(Tittle,255,"%t%t","SF2 Prefix","SF2 Special Round Vote Menu Title"); NativeVotes_SetDetails(voteMenu,Tittle); - ArrayList arrayEnabledRounds = SpecialEnabledList(); - int iBlacklistedItems[6]; - iBlacklistedItems[5] = 26; - int[] iWhitelistedItems = new int[arrayEnabledRounds.Length - 1]; - char sWhitelisted[16]; + ArrayList arrayEnabledRounds = SpecialEnabledList().Clone(); + int iEraseVoteRound = arrayEnabledRounds.FindValue(SPECIALROUND_VOTE); + if (iEraseVoteRound != -1) arrayEnabledRounds.Erase(iEraseVoteRound); for (int i = 0; i < 5; i++) { - bool bChange = false; - - int iRandomRound = GetRandomInt(0, arrayEnabledRounds.Length - 1); - for (int i2 = 0; i2 < 5; i2++) + int iRound = arrayEnabledRounds.Get(GetRandomInt(0,arrayEnabledRounds.Length-1)); + int iEraseRound = arrayEnabledRounds.FindValue(iRound); + if (iEraseRound != -1) arrayEnabledRounds.Erase(iEraseRound); + + char sItem[30], sItemOutPut[30]; + switch (iRound) { - if (iRandomRound == iBlacklistedItems[0] || iRandomRound == iBlacklistedItems[1] || iRandomRound == iBlacklistedItems[2] || iRandomRound == iBlacklistedItems[3] || iRandomRound == iBlacklistedItems[4] || iRandomRound == iBlacklistedItems[5]) bChange = true; + case SPECIALROUND_DOUBLETROUBLE: FormatEx(sItem, sizeof(sItem), "Double Trouble"); + case SPECIALROUND_INSANEDIFFICULTY: FormatEx(sItem, sizeof(sItem), "Suicide Time"); + case SPECIALROUND_DOUBLEMAXPLAYERS: FormatEx(sItem, sizeof(sItem), "Double Players"); + case SPECIALROUND_LIGHTSOUT: FormatEx(sItem, sizeof(sItem), "Lights Out"); + case SPECIALROUND_BEACON: FormatEx(sItem, sizeof(sItem), "Bacon Spray"); + case SPECIALROUND_DOOMBOX: FormatEx(sItem, sizeof(sItem), "Doom Box"); + case SPECIALROUND_NOGRACE: FormatEx(sItem, sizeof(sItem), "Start Running"); + case SPECIALROUND_2DOUBLE: FormatEx(sItem, sizeof(sItem), "Double It All"); + case SPECIALROUND_DOUBLEROULETTE: FormatEx(sItem, sizeof(sItem), "Double Roulette"); + case SPECIALROUND_NIGHTVISION: FormatEx(sItem, sizeof(sItem), "Night Vision"); + case SPECIALROUND_INFINITEFLASHLIGHT: FormatEx(sItem, sizeof(sItem), "Infinite Flashlight"); + case SPECIALROUND_DREAMFAKEBOSSES: FormatEx(sItem, sizeof(sItem), "Just a Dream"); + case SPECIALROUND_EYESONTHECLOACK: FormatEx(sItem, sizeof(sItem), "Countdown"); + case SPECIALROUND_NOPAGEBONUS: FormatEx(sItem, sizeof(sItem), "Deadline"); + case SPECIALROUND_DUCKS: FormatEx(sItem, sizeof(sItem), "Ducks"); + case SPECIALROUND_1UP: FormatEx(sItem, sizeof(sItem), "1-Up"); + case SPECIALROUND_NOULTRAVISION: FormatEx(sItem, sizeof(sItem), "Blind"); + case SPECIALROUND_SUPRISE: FormatEx(sItem, sizeof(sItem), "Surprise"); + case SPECIALROUND_LASTRESORT: FormatEx(sItem, sizeof(sItem), "Last Resort"); + case SPECIALROUND_ESCAPETICKETS: FormatEx(sItem, sizeof(sItem), "Escape Tickets"); + case SPECIALROUND_REVOLUTION: FormatEx(sItem, sizeof(sItem), "Special Round Revolution"); + case SPECIALROUND_DISTORTION: FormatEx(sItem, sizeof(sItem), "Space Distortion"); + case SPECIALROUND_MULTIEFFECT: FormatEx(sItem, sizeof(sItem), "Multieffect"); + case SPECIALROUND_BOO: FormatEx(sItem, sizeof(sItem), "Boo"); + case SPECIALROUND_REALISM: FormatEx(sItem, sizeof(sItem), "Marble Hornets"); + case SPECIALROUND_COFFEE: FormatEx(sItem, sizeof(sItem), "Coffee"); + case SPECIALROUND_PAGEDETECTOR: FormatEx(sItem, sizeof(sItem), "Page Detector"); + case SPECIALROUND_CLASSSCRAMBLE: FormatEx(sItem, sizeof(sItem), "Class Scramble"); + case SPECIALROUND_2DOOM: FormatEx(sItem, sizeof(sItem), "Silent Slender"); + case SPECIALROUND_WALLHAX: FormatEx(sItem, sizeof(sItem), "Wall Hax"); + case SPECIALROUND_HYPERSNATCHER: FormatEx(sItem, sizeof(sItem), "Hyper Snatcher"); + case SPECIALROUND_PAGEREWARDS: FormatEx(sItem, sizeof(sItem), "Page Rewards"); + case SPECIALROUND_TINYBOSSES: FormatEx(sItem, sizeof(sItem), "Tiny Bosses"); + case SPECIALROUND_RUNNINGINTHE90S: FormatEx(sItem, sizeof(sItem), "In The 90s"); + case SPECIALROUND_TRIPLEBOSSES: FormatEx(sItem, sizeof(sItem), "Triple Bosses"); + case SPECIALROUND_20DOLLARS: FormatEx(sItem, sizeof(sItem), "20 Dollars"); } - - if (bChange) + for (int iBit = 0; iBit < 30; iBit++) { - for (int i3 = 0; i3 < arrayEnabledRounds.Length - 1; i3++) + if (strcmp(sItem[iBit],"-") == 0 ||strcmp(sItem[iBit],":") == 0) { - if (i3 != iBlacklistedItems[0] && i3 != iBlacklistedItems[1] && i3 != iBlacklistedItems[2] && i3 != iBlacklistedItems[3] && i3 != iBlacklistedItems[4] && i3 != iBlacklistedItems[5]) - { - iWhitelistedItems[i3] = i3; - FormatEx(sWhitelisted, sizeof(sWhitelisted), "%d", i3); - } - } - int iRandomRoundNew = GetRandomInt(0, StringToInt(sWhitelisted)); - char sItem[30], sItemOutPut[30]; - switch (iRandomRoundNew) - { - case SPECIALROUND_DOUBLETROUBLE: FormatEx(sItem, sizeof(sItem), "Double Trouble"); - case SPECIALROUND_INSANEDIFFICULTY: FormatEx(sItem, sizeof(sItem), "Suicide Time"); - case SPECIALROUND_DOUBLEMAXPLAYERS: FormatEx(sItem, sizeof(sItem), "Double Players"); - case SPECIALROUND_LIGHTSOUT: FormatEx(sItem, sizeof(sItem), "Lights Out"); - case SPECIALROUND_BEACON: FormatEx(sItem, sizeof(sItem), "Bacon Spray"); - case SPECIALROUND_DOOMBOX: FormatEx(sItem, sizeof(sItem), "Doom Box"); - case SPECIALROUND_NOGRACE: FormatEx(sItem, sizeof(sItem), "Start Running"); - case SPECIALROUND_2DOUBLE: FormatEx(sItem, sizeof(sItem), "Double It All"); - case SPECIALROUND_DOUBLEROULETTE: FormatEx(sItem, sizeof(sItem), "Double Roulette"); - case SPECIALROUND_NIGHTVISION: FormatEx(sItem, sizeof(sItem), "Night Vision"); - case SPECIALROUND_INFINITEFLASHLIGHT: FormatEx(sItem, sizeof(sItem), "Infinite Flashlight"); - case SPECIALROUND_DREAMFAKEBOSSES: FormatEx(sItem, sizeof(sItem), "Just a Dream"); - case SPECIALROUND_EYESONTHECLOACK: FormatEx(sItem, sizeof(sItem), "Countdown"); - case SPECIALROUND_NOPAGEBONUS: FormatEx(sItem, sizeof(sItem), "Deadline"); - case SPECIALROUND_DUCKS: FormatEx(sItem, sizeof(sItem), "Ducks"); - case SPECIALROUND_1UP: FormatEx(sItem, sizeof(sItem), "1 Up"); - case SPECIALROUND_NOULTRAVISION: FormatEx(sItem, sizeof(sItem), "Blind"); - case SPECIALROUND_SUPRISE: FormatEx(sItem, sizeof(sItem), "Surprise"); - case SPECIALROUND_LASTRESORT: FormatEx(sItem, sizeof(sItem), "Last Resort"); - case SPECIALROUND_ESCAPETICKETS: FormatEx(sItem, sizeof(sItem), "Escape Tickets"); - case SPECIALROUND_REVOLUTION: FormatEx(sItem, sizeof(sItem), "Special Round Revolution"); - case SPECIALROUND_DISTORTION: FormatEx(sItem, sizeof(sItem), "Space Distortion"); - case SPECIALROUND_MULTIEFFECT: FormatEx(sItem, sizeof(sItem), "Multieffect"); - case SPECIALROUND_BOO: FormatEx(sItem, sizeof(sItem), "Boo"); - case SPECIALROUND_REALISM: FormatEx(sItem, sizeof(sItem), "Marble Hornets"); - case SPECIALROUND_COFFEE: FormatEx(sItem, sizeof(sItem), "Coffee"); - case SPECIALROUND_PAGEDETECTOR: FormatEx(sItem, sizeof(sItem), "Page Detector"); - case SPECIALROUND_CLASSSCRAMBLE: FormatEx(sItem, sizeof(sItem), "Class Scramble"); - case SPECIALROUND_2DOOM: FormatEx(sItem, sizeof(sItem), "Silent Slender"); - case SPECIALROUND_WALLHAX: FormatEx(sItem, sizeof(sItem), "Wall Hax"); - case SPECIALROUND_HYPERSNATCHER: FormatEx(sItem, sizeof(sItem), "Hyper Snatcher"); - case SPECIALROUND_PAGEREWARDS: FormatEx(sItem, sizeof(sItem), "Page Rewards"); - case SPECIALROUND_TINYBOSSES: FormatEx(sItem, sizeof(sItem), "Tiny Bosses"); - case SPECIALROUND_RUNNINGINTHE90S: FormatEx(sItem, sizeof(sItem), "In The 90s"); - case SPECIALROUND_TRIPLEBOSSES: FormatEx(sItem, sizeof(sItem), "Triple Bosses"); - case SPECIALROUND_20DOLLARS: FormatEx(sItem, sizeof(sItem), "20 Dollars"); + break; } - for (int iBit = 0; iBit < 30; iBit++) - { - if (strcmp(sItem[iBit],"-") == 0 ||strcmp(sItem[iBit],":") == 0) - { - break; - } - sItemOutPut[iBit] = sItem[iBit]; - } - FormatEx(sItem, sizeof(sItem), "%d", iRandomRoundNew); - NativeVotes_AddItem(voteMenu, sItem, sItemOutPut); - - iBlacklistedItems[i] = iRandomRoundNew; - } - else - { - char sItem[30], sItemOutPut[30]; - switch (iRandomRound) - { - case SPECIALROUND_DOUBLETROUBLE: FormatEx(sItem, sizeof(sItem), "Double Trouble"); - case SPECIALROUND_INSANEDIFFICULTY: FormatEx(sItem, sizeof(sItem), "Suicide Time"); - case SPECIALROUND_DOUBLEMAXPLAYERS: FormatEx(sItem, sizeof(sItem), "Double Players"); - case SPECIALROUND_LIGHTSOUT: FormatEx(sItem, sizeof(sItem), "Lights Out"); - case SPECIALROUND_BEACON: FormatEx(sItem, sizeof(sItem), "Bacon Spray"); - case SPECIALROUND_DOOMBOX: FormatEx(sItem, sizeof(sItem), "Doom Box"); - case SPECIALROUND_NOGRACE: FormatEx(sItem, sizeof(sItem), "Start Running"); - case SPECIALROUND_2DOUBLE: FormatEx(sItem, sizeof(sItem), "Double It All"); - case SPECIALROUND_DOUBLEROULETTE: FormatEx(sItem, sizeof(sItem), "Double Roulette"); - case SPECIALROUND_NIGHTVISION: FormatEx(sItem, sizeof(sItem), "Night Vision"); - case SPECIALROUND_INFINITEFLASHLIGHT: FormatEx(sItem, sizeof(sItem), "Infinite Flashlight"); - case SPECIALROUND_DREAMFAKEBOSSES: FormatEx(sItem, sizeof(sItem), "Just a Dream"); - case SPECIALROUND_EYESONTHECLOACK: FormatEx(sItem, sizeof(sItem), "Countdown"); - case SPECIALROUND_NOPAGEBONUS: FormatEx(sItem, sizeof(sItem), "Deadline"); - case SPECIALROUND_DUCKS: FormatEx(sItem, sizeof(sItem), "Ducks"); - case SPECIALROUND_1UP: FormatEx(sItem, sizeof(sItem), "1 Up"); - case SPECIALROUND_NOULTRAVISION: FormatEx(sItem, sizeof(sItem), "Blind"); - case SPECIALROUND_SUPRISE: FormatEx(sItem, sizeof(sItem), "Surprise"); - case SPECIALROUND_LASTRESORT: FormatEx(sItem, sizeof(sItem), "Last Resort"); - case SPECIALROUND_ESCAPETICKETS: FormatEx(sItem, sizeof(sItem), "Escape Tickets"); - case SPECIALROUND_REVOLUTION: FormatEx(sItem, sizeof(sItem), "Special Round Revolution"); - case SPECIALROUND_DISTORTION: FormatEx(sItem, sizeof(sItem), "Space Distortion"); - case SPECIALROUND_MULTIEFFECT: FormatEx(sItem, sizeof(sItem), "Multieffect"); - case SPECIALROUND_BOO: FormatEx(sItem, sizeof(sItem), "Boo"); - case SPECIALROUND_REALISM: FormatEx(sItem, sizeof(sItem), "Marble Hornets"); - case SPECIALROUND_COFFEE: FormatEx(sItem, sizeof(sItem), "Coffee"); - case SPECIALROUND_PAGEDETECTOR: FormatEx(sItem, sizeof(sItem), "Page Detector"); - case SPECIALROUND_CLASSSCRAMBLE: FormatEx(sItem, sizeof(sItem), "Class Scramble"); - case SPECIALROUND_2DOOM: FormatEx(sItem, sizeof(sItem), "Silent Slender"); - case SPECIALROUND_WALLHAX: FormatEx(sItem, sizeof(sItem), "Wall Hax"); - case SPECIALROUND_HYPERSNATCHER: FormatEx(sItem, sizeof(sItem), "Hyper Snatcher"); - case SPECIALROUND_PAGEREWARDS: FormatEx(sItem, sizeof(sItem), "Page Rewards"); - case SPECIALROUND_TINYBOSSES: FormatEx(sItem, sizeof(sItem), "Tiny Bosses"); - case SPECIALROUND_RUNNINGINTHE90S: FormatEx(sItem, sizeof(sItem), "In The 90s"); - case SPECIALROUND_TRIPLEBOSSES: FormatEx(sItem, sizeof(sItem), "Triple Bosses"); - case SPECIALROUND_20DOLLARS: FormatEx(sItem, sizeof(sItem), "20 Dollars"); - } - for (int iBit = 0; iBit < 30; iBit++) - { - if (strcmp(sItem[iBit],"-") == 0 ||strcmp(sItem[iBit],":") == 0) - { - break; - } - sItemOutPut[iBit] = sItem[iBit]; - } - FormatEx(sItem, sizeof(sItem), "%d", iRandomRound); - NativeVotes_AddItem(voteMenu, sItem, sItemOutPut); - - iBlacklistedItems[i] = iRandomRound; + sItemOutPut[iBit] = sItem[iBit]; } + FormatEx(sItem, sizeof(sItem), "%d", iRound); + NativeVotes_AddItem(voteMenu, sItem, sItemOutPut); } delete arrayEnabledRounds; diff --git a/addons/sourcemod/translations/sf2.phrases.txt b/addons/sourcemod/translations/sf2.phrases.txt index c3f0da27..f14c5370 100644 --- a/addons/sourcemod/translations/sf2.phrases.txt +++ b/addons/sourcemod/translations/sf2.phrases.txt @@ -1386,7 +1386,7 @@ "SF2 Change Log" { - "en" "-Fixed a bug where footstep and voice auto chase counts were inverted.\n-Reduced default Slaughter Run boss speed from 600 to 580.\n-Max air speed is no longer divided by 2.\n-Reverted the code for the bobbing functions." + "en" "-Special Round Vote now has a new system to pick random votes without repeats and breaking.\n-Silent Slender now only spawns 3 bosses compared to 4.\n-In The 90s music is back and extended.\n-Auto chase sprinters is now dependent on the boss' search sound range.\n-Ghost mode now uses Collision Hooks rather than noclip.\n-Added proxy weapons." } "SF2 Smite player"