diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 333504508..50d9699ef 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,7 +2,7 @@ diff --git a/src/com/watabou/pixeldungeon/actors/hero/Hero.java b/src/com/watabou/pixeldungeon/actors/hero/Hero.java index daf8d5740..5520ab3df 100644 --- a/src/com/watabou/pixeldungeon/actors/hero/Hero.java +++ b/src/com/watabou/pixeldungeon/actors/hero/Hero.java @@ -86,6 +86,7 @@ import com.watabou.pixeldungeon.levels.Terrain; import com.watabou.pixeldungeon.levels.features.AlchemyPot; import com.watabou.pixeldungeon.levels.features.Chasm; import com.watabou.pixeldungeon.plants.Earthroot; +import com.watabou.pixeldungeon.plants.Sungrass; import com.watabou.pixeldungeon.scenes.GameScene; import com.watabou.pixeldungeon.scenes.InterlevelScene; import com.watabou.pixeldungeon.scenes.SurfaceScene; @@ -804,6 +805,11 @@ public class Hero extends Char { if (armor != null) { damage = armor.absorb( damage ); } + + Sungrass.Health health = buff( Sungrass.Health.class ); + if (health != null) { + health.absorb( damage ); + } if (belongings.armor != null) { damage = belongings.armor.proc( enemy, this, damage ); diff --git a/src/com/watabou/pixeldungeon/items/Generator.java b/src/com/watabou/pixeldungeon/items/Generator.java index 31df0d671..c465b7a95 100644 --- a/src/com/watabou/pixeldungeon/items/Generator.java +++ b/src/com/watabou/pixeldungeon/items/Generator.java @@ -87,7 +87,7 @@ public class Generator { ScrollOfUpgrade.class, ScrollOfRecharging.class, ScrollOfMagicMapping.class, - ScrollOfChallenge.class, + ScrollOfRage.class, ScrollOfTerror.class, ScrollOfLullaby.class, ScrollOfWeaponUpgrade.class, diff --git a/src/com/watabou/pixeldungeon/items/scrolls/Scroll.java b/src/com/watabou/pixeldungeon/items/scrolls/Scroll.java index 711dac28d..e069ead2f 100644 --- a/src/com/watabou/pixeldungeon/items/scrolls/Scroll.java +++ b/src/com/watabou/pixeldungeon/items/scrolls/Scroll.java @@ -44,7 +44,7 @@ public abstract class Scroll extends Item { ScrollOfRemoveCurse.class, ScrollOfTeleportation.class, ScrollOfUpgrade.class, - ScrollOfChallenge.class, + ScrollOfRage.class, ScrollOfTerror.class, ScrollOfLullaby.class, ScrollOfWeaponUpgrade.class, diff --git a/src/com/watabou/pixeldungeon/items/scrolls/ScrollOfChallenge.java b/src/com/watabou/pixeldungeon/items/scrolls/ScrollOfRage.java similarity index 69% rename from src/com/watabou/pixeldungeon/items/scrolls/ScrollOfChallenge.java rename to src/com/watabou/pixeldungeon/items/scrolls/ScrollOfRage.java index b15446ed0..faad2c773 100644 --- a/src/com/watabou/pixeldungeon/items/scrolls/ScrollOfChallenge.java +++ b/src/com/watabou/pixeldungeon/items/scrolls/ScrollOfRage.java @@ -20,25 +20,30 @@ package com.watabou.pixeldungeon.items.scrolls; import com.watabou.noosa.audio.Sample; import com.watabou.pixeldungeon.Assets; import com.watabou.pixeldungeon.Dungeon; +import com.watabou.pixeldungeon.actors.buffs.Amok; +import com.watabou.pixeldungeon.actors.buffs.Buff; import com.watabou.pixeldungeon.actors.buffs.Invisibility; import com.watabou.pixeldungeon.actors.mobs.Mob; import com.watabou.pixeldungeon.effects.Speck; import com.watabou.pixeldungeon.utils.GLog; -public class ScrollOfChallenge extends Scroll { +public class ScrollOfRage extends Scroll { { - name = "Scroll of Challenge"; + name = "Scroll of Rage"; } @Override protected void doRead() { + + for (Mob mob : Dungeon.level.mobs) { + mob.beckon( curUser.pos ); + if (Dungeon.level.fieldOfView[mob.pos]) { + Buff.prolong(mob, Amok.class, 5f); + } + } - for (Mob mob : Dungeon.level.mobs) { - mob.beckon( curUser.pos ); - } - - GLog.w( "The scroll emits a challenging roar that echoes throughout the dungeon!" ); + GLog.w( "The scroll emits an enraging roar that echoes throughout the dungeon!" ); setKnown(); curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); @@ -51,7 +56,7 @@ public class ScrollOfChallenge extends Scroll { @Override public String desc() { return - "When read aloud, this scroll will unleash a challenging roar " + - "that will awaken all monsters and alert them to the reader's location."; + "When read aloud, this scroll will unleash a great roar " + + "that draws all enemies to the reader, and enrages nearby ones."; } } diff --git a/src/com/watabou/pixeldungeon/plants/Blindweed.java b/src/com/watabou/pixeldungeon/plants/Blindweed.java index 0e3f80605..564464811 100644 --- a/src/com/watabou/pixeldungeon/plants/Blindweed.java +++ b/src/com/watabou/pixeldungeon/plants/Blindweed.java @@ -20,6 +20,7 @@ package com.watabou.pixeldungeon.plants; import com.watabou.pixeldungeon.Dungeon; import com.watabou.pixeldungeon.actors.Char; import com.watabou.pixeldungeon.actors.buffs.Blindness; +import com.watabou.pixeldungeon.actors.buffs.Cripple; import com.watabou.pixeldungeon.actors.buffs.Buff; import com.watabou.pixeldungeon.actors.mobs.Mob; import com.watabou.pixeldungeon.actors.mobs.Mob.State; @@ -32,7 +33,8 @@ import com.watabou.utils.Random; public class Blindweed extends Plant { private static final String TXT_DESC = - "Upon touching a Blindweed it perishes in a blinding flash of light."; + "Upon being touched a Blindweed perishes in a bright flash of light." + + "The flash is strong enough to disorient for several seconds."; { image = 3; @@ -44,7 +46,9 @@ public class Blindweed extends Plant { super.activate( ch ); if (ch != null) { - Buff.prolong( ch, Blindness.class, Random.Int( 5, 10 ) ); + int len = Random.Int( 5, 10 ); + Buff.prolong( ch, Blindness.class, len ); + Buff.prolong( ch, Cripple.class, len ); if (ch instanceof Mob) { ((Mob)ch).state = State.WANDERING; ((Mob)ch).beckon( Dungeon.level.randomDestination() ); diff --git a/src/com/watabou/pixeldungeon/plants/Earthroot.java b/src/com/watabou/pixeldungeon/plants/Earthroot.java index 400614ebc..95e64bbb8 100644 --- a/src/com/watabou/pixeldungeon/plants/Earthroot.java +++ b/src/com/watabou/pixeldungeon/plants/Earthroot.java @@ -26,13 +26,14 @@ import com.watabou.pixeldungeon.effects.particles.EarthParticle; import com.watabou.pixeldungeon.items.potions.PotionOfParalyticGas; import com.watabou.pixeldungeon.sprites.ItemSpriteSheet; import com.watabou.pixeldungeon.ui.BuffIndicator; +import com.watabou.pixeldungeon.utils.Utils; import com.watabou.utils.Bundle; public class Earthroot extends Plant { private static final String TXT_DESC = "When a creature touches an Earthroot, its roots " + - "create a kind of natural armor around it."; + "create a kind of immobile natural armor around it."; { image = 5; @@ -49,7 +50,7 @@ public class Earthroot extends Plant { if (Dungeon.visible[pos]) { CellEmitter.bottom( pos ).start( EarthParticle.FACTORY, 0.05f, 8 ); - Camera.main.shake( 1, 0.4f ); + Camera.main.shake( 0.25f, 1f ); } } @@ -98,12 +99,12 @@ public class Earthroot extends Plant { } public int absorb( int damage ) { - if (damage >= level) { + if (damage*2 >= level) { detach(); return damage - level; } else { - level -= damage; - return 0; + level -= damage-damage/2; + return damage/2; } } @@ -120,7 +121,7 @@ public class Earthroot extends Plant { @Override public String toString() { - return "Herbal armor"; + return Utils.format("Herbal armor (%d)", level); } private static final String POS = "pos"; diff --git a/src/com/watabou/pixeldungeon/plants/Sungrass.java b/src/com/watabou/pixeldungeon/plants/Sungrass.java index c1a1e82ab..81264f56c 100644 --- a/src/com/watabou/pixeldungeon/plants/Sungrass.java +++ b/src/com/watabou/pixeldungeon/plants/Sungrass.java @@ -26,6 +26,7 @@ import com.watabou.pixeldungeon.effects.particles.ShaftParticle; import com.watabou.pixeldungeon.items.potions.PotionOfHealing; import com.watabou.pixeldungeon.sprites.ItemSpriteSheet; import com.watabou.pixeldungeon.ui.BuffIndicator; +import com.watabou.pixeldungeon.utils.Utils; import com.watabou.utils.Bundle; public class Sungrass extends Plant { @@ -74,27 +75,50 @@ public class Sungrass extends Plant { public static class Health extends Buff { - private static final float STEP = 5f; + private static final float STEP = 1f; private int pos; + private int healCurr = 2; + private int count = 5; + private int healTot; @Override public boolean attachTo( Char target ) { pos = target.pos; + healTot = target.HT; return super.attachTo( target ); } @Override - public boolean act() { - if (target.pos != pos || target.HP >= target.HT) { - detach(); - } else { - target.HP = Math.min( target.HT, target.HP + target.HT / 10 ); - target.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - } - spend( STEP ); - return true; - } + public boolean act() { + if (target.pos != pos || healTot <= 0) { + detach(); + } + if (count == 5) { + if (healTot <= healCurr) { + target.HP = Math.min(target.HT, target.HP + healTot); + target.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); + detach(); + } else { + target.HP = Math.min(target.HT, target.HP + healCurr); + healTot -= healCurr; + healCurr = Math.min(healCurr+healCurr-1,(int)(target.HT*0.15)); + target.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); + } + count = 1; + } else { + count++; + } + spend( STEP ); + return true; + } + + public int absorb( int damage ) { + healTot -= damage; + if (healTot <= 0) + detach(); + return damage; + } @Override public int icon() { @@ -103,7 +127,7 @@ public class Sungrass extends Plant { @Override public String toString() { - return "Herbal healing"; + return Utils.format( "Herbal Healing (%d)", healTot); } private static final String POS = "pos";