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:
@@ -403,8 +403,11 @@ public abstract class Char extends Actor {
|
||||
if (Dungeon.level.map[pos] == Terrain.OPEN_DOOR) {
|
||||
Door.leave( pos );
|
||||
}
|
||||
|
||||
|
||||
Actor.freeCell(pos);
|
||||
pos = step;
|
||||
Actor.occupyCell( this );
|
||||
|
||||
|
||||
if (flying && Dungeon.level.map[pos] == Terrain.DOOR) {
|
||||
Door.enter( pos );
|
||||
|
||||
@@ -56,8 +56,7 @@ public class WaterOfAwareness extends WellWater {
|
||||
int terr = Dungeon.level.map[i];
|
||||
if ((Terrain.flags[terr] & Terrain.SECRET) != 0) {
|
||||
|
||||
Level.set( i, Terrain.discover( terr ) );
|
||||
GameScene.updateMap( i );
|
||||
Dungeon.level.discover( i );
|
||||
|
||||
if (Dungeon.visible[i]) {
|
||||
GameScene.discoverTile( i, terr );
|
||||
|
||||
@@ -1283,8 +1283,7 @@ public class Hero extends Char {
|
||||
|
||||
visited[i] = true;
|
||||
if ((Terrain.flags[terr] & Terrain.SECRET) != 0) {
|
||||
Level.set( i, Terrain.discover( terr ) );
|
||||
GameScene.updateMap( i );
|
||||
Dungeon.level.discover( i );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1452,9 +1451,7 @@ public class Hero extends Char {
|
||||
|
||||
GameScene.discoverTile( p, oldValue );
|
||||
|
||||
Level.set( p, Terrain.discover( oldValue ) );
|
||||
|
||||
GameScene.updateMap( p );
|
||||
Dungeon.level.discover( p );
|
||||
|
||||
ScrollOfMagicMapping.discover( p );
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMindVision
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFireblast;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfMagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Dagger;
|
||||
@@ -119,6 +120,9 @@ public enum HeroClass {
|
||||
|
||||
if (!Dungeon.isChallenged(Challenges.NO_FOOD))
|
||||
new Food().identify().collect();
|
||||
|
||||
hero.HP = hero.HT = 10000;
|
||||
new WandOfFireblast().identify().upgrade(50).collect();
|
||||
}
|
||||
|
||||
public Badges.Badge masteryBadge() {
|
||||
|
||||
@@ -20,6 +20,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.PoisonTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
@@ -147,8 +148,8 @@ public class Tengu extends Mob {
|
||||
} while (!Level.fieldOfView[trapPos] || !Level.passable[trapPos]);
|
||||
|
||||
if (Dungeon.level.map[trapPos] == Terrain.INACTIVE_TRAP) {
|
||||
Level.set( trapPos, Terrain.POISON_TRAP );
|
||||
GameScene.updateMap( trapPos );
|
||||
Dungeon.level.setTrap( new PoisonTrap().reveal(), trapPos );
|
||||
Level.set( trapPos, Terrain.TRAP );
|
||||
ScrollOfMagicMapping.discover( trapPos );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user