v0.7.4: fixed various dried rose AI errors

This commit is contained in:
Evan Debenham 2019-07-11 19:43:01 -04:00
parent 1f604d7b13
commit 71db3ba1d1
3 changed files with 16 additions and 7 deletions

View File

@ -887,6 +887,7 @@ public abstract class Mob extends Char {
for (Mob mob : level.mobs.toArray( new Mob[0] )) {
//preserve the ghost no matter where they are
if (mob instanceof DriedRose.GhostHero) {
((DriedRose.GhostHero) mob).clearDefensingPos();
level.mobs.remove( mob );
heldAllies.add(mob);

View File

@ -409,11 +409,14 @@ public class DriedRose extends Artifact {
ghost.aggro(null);
ghost.state = ghost.WANDERING;
ghost.defendingPos = -1;
ghost.movingToDefendPos = false;
} else if (Actor.findChar(cell).alignment == Char.Alignment.ENEMY){
ghost.yell(Messages.get(ghost, "directed_attack_" + Random.IntRange(1, 5)));
ghost.aggro(Actor.findChar(cell));
ghost.setTarget(cell);
ghost.movingToDefendPos = false;
}
}
@ -477,9 +480,6 @@ public class DriedRose extends Artifact {
properties.add(Property.UNDEAD);
}
private int defendingPos = -1;
private boolean movingToDefendPos = false;
private DriedRose rose = null;
public GhostHero(){
@ -504,6 +504,14 @@ public class DriedRose extends Artifact {
HT = 20 + 8*rose.level();
}
private int defendingPos = -1;
private boolean movingToDefendPos = false;
public void clearDefensingPos(){
defendingPos = -1;
movingToDefendPos = false;
}
@Override
protected boolean act() {
updateRose();

View File

@ -235,11 +235,11 @@ items.artifacts.driedrose$ghosthero.dialogue_prison_6=These people didn't have t
items.artifacts.driedrose$ghosthero.dialogue_caves_1=No human or dwarf has been here for a very long time.
items.artifacts.driedrose$ghosthero.dialogue_caves_2=What would cause the dwarves to abandon a gold mine?
items.artifacts.driedrose$ghosthero.dialogue_caves_3=It's a shame all the gold here is useless on the surface.
items.artifacts.driedrose$ghosthero.dialogue_caves_4=The creatures here are twisted, just like the sewers.
items.artifacts.driedrose$ghosthero.dialogue_caves_4=The creatures here are twisted, just like in the sewers.
items.artifacts.driedrose$ghosthero.dialogue_caves_5=Even the bats are bloodthirsty here.
items.artifacts.driedrose$ghosthero.dialogue_caves_6=We haven't seen any machinery, did the dwarves reclaim it all?
items.artifacts.driedrose$ghosthero.dialogue_city_1=The dwarves were industrious, but greedy.
items.artifacts.driedrose$ghosthero.dialogue_city_2=So the dwarvern metropolis really has fallen.
items.artifacts.driedrose$ghosthero.dialogue_city_2=So the dwarven metropolis really has fallen.
items.artifacts.driedrose$ghosthero.dialogue_city_3=I hope the surface never ends up like this place.
items.artifacts.driedrose$ghosthero.dialogue_city_4=Dwarves aren't supposed to look so pale.
items.artifacts.driedrose$ghosthero.dialogue_city_5=I don't know what's worse, the dwarves, or their creations.
@ -290,12 +290,12 @@ items.artifacts.driedrose$ghosthero.directed_attack_1=Okay, I'll attack that one
items.artifacts.driedrose$ghosthero.directed_attack_2=I'll get that one.
items.artifacts.driedrose$ghosthero.directed_attack_3=Engaging...
items.artifacts.driedrose$ghosthero.directed_attack_4=Let's get them!
items.artifacts.driedrose$ghosthero.directed_attack_5=TODO
items.artifacts.driedrose$ghosthero.directed_attack_5=I've got that one.
items.artifacts.driedrose$ghosthero.directed_position_1=Okay, I'll hold that position.
items.artifacts.driedrose$ghosthero.directed_position_2=I'll go there and defend.
items.artifacts.driedrose$ghosthero.directed_position_3=Repositioning...
items.artifacts.driedrose$ghosthero.directed_position_4=On my way!
items.artifacts.driedrose$ghosthero.directed_position_5=TODO
items.artifacts.driedrose$ghosthero.directed_position_5=I'll head over there.
items.artifacts.driedrose$ghosthero.desc=A frail looking ethereal figure with a humanoid shape. Their power seems tied to the rose you have.\n\nThis ghost may not be much, they seem to be your only true friend down here.