v0.6.4: significantly nerfed paralysis, now is easier to snap out of

This commit is contained in:
Evan Debenham 2018-03-17 23:45:04 -04:00
parent bc14b0472b
commit f8c94e2989
5 changed files with 60 additions and 8 deletions

View File

@ -302,12 +302,7 @@ public abstract class Char extends Actor {
} }
if (buff( Paralysis.class ) != null) { if (buff( Paralysis.class ) != null) {
if (Random.Int( dmg ) >= Random.Int( HP )) { buff( Paralysis.class ).processDamage(dmg);
Buff.detach( this, Paralysis.class );
if (Dungeon.level.heroFOV[pos]) {
GLog.i( Messages.get(Char.class, "out_of_paralysis", name) );
}
}
} }
//FIXME: when I add proper damage properties, should add an IGNORES_SHIELDS property to use here. //FIXME: when I add proper damage properties, should add an IGNORES_SHIELDS property to use here.

View File

@ -38,6 +38,11 @@ import com.watabou.utils.Random;
public class Electricity extends Blob { public class Electricity extends Blob {
{
//acts after mobs, to give them a chance to resist paralysis
actPriority = MOB_PRIO - 1;
}
private boolean[] water; private boolean[] water;
@Override @Override

View File

@ -32,6 +32,11 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
public class ParalyticGas extends Blob { public class ParalyticGas extends Blob {
{
//acts after mobs, to give them a chance to resist paralysis
actPriority = MOB_PRIO - 1;
}
@Override @Override
protected void evolve() { protected void evolve() {
super.evolve(); super.evolve();

View File

@ -21,11 +21,14 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class Paralysis extends FlavourBuff { public class Paralysis extends FlavourBuff {
@ -45,6 +48,21 @@ public class Paralysis extends FlavourBuff {
} }
} }
public void processDamage( int damage ){
if (target == null) return;
ParalysisResist resist = target.buff(ParalysisResist.class);
if (resist == null){
resist = Buff.affect(target, ParalysisResist.class);
}
resist.damage += damage;
if (Random.NormalIntRange(0, resist.damage) >= Random.NormalIntRange(0, target.HP)){
detach();
if (Dungeon.level.heroFOV[target.pos]) {
GLog.i( Messages.get(this, "out", target.name) );
}
}
}
@Override @Override
public void detach() { public void detach() {
super.detach(); super.detach();
@ -81,4 +99,33 @@ public class Paralysis extends FlavourBuff {
public static float duration( Char ch ) { public static float duration( Char ch ) {
return DURATION; return DURATION;
} }
public static class ParalysisResist extends Buff {
private int damage;
@Override
public boolean act() {
if (target.buff(Paralysis.class) == null) {
damage -= Math.ceil(damage / 10f);
if (damage >= 0) detach();
}
spend(TICK);
return true;
}
private static final String DAMAGE = "damage";
@Override
public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle);
damage = bundle.getInt(DAMAGE);
}
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
bundle.put( DAMAGE, damage );
}
}
} }

View File

@ -171,6 +171,7 @@ actors.buffs.ooze.desc=This sticky acid clings to flesh, slowly melting it away.
actors.buffs.paralysis.name=Paralysed actors.buffs.paralysis.name=Paralysed
actors.buffs.paralysis.heromsg=You are paralysed! actors.buffs.paralysis.heromsg=You are paralysed!
actors.buffs.paralysis.out=The pain snaps %s out of paralysis.
actors.buffs.paralysis.desc=Oftentimes the worst thing to do is nothing at all.\n\nParalysis completely halts all actions, forcing the target to wait until the effect wears off. The pain from taking damage can also cause characters to snap out of paralysis.\n\nTurns of paralysis remaining: %s. actors.buffs.paralysis.desc=Oftentimes the worst thing to do is nothing at all.\n\nParalysis completely halts all actions, forcing the target to wait until the effect wears off. The pain from taking damage can also cause characters to snap out of paralysis.\n\nTurns of paralysis remaining: %s.
actors.buffs.poison.name=Poisoned actors.buffs.poison.name=Poisoned
@ -555,5 +556,4 @@ actors.mobs.yog$larva.desc=Yog-Dzewa is an Old God, a powerful entity from the r
actors.char.kill=%s killed you... actors.char.kill=%s killed you...
actors.char.defeat=You defeated %s. actors.char.defeat=You defeated %s.
actors.char.out_of_paralysis=The pain snapped %s out of paralysis.
actors.char.def_verb=dodged actors.char.def_verb=dodged