Esempio n. 1
0
 public override void ChangeState(State state)
 {
     //player.input.OnKeyDown -= HandleKeyDownInput;
     //player.input.OnKeyRelease -= HandleKeyReleaseInput;
     if (pulledPlayer != null) { pulledPlayer.isCaught = false; }
     base.ChangeState(state);
 }
Esempio n. 2
0
        public override void ChangeState(State state)
        {
            // unlisten
            player.input.OnKeyDown -= HandleKeyDownInput;

            base.ChangeState(state);
        }
Esempio n. 3
0
        public override void isHit(BoxingPlayer attackingPlayer, State expectedHitState, int damage)
        {
            // Nothing happens! You can't phase me bro!

            // unless you're shoot'n me!
            if ((attackingPlayer.state is StateRevolverShoot))
            {
                base.isHit(attackingPlayer, expectedHitState, damage);
            }
            // well timed? Duck and weave!
            else if (dodgeThreshold > 0)
            {
                ChangeState(new StateDodge(player));
                attackingPlayer.state.wasDodged();
            }

            // just get knocked back a little
            else if (!(attackingPlayer.state is StateRevolverShoot) && timer <= 0)
            {
                if ((player.direction == 1 && player.position.X < attackingPlayer.position.X)
                || (player.direction == -1 && player.position.X > attackingPlayer.position.X))
                {
                    timer = waitTime;
                    player.position.X += attackingPlayer.direction * hitVelocity;

                    // and some chip damage
                    //player.CurrentHealth -= 1;
                }
                else
                {
                    // You're facing the wrong way and get knocked down, homie!
                    base.isHit(attackingPlayer, expectedHitState, damage);
                }
            }
        }
 public StateBowlerHatCatch(BoxingPlayer player, BowlerHatInstance hat, State originalState)
     : base(player, "BowlerCatch")
 {
     this.hat = hat;
     this.originalState = originalState;
     player.hasThrownBowlerHat = false;
 }
Esempio n. 5
0
        public override void ChangeState(State state)
        {
            player.input.OnKeyDown -= HandleKeyDownInput;
            player.input.OnKeyRelease -= HandleKeyReleaseInput;

            base.ChangeState(state);
        }
Esempio n. 6
0
 /// <summary>
 /// If we're hit 5 times by the revolver, we get knocked down!
 /// </summary>
 /// <param name="attackingPlayer"></param>
 public override void isHit(BoxingPlayer attackingPlayer, State expectedHitState, int damage)
 {
     if (timer > 0)
     {
         hitCounter++;
         timer = time;
         player.sprite.FrameIndex = 0;
         player.CurrentHealth -= damage / 2;
     }
 }
Esempio n. 7
0
 public override void isHit(BoxingPlayer attackingPlayer, State expectedHitState, int damage)
 {
     //If you get jumped on, you get knocked down!
     if (attackingPlayer.state is StateFall || attackingPlayer.isFalling)
     {
         ChangeState(new StateKnockedDown(player, 0, false));
     }
     else if (attackingPlayer.state is StateCaneBonk)
     {
         base.isHit(attackingPlayer, new StateKnockedDown(player, 0, false), damage);
     }
 }
Esempio n. 8
0
 public virtual void ChangeState(State state)
 {
     if (player.isAirborn && state is StateStopped)
     {
         ChangeState(new StateJump(state.player, true));
         //player.ChangeAnimation(s.key);
         //player.state = s;
     }
     else
     {
         player.ChangeAnimation(state.key);
         player.state = state;
     }
 }
Esempio n. 9
0
        /// <summary>
        /// If we're hit twice in a row, we get knocked down!
        /// </summary>
        /// <param name="attackingPlayer"></param>
        public override void isHit(BoxingPlayer attackingPlayer, State expectedHitState, int damage)
        {
            if (timer <= 0)
            {

                ChangeState(new StateKnockedDown(player, attackingPlayer.direction, true));
                player.CurrentHealth -= damage;

                if(attackingPlayer.state is StateCaneBonk)
                    player.soundEffects["CaneHit"].Play(); // play the sound effect!
                //else
                    //player.soundEffects["

                timer = time;
            }
        }
Esempio n. 10
0
        /// <summary>
        /// If we're hit twice in a row, we get knocked down!
        /// </summary>
        /// <param name="attackingPlayer"></param>
        public override void isHit(BoxingPlayer attackingPlayer, State expectedHitState, int damage)
        {
            if (timer <= 0)
            {
                // well timed? Duck and weave!
                if (dodgeTimer > 0)
                {
                    ChangeState(new StateDodge(player));
                    attackingPlayer.state.wasDodged();
                }
                else
                {
                    hitCounter++;
                    PlaySound(player.soundEffects["Hit"]); // play the sound effect!

                }
            }

            if (hitCounter >= 1)
            {
                ChangeState(new StateKnockedDown(player, attackingPlayer.direction,true));
                player.CurrentHealth -= 20;
            }
        }
Esempio n. 11
0
 // Not even items!
 public override void isHitByItem(ItemInstance item, State expectedHitState)
 {
     // base.isHitByItem(item, expectedHitState);
 }
Esempio n. 12
0
 // if you're knocked down, nothing can hit you
 public override void isHit(BoxingPlayer attackingPlayer, State expectedHitState, int damage)
 {
 }
Esempio n. 13
0
 public override void ChangeState(State state)
 {
     player.currentHorizontalSpeed = -knockbackVelocity;
     base.ChangeState(state);
 }
Esempio n. 14
0
        /// <summary>
        /// Handles any effects to this player.
        /// </summary>
        /// <param name="attackingPlayer"></param>
        public virtual void isHit(BoxingPlayer attackingPlayer, State expectedHitState, int damage)
        {
            //Debug.WriteLine("isHit virtual!");

            if (attackingPlayer.state.isAttack || attackingPlayer.state is StateRevolverShoot)
                player.CurrentHealth -= damage;

            if (player.CurrentHealth <= 0)
                player.state.ChangeState(new StateKnockedDown(player, attackingPlayer.direction, true));
            else
                player.state.ChangeState(expectedHitState);
        }
Esempio n. 15
0
 public override void isHit(Auction_Boxing_2.BoxingPlayer attackingPlayer, State expectedHitState, int damage)
 {
     ChangeState(new StateKnockedDown(player,attackingPlayer.direction, true));
 }
Esempio n. 16
0
        public override void isHitByItem(ItemInstance item, State expectedHitState)
        {
            if (timer <= 0)
            {
                // well timed? Duck and weave!
                if (dodgeTimer > 0)
                {
                    ChangeState(new StateDodge(player));
                    //attackingPlayer.state.wasDodged();
                }
                else
                {
                    hitCounter++;
                    PlaySound(player.soundEffects["Hit"]); // play the sound effect!

                }
                timer = time;
            }

            if (hitCounter >= 1)
            {
                ChangeState(new StateKnockedDown(player, item.moveDirection, true));
                player.CurrentHealth -= 20;
            }

            //base.isHitByItem(item, expectedHitState);
        }
Esempio n. 17
0
        public virtual void isHitByItem(ItemInstance item, State expectedHitState)
        {
            player.CurrentHealth -= item.damage;

            if(player.CurrentHealth <= 0 || player.state is StateJump)
                player.state.ChangeState(new StateKnockedDown(player, item.moveDirection, true));
            else
                player.state.ChangeState(expectedHitState);
        }