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 bool AddForces(Force force, Player opponent, GameTime gameTime) { if (PurchasePack.ForceCosts[(int)force.Id] > Cash) { return(false); } else { if (this.PlayerID == 1) { LearnInputOutput learning = new LearnInputOutput(opponent.ListOfForces, this.ListOfForces, this.Upgrades, this.Cash, (int)force.Id); Data.WriteToFile(learning); this.DidSomething(gameTime); } Cash -= PurchasePack.ForceCosts[(int)force.Id]; force.OriginalRange = force.Range; UpgradePack.UpgradeForce(force, Upgrades[(int)force.Id]); force.MaxHp = force.Hp; ListOfForces.Add(force); return(true); } }