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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( curCharges >= (cursed ? 1 : chargesPerCast())){
|
if ( curCharges >= chargesPerCast()){
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
GLog.w(Messages.get(this, "fizzles"));
|
GLog.w(Messages.get(this, "fizzles"));
|
||||||
@@ -421,34 +421,13 @@ public abstract class Wand extends Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (charger != null
|
//If hero owns wand but it isn't in belongings it must be in the staff
|
||||||
&& charger.target == Dungeon.hero){
|
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
|
Buff.prolong(Dungeon.hero, Talent.EmpoweredStrikeTracker.class, 10f);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
//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();
|
Invisibility.dispel();
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
@@ -621,6 +600,32 @@ public abstract class Wand extends Item {
|
|||||||
|
|
||||||
curUser.busy();
|
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.cursed){
|
||||||
if (!curWand.cursedKnown){
|
if (!curWand.cursedKnown){
|
||||||
GLog.n(Messages.get(Wand.class, "curse_discover", curWand.name()));
|
GLog.n(Messages.get(Wand.class, "curse_discover", curWand.name()));
|
||||||
|
|||||||
+1
-1
@@ -190,7 +190,7 @@ public class WandOfFireblast extends DamageWand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int chargesPerCast() {
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
//consumes 30% of current charges, rounded up, with a min of 1 and a max of 3.
|
//consumes 30% of current charges, rounded up, with a min of 1 and a max of 3.
|
||||||
|
|||||||
+1
-1
@@ -277,7 +277,7 @@ public class WandOfRegrowth extends Wand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int chargesPerCast() {
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
//consumes 30% of current charges, rounded up, with a min of 1 and a max of 3.
|
//consumes 30% of current charges, rounded up, with a min of 1 and a max of 3.
|
||||||
|
|||||||
Reference in New Issue
Block a user