rpd:potion_mechanic
Table of Contents
Potion
Potions are consumable items in Remixed Dungeon that provide various beneficial or harmful effects when drunk.
Common Potions
- Potion of Healing - Restores health
- Potion of Strength - Permanently increases strength
- Potion of Experience - Grants experience points
- Potion of Invisibility - Grants temporary invisibility
- Potion of Might - Permanently increases damage and health
- Potion of Purity - Neutralizes harmful gases and curses
Special Potions
- Potion of Levitation - Grants temporary levitation
- Potion of Frost - Freezes enemies in an area
- Potion of Liquid Flame - Creates an explosion of fire
- Potion of Overhealing - Overheals with health regeneration
- Potion of Toxic Gas - Releases a cloud of poisonous gas
- Potion of Paralytic Gas - Creates paralyzing gas
Mechanics
- Drinking: Potions can be drunk directly for their effect
- Moistening: Potions can be used with arrows to create special ammunition
- Alchemy: Potions can be used in alchemy recipes
- Identifying: Unidentified potions must be thrown or drunk to learn their effect
- Shattering: When thrown at terrain other than traps or pits, potions shatter and have no effect
Identification
- Potions have different colors that hint at their effects
- Once identified, the color becomes fixed for that character
- Identification is permanent for that specific potion type
- Harmful potions (Liquid Flame, Frost, Toxic Gas, Paralytic Gas) default to throwing action when known
Data Validation
- Information source: Potion.java
- All potion types extend the base Potion class
Source Code
- Potion.java - Base potion class
- Potions directory - Individual potion implementations
Code References
- Base Class: Potion.java - Implements base mechanics for all potions
- Potion Types Array: potions array - Contains all potion classes in the game
- Image Handling: images array - Defines the 13 different potion sprites
- Color System: color() method - Gets color name from string resources
- Identification System: ItemStatusHandler - Manages potion identification state
- Harmful Potions: knownHamful() method - Logic for harmful potions (Liquid Flame, Toxic Gas, Paralytic Gas, Frost)
- Drink Confirmation: drink confirmation dialog - For harmful potions
- Throw Confirmation: throw confirmation dialog - For beneficial potions
- Shatter Mechanics: onThrow method - Handles when potions shatter
- Splash Effect: splash method - Visual effect when potions shatter
- Quality Factor: qualityFactor method - Affects effects in subclasses
- Moistening System: moisten mechanism - Converts potions to special arrows
- Potion Belt Integration: bag method - Potions can be stored in Potion Belt
- String Resources: Potion string resources - Names and descriptions for all potions
- Potion Colors: Potion color arrays - 13 different color names for potions
- Drink Action: AC_DRINK - Action to drink potions
- Moisten Action: AC_MOISTEN - Action to moisten items with potions
- Shatter Sound: Assets.SND_SHATTER - Sound when potions shatter
- Drink Sound: Assets.SND_DRINK - Sound when potions are drunk
- Color Determination: color determination - Gets colors from R.array.Potion_Colors string resource
- Price Calculation: price method - Base price is 20 gold
- Stackability: stackable = true - Potions can be stacked
- Item Overlay Labels: overlayIndex method - Shows label index for identified potions
- Time to Drink: TIME_TO_DRINK - Takes 1 turn to drink
- Time to Moisten: TIME_TO_MOISTEN - Takes 1 turn to moisten items
- Badge Tracking: Badges.validateAllPotionsIdentified - Tracks when all potions are identified
- Potion Images: ItemsSlices.txt - Defines potion sprite locations in items/potions.png
- Potion Types Initialization: initColors() method - Initializes potion color mapping
- Splash Colors: splashColors array - Extracts colors from potion sprites for splash effects
- Item Status Handler: ItemStatusHandler class - Handles the identification system for potions
- Frost Protection: PotionBelt class - Protects potions from freezing
- Moistenable Items: moisten system - Supports arrows, scrolls, and rotten food
- Action System: actions() method - Adds drink and moisten actions to hero actions
- Default Action: setDefaultAction(CommonActions.AC_DRINK) - Default is to drink unless the potion is known to be harmful
- Machine-readable data: mr:potion_mechanic
See Also
- Potions - List of all potions
- Moistening - Using potions to create special arrows
- Alchemy - Using potions in recipes
rpd/potion_mechanic.txt · Last modified: by 127.0.0.1

