Exemplo n.º 1
0
 public void MoveL()
 {
     this.Moving = true;
     //checks if at edge of screen
     if (this.Position > 1)
     {
         //don't need to check if enemy behind
         if (this.AtkCharged == false)
         {
             //as animation has position of square it goes to
             Animate.ControlableEntityAni(this.Position - 1, this.Position - 1, Animations.PlayerAni("WalkLeft"), 80);
         }
         else
         {
             Animate.ControlableEntityAni(this.Position - 1, this.Position - 1, Animations.PlayerAni("WalkLeftHammerUp"), 80);
         }
         this.Position--;
         MainClass.PlayerEventSystem.MadeMove("left");
     }
     else
     {
         //loads the prev screen if conditions met - enemies = 0, is at edge of screen, not at start of game
         MainClass.GameMap.PrevScreen();
     }
 }
Exemplo n.º 2
0
 public void dead()
 {
     if (this.living == false)
     {
         Animate.ControlableEntityPlace(this.Position, Art.Enemy("blankH"));
         MainClass.PlayerEventSystem.MadeCombatMove -= PlayerEventSystem_MadeCombatMove;
     }
 }
Exemplo n.º 3
0
        public void RenderEntity(int PlusPos = 0)
        {
            var StanceName = this.Name;

            //make it 1 down?
            if (this.Name == "Player")
            {
                if (Moving == true)
                {
                    StanceName += "Moving";
                }
                if (this.AtkCharged == true)
                {
                    StanceName += "HammerUp";
                }
            }
            Animate.ControlableEntityPlace(this.Position + PlusPos, Art.Enemy(StanceName));
        }
Exemplo n.º 4
0
        public void Attack()
        {
            this.Moving = false;
            //note it is a charge attack
            if (this.AtkCharged == false)
            {
                //lift hammer up
                this.AtkCharged = true;
                Animate.ControlableEntityAni(this.Position, this.Position, Animations.PlayerAni("LiftHammer"));
            }
            else
            {
                //swing hammer
                this.AtkCharged = false;
                Animate.ControlableEntityAni(this.Position, this.Position, Animations.PlayerAni("Bonk"), 80);

                //as can't change list while in foreach loop create new list
                List <Enemy> EtoCheck = new List <Enemy>()
                {
                };
                foreach (Enemy ETA in MainClass.GameMap.CurrentEnemies)
                {
                    EtoCheck.Add(ETA);
                }
                foreach (Enemy EnemyToAttack in EtoCheck)
                {
                    if (this.Position == EnemyToAttack.Position - 1)
                    {
                        if (EnemyToAttack.PlanedMove == "dodge")
                        {
                            EnemyToAttack.MakeMove();
                            EnemyToAttack.TakeDamage(this.Strength, this.BaseDamage);
                        }
                        else
                        {
                            EnemyToAttack.TakeDamage(this.Strength, this.BaseDamage);
                        }
                    }
                }
            }
            this.Moving = true;
            MainClass.PlayerEventSystem.MadeMove("attack");
        }
Exemplo n.º 5
0
        public void MakeMove()
        {
            //clears Planned move
            if (this.CentredAboveEnemy != 0 && this.OneLineAboveEnemy != 0)
            {
                Console.SetCursorPosition(this.CentredAboveEnemy, this.OneLineAboveEnemy);
                Console.WriteLine($"{new String(' ', this.PlanedMoveChar.Length)}");
            }
            else
            {
                //MakeErrorMessage("Enemy indicatior not right");
            }
            //remember player moves then enemy
            //ADD animations
            switch (this.PlanedMove.ToLower())
            {
            case "dodge":
                //this.Dodging = true;
                System.Diagnostics.Debug.Write("D");
                break;

            case "debuff":
                //do nothing
                break;

            case "move":
                //this.Position -= 1; not working
                Animate.ControlableEntityPlace(this.Position, Art.Enemy("blank"));
                bool spaceInfrontAvalible = true;
                foreach (Enemy spaceInfrontAvalibleToCheck in MainClass.GameMap.CurrentEnemies)
                {
                    if (spaceInfrontAvalibleToCheck.Position == this.Position - 1)
                    {
                        spaceInfrontAvalible = false;
                    }
                }
                if (MainClass.Player_1.Position != this.Position - 1 && spaceInfrontAvalible)
                {
                    this.Position -= 1;
                }
                else /*System.Diagnostics.Debug.WriteLine("Can't move there player or enemy is there");*/ } {
                this.RenderEntity();
                break;
Exemplo n.º 6
0
 public void MoveR()
 {
     this.Moving = true;
     //checks if at edge of screen
     if (this.Position < 6)
     {
         bool EnemyInfront = false;
         foreach (var ens in MainClass.GameMap.CurrentEnemies)
         {
             //checks if enemy is infront of player
             if (ens.Position == this.Position + 1)
             {
                 EnemyInfront = true;
                 Log.UpdateLog("can't move into Enemy");
             }
         }
         if (!EnemyInfront)
         {
             if (this.AtkCharged == false)
             {
                 Animate.ControlableEntityAni(this.Position, this.Position + 1, Animations.PlayerAni("WalkRight"), 80);
             }
             else
             {
                 Animate.ControlableEntityAni(this.Position, this.Position + 1, Animations.PlayerAni("WalkRightHammerUp"), 80);
             }
             this.Position++;
             MainClass.PlayerEventSystem.MadeMove("right");
         }
     }
     else
     {
         //loads the next screen if conditions met - enemies = 0, is at edge of screen, not at end of game
         MainClass.GameMap.NextScreen();
     }
 }