本文整理汇总了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 );
}
}
示例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 );
}
示例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 );
}
示例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" );
}
}
示例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 );
}
示例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 );
}
示例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();
}
示例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 );
}
}
示例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();
}
示例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);
}
}