Table of Contents

Terror Buff - Code References

Terror Buff

Java Classes

Class Details

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));
        }
}

Key Methods

Constants

JSON Configuration

This entity does not have JSON configuration files. It is fully implemented in Java.

String Resources

<!-- 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>

String Resource References

Lua Scripts

Usage in Code

String Resources