本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas类的典型用法代码示例。如果您正苦于以下问题:Java ToxicGas类的具体用法?Java ToxicGas怎么用?Java ToxicGas使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToxicGas类属于com.shatteredpixel.shatteredpixeldungeon.actors.blobs包,在下文中一共展示了ToxicGas类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: damage
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public void damage( int dmg, Object src ) {
super.damage( dmg, src );
if (src instanceof ToxicGas) {
((ToxicGas)src).clear( pos );
}
}
示例2: activate
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public void activate( Char ch ) {
super.activate( ch );
GameScene.add( Blob.seed( pos, 100, ToxicGas.class ) );
Dungeon.level.drop( new Seed(), pos ).sprite.drop();
if (ch != null) {
Buff.prolong( ch, Roots.class, TICK * 3 );
}
}
示例3: act
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public boolean act() {
GameScene.add(Blob.seed(target.pos, 50, ToxicGas.class));
spend(TICK);
left -= TICK;
if (left <= 0)
detach();
return true;
}
示例4: shatter
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
protected void shatter( int cell ) {
setKnown();
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
ToxicGas gas = Blob.seed( cell, 1000, ToxicGas.class );
Actor.add( gas );
GameScene.add( gas );
}
示例5: damage
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public void damage( int dmg, Object src ) {
super.damage( dmg, src );
if (src instanceof ToxicGas) {
((ToxicGas)src).clear( pos );
}
}
示例6: act
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public boolean act() {
GameScene.add(Blob.seed(target.pos, 50, ToxicGas.class));
spend(TICK);
left -= TICK;
if (left <= 0){
detach();
} else if (left < 5){
BuffIndicator.refreshHero();
}
return true;
}
示例7: shatter
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public void shatter( int cell ) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
GameScene.add( Blob.seed( cell, 1000, ToxicGas.class ) );
}
示例8: switchLevel
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public static void switchLevel( final Level level, int pos ) {
Dungeon.level = level;
Actor.init();
Actor respawner = level.respawner();
if (respawner != null) {
Actor.add( level.respawner() );
}
for (Potion potion : level.fallingPotions){
int cell = level.randomRespawnCell();
while (cell == -1)
cell = level.randomRespawnCell();
if (potion instanceof PotionOfLiquidFlame)
GameScene.add( Blob.seed( cell, 2, Fire.class));
else if (potion instanceof PotionOfToxicGas)
GameScene.add( Blob.seed( cell, 1000, ToxicGas.class ) );
else if (potion instanceof PotionOfParalyticGas)
GameScene.add( Blob.seed( cell, 1000, ParalyticGas.class ) );
else if (potion instanceof PotionOfLevitation)
GameScene.add( Blob.seed( cell, 1000, ConfusionGas.class ) );
}
level.fallingPotions.clear();
hero.pos = pos != -1 ? pos : level.exit;
Light light = hero.buff( Light.class );
hero.viewDistance = light == null ? level.viewDistance : Math.max( Light.DISTANCE, level.viewDistance );
observe();
try {
saveAll();
} catch (IOException e) {
/*This only catches IO errors. Yes, this means things can do wrong, and they can go wrong catastrophically.
But when they do the user will get a nice 'report this issue' dialogue, and I can fix the bug.*/
}
}
示例9: shatter
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
protected void shatter( int cell ) {
PathFinder.buildDistanceMap( cell, BArray.not( Level.losBlocking, null ), DISTANCE );
boolean procd = false;
Blob[] blobs = {
Dungeon.level.blobs.get( ToxicGas.class ),
Dungeon.level.blobs.get( ParalyticGas.class ),
Dungeon.level.blobs.get( ConfusionGas.class ),
Dungeon.level.blobs.get( StenchGas.class )
};
for (int j=0; j < blobs.length; j++) {
Blob blob = blobs[j];
if (blob == null) {
continue;
}
for (int i=0; i < Level.LENGTH; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
int value = blob.cur[i];
if (value > 0) {
blob.cur[i] = 0;
blob.volume -= value;
procd = true;
CellEmitter.get( i ).burst( Speck.factory( Speck.DISCOVER ), 1 );
}
}
}
}
boolean heroAffected = PathFinder.distance[Dungeon.hero.pos] < Integer.MAX_VALUE;
if (procd) {
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
setKnown();
if (heroAffected) {
GLog.p( TXT_FRESHNESS );
}
} else {
super.shatter( cell );
if (heroAffected) {
GLog.i( TXT_FRESHNESS );
setKnown();
}
}
}
示例10: defenseProc
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public int defenseProc(Char enemy, int damage) {
GameScene.add(Blob.seed(pos, 20, ToxicGas.class));
return super.defenseProc(enemy, damage);
}
示例11: act
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public boolean act() {
GameScene.add( Blob.seed( pos, 30, ToxicGas.class ) );
return super.act();
}
示例12: proc
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage) {
int level = Math.max( 0, armor.level );
if (Level.adjacent( attacker.pos, defender.pos ) && Random.Int( level + 5 ) >= 4) {
GameScene.add( Blob.seed( attacker.pos, 20, ToxicGas.class ) );
}
return damage;
}
示例13: proc
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public int proc(Armor armor, Char attacker, Char defender, int damage) {
if ( Random.Int( 8 ) == 0) {
GameScene.add( Blob.seed( defender.pos, 250, ToxicGas.class ) );
}
return damage;
}
示例14: trigger
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
public static void trigger( int pos, Char ch ) {
GameScene.add( Blob.seed( pos, 300 + 20 * Dungeon.depth, ToxicGas.class ) );
}
示例15: activate
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; //导入依赖的package包/类
@Override
public void activate() {
GameScene.add( Blob.seed( pos, 300 + 20 * Dungeon.depth, ToxicGas.class ) );
}