|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Superinterface of all Monster-like objects, such as (of course) monsters, but also NPCs and Players.
Field Summary | |
static int |
DEFAULT_MONSTER_ATTACK_SPEED
Monsters attack once per second by default; this can be overridden by setting an int "attack-speed" property on the monster. |
static int |
DEFAULT_MONSTER_SPEED
If a monster has no "move-speed" property, this is the default speed at which the monster moves. |
static int |
DEFAULT_MONSTER_STRENGTH
If the monster has no "str" property, this is the default. |
static int |
MONSTER_XP_CAP
The maximum number of XP you can get for any monster, regardless of how difficult it is. |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Fields inherited from interface wyvern.common.net.RemoteAudio |
DEFAULT_ALERT_GAIN, DEFAULT_ALERT_REPEAT_DELAY, DEFAULT_ALERT_REPEATS, DEFAULT_GAIN, DEFAULT_REPEAT_DELAY, DEFAULT_REPEATS |
Method Summary | |
void |
adjustSP(int adjust)
Adjusts the monster's spell points upwards or downwards. |
int |
adjustStat(int adjust,
java.lang.String statname,
java.lang.String statmax)
Adjusts the specified stat, staying within the valid range for the stat. |
void |
adjustWallet(long amount)
Adjusts the amount of money the player is carrying by a positive or negative amount. |
void |
burial(GameObject attacker)
Destroys the monster. |
void |
createInventory()
Creates an inventory for the monster if it doesn't have one. |
void |
dropAll()
Causes the monster to drop all its items, except for items that are prevented from being dropped normally (e.g. they're cursed). |
void |
dropAllForce()
Causes the monster to drop all its items, even if they're cursed, worn, etc. |
int |
getLevel()
Returns the monster's level. |
int |
getMaxSP()
Returns the monster's maximum mana. |
PartsList |
getPartsList()
Returns the monster's body-parts list. |
int |
getSP()
Returns the monster's mana. |
SpellList |
getSpellList()
Returns the player's or monster's SpellList. |
long |
getWallet()
Returns the amount of cash the monster is carrying in their top-level inventory. |
boolean |
isAlive()
Returns true if the monster is alive. |
void |
setHP(int hp)
Sets the current HP for the player, but keeps it within the valid range of (0, "max-hp") |
void |
setSP(int sp)
Sets the current SP for the player, but keeps it within the valid range of (0, "max-sp") |
Methods inherited from interface wyvern.lib.Commandable |
addAttack, addMessageListener, command, command, commandNow, getAI, getCapName, getCombatQueue, getCommand, getEncumbrance, getFiringPoint, getInventory, getName, getQueue, isStarted, isTelnet, message, message, message, registerCommand, removeAttack, removeMessageListener, sendPicture, sendPicture, setAI, setEncumbrance, setName, start, stop, unregisterCommand |
Methods inherited from interface wyvern.lib.Hookable |
addHook, getHookList, getHooks, removeHook, runFailedPostHook, runPostHook, runPreHook |
Methods inherited from interface wyvern.lib.MethodHookable |
addMethodHook, removeMethodHook, runMethodHook |
Methods inherited from interface wyvern.lib.Broadcaster |
broadcast, broadcast, broadcast, broadcast, broadcast |
Methods inherited from interface wyvern.common.net.RemoteAudio |
pauseSound, playAlert, playAlert, playDefaultMusic, playPriorityMusic, playPriorityMusic, playSound, playSound, resumeSound, setMusicGain, setSoundGain, stopAllSounds, stopMusic, stopSound |
Methods inherited from interface wyvern.lib.properties.Attackable |
getXPAward, notifyAttacked |
Methods inherited from interface wyvern.lib.properties.Damageable |
adjustHP, getHP, getMaxHP, kill |
Field Detail |
public static final int DEFAULT_MONSTER_SPEED
public static final int DEFAULT_MONSTER_STRENGTH
public static final int DEFAULT_MONSTER_ATTACK_SPEED
public static final int MONSTER_XP_CAP
Method Detail |
public boolean isAlive()
public void dropAll()
public void dropAllForce()
public void burial(GameObject attacker)
attacker
- the player/etc. that killed us; can be nullpublic PartsList getPartsList()
public int getLevel()
public int getSP()
public int getMaxSP()
public void adjustSP(int adjust)
adjust
- a number (possibly negative) to add to the monster's hppublic int adjustStat(int adjust, java.lang.String statname, java.lang.String statmax)
adjust
- the amount by which to adjust the stat, positive
or negative.statname
- the name of the stat property to adjuststatmax
- the name of the max-stat property, e.g., "max-hp"
public void setSP(int sp)
sp
- the new sppublic void setHP(int hp)
hp
- the new hppublic long getWallet()
public void adjustWallet(long amount)
amount
- the amount of silver to add. If negative, deducts from
the player's cash on hand. If the amount to deduct is more than
the player has, it returns only the amount the player had on hand.
It's up to the caller to call getWallet() and ensure there's enough
there. Note: this method does NOT check whether the player can carry the money, and it's possible to give the player more than they can technically carry. This is still under consideration - if it causes bugs, then we'll force the extra money to go on the ground.
public SpellList getSpellList()
public void createInventory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |