| Core/GameEngine/Model/Config/PetClassCostConfig.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/GameEngine/Model/Config/PetClassCostConfig.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/GameEngine/Model/TelPartialConfig/tagStoreConfig.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/NetworkPackage/ClientPack/ClientToMapServer/CA7_Pet/CA704_tagCMPetClassUP.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Pet/AutoTrainTipsPWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Pet/AutoTrainTipsPWin.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Pet/PetAttributeMethods.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Pet/PetAttributeWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Pet/PlayerPetDatas.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/GameEngine/Model/Config/PetClassCostConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Saturday, January 06, 2018 // [ Date ]: Thursday, November 01, 2018 //-------------------------------------------------------- using UnityEngine; @@ -11,11 +11,12 @@ public partial class PetClassCostConfig : ConfigBase { public int ID { get ; private set ; } public int PetID { get ; private set ; } public int Rank { get ; private set ; } public int UpNeedExp { get ; private set ; } public int AtkAdd { get ; private set ; } public int ID { get ; private set ; } public int PetID { get ; private set ; } public int Rank { get ; private set ; } public int UpNeedExp { get ; private set ; } public int AtkAdd { get ; private set ; } public int NeedExpTotal { get ; private set ; } public override string getKey() { @@ -25,15 +26,17 @@ public override void Parse() { try { ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; PetID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; Rank=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; UpNeedExp=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; AtkAdd=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; PetID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; Rank=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; UpNeedExp=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; AtkAdd=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; NeedExpTotal=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; } catch (Exception ex) { Core/GameEngine/Model/Config/PetClassCostConfig.cs.meta
@@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: a58409c48a307e24eb39a8c2e933c8e8 timeCreated: 1515213576 licenseType: Pro timeCreated: 1541079969 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] Core/GameEngine/Model/TelPartialConfig/tagStoreConfig.cs
@@ -13,6 +13,8 @@ private static Dictionary<int, List<StoreConfig>> storeConfigs = new Dictionary<int, List<StoreConfig>>(); public void OnConfigParseCompleted() { if (ShopType == 0) return; if (!s_storeModelDict.ContainsKey(ShopType)) { List<StoreConfig> modellist = new List<StoreConfig>(); Core/NetworkPackage/ClientPack/ClientToMapServer/CA7_Pet/CA704_tagCMPetClassUP.cs
@@ -6,6 +6,7 @@ public class CA704_tagCMPetClassUP : GameNetPackBasic { public byte PetItemIndex; //宠物数据背包索引 public ushort UseItemCnt; //消耗材料个数 public byte IsAutoBuy; //是否自动购买 public CA704_tagCMPetClassUP () { combineCmd = (ushort)0x03FE; @@ -15,6 +16,7 @@ public override void WriteToBytes () { WriteBytes (PetItemIndex, NetDataType.BYTE); WriteBytes (UseItemCnt, NetDataType.WORD); WriteBytes (IsAutoBuy, NetDataType.BYTE); } } Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs
@@ -35,7 +35,8 @@ if (vNetData.HurtCount > 0) { if (_skill.id != _attacker.SkillMgr.CurCastSkill.id) if (_attacker.SkillMgr.CurCastSkill != null && _skill.id != _attacker.SkillMgr.CurCastSkill.id) { _skill.ClearServerHurtList(); } System/Pet/AutoTrainTipsPWin.cs
New file @@ -0,0 +1,268 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Thursday, November 01, 2018 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using TableConfig; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class SkillClass { public int PetID; public int SkillID; public int Lv; } public class AutoTrainTipsPWin : Window { #region Built-in [SerializeField] Button m_CloseBtn;//关闭 [SerializeField] Button m_CancelBtn;//取消 [SerializeField] Button m_ConfirmBtn;//确定 [SerializeField] Button m_BtnReduce;//减 [SerializeField] Button m_BtnPlus;//加 [SerializeField] Button _DotText1Btn;//计算器按钮 [SerializeField] Button _NumKeyBoardBGM;//计算机面板按钮 [SerializeField] NumKeyBoard _NumKeyBoard;//计算机 [SerializeField] Text NextToLvText;//需要驯养等级 [SerializeField] Text NeedNumberText;//所需购买的颗数 [SerializeField] Text m_NowLevelTxt;//当前等级 private int PetID = 0; public static int _Lvnumber = 0;//标记需要升到所需的阶数 public static int DomesticateNumber = 0;//驯养次数 private PetAttributeWin PetWin = new PetAttributeWin(); private bool isBool = true; public static bool IsFairy = false; List<SkillClass> PetSkills = new List<SkillClass>(); PlayerPetDatas m_petModel; PlayerPetDatas PetModel { get { return m_petModel ?? (m_petModel = ModelCenter.Instance.GetModel<PlayerPetDatas>()); } } protected override void BindController() { PetWin = WindowCenter.Instance.Get<PetAttributeWin>(); } protected override void AddListeners() { m_CloseBtn.AddListener(OnClickCloseButton); m_CancelBtn.AddListener(OnClickCancelButton); m_ConfirmBtn.AddListener(OnClickConfirmButton); m_BtnReduce.AddListener(OnClickReduceButton); m_BtnPlus.AddListener(OnClickPlusButton); _DotText1Btn.AddListener(OnClickDotText1); _NumKeyBoardBGM.AddListener(OnClickNumKeyBoardBGM); _NumKeyBoard.onValueChange.AddListener(OnClickNumKeyBoardValueChange); _NumKeyBoard.onConfirm.AddListener(onConfirm); } protected override void OnPreOpen() { IsFairy = false; _NumKeyBoardBGM.gameObject.SetActive(false); isBool = true; PetID = PetModel.SigPetId; m_NowLevelTxt.text = string.Format(Language.Get("PetZ1031"), PetModel._DicPetBack[PetID].PetClass); GetMountSkills(PetID); PropertyEntries(PetID);//默认自动选择 int GetLvNow = PetModel._DicPetBack[PetID].PetClass; int MaxLv = Config.Instance.Get<PetInfoConfig>(PetID).MaxRank; _NumKeyBoard.min = (uint)(GetLvNow + 1); _NumKeyBoard.max = (uint)MaxLv; } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnAfterClose() { } private void GetMountSkills(int petId)//获取坐骑的技能 { PetSkills.Clear(); var PetInfo = Config.Instance.Get<PetInfoConfig>(petId); int[] SKillID = ConfigParse.GetMultipleStr<int>(PetInfo.SkillID); int[] SkillUnLock = ConfigParse.GetMultipleStr<int>(PetInfo.SkillUnLock); for (int i = 0; i < SKillID.Length; i++) { SkillClass skillClass = new SkillClass(); skillClass.PetID = petId; skillClass.SkillID = SKillID[i]; skillClass.Lv = SkillUnLock[i]; PetSkills.Add(skillClass); } } private void PropertyEntries(int _petID)//默认自动选择 { int NextMountLv = 0; int getLv = PetModel._DicPetBack[_petID].PetClass; var PetInfo = Config.Instance.Get<PetInfoConfig>(_petID); bool IsBool = true; for (int i = 0; i < PetSkills.Count; i++) { if (PetSkills[i].Lv > getLv && IsBool) { NextMountLv = PetSkills[i].Lv; IsBool = false; } } if (IsBool) { NextMountLv = PetInfo.MaxRank; } _Lvnumber = NextMountLv; int NowHorseExp = PetClassCostConfig.GetPetIdAndRank(_petID, getLv).NeedExpTotal + PetModel._DicPetBack[_petID].petExp;//当前等级的经验 int NeedNumber = Mathf.CeilToInt((float)(PetClassCostConfig.GetPetIdAndRank(_petID, NextMountLv).NeedExpTotal - NowHorseExp) / 100);//所需要的颗数 DomesticateNumber = NeedNumber; NeedNumberText.text = NeedNumber.ToString(); NextToLvText.text = NextMountLv + Language.Get("Z1041"); } private void SetMountSelectionInformation(int _PetID, int LV) { int getLv = PetModel._DicPetBack[_PetID].PetClass; int NowHorseExp = PetClassCostConfig.GetPetIdAndRank(_PetID, getLv).NeedExpTotal + PetModel._DicPetBack[_PetID].petExp;//当前等级的经验 int NeedNumber = Mathf.CeilToInt((float)(PetClassCostConfig.GetPetIdAndRank(_PetID, LV).NeedExpTotal - NowHorseExp) / 100);//所需要的颗数 DomesticateNumber = NeedNumber; NextToLvText.text = LV + Language.Get("Z1041"); NeedNumberText.text = NeedNumber.ToString(); } private void OnClickCloseButton() { Close(); } private void OnClickCancelButton() { Close(); } private void OnClickConfirmButton()//确定 { int NeedFairyJade = DomesticateNumber * 10; int gold = (int)UIHelper.GetMoneyCnt(1); if (NeedFairyJade > 0 && gold >= NeedFairyJade) { IsFairy = true; PetWin.FairyJadeDomesticate(); Close(); } else { if (VersionConfig.Get().isBanShu) { SysNotifyMgr.Instance.ShowTip("GoldErr"); return; } WindowCenter.Instance.Open<RechargeTipWin>(); } } private void OnClickReduceButton()//减 { int getLvNow = PetModel._DicPetBack[PetID].PetClass; if (_Lvnumber - 1 < getLvNow + 1) { ScrollTip.ShowTip(Language.Get("PetBelowCultureLevel_")); } else { _Lvnumber -= 1; SetMountSelectionInformation(PetID, _Lvnumber); } } private void OnClickPlusButton()//加 { int MaxLv = Config.Instance.Get<PetInfoConfig>(PetID).MaxRank; if (_Lvnumber + 1 <= MaxLv) { _Lvnumber += 1; SetMountSelectionInformation(PetID, _Lvnumber); } else { ScrollTip.ShowTip(Language.Get("PetMoreThanDomestication_Z")); } } private void OnClickDotText1()//中间点击 { if (!_NumKeyBoardBGM.gameObject.activeSelf) { _NumKeyBoardBGM.gameObject.SetActive(true); } } private void OnClickNumKeyBoardBGM()//关闭面板 { if (_NumKeyBoardBGM.gameObject.activeSelf) { _NumKeyBoardBGM.gameObject.SetActive(false); } } private void OnClickNumKeyBoardValueChange() { if (int.Parse(_NumKeyBoard.Value) > 999) { NextToLvText.text = 999 + Language.Get("Z1041"); } else { NextToLvText.text = int.Parse(_NumKeyBoard.Value) + Language.Get("Z1041"); } } private void NumKeyBoardValueChange() { int GetLvNow = PetModel._DicPetBack[PetID].PetClass; int MaxLv = Config.Instance.Get<PetInfoConfig>(PetID).MaxRank; if (int.Parse(_NumKeyBoard.Value) < GetLvNow + 1) { _Lvnumber = GetLvNow + 1; SetMountSelectionInformation(PetID, _Lvnumber); ScrollTip.ShowTip(Language.Get("LessThanTheDomesticated_Z")); } else if (int.Parse(_NumKeyBoard.Value) > MaxLv) { _Lvnumber = MaxLv; SetMountSelectionInformation(PetID, _Lvnumber); ScrollTip.ShowTip(Language.Get("MoreThanDomestication_Z")); } else if (int.Parse(_NumKeyBoard.Value) >= GetLvNow + 1 && int.Parse(_NumKeyBoard.Value) <= MaxLv) { _Lvnumber = int.Parse(_NumKeyBoard.Value); SetMountSelectionInformation(PetID, _Lvnumber); } } private void onConfirm(bool _bool) { if (_bool) { NumKeyBoardValueChange(); _NumKeyBoardBGM.gameObject.SetActive(false); } } #endregion } } System/Pet/AutoTrainTipsPWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: d659e84f62ab04c4280d8089523fde59 timeCreated: 1541073534 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Pet/PetAttributeMethods.cs
@@ -85,8 +85,10 @@ PetInfoConfig petInfoConfig; bool isAutoTrain = false; List<GameObject> Skillimage = new List<GameObject>(); private bool IsZidong = false; private void OnEnable() { IsZidong = false; timePlay = 0; Skillimage.Clear(); Skillimage.Add(Skillimage1); @@ -494,16 +496,13 @@ { if (petmodel._DicPetBack.ContainsKey(petInfoConfig.ID)) { petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1); petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1,0); } } else { ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId); } // petTrainBtn.RemoveAllListeners(); } private void ClickPetAutoTrainBtn() @@ -511,7 +510,20 @@ int haveCnt = playerPack.GetItemCountByID(PackType.rptItem, petmodel.petUpgradeToolId); if (haveCnt < costNum) { ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId); if (!isAutoTrain) { WindowCenter.Instance.Open<AutoTrainTipsPWin>(); } else { AutoTrainTipsPWin.IsFairy = false; isAutoTrain = false; IsZidong = false; petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6"); StopCoroutine("FairyJadeD"); } return; } isAutoTrain = !isAutoTrain; @@ -548,7 +560,7 @@ if (petmodel.Wait) { petmodel.Wait = false; petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum); petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum,0); } } else @@ -556,7 +568,7 @@ if (petmodel.Wait) { petmodel.Wait = false; petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt); petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt,0); } } @@ -565,9 +577,12 @@ } else { petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6"); isAutoTrain = false; if (!IsZidong) { petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6"); isAutoTrain = false; } } } #endregion @@ -644,8 +659,6 @@ ridingModel.property = PropertyTip.Pet; ridingModel.RidingId = PetID; WindowCenter.Instance.Open<TargetPetAttrWin>(); // WindowCenter.Instance.Get<TargetPetAttrWin>().PropertyMountAndPet(PropertyTip.Pet, PetID); }); if (petmodel._DicPetBack[PetID].PetClass >= PetModel.MaxRank)//满阶 { @@ -697,6 +710,53 @@ FragmentUnlockTip.SetActive(false); FullAttTip.SetActive(true); } public void FairyJadeDomesticate()//仙玉驯养 { int NumberLv = AutoTrainTipsPWin._Lvnumber;//等级所需的等级 if (NumberLv > petmodel._DicPetBack[typePetID].PetClass && !WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>() && AutoTrainTipsPWin.IsFairy) { isAutoTrain = true; petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7"); IsZidong = true; StartCoroutine("FairyJadeD"); } } IEnumerator FairyJadeD()//仙玉驯养 { int number = AutoTrainTipsPWin.DomesticateNumber;//所需的颗数 int NumberLv = AutoTrainTipsPWin._Lvnumber;//等级所需的等级 while (NumberLv > petmodel._DicPetBack[typePetID].PetClass) { if (WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>()) { isAutoTrain = false; IsZidong =false; petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6"); StopCoroutine("FairyJadeD"); yield break; } if (petmodel.Wait) { petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7"); int exp = PetClassCostConfig.GetPetIdAndRank(typePetID, petmodel._DicPetBack[typePetID].PetClass).NeedExpTotal; int NeedNum = ridingModel.PetAndHorseNeedDanNum(exp); petmodel.SendPetTrainQuest(petmodel._DicPetBack[typePetID].ItemPlace, NeedNum, 1);//向服务端发包坐骑经验单 petmodel.Wait = false; } yield return null; } if (isAutoTrain) { AutoTrainTipsPWin.IsFairy = false; isAutoTrain = false; IsZidong = false; petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6"); StopCoroutine("FairyJadeD"); yield break; } yield break; } } } System/Pet/PetAttributeWin.cs
@@ -224,7 +224,9 @@ return; } } petmodel.SigPetId = petId; TypePetID = petId; _PetAttributeMethods.ModelShow(petId); } @@ -316,6 +318,7 @@ if (Pet != 0) { TypePetID = Pet; petmodel.SigPetId = Pet; return; } } @@ -331,6 +334,7 @@ if (Value.UnLockNeedItemID == ItemId) { TypePetID = Value.ID; petmodel.SigPetId = TypePetID; return; } } @@ -341,6 +345,7 @@ if (petmodel.DeblockingRedPoint[key].state == RedPointState.Simple) { TypePetID = key; petmodel.SigPetId = TypePetID; return; } } @@ -350,16 +355,19 @@ if (petmodel.CultivateRedPoint[key].state == RedPointState.Simple) { TypePetID = key; petmodel.SigPetId = TypePetID; return; } } if (petmodel.PetNow != 0) { TypePetID = petmodel.PetNow; petmodel.SigPetId = TypePetID; } else { TypePetID = sortlist[0].ID; petmodel.SigPetId = TypePetID; } } private int JunpIndex() @@ -389,6 +397,7 @@ if (value.ID == petID[0]) { TypePetID = petID[0]; petmodel.SigPetId = TypePetID; } } //m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见 @@ -424,6 +433,13 @@ } return Index; } public void FairyJadeDomesticate() { _PetAttributeMethods.FairyJadeDomesticate(); } } } System/Pet/PlayerPetDatas.cs
@@ -48,6 +48,7 @@ public bool IsOk = false; private int PetDanExp = 0;//灵宠丹经验 public int SigPetId = 0;//用来标记当前选中的坐骑ID public List<int> ListEffectSkill = new List<int>(); PlayerPackModel _playerPack; PlayerPackModel playerPack @@ -174,11 +175,12 @@ } } public void SendPetTrainQuest(int petIndex, int number) public void SendPetTrainQuest(int petIndex, int number,int _IsAutoBuy) { CA704_tagCMPetClassUP _tagCA704 = new CA704_tagCMPetClassUP(); _tagCA704.PetItemIndex = (byte)petIndex; _tagCA704.UseItemCnt = (ushort)number; _tagCA704.IsAutoBuy = (byte)_IsAutoBuy; GameNetSystem.Instance.SendInfo(_tagCA704); } #endregion