v2.2.0: downed guardians now repel items & don't trigger on-hit effects
This commit is contained in:
@@ -408,20 +408,22 @@ public abstract class Char extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int effectiveDamage = enemy.defenseProc( this, Math.round(dmg) );
|
int effectiveDamage = enemy.defenseProc( this, Math.round(dmg) );
|
||||||
effectiveDamage = Math.max( effectiveDamage - dr, 0 );
|
//do not trigger on-hit logic if defenseProc returned a negative value
|
||||||
|
if (effectiveDamage >= 0) {
|
||||||
|
effectiveDamage = Math.max(effectiveDamage - dr, 0);
|
||||||
|
|
||||||
if (enemy.buff(Viscosity.ViscosityTracker.class) != null){
|
if (enemy.buff(Viscosity.ViscosityTracker.class) != null) {
|
||||||
effectiveDamage = enemy.buff(Viscosity.ViscosityTracker.class).deferDamage(effectiveDamage);
|
effectiveDamage = enemy.buff(Viscosity.ViscosityTracker.class).deferDamage(effectiveDamage);
|
||||||
enemy.buff(Viscosity.ViscosityTracker.class).detach();
|
enemy.buff(Viscosity.ViscosityTracker.class).detach();
|
||||||
|
}
|
||||||
|
|
||||||
|
//vulnerable specifically applies after armor reductions
|
||||||
|
if (enemy.buff(Vulnerable.class) != null) {
|
||||||
|
effectiveDamage *= 1.33f;
|
||||||
|
}
|
||||||
|
|
||||||
|
effectiveDamage = attackProc(enemy, effectiveDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
//vulnerable specifically applies after armor reductions
|
|
||||||
if ( enemy.buff( Vulnerable.class ) != null){
|
|
||||||
effectiveDamage *= 1.33f;
|
|
||||||
}
|
|
||||||
|
|
||||||
effectiveDamage = attackProc( enemy, effectiveDamage );
|
|
||||||
|
|
||||||
if (visibleFight) {
|
if (visibleFight) {
|
||||||
if (effectiveDamage > 0 || !enemy.blockSound(Random.Float(0.96f, 1.05f))) {
|
if (effectiveDamage > 0 || !enemy.blockSound(Random.Float(0.96f, 1.05f))) {
|
||||||
hitSound(Random.Float(0.87f, 1.15f));
|
hitSound(Random.Float(0.87f, 1.15f));
|
||||||
|
|||||||
+13
@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CrystalGuardianSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CrystalGuardianSprite;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
@@ -65,6 +66,7 @@ public class CrystalGuardian extends Mob{
|
|||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
if (recovering){
|
if (recovering){
|
||||||
|
throwItems();
|
||||||
HP = Math.min(HT, HP+5);
|
HP = Math.min(HT, HP+5);
|
||||||
sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);
|
sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);
|
||||||
if (HP == HT){
|
if (HP == HT){
|
||||||
@@ -97,6 +99,17 @@ public class CrystalGuardian extends Mob{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int defenseProc(Char enemy, int damage) {
|
||||||
|
if (recovering){
|
||||||
|
sprite.showStatus(CharSprite.NEGATIVE, Integer.toString(damage));
|
||||||
|
HP = Math.max(1, HP-damage);
|
||||||
|
damage = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.defenseProc(enemy, damage);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAlive() {
|
public boolean isAlive() {
|
||||||
if (HP <= 0){
|
if (HP <= 0){
|
||||||
|
|||||||
Reference in New Issue
Block a user