V0.2.0: Implemented Ring of Tenacity
This commit is contained in:
parent
2ad10e7168
commit
110631ea77
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfForce;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfForce;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfTenacity;
|
||||||
import com.watabou.noosa.Camera;
|
import com.watabou.noosa.Camera;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
@ -831,6 +832,15 @@ public class Hero extends Char {
|
||||||
Buff.detach(this, Drowsy.class);
|
Buff.detach(this, Drowsy.class);
|
||||||
GLog.w("The pain helps you resist the urge to sleep.");
|
GLog.w("The pain helps you resist the urge to sleep.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int tenacity = 0;
|
||||||
|
for (Buff buff : buffs(RingOfTenacity.Tenacity.class)) {
|
||||||
|
tenacity += ((RingOfTenacity.Tenacity)buff).level;
|
||||||
|
}
|
||||||
|
//TODO: test if this works
|
||||||
|
if (tenacity != 0) //(HT - HP)/HT = heroes current % missing health.
|
||||||
|
dmg *= Math.pow(0.9, tenacity*((float)(HT - HP)/HT));
|
||||||
|
|
||||||
super.damage( dmg, src );
|
super.damage( dmg, src );
|
||||||
|
|
||||||
if (subClass == HeroSubClass.BERSERKER && 0 < HP && HP <= HT * Fury.LEVEL) {
|
if (subClass == HeroSubClass.BERSERKER && 0 < HP && HP <= HT * Fury.LEVEL) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
|
||||||
* Created by debenhame on 10/09/2014.
|
* Created by debenhame on 10/09/2014.
|
||||||
*/
|
*/
|
||||||
public class RingOfTenacity extends Ring {
|
public class RingOfTenacity extends Ring {
|
||||||
//TODO: tie this into game logic
|
//TODO: testing, numbers tweaking
|
||||||
{
|
{
|
||||||
name = "Ring of Tenacity";
|
name = "Ring of Tenacity";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user