Esempio n. 1
0
 public Enemy(int x, int y) : base(Sprite.Sprites["enemy2"], x, y, 16, 16)
 {
     combo     = new AttackCombo(3, 30);
     walkCycle = 2;
     SkillBook = new SkillBook(
         SkillManager.Instance["heavy"].CreateNew(),
         SkillManager.Instance["block"].CreateNew());
 }
Esempio n. 2
0
 public Player(int x, int y, int keyController, int mouseController) : base(Sprite.Sprites["player2"], x, y, 16, 16)
 {
     this.keyController   = keyController;
     this.mouseController = mouseController;
     combo     = new AttackCombo(3, 15);
     SkillBook = new SkillBook(
         SkillManager.Instance["heavy"].CreateNew(),
         SkillManager.Instance["block"].CreateNew(),
         SkillManager.Instance["counter"].CreateNew(),
         SkillManager.Instance["ranged"].CreateNew());
     Hotbar = new Hotbar(
         SkillBook["heavy"],
         SkillBook["block"],
         SkillBook["counter"],
         SkillBook["ranged"]
         );
     walkCycle = 4;
 }
Esempio n. 3
0
        public bool Tick(Location location, Entity entity)
        {
            ImageIndex = direction + ((int)walkIndex % walkCycle);

            if (!IsDead() && balance < 100 && (!animations.Any() || !animations.Peek().Peek().Name.Contains("back")))
            {
                balance++;
            }

            if (stamina < 30)
            {
                stamina += 1.0f / Program.TPS / 2.5f;
            }

            SkillBook.Tick();

            if (combo.IsStarted() && ((animations.Any() && !(animations.Peek().Peek() is AttackAnimation)) || !animations.Any()) && combo.Tick())
            {
                combo.Reset();
            }

            if (stun > 0)
            {
                stun--;
            }

            if (PreppedSkill != null)
            {
                skillActivation.Tick(this);
            }

            if (animations.Any())
            {
                if (stun > 0 && animations.Peek().Peek().IsInterruptable())
                {
                    return(true);
                }

                AnimationChain chain = animations.Peek();
                if (animations.Peek().Tick(this))
                {
                    if (chain == animations.Peek())
                    {
                        animations.Peek().Pop();
                    }

                    if (!animations.Peek().Any())
                    {
                        animations.Pop();
                    }
                }

                if (animations.Any() && animations.Peek().Peek().IsPausing())
                {
                    return(true);
                }
            }

            if (health <= 0)
            {
                return(true);
            }

            return(false);
        }