diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 54215d98a..3c9ed15c6 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -2155,7 +2155,7 @@ items.weapon.missiles.boomerang.desc=Thrown to the enemy this flat curved wooden items.weapon.missiles.boomerang.durability=Due to its solid construction, this boomerang will not break from use. items.weapon.missiles.fishingspear.name=fishing spear -items.weapon.missiles.fishingspear.desc=Tiny throwing spears designed for fishing. They work well as an improvised weapon too. +items.weapon.missiles.fishingspear.desc=Tiny throwing spears that work well as an improvised weapon despite being designed for fishing. items.weapon.missiles.forcecube.name=force cube items.weapon.missiles.forcecube.ondeath=You killed yourself with your own Force Cube... @@ -2186,10 +2186,13 @@ items.weapon.missiles.missileweapon.dust=The thrown weapon crumbles to dust as y items.weapon.missiles.missileweapon$placeholder.name=thrown weapon items.weapon.missiles.shuriken.name=shuriken -items.weapon.missiles.shuriken.desc=Star-shaped pieces of metal with razor-sharp blades. They are lightweight and easy to use on the move. A single shuriken can be thrown instantly after moving. +items.weapon.missiles.shuriken.stats_desc=Shurikens can be thrown instantly with a 20 turn cooldown. +items.weapon.missiles.shuriken.desc=These star-shaped pieces of metal with razor-sharp blades can be quickly thrown while on the move. +items.weapon.missiles.shuriken$shurikeninstanttracker.name=Shuriken Cooldown +items.weapon.missiles.shuriken$shurikeninstanttracker.desc=You have recently thrown a shuriken instantly, and must wait before doing it again. Shurikens can still be thrown, but at normal weapon speed.\n\nTurns Remaining: %s. items.weapon.missiles.throwingclub.name=throwing club -items.weapon.missiles.throwingclub.desc=A fairly simple thrown weapon, essentially a large rock fastened to a stick. While they are a bit lacking in damage, their solid stone head means they are quite durable, and won't stick to enemies. +items.weapon.missiles.throwingclub.desc=A fairly simple but durable thrown weapon, essentially a large rock fastened to a stick. items.weapon.missiles.throwinghammer.name=throwing hammer items.weapon.missiles.throwinghammer.desc=These hefty hammers are designed to be thrown at an enemy. While they are a bit lacking in damage, their smooth all-metal construction means they are quite durable, and won't stick to enemies. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index b4e8b8e65..28963c78d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -301,7 +301,6 @@ public abstract class Char extends Actor { if (Dungeon.hero.subClass == HeroSubClass.FREERUNNER){ Buff.affect(Dungeon.hero, Momentum.class).gainStack(); } - Dungeon.hero.justMoved = true; Dungeon.hero.busy(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index c1efc79f8..cac0a5abe 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -790,7 +790,6 @@ public class Hero extends Char { @Override public void spendConstant(float time) { - justMoved = false; super.spendConstant(time); } @@ -1725,10 +1724,6 @@ public class Hero extends Char { private boolean walkingToVisibleTrapInFog = false; - //FIXME this is a fairly crude way to track this, really it would be nice to have a short - //history of hero actions - public boolean justMoved = false; - private boolean getCloser( final int target ) { if (target == pos) @@ -1828,7 +1823,6 @@ public class Hero extends Char { move(step); spend( delay ); - justMoved = true; search(false); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Shuriken.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Shuriken.java index d2adfbcdc..4b9baa077 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Shuriken.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/Shuriken.java @@ -23,8 +23,10 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; -import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; +import com.watabou.noosa.Image; public class Shuriken extends MissileWeapon { @@ -42,10 +44,40 @@ public class Shuriken extends MissileWeapon { return 4 * tier + //8 base, down from 10 (tier == 1 ? 2*lvl : tier*lvl); //scaling unchanged } - + + @Override + protected void onThrow(int cell) { + super.onThrow(cell); + if (curUser.buff(ShurikenInstantTracker.class) == null) { + //1 less turn as the attack will be instant + FlavourBuff.affect(curUser, ShurikenInstantTracker.class, ShurikenInstantTracker.DURATION-1); + } + } + @Override public float delayFactor(Char owner) { - if (owner instanceof Hero && ((Hero) owner).justMoved) return 0; - else return super.delayFactor(owner); + return owner.buff(ShurikenInstantTracker.class) != null ? super.delayFactor(owner) : 0; } + + public static class ShurikenInstantTracker extends FlavourBuff { + + public static int DURATION = 20; + + @Override + public int icon() { + return BuffIndicator.THROWN_WEP; + } + + @Override + public void tintIcon(Image icon) { + icon.hardlight(0.6f, 0.6f, 0.6f); + } + + @Override + public float iconFadePercent() { + return Math.max(0, (DURATION - visualcooldown()) / DURATION); + } + + } + }