Beispiel #1
0
        public Projectile(
            Game game,
            float x,
            float y,
            int collisionRadius,
            AttackableUnit owner,
            Target target,
            Spell originSpell,
            float moveSpeed,
            string projectileName,
            int flags  = 0,
            uint netId = 0
            ) : base(game, x, y, collisionRadius, 0, netId)
        {
            SpellData    = _game.Config.ContentManager.GetSpellData(projectileName);
            _originSpell = originSpell;
            _moveSpeed   = moveSpeed;
            Owner        = owner;
            Team         = owner.Team;
            ProjectileId = (int)HashFunctions.HashString(projectileName);
            if (!string.IsNullOrEmpty(projectileName))
            {
                VisionRadius = SpellData.MissilePerceptionBubbleRadius;
            }
            ObjectsHit = new List <GameObject>();

            Target = target;

            if (!target.IsSimpleTarget)
            {
                ((GameObject)target).IncrementAttackerCount();
            }

            owner.IncrementAttackerCount();
        }