v0.7.1: implemented new furrowed grass mechanic for huntress

This commit is contained in:
Evan Debenham
2018-11-17 03:30:10 -05:00
parent 72249110bf
commit 74fc34bd97
22 changed files with 117 additions and 74 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

@@ -44,7 +44,8 @@ public class StormCloud extends Blob {
int terr = Dungeon.level.map[cell]; int terr = Dungeon.level.map[cell];
if (terr == Terrain.EMPTY || terr == Terrain.GRASS || if (terr == Terrain.EMPTY || terr == Terrain.GRASS ||
terr == Terrain.EMBERS || terr == Terrain.EMPTY_SP || terr == Terrain.EMBERS || terr == Terrain.EMPTY_SP ||
terr == Terrain.HIGH_GRASS || terr == Terrain.EMPTY_DECO) { terr == Terrain.HIGH_GRASS || terr == Terrain.FURROWED_GRASS
|| terr == Terrain.EMPTY_DECO) {
Level.set(cell, Terrain.WATER); Level.set(cell, Terrain.WATER);
GameScene.updateMap(cell); GameScene.updateMap(cell);
} else if (terr == Terrain.SECRET_TRAP || terr == Terrain.TRAP || terr == Terrain.INACTIVE_TRAP) { } else if (terr == Terrain.SECRET_TRAP || terr == Terrain.TRAP || terr == Terrain.INACTIVE_TRAP) {
@@ -78,7 +78,8 @@ public class RegrowthBomb extends Bomb {
Dungeon.level.map[i] == Terrain.EMBERS || Dungeon.level.map[i] == Terrain.EMBERS ||
Dungeon.level.map[i] == Terrain.EMPTY_DECO || Dungeon.level.map[i] == Terrain.EMPTY_DECO ||
Dungeon.level.map[i] == Terrain.GRASS || Dungeon.level.map[i] == Terrain.GRASS ||
Dungeon.level.map[i] == Terrain.HIGH_GRASS){ Dungeon.level.map[i] == Terrain.HIGH_GRASS ||
Dungeon.level.map[i] == Terrain.FURROWED_GRASS){
plantCandidates.add(i); plantCandidates.add(i);
} }
@@ -55,7 +55,8 @@ public class AquaBlast extends TargetedSpell {
int terr = Dungeon.level.map[cell + i]; int terr = Dungeon.level.map[cell + i];
if (terr == Terrain.EMPTY || terr == Terrain.GRASS || if (terr == Terrain.EMPTY || terr == Terrain.GRASS ||
terr == Terrain.EMBERS || terr == Terrain.EMPTY_SP || terr == Terrain.EMBERS || terr == Terrain.EMPTY_SP ||
terr == Terrain.HIGH_GRASS || terr == Terrain.EMPTY_DECO) { terr == Terrain.HIGH_GRASS || terr == Terrain.FURROWED_GRASS ||
terr == Terrain.EMPTY_DECO) {
Level.set(cell + i, Terrain.WATER); Level.set(cell + i, Terrain.WATER);
GameScene.updateMap(cell + i); GameScene.updateMap(cell + i);
} }
@@ -128,14 +128,7 @@ public class CursedWand {
case 1: case 1:
cursedFX(user, bolt, new Callback() { cursedFX(user, bolt, new Callback() {
public void call() { public void call() {
int c = Dungeon.level.map[bolt.collisionPos]; GameScene.add( Blob.seed(bolt.collisionPos, 30, Regrowth.class));
if (c == Terrain.EMPTY ||
c == Terrain.EMBERS ||
c == Terrain.EMPTY_DECO ||
c == Terrain.GRASS ||
c == Terrain.HIGH_GRASS) {
GameScene.add( Blob.seed(bolt.collisionPos, 30, Regrowth.class));
}
wand.wandUsed(); wand.wandUsed();
} }
}); });
@@ -220,7 +213,8 @@ public class CursedWand {
pos == Terrain.EMBERS || pos == Terrain.EMBERS ||
pos == Terrain.EMPTY_DECO || pos == Terrain.EMPTY_DECO ||
pos == Terrain.GRASS || pos == Terrain.GRASS ||
pos == Terrain.HIGH_GRASS) { pos == Terrain.HIGH_GRASS ||
pos == Terrain.FURROWED_GRASS) {
Dungeon.level.plant((Plant.Seed) Generator.random(Generator.Category.SEED), pos); Dungeon.level.plant((Plant.Seed) Generator.random(Generator.Category.SEED), pos);
} }
wand.wandUsed(); wand.wandUsed();
@@ -358,14 +352,7 @@ public class CursedWand {
//great forest fire! //great forest fire!
case 0: case 0:
for (int i = 0; i < Dungeon.level.length(); i++){ for (int i = 0; i < Dungeon.level.length(); i++){
int c = Dungeon.level.map[i]; GameScene.add( Blob.seed(i, 15, Regrowth.class));
if (c == Terrain.EMPTY ||
c == Terrain.EMBERS ||
c == Terrain.EMPTY_DECO ||
c == Terrain.GRASS ||
c == Terrain.HIGH_GRASS) {
GameScene.add( Blob.seed(i, 15, Regrowth.class));
}
} }
do { do {
GameScene.add(Blob.seed(Dungeon.level.randomDestination(), 10, Fire.class)); GameScene.add(Blob.seed(Dungeon.level.randomDestination(), 10, Fire.class));
@@ -78,7 +78,8 @@ public class WandOfRegrowth extends Wand {
c == Terrain.EMBERS || c == Terrain.EMBERS ||
c == Terrain.EMPTY_DECO || c == Terrain.EMPTY_DECO ||
c == Terrain.GRASS || c == Terrain.GRASS ||
c == Terrain.HIGH_GRASS)) { c == Terrain.HIGH_GRASS ||
c == Terrain.FURROWED_GRASS)) {
i.remove(); i.remove();
} }
} }
@@ -711,6 +711,7 @@ public abstract class Level implements Bundlable {
} }
if (map[pos] == Terrain.HIGH_GRASS || if (map[pos] == Terrain.HIGH_GRASS ||
map[pos] == Terrain.FURROWED_GRASS ||
map[pos] == Terrain.EMPTY || map[pos] == Terrain.EMPTY ||
map[pos] == Terrain.EMBERS || map[pos] == Terrain.EMBERS ||
map[pos] == Terrain.EMPTY_DECO) { map[pos] == Terrain.EMPTY_DECO) {
@@ -800,6 +801,7 @@ public abstract class Level implements Bundlable {
break; break;
case Terrain.HIGH_GRASS: case Terrain.HIGH_GRASS:
case Terrain.FURROWED_GRASS:
HighGrass.trample( this, cell, ch ); HighGrass.trample( this, cell, ch );
break; break;
@@ -1002,6 +1004,8 @@ public abstract class Level implements Bundlable {
return Messages.get(Level.class, "exit_name"); return Messages.get(Level.class, "exit_name");
case Terrain.EMBERS: case Terrain.EMBERS:
return Messages.get(Level.class, "embers_name"); return Messages.get(Level.class, "embers_name");
case Terrain.FURROWED_GRASS:
return Messages.get(Level.class, "furrowed_grass_name");
case Terrain.LOCKED_DOOR: case Terrain.LOCKED_DOOR:
return Messages.get(Level.class, "locked_door_name"); return Messages.get(Level.class, "locked_door_name");
case Terrain.PEDESTAL: case Terrain.PEDESTAL:
@@ -1049,6 +1053,7 @@ public abstract class Level implements Bundlable {
case Terrain.EMBERS: case Terrain.EMBERS:
return Messages.get(Level.class, "embers_desc"); return Messages.get(Level.class, "embers_desc");
case Terrain.HIGH_GRASS: case Terrain.HIGH_GRASS:
case Terrain.FURROWED_GRASS:
return Messages.get(Level.class, "high_grass_desc"); return Messages.get(Level.class, "high_grass_desc");
case Terrain.LOCKED_DOOR: case Terrain.LOCKED_DOOR:
return Messages.get(Level.class, "locked_door_desc"); return Messages.get(Level.class, "locked_door_desc");
@@ -237,7 +237,7 @@ public abstract class RegularLevel extends Level {
} }
for (Mob m : mobs){ for (Mob m : mobs){
if (map[m.pos] == Terrain.HIGH_GRASS) { if (map[m.pos] == Terrain.HIGH_GRASS || map[m.pos] == Terrain.FURROWED_GRASS) {
map[m.pos] = Terrain.GRASS; map[m.pos] = Terrain.GRASS;
losBlocking[m.pos] = false; losBlocking[m.pos] = false;
} }
@@ -324,7 +324,7 @@ public abstract class RegularLevel extends Level {
type = Heap.Type.HEAP; type = Heap.Type.HEAP;
} }
int cell = randomDropCell(); int cell = randomDropCell();
if (map[cell] == Terrain.HIGH_GRASS) { if (map[cell] == Terrain.HIGH_GRASS || map[cell] == Terrain.FURROWED_GRASS) {
map[cell] = Terrain.GRASS; map[cell] = Terrain.GRASS;
losBlocking[cell] = false; losBlocking[cell] = false;
} }
@@ -353,7 +353,7 @@ public abstract class RegularLevel extends Level {
for (Item item : itemsToSpawn) { for (Item item : itemsToSpawn) {
int cell = randomDropCell(); int cell = randomDropCell();
drop( item, cell ).type = Heap.Type.HEAP; drop( item, cell ).type = Heap.Type.HEAP;
if (map[cell] == Terrain.HIGH_GRASS) { if (map[cell] == Terrain.HIGH_GRASS || map[cell] == Terrain.FURROWED_GRASS) {
map[cell] = Terrain.GRASS; map[cell] = Terrain.GRASS;
losBlocking[cell] = false; losBlocking[cell] = false;
} }
@@ -362,7 +362,7 @@ public abstract class RegularLevel extends Level {
Item item = Bones.get(); Item item = Bones.get();
if (item != null) { if (item != null) {
int cell = randomDropCell(); int cell = randomDropCell();
if (map[cell] == Terrain.HIGH_GRASS) { if (map[cell] == Terrain.HIGH_GRASS || map[cell] == Terrain.FURROWED_GRASS) {
map[cell] = Terrain.GRASS; map[cell] = Terrain.GRASS;
losBlocking[cell] = false; losBlocking[cell] = false;
} }
@@ -389,7 +389,7 @@ public abstract class RegularLevel extends Level {
GuidePage p = new GuidePage(); GuidePage p = new GuidePage();
p.page(missingPages.get(0)); p.page(missingPages.get(0));
int cell = randomDropCell(); int cell = randomDropCell();
if (map[cell] == Terrain.HIGH_GRASS) { if (map[cell] == Terrain.HIGH_GRASS || map[cell] == Terrain.FURROWED_GRASS) {
map[cell] = Terrain.GRASS; map[cell] = Terrain.GRASS;
losBlocking[cell] = false; losBlocking[cell] = false;
} }
@@ -39,6 +39,7 @@ public class Terrain {
public static final int BARRICADE = 13; public static final int BARRICADE = 13;
public static final int EMPTY_SP = 14; public static final int EMPTY_SP = 14;
public static final int HIGH_GRASS = 15; public static final int HIGH_GRASS = 15;
public static final int FURROWED_GRASS = 30;
public static final int SECRET_DOOR = 16; public static final int SECRET_DOOR = 16;
public static final int SECRET_TRAP = 17; public static final int SECRET_TRAP = 17;
@@ -85,6 +86,7 @@ public class Terrain {
flags[BARRICADE] = FLAMABLE | SOLID | LOS_BLOCKING; flags[BARRICADE] = FLAMABLE | SOLID | LOS_BLOCKING;
flags[EMPTY_SP] = flags[EMPTY]; flags[EMPTY_SP] = flags[EMPTY];
flags[HIGH_GRASS] = PASSABLE | LOS_BLOCKING | FLAMABLE; flags[HIGH_GRASS] = PASSABLE | LOS_BLOCKING | FLAMABLE;
flags[FURROWED_GRASS]= flags[HIGH_GRASS];
flags[SECRET_DOOR] = flags[WALL] | SECRET; flags[SECRET_DOOR] = flags[WALL] | SECRET;
flags[SECRET_TRAP] = flags[EMPTY] | SECRET; flags[SECRET_TRAP] = flags[EMPTY] | SECRET;
@@ -43,53 +43,72 @@ import com.watabou.utils.Random;
public class HighGrass { public class HighGrass {
//prevents items dropped from grass, from trampling that same grass.
//yes this is a bit ugly, oh well.
private static boolean freezeTrample = false;
public static void trample( Level level, int pos, Char ch ) { public static void trample( Level level, int pos, Char ch ) {
if (ch instanceof Hero && ((Hero) ch).heroClass == HeroClass.HUNTRESS){ if (freezeTrample) return;
//Level.set(pos, Terrain.FURROWED_GRASS);
Level.set(pos, Terrain.GRASS); if (level.map[pos] == Terrain.FURROWED_GRASS){
if (ch instanceof Hero && ((Hero) ch).heroClass == HeroClass.HUNTRESS){
//Do nothing
freezeTrample = true;
} else {
Level.set(pos, Terrain.GRASS);
}
} else { } else {