Table of Contents

Scroll of Lullaby

Scroll of Lullaby

The Scroll of Lullaby is a magical item that puts nearby enemies to sleep.

Description

When read, the Scroll of Lullaby releases magical lullabies that put all enemies within a certain radius to sleep. Sleeping enemies will remain asleep until they take damage or are otherwise disturbed.

Effects

Strategy

Code References

<code java> package com.watabou.pixeldungeon.items.scrolls;

import com.watabou.pixeldungeon.Dungeon; import com.watabou.pixeldungeon.actors.buffs.Buff; import com.watabou.pixeldungeon.actors.mobs.Mob; import com.watabou.pixeldungeon.effects.SpellSprite; import com.watabou.pixeldungeon.utils.GLog;

public class ScrollOfLullaby extends Scroll {

@Override
protected void doRead() {
	
	for (Mob mob : Dungeon.level.mobs) {
		if (Dungeon.visible[mob.pos]) {
			Buff.affect( mob, Sleep.class );
			if (mob.state == mob.HUNTING) {
				mob.state = mob.WANDERING;
			}
			mob.sprite.centerEmitter().start( Speck.factory( Speck.NOTE ), 0.3f, 4 );
		}
	}
	
	GLog.h( "The scroll utters a soothing melody. You feel very sleepy." );
	setKnown();
	
	((ScrollOfMagicMapping)curItem).readAnimation();
}

@Override
public String desc() {
	return
		"The scroll utters a soothing melody that will put all " +
		"enemies caught within its range into a deep magical slumber.";
}

} </code>