public class Spell
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
castingTime
The casting time.
|
private int |
damage
The damage done by the spell.
|
private int |
faceNum
The face number.
|
private int |
grace
The grace needed to cast the spell.
|
private int |
level
The spell level.
|
private EventListenerList2<SpellListener> |
listeners
The
SpellListeners to be notified of changes. |
private int |
mana
The mana needed to cast the spell.
|
private java.lang.String |
message
The description.
|
private java.lang.String |
name
The spell name.
|
private int |
path
The spell path.
|
private int |
skill
The spell's skill.
|
private SkillSet |
skillSet
To get the skill's name, see
SkillSet . |
private Stats |
stats
Attuned, repelled or denied information.
|
private int |
tag
The tag ID.
|
private boolean |
unknown
Whether this spell is unknown to the character.
|
Constructor and Description |
---|
Spell(java.lang.String name,
SkillSet skillSet,
Stats stats)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addSpellListener(SpellListener listener)
Adds a
SpellListener to be notified of changes. |
private void |
fireChanged()
Notifies all listeners.
|
int |
getCastingTime()
Returns the casting time.
|
int |
getDamage()
Returns the damage done by the spell.
|
int |
getFaceNum()
Returns the face number.
|
int |
getGrace()
Returns the grace needed to cast the spell.
|
int |
getLevel()
Returns the spell level.
|
int |
getMana()
Returns the mana needed to cast the spell.
|
java.lang.String |
getMessage()
Returns the description.
|
java.lang.String |
getName()
Returns the spell name.
|
int |
getPath()
Returns the spell path.
|
int |
getSkill()
Returns the spell's skill.
|
int |
getTag()
Returns the tag ID.
|
java.lang.String |
getTooltipText()
Returns a description for this spell to be used in tooltips.
|
boolean |
isUnknown()
Returns whether this spell is unknown to the character.
|
void |
removeSpellListener(SpellListener listener)
Removes a
SpellListener to be notified of changes. |
void |
setParameters(int faceNum,
int tag,
java.lang.String message,
int level,
int castingTime,
int mana,
int grace,
int damage,
int skill,
int path)
Updates the spell's parameters.
|
void |
setUnknown(boolean unknown)
Marks this spell as known or unknown for the character.
|
java.lang.String |
toString() |
void |
updateParameters(boolean updateMana,
int mana,
boolean updateGrace,
int grace,
boolean updateDamage,
int damage)
Updates the spell's parameters.
|
private int castingTime
private int damage
private int faceNum
private int grace
private int level
@NotNull private final EventListenerList2<SpellListener> listeners
SpellListeners
to be notified of changes.private int mana
@NotNull private java.lang.String message
@NotNull private final java.lang.String name
private int path
private int skill
Stats.CS_STAT_SKILLINFO
.private final Stats stats
private int tag
private boolean unknown
public void addSpellListener(@NotNull SpellListener listener)
SpellListener
to be notified of changes.listener
- the listener to addprivate void fireChanged()
public int getCastingTime()
public int getDamage()
public int getFaceNum()
public int getGrace()
public int getLevel()
public int getMana()
@NotNull public java.lang.String getMessage()
@NotNull public java.lang.String getName()
public int getPath()
public int getSkill()
Stats.CS_STAT_SKILLINFO
.public int getTag()
@NotNull public java.lang.String getTooltipText()
public boolean isUnknown()
public void removeSpellListener(@NotNull SpellListener listener)
SpellListener
to be notified of changes.listener
- the listener to removepublic void setParameters(int faceNum, int tag, @NotNull java.lang.String message, int level, int castingTime, int mana, int grace, int damage, int skill, int path)
faceNum
- the face numbertag
- the tag IDmessage
- the descriptionlevel
- the spell levelcastingTime
- the casting timemana
- the mana needed to cast the spellgrace
- the grace needed to cast the spelldamage
- the damage done by the spellskill
- the spell's skillpath
- the spell pathpublic void setUnknown(boolean unknown)
unknown
- whether this spell is unknown@NotNull public java.lang.String toString()
toString
in class java.lang.Object
public void updateParameters(boolean updateMana, int mana, boolean updateGrace, int grace, boolean updateDamage, int damage)
updateMana
- whether to update the manamana
- the mana needed to cast the spellupdateGrace
- whether to update the gracegrace
- the grace needed to cast the spellupdateDamage
- whether to update the damagedamage
- the damage done by the spell