|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A programmable monster generator.
Lairs have properties you can set to control what monsters they generate, and when. For example, you could put a Lair object under a bridge, and have it generate trolls periodically.
A lair object produces monsters in "batches". It spits out some monsters from the list you've specified, between the min and max numbers you set, and then waits for them to be removed from the list. When a monster dies (or something unusual happens to it, such as being teleported to a non-adjacent map), it is removed from the list. When all the monsters from the batch are removed, the lair sets a reset timer and waits until it expires. Then it starts over again, producing another batch of monsters.
Lair objects need to know when the monsters they've generated have left the area, died, etc., so they can reset. They work together with the monster AIs to figure this stuff out.
Field Summary | |
static int |
DEFAULT_HP
The default number of hit points the generator has. |
static int |
DEFAULT_MAX
The default maximum number of monsters to generate, per reset. |
static int |
DEFAULT_MIN
The default minimum number of monsters to generate on reset. |
static int |
DEFAULT_RESET_DELAY
The default delay (in seconds) between resets; i.e. between the time the last monster is killed and the first new one appears. |
static int |
DEFAULT_SPEED
The default speed at which the Generator generates monsters, in seconds. |
Method Summary | |
int |
getMaximum()
Returns the maximum monsters this lair will generate before stopping. |
int |
getMinimum()
Returns the minimum number of monsters the lair will generate on each reset. |
int |
getResetDelay()
Gets the time between resets for this lair object. |
int |
getSpeed()
Returns the speed at which this object generates monsters. |
java.lang.String |
getType()
If this generator is set to generate a specific type of monster, returns that type. |
java.lang.String |
getTypeList()
Returns the path to the list of monster types that this lair generates, or null if it generates a single type. |
void |
remove(GameObject m)
Removes a monster from the Lair's list. |
void |
reset()
Resets the lair, removing all references to its monsters and starting over again. |
void |
setMaximum(int max)
Sets the maximum number of monsters this lair will generate before stopping. |
void |
setMinimum(int minimum)
Sets the minimum number of monsters to generate. |
void |
setResetDelay(int delay)
Sets the time after the last monster croaks before the Lair will spew out more monsters. |
void |
setSpeed(int speed)
Sets the speed at which this object generates monsters. |
void |
setType(java.lang.String type)
Sets one specific monster type for this lair to produce. |
void |
setTypeList(java.lang.String path)
Sets a list of monster types for this lair to generate. |
void |
setTypes(java.lang.String types)
Sets a list of monsters to randomly choose from when generating. |
void |
start()
Starts the generator. |
Field Detail |
public static final int DEFAULT_SPEED
public static final int DEFAULT_RESET_DELAY
public static final int DEFAULT_MAX
public static final int DEFAULT_MIN
public static final int DEFAULT_HP
Method Detail |
public void setType(java.lang.String type)
type
- a path to an archetype, or a fully-qualified
java classname.public void setTypes(java.lang.String types)
types
- a whitespace-delimited list of archetypes,
e.g. "monsters/goblin/kobold monsters/goblin/kobold_lord"public java.lang.String getType()
public void setTypeList(java.lang.String path)
path
- the relative path to a list of archetypes,
e.g. "generator/kobold" (if under world/lists) or
"wiz/foobar/mylists/bugbear" if under a wizard directory.public java.lang.String getTypeList()
public void setSpeed(int speed)
speed
- the number of seconds between each monster
generated in a particular batch.public int getSpeed()
public void setResetDelay(int delay)
delay
- the delay (in seconds) between resets. Setting
this to zero will cause the lair to start a new batch as soon
as the old one is finished.public int getResetDelay()
public void setMaximum(int max)
max
- the maximum monsters to generate on each reset.public int getMaximum()
public void setMinimum(int minimum)
minimum
- the fewest monsters to create; defaults to 1.public int getMinimum()
public void remove(GameObject m)
public void start()
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |