From 2166d13c624bdbc8ff1dac74deb0a46397ad5c30 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 10 Jul 2016 20:20:43 -0400 Subject: [PATCH] v0.4.1: wands now charge slightly faster when in the wand holster --- .../shatteredpixeldungeon/items/bags/WandHolster.java | 4 +++- .../shatteredpixeldungeon/items/wands/Wand.java | 6 +++++- .../shatteredpixeldungeon/messages/items/items.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/bags/WandHolster.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/bags/WandHolster.java index 4cc70a7cb..c8158d791 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/bags/WandHolster.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/bags/WandHolster.java @@ -31,6 +31,8 @@ public class WandHolster extends Bag { size = 12; } + + public static float HOLSTER_SCALE_FACTOR = 0.85f; @Override public boolean grab( Item item ) { @@ -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; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index 309c45d64..66748617f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -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,7 +108,10 @@ public abstract class Wand extends Item { public boolean collect( Bag container ) { if (super.collect( container )) { if (container.owner != null) { - charge( container.owner ); + if (container instanceof WandHolster) + charge( container.owner, ((WandHolster) container).HOLSTER_SCALE_FACTOR ); + else + charge( container.owner ); } return true; } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index ad7b41722..99be2a696 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -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.