Пример #1
0
    public List <KStruct> GetAwardDataByID(int awardID)
    {
        List <KStruct> list = new List <KStruct>();
        DAward         db   = ReadCfgAward.GetDataById(awardID);

        if (db == null)
        {
            return(null);
        }
        switch (db.DropType)
        {
        case EDropType.MULFIX:
            CalcMulFixItem(ref list, db.DropItems);
            break;

        case EDropType.ONERAN:
            CalcOneRanItem(ref list, db.DropItems);
            break;

        case EDropType.MULRAN:
            CalcMulFixItem(ref list, db.DropItems);
            break;
        }
        return(list);
    }
Пример #2
0
    public void TryReceiveReward(ECopyType copyType, int chapter, int awardIndex)
    {
        if (awardIndex < 0 || awardIndex > 2)
        {
            GTItemHelper.ShowTip("非法AwardIndex" + awardIndex);
            return;
        }
        int rewardState = RaidModule.Instance.GetChapterRewardStateByAwardIndex(chapter, awardIndex);

        switch (rewardState)
        {
        case ERewardState.NOT_RECEIVE:
            GTItemHelper.ShowTip("未达成条件");
            return;

        case ERewardState.HAS_RECEIVE:
            GTItemHelper.ShowTip("奖励已领取");
            return;
        }
        DWorld chapterDB = ReadCfgWorld.GetDataById(chapter);
        DAward awardDB   = ReadCfgAward.GetDataById(chapterDB.Awards[awardIndex]);

        if (GTItemHelper.CheckBagFull(awardDB.MaxDropNum))
        {
            return;
        }

        ReqGetChapterAward req = new ReqGetChapterAward();

        req.CopyType = (int)copyType;
        req.Chapter  = chapter;
        req.Index    = awardIndex;
        NetworkManager.Instance.Send <ReqGetChapterAward>(MessageID.MSG_REQ_GET_CHAPTERAWARD, req);
    }
Пример #3
0
    public void ShowAwardById(int award, int rewardState, UIEventListener.VoidDelegate doReceive)
    {
        List <KStruct> list = AwardModule.Instance.GetAwardDataByID(award);
        DAward         db   = ReadCfgAward.GetDataById(award);

        for (int i = 0; i < items.Count; i++)
        {
            Item it = items[i];
            if (i < list.Count)
            {
                KStruct vo = list[i];
                it.itemBtn.SetActive(true);
                it.itemNum.text = vo.Num > 1 ? vo.Num.ToString() : string.Empty;
                GTItemHelper.ShowItemTexture(it.itemTexture, vo.Id);
                GTItemHelper.ShowItemQuality(it.itemQuality, vo.Id);
                GTItemHelper.ShowItemName(it.itemName, vo.Id);
                DItem itemDB = ReadCfgItem.GetDataById(vo.Id);
                it.chip.SetActive(itemDB.ItemType == EItemType.CHIP);
            }
            else
            {
                it.itemBtn.SetActive(false);
            }
        }

        switch (rewardState)
        {
        case ERewardState.NOT_RECEIVE:
            btnReceive.GetComponent <UISprite>().color = Color.black;
            btnReceive.transform.Find("Label").GetComponent <UILabel>().text = "领取";
            break;

        case ERewardState.CAN_RECEIVE:
            btnReceive.GetComponent <UISprite>().color = Color.white;
            btnReceive.transform.Find("Label").GetComponent <UILabel>().text = "领取";
            break;

        case ERewardState.HAS_RECEIVE:
            btnReceive.GetComponent <UISprite>().color = Color.black;
            btnReceive.transform.Find("Label").GetComponent <UILabel>().text = "已领取";
            break;
        }
        labTitle.text = db.Name;
        DoReceive     = doReceive;
    }
Пример #4
0
    public void TryMainCopyReceiveReward(int chapter, int index)
    {
        ERewardState rewardState = MLRaid.Instance.GetChapterRewardStateByAwardIndex(chapter, index);

        switch (rewardState)
        {
        case ERewardState.NOT_RECEIVE:
            GTItemHelper.ShowTip("未达成条件");
            return;

        case ERewardState.HAS_RECEIVE:
            GTItemHelper.ShowTip("奖励已领取");
            return;
        }
        DCopyMainChapter chapterDB = ReadCfgCopyMainChapter.GetDataById(chapter);
        DAward           awardDB   = ReadCfgAward.GetDataById(chapterDB.Awards[index]);

        if (GTItemHelper.CheckBagFull(awardDB.MaxDropNum))
        {
            return;
        }
    }
Пример #5
0
    public void TryUseItemByPos(int pos, int num)
    {
        XItem item = DataDBSBagItem.GetDataById(pos);

        if (item.Num < num)
        {
            GTItemHelper.ShowTip("物品不足");
            return;
        }
        DItem itemDB = ReadCfgItem.GetDataById(item.Id);

        if (itemDB.ItemType == EItemType.BOX)
        {
            if (itemDB.Data1 != 0)
            {
                if (GTDataManager.Instance.GetItemCountById(itemDB.Data1) < num)
                {
                    GTItemHelper.ShowTip("需要足够的钥匙");
                    return;
                }
            }
            DAward awardDB = ReadCfgAward.GetDataById(itemDB.Data2);
            if (GTItemHelper.CheckBagFull(awardDB.MaxDropNum))
            {
                return;
            }
        }

        ReqUseItem req = new ReqUseItem();

        req.Pos     = pos;
        req.Num     = num;
        req.PosType = (int)EPosType.BagItem;
        req.ID      = item.Id;
        NetworkManager.Instance.Send <ReqUseItem>(MessageID.MSG_REQ_USEITEM, req);
    }
Пример #6
0
    public override void Init()
    {
        ReadCfgLocalString.Read("Text/Local/Data_LocalString");
        ReadCfgCurve.Read("Text/Local/Data_Curve");

        ReadCfgStageMount.Read("Text/Local/Data_StageMount");
        ReadCfgStagePartner.Read("Text/Local/Data_StagePartner");
        ReadCfgStagePet.Read("Text/Local/Data_StagePet");
        ReadCfgStageRelics.Read("Text/Local/Data_StageRelics");
        ReadCfgStageRole.Read("Text/Local/Data_StageRole");

        ReadCfgSearch.Read("Text/Local/Data_Search");
        ReadCfgRandomName.Read("Text/Local/Data_RandomNames");

        ReadCfgProperty.Read("Text/Data/Data_Property");
        ReadCfgQuality.Read("Text/Data/Data_Quality");

        ReadCfgItem.Read("Text/Data/Data_Item");
        ReadCfgEquip.Read("Text/Data/Data_Equip");
        ReadCfgAction.Read("Text/Data/Data_Action");

        ReadCfgRole.Read("Text/Data/Data_Role");
        ReadCfgRoleLevel.Read("Text/Data/Data_RoleLevel");

        ReadCfgEquip.Read("Text/Data/Data_Equip");
        ReadCfgEquipAdvance.Read("Text/Data/Data_EquipAdvance");
        ReadCfgEquipAdvanceCost.Read("Text/Data/Data_EquipAdvanceCost");
        ReadCfgEquipStreng.Read("Text/Data/Data_EquipStrengthen");
        ReadCfgEquipStrengLevel.Read("Text/Data/Data_EquipStrengthenLevel");
        ReadCfgEquipStar.Read("Text/Data/Data_EquipStar");
        ReadCfgEquipSuit.Read("Text/Data/Data_EquipSuit");

        ReadCfgGem.Read("Text/Data/Data_Gem");
        ReadCfgGemLevel.Read("Text/Data/Data_GemLevel");
        ReadCfgGemSuit.Read("Text/Data/Data_GemSuit");

        ReadCfgAward.Read("Text/Data/Data_Award");

        ReadCfgCopyMainChapter.Read("Text/Data/Data_CopyMainChapter");
        ReadCfgCopy.Read("Text/Data/Data_Copy");

        ReadCfgEffect.Read("Text/Data/Data_Effect");
        ReadCfgRelics.Read("Text/Data/Data_Relics");
        ReadCfgMachine.Read("Text/Data/Data_Machine");

        ReadCfgActorGroup.Read("Text/Data/Data_ActorGroup");
        ReadCfgActor.Read("Text/Data/Data_Actor");
        ReadCfgActorRace.Read("Text/Data/Data_ActorRace");
        ReadCfgActorModel.Read("Text/Data/Data_ActorModel");

        ReadCfgStore.Read("Text/Data/Data_Store");
        ReadCfgStoreType.Read("Text/Data/Data_StoreType");

        ReadCfgPet.Read("Text/Data/Data_Pet");
        ReadCfgPetLevel.Read("Text/Data/Data_PetLevel");

        ReadCfgPartner.Read("Text/Data/Data_Partner");
        ReadCfgPartnerLevel.Read("Text/Data/Data_PartnerLevel");
        ReadCfgPartnerWake.Read("Text/Data/Data_PartnerWake");
        ReadCfgPartnerAdvance.Read("Text/Data/Data_PartnerAdvance");
        ReadCfgPartnerWash.Read("Text/Data/Data_PartnerWash");
        ReadCfgPartnerFetter.Read("Text/Data/Data_PartnerFetter");
        ReadCfgPartnerStar.Read("Text/Data/Data_PartnerStar");

        ReadCfgTask.Read("Text/Data/Data_Task");
        ReadCfgAdventure.Read("Text/Data/Data_Adventure");
        ReadCfgSkillTalent.Read("Text/Data/Data_SkillTalent");
        ReadCfgMine.Read("Text/Data/Data_Mine");
        ReadCfgSkill.Read("Text/Data/Data_Skill");
        ReadCfgVideo.Read("Text/Data/Data_Video");
        ReadCfgDialogue.Read("Text/Data/Data_Dialogue");

        ActBuffSystem.Read("Text/Buff/Buff");
    }