public IActionResult Character(string strategy, int level, string scores) { var build = strategyGateway.Find(strategy); var roller = GatewayProvider.Find <AbilityScoreGenerator>(scores); build.TargetLevel = level; build.AbilityScoreRoller = roller.Generator; var gen = GatewayProvider.Find <CharacterDesigner>(build.Designer); var character = new CharacterSheet(build); gen.ExecuteStep(character); ViewData["character"] = new CharacterSheetTextView(character); ViewData["characterFull"] = character; ViewData["strategy"] = strategy; ViewData["scores"] = scores; ViewData["level"] = level; var saveObj = new YamlObjectStore(); character.Save(saveObj); ViewData["save-data"] = saveObj.WriteToString(); return(View()); }
public IActionResult Settlement(string strategy) { var strat = strategyGateway.Find(strategy); var settlement = new Settlement(strat); var settlementBuilder = GatewayProvider.Find <SettlementDesigner>("create-settlement"); settlementBuilder.Execute(settlement); this.ViewData["settlement"] = settlement; this.ViewData["strategy"] = strategy; return(this.View()); }
public void LoadAndRunAllDesignersToLevel20() { var strategies = GatewayProvider.All <CharacterStrategy>(); foreach (var strat in strategies) { ShortLog.DebugFormat("Validating Strategy: {0}", strat.Name); strat.TargetLevel = 20; var gen = GatewayProvider.Find <CharacterDesigner>(strat.Designer); var character = new CharacterSheet(strat); gen.ExecuteStep(character); } }
public void Execute(Settlement settlement) { var strategy = settlement.Get <SettlementStrategy>(); int target = Randomly.Range(strategy.MinimumPopulation, strategy.MaximumPopulation); for (int count = 0; count < target; count++) { var inhabitantStrategy = GatewayProvider.Find <CharacterStrategy>("inhabitant"); var designer = GatewayProvider.Find <CharacterDesigner>(inhabitantStrategy.Designer); var inhabitant = new CharacterSheet(inhabitantStrategy); designer.ExecuteStep(inhabitant); settlement.AddInhabitant(inhabitant); } }
public PointBuyAbilityScoreGenerator() { MaxDumpStats = 3; PointCosts = GatewayProvider.Find <AbilityScoreCosts>("standard"); }
public FlurryOfBlows() : this(GatewayProvider.Find <DataTable>("Monk Abilities")) { }
public MonkArmorClassBonus() { monkAbilities = GatewayProvider.Find <DataTable>("Monk Abilities"); }
public static string FindAndChooseWord(string descriptorName) { var descriptor = GatewayProvider.Find <Descriptor>(descriptorName); return(descriptor.Words.ChooseOne()); }
public MagicArmor(IArmor armor, int bonus) : base(armor) { this.MagicBonus = bonus; this.MagicValue = GatewayProvider.Find <MagicArmorValue>(MagicBonus.ToString()).Value; }
public MonkUnarmedStrike() { damageTable = GatewayProvider.Find <DataTable>("Monk Abilities"); }
public MagicWeapon(IWeapon weapon, int magic) : base(weapon) { this.MagicBonus = magic; this.MagicValue = GatewayProvider.Find <MagicWeaponValue>(magic.ToString()); }