internal static BlueprintFeature GetBloodlinePower(BlueprintProgression bloodline, int level) { if (level == 1) { return((BlueprintFeature)bloodline.GetLevelEntry(1).Features.First(f => !IsArcanaOrClassSkill(f))); } var features = bloodline.GetLevelEntry(level).Features; var power = features.First(f => (!Char.IsDigit(f.name.Last()) || f.name.Last() == '1') && !f.name.EndsWith("ExtraUse") && f.GetComponent <AddKnownSpell>() == null); return((BlueprintFeature)power); }
static BlueprintFeature CreateBloodlineSpell(BlueprintProgression bloodline, int level, BlueprintProgression crossbloodline) { foreach (var feat in bloodline.GetLevelEntry(level).Features) { var addSpell = feat.GetComponents <AddKnownSpell>().FirstOrDefault(s => s.CharacterClass == sorcererClass); if (addSpell == null) { continue; } var result = CreateCrossbloodedFeature((BlueprintFeature)feat, crossbloodline); var spell = addSpell.Spell; if (!result.GetComponents <PrerequisiteSpellKnown>().Any(s => s.Spell == spell && s.Not)) { result.AddComponent(PrerequisiteSpellKnown.Create(spell, true)); } spell.AddRecommendNoFeature(crossbloodline); return(result); } throw Main.Error($"could not find level {level} spell for ${bloodline.name}"); }