Пример #1
0
        public void TestGearFactory()
        {
            Ability[] a;
            var       gfLocal  = new GearFactory("ActI", true);
            var       gfRemote = new GearFactory("ActI", false);

            a = new Ability[] {
                new Ability(1, AbilityType.Range, 0, 0),
                new Ability(1, AbilityType.Damage, 1, 0),
                new Ability(1, AbilityType.Pierce, 1, 0),
            };
            var mainHand = new WeoponItem(
                "Iron Spear", new AttackDice("blue", "yellow"),
                HandCatagory.MeleeWeopon, a,
                new ItemCatagory[] { ItemCatagory.Exotic }, 1);

            Assert.Equal(mainHand, gfLocal.MainHand[0]);
            Assert.Equal(mainHand, gfRemote.MainHand[0]);

            var offHand = new ShieldItem("Iron Shield", new Ability[0]);

            Assert.Equal(offHand, gfLocal.OffHand[0]);
            Assert.Equal(offHand, gfRemote.OffHand[0]);

            var armor = new ArmorItem("Chainmail", new DefenceDice("grey"),
                                      ItemCatagory.HeavyArmor, new Ability[0]);

            a = new Ability[] { new Ability(1, AbilityType.Range, 0, 0) };
            var helmet  = new ItemCatagory[] { ItemCatagory.Helmet };
            var trinket = new TrinketItem("Scorpion Helmet", helmet, a);

            Assert.Equal(trinket, gfLocal.Trinket[0]);
            Assert.Equal(trinket, gfRemote.Trinket[0]);
        }
        private Player GeneratePlayer()
        {
            Player p = new Player("Hero Alba", "A hero on a journey", new Point(5, 5), 125, 15);

            p.EquipNewGear(GearFactory.GetGear(GearType.Chest));
            p.EquipNewWeapon(WeaponFactory.GetWeapon(WeaponType.MainHand, AttackType.Blunt));
            return(p);
        }
Пример #3
0
        public FileDataStore()
        {
            GearFactory gf = new GearFactory("ActI", false);

            MainHand = gf.MainHand;
            OffHand  = gf.OffHand;
            Armor    = gf.Armor;
            Trinket  = gf.Trinket;
            var baseDefence = new DefenceDice(new GreyDie());

            Hero = new Hero("Leoric", 4, 8, 5, baseDefence, 1, 5, 3, 2, 0);
        }
Пример #4
0
        public GameSession()
        {
            CurrentPlayer = new Player("Stanis", 10)
            {
                Fishnet = FishFactory.CreateFishByID(1001, 1002, 1004, 1005, 1003, 1002, 1001, 1006, 1004, 1004, 1007, 1003,
                                                     1001, 1002, 1004, 1005, 1003, 1002, 1001, 1006, 1004, 1004, 1007, 1003),
                Backpack = GearFactory.GetListOfStandardItems()
            };

            WorldFactory factory = new WorldFactory();

            CurrentWorld = factory.CreateWorld();
        }