Skip to content

Commit

Permalink
Merge branch 'master' into config-reader-bot-creation
Browse files Browse the repository at this point in the history
  • Loading branch information
higps committed Oct 4, 2023
2 parents d6388c5 + b7d0c64 commit 0dbb779
Show file tree
Hide file tree
Showing 171 changed files with 548 additions and 6,503 deletions.
7 changes: 0 additions & 7 deletions Z_dont_compile_behomer.sp
Original file line number Diff line number Diff line change
Expand Up @@ -224,28 +224,21 @@ MakeGiantSoldier(client)

int iHealth = 3800;

int MaxHealth = 200;
//PrintToChatAll("MaxHealth %i", MaxHealth);

int iAdditiveHP = iHealth - MaxHealth;

TF2_SetHealth(client, iHealth);
// PrintToChatAll("iHealth %i", iHealth);

// PrintToChatAll("iAdditiveHP %i", iAdditiveHP);

SetEntPropFloat(client, Prop_Send, "m_flModelScale", 1.75);
SetEntProp(client, Prop_Send, "m_bIsMiniBoss", true);
TF2Attrib_SetByName(client, "max health additive bonus", float(iAdditiveHP));
TF2Attrib_SetByName(client, "ammo regen", 100.0);
TF2Attrib_SetByName(client, "move speed penalty", 0.4);
TF2Attrib_SetByName(client, "damage force reduction", 0.4);
TF2Attrib_SetByName(client, "airblast vulnerability multiplier", 0.4);
TF2Attrib_SetByName(client, "airblast vertical vulnerability multiplier", 0.1);
float HealthPackPickUpRate = float(MaxHealth) / float(iHealth);
TF2Attrib_SetByName(client, "health from packs decreased", HealthPackPickUpRate);
TF2Attrib_SetByName(client, "cancel falling damage", 1.0);
TF2Attrib_SetByName(client, "patient overheal penalty", 0.15);

//TF2Attrib_SetByName(client, "override footstep sound set", 3.0);

Expand Down
1 change: 1 addition & 0 deletions berobot_equipment.sp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <tf2attributes>
#include <tf2utils>
#include <tf2items>
#include <tf2>

#pragma newdecls required
#pragma semicolon 1
Expand Down
50 changes: 45 additions & 5 deletions berobot_factory.sp
Original file line number Diff line number Diff line change
Expand Up @@ -639,11 +639,51 @@ public any Native_IsSentryBuster(Handle plugin, int numParams)

public any Native_RoboSetHealth(Handle plugin, int numParams)
{
int client = GetNativeCell(1);
int NewHealth = GetNativeCell(2);
SetEntProp(client, Prop_Send, "m_iHealth", NewHealth, 1);
SetEntProp(client, Prop_Data, "m_iHealth", NewHealth, 1);
SetEntProp(client, Prop_Data, "m_iMaxHealth", NewHealth, 1);
int client = GetNativeCell(1);
TFClassType iClass = GetNativeCell(2);
int iHealth = GetNativeCell(3);
float OverHealRate = GetNativeCell(4);
int ClassHealth;

switch (iClass) {
case TFClass_Scout:
ClassHealth = 125;
case TFClass_Soldier:
ClassHealth = 200;
case TFClass_Pyro:
ClassHealth = 175;
case TFClass_DemoMan:
ClassHealth = 175;
case TFClass_Heavy:
ClassHealth = 300;
case TFClass_Engineer:
ClassHealth = 125;
case TFClass_Medic:
ClassHealth = 150;
case TFClass_Sniper:
ClassHealth = 125;
case TFClass_Spy:
ClassHealth = 125;
default:
ClassHealth = 100; // Default health if class is not recognized
}

//Set New health before doing the rest
SetEntProp(client, Prop_Send, "m_iHealth", iHealth, 1);
SetEntProp(client, Prop_Data, "m_iHealth", iHealth, 1);
SetEntProp(client, Prop_Data, "m_iMaxHealth", iHealth, 1);

//Calculate the overheal and health pickup penalty
int iAdditiveHP = iHealth - ClassHealth;
float OverHeal = float(ClassHealth) * OverHealRate;
float TotalHealthOverHeal = iHealth * OverHealRate;
float OverHealPenaltyRate = OverHeal / TotalHealthOverHeal;
TF2Attrib_SetByName(client, "patient overheal penalty", OverHealPenaltyRate);
TF2Attrib_SetByName(client, "max health additive bonus", float(iAdditiveHP));

float HealthPackPickUpRate = float(ClassHealth) / float(iHealth);
TF2Attrib_SetByName(client, "health from packs decreased", HealthPackPickUpRate);

}

// public Action Timer_SetDefenseBuff(Handle timer, any client)
Expand Down
16 changes: 8 additions & 8 deletions berobot_restrictions_team.sp
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,14 @@ void SetRestriciton(RobotCoins restriction, char robotName[NAMELENGTH], bool ena

OnRestrictionChanged(robotName);

char msg[256];
if (enable)
Format(msg, sizeof(msg), "Robot '%s' now available for purchase", robotName);
else
Format(msg, sizeof(msg), "Robot '%s' currently not affordable", robotName);

SMLogTag(SML_VERBOSE, msg);
MM_PrintToChatAll(msg);
// char msg[256];
// if (enable)
// Format(msg, sizeof(msg), "Robot '%s' now available for purchase", robotName);
// else
// Format(msg, sizeof(msg), "Robot '%s' currently not affordable", robotName);

// SMLogTag(SML_VERBOSE, msg);
// MM_PrintToChatAll(msg);
}

void GetRestrictions()
Expand Down
15 changes: 1 addition & 14 deletions boss_demoman_demopan.sp
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,12 @@ MakeSolar(client)
SetModel(client, GDEKNIGHT);

float scale = 1.75;
int iHealth = 7500;
RoboSetHealth(client,TFClass_DemoMan, 7500, 1.5);


int MaxHealth = 175;
// PrintToChatAll("MaxHealth %i", MaxHealth);

int iAdditiveHP = iHealth - MaxHealth;

TF2_SetHealth(client, iHealth);
// PrintToChatAll("iHealth %i", iHealth);

// PrintToChatAll("iAdditiveHP %i", iAdditiveHP);
Expand All @@ -125,13 +122,9 @@ MakeSolar(client)

SetEntPropFloat(client, Prop_Send, "m_flModelScale", scale);
SetEntProp(client, Prop_Send, "m_bIsMiniBoss", true);
float HealthPackPickUpRate = float(MaxHealth) / float(iHealth);
TF2Attrib_SetByName(client, "health from packs decreased", HealthPackPickUpRate);
TF2Attrib_SetByName(client, "max health additive bonus", float(iAdditiveHP));
TF2Attrib_SetByName(client, "damage force reduction", 0.5);
TF2Attrib_SetByName(client, "move speed penalty", 0.85);
TF2Attrib_SetByName(client, "cancel falling damage", 1.0);
TF2Attrib_SetByName(client, "patient overheal penalty", 0.15);

TF2Attrib_SetByName(client, "override footstep sound set", 4.0);
TF2Attrib_SetByName(client, "airblast vulnerability multiplier", 0.4);
Expand All @@ -156,12 +149,6 @@ MakeSolar(client)
//SetBossHealth(client);
}

stock TF2_SetHealth(client, NewHealth)
{
SetEntProp(client, Prop_Send, "m_iHealth", NewHealth, 1);
SetEntProp(client, Prop_Data, "m_iHealth", NewHealth, 1);
SetEntProp(client, Prop_Data, "m_iMaxHealth", NewHealth, 1);
}

public Action:Timer_Switch(Handle:timer, any:client)
{
Expand Down
15 changes: 1 addition & 14 deletions boss_demoman_nuker.sp
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,12 @@ MakeSolar(client)
SetModel(client, GDEKNIGHT);

float scale = 1.85;
int iHealth = 5000;
RoboSetHealth(client,TFClass_DemoMan, 5000, 1.5);


int MaxHealth = 175;
// PrintToChatAll("MaxHealth %i", MaxHealth);

int iAdditiveHP = iHealth - MaxHealth;

TF2_SetHealth(client, iHealth);
// PrintToChatAll("iHealth %i", iHealth);

// PrintToChatAll("iAdditiveHP %i", iAdditiveHP);
Expand All @@ -131,14 +128,10 @@ MakeSolar(client)

SetEntPropFloat(client, Prop_Send, "m_flModelScale", scale);
SetEntProp(client, Prop_Send, "m_bIsMiniBoss", true);
float HealthPackPickUpRate = float(MaxHealth) / float(iHealth);
TF2Attrib_SetByName(client, "health from packs decreased", HealthPackPickUpRate);
TF2Attrib_SetByName(client, "max health additive bonus", float(iAdditiveHP));
TF2Attrib_SetByName(client, "damage force reduction", 0.5);
TF2Attrib_SetByName(client, "move speed penalty", 0.5);
TF2Attrib_SetByName(client, "airblast vulnerability multiplier", 0.3);
TF2Attrib_SetByName(client, "cancel falling damage", 1.0);
TF2Attrib_SetByName(client, "patient overheal penalty", 0.15);

TF2Attrib_SetByName(client, "override footstep sound set", 4.0);

Expand Down Expand Up @@ -166,12 +159,6 @@ TF2Attrib_SetByName(client, "cannot pick up intelligence", 1.0);

}

stock TF2_SetHealth(client, NewHealth)
{
SetEntProp(client, Prop_Send, "m_iHealth", NewHealth, 1);
SetEntProp(client, Prop_Data, "m_iHealth", NewHealth, 1);
SetEntProp(client, Prop_Data, "m_iMaxHealth", NewHealth, 1);
}

public Action:Timer_Switch(Handle:timer, any:client)
{
Expand Down
Loading

0 comments on commit 0dbb779

Please sign in to comment.