Пример #1
0
    /// <summary>
    /// 武器選択
    /// </summary>
    void Weapon()
    {
        mBG.SetActive(mWeaponChange);
        if (mStateManager.GetState() == States.Weapon)
        {
            mInputVec = new Vector3(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));

            if (mInputVec.y > 0)
            {
                mWeapon = WeaponsList.Sword;
            }
            else if (mInputVec.x > 0)
            {
                mWeapon = WeaponsList.Gun;
            }
            else if (mInputVec.y < 0)
            {
                mWeapon = WeaponsList.Fist;
            }
            else if (mInputVec.x < 0)
            {
                mWeapon = WeaponsList.Cane;
            }
        }
    }
Пример #2
0
    /// <summary>
    /// 武器
    /// </summary>
    /// <param name="weapon"></param>
    public void SetWeapon(WeaponsList weapon)
    {
        if (weapon == WeaponsList.None || weapon == mNewWeapon)
        {
            return;
        }

        mBeforeWeapon = mNewWeapon;
        mNewWeapon    = weapon;

        if (mNewWeapon == WeaponsList.Sword)
        {
            mHP -= mWeaponScript[WeaponsList.Sword].GetComponent <Sword>().GetWeaponHP();
            mWeaponScript[WeaponsList.Sword].GetComponent <Sword>().mIsRecast = false;
        }
        if (mNewWeapon == WeaponsList.Gun)
        {
            mHP -= mWeaponScript[WeaponsList.Gun].GetComponent <Gun>().GetWeaponHP();
            mWeaponScript[WeaponsList.Gun].GetComponent <Gun>().mIsRecast = false;
        }
        if (mNewWeapon == WeaponsList.Cane)
        {
            mHP -= mWeaponScript[WeaponsList.Cane].GetComponent <Cane>().GetWeaponHP();
            mWeaponScript[WeaponsList.Cane].GetComponent <Cane>().mIsRecast = false;
        }

        ActiveSetting();
    }
Пример #3
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));
            }
        }
Пример #4
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();
        }
Пример #5
0
        public void CreaturePicksUpWeapon(Entities entity, Weapon weapon)
        {
            if (!WeaponsList.Contains(weapon))
            {
                return;
            }

            entity.EquipWeapon(weapon);
        }
Пример #6
0
        public void CheckOut(string itemDictNum)
        {
            switch (itemDictNum.Substring(0, 1))
            {
            case "a":
                var armor = (Armor)ItemCatalog[itemDictNum];

                if (Hero.Gold >= armor.OriginalValue)
                {
                    Hero.Gold -= armor.OriginalValue;
                    ArmorList.Remove(armor);
                    Hero.ArmorsBag.Add(armor);
                    Console.WriteLine($"You bought a {armor.Name} for {armor.OriginalValue} gold");
                    Start();
                }
                else
                {
                    Console.WriteLine($"You do not have enough gold to purchase {armor.Name}");
                    Start();
                }
                break;

            case "p":
                var potion3 = (Potion)ItemCatalog[itemDictNum];
                if (Hero.Gold >= potion3.OriginalValue)
                {
                    Hero.Gold -= potion3.OriginalValue;
                    PotionsList.Remove(potion3);
                    Hero.PotionsBag.Add(potion3);
                    Console.WriteLine($"You bought a {potion3.Name} for {potion3.OriginalValue} gold");
                    Start();
                }
                else
                {
                    Console.WriteLine($"You do not have enough gold to purchase {potion3.Name}");
                    Start();
                }
                break;

            case "w":
                var weapon = (Weapon)ItemCatalog[itemDictNum];
                if (Hero.Gold >= weapon.OriginalValue)
                {
                    Hero.Gold -= weapon.OriginalValue;
                    WeaponsList.Remove(weapon);
                    Hero.WeaponsBag.Add(weapon);
                    Console.WriteLine($"You bought a {weapon.Name} for {weapon.OriginalValue} gold");
                    Start();
                }
                else
                {
                    Console.WriteLine($"You do not have enough gold to purchase {weapon.Name}");
                    Start();
                }
                break;
            }
        }
Пример #7
0
        public void HumanPickUpsWeapon(HumanPlayer Player, Weapon weapon)
        {
            if (!WeaponsList.Contains(weapon))
            {
                return;
            }

            Player.EquipWeapon(weapon);
        }
Пример #8
0
        public void cycleWeaponsLeft()
        {
            GameScreen.gameSFXs["cycle"].Play();
            if ((int)currentWeapon == 0)
            {
                return;
            }
            int intEnum = (int)(currentWeapon);

            intEnum--;
            currentWeapon = (WeaponsList)intEnum;
        }
Пример #9
0
        public void cycleWeaponsRight()
        {
            GameScreen.gameSFXs["cycle"].Play();
            if ((int)currentWeapon == (Enum.GetNames(typeof(WeaponsList)).Length - 1))
            {
                return;
            }
            int intEnum = (int)(currentWeapon);

            intEnum++;
            currentWeapon = (WeaponsList)intEnum;
        }
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Пример #11
0
        void ShopListWeapons()
        {
            var count = 1;

            Console.WriteLine("---Weapons For Sale---");
            foreach (var weapon in WeaponsList.OrderBy(x => x.Name))
            {
                Console.WriteLine($"w{count} {weapon.Name}, {weapon.OriginalValue}, {weapon.ResellValue}");
                ItemCatalog.Add($"w{count}", weapon);
                count++;
            }
            Console.WriteLine("");
        }
Пример #12
0
        public void ListWeapons()
        {
            Console.WriteLine("Weapons:");
            var count = 1;

            foreach (var weapon in WeaponsList.OrderBy(w => w.OriginalValue))
            {
                Console.WriteLine($"w{count}. {weapon.Name} - Original Value: {weapon.OriginalValue}, Resell Value: {weapon.ResellValue}");
                ItemCatalog.Add($"w{count}", weapon);
                count++;
            }
            Console.WriteLine();
        }
Пример #13
0
 /// <summary>
 /// 武器スクリプトのアクティブ化設定
 /// </summary>
 void Active(WeaponsList weapon)
 {
     foreach (KeyValuePair <WeaponsList, MonoBehaviour> attack in mWeaponScript)
     {
         if (weapon == attack.Key)
         {
             //move.Valueからだと変更できないみたい
             mWeaponScript[attack.Key].enabled = true;
         }
         else
         {
             mWeaponScript[attack.Key].enabled = false;
         }
     }
 }
Пример #14
0
    void Start()
    {
        //testing Pathing
        seeker = GetComponent <Seeker>();

        //get original name of the mech
        OGName = mech.name;
        //create unique instance of mech (clone)
        mech = Instantiate(mech);
        //rename the clone to the orginal name
        mech.name = OGName;
        mechTrans = GetComponent <Transform>();


        //get the full height of the model
        modelHeight = mech.MechPrefab.GetComponent <Renderer>().bounds.size.y;
        moveUnit(Vector3.zero, Vector3.zero);
        setCurrentHex();

        Debug.Log("My name is: " + mech.mechName +
                  " and I have: " + mech.movementRemaining + " movement remaining. I have: "
                  + mech.hpTorso + " Torso Hp remaining." + " And I am located at: " + x + ", " + y);


        //testing weapon loading
        loadWeapon("Autocannon");
        loadWeapon("Laser");
        loadWeapon("Flamer");
        loadWeapon("Railgun");
        setWepBools();

        //equip a default weapon
        if (WeaponsList.ContainsKey("00"))
        {
            equipWeapon("00");
        }
        //build the list of weapons to display in the GUI
        listWeapons();

        // log to return my dictionary
        // foreach (var key in WeaponsList)
        // {
        //     Debug.Log(key);
        // }
    }
Пример #15
0
 public void GivePowerUp(WeaponsList weapon)
 {
     /*switch (weapon) {
      *  case WeaponsList.GEMINI_MISSILE :
      *      weapons[weapon] += 1;
      *      break;
      *
      *  case WeaponsList.CRUSADER_MISSILE :
      *      break;
      *
      *  case WeaponsList.PORT_MISSILE :
      *      break;
      *
      *  default :
      *      break;
      * } */
     weapons[weapon] += 1;
 }
Пример #16
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();
        }
Пример #17
0
    void Start()
    {
        //取得
        mStateManager = GameObject.FindGameObjectWithTag("Manager").GetComponent <StateManager>();

        //設定
        mNewWeapon    = Scene.GetWeapon();
        mBeforeWeapon = WeaponsList.None;
        mWeaponScript = new Dictionary <WeaponsList, MonoBehaviour>()
        {
            { WeaponsList.Sword, GetComponent <Sword>() },
            { WeaponsList.Gun, GetComponent <Gun>() },
            { WeaponsList.Fist, GetComponent <Fist>() },
            { WeaponsList.Cane, GetComponent <Cane>() }
        };

        //最初の武器リソースをアクティブ
        ActiveSetting();
    }
Пример #18
0
    /// <summary>
    /// 武器選択モード移行
    /// </summary>
    void Mode()
    {
        if (mStateManager.GetState() != States.Normal && mStateManager.GetState() != States.Weapon)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.U))
        {
            mWeapon = WeaponsList.None;
            mStateManager.SetState(States.Weapon);
            mWeaponChange = true;
        }
        else if (Input.GetKeyUp(KeyCode.U))
        {
            GetComponent <Player>().SetWeapon(mWeapon);
            mStateManager.SetState(States.Normal);
            mWeaponChange = false;
        }
    }
Пример #19
0
        public CommandCenter(GameScreen gameScreen, Texture2D texture, Texture2D shield, Texture2D weapon, Vector2 position)
            : base(texture, position, 0.1f, 0.0f, true, SpriteEffects.None)
        {
            stasisDelay  = 0;
            _gameScreen  = gameScreen;
            _position    = position;
            _launchAngle = 0.0f;
            _Device      = Screen.graphics;
            // TODO: Make a list for all textures passed to this class
            texGeminiMissile  = weapon;
            texCrusaderShield = shield;
            currentWeapon     = WeaponsList.GEMINI_MISSILE;
            hp     = 100;
            radius = (_texture.Width * Scale) / 2;

            line = new Texture2D(_Device, 1, 1);
            line.SetData <Color> (
                new Color[] { Color.White }); // fill the texture with White
            shields = new List <CrusaderShield> ();
            weapons = new Dictionary <WeaponsList, int> ();
            weapons.Add(WeaponsList.GEMINI_MISSILE, 999);
            weapons.Add(WeaponsList.PORT_MISSILE, 3);
            weapons.Add(WeaponsList.CRUSADER_MISSILE, 3);
        }
Пример #20
0
 /// <summary>
 /// 武器選択
 /// </summary>
 /// <param name="weapon"></param>
 public void OnWeapon()
 {
     m_weaponCheck = m_weapon;
     SceneNavigator.Instance.Change(m_currentScene.ToString(), 1.5f);
 }
Пример #21
0
    void Start()
    {
        mStateManager = GameObject.FindGameObjectWithTag("Manager").GetComponent <StateManager>();

        mWeapon = Scene.GetWeapon();
    }
Пример #22
0
 public WeaponSystem(WeaponsList weaponsList)
 {
     _weaponsList = weaponsList;
 }
Пример #23
0
 public void RemoveWeaponFromWorld(Weapon weapon)
 {
     WeaponsList.Remove(weapon);
 }
Пример #24
0
        private void ConfirmChanges()
        {
            ObservableCollection <GameRule> SelectedRulesList   = new ObservableCollection <GameRule>(RulesList.Where(w => (w.IsSelected == true)));
            ObservableCollection <Weapon>   SelectedWeaponsList = new ObservableCollection <Weapon>(WeaponsList.Where(w => (w.IsSelected == true)));
            int SelectedNationID = (SelectedNation != null) ? SelectedNation.ID : 0;

            thisModel.ConfirmChanges(Name, SelectedNationID, Type, Composition, WeaponDescription, ArmourClass, Inexperienced, Regular, Veteran, PointsInexp, PointsReg, PointsVet, BaseSize, MaxSize, SelectedUnit, UnitsList, SelectedRulesList, SelectedWeaponsList);
            if (SelectedUnit != null)
            {
                Name              = SelectedUnit.Name;
                SelectedNation    = NationsList.Where(x => x.ID == SelectedUnit.NationID).FirstOrDefault();
                Type              = SelectedUnit.Type;
                Composition       = SelectedUnit.Composition;
                WeaponDescription = SelectedUnit.WeaponDescription;
                ArmourClass       = SelectedUnit.ArmourClass;
                Inexperienced     = SelectedUnit.Inexperienced;
                Regular           = SelectedUnit.Regular;
                Veteran           = SelectedUnit.Veteran;
                PointsInexp       = SelectedUnit.PointsInexp;
                PointsReg         = SelectedUnit.PointsReg;
                PointsVet         = SelectedUnit.PointsVet;
                BaseSize          = SelectedUnit.BaseSize;
                MaxSize           = SelectedUnit.MaxSize;
            }
            else
            {
                PrepareToAddNew();
            }
        }
Пример #25
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);
        }