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


Java Drowsy類代碼示例

本文整理匯總了Java中com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy的典型用法代碼示例。如果您正苦於以下問題:Java Drowsy類的具體用法?Java Drowsy怎麽用?Java Drowsy使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Drowsy類屬於com.shatteredpixel.shatteredpixeldungeon.actors.buffs包,在下文中一共展示了Drowsy類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: activate

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; //導入依賴的package包/類
@Override
public void activate( Char ch ) {
    super.activate( ch );

    if (ch != null) {
        if (ch instanceof Mob)
            Buff.affect(ch, MagicalSleep.class);
        else if (ch instanceof Hero){
            GLog.i( "You feel refreshed." );
            Buff.detach( ch, Poison.class );
            Buff.detach( ch, Cripple.class );
            Buff.detach( ch, Weakness.class );
            Buff.detach( ch, Bleeding.class );
            Buff.detach( ch, Drowsy.class );
            Buff.detach( ch, Slow.class );
            Buff.detach( ch, Vertigo.class);
       }
    }
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:20,代碼來源:Dreamfoil.java

示例2: doRead

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; //導入依賴的package包/類
@Override
protected void doRead() {
	
	curUser.sprite.centerEmitter().start( Speck.factory( Speck.NOTE ), 0.3f, 5 );
	Sample.INSTANCE.play( Assets.SND_LULLABY );
	Invisibility.dispel();

	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (Level.fieldOfView[mob.pos]) {
			Buff.affect( mob, Drowsy.class );
               mob.sprite.centerEmitter().start( Speck.factory( Speck.NOTE ), 0.3f, 5 );
		}
	}

       Buff.affect( curUser, Drowsy.class );

	GLog.i( "The scroll utters a soothing melody. You feel very sleepy." );

	setKnown();
	
	curUser.spendAndNext( TIME_TO_READ );
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:23,代碼來源:ScrollOfLullaby.java

示例3: activate

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; //導入依賴的package包/類
@Override
public void activate() {
	Char ch = Actor.findChar(pos);

	if (ch != null) {
		if (ch instanceof Mob)
			Buff.affect(ch, MagicalSleep.class);
		else if (ch instanceof Hero){
			GLog.i( Messages.get(this, "refreshed") );
			Buff.detach( ch, Poison.class );
			Buff.detach( ch, Cripple.class );
			Buff.detach( ch, Weakness.class );
			Buff.detach( ch, Bleeding.class );
			Buff.detach( ch, Drowsy.class );
			Buff.detach( ch, Slow.class );
			Buff.detach( ch, Vertigo.class);
		}
	}
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:20,代碼來源:Dreamfoil.java

示例4: doRead

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; //導入依賴的package包/類
@Override
public void doRead() {
	
	curUser.sprite.centerEmitter().start( Speck.factory( Speck.NOTE ), 0.3f, 5 );
	Sample.INSTANCE.play( Assets.SND_LULLABY );
	Invisibility.dispel();

	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (Dungeon.level.heroFOV[mob.pos]) {
			Buff.affect( mob, Drowsy.class );
			mob.sprite.centerEmitter().start( Speck.factory( Speck.NOTE ), 0.3f, 5 );
		}
	}

	Buff.affect( curUser, Drowsy.class );

	GLog.i( Messages.get(this, "sooth") );

	setKnown();

	readAnimation();
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:23,代碼來源:ScrollOfLullaby.java

示例5: execute

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; //導入依賴的package包/類
@Override
public void execute( Hero hero, String action ) {
	
	super.execute( hero, action );
	
	if (action.equals( AC_EAT )) {
		
		switch (Random.Int( 5 )) {
		case 0:
			GLog.i( "You see your hands turn invisible!" );
			Buff.affect( hero, Invisibility.class, Invisibility.DURATION );
			break;
		case 1:
			GLog.i( "You feel your skin harden!" );
			Buff.affect( hero, Barkskin.class ).level( hero.HT / 4 );
			break;
		case 2:
			GLog.i( "Refreshing!" );
               Buff.detach( hero, Poison.class );
               Buff.detach( hero, Cripple.class );
               Buff.detach( hero, Weakness.class );
               Buff.detach( hero, Bleeding.class );
               Buff.detach( hero, Drowsy.class );
               Buff.detach( hero, Slow.class );
               Buff.detach( hero, Vertigo.class);
			break;
		case 3:
			GLog.i( "You feel better!" );
			if (hero.HP < hero.HT) {
				hero.HP = Math.min( hero.HP + hero.HT / 4, hero.HT );
				hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
			}
			break;
		}
	}
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:37,代碼來源:FrozenCarpaccio.java

示例6: damage

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; //導入依賴的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

示例7: effect

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; //導入依賴的package包/類
public static void effect(Hero hero){
	switch (Random.Int( 5 )) {
		case 0:
			GLog.i( Messages.get(FrozenCarpaccio.class, "invis") );
			Buff.affect( hero, Invisibility.class, Invisibility.DURATION );
			break;
		case 1:
			GLog.i( Messages.get(FrozenCarpaccio.class, "hard") );
			Buff.affect( hero, Barkskin.class ).level( hero.HT / 4 );
			break;
		case 2:
			GLog.i( Messages.get(FrozenCarpaccio.class, "refresh") );
			Buff.detach( hero, Poison.class );
			Buff.detach( hero, Cripple.class );
			Buff.detach( hero, Weakness.class );
			Buff.detach( hero, Bleeding.class );
			Buff.detach( hero, Drowsy.class );
			Buff.detach( hero, Slow.class );
			Buff.detach( hero, Vertigo.class);
			break;
		case 3:
			GLog.i( Messages.get(FrozenCarpaccio.class, "better") );
			if (hero.HP < hero.HT) {
				hero.HP = Math.min( hero.HP + hero.HT / 4, hero.HT );
				hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
			}
			break;
	}
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:30,代碼來源:FrozenCarpaccio.java

示例8: empoweredRead

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; //導入依賴的package包/類
@Override
public void empoweredRead() {
	doRead();
	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (Dungeon.level.heroFOV[mob.pos]) {
			Buff drowsy = mob.buff(Drowsy.class);
			if (drowsy != null) drowsy.act();
		}
	}
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:11,代碼來源:ScrollOfLullaby.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。