public void CalculateAdjustmentsForMovementHorizontal( ref float baseAdd, ref float bonusAdd, ref float percentAdd, ref float multipliers) { if (GetComponent <ActorStatus>().HasStatus(StatusType.MovementDebuffSuppression)) { StatModFilterDelegate filterDelegate = statMod => !(statMod.mod != ModType.Multiplier ? statMod.val < 0.0 : statMod.val < 1.0); CalculateAdjustments(StatType.Movement_Horizontal, ref baseAdd, ref bonusAdd, ref percentAdd, ref multipliers, filterDelegate); } else { CalculateAdjustments(StatType.Movement_Horizontal, ref baseAdd, ref bonusAdd, ref percentAdd, ref multipliers); } }
private void CalculateAdjustments( StatType stat, ref float baseAdd, ref float bonusAdd, ref float percentAdd, ref float multipliers, StatModFilterDelegate filterDelegate) { if (m_statMods == null || !m_statMods.ContainsKey(stat)) { return; } List <StatMod> statMod = m_statMods[stat]; for (int index = 0; index < statMod.Count; ++index) { if (filterDelegate(statMod[index])) { CalculateAdjustmentForStatMod(statMod[index], ref baseAdd, ref bonusAdd, ref percentAdd, ref multipliers); } } }