Class Pirate

java.lang.Object
com.mygdx.game.Components.Component
com.mygdx.game.Components.Pirate

public class Pirate
extends Component
Gives the concepts of health plunder, etc. Allows for firing of cannonballs, factions, death, targets
  • Field Details

    • isAlive

      protected boolean isAlive
  • Constructor Details

    • Pirate

      public Pirate()
  • Method Details

    • addTarget

      public void addTarget​(Ship target)
    • getPlunder

      public int getPlunder()
    • addPlunder

      public void addPlunder​(int money)
    • getFaction

      public Faction getFaction()
    • setFactionId

      public void setFactionId​(int factionId)
    • takeDamage

      public void takeDamage​(float dmg)
    • shoot

      public void shoot​(com.badlogic.gdx.math.Vector2 dir)
      Will shoot a cannonball assigning this.parent as the cannonball's parent (must be Ship atm)
      Parameters:
      dir - the direction to shoot in
    • reload

      public void reload​(int ammo)
      Adds ammo
      Parameters:
      ammo - amount to add
    • getHealth

      public int getHealth()
    • canAttack

      public boolean canAttack()
      if dst to target is less than attack range target will be null if not in agro range
    • isAgro

      public boolean isAgro()
      if dst to target is >= attack range target will be null if not in agro range
    • getTarget

      public Ship getTarget()
    • removeTarget

      public void removeTarget()
    • isAlive

      public boolean isAlive()
    • kill

      public void kill()
      Kill its self
    • setAmmo

      public void setAmmo​(int ammo)
    • getAmmo

      public int getAmmo()
    • targetCount

      public int targetCount()
    • getTargets

      public QueueFIFO<Ship> getTargets()