示例#1
0
    public void UpLevel()
    {
        if (MyHead.togUpLevel.value)
        {
            MyHead.UpStar.SetActive(false);
            MyHead.UpLevel.SetActive(true);
            MyHead.BtnUpStar.gameObject.SetActive(false);
            MyHead.btnUp.gameObject.SetActive(true);
            MyHead.LblNextName.text = NGUIUtil.GetStringByKey(10000154);
            //MyHead.btnUp.isEnabled = false;

            if (m_CurItem != null)
            {
                m_CurItem.ResetUI();
                MyHead.LblStarName.text = "";
                MyHead.lblName.text     = "[71fff0]" + m_CurItem.Godskill.m_name + "[-]  [ffff62]" + NGUIUtil.GetStringByKey("60000005") + m_CurItem.m_caption.m_level1 + "[-]";
                if (m_CurItem.Godskill.m_coinneed == 0 && m_CurItem.Godskill.m_crystalneed == 0)
                {
                    MyHead.lblExplain.text = NGUIUtil.GetStringByKey(10000122);
                }
                else
                {
                    MyHead.lblExplain.text = string.Format("[552d0a]" + m_CurItem.Godskill.m_explain + "[-]");
                }

                MyHead.lblGoldCost.text = m_CurItem.Godskill.m_coinneed.ToString();

                if (UserDC.GetCoin() >= m_CurItem.Godskill.m_coinneed)
                {
                    MyHead.lblGoldCost.color = Color.white;
                }
                else
                {
                    MyHead.lblGoldCost.color = Color.red;
                }

                MyHead.lblDiamondCost.text = m_CurItem.Godskill.m_crystalneed.ToString();
                if (UserDC.GetCrystal() >= m_CurItem.Godskill.m_crystalneed)
                {
                    MyHead.lblDiamondCost.color = Color.white;
                }
                else
                {
                    MyHead.lblDiamondCost.color = Color.red;
                }
                m_CurItem.CheckUp();
                //				MyHead.btnUp.isEnabled = m_CurItem.CheckLevTop() && m_CurItem.m_CanLevUP;
                GodSkillInfo nextInfo = new GodSkillInfo();

                GodSkillM.GetGodSkill(m_CurItem.Godskill.m_type, m_CurItem.Godskill.m_level + 1, ref nextInfo);
                if (nextInfo != null && nextInfo.m_explain != null)
                {
                    MyHead.NextStarDes.text = string.Format("[552d0a]" + nextInfo.m_explain + "[-]");
                }
            }
        }
    }
示例#2
0
    public void UpStar()
    {
        if (MyHead.togUpStar.value)
        {
            MyHead.UpStar.SetActive(true);
            MyHead.UpLevel.SetActive(false);

            MyHead.BtnUpStar.gameObject.SetActive(true);
            MyHead.btnUp.gameObject.SetActive(false);
            MyHead.LblNextName.text = NGUIUtil.GetStringByKey(70000115);
            //MyHead.BtnUpStar.isEnabled = false;
            if (m_CurItem != null)
            {
                m_CurItem.ResetUI();

                MyHead.LblStarName.text = "[71fff0]" + m_CurItem.Godskill.m_name + "[-]";
                MyHead.lblName.text     = "";
                MyHead.lblExplain.text  = string.Format("[552d0a]" + m_CurItem.Godskill.m_stardescription + "[-]");

                int bookcount = ItemDC.GetItemCount(m_CurItem.Godskill.m_needbook);
                if (m_CurItem.Godskill.m_needbooknum == 0 && m_CurItem.m_caption.m_star == 5)
                {
                    MyHead.lblScrollNum.text      = NGUIUtil.GetStringByKey(10000085);
                    MyHead.SprProgress.fillAmount = 1.0f;
                }
                else
                {
                    MyHead.lblScrollNum.text      = bookcount + "/" + m_CurItem.Godskill.m_needbooknum;
                    MyHead.SprProgress.fillAmount = bookcount * 1.0f / m_CurItem.Godskill.m_needbooknum;
                }

                GodSkillInfo nextInfo = new GodSkillInfo();

                GodSkillM.GetGodSkill(m_CurItem.Godskill.m_type, m_CurItem.Godskill.m_level, m_CurItem.m_caption.m_star + 1, ref nextInfo);
                if (m_CurItem.m_caption.m_star == 5)
                {
                    MyHead.NextStarDes.text = string.Format("[552d0a]" + NGUIUtil.GetStringByKey(10000085) + "[-]");
                }
                else if (nextInfo != null && nextInfo.m_stardescription != null)
                {
                    MyHead.NextStarDes.text = string.Format("[552d0a]" + nextInfo.m_stardescription + "[-]");
                }

                SetTrapStarLevel(m_CurItem.m_caption.m_star);
                m_CurItem.CheckUp();
                //				MyHead.BtnUpStar.isEnabled = m_CurItem.CheckStarTop();
                UIGrid grid = MyHead.StarParent.GetComponent <UIGrid>();
                grid.repositionNow = true;
            }
        }
    }
示例#3
0
    public static bool CheckStarUp(CaptionInfo info)
    {
        GodSkillInfo Godskill  = info.GetGodSkillInfo();
        int          bookcount = ItemDC.GetItemCount(Godskill.m_needbook);

        if (UserDC.GetLevel() >= info.m_levelneed && Godskill.m_needbooknum > 0 && bookcount >= Godskill.m_needbooknum)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
示例#4
0
 public static void SetGrowData(int type, int num, ref GodSkillInfo info)
 {
     if (type == 1)
     {
         info.m_power += num;
     }
     else if (type == 2)
     {
         info.m_range += num * 0.01f;
     }
     else if (type == 4)
     {
         info.m_power2 += num;
     }
 }
示例#5
0
    public static void GetGodSkill(int type, int level, int star, ref GodSkillInfo info)
    {
        GetGodSkill(type, level, ref info);
        foreach (sdata.s_godskillstarInfo gs in m_lGodSkillStar)
        {
            if (gs.godskilltype == type && gs.godskillstar == star)
            {
                info.m_needbook        = gs.needbook;
                info.m_needbooknum     = gs.needbooknum;
                info.m_stardescription = gs.description;
                SetGrowData(gs.growtype0, gs.grownum0, ref info);
                SetGrowData(gs.growtype1, gs.grownum1, ref info);
                SetGrowData(gs.growtype2, gs.grownum2, ref info);
                int lentime = NdUtil.GetLength(gs.statustime);
                int lentype = NdUtil.GetLength(gs.statustype);
                for (int i = 0; i < info.m_own_status_info.Count; i++)
                {
                    if (gs.statustime != "" && i < lentime)
                    {
                        info.m_own_status_info[i].m_time += NdUtil.GetIntValue(gs.statustime, i);
                    }
                    if (info.m_own_status_info[i].m_effect.Count > 1 && gs.statustype != "")
                    {
                        for (int j = 0; j < info.m_own_status_info[i].m_effect.Count; j += 2)
                        {
                            for (int k = 0; k < lentype; k++)
                            {
                                if (NdUtil.GetIntValue(gs.statustype, i) == info.m_own_status_info[i].m_effect[j])
                                {
                                    info.m_own_status_info[i].m_effect[j + 1] += NdUtil.GetIntValue(gs.statusvalue, i);
                                }
                            }
                        }
                    }
                }
                break;

                /*info.m_statustime = gs.statustime;
                 * info.m_statustype = gs.statustype;
                 * info.m_statusvalue = gs.statusvalue;*/
            }
        }
    }
示例#6
0
    /// <summary>
    /// 创建黑科技
    /// </summary>
    void CreateBlackScience(CaptionInfo info)
    {
        if (info == null)
        {
            NGUIUtil.DebugLog("CreateBlackScience info == null");
            return;
        }
        GodSkillInfo gInfo = new GodSkillInfo();

        //黑科技抽取是1级,王振鑫确认
        GodSkillM.GetGodSkill(info.m_godskilltype1, 1, ref gInfo);
        NGUIUtil.SetLableText(MyHead.LblBlackScienceDesc, gInfo.m_explain);
        string icon = "Textures/role/" + info.m_captionid;

        NGUIUtil.Set2DSprite(MyHead.Spr2dBSIcon, icon);
        int star = GodSkillM.GetCaptionMinStarLevel(info.m_godskilltype1);

        SetStarsLevel(star);
    }
示例#7
0
    public static bool CheckLevUp(CaptionInfo info)
    {
        if (info.m_star == ConstantData.MaxStarLevel)
        {
            return(false);
        }
        GodSkillInfo Godskill = info.GetGodSkillInfo();

        if (UserDC.GetLevel() >= info.m_levelneed &&
            Godskill.m_coinneed > 0 && Godskill.m_crystalneed > 0 &&
            UserDC.GetCoin() >= Godskill.m_coinneed && UserDC.GetCrystal() >= Godskill.m_crystalneed)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
示例#8
0
    public static void GetGodSkill(int type, int level, ref GodSkillInfo info)
    {
        foreach (sdata.s_godskilltypeInfo gs in m_lgodskill)
        {
            if (gs.type == type && gs.level == level)
            {
                info.m_id                = gs.id;
                info.m_type              = gs.type;
                info.m_level             = gs.level;
                info.m_name              = gs.name;
                info.m_action            = gs.action;
                info.m_target            = gs.target;
                info.m_multiple          = gs.multiple;
                info.m_range             = gs.range * 0.01f;
                info.m_power             = gs.power;
                info.m_power2            = gs.power2;
                info.m_selectTarget      = gs.selecttarget;
                info.m_own_status_info   = new List <SkillStatusInfo>();
                info.m_enemy_status_info = new List <SkillStatusInfo>();
                info.m_mana              = new List <int>();

                SkillM.SetSkillStatus(ref info.m_own_status_info, gs.own_status);
                SkillM.SetSkillStatus(ref info.m_enemy_status_info, gs.enemy_status);
                int length = NdUtil.GetLength(gs.mana);
                if (length > 0)
                {
                    for (int i = 0; i < length; ++i)
                    {
                        info.m_mana.Add(NdUtil.GetIntValue(gs.mana, i));
                    }
                }
                info.m_times           = gs.times;
                info.m_blackscreentime = gs.blackscreentime * 0.001f;
                info.m_crystalneed     = gs.crystalneed;
                info.m_coinneed        = gs.coinneed;
                info.m_woodneed        = gs.woodneed;
                info.m_explain         = gs.explain;
                break;
            }
        }
    }
示例#9
0
    public void SetCaption(CaptainInfo info)
    {
        m_id            = info.id > 0 ? info.id : m_id;
        m_star          = info.star > 0? info.star : m_star;
        m_level1        = info.level1 > 0? info.level1 : m_level1;
        m_godskilltype1 = info.godskilltype1 > 0? info.godskilltype1 : m_godskilltype1;
        GodSkillInfo skill = new GodSkillInfo();

        if (m_godskilltype1 > 0 && m_level1 > 0)
        {
            GodSkillM.GetGodSkill(m_godskilltype1, m_level1, m_star, ref skill);
            m_GodSkill[m_godskilltype1] = skill;
        }
        skill = new GodSkillInfo();
        if (info.godskilltype2 > 0 && info.level2 > 0)
        {
            m_level2        = info.level2;
            m_godskilltype2 = info.godskilltype2;
            GodSkillM.GetGodSkill(info.godskilltype2, info.level2, info.star, ref skill);
            m_GodSkill[info.godskilltype2] = skill;
        }
        skill = new GodSkillInfo();
        if (info.godskilltype3 > 0 && info.level3 > 0)
        {
            m_level3        = info.level3;
            m_godskilltype3 = info.godskilltype3;
            GodSkillM.GetGodSkill(info.godskilltype3, info.level3, info.star, ref skill);
            m_GodSkill[info.godskilltype3] = skill;
        }
        skill = new GodSkillInfo();
        if (info.godskilltype4 > 0 && info.level4 > 0)
        {
            m_level4        = info.level4;
            m_godskilltype4 = info.godskilltype4;
            GodSkillM.GetGodSkill(info.godskilltype4, info.level4, info.star, ref skill);
            m_GodSkill[info.godskilltype4] = skill;
        }
    }
示例#10
0
    /// <summary>
    /// 显示首次获得黑科技表现
    /// </summary>
    private void ShowTrophiesAction()
    {
        if (CurSummonCaptianID == 0)
        {
            return;
        }

        CaptionInfo cInfo = new CaptionInfo();

        GodSkillM.GetCaption(CurSummonCaptianID, ref cInfo);
        GodSkillInfo gInfo = new GodSkillInfo();

        //黑科技抽取是1级,王振鑫确认
        GodSkillM.GetGodSkill(cInfo.m_godskilltype1, 1, ref gInfo);
        string name = "";

        name = gInfo.m_name;
        sdata.s_itemtypeInfo itypeInfo = new sdata.s_itemtypeInfo();
        itypeInfo.gid   = CurSummonCaptianID;
        itypeInfo.name  = name;
        itypeInfo.gtype = 3;

        List <sdata.s_itemtypeInfo> lInfo = new List <sdata.s_itemtypeInfo>();

        lInfo.Add(itypeInfo);

        TrophiesActionWnd TropWnd = WndManager.GetDialog <TrophiesActionWnd>();

        if (TropWnd)
        {
            TropWnd.ClearTropiesData();
            TropWnd.AddTropiesData(lInfo);
            TropWnd.SetWndType(3);
            TropWnd.MyHead.LblDes.gameObject.SetActive(false);
        }
    }
示例#11
0
 public void SetSkill(GodSkillInfo skill)
 {
     m_ReleaseTimes = 0;
     m_godskill     = skill;
 }
示例#12
0
    public void SetCaption(int level)
    {
        GodSkillInfo skill = new GodSkillInfo();

        m_level1 = level;
        m_level2 = level;
        m_level3 = level;
        m_level4 = level;
        if (m_godskilltype1 > 0)
        {
            if (m_star == 0)
            {
                m_star = 1;
            }

            GodSkillM.GetGodSkill(m_godskilltype1, level, m_star, ref skill);
            if (m_GodSkill.ContainsKey(m_godskilltype1))
            {
                m_GodSkill[m_godskilltype1] = skill;
            }
            else
            {
                m_GodSkill.Add(m_godskilltype1, skill);
            }
        }
        skill = new GodSkillInfo();
        if (m_godskilltype2 > 0)
        {
            GodSkillM.GetGodSkill(m_godskilltype2, level, m_star, ref skill);
            if (m_GodSkill.ContainsKey(m_godskilltype2))
            {
                m_GodSkill[m_godskilltype2] = skill;
            }
            else
            {
                m_GodSkill.Add(m_godskilltype2, skill);
            }
        }
        skill = new GodSkillInfo();
        if (m_godskilltype3 > 0)
        {
            GodSkillM.GetGodSkill(m_godskilltype3, level, m_star, ref skill);
            if (m_GodSkill.ContainsKey(m_godskilltype3))
            {
                m_GodSkill[m_godskilltype3] = skill;
            }
            else
            {
                m_GodSkill.Add(m_godskilltype3, skill);
            }
        }
        skill = new GodSkillInfo();
        if (m_godskilltype4 > 0)
        {
            GodSkillM.GetGodSkill(m_godskilltype4, level, m_star, ref skill);
            if (m_GodSkill.ContainsKey(m_godskilltype4))
            {
                m_GodSkill[m_godskilltype4] = skill;
            }
            else
            {
                m_GodSkill.Add(m_godskilltype4, skill);
            }
        }
    }
示例#13
0
    // isSoul是为了兼容闪亮登场界面的信息。
    public static ItemIconInfo GetIconInfo(IconType iconType, int id, bool isSoul, bool isBook)
    {
        ItemIconInfo iconInfo = new ItemIconInfo();

        if (iconType == IconType.IconType_Fragment)
        {
            if (isSoul)
            {
                int soldierTypeId       = SoldierM.GetSoldierStarID(id);
                s_soldier_typeInfo info = SoldierM.GetSoldierType(soldierTypeId);
                if (info == null)
                {
                    NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!");
                    return(null);
                }
                else
                {
                    iconType = IconType.IconType_Soldier;
                    id       = info.modeltype;
                }
            }
            else if (isBook)
            {
                iconType = IconType.IconType_Captain;
                int godSkillType = GodSkillM.GetGodSkillType(id);
                id = GodSkillM.GetCaptainID(godSkillType);
            }
        }

        if (iconType == IconType.IconType_Soldier)        //英雄整卡
        {
            s_soldier_typeInfo info = SoldierM.GetSoldierType(id);
            if (info == null)
            {
                NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!");
                return(null);
            }
            else
            {
                iconInfo.mType = iconType;
                iconInfo.mName = info.name;
                iconInfo.mID   = info.modeltype;
            }
        }
        else if (iconType == IconType.IconType_Fragment)        //道具/碎片
        {
            s_itemtypeInfo info = ItemM.GetItemInfo(id);
            if (info == null)
            {
                NGUIUtil.DebugLog("s_itemtype id = " + id + " 静态表数据未配置!");
                return(null);
            }
            else
            {
                iconInfo.mType = iconType;
                iconInfo.mName = info.name;
                int soldierTypeId = SoldierM.GetSoldierStarID(id);
                iconInfo.mID = info.gid;
            }
        }
        else if (iconType == IconType.IconType_Bulding)        //陷阱
        {
            s_building_typeInfo buildinfo = buildingM.GetBuildType(id);

            iconInfo.mType = iconType;
            iconInfo.mName = buildinfo.name;
            iconInfo.mID   = buildinfo.modeltype;
        }
        else if (iconType == IconType.IconType_Captain)        //黑科技
        {
            iconInfo.mType = iconType;
            CaptionInfo captionInfo = new CaptionInfo();
            GodSkillM.GetCaption(id, ref captionInfo);
            GodSkillInfo godSkillInfo = new GodSkillInfo();
            GodSkillM.GetGodSkill(captionInfo.m_godskilltype1, 1, ref godSkillInfo);
            iconInfo.mName = godSkillInfo.m_name;
            iconInfo.mID   = id;
        }
        iconInfo.mIsSoul = isSoul;
        iconInfo.mIsBook = isBook;
        return(iconInfo);
    }
示例#14
0
    private string GetName(s_signinInfo info)
    {
        string           result = "";
        int              id     = info.item_type;
        SignInRewardType type   = (SignInRewardType)info.reward_type;

        switch (type)
        {
        case SignInRewardType.BlackScience:
            CaptionInfo cInfo = new CaptionInfo();
            GodSkillM.GetCaption(id, ref cInfo);
            GodSkillInfo gInfo = new GodSkillInfo();
            GodSkillM.GetGodSkill(cInfo.m_godskilltype1, 1, ref gInfo);
            result = gInfo.m_name;
            break;

        case SignInRewardType.HeroSoulFragment:
        case SignInRewardType.ItemAndEquip:
        case SignInRewardType.TrapFragment:
        case SignInRewardType.BlackScienceFragment:
            s_itemtypeInfo info1 = ItemM.GetItemInfo(id);
            if (info1 != null)
            {
                result = info1.name;
            }
            break;

        case SignInRewardType.Hero:
            SoldierInfo info2 = SoldierM.GetSoldierInfo(id);
            if (info2 != null)
            {
                result = info2.m_name;
            }
            break;

        case SignInRewardType.Trap:
            BuildInfo info3 = buildingM.GetStartBuildInfo(id);
            if (info3 != null)
            {
                result = info3.m_name;
            }
            break;

        case SignInRewardType.GoldCoin:
            result = NGUIUtil.GetStringByKey(88800061);
            break;

        case SignInRewardType.Diamond:
            result = NGUIUtil.GetStringByKey(99700001);
            break;

        case SignInRewardType.Crystal:
            result = NGUIUtil.GetStringByKey(10000177);
            break;

        case SignInRewardType.Wood:
            result = NGUIUtil.GetStringByKey(10000178);
            break;
        }
        return(result);
    }