Пример #1
0
        public void Dispatcher_Tests_Base_SetUp()
        {
            Engine.Cosmogenesis("bang", __factory);

            var atlas  = SourceMe.The <Atlas>();
            var legend = atlas.Legend;

            ttFloor       = legend[TerrainEnum.Floor];
            ttWall        = legend[TerrainEnum.Wall];
            ttDoorOpen    = legend[TerrainEnum.DoorOpen];
            ttDoorClosed  = legend[TerrainEnum.DoorClosed];
            ttSoil        = legend[TerrainEnum.Soil];
            ttSoilTilled  = legend[TerrainEnum.SoilTilled];
            ttSoilPlanted = legend[TerrainEnum.SoilPlanted];

            _gameState     = SourceMe.The <IGameState>();
            _gameState.Map = new CompoundMap
            {
                BeingMap = new BeingMap(),
                RotMap   = new RotMap(),
                SpaceMap = CreateSmallTestMap(),
                ItemMap  = new ItemMap(),
            };

            _controls    = SourceMe.The <IControlPanel>();
            BeingCreator = SourceMe.The <IBeingCreator>();
        }
Пример #2
0
        public void SetUp()
        {
            Basis.ConnectIDGenerator();
            _beingCreator = SourceMe.The <IBeingCreator>();

            var _loader = SourceMe.The <MapLoader>();

            _serializer   = _loader.GetSerializer();
            _deserializer = _loader.GetDeserializer();
        }
Пример #3
0
        public void SetUp()
        {
            BeingCreator = SourceMe.The <IBeingCreator>();
            Basis.ConnectIDGenerator();

            // Torch as club, crunch and burn
            tac        = new AttackMethod();
            tac_impact = new AttackEffect
            {
                Type        = "physical.impact.blunt",
                DamageRange = "1d5"
            };
            tac_flame = new AttackEffect
            {
                Type        = "energetic.fire",
                DamageRange = "1d3 - 1"
            };
            tac.AttackEffects.Add(tac_impact);
            tac.AttackEffects.Add(tac_flame);

            // Brekka-onu's Flame Hammer, bigger crunch, bigger burn
            bfh        = new AttackMethod();
            bfh_impact = new AttackEffect
            {
                Type        = "physical.impact.blunt",
                DamageRange = "2d6 + 4"
            };
            bfh_flame = new AttackEffect
            {
                Type        = "energetic.fire",
                DamageRange = "1d4 + 2"
            };
            bfh.AttackEffects.Add(bfh_impact);
            bfh.AttackEffects.Add(bfh_flame);

            leather_armor = new DefenseMethod();
            leather_armor.Resistances["physical.impact.blunt"] = "1/4 ..4";
            leather_armor.Resistances["physical"]  = "1/2 ..4";
            leather_armor.Resistances["energetic"] = "2/3 ..4";
            leather_armor.Resistances["magical"]   = "1/3 ..1";
            leather_armor.Resistances["vital"]     = "1/3 ..2";
            //leather_armor.Resistances["default"] = "1/3 ..3";  //not needed with all branches covered

            ring_armor = new DefenseMethod();
            ring_armor.Resistances["physical.impact.blunt"] = "1/2 ..6";
            ring_armor.Resistances["physical"]       = "2/3 ..8";
            ring_armor.Resistances["energetic.fire"] = "2/3 ..5";
            ring_armor.Resistances["default"]        = "1/2 ..5";

            //0.2: Keep the tree of damage types in data, and type-check attacks/defenses at load time...
        }
Пример #4
0
        public SocialRegister Register_FromYaml(IParser parser, IBeingCreator creator)
        {
            parser.Consume <MappingStart>();
            var register = new SocialRegister(creator);

            while (parser.TryConsume <Scalar>(out var evt) && evt.Value == "Being")
            {
                parser.Consume <MappingStart>();
                IBeing being = creator.Being_FromYaml(parser);
                parser.Consume <MappingEnd>();

                register.WellKnownBeings[being.Name] = being;
            }

            parser.Consume <MappingEnd>();
            return(register);
        }
Пример #5
0
 public Compendium(
     IDGenerator idGen,
     IBeingCreator beingCreator,
     TomeOfChaos tomeOfChaos,
     Herbal herbal,
     SocialRegister socialRegister,
     Dramaticon dramaticon,
     Atlas atlas
     )
 {
     IDGenerator    = idGen;
     BeingCreator   = beingCreator;
     TomeOfChaos    = tomeOfChaos;
     Herbal         = herbal;
     SocialRegister = socialRegister;
     Dramaticon     = dramaticon;
     Atlas          = atlas;
 }
Пример #6
0
        public void Register_ToYaml(IEmitter emitter, IBook book, IBeingCreator creator)
        {
            if (book == null)
            {
                return;
            }
            var reg = (SocialRegister)book;

            emitter.StartNamedMapping("SocialRegister");

            foreach (var key in reg.WellKnownBeings.Keys)
            {
                emitter.StartNamedMapping("Being");

                creator.Being_ToYaml(emitter, reg.WellKnownBeings[key]);

                emitter.EndMapping();
            }

            emitter.EndMapping();
        }
Пример #7
0
 public MapLoader(ILog logger, Atlas atlas, IBeingCreator creator)
     : this(logger, atlas)
 {
 }
Пример #8
0
        public SocialRegister Register_FromNew(IBeingCreator creator)
        {
            var register = new SocialRegister(creator);

            return(register);
        }
Пример #9
0
 public BookPublisher(IBeingCreator creator)
 {
     BeingCreator = creator;
 }
Пример #10
0
 public SocialRegister(IBeingCreator creator)
 {
     BeingCreator    = creator;
     WellKnownBeings = new Dictionary <string, IBeing>();
 }
Пример #11
0
 public YConv_IBook(IBeingCreator creator)
 {
     Creator   = creator;
     Publisher = new BookPublisher(creator);
 }