====== Zombie Mob - Code References ====== {{ rpd:images:zombie_mob.png|Zombie Mob }} ===== Java Classes ===== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/mobs/Mob.java|Mob.java]] - Base mob class * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/mobs/common/MobFactory.java|MobFactory.java]] - Factory for creating mobs from JSON configuration * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/ai/CustomMobAi.java|CustomMobAi.java]] - AI for JSON-configured mobs ===== JSON Configuration ===== Mob configuration in mobsDesc/Zombie.json: { "name" : "Zombie_Name", "name_objective": "Zombie_Name_Objective", "description" : "Zombie_Desc", "gender" : "Zombie_Gender", "attackSkill" : 10, "defenseSkill" : 10, "dmgMin" : 3, "dmgMax" : 10, "dr" : 10, "str" : 13, "ht" : 33, "exp" : 6, "maxLvl" : 15, "baseSpeed" : 1, "attackDelay" : 1, "viewDistance" : 8, "walkingType" : "NORMAL", "spriteDesc" : "spritesDesc/Zombie.json", "scriptFile" : "scripts/mobs/Zombie", "lootChance" : 0.02, "loot" : { "kind": "Gold" }, "undead" : true, "isHumanoid" : true, "canBePet" : true, "friendly" : false, "fraction" : "DUNGEON" } * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/mobsDesc/Zombie.json|mobsDesc/Zombie.json]] - Main mob configuration * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/spritesDesc/Zombie.json|spritesDesc/Zombie.json]] - Sprite configuration * Spawn configuration in Bestiary.json: * **necro1**: Zombie spawn rate 1.0 * **necro2**: Zombie spawn rate 1.0 (with ExplodingSkull, EnslavedSoul, DeathKnight, DreadKnight) * **necro3**: Zombie spawn rate 2.0 (with ExplodingSkull, EnslavedSoul, DeathKnight, DreadKnight) * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/levelsDesc/Bestiary.json|Bestiary.json]] ===== String Resources ===== English string resources: zombie zombie An animated corpse from the necropolis. It has quite a bit of health, and has a chance to poison the hero on hit. Like all undead creatures, it has immunity to many effects. masculine String resources available in multiple languages: * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values/strings_all.xml|English (values/strings_all.xml)]] * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-ru/strings_all.xml|Russian (values-ru/strings_all.xml)]] * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-de/strings_all.xml|German (values-de/strings_all.xml)]] * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-fr/strings_all.xml|French (values-fr/strings_all.xml)]] * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-es/strings_all.xml|Spanish (values-es/strings_all.xml)]] * And other localization files ===== Lua Scripts ===== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/mobs/Zombie.lua|Zombie.lua]] - Custom attack behavior (poison on hit) ===== Key Code Fragments ===== **JSON Configuration (mobsDesc/Zombie.json)**: { "name" : "Zombie_Name", "name_objective": "Zombie_Name_Objective", "description" : "Zombie_Desc", "gender" : "Zombie_Gender", "attackSkill" : 10, "defenseSkill" : 10, "dmgMin" : 3, "dmgMax" : 10, "dr" : 10, "str" : 13, "ht" : 33, "exp" : 6, "maxLvl" : 15, "baseSpeed" : 1, "attackDelay" : 1, "viewDistance" : 8, "walkingType" : "NORMAL", "spriteDesc" : "spritesDesc/Zombie.json", "scriptFile" : "scripts/mobs/Zombie", "lootChance" : 0.02, "loot" : { "kind": "Gold" }, "undead" : true, "isHumanoid" : true, "canBePet" : true, "friendly" : false, "fraction" : "DUNGEON" } **Lua Script (scripts/mobs/Zombie.lua)**: local RPD = require "scripts/lib/commonClasses" local mob = require "scripts/lib/mob" return mob.init{ attackProc = function(self, enemy, dmg) -- 1/3 chance to poison; java rolled Random.Int(2,3) which is [2,3) -- i.e. always 2 turns if enemy ~= nil and math.random(3) == 1 then local factor = RPD.CharUtils:durationFactor(enemy) RPD.Buffs.Buff:affect(enemy, "Poison", 2 * factor) end return dmg end } ===== Related mr: Entities ===== * [[mr:poison_buff|Poison (Buff)]] - Applied by Zombie's attack * [[mr:necromancer_class|Necromancer (Class)]] - Related to Necropolis theme * [[mr:skeleton_mob|Skeleton (Mob)]] - Another undead mob in Necropolis * [[mr:death_knight_mob|Death Knight (Mob)]] - Another Necropolis mob * [[mr:enslaved_soul_mob|Enslaved Soul (Mob)]] - Another Necropolis mob ===== Related Wiki Pages ===== * [[en:rpd:necropolis_level|Necropolis (Level)]] - Where Zombies spawn * [[en:rpd:undead_mob|Undead (Mechanic)]] - Zombie type and immunities