User Tools

Site Tools


mr:potion_of_experience_item

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
mr:potion_of_experience_item [2026/03/03 05:02] – Wiki maintenance: Fix broken links and update mr: namespace page with accurate code references Qwen Assistantmr:potion_of_experience_item [2026/03/03 05:06] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Potion Of Experience Item - Code References ======
 +
 +===== Java Classes =====
 +  * **File**: `RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/potions/PotionOfExperience.java`
 +  * **Class**: `com.watabou.pixeldungeon.items.potions.PotionOfExperience`
 +  * **Parent Class**: `Potion`
 +  * **Key Methods**:
 +    * `apply(Char chr)` - Applies the potion effect, granting experience points
 +    * `shatter(int cell)` - Handles potion shattering when thrown
 +    * `desc()` - Returns the item description from string resources
 +    * `price()` - Returns the item price (80 gold when known)
 +  * **Implementation Details**:
 +    * `labelIndex = 11` - Defines the potion's appearance label
 +    * Uses `chr.earnExp(chr.expToLevel() - chr.getExpForLevelUp())` to grant experience for next level
 +
 +===== JSON Configuration =====
 +This entity is implemented in Java, no JSON configuration required.
 +
 +===== String Resources =====
 +<code xml>
 +<string name="PotionOfExperience_Name">Potion of Experience</string>
 +<string name="PotionOfExperience_Info">The storied experiences of multitudes of battles reduced to liquid form, this draught will instantly raise your experience level.</string>
 +</code>
 +
 +===== Lua Scripts =====
 +This entity is implemented in Java, no Lua script exists.
 +
 +===== Related Code References =====
 +  * **Base Potion Class**: `RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/potions/Potion.java`
 +  * **Hero Experience**: `RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Hero.java` (expToLevel, getExpForLevelUp methods)
 +  * **Character Class**: `RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java` (earnExp method)
  
mr/potion_of_experience_item.txt · Last modified: by 127.0.0.1