Unstable 0.1500.1.0 (BaroDev edition)
This commit is contained in:
+5
-1
@@ -14,6 +14,10 @@ namespace Barotrauma.Abilities
|
||||
// currently only used to turn off simulation if random conditions are in use
|
||||
public bool IsActive { get; private set; } = true;
|
||||
|
||||
protected int maxTriggerCount { get; }
|
||||
protected int timesTriggered = 0;
|
||||
|
||||
|
||||
// add support for OR conditions?
|
||||
protected readonly List<AbilityCondition> abilityConditions = new List<AbilityCondition>();
|
||||
|
||||
@@ -24,7 +28,7 @@ namespace Barotrauma.Abilities
|
||||
{
|
||||
CharacterTalent = characterTalent;
|
||||
Character = CharacterTalent.Character;
|
||||
|
||||
maxTriggerCount = abilityElementGroup.GetAttributeInt("maxtriggercount", int.MaxValue);
|
||||
foreach (XElement subElement in abilityElementGroup.Elements())
|
||||
{
|
||||
switch (subElement.Name.ToString().ToLowerInvariant())
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ namespace Barotrauma.Abilities
|
||||
|
||||
private bool IsApplicable(object abilityData)
|
||||
{
|
||||
if (timesTriggered >= maxTriggerCount) { return false; }
|
||||
return abilityConditions.All(c => c.MatchesCondition(abilityData));
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -14,6 +14,7 @@ namespace Barotrauma.Abilities
|
||||
private float effectDelay;
|
||||
private float effectDelayTimer;
|
||||
|
||||
|
||||
public CharacterAbilityGroupInterval(CharacterTalent characterTalent, XElement abilityElementGroup) : base(characterTalent, abilityElementGroup)
|
||||
{
|
||||
// too many overlapping intervals could cause hitching? maybe randomize a little
|
||||
@@ -42,6 +43,7 @@ namespace Barotrauma.Abilities
|
||||
}
|
||||
private bool IsApplicable()
|
||||
{
|
||||
if (timesTriggered >= maxTriggerCount) { return false; }
|
||||
return abilityConditions.All(c => c.MatchesCondition());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user