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