v1.4.2: fixed item buffs acting on-load if the hero has a partial turn

This commit is contained in:
Evan Debenham
2022-10-25 12:43:09 -04:00
parent 39ac31f145
commit 9bc40ebbb4
4 changed files with 39 additions and 7 deletions

View File

@@ -278,6 +278,17 @@ abstract public class ClassArmor extends Armor {
}
public class Charger extends Buff {
@Override
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);
return true;
}
return false;
}
@Override
public boolean act() {
LockedFloor lock = target.buff(LockedFloor.class);

View File

@@ -215,6 +215,16 @@ public class Artifact extends KindofMisc {
public class ArtifactBuff extends Buff {
@Override
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);
return true;
}
return false;
}
public int itemLevel() {
return level();
}

View File

@@ -339,12 +339,20 @@ public class Ring extends KindofMisc {
}
public class RingBuff extends Buff {
@Override
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);
return true;
}
return false;
}
@Override
public boolean act() {
spend( TICK );
return true;
}

View File

@@ -664,12 +664,15 @@ public abstract class Wand extends Item {
private static final float CHARGE_BUFF_BONUS = 0.25f;
float scalingFactor = NORMAL_SCALE_FACTOR;
@Override
public boolean attachTo( Char target ) {
super.attachTo( target );
return true;
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);
return true;
}
return false;
}
@Override