Class BasePotion
java.lang.Object
gameelement.potion.BasePotion
- Direct Known Subclasses:
DreamMistPotion, EnergySplashPotion, NovaSparkPotion, PassionPopPotion, SoothingLovePotion, StarloveCharmPotion
Base model for potions created by merging two elements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringPotion image resource path.protected StringPotion display name.protected intDamage dealt by this potion.protected List<Class<? extends BaseElement>> Element classes required to create this potion.protected PotionTypePotion type used for matching soul weakness. -
Constructor Summary
ConstructorsConstructorDescriptionBasePotion(String potionName, String imagePath) Creates a potion with its display name and image resource path. -
Method Summary
Modifier and TypeMethodDescriptionGets the image resource path for this potion.Gets the potion display name.intGets the damage power of this potion.List<Class<? extends BaseElement>> Gets the two element classes required to create this potion.Gets the potion type used for soul weakness matching.abstract booleanpotionMatchesRecipe(List<BaseElement> elements) Checks whether the selected elements match this potion recipe.voidsetImagePath(String imagePath) Sets the image resource path for this potion.voidsetPotionName(String potionName) Sets the potion display name.voidsetPotionPower(int potionPower) Sets the potion damage power and clamps negative values to zero.voidsetPotionRecipe(List<Class<? extends BaseElement>> potionRecipe) Sets the element classes required to create this potion.voidsetPotionType(PotionType type) Sets the potion type used for soul weakness matching.
-
Field Details
-
potionName
Potion display name. -
potionType
Potion type used for matching soul weakness. -
potionPower
protected int potionPowerDamage dealt by this potion. -
imagePath
Potion image resource path. -
potionRecipe
Element classes required to create this potion.
-
-
Constructor Details
-
BasePotion
-
-
Method Details
-
getPotionName
-
getImagePath
-
setImagePath
Sets the image resource path for this potion.- Parameters:
imagePath- image file path
-
getPotionRecipe
Gets the two element classes required to create this potion.- Returns:
- recipe element classes
-
setPotionRecipe
Sets the element classes required to create this potion.- Parameters:
potionRecipe- recipe element classes
-
potionMatchesRecipe
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
Sets the potion display name.- Parameters:
potionName- potion name
-
getPotionType
Gets the potion type used for soul weakness matching.- Returns:
- potion type
-
setPotionType
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
-