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 Summary
Fields Modifier and Type Field Description String
mainForm
String
name
OrderedMap<String,List<String>>
parts
OrderedSet<String>
powerAdjectives
OrderedSet<String>
powerPhrases
String
unknown
OrderedSet<String>
unsaidAdjectives
OrderedSet<String>
wholeAdjectives
-
Constructor Summary
Constructors Constructor Description 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 ";" .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.Chimera(String name, MonsterGen.Chimera other)
Copies an existing Chimera other into a new Chimera with potentially a different name. -
Method Summary
Modifier and Type Method Description 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.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.String
present(boolean capitalize)
Get a string description of this monster's appearance and powers.String
presentVisible(boolean capitalize)
Get a string description of this monster's appearance.String
toString()
-
Field Details
-
Constructor Details
-
Chimera
Copies an existing Chimera other into a new Chimera with potentially a different name.- Parameters:
name
- the name to use for the Chimera this constructsother
- the existing Chimera to copy all fields but name from.
-
Chimera
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 isChimera 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 mixedunknown
- true if the creature's basic shape is unlikely to be known by a player, false for animals and possibly common mythological creatures like dragonsterms
- 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 isChimera 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 mixedunknown
- true if the creature's basic shape is unlikely to be known by a player, false for animals and possibly common mythological creatures like dragonsparts
- the different body part nouns this creature can contribute to a creature when mixedunsaid
- appearance adjectives that don't need to be said if the creature is familiarwhole
- appearance adjectives that apply to the whole creaturepowerAdj
- power adjectives like "furious" or "fire-breathing"powerPhr
- power phrases like "can cast arcane spells"
-
-
Method Details
-
present
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
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
-
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 factorsnewName
- the name to call the produced Chimeraother
- the Chimera to mix with this oneotherInfluence
- the fraction between 0.0 and 1.0 of descriptors from other to use- Returns:
- a new Chimera mixing features from both inputs
-
mix
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 Chimeraother
- the Chimera to mix with this oneotherInfluence
- the fraction between 0.0 and 1.0 of descriptors from other to use- Returns:
- a new Chimera mixing features from both inputs
-