v0.3.0c: trap refactor pt2, traps completely changed to work based on instantiable trap objects instead of terrain types

This makes the trap system far more extendable.
This commit is contained in:
Evan Debenham
2015-06-03 20:40:58 -04:00
parent 7e79a10501
commit 85a907d14e
25 changed files with 336 additions and 285 deletions
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.PoisonTrap;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.watabou.noosa.Scene;
import com.watabou.utils.Bundle;
@@ -204,13 +205,14 @@ public class PrisonBossLevel extends RegularLevel {
int trapPos = Random.Int( LENGTH );
if (map[trapPos] == Terrain.EMPTY) {
map[trapPos] = Terrain.POISON_TRAP;
map[trapPos] = Terrain.TRAP;
setTrap( new PoisonTrap().reveal(), trapPos );
}
}
}
@Override
protected void decorate() {
protected void decorate() {
for (int i=WIDTH + 1; i < LENGTH - WIDTH - 1; i++) {
if (map[i] == Terrain.EMPTY) {