v0.9.3: added targeting logic to abilities, fixed a few not using charge
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ public abstract class ArmorAbility implements Bundlable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//leave null for no targeting
|
//leave null for no targeting
|
||||||
protected String targetingPrompt(){
|
public String targetingPrompt(){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -10,7 +10,6 @@ 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.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Rat;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Rat;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||||
@@ -34,7 +33,7 @@ public class Ratmogrify extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String targetingPrompt() {
|
public String targetingPrompt() {
|
||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -48,6 +48,9 @@ public class NaturesPower extends ArmorAbility {
|
|||||||
hero.sprite.operate(hero.pos);
|
hero.sprite.operate(hero.pos);
|
||||||
Sample.INSTANCE.play(Assets.Sounds.CHARGEUP);
|
Sample.INSTANCE.play(Assets.Sounds.CHARGEUP);
|
||||||
hero.sprite.emitter().burst(LeafParticle.GENERAL, 10);
|
hero.sprite.emitter().burst(LeafParticle.GENERAL, 10);
|
||||||
|
|
||||||
|
armor.charge -= chargeUse(hero);
|
||||||
|
armor.updateQuickslot();
|
||||||
hero.spendAndNext(Actor.TICK);
|
hero.spendAndNext(Actor.TICK);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -90,7 +93,5 @@ public class NaturesPower extends ArmorAbility {
|
|||||||
return Messages.get(this, "desc", dispTurns(visualcooldown()));
|
return Messages.get(this, "desc", dispTurns(visualcooldown()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO name/desc
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
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;
|
||||||
@@ -49,7 +48,7 @@ public class SpectralBlades extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String targetingPrompt() {
|
public String targetingPrompt() {
|
||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -123,9 +123,6 @@ public class ElementalBlast extends ArmorAbility {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void activate(ClassArmor armor, Hero hero, Integer target) {
|
protected void activate(ClassArmor armor, Hero hero, Integer target) {
|
||||||
armor.charge -= chargeUse(hero);
|
|
||||||
Item.updateQuickslot();
|
|
||||||
|
|
||||||
Ballistica aim;
|
Ballistica aim;
|
||||||
//Basically the direction of the aim only matters if it goes outside the map
|
//Basically the direction of the aim only matters if it goes outside the map
|
||||||
//So we just ensure it won't do that.
|
//So we just ensure it won't do that.
|
||||||
@@ -141,7 +138,6 @@ public class ElementalBlast extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (wandCls == null){
|
if (wandCls == null){
|
||||||
//TODO
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,6 +393,9 @@ public class ElementalBlast extends ArmorAbility {
|
|||||||
Invisibility.dispel();
|
Invisibility.dispel();
|
||||||
hero.busy();
|
hero.busy();
|
||||||
|
|
||||||
|
armor.charge -= chargeUse(hero);
|
||||||
|
armor.updateQuickslot();
|
||||||
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.CHARGEUP );
|
Sample.INSTANCE.play( Assets.Sounds.CHARGEUP );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -34,7 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.EtherealChains;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
@@ -61,7 +60,7 @@ public class WarpBeacon extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String targetingPrompt() {
|
public String targetingPrompt() {
|
||||||
if (Dungeon.hero.buff(WarpBeaconTracker.class) == null
|
if (Dungeon.hero.buff(WarpBeaconTracker.class) == null
|
||||||
&& Dungeon.hero.hasTalent(Talent.REMOTE_BEACON)){
|
&& Dungeon.hero.hasTalent(Talent.REMOTE_BEACON)){
|
||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
@@ -106,6 +105,9 @@ public class WarpBeacon extends ArmorAbility {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
armor.charge -= chargeNeeded;
|
||||||
|
armor.updateQuickslot();
|
||||||
|
|
||||||
if (tracker.depth == Dungeon.depth){
|
if (tracker.depth == Dungeon.depth){
|
||||||
Char existing = Actor.findChar(tracker.pos);
|
Char existing = Actor.findChar(tracker.pos);
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -46,7 +46,7 @@ public class WildMagic extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String targetingPrompt() {
|
public String targetingPrompt() {
|
||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +99,9 @@ public class WildMagic extends ArmorAbility {
|
|||||||
|
|
||||||
Buff.affect(hero, WildMagicTracker.class, 0f);
|
Buff.affect(hero, WildMagicTracker.class, 0f);
|
||||||
|
|
||||||
|
armor.charge -= chargeUse(hero);
|
||||||
|
armor.updateQuickslot();
|
||||||
|
|
||||||
zapWand(wands, hero, target);
|
zapWand(wands, hero, target);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ import com.watabou.utils.Bundle;
|
|||||||
public class DeathMark extends ArmorAbility {
|
public class DeathMark extends ArmorAbility {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String targetingPrompt() {
|
public String targetingPrompt() {
|
||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ import com.watabou.utils.Random;
|
|||||||
public class SmokeBomb extends ArmorAbility {
|
public class SmokeBomb extends ArmorAbility {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String targetingPrompt() {
|
public String targetingPrompt() {
|
||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-1
@@ -62,7 +62,6 @@ public class Endure extends ArmorAbility {
|
|||||||
hero.spendAndNext(3f);
|
hero.spendAndNext(3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO visual buff stuff
|
|
||||||
public static class EndureTracker extends FlavourBuff {
|
public static class EndureTracker extends FlavourBuff {
|
||||||
|
|
||||||
public boolean enduring;
|
public boolean enduring;
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class HeroicLeap extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String targetingPrompt() {
|
public String targetingPrompt() {
|
||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ public class Shockwave extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String targetingPrompt() {
|
public String targetingPrompt() {
|
||||||
return Messages.get(this, "prompt");
|
return Messages.get(this, "prompt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -170,6 +170,7 @@ abstract public class ClassArmor extends Armor {
|
|||||||
} else if (charge < hero.armorAbility.chargeUse(hero)) {
|
} else if (charge < hero.armorAbility.chargeUse(hero)) {
|
||||||
GLog.w( Messages.get(this, "low_charge") );
|
GLog.w( Messages.get(this, "low_charge") );
|
||||||
} else {
|
} else {
|
||||||
|
usesTargeting = hero.armorAbility.targetingPrompt() != null;
|
||||||
hero.armorAbility.use(this, hero);
|
hero.armorAbility.use(this, hero);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user