Пример #1
0
    void HitAnimal(Collision2D other)
    {
        if (other.collider.CompareTag("Wildlife"))
        {
            if (arrowType == 0)
            {
                arrowPrefab = ItemCollection.itemCollection.bowArrow;
            }
            else if (arrowType == 1)
            {
                arrowPrefab = ItemCollection.itemCollection.crossbowArrow;
            }
            else if (arrowType == 2)
            {
                arrowPrefab = ItemCollection.itemCollection.ballistaArrow;
            }
            Instantiate(Effect.effect.bloodPool, transform.position, transform.rotation);

            boar            = other.collider.GetComponent <Boar>();
            boar.nextWonder = 0;
            totalDamage     = basicDamage + (rb.velocity.magnitude / 20) * basicDamage;
            boar.hp        -= totalDamage;
            if (boar.hp <= 0)
            {
                GameObject newArrow = Instantiate(arrowPrefab, transform.position, transform.rotation);
                arrowPrefab.layer = LayerMask.NameToLayer("DeadBody");
                newArrow.GetComponent <Arrow>().speed = 0;
            }
        }
    }
Пример #2
0
        public override bool[,] movimetsPosible()
        {
            bool[,] array = new bool[Boar.Lines, Boar.Columns];
            Position pos = new Position(0, 0);


            //NorthEast
            pos.defineValue(Position.Line - 1, Position.Column + 1);
            while (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
                if (Boar.piece(pos) != null && Boar.piece(pos).Color != Color)
                {
                    break;
                }
                pos.Line   -= 1;
                pos.Column += 1;
            }

            //NorthWest
            pos.defineValue(Position.Line - 1, Position.Column - 1);
            while (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
                if (Boar.piece(pos) != null && Boar.piece(pos).Color != Color)
                {
                    break;
                }
                pos.Line   -= 1;
                pos.Column -= 1;
            }

            //SouthWest
            pos.defineValue(Position.Line + 1, Position.Column - 1);
            while (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
                if (Boar.piece(pos) != null && Boar.piece(pos).Color != Color)
                {
                    break;
                }
                pos.Line   += 1;
                pos.Column -= 1;
            }

            //SouthEast
            pos.defineValue(Position.Line + 1, Position.Column + 1);
            while (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
                if (Boar.piece(pos) != null && Boar.piece(pos).Color != Color)
                {
                    break;
                }
                pos.Line   += 1;
                pos.Column += 1;
            }

            return(array);
        }
Пример #3
0
    public override void play(ref Player p)
    {
        Minion boar = new Boar();

        p.board.Add(boar);
        boar.play(ref p);
        base.play(ref p);
    }
Пример #4
0
        public override bool[,] movimetsPosible()
        {
            bool[,] arrayGeneral = new bool[Boar.Lines, Boar.Columns];
            Position pos = new Position(0, 0);


            //up
            pos.defineValue(Position.Line - 2, Position.Column - 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                arrayGeneral[pos.Line, pos.Column] = true;
            }
            //up
            pos.defineValue(Position.Line - 2, Position.Column + 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                arrayGeneral[pos.Line, pos.Column] = true;
            }
            //Down
            pos.defineValue(Position.Line + 2, Position.Column + 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                arrayGeneral[pos.Line, pos.Column] = true;
            }
            //Down
            pos.defineValue(Position.Line + 2, Position.Column - 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                arrayGeneral[pos.Line, pos.Column] = true;
            }
            //Rith
            pos.defineValue(Position.Line + 1, Position.Column + 2);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                arrayGeneral[pos.Line, pos.Column] = true;
            }
            //Rith
            pos.defineValue(Position.Line - 1, Position.Column + 2);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                arrayGeneral[pos.Line, pos.Column] = true;
            }
            //Left
            pos.defineValue(Position.Line - 1, Position.Column - 2);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                arrayGeneral[pos.Line, pos.Column] = true;
            }
            //Left
            pos.defineValue(Position.Line + 1, Position.Column - 2);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                arrayGeneral[pos.Line, pos.Column] = true;
            }
            return(arrayGeneral);
        }
Пример #5
0
        private void BoarAbility()
        {
            CancelShooting();
            doingBoar = true;
            ChangeAnimation(ref currentAnimation, boarAnimation);
            ChangeAnimation(ref currentHandAnimation, handBoarAnimation);
            abilityTwoCooldown = abilityTwoMaxCooldown;
            UpdateSpriteEffect();
            Boar boar = new Boar(this, boarDmg, aimDirection, shadow.Position, 8, clientBounds);

            abilityBuffer.Add(boar);
        }
Пример #6
0
        public void TestSetupQuest2()
        {
            QuestMatch game = ScenarioCreator.GameNoDeal(1);

            game.AttachLogger(new Quest.Core.Logger("TestSetupQuest2"));
            Player sponsorAI = game.Players[0];

            sponsorAI.Behaviour = new Strategy1();

            // Setup quest
            SearchForTheQuestingBeast quest = new SearchForTheQuestingBeast(game); // 4 stages.

            game.CurrentStory = quest;
            quest.Sponsor     = sponsorAI;

            //cards, no test
            Giant   giant   = new Giant(game);   //40
            Lance   lance   = new Lance(game);   //20
            Mordred mordred = new Mordred(game); //30
            Sword   sword   = new Sword(game);   //10
            Sword   sword2  = new Sword(game);   //10
            Dagger  dagger  = new Dagger(game);  //5
            Dagger  dagger2 = new Dagger(game);  //5
            Thieves thieves = new Thieves(game); //5
            Boar    boar    = new Boar(game);    //5

            sponsorAI.Hand.Add(new List <Card>()
            {
                giant, lance, thieves, boar, mordred,
                dagger, dagger2, sword, sword2
            });

            List <AdventureCard>[] stages = sponsorAI.Behaviour.SetupQuest(quest, sponsorAI.Hand);
            Assert.AreEqual(4, stages.Length);

            //test last stage - should contain giant and lance
            Assert.AreEqual(2, stages[3].Count);
            Assert.IsTrue(stages[3].Contains(giant));
            Assert.IsTrue(stages[3].Contains(lance));

            //test 3rd stage - should be mordred and one of the daggers
            Assert.AreEqual(2, stages[2].Count);
            Assert.IsTrue(stages[2].Contains(mordred));
            Assert.IsTrue((stages[2].Contains(dagger)) || (stages[2].Contains(dagger2)));

            //test 2nd stage - thieves or boar, and one of the swords
            Assert.AreEqual(2, stages[1].Count);
            Assert.IsTrue((stages[1].Contains(thieves)) || (stages[1].Contains(boar)));
            Assert.IsTrue((stages[1].Contains(sword)) || (stages[1].Contains(sword2)));
            //test 1st stage - thieves or boar (whichever wasn't played previously)
            Assert.AreEqual(1, stages[0].Count);
            Assert.IsTrue((stages[1].Contains(thieves)) || (stages[1].Contains(boar)));
        }
        public string Execute(IList <string> parameters)
        {
            string name     = parameters[1];
            IPoint position = this.LocationParser.ParsePoint(parameters[2]);

            var boar = new Boar(name, position);

            Engine.AllOgranisms.Add(boar);
            Engine.Animals.Add(boar);

            string message = $"Boar {name} was created at ({position.X}, {position.Y})";

            return(message);
        }
Пример #8
0
        public void TestQuestSponsoring()
        {
            QuestMatch game = ScenarioCreator.GameNoDeal(2);

            game.AttachLogger(new Quest.Core.Logger("TestQuestSponsoring"));
            Player aiPlayer = game.Players[0];

            aiPlayer.Behaviour = new Strategy1();
            Player otherPlayer = game.Players[1];

            RescueTheFairMaiden quest = new RescueTheFairMaiden(game); // 3 Stages with bonus to Black Knight.

            game.CurrentStory = quest;

            // Test case where another player can win.
            //(conditions for whether or not to sponsor quest is same as strategy 2)
            otherPlayer.Rank.AddShields(21);
            Assert.IsFalse(aiPlayer.Behaviour.SponsorQuest(quest, aiPlayer.Hand));
            otherPlayer.Rank.RemoveShields(10);

            //quest cards
            Dragon      dragon      = new Dragon(game);      //50
            BlackKnight blackKnight = new BlackKnight(game); //35 (25+10)
            Mordred     mordred     = new Mordred(game);     //30
            Thieves     thieves     = new Thieves(game);     //5
            Boar        boar        = new Boar(game);        //5
            Lance       lance       = new Lance(game);       //20
            Sword       sword       = new Sword(game);       //10
            Dagger      dagger      = new Dagger(game);      //5

            aiPlayer.Hand.Add(new TestOfValor(game));
            aiPlayer.Hand.Add(boar);
            aiPlayer.Hand.Add(thieves);
            //hand: boar, thieves, testOfValor - not enough bp
            Assert.IsFalse(aiPlayer.Behaviour.SponsorQuest(quest, aiPlayer.Hand));

            aiPlayer.Hand.Add(blackKnight);
            aiPlayer.Hand.Add(lance);
            //hand: boar, thieves, test, blackknight, lance - enough bp
            Assert.IsTrue(aiPlayer.Behaviour.SponsorQuest(quest, aiPlayer.Hand));

            aiPlayer.Hand.Remove(boar);
            aiPlayer.Hand.Remove(thieves);
            aiPlayer.Hand.Remove(lance);
            aiPlayer.Hand.Add(dragon);
            //hand: black knight, test, lance, dragon - enough bp
            //(last stage dragon, 2nd stage test, first black knight (no lance))
            Assert.IsTrue(aiPlayer.Behaviour.SponsorQuest(quest, aiPlayer.Hand));
        }
Пример #9
0
    // Start is called before the first frame update
    void Start()
    {
        boar = GameObject.FindGameObjectWithTag("Boar").GetComponent <Boar>();
        if (!boar)
        {
            Debug.Log("BOAR IS NULL");
        }
        endRace = GameObject.FindGameObjectWithTag("SceneTrigger").GetComponent <EndRace>();
        if (!endRace)
        {
            Debug.Log("END TRIGGER IS NULL");
        }

        countDownTimeRemaining = countDownTime;
    }
Пример #10
0
        public void TestQuestSponsoring()
        {
            QuestMatch game = ScenarioCreator.GameNoDeal(2);

            game.AttachLogger(new Quest.Core.Logger("TestQuestSponsoring"));
            Player aiPlayer = game.Players[0];

            aiPlayer.Behaviour = new Strategy2();
            Player winningPlayer = game.Players[1];

            RescueTheFairMaiden quest = new RescueTheFairMaiden(game); // 3 Stages with bonus to Black Knight.

            game.CurrentStory = quest;

            // Test case where another player can win.
            winningPlayer.Rank.AddShields(21);
            Assert.IsFalse(aiPlayer.Behaviour.SponsorQuest(quest, aiPlayer.Hand));
            winningPlayer.Rank.RemoveShields(10);

            // Test cards.
            Boar        boar        = new Boar(game);        // 5 BP
            Thieves     thieves     = new Thieves(game);     // 5 BP
            BlackKnight blackKnight = new BlackKnight(game); // Should be worth 35 BP, not 25.
            GreenKnight greenKnight = new GreenKnight(game);
            Mordred     mordred     = new Mordred(game);     // 30 BP.
            Lance       lance       = new Lance(game);       // +20 BP.

            // Ensure having a test card is taken into consideration for the next tests.
            aiPlayer.Hand.Add(new TestOfValor(game));

            // First case, not enough battle points in second stage, expect false.
            aiPlayer.Hand.Add(boar);
            aiPlayer.Hand.Add(thieves);
            Assert.IsFalse(aiPlayer.Behaviour.SponsorQuest(quest, aiPlayer.Hand));

            // Add weapon, expect true.
            aiPlayer.Hand.Add(lance);
            Assert.IsTrue(aiPlayer.Behaviour.SponsorQuest(quest, aiPlayer.Hand));
            aiPlayer.Hand.Remove(lance);
            aiPlayer.Hand.Remove(boar);
            aiPlayer.Hand.Remove(thieves);

            // Green knight and black knight test, black night quest bonuse should be considered, expect true.
            aiPlayer.Hand.Add(blackKnight);
            aiPlayer.Hand.Add(greenKnight);
            Assert.IsTrue(aiPlayer.Behaviour.SponsorQuest(quest, aiPlayer.Hand));
        }
Пример #11
0
        public void TestSetupTest()
        {
            QuestMatch game = ScenarioCreator.GameNoDeal(1);

            game.AttachLogger(new Quest.Core.Logger("TestSetupQuest"));
            Player sponsorAI = game.Players[0];

            sponsorAI.Behaviour = new Strategy2();

            // Setup quest
            SearchForTheQuestingBeast quest = new SearchForTheQuestingBeast(game); // 4 stages.

            game.CurrentStory = quest;
            quest.Sponsor     = sponsorAI;

            // Test cards.
            TestOfTemptation testOfTemptation = new TestOfTemptation(game); // Play second last (stage 3).
            Boar             boar             = new Boar(game);             // 5 BP.
            Saxons           saxons           = new Saxons(game);           // 10 BP.
            Mordred          mordred          = new Mordred(game);          // 40 BP, played last stage.
            Sword            sword            = new Sword(game);            // 10 BP, played last stage.

            sponsorAI.Hand.Add(new List <Card>()
            {
                testOfTemptation, boar, saxons, mordred, sword
            });

            List <AdventureCard>[] stages = sponsorAI.Behaviour.SetupQuest(quest, sponsorAI.Hand);
            Assert.AreEqual(4, stages.Length);

            // Validate stage 1.
            Assert.AreEqual(1, stages[0].Count);
            Assert.IsTrue(stages[0].Contains(boar));

            // Validate stage 2.
            Assert.AreEqual(1, stages[1].Count);
            Assert.IsTrue(stages[1].Contains(saxons));

            // Validate stage 3.
            Assert.AreEqual(1, stages[2].Count);
            Assert.IsTrue(stages[2].Contains(testOfTemptation));

            // Validate stage 4.
            Assert.AreEqual(2, stages[3].Count);
            Assert.IsTrue(stages[3].Contains(mordred));
            Assert.IsTrue(stages[3].Contains(sword));
        }
Пример #12
0
    // Start is called before the first frame update
    void Start()
    {
        boar = GameObject.FindGameObjectWithTag("Boar").GetComponent <Boar>();
        if (!boar)
        {
            Debug.Log("BOAR IS NULL");
        }
        endRace = GameObject.FindGameObjectWithTag("SceneTrigger").GetComponent <EndRace>();
        if (!endRace)
        {
            Debug.Log("END TRIGGER IS NULL");
        }

        countDownTimeRemaining = countDownTime;
        secondsTimeRemaining   = Mathf.FloorToInt(raceTime % 60);
        minutesTimeRemaining   = Mathf.FloorToInt(raceTime / 60);
    }
Пример #13
0
        public void TestQuestParticipation()
        {
            QuestMatch game = ScenarioCreator.GameNoDeal(1);

            game.AttachLogger(new Quest.Core.Logger("TestQuestParticipation"));
            Player aiPlayer = game.Players[0];

            aiPlayer.Behaviour = new Strategy1();

            RescueTheFairMaiden quest = new RescueTheFairMaiden(game); // 3 stages.

            game.CurrentStory = quest;

            //cards
            Lance         lance         = new Lance(game);         //20
            Dagger        dagger        = new Dagger(game);        //5
            Sword         sword         = new Sword(game);         //10
            SirGalahad    sirGalahad    = new SirGalahad(game);    //15
            SirLancelot   sirLancelot   = new SirLancelot(game);   //15
            KingPellinore kingPellinore = new KingPellinore(game); //10
            Mordred       mordred       = new Mordred(game);       //30
            Thieves       thieves       = new Thieves(game);       //5
            Boar          boar          = new Boar(game);          //5

            aiPlayer.Hand.Add(lance);
            aiPlayer.Hand.Add(dagger);
            aiPlayer.Hand.Add(sword);
            aiPlayer.Hand.Add(sirGalahad);
            aiPlayer.Hand.Add(boar);
            aiPlayer.Hand.Add(thieves);
            //hand: lance, dagger, sword, galahad, boar, thieves - not enough weapon/allies
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));

            aiPlayer.Hand.Add(sirLancelot);
            aiPlayer.Hand.Add(kingPellinore);
            //hand: lance, dagger, sword, galahad, lancelot, pelinore, boar, thieves
            Assert.IsTrue(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));

            aiPlayer.Hand.Remove(thieves);
            //not enough foes (to discard)
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));
            //2 foes, but mordred has too much bp
            aiPlayer.Hand.Add(mordred);
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));
        }
Пример #14
0
        public void TestQuestParticipation()
        {
            QuestMatch game = ScenarioCreator.GameNoDeal(1);

            game.AttachLogger(new Quest.Core.Logger("TestQuestParticipation"));
            Player aiPlayer = game.Players[0];

            aiPlayer.Behaviour = new Strategy2();

            RescueTheFairMaiden quest = new RescueTheFairMaiden(game); // 3 stages.

            game.CurrentStory = quest;

            // Make player knight, 10 BP.
            aiPlayer.Rank.AddShields(5);

            // Test cards.
            KingArthur  arthur      = new KingArthur(game);  // 10 BP.
            SirLancelot lancelot    = new SirLancelot(game); // 15 BP.
            SirGalahad  galahad     = new SirGalahad(game);  // 15 BP.
            Boar        boar        = new Boar(game);        // 5 BP, should be discarded.
            Thieves     thieves     = new Thieves(game);     // 5 BP, should be discarded.
            BlackKnight blackKnight = new BlackKnight(game); // 25 BP, should not be discarded.
            Excalibur   excalibur   = new Excalibur(game);   // +30 BP.
            Lance       lance       = new Lance(game);       // + 20 BP.

            // Cannot increase for all 3 stages, expect false.
            aiPlayer.Hand.Add(boar);
            aiPlayer.Hand.Add(thieves);
            aiPlayer.Hand.Add(blackKnight);
            aiPlayer.Hand.Add(arthur);
            aiPlayer.Hand.Add(lancelot);
            aiPlayer.Hand.Add(galahad);
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));

            // Add weapons, expect true.
            aiPlayer.Hand.Add(excalibur);
            aiPlayer.Hand.Add(lance);
            Assert.IsTrue(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));

            // Remove discardable foe less than 25 BP, expect false.
            aiPlayer.Hand.Remove(boar);
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));
        }
Пример #15
0
        public void TestSetupQuest()
        {
            QuestMatch game = ScenarioCreator.GameNoDeal(1);

            game.AttachLogger(new Quest.Core.Logger("TestSetupQuest"));
            Player sponsorAI = game.Players[0];

            sponsorAI.Behaviour = new Strategy1();

            // Setup quest
            RescueTheFairMaiden quest = new RescueTheFairMaiden(game);//3 stages

            game.CurrentStory = quest;
            quest.Sponsor     = sponsorAI;

            //quest cards
            Dragon      dragon      = new Dragon(game);      //50
            BlackKnight blackKnight = new BlackKnight(game); //35 (25+10)
            Thieves     thieves     = new Thieves(game);     //5
            Boar        boar        = new Boar(game);        //5
            TestOfValor testOfValor = new TestOfValor(game);

            sponsorAI.Hand.Add(new List <Card>()
            {
                testOfValor, boar, thieves, dragon
            });

            List <AdventureCard>[] stages = sponsorAI.Behaviour.SetupQuest(quest, sponsorAI.Hand);
            Assert.AreEqual(3, stages.Length);

            //test last stage - should contain strongest foe (dragon)
            Assert.AreEqual(1, stages[2].Count);
            Assert.IsTrue(stages[2].Contains(dragon));

            //test second last stage - should contain test of valor
            Assert.AreEqual(1, stages[1].Count);
            Assert.IsTrue(stages[1].Contains(testOfValor));

            //test first stage
            Assert.AreEqual(1, stages[0].Count);
        }
Пример #16
0
 protected override void ExecuteBirthCommand(string[] commandWords)
 {
     string organismType = commandWords[1];
     string name = null;
     Point position = default(Point);
     switch (organismType)
     {
         case WolfType:
             name = commandWords[2];
             position = Point.Parse(commandWords[3]);
             Wolf newWolf = new Wolf(name, position);
             this.AddOrganism(newWolf);
             break;
         case LionType:
             name = commandWords[2];
             position = Point.Parse(commandWords[3]);
             Lion newLion = new Lion(name, position);
             this.AddOrganism(newLion);
             break;
         case GrassType:
             position = Point.Parse(commandWords[2]);
             Grass newGrass = new Grass(position);
             this.AddOrganism(newGrass);
             break;
         case BoarType:
             name = commandWords[2];
             position = Point.Parse(commandWords[3]);
             Boar newBoar = new Boar(name, position);
             this.AddOrganism(newBoar);
             break;
         case ZombieType:
             name = commandWords[2];
             position = Point.Parse(commandWords[3]);
             Zombie newZombie = new Zombie(name, position);
             this.AddOrganism(newZombie);
             break;
         default:
             base.ExecuteBirthCommand(commandWords);
             break;
     }
 }
Пример #17
0
        public override bool[,] movimetsPosible()
        {
            bool[,] array = new bool[Boar.Lines, Boar.Columns];
            Position pos = new Position(0, 0);

            if (Color == Color.White)
            {
                pos.defineValue(Position.Line - 2, Position.Column);
                if (Boar.positionValid(pos) && MovimentQuantity == 0)
                {
                    array[pos.Line, pos.Column] = true;
                }
                //up
                pos.defineValue(Position.Line - 1, Position.Column);
                if (Boar.positionValid(pos) && free(pos))
                {
                    array[pos.Line, pos.Column] = true;
                }

                //northEast
                pos.defineValue(Position.Line - 1, Position.Column + 1);
                if (Boar.positionValid(pos) && existEnemy(pos))
                {
                    array[pos.Line, pos.Column] = true;
                }

                //northeWest
                pos.defineValue(Position.Line - 1, Position.Column - 1);
                if (Boar.positionValid(pos) && existEnemy(pos))
                {
                    array[pos.Line, pos.Column] = true;
                }
            }
            else
            {
                pos.defineValue(Position.Line + 2, Position.Column);
                if (Boar.positionValid(pos) && MovimentQuantity == 0)
                {
                    array[pos.Line, pos.Column] = true;
                }
                //up
                pos.defineValue(Position.Line + 1, Position.Column);
                if (Boar.positionValid(pos) && free(pos))
                {
                    array[pos.Line, pos.Column] = true;
                }

                //northEast
                pos.defineValue(Position.Line + 1, Position.Column - 1);
                if (Boar.positionValid(pos) && existEnemy(pos))
                {
                    array[pos.Line, pos.Column] = true;
                }

                //northeWest
                pos.defineValue(Position.Line + 1, Position.Column + 1);
                if (Boar.positionValid(pos) && existEnemy(pos))
                {
                    array[pos.Line, pos.Column] = true;
                }
            }
            return(array);
        }
Пример #18
0
        private bool canMoviment(Position pos)
        {
            Piece p = Boar.piece(pos);

            return(p == null || p.Color != Color);
        }
Пример #19
0
 private bool free(Position pos)
 {
     return(Boar.piece(pos) == null);
 }
Пример #20
0
        private bool existEnemy(Position pos)
        {
            Piece p = Boar.piece(pos);

            return(p != null && p.Color != Color);
        }
        public override void Damage(Mobile m)
        {
            base.Damage(m);

            if (m.Alive)
            {
                Item item = m.FindItemOnLayer(Layer.OuterTorso);

                if (item is GMRobe)
                {
                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                }
                else
                {
                    // Forest noises
                    if (Utility.RandomDouble() < 0.008)
                    {
                        m.PlaySound(Utility.RandomList(0x000, 0x001, 0x002));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Bird chirps
                    if (Utility.RandomDouble() < 0.002)
                    {
                        m.PlaySound(Utility.RandomList(0x094, 0x095, 0x096, 0x097, 0x0D1, 0x0D2));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Cricket noises
                    if (Utility.RandomDouble() < 0.003)
                    {
                        m.PlaySound(Utility.RandomList(0x00A, 0x00B));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Turdy Encounter 1
                    if (Utility.RandomDouble() < 0.002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 8;
                            int y1 = m.Y + 8;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature turdyencounter;
                                switch (Utility.Random(2))
                                {
                                default:
                                case 0: turdyencounter = new Turdy(); break;

                                case 1: turdyencounter = new Turdy(); break;
                                }
                                turdyencounter.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                turdyencounter.Combatant = m;
                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTurdyEncounter), turdyencounter);
                            }
                        }
                    }

                    // Turdy Encounter 2
                    if (Utility.RandomDouble() < 0.002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 8;
                            int y2 = m.Y - 8;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature turdyencounter;
                                switch (Utility.Random(2))
                                {
                                default:
                                case 0: turdyencounter = new Turdy(); break;

                                case 1: turdyencounter = new Turdy(); break;
                                }
                                turdyencounter.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                turdyencounter.Combatant = m;
                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTurdyEncounter), turdyencounter);
                            }
                        }
                    }

                    // Random Encounter 1
                    if (Utility.RandomDouble() < 0.0002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 8;
                            int y1 = m.Y + 8;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature encounterb;
                                switch (Utility.Random(2))
                                {
                                default:
                                case 0: encounterb = new AutumnwoodAdventurer(); break;

                                case 1: encounterb = new AutumnwoodAdventurer(); break;
                                }
                                encounterb.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterB), encounterb);
                            }
                        }
                    }

                    // Random Encounter 2
                    if (Utility.RandomDouble() < 0.0002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 8;
                            int y2 = m.Y - 8;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature encounterb;
                                switch (Utility.Random(2))
                                {
                                default:
                                case 0: encounterb = new AutumnwoodAdventurer(); break;

                                case 1: encounterb = new AutumnwoodAdventurer(); break;
                                }
                                encounterb.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterB), encounterb);
                            }
                        }
                    }

                    // Tamable Encounter 1
                    if (Utility.RandomDouble() < 0.002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 8;
                            int y1 = m.Y + 8;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature tameable;
                                switch (Utility.Random(23))
                                {
                                default:
                                case 0: tameable = new Bird(); break;

                                case 1: tameable = new Boar(); break;

                                case 2: tameable = new BlackBear(); break;

                                case 3: tameable = new Bull(); break;

                                case 4: tameable = new Chicken(); break;

                                case 5: tameable = new Cow(); break;

                                case 6: tameable = new ForestBat(); break;

                                case 7: tameable = new Goat(); break;

                                case 8: tameable = new GreatHart(); break;

                                case 9: tameable = new GreenSlime(); break;

                                case 10: tameable = new GreySquirrel(); break;

                                case 11: tameable = new GreyWolfPup(); break;

                                case 12: tameable = new Hind(); break;

                                case 13: tameable = new Horse(); break;

                                case 14: tameable = new LargeFrog(); break;

                                case 15: tameable = new Ogumo(); break;

                                case 16: tameable = new Panther(); break;

                                case 17: tameable = new Pig(); break;

                                case 18: tameable = new Rabbit(); break;

                                case 19: tameable = new Rat(); break;

                                case 20: tameable = new RhinoBeetle(); break;

                                case 21: tameable = new RunningPants(); break;

                                case 22: tameable = new Sheep(); break;
                                }
                                tameable.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable);
                            }
                        }
                    }

                    // Tamable Encounter 2
                    if (Utility.RandomDouble() < 0.002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 8;
                            int y2 = m.Y - 8;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature tameable;
                                switch (Utility.Random(23))
                                {
                                default:
                                case 0: tameable = new Bird(); break;

                                case 1: tameable = new Boar(); break;

                                case 2: tameable = new BlackBear(); break;

                                case 3: tameable = new Bull(); break;

                                case 4: tameable = new Chicken(); break;

                                case 5: tameable = new Cow(); break;

                                case 6: tameable = new ForestBat(); break;

                                case 7: tameable = new Goat(); break;

                                case 8: tameable = new GreatHart(); break;

                                case 9: tameable = new GreenSlime(); break;

                                case 10: tameable = new GreySquirrel(); break;

                                case 11: tameable = new GreyWolfPup(); break;

                                case 12: tameable = new Hind(); break;

                                case 13: tameable = new Horse(); break;

                                case 14: tameable = new LargeFrog(); break;

                                case 15: tameable = new Ogumo(); break;

                                case 16: tameable = new Panther(); break;

                                case 17: tameable = new Pig(); break;

                                case 18: tameable = new Rabbit(); break;

                                case 19: tameable = new Rat(); break;

                                case 20: tameable = new RhinoBeetle(); break;

                                case 21: tameable = new RunningPants(); break;

                                case 22: tameable = new Sheep(); break;
                                }
                                tameable.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable);
                            }
                        }
                    }

                    // Random Treasure Chest 1
                    if (Utility.RandomDouble() < 0.0005)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 12;
                            int y1 = m.Y + 12;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseContainer treasurechest;

                                if (m.Skills.Tracking.Base > 14.9)
                                {
                                    switch (Utility.Random(2))
                                    {
                                    default:
                                    case 0: treasurechest = new AutumnwoodTreasureChest1(); break;

                                    case 1: treasurechest = new AutumnwoodTreasureChest1(); break;
                                    }
                                    treasurechest.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                    Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest);
                                }
                            }
                        }
                    }

                    // Random Treasure Chest 2
                    if (Utility.RandomDouble() < 0.0005)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 12;
                            int y2 = m.Y - 12;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseContainer treasurechest;

                                if (m.Skills.Tracking.Base > 14.9)
                                {
                                    switch (Utility.Random(2))
                                    {
                                    default:
                                    case 0: treasurechest = new AutumnwoodTreasureChest1(); break;

                                    case 1: treasurechest = new AutumnwoodTreasureChest1(); break;
                                    }
                                    treasurechest.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                    Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest);
                                }
                            }
                        }
                    }
                }
            }
        }
 public Boar_MeleeAttackState(FiniteStateMachine finiteStateMachine, Enemy entity, string animationBoolName, Transform attackPosition,
                              D_MeleeAttackState stateData, Boar boar) : base(finiteStateMachine, entity, animationBoolName, attackPosition, stateData)
 {
     _boar = boar;
 }
Пример #23
0
        public override bool[,] movimetsPosible()
        {
            bool[,] array = new bool[Boar.Lines, Boar.Columns];
            Position pos = new Position(0, 0);


            //up
            pos.defineValue(Position.Line - 1, Position.Column);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
            }

            //right
            pos.defineValue(Position.Line, Position.Column + 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
            }

            //left
            pos.defineValue(Position.Line, Position.Column - 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
            }

            //down
            pos.defineValue(Position.Line + 1, Position.Column);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
            }

            //northwestern
            pos.defineValue(Position.Line - 1, Position.Column + 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
            }

            //southeast
            pos.defineValue(Position.Line + 1, Position.Column + 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
            }

            //sout-west
            pos.defineValue(Position.Line + 1, Position.Column - 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
            }

            //northewest
            pos.defineValue(Position.Line - 1, Position.Column - 1);
            if (Boar.positionValid(pos) && canMoviment(pos))
            {
                array[pos.Line, pos.Column] = true;
            }

            // Jogada especial Roque
            if (MovimentQuantity == 0)
            {
                // jogada especial roque pequeno
                Position posT1 = new Position(Position.Line, Position.Column + 3);
                if (towerTesttoRoque(posT1))
                {
                    Position p1 = new Position(Position.Line, Position.Column + 1);
                    Position p2 = new Position(Position.Line, Position.Column + 2);
                    if (Boar.piece(p1) == null && Boar.piece(p2) == null)
                    {
                        array[Position.Line, Position.Column + 2] = true;
                    }
                }
            }

            // #Jogadaespecial Roque grande
            if (MovimentQuantity == 0)
            {
                // #jogadaespecial roque pequeno
                Position posT2 = new Position(Position.Line, Position.Column - 4);
                if (towerTesttoRoque(posT2))
                {
                    Position p1 = new Position(Position.Line, Position.Column - 1);
                    Position p2 = new Position(Position.Line, Position.Column - 2);
                    Position p3 = new Position(Position.Line, Position.Column - 3);
                    if (Boar.piece(p1) == null && Boar.piece(p2) == null && Boar.piece(p3) == null)
                    {
                        array[Position.Line, Position.Column - 2] = true;
                    }
                }
            }

            return(array);
        }
Пример #24
0
        private bool towerTesttoRoque(Position pos)
        {
            Piece p = Boar.piece(pos);

            return(p != null && p is Tower && p.Color == Color && MovimentQuantity == 0);
        }
        public override void Damage(Mobile m)
        {
            base.Damage(m);

            if (m.Alive)
            {
                Item item = m.FindItemOnLayer(Layer.OuterTorso);

                if (item is GMRobe)
                {
                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                }
                else if (item is GMRobeExplosion)
                {
                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    m.PlaySound(Utility.RandomList(0x307, 0x308));
                }
                else if (item is GMRobeHoly)
                {
                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);

                    m.FixedParticles(0x375A, 1, 30, 9966, 88, 2, EffectLayer.Head);
                    m.FixedParticles(0x37B9, 1, 30, 9502, 85, 3, EffectLayer.Head);
                    m.FixedParticles(0x376A, 1, 31, 9961, 80, 0, EffectLayer.Waist);
                    m.FixedParticles(0x37C4, 1, 31, 9502, 88, 2, EffectLayer.Waist);
                }
                else if (item is GMRobeFarts)
                {
                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);

                    m.PlaySound(Utility.RandomList(792, 1064));
                }
                else if (item is GMRobeTrailfire)
                {
                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);

                    m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                }
                else
                {
                    if (m.Title == "the Running Pants")
                    {
                        if (m.Str <= 100)
                        {
                            if (Utility.RandomDouble() < 0.0003)
                            {
                                m.Str += 1;
                                m.BoltEffect(0x480);
                                m.PlaySound(0x5CE);
                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                            }
                        }
                    }

                    // Wind
                    if (Utility.RandomDouble() < 0.002)
                    {
                        m.PlaySound(Utility.RandomList(0x014, 0x15, 0x016, 0x5C7));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    if (Utility.RandomDouble() < 0.002)
                    {
                        m.PlaySound(Utility.RandomList(0x014, 0x15, 0x016, 0x5C7));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    if (m.Kills >= 5)
                    {
                        // Wasteland Mercenary Ambush
                        if (Utility.RandomDouble() < 0.005)
                        {
                            if (m.Map == Map.Malas)
                            {
                                int x1 = m.X + 20;
                                int y1 = m.Y + 20;
                                int z1 = Map.Malas.GetAverageZ(x1, y1);

                                if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                                {
                                    BaseCreature wastelandmercenary = new WastelandMercenary();
                                    wastelandmercenary.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);
                                    wastelandmercenary.Combatant = m;
                                    wastelandmercenary.PlaySound(0x220);                           // Earthquake

                                    m.PlaySound(0x5CE);
                                    wastelandmercenary.BoltEffect(0x480);
                                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);

                                    Timer.DelayCall(TimeSpan.FromMinutes(30.0), new TimerStateCallback(DeleteWastelandMercenary), wastelandmercenary);
                                }
                            }

                            // Wasteland Mercenary 2
                            if (Utility.RandomDouble() < 0.005)
                            {
                                if (m.Map == Map.Malas)
                                {
                                    int x2 = m.X - 20;
                                    int y2 = m.Y - 20;
                                    int z2 = Map.Malas.GetAverageZ(x2, y2);

                                    if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                                    {
                                        BaseCreature wastelandmercenary = new WastelandMercenary();
                                        wastelandmercenary.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);
                                        wastelandmercenary.Combatant = m;
                                        wastelandmercenary.PlaySound(0x220);                           // Earthquake

                                        m.PlaySound(0x5CE);
                                        wastelandmercenary.BoltEffect(0x480);
                                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);

                                        Timer.DelayCall(TimeSpan.FromMinutes(30.0), new TimerStateCallback(DeleteWastelandMercenary), wastelandmercenary);
                                    }
                                }
                            }
                        }
                    }

                    // Dragon Encounter 1
                    if (Utility.RandomDouble() < 0.0001)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 15;
                            int y1 = m.Y + 15;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature dragonencounter;
                                switch (Utility.Random(2))
                                {
                                default:
                                case 0: dragonencounter = new BlackDragon(); break;

                                case 1: dragonencounter = new BlackDragon(); break;
                                }
                                dragonencounter.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);
                                dragonencounter.Combatant = m;
                                m.PlaySound(0x656);                 // risingColossus

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(30.0), new TimerStateCallback(DeleteDragonEncounter), dragonencounter);
                            }
                        }
                    }

                    // Dragon Encounter 2
                    if (Utility.RandomDouble() < 0.0001)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 12;
                            int y2 = m.Y - 12;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature dragonencounter;
                                switch (Utility.Random(8))
                                {
                                default:
                                case 0: dragonencounter = new BlackDragon(); break;

                                case 1: dragonencounter = new BlackDragon(); break;
                                }
                                dragonencounter.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);
                                dragonencounter.Combatant = m;
                                m.PlaySound(0x656);                 // risingColossus

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(30.0), new TimerStateCallback(DeleteDragonEncounter), dragonencounter);
                            }
                        }
                    }

                    // Random Encounter 1
                    if (Utility.RandomDouble() < 0.00002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 12;
                            int y1 = m.Y + 12;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature encountera;
                                switch (Utility.Random(15))
                                {
                                default:
                                case 0: encountera = new Almiraj(); break;

                                case 1: encountera = new BlackAntAmbusher(); break;

                                case 2: encountera = new FaerieBeetleCollector(); break;

                                case 3: encountera = new GazerLarva(); break;

                                case 4: encountera = new Gizzard(); break;

                                case 5: encountera = new GreenSlime(); break;

                                case 6: encountera = new HordeMinion(); break;

                                case 7: encountera = new Mongbat(); break;

                                case 8: encountera = new Orc(); break;

                                case 9: encountera = new Ratman(); break;

                                case 10: encountera = new StreamingWisp(); break;

                                case 11: encountera = new SwampVine(); break;

                                case 12: encountera = new Tokoloshe(); break;

                                case 13: encountera = new VerdantSprite(); break;

                                case 14: encountera = new WaterLizard(); break;
                                }
                                encountera.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera);
                            }
                        }
                    }

                    // Random Encounter 2
                    if (Utility.RandomDouble() < 0.00002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 12;
                            int y2 = m.Y - 12;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature encountera;
                                switch (Utility.Random(15))
                                {
                                default:
                                case 0: encountera = new Almiraj(); break;

                                case 1: encountera = new BlackAntAmbusher(); break;

                                case 2: encountera = new FaerieBeetleCollector(); break;

                                case 3: encountera = new GazerLarva(); break;

                                case 4: encountera = new Gizzard(); break;

                                case 5: encountera = new GreenSlime(); break;

                                case 6: encountera = new HordeMinion(); break;

                                case 7: encountera = new Mongbat(); break;

                                case 8: encountera = new Orc(); break;

                                case 9: encountera = new Ratman(); break;

                                case 10: encountera = new StreamingWisp(); break;

                                case 11: encountera = new SwampVine(); break;

                                case 12: encountera = new Tokoloshe(); break;

                                case 13: encountera = new VerdantSprite(); break;

                                case 14: encountera = new WaterLizard(); break;
                                }
                                encountera.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera);
                            }
                        }
                    }

                    // Tamable Encounter 1
                    if (Utility.RandomDouble() < 0.00002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 12;
                            int y1 = m.Y + 12;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature tameable;
                                switch (Utility.Random(23))
                                {
                                default:
                                case 0: tameable = new Bird(); break;

                                case 1: tameable = new Boar(); break;

                                case 2: tameable = new BrownBear(); break;

                                case 3: tameable = new Bull(); break;

                                case 4: tameable = new Chicken(); break;

                                case 5: tameable = new Cow(); break;

                                case 6: tameable = new ForestBat(); break;

                                case 7: tameable = new Goat(); break;

                                case 8: tameable = new GreatHart(); break;

                                case 9: tameable = new GreenSlime(); break;

                                case 10: tameable = new GreySquirrel(); break;

                                case 11: tameable = new GreyWolfPup(); break;

                                case 12: tameable = new Hind(); break;

                                case 13: tameable = new Horse(); break;

                                case 14: tameable = new LargeFrog(); break;

                                case 15: tameable = new Ogumo(); break;

                                case 16: tameable = new Panther(); break;

                                case 17: tameable = new Pig(); break;

                                case 18: tameable = new Rabbit(); break;

                                case 19: tameable = new Rat(); break;

                                case 20: tameable = new RhinoBeetle(); break;

                                case 21: tameable = new RunningPants(); break;

                                case 22: tameable = new Sheep(); break;
                                }
                                tameable.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable);
                            }
                        }
                    }

                    // Tamable Encounter 2
                    if (Utility.RandomDouble() < 0.00002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 12;
                            int y2 = m.Y - 12;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature tameable;
                                switch (Utility.Random(23))
                                {
                                default:
                                case 0: tameable = new Bird(); break;

                                case 1: tameable = new Boar(); break;

                                case 2: tameable = new BrownBear(); break;

                                case 3: tameable = new Bull(); break;

                                case 4: tameable = new Chicken(); break;

                                case 5: tameable = new Cow(); break;

                                case 6: tameable = new ForestBat(); break;

                                case 7: tameable = new Goat(); break;

                                case 8: tameable = new GreatHart(); break;

                                case 9: tameable = new GreenSlime(); break;

                                case 10: tameable = new GreySquirrel(); break;

                                case 11: tameable = new GreyWolfPup(); break;

                                case 12: tameable = new Hind(); break;

                                case 13: tameable = new Horse(); break;

                                case 14: tameable = new LargeFrog(); break;

                                case 15: tameable = new Ogumo(); break;

                                case 16: tameable = new Panther(); break;

                                case 17: tameable = new Pig(); break;

                                case 18: tameable = new Rabbit(); break;

                                case 19: tameable = new Rat(); break;

                                case 20: tameable = new RhinoBeetle(); break;

                                case 21: tameable = new RunningPants(); break;

                                case 22: tameable = new Sheep(); break;
                                }
                                tameable.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable);
                            }
                        }
                    }

                    // Random Adventurer 1
                    if (Utility.RandomDouble() < 0.00002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 15;
                            int y1 = m.Y + 15;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature friendlyencounter;
                                switch (Utility.Random(2))
                                {
                                default:
                                case 0: friendlyencounter = new ZaythalorHuman(); break;

                                case 1: friendlyencounter = new ZaythalorSunElf(); break;

                                case 2: friendlyencounter = new ZaythalorMoonElf(); break;
                                }
                                friendlyencounter.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteFriendlyEncounter), friendlyencounter);
                            }
                        }
                    }

                    // Random Adventurer 2
                    if (Utility.RandomDouble() < 0.00002)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 15;
                            int y2 = m.Y - 15;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature friendlyencounter;
                                switch (Utility.Random(2))
                                {
                                default:
                                case 0: friendlyencounter = new ZaythalorHuman(); break;

                                case 1: friendlyencounter = new ZaythalorSunElf(); break;

                                case 2: friendlyencounter = new ZaythalorMoonElf(); break;
                                }
                                friendlyencounter.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteFriendlyEncounter), friendlyencounter);
                            }
                        }
                    }

                    // Random Treasure Chest 1
                    if (Utility.RandomDouble() < 0.0005)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 12;
                            int y1 = m.Y + 12;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseContainer treasurechest;

                                if (m.Skills.Tracking.Base > 4.9)
                                {
                                    switch (Utility.Random(2))
                                    {
                                    default:
                                    case 0: treasurechest = new ZaythalorForestTreasureChest1(); break;

                                    case 1: treasurechest = new ZaythalorForestTreasureChest1(); break;
                                    }
                                    treasurechest.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                    Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest);
                                }
                            }
                        }
                    }

                    // Random Treasure Chest 2
                    if (Utility.RandomDouble() < 0.0005)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 12;
                            int y2 = m.Y - 12;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseContainer treasurechest;

                                if (m.Skills.Tracking.Base > 4.9)
                                {
                                    switch (Utility.Random(2))
                                    {
                                    default:
                                    case 0: treasurechest = new ZaythalorForestTreasureChest1(); break;

                                    case 1: treasurechest = new ZaythalorForestTreasureChest1(); break;
                                    }
                                    treasurechest.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                    Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest);
                                }
                            }
                        }
                    }

                    // Random Dead Body 1
                    if (Utility.RandomDouble() < 0.0003)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 10;
                            int y1 = m.Y + 10;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseContainer deadbody;

                                switch (Utility.Random(4))
                                {
                                default:
                                case 0: deadbody = new UnknownBardSkeletonZaythalor(); break;

                                case 1: deadbody = new UnknownMageSkeletonZaythalor(); break;

                                case 2: deadbody = new UnknownRogueSkeletonZaythalor(); break;

                                case 3: deadbody = new UnknownRogueSkeletonZaythalor(); break;
                                }

                                deadbody.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteDeadBody), deadbody);
                            }
                        }
                    }

                    // Random Dead Body 2
                    if (Utility.RandomDouble() < 0.0003)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 10;
                            int y2 = m.Y - 10;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseContainer deadbody;

                                switch (Utility.Random(4))
                                {
                                default:
                                case 0: deadbody = new UnknownBardSkeletonZaythalor(); break;

                                case 1: deadbody = new UnknownMageSkeletonZaythalor(); break;

                                case 2: deadbody = new UnknownRogueSkeletonZaythalor(); break;

                                case 3: deadbody = new UnknownRogueSkeletonZaythalor(); break;
                                }

                                deadbody.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteDeadBody), deadbody);
                            }
                        }
                    }

                    PlayerMobile player1 = m as PlayerMobile;
                    QuestSystem  qs1     = player1.Quest;

                    if (qs1 is StolenNecklaceQuest)
                    {
                        if (qs1.IsObjectiveInProgress(typeof(ReturnStolenNecklaceObjective)))
                        {
                            m.Send(Network.PlayMusic.GetInstance(MusicName.StygianAbyss));
                            AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                        }
                    }

                    PlayerMobile player = m as PlayerMobile;
                    QuestSystem  qs     = player.Quest;

                    if (qs is StolenNecklaceQuest)
                    {
                        if (qs.IsObjectiveInProgress(typeof(ReturnStolenNecklaceObjective)))
                        {
                            // Brigand Ambush
                            if (Utility.RandomDouble() < 0.015)
                            {
                                if (m.Map == Map.Malas)
                                {
                                    int x1 = m.X + 20;
                                    int y1 = m.Y + 20;
                                    int z1 = Map.Malas.GetAverageZ(x1, y1);

                                    if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                                    {
                                        BaseCreature brigandmale = new BrigandMaleQuest();
                                        brigandmale.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);
                                        brigandmale.Combatant = m;
                                        m.Send(Network.PlayMusic.GetInstance(MusicName.StygianAbyss));

                                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                        Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteBrigandMale), brigandmale);
                                    }
                                }
                            }

                            // Brigand Ambush 2
                            if (Utility.RandomDouble() < 0.015)
                            {
                                if (m.Map == Map.Malas)
                                {
                                    int x2 = m.X - 20;
                                    int y2 = m.Y - 20;
                                    int z2 = Map.Malas.GetAverageZ(x2, y2);

                                    if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                                    {
                                        BaseCreature brigandfemale = new BrigandFemaleQuest();
                                        brigandfemale.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);
                                        brigandfemale.Combatant = m;
                                        m.Send(Network.PlayMusic.GetInstance(MusicName.StygianAbyss));

                                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                        Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteBrigandFemale), brigandfemale);
                                    }
                                }
                            }
                        }
                    }

                    else if (qs is StaffOfFlyingMonkeysQuest)
                    {
                        if (qs.IsObjectiveInProgress(typeof(EscapeObjective)))
                        {
                            // Mongbat Ambush
                            if (Utility.RandomDouble() < 0.015)
                            {
                                if (m.Map == Map.Malas)
                                {
                                    int x1 = m.X + 20;
                                    int y1 = m.Y + 20;
                                    int z1 = Map.Malas.GetAverageZ(x1, y1);

                                    if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                                    {
                                        BaseCreature cavernmongbatberserker = new CavernMongbatBerserkerQuest();
                                        cavernmongbatberserker.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);
                                        cavernmongbatberserker.Combatant = m;
                                        m.Send(Network.PlayMusic.GetInstance(MusicName.Medieval));

                                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                        Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteCavernMongbatBerserkerQuest), cavernmongbatberserker);
                                    }
                                }
                            }

                            // Mongbat Ambush 2
                            if (Utility.RandomDouble() < 0.015)
                            {
                                if (m.Map == Map.Malas)
                                {
                                    int x2 = m.X - 20;
                                    int y2 = m.Y - 20;
                                    int z2 = Map.Malas.GetAverageZ(x2, y2);

                                    if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                                    {
                                        BaseCreature cavernmongbatberserker = new CavernMongbatBerserkerQuest();
                                        cavernmongbatberserker.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);
                                        cavernmongbatberserker.Combatant = m;
                                        m.Send(Network.PlayMusic.GetInstance(MusicName.Medieval));

                                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                        Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteCavernMongbatBerserkerQuest), cavernmongbatberserker);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #26
0
 public Boar_StunState(FiniteStateMachine finiteStateMachine, Enemy entity, string animationBoolName, D_StunState stateData, Boar boar)
     : base(finiteStateMachine, entity, animationBoolName, stateData)
 {
     _boar = boar;
 }
Пример #27
0
        public void QuestTest()
        {
            QuestMatch match = new QuestMatch(logger: new Quest.Core.Logger("QuestTest"));
            Player     p1    = new Player("p1", match);
            Player     p2    = new Player("p2", match);
            Player     p3    = new Player("p3", match);
            Player     p4    = new Player("p4", match);

            match.AddPlayer(p1);
            match.AddPlayer(p2);
            match.AddPlayer(p3);
            match.AddPlayer(p4);

            QuestCard quest = new BoarHunt(match);

            match.CurrentStory = quest;

            quest.SponsorshipResponse(p1, true);

            Assert.IsTrue((match.CurrentStory as QuestCard).Sponsor == p1);

            quest.ParticipationResponse(p2, true);
            quest.ParticipationResponse(p3, true);
            quest.ParticipationResponse(p4, true);

            Assert.IsFalse(quest.Participants.Contains(p1));
            Assert.IsTrue(quest.Participants.Contains(p2));
            Assert.IsTrue(quest.Participants.Contains(p3));
            Assert.IsTrue(quest.Participants.Contains(p4));

            Boar  boar  = new Boar(match);
            Sword sword = new Sword(match);
            Horse horse = new Horse(match);

            p1.Hand.Add(new List <Card>()
            {
                boar, sword, horse
            });

            quest.AddFoeStage(boar, new List <WeaponCard>()
            {
                sword, horse
            });
            Assert.AreEqual(35, quest.GetStage(1).BattlePoints());

            Thieves thieves = new Thieves(match);

            p1.Hand.Add(thieves);
            quest.AddFoeStage(thieves);
            Assert.AreEqual(5, quest.GetStage(2).BattlePoints());

            p2.BattleArea.Add(new Sword(match));
            p2.BattleArea.Add(new Excalibur(match));
            p2.BattleArea.Add(new Dagger(match));
            p2.BattleArea.Add(new Horse(match));
            p2.BattleArea.Add(new Lance(match));
            p2.BattleArea.Add(new BattleAx(match));

            Assert.AreEqual(90, p2.BattleArea.BattlePoints());

            p3.BattleArea.Add(new Dagger(match));
            p3.BattleArea.Add(new Excalibur(match));

            Assert.AreEqual(35, p3.BattleArea.BattlePoints());

            p4.BattleArea.Add(new Sword(match));

            Assert.AreEqual(10, p4.BattleArea.BattlePoints());

            quest.Resolve();

            Assert.AreEqual(2, quest.CurrentStage);

            Assert.IsTrue(quest.Participants.Contains(p2));
            Assert.IsTrue(quest.Participants.Contains(p3));
            Assert.IsFalse(quest.Participants.Contains(p4));

            Assert.IsTrue(p2.BattleArea.Cards.Count == 0);
            Assert.IsTrue(p3.BattleArea.Cards.Count == 0);
            Assert.IsTrue(p4.BattleArea.Cards.Count == 0);

            p2.BattleArea.Add(new Dagger(match));

            Assert.AreEqual(5, p2.BattleArea.BattlePoints());

            quest.Resolve();

            Assert.IsTrue(quest.Participants.Contains(p2));
            Assert.IsFalse(quest.Participants.Contains(p3));

            Assert.AreEqual(0, p1.Rank.Shields);
            Assert.AreEqual(2, p2.Rank.Shields);
            Assert.AreEqual(0, p3.Rank.Shields);
            Assert.AreEqual(0, p4.Rank.Shields);

            Assert.AreEqual(6, p1.Hand.Count);
            Assert.AreEqual(1, p2.Hand.Count);
            Assert.AreEqual(1, p3.Hand.Count);
            Assert.AreEqual(0, p4.Hand.Count);
        }
Пример #28
0
        static void Main(string[] args)
        {
            Console.Title = "SAO DnD Project";
            Console.WriteLine("Welcome to the castle floating in the sky... Aincrad");

            int  levelsBeat     = 0;
            bool usedSwordSkill = false;
            bool usedHealing    = false;

            Console.WriteLine("Please enter the name you wish to go by in the game");
            string playerName = Console.ReadLine();

            // 1. Create the player - need to learn custom classes
            // 2. Create a weapon
            Weapon LongSword     = new Weapon(1, 8, "Long Sword", 10, false);
            Weapon GreatSword    = new Weapon(6, 15, "Greatsword", 5, true);
            Weapon Dagger        = new Weapon(1, 4, "Dagger", 25, false);
            Weapon MaceandShield = new Weapon(3, 10, "Mace and Shield", 15, true);

            Console.WriteLine("Choose a weapon type you would like to use on your quest to clear the game\nLongsword 1\nGreatsword 2\nDagger 3\nMace and Shield 4");
            string weaponChoice    = Console.ReadLine().ToUpper();
            bool   agile           = false;
            Weapon chosenWeapon    = null;
            bool   hasChosenWeapon = false;

            do
            {
                {
                    switch (weaponChoice)
                    {
                    case "1":
                    case "LONGSWORD":
                    case "L":
                        chosenWeapon    = LongSword;
                        hasChosenWeapon = true;
                        break;

                    case "2":
                    case "GREATSWORD":
                    case "G":
                        chosenWeapon    = GreatSword;
                        hasChosenWeapon = true;
                        break;

                    case "3":
                    case "DAGGER":
                    case "D":
                        chosenWeapon    = Dagger;
                        agile           = true;
                        hasChosenWeapon = true;
                        break;

                    case "4":
                    case "MACEANDSHIELD":
                    case "M":
                        chosenWeapon    = MaceandShield;
                        hasChosenWeapon = true;
                        break;

                    default:
                        Console.WriteLine("Input not recognized. Please enter a correct response");
                        hasChosenWeapon = false;
                        break;
                    }
                }
            } while (hasChosenWeapon == false);

            Player player      = new Player(playerName, 10, 15, 20, 20, chosenWeapon);
            int    playerLevel = 1;

            if (chosenWeapon == LongSword)
            {
                player.HitChance = 50;
                player.Block     = 15;
                player.Life      = 15;
                player.MaxLife   = 15;
            }
            if (chosenWeapon == GreatSword)
            {
                player.HitChance = 40;
                player.Block     = 10;
                player.Life      = 20;
                player.MaxLife   = 20;
            }
            if (chosenWeapon == Dagger)
            {
                player.HitChance = 60;
                player.Block     = 20;
                player.Life      = 12;
                player.MaxLife   = 12;
            }
            if (chosenWeapon == MaceandShield)
            {
                player.HitChance = 35;
                player.Block     = 30;
                player.Life      = 30;
                player.MaxLife   = 30;
            }
            //3. Create a loop for the room and monster

            bool exit = false;

            do
            {
                // 4. Create a room
                Console.WriteLine(GetRoom());
                // 5. Create a monster
                Skeleton   r1 = new Skeleton(); //uses the default ctor which sets some default values
                Skeleton   r2 = new Skeleton("Skeleton Hero", 30, 35, 18, 18, 3, 7, "A hero from a forgotten realm, risen from his grave.");
                Boar       r3 = new Boar();
                Boar       r4 = new Boar("Dire Boar", 20, 35, 20, 20, 2, 8, "A boar transformed by it's incredible rage, truly a dangerous foe");
                KoboldLord r5 = new KoboldLord();
                //all of our child monsters are of type mosnster so we can store them in an array
                Monster[] monsters = { r1, r1, r2, r3, r3, r4, r5 };

                //randomly select a monster
                Random  rand    = new Random();
                int     randNbr = rand.Next(monsters.Length);
                Monster monster = monsters[randNbr];

                Console.WriteLine("\nIn this room you find " + monster.Name);

                #region Menu Loop
                //TODO 6 Create a loop for menu of options
                bool reload = false;

                do
                {
                    #region Menu Switch
                    //7. Create a menu of options
                    Console.WriteLine("\nPlease choose an action:\nA) Attack\nS) Sword Skill \nR) Run Away\nP) Player Info\nM) Monster Info\nH) Heal\nX) Exit\n");

                    //8. cathc the the choice
                    ConsoleKey userChoice = Console.ReadKey(true).Key;
                    //9. Clear the console
                    Console.Clear();

                    //10. Build switch for user choice
                    switch (userChoice)
                    {
                    case ConsoleKey.A:
                        //11 handlle attack sequence
                        if (agile == true)
                        {
                            Combat.DoAttack(player, monster);
                        }
                        Combat.DoBattle(player, monster);
                        //12 handle player win
                        if (monster.Life <= 0)
                        {
                            //monster is dead
                            //could put in item drop, xp, or life gain
                            playerLevel            += 1;
                            Console.ForegroundColor = ConsoleColor.Green;
                            Console.WriteLine("\nWith the {0} Slain, you make your way 1 floor closer to the end.\n", monster.Name);
                            Console.ResetColor();
                            player.Life    = player.MaxLife;
                            usedSwordSkill = false;
                            usedHealing    = false;
                            reload         = true; //breaks us out of the inner loop but no the outer, will allow the player to continue on their journey
                            levelsBeat++;
                            if (levelsBeat >= 1)
                            {
                                player.Life      += 1;
                                player.MaxLife   += 1;
                                player.Block     += 1;
                                player.HitChance += 1;
                            }
                        }

                        break;

                    case ConsoleKey.S:
                        if (usedSwordSkill == true)
                        {
                            Console.WriteLine("You cannot use another sword skill during this combat.");
                        }
                        else
                        {
                            Console.WriteLine("You unleash a sword skill to do more damage");
                            player.EquippedWeapon.MinDamage      += 10;
                            player.EquippedWeapon.MaxDamage      += 10;
                            player.EquippedWeapon.BonusHitChance += 15;
                            Combat.DoAttack(player, monster);
                            player.EquippedWeapon.MinDamage      -= 10;
                            player.EquippedWeapon.MaxDamage      -= 10;
                            player.EquippedWeapon.BonusHitChance -= 15;
                            usedSwordSkill = true;
                        }
                        if (monster.Life <= 0)
                        {
                            //monster is dead
                            //could put in item drop, xp, or life gain
                            playerLevel            += 1;
                            Console.ForegroundColor = ConsoleColor.Green;
                            Console.WriteLine("\nWith the {0} Slain, you make your way 1 floor closer to the end.\n", monster.Name);
                            Console.ResetColor();
                            player.Life    = player.MaxLife;
                            usedSwordSkill = false;
                            usedHealing    = false;
                            reload         = true; //breaks us out of the inner loop but no the outer, will allow the player to continue on their journey
                            levelsBeat++;
                            if (levelsBeat >= 1)
                            {
                                player.Life      += 1;
                                player.MaxLife   += 1;
                                player.Block     += 1;
                                player.HitChance += 1;
                            }
                        }

                        break;

                    case ConsoleKey.R:
                        Console.WriteLine("So it seems your cowardly instincts have prevailed, how unfortunate.");
                        //todo handle the free attack
                        Console.WriteLine($"{monster.Name} attempts to attack as you run");
                        Combat.DoAttack(monster, player);
                        Console.WriteLine();
                        usedSwordSkill = false;
                        usedHealing    = false;
                        //14 exit inner loop and get a new room
                        reload = true;
                        break;

                    case ConsoleKey.P:
                        // 15. print out player info
                        Console.WriteLine("Player info");
                        Console.WriteLine(playerName);
                        Console.WriteLine(player);
                        Console.WriteLine("You are level " + playerLevel);
                        Console.WriteLine("Floors Cleared: " + levelsBeat);
                        break;

                    case ConsoleKey.M:
                        //todo print out monster info
                        Console.WriteLine("monster info");
                        Console.WriteLine(monster);
                        break;

                    case ConsoleKey.H:
                        if (usedHealing == true)
                        {
                            Console.WriteLine("You cannot use another Healing Crystal during this combat.");
                        }
                        else
                        {
                            player.Life             = player.MaxLife;
                            Console.ForegroundColor = ConsoleColor.Green;
                            Console.WriteLine("You take out a Healing Crystal and use it");
                            Console.ResetColor();
                            usedHealing = true;
                        }

                        break;

                    case ConsoleKey.X:
                    case ConsoleKey.E:
                        Console.WriteLine("After unequipping your weapon, you slowly end up rotting away in the Town of Beginnings");
                        exit = true;
                        break;

                    default:
                        Console.WriteLine("learn to type bruh");
                        break;
                    }
                    #endregion

                    //todo 17 check life before continuing
                    if (player.Life <= 0)
                    {
                        Console.WriteLine("As your Health Bar is Depleted your body disappears and your vision goes black\a");
                        exit = true; //break out of both loops
                    }
                    if (levelsBeat == 100)
                    {
                        Console.WriteLine("As you defeat the final enemy a giant Game Cleared sign appears before you and you open your eyes to see the real world\a");
                        exit = true; //break out of both loops
                    }
                    if (levelsBeat == 20 && levelsBeat == 40 && levelsBeat == 60 && levelsBeat == 80)
                    {
                        r1.Life      += 5;
                        r1.MaxLife   += 5;
                        r1.Block     += 5;
                        r1.HitChance += 5;
                        r1.MinDamage += 2;
                        r1.MaxDamage += 4;
                        r2.Life      += 5;
                        r2.MaxLife   += 5;
                        r2.Block     += 5;
                        r2.HitChance += 5;
                        r2.MinDamage += 2;
                        r2.MaxDamage += 4;
                        r3.Life      += 3;
                        r3.MaxLife   += 3;
                        r3.Block     += 7;
                        r3.HitChance += 3;
                        r3.MinDamage += 3;
                        r3.MaxDamage += 5;
                        r4.Life      += 4;
                        r4.MaxLife   += 4;
                        r4.Block     += 8;
                        r4.HitChance += 4;
                        r4.MinDamage += 3;
                        r4.MaxDamage += 5;
                        r5.Life      += 5;
                        r5.MaxLife   += 5;
                        r5.Block     += 10;
                        r5.HitChance += 5;
                        r5.MinDamage += 1;
                        r5.MaxDamage += 3;
                    }
                    if (levelsBeat == 25 && chosenWeapon == LongSword)
                    {
                        Console.WriteLine("On the 25th floor you find a Dark Steel Longsword and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 3;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 50 && chosenWeapon == LongSword)
                    {
                        Console.WriteLine("On the 50th floor you find a Holy Steel Longsword and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 4;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 75 && chosenWeapon == LongSword)
                    {
                        Console.WriteLine("On the 75th floor you find the Elucidator and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 4;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 25 && chosenWeapon == GreatSword)
                    {
                        Console.WriteLine("On the 25th floor you find a Dark Steel Greatsword and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 3;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 50 && chosenWeapon == GreatSword)
                    {
                        Console.WriteLine("On the 50th floor you find a Holy Steel Greatsword and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 4;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 75 && chosenWeapon == GreatSword)
                    {
                        Console.WriteLine("On the 75th floor you find the Doomblade and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 4;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 25 && chosenWeapon == Dagger)
                    {
                        Console.WriteLine("On the 25th floor you find a Dark Steel Dagger and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 3;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 50 && chosenWeapon == LongSword)
                    {
                        Console.WriteLine("On the 50th floor you find a Holy Steel Dagger and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 4;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 75 && chosenWeapon == LongSword)
                    {
                        Console.WriteLine("On the 75th floor you find the Assassin's Dirk and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 4;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 25 && chosenWeapon == MaceandShield)
                    {
                        Console.WriteLine("On the 25th floor you find a Dark Steel Mace and Shield and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 3;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 50 && chosenWeapon == MaceandShield)
                    {
                        Console.WriteLine("On the 50th floor you find a Holy Steel Mace and Shield and Equip it.\n");
                        player.EquippedWeapon.MinDamage      += 4;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                    if (levelsBeat == 75 && chosenWeapon == MaceandShield)
                    {
                        Console.WriteLine("On the 75th floor you find the Demon's Cudgel and Shield and Equip them.\n");
                        player.EquippedWeapon.MinDamage      += 4;
                        player.EquippedWeapon.MaxDamage      += 4;
                        player.EquippedWeapon.BonusHitChance += 5;
                    }
                } while (!exit && !reload);
                #endregion
            } while (!exit); //while exit is false it will loop

            Console.WriteLine("You cleared " + levelsBeat + " floor" + (levelsBeat == 1 ? "." : "s."));
        }
Пример #29
0
 // Use this for initialization
 void Start()
 {
     boar = transform.parent.gameObject.GetComponent <Boar>();
 }
Пример #30
0
 public Boar_SlowDownState(FiniteStateMachine finiteStateMachine, Entity entity, string animationBoolName, D_SlowDownState stateData, Boar boar)
     : base(finiteStateMachine, entity, animationBoolName, stateData)
 {
     this.boar = boar;
 }
 public Boar_PlayerDetectedState(FiniteStateMachine finiteStateMachine, Entity entity, string animationBoolName, D_PlayerDetectedState stateData, Boar boar)
     : base(finiteStateMachine, entity, animationBoolName, stateData)
 {
     this.boar = boar;
 }