v2.0.0: fixed load delay on non-static buffs rarely triggering incorrectly

This commit is contained in:
Evan Debenham
2022-11-29 12:27:05 -05:00
parent 613f4c850b
commit 5cefa3712a
4 changed files with 12 additions and 4 deletions

View File

@@ -292,7 +292,9 @@ abstract public class ClassArmor extends Armor {
public boolean attachTo( Char target ) {
if (super.attachTo( target )) {
//if we're loading in and the hero has partially spent a turn, delay for 1 turn
if (now() == 0 && cooldown() == 0 && target.cooldown() > 0) spend(TICK);
if (target instanceof Hero && Dungeon.hero == null && cooldown() == 0 && target.cooldown() > 0) {
spend(TICK);
}
return true;
}
return false;

View File

@@ -220,7 +220,9 @@ public class Artifact extends KindofMisc {
public boolean attachTo( Char target ) {
if (super.attachTo( target )) {
//if we're loading in and the hero has partially spent a turn, delay for 1 turn
if (now() == 0 && cooldown() == 0 && target.cooldown() > 0) spend(TICK);
if (target instanceof Hero && Dungeon.hero == null && cooldown() == 0 && target.cooldown() > 0) {
spend(TICK);
}
return true;
}
return false;

View File

@@ -344,7 +344,9 @@ public class Ring extends KindofMisc {
public boolean attachTo( Char target ) {
if (super.attachTo( target )) {
//if we're loading in and the hero has partially spent a turn, delay for 1 turn
if (now() == 0 && cooldown() == 0 && target.cooldown() > 0) spend(TICK);
if (target instanceof Hero && Dungeon.hero == null && cooldown() == 0 && target.cooldown() > 0) {
spend(TICK);
}
return true;
}
return false;

View File

@@ -680,7 +680,9 @@ public abstract class Wand extends Item {
public boolean attachTo( Char target ) {
if (super.attachTo( target )) {
//if we're loading in and the hero has partially spent a turn, delay for 1 turn
if (now() == 0 && cooldown() == 0 && target.cooldown() > 0) spend(TICK);
if (target instanceof Hero && Dungeon.hero == null && cooldown() == 0 && target.cooldown() > 0) {
spend(TICK);
}
return true;
}
return false;