Client LuaCsForBarotrauma
WreckAIConfig.cs
1 using System;
3 using Microsoft.Xna.Framework;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Xml.Linq;
7 
8 namespace Barotrauma
9 {
11  {
13 
14  public string Name => "Wreck AI Config";
15 
16  public Dictionary<Identifier, SerializableProperty> SerializableProperties { get; private set; }
17 
19 
21  public Identifier DefensiveAgent { get; private set; }
22 
24  public string OffensiveAgent { get; private set; }
25 
27  public string Brain { get; private set; }
28 
30  public Identifier Spawner { get; private set; }
31 
33  public string BrainRoomBackground { get; private set; }
34 
36  public string BrainRoomVerticalWall { get; private set; }
37 
39  public string BrainRoomHorizontalWall { get; private set; }
40 
41  [Serialize(60f, IsPropertySaveable.No)]
42  public float AgentSpawnDelay { get; private set; }
43 
44  [Serialize(0.5f, IsPropertySaveable.No)]
45  public float AgentSpawnDelayRandomFactor { get; private set; }
46 
48  public float AgentSpawnDelayDifficultyMultiplier { get; private set; }
49 
51  public float AgentSpawnCountDifficultyMultiplier { get; private set; }
52 
54  public int MinAgentsPerBrainRoom { get; private set; }
55 
57  public int MaxAgentsPerRoom { get; private set; }
58 
60  public int MinAgentsOutside { get; private set; }
61 
63  public int MaxAgentsOutside { get; private set; }
64 
66  public int MinAgentsInside { get; private set; }
67 
69  public int MaxAgentsInside { get; private set; }
70 
72  public int MaxAgentCount { get; private set; }
73 
74  [Serialize(100f, IsPropertySaveable.No)]
75  public float MinWaterLevel { get; private set; }
76 
77  [Serialize(true, IsPropertySaveable.No)]
78  public bool KillAgentsWhenEntityDies { get; private set; }
79 
81  public float DeadEntityColorMultiplier { get; private set; }
82 
84  public float DeadEntityColorFadeOutTime { get; private set; }
85 
86  public readonly Identifier[] ForbiddenAmmunition;
87 
88  public static WreckAIConfig GetRandom() => Prefabs.OrderBy(p => p.UintIdentifier).GetRandom(Rand.RandSync.ServerAndClient);
89 
90  protected override Identifier DetermineIdentifier(XElement element)
91  {
92  return element.GetAttributeIdentifier("Entity", base.DetermineIdentifier(element));
93  }
94 
95  public WreckAIConfig(ContentXElement element, WreckAIConfigFile file) : base(file, element)
96  {
98  ForbiddenAmmunition = XMLExtensions.GetAttributeIdentifierArray(element, "ForbiddenAmmunition", Array.Empty<Identifier>());
99  }
100 
101  public override void Dispose() { }
102  }
103 }
readonly Identifier Identifier
Definition: Prefab.cs:34
Prefab that has a property serves as a deterministic hash of a prefab's identifier....
static Dictionary< Identifier, SerializableProperty > DeserializeProperties(object obj, XElement element=null)
float AgentSpawnCountDifficultyMultiplier
static readonly PrefabCollection< WreckAIConfig > Prefabs
Dictionary< Identifier, SerializableProperty > SerializableProperties
readonly Identifier[] ForbiddenAmmunition
override Identifier DetermineIdentifier(XElement element)
override void Dispose()
float AgentSpawnDelayDifficultyMultiplier
static WreckAIConfig GetRandom()
WreckAIConfig(ContentXElement element, WreckAIConfigFile file)