Пример #1
0
  private static void applyRace(Thing h, String r) {
    if (r.equals("human")) {
      // humans are the most common inhabitants in the world of Tyrant
      // they are good all-round characters

      Coin.addMoney(h, 10 * RPG.d(4, 10));
      h.addThing(Lib.create("[IsDagger]"));
      h.addThing(Lib.create("[IsFood]"));
    } else if (r.equals("dwarf")) {
      // dwarves are sturdy and industrious cave dwellers
      // they are famed for their skill in smithing and mining

      Coin.addMoney(h, 10 * RPG.d(5, 10));

      h.addThing(Lib.create("iron hand axe"));
      h.addThing(Lib.create("loaf of dwarf bread"));
    } else if (r.equals("hobbit")) {
      // hobbits are just three feet high
      // they are peaceful folk, renowned as farmers
      Coin.addMoney(h, RPG.d(6, 10));
      h.addThing(Lib.create("stone knife"));
      h.addThing(Lib.create("[IsFood]"));
      h.addThing(Lib.create("[IsFood]"));
      h.addThing(Lib.create("[IsFood]"));
      h.addThing(Lib.create("[IsEquipment]"));
      h.addThing(Lib.create("sling"));
      h.addThing(Lib.create("10 pebble"));
    } else if (r.equals("high elf")) {
      // high elves are noble and wise

      Coin.addMoney(h, 10 * RPG.d(6, 10));
      h.addThing(Lib.create("ornate mithril ring"));
      h.addThing(Lib.create("elven steel dagger"));
    } else if (r.equals("wood elf")) {
      // wood elves are shy of other races
      // they are agile and talented archers
      h.addThing(Lib.create("short bow"));
      h.addThing(Lib.create("lesser elven arrow"));
    } else if (r.equals("dark elf")) {
      // dark elves are vicious and powerful
      // they prefer throwing weapons, darts and shurikens

      h.addThing(Lib.create("iron dagger"));
      h.addThing(Lib.create("[IsPotion]"));
    } else if (r.equals("gnome")) {
      // gnomes are disadvantage by their small size
      // they make up for this with igenuity

      Thing n = Lib.createType("IsMagicItem", 5);
      Item.identify(n);
      h.addThing(n);
      Coin.addMoney(h, 100 * RPG.d(10, 10));

    } else if (r.equals("half orc")) {
      // half orcs are volatile and dangerous

      h.addThing(Lib.createType("IsWeapon", RPG.d(3)));
      h.addThing(Lib.create("[IsMeat]"));
      Coin.addMoney(h, RPG.d(4, 10));

    } else if (r.equals("half troll")) {
      // trolls are lumbering hunks of muscle
      // with fearsome regenerative powers
      // they are not very bright

      h.incStat(RPG.ST_SKILLPOINTS, -1);

      h.addThing(Lib.createType("IsClub", RPG.d(6)));
      h.addThing(Lib.create("[IsMeat]"));
      h.addThing(Lib.create("[IsMeat]"));
      h.addThing(Lib.create("meat ration"));

    } else if (r.equals("argonian")) {
      // some equipment
      // in line with argonian style
      h.addThing(Lib.create("[IsTrident]"));
      h.addThing(Lib.create("[IsMeat]"));
      h.addThing(Lib.create("[IsFish]"));

    } else if (r.equals("hawken")) {
      // some equipment
      // in line with hawken style
      h.addThing(Lib.create("[IsDagger]"));
      h.addThing(Lib.create("[IsMeat]"));
      Coin.addMoney(h, RPG.d(4, 10));

    } else if (r.equals("pensadorian")) {
      // some equipment
      // in line with pensadorian style
      h.addThing(Lib.create("[IsDagger]"));
      h.addThing(Lib.create("[IsFruit]"));
      Coin.addMoney(h, RPG.d(4, 10));

    } else {

      throw new Error("Race [" + r + "] not recognised");
    }
  }