Ejemplo n.º 1
0
    /// <summary>
    ///    强化
    /// </summary>
    void EquipStrength(PackBtnType packBtnType)
    {
        var m_isConsumeEnough = m_equipListBehaviour.CurrrEquipDetails.m_equipStrenUpgradeProperty.EnoughToStren;

        SoundManager.Instance.PlaySoundEffect("Sound_Button_Equipment_Click");
        if (m_isStrengthBack)
        {
            if (m_isConsumeEnough)
            {
                ItemFielInfo selectedEquip      = m_equipListBehaviour.CurrrEquipDetails.CurrItemFielInfo;
                var          playerLv           = PlayerManager.Instance.FindHeroDataModel().UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL;
                var          wantedStrengthenLv = packBtnType == PackBtnType.Strength?
                                                  selectedEquip.equipmentEntity.EQUIP_FIELD_STRONGE_LEVEL + 1
                                                :selectedEquip.equipmentEntity.EQUIP_FIELD_START_LEVEL + 1;
                if (playerLv < wantedStrengthenLv)
                {
//					IDS_I3_55	强化等级不能高于自身等级。
//						IDS_I3_56	星阶等级不能高于自身等级。
                    string tipsIDS = packBtnType == PackBtnType.Strength?"IDS_I3_55":"IDS_I3_56";
                    MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString(tipsIDS), 1);
                }
                else
                {
                    var byStrengthType = (byte)(packBtnType == PackBtnType.Strength?Equipment_Strength_Type.EQUIPMENT_NORMAL_STRENGTH_TYPE:Equipment_Strength_Type.EQUIPMENT_START_STRENGTH_TYPE);

                    SMsgGoodsOperateEquipmentStrength sMsgGoodsOperateEquipmentStrength = new SMsgGoodsOperateEquipmentStrength();
                    sMsgGoodsOperateEquipmentStrength.byStrengthType = byStrengthType;
                    sMsgGoodsOperateEquipmentStrength.dGoodsID       = (uint)selectedEquip.LocalItemData._goodID;
                    sMsgGoodsOperateEquipmentStrength.uidGoods       = selectedEquip.equipmentEntity.SMsg_Header.uidEntity;
                    NetServiceManager.Instance.EquipStrengthenService.SendGoodsOperateEquipmentStrengthCommand(sMsgGoodsOperateEquipmentStrength);
                    m_isStrengthBack  = false;
                    m_currStrenghType = packBtnType;
                }
            }
            else
            {
                //Tips系统  提示  升星 "材料不足"  / 强化 到快速购买
                if (packBtnType == PackBtnType.StarUpgrade)
                {
                    MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_I3_54"), 1);
                }
                else
                {
//					MessageBox.Instance.Show(1,"", LanguageTextManager.GetString("IDS_I3_50"),LanguageTextManager.GetString("IDS_I3_44"),LanguageTextManager.GetString("IDS_I3_61")
//					                         ,()=>{SoundManager.Instance.PlaySoundEffect("Sound_Button_Equipment_Cancel");MessageBox.Instance.CloseMsgBox();}
//					,()=>{SoundManager.Instance.PlaySoundEffect("Sound_Button_Equipment_Confirm");
//					//TODO  打开快速购买界面
//					});
                    MessageBox.Instance.ShowNotEnoughMoneyMsg(() => { SoundManager.Instance.PlaySoundEffect("Sound_Button_Equipment_Cancel"); MessageBox.Instance.CloseMsgBox(); });
                }
            }
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    ///    强化/升星
    /// </summary>
    void EquipStrength()
    {
        int ItemId;
        var m_isConsumeEnough = ContainerInfomanager.Instance.HasEnoughMaterial(EquipmentUpgradeDataManger.Instance.CurrentType, EquipmentUpgradeDataManger.Instance.CurrentSelectEquip, out ItemId);

        //SoundManager.Instance.PlaySoundEffect("Sound_Button_Equipment_Click");
        if (m_isStrengthBack)
        {
            if (m_isConsumeEnough)
            {
                ItemFielInfo selectedEquip = EquipmentUpgradeDataManger.Instance.CurrentSelectEquip;
                var          playerLv      = PlayerManager.Instance.FindHeroDataModel().UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL;
                int          wantedStrengthenLv;
                if (EquipmentUpgradeDataManger.Instance.CurrentType == UpgradeType.Strength)
                {
                    wantedStrengthenLv = PlayerDataManager.Instance.GetEquipmentStrengthLevel((EquiptSlotType)selectedEquip.sSyncContainerGoods_SC.nPlace) + 1;
                }
                else
                {
                    wantedStrengthenLv = PlayerDataManager.Instance.GetEquipmentStarLevel((EquiptSlotType)selectedEquip.sSyncContainerGoods_SC.nPlace) + 1;
                }
                if (playerLv < wantedStrengthenLv)
                {
                    //                  IDS_I3_55   强化等级不能高于自身等级。
                    //                      IDS_I3_56   星阶等级不能高于自身等级。
                    string tipsIDS = EquipmentUpgradeDataManger.Instance.CurrentType == UpgradeType.Strength?"IDS_I3_55":"IDS_I3_56";
                    MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString(tipsIDS), 1);
                }
                else
                {
                    byte byStrengthType;
                    if (EquipmentUpgradeDataManger.Instance.CurrentType == UpgradeType.Strength)
                    {
                        byStrengthType = (byte)Equipment_Strength_Type.EQUIPMENT_NORMAL_STRENGTH_TYPE;
                    }
                    else
                    {
                        byStrengthType = (byte)Equipment_Strength_Type.EQUIPMENT_START_STRENGTH_TYPE;
                    }
                    SMsgGoodsOperateEquipmentStrength sMsgGoodsOperateEquipmentStrength = new SMsgGoodsOperateEquipmentStrength();
                    sMsgGoodsOperateEquipmentStrength.byStrengthType = byStrengthType;
                    sMsgGoodsOperateEquipmentStrength.dGoodsID       = (uint)selectedEquip.LocalItemData._goodID;
                    sMsgGoodsOperateEquipmentStrength.uidGoods       = selectedEquip.equipmentEntity.SMsg_Header.uidEntity;
                    NetServiceManager.Instance.EquipStrengthenService.SendGoodsOperateEquipmentStrengthCommand(sMsgGoodsOperateEquipmentStrength);
                    m_isStrengthBack = false;
                    //  m_currStrenghType=packBtnType   ;
                }
            }
            else
            {
                //Tips系统  提示  升星 "材料不足"  / 强化 到快速购买
                if (EquipmentUpgradeDataManger.Instance.CurrentType == UpgradeType.StarUp)
                {
                    MessageBox.Instance.ShowTips(3, string.Format(LanguageTextManager.GetString("IDS_I10_7"), LanguageTextManager.GetString(ItemDataManager.Instance.GetItemData(ItemId)._szGoodsName)), 1);
                }
                else
                {
                    MessageBox.Instance.ShowNotEnoughMoneyMsg(() => { SoundManager.Instance.PlaySoundEffect("Sound_Button_Equipment_Cancel"); MessageBox.Instance.CloseMsgBox(); });
                }
            }
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 发送装备强化指令
    /// </summary>
    /// <param name="sMsgGoodsOperateEquipmentStrength"></param>
    public void SendGoodsOperateEquipmentStrengthCommand(SMsgGoodsOperateEquipmentStrength sMsgGoodsOperateEquipmentStrength)
    {
        Package pkg = sMsgGoodsOperateEquipmentStrength.GeneratePackage();

        this.Request(pkg);
    }