|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.player.MusicManager
Handles switching background music.
Field Summary | |
static double |
LOW_HP_THRESHOLD
The ratio of hp/maxhp below which the time-running-out combat music starts playing. |
Fields inherited from interface wyvern.kernel.player.MusicState.States |
NAMES, NOT_READY, PLAYING, PRIORITY, READY |
Method Summary | |
static boolean |
checkCombat(Player player)
Checks if the player is moving into combat, moving out of combat, continuing combat, or continuing non-combat. |
static void |
endSound(CommandEvent event)
Client is notifying is that it's finished playing a sound. |
static Music |
getMapMusic(Player player)
Retrieves the default music to play for the player, based on their map. |
static void |
noAudio(CommandEvent event)
Client has requested that we send no audio events whatsoever. |
static boolean |
playDefault(Commandable agent)
Figures out the default background music for the specified player, and plays it. |
static boolean |
playPriority(Commandable agent,
java.lang.String path,
int repeats,
int delay,
double gain)
Plays a piece of music at a higher priority than the normal background music. |
static void |
setMusicGain(Player p,
double gain)
Sets the volume for the background music. |
static void |
stopMusic(Player p)
Stops the background music for a given player. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double LOW_HP_THRESHOLD
Method Detail |
public static boolean playDefault(Commandable agent)
agent
- any Commandable - it's ignored unless
it's a Player.
public static boolean playPriority(Commandable agent, java.lang.String path, int repeats, int delay, double gain)
Rules:
Sets the agent's MusicState to PRIORITY.
agent
- the playerpath
- relative path to music to play
public static Music getMapMusic(Player player)
player
- the player to get the music for
public static void endSound(CommandEvent event)
Use Kernel.subscribe() to listen for the message.
event
- the event containing the player whose
client is sending the notification.public static void noAudio(CommandEvent event)
public static boolean checkCombat(Player player)
public static void stopMusic(Player p)
p
- the playerpublic static void setMusicGain(Player p, double gain)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |