v0.4.0: reworked dagger

This commit is contained in:
Evan Debenham 2016-05-15 18:06:34 -04:00
parent 7021b01821
commit 5e27d0e056
4 changed files with 22 additions and 2 deletions

View File

@ -850,6 +850,10 @@ public class Hero extends Char {
}
}
public Char enemy(){
return enemy;
}
public void rest( boolean fullRest ) {
spendAndNext( TIME_TO_REST );
if (!fullRest) {

View File

@ -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){

View File

@ -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);
}
}

View File

@ -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