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


Java TimekeepersHourglass类代码示例

本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass的典型用法代码示例。如果您正苦于以下问题:Java TimekeepersHourglass类的具体用法?Java TimekeepersHourglass怎么用?Java TimekeepersHourglass使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TimekeepersHourglass类属于com.shatteredpixel.shatteredpixeldungeon.items.artifacts包,在下文中一共展示了TimekeepersHourglass类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dispel

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
public static void dispel() {
	Invisibility buff = Dungeon.hero.buff( Invisibility.class );
	if (buff != null) {
		buff.detach();
	}
       CloakOfShadows.cloakStealth cloakBuff = Dungeon.hero.buff( CloakOfShadows.cloakStealth.class );
       if (cloakBuff != null) {
           cloakBuff.act();
           cloakBuff.detach();
       }
       //this isn't a form of invisibilty, but it is meant to dispel at the same time as it.
       TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff( TimekeepersHourglass.timeFreeze.class );
       if (timeFreeze != null) {
           timeFreeze.detach();
       }
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:17,代码来源:Invisibility.java

示例2: heroFall

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
public static void heroFall( int pos ) {
	
	jumpConfirmed = false;
			
	Sample.INSTANCE.play( Assets.SND_FALLING );

	Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
	if (buff != null) buff.detach();

       for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] ))
           if (mob instanceof DriedRose.GhostHero) mob.destroy();
	
	if (Dungeon.hero.isAlive()) {
		Dungeon.hero.interrupt();
		InterlevelScene.mode = InterlevelScene.Mode.FALL;
		if (Dungeon.level instanceof RegularLevel) {
			Room room = ((RegularLevel)Dungeon.level).room( pos );
			InterlevelScene.fallIntoPit = room != null && room.type == Room.Type.WEAK_FLOOR;
		} else {
			InterlevelScene.fallIntoPit = false;
		}
		Game.switchScene( InterlevelScene.class );
	} else {
		Dungeon.hero.sprite.visible = false;
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:27,代码来源:Chasm.java

示例3: actDescend

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
private boolean actDescend( HeroAction.Descend action ) {
	int stairs = action.dst;
	if (pos == stairs && pos == Dungeon.level.exit) {
		
		curAction = null;

		Buff buff = buff(TimekeepersHourglass.timeFreeze.class);
		if (buff != null) buff.detach();
		
		InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
		Game.switchScene( InterlevelScene.class );

		return false;

	} else if (getCloser( stairs )) {

		return true;

	} else {
		ready();
		return false;
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:24,代码来源:Hero.java

示例4: add

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
@Override
public void add( Buff buff ) {

	if (buff(TimekeepersHourglass.timeStasis.class) != null)
		return;

	super.add( buff );

	if (sprite != null) {
		String msg = buff.heroMessage();
		if (msg != null){
			GLog.w(msg);
		}

		if (buff instanceof Paralysis || buff instanceof Vertigo) {
			interrupt();
		}

	}
	
	BuffIndicator.refreshHero();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:23,代码来源:Hero.java

示例5: heroFall

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
public static void heroFall( int pos ) {
	
	jumpConfirmed = false;
			
	Sample.INSTANCE.play( Assets.SND_FALLING );

	Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
	if (buff != null) buff.detach();
	
	if (Dungeon.hero.isAlive()) {
		Dungeon.hero.interrupt();
		InterlevelScene.mode = InterlevelScene.Mode.FALL;
		if (Dungeon.level instanceof RegularLevel) {
			Room room = ((RegularLevel)Dungeon.level).room( pos );
			InterlevelScene.fallIntoPit = room != null && room instanceof WeakFloorRoom;
		} else {
			InterlevelScene.fallIntoPit = false;
		}
		Game.switchScene( InterlevelScene.class );
	} else {
		Dungeon.hero.sprite.visible = false;
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:24,代码来源:Chasm.java

示例6: spend

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
@Override
public void spend( float time ) {
	TimekeepersHourglass.timeFreeze buff = buff(TimekeepersHourglass.timeFreeze.class);
	if (buff != null){
		buff.processTime(time);
	} else {
		super.spend(time);
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:10,代码来源:Hero.java

示例7: actAscend

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
private boolean actAscend( HeroAction.Ascend action ) {
	int stairs = action.dst;
	if (pos == stairs && pos == Dungeon.level.entrance) {
		
		if (Dungeon.depth == 1) {
			
			if (belongings.getItem( Amulet.class ) == null) {
				GameScene.show( new WndMessage( Messages.get(this, "leave") ) );
				ready();
			} else {
				Dungeon.win( Amulet.class );
				Dungeon.deleteGame( Dungeon.hero.heroClass, true );
				Game.switchScene( SurfaceScene.class );
			}
			
		} else {
			
			curAction = null;

			Buff buff = buff(TimekeepersHourglass.timeFreeze.class);
			if (buff != null) buff.detach();

			InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
			Game.switchScene( InterlevelScene.class );
		}

		return false;

	} else if (getCloser( stairs )) {

		return true;

	} else {
		ready();
		return false;
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:38,代码来源:Hero.java

示例8: damage

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
@Override
public void damage( int dmg, Object src ) {
	if (buff(TimekeepersHourglass.timeStasis.class) != null)
		return;

	if (!(src instanceof Hunger || src instanceof Viscosity.DeferedDamage) && damageInterrupt) {
		interrupt();
		resting = false;
	}

	if (this.buff(Drowsy.class) != null){
		Buff.detach(this, Drowsy.class);
		GLog.w( Messages.get(this, "pain_resist") );
	}

	CapeOfThorns.Thorns thorns = buff( CapeOfThorns.Thorns.class );
	if (thorns != null) {
		dmg = thorns.proc(dmg, (src instanceof Char ? (Char)src : null),  this);
	}

	dmg = (int)Math.ceil(dmg * RingOfTenacity.damageMultiplier( this ));

	//TODO improve this when I have proper damage source logic
	if (belongings.armor != null && belongings.armor.hasGlyph(AntiMagic.class)
			&& RingOfElements.FULL.contains(src.getClass())){
		dmg -= Random.NormalIntRange(belongings.armor.DRMin(), belongings.armor.DRMax())/3;
	}

	if (subClass == HeroSubClass.BERSERKER && berserk == null){
		berserk = Buff.affect(this, Berserk.class);
	}

	super.damage( dmg, src );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:35,代码来源:Hero.java

示例9: dispel

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
public static void dispel() {
	Invisibility buff = Dungeon.hero.buff( Invisibility.class );
	if (buff != null) {
		buff.detach();
	}
	CloakOfShadows.cloakStealth cloakBuff = Dungeon.hero.buff( CloakOfShadows.cloakStealth.class );
	if (cloakBuff != null) {
		cloakBuff.dispel();
	}
	//this isn't a form of invisibilty, but it is meant to dispel at the same time as it.
	TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff( TimekeepersHourglass.timeFreeze.class );
	if (timeFreeze != null) {
		timeFreeze.detach();
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:16,代码来源:Invisibility.java

示例10: spend

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
@Override
public void spend( float time ) {
    TimekeepersHourglass.timeFreeze buff = buff(TimekeepersHourglass.timeFreeze.class);
    if (!(buff != null && buff.processTime(time)))
        super.spend( time );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:7,代码来源:Hero.java

示例11: actPickUp

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
private boolean actPickUp( HeroAction.PickUp action ) {
	int dst = action.dst;
	if (pos == dst) {
		
		Heap heap = Dungeon.level.heaps.get( pos );
		if (heap != null) {				
			Item item = heap.pickUp();
			if (item.doPickUp( this )) {
				
				if (item instanceof Dewdrop
                           || item instanceof TimekeepersHourglass.sandBag
                           || item instanceof DriedRose.Petal) {
					
				} else {

					if ((item instanceof ScrollOfUpgrade && ((ScrollOfUpgrade)item).isKnown()) ||
						(item instanceof PotionOfStrength && ((PotionOfStrength)item).isKnown())) {
						GLog.p( TXT_YOU_NOW_HAVE, item.name() );
					} else {
						GLog.i( TXT_YOU_NOW_HAVE, item.name() );
					}

                       //Alright, if anyone complains about not knowing the vial doesn't revive
                       //after this... I'm done, I'm just done.
                       if (item instanceof DewVial) {
                           GLog.w("Its revival power seems to have faded.");
                       }
				}
				
				if (!heap.isEmpty()) {
					GLog.i( TXT_SOMETHING_ELSE );
				}
				curAction = null;
			} else {
				Dungeon.level.drop( item, pos ).sprite.drop();
				ready();
			}
		} else {
			ready();
           }

           return false;

       } else if (getCloser( dst )) {

           return true;

       } else {
           ready();
           return false;
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:53,代码来源:Hero.java

示例12: add

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
@Override
public void add( Buff buff ) {

	if (buff(TimekeepersHourglass.timeStasis.class) != null)
		return;

	super.add( buff );
	
	if (sprite != null) {
		if (buff instanceof Burning) {
			GLog.w( "You catch fire!" );
			interrupt();
		} else if (buff instanceof Paralysis) {
			GLog.w( "You are paralysed!" );
			interrupt();
		} else if (buff instanceof Poison) {
			GLog.w( "You are poisoned!" );
			interrupt();
		} else if (buff instanceof Ooze) {
			GLog.w( "Caustic ooze eats your flesh. Wash it away!" );
		} else if (buff instanceof Roots) {
			GLog.w( "You can't move!" );
		} else if (buff instanceof Weakness) {
			GLog.w( "You feel weakened!" );
		} else if (buff instanceof Blindness) {
			GLog.w( "You are blinded!" );
		} else if (buff instanceof Fury) {
			GLog.w( "You become furious!" );
			sprite.showStatus( CharSprite.POSITIVE, "furious" );
		} else if (buff instanceof Charm) {
			GLog.w( "You are charmed!" );
		}  else if (buff instanceof Cripple) {
			GLog.w( "You are crippled!" );
		} else if (buff instanceof Bleeding) {
			GLog.w( "You are bleeding!" );
		} else if (buff instanceof RingOfMight.Might){
               if (((RingOfMight.Might)buff).level > 0) {
                   HT += ((RingOfMight.Might) buff).level * 5;
               }
           } else if (buff instanceof Vertigo) {
               GLog.w("Everything is spinning around you!");
               interrupt();
           }
		
		else if (buff instanceof Light) {
			sprite.add( CharSprite.State.ILLUMINATED );
		}
	}
	
	BuffIndicator.refreshHero();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:52,代码来源:Hero.java

示例13: updateSpriteState

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
@Override
public void updateSpriteState() {
    super.updateSpriteState();
    if (Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class) != null)
        sprite.add( CharSprite.State.PARALYSED );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:7,代码来源:Mob.java

示例14: execute

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	
	if (action == AC_SET || action == AC_RETURN) {
		
		if (Dungeon.bossLevel()) {
			hero.spend( LloydsBeacon.TIME_TO_USE );
			GLog.w( TXT_PREVENTING );
			return;
		}
		
		for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
			if (Actor.findChar( hero.pos + Level.NEIGHBOURS8[i] ) != null) {
				GLog.w( TXT_CREATURES );
				return;
			}
		}
	}
	
	if (action == AC_SET) {
		
		returnDepth = Dungeon.depth;
		returnPos = hero.pos;
		
		hero.spend( LloydsBeacon.TIME_TO_USE );
		hero.busy();
		
		hero.sprite.operate( hero.pos );
		Sample.INSTANCE.play( Assets.SND_BEACON );
		
		GLog.i( TXT_RETURN );
		
	} else if (action == AC_RETURN) {
		
		if (returnDepth == Dungeon.depth) {
			reset();
			WandOfBlink.appear( hero, returnPos );
			Dungeon.level.press( returnPos, hero );
			Dungeon.observe();
		} else {

			Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
			if (buff != null) buff.detach();

               for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] ))
                   if (mob instanceof DriedRose.GhostHero) mob.destroy();

			InterlevelScene.mode = InterlevelScene.Mode.RETURN;
			InterlevelScene.returnDepth = returnDepth;
			InterlevelScene.returnPos = returnPos;
			reset();
			Game.switchScene( InterlevelScene.class );
		}
		
		
	} else {
		
		super.execute( hero, action );
		
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:62,代码来源:LloydsBeacon.java

示例15: actPickUp

import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; //导入依赖的package包/类
private boolean actPickUp( HeroAction.PickUp action ) {
	int dst = action.dst;
	if (pos == dst) {
		
		Heap heap = Dungeon.level.heaps.get( pos );
		if (heap != null) {
			Item item = heap.peek();
			if (item.doPickUp( this )) {
				heap.pickUp();

				if (item instanceof Dewdrop
						|| item instanceof TimekeepersHourglass.sandBag
						|| item instanceof DriedRose.Petal
						|| item instanceof Key) {
					//Do Nothing
				} else {

					boolean important =
							((item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion) && ((Scroll)item).isKnown()) ||
							((item instanceof PotionOfStrength || item instanceof PotionOfMight) && ((Potion)item).isKnown());
					if (important) {
						GLog.p( Messages.get(this, "you_now_have", item.name()) );
					} else {
						GLog.i( Messages.get(this, "you_now_have", item.name()) );
					}
				}
				
				curAction = null;
			} else {
				heap.sprite.drop();
				ready();
			}
		} else {
			ready();
		}

		return false;

	} else if (getCloser( dst )) {

		return true;

	} else {
		ready();
		return false;
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:48,代码来源:Hero.java


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