v0.9.1: improved quickslot targeting logic in edge cases
This commit is contained in:
parent
22036628d3
commit
fc319ad420
|
@ -509,6 +509,10 @@ public class Item implements Bundlable {
|
|||
}
|
||||
}
|
||||
|
||||
public int targetingPos( Hero user, int dst ){
|
||||
return throwPos( user, dst );
|
||||
}
|
||||
|
||||
public int throwPos( Hero user, int dst){
|
||||
return new Ballistica( user.pos, dst, Ballistica.PROJECTILE ).collisionPos;
|
||||
}
|
||||
|
|
|
@ -107,7 +107,12 @@ public abstract class Wand extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
protected abstract void onZap( Ballistica attack );
|
||||
@Override
|
||||
public int targetingPos(Hero user, int dst) {
|
||||
return new Ballistica( user.pos, dst, collisionProperties ).collisionPos;
|
||||
}
|
||||
|
||||
protected abstract void onZap(Ballistica attack );
|
||||
|
||||
public abstract void onHit( MagesStaff staff, Char attacker, Char defender, int damage);
|
||||
|
||||
|
|
|
@ -144,6 +144,11 @@ public class SpiritBow extends Weapon {
|
|||
+ (curseInfusionBonus ? 2 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int targetingPos(Hero user, int dst) {
|
||||
return knockArrow().targetingPos(user, dst);
|
||||
}
|
||||
|
||||
private int targetPos;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -233,7 +233,7 @@ public class QuickSlotButton extends Button implements WndBag.Listener {
|
|||
public static int autoAim(Char target, Item item){
|
||||
|
||||
//first try to directly target
|
||||
if (item.throwPos(Dungeon.hero, target.pos) == target.pos) {
|
||||
if (item.targetingPos(Dungeon.hero, target.pos) == target.pos) {
|
||||
return target.pos;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user