internal void AddModifierFromEffect(IntModifierFromEffect a_modifier) { if (a_modifier.modifier.IsBonus) { _bonusList.Add(a_modifier); } else { _malusList.Add(a_modifier); } _needsToBeCompute = true; }
internal override AEffectReport Apply(Unit a_target) { if (effectInfos == null) { Debug.LogError("Null effect for this modifier effect"); return(null); } FloatModifier percent; IntModifier flat; IntModifierFromEffect intMod; FloatModifierFromEffect floatMod; //PHYSICAL if (physical.flat > 0) { flat = new IntModifier(); flat.flat = ComputeStackModification(physical.flat); intMod = new IntModifierFromEffect(); intMod.modifier = flat; intMod.source = effectInfos.effectOverTime; a_target.attack.bonusPhysical.damage.flat.AddModifierFromEffect(intMod); } if (physical.percent > 0) { percent = new FloatModifier(); percent.flat = ComputeStackModification(physical.percent); // Only flat % modification. floatMod = new FloatModifierFromEffect(); floatMod.modifier = percent; floatMod.source = effectInfos.effectOverTime; a_target.attack.bonusPhysical.damage.percent.AddModifierFromEffect(floatMod); } //MAGIC if (magic.flat > 0) { flat = new IntModifier(); flat.flat = ComputeStackModification(magic.flat); intMod = new IntModifierFromEffect(); intMod.modifier = flat; intMod.source = effectInfos.effectOverTime; a_target.attack.bonusMagical.damage.flat.AddModifierFromEffect(intMod); } if (magic.percent > 0) { percent = new FloatModifier(); percent.flat = ComputeStackModification(magic.percent); // Only flat % modification. floatMod = new FloatModifierFromEffect(); floatMod.modifier = percent; floatMod.source = effectInfos.effectOverTime; a_target.attack.bonusMagical.damage.percent.AddModifierFromEffect(floatMod); } return(null); }