• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java Weakness类的典型用法和代码示例

java 1次浏览

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

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

示例1: zap

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
private void zap() {
	spend( TIME_TO_ZAP );
	
	if (hit( this, enemy, true )) {
		if (enemy == Dungeon.hero && Random.Int( 2 ) == 0) {
			Buff.prolong( enemy, Weakness.class, Weakness.duration( enemy ) );
		}
		
		int dmg = Random.Int( 12, 18 );
		enemy.damage( dmg, this );
		
		if (!enemy.isAlive() && enemy == Dungeon.hero) {
			Dungeon.fail( Utils.format( ResultDescriptions.MOB, 
				Utils.indefinite( name ), Dungeon.depth ) );
			GLog.n( TXT_SHADOWBOLT_KILLED, name );
		}
	} else {
		enemy.sprite.showStatus( CharSprite.NEUTRAL,  enemy.defenseVerb() );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:21,
代码来源:Warlock.java

示例2: doRead

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
@Override
protected void doRead() {
	
	new Flare( 6, 32 ).show( curUser.sprite, 2f ) ;
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	boolean procced = uncurse( curUser, curUser.belongings.backpack.items.toArray( new Item[0] ) ); 
	procced = uncurse( curUser, 
		curUser.belongings.weapon, 
		curUser.belongings.armor, 
		curUser.belongings.ring1, 
		curUser.belongings.ring2 ) || procced;
	
	Weakness.detach( curUser, Weakness.class );
	
	if (procced) {
		GLog.p( TXT_PROCCED );			
	} else {		
		GLog.i( TXT_NOT_PROCCED );		
	}
	
	setKnown();
	
	readAnimation();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:27,
代码来源:ScrollOfRemoveCurse.java

示例3: doRead

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
@Override
protected void doRead() {
	
	new Flare( 6, 32 ).show( curUser.sprite, 2f ) ;
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	boolean procced = uncurse( curUser, curUser.belongings.backpack.items.toArray( new Item[0] ) ); 
	procced = uncurse( curUser, 
		curUser.belongings.weapon, 
		curUser.belongings.armor, 
		curUser.belongings.ring1, 
		curUser.belongings.ring2 ) || procced;
	
	Weakness.detach( curUser, Weakness.class );
	
	if (procced) {
		GLog.p( TXT_PROCCED );			
	} else {		
		GLog.i( TXT_NOT_PROCCED );		
	}
	
	setKnown();
	
	curUser.spendAndNext( TIME_TO_READ );
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:27,
代码来源:ScrollOfRemoveCurse.java

示例4: zap

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
@Override
public boolean zap(@NonNull Char enemy) {
	if (super.zap(enemy)) {
		if (getEnemy() == Dungeon.hero && Random.Int(2) == 0) {
			Buff.prolong(getEnemy(), Weakness.class, Weakness.duration(getEnemy()));
		}

		if (!getEnemy().isAlive() && getEnemy() == Dungeon.hero) {
			Dungeon.fail(Utils.format(ResultDescriptions.MOB,
					Utils.indefinite(getName()), Dungeon.depth));
			GLog.n(TXT_SHADOWBOLT_KILLED, getName());
		}
		return true;
	}
	return false;
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:17,
代码来源:Warlock.java

示例5: doRead

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
@Override
protected void doRead() {

	new Flare(6, 32).show(getCurUser().getSprite(), 2f);
	Sample.INSTANCE.play(Assets.SND_READ);
	Invisibility.dispel(getCurUser());

	boolean procced = uncurse(getCurUser().belongings);

	Weakness.detach(getCurUser(), Weakness.class);

	if (procced) {
		GLog.p(TXT_PROCCED);
		getCurUser().getSprite().emitter().start(ShadowParticle.UP, 0.05f, 10);
	} else {
		GLog.i(TXT_NOT_PROCCED);
	}

	setKnown();

	getCurUser().spendAndNext(TIME_TO_READ);
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:23,
代码来源:ScrollOfRemoveCurse.java

示例6: execute

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的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 hardens!" );
			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 );
			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:kurtyu,
项目名称:PixelDungeonTC,
代码行数:34,
代码来源:FrozenCarpaccio.java

示例7: heal

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
public static void heal( Hero hero ) {
	
	hero.HP = hero.HT;
	Buff.detach( hero, Poison.class );
	Buff.detach( hero, Cripple.class );
	Buff.detach( hero, Weakness.class );
	Buff.detach( hero, Bleeding.class );
	
	hero.sprite.emitter().start( Speck.factory( Speck.HEALING ), 0.4f, 4 );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:11,
代码来源:PotionOfHealing.java

示例8: execute

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的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(Game.getVar(R.string.FrozenCarpaccio_Info1));
			Buff.affect( hero, Invisibility.class, Invisibility.DURATION );
			break;
		case 1:
			GLog.i(Game.getVar(R.string.FrozenCarpaccio_Info2));
			Buff.affect( hero, Barkskin.class ).level( hero.ht() / 4 );
			break;
		case 2:
			GLog.i(Game.getVar(R.string.FrozenCarpaccio_Info3));
			Buff.detach( hero, Poison.class );
			Buff.detach( hero, Cripple.class );
			Buff.detach( hero, Weakness.class );
			Buff.detach( hero, Bleeding.class );
			break;
		case 3:
			GLog.i(Game.getVar(R.string.FrozenCarpaccio_Info4));
			if (hero.hp() < hero.ht()) {
				hero.hp(Math.min( hero.hp() + hero.ht() / 4, hero.ht() ));
				hero.getSprite().emitter().burst( Speck.factory( Speck.HEALING ), 1 );
			}
			break;
		}
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:34,
代码来源:FrozenCarpaccio.java

示例9: heal

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
public static void heal( Char ch, float portion ) {

		ch.hp((int) Math.min(ch.ht(),ch.hp()+ch.ht()*portion));
		Buff.detach( ch, Poison.class );
		Buff.detach( ch, Cripple.class );
		Buff.detach( ch, Weakness.class );
		Buff.detach( ch, Bleeding.class );
		
		ch.getSprite().emitter().start( Speck.factory( Speck.HEALING ), 0.4f, 4 );
	}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:11,
代码来源:PotionOfHealing.java

示例10: add

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
@Override
public void add( Buff buff ) {
	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 away it!" );
		} 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 Vertigo) {
			GLog.w( "Everything is spinning around you!" );
			interrupt();
		}
		
		else if (buff instanceof Light) {
			sprite.add( CharSprite.State.ILLUMINATED );
		}
	}
	
	BuffIndicator.refreshHero();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:44,
代码来源:Hero.java

示例11: effectiveSTR

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
public int effectiveSTR() {
	int str = Scrambler.descramble(STR);

	return buff(Weakness.class) != null ? str - 2 : str;
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:6,
代码来源:Hero.java

示例12: add

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Weakness; //导入依赖的package包/类
@Override
public void add(Buff buff) {
	super.add(buff);

	if (!GameScene.isSceneReady()) {
		return;
	}

	if (buff instanceof Burning) {
		GLog.w(Game.getVar(R.string.Hero_StaBurning));
		interrupt();
	} else if (buff instanceof Paralysis) {
		GLog.w(Game.getVar(R.string.Hero_StaParalysis));
		interrupt();
	} else if (buff instanceof Poison) {
		GLog.w(Game.getVar(R.string.Hero_StaPoison));
		interrupt();
	} else if (buff instanceof Ooze) {
		GLog.w(Game.getVar(R.string.Hero_StaOoze));
	} else if (buff instanceof Roots) {
		GLog.w(Game.getVar(R.string.Hero_StaRoots));
	} else if (buff instanceof Weakness) {
		GLog.w(Game.getVar(R.string.Hero_StaWeakness));
	} else if (buff instanceof Blindness) {
		GLog.w(Game.getVar(R.string.Hero_StaBlindness));
	} else if (buff instanceof Fury) {
		GLog.w(Game.getVar(R.string.Hero_StaFury));
		getSprite().showStatus(CharSprite.POSITIVE, Game.getVar(R.string.Hero_StaFurious));
	} else if (buff instanceof Charm) {
		GLog.w(Game.getVar(R.string.Hero_StaCharm));
	} else if (buff instanceof Cripple) {
		GLog.w(Game.getVar(R.string.Hero_StaCripple));
	} else if (buff instanceof Bleeding) {
		GLog.w(Game.getVar(R.string.Hero_StaBleeding));
	} else if (buff instanceof Vertigo) {
		GLog.w(Game.getVar(R.string.Hero_StaVertigo));
		interrupt();
	}

	BuffIndicator.refreshHero();
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:42,
代码来源:Hero.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)