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