Skip to content

Commit

Permalink
0.9.5bp-hw2
Browse files Browse the repository at this point in the history
...
  • Loading branch information
hmdzl001 committed Oct 25, 2020
1 parent 9916150 commit 8b47d7c
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 49 deletions.
Binary file added assets/tiles_honey.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/tiles_sp.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/water5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions java/com/hmdzl/spspd/Assets.java
Expand Up @@ -161,12 +161,15 @@ public class Assets {
public static final String TILES_FOREST = "tiles_forest.png";
public static final String TILES_TOWN = "tiles_town.png";
public static final String TILES_SP = "tiles_sp.png";
public static final String TILES_HONEY = "tiles_honey.png";

public static final String WATER_SEWERS = "water0.png";
public static final String WATER_PRISON = "water1.png";
public static final String WATER_CAVES = "water2.png";
public static final String WATER_CITY = "water3.png";
public static final String WATER_HALLS = "water4.png";
public static final String WATER_HONEY = "water5.png";


public static final String WEAK_FLOOR = "custom_tiles/weak_floor.png";

Expand Down
13 changes: 4 additions & 9 deletions java/com/hmdzl/spspd/Dungeon.java
Expand Up @@ -157,7 +157,6 @@ public void drop() {
public static boolean dewNorn = false;
public static boolean canSave = false;
public static boolean gnollmission = false;
public static boolean oneDay = false;
public static boolean error = false;
//public static boolean secondQuest = false;

Expand Down Expand Up @@ -262,7 +261,6 @@ public static void init() {
dewNorn = false;
canSave = false;
gnollmission = false;
oneDay =false;
error = false;

pars = new int[100];
Expand Down Expand Up @@ -950,9 +948,9 @@ public static boolean notClearableLevel(int depth) {
|| depth == 25 || depth>25;
}

public static boolean townCheck(int depth) {
return depth > 54 && depth < 66;
}
//public static boolean townCheck(int depth) {
//return depth > 54 && depth < 66;
//}

public static boolean growLevel(int depth) {
return depth == 27 || depth == 28 || depth == 32 || depth == 30 || depth == 55;
Expand Down Expand Up @@ -1111,7 +1109,6 @@ private static boolean chance(int[] quota, int number) {
private static final String DEWNORN = "dewNorn";
private static final String CANSAVE = "canSave";
private static final String GNOLLMISSION = "gnollmission";
private static final String ONEDAY = "oneDay";
private static final String ERROR = "error";
private static final String WINGS = "wings";
private static final String PARS = "pars";
Expand Down Expand Up @@ -1199,7 +1196,6 @@ public static void saveGame(String fileName) throws IOException {
bundle.put(DEWNORN, dewNorn);
bundle.put(CANSAVE, canSave);
bundle.put(GNOLLMISSION, gnollmission);
bundle.put(ONEDAY, oneDay);
bundle.put(ERROR, error);
bundle.put(PARS, pars);

Expand Down Expand Up @@ -1395,7 +1391,6 @@ public static void loadGame(String fileName, boolean fullLoad)
dewNorn = bundle.getBoolean(DEWNORN);
canSave = bundle.getBoolean(CANSAVE);
gnollmission = bundle.getBoolean(GNOLLMISSION);
oneDay = bundle.getBoolean(ONEDAY);
error = bundle.getBoolean(ERROR);
pars = bundle.getIntArray(PARS);

Expand Down Expand Up @@ -1567,7 +1562,7 @@ public static boolean checkNight(){
}

public static int getMonth(){
int month=Calendar.getInstance().get(Calendar.MONTH);
int month=Calendar.getInstance().get(Calendar.MONTH)+1;
return month;
}

Expand Down
2 changes: 1 addition & 1 deletion java/com/hmdzl/spspd/actors/hero/Hero.java
Expand Up @@ -1336,7 +1336,7 @@ private boolean actAscend(HeroAction.Ascend action) {
InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
Game.switchScene(InterlevelScene.class);

} else if (Dungeon.depth > 26 && !Dungeon.townCheck(Dungeon.depth)){
} else if (Dungeon.depth > 26 ){
ready();
} else if (Dungeon.depth == 55 || Dungeon.depth == 99){
ready();
Expand Down
4 changes: 2 additions & 2 deletions java/com/hmdzl/spspd/actors/mobs/ElderAvatar.java
Expand Up @@ -124,10 +124,10 @@ public void restoreFromBundle( Bundle bundle ) {
public void spawnObe() {
Obelisk a = new Obelisk();

a.pos = Terrain.EMPTY_WELL;
a.pos = Terrain.WELL;
do {
a.pos = Random.Int(Dungeon.level.randomRespawnCellMob());
} while (Dungeon.level.map[a.pos] != Terrain.EMPTY_WELL
} while (Dungeon.level.map[a.pos] != Terrain.WELL
|| Actor.findChar(a.pos) != null);
GameScene.add(a);
}
Expand Down
4 changes: 2 additions & 2 deletions java/com/hmdzl/spspd/actors/mobs/King.java
Expand Up @@ -91,10 +91,10 @@ public class King extends Mob {
public void spawnTomb() {
DwarfKingTomb a = new DwarfKingTomb();

a.pos = Terrain.EMPTY_WELL;
a.pos = Terrain.WELL;
do {
a.pos = Random.Int(Dungeon.level.randomRespawnCellMob());
} while (Dungeon.level.map[a.pos] != Terrain.EMPTY_WELL
} while (Dungeon.level.map[a.pos] != Terrain.WELL
|| Actor.findChar(a.pos) != null);
GameScene.add(a);
}
Expand Down
5 changes: 2 additions & 3 deletions java/com/hmdzl/spspd/actors/mobs/LichDancer.java
Expand Up @@ -111,7 +111,6 @@ protected boolean act() {

if( 3 - breaks > 4 * HP / HT ) {
breaks++;
spawnTomb();
jump();
return true;
}
Expand Down Expand Up @@ -147,15 +146,15 @@ private void jump() {
int newPos;
do {
newPos = Random.Int(Level.getLength());
} while (Dungeon.level.map[newPos] != Terrain.EMPTY_WELL);
} while (Dungeon.level.map[newPos] != Terrain.WELL && Dungeon.level.map[newPos] != Terrain.TENT);
sprite.move(pos, newPos);
move(newPos);

if (Dungeon.visible[newPos]) {
CellEmitter.get(newPos).burst(Speck.factory(Speck.WOOL), 6);
Sample.INSTANCE.play(Assets.SND_PUFF);
}

spawnTomb();
spend(1 / speed());
}

Expand Down
2 changes: 1 addition & 1 deletion java/com/hmdzl/spspd/actors/mobs/Wraith.java
Expand Up @@ -134,7 +134,7 @@ public boolean reset() {
@Override
public void notice() {
super.notice();
if (Dungeon.getMonth()==9) {yell("BOO!");}
//if (Dungeon.getMonth()==9) {yell("BOO!");}
}

public static void spawnAround(int pos) {
Expand Down
2 changes: 1 addition & 1 deletion java/com/hmdzl/spspd/actors/mobs/npcs/NewPlayer.java
Expand Up @@ -30,7 +30,7 @@ public class NewPlayer extends NPC {

{
//name = NewPlayer;
spriteClass = IceRabbitSprite.class;
spriteClass =NewPlayerSprite.class;
state = WANDERING;
properties.add(Property.UNKNOW);
}
Expand Down
5 changes: 4 additions & 1 deletion java/com/hmdzl/spspd/levels/CityBossLevel.java
Expand Up @@ -87,7 +87,10 @@ protected boolean build() {
Painter.fill(this, LEFT, TOP, HALL_WIDTH, HALL_HEIGHT, Terrain.EMPTY);
Painter.fill(this, CENTER, TOP, 1, HALL_HEIGHT, Terrain.EMPTY_SP);

map[(TOP + 1) * getWidth() + CENTER] = Terrain.EMPTY_WELL;
map[(TOP + 1) * getWidth() + CENTER] = Terrain.WELL;

map[(TOP + 1) * getWidth() + CENTER - 1] = Terrain.TENT;
map[(TOP + 1) * getWidth() + CENTER + 1] = Terrain.TENT;

int y = TOP + 1;
while (y < TOP + HALL_HEIGHT) {
Expand Down
4 changes: 2 additions & 2 deletions java/com/hmdzl/spspd/levels/PotLevel.java
Expand Up @@ -374,12 +374,12 @@ public void press(int cell, Char ch) {

@Override
public String tilesTex() {
return Assets.TILES_PUZZLE;
return Assets.TILES_HONEY;
}

@Override
public String waterTex() {
return Assets.WATER_PRISON;
return Assets.WATER_HONEY;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion java/com/hmdzl/spspd/levels/RegularLevel.java
Expand Up @@ -149,7 +149,7 @@ protected boolean build() {
}

specials = new ArrayList<Room.Type>(Room.SPECIALS);
if (Dungeon.bossLevel(Dungeon.depth + 1) || Dungeon.townCheck(Dungeon.depth)) {
if (Dungeon.bossLevel(Dungeon.depth + 1)) {
specials.remove(Room.Type.WEAK_FLOOR);
}
if (Dungeon.skins == 5) {
Expand Down
2 changes: 2 additions & 0 deletions java/com/hmdzl/spspd/levels/SokobanSPLevel.java
Expand Up @@ -418,11 +418,13 @@ public void press(int cell, Char ch) {
@Override
public String tilesTex() {
return Assets.TILES_SP;
//return Assets.TILES_HONEY;
}

@Override
public String waterTex() {
return Assets.WATER_SEWERS;
//return Assets.WATER_HONEY;
}

@Override
Expand Down
23 changes: 4 additions & 19 deletions java/com/hmdzl/spspd/levels/TownLevel.java
Expand Up @@ -154,10 +154,7 @@ public class TownLevel extends Level {
LENGTH = HEIGHT*WIDTH;
special=false;
}


public int mineDepth=0;


public int[] scrollspots;
public int[] storespots;
public int[] bombpots;
Expand All @@ -168,7 +165,6 @@ public class TownLevel extends Level {
public int[] skillpots;
public int[] pillpots;

private static final String MINEDEPTH = "mineDepth";
private static final String SCROLLSPOTS = "scrollspots";
private static final String STORESPOTS = "storespots";
private static final String BOMBPOTS = "bombpots";
Expand All @@ -181,7 +177,6 @@ public class TownLevel extends Level {
@Override
public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle);
bundle.put(MINEDEPTH, mineDepth);
bundle.put(SCROLLSPOTS, scrollspots);
bundle.put(STORESPOTS, storespots);
bundle.put(BOMBPOTS, bombpots);
Expand All @@ -196,7 +191,6 @@ public void storeInBundle(Bundle bundle) {
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
mineDepth = bundle.getInt(MINEDEPTH);
scrollspots = bundle.getIntArray(SCROLLSPOTS);
storespots = bundle.getIntArray(STORESPOTS);
bombpots = bundle.getIntArray(BOMBPOTS);
Expand Down Expand Up @@ -242,7 +236,7 @@ public void storeStock (){
map[exit] = Terrain.STATUE;
}

if(storeRefresh()){

if (Badges.checkSARRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)){
for (int i : sppots) {
Heap heap = heaps.get(i);
Expand Down Expand Up @@ -326,7 +320,7 @@ public void storeStock (){
}
}
}
}

}

public Item storeItem (){
Expand Down Expand Up @@ -566,16 +560,6 @@ public Item storeItem9 (){
return prize;
}

public boolean storeRefresh(){
boolean check=false;
if (Statistics.realdeepestFloor>mineDepth || Dungeon.oneDay==true){
//mineDepth=Statistics.realdeepestFloor;
check=true;
Dungeon.oneDay=false;
}
return check;
}

@Override
public void create() {

Expand Down Expand Up @@ -1077,6 +1061,7 @@ public String tilesTex() {
@Override
public String waterTex() {
return Assets.WATER_PRISON;
//return Assets.WATER_HONEY;
}

@Override
Expand Down
2 changes: 0 additions & 2 deletions java/com/hmdzl/spspd/levels/painters/StandardPainter.java
Expand Up @@ -118,7 +118,6 @@ public static void paint(Level level, Room room) {
if (!Dungeon.bossLevel()
&& !Dungeon.bossLevel(Dungeon.depth + 1)
&& (Dungeon.depth < 22 || Dungeon.depth > 100)
&& !Dungeon.townCheck(Dungeon.depth)
&& Math.min(room.width(), room.height()) >= 5) {
paintFissure(level, room);
return;
Expand Down Expand Up @@ -363,7 +362,6 @@ private static void paintBridge(Level level, Room room) {
fill(level, room.left + 1, room.top + 1, room.width() - 1,
room.height() - 1,
!Dungeon.bossLevel() && !Dungeon.bossLevel(Dungeon.depth + 1) && (Dungeon.depth < 22 || Dungeon.depth > 26)
&& !Dungeon.townCheck(Dungeon.depth)
&& Random.Int(3) == 0 ? Terrain.TRAP_AIR : Terrain.WATER);

Point door1 = null;
Expand Down
2 changes: 1 addition & 1 deletion java/com/hmdzl/spspd/scenes/GameScene.java
Expand Up @@ -370,7 +370,7 @@ public void create() {
break;
}

if (Dungeon.hero.isAlive() && Dungeon.depth != 22) {
if (Dungeon.hero.isAlive()) {
Badges.validateNoKilling();
}
break;
Expand Down
8 changes: 4 additions & 4 deletions java/com/hmdzl/spspd/scenes/InterlevelScene.java
Expand Up @@ -284,9 +284,9 @@ private void descend() throws IOException {
Level level;
if ((Dungeon.depth>55) && (Dungeon.depth >= Statistics.realdeepestFloor) && ((Random.Int(100)<101) || Dungeon.depth==56) ){
level = Dungeon.newMineBossLevel();
}else if (Dungeon.townCheck(Dungeon.depth) && (Dungeon.depth >= Statistics.realdeepestFloor || Random.Int(10)<2)){
level = Dungeon.newLevel();
}else if (Dungeon.depth >= Statistics.deepestFloor && !Dungeon.townCheck(Dungeon.depth) ){
//}else if (Dungeon.townCheck(Dungeon.depth) && (Dungeon.depth >= Statistics.realdeepestFloor || Random.Int(10)<2)){
// level = Dungeon.newLevel();
}else if (Dungeon.depth >= Statistics.deepestFloor){
level = Dungeon.newLevel();
} else {
Dungeon.depth++;
Expand Down Expand Up @@ -324,7 +324,7 @@ private void ascend() throws IOException {
Dungeon.depth=40;
Level level = Dungeon.loadLevel(Dungeon.hero.heroClass);
Dungeon.switchLevel(level, level.entrance);
} else if (Dungeon.depth > 26 && !Dungeon.townCheck(Dungeon.depth)) {
} else if (Dungeon.depth > 26) {
Dungeon.depth=1;
Level level = Dungeon.loadLevel(Dungeon.hero.heroClass);
Dungeon.switchLevel(level, level.entrance);
Expand Down

0 comments on commit 8b47d7c

Please sign in to comment.