diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 2b5668688..6b1a9749a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -849,6 +849,10 @@ public class Hero extends Char { } } + + public Char enemy(){ + return enemy; + } public void rest( boolean fullRest ) { spendAndNext( TIME_TO_REST ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index b057005db..1704db711 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -382,6 +382,10 @@ public abstract class Mob extends Char { return damage; } + public boolean surprisedBy( Char enemy ){ + return !enemySeen && enemy == Dungeon.hero; + } + public void aggro( Char ch ) { enemy = ch; if (state != PASSIVE){ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java index c21dab545..c856df492 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java @@ -20,7 +20,11 @@ */ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.watabou.utils.Random; public class Dagger extends MeleeWeapon { @@ -28,7 +32,6 @@ public class Dagger extends MeleeWeapon { image = ItemSpriteSheet.DAGGER; tier = 1; - ACC = 1.25f; //25% boost to accuracy } @Override @@ -37,4 +40,13 @@ public class Dagger extends MeleeWeapon { lvl*(tier+1); //scaling unchanged } + @Override + public int damageRoll(Hero hero) { + Char enemy = hero.enemy(); + if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) + //deals avg damage to max on surprise, instead of min to max. + return Random.NormalIntRange((min() + max())/2, max()); + else + return super.damageRoll(hero); + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index ded88ac2e..f8842a592 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -686,7 +686,7 @@ items.weapon.melee.battleaxe.stats_desc=This is a rather accurate weapon. items.weapon.melee.battleaxe.desc=The enormous steel head of this battle axe puts considerable heft behind each stroke. items.weapon.melee.dagger.name=dagger -items.weapon.melee.dagger.stats_desc=This is a rather accurate weapon. +items.weapon.melee.dagger.stats_desc=This weapon is very effective against unaware enemies. items.weapon.melee.dagger.desc=A simple iron dagger with a well worn wooden handle. items.weapon.melee.glaive.name=glaive