Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | jobNameText.text = OccupationNameConfig.GetOccupationName(playerInfo.Job,1);
|
| | | goldHelpText.text = assistModel.goldAssistPlayer.ToString();
|
| | | UpdateAssistReward();
|
| | | UpdateRelation();
|
| | | int nirvanaLv = playerInfo.LV - friendsModel.OpenGreatLV;
|
| | | lvIcon.gameObject.SetActive(nirvanaLv > 0);
|
| | | if (nirvanaLv > 0)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateRelation()
|
| | | {
|
| | | if (playerInfo == null) return;
|
| | |
|
| | | relationImg.gameObject.SetActive(playerInfo.relatedToPlayer != DungeonAssistModel.RelatedToPlayer.None);
|
| | | switch (playerInfo.relatedToPlayer)
|
| | | {
|
| | | case DungeonAssistModel.RelatedToPlayer.Friend:
|
| | | relationImg.SetSprite("XT_FBZZ_04");
|
| | | break;
|
| | | case DungeonAssistModel.RelatedToPlayer.Ally:
|
| | | relationImg.SetSprite("XT_FBZZ_05");
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void ClickHelp()
|
| | | {
|
| | | if (playerInfo == null) return;
|
| | |
| | | int playerId = (int)PlayerDatas.Instance.baseData.PlayerID;
|
| | | helpInfoLocalSave = StringUtility.Contact("HelpInfoLocalSave", playerId);
|
| | | GetLocalSaveData();
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | {
|
| | | var ratio = (float)addRatio / 100;
|
| | | addRatioStr = StringUtility.Contact(ratio, "%");
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetCurVipAddCoins(out int addCoins)
|
| | | {
|
| | | addCoins = 0;
|
| | | int vipLv = PlayerDatas.Instance.baseData.VIPLv;
|
| | | var vipDict = VipPrivilegeConfig.GetVipPrivilegeDic(VipPrivilegeType.AssistXianYuanCoinsAdd);
|
| | | if (vipDict == null || vipLv < 1) return false;
|
| | | List<int> vipLvlist = vipDict.Keys.ToList();
|
| | | vipLvlist.Sort();
|
| | | for (int i = vipLvlist.Count - 1; i > -1; i--)
|
| | | {
|
| | | var lv = vipLvlist[i];
|
| | | var coins = vipDict[lv];
|
| | | if (vipLv >= lv && coins > 0)
|
| | | {
|
| | | addCoins = coins;
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
| | | helpInfolist = helpInfolist == null ? new List<string>() : helpInfolist;
|
| | | if (helpInfolist.Count >= 20)
|
| | | {
|
| | | helpInfolist.RemoveAt(0);
|
| | | helpInfolist.RemoveAt(helpInfolist.Count - 1);
|
| | | }
|
| | | info = StringUtility.Contact(createDate,"|",info, "|", isNew);
|
| | | helpInfolist.Add(info);
|
| | | helpInfolist.Insert(0,info);
|
| | | LocalSave.SetStringArray(helpInfoLocalSave, helpInfolist.ToArray());
|
| | | if(UpdateResultEvent != null)
|
| | | {
|
| | |
| | | public void UpdateAssistList(HB207_tagMCHelpBattleList battleList)
|
| | | {
|
| | | assistPlayerDict.Clear();
|
| | | List<AssistPlayerInfo> playerInfos = new List<AssistPlayerInfo>();
|
| | | assistRefreshNum = battleList.RefreshCount;
|
| | | for(int i = 0; i < battleList.HelpCount; i++)
|
| | | {
|
| | | var info = battleList.HelpPlayerList[i];
|
| | | AssistPlayerInfo playerInfo = new AssistPlayerInfo(info);
|
| | | assistPlayerDict.Add(playerInfo.PlayerID,playerInfo);
|
| | | playerInfos.Add(playerInfo);
|
| | | |
| | | }
|
| | | playerInfos.Sort(CompareByFightPower);
|
| | | for(int i = 0; i < playerInfos.Count; i++)
|
| | | {
|
| | | var playerInfo = playerInfos[i];
|
| | | assistPlayerDict.Add(playerInfo.PlayerID, playerInfo);
|
| | | }
|
| | |
|
| | | if(UpdataAssistPlayerListEvent != null)
|
| | |
| | | {
|
| | | WindowCenter.Instance.Open<DungeonAssistPlayerWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | public int CompareByFightPower(AssistPlayerInfo start,AssistPlayerInfo end)
|
| | | {
|
| | | int x = start.FightPower;
|
| | | int y = end.FightPower;
|
| | | if (x.CompareTo(y) != 0) return -x.CompareTo(y);
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public event Action<int> UpdataAssistPlayerEvent;
|
| | |
| | | {
|
| | | UpdateCheckInResultEvent();
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | | private List<AssistResult> assistResults = new List<AssistResult>();
|
| | | public void UpdateAssistResultNotify(HB211_tagMCHelpBattleRecordList recordList)
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region 红点
|
| | | public const int AssistCheckInRedPoint = 7800001;
|
| | | public Redpoint checkInRedpoint = new Redpoint(AssistCheckInRedPoint);
|
| | | public void UpdateRedpoint()
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.DayDaily)) return;
|
| | |
|
| | | if(IsCheckInOk)
|
| | | {
|
| | | checkInRedpoint.state = RedPointState.None;
|
| | | }
|
| | | else
|
| | | {
|
| | | checkInRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public class AssistResult
|
| | | {
|
| | | public int assistType; // 1 真实的自己 2 自己的镜像
|
| | |
| | |
|
| | | private void UpdateXianYuanCoins()
|
| | | {
|
| | | dayScoreText.text = StringUtility.Contact(PlayerDatas.Instance.baseData.ExAttr11,"/",assistModel.maxXianYuanCoins);
|
| | | int addCoins = 0;
|
| | | assistModel.TryGetCurVipAddCoins(out addCoins);
|
| | | int limitCoins = assistModel.maxXianYuanCoins + addCoins;
|
| | | dayScoreText.text = StringUtility.Contact(PlayerDatas.Instance.baseData.ExAttr11,"/",limitCoins);
|
| | | }
|
| | |
|
| | | private void UpdateVipAddCoins()
|
| | |
| | | m_RealmIconNext.Display(_realmLv);
|
| | | var fightPower = PlayerDatas.Instance.baseData.FightPoint;
|
| | |
|
| | | var presentConfig = Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | if (presentConfig != null && presentConfig.IsBigRealm == 1)
|
| | | {
|
| | | m_FightPower.text = Language.Get("RealmRecommendTip", UIHelper.ReplaceLargeNum(config.FightPower));
|
| | | }
|
| | | else
|
| | | {
|
| | | m_FightPower.text = StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Green, Language.Get("RolePromoteBetterFight")),
|
| | | UIHelper.AppendStringColor(fightPower >= config.FightPower ? TextColType.Green : TextColType.Red, fightPower.ToString())
|
| | | , "/", config.FightPower);
|
| | | }
|
| | | m_FightPower.text = StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Green, Language.Get("RolePromoteBetterFight")),
|
| | | UIHelper.AppendStringColor(fightPower >= config.FightPower ? TextColType.Green : TextColType.Red, fightPower.ToString())
|
| | | , "/", config.FightPower);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | private void GetTargetLevel(int level)
|
| | | {
|
| | | Dictionary<int, int> skillDict = null;
|
| | | var minLevel = level;
|
| | | var minLevel = 0;
|
| | | if (model.TryGetGodWeaponSkills(selectGodWeaponType, out skillDict))
|
| | | {
|
| | | foreach (var key in skillDict.Keys)
|
| | |
| | | {
|
| | | foreach (var value in stages)
|
| | | {
|
| | | if (value >= level && value <= minLevel)
|
| | | if (value >= level)
|
| | | {
|
| | | minLevel = value;
|
| | | if (minLevel == 0 || value <= minLevel)
|
| | | {
|
| | | minLevel = value;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | targetLevel = minLevel;
|
| | | targetLevel = Mathf.Max(level, minLevel);
|
| | | }
|
| | |
|
| | | private void DisplayLevel()
|
| | |
| | | Dictionary<int, List<int>> godWeaponStageDict = new Dictionary<int, List<int>>();
|
| | | Dictionary<int, int> exteriorPowerDict = new Dictionary<int, int>();
|
| | | Dictionary<int, int> godWeaponSkillEffect = new Dictionary<int, int>();
|
| | | Dictionary<int, int> singleHarmmerExp = new Dictionary<int, int>();
|
| | | int[] autoHammerExpArea { get; set; }
|
| | | int[] autoHammerCount { get; set; }
|
| | |
|
| | |
| | | {
|
| | | autoHammerExpArea = ConfigParse.GetMultipleStr<int>(autoHammerConfig.Numerical1);
|
| | | autoHammerCount = ConfigParse.GetMultipleStr<int>(autoHammerConfig.Numerical2);
|
| | | singleHarmmerExp = ConfigParse.GetDic<int, int>(autoHammerConfig.Numerical3);
|
| | | }
|
| | |
|
| | | var funcConfig = Config.Instance.Get<FuncConfigConfig>("GodMagicExp");
|
| | |
| | | index = i;
|
| | | break;
|
| | | }
|
| | | else
|
| | | {
|
| | | index++;
|
| | | }
|
| | | }
|
| | | if (index < autoHammerCount.Length)
|
| | | {
|
| | |
| | | {
|
| | | totalExp = moneyCount * autoHammerCost.exp;
|
| | | }
|
| | | else if (singleHarmmerExp.ContainsKey(type))
|
| | | {
|
| | | totalExp = moneyCount * singleHarmmerExp[type];
|
| | | }
|
| | | var itemId = items[index];
|
| | | var itemConfig = Config.Instance.Get<ItemConfig>(itemId);
|
| | | var expCount = Mathf.CeilToInt((float)totalExp / itemConfig.EffectValueA1);
|
| | |
| | | m_Hammer.gameObject.SetActive((active || model.SatisfyUnlockCondition(model.selectType)) && !maxLevel);
|
| | | m_AutoHammer.gameObject.SetActive(active && !maxLevel);
|
| | | m_HammerRedpoint.gameObject.SetActive(model.GetRedpointLightByType(model.selectType));
|
| | |
|
| | | List<int> stages = null;
|
| | | var requirePreview = model.TryGetGodWeaponStages(model.selectType, out stages);
|
| | | m_Preview.gameObject.SetActive(requirePreview);
|
| | |
|
| | | if (!active)
|
| | | {
|
| | | m_CostItemTitle.text = Language.Get("L1049");
|
| | |
| | | if (config != null)
|
| | | {
|
| | | m_PropertyName.text = config.Name;
|
| | | m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage)),
|
| | | m_PropertyValue.text = StringUtility.Contact(
|
| | | UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
| | | config.ISPercentage == 1 ? "%" : string.Empty);
|
| | | }
|
| | | }
|
| | |
| | | if (config != null)
|
| | | {
|
| | | m_PropertyName.text = config.Name;
|
| | | m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage)),
|
| | | m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(
|
| | | UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
| | | config.ISPercentage == 1 ? "%" : string.Empty);
|
| | | }
|
| | | }
|
| | |
| | | if (config != null)
|
| | | {
|
| | | m_PropertyName.text = StringUtility.Contact(config.Name, ":");
|
| | | m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage)),
|
| | | m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(
|
| | | UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
| | | config.ISPercentage == 1 ? "%" : string.Empty);
|
| | | }
|
| | | }
|
| | |
| | | if (config != null)
|
| | | {
|
| | | m_PropertyName.text = StringUtility.Contact(config.Name, ":");
|
| | | m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage)),
|
| | | m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(
|
| | | UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
| | | config.ISPercentage == 1 ? "%" : string.Empty);
|
| | | if (_add == 0)
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | m_PropertyAdd.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_add, config.ISPercentage)),
|
| | | m_PropertyAdd.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(
|
| | | UIHelper.ReplacePercentage(_add, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
| | | config.ISPercentage == 1 ? "%" : string.Empty);
|
| | | }
|
| | | }
|
| | |
| | | if (config != null)
|
| | | {
|
| | | m_PropertyName.text = config.Name;
|
| | | m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage)),
|
| | | m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(
|
| | | UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
| | | config.ISPercentage == 1 ? "%" : string.Empty);
|
| | | m_PropertyAdd.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_add, config.ISPercentage)),
|
| | | m_PropertyAdd.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(
|
| | | UIHelper.ReplacePercentage(_add, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
| | | config.ISPercentage == 1 ? "%" : string.Empty);
|
| | | }
|
| | | }
|
| | |
| | | switch (key)
|
| | | {
|
| | | case 1:
|
| | | if (clothesModel != null)
|
| | | if (secondaryModel != null)
|
| | | {
|
| | | bone = clothesModel.transform.GetChildTransformDeeply("Bip001 Spine");
|
| | | bone = secondaryModel.transform;
|
| | | }
|
| | | break;
|
| | | case 2:
|
| | | if (weaponModel != null)
|
| | | {
|
| | | bone = weaponModel.transform;
|
| | | }
|
| | | break;
|
| | | case 3:
|
| | | if (secondaryModel != null)
|
| | | {
|
| | | bone = secondaryModel.transform;
|
| | | }
|
| | | break;
|
| | | case 4:
|
| | |
| | | return _textBuilder.ToString();
|
| | | }
|
| | |
|
| | | public static float ReplacePercentage(float num, int isPer)
|
| | | public static float ReplacePercentage(float num, int isPer, int decimals = 1)
|
| | | {
|
| | | if (isPer == 1 || isPer == 2)
|
| | | {
|
| | | return (float)Math.Round(num / 100, 1);
|
| | | return (float)Math.Round(num / 100, decimals);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static int GetPropertyDecimalCount(int property)
|
| | | {
|
| | | switch (property)
|
| | | {
|
| | | case 73:
|
| | | return 2;
|
| | | default:
|
| | | return 1;
|
| | | }
|
| | | }
|
| | |
|
| | | private const string SPECIAL_CHA = " ()()@!#$%^&*[]|_";
|
| | | public static bool HasSpecialCharac(string str)
|
| | | {
|