Beispiel #1
0
        private void DoActiveTick(Pawn owner)
        {
            Vector3 attackDir = new Vector3(Mathf.Sin(owner.yaw), 0, Mathf.Cos(owner.yaw));
            Vector3 attackPos = owner.waistPosition() + attackDir * data.attacks[attackHand].range;
            bool    hit       = false;

            foreach (var c in owner.world.GetActorIterator <Pawn>())
            {
                if (c.team != owner.team && c.active && !hitTargets.Contains(c))
                {
                    if (CheckIfHit(owner, attackPos, attackDir, owner.position, c))
                    {
                        hit = true;
                        hitTargets.Add(c);
                    }
                }
            }

            if (_damageIndicator != null)
            {
                _damageIndicator.Tick(attackPos, hit);
            }
        }