Skip to content

Commit

Permalink
1.7.5.07
Browse files Browse the repository at this point in the history
  • Loading branch information
Mentrillum committed Nov 21, 2022
1 parent 849d629 commit c1ecc94
Show file tree
Hide file tree
Showing 14 changed files with 316 additions and 184 deletions.
4 changes: 2 additions & 2 deletions addons/sourcemod/scripting/include/sf2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#endif
#define _sf2_included

#define PLUGIN_VERSION "1.7.5.06 M"
#define PLUGIN_VERSION_DISPLAY "1.7.5.06 M"
#define PLUGIN_VERSION "1.7.5.07 M"
#define PLUGIN_VERSION_DISPLAY "1.7.5.07 M"

// Some defines.
#define SF2_MAX_PROFILE_NAME_LENGTH 64
Expand Down
27 changes: 16 additions & 11 deletions addons/sourcemod/scripting/sf2.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,11 @@ public void TF2_OnConditionAdded(int client, TFCond cond)
g_PlayerProxyControl[client] = 0;
}
}

if (IsClientUsingFlashlight(client))
{
ClientHandleFlashlight(client);
}
}
if (cond == view_as<TFCond>(82))
{
Expand Down Expand Up @@ -2280,7 +2285,7 @@ void OnConVarChanged(Handle cvar, const char[] oldValue, const char[] intValue)
EmitSoundToAll(g_SoundNightmareMode[i]);
}
SpecialRoundGameText("Its Restart Session time!", "leaderboard_streak");
CPrintToChatAll("{royalblue}%t{default}Your thirst for blood continues? Very well, let the blood spill. Let the demons feed off your unfortunate soul... Difficulty set to {mediumslateblue}%t!", "SF2 Prefix", "SF2 Calamity Difficulty");
CPrintToChatAll("{royalblue}%t {default}Your thirst for blood continues? Very well, let the blood spill. Let the demons feed off your unfortunate soul... Difficulty set to {mediumslateblue}%t!", "SF2 Prefix", "SF2 Calamity Difficulty");
g_RestartSessionEnabled = true;
g_DifficultyConVar.SetInt(Difficulty_Apollyon);
g_IgnoreRoundWinConditionsConVar.SetBool(true);
Expand Down Expand Up @@ -2375,7 +2380,7 @@ void OnConVarChanged(Handle cvar, const char[] oldValue, const char[] intValue)
}
else
{
CPrintToChatAll("{royalblue}%t{default}You're done? Ok. Difficulty set to {darkgray}Apollyon.", "SF2 Prefix");
CPrintToChatAll("{royalblue}%t {default}You're done? Ok. Difficulty set to {darkgray}Apollyon.", "SF2 Prefix");
g_RestartSessionEnabled = false;
g_DifficultyConVar.SetInt(Difficulty_Apollyon);
g_IgnoreRoundWinConditionsConVar.SetBool(false);
Expand Down Expand Up @@ -2637,7 +2642,7 @@ Action Hook_NormalSound(int clients[64], int &numClients, char sample[PLATFORM_M
}
}
}
else if (!g_PlayerEliminated[entity] && !g_PlayerEscaped[entity])
else if (!g_PlayerEliminated[entity] && !DidClientEscape(entity))
{
switch (channel)
{
Expand All @@ -2664,7 +2669,7 @@ Action Hook_NormalSound(int clients[64], int &numClients, char sample[PLATFORM_M
GetClientAbsOrigin(entity, g_SlenderTargetSoundTempPos[bossIndex]);
g_SlenderInterruptConditions[bossIndex] |= COND_HEARDSUSPICIOUSSOUND;
g_SlenderInterruptConditions[bossIndex] |= COND_HEARDVOICE;
if (g_SlenderState[bossIndex] == STATE_ALERT && NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
if (NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
{
g_SlenderSoundTarget[bossIndex] = EntIndexToEntRef(entity);
g_SlenderAutoChaseCount[bossIndex] += NPCChaserAutoChaseAddVoice(bossIndex, difficulty);
Expand Down Expand Up @@ -2740,7 +2745,7 @@ Action Hook_NormalSound(int clients[64], int &numClients, char sample[PLATFORM_M
{
g_SlenderInterruptConditions[bossIndex] |= COND_HEARDFOOTSTEP;
}
if (g_SlenderState[bossIndex] == STATE_ALERT && NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
if (NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
{
g_SlenderSoundTarget[bossIndex] = EntIndexToEntRef(entity);
if (isLoudStep)
Expand Down Expand Up @@ -2774,7 +2779,7 @@ Action Hook_NormalSound(int clients[64], int &numClients, char sample[PLATFORM_M
GetClientAbsOrigin(entity, g_SlenderTargetSoundTempPos[bossIndex]);
g_SlenderInterruptConditions[bossIndex] |= COND_HEARDSUSPICIOUSSOUND;
g_SlenderInterruptConditions[bossIndex] |= COND_HEARDWEAPON;
if (g_SlenderState[bossIndex] == STATE_ALERT && NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
if (NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
{
g_SlenderSoundTarget[bossIndex] = EntIndexToEntRef(entity);
g_SlenderAutoChaseCount[bossIndex] += NPCChaserAutoChaseAddWeapon(bossIndex, difficulty);
Expand All @@ -2801,7 +2806,7 @@ Action Hook_NormalSound(int clients[64], int &numClients, char sample[PLATFORM_M
GetClientAbsOrigin(entity, g_SlenderTargetSoundTempPos[bossIndex]);
g_SlenderInterruptConditions[bossIndex] |= COND_HEARDSUSPICIOUSSOUND;
g_SlenderInterruptConditions[bossIndex] |= COND_HEARDFLASHLIGHT;
if (g_SlenderState[bossIndex] == STATE_ALERT && NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
if (NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
{
g_SlenderSoundTarget[bossIndex] = EntIndexToEntRef(entity);
g_SlenderAutoChaseCount[bossIndex] += NPCChaserAutoChaseAddWeapon(bossIndex, difficulty);
Expand All @@ -2825,7 +2830,7 @@ Action Hook_NormalSound(int clients[64], int &numClients, char sample[PLATFORM_M
GetClientAbsOrigin(entity, g_SlenderTargetSoundTempPos[bossIndex]);
g_SlenderInterruptConditions[bossIndex] |= COND_HEARDSUSPICIOUSSOUND;
g_SlenderInterruptConditions[bossIndex] |= COND_HEARDVOICE;
if (g_SlenderState[bossIndex] == STATE_ALERT && NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
if (NPCChaserIsAutoChaseEnabled(bossIndex) && g_SlenderAutoChaseCooldown[bossIndex] < GetGameTime())
{
g_SlenderSoundTarget[bossIndex] = EntIndexToEntRef(entity);
g_SlenderAutoChaseCount[bossIndex] += NPCChaserAutoChaseAddVoice(bossIndex, difficulty) * 2;
Expand Down Expand Up @@ -3188,7 +3193,7 @@ void CollectPage(int page, int activator)
NPCGetBossName(_, bossName, sizeof(bossName), buffer);
EmitSoundToAll(SR_SOUND_SELECT_BR, _, SNDCHAN_AUTO, _, _, 0.75);
SpecialRoundGameText(bossName, "d_purgatory");
CPrintToChatAll("{royalblue}%t{default}Next on the roulette: {valve}%s", "SF2 Prefix", bossName); //Minimized HUD
CPrintToChatAll("{royalblue}%t {default}Next on the roulette: {valve}%s", "SF2 Prefix", bossName); //Minimized HUD
}
delete selectableBosses;
}
Expand All @@ -3202,15 +3207,15 @@ void CollectPage(int page, int activator)
NPCGetBossName(_, bossName, sizeof(bossName), buffer);
EmitSoundToAll(SR_SOUND_SELECT_BR, _, SNDCHAN_AUTO, _, _, 0.75);
SpecialRoundGameText(bossName, "d_purgatory");
CPrintToChatAll("{royalblue}%t{default}Next on the roulette: {valve}%s", "SF2 Prefix", bossName);
CPrintToChatAll("{royalblue}%t {default}Next on the roulette: {valve}%s", "SF2 Prefix", bossName);
}
delete selectableBosses;
}
}
else
{
SpecialRoundGameText("You got lucky, no boss can be added.", "cappoint_progressbar_blocked");
CPrintToChatAll("{royalblue}%t{default}You got lucky, no boss can be added.", "SF2 Prefix");
CPrintToChatAll("{royalblue}%t {default}You got lucky, no boss can be added.", "SF2 Prefix");
}
}

Expand Down
44 changes: 25 additions & 19 deletions addons/sourcemod/scripting/sf2/adminmenu.sp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int AdminMenu_PlayerForceProxy(Handle menu, MenuAction action,int param1,
int client = GetClientOfUserId(StringToInt(userId));
if (client <= 0)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Player Does Not Exist", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Player Does Not Exist", param1);
DisplayPlayerForceProxyAdminMenu(param1);
}
else
Expand All @@ -100,7 +100,7 @@ static int AdminMenu_PlayerForceProxy(Handle menu, MenuAction action,int param1,
{
delete menuHandle;
DisplayTopMenu(g_TopMenu, param1, TopMenuPosition_LastCategory);
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 No Active Bosses", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 No Active Bosses", param1);
}
else
{
Expand Down Expand Up @@ -131,7 +131,7 @@ static int AdminMenu_PlayerForceProxyBoss(Handle menu, MenuAction action,int par
int client = GetClientOfUserId(g_PlayerAdminMenuTargetUserId[param1]);
if (client <= 0)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Player Does Not Exist", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Player Does Not Exist", param1);
}
else
{
Expand All @@ -140,22 +140,22 @@ static int AdminMenu_PlayerForceProxyBoss(Handle menu, MenuAction action,int par
int index = NPCGetFromUniqueID(StringToInt(id));
if (index == -1)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
}
else
{
if (!(NPCGetFlags(index) & SFF_PROXIES) ||
g_SlenderCopyMaster[index] != -1)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Boss Not Allowed To Have Proxies", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Boss Not Allowed To Have Proxies", param1);
}
else if (!g_PlayerEliminated[client])
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Player In Game", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Player In Game", param1);
}
else if (g_PlayerProxy[param1])
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Player Already A Proxy", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Player Already A Proxy", param1);
}
else
{
Expand Down Expand Up @@ -531,7 +531,7 @@ static bool DisplayRemoveBossAdminMenu(int client)
if (!AddBossTargetsToMenu(menuHandle))
{
delete menuHandle;
CPrintToChat(client, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 No Active Bosses", client);
CPrintToChat(client, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 No Active Bosses", client);
}
else
{
Expand Down Expand Up @@ -566,7 +566,7 @@ static int AdminMenu_RemoveBoss(Handle menu, MenuAction action,int param1,int pa
int index = NPCGetFromUniqueID(StringToInt(id));
if (index == -1)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
}
else
{
Expand All @@ -586,7 +586,7 @@ static bool DisplaySpawnBossAdminMenu(int client)
if (!AddBossTargetsToMenu(menuHandle))
{
delete menuHandle;
CPrintToChat(client, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 No Active Bosses", client);
CPrintToChat(client, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 No Active Bosses", client);
}
else
{
Expand Down Expand Up @@ -621,7 +621,7 @@ static int AdminMenu_SpawnBoss(Handle menu, MenuAction action,int param1,int par
int index = NPCGetFromUniqueID(StringToInt(id));
if (index == -1)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
}
else
{
Expand All @@ -641,7 +641,7 @@ static bool DisplayBossAttackWaitersAdminMenu(int client)
if (!AddBossTargetsToMenu(menuHandle))
{
delete menuHandle;
CPrintToChat(client, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 No Active Bosses", client);
CPrintToChat(client, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 No Active Bosses", client);
}
else
{
Expand Down Expand Up @@ -676,7 +676,7 @@ static int AdminMenu_BossAttackWaiters(Handle menu, MenuAction action,int param1
int index = NPCGetFromUniqueID(StringToInt(id));
if (index == -1)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
DisplayBossAttackWaitersAdminMenu(param1);
}
else
Expand Down Expand Up @@ -725,7 +725,7 @@ static int AdminMenu_BossAttackWaitersConfirm(Handle menu, MenuAction action,int
int index = NPCGetFromUniqueID(StringToInt(id));
if (index == -1)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
}
else
{
Expand Down Expand Up @@ -755,7 +755,7 @@ static bool DisplayBossTeleportAdminMenu(int client)
if (!AddBossTargetsToMenu(menuHandle))
{
delete menuHandle;
CPrintToChat(client, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 No Active Bosses", client);
CPrintToChat(client, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 No Active Bosses", client);
}
else
{
Expand Down Expand Up @@ -790,7 +790,7 @@ static int AdminMenu_BossTeleport(Handle menu, MenuAction action,int param1,int
int index = NPCGetFromUniqueID(StringToInt(id));
if (index == -1)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
DisplayBossTeleportAdminMenu(param1);
}
else
Expand Down Expand Up @@ -839,7 +839,7 @@ static int AdminMenu_BossTeleportConfirm(Handle menu, MenuAction action,int para
int index = NPCGetFromUniqueID(StringToInt(id));
if (index == -1)
{
CPrintToChat(param1, "{royalblue}%t{default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
CPrintToChat(param1, "{royalblue}%t {default}%T", "SF2 Prefix", "SF2 Boss Does Not Exist", param1);
}
else
{
Expand Down Expand Up @@ -927,10 +927,16 @@ static int AdminMenu_OverrideBoss(Handle menu, MenuAction action,int param1,int
}
else if (action == MenuAction_Select)
{
char profile[SF2_MAX_PROFILE_NAME_LENGTH];
char profile[SF2_MAX_PROFILE_NAME_LENGTH], name[SF2_MAX_NAME_LENGTH];
GetMenuItem(menu, param2, profile, sizeof(profile));

FakeClientCommand(param1, "sm_cvar sf2_boss_profile_override %s", profile);
g_BossProfileOverrideConVar.SetString(profile);

ArrayList arrayNames;
arrayNames = GetBossProfileNames(profile);
arrayNames.GetString(Difficulty_Normal, name, sizeof(name));

CPrintToChatAll("{royalblue}%t {collectors}%N {default}set the next boss to {valve}%s{default}.", "SF2 Prefix", param1, name);

DisplayOverrideBossAdminMenu(param1);
}
Expand Down
11 changes: 9 additions & 2 deletions addons/sourcemod/scripting/sf2/client.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3771,7 +3771,14 @@ void ClientUpdateListeningFlags(int client, bool reset=false)
}
else
{
SetListenOverride(client, i, Listen_No);
if (!DidClientEscape(client))
{
SetListenOverride(client, i, Listen_No);
}
else
{
SetListenOverride(client, i, Listen_Default);
}
}
}
}
Expand Down Expand Up @@ -3944,7 +3951,7 @@ static Action Hook_ConstantGlowSetTransmit(int ent, int other)
{
return Plugin_Continue;
}
if ((SF_SpecialRound(SPECIALROUND_WALLHAX) || g_EnableWallHaxConVar.BoolValue) && ((GetClientTeam(other) == TFTeam_Red && !g_PlayerEscaped[other] && !g_PlayerEliminated[other]) || (g_PlayerProxy[other])))
if ((SF_SpecialRound(SPECIALROUND_WALLHAX) || g_EnableWallHaxConVar.BoolValue) && ((GetClientTeam(other) == TFTeam_Red && !DidClientEscape(other) && !g_PlayerEliminated[other]) || (g_PlayerProxy[other])))
{
return Plugin_Continue;
}
Expand Down
Loading

0 comments on commit c1ecc94

Please sign in to comment.