v2.5.0: mimics are now sneaky if hero had mimic tooth when they spawned
This commit is contained in:
@@ -49,7 +49,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TalismanOfForesi
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MimicTooth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfRegrowth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfWarding;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
@@ -950,10 +949,9 @@ public class Dungeon {
|
||||
|
||||
GameScene.updateFog(l, t, width, height);
|
||||
|
||||
boolean stealthyMimics = MimicTooth.stealthyMimics();
|
||||
if (hero.buff(MindVision.class) != null){
|
||||
for (Mob m : level.mobs.toArray(new Mob[0])){
|
||||
if (stealthyMimics && m instanceof Mimic && m.alignment == Char.Alignment.NEUTRAL){
|
||||
if (m instanceof Mimic && m.alignment == Char.Alignment.NEUTRAL && ((Mimic) m).stealthy()){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -66,6 +66,11 @@ public class EbonyMimic extends Mimic {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stealthy() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void stopHiding(){
|
||||
state = HUNTING;
|
||||
if (sprite != null) sprite.idle();
|
||||
|
||||
@@ -65,15 +65,19 @@ public class Mimic extends Mob {
|
||||
}
|
||||
|
||||
public ArrayList<Item> items;
|
||||
|
||||
private boolean stealthy = false;
|
||||
|
||||
private static final String LEVEL = "level";
|
||||
private static final String ITEMS = "items";
|
||||
private static final String STEALTHY= "stealthy";
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
if (items != null) bundle.put( ITEMS, items );
|
||||
bundle.put( LEVEL, level );
|
||||
bundle.put( STEALTHY, stealthy );
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -84,6 +88,7 @@ public class Mimic extends Mob {
|
||||
}
|
||||
level = bundle.getInt( LEVEL );
|
||||
adjustStats(level);
|
||||
stealthy = bundle.getBoolean(STEALTHY);
|
||||
super.restoreFromBundle(bundle);
|
||||
if (state != PASSIVE && alignment == Alignment.NEUTRAL){
|
||||
alignment = Alignment.ENEMY;
|
||||
@@ -142,7 +147,7 @@ public class Mimic extends Mob {
|
||||
@Override
|
||||
public CharSprite sprite() {
|
||||
MimicSprite sprite = (MimicSprite) super.sprite();
|
||||
if (alignment == Alignment.NEUTRAL) sprite.hideMimic();
|
||||
if (alignment == Alignment.NEUTRAL) sprite.hideMimic(this);
|
||||
return sprite;
|
||||
}
|
||||
|
||||
@@ -215,6 +220,11 @@ public class Mimic extends Mob {
|
||||
}
|
||||
}
|
||||
|
||||
//stealthy mimics have changes to visual behaviour that make them much harder to detect
|
||||
public boolean stealthy(){
|
||||
return stealthy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageRoll() {
|
||||
if (alignment == Alignment.NEUTRAL){
|
||||
@@ -309,6 +319,10 @@ public class Mimic extends Mob {
|
||||
//generate an extra reward for killing the mimic
|
||||
m.generatePrize(useDecks);
|
||||
|
||||
if (MimicTooth.stealthyMimics()){
|
||||
m.stealthy = true;
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfIntuition;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.DimensionalSundial;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.EyeOfNewt;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MimicTooth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MossyClump;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.TrapMechanism;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.TrinketCatalyst;
|
||||
@@ -1342,10 +1341,9 @@ public abstract class Level implements Bundlable {
|
||||
}
|
||||
|
||||
Dungeon.hero.mindVisionEnemies.clear();
|
||||
boolean stealthyMimics = MimicTooth.stealthyMimics();
|
||||
if (c.buff( MindVision.class ) != null) {
|
||||
for (Mob mob : mobs) {
|
||||
if (stealthyMimics && mob instanceof Mimic && mob.alignment == Char.Alignment.NEUTRAL){
|
||||
if (mob instanceof Mimic && mob.alignment == Char.Alignment.NEUTRAL&& ((Mimic) mob).stealthy()){
|
||||
continue;
|
||||
}
|
||||
for (int i : PathFinder.NEIGHBOURS9) {
|
||||
@@ -1362,7 +1360,7 @@ public abstract class Level implements Bundlable {
|
||||
|
||||
if (mindVisRange >= 1) {
|
||||
for (Mob mob : mobs) {
|
||||
if (stealthyMimics && mob instanceof Mimic && mob.alignment == Char.Alignment.NEUTRAL) {
|
||||
if (mob instanceof Mimic && mob.alignment == Char.Alignment.NEUTRAL&& ((Mimic) mob).stealthy()){
|
||||
continue;
|
||||
}
|
||||
int p = mob.pos;
|
||||
|
||||
@@ -60,7 +60,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.journal.Guidebook;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.DimensionalSundial;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MimicTooth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Document;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Journal;
|
||||
@@ -1323,10 +1322,9 @@ public class GameScene extends PixelScene {
|
||||
|
||||
public static void afterObserve() {
|
||||
if (scene != null) {
|
||||
boolean stealthyMimics = MimicTooth.stealthyMimics();
|
||||
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
|
||||
if (mob.sprite != null) {
|
||||
if (stealthyMimics && mob instanceof Mimic && mob.state == mob.PASSIVE && mob.sprite.visible){
|
||||
if (mob instanceof Mimic && mob.state == mob.PASSIVE && ((Mimic) mob).stealthy() && mob.sprite.visible){
|
||||
//mimics stay visible in fog of war after being first seen
|
||||
mob.sprite.visible = true;
|
||||
} else {
|
||||
|
||||
+6
-6
@@ -23,7 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MimicTooth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
|
||||
public class MimicSprite extends MobSprite {
|
||||
@@ -77,12 +77,12 @@ public class MimicSprite extends MobSprite {
|
||||
public void linkVisuals(Char ch) {
|
||||
super.linkVisuals(ch);
|
||||
if (ch.alignment == Char.Alignment.NEUTRAL) {
|
||||
hideMimic();
|
||||
hideMimic(ch);
|
||||
}
|
||||
}
|
||||
|
||||
public void hideMimic(){
|
||||
if (MimicTooth.stealthyMimics()){
|
||||
public void hideMimic(Char ch){
|
||||
if (ch instanceof Mimic && ((Mimic) ch).stealthy()){
|
||||
play(advancedHiding);
|
||||
} else {
|
||||
play(hiding);
|
||||
@@ -119,8 +119,8 @@ public class MimicSprite extends MobSprite {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideMimic() {
|
||||
super.hideMimic();
|
||||
public void hideMimic(Char ch) {
|
||||
super.hideMimic(ch);
|
||||
alpha(0.2f);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user