public effect(effect e) { this.PerminentTimeout = e.PerminentTimeout; this.Timeout = e.Timeout; this.effectedStat = e.effectedStat; this.Perturn = e.Perturn; this.ParentName = e.ParentName; this.ResetStat = e.ResetStat; this.TotalMod = e.TotalMod; }
/// <summary> /// Decrease the stat effected by the total amount effected. /// </summary> /// <param name="e">The effect to be reduce</param> private void removeEffectMod(effect e) { myStats[e.EffectedType] -= e.TotalMod; e.TotalMod = 0; }
/// <summary> /// Makes an effect's timeout 0 /// </summary> /// <param name="e"></param> private void RemoveEffect(effect e) { removeEffectMod(e); }
/// <summary> /// An effect is added and the modification is done once. /// </summary> /// <param name="e">Effect to be added to the effects on the creature</param> private void AddEffect(effect e) { this.effects.Add(e); addEffectMod(e); }
public string TakeDamage(effect e) { string ret; e.damageToHealth(); e.EffectMod = -(e.EffectMod - CalculateDamageResistance(myStats[Stats.statsType.DEFENCE],myStats[Stats.statsType.INTELLIGENCE], myStats[Stats.statsType.RESISTANCE])); //Damage less than 0 after resistance if (e.EffectMod >= 0) { e.EffectMod = 0; ret = "Blocked"; } else ret = e.EffectMod.ToString(); this.AddEffect(e); return ret; /**TODO check for death!**/ }
public void GiveDamage(creature Target, effect e) { /** TODO: Calculate Actual damage based on damaged based by effect **/ effect tempE = new effect(e); tempE.EffectMod = CalculateDamage2(myStats[Stats.statsType.STRENGTH], myStats[Stats.statsType.INTELLIGENCE], tempE.EffectMod); Target.TakeDamage(tempE); }
/// <summary> /// Called by Effect's effectStep method. Adds the effect mod to the effect if the effect is Perturn. /// The effects totalMod is increased by the total moded /// </summary> /// <param name="e">The effect to be added</param> public void addEffectMod(effect e) { double total = e.EffectMod * ((e.EffectPart != bodypart.ClassPartTypes.NULL && e.Timeout == -1) ? mastery.MasterMod(this.Mastery.MasteryLevels[e.EffectPart]) : 1); myStats[e.EffectedType] += total; e.TotalMod += total; //for perturn effects, increase the effect each time. }