diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index 584976f39..1be800541 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -363,7 +363,9 @@ public class Dungeon { @SuppressWarnings("deprecation") public static void switchLevel( final Level level, int pos ) { - if (pos < 0 || pos >= level.length()){ + if (pos == -2){ + pos = level.exit; + } else if (pos < 0 || pos >= level.length()){ pos = level.entrance; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java index 163c0629f..b02e99ea1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java @@ -32,11 +32,12 @@ public class AdrenalineSurge extends Buff { } private int boost; - private static final float INTERVAL = TICK * 800f; + private float interval; - public void reset(){ - boost = 2; - spend(INTERVAL - cooldown()); + public void reset(int boost, float interval){ + this.boost = boost; + this.interval = interval; + spend(interval - cooldown()); } public int boost(){ @@ -47,7 +48,7 @@ public class AdrenalineSurge extends Buff { public boolean act() { boost --; if (boost > 0){ - spend( INTERVAL ); + spend( interval ); } else { detach(); } @@ -70,16 +71,24 @@ public class AdrenalineSurge extends Buff { } private static final String BOOST = "boost"; + private static final String INTERVAL = "interval"; @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); bundle.put( BOOST, boost ); + bundle.put( INTERVAL, interval ); } @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); boost = bundle.getInt( BOOST ); + //pre-0.7.1 + if (bundle.contains(INTERVAL)) { + interval = bundle.getFloat(INTERVAL); + } else { + interval = 800f; + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java index a4dcebd30..df392749b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java @@ -22,6 +22,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor.curses; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; @@ -48,7 +50,16 @@ public class Overgrowth extends Armor.Glyph { Plant p = s.couch(defender.pos, null); - p.activate(); + //momentarily revoke warden benefits, otherwise this curse would be incredibly powerful + if (defender instanceof Hero && ((Hero) defender).subClass == HeroSubClass.WARDEN){ + ((Hero) defender).subClass = HeroSubClass.NONE; + p.activate( defender ); + ((Hero) defender).subClass = HeroSubClass.WARDEN; + } else { + p.activate( defender ); + } + + CellEmitter.get( defender.pos ).burst( LeafParticle.LEVEL_SPECIFIC, 10 ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfAdrenalineSurge.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfAdrenalineSurge.java index 654ecc988..954c03281 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfAdrenalineSurge.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfAdrenalineSurge.java @@ -34,7 +34,7 @@ public class PotionOfAdrenalineSurge extends ExoticPotion { @Override public void apply(Hero hero) { setKnown(); - Buff.affect(hero, AdrenalineSurge.class).reset(); + Buff.affect(hero, AdrenalineSurge.class).reset(2, 800f); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java index 77684119d..b1aa72d94 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java @@ -300,7 +300,7 @@ public class WandOfRegrowth extends Wand { } @Override - public void activate() { + public void activate( Char ch ) { int nDrops = Random.NormalIntRange(3, 6); @@ -336,7 +336,7 @@ public class WandOfRegrowth extends Wand { } @Override - public void activate() { + public void activate( Char ch ) { int nSeeds = Random.NormalIntRange(2, 4); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/BlandfruitBush.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/BlandfruitBush.java index 11ee4459e..17c95b17b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/BlandfruitBush.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/BlandfruitBush.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -32,7 +33,7 @@ public class BlandfruitBush extends Plant { } @Override - public void activate() { + public void activate( Char ch ) { Dungeon.level.drop( new Blandfruit(), pos ).sprite.drop(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Blindweed.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Blindweed.java index dd59878bd..61e7dec2e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Blindweed.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Blindweed.java @@ -22,11 +22,13 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; @@ -40,16 +42,19 @@ public class Blindweed extends Plant { } @Override - public void activate() { - Char ch = Actor.findChar(pos); + public void activate( Char ch ) { if (ch != null) { - int len = Random.Int( 5, 10 ); - Buff.prolong( ch, Blindness.class, len ); - Buff.prolong( ch, Cripple.class, len ); - if (ch instanceof Mob) { - if (((Mob)ch).state == ((Mob)ch).HUNTING) ((Mob)ch).state = ((Mob)ch).WANDERING; - ((Mob)ch).beckon( Dungeon.level.randomDestination() ); + if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){ + Buff.affect(ch, Invisibility.class, 10f); + } else { + int len = Random.Int(5, 10); + Buff.prolong(ch, Blindness.class, len); + Buff.prolong(ch, Cripple.class, len); + if (ch instanceof Mob) { + if (((Mob) ch).state == ((Mob) ch).HUNTING) ((Mob) ch).state = ((Mob) ch).WANDERING; + ((Mob) ch).beckon(Dungeon.level.randomDestination()); + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Dreamfoil.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Dreamfoil.java index 26ff9c1ca..4de1eff88 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Dreamfoil.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Dreamfoil.java @@ -21,9 +21,9 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.BlobImmunity; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; @@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Slow; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -45,13 +46,12 @@ public class Dreamfoil extends Plant { } @Override - public void activate() { - Char ch = Actor.findChar(pos); + public void activate( Char ch ) { if (ch != null) { - if (ch instanceof Mob) + if (ch instanceof Mob) { Buff.affect(ch, MagicalSleep.class); - else if (ch instanceof Hero){ + } else if (ch instanceof Hero){ GLog.i( Messages.get(this, "refreshed") ); Buff.detach( ch, Poison.class ); Buff.detach( ch, Cripple.class ); @@ -60,6 +60,11 @@ public class Dreamfoil extends Plant { Buff.detach( ch, Drowsy.class ); Buff.detach( ch, Slow.class ); Buff.detach( ch, Vertigo.class); + + if (((Hero) ch).subClass == HeroSubClass.WARDEN){ + Buff.affect(ch, BlobImmunity.class, 10f); + } + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java index e8399bf82..fc817d0a9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java @@ -22,10 +22,11 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EarthParticle; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -42,11 +43,14 @@ public class Earthroot extends Plant { } @Override - public void activate() { - Char ch = Actor.findChar(pos); + public void activate( Char ch ) { if (ch == Dungeon.hero) { - Buff.affect( ch, Armor.class ).level(ch.HT); + if (Dungeon.hero.subClass == HeroSubClass.WARDEN){ + Buff.affect(ch, Barkskin.class).set((Dungeon.depth + 5)/2, 5); + } else { + Buff.affect(ch, Armor.class).level(ch.HT); + } } if (Dungeon.level.heroFOV[pos]) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java index 898801134..eef32fba4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java @@ -22,14 +22,20 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.watabou.noosa.Game; public class Fadeleaf extends Plant { @@ -38,14 +44,32 @@ public class Fadeleaf extends Plant { } @Override - public void activate() { - Char ch = Actor.findChar(pos); + public void activate( final Char ch ) { if (ch instanceof Hero) { - ScrollOfTeleportation.teleportHero( (Hero)ch ); ((Hero)ch).curAction = null; + if (((Hero) ch).subClass == HeroSubClass.WARDEN){ + + if (Dungeon.bossLevel()) { + GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") ); + return; + + } + + Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class); + if (buff != null) buff.detach(); + + InterlevelScene.mode = InterlevelScene.Mode.RETURN; + InterlevelScene.returnDepth = Math.max(1, (Dungeon.depth - 1)); + InterlevelScene.returnPos = -2; + Game.switchScene( InterlevelScene.class ); + + } else { + ScrollOfTeleportation.teleportHero((Hero) ch); + } + } else if (ch instanceof Mob && !ch.properties().contains(Char.Property.IMMOVABLE)) { int count = 10; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Firebloom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Firebloom.java index df422abb5..148aea929 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Firebloom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Firebloom.java @@ -22,8 +22,13 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FireImbue; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -36,7 +41,11 @@ public class Firebloom extends Plant { } @Override - public void activate() { + public void activate( Char ch ) { + + if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){ + Buff.affect(ch, FireImbue.class).set(15f); + } GameScene.add( Blob.seed( pos, 2, Fire.class ) ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java index 1ab8cf863..4294a29a8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java @@ -22,8 +22,13 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FrostImbue; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.watabou.utils.PathFinder; @@ -35,7 +40,11 @@ public class Icecap extends Plant { } @Override - public void activate() { + public void activate( Char ch ) { + + if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){ + Buff.affect(ch, FrostImbue.class, 15f); + } PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.losBlocking, null ), 1 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java index 17162968d..6346d5c99 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java @@ -60,10 +60,10 @@ public abstract class Plant implements Bundlable { } wither(); - activate(); + activate( ch ); } - public abstract void activate(); + public abstract void activate( Char ch ); public void wither() { Dungeon.level.uproot( pos ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java index 758d45e2f..8c8d34b76 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java @@ -22,6 +22,11 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AdrenalineSurge; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -33,7 +38,11 @@ public class Rotberry extends Plant { } @Override - public void activate() { + public void activate( Char ch ) { + if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){ + Buff.affect(ch, AdrenalineSurge.class).reset(1, 200f); + } + Dungeon.level.drop( new Seed(), pos ).sprite.drop(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sorrowmoss.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sorrowmoss.java index 7ec0e5407..76c92afb6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sorrowmoss.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sorrowmoss.java @@ -22,10 +22,12 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ToxicImbue; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PoisonParticle; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -37,8 +39,10 @@ public class Sorrowmoss extends Plant { } @Override - public void activate() { - Char ch = Actor.findChar(pos); + public void activate( Char ch ) { + if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){ + Buff.affect(ch, ToxicImbue.class).set(15f); + } if (ch != null) { Buff.affect( ch, Poison.class ).set( 4 + Dungeon.depth / 2 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Starflower.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Starflower.java index 862b0b6c9..3fd3ac5b3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Starflower.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Starflower.java @@ -22,10 +22,12 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bless; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.utils.Random; @@ -36,10 +38,14 @@ public class Starflower extends Plant { } @Override - public void activate() { - Char ch = Actor.findChar(pos); + public void activate( Char ch ) { - if (ch != null) Buff.prolong(ch, Bless.class, Bless.DURATION); + if (ch != null) { + Buff.prolong(ch, Bless.class, Bless.DURATION); + if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){ + Buff.prolong(ch, Recharging.class, Bless.DURATION); + } + } if (Random.Int(5) == 0){ Dungeon.level.drop(new Seed(), pos).sprite.drop(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Stormvine.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Stormvine.java index d2615e31f..4e1f64a24 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Stormvine.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Stormvine.java @@ -21,10 +21,12 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Levitation; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class Stormvine extends Plant { @@ -34,11 +36,14 @@ public class Stormvine extends Plant { } @Override - public void activate() { - Char ch = Actor.findChar(pos); + public void activate( Char ch ) { if (ch != null) { - Buff.affect(ch, Vertigo.class, Vertigo.DURATION ); + if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){ + Buff.affect(ch, Levitation.class, 10f); + } else { + Buff.affect(ch, Vertigo.class, Vertigo.DURATION); + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java index 2b29a4b3e..26721ecd9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java @@ -22,11 +22,12 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Healing; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle; @@ -43,11 +44,14 @@ public class Sungrass extends Plant { } @Override - public void activate() { - Char ch = Actor.findChar(pos); + public void activate( Char ch ) { if (ch == Dungeon.hero) { - Buff.affect( ch, Health.class ).boost(ch.HT); + if (Dungeon.hero.subClass == HeroSubClass.WARDEN) { + Buff.affect(ch, Healing.class).setHeal(ch.HT, 0, 1); + } else { + Buff.affect(ch, Health.class).boost(ch.HT); + } } if (Dungeon.level.heroFOV[pos]) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java index fe5657edf..ef3b65cc6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java @@ -22,10 +22,11 @@ package com.shatteredpixel.shatteredpixeldungeon.plants; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -39,10 +40,12 @@ public class Swiftthistle extends Plant { } @Override - public void activate() { - Char ch = Actor.findChar(pos); + public void activate( Char ch ) { if (ch == Dungeon.hero) { Buff.affect(ch, TimeBubble.class).reset(); + if (Dungeon.hero.subClass == HeroSubClass.WARDEN){ + Buff.affect(ch, Haste.class, 5f); + } } }