diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c5e7f5..9bf09b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,13 @@ jobs: spcomp -i ./ rrm_marked.sp spcomp -i ./ rrm_medieval.sp spcomp -i ./ rrm_milk.sp + spcomp -i ./ rrm_powerup_agility.sp + spcomp -i ./ rrm_powerup_haste.sp + spcomp -i ./ rrm_powerup_plague.sp + spcomp -i ./ rrm_powerup_precision.sp + spcomp -i ./ rrm_powerup_resistance.sp + spcomp -i ./ rrm_powerup_strength.sp + spcomp -i ./ rrm_powerup_vampire.sp spcomp -i ./ rrm_resize.sp spcomp -i ./ rrm_stun.sp spcomp -i ./ rrm_taunt.sp \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 81d0869..b48de22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,13 @@ jobs: spcomp -i ./ rrm_marked.sp spcomp -i ./ rrm_medieval.sp spcomp -i ./ rrm_milk.sp + spcomp -i ./ rrm_powerup_agility.sp + spcomp -i ./ rrm_powerup_haste.sp + spcomp -i ./ rrm_powerup_plague.sp + spcomp -i ./ rrm_powerup_precision.sp + spcomp -i ./ rrm_powerup_resistance.sp + spcomp -i ./ rrm_powerup_strength.sp + spcomp -i ./ rrm_powerup_vampire.sp spcomp -i ./ rrm_resize.sp spcomp -i ./ rrm_stun.sp spcomp -i ./ rrm_taunt.sp diff --git a/rrm_powerup_agility.sp b/rrm_powerup_agility.sp new file mode 100644 index 0000000..be06002 --- /dev/null +++ b/rrm_powerup_agility.sp @@ -0,0 +1,89 @@ +// Copyright (C) 2023 Katsute | Licensed under CC BY-NC-SA 4.0 + +#pragma semicolon 1 + +#define RRM_VERSION "1.0" + +#include +#include +#include +#include +#include + +TFCond cond = TFCond_RuneAgility; + +int gEnabled = 0; + +public Plugin myinfo = { + name= "[RRM] Agility Powerup Modifier", + author = "Katsute", + description = "Modifier that grants agility powerup.", + version = "1.0" +}; + +public void OnPluginStart(){ + if(RRM_IsRegOpen()) + RegisterModifiers(); + + AddCommandListener(OnDropItem, "dropitem"); + + AutoExecConfig(true, "rrm_powerup_agility", "rrm"); +} + +public int RRM_OnRegOpen(){ + RegisterModifiers(); +} + +void RegisterModifiers(){ + RRM_Register("Agility Powerup", 0.0, 0.0, false, RRM_Callback_Powerup); +} + +public int RRM_Callback_Powerup(bool enable, float value){ + gEnabled = enable; + if(gEnabled){ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKHook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + ApplyPowerup(i); + }else{ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKUnhook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + RemovePowerup(i); + } + return gEnabled; +} + +public void OnEntityCreated(int ent, const char[] classname){ + if(gEnabled && strncmp(classname, "item_power", 10) == 0 && IsValidEntity(ent)) + AcceptEntityInput(ent, "Kill"); +} + +public void OnExitResupply(const int resupply, const int client){ + if(gEnabled && 0 < client < MaxClients && IsClientInGame(client) && IsPlayerAlive(client)) + ApplyPowerup(client); +} + +public Action OnDropItem(const int client, const char[] cmd, any args){ + if(gEnabled) + return Plugin_Handled; + return Plugin_Continue; +} + +public void ApplyPowerup(const int client){ + if(!TF2_IsPlayerInCondition(client, cond)){ + TF2_AddCondition(client, cond); + TF2_RegeneratePlayer(client); + } +} + +public void RemovePowerup(const int client){ + if(TF2_IsPlayerInCondition(client, cond)) + TF2_RemoveCondition(client, cond); +} \ No newline at end of file diff --git a/rrm_powerup_haste.sp b/rrm_powerup_haste.sp new file mode 100644 index 0000000..45eff94 --- /dev/null +++ b/rrm_powerup_haste.sp @@ -0,0 +1,89 @@ +// Copyright (C) 2023 Katsute | Licensed under CC BY-NC-SA 4.0 + +#pragma semicolon 1 + +#define RRM_VERSION "1.0" + +#include +#include +#include +#include +#include + +TFCond cond = TFCond_RuneHaste; + +int gEnabled = 0; + +public Plugin myinfo = { + name= "[RRM] Haste Powerup Modifier", + author = "Katsute", + description = "Modifier that grants haste powerup.", + version = "1.0" +}; + +public void OnPluginStart(){ + if(RRM_IsRegOpen()) + RegisterModifiers(); + + AddCommandListener(OnDropItem, "dropitem"); + + AutoExecConfig(true, "rrm_powerup_haste", "rrm"); +} + +public int RRM_OnRegOpen(){ + RegisterModifiers(); +} + +void RegisterModifiers(){ + RRM_Register("Haste Powerup", 0.0, 0.0, false, RRM_Callback_Powerup); +} + +public int RRM_Callback_Powerup(bool enable, float value){ + gEnabled = enable; + if(gEnabled){ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKHook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + ApplyPowerup(i); + }else{ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKUnhook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + RemovePowerup(i); + } + return gEnabled; +} + +public void OnEntityCreated(int ent, const char[] classname){ + if(gEnabled && strncmp(classname, "item_power", 10) == 0 && IsValidEntity(ent)) + AcceptEntityInput(ent, "Kill"); +} + +public void OnExitResupply(const int resupply, const int client){ + if(gEnabled && 0 < client < MaxClients && IsClientInGame(client) && IsPlayerAlive(client)) + ApplyPowerup(client); +} + +public Action OnDropItem(const int client, const char[] cmd, any args){ + if(gEnabled) + return Plugin_Handled; + return Plugin_Continue; +} + +public void ApplyPowerup(const int client){ + if(!TF2_IsPlayerInCondition(client, cond)){ + TF2_AddCondition(client, cond); + TF2_RegeneratePlayer(client); + } +} + +public void RemovePowerup(const int client){ + if(TF2_IsPlayerInCondition(client, cond)) + TF2_RemoveCondition(client, cond); +} \ No newline at end of file diff --git a/rrm_powerup_plague.sp b/rrm_powerup_plague.sp new file mode 100644 index 0000000..8f4a598 --- /dev/null +++ b/rrm_powerup_plague.sp @@ -0,0 +1,89 @@ +// Copyright (C) 2023 Katsute | Licensed under CC BY-NC-SA 4.0 + +#pragma semicolon 1 + +#define RRM_VERSION "1.0" + +#include +#include +#include +#include +#include + +TFCond cond = TFCond_PlagueRune; + +int gEnabled = 0; + +public Plugin myinfo = { + name= "[RRM] Plague Powerup Modifier", + author = "Katsute", + description = "Modifier that grants plague powerup.", + version = "1.0" +}; + +public void OnPluginStart(){ + if(RRM_IsRegOpen()) + RegisterModifiers(); + + AddCommandListener(OnDropItem, "dropitem"); + + AutoExecConfig(true, "rrm_powerup_plague", "rrm"); +} + +public int RRM_OnRegOpen(){ + RegisterModifiers(); +} + +void RegisterModifiers(){ + RRM_Register("Plague Powerup", 0.0, 0.0, false, RRM_Callback_Powerup); +} + +public int RRM_Callback_Powerup(bool enable, float value){ + gEnabled = enable; + if(gEnabled){ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKHook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + ApplyPowerup(i); + }else{ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKUnhook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + RemovePowerup(i); + } + return gEnabled; +} + +public void OnEntityCreated(int ent, const char[] classname){ + if(gEnabled && strncmp(classname, "item_power", 10) == 0 && IsValidEntity(ent)) + AcceptEntityInput(ent, "Kill"); +} + +public void OnExitResupply(const int resupply, const int client){ + if(gEnabled && 0 < client < MaxClients && IsClientInGame(client) && IsPlayerAlive(client)) + ApplyPowerup(client); +} + +public Action OnDropItem(const int client, const char[] cmd, any args){ + if(gEnabled) + return Plugin_Handled; + return Plugin_Continue; +} + +public void ApplyPowerup(const int client){ + if(!TF2_IsPlayerInCondition(client, cond)){ + TF2_AddCondition(client, cond); + TF2_RegeneratePlayer(client); + } +} + +public void RemovePowerup(const int client){ + if(TF2_IsPlayerInCondition(client, cond)) + TF2_RemoveCondition(client, cond); +} \ No newline at end of file diff --git a/rrm_powerup_precision.sp b/rrm_powerup_precision.sp new file mode 100644 index 0000000..4b86a3e --- /dev/null +++ b/rrm_powerup_precision.sp @@ -0,0 +1,89 @@ +// Copyright (C) 2023 Katsute | Licensed under CC BY-NC-SA 4.0 + +#pragma semicolon 1 + +#define RRM_VERSION "1.0" + +#include +#include +#include +#include +#include + +TFCond cond = TFCond_RunePrecision; + +int gEnabled = 0; + +public Plugin myinfo = { + name= "[RRM] Precision Powerup Modifier", + author = "Katsute", + description = "Modifier that grants precision powerup.", + version = "1.0" +}; + +public void OnPluginStart(){ + if(RRM_IsRegOpen()) + RegisterModifiers(); + + AddCommandListener(OnDropItem, "dropitem"); + + AutoExecConfig(true, "rrm_powerup_precision", "rrm"); +} + +public int RRM_OnRegOpen(){ + RegisterModifiers(); +} + +void RegisterModifiers(){ + RRM_Register("Precision Powerup", 0.0, 0.0, false, RRM_Callback_Powerup); +} + +public int RRM_Callback_Powerup(bool enable, float value){ + gEnabled = enable; + if(gEnabled){ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKHook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + ApplyPowerup(i); + }else{ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKUnhook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + RemovePowerup(i); + } + return gEnabled; +} + +public void OnEntityCreated(int ent, const char[] classname){ + if(gEnabled && strncmp(classname, "item_power", 10) == 0 && IsValidEntity(ent)) + AcceptEntityInput(ent, "Kill"); +} + +public void OnExitResupply(const int resupply, const int client){ + if(gEnabled && 0 < client < MaxClients && IsClientInGame(client) && IsPlayerAlive(client)) + ApplyPowerup(client); +} + +public Action OnDropItem(const int client, const char[] cmd, any args){ + if(gEnabled) + return Plugin_Handled; + return Plugin_Continue; +} + +public void ApplyPowerup(const int client){ + if(!TF2_IsPlayerInCondition(client, cond)){ + TF2_AddCondition(client, cond); + TF2_RegeneratePlayer(client); + } +} + +public void RemovePowerup(const int client){ + if(TF2_IsPlayerInCondition(client, cond)) + TF2_RemoveCondition(client, cond); +} \ No newline at end of file diff --git a/rrm_powerup_resistance.sp b/rrm_powerup_resistance.sp new file mode 100644 index 0000000..a7d9a33 --- /dev/null +++ b/rrm_powerup_resistance.sp @@ -0,0 +1,89 @@ +// Copyright (C) 2023 Katsute | Licensed under CC BY-NC-SA 4.0 + +#pragma semicolon 1 + +#define RRM_VERSION "1.0" + +#include +#include +#include +#include +#include + +TFCond cond = TFCond_RuneResist; + +int gEnabled = 0; + +public Plugin myinfo = { + name= "[RRM] Resistance Powerup Modifier", + author = "Katsute", + description = "Modifier that grants resistance powerup.", + version = "1.0" +}; + +public void OnPluginStart(){ + if(RRM_IsRegOpen()) + RegisterModifiers(); + + AddCommandListener(OnDropItem, "dropitem"); + + AutoExecConfig(true, "rrm_powerup_resistance", "rrm"); +} + +public int RRM_OnRegOpen(){ + RegisterModifiers(); +} + +void RegisterModifiers(){ + RRM_Register("Resistance Powerup", 0.0, 0.0, false, RRM_Callback_Powerup); +} + +public int RRM_Callback_Powerup(bool enable, float value){ + gEnabled = enable; + if(gEnabled){ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKHook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + ApplyPowerup(i); + }else{ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKUnhook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + RemovePowerup(i); + } + return gEnabled; +} + +public void OnEntityCreated(int ent, const char[] classname){ + if(gEnabled && strncmp(classname, "item_power", 10) == 0 && IsValidEntity(ent)) + AcceptEntityInput(ent, "Kill"); +} + +public void OnExitResupply(const int resupply, const int client){ + if(gEnabled && 0 < client < MaxClients && IsClientInGame(client) && IsPlayerAlive(client)) + ApplyPowerup(client); +} + +public Action OnDropItem(const int client, const char[] cmd, any args){ + if(gEnabled) + return Plugin_Handled; + return Plugin_Continue; +} + +public void ApplyPowerup(const int client){ + if(!TF2_IsPlayerInCondition(client, cond)){ + TF2_AddCondition(client, cond); + TF2_RegeneratePlayer(client); + } +} + +public void RemovePowerup(const int client){ + if(TF2_IsPlayerInCondition(client, cond)) + TF2_RemoveCondition(client, cond); +} \ No newline at end of file diff --git a/rrm_powerup_strength.sp b/rrm_powerup_strength.sp new file mode 100644 index 0000000..470cf92 --- /dev/null +++ b/rrm_powerup_strength.sp @@ -0,0 +1,89 @@ +// Copyright (C) 2023 Katsute | Licensed under CC BY-NC-SA 4.0 + +#pragma semicolon 1 + +#define RRM_VERSION "1.0" + +#include +#include +#include +#include +#include + +TFCond cond = TFCond_RuneStrength; + +int gEnabled = 0; + +public Plugin myinfo = { + name= "[RRM] Strength Powerup Modifier", + author = "Katsute", + description = "Modifier that grants strength powerup.", + version = "1.0" +}; + +public void OnPluginStart(){ + if(RRM_IsRegOpen()) + RegisterModifiers(); + + AddCommandListener(OnDropItem, "dropitem"); + + AutoExecConfig(true, "rrm_powerup_strength", "rrm"); +} + +public int RRM_OnRegOpen(){ + RegisterModifiers(); +} + +void RegisterModifiers(){ + RRM_Register("Strength Powerup", 0.0, 0.0, false, RRM_Callback_Powerup); +} + +public int RRM_Callback_Powerup(bool enable, float value){ + gEnabled = enable; + if(gEnabled){ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKHook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + ApplyPowerup(i); + }else{ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKUnhook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + RemovePowerup(i); + } + return gEnabled; +} + +public void OnEntityCreated(int ent, const char[] classname){ + if(gEnabled && strncmp(classname, "item_power", 10) == 0 && IsValidEntity(ent)) + AcceptEntityInput(ent, "Kill"); +} + +public void OnExitResupply(const int resupply, const int client){ + if(gEnabled && 0 < client < MaxClients && IsClientInGame(client) && IsPlayerAlive(client)) + ApplyPowerup(client); +} + +public Action OnDropItem(const int client, const char[] cmd, any args){ + if(gEnabled) + return Plugin_Handled; + return Plugin_Continue; +} + +public void ApplyPowerup(const int client){ + if(!TF2_IsPlayerInCondition(client, cond)){ + TF2_AddCondition(client, cond); + TF2_RegeneratePlayer(client); + } +} + +public void RemovePowerup(const int client){ + if(TF2_IsPlayerInCondition(client, cond)) + TF2_RemoveCondition(client, cond); +} \ No newline at end of file diff --git a/rrm_powerup_vampire.sp b/rrm_powerup_vampire.sp new file mode 100644 index 0000000..460a08a --- /dev/null +++ b/rrm_powerup_vampire.sp @@ -0,0 +1,89 @@ +// Copyright (C) 2023 Katsute | Licensed under CC BY-NC-SA 4.0 + +#pragma semicolon 1 + +#define RRM_VERSION "1.0" + +#include +#include +#include +#include +#include + +TFCond cond = TFCond_RuneVampire; + +int gEnabled = 0; + +public Plugin myinfo = { + name= "[RRM] Vampire Powerup Modifier", + author = "Katsute", + description = "Modifier that grants vampire powerup.", + version = "1.0" +}; + +public void OnPluginStart(){ + if(RRM_IsRegOpen()) + RegisterModifiers(); + + AddCommandListener(OnDropItem, "dropitem"); + + AutoExecConfig(true, "rrm_powerup_vampire", "rrm"); +} + +public int RRM_OnRegOpen(){ + RegisterModifiers(); +} + +void RegisterModifiers(){ + RRM_Register("Vampire Powerup", 0.0, 0.0, false, RRM_Callback_Powerup); +} + +public int RRM_Callback_Powerup(bool enable, float value){ + gEnabled = enable; + if(gEnabled){ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKHook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + ApplyPowerup(i); + }else{ + int ent; + while((ent = FindEntityByClassname(ent, "func_respawnroom")) != -1) + SDKUnhook(ent, SDKHook_EndTouchPost, OnExitResupply); + + for(int i = 1; i < MaxClients; i++) + if(IsClientInGame(i) && IsPlayerAlive(i)) + RemovePowerup(i); + } + return gEnabled; +} + +public void OnEntityCreated(int ent, const char[] classname){ + if(gEnabled && strncmp(classname, "item_power", 10) == 0 && IsValidEntity(ent)) + AcceptEntityInput(ent, "Kill"); +} + +public void OnExitResupply(const int resupply, const int client){ + if(gEnabled && 0 < client < MaxClients && IsClientInGame(client) && IsPlayerAlive(client)) + ApplyPowerup(client); +} + +public Action OnDropItem(const int client, const char[] cmd, any args){ + if(gEnabled) + return Plugin_Handled; + return Plugin_Continue; +} + +public void ApplyPowerup(const int client){ + if(!TF2_IsPlayerInCondition(client, cond)){ + TF2_AddCondition(client, cond); + TF2_RegeneratePlayer(client); + } +} + +public void RemovePowerup(const int client){ + if(TF2_IsPlayerInCondition(client, cond)) + TF2_RemoveCondition(client, cond); +} \ No newline at end of file