|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.kernel.maps.MapObject wyvern.kernel.commands.AbstractCommandable wyvern.kernel.monsters.MonsterImpl wyvern.kernel.player.PlayerImpl
The default implementation of the Player interface.
Nested Class Summary |
Nested classes inherited from class wyvern.kernel.monsters.MonsterImpl |
MonsterImpl.WalkVisitor |
Nested classes inherited from class wyvern.common.net.RPCConstants |
RPCConstants.ImageAlign, RPCConstants.ImageFlags, RPCConstants.ImageFormat, RPCConstants.OutputView, RPCConstants.TextStyle |
Field Summary |
Fields inherited from class wyvern.kernel.monsters.MonsterImpl |
beats_, python_, walkVisitor_ |
Fields inherited from class wyvern.kernel.commands.AbstractCommandable |
hookList_, queue_, started_ |
Fields inherited from class wyvern.kernel.maps.MapObject |
IN_MAP_EDITOR, listenerList_ |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.Player |
DEFAULT_PLAYER_SPEED, DEFAULT_WAKE_MONSTER_RADIUS, END_COMBAT_DELAY, MAX_VIEW_SIZE, MAX_WIZ_VIEW_SIZE |
Fields inherited from interface wyvern.lib.Monster |
DEFAULT_MONSTER_ATTACK_SPEED, DEFAULT_MONSTER_SPEED, DEFAULT_MONSTER_STRENGTH, MONSTER_XP_CAP |
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 |
Constructor Summary | |
PlayerImpl()
Constructs a new PlayerImpl. |
Method Summary | |
void |
adjustAlign(int adjust)
Adjusts the player's alignment upwards or downwards. |
void |
adjustFood(int adjust)
Adjusts the player's food amount by the specified amount. |
void |
adjustHP(int adjust)
Adjusts the object's hit points upwards or downwards. |
void |
adjustShoutPoints(int adjust)
Adjusts the player's shout points upwards or downwards. |
void |
adjustSkill(java.lang.String name,
int adjust)
Adjusts the transient value of a skill for the player. |
void |
adjustSP(int adjust)
Adjusts the monster's spell points upwards or downwards. |
void |
adjustWallet(long amount)
Adjusts the amount of money the player is carrying by a positive or negative amount. |
void |
adjustXP(int adjust)
Adjusts the player's experience points upwards or downwards. |
boolean |
autosave()
Saves the current state of the player to the player's file, without issuing any message to the player. |
void |
broadcastEntry(boolean entered)
Tells certain lists that the player entered or left the game. |
void |
burial(GameObject attacker)
Kills a player, for real. |
long |
combatTimeLeft()
Returns time left before we change this API. |
void |
command(java.lang.String cmd,
boolean user)
Method called when a command is added to the command queue. |
void |
computeStartTime()
Initializes idle timer and start date. |
protected java.lang.String |
computeTitle()
Figures out what the player's title should be. |
void |
controlCamera(boolean control)
Tells the Player to control its own camera (if true) or notifies the Player that the camera will be controlled externally (if false). |
void |
createInventory()
Creates the Inventory if not present, and sets the owner field. |
void |
destroy()
Destroys the player object. |
void |
dropInventoryIfGuest()
|
void |
enqueueCommand(java.lang.String command,
boolean user)
Puts a command in our command queue. |
void |
ensureAI()
Don't give us an AI on construction. |
protected void |
ensureEventQueue()
Creates an extra event queue for combat commands, so automatic combat happens in parallel with movement. |
protected void |
ensurePartsList()
Makes a default (humanoid) body-parts list for the monster. |
int |
getAge()
Returns the player's age in seconds. |
java.util.Map |
getAliases()
Returns the aliases for this player. |
int |
getAlignment()
Returns player's alignment |
RemoteClient |
getClient()
Returns the RemoteClient implementation for this player. |
EventQueue |
getCombatQueue()
Returns the combat queue, in case you want to place attack commands into it directly. |
Command |
getCommand(CommandEvent event)
Figures out who will handle a given command. |
CommandList |
getCommandList()
Returns the CommandList for this player. |
int |
getFood()
Returns the player's current food level. |
java.lang.String |
getFullTitle()
Returns a full title, such as "Rawk the Elven Adventurer". |
Camera |
getGroundCamera()
Returns the camera that displays the ground beneath the player. |
GameObject |
getGroundObject(int index)
This is a rather special-purpose method: it returns the game object that's currently being displayed in the client's ground display at the specified index. |
Heart |
getHeart()
|
java.lang.String |
getHostAddress()
Returns the IP address this player is connected from. |
int |
getIdleTime()
Returns the number of seconds the player has been idle. |
Camera |
getMapCamera()
Returns the camera that displays the map. |
int |
getMaxFood()
Returns the max food the player can eat/drink. |
MusicState |
getMusicState()
Returns the MusicState object keeping track of this player's running soundtrack. |
java.lang.String |
getName()
Returns the name of this commandable |
java.lang.String |
getPassword()
Returns the player's encrypted password. |
Point |
getPositionInViewport()
Returns the relative offets of the player within the player's map camera. |
java.lang.String |
getRace()
Returns player's race. |
wyvern.server.IClientSession |
getSession()
Returns the ClientSession for this player. |
java.lang.String |
getSex()
Returns player's gender. |
int |
getShoutPoints()
Returns the player's shout points. |
SpellList |
getSpellList()
Returns the player's SpellList, or null if they don't know any spells (or are a Wizard who can cast anything.) |
java.util.Date |
getStartDate()
Returns the time when the player logged in. |
long |
getStartTime()
Returns System.currentTimeMillis() when the player logged in. |
java.lang.String |
getTitle()
Returns the player's title, e.g. |
int |
getXP()
Returns the player's experience. |
int |
getXPAward()
Returns the experience award for killing this monster. |
void |
heartbeat()
Heartbeat notification, called every 5 seconds on every player and (started) monster in the game. |
boolean |
inCombat()
Returns true if the player has recently been in combat. |
void |
init(RemoteClient client,
Dimension viewsize)
Initializes the player instance and data structures using the specified RemoteClient. |
boolean |
isGuest()
Returns true if the player is a guest. |
boolean |
isHallOfFamer()
|
boolean |
isHandheld()
Returns true if the player is connected via a handheld client. |
boolean |
isMonster()
Returns true if (and only if) this is a Monster (and not a Player). |
boolean |
isNetDead()
Returns true if the player is currently net-dead. |
boolean |
isPlayer()
Returns true if (and only if) this is a Player. |
boolean |
isRobot()
|
boolean |
isShutDown()
Returns true if this Player object is defunct (the player has logged out). |
boolean |
isTelnet()
Returns true if we're connected via a Telnet client. |
boolean |
isWizard()
Returns true if the player is a Wizard (any level). |
void |
kill(GameObject attacker)
Kills the player. |
long |
lastCombat()
Returns the last time the player had an updateCombat() method called. |
void |
makeGravestone(GameObject attacker,
int xpLost,
int guildXpLost)
|
void |
mapLoaded(GameMap map,
java.lang.String name)
If the player applies a teleporter for a map that hasn't been loaded yet, this method gets called when the map finishes loading. |
void |
mapLoadFailed(java.lang.String name)
Called when the requested map couldn't be loaded. |
void |
message(java.lang.String msg)
Outputs a message to this object. |
void |
message(java.lang.String[] strings,
byte[] styles)
Sends a message to the client as an array of strings and styles to use for each piece. |
void |
message(java.lang.String msg,
byte style)
Sends a message to the client using the specified style. |
void |
notifyAttacked(Commandable attacker)
Notifies the object it's being attacked. |
boolean |
outranks(Commandable other)
Returns true if this player outranks the passed player. |
void |
pauseSound(java.lang.String id)
Pauses a particular sound. |
void |
playAlert(java.lang.String path)
Plays the specified sound file on the client, one repeat, no delay, and the default gain. |
void |
playAlert(java.lang.String path,
int repeats,
int repeatDelay,
double gain)
Plays the specified alert with custom parameters. |
void |
playDefaultMusic()
The player has switched maps, so figure out the default background music to be playing, and plays it. |
void |
playPriorityMusic(java.lang.String path)
Sets the background music track to the specified file, with the default gain/volume. |
void |
playPriorityMusic(java.lang.String path,
int repeats,
int delay,
double gain)
Plays the specified music with custom parameters. |
void |
playSound(java.lang.String path,
java.lang.String id)
Plays a sound effect on the client with the default gain. |
void |
playSound(java.lang.String path,
java.lang.String id,
int repeats,
int repeatDelay,
double gain)
Plays the specified sound effect with custom parameters. |
protected void |
processStartupCommands()
Gets the list of startup commands from the "startcmds" StringList property, and puts each one in the agent's queue. |
void |
quit()
Dumps the player out of the game, dropping all inventory before saving the player. |
void |
quitSafely()
Player's quitting in an Inn or somewhere they can keep their inventory. |
void |
readAliases()
Rebuilds the table of aliases for this player, by looking through all the player's properties that start with "alias-". |
void |
reconnect(RemoteClient client,
Dimension viewsize)
Reconnects a net-dead player. |
void |
registerCommand(java.lang.String command,
Command handler)
Registers a new command with the monster or player. |
void |
remove()
Removes this object from its map. |
void |
resetIdleTimer()
Resets the number of seconds the player has been idle to zero. |
void |
restart()
Resets the player after dying. |
void |
resumeSound(java.lang.String id)
Resumes a particular sound. |
boolean |
save()
Saves the player with notification. |
void |
sendFile(java.lang.String path,
java.lang.String command)
Downloads a file to the client. |
void |
sendFood()
Updates player's food display on the client. |
void |
sendHP()
Updates the player's hit-points display on the client. |
void |
sendImage(java.lang.String path)
|
void |
sendLevel()
Updates player's level display on the client. |
void |
sendLoad()
Updates the player's encumbrance display on the client. |
void |
sendName()
Updates the player's name on the client. |
void |
sendPicture(java.lang.String path,
java.lang.String title)
Sends a picture to the client. |
void |
sendPicture(java.lang.String path,
java.lang.String title,
byte format,
byte align,
byte view,
int flags)
Sends a picture to the client. |
void |
sendRange()
Updates the player's range-weapon on the client. |
void |
sendSP()
Updates the player's spell-points display on the client. |
void |
sendSpells()
Resends the player's list of known spells to the client. |
void |
sendTile(int tile,
java.lang.String path,
long timestamp)
|
void |
sendXP()
Updates the player's experience display on the client. |
void |
serverTransfer(java.lang.String host)
Tells the client to connect to a different server after a successful transfer. |
void |
setEncumbrance(int load)
Sets the encumbrance of the player. |
void |
setHeart(Heart heart)
|
void |
setHP(int hp)
Sets the current HP for the player, but keeps it within the valid range of (0, "max-hp") |
void |
setLevelProperties()
Initializes default properties based on the monster's level. |
void |
setMap(GameMap map,
int x,
int y)
Puts the player in a new map. |
void |
setMusicGain(double gain)
Sets the volume of the background music. |
void |
setNetDead()
Sets the net-dead flag. |
void |
setSession(wyvern.server.IClientSession session)
Sets the ClientSession (the thread reading from the socket). |
void |
setSoundGain(java.lang.String id,
double gain)
Sets the volume of a particular sound playing on the client. |
void |
setSP(int sp)
Sets the current SP for the player, but keeps it within the valid range of (0, "max-sp") |
void |
setTitle(java.lang.String title)
Sets the player's title, e.g. |
void |
setViewSize(int width,
int height)
Sets new dimensions for the map camera. |
boolean |
solvedQuest(java.lang.String name)
Returns true if the player has solved the specified quest. |
void |
startPoison()
Turns the client HP indicator green. |
void |
stop()
Stops the player permanently. |
void |
stopAllSounds()
Stops all of the currently playing sounds on the client. |
void |
stopMusic()
Stops the background music completely. |
void |
stopPoison()
Returns the client HP indicator red. |
void |
stopSound(java.lang.String id)
Stops the specified sound effect. |
void |
tellLater(java.lang.String msg,
byte style)
Puts a message in the player's event queue that will be displayed to the player after all current events in the queue are processed. |
java.lang.String |
toString()
Prints information about the player. |
void |
uncacheImage(java.lang.String path)
Tells the client to uncache the specified image, and request it to be reloaded if it views it again. |
void |
unregisterCommand(java.lang.String command,
Command handler)
Unregisters a command. |
void |
updateClient()
Sends all our visible stats to the client. |
void |
updateCombat()
Marks the player as being in combat. |
protected void |
updateMapLocation(java.util.List src,
java.util.List dest)
This method is called by move(), teleport() and setLocations() to remove the object from its old locations and place it in its new locations. |
void |
viewMap(GameMap map,
int x,
int y)
This is used by the World object to show what's going on in the map while the player is logging in. |
void |
wakeMonsters()
Maybe wakes up nearby monsters. |
Methods inherited from class wyvern.kernel.monsters.MonsterImpl |
addCustomAttacks, addToMap, adjustStat, checkDirection, createGenericAttacks, dropAll, dropAllForce, generateInventory, getDamagedDescription, getHP, getInventory, getLevel, getMaxHP, getMaxSP, getPartsList, getSP, getWallet, initialize, initInventory, isAlive, isAttackable, isHostile, isMonsterOrPlayer, isNeutral, isPeaceful, methodCalled, mouseClicked, setDefaultAttackSpeed, snuffActiveSpells, start |
Methods inherited from class wyvern.kernel.commands.AbstractCommandable |
addAttack, addHook, addMessageListener, addMethodHook, checkAnimated, command, commandNow, fireMessageReceived, getAI, getCapName, getEncumbrance, getFiringPoint, getHookList, getHooks, getQueue, isCommandable, isStarted, removeAttack, removeHook, removeMessageListener, removeMethodHook, runFailedPostHook, runMethodHook, runPostHook, runPreHook, setAI, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface wyvern.lib.Monster |
adjustStat, dropAll, dropAllForce, getLevel, getMaxSP, getPartsList, getSP, getWallet, isAlive |
Methods inherited from interface wyvern.lib.Commandable |
addAttack, addMessageListener, command, commandNow, getAI, getCapName, getEncumbrance, getFiringPoint, getInventory, getQueue, isStarted, removeAttack, removeMessageListener, setAI, setName, start |
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.lib.properties.Damageable |
getHP, getMaxHP |
Constructor Detail |
public PlayerImpl()
Method Detail |
public void computeStartTime()
public void init(RemoteClient client, Dimension viewsize)
Player
init
in interface Player
client
- the RemoteClient used for sending information.viewsize
- the size of the client's map viewportpublic void reconnect(RemoteClient client, Dimension viewsize)
Player
reconnect
in interface Player
client
- the new RemoteClient handling server outputviewsize
- the client view width and heightpublic void readAliases()
readAliases
in interface Player
protected void processStartupCommands()
public java.util.Map getAliases()
Player
getAliases
in interface Player
public void setLevelProperties()
MonsterImpl
setLevelProperties
in class MonsterImpl
public void broadcastEntry(boolean entered)
entered
- true if the player is entering; false if leavingpublic boolean isNetDead()
Player
isNetDead
in interface Player
public java.lang.String getHostAddress()
Player
getHostAddress
in interface Player
public java.lang.String getPassword()
Player
getPassword
in interface Player
public void serverTransfer(java.lang.String host)
Player
serverTransfer
in interface Player
host
- the host of the server the player is now visitingpublic void sendFile(java.lang.String path, java.lang.String command)
Player
sendFile
in interface Player
path
- the relative path to the file. There are
restrictions on what file extensions are allowed - call
wyvern.server.request.SendFile.getApprovedExtensions()
to see which ones it will send. There are also limits
on max file size: SendFile.MAX_DATA_FILE_LENGTH is the
current limit.command
- the original "#download public java.lang.String getName()
Commandable
getName
in interface Commandable
getName
in class AbstractCommandable
public java.lang.String getTitle()
Player
getTitle
in interface Player
protected java.lang.String computeTitle()
public boolean isHallOfFamer()
public void setTitle(java.lang.String title)
Player
setTitle
in interface Player
title
- the new title for the playerpublic int getAge()
Player
getAge
in interface Player
public Command getCommand(CommandEvent event)
Commandable
Asks the Commandable to look in its table of registered commands to find a Command to handle the specified command.
getCommand
in interface Commandable
getCommand
in class AbstractCommandable
public void message(java.lang.String msg)
Commandable
Mostly used by Player and subclasses; monsters ignore messages by default (but they can intercept them if they like). Spells could conceivably be voice-activated too.
message
in interface Commandable
message
in class AbstractCommandable
public void message(java.lang.String msg, byte style)
Commandable
message
in interface Commandable
message
in class MonsterImpl
public void message(java.lang.String[] strings, byte[] styles)
Commandable
message
in interface Commandable
message
in class MonsterImpl
public void sendPicture(java.lang.String path, java.lang.String title, byte format, byte align, byte view, int flags)
Commandable
sendPicture
in interface Commandable
sendPicture
in class AbstractCommandable
public void sendPicture(java.lang.String path, java.lang.String title)
Commandable
The image is sent to the server-output window on the client, and it's left aligned by default. You can use the overloaded version of sendPicture to control the alignment and/or view that you want for the image. The image is assumed to be a GIF.
sendPicture
in interface Commandable
sendPicture
in class AbstractCommandable
public void tellLater(java.lang.String msg, byte style)
Player
tellLater
in interface Player
msg
- the message to sendstyle
- the RPCConstants.TextStylepublic void command(java.lang.String cmd, boolean user)
command
in interface Commandable
command
in class AbstractCommandable
cmd
- the command that was entereduser
- true if player-originatedpublic void enqueueCommand(java.lang.String command, boolean user)
Player
enqueueCommand
in interface Player
command
- the command stringuser
- true if the command was initiated by the player,
false if it came from an object on the server (such as a
charm-monster spell).public void registerCommand(java.lang.String command, Command handler)
Commandable
When the monster or player enters the command, the passed callback object will be notified so it can execute the command.
registerCommand
in interface Commandable
registerCommand
in class AbstractCommandable
public void unregisterCommand(java.lang.String command, Command handler)
Commandable
unregisterCommand
in interface Commandable
unregisterCommand
in class AbstractCommandable
public void viewMap(GameMap map, int x, int y)
viewMap
in interface Player
map
- the map to viewx
- the map x coordinatey
- the map y coordinatepublic void createInventory()
createInventory
in interface Monster
createInventory
in class MonsterImpl
public void ensureAI()
ensureAI
in class MonsterImpl
public void kill(GameObject attacker)
kill
in interface Damageable
kill
in class MonsterImpl
attacker
- the thing that killed the playerpublic void burial(GameObject attacker)
burial
in interface Monster
burial
in class MonsterImpl
attacker
- the agent who killed us (can be null)public void makeGravestone(GameObject attacker, int xpLost, int guildXpLost)
public void restart()
public java.lang.String toString()
toString
in class MapObject
public void setMap(GameMap map, int x, int y)
setMap
in interface GameObject
setMap
in class MonsterImpl
map
- the GameMap we're moving to.x
- map x coordinatey
- map y coordinatepublic void remove()
GameObject
remove
in interface GameObject
remove
in class MonsterImpl
protected void updateMapLocation(java.util.List src, java.util.List dest)
MapObject
updateMapLocation
in class MapObject
src
- the location list that the object occupied.dest
- the new positions to usepublic void wakeMonsters()
public boolean save()
Player
save
in interface Player
public boolean autosave()
Player
autosave
in interface Player
public void quitSafely()
Player
Lots of things happen in this method:
When a player quits, a pubsub message is published. The Message sent out has the following attributes:
Registering for this PubSub message is easier and more reliable than using the quitPostHook. The quitPostHook is only run if the player types "quit". If the player applies a bed, or is booted off the game, then you won't get the hook callback. The PubSub message goes out no matter how the player leaves the game.
quitSafely
in interface Player
public void stop()
stop
in interface Commandable
stop
in class MonsterImpl
public void destroy()
destroy
in interface GameObject
destroy
in class AbstractCommandable
public void quit()
Player
quit
in interface Player
public void dropInventoryIfGuest()
public void setSession(wyvern.server.IClientSession session)
Player
setSession
in interface Player
session
- the thread reading from the client socketpublic wyvern.server.IClientSession getSession()
Player
getSession
in interface Player
public boolean isShutDown()
Player
isShutDown
in interface Player
public void updateClient()
Player
updateClient
in interface Player
public java.lang.String getFullTitle()
Player
getFullTitle
in interface Player
public void sendHP()
Player
sendHP
in interface Player
public void sendSP()
Player
sendSP
in interface Player
public void sendXP()
Player
sendXP
in interface Player
public void sendLevel()
Player
sendLevel
in interface Player
public void sendFood()
Player
sendFood
in interface Player
public void sendName()
Player
sendName
in interface Player
public void sendRange()
Player
sendRange
in interface Player
public void sendLoad()
Player
sendLoad
in interface Player
public void sendSpells()
Player
sendSpells
in interface Player
protected void ensurePartsList()
MonsterImpl
ensurePartsList
in class MonsterImpl
public SpellList getSpellList()
Player
getSpellList
in interface Player
getSpellList
in class MonsterImpl
public void sendTile(int tile, java.lang.String path, long timestamp)
public void sendImage(java.lang.String path)
public void uncacheImage(java.lang.String path)
uncacheImage
in interface Player
path
- the relative path to the image, such as
wiz/rhialto/images/big_rock (note: no extension).public int getXP()
Player
getXP
in interface Player
public int getXPAward()
Attackable
getXPAward
in interface Attackable
getXPAward
in class MonsterImpl
public void adjustXP(int adjust)
Player
adjustXP
in interface Player
adjust
- a number (possibly negative) to add to the player's xppublic void setHP(int hp)
Monster
setHP
in interface Monster
setHP
in class MonsterImpl
public void setSP(int sp)
Monster
setSP
in interface Monster
setSP
in class MonsterImpl
public void adjustHP(int adjust)
Damageable
adjustHP
in interface Damageable
adjustHP
in class MonsterImpl
public void adjustSP(int adjust)
Monster
adjustSP
in interface Monster
adjustSP
in class MonsterImpl
public int getAlignment()
getAlignment
in interface Player
public void adjustAlign(int adjust)
adjustAlign
in interface Player
adjust
- a number (possibly negative) to add to the player's
"align" property. Runs a method-hook called "align", where
the data parameter is an Integer containing the adjustment.
It's run after the adjustment is applied, so subtract the
adjustment to see what the old alignment was.public void adjustSkill(java.lang.String name, int adjust)
Player
adjustSkill
in interface Player
name
- the skill name, such as "sk-incantation"adjust
- the adjustment (can be negative)public java.lang.String getRace()
Player
getRace
in interface Player
public java.lang.String getSex()
Player
getSex
in interface Player
public int getFood()
Player
getFood
in interface Player
public int getMaxFood()
getMaxFood
in interface Player
public Camera getGroundCamera()
Player
getGroundCamera
in interface Player
public GameObject getGroundObject(int index)
Player
getGroundObject
in interface Player
index
- the 0-based index of the selected item
public Point getPositionInViewport()
getPositionInViewport
in interface Player
public Camera getMapCamera()
Player
getMapCamera
in interface Player
public void controlCamera(boolean control)
Player
controlCamera
in interface Player
control
- false to grab control of the camera, true to
return control to the Player.public void setViewSize(int width, int height)
Player
setViewSize
in interface Player
width
- the new camera view width (in tiles)height
- the new camera view height (in tiles)public void adjustWallet(long amount)
Monster
adjustWallet
in interface Monster
adjustWallet
in class MonsterImpl
public void heartbeat()
heartbeat
in interface HeartbeatCallback
heartbeat
in class MonsterImpl
public Heart getHeart()
public void setHeart(Heart heart)
public int getShoutPoints()
Player
getShoutPoints
in interface Player
public void adjustShoutPoints(int adjust)
Player
adjustShoutPoints
in interface Player
adjust
- a number (possibly negative) to add to the player's shppublic void adjustFood(int adjust)
Player
adjustFood
in interface Player
public EventQueue getCombatQueue()
getCombatQueue
in interface Commandable
getCombatQueue
in class AbstractCommandable
protected void ensureEventQueue()
ensureEventQueue
in class AbstractCommandable
public void notifyAttacked(Commandable attacker)
Attackable
notifyAttacked
in interface Attackable
notifyAttacked
in class MonsterImpl
attacker
- the thing attacking uspublic CommandList getCommandList()
Player
getCommandList
in interface Player
public void startPoison()
Player
startPoison
in interface Player
public void stopPoison()
Player
stopPoison
in interface Player
public void mapLoaded(GameMap map, java.lang.String name)
mapLoaded
in interface MapLoaderListener
map
- the map referencename
- the name of the mappublic void mapLoadFailed(java.lang.String name)
mapLoadFailed
in interface MapLoaderListener
name
- the name of the map that failed.public boolean isTelnet()
Player
isTelnet
in interface Player
isTelnet
in class AbstractCommandable
public RemoteClient getClient()
Player
getClient
in interface Player
public void setNetDead()
Player
setNetDead
in interface Player
public boolean solvedQuest(java.lang.String name)
Player
solvedQuest
in interface Player
name
- the quest name, e.g. "moonquest"
public final boolean isWizard()
Player
isWizard
in interface Player
isWizard
in class MapObject
public final boolean isGuest()
Player
isGuest
in interface Player
public final boolean isPlayer()
GameObject
isPlayer
in interface GameObject
isPlayer
in class MonsterImpl
public final boolean isMonster()
GameObject
isMonster
in interface GameObject
isMonster
in class MonsterImpl
public boolean outranks(Commandable other)
Player
outranks
in interface Player
other
- the other player
public boolean isHandheld()
Player
isHandheld
in interface Player
public void setEncumbrance(int load)
setEncumbrance
in interface Commandable
setEncumbrance
in class AbstractCommandable
load
- the encumbrance from 0-4public int getIdleTime()
Player
getIdleTime
in interface Player
public void resetIdleTimer()
resetIdleTimer
in interface Player
public long getStartTime()
Player
getStartTime
in interface Player
public java.util.Date getStartDate()
Player
getStartDate
in interface Player
public boolean inCombat()
Player
inCombat
in interface Player
public long combatTimeLeft()
Player
combatTimeLeft
in interface Player
public long lastCombat()
Player
lastCombat
in interface Player
public void updateCombat()
Player
updateCombat
in interface Player
public MusicState getMusicState()
Player
getMusicState
in interface Player
public void playAlert(java.lang.String path)
RemoteAudio
Can't be stopped, so use with care.
playAlert
in interface RemoteAudio
playAlert
in class AbstractCommandable
public void playAlert(java.lang.String path, int repeats, int repeatDelay, double gain)
RemoteAudio
Parameters are file path, number of repeats, delay between repeats, and gain (volume). The alert won't play if the path is null or not found on the server. All other params are adjusted to be within the valid range for the parameter, if necessary.
playAlert
in interface RemoteAudio
playAlert
in class AbstractCommandable
public void playDefaultMusic()
RemoteAudio
playDefaultMusic
in interface RemoteAudio
playDefaultMusic
in class AbstractCommandable
public void playPriorityMusic(java.lang.String path)
RemoteAudio
Client sends an "#endmusic" directive back to the server when it's finished playing all the repeats.
When this playMusic() is called, the specified music overrides the current background music. The player is considered to be playing the soundtrack in "priority" mode, meaning that switching maps or combat states won't revert it back to the normal map or combat music.
playPriorityMusic
in interface RemoteAudio
playPriorityMusic
in class AbstractCommandable
public void playPriorityMusic(java.lang.String path, int repeats, int delay, double gain)
RemoteAudio
playPriorityMusic
in interface RemoteAudio
playPriorityMusic
in class AbstractCommandable
public void stopMusic()
RemoteAudio
stopMusic
in interface RemoteAudio
stopMusic
in class AbstractCommandable
public void setMusicGain(double gain)
RemoteAudio
setMusicGain
in interface RemoteAudio
setMusicGain
in class AbstractCommandable
public void playSound(java.lang.String path, java.lang.String id)
RemoteAudio
Client sends a "#endsound id" directive back to the server when the sound finishes playing, unless it was interrupted with stopSound() or stopAllSounds().
playSound
in interface RemoteAudio
playSound
in class AbstractCommandable
public void playSound(java.lang.String path, java.lang.String id, int repeats, int repeatDelay, double gain)
RemoteAudio
playSound
in interface RemoteAudio
playSound
in class AbstractCommandable
public void stopSound(java.lang.String id)
RemoteAudio
stopSound
in interface RemoteAudio
stopSound
in class AbstractCommandable
public void stopAllSounds()
RemoteAudio
stopAllSounds
in interface RemoteAudio
stopAllSounds
in class AbstractCommandable
public void setSoundGain(java.lang.String id, double gain)
RemoteAudio
setSoundGain
in interface RemoteAudio
setSoundGain
in class AbstractCommandable
public void pauseSound(java.lang.String id)
RemoteAudio
pauseSound
in interface RemoteAudio
pauseSound
in class AbstractCommandable
public void resumeSound(java.lang.String id)
RemoteAudio
resumeSound
in interface RemoteAudio
resumeSound
in class AbstractCommandable
public boolean isRobot()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |