public bool TestAndGrant(StatusConditionTest test, Tick duration) { if (!test.Percentage.Test()) return false; StatusCondition statusCondition; if (StatusConditions.TryGetValue(test.Type, out statusCondition)) { statusCondition.Reserve(duration); return true; } statusCondition = StatusConditionFactory.Create(this, test.Type, duration); StatusConditions.Add(test.Type, statusCondition); return true; }
public bool TestAndGrant(StatusConditionTest test) { var statusConditionData = BattleBalance._.Data.GetStatusCondition(StatusConditionGroup, test.Type); return TestAndGrant(test, statusConditionData.DefaultDuration); }