mr:suspicious_rat_mob
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| mr:suspicious_rat_mob [2026/03/21 13:42] – Wiki standards compliance fixes for randomly selected pages Qwen Assistant | mr:suspicious_rat_mob [2026/03/21 13:45] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Suspicious Rat Mob - Code References ====== | ||
| + | |||
| + | ===== Java Classes ===== | ||
| + | * '' | ||
| + | * Extends: [[https:// | ||
| + | * Related: [[https:// | ||
| + | |||
| + | ===== Java Class Content ===== | ||
| + | <code java> | ||
| + | package com.nyrds.pixeldungeon.mobs.guts; | ||
| + | |||
| + | import com.nyrds.Packable; | ||
| + | import com.nyrds.pixeldungeon.ml.R; | ||
| + | import com.nyrds.platform.audio.Sample; | ||
| + | import com.nyrds.platform.util.StringsManager; | ||
| + | import com.watabou.pixeldungeon.Assets; | ||
| + | import com.watabou.pixeldungeon.actors.Char; | ||
| + | import com.watabou.pixeldungeon.actors.CharUtils; | ||
| + | import com.watabou.pixeldungeon.actors.blobs.ToxicGas; | ||
| + | import com.watabou.pixeldungeon.actors.mobs.Mob; | ||
| + | import com.watabou.pixeldungeon.sprites.CharSprite; | ||
| + | import com.watabou.pixeldungeon.utils.GLog; | ||
| + | |||
| + | import org.jetbrains.annotations.NotNull; | ||
| + | |||
| + | public class SuspiciousRat extends Mob { | ||
| + | |||
| + | private static final float TIME_TO_HATCH = 4f; | ||
| + | |||
| + | { | ||
| + | hp(ht(140)); | ||
| + | baseDefenseSkill = 25; | ||
| + | baseAttackSkill | ||
| + | dmgMin = 10; | ||
| + | dmgMax = 15; | ||
| + | dr = 2; | ||
| + | |||
| + | expForKill = 1; | ||
| + | maxLvl = 30; | ||
| + | |||
| + | pacified = true; | ||
| + | |||
| + | addImmunity(ToxicGas.class); | ||
| + | } | ||
| + | |||
| + | @Packable | ||
| + | public boolean transforming = false; | ||
| + | |||
| + | @Override | ||
| + | public boolean act() { | ||
| + | if (enemySeen) { | ||
| + | if (!transforming) { | ||
| + | spend(TIME_TO_HATCH); | ||
| + | transforming = true; | ||
| + | if (CharUtils.isVisible(this)) { | ||
| + | getSprite().showStatus(CharSprite.NEGATIVE, | ||
| + | GLog.n(StringsManager.getVar(R.string.SuspiciousRat_Info1)); | ||
| + | } | ||
| + | getSprite().zap(getEnemy().getPos()); | ||
| + | } else { | ||
| + | int wereratPos = this.getPos(); | ||
| + | if (level().cellValid(wereratPos)) { | ||
| + | PseudoRat mob = new PseudoRat(); | ||
| + | mob.setPos(wereratPos); | ||
| + | level().spawnMob(mob); | ||
| + | Sample.INSTANCE.play(Assets.SND_CURSED); | ||
| + | } | ||
| + | die(this); | ||
| + | } | ||
| + | return true; | ||
| + | } | ||
| + | return super.act(); | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public boolean zap(@NotNull Char enemy){ | ||
| + | return false; | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Key Constants ===== | ||
| + | * **Health Points:** HP = 140, HT = 140 | ||
| + | * **Defense Skill:** baseDefenseSkill = 25 | ||
| + | * **Attack Skill:** baseAttackSkill = 25 | ||
| + | * **Damage:** dmgMin = 10, dmgMax = 15 | ||
| + | * **Damage Reduction: | ||
| + | * **Experience: | ||
| + | * **Max Level:** maxLvl = 30 | ||
| + | * **Transformation Time:** TIME_TO_HATCH = 4f (4 turns) | ||
| + | * **Pacified: | ||
| + | * **Immunity: | ||
| + | |||
| + | ===== Transformation Mechanics ===== | ||
| + | * **Trigger: | ||
| + | * **Phase 1:** Begins transformation, | ||
| + | * **Phase 2:** Spawns PseudoRat at same position, dies | ||
| + | * **Sound:** Plays Assets.SND_CURSED on transformation | ||
| + | |||
| + | ===== JSON Configuration ===== | ||
| + | Spawn configuration found in '' | ||
| + | <code json> | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== String Resources ===== | ||
| + | English ('' | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | Russian ('' | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | ===== Lua Scripts ===== | ||
| + | No Lua script implementation. This mob is implemented entirely in Java. | ||
| + | |||
| + | ===== Spawn Location ===== | ||
| + | * **Level:** Guts (этажи 26-30) | ||
| + | * **Configuration: | ||
| + | |||
| + | ===== Related Mobs ===== | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | |||
| + | ===== See Also ===== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
mr/suspicious_rat_mob.txt · Last modified: (external edit)
