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


Java Cripple类代码示例

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


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

示例1: heroLand

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
public static void heroLand() {
	
	Hero hero = Dungeon.hero;
	
	hero.sprite.burst( hero.sprite.blood(), 10 );
	Camera.main.shake( 4, 0.2f );
	
	Buff.prolong( hero, Cripple.class, Cripple.DURATION );
	hero.damage( Random.IntRange( hero.HT / 3, hero.HT / 2 ), new Hero.Doom() {
		@Override
		public void onDeath() {
			Badges.validateDeathFromFalling();
			
			Dungeon.fail( ResultDescriptions.FALL );
			GLog.n( "You fell to death..." );
		}
	} );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:19,代码来源:Chasm.java

示例2: activate

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
@Override
public void activate( Char ch ) {
	super.activate( ch );
	
	if (ch != null) {
           int len = Random.Int( 5, 10 );
		Buff.prolong( ch, Blindness.class, len );
           Buff.prolong( ch, Cripple.class, len );
		if (ch instanceof Mob) {
			((Mob)ch).state = ((Mob)ch).WANDERING;
			((Mob)ch).beckon( Dungeon.level.randomDestination() );
		}
	}
	
	if (Dungeon.visible[pos]) {
		CellEmitter.get( pos ).burst( Speck.factory( Speck.LIGHT ), 4 );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:19,代码来源:Blindweed.java

示例3: activate

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的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

示例4: heroLand

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
public static void heroLand() {
	
	Hero hero = Dungeon.hero;
	
	hero.sprite.burst( hero.sprite.blood(), 10 );
	Camera.main.shake( 4, 0.2f );

	Dungeon.level.press( hero.pos, hero );
	Buff.prolong( hero, Cripple.class, Cripple.DURATION );

	//The lower the hero's HP, the more bleed and the less upfront damage.
	//Hero has a 50% chance to bleed out at 66% HP, and begins to risk instant-death at 25%
	Buff.affect( hero, Bleeding.class).set( Math.round(hero.HT / (6f + (6f*(hero.HP/(float)hero.HT)))));
	hero.damage( Math.max( hero.HP / 2, Random.NormalIntRange( hero.HP / 2, hero.HT / 4 )), new Hero.Doom() {
		@Override
		public void onDeath() {
			Badges.validateDeathFromFalling();
			
			Dungeon.fail( Chasm.class );
			GLog.n( Messages.get(Chasm.class, "ondeath") );
		}
	} );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:24,代码来源:Chasm.java

示例5: activate

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
@Override
public void activate() {
	
	Char c = Actor.findChar( pos );
	
	if (c != null) {
		int damage = Math.max( 0,  (4 + Dungeon.depth) - c.drRoll() );
		Buff.affect( c, Bleeding.class ).set( damage );
		Buff.prolong( c, Blindness.class, 10f );
		Buff.prolong( c, Cripple.class, 20f );
		
		if (c instanceof Mob) {
			if (((Mob)c).state == ((Mob)c).HUNTING) ((Mob)c).state = ((Mob)c).WANDERING;
			((Mob)c).beckon( Dungeon.level.randomDestination() );
		}
	}
	
	if (Dungeon.level.heroFOV[pos]) {
		GameScene.flash(0xFFFFFF);
		Sample.INSTANCE.play( Assets.SND_BLAST );
	}
	
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:24,代码来源:FlashingTrap.java

示例6: activate

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
@Override
public void activate() {
	Char ch = Actor.findChar(pos);
	
	if (ch != null) {
		int len = Random.Int( 5, 10 );
		Buff.prolong( ch, Blindness.class, len );
		Buff.prolong( ch, Cripple.class, len );
		if (ch instanceof Mob) {
			if (((Mob)ch).state == ((Mob)ch).HUNTING) ((Mob)ch).state = ((Mob)ch).WANDERING;
			((Mob)ch).beckon( Dungeon.level.randomDestination() );
		}
	}
	
	if (Dungeon.level.heroFOV[pos]) {
		CellEmitter.get( pos ).burst( Speck.factory( Speck.LIGHT ), 4 );
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:19,代码来源:Blindweed.java

示例7: activate

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的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

示例8: act

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
@Override
public boolean act() {
	int chargeTarget = 5+(level()*2);
	LockedFloor lock = target.buff(LockedFloor.class);
	if (charge < chargeTarget && !cursed && (lock == null || lock.regenOn())) {
		partialCharge += 1 / (40f - (chargeTarget - charge)*2f);
	} else if (cursed && Random.Int(100) == 0){
		Buff.prolong( target, Cripple.class, 10f);
	}

	if (partialCharge >= 1) {
		partialCharge --;
		charge ++;
	}

	updateQuickslot();

	spend( TICK );

	return true;
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:22,代码来源:EtherealChains.java

示例9: proc

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage) {
	// lvl 0 - 20%
	// lvl 1 - 33%
	// lvl 2 - 43%
	int level = Math.max( 0, weapon.level() );

	if (Random.Int( level + 5 ) >= 4) {

		Buff.prolong( defender, Blindness.class, Random.Float( 1f, 1f + level ) );
		Buff.prolong( defender, Cripple.class, Random.Float( 1f, 1f + level/2f ) );
		defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6 );

	}

	return damage;
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:18,代码来源:Dazzling.java

示例10: steal

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
@Override
protected boolean steal( Hero hero ) {
	if (super.steal( hero )) {
		
		Buff.prolong( enemy, Blindness.class, Random.Int( 5, 12 ) );
           Buff.affect( enemy, Poison.class ).set(Random.Int(5, 7) * Poison.durationFactor(enemy));
           Buff.prolong( enemy, Cripple.class, Cripple.DURATION );
		Dungeon.observe();
		
		return true;
	} else {
		return false;
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:15,代码来源:Bandit.java

示例11: attackProc

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
@Override
public int attackProc( Char enemy, int damage ) {
	if (Random.Int( 2 ) == 0) {
		Buff.prolong( enemy, Cripple.class, Cripple.DURATION );
	}
	
	return damage;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:9,代码来源:Scorpio.java

示例12: trigger

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
public static void trigger( int pos, Char c ) {
	
	if (c != null) {
		int damage = Math.max( 0,  (Dungeon.depth + 3) - Random.IntRange( 0, c.dr() / 2 ) );
		Buff.affect( c, Bleeding.class ).set( damage );
		Buff.prolong( c, Cripple.class, Cripple.DURATION );
		Wound.hit( c );
	} else {
		Wound.hit( pos );
	}
	
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:13,代码来源:GrippingTrap.java

示例13: execute

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的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

示例14: heal

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的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:wolispace,项目名称:soft-pixel-dungeon,代码行数:11,代码来源:PotionOfHealing.java

示例15: steal

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; //导入依赖的package包/类
@Override
protected boolean steal( Hero hero ) {
	if (super.steal( hero )) {
		
		Buff.prolong( hero, Blindness.class, Random.Int( 2, 5 ) );
		Buff.affect( hero, Poison.class ).set(Random.Int(5, 7) * Poison.durationFactor(enemy));
		Buff.prolong( hero, Cripple.class, Random.Int( 3, 8 ) );
		Dungeon.observe();
		
		return true;
	} else {
		return false;
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:15,代码来源:Bandit.java


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