v0.9.2: fixed various crash errors

This commit is contained in:
Evan Debenham 2021-02-15 22:18:02 -05:00
parent dd8ec8033c
commit db8dffe639
6 changed files with 19 additions and 16 deletions

View File

@ -216,6 +216,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
public void useMove(ComboMove move){ public void useMove(ComboMove move){
if (move == ComboMove.PARRY){ if (move == ComboMove.PARRY){
parryUsed = true; parryUsed = true;
comboTime = 5f;
Buff.affect(target, ParryTracker.class, Actor.TICK); Buff.affect(target, ParryTracker.class, Actor.TICK);
((Hero)target).spendAndNext(Actor.TICK); ((Hero)target).spendAndNext(Actor.TICK);
} else { } else {
@ -422,6 +423,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
if (cell == null) return; if (cell == null) return;
final Char enemy = Actor.findChar( cell ); final Char enemy = Actor.findChar( cell );
if (enemy == null if (enemy == null
|| enemy == target
|| !Dungeon.level.heroFOV[cell] || !Dungeon.level.heroFOV[cell]
|| target.isCharmedBy( enemy )) { || target.isCharmedBy( enemy )) {
GLog.w(Messages.get(Combo.class, "bad_target")); GLog.w(Messages.get(Combo.class, "bad_target"));

View File

@ -231,9 +231,7 @@ public class Preparation extends Buff implements ActionIndicator.Action {
public void restoreFromBundle(Bundle bundle) { public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle); super.restoreFromBundle(bundle);
turnsInvis = bundle.getInt(TURNS); turnsInvis = bundle.getInt(TURNS);
if (AttackLevel.getLvl(turnsInvis).blinkDistance() > 0){ ActionIndicator.setAction(this);
ActionIndicator.setAction(this);
}
} }
@Override @Override

View File

@ -694,10 +694,12 @@ public abstract class Mob extends Char {
&& soulMarked && soulMarked
&& Random.Int(10) < Dungeon.hero.pointsInTalent(Talent.NECROMANCERS_MINIONS)){ && Random.Int(10) < Dungeon.hero.pointsInTalent(Talent.NECROMANCERS_MINIONS)){
Wraith w = Wraith.spawnAt(pos); Wraith w = Wraith.spawnAt(pos);
Buff.affect(w, Corruption.class); if (w != null) {
if (Dungeon.level.heroFOV[pos]){ Buff.affect(w, Corruption.class);
CellEmitter.get(pos).burst( ShadowParticle.CURSE, 6 ); if (Dungeon.level.heroFOV[pos]) {
Sample.INSTANCE.play( Assets.Sounds.CURSED ); CellEmitter.get(pos).burst(ShadowParticle.CURSE, 6);
Sample.INSTANCE.play(Assets.Sounds.CURSED);
}
} }
} }
} }

View File

@ -266,7 +266,7 @@ public class NewTengu extends Mob {
if (level.heroFOV[newPos]) CellEmitter.get( newPos ).burst( Speck.factory( Speck.WOOL ), 6 ); if (level.heroFOV[newPos]) CellEmitter.get( newPos ).burst( Speck.factory( Speck.WOOL ), 6 );
Sample.INSTANCE.play( Assets.Sounds.PUFF ); Sample.INSTANCE.play( Assets.Sounds.PUFF );
float fill = 0.9f - 0.5f*((HP-80)/80f); float fill = 0.9f - 0.5f*((HP-(HT/2f))/(HT/2f));
level.placeTrapsInTenguCell(fill); level.placeTrapsInTenguCell(fill);
//otherwise, jump in a larger possible area, as the room is bigger //otherwise, jump in a larger possible area, as the room is bigger

View File

@ -90,8 +90,10 @@ public class Artifact extends KindofMisc {
public boolean doUnequip( Hero hero, boolean collect, boolean single ) { public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
if (super.doUnequip( hero, collect, single )) { if (super.doUnequip( hero, collect, single )) {
passiveBuff.detach(); if (passiveBuff != null) {
passiveBuff = null; passiveBuff.detach();
passiveBuff = null;
}
if (activeBuff != null){ if (activeBuff != null){
activeBuff.detach(); activeBuff.detach();

View File

@ -155,11 +155,10 @@ public class CloakOfShadows extends Artifact {
if (passiveBuff != null){ if (passiveBuff != null){
passiveBuff.detach(); passiveBuff.detach();
passiveBuff = null; passiveBuff = null;
}
if (activeBuff != null){ if (activeBuff != null){
activeBuff.detach(); activeBuff.detach();
activeBuff = null; activeBuff = null;
}
} }
} }