private void HandleHdInfos(ref StatBlockInfo.HDBlockInfo tempHDInfo, ref int Count, ref bool Found, List <string> FoundClasses, List <ClassWrapper> tempCharacterClasses) { for (int a = 0; a < _hitDiceBlockInfo.Count; a++) { tempHDInfo = _hitDiceBlockInfo[a]; foreach (ClassWrapper wrapper in _sbCheckerBaseInput.CharacterClasses.Classes) { if (tempHDInfo.HDType == _sbCheckerBaseInput.CharacterClasses.GetClassHDType(wrapper.Name)) { if (wrapper.Name == "Eidolon") { tempHDInfo.Multiplier -= StatBlockInfo.ComputeEidolonHD(wrapper.Level); } else { tempHDInfo.Multiplier -= wrapper.Level; } Found = true; FoundClasses.Add(wrapper.Name); tempCharacterClasses.Remove(wrapper); } } if (Found) { Found = false; _hitDiceBlockInfo[Count] = tempHDInfo; } Count++; } }
public int HDValue() { StatBlockInfo.HDBlockInfo racialHDInfo = new StatBlockInfo.HDBlockInfo(); string hold = HD; hold = Utility.RemoveParentheses(hold); int Pos = hold.IndexOf(";"); int Pos2 = hold.IndexOf("HD"); if (Pos < Pos2) { Pos = hold.IndexOf(";", Pos2); } int value = 0; if (Pos >= 0 && hold.Contains("HD")) { hold = hold.Substring(0, Pos); hold = hold.Replace("HD", string.Empty).Trim(); return(Convert.ToInt32(hold)); } List <string> HDBlocks = hold.Split('+').ToList(); foreach (string block in HDBlocks) { if (block.Contains("d") && !block.Contains(";")) { racialHDInfo.ParseHDBlock(block); value += racialHDInfo.Multiplier; } } return(value); }
private void HandleHDBlocks(List <string> HDBlocks) { StatBlockInfo.HDBlockInfo tempHDInfo = new StatBlockInfo.HDBlockInfo(); foreach (string oneBlock in HDBlocks) { tempHDInfo.ParseHDBlock(oneBlock); bool HDTypeFound = false; StatBlockInfo.HDBlockInfo HoldHD2 = new StatBlockInfo.HDBlockInfo(); foreach (StatBlockInfo.HDBlockInfo tempBlock in _hitDiceBlockInfo) { if (tempBlock.HDType == tempHDInfo.HDType) //combine like HD types, i.e. 3d10+7d10 -> 10d10 { HoldHD2 = tempBlock; tempHDInfo.Multiplier += tempBlock.Multiplier; tempHDInfo.Modifier += tempBlock.Modifier; HDTypeFound = true; break; } } if (HDTypeFound) { _hitDiceBlockInfo.Remove(HoldHD2); } _hitDiceBlockInfo.Add(tempHDInfo); } }
public static void ChangeHD(MonsterStatBlock MonSB, StatBlockInfo.HitDiceCategories NewHDCategory) { if (!MonSB.DontUseRacialHD) { StatBlockInfo.HDBlockInfo tempHDInfo = new StatBlockInfo.HDBlockInfo(); tempHDInfo.ParseHDBlock(MonSB.HD); tempHDInfo.HDType = NewHDCategory; tempHDInfo.Modifier = 0; MonSB.HD = tempHDInfo.ToString(); } }
private static void ComputeRangeMod(Weapon weapon, AbilityScores.AbilityScores _abilityScores, MonSBSearch _monSBSearch, StatBlockMessageWrapper _messageXML, ref string formula, ref StatBlockInfo.HDBlockInfo damageComputed) { int rangedModUsed = _abilityScores.StrMod; string rangeModUsedString = " Str"; if (_monSBSearch.HasDefensiveAbility("incorporeal")) { rangedModUsed = 0; // _abilityScores.DexMod; rangeModUsedString = " Dex"; } if (weapon.name.Contains("composite") && weapon.CompositeBonus == 0) { _messageXML.AddFail("Composite Weapon", "Str Bonus Missing"); } if (!Utility.IsThrownWeapon(weapon.search_name.ToLower())) { if (!weapon.uses_ammunition || weapon.name == "Sling" || (weapon.name.Contains("composite") && weapon.CompositeBonus > 0)) { if (weapon.name.Contains("composite") && weapon.CompositeBonus > 0) { if (weapon.CompositeBonus >= rangedModUsed) { damageComputed.Modifier += Convert.ToInt32(rangedModUsed); formula += " +" + rangedModUsed.ToString() + " composite"; } else { damageComputed.Modifier += Convert.ToInt32(weapon.CompositeBonus); formula += " +" + weapon.CompositeBonus.ToString() + " composite"; } } else { if (!weapon.name.ToLower().Contains("cross")) { damageComputed.Modifier += Convert.ToInt32(rangedModUsed); formula += " +" + rangedModUsed.ToString() + rangeModUsedString; } } } } if (weapon.category == "Ranged Weapons" && !weapon.name.Contains("composite") && weapon.name.Contains("bow") && rangedModUsed < 0) { if (!weapon.name.ToLower().Contains("crossbow")) { damageComputed.Modifier += Convert.ToInt32(rangedModUsed); formula += " +" + rangedModUsed.ToString() + rangeModUsedString; } } }
public override MonsterStatBlock ApplyTemplate(MonsterStatBlock MonSB) { if (!MonSB.DontUseRacialHD) { TemplateCommon.ChangeHD(MonSB, StatBlockInfo.HitDiceCategories.d8); StatBlockInfo.HDBlockInfo tempHDInfo = new StatBlockInfo.HDBlockInfo(); tempHDInfo.ParseHDBlock(MonSB.HD); //tempHDInfo.HDType = StatBlockInfo.HitDiceCategories.d8; //keeps HD, change to d8 //tempHDInfo.Modifier = 0; //MonSB.HD = tempHDInfo.ToString(); CreatureTypeFoundation CreatureType = CreatureTypeDetailsWrapper.GetRaceDetailClass("undead"); int fort = StatBlockInfo.ParseSaveBonues(tempHDInfo.Multiplier, CreatureType.FortSaveType); CreatureTypeMaster CreatureTypeMaster = new CreatureTypeMaster(); CreatureTypeMaster.CreatureTypeInstance = CreatureType; fort += StatBlockInfo.GetAbilityModifier(MonSB.GetAbilityScoreValue(CreatureTypeMaster.CreatureTypeInstance.FortMod())); MonSB.Fort = fort.ToString(); int refValue = StatBlockInfo.ParseSaveBonues(tempHDInfo.Multiplier, CreatureType.RefSaveType); refValue += StatBlockInfo.GetAbilityModifier(MonSB.GetAbilityScoreValue(StatBlockInfo.DEX)); MonSB.Ref = refValue.ToString(); int will = StatBlockInfo.ParseSaveBonues(tempHDInfo.Multiplier, CreatureType.WillSaveType); will += StatBlockInfo.GetAbilityModifier(MonSB.GetAbilityScoreValue(StatBlockInfo.WIS)); MonSB.Will = will.ToString(); } MonSB.AC_Mods = StatBlockInfo.ChangeAC_Mod(MonSB.AC_Mods, "natural", 6, true); MonSB.Feats = StatBlockInfo.AddFeat(MonSB.Feats, "AlertnessB"); MonSB.Feats = StatBlockInfo.AddFeat(MonSB.Feats, "Combat ReflexesB"); MonSB.Feats = StatBlockInfo.AddFeat(MonSB.Feats, "DodgeB"); MonSB.Feats = StatBlockInfo.AddFeat(MonSB.Feats, "Improved InitiativeB"); MonSB.Feats = StatBlockInfo.AddFeat(MonSB.Feats, "Lightning ReflexesB"); MonSB.Feats = StatBlockInfo.AddFeat(MonSB.Feats, "ToughnessB"); MonSB.RacialMods = StatBlockInfo.AddRacialMod(MonSB.RacialMods, "+8 Bluff"); MonSB.RacialMods = StatBlockInfo.AddRacialMod(MonSB.RacialMods, "+8 Perception"); MonSB.RacialMods = StatBlockInfo.AddRacialMod(MonSB.RacialMods, "+8 Sense Motive"); MonSB.RacialMods = StatBlockInfo.AddRacialMod(MonSB.RacialMods, "+8 Stealth"); TemplateCommon.AddDR(MonSB, "magic and silver", 10); TemplateCommon.AddResistance(MonSB, "cold ", 10); TemplateCommon.AddResistance(MonSB, "electricity ", 10); return(MonSB); }
private StatBlockInfo.HDBlockInfo HandleMythic(StatBlockInfo.HDBlockInfo tempHDInfo, List <string> FoundClasses, List <ClassWrapper> tempCharacterClasses) { if (_sbCheckerBaseInput.MonsterSBSearch.IsMythic && tempCharacterClasses.Any()) { tempHDInfo = new StatBlockInfo.HDBlockInfo(); tempHDInfo.HDType = StatBlockInfo.HitDiceCategories.None; for (int a = 0; a < _sbCheckerBaseInput.CharacterClasses.Classes.Count; a++) { ClassWrapper wrapper = _sbCheckerBaseInput.CharacterClasses.Classes[a]; if (tempHDInfo.HDType == _sbCheckerBaseInput.CharacterClasses.GetClassHDType(wrapper.Name)) { FoundClasses.Add(wrapper.Name); tempCharacterClasses.Remove(wrapper); } } } return(tempHDInfo); }
public int RaceWill() { switch (BaseRaceType) { case RaceType.Race: return(0); case RaceType.StatBlock: case RaceType.BestiaryStatBlock: // if (IsHumanoid) return 0; // determined by class if (!UseRacialHD) { return(0); // determined by class } if (_useTemplateValues) { int modWill = StatBlockInfo.GetAbilityModifier(GetAbilityScore(StatBlockInfo.WIS)); return(Convert.ToInt32(Race_SB.Will) - modWill); } else { if (WillOverride == StatBlockInfo.SaveBonusType.None) { StatBlockInfo.HDBlockInfo racialHDInfo = new StatBlockInfo.HDBlockInfo(); racialHDInfo.ParseHDBlock(RacialHD()); return(CreatureTypeMaster.GetWillSaveValue(racialHDInfo.Multiplier)); } else { return(StatBlockInfo.ParseSaveBonues(RacialHDValue(), WillOverride)); } } case RaceType.None: return(0); } return(-1); }
public override MonsterStatBlock ApplyTemplate(MonsterStatBlock MonSB) { TemplateCommon.ChangeHD(MonSB, StatBlockInfo.HitDiceCategories.d8); StatBlockInfo.HDBlockInfo tempHDInfo = new StatBlockInfo.HDBlockInfo(); tempHDInfo.ParseHDBlock(MonSB.HD); double HD = Convert.ToInt32(tempHDInfo.Multiplier); double temp = HD / 3; MonSB.BaseAtk = "+" + Math.Floor(temp).ToString(); temp = HD / 3; //Fort MonSB.Fort = "+" + Math.Floor(temp).ToString(); temp = HD / 3; ///Ref MonSB.Ref = "+" + Math.Floor(temp).ToString(); temp = HD / 2; ///Will MonSB.Will = "+" + (Math.Floor(temp) + 2).ToString(); TemplateCommon.AddResistance(MonSB, "slashing ", 5); return(MonSB); }
public override MonsterStatBlock ApplyTemplate(MonsterStatBlock MonSB) { StatBlockInfo.HDBlockInfo tempHDInfo = new StatBlockInfo.HDBlockInfo(); tempHDInfo.ParseHDBlock(MonSB.HD); tempHDInfo.HDType = StatBlockInfo.HitDiceCategories.d8; //keeps HD, change to d8 tempHDInfo.Modifier = 0; MonSB.HD = tempHDInfo.ToString(); double HD = Convert.ToInt32(tempHDInfo.Multiplier); double temp = (HD * 3) / 4; MonSB.BaseAtk = "+" + Math.Floor(temp).ToString(); temp = HD / 3; //Fort MonSB.Fort = "+" + Math.Floor(temp).ToString(); temp = HD / 3; ///Ref MonSB.Ref = "+" + Math.Floor(temp).ToString(); temp = HD / 2; ///Will MonSB.Will = "+" + (Math.Floor(temp) + 2).ToString(); switch (StatBlockInfo.GetSizeEnum(MonSB.Size)) { case StatBlockInfo.SizeCategories.Tiny: temp = 0; break; case StatBlockInfo.SizeCategories.Small: temp = 1; break; case StatBlockInfo.SizeCategories.Medium: case StatBlockInfo.SizeCategories.Large: temp = 2; break; case StatBlockInfo.SizeCategories.Huge: temp = 3; break; case StatBlockInfo.SizeCategories.Gargantuan: temp = 6; break; case StatBlockInfo.SizeCategories.Colossal: temp = 10; break; default: temp = 0; break; } MonSB.AC_Mods = StatBlockInfo.ChangeAC_Mod(MonSB.AC_Mods, "natural", Convert.ToInt32(temp), false); TemplateCommon.AddDR(MonSB, "bludgeoning", 5); return(MonSB); }
public static MonsterStatBlock AppyBaseZombieTemplate(MonsterStatBlock MonSB) { StatBlockInfo.HDBlockInfo tempHDInfo = new StatBlockInfo.HDBlockInfo(); tempHDInfo.ParseHDBlock(MonSB.HD); tempHDInfo.HDType = StatBlockInfo.HitDiceCategories.d8; //keeps HD, change to d8 tempHDInfo.Modifier = 0; MonSB.HD = tempHDInfo.ToString(); double HD = Convert.ToInt32(tempHDInfo.Multiplier); double temp = (HD * 3) / 4; MonSB.BaseAtk = "+" + Math.Floor(temp).ToString(); temp = HD / 3; //Fort MonSB.Fort = "+" + Math.Floor(temp).ToString(); temp = HD / 3; ///Ref MonSB.Ref = "+" + Math.Floor(temp).ToString(); temp = HD / 2; ///Will MonSB.Will = "+" + (Math.Floor(temp) + 2).ToString(); switch (StatBlockInfo.GetSizeEnum(MonSB.Size)) { case StatBlockInfo.SizeCategories.Tiny: temp = 0; break; case StatBlockInfo.SizeCategories.Small: temp = 1; break; case StatBlockInfo.SizeCategories.Medium: temp = 2; break; case StatBlockInfo.SizeCategories.Large: temp = 3; break; case StatBlockInfo.SizeCategories.Huge: temp = 4; break; case StatBlockInfo.SizeCategories.Gargantuan: temp = 7; break; case StatBlockInfo.SizeCategories.Colossal: temp = 11; break; default: temp = 0; break; } TemplateCommon.ChangeHD(MonSB, StatBlockInfo.HitDiceCategories.d8); TemplateCommon.AddDR(MonSB, "slashing", 5); MonSB.AC_Mods = StatBlockInfo.ChangeAC_Mod(MonSB.AC_Mods, "natural", Convert.ToInt32(temp), false); MonSB.Skills = string.Empty; MonSB.Feats = "ToughnessB"; return(MonSB); }
public void ParseEquipment(IMonSBSearch _monSBSearch) { string gear = _sbCheckerBaseInput.MonsterSB.Gear.Replace("*", string.Empty).Trim(); string otherGear = _sbCheckerBaseInput.MonsterSB.OtherGear.Replace("*", string.Empty).Trim(); Utility.ParenCommaFix(ref otherGear); Utility.ParenCommaFix(ref gear); if (gear.Contains("CL ")) { // HandleCLCommas(ref gear); } List <string> gearHold = gear.Split(',').ToList(); if (otherGear != null) { gearHold.AddRange(otherGear.Split(',').ToList()); } if (_sbCheckerBaseInput.MonsterSB.Environment.Length > 0) { if (_sbCheckerBaseInput.MonsterSB.Treasure.Contains("NPC Gear")) { gear = _sbCheckerBaseInput.MonsterSB.Treasure; int Pos = gear.IndexOf(PathfinderConstants.PAREN_LEFT); if (Pos != -1) { gear = gear.Replace(gear.Substring(0, Pos - 1), string.Empty); Pos = gear.IndexOf(PathfinderConstants.PAREN_RIGHT); gear = gear.Substring(0, Pos); gear = gear.Replace(PathfinderConstants.PAREN_LEFT, string.Empty); gearHold.AddRange(gear.Split(',').ToList()); } } if (_sbCheckerBaseInput.MonsterSB.Treasure.Contains("standard (")) { gear = _sbCheckerBaseInput.MonsterSB.Treasure; int Pos = gear.IndexOf(PathfinderConstants.PAREN_LEFT); gear = gear.Replace(gear.Substring(0, Pos - 1), string.Empty); Pos = gear.IndexOf(PathfinderConstants.PAREN_RIGHT); gear = gear.Substring(0, Pos); gear = gear.Replace(PathfinderConstants.PAREN_LEFT, string.Empty); gearHold.AddRange(gear.Split(',').ToList()); } else if (_sbCheckerBaseInput.MonsterSB.Treasure.Contains(" (")) { gear = _sbCheckerBaseInput.MonsterSB.Treasure; int Pos = gear.IndexOf(PathfinderConstants.PAREN_LEFT); gear = gear.Replace(gear.Substring(0, Pos - 1), string.Empty); Pos = gear.IndexOf(PathfinderConstants.PAREN_RIGHT); gear = gear.Substring(0, Pos); gear = gear.Replace(PathfinderConstants.PAREN_LEFT, string.Empty); gearHold.AddRange(gear.Split(',').ToList()); } } gearHold.ForEach(x => x = x.Trim()); gearHold.RemoveAll(x => x == string.Empty); foreach (string super in _sbCheckerBaseInput.SourceSuperScripts) { for (int a = 0; a < gearHold.Count; a++) { gearHold[a] = gearHold[a].Replace(super, string.Empty); } } try { _equipmentData.Weapons = Equipment_Parse.ParseWeaponsSimple(gearHold, _weaponBusiness, _magicItemStatBlockBusiness); } catch (Exception ex) { _sbCheckerBaseInput.MessageXML.AddFail("ParseEquipment", ex.Message); } Weapon weapon = Equipment_Parse.GetUnarmedStrikeWeapon(_weaponBusiness); //everyone can do unarmed strike if (_sbCheckerBaseInput.MonsterSB.Melee.Contains("incorporeal touch")) { IncorporealTouch incorporealTouch = Equipment_Parse.GetIncorporealTouchWeapon(); int posIncorporealTouchStart = _sbCheckerBaseInput.MonsterSB.Melee.IndexOf("incorporeal touch"); int posIncorporealTouchStop = _sbCheckerBaseInput.MonsterSB.Melee.IndexOf(PathfinderConstants.PAREN_RIGHT, posIncorporealTouchStart); string incorporealTouchString = _sbCheckerBaseInput.MonsterSB.Melee.Substring(posIncorporealTouchStart, posIncorporealTouchStop - posIncorporealTouchStart); incorporealTouch.DameageStrings = incorporealTouchString.Split(new string[] { " plus " }, StringSplitOptions.RemoveEmptyEntries).ToList(); _equipmentData.Weapons.Add(incorporealTouch, 1); } if (_sbCheckerBaseInput.MonsterSB.Class.Contains("monk") || _sbCheckerBaseInput.MonsterSB.Class.Contains("brawler")) { int naturalWeaponMod = 0; string naturalWeaponString; if (_monSBSearch.HasGear("amulet of mighty fists")) { naturalWeaponString = _monSBSearch.GetGearString("amulet of mighty fists"); if (naturalWeaponString.Contains("+")) { List <string> specialAbilities = CommonMethods.GetAmuletOfMightFistsSpecialAbilities(); foreach (string ability in specialAbilities) { if (naturalWeaponString.Contains(ability)) { naturalWeaponString = naturalWeaponString.Replace(ability, string.Empty); } } int Pos = naturalWeaponString.IndexOf("+"); naturalWeaponMod = int.Parse(naturalWeaponString.Substring(Pos + 1)); } } Weapon weapon2 = Equipment_Parse.GetUnarmedStrikeWeapon(_weaponBusiness); StatBlockInfo.HDBlockInfo MonkUAD = FindSpecialClassUnarmedDamage(_sizeData.SizeCat); weapon2.damage_medium = MonkUAD.ToString(); weapon2.damage_small = MonkUAD.ToString(); weapon2.WeaponSize = _sizeData.SizeCat; naturalWeaponString = "flurry of blows"; if (naturalWeaponMod > 0) { naturalWeaponString = "+" + naturalWeaponMod.ToString() + PathfinderConstants.SPACE + naturalWeaponString; weapon2.EnhancementBonus = naturalWeaponMod; weapon2.Masterwork = true; } weapon2.name = naturalWeaponString; weapon2.search_name = "flurry of blows"; _equipmentData.Weapons.Add(weapon2, 1); int monkLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("Monk"); if (monkLevel == 0) { monkLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("brawler"); } if (_monSBSearch.HasGear("monk's robe")) { monkLevel += 5; } StatBlockInfo.HDBlockInfo MonkUAD2 = StatBlockInfo.GetSpecialClassUnarmedDamage(monkLevel, _sizeData.SizeCat); naturalWeaponString = "unarmed strike"; if (naturalWeaponMod > 0) { naturalWeaponString = "+" + naturalWeaponMod.ToString() + PathfinderConstants.SPACE + naturalWeaponString; weapon.EnhancementBonus = naturalWeaponMod; weapon.Masterwork = true; } weapon.name = naturalWeaponString; weapon.search_name = "unarmed strike"; StatBlockInfo.HDBlockInfo tempUAD = StatBlockInfo.GetSpecialClassUnarmedDamage(monkLevel, StatBlockInfo.SizeCategories.Medium); weapon.damage_medium = tempUAD.ToString(); tempUAD = StatBlockInfo.GetSpecialClassUnarmedDamage(monkLevel, StatBlockInfo.SizeCategories.Small); weapon.damage_small = tempUAD.ToString(); weapon.WeaponSize = _sizeData.SizeCat; } _equipmentData.Weapons.Add(weapon, 1); if (_sbCheckerBaseInput.MonsterSB.Class.Contains("barbarian")) { if (_sbCheckerBaseInput.MonsterSB.Melee.Contains("bite")) { _equipmentData.Weapons.Add(Equipment_Parse.GetBarbarianBite(), 1); } } if (_sbCheckerBaseInput.MonsterSB.Class.Contains("alchemist")) { if (_sbCheckerBaseInput.MonsterSB.Ranged.Contains("bomb")) { _equipmentData.Weapons.Add(Equipment_Parse.GetBomb(), 1); } } if (_sbCheckerBaseInput.MonsterSB.SpecialAttacks.Contains("rock throwing")) { _equipmentData.Weapons.Add(Equipment_Parse.AddRockAsWeapon(), 1); } _equipmentData.Armor = Equipment_Parse.ParseArmorSimple(gearHold, _armorBusiness); _monSBSearch.Armor = _equipmentData.Armor; StatBlockInfo.ArmorProficiencies tempArmorPro = _sbCheckerBaseInput.CharacterClasses.GetAllKnownArmorProficiencies(); StatBlockInfo.ShieldProficiencies tempShieldPro = _sbCheckerBaseInput.CharacterClasses.GetAllKnownShieldProficiencies(); if (_monSBSearch.HasFeat("Light _equipmentData.Armor Proficiency")) { tempArmorPro |= StatBlockInfo.ArmorProficiencies.Light; } if (_monSBSearch.HasFeat("Medium _equipmentData.Armor Proficiency")) { tempArmorPro |= StatBlockInfo.ArmorProficiencies.Medium; } if (_monSBSearch.HasFeat("Heavy _equipmentData.Armor Proficiency")) { tempArmorPro |= StatBlockInfo.ArmorProficiencies.Heavy; } if (_monSBSearch.HasFeat("Shield Proficiency")) { tempShieldPro |= StatBlockInfo.ShieldProficiencies.Shield; } if (_monSBSearch.HasFeat("Tower Shield Proficiency")) { tempShieldPro |= StatBlockInfo.ShieldProficiencies.Tower; } Armor armor; foreach (KeyValuePair <IEquipment, int> kvp in _equipmentData.Armor) { if (kvp.Key is Armor) { armor = (Armor)kvp.Key; if (armor.category == "shield") { StatBlockInfo.ShieldProficiencies shieldCategory = armor.GetShieldCategory(); if ((!tempShieldPro.HasFlag(shieldCategory) && (_sbCheckerBaseInput.MonsterSB.DontUseRacialHD || (_sbCheckerBaseInput.Race_Base != null && _sbCheckerBaseInput.Race_Base.RaceBaseType == RaceBase.RaceType.Race)))) { if (tempShieldPro.HasFlag(StatBlockInfo.ShieldProficiencies.Extra)) { List <string> extraShield = _sbCheckerBaseInput.CharacterClasses.GetAllShieldProficienciesExtra(); if (!extraShield.Contains(armor.name)) { _sbCheckerBaseInput.MessageXML.AddFail("Missing Shield Proficiency", armor.name + " needs " + shieldCategory.ToString()); } } else { _sbCheckerBaseInput.MessageXML.AddFail("Missing Shield Proficiency", armor.name + " needs " + shieldCategory.ToString()); } } } if (armor.category.Contains("armor")) { StatBlockInfo.ArmorProficiencies armorCategory = armor.GetArmorCategory(); if ((tempArmorPro & armorCategory) != armorCategory && (_sbCheckerBaseInput.MonsterSB.DontUseRacialHD || (_sbCheckerBaseInput.Race_Base != null && _sbCheckerBaseInput.Race_Base.RaceBaseType == RaceBase.RaceType.Race))) { _sbCheckerBaseInput.MessageXML.AddFail("Missing _equipmentData.Armor Proficiency", armor.name + " needs " + armorCategory.ToString()); } } } else if (kvp.Key is Weapon) //shield as weapon { _equipmentData.Weapons.Add(kvp.Key, kvp.Value); } } _equipmentData.EquipementRoster = Equipment_Parse.ParseMagicItems(gearHold, _equipmentData.EquipementRoster, _magicItemStatBlockBusiness, _weaponBusiness, _armorBusiness, _equipmentGoodsBusiness); foreach (KeyValuePair <IEquipment, int> kvp in _equipmentData.EquipementRoster) { IEquipment hold = kvp.Key; if (hold.EquipmentType == EquipmentType.MagicItem) { ApplyMagicItem(hold); } } foreach (string missing in gearHold) { _sbCheckerBaseInput.MessageXML.AddInfo("Missing Gear Info: " + missing); } }
public IHitDiceCheckerOutput CheckHDValue() { HitDiceCheckerOutput output = new HitDiceCheckerOutput(); try { string CheckName = "HD"; string holdHD = _sbCheckerBaseInput.MonsterSB.HD; holdHD = holdHD.Replace(PathfinderConstants.PAREN_LEFT, string.Empty).Replace(PathfinderConstants.PAREN_RIGHT, string.Empty).Replace(" plus ", "+"); int Pos = holdHD.IndexOf("temporary"); if (Pos != -1) { Pos = holdHD.LastIndexOf("+", Pos); holdHD = holdHD.Substring(0, Pos).Trim(); } Pos = holdHD.LastIndexOf("+"); int Pos2 = holdHD.LastIndexOf("d"); output.HDModifier = _sbCheckerBaseInput.MonsterSB.HDMod(); string racialHD = _sbCheckerBaseInput.CharacterClasses.HasClass("animal companion") || _sbCheckerBaseInput.CharacterClasses.HasClass("eidolon") ? string.Empty : _sbCheckerBaseInput.Race_Base.RacialHD(); racialHD = HandleAnimatedObject(racialHD); if (Pos >= 0 && Pos2 < Pos) { //string temp = holdHD.Substring(Pos); // _hdModifier = Convert.ToInt32(temp); // holdHD = holdHD.Replace(temp, string.Empty).Trim(); holdHD = holdHD.Substring(0, Pos); } List <string> hitDiceBlocks = FindHDBlocks(holdHD); StatBlockInfo.HDBlockInfo racialHDInfo = new StatBlockInfo.HDBlockInfo(); int Count = 0; bool Found = false; bool Pass = true; HandleHDBlocks(hitDiceBlocks); if (racialHD.Length > 0) { racialHDInfo.ParseHDBlock(racialHD); } output.TotalHd = 0; foreach (StatBlockInfo.HDBlockInfo tempBlock in _hitDiceBlockInfo) { output.TotalHd += tempBlock.Multiplier; if (racialHD.Length > 0 && tempBlock.HDType != racialHDInfo.HDType && tempBlock.Multiplier != racialHDInfo.Multiplier) { output.TotalHdNonRacial += tempBlock.Multiplier; } } List <string> foundClassesList = new List <string>(); StatBlockInfo.HDBlockInfo tempHDInfo = new StatBlockInfo.HDBlockInfo(); List <ClassWrapper> tempCharacterClasses = new List <ClassWrapper>(_sbCheckerBaseInput.CharacterClasses.Classes); HandleHdInfos(ref tempHDInfo, ref Count, ref Found, foundClassesList, tempCharacterClasses); tempHDInfo = HandleMythic(tempHDInfo, foundClassesList, tempCharacterClasses); int hdMultiplier = 0; if (racialHD.Length > 0) { foreach (StatBlockInfo.HDBlockInfo tempBlock in _hitDiceBlockInfo) { hdMultiplier = tempBlock.Multiplier; if (racialHDInfo.HDType == tempBlock.HDType) { hdMultiplier -= racialHDInfo.Multiplier; } if (hdMultiplier != 0) { _sbCheckerBaseInput.MessageXML.AddFail(CheckName, "Wrong HD for " + tempBlock.HDType.ToString()); Pass = false; } } } if (foundClassesList.Count != _sbCheckerBaseInput.CharacterClasses.Classes.Count) { string hold = string.Empty; foreach (ClassWrapper wrapper in tempCharacterClasses) { hold += wrapper.Name + ","; } hold = hold.Substring(0, hold.Length - 1); _sbCheckerBaseInput.MessageXML.AddFail(CheckName, "Missing HD for Classes " + hold); Pass = false; } if (Pass) { _sbCheckerBaseInput.MessageXML.AddPass(CheckName); } } catch (Exception ex) { _sbCheckerBaseInput.MessageXML.AddFail("CheckHDValue", ex.Message); } return(output); }
public void CheckRangedWeaponDamage(Weapon weapon, string weaponsDamage, string size, AbilityScores.AbilityScores _abilityScores, MonSBSearch _monSBSearch, StatBlockMessageWrapper _messageXML, bool MagicWeapon, bool GreaterMagicWeapon, IndividualStatBlock_Combat _indvSB) { string formula = string.Empty; StatBlockInfo.SizeCategories MonSize = StatBlockInfo.GetSizeEnum(size); if (_monSBSearch.HasSQ("undersized weapons")) { MonSize = StatBlockInfo.ReduceSize(MonSize); } StatBlockInfo.HDBlockInfo damageComputed = new StatBlockInfo.HDBlockInfo(); if (weapon.name == "Sling" && _monSBSearch.HasGear("stones")) { damageComputed.ParseHDBlock(weapon.damage_small); } else if (MonSize == StatBlockInfo.SizeCategories.Medium) { damageComputed.ParseHDBlock(weapon.damage_medium); } else if (MonSize == StatBlockInfo.SizeCategories.Small) { damageComputed.ParseHDBlock(weapon.damage_small); } else { damageComputed.ParseHDBlock(StatBlockInfo.ChangeWeaponDamageSize(weapon.damage_medium, MonSize)); } if (!weaponsDamage.Contains("entangle")) { ComputeRangeMod(weapon, _abilityScores, _monSBSearch, _messageXML, ref formula, ref damageComputed); } if (_monSBSearch.HasSpecialAttackGeneral("weapon training")) { damageComputed.Modifier += _monSBSearch.GetWeaponsTrainingModifier(weapon.search_name, ref formula); } if (_monSBSearch.HasClassArchetype("crossbowman")) { int fighterLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("fighter"); if (fighterLevel >= 3) { int dexBonus = _abilityScores.DexMod / 2; if (dexBonus <= 0) { dexBonus = 1; } damageComputed.Modifier += dexBonus; formula += " +" + dexBonus.ToString() + " crossbowman deadshot"; } if (fighterLevel >= 5) { int tempBonus = 1; if (fighterLevel >= 9) { tempBonus++; } if (fighterLevel >= 13) { tempBonus++; } if (fighterLevel >= 17) { tempBonus++; } damageComputed.Modifier += tempBonus; formula += " +" + tempBonus.ToString() + " crossbowman crossbow expert"; } } if (_monSBSearch.HasClassArchetype("archer")) { int fighterLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("fighter"); if (fighterLevel >= 5) { int tempBonus = 1; if (fighterLevel >= 9) { tempBonus++; } if (fighterLevel >= 13) { tempBonus++; } if (fighterLevel >= 17) { tempBonus++; } damageComputed.Modifier += tempBonus; formula += " +" + tempBonus.ToString() + " Expert Archer"; } } string hold = weapon.NamedWeapon ? weapon.BaseWeaponName.ToLower() : weapon.search_name.ToLower(); if (_monSBSearch.HasFeat("Weapon Specialization (" + hold + PathfinderConstants.PAREN_RIGHT)) { formula += " +2 Weapon Specialization"; damageComputed.Modifier += 2; } if (_monSBSearch.HasFeat("Greater Weapon Specialization (" + hold + PathfinderConstants.PAREN_RIGHT)) { formula += " +2 Greater Weapon Specialization"; damageComputed.Modifier += 2; } if (weapon.WeaponSpecialMaterial == WeaponSpecialMaterials.AlchemicalSilver && (weapon.slashing || weapon.piercing)) { damageComputed.Modifier--; formula += " -1 Alchemical Silver"; } if (weapon.EnhancementBonus > 0) { damageComputed.Modifier += weapon.EnhancementBonus; formula += " +" + weapon.EnhancementBonus.ToString() + " Enhancement Bonus"; } if (_abilityScores.StrMod != 0 && Utility.IsThrownWeapon(weapon.search_name.ToLower())) { int MeleeModUsed = _abilityScores.StrMod; if (_monSBSearch.HasDefensiveAbility("incorporeal")) { MeleeModUsed = _abilityScores.DexMod; } formula += " +" + MeleeModUsed.ToString() + " Str Bonus Used- Thrown"; damageComputed.Modifier += Convert.ToInt32(MeleeModUsed); } if (weapon.name.Contains("bow") && !weapon.name.ToLower().Contains("composite") && !weapon.name.ToLower().Contains("cross") && _abilityScores.StrMod < 0) { damageComputed.Modifier += _abilityScores.StrMod; } bool ignoreEnhancement = false; WeaponCommon weaponCommon = new WeaponCommon(_sbCheckerBaseInput, _equipmentData, _naturalWeaponBusiness); weaponCommon.GetOnGoingDamageMods(MagicWeapon, GreaterMagicWeapon, _indvSB, ref formula, ref damageComputed, ref ignoreEnhancement); weaponsDamage = weaponsDamage.Replace(PathfinderConstants.PAREN_LEFT, string.Empty).Replace(PathfinderConstants.PAREN_RIGHT, string.Empty) .Replace("nonlethal", string.Empty); int Pos = weaponsDamage.IndexOf("/"); string weaponCrit; if (Pos >= 0) { weaponCrit = weaponsDamage.Substring(Pos + 1); weaponsDamage = weaponsDamage.Substring(0, Pos); } StatBlockInfo.HDBlockInfo damageSB = new StatBlockInfo.HDBlockInfo(); damageSB.ParseHDBlock(weaponsDamage.Trim()); if (weapon.name == "rock" && _monSBSearch.HasSpecialAttackGeneral("rock throwing")) { if (damageComputed.Modifier != (_abilityScores.StrMod * 1.5)) { _messageXML.AddFail("Ranged Attack Damage- Rock ", (_abilityScores.StrMod * 1.5).ToString(), damageComputed.Modifier.ToString()); } } if (weapon.name == "bomb" && _sbCheckerBaseInput.CharacterClasses.HasClass("alchemist")) { damageComputed = new StatBlockInfo.HDBlockInfo(); damageComputed.HDType = StatBlockInfo.HitDiceCategories.d6; int alchemistLevel = _sbCheckerBaseInput.CharacterClasses.FindClassLevel("alchemist"); damageComputed.Multiplier = ((alchemistLevel - 1) / 2) + 1; damageComputed.Modifier = _abilityScores.IntMod; formula = "+" + _abilityScores.IntMod.ToString() + " Int mod"; } if (damageSB.Equals(damageComputed)) { _messageXML.AddPass("Ranged Attack Damage " + weapon.Weapon_FullName(), formula); } else { _messageXML.AddFail("Ranged Attack Damage " + weapon.Weapon_FullName(), damageComputed.ToString(), damageSB.ToString(), formula); } //string tempWeaponCrit = weapon.critical.Replace("/×2", string.Empty); //tempWeaponCrit = tempWeaponCrit.Replace((char)(8211), Char.Parse("-")); //if (tempWeaponCrit == weaponCrit) //{ // _messageXML.AddPass("Ranged Attack Critical- " + weapon.Weapon_FullName()); //} //else //{ // _messageXML.AddFail("Ranged Attack Critical- " + weapon.Weapon_FullName(), weapon.critical, weaponCrit); //} }
public void GetOnGoingDamageMods(bool MagicWeapon, bool GreaterMagicWeapon, IndividualStatBlock_Combat IndvSB, ref string formula, ref StatBlockInfo.HDBlockInfo damageComputed, ref bool ignoreEnhancement) { List <OnGoingStatBlockModifier> Mods = _sbCheckerBaseInput.IndvSB.GetOnGoingStatBlockMods(); foreach (OnGoingStatBlockModifier mod in Mods) { if (mod.ModType == OnGoingStatBlockModifier.StatBlockModifierTypes.Damage && mod.SubType == OnGoingStatBlockModifier.StatBlockModifierSubTypes.None) { bool ignore = false; if (mod.Name.Contains(GREATER_MAGIC_WEAPON) && GreaterMagicWeapon) { ignoreEnhancement = true; } if (mod.Name.Contains(MAGIC_WEAPON) && MagicWeapon && !mod.Name.Contains(GREATER_MAGIC_WEAPON)) { ignoreEnhancement = true; } if (mod.Name.Contains(GREATER_MAGIC_WEAPON) && !GreaterMagicWeapon) { ignore = true; } else if (mod.Name.Contains(MAGIC_WEAPON) && !MagicWeapon && !mod.Name.Contains(GREATER_MAGIC_WEAPON)) { ignore = true; } if (!ignore) { damageComputed.Modifier += mod.Modifier; formula += " +" + mod.Modifier.ToString() + PathfinderConstants.SPACE + mod.Name; } } } }
public int RacialHDValue() { StatBlockInfo.HDBlockInfo racialHDInfo = new StatBlockInfo.HDBlockInfo(); racialHDInfo.ParseHDBlock(RacialHD()); return(racialHDInfo.Multiplier); }
public void CheckMeleeWeaponDamage(Weapon weapon, string weaponsDamage, bool TwoWeaponFighting, bool BiteAttack, int weaponCount, int weaponIndex, string Size, AbilityScores.AbilityScores _abilityScores, MonSBSearch _monSBSearch, StatBlockMessageWrapper _messageXML, int FighterLevel, int ACDefendingMod, bool MagicWeapon, bool GreaterMagicWeapon, IndividualStatBlock_Combat _indvSB) { string formula = string.Empty; bool hasSizeDifference = false; StatBlockInfo.SizeCategories MonSize = StatBlockInfo.GetSizeEnum(Size); StatBlockInfo.SizeCategories WeaponSize = weapon.WeaponSize; if (MonSize != WeaponSize) { hasSizeDifference = true; } if (_monSBSearch.HasSQ("undersized weapons")) { MonSize = StatBlockInfo.ReduceSize(MonSize); } StatBlockInfo.HDBlockInfo damageComputed = new StatBlockInfo.HDBlockInfo(); ShieldSpecialAbilitiesEnum shieldSA = weapon.ShieldSpecialAbilities.ShieldSpecialAbilityValues; bool ShieldBashBoost = false; if ((shieldSA & ShieldSpecialAbilitiesEnum.Bashing) == ShieldSpecialAbilitiesEnum.Bashing) { ShieldBashBoost = true; MonSize = StatBlockInfo.IncreaseSize(MonSize); MonSize = StatBlockInfo.IncreaseSize(MonSize); } bool HasNewWeaponDamge = false; Weapon weaponDamage = null; if (weapon.search_name.ToLower() == "halfling sling staff") { weaponDamage = _weaponBusiness.GetWeaponByName("club"); HasNewWeaponDamge = true; } weaponsDamage = weaponsDamage.Replace(PathfinderConstants.PAREN_LEFT, string.Empty).Replace(PathfinderConstants.PAREN_RIGHT, string.Empty) .Replace("nonlethal", string.Empty); int Pos = weaponsDamage.IndexOf("/"); string weaponCrit; if (Pos >= 0) { weaponCrit = weaponsDamage.Substring(Pos + 1); weaponsDamage = weaponsDamage.Substring(0, Pos); } StatBlockInfo.HDBlockInfo damageSB = new StatBlockInfo.HDBlockInfo(); if (weaponsDamage.Contains("|")) { Pos = weaponsDamage.IndexOf("|"); weaponsDamage = weaponsDamage.Substring(0, Pos); } damageSB.ParseHDBlock(weaponsDamage.Trim()); if (weapon.@double) { //for double weapons assume the damage in the string is one of the ends if (weapon.damage_medium.Contains(damageSB.HDType.ToString())) { weapon.damage_medium = damageSB.Multiplier.ToString() + damageSB.HDType.ToString(); } if (weapon.damage_small.Contains(damageSB.HDType.ToString())) { weapon.damage_small = damageSB.Multiplier.ToString() + damageSB.HDType.ToString(); } } if (MonSize == StatBlockInfo.SizeCategories.Medium && !ShieldBashBoost && !hasSizeDifference) { if (HasNewWeaponDamge) { damageComputed.ParseHDBlock(weapon.damage_medium); } else { damageComputed.ParseHDBlock(weapon.damage_medium); } } else if (MonSize == StatBlockInfo.SizeCategories.Small && !ShieldBashBoost && !hasSizeDifference) { if (HasNewWeaponDamge) { damageComputed.ParseHDBlock(weapon.damage_small); } else { damageComputed.ParseHDBlock(weapon.damage_small); } } else if (!hasSizeDifference) { if (HasNewWeaponDamge) { damageComputed.ParseHDBlock(StatBlockInfo.ChangeWeaponDamageSize(weaponDamage.damage_medium, MonSize)); } else { damageComputed.ParseHDBlock(StatBlockInfo.ChangeWeaponDamageSize(weapon.damage_medium, MonSize)); } } else { //hasSizeDifference = true if (MonSize == StatBlockInfo.SizeCategories.Small) { damageComputed.ParseHDBlock(weapon.damage_small); } else { StatBlockInfo.SizeCategories tempSize = StatBlockInfo.SizeCategories.Medium; if (WeaponSize == tempSize) { tempSize = MonSize; } damageComputed.ParseHDBlock(StatBlockInfo.ChangeWeaponDamageSize(weapon.damage_medium, tempSize)); } } double StrBonus; bool OneHandedAsTwo; string ModUsed = ComputeStrBonus(weapon, TwoWeaponFighting, BiteAttack, weaponCount, weaponIndex, _monSBSearch, _abilityScores, out StrBonus, out OneHandedAsTwo); formula += " +" + StrBonus.ToString() + PathfinderConstants.SPACE + ModUsed + " Bonus Used"; damageComputed.Modifier += Convert.ToInt32(StrBonus); if (weapon.WeaponSpecialMaterial == WeaponSpecialMaterials.AlchemicalSilver && (weapon.slashing || weapon.piercing)) { damageComputed.Modifier--; formula += " -1 Alchemical Silver"; } if (_monSBSearch.HasSQ("hulking changeling")) { damageComputed.Modifier++; formula += " +1 hulking changeling"; } string hold2 = weapon.NamedWeapon ? weapon.BaseWeaponName : weapon.search_name; if (_monSBSearch.HasSpecialAttackGeneral("weapon training")) { damageComputed.Modifier += _monSBSearch.GetWeaponsTrainingModifier(hold2, ref formula); } damageComputed.Modifier += PoleArmTraingMods(weapon, _monSBSearch, FighterLevel, ref formula); bool ignoreEnhancement = false; if (weapon.name.ToLower() == "unarmed strike") { damageComputed.Modifier += _monSBSearch.GetOnGoingStatBlockModValue(OnGoingStatBlockModifier.StatBlockModifierTypes.NaturalDamage, OnGoingStatBlockModifier.StatBlockModifierSubTypes.None, ref formula); } else { WeaponCommon weaponCommon = new WeaponCommon(_sbCheckerBaseInput, _equipmentData, _naturalWeaponBusiness); weaponCommon.GetOnGoingDamageMods(MagicWeapon, GreaterMagicWeapon, _indvSB, ref formula, ref damageComputed, ref ignoreEnhancement); } if ((weapon.WeaponSpecialAbilities.WeaponSpecialAbilitiesValue & WeaponSpecialAbilitiesEnum.Furious) == WeaponSpecialAbilitiesEnum.Furious) { damageComputed.Modifier += 2; formula += " +1 furious"; } string hold = weapon.NamedWeapon ? weapon.BaseWeaponName.ToLower() : weapon.search_name.ToLower(); if (hold.Contains("aldori")) { hold = hold.Replace("aldori", "Aldori"); } if (_sbCheckerBaseInput.CharacterClasses.HasClass("aldori swordlord")) { if (hold.Contains("dueling sword")) { int tenpMod = _monSBSearch.GetAbilityMod(AbilityScores.AbilityScores.AbilityName.Dexterity); formula += " +" + tenpMod.ToString() + " Deft Strike"; damageComputed.Modifier += tenpMod; } } if (_monSBSearch.HasFeat("Weapon Specialization (" + hold + PathfinderConstants.PAREN_RIGHT)) { formula += " +2 Weapon Specialization"; damageComputed.Modifier += 2; } if (_monSBSearch.HasFeat("Greater Weapon Specialization (" + hold + PathfinderConstants.PAREN_RIGHT)) { formula += " +2 Greater Weapon Specialization"; damageComputed.Modifier += 2; } if (_monSBSearch.HasTemplate("graveknight")) { damageComputed.Modifier += 2; formula += " +2 Sacrilegious Aura"; } if (_monSBSearch.HasFeat("Shield Master") && weapon.name.Contains("shield")) { formula += " +" + weapon.EnhancementBonus + " Shield Master"; damageComputed.Modifier += weapon.EnhancementBonus; } //no enchantment bonus for shield bash if (weapon.EnhancementBonus > 0 && ACDefendingMod == 0 && !weapon.name.Contains("shield") && !ignoreEnhancement) { formula += " +" + weapon.EnhancementBonus.ToString() + " Enhancement Bonus"; damageComputed.Modifier += weapon.EnhancementBonus; } if (weapon.Broken) { formula += " -2 Broken"; damageComputed.Modifier -= 2; } if (damageSB.Equals(damageComputed)) { _messageXML.AddPass("Melee Attack Damage-" + weapon.Weapon_FullName(), formula); } else { int temp5 = damageComputed.Modifier - 1; if (OneHandedAsTwo && damageSB.Modifier == temp5 && !_monSBSearch.HasShield()) // not all SB use two handed weapons; not error, their choice { _messageXML.AddInfo(weapon.Weapon_FullName() + " could be used two-handed for extra damage"); _messageXML.AddPass("Melee Attack Damage-" + weapon.Weapon_FullName()); } else { _messageXML.AddFail("Melee Attack Damage-" + weapon.Weapon_FullName(), damageComputed.ToString(), damageSB.ToString(), formula); if (OneHandedAsTwo) { _messageXML.AddFail("Melee Attack Damage-", "Weapon could be used As Two-Handed?"); } } } string tempWeaponCrit = weapon.critical.Replace("/×2", string.Empty); tempWeaponCrit = tempWeaponCrit.Replace((char)(8211), char.Parse("-")); //if (tempWeaponCrit == weaponCrit) //{ // _messageXML.AddPass("Melee Attack Critical- " + weapon.Weapon_FullName()); //} //else //{ // _messageXML.AddFail("Melee Attack Critical- " + weapon.Weapon_FullName(), weapon.critical, weaponCrit); //} }