本文整理匯總了Java中com.shatteredpixel.shatteredpixeldungeon.Dungeon.observe方法的典型用法代碼示例。如果您正苦於以下問題:Java Dungeon.observe方法的具體用法?Java Dungeon.observe怎麽用?Java Dungeon.observe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.shatteredpixel.shatteredpixeldungeon.Dungeon
的用法示例。
在下文中一共展示了Dungeon.observe方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: attachTo
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public boolean attachTo(Char target) {
spend(charge);
((Hero)target).spendAndNext(charge);
//shouldn't punish the player for going into stasis frequently
Hunger hunger = target.buff(Hunger.class);
if (hunger != null && !hunger.isStarving())
hunger.satisfy(charge);
charge = 0;
target.invisible++;
updateQuickslot();
Dungeon.observe();
return super.attachTo(target);
}
示例2: drop
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public Heap drop( Item item, int cell ) {
if (!keyDropped && item instanceof SkeletonKey) {
keyDropped = true;
locked = false;
CellEmitter.get( arenaDoor ).start( Speck.factory( Speck.ROCK ), 0.07f, 10 );
set( arenaDoor, Terrain.EMPTY_DECO );
GameScene.updateMap( arenaDoor );
Dungeon.observe();
}
return super.drop( item, cell );
}
示例3: press
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public void press( int cell, Char hero ) {
super.press( cell, hero );
if (!enteredArena && outsideEntraceRoom( cell ) && hero == Dungeon.hero) {
enteredArena = true;
locked = true;
Mob boss = Bestiary.mob( Dungeon.depth );
boss.state = boss.HUNTING;
do {
boss.pos = Random.Int( LENGTH );
} while (
!passable[boss.pos] ||
!outsideEntraceRoom( boss.pos ) ||
Dungeon.visible[boss.pos]);
GameScene.add( boss );
set( arenaDoor, Terrain.LOCKED_DOOR );
GameScene.updateMap( arenaDoor );
Dungeon.observe();
}
}
示例4: teleportHero
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public static void teleportHero( Hero hero ) {
int count = 10;
int pos;
do {
pos = Dungeon.level.randomRespawnCell();
if (count-- <= 0) {
break;
}
} while (pos == -1);
if (pos == -1) {
GLog.w( TXT_NO_TELEPORT );
} else {
WandOfBlink.appear( hero, pos );
Dungeon.level.press( pos, hero );
Dungeon.observe();
GLog.i( TXT_TELEPORTED );
}
}
示例5: execute
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public void execute( Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_SCRY)){
if (!isEquipped(hero)) GLog.i("You need to equip your talisman to do that.");
else if (charge != chargeCap) GLog.i("Your talisman isn't full charged yet.");
else {
hero.sprite.operate(hero.pos);
hero.busy();
Sample.INSTANCE.play(Assets.SND_BEACON);
charge = 0;
for (int i = 0; i < Level.LENGTH; i++) {
int terr = Dungeon.level.map[i];
if ((Terrain.flags[terr] & Terrain.SECRET) != 0) {
GameScene.updateMap(i);
if (Dungeon.visible[i]) {
GameScene.discoverTile(i, terr);
}
}
}
GLog.p("The Talisman floods your mind with knowledge about the current floor.");
Buff.affect(hero, Awareness.class, Awareness.DURATION);
Dungeon.observe();
}
}
}
示例6: reallyDie
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public static void reallyDie( Object cause ) {
int length = Level.LENGTH;
int[] map = Dungeon.level.map;
boolean[] visited = Dungeon.level.visited;
boolean[] discoverable = Level.discoverable;
for (int i=0; i < length; i++) {
int terr = map[i];
if (discoverable[i]) {
visited[i] = true;
if ((Terrain.flags[terr] & Terrain.SECRET) != 0) {
Level.set( i, Terrain.discover( terr ) );
GameScene.updateMap( i );
}
}
}
Bones.leave();
Dungeon.observe();
Dungeon.hero.belongings.identify();
GameScene.gameOver();
if (cause instanceof Hero.Doom) {
((Hero.Doom)cause).onDeath();
}
Dungeon.deleteGame( Dungeon.hero.heroClass, true );
}
示例7: onMotionComplete
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public void onMotionComplete() {
Dungeon.observe();
search( false );
super.onMotionComplete();
}
示例8: steal
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
protected boolean steal( Hero hero ) {
if (super.steal( hero )) {
Buff.prolong( enemy, Blindness.class, Random.Int( 5, 12 ) );
Buff.affect( enemy, Poison.class ).set(Random.Int(5, 7) * Poison.durationFactor(enemy));
Buff.prolong( enemy, Cripple.class, Cripple.DURATION );
Dungeon.observe();
return true;
} else {
return false;
}
}
示例9: attachTo
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public boolean attachTo( Char target ) {
if (super.attachTo( target )) {
// When a level is loading, do nothing
if (Dungeon.level != null) {
target.viewDistance = Math.max( Dungeon.level.viewDistance, DISTANCE );
Dungeon.observe();
}
return true;
} else {
return false;
}
}
示例10: detach
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public void detach() {
if (target.invisible > 0)
target.invisible --;
super.detach();
activeBuff = null;
Dungeon.observe();
}
示例11: attachTo
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public boolean attachTo( Char target ) {
if (super.attachTo( target )) {
Sample.INSTANCE.play( Assets.SND_MELD );
Dungeon.observe();
return true;
} else {
return false;
}
}
示例12: drop
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public Heap drop( Item item, int cell ) {
if (!keyDropped && item instanceof SkeletonKey) {
keyDropped = true;
locked = false;
set( arenaDoor, Terrain.DOOR );
GameScene.updateMap( arenaDoor );
Dungeon.observe();
}
return super.drop( item, cell );
}
示例13: enter
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public static void enter( int pos ) {
Level.set( pos, Terrain.OPEN_DOOR );
GameScene.updateMap( pos );
Dungeon.observe();
if (Dungeon.visible[pos]) {
Sample.INSTANCE.play( Assets.SND_OPEN );
}
}
示例14: leave
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
public static void leave( int pos ) {
if (Dungeon.level.heaps.get( pos ) == null) {
Level.set( pos, Terrain.DOOR );
GameScene.updateMap( pos );
Dungeon.observe();
}
}
示例15: apply
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //導入方法依賴的package包/類
@Override
public void apply( Hero hero ) {
setKnown();
Buff.affect( hero, MindVision.class, MindVision.DURATION );
Dungeon.observe();
if (Dungeon.level.mobs.size() > 0) {
GLog.i( "You can somehow feel the presence of other creatures' minds!" );
} else {
GLog.i( "You can somehow tell that you are alone on this level at the moment." );
}
}