v3.0.0: fixed exploits involving juggling salt cube
This commit is contained in:
+17
@@ -87,6 +87,23 @@ public class Regeneration extends Buff {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//helper method for resetting the delay when salt cube buff changes, to counter exploits
|
||||||
|
public void resetDelay( SaltCube cube ){
|
||||||
|
ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class);
|
||||||
|
float delay = REGENERATION_DELAY;
|
||||||
|
if (regenBuff != null && target.buff(MagicImmune.class) == null) {
|
||||||
|
if (regenBuff.isCursed()) {
|
||||||
|
delay *= 1.5f;
|
||||||
|
} else {
|
||||||
|
//15% boost at +0, scaling to a 500% boost at +10
|
||||||
|
delay -= 1.33f + regenBuff.itemLevel()*0.667f;
|
||||||
|
delay /= RingOfEnergy.artifactChargeMultiplier(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delay /= SaltCube.healthRegenMultiplier(cube.level());
|
||||||
|
postpone( delay );
|
||||||
|
}
|
||||||
|
|
||||||
public int regencap(){
|
public int regencap(){
|
||||||
return target.HT;
|
return target.HT;
|
||||||
}
|
}
|
||||||
|
|||||||
+17
@@ -21,6 +21,10 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.trinkets;
|
package com.shatteredpixel.shatteredpixeldungeon.items.trinkets;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
|
||||||
@@ -36,6 +40,19 @@ public class SaltCube extends Trinket {
|
|||||||
return 6+2*level();
|
return 6+2*level();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDetach() {
|
||||||
|
//resets regen delay to counter exploits involving juggling the salt cube.
|
||||||
|
Buff.affect(Dungeon.hero, Regeneration.class).resetDelay(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doPickUp(Hero hero, int pos) {
|
||||||
|
//resets regen delay to counter exploits involving juggling the salt cube.
|
||||||
|
Buff.affect(Dungeon.hero, Regeneration.class).resetDelay(this);
|
||||||
|
return super.doPickUp(hero, pos);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String statsDesc() {
|
public String statsDesc() {
|
||||||
if (isIdentified()){
|
if (isIdentified()){
|
||||||
|
|||||||
Reference in New Issue
Block a user