当前位置: 首页>>代码示例>>Java>>正文


Java Chasm类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:22,代码来源:PitfallTrap.java

示例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 );
		}
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:35,代码来源:Level.java

示例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 );
		}
	}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:65,代码来源:Level.java

示例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();
		}
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:61,代码来源:Level.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。