mr:armor_buff
Table of Contents
Armor Buff - Code References
Java Classes
- Plant.java (base plant class)
- LevelObjectsFactory.java (registers Earthroot plant)
JSON Configuration
This entity is implemented via Lua scripts, no JSON configuration exists for the buff itself.
String Resources
<string name="Earthroot_ArmorBuff">Armor</string> <string name="EarthrootBuff_Name">Herbal armor</string> <string name="EarthrootBuff_Info">Roots have sprouted from the ground providing natural armor.</string>
Lua Scripts
- Plant script: scripts/plants/Earthroot.lua - Applies Armor buff on contact
- Buff script: scripts/buffs/Armor.lua - Armor buff implementation
Buff Properties (from scripts/buffs/Armor.lua)
icon = 20- BuffIndicator.ARMORname = “EarthrootBuff_Name�- String resource for nameinfo = “EarthrootBuff_Info�- String resource for descriptionlevel- Stores the damage absorption amount (set to character's HT when applied)pos- Stores the position where the buff was applied
Buff Implementation
act = function(self, buff) local target = buff.target local pos = self.data and self.data.pos if target:getPos() ~= pos then buff:detach() end buff:spend(1) -- STEP end, defenceProc = function(self, buff, enemy, damage) local lvl = buff:level() if damage >= lvl then buff:detach() return damage - lvl else buff:level(lvl - damage) return 0 end end
Buff Behavior
- Applied when a character steps on an Earthroot plant
- Level is set to the character's HT (hit points) when applied
- Absorbs incoming damage up to the level amount
- Detaches if the character moves from the position where it was applied
- Detaches after absorbing damage equal to or greater than its level
Related mr Entities
mr/armor_buff.txt · Last modified: by 127.0.0.1
