/// <summary> /// Default constructor /// </summary> /// <param name="name">The minion's type name [imp, succy, felguard, etc]</param> /// <param name="master">A reference to the minion owner's character sheet - required because there are talents / buffs that apply to the minion too.</param> /// <param name="stats">A reference to the minion owner's cumulative stats - required because many stats are inherited by the minion.</param> protected Minion(String name, Character master, Stats stats) { Name = name; Master = master; OwnerStats = stats; HealthModifier = 1; MaxHealthModifier = 1; PowerModifier = 1; InheritedCriticalStrikeChance = (master.WarlockTalents.ImprovedDemonicTactics * 0.10f); #region minion buffs //A minion will inherit nearly all the buffs applied to its master, //so (to keep things simple), we copy all buffs on the master and remove the ones that dont apply CalculationsWarlock calcs = new CalculationsWarlock(); Stats buffs = calcs.GetBuffsStats(master.ActiveBuffs); //focus magic cannot be applied to minions if (master.ActiveBuffsContains("Focus Magic")) { buffs -= Buff.GetBuffByName("Focus Magic").Stats; } //food and flask/elixir/potions consumed by the master do not apply to minions foreach (Buff buff in master.ActiveBuffs) { if (buff.Group == "Elixirs and Flasks") { buffs -= buff.Stats; //TODO: Remove any buff improvements //foreach (Buff ImpBuff in buff.Improvements) buffs -= ImpBuff.Stats; ; } if (buff.Group == "Food") { buffs -= buff.Stats; } } //however, minions do eat food (e.g. Kibler's), so we'll assume that if the master has food, then the minion does too. //TODO: minion food buffs MinionStats = buffs; #endregion }
/// <summary> /// Default constructor /// </summary> /// <param name="name">The minion's type name [imp, succy, felguard, etc]</param> /// <param name="master">A reference to the minion owner's character sheet - required because there are talents / buffs that apply to the minion too.</param> /// <param name="stats">A reference to the minion owner's cumulative stats - required because many stats are inherited by the minion.</param> protected Minion( String name, Character master, Stats stats ) { Name = name; Master = master; OwnerStats = stats; HealthModifier = 1; MaxHealthModifier = 1; PowerModifier = 1; InheritedCriticalStrikeChance = (master.WarlockTalents.ImprovedDemonicTactics * 0.10f); #region minion buffs //A minion will inherit nearly all the buffs applied to its master, //so (to keep things simple), we copy all buffs on the master and remove the ones that dont apply CalculationsWarlock calcs = new CalculationsWarlock(); Stats buffs = calcs.GetBuffsStats(master.ActiveBuffs); //focus magic cannot be applied to minions if (master.ActiveBuffsContains("Focus Magic")) { buffs -= Buff.GetBuffByName("Focus Magic").Stats; } //food and flask/elixir/potions consumed by the master do not apply to minions foreach (Buff buff in master.ActiveBuffs) { if (buff.Group == "Elixirs and Flasks") { buffs -= buff.Stats; //TODO: Remove any buff improvements //foreach (Buff ImpBuff in buff.Improvements) buffs -= ImpBuff.Stats; ; } if (buff.Group == "Food") buffs -= buff.Stats; } //however, minions do eat food (e.g. Kibler's), so we'll assume that if the master has food, then the minion does too. //TODO: minion food buffs MinionStats = buffs; #endregion }