Skip to content

Commit

Permalink
1.5.5.2 Secret Update 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mentrillum authored Jul 8, 2020
1 parent bd79ec1 commit a456e20
Show file tree
Hide file tree
Showing 11 changed files with 1,921 additions and 1,224 deletions.
28 changes: 27 additions & 1 deletion addons/sourcemod/configs/sf2/profiles_documentation.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
// "kill_radius" - If a player gets this close to the boss, they will be caught by them.
// "use_raid_hitbox" - Boolean (0/1) - This value should only be used for RAID and Boxing bosses, this allows the "mins" and "maxs" value to be used for the boss' hitbox, avoid goind overboard with those values.
//
// "kill_weapontype" - String (256) - Unlike the attack weapon kill icons, this will attempt to be used if no attack kill icon is present, or you can use it for kill_radius bosses.
// Requires "attack_weaponsenable" to be set to 1.
// "kill_weapontypeint" - This should only be used for headshots, backstabs, or anything with special kill icons.
//
// "copy" - Boolean (0/1) that determines if the boss should make copies of itself to chase separated players. Default value is "0".
// "copy_max" - Determines how many copies can be active in one time.
// "copy_max_easy" - Determines how many copies can be active on the Easy difficulty, default is the value of copy_max.
Expand Down Expand Up @@ -950,7 +954,7 @@
// "player_smite_transparency" - Int (0 > 255) - Determines the transparency/alpha value of the Smite Color. Defaults to "255"
//
// =====================================================================
// PROJECTILE & AURA ABILITIES
// PROJECTILE ABILITIES
// =====================================================================
//
// Provides the boss with the ability to either spawn projectiles. Supports Fireballs, Iceballs, Rockets, Grenades, Sentry Rockets, Arrows, and Cow Mangler projectiles.
Expand Down Expand Up @@ -1029,6 +1033,28 @@
// "use_gesture_shoot" - Boolean (0/1) - This allows bosses to play a layer animation in addition to whatever animation they are playing, so they can do a shooting animation, throwing animation, or any layer animation while playing their current animation.
// An example of layer animations are the TF2 classes shoot layer animations. This should only be used if bosses only have a projectile attack, stunning and attacking just don't work as well at the moment.
// "gesture_shootprojectile" - String (256) - Determines the layer animation the boss should play once it shoots a projectile.
//
// =============================================================
// TRAP ABILITIES
// =============================================================
//
// Provides the boss with the ability to deploy traps to catch players.
// -----------------------------------------------------------------------------------------------------------------------------------------------------
// "traps_enabled" - Boolean (0/1) - Determins if the boss should be able to deploy traps. Defaults to "0".
//
// "trap_type" - Int - Determins the type of trap that the boss will deploy. Defaults to "0".
//
// Trap Type Values for "trap_type" are the following:
// ----------------------------------------------------------
// 0 = Bear Trap
//
// "trap_spawn_cooldown" - Float - Determins how long the cooldown should be for the bosses next trap deploy time. Defaults to "8.0" seconds.
// "trap_spawn_cooldown_easy" - Same as "trap_spawn_cooldown", except in Easy difficulty. If not set, value will be set to whatever "trap_spawn_cooldown" is set to.
// "trap_spawn_cooldown_hard" - Same as "trap_spawn_cooldown", except in Hard difficulty. If not set, value will be set to whatever "trap_spawn_cooldown" is set to.
// "trap_spawn_cooldown_insane" - Same as "trap_spawn_cooldown", except in Insane difficulty. If not set, value will be set to whatever "trap_spawn_cooldown_hard" is set to.
// "trap_spawn_cooldown_nightmare" - Same as "trap_spawn_cooldown", except in Nightmare difficulty. If not set, value will be set to whatever "trap_spawn_cooldown_insane" is set to.
// "trap_spawn_cooldown_apollyon" - Same as "trap_spawn_cooldown", except in Apollyon difficulty. If not set, value will be set to whatever "trap_spawn_cooldown_nightmare" is set to.
//
// =====================================================================
// RAID KEY VALUES
// =====================================================================
Expand Down
1 change: 1 addition & 0 deletions addons/sourcemod/scripting/include/sf2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ enum SF2RoundState
#define SFF_COPIES (1 << 14)
#define SFF_ATTACKPROPS (1 << 15)
#define SFF_WEAPONKILLS (1 << 16)
#define SFF_WEAPONKILLSONRADIUS (1 << 17)

// Interrup conditions.
#define COND_HEARDSUSPICIOUSSOUND (1 << 0)
Expand Down
103 changes: 94 additions & 9 deletions addons/sourcemod/scripting/sf2.sp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ bool sendproxymanager=false;
#include <sf2>
#pragma newdecls required

#define PLUGIN_VERSION "1.5.5.1 Modified"
#define PLUGIN_VERSION_DISPLAY "1.5.5.1 Modified"
#define PLUGIN_VERSION "1.5.5.2 Modified"
#define PLUGIN_VERSION_DISPLAY "1.5.5.2 Modified"

#define TFTeam_Spectator 1
#define TFTeam_Red 2
Expand Down Expand Up @@ -163,6 +163,10 @@ public Plugin myinfo =
//#define NINETYSMUSIC "slender/sf2modified_runninginthe90s.wav"
#define TRIPLEBOSSESMUSIC "slender/sf2modified_triplebosses.wav"

#define TRAP_DEPLOY "slender/modified_traps/beartrap/trap_deploy.mp3"
#define TRAP_CLOSE "slender/modified_traps/beartrap/trap_close.mp3"
#define TRAP_MODEL "models/mentrillum/traps/beartrap.mdl"

#define SF2_HUD_TEXT_COLOR_R 127
#define SF2_HUD_TEXT_COLOR_G 167
#define SF2_HUD_TEXT_COLOR_B 141
Expand Down Expand Up @@ -350,6 +354,7 @@ float g_flSlenderNextVoiceSound[MAX_BOSSES] = { -1.0, ... };
float g_flSlenderNextMoanSound[MAX_BOSSES] = { -1.0, ... };
float g_flSlenderNextWanderPos[MAX_BOSSES] = { -1.0, ... };
float g_flSlenderNextCloakTime[MAX_BOSSES] = { -1.0, ... };
float g_flSlenderNextTrapPlacement[MAX_BOSSES] = { -1.0, ... };
float g_flSlenderNextFootstepIdleSound[MAX_BOSSES] = { -1.0, ... };
float g_flSlenderNextFootstepWalkSound[MAX_BOSSES] = { -1.0, ... };
float g_flSlenderNextFootstepRunSound[MAX_BOSSES] = { -1.0, ... };
Expand Down Expand Up @@ -456,6 +461,9 @@ float g_flPlayerStaticShakeMaxVolume[MAXPLAYERS + 1];

float g_flPlayerProxyNextVoiceSound[MAXPLAYERS + 1];

bool g_bPlayerTrapped[MAXPLAYERS + 1];
int g_iPlayerTrapCount[MAXPLAYERS + 1];

// Fake lag compensation for FF.
bool g_bPlayerLagCompensation[MAXPLAYERS + 1];
int g_iPlayerLagCompensationTeam[MAXPLAYERS + 1];
Expand Down Expand Up @@ -852,6 +860,7 @@ ConVar g_cvLookAheadDist;
#include "sf2/client.sp"
#include "sf2/specialround.sp"
#include "sf2/adminmenu.sp"
#include "sf2/traps.sp"


#define SF2_PROJECTED_FLASHLIGHT_CONFIRM_SOUND "ui/item_acquired.wav"
Expand Down Expand Up @@ -1132,6 +1141,7 @@ public void OnPluginStart()
RegAdminCmd("sm_sf2_force_proxy", Command_ForceProxy, ADMFLAG_SLAY);
//RegAdminCmd("sm_sf2_nightvision", Command_NightVision, ADMFLAG_SLAY);
RegAdminCmd("sm_sf2_force_escape", Command_ForceEscape, ADMFLAG_CHEATS);
RegAdminCmd("sm_sf2_set_difficulty", Command_ForceDifficulty, ADMFLAG_SLAY);

// Hook onto existing console commands.
AddCommandListener(Hook_CommandBuild, "build");
Expand Down Expand Up @@ -1681,6 +1691,7 @@ static void PrecacheStuff()

PrecacheModel(PAGE_MODEL, true);
PrecacheModel(SF_KEYMODEL, true);
PrecacheModel(TRAP_MODEL, true);

PrecacheSound2(FLASHLIGHT_CLICKSOUND);
PrecacheSound2(FLASHLIGHT_CLICKSOUND_NIGHTVISION);
Expand Down Expand Up @@ -1742,6 +1753,9 @@ static void PrecacheStuff()

//PrecacheSound2(NINETYSMUSIC);
PrecacheSound2(TRIPLEBOSSESMUSIC);

PrecacheSound2(TRAP_CLOSE);
PrecacheSound2(TRAP_DEPLOY);

PrecacheSound2(PROXY_RAGE_MODE_SOUND);

Expand Down Expand Up @@ -1796,6 +1810,18 @@ static void PrecacheStuff()
AddFileToDownloadsTable("materials/models/Jason278/Slender/Sheets/Sheet_8.vtf");
AddFileToDownloadsTable("materials/models/Jason278/Slender/Sheets/Sheet_8.vmt");

AddFileToDownloadsTable("models/mentrillum/traps/beartrap.mdl");
AddFileToDownloadsTable("models/mentrillum/traps/beartrap.sw.vtx");
AddFileToDownloadsTable("models/mentrillum/traps/beartrap.dx80.vtx");
AddFileToDownloadsTable("models/mentrillum/traps/beartrap.dx90.vtx");
AddFileToDownloadsTable("models/mentrillum/traps/beartrap.phy");
AddFileToDownloadsTable("models/mentrillum/traps/beartrap.vvd");

AddFileToDownloadsTable("materials/models/mentrillum/traps/beartrap/trap_m.vtf");
AddFileToDownloadsTable("materials/models/mentrillum/traps/beartrap/trap_m.vmt");
AddFileToDownloadsTable("materials/models/mentrillum/traps/beartrap/trap_n.vtf");
AddFileToDownloadsTable("materials/models/mentrillum/traps/beartrap/trap_r.vtf");

// pvp
PvP_Precache();
}
Expand Down Expand Up @@ -2871,6 +2897,47 @@ public Action Command_ForceEscape(int iClient,int args)

return Plugin_Handled;
}
public Action Command_ForceDifficulty(int iClient,int args)
{
if (!g_bEnabled) return Plugin_Continue;

if (args == 0)
{
ReplyToCommand(iClient, "Usage: sm_sf2_set_difficulty <difficulty 1-5>");
return Plugin_Handled;
}

if (IsRoundEnding() || IsRoundInWarmup())
{
CPrintToChat(iClient, "{yellow}%t{default}%T", "SF2 Prefix", "SF2 Cannot Use Command", iClient);
return Plugin_Handled;
}

char arg1[32];
GetCmdArg(1, arg1, sizeof(arg1));

int iNewDifficulty = StringToInt(arg1);

if (iNewDifficulty < 6)
{
SetConVarInt(g_cvDifficulty, iNewDifficulty);
}
else
{
SetConVarInt(g_cvDifficulty, 5);
}

switch (iNewDifficulty)
{
case Difficulty_Normal: CPrintToChatAll("{yellow}%t{collectors}%N {default}set the difficulty to {yellow}%t{default}.", "SF2 Prefix", iClient, "SF2 Normal Difficulty");
case Difficulty_Hard: CPrintToChatAll("{yellow}%t{collectors}%N {default}set the difficulty to {orange}%t{default}.", "SF2 Prefix", iClient, "SF2 Hard Difficulty");
case Difficulty_Insane: CPrintToChatAll("{yellow}%t{collectors}%N {default}set the difficulty to {red}%t{default}.", "SF2 Prefix", iClient, "SF2 Insane Difficulty");
case Difficulty_Nightmare: CPrintToChatAll("{yellow}%t{collectors}%N {default}set the difficulty to {valve}Nightmare!", "SF2 Prefix", iClient);
case Difficulty_Apollyon: CPrintToChatAll("{yellow}%t{collectors}%N {default}set the difficulty to {darkgray}Apollyon!", "SF2 Prefix", iClient);
}

return Plugin_Handled;
}
public Action Command_AddSlender(int iClient,int args)
{
if (!g_bEnabled) return Plugin_Continue;
Expand Down Expand Up @@ -6682,6 +6749,9 @@ public Action Event_PlayerSpawn(Handle event, const char[] name, bool dB)
g_iPlayerHitsToCrits[iClient] = 0;
g_iPlayerHitsToHeads[iClient] = 0;

g_bPlayerTrapped[iClient] = false;
g_iPlayerTrapCount[iClient] = 0;

if (IsPlayerAlive(iClient) && IsClientParticipating(iClient))
{
if(MusicActive() || SF_SpecialRound(SPECIALROUND_TRIPLEBOSSES))//A boss is overriding the music.
Expand Down Expand Up @@ -6883,14 +6953,26 @@ public Action Event_PlayerDeathPre(Event event, const char[] name, bool dB)
SetEntPropString(iSourceTV, Prop_Data, "m_szNetname", sBossName);

event.SetString("assister_fallback","");
if (NPCGetFlags(npcIndex) & SFF_WEAPONKILLS)
if (NPCGetFlags(npcIndex) & SFF_WEAPONKILLS || NPCGetFlags(npcIndex) & SFF_WEAPONKILLSONRADIUS)
{
char sWeaponType[PLATFORM_MAX_PATH];
int iWeaponNum = GetProfileAttackNum(sProfile, "attack_weapontypeint", 0, iAttackIndex+1);
GetProfileAttackString(sProfile, "attack_weapontype", sWeaponType, sizeof(sWeaponType), "", iAttackIndex+1);
event.SetString("weapon_logclassname",sWeaponType);
event.SetString("weapon",sWeaponType);
event.SetInt("customkill",iWeaponNum);
if (NPCGetFlags(npcIndex) & SFF_WEAPONKILLS)
{
char sWeaponType[PLATFORM_MAX_PATH];
int iWeaponNum = GetProfileAttackNum(sProfile, "attack_weapontypeint", 0, iAttackIndex+1);
GetProfileAttackString(sProfile, "attack_weapontype", sWeaponType, sizeof(sWeaponType), "", iAttackIndex+1);
event.SetString("weapon_logclassname",sWeaponType);
event.SetString("weapon",sWeaponType);
event.SetInt("customkill",iWeaponNum);
}
else if (NPCGetFlags(npcIndex) & SFF_WEAPONKILLSONRADIUS)
{
char sWeaponType[PLATFORM_MAX_PATH];
int iWeaponNum = GetProfileNum(sProfile, "kill_weapontypeint", 0);
GetProfileString(sProfile, "kill_weapontype", sWeaponType, sizeof(sWeaponType));
event.SetString("weapon_logclassname",sWeaponType);
event.SetString("weapon",sWeaponType);
event.SetInt("customkill",iWeaponNum);
}
}
else
{
Expand Down Expand Up @@ -7261,6 +7343,9 @@ public Action Event_PlayerDeath(Event event, const char[] name, bool dB)
g_bPlayerGettingPageReward[iClient] = false;
g_iPlayerHitsToCrits[iClient] = 0;
g_iPlayerHitsToHeads[iClient] = 0;

g_bPlayerTrapped[iClient] = false;
g_iPlayerTrapCount[iClient] = 0;
}
if (!IsRoundEnding() && !g_bRoundWaitingForPlayers)
{
Expand Down
Loading

0 comments on commit a456e20

Please sign in to comment.