Class BaseSoul

java.lang.Object
gameelement.soul.BaseSoul
Direct Known Subclasses:
DreamMistSoul, EnergySplashSoul, NovaSparkSoul, PassionPopSoul, SoothingLoveSoul, StarloveCharmSoul

public abstract class BaseSoul extends Object
Base model for all souls that appear on the conveyor belt.
  • Constructor Details

    • BaseSoul

      public BaseSoul(int soulHP, PotionType weaknessType, String imagePath)
      Creates a soul with HP, weakness type, and image resource path.
      Parameters:
      soulHP - starting hit points
      weaknessType - potion type that can damage this soul
      imagePath - resource file used for the soul image
  • Method Details

    • getSoulHP

      public int getSoulHP()
      Gets the current soul HP.
      Returns:
      current hit points
    • setSoulHP

      public void setSoulHP(int soulHP)
      Sets soul HP and clamps negative values to zero.
      Parameters:
      soulHP - hit points to set
    • getWeaknessType

      public PotionType getWeaknessType()
      Gets the potion type that can damage this soul.
      Returns:
      weakness potion type
    • setWeaknessType

      public void setWeaknessType(PotionType weaknessType)
      Sets the potion type that can damage this soul.
      Parameters:
      weaknessType - weakness potion type
    • getImagePath

      public String getImagePath()
      Gets the image resource path for this soul.
      Returns:
      image file path
    • setImagePath

      public void setImagePath(String imagePath)
      Sets the image resource path for this soul.
      Parameters:
      imagePath - image file path
    • canbeHitByPotion

      public boolean canbeHitByPotion(BasePotion potion)
      Checks whether the potion matches this soul weakness.
      Parameters:
      potion - potion used for the attack
      Returns:
      true when the potion type matches the weakness
    • takeDamageFromPotion

      public void takeDamageFromPotion(BasePotion potion)
      Applies potion damage when the potion matches this soul weakness.
      Parameters:
      potion - potion used for the attack