rpd:scroll_of_lullaby_item
Differences
This shows you the differences between two versions of the page.
| rpd:scroll_of_lullaby_item [2025/12/24 21:04] – Create Scroll of Lullaby item page with code references mike | rpd:scroll_of_lullaby_item [2025/12/24 21:11] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Scroll of Lullaby ====== | ||
| + | {{ rpd: | ||
| + | |||
| + | 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**: | ||
| + | |||
| + | ==== Strategy ==== | ||
| + | * **Safe Passage**: Allows safe passage through dangerous areas | ||
| + | * **Escape Mechanism**: | ||
| + | * **Timing**: Best used when surrounded by multiple enemies | ||
| + | * **Caution**: | ||
| + | |||
| + | ==== Code References ==== | ||
| + | ''< | ||
| + | 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 | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | ''</ | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | ==== Related Items ==== | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | |||
| + | {{tag> rpd items scrolls lullaby}} | ||
rpd/scroll_of_lullaby_item.txt · Last modified: by 127.0.0.1
