V0.1.1: more work on lullaby.
This commit is contained in:
parent
52abd25647
commit
5c1526e430
|
@ -17,12 +17,15 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
||||
public class Drowsy extends FlavourBuff {
|
||||
public class Drowsy extends Buff {
|
||||
|
||||
public static final float DURATION = 4f;
|
||||
public static final float STEP = 5f;
|
||||
|
||||
private boolean placed = false;
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
|
@ -31,9 +34,17 @@ public class Drowsy extends FlavourBuff {
|
|||
|
||||
@Override
|
||||
public boolean act(){
|
||||
Buff.affect(target, MagicalSleep.class);
|
||||
GLog.i("You fall into a deep magical sleep.");
|
||||
return super.act();
|
||||
if (placed) {
|
||||
Buff.affect(target, MagicalSleep.class);
|
||||
if (target instanceof Hero)
|
||||
GLog.i("You fall into a deep magical sleep.");
|
||||
detach();
|
||||
return true;
|
||||
} else {
|
||||
placed = true;
|
||||
spend(STEP);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -295,9 +295,11 @@ public abstract class Mob extends Char {
|
|||
state = State.FLEEING;
|
||||
} else if (buff instanceof Sleep || buff instanceof MagicalSleep) {
|
||||
if (sprite != null) {
|
||||
new Flare( 4, 32 ).color( 0x44ffff, true ).show( sprite, 2f ) ;
|
||||
//new Flare( 4, 32 ).color( 0x44ffff, true ).show( sprite, 2f ) ;
|
||||
this.sprite().showSleep();
|
||||
}
|
||||
state = State.SLEEPING;
|
||||
this.sprite().showSleep();
|
||||
postpone( Sleep.SWS );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,18 +42,14 @@ public class ScrollOfLullaby extends Scroll {
|
|||
Sample.INSTANCE.play( Assets.SND_LULLABY );
|
||||
Invisibility.dispel();
|
||||
|
||||
int count = 0;
|
||||
Mob affected = null;
|
||||
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
|
||||
if (Level.fieldOfView[mob.pos]) {
|
||||
Buff.affect( mob, Drowsy.class );
|
||||
if (mob.buff( Drowsy.class ) != null) {
|
||||
affected = mob;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Buff.affect( curUser, Drowsy.class );
|
||||
|
||||
GLog.i( "The scroll utters a soothing melody. You feel very sleepy." );
|
||||
|
||||
setKnown();
|
||||
|
|
Loading…
Reference in New Issue
Block a user