public override void OnActivate(GameTime gameTime, ArmorPotionFramework.EntityClasses.Player activatedBy) { if (!_hasProjectile) { AreaOfEffectProjectile projectile = new AreaOfEffectProjectile(activatedBy.World, this, ProjectileTarget.Enemy, ArmorPotionFramework.TileEngine.EventType.LightningEvent, false, CenterEntity(activatedBy), 3000); projectile.AnimatedSprites.Add("Normal", AnimatedSprite); activatedBy.World.Projectiles.Add(projectile); _hasProjectile = true; } }
public override void OnActivate(GameTime gameTime, ArmorPotionFramework.EntityClasses.Player activatedBy) { _currentWaitTime -= gameTime.ElapsedGameTime.Milliseconds; if (_currentWaitTime < 0) { _currentWaitTime = _maxWaitTime; ConeProjectile projectile = new ConeProjectile(activatedBy.World, this, ProjectileTarget.Enemy, EventType.FireEvent, false, 75, CenterEntity(activatedBy), MathHelper.ToRadians((int)activatedBy.CurrentSprite.CurrentAnimation * 90), Math.PI / 4); projectile.AnimatedSprites.Add("Normal", AnimatedSprite); activatedBy.World.Projectiles.Add(projectile); } }
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; } }
public override void ConsumedBy(ArmorPotionFramework.EntityClasses.Player player) { player.Health.Damage(25); }
public override void OnUnEquip(ArmorPotionFramework.EntityClasses.Player removedBy) { }
public void SetUp(ArmorPotionFramework.EntityClasses.Enemy enemy) { _lifetime = _defaultLifetime; _waitTime = _defaultWaitTime; AnimationKey currentAnimation = enemy.CurrentSprite.CurrentAnimation; enemy.CurrentSpriteKey = "Charging"; enemy.CurrentSprite.IsAnimating = true; enemy.CurrentSprite.CurrentAnimation = currentAnimation; }
public void Update(Microsoft.Xna.Framework.GameTime gameTime, ArmorPotionFramework.EntityClasses.Enemy enemy) { bool canAttack = WaitTimer(gameTime); if (canAttack && !_isSetUp) { Vector2 newPosition = new Vector2(enemy.Position.X - enemy.CurrentSprite.Width / 2, enemy.Position.Y - enemy.CurrentSprite.Height / 2); Animation animation = new Animation(1, 256, 256, 0, 0); _projectile = new AreaOfEffectProjectile(enemy.World, null, ProjectileTarget.Player, EventType.LightningEvent, false, newPosition, _defaultLifetime); _projectile.AnimatedSprites.Add("Normal", _sprite.Clone()); _projectile.DamageAmount = _aoeDamage; enemy.World.Projectiles.Add(_projectile); _lifetime = _defaultLifetime; _isSetUp = true; enemy.CurrentSpriteKey = "Walking"; } else if(canAttack && _isSetUp) { _lifetime -= gameTime.ElapsedGameTime.Milliseconds; if (_lifetime < 0) { _isSetUp = false; enemy.ActionComplete(); } } }
public override void OnActivate(Microsoft.Xna.Framework.GameTime gameTime, ArmorPotionFramework.EntityClasses.Player activatedBy) { }
public override void OnUnEquip(ArmorPotionFramework.EntityClasses.Player removedBy) { removedBy.Health.ChangeMaxRelative(-200); }
public void LockToSprite(ArmorPotionFramework.EntityClasses.Player player) { Vector2 playerPositon = player.Position; Vector2 playerTranslation = player.CurrentTranslation; Vector2 currentWidthHeight = new Vector2(player.CurrentSprite.Width, player.CurrentSprite.Height); _cameraX = (playerPositon.X + currentWidthHeight.X / 2) - (_viewportRectangle.Width / 2) + playerTranslation.X; _cameraY = (playerPositon.Y + currentWidthHeight.Y / 2) - (_viewportRectangle.Height / 2) + playerTranslation.Y; LockCamera(); }