本文整理汇总了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();
}
}
示例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;
}
}
示例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;
}
}
示例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();
}
示例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;
}
}
示例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);
}
}
示例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;
}
}
示例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 );
}
示例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();
}
}
示例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 );
}
示例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;
}
}
示例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();
}
示例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 );
}
示例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 );
}
}
示例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;
}
}