示例#1
0
    /// <summary>
    /// 添加广播公告
    /// </summary>
    public void addMessageRadio(string name, int vipLevel, string propType, int propSid)
    {
        string qualityName  = "";
        string qualityColor = "";
        string propName     = "";

        if (propType == TempPropType.EQUIPMENT)
        {
            EquipSample equipSample = EquipmentSampleManager.Instance.getEquipSampleBySid(propSid);
            qualityName  = QualityManagerment.getQualityNameByNone(equipSample.qualityId);
            qualityColor = QualityManagerment.getQualityColor(equipSample.qualityId);
            propName     = equipSample.name;
        }
        else if (propType == TempPropType.GOODS)
        {
            PropSample propSample = PropSampleManager.Instance.getPropSampleBySid(propSid);
            qualityName  = QualityManagerment.getQualityNameByNone(propSample.qualityId);
            qualityColor = QualityManagerment.getQualityColor(propSample.qualityId);
            propName     = propSample.name;
        }
        string str1;

        if (vipLevel > 0)
        {
            str1 = "[FF0000]" + LanguageConfigManager.Instance.getLanguage("s0509", name, vipLevel.ToString());
        }
        else
        {
            str1 = "[FF0000]" + name;
        }
        string str2    = qualityColor + qualityName + LanguageConfigManager.Instance.getLanguage("equipName") + propName;
        string message = "[FFFFFF]" + LanguageConfigManager.Instance.getLanguage("s0507", str1) + "[FFFFFF]" + LanguageConfigManager.Instance.getLanguage("s0561", str2);

        RadioManager.Instance.M_addRadioMsg(RadioManager.RADIO_LUCKY_EQUIP_TYPE, message);
    }
示例#2
0
    //解析道具数据
    public override void parseSample(int sid)
    {
        PropSample sample  = new PropSample();
        string     dataStr = getSampleDataBySid(sid);

        sample.parse(sid, dataStr);
        samples.Add(sid, sample);
    }
示例#3
0
    /// <summary>
    /// 计算上阵六个神格所带来的附加效果
    /// </summary>
    /// <returns></returns>
    public ShenGeExtraEffect CalculateExtrEffectValue()
    {
        List <ShenGeCaoInfo> shenGeCaoInfos = getAllEquipedShenGeSid();

        for (int i = 0; i < shenGeCaoInfos.Count; i++)
        {
            if (shenGeCaoInfos[i].sid == 0)
            {
                shenGeCaoInfos.Remove(shenGeCaoInfos[i]);
            }
        }
        if (shenGeCaoInfos.Count < 6)
        {
            return(null);
        }

        Prop       tmp      = PropManagerment.Instance.createProp(shenGeCaoInfos[0].sid);
        PropSample sample   = PropSampleManager.Instance.getPropSampleBySid(shenGeCaoInfos[0].sid);
        int        minLevel = 0;

        if (sample != null)
        {
            minLevel = tmp.getShenGeLevel();
        }
        for (int i = 1; i < shenGeCaoInfos.Count; i++)
        {
            Prop       tempProp = PropManagerment.Instance.createProp(shenGeCaoInfos[i].sid);
            PropSample samplee  = PropSampleManager.Instance.getPropSampleBySid(shenGeCaoInfos[i].sid);
            if (samplee != null)
            {
                if (minLevel > tempProp.getShenGeLevel())
                {
                    minLevel = tempProp.getShenGeLevel();
                }
            }
        }
        List <ShenGeExtraEffect> extraList = CommandConfigManager.Instance.GetShenGeExtraEffectsList();

        if (minLevel < extraList[0].level)
        {
            return(null);
        }
        if (minLevel >= extraList[extraList.Count - 1].level)
        {
            return(extraList[extraList.Count - 1]);
        }
        for (int i = 0; i < extraList.Count; i++)
        {
            int level = extraList[i].level;
            if (minLevel < level)
            {
                return(extraList[i - 1]);
            }
        }
        return(null);
    }
示例#4
0
 //是否是碎片道具
 public bool isScrap()
 {
     if (getGoodsType() == PrizeType.PRIZE_PROP)
     {
         PropSample propTemp = PropSampleManager.Instance.getPropSampleBySid(getGoodsSid());
         if (propTemp.type == PropType.PROP_TYPE_CARDSCRAP || propTemp.type == PropType.PROP_TYPE_EQUIPSCRAP || propTemp.type == PropType.PROP_MAGIC_SCRAP)
         {
             return(true);
         }
     }
     return(false);
 }
 public override void buttonEventBase(GameObject gameObj)
 {
     if (gameObj.name == "close")
     {
         msg.msgEvent             = msg_event.dialogCancel;
         this.dialogCloseUnlockUI = true;
         finishWindow();
         //callback (msg);
     }
     //最小值
     else if (gameObj.name == "min")
     {
         now = min;
         updateDisplayeNumber();
         coverDistanceToOne();
         MaskWindow.UnlockUI();
     }
     //最大值
     else if (gameObj.name == "max")
     {
         now = max;
         updateDisplayeNumber();
         coverDistanceToOne();
         MaskWindow.UnlockUI();
     }
     //加
     else if (gameObj.name == "add")
     {
         addNumber();
         MaskWindow.UnlockUI();
     }
     //减
     else if (gameObj.name == "reduce")
     {
         reduceNumber();
         MaskWindow.UnlockUI();
     }
     calculateTotal();
     //选定确认
     if (gameObj.name == "buttonOk")
     {
         GuideManager.Instance.doGuide();;
         PropSample sample = PropSampleManager.Instance.getPropSampleBySid(item.sid);
         msg.msgEvent = msg_event.dialogOK;
         finishWindow();
         EventDelegate.Add(OnHide, () => {
             callback(msg);
         });
     }
     //MaskWindow.UnlockUI ();
 }
示例#6
0
    private bool checkShowTips()
    {
        List <ShenGeCaoInfo> infos = ShenGeManager.Instance.getAllEquipedShenGeSid();

        for (int k = 0; k < infos.Count; k++) //计算各类型神格所附加的影响值总和
        {
            Prop       tmpProp = PropManagerment.Instance.createProp(infos[k].sid);
            PropSample sample  = PropSampleManager.Instance.getPropSampleBySid(infos[k].sid);
            if (sample != null)
            {
                if (ShenGeManager.Instance.checkCanGroup(tmpProp, ShenGeManager.SHENGEWINDOW))
                {
                    return(true);
                }
            }
        }
        return(false);
    }
示例#7
0
    /// <summary>
    /// 计算神格威能
    /// </summary>
    /// <returns></returns>
    public ShenGePower CalculateShenGePower()
    {
        List <ShenGeCaoInfo> shenGeCaoInfos = getAllEquipedShenGeSid();

        for (int i = 0; i < shenGeCaoInfos.Count; i++)
        {
            if (shenGeCaoInfos[i].sid == 0)
            {
                shenGeCaoInfos.Remove(shenGeCaoInfos[i]);
            }
        }
        int sumLevel = 0;

        for (int i = 0; i < shenGeCaoInfos.Count; i++)
        {
            Prop       tempProp = PropManagerment.Instance.createProp(shenGeCaoInfos[i].sid);
            PropSample sample   = PropSampleManager.Instance.getPropSampleBySid(shenGeCaoInfos[i].sid);
            if (sample != null)
            {
                sumLevel += tempProp.getShenGeLevel();
            }
        }
        List <ShenGePower> shenGePowers = CommandConfigManager.Instance.GetsheGePowersList();

        if (sumLevel < shenGePowers[0].level)
        {
            return(null);
        }
        if (sumLevel >= shenGePowers[shenGePowers.Count - 1].level)
        {
            return(shenGePowers[shenGePowers.Count - 1]);
        }
        for (int i = 0; i < shenGePowers.Count; i++)
        {
            int level = shenGePowers[i].level;
            if (sumLevel < level)
            {
                return(shenGePowers[i - 1]);
            }
        }
        return(null);
    }
示例#8
0
    /// <summary>
    /// 获取所有已装备的神格的类型
    /// </summary>
    /// <returns></returns>
    public ArrayList getAllEquipedTypes()
    {
        ArrayList list = new ArrayList();

        if (sidList == null)
        {
            return(list);
        }
        for (int i = 0; i < sidList.Count; i++)
        {
            Prop       prop   = PropManagerment.Instance.createProp(sidList[i].sid);
            PropSample sample = PropSampleManager.Instance.getPropSampleBySid(sidList[i].sid);
            if (sample != null)
            {
                int type = prop.getType();
                list.Add(type);
            }
        }
        return(list);
    }
 /// <summary>
 /// 点击事件
 /// </summary>
 public override void buttonEventBase(GameObject gameObj)
 {
     base.buttonEventBase(gameObj);
     if (gameObj.name == "close")
     {
         this.dialogCloseUnlockUI = true;
     }
     else if (gameObj.name == "buttonFire")
     {
         PropSample sample = PropSampleManager.Instance.getPropSampleBySid(propPrize.sid);
         if (sample.type == PropType.PROP_TYPE_CHEST)
         {
             //若果临时仓库有东西时,不能打开宝箱,并飘字提示玩家
             if (StorageManagerment.Instance.getAllTemp().Count > 0)
             {
                 UiManager.Instance.openDialogWindow <MessageLineWindow> ((win) => {
                     win.Initialize(LanguageConfigManager.Instance.getLanguage("storeFull_temp_tip"));
                 });
                 return;
             }
             //如果数量只有一个 则直接使用,不用去选择数量
             if (now > 0)
             {
                 if (callback != null)
                 {
                     this.dialogCloseUnlockUI = false;
                     callback(now, propPrize);
                 }
             }
         }
         else if (sample.type == PropType.PROP_TYPE_LOCK_CHEST)                //带锁的宝箱打开界面
         {
             UiManager.Instance.openWindow <TreasureChestWindow> ((win) => {
                 win.init(propPrize.sid);
             });
         }
     }
     finishWindow();
 }
示例#10
0
    public void Initialize(PropAward item, AwardDisplayCtrl ctrl)
    {
        PropSample sample = PropSampleManager.Instance.getPropSampleBySid(item.sid);
        Prop       tmp    = PropManagerment.Instance.createProp(sample.sid);

        if (tmp.isMagicScrap())
        {
            Utils.RemoveAllChild(itemImage.transform);
            MagicWeapon magic = MagicWeaponScrapManagerment.Instance.getMagicWeaponByScrapSid(tmp.sid);
            GameObject  obj   = NGUITools.AddChild(itemImage.gameObject, starPerfab);
            ShowStars   show  = obj.GetComponent <ShowStars>();
            show.init(magic, MagicWeaponManagerment.USEDBUMAGIC_AWARD);
        }
        itemName.text = LanguageConfigManager.Instance.getLanguage("s0058") + sample.name;
        string count;

        if (item.num == 0)
        {
            count = "x1";
        }
        else
        {
            count = "x" + item.num;
        }
        itemName.text += count;

        itemImage.width  = 256;
        itemImage.height = 256;
        if (item.sid == 71181)
        {
            itemImage.width  = 180;
            itemImage.height = 180;
        }
        qualityBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(sample.qualityId);
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + sample.iconId, itemImage);
        Initialize(ctrl);
    }
示例#11
0
    public override void DoClickEvent()
    {
        base.DoClickEvent();
        GuideManager.Instance.doFriendlyGuideEvent();

        PropSample sample = PropSampleManager.Instance.getPropSampleBySid(prop.sid);

        if (UserManager.Instance.self.getUserLevel() < prop.getUseLv() && sample.type != PropType.PROP_COMBAT_CHEST)
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((window) => {
                window.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("s0331", prop.getUseLv().ToString()), null);
            });
            return;
        }
        if (sample.type == PropType.PROP_TYPE_CHEST)
        {
            //若果临时仓库有东西时,不能打开宝箱,并飘字提示玩家
            if (StorageManagerment.Instance.getAllTemp().Count > 0)
            {
                UiManager.Instance.openDialogWindow <MessageLineWindow> ((win) => {
                    win.Initialize(LanguageConfigManager.Instance.getLanguage("storeFull_temp_tip"));
                });
                return;
            }
            //如果数量只有一个 则直接使用,不用去选择数量
            if (prop.getNum() == 1)
            {
                useProp(1);
                return;
            }

            GuideManager.Instance.doGuide();
            UiManager.Instance.openDialogWindow <BuyWindow> ((win) => {
                win.init(prop, prop.getNum(), 1, prop.getNum() > 50 ? 50 : prop.getNum(), 1, constResourcesPath.NONE, useBack);
            });
        }
        else if (sample.type == PropType.PROP_TYPE_LOCK_CHEST)            //带锁的宝箱打开界面
        {
            UiManager.Instance.openWindow <TreasureChestWindow> ((win) => {
                win.init(prop.sid);
            });
        }
        /** 使用改名卡 */
        else if (sample.type == PropType.PROP_RENAME)
        {
            UiManager.Instance.openDialogWindow <RoleRenameWindow>((win) => {
                win.sample = sample;
            });
        }
        else if (sample.type == PropType.PROP_HAFE_MONTH)
        {
            OpenGiftBagFport fport = FPortManager.Instance.getFPort("OpenGiftBagFport") as OpenGiftBagFport;
            fport.access(1, prop, () =>
            {
                NoticeMonthCardFPort sp = FPortManager.Instance.getFPort("NoticeMonthCardFPort") as NoticeMonthCardFPort;
                sp.access_get(() =>
                {
                    UiManager.Instance.openDialogWindow <MessageLineWindow>((winn) => {
                        winn.Initialize(LanguageConfigManager.Instance.getLanguage("month_hafe_add"));
                        StoreWindow store = UiManager.Instance.getWindow <StoreWindow>();
                        if (store != null)
                        {
                            store.updateContent();
                        }
                    });
                });


                //int[] monthCardDueDate=NoticeManagerment.Instance.monthCardDueDate;
                //if (monthCardDueDate == null || monthCardDueDate.Length == 0)
                //{
                //    int currentTime = ServerTimeKit.getSecondTime();
                //    DateTime time = TimeKit.getDateTime(currentTime + 1296000);
                //    NoticeManagerment.Instance.monthCardDueDate = new int[3]
                //    {
                //        time.Year,
                //        time.Month,
                //        time.Day
                //    };
                //    GameManager.Instance.monthTime = currentTime + 1296000;
                //}
                //else
                //{
                //    DateTime t = TimeKit.getDateTime(GameManager.Instance.monthTime + 1296000);
                //    NoticeManagerment.Instance.monthCardDueDate = new int[3]
                //    {
                //        t.Year,
                //        t.Month,
                //        t.Day
                //    };
                //}
            });
        }
        else if (sample.type == PropType.PROP_COMBAT_CHEST)
        {
            if (StorageManagerment.Instance.getAllTemp().Count > 0)
            {
                UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => {
                    win.Initialize(LanguageConfigManager.Instance.getLanguage("storeFull_temp_tip"));
                });
                return;
            }
            useChest();
        }
    }
示例#12
0
    public void Initialize(Prop chooseItem, int index, int intoType)
    {
        localIndex  = index;
        chooseProp  = chooseItem;
        intoWinType = intoType;
        nextProp    = chooseProp;
        for (int i = 0; i < CostInfoLabels.Length; i++)
        {
            CostInfoLabels[i].text = "";
        }
        if (ShenGeManager.Instance.getShowShenGeList(chooseProp).Count > 0)
        {
            buttonChange.disableButton(false);
        }
        else
        {
            buttonChange.disableButton(true);
        }
        if (chooseProp != null)
        {
            if (intoType == ShenGeManager.STORAGE)
            {
                buttonChange.gameObject.SetActive(false);
                buttonGroup.gameObject.SetActive(false);
            }
            else if (intoType == ShenGeManager.SHENGEWINDOW)
            {
                buttonCompound.gameObject.SetActive(false);
            }
            string str = "";
            switch (chooseProp.getType())
            {
            case PropType.PROP_SHENGE_HP:
                str = LanguageConfigManager.Instance.getLanguage("s0005");
                break;

            case PropType.PROP_SHENGE_ATT:
                str = LanguageConfigManager.Instance.getLanguage("s0006");
                break;

            case PropType.PROP_SHENGE_DEF:
                str = LanguageConfigManager.Instance.getLanguage("s0007");
                break;

            case PropType.PROP_SHENGE_MAG:
                str = LanguageConfigManager.Instance.getLanguage("s0008");
                break;

            case PropType.PROP_SHENGE_AGI:
                str = LanguageConfigManager.Instance.getLanguage("s0009");
                break;
            }
            valueType.text       = str;
            currentPropName.text = QualityManagerment.getQualityColor(chooseProp.getQualityId()) + chooseProp.getName();
            if (!ShenGeManager.Instance.checkCanGroup(chooseProp, intoType))
            {
                DescribeLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_022");
                PropSample tmpSample = PropSampleManager.Instance.getPropSampleBySid(chooseProp.getNextShenGeSid());
                if (tmpSample == null)
                {
                    DescribeLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_030");
                    desc.text          = "";
                }
                else
                {
                    nextProp  = PropManagerment.Instance.createProp(tmpSample.sid);
                    desc.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_038");
                }
                ResourcesManager.Instance.LoadAssetBundleTexture(
                    ResourcesManager.ICONIMAGEPATH + chooseProp.getIconId(), propImage);
                //propName.text = QualityManagerment.getQualityColor(chooseProp.getQualityId()) + chooseProp.getName();
                //propName.gameObject.transform.localPosition = new Vector3(130,23.5f,0);
                propName.text      = "";
                heChengLabel.text  = "";
                quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(chooseProp.getQualityId());
                ValueLabel.text    = chooseProp.getEffectValue() + "";
                addValueLabel.text = "";
                buttonGroup.disableButton(true);
                return;
            }
            buttonGroup.disableButton(false);
            PropSample sample = PropSampleManager.Instance.getPropSampleBySid(chooseProp.getNextShenGeSid());
            if (sample == null)
            {
                return;
            }
            else
            {
                nextProp = PropManagerment.Instance.createProp(sample.sid);
            }
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + sample.iconId, propImage);
            heChengLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_021");
            propName.text     = QualityManagerment.getQualityColor(sample.qualityId) + sample.name;
            propName.gameObject.transform.localPosition = new Vector3(183, 23.5f, 0);
            quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(sample.qualityId);
            ValueLabel.text    = chooseProp.getEffectValue() + "";
            addValueLabel.text = "+" + (sample.effectValue - chooseProp.getEffectValue()) + "";
            List <ShenGeInfo> tmpList = ShenGeManager.Instance.shengeList;
            for (int i = 0; i < tmpList.Count; i++)
            {
                Prop tmpProp = PropManagerment.Instance.createProp(tmpList[i].sid);
                if (tmpProp != null)
                {
                    CostInfoLabels[i].text = QualityManagerment.getQualityColor(tmpProp.getQualityId()) + tmpProp.getName() + "X" + tmpList[i].num;
                }
            }
        }
    }
示例#13
0
 public override void buttonEventBase(GameObject gameObj)
 {
     if (gameObj.name == "close")
     {
         msg.msgEvent             = msg_event.dialogCancel;
         this.dialogCloseUnlockUI = true;
         finishWindow();
         callback(msg);
     }
     //最小值
     else if (gameObj.name == "min")
     {
         now = min;
         updateDisplayeNumber();
         coverDistanceToOne();
         MaskWindow.UnlockUI();
     }
     //最大值
     else if (gameObj.name == "max")
     {
         now = max;
         updateDisplayeNumber();
         coverDistanceToOne();
         MaskWindow.UnlockUI();
     }
     //加
     else if (gameObj.name == "add")
     {
         addNumber();
         MaskWindow.UnlockUI();
     }
     //减
     else if (gameObj.name == "reduce")
     {
         reduceNumber();
         MaskWindow.UnlockUI();
     }
     calculateTotal();
     //选定确认
     if (gameObj.name == "buttonOk")
     {
         GuideManager.Instance.doGuide();
         if (item.GetType() == typeof(Goods) || item.GetType() == typeof(NoticeActiveGoods))
         {
             if (!canBuy())
             {
                 //MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage ("s0355", costStr));
                 if (costType == PrizeType.PRIZE_RMB)
                 {
                     finishWindow();
                     EventDelegate.Add(OnHide, () => {
                         MessageWindow.ShowRecharge(LanguageConfigManager.Instance.getLanguage("s0355", costStr));
                     });
                 }
                 else
                 {
                     UiManager.Instance.openDialogWindow <MessageWindow> (
                         (win) => {
                         win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("s0355", costStr), null);
                     });
                 }
                 return;
             }
             if (!checkSotreFull())
             {
                 msg.msgEvent = msg_event.dialogOK;
             }
             else
             {
                 UiManager.Instance.openDialogWindow <MessageWindow> (
                     (win) => {
                     win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, str + "," + LanguageConfigManager.Instance.getLanguage("s0207"), null);
                 });
             }
         }
         else
         {
             if (item.GetType() == typeof(Prop))
             {
                 Prop       prop   = item as Prop;
                 PropSample sample = PropSampleManager.Instance.getPropSampleBySid(prop.sid);
                 //精灵宝箱
                 if (sample.sid == 71070)
                 {
                     if (StorageManagerment.Instance.isRoleStorageFull(StringKit.toInt(numberText.text)))
                     {
                         str = LanguageConfigManager.Instance.getLanguage("s0192", LanguageConfigManager.Instance.getLanguage("cardName"));
                         MessageWindow.ShowAlert(str);
                         return;
                     }
                 }
             }
             msg.msgEvent = msg_event.dialogOK;
         }
         finishWindow();
         EventDelegate.Add(OnHide, () => {
             callback(msg);
         });
     }
     //MaskWindow.UnlockUI ();
 }
示例#14
0
    public void UpdateProp(Prop _prop)
    {
        compoundButton.gameObject.SetActive(false);
        if (_prop == null)
        {
            return;
        }
        prop = _prop;
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + prop.getIconId(), itemIcon);

        if (prop.getDescribe().Length > STRLENGTH + 6)
        {
            descript.text = prop.getDescribe().Substring(0, STRLENGTH + 4) + "...";
        }
        else
        {
            descript.text = prop.getDescribe();
        }
        //propName.text =QualityManagerment.getQualityColor( prop.getQualityId ()) +prop.getName ();
        propName.text      = prop.getName();
        propNum.text       = " x " + prop.getNum();
        quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(prop.getQualityId());
        if (prop.isCanExchageCard())
        {
            compoundButton.disableButton(false);
            compoundButton.gameObject.SetActive(true);
            compoundButton.fatherWindow = fatherWindow;
            compoundButton.initButton(prop);
        }
        if (prop.isShenGeProp())
        {
            if (type == ShenGeManager.CHANGE)
            {
                equipButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_011");
                equipButton.gameObject.SetActive(true);
                equipButton.fatherWindow = fatherWindow;
                equipButton.UpdateProp(prop, localIndex);
            }
            else if (type == ShenGeManager.EQUIP)
            {
                equipButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_010");
                equipButton.gameObject.SetActive(true);
                equipButton.fatherWindow = fatherWindow;
                equipButton.UpdateProp(prop, localIndex);
            }
            else
            {
                PropSample sample = PropSampleManager.Instance.getPropSampleBySid(prop.getNextShenGeSid());
                if (sample != null)
                {
                    compoundButton.gameObject.SetActive(true);
                    if (!ShenGeManager.Instance.checkCanGroup(prop, ShenGeManager.STORAGE))
                    {
                        compoundButton.disableButton(true);
                    }
                    else
                    {
                        compoundButton.disableButton(false);
                        compoundButton.fatherWindow = fatherWindow;
                        compoundButton.initButton(prop);
                    }
                }
            }
        }
        if (prop.getType() == PropType.PROP_TYPE_CHEST || prop.getType() == PropType.PROP_TYPE_LOCK_CHEST || prop.getType() == PropType.PROP_RENAME ||
            prop.getType() == PropType.PROP_HAFE_MONTH || prop.getType() == PropType.PROP_COMBAT_CHEST)
        {
            useButton.gameObject.SetActive(true);
            useButton.fatherWindow = fatherWindow;
            useButton.initButton(prop);
        }
        else
        {
            useButton.gameObject.SetActive(false);
        }

//		if (prop.getType () != PropType.PROP_TYPE_CHEST&&prop.getType()!=PropType.PROP_TYPE_LOCK_CHEST) {
//			useButton.gameObject.SetActive (false);
//		} else {
//			useButton.gameObject.SetActive (true);
//			useButton.fatherWindow = fatherWindow;
//			useButton.initButton(prop);
//		}
    }
示例#15
0
    /// <summary>
    /// 检测是否可以升级
    /// </summary>
    /// <param name="prop"></param>
    /// <returns></returns>
    public bool checkCanGroup(Prop prop, int type)
    {
        Prop tmpProp = prop;

        if (tmpProp == null)
        {
            return(false);
        }
        PropSample sample     = PropSampleManager.Instance.getPropSampleBySid(tmpProp.sid);
        PropSample nextSample = PropSampleManager.Instance.getPropSampleBySid(sample.nextLevelSid);

        if (nextSample == null)
        {
            return(false);
        }
        int nextShenGeExp      = nextSample.expValue;
        List <ShenGeInfo> list = getAllShenGeInStorage(tmpProp);

        //取得升级所需的神格列表
        if (shengeList == null)
        {
            shengeList = new List <ShenGeInfo>();
        }
        else
        {
            shengeList.Clear();
        }
        if (type == 1)
        {
            for (int i = 0; i < list.Count; i++)
            {
                Prop temp = StorageManagerment.Instance.getProp(list[i].sid);
                if (temp.sid == tmpProp.sid)
                {
                    if (temp.getNum() == 1)
                    {
                        list.Remove(list[i]);
                    }
                    else
                    {
                        list[i].num -= 1;
                    }
                }
            }
        }
        int sum = 0;

        for (int i = 0; i < list.Count; i++)
        {
            Prop temp = StorageManagerment.Instance.getProp(list[i].sid);
            //if (type == 1) {//仓库合成
            //    if (tmpProp.sid == temp.sid) {
            //        sum += (temp.getShenGeExp() * (temp.getNum() - 1));
            //    } else
            //        sum += (temp.getShenGeExp() * temp.getNum());
            //} else
            sum += (temp.getShenGeExp() * list[i].num);

            if (sum < (nextShenGeExp / 2))
            {
                shengeList.Add(list[i]);
            }
            else if (sum == (nextShenGeExp / 2))
            {
                shengeList.Add(list[i]);
                return(true);
            }
            else
            {
                int        moreNum = (sum - (nextShenGeExp / 2)) / temp.getShenGeExp();
                ShenGeInfo tmpInfo = new ShenGeInfo();
                tmpInfo.level = temp.getShenGeLevel();
                tmpInfo.sid   = temp.sid;
                tmpInfo.num   = list[i].num - moreNum;
                shengeList.Add(tmpInfo);
                return(true);
            }
        }
        return(false);
    }
    //初始化商品条目信息
    public void updateGoods(Goods goods, CallBack callback)
    {
        //判断商品是否已解锁
        bool isLocked = false;

        buyButton.disableButton(true);
        buyButton.gameObject.SetActive(true);
        this.goods              = goods;
        this.shopUpdate         = callback;
        this.goodsName.text     = goods.getName();
        this.contributeNum.text = goods.getCostPrice() + "";
        openCondition.text      = "";
        //还没有开放,显示解锁条件
        if (!FuBenManagerment.Instance.isCanShow(goods.sid))
        {
            string[] st      = CommandConfigManager.Instance.getNvShenShopSid();
            int      flagSid = 0;
            for (int i = 0; i < st.Length; i++)
            {
                string[] kk             = st[i].Split('#');
                int      tempMissionSid = StringKit.toInt(kk[0].Substring(kk[0].Length - 2, 2));
                int      tempGoodSid    = StringKit.toInt(kk[1]);
                if (goods.sid == tempGoodSid)
                {
                    openCondition.text = LanguageConfigManager.Instance.getLanguage("nvShenShop_openConditon", tempMissionSid + "");
                    buyButton.gameObject.SetActive(false);
                    break;
                }
            }
        }
        if (stars != null)
        {
            for (int i = 0; i < stars.transform.childCount; i++)
            {
                stars.transform.GetChild(i).gameObject.SetActive(false);
            }
        }
        if (goods.getGoodsMaxBuyCount() == 0)
        {
            this.times.text = LanguageConfigManager.Instance.getLanguage("s0280l1");
        }
        else
        {
            this.times.text = LanguageConfigManager.Instance.getLanguage("prefabzc20") + Math.Max(goods.getGoodsMaxBuyCount() - goods.getNowBuyNum(), 0).ToString() + "/" + goods.getGoodsMaxBuyCount() + "";
        }
        //该商品是否已解锁
        if (!isLocked)
        {
            locked.parent.gameObject.collider.enabled = true;
            //购买物品次数是否已经达到上限
            if (goods.getGoodsMaxBuyCount() > 0 && goods.getNowBuyNum() >= goods.getGoodsMaxBuyCount())
            {
                buyButton.disableButton(true);
            }
            else
            {
                int  propSid = goods.getCostToolSid();
                Prop p       = StorageManagerment.Instance.getProp(propSid);
                if (p == null || p.getNum() < goods.getCostPrice())
                {
                    buyButton.disableButton(true);
                }
                else
                {
                    buyButton.disableButton(false);
                    buyButton.goods        = this.goods;
                    buyButton.callback     = buy;
                    buyButton.fatherWindow = fatherWindow;
                }
            }
        }
        else
        {
            locked.gameObject.SetActive(true);//不可以购买,点击无效
            locked.parent.gameObject.collider.enabled = false;
        }
        string des = "";

        //string nameColor = "";
        if (goods.getGoodsType() == PrizeType.PRIZE_EQUIPMENT)
        {
            icon_backGround.spriteName = QualityManagerment.qualityIDToIconSpriteName(EquipmentSampleManager.Instance.getEquipSampleBySid(goods.getGoodsSid()).qualityId);
            des = EquipmentSampleManager.Instance.getEquipSampleBySid(goods.getGoodsSid()).desc;
            //nameColor = QualityManagerment.getQualityColor (EquipmentSampleManager.Instance.getEquipSampleBySid (goods.getGoodsSid ()).qualityId);
        }
        else if (goods.getGoodsType() == PrizeType.PRIZE_PROP)
        {
            PropSample ps = PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid());
            icon_backGround.spriteName = QualityManagerment.qualityIDToIconSpriteName(ps.qualityId);
            des = PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid()).describe;
            if (goods.isCardScrap() && stars != null)  //如果是卡片碎片,显示星星
            {
                stars.transform.localPosition = new Vector3(0, -30, 0);
                int  propSid = goods.getGoodsSid();                                      //碎片sid
                Card card    = CardScrapManagerment.Instance.getCardByScrapSid(propSid); //根据卡片碎片sid获取对应的卡片
                if (card != null)
                {
                    int cardStarLevel = CardSampleManager.Instance.getStarLevel(card.sid);//卡片星级
                    showStar(cardStarLevel);
                }
            }
            else if (ps.type == PropType.PROP_MAGIC_SCRAP)
            {
                MagicWeapon magic = MagicWeaponScrapManagerment.Instance.getMagicWeaponByScrapSid(ps.sid);
                if (magic != null && MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magic.sid) != null)
                {
                    int level = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magic.sid).starLevel;
                    showStar(level);
                }
            }
            if (ps.type == PropType.PROP_TYPE_EQUIPSCRAP)
            {
            }
            //nameColor = QualityManagerment.getQualityColor (PropSampleManager.Instance.getPropSampleBySid (goods.getGoodsSid ()).qualityId);
        }
        else if (goods.getGoodsType() == PrizeType.PRIZE_STARSOUL)
        {
            des = StarSoulManager.Instance.createStarSoul(goods.getGoodsSid()).getDescribe();
            //nameColor = QualityManagerment.getQualityColor (StarSoulManager.Instance.createStarSoul (goods.getGoodsSid ()).getQualityId ());
        }
        else if (goods.getGoodsType() == PrizeType.PRIZE_MAGIC_WEAPON)
        {
            icon_backGround.spriteName = QualityManagerment.qualityIDToIconSpriteName(MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(goods.getGoodsSid()).qualityId);
            des = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(goods.getGoodsSid()).desc;
            //nameColor = QualityManagerment.getQualityColor(MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(goods.getGoodsSid()).qualityId);
            if (MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(goods.getGoodsSid()) != null)
            {
                int level = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(goods.getGoodsSid()).starLevel;
                showStar(level);
            }
        }
        if (spriteScrap != null)
        {
            if (goods.isScrap())
            {
                spriteScrap.gameObject.SetActive(true);
            }
            else
            {
                spriteScrap.gameObject.SetActive(false);
            }
        }
        showGoodsTex();
        des = des.Split('~')[0];
        Regex           r     = new Regex("\\[.+?\\]");
        MatchCollection mc    = r.Matches(des);
        int             index = 0;

        for (int i = 0; i < mc.Count; i++)
        {
            if (mc[i].Index > STRING_LENGTH - 1)
            {
                break;
            }
            else if (mc[i].Index <= STRING_LENGTH - 1 && mc[i].Index + mc[i].Value.Length > STRING_LENGTH)
            {
                index += mc[i].Value.Length;
                break;
            }
            else
            {
                index += mc[i].Value.Length;
            }
        }
        if (des.Length > (STRING_LENGTH + index))
        {
            des = des.Substring(0, STRING_LENGTH - 1 + index) + "...";
        }
        if (desc != null)
        {
            desc.text = des;
        }
    }
示例#17
0
    /// <summary>
    /// 更新界面显示
    /// </summary>
    public void updateUI()
    {
        List <ShenGeCaoInfo> infos = ShenGeManager.Instance.getAllEquipedShenGeSid();

        shenGes = new ButtonShenGe[shengePoint.Length];
        for (int i = 0; i < shengePoint.Length; i++)        //清空
        {
            Utils.RemoveAllChild(shengePoint[i].transform);
        }
        for (int i = 0; i < shengePoint.Length; i++)//初始化
        {
            GameObject obj = NGUITools.AddChild(shengePoint[i], shengePrefab);
            obj.GetComponent <ButtonShenGe>().init(null, (i + 1));
            obj.GetComponent <ButtonShenGe>().fatherWindow = this;
            shenGes[i] = obj.GetComponent <ButtonShenGe>();
        }
        for (int i = 0; i < attrs.Length; i++)
        {
            attrs[i] = 0;
        }
        for (int k = 0; k < infos.Count; k++)//计算各类型神格所附加的影响值总和
        {
            int        index   = infos[k].index;
            Prop       tmpProp = PropManagerment.Instance.createProp(infos[k].sid);
            PropSample sample  = PropSampleManager.Instance.getPropSampleBySid(infos[k].sid);
            if (sample != null)
            {
                shenGes[index - 1].init(tmpProp, index);
                if (tmpProp != null)
                {
                    switch (tmpProp.getType())
                    {
                    case PropType.PROP_SHENGE_HP:
                        attrs[0] += tmpProp.getEffectValue();
                        break;

                    case PropType.PROP_SHENGE_DEF:
                        attrs[1] += tmpProp.getEffectValue();
                        break;

                    case PropType.PROP_SHENGE_AGI:
                        attrs[2] += tmpProp.getEffectValue();
                        break;

                    case PropType.PROP_SHENGE_ATT:
                        attrs[3] += tmpProp.getEffectValue();
                        break;

                    case PropType.PROP_SHENGE_MAG:
                        attrs[4] += tmpProp.getEffectValue();
                        break;
                    }
                }
            }
        }
        for (int i = 0; i < attrsLabels.Length; i++)//赋值神格属性值
        {
            attrsLabels[i].text = "";
            if (attrs[i] != 0)
            {
                attrsLabels[i].text = "+" + attrs[i];
            }
        }

        //==========神格威能=========================
        shenGeEffectLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_019");
        ShenGePower tmpPower = ShenGeManager.Instance.CalculateShenGePower();
        string      str      = "";

        if (tmpPower != null)
        {
            for (int i = 0; i < tmpPower.AttrInfos.Count; i++)
            {
                if (tmpPower.AttrInfos[i].type == ShenGeManager.ADDATTACK)
                {
                    str += LanguageConfigManager.Instance.getLanguage("NvShenShenGe_014",
                                                                      tmpPower.AttrInfos[i].value + "% ");
                }
                else if (tmpPower.AttrInfos[i].type == ShenGeManager.REDUECEDAMAGE)
                {
                    str += LanguageConfigManager.Instance.getLanguage("NvShenShenGe_015",
                                                                      tmpPower.AttrInfos[i].value + "% ");
                }
            }
            shenGeEffectLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_013", tmpPower.level + "", str);
        }
        //==========神格额外属性=========================
        string str1 = "";

        str1 += LanguageConfigManager.Instance.getLanguage("NvShenShenGe_014",
                                                           "0% ");
        str1 += LanguageConfigManager.Instance.getLanguage("NvShenShenGe_015",
                                                           "0% ");
        descLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_033", "0", str1);
        ShenGeExtraEffect extraValue = ShenGeManager.Instance.CalculateExtrEffectValue();
        //for (int i = 0; i < attrsPerLabels.Length; i++) {
        //    attrsPerLabels[i].text = "";
        //    if (value != "")
        //        attrsPerLabels[i].text = "[FF0000]+" + value;
        //}
        string strs = "";

        if (extraValue != null)
        {
            strs = "";
            for (int i = 0; i < extraValue.AttrInfos.Count; i++)
            {
                if (extraValue.AttrInfos[i].type == ShenGeManager.ADDATTACK)
                {
                    strs += LanguageConfigManager.Instance.getLanguage("NvShenShenGe_014",
                                                                       extraValue.AttrInfos[i].value + "% ");
                }
                else if (extraValue.AttrInfos[i].type == ShenGeManager.REDUECEDAMAGE)
                {
                    strs += LanguageConfigManager.Instance.getLanguage("NvShenShenGe_015",
                                                                       extraValue.AttrInfos[i].value + "% ");
                }
            }
            descLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_033", extraValue.level.ToString(), strs);
        }
        //所有的神格额外效果
        string effectsStr = "";
        string strss      = "";
        List <ShenGeExtraEffect> allExtraEffectList = CommandConfigManager.Instance.GetShenGeExtraEffectsList();

        for (int i = 0; i < allExtraEffectList.Count; i++)
        {
            strss = "";
            if (allExtraEffectList[i] != null)
            {
                for (int k = 0; k < allExtraEffectList[i].AttrInfos.Count; k++)
                {
                    if (allExtraEffectList[i].AttrInfos[k].type == ShenGeManager.ADDATTACK)
                    {
                        strss += LanguageConfigManager.Instance.getLanguage("NvShenShenGe_014",
                                                                            allExtraEffectList[i].AttrInfos[k].value + "% ");
                    }
                    else if (allExtraEffectList[i].AttrInfos[k].type == ShenGeManager.REDUECEDAMAGE)
                    {
                        strss += LanguageConfigManager.Instance.getLanguage("NvShenShenGe_015",
                                                                            allExtraEffectList[i].AttrInfos[k].value + "% ");
                    }
                }
            }
            effectsStr += LanguageConfigManager.Instance.getLanguage("NvShenShenGe_012", allExtraEffectList[i].level.ToString(), allExtraEffectList[i].level.ToString(), strss);
        }
        AllExtraEffectLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_034", CommandConfigManager.Instance.shenGeGongMingString) + LanguageConfigManager.Instance.getLanguage("NvShenShenGe_035") + effectsStr;
        //==========冒险队伍战斗力=========================
        combatLabel.text = ArmyManager.Instance.DeepClone(ArmyManager.Instance.getArmy(1)).getAllCombat().ToString();

        MaskWindow.UnlockUI();
        GuideManager.Instance.doFriendlyGuideEvent();
    }