| | |
| | | }
|
| | | private static Regex m_TextColorRegex = new Regex("<color=#[0-9a-zA-Z]+>(.*)</color>", RegexOptions.Singleline);
|
| | |
|
| | | public static string GetTextColorByItemColor(TextColType type, string msg, bool bright = false)
|
| | | public static string AppendStringColor(TextColType type, string msg, bool bright = false)
|
| | | {
|
| | | if (m_TextColorRegex.IsMatch(msg))
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static string GetTextColorByItemColor(int itemColor, string msg, bool bright = false)
|
| | | public static string AppendStringColor(int itemColor, string msg, bool bright = false)
|
| | | {
|
| | | switch (itemColor)
|
| | | {
|
| | | case 0:
|
| | | case 1:
|
| | | return GetTextColorByItemColor(TextColType.White, msg, bright);
|
| | | return AppendStringColor(TextColType.White, msg, bright);
|
| | | case 2:
|
| | | return GetTextColorByItemColor(TextColType.Blue, msg, bright);
|
| | | return AppendStringColor(TextColType.Blue, msg, bright);
|
| | | case 3:
|
| | | return GetTextColorByItemColor(TextColType.Purple, msg, bright);
|
| | | return AppendStringColor(TextColType.Purple, msg, bright);
|
| | | case 4:
|
| | | return GetTextColorByItemColor(TextColType.Orange, msg, bright);
|
| | | return AppendStringColor(TextColType.Orange, msg, bright);
|
| | | case 5:
|
| | | return GetTextColorByItemColor(TextColType.Red, msg, bright);
|
| | | return AppendStringColor(TextColType.Red, msg, bright);
|
| | | case 6:
|
| | | return GetTextColorByItemColor(TextColType.Pink, msg, bright);
|
| | | return AppendStringColor(TextColType.Pink, msg, bright);
|
| | | }
|
| | | return msg;
|
| | | }
|
| | |
| | |
|
| | | #region 计算战斗力
|
| | | public static readonly string FightPowerFormula = "FightpowerFormula";
|
| | | public static uint GetFightPower(params int[] paraArray)
|
| | | {
|
| | | Equation.Instance.Clear();
|
| | | if (paraArray == null || paraArray.Length < 2 || paraArray.Length % 2 != 0) return 0;
|
| | | for (int i = 0; i < paraArray.Length; i += 2)
|
| | | {
|
| | | PlayerPropertyConfig cfg = Config.Instance.Get<PlayerPropertyConfig>(paraArray[i]);
|
| | | if (cfg != null)
|
| | | {
|
| | | if (paraArray[i] == 7)
|
| | | {
|
| | | Equation.Instance.AddKeyValue("MinAtk", paraArray[i + 1]);
|
| | | Equation.Instance.AddKeyValue("MaxAtk", paraArray[i + 1]);
|
| | | }
|
| | | else
|
| | | {
|
| | | Equation.Instance.AddKeyValue(cfg.Parameter, paraArray[i + 1]);
|
| | | }
|
| | | }
|
| | | }
|
| | | FuncConfigConfig funcCfg = Config.Instance.Get<FuncConfigConfig>(FightPowerFormula);
|
| | | return Equation.Instance.Eval<uint>(funcCfg.Numerical1);
|
| | | }
|
| | |
|
| | | public static int GetFightPower(Dictionary<int, int> _propertyDict)
|
| | | {
|
| | | Equation.Instance.Clear();
|