Skip to content

Commit

Permalink
finalized logic, and did some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
higps committed Jul 11, 2024
1 parent a54c778 commit 808587b
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 30 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions berobot_bugged_plugin_reloader.sp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public Action Event_teamplay_round_start(Event event, char[] name, bool dontBroa
{
ServerCommand("sm_plugins reload /mm_cast_spell/");
ServerCommand("sm_plugins reload /owned_building_phasing/");
ServerCommand("sm_plugins reload /ability/");
g_bool_loaded = true;
}

Expand Down
2 changes: 1 addition & 1 deletion berobot_dmg_handler.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ public Action Event_post_inventory_application(Event event, const char[] name, b
{
stat1 = 16.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}+%i extra max bonus clip on kill", chat_display, RoundToNearest(g_AirStrikeDMGRequirement), 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);
}
if (IsBlackBox(Weapon1))
{
Expand Down
2 changes: 1 addition & 1 deletion berobot_hud.sp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ void DrawTeamHud(TFTeam team, int r, int g, int b, int a)
int robotCoins = GetRobotCoinsFor(i);
int bossTokens = GetTeamCoinsFor(i);

ShowSyncHudText(i, _hudSynchronizer, "Robot-₡oins: %i\nBoss-₡oins: %i", robotCoins, bossTokens);
ShowSyncHudText(i, _hudSynchronizer, "Robot-₡oins: %i\nBoss-₡oins: %i/1", robotCoins, bossTokens);
}
}
51 changes: 37 additions & 14 deletions berobot_teamcoin_giver.sp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void OnMapStart()

public void OnPluginStart()
{
HookEvent("player_death", Event_Death, EventHookMode_Post);
HookEvent("player_death", Event_Death, EventHookMode_Pre);
HookEvent("teamplay_point_captured", Event_Teamplay_Point_Captured, EventHookMode_Post);
HookEvent("teamplay_round_start", Event_teamplay_round_start, EventHookMode_Post);
HookEvent("teamplay_setup_finished", Event_teamplay_setup_finished, EventHookMode_Post);
Expand All @@ -72,16 +72,17 @@ public Action Event_teamplay_round_start(Event event, char[] name, bool dontBroa
public Action Event_Teamplay_Point_Captured(Event event, char[] name, bool dontBroadcast)
{


if(!g_first_capture)
{
g_first_capture = true;
GiveBossCoin();
}else
if(!IsBossPresent())
{
CheckBossCoin();
if(!g_first_capture)
{
g_first_capture = true;
GiveBossCoin();
}else
{
CheckBossCoin();
}
}



return Plugin_Continue;
Expand All @@ -97,18 +98,25 @@ public Action Event_Death(Event event, const char[] name, bool dontBroadcast)
{
CheckBossCoin();
}


// if (IsBoss(victim))
// {
// PrintToChatAll("%N was a boss", victim);
// }
return Plugin_Continue;
}

void CheckBossCoin()
{
if(!IsBossPresent())
{
// PrintToChatAll("Current gametime: %f\nLast Boss Coin %f\nNext Boss Coin: %f\nNext boss coin in %f seconds",GetEngineTime(),g_last_given_boss_coin, (g_last_given_boss_coin + g_last_given_boss_coin_cooldown), (g_last_given_boss_coin + g_last_given_boss_coin_cooldown)- GetEngineTime());
if (!b_is_koth)
{
int robotteam = GetRobotTeam();



if (GetEngineTime() > (g_last_given_boss_coin + g_last_given_boss_coin_cooldown))
{

Expand All @@ -117,7 +125,7 @@ void CheckBossCoin()
// PrintToChatAll("WAS RED TEAM, BUT NO CAP");
}else{
// PrintToChatAll("WAS T");
GiveBossCoin();
GiveBossCoin();
}
}

Expand All @@ -129,17 +137,32 @@ void CheckBossCoin()
GiveBossCoin();
koth_caps = 0;
}
}
}
}
}

bool IsBossPresent()
{
for(int i = 1; i <= MaxClients; i++)
{
if (IsBoss(i))
{
// PrintToChatAll("Boss is present");
return true;
}
}
// PrintToChatAll("No Boss is present");
return false;
}

void GiveBossCoin()
{

// bool BossPresent = false;
for(int i = 1; i <= MaxClients; i++)
{

if (IsValidClient(i) && IsAnyRobot(i))
{
// PrintToChatAll("Emitting sound to %N",i);
if (GetTeamCoinsFor(i) != 1)
{
EmitSoundToClient(i,get_boss_coin_sound);
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 @@ -58,7 +58,7 @@
"warpaint_id" "0"
"attributes"
{
"dmg penalty vs players" "1.9"
"dmg penalty vs players" "1.75"
"fire rate bonus" "0.85"
"killstreak tier" "1.0"
"mod weapon blocks healing" "1.0"
Expand Down
2 changes: 1 addition & 1 deletion cfg/robots/free_damage_grenades_demoman_carpetomber.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"warpaint_id" "226"
"attributes"
{
"dmg penalty vs players" "0.75"
"dmg penalty vs players" "0.85"
"clip size bonus" "1.4"
"faster reload rate" "0.8"
"projectile speed increased" "3.0"
Expand Down
3 changes: 1 addition & 2 deletions cfg/robots/free_healer_medic_death_negator.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@
"attributes"
{
"killstreak tier" "1.0"
"overheal penalty" "5.0"
"overheal penalty" "10.0"
// "ubercharge rate penalty" "2.0"
"move speed bonus resource level" "1.35"
"heal rate bonus" "2.0"
"overheal decay bonus" "50.0"
}
Expand Down
26 changes: 16 additions & 10 deletions cfg/robots/paid_damage_melee_demoman_flycharger.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"quality" "6"
"level" "1"
"slot" "2"
"warpaint_id" "404"
"warpaint_id" "144"
"attributes"
{
"killstreak tier" "1.0"
Expand All @@ -84,14 +84,20 @@
}
"cosmetics"
{
"DemonicDome"
{
"itemindex" "31384"
}
"WarCloak"
{
"itemindex" "31388"
"style" "1"
}
"WarEagle"
{
"itemindex" "30887"
}
"LazyLounger"
{
"itemindex" "31423"
"paint" "Australium Gold"
}
"LoafLoafers"
{
"itemindex" "31105"
"style" "1"
"paint" "Australium Gold"
}
}
}

0 comments on commit 808587b

Please sign in to comment.