Exemplo n.º 1
0
        public override void OnActivate(Microsoft.Xna.Framework.GameTime gameTime, ArmorPotionFramework.EntityClasses.Player activatedBy)
        {
            if (!_hasProjectile)
            {
                _currentWaitTime = _maxWaitTime;

                ThrowProjectile projectile = new ThrowProjectile(
                    activatedBy.World,
                    this,
                    ProjectileTarget.Enemy,
                    _eventType,
                    false,
                    this.CenterEntity(activatedBy),
                    _throwDistance,
                    MathHelper.ToRadians((int)activatedBy.CurrentSprite.CurrentAnimation * 90),
                    _projectileDistance,
                    _spreadAngle,
                    _revolutions,
                    _projectilesPerIteration,
                    true,
                    _aoeDestination,
                    _aoeLife);

                projectile.DamageAmount = 5;

                if (_eventType == EventType.LightningEvent)
                    projectile.DamageAmount = 25;
                else if (_eventType == EventType.IceEvent)
                    projectile.DamageAmount = 3;

                projectile.AnimatedSprites.Add("Normal", AnimatedSprite);
                projectile.AnimatedSprites.Add("Projectile", _secondaryProjectileSprite);

                activatedBy.World.Projectiles.Add(projectile);

                _hasProjectile = true;
            }
        }