Skip to content

Commit

Permalink
6.0.12 (#50)
Browse files Browse the repository at this point in the history
* Added check for invalid shield/sword gfx options (older version configs could have it "wrong" because of deleted options)

* Added code to attempt to "reset" enemizer roms back to pre-enemizer state and rerun enemizer with the embedded settings. Needs more work because the generated files are not 100% the same as the input.

* Load less OW areas (special areas) and don't try to randomize "fake" areas

* Changed custom sword/shield graphics dropdown to load from files in respective folders
Modified config to not export the selected sword/shield graphics
Modified config to use string filename for sword/shield graphics
Fixed bugs with room/ow graphics block selection
  • Loading branch information
sosuke3 authored Nov 4, 2017
1 parent b8323a9 commit 833f200
Show file tree
Hide file tree
Showing 29 changed files with 540 additions and 223 deletions.
3 changes: 3 additions & 0 deletions EnemizerGui/Enemizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@
<Content Include="sword_gfx\normal.gfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="shield_gfx\rupee.gfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
75 changes: 38 additions & 37 deletions EnemizerGui/EnemizerForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 35 additions & 12 deletions EnemizerGui/EnemizerForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,30 @@ private void LoadSpriteDropdown()
void LoadSwordDropdown()
{
swordGraphicsCombobox.Items.Clear();
foreach (var e in Enum.GetValues(typeof(SwordTypes)))
//foreach (var e in Enum.GetValues(typeof(SwordTypes)))
//{
// swordGraphicsCombobox.Items.Add(((SwordTypes)e).GetDescription());
//}

foreach (string f in Directory.GetFiles("sword_gfx\\"))
{
swordGraphicsCombobox.Items.Add(((SwordTypes)e).GetDescription());
files_names item = new files_names(Path.GetFileNameWithoutExtension(f), f);
swordGraphicsCombobox.Items.Add(item);
}
}

void LoadShieldDropdown()
{
shieldSpriteCombobox.Items.Clear();
foreach(var e in Enum.GetValues(typeof(ShieldTypes)))
//foreach(var e in Enum.GetValues(typeof(ShieldTypes)))
//{
// shieldSpriteCombobox.Items.Add(((ShieldTypes)e).GetDescription());
//}

foreach (string f in Directory.GetFiles("shield_gfx\\"))
{
shieldSpriteCombobox.Items.Add(((ShieldTypes)e).GetDescription());
files_names item = new files_names(Path.GetFileNameWithoutExtension(f), f);
shieldSpriteCombobox.Items.Add(item);
}
}

Expand Down Expand Up @@ -292,17 +304,20 @@ private void UpdateExtrasTabUIFromConfig()

private void UpdateGraphicsTabUIFromConfig()
{
if((int)config.OptionFlags.SwordGraphics > swordGraphicsCombobox.Items.Count)

var swords = swordGraphicsCombobox.Items.Cast<files_names>();
if(false == swords.Any(x => x.file == config.OptionFlags.SwordGraphics))
{
config.OptionFlags.SwordGraphics = SwordTypes.Normal;
config.OptionFlags.SwordGraphics = "sword_gfx\\normal.gfx";
}
swordGraphicsCombobox.SelectedIndex = (int)config.OptionFlags.SwordGraphics;
swordGraphicsCombobox.SelectedIndex = swordGraphicsCombobox.Items.IndexOf(swords.FirstOrDefault(x => x.file == config.OptionFlags.SwordGraphics));

if((int)config.OptionFlags.ShieldGraphics >= shieldSpriteCombobox.Items.Count)
var shields = shieldSpriteCombobox.Items.Cast<files_names>();
if (false == shields.Any(x => x.file == config.OptionFlags.ShieldGraphics))
{
config.OptionFlags.ShieldGraphics = ShieldTypes.Normal;
config.OptionFlags.ShieldGraphics = "shield_gfx\\normal.gfx";
}
shieldSpriteCombobox.SelectedIndex = (int)config.OptionFlags.ShieldGraphics;
shieldSpriteCombobox.SelectedIndex = shieldSpriteCombobox.Items.IndexOf(shields.FirstOrDefault(x => x.file == config.OptionFlags.ShieldGraphics));
}

private void LoadAbsorbableItemsChecklistFromConfig()
Expand Down Expand Up @@ -410,6 +425,14 @@ private void generateRomButton_Click(object sender, EventArgs e)
var linkSpriteFilename = (linkSpriteCombobox.Items[linkSpriteCombobox.SelectedIndex] as files_names).file.ToString();
Randomization randomize = new Randomization();
RomData romData = new RomData(rom_data);
if(romData.IsEnemizerRom)
{
if(DialogResult.No == MessageBox.Show("Enemizer rom detected: this will cause Enemizer to try to reset the rom and rerun the same settings that are embedded in the rom. This feature exists for debugging purposes only. If you think this is a mistake, please double check the input file you selected. Do you wish to continue?", "Enemizer rom detected", MessageBoxButtons.YesNo))
{
// user picked no
return;
}
}
RomData randomizedRom = randomize.MakeRandomization(seed, config.OptionFlags, romData, linkSpriteFilename);

using (var fbd = new FolderBrowserDialog())
Expand Down Expand Up @@ -732,12 +755,12 @@ private void negativeModeCheckbox_CheckedChanged(object sender, EventArgs e)

private void swordGraphicsCombobox_SelectedIndexChanged(object sender, EventArgs e)
{
config.OptionFlags.SwordGraphics = (SwordTypes)swordGraphicsCombobox.SelectedIndex;
config.OptionFlags.SwordGraphics = (swordGraphicsCombobox.SelectedItem as files_names).file.ToString();
}

private void shieldSpriteCombobox_SelectedIndexChanged(object sender, EventArgs e)
{
config.OptionFlags.ShieldGraphics = (ShieldTypes)shieldSpriteCombobox.SelectedIndex;
config.OptionFlags.ShieldGraphics = (shieldSpriteCombobox.SelectedItem as files_names).file.ToString();
}

private void completeModificationCombobox_SelectedIndexChanged(object sender, EventArgs e)
Expand Down
4 changes: 3 additions & 1 deletion EnemizerGui/file_names.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -17,7 +18,8 @@ public files_names(string name, string file)
}
public override string ToString()
{
return name;
TextInfo ti = new CultureInfo("en-US", false).TextInfo;
return ti.ToTitleCase(name);
}

}
Expand Down
Binary file added EnemizerGui/shield_gfx/rupee.gfx
Binary file not shown.
35 changes: 35 additions & 0 deletions EnemizerLibrary/BossRandomizer/Boss/GTArmosBoss.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EnemizerLibrary
{
// this should only be used for resetting a rom back to vanilla
public class GTArmosBoss : Boss
{
public GTArmosBoss() : base(BossType.Armos)
{
BossPointer = new byte[] { 0x23, 0xDB };
BossGraphics = 9;
BossSpriteId = SpriteConstants.ArmosKnightsSprite;
BossNode = "gt-armos";

BossSpriteArray = new byte[]
{
0x05, 0x04, 0x53, // armos
0x05, 0x07, 0x53, // armos
0x05, 0x0A, 0x53, // armos
0x08, 0x0A, 0x53, // armos
0x08, 0x07, 0x53, // armos
0x08, 0x04, 0x53, // armos
0x08, 0xE7, 0x19, // armos trigger OL
0x07, 0x07, 0xE3, // fairy
0x07, 0x07, 0xE3, // fairy
0x07, 0x07, 0xE3, // fairy
0x07, 0x07, 0xE3, // fairy
};
}
}
}
28 changes: 28 additions & 0 deletions EnemizerLibrary/BossRandomizer/Boss/GTLanmolaBoss.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EnemizerLibrary
{
public class GTLanmolaBoss : Boss
{
public GTLanmolaBoss() : base(BossType.Lanmola)
{
BossPointer = new byte[] { 0xBE, 0xE1 };
BossGraphics = 35;
BossSpriteId = SpriteConstants.LanmolasSprite;
BossNode = "gt-lanmolas";

BossSpriteArray = new byte[]
{
0x07, 0x06, 0x54, // lanmolas
0x07, 0x09, 0x54, // lanmolas
0x09, 0x07, 0x54, // lanmolas
0x18, 0x17, 0xD1, // bunny beam
0x1C, 0x03, 0xC5, // medusa
};
}
}
}
24 changes: 24 additions & 0 deletions EnemizerLibrary/BossRandomizer/Boss/GTMoldormBoss.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EnemizerLibrary
{
public class GTMoldormBoss : Boss
{
public GTMoldormBoss() : base(BossType.Moldorm)
{
BossPointer = new byte[] { 0x1E, 0xDF };
BossGraphics = 12;
BossSpriteId = SpriteConstants.MoldormSprite;
BossNode = "gt-moldorm";

BossSpriteArray = new byte[]
{
0x09, 0x09, 0x09 // moldorm
};
}
}
}
Loading

0 comments on commit 833f200

Please sign in to comment.