Skip to content

Commit

Permalink
updated mafia, added some incomplete logic to handle koth_ detection …
Browse files Browse the repository at this point in the history
…for robtos
  • Loading branch information
higps committed Jan 19, 2024
1 parent 1fea87f commit 959ec50
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 5 deletions.
91 changes: 91 additions & 0 deletions berobot_capture_boss_coin_awarding.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#include <berobot_constants>
#include <berobot>
#include <sourcemod>
#include <sm_logger>
#include <morecolors>
#include <tf2>
#include <tf2_stocks>

#pragma newdecls required
#pragma semicolon 1

public Plugin myinfo =
{
name = "berobot_getgamemode",
author = "heavy is gps",
description = "Manned Machines GameMode Getter",
version = "0.1",
url = "https://github.com/higps/robogithub"
};


int b_is_koth;

public void OnPluginStart()
{
HookEvent("teamplay_point_captured", Event_Teamplay_Point_Captured, EventHookMode_Post);
}

public void OnMapStart()
{
b_is_koth = GameRules_GetProp("m_bPlayingKoth");
}

public Action Event_Teamplay_Point_Captured(Event event, char[] name, bool dontBroadcast)
{
//int team = GetEventInt(event, "team");
//PrintToChatAll("Team wws %i", team);
if (!b_is_koth)
{
// AddTeamCoins(TFTeam_Blue, 1);
// AddTeamCoins(TFTeam_Red, 1);
}else
{
int Team_that_captured = GetEventInt(event, "team");
PrintToChatAll("Team that captured was %i", Team_that_captured);
int RoboTeam = GetRobotTeam();

//2 Is red
//3 is blu
}
}


// public Action Event_Teamplay_Point_Captured(Event event, char[] name, bool dontBroadcast)
// {
// //int team = GetEventInt(event, "team");
// //PrintToChatAll("Team wws %i", team);

// PrintToChatAll("ATtempting to post times:");
// // Get the Red team round timer entity

// int timerRed = GameRules_GetPropEnt("m_hRedKothTimer");
// int timerBlu = GameRules_GetPropEnt("m_hBlueKothTimer");

// float redtime = GetEntPropFloat(timerRed, Prop_Send, "m_flTimeRemaining");
// float blutime = GetEntPropFloat(timerBlu, Prop_Send, "m_flTimeRemaining");

// char redTimeFormatted[16];
// char blueTimeFormatted[16];



// FormatTime_Float(redtime, redTimeFormatted);
// FormatTime_Float(blutime, blueTimeFormatted);


// PrintToChatAll("Red: %s, Blu: %s", redTimeFormatted, blueTimeFormatted);
// return Plugin_Continue;
// }

// char FormatTime_Float(float seconds, char formattedTime[16])
// {
// int minutes = RoundFloat(seconds / 60.0);
// int remainingSeconds = RoundFloat(seconds) % 60;

// Format(formattedTime, sizeof(formattedTime), "%d:%02d", minutes, remainingSeconds);

// return formattedTime;


// }
13 changes: 10 additions & 3 deletions berobot_handler.sp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ bool b_g_high_power = false;
int g_RoundCount;
// int g_TankCount;

int b_is_koth;

ArrayList g_Volunteers;


Expand Down Expand Up @@ -379,7 +381,7 @@ public void OnMapStart()
g_RoboTeam = -1;
PrecacheSound(RESISTANCE);


b_is_koth = GameRules_GetProp("m_bPlayingKoth");
}

public void ResetMode()
Expand Down Expand Up @@ -754,11 +756,16 @@ public Action Event_Teamplay_Point_Captured(Event event, char[] name, bool dontB

if (g_Enable && g_BossMode)
{

if (!b_is_koth)
{
AddTeamCoins(TFTeam_Blue, 1);
AddTeamCoins(TFTeam_Red, 1);

}else
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
}
}

}

public Action Event_teamplay_round_start(Event event, char[] name, bool dontBroadcast)
Expand Down
3 changes: 1 addition & 2 deletions cfg/robots/paid_damage_melee_heavy_mafia.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@
{
"tf_weapon_fists"
{
"itemindex" "310"
"itemindex" "426"
"quality" "6"
"level" "1"
"slot" "0"
"skin" "0"
"attributes"
{
"mod_maxhealth_drain_rate" "0.0"
"heal on kill" "500.0"
"killstreak tier" "1.0"
"dmg penalty vs players" "1.25"
"melee range multiplier" "1.25"
Expand Down

0 comments on commit 959ec50

Please sign in to comment.