diff --git a/SWD2Randomizer/Patcher.cs b/SWD2Randomizer/Patcher.cs index 62b5634..4fc12d0 100644 --- a/SWD2Randomizer/Patcher.cs +++ b/SWD2Randomizer/Patcher.cs @@ -21,6 +21,7 @@ public void PatchAll() PatchHook(); PatchTriple(); PatchOasis(); + PatchBlueprints(); } /* Make the ignition axe effective against Priest Glorious */ @@ -33,7 +34,7 @@ public void PatchPriest() { doc.Load(damageTypePatch); } - catch (Exception e) + catch (Exception) { Console.WriteLine("caught exception"); } @@ -56,7 +57,7 @@ public void PatchHook() { doc.Load(hubPatch); } - catch (Exception e) + catch (Exception) { Console.WriteLine("caught exception"); } @@ -82,7 +83,7 @@ public void PatchOasis() { doc.Load(hubPatch); } - catch (Exception e) + catch (Exception) { Console.WriteLine("caught exception"); } @@ -103,7 +104,7 @@ public void PatchOasis() { doc.Load(quests); } - catch (Exception e) + catch (Exception) { Console.WriteLine("caught exception"); } @@ -134,7 +135,7 @@ public void PatchTriple() { doc.Load(priceList); } - catch (Exception e) + catch (Exception) { Console.WriteLine("caught exception"); } @@ -157,7 +158,7 @@ public void PatchIntro() { doc.Load(quests); } - catch (Exception e) + catch (Exception) { Console.WriteLine("caught exception"); } @@ -185,7 +186,7 @@ public void PatchIntro() { doc.Load(introPatch); } - catch (Exception e) + catch (Exception) { Console.WriteLine("caught exception"); } @@ -337,6 +338,46 @@ public void PatchIntro() doc.Save(introPatch); } + /* Lower the price of triple grenade blueprint */ + public void PatchBlueprints() + { + string upgradeList = Path.Combine(baseDir, "Definitions", "upgrades.xml"); + + XmlDocument doc = new XmlDocument(); + try + { + doc.Load(upgradeList); + } + catch (Exception) + { + Console.WriteLine("caught exception"); + } + XmlNode blueprint = doc.SelectSingleNode("//Upgrade[@Name='fate.bloodquest']"); + + XmlNode name = doc.CreateNode(XmlNodeType.Element, "CategoryStringId", null); + name.InnerText = "upgrade_fate_bloodquest"; + blueprint.AppendChild(name); + + blueprint = doc.SelectSingleNode("//Upgrade[@Name='fate.xpx2']"); + + name = doc.CreateNode(XmlNodeType.Element, "CategoryStringId", null); + name.InnerText = "upgrade_fate_xpx2"; + blueprint.AppendChild(name); + + blueprint = doc.SelectSingleNode("//Upgrade[@Name='fate.explosions']"); + + name = doc.CreateNode(XmlNodeType.Element, "CategoryStringId", null); + name.InnerText = "upgrade_fate_explosions"; + blueprint.AppendChild(name); + + blueprint = doc.SelectSingleNode("//Upgrade[@Name='pressurebomb.launcher_triple']"); + + name = doc.CreateNode(XmlNodeType.Element, "CategoryStringId", null); + name.InnerText = "upgrade_pressurebomb_launcher_triple"; + blueprint.AppendChild(name); + + doc.Save(upgradeList); + } } }