Client LuaCsForBarotrauma
AbilityConditionServerRandom.cs
1 using System.Xml.Linq;
2 
3 namespace Barotrauma.Abilities
4 {
6  {
7  private readonly float randomChance = 0f;
8  public override bool AllowClientSimulation => false;
9 
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 }
AbilityConditionServerRandom(CharacterTalent characterTalent, ContentXElement conditionElement)
float GetAttributeFloat(string key, float def)