public void SetViewNextEvolutionMonster(string monsterId, GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList userMonster)
        {
            GameWebAPI.RespDataMA_GetMonsterMS.MonsterM simple = MonsterMaster.GetMonsterMasterByMonsterId(monsterId).Simple;
            GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group  = MonsterMaster.GetMonsterMasterByMonsterGroupId(simple.monsterGroupId).Group;
            DataMng.ExperienceInfo experienceInfo = DataMng.Instance().GetExperienceInfo(0);
            MonsterData            monsterData    = new MonsterData(new GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList(userMonster)
            {
                monsterId   = monsterId,
                level       = "1",
                ex          = "0",
                levelEx     = "0",
                nextLevelEx = experienceInfo.expLevNext.ToString()
            });

            if (!string.IsNullOrEmpty(group.leaderSkillId) && "0" != group.leaderSkillId)
            {
                monsterData.userMonster.leaderSkillId = group.leaderSkillId;
                monsterData.InitSkillInfo();
            }
            StatusValue statusValue = MonsterStatusData.GetStatusValue(monsterId, "1");

            statusValue.luck = int.Parse(userMonster.luck);
            monsterData.SetStatus(statusValue);
            CMD_CharacterDetailed.DataChg = monsterData;
            GameWebAPI.RespDataMA_GetMonsterResistanceM.MonsterResistanceM resistanceMaster = MonsterResistanceData.GetResistanceMaster(monsterData.monsterM.resistanceId);
            bool active = this.AnyMatchStrongResistance(resistanceMaster, userMonster.tranceResistance, userMonster.tranceStatusAilment);

            this.nextMonsterResistanceAlert.gameObject.SetActive(active);
        }
    public void ItemIconOnTap()
    {
        if (this.numUpButtonCollider.isTouching || this.numDownButtonCollider.isTouching)
        {
            return;
        }
        MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory) int.Parse(this.exchangeInfoData.assetCategoryId);
        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory2 = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(this.exchangeInfoData.assetCategoryId);
        switch (assetCategory)
        {
        case MasterDataMng.AssetCategory.MONSTER:
            if (!string.IsNullOrEmpty(this.exchangeInfoData.monsterFixedValueId))
            {
                MonsterFixedM fixedValues = MonsterFixedData.GetMonsterFixedMaster(this.exchangeInfoData.monsterFixedValueId);
                if (fixedValues != null)
                {
                    CMD_MonsterParamPop cmd_MonsterParamPop          = GUIMain.ShowCommonDialog(null, "CMD_MonsterParamPop", null) as CMD_MonsterParamPop;
                    MonsterData         digimonData                  = MonsterDataMng.Instance().CreateMonsterDataByMID(this.exchangeInfoData.assetValue);
                    GameWebAPI.RespDataMA_GetSkillM.SkillM[] skillM  = MasterDataMng.Instance().RespDataMA_SkillM.skillM;
                    GameWebAPI.RespDataMA_GetSkillM.SkillM   skillM2 = skillM.FirstOrDefault((GameWebAPI.RespDataMA_GetSkillM.SkillM x) => x.skillGroupId == digimonData.monsterM.skillGroupId && x.skillGroupSubId == fixedValues.defaultSkillGroupSubId);
                    if (int.Parse(fixedValues.level) > int.Parse(digimonData.monsterM.maxLevel))
                    {
                        fixedValues.level = digimonData.monsterM.maxLevel;
                    }
                    int lvMAXExperienceInfo = DataMng.Instance().GetLvMAXExperienceInfo(int.Parse(fixedValues.level));
                    DataMng.ExperienceInfo experienceInfo = DataMng.Instance().GetExperienceInfo(lvMAXExperienceInfo);
                    digimonData.userMonster.luck                   = fixedValues.luck;
                    digimonData.userMonster.friendship             = "0";
                    digimonData.userMonster.level                  = fixedValues.level;
                    digimonData.userMonster.hpAbility              = fixedValues.hpAbility;
                    digimonData.userMonster.hpAbilityFlg           = fixedValues.hpAbilityFlg.ToString();
                    digimonData.userMonster.attackAbility          = fixedValues.attackAbility;
                    digimonData.userMonster.attackAbilityFlg       = fixedValues.attackAbilityFlg.ToString();
                    digimonData.userMonster.defenseAbility         = fixedValues.defenseAbility;
                    digimonData.userMonster.defenseAbilityFlg      = fixedValues.defenseAbilityFlg.ToString();
                    digimonData.userMonster.spAttackAbility        = fixedValues.spAttackAbility;
                    digimonData.userMonster.spAttackAbilityFlg     = fixedValues.spAttackAbilityFlg.ToString();
                    digimonData.userMonster.spDefenseAbility       = fixedValues.spDefenseAbility;
                    digimonData.userMonster.spDefenseAbilityFlg    = fixedValues.spDefenseAbilityFlg.ToString();
                    digimonData.userMonster.speedAbility           = fixedValues.speedAbility;
                    digimonData.userMonster.speedAbilityFlg        = fixedValues.speedAbilityFlg.ToString();
                    digimonData.userMonster.commonSkillId          = fixedValues.commonSkillId;
                    digimonData.userMonster.leaderSkillId          = fixedValues.leaderSkillId;
                    digimonData.userMonster.defaultSkillGroupSubId = fixedValues.defaultSkillGroupSubId;
                    digimonData.userMonster.uniqueSkillId          = skillM2.skillId;
                    digimonData.InitSkillInfo();
                    cmd_MonsterParamPop.MonsterDataSet(digimonData, experienceInfo, int.Parse(this.exchangeInfoData.maxExtraSlotNum), this.exchangeItemData.eventExchangeId);
                }
            }
            break;

        case MasterDataMng.AssetCategory.DIGI_STONE:
            CMD_QuestItemPOP.Create(assetCategory2);
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            CMD_QuestItemPOP.Create(assetCategory2);
            break;

        case MasterDataMng.AssetCategory.TIP:
            CMD_QuestItemPOP.Create(assetCategory2);
            break;

        default:
            switch (assetCategory)
            {
            case MasterDataMng.AssetCategory.SOUL:
            {
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(this.exchangeInfoData.assetValue);
                CMD_QuestItemPOP.Create(soul);
                break;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
            {
                FacilityConditionM[] facilityCondition         = FarmDataManager.GetFacilityCondition(this.exchangeInfoData.assetValue);
                FacilityConditionM   facilityConditionM        = facilityCondition.FirstOrDefault((FacilityConditionM x) => int.Parse(x.conditionType) == 1);
                FacilityM            facilityMasterByReleaseId = FarmDataManager.GetFacilityMasterByReleaseId(facilityConditionM.releaseId);
                CMD_QuestItemPOP.Create(facilityConditionM, this.exchangeInfoData.assetValue, facilityMasterByReleaseId);
                break;
            }

            case MasterDataMng.AssetCategory.CHIP:
            {
                GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(this.exchangeInfoData.assetValue);
                CMD_QuestItemPOP.Create(chipMainData);
                break;
            }

            case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            {
                string ticketValue = this.exchangeInfoData.assetValue;
                GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM data = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => x.dungeonTicketId == ticketValue);
                CMD_QuestItemPOP.Create(data);
                break;
            }
            }
            break;

        case MasterDataMng.AssetCategory.ITEM:
        {
            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(this.exchangeInfoData.assetValue);
            CMD_QuestItemPOP.Create(itemM);
            break;
        }
        }
    }
Exemple #3
0
        public static CommonDialog CreateForExchange(string assetCategoryId, string assetValue, string monsterFixedValueId, string maxExtraSlotNum, string eventExchangeId)
        {
            CommonDialog commonDialog = null;
            int          num;

            if (int.TryParse(assetCategoryId, out num))
            {
                FactoryAssetCategoryDetailPopup.PopupCreator popCreator = FactoryAssetCategoryDetailPopup.GetPopCreator(num);
                commonDialog = popCreator.func(assetCategoryId, assetValue);
                if (null != commonDialog && num == 1 && !string.IsNullOrEmpty(monsterFixedValueId))
                {
                    CMD_MonsterParamPop cmd_MonsterParamPop = commonDialog as CMD_MonsterParamPop;
                    if (null != cmd_MonsterParamPop)
                    {
                        MonsterFixedM monsterFixedMaster = MonsterFixedData.GetMonsterFixedMaster(monsterFixedValueId);
                        if (monsterFixedMaster != null)
                        {
                            MonsterData monsterData = MonsterDataMng.Instance().CreateMonsterDataByMID(assetValue);
                            GameWebAPI.RespDataMA_GetSkillM        respDataMA_SkillM = MasterDataMng.Instance().RespDataMA_SkillM;
                            GameWebAPI.RespDataMA_GetSkillM.SkillM skillM            = null;
                            foreach (GameWebAPI.RespDataMA_GetSkillM.SkillM skillM3 in respDataMA_SkillM.skillM)
                            {
                                if (skillM3.skillGroupId == monsterData.monsterM.skillGroupId && skillM3.skillGroupSubId == monsterFixedMaster.defaultSkillGroupSubId)
                                {
                                    skillM = skillM3;
                                    break;
                                }
                            }
                            if (int.Parse(monsterFixedMaster.level) > int.Parse(monsterData.monsterM.maxLevel))
                            {
                                monsterFixedMaster.level = monsterData.monsterM.maxLevel;
                            }
                            int lvMAXExperienceInfo = DataMng.Instance().GetLvMAXExperienceInfo(int.Parse(monsterFixedMaster.level));
                            DataMng.ExperienceInfo experienceInfo = DataMng.Instance().GetExperienceInfo(lvMAXExperienceInfo);
                            monsterData.userMonster.luck                   = monsterFixedMaster.luck;
                            monsterData.userMonster.friendship             = "0";
                            monsterData.userMonster.level                  = monsterFixedMaster.level;
                            monsterData.userMonster.hpAbility              = monsterFixedMaster.hpAbility;
                            monsterData.userMonster.hpAbilityFlg           = monsterFixedMaster.hpAbilityFlg.ToString();
                            monsterData.userMonster.attackAbility          = monsterFixedMaster.attackAbility;
                            monsterData.userMonster.attackAbilityFlg       = monsterFixedMaster.attackAbilityFlg.ToString();
                            monsterData.userMonster.defenseAbility         = monsterFixedMaster.defenseAbility;
                            monsterData.userMonster.defenseAbilityFlg      = monsterFixedMaster.defenseAbilityFlg.ToString();
                            monsterData.userMonster.spAttackAbility        = monsterFixedMaster.spAttackAbility;
                            monsterData.userMonster.spAttackAbilityFlg     = monsterFixedMaster.spAttackAbilityFlg.ToString();
                            monsterData.userMonster.spDefenseAbility       = monsterFixedMaster.spDefenseAbility;
                            monsterData.userMonster.spDefenseAbilityFlg    = monsterFixedMaster.spDefenseAbilityFlg.ToString();
                            monsterData.userMonster.speedAbility           = monsterFixedMaster.speedAbility;
                            monsterData.userMonster.speedAbilityFlg        = monsterFixedMaster.speedAbilityFlg.ToString();
                            monsterData.userMonster.commonSkillId          = monsterFixedMaster.commonSkillId;
                            monsterData.userMonster.leaderSkillId          = monsterFixedMaster.leaderSkillId;
                            monsterData.userMonster.defaultSkillGroupSubId = monsterFixedMaster.defaultSkillGroupSubId;
                            monsterData.userMonster.uniqueSkillId          = skillM.skillId;
                            monsterData.InitSkillInfo();
                            cmd_MonsterParamPop.MonsterDataSet(monsterData, experienceInfo, int.Parse(maxExtraSlotNum), eventExchangeId);
                        }
                    }
                }
            }
            return(commonDialog);
        }