public bodypart(ClassTypes ty, PartTypes pt, string name = " ",double str = 0, double def = 0, double intel = 0, double agil = 0, double end = 0) { Name = name; Abilities = new List<ability>(); Class = ty; Part = pt; ClassPart = (ClassPartTypes)Enum.Parse(typeof(ClassPartTypes),Class.ToString() + Part.ToString()); if (str + agil + def + intel + end != 0) { ability tempAbility = new ability("Base", new List<effect>() { new effect(Stats.statsType.STRENGTH, str, -1, false, true, " ", this.ClassPart), new effect(Stats.statsType.AGILITY, agil, -1, false, true, " ", this.ClassPart), new effect(Stats.statsType.INTELLIGENCE, intel, -1, false, true, " ", this.ClassPart), new effect(Stats.statsType.ENDURANCE, end, -1, false, true, " ", this.ClassPart), new effect(Stats.statsType.DEFENCE, def, -1, false, true, " ",this.ClassPart) }, true, true, new mastery(), new Stats()); this.AddAbility(tempAbility); } }
public void AddAbility(ability ab) { if(ab.Passive) foreach (effect e in ab.Effects) e.EffectPart = this.ClassPart; Abilities.Add(ab); }
private void AddAbility(ability a) { if (a.Passive) foreach (effect e in a.Effects) this.AddEffect(e); this.Abilities.Add(a); }
private void RemoveAbility(ability a) { if (a.Passive) foreach (effect e in a.Effects) e.Timeout = 0; this.Abilities.Remove(a); }
public void useAbilityOn(creature target, ability a) { foreach (effect e in a.Effects) { if (e.EffectedType == Stats.statsType.DAMAGE) this.GiveDamage(target, e); else target.AddEffect(e); } }