v3.3.5: implemented another room for vault enemies

This commit is contained in:
Evan Debenham
2026-02-04 16:36:36 -05:00
committed by Evan Debenham
parent a19104fae7
commit 73ce3a9dab
4 changed files with 54 additions and 3 deletions

View File

@@ -1790,7 +1790,7 @@ actors.mobs.tormentedspirit.name=tormented spirit
actors.mobs.tormentedspirit.desc=Tormented spirits are otherwise good-natured spirits that have been afflicted by a curse. So long as they are cursed they will attack just like a wraith, and are more powerful as well!\n\nIt may be possible to cleanse the curse by using the right item while next to the spirit. If the curse is lifted the spirit will surely be grateful... actors.mobs.tormentedspirit.desc=Tormented spirits are otherwise good-natured spirits that have been afflicted by a curse. So long as they are cursed they will attack just like a wraith, and are more powerful as well!\n\nIt may be possible to cleanse the curse by using the right item while next to the spirit. If the curse is lifted the spirit will surely be grateful...
actors.mobs.tormentedspirit.thank_you=Thank you... actors.mobs.tormentedspirit.thank_you=Thank you...
actors.mobs.vaultrat.desc=This rat has some behaviour changes to test out new vault enemy AI:\n_-_ Its movement can be 'heard' through walls\n_-_ It will wander along a pre-set patrol\n_-_ While wandering it has sharply reduced detection chance behind the direction it moves in.\n_-_ When it detects you it will 'investigate' before swapping to hunting. Investigating enemies move toward you but don't attack and are easier to lose behind doors and corners. actors.mobs.vaultrat.desc=This rat has some behaviour changes to test out new vault enemy AI:\n_-_ Its movement can be 'heard' through walls\n_-_ It will wander along a pre-set patrol\n_-_ While wandering it has sharply reduced detection range behind the direction it moves in.\n_-_While sleeping its detection range is also reduced\n_-_ When it detects you it will 'investigate' before swapping to hunting. Investigating enemies move toward you but don't attack and are easier to lose behind doors and corners.
actors.mobs.warlock.name=dwarf warlock actors.mobs.warlock.name=dwarf warlock
actors.mobs.warlock.bolt_kill=The shadow bolt killed you... actors.mobs.warlock.bolt_kill=The shadow bolt killed you...

View File

@@ -160,6 +160,7 @@ public class VaultMob extends Mob {
} else { } else {
//reset this, representing the mob looking around in place //reset this, representing the mob looking around in place
previousPos = pos; previousPos = pos;
sprite.idle();
} }
} }
return wanderPos; return wanderPos;

View File

@@ -251,6 +251,9 @@ public class WandOfBlastWave extends DamageWand {
x = (pos % Dungeon.level.width()) * DungeonTilemap.SIZE + (DungeonTilemap.SIZE - width) / 2; x = (pos % Dungeon.level.width()) * DungeonTilemap.SIZE + (DungeonTilemap.SIZE - width) / 2;
y = (pos / Dungeon.level.width()) * DungeonTilemap.SIZE + (DungeonTilemap.SIZE - height) / 2; y = (pos / Dungeon.level.width()) * DungeonTilemap.SIZE + (DungeonTilemap.SIZE - height) / 2;
resetColor();
scale.set(0);
time = TIME_TO_FADE; time = TIME_TO_FADE;
this.size = size; this.size = size;
} }
@@ -283,8 +286,6 @@ public class WandOfBlastWave extends DamageWand {
b.reset(pos, radius); b.reset(pos, radius);
if (hardLight != -1){ if (hardLight != -1){
b.hardlight(hardLight); b.hardlight(hardLight);
} else {
b.resetColor();
} }
} }

View File

@@ -0,0 +1,49 @@
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.VaultRat;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
import com.watabou.utils.Point;
public class VaultEnemyCenterRoom extends StandardRoom {
@Override
public float[] sizeCatProbs() {
return new float[]{0, 1, 0};
}
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
Painter.fill( level, this, 1 , Terrain.EMPTY );
Painter.fill( level, this, 2 , Terrain.WALL );
Painter.fill( level, this, 3 , Terrain.EMPTY );
Painter.drawLine( level, new Point(left+1, top+3), new Point(right-1, top+3), Terrain.EMPTY);
Painter.drawLine( level, new Point(left+1, bottom-3), new Point(right-1, bottom-3), Terrain.EMPTY);
Painter.drawLine( level, new Point(left+3, top+1), new Point(left+3, bottom-1), Terrain.EMPTY);
Painter.drawLine( level, new Point(right-3, top+1), new Point(right-3, bottom-1), Terrain.EMPTY);
//TODO maybe better without corner pillars? they sorta just bait you...
// Need to think a little more about layout here
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
}
VaultRat rat = new VaultRat();
do {
rat.pos = level.pointToCell(center());
} while (level.solid[rat.pos]);
rat.state = rat.WANDERING;
level.mobs.add(rat);
}
@Override
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
return false;
}
}