v0.3.0c: refactored plants to match the structure of new traps.
This commit is contained in:
@@ -19,6 +19,7 @@ package com.shatteredpixel.shatteredpixeldungeon.plants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
@@ -41,7 +42,7 @@ import com.watabou.utils.Bundlable;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class Plant implements Bundlable {
|
||||
public abstract class Plant implements Bundlable {
|
||||
|
||||
public String plantName;
|
||||
|
||||
@@ -49,16 +50,21 @@ public class Plant implements Bundlable {
|
||||
public int pos;
|
||||
|
||||
public PlantSprite sprite;
|
||||
|
||||
public void activate( Char ch ) {
|
||||
|
||||
|
||||
public void trigger(){
|
||||
|
||||
Char ch = Actor.findChar(pos);
|
||||
|
||||
if (ch instanceof Hero && ((Hero)ch).subClass == HeroSubClass.WARDEN) {
|
||||
Buff.affect( ch, Barkskin.class ).level( ch.HT / 3 );
|
||||
}
|
||||
|
||||
|
||||
activate();
|
||||
wither();
|
||||
}
|
||||
|
||||
public abstract void activate();
|
||||
|
||||
public void wither() {
|
||||
Dungeon.level.uproot( pos );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user