mr:barkskin_buff
Table of Contents
Barkskin Buff - Code References
Java Classes
This entity is implemented in Lua (migrated from Java), no Java class exists in current codebase
- Former Java implementation: `com/watabou/pixeldungeon/actors/buffs/Barkskin.java` (removed)
JSON Configuration
This entity is implemented in Lua, no JSON configuration exists
String Resources
<string name="BarkskinBuff_Name">Barkskin</string> <string name="BarkskinBuff_Info">The body is covered by bark which blocks some damage taken.</string> <string name="BarkskinBuff_Gender">neuter</string>Russian strings:
<string name="BarkskinBuff_Name">Кора</string> <string name="BarkskinBuff_Info">Тело покрыто твёрдой корой, которая блокирует некоторый урон.</string>
Lua Scripts
- Barkskin.lua - Core buff implementation
Lua Implementation (Barkskin.lua)
local RPD = require "scripts/lib/commonClasses" local buff = require "scripts/lib/buff" return buff.init{ desc = function () return { icon = 24, -- BuffIndicator.BARKSKIN name = "BarkskinBuff_Name", info = "BarkskinBuff_Info", } end, act = function(self, buff) local target = buff.target if target:isAlive() then buff:spend(1) -- Actor.TICK local lvl = buff:level() - 1 buff:level(lvl) if lvl <= 0 then buff:detach() end else buff:detach() end end, drBonus = function(self, buff) return buff:level() end }
Mechanics
- Effect: Increases DR (Damage Reduction) by amount equal to current buff level
- Duration: Buff level decreases by 1 each turn (Actor.TICK); expires when level reaches 0
- Initial Level: Set by the source applying the buff (see Sources below)
- DR Bonus: Equal to current buff level (via `drBonus()` method)
- Icon: BuffIndicator.BARKSKIN (icon ID 24)
Sources
- Nature Armor Spell (Elf spell): Applies Barkskin with initial level = caster's skill level × caster's level
- Earthroot Plant: Applies Barkskin with initial level = hero's effective STR / 4
- Generic Plant: Applies Barkskin with initial level = hero's max HP / 3
- Frozen Carpaccio (food): Applies Barkskin with initial level = hero's max HP / 4
- High Grass (level feature): Applies Barkskin with initial level = hero's max HP / 3
- Spider Mind (mob): Has Barkskin as one of its buffs
Image Assets
- wiki-data/media/rpd/images/barkskin_buff.png
- wiki-data/media/rpd/images/buff_Barkskin.png
Related mr Entities
- Vertigo Buff - Another buff implementation reference
Related Pages
mr/barkskin_buff.txt · Last modified: by 127.0.0.1
