Esempio n. 1
0
        protected override void Hit(Actor actor)
        {
            var attackDirection       = (this.Location - actor.Location).Unit();
            var actorStartingLocation = actor.Location;

            this.Momentum += 1;
            actor.Move(-1 * attackDirection);
            if (game.CurrentPhase == Game.TurnPhases.Enemy)
            {
                // Cancel attack move - 'cause parried (most likely)
                actor.NextMove = Action.Wait;
            }
            if (actorStartingLocation == actor.Location)
            {
                if (game.CurrentPhase == Game.TurnPhases.Player)
                {
                    Location = actorStartingLocation + attackDirection;
                }
            }
            else
            {
                if (game.CurrentPhase == Game.TurnPhases.Player)
                {
                    Location = actorStartingLocation;
                }
                // Stun longer, if you hit them into something
                actor.Stun(1);
            }
            actor.GotHit(Math.Max(Momentum, 1));
        }
Esempio n. 2
0
        protected override void Hit(Actor actor)
        {
            toAttack = false;
            var thisdmg = dmg;

            if (actor.Location.Adjacent(Location))
            {
                for (var i = 0; i < pushDistance; ++i)
                {
                    // Enemy pushes away when hitting
                    var attackDirection       = (this.Location - actor.Location).Unit();
                    var actorStartingLocation = actor.Location;
                    actor.Move(-1 * attackDirection);
                    if (actorStartingLocation == actor.Location)
                    {
                        // More damage, if hit into something
                        thisdmg += 1;
                    }
                }
                actor.GotHit(dmg);
                if (stunTime != 0)
                {
                    actor.Stun(stunTime);
                }
            }
            ;
        }