當前位置: 首頁>>代碼示例>>Java>>正文


Java Chasm.mobFall方法代碼示例

本文整理匯總了Java中com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm.mobFall方法的典型用法代碼示例。如果您正苦於以下問題:Java Chasm.mobFall方法的具體用法?Java Chasm.mobFall怎麽用?Java Chasm.mobFall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm的用法示例。


在下文中一共展示了Chasm.mobFall方法的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.mobFall方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。