public SubRace GetSubRace(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (SubRaces.ContainsKey(name)) { return(SubRaces[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && SubRaces.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(SubRaces[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (SubRacesSimple.ContainsKey(name)) { return(SubRacesSimple[name]); } ConfigManager.LogError("Unknown Subrace: " + name); SubRace sr = new SubRace(this, name, null) { Description = "Missing Entry" }; return(sr); }
public Spell GetSpell(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Spells.ContainsKey(name)) { return(Spells[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Spells.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Spells[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (SpellsSimple.ContainsKey(name)) { return(SpellsSimple[name]); } ConfigManager.LogError("Spell not found: " + name); Spell missing = new Spell() { Name = name, Source = "Autogenerated Entry", ShowSource = true }; missing.Register(this, null); return(missing); }
public Monster GetMonster(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Monsters.ContainsKey(name)) { return(Monsters[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Monsters.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Monsters[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (MonstersSimple.ContainsKey(name)) { return(MonstersSimple[name]); } if (MonstersSimple.Count > 0) { ConfigManager.LogError("Unknown Monster: " + name); return(new Monster(this, name, "Missing Entry")); } return(null); }
public Item GetItem(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Items.ContainsKey(name)) { return(Items[name]); } if (Spells.ContainsKey(name)) { return(new Scroll(GetSpell(name, sourcehint))); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Items.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Items[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (sourcehint != null && Spells.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(new Scroll(GetSpell(name + " " + ConfigManager.SourceSeperator + " " + sourcehint, sourcehint))); } if (ItemsSimple.ContainsKey(name)) { return(ItemsSimple[name]); } if (SpellsSimple.ContainsKey(name)) { return(new Scroll(GetSpell(name, sourcehint))); } return(new Item(Category.Make(this), name)); }
public Condition GetCondition(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Conditions.ContainsKey(name)) { return(Conditions[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Conditions.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Conditions[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (ConditionsSimple.ContainsKey(name)) { return(ConditionsSimple[name]); } return(new Condition(this, name, "")); }
public ClassDefinition GetClass(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Classes.ContainsKey(name)) { return(Classes[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Classes.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Classes[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (ClassesSimple.ContainsKey(name)) { return(ClassesSimple[name]); } ConfigManager.LogError("Unknown Class: " + name); return(new ClassDefinition(this, name, "Missing Entry", 4)); }
public Background GetBackground(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Backgrounds.ContainsKey(name)) { return(Backgrounds[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Backgrounds.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Backgrounds[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (BackgroundsSimple.ContainsKey(name)) { return(BackgroundsSimple[name]); } ConfigManager.LogError("Unknown Background: " + name); return(new Background(this, name, "Missing Entry")); }
public Skill GetSkill(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Skills.ContainsKey(name)) { return(Skills[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Skills.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Skills[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (SkillsSimple.ContainsKey(name)) { return(SkillsSimple[name]); } ConfigManager.LogError("Unknown Skill: " + name); return(new Skill(this, name, "Missing Entry", Ability.None)); }
public MagicProperty GetMagic(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Magic.ContainsKey(name)) { return(Magic[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Magic.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Magic[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (MagicSimple.ContainsKey(name)) { return(MagicSimple[name]); } ConfigManager.LogError("Unknown property: " + name); return(new MagicProperty(this, name, "Missing Entry")); }
public Language GetLanguage(String name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Languages.ContainsKey(name)) { return(Languages[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Languages.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Languages[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (LanguagesSimple.ContainsKey(name)) { return(LanguagesSimple[name]); } ConfigManager.LogError("Unknown Language: " + name); return(new Language(this, name, "Missing Entry", "", "")); }
public Feature GetBoon(string name, string sourcehint) { if (name.Contains(ConfigManager.SourceSeperatorString)) { if (Boons.ContainsKey(name)) { return(Boons[name]); } name = SourceInvariantComparer.NoSource(name); } if (sourcehint != null && Boons.ContainsKey(name + " " + ConfigManager.SourceSeperator + " " + sourcehint)) { return(Boons[name + " " + ConfigManager.SourceSeperator + " " + sourcehint]); } if (BoonsSimple.ContainsKey(name)) { return(BoonsSimple[name]); } ConfigManager.LogError("Unknown Boon: " + name); Feature b = new Feature(name, "Missing Boon", 0, false); BoonsSimple[name] = b; return(b); }