mr:caged_kobold_mob
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| mr:caged_kobold_mob [2025/12/25 18:23] – auto lint fix Mikhael | mr:caged_kobold_mob [2026/03/14 04:39] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Caged Kobold Mob - Code References ====== | ||
| + | |||
| + | **Caged Kobold** is an NPC mob found in the Ice Caves level. He is part of a quest where the player must free him from a cage using an Ice Key. | ||
| + | |||
| + | ===== Java Classes ===== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | ===== Code Analysis ===== | ||
| + | **Class Structure: | ||
| + | * **Package**: | ||
| + | * **Inheritance**: | ||
| + | * **Spawn Method**: static spawn(RegularLevel level, Room room) | ||
| + | * **Interaction Method**: interact(Char hero) | ||
| + | |||
| + | **Quest Mechanics: | ||
| + | * **Quest State Class**: Quest (inner static class) | ||
| + | * **State Variables**: | ||
| + | - `spawned`: Tracks if NPC has been spawned (resets per game) | ||
| + | - `given`: Quest given to player | ||
| + | - `processed`: | ||
| + | - `completed`: | ||
| + | - `depth`: Dungeon depth where quest is active | ||
| + | |||
| + | * **Quest Flow**: | ||
| + | 1. Player approaches Caged Kobold in Ice Caves | ||
| + | 2. NPC gives quest dialogue (CagedKobold_Intro) | ||
| + | 3. Quest.given = true, Quest.processed = true | ||
| + | 4. Journal entry added (Journal.Feature.CAGEDKOBOLD) | ||
| + | 5. Player finds Ice Key | ||
| + | 6. Player returns and exchanges Ice Key for CandleOfMindVision | ||
| + | 7. Quest.complete() called | ||
| + | 8. Journal entry removed | ||
| + | 9. NPC transforms into candle (killAndErase) | ||
| + | |||
| + | **Interaction Logic:** | ||
| + | * If Quest.completed: | ||
| + | * If Quest.given: | ||
| + | - Checks if player has IceKey | ||
| + | - If has IceKey: Exchanges for CandleOfMindVision, | ||
| + | - If no IceKey: Says random phrase (Message1, Message2, or Message3) | ||
| + | * If not Quest.given: | ||
| + | |||
| + | **Spawn Behavior:** | ||
| + | * Spawns only once per game (checks `spawned` flag) | ||
| + | * Spawns in random cell within room (not on EXIT tiles) | ||
| + | * Called from IceCavesLevel.java: | ||
| + | |||
| + | ===== JSON Configuration ===== | ||
| + | Sprite configuration (spritesDesc/ | ||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== String Resources ===== | ||
| + | English (values/ | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | Russian (values-ru/ | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | Other languages: | ||
| + | * **German**: eingesperrter Kobold | ||
| + | * **Spanish**: | ||
| + | * **Greek**: φυλακισμένος καλικάντζαρος | ||
| + | * **French**: kobold en cage | ||
| + | * **Polish**: uwięziony kobold | ||
| + | * **Portuguese (BR)**: kobold engaiolado | ||
| + | * **Indonesian**: | ||
| + | * **Italian**: | ||
| + | * **Japanese**: | ||
| + | |||
| + | ===== Lua Scripts ===== | ||
| + | This entity is implemented in Java, no Lua script exists | ||
| + | |||
| + | ===== Related mr Entities ===== | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | |||
| + | {{tag> rpd mobs npcs caged_kobold ice_caves quest immortal }} | ||
