v0.8.0: various bugfixes:

- fixed various rare crash bugs
- fixed the locked floor buff not adding time correctly for DK
- fixed DK unintentionally dropping armor kit on his throne
- tweaked the text ghouls display when downed
- wards now trigger traps if placed on top of them
This commit is contained in:
Evan Debenham 2020-02-15 01:04:25 -05:00
parent 8e74837162
commit f2acbd61e3
8 changed files with 35 additions and 9 deletions

View File

@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LifeLink; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LifeLink;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.effects.Beam; import com.shatteredpixel.shatteredpixeldungeon.effects.Beam;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
@ -40,6 +41,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.ArmorKit;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.GooBlob;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
import com.shatteredpixel.shatteredpixeldungeon.levels.NewCityBossLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.NewCityBossLevel;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
@ -270,6 +272,8 @@ public class DwarfKing extends Mob {
} }
private boolean teleportSubject(){ private boolean teleportSubject(){
if (enemy == null) return false;
Mob furthest = null; Mob furthest = null;
for (Mob m : getSubjects()){ for (Mob m : getSubjects()){
@ -355,6 +359,10 @@ public class DwarfKing extends Mob {
} }
int preHP = HP; int preHP = HP;
super.damage(dmg, src); super.damage(dmg, src);
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
if (lock != null && !isImmune(src.getClass())) lock.addTime(dmg/3);
if (phase == 1) { if (phase == 1) {
int dmgTaken = preHP - HP; int dmgTaken = preHP - HP;
abilityCooldown -= dmgTaken/8f; abilityCooldown -= dmgTaken/8f;
@ -396,7 +404,13 @@ public class DwarfKing extends Mob {
public void die(Object cause) { public void die(Object cause) {
GameScene.bossSlain(); GameScene.bossSlain();
if (!Dungeon.level.solid[pos]) {
Dungeon.level.drop(new ArmorKit(), pos).sprite.drop(); Dungeon.level.drop(new ArmorKit(), pos).sprite.drop();
} else {
//if the king is on his throne, drop the toolkit below
Dungeon.level.drop( new ArmorKit(), pos + Dungeon.level.width() ).sprite.drop( pos );
}
super.die( cause ); super.die( cause );

View File

@ -28,8 +28,10 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.GhoulSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.GhoulSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random; import com.watabou.utils.Random;
@ -146,6 +148,8 @@ public class Ghoul extends Mob {
timesDowned++; timesDowned++;
Buff.append(nearby, GhoulLifeLink.class).set(timesDowned*5, this); Buff.append(nearby, GhoulLifeLink.class).set(timesDowned*5, this);
((GhoulSprite)sprite).crumple(); ((GhoulSprite)sprite).crumple();
HP = Math.round(HT/10f);
GLog.i(Messages.get(this, "collapse"));
return; return;
} }
} }
@ -275,7 +279,6 @@ public class Ghoul extends Mob {
turnsToRevive--; turnsToRevive--;
if (turnsToRevive <= 0){ if (turnsToRevive <= 0){
ghoul.HP = Math.round(ghoul.HT/10f);
if (Actor.findChar( ghoul.pos ) != null) { if (Actor.findChar( ghoul.pos ) != null) {
ArrayList<Integer> candidates = new ArrayList<>(); ArrayList<Integer> candidates = new ArrayList<>();
for (int n : PathFinder.NEIGHBOURS8) { for (int n : PathFinder.NEIGHBOURS8) {

View File

@ -65,7 +65,7 @@ public class GoldenMimic extends Mimic {
public void stopHiding(){ public void stopHiding(){
state = HUNTING; state = HUNTING;
if (Dungeon.level.heroFOV[pos] && Actor.chars().contains(this)) { if (Actor.chars().contains(this) && Dungeon.level.heroFOV[pos]) {
enemy = Dungeon.hero; enemy = Dungeon.hero;
target = Dungeon.hero.pos; target = Dungeon.hero.pos;
enemySeen = true; enemySeen = true;

View File

@ -117,11 +117,10 @@ public class NewTengu extends Mob {
//Tengu is immune to debuffs and damage when removed from the level //Tengu is immune to debuffs and damage when removed from the level
@Override @Override
public void add(Buff buff) { public void add(Buff buff) {
if (!Dungeon.level.mobs.contains(this)){ if (Actor.chars().contains(this)){
return;
}
super.add(buff); super.add(buff);
} }
}
@Override @Override
public void damage(int dmg, Object src) { public void damage(int dmg, Object src) {

View File

@ -101,6 +101,7 @@ public class WandOfWarding extends Wand {
GameScene.add(ward, 1f); GameScene.add(ward, 1f);
Dungeon.level.occupyCell(ward); Dungeon.level.occupyCell(ward);
ward.sprite.emitter().burst(MagicMissile.WardParticle.UP, ward.tier); ward.sprite.emitter().burst(MagicMissile.WardParticle.UP, ward.tier);
Dungeon.level.pressCell(bolt.collisionPos);
} else { } else {
GLog.w( Messages.get(this, "bad_location")); GLog.w( Messages.get(this, "bad_location"));
@ -188,6 +189,12 @@ public class WandOfWarding extends Wand {
state = WANDERING; state = WANDERING;
} }
@Override
protected boolean act() {
throwItem();
return super.act();
}
@Override @Override
public String name() { public String name() {
return Messages.get(this, "name_" + tier ); return Messages.get(this, "name_" + tier );

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.ui; package com.shatteredpixel.shatteredpixeldungeon.ui;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@ -46,7 +47,7 @@ public class CharHealthIndicator extends HealthBar {
public void update() { public void update() {
super.update(); super.update();
if (target != null && target.isAlive() && target.sprite.visible) { if (target != null && target.isAlive() && target.sprite.visible && Actor.chars().contains(target)) {
CharSprite sprite = target.sprite; CharSprite sprite = target.sprite;
width = sprite.width()*(4/6f); width = sprite.width()*(4/6f);
x = sprite.x + sprite.width()/6f; x = sprite.x + sprite.width()/6f;

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.ui; package com.shatteredpixel.shatteredpixeldungeon.ui;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@ -40,7 +41,7 @@ public class TargetHealthIndicator extends HealthBar {
public void update() { public void update() {
super.update(); super.update();
if (target != null && target.isAlive() && target.sprite.visible) { if (target != null && target.isAlive() && target.sprite.visible && Actor.chars().contains(target)) {
CharSprite sprite = target.sprite; CharSprite sprite = target.sprite;
width = sprite.width(); width = sprite.width();
x = sprite.x; x = sprite.x;

View File

@ -551,6 +551,7 @@ actors.mobs.fetidrat.name=fetid rat
actors.mobs.fetidrat.desc=Something is clearly wrong with this rat. Its greasy black fur and rotting skin are very different from the healthy rats you've seen previously. Its pale green eyes make it seem especially menacing.\n\nThe rat carries a cloud of horrible stench with it, it's overpoweringly strong up close.\n\nDark ooze dribbles from the rat's mouth, it eats through the floor but seems to dissolve in water. actors.mobs.fetidrat.desc=Something is clearly wrong with this rat. Its greasy black fur and rotting skin are very different from the healthy rats you've seen previously. Its pale green eyes make it seem especially menacing.\n\nThe rat carries a cloud of horrible stench with it, it's overpoweringly strong up close.\n\nDark ooze dribbles from the rat's mouth, it eats through the floor but seems to dissolve in water.
actors.mobs.ghoul.name=dwarven ghoul actors.mobs.ghoul.name=dwarven ghoul
actors.mobs.ghoul.collapse=The dwarven ghoul collapses.
actors.mobs.ghoul.desc=As dwarven society slowly began to collapse, and the current king of the dwarves seized absolute power, those who were weak or who resisted him were not treated well. As the king grew more adept at wielding dark magic, he bent these dwarves to his will, and now they make up the footsoldiers of his army.\n\nGhouls are not especially strong on their own, but always travel in groups and are much harder to kill in large numbers. _When a ghoul is defeated, it will rise again after a few turns as long as another ghoul is nearby._ actors.mobs.ghoul.desc=As dwarven society slowly began to collapse, and the current king of the dwarves seized absolute power, those who were weak or who resisted him were not treated well. As the king grew more adept at wielding dark magic, he bent these dwarves to his will, and now they make up the footsoldiers of his army.\n\nGhouls are not especially strong on their own, but always travel in groups and are much harder to kill in large numbers. _When a ghoul is defeated, it will rise again after a few turns as long as another ghoul is nearby._
actors.mobs.gnoll.name=gnoll scout actors.mobs.gnoll.name=gnoll scout