Allow deactivating all raids

This commit is contained in:
Kurt 2020-12-29 10:53:47 -08:00
parent de840f40d4
commit d9a4eacaf4
2 changed files with 24 additions and 2 deletions

View File

@ -28,6 +28,16 @@ public RaidSpawnDetail[] GetAllRaids()
return result;
}
public void DectivateAllRaids()
{
for (int i = 0; i < CountUsed; i++)
{
if (i == 16) // Watchtower, special
continue;
GetRaid(i).Deactivate();
}
}
public void ActivateAllRaids(bool rare, bool isEvent)
{
var rnd = Util.Rand;
@ -195,6 +205,13 @@ public void Activate(byte star, byte rand, bool rare = false, bool isEvent = fal
IsRare = rare;
IsEvent = isEvent;
}
public void Deactivate()
{
DenType = RaidType.None;
Stars = 0;
RandRoll = 0;
}
public string Dump() => $"{Hash:X16}\t{Seed:X16}\t{Stars}\t{RandRoll:00}\t{DenType}\t{Flags:X2}";

View File

@ -39,9 +39,14 @@ private void B_Save_Click(object sender, EventArgs e)
private void B_ActivateAll_Click(object sender, EventArgs e)
{
bool export = (ModifierKeys & Keys.Alt) != 0;
if (export)
bool alt = (ModifierKeys & Keys.Alt) != 0;
if (alt)
{
if ((ModifierKeys & Keys.Control) == 0)
{
Raids.DectivateAllRaids();
LoadDen(CB_Den.SelectedIndex);
}
var txt = Raids.DumpAll();
var concat = string.Join(Environment.NewLine, txt);
if (WinFormsUtil.SetClipboardText(concat))