mr:rage_buff
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| mr:rage_buff [2026/03/19 02:29] – Wiki maintenance: Update multiple language pages and mr: namespace content Qwen Assistant | mr:rage_buff [2026/03/19 02:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Rage Buff - Code References ====== | ||
| + | {{ rpd: | ||
| + | |||
| + | ===== Java Classes ===== | ||
| + | * [[https:// | ||
| + | |||
| + | ===== Java Class Content ===== | ||
| + | <code java> | ||
| + | package com.nyrds.pixeldungeon.mechanics.buffs; | ||
| + | |||
| + | import com.nyrds.pixeldungeon.ml.R; | ||
| + | import com.nyrds.platform.audio.Sample; | ||
| + | import com.nyrds.platform.util.StringsManager; | ||
| + | import com.watabou.pixeldungeon.Assets; | ||
| + | import com.watabou.pixeldungeon.actors.Char; | ||
| + | import com.watabou.pixeldungeon.effects.particles.ShadowParticle; | ||
| + | import com.watabou.pixeldungeon.items.rings.ArtifactBuff; | ||
| + | import com.watabou.pixeldungeon.ui.BuffIndicator; | ||
| + | |||
| + | import org.jetbrains.annotations.NotNull; | ||
| + | |||
| + | /** | ||
| + | * Created by mike on 25.03.2018. | ||
| + | * This file is part of Remixed Pixel Dungeon. | ||
| + | */ | ||
| + | public class RageBuff extends ArtifactBuff { | ||
| + | @Override | ||
| + | public boolean act() { | ||
| + | if (target.isAlive()) { | ||
| + | if (target.hp() > target.ht() / 5 && Math.random() < 0.1f) { | ||
| + | target.damage((int) (Math.random() * 5), this); | ||
| + | target.getSprite().emitter().burst(ShadowParticle.CURSE, | ||
| + | Sample.INSTANCE.play(Assets.SND_CURSED); | ||
| + | } | ||
| + | } else { | ||
| + | deactivateActor(); | ||
| + | } | ||
| + | spend(1); | ||
| + | return true; | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public int attackProc(Char attacker, Char defender, int damage) { | ||
| + | return damage * 2; | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public int icon() { | ||
| + | return BuffIndicator.BLOODLUST; | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public String name() { | ||
| + | return StringsManager.getVar(R.string.CorpseDustBuff_Name); | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public String desc() { | ||
| + | return StringsManager.getVar(R.string.CorpseDustBuff_Info); | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public boolean attachTo(@NotNull Char target ) { | ||
| + | return target.hasBuff(BuffFactory.RAGE) || super.attachTo(target); | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== JSON Configuration ===== | ||
| + | * This buff is implemented in Java, no JSON configuration exists | ||
| + | |||
| + | ===== String Resources ===== | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | ===== Lua Scripts ===== | ||
| + | * This buff is implemented in Java, no Lua script exists | ||
| + | |||
| + | ===== Special Properties ===== | ||
| + | * **Damage Doubling**: attackProc() method doubles all damage dealt by the affected character (damage * 2) | ||
| + | * **Self-Damage Risk**: Has 10% chance per turn to deal 1-5 damage to the affected character when HP > 1/5 of max HP | ||
| + | * **Curse Effect**: Self-damage triggers ShadowParticle.CURSE visual effect and plays Assets.SND_CURSED sound | ||
| + | * **Extends ArtifactBuff**: | ||
| + | * **Self-Removal**: | ||
| + | * **Buff Icon**: Uses BuffIndicator.BLOODLUST icon | ||
| + | * **Display Name**: Uses CorpseDustBuff_Name string resource for display (name() method returns " | ||
| + | * **Prevents Duplicates**: | ||
| + | |||
| + | ===== Usage in Other Java Classes ===== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | ===== Source Code Reference ===== | ||
| + | * attackProc() method doubles all damage dealt by the affected character | ||
| + | * act() method implements periodic self-damage when HP > ht()/5 with 10% probability | ||
| + | * attachTo() method prevents duplicate buffs on same target | ||
| + | * icon() returns BuffIndicator.BLOODLUST | ||
| + | * name() and desc() methods retrieve strings from CorpseDustBundle | ||
mr/rage_buff.txt · Last modified: by 127.0.0.1
