diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 41bfda569..6de67b9b0 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -57,7 +57,7 @@ items.armor.glyphs.stone.name=%s of stone items.armor.glyphs.stone.desc=This glyph surrounds the armor with heavy magical stone that makes dodging impossible, but blocks damage in proportion with evasion. items.armor.glyphs.swiftness.name=%s of swiftness -items.armor.glyphs.swiftness.desc=This glyph enhances the speed of the wearer whenever they aren't next to an enemy. +items.armor.glyphs.swiftness.desc=This glyph enhances the speed of the wearer whenever they aren't NEAR to an enemy. items.armor.glyphs.thorns.name=%s of thorns items.armor.glyphs.thorns.desc=This powerful glyph harms attackers, causing them to slowly bleed when they attack the wearer. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index 7e0b4b3b6..1e9bf3e7e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -63,6 +63,7 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.particles.Emitter; import com.watabou.utils.Bundlable; import com.watabou.utils.Bundle; +import com.watabou.utils.PathFinder; import com.watabou.utils.Random; import com.watabou.utils.Reflection; @@ -318,15 +319,16 @@ public class Armor extends EquipableItem { if (hasGlyph(Swiftness.class, owner)) { boolean enemyNear = false; + PathFinder.buildDistanceMap(owner.pos, Dungeon.level.passable, 2); for (Char ch : Actor.chars()){ - if (Dungeon.level.adjacent(ch.pos, owner.pos) && owner.alignment != ch.alignment){ + if ( PathFinder.distance[ch.pos] != Integer.MAX_VALUE && owner.alignment != ch.alignment){ enemyNear = true; break; } } if (!enemyNear) speed *= (1.2f + 0.04f * buffedLvl()); } else if (hasGlyph(Flow.class, owner) && Dungeon.level.water[owner.pos]){ - speed *= 2f; + speed *= (2f + 0.25f*buffedLvl()); } if (hasGlyph(Bulk.class, owner) && diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java index 06fc1574a..0626381d4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java @@ -93,7 +93,7 @@ public class AntiMagic extends Armor.Glyph { } public static int drRoll( int level ){ - return Random.NormalIntRange(level, 4 + (level*2)); + return Random.NormalIntRange(level, 3 + Math.round(level*1.5f)); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java index 1ebe22433..3a9decca4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java @@ -45,59 +45,5 @@ public class Camouflage extends Armor.Glyph { return GREEN; } - public static class Camo extends Invisibility { - - { - announced = false; - } - - private int pos; - private int left; - - @Override - public boolean act() { - left--; - if (left == 0 || target.pos != pos) { - detach(); - } else { - spend(TICK); - } - return true; - } - - public void set(int time){ - left = time; - pos = target.pos; - Sample.INSTANCE.play( Assets.Sounds.MELD ); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(left)); - } - - private static final String POS = "pos"; - private static final String LEFT = "left"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle( bundle ); - bundle.put( POS, pos ); - bundle.put( LEFT, left ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle( bundle ); - pos = bundle.getInt( POS ); - left = bundle.getInt( LEFT ); - } - } - } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java index b0a28b6e4..4c1bbbf56 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java @@ -34,7 +34,9 @@ public class Repulsion extends Armor.Glyph { @Override public int proc( Armor armor, Char attacker, Char defender, int damage) { - + // lvl 0 - 20% + // lvl 1 - 33% + // lvl 2 - 43% int level = Math.max( 0, armor.buffedLvl() ); if (Random.Int( level + 5 ) >= 4){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java index 3e46d227e..58036f4eb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java @@ -38,9 +38,9 @@ public class Thorns extends Armor.Glyph { int level = Math.max(0, armor.buffedLvl()); // lvl 0 - 16.7% - // lvl 1 - 28.6% - // lvl 2 - 37.5% - if ( Random.Int( level + 6) >= 5) { + // lvl 1 - 23.1% + // lvl 2 - 28.5% + if ( Random.Int( level + 12) >= 10) { Buff.affect( attacker, Bleeding.class).set( 4 + level ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java index ff8d087f8..45ad594a2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java @@ -31,6 +31,8 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Elastic; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; +import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; +import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.TenguDartTrap; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -156,11 +158,15 @@ public class WandOfBlastWave extends DamageWand { ch.sprite.place(ch.pos); return; } + int oldPos = ch.pos; ch.pos = newPos; if (finalCollided && ch.isAlive()) { ch.damage(Random.NormalIntRange((finalDist + 1) / 2, finalDist), this); Paralysis.prolong(ch, Paralysis.class, Random.NormalIntRange((finalDist + 1) / 2, finalDist)); } + if (Dungeon.level.map[oldPos] == Terrain.OPEN_DOOR){ + Door.leave(oldPos); + } Dungeon.level.occupyCell(ch); if (ch == Dungeon.hero){ //FIXME currently no logic here if the throw effect kills the hero diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Corrupting.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Corrupting.java index 7379787c9..72ac0938e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Corrupting.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Corrupting.java @@ -48,11 +48,11 @@ public class Corrupting extends Weapon.Enchantment { int level = Math.max( 0, weapon.buffedLvl() ); // lvl 0 - 20% - // lvl 1 ~ 22.5% - // lvl 2 ~ 25% + // lvl 1 ~ 23% + // lvl 2 ~ 26% if (damage >= defender.HP && !defender.isImmune(Corruption.class) - && Random.Int( level + 30 ) >= 24){ + && Random.Int( level + 25 ) >= 20){ Mob enemy = (Mob) defender; Hero hero = (attacker instanceof Hero) ? (Hero) attacker : Dungeon.hero; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java index 91e0899b6..a2b672791 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java @@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; 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.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; @@ -107,7 +108,8 @@ public class HighGrass { //Camouflage //FIXME doesn't work with sad ghost if (hero.belongings.armor != null && hero.belongings.armor.hasGlyph(Camouflage.class, hero)) { - Buff.affect(hero, Camouflage.Camo.class).set(3 + hero.belongings.armor.buffedLvl()); + Buff.prolong(hero, Invisibility.class, 3 + hero.belongings.armor.buffedLvl()/2); + Sample.INSTANCE.play( Assets.Sounds.MELD ); } }