mr:shopkeeper_mob
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mr:shopkeeper_mob [2025/12/25 18:23] – auto lint fix Mikhael | mr:shopkeeper_mob [2026/03/10 12:46] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Shopkeeper Mob - Code References ====== | ||
| + | |||
| + | {{ rpd: | ||
| + | |||
| + | ===== Java Classes ===== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | ===== Java Class Content ===== | ||
| + | <code java> | ||
| + | package com.watabou.pixeldungeon.actors.mobs.npcs; | ||
| + | |||
| + | import com.nyrds.Packable; | ||
| + | import com.nyrds.pixeldungeon.game.GameLoop; | ||
| + | import com.nyrds.pixeldungeon.items.Treasury; | ||
| + | import com.nyrds.pixeldungeon.mechanics.NamedEntityKind; | ||
| + | import com.nyrds.pixeldungeon.windows.WndShopOptions; | ||
| + | import com.nyrds.util.ModdingBase; | ||
| + | import com.watabou.pixeldungeon.Badges; | ||
| + | import com.watabou.pixeldungeon.Dungeon; | ||
| + | import com.watabou.pixeldungeon.actors.Char; | ||
| + | import com.watabou.pixeldungeon.actors.CharUtils; | ||
| + | import com.watabou.pixeldungeon.actors.buffs.Regeneration; | ||
| + | import com.watabou.pixeldungeon.effects.CellEmitter; | ||
| + | import com.watabou.pixeldungeon.effects.particles.ElmoParticle; | ||
| + | import com.watabou.pixeldungeon.items.Item; | ||
| + | import com.watabou.pixeldungeon.items.bags.Bag; | ||
| + | import com.watabou.pixeldungeon.items.food.Food; | ||
| + | import com.watabou.pixeldungeon.items.food.OverpricedRation; | ||
| + | import com.watabou.pixeldungeon.scenes.GameScene; | ||
| + | import com.watabou.pixeldungeon.windows.WndBag; | ||
| + | import org.jetbrains.annotations.NotNull; | ||
| + | |||
| + | public class Shopkeeper extends NPC { | ||
| + | { | ||
| + | spriteClass = " | ||
| + | movable = false; | ||
| + | addImmunity(Regeneration.class); | ||
| + | } | ||
| + | |||
| + | @Packable | ||
| + | public String bagSold = ""; | ||
| + | |||
| + | @Override | ||
| + | public void damage(int dmg, @NotNull NamedEntityKind src ) { | ||
| + | destroy(); | ||
| + | getSprite().killAndErase(); | ||
| + | CellEmitter.get( getPos() ).burst( ElmoParticle.FACTORY, | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public boolean reset() { | ||
| + | return true; | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public boolean interact(final Char hero) { | ||
| + | // Shop interaction logic | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== JSON Configuration ===== | ||
| + | * [[https:// | ||
| + | |||
| + | ===== String Resources ===== | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | ===== Lua Scripts ===== | ||
| + | This entity is implemented in Java, no Lua script exists | ||
| + | |||
| + | ===== Usage in Code ===== | ||
| + | * Shop painter creates Shopkeeper in shops: [[https:// | ||
| + | * Registered in MobFactory: [[https:// | ||
| + | * Used in WndDontLikeAds: | ||
| + | * TownShopLevel creates TownShopkeeper variant: [[https:// | ||
| + | |||
| + | ===== Related mr Entities ===== | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
