Пример #1
0
        private void StockShop()
        {
            //Add weapons to weapons list
            for (var loop = 1; loop <= 5; loop++)
            {
                WeaponsList.Add(new Weapon("Wooden Stick", 1, 3, 1));
                WeaponsList.Add(new Weapon("Kung Fu Fist", 3, 5, 3));
                WeaponsList.Add(new Weapon("ACME Boxing Glove", 5, 10, 5));
                WeaponsList.Add(new Weapon("Roundhouse Boots", 8, 18, 8));
            }

            //Add armor to armors list
            for (var loop = 1; loop <= 5; loop++)
            {
                ArmorsList.Add(new Armor("Leather Vest", 1, 2, 1));
                ArmorsList.Add(new Armor("Padded Shield", 2, 5, 3));
                ArmorsList.Add(new Armor("Shock Absorbing Robe", 5, 9, 5));
                ArmorsList.Add(new Armor("Chuck Norris' Beard", 7, 15, 8));
            }

            //Add potions to potions list
            for (var loop = 1; loop <= 5; loop++)
            {
                PotionsList.Add(new Potion("Sizzurp", 5, 5, 2));
                PotionsList.Add(new Potion("Super Sizzurp", 10, 10, 5));
                PotionsList.Add(new Potion("Sizzurp de Saints", 30, 30, 13));
            }
        }
Пример #2
0
        /// <summary>
        /// The load weapons.
        /// </summary>
        /// <param name="WeaponsList">The weapons list.</param>
        /// <remarks></remarks>
        public void LoadWeapons(ref List <CollectionInfo> WeaponsList)
        {
            if (WeaponsList == null)
            {
                WeaponsList = new List <CollectionInfo>();
            }
            else
            {
                WeaponsList.Clear();
            }

            map.OpenMap(MapTypes.Internal);

            // Lists all weapons
            for (int i = 0; i < map.MetaInfo.TagType.Length; i++)
            {
                if ((map.MetaInfo.TagType[i] == "itmc") || (map.MetaInfo.TagType[i] == "vehc"))
                {
                    CollectionInfo Weapon = new CollectionInfo();
                    Meta           m      = new Meta(map);
                    m.ReadMetaFromMap(i, false);

                    Weapon.ItmcTagNumber = i;

                    // Base address of ITMC tag, offset of WEAP pointer (+20)
                    map.BR.BaseStream.Position = map.MetaInfo.Offset[Weapon.ItmcTagNumber] + 20;
                    Weapon.WeapTagNumber       = map.Functions.ForMeta.FindMetaByID(map.BR.ReadInt32());
                    if (Weapon.WeapTagNumber == -1)
                    {
                        continue;
                    }

                    // Base address of WEAP tag, offset of HLMT pointer (+56)
                    map.BR.BaseStream.Position = map.MetaInfo.Offset[Weapon.WeapTagNumber] + 56;
                    Weapon.HlmtTagNumber       = map.Functions.ForMeta.FindMetaByID(map.BR.ReadInt32());
                    if (Weapon.HlmtTagNumber != -1)
                    {
                        // Base address of HLMT tag, offset of MODE pointer (+4)
                        map.BR.BaseStream.Position = map.MetaInfo.Offset[Weapon.HlmtTagNumber] + 4;
                        Weapon.ModelTagNumber      = map.Functions.ForMeta.FindMetaByID(map.BR.ReadInt32());
                        m.ReadMetaFromMap(Weapon.ModelTagNumber, false);
                        Weapon.Model = new ParsedModel(ref m);
                        ParsedModel.DisplayedInfo.LoadDirectXTexturesAndBuffers(ref device, ref Weapon.Model);

                        // Store names into Weapon
                        Weapon.TagPath = map.FileNames.Name[i];
                        Weapon.TagType = map.MetaInfo.TagType[i];
                        int      xx        = map.Functions.ForMeta.FindByNameAndTagType(Weapon.TagType, Weapon.TagPath);
                        string[] NameSplit = map.FileNames.Name[xx].Split('\\');
                        Weapon.Name = NameSplit[NameSplit.Length - 1];
                        Weapon.Name = Weapon.Name.Replace('_', ' ');
                        WeaponsList.Add(Weapon);
                    }
                }
            }

            map.CloseMap();
        }
Пример #3
0
        /// <summary>
        /// The load weapons.
        /// </summary>
        /// <param name="WeaponsList">The weapons list.</param>
        /// <remarks></remarks>
        public void LoadWeapons(ref List <CollectionInfo> WeaponsList)
        {
            if (WeaponsList == null)
            {
                WeaponsList = new List <CollectionInfo>();
            }
            else
            {
                WeaponsList.Clear();
            }

            map.OpenMap(MapTypes.Internal);

            // Lists all weapons
            for (int i = 0; i < map.MetaInfo.TagType.Length; i++)
            {
                if ((map.MetaInfo.TagType[i] == "itmc") || (map.MetaInfo.TagType[i] == "vehc"))
                {
                    CollectionInfo Weapon = new CollectionInfo();
                    Meta           m      = new Meta(map);
                    m.ReadMetaFromMap(i, false);

                    Weapon.ModelTagNumber = map.Functions.FindModelByBaseClass(i);
                    if (Weapon.ModelTagNumber != -1)
                    {
                        m.ReadMetaFromMap(Weapon.ModelTagNumber, false);
                        Weapon.Model = new ParsedModel(ref m);
                        ParsedModel.DisplayedInfo.LoadDirectXTexturesAndBuffers(ref device, ref Weapon.Model);

                        // Store names into Weapon
                        Weapon.TagPath = map.FileNames.Name[i];
                        Weapon.TagType = map.MetaInfo.TagType[i];
                        int      xx        = map.Functions.ForMeta.FindByNameAndTagType(Weapon.TagType, Weapon.TagPath);
                        string[] NameSplit = map.FileNames.Name[xx].Split('\\');
                        Weapon.Name = NameSplit[NameSplit.Length - 1];
                        Weapon.Name = Weapon.Name.Replace('_', ' ');
                        WeaponsList.Add(Weapon);
                    }
                }
            }

            map.CloseMap();
        }
Пример #4
0
        public void AddWeapontoWorld(TypeOfAttack attackType, double damage, string description, int positionX, int positionY)
        {
            WeaponsList.Add(WeaponFactory.GenerateWeapon(attackType, damage, description, positionX, positionY));

            OnEventChanged(EventArgs.Empty);
        }