Пример #1
0
 private static void drink(
     Player player,
     int amount_min,
     int amount_max,
     int[] extra_possibilities,
     boolean tavern,
     double gas_chance) {
   int amount = Random.integer_from(amount_min, amount_max);
   for (int i = 0; i < amount; i++) {
     Type.delay(".", 1100);
   }
   System.out.println();
   boolean overdrinking_weaken = false;
   Type.delay("💧: ");
   if (player.wetness + amount < player.quenched)
     Type.delay_line(
         Random.text_of(
             new String[] {
               "You could drink some more.",
               "You are still thirsty.",
               "Your throat is still somewhat dry."
             }));
   else if (player.wetness + amount == player.quenched)
     Type.delay_line(
         Random.text_of(
             new String[] {
               "You have drunk enough.",
               "You have quenched your thirst.",
               "You are no longer thirsty."
             }));
   else {
     if (player.wetness == player.quenched) {
       Type.delay_line(
           Random.text_of(new String[] {"You have overdrunk.", "You feel waterlogged."}));
       overdrinking_weaken = true;
       if (gas_chance + .65 <= .9) gas_chance += .65;
       else gas_chance = .9;
     } else
       Type.delay_line(
           Random.text_of(
               new String[] {
                 "You have drunk enough.",
                 "You have quenched your thirst.",
                 "You are no longer thirsty."
               }));
     amount = player.quenched - player.wetness;
   }
   player.wetness += amount;
   player.display_wetnessbar();
   if (overdrinking_weaken) player.weaken(1);
   if (player.wetness >= player.quenched - 1) extra(player, extra_possibilities, tavern);
   gas(gas_chance);
 }
Пример #2
0
 public void event(Player player) {
   spectacle();
   if (player.health < player.healthy) {
     Type.delay("You find respite here.");
     int amount = Random.integer_from(1, 4);
     for (int i = 0; i < amount; i++) {
       Type.delay(".", 1250);
     }
     System.out.println();
     player.recover(1 + amount);
   }
 }
Пример #3
0
 public Pause() {
   if (Act.input_backup.contains("pause") && Random.binary()) {
     Halt halt = new Halt();
   } else {
     Type.delay(
         Random.text_of(
             new String[] {
               "You pause for a moment.",
               "You pause for a moment, absorbing the view.",
               "You pause to admire your surroundings.",
               "You take a moment to admire your surroundings."
             }));
     for (int i = 0; i < Random.integer_from(1, 4); i++) Type.delay(".", 750);
     System.out.println();
   }
 }
Пример #4
0
 public void event(Player player) {
   spectacle();
   if (player.health > 8 && Random.whole() <= .767) {
     System.out.println();
     Type.delay_line(
         Random.text_of(
             new String[] {
               "You bump into a spike!",
               "You are standing in a pool of acid!",
               "Flames shoot out of a wall, singeing you!",
               "A poison dart shoots out of a wall, burying into you!",
               "You get zapped as you step onto a metal grate!"
             }));
     player.trap_weaken(Random.integer_from(5, 8));
   }
 }
Пример #5
0
  public Iron_Golem() {
    nonliving = true;
    unconscious = true;

    large = true;

    health_min = 190;
    health_max = 230;
    health = Random.integer_from(health_min, health_max);

    fortitude = 20;

    agility = 9;

    block = fortitude + agility;

    strength = fortitude;

    damage_min = 5;
    damage_max = agility + strength;
  }
Пример #6
0
  public Tavern() {
    super();

    // tavern toggle //
    tavern = true;

    // context //
    String context_place;
    if (Random.whole() <= .7) context_place = Random.text_of(context_places_common);
    else context_place = Random.text_of(context_places_rare);
    context = Random.text_of(new String[] {"at", "inside", "in"}) + " The ";
    switch (Random.integer_to(15)) {
      case 0:
        {
          context += Random.text_of(context_object_adjectives) + " " + context_place;
          break;
        }
      case 1:
        {
          context +=
              context_place
                  + " of the "
                  + Random.text_of(context_object_adjectives)
                  + " "
                  + Random.text_of(context_characters);
          break;
        }
      case 2:
        {
          context +=
              Random.text_of(context_object_adjectives)
                  + " "
                  + Random.text_of(context_objects)
                  + Random.text_of(new String[] {" " + context_place, ""});
          break;
        }
      case 3:
        {
          context +=
              context_place
                  + " of the "
                  + Random.text_of(context_character_adjectives)
                  + " "
                  + Random.text_of(context_characters);
          break;
        }
      case 4:
        {
          context +=
              Random.text_of(context_character_adjectives)
                  + " "
                  + Random.text_of(
                      new String[] {
                        Random.text_of(context_characters)
                            + Random.text_of(new String[] {" " + context_place, ""}),
                        Random.text_of(context_characters_possessive) + " " + context_place
                      });
          break;
        }
      case 5:
        {
          context += context_place + " of the " + Random.text_of(context_characters_plural);
          break;
        }
      case 6:
        {
          context += context_place + " of " + Random.text_of(context_characters_plural);
          break;
        }
      case 7:
        {
          context +=
              Random.text_of(context_objects)
                  + " and the "
                  + Random.text_of(context_objects)
                  + Random.text_of(new String[] {" " + context_place, ""});
          break;
        }
      case 8:
        {
          context +=
              Random.text_of(context_object_adjectives)
                  + " "
                  + Random.text_of(context_objects)
                  + Random.text_of(new String[] {" " + context_place, ""});
          break;
        }
      case 9:
        {
          context +=
              Random.text_of(context_characters_possessive)
                  + " "
                  + Random.text_of(context_objects)
                  + " "
                  + context_place;
          break;
        }
      case 10:
        {
          context +=
              Random.text_of(context_character_adjectives)
                  + " "
                  + Random.text_of(context_characters_possessive)
                  + " "
                  + Random.text_of(context_objects)
                  + Random.text_of(new String[] {" " + context_place, ""});
          break;
        }
      case 11:
        {
          context += Random.text_of(context_characters_possessive) + " " + context_place;
          break;
        }
      case 12:
        {
          context +=
              Random.text_of(context_character_adjectives)
                  + " "
                  + Random.text_of(context_characters_possessive)
                  + " "
                  + context_place;
          break;
        }
      case 13:
        {
          context +=
              Random.text_of(context_characters)
                  + " and "
                  + Random.text_of(context_characters)
                  + " "
                  + context_place;
          break;
        }
      case 14:
        {
          context +=
              Random.text_of(context_characters)
                  + " and the "
                  + Random.text_of(context_objects)
                  + Random.text_of(new String[] {" " + context_place, ""});
          break;
        }
      case 15:
        {
          context +=
              Random.text_of(context_objects)
                  + " and the "
                  + Random.text_of(context_characters)
                  + Random.text_of(new String[] {" " + context_place, ""});
          break;
        }
        // error //
      default:
        {
          System.out.println("ERROR:\nTavern:\nswitch chose default instead of a case");
        }
    }
    context += Random.text_of(new String[] {".", ".", ".", "..."});

    // description //
    description =
        Random.text_of(
            new String[] {
              "It's late, and most of the people here are tired. The inn's fireplace is crackling softly...",
              "The tavern is large, and largely undecorated, except for an extravagant rug at the entryway.",
              "The inn is warm and well lit inside. The lights flicker against various artworks hanging on the walls, depicting both adventurous and everyday scenes.",
              "The barkeep tends to the bar, wiping it clean. There is an impressive array of bottles and kegs behind him.",
              "The tavern is small, but well decorated. Adventuring paraphernalia are hung on the walls — items such as a crossbow, a bandolier, a helmet, and a broadsword.",
              "There are many barrels of mead stacked in the corner, enough to last the tavern for at least a year.",
              "Flickering candles are mounted on the walls, lending a midnight atmosphere. A large chandelier hangs from the center of the ceiling."
            });
    if (Random.whole() <= .35) {
      if (Random.whole() <= .3)
        description +=
            " Some open games of dice and cards rest on the tables for late night players.";
      else {
        if (Random.whole() <= .33)
          description = "Card and dice games are being played tonight. " + description;
        else if (Random.whole() <= .66)
          description +=
              " There is a band in tonight, playing a jovial tune with lute, flute, and drums on a platform in the back of the tavern.";
        else
          description =
              "Card and dice games are being played tonight. "
                  + description
                  + " There is a band of flute and lute players in the back of the tavern, providing a relaxing atmosphere.";
      }
    }

    // placements //
    large_character_placements =
        new String[] {
          "by the doorway", Random.text_of(new String[] {"at", "beside"}) + " the bar", "on a table"
        };
    nonlarge_character_placements =
        new String[] {
          "seated on a stool at the bar",
          "in the seat at a table",
          "by the mead barrels",
          "behind the bar"
        };
    noncharacter_placements =
        new String[] {
          "on the wooden floor",
          "on the mantle of the fireplace",
          "in the fireplace",
          "in a crate",
          "on a shelf in the back",
          "mounted on the wall",
          "against the wall",
          "on the rug at the door",
          "in the lockbox under the counter of the bar",
          "by some ingredient pouches behind the bar",
          "under a wall-mounted candle"
        };
    // moba //
    if (Random.whole() <= .857) moba = new String[] {};
    else moba = mobs_permute(new String[] {"Thug"});

    // occupants //
    occupants =
        new String[] {
          Random.text_of(new String[] {"the barkeep", "the bartender", "the innkeeper"})
        };
    int more_occupants =
        Random.integer_from(2, 7); // rough overcount because repeats will get discarded //
    for (int i = 0; i < more_occupants; i++) {
      String additional_occupant = Random.text_of(possible_occupants);
      if (!Array.containment(occupants, additional_occupant))
        occupants = Array.combine(occupants, new String[] {additional_occupant});
    }
    // occupants statement //
    occupants_statement =
        Random.text_of(new String[] {"The", "Tonight's"})
            + " "
            + Random.text_of(new String[] {"occupants", "occupants", "residents"})
            + " include ";
    for (int i = 0; i < occupants.length; i++) {
      if (i < occupants.length - 2) occupants_statement += occupants[i] + ", ";
      else if (i < occupants.length - 1) occupants_statement += occupants[i] + ", and ";
      else occupants_statement += occupants[i] + ".";
    }
  }