• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java Vertigo类的典型用法和代码示例

java 1次浏览

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

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

示例1: move

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
public void move( int step ) {
	
	if (Level.adjacent( step, pos ) && buff( Vertigo.class ) != null) {
		step = pos + Level.NEIGHBOURS8[Random.Int( 8 )];
		if (!(Level.passable[step] || Level.avoid[step]) || Actor.findChar( step ) != null) {
			return;
		}
	}
	
	if (Dungeon.level.map[pos] == Terrain.OPEN_DOOR) {
		Door.leave( pos );
	}
	
	pos = step;
	
	if (flying && Dungeon.level.map[pos] == Terrain.DOOR) {
		Door.enter( pos );
	}
	
	if (this != Dungeon.hero) {
		sprite.visible = Dungeon.visible[pos];
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:24,
代码来源:Char.java

示例2: proc

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
public boolean proc( Weapon weapon, Char attacker, Char defender, int damage ) {
	// lvl 0 - 20%
	// lvl 1 - 33%
	// lvl 2 - 43%
	int level = Math.max( 0, weapon.effectiveLevel() );
	
	if (Random.Int( level + 5 ) >= 4) {
		
		if (defender == Dungeon.hero) {
			Buff.affect( defender, Vertigo.class, Vertigo.duration( defender ) );
		} else {
			Buff.affect( defender, Terror.class, Terror.DURATION ).object = attacker.id();
		}
		
		return true;
	} else {
		return false;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:21,
代码来源:Horror.java

示例3: onZap

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
protected void onZap( int cell ) {
	Char ch = Actor.findChar( cell );
	if (ch != null) {
		
		if (ch == Dungeon.hero) {
			Buff.affect( ch, Vertigo.class, Vertigo.duration( ch ) );
		} else {
			Buff.affect( ch, Amok.class, 3f + power() );
		}

	} else {
		
		GLog.i( "nothing happened" );
		
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:18,
代码来源:WandOfAmok.java

示例4: proc

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
public boolean 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) {
		
		if (defender == Dungeon.hero) {
			Buff.affect( defender, Vertigo.class, Vertigo.duration( defender ) );
		} else {
			Buff.affect( defender, Terror.class, Terror.DURATION ).object = attacker.id();
		}
		
		return true;
	} else {
		return false;
	}
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:21,
代码来源:Horror.java

示例5: onZap

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
protected void onZap( int cell ) {
	Char ch = Actor.findChar( cell );
	if (ch != null) {
		
		if (ch == Dungeon.hero) {
			Buff.affect( ch, Vertigo.class, Vertigo.duration( ch ) );
		} else {
			Buff.affect( ch, Amok.class, 3f + level() );
		}

	} else {
		
		GLog.i( "nothing happened" );
		
	}
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:18,
代码来源:WandOfAmok.java

示例6: proc

点赞 3

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
public boolean 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) {
		
		if (defender == Dungeon.hero) {
			Buff.affect( defender, Vertigo.class, Vertigo.duration( defender ) );
		} else {
			Buff.affect( defender, Terror.class, Terror.DURATION ).source = attacker;
		}
		
		return true;
	} else {
		return false;
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:21,
代码来源:Horror.java

示例7: evolve

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
protected void evolve() {
	super.evolve();
	
	Char ch;
	for (int i=0; i < LENGTH; i++) {
		if (cur[i] > 0 && (ch = Actor.findChar( i )) != null) {
			Buff.prolong( ch, Vertigo.class, Vertigo.duration( ch ) );
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:12,
代码来源:ConfusionGas.java

示例8: evolve

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
protected void evolve() {
	super.evolve();
	
	Char ch;
	for (int i=0; i < getLength(); i++) {
		if (cur[i] > 0 && (ch = Actor.findChar( i )) != null) {
			Buff.prolong( ch, Vertigo.class, Vertigo.duration( ch ) );
		}
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:12,
代码来源:ConfusionGas.java

示例9: execute

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	
	super.execute( hero, action );
	
	if (action.equals( Food.AC_EAT )) {
		ScrollOfTeleportation.teleportHero( hero );
		hero.spendAndNext(1);
		hero.curAction = null;
		Buff.affect(hero, Vertigo.class, Vertigo.DURATION * 2);
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:13,
代码来源:Fadeleaf.java

示例10: execute

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	
	super.execute( hero, action );
	
	if (action.equals( Food.AC_EAT )) {
		Buff.affect(hero, Vertigo.class, Vertigo.DURATION * 2);
		Buff.affect(hero, MindVision.class, 1);
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:11,
代码来源:Dreamweed.java

示例11: applySpecial

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
public void applySpecial(Hero hero, Char tgt) {
	setCurUser(hero);

	if (Dungeon.level.distance(getCurUser().getPos(), tgt.getPos()) > 1) {
		drawChain(tgt.getPos());
	}

	if (Random.Float(1) < 0.1f) {
		Buff.prolong(tgt, Vertigo.class, 3);
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:12,
代码来源:Kusarigama.java

示例12: onZap

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
protected void onZap( int cell ) {
	Char ch = Actor.findChar( cell );
	if (ch != null) {
		if (ch == Dungeon.hero) {
			Buff.affect( ch, Vertigo.class, Vertigo.duration( ch ) );
		} else {
			Buff.affect( ch, Amok.class, 3f + effectiveLevel() );
		}
	} else {
		GLog.i(Game.getVar(R.string.WandOfAmok_Info1));
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:14,
代码来源:WandOfAmok.java

示例13: add

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
public void add( Buff buff ) {
	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 away it!" );
		} 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 Vertigo) {
			GLog.w( "Everything is spinning around you!" );
			interrupt();
		}
		
		else if (buff instanceof Light) {
			sprite.add( CharSprite.State.ILLUMINATED );
		}
	}
	
	BuffIndicator.refreshHero();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:44,
代码来源:Hero.java

示例14: move

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
public void move(int step) {
	
	if(!isMovable()) {
		return;
	}

	if (buff(Vertigo.class) != null && Dungeon.level.adjacent(getPos(), step)) { //ignore vertigo when blinking or teleporting
		List<Integer> candidates = new ArrayList<>();
		for (int dir : Level.NEIGHBOURS8) {
			int p = getPos() + dir;
			if (Dungeon.level.cellValid(p)) {
				if ((Dungeon.level.passable[p] || Dungeon.level.avoid[p]) && Actor.findChar(p) == null) {
					candidates.add(p);
				}
			}
		}

		if (candidates.isEmpty()) { // Nowhere to move? just stay then
			return;
		}

		step = Random.element(candidates);
	}

	if (Dungeon.level.map[getPos()] == Terrain.OPEN_DOOR) {
		Door.leave(getPos());
	}

	setPos(step);

	if (!isFlying()) {
		Dungeon.level.press(getPos(),this);
	}

	if (isFlying() && Dungeon.level.map[getPos()] == Terrain.DOOR) {
		Door.enter(getPos());
	}

	if (this != Dungeon.hero) {
		getSprite().setVisible(Dungeon.visible[getPos()] && invisible >= 0);
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:43,
代码来源:Char.java

示例15: add

点赞 2

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
@Override
public void add(Buff buff) {
	super.add(buff);

	if (!GameScene.isSceneReady()) {
		return;
	}

	if (buff instanceof Burning) {
		GLog.w(Game.getVar(R.string.Hero_StaBurning));
		interrupt();
	} else if (buff instanceof Paralysis) {
		GLog.w(Game.getVar(R.string.Hero_StaParalysis));
		interrupt();
	} else if (buff instanceof Poison) {
		GLog.w(Game.getVar(R.string.Hero_StaPoison));
		interrupt();
	} else if (buff instanceof Ooze) {
		GLog.w(Game.getVar(R.string.Hero_StaOoze));
	} else if (buff instanceof Roots) {
		GLog.w(Game.getVar(R.string.Hero_StaRoots));
	} else if (buff instanceof Weakness) {
		GLog.w(Game.getVar(R.string.Hero_StaWeakness));
	} else if (buff instanceof Blindness) {
		GLog.w(Game.getVar(R.string.Hero_StaBlindness));
	} else if (buff instanceof Fury) {
		GLog.w(Game.getVar(R.string.Hero_StaFury));
		getSprite().showStatus(CharSprite.POSITIVE, Game.getVar(R.string.Hero_StaFurious));
	} else if (buff instanceof Charm) {
		GLog.w(Game.getVar(R.string.Hero_StaCharm));
	} else if (buff instanceof Cripple) {
		GLog.w(Game.getVar(R.string.Hero_StaCripple));
	} else if (buff instanceof Bleeding) {
		GLog.w(Game.getVar(R.string.Hero_StaBleeding));
	} else if (buff instanceof Vertigo) {
		GLog.w(Game.getVar(R.string.Hero_StaVertigo));
		interrupt();
	}

	BuffIndicator.refreshHero();
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:42,
代码来源:Hero.java

示例16: add

点赞 1

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
public void add( Buff buff ) {
	
	buffs.add( buff );
	Actor.add( buff );
	
	if (sprite != null) {
		if (buff instanceof Poison) {
			
			CellEmitter.center( pos ).burst( PoisonParticle.SPLASH, 5 );
			sprite.showStatus( CharSprite.NEGATIVE, "poisoned" );
			
		} else if (buff instanceof Amok) {
			
			sprite.showStatus( CharSprite.NEGATIVE, "amok" );

		} else if (buff instanceof Slow) {

			sprite.showStatus( CharSprite.NEGATIVE, "slowed" );
			
		} else if (buff instanceof MindVision) {
			
			sprite.showStatus( CharSprite.POSITIVE, "mind" );
			sprite.showStatus( CharSprite.POSITIVE, "vision" );
			
		} else if (buff instanceof Paralysis) {

			sprite.add( CharSprite.State.PARALYSED );
			sprite.showStatus( CharSprite.NEGATIVE, "paralysed" );
			
		} else if (buff instanceof Terror) {
			
			sprite.showStatus( CharSprite.NEGATIVE, "frightened" );
			
		} else if (buff instanceof Roots) {
			
			sprite.showStatus( CharSprite.NEGATIVE, "rooted" );
			
		} else if (buff instanceof Cripple) {

			sprite.showStatus( CharSprite.NEGATIVE, "crippled" );
			
		} else if (buff instanceof Bleeding) {

			sprite.showStatus( CharSprite.NEGATIVE, "bleeding" );
			
		} else if (buff instanceof Vertigo) {

			sprite.showStatus( CharSprite.NEGATIVE, "dizzy" );
			
		} else if (buff instanceof Sleep) {
			sprite.idle();
		}
		
		  else if (buff instanceof Burning) {
			sprite.add( CharSprite.State.BURNING );
		} else if (buff instanceof Levitation) {
			sprite.add( CharSprite.State.LEVITATING );
		} else if (buff instanceof Frost) {
			sprite.add( CharSprite.State.FROZEN );
		} else if (buff instanceof Invisibility) {
			if (!(buff instanceof Shadows)) {
				sprite.showStatus( CharSprite.POSITIVE, "invisible" );
			}
			sprite.add( CharSprite.State.INVISIBLE );
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:68,
代码来源:Char.java

示例17: add

点赞 1

import com.watabou.pixeldungeon.actors.buffs.Vertigo; //导入依赖的package包/类
public void add(Buff buff) {

		if(!isAlive()) {
			return;
		}

		buffs.add(buff);
		Actor.add(buff);

		if (!GameScene.isSceneReady()) {
			return;
		}

		if (buff instanceof Poison) {

			CellEmitter.center(getPos()).burst(PoisonParticle.SPLASH, 5);
			getSprite().showStatus(CharSprite.NEGATIVE, Game.getVar(R.string.Char_StaPoisoned));

		} else if (buff instanceof Amok) {

			getSprite().showStatus(CharSprite.NEGATIVE, Game.getVar(R.string.Char_StaAmok));

		} else if (buff instanceof Slow) {

			getSprite().showStatus(CharSprite.NEGATIVE, Game.getVar(R.string.Char_StaSlowed));

		} else if (buff instanceof MindVision) {

			getSprite().showStatus(CharSprite.POSITIVE, Game.getVar(R.string.Char_StaMind));
			getSprite().showStatus(CharSprite.POSITIVE, Game.getVar(R.string.Char_StaVision));

		} else if (buff instanceof Paralysis) {

			getSprite().add(CharSprite.State.PARALYSED);
			getSprite().showStatus(CharSprite.NEGATIVE, Game.getVar(R.string.Char_StaParalysed));

		} else if (buff instanceof Terror) {

			getSprite().showStatus(CharSprite.NEGATIVE, Game.getVar(R.string.Char_StaFrightened));

		} else if (buff instanceof Roots) {

			getSprite().showStatus(CharSprite.NEGATIVE, Game.getVar(R.string.Char_StaRooted));

		} else if (buff instanceof Cripple) {

			getSprite().showStatus(CharSprite.NEGATIVE, Game.getVar(R.string.Char_StaCrippled));

		} else if (buff instanceof Bleeding) {

			getSprite().showStatus(CharSprite.NEGATIVE, Game.getVar(R.string.Char_StaBleeding));

		} else if (buff instanceof Vertigo) {

			getSprite().showStatus(CharSprite.NEGATIVE, Game.getVar(R.string.Char_StaDizzy));

		} else if (buff instanceof Sleep) {
			getSprite().idle();
		} else if (buff instanceof Light) {
			getSprite().add(CharSprite.State.ILLUMINATED);
		} else if (buff instanceof Burning) {
			getSprite().add(CharSprite.State.BURNING);
		} else if (buff instanceof Levitation) {
			getSprite().add(CharSprite.State.LEVITATING);
		} else if (buff instanceof Frost) {
			getSprite().add(CharSprite.State.FROZEN);
		} else if (buff instanceof Invisibility) {
			if (!(buff instanceof Shadows)) {
				getSprite().showStatus(CharSprite.POSITIVE, Game.getVar(R.string.Char_StaInvisible));
			}
			getSprite().add(CharSprite.State.INVISIBLE);
		}

	}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:75,
代码来源:Char.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)