Example #1
0
        public void UsageTest()
        {
            Card x;

            x = new Attack(CardSuit.Club, 0);
            Assert.AreEqual(1, x.numOfTargets());
            x = new Miss(CardSuit.Club, 0);
            Assert.AreEqual(-1, x.numOfTargets()); // this means not usable
            x = new Wine(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new Peach(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new Negate(CardSuit.Club, 0);
            Assert.AreEqual(-1, x.numOfTargets());
            x = new Barbarians(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new HailofArrow(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new PeachGarden(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new Wealth(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new Steal(CardSuit.Club, 0);
            Assert.AreEqual(1, x.numOfTargets());
            x = new Break(CardSuit.Club, 0);
            Assert.AreEqual(1, x.numOfTargets());
            x = new Capture(CardSuit.Club, 0);
            Assert.AreEqual(1, x.numOfTargets());
            x = new Starvation(CardSuit.Club, 0);
            Assert.AreEqual(1, x.numOfTargets());
            x = new Crossbow(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new IceSword(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new Scimitar(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new BlackShield(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
            x = new EightTrigrams(CardSuit.Club, 0);
            Assert.AreEqual(0, x.numOfTargets());
        }
        public void IceSwordTest2()
        {
            IceSword c = new IceSword(CardSuit.Club, (byte)1);

            Assert.AreEqual("IceSword", c.ToString());
        }
Example #3
0
        public WalkingScene(SpellswordGame game, World thisWorld, WalkingPlayer player)
        {
            inputHandler = game.Services.GetService <InputHandler>();
            if (inputHandler == null)
            {
                inputHandler = new InputHandler(game);
                game.Components.Add(inputHandler);
            }

            this.game      = game;
            this.thisWorld = thisWorld;
            this.player    = player;

            string[] mapFile =
            {
                "11111110001111111",
                "11111110001111111",
                "11111110001111111",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "00010000000001000",
                "00000000000000000",
                "00010000000001000",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "00010000000001000",
                "00000000000000000",
                "00010000000001000",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "11111111011111111",
                "11111110001111111",
                "11111110001111111",
                "11111110001111111"
            };

            emptyTiles = new List <EmptyTile>();
            CreateEmptyTiles(game, mapFile);

            //Temp test
            Enemy welp   = new Welp("WelpSmall", "Welp");
            Enemy zombie = new Zombie("ZombieSmall", "Zombie");
            Enemy wraith = new Wraith("WraithSmall", "Wraith");
            Enemy ghost  = new Ghost("BackwardsStill", "Ghost");
            Enemy flower = new Flower("FlowerWorld", "FlowerBattle");
            Enemy dragon = new Dragon("Dragon", "Dragon", "DragonSpecial");

            enemies = new List <WorldEnemy>();
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(3, 7), welp));    // Welp
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(3, 13), zombie)); // Zombie
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(13, 7), wraith)); // Wraith
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(13, 13), ghost)); // Ghost
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(8, 19), flower)); // Flower
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(8, 1), dragon));  // Dragon Boss

            // More Temp Test
            swords = new List <WorldSword>();
            Weapon iceShield      = new IceShield("IceShield", 8, 15);
            Weapon iceSword       = new IceSword("IceSword", 20, 5);
            Weapon lightningSword = new LightningSword("LightningSword", 30, 5);
            Weapon focus          = new BasicFocus("SpellFocus");

            this.swords.Add(new WorldSword(game, thisWorld, new Point(1, 7), iceShield));       // Ice Shield
            this.swords.Add(new WorldSword(game, thisWorld, new Point(1, 13), iceSword));       // Ice Blade
            this.swords.Add(new WorldSword(game, thisWorld, new Point(15, 7), lightningSword)); // Lightning Blade
            this.swords.Add(new WorldSword(game, thisWorld, new Point(15, 13), focus));         // Spell/Power Focus

            InitializePlayerToMiddle();
        }
        public void IceSwordTest()
        {
            IceSword c = new IceSword(CardSuit.Club, (byte)1);

            Assert.AreEqual("IceSword Description", c.getDescription());
        }