public class Effect extends java.lang.Object implements SaveElement
Constructor and Description |
---|
Effect(java.lang.String id,
org.newdawn.slick.Image iconImg,
Modifiers bonuses,
int dot,
int duration,
EffectType type,
EffectSource source,
org.newdawn.slick.GameContainer gc)
Effect constructor
|
Effect(java.lang.String id,
org.newdawn.slick.Image iconImg,
Modifiers bonuses,
int dot,
int duration,
EffectType type,
java.lang.String savedOwnerId,
java.lang.String savedSourceId,
org.newdawn.slick.GameContainer gc)
Effect constructor(with saved source ID)
|
Modifier and Type | Method and Description |
---|---|
void |
affect(Targetable target)
Starts affect on specified character
|
int |
getDuration() |
java.lang.String |
getId()
Returns effect Id
|
java.lang.String |
getInfo()
Returns effect info
|
org.w3c.dom.Element |
getSave(org.w3c.dom.Document doc)
Parses object to XML document element
|
EffectSource |
getSource()
Returns source of this effect(may return NULl)
|
java.lang.String |
getSourceId()
Returns string with effect ID and source ID
|
EffectTile |
getTile()
Returns effect UI icon
|
int |
getTime()
Returns current effect time
|
EffectType |
getType()
Returns effect type
|
boolean |
isOn() |
void |
removeFrom(Targetable target)
Removes affect from specified character
|
void |
setTime(int timeInMillis)
Sets current effect time
|
boolean |
turnOn(Targetable target)
Starts effect timer
|
void |
updateTime(int delta)
Updates effect time
|
public Effect(java.lang.String id, org.newdawn.slick.Image iconImg, Modifiers bonuses, int dot, int duration, EffectType type, EffectSource source, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
id
- Effect IDimgName
- Effect icon image namebonuses
- Effect bonusesdot
- Damage over timeduration
- Effect durationtype
- Effect Typesource
- Effect source, e.g. skill or itemgc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public Effect(java.lang.String id, org.newdawn.slick.Image iconImg, Modifiers bonuses, int dot, int duration, EffectType type, java.lang.String savedOwnerId, java.lang.String savedSourceId, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
id
- Effect IDimgName
- Effect icon image namebonuses
- Effect bonusesdot
- Damage over timeduration
- Effect durationtype
- Effect TypesavedSourceId
- Saved serial ID of effect source(source restored later in update)gc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public void affect(Targetable target)
character
- Some game characterpublic void removeFrom(Targetable target)
target
- Some game characterpublic int getDuration()
public EffectType getType()
public boolean isOn()
public void updateTime(int delta)
delta
- Time from last game loop updatepublic boolean turnOn(Targetable target)
public void setTime(int timeInMillis)
timeInMillis
- Time in millisecondspublic int getTime()
public EffectTile getTile()
public java.lang.String getId()
public java.lang.String getSourceId()
public EffectSource getSource()
public java.lang.String getInfo()
public org.w3c.dom.Element getSave(org.w3c.dom.Document doc)
SaveElement
getSave
in interface SaveElement
doc
- XML document for save game