Package squidpony

Class MonsterGen.Chimera

java.lang.Object
squidpony.MonsterGen.Chimera
Enclosing class:
MonsterGen

public static class MonsterGen.Chimera
extends Object
A creature that can be mixed with other Chimeras or given additional descriptors, then printed in a usable format for game text.
  • Field Details

  • Constructor Details

    • Chimera

      public Chimera​(String name, MonsterGen.Chimera other)
      Copies an existing Chimera other into a new Chimera with potentially a different name.
      Parameters:
      name - the name to use for the Chimera this constructs
      other - the existing Chimera to copy all fields but name from.
    • Chimera

      public Chimera​(String name, String unknown, String... terms)
      Constructs a Chimera given a name (typically all lower-case), null if the creature is familiar or a String if the creature's basic shape is likely to be unknown to players, and an array or vararg of String terms containing, usually, several groups of String elements separated by the literal string ";" . The first group in terms contains what body parts this creature has and could potentially grant to another creature if mixed; examples are "head", "legs", "claws", "wings", and "eyes". In the next group are the "unsaid" adjectives, which are not listed if unknown is false, but may be contributed to other creatures if mixed (mixing a horse with a snake may make the horse scaly, since "scaly" is an unsaid adjective for snakes). Next are adjectives that apply to the whole creature's appearance, which don't need to replicate the unsaid adjectives and are often added as a step to randomize a creature; this part is often empty and simply ends on the separator ";" . Next are the power adjectives, which are any special abilities a creature might have that aren't immediately visible, like "furious" or "toxic". Last are the power phrases, which follow a format like "can cast arcane spells", "embodies the wilderness", or "constantly drools acid"; it should be able to be put in a sentence after the word "that", like "a snake that can cast arcane spells".
      The unknown argument determines if descriptions need to include basic properties like calling a Snake scaly (null in this case) or a Pestilence Fiend chitinous (no one knows what that creature is, so a String needs to be given so a player and player character that don't know its name can call it something, like "demon").
      An example is Chimera SNAKE = new Chimera("snake", null, "head", "tail", "fangs", "eyes", ";", "reptilian", "scaly", "lean", "curvaceous", ";", ";", "toxic");
      Parameters:
      name - the name to refer to the creature by and its body parts by when mixed
      unknown - true if the creature's basic shape is unlikely to be known by a player, false for animals and possibly common mythological creatures like dragons
      terms - an array or vararg of String elements, separated by ";" , see method documentation for details
    • Chimera

      public Chimera​(String name, String unknown, Collection<String> parts, Collection<String> unsaid, Collection<String> whole, Collection<String> powerAdj, Collection<String> powerPhr)
      Constructs a Chimera given a name (typically all lower-case), null if the creature is familiar or a String if the creature's basic shape is likely to be unknown to players, and several String Collection args for the different aspects of the Chimera. The first Collection contains what body parts this creature has and could potentially grant to another creature if mixed; examples are "head", "legs", "claws", "wings", and "eyes". The next Collection contains "unsaid" adjectives, which are not listed if unknown is false, but may be contributed to other creatures if mixed (mixing a horse with a snake may make the horse scaly, since "scaly" is an unsaid adjective for snakes). Next are adjectives that apply to the "whole" creature's appearance, which don't need to replicate the unsaid adjectives and are often added as a step to randomize a creature; this Collection is often empty. Next are the power adjectives, which are any special abilities a creature might have that aren't immediately visible, like "furious" or "toxic". Last are the power phrases, which follow a format like "can cast arcane spells", "embodies the wilderness", or "constantly drools acid"; it should be able to be put in a sentence after the word "that", like "a snake that can cast arcane spells".
      The unknown argument determines if descriptions need to include basic properties like calling a Snake scaly (null in this case) or a Pestilence Fiend chitinous (no one knows what that creature is, so a String needs to be given so a player and player character that don't know its name can call it something, like "demon").
      An example is Chimera SNAKE = new Chimera("snake", null, "head", "tail", "fangs", "eyes", ";", "reptilian", "scaly", "lean", "curvaceous", ";", ";", "toxic");
      Parameters:
      name - the name to refer to the creature by and its body parts by when mixed
      unknown - true if the creature's basic shape is unlikely to be known by a player, false for animals and possibly common mythological creatures like dragons
      parts - the different body part nouns this creature can contribute to a creature when mixed
      unsaid - appearance adjectives that don't need to be said if the creature is familiar
      whole - appearance adjectives that apply to the whole creature
      powerAdj - power adjectives like "furious" or "fire-breathing"
      powerPhr - power phrases like "can cast arcane spells"
  • Method Details

    • present

      public String present​(boolean capitalize)
      Get a string description of this monster's appearance and powers.
      Parameters:
      capitalize - true if the description should start with a capital letter.
      Returns:
      a String description including both appearance and powers
    • presentVisible

      public String presentVisible​(boolean capitalize)
      Get a string description of this monster's appearance.
      Parameters:
      capitalize - true if the description should start with a capital letter.
      Returns:
      a String description including only the monster's appearance
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • mix

      public MonsterGen.Chimera mix​(RNG rng, String newName, MonsterGen.Chimera other, double otherInfluence)
      Fuse two Chimera objects by some fraction of influence, using the given RNG and possibly renaming the creature. Does not modify the existing Chimera objects.
      Parameters:
      rng - the RNG to determine random factors
      newName - the name to call the produced Chimera
      other - the Chimera to mix with this one
      otherInfluence - the fraction between 0.0 and 1.0 of descriptors from other to use
      Returns:
      a new Chimera mixing features from both inputs
    • mix

      public MonsterGen.Chimera mix​(String newName, MonsterGen.Chimera other, double otherInfluence)
      Fuse two Chimera objects by some fraction of influence, using the default RNG and possibly renaming the creature. Does not modify the existing Chimera objects.
      Parameters:
      newName - the name to call the produced Chimera
      other - the Chimera to mix with this one
      otherInfluence - the fraction between 0.0 and 1.0 of descriptors from other to use
      Returns:
      a new Chimera mixing features from both inputs