當前位置: 首頁>>代碼示例>>Java>>正文


Java Amok類代碼示例

本文整理匯總了Java中com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok的典型用法代碼示例。如果您正苦於以下問題:Java Amok類的具體用法?Java Amok怎麽用?Java Amok使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Amok類屬於com.shatteredpixel.shatteredpixeldungeon.actors.buffs包,在下文中一共展示了Amok類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: add

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的package包/類
@Override
public void add( Buff buff ) {
	super.add( buff );
	if (buff instanceof Amok) {
		if (sprite != null) {
			sprite.showStatus( CharSprite.NEGATIVE, TXT_RAGE );
		}
		state = HUNTING;
	} else if (buff instanceof Terror) {
		state = FLEEING;
	} else if (buff instanceof Sleep) {
		state = SLEEPING;
           this.sprite().showSleep();
		postpone( Sleep.SWS );
	}
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:17,代碼來源:Mob.java

示例2: findPath

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的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 );
	
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:25,代碼來源:Dungeon.java

示例3: doRead

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的package包/類
@Override
protected void doRead() {

       for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
           mob.beckon( curUser.pos );
           if (Level.fieldOfView[mob.pos]) {
               Buff.prolong(mob, Amok.class, 5f);
           }
       }
	
	GLog.w( "The scroll emits an enraging roar that echoes throughout the dungeon!" );
	setKnown();
	
	curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );		
	Sample.INSTANCE.play( Assets.SND_CHALLENGE );
	Invisibility.dispel();
	
	curUser.spendAndNext( TIME_TO_READ );
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:20,代碼來源:ScrollOfRage.java

示例4: onZap

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的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:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:18,代碼來源:WandOfAmok.java

示例5: findPath

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的package包/類
public static PathFinder.Path findPath(Char ch, int from, int to, boolean pass[], boolean[] visible ) {

		setupPassable();
		if (ch.flying || ch.buff( Amok.class ) != null) {
			BArray.or( pass, Dungeon.level.avoid, passable );
		} else {
			System.arraycopy( pass, 0, passable, 0, Dungeon.level.length() );
		}

		for (Char c : Actor.chars()) {
			if (visible[c.pos]) {
				passable[c.pos] = false;
			}
		}

		return PathFinder.find( from, to, passable );

	}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:19,代碼來源:Dungeon.java

示例6: findStep

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的package包/類
public static int findStep(Char ch, int from, int to, boolean pass[], boolean[] visible ) {

		if (Dungeon.level.adjacent( from, to )) {
			return Actor.findChar( to ) == null && (pass[to] || Dungeon.level.avoid[to]) ? to : -1;
		}

		setupPassable();
		if (ch.flying || ch.buff( Amok.class ) != null) {
			BArray.or( pass, Dungeon.level.avoid, passable );
		} else {
			System.arraycopy( pass, 0, passable, 0, Dungeon.level.length() );
		}
		
		for (Char c : Actor.chars()) {
			if (visible[c.pos]) {
				passable[c.pos] = false;
			}
		}
		
		return PathFinder.getStep( from, to, passable );

	}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:23,代碼來源:Dungeon.java

示例7: empoweredRead

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的package包/類
@Override
public void empoweredRead() {
	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (Dungeon.level.heroFOV[mob.pos]) {
			Buff.prolong(mob, Amok.class, 5f);
		}
	}
	
	setKnown();
	
	curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	readAnimation();
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:17,代碼來源:ScrollOfRage.java

示例8: add

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的package包/類
@Override
public void add( Buff buff ) {
	super.add( buff );
	if (buff instanceof Amok || buff instanceof Corruption) {
		state = HUNTING;
	} else if (buff instanceof Terror) {
		state = FLEEING;
	} else if (buff instanceof Sleep) {
		state = SLEEPING;
		this.sprite().showSleep();
		postpone( Sleep.SWS );
	}
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:14,代碼來源:Mob.java

示例9: doRead

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的package包/類
@Override
public void doRead() {

	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		mob.beckon( curUser.pos );
		if (Dungeon.level.heroFOV[mob.pos]) {
			Buff.prolong(mob, Amok.class, 5f);
		}
	}

	for (Heap heap : Dungeon.level.heaps.values()) {
		if (heap.type == Heap.Type.MIMIC) {
			Mimic m = Mimic.spawnAt( heap.pos, heap.items );
			if (m != null) {
				m.beckon( curUser.pos );
				heap.destroy();
			}
		}
	}

	GLog.w( Messages.get(this, "roar") );
	setKnown();
	
	curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );
	Sample.INSTANCE.play( Assets.SND_CHALLENGE );
	Invisibility.dispel();

	readAnimation();
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:30,代碼來源:ScrollOfRage.java

示例10: onHit

import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; //導入依賴的package包/類
@Override
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
	// lvl 0 - 25%
	// lvl 1 - 40%
	// lvl 2 - 50%
	if (Random.Int( level() + 4 ) >= 3){
		Buff.prolong( defender, Amok.class, 4+level()*2);
	}
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:10,代碼來源:WandOfCorruption.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。