/// <summary> /// 武器の詳細設定 /// </summary> /// <param name="weapon">武器</param> private void WeaponInfo(WeaponItem weapon) { info = new string[8]; WeaponItem currentWeapon = playerItem.LeftHand(); int[] diff = new int[2]; //現在装備している武器(左手)との差を取得 if (currentWeapon != null) { diff[0] = weapon.GetPower() - currentWeapon.GetPower(); diff[1] = weapon.GetDefense() - currentWeapon.GetDefense(); } else { diff[0] = weapon.GetPower(); diff[1] = weapon.GetDefense(); } colors[0] = GetColor(diff[0]); //色付け colors[1] = GetColor(diff[1]); //色付け info[0] = weapon.GetItemName() + " + " + weapon.GetReinforcement(); info[1] = "レア度 " + weapon.GetItemRare(); info[2] = "買値 " + weapon.GetItemPrice(); info[3] = "重量 " + weapon.GetItemWeight(); info[4] = "タイプ " + weapon.GetWeaponType(); info[5] = weapon.GetItemExplanation(); info[6] = "攻撃力 " + weapon.GetPower() + "(" + diff[0] + ")"; info[7] = "守備力 " + weapon.GetDefense() + "(" + diff[1] + ")"; }
/// <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(); } }