v0.4.0: lots of refactoring to on-upgrade logic

This commit is contained in:
Evan Debenham
2016-06-14 23:07:32 -04:00
committed by Evan Debenham
parent 9f65ff4e5b
commit 4c8bcade38
9 changed files with 121 additions and 89 deletions
@@ -127,28 +127,6 @@ public class Ring extends KindofMisc {
}
}
@Override
public Item upgrade() {
if (cursed && cursedKnown) {
GLog.p( Messages.get(Item.class, "weaken_curse") );
Dungeon.hero.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 );
}
super.upgrade();
if (buff != null) {
Char owner = buff.target;
buff.detach();
if ((buff = buff()) != null) {
buff.attachTo( owner );
}
}
return this;
}
public boolean isKnown() {
return handler.isKnown( this );
}
@@ -263,11 +241,6 @@ public class Ring extends KindofMisc {
public class RingBuff extends Buff {
public int level;
public RingBuff() {
level = Ring.this.level();
}
@Override
public boolean attachTo( Char target ) {
@@ -284,7 +257,6 @@ public class Ring extends KindofMisc {
public boolean act() {
if (!isIdentified() && --ticksToKnow <= 0) {
String gemName = name();
identify();
GLog.w( Messages.get(Ring.class, "identify", Ring.this.toString()) );
Badges.validateItemLevelAquired( Ring.this );
@@ -294,5 +266,9 @@ public class Ring extends KindofMisc {
return true;
}
public int level(){
return Ring.this.level();
}
}
}