Package com.prineside.tdi2.abilities
Class BallLightningAbility
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Ability
com.prineside.tdi2.abilities.BallLightningAbility
- All Implemented Interfaces:
KryoSerializable
Ball lightning ability implementation.
Enum: AbilityType.BALL_LIGHTNING
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.prineside.tdi2.Ability
Ability.Factory<T extends Ability>
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat
Time (in seconds) between charges.float
Damage of one hit of lightning.static final float
Default value of the attackInterval field.float
Total duration (in seconds) of life of the ball lightning.Tower responsible for starting this ability, will be null if started by the player.Fields inherited from class com.prineside.tdi2.Registrable
S
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(int x, int y, double mdps) Configures ability before it can be started.void
Called byAbilitySystem.draw(Batch, float)
each frame.void
drawBatchAdditive
(Batch batch, float deltaTime) Called byAbilitySystem.drawBatchAdditive(Batch, float)
(Batch, float)} each frame.boolean
isDone()
Used to check if the ability has finished running.void
boolean
start()
Starts the ability.void
update
(float deltaTime) Called by the AbilitySystem each frame to update the state of this ability.void
Methods inherited from class com.prineside.tdi2.Ability
getKilledEnemiesCoinMultiplier, getType, onDone, startEffects
Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
DEFAULT_ATTACK_INTERVAL
public static final float DEFAULT_ATTACK_INTERVALDefault value of the attackInterval field.- See Also:
-
duration
public float durationTotal duration (in seconds) of life of the ball lightning. Can be increased while ability is still active to prolong its duration. -
damage
public float damageDamage of one hit of lightning. -
launchedByTower
Tower responsible for starting this ability, will be null if started by the player. -
attackInterval
public float attackIntervalTime (in seconds) between charges.
-
-
Method Details
-
write
- Specified by:
write
in interfaceKryoSerializable
- Overrides:
write
in classAbility
-
read
- Specified by:
read
in interfaceKryoSerializable
- Overrides:
read
in classAbility
-
configure
public void configure(int x, int y, double mdps) Description copied from class:Ability
Configures ability before it can be started. Sets the position on map where this ability will start - depending on ability type, it can apply an effect in that point. Some abilities can ignore the position completely. -
start
public boolean start()Description copied from class:Ability
Starts the ability. Normally only called by theAbilitySystem
and not manually. UseAbilitySystem.startAbility(Ability)
to trigger the events and handle the ability properly. -
update
public void update(float deltaTime) Description copied from class:Ability
Called by the AbilitySystem each frame to update the state of this ability. -
isDone
public boolean isDone()Description copied from class:Ability
Used to check if the ability has finished running. Used by theAbilitySystem
to finish the handling of the ability. -
draw
Description copied from class:Ability
Called byAbilitySystem.draw(Batch, float)
each frame. Allows to update realtime graphics of the ability. -
drawBatchAdditive
Description copied from class:Ability
Called byAbilitySystem.drawBatchAdditive(Batch, float)
(Batch, float)} each frame. Allows to update realtime graphics of the ability and render additive graphics on top of the regular (draw) ones.- Overrides:
drawBatchAdditive
in classAbility
- Parameters:
batch
- Batch used for renderingdeltaTime
- delta time since the last frame (dynamic)
-