| | |
| | | public int TitleID; |
| | | public uint ExpPoint; //扩充经验点数(亿) |
| | | public uint TotalExp; //总经验(小于亿部分) |
| | | public ulong curExp { get { return TotalExp + ExpPoint * Constants.ExpPointValue; } } |
| | | public long curExp { get { return TotalExp + ExpPoint * Constants.ExpPointValue; } } |
| | | public uint FamilyId; //家族 |
| | | public string FamilyName; //家族名称 |
| | | public uint diamond; //仙玉 |
| | | public uint bindDiamond; //灵石 |
| | | public uint copper; //铜钱 |
| | | public ulong allCopper { get { return (ulong)copper + (ulong)copperExtend * Constants.ExpPointValue; } } |
| | | public ulong FightPoint; //战斗值 |
| | | public long allCopper { get { return copper + copperExtend * Constants.ExpPointValue; } } |
| | | public long FightPoint; //战斗值 |
| | | public ushort MapID; //角色所在地图 地图规则:C/S一一对应的常规地图,C假地图(ExAttr14),多C一个S地图(ExAttr3) |
| | | public ushort PosX; //角色坐标 |
| | | public ushort PosY; |
| | | public ulong HP; //当前HP |
| | | public long HP; //当前HP |
| | | public uint FreePoint; //未分配点数 |
| | | public uint FreeSkillPoint; //未分配的技能点 |
| | | public int STR; //力量 |
| | |
| | | public event Action<long> spNewGetEvent; |
| | | |
| | | |
| | | private Dictionary<PlayerDataType, ulong> PlayerDataDict = new Dictionary<PlayerDataType, ulong>(); |
| | | private Dictionary<PlayerDataType, long> PlayerDataDict = new Dictionary<PlayerDataType, long>(); |
| | | |
| | | public void InitPlayerData(H0102_tagCDBPlayer data) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public ulong GetPlayerDataByType(PlayerDataType type) |
| | | public long GetPlayerDataByType(PlayerDataType type) |
| | | { |
| | | ulong value = 0; |
| | | long value = 0; |
| | | PlayerDataDict.TryGetValue(type, out value); |
| | | return value; |
| | | } |
| | |
| | | |
| | | public class PlayerExtersionData |
| | | { |
| | | public ulong MaxHP; // 最大HP 28, |
| | | public long MaxHP; // 最大HP 28, |
| | | public int MaxMP; // 最大MP 30, |
| | | public int ExpRate; // 当前经验倍率 单位为百分比 35, |
| | | public int DEF; // 外防 42 |
| | |
| | | // 检查一下锤子的消耗 |
| | | //FightPoint 用于记录消耗战锤倍数,小于等于1时默认1倍,大于1时为对应消耗倍值,0418刷新类型22 |
| | | Debug.LogError("HandModeOperationAgent DoNext 2"); |
| | | ulong costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.FightPoint); |
| | | long costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.FightPoint); |
| | | |
| | | ulong cost = (costRate > 1 ? costRate : 1) * 1; // 1是默认消耗 |
| | | long cost = (costRate > 1 ? costRate : 1) * 1; // 1是默认消耗 |
| | | |
| | | |
| | | |
| | |
| | | |
| | | protected void OnPlayerLoginOk() |
| | | { |
| | | ulong exAttr1 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr1); |
| | | ulong exAttr2 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr2); |
| | | long exAttr1 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr1); |
| | | long exAttr2 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr2); |
| | | |
| | | int MapID = 1; |
| | | int FuncLineID = (int)exAttr2; |
| | |
| | | int selectID = selectItemInfo[CustomizedRechargeModel.Instance.chooseWinIndex][itemIndex];
|
| | | int itemId = CTGSelectItemConfig.Get(selectID).ItemID;
|
| | | int count = CTGSelectItemConfig.Get(selectID).ItemCount;
|
| | | var itemData = new ItemCellModel((int)itemId, false, (ulong)count);
|
| | | var itemData = new ItemCellModel(itemId, false, count);
|
| | | images[i].SetActive(CustomizedRechargeModel.Instance.GetChooseSubIndex(CustomizedRechargeModel.Instance.chooseWinIndex) - 1 == i);
|
| | | itemCells[i].SetActive(true);
|
| | | itemCells[i].Init(itemData);
|
| | |
| | | if (chooseIndex != 0)
|
| | | {
|
| | | int selectID = ctgConfig.SelectItemInfo[i][chooseIndex - 1];
|
| | | var itemData = new ItemCellModel(CTGSelectItemConfig.Get(selectID).ItemID, false, (ulong)CTGSelectItemConfig.Get(selectID).ItemCount);
|
| | | var itemData = new ItemCellModel(CTGSelectItemConfig.Get(selectID).ItemID, false, CTGSelectItemConfig.Get(selectID).ItemCount);
|
| | | itemCellList[i].Init(itemData);
|
| | | if (i == CustomizedRechargeModel.Instance.chooseWinIndex)
|
| | | {
|
| | |
| | | {
|
| | | int selectID = selectItemInfo[j][selectedItemIndexs[j] - 1];
|
| | |
|
| | | items.Add(new Item(CTGSelectItemConfig.Get(selectID).ItemID, (ulong)CTGSelectItemConfig.Get(selectID).ItemCount));
|
| | | items.Add(new Item(CTGSelectItemConfig.Get(selectID).ItemID, CTGSelectItemConfig.Get(selectID).ItemCount));
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | if (i < awards.Count)
|
| | | {
|
| | | var award = awards[i];
|
| | | var itemData = new ItemCellModel(award.id, false, (ulong)award.countEx);
|
| | | var itemData = new ItemCellModel(award.id, false, award.countEx);
|
| | | itemCells[i].Init(itemData);
|
| | | itemCells[i].button.SetListener(() =>
|
| | | {
|
| | |
| | | int moneyType = funcSet.CostMoneyType;
|
| | | int xbOneMoney = funcSet.CostMoneyList[0];
|
| | |
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney)
|
| | | {
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (!GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType))
|
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.Show(GeneralDefine.MoneyDisplayModel[moneyType], true);
|
| | | }
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | //货币寻宝
|
| | | int moneyType = funcSet.CostMoneyType;
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)needMoney)
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= needMoney)
|
| | | {
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (!GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType))
|
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.Show(GeneralDefine.MoneyDisplayModel[moneyType], true);
|
| | | }
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | var funcSet = TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore); |
| | | scoreProcessText.text = UIHelper.GetMoneyCnt(51) + "/" + TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]; |
| | | sliderImg.fillAmount = (float)UIHelper.GetMoneyCnt(51) / TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]; |
| | | if (UIHelper.GetMoneyCnt(51) >= (ulong)TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]) |
| | | if (UIHelper.GetMoneyCnt(51) >= TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]) |
| | | { |
| | | scoreProcessText.color = UIHelper.GetUIColor(TextColType.LightWhite); |
| | | } |
| | |
| | | |
| | | scoreText.text = UIHelper.GetMoneyCnt(51) + "/" + TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]; |
| | | |
| | | if (UIHelper.GetMoneyCnt(51) >= (ulong)TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]) |
| | | if (UIHelper.GetMoneyCnt(51) >= TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]) |
| | | { |
| | | scoreTween.SetActive(true); |
| | | } |
| | |
| | | return TeamManager.Instance.GetTeam(teamType).HasHeroInServer(itemHero.guid); |
| | | } |
| | | |
| | | //是否上任何阵容 |
| | | public bool IsInAnyTeam() |
| | | { |
| | | for (int i = 1; i < (int)TeamType.Max; i++) |
| | | { |
| | | if (TeamManager.Instance.GetTeam((TeamType)i).HasHeroInServer(itemHero.guid)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //是否上任何阵容,且只有一只 |
| | | public bool IsInAnyTeamJustOne() |
| | | { |
| | | for (int i = 1; i < (int)TeamType.Max; i++) |
| | | { |
| | | var team = TeamManager.Instance.GetTeam((TeamType)i); |
| | | if (team.HasHeroInServer(itemHero.guid)) |
| | | { |
| | | if (team.GetTeamHeroCount() == 1) |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //下阵所有阵容 |
| | | public void LeaveAllTeam() |
| | | { |
| | | for (int i = 1; i < (int)TeamType.Max; i++) |
| | | { |
| | | int pos; |
| | | var team = TeamManager.Instance.GetTeam((TeamType)i); |
| | | if (TeamManager.Instance.GetTeam((TeamType)i).RemoveHero(this, out pos)) |
| | | { |
| | | //如果是最后一个武将,则默认上阵一个 |
| | | team.SaveTeam(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public long GetSkillsFightPower() |
| | | { |
| | | long fightPower = 0; |
| | |
| | | } |
| | | return fightPower; |
| | | } |
| | | |
| | | |
| | | public void ChangeLockState() |
| | | { |
| | | var pack = new CB238_tagCSHeroLock(); |
| | | pack.ItemIndex = (ushort)itemHero.gridIndex; |
| | | pack.IsLock = isLock ? (byte)0 : (byte)1; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class HeroDeleteHeadCell : MonoBehaviour |
| | | { |
| | | [SerializeField] HeroHeadBaseCell heroHeadBaseCell; |
| | | [SerializeField] Image jobImg; |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] GameObject selectRect; |
| | | [SerializeField] GameObject maskObj; |
| | | [SerializeField] GameObject onTeamObj; |
| | | [SerializeField] GameObject lockObj; |
| | | [SerializeField] GameObject awakeObj; |
| | | [SerializeField] Text awakeLVText; |
| | | |
| | | public void Display(int index) |
| | | { |
| | | var guid = HeroUIManager.Instance.heroDeleteSortList[index]; |
| | | var hero = HeroManager.Instance.GetHero(guid); |
| | | var team = TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType); |
| | | selectRect.SetActive(HeroUIManager.Instance.selectDeleteHeroList.Contains(guid)); |
| | | maskObj.SetActive(hero.isLock || hero.IsInAnyTeam() |
| | | || HeroUIManager.Instance.selectDeleteHeroList.Contains(guid) || hero.awakeLevel > 0); |
| | | |
| | | lockObj.SetActive(hero.isLock); |
| | | onTeamObj.SetActive(hero.IsInAnyTeam()); |
| | | awakeObj.SetActive(hero.awakeLevel > 0); |
| | | awakeLVText.text = hero.awakeLevel.ToString(); |
| | | |
| | | heroHeadBaseCell.Init(hero.heroId, hero.SkinID, hero.heroStar, hero.awakeLevel, hero.heroLevel, () => |
| | | { |
| | | Click(hero, index); |
| | | }); |
| | | nameText.text = hero.breakLevel == 0 ? hero.heroConfig.Name : Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel); |
| | | |
| | | jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(hero.heroConfig.Class)); |
| | | } |
| | | |
| | | void Click(HeroInfo hero, int index) |
| | | { |
| | | //上阵 锁定 觉醒 的情况 |
| | | if (hero.awakeLevel > 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroReborn1"); |
| | | return; |
| | | } |
| | | |
| | | if (hero.IsInAnyTeamJustOne()) |
| | | { |
| | | //阵容至少要有一个武将上阵 |
| | | SysNotifyMgr.Instance.ShowTip("HeroFunc3"); |
| | | return; |
| | | } |
| | | |
| | | if (hero.isLock) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), |
| | | Language.Get("herocard66"), (bool isOK) => |
| | | { |
| | | if (isOK) |
| | | { |
| | | hero.ChangeLockState(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | if (hero.IsInAnyTeam()) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), |
| | | Language.Get("herocard65"), (bool isOK) => |
| | | { |
| | | if (isOK) |
| | | { |
| | | hero.LeaveAllTeam(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | if (HeroUIManager.Instance.selectDeleteHeroList.Contains(hero.itemHero.guid)) |
| | | { |
| | | HeroUIManager.Instance.selectDeleteHeroList.Remove(hero.itemHero.guid); |
| | | } |
| | | else |
| | | { |
| | | HeroUIManager.Instance.selectDeleteHeroList.Add(hero.itemHero.guid); |
| | | } |
| | | |
| | | Display(index); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c612a8c9405b7504197e93a1c71d9fc7 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class HeroDeleteLineCell : CellView |
| | | { |
| | | [SerializeField] HeroDeleteHeadCell[] cardList; |
| | | |
| | | public void Display(int index) |
| | | { |
| | | for (int i = 0; i < cardList.Length; i++) |
| | | { |
| | | if (i + index < HeroUIManager.Instance.heroDeleteSortList.Count) |
| | | { |
| | | cardList[i].SetActive(true); |
| | | cardList[i].Display(index + i); |
| | | } |
| | | else |
| | | { |
| | | cardList[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: bbe0726ecc72b50449e34339b7d9af94 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将培养界面 |
| | | /// </summary> |
| | | public class HeroDeleteWin : UIBase |
| | | { |
| | | [SerializeField] Button storeBtn; |
| | | [SerializeField] ScrollerController scroller; |
| | | [SerializeField] HeroSelectBehaviour heroSelectBehaviour; |
| | | [SerializeField] GameObject noHeroObj; |
| | | [SerializeField] Button quickSelectBtn; |
| | | [SerializeField] Button deleteBtn; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | storeBtn.AddListener(() => |
| | | { |
| | | // UIManager.Instance.OpenWindow<StoreWin>(); |
| | | }); |
| | | quickSelectBtn.AddListener(QuickSelect); |
| | | deleteBtn.AddListener(DeleteHero); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | TeamManager.Instance.OnTeamChange += OnTeamChange; |
| | | PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent; |
| | | ItemLogicUtility.Instance.OnGetItemShowEvent += OnGetItemShowEvent; |
| | | |
| | | HeroUIManager.Instance.selectHeroDeleteListJob = 0; |
| | | HeroUIManager.Instance.selectHeroDeleteListCountry = 0; |
| | | |
| | | HeroUIManager.Instance.SortHeroDeleteList(); |
| | | heroSelectBehaviour.Display(0, HeroUIManager.Instance.selectHeroDeleteListJob, HeroUIManager.Instance.selectHeroDeleteListCountry, SelectJobCountry); |
| | | RefreshEmptyTip(); |
| | | CreateScroller(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | TeamManager.Instance.OnTeamChange -= OnTeamChange; |
| | | PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent; |
| | | ItemLogicUtility.Instance.OnGetItemShowEvent -= OnGetItemShowEvent; |
| | | HeroUIManager.Instance.selectDeleteHeroList.Clear(); |
| | | } |
| | | |
| | | void CreateScroller() |
| | | { |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < HeroUIManager.Instance.heroDeleteSortList.Count; i++) |
| | | { |
| | | if (i % 5 == 0) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as HeroDeleteLineCell; |
| | | _cell.Display(cell.index); |
| | | } |
| | | |
| | | void SelectJobCountry(int job, int country) |
| | | { |
| | | HeroUIManager.Instance.selectHeroDeleteListJob = job; |
| | | HeroUIManager.Instance.selectHeroDeleteListCountry = country; |
| | | HeroUIManager.Instance.SortHeroDeleteList(); |
| | | CreateScroller(); |
| | | RefreshEmptyTip(); |
| | | } |
| | | |
| | | void RefreshEmptyTip() |
| | | { |
| | | if (HeroUIManager.Instance.heroDeleteSortList.Count <= 0) |
| | | { |
| | | noHeroObj.SetActive(true); |
| | | scroller.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | noHeroObj.SetActive(false); |
| | | scroller.SetActive(true); |
| | | } |
| | | } |
| | | |
| | | void OnTeamChange(TeamType type) |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | void RefreshItemLockEvent(PackType type, string guid, bool lockState) |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | void QuickSelect() |
| | | { |
| | | //只选精英 |
| | | for (int i = 0; i < HeroUIManager.Instance.heroDeleteSortList.Count; i++) |
| | | { |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.heroDeleteSortList[i]); |
| | | if (hero == null) |
| | | continue; |
| | | |
| | | if (hero.Quality > 2) |
| | | continue; |
| | | if (hero.awakeLevel > 0) |
| | | continue; |
| | | if (hero.isLock) |
| | | continue; |
| | | if (hero.IsInAnyTeam()) |
| | | continue; |
| | | |
| | | if (HeroUIManager.Instance.selectDeleteHeroList.Contains(hero.itemHero.guid)) |
| | | continue; |
| | | |
| | | HeroUIManager.Instance.selectDeleteHeroList.Add(hero.itemHero.guid); |
| | | } |
| | | |
| | | if (HeroUIManager.Instance.selectDeleteHeroList.Count == 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroReborn2"); |
| | | return; |
| | | } |
| | | |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | void DeleteHero() |
| | | { |
| | | if (HeroUIManager.Instance.selectDeleteHeroList.Count == 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroReborn3"); |
| | | return; |
| | | } |
| | | |
| | | bool hasStarHero = false; |
| | | for (int i = 0; i < HeroUIManager.Instance.selectDeleteHeroList.Count; i++) |
| | | { |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]); |
| | | if (hero == null) |
| | | continue; |
| | | if (hero.heroStar > 1) |
| | | { |
| | | hasStarHero = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (hasStarHero) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("herocard67"), (bool isOK) => |
| | | { |
| | | if (isOK) |
| | | { |
| | | ShowDeleteItems(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | ShowDeleteItems(); |
| | | |
| | | } |
| | | |
| | | void ShowDeleteItems() |
| | | { |
| | | Dictionary<int, long> allItemDict = new Dictionary<int, long>(); |
| | | for (int i = 0; i < HeroUIManager.Instance.selectDeleteHeroList.Count; i++) |
| | | { |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]); |
| | | if (hero == null) |
| | | continue; |
| | | |
| | | |
| | | allItemDict = CommonFunc.AddDict(allItemDict, CommonFunc.AddDict(HeroUIManager.Instance.GetHeroLVPayBack(hero.Quality, hero.heroLevel), |
| | | HeroUIManager.Instance.GetHeroBreakPayBack(hero.Quality, hero.breakLevel))); |
| | | |
| | | Dictionary<int, long> tmpDict = new Dictionary<int, long>(); |
| | | |
| | | foreach (var itemInfo in hero.qualityConfig.DismissReturnItems) |
| | | { |
| | | if (!tmpDict.ContainsKey(itemInfo[0])) |
| | | { |
| | | tmpDict.Add(itemInfo[0], itemInfo[1] * (1 + hero.heroStar)); |
| | | } |
| | | else |
| | | { |
| | | tmpDict[itemInfo[0]] += itemInfo[1] * (1 + hero.heroStar); |
| | | } |
| | | } |
| | | |
| | | allItemDict = CommonFunc.AddDict(allItemDict, tmpDict); |
| | | } |
| | | |
| | | List<Item> items = CommonFunc.ChangeToItemList(allItemDict); |
| | | ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard25"), Language.Get("herocard26"), (bool isOk) => |
| | | { |
| | | if (isOk) |
| | | { |
| | | //发包 |
| | | var pack = new CB240_tagCSHeroDismiss(); |
| | | List<ushort> indexList = new List<ushort>(); |
| | | for (int i = 0; i < HeroUIManager.Instance.selectDeleteHeroList.Count; i++) |
| | | { |
| | | indexList.Add((ushort)HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]).itemHero.gridIndex); |
| | | } |
| | | pack.ItemIndexList = indexList.ToArray(); |
| | | pack.Count = (ushort)pack.ItemIndexList.Length; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | HeroUIManager.Instance.selectDeleteHeroList.Clear(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | void OnGetItemShowEvent() |
| | | { |
| | | HeroUIManager.Instance.SortHeroDeleteList(); |
| | | CreateScroller(); |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d70030f1a7e3bc74fb1ed762daa7a2d3 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | } |
| | | |
| | | moneyIcon.SetOrgSprite(ItemConfig.Get(nextBreakLVConfig.UPCostItem[0]).IconKey); |
| | | moneyText.text = UIHelper.ShowUseItem(PackType.Item, nextBreakLVConfig.UPCostItem[0], (ulong)nextBreakLVConfig.UPCostItem[1]); |
| | | moneyText.text = UIHelper.ShowUseItem(PackType.Item, nextBreakLVConfig.UPCostItem[0], nextBreakLVConfig.UPCostItem[1]); |
| | | |
| | | var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(hero.heroId, hero.breakLevel + 1); |
| | | if (nextQualityBreakConfig == null) |
| | |
| | | |
| | | void BreakLV() |
| | | { |
| | | if (ItemLogicUtility.CheckItemCount(PackType.Item, hero.qualityBreakConfig.UPCostItem[0], (ulong)hero.qualityBreakConfig.UPCostItem[1], 2)) |
| | | if (ItemLogicUtility.CheckItemCount(PackType.Item, hero.qualityBreakConfig.UPCostItem[0], hero.qualityBreakConfig.UPCostItem[1], 2)) |
| | | { |
| | | var pack = new CB232_tagCSHeroBreak(); |
| | | pack.ItemIndex = (ushort)hero.itemHero.gridIndex; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<int, long>(hero.heroId, hero.CalculatePower(false)); |
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false)); |
| | | CloseWindow(); |
| | | //设置个等待回复的标识 显示成功界面 |
| | | HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse() |
| | |
| | | heroListScroller.OnRefreshCell += OnRefreshCell; |
| | | PackManager.Instance.gridRefreshEvent += GridRefreshEvent; |
| | | PackManager.Instance.RefreshItemEvent += RefreshItemEvent; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | HeroUIManager.Instance.SortHeroList(); |
| | | CreateScroller(); |
| | | Refresh(); |
| | |
| | | heroListScroller.OnRefreshCell -= OnRefreshCell; |
| | | PackManager.Instance.RefreshItemEvent -= RefreshItemEvent; |
| | | PackManager.Instance.gridRefreshEvent -= GridRefreshEvent; |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | } |
| | | |
| | | |
| | | private void OnCloseWindow(UIBase closeUI) |
| | | { |
| | | //其他武将功能产生数据变化,需要刷新武将列表 |
| | | if (closeUI is HeroTrainWin || |
| | | closeUI is HeroCallWin || |
| | | closeUI is HeroPosWin) |
| | | { |
| | | HeroUIManager.Instance.SortHeroList(); |
| | | CreateScroller(); |
| | | Refresh(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | ChangeHero(-1); |
| | | }); |
| | | |
| | | lockBtn.AddListener(SetLockState); |
| | | lockBtn.AddListener(()=> { hero.ChangeLockState(); }); |
| | | resetBtn.AddListener(ResetBtnClick); |
| | | deleteBtn.AddListener(DeleteHero); |
| | | awakeBtn.AddListener(() => |
| | |
| | | { |
| | | PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent; |
| | | HeroManager.Instance.onHeroChangeEvent += RefreshHeroEvent; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | guid = HeroUIManager.Instance.selectHeroGuid; |
| | | hero = HeroManager.Instance.GetHero(guid); |
| | | unfoldState = false; |
| | |
| | | { |
| | | PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent; |
| | | HeroManager.Instance.onHeroChangeEvent -= RefreshHeroEvent; |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | } |
| | | |
| | | |
| | | private void OnCloseWindow(UIBase closeUI) |
| | | { |
| | | //其他界面删除武将会影响逻辑 |
| | | if (closeUI is HeroDeleteWin) |
| | | { |
| | | HeroUIManager.Instance.SortHeroList(); |
| | | if (HeroManager.Instance.GetHero(guid) == null) |
| | | { |
| | | CloseWindow(); |
| | | } |
| | | } |
| | | } |
| | | public override void Refresh() |
| | | { |
| | | roleLhModel.Create(hero.SkinID, HeroUIManager.lihuiScale, motionName: "", isLh: true); |
| | |
| | | Refresh(); |
| | | } |
| | | |
| | | void SetLockState() |
| | | { |
| | | var pack = new CB238_tagCSHeroLock(); |
| | | pack.ItemIndex = (ushort)hero.itemHero.gridIndex; |
| | | pack.IsLock = hero.isLock ? (byte)0 : (byte)1; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | void ResetBtnClick() |
| | | { |
| | | //升级、突破、觉醒 |
| | |
| | | |
| | | |
| | | var payBack1 = CommonFunc.AddDict(HeroUIManager.Instance.GetHeroLVPayBack(hero.Quality, hero.heroLevel), |
| | | HeroUIManager.Instance.GetHeroBreakPayBack(hero.heroId, hero.breakLevel)); |
| | | HeroUIManager.Instance.GetHeroBreakPayBack(hero.Quality, hero.breakLevel)); |
| | | |
| | | //已觉醒的需要消耗货币 |
| | | if (hero.awakeLevel == 0) |
| | |
| | | } |
| | | else |
| | | { |
| | | payBack1 = CommonFunc.AddDict(payBack1, HeroUIManager.Instance.GetHeroQualityAwakePayBack(hero.heroId, hero.awakeLevel)); |
| | | |
| | | if (HeroUIManager.Instance.awakeRebirthCnt >= HeroUIManager.Instance.rebornAwakeHeroMaxCount) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroRebornAwakeMax"); |
| | | return; |
| | | } |
| | | |
| | | payBack1 = CommonFunc.AddDict(payBack1, HeroUIManager.Instance.GetHeroQualityAwakePayBack(hero.Quality, hero.awakeLevel)); |
| | | items = CommonFunc.ChangeToItemList(payBack1); |
| | | var info2 = Language.Get("herocard44", HeroUIManager.Instance.awakeRebirthCnt); |
| | | var payBackMoney = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel).RebirthCostMoney; |
| | | ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) => |
| | | { |
| | | if (isOk) |
| | | { |
| | | if (UIHelper.GetMoneyCnt(HeroUIManager.Instance.payBackMoneyType) < payBackMoney) |
| | | { |
| | | ItemTipUtility.ShowMoneyTip(HeroUIManager.Instance.payBackMoneyType); |
| | | return; |
| | | } |
| | | //发包 |
| | | SendReborn(hero.itemHero.gridIndex); |
| | | } |
| | | }, info2, "", HeroUIManager.Instance.payBackMoney, HeroUIManager.Instance.payBackMoneyType); |
| | | }, info2, "", payBackMoney, HeroUIManager.Instance.payBackMoneyType); |
| | | |
| | | } |
| | | |
| | |
| | | var pack = new CB239_tagCSHeroRebirth(); |
| | | pack.ItemIndex = (ushort)index; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | |
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false)); |
| | | |
| | | } |
| | | |
| | | void DeleteHero() |
| | | { |
| | | if (hero.isLock) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("UnlockHero"); |
| | | return; |
| | | } |
| | | // if (hero.isLock) |
| | | // { |
| | | // SysNotifyMgr.Instance.ShowTip("UnlockHero"); |
| | | // return; |
| | | // } |
| | | |
| | | UIManager.Instance.OpenWindow<HeroDeleteWin>(); |
| | | } |
| | | |
| | | void RefreshStars() |
| | |
| | | lvupBtnText.text = Language.Get("L1111"); |
| | | var breakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel); |
| | | lvupMoneyIcon.SetOrgSprite(ItemConfig.Get(breakConfig.UPCostItem[0]).IconKey); |
| | | lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, breakConfig.UPCostItem[0], (ulong)breakConfig.UPCostItem[1], TextColType.NavyBrown); |
| | | lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, breakConfig.UPCostItem[0], breakConfig.UPCostItem[1], TextColType.NavyBrown); |
| | | } |
| | | else |
| | | { |
| | | lvupBtnText.text = Language.Get("L1109"); |
| | | var lvupConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel); |
| | | lvupMoneyIcon.SetOrgSprite(ItemConfig.Get(lvupConfig.UPCostItem[0]).IconKey); |
| | | lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, lvupConfig.UPCostItem[0], (ulong)lvupConfig.UPCostItem[1], TextColType.NavyBrown); |
| | | lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, lvupConfig.UPCostItem[0], lvupConfig.UPCostItem[1], TextColType.NavyBrown); |
| | | } |
| | | |
| | | } |
| | |
| | | void LVUp() |
| | | { |
| | | int itemID = 0; |
| | | ulong needCount = 0; |
| | | long needCount = 0; |
| | | if (HeroUIManager.Instance.IsLVMaxByBreakLevel(hero)) |
| | | { |
| | | //突破 |
| | |
| | | //升级 |
| | | var lvupConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel); |
| | | itemID = lvupConfig.UPCostItem[0]; |
| | | needCount = (ulong)lvupConfig.UPCostItem[1]; |
| | | needCount = lvupConfig.UPCostItem[1]; |
| | | if (ItemLogicUtility.CheckItemCount(PackType.Item, itemID, needCount, 2)) |
| | | { |
| | | var pack = new CB230_tagCSHeroLVUP(); |
| | |
| | | { |
| | | addPerObject.SetActive(false); |
| | | }); |
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<int, long>(hero.heroId, hero.CalculatePower(false)); |
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将培养界面 |
| | | /// </summary> |
| | | public partial class HeroTrainWin : UIBase |
| | | { |
| | | |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0a54f9a153cd2c04cb1deeeaa05b7741 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | |
| | | public partial class HeroUIManager : GameSystemManager<HeroUIManager> |
| | | { |
| | | |
| | | |
| | | |
| | | #region 重生 遣散 |
| | | public int awakeRebirthCnt { get; private set; } |
| | | public int payBackMoneyType; |
| | | public int payBackMoney; |
| | | public Dictionary<int, ulong> GetHeroLVPayBack(int quality, int lv) |
| | | public int rebornAwakeHeroMaxCount; //觉醒武将每日的最大重生次数 |
| | | |
| | | public List<string> heroDeleteSortList { get; private set; } = new List<string>(); |
| | | public int selectHeroDeleteListJob = 0; //筛选职业 |
| | | public int selectHeroDeleteListCountry = 0; //筛选国家 |
| | | |
| | | public List<string> selectDeleteHeroList { get; private set; } = new List<string>(); |
| | | |
| | | |
| | | public Dictionary<int, long> GetHeroLVPayBack(int quality, int lv) |
| | | { |
| | | //汇总返还总数量 |
| | | Dictionary<int, ulong> itemCounDic = new Dictionary<int, ulong>(); |
| | | Dictionary<int, long> itemCounDic = new Dictionary<int, long>(); |
| | | for (int i = 1; i < lv; i++) |
| | | { |
| | | var config = HeroQualityLVConfig.GetQualityLVConfig(quality, lv); |
| | | var config = HeroQualityLVConfig.GetQualityLVConfig(quality, i); |
| | | var itemID = config.UPCostItem[0]; |
| | | var count = (ulong)config.UPCostItem[1]; |
| | | var count = config.UPCostItem[1]; |
| | | if (!itemCounDic.ContainsKey(itemID)) |
| | | { |
| | | itemCounDic[itemID] = count; |
| | | } |
| | | itemCounDic[itemID] = itemCounDic[itemID] + count; |
| | | else |
| | | { |
| | | itemCounDic[itemID] += count; |
| | | } |
| | | } |
| | | |
| | | return itemCounDic; |
| | | } |
| | | |
| | | |
| | | public Dictionary<int, ulong> GetHeroBreakPayBack(int quality, int lv) |
| | | public Dictionary<int, long> GetHeroBreakPayBack(int quality, int lv) |
| | | { |
| | | //汇总返还总数量 |
| | | Dictionary<int, ulong> itemCounDic = new Dictionary<int, ulong>(); |
| | | Dictionary<int, long> itemCounDic = new Dictionary<int, long>(); |
| | | for (int i = 0; i < lv; i++) |
| | | { |
| | | var config = HeroQualityBreakConfig.GetQualityBreakConfig(quality, lv); |
| | | var config = HeroQualityBreakConfig.GetQualityBreakConfig(quality, i); |
| | | var itemID = config.UPCostItem[0]; |
| | | var count = (ulong)config.UPCostItem[1]; |
| | | var count = config.UPCostItem[1]; |
| | | if (!itemCounDic.ContainsKey(itemID)) |
| | | { |
| | | itemCounDic[itemID] = count; |
| | | } |
| | | itemCounDic[itemID] = itemCounDic[itemID] + count; |
| | | else |
| | | { |
| | | itemCounDic[itemID] += count; |
| | | } |
| | | } |
| | | |
| | | return itemCounDic; |
| | |
| | | |
| | | } |
| | | |
| | | public Dictionary<int, ulong> GetHeroQualityAwakePayBack(int quality, int lv) |
| | | public Dictionary<int, long> GetHeroQualityAwakePayBack(int quality, int lv) |
| | | { |
| | | //汇总返还总数量 |
| | | Dictionary<int, ulong> itemCounDic = new Dictionary<int, ulong>(); |
| | | Dictionary<int, long> itemCounDic = new Dictionary<int, long>(); |
| | | for (int i = 0; i < lv; i++) |
| | | { |
| | | var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(quality, lv); |
| | | var itemID = config.UPCostItem[0]; |
| | | var count = (ulong)config.UPCostItem[1]; |
| | | var count = config.UPCostItem[1]; |
| | | if (!itemCounDic.ContainsKey(itemID)) |
| | | { |
| | | itemCounDic[itemID] = count; |
| | | } |
| | | itemCounDic[itemID] = itemCounDic[itemID] + count; |
| | | else |
| | | { |
| | | itemCounDic[itemID] = itemCounDic[itemID] + count; |
| | | } |
| | | } |
| | | |
| | | return itemCounDic; |
| | |
| | | awakeRebirthCnt = netPack.AwakeRebirthCnt; |
| | | } |
| | | |
| | | |
| | | public void SortHeroDeleteList() |
| | | { |
| | | heroDeleteSortList = HeroManager.Instance.GetHeroGuidList(selectHeroDeleteListJob, selectHeroDeleteListCountry); |
| | | heroDeleteSortList.Sort(CmpDeleteHero); |
| | | } |
| | | |
| | | |
| | | int CmpDeleteHero(string guidA, string guidB) |
| | | { |
| | | HeroInfo heroA = HeroManager.Instance.GetHero(guidA); |
| | | HeroInfo heroB = HeroManager.Instance.GetHero(guidB); |
| | | if (heroA == null || heroB == null) |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | // 排序规则:上阵>武将等级>突破等级>武将觉醒阶级>武将品质>武将吞噬星级>武将ID |
| | | bool isInTeamA = heroA.IsInAnyTeam(); |
| | | bool isInTeamB = heroB.IsInAnyTeam(); |
| | | if (isInTeamA != isInTeamB) |
| | | { |
| | | return isInTeamA ? 1 : -1; |
| | | } |
| | | if (heroA.heroLevel != heroB.heroLevel) |
| | | { |
| | | return heroA.heroLevel < heroB.heroLevel ? -1 : 1; |
| | | } |
| | | if (heroA.breakLevel != heroB.breakLevel) |
| | | { |
| | | return heroA.breakLevel < heroB.breakLevel ? -1 : 1; |
| | | } |
| | | if (heroA.awakeLevel != heroB.awakeLevel) |
| | | { |
| | | return heroA.awakeLevel < heroB.awakeLevel ? -1 : 1; |
| | | } |
| | | if (heroA.Quality != heroB.Quality) |
| | | { |
| | | return heroA.Quality < heroB.Quality ? -1 : 1; |
| | | } |
| | | if (heroA.heroStar != heroA.heroStar) |
| | | { |
| | | return heroA.heroStar < heroB.heroStar ? -1 : 1; |
| | | } |
| | | |
| | | return heroB.heroId.CompareTo(heroA.heroId); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | public const float lihuiScale = 0.6f; //立绘缩放大小 |
| | | |
| | | //用于非上阵武将战力变化时 武将ID:上次战力 |
| | | public KeyValuePair<int, long> lastFightPower = new KeyValuePair<int, long>(0, 0); |
| | | public KeyValuePair<string, long> lastFightPower = new KeyValuePair<string, long>(); |
| | | |
| | | public override void Init() |
| | | { |
| | |
| | | { |
| | | var config = FuncConfigConfig.Get("HeroRebirth"); |
| | | payBackMoneyType = int.Parse(config.Numerical1); |
| | | payBackMoney = int.Parse(config.Numerical2); |
| | | rebornAwakeHeroMaxCount = int.Parse(config.Numerical2); |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | |
| | | { |
| | | if (isOK) |
| | | { |
| | | if (UIHelper.GetMoneyCnt(buyInfo[0]) < (ulong)buyInfo[1]) |
| | | if (UIHelper.GetMoneyCnt(buyInfo[0]) < buyInfo[1]) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", buyInfo[0]); |
| | | return; |
| | |
| | | items.Add(new Item() |
| | | { |
| | | id = itemArray[j][0], |
| | | countEx = (ulong)itemArray[j][1], |
| | | countEx = itemArray[j][1], |
| | | bind = itemArray[j][2], |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | //获得单投资的总收益 |
| | | public ulong GetTotalIncome(int type) |
| | | public long GetTotalIncome(int type) |
| | | { |
| | | ulong income = 0; |
| | | long income = 0; |
| | | if (m_InvestItems.ContainsKey(type)) |
| | | { |
| | | var keyList = m_InvestItems[type].Keys.ToList(); |
| | |
| | | using LitJson;
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | |
|
| | | /// <summary>
|
| | | /// 宝箱功能 + 获取奖励界面
|
| | |
| | | // ModelCenter.Instance.GetModel<FairySiegeActModel>()?.OnUpdateAwardInfoAction(netPack);
|
| | | // return;
|
| | | // }
|
| | | if (!commonShowAwardEvents.Contains(eventName))
|
| | | // if (!commonShowAwardEvents.Contains(eventName))
|
| | | // return;
|
| | | if (string.IsNullOrEmpty(eventName))
|
| | | {
|
| | | Debug.Log("获得物品展示 无事件名");
|
| | | return;
|
| | | }
|
| | |
|
| | | List<Item> showItems = new List<Item>();
|
| | |
|
| | | if (netPack.Exp != 0 || netPack.ExpPoint != 0)
|
| | | {
|
| | | ulong expValue = netPack.Exp + netPack.ExpPoint * (ulong)Constants.ExpPointValue;
|
| | | long expValue = netPack.Exp + netPack.ExpPoint * Constants.ExpPointValue;
|
| | | showItems.Add(new Item(GeneralDefine.expDisplayId, expValue));
|
| | | }
|
| | | if (netPack.MoneyList.Length != 0)
|
| | |
| | | var selectlistDict = ConfigParse.GetDic<int, int>(config.SelectList);
|
| | | foreach (var item in selectlistDict)
|
| | | {
|
| | | itemIDs.Add(new Item(item.Key, (ulong)item.Value));
|
| | | itemIDs.Add(new Item(item.Key, item.Value));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var itemListDict = ConfigParse.GetDic<int, int>(config.FixedItem);
|
| | | foreach (var item in itemListDict)
|
| | | {
|
| | | itemIDs.Add(new Item(item.Key, (ulong)item.Value));
|
| | | itemIDs.Add(new Item(item.Key, item.Value));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | for (int i = 0; i < arr.Count; i++)
|
| | | {
|
| | | itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), ulong.Parse(arr[i][1][1].ToString())));
|
| | | itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), long.Parse(arr[i][1][1].ToString())));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | for (int i = 0; i < arr.Count; i++)
|
| | | {
|
| | | itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), ulong.Parse(arr[i][1][1].ToString())));
|
| | | itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), long.Parse(arr[i][1][1].ToString())));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | itemCount = ItemTipUtility.mainTipData.baseInfo.count; |
| | | guid = ItemTipUtility.mainTipData.guid; |
| | | |
| | | itemCell.Init(new ItemCellModel(itemID, false, (ulong)itemCount)); |
| | | itemCell.Init(new ItemCellModel(itemID, false, itemCount)); |
| | | var itemConfig = ItemConfig.Get(itemID); |
| | | nameText.text = itemConfig.ItemName; |
| | | descText.text = itemConfig.Description; |
| | |
| | | this.guid = _guid;
|
| | | ItemConfig itemConfig = ItemConfig.Get(itemId);
|
| | | int count = itemArr[1];
|
| | | itemCell.Init(new ItemCellModel(itemId, false, (ulong)count));
|
| | | itemCell.Init(new ItemCellModel(itemId, false, count));
|
| | | itemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(itemId);
|
| | |
| | | guid = ItemTipUtility.mainTipData.guid;
|
| | | InitItemsData();
|
| | |
|
| | | itemCell.Init(new ItemCellModel(itemID, false, (ulong)itemCount));
|
| | | itemCell.Init(new ItemCellModel(itemID, false, itemCount));
|
| | | var itemConfig = ItemConfig.Get(itemID);
|
| | | nameText.text = itemConfig.ItemName;
|
| | | descText.text = itemConfig.Description;
|
| | |
| | | public static TipData mainTipData { get; private set; } // 注意当递进点击打开多个tip界面会变更数据,不能依赖此值 |
| | | public static TipData secondaryData { get; private set; } |
| | | |
| | | public static void ShowMoneyTip(int moneyType) |
| | | { |
| | | if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType)) |
| | | { |
| | | Show(GeneralDefine.MoneyDisplayModel[moneyType], true); |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType); |
| | | // Debug.LogErrorFormat("配置MoneyDisplayModel 查无此货币:{0}", moneyType); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void Show(int itemId, bool showGetWay = false) |
| | | { |
| | | if (!ItemConfig.HasKey(itemId)) |
| | |
| | | var item = ItemTipUtility.mainTipData.baseInfo; |
| | | if (string.IsNullOrEmpty(ItemTipUtility.mainTipData.guid)) |
| | | { |
| | | itemCell.Init(new ItemCellModel(item.itemId, false, (ulong)item.count)); |
| | | itemCell.Init(new ItemCellModel(item.itemId, false, item.count)); |
| | | } |
| | | else |
| | | { |
| | |
| | | // break; |
| | | default: |
| | | { |
| | | if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType)) |
| | | { |
| | | ItemTipUtility.Show(GeneralDefine.MoneyDisplayModel[moneyType], true); |
| | | } |
| | | ItemTipUtility.ShowMoneyTip(moneyType); |
| | | } |
| | | break; |
| | | } |
| | |
| | | public struct Item |
| | | { |
| | | public int id; |
| | | public ulong countEx; |
| | | public long countEx; |
| | | public int quality; |
| | | public int bind; //绑定 或者 拍卖 交易 |
| | | |
| | | public Item(int _id, ulong _count) |
| | | public Item(int _id, long _count) |
| | | { |
| | | this.id = _id; |
| | | this.quality = 0; |
| | |
| | | } |
| | | |
| | | |
| | | public Item(int _id, ulong _count, int _quality) |
| | | public Item(int _id, long _count, int _quality) |
| | | { |
| | | this.id = _id; |
| | | this.quality = _quality; |
| | |
| | | this.countEx = _count; |
| | | } |
| | | |
| | | public Item(int _id, ulong _count, int _bind = 0, int _quality = 0) |
| | | public Item(int _id, long _count, int _bind = 0, int _quality = 0) |
| | | { |
| | | this.id = _id; |
| | | this.quality = _quality; |
| | |
| | | /// <param name="needCount 需要数量"></param>
|
| | | /// <param name="needTips">0 不响应 1 弹提示 2 弹获取途径tips</param>
|
| | | /// <returns></returns>
|
| | | public static bool CheckItemCount(PackType packType, int itemId, ulong needCount, int needTips = 0)
|
| | | public static bool CheckItemCount(PackType packType, int itemId, long needCount, int needTips = 0)
|
| | | {
|
| | | if (needCount <= 0)
|
| | | {
|
| | |
| | | return isEnough;
|
| | | }
|
| | |
|
| | | public static bool CheckCurrencyCount(int moneyType, ulong needCount, bool needTips = false)
|
| | | public static bool CheckCurrencyCount(int moneyType, long needCount, bool needTips = false)
|
| | | {
|
| | | if (needCount <= 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | ulong haveCount = UIHelper.GetMoneyCnt(moneyType);
|
| | | long haveCount = UIHelper.GetMoneyCnt(moneyType);
|
| | |
|
| | | bool isEnough = haveCount >= needCount;
|
| | |
|
| | |
| | | #endregion
|
| | |
|
| | | //设置玩家货币显示
|
| | | public string OnChangeCoinsUnit(ulong value)
|
| | | public string OnChangeCoinsUnit(long value)
|
| | | {
|
| | | return UIHelper.ReplaceLargeNum(value);
|
| | | }
|
| | |
| | | return list; |
| | | } |
| | | |
| | | public ulong GetCountById(int itemId, bool includeAuction = true) |
| | | public long GetCountById(int itemId, bool includeAuction = true) |
| | | { |
| | | ulong count = 0; |
| | | long count = 0; |
| | | |
| | | //部分货币和物品绑定 |
| | | if (GeneralDefine.itemMoneyCountDict.ContainsKey(itemId)) |
| | |
| | | { |
| | | continue; |
| | | } |
| | | count += (ulong)item.count; |
| | | count += item.count; |
| | | } |
| | | } |
| | | return count; |
| | |
| | | public virtual void Init(ItemModel model, bool isCompare = false)
|
| | | {
|
| | | itemId = model.itemId;
|
| | | InitUI(model.guid, model.itemId, (ulong)model.count, model.isAuction, model.packType, isCompare, model.useDataDict);
|
| | | InitUI(model.guid, model.itemId, model.count, model.isAuction, model.packType, isCompare, model.useDataDict);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | InitUI(model.guid, model.itemId, model.count, false, model.packType, model.isCompare, model.useDataDic);
|
| | | }
|
| | |
|
| | | private void InitUI(string guid, int itemId, ulong count, bool isAuction, PackType type, bool isCompare, Dictionary<int, List<int>> useDataDic)
|
| | | private void InitUI(string guid, int itemId, long count, bool isAuction, PackType type, bool isCompare, Dictionary<int, List<int>> useDataDic)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config == null) return;
|
| | |
| | | {
|
| | | public string guid { get; private set; }
|
| | | public int itemId { get; private set; }
|
| | | public ulong count { get; private set; }
|
| | | public long count { get; private set; }
|
| | | public int score { get; private set; }
|
| | | public bool isCompare { get; private set; }
|
| | | public ItemConfig itemConfig { get { return ItemConfig.Get(itemId); } }
|
| | |
| | | public Dictionary<int, List<int>> useDataDic { get; private set; }
|
| | |
|
| | |
|
| | | public ItemCellModel(int itemId, bool isPreview = false, ulong count = 0, string guid = "", PackType type = PackType.Deleted, bool isCompare = false, Dictionary<int, List<int>> useDataDic = null)
|
| | | public ItemCellModel(int itemId, bool isPreview = false, long count = 0, string guid = "", PackType type = PackType.Deleted, bool isCompare = false, Dictionary<int, List<int>> useDataDic = null)
|
| | | {
|
| | | this.itemId = AdjustItemId(itemId);
|
| | | this.guid = guid;
|
| | |
| | | this.score = 0;
|
| | | }
|
| | |
|
| | | public ItemCellModel(int itemId, bool isPreview, ulong count)
|
| | | public ItemCellModel(int itemId, bool isPreview, long count)
|
| | | {
|
| | | this.itemId = AdjustItemId(itemId);
|
| | | this.guid = "";
|
| | |
| | | /// <param name="type"></param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public ulong GetItemCountByID(PackType type, int id, bool includeAuction = true) |
| | | public long GetItemCountByID(PackType type, int id, bool includeAuction = true) |
| | | { |
| | | ulong count = 0; |
| | | long count = 0; |
| | | var singlePack = GetSinglePack(type); |
| | | if (singlePack != null) |
| | | { |
| | |
| | | if (index < 0 || index >= mailData.Items.Count) |
| | | return; |
| | | MailItemData data = mailData.Items[index]; |
| | | itemCell.Init(new ItemCellModel((int)data.ItemID, true, (ulong)data.Count)); |
| | | itemCell.Init(new ItemCellModel((int)data.ItemID, true, data.Count)); |
| | | itemCell.button.SetListener(() => ItemTipUtility.Show((int)data.ItemID)); |
| | | imgHave.SetActive(mailState == 3); |
| | | |
| | |
| | | }
|
| | |
|
| | |
|
| | | public void PowerAdd(ulong power)
|
| | | public void PowerAdd(long power)
|
| | | {
|
| | | if (prowBool)
|
| | | {
|
| | | prowNum = (long)power;
|
| | | prowNum = power;
|
| | | prowBool = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | if ((long)power != prowNum)
|
| | | if (power != prowNum)
|
| | | {
|
| | | prowNumChange = (long)power - prowNum;
|
| | | prowNum = (long)power;
|
| | | prowNumChange = power - prowNum;
|
| | | prowNum = power;
|
| | | isAdd = prowNumChange > 0;
|
| | | prowNumChange = Math.Abs(prowNumChange);
|
| | | if (customDisplayPower != null && customDisplayPower())
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | prowNum = (long)power;
|
| | | prowNum = power;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | /// <param name="hero"></param>
|
| | | public void AddPowerNotOnTeam(HeroInfo hero)
|
| | | {
|
| | | if (HeroUIManager.Instance.lastFightPower.Key != hero.heroId)
|
| | | if (HeroUIManager.Instance.lastFightPower.Key != hero.itemHero.guid)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | prowNumChange = hero.CalculatePower() - HeroUIManager.Instance.lastFightPower.Value;
|
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>();
|
| | | isAdd = prowNumChange > 0;
|
| | | prowNumChange = Math.Abs(prowNumChange);
|
| | | prowNum = hero.CalculatePower();
|
| | |
| | | return 0;
|
| | | //激活物品数量不足
|
| | | var hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, itemId);
|
| | | if (hasCnt < (ulong)count)
|
| | | if (hasCnt < count)
|
| | | return 0;
|
| | | return 1;
|
| | | }
|
| | |
| | | List<Item> itemList = new List<Item>();
|
| | | for (int j = 0; j < giftInfoDict[giftInfokeyList[i]].Count; j++)
|
| | | {
|
| | | Item item = new Item(giftInfoDict[giftInfokeyList[i]][j][0], (ulong)giftInfoDict[giftInfokeyList[i]][j][1]);
|
| | | Item item = new Item(giftInfoDict[giftInfokeyList[i]][j][0], giftInfoDict[giftInfokeyList[i]][j][1]);
|
| | | itemList.Add(item);
|
| | | }
|
| | | itemAllList.Add(itemList);
|
| | |
| | | m_RechargeGainItemDict.Add(configs[i].CTGID, _itemList);
|
| | | for (int k = 0; k < _itemArray.Length; k++)
|
| | | {
|
| | | Item _item = new Item(_itemArray[k][0], (ulong)_itemArray[k][1]);
|
| | | Item _item = new Item(_itemArray[k][0], _itemArray[k][1]);
|
| | | _itemList.Add(_item);
|
| | | }
|
| | | }
|
| | |
| | | for (int i = 0; i < _itemJson[jobstr].Count; i++)
|
| | | {
|
| | | m_FirstChargeItemDict[day][job].Add(new Item(int.Parse(_itemJson[jobstr][i][0].ToString()),
|
| | | ulong.Parse(_itemJson[jobstr][i][1].ToString())));
|
| | | long.Parse(_itemJson[jobstr][i][1].ToString())));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var _itemCommon = JsonMapper.ToObject<int[][]>(config.CommItemList);
|
| | | for (int i = 0; i < _itemCommon.Length; i++)
|
| | | {
|
| | | m_FirstChargeCommonItemDict[day].Add(new Item(_itemCommon[i][0], (ulong)_itemCommon[i][1]));
|
| | | m_FirstChargeCommonItemDict[day].Add(new Item(_itemCommon[i][0], _itemCommon[i][1]));
|
| | | }
|
| | |
|
| | |
|
| | |
| | | public int viewPlayerType { get; private set; }
|
| | |
|
| | | private Dictionary<int, ViewPlayerData> viewPlayerDataDic = new Dictionary<int, ViewPlayerData>();
|
| | | private Dictionary<int, ulong> funcFightPowerDict = new Dictionary<int, ulong>();
|
| | | private Dictionary<int, long> funcFightPowerDict = new Dictionary<int, long>();
|
| | | public event Action PowerUpdate;
|
| | | public static Action<int, int, ViewPlayerData> OnRevPackage; //尽量不要用第一个参数viewtype做判断,容易出错
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public ulong GetFuncFightPower(int type)
|
| | | public long GetFuncFightPower(int type)
|
| | | {
|
| | | if (funcFightPowerDict.ContainsKey(type))
|
| | | {
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | private ulong _price;
|
| | | private long _price;
|
| | | public void SendBuyShopItem(StoreConfig model, int count)
|
| | | {
|
| | |
|
| | | _price = (ulong)(model.MoneyNumber * count);
|
| | | _price = model.MoneyNumber * count;
|
| | |
|
| | | if (MoneyIsEnough(model.MoneyType, _price))
|
| | | {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public bool MoneyIsEnough(int moneyType, ulong money)
|
| | | public bool MoneyIsEnough(int moneyType, long money)
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(moneyType) < money)
|
| | | {
|
| | |
| | | {
|
| | | if (!TryGetIsSellOut(storeConfig, out remainNum))
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(storeConfig.MoneyType) >= (ulong)storeConfig.MoneyNumber)
|
| | | if (UIHelper.GetMoneyCnt(storeConfig.MoneyType) >= storeConfig.MoneyNumber)
|
| | | {
|
| | | shopRedDict[storeConfig.ID].state = RedPointState.Simple;
|
| | | }
|
| | |
| | | {
|
| | | break;
|
| | | }
|
| | | if (!MoneyIsEnough(config.MoneyType, (ulong)config.MoneyNumber))
|
| | | if (!MoneyIsEnough(config.MoneyType, config.MoneyNumber))
|
| | | {
|
| | | break;
|
| | | }
|
| | |
| | | { |
| | | None = 0, |
| | | Story = 1, //主线 |
| | | Arena = 2, //竞技场进攻 |
| | | ArenaDefense = 3, //竞技场防守 |
| | | Arena = 2, //竞技场进攻 |
| | | ArenaDefense = 3, //竞技场防守 |
| | | |
| | | Max, //最大值放最后,用于for循环,故阵容枚举按顺序+1定义,如果不按此规则请修改Max相关逻辑 |
| | | } |
| | | |
| | |
| | | public static string generalItemTip2; |
| | | |
| | | public static List<Item> getItems { get; private set; } |
| | | //多物品确认框 |
| | | /// <summary> |
| | | /// 多物品确认框 |
| | | /// </summary> |
| | | /// <param name="items"></param> |
| | | /// <param name="tiltle"></param> |
| | | /// <param name="info"></param> |
| | | /// <param name="func"></param> |
| | | /// <param name="info2"></param> |
| | | /// <param name="btnText">为空时默认显示确定文字</param> |
| | | /// <param name="moneyCnt"></param> |
| | | /// <param name="type"></param> |
| | | public static void ShowItemsConfirm(List<Item> items, string tiltle, string info, Action<bool> func, |
| | | string info2 = "", string btnText = "", int moneyCnt = 0, int type = 0) |
| | | { |
| | |
| | | { |
| | | [SerializeField] Text m_Title; |
| | | [SerializeField] Text m_RuleTxt; |
| | | [SerializeField] RectTransform scrollRect; |
| | | [SerializeField] float maxHeight = 800f; // 设置最大高度限制 |
| | | // [SerializeField] RectTransform scrollRect; |
| | | // [SerializeField] float maxHeight = 800f; // 设置最大高度限制 |
| | | |
| | | |
| | | #region Built-in |
| | |
| | | } |
| | | |
| | | //打开后固定文本,不会动态变化 |
| | | protected override void NextFrameAfterOpen() |
| | | { |
| | | Vector2 newSizeDelta = scrollRect.sizeDelta; |
| | | newSizeDelta.y = Mathf.Min(newSizeDelta.y, maxHeight); // 限制最大高度 |
| | | scrollRect.sizeDelta = newSizeDelta; |
| | | } |
| | | // protected override void NextFrameAfterOpen() |
| | | // { |
| | | // Vector2 newSizeDelta = scrollRect.sizeDelta; |
| | | // newSizeDelta.y = Mathf.Min(newSizeDelta.y, maxHeight); // 限制最大高度 |
| | | // scrollRect.sizeDelta = newSizeDelta; |
| | | // } |
| | | |
| | | |
| | | #endregion |
| | |
| | | public void Display(int index)
|
| | | {
|
| | | int itemID = ConfirmCancel.getItems[index].id;
|
| | | itemCell.Init(new ItemCellModel(itemID, false, (ulong)ConfirmCancel.getItems[index].countEx));
|
| | | itemCell.Init(new ItemCellModel(itemID, false, ConfirmCancel.getItems[index].countEx));
|
| | | itemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(itemID);
|
| | |
| | | {
|
| | | m_Title.text = ConfirmCancel.generalTitle;
|
| | | m_Info.text = ConfirmCancel.generalItemTip;
|
| | | m_Info2.text = ConfirmCancel.generalItemTip2;
|
| | | if (string.IsNullOrEmpty(ConfirmCancel.generalItemTip2))
|
| | | { |
| | | m_Info2.SetActive(false);
|
| | | }
|
| | | else
|
| | | { |
| | | m_Info2.SetActive(true);
|
| | | m_Info2.text = ConfirmCancel.generalItemTip2;
|
| | | }
|
| | | m_Scroller.OnRefreshCell += OnRefreshCell;
|
| | | CreateScroller();
|
| | | m_BtnText.text = string.IsNullOrEmpty(ConfirmCancel.OKName) ? Language.Get("L1001") : ConfirmCancel.OKName;
|
| | |
| | | else
|
| | | {
|
| | | moneyObj.SetActive(true);
|
| | | moneyText.text = UIHelper.ShowUseMoney(ConfirmCancel.moneyType, (ulong)ConfirmCancel.moneyNeedCount);
|
| | | moneyText.text = UIHelper.ShowUseMoney(ConfirmCancel.moneyType, ConfirmCancel.moneyNeedCount);
|
| | | moneyIcon.SetIconWithMoneyType(ConfirmCancel.moneyType);
|
| | | }
|
| | | }
|
| | |
| | | private void ConfirmBtn()
|
| | | {
|
| | | ConfirmCancel.OnPopConfirmClickEvent?.Invoke(true);
|
| | | CloseWindow();
|
| | | }
|
| | |
|
| | |
|
| | |
| | | |
| | | public class CommonFunc |
| | | { |
| | | public static Dictionary<int, ulong> AddDict(Dictionary<int, ulong> dic1, Dictionary<int, ulong> dic2) |
| | | public static Dictionary<int, long> AddDict(Dictionary<int, long> dic1, Dictionary<int, long> dic2) |
| | | { |
| | | var resultDic = new Dictionary<int, ulong>(dic1); |
| | | var resultDic = new Dictionary<int, long>(dic1); |
| | | foreach (var data in dic2) |
| | | { |
| | | if (resultDic.ContainsKey(data.Key)) |
| | |
| | | |
| | | |
| | | |
| | | public static List<Item> ChangeToItemList(Dictionary<int, ulong> dict) |
| | | public static List<Item> ChangeToItemList(Dictionary<int, long> dict) |
| | | { |
| | | List<Item> itemlist = new List<Item>(); |
| | | if (dict == null) |
| | |
| | | public const float F_EPSILON = 0.00001f; |
| | | |
| | | //服务端的大数值通过两个字段表示,大数字位单位为亿 |
| | | public const ulong ExpPointValue = 100000000; |
| | | public const long ExpPointValue = 100000000; |
| | | |
| | | public static readonly Vector3 Special_Hide_Position = new Vector3(10000, -10000, 10000); |
| | | public readonly static Vector2 DESIGN_RESOLUTION = new Vector2(750, 1334); |
| | |
| | | else if (span.TotalMinutes > 1) return Math.Floor(span.TotalMinutes) + Language.Get("L1073"); |
| | | else return 1 + Language.Get("L1073"); |
| | | } |
| | | /// <summary> |
| | | /// 根据属性获取玩家数据 |
| | | /// </summary> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | public static ulong GetPropertyValue(PropertyType type) |
| | | { |
| | | switch (type) |
| | | { |
| | | case PropertyType.LV: |
| | | return PlayerDatas.Instance.baseData.LV; |
| | | case PropertyType.POWER: |
| | | return (ulong)PlayerDatas.Instance.baseData.STR; |
| | | case PropertyType.AGILITY: |
| | | return (ulong)PlayerDatas.Instance.baseData.PHY; |
| | | case PropertyType.PHYSIQUE: |
| | | return (ulong)PlayerDatas.Instance.baseData.CON; |
| | | case PropertyType.MENTALITY: |
| | | return (ulong)PlayerDatas.Instance.baseData.PNE; |
| | | case PropertyType.HP: |
| | | return PlayerDatas.Instance.extersion.MaxHP; |
| | | case PropertyType.ATK: |
| | | return (ulong)PlayerDatas.Instance.extersion.MAXATK; |
| | | case PropertyType.DEF: |
| | | return (ulong)PlayerDatas.Instance.extersion.DEF; |
| | | case PropertyType.HIT: |
| | | return (ulong)PlayerDatas.Instance.extersion.HIT; |
| | | case PropertyType.MISS: |
| | | return (ulong)PlayerDatas.Instance.extersion.Miss; |
| | | case PropertyType.ATKSPEED: |
| | | return (ulong)PlayerDatas.Instance.extersion.battleValEx1; |
| | | case PropertyType.CritChance: |
| | | return (ulong)PlayerDatas.Instance.extersion.SuperHitRate; |
| | | case PropertyType.CritHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.SuperHit; |
| | | case PropertyType.CritResis: |
| | | return (ulong)PlayerDatas.Instance.extersion.SuperHitReduce; |
| | | case PropertyType.HeartHit: |
| | | return (ulong)PlayerDatas.Instance.extersion.luckHitRate; |
| | | case PropertyType.HeartHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.luckHitVal; |
| | | case PropertyType.HeartResis: |
| | | return (ulong)PlayerDatas.Instance.extersion.LuckyHitRateReduce; |
| | | case PropertyType.SkillHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.SkillAtkRate; |
| | | case PropertyType.PVPAddHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.DamagePVP; |
| | | case PropertyType.PVPReduceHurt: |
| | | return PlayerDatas.Instance.GetPlayerDataByType((PlayerDataType)191); |
| | | case PropertyType.LifeReply: |
| | | return (ulong)PlayerDatas.Instance.extersion.HPRestorePer; |
| | | case PropertyType.HurtReflect: |
| | | return (ulong)PlayerDatas.Instance.extersion.DamageBackRate; |
| | | case PropertyType.MoveSpeed: |
| | | return (ulong)PlayerDatas.Instance.extersion.SpeedValue; |
| | | case PropertyType.PetAddHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.PetDamPer; |
| | | case PropertyType.RealHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.realATK; |
| | | case PropertyType.RealResis: |
| | | return (ulong)PlayerDatas.Instance.extersion.realDEF; |
| | | case PropertyType.DefyDef: |
| | | return (ulong)PlayerDatas.Instance.extersion.IgnoreDefRate; |
| | | case PropertyType.DefyDefResis: |
| | | return (ulong)PlayerDatas.Instance.extersion.IgnoreDefRateReduce; |
| | | case PropertyType.DefChance: |
| | | return (ulong)PlayerDatas.Instance.extersion.DamChanceDef; |
| | | case PropertyType.BloodHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.BleedDamage; |
| | | case PropertyType.AktReplyBlood: |
| | | return (ulong)PlayerDatas.Instance.extersion.BattleValEx2; |
| | | case PropertyType.Stun: |
| | | return (ulong)PlayerDatas.Instance.extersion.FaintRate; |
| | | case PropertyType.CtrlResis: |
| | | return (ulong)PlayerDatas.Instance.extersion.FaintDefRate; |
| | | case PropertyType.AddFinalHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.FinalHurt; |
| | | case PropertyType.ReduceFinalHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.FinalHurtReduce; |
| | | case PropertyType.PVPAddHurtPer: |
| | | return (ulong)PlayerDatas.Instance.extersion.DamagePerPVP; |
| | | case PropertyType.PVPReduceHurtPer: |
| | | return (ulong)PlayerDatas.Instance.extersion.DamagePerPVPReduce; |
| | | case PropertyType.DleHitChance: |
| | | return (ulong)PlayerDatas.Instance.extersion.ComboDamPerRate; |
| | | case PropertyType.DleHurt: |
| | | return (ulong)PlayerDatas.Instance.extersion.ComboDamPer; |
| | | case PropertyType.ReduceSkillHurtPercent: |
| | | return (ulong)PlayerDatas.Instance.extersion.skillAtkRateReduce; |
| | | case PropertyType.NpcHurtAddPer: |
| | | return (ulong)PlayerDatas.Instance.extersion.NpcHurtAddPer; |
| | | case PropertyType.Luck: |
| | | return (ulong)PlayerDatas.Instance.extersion.luckValue; |
| | | case PropertyType.Mater: |
| | | return (ulong)PlayerDatas.Instance.baseData.mater; |
| | | case PropertyType.Wood: |
| | | return (ulong)PlayerDatas.Instance.baseData.wood; |
| | | case PropertyType.Water: |
| | | return (ulong)PlayerDatas.Instance.baseData.water; |
| | | case PropertyType.Fire: |
| | | return (ulong)PlayerDatas.Instance.baseData.fire; |
| | | case PropertyType.Earth: |
| | | return (ulong)PlayerDatas.Instance.baseData.earth; |
| | | case PropertyType.ReduceCrit: |
| | | return (ulong)PlayerDatas.Instance.baseData.reduceCrit; |
| | | case PropertyType.ReduceHeartHurtPer: |
| | | return (ulong)PlayerDatas.Instance.baseData.reduceHeartHurt; |
| | | case PropertyType.ReduceFinalHurtPer: |
| | | return (ulong)PlayerDatas.Instance.baseData.reduceFinalHurt; |
| | | case PropertyType.AtkPercent: |
| | | case PropertyType.CritHurtPercent: |
| | | case PropertyType.DodgePercent: |
| | | // return (ulong)ModelCenter.Instance.GetModel<ReikiRootModel>().GetReikiPropertyValue((int)type); |
| | | // TODO YYL |
| | | return 0ul; |
| | | case PropertyType.SkillAddPerA: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillAddPerA; |
| | | case PropertyType.SkillAddPerB: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillAddPerB; |
| | | case PropertyType.SkillAddPerC: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillAddPerC; |
| | | case PropertyType.SkillAddPerD: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillAddPerD; |
| | | case PropertyType.SkillAddPerE: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillAddPerE; |
| | | case PropertyType.SkillAddPerF: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillAddPerF; |
| | | case PropertyType.SkillAddPerG: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillAddPerG; |
| | | case PropertyType.SkillReducePerA: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillReducePerA; |
| | | case PropertyType.SkillReducePerB: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillReducePerB; |
| | | case PropertyType.SkillReducePerC: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillReducePerC; |
| | | case PropertyType.SkillReducePerD: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillReducePerD; |
| | | case PropertyType.SkillReducePerE: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillReducePerE; |
| | | case PropertyType.SkillReducePerF: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillReducePerF; |
| | | case PropertyType.SkillReducePerG: |
| | | return (ulong)PlayerDatas.Instance.baseData.skillReducePerG; |
| | | case PropertyType.ReduceSkillCDPer: |
| | | return (ulong)PlayerDatas.Instance.extersion.battleValEx3; |
| | | case PropertyType.AddFinalHurtPer: |
| | | return (ulong)PlayerDatas.Instance.extersion.FunalHurtPer; |
| | | case PropertyType.AddNormalHurt: |
| | | return (ulong)PlayerDatas.Instance.baseData.NormalHurt; |
| | | case PropertyType.AddNormalHurtPer: |
| | | return (ulong)PlayerDatas.Instance.baseData.NormalHurtPer; |
| | | case PropertyType.AddSkillHurt: |
| | | return (ulong)PlayerDatas.Instance.baseData.FabaoHurt; |
| | | case PropertyType.AddSkillHurtPer: |
| | | return (ulong)PlayerDatas.Instance.baseData.FabaoHurtPer; |
| | | case PropertyType.AddPVEHurt: |
| | | return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.DamagePVE); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | }; |
| | | |
| | | public static ulong GetMoneyCnt(int moneyType) |
| | | public static long GetMoneyCnt(int moneyType) |
| | | { |
| | | switch (moneyType) |
| | | { |
| | |
| | | } |
| | | case 18: |
| | | { |
| | | return (ulong)PlayerDatas.Instance.extersion.honorValue; |
| | | return PlayerDatas.Instance.extersion.honorValue; |
| | | } |
| | | case 25: |
| | | { |
| | |
| | | } |
| | | case 24: |
| | | { |
| | | return (ulong)PlayerDatas.Instance.extersion.runeChip; |
| | | return PlayerDatas.Instance.extersion.runeChip; |
| | | } |
| | | case 15: |
| | | { |
| | |
| | | } |
| | | |
| | | //显示数量, 格式n/m, 足够绿色不足红色 |
| | | public static string ShowUseMoney(int moneyType, ulong useCnt, TextColType engoughColor = TextColType.Green) |
| | | public static string ShowUseMoney(int moneyType, long useCnt, TextColType engoughColor = TextColType.Green) |
| | | { |
| | | ulong cnt = GetMoneyCnt(moneyType); |
| | | long cnt = GetMoneyCnt(moneyType); |
| | | return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}"); |
| | | } |
| | | |
| | | public static string ShowUseItem(PackType type, int itemId, ulong useCnt, TextColType engoughColor = TextColType.Green) |
| | | public static string ShowUseItem(PackType type, int itemId, long useCnt, TextColType engoughColor = TextColType.Green) |
| | | { |
| | | ulong cnt = PackManager.Instance.GetItemCountByID(type, itemId); |
| | | long cnt = PackManager.Instance.GetItemCountByID(type, itemId); |
| | | return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}"); |
| | | } |
| | | |