v0.4.1: wands now charge slightly faster when in the wand holster

This commit is contained in:
Evan Debenham 2016-07-10 20:20:43 -04:00 committed by Evan Debenham
parent 64b0f46a06
commit 2166d13c62
3 changed files with 9 additions and 3 deletions

View File

@ -32,6 +32,8 @@ public class WandHolster extends Bag {
size = 12;
}
public static float HOLSTER_SCALE_FACTOR = 0.85f;
@Override
public boolean grab( Item item ) {
return item instanceof Wand;
@ -42,7 +44,7 @@ public class WandHolster extends Bag {
if (super.collect( container )) {
if (owner != null) {
for (Item item : items) {
((Wand)item).charge( owner );
((Wand)item).charge( owner, HOLSTER_SCALE_FACTOR );
}
}
return true;

View File

@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
@ -107,6 +108,9 @@ public abstract class Wand extends Item {
public boolean collect( Bag container ) {
if (super.collect( container )) {
if (container.owner != null) {
if (container instanceof WandHolster)
charge( container.owner, ((WandHolster) container).HOLSTER_SCALE_FACTOR );
else
charge( container.owner );
}
return true;

View File

@ -315,7 +315,7 @@ items.bags.seedpouch.name=seed pouch
items.bags.seedpouch.desc=This small velvet pouch allows you to store any number of seeds in it. Very convenient.
items.bags.wandholster.name=wand holster
items.bags.wandholster.desc=This slim holster is made from some exotic animal, and is designed to compactly hold many wands.
items.bags.wandholster.desc=This slim holster is made from some exotic animal hide, and is designed to compactly hold many wands.\n\nThe holster projects a magical field around itself, causing all wands inside to recharge slightly faster.