Пример #1
0
        /// <summary>
        /// 装備文字を設定
        /// </summary>
        private void SetText()
        {
            ProtectionItem[] armor     = playerItem.CurrentArmor(); //装備を取得
            WeaponItem       leftHand  = playerItem.LeftHand();     //左手
            WeaponItem       rightHand = playerItem.RightHand();    //右手
            ConsumptionItem  arrow     = playerItem.Arrow();
            AccessaryItem    accessary = playerItem.Accessary();

            equips = new string[8];                                 //装備文字初期化
            for (int i = 0; i < 4; i++)                             //防具文字を設定
            {
                colors[i] = Color.White;
                SetProtectionText(ref equips[i], armor, (ProtectionItem.ProtectionType)i);
            }

            if (leftHand == null)           //左手に武器がない場合
            {
                colors[4] = Color.White;
                EquipNull(ref equips[4]);
            }
            else
            {
                colors[4] = Color.Lerp(Color.White, Color.Gold, leftHand.GetItemRare() / 8.0f);       //レア度で色付け
                equips[4] = leftHand.GetItemName() + " + " + leftHand.GetReinforcement();
            }

            if (rightHand == null)           //右手に武器がない場合
            {
                colors[5] = Color.White;
                EquipNull(ref equips[5]);
            }
            else
            {
                colors[5] = Color.Lerp(Color.White, Color.Gold, rightHand.GetItemRare() / 8.0f);       //レア度で色付け
                equips[5] = rightHand.GetItemName() + " + " + rightHand.GetReinforcement();
            }

            if (arrow == null)                //矢を装備していない場合
            {
                colors[6] = Color.White;
                EquipNull(ref equips[6]);
            }
            else
            {
                colors[6] = Color.Lerp(Color.White, Color.Gold, arrow.GetItemRare() / 8.0f);       //レア度で色付け
                equips[6] = arrow.GetItemName() + "(" + arrow.GetStack() + ")";
            }

            if (accessary == null)
            {
                colors[7] = Color.White;
                EquipNull(ref equips[7]);
            }
            else
            {
                colors[7] = Color.Lerp(Color.White, Color.Gold, accessary.GetItemRare() / 8.0f);       //レア度で色付け
                equips[7] = accessary.GetItemName();
            }
        }
Пример #2
0
        /// <summary>
        /// 使用アイテムの詳細設定
        /// </summary>
        /// <param name="item">アイテム</param>
        private void ConsumptionInfo(ConsumptionItem item)
        {
            info = new string[6];

            info[0] = item.GetItemName();
            info[1] = "レア度 " + item.GetItemRare();
            info[2] = "買値 " + item.GetItemPrice();
            info[3] = "重量 " + item.GetItemWeight();
            info[4] = "タイプ " + item.GetTypeText();
            info[5] = item.GetItemExplanation();

            if (item.GetTypeText() == "矢")
            {
                info[0] += "(" + item.GetStack() + ")";
            }
        }