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


Java Char.buff方法代码示例

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


在下文中一共展示了Char.buff方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attackProc

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
@Override
public int attackProc( Char enemy, int damage ) {
    //The gnoll's attacks get more severe the more the player lets it hit them
    int effect = Random.Int(4)+combo;

    if (effect > 2) {

        if (effect >=6 && enemy.buff(Burning.class) == null){

            if (Level.flamable[enemy.pos])
                GameScene.add( Blob.seed( enemy.pos, 4, Fire.class ) );
            Buff.affect( enemy, Burning.class ).reignite( enemy );

        } else
            Buff.affect( enemy, Poison.class).set((effect-2) * Poison.durationFactor(enemy));

    }
    return damage;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:20,代码来源:Ghost.java

示例2: findPath

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
public static int findPath( Char ch, int from, int to, boolean pass[], boolean[] visible ) {
	
	if (Level.adjacent( from, to )) {
		return Actor.findChar( to ) == null && (pass[to] || Level.avoid[to]) ? to : -1;
	}
	
	if (ch.flying || ch.buff( Amok.class ) != null) {
		BArray.or( pass, Level.avoid, passable );
	} else {
		System.arraycopy( pass, 0, passable, 0, Level.LENGTH );
	}
	
	for (Actor actor : Actor.all()) {
		if (actor instanceof Char) {
			int pos = ((Char)actor).pos;
			if (visible[pos]) {
				passable[pos] = false;
			}
		}
	}
	
	return PathFinder.getStep( from, to, passable );
	
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:25,代码来源:Dungeon.java

示例3: proc

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage ) {

	if (damage == 0) {
		return 0;
	}
	
	int level = Math.max( 0, armor.level );
	
	if (Random.Int( level + 7 ) >= 6) {
		
		DeferedDamage debuff = defender.buff( DeferedDamage.class );
		if (debuff == null) {
			debuff = new DeferedDamage();
			debuff.attachTo( defender );
		}
		debuff.prolong( damage );
		
		defender.sprite.showStatus( CharSprite.WARNING, "deferred %d", damage );
		
		return 0;
		
	} else {
		return damage;
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:27,代码来源:Viscosity.java

示例4: attachTo

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
@Override
public boolean attachTo(Char target) {
    spend(charge);
    ((Hero)target).spendAndNext(charge);

    //shouldn't punish the player for going into stasis frequently
    Hunger hunger = target.buff(Hunger.class);
    if (hunger != null && !hunger.isStarving())
        hunger.satisfy(charge);

    charge = 0;

    target.invisible++;

    updateQuickslot();

    Dungeon.observe();

    return super.attachTo(target);
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:21,代码来源:TimekeepersHourglass.java

示例5: affect

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
public static<T extends Buff> T affect( Char target, Class<T> buffClass ) {
	T buff = target.buff( buffClass );
	if (buff != null) {
		return buff;
	} else {
		try {
			buff = buffClass.newInstance();
			buff.attachTo( target );
			return buff;
		} catch (Exception e) {
			return null;
		}
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:15,代码来源:Buff.java

示例6: cast

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
public void cast( final Hero user, int dst ) {
	
	final int cell = Ballistica.cast( user.pos, dst, false, true );
	user.sprite.zap( cell );
	user.busy();
	
	Char enemy = Actor.findChar( cell );
	QuickSlotButton.target(enemy);
	
	float delay = TIME_TO_THROW;
	if (this instanceof MissileWeapon) {

		// FIXME
		delay *= ((MissileWeapon)this).speedFactor( user );
		if (enemy != null && enemy.buff( SnipersMark.class ) != null) {
			delay *= 0.5f;
		}
	}
	final float finalDelay = delay;
	
	((MissileSprite)user.sprite.parent.recycle( MissileSprite.class )).
		reset( user.pos, cell, this, new Callback() {			
			@Override
			public void call() {
				Item.this.detach( user.belongings.backpack ).onThrow( cell );
				user.spendAndNext( finalDelay );
			}
		} );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:30,代码来源:Item.java

示例7: duration

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
public static float duration( Char ch ) {
	Resistance r = ch.buff( Resistance.class );
	return r != null ? r.durationFactor() * DURATION : DURATION;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:5,代码来源:Weakness.java

示例8: durationFactor

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
public static float durationFactor( Char ch ) {
	Resistance r = ch.buff( Resistance.class );
	return r != null ? r.durationFactor() : 1;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:5,代码来源:Poison.java

示例9: duration

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
public static float duration( Char ch ) {
    Resistance r = ch.buff( Resistance.class );
    return r != null ? r.durationFactor() * DURATION : DURATION;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:5,代码来源:Vertigo.java

示例10: recover

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
public static void recover( Char target ) {
	Terror terror = target.buff( Terror.class );
	if (terror != null && terror.cooldown() < DURATION) {
		target.remove( terror );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:7,代码来源:Terror.java

示例11: proc

import com.shatteredpixel.shatteredpixeldungeon.actors.Char; //导入方法依赖的package包/类
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage) {

	int level = Math.max( 0, armor.level );
	if (Random.Int( level / 2 + 5 ) >= 4) {
		
		int healing = Math.min( defender.HT - defender.HP, Random.Int( 1, defender.HT / 5 ) );

		if (healing > 0) {
			
			Hunger hunger = defender.buff( Hunger.class );
			
			if (hunger != null && !hunger.isStarving()) {
				
				hunger.satisfy( -Hunger.STARVING / 10 );
				BuffIndicator.refreshHero();
				
				defender.HP += healing;
				defender.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
				defender.sprite.showStatus( CharSprite.POSITIVE, Integer.toString( healing ) );
			}
		}

	}
	
	return damage;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:28,代码来源:Metabolism.java


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