v0.7.0b: added a new layer, currently used so things can be inside grass
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle;
|
||||
|
@ -44,7 +45,12 @@ public class HighGrass {
|
|||
|
||||
public static void trample( Level level, int pos, Char ch ) {
|
||||
|
||||
Level.set( pos, Terrain.GRASS );
|
||||
if (ch instanceof Hero && ((Hero) ch).heroClass == HeroClass.HUNTRESS){
|
||||
//Level.set(pos, Terrain.FURROWED_GRASS);
|
||||
Level.set(pos, Terrain.GRASS);
|
||||
} else {
|
||||
Level.set(pos, Terrain.GRASS);
|
||||
}
|
||||
GameScene.updateMap( pos );
|
||||
|
||||
int naturalismLevel = 0;
|
||||
|
|
|
@ -62,6 +62,7 @@ import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonWallsTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.FogOfWar;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.GridTileMap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.RaisedTerrainTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.TerrainFeaturesTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.WallBlockingTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
||||
|
@ -118,6 +119,7 @@ public class GameScene extends PixelScene {
|
|||
private DungeonTerrainTilemap tiles;
|
||||
private GridTileMap visualGrid;
|
||||
private TerrainFeaturesTilemap terrainFeatures;
|
||||
private RaisedTerrainTilemap raisedTerrain;
|
||||
private DungeonWallsTilemap walls;
|
||||
private WallBlockingTilemap wallBlocking;
|
||||
private FogOfWar fog;
|
||||
|
@ -242,6 +244,9 @@ public class GameScene extends PixelScene {
|
|||
mob.beckon( Dungeon.hero.pos );
|
||||
}
|
||||
}
|
||||
|
||||
raisedTerrain = new RaisedTerrainTilemap();
|
||||
add( raisedTerrain );
|
||||
|
||||
walls = new DungeonWallsTilemap();
|
||||
add(walls);
|
||||
|
@ -771,6 +776,7 @@ public class GameScene extends PixelScene {
|
|||
scene.tiles.map(Dungeon.level.map, Dungeon.level.width() );
|
||||
scene.visualGrid.map(Dungeon.level.map, Dungeon.level.width() );
|
||||
scene.terrainFeatures.map(Dungeon.level.map, Dungeon.level.width() );
|
||||
scene.raisedTerrain.map(Dungeon.level.map, Dungeon.level.width() );
|
||||
scene.walls.map(Dungeon.level.map, Dungeon.level.width() );
|
||||
}
|
||||
updateFog();
|
||||
|
@ -782,6 +788,7 @@ public class GameScene extends PixelScene {
|
|||
scene.tiles.updateMap();
|
||||
scene.visualGrid.updateMap();
|
||||
scene.terrainFeatures.updateMap();
|
||||
scene.raisedTerrain.updateMap();
|
||||
scene.walls.updateMap();
|
||||
updateFog();
|
||||
}
|
||||
|
@ -792,6 +799,7 @@ public class GameScene extends PixelScene {
|
|||
scene.tiles.updateMapCell( cell );
|
||||
scene.visualGrid.updateMapCell( cell );
|
||||
scene.terrainFeatures.updateMapCell( cell );
|
||||
scene.raisedTerrain.updateMapCell( cell );
|
||||
scene.walls.updateMapCell( cell );
|
||||
//update adjacent cells too
|
||||
updateFog( cell, 1 );
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 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.tiles;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
|
||||
public class RaisedTerrainTilemap extends DungeonTilemap {
|
||||
|
||||
public RaisedTerrainTilemap() {
|
||||
super(Dungeon.level.tilesTex());
|
||||
map( Dungeon.level.map, Dungeon.level.width() );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getTileVisual(int pos, int tile, boolean flat) {
|
||||
|
||||
if (flat) return -1;
|
||||
|
||||
if (tile == Terrain.HIGH_GRASS){
|
||||
return DungeonTileSheet.getVisualWithAlts(
|
||||
DungeonTileSheet.RAISED_HIGH_GRASS,
|
||||
pos) + 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean needsRender(int pos) {
|
||||
return data[pos] != -1;
|
||||
}
|
||||
}
|