Example #1
0
        public override void Action(Gamer gamer)
        {
            Output.Print("Attack to monster:");
            var rnd = GetRandom();

            if (rnd > gamer.GetImpactForce())
            {
                Output.Print("You are fail.");
                gamer.ActionResult(_attackSettings.Fail);
            }
            else
            {
                Output.Print("You are vin.");
                gamer.ActionResult(_attackSettings.Vin);
            }
        }
Example #2
0
 public override void Action(Gamer gamer)
 {
     Output.Print("By clothes.");
     if (gamer.Money >= Settings.Price)
     {
         var power = (new Random()).Next(Settings.MinHealth, Settings.MaxHealth);
         gamer.ActionResult(new ActionChange()
         {
             PowerChange = power,
             MoneyChange = -Settings.Price
         });
         return;
     }
     Output.Print("Invalid balance.");
 }
Example #3
0
 public override void Action(Gamer gamer)
 {
     Output.Print("By weapon.");
     if (gamer.Money >= _settings.Price)
     {
         var power = (new Random()).Next(_settings.MinPower, _settings.MaxPower);
         gamer.ActionResult(new ActionChange()
         {
             PowerChange = power,
             MoneyChange = -_settings.Price
         });
         return;
     }
     Output.Print("Invalid balance.");
 }
Example #4
0
 public override void Action(Gamer gamer)
 {
     Output.Print("Go to healer");
     if (gamer.Money >= _healerSettings.Price)
     {
         var health = (new Random()).Next(_healerSettings.MinHealth, _healerSettings.MaxHealth);
         gamer.ActionResult(new ActionChange()
         {
             MoneyChange  = -_healerSettings.Price,
             HealthChange = (gamer.Healts + health) > 100? 100 - gamer.Healts:health
         });
     }
     else
     {
         Output.Print("Invalid balance.");
     }
 }