本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm类的典型用法代码示例。如果您正苦于以下问题:Java Chasm类的具体用法?Java Chasm怎么用?Java Chasm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Chasm类属于com.shatteredpixel.shatteredpixeldungeon.levels.features包,在下文中一共展示了Chasm类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; //导入依赖的package包/类
@Override
public void activate() {
Heap heap = Dungeon.level.heaps.get( pos );
if (heap != null){
for (Item item : heap.items){
Dungeon.dropToChasm(item);
}
heap.sprite.kill();
GameScene.discard(heap);
Dungeon.level.heaps.remove( pos );
}
Char ch = Actor.findChar( pos );
if (ch == Dungeon.hero){
Chasm.heroFall( pos );
} else if (ch != null){
Chasm.mobFall((Mob)ch);
}
}
示例2: mobPress
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; //导入依赖的package包/类
public void mobPress( Mob mob ) {
int cell = mob.pos;
if (pit[cell] && !mob.flying) {
Chasm.mobFall( mob );
return;
}
Trap trap = null;
switch (map[cell]) {
case Terrain.TRAP:
trap = traps.get( cell );
break;
case Terrain.DOOR:
Door.enter( cell );
break;
}
if (trap != null) {
trap.trigger();
}
Plant plant = plants.get( cell );
if (plant != null) {
plant.trigger();
}
if ( map[cell] == Terrain.HIGH_GRASS){
HighGrass.trample( this, cell, mob );
}
}
示例3: mobPress
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; //导入依赖的package包/类
public void mobPress( Mob mob ) {
int cell = mob.pos;
if (pit[cell] && !mob.flying) {
Chasm.mobFall( mob );
return;
}
boolean trap = true;
switch (map[cell]) {
case Terrain.TOXIC_TRAP:
ToxicTrap.trigger( cell, mob );
break;
case Terrain.FIRE_TRAP:
FireTrap.trigger( cell, mob );
break;
case Terrain.PARALYTIC_TRAP:
ParalyticTrap.trigger( cell, mob );
break;
case Terrain.POISON_TRAP:
PoisonTrap.trigger( cell, mob );
break;
case Terrain.ALARM_TRAP:
AlarmTrap.trigger( cell, mob );
break;
case Terrain.LIGHTNING_TRAP:
LightningTrap.trigger( cell, mob );
break;
case Terrain.GRIPPING_TRAP:
GrippingTrap.trigger( cell, mob );
break;
case Terrain.SUMMONING_TRAP:
SummoningTrap.trigger( cell, mob );
break;
case Terrain.DOOR:
Door.enter( cell );
default:
trap = false;
}
if (trap) {
if (Dungeon.visible[cell]) {
Sample.INSTANCE.play( Assets.SND_TRAP );
}
set( cell, Terrain.INACTIVE_TRAP );
GameScene.updateMap( cell );
}
Plant plant = plants.get( cell );
if (plant != null) {
plant.activate( mob );
}
}
示例4: press
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; //导入依赖的package包/类
public void press( int cell, Char ch ) {
if (ch != null && pit[cell] && !ch.flying) {
if (ch == Dungeon.hero) {
Chasm.heroFall(cell);
} else if (ch instanceof Mob) {
Chasm.mobFall( (Mob)ch );
}
return;
}
Trap trap = null;
switch (map[cell]) {
case Terrain.SECRET_TRAP:
GLog.i( Messages.get(Level.class, "hidden_plate") );
case Terrain.TRAP:
trap = traps.get( cell );
break;
case Terrain.HIGH_GRASS:
HighGrass.trample( this, cell, ch );
break;
case Terrain.WELL:
WellWater.affectCell( cell );
break;
case Terrain.DOOR:
Door.enter( cell );
break;
}
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
if (trap != null) {
if (timeFreeze == null) {
if (ch == Dungeon.hero)
Dungeon.hero.interrupt();
trap.trigger();
} else {
Sample.INSTANCE.play(Assets.SND_TRAP);
discover(cell);
timeFreeze.setDelayedPress(cell);
}
}
Plant plant = plants.get( cell );
if (plant != null) {
plant.trigger();
}
}