Client LuaCsForBarotrauma
AbilityConditionShipFlooded.cs
1
namespace
Barotrauma.Abilities
2
{
3
class
AbilityConditionShipFlooded
:
AbilityConditionDataless
4
{
5
private
readonly
float
floodPercentage;
6
public
AbilityConditionShipFlooded
(
CharacterTalent
characterTalent
,
ContentXElement
conditionElement) : base(
characterTalent
, conditionElement)
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
is not { } hullSubmarine) {
continue
; }
18
if
(hullSubmarine !=
character
.
Submarine
|| hullSubmarine.
TeamID
!=
character
.
TeamID
) {
continue
; }
19
waterVolume += hull.
WaterVolume
;
20
totalVolume += hull.
Volume
;
21
}
22
return
(waterVolume / totalVolume) > floodPercentage;
23
}
24
}
25
}
Barotrauma.Abilities.AbilityConditionDataless
Definition:
AbilityConditionDataless.cs:4
Barotrauma.Abilities.AbilityCondition.character
Character character
Definition:
AbilityCondition.cs:9
Barotrauma.Abilities.AbilityCondition.characterTalent
CharacterTalent characterTalent
Definition:
AbilityCondition.cs:8
Barotrauma.Abilities.AbilityConditionShipFlooded
Definition:
AbilityConditionShipFlooded.cs:4
Barotrauma.Abilities.AbilityConditionShipFlooded.AbilityConditionShipFlooded
AbilityConditionShipFlooded(CharacterTalent characterTalent, ContentXElement conditionElement)
Definition:
AbilityConditionShipFlooded.cs:6
Barotrauma.Abilities.AbilityConditionShipFlooded.MatchesConditionSpecific
override bool MatchesConditionSpecific()
Definition:
AbilityConditionShipFlooded.cs:11
Barotrauma.Character.IsInFriendlySub
bool IsInFriendlySub
Definition:
BarotraumaShared/SharedSource/Characters/Character.cs:1266
Barotrauma.Character.TeamID
CharacterTeamType TeamID
Definition:
BarotraumaShared/SharedSource/Characters/Character.cs:210
Barotrauma.CharacterTalent
Definition:
CharacterTalent.cs:8
Barotrauma.ContentXElement
Definition:
ContentXElement.cs:13
Barotrauma.ContentXElement.GetAttributeFloat
float GetAttributeFloat(string key, float def)
Barotrauma.Entity.Submarine
Submarine Submarine
Definition:
Entity.cs:53
Barotrauma.Hull
Definition:
BarotraumaShared/SharedSource/Map/Hull.cs:115
Barotrauma.Hull.HullList
static readonly List< Hull > HullList
Definition:
BarotraumaShared/SharedSource/Map/Hull.cs:116
Barotrauma.Hull.Volume
float Volume
Definition:
BarotraumaShared/SharedSource/Map/Hull.cs:373
Barotrauma.Hull.WaterVolume
float WaterVolume
Definition:
BarotraumaShared/SharedSource/Map/Hull.cs:300
Barotrauma.Submarine.TeamID
CharacterTeamType TeamID
Definition:
BarotraumaShared/SharedSource/Map/Submarine.cs:28
Barotrauma.Abilities
Definition:
AbilityCondition.cs:5
Barotrauma
BarotraumaShared
SharedSource
Characters
Talents
Abilities
AbilityConditionals
AbilityConditionDataless
AbilityConditionShipFlooded.cs
Generated by
1.9.1