mr:shield_class
Table of Contents
Shield Class - Machine Reference
This page contains machine-readable reference information about the Shield mechanics for automated tools and AI assistants. Shields are fully implemented via Lua scripts using the shields library (no Java Shield class exists).
Entity Information
- Entity Type: Armor (Off-hand/Left Hand)
- Implementation: Lua (shields library)
- Parent Class: Armor (Java base for all armor)
- Equip Slot: left_hand (Belongings.Slot.LEFT_HAND)
- Package: com.watabou.pixeldungeon.items.armor (base Armor class)
Java Implementation
- Base Armor Class: Armor.java
- Shield Logic: Implemented in Lua via shields.lua
- Slot: Belongings.Slot.LEFT_HAND
Shield Mechanics
- Block Chance: Based on shield level and hero's STR
- Block Amount: Based on shield level and item level
- Recharge Time: Time between blocks, affected by STR penalty
- Wait After Block: Additional delay after blocking
- Upgradeable: Can be upgraded with Upgrade Scrolls
- Tier/Level: Shield level determines base stats (1-4+)
Known Shield Implementations
- Wooden Shield - Level 1
- Tough Shield - Level 2 (Lua implementation)
- Strong Shield - Level 3
- Royal Shield - Level 4
- Chaos Shield - Special chaos mechanics (Level 3+)
Shield Buff System
- When equipped in left_hand, applies ShieldLeft buff
- When equipped as weapon (two-handed), applies ShieldRight buff
- Buff level matches shield level
- Buff source is the shield item
Lua Implementation Pattern
Most shields are implemented in Lua using the shields library:
- Library: shields.lua
- makeShield(shieldLevel, shieldDesc, shieldBuff) - Creates shield configuration
- Typical shieldLevel: 1-4 (Wooden=1, Tough=2, Strong=3, Royal=4)
- Price formula: 20 * shieldLevel
Drop Configuration
- Treasury.json: SHIELD category with weights (WoodenShield=1, ToughShield=0.5, StrongShield=0.25, RoyalShield=0.125)
- SpidersTreasury.json: Same shield drop rates
Code References
- shields.lua - Lua shield library
- stats/shields.lua - Shield stats (STR requirements, block chance, block amount)
- ItemFactory.java - Registration
- Treasury.json - Drop configuration
- Shielded.json - Shielded mob sprite config
String Resources
- Name pattern: [ShieldName]_Name (e.g., WoodenShield_Name, ToughShield_Name)
- Description pattern: [ShieldName]_Desc (e.g., WoodenShield_Desc, ToughShield_Desc)
- English: strings_all.xml
- Russian: strings_all.xml (ru)
Related Pages
- Shields - English wiki page
- Shields Library - Lua library reference
- Wooden Shield Item - Basic shield reference
- Tough Shield Item - Level 2 shield reference
mr/shield_class.txt · Last modified: by 127.0.0.1
