| | |
| | | }
|
| | | }
|
| | |
|
| | | public static void GodWeaponStage(int _type, int _level, int _beforeLevel)
|
| | | {
|
| | | activateType = ActivateFunc.GodWeaponEffect;
|
| | | currentLv = _level;
|
| | | godWeaponType = _type;
|
| | | beforeLv = _beforeLevel;
|
| | | skills.Clear();
|
| | | propertyCompares.Clear();
|
| | | lastPropertyDict.Clear();
|
| | | currentPropertyDict.Clear();
|
| | |
|
| | | var _model = ModelCenter.Instance.GetModel<MagicianModel>();
|
| | | if (_model.godWeaponSkillDict.ContainsKey(_type))
|
| | | {
|
| | | var _dict = _model.godWeaponSkillDict[_type];
|
| | | var _skillid = 0;
|
| | | if (beforeLv == 0)
|
| | | {
|
| | | foreach (var _key in _dict.Keys)
|
| | | {
|
| | | skills.Add(_dict[_key]);
|
| | | }
|
| | | }
|
| | | else if (_model.TryGetUnlockSkill(godWeaponType, beforeLv, _level, out _skillid))
|
| | | {
|
| | | skills.Add(_skillid);
|
| | | }
|
| | | }
|
| | |
|
| | | var _beforeConfig = GodWeaponConfig.GetConfig(_type, beforeLv);
|
| | | if (_beforeConfig != null)
|
| | | {
|
| | | for (int i = 0; i < _beforeConfig.AttrType.Length; i++)
|
| | | {
|
| | | lastPropertyDict.Add(_beforeConfig.AttrType[i], _beforeConfig.AttrNum[i]);
|
| | | }
|
| | | }
|
| | | var config = GodWeaponConfig.GetConfig(_type, currentLv);
|
| | | for (int i = 0; i < config.AttrType.Length; i++)
|
| | | {
|
| | | currentPropertyDict.Add(config.AttrType[i], config.AttrNum[i]);
|
| | | }
|
| | |
|
| | | fightPower = UIHelper.GetFightPower(currentPropertyDict) - UIHelper.GetFightPower(lastPropertyDict);
|
| | | if (beforeLv != 0)
|
| | | {
|
| | | for (int i = 0; i < skills.Count; i++)
|
| | | {
|
| | | var skillConfig = Config.Instance.Get<SkillConfig>(skills[i]);
|
| | | fightPower += skillConfig.FightPower;
|
| | | }
|
| | | }
|
| | |
|
| | | titleIconKey = "GodWeaponEffectTitle";
|
| | |
|
| | | if (!WindowCenter.Instance.IsOpen<RealmPropertyUpWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<RealmPropertyUpWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | public static void StoveUpgrade(int stoveLv)
|
| | | {
|
| | | activateType = ActivateFunc.Stove;
|
| | |
| | | GodWeapon,
|
| | | Stove, //炼丹炉升级
|
| | | TreasureSoul,//法宝魂领取属性
|
| | | GodWeaponEffect,
|
| | | }
|
| | |
|
| | | public struct PropertyCompare
|
| | |
| | | [SerializeField] Image m_PresentRealmIcon;
|
| | | [SerializeField] Image m_NextRealmIcon;
|
| | | [SerializeField] Text m_RealmActivity;
|
| | | [SerializeField] RectTransform m_ContainerGodWeaponEffect;
|
| | | [SerializeField] Text m_GodWeaponStage;
|
| | | [SerializeField] Text m_CloseTip;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerNewGotFly;
|
| | |
| | | m_ContainerNewGotSkill.gameObject.SetActive(false);
|
| | | m_ContainerRealm.gameObject.SetActive(false);
|
| | | m_ContainerTreasureSoul.gameObject.SetActive(false);
|
| | | m_ContainerGodWeaponEffect.gameObject.SetActive(false);
|
| | | m_DisplayAlphaTween.SetStartState();
|
| | | flying = false;
|
| | | startFly = false;
|
| | |
| | | DisplayTreasureSoul();
|
| | | DisplayFightPower();
|
| | | DisplayProperty();
|
| | | break;
|
| | | case ActivateShow.ActivateFunc.GodWeaponEffect:
|
| | | DisplayFightPower();
|
| | | DisplayLv();
|
| | | DisplayGodWeaponEffect();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | switch (ActivateShow.activateType)
|
| | | {
|
| | | case ActivateShow.ActivateFunc.Realm:
|
| | | case ActivateShow.ActivateFunc.GodWeaponEffect:
|
| | | m_ModelRawImage.gameObject.SetActive(true);
|
| | | m_ModelRawImage.rectTransform.sizeDelta = new Vector2(680, 510);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(m_ModelRawImage, PlayerDatas.Instance.baseData.Job, RoleEquipType.retWing);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | void DisplayGodWeaponEffect()
|
| | | {
|
| | | m_ContainerGodWeaponEffect.gameObject.SetActive(true);
|
| | | var model = ModelCenter.Instance.GetModel<MagicianModel>();
|
| | | var config = GodWeaponConfig.GetConfig(ActivateShow.godWeaponType, 1);
|
| | | var stage = model.GetGodWeaponStage(ActivateShow.godWeaponType);
|
| | | m_GodWeaponStage.text = Language.Get("MagicWin_9", config.Name, stage);
|
| | | }
|
| | |
|
| | | void PrepareFly(int _skillId)
|
| | | {
|
| | | ActivateShow.PrepareSkillFly();
|
| | |
| | | var maxLevel = configs[configs.Count - 1].Lv;
|
| | | m_NumKeyBoard.max = (uint)maxLevel;
|
| | | minLevel = godWeaponInfo.level + 1;
|
| | | targetLevel = minLevel;
|
| | | GetTargetLevel(minLevel);
|
| | | }
|
| | | m_NumKeyBoard.gameObject.SetActive(false);
|
| | | DisplayLevel();
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | private void GetTargetLevel(int level)
|
| | | {
|
| | | Dictionary<int, int> skillDict = null;
|
| | | var minLevel = level;
|
| | | if (model.TryGetGodWeaponSkills(selectGodWeaponType, out skillDict))
|
| | | {
|
| | | foreach (var key in skillDict.Keys)
|
| | | {
|
| | | if (key >= level)
|
| | | {
|
| | | minLevel = key;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | List<int> stages = null;
|
| | | if (model.TryGetGodWeaponStages(selectGodWeaponType, out stages))
|
| | | {
|
| | | foreach (var value in stages)
|
| | | {
|
| | | if (value >= level && value <= minLevel)
|
| | | {
|
| | | minLevel = value;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | targetLevel = minLevel;
|
| | | }
|
| | |
|
| | | private void DisplayLevel()
|
| | | {
|
| | | GodWeaponInfo godWeaponInfo = model.GetGodWeaponInfo(selectGodWeaponType);
|
| | |
| | | GodWeaponInfo godWeaponInfo = GetGodWeaponInfo(data.WeaponType);
|
| | | if (godWeaponInfo != null)
|
| | | {
|
| | | CheckActivate(godWeaponInfo.type, godWeaponInfo.level, data.WeaponLV);
|
| | | var beforeLevel = godWeaponInfo.level;
|
| | | godWeaponInfo.exp = data.WeaponExp;
|
| | | godWeaponInfo.level = data.WeaponLV;
|
| | | CheckActivate(godWeaponInfo.type, beforeLevel, data.WeaponLV);
|
| | | }
|
| | | }
|
| | | UpdateRedPoint();
|
| | |
| | |
|
| | | void CheckActivate(int _type, int _beforeLv, int _nowLv)
|
| | | {
|
| | | if (serverInited)
|
| | | {
|
| | | var stage = 0;
|
| | | if (_beforeLv != _nowLv && TryGetUnlockStage(_type, _beforeLv, _nowLv, out stage))
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<MagicianWin>()
|
| | | && !NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<GodWeaponPreviewWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<GodWeaponPreviewWin>();
|
| | | }
|
| | | ActivateShow.GodWeaponStage(_type, _nowLv, _beforeLv);
|
| | | }
|
| | | return;
|
| | | }
|
| | | }
|
| | | var _skillId = 0;
|
| | | if (serverInited && _beforeLv != _nowLv
|
| | | && (_beforeLv == 0 || TryGetUnlockSkill(_type, _beforeLv, _nowLv, out _skillId)))
|
| | |
| | | ActivateShow.GodWeaponActivate(_type, _nowLv, _beforeLv);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetUnlockStage(int _type, int _beforeLv, int _nowLv, out int stage)
|
| | | {
|
| | | stage = 0;
|
| | | List<int> stages = null;
|
| | | if (TryGetGodWeaponStages(_type, out stages))
|
| | | {
|
| | | var beforeStage = 0;
|
| | | for (int i = 0; i < stages.Count; i++)
|
| | | {
|
| | | if (stages[i] <= _beforeLv)
|
| | | {
|
| | | beforeStage = i + 1;
|
| | | }
|
| | | }
|
| | | for (int i = 0; i < stages.Count; i++)
|
| | | {
|
| | | if (stages[i] <= _nowLv)
|
| | | {
|
| | | stage = i + 1;
|
| | | }
|
| | | }
|
| | | return stage > beforeStage;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetUnlockSkill(int _type, int _beforeLv, int _nowLv,out int _skillid)
|
| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | public bool TryGetGodWeaponStages(int type, out List<int> stages)
|
| | | {
|
| | | return godWeaponStageDict.TryGetValue(type, out stages);
|
| | | }
|
| | |
|
| | | public bool IsGodWeaponMaxLevelByItem(int _itemId)
|
| | | {
|
| | | foreach (var _key in godWeaponLevelUpCost.Keys)
|
| | |
| | | if (m_LastAutoHammerState != AutoHammerState.None)
|
| | | {
|
| | | DisplayExp(true);
|
| | | if (moneyHammer)
|
| | | {
|
| | | ScrollTip.Close();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (OnTipReceiveEvent != null) OnTipReceiveEvent();
|
| | | }
|
| | |
|
| | | public static void Close()
|
| | | {
|
| | | m_Hints.Clear();
|
| | | }
|
| | |
|
| | | public enum ScrollTipState
|
| | | {
|
| | | None,
|