//methods public override void Trigger(Player player) { PlayerArrivedEvent(this, new PlayerArrivedEventArgs(player)); if (Owner == null) { if (player.Cash >= Price) { if (player.Confirm("Would you like to buy the estate? Price: " + Price)) { player.BuyEstate(this); } } else { player.Inform("Sorry, but you cannot afford this estate. Price: " + Price); } } else if (Owner == player) { if (player.Cash >= Price && Level != 6) { if (player.Confirm("Would you like to upgrade the estate? Price: " + Price)) { Upgrade(player); } } else if (Level == 6) { player.Inform("The estate is fully upgraded!"); } else { player.Inform("Sorry, but you cannot afford upgrading this estate. Price: " + Price); } } else { player.PayRent(); } }
public override void Trigger(Player player) { PlayerArrivedEvent(this, new PlayerArrivedEventArgs(player)); if (player.Confirm("I want to play a game...")) { int invest = player.InputInt("How much do you want to bet?"); player.SpendCash(invest); int revenue = Calculate(invest); player.AddCash(revenue); if (invest >= revenue) { player.Inform("Poor guy..."); ResultEvent(player, new CasinoEventArgs(false)); } else { player.Inform("Lucky you..."); ResultEvent(player, new CasinoEventArgs(true)); } } }
public override void Trigger(Player player) { PlayerArrivedEvent(this, new PlayerArrivedEventArgs(player)); if (player.Confirm("I want to play a game...")) { int invest = player.InputInt("How much do you want to bet?"); player.SpendCash(invest); int revenue = Calculate(invest); player.AddCash(revenue); if (invest >= revenue) { player.Inform("Poor guy..."); ResultEvent(player,new CasinoEventArgs(false)); } else { player.Inform("Lucky you..."); ResultEvent(player,new CasinoEventArgs(true)); } } }