v2.5.0: cleaned up drowsy code, added duration to desc

This commit is contained in:
Evan Debenham
2024-08-29 15:11:36 -04:00
parent cc3c434d35
commit 73129585e9
3 changed files with 5 additions and 19 deletions

View File

@@ -189,7 +189,7 @@ actors.buffs.dread.name=dread
actors.buffs.dread.desc=A terror so great that it will cause its target to flee the dungeon entirely!\n\nCreatures affected by dread will run from their opponent at high speed, and will disappear from the dungeon entirely once they are out of sight. Enemies that are defeated this way award half experience and drop no items. The shock of pain will lessen the duration of dread.\n\nTurns of dread remaining: %d.
actors.buffs.drowsy.name=drowsy
actors.buffs.drowsy.desc=A magical force is making it difficult to stay awake.\n\nThe hero can resist drowsiness by taking damage or by being at full health.\n\nAfter a few turns, the target will fall into a deep magical sleep.
actors.buffs.drowsy.desc=A magical force is making it difficult to stay awake, after a few turns, the target will fall into a deep magical sleep.\n\nThe hero can resist drowsiness by taking damage or by being at full health.\n\nTurns until sleep: %s.
actors.buffs.earthimbue.name=imbued with earth
actors.buffs.earthimbue.desc=You are imbued with the power of earth!\n\nAll physical attacks will shift the earth under the enemy, crippling them for a short time.\n\nTurns of earth imbue remaining: %s.

View File

@@ -22,10 +22,9 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Drowsy extends Buff {
public class Drowsy extends FlavourBuff {
public static final float DURATION = 5f;
@@ -44,16 +43,8 @@ public class Drowsy extends Buff {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String iconTextDisplay() {
return Integer.toString((int)visualcooldown());
}
public boolean attachTo(Char target ) {
if (!target.isImmune(Sleep.class) && super.attachTo(target)) {
if (cooldown() == 0) {
spend(DURATION);
}
return true;
}
return false;
@@ -63,12 +54,7 @@ public class Drowsy extends Buff {
public boolean act(){
Buff.affect(target, MagicalSleep.class);
detach();
return true;
return super.act();
}
@Override
public String desc() {
return Messages.get(this, "desc", dispTurns(visualcooldown()));
}
}

View File

@@ -47,12 +47,12 @@ public class ScrollOfLullaby extends Scroll {
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
if (Dungeon.level.heroFOV[mob.pos]) {
Buff.affect( mob, Drowsy.class );
Buff.affect( mob, Drowsy.class, Drowsy.DURATION );
mob.sprite.centerEmitter().start( Speck.factory( Speck.NOTE ), 0.3f, 5 );
}
}
Buff.affect( curUser, Drowsy.class );
Buff.affect( curUser, Drowsy.class, Drowsy.DURATION );
GLog.i( Messages.get(this, "sooth") );