Beispiel #1
0
        /*public bool Parry(RectangleF hitmask)
         * {
         *  //new RectangleDebug(World, hitmask, Color.Orange, 20);
         *  var affectedHitboxes = World.FindBoxes(hitmask);
         *  foreach (Box Box in affectedHitboxes)
         *  {
         *      if (Box.Data is Enemy enemy && enemy.Attacking)
         *      {
         *          if (Box.Data == this)
         *              continue;
         *          PlaySFX(sfx_sword_bink, 1.0f, -0.3f, -0.5f);
         *          World.Hitstop = 15;
         *          Invincibility = 10;
         *          if (OnGround)
         *          {
         *              Velocity += GetFacingVector(Facing) * -2;
         *          }
         *          else
         *          {
         *              ExtraJumps = Math.Max(ExtraJumps, 1);
         *              Velocity.Y = 0;
         *          }
         *          new ParryEffect(World, Vector2.Lerp(Box.Bounds.Center, Position, 0.5f), 0, 10);
         *          return true;
         *      }
         *  }
         *
         *  return false;
         * }*/

        public override void ParryGive(IParryReceiver receiver, RectangleF box)
        {
            if (CurrentAction is ActionAttack attack)
            {
                attack.ParryGive(receiver);
            }
            Invincibility = 10;
            Hitstop       = 20;
        }
Beispiel #2
0
        public static bool Parry(IParryGiver giver, IParryReceiver receiver, RectangleF box)
        {
            if (giver != receiver && receiver.CanParry)
            {
                giver.ParryGive(receiver, box);
                receiver.ParryReceive(giver, box);
                return(true);
            }

            return(false);
        }
 public abstract void ParryGive(IParryReceiver receiver);
Beispiel #4
0
 public virtual void ParryGive(IParryReceiver receiver, RectangleF box)
 {
     //NOOP
 }
 public override void ParryGive(IParryReceiver receiver)
 {
 }
Beispiel #6
0
 public override void ParryGive(IParryReceiver receiver)
 {
     SwingVisual(Parried);
     SlashAction = SwingAction.DownSwing;
 }
Beispiel #7
0
 public override void ParryGive(IParryReceiver receiver)
 {
     PunchVisual();
     PunchAction = PunchState.PunchEnd;
 }
Beispiel #8
0
 public override void ParryGive(IParryReceiver receiver)
 {
     Steal();
 }