Beispiel #1
0
    /// <summary>
    /// 获取金钱详情
    /// </summary>
    /// <param name="rewardTypeData"></param>
    /// <param name="iconDataManager"></param>
    /// <returns></returns>
    private static RewardTypeBean GetRewardDetailsForAddMoney(RewardTypeBean rewardTypeData)
    {
        string iconKey        = "";
        string rewardDescribe = "???";

        switch (rewardTypeData.dataType)
        {
        case RewardTypeEnum.AddMoneyL:
            iconKey        = "money_3";
            rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6002), rewardTypeData.data);
            break;

        case RewardTypeEnum.AddMoneyM:
            iconKey        = "money_2";
            rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6003), rewardTypeData.data);
            break;

        case RewardTypeEnum.AddMoneyS:
            iconKey        = "money_1";
            rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6004), rewardTypeData.data);
            break;
        }
        rewardTypeData.spRewardIcon   = IconDataHandler.Instance.manager.GetIconSpriteByName(iconKey);
        rewardTypeData.rewardDescribe = rewardDescribe;
        rewardTypeData.rewardNumber   = int.Parse(rewardTypeData.data);
        return(rewardTypeData);
    }
Beispiel #2
0
    protected static RewardTypeBean GetRandomRewardForData(List <CharacterBean> listEnemyData, RewardTypeEnum rewardType, string rewardListStr)
    {
        if (CheckUtil.StringIsNull(rewardListStr))
        {
            return(null);
        }
        List <string> listReward   = StringUtil.SplitBySubstringForListStr(rewardListStr, '|');
        string        randomReward = RandomUtil.GetRandomDataByList(listReward);
        string        rewardDataStr;

        if (randomReward.Equals("Skills"))
        {
            //如果没有传入敌人则不获取技能
            if (CheckUtil.ListIsNull(listEnemyData))
            {
                return(GetRandomRewardForData(listEnemyData, rewardType, rewardListStr));
            }
            List <long> listSkills = new List <long>();
            for (int i = 0; i < listEnemyData.Count; i++)
            {
                CharacterBean characterData = listEnemyData[i];
                listSkills.AddRange(characterData.attributes.listSkills);
            }
            long randomSkill = RandomUtil.GetRandomDataByList(listSkills);
            rewardDataStr = (1400000 + randomSkill) + "";
        }
        else
        {
            rewardDataStr = randomReward;
        }
        RewardTypeBean rewardData = new RewardTypeBean(rewardType, rewardDataStr);

        return(rewardData);
    }
Beispiel #3
0
    protected static void CompleteRewardForAddChild(RewardTypeBean rewardTypeData)
    {
        GameDataBean   gameData   = GameDataHandler.Instance.manager.GetGameData();
        FamilyDataBean familyData = gameData.GetFamilyData();

        familyData.CreateChild(rewardTypeData.data, gameData.userCharacter, familyData.mateCharacter);
    }
Beispiel #4
0
    public void Submit(DialogView dialogView, DialogBean dialogBean)
    {
        InputTextDialogView inputTextDialog = dialogView as InputTextDialogView;

        AudioHandler.Instance.PlaySound(AudioSoundEnum.Reward);
        RewardTypeBean rewardTypeData = new RewardTypeBean();

        rewardTypeData.dataType = RewardTypeEnum.AddChild;
        rewardTypeData.data     = inputTextDialog.GetText();
        miniGameData.listReward.Add(rewardTypeData);
        base.EndGame(MiniGameResultEnum.Win, false);
    }
Beispiel #5
0
    /// <summary>
    /// 获取食材的奖励详情
    /// </summary>
    /// <param name="rewardTypeData"></param>
    /// <param name="ingName"></param>
    /// <returns></returns>
    private static RewardTypeBean GetRewardDetailsForIng(RewardTypeBean rewardTypeData)
    {
        string ingName = "???";
        Sprite spIcon  = null;

        switch (rewardTypeData.dataType)
        {
        case RewardTypeEnum.AddIngOilsalt:
            ingName = TextHandler.Instance.manager.GetTextById(21);
            spIcon  = IngredientsEnumTools.GetIngredientIcon(IngredientsEnum.Oilsalt);
            break;

        case RewardTypeEnum.AddIngMeat:
            ingName = TextHandler.Instance.manager.GetTextById(22);
            spIcon  = IngredientsEnumTools.GetIngredientIcon(IngredientsEnum.Meat);
            break;

        case RewardTypeEnum.AddIngRiverfresh:
            ingName = TextHandler.Instance.manager.GetTextById(23);
            spIcon  = IngredientsEnumTools.GetIngredientIcon(IngredientsEnum.Riverfresh);
            break;

        case RewardTypeEnum.AddIngSeafood:
            ingName = TextHandler.Instance.manager.GetTextById(24);
            spIcon  = IngredientsEnumTools.GetIngredientIcon(IngredientsEnum.Seafood);
            break;

        case RewardTypeEnum.AddIngVegetables:
            ingName = TextHandler.Instance.manager.GetTextById(25);
            spIcon  = IngredientsEnumTools.GetIngredientIcon(IngredientsEnum.Vegetables);
            break;

        case RewardTypeEnum.AddIngMelonfruit:
            ingName = TextHandler.Instance.manager.GetTextById(26);
            spIcon  = IngredientsEnumTools.GetIngredientIcon(IngredientsEnum.Melonfruit);
            break;

        case RewardTypeEnum.AddIngWaterwine:
            ingName = TextHandler.Instance.manager.GetTextById(27);
            spIcon  = IngredientsEnumTools.GetIngredientIcon(IngredientsEnum.Waterwine);
            break;

        case RewardTypeEnum.AddIngFlour:
            ingName = TextHandler.Instance.manager.GetTextById(28);
            spIcon  = IngredientsEnumTools.GetIngredientIcon(IngredientsEnum.Flour);
            break;
        }
        rewardTypeData.rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6010), ingName, rewardTypeData.data);
        rewardTypeData.rewardNumber   = int.Parse(rewardTypeData.data);
        rewardTypeData.spRewardIcon   = spIcon;
        return(rewardTypeData);
    }
Beispiel #6
0
    /// <summary>
    /// 获取随机道具的奖励详情
    /// </summary>
    /// <param name="data"></param>
    /// <param name="iconDataManager"></param>
    /// <param name="gameItemsManager"></param>
    /// <returns></returns>
    private static RewardTypeBean GetRewardDetailsForRandomItems(RewardTypeBean data)
    {
        long[]        listItemsData = StringUtil.SplitBySubstringForArrayLong(data.data, ',');
        long          randomItemsId = RandomUtil.GetRandomDataByArray(listItemsData);
        ItemsInfoBean itemsInfo     = GameItemsHandler.Instance.manager.GetItemsById(randomItemsId);

        data.rewardDescribe  = itemsInfo.name;
        data.rewardNumber    = 1;
        data.rewardId        = randomItemsId;
        data.rewardDescribe += (" x" + data.rewardNumber);
        data.spRewardIcon    = GeneralEnumTools.GetGeneralSprite(itemsInfo, true);
        return(data);
    }
Beispiel #7
0
    /// <summary>
    /// 获取建筑数据详情
    /// </summary>
    /// <param name="data"></param>
    /// <param name="iconDataManager"></param>
    /// <param name="innBuildManager"></param>
    /// <returns></returns>
    private static RewardTypeBean GetRewardDetailsForBuildItems(RewardTypeBean data)
    {
        string[]      listBuildItemsData = StringUtil.SplitBySubstringForArrayStr(data.data, ',');
        long          buildItemId        = long.Parse(listBuildItemsData[0]);
        BuildItemBean buildItemInfo      = InnBuildHandler.Instance.manager.GetBuildDataById(buildItemId);

        data.rewardDescribe = buildItemInfo.name;
        if (listBuildItemsData.Length == 2)
        {
            data.rewardNumber = int.Parse(listBuildItemsData[1]);
        }
        data.rewardId        = buildItemId;
        data.rewardDescribe += (" x" + data.rewardNumber);
        data.spRewardIcon    = BuildItemTypeEnumTools.GetBuildItemSprite(buildItemInfo);
        return(data);
    }
Beispiel #8
0
    /// <summary>
    /// 获取道具的奖励详情
    /// </summary>
    /// <param name="data"></param>
    /// <param name="iconDataManager"></param>
    /// <param name="gameItemsManager"></param>
    /// <returns></returns>
    private static RewardTypeBean GetRewardDetailsForItems(RewardTypeBean data)
    {
        string[] listItemsData = StringUtil.SplitBySubstringForArrayStr(data.data, ',');
        long     itemId        = long.Parse(listItemsData[0]);

        ItemsInfoBean itemsInfo = GameItemsHandler.Instance.manager.GetItemsById(itemId);

        data.rewardDescribe = itemsInfo.name;
        if (listItemsData.Length == 2)
        {
            data.rewardNumber = int.Parse(listItemsData[1]);
        }
        data.rewardId        = itemId;
        data.rewardDescribe += (" x" + data.rewardNumber);
        data.spRewardIcon    = GeneralEnumTools.GetGeneralSprite(itemsInfo, true);
        return(data);
    }
Beispiel #9
0
    /// <summary>
    /// 获取奖杯详情
    /// </summary>
    /// <param name="rewardTypeData"></param>
    /// <param name="iconDataManager"></param>
    /// <returns></returns>
    private static RewardTypeBean GetRewardDetailsForAddTrophy(RewardTypeBean rewardTypeData)
    {
        string iconKey        = "";
        string rewardDescribe = "???";

        int[] listData = StringUtil.SplitBySubstringForArrayInt(rewardTypeData.data, ',');
        switch (rewardTypeData.dataType)
        {
        case RewardTypeEnum.AddArenaTrophyElementary:
            iconKey        = "trophy_1_0";
            rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6006), listData[0] + "");
            break;

        case RewardTypeEnum.AddArenaTrophyIntermediate:
            iconKey        = "trophy_1_1";
            rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6007), listData[0] + "");
            break;

        case RewardTypeEnum.AddArenaTrophyAdvanced:
            iconKey        = "trophy_1_2";
            rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6008), listData[0] + "");
            break;

        case RewardTypeEnum.AddArenaTrophyLegendary:
            iconKey        = "trophy_1_3";
            rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6009), listData[0] + "");
            break;
        }
        rewardTypeData.spRewardIcon   = IconDataHandler.Instance.manager.GetIconSpriteByName(iconKey);
        rewardTypeData.rewardDescribe = rewardDescribe;
        rewardTypeData.rewardNumber   = listData[0];
        if (listData.Length > 1)
        {
            int isRecord = listData[1];
            rewardTypeData.isRecord = (isRecord == 0 ? false : true);
        }
        return(rewardTypeData);
    }
Beispiel #10
0
    protected static RewardTypeBean GetRewardDetailsForWorkerExp(RewardTypeBean rewardTypeData)
    {
        Sprite spriteIcon     = null;
        string rewardDescribe = "???";

        switch (rewardTypeData.dataType)
        {
        case RewardTypeEnum.AddChefExp:
            spriteIcon     = WorkerEnumTools.GetWorkerSprite(WorkerEnum.Chef);
            rewardDescribe = WorkerEnumTools.GetWorkerName(WorkerEnum.Chef) + string.Format(TextHandler.Instance.manager.GetTextById(6021), rewardTypeData.data);
            break;

        case RewardTypeEnum.AddWaiterExp:
            spriteIcon     = WorkerEnumTools.GetWorkerSprite(WorkerEnum.Waiter);
            rewardDescribe = WorkerEnumTools.GetWorkerName(WorkerEnum.Waiter) + string.Format(TextHandler.Instance.manager.GetTextById(6021), rewardTypeData.data);
            break;

        case RewardTypeEnum.AddAccountantExp:
            spriteIcon     = WorkerEnumTools.GetWorkerSprite(WorkerEnum.Accountant);
            rewardDescribe = WorkerEnumTools.GetWorkerName(WorkerEnum.Accountant) + string.Format(TextHandler.Instance.manager.GetTextById(6021), rewardTypeData.data);
            break;

        case RewardTypeEnum.AddAccostExp:
            spriteIcon     = WorkerEnumTools.GetWorkerSprite(WorkerEnum.Accost);
            rewardDescribe = WorkerEnumTools.GetWorkerName(WorkerEnum.Accost) + string.Format(TextHandler.Instance.manager.GetTextById(6021), rewardTypeData.data);
            break;

        case RewardTypeEnum.AddBeaterExp:
            spriteIcon     = WorkerEnumTools.GetWorkerSprite(WorkerEnum.Beater);
            rewardDescribe = WorkerEnumTools.GetWorkerName(WorkerEnum.Beater) + string.Format(TextHandler.Instance.manager.GetTextById(6021), rewardTypeData.data);
            break;
        }
        rewardTypeData.spRewardIcon   = spriteIcon;
        rewardTypeData.rewardDescribe = rewardDescribe;
        rewardTypeData.rewardNumber   = int.Parse(rewardTypeData.data);
        return(rewardTypeData);
    }
Beispiel #11
0
    /// <summary>
    /// 创建迷你游戏数据
    /// </summary>
    /// <returns></returns>
    private List<MiniGameBaseBean> CreateMiniGameData(TrophyTypeEnum type)
    {
        List<MiniGameBaseBean> listMiniGameData = new List<MiniGameBaseBean>();
        int arenaNumber = UnityEngine.Random.Range(5, 15);
        for (int i = 0; i < arenaNumber; i++)
        {
            MiniGameEnum gameType = MiniGameEnumTools.GetRandomMiniGameTypeForArena();
            StoreInfoBean storeInfo = null;

            MiniGameBaseBean miniGameData = MiniGameEnumTools.GetMiniGameData(gameType);
            miniGameData.gameReason = MiniGameReasonEnum.Fight;
            switch (gameType)
            {
                case MiniGameEnum.Cooking:
                    storeInfo = GetStoreInfoByTypeAndWorker(type, WorkerEnum.Chef);
                    miniGameData = CreateCookingGameData((MiniGameCookingBean)miniGameData, storeInfo, type);
                    break;
                case MiniGameEnum.Barrage:
                    storeInfo = GetStoreInfoByTypeAndWorker(type, WorkerEnum.Waiter);
                    miniGameData = CreateBarrageGameData((MiniGameBarrageBean)miniGameData, storeInfo, type);
                    break;
                case MiniGameEnum.Account:
                    storeInfo = GetStoreInfoByTypeAndWorker(type, WorkerEnum.Accountant);
                    miniGameData = CreateAccountGameData((MiniGameAccountBean)miniGameData, storeInfo, type);
                    break;
                case MiniGameEnum.Debate:
                    storeInfo = GetStoreInfoByTypeAndWorker(type, WorkerEnum.Accost);
                    miniGameData = CreateDebateGameData((MiniGameDebateBean)miniGameData, storeInfo, type);
                    break;
                case MiniGameEnum.Combat:
                    storeInfo = GetStoreInfoByTypeAndWorker(type, WorkerEnum.Beater);
                    miniGameData = CreateCombatGameData((MiniGameCombatBean)miniGameData, storeInfo, type);
                    break;
            }
            PreTypeForMiniGameEnumTools.GetMiniGameData(miniGameData, storeInfo.pre_data_minigame);
            //奖励添加
            miniGameData.listReward = new List<RewardTypeBean>();
            List<RewardTypeBean> listReward = RewardTypeEnumTools.GetListRewardData(storeInfo.reward_data);
            //固定奖励
            List<RewardTypeBean> listFixedReward = new List<RewardTypeBean>();
            //随机奖励
            List<RewardTypeBean> listRandomReward = new List<RewardTypeBean>();
            foreach (RewardTypeBean itemReward in listReward)
            {
                switch (itemReward.GetRewardType())
                {
                    case RewardTypeEnum.AddMoneyL:
                    case RewardTypeEnum.AddMoneyM:
                    case RewardTypeEnum.AddMoneyS:
                    case RewardTypeEnum.AddArenaTrophyElementary:
                    case RewardTypeEnum.AddArenaTrophyIntermediate:
                    case RewardTypeEnum.AddArenaTrophyAdvanced:
                    case RewardTypeEnum.AddArenaTrophyLegendary:
                        if (miniGameData.winBringDownNumber > 0)
                        {
                            //针对多人战 奖励提升
                            itemReward.data = long.Parse(itemReward.data) * miniGameData.winBringDownNumber + "";
                        }
                        listFixedReward.Add(itemReward);
                        break;
                    default:
                        listRandomReward.Add(itemReward);
                        break;
                }
            }
            miniGameData.listReward.AddRange(listFixedReward);
            if (!CheckUtil.ListIsNull(listRandomReward))
            {
                RewardTypeBean randomReward = RandomUtil.GetRandomDataByList(listRandomReward);
                miniGameData.listReward.Add(randomReward);
            }

            //添加对应的奖杯
            switch (type)
            {
                case TrophyTypeEnum.Elementary:
                    break;
                case TrophyTypeEnum.Intermediate:
                    break;
                case TrophyTypeEnum.Advanced:
                    break;
                case TrophyTypeEnum.Legendary:
                    break;
            }
            //设置游戏时间
            if (storeInfo.mark != null)
                miniGameData.preGameTime = int.Parse(storeInfo.mark);
            //设置前置金钱
            miniGameData.preMoneyL = storeInfo.price_l;
            miniGameData.preMoneyM = storeInfo.price_m;
            miniGameData.preMoneyS = storeInfo.price_s;
            //添加游戏数据
            listMiniGameData.Add(miniGameData);
        }
        return listMiniGameData;
    }
Beispiel #12
0
    public static RewardTypeBean GetRewardDetails(RewardTypeBean data)
    {
        switch (data.dataType)
        {
        case RewardTypeEnum.AddWorkerNumber:
            data.spRewardIcon   = IconDataHandler.Instance.manager.GetIconSpriteByName("ui_features_worker");
            data.rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6001), data.data);
            data.rewardNumber   = int.Parse(data.data);
            break;

        case RewardTypeEnum.AddWorker:
            long workerId = long.Parse(data.data);
            data.workerCharacterData = NpcInfoHandler.Instance.manager.GetCharacterDataById(workerId);
            data.rewardDescribe      = string.Format(TextHandler.Instance.manager.GetTextById(6011), data.workerCharacterData.baseInfo.name);
            break;

        case RewardTypeEnum.AddMoneyL:
        case RewardTypeEnum.AddMoneyM:
        case RewardTypeEnum.AddMoneyS:
            GetRewardDetailsForAddMoney(data);
            break;

        case RewardTypeEnum.AddGuildCoin:
            data.spRewardIcon   = IconDataHandler.Instance.manager.GetIconSpriteByName("guild_coin_2");
            data.rewardDescribe = string.Format(TextHandler.Instance.manager.GetTextById(6005), data.data);
            data.rewardNumber   = int.Parse(data.data);
            break;

        case RewardTypeEnum.AddItems:
            data = GetRewardDetailsForItems(data);
            break;

        case RewardTypeEnum.RandomAddItems:
            data = GetRewardDetailsForRandomItems(data);
            break;

        case RewardTypeEnum.AddBuildItems:
            data = GetRewardDetailsForBuildItems(data);
            break;

        case RewardTypeEnum.AddArenaTrophyElementary:
        case RewardTypeEnum.AddArenaTrophyIntermediate:
        case RewardTypeEnum.AddArenaTrophyAdvanced:
        case RewardTypeEnum.AddArenaTrophyLegendary:
            GetRewardDetailsForAddTrophy(data);
            break;

        case RewardTypeEnum.AddIngOilsalt:
        case RewardTypeEnum.AddIngMeat:
        case RewardTypeEnum.AddIngRiverfresh:
        case RewardTypeEnum.AddIngSeafood:
        case RewardTypeEnum.AddIngVegetables:
        case RewardTypeEnum.AddIngMelonfruit:
        case RewardTypeEnum.AddIngWaterwine:
        case RewardTypeEnum.AddIngFlour:
            GetRewardDetailsForIng(data);
            break;

        case RewardTypeEnum.AddChefExp:    //增加职业经验
        case RewardTypeEnum.AddWaiterExp:
        case RewardTypeEnum.AddAccountantExp:
        case RewardTypeEnum.AddAccostExp:
        case RewardTypeEnum.AddBeaterExp:
            GetRewardDetailsForWorkerExp(data);
            break;

        case RewardTypeEnum.AddChild:
            GetRewardDetailsForChild(data);
            break;
        }
        return(data);
    }
Beispiel #13
0
    /// <summary>
    /// 根据层数获取奖励
    /// </summary>
    /// <param name="layer"></param>
    /// <param name="normalBuildRate"></param>
    /// <returns></returns>
    public static List <RewardTypeBean> GetRewardItemsForInfiniteTowers(List <CharacterBean> listEnemyData, int layer, int totalLucky, bool isSend)
    {
        List <RewardTypeBean> listReward = new List <RewardTypeBean>();
        long addExp    = 0;
        long addMoneyS = 0;

        //获取稀有物品概率
        float normalBuildRate = 0.25f + 0.0025f * (totalLucky / 3f);
        float rateRate        = 0;

        if (isSend)
        {
            rateRate = 0.05f + 0.0005f * totalLucky;
        }
        else
        {
            rateRate = 0.1f + 0.0005f * totalLucky;
        }
        if (layer % 10 == 0)
        {
            //添加经验奖励
            addExp = layer * 5;
            //添加金钱奖励
            addMoneyS = layer * 50;
            //BOSS奖励
            string rewardForNormalStr      = "";
            string rewardForRareStr        = "";
            string rewardForNormalBuildStr = "";
            string rewardForRareBuildStr   = "";
            switch (layer)
            {
            case 10:
            case 20:
            case 30:
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersNormalRewardForLevel1, out rewardForNormalStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersRareRewardForLevel1, out rewardForRareStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersNormalBuildRewardForLevel1, out rewardForNormalBuildStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersRareBuildRewardForLevel1, out rewardForRareBuildStr);
                break;

            case 40:
            case 50:
            case 60:
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersNormalRewardForLevel2, out rewardForNormalStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersRareRewardForLevel2, out rewardForRareStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersNormalBuildRewardForLevel2, out rewardForNormalBuildStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersRareBuildRewardForLevel2, out rewardForRareBuildStr);
                break;

            case 70:
            case 80:
            case 90:
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersNormalRewardForLevel3, out rewardForNormalStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersRareRewardForLevel3, out rewardForRareStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersNormalBuildRewardForLevel3, out rewardForNormalBuildStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersRareBuildRewardForLevel3, out rewardForRareBuildStr);
                break;

            default:
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersNormalRewardForLevel4, out rewardForNormalStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersRareRewardForLevel4, out rewardForRareStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersNormalBuildRewardForLevel4, out rewardForNormalBuildStr);
                GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersRareBuildRewardForLevel4, out rewardForRareBuildStr);
                break;
            }
            if (!CheckUtil.StringIsNull(rewardForNormalStr))
            {
                //必定随机获得一个物品
                RewardTypeBean rewardForItems = GetRandomRewardForData(listEnemyData, RewardTypeEnum.AddItems, rewardForNormalStr);
                listReward.Add(rewardForItems);
                //有一定概率获得建筑物
                float randomTemp = UnityEngine.Random.Range(0f, 1f);
                if (!CheckUtil.StringIsNull(rewardForNormalBuildStr) && randomTemp <= normalBuildRate)
                {
                    RewardTypeBean rewardForBuild = GetRandomRewardForData(listEnemyData, RewardTypeEnum.AddBuildItems, rewardForNormalBuildStr);
                    listReward.Add(rewardForBuild);
                }
            }
            if (!CheckUtil.StringIsNull(rewardForRareStr))
            {
                //有一定概率获得稀有物品
                float randomTemp = UnityEngine.Random.Range(0f, 1f);
                if (randomTemp <= rateRate)
                {
                    RewardTypeBean rewardForItems = GetRandomRewardForData(listEnemyData, RewardTypeEnum.AddItems, rewardForRareStr);
                    listReward.Add(rewardForItems);
                }
            }
        }
        else
        {
            //添加经验奖励
            addExp = layer;
            //添加金钱奖励
            addMoneyS = layer * 5;
        }

        RewardTypeBean rewardForExp = new RewardTypeBean(RewardTypeEnum.AddBeaterExp, addExp + "");

        listReward.Add(rewardForExp);
        RewardTypeBean rewardForMoneyS = new RewardTypeBean(RewardTypeEnum.AddMoneyS, addMoneyS + "");

        listReward.Add(rewardForMoneyS);

        return(listReward);
    }
Beispiel #14
0
 /// <summary>
 /// 获取孩子的奖励详情
 /// </summary>
 /// <param name="rewardTypeData"></param>
 /// <param name="ingName"></param>
 /// <returns></returns>
 private static RewardTypeBean GetRewardDetailsForChild(RewardTypeBean data)
 {
     data.rewardDescribe = TextHandler.Instance.manager.GetTextById(6101);
     data.spRewardIcon   = IconDataHandler.Instance.manager.GetIconSpriteByName("baby_1");
     return(data);
 }