public override MonsterStatBlock ApplyTemplate(MonsterStatBlock MonSB) { int HDValue = MonSB.HDValue(); if (HDValue < 5) { TemplateCommon.AddResistance(MonSB, "cold ", 5); TemplateCommon.AddResistance(MonSB, "fire ", 5); } else if (HDValue >= 5 && HDValue <= 10) { TemplateCommon.AddDR(MonSB, "good", 5); TemplateCommon.AddResistance(MonSB, "cold ", 10); TemplateCommon.AddResistance(MonSB, "fire ", 10); } else if (HDValue >= 11) { TemplateCommon.AddDR(MonSB, "good", 10); TemplateCommon.AddResistance(MonSB, "cold ", 15); TemplateCommon.AddResistance(MonSB, "fire ", 15); } int CR_Hold; int.TryParse(MonSB.CR, out CR_Hold); MonSB.SR = (CR_Hold + 5).ToString(); return(MonSB); }
public override MonsterStatBlock ApplyTemplate(MonsterStatBlock MonSB) { MonSB.AC_Mods = StatBlockInfo.ChangeAC_Mod(MonSB.AC_Mods, "natural", 1, true); if (MonSB.HDValue() <= 11) { TemplateCommon.AddDR(MonSB, "magic", 5); } else { TemplateCommon.AddDR(MonSB, "magic", 10); } TemplateCommon.AddResistance(MonSB, "acid ", 10); TemplateCommon.AddResistance(MonSB, "cold ", 10); TemplateCommon.AddResistance(MonSB, "electricity ", 10); return(MonSB); }
public override MonsterStatBlock ApplyTemplate(MonsterStatBlock MonSB) { MonSB.AC_Mods = StatBlockInfo.ChangeAC_Mod(MonSB.AC_Mods, "natural", 1, true); if (MonSB.HDValue() <= 11) { TemplateCommon.AddDR(MonSB, "magic", 5); } else { TemplateCommon.AddDR(MonSB, "magic", 10); } TemplateCommon.AddResistance(MonSB, "cold ", 10); TemplateCommon.AddResistance(MonSB, "electricity ", 10); TemplateCommon.AddResistance(MonSB, "acid ", 10); TemplateCommon.AddResistance(MonSB, "fire ", 10); int CR_Hold; int.TryParse(MonSB.CR, out CR_Hold); if (CR_Hold <= 4) { MonSB.SR = ((CR_Hold - 1) + 11).ToString(); } else if (CR_Hold <= 10) { MonSB.SR = ((CR_Hold - 2) + 11).ToString(); } else { MonSB.SR = ((CR_Hold - 2) + 11).ToString(); } return(MonSB); }
private void CheckAppliedTemplates(TemplateManager.TemplateManager TM, ref MonsterStatBlock TestMonSB) { string CheckName = "CheckAppliedTemplates"; bool stackedTemplates = false; if (MonSB.TemplatesApplied.Contains(",")) { stackedTemplates = true; //|1,2,3…@sk| } List <string> templates = MonSB.TemplatesApplied.Split('|').ToList <string>(); templates.Remove(""); List <string> stackedTemplateList = new List <string>(); string stackedTemplateBase = string.Empty; if (stackedTemplates) { FindStackTemplates(templates, ref stackedTemplateList, ref stackedTemplateBase); } foreach (string appliedTemplate in templates) { string lowerAppliedTemplate = appliedTemplate.ToLower(); if (lowerAppliedTemplate.Contains("advanced") || lowerAppliedTemplate.Contains("advanced hd")) { if (MonSB.HDValue() - CharacterClasses.FindTotalClassLevels() != Race_Base.RacialHDValue()) { TestMonSB = ApplyAdvancedHDTemplate(TM, TestMonSB); } else { if (TestMonSB != null) { List <string> Failures; if (stackedTemplates) { TestMonSB = ApplyStackedTemplates(TM, TestMonSB, stackedTemplateList, stackedTemplateBase, out Failures); } else { if (templates.Count == 1) { TestMonSB = ApplyOneTemplate(CheckName, TM, TestMonSB); } else { TestMonSB = ApplyMultipleTemplates(TM, TestMonSB, templates, stackedTemplateList); } } Race_Base.ApplyTemplatedRaceSB(TestMonSB, true); } } } else { if (TestMonSB != null) { bool Success; MonsterStatBlock tempmonSB = null; List <string> Failures; if (stackedTemplates) { TestMonSB = ApplyStackedTemplates(TM, TestMonSB, stackedTemplateList, stackedTemplateBase, out Failures); Success = !Failures.Any(); } else { TM.ApplyTemplate(TestMonSB, lowerAppliedTemplate.Trim(), out Success); } if (tempmonSB != null) { TestMonSB = tempmonSB; } if (!Success) { _messageXML.AddFail("CheckTemplates", "Template not applied for " + lowerAppliedTemplate.Trim()); } else { _messageXML.AddInfo("Template Applied - " + lowerAppliedTemplate.Trim()); Race_Base.ApplyTemplatedRaceSB(TestMonSB, true); } } } } }