v8.2.0a
+ Added documentation to FastFire2 - Removed some headers - Removed some includes - Made some functions private - Moved precaches to the precache function - Moved onslaughter tick code to appropriate BossHandler - Removed spaghetti code from debug commands + Made music menu display forever - Renamed menus - Moved OnFastFire2Ready lighting reset function to the WeatherManager reset function + Took control of admin commands during certain... situations :) + Added scripts for certain... situations :) + Added custom hud text renderer + Bump version
This commit is contained in:
@@ -6,6 +6,7 @@ enum struct BOSSHANDLER {
|
||||
bool isAlive;
|
||||
bool shouldTick;
|
||||
bool shouldTickBGM;
|
||||
bool sOverflow;
|
||||
bool tickBuster;
|
||||
bool tickBusterNuclear;
|
||||
float fAng[3];
|
||||
@@ -48,7 +49,18 @@ enum struct BOSSHANDLER {
|
||||
if(this.tickBuster) this.TickBuster();
|
||||
switch(this.bossID){
|
||||
case 0:{
|
||||
|
||||
float pos[3], ang[3], vel[3], newPos[3];
|
||||
vel[0] = 0.0;
|
||||
vel[1] = 0.0;
|
||||
vel[2] = 0.0;
|
||||
int BossEnt = FindEntityByTargetname("FB.BruteJusticeTrain", "func_tracktrain");
|
||||
int BossTP = FindEntityByTargetname("FB.OnslaughterBase", "base_boss");
|
||||
GetEntPropVector(BossEnt, Prop_Send, "m_vecOrigin", pos);
|
||||
GetEntPropVector(BossEnt, Prop_Data, "m_angRotation", ang);
|
||||
newPos[0] = pos[0];
|
||||
newPos[1] = pos[1];
|
||||
newPos[2] = pos[2] + 0.0;
|
||||
TeleportEntity(BossTP, newPos, ang, vel);
|
||||
}
|
||||
case 1:{
|
||||
|
||||
@@ -144,6 +156,33 @@ enum struct BOSSHANDLER {
|
||||
}
|
||||
}
|
||||
}
|
||||
case 69:{
|
||||
int eCount = 0;
|
||||
for (int i = 1; i <= MaxClients; i++) {
|
||||
if (!IsClientInGame(i)) continue;
|
||||
if (GetClientTeam(i) == TFTeam_Red && TF2_GetPlayerClass(i) == TFClass_Engineer) eCount++;
|
||||
}
|
||||
int sCount = 0;
|
||||
int ent = -1
|
||||
while ((ent = FindEntityByClassname(ent, "obj_sentrygun")) != -1) {
|
||||
if (!IsValidEntity(ent)) continue;
|
||||
if (this.sOverflow) {
|
||||
SetEntProp(ent, Prop_Send, "m_iTeamNum", TFTeam_Blue);
|
||||
SetEntPropEnt(ent, Prop_Data, "m_hOwnerEntity", 0);
|
||||
}
|
||||
if (GetEntProp(ent, Prop_Send, "m_iTeamNum") == TFTeam_Red) {
|
||||
sCount++;
|
||||
PrintToChatAll("Found %i sentry guns. I'm watching your ass...", sCount);
|
||||
if (sCount > eCount * 7){
|
||||
PrintToChatAll("[FARTSY.DLL] TOO MANY SENTRIES DETECTED. PREPARE TO DIE. WOLOLOOOOOOO!");
|
||||
this.sOverflow = true;
|
||||
ent = -1;
|
||||
sCount = 0;
|
||||
CreateTimer(3.0, TimedOperator, 42690);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//For tracking bgm and updating bgm based on player emnity
|
||||
|
@@ -10,7 +10,6 @@ public Action Command_AOE(int client, int args){
|
||||
}
|
||||
|
||||
public Action Command_SetFogDensity(int client, int args){
|
||||
tickOnslaughter = true;
|
||||
char arg1[5];
|
||||
GetCmdArg(1, arg1, sizeof(arg1));
|
||||
WeatherManager.fogTarget = StringToFloat(arg1);
|
||||
|
@@ -135,15 +135,15 @@ public Action Command_Music(int client, int args) {
|
||||
public void ShowFartsyMusicMenu(int client) {
|
||||
Menu menu = new Menu(MenuHandlerFartsyMusic, MENU_ACTIONS_DEFAULT);
|
||||
char buffer[100];
|
||||
menu.SetTitle("FartsysAss Music Menu");
|
||||
menu.SetTitle("Fartsy's Music Menu");
|
||||
for (int i = 0; i < sizeof(BGMArray); i++) menu.AddItem(buffer, BGMArray[i].songName);
|
||||
menu.Display(client, 20);
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
menu.ExitButton = true;
|
||||
}
|
||||
|
||||
//Set Fartsy Sound menu
|
||||
public void FartsysSNDSelected(int client, CookieMenuAction action, any info, char[] buffer, int maxlen) {
|
||||
if (action == CookieMenuAction_SelectOption) ShowFartsyMenu(client);
|
||||
public void FartsysSNDSelected(int client, MenuAction action, any info, char[] buffer, int maxlen) {
|
||||
if (action == MenuAction_Select) ShowFartsyMenu(client);
|
||||
}
|
||||
|
||||
// Get clients sound preferences then send them the menu
|
||||
@@ -164,7 +164,7 @@ public Action Command_Sounds(int client, int args) {
|
||||
public void ShowFartsyMenu(int client) {
|
||||
Menu menu = new Menu(MenuHandlerFartsy, MENU_ACTIONS_DEFAULT);
|
||||
char buffer[100];
|
||||
menu.SetTitle("FartsysAss Sound Menu");
|
||||
menu.SetTitle("Fartsy's Sound Menu");
|
||||
menu.AddItem(buffer, "Disable ALL");
|
||||
menu.AddItem(buffer, "Music Only");
|
||||
menu.AddItem(buffer, "Sound Effects Only");
|
||||
@@ -588,6 +588,7 @@ enum struct WEATHERMANAGER {
|
||||
FastFire2("Weather.Sky", "Enable", "", 0.0, false);
|
||||
FastFire2("Weather.Sky", "Skin", "0", 0.0, false);
|
||||
FastFire2("Weather.FogSky", "Enable", "", 2.0, false);
|
||||
for (int i = 0; i < sizeof(MapLighting); i++) MapLighting[i].Repair();
|
||||
}
|
||||
void SetFogStartQueued(const char[] fsq){
|
||||
FastFire2("Weather.FogOutdoor", "SetStartDistLerpTo", fsq, 0.0, false);
|
||||
|
@@ -9,7 +9,6 @@ enum {
|
||||
enum struct PLAYERDATA {
|
||||
char classname;
|
||||
char name;
|
||||
|
||||
}
|
||||
void AssLogger(int logLevel, const char[] logData, any...) {
|
||||
char buffer[256];
|
||||
@@ -97,7 +96,6 @@ enum struct COREDATA {
|
||||
}
|
||||
}
|
||||
COREDATA core;
|
||||
bool tickOnslaughter;
|
||||
|
||||
Database Ass_Database;
|
||||
int attemptSpawn = 0;
|
||||
@@ -1000,6 +998,16 @@ stock int TF2_GetPlayerMaxHealth(int client) {
|
||||
}
|
||||
|
||||
void RegisterAndPrecacheAllFiles(){
|
||||
PrecacheSound(TBGM0, true);
|
||||
PrecacheSound(TBGM2, true);
|
||||
PrecacheSound(TBGM3, true);
|
||||
PrecacheSound(TBGM4, true);
|
||||
PrecacheSound(TBGM5, true);
|
||||
PrecacheSound(TBGM6, true);
|
||||
PrintToServer("PRECACHING THESE SOUNDS SO EARLY IS NOT INTENTIONAL, PLEASE FIX THIS FARTSY.");
|
||||
PrecacheSound("fartsy/misc/brawler/fartsy_dll/intro.mp3", true);
|
||||
PrecacheSound("fartsy/misc/brawler/fartsy_dll/terror.mp3", true);
|
||||
PrecacheSound("fartsy/music/tcmusic/humanhypothesis.wav", true);
|
||||
AssLogger(0, "Loading EVERYTHING to RAM...");
|
||||
Handle confBGM = OpenFile("addons/sourcemod/configs/FartsysAss/Files/music.ini", "rt", false);
|
||||
Handle confSFX = OpenFile("addons/sourcemod/configs/FartsysAss/Files/sfx.ini", "rt", false);
|
||||
@@ -1382,7 +1390,8 @@ public Action PerformWaveSetup() {
|
||||
for (int i = 8; i < sizeof(WaveSetup) - 2; i++) FastFire2(WaveSetup[i], "", "", 0.0, true);
|
||||
}
|
||||
case 5, 12, 19: {
|
||||
tickOnslaughter = true;
|
||||
Get_Boss_Handler().bossID = 0;
|
||||
Get_Boss_Handler().shouldTick = true;
|
||||
core.HWNMax = 260.0;
|
||||
core.HWNMin = 140.0;
|
||||
for (int i = 8; i < sizeof(WaveSetup) - 2; i++) FastFire2(WaveSetup[i], "", "", 0.0, true);
|
||||
@@ -1715,3 +1724,26 @@ public void OnClientPostAdminCheck(int client) {
|
||||
Ass_Database.Query(SQL_SNDPrefs, queryID, client);
|
||||
}
|
||||
}
|
||||
/* Sends hud text to players
|
||||
* @param channel The channel to use (1 - 4)
|
||||
* @param text The text to display
|
||||
* @param posX X pos L-R (0 to 1)
|
||||
* @param posY Y pos U-D (0 to 1)
|
||||
* @param holdTime Time to display the text
|
||||
* @param color1[4] Target Color rgba
|
||||
* @param color2[4] Initial Color rgba
|
||||
* @param effect 0/1 Fade In / Out, 2 = Scan Out
|
||||
* @param fxTime Time it takes for the effect to run
|
||||
* @param fadeIn Time it takes for the text to fade in
|
||||
* @param fadeOut Time it takes for the text to fade out
|
||||
*/
|
||||
void SendHudTextAll(int channel, const char[] text, float posX, float posY, float holdTime, int color1[4], int color2[4], int effect, float fxTime, float fadeIn, float fadeOut){
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if (IsClientInGame(i))
|
||||
{
|
||||
SetHudTextParamsEx(posX, posY, holdTime, color1, color2, effect, fxTime, fadeIn, fadeOut);
|
||||
ShowHudText(i, channel, text);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
public char PLUGIN_VERSION[8] = "8.1.0c";
|
||||
public char PLUGIN_VERSION[8] = "8.2.0a";
|
||||
void sudo(int task) {
|
||||
AssLogger(LOGLVL_DEBUG, "Calling sudo with %i", task);
|
||||
switch (task) {
|
||||
@@ -11,7 +11,7 @@ void sudo(int task) {
|
||||
case 1: {
|
||||
core.tacobell = false;
|
||||
ServerCommand("fb_startmoney 50000");
|
||||
CPrintToChatAll("{darkviolet}[{yellow}INFO{darkviolet}] {red}PROFESSOR'S ASS {white}v0x20 (Core-v%s). Prepare yourself for the unpredictable... [{limegreen}by TTV/ProfessorFartsalot{white}]", PLUGIN_VERSION);
|
||||
CPrintToChatAll("{darkviolet}[{yellow}INFO{darkviolet}] {red}PROFESSOR'S ASS {white}v0x22 (Core-v%s). Prepare yourself for the unpredictable... [{limegreen}by TTV/ProfessorFartsalot{white}]", PLUGIN_VERSION);
|
||||
FastFire2("rain", "Alpha", "0", 0.0, false);
|
||||
UpdateGamemode();
|
||||
}
|
||||
@@ -541,10 +541,11 @@ void sudo(int task) {
|
||||
}
|
||||
//Onslaughter dead
|
||||
case 137:{
|
||||
tickOnslaughter = false;
|
||||
BossHandler.shouldTick = false;
|
||||
FastFire2("OnslaughterTank", "SetHealth", "1", 0.0, false);
|
||||
FastFire2("TankRelayDMG", "Enable", "", 0.0, false);
|
||||
FastFire2("TankRelayDMG", "Disable", "", 10.0, false);
|
||||
BossHandler.isAlive = false;
|
||||
}
|
||||
//Sephiroth dead (future code)
|
||||
case 138:{
|
||||
@@ -585,7 +586,6 @@ void sudo(int task) {
|
||||
}
|
||||
//Reset Map
|
||||
case 300: {
|
||||
tickOnslaughter = false;
|
||||
AudioManager.Reset();
|
||||
BossHandler.shouldTick = false;
|
||||
core.Reset();
|
||||
@@ -625,7 +625,8 @@ void sudo(int task) {
|
||||
case 305: {
|
||||
EmitSoundToAll(BGMArray[6].realPath, _, AudioManager.chanBGM, BGMArray[6].SNDLVL, SND_CHANGEVOL, 1.0, _, _, _, _, _, _);
|
||||
}
|
||||
case 420:{ //Init/Reset Wave Null.
|
||||
case 420:{ // Init/Reset Wave Null.
|
||||
CPrintToChatAll("{red} [CORE] WARNING: Initializing Wave Null... Welcome to a new kind of tension, everything isn't meant to be okay. :')");
|
||||
UpdateGamemode();
|
||||
FastFire2("Weather.Sky", "Skin", "3", 0.0, false);
|
||||
WeatherManager.fogDensity = 0.1;
|
||||
@@ -892,10 +893,46 @@ void sudo(int task) {
|
||||
case 20000:{
|
||||
BossHandler.EmitSpawnSound(2);
|
||||
}
|
||||
case 42690:{
|
||||
BossHandler.bossID = 69;
|
||||
BossHandler.shouldTick = true;
|
||||
BossHandler.isAlive = true;
|
||||
EmitSoundToAll("fartsy/misc/brawler/fartsy_dll/intro.mp3");
|
||||
PrintToConsoleAll("Loading FARTSY.DLL from C:\\Windows\\System32 ...");
|
||||
PrintToServer("Loading FARTSY.IMG from /boot/efi ...");
|
||||
PrintToChatAll("FARTSY.DLL has joined the game");
|
||||
ServerCommand("sm_mortal @all");
|
||||
AddCommandListener(CommandOverride, "sm_buddha");
|
||||
AddCommandListener(CommandOverride, "sm_gimme");
|
||||
AddCommandListener(CommandOverride, "sm_givew");
|
||||
AddCommandListener(CommandOverride, "sm_gi");
|
||||
AddCommandListener(CommandOverride, "sm_god");
|
||||
AddCommandListener(CommandOverride, "sm_admin");
|
||||
AddCommandListener(CommandOverride, "sm_noclip");
|
||||
AddCommandListener(CommandOverride, "sm_noclipme");
|
||||
CreateTimer(6.1, TimedOperator, 50000);
|
||||
}
|
||||
case 42696:{
|
||||
RemoveCommandListener(CommandOverride, "sm_buddha");
|
||||
RemoveCommandListener(CommandOverride, "sm_god");
|
||||
RemoveCommandListener(CommandOverride, "sm_gimme");
|
||||
RemoveCommandListener(CommandOverride, "sm_givew");
|
||||
RemoveCommandListener(CommandOverride, "sm_gi");
|
||||
RemoveCommandListener(CommandOverride, "sm_admin");
|
||||
RemoveCommandListener(CommandOverride, "sm_noclip");
|
||||
RemoveCommandListener(CommandOverride, "sm_noclipme");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public Action CommandOverride(int client, const char[] command, int argc)
|
||||
{
|
||||
ServerCommand(GetRandomInt(0, 1 == 1) ? "sm_slay #%i" : "sm_smite #i", GetClientUserId(client));
|
||||
PrintToChatAll ("[FARTSY.DLL] Did you REALLY think I would let you cheat, %N? How about instead of using %s you actually play the game, loser!", client, command);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
//Timed commands
|
||||
public Action TimedOperator(Handle timer, int job) {
|
||||
switch (job) {
|
||||
@@ -1067,6 +1104,87 @@ public Action TimedOperator(Handle timer, int job) {
|
||||
Emerge(BEM);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 42690: {
|
||||
BossHandler.sOverflow = false;
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50000: {
|
||||
ServerCommand("sv_cheats 1");
|
||||
for (int client = 1; client <= MaxClients; client++) if (IsClientInGame(client)) ClientCommand(client, "r_screenoverlay fartsy/fartsy_dll_core");
|
||||
ServerCommand("sv_cheats 0");
|
||||
FastFire2("FB.FadeBLCK", "Alpha", "127", 0.0, false);
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 0.0, false);
|
||||
SendHudTextAll(1, "Did you think this would be easy...?", 0.1, 0.15, 9.0, {0, 160, 0, 255}, {0, 255, 0, 255}, 2, 0.5, 0.05, 0.75);
|
||||
EmitSoundToAll("fartsy/misc/brawler/fartsy_dll/terror.mp3");
|
||||
CreateTimer(3.0, TimedOperator, 50001);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50001: {
|
||||
FastFire2("FB.FadeBLCK", "Alpha", "127", 0.0, false);
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 0.0, false);
|
||||
SendHudTextAll(2, "You can't possibly expect the same old tricks to work.... can you?~", 0.2, 0.2, 3.0, {0, 160, 0, 192}, {0, 255, 0, 192}, 2, 0.75, 0.05, 0.75);
|
||||
CreateTimer(5.0, TimedOperator, 50002);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50002: {
|
||||
FastFire2("FB.FadeBLCK", "Alpha", "127", 0.0, false);
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 0.0, false);
|
||||
SendHudTextAll(1, "LAUGH IT UP. You and I both know this is 'just another boss fight'...", 0.15, 0.25, 7.0, {0, 160, 0, 192}, {0, 255, 0, 192}, 2, 0.5, 0.05, 0.75);
|
||||
CreateTimer(5.0, TimedOperator, 50003);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50003: {
|
||||
FastFire2("FB.FadeBLCK", "Alpha", "192", 0.0, false);
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 0.0, false);
|
||||
SendHudTextAll(2, "...or is it?~", 0.2, 0.3, 2.0, {0, 160, 0, 192}, {0, 255, 0, 192}, 2, 0.5, 0.05, 0.75);
|
||||
CreateTimer(4.0, TimedOperator, 50004);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50004:{
|
||||
FastFire2("FB.FadeBLCK", "Alpha", "224", 0.0, false);
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 0.0, false);
|
||||
SendHudTextAll(1, "ARE YOU HAPPY? All of you who knew what was happening...~", 0.25, 0.35, 7.0, {0, 160, 0, 192}, {0, 255, 0, 192}, 2, 0.5, 0.05, 0.75);
|
||||
CreateTimer(5.0, TimedOperator, 50005);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50005:{
|
||||
FastFire2("FB.FadeBLCK", "Alpha", "224", 0.0, false);
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 0.0, false);
|
||||
SendHudTextAll(2, "Every last one of you...", 0.35, 0.4, 5.0, {0, 160, 0, 192}, {0, 255, 0, 192}, 1, 0.5, 0.5, 0.75);
|
||||
CreateTimer(5.0, TimedOperator, 50006);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50006:{
|
||||
FastFire2("FB.FadeBLCK", "Alpha", "192", 0.0, false);
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 0.0, false);
|
||||
SendHudTextAll(1, "I hope you're as happy as I am...~", 0.15, 0.45, 7.0, {0, 160, 0, 192}, {0, 255, 0, 192}, 2, 0.5, 0.05, 0.75);
|
||||
CreateTimer(4.0, TimedOperator, 50007);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50007:{
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 0.0, false);
|
||||
SendHudTextAll(2, "...knowing you all just spent all your time here~", 0.25, 0.5, 5.0, {0, 160, 0, 192}, {0, 255, 0, 192}, 2, 0.5, 0.05, 0.75);
|
||||
CreateTimer(5.0, TimedOperator, 50008);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50008:{
|
||||
FastFire2("FB.FadeBLCK", "Alpha", "255", 0.0, false);
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 0.0, false);
|
||||
ServerCommand("sv_cheats 1");
|
||||
for (int client = 1; client <= MaxClients; client++) if (IsClientInGame(client)) ClientCommand(client, "r_screenoverlay fartsy/fartsy_dll_anon");
|
||||
ServerCommand("sv_cheats 0");
|
||||
FastFire2("FB.FadeBLCK", "Fade", "", 3.0, false);
|
||||
SendHudTextAll(1, "JUST TO DIE!!!", 0.4, 0.6, 7.0, {255, 0, 0, 255}, {255, 0, 0, 255}, 1, 0.5, 0.05, 0.75);
|
||||
CreateTimer(5.75, TimedOperator, 50009);
|
||||
return Plugin_Stop;
|
||||
}
|
||||
case 50009:{
|
||||
ServerCommand("sv_cheats 1");
|
||||
for (int client = 1; client <= MaxClients; client++) if (IsClientInGame(client)) ClientCommand(client, "r_screenoverlay \\");
|
||||
ServerCommand("sv_cheats 0");
|
||||
EmitSoundToAll("fartsy/music/tcmusic/humanhypothesis.wav");
|
||||
return Plugin_Stop;
|
||||
}
|
||||
}
|
||||
return Plugin_Stop;
|
||||
}
|
@@ -21,7 +21,14 @@ void InjectFastFire2(){
|
||||
OnFastFire2Ready();
|
||||
}
|
||||
|
||||
//Execute inputs - EXPERT MODE
|
||||
/* Fartsy's ent_fire interface
|
||||
* @param target The target entity
|
||||
* @param input The input to execute
|
||||
* @param param Parameters if applicable
|
||||
* @param delay The delay before executing
|
||||
* @param isLegacy Whether this is legacy or not. isLegacy will use the target param as the entire fire string. Example: `FastFire2("OnUser1 Operator,Command,sm_example,0.69,1", "", "", 0.0, true);`
|
||||
* OnUser1 is mandatory before the fire string when using legacy mode. Legacy mode also requries `,1` after the string so it only fires once instead of per function call.
|
||||
*/
|
||||
public void FastFire2(const char[] target, const char[] input, const char[] param, const float delay, bool isLegacy) {
|
||||
int ff2 = EntRefToEntIndex(ff2Ref);
|
||||
char FireStr[128];
|
||||
|
Reference in New Issue
Block a user