v0.8.0a: ripper demon balance tweaks:

- leap ability now has a short cooldown
- damage slightly reduced to 12-25 from 15-25
- bleed effect is now less likely do deal lots of damage
This commit is contained in:
Evan Debenham 2020-04-27 20:19:47 -04:00
parent 042937e164
commit b0b62987fc

View File

@ -68,7 +68,7 @@ public class RipperDemon extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Random.NormalIntRange( 15, 25 ); return Random.NormalIntRange( 12, 25 );
} }
@Override @Override
@ -88,22 +88,22 @@ public class RipperDemon extends Mob {
private static final String LAST_ENEMY_POS = "last_enemy_pos"; private static final String LAST_ENEMY_POS = "last_enemy_pos";
private static final String LEAP_POS = "leap_pos"; private static final String LEAP_POS = "leap_pos";
private static final String LEAP_CD = "leap_cd";
@Override @Override
public void storeInBundle(Bundle bundle) { public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle); super.storeInBundle(bundle);
bundle.put(LAST_ENEMY_POS, lastEnemyPos); bundle.put(LAST_ENEMY_POS, lastEnemyPos);
bundle.put(LEAP_POS, leapPos); bundle.put(LEAP_POS, leapPos);
bundle.put(LEAP_CD, leapCooldown);
} }
@Override @Override
public void restoreFromBundle(Bundle bundle) { public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle); super.restoreFromBundle(bundle);
//pre beta-5.0
if (bundle.contains(LAST_ENEMY_POS)) {
lastEnemyPos = bundle.getInt(LAST_ENEMY_POS); lastEnemyPos = bundle.getInt(LAST_ENEMY_POS);
leapPos = bundle.getInt(LEAP_POS); leapPos = bundle.getInt(LEAP_POS);
} leapCooldown = bundle.getFloat(LEAP_CD);
} }
private int lastEnemyPos = -1; private int lastEnemyPos = -1;
@ -112,6 +112,7 @@ public class RipperDemon extends Mob {
protected boolean act() { protected boolean act() {
AiState lastState = state; AiState lastState = state;
boolean result = super.act(); boolean result = super.act();
if (paralysed <= 0) leapCooldown --;
//if state changed from wandering to hunting, we haven't acted yet, don't update. //if state changed from wandering to hunting, we haven't acted yet, don't update.
if (!(lastState == WANDERING && state == HUNTING)) { if (!(lastState == WANDERING && state == HUNTING)) {
@ -126,6 +127,7 @@ public class RipperDemon extends Mob {
} }
private int leapPos = -1; private int leapPos = -1;
private float leapCooldown = 0;
public class Hunting extends Mob.Hunting { public class Hunting extends Mob.Hunting {
@ -142,7 +144,7 @@ public class RipperDemon extends Mob {
Char ch = Actor.findChar(leapPos); Char ch = Actor.findChar(leapPos);
if (ch != null){ if (ch != null){
if (alignment != ch.alignment){ if (alignment != ch.alignment){
Buff.affect(ch, Bleeding.class).set(0.75f*Math.max(damageRoll(), damageRoll())); Buff.affect(ch, Bleeding.class).set(0.75f*damageRoll());
ch.sprite.flash(); ch.sprite.flash();
Sample.INSTANCE.play(Assets.SND_HIT); Sample.INSTANCE.play(Assets.SND_HIT);
} }
@ -165,6 +167,7 @@ public class RipperDemon extends Mob {
} }
leapPos = -1; leapPos = -1;
leapCooldown = Random.NormalIntRange(2, 4);
sprite.idle(); sprite.idle();
Dungeon.level.occupyCell(RipperDemon.this); Dungeon.level.occupyCell(RipperDemon.this);
next(); next();
@ -188,7 +191,7 @@ public class RipperDemon extends Mob {
return true; return true;
} }
if (enemyInFOV && Dungeon.level.distance(pos, enemy.pos) >= 3) { if (leapCooldown <= 0 && enemyInFOV && Dungeon.level.distance(pos, enemy.pos) >= 3) {
int targetPos = enemy.pos; int targetPos = enemy.pos;
if (lastEnemyPos != enemy.pos){ if (lastEnemyPos != enemy.pos){