v2.2.0: added a proper entrance room for the blacksmith quest area
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 294 B After Width: | Height: | Size: 717 B |
@@ -23,9 +23,14 @@ levels.rooms.special.toxicgasroom$toxicvent.desc=A careless adventurer must have
|
|||||||
levels.rooms.special.weakfloorroom$hiddenwell.name=Distant well
|
levels.rooms.special.weakfloorroom$hiddenwell.name=Distant well
|
||||||
levels.rooms.special.weakfloorroom$hiddenwell.desc=You can just make out a well in the depths below, perhaps there is something down there?
|
levels.rooms.special.weakfloorroom$hiddenwell.desc=You can just make out a well in the depths below, perhaps there is something down there?
|
||||||
|
|
||||||
|
levels.rooms.standard.blacksmithroom$questentrance.name=Mine entrance
|
||||||
|
levels.rooms.standard.blacksmithroom$questentrance.desc=This ladder leads to an old mine just below the blacksmith's workshop.
|
||||||
|
|
||||||
levels.rooms.standard.ritualsiteroom$ritualmarker.name=Ritual marker
|
levels.rooms.standard.ritualsiteroom$ritualmarker.name=Ritual marker
|
||||||
levels.rooms.standard.ritualsiteroom$ritualmarker.desc=A painted marker for some dark ritual. Candles are usually placed on the four corners.
|
levels.rooms.standard.ritualsiteroom$ritualmarker.desc=A painted marker for some dark ritual. Candles are usually placed on the four corners.
|
||||||
|
|
||||||
|
levels.rooms.quest.mineentrance$questexit.name=Mine exit
|
||||||
|
levels.rooms.quest.mineentrance$questexit.desc=This ladder leads out of the mine, back into the blacksmith's workshop.
|
||||||
|
|
||||||
###traps
|
###traps
|
||||||
levels.traps.alarmtrap.name=alarm trap
|
levels.traps.alarmtrap.name=alarm trap
|
||||||
|
|||||||
@@ -32,9 +32,10 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.builders.Builder;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.MiningLevelPainter;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.MiningLevelPainter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.MineEntrance;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.CaveRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.CaveRoom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EntranceRoom;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
|
||||||
import com.watabou.noosa.Group;
|
import com.watabou.noosa.Group;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
@@ -49,7 +50,7 @@ public class MiningLevel extends CavesLevel {
|
|||||||
@Override
|
@Override
|
||||||
protected ArrayList<Room> initRooms() {
|
protected ArrayList<Room> initRooms() {
|
||||||
ArrayList<Room> initRooms = new ArrayList<>();
|
ArrayList<Room> initRooms = new ArrayList<>();
|
||||||
initRooms.add ( roomEntrance = new EntranceRoom());
|
initRooms.add ( roomEntrance = new MineEntrance());
|
||||||
|
|
||||||
//currently spawns 10-12 cave rooms, of any size
|
//currently spawns 10-12 cave rooms, of any size
|
||||||
int rooms = Random.NormalIntRange(10, 12);
|
int rooms = Random.NormalIntRange(10, 12);
|
||||||
|
|||||||
+123
@@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2015 Oleg Dolya
|
||||||
|
*
|
||||||
|
* Shattered Pixel Dungeon
|
||||||
|
* Copyright (C) 2014-2023 Evan Debenham
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EntranceRoom;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
|
||||||
|
import com.watabou.noosa.Image;
|
||||||
|
import com.watabou.noosa.Tilemap;
|
||||||
|
import com.watabou.utils.Point;
|
||||||
|
|
||||||
|
public class MineEntrance extends EntranceRoom {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int minWidth() {
|
||||||
|
return Math.max(super.minWidth(), 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int minHeight() {
|
||||||
|
return Math.max(super.minHeight(), 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canMerge(Level l, Point p, int mergeTerrain) {
|
||||||
|
//StandardRoom.canMerge
|
||||||
|
int cell = l.pointToCell(pointInside(p, 1));
|
||||||
|
return (Terrain.flags[l.map[cell]] & Terrain.SOLID) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Level level) {
|
||||||
|
Painter.fill( level, this, Terrain.WALL );
|
||||||
|
Painter.fill( level, this, 1, Terrain.EMPTY );
|
||||||
|
|
||||||
|
int entrance;
|
||||||
|
do {
|
||||||
|
entrance = level.pointToCell(random(2));
|
||||||
|
} while (level.findMob(entrance) != null || level.map[entrance] == Terrain.WALL);
|
||||||
|
Painter.set( level, entrance, Terrain.ENTRANCE );
|
||||||
|
|
||||||
|
QuestExit vis = new QuestExit();
|
||||||
|
Point p = level.cellToPoint(entrance);
|
||||||
|
vis.pos(p.x - 1, p.y - 1);
|
||||||
|
level.customTiles.add(vis);
|
||||||
|
|
||||||
|
level.transitions.add(new LevelTransition(level,
|
||||||
|
entrance,
|
||||||
|
LevelTransition.Type.BRANCH_ENTRANCE,
|
||||||
|
Dungeon.depth,
|
||||||
|
0,
|
||||||
|
LevelTransition.Type.BRANCH_EXIT));
|
||||||
|
|
||||||
|
//TODO add pre-quest decorations here
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class QuestExit extends CustomTilemap {
|
||||||
|
|
||||||
|
{
|
||||||
|
texture = Assets.Environment.CAVES_QUEST;
|
||||||
|
|
||||||
|
tileW = tileH = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int TEX_WIDTH = 128;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tilemap create() {
|
||||||
|
Tilemap v = super.create();
|
||||||
|
v.map(mapSimpleImage(0, 1, TEX_WIDTH), 3);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String name(int tileX, int tileY) {
|
||||||
|
if (tileX == 1 && tileY == 1){
|
||||||
|
return Messages.get(this, "name");
|
||||||
|
}
|
||||||
|
return super.name(tileX, tileY);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String desc(int tileX, int tileY) {
|
||||||
|
if (tileX == 1 && tileY == 1){
|
||||||
|
return Messages.get(this, "desc");
|
||||||
|
}
|
||||||
|
return super.desc(tileX, tileY);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Image image(int tileX, int tileY) {
|
||||||
|
if (tileX == 1 && tileY == 1){
|
||||||
|
return super.image(tileX, tileY);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+11
-1
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.BurningTrap;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.BurningTrap;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
|
||||||
import com.watabou.noosa.Tilemap;
|
import com.watabou.noosa.Tilemap;
|
||||||
import com.watabou.utils.Point;
|
import com.watabou.utils.Point;
|
||||||
@@ -119,6 +120,15 @@ public class BlacksmithRoom extends StandardRoom {
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO add some text here in v2.2.0
|
@Override
|
||||||
|
public String name(int tileX, int tileY) {
|
||||||
|
return Messages.get(this, "name");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String desc(int tileX, int tileY) {
|
||||||
|
return Messages.get(this, "desc");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user