Track LocalMods as part of monolith
This commit is contained in:
Executable
+43
@@ -0,0 +1,43 @@
|
||||
using Barotrauma;
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.Items.Components;
|
||||
using FarseerPhysics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using static Barotrauma.AIObjectiveIdle;
|
||||
|
||||
namespace MoreLevelContent.Shared.AI
|
||||
{
|
||||
// Targets list not populating is probably the issue
|
||||
internal class AIFightIntrudersAnySubObjective : AIObjectiveFightIntruders
|
||||
{
|
||||
public AIFightIntrudersAnySubObjective(Character character, AIObjectiveManager objectiveManager, float priorityModifier = 1) : base(character, objectiveManager, priorityModifier)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool AllowInAnySub => true;
|
||||
|
||||
|
||||
public override void FindTargets()
|
||||
{
|
||||
foreach (Character target in GetList())
|
||||
{
|
||||
if (!IsValidTarget(target)) { continue; }
|
||||
if (!character.CanSeeTarget(target)) { continue; }
|
||||
if (!ignoreList.Contains(target))
|
||||
{
|
||||
Targets.Add(target);
|
||||
if (Targets.Count > MaxTargets)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user