/// <summary> /// 排行榜玩家模型显示 /// </summary> /// <param name="_info"></param> public PlayerBaseData(pt_req_look_rank_usrinfo_d773 _info) { serverInstanceID = _info.uid; name = _info.name; baseValueDic[ActorBaseTag.Level] = (ulong)_info.lev; prof = _info.prof; //clothesFashionID = _info.model_clothes_id; //Debug.Log("获取排行榜其他玩家信息 " + _info.name + "职业" + _info.prof); equipTypeList.Clear(); for (int i = 0; i < _info.target_equip_list.Count; i++) { equipTypeList.Add((int)_info.target_equip_list[i].type); realEquipmentInfo.Add(new EquipmentInfo(_info.target_equip_list[i], EquipmentBelongTo.PREVIEW)); } if (_info.wing_id > 0) { WingRef data = ConfigMng.Instance.GetWingRef(_info.wing_id, _info.wing_lev); if (data != null) { equipTypeList.Add(data.itemui); } } for (int i = 0, max = _info.model_clothes_id.Count; i < max; i++) { if (_info.model_clothes_id[i] != 0) { equipTypeList.Add(_info.model_clothes_id[i]); } } }
/// <summary> /// 城主 /// </summary> /// <param name="_info"></param> public PlayerBaseData(pt_guild_storm_city_ui_info_d730 _info) { guildName = _info.guild_name; name = _info.castellan; prof = _info.prof; equipTypeList.Clear(); if (_info.wing_id > 0) { WingRef data = ConfigMng.Instance.GetWingRef(_info.wing_id, _info.wing_lev); if (data != null) { equipTypeList.Add(data.itemui); } } if (_info.magic_weapon_id > 0) { RefineRef rr = ConfigMng.Instance.GetRefineRef(_info.magic_weapon_id, _info.magic_strength_lev, _info.magic_strength_star); if (rr != null) { magicWeaponID = rr.model; } } for (int i = 0, max = _info.model_id.Count; i < max; i++) { if (_info.model_id[i] != 0) { equipTypeList.Add(_info.model_id[i]); } } }
public void ShowWingInfo(WingRef _info) { info = _info; if (nameLabel != null) { nameLabel.text = _info.name; } }
public void Update(scene_ply _data) { IsAlive = _data.hp > 0; UpdateName(_data.name); //放在serverData.Update(_data);之前 UpdateGuildName(_data.guildName); //放在serverData.Update(_data);之前 serverData.Update(_data); serverData.equipTypeList.Clear(); //更新移动速度 UpdateMoveSpeed(); //强化特效更新 UpdateStrengEffect(_data.strenthen_min_lev); //坐骑更新 if (curMountInfo == null) { if (_data.ride_type != 0) { curMountInfo = new MountInfo(_data, this); UpdateMount(curMountInfo); } } else { curMountInfo.Update(_data); } //法宝更新 if (_data.magic_weapon_id > 0) { RefineRef rr = ConfigMng.Instance.GetRefineRef(_data.magic_weapon_id, _data.magic_strength_lev, _data.magic_strength_star); if (rr != null) { serverData.magicWeaponID = rr.model; if (GameCenter.systemSettingMng.OtherPlayerMagic) { serverData.equipTypeList.Add(rr.model); } } } //翅膀更新 if (_data.wing_id > 0) { WingRef data = ConfigMng.Instance.GetWingRef(_data.wing_id, _data.wing_lev); if (data != null) { serverData.wingID = data.itemui; if (GameCenter.systemSettingMng.OtherPlayerWing) { serverData.equipTypeList.Add(data.itemui); } } } for (int i = 0, max = _data.model_clothes_id.Count; i < max; i++) { serverData.equipTypeList.Add(_data.model_clothes_id[i]); } ProcessServerData(serverData); }
/// <summary> /// 试用翅膀到期 /// </summary> void ChooseWingGo() { if (GameCenter.wingMng.WingDic.Count != 0) { GameCenter.uIMng.ReleaseGUI(GUIType.TRIALWING); GameCenter.uIMng.SwitchToUI(GUIType.NONE); return; } GameCenter.wingMng.C2S_RequestChangeWing(WingRef.id, false); starGo.SetActive(false); endGo.SetActive(true); using (var info = Dic.GetEnumerator()) { while (info.MoveNext()) { if (nameLabel != null) { nameLabel.text = "[b]" + info.Current.Value.name; } for (int i = 0; i < attriNextLabel.Count; i++) { AttributeTypeRef attributeRef = ConfigMng.Instance.GetAttributeTypeRef((ActorPropertyTag)Enum.ToObject(typeof(ActorPropertyTag), info.Current.Value.property_list[i].eid)); if (attriNextLabel[i] != null) { attriNextLabel[i].text = attributeRef == null ? string.Empty : attributeRef.stats; } if (attriNextNum[i] != null) { attriNextNum[i].text = "+" + info.Current.Value.property_list[i].count.ToString(); } } WingRef wingRef = ConfigMng.Instance.GetWingRef(info.Current.Value.id, ConfigMng.Instance.GetWingMaxLev(info.Current.Value.id)); if (wingRef != null && skillSP != null) { SkillMainConfigRef skillRef = ConfigMng.Instance.GetSkillMainConfigRef(wingRef.passivity_skill.skillid); skillSP.spriteName = skillRef == null ? string.Empty : skillRef.skillIcon; } if (skillDes != null) { skillDes.text = info.Current.Value.not_active_skill; } //if (model != null) //{ // model.configID = wingRef.itemui; // model.lookRotation = 360; // model.StartLoad(); //} if (wingTex != null) { GameCenter.previewManager.TryPreviewSingleEquipment(new EquipmentInfo(wingRef.itemui, EquipmentBelongTo.PREVIEW), wingTex); } return; } } }
/// <summary> /// 查看其他玩家 /// </summary> /// <param name="_info">Info.</param> public PlayerBaseData(pt_look_usr_list_d712 _info) { vipLev = _info.vip_lev; serverInstanceID = _info.uid; name = _info.name; guildName = _info.guild_name; baseValueDic[ActorBaseTag.Level] = (ulong)_info.lev; prof = _info.prof; //clothesFashionID = _info.model_clothes_id; equipTypeList.Clear(); realEquipmentInfo.Clear(); for (int i = 0; i < _info.target_equip_list.Count; i++) { equipTypeList.Add((int)_info.target_equip_list[i].type); //Debug.Log(_info.target_equip_list[i].type+","+_info.target_equip_list[i].lev); realEquipmentInfo.Add(new EquipmentInfo(_info.target_equip_list[i], EquipmentBelongTo.PREVIEW)); } for (int i = 0, max = _info.model_clothes_id.Count; i < max; i++) { if (_info.model_clothes_id[i] != 0) { equipTypeList.Add(_info.model_clothes_id[i]); } } if (_info.wing_id > 0) { WingRef data = ConfigMng.Instance.GetWingRef(_info.wing_id, _info.wing_lev); if (data != null) { equipTypeList.Add(data.itemui); } } for (int i = 0, max = _info.target_property.Count; i < max; i++) { propertyValueDic[(ActorPropertyTag)(int)_info.target_property[i].type] = (int)_info.target_property[i].data; } skillList.Clear(); for (int i = 0, max = _info.target_skill.Count; i < max; i++) { //Debug.Log("skill:"+_info.target_skill[i].skill_id+",lev:"+_info.target_skill[i].skill_lev); skillList.Add(new SkillInfo(_info.target_skill[i])); } //propertyValueDic[ActorPropertyTag.SLA] = _info.slaughter; propertyValueDic[ActorPropertyTag.LUCKY] = _info.luck_num; baseValueDic[ActorBaseTag.FightValue] = (ulong)_info.battle; baseValueDic[ActorBaseTag.SLAVALUE] = (ulong)_info.slaughter; }
public OtherPlayerData(st.net.NetBase.scene_ply _info) { serverInstanceID = (int)_info.pid; name = _info.name; guildName = _info.guildName; baseValueDic[ActorBaseTag.Level] = _info.level; prof = (int)_info.prof; startPosX = _info.x; startPosY = _info.y; startPosZ = _info.z; dir = (int)_info.dir; camp = (int)_info.camp; teamID = (int)_info.team_id; titleID = (int)_info.title; leaderID = (int)_info.team_leader; smallStrenLev = _info.strenthen_min_lev; equipTypeList.Clear(); if (_info.magic_weapon_id > 0) { RefineRef rr = ConfigMng.Instance.GetRefineRef(_info.magic_weapon_id, _info.magic_strength_lev, _info.magic_strength_star); if (rr != null) { magicWeaponID = rr.model; } } if (_info.wing_id > 0) { WingRef data = ConfigMng.Instance.GetWingRef(_info.wing_id, _info.wing_lev); if (data != null) { equipTypeList.Add(data.itemui); } } for (int i = 0, max = _info.model_clothes_id.Count; i < max; i++) { equipTypeList.Add((int)_info.model_clothes_id[i]); } propertyValueDic[ActorPropertyTag.HPLIMIT] = (int)_info.max_hp; propertyValueDic[ActorPropertyTag.MOVESPD] = (int)_info.move_speed; baseValueDic[ActorBaseTag.CurHP] = _info.hp; baseValueDic[ActorBaseTag.FightValue] = _info.fighting; baseValueDic[ActorBaseTag.SLALEVEL] = _info.pk_level; baseValueDic[ActorBaseTag.CounterAttack] = (uint)_info.counter_status; //Debug.Log("_info.move_speed:"+_info.move_speed); }
/// <summary> /// 切换翅膀 /// </summary> void OnChangeToggle(GameObject go) { for (int i = 0; i < listGame.Count; i++) { if (listGame[i] != null && listGame[i].GetComponent <UIToggle>().value) { //刷新激活界面 WingItemUI wingItemUI = listGame[i].GetComponent <WingItemUI>(); WingRef info = null; if (wingItemUI != null) { info = wingItemUI.Info; } if (info != null && WingDicton.ContainsKey(info.id)) { wingActive.SetWingActiveUI(WingDicton[info.id] as WingInfo); if (notActiveGo != null) { notActiveGo.SetActive(false); } if (ActiveGo != null) { ActiveGo.SetActive(true); } curWingInfo = WingDicton[info.id] as WingInfo; RefreshModel(activeWing); } //刷新未激活界面 else if (info != null) { wingNotActive.SetWingNotActiveUI(info); if (notActiveGo != null) { notActiveGo.SetActive(true); } if (ActiveGo != null) { ActiveGo.SetActive(false); } curWingInfo = new WingInfo(info); RefreshModel(notActiveWing); } } } }
/// <summary> /// 淬炼后刷新 /// </summary> void OnWingUpdate() { for (int i = 0; i < listGame.Count; i++) { if (listGame[i] != null && listGame[i].GetComponent <UIToggle>().value) { WingRef info = listGame[i].GetComponent <WingItemUI>().Info; if (info != null && WingDicton.ContainsKey(info.id)) { wingActive.SetWingActiveUI(WingDicton[info.id] as WingInfo); curWingInfo = WingDicton[info.id] as WingInfo; if (GameCenter.wingMng.isRefreshEffect) { GameCenter.wingMng.isRefreshEffect = false; RefreshModel(activeWing); } } } } }
/// <summary> /// 设置翅膀红点 /// </summary> public void SetWingRedPoint() { bool isRedPoint = false; if (wingDic.Count == 0) { WingRef data = ConfigMng.Instance.GetWingRef(1, 1); if (data != null) { WingInfo wingInfo = new WingInfo(data); if (wingInfo.WingActiveEnough) { isRedPoint = true; } else { isRedPoint = false; } } } else { foreach (WingInfo info in wingDic.Values) { if (info.WingConsumeEnough && info.WingLev < ConfigMng.Instance.GetWingMaxLev(info.WingId))//满级不显示红点 { isRedPoint = true; break; } else { isRedPoint = false; } } } GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.FAIRYFEATHER, isRedPoint); }
/// <summary> /// 构造 by吴江 /// </summary> /// <param name="_actorData"></param> public OtherPlayerInfo(st.net.NetBase.scene_ply _info, List <int> _equipList, bool _isInFight) { serverData = new OtherPlayerData(_info); if (_equipList != null && _equipList.Count > 0) { serverData.equipTypeList.AddRange(_equipList); } serverData.isInFight = _isInFight; IsAlive = serverData.baseValueDic.ContainsKey(ActorBaseTag.CurHP)?(serverData.baseValueDic[ActorBaseTag.CurHP] != 0):true; //其他玩家是否死亡和复活 List <int> defaultEquipList = RefData == null?new List <int>():RefData.defaultEquipList; foreach (var item in defaultEquipList) { EquipmentInfo eq = new EquipmentInfo(item, EquipmentBelongTo.EQUIP); if (defaultDictionary.ContainsKey(eq.Slot)) { GameSys.LogError(ConfigMng.Instance.GetUItext(213)); } defaultDictionary[eq.Slot] = eq; } RefineRef rr = ConfigMng.Instance.GetRefineRef(_info.magic_weapon_id, _info.magic_strength_lev, _info.magic_strength_star); if (rr != null) { serverData.magicWeaponID = rr.model; if (serverData.equipTypeList.Contains(serverData.magicWeaponID)) { if (!GameCenter.systemSettingMng.OtherPlayerMagic) { serverData.equipTypeList.Remove(serverData.magicWeaponID); } } else { if (GameCenter.systemSettingMng.OtherPlayerMagic) { serverData.equipTypeList.Add(serverData.magicWeaponID); } } } WingRef data = null; if (_info.wing_id > 0) { data = ConfigMng.Instance.GetWingRef(_info.wing_id, _info.wing_lev); } if (data != null) { serverData.wingID = data.itemui; if (serverData.equipTypeList.Contains(serverData.wingID)) { if (!GameCenter.systemSettingMng.OtherPlayerWing) { serverData.equipTypeList.Remove(serverData.wingID); } } else { if (GameCenter.systemSettingMng.OtherPlayerWing) { serverData.equipTypeList.Add(serverData.wingID); } } } ProcessServerData(serverData); if (_info.ride_type > 0) { curMountInfo = new MountInfo(_info, this); } }
/// <summary> /// 通过静态配置构造 /// </summary> /// <param name="_wingRefData"></param> public WingInfo(WingRef _wingRefData) { wingRefData = _wingRefData; }
/// <summary> /// 刷新自身数据 /// </summary> void RefreshMyData() { myDataOne = GameCenter.newRankingMng.myValue1; myDataTwo = GameCenter.newRankingMng.myValue2; //是否上榜 if (GameCenter.newRankingMng.myRank <= 100 && GameCenter.newRankingMng.myRank != 0 && myRank != null) { myRank.gameObject.SetActive(true); myNoRank.gameObject.SetActive(false); myRank.text = GameCenter.newRankingMng.myRank.ToString(); if (nameLabel != null) { nameLabel.gameObject.SetActive(true); } if (nameLabel != null) { nameLabel.text = GameCenter.mainPlayerMng.MainPlayerInfo.Name; } } else { myRank.gameObject.SetActive(false); myNoRank.gameObject.SetActive(true); if (nameLabel != null) { nameLabel.gameObject.SetActive(false); } } if (myDataLabel != null) { guildLabel.gameObject.SetActive(false); myDataLabel.gameObject.SetActive(true); switch (rankType - 1) { case 0: myDataLabel.text = myDataOne.ToString(); break; case 1: myDataLabel.text = ConfigMng.Instance.GetLevelDes(myDataOne); break; case 2: if (myDataOne != 0) { myDataLabel.text = myDataOne.ToString(); } else { myDataLabel.gameObject.SetActive(false); } break; case 3: if (myDataOne != 0) { RidePropertyRef rideRef = ConfigMng.Instance.GetMountPropertyRef(myDataOne); myDataLabel.text = rideRef == null ? string.Empty : rideRef.name; } else { myDataLabel.gameObject.SetActive(false); } break; case 4: if (myDataOne != 0) { CheckPointRef chapRef = ConfigMng.Instance.GetCheckPointRef(myDataOne); myDataLabel.text = chapRef == null ? string.Empty : chapRef.name; } else { myDataLabel.gameObject.SetActive(false); } break; case 5: if (nameLabel != null) { nameLabel.text = GameCenter.mainPlayerMng.MainPlayerInfo.GuildName; } if (myDataOne != 0 && myDataTwo != 0) { myDataLabel.gameObject.SetActive(false); guildLabel.gameObject.SetActive(true); guildLabel.text = myDataOne + " " + myDataTwo; } else { guildLabel.gameObject.SetActive(false); myDataLabel.gameObject.SetActive(false); } break; case 6: if (myDataOne != 0) { WingRef wingRef = ConfigMng.Instance.GetWingRef(myDataOne, myDataTwo); myDataLabel.text = wingRef == null ? string.Empty : wingRef.name; } else { myDataLabel.gameObject.SetActive(false); } break; default: if (myDataOne != 0) { myDataLabel.text = myDataOne.ToString(); } else { myDataLabel.gameObject.SetActive(false); } break; } } }
/// <summary> /// 激活按钮 /// </summary> void OnClickActiveBtn() { EquipmentRef equipRef = ConfigMng.Instance.GetEquipmentRef(data.condition_2[0]); if (equipRef != null) { consumePrice = (int)equipRef.diamonPrice * data.condition_2[1]; } //前置翅膀没有激活 if (!GameCenter.wingMng.WingDic.ContainsKey(data.id - 1) && data.id - 1 >= 1) { // 提示前置翅膀等级不足 MessageST mst = new MessageST(); mst.messID = 218; WingRef lastWingRef = ConfigMng.Instance.GetWingRef(data.id - 1, 1); mst.words = new string[1] { lastWingRef == null ? string.Empty : lastWingRef.name }; GameCenter.messageMng.AddClientMsg(mst); } //前置翅膀激活,没有达到15级 else if (GameCenter.wingMng.WingDic.ContainsKey(data.id - 1) && (GameCenter.wingMng.WingDic[data.id - 1] as WingInfo).WingLev < data.condition_1[1]) { // 提示前置翅膀等级不足 MessageST mst = new MessageST(); mst.messID = 218; WingRef lastWingRef = ConfigMng.Instance.GetWingRef(data.id - 1, 1); mst.words = new string[1] { lastWingRef == null ? string.Empty : lastWingRef.name }; GameCenter.messageMng.AddClientMsg(mst); } else if (data.condition_2.Count != 0 && GameCenter.inventoryMng.GetNumberByType(data.condition_2[0]) < data.condition_2[1]) { //提示材料不足!!! MessageST mst = new MessageST(); mst.messID = 217; //是否花费多少元宝?购买多少个?什么? mst.words = new string[3] { (ConfigMng.Instance.GetEquipmentRef(data.condition_2[0]).diamonPrice *data.condition_2[1]).ToString(), data.condition_2[1].ToString(), ConfigMng.Instance.GetEquipmentRef(data.condition_2[0]).name }; mst.delYes = delegate { if (GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount < consumePrice) { MessageST message = new MessageST(); message.messID = 210; message.delYes = delegate { // 充值界面 GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE); }; GameCenter.messageMng.AddClientMsg(message); } else { GameCenter.wingMng.C2S_RequestUpLev(WingState.ACTIVEWING, data.id, true); } }; GameCenter.messageMng.AddClientMsg(mst); } else { GameCenter.wingMng.C2S_RequestUpLev(WingState.ACTIVEWING, data.id, false); } }
public void SetWingNotActiveUI(WingRef _info) { data = _info; if (desNameLabel != null) { desNameLabel.text = _info.name; } if (attribuDes != null) { attribuDes.text = _info.des; } if (skillLabel != null) { skillLabel.text = _info.skill_des; } if (skillDes != null) { skillDes.text = _info.not_active_skill; } //技能图片 WingRef wingRef = ConfigMng.Instance.GetWingRef(_info.id, ConfigMng.Instance.GetWingMaxLev(_info.id)); int skillId = 0; if (wingRef != null) { skillId = wingRef.passivity_skill.skillid; } SkillMainConfigRef skillRef = ConfigMng.Instance.GetSkillMainConfigRef(skillId); if (skillIcon != null) { skillIcon.spriteName = skillRef == null ? string.Empty : skillRef.skillIcon; skillIcon.IsGray = UISpriteEx.ColorGray.Gray; } //消耗 第一个翅膀的开启条件不同只需消耗材料 if (_info.id == 1) { if (ConfigMng.Instance.GetEquipmentRef(_info.condition_2[0]) != null) { string[] name = new string[2] { GameHelper.GetStringWithBagNumber(_info.condition_2[0], (ulong)_info.condition_2[1]), string.Empty }; if (conditionLabel[0] != null) { conditionLabel[0].text = ConfigMng.Instance.GetUItext(6, name); } if (conditionLabel[1] != null) { conditionLabel[1].gameObject.SetActive(false); } } } else { if (conditionLabel[1] != null) { conditionLabel[1].gameObject.SetActive(true); } if (ConfigMng.Instance.GetWingRef(_info.condition_1[0], 1) != null) { string[] name = new string[2] { ConfigMng.Instance.GetWingRef(_info.condition_1[0], 1).name, _info.condition_1[1].ToString() }; if (conditionLabel[0] != null) { conditionLabel[0].text = ConfigMng.Instance.GetUItext(7, name); } } if (ConfigMng.Instance.GetEquipmentRef(_info.condition_2[0]) != null) { string[] conname = new string[2] { GameHelper.GetStringWithBagNumber(_info.condition_2[0], (ulong)_info.condition_2[1]), string.Empty }; if (conditionLabel[1] != null) { conditionLabel[1].text = ConfigMng.Instance.GetUItext(8, conname); } } } }
public WingRefEty(WingRef info) { id = info.id; lev = info.lev; wingRefList.Add(info); }