Example #1
0
 public ComEntityMoveTo(ComEntity comEntity, Point moveTo, bool movingWithDeathInMind, string moverUserName = null)
     : base(comEntity)
 {
     this.moveTo                = moveTo;
     this.moverUserName         = moverUserName;
     this.movingWithDeathInMind = movingWithDeathInMind;
 }
Example #2
0
        public void DoReceiveAttack(object[] args)
        {
            string userName = (string)args[0];

            if (userName == TwitchUserComEntityData.TwitchUserName)
            {
                return;
            }
            ComEntity attacker = (ComEntity)args[1];

            if (FP.Distance(X, Y, attacker.X, attacker.Y) < 60)
            {
                Interrupt();
                //hitVector

                var hitDistance = FP.Scale(TwitchUserComEntityData.Damage, DamageMin, DamageMax, HitDistanceMin, HitDistanceMax);
                TwitchUserComEntityData.Damage += DamageAmount;
                QueueCommand(new ComEntityMoveTo(this, (new Point(X, Y) + new Point(X - attacker.X, Y - attacker.Y).Normalized() * hitDistance), true, userName));
            }
        }
Example #3
0
 public ComEntityCommand(ComEntity comEntity)
 {
     this.comEntity = comEntity;
 }