v2.1.4: added a couple custom visuals to the blacksmith quest area
This commit is contained in:
BIN
core/src/main/assets/environment/custom_tiles/caves_quest.png
Normal file
BIN
core/src/main/assets/environment/custom_tiles/caves_quest.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 295 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -50,8 +50,9 @@ public class Assets {
|
||||
|
||||
public static final String WEAK_FLOOR = "environment/custom_tiles/weak_floor.png";
|
||||
public static final String SEWER_BOSS = "environment/custom_tiles/sewer_boss.png";
|
||||
public static final String PRISON_QUEST = "environment/custom_tiles/prison_quests.png";
|
||||
public static final String PRISON_QUEST = "environment/custom_tiles/prison_quest.png";
|
||||
public static final String PRISON_EXIT = "environment/custom_tiles/prison_exit.png";
|
||||
public static final String CAVES_QUEST = "environment/custom_tiles/caves_quest.png";
|
||||
public static final String CAVES_BOSS = "environment/custom_tiles/caves_boss.png";
|
||||
public static final String CITY_BOSS = "environment/custom_tiles/city_boss.png";
|
||||
public static final String HALLS_SP = "environment/custom_tiles/halls_special.png";
|
||||
|
||||
@@ -34,7 +34,10 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.painters.CavesPainter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.CaveRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
|
||||
import com.watabou.noosa.Group;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.Tilemap;
|
||||
|
||||
public class MiningLevel extends Level {
|
||||
|
||||
@@ -80,6 +83,10 @@ public class MiningLevel extends Level {
|
||||
|
||||
painter.paint(this, null);
|
||||
|
||||
BorderDarken vis = new BorderDarken();
|
||||
vis.setRect(0, 0, width, height);
|
||||
customWalls.add(vis);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -156,4 +163,35 @@ public class MiningLevel extends Level {
|
||||
CavesLevel.addCavesVisuals(this, visuals);
|
||||
return visuals;
|
||||
}
|
||||
|
||||
public static class BorderDarken extends CustomTilemap{
|
||||
|
||||
{
|
||||
texture = Assets.Environment.CAVES_QUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tilemap create() {
|
||||
Tilemap v = super.create();
|
||||
int[] data = new int[tileW*tileH];
|
||||
for (int i = 0; i < data.length; i++){
|
||||
if (i < tileW){
|
||||
data[i] = 2;
|
||||
} else if (i % tileW == 0 || i % tileW == tileW-1){
|
||||
data[i] = 1;
|
||||
} else if (i + 2*tileW > data.length) {
|
||||
data[i] = 3;
|
||||
} else {
|
||||
data[i] = -1;
|
||||
}
|
||||
}
|
||||
v.map( data, tileW );
|
||||
return v;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image image(int tileX, int tileY) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
@@ -29,6 +30,8 @@ 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.traps.BurningTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
|
||||
import com.watabou.noosa.Tilemap;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
@@ -74,7 +77,6 @@ public class BlacksmithRoom extends StandardRoom {
|
||||
} while (level.heaps.get( npc.pos ) != null);
|
||||
level.mobs.add( npc );
|
||||
|
||||
// TODO need to add some better visuals here (even just a simple custom asset)
|
||||
Random.pushGenerator(Dungeon.seedCurDepth()+1);
|
||||
int entrancePos;
|
||||
do {
|
||||
@@ -82,6 +84,10 @@ public class BlacksmithRoom extends StandardRoom {
|
||||
} while (level.heaps.get( npc.pos ) != null || entrancePos == npc.pos);
|
||||
Random.popGenerator();
|
||||
|
||||
QuestEntrance vis = new QuestEntrance();
|
||||
vis.pos(entrancePos, level);
|
||||
level.customTiles.add(vis);
|
||||
|
||||
level.transitions.add(new LevelTransition(level,
|
||||
entrancePos,
|
||||
LevelTransition.Type.BRANCH_EXIT,
|
||||
@@ -97,4 +103,22 @@ public class BlacksmithRoom extends StandardRoom {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class QuestEntrance extends CustomTilemap {
|
||||
|
||||
{
|
||||
texture = Assets.Environment.CAVES_QUEST;
|
||||
|
||||
tileW = tileH = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tilemap create() {
|
||||
Tilemap v = super.create();
|
||||
v.map( new int[]{0}, 1 );
|
||||
return v;
|
||||
}
|
||||
|
||||
//TODO add some text here in v2.2.0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.tiles;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.NoosaScript;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
@@ -40,7 +41,11 @@ public abstract class CustomTilemap implements Bundlable {
|
||||
protected Tilemap vis = null;
|
||||
|
||||
public void pos(int pos) {
|
||||
pos( pos%Dungeon.level.width(), pos/Dungeon.level.width() );
|
||||
pos( pos, Dungeon.level );
|
||||
}
|
||||
|
||||
public void pos(int pos, Level level) {
|
||||
pos( pos%level.width(), pos/level.width() );
|
||||
}
|
||||
|
||||
public void pos(int tileX, int tileY){
|
||||
|
||||
Reference in New Issue
Block a user