(f2cce83a3) AI combat improvements: - Bots now find weapons that are inside the equipped containers (tool boxes). - Bots can now use any item as a weapon as long as there's a combat priority defined for the items. - Adjust the combat priorities a bit; the bots now prioritize welding tool and plasma cutter over wrench or toolbox.

This commit is contained in:
Joonas Rikkonen
2019-06-04 16:52:24 +03:00
parent c4584f7763
commit cdc58316ed
2 changed files with 31 additions and 30 deletions
@@ -208,7 +208,13 @@ namespace Barotrauma.Items.Components
get;
private set;
}
/// <summary>
/// How useful the item is in combat? Used by AI to decide which item it should use as a weapon. For the sake of clarity, use a value between 0 and 100 (not enforced).
/// </summary>
[Serialize(0f, false)]
public float CombatPriority { get; private set; }
public ItemComponent(Item item, XElement element)
{
this.item = item;
@@ -539,6 +545,7 @@ namespace Barotrauma.Items.Components
GameAnalyticsManager.AddErrorEventOnce("ItemComponent.DegreeOfSuccess:CharacterNull", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
return 0.0f;
}
float average = skillSuccessSum / requiredSkills.Count;
float skillSuccessSum = 0.0f;
for (int i = 0; i < requiredSkills.Count; i++)