v2.0.0: backup barrier now triggers before wand zaps resolve
This commit is contained in:
@@ -140,7 +140,7 @@ public abstract class Wand extends Item {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( curCharges >= (cursed ? 1 : chargesPerCast())){
|
||||
if ( curCharges >= chargesPerCast()){
|
||||
return true;
|
||||
} else {
|
||||
GLog.w(Messages.get(this, "fizzles"));
|
||||
@@ -421,34 +421,13 @@ public abstract class Wand extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
if (charger != null
|
||||
&& charger.target == Dungeon.hero){
|
||||
//If hero owns wand but it isn't in belongings it must be in the staff
|
||||
if (Dungeon.hero.hasTalent(Talent.EMPOWERED_STRIKE)
|
||||
&& charger != null && charger.target == Dungeon.hero
|
||||
&& !Dungeon.hero.belongings.contains(this)){
|
||||
|
||||
//if the wand is owned by the hero, but not in their inventory, it must be in the staff
|
||||
if (!Dungeon.hero.belongings.contains(this)) {
|
||||
if (curCharges == 0 && Dungeon.hero.hasTalent(Talent.BACKUP_BARRIER)) {
|
||||
//grants 3/5 shielding
|
||||
Buff.affect(Dungeon.hero, Barrier.class).setShield(1 + 2 * Dungeon.hero.pointsInTalent(Talent.BACKUP_BARRIER));
|
||||
}
|
||||
if (Dungeon.hero.hasTalent(Talent.EMPOWERED_STRIKE)) {
|
||||
Buff.prolong(Dungeon.hero, Talent.EmpoweredStrikeTracker.class, 10f);
|
||||
}
|
||||
Buff.prolong(Dungeon.hero, Talent.EmpoweredStrikeTracker.class, 10f);
|
||||
|
||||
//otherwise process logic for metamorphed backup barrier
|
||||
} else if (curCharges == 0
|
||||
&& Dungeon.hero.heroClass != HeroClass.MAGE
|
||||
&& Dungeon.hero.hasTalent(Talent.BACKUP_BARRIER)){
|
||||
boolean highest = true;
|
||||
for (Item i : Dungeon.hero.belongings.getAllItems(Wand.class)){
|
||||
if (i.level() > level()){
|
||||
highest = false;
|
||||
}
|
||||
}
|
||||
if (highest){
|
||||
//grants 3/5 shielding
|
||||
Buff.affect(Dungeon.hero, Barrier.class).setShield(1 + 2 * Dungeon.hero.pointsInTalent(Talent.BACKUP_BARRIER));
|
||||
}
|
||||
}
|
||||
}
|
||||
Invisibility.dispel();
|
||||
updateQuickslot();
|
||||
@@ -620,6 +599,32 @@ public abstract class Wand extends Item {
|
||||
if (curWand.tryToZap(curUser, target)) {
|
||||
|
||||
curUser.busy();
|
||||
|
||||
//backup barrier logic
|
||||
//This triggers before the wand zap, mostly so the barrier helps vs skeletons
|
||||
if (curUser.hasTalent(Talent.BACKUP_BARRIER)
|
||||
&& curWand.curCharges == curWand.chargesPerCast()
|
||||
&& curWand.charger != null && curWand.charger.target == curUser){
|
||||
|
||||
//regular. If hero owns wand but it isn't in belongings it must be in the staff
|
||||
if (curUser.heroClass == HeroClass.MAGE && !curUser.belongings.contains(curWand)){
|
||||
//grants 3/5 shielding
|
||||
Buff.affect(Dungeon.hero, Barrier.class).setShield(1 + 2 * Dungeon.hero.pointsInTalent(Talent.BACKUP_BARRIER));
|
||||
|
||||
//metamorphed. Triggers if wand is highest level hero has
|
||||
} else if (curUser.heroClass != HeroClass.MAGE) {
|
||||
boolean highest = true;
|
||||
for (Item i : curUser.belongings.getAllItems(Wand.class)){
|
||||
if (i.level() > curWand.level()){
|
||||
highest = false;
|
||||
}
|
||||
}
|
||||
if (highest){
|
||||
//grants 3/5 shielding
|
||||
Buff.affect(Dungeon.hero, Barrier.class).setShield(1 + 2 * Dungeon.hero.pointsInTalent(Talent.BACKUP_BARRIER));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (curWand.cursed){
|
||||
if (!curWand.cursedKnown){
|
||||
|
||||
@@ -190,7 +190,7 @@ public class WandOfFireblast extends DamageWand {
|
||||
|
||||
@Override
|
||||
protected int chargesPerCast() {
|
||||
if (charger != null && charger.target.buff(WildMagic.WildMagicTracker.class) != null){
|
||||
if (cursed || charger != null && charger.target.buff(WildMagic.WildMagicTracker.class) != null){
|
||||
return 1;
|
||||
}
|
||||
//consumes 30% of current charges, rounded up, with a min of 1 and a max of 3.
|
||||
|
||||
@@ -277,7 +277,7 @@ public class WandOfRegrowth extends Wand {
|
||||
|
||||
@Override
|
||||
protected int chargesPerCast() {
|
||||
if (charger != null && charger.target.buff(WildMagic.WildMagicTracker.class) != null){
|
||||
if (cursed || charger != null && charger.target.buff(WildMagic.WildMagicTracker.class) != null){
|
||||
return 1;
|
||||
}
|
||||
//consumes 30% of current charges, rounded up, with a min of 1 and a max of 3.
|
||||
|
||||
Reference in New Issue
Block a user