2021-04-08 20:09:59 +08:00
|
|
|
|
using ET;
|
|
|
|
|
using FairyGUI;
|
|
|
|
|
using Cal.DataTable;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using Cal;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public class TabHelper
|
|
|
|
|
{
|
|
|
|
|
private static FUI_TabUI _ui;
|
|
|
|
|
private static FUI_TabUI _comprasionUi;
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public static FUI_TabUI FUI_TabUI
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_ui == null)
|
|
|
|
|
{
|
|
|
|
|
_ui = FUI_TabUI.CreateInstance(FUIComponent.Instance);
|
|
|
|
|
_ui.Name = _ui.self.id.ToString();
|
|
|
|
|
_ui.self.sortingOrder = 9998;
|
|
|
|
|
FUIComponent.Instance.Add(_ui, true);
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
return _ui;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void AddHideEvent()
|
|
|
|
|
{
|
|
|
|
|
GRoot.inst.GetTopWindow().onRemovedFromStage.Add(TabHelper.HideUI);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static FUI_TabUI FUI_TabComprasionUI
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_comprasionUi == null)
|
|
|
|
|
{
|
|
|
|
|
_comprasionUi = FUI_TabUI.CreateInstance(FUIComponent.Instance);
|
|
|
|
|
_comprasionUi.Name = _comprasionUi.self.id.ToString();
|
|
|
|
|
_comprasionUi.self.sortingOrder = 9998;
|
|
|
|
|
FUIComponent.Instance.Add(_comprasionUi, true);
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
return _comprasionUi;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
private static bool isShowing;
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
//private static bool isLastShowing;
|
|
|
|
|
private static FUI_TabUI OpenUI()
|
|
|
|
|
{
|
|
|
|
|
if (!isShowing)
|
|
|
|
|
{
|
|
|
|
|
isShowing = true;
|
|
|
|
|
FUI_TabUI.Visible = true;
|
|
|
|
|
FUI_TabUI.m_Show.Play();
|
|
|
|
|
}
|
|
|
|
|
#if !UNITY_STANDALONE
|
|
|
|
|
HideComprasionUI();
|
|
|
|
|
AddHideEvent();
|
|
|
|
|
#endif
|
|
|
|
|
return FUI_TabUI;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
private static FUI_TabUI OpenComprasionUI()
|
|
|
|
|
{
|
|
|
|
|
FUI_TabComprasionUI.Visible = true;
|
|
|
|
|
FUI_TabComprasionUI.m_Show.Play();
|
|
|
|
|
|
|
|
|
|
return FUI_TabComprasionUI;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public static void HideUI()
|
|
|
|
|
{
|
2021-05-03 01:54:31 +08:00
|
|
|
|
token?.Cancel();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
isShowing = false;
|
|
|
|
|
if (FUI_TabUI.Visible)
|
|
|
|
|
{
|
|
|
|
|
FUI_TabUI.Visible = false;
|
|
|
|
|
FUI_TabUI.m_Hide.Play();
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (FUI_TabComprasionUI.Visible)
|
|
|
|
|
{
|
|
|
|
|
FUI_TabComprasionUI.Visible = false;
|
|
|
|
|
FUI_TabComprasionUI.m_Hide.Play();
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public static void HideComprasionUI()
|
|
|
|
|
{
|
|
|
|
|
if (FUI_TabComprasionUI.Visible)
|
|
|
|
|
{
|
|
|
|
|
FUI_TabComprasionUI.Visible = false;
|
|
|
|
|
FUI_TabComprasionUI.m_Hide.Play();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public struct QualityColor
|
|
|
|
|
{
|
|
|
|
|
public const string Common = "#FFFFFF";
|
|
|
|
|
public const string UnCommon = "#00CD14";
|
|
|
|
|
public const string Rare = "#0027FF";
|
|
|
|
|
public const string Epic = "#FF00B8";
|
|
|
|
|
public const string Legendary = "#FF6600";
|
|
|
|
|
public const string Ulti = "#FF0000";
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public const string YellowStar = "[img]ui://kqsmrpxlp2c66p[/img]";
|
|
|
|
|
public const string SliverStar = "[img]ui://kqsmrpxlp2c66q[/img]";
|
|
|
|
|
public const string Gold = "[img]ui://kqsmrpxleh2aa[/img]";
|
|
|
|
|
public const string Sliver = "[img]ui://kqsmrpxleh2ab[/img]";
|
|
|
|
|
public const string Coin = "[img]ui://kqsmrpxleh2am[/img]";
|
|
|
|
|
|
|
|
|
|
private const int TitleSize = 18;
|
|
|
|
|
|
|
|
|
|
private static StringBuilder sb = new StringBuilder();
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-05-03 01:54:31 +08:00
|
|
|
|
private static EventCallback0 action;
|
|
|
|
|
private static ETCancellationToken token;
|
|
|
|
|
|
|
|
|
|
public static void SetTab(GObject btn, EventCallback0 _action, bool isVisal = false)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
#if UNITY_STANDALONE
|
2021-05-05 13:36:19 +08:00
|
|
|
|
btn.data = _action;
|
|
|
|
|
btn.onRollOver.Set1(OnRollOver);
|
2021-05-03 01:54:31 +08:00
|
|
|
|
btn.onRollOut.Set(TabHelper.HideUI);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
#else
|
2021-05-03 01:54:31 +08:00
|
|
|
|
if(isVisal)
|
|
|
|
|
btn.onClick.Set(_action);
|
|
|
|
|
else
|
|
|
|
|
btn.onClick.Add(_action);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
#endif
|
2021-05-03 01:54:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-05 13:36:19 +08:00
|
|
|
|
private static async void OnRollOver(EventContext context)
|
2021-05-03 01:54:31 +08:00
|
|
|
|
{
|
2021-05-05 13:36:19 +08:00
|
|
|
|
action = context.sender.As<GObject>().data as EventCallback0;
|
2021-05-03 01:54:31 +08:00
|
|
|
|
token?.Cancel();
|
|
|
|
|
token = new ETCancellationToken();
|
2021-05-14 15:28:23 +08:00
|
|
|
|
var ret = await TimerComponent.Instance.WaitAsync(350, token);
|
2021-05-03 01:54:31 +08:00
|
|
|
|
if (ret)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
action?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-03 01:54:31 +08:00
|
|
|
|
private static readonly List<string> itemDescList = new List<string>();
|
2021-05-14 15:28:23 +08:00
|
|
|
|
private static readonly string SpaceLine3 = "[size=3] [/size]";
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
public static void OpenUI(Scene zoneScene, ClientItemData data, bool isComprasion = true, long unitId = 0)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-14 15:28:23 +08:00
|
|
|
|
bool isMine = unitId == 0;
|
|
|
|
|
Unit unit = unitId == 0? zoneScene.GetComponent<UnitComponent>().MyUnit : zoneScene.GetComponent<UnitComponent>().Get(unitId);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
ClientItemData wornEquipData = null;
|
|
|
|
|
sb.Length = 0;
|
|
|
|
|
itemDescList.Clear();
|
2021-05-05 13:36:19 +08:00
|
|
|
|
string starSoulString = null;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
switch (data.ItemType)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
case ItemType.EquipItem:
|
2021-05-01 22:06:12 +08:00
|
|
|
|
{
|
|
|
|
|
EquipBase equipBase = DataTableHelper.Get<EquipBase>(data.ItemId);
|
|
|
|
|
int index = equipBase.Type;
|
|
|
|
|
if (isComprasion)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
isComprasion = false;
|
|
|
|
|
if (ClientItemDataComponent.Instance.WornEquipDic.TryGetValue(index, out wornEquipData))
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
isComprasion = wornEquipData.ItemType == ItemType.EquipItem;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Quality quality;
|
|
|
|
|
if (data.Equip.quality == 0)
|
|
|
|
|
quality = (Quality) equipBase.Quality;
|
|
|
|
|
else
|
|
|
|
|
quality = data.Equip.quality;
|
|
|
|
|
string equipLevel = null;
|
|
|
|
|
if (data.Equip.level > 0)
|
|
|
|
|
{
|
|
|
|
|
equipLevel = "+" + data.Equip.level;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sb.AppendFormat($"[color={GetQualityColor(quality)}][size={TitleSize}][b]{equipBase.Name} {equipLevel}[/b][/size][/color]\n");
|
|
|
|
|
int star;
|
|
|
|
|
if (data.Equip.star == 0)
|
|
|
|
|
star = equipBase.Star;
|
|
|
|
|
else
|
|
|
|
|
star = data.Equip.star;
|
|
|
|
|
for (int i = 0; i < star; i++)
|
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat(YellowStar);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sb.AppendFormat("\n");
|
|
|
|
|
sb.AppendFormat($"装备 {(EquipType) equipBase.Type}\n");
|
|
|
|
|
(long gold, int sliver, int coin) = GetCoinFormat(equipBase.Price);
|
|
|
|
|
sb.Append($"单价: {gold}{Gold} {sliver}{Sliver} {coin}{Coin}\n");
|
|
|
|
|
string isLock = data.IsLock? "已绑定" : "未绑定";
|
|
|
|
|
sb.AppendFormat($"[color=#ff99cc]{isLock}[/color]\n");
|
|
|
|
|
sb.AppendFormat($"需要等级:{equipBase.UseLevel}\n");
|
|
|
|
|
sb.AppendFormat($"需要职业: {GetStrJob(equipBase.JobId, equipBase.Transmigration)}\n");
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-01 22:06:12 +08:00
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
GetEquipSpecialAtrribute(data.Equip, itemDescList);
|
|
|
|
|
foreach (string item in itemDescList)
|
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-01 22:06:12 +08:00
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
GetEquipBaseAtrribute(data.Equip, equipBase, itemDescList);
|
|
|
|
|
foreach (string item in itemDescList)
|
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-01 22:06:12 +08:00
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
GetEquipAdditionalAtrribute(data.Equip, itemDescList);
|
|
|
|
|
foreach (string item in itemDescList)
|
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (int item in data.Equip.gemList)
|
|
|
|
|
{
|
|
|
|
|
if (item == 0)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendFormat($"{SliverStar}\n");
|
|
|
|
|
continue;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
|
|
|
|
MaterialBase materialBase = DataTableHelper.Get<MaterialBase>(item);
|
|
|
|
|
sb.AppendFormat(
|
|
|
|
|
$"{YellowStar}[color=#e9d099]{GteGemValue((AttributeType) materialBase.GemKey, materialBase.GemValue)}[/color]\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!data.getSource.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
sb.AppendLine($"来源:[color=#ffff00][i]{data.getSource}[/i][/color]");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SuitConfig suitConfig = SuitConfigCategory.Instance.GetSuitConfigByEquipId(data.ItemId);
|
|
|
|
|
if (suitConfig != null)
|
|
|
|
|
{
|
2021-04-08 20:09:59 +08:00
|
|
|
|
itemDescList.Clear();
|
2021-05-01 22:06:12 +08:00
|
|
|
|
GetEquipSuitAtrribute(suitConfig.SuitArr, itemDescList);
|
|
|
|
|
sb.AppendFormat($"套装属性:\n");
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (string item in itemDescList)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
StarSoulBag bag = unit.GetComponent<StarSoulBag>();
|
|
|
|
|
|
2021-05-05 13:36:19 +08:00
|
|
|
|
long starSoulId = bag.usedStarSoulDic[(byte) index];
|
|
|
|
|
if (starSoulId != 0)
|
2021-05-03 01:54:31 +08:00
|
|
|
|
{
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-03 01:54:31 +08:00
|
|
|
|
sb.AppendLine("----星魂----");
|
2021-05-05 13:36:19 +08:00
|
|
|
|
starSoulString = GenerateStarSoulString(sb, bag, starSoulId, needReturn: true);
|
2021-05-03 01:54:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendFormat($"[color=#ffff99]{equipBase.Description}[/color]");
|
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
break;
|
|
|
|
|
case ItemType.GoodsItem:
|
2021-05-01 22:06:12 +08:00
|
|
|
|
{
|
|
|
|
|
GoodsBase goodsBase = DataTableHelper.Get<GoodsBase>(data.ItemId);
|
|
|
|
|
Quality quality = (Quality) goodsBase.Quality;
|
|
|
|
|
sb.AppendFormat($"[color={GetQualityColor(quality)}][size={TitleSize}][b]{goodsBase.Name}[/b][/size][/color]\n");
|
|
|
|
|
sb.AppendFormat($"道具 消耗品\n");
|
|
|
|
|
(long gold, int sliver, int coin) = GetCoinFormat(goodsBase.Price);
|
|
|
|
|
sb.Append($"单价: {gold}{Gold} {sliver}{Sliver} {coin}{Coin}\n");
|
|
|
|
|
string isLock = data.IsLock? "已绑定" : "未绑定";
|
|
|
|
|
sb.AppendFormat($"[color=#ff99cc]{isLock}[/color]\n");
|
|
|
|
|
sb.AppendFormat($"需要等级:{goodsBase.UsedLevel}\n");
|
|
|
|
|
sb.AppendFormat($"[color=#ffff99]{goodsBase.Description}[/color]");
|
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
break;
|
|
|
|
|
case ItemType.MaterialsItem:
|
2021-05-01 22:06:12 +08:00
|
|
|
|
{
|
|
|
|
|
MaterialBase materialBase = DataTableHelper.Get<MaterialBase>(data.ItemId);
|
|
|
|
|
Quality quality = (Quality) materialBase.Quality;
|
|
|
|
|
sb.AppendFormat($"[color={GetQualityColor(quality)}][size={TitleSize}][b]{materialBase.Name}[/b][/size][/color]\n");
|
|
|
|
|
sb.AppendFormat(
|
|
|
|
|
$"材料 {((MaterialsType) materialBase.MaterialType == MaterialsType.普通材料? MaterialsType.普通材料.ToString() : ((GemType) materialBase.GemType).ToString())}\n");
|
|
|
|
|
(long gold, int sliver, int coin) = GetCoinFormat(materialBase.Price);
|
|
|
|
|
sb.Append($"单价: {gold}{Gold} {sliver}{Sliver} {coin}{Coin}\n");
|
|
|
|
|
string isLock = data.IsLock? "已绑定" : "未绑定";
|
|
|
|
|
sb.AppendFormat($"[color=#ff99cc]{isLock}[/color]\n");
|
|
|
|
|
if (materialBase.MaterialType == (int) MaterialsType.宝石)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendLine($"[color=#99bf88]{GteGemValue((AttributeType) materialBase.GemKey, materialBase.GemValue)}[/color]");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
|
|
|
|
sb.Append($"[color=#ffff99]{materialBase.Description}[/color]");
|
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-11 19:50:39 +08:00
|
|
|
|
FUI_TabUI ui = OpenUI();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
ui.m_title.text = sb.ToString();
|
|
|
|
|
Vector2 pos = GRoot.inst.GetPoupPosition(ui.self, null, null);
|
|
|
|
|
Vector2 offset = new Vector2(15, 15);
|
|
|
|
|
pos += offset;
|
|
|
|
|
ui.self.position = pos;
|
|
|
|
|
if (isComprasion)
|
|
|
|
|
{
|
|
|
|
|
if (wornEquipData == null) return;
|
2021-04-11 19:50:39 +08:00
|
|
|
|
FUI_TabUI comUI = OpenComprasionUI();
|
|
|
|
|
Vector2 newPos = GetComprasionPos(comUI.self, pos);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
comUI.self.position = newPos;
|
|
|
|
|
sb.Length = 0;
|
|
|
|
|
//!产生字符
|
|
|
|
|
EquipBase equipBase = DataTableHelper.Get<EquipBase>(wornEquipData.ItemId);
|
2021-05-01 22:06:12 +08:00
|
|
|
|
Quality quality = (Quality) equipBase.Quality;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
string equipLevel = null;
|
|
|
|
|
if (wornEquipData.Equip.level > 0)
|
|
|
|
|
{
|
|
|
|
|
equipLevel = "+" + wornEquipData.Equip.level;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
sb.AppendFormat($"[color={GetQualityColor(quality)}][size={TitleSize}][b]{equipBase.Name} {equipLevel}[/b][/size][/color]\n");
|
|
|
|
|
for (int i = 0; i < equipBase.Star; i++)
|
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat(YellowStar);
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
sb.AppendFormat("\n");
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendFormat($"装备[color=#99cc33](已穿戴)[/color] {(EquipType) equipBase.Type}\n");
|
2021-04-11 19:50:39 +08:00
|
|
|
|
(long gold, int sliver, int coin) = GetCoinFormat(equipBase.Price);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
sb.Append($"单价: {gold}{Gold} {sliver}{Sliver} {coin}{Coin}\n");
|
|
|
|
|
sb.AppendFormat($"[color=#ff99cc]已绑定[/color]\n");
|
|
|
|
|
sb.AppendFormat($"需要等级:{equipBase.UseLevel}\n");
|
|
|
|
|
sb.AppendFormat($"需要职业: {GetStrJob(equipBase.JobId, equipBase.Transmigration)}\n");
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
GetEquipSpecialAtrribute(wornEquipData.Equip, itemDescList);
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (string item in itemDescList)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
GetEquipBaseAtrribute(wornEquipData.Equip, equipBase, itemDescList);
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (string item in itemDescList)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
GetEquipAdditionalAtrribute(wornEquipData.Equip, itemDescList);
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (string item in itemDescList)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (int item in wornEquipData.Equip.gemList)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
if (item == 0)
|
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"{SliverStar}\n");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-01 22:06:12 +08:00
|
|
|
|
MaterialBase materialBase = DataTableHelper.Get<MaterialBase>(item);
|
|
|
|
|
sb.AppendFormat(
|
|
|
|
|
$"{YellowStar}[color=#e9d099]{GteGemValue((AttributeType) materialBase.GemKey, materialBase.GemValue)}[/color]\n");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!wornEquipData.getSource.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
sb.AppendLine($"来源:[color=#ffff00][i]{wornEquipData.getSource}[/i][/color]");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
|
2021-05-05 13:36:19 +08:00
|
|
|
|
if (starSoulString != null)
|
2021-05-03 01:54:31 +08:00
|
|
|
|
{
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-03 01:54:31 +08:00
|
|
|
|
sb.AppendLine("----星魂----");
|
2021-05-05 13:36:19 +08:00
|
|
|
|
sb.Append(starSoulString);
|
2021-05-03 01:54:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
sb.AppendFormat($"[color=#ffff99]{equipBase.Description}[/color]");
|
|
|
|
|
//!字符串赋值
|
|
|
|
|
FUI_TabComprasionUI.m_title.text = sb.ToString();
|
|
|
|
|
}
|
2021-05-03 01:54:31 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-05-05 13:36:19 +08:00
|
|
|
|
private static string GenerateStarSoulString(StringBuilder sb, StarSoulBag bag, long equipStarSoulId, bool showPosType = false,
|
|
|
|
|
bool needReturn = false)
|
|
|
|
|
{
|
|
|
|
|
if (equipStarSoulId == 0)
|
|
|
|
|
return string.Empty;
|
|
|
|
|
StarSoulItem starSoulItem = bag.Get(equipStarSoulId);
|
|
|
|
|
return GenerateStarSoulString(sb, bag, starSoulItem, showPosType, needReturn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GenerateStarSoulString(StringBuilder sb, StarSoulBag bag, StarSoulItem starSoulItem, bool showPosType = false,
|
|
|
|
|
bool needReturn = false)
|
|
|
|
|
{
|
|
|
|
|
int startIndex = sb.Length;
|
|
|
|
|
StarSoulTypeConfig starSoulTypeConfig = StarSoulTypeConfigCategory.Instance.Get(starSoulItem.typeId);
|
|
|
|
|
sb.AppendLine(
|
|
|
|
|
$"[color={GetQualityColor(starSoulItem.quality)}][size={TitleSize}][b]{starSoulTypeConfig.Name} +{starSoulItem.level}[/b][/size][/color]");
|
|
|
|
|
|
|
|
|
|
if (showPosType)
|
|
|
|
|
{
|
|
|
|
|
sb.AppendLine($"可放置位置:{starSoulItem.posType}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StarSoulAttributeConfig soulAttributeConfig = StarSoulAttributeConfigCategory.Instance.Get(starSoulItem.mainAttribute);
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-05 13:36:19 +08:00
|
|
|
|
sb.AppendLine("固定属性:");
|
|
|
|
|
sb.AppendLine(
|
|
|
|
|
$"[color=#99bf88]{GetAttributeString((Cal.AttributeType) soulAttributeConfig.Key, ItemHelper.GetRealMainValue(soulAttributeConfig.Value, starSoulItem.level))}[/color]");
|
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-05 13:36:19 +08:00
|
|
|
|
sb.AppendLine("随机属性:");
|
|
|
|
|
for (var i = 0; i < starSoulItem.viceAttribute.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
int __id = starSoulItem.viceAttribute[i];
|
|
|
|
|
if (__id == 0)
|
|
|
|
|
break;
|
|
|
|
|
soulAttributeConfig = StarSoulAttributeConfigCategory.Instance.Get(__id);
|
|
|
|
|
sb.AppendLine(
|
|
|
|
|
$"[color=#99bf88]{GetAttributeString((Cal.AttributeType) soulAttributeConfig.Key, ItemHelper.GetRealViceValue(soulAttributeConfig.Value * (1 + starSoulItem.viceAdd[i]), starSoulItem.quality))}[/color]");
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-05 13:36:19 +08:00
|
|
|
|
sb.AppendLine("套装属性:");
|
|
|
|
|
StarSoulSuit suit = bag.Suits.Find(t => t.Id == starSoulItem.typeId);
|
|
|
|
|
string color = "#999999";
|
2021-05-14 15:28:23 +08:00
|
|
|
|
if (suit != null && suit.type.HasFlag(StarSoulSuit.StarSoulSuitType.Suit4))
|
2021-05-05 13:36:19 +08:00
|
|
|
|
color = "#ccee00";
|
|
|
|
|
sb.AppendLine($"[color={color}]4件套:\n {starSoulTypeConfig.Suit4}[/color]");
|
|
|
|
|
color = "#999999";
|
2021-05-14 15:28:23 +08:00
|
|
|
|
if (suit != null && suit.type.HasFlag(StarSoulSuit.StarSoulSuitType.Suit8))
|
2021-05-05 13:36:19 +08:00
|
|
|
|
color = "#cc9900";
|
|
|
|
|
if (!starSoulTypeConfig.Suit8.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
sb.AppendLine($"[color={color}]8件套:\n {starSoulTypeConfig.Suit8}[/color]");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (needReturn)
|
|
|
|
|
return sb.ToString(startIndex, sb.Length - startIndex);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Vector2 GetComprasionPos(GObject gObject, Vector2 oldPos)
|
2021-05-03 01:54:31 +08:00
|
|
|
|
{
|
|
|
|
|
Vector2 tempPos = oldPos + new Vector2(-gObject.width, 0);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
2021-05-03 01:54:31 +08:00
|
|
|
|
return tempPos;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void GetEquipSuitAtrribute(SuitConfig.Suit[] suitArr, List<string> list)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (SuitConfig.Suit suit in suitArr)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
list.Add(TabHelper.GetAttributeString((Cal.AttributeType) suit.Key, suit.Value));
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//!获取装备的词条
|
|
|
|
|
static void GetEquipBaseAtrribute(Equip equip, EquipBase equipBase, List<string> list)
|
|
|
|
|
{
|
|
|
|
|
foreach (var kv in equip.mainAttribute)
|
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
float value = TabHelper.GetValueFromConfig((Cal.AttributeType) kv.Key, equipBase);
|
|
|
|
|
AttributeType attributeType = (AttributeType) kv.Key;
|
|
|
|
|
list.Add($"{GetAttributeString(attributeType, value, 1 + kv.Value)}{GetPercent(kv.Value)}");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (int manulequipId in equip.randomAttributes)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
ManulEquipAttribute manulEquipAttribute = ManulEquipAttributeCategory.Instance.Get(manulequipId);
|
|
|
|
|
if (manulEquipAttribute != null)
|
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
list.Add($"{GetAttributeString((AttributeType) manulEquipAttribute.Key, manulEquipAttribute.Value)}");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
|
|
|
|
public static string GetPercent(float percent)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
return percent >= 0? $"[color=#99cc33] ({percent:p2})[/color]" : $"[color=#cc3333] ({percent:p2})[/color]";
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
//!获取装备的词条
|
|
|
|
|
static void GetEquipAdditionalAtrribute(Equip equip, List<string> list)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (int affixId in equip.addtionalAttributes)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
if (affixId == 0) continue;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
EquipAffixConfig equipAffixConfig = EquipAffixConfigCategory.Instance.Get(affixId);
|
|
|
|
|
if (equipAffixConfig != null)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (EquipAffixConfig.Affix affix in equipAffixConfig.AffixArr)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
list.Add(TabHelper.GetAttributeString((Cal.AttributeType) affix.Key, affix.Value));
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
static void GetEquipSpecialAtrribute(Equip equip, List<string> list)
|
|
|
|
|
{
|
|
|
|
|
float add;
|
|
|
|
|
Strengthentable strengthentable = StrengthentableCategory.Instance.Get(equip.level, false);
|
|
|
|
|
if (strengthentable == null)
|
|
|
|
|
{
|
|
|
|
|
add = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
2021-05-01 22:06:12 +08:00
|
|
|
|
add = 1 + strengthentable.AttribteAdd;
|
|
|
|
|
|
|
|
|
|
if (equip.specialKey != AttributeType.无)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
EquipBase equipBase = EquipBaseCategory.Instance.Get(equip.EquipId);
|
|
|
|
|
list.Add($"{equip.specialKey}:{MathHelper.RoundToInt(equipBase.SpecialValue * add)}");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ManulEquipAttribute manulEquipAttribute = ManulEquipAttributeCategory.Instance.Get(equip.specialId);
|
2021-05-01 22:06:12 +08:00
|
|
|
|
if (manulEquipAttribute != null)
|
|
|
|
|
list.Add($"{(Cal.AttributeType) manulEquipAttribute.Key}:{MathHelper.RoundToInt(manulEquipAttribute.Value * add)}");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
|
|
|
|
public static string GetAttributeString(AttributeType attributeType, float value, float coeffict = 1)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
string str = null;
|
|
|
|
|
switch (attributeType)
|
|
|
|
|
{
|
|
|
|
|
case AttributeType.最大生命:
|
|
|
|
|
case AttributeType.最大精力:
|
|
|
|
|
case AttributeType.力量:
|
|
|
|
|
case AttributeType.敏捷:
|
|
|
|
|
case AttributeType.精神:
|
|
|
|
|
case AttributeType.智慧:
|
|
|
|
|
case AttributeType.体质:
|
|
|
|
|
case AttributeType.耐力:
|
|
|
|
|
case AttributeType.物理攻击:
|
|
|
|
|
case AttributeType.精神攻击:
|
|
|
|
|
case AttributeType.物理防御:
|
|
|
|
|
case AttributeType.精神防御:
|
|
|
|
|
str = $"{attributeType}:{MathHelper.RoundToInt(value * coeffict)}";
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.物理暴击系数:
|
|
|
|
|
case AttributeType.精神暴击系数:
|
|
|
|
|
case AttributeType.物理暴击效果:
|
|
|
|
|
case AttributeType.精神暴击效果:
|
|
|
|
|
case AttributeType.抗物理暴击系数:
|
|
|
|
|
case AttributeType.抗精神暴击系数:
|
|
|
|
|
case AttributeType.抗物理暴击效果:
|
|
|
|
|
case AttributeType.抗精神暴击效果:
|
|
|
|
|
case AttributeType.辅助值:
|
|
|
|
|
case AttributeType.物理免伤:
|
|
|
|
|
case AttributeType.精神免伤:
|
|
|
|
|
case AttributeType.速度:
|
|
|
|
|
case AttributeType.命中:
|
|
|
|
|
case AttributeType.抵抗:
|
|
|
|
|
case AttributeType.吸血率:
|
|
|
|
|
case AttributeType.吸血量:
|
|
|
|
|
case AttributeType.生命回复:
|
|
|
|
|
case AttributeType.物理增伤:
|
|
|
|
|
case AttributeType.精神增伤:
|
|
|
|
|
str = $"{attributeType}:{value * coeffict:p2}";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
return str;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
|
|
|
|
public static float GetValueFromConfig(AttributeType attributeType, EquipBase equipBase)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
switch (attributeType)
|
|
|
|
|
{
|
|
|
|
|
case AttributeType.无:
|
|
|
|
|
return 0;
|
|
|
|
|
case AttributeType.最大生命:
|
|
|
|
|
return equipBase.Hp;
|
|
|
|
|
case AttributeType.最大精力:
|
|
|
|
|
return equipBase.Mp;
|
|
|
|
|
case AttributeType.力量:
|
|
|
|
|
return equipBase.Str;
|
|
|
|
|
case AttributeType.敏捷:
|
|
|
|
|
return equipBase.Quk;
|
|
|
|
|
case AttributeType.精神:
|
|
|
|
|
return equipBase.Spi;
|
|
|
|
|
case AttributeType.智慧:
|
|
|
|
|
return equipBase.Wim;
|
|
|
|
|
case AttributeType.物理攻击:
|
|
|
|
|
return equipBase.PhyAtk;
|
|
|
|
|
case AttributeType.精神攻击:
|
|
|
|
|
return equipBase.SpiAtk;
|
|
|
|
|
case AttributeType.物理防御:
|
|
|
|
|
return equipBase.PhyDef;
|
|
|
|
|
case AttributeType.精神防御:
|
|
|
|
|
return equipBase.SpiDef;
|
|
|
|
|
case AttributeType.物理暴击系数:
|
|
|
|
|
return equipBase.Pcrir;
|
|
|
|
|
case AttributeType.精神暴击系数:
|
|
|
|
|
return equipBase.Mcrir;
|
|
|
|
|
case AttributeType.物理暴击效果:
|
|
|
|
|
return equipBase.Pcri;
|
|
|
|
|
case AttributeType.精神暴击效果:
|
|
|
|
|
return equipBase.Mcri;
|
|
|
|
|
case AttributeType.抗物理暴击系数:
|
|
|
|
|
return equipBase.Rpcrir;
|
|
|
|
|
case AttributeType.抗精神暴击系数:
|
|
|
|
|
return equipBase.Rmcrir;
|
|
|
|
|
case AttributeType.抗物理暴击效果:
|
|
|
|
|
return equipBase.Rpcri;
|
|
|
|
|
case AttributeType.抗精神暴击效果:
|
|
|
|
|
return equipBase.Rmcri;
|
|
|
|
|
case AttributeType.辅助值:
|
|
|
|
|
return equipBase.Dvo;
|
|
|
|
|
case AttributeType.体质:
|
|
|
|
|
return equipBase.Phy;
|
|
|
|
|
case AttributeType.耐力:
|
|
|
|
|
return equipBase.Sta;
|
|
|
|
|
case AttributeType.物理免伤:
|
|
|
|
|
return equipBase.Nphyi;
|
|
|
|
|
case AttributeType.精神免伤:
|
|
|
|
|
return equipBase.Nmeni;
|
|
|
|
|
case AttributeType.速度:
|
|
|
|
|
return equipBase.Spd;
|
|
|
|
|
case AttributeType.命中:
|
|
|
|
|
return equipBase.Hit;
|
|
|
|
|
case AttributeType.抵抗:
|
|
|
|
|
return equipBase.Res;
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void GetEquipSpecialAtrribute(EquipBase equip, List<string> list)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
var kv = new KeyValuePair<int, int>(equip.SpecialKey, equip.SpecialValue);
|
|
|
|
|
if (kv.Value == 0) return;
|
2021-05-01 22:06:12 +08:00
|
|
|
|
AttributeType attributeType = (AttributeType) kv.Key;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
switch (attributeType)
|
|
|
|
|
{
|
|
|
|
|
case AttributeType.最大生命:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.最大精力:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.力量:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.敏捷:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.精神:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.智慧:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.物理攻击:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.精神攻击:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.物理防御:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.精神防御:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.物理暴击系数:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.精神暴击系数:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.物理暴击效果:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.精神暴击效果:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.抗物理暴击系数:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.抗精神暴击系数:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.抗物理暴击效果:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.抗精神暴击效果:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.辅助值:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.体质:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.耐力:
|
|
|
|
|
list.Add($"{attributeType}:{MathHelper.RoundToInt(kv.Value)}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.物理免伤:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.精神免伤:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.速度:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:f0}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.命中:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
case AttributeType.抵抗:
|
|
|
|
|
list.Add($"{attributeType}:{kv.Value:p2}");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public static void OpenUI(int itemId, string additionalPrice = null)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
IConfig itemBase = BagHelper.GetItemBase(itemId);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
sb.Length = 0;
|
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
switch (itemBase)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
case EquipBase equipBase:
|
2021-05-01 22:06:12 +08:00
|
|
|
|
{
|
|
|
|
|
Quality quality = (Quality) equipBase.Quality;
|
|
|
|
|
sb.AppendFormat($"[color={GetQualityColor(quality)}][size={TitleSize}][b]{equipBase.Name}[/b][/size][/color]\n");
|
|
|
|
|
for (int i = 0; i < equipBase.Star; i++)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendFormat(YellowStar);
|
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendFormat("\n");
|
|
|
|
|
sb.AppendFormat($"装备 {(EquipType) equipBase.Type}\n");
|
|
|
|
|
(long gold, int sliver, int coin) = GetCoinFormat(equipBase.Price);
|
|
|
|
|
sb.Append($"单价: {gold}{Gold} {sliver}{Sliver} {coin}{Coin}\n");
|
|
|
|
|
string isLock = "未绑定";
|
|
|
|
|
sb.AppendFormat($"[color=#ff99cc]{isLock}[/color]\n");
|
|
|
|
|
sb.AppendFormat($"需要等级:{equipBase.UseLevel}\n");
|
|
|
|
|
sb.AppendFormat($"需要职业: {GetStrJob(equipBase.JobId, equipBase.Transmigration)}\n");
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-01 22:06:12 +08:00
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
GetEquipSpecialAtrribute(equipBase, itemDescList);
|
|
|
|
|
foreach (string item in itemDescList)
|
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-01 22:06:12 +08:00
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
GetEquiBaseAtrribute(equipBase, itemDescList);
|
|
|
|
|
foreach (string item in itemDescList)
|
|
|
|
|
{
|
|
|
|
|
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < equipBase.MaxHole; i++)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendFormat($"{SliverStar}\n");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
|
|
|
|
sb.AppendFormat($"[color=#ffff99]{equipBase.Description}[/color]");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case GoodsBase goodsBase:
|
|
|
|
|
{
|
|
|
|
|
Quality quality = (Quality) goodsBase.Quality;
|
|
|
|
|
sb.AppendFormat($"[color={GetQualityColor(quality)}][size={TitleSize}][b]{goodsBase.Name}[/b][/size][/color]\n");
|
|
|
|
|
sb.AppendFormat($"道具 消耗品\n");
|
|
|
|
|
(long gold, int sliver, int coin) = GetCoinFormat(goodsBase.Price);
|
|
|
|
|
sb.Append($"单价: {gold}{Gold} {sliver}{Sliver} {coin}{Coin}\n");
|
|
|
|
|
string isLock = goodsBase.IsLock? "已绑定" : "未绑定";
|
|
|
|
|
sb.AppendFormat($"[color=#ff99cc]{isLock}[/color]\n");
|
|
|
|
|
sb.AppendFormat($"需要等级:{goodsBase.UsedLevel}\n");
|
|
|
|
|
sb.AppendFormat($"[color=#ffff99]{goodsBase.Description}[/color]");
|
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
break;
|
|
|
|
|
case MaterialBase materialBase:
|
2021-05-01 22:06:12 +08:00
|
|
|
|
{
|
|
|
|
|
Quality quality = (Quality) materialBase.Quality;
|
|
|
|
|
sb.AppendFormat($"[color={GetQualityColor(quality)}][size={TitleSize}][b]{materialBase.Name}[/b][/size][/color]\n");
|
|
|
|
|
sb.AppendFormat(
|
|
|
|
|
$"材料 {((MaterialsType) materialBase.MaterialType == MaterialsType.普通材料? MaterialsType.普通材料.ToString() : ((GemType) materialBase.GemType).ToString())}\n");
|
|
|
|
|
(long gold, int sliver, int coin) = GetCoinFormat(materialBase.Price);
|
|
|
|
|
sb.Append($"单价: {gold}{Gold} {sliver}{Sliver} {coin}{Coin}\n");
|
|
|
|
|
string isLock = materialBase.IsLock? "已绑定" : "未绑定";
|
|
|
|
|
sb.AppendFormat($"[color=#ff99cc]{isLock}[/color]\n");
|
|
|
|
|
if (materialBase.MaterialType == (int) MaterialsType.宝石)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendLine($"[color=#99bf88]{GteGemValue((AttributeType) materialBase.GemKey, materialBase.GemValue)}[/color]");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
|
|
|
|
sb.Append($"[color=#ffff99]{materialBase.Description}[/color]");
|
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (additionalPrice != null)
|
|
|
|
|
sb.Append($"{additionalPrice}");
|
2021-04-11 19:50:39 +08:00
|
|
|
|
FUI_TabUI ui = OpenUI();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
ui.m_title.text = sb.ToString();
|
|
|
|
|
Vector2 pos = GRoot.inst.GetPoupPosition(ui.self, null, null);
|
|
|
|
|
Vector2 offset = new Vector2(15, 15);
|
|
|
|
|
pos += offset;
|
|
|
|
|
ui.self.position = pos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void OpenBuffUI(BuffStateInfo stateBuffInfo)
|
|
|
|
|
{
|
|
|
|
|
sb.Length = 0;
|
|
|
|
|
sb.AppendLine($"{stateBuffInfo.iconDesc}");
|
2021-04-11 19:50:39 +08:00
|
|
|
|
sb.Append($"持续时间时间:{stateBuffInfo.time / 1000f:f1} s");
|
|
|
|
|
FUI_TabUI ui = OpenUI();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
ui.m_title.text = sb.ToString();
|
|
|
|
|
Vector2 pos = GRoot.inst.GetPoupPosition(ui.self, null, null);
|
|
|
|
|
Vector2 offset = new Vector2(15, 15);
|
|
|
|
|
pos += offset;
|
|
|
|
|
ui.self.position = pos;
|
|
|
|
|
}
|
2021-05-15 14:29:48 +08:00
|
|
|
|
public static string GetAdditionalPrice(MultiShop config)
|
|
|
|
|
{
|
|
|
|
|
return $"\n售价: {config.Price}" + (ShopType)config.Type switch
|
|
|
|
|
{
|
|
|
|
|
ShopType.None => "",
|
|
|
|
|
ShopType.Gem => "星币",
|
|
|
|
|
ShopType.Honor => "荣誉",
|
|
|
|
|
ShopType.Pvp => "竞技币",
|
|
|
|
|
ShopType.Family => "家族贡献",
|
|
|
|
|
_ => throw new ArgumentOutOfRangeException()
|
|
|
|
|
};
|
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public static string GetAdditionalPrice(IConfig itemBase, float discount = 1, MarketType marketType = MarketType.VoucherMarket)
|
|
|
|
|
{
|
|
|
|
|
sb.Length = 0;
|
|
|
|
|
switch (itemBase)
|
|
|
|
|
{
|
|
|
|
|
case MarketBase marketBase:
|
2021-05-01 22:06:12 +08:00
|
|
|
|
{
|
|
|
|
|
if (marketType == MarketType.YuanBaoMarket)
|
|
|
|
|
{
|
|
|
|
|
sb.Append($"\n原价: <s>{marketBase.Price_YuanBao}元宝</s>");
|
|
|
|
|
sb.Append($"\n现价: {Mathf.RoundToInt(marketBase.Price_YuanBao * discount)}元宝 ({discount:p2})");
|
|
|
|
|
}
|
|
|
|
|
else if (marketType == MarketType.VoucherMarket)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
if (marketBase.OnlyYuanBao)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.Append("\n代金券无法购买此物品!");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
else
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.Append($"\n原价: <s>{marketBase.Price_YuanBao * 2}代金券</s>");
|
|
|
|
|
sb.Append($"\n现价: {Mathf.RoundToInt(marketBase.Price_YuanBao * discount * 2)}代金券 ({discount:p2})");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
break;
|
|
|
|
|
case ShopBase shopBase:
|
2021-05-01 22:06:12 +08:00
|
|
|
|
{
|
|
|
|
|
(long gold, int sliver, int coin) = GetCoinFormat(shopBase.Price);
|
|
|
|
|
sb.Append($"\n售价: {gold}{Gold} {sliver}{Sliver} {coin}{Coin}");
|
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
return sb.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void OpenEquipForgeUI(int itemId, List<EquipForgeMaterialInfo> needMaterialInfoList)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
IConfig itemBase = BagHelper.GetItemBase(itemId);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
sb.Length = 0;
|
|
|
|
|
switch (itemBase)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
case EquipBase equipBase:
|
2021-05-01 22:06:12 +08:00
|
|
|
|
{
|
|
|
|
|
Quality quality = (Quality) equipBase.Quality;
|
|
|
|
|
sb.Append($"[color={GetQualityColor(quality)}][size={TitleSize}][b]{equipBase.Name}[/b][/size][/color]\n");
|
|
|
|
|
for (int i = 0; i < equipBase.Star; i++)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.Append(YellowStar);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sb.Append("\n");
|
|
|
|
|
sb.Append($"需要等级:{equipBase.UseLevel}\n");
|
|
|
|
|
sb.Append($"需要职业: {GetStrJob(equipBase.JobId, equipBase.Transmigration)}\n");
|
|
|
|
|
itemDescList.Clear();
|
|
|
|
|
GetEquiBaseAtrribute(equipBase, itemDescList);
|
|
|
|
|
foreach (string item in itemDescList)
|
|
|
|
|
{
|
|
|
|
|
sb.Append($"[color=#99bf88]{item}[/color]\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sb.Append($"[color=#FFE148]-----------------所需素材-----------------[/color]");
|
|
|
|
|
foreach (EquipForgeMaterialInfo item in needMaterialInfoList)
|
|
|
|
|
{
|
|
|
|
|
string color = item.needCount > item.count? "FF0000" : "FFFFFF";
|
|
|
|
|
sb.Append($"\n[color=#{color}]{item.name} x{item.needCount}(持有{item.count})[/color]");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
break;
|
|
|
|
|
case GoodsBase goodsBase:
|
|
|
|
|
case MaterialBase materialBase:
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-11 19:50:39 +08:00
|
|
|
|
FUI_TabUI ui = OpenUI();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
ui.m_title.text = sb.ToString();
|
|
|
|
|
Vector2 pos = GRoot.inst.GetPoupPosition(ui.self, null, null);
|
|
|
|
|
Vector2 offset = new Vector2(15, 15);
|
|
|
|
|
pos += offset;
|
|
|
|
|
ui.self.position = pos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void OpenSkilUI(SkillConfig skillLogicConfig, int level, bool isPre = false)
|
|
|
|
|
{
|
|
|
|
|
sb.Length = 0;
|
|
|
|
|
sb.AppendLine($"[color=#FF8821][size={TitleSize}][b]{skillLogicConfig.Name}[/b][/size][/color]");
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendLine($"技能类型:{(SkillTypes) skillLogicConfig.SkillType}");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
sb.AppendLine($"冷却时间:{skillLogicConfig.CD / 1000}s");
|
|
|
|
|
sb.AppendLine("[color=#FFE148]------------------------------------------[/color]");
|
2021-05-01 22:06:12 +08:00
|
|
|
|
sb.AppendLine($"当前等级:{(isPre? 0 : level)}");
|
|
|
|
|
SkillCastType castType = (SkillCastType) skillLogicConfig.CastType;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
switch (castType)
|
|
|
|
|
{
|
|
|
|
|
case SkillCastType.无消耗:
|
|
|
|
|
sb.AppendLine($"{castType}");
|
|
|
|
|
break;
|
|
|
|
|
case SkillCastType.消耗精力:
|
|
|
|
|
case SkillCastType.消耗血量:
|
|
|
|
|
sb.AppendLine($"{castType}:{skillLogicConfig.CastValue:p2}");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-04-18 15:54:51 +08:00
|
|
|
|
|
|
|
|
|
SkillConfig skillConfig_Level = SkillConfigCategory.Instance.Get(skillLogicConfig.Id + level + 1, false);
|
|
|
|
|
sb.AppendLine($"升级需要等级:{skillConfig_Level?.LearnLevel}");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
sb.AppendLine($"技能效果:\n {skillLogicConfig.Desc}");
|
|
|
|
|
for (int i = 1; i <= skillLogicConfig.MaxLevel; i++)
|
|
|
|
|
{
|
2021-04-16 00:06:30 +08:00
|
|
|
|
string descColor;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (level < i || isPre)
|
|
|
|
|
descColor = "#999999";
|
|
|
|
|
else
|
|
|
|
|
descColor = "#ffffff";
|
2021-04-11 19:50:39 +08:00
|
|
|
|
SkillConfig skillConfig_EachLevel = DataTableHelper.Get<SkillConfig>(skillLogicConfig.Id + i);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
sb.AppendLine($" [color={descColor}]{skillConfig_EachLevel.Desc}[/color]");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-11 19:50:39 +08:00
|
|
|
|
FUI_TabUI ui = OpenUI();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
ui.m_title.text = sb.ToString();
|
|
|
|
|
Vector2 pos = GRoot.inst.GetPoupPosition(ui.self, null, null);
|
|
|
|
|
Vector2 offset = new Vector2(15, 15);
|
|
|
|
|
pos += offset;
|
|
|
|
|
ui.self.position = pos;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-01 22:06:12 +08:00
|
|
|
|
public static void OpenStarSoulUI(StarSoulBag bag, long id)
|
|
|
|
|
{
|
|
|
|
|
sb.Length = 0;
|
2021-05-05 13:36:19 +08:00
|
|
|
|
GenerateStarSoulString(sb, bag, id, true);
|
2021-05-01 22:06:12 +08:00
|
|
|
|
StarSoulItem data = bag.Get(id);
|
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-05 13:36:19 +08:00
|
|
|
|
sb.Append("[color=#ffff99]星魂可以通过消耗其他星魂进行升级,升级会提升固定属性;每升级4级产生或者强化某一个随机属性[/color]");
|
2021-05-01 22:06:12 +08:00
|
|
|
|
FUI_TabUI ui = OpenUI();
|
|
|
|
|
ui.m_title.text = sb.ToString();
|
|
|
|
|
Vector2 pos = GRoot.inst.GetPoupPosition(ui.self, null, null);
|
|
|
|
|
Vector2 offset = new Vector2(15, 15);
|
|
|
|
|
pos += offset;
|
|
|
|
|
ui.self.position = pos;
|
2021-05-03 01:54:31 +08:00
|
|
|
|
|
|
|
|
|
if (data.isUsed)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-05 13:36:19 +08:00
|
|
|
|
EquipType equipType = data.posType;
|
|
|
|
|
long usedId = bag.usedStarSoulDic[(byte) equipType];
|
|
|
|
|
if (usedId == 0)
|
2021-05-03 01:54:31 +08:00
|
|
|
|
return;
|
|
|
|
|
FUI_TabUI comUI = OpenComprasionUI();
|
|
|
|
|
Vector2 newPos = GetComprasionPos(comUI.self, pos);
|
|
|
|
|
comUI.self.position = newPos;
|
|
|
|
|
sb.Length = 0;
|
2021-05-05 13:36:19 +08:00
|
|
|
|
GenerateStarSoulString(sb, bag, usedId);
|
2021-05-03 01:54:31 +08:00
|
|
|
|
|
2021-05-14 15:28:23 +08:00
|
|
|
|
sb.AppendLine(SpaceLine3);
|
2021-05-05 13:36:19 +08:00
|
|
|
|
sb.Append("[color=#ffff99]星魂可以通过消耗其他星魂进行升级,升级会提升固定属性;每升级4级产生或者强化某一个随机属性[/color]");
|
2021-05-03 01:54:31 +08:00
|
|
|
|
comUI.m_title.text = sb.ToString();
|
2021-05-01 22:06:12 +08:00
|
|
|
|
}
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
|
//!获取品质颜色码
|
2021-05-02 23:18:14 +08:00
|
|
|
|
public static string GetQualityColor(Quality quality)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
switch (quality)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case Quality.Common: return QualityColor.Common;
|
|
|
|
|
case Quality.UnCommon: return QualityColor.UnCommon;
|
|
|
|
|
case Quality.Rare: return QualityColor.Rare;
|
|
|
|
|
case Quality.Epic: return QualityColor.Epic;
|
|
|
|
|
case Quality.Legendary: return QualityColor.Legendary;
|
|
|
|
|
case Quality.Ulti: return QualityColor.Ulti;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
//!获取职业
|
|
|
|
|
public static string GetStrJob(int jobId, int trans = 0)
|
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
return GetStrJob((JobType) jobId, trans);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public static string GetStrJob(JobType jobId, int trans = 0)
|
|
|
|
|
{
|
|
|
|
|
string ext = null;
|
|
|
|
|
switch (trans)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
case 0:
|
|
|
|
|
ext = "";
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
ext = "(一转)";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
ext = "(二转)";
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
switch (jobId)
|
|
|
|
|
{
|
|
|
|
|
case JobType.UnKnown:
|
|
|
|
|
break;
|
|
|
|
|
case JobType.Officer:
|
|
|
|
|
return "军官" + ext;
|
|
|
|
|
case JobType.Sportsman:
|
|
|
|
|
return "运动员" + ext;
|
|
|
|
|
case JobType.Nurse:
|
|
|
|
|
return "护士" + ext;
|
|
|
|
|
case JobType.Superman:
|
|
|
|
|
return "超能力" + ext;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
return string.Empty;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public static int GetJobById(int jobId)
|
|
|
|
|
{
|
|
|
|
|
return (jobId + 1) / 2;
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
//!获取装备的词条
|
|
|
|
|
static void GetEquiBaseAtrribute(EquipBase equipBase, List<string> list)
|
|
|
|
|
{
|
|
|
|
|
string GetPercent(int a, int b)
|
|
|
|
|
{
|
|
|
|
|
float percent = (a - b) * 100 / b;
|
2021-05-01 22:06:12 +08:00
|
|
|
|
return percent >= 0? $"[color=#99cc33] ({percent:f2}%)[/color]" : $"[color=#cc3333] ({percent:f2}%)[/color]";
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
string GetFloatPercent(float a, float b)
|
|
|
|
|
{
|
|
|
|
|
float percent = (a - b) * 100 / b;
|
2021-05-01 22:06:12 +08:00
|
|
|
|
return percent >= 0? $"[color=#99cc33] ({percent:f2}%)[/color]" : $"[color=#cc3333] ({percent:f2}%)[/color]";
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Hp != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"生命:{equipBase.Hp}{GetPercent(equipBase.Hp, equipBase.Hp)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Mp != 0)
|
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
list.Add($"精力:{equipBase.Mp}{GetPercent(equipBase.Mp, equipBase.Mp)}");
|
2021-04-08 20:09:59 +08:00
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Str != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"力量:{equipBase.Str}{GetPercent(equipBase.Str, equipBase.Str)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Quk != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"敏捷:{equipBase.Quk}{GetPercent(equipBase.Quk, equipBase.Quk)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Spi != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"精神:{equipBase.Spi}{GetPercent(equipBase.Spi, equipBase.Spi)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Wim != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"智慧:{equipBase.Wim}{GetPercent(equipBase.Wim, equipBase.Wim)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Sta != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"耐力:{equipBase.Sta}{GetPercent(equipBase.Sta, equipBase.Sta)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Phy != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"体力:{equipBase.Phy}{GetPercent(equipBase.Phy, equipBase.Phy)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.PhyAtk != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"物理攻击:{equipBase.PhyAtk}{GetPercent(equipBase.PhyAtk, equipBase.PhyAtk)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.SpiAtk != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"精神攻击:{equipBase.SpiAtk}{GetPercent(equipBase.SpiAtk, equipBase.SpiAtk)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.PhyDef != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"物理防御:{equipBase.PhyDef}{GetPercent(equipBase.PhyDef, equipBase.PhyDef)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.SpiDef != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"精神防御:{equipBase.SpiDef}{GetPercent(equipBase.SpiDef, equipBase.SpiDef)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Pcrir != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"物理暴击率:{equipBase.Pcrir:p2}{GetFloatPercent(equipBase.Pcrir, equipBase.Pcrir)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Mcrir != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"精神暴击率:{equipBase.Mcrir:p2}{GetFloatPercent(equipBase.Mcrir, equipBase.Mcrir)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Pcri != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"物理暴击值:{equipBase.Pcri:p2}{GetFloatPercent(equipBase.Pcri, equipBase.Pcri)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Mcri != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"精神暴击值:{equipBase.Mcri:p2}{GetFloatPercent(equipBase.Mcri, equipBase.Mcri)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Rpcrir != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"抗物理暴击率:{equipBase.Rpcrir:p2}{GetFloatPercent(equipBase.Rpcrir, equipBase.Rpcrir)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Rmcrir != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"抗精神暴击率:{equipBase.Rmcrir:p2}{GetFloatPercent(equipBase.Rmcrir, equipBase.Rmcrir)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Rpcri != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"抗物理暴击值:{equipBase.Rpcrir:p2}{GetFloatPercent(equipBase.Rpcri, equipBase.Rpcri)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Rmcri != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"抗精神暴击值:{equipBase.Rmcri:p2}{GetFloatPercent(equipBase.Rmcri, equipBase.Rmcri)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Nphyi != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"物理免伤:{equipBase.Nphyi:p2}{GetFloatPercent(equipBase.Nphyi, equipBase.Nphyi)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Nmeni != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"精神免伤:{equipBase.Nmeni:p2}{GetFloatPercent(equipBase.Nmeni, equipBase.Nmeni)}");
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (equipBase.Dvo != 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add($"辅助值:{equipBase.Dvo:p2}{GetFloatPercent(equipBase.Dvo, equipBase.Dvo)}");
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public static (long, int, int) GetCoinFormat(long coin)
|
|
|
|
|
{
|
2021-05-01 22:06:12 +08:00
|
|
|
|
int cupper = (int) (coin % 100);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
long gold = coin / 10000;
|
2021-05-01 22:06:12 +08:00
|
|
|
|
int sliver = (int) ((coin - gold * 10000) / 100);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
return (gold, sliver, cupper);
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public static string GteGemValue(AttributeType type, float value)
|
|
|
|
|
{
|
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case AttributeType.最大生命:
|
|
|
|
|
case AttributeType.最大精力:
|
|
|
|
|
case AttributeType.力量:
|
|
|
|
|
case AttributeType.敏捷:
|
|
|
|
|
case AttributeType.精神:
|
|
|
|
|
case AttributeType.智慧:
|
|
|
|
|
case AttributeType.物理攻击:
|
|
|
|
|
case AttributeType.精神攻击:
|
|
|
|
|
case AttributeType.物理防御:
|
|
|
|
|
case AttributeType.精神防御:
|
|
|
|
|
case AttributeType.体质:
|
|
|
|
|
case AttributeType.耐力:
|
|
|
|
|
case AttributeType.速度:
|
|
|
|
|
return $"{type}:{MathHelper.RoundToInt(value)}";
|
|
|
|
|
case AttributeType.物理暴击系数:
|
|
|
|
|
case AttributeType.精神暴击系数:
|
|
|
|
|
case AttributeType.物理暴击效果:
|
|
|
|
|
case AttributeType.精神暴击效果:
|
|
|
|
|
case AttributeType.抗物理暴击系数:
|
|
|
|
|
case AttributeType.抗物理暴击效果:
|
|
|
|
|
case AttributeType.抗精神暴击系数:
|
|
|
|
|
case AttributeType.抗精神暴击效果:
|
|
|
|
|
case AttributeType.辅助值:
|
|
|
|
|
case AttributeType.物理免伤:
|
|
|
|
|
case AttributeType.精神免伤:
|
|
|
|
|
case AttributeType.命中:
|
|
|
|
|
case AttributeType.抵抗:
|
|
|
|
|
return $"{type}:{value:p2}";
|
|
|
|
|
case AttributeType.无:
|
|
|
|
|
default: return string.Empty;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
}
|