v0.8.0: adjusted demon spawners and bestiary now that halls has 4 floors
This commit is contained in:
parent
c062edbdb6
commit
aaa0bdc135
|
@ -37,6 +37,8 @@ public class Statistics {
|
||||||
public static int upgradesUsed;
|
public static int upgradesUsed;
|
||||||
public static int sneakAttacks;
|
public static int sneakAttacks;
|
||||||
public static int thrownAssists;
|
public static int thrownAssists;
|
||||||
|
|
||||||
|
public static int spawnersAlive;
|
||||||
|
|
||||||
public static float duration;
|
public static float duration;
|
||||||
|
|
||||||
|
@ -58,6 +60,8 @@ public class Statistics {
|
||||||
upgradesUsed = 0;
|
upgradesUsed = 0;
|
||||||
sneakAttacks = 0;
|
sneakAttacks = 0;
|
||||||
thrownAssists = 0;
|
thrownAssists = 0;
|
||||||
|
|
||||||
|
spawnersAlive = 0;
|
||||||
|
|
||||||
duration = 0;
|
duration = 0;
|
||||||
|
|
||||||
|
@ -78,6 +82,8 @@ public class Statistics {
|
||||||
private static final String UPGRADES = "upgradesUsed";
|
private static final String UPGRADES = "upgradesUsed";
|
||||||
private static final String SNEAKS = "sneakAttacks";
|
private static final String SNEAKS = "sneakAttacks";
|
||||||
private static final String THROWN = "thrownAssists";
|
private static final String THROWN = "thrownAssists";
|
||||||
|
|
||||||
|
private static final String SPAWNERS = "spawnersAlive";
|
||||||
|
|
||||||
private static final String DURATION = "duration";
|
private static final String DURATION = "duration";
|
||||||
|
|
||||||
|
@ -95,6 +101,8 @@ public class Statistics {
|
||||||
bundle.put( UPGRADES, upgradesUsed );
|
bundle.put( UPGRADES, upgradesUsed );
|
||||||
bundle.put( SNEAKS, sneakAttacks );
|
bundle.put( SNEAKS, sneakAttacks );
|
||||||
bundle.put( THROWN, thrownAssists );
|
bundle.put( THROWN, thrownAssists );
|
||||||
|
|
||||||
|
bundle.put( SPAWNERS, spawnersAlive );
|
||||||
|
|
||||||
bundle.put( DURATION, duration );
|
bundle.put( DURATION, duration );
|
||||||
|
|
||||||
|
@ -113,6 +121,8 @@ public class Statistics {
|
||||||
upgradesUsed = bundle.getInt( UPGRADES );
|
upgradesUsed = bundle.getInt( UPGRADES );
|
||||||
sneakAttacks = bundle.getInt( SNEAKS );
|
sneakAttacks = bundle.getInt( SNEAKS );
|
||||||
thrownAssists = bundle.getInt( THROWN );
|
thrownAssists = bundle.getInt( THROWN );
|
||||||
|
|
||||||
|
spawnersAlive = bundle.getInt( SPAWNERS );
|
||||||
|
|
||||||
duration = bundle.getFloat( DURATION );
|
duration = bundle.getFloat( DURATION );
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,12 @@ public class Bestiary {
|
||||||
Golem.class, Golem.class, Golem.class));
|
Golem.class, Golem.class, Golem.class));
|
||||||
|
|
||||||
// Halls
|
// Halls
|
||||||
case 21: case 22:
|
case 21:
|
||||||
|
//2x succubus, 1x evil eye
|
||||||
|
return new ArrayList<>(Arrays.asList(
|
||||||
|
Succubus.class, Succubus.class,
|
||||||
|
Eye.class));
|
||||||
|
case 22:
|
||||||
//1x succubus, 1x evil eye
|
//1x succubus, 1x evil eye
|
||||||
return new ArrayList<>(Arrays.asList(
|
return new ArrayList<>(Arrays.asList(
|
||||||
Succubus.class,
|
Succubus.class,
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
||||||
|
@ -73,10 +74,17 @@ public class DemonSpawner extends Mob {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float spawnCooldown = 60;
|
private float spawnCooldown = 0;
|
||||||
|
|
||||||
|
private boolean spawnRecorded = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
|
if (!spawnRecorded){
|
||||||
|
Statistics.spawnersAlive++;
|
||||||
|
spawnRecorded = true;
|
||||||
|
}
|
||||||
|
|
||||||
spawnCooldown--;
|
spawnCooldown--;
|
||||||
if (spawnCooldown <= 0){
|
if (spawnCooldown <= 0){
|
||||||
ArrayList<Integer> candidates = new ArrayList<>();
|
ArrayList<Integer> candidates = new ArrayList<>();
|
||||||
|
@ -100,6 +108,10 @@ public class DemonSpawner extends Mob {
|
||||||
}
|
}
|
||||||
|
|
||||||
spawnCooldown += 60;
|
spawnCooldown += 60;
|
||||||
|
if (Dungeon.depth > 21){
|
||||||
|
//60/53.33/46.67/40 turns to spawn on floor 21/22/23/24
|
||||||
|
spawnCooldown -= Math.max(40, (Dungeon.depth-21)*6.67);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.act();
|
return super.act();
|
||||||
|
@ -116,18 +128,29 @@ public class DemonSpawner extends Mob {
|
||||||
super.damage(dmg, src);
|
super.damage(dmg, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void die(Object cause) {
|
||||||
|
if (spawnRecorded){
|
||||||
|
Statistics.spawnersAlive--;
|
||||||
|
}
|
||||||
|
super.die(cause);
|
||||||
|
}
|
||||||
|
|
||||||
public static final String SPAWN_COOLDOWN = "spawn_cooldown";
|
public static final String SPAWN_COOLDOWN = "spawn_cooldown";
|
||||||
|
public static final String SPAWN_RECORDED = "spawn_recorded";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeInBundle(Bundle bundle) {
|
public void storeInBundle(Bundle bundle) {
|
||||||
super.storeInBundle(bundle);
|
super.storeInBundle(bundle);
|
||||||
bundle.put(SPAWN_COOLDOWN, spawnCooldown);
|
bundle.put(SPAWN_COOLDOWN, spawnCooldown);
|
||||||
|
bundle.put(SPAWN_RECORDED, spawnRecorded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restoreFromBundle(Bundle bundle) {
|
public void restoreFromBundle(Bundle bundle) {
|
||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
spawnCooldown = bundle.getFloat(SPAWN_COOLDOWN);
|
spawnCooldown = bundle.getFloat(SPAWN_COOLDOWN);
|
||||||
|
spawnRecorded = bundle.getBoolean(SPAWN_RECORDED);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,9 +70,6 @@ public class HallsLevel extends RegularLevel {
|
||||||
ArrayList<Room> rooms = super.initRooms();
|
ArrayList<Room> rooms = super.initRooms();
|
||||||
|
|
||||||
rooms.add(new DemonSpawnerRoom());
|
rooms.add(new DemonSpawnerRoom());
|
||||||
if (Dungeon.depth == 24){
|
|
||||||
rooms.add(new DemonSpawnerRoom());
|
|
||||||
}
|
|
||||||
|
|
||||||
return rooms;
|
return rooms;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,21 +49,6 @@ public class DemonSpawnerRoom extends SpecialRoom {
|
||||||
spawner.pos = cx + cy * level.width();
|
spawner.pos = cx + cy * level.width();
|
||||||
level.mobs.add( spawner );
|
level.mobs.add( spawner );
|
||||||
|
|
||||||
//2/3 chance for 1, 1/3 chance for 2
|
|
||||||
int rippers = Random.chances( new float[]{0, 2, 1});
|
|
||||||
|
|
||||||
for (int i = 0; i < rippers; i++){
|
|
||||||
int pos;
|
|
||||||
do {
|
|
||||||
pos = level.pointToCell(random(1));
|
|
||||||
} while (level.solid[pos] || level.findMob(pos) != null);
|
|
||||||
|
|
||||||
RipperDemon ripper = new RipperDemon();
|
|
||||||
ripper.pos = pos;
|
|
||||||
ripper.state = ripper.HUNTING;
|
|
||||||
level.mobs.add( ripper );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user