|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.monsters.InvGenerator
Base class for monster inventory-generators. Has utility functions for generating and cloning objects.
Constructor Summary | |
InvGenerator()
|
Method Summary | |
void |
addItem(Inventory inv,
Archetype arch)
Adds an object of the passed archetype. |
void |
addItem(Inventory inv,
java.lang.String name)
Creates and adds an item of the exact archetype specified in the name property, e.g. |
GameObject |
clone(java.lang.String name,
int level)
Instantiates an object of the passed arch and level. |
GameObject |
cloneItem(java.lang.String name)
Clones a random item generated from a list, rather than using the RandomItem stuff, so the level doesn't matter. |
abstract void |
generate(Monster mon)
Time to generate the inventory. |
void |
randomItem(Inventory inv,
java.lang.String name,
int level)
Generates a random item of the passed type and level, and adds it to the inventory. |
int |
roll()
Rolls a percentage (just calls Range.percent()). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InvGenerator()
Method Detail |
public int roll()
public GameObject cloneItem(java.lang.String name)
public GameObject clone(java.lang.String name, int level)
name
- the archetype, e.g. "random/weapon"level
- level of item to clonepublic void addItem(Inventory inv, Archetype arch)
arch
- the archetypepublic void addItem(Inventory inv, java.lang.String name)
public void randomItem(Inventory inv, java.lang.String name, int level)
public abstract void generate(Monster mon)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |