Client LuaCsForBarotrauma
AbilityConditionShipFlooded.cs
1 namespace Barotrauma.Abilities
2 {
4  {
5  private readonly float floodPercentage;
7  {
8  floodPercentage = conditionElement.GetAttributeFloat("floodpercentage", 0f);
9  }
10 
11  protected override bool MatchesConditionSpecific()
12  {
13  if (!character.IsInFriendlySub) { return false; }
14  float waterVolume = 0.0f, totalVolume = 0.0f;
15  foreach (Hull hull in Hull.HullList)
16  {
17  if (hull.Submarine != character.Submarine) { continue; }
18  waterVolume += hull.WaterVolume;
19  totalVolume += hull.Volume;
20  }
21  return (waterVolume / totalVolume) > floodPercentage;
22  }
23  }
24 }
AbilityConditionShipFlooded(CharacterTalent characterTalent, ContentXElement conditionElement)
float GetAttributeFloat(string key, float def)
Submarine Submarine
Definition: Entity.cs:53
static readonly List< Hull > HullList