Пример #1
0
        public void EditItems()
        {
            var obj   = ROM[GameFile.ItemStats]; // mini
            var data  = obj[0];
            var items = Item8.GetArray(data);
            var cache = new DataCache <Item8>(items);

            using var form = new GenericEditor <Item8>(cache, ROM.GetStrings(TextName.ItemNames), "Item Editor", Randomize);
            form.ShowDialog();
            if (!form.Modified)
            {
                cache.CancelEdits();
                return;
            }

            void Randomize()
            {
                var tradeEvos = new[] { 221, 226, 227, 233, 235, 252, 321, 322, 323, 324, 325, 573, 646, 647 };

                foreach (var item in items)
                {
                    if (item.ItemSprite == -1 || !tradeEvos.Contains(item.ItemID))
                    {
                        continue;
                    }

                    item.Boost0          = 8; // evo stone
                    item.EffectField     = 6; // use effect
                    item.CanUseOnPokemon = true;
                }
            }

            obj[0] = Item8.SetArray(items, data);
        }
Пример #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ItemSetId != 0UL)
            {
                hash ^= ItemSetId.GetHashCode();
            }
            if (Item1 != 0L)
            {
                hash ^= Item1.GetHashCode();
            }
            if (Item1Quantity != 0)
            {
                hash ^= Item1Quantity.GetHashCode();
            }
            if (Item2 != 0L)
            {
                hash ^= Item2.GetHashCode();
            }
            if (Item2Quantity != 0)
            {
                hash ^= Item2Quantity.GetHashCode();
            }
            if (Item3 != 0L)
            {
                hash ^= Item3.GetHashCode();
            }
            if (Item3Quantity != 0)
            {
                hash ^= Item3Quantity.GetHashCode();
            }
            if (Item4 != 0L)
            {
                hash ^= Item4.GetHashCode();
            }
            if (Item4Quantity != 0)
            {
                hash ^= Item4Quantity.GetHashCode();
            }
            if (Item5 != 0L)
            {
                hash ^= Item5.GetHashCode();
            }
            if (Item5Quantity != 0)
            {
                hash ^= Item5Quantity.GetHashCode();
            }
            if (Item6 != 0L)
            {
                hash ^= Item6.GetHashCode();
            }
            if (Item6Quantity != 0)
            {
                hash ^= Item6Quantity.GetHashCode();
            }
            if (Item7 != 0L)
            {
                hash ^= Item7.GetHashCode();
            }
            if (Item7Quantity != 0)
            {
                hash ^= Item7Quantity.GetHashCode();
            }
            if (Item8 != 0L)
            {
                hash ^= Item8.GetHashCode();
            }
            if (Item8Quantity != 0)
            {
                hash ^= Item8Quantity.GetHashCode();
            }
            if (Item9 != 0L)
            {
                hash ^= Item9.GetHashCode();
            }
            if (Item9Quantity != 0)
            {
                hash ^= Item9Quantity.GetHashCode();
            }
            if (Item10 != 0L)
            {
                hash ^= Item10.GetHashCode();
            }
            if (Item10Quantity != 0)
            {
                hash ^= Item10Quantity.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }