mr:mana_regeneration_buff
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| mr:mana_regeneration_buff [2026/03/02 05:52] – Fix wiki documentation issues Qwen Assistant | mr:mana_regeneration_buff [2026/03/02 05:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Mana Regeneration Buff - Code References ====== | ||
| + | |||
| + | ===== Java Classes ===== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | ===== JSON Configuration ===== | ||
| + | This entity is implemented in Java, no specific JSON configuration exists | ||
| + | |||
| + | ===== String Resources ===== | ||
| + | <code xml> | ||
| + | <!-- English (values/ | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | |||
| + | <!-- Russian (values-ru/ | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | ===== Lua Scripts ===== | ||
| + | This entity is implemented in Java, no Lua script exists | ||
| + | |||
| + | ===== Implementation Details ===== | ||
| + | * **Class**: `com.watabou.pixeldungeon.actors.buffs.ManaRegeneration` | ||
| + | * **Extends**: | ||
| + | * **Regeneration Delay**: 20 turns base (REGENERATION_DELAY constant) | ||
| + | * **Bonus Calculation**: | ||
| + | * **Fast Mana Regeneration**: | ||
| + | * **Skill Points**: Accumulates 1 skill point per tick in unsafe areas | ||
| + | * **Buff Attachment**: | ||
| + | |||
| + | ===== Code Fragment ===== | ||
| + | <code java> | ||
| + | public class ManaRegeneration extends Buff { | ||
| + | private static final float REGENERATION_DELAY = 20; | ||
| + | |||
| + | @Override | ||
| + | public boolean act() { | ||
| + | if (target.isAlive()) { | ||
| + | if (!target.level().isSafe()) { | ||
| + | target.accumulateSkillPoints(1); | ||
| + | } | ||
| + | |||
| + | final int[] bonus = {0}; | ||
| + | |||
| + | if(Dungeon.isFacilitated(Facilitations.FAST_MANA_REGENERATION)) { | ||
| + | bonus[0] += 10; | ||
| + | } | ||
| + | |||
| + | target.forEachBuff(b-> | ||
| + | |||
| + | spend((float) (REGENERATION_DELAY / Math.pow(1.2, | ||
| + | } else { | ||
| + | deactivate(); | ||
| + | } | ||
| + | return true; | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Related Information ===== | ||
| + | * This buff handles the regeneration of mana for characters | ||
| + | * It runs every 20 turns divided by 1.2^bonus (where bonus comes from other buffs with manaRegenerationBonus) | ||
| + | * If Fast Mana Regeneration facilitation is enabled, it adds a +10 bonus | ||
| + | * When in unsafe areas, it accumulates skill points for the character | ||
| + | * The regeneration rate is affected by other buffs that provide manaRegenerationBonus | ||
| + | * Hero classes and subclasses can provide manaRegenerationBonus through their implementations | ||
mr/mana_regeneration_buff.txt · Last modified: (external edit)
