public Projectile(Projectile attack, Actor source) : base(attack, source) { knockback = attack.knockback; particle = new ProjectileParticle(Global.particleManager.Get(key), new Vector2(source.col_rect.Center.X, source.col_rect.Bottom), direction); if (attack.knockback) source.velocity = -particle.velocity; }
public Attack(Attack attack, Actor source) : base(attack) { attackType = attack.attackType; damage = attack.damage; sourceUnit = source.unitType; source.curAnim = key; direction = Global.getVectorAngle(source.direction); if (this.GetType() != typeof(CollisionDamage)) source.SetAttackTimer(attack.cooldown); }
public DamageEffect(Actor source) { alpha = (float)(removeTimer.Interval); sprite = Global.spriteManager.dict["damage_effect"].Get("damage_effect1"); removeTimer.AutoReset = false; removeTimer.Elapsed += new ElapsedEventHandler(removeTimer_Elapsed); removeTimer.Start(); imgpos.X = source.col_rect.Center.X - sprite.rect.Width / 2 + Global.random.Next(-10, 10); imgpos.Y = source.col_rect.Center.Y - sprite.rect.Height / 2 + Global.random.Next(-5, 5); depth = (imgpos.Y + sprite.texture.Height + 1) * 0.0001f; }
public ChargeAttack(ChargeAttack chargeAttack, Actor source) { startKey = chargeAttack.startKey; attackKey = chargeAttack.attackKey; /* switch (Global.attackManager.dict[source.key].Get(chargeAttack.attackKey).attackType) { case (AttackType.Melee): attack = new Melee(Global.attackManager.dict[source.key].Get(chargeAttack.attackKey) as Melee, source); break; case (AttackType.Projectile): attack = new Projectile(Global.attackManager.dict[source.key].Get(chargeAttack.attackKey) as Projectile, source); break; case (AttackType.AreaOfEffect): attack = new AreaOfEffect(Global.attackManager.dict[source.key].Get(chargeAttack.attackKey) as AreaOfEffect, source); break; }*/ //source.curAnim = chargeAttack.startKey; //source.charge_timer.Interval = chargeAttack.interval; //source.charge_timer.Start(); }
public Melee(Melee attack, Actor source) : base(attack, source) { col_rect.X = (int)(source.col_rect.Center.X + Math.Cos(direction) * (source.col_rect.Width + source.col_rect.Height) / 2 - col_rect.Width / 2); col_rect.Y = (int)(source.col_rect.Center.Y + Math.Sin(direction) * (source.col_rect.Width + source.col_rect.Height) / 2 - col_rect.Height / 2); }
public static void TryCollision(Actor source) { foreach (Actor target in Global.scene.actors.Where(t => source != t && source.unitType == t.unitType)) CheckCollision(source, target); }
public AreaOfEffect(AreaOfEffect attack, Actor source) : base(attack, source) { radius = attack.radius; pos = Global.toCenter(source.col_rect); }