From 902b2a096f35d00d0d0c41bbc8d802e6eb0b5698 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 11 Sep 2014 11:13:25 -0400 Subject: [PATCH] V0.2.0: Implemented Ring of Might --- .../items/rings/RingOfMight.java | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java index d125544c6..3f5198c9f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java @@ -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; + } + } } }