From bb636dd2370f50dafea746365c54bc4ae80a4a6a Mon Sep 17 00:00:00 2001
From: Evan Debenham <Evan.SHPX@gmail.com>
Date: Mon, 25 May 2015 22:27:37 -0400
Subject: [PATCH] v0.3.0: modified wandmaker's reward

---
 .../actors/mobs/npcs/Wandmaker.java              | 15 +++++++--------
 .../windows/WndWandmaker.java                    | 16 +++++++---------
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java
index d30466c4d..2aec9f548 100644
--- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java
+++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java
@@ -20,6 +20,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
 import java.util.ArrayList;
 
 import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
+import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
 import com.watabou.noosa.audio.Sample;
 import com.shatteredpixel.shatteredpixeldungeon.Assets;
 import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
@@ -38,8 +39,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
 import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
 import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust;
 import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
-import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfDisintegration;
-import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfRegrowth;
 import com.shatteredpixel.shatteredpixeldungeon.levels.PrisonLevel;
 import com.shatteredpixel.shatteredpixeldungeon.levels.Room;
 import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@@ -221,13 +220,13 @@ public class Wandmaker extends NPC {
 				alternative = Random.Int( 2 ) == 0;
 				
 				given = false;
-				//TODO: implement new logic
-				wand1 = new WandOfDisintegration();
-				wand1.random().upgrade();
-				
+				wand1 = (Wand) Generator.random(Generator.Category.WAND);
+				wand1.upgrade();
 
-				wand2 = new WandOfRegrowth();
-				wand2.random().upgrade();
+				do {
+					wand2 = (Wand) Generator.random(Generator.Category.WAND);
+				} while (wand2.getClass().equals(wand1.getClass()));
+				wand2.upgrade();
 			}
 		}
 		
diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndWandmaker.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndWandmaker.java
index 34d7cea89..a34eb3c10 100644
--- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndWandmaker.java
+++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndWandmaker.java
@@ -35,8 +35,6 @@ public class WndWandmaker extends Window {
 	private static final String TXT_MESSAGE	= 
 		"Oh, I see you have succeeded! I do hope it hasn't troubled you too much. " +
 		"As I promised, you can choose one of my high quality wands.";
-	private static final String TXT_BATTLE		= "Battle wand";
-	private static final String TXT_NON_BATTLE	= "Non-battle wand";
 	
 	private static final String TXT_FARAWELL	= "Good luck in your quest, %s!";
 	
@@ -60,25 +58,25 @@ public class WndWandmaker extends Window {
 		message.y = titlebar.bottom() + GAP;
 		add( message );
 		
-		RedButton btnBattle = new RedButton( TXT_BATTLE ) {
+		RedButton btnWand1 = new RedButton( Wandmaker.Quest.wand1.name() ) {
 			@Override
 			protected void onClick() {
 				selectReward( wandmaker, item, Wandmaker.Quest.wand1 );
 			}
 		};
-		btnBattle.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
-		add( btnBattle );
+		btnWand1.setRect(0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT);
+		add( btnWand1 );
 		
-		RedButton btnNonBattle = new RedButton( TXT_NON_BATTLE ) {
+		RedButton btnWand2 = new RedButton( Wandmaker.Quest.wand2.name() ) {
 			@Override
 			protected void onClick() {
 				selectReward( wandmaker, item, Wandmaker.Quest.wand2 );
 			}
 		};
-		btnNonBattle.setRect( 0, btnBattle.bottom() + GAP, WIDTH, BTN_HEIGHT );
-		add( btnNonBattle );
+		btnWand2.setRect(0, btnWand1.bottom() + GAP, WIDTH, BTN_HEIGHT);
+		add( btnWand2 );
 		
-		resize( WIDTH, (int)btnNonBattle.bottom() );
+		resize(WIDTH, (int) btnWand2.bottom());
 	}
 	
 	private void selectReward( Wandmaker wandmaker, Item item, Wand reward ) {