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


Java Roots类代码示例

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


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

示例1: evolve

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
@Override
protected void evolve() {
	
	for (int i=0; i < LENGTH; i++) {
		
		int offv = cur[i] > 0 ? cur[i] - 1 : 0;
		off[i] = offv;
		
		if (offv > 0) {
			
			volume += offv;
			
			Char ch = Actor.findChar( i );
			if (ch != null) {
				Buff.prolong( ch, Roots.class, TICK );
			}
		}
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:20,代码来源:Web.java

示例2: doSpecial

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
@Override
public void doSpecial() {	
	
	for (Mob mob : Dungeon.level.mobs) {
		if (Level.fieldOfView[mob.pos]) {
			Buff.affect( mob, Burning.class ).reignite( mob );
			Buff.prolong( mob, Roots.class, 3 );
		}
	}

       curUser.HP -= (curUser.HP / 3);
	
	curUser.spend( Actor.TICK );
	curUser.sprite.operate( curUser.pos );
	curUser.busy();
	
	curUser.sprite.centerEmitter().start( ElmoParticle.FACTORY, 0.15f, 4 );
	Sample.INSTANCE.play( Assets.SND_READ );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:20,代码来源:MageArmor.java

示例3: execute

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
    super.execute(hero, action);
    if (action.equals(AC_FEED)){
        GameScene.selectItem(itemSelector, mode, inventoryTitle);
    } else if (action.equals(AC_ROOT) && level > 0){

        if (!isEquipped( hero )) GLog.i("You need to equip them to do that.");
        else if (charge == 0)    GLog.i("They have no energy right now.");
        else {
            Buff.prolong(hero, Roots.class, 5);
            Buff.affect(hero, Earthroot.Armor.class).level(charge);
            CellEmitter.bottom(hero.pos).start(EarthParticle.FACTORY, 0.05f, 8);
            Camera.main.shake(1, 0.4f);
            charge = 0;
            updateQuickslot();
        }
    }
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:20,代码来源:SandalsOfNature.java

示例4: evolve

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
@Override
protected void evolve() {

	int cell;

	for (int i = area.left; i < area.right; i++){
		for (int j = area.top; j < area.bottom; j++){
			cell = i + j*Dungeon.level.width();
			off[cell] = cur[cell] > 0 ? cur[cell] - 1 : 0;

			if (off[cell] > 0) {

				volume += off[cell];

				Char ch = Actor.findChar( cell );
				if (ch != null && !ch.immunities().contains(this.getClass())) {
					Buff.prolong( ch, Roots.class, TICK );
				}
			}
		}
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:23,代码来源:Web.java

示例5: doSpecial

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
@Override
public void doSpecial() {
	
	for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
		if (Dungeon.level.heroFOV[mob.pos]) {
			Buff.affect( mob, Burning.class ).reignite( mob );
			Buff.prolong( mob, Roots.class, 3 );
		}
	}

	curUser.HP -= (curUser.HP / 3);
	
	curUser.spend( Actor.TICK );
	curUser.sprite.operate( curUser.pos );
	curUser.busy();
	
	curUser.sprite.centerEmitter().start( ElmoParticle.FACTORY, 0.15f, 4 );
	Sample.INSTANCE.play( Assets.SND_READ );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:20,代码来源:MageArmor.java

示例6: effect

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
public static void effect(Hero hero){
	switch (Random.Int( 5 )) {
		case 0:
			GLog.w( Messages.get(MysteryMeat.class, "hot") );
			Buff.affect( hero, Burning.class ).reignite( hero );
			break;
		case 1:
			GLog.w( Messages.get(MysteryMeat.class, "legs") );
			Buff.prolong( hero, Roots.class, Paralysis.duration( hero ) );
			break;
		case 2:
			GLog.w( Messages.get(MysteryMeat.class, "not_well") );
			Buff.affect( hero, Poison.class ).set( Poison.durationFactor( hero ) * hero.HT / 5 );
			break;
		case 3:
			GLog.w( Messages.get(MysteryMeat.class, "stuffed") );
			Buff.prolong( hero, Slow.class, Slow.duration( hero ) );
			break;
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:21,代码来源:MysteryMeat.java

示例7: execute

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	super.execute(hero, action);

	if (action.equals(AC_FEED)){

		GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt"));

	} else if (action.equals(AC_ROOT) && level() > 0){

		if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
		else if (charge == 0)    GLog.i( Messages.get(this, "no_charge") );
		else {
			Buff.prolong(hero, Roots.class, 5);
			Buff.affect(hero, Earthroot.Armor.class).level(charge);
			CellEmitter.bottom(hero.pos).start(EarthParticle.FACTORY, 0.05f, 8);
			Camera.main.shake(1, 0.4f);
			charge = 0;
			updateQuickslot();
		}
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:23,代码来源:SandalsOfNature.java

示例8: evolve

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
@Override
protected void evolve() {
	super.evolve();
	
	if (volume > 0) {
		
		boolean mapUpdated = false;
		
		for (int i=0; i < LENGTH; i++) {
			if (off[i] > 0) {
				int c = Dungeon.level.map[i];
				if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) {
					
					Level.set( i, cur[i] > 9 ? Terrain.HIGH_GRASS : Terrain.GRASS );
					mapUpdated = true;
					
				} else if (c == Terrain.GRASS && cur[i] > 9) {
					
					Level.set( i, Terrain.HIGH_GRASS );
					mapUpdated = true;
					
				}
				
				Char ch = Actor.findChar( i );
				if (ch != null) {
					Buff.prolong( ch, Roots.class, TICK );
				}
			}
		}
		
		if (mapUpdated) {
			GameScene.updateMap();
			Dungeon.observe();
		}
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:37,代码来源:Regrowth.java

示例9: activate

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的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 );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:13,代码来源:Wandmaker.java

示例10: execute

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的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.w( "Oh it's hot!" );
			Buff.affect( hero, Burning.class ).reignite( hero );
			break;
		case 1:
			GLog.w( "You can't feel your legs!" );
			Buff.prolong( hero, Roots.class, Paralysis.duration( hero ) );
			break;
		case 2:
			GLog.w( "You are not feeling well." );
			Buff.affect( hero, Poison.class ).set( Poison.durationFactor( hero ) * hero.HT / 5 );
			break;
		case 3:
			GLog.w( "You are stuffed." );
			Buff.prolong( hero, Slow.class, Slow.duration( hero ) );
			break;
		}
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:28,代码来源:MysteryMeat.java

示例11: evolve

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
@Override
protected void evolve() {
	super.evolve();
	
	if (volume > 0) {
		int cell;
		for (int i = area.left; i < area.right; i++) {
			for (int j = area.top; j < area.bottom; j++) {
				cell = i + j*Dungeon.level.width();
				if (off[cell] > 0) {
					int c = Dungeon.level.map[cell];
					int c1 = c;
					if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) {
						c1 = (cur[cell] > 9 && Actor.findChar( cell ) == null)
								? Terrain.HIGH_GRASS : Terrain.GRASS;
					} else if (c == Terrain.GRASS && cur[cell] > 9 && Dungeon.level.plants.get(cell) == null && Actor.findChar( cell ) == null ) {
						c1 = Terrain.HIGH_GRASS;
					}

					if (c1 != c) {
						Level.set( cell, c1 );
						GameScene.updateMap( cell );
					}

					Char ch = Actor.findChar( cell );
					if (ch != null
							&& !ch.immunities().contains(this.getClass())
							&& off[cell] > 1) {
						Buff.prolong( ch, Roots.class, TICK );
					}
				}
			}
		}
		Dungeon.observe();
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:37,代码来源:Regrowth.java

示例12: add

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; //导入依赖的package包/类
@Override
public void add( Buff buff ) {

	if (buff(TimekeepersHourglass.timeStasis.class) != null)
		return;

	super.add( buff );
	
	if (sprite != null) {
		if (buff instanceof Burning) {
			GLog.w( "You catch fire!" );
			interrupt();
		} else if (buff instanceof Paralysis) {
			GLog.w( "You are paralysed!" );
			interrupt();
		} else if (buff instanceof Poison) {
			GLog.w( "You are poisoned!" );
			interrupt();
		} else if (buff instanceof Ooze) {
			GLog.w( "Caustic ooze eats your flesh. Wash it away!" );
		} else if (buff instanceof Roots) {
			GLog.w( "You can't move!" );
		} else if (buff instanceof Weakness) {
			GLog.w( "You feel weakened!" );
		} else if (buff instanceof Blindness) {
			GLog.w( "You are blinded!" );
		} else if (buff instanceof Fury) {
			GLog.w( "You become furious!" );
			sprite.showStatus( CharSprite.POSITIVE, "furious" );
		} else if (buff instanceof Charm) {
			GLog.w( "You are charmed!" );
		}  else if (buff instanceof Cripple) {
			GLog.w( "You are crippled!" );
		} else if (buff instanceof Bleeding) {
			GLog.w( "You are bleeding!" );
		} else if (buff instanceof RingOfMight.Might){
               if (((RingOfMight.Might)buff).level > 0) {
                   HT += ((RingOfMight.Might) buff).level * 5;
               }
           } else if (buff instanceof Vertigo) {
               GLog.w("Everything is spinning around you!");
               interrupt();
           }
		
		else if (buff instanceof Light) {
			sprite.add( CharSprite.State.ILLUMINATED );
		}
	}
	
	BuffIndicator.refreshHero();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:52,代码来源:Hero.java

示例13: proc

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

	int level = Math.max( 0, armor.level );
	
	if (Random.Int( 4 ) == 0) {
		
		Buff.prolong( defender, Roots.class, 5 - level / 5 );
		Buff.affect( defender, Earthroot.Armor.class ).level( 5 * (level + 1) );
		CellEmitter.bottom( defender.pos ).start( EarthParticle.FACTORY, 0.05f, 8 );
		Camera.main.shake( 1, 0.4f );
		
	}

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

示例14: proc

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

	int level = Math.max( 0, armor.level() );
	
	if (Random.Int( 4 ) == 0) {
		
		Buff.prolong( defender, Roots.class, 3 );
		Buff.affect( defender, Earthroot.Armor.class ).level( 5 + 2*level );
		CellEmitter.bottom( defender.pos ).start( EarthParticle.FACTORY, 0.05f, 8 );
		Camera.main.shake( 1, 0.4f );
		
	}

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


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