(22ec3a281) Add a boolean that controls whether or not the enemy attacks outposts and the characters inside it.
This commit is contained in:
@@ -14,6 +14,11 @@ namespace Barotrauma
|
||||
{
|
||||
public static bool DisableEnemyAI;
|
||||
|
||||
/// <summary>
|
||||
/// Enable the character to attack the outposts and the characters inside them. Disabled by default.
|
||||
/// </summary>
|
||||
public bool TargetOutposts;
|
||||
|
||||
class WallTarget
|
||||
{
|
||||
public Vector2 Position;
|
||||
@@ -1067,11 +1072,11 @@ namespace Barotrauma
|
||||
continue;
|
||||
}
|
||||
if (target.Type == AITarget.TargetType.HumanOnly) { continue; }
|
||||
// Don't attack outposts.
|
||||
if (target.Entity.Submarine != null && target.Entity.Submarine.IsOutpost) { continue; }
|
||||
|
||||
if (!TargetOutposts)
|
||||
{
|
||||
if (target.Entity.Submarine != null && target.Entity.Submarine.IsOutpost) { continue; }
|
||||
}
|
||||
Character targetCharacter = target.Entity as Character;
|
||||
|
||||
//ignore the aitarget if it is the Character itself
|
||||
if (targetCharacter == character) continue;
|
||||
|
||||
|
||||
@@ -128,6 +128,25 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public string DisplayName
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
private string roomName;
|
||||
[Editable, Serialize("", true, translationTextTag: "RoomName.")]
|
||||
public string RoomName
|
||||
{
|
||||
get { return roomName; }
|
||||
set
|
||||
{
|
||||
if (roomName == value) { return; }
|
||||
roomName = value;
|
||||
DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName;
|
||||
}
|
||||
}
|
||||
|
||||
public override Rectangle Rect
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user