v1.4.0: improved targeting logic for armor abilities
This commit is contained in:
+6
@@ -21,9 +21,11 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
@@ -62,6 +64,10 @@ public abstract class ArmorAbility implements Bundlable {
|
|||||||
return targetingPrompt() != null;
|
return targetingPrompt() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int targetedPos( Char user, int dst ){
|
||||||
|
return new Ballistica( user.pos, dst, Ballistica.PROJECTILE ).collisionPos;
|
||||||
|
}
|
||||||
|
|
||||||
public float chargeUse( Hero hero ){
|
public float chargeUse( Hero hero ){
|
||||||
float chargeUse = baseChargeUse;
|
float chargeUse = baseChargeUse;
|
||||||
if (hero.hasTalent(Talent.HEROIC_ENERGY)){
|
if (hero.hasTalent(Talent.HEROIC_ENERGY)){
|
||||||
|
|||||||
+5
@@ -68,6 +68,11 @@ public class Ratmogrify extends ArmorAbility {
|
|||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int targetedPos(Char user, int dst) {
|
||||||
|
return dst;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void activate(ClassArmor armor, Hero hero, Integer target) {
|
protected void activate(ClassArmor armor, Hero hero, Integer target) {
|
||||||
|
|
||||||
|
|||||||
+5
@@ -70,6 +70,11 @@ public class WarpBeacon extends ArmorAbility {
|
|||||||
return super.targetingPrompt();
|
return super.targetingPrompt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int targetedPos(Char user, int dst) {
|
||||||
|
return dst;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void activate(ClassArmor armor, Hero hero, Integer target) {
|
protected void activate(ClassArmor armor, Hero hero, Integer target) {
|
||||||
if (target == null){
|
if (target == null){
|
||||||
|
|||||||
+7
-2
@@ -46,13 +46,18 @@ import com.watabou.utils.PathFinder;
|
|||||||
|
|
||||||
public class DeathMark extends ArmorAbility {
|
public class DeathMark extends ArmorAbility {
|
||||||
|
|
||||||
|
{
|
||||||
|
baseChargeUse = 25f;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String targetingPrompt() {
|
public String targetingPrompt() {
|
||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
@Override
|
||||||
baseChargeUse = 25f;
|
public int targetedPos(Char user, int dst) {
|
||||||
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+5
@@ -67,6 +67,11 @@ public class SmokeBomb extends ArmorAbility {
|
|||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean useTargeting() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float chargeUse(Hero hero) {
|
public float chargeUse(Hero hero) {
|
||||||
if (!hero.hasTalent(Talent.SHADOW_STEP) || hero.invisible <= 0){
|
if (!hero.hasTalent(Talent.SHADOW_STEP) || hero.invisible <= 0){
|
||||||
|
|||||||
+5
@@ -57,6 +57,11 @@ public class Shockwave extends ArmorAbility {
|
|||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int targetedPos(Char user, int dst) {
|
||||||
|
return new Ballistica( user.pos, dst, Ballistica.STOP_SOLID | Ballistica.STOP_TARGET ).collisionPos;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void activate(ClassArmor armor, Hero hero, Integer target) {
|
protected void activate(ClassArmor armor, Hero hero, Integer target) {
|
||||||
if (target == null){
|
if (target == null){
|
||||||
|
|||||||
+5
@@ -89,6 +89,11 @@ abstract public class ClassArmor extends Armor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int targetingPos(Hero user, int dst) {
|
||||||
|
return user.armorAbility.targetedPos(user, dst);
|
||||||
|
}
|
||||||
|
|
||||||
public static ClassArmor upgrade (Hero owner, Armor armor ) {
|
public static ClassArmor upgrade (Hero owner, Armor armor ) {
|
||||||
|
|
||||||
ClassArmor classArmor = null;
|
ClassArmor classArmor = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user