Class BasePotion

java.lang.Object
gameelement.potion.BasePotion
Direct Known Subclasses:
DreamMistPotion, EnergySplashPotion, NovaSparkPotion, PassionPopPotion, SoothingLovePotion, StarloveCharmPotion

public abstract class BasePotion extends Object
Base model for potions created by merging two elements.
  • Field Details

    • potionName

      protected String potionName
      Potion display name.
    • potionType

      protected PotionType potionType
      Potion type used for matching soul weakness.
    • potionPower

      protected int potionPower
      Damage dealt by this potion.
    • imagePath

      protected String imagePath
      Potion image resource path.
    • potionRecipe

      protected List<Class<? extends BaseElement>> potionRecipe
      Element classes required to create this potion.
  • Constructor Details

    • BasePotion

      public BasePotion(String potionName, String imagePath)
      Creates a potion with its display name and image resource path.
      Parameters:
      potionName - potion name shown by the game
      imagePath - resource file used for the potion image
  • Method Details

    • getPotionName

      public String getPotionName()
      Gets the potion display name.
      Returns:
      potion name
    • getImagePath

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

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

      public List<Class<? extends BaseElement>> getPotionRecipe()
      Gets the two element classes required to create this potion.
      Returns:
      recipe element classes
    • setPotionRecipe

      public void setPotionRecipe(List<Class<? extends BaseElement>> potionRecipe)
      Sets the element classes required to create this potion.
      Parameters:
      potionRecipe - recipe element classes
    • potionMatchesRecipe

      public abstract boolean potionMatchesRecipe(List<BaseElement> elements)
      Checks whether the selected elements match this potion recipe.
      Parameters:
      elements - selected elements from the merge station
      Returns:
      true when the recipe is correct
    • setPotionName

      public void setPotionName(String potionName)
      Sets the potion display name.
      Parameters:
      potionName - potion name
    • getPotionType

      public PotionType getPotionType()
      Gets the potion type used for soul weakness matching.
      Returns:
      potion type
    • setPotionType

      public void setPotionType(PotionType type)
      Sets the potion type used for soul weakness matching.
      Parameters:
      type - potion type
    • getPotionPower

      public int getPotionPower()
      Gets the damage power of this potion.
      Returns:
      potion damage power
    • setPotionPower

      public void setPotionPower(int potionPower)
      Sets the potion damage power and clamps negative values to zero.
      Parameters:
      potionPower - potion damage power