V0.2.0: minor bugfix in sungrass.

This commit is contained in:
Evan Debenham 2014-08-28 09:54:27 -04:00
parent 871e00f597
commit 605ec62223

View File

@ -90,11 +90,11 @@ public class Sungrass extends Plant {
@Override @Override
public boolean act() { public boolean act() {
if (target.pos != pos || level <= 0) { if (target.pos != pos) {
detach(); detach();
} }
if (count == 5) { if (count == 5) {
if (level <= healCurr) { if (level <= healCurr*.025*target.HT) {
target.HP = Math.min(target.HT, target.HP + level); target.HP = Math.min(target.HT, target.HP + level);
target.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); target.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);
detach(); detach();
@ -109,6 +109,8 @@ public class Sungrass extends Plant {
} else { } else {
count++; count++;
} }
if (level <= 0)
detach();
spend( STEP ); spend( STEP );
return true; return true;
} }