mr:ankh_item
Table of Contents
Ankh Item - Code References
Java Classes
- Ankh.java - Main item class implementing resurrection logic
- WndResurrect.java - Resurrection confirmation window
- Hero.java - Calls Ankh.resurrect() on hero death (line 600)
- Dungeon.java - Checks for Ankh possession (line 796)
- Statistics.java - Tracks ankhsUsed statistic
- WndRanking.java - Displays “Ankhs Used” in ranking screen
- ShopPainter.java - Shopkeeper may sell Ankh (line 143)
- ItemFactory.java - Registers Ankh item class (line 243)
- ItemSpriteSheet.java - Defines ANKH sprite index (line 121)
JSON Configuration
This entity is implemented in Java, no JSON configuration exists
String Resources
<string name="Ankh_Name">Ankh</string> <string name="Ankh_Info">This ancient symbol of immortality grants an ability to return to life after death. Upon resurrection all non-equipped items are lost.</string> <string name="Dungeon_Tips_13">There is no sense in possessing more than one Ankh at the same time, because you will lose them upon resurrecting.</string> <string name="WndRanking_StaAnkhs">Ankhs Used</string>
Lua Scripts
This entity is implemented in Java, no Lua script exists
Entity Kind
- Entity Kind: Ankh (returns class simple name via getEntityKind())
- Item Type: Key/Resurrection item
- Stackable: Yes (stackable = true)
- Identified: Always identified (isIdentified() returns true)
- Upgradable: No (isUpgradable() returns false)
- Price: 50 gold per unit (price() returns 50 * quantity)
- Sprite: ItemSpriteSheet.ANKH (index 1)
Resurrection Mechanics
- Method: public static boolean resurrect(@NotNull Char chr, NamedEntityKind cause)
- Process:
1. Checks if character has Ankh in belongings
2. Removes Ankh from belongings 3. For non-Hero characters: calls chr.resurrect() immediately 4. For Hero: shows WndResurrect window to give player choice * **Consumption:** Ankh is consumed on successful resurrection * **Side Effect:** All non-equipped items are lost upon resurrection
Related Information
- The Ankh allows resurrection after death but causes loss of all non-equipped items
- Only one Ankh should be carried at a time due to consumption on use
- Implemented as a static method
resurrectthat can be called for any Char - Uses WndResurrect window for hero resurrection to give player choice
- Statistics track total ankhs used across all runs
mr/ankh_item.txt · Last modified: by 127.0.0.1
