Пример #1
0
  private static void gas(double chance) {
    if (Random.whole() <= chance) {
      Wait.milliseconds(322);
      System.out.print("\n\n");

      Burp burp = new Burp();
      if (Random.whole() <= .12) gas(1);
    }
  }
Пример #2
0
 public Drink(Player player, Scenario scenario, boolean World, boolean from_Ahead) {
   boolean tavern = scenario.environment.tavern,
       waterskin_specific =
           Array.subcontainment_case_ignored(
               Act.input_backup,
               Array.combine(triggers_subsafe_uncolloquial_specific, new String[] {"inv"})),
       resupplying =
           Array.subcontainment_case_ignored(
               Act.input_backup, triggers_subsafe_uncolloquial_resupplies),
       resupplying_order = Random.binary();
   if (resupplying && resupplying_order) {
     Eat eat = new Eat(player, scenario, true, World, from_Ahead);
   }
   String quench_your_thirst_phrase =
       Random.text_of(triggers_subsafe_verbs_colloquial)
           + " your "
           + Random.text_of(triggers_subsafe_objects_colloquial);
   if (World || from_Ahead) {
     if (tavern && (!waterskin_specific || resupplying)) {
       if (resupplying) extra(player, new int[] {player.water_max - player.water}, tavern);
       else {
         Type.delay(
             Random.text_of(new String[] {"🍶", "🍷"})
                 + ": You "
                 + Random.text_of(ordering_statements)
                 + Random.text_of(new String[] {"", " at the bar"})
                 + ".");
         drink(player, 1, player.quenched, new int[] {0, 1, 1, 2, 2, 3}, tavern, .2);
       }
     } else if (Array.subcontainment_case_ignored(
             Act.input_backup, triggers_subsafe_uncolloquial_ordering)
         || Array.containment_case_ignored(
             triggers_nonsubsafe_uncolloquial_ordering, Act.input_backup)) {
       Type.delay_line(
           Random.text_of(
               new String[] {"You are not in a tavern.", "There is no bartender here!"}));
     } else if ((!waterskin_specific && scenario.environment.water && Random.whole() <= .95)
         || (scenario.environment.water && resupplying)) {
       Wait.milliseconds(400);
       Type.delay(
           "💧: "
               + Random.text_of(
                   new String[] {
                     "You find some water available here", "You access the water source here"
                   })
               + ".");
       if (resupplying) extra(player, new int[] {player.water_max - player.water}, tavern);
       else {
         if (scenario.environment.snowy)
           Type.delay_line(
               "❄: "
                   + Random.text_of(
                       new String[] {
                         "You feel cold.",
                         "That was chilling.",
                         "You shiver.",
                         "That was cold water!"
                       }));
         drink(
             player,
             1,
             Random.integer_of(new int[] {player.quenched - 1, player.quenched}),
             new int[] {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3},
             tavern,
             .1);
       }
     } else if (player.water >= 1 && !resupplying) {
       int drunk = 1;
       if (Random.whole() <= .8) {
         drunk = player.quenched - player.wetness;
         while (drunk > player.water) drunk--;
         if (drunk == 0) drunk = 1;
       } else drunk = Random.integer_of(new int[] {1, 1, 1, 1, 1, 2, 2, 2, 3});
       player.water -= drunk;
       Type.delay(
           "💧: You "
               + Random.text_of(
                   new String[] {
                     "drink"
                         + Random.text_of(
                             new String[] {
                               "",
                               " "
                                   + Random.text_of(
                                       new String[] {
                                         "some water",
                                         "some of your water",
                                         "from your waterskin",
                                         "some water from your waterskin",
                                         "a few sips of water"
                                             + Random.text_of(
                                                 new String[] {"", " from your waterskin"})
                                       }),
                             }),
                     "sip "
                         + Random.text_of(
                             new String[] {
                               "some water",
                               "on some water",
                               "some of your water",
                               "on some of your water",
                               "from your waterskin",
                               "on your waterskin",
                               "some water from your waterskin"
                             }),
                     Random.text_of(triggers_subsafe_colloquial_guzzles)
                         + " "
                         + Random.text_of(
                             new String[] {
                               "some water", "some of your water", "some water from your waterskin"
                             }),
                     quench_your_thirst_phrase
                   })
               + ".");
       drink(player, drunk, drunk, new int[] {}, tavern, .1);
     }
     // type a statement explaining why the player cannot drink //
     else {
       if (resupplying)
         Type.delay_line(
             Random.text_of(
                     new String[] {
                       "There is no drinkable water nearby",
                       "You have no clean water around to fill your waterskin with"
                     })
                 + ".");
       else
         Type.delay_line(
             "You have no water"
                 + Random.text_of(
                     new String[] {
                       "",
                       " "
                           + Random.text_of(new String[] {"", "available", "left"})
                           + Random.text_of(
                               new String[] {"", " to " + quench_your_thirst_phrase + " with"}),
                       "in your waterskin, nor is there any good water around",
                       "on hand, and there is nothing here to " + quench_your_thirst_phrase,
                       "with you, and there is no good drinking water here"
                     })
                 + ".");
     }
   } else {
     if (resupplying) Type.delay_line("You have no time to resupply during combat!");
     else {
       Type.delay_line(
           "You have no time to "
               + Random.text_of(
                   new String[] {
                     "drink",
                     Random.text_of(triggers_subsafe_colloquial_guzzles)
                         + " "
                         + Random.text_of(new String[] {"", "any "})
                         + "water",
                     "take a "
                         + Random.text_of(triggers_subsafe_colloquial_guzzles)
                         + Random.text_of(new String[] {"", " of water"}),
                     quench_your_thirst_phrase,
                   })
               + " during combat!");
     }
   }
   if (resupplying && !resupplying_order) {
     Eat eat = new Eat(player, scenario, true, World, from_Ahead);
   }
 }