Exemple #1
0
    /// <summary>
    /// 返回物品的数量
    /// </summary>
    public static int GetItemCount(s_signinInfo info)
    {
        int result            = 0;
        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);
            if (cInfo.m_captionid > 0)
            {
                result = 1;
            }
            break;

        case SignInRewardType.HeroSoulFragment:
        case SignInRewardType.ItemAndEquip:
        case SignInRewardType.TrapFragment:
        case SignInRewardType.BlackScienceFragment:
            result = ItemDC.GetItemCount(id);
            break;

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

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

        case SignInRewardType.GoldCoin:    //下面内容策划待定
            result = UserDC.GetCoin();
            break;

        case SignInRewardType.Diamond:
            result = UserDC.GetDiamond();
            break;

        case SignInRewardType.Crystal:
            result = UserDC.GetCrystal();
            break;

        case SignInRewardType.Wood:
            result = UserDC.GetWood();
            break;
        }
        return(result);
    }
Exemple #2
0
    /// <summary>
    /// 1104 0616 回应船长数据
    /// </summary>
    public static bool Recv_USER_CAPTION_INFO_RESP(object Info)
    {
        if (Info == null)
        {
            return(false);
        }
        captain.CaptainInfoResponse sir = Info as captain.CaptainInfoResponse;
        foreach (captain.CaptainInfo I in  sir.captain_infos)
        {
            //添加
            int action = I.action;
            int id     = I.captainid;
            if (action == 0)
            {
                bool ishave = false;
                foreach (CaptionInfo c in m_Captions.Values)
                {
                    if (c.m_id == I.id)
                    {
                        ishave = true;
                        c.SetCaption(I);
                        break;
                    }
                }

                if (ishave == false)
                {
                    CaptionInfo capinfo = new CaptionInfo();
                    GodSkillM.GetCaption(I.captainid, ref capinfo);
                    capinfo.SetCaption(I);
                    m_Captions.Add(id, capinfo);
                }
            }
            else if (action == 1)     //update
            {
                foreach (CaptionInfo c in m_Captions.Values)
                {
                    if (c.m_id == I.id)
                    {
                        c.SetCaption(I);
                        break;
                    }
                }
            }
            else if (action == 2)
            {
                foreach (CaptionInfo c in m_Captions.Values)
                {
                    if (c.m_id == I.id)
                    {
                        m_Captions.Remove(c.m_captionid);
                        break;
                    }
                }
            }
        }
        return(true);
    }
Exemple #3
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);
        }
    }
Exemple #4
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);
    }
    private void LoadTrophies(int gtype, int gid, bool isSoul = false, bool isNewVersion = false, int num = 0, bool isBook = false)
    {
        NGUIUtil.SetActive(MyHead.SkillInfo, false);
        NGUIUtil.SetActive(MyHead.Building, false);

        if (isNewVersion)
        {
            if (MyHead.LblDes != null)
            {
                MyHead.LblDes.gameObject.SetActive(false);
            }
        }
        if (gtype == 1)   //炮弹兵
        {
            SoldierInfo Info = SoldierM.GetStartSoldierInfo(gid);
            CreateSoldier(Info);

            if (isNewVersion)
            {
                if (isSoul && num > 0)
                {
                    int startLevel = SoldierM.GetSoldierStarLevel(Info.SoldierTypeID);
                    MyHead.LblDes.text = string.Format(NGUIUtil.GetStringByKey(10000119), startLevel, num);
                    MyHead.LblDes.gameObject.SetActive(true);
                }
            }
            else if (m_isSoulPis && m_SoulPisNum > 0)
            {
                int startLevel = SoldierM.GetSoldierStarLevel(Info.SoldierTypeID);
                MyHead.LblDes.text = string.Format(NGUIUtil.GetStringByKey(10000119), startLevel, m_SoulPisNum);
            }
            m_bNotTween = false;
        }
        else if (gtype == 3)     // 陷阱/建筑物
        {
            BuildInfo Info = buildingM.GetStartBuildInfo(gid);
            if (Info != null)
            {
                CreateBuilding(Info);
            }

            m_bNotTween = true;
        }
        else if (gtype == 4)     //黑科技
        {
            NGUIUtil.SetActive(MyHead.BlackScience, true);
            CaptionInfo info = new CaptionInfo();
            GodSkillM.GetCaption(gid, ref info);
            CreateBlackScience(info);
            if (isNewVersion)
            {
                if (isBook && num > 0)
                {
                    int star = GodSkillM.GetCaptionMinStarLevel(info.m_godskilltype1);
                    MyHead.LblDes.text = string.Format(NGUIUtil.GetStringByKey(30000060), star, num);
                    MyHead.LblDes.gameObject.SetActive(true);
                }
            }
            else if (m_isSoulPis && m_SoulPisNum > 0)
            {
                int star = GodSkillM.GetCaptionMinStarLevel(info.m_godskilltype1);
                MyHead.LblDes.text = string.Format(NGUIUtil.GetStringByKey(30000060), star, m_SoulPisNum);
            }
            m_bNotTween = true;
        }
        else if (gtype == 5)     //设计图
        {
            StaticShipCanvas cInfo = ShipPlanM.GetShipCanvasInfo(gid);
            CreateDesignPic(cInfo);
            m_bNotTween = true;
        }
        else if (gtype == 2)     //碎片
        {
            CreateTrophyItem(gtype, gid);
        }
        SoundPlay.Play("get_item", false, false);
    }
    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);
    }