V0.2.0: Implemented Ring of Might

This commit is contained in:
Evan Debenham 2014-09-11 11:13:25 -04:00
parent cbb7d8b130
commit 902b2a096f

View File

@ -1,10 +1,14 @@
package com.shatteredpixel.shatteredpixeldungeon.items.rings;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
/**
* Created by debenhame on 10/09/2014.
*/
public class RingOfMight extends Ring {
//TODO: tie this into game logic
//TODO: test this, numbers tweaking
//specifically, make sure this works with levelling up the ring
{
name = "Ring of Might";
}
@ -24,6 +28,28 @@ public class RingOfMight extends Ring {
}
public class Might extends RingBuff {
@Override
public boolean attachTo( Char target ) {
if (target instanceof Hero){
((Hero) target).STR += level;
}
if (level > 0){
target.HT += level*5;
}
return super.attachTo(target);
}
@Override
public void detach(){
if (target instanceof Hero){
((Hero) target).STR -= level;
}
if (level > 0){
target.HT -= level*5;
}
}
}
}