void OnRankSlotdelegate(int arr, GameObject go)
    {
        if (RankList.Count <= arr)
        {
            go.SetActive(false);
            return;
        }

        go.SetActive(true);

        Character.CharacterInfo charInfo = _LowDataMgr.instance.GetCharcterData((uint)RankList[arr].Type);
        Transform tf = go.transform;

        //   tf.FindChild("guild_name").GetComponent<UILabel>().text = RankList[arr].GuildName;
        tf.FindChild("name").GetComponent <UILabel>().text = string.Format("{0} {1}", _LowDataMgr.instance.GetStringCommon(155), RankList[arr].Name);
        // tf.FindChild("rank").GetComponent<UILabel>().text = string.Format("{0} {1}", _LowDataMgr.instance.GetStringCommon(1020), RankList[arr].Rank);
        //tf.FindChild("class").GetComponent<UISprite>().spriteName = UIHelper.GetClassIcon((uint)RankList[arr].Type);
        tf.FindChild("face").GetComponent <UISprite>().spriteName = charInfo.PortraitId;
        tf.FindChild("battle").GetComponent <UILabel>().text      = string.Format("{0} {1:#,#}", _LowDataMgr.instance.GetStringCommon(47), RankList[arr].Attack);


        //랭킹 1,2,3등은 명칭이다름
        GameObject one   = tf.FindChild("1").gameObject;
        GameObject two   = tf.FindChild("2").gameObject;
        GameObject three = tf.FindChild("3").gameObject;
        GameObject other = tf.FindChild("0").gameObject;

        one.SetActive(false);
        two.SetActive(false);
        three.SetActive(false);
        other.SetActive(false);

        if (RankList[arr].Rank == 1)
        {
            one.SetActive(true);
        }
        else if (RankList[arr].Rank == 2)
        {
            two.SetActive(true);
        }
        else if (RankList[arr].Rank == 3)
        {
            three.SetActive(true);
        }
        else
        {
            other.transform.FindChild("Txt_ranking").GetComponent <UILabel>().text = string.Format(_LowDataMgr.instance.GetStringCommon(522), RankList[arr].Rank);
            other.SetActive(true);
        }


        EventDelegate.Set(tf.FindChild("info").GetComponent <UIEventTrigger>().onClick, delegate()
        {
            //정보보기
            ulong uu = (ulong)RankList[arr].RoleId;
            UIMgr.OpenUserInfoPopup(/*(long)RankList[arr].RoleId*/ (long)uu, RankList[arr].Name, RankList[arr].Type, RankList[arr].VipLevel, RankList[arr].Level, true);
        });
    }
    //길드관리뷰
    public void SetAddminView(uint a, List <NetData.ApplyRoleInfo> applyList)
    {
        isFreeJoinSet          = MyGuildSimpleInfo.JoinSet == 2; //1이자유가입 아마
        BtnFreeJoin.isEnabled  = !isFreeJoinSet;
        BtnJudgeJoin.isEnabled = isFreeJoinSet;

        GuildJoinLv         = (int)MyGuildSimpleInfo.JoinLevel;
        GuildJoinLevel.text = GuildJoinLv.ToString();//GuildJoinLv.ToString();

        ApplyList = applyList;
        AdminListEmpty.SetActive(applyList.Count == 0);
        for (int i = 0; i < AdminGrid.transform.childCount; i++)
        {
            if (i >= ApplyList.Count)
            {
                AdminGrid.transform.GetChild(i).gameObject.SetActive(false);
                continue;
            }

            GameObject slotGo = AdminGrid.transform.GetChild(i).gameObject;
            Transform  slotTf = slotGo.transform;
            slotGo.SetActive(true);

            NetData.ApplyRoleInfo rcvData = ApplyList[i];

            UILabel name = slotTf.FindChild("name").GetComponent <UILabel>();
            name.text = rcvData.Name;

            UILabel lv = slotTf.FindChild("level").GetComponent <UILabel>();
            lv.text = rcvData.Lv.ToString();

            UILabel Attack = slotTf.FindChild("strength").GetComponent <UILabel>();
            Attack.text = rcvData.Power.ToString();

            UISprite Faces = slotGo.transform.FindChild("Face").GetComponent <UISprite>();
            Character.CharacterInfo charLowData = _LowDataMgr.instance.GetCharcterData(rcvData.Type);
            Faces.spriteName = charLowData.PortraitId;

            //승인
            UIEventTrigger ok = slotGo.transform.FindChild("btn_ok").GetComponent <UIEventTrigger>();
            EventDelegate.Set(ok.onClick, delegate()
            {
                NetworkClient.instance.SendPMsgGuildExamineApplicantC(MyGuildId, rcvData.Id, 1);
            });
            //거절
            UIEventTrigger no = slotGo.transform.FindChild("btn_cancel").GetComponent <UIEventTrigger>();
            EventDelegate.Set(no.onClick, delegate()
            {
                NetworkClient.instance.SendPMsgGuildExamineApplicantC(MyGuildId, rcvData.Id, 2);
            });
        }
        AdminGrid.Reposition();
        AdminSroll.enabled = ApplyList.Count > 4;

        Alram.SetActive(SceneManager.instance.IsAlram((AlramIconType.GUILD)));
    }
Esempio n. 3
0
    /// <summary> 랭킹 정보 </summary>
    public void OnPMsgTowerRankQuerySHandler(List <NetData.TowerRankData> rankList)
    {
        ulong playerCharIdx = NetData.instance.GetUserInfo().GetCharUUID();
        int   playerRank    = 0;
        int   childCount    = RankGrid.transform.childCount;

        for (int i = 0; i < childCount; i++)
        {
            Transform slotTf = RankGrid.transform.GetChild(i);
            if (rankList.Count <= i)
            {
                slotTf.gameObject.SetActive(false);
                continue;
            }

            slotTf.gameObject.SetActive(true);
            UILabel  nickName  = slotTf.FindChild("name").GetComponent <UILabel>();
            UILabel  clearTime = slotTf.FindChild("clearTime").GetComponent <UILabel>();
            UILabel  rankNum   = slotTf.FindChild("num").GetComponent <UILabel>();
            UISprite face      = slotTf.FindChild("Face/icon").GetComponent <UISprite>();

            NetData.TowerRankData data = rankList[i];
            float m = Mathf.Floor(data.Seconds / 60);
            float s = Mathf.Floor(data.Seconds % 60);

            rankNum.text   = string.Format("{0}", data.RankNumber);
            nickName.text  = data.Name;
            clearTime.text = string.Format(_LowDataMgr.instance.GetStringCommon(214), m.ToString("00"), s.ToString("00"));

            Character.CharacterInfo charLowDatga = _LowDataMgr.instance.GetCharcterData(data.CharLowData);
            face.spriteName = charLowDatga.PortraitId;

            if (playerCharIdx.CompareTo(data.RoleId) == 0)//나임
            {
                playerRank = data.RankNumber;
            }
        }

        if (0 < playerRank)//순위권
        {
            PlayerRanking.text = string.Format(_LowDataMgr.instance.GetStringCommon(192), playerRank);
        }
        else//순위권 밖
        {
            PlayerRanking.text = _LowDataMgr.instance.GetStringCommon(193);
        }

        RankGrid.repositionNow = true;
    }
Esempio n. 4
0
    public _PlayerSyncData OtherPcSyncData(ulong AccountUUID, ulong a_rUUID, string a_Nick, uint a_CharIdx, uint a_userCostumeIdx, uint a_userLevel, uint prefix, uint suffix, uint maxSuperArmor, uint skillSetId)
    {
        _PlayerSyncData otherPcSyncData = new _PlayerSyncData();
        //if (_playerSyncData == null)
        //    return;

        PlayerUnitData myData = new PlayerUnitData();

        Dictionary <AbilityType, float> playerStats = new Dictionary <AbilityType, float>();

        //기본 스탯 넣어주자
        uint iLevel = 1;

        //일단 기본캐릭만
        Character.CharacterInfo charInfo = _LowDataMgr.instance.GetCharcterData(11000);
        playerStats.Add(AbilityType.HP, (float)(charInfo.BaseHp + iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1) * charInfo.LevelUpHp));
        playerStats.Add(AbilityType.DAMAGE, (float)(charInfo.BaseAtk + iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1) * charInfo.LevelUpAtk));
        playerStats.Add(AbilityType.HIT_RATE, (float)(charInfo.BaseHit * 0.1f + iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1) * charInfo.LevelHitRate));
        playerStats.Add(AbilityType.DODGE_RATE, (float)(charInfo.BaseAvoid * 0.1f + iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1) * charInfo.LevelAvoidRate));
        playerStats.Add(AbilityType.CRITICAL_RATE, (float)(charInfo.BaseCriticalRate * 0.1f));
        playerStats.Add(AbilityType.CRITICAL_RES, (float)(charInfo.BaseCriticalResist * 0.1f));
        playerStats.Add(AbilityType.CRITICAL_DAMAGE, (float)(charInfo.BaseCriticalDamage * 0.1f));
        playerStats.Add(AbilityType.DRAIN_HP, (float)(charInfo.BaseLifeSteal * 0.1f));
        playerStats.Add(AbilityType.DEFENCE_IGNORE, (float)(charInfo.BaseIgnoreAtk));
        playerStats.Add(AbilityType.DAMAGE_DECREASE, (float)(charInfo.BaseDamageDown));
        playerStats.Add(AbilityType.DAMAGE_DECREASE_RATE, (float)(charInfo.BaseDamageDownRate * 0.1f));
        playerStats.Add(AbilityType.EXP_UP, 0f);
        playerStats.Add(AbilityType.ALLSTAT_RATE, 0f);
        playerStats.Add(AbilityType.SUPERARMOR, maxSuperArmor);
        playerStats.Add(AbilityType.SUPERARMOR_RECOVERY, (float)(charInfo.SuperArmorRecovery));
        playerStats.Add(AbilityType.SUPERARMOR_RECOVERY_RATE, (float)(charInfo.SuperArmorRecoveryRate));
        playerStats.Add(AbilityType.SUPERARMOR_RECOVERY_TIME, (float)(charInfo.SuperArmorRecoveryTime));

        /*
         * for (int i = 0; i < (int)ePartType.PART_MAX; i++)
         * _ItemData equipItem = GetUserInfo().GetEquipParts((ePartType)i);
         *
         * if (equipItem != null)
         * {
         * var enumerator = equipItem.Stats.GetEnumerator();
         * while (enumerator.MoveNext())
         * {
         *  if (playerStats.ContainsKey(enumerator.Current.Key))
         *  {
         *      //있는거면 더해주기
         *      playerStats[enumerator.Current.Key] += RealValue(enumerator.Current.Key, enumerator.Current.Value);
         *  }
         *  else
         *  {
         *      //없는거면 추가
         *      playerStats.Add(enumerator.Current.Key, RealValue(enumerator.Current.Key, enumerator.Current.Value));
         *  }
         *
         * }
         * }
         * }
         */

        uint HELMETID = 0;
        uint CLOTHID  = 0;
        uint WEAPONID = 0;

        Item.EquipmentInfo tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.HELMET);
        if (tempInfo == null)
        {
            HELMETID = 0;
        }
        else
        {
            HELMETID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.CLOTH);
        if (tempInfo == null)
        {
            CLOTHID = 0;
        }
        else
        {
            CLOTHID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.WEAPON);
        if (tempInfo == null)
        {
            WEAPONID = 0;
        }
        else
        {
            WEAPONID = tempInfo.Id;
        }

        //서버에서 정상적인 데이터 오기전까지는 일렇게.
        if (skillSetId <= 0)
        {
            switch (a_CharIdx)
            {
            case 11000:
                skillSetId = 100;
                break;

            case 12000:
                skillSetId = 200;
                break;

            case 13000:
                skillSetId = 300;
                break;
            }
        }

        myData.Init(0,
                    0,
                    a_Nick,
                    AccountUUID,
                    a_rUUID,
                    a_CharIdx,
                    0,
                    a_userCostumeIdx,
                    0,
                    0,
                    skillSetId,
                    false,
                    1,
                    prefix,
                    suffix,
                    playerStats);

        //Item.CostumeInfo costumeData = _LowDataMgr.instance.GetLowDataCostumeInfo(a_userCostumeIdx);

        uint skillIndex = 0;

        SkillTables.SkillSetInfo setInfo = _LowDataMgr.instance.GetLowDataSkillSet(skillSetId);
        for (int i = 0; i < setInfo.skill0.Count; i++)
        {
            uint.TryParse(setInfo.skill0[i], out skillIndex);
            myData.NormalAttackData[i] = new SkillData(skillIndex, (byte)1);
        }

        myData.SkillData[0] = new SkillData(setInfo.skill1, (byte)1);
        myData.SkillData[1] = new SkillData(setInfo.skill2, (byte)1);
        myData.SkillData[2] = new SkillData(setInfo.skill3, (byte)1);
        myData.SkillData[3] = new SkillData(setInfo.skill4, (byte)1);

        for (int i = 0; i < setInfo.Chain.Count; i++)
        {
            uint.TryParse(setInfo.Chain[i], out skillIndex);
            myData.SkillData[4 + i] = new SkillData(skillIndex, (byte)1);
        }

        otherPcSyncData.playerSyncDatas.Add(myData);

        return(otherPcSyncData);
    }
Esempio n. 5
0
    //플레이어용
    public Dictionary <AbilityType, float> CalcPlayerStats(uint charIdx = 0, uint iLevel = 0, List <_ItemData> equipList = null, _CostumeData equipCostume = null)
    {
        if (charIdx <= 0)
        {
            charIdx      = GetUserInfo()._userCharIndex;
            iLevel       = GetUserInfo()._Level;
            equipList    = GetUserInfo().GetEquipItemList();
            equipCostume = GetUserInfo().GetEquipCostume();
        }

        bool bDebugStat = false;


        Dictionary <AbilityType, float> playerStats = new Dictionary <AbilityType, float>();

        Dictionary <AbilityType, float> itemStats = new Dictionary <AbilityType, float>();

        //기본 스탯 넣어주자
        //uint iLevel = GetUserInfo()._Level;

        //일단 기본캐릭만
        Character.CharacterInfo charInfo = _LowDataMgr.instance.GetCharcterData(charIdx);        //GetUserInfo().GetCharIdx()

        //float t1 = (float)(iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1));
        //float t2 = (float)(t1 * charInfo.LevelUpHp);
        //float t3 = (float)(charInfo.BaseHp + t2);
        float powValue = Mathf.Pow(_LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1), iLevel);

        playerStats.Add(AbilityType.HP, (float)(charInfo.BaseHp + (iLevel * powValue * charInfo.LevelUpHp)) * 0.1f);
        playerStats.Add(AbilityType.DAMAGE, (float)(charInfo.BaseAtk + (iLevel * powValue * charInfo.LevelUpAtk)) * 0.1f);
        playerStats.Add(AbilityType.HIT_RATE, (float)(charInfo.BaseHit + (iLevel * powValue * charInfo.LevelHitRate)) * 0.1f);
        playerStats.Add(AbilityType.DODGE_RATE, (float)(charInfo.BaseAvoid + (iLevel * powValue * charInfo.LevelAvoidRate)) * 0.1f);
        playerStats.Add(AbilityType.CRITICAL_RATE, (float)(charInfo.BaseCriticalRate * 0.1f));
        playerStats.Add(AbilityType.CRITICAL_RES, (float)(charInfo.BaseCriticalResist * 0.1f));
        playerStats.Add(AbilityType.CRITICAL_DAMAGE, (float)(charInfo.BaseCriticalDamage * 0.1f));
        playerStats.Add(AbilityType.DRAIN_HP, (float)(charInfo.BaseLifeSteal * 0.1f));
        playerStats.Add(AbilityType.DEFENCE_IGNORE, (float)(charInfo.BaseIgnoreAtk * 0.1f));
        playerStats.Add(AbilityType.DAMAGE_DECREASE, (float)(charInfo.BaseDamageDown * 0.1f));
        playerStats.Add(AbilityType.DAMAGE_DECREASE_RATE, (float)(charInfo.BaseDamageDownRate * 0.1f));
        playerStats.Add(AbilityType.COOLTIME, 0f);
        playerStats.Add(AbilityType.ATTACK_SPEED, _LowDataMgr.instance.GetAttackSpeed(1f));

        playerStats.Add(AbilityType.SUPERARMOR, (float)(charInfo.BaseSuperArmor + (iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1) * charInfo.LevelUpSuperArmor)));
        playerStats.Add(AbilityType.SUPERARMOR_RECOVERY, (float)(charInfo.SuperArmorRecovery));
        playerStats.Add(AbilityType.SUPERARMOR_RECOVERY_RATE, (float)(charInfo.SuperArmorRecoveryRate));
        playerStats.Add(AbilityType.SUPERARMOR_RECOVERY_TIME, (float)(charInfo.SuperArmorRecoveryTime));

        playerStats.Add(AbilityType.WEIGHT, charInfo.Weight);


        playerStats.Add(AbilityType.EXP_UP, 0f);
        playerStats.Add(AbilityType.ALLSTAT_RATE, 0f);

                #if UNITY_EDITOR
        if (bDebugStat)
        {
            Debug.Log(" CalcPlayerStats , lv:" + iLevel + " =======================================");
            Debug.Log(" === player Stats ===");
            var playerStatsEnum = playerStats.GetEnumerator();
            while (playerStatsEnum.MoveNext())
            {
                Debug.Log(" ability:" + playerStatsEnum.Current.Key + ", v:" + playerStatsEnum.Current.Value);
            }

            Debug.Log(" === equipment Stats ===");
        }
                #endif


        for (int i = 0; i < equipList.Count; i++)        // (int)ePartType.PART_MAX
        {
            _ItemData equipItem = equipList[i];
            if (equipItem != null)
            {
                List <ItemAbilityData> statList = equipItem.StatList;
                int count = statList.Count;

//				if (bDebugStat){
//					Debug.Log (" = equipItem, id:"+equipItem._equipitemDataIndex+", _enchant:"+equipItem._enchant+", num of stat:"+count);
//				}
                for (int j = 0; j < count; j++)
                {
                    if (itemStats.ContainsKey(statList[j].Ability) == false)
                    {
                        itemStats.Add(statList[j].Ability, 0f);
                    }

                    itemStats[statList[j].Ability] += _LowDataMgr.instance.GetItemAbilityValue(statList[j].Value, equipItem._enchant);

                    if (bDebugStat)
                    {
                        Debug.Log(" = equipItem, id:" + equipItem._equipitemDataIndex + ", _enchant:" + equipItem._enchant + ", ability:" + statList[j].Ability + ",v:" + itemStats[statList[j].Ability]);
                    }
                }
            }
        }


        // 일단 주석처리. 코스튬은 추후 다시 붙일 예정. 20171103 kyh

        /*
         * //Debug.Log (" === jewel Stats     ===");
         * //현재 가지고 들어가는 코스튬에 박힌 보석정보 - 소켓이 4개
         * //_CostumeData equipCostume = GetUserInfo().GetEquipCostume();
         * if (equipCostume != null)
         * {
         *      int length = equipCostume._EquipJewelLowId.Length;
         *      for (ushort i = 0; i < length; i++)
         *      {
         *              uint lowDataId = equipCostume._EquipJewelLowId[i];
         *              if (lowDataId <= 0)//미장착 이란 소리
         *                      continue;
         *
         *              //Debug.Log (" = jewel id:"+lowDataId);
         *
         *              Item.ItemInfo useLowData = _LowDataMgr.instance.GetUseItem(lowDataId);
         *              if (0 < useLowData.OptionType)
         *              {
         *                      ItemAbilityData data = new ItemAbilityData();
         *                      data.Ability = (AbilityType)useLowData.OptionType;
         *                      data.Value = useLowData.value;
         *
         *                      if (itemStats.ContainsKey(data.Ability) == false){
         *                              itemStats.Add(data.Ability, 0);
         *                      }
         *
         *                      //Debug.Log (" ability:"+ data.Ability+", v:"+data.Value+", abilityValue:"+RealValue(data.Ability, data.Value));
         *
         *                      //있는거면 더해주기
         *                      itemStats[data.Ability] += RealValue(data.Ability, data.Value);
         *              }
         *      }
         * }
         */

        // // 일단 주석처리. 코스튬은 추후 다시 붙일 예정. 20171103 kyh
        ///////////////////////////////// costume ability add

        /*
         * if (NetData.instance.GetUserInfo ().GetEquipCostume() != null){
         *      NetData.ItemAbilityData CostumeAbility = NetData.instance.GetUserInfo ().GetEquipCostume ().AbilityData;
         *
         *      // new
         *      // (캐릭터 스탯 + 코스튬 스탯) * formula = 캐릭터 최종스탯 이였으나 캐릭터 스탯 + (코스튬 스탯 * formula) = 캐릭터 최종스탯 으로 변경한다.
         *      // 따라서 코스튬 스탯을 itemStats에 add하지않고 바로 playerStats에 추가한다.2017.8.18 kyh
         *      if (CostumeAbility != null) {
         *              if (playerStats.ContainsKey (CostumeAbility.Ability) == false) {
         *                      playerStats.Add (CostumeAbility.Ability, 0f);
         *              }
         #if UNITY_EDITOR
         *              if (bDebugStat){
         *              //Debug.Log (" === costume Stats   ===");
         *              //Debug.Log (" costume ability : " + CostumeAbility.Ability + ", v:" + _LowDataMgr.instance.GetCostumeAbilityValue (GetUserInfo ().GetEquipCostume ()._Grade, CostumeAbility.Value));
         *              }
         #endif
         *              playerStats [CostumeAbility.Ability] += _LowDataMgr.instance.GetCostumeAbilityValue (GetUserInfo ().GetEquipCostume ()._Grade, GetUserInfo ().GetEquipCostume ()._MinorGrade, CostumeAbility.Value);
         *      }
         *      ///////////////////////////////// costume ability add
         *      ///
         * }
         */


        if (bDebugStat)
        {
            Debug.Log(" === player + item   ===");
        }
        //최종스탯계산

        float subCharUpRate = 1f;        //_LowDataMgr.instance.GetSubCharUpValue ();
        var   enumerator    = itemStats.GetEnumerator();
        while (enumerator.MoveNext())
        {
            if (playerStats.ContainsKey(enumerator.Current.Key))
            {
                //float t = (1 + (_LowDataMgr.instance.CostumeGradeCalc( GetUserInfo().GetEquipCostume()._Grade )));// 1.02

                //				Debug.Log(" calc player stat===");
                //				Debug.Log(" player stat name:"+enumerator.Current.Key);
                //				Debug.Log(" playerStats:"+playerStats[enumerator.Current.Key]);
                //				Debug.Log(" ItemStat:"+enumerator.Current.Value);
                //Debug.Log(" formula:"+(1 + (_LowDataMgr.instance.CostumeGradeCalc( GetUserInfo().GetEquipCostume()._Grade ))) );
                //float val = (playerStats[enumerator.Current.Key] + enumerator.Current.Value) * (1 + (_LowDataMgr.instance.CostumeGradeCalc( GetUserInfo().GetEquipCostume()._Grade )));
                //Debug.Log(" val : "+val);
                //playerStats[enumerator.Current.Key] = (playerStats[enumerator.Current.Key] + enumerator.Current.Value) * (1 + (_LowDataMgr.instance.CostumeGradeCalc( GetUserInfo().GetEquipCostume()._Grade )));

                float prevVal = 0f;
                if (bDebugStat)
                {
                    prevVal = playerStats[enumerator.Current.Key];
                }
                playerStats[enumerator.Current.Key] = myRoundToInt2((playerStats[enumerator.Current.Key] + enumerator.Current.Value) * subCharUpRate);

                if (bDebugStat)
                {
                    Debug.Log(" = ability:" + enumerator.Current.Key + ", pc [" + prevVal + "]+ item [" + enumerator.Current.Value + "]=" + playerStats[enumerator.Current.Key]);
                }
            }
        }

                #if UNITY_EDITOR
        if (bDebugStat)
        {
            Debug.Log(" === final  Stats ===");
            var finalEnum = playerStats.GetEnumerator();
            while (finalEnum.MoveNext())
            {
                Debug.Log(" ability:" + finalEnum.Current.Key + ", v:" + finalEnum.Current.Value);
            }
        }
                #endif

        return(playerStats);
    }
Esempio n. 6
0
    public void OpenCharacterInfoPanel(BaseVillager villager)
    {
        villagerReference = villager;

        villagerReference.gameObject.GetComponent <Renderer>().material.SetFloat("_Outline", 0.2f);

        selectedCharacterInfo       = villagerReference.GetCharacterInfo();
        selectedCharacterTaskSkills = villagerReference.GetTaskSkills();

        for (int i = 0; i < infoText.Length; i++)
        {
            switch (i)
            {
            case 1:
                infoText [i].text = selectedCharacterInfo.characterName;
                break;

            case 2:
                infoText[i].text = selectedCharacterInfo.characterName;
                break;

            case 3:
                if (selectedCharacterInfo.characterSex == 1)
                {
                    infoText [i].text = "Male";
                }
                else
                {
                    infoText [i].text = "Female";
                }
                break;

            case 5:
                infoText [i].text = selectedCharacterInfo.characterLevel.ToString();
                break;

            case 8:
                infoText [i].text = selectedCharacterInfo.characterAttributes.fitness.ToString();
                break;

            case 10:
                infoText [i].text = selectedCharacterInfo.characterAttributes.nimbleness.ToString();
                break;

            case 12:
                infoText [i].text = selectedCharacterInfo.characterAttributes.curiosity.ToString();
                break;

            case 14:
                infoText [i].text = selectedCharacterInfo.characterAttributes.focus.ToString();
                break;

            case 16:
                infoText [i].text = selectedCharacterInfo.characterAttributes.charm.ToString();
                break;

            case 19:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.brawling.ToString();
                break;

            case 21:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.sword.ToString();
                break;

            case 23:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.longsword.ToString();
                break;

            case 25:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.axe.ToString();
                break;

            case 27:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.polearm.ToString();
                break;

            case 29:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.bow.ToString();
                break;

            case 31:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.dodge.ToString();
                break;

            case 33:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.armor.ToString();
                break;

            case 36:
                infoText [i].text = selectedCharacterTaskSkills.mining.ToString();
                break;

            case 38:
                infoText [i].text = selectedCharacterTaskSkills.woodcutting.ToString();
                break;

            case 40:
                infoText [i].text = selectedCharacterTaskSkills.blacksmithing.ToString();
                break;

            case 42:
                infoText [i].text = selectedCharacterTaskSkills.weaponCrafting.ToString();
                break;

            case 44:
                infoText [i].text = selectedCharacterTaskSkills.armorCrafting.ToString();
                break;

            case 46:
                infoText [i].text = selectedCharacterTaskSkills.tailoring.ToString();
                break;

            case 48:
                infoText [i].text = selectedCharacterTaskSkills.farming.ToString();
                break;

            case 50:
                infoText [i].text = selectedCharacterTaskSkills.construction.ToString();
                break;

            case 52:
                infoText [i].text = selectedCharacterTaskSkills.sailing.ToString();
                break;

            case 54:
                infoText [i].text = villagerReference.GetEquippedWeapon().GetItemName();
                break;

            case 56:
                infoText [i].text = villagerReference.GetOffHandWeapon().GetItemName();
                break;

            case 58:
                infoText [i].text = villagerReference.GetEquippedArmor().GetItemName();
                break;
            }
        }

        characterPanel.SetActive(true);
    }
Esempio n. 7
0
    public void OpenCharacterInfoPanel()
    {
        selectedCharacterInfo       = villagerReference.GetCharacterInfo();
        selectedCharacterTaskSkills = villagerReference.GetTaskSkills();

        //villagerReference.gameObject.GetComponent<Renderer>().material.SetFloat("_Outline", 0.2f);

        for (int i = 0; i < infoText.Length; i++)
        {
            switch (i)
            {
            case 1:
                infoText[i].text = selectedCharacterInfo.characterName;
                break;

            case 2:
                characterPanel.GetComponentInChildren <InputField>().text = selectedCharacterInfo.characterName;
                break;

            case 4:
                if (selectedCharacterInfo.characterSex == 1)
                {
                    infoText [i].text = "Male";
                }
                else
                {
                    infoText [i].text = "Female";
                }
                break;

            case 6:
                infoText [i].text = selectedCharacterInfo.characterLevel.ToString();
                break;

            case 9:
                infoText [i].text = selectedCharacterInfo.characterAttributes.fitness.ToString();
                break;

            case 11:
                infoText [i].text = selectedCharacterInfo.characterAttributes.nimbleness.ToString();
                break;

            case 13:
                infoText [i].text = selectedCharacterInfo.characterAttributes.curiosity.ToString();
                break;

            case 15:
                infoText [i].text = selectedCharacterInfo.characterAttributes.focus.ToString();
                break;

            case 17:
                infoText [i].text = selectedCharacterInfo.characterAttributes.charm.ToString();
                break;

            case 20:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.brawling.ToString();
                break;

            case 22:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.sword.ToString();
                break;

            case 24:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.longsword.ToString();
                break;

            case 26:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.axe.ToString();
                break;

            case 28:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.polearm.ToString();
                break;

            case 30:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.bow.ToString();
                break;

            case 32:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.dodge.ToString();
                break;

            case 34:
                infoText [i].text = selectedCharacterInfo.characterCombatSkills.armor.ToString();
                break;

            case 37:
                infoText [i].text = selectedCharacterTaskSkills.mining.ToString();
                break;

            case 39:
                infoText [i].text = selectedCharacterTaskSkills.woodcutting.ToString();
                break;

            case 41:
                infoText [i].text = selectedCharacterTaskSkills.blacksmithing.ToString();
                break;

            case 43:
                infoText [i].text = selectedCharacterTaskSkills.weaponCrafting.ToString();
                break;

            case 45:
                infoText [i].text = selectedCharacterTaskSkills.armorCrafting.ToString();
                break;

            case 47:
                infoText [i].text = selectedCharacterTaskSkills.tailoring.ToString();
                break;

            case 49:
                infoText [i].text = selectedCharacterTaskSkills.farming.ToString();
                break;

            case 51:
                infoText [i].text = selectedCharacterTaskSkills.construction.ToString();
                break;

            case 53:
                infoText [i].text = selectedCharacterTaskSkills.sailing.ToString();
                break;

            case 55:
                infoText [i].text = villagerReference.GetEquippedWeapon().GetItemName();
                break;

            case 57:
                infoText [i].text = villagerReference.GetOffHandWeapon().GetItemName();
                break;

            case 59:
                infoText [i].text = villagerReference.GetEquippedArmor().GetItemName();
                break;
            }
        }

        characterPanel.SetActive(true);
    }
    //길드멤버뷰
    public void SetGuildMemberList(List <NetData.GuildMemberInfo> memberList)
    {
        MyGuildMemberList = memberList;

        //접속중인길드원 -> 직책 순으로 소팅해줌
        MyGuildMemberList.Sort(SortGuildMemberList);

        for (int i = 0; i < MemberGrid.transform.childCount; i++)
        {
            if (i >= MyGuildMemberList.Count)
            {
                MemberGrid.transform.GetChild(i).gameObject.SetActive(false);
                continue;
            }

            GameObject slotGo = MemberGrid.transform.GetChild(i).gameObject;
            Transform  slotTf = slotGo.transform;
            slotGo.SetActive(true);

            NetData.GuildMemberInfo rcvData = MyGuildMemberList[i];

            UILabel name = slotTf.FindChild("name").GetComponent <UILabel>();
            name.text = rcvData.Name;

            UISprite Faces = slotGo.transform.FindChild("Face").GetComponent <UISprite>();
            Character.CharacterInfo charLowData = _LowDataMgr.instance.GetCharcterData(rcvData.Type);
            Faces.spriteName = charLowData.PortraitId;

            UILabel lv = slotTf.FindChild("level").GetComponent <UILabel>();
            lv.text = rcvData.Lv.ToString();

            UILabel Attack = slotTf.FindChild("strength").GetComponent <UILabel>();
            Attack.text = rcvData.Power.ToString();

            UILabel position = slotTf.FindChild("rank").GetComponent <UILabel>();
            Guild.GuildPositionInfo myPosition = _LowDataMgr.instance.GetLowdataGuildPositionInfo(rcvData.position);
            position.text = _LowDataMgr.instance.GetStringCommon(myPosition.name);

            UILabel contri = slotTf.FindChild("point").GetComponent <UILabel>();
            contri.text = rcvData.Contribution.ToString();

            UILabel access = slotTf.FindChild("access").GetComponent <UILabel>();
            if (rcvData.Online == 1 /*rcvData.LogountTime < rcvData.LoginTime*/)//0오프 1온라인
            {
                //온라인
                access.text = _LowDataMgr.instance.GetStringCommon(1116);
            }
            else
            {
                //오프
                //이거좀더보기
                if (rcvData.LogountTime != 0)
                {
                    System.DateTime logout     = System.DateTime.ParseExact(rcvData.LogountTime.ToString(), "yyyyMMddHHmmss", null);
                    System.TimeSpan lastAccess = System.DateTime.Now - logout;

                    // 하루지남
                    if (lastAccess.Days > 0)
                    {
                        access.text = string.Format(_LowDataMgr.instance.GetStringCommon(1119), lastAccess.Days);
                    }
                    else if (lastAccess.Hours > 0)
                    {
                        //24시간미만
                        access.text = string.Format(_LowDataMgr.instance.GetStringCommon(1118), lastAccess.Hours);
                    }
                    else
                    {
                        //60분미만
                        access.text = string.Format(_LowDataMgr.instance.GetStringCommon(1117), lastAccess.Minutes);
                    }
                }
                else
                {
                    //일단임시로....
                    access.text = string.Format(_LowDataMgr.instance.GetStringCommon(1117), 1);
                }
            }

            UIButton Admin = slotTf.FindChild("admin").GetComponent <UIButton>();
            Admin.isEnabled = rcvData.Id != NetData.instance.GetUserInfo()._charUUID;
            //관리탭
            EventDelegate.Set(Admin.onClick, delegate()
            {
                MyFriendList.Clear();
                MySendList.Clear();
                MemberAdminPopup.transform.FindChild("Btn01").GetComponent <UIButton>().isEnabled = true;
                NetworkClient.instance.SendPMsgFriendQueryListC();
                selectMember = rcvData;
                SetMemberPopup(rcvData);
            });
        }
        MemberGrid.Reposition();
        MemberScroll.enabled = MyGuildMemberList.Count > 4;
    }
Esempio n. 9
0
    void OnCallbackSlot(int arr, GameObject go)
    {
        if (CurTabType == 0)//길드
        {
            if (GuildMemberList.Count <= arr)
            {
                go.SetActive(false);
                return;
            }

            go.SetActive(true);
            Transform tf = go.transform;
            Character.CharacterInfo charLowData = _LowDataMgr.instance.GetCharcterData(GuildMemberList[arr].Type);
            tf.FindChild("lv").GetComponent <UILabel>().text          = string.Format(_LowDataMgr.instance.GetStringCommon(453), GuildMemberList[arr].Lv);
            tf.FindChild("name").GetComponent <UILabel>().text        = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(155), GuildMemberList[arr].Name);
            tf.FindChild("battle").GetComponent <UILabel>().text      = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(47), GuildMemberList[arr].Power);
            tf.FindChild("face").GetComponent <UISprite>().spriteName = charLowData.PortraitId;

            if (0 <= NetData.instance.GetGameRoomUserArr(GuildMemberList[arr].Id)) //이미 초대되어 있음
            {
                tf.FindChild("BtnInvite").GetComponent <UISprite>().color = Color.gray;
                tf.FindChild("BtnInvite").collider.enabled = false;
                tf.FindChild("BtnInvite/label").GetComponent <UILabel>().color = Color.gray;
            }
            else
            {
                tf.FindChild("BtnInvite").GetComponent <UISprite>().color = Color.white;
                tf.FindChild("BtnInvite").collider.enabled = true;
                tf.FindChild("BtnInvite/label").GetComponent <UILabel>().color = Color.white;

                List <long> list = new List <long>();
                list.Add((long)GuildMemberList[arr].Id);
                EventDelegate.Set(tf.FindChild("BtnInvite").GetComponent <UIButton>().onClick, delegate() {
                    if (CurGameMode == GAME_MODE.COLOSSEUM)
                    {
                        NetworkClient.instance.SendPMsgColosseumInviteC(0, list);
                    }
                    else
                    {
                        NetworkClient.instance.SendPMsgMultiBossInviteC(0, list);
                    }

                    IsSendFriend = false;
                });
            }
        }
        else if (CurTabType == 1)//친구
        {
            if (FriendList.Count <= arr)
            {
                go.SetActive(false);
                return;
            }

            go.SetActive(true);
            Transform tf = go.transform;
            Character.CharacterInfo charLowData = _LowDataMgr.instance.GetCharcterData(FriendList[arr].nLookId);
            tf.FindChild("lv").GetComponent <UILabel>().text          = string.Format(_LowDataMgr.instance.GetStringCommon(453), FriendList[arr].nLevel);
            tf.FindChild("name").GetComponent <UILabel>().text        = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(155), FriendList[arr].szName);
            tf.FindChild("battle").GetComponent <UILabel>().text      = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(47), FriendList[arr].BattlePower);
            tf.FindChild("face").GetComponent <UISprite>().spriteName = charLowData.PortraitId;

            if (0 <= NetData.instance.GetGameRoomUserArr(FriendList[arr].ullRoleId))//이미 초대되어 있음
            {
                tf.FindChild("BtnInvite").GetComponent <UISprite>().color = Color.gray;
                tf.FindChild("BtnInvite").collider.enabled = false;
                tf.FindChild("BtnInvite/label").GetComponent <UILabel>().color = Color.gray;
            }
            else
            {
                tf.FindChild("BtnInvite").GetComponent <UISprite>().color = Color.white;
                tf.FindChild("BtnInvite").collider.enabled = true;
                tf.FindChild("BtnInvite/label").GetComponent <UILabel>().color = Color.white;

                List <long> list = new List <long>();
                list.Add((long)FriendList[arr].ullRoleId);
                EventDelegate.Set(tf.FindChild("BtnInvite").GetComponent <UIButton>().onClick, delegate() {
                    if (CurGameMode == GAME_MODE.COLOSSEUM)
                    {
                        NetworkClient.instance.SendPMsgColosseumInviteC(0, list);
                    }
                    else
                    {
                        NetworkClient.instance.SendPMsgMultiBossInviteC(0, list);
                    }

                    IsSendFriend = true;
                });
            }
        }
    }