Skip to content

Commit

Permalink
terminator outline fix
Browse files Browse the repository at this point in the history
  • Loading branch information
higps committed Aug 1, 2024
1 parent de7f279 commit 6fbdfbe
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 39 deletions.
46 changes: 28 additions & 18 deletions ability_free_tank_heavy_terminator_ability.sp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
#define TARGET_FOUND "ui/cyoa_objective_panel_expand.wav"
#define TARGET_TERMINATED "ui/cyoa_map_open.wav.wav"
#define TARGET_CANCEL "ui/cyoa_map_close.wav"
float scale = 1.15;

enum
{
target_valid,
target_in_spawn,
target_no_valid_target,
target_lost,
target_terminated,
target_cancelled
target_valid,
target_in_spawn,
target_no_valid_target,
target_lost,
target_terminated,
target_cancelled
}
public OnMapStart()
{
Expand Down Expand Up @@ -82,7 +80,7 @@ int g_previous_target = -2;
bool g_isTerminator = false;
float gametime = -1.0;
float gametime_retarget = -1.0;

int g_the_terminator = -1;
public FindTerminator()
{

Expand All @@ -91,6 +89,7 @@ public FindTerminator()
{
// PrintToChatAll("Terminator was %N", i);
g_isTerminator = true;
g_the_terminator = i;
return i;
}
}
Expand All @@ -111,7 +110,7 @@ void FindTerminationTarget(){


//Only do this check if there is a terminator
if (g_isTerminator)
if (g_isTerminator)
{
//Find the Terminator target
TFTeam clientTeam = TF2_GetClientTeam(client);
Expand Down Expand Up @@ -141,10 +140,14 @@ void FindTerminationTarget(){
if (IsValidEntity(g_iGlowEnt[client])) {
RemoveEntity(g_iGlowEnt[client]);
}

// PrintToChatAll("Applying glow to %N", randomPlayer);
g_iGlowEnt[client] = EntIndexToEntRef(TF2_AttachBasicGlow(randomPlayer));
g_target = randomPlayer;
if (IsValidClient(g_iGlowEnt[client])) SDKHook(g_iGlowEnt[client], SDKHook_SetTransmit, OnGlowShouldTransmit);
if (IsValidEntity(g_iGlowEnt[client]))
{
// PrintToChatAll("Hooking onglow for %N", g_iGlowEnt[client]);
SDKHook(g_iGlowEnt[client], SDKHook_SetTransmit, OnGlowShouldTransmit);
}
g_flTagEndTime[client] = GetGameTime() + flDuration;
gametime = -1.0;
}
Expand Down Expand Up @@ -217,19 +220,26 @@ void TerminatorHeal(int client)

Action OnGlowShouldTransmit(int glow, int client) {
int glowTarget = GetEntPropEnt(glow, Prop_Data, "m_hParent");
if (!g_isTerminator || g_targetstatus != target_valid) return Plugin_Stop;

if (!IsValidEntity(glowTarget)) {
return Plugin_Stop;
}


// PrintToChatAll("Glow %N", glowTarget);
// PrintToChatAll("Glow team %i",TF2_GetClientTeam(glowTarget));
// PrintToChatAll("Terminatorteam team %i",TF2_GetClientTeam(FindTerminator()));
if (!TF2_IsEnemyTeam(TF2_GetClientTeam(glowTarget), TF2_GetClientTeam(client))) {
// prevent showing outline on teammates
// TODO make this more robust for teamcounts larger than 2 --
// we'd need to track the attacker
return Plugin_Stop;
}

if (!g_isTerminator || g_targetstatus != target_valid) return Plugin_Stop;

if (!IsValidEntity(glowTarget)) {
return Plugin_Stop;
}





return Plugin_Continue;
}
Expand Down
30 changes: 20 additions & 10 deletions berobot_dmg_handler.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1356,21 +1356,24 @@ public Action Event_post_inventory_application(Event event, const char[] name, b
TF2Attrib_RemoveByName(Weapon3, "fire rate bonus");

stat1 = 0.70;
stat2 = 0.2;
if (Weapon1 != -1)
{
TF2Attrib_SetByName(Weapon1, "Reload time decreased", stat1);
// SetDemoDamageBuff(Weapon1);
TF2Attrib_SetByName(Weapon1, "dmg falloff decreased", stat2);

}

if (Weapon2 != -1)
{
TF2Attrib_SetByName(Weapon2, "Reload time decreased", stat1);
TF2Attrib_SetByName(Weapon2, "dmg falloff decreased", stat2);
// SetDemoDamageBuff(Weapon2);

}
stat1 = 1.0-stat1;
Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}Demoman: All of projectile weapons {orange}Reload %0.0f%%%% faster\n{teamcolor}Melee weapons {orange}more damage{teamcolor} the more damage you do",chat_display, OneIs100(stat1));
Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}Demoman: All of projectile weapons {orange}Reload %0.0f%%%% faster. +%0.0f%%%% splash damage bonus\n{teamcolor}Melee weapons {orange}more damage{teamcolor} the more damage you do",chat_display, OneIs100(stat1), MoreIsMore(stat2));
}

if (Weapon3 != -1)
Expand Down Expand Up @@ -1937,8 +1940,13 @@ public Action Event_post_inventory_application(Event event, const char[] name, b
if (IsAirStrike(Weapon1))
{
stat1 = 16.0;
stat2 = 0.15;
stat3 = 2.0;
TF2Attrib_SetByName(Weapon1, "clipsize increase on kill",stat1);
Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}AirStrike: {orange}Gains additional clip{teamcolor} by doing %i damage to robots, {orange}+%0.0f extra max bonus clip on kill", chat_display, RoundToNearest(g_AirStrikeDMGRequirement), stat1);
TF2Attrib_SetByName(Weapon1, "rocketjump attackrate bonus",stat2);
TF2Attrib_SetByName(Weapon1, "maxammo primary increased",stat3);

Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}AirStrike: {orange}Gains additional clip{teamcolor} by doing %i damage to robots, {orange}+%0.0f extra max bonus clip on kill. %0.0f%%%% faster firing speed while rocket jumping. +%0.0f%%%% max ammo bonus", chat_display, RoundToNearest(g_AirStrikeDMGRequirement), stat1, LessIsMore(stat2), OneIs100(stat2));
}
if (IsBlackBox(Weapon1))
{
Expand All @@ -1953,24 +1961,26 @@ public Action Event_post_inventory_application(Event event, const char[] name, b
TF2Attrib_SetByName(Weapon1, "clip size upgrade atomic", stat1);
Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}Beggars Bazooka: {orange}+%0.0f clip size",chat_display, stat1);
}
if (IsAnyRocketLauncher(Weapon1))
{
stat1 = 0.8;
TF2Attrib_SetByName(Weapon1, "Reload time decreased", stat1);
Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}Primary {orange}+%0.0f%%%% faster reload",chat_display, LessIsMore(stat1));
}

if (IsRocketLauncher(Weapon1))
{
stat1 = 1.5;
TF2Attrib_SetByName(Weapon1, "Blast radius increased", stat1);
Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}Rocket Launcher {orange}+%0.0f%%%% larger explosion radius",chat_display, MoreIsMore(stat1));
}
if (IsAnyRocketLauncher(Weapon1))
{
stat1 = 0.7;
stat2 = 0.15;
TF2Attrib_SetByName(Weapon1, "Reload time decreased", stat1);
TF2Attrib_SetByName(Weapon1, "dmg falloff decreased", stat2);
Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}Primary {orange}+%0.0f%%%% faster reload. +%0.0f%%%% splash damage bonus",chat_display, LessIsMore(stat1), MoreIsMore(stat2));
}
if (IsEqualizer(Weapon3))
{
stat1 = 20.0;
TF2Attrib_SetByName(Weapon3, "mod rage on hit bonus", stat1);
Format(chat_display, sizeof(chat_display), "%s{orange}\nEqualizer: %0.0f%%%%{teamcolor} increased rage build",chat_display, MoreIsMore(stat1));

Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}Equalizer: %0.0f%%%%{teamcolor} increased rage build",chat_display, MoreIsMore(stat1));

}
if (IsMarketGardner(Weapon3))
Expand Down
8 changes: 4 additions & 4 deletions berobot_handler.sp
Original file line number Diff line number Diff line change
Expand Up @@ -2227,7 +2227,7 @@ int Native_EnsureRobotCount(Handle plugin, int numParams)
if (g_f_Damage_Bonus == -1.0 && (g_b_changed_dmg || !g_b_broadcast_msg))
{
// PrintCenterTextAll("Alert: Robot Power Restored\nRobots take normal damage");
MC_PrintToChatAll("{magenta}Alert: Robot Power Restored\nRobots take normal damage");
MC_PrintToChatAll("{magenta}Alert: Balance Restored\nRobots take normal damage");
g_b_broadcast_msg = true;
}

Expand All @@ -2237,7 +2237,7 @@ int Native_EnsureRobotCount(Handle plugin, int numParams)
{
char word[5]; // Assuming "more" or "less" won't exceed 4 characters
GetDamageWord(word, sizeof(word));
MC_PrintToChatAll("{magenta}Alert: Low Power!\nRobots take {orange}%.0f %% %s {magenta}damage!", (g_f_Damage_Bonus-1.0)*100,word);
MC_PrintToChatAll("{magenta}Alert: Player Imbalance detected\nRobots take {orange}%.0f %% %s {magenta}damage!", (g_f_Damage_Bonus-1.0)*100,word);
// PrintCenterTextAll("Alert: Low Power!\nRobots take %.0f %% %s damage!", (g_f_Damage_Bonus-1.0)*100,word);
g_b_broadcast_msg = true;
}
Expand All @@ -2259,7 +2259,7 @@ int Native_EnsureRobotCount(Handle plugin, int numParams)
{
char word[5]; // Assuming "more" or "less" won't exceed 4 characters
GetDamageWord(word, sizeof(word));
MC_PrintToChatAll("{magenta}Alert: High Power!\nRobots take {orange}%.0f %% %s {magenta}damage!", (g_f_Damage_Bonus-1.0)*100,word);
MC_PrintToChatAll("{magenta}Alert: Player Imbalance detected!\nRobots take {orange}%.0f %% %s {magenta}damage!", (g_f_Damage_Bonus-1.0)*100,word);
// PrintCenterTextAll("Alert: High Power!\nRobots take %.0f %% %s damage!", (g_f_Damage_Bonus-1.0)*100, word);
g_b_broadcast_msg = true;
}
Expand All @@ -2277,7 +2277,7 @@ int Native_EnsureRobotCount(Handle plugin, int numParams)
{
char word[5]; // Assuming "more" or "less" won't exceed 4 characters
GetDamageWord(word, sizeof(word));
MC_PrintToChatAll("{magenta}Low Power!\nRobots take {orange}%.0f %% %s {magenta}damage!", (g_f_Damage_Bonus-1.0)*100,word);
MC_PrintToChatAll("{magenta}Player Imbalance detected!\nRobots take {orange}%.0f %% %s {magenta}damage!", (g_f_Damage_Bonus-1.0)*100,word);
// PrintCenterTextAll("Alert: Low Power!\nRobots take %.0f %% %s damage!", (g_f_Damage_Bonus-1.0)*100, word);
g_b_broadcast_msg = true;
}
Expand Down
2 changes: 1 addition & 1 deletion cfg/robots/boss_heavy_kommisarkrit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scale" "1.75"
"health_bonus_per_player" "100"
"boss_cost" "1"
"rc_cost" "75.0"
"rc_cost" "50.0"
"difficulty" "2"
"sounds"
{
Expand Down
2 changes: 1 addition & 1 deletion cfg/robots/boss_pyro_skilltron.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scale" "1.75"
"health_bonus_per_player" "100"
"boss_cost" "1"
"rc_cost" "30.0"
"rc_cost" "35.0"
"difficulty" "2"
"sounds"
{
Expand Down
2 changes: 1 addition & 1 deletion cfg/robots/boss_soldier_General_Crits.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"health" "5800"
"health_bonus_per_player" "75"
"boss_cost" "1"
"rc_cost" "70.0"
"rc_cost" "50.0"
"difficulty" "2"
"sounds"
{
Expand Down
2 changes: 1 addition & 1 deletion cfg/robots/boss_soldier_saxtron_hale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"health" "2046"
"health_bonus_per_player" "250"
"boss_cost" "1"
"rc_cost" "50.0"
"rc_cost" "40.0"
"difficulty" "2"
"scale" "1.5"
"sounds"
Expand Down
1 change: 0 additions & 1 deletion cfg/robots/free_sniper_jbird.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"ammo regen" "100.0"
"head scale" "0.8"
"rage giving scale" "0.75"
"health regen" "10.0"
}
"remove_weapon_slots"
{
Expand Down
1 change: 0 additions & 1 deletion cfg/robots/free_sniper_skeeter.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"lunchbox adds minicrits" "3.0"
"apply z velocity on damage" "550.0"
"faster reload rate" "0.35"
"heal on hit for rapidfire" "25.0"
}
}
"tf_weapon_smg"
Expand Down
2 changes: 1 addition & 1 deletion cfg/robots/free_tank_heavy_terminator.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"role" "Tank"
"subclass" "Tank"
"tips" "HiNet: Terminate your target"
"health" "1100"
"health" "1500"
"health_bonus_per_player" "75"
"difficulty" "2"
"scale" "1.15"
Expand Down

0 comments on commit 6fbdfbe

Please sign in to comment.