diff --git a/configs/bwree/robot/robot_giant.cfg b/configs/bwree/robot/robot_giant.cfg index cf2ac27..03bb9a3 100644 --- a/configs/bwree/robot/robot_giant.cfg +++ b/configs/bwree/robot/robot_giant.cfg @@ -1108,7 +1108,7 @@ { Class Pyro Name "Giant Airblast Pyro" - ClassIcon pyro_airblast + ClassIcon pyro_reflect_daan Skill Expert Health 3000 WeaponRestrictions PrimaryOnly @@ -1683,6 +1683,101 @@ "override footstep sound set" 4 } } + T_TFBot_Giant_Demo_Sticky + { + Health 3300 + Name "Giant Stickybomb Demo" + Class Demoman + ClassIcon demo_sticky_daan + Skill Expert + WeaponRestrictions SecondaryOnly + Tags "bot_giant" + Cooldown 35 + TotalCurrency 35 + BotAttributes + { + "MiniBoss" "1" + "HoldFireUntilFullReload" "1" + } + Items + { + "The Frag Proof Fragger" + { + } + "Upgradeable TF_WEAPON_GRENADELAUNCHER" + { + "is_passive_weapon" 1 + "override projectile type" 27 + "fire rate penalty" 1337 + } + "Upgradeable TF_WEAPON_PIPEBOMBLAUNCHER" + { + "damage bonus" 1.2 + "stickybomb charge rate" 0.001 + "max pipebombs decreased" -7 + "projectile range increased" 0.35 + "fire rate bonus" 0.75 + "faster reload rate" 0.7 + } + } + CharacterAttributes + { + "damage force reduction" 0.5 + "move speed bonus" 0.5 + "airblast vulnerability multiplier" 0.5 + "override footstep sound set" 4 + } + } + T_TFBot_Giant_Demo_Stickybomb_Burst + { + Name "Giant Burst Stickybomb Demo" + Class Demoman + ClassIcon demo_sticky_burst + Health 3300 + Skill Expert + MaxVisionRange 1200 + WeaponRestrictions SecondaryOnly + Tags "bot_giant" + Cooldown 35 + TotalCurrency 40 + BotAttributes + { + "MiniBoss" "1" + "HoldFireUntilFullReload" "1" + } + Items + { + "The Frag Proof Fragger" + { + } + "The Hurt Locher" + { + } + "Upgradeable TF_WEAPON_GRENADELAUNCHER" + { + "is_passive_weapon" 1 + "override projectile type" 27 + "fire rate penalty" 1337 + } + "Upgradeable TF_WEAPON_PIPEBOMBLAUNCHER" + { + "stickybomb charge rate" 0.001 + "Projectile range increased" 0.5 + "damage bonus" 1.2 + "blast radius increased" 1.15 + "fire rate bonus" 0.1 + "faster reload rate" 0.55 + "projectile spread angle penalty" 5 + } + } + CharacterAttributes + { + "move speed bonus" 0.5 + "airblast vulnerability multiplier" 0.4 + "damage force reduction" 0.4 + "override footstep sound set" 4 + } + } T_TFBot_Giant_Demoman_ScatterBarrage { Class Demoman @@ -1977,6 +2072,39 @@ "override footstep sound set" 2 } } + T_TFBot_Giant_Heavyweapons_Tomislav + { + Class Heavy + Name "Giant Tomislav Heavy" + ClassIcon heavy_accurate_lite + Skill Expert + Health 5000 + WeaponRestrictions PrimaryOnly + Tags "bot_giant" + Cooldown 45 + TotalCurrency 50 + BotAttributes + { + "MiniBoss" "1" + } + Items + { + "Capone's Capper" + { + } + "Tomislav" + { + "damage bonus" 1.5 + } + } + CharacterAttributes + { + "move speed bonus" 0.5 + "damage force reduction" 0.3 + "airblast vulnerability multiplier" 0.3 + "override footstep sound set" 2 + } + } T_TFBot_Giant_Heavyweapons_HealOnKill { Class Heavy @@ -2229,6 +2357,137 @@ "override footstep sound set" 2 } } + T_TFBot_Giant_Engineer_Shotgun + { + Class Engineer + Name "Giant Shotgun Engineer" + ClassIcon heavy_shotgun + Skill Expert + "scale" 1.85 + Health 3800 + WeaponRestrictions PrimaryOnly + Tags "bot_giant" + Cooldown 30 + TotalCurrency 30 + BotAttributes + { + "MiniBoss" "1" + "HoldFireUntilFullReload" "1" + } + Items + { + "TF_WEAPON_SHOTGUN_PRIMARY" + { + "fire rate bonus" 2.5 + "bullets per shot bonus" 8.5 + "damage penalty" 0.5 + "faster reload rate" 0.1 + } + } + CharacterAttributes + { + "move speed bonus" 0.5 + "damage force reduction" 0.5 + "airblast vulnerability multiplier" 0.5 + "override footstep sound set" 5 + "voice pitch scale" 0 + } + } + T_TFBot_Giant_Engineer_Pomson + { + Class Engineer + Name "Giant Pomson Engineer" + ClassIcon engineer_pomson + Skill Expert + "scale" 1.85 + Health 3800 + WeaponRestrictions PrimaryOnly + Tags "bot_giant" + Cooldown 30 + TotalCurrency 30 + BotAttributes + { + "MiniBoss" "1" + "HoldFireUntilFullReload" "1" + } + Items + { + "The Pomson 6000" + { + "damage bonus" 1.7 + "dmg bonus vs buildings" 4 + "fire rate bonus" 0.15 + "faster reload rate" 0.25 + "clip size bonus upgrade" 2 + "projectile penetration" 1 + } + "The Brainiac Hairpiece" + { + } + "The Brainiac Goggles" + { + } + "Iron lung" + { + } + } + CharacterAttributes + { + "move speed bonus" 0.5 + "damage force reduction" 0.5 + "airblast vulnerability multiplier" 0.5 + "override footstep sound set" 5 + "voice pitch scale" 0 + } + } + T_TFBot_Giant_Engineer_FrontierJustice_Boost + { + Class Engineer + Name "Giant Booster Engineer" + ClassIcon engineer_frontierjustice_nys_booster + Skill Expert + "scale" 1.85 + Health 4000 + WeaponRestrictions PrimaryOnly + Tags "bot_giant" + Cooldown 42 + TotalCurrency 45 + BotAttributes + { + "MiniBoss" "1" + "HoldFireUntilFullReload" "1" + } + Items + { + "The Frontier Justice" + { + "fire rate bonus" 2.5 + "bullets per shot bonus" 8 + "damage penalty" 0.6 + "faster reload rate" 0.1 + "attack projectiles" 1 + "critboost on kill" 3 + "heal on kill" 1000 + } + "Aim Assistant" + { + } + "Brain Interface" + { + } + "Iron lung" + { + } + } + CharacterAttributes + { + "move speed bonus" 0.5 + "damage force reduction" 0.4 + "airblast vulnerability multiplier" 0.4 + "override footstep sound set" 5 + "voice pitch scale" 0 + } + } T_TFBot_Giant_Medic { Class Medic @@ -2651,7 +2910,7 @@ Name "Giant Bushwacka/Jar Combo Sniper" ClassIcon sniper_jarate_bushwacka Skill Expert - Health 4000 + Health 3600 Tags "bot_giant" Cooldown 35 TotalCurrency 50 @@ -2663,12 +2922,11 @@ { "Jarate" { - "effect bar recharge rate increased" 0.25 - "applies snare effect" 0.5 + "effect bar recharge rate increased" 0.05 } "The Bushwacka" { - "fire rate bonus" 0.5 + "fire rate bonus" 0.6 "damage bonus" 1.5 "dmg taken increased" 1 } @@ -2678,7 +2936,7 @@ } CharacterAttributes { - "move speed bonus" 0.7 + "move speed bonus" 0.6 "damage force reduction" 0.4 "airblast vulnerability multiplier" 0.4 "override footstep sound set" 7 diff --git a/configs/bwree/robot/robot_standard.cfg b/configs/bwree/robot/robot_standard.cfg index 07beeed..108b60f 100644 --- a/configs/bwree/robot/robot_standard.cfg +++ b/configs/bwree/robot/robot_standard.cfg @@ -1,4 +1,5 @@ + "RobotStandardTemplates" { "Templates" @@ -1523,6 +1524,41 @@ } } } + T_TFBot_Heavyweapons_Tomislav + { + Class Heavy + Name "Tomislav Heavy" + ClassIcon heavy_accurate_lite + Skill Hard + TotalCurrency 8 + Items + { + "Capone's Capper" + { + } + "Tomislav" + { + } + } + } + T_TFBot_Heavyweapons_Heater + { + Class Heavy + Name "Heater Heavy" + ClassIcon heavy_heater + Skill Normal + TotalCurrency 8 + Items + { + "The Bunsen Brave" + { + } + "The Huo Long Heatmaker" + { + "damage penalty" 1 + } + } + } T_TFBot_Heavyweapons_Rocket { Class Heavy @@ -1662,7 +1698,7 @@ Health 1200 Scale 1.5 Tags "bot_giant" - WeaponRestrictions MeleeOnly + WeaponRestrictions PrimaryOnly Cooldown 30 TotalCurrency 50 Items @@ -1735,9 +1771,9 @@ { "TF_WEAPON_GRENADELAUNCHER" { - "faster reload rate" 1.75 + "faster reload rate" 1.5 "fire rate bonus" 0.05 - "clip size penalty" 0.5 + "clip size penalty" 0.75 // 3 instead of 2 "projectile spread angle penalty" 3 } } @@ -1863,7 +1899,7 @@ } "TF_WEAPON_GRENADELAUNCHER" { - "faster reload rate" 1.75 + "faster reload rate" 1.5 "fire rate bonus" 0.05 "damage penalty" 0.3 "clip size penalty" 0.75 @@ -1979,6 +2015,100 @@ } } } + T_TFBot_Demo_Caber_Hard + { + Class Demoman + Name "Charging Caber Demo" + ClassIcon demo_caber_nys + Skill Hard + Health 175 + WeaponRestrictions MeleeOnly + TotalCurrency 10 + Cooldown 15 + Items + { + "The Ullapool Caber" + { + "blast dmg to self increased" 50 + "damage bonus" 1.5 + } + "The Chargin' Targe" + { + } + "Ali Baba's Wee Booties" + { + } + } + } + T_TFBot_Demo_Caber_Explosive + { + Class Demoman + Name "Volatile Caber Demo" + ClassIcon demo_caber_nuke + Skill Expert + Health 150 + WeaponRestrictions MeleeOnly + TotalCurrency 18 + Cooldown 25 + BotAttributes + { + "AlwaysCrit" "1" + } + Items + { + "The Ullapool Caber" + { + "blast dmg to self increased" 100 + "damage bonus" 3.5 + } + "The Chargin' Targe" + { + "charge recharge rate increased" 8.0 + } + "Ali Baba's Wee Booties" + { + } + "Sober Stuntman" + { + } + } + CharacterAttributes + { + "move speed bonus" 1.5 + } + } + T_TFBot_Demoman_Stickybomb + { + Class Demoman + Name "Stickybomb Demoman" + ClassIcon demo_sticky_daan + Skill Hard + Health 175 + WeaponRestrictions SecondaryOnly + MaxVisionRange 750 + TotalCurrency 7 + Cooldown 10 + Items + { + "Upgradeable TF_WEAPON_GRENADELAUNCHER" + { + "is_passive_weapon" 1 // uses grenade launcher animation + "override projectile type" 15 // fires nothing + "faster reload rate" -0.8 + } + "Upgradeable TF_WEAPON_PIPEBOMBLAUNCHER" + { + "faster reload rate" -0.8 + "projectile spread angle penalty" 3 + "sticky arm time bonus" 2 + "stickybomb charge rate" -1 + "max pipebombs increased" -7 + } + "Bomb Beanie" + { + } + } + } T_TFBot_Demoman_Crit { Class Demoman @@ -2634,7 +2764,7 @@ { Class Pyro Name "Airblast Pyro" - ClassIcon pyro_airblast + ClassIcon pyro_reflect_daan Skill Hard WeaponRestrictions PrimaryOnly TotalCurrency 8 diff --git a/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.dx80.vtx b/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.dx80.vtx new file mode 100644 index 0000000..0440ec5 Binary files /dev/null and b/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.dx80.vtx differ diff --git a/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.dx90.vtx b/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.dx90.vtx new file mode 100644 index 0000000..9a5b47c Binary files /dev/null and b/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.dx90.vtx differ diff --git a/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.mdl b/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.mdl new file mode 100644 index 0000000..78ca881 Binary files /dev/null and b/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.mdl differ diff --git a/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.vvd b/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.vvd new file mode 100644 index 0000000..fc561ec Binary files /dev/null and b/download/models/mvm/workshop_partner/weapons/v_models/v_hm_watch/v_hm_watch_bot.vvd differ diff --git a/gamedata/tf2.bwree.txt b/gamedata/tf2.bwree.txt index e701616..03bf65a 100644 --- a/gamedata/tf2.bwree.txt +++ b/gamedata/tf2.bwree.txt @@ -96,6 +96,11 @@ "windows" "344" "linux" "350" } + "CTFItem::PickUp" + { + "windows" "231" + "linux" "269" + } "CBaseEntity::ShouldTransmit" { "windows" "20" diff --git a/source/bwree/dhooks.sp b/source/bwree/dhooks.sp index 66f199f..afac66d 100644 --- a/source/bwree/dhooks.sp +++ b/source/bwree/dhooks.sp @@ -251,14 +251,11 @@ static MRESReturn DHookCallback_EventKilled_Pre(int pThis, DHookParam hParams) if (attacker == pThis) { - if (info.GetDamageCustom() == TF_CUSTOM_SUICIDE) - { - bDropPack = false; - + bDropPack = false; + #if defined SUICIDE_DISTRIBUTE_CURRENCY - DistributeCurrencyAmount(dropAmount, _, _, true); + DistributeCurrencyAmount(dropAmount, _, _, true); #endif - } } else if (inflictor > 0 && IsEntityATrigger(inflictor)) { diff --git a/source/bwree/events.sp b/source/bwree/events.sp index d27b686..3a2f367 100644 --- a/source/bwree/events.sp +++ b/source/bwree/events.sp @@ -184,6 +184,7 @@ static void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast static void Event_MvmBeginWave(Event event, const char[] name, bool dontBroadcast) { + g_flTimeRoundStarted = GetGameTime(); g_bCanBotsAttackInSpawn = CanBotsAttackWhileInSpawnRoom(g_iPopulationManager); StartSentryBusterCooldown(); diff --git a/source/bwree/robot_templates.sp b/source/bwree/robot_templates.sp index 96d889c..5c76cbe 100644 --- a/source/bwree/robot_templates.sp +++ b/source/bwree/robot_templates.sp @@ -2,7 +2,7 @@ #define ROBOT_NAME_UNDEFINED "TFBot" #define MAX_TELEPORTWHERE_NAME_COUNT 2 #define TELEPORTWHERE_NAME_EACH_MAX_LENGTH 12 -#define MAX_ROBOT_TEMPLATES 130 +#define MAX_ROBOT_TEMPLATES 140 #define MAX_ENGINEER_NEST_HINT_LOCATIONS 20 #define BOSS_ROBOT_SPAWN_SOUND ")mvm/giant_heavy/giant_heavy_entrance.wav" @@ -928,6 +928,25 @@ static Action Timer_FinishRobotPlayer(Handle timer, DataPack pack) MvMEngineerTeleportSpawn(client); } } + else + { + //Let's not try to pickup the flag before the bots do + if (GetGameTime() - g_flTimeRoundStarted >= nb_update_frequency.FloatValue + 0.1) + { + /* Most should start with the flag except some for various reasons + - spies teleport near victims + - teleporting engineers teleport in + - medics are healers + - aggressive does push to capture point */ + if (nMission == CTFBot_NO_MISSION && iClass != TFClass_Medic && !roboPlayer.HasAttribute(CTFBot_AGGRESSIVE)) + { + int flag = GetFlagToFetch(client); + + if (flag != -1 && CaptureFlag_IsHome(flag)) + CTFItemPickup(flag, client, true); + } + } + } //For TFBots this is actually checked in CTFBot::PhysicsSimulate if (roboPlayer.HasAttribute(CTFBot_ALWAYS_CRIT)) diff --git a/source/bwree/sdkcalls.sp b/source/bwree/sdkcalls.sp index 08a70d0..3fdb401 100644 --- a/source/bwree/sdkcalls.sp +++ b/source/bwree/sdkcalls.sp @@ -53,6 +53,7 @@ static Handle m_hGetCurrentWave; static Handle m_hDropCurrencyPack; static Handle m_hDistributeCurrencyAmount; static Handle m_hClip1; +static Handle m_hPickup; bool InitSDKCalls(GameData hGamedata) { @@ -169,6 +170,16 @@ bool InitSDKCalls(GameData hGamedata) failCount++; } + StartPrepSDKCall(SDKCall_Entity); + PrepSDKCall_SetFromConf(hGamedata, SDKConf_Virtual, "CTFItem::PickUp"); + PrepSDKCall_AddParameter(SDKType_CBasePlayer, SDKPass_Pointer); + PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain); + if ((m_hPickup = EndPrepSDKCall()) == null) + { + LogError("Failed to create SDKCall for CTFItem::PickUp!"); + failCount++; + } + if (failCount > 0) { LogError("InitSDKCalls: GameData file has %d problems!", failCount); @@ -236,4 +247,9 @@ int DistributeCurrencyAmount(int nAmount, int pTFPlayer = -1, bool bShared = tru int Clip1(int weapon) { return SDKCall(m_hClip1, weapon); +} + +void CTFItemPickup(int item, int pPlayer, bool bInvisible) +{ + SDKCall(m_hPickup, item, pPlayer, bInvisible); } \ No newline at end of file diff --git a/source/bwree/util.sp b/source/bwree/util.sp index 06c1c63..c33fbdf 100644 --- a/source/bwree/util.sp +++ b/source/bwree/util.sp @@ -14,6 +14,7 @@ #include #include #include +#include #define IsEmptyString(%1) (%1[0] == 0) diff --git a/source/tf2_bwree.sp b/source/tf2_bwree.sp index 3113b9e..f216853 100644 --- a/source/tf2_bwree.sp +++ b/source/tf2_bwree.sp @@ -94,7 +94,10 @@ enum struct esSuspectedSpyInfo #endif bool g_bLateLoad; + bool g_bCanBotsAttackInSpawn; +Handle g_hHudText; +float g_flTimeRoundStarted; int g_iObjectiveResource = -1; int g_iPopulationManager = -1; @@ -801,6 +804,9 @@ public void OnPluginStart() InitGameEventHooks(); + g_hHudText = CreateHudSynchronizer(); + m_adtBWRCooldown = new StringMap(); + GameData hGamedata = new GameData("tf2.bwree"); if (hGamedata) @@ -825,8 +831,6 @@ public void OnPluginStart() SetFailState("Failed to load gamedata file tf2.bwree.txt"); } - m_adtBWRCooldown = new StringMap(); - if (g_bLateLoad) { int maxEntCount = GetMaxEntities(); @@ -1200,7 +1204,30 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 buttons |= IN_ATTACK; } - int myWeapon = player.GetActiveTFWeapon(); + int myWeapon = player.GetActiveWeapon(); + + if (myWeapon != -1) + { + if (roboPlayer.HasAttribute(CTFBot_HOLD_FIRE_UNTIL_FULL_RELOAD) || tf_bot_always_full_reload.BoolValue) + { + if (Clip1(myWeapon) <= 0) + m_bIsWaitingForReload[client] = true; + + if (m_bIsWaitingForReload[client]) + { + if (Clip1(myWeapon) < TF2Util_GetWeaponMaxClip(myWeapon)) + { + //Our clip has not refiled yet, so don't attack right now + buttons &= ~IN_ATTACK; + } + else + { + //We have fully reloaded + m_bIsWaitingForReload[client] = false; + } + } + } + } if (buttons & IN_ATTACK) { @@ -1210,29 +1237,6 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 BlockAttackForDuration(client, 0.5); buttons &= ~IN_ATTACK; } - else if (myWeapon != -1) - { - if (roboPlayer.HasAttribute(CTFBot_HOLD_FIRE_UNTIL_FULL_RELOAD) || tf_bot_always_full_reload.BoolValue) - { - if (Clip1(myWeapon) <= 0) - m_bIsWaitingForReload[client] = true; - - if (m_bIsWaitingForReload[client]) - { - if (Clip1(myWeapon) < TF2Util_GetWeaponMaxClip(myWeapon)) - { - //Our clip has not refiled yet, so don't attack right now - BlockAttackForDuration(client, 0.5); - buttons &= ~IN_ATTACK; - } - else - { - //We have fully reloaded - m_bIsWaitingForReload[client] = false; - } - } - } - } } if (buttons & IN_ATTACK2) @@ -1308,6 +1312,17 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 } } + if (m_bIsWaitingForReload[client]) + { + SetHudTextParams(-1.0, -0.55, 0.25, 0, 255, 0, 255, 0, 0.0, 0.0, 0.0); + ShowSyncHudText(client, g_hHudText, "%t", "Hud_Reloading_Barrage"); + } + else if (roboPlayer.HasMission(CTFBot_MISSION_DESTROY_SENTRIES)) + { + SetHudTextParams(-1.0, -1.0, 0.1, 255, 0, 0, 0, 0, 0.0, 0.0, 0.0); + ShowSyncHudText(client, g_hHudText, "%t", "Hud_Instruct_SentryBuster_Detonate"); + } + float myAbsOrigin[3]; GetClientAbsOrigin(client, myAbsOrigin); //Heehee I'm a spy! @@ -2062,8 +2077,8 @@ public Action PlayerRobot_WeaponCanSwitchTo(int client, int weapon) public void PlayerRobot_WeaponEquipPost(int client, int weapon) { - /* if (GameRules_GetRoundState() == RoundState_BetweenRounds) - return; */ + if (GameRules_GetRoundState() == RoundState_BetweenRounds) + return; switch (bwr3_robot_custom_viewmodels.IntValue) { @@ -2789,6 +2804,78 @@ void SetNextBehaviorActionTime(int client, float value) m_flNextActionTime[client] = GetEngineTime() + value; } +int GetFlagToFetch(int client) +{ + if (TF2_GetPlayerClass(client) == TFClass_Engineer) + return -1; + + if (MvMRobotPlayer(client).HasAttribute(CTFBot_IGNORE_FLAG)) + return -1; + + int ent = -1; + ArrayList adtFlags = new ArrayList(); + int nCarriedFlags = 0; + int enemyTeam = view_as(TF2_GetEnemyTeam(TF2_GetClientTeam(client))); + + while ((ent = FindEntityByClassname(ent, "item_teamflag")) != -1) + { + if (CaptureFlag_IsDisabled(ent)) + continue; + + //We do not look for these as we are not looking for the enemy's flag + if (CaptureFlag_GetType(ent) == TF_FLAGTYPE_CTF) + continue; + + if (BaseEntity_GetTeamNumber(ent) != enemyTeam) + adtFlags.Push(ent); + + if (CaptureFlag_IsStolen(ent)) + nCarriedFlags++; + } + + int iClosestFlag = -1; + float flClosestFlagDist = FLT_MAX; + int iClosestUncarriedFlag = -1; + float flClosestUncarriedFlagDist = FLT_MAX; + + //Always in mvm, so we don't care about non-mvm specific rules here + float myAbsOrigin[3]; GetClientAbsOrigin(client, myAbsOrigin); + + for (int i = 0; i < adtFlags.Length; i++) + { + int iFlag = adtFlags.Get(i); + + //TODO: m_followers? + + //Find closest flag + float vecSubtracted[3]; SubtractVectors(GetAbsOrigin(iFlag), myAbsOrigin, vecSubtracted); + float flDist = GetVectorLength(vecSubtracted, true); + + if (flDist < flClosestFlagDist) + { + iClosestFlag = iFlag; + flClosestFlagDist = flDist; + } + + //Find closest uncarried flag + if (nCarriedFlags < adtFlags.Length && !CaptureFlag_IsStolen(iFlag)) + { + if (flDist < flClosestUncarriedFlagDist) + { + iClosestUncarriedFlag = iFlag; + flClosestUncarriedFlagDist = flDist; + } + } + } + + CloseHandle(adtFlags); + + if (iClosestUncarriedFlag != -1) + return iClosestUncarriedFlag; + + return iClosestFlag; +} + void RemoveAllRobotPlayerOwnedEntities() { RemoveAllRobotPlayerOwnedProjectiles(); diff --git a/translations/bwree.phrases.txt b/translations/bwree.phrases.txt index 6ea7985..1d9a732 100644 --- a/translations/bwree.phrases.txt +++ b/translations/bwree.phrases.txt @@ -144,6 +144,14 @@ "#format" "{1:s}" "en" "{1} is stalling the game." } + "Hud_Reloading_Barrage" + { + "en" "RELOADING BARRAGE" + } + "Hud_Instruct_SentryBuster_Detonate" + { + "en" "Use VoiceCommand \"MEDIC!\" to detonate" + } "Changed_Heal_Target" { "#format" "{1:s}"