Client LuaCsForBarotrauma
AbilityConditionServerRandom.cs
1
using
System.Xml.Linq;
2
3
namespace
Barotrauma.Abilities
4
{
5
class
AbilityConditionServerRandom
:
AbilityConditionDataless
6
{
7
private
readonly
float
randomChance = 0f;
8
public
override
bool
AllowClientSimulation
=>
false
;
9
10
public
AbilityConditionServerRandom
(
CharacterTalent
characterTalent
,
ContentXElement
conditionElement) : base(
characterTalent
, conditionElement)
11
{
12
randomChance = conditionElement.
GetAttributeFloat
(
"randomchance"
, 1f);
13
}
14
15
protected
override
bool
MatchesConditionSpecific
()
16
{
17
return
randomChance >= Rand.Range(0f, 1f, Rand.RandSync.Unsynced);
18
}
19
}
20
}
Barotrauma.Abilities.AbilityConditionDataless
Definition:
AbilityConditionDataless.cs:4
Barotrauma.Abilities.AbilityCondition.characterTalent
CharacterTalent characterTalent
Definition:
AbilityCondition.cs:8
Barotrauma.Abilities.AbilityConditionServerRandom
Definition:
AbilityConditionServerRandom.cs:6
Barotrauma.Abilities.AbilityConditionServerRandom.AllowClientSimulation
override bool AllowClientSimulation
Definition:
AbilityConditionServerRandom.cs:8
Barotrauma.Abilities.AbilityConditionServerRandom.AbilityConditionServerRandom
AbilityConditionServerRandom(CharacterTalent characterTalent, ContentXElement conditionElement)
Definition:
AbilityConditionServerRandom.cs:10
Barotrauma.Abilities.AbilityConditionServerRandom.MatchesConditionSpecific
override bool MatchesConditionSpecific()
Definition:
AbilityConditionServerRandom.cs:15
Barotrauma.CharacterTalent
Definition:
CharacterTalent.cs:8
Barotrauma.ContentXElement
Definition:
ContentXElement.cs:13
Barotrauma.ContentXElement.GetAttributeFloat
float GetAttributeFloat(string key, float def)
Barotrauma.Abilities
Definition:
AbilityCondition.cs:5
Barotrauma
BarotraumaShared
SharedSource
Characters
Talents
Abilities
AbilityConditionals
AbilityConditionDataless
AbilityConditionServerRandom.cs
Generated by
1.9.1