예제 #1
0
        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());
        }
예제 #2
0
        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());
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
 public PointBuyAbilityScoreGenerator()
 {
     MaxDumpStats = 3;
     PointCosts   = GatewayProvider.Find <AbilityScoreCosts>("standard");
 }
예제 #6
0
 public FlurryOfBlows()
     : this(GatewayProvider.Find <DataTable>("Monk Abilities"))
 {
 }
예제 #7
0
 public MonkArmorClassBonus()
 {
     monkAbilities = GatewayProvider.Find <DataTable>("Monk Abilities");
 }
예제 #8
0
        public static string FindAndChooseWord(string descriptorName)
        {
            var descriptor = GatewayProvider.Find <Descriptor>(descriptorName);

            return(descriptor.Words.ChooseOne());
        }
예제 #9
0
 public MagicArmor(IArmor armor, int bonus) : base(armor)
 {
     this.MagicBonus = bonus;
     this.MagicValue = GatewayProvider.Find <MagicArmorValue>(MagicBonus.ToString()).Value;
 }
예제 #10
0
 public MonkUnarmedStrike()
 {
     damageTable = GatewayProvider.Find <DataTable>("Monk Abilities");
 }
예제 #11
0
 public MagicWeapon(IWeapon weapon, int magic) : base(weapon)
 {
     this.MagicBonus = magic;
     this.MagicValue = GatewayProvider.Find <MagicWeaponValue>(magic.ToString());
 }