本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.effects.Splash类的典型用法代码示例。如果您正苦于以下问题:Java Splash类的具体用法?Java Splash怎么用?Java Splash使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Splash类属于com.shatteredpixel.shatteredpixeldungeon.effects包,在下文中一共展示了Splash类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: proc
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage) {
// lvl 0 - 33%
// lvl 1 - 50%
// lvl 2 - 60%
int level = Math.max( 0, weapon.level() );
if (Random.Int( level + 3 ) >= 2) {
Buff.affect(defender, Bleeding.class).set(damage/4);
Splash.at( defender.sprite.center(), -PointF.PI / 2, PointF.PI / 6,
defender.sprite.blood(), 10 );
}
return damage;
}
示例2: proc
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的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, Chill.class, Random.Float( 2f, 3f ) );
Splash.at( defender.sprite.center(), 0xFFB2D6FF, 5);
}
return damage;
}
示例3: splash
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
protected void splash( int cell ) {
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
if (fire != null)
fire.clear( cell );
final int color = ItemSprite.pick( image, 8, 10 );
Char ch = Actor.findChar(cell);
if (ch != null) {
Buff.detach(ch, Burning.class);
Buff.detach(ch, Ooze.class);
Splash.at( ch.sprite.center(), color, 5 );
} else {
Splash.at( cell, color, 5 );
}
}
示例4: bloodBurstA
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
public void bloodBurstA( PointF from, int damage ) {
if (visible) {
PointF c = center();
int n = (int)Math.min( 9 * Math.sqrt( (double)damage / ch.HT ), 9 );
Splash.at( c, PointF.angle( from, c ), 3.1415926f / 2, blood(), n );
}
}
示例5: act
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
@Override
public boolean act() {
if (target.isAlive()) {
if ((level = Random.Int( level / 2, level )) > 0) {
target.damage( level, this );
if (target.sprite.visible) {
Splash.at( target.sprite.center(), -PointF.PI / 2, PointF.PI / 6,
target.sprite.blood(), Math.min( 10 * level / target.HT, 10 ) );
}
if (target == Dungeon.hero && !target.isAlive()) {
Dungeon.fail( ResultDescriptions.BLEEDING );
GLog.n( "You bled to death..." );
}
spend( TICK );
} else {
detach();
}
} else {
detach();
}
return true;
}
示例6: act
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
@Override
public boolean act() {
if (target.isAlive()) {
if ((level = Random.NormalIntRange( level / 2, level )) > 0) {
target.damage( level, this );
if (target.sprite.visible) {
Splash.at( target.sprite.center(), -PointF.PI / 2, PointF.PI / 6,
target.sprite.blood(), Math.min( 10 * level / target.HT, 10 ) );
}
if (target == Dungeon.hero && !target.isAlive()) {
Dungeon.fail( getClass() );
GLog.n( Messages.get(this, "ondeath") );
}
spend( TICK );
} else {
detach();
}
} else {
detach();
}
return true;
}
示例7: activate
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
@Override
public void activate() {
if (Dungeon.level.heroFOV[ pos ]){
Splash.at( pos, 0xFFB2D6FF, 5);
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
for( int i : PathFinder.NEIGHBOURS9) {
if (!Dungeon.level.solid[pos + i]) {
GameScene.add(Blob.seed(pos + i, 10, Freezing.class));
}
}
}
示例8: activate
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
@Override
public void activate() {
Char ch = Actor.findChar( pos );
if (ch != null){
Buff.affect(ch, Ooze.class);
Splash.at( pos, 0x000000, 5);
}
}
示例9: activate
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
@Override
public void activate() {
if (Dungeon.level.heroFOV[ pos ]){
Splash.at( pos, 0xFFB2D6FF, 5);
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.solid, null ), 2 );
for (int i = 0; i < PathFinder.distance.length; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
GameScene.add(Blob.seed(i, 20, Freezing.class));
}
}
}
示例10: proc
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
@Override
public int proc(Armor armor, Char attacker, Char defender, int damage) {
if (Random.Int(10) == 0){
int pos = defender.pos;
for (int i : PathFinder.NEIGHBOURS9){
Splash.at(pos+i, 0x000000, 5);
if (Actor.findChar(pos+i) != null)
Buff.affect(Actor.findChar(pos+i), Ooze.class);
}
}
return damage;
}
示例11: die
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
@Override
public void die() {
super.die();
Splash.at( center(), blood(), 12 );
}
示例12: burst
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
public void burst( final int color, int n ) {
if (visible) {
Splash.at( center(), color, n );
}
}
示例13: die
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
@Override
public void die() {
Splash.at( center(), blood(), 10 );
super.die();
}
示例14: splash
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
protected void splash( int cell ) {
final int color = ItemSprite.pick( image, 8, 10 );
Splash.at( cell, color, 5 );
}
示例15: shatter
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; //导入依赖的package包/类
public Item shatter( Char owner, int pos ) {
if (Dungeon.level.heroFOV[pos]) {
Sample.INSTANCE.play( Assets.SND_SHATTER );
Splash.at( pos, 0xffd500, 5 );
}
int newPos = pos;
if (Actor.findChar( pos ) != null) {
ArrayList<Integer> candidates = new ArrayList<Integer>();
boolean[] passable = Dungeon.level.passable;
for (int n : PathFinder.NEIGHBOURS4) {
int c = pos + n;
if (passable[c] && Actor.findChar( c ) == null) {
candidates.add( c );
}
}
newPos = candidates.size() > 0 ? Random.element( candidates ) : -1;
}
if (newPos != -1) {
Bee bee = new Bee();
bee.spawn( Dungeon.depth );
bee.setPotInfo( pos, owner );
bee.HP = bee.HT;
bee.pos = newPos;
GameScene.add( bee );
Actor.addDelayed( new Pushing( bee, pos, newPos ), -1f );
bee.sprite.alpha( 0 );
bee.sprite.parent.add( new AlphaTweener( bee.sprite, 1, 0.15f ) );
Sample.INSTANCE.play( Assets.SND_BEE );
return new ShatteredPot().setBee( bee );
} else {
return this;
}
}