Beispiel #1
0
    public void ShowPlayerInfo(eBattleType state, double atk, double def, double heal, double hpCurrent, double hpMax, int conditionCurrent)
    {
        mPlayerInfoObj.SetActive(true);

        mPlayerInfoText[0].text = state.ToString();
        mPlayerInfoText[1].text = "ATK : " + UnitBuilder.GetUnitStr(atk);
        mPlayerInfoText[2].text = "DEF : " + UnitBuilder.GetUnitStr(def);
        mPlayerInfoText[3].text = "HEAL : " + UnitBuilder.GetUnitStr(heal);
        mPlayerInfoText[4].text = string.Format("HP : {0}/{1}", UnitBuilder.GetUnitStr(hpCurrent), UnitBuilder.GetUnitStr(hpMax));
        mPlayerInfoText[5].text = string.Format("Field : {0}", conditionCurrent);
    }
Beispiel #2
0
        private void RecordBattle(eCombatOutcome outcome)//上报友盟,是否通关
        {
            bool   tmpIsWon = outcome == eCombatOutcome.Win ? true : false;
            string tmpLevel = string.Empty;

            if (_battleType == eBattleType.MainCampaignBattle)
            {
                tmpLevel = LTMainInstanceCampaignCtrl.CampaignId.ToString();
                if (!string.IsNullOrEmpty(tmpLevel))
                {
                    JudgeBattle(tmpIsWon, "Main" + tmpLevel);
                    if (tmpIsWon)
                    {
                        LTChargeManager.Instance.CheckLimitedTimeGiftTrigger(Hotfix_LT.Data.LTGTriggerType.Main, tmpLevel);
                    }
                }
            }
            else if (_battleType == eBattleType.InfiniteChallenge)
            {
                DataLookupsCache.Instance.SearchDataByID <string>("infiniteChallenge.info.currentlayer", out tmpLevel);
                if (!string.IsNullOrEmpty(tmpLevel))
                {
                    JudgeBattle(tmpIsWon, _battleType.ToString() + tmpLevel);
                    if (tmpIsWon)
                    {
                        LTChargeManager.Instance.CheckLimitedTimeGiftTrigger(Hotfix_LT.Data.LTGTriggerType.UltimateTrial, tmpLevel);
                    }
                }
                Data.NewGameConfigTemplateManager.Instance.GetEnterVigor(eBattleType.InfiniteChallenge, out int dayDisCountTime, out int NewVigor, out int oldVigor);
                int curDisCountTime = dayDisCountTime - LTUltimateTrialDataManager.Instance.GetCurrencyTimes();
                if (outcome == eCombatOutcome.Win && curDisCountTime >= 0)
                {
                    LTDailyDataManager.Instance.SetDailyDataRefreshState();
                }
            }
            else if (_battleType == eBattleType.TreasuryBattle)
            {
                ArrayList rewardData;
                DataLookupsCache.Instance.SearchDataByID <ArrayList>("combat.rewards", out rewardData);
                Hashtable rewardDataTable = Johny.HashtablePool.Claim();
                if (rewardData != null)
                {
                    rewardDataTable = rewardData[0] as Hashtable;
                }
                tmpLevel = EB.Dot.String("gold.currentDifficulty", rewardDataTable, null);

                if (!string.IsNullOrEmpty(tmpLevel))
                {
                    JudgeBattle(tmpIsWon, _battleType.ToString() + tmpLevel);
                }
            }
            else if (_battleType == eBattleType.ExpSpringBattle)
            {
                ArrayList rewardData;
                DataLookupsCache.Instance.SearchDataByID <ArrayList>("combat.rewards", out rewardData);
                Hashtable rewardDataTable = Johny.HashtablePool.Claim();
                if (rewardData != null)
                {
                    rewardDataTable = rewardData[0] as Hashtable;
                }
                tmpLevel = EB.Dot.String("currentDifficulty", rewardDataTable, null);
                if (!string.IsNullOrEmpty(tmpLevel))
                {
                    JudgeBattle(tmpIsWon, _battleType.ToString() + tmpLevel);
                }
            }
            else if (_battleType == eBattleType.ChallengeCampaign)
            {
                tmpLevel = LTInstanceMapModel.Instance.CurLevelNum.ToString();
            }
            int chapterId = 0;

            int.TryParse(tmpLevel, out chapterId);

            string     teamName     = FormationUtil.GetCurrentTeamName(_battleType);
            string     teamDataPath = SmallPartnerPacketRule.USER_TEAM + "." + teamName + ".team_info";
            List <int> heroInfos    = new List <int>();
            ArrayList  teamDatas;

            DataLookupsCache.Instance.SearchDataByID(teamDataPath, out teamDatas);
            if (teamDatas != null)
            {
                for (var i = 0; i < teamDatas.Count; i++)
                {
                    var    td     = teamDatas[i];
                    string heroid = EB.Dot.String("hero_id", td, "");
                    if (!string.IsNullOrEmpty(heroid))
                    {
                        LTPartnerData data = LTPartnerDataManager.Instance.GetPartnerByHeroId(int.Parse(heroid));
                        if (data != null)
                        {
                            // IDictionary<string, int> hero = new Dictionary<string, int>();
                            // hero.Add(data.HeroInfo.name, data.Level);
                            heroInfos.Add(data.InfoId);
                        }
                    }
                }
            }
            FusionTelemetry.PostCombat(_battleType.ToString(), chapterId, tmpIsWon ? 1 : 2, heroInfos, isCombatOut ? 2 : 1);
        }
Beispiel #3
0
 private string GetBattleIsFailedKey(eBattleType type)
 {
     return(string.Format("{0}-{1}-{2}", LoginManager.Instance.LocalUserId.Value, NodeMessageManager.CheckBattleIsFailed, type.ToString()));
 }