22 package com.realtime.crossfire.jxclient.sound;
31 import org.jetbrains.annotations.NotNull;
42 private static final long DELAY = 5000;
76 @SuppressWarnings(
"FieldCanBeLocal")
81 ignoreLevelChange = System.currentTimeMillis()+
DELAY;
85 public void statChanged(
final int statNo,
final int value) {
90 public void simpleWeaponSpeedChanged(
final boolean simpleWeaponSpeed) {
95 public void titleChanged(@NotNull
final String title) {
100 public void rangeChanged(@NotNull
final String range) {
105 public void activeSkillChanged(@NotNull
final String activeSkill) {
110 public void experienceChanged(
final long exp) {
115 public void experienceNextLevelChanged(
final long expNextLevel) {
125 @SuppressWarnings(
"FieldCanBeLocal")
129 public void guiStateChanged(@NotNull
final RendererGuiState rendererGuiState) {
131 ignoreLevelChange = System.currentTimeMillis()+
DELAY;
140 @SuppressWarnings(
"FieldCanBeLocal")
144 public void delinvReceived(
final int tag) {
149 public void delitemReceived(@NotNull
final int[] tags) {
154 public void addItemReceived(
final int location,
final int tag,
final int flags,
final int weight,
final int faceNum, @NotNull
final String name, @NotNull
final String namePl,
final int anim,
final int animSpeed,
final int nrof,
final int type) {
159 public void playerReceived(
final int tag,
final int weight,
final int faceNum, @NotNull
final String name) {
160 ignoreLevelChange = System.currentTimeMillis()+
DELAY;
164 public void upditemReceived(
final int flags,
final int tag,
final int valLocation,
final int valFlags,
final int valWeight,
final int valFaceNum, @NotNull
final String valName, @NotNull
final String valNamePl,
final int valAnim,
final int valAnimSpeed,
final int valNrof) {
194 final boolean newPoisoned = value != 0;
202 final int newLevel = value;
203 if (
level != newLevel) {
219 private void playClip(@NotNull
final String clip) {
void playClip(@NotNull final String clip)
Plays a clip if sounds should be generated.
void guiStateChanged(@NotNull RendererGuiState rendererGuiState)
The gui state has changed.
final RendererGuiStateListener rendererGuiStateListener
The gui state listener.
final SoundManager soundManager
The SoundManager instance to watch.
PLAYING
The playing screen is active.
final CrossfireUpdateItemListener crossfireUpdateItemListener
The CrossfireUpdateItemListener to receive item updates.
static final int CS_STAT_LEVEL
The Global Level stat.
int level
The last known level.
Monitors stat changes and generates appropriate sound effects.
Renders a Gui instance into a Frame.
void playClip(@NotNull final Sounds type, @Nullable final String name, @NotNull final String action)
Plays a sound clip.
boolean poisoned
The last known poisoned state.
A character related sound event.
final StatsListener statsListener
The crossfire stats listener.
All gui states of JXCWindowRenderer.
Interface for listeners interested in changes of Stats instances.
StatsWatcher(@NotNull final Stats stats, @NotNull final JXCWindowRenderer windowRenderer, @NotNull final CrossfireServerConnection server, @NotNull final SoundManager soundManager)
Creates a new instance.
static final int C_STAT_POISONED
The "is poisoned" indicator.
static final String LEVEL_UP
The sound to play when the character gains a new level.
static final String POISON_OFF
The sound to play when the character gets un-poisoned.
void checkStats(final int statNo, final int value)
Checks for changed stats and generate sound effects.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
This is the representation of all the statistics of a player, like its speed or its experience...
boolean active
Whether sounds should be generated.
Interface for listeners interested in item related commands.
static final String POISON_ON
The sound to play when the character get poisoned.
Interface for listeners interested in gui state changes.
long ignoreLevelChange
Ignore level changes until this time has reached.
static final long DELAY
Duration for which to ignore level changes after login.