public override void Atack(Player player, GameTime gameTime) { if (!IsReloading) { MissileBase missile = new MissileBase(player, AtackPoints, Random.NextDouble() <= Accuracy, new Point((int)(2 * (500 - PosX) * (1.5 - (double)player.PlayerID) + 500), (int)Force.PosY + (int)(170 * 0.2)), new Point((int)(2 * (500 - player.PlayerBase.PosX) * ((double)player.PlayerID - 1.5) + 500), (int)Force.PosY + (int)(170 * 0.2))); MissileBase missile2 = new MissileBase(player, AtackPoints, Random.NextDouble() <= Accuracy, new Point((int)(2 * (500 - PosX) * (1.5 - (double)player.PlayerID) + 500), (int)Force.PosY + (int)(170 * 0.2)), new Point((int)(2 * (500 - player.PlayerBase.PosX) * ((double)player.PlayerID - 1.5) + 500), (int)Force.PosY + (int)(170 * 0.2))); MissileBase missile3 = new MissileBase(player, AtackPoints, Random.NextDouble() <= Accuracy, new Point((int)(2 * (500 - PosX) * (1.5 - (double)player.PlayerID) + 500), (int)Force.PosY + (int)(170 * 0.2)), new Point((int)(2 * (500 - player.PlayerBase.PosX) * ((double)player.PlayerID - 1.5) + 500), (int)Force.PosY + (int)(170 * 0.2))); GameEffectsEngine.Add(missile); GameEventEngine.Add(new GameEventDelayed(() => { GameEffectsEngine.Add(missile2); }, 0.04)); GameEventEngine.Add(new GameEventDelayed(() => { GameEffectsEngine.Add(missile3); }, 0.08)); GameEventEngine.Add(new GameEventDelayed(() => { IsReloading = false; }, ReloadTime)); IsReloading = true; } }
public void DestroyNoHp(Player opponent) { if (ListOfForces.Count > 0) { Force force = ListOfForces[0]; if (force.Hp <= 0) { opponent.Cash += CashPack.ForceCashReceived[(int)force.Id]; Explosion explosion = new Explosion(force, this); GameEffectsEngine.Add(explosion); ListOfForces.RemoveAt(0); } } }
public virtual void Atack(Player player, Force enemyForce, GameTime gameTime) { if (!IsReloading) { Missile missile = new Missile(player, enemyForce, AtackPoints, Random.NextDouble() <= Accuracy, new Point((int)(2 * (500 - PosX) * (1.5 - (double)player.PlayerID) + 500), (int)Force.PosY + (int)(170 * 0.2)), new Point((int)(2 * (500 - enemyForce.PosX) * ((double)player.PlayerID - 1.5) + 500), (int)Force.PosY + (int)(170 * 0.2))); GameEffectsEngine.Add(missile); GameEventEngine.Add(new GameEventDelayed(() => { IsReloading = false; }, ReloadTime)); IsReloading = true; } }