 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.spells;
30 import java.util.Locale;
31 import org.jetbrains.annotations.NotNull;
252 boolean changed =
false;
259 if (this.tag !=
tag) {
264 if (!this.message.equals(
message)) {
269 if (this.level !=
level) {
279 if (this.mana !=
mana) {
284 if (this.grace !=
grace) {
289 if (this.damage !=
damage) {
294 if (this.skill !=
skill) {
299 if (this.path !=
path) {
324 boolean changed =
false;
326 if (updateMana && this.mana !=
mana) {
331 if (updateGrace && this.grace !=
grace) {
336 if (updateDamage && this.damage !=
damage) {
358 final StringBuilder sb =
new StringBuilder(
"<b>");
359 sb.append(
name.substring(0, 1).toUpperCase(Locale.ENGLISH)).append(
name.substring(1));
362 sb.append(
" (unknown)");
365 sb.append(Integer.bitCount(
path) == 1 ?
"<br>Spell path:" :
"<br>Spell paths:");
371 sb.append(
"<br>Skill: ").append(sk);
374 sb.append(
"<br>Level: ");
378 sb.append(
" (attuned => ");
382 sb.append(
" (repelled => ");
389 sb.append(
"<br>Mana: ").append(
mana);
392 sb.append(
"<br>Grace: ").append(
grace);
395 sb.append(
"<br>Damage: ").append(
damage);
398 sb.append(
"<br><b>You are denied from casting this spell.</b>");
412 listener.spellChanged();
void removeSpellListener(@NotNull final SpellListener listener)
Removes a SpellListener to be notified of changes.
int skill
The spell's skill.
int castingTime
The casting time.
int mana
The mana needed to cast the spell.
int getLevel()
Returns the spell level.
String message
The description.
static final int CS_STAT_SPELL_ATTUNE
Attuned spell paths of a spell.
boolean unknown
Whether this spell is unknown to the character.
int getPath()
Returns the spell path.
String getMessage()
Returns the description.
Utility class for spell path related functions.
Interface for listeners interested in Spell related events.
int getFaceNum()
Returns the face number.
int getCastingTime()
Returns the casting time.
Spell(@NotNull final String name, @NotNull final SkillSet skillSet, @NotNull final Stats stats)
Creates a new instance.
static final int CS_STAT_SPELL_DENY
Denied spell paths of a spell.
void addSpellListener(@NotNull final SpellListener listener)
Adds a SpellListener to be notified of changes.
int getGrace()
Returns the grace needed to cast the spell.
A list of event listeners.
final EventListenerList2< SpellListener > listeners
The SpellListeners to be notified of changes.
Describes a Crossfire spell.
final String name
The spell name.
int getTag()
Returns the tag ID.
static final int CS_STAT_SPELL_REPEL
Repelled spell paths of a spell.
One skill of the character.
static String splitAsHtml(@NotNull final String message)
Splits the given string into lines and returns the lines separated by "<br>".
int level
The spell level.
Skill getSkill(final int id)
Returns the given skill as a Skill object.
void setParameters(final int faceNum, final int tag, @NotNull final String message, final int level, final int castingTime, final int mana, final int grace, final int damage, final int skill, final int path)
Updates the spell's parameters.
void fireChanged()
Notifies all listeners.
This is the representation of all the statistics of a player, like its speed or its experience.
Utility class for splitting strings.
int damage
The damage done by the spell.
boolean isUnknown()
Returns whether this spell is unknown to the character.
void updateParameters(final boolean updateMana, final int mana, final boolean updateGrace, final int grace, final boolean updateDamage, final int damage)
Updates the spell's parameters.
int getDamage()
Returns the damage done by the spell.
int faceNum
The face number.
static void appendSpellPaths(final int path, @NotNull final StringBuilder sb)
Appends a human-readable description of a set of spell paths to a StringBuilder instance.
String getName()
Returns the spell name.
final Stats stats
Attuned, repelled or denied information.
Maintain the set of skills as sent by the server.
int getStat(final int statNo)
Returns the numerical value of the given statistic.
int grace
The grace needed to cast the spell.
final SkillSet skillSet
To get the skill's name, see SkillSet.
String getTooltipText()
Returns a description for this spell to be used in tooltips.
int getLevel()
Returns the skill level.
void setUnknown(final boolean unknown)
Marks this spell as known or unknown for the character.
int getSkill()
Returns the spell's skill.
int getMana()
Returns the mana needed to cast the spell.