mr:pseudo_pasty_item
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| mr:pseudo_pasty_item [2026/03/19 02:29] – Wiki maintenance: Update multiple language pages and mr: namespace content Qwen Assistant | mr:pseudo_pasty_item [2026/03/19 02:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Pseudo Pasty Item - Code References ====== | ||
| + | |||
| + | {{ rpd: | ||
| + | |||
| + | ===== Java Classes ===== | ||
| + | * [[https:// | ||
| + | |||
| + | ===== Java Class Content ===== | ||
| + | <code java> | ||
| + | package com.watabou.pixeldungeon.items.food; | ||
| + | |||
| + | import com.nyrds.pixeldungeon.mechanics.CommonActions; | ||
| + | import com.watabou.pixeldungeon.actors.Char; | ||
| + | import com.watabou.pixeldungeon.actors.CharUtils; | ||
| + | import com.watabou.pixeldungeon.actors.buffs.Hunger; | ||
| + | import com.watabou.pixeldungeon.items.Item; | ||
| + | import com.watabou.pixeldungeon.sprites.ItemSpriteSheet; | ||
| + | |||
| + | import org.jetbrains.annotations.NotNull; | ||
| + | |||
| + | public class PseudoPasty extends Food { | ||
| + | |||
| + | public PseudoPasty() { | ||
| + | image = ItemSpriteSheet.PASTY; | ||
| + | energy = Hunger.STARVING; | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public Item pick(Char ch, int pos) { | ||
| + | return CharUtils.tryToSpawnMimic(this, | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public void _execute(@NotNull Char chr, @NotNull String action) { | ||
| + | if (action.equals(CommonActions.AC_EAT)) { | ||
| + | pick(chr, | ||
| + | this.removeItemFrom(chr); | ||
| + | return; | ||
| + | } | ||
| + | |||
| + | super._execute(chr, | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Special Properties ===== | ||
| + | * Extends Food class | ||
| + | * When eaten, attempts to spawn a " | ||
| + | * Uses PASTY sprite from ItemSpriteSheet | ||
| + | * Provides STARVING energy level (same as regular food) | ||
| + | * Has unique interaction behavior that overrides standard food consumption | ||
| + | |||
| + | ===== Usage in Other Java Classes ===== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | ===== String Resources ===== | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | ===== Lua Scripts ===== | ||
| + | This entity is implemented in Java, no Lua script exists | ||
| + | |||
| + | ===== JSON Configuration ===== | ||
| + | This entity is implemented in Java as a class, no JSON configuration exists | ||
mr/pseudo_pasty_item.txt · Last modified: by 127.0.0.1
