Table of Contents

Scroll Of Psionic Blast - Code References

Java Classes

Full Java Class Content

package com.watabou.pixeldungeon.items.scrolls;
 
import com.nyrds.platform.audio.Sample;
import com.watabou.pixeldungeon.Assets;
import com.watabou.pixeldungeon.Dungeon;
import com.watabou.pixeldungeon.actors.Char;
import com.watabou.pixeldungeon.actors.buffs.Blindness;
import com.watabou.pixeldungeon.actors.buffs.Buff;
import com.watabou.pixeldungeon.actors.buffs.Invisibility;
import com.watabou.pixeldungeon.actors.mobs.Mob;
import com.watabou.pixeldungeon.scenes.GameScene;
import com.watabou.utils.Random;
 
import org.jetbrains.annotations.NotNull;
 
public class ScrollOfPsionicBlast extends Scroll {
 
	@Override
	protected void doRead(@NotNull Char reader) {
 
		GameScene.flash( 0xFFFFFF );
 
		Sample.INSTANCE.play( Assets.SND_BLAST );
		Invisibility.dispel(reader);
 
		// Affect all visible mobs
		for (Mob mob : Dungeon.level.getCopyOfMobsArray()) {
			if (Dungeon.level.fieldOfView[mob.getPos()]) {
				// Blind for 3-6 turns
				Buff.prolong( mob, Blindness.class, Random.Int( 3, 6 ) );
				// Damage: 1 to 2/3 of max HP
				mob.damage( Random.IntRange( 1, mob.ht() * 2 / 3 ), this );
			}
		}
 
		// Also affect the reader
		Buff.prolong( reader, Blindness.class, Random.Int( 3, 6 ) );
		reader.observe();
 
		setKnown();
 
		reader.spend( TIME_TO_READ );
	}
 
	@Override
	public int price() {
		return isKnown() ? 80 * quantity() : super.price();
	}
}

Effects from code:

JSON Configuration

This entity is implemented in Java, no JSON configuration exists

String Resources

English (values/strings_all.xml):

<string name="ScrollOfPsionicBlast_Name">Scroll of Psionic Blast</string>
<string name="ScrollOfPsionicBlast_Info">The energy of this scroll will discharge a psionic blast, dealing tremendous damage to all creatures in your field of view. The damage is so immense that it will also temporarily blind you.</string>
<string name="ScrollOfPsionicBlast_Unknown">You don\'t know what this scroll will do yet.</string>
<string name="ScrollOfPsionicBlast_Kill">The psionic blast killed you...</string>
<string name="ScrollOfPsionicBlast_Desc">The energy of this scroll will discharge a psionic blast, dealing tremendous damage to all creatures in your field of view. The damage is so immense that it will also temporarily blind you.</string>
<string name="ScrollOfPsionicBlast_Uses">Uses: %d</string>

Russian (values-ru/strings_all.xml):

<string name="ScrollOfPsionicBlast_Name">Свиток псионического взрыва</string>
<string name="ScrollOfPsionicBlast_Info">Энергия этого свитка высвободит псионический взрыв, наносящий огромный урон всем существам в вашем поле зрения. Урон настолько велик, что также временно ослепит вас.</string>
<string name="ScrollOfPsionicBlast_Kill">Псионический взрыв убил вас...</string>

Lua Scripts

This entity is implemented in Java, no Lua script exists