少年修仙传客户端代码仓库
lcy
2024-12-16 a39c35fc6449430cd02bccb681c4a0a880e46cd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
 
using System;
using vnxbqy.UI;
 
 
public class StrengthenModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
{
    PackModel _playerPack;
    PackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); } }
    public void OnBeforePlayerDataInitialize()
    {
 
    }
    public override void Init()
    {
 
 
    }
 
    public override void UnInit()
    {
 
    }
 
    public void OnPlayerLoginOk()
    {
 
    }
    //===========羽翼精炼
    Dictionary<int, WingRefineAttrModel> _DicWingRe = new Dictionary<int, WingRefineAttrModel>();
    class WingRefineAttrModel
    {
        public int Ability1;//属性值1
        public int Ability1Value;//数值1
        public int Ability2;//属性值2
        public int Ability2Value;//数值2
 
    }
    private List<WingRefineAttrConfig> tegWing = new List<WingRefineAttrConfig>();
    void WingRefine()//精炼属性
    {
        if (tegWing.Count <= 0)
        {
            tegWing = WingRefineAttrConfig.GetValues();
        }
        //var tegWing = WingRefineAttrConfig.GetValues();
        foreach (var values in tegWing)
        {
            if (!_DicWingRe.ContainsKey(values.wingsPhase))
            {
                WingRefineAttrModel _wingRefineAttrModel = new WingRefineAttrModel();
                int[] array = ConfigParse.GetKeyValueKeys<int>(values.attrupper);
                int[] intarray = ConfigParse.GetKeyValueValues<int>(values.attrupper);
                _wingRefineAttrModel.Ability1 = array[0];
                _wingRefineAttrModel.Ability2 = array[1];
 
                _wingRefineAttrModel.Ability1Value = intarray[0];
                _wingRefineAttrModel.Ability2Value = intarray[1];
                _DicWingRe.Add(values.wingsPhase, _wingRefineAttrModel);
 
            }
        }
    }
 
    public float[] BackpackWings(int ItemID, int _Refining)//用于背包 翅膀(1.翅膀ID,2.精炼值)
    {
        WingRefine();
        int _currentRefiningAll = 0;//总精炼度
        ItemConfig Item = ItemConfig.Get(ItemID);
        if (tegWing.Count <= 0)
        {
            tegWing = WingRefineAttrConfig.GetValues();
        }
        //  var configs = WingRefineAttrConfig.GetValues();
        foreach (var values in tegWing)
        {
            if (Item.LV == values.wingsPhase)
            {
                _currentRefiningAll = values.EXPupper;//总精炼度
                if (_Refining >= _currentRefiningAll)
                {
                    _Refining = _currentRefiningAll;
                }
            }
        }
 
        float _RefiningRatio = (float)_Refining / _currentRefiningAll;//精炼比值
        float _RefiningDegrees = _DicWingRe[Item.LV].Ability2Value * _RefiningRatio;
        float _life = _DicWingRe[Item.LV].Ability1Value * _RefiningRatio;
        float[] _floList = new float[2];
        _floList[0] = _RefiningDegrees;
        _floList[1] = _life;
        return _floList;
    }
 
    public bool IsHint(int ID)
    {
        if (WingRefineAttrConfig.Get(ID) == null)
        {
            return false;
        }
        ItemModel itemModel = playerPack.GetItemByIndex(PackType.Equip, SpiritWeaponModel.WING_EQUIPINDEX);
        if (itemModel.GetUseData((int)ItemUseDataKey.wingProgressValue) != null)
        {
            int currentRefining = 0;
            int currentReAll = 0;
            currentRefining = itemModel.GetUseData((int)ItemUseDataKey.wingProgressValue)[0];//当前精炼度  
            if (tegWing.Count <= 0)
            {
                tegWing = WingRefineAttrConfig.GetValues();
            }
            //  var wingRefineAttrConfigs = WingRefineAttrConfig.GetValues();
            foreach (var value in tegWing)
            {
                if (itemModel.config.LV == value.wingsPhase)
                {
                    currentReAll = value.EXPupper;//总精炼度
                }
            }
            if (currentReAll > currentRefining)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            return false;
        }
    }
 
 
}