public ArmorClassChecker(SBCheckerBaseInput sbCheckerBaseInput, IArmorClassData armorClassData, int SizeMod, int DodgeBonus) { _sbCheckerBaseInput = sbCheckerBaseInput; this.SizeMod = SizeMod; this.DodgeBonus = DodgeBonus; ACMods_SB = armorClassData.ACMods_SB; AC = _sbCheckerBaseInput.MonsterSB.AC; Race = _sbCheckerBaseInput.Race_Base.Name(); HD = _sbCheckerBaseInput.Race_Base.RaceSB.HDValue(); _onGoingMods = _sbCheckerBaseInput.IndvSB.GetOnGoingStatBlockMods(); _armorClassData = armorClassData; }
public ArmorClassChecker(StatBlockMessageWrapper _messageXML, MonSBSearch _monSBSearch, ClassMaster CharacterClasses, StatBlockInfo.ACMods ACMods_Computed, int MaxDexMod, int SizeMod, int DodgeBonus, string AC, StatBlockInfo.ACMods ACMods_SB, string Race, List <OnGoingStatBlockModifier> onGoingMods, int HD) { this._messageXML = _messageXML; this._monSBSearch = _monSBSearch; this.CharacterClasses = CharacterClasses; this.ACMods_Computed = ACMods_Computed; this.MaxDexMod = MaxDexMod; this.SizeMod = SizeMod; this.DodgeBonus = DodgeBonus; this.ACMods_SB = ACMods_SB; this.AC = AC; this.Race = Race; this.HD = HD; _onGoingMods = onGoingMods; }
public void CheckACValue() { string CheckName = "AC Value"; int dexBonus = 0, duelist = 0, onGoingMods = 0, flatFootedMod = 0; int dexUsed = _sbCheckerBaseInput.MonsterSBSearch.GetAbilityMod(AbilityScores.AbilityScores.AbilityName.Dexterity); int dexMod = dexUsed; string formula = string.Empty; StatBlockInfo.ACMods acMods_Computed = new StatBlockInfo.ACMods(); if (_sbCheckerBaseInput.CharacterClasses.HasClass("duelist")) //Canny Defense { int IntMod = _sbCheckerBaseInput.MonsterSBSearch.GetAbilityMod(AbilityScores.AbilityScores.AbilityName.Intelligence); if (IntMod > 0) { int Mod; int DuelistLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("duelist"); Mod = IntMod >= DuelistLevel ? Mod = DuelistLevel : Mod = IntMod; duelist = Mod; } } if (_armorClassData.MaxDexMod > -1) //negative number means no penalty { if (_armorClassData.MaxDexMod < dexMod) { dexUsed = _armorClassData.MaxDexMod; formula += " MaxDex: was " + _armorClassData.MaxDexMod.ToString() + " even though Dex mod is " + (dexMod).ToString(); // duelist = 0; } } if (dexMod > 0) { dexBonus = dexUsed; } if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Uncanny Dodge")) { flatFootedMod = dexUsed; } switch (Race) { case "kasatha": acMods_Computed.Dodge += 2; break; case "Svirfneblin": acMods_Computed.Dodge += 2; break; } if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("void form")) { acMods_Computed.Deflection += HD / 4; } if (_sbCheckerBaseInput.MonsterSBSearch.HasSubType("clockwork")) { acMods_Computed.Dodge += 2; } if (_sbCheckerBaseInput.CharacterClasses.HasClass("sorcerer")) //Natural Armor Increase { if (_sbCheckerBaseInput.MonsterSBSearch.HasBloodline("draconic")) { int sorLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("sorcerer"); if (sorLevel >= 3) { acMods_Computed.Natural += 1; } if (sorLevel >= 9) { acMods_Computed.Natural += 1; } if (sorLevel >= 15) { acMods_Computed.Natural += 2; } } } if (_sbCheckerBaseInput.CharacterClasses.HasClass("oracle")) { if (_sbCheckerBaseInput.MonsterSBSearch.HasMystery("ancestor") && _sbCheckerBaseInput.MonsterSBSearch.HasSQ("spirit shield")) { int oracleLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("oracle"); if (oracleLevel >= 1) { acMods_Computed.Armor += 4; } if (oracleLevel >= 7) { acMods_Computed.Armor += 2; } if (oracleLevel >= 11) { acMods_Computed.Armor += 2; } if (oracleLevel >= 15) { acMods_Computed.Armor += 2; } if (oracleLevel >= 19) { acMods_Computed.Armor += 2; } } } if (_sbCheckerBaseInput.CharacterClasses.HasClass("gunslinger")) //Nimble (Ex) { int gunslingerLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("gunslinger"); if (gunslingerLevel >= 2) { acMods_Computed.Dodge += 1; } if (gunslingerLevel >= 6) { acMods_Computed.Dodge += 1; } if (gunslingerLevel >= 10) { acMods_Computed.Dodge += 1; } if (gunslingerLevel >= 14) { acMods_Computed.Dodge += 1; } if (gunslingerLevel >= 18) { acMods_Computed.Dodge += 1; } } if (_sbCheckerBaseInput.CharacterClasses.HasClass("swashbuckler")) //Nimble (Ex) { int swashbucklerLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("swashbuckler"); if (swashbucklerLevel >= 3) { acMods_Computed.Dodge += 1; } if (swashbucklerLevel >= 7) { acMods_Computed.Dodge += 1; } if (swashbucklerLevel >= 11) { acMods_Computed.Dodge += 1; } if (swashbucklerLevel >= 15) { acMods_Computed.Dodge += 1; } if (swashbucklerLevel >= 19) { acMods_Computed.Dodge += 1; } } if (_sbCheckerBaseInput.CharacterClasses.HasClass("stalwart defender")) //AC Bonus (Ex) { int stalwartDefenderLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("stalwart defender"); if (stalwartDefenderLevel >= 1) { acMods_Computed.Dodge += 1; } if (stalwartDefenderLevel >= 4) { acMods_Computed.Dodge += 1; } if (stalwartDefenderLevel >= 7) { acMods_Computed.Dodge += 1; } if (stalwartDefenderLevel >= 10) { acMods_Computed.Dodge += 1; } } if (_sbCheckerBaseInput.CharacterClasses.HasClass("ranger") && _sbCheckerBaseInput.MonsterSBSearch.HasArchetype("shapeshifter")) { if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("form of the dragon")) { acMods_Computed.Natural += 2; } } if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("staff magus")) //Quarterstaff Defense (Ex) { int magusLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("magus"); //TO DO } if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Aldori Dueling Mastery")) { acMods_Computed.Shield += 2; //Aldori Dueling Mastery } if (_sbCheckerBaseInput.CharacterClasses.HasClass("prophet of kalistrade")) { int level = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("prophet of kalistrade"); //Auspicious Display --assumes the bling is present int mod = 1; if (level >= 4) { mod++; } if (level >= 7) { mod++; } if (level >= 10) { mod++; } acMods_Computed.Dodge += mod; } //should be handled SBChecker.ParseACMods() //foreach (OnGoingStatBlockModifier mod in _onGoingMods) //{ // if (mod.ModType == OnGoingStatBlockModifier.StatBlockModifierTypes.AC) // { // onGoingMods += mod.Modifier; // } //} if (_sbCheckerBaseInput.MonsterSBSearch.HasTemplate("worm that walks")) { int WisMod = _sbCheckerBaseInput.MonsterSBSearch.GetAbilityMod(AbilityScores.AbilityScores.AbilityName.Wisdom); if (WisMod < 2) { WisMod = 2; } acMods_Computed.Insight += WisMod; } acMods_Computed.Natural += _armorClassData.ACMods_SB.Natural; acMods_Computed.Armor += _armorClassData.ACMods_Computed.Armor; acMods_Computed.Shield += _armorClassData.ACMods_Computed.Shield; acMods_Computed.Deflection += _armorClassData.ACMods_SB.Deflection; acMods_Computed.Dodge += _armorClassData.ACMods_SB.Dodge; int OtherBonuses = acMods_Computed.Enhancement + acMods_Computed.Deflection + acMods_Computed.Natural + acMods_Computed.Dodge + acMods_Computed.Wis + acMods_Computed.Defending + acMods_Computed.Insight + SizeMod + acMods_Computed.Monk + duelist + onGoingMods; formula += " AC = 10 +" + acMods_Computed.Armor.ToString() + " Armor +" + acMods_Computed.Shield.ToString() + " Shield +" + dexUsed.ToString() + " Dex Used +" + OtherBonuses.ToString() + " Other Bonuses +" + acMods_Computed.Rage + " Rage +" + acMods_Computed.BloodRage + " Bloodrage"; if (OtherBonuses != 0) { formula += " Other Bonuses ="; if (acMods_Computed.Enhancement != 0) { formula += " +" + acMods_Computed.Enhancement.ToString() + " Enhancement"; } if (acMods_Computed.Deflection != 0) { formula += " +" + acMods_Computed.Deflection.ToString() + " Deflection"; } if (acMods_Computed.Natural != 0) { formula += " +" + acMods_Computed.Natural.ToString() + " Natural"; } if (acMods_Computed.Dodge != 0) { formula += " +" + acMods_Computed.Dodge.ToString() + " Dodge"; } if (acMods_Computed.Wis != 0) { formula += " +" + acMods_Computed.Wis.ToString() + " Wis"; } if (acMods_Computed.Defending != 0) { formula += " +" + acMods_Computed.Defending.ToString() + " defending"; } formula += CommonMethods.GetStringValue(SizeMod) + " SizeMod"; if (acMods_Computed.Monk != 0) { formula += " +" + acMods_Computed.Monk.ToString() + " Monk"; } if (duelist != 0) { formula += " +" + duelist.ToString() + " duelist"; } if (onGoingMods != 0) { formula += " +" + onGoingMods.ToString() + " onGoingMods"; } if (acMods_Computed.Insight != 0) { formula += " +" + acMods_Computed.Insight.ToString() + " Insight"; } } int CompAC = 10 + acMods_Computed.Armor + acMods_Computed.Shield + dexUsed + OtherBonuses + acMods_Computed.Rage + acMods_Computed.BloodRage; int CompTouchAC = 10 + dexUsed + SizeMod + acMods_Computed.Deflection + acMods_Computed.Defending + DodgeBonus + acMods_Computed.Rage + acMods_Computed.BloodRage + acMods_Computed.Wis + acMods_Computed.Monk + duelist + acMods_Computed.Insight; int CompFlatFoootedAC = CompAC - dexBonus + flatFootedMod - DodgeBonus - duelist; int AC_SB; int Touch_SB; int Flatfooted_SB; if (AC.Contains(CR)) //2nd AC block { int Pos5 = AC.IndexOf(CR); AC = AC.Substring(0, Pos5).Trim(); Pos5 = AC.IndexOf(PathfinderConstants.PAREN_RIGHT); AC = AC.Substring(Pos5 + 1).Trim(); } List <string> ACList_SB = AC.Split(',').ToList(); if (ACList_SB[0].Contains(PathfinderConstants.PAREN_LEFT)) { ACList_SB[0] = ACList_SB[0].Substring(0, ACList_SB[0].IndexOf(PathfinderConstants.PAREN_LEFT)).Trim(); } try { AC_SB = Convert.ToInt32(ACList_SB[0]); } catch (Exception ex) { _sbCheckerBaseInput.MessageXML.AddFail(CheckName, ex.Message); return; } string temp = ACList_SB[1].Replace("touch", string.Empty); try { Touch_SB = Convert.ToInt32(temp); } catch { _sbCheckerBaseInput.MessageXML.AddFail(CheckName, "Issue parsing touch AC"); return; } temp = ACList_SB[2].Replace("flat-footed", string.Empty); try { Flatfooted_SB = Convert.ToInt32(temp); } catch { _sbCheckerBaseInput.MessageXML.AddFail(CheckName, "Issue parsing flat-footed AC"); return; } if (CompAC == AC_SB && CompTouchAC == Touch_SB && CompFlatFoootedAC == Flatfooted_SB) { _sbCheckerBaseInput.MessageXML.AddPass(CheckName, formula); return; } if (CompAC != AC_SB) { _sbCheckerBaseInput.MessageXML.AddFail(CheckName, CompAC.ToString() + PathfinderConstants.SPACE + acMods_Computed.ToString(), AC_SB.ToString(), formula); } if (CompTouchAC != Touch_SB) { _sbCheckerBaseInput.MessageXML.AddFail(CheckName + " Touch ", PathfinderConstants.ASCII_10 + CompTouchAC.ToString() + PathfinderConstants.SPACE + acMods_Computed.ToString(), Touch_SB.ToString(), formula); } if (CompFlatFoootedAC != Flatfooted_SB) { _sbCheckerBaseInput.MessageXML.AddFail(CheckName + " Flat-Footed ", CompFlatFoootedAC.ToString() + PathfinderConstants.SPACE + acMods_Computed.ToString(), Flatfooted_SB.ToString(), formula); } _armorClassData.ACMods_Computed = acMods_Computed; }
public void ParseACMods() { Armor armor; Weapon weapon; double Bonus; StatBlockInfo.ACMods acMods_Computed = new StatBlockInfo.ACMods(); foreach (KeyValuePair <IEquipment, int> kvp in _equipmentData.Armor) { if (kvp.Key is Armor) { armor = (Armor)kvp.Key; if (armor.category == "shield") { if (armor.bonus.HasValue) { Bonus = Convert.ToInt32(armor.bonus); if (armor.Broken) { Bonus = Math.Floor(Bonus / 2); } acMods_Computed.Shield += Convert.ToInt32(Bonus) + armor.EnhancementBonus; } } if (armor.category.Contains("armor")) { if (armor.bonus.HasValue) { Bonus = Convert.ToInt32(armor.bonus); if (armor.Broken) { Bonus = Math.Floor(Bonus / 2); } acMods_Computed.Armor += Convert.ToInt32(Bonus) + armor.EnhancementBonus; } } } } foreach (KeyValuePair <IEquipment, int> kvp in _equipmentData.Weapons) { weapon = (Weapon)kvp.Key; if ((weapon.WeaponSpecialAbilities.WeaponSpecialAbilitiesValue & WeaponSpecialAbilitiesEnum.Defending) == WeaponSpecialAbilitiesEnum.Defending) { if (_sbCheckerBaseInput.MonsterSB.AC_Mods.Contains("defending")) { _acDefendingMod += weapon.EnhancementBonus; acMods_Computed.Defending += weapon.EnhancementBonus; } } } if (_sbCheckerBaseInput.MonsterSBSearch.HasArchetype("free hand fighter")) //Elusive { int FighterLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("fighter"); if (FighterLevel >= 3) { acMods_Computed.Dodge++; } if (FighterLevel >= 7) { acMods_Computed.Dodge++; } if (FighterLevel >= 11) { acMods_Computed.Dodge++; } if (FighterLevel >= 15) { acMods_Computed.Dodge++; } if (FighterLevel >= 19) { acMods_Computed.Dodge++; } } if (_sbCheckerBaseInput.CharacterClasses.HasClass("monk")) { acMods_Computed.Wis += _abilityScores.WisMod; int MonkLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("monk"); if (_sbCheckerBaseInput.MonsterSBSearch.HasGear("monk's robe")) { MonkLevel += 5; } acMods_Computed.Monk += MonkLevel / 4; } else if (_sbCheckerBaseInput.MonsterSBSearch.HasGear("monk's robe")) { acMods_Computed.Monk += 1; //level 5 monk, no wis mod } if (_sbCheckerBaseInput.CharacterClasses.HasClass("psychic") && _sbCheckerBaseInput.MonsterSB.PsychicDiscipline == "self-perfection") { acMods_Computed.Wis += _abilityScores.WisMod; } if (_sbCheckerBaseInput.CharacterClasses.HasClass("sorcerer")) { if (_sbCheckerBaseInput.MonsterSBSearch.HasBloodline("serpentine")) { int SorcererLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("sorcerer"); if (SorcererLevel >= 9) { acMods_Computed.Natural++; } if (SorcererLevel >= 13) { acMods_Computed.Natural++; } if (SorcererLevel >= 17) { acMods_Computed.Natural++; } } } if (_sbCheckerBaseInput.CharacterClasses.HasClass("animal companion")) { int animalCompanionLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("animal companion"); int animalCompanionMod = StatBlockInfo.AnimalCompanionNaturalArmorBonus(animalCompanionLevel); acMods_Computed.Natural += animalCompanionMod; } if (_sbCheckerBaseInput.MonsterSBSearch.HasBloodline("aquatic")) { int bloodlineLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("sorcerer"); if (bloodlineLevel >= 9) { acMods_Computed.Natural++; } } if (_sbCheckerBaseInput.CharacterClasses.HasClass("dragon disciple")) { int dragonDiscipleLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("dragon disciple"); if (dragonDiscipleLevel >= 1) { acMods_Computed.Natural++; } if (dragonDiscipleLevel >= 3) { acMods_Computed.Natural++; } if (dragonDiscipleLevel >= 7) { acMods_Computed.Natural++; } } if (_sbCheckerBaseInput.CharacterClasses.HasClass("bloatmage")) { int BloatMageLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("bloatmage"); if (BloatMageLevel >= 3) { acMods_Computed.Natural++; } if (BloatMageLevel >= 7) { acMods_Computed.Natural++; } } acMods_Computed.Dex = _armorClassData.MaxDexMod < _abilityScores.DexMod ? _armorClassData.MaxDexMod : _abilityScores.DexMod; if (_sbCheckerBaseInput.MonsterSB.DefensiveAbilities.Contains("incorporeal")) { int incorporealMod = _abilityScores.ChaMod <= 0 ? 1 : _abilityScores.ChaMod; acMods_Computed.Deflection += incorporealMod; } if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Snapping Turtle Style")) { acMods_Computed.Shield++; } if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Dodge")) { acMods_Computed.Dodge++; if (_sbCheckerBaseInput.MonsterSBSearch.HasMythicFeat("Dodge")) { acMods_Computed.Dodge++; } } if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Shield Focus")) { acMods_Computed.Shield++; } if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Greater Shield Focus")) { acMods_Computed.Shield++; } if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Two-Weapon Defense")) { acMods_Computed.Shield++; } if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Improved Natural Armor")) { acMods_Computed.Natural++; } //if (_sbCheckerBaseInput.MonsterSBSearch.HasFeat("Combat Expertise")) //{ // acMods_Computed.Dodge++; // acMods_Computed.Dodge += int.Parse(_sbCheckerBaseInput.MonsterSB.BaseAtk) / 4; //} if (_sbCheckerBaseInput.MonsterSB.Class.Contains("barbarian")) { acMods_Computed.Rage = -2; //ranged AC mod only //if (_sbCheckerBaseInput.MonsterSBSearch.HasSpecialAttackGeneral("rolling dodge")) //{ // int BarbarianLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("barbarian"); // if (BarbarianLevel >= 6) acMods_Computed.Dodge++; // if (BarbarianLevel >= 12) acMods_Computed.Dodge++; // if (BarbarianLevel >= 18) acMods_Computed.Dodge++; //} } if (_sbCheckerBaseInput.MonsterSB.Class.Contains("bloodrager")) { acMods_Computed.BloodRage = -2; } if (_sbCheckerBaseInput.MonsterSBSearch.HasClassArchetype("savage barbarian")) { int BarbarianLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("barbarian"); //Naked Courage (Ex) if (BarbarianLevel >= 3) { acMods_Computed.Natural++; } if (BarbarianLevel >= 9) { acMods_Computed.Natural++; } if (BarbarianLevel >= 15) { acMods_Computed.Natural++; } //Natural Toughness (Ex) if (BarbarianLevel >= 7) { acMods_Computed.Natural++; } if (BarbarianLevel >= 10) { acMods_Computed.Natural++; } if (BarbarianLevel >= 13) { acMods_Computed.Natural++; } if (BarbarianLevel >= 16) { acMods_Computed.Natural++; } if (BarbarianLevel >= 19) { acMods_Computed.Natural++; } } if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("mutagen")) { acMods_Computed.Natural += 2; if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("greater mutagen")) { acMods_Computed.Natural += 2; if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("grand mutagen")) { acMods_Computed.Natural += 2; } } } if (_sbCheckerBaseInput.MonsterSBSearch.HasSQ("otherworldly insight")) { acMods_Computed.Insight += 10; } if (_sbCheckerBaseInput.MonsterSBSearch.HasMystery("bones")) { int oracleLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("oracle"); acMods_Computed.Armor += 4; if (oracleLevel >= 7) { acMods_Computed.Armor += 2; } if (oracleLevel >= 11) { acMods_Computed.Armor += 2; } if (oracleLevel >= 15) { acMods_Computed.Armor += 2; } if (oracleLevel >= 19) { acMods_Computed.Armor += 2; } } if (_sbCheckerBaseInput.IndvSB != null) { acMods_Computed.Shield += _sbCheckerBaseInput.IndvSB.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.AC, OnGoingStatBlockModifier.StatBlockModifierSubTypes.AC_Shield); acMods_Computed.Armor += _sbCheckerBaseInput.IndvSB.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.AC, OnGoingStatBlockModifier.StatBlockModifierSubTypes.AC_Armor); acMods_Computed.Deflection += _sbCheckerBaseInput.IndvSB.GetOnGoingStatBlockModValueStackable(OnGoingStatBlockModifier.StatBlockModifierTypes.AC, OnGoingStatBlockModifier.StatBlockModifierSubTypes.AC_Deflection, true); acMods_Computed.Dodge += _sbCheckerBaseInput.IndvSB.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.AC, OnGoingStatBlockModifier.StatBlockModifierSubTypes.AC_Dodge); acMods_Computed.Natural += _sbCheckerBaseInput.IndvSB.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.AC, OnGoingStatBlockModifier.StatBlockModifierSubTypes.AC_Natural); acMods_Computed.Enhancement += _sbCheckerBaseInput.IndvSB.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.AC, OnGoingStatBlockModifier.StatBlockModifierSubTypes.AC_Enhancement); acMods_Computed.Insight += _sbCheckerBaseInput.IndvSB.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.AC, OnGoingStatBlockModifier.StatBlockModifierSubTypes.AC_Insight); } //if (_sbCheckerBaseInput.MonsterSB.DefensiveAbilities.Contains("uncanny dodge")) //{ // // acMods_Computed.Dodge++; //} if (_sbCheckerBaseInput.MonsterSBSearch.Race() == "kasatha") { acMods_Computed.Dodge += 2; } try { acMods_Computed.Natural += _sbCheckerBaseInput.Race_Base.RaceNaturalArmor(); } catch (Exception ex) { _sbCheckerBaseInput.MessageXML.AddFail("Race_Base.RaceNaturalArmor", ex.Message); } acMods_Computed.Size = _sizeMod; foreach (MagicItemAbilitiesWrapper wrapper in _equipmentData.MagicItemAbilities) { if (wrapper != null) { foreach (OnGoing.IOnGoing SBMods in wrapper.OnGoingStatBlockModifiers) { if (SBMods.OnGoingType == OnGoingType.StatBlock) { OnGoingStatBlockModifier Mod = (OnGoingStatBlockModifier)SBMods; if (Mod.ModType == OnGoingStatBlockModifier.StatBlockModifierTypes.AC) { acMods_Computed.AddModEffect(Mod); } } } } } _armorClassData.ACMods_Computed = acMods_Computed; }
private string ApplyMagicItem(IEquipment MagicItem) { StatBlockInfo.ACMods acMods_Computed = new StatBlockInfo.ACMods(); MagicItemStatBlock MI = (MagicItemStatBlock)MagicItem; try { MagicItemAbilitiesWrapper wrapper = MagicItemAbilityReflectionWrapper.GetMagicItemAbility(MI.name, MI.ExtraAbilities); _sbCheckerBaseInput.IndvSB.ApplyMagicItem(MagicItem); if (wrapper.EquimentBaseString.Length > 0) { Dictionary <IEquipment, int> tempArmor = Equipment_Parse.ParseArmorSimple(new List <string> { wrapper.EquimentBaseString }, _armorBusiness); if (tempArmor.Keys.First().EquipmentType == EquipmentType.Armor) { double Bonus = 0; Armor armor = (Armor)tempArmor.Keys.First(); if (armor.category == "shield") { if (armor.bonus.HasValue) { Bonus = Convert.ToInt32(armor.bonus); if (armor.Broken) { Bonus = Math.Floor(Bonus / 2); } acMods_Computed.Shield += Convert.ToInt32(Bonus) + armor.EnhancementBonus; } } if (armor.category.Contains("armor")) { if (armor.bonus.HasValue) { Bonus = Convert.ToInt32(armor.bonus); if (armor.Broken) { Bonus = Math.Floor(Bonus / 2); } acMods_Computed.Armor += Convert.ToInt32(Bonus) + armor.EnhancementBonus; } } } } _equipmentData.MagicItemAbilities.Add(wrapper); } catch (Exception ex) { _sbCheckerBaseInput.MessageXML.AddFail("SBChecker-ApplyMagicItem", ex.Message + "--- " + ex.InnerException); } _armorClassData.ACMods_Computed = acMods_Computed; return(MI.name + " abilities added."); }