v0.7.1: tipped darts now tie into durability and synergize with warden

This commit is contained in:
Evan Debenham 2018-11-30 09:04:46 -05:00
parent 0a839897e7
commit a14dcf4a35
6 changed files with 46 additions and 21 deletions

View File

@ -59,7 +59,7 @@ abstract public class MissileWeapon extends Weapon {
protected static final float MAX_DURABILITY = 100;
protected float durability = MAX_DURABILITY;
protected int baseUses = 10;
protected float baseUses = 10;
public boolean holster;
@ -202,16 +202,16 @@ abstract public class MissileWeapon extends Weapon {
} else {
parent.durability -= parent.durabilityPerUse();
if (parent.durability > 0 && parent.durability <= parent.durabilityPerUse()){
if (level() <= 0)GLog.w(Messages.get(MissileWeapon.class, "about_to_break"));
else GLog.n(Messages.get(MissileWeapon.class, "about_to_break"));
if (level() <= 0)GLog.w(Messages.get(this, "about_to_break"));
else GLog.n(Messages.get(this, "about_to_break"));
}
}
parent = null;
} else {
durability -= durabilityPerUse();
if (durability > 0 && durability <= durabilityPerUse()){
if (level() <= 0)GLog.w(Messages.get(MissileWeapon.class, "about_to_break"));
else GLog.n(Messages.get(MissileWeapon.class, "about_to_break"));
if (level() <= 0)GLog.w(Messages.get(this, "about_to_break"));
else GLog.n(Messages.get(this, "about_to_break"));
}
}
if (durability > 0){

View File

@ -34,6 +34,9 @@ public class Dart extends MissileWeapon {
image = ItemSpriteSheet.DART;
tier = 1;
//infinite, even with penalties
baseUses = 1000;
}
@Override
@ -58,11 +61,6 @@ public class Dart extends MissileWeapon {
}
}
@Override
protected float durabilityPerUse() {
return 0;
}
private static Crossbow bow;
private void updateCrossbow(){

View File

@ -47,4 +47,8 @@ public class RotDart extends TippedDart {
return super.proc(attacker, defender, damage);
}
@Override
protected float durabilityPerUse() {
return 100f;
}
}

View File

@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
@ -50,22 +51,41 @@ public abstract class TippedDart extends Dart {
{
tier = 2;
//so that slightly more than 1.5x durability is needed for 2 uses
baseUses = 0.65f;
}
//exact same damage as regular darts, despite being higher tier.
@Override
protected void rangedHit(Char enemy, int cell) {
//attempt to stick the dart to the enemy, just drop it if we can't.
Dart d = new Dart();
if (enemy.isAlive() && sticky) {
PinCushion p = Buff.affect(enemy, PinCushion.class);
if (p.target == enemy){
p.stick(d);
return;
super.rangedHit( enemy, cell);
//need to spawn a dart
if (durability <= 0){
//attempt to stick the dart to the enemy, just drop it if we can't.
Dart d = new Dart();
if (enemy.isAlive() && sticky) {
PinCushion p = Buff.affect(enemy, PinCushion.class);
if (p.target == enemy){
p.stick(d);
return;
}
}
Dungeon.level.drop( d, enemy.pos ).sprite.drop();
}
Dungeon.level.drop( d, enemy.pos ).sprite.drop();
}
@Override
protected float durabilityPerUse() {
float use = super.durabilityPerUse();
if (Dungeon.hero.subClass == HeroSubClass.WARDEN){
use /= 2f;
}
return use;
}
private static HashMap<Class<?extends Plant.Seed>, Class<?extends TippedDart>> types = new HashMap<>();

View File

@ -335,7 +335,7 @@ actors.hero.herosubclass.freerunner_desc=The _Freerunner_ builds momentum as he
actors.hero.herosubclass.sniper=sniper
actors.hero.herosubclass.sniper_desc=The _Sniper_ is a master of ranged combat, with increased vision and bonus accuracy and armor piercing based on attack distance. After striking with a thrown weapon, she can follow up with a special attack from her bow.
actors.hero.herosubclass.warden=warden
actors.hero.herosubclass.warden_desc=The _Warden_ has a strong connection to nature which allows her to see through tall grass and command furrowed grass to sprout around plants she grows. Plants she tramples will also give bonus effects, tipped darts will last longer, and grass will give her an armor boost when she stands in it.
actors.hero.herosubclass.warden_desc=The _Warden_ has a strong connection to nature which allows her to see through tall grass and command furrowed grass to sprout around plants she grows. Plants she tramples will also give bonus effects, tipped darts gain 2x durability, and grass will give her an armor boost when she stands in it.

View File

@ -1354,7 +1354,7 @@ items.weapon.missiles.darts.poisondart.name=poison dart
items.weapon.missiles.darts.poisondart.desc=These darts are tipped with a sorrowmoss-based compound which will poison their target.
items.weapon.missiles.darts.rotdart.name=rot dart
items.weapon.missiles.darts.rotdart.desc=These wicked darts are tipped with an acidic rotberry-based compound, which will aggressively eat through anything the dart comes into contact with. Powerful foes will resist most of the effect, but the corrosion is strong enough to easily kill most standard enemies.
items.weapon.missiles.darts.rotdart.desc=These wicked darts are tipped with an acidic rotberry-based compound, which will aggressively eat through anything the dart comes into contact with. Powerful foes will resist most of the effect, but the corrosion is strong enough to easily kill most standard enemies. Unfortunately, the compound is unstable, and will always expire after a single use.
items.weapon.missiles.darts.shockingdart.name=shocking dart
items.weapon.missiles.darts.shockingdart.desc=These darts are tipped with a stormvine-based compound which will deliver a nasty shock to their target.
@ -1362,7 +1362,10 @@ items.weapon.missiles.darts.shockingdart.desc=These darts are tipped with a stor
items.weapon.missiles.darts.sleepdart.name=sleep dart
items.weapon.missiles.darts.sleepdart.desc=These darts are tipped with a dreamfoil-based compound which will instantly put their target into a light sleep.
items.weapon.missiles.darts.tippeddart.unlimited_uses=Tipped darts will expend their effect once used and will become regular darts.
items.weapon.missiles.darts.tippeddart.durability=Tipped darts will lose their tips and become regular darts when used.
items.weapon.missiles.darts.tippeddart.uses_left=This stack of darts has _%d/%d_ uses left before one tip wears off.
items.weapon.missiles.darts.tippeddart.unlimited_uses=_But these are of such high quality that they will effectively last forever._
items.weapon.missiles.darts.tippeddart.about_to_break=Your dart tip is about to expire.
items.weapon.missiles.bolas.name=bolas