diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java index 7b97a5f7d..97295ad9b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java @@ -66,7 +66,12 @@ public class Ghoul extends Mob { public int drRoll() { return Random.NormalIntRange(0, 4); } - + + @Override + public float spawningWeight() { + return 0.5f; + } + private int partnerID = -1; private static final String PARTNER_ID = "partner_id"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java index 5ee4e5cbf..d7e226c23 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java @@ -108,7 +108,12 @@ public class Mimic extends Mob { } super.rollToDropLoot(); } - + + @Override + public float spawningWeight() { + return 0f; + } + @Override public boolean reset() { state = WANDERING; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 63285a740..cb1efbe31 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -671,6 +671,11 @@ public abstract class Mob extends Char { } return item; } + + //how many mobs this one should count as when determining spawning totals + public float spawningWeight(){ + return 1; + } public boolean reset() { return false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java index 638db2e8c..ff2085254 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java @@ -104,7 +104,12 @@ public class Piranha extends Mob { Statistics.piranhasKilled++; Badges.validatePiranhasKilled(); } - + + @Override + public float spawningWeight() { + return 0; + } + @Override public boolean reset() { return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java index 58daaa02c..017231de1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java @@ -140,7 +140,12 @@ public class Statue extends Mob { Notes.remove( Notes.Landmark.STATUE ); super.destroy(); } - + + @Override + public float spawningWeight() { + return 0f; + } + @Override public boolean reset() { state = PASSIVE; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java index 6e49b03bc..fdb0f0373 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java @@ -84,6 +84,11 @@ public class Wraith extends Mob { enemySeen = true; } + @Override + public float spawningWeight() { + return 0f; + } + @Override public boolean reset() { state = WANDERING; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index e964ff8cf..509d93d2b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -492,11 +492,12 @@ public abstract class Level implements Bundlable { @Override protected boolean act() { - int count = 0; + float count = 0; - //TODO some mobs should count for less (ripper shouldn't count at all, ghouls should be 1/2, special enemies should be 0 for (Mob mob : mobs.toArray(new Mob[0])){ - if (mob.alignment == Char.Alignment.ENEMY) count++; + if (mob.alignment == Char.Alignment.ENEMY && !mob.properties().contains(Char.Property.MINIBOSS)) { + count += mob.spawningWeight(); + } } if (count < nMobs()) {