User Tools

Site Tools


rpd:scroll_of_lullaby_item

Differences

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

Link to this comparison view

rpd:scroll_of_lullaby_item [2025/12/24 21:04] – Create Scroll of Lullaby item page with code references mikerpd:scroll_of_lullaby_item [2025/12/24 21:11] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Scroll of Lullaby ======
  
 +{{ rpd:images:scroll_lullaby.png|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 ====
 +  * **Area of Effect**: All enemies within 5 tiles of the hero
 +  * **Sleep Duration**: Enemies remain asleep for 5-10 turns
 +  * **Peaceful Sleep**: Sleeping enemies won't attack unless damaged
 +  * **Disturbance**: Loud noises or attacks will wake sleeping enemies
 +
 +==== Strategy ====
 +  * **Safe Passage**: Allows safe passage through dangerous areas
 +  * **Escape Mechanism**: Useful for escaping dangerous situations
 +  * **Timing**: Best used when surrounded by multiple enemies
 +  * **Caution**: Be careful not to wake sleeping enemies
 +
 +==== 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>''
 +
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/scrolls/ScrollOfLullaby.java|ScrollOfLullaby.java]] - Main implementation
 +
 +==== Related Items ====
 +  * [[rpd:scrolls|Scrolls]] - List of all scrolls
 +  * [[rpd:scroll_of_teleportation_item|Scroll of Teleportation]] - Another escape utility scroll
 +
 +{{tag> rpd items scrolls lullaby}}
rpd/scroll_of_lullaby_item.txt · Last modified: by 127.0.0.1