Client LuaCsForBarotrauma
AbilityConditionHasDifferentJobs.cs
1
using
System.Collections.Generic;
2
using
System.Linq;
3
using
System.Xml.Linq;
4
5
namespace
Barotrauma.Abilities
6
{
7
class
AbilityConditionHasDifferentJobs
:
AbilityConditionDataless
8
{
9
private
readonly
int
amount;
10
public
AbilityConditionHasDifferentJobs
(
CharacterTalent
characterTalent
,
ContentXElement
conditionElement) : base(
characterTalent
, conditionElement)
11
{
12
amount = conditionElement.
GetAttributeInt
(
"amount"
, 0);
13
}
14
15
protected
override
bool
MatchesConditionSpecific
()
16
{
17
IEnumerable<Character> crewmembers =
Character
.
GetFriendlyCrew
(
character
);
18
int
differentCrewAmount = crewmembers.Select(c => c.Info?.Job?.Prefab.Identifier).Distinct().Count();
19
return
differentCrewAmount >= amount;
20
}
21
}
22
}
Barotrauma.Abilities.AbilityConditionDataless
Definition:
AbilityConditionDataless.cs:4
Barotrauma.Abilities.AbilityConditionHasDifferentJobs
Definition:
AbilityConditionHasDifferentJobs.cs:8
Barotrauma.Abilities.AbilityConditionHasDifferentJobs.MatchesConditionSpecific
override bool MatchesConditionSpecific()
Definition:
AbilityConditionHasDifferentJobs.cs:15
Barotrauma.Abilities.AbilityConditionHasDifferentJobs.AbilityConditionHasDifferentJobs
AbilityConditionHasDifferentJobs(CharacterTalent characterTalent, ContentXElement conditionElement)
Definition:
AbilityConditionHasDifferentJobs.cs:10
Barotrauma.Abilities.AbilityCondition.character
Character character
Definition:
AbilityCondition.cs:9
Barotrauma.Abilities.AbilityCondition.characterTalent
CharacterTalent characterTalent
Definition:
AbilityCondition.cs:8
Barotrauma.Character
Definition:
BarotraumaShared/SharedSource/Characters/Character.cs:32
Barotrauma.Character.GetFriendlyCrew
static IEnumerable< Character > GetFriendlyCrew(Character character)
Definition:
BarotraumaShared/SharedSource/Characters/Character.cs:5738
Barotrauma.CharacterTalent
Definition:
CharacterTalent.cs:8
Barotrauma.ContentXElement
Definition:
ContentXElement.cs:13
Barotrauma.ContentXElement.GetAttributeInt
int GetAttributeInt(string key, int def)
Barotrauma.Abilities
Definition:
AbilityCondition.cs:5
Barotrauma
BarotraumaShared
SharedSource
Characters
Talents
Abilities
AbilityConditionals
AbilityConditionDataless
AbilityConditionHasDifferentJobs.cs
Generated by
1.9.1