Class BlizzardAbility

java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Ability
com.prineside.tdi2.abilities.BlizzardAbility
All Implemented Interfaces:
KryoSerializable, Listener<EnemySpawn>

public class BlizzardAbility extends Ability implements Listener<EnemySpawn>
Blizzard ability implementation. Enum: AbilityType.BLIZZARD
  • Field Details

  • Method Details

    • write

      public void write(Kryo kryo, Output output)
      Specified by:
      write in interface KryoSerializable
      Overrides:
      write in class Ability
    • read

      public void read(Kryo kryo, Input input)
      Specified by:
      read in interface KryoSerializable
      Overrides:
      read in class Ability
    • 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.
      Specified by:
      configure in class Ability
      Parameters:
      x - X position (px) where this ability will start
      y - Y position (px) where this ability will start
      mdps - MDPS value which will be used to calculate the efficiency of this ability. Normally S.enemy.getTowersMaxDps() is used here.
    • start

      public boolean start()
      Description copied from class: Ability
      Starts the ability. Normally only called by the AbilitySystem and not manually. Use AbilitySystem.startAbility(Ability) to trigger the events and handle the ability properly.
      Overrides:
      start in class Ability
      Returns:
      true if started, false if can't start and should be ignored
    • update

      public void update(float deltaTime)
      Description copied from class: Ability
      Called by the AbilitySystem each frame to update the state of this ability.
      Specified by:
      update in class Ability
      Parameters:
      deltaTime - delta time since the last frame (fixed)
    • isDone

      public boolean isDone()
      Description copied from class: Ability
      Used to check if the ability has finished running. Used by the AbilitySystem to finish the handling of the ability.
      Specified by:
      isDone in class Ability
      Returns:
      true if ability has finished running and can be unregistered from the game state
    • onDone

      public void onDone()
      Description copied from class: Ability
      Called by the AbilitySystem once it realizes that the ability Ability.isDone() but before the ability gets unregistered. Usually used by the implementations of this class to remove particle effects and event listeners.
      Overrides:
      onDone in class Ability
    • draw

      public void draw(Batch batch, float deltaTime)
      Description copied from class: Ability
      Called by AbilitySystem.draw(Batch, float) each frame. Allows to update realtime graphics of the ability.
      Specified by:
      draw in class Ability
      Parameters:
      batch - Batch used for rendering
      deltaTime - delta time since the last frame (dynamic)
    • handleEvent

      public void handleEvent(EnemySpawn event)
      Description copied from interface: Listener
      Called each time an event is being triggered
      Specified by:
      handleEvent in interface Listener<EnemySpawn>
      Parameters:
      event - event object passed by someone. Some events can be stopped or cancelled