Skip to content

Commit

Permalink
paycheck update
Browse files Browse the repository at this point in the history
  • Loading branch information
higps committed Feb 17, 2024
1 parent afd7079 commit ff8008d
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 16 deletions.
20 changes: 11 additions & 9 deletions berobot_config_reader.sp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,18 @@ public void ReadConfig()
hasRestrictions = true;
}

// Fetch on death cost. Default cost is located in berobot.inc
if (g_hConfig.GetFloat("rc_on_death"))
{
iInteger = g_hConfig.GetNum("rc_on_death", iInteger);
robot.robotCoinsOnDeath = iInteger;
}

if (g_hConfig.GetFloat("tc_on_death"))
{
iInteger = g_hConfig.GetNum("tc_on_death", iInteger);
robot.teamCoinsOnDeath = iInteger;
}

if (!hasRestrictions)
{
Expand Down Expand Up @@ -722,15 +733,6 @@ MakeRobotFrame(client)
i_hConfig.GoBack();
}










int bonus_hp = 0;
if(i_hConfig.GetNum("health_bonus_per_player"))
{
Expand Down
2 changes: 1 addition & 1 deletion berobot_dmg_handler.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@ public Action Event_post_inventory_application(Event event, const char[] name, b
{
if (IsAnyBanner(Weapon2))
{
stat1 = 2.0;
stat1 = 1.5;
TF2Attrib_SetByName(Weapon2, "increase buff duration", stat1);

Format(chat_display, sizeof(chat_display), "%s\n{teamcolor}Liberty Launcher: Provides banner {orange}+%0.0f%%%% longer buff duration{teamcolor}",chat_display, MoreIsMore(stat1));
Expand Down
3 changes: 0 additions & 3 deletions berobot_restrictions_team_death.sp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ public void OnDeath(Event event, const char[] name, bool dontBroadcast)
SMLogTag(SML_VERBOSE, "adding %i TeamCoins, because robot %L died", rewardedTeamCoins, victimClientId);
AddTeamCoinsFor(victimClientId, rewardedTeamCoins);




}

public Action Timer_DeathTip(Handle timer, DataPack info)
Expand Down
2 changes: 2 additions & 0 deletions berobot_storage.sp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ public any Native_AddRobot(Handle plugin, int numParams)
robot.deathtip = robotDefinition.deathtip;
robot.weaponsound = robotDefinition.weaponsound;
robot.footstep = robotDefinition.footstep;
robot.robotCoinsOnDeath = robotDefinition.robotCoinsOnDeath;
robot.teamCoinsOnDeath = robotDefinition.teamCoinsOnDeath;

//New stuff for the config file
//Modify this to only store what's needed to view in the menu
Expand Down
2 changes: 1 addition & 1 deletion cfg/robots/free_healer_medic_ubermachine.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"attributes"
{
"killstreak tier" "1.0"
"add uber charge on hit" "1.0"
"add uber charge on hit" "0.25"
}
}
"tf_weapon_medigun"
Expand Down
4 changes: 3 additions & 1 deletion include/berobot.inc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ enum struct RobotDefinition {
int weaponsound;
int footstep;
int difficulty;
int robotCoinsOnDeath;
int teamCoinsOnDeath;
}
typedef RobotCallback = function void (int client);

Expand All @@ -123,7 +125,7 @@ typedef RobotCallback = function void (int client);
*
* @noreturn
*/
native void AddRobot(const any[] robot, RobotCallback callback, char[] version, RestrictionsDefinition restrictions = null, int robotCoinsOnDeath = 1, int teamCoinsOnDeath = 0);
native void AddRobot(const any[] robot, RobotCallback callback, char[] version, RestrictionsDefinition restrictions = null, int robotCoinsOnDeath = 10, int teamCoinsOnDeath = 0);

/**
* Removes a robot to the storage. So it can't be used by other plugins anymore. (usually called during OnPluginEnd)
Expand Down
2 changes: 1 addition & 1 deletion paid_sentry_buster_mvm.sp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ stock void GiveGiantDemoKnight(int client)

SetEntPropFloat(Weapon1, Prop_Send, "m_flModelScale", 0.01);
}
TF2CustAttr_SetString(client, "Sentry Buster", "damage=25000.0 radius=500.0 lineofsight=1 timer=1.25");
TF2CustAttr_SetString(client, "Sentry Buster", "damage=25000.0 radius=300.0 lineofsight=1 timer=1.25");


}
Expand Down
35 changes: 35 additions & 0 deletions python_stuff/increase_bot_rc_cost_by_10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
import re

def process_cfg_file(file_path):
with open(file_path, 'r') as file:
lines = file.readlines()

modified_lines = []
for line in lines:
if 'rc_cost' in line:
# Extracting the number using regular expression
number = re.search(r'"rc_cost"\s+"(\d+(\.\d+)?)\s*"', line)
if number:
# Multiplying the number by 10
new_number = str(float(number.group(1)) * 10)
# Replacing the old number with the new one
modified_line = re.sub(r'"rc_cost"\s+"(\d+(\.\d+)?)\s*"', r'"rc_cost" "{}"'.format(new_number), line)
modified_lines.append(modified_line)
else:
modified_lines.append(line)

with open(file_path, 'w') as file:
file.writelines(modified_lines)

def process_directory(directory_path):
for root, dirs, files in os.walk(directory_path):
for file in files:
if file.endswith('.cfg'):
file_path = os.path.join(root, file)
process_cfg_file(file_path)

if __name__ == "__main__":
directory_path = input("Enter the directory path: ")
process_directory(directory_path)
print("Processing complete.")

0 comments on commit ff8008d

Please sign in to comment.