User Tools

Site Tools


mr:thief_mob

Thief Mob - Code References

Machine-readable reference page for the Thief mob entity in Remixed Dungeon.

Java Classes

Java Implementation Details

Stats (from Thief.java):

{
    hp(ht(20));              // Health points: 20
    baseDefenseSkill = 12;   // Defense skill: 12
    baseAttackSkill = 12;    // Attack skill: 12
    dmgMin = 1;              // Minimum damage: 1
    dmgMax = 7;              // Maximum damage: 7
    dr = 3;                  // Damage reduction: 3
    expForKill = 5;          // Experience for kill: 5
    maxLvl = 10;             // Maximum level: 10
    loot(RingOfHaggler.class, 0.01f); // 1% drop chance for Ring of Haggler
}

Special Abilities:

  • Steal Attack: Can steal items from the player on attack (attackProc method)
  • Fleeing Behavior: Enters ThiefFleeing AI state after successful steal
  • Gold Drop: Drops gold when hit while in fleeing state (defenseProc method)

JSON Configuration

Sprite Configuration (Thief.json):

{
  "idle": { "looped": true, "frames": [0,0,0,1,0,0,0,0,1], "fps": 1 },
  "die": { "looped": false, "frames": [5,6,7,8,9], "fps": 10 },
  "attack": { "looped": false, "frames": [10,11,12,0], "fps": 12 },
  "run": { "looped": true, "frames": [0,0,2,3,3,4], "fps": 15 },
  "texture": "thief.png",
  "width": 12,
  "height": 13,
  "bloodColor": "0xffbb0000"
}

Lua Scripts

  • ScriptedThief.lua - Lua script that defines special attack behavior for stealing items

Lua Implementation (ScriptedThief.lua):

return mob.init{
    attackProc = function(self, enemy, dmg)
        if not self:getLoot() then
            local belongins = enemy:getBelongings()
            if belongins then
                local items = belongins.backpack.items
                local item = items:get(math.random(0,items:size()-1))
                item:removeItemFrom(enemy)
                self:loot(item)
                RPD.glog("%s stole %s from %s", self:name(), item:name(), enemy:name())
                RPD.setAi(self, "ThiefFleeing")
            end
        end
        return dmg
    end
}

String Resources

English (values/strings_all.xml):

<string name="Thief_Name">crazy thief</string>
<string name="Thief_Gender">masculine</string>
<string name="Thief_Name_Objective">crazy thief</string>
<string name="Thief_Desc">Deeper levels of the dungeon have always been a hiding place for all kinds of criminals. Not all of them could keep a clear mind during their extended periods so far from daylight. Long ago, these crazy thieves and bandits forgot who they are and why they steal.</string>
<string name="Thief_Stole">%1$s stole %2$s from you!</string>
<string name="Thief_Carries">\n\n%1$s is carrying a _%2$s_. Stolen obviously.</string>

Russian (values-ru/strings_all.xml):

<string name="Thief_Name">свихнувшийся вор</string>
<string name="Thief_Gender">masculine</string>
<string name="Thief_Name_Objective">вора</string>
<string name="Thief_Desc">Глубинные уровни подземелья всегда служили хорошим укрытием для всякого рода преступников. Но не всякий преступник мог сохранить рассудок, будучи отлучённым от дневного света на долгое время. Давным-давно эти безумные бандиты и воры позабыли, кто они и зачем совершают преступления.</string>
<string name="Thief_Stole">%1$s украл у тебя предмет %2$s!</string>
<string name="Thief_Carries">\n\n%1$s носит _%2$s_. Добро, конечно, краденое.</string>

Localization Keys

The Thief mob uses the following localization keys across all supported languages:

  • Thief_Name - Display name
  • Thief_Gender - Grammatical gender (masculine)
  • Thief_Name_Objective - Objective case name
  • Thief_Desc - Description text
  • Thief_Stole - Message when Thief steals from player
  • Thief_Carries - Description of stolen item carried by Thief
mr/thief_mob.txt · Last modified: by 127.0.0.1