diff --git a/Lotd/FileFormats/bin/CardManager.cs b/Lotd/FileFormats/bin/CardManager.cs index a1888ef..bf3b932 100644 --- a/Lotd/FileFormats/bin/CardManager.cs +++ b/Lotd/FileFormats/bin/CardManager.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Diagnostics; using System.IO; using System.Linq; @@ -173,42 +174,45 @@ private void LoadCardProps(List cards, Dictionary car private void LoadCardProp(CardInfo card, Dictionary cardsById, uint a1, uint a2) { - uint first = (a1 << 18) | ((a1 & 0x7FC000 | a1 >> 18) >> 5); - - uint second = (((a2 & 1u) | (a2 << 21)) & 0x80000001 | ((a2 & 0x7800) | ((a2 & 0x780 | ((a2 & 0x7E) << 10)) << 8)) << 6 | - ((a2 & 0x38000 | ((a2 & 0x7C0000 | ((a2 & 0x7800000 | (a2 >> 8) & 0x780000) >> 9)) >> 8)) >> 1)); - - short cardId = (short)((first >> 18) & 0x3FFF); - uint atk = ((first >> 9) & 0x1FF); - uint def = (first & 0x1FF); - CardType cardType = (CardType)((second >> 25) & 0x3F); - CardAttribute attribute = (CardAttribute)((second >> 21) & 0xF); - uint level = (second >> 17) & 0xF; - SpellType spellType = (SpellType)((second >> 14) & 7); - MonsterType monsterType = (MonsterType)((second >> 9) & 0x1F); - uint pendulumScale1 = (second >> 1) & 0xF; - uint pendulumScale2 = (second >> 5) & 0xF; - - card.CardId = cardId; - card.Atk = (int)(atk * 10); - card.Def = (int)(def * 10); - card.Level = (byte)level; - card.Attribute = attribute; - card.CardType = cardType; - card.SpellType = spellType; - card.MonsterType = monsterType; - card.PendulumScale1 = (byte)pendulumScale1; - card.PendulumScale2 = (byte)pendulumScale2; - - cardsById.Add(cardId, card); + BitVector32 bit1 = new BitVector32((int)a1); + BitVector32.Section bit1_mrk = BitVector32.CreateSection(16383);// offset 0, mask 16383 (0x3FFF) + BitVector32.Section bit1_attack = BitVector32.CreateSection(511, bit1_mrk);// offset 14, mask 511 (0x1FF) + BitVector32.Section bit1_defence = BitVector32.CreateSection(511, bit1_attack);// offset 23, mask 511 (0x1FF) + // All bits used + + BitVector32 bit2 = new BitVector32((int)a2); + BitVector32.Section bit2_exist = BitVector32.CreateSection(1);// offset 0, mask 1 (0x1) + BitVector32.Section bit2_kind = BitVector32.CreateSection(63, bit2_exist);// offset 1, mask 63 (0x3F) + BitVector32.Section bit2_attr = BitVector32.CreateSection(15, bit2_kind);// offset 7, mask 15 (0xF) + BitVector32.Section bit2_level = BitVector32.CreateSection(15, bit2_attr);// offset 11, mask 15 (0xF) + BitVector32.Section bit2_icon = BitVector32.CreateSection(7, bit2_level);// offset 15, mask 7 (0x7) + BitVector32.Section bit2_type = BitVector32.CreateSection(31, bit2_icon);// offset 18, mask 31 (0x1F) + BitVector32.Section bit2_scaleL = BitVector32.CreateSection(15, bit2_type);// offset 23, mask 15 (0xF) + BitVector32.Section bit2_scaleR = BitVector32.CreateSection(15, bit2_scaleL);// offset 27, mask 15 (0xF) + + BitVector32.Section bit2_unused = BitVector32.CreateSection(1, bit2_scaleR);// offset 31, mask 1 + Debug.Assert(bit2[bit2_unused] == 0); + + card.CardId = (short)bit1[bit1_mrk]; + card.Atk = (int)(bit1[bit1_attack] * 10); + card.Def = (int)(bit1[bit1_defence] * 10); + card.Level = (byte)bit2[bit2_level]; + card.Attribute = (CardAttribute)bit2[bit2_attr]; + card.CardType = (CardType)bit2[bit2_kind]; + card.SpellType = (SpellType)bit2[bit2_icon]; + card.MonsterType = (MonsterType)bit2[bit2_type]; + card.PendulumScale1 = (byte)bit2[bit2_scaleL]; + card.PendulumScale2 = (byte)bit2[bit2_scaleR]; + + cardsById.Add(card.CardId, card); // This is a hard coded value in native code. Might as well do the same check here. - Debug.Assert(cardId < Constants.GetMaxCardId(Manager.Version) + 1); + Debug.Assert(card.CardId < Constants.GetMaxCardId(Manager.Version) + 1); - if (!Enum.IsDefined(typeof(MonsterType), monsterType) || - !Enum.IsDefined(typeof(SpellType), spellType) || - !Enum.IsDefined(typeof(CardType), cardType) || - !Enum.IsDefined(typeof(CardAttribute), attribute)) + if (!Enum.IsDefined(typeof(MonsterType), card.MonsterType) || + !Enum.IsDefined(typeof(SpellType), card.SpellType) || + !Enum.IsDefined(typeof(CardType), card.CardType) || + !Enum.IsDefined(typeof(CardAttribute), card.Attribute)) { //Debug.Assert(false);// TODO: Update for LE } @@ -647,7 +651,7 @@ public bool IsExtraDeckCard get { return CardTypeFlags.HasFlag(CardTypeFlags.Xyz) || CardTypeFlags.HasFlag(CardTypeFlags.Fusion) || - CardTypeFlags.HasFlag(CardTypeFlags.Synchro); + CardTypeFlags.HasFlag(CardTypeFlags.Synchro) || CardTypeFlags.HasFlag(CardTypeFlags.Link); } } @@ -724,6 +728,11 @@ public CardFrameType FrameType return CardFrameType.Ritual; } + if (cardFlags.HasFlag(CardTypeFlags.Link)) + { + return CardFrameType.Link; + } + if (cardFlags.HasFlag(CardTypeFlags.Effect) || cardFlags.HasFlag(CardTypeFlags.SpecialSummon) || cardFlags.HasFlag(CardTypeFlags.Union) || @@ -813,14 +822,15 @@ public static CardTypeFlags GetCardTypeFlags(CardType cardType) //case CardType.SynchoPendulumEffect: return CardTypeFlags.Synchro | CardTypeFlags.Pendulum | CardTypeFlags.Effect; //case CardType.UnionTunerEffect: return CardTypeFlags.Union | CardTypeFlags.Tuner | CardTypeFlags.Effect; //case CardType.RitualSpiritEffect: return CardTypeFlags.Ritual | CardTypeFlags.Spirit | CardTypeFlags.Effect; - case CardType.AnyNormal: return CardTypeFlags.Any | CardTypeFlags.Normal; + case CardType.Link: return CardTypeFlags.Link; + /*case CardType.AnyNormal: return CardTypeFlags.Any | CardTypeFlags.Normal; case CardType.AnyFusion: return CardTypeFlags.Any | CardTypeFlags.Fusion; case CardType.AnyFlip: return CardTypeFlags.Any | CardTypeFlags.Flip; case CardType.AnyPendulum: return CardTypeFlags.Any | CardTypeFlags.Pendulum; case CardType.AnyRitual: return CardTypeFlags.Any | CardTypeFlags.Ritual; case CardType.AnySynchro: return CardTypeFlags.Any | CardTypeFlags.Synchro; case CardType.AnyTuner: return CardTypeFlags.Any | CardTypeFlags.Tuner; - case CardType.AnyXyz: return CardTypeFlags.Any | CardTypeFlags.Xyz; + case CardType.AnyXyz: return CardTypeFlags.Any | CardTypeFlags.Xyz;*/ default: return 0;// TODO: Update for LE //throw new NotImplementedException("Unhandled CardType->CardTypeFlags conversion " + cardType); } @@ -927,6 +937,7 @@ public static string GetCardTypeFlagName(CardTypeFlags flag) case CardTypeFlags.Flip: return "Flip"; case CardTypeFlags.Pendulum: return "Pendulum"; //case CardTypeFlags.SpecialSummon: return ""; + case CardTypeFlags.Link: return "Link"; } } } @@ -988,7 +999,9 @@ public enum CardType //RitualSpiritEffect = 38,// unused //_______ = 39,// unused - underscores?? - // These values are used for tagdata/taginfo + Link = 43 + + /*// These values are used for tagdata/taginfo AnyNormal = 37,// NORMAL* AnySynchro = 38,// SYNC* AnyXyz = 39,// XYZ* @@ -996,7 +1009,7 @@ public enum CardType AnyFusion = 41,// FUSION* AnyRitual = 42,// RITUAL* AnyPendulum = 43,// PEND* - AnyFlip = 44,// FLIP* + AnyFlip = 44,// FLIP**/ } /// @@ -1024,8 +1037,7 @@ public enum CardTypeFlags : uint Flip = 1 << 15, Pendulum = 1 << 16, SpecialSummon = 1 << 17,// "This monster cannot be Normal Summoned or Set" - - Link = 1 << 18,// Not in LOTD + Link = 1 << 18, Normal = 1 << 19,// Special flag used for finding related cards Any = 1 << 20,// Special flag used for finding related cards @@ -1096,6 +1108,7 @@ public enum CardFrameType Xyz, Spell, Trap, + Link } public enum CardLimitation diff --git a/Lotd/NativeScript/MemTools.Structures.cs b/Lotd/NativeScript/MemTools.Structures.cs index b8946f8..48260d1 100644 --- a/Lotd/NativeScript/MemTools.Structures.cs +++ b/Lotd/NativeScript/MemTools.Structures.cs @@ -440,11 +440,15 @@ public enum ScreenTransitionType public enum ScreenState { + LogoBlank = 1, + /// /// Second logo that appears /// DeveloperLogo = 2, + LogoRating = 3, + /// /// First logo that appears /// @@ -455,6 +459,9 @@ public enum ScreenState /// GameLogo = 5, + SignIn = 6, + CommonBg = 7, + // 6 = clickable game logo? // 7 = transition between logo / main menu? @@ -463,14 +470,16 @@ public enum ScreenState /// /// Loading screen that is displayed before a duel /// - DuelLoadingScreen = 9, + DuelLoadingScreen = 9,//GameLoading + + GameBegin = 10, // SeriesSelection = 10, /// /// Duel state after loading screen (this includes rock paper scissors) /// - Duel = 11, + Duel = 11,//ExGameDuel HelpAndOptions = 12, Settings = 13, @@ -489,6 +498,8 @@ public enum ScreenState /// PlayersList = 19, + Pause = 20, + DuelistChallenges = 21, /// @@ -550,6 +561,7 @@ public enum ScreenState MultiplayerLobby2 = 36, + LiveLoading = 37, // 37 = multiplayer duel? MultiplayerLeaderboars = 38, @@ -557,6 +569,8 @@ public enum ScreenState // "Join" menu in multiplayer MultiplayerJoin = 39, + SafetyZone = 40, + /// /// "Select Series" menu /// diff --git a/Lotd/NativeScript/MemTools.cs b/Lotd/NativeScript/MemTools.cs index 1a76f65..35b53e2 100644 --- a/Lotd/NativeScript/MemTools.cs +++ b/Lotd/NativeScript/MemTools.cs @@ -1100,10 +1100,13 @@ public void StartDuel(StartDuelInfo duelInfo) WriteValue(addresses.modeChallengeDuelAddress, (byte)(challengeDuel ? 1 : 0)); - if (addresses.modeMasterRules != IntPtr.Zero) + /*if (addresses.modeMasterRules != IntPtr.Zero) { + // This doesn't work... WriteValue(addresses.modeMasterRules, (byte)(duelInfo.MasterRules5 ? 1 : 0)); - } + //WriteValue((IntPtr)0x140C8D360, 0x80);//(uint)(0xFFFFFFFF & 0xFFFFFF7F)); <--- sudden countdown and such (8) + //WriteValue((IntPtr)0x140C8D364, 0x80); + }*/ // Set the controllers for each player (AI / player) WriteValue(addresses.modePlayerControllerAddress + (4 * GetPlayerIndex(Player.Self)), (int)duelInfo.GetController(Player.Self)); diff --git a/Lotd/UI/DuelStarterForm.Designer.cs b/Lotd/UI/DuelStarterForm.Designer.cs index 929e7f4..72d171a 100644 --- a/Lotd/UI/DuelStarterForm.Designer.cs +++ b/Lotd/UI/DuelStarterForm.Designer.cs @@ -76,13 +76,17 @@ private void InitializeComponent() this.speedMultiplierLabel = new System.Windows.Forms.Label(); this.speedMultiplierApplyButton = new System.Windows.Forms.Button(); this.duelSettingsPanel = new System.Windows.Forms.Panel(); + this.seedNumericUpDown = new System.Windows.Forms.NumericUpDown(); + this.seedLabel = new System.Windows.Forms.Label(); + this.useCustomHandCountLP = new System.Windows.Forms.CheckBox(); this.duelKindComboBox = new System.Windows.Forms.ComboBox(); - this.masterRules5CheckBox = new System.Windows.Forms.CheckBox(); this.duelRewardsCheckBox = new System.Windows.Forms.CheckBox(); this.unlockContentButtonButton = new System.Windows.Forms.Button(); this.animationsButton = new System.Windows.Forms.Button(); this.setsDecksPanel = new System.Windows.Forms.Panel(); - this.useCustomHandCountLP = new System.Windows.Forms.CheckBox(); + this.screenComboBox = new System.Windows.Forms.ComboBox(); + this.goToSceeenButton = new System.Windows.Forms.Button(); + this.filterDeckLinkCheckBox = new System.Windows.Forms.CheckBox(); this.decksListPanel1.SuspendLayout(); this.playerDeckButtonsPanel.SuspendLayout(); this.panel1.SuspendLayout(); @@ -91,13 +95,14 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.startingHandNumericUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.speedMultiplierNumericUpDown)).BeginInit(); this.duelSettingsPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.seedNumericUpDown)).BeginInit(); this.setsDecksPanel.SuspendLayout(); this.SuspendLayout(); // // tagDuelCheckBox // this.tagDuelCheckBox.AutoSize = true; - this.tagDuelCheckBox.Location = new System.Drawing.Point(5, 28); + this.tagDuelCheckBox.Location = new System.Drawing.Point(5, 53); this.tagDuelCheckBox.Name = "tagDuelCheckBox"; this.tagDuelCheckBox.Size = new System.Drawing.Size(70, 17); this.tagDuelCheckBox.TabIndex = 3; @@ -107,7 +112,7 @@ private void InitializeComponent() // matchDuelCheckBox // this.matchDuelCheckBox.AutoSize = true; - this.matchDuelCheckBox.Location = new System.Drawing.Point(5, 51); + this.matchDuelCheckBox.Location = new System.Drawing.Point(5, 76); this.matchDuelCheckBox.Name = "matchDuelCheckBox"; this.matchDuelCheckBox.Size = new System.Drawing.Size(81, 17); this.matchDuelCheckBox.TabIndex = 4; @@ -121,7 +126,7 @@ private void InitializeComponent() this.decksListBox.IntegralHeight = false; this.decksListBox.Location = new System.Drawing.Point(0, 136); this.decksListBox.Name = "decksListBox"; - this.decksListBox.Size = new System.Drawing.Size(217, 319); + this.decksListBox.Size = new System.Drawing.Size(217, 354); this.decksListBox.TabIndex = 5; this.decksListBox.SelectedIndexChanged += new System.EventHandler(this.decksListBox_SelectedIndexChanged); // @@ -136,7 +141,7 @@ private void InitializeComponent() this.decksListPanel1.Dock = System.Windows.Forms.DockStyle.Left; this.decksListPanel1.Location = new System.Drawing.Point(0, 0); this.decksListPanel1.Name = "decksListPanel1"; - this.decksListPanel1.Size = new System.Drawing.Size(217, 455); + this.decksListPanel1.Size = new System.Drawing.Size(217, 490); this.decksListPanel1.TabIndex = 6; // // deckFilterTextBox @@ -289,6 +294,7 @@ private void InitializeComponent() // // deckFilterPanel // + this.deckFilterPanel.Controls.Add(this.filterDeckLinkCheckBox); this.deckFilterPanel.Controls.Add(this.filterDeckRitualCheckBox); this.deckFilterPanel.Controls.Add(this.filterDeckXyzCheckBox); this.deckFilterPanel.Controls.Add(this.filterDeckFusionCheckBox); @@ -368,7 +374,7 @@ private void InitializeComponent() // player1DeckLabel // this.player1DeckLabel.AutoSize = true; - this.player1DeckLabel.Location = new System.Drawing.Point(3, 305); + this.player1DeckLabel.Location = new System.Drawing.Point(3, 333); this.player1DeckLabel.Name = "player1DeckLabel"; this.player1DeckLabel.Size = new System.Drawing.Size(26, 13); this.player1DeckLabel.TabIndex = 7; @@ -378,7 +384,7 @@ private void InitializeComponent() // this.duelArenaComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.duelArenaComboBox.FormattingEnabled = true; - this.duelArenaComboBox.Location = new System.Drawing.Point(80, 210); + this.duelArenaComboBox.Location = new System.Drawing.Point(80, 215); this.duelArenaComboBox.Name = "duelArenaComboBox"; this.duelArenaComboBox.Size = new System.Drawing.Size(146, 21); this.duelArenaComboBox.TabIndex = 10; @@ -386,7 +392,7 @@ private void InitializeComponent() // lifePointsLabel // this.lifePointsLabel.AutoSize = true; - this.lifePointsLabel.Location = new System.Drawing.Point(4, 260); + this.lifePointsLabel.Location = new System.Drawing.Point(4, 265); this.lifePointsLabel.Name = "lifePointsLabel"; this.lifePointsLabel.Size = new System.Drawing.Size(59, 13); this.lifePointsLabel.TabIndex = 13; @@ -395,7 +401,7 @@ private void InitializeComponent() // lifePointsNumericUpDown // this.lifePointsNumericUpDown.Enabled = false; - this.lifePointsNumericUpDown.Location = new System.Drawing.Point(67, 256); + this.lifePointsNumericUpDown.Location = new System.Drawing.Point(67, 261); this.lifePointsNumericUpDown.Maximum = new decimal(new int[] { 60000, 0, @@ -415,7 +421,7 @@ private void InitializeComponent() this.skipRockPaperScissorsCheckBox.AutoSize = true; this.skipRockPaperScissorsCheckBox.Checked = true; this.skipRockPaperScissorsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.skipRockPaperScissorsCheckBox.Location = new System.Drawing.Point(5, 97); + this.skipRockPaperScissorsCheckBox.Location = new System.Drawing.Point(5, 122); this.skipRockPaperScissorsCheckBox.Name = "skipRockPaperScissorsCheckBox"; this.skipRockPaperScissorsCheckBox.Size = new System.Drawing.Size(149, 17); this.skipRockPaperScissorsCheckBox.TabIndex = 15; @@ -425,7 +431,7 @@ private void InitializeComponent() // player2DeckLabel // this.player2DeckLabel.AutoSize = true; - this.player2DeckLabel.Location = new System.Drawing.Point(3, 324); + this.player2DeckLabel.Location = new System.Drawing.Point(3, 352); this.player2DeckLabel.Name = "player2DeckLabel"; this.player2DeckLabel.Size = new System.Drawing.Size(26, 13); this.player2DeckLabel.TabIndex = 16; @@ -434,7 +440,7 @@ private void InitializeComponent() // player4DeckLabel // this.player4DeckLabel.AutoSize = true; - this.player4DeckLabel.Location = new System.Drawing.Point(3, 362); + this.player4DeckLabel.Location = new System.Drawing.Point(3, 390); this.player4DeckLabel.Name = "player4DeckLabel"; this.player4DeckLabel.Size = new System.Drawing.Size(26, 13); this.player4DeckLabel.TabIndex = 18; @@ -443,7 +449,7 @@ private void InitializeComponent() // player3DeckLabel // this.player3DeckLabel.AutoSize = true; - this.player3DeckLabel.Location = new System.Drawing.Point(3, 343); + this.player3DeckLabel.Location = new System.Drawing.Point(3, 371); this.player3DeckLabel.Name = "player3DeckLabel"; this.player3DeckLabel.Size = new System.Drawing.Size(26, 13); this.player3DeckLabel.TabIndex = 17; @@ -452,7 +458,7 @@ private void InitializeComponent() // startingHandNumericUpDown // this.startingHandNumericUpDown.Enabled = false; - this.startingHandNumericUpDown.Location = new System.Drawing.Point(67, 280); + this.startingHandNumericUpDown.Location = new System.Drawing.Point(67, 285); this.startingHandNumericUpDown.Maximum = new decimal(new int[] { 60000, 0, @@ -470,7 +476,7 @@ private void InitializeComponent() // startHandLabel // this.startHandLabel.AutoSize = true; - this.startHandLabel.Location = new System.Drawing.Point(4, 283); + this.startHandLabel.Location = new System.Drawing.Point(4, 288); this.startHandLabel.Name = "startHandLabel"; this.startHandLabel.Size = new System.Drawing.Size(61, 13); this.startHandLabel.TabIndex = 19; @@ -478,7 +484,7 @@ private void InitializeComponent() // // startDuelButton // - this.startDuelButton.Location = new System.Drawing.Point(4, 403); + this.startDuelButton.Location = new System.Drawing.Point(4, 431); this.startDuelButton.Name = "startDuelButton"; this.startDuelButton.Size = new System.Drawing.Size(75, 23); this.startDuelButton.TabIndex = 21; @@ -489,7 +495,7 @@ private void InitializeComponent() // player1AICheckBox // this.player1AICheckBox.AutoSize = true; - this.player1AICheckBox.Location = new System.Drawing.Point(5, 381); + this.player1AICheckBox.Location = new System.Drawing.Point(5, 409); this.player1AICheckBox.Name = "player1AICheckBox"; this.player1AICheckBox.Size = new System.Drawing.Size(49, 17); this.player1AICheckBox.TabIndex = 22; @@ -501,7 +507,7 @@ private void InitializeComponent() this.player2AICheckBox.AutoSize = true; this.player2AICheckBox.Checked = true; this.player2AICheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.player2AICheckBox.Location = new System.Drawing.Point(60, 381); + this.player2AICheckBox.Location = new System.Drawing.Point(60, 409); this.player2AICheckBox.Name = "player2AICheckBox"; this.player2AICheckBox.Size = new System.Drawing.Size(49, 17); this.player2AICheckBox.TabIndex = 23; @@ -513,7 +519,7 @@ private void InitializeComponent() this.player3AICheckBox.AutoSize = true; this.player3AICheckBox.Checked = true; this.player3AICheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.player3AICheckBox.Location = new System.Drawing.Point(115, 381); + this.player3AICheckBox.Location = new System.Drawing.Point(115, 409); this.player3AICheckBox.Name = "player3AICheckBox"; this.player3AICheckBox.Size = new System.Drawing.Size(49, 17); this.player3AICheckBox.TabIndex = 24; @@ -525,7 +531,7 @@ private void InitializeComponent() this.player4AICheckBox.AutoSize = true; this.player4AICheckBox.Checked = true; this.player4AICheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.player4AICheckBox.Location = new System.Drawing.Point(170, 381); + this.player4AICheckBox.Location = new System.Drawing.Point(170, 409); this.player4AICheckBox.Name = "player4AICheckBox"; this.player4AICheckBox.Size = new System.Drawing.Size(49, 17); this.player4AICheckBox.TabIndex = 25; @@ -545,7 +551,7 @@ private void InitializeComponent() "Random", "Self", "Opponent"}); - this.startingPlayerComboBox.Location = new System.Drawing.Point(80, 185); + this.startingPlayerComboBox.Location = new System.Drawing.Point(80, 190); this.startingPlayerComboBox.Name = "startingPlayerComboBox"; this.startingPlayerComboBox.Size = new System.Drawing.Size(146, 21); this.startingPlayerComboBox.TabIndex = 26; @@ -555,7 +561,7 @@ private void InitializeComponent() this.fullReloadCheckBox.AutoSize = true; this.fullReloadCheckBox.Checked = true; this.fullReloadCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.fullReloadCheckBox.Location = new System.Drawing.Point(5, 120); + this.fullReloadCheckBox.Location = new System.Drawing.Point(5, 145); this.fullReloadCheckBox.Name = "fullReloadCheckBox"; this.fullReloadCheckBox.Size = new System.Drawing.Size(79, 17); this.fullReloadCheckBox.TabIndex = 27; @@ -565,7 +571,7 @@ private void InitializeComponent() // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(2, 189); + this.label1.Location = new System.Drawing.Point(2, 194); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(75, 13); this.label1.TabIndex = 28; @@ -574,7 +580,7 @@ private void InitializeComponent() // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(2, 215); + this.label2.Location = new System.Drawing.Point(2, 220); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(60, 13); this.label2.TabIndex = 29; @@ -624,9 +630,12 @@ private void InitializeComponent() // // duelSettingsPanel // + this.duelSettingsPanel.Controls.Add(this.goToSceeenButton); + this.duelSettingsPanel.Controls.Add(this.screenComboBox); + this.duelSettingsPanel.Controls.Add(this.seedNumericUpDown); + this.duelSettingsPanel.Controls.Add(this.seedLabel); this.duelSettingsPanel.Controls.Add(this.useCustomHandCountLP); this.duelSettingsPanel.Controls.Add(this.duelKindComboBox); - this.duelSettingsPanel.Controls.Add(this.masterRules5CheckBox); this.duelSettingsPanel.Controls.Add(this.duelRewardsCheckBox); this.duelSettingsPanel.Controls.Add(this.speedMultiplierLabel); this.duelSettingsPanel.Controls.Add(this.tagDuelCheckBox); @@ -655,9 +664,41 @@ private void InitializeComponent() this.duelSettingsPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.duelSettingsPanel.Location = new System.Drawing.Point(217, 25); this.duelSettingsPanel.Name = "duelSettingsPanel"; - this.duelSettingsPanel.Size = new System.Drawing.Size(278, 430); + this.duelSettingsPanel.Size = new System.Drawing.Size(278, 465); this.duelSettingsPanel.TabIndex = 36; // + // seedNumericUpDown + // + this.seedNumericUpDown.Location = new System.Drawing.Point(67, 309); + this.seedNumericUpDown.Maximum = new decimal(new int[] { + -1, + 0, + 0, + 0}); + this.seedNumericUpDown.Name = "seedNumericUpDown"; + this.seedNumericUpDown.Size = new System.Drawing.Size(120, 20); + this.seedNumericUpDown.TabIndex = 38; + // + // seedLabel + // + this.seedLabel.AutoSize = true; + this.seedLabel.Location = new System.Drawing.Point(4, 311); + this.seedLabel.Name = "seedLabel"; + this.seedLabel.Size = new System.Drawing.Size(35, 13); + this.seedLabel.TabIndex = 37; + this.seedLabel.Text = "Seed:"; + // + // useCustomHandCountLP + // + this.useCustomHandCountLP.AutoSize = true; + this.useCustomHandCountLP.Location = new System.Drawing.Point(6, 242); + this.useCustomHandCountLP.Name = "useCustomHandCountLP"; + this.useCustomHandCountLP.Size = new System.Drawing.Size(143, 17); + this.useCustomHandCountLP.TabIndex = 36; + this.useCustomHandCountLP.Text = "Custom life points / hand"; + this.useCustomHandCountLP.UseVisualStyleBackColor = true; + this.useCustomHandCountLP.CheckedChanged += new System.EventHandler(this.useCustomHandCountLP_CheckedChanged); + // // duelKindComboBox // this.duelKindComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -666,30 +707,18 @@ private void InitializeComponent() "Regular", "Speed", "Rush"}); - this.duelKindComboBox.Location = new System.Drawing.Point(3, 70); + this.duelKindComboBox.Location = new System.Drawing.Point(3, 95); this.duelKindComboBox.Name = "duelKindComboBox"; this.duelKindComboBox.Size = new System.Drawing.Size(118, 21); this.duelKindComboBox.TabIndex = 35; this.duelKindComboBox.SelectedIndexChanged += new System.EventHandler(this.duelKindComboBox_SelectedIndexChanged); // - // masterRules5CheckBox - // - this.masterRules5CheckBox.AutoSize = true; - this.masterRules5CheckBox.Checked = true; - this.masterRules5CheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.masterRules5CheckBox.Location = new System.Drawing.Point(5, 166); - this.masterRules5CheckBox.Name = "masterRules5CheckBox"; - this.masterRules5CheckBox.Size = new System.Drawing.Size(173, 17); - this.masterRules5CheckBox.TabIndex = 34; - this.masterRules5CheckBox.Text = "Master Rules 5 (Link Evolution)"; - this.masterRules5CheckBox.UseVisualStyleBackColor = true; - // // duelRewardsCheckBox // this.duelRewardsCheckBox.AutoSize = true; this.duelRewardsCheckBox.Checked = true; this.duelRewardsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.duelRewardsCheckBox.Location = new System.Drawing.Point(5, 143); + this.duelRewardsCheckBox.Location = new System.Drawing.Point(5, 168); this.duelRewardsCheckBox.Name = "duelRewardsCheckBox"; this.duelRewardsCheckBox.Size = new System.Drawing.Size(68, 17); this.duelRewardsCheckBox.TabIndex = 33; @@ -726,22 +755,43 @@ private void InitializeComponent() this.setsDecksPanel.Size = new System.Drawing.Size(278, 25); this.setsDecksPanel.TabIndex = 37; // - // useCustomHandCountLP - // - this.useCustomHandCountLP.AutoSize = true; - this.useCustomHandCountLP.Location = new System.Drawing.Point(6, 237); - this.useCustomHandCountLP.Name = "useCustomHandCountLP"; - this.useCustomHandCountLP.Size = new System.Drawing.Size(143, 17); - this.useCustomHandCountLP.TabIndex = 36; - this.useCustomHandCountLP.Text = "Custom life points / hand"; - this.useCustomHandCountLP.UseVisualStyleBackColor = true; - this.useCustomHandCountLP.CheckedChanged += new System.EventHandler(this.useCustomHandCountLP_CheckedChanged); + // screenComboBox + // + this.screenComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.screenComboBox.FormattingEnabled = true; + this.screenComboBox.Location = new System.Drawing.Point(4, 27); + this.screenComboBox.Name = "screenComboBox"; + this.screenComboBox.Size = new System.Drawing.Size(118, 21); + this.screenComboBox.TabIndex = 39; + // + // goToSceeenButton + // + this.goToSceeenButton.Location = new System.Drawing.Point(125, 26); + this.goToSceeenButton.Name = "goToSceeenButton"; + this.goToSceeenButton.Size = new System.Drawing.Size(39, 23); + this.goToSceeenButton.TabIndex = 40; + this.goToSceeenButton.Text = "Go"; + this.goToSceeenButton.UseVisualStyleBackColor = true; + this.goToSceeenButton.Click += new System.EventHandler(this.goToSceeenButton_Click); + // + // filterDeckLinkCheckBox + // + this.filterDeckLinkCheckBox.AutoSize = true; + this.filterDeckLinkCheckBox.Checked = true; + this.filterDeckLinkCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.filterDeckLinkCheckBox.Location = new System.Drawing.Point(128, 28); + this.filterDeckLinkCheckBox.Name = "filterDeckLinkCheckBox"; + this.filterDeckLinkCheckBox.Size = new System.Drawing.Size(46, 17); + this.filterDeckLinkCheckBox.TabIndex = 39; + this.filterDeckLinkCheckBox.Text = "Link"; + this.filterDeckLinkCheckBox.ThreeState = true; + this.filterDeckLinkCheckBox.UseVisualStyleBackColor = true; // // DuelStarterForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(495, 455); + this.ClientSize = new System.Drawing.Size(495, 490); this.Controls.Add(this.duelSettingsPanel); this.Controls.Add(this.setsDecksPanel); this.Controls.Add(this.decksListPanel1); @@ -759,6 +809,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.speedMultiplierNumericUpDown)).EndInit(); this.duelSettingsPanel.ResumeLayout(false); this.duelSettingsPanel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.seedNumericUpDown)).EndInit(); this.setsDecksPanel.ResumeLayout(false); this.ResumeLayout(false); @@ -813,11 +864,15 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox filterDeckFusionCheckBox; private System.Windows.Forms.CheckBox filterDeckSynchroCheckBox; private System.Windows.Forms.CheckBox filterDeckPendulumCheckBox; - private System.Windows.Forms.CheckBox masterRules5CheckBox; private System.Windows.Forms.Button unlockContentButtonButton; private System.Windows.Forms.Button animationsButton; private System.Windows.Forms.Panel setsDecksPanel; private System.Windows.Forms.ComboBox duelKindComboBox; private System.Windows.Forms.CheckBox useCustomHandCountLP; + private System.Windows.Forms.NumericUpDown seedNumericUpDown; + private System.Windows.Forms.Label seedLabel; + private System.Windows.Forms.Button goToSceeenButton; + private System.Windows.Forms.ComboBox screenComboBox; + private System.Windows.Forms.CheckBox filterDeckLinkCheckBox; } } \ No newline at end of file diff --git a/Lotd/UI/DuelStarterForm.cs b/Lotd/UI/DuelStarterForm.cs index 59a8130..92fe20a 100644 --- a/Lotd/UI/DuelStarterForm.cs +++ b/Lotd/UI/DuelStarterForm.cs @@ -48,6 +48,15 @@ public DuelStarterForm() startingPlayerComboBox.SelectedIndex = 0; duelKindComboBox.SelectedIndex = 0; + foreach (MemTools.ScreenState screen in Enum.GetValues(typeof(MemTools.ScreenState))) + { + screenComboBox.Items.Add(screen); + if (screen == MemTools.ScreenState.MainMenu) + { + screenComboBox.SelectedIndex = screenComboBox.Items.Count - 1; + } + } + if (Program.Version != GameVersion.Lotd) { // Rewards are handled differently on LE? @@ -112,6 +121,16 @@ private void speedMultiplierApplyButton_Click(object sender, EventArgs e) Program.MemTools.SetTimeMultiplier((double)speedMultiplierNumericUpDown.Value, true); } + private void goToSceeenButton_Click(object sender, EventArgs e) + { + if (!Program.MemTools.IsFullyLoaded) + { + return; + } + + Program.MemTools.SetScreenState((MemTools.ScreenState)screenComboBox.SelectedItem); + } + private void unlockContentButtonButton_Click(object sender, EventArgs e) { SimpleSaveDataForm contentForm = new SimpleSaveDataForm(); @@ -406,6 +425,7 @@ private void UpdateDecksList() bool hasRitual = false; bool hasSynchro = false; bool hasFusion = false; + bool hasLink = false; foreach (short cardId in cardIds) { CardInfo card; @@ -432,13 +452,18 @@ private void UpdateDecksList() { hasFusion = true; } + if (card.CardTypeFlags.HasFlag(CardTypeFlags.Link)) + { + hasLink = true; + } } } if (!FilterMatched(filterDeckXyzCheckBox, hasXyz) || !FilterMatched(filterDeckPendulumCheckBox, hasPendulum) || !FilterMatched(filterDeckRitualCheckBox, hasRitual) || !FilterMatched(filterDeckSynchroCheckBox, hasSynchro) || - !FilterMatched(filterDeckFusionCheckBox, hasFusion)) + !FilterMatched(filterDeckFusionCheckBox, hasFusion) || + !FilterMatched(filterDeckLinkCheckBox, hasLink)) { continue; } @@ -535,8 +560,8 @@ private void startDuelButton_Click(object sender, EventArgs e) startDuelInfo.SkipRockPaperScissors = skipRockPaperScissorsCheckBox.Checked; startDuelInfo.LifePoints = (int)lifePointsNumericUpDown.Value; startDuelInfo.StartingHandCount = (int)startingHandNumericUpDown.Value; + startDuelInfo.RandSeed = (int)(uint)seedNumericUpDown.Value; startDuelInfo.FullReload = fullReloadCheckBox.Checked; - startDuelInfo.MasterRules5 = masterRules5CheckBox.Checked; startDuelInfo.SetAvatarId(MemTools.Player.Self, playerDecks[0].DeckAvatarId); startDuelInfo.SetAvatarId(MemTools.Player.Opponent, playerDecks[1].DeckAvatarId);