Example #1
0
    /// <summary>
    /// 设置其他玩法
    /// </summary>
    public void SetNoNeedEnergy()
    {
        m_listNoNeedEnergyData.Clear();
        List <int> idList = UpgradeGuideData.GetNoNeedEnergyList();

        for (int i = 0; i < idList.Count; i++)
        {
            UpgradeGuideData xmlData = UpgradeGuideData.GetData(idList[i]);
            NoNeedEnergyData noNeedEnergyData;
            noNeedEnergyData.ID         = xmlData.id;
            noNeedEnergyData.title      = LanguageData.GetContent(xmlData.title);
            noNeedEnergyData.icon       = IconData.GetIconPath(xmlData.icon);
            noNeedEnergyData.buttonName = LanguageData.GetContent(47902);
            noNeedEnergyData.desc       = LanguageData.GetContent(xmlData.describtion);

            // ID = 4(竞技场); ID= 3(试炼之塔)
            if (xmlData.id == 4)
            {
                noNeedEnergyData.requestLevel = SystemRequestLevel.ArenaIcon;
            }
            else if (xmlData.id == 3)
            {
                noNeedEnergyData.requestLevel = SystemRequestLevel.CILMBTOWER;
            }
            else
            {
                noNeedEnergyData.requestLevel = 0;
            }

            m_listNoNeedEnergyData.Add(noNeedEnergyData);
        }

        // 按照开启等级从小到大排序
        m_listNoNeedEnergyData.Sort(delegate(NoNeedEnergyData a, NoNeedEnergyData b)
        {
            if (a.requestLevel < b.requestLevel)
            {
                return(-1);
            }
            else
            {
                return(1);
            }
        });

        EnergyNoEnoughUIViewManager.Instance.SetUIGridList(m_listNoNeedEnergyData.Count, () =>
        {
            EnergyNoEnoughUIViewManager.Instance.SetNoNeedEnergyGridListData(m_listNoNeedEnergyData);
        });
    }
Example #2
0
    public void SetBuyEnergy()
    {
        m_listBuyEnergyData.Clear();
        int        lastTimes  = MogoWorld.thePlayer.CalBuyEnergyLastTimes();
        EnergyData energyData = EnergyData.dataMap[1];

        // 购买一次
        BuyEnergyData buyOneEnergyData;

        buyOneEnergyData.title = LanguageData.GetContent(47806);
        buyOneEnergyData.icon  = IconData.GetIconPath(14);
        if (lastTimes > 0)
        {
            buyOneEnergyData.buttonName = LanguageData.GetContent(47801); // 立即购买
            buyOneEnergyData.diamond    = MogoWorld.thePlayer.CalBuyEnergyDiamondCost(1);
            buyOneEnergyData.addEnergy  = energyData.fixedPoints * 1;
        }
        else
        {
            buyOneEnergyData.buttonName = LanguageData.GetContent(47811); // 不可购买
            buyOneEnergyData.diamond    = 0;
            buyOneEnergyData.addEnergy  = 0;
        }

        // 全部购买
        BuyEnergyData buyAllEnergyData;

        buyAllEnergyData.title = LanguageData.GetContent(47807);
        buyAllEnergyData.icon  = IconData.GetIconPath(14);
        if (lastTimes > 0)
        {
            buyAllEnergyData.buttonName = LanguageData.GetContent(47801); // 立即购买
            buyAllEnergyData.diamond    = MogoWorld.thePlayer.CalBuyEnergyDiamondCost(lastTimes);
            buyAllEnergyData.addEnergy  = energyData.fixedPoints * lastTimes;
        }
        else
        {
            buyAllEnergyData.buttonName = LanguageData.GetContent(47811); // 不可购买
            buyAllEnergyData.diamond    = 0;
            buyAllEnergyData.addEnergy  = 0;
        }

        m_listBuyEnergyData.Add(buyOneEnergyData);
        m_listBuyEnergyData.Add(buyAllEnergyData);

        EnergyNoEnoughUIViewManager.Instance.SetUIGridList(m_listBuyEnergyData.Count, () =>
        {
            EnergyNoEnoughUIViewManager.Instance.SetBuyEnergyGridListData(m_listBuyEnergyData);
        });
    }
Example #3
0
    private void UpdateUpgradeContent()
    {
        WingData      wd   = tipData;
        WingLevelData wld  = wd.GetLevelData(m_wings[wd.id].level);
        WingLevelData wnld = wd.GetLevelData(m_wings[wd.id].level + 1);

        WingUIViewManager.Instance.SetWingTipTitle(LanguageData.GetContent(wd.name));
        List <string> attrs     = wld.GetPropertEffect();
        List <string> nextAttrs = null;

        if (wnld != null)
        {
            nextAttrs = wnld.GetPropertEffect();
            WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogCost("x" + wnld.trainDiamondCost);
            WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogNextLevel(LanguageData.GetContent(200005, wnld.level));
        }
        WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogCurrentLevel(LanguageData.GetContent(200005, wld.level));
        WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogIcon(IconData.GetIconPath(wd.icon));
        WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogTitle(LanguageData.GetContent(wd.name));
        Wing  w = m_wings[wd.id];
        float p = 0;

        if (wld.nextLevelExp == 0)
        {
            p = 1;
            WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogProgressText(w.exp + "/" + w.exp);
        }
        else
        {
            p = (float)w.exp / (float)wld.nextLevelExp;
            WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogProgressText(w.exp + "/" + wld.nextLevelExp);
        }
        WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogProgressSize(p);
        for (int i = 0; i < attrs.Count; i++)
        {
            WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogCurrentAttr(attrs[i], i);
            if (nextAttrs != null)
            {
                WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogNextAttr(nextAttrs[i], i);
            }
            else
            {
                WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogNextAttr("", i);
            }
        }
        WingUIUpgradeDialogLogicManager.Instance.SetUIDirty();
    }
Example #4
0
 private string GetIcon(int id)
 {
     color = IconData.dataMap.Get(id).color;
     return(IconData.GetIconPath(id));
 }
    /// <summary>
    /// 计算提升系统数据
    /// </summary>
    /// <param name="playerLevel"></param>
    private void CalUpgradePowerGridList(byte playerLevel)
    {
        m_listUpgradePowerSystemData.Clear();

        List <int> upgradePowerIDList = UpgradePowerData.GetUpgradePowerIDList();

        for (int index = 0; index < upgradePowerIDList.Count; index++)
        {
            UpgradePowerData xmlData = UpgradePowerData.GetUpgradePowerDataByID(upgradePowerIDList[index]);
            if (xmlData != null)
            {
                UpgradePowerSystemData upgradePowerSystemData;

                // 基本信息
                upgradePowerSystemData.systemName   = LanguageData.GetContent(xmlData.name);
                upgradePowerSystemData.iconName     = IconData.GetIconPath(xmlData.icon);
                upgradePowerSystemData.xmlID        = xmlData.id;
                upgradePowerSystemData.xmlLevel     = xmlData.level;
                upgradePowerSystemData.xmlText      = LanguageData.GetContent(xmlData.text);
                upgradePowerSystemData.xmlFloatText = LanguageData.GetContent(xmlData.floatText);

                // 评分
                upgradePowerSystemData.modulus       = 0;
                upgradePowerSystemData.starNum       = 0;
                upgradePowerSystemData.scoreProgress = 0;
                CalStarNumAndScoreProgress(xmlData.id,
                                           ref upgradePowerSystemData.starNum,
                                           ref upgradePowerSystemData.scoreProgress,
                                           ref upgradePowerSystemData.modulus);

                // <=200表示开启等级
                // >900表示特殊条件; 901表示开启公会后开启
                if (xmlData.level <= 200)
                {
                    if (MogoWorld.thePlayer.level >= xmlData.level)
                    {
                        upgradePowerSystemData.hasOpened = true;
                    }
                    else
                    {
                        upgradePowerSystemData.hasOpened = false;
                    }
                }
                else if (xmlData.level == 901)
                {
                    if (MogoUIManager.ISTONGUIOPENED)
                    {
                        upgradePowerSystemData.hasOpened = true;
                    }
                    else
                    {
                        upgradePowerSystemData.hasOpened = false;
                    }
                }
                else
                {
                    upgradePowerSystemData.hasOpened = false;
                }

                m_listUpgradePowerSystemData.Add(upgradePowerSystemData);
            }
        }
    }
Example #6
0
    public void UpdateWing(LuaTable wings)
    {
        List <WingGridData> datas = new List <WingGridData>();

        m_wings.Clear();
        m_grids.Clear();
        m_magic.Clear();
        m_common.Clear();
        int dressed = int.Parse((string)wings["1"]);

        this.dressed = dressed;
        foreach (var item in (LuaTable)wings["2"])
        {
            Wing w = new Wing();
            w.id     = int.Parse(item.Key);
            w.level  = int.Parse((string)((LuaTable)item.Value)["1"]);
            w.exp    = int.Parse((string)((LuaTable)item.Value)["2"]);
            w.active = int.Parse((string)((LuaTable)item.Value)["3"]);
            m_wings.Add(w.id, w);
        }
        foreach (var item in WingData.dataMap)
        {
            WingGridData d = new WingGridData();
            d.wingId       = item.Key;
            d.WingName     = LanguageData.GetContent(item.Value.name);
            d.WingDescripe = LanguageData.GetContent(item.Value.descrip);
            d.WingIconName = IconData.GetIconPath(item.Value.icon);
            if (m_wings.ContainsKey(item.Key))
            {
                d.WingCurExp   = m_wings[item.Key].exp;
                d.WingStarNum  = 3;
                d.WingTotalExp = item.Value.GetLevelData(m_wings[item.Key].level).nextLevelExp;
                d.IsHave       = true;
                if (item.Value.type == 1)
                {
                    d.WingStatus = "";
                }
                else
                {
                    if (m_wings[item.Key].active == 1)
                    {
                        d.WingStatus = LanguageData.GetContent(26829);
                        d.IsActive   = true;
                    }
                    else
                    {
                        d.WingStatus = LanguageData.GetContent(26828);
                        d.IsActive   = false;
                    }
                }
                d.WingPrice = "";
            }
            else
            {
                d.WingPrice    = "";
                d.WingStarNum  = 0;
                d.WingCurExp   = 0;
                d.WingTotalExp = 0;
                if (item.Value.type == 1)
                {
                    d.WingStatus = LanguageData.GetContent(26827);
                    d.WingPrice  = "" + item.Value.price;
                }
                else
                {
                    d.WingStatus = LanguageData.GetContent(26827);
                }
                d.IsHave   = false;
                d.IsActive = false;
                d.IsUsing  = false;
            }
            if (item.Value.type == 1)
            {
                if (d.wingId == dressed)
                {
                    d.IsUsing = d.IsHave;
                }
                d.IsActive = d.IsHave;
                m_common.Add(d);
            }
            else
            {
                d.IsHave  = true;
                d.IsUsing = true;
                m_magic.Add(d);
            }
            datas.Add(d);
        }
        m_grids = datas;
        CommonWing();
        WingUILogicManager.Instance.SetGold("" + m_self.gold);
        WingUILogicManager.Instance.SetDiamond("" + m_self.diamond);
        UpdateProperty();
        if (opened)
        {
            UpdateUpgradeContent();
        }
    }
Example #7
0
    /// <summary>
    /// 升级引导
    /// </summary>
    public void SetUpgradeLevelGuide(int arenaExp = 0)
    {
        m_listUpgradeLevelGuideData.Clear();
        List <int> idList = UpgradeGuideData.GetLevelNoEnoughList();

        for (int i = 0; i < idList.Count; i++)
        {
            UpgradeGuideData      xmlData = UpgradeGuideData.GetData(idList[i]);
            UpgradeLevelGuideData upgradeLevelGuideData;
            upgradeLevelGuideData.ID         = xmlData.id;
            upgradeLevelGuideData.title      = LanguageData.GetContent(xmlData.title);
            upgradeLevelGuideData.icon       = IconData.GetIconPath(xmlData.icon);
            upgradeLevelGuideData.buttonName = LanguageData.GetContent(47902);

            bool           useMinLevel    = true;
            LevelGuideData levelGuideData = new LevelGuideData();
            levelGuideData.level = new List <int>();
            levelGuideData.level.Add(int.MaxValue);

            foreach (var item in LevelGuideData.dataMap)
            {
                if (xmlData.id != item.Value.type)
                {
                    continue;
                }

                if (levelGuideData.level[0] > item.Value.level[0])
                {
                    levelGuideData = item.Value;
                }

                if (MogoWorld.thePlayer.level > item.Value.level[0] &&
                    MogoWorld.thePlayer.level < item.Value.level[1])
                {
                    useMinLevel    = false;
                    levelGuideData = item.Value;
                    break;
                }
            }

            if (useMinLevel)
            {
                upgradeLevelGuideData.desc = LanguageData.dataMap.Get(xmlData.describtion).Format(AvatarLevelData.dataMap.Get(levelGuideData.level[0]).expStandard *levelGuideData.rate);
            }
            else
            {
                upgradeLevelGuideData.desc = LanguageData.dataMap.Get(xmlData.describtion).Format(AvatarLevelData.dataMap.Get(MogoWorld.thePlayer.level).expStandard *levelGuideData.rate);
            }

            // ID = 2(竞技场)
            // ID = 1(每日任务)
            // ID = 5(飞龙大赛)
            // ID = 6(保卫女神)
            if (xmlData.id == 2)
            {
                upgradeLevelGuideData.requestLevel = SystemRequestLevel.ArenaIcon;
            }
            else if (xmlData.id == 1)
            {
                upgradeLevelGuideData.requestLevel = SystemRequestLevel.DailyTaskIcon;
            }
            else if (xmlData.id == 5)
            {
                upgradeLevelGuideData.requestLevel = SystemRequestLevel.DRAGONMATCH;
            }
            else if (xmlData.id == 6)
            {
                upgradeLevelGuideData.requestLevel = SystemRequestLevel.OGREMUSTDIE;
            }
            else if (xmlData.id == 7)
            {
                upgradeLevelGuideData.requestLevel = 0;
            }
            else
            {
                upgradeLevelGuideData.requestLevel = 0;
                upgradeLevelGuideData.desc         = string.Empty;
            }

            m_listUpgradeLevelGuideData.Add(upgradeLevelGuideData);
        }

        // 按照开启等级从小到大排序
        m_listUpgradeLevelGuideData.Sort(delegate(UpgradeLevelGuideData a, UpgradeLevelGuideData b)
        {
            if (a.requestLevel < b.requestLevel)
            {
                return(-1);
            }
            else
            {
                return(1);
            }
        });

        // 创建UI
        LevelNoEnoughUIViewManager.Instance.SetUIGridList(m_listUpgradeLevelGuideData.Count, () =>
        {
            LevelNoEnoughUIViewManager.Instance.SetGridListData(m_listUpgradeLevelGuideData);
        });
    }