User Tools

Site Tools


mr:terror_buff

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mr:terror_buff [2026/03/25 18:44] – Wiki maintenance: Fix links, update mr:terror_buff with code references, and correct string resource line numbers Qwen Assistantmr:terror_buff [2026/07/12 00:15] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Terror Buff - Code References ======
  
 +{{ rpd:images:terror_buff.png|Terror Buff }}
 +
 +===== Java Classes =====
 +  * Main Implementation: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/buffs/Terror.java|Terror.java]]
 +  * AI Handler: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/ai/Horrified.java|Horrified.java]]
 +
 +===== Class Details =====
 +<code java>
 +package com.watabou.pixeldungeon.actors.buffs;
 +
 +import com.nyrds.pixeldungeon.ml.R;
 +import com.nyrds.platform.util.StringsManager;
 +import com.watabou.pixeldungeon.actors.Char;
 +import com.watabou.pixeldungeon.actors.mobs.Fraction;
 +import com.watabou.pixeldungeon.actors.mobs.Mob;
 +import com.watabou.pixeldungeon.sprites.CharSprite;
 +import com.watabou.pixeldungeon.ui.BuffIndicator;
 +
 +import org.jetbrains.annotations.NotNull;
 +
 +import com.nyrds.LuaInterface;
 +
 +@LuaInterface
 +public class Terror extends FlavourBuff {
 +
 +        public static final float DURATION = 10f;
 +
 +        @Override
 +        public int icon() {
 +                return BuffIndicator.TERROR;
 +        }
 +
 +        public static void recover( Char target ) {
 +                Terror terror = target.buff( Terror.class );
 +                if (terror != null && terror.cooldown() < DURATION) {
 +                        target.remove( terror );
 +                }
 +        }
 +
 +        @Override
 +        public boolean attachTo(@NotNull Char target) {
 +                if(super.attachTo(target)) {
 +                        if(target instanceof Mob && target.fraction!=Fraction.NEUTRAL) {
 +                                Mob tgt = (Mob)target;
 +                                tgt.releasePet();
 +                        }
 +                        return true;
 +                }
 +                return false;
 +        }
 +
 +        @Override
 +        public void attachVisual() {
 +        target.showStatus(CharSprite.NEGATIVE, StringsManager.getVar(R.string.Char_StaFrightened));
 +        }
 +}
 +</code>
 +
 +===== Key Methods =====
 +  * **attachTo(Char target)**: Attaches the Terror buff to a character. If the target is a non-neutral Mob, releases any pet.
 +  * **recover(Char target)**: Removes Terror buff if cooldown is less than DURATION (10f).
 +  * **attachVisual()**: Shows "frightened" status message on the character sprite.
 +  * **icon()**: Returns BuffIndicator.TERROR for the buff icon.
 +
 +===== Constants =====
 +  * **DURATION**: 10f (10 seconds default duration)
 +
 +===== JSON Configuration =====
 +This entity does not have JSON configuration files. It is fully implemented in Java.
 +
 +===== String Resources =====
 +<code xml>
 +<!-- English strings -->
 +<string name="Char_StaFrightened">frightened</string>
 +<string name="TerrorBuff_Info">It looks like someone was very frightened.</string>
 +<string name="Mob_StaTerrorStatus2">%s is terrified of %s!</string>
 +
 +<!-- Russian strings -->
 +<string name="Char_StaFrightened">испуган</string>
 +<string name="TerrorBuff_Info">Похоже, кто-то очень испугался.</string>
 +<string name="Mob_StaTerrorStatus2">%s в ужасе перед %s!</string>
 +</code>
 +
 +===== String Resource References =====
 +  * English: RemixedDungeon/src/main/res/values/strings_all.xml
 +    - Char_StaFrightened
 +    - TerrorBuff_Info
 +    - Mob_StaTerrorStatus2
 +  * Russian: RemixedDungeon/src/main/res/values-ru/strings_all.xml
 +    - Char_StaFrightened
 +    - TerrorBuff_Info
 +    - Mob_StaTerrorStatus2
 +
 +===== Lua Scripts =====
 +  * Roar.lua: Uses RPD.Buffs.Terror to apply terror effect
 +  * commonClasses.lua: Binds Terror class for Lua access
 +  * ChaosShieldLeft.lua: Includes Terror in random debuff list
 +
 +===== Usage in Code =====
 +  * **Immunity**: Many mobs have immunity to Terror:
 +    - IceGuardian, IceGuardianCore, Kobold (Ice Caves)
 +    - YogsHeart, YogsBrain, YogsEye, BurningFist, RottingFist (Guts)
 +  * **AI Behavior**: The Horrified AI class handles terrorized mob behavior
 +  * **Status Display**: Uses CharSprite.NEGATIVE for visual feedback
 +  * **Pet Release**: Automatically releases pets when applied to non-neutral mobs
 +
 +===== Related Classes =====
 +  * FlavourBuff (parent class)
 +  * BuffIndicator (icon system)
 +  * Horrified (AI handler for terrorized mobs)
 +  * CharSprite (visual status display)
 +  * Fraction (mob faction system)
 +
 +===== Source Code Links =====
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/buffs/Terror.java|Terror.java]]
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/ai/Horrified.java|Horrified.java]]
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/scrolls/ScrollOfTerror.java|ScrollOfTerror.java]]
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/weapon/enchantments/Horror.java|Horror.java]]
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/spells/Roar.lua|Roar.lua]]
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/lib/commonClasses.lua|commonClasses.lua]]
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/buffs/ChaosShieldLeft.lua|ChaosShieldLeft.lua]]
 +
 +===== String Resources =====
 +  * TerrorBuff_Name
 +  * TerrorBuff_Info
 +  * Char_StaFrightened
 +  * Mob_StaTerrorStatus2
 +
 +{{tag> rpd buffs mr}}