public HomingProjectile(Game game, Creature target, Creature attacker, OnHitProjectileDelegate onHitDelegate) : base(game, attacker, onHitDelegate) { this.target = target; this.duration = null; onHit = onHitDelegate; }
public bool PreviouslyHarmed(Creature creature) { if (harmedCreatures.Contains(creature)) return true; harmedCreatures.Add(creature); return false; }
protected void volleyOnHit(Projectile projectile, Creature target) { if(!data.PreviouslyHarmed(target)) { target.takePhysicalDamage(damage, attacker.getFlatArmorPen(), attacker.getPercArmorPen()); target.buffs.Add(frostShot.getFrostDebuff(target)); } }
public VolleyProjectile(Game game, Creature attacker, FrostShot frostShot, float damage, float duration, AreaOfEffectTracker data) : base(game, attacker, null) { this.frostShot = frostShot; this.damage = damage; this.duration = TimeSpan.FromSeconds(duration); this.data = data; onHit = volleyOnHit; }
public Buff(Creature entity) { entity.buffs.Add(this); this.creature = entity; name = string.Empty; texture = null; debuff = false; duration = null; dispelable = true; modifiedStats = new List<ModifiedStat>(); }
public static Entity.SpriteDirection GetTargetDirection(Creature creature) { float targetAngle = GetTargetAngle(creature); if (targetAngle < Math.PI / 2 && targetAngle > -Math.PI / 2) return Entity.SpriteDirection.Right; return Entity.SpriteDirection.Left; }
public static float GetTargetAngle(Creature creature) { return (float)Math.Atan2((double)(creature.target.DisplayPosition.Y - creature.DisplayPosition.Y), (double)(creature.target.DisplayPosition.X - creature.DisplayPosition.X)); }
public void setTeam(Creature.Team team) { this.creature.team = team; }
public EnchantedCrystalArrowProjectile(Game game, Creature attacker, float damage, float duration, OnHitProjectileDelegate onHit) : base(game, attacker, onHit) { this.damage = damage; this.duration = TimeSpan.FromSeconds(duration); }
protected void onHit(Projectile projectile, Creature target) { target.takePhysicalDamage(getDamage(), getFlatArmorPen(), getPercArmorPen()); }
public void OnAttack(Creature target) { e.target = target; Attack(this, e); }
public Projectile(Game game, Creature attacker, OnHitProjectileDelegate onHit) : base(game) { this.attacker = attacker; this.onHit += onHit; }
public Buffs.Frost getFrostDebuff(Creature target) { return new Buffs.Frost(target, level); }