public float GetHeroContribution(Units target) { int unique_id = target.unique_id; if (this.MyData == null) { return(0f); } int num = this.MyData.heroKill.GetHeroRecord(unique_id); int num2 = this.MyData.monsterKill.GetHeroRecord(unique_id); int heroRecord = this.MyData.towerKill.GetHeroRecord(unique_id); AchieveData achieveData = GameManager.Instance.AchieveManager.GetAchieveData(unique_id, target.teamType); if (achieveData != null) { num = achieveData.TotalKill; num2 = achieveData.MonsterKillNum; } float num3 = (float)num2 * this.ConfigData.monsterData.normalRate + (float)num * this.ConfigData.heroData.normalRate + (float)heroRecord * this.ConfigData.towerData.normalRate; float num4 = (float)num2 * this.ConfigData.monsterData.KillRate + (float)heroRecord * this.ConfigData.towerData.KillRate + (float)num * this.GetKillHeroSingleReward(); BattleAttrGrowth.KillData killData = GameManager.Instance.AchieveManager.GetKillData(this.Team); int num5 = (killData.KillFirstHeroId != unique_id) ? 0 : 1; int num6 = (killData.KillFirstMonsterId != unique_id) ? 0 : 1; float num7 = (float)num5 * this.ConfigData.heroData.firstKillRate + (float)num6 * this.ConfigData.monsterData.firstKillRate; float num8 = 0f; if (achieveData != null) { num8 = (float)(-(float)achieveData.SelfDeathTime) * this.ConfigData.heroData.deathPenaltyRate; } return(num3 + num4 + num7 + num8); }
public void UpdateKillingHeroData(AchieveData targetData) { if (targetData.HeroId != this._heroId) { this.ContinusKillNoTime++; this.TotalKill++; if (this._killTime.Count > 0) { float num = this._killTime[this._killTime.Count - 1]; if (Time.time - num <= 7f) { this.ContinusKillWithTime++; } else { this.ContinusKillWithTime = 1; } } else { this.ContinusKillWithTime = 1; } this._killTime.Add(Time.time); } else { this.ContinusKillNoTime = 0; this.ContinusKillWithTime = 0; this.SelfDeathTime++; } Singleton <TriggerManager> .Instance.SendGameStateEvent(GameEvent.UpdateView); }
static public void UpdateMyAchieve(COM_Achievement hasProgress, bool isNew = false) { AchieveData data = AchieveData.GetData((int)hasProgress.achId_); if (data == null) { Debug.LogError(" Achievement ID: " + hasProgress.achId_ + " is not excist."); return; } if (achievementByTab.ContainsKey(data._Category)) { if (achievementByTab[data._Category].ContainsKey(data._AchieveType)) { for (int j = 0; j < achievementByTab[data._Category][data._AchieveType].Count; ++j) { if (achievementByTab[data._Category][data._AchieveType][j].data_._Id == hasProgress.achId_) { if (!achievementByTab[data._Category][data._AchieveType][j].isAch_ && hasProgress.isAch_) { if (isNew) { newAchieve.Enqueue(achievementByTab[data._Category][data._AchieveType][j]); ChatSystem.PushSystemMessage(LanguageManager.instance.GetValue("chengjiu").Replace("{n}", AchieveData.GetData((int)hasProgress.achId_)._AtName)); } finishCount++; } achievementByTab[data._Category][data._AchieveType][j].achValue_ = hasProgress.achValue_; achievementByTab[data._Category][data._AchieveType][j].isAward_ = hasProgress.isAward_; achievementByTab[data._Category][data._AchieveType][j].isAch_ = hasProgress.isAch_; } } } } isDirty = true; }
public AchievementContent(AchieveData data, uint progress = 0, bool isAch = false, bool isAward = false) { data_ = data; achValue_ = progress; isAch_ = isAch; isAward_ = isAward; }
/// <summary> /// 获取对应类型已获得的成就数量 /// </summary> /// <param name="type"></param> /// <param name="haveNum"></param> /// <param name="totalNum"></param> public void GetGainAchieveByType(uint type, out int haveNum, out int totalNum) { if (!subAchievementData.ContainsKey(type)) { haveNum = 0; totalNum = 0; return; } haveNum = 0; List <AchievementDataBase> list = subAchievementData[type]; totalNum = list.Count; for (int i = 0; i < list.Count; i++) { AchieveData achieveData = null; if (achievementServerData.TryGetValue(list[i].id, out achieveData)) { if (achieveData != null && achieveData.status > 0) { haveNum++; } } } }
void SecondTypeClick(uint childID) { AchievementDataBase typeData = achievementManager.GetParentAchievementData((int)m_uint_activeFType); if (typeData == null) { return; } List <AchievementDataBase> list = achievementManager.GetSubAchievementDataList(typeData.type); dailyAchieveDataList.Clear(); for (int i = 0; i < list.Count; i++) { if (list[i].childType == childID) { uint id = list[i].id; AchieveData achieveData = achievementManager.GetAchieveData(id); if (achieveData != null) { if (m_toggle_HideAchievement.value && achieveData.status == (uint)AchieveStatus.AchieveStatus_HaveReceive) { continue; } } else { achieveData = new AchieveData(); achieveData.id = list[i].id; } dailyAchieveDataList.Add(achieveData); } } dailyAchieveDataList.Sort(SortAchieveData); m_ctor_AchievementScrollView.CreateGrids(dailyAchieveDataList.Count); }
private void UpdateSourceData() { Units player = PlayerControlMgr.Instance.GetPlayer(); if (player == null) { return; } if (LevelManager.Instance.IsPvpBattleType) { int unique_id = player.unique_id; PvpStatisticMgr.HeroData heroData = Singleton <PvpManager> .Instance.StatisticMgr.GetHeroData(unique_id); this._data.heroKill = heroData.HeroKill; this._data.monsterKill = heroData.MonsterKill; this._data.assist = heroData.Assist; this._data.death = heroData.Death; this._data.firstKill = heroData.FirstKill; } else { AchieveData achieveData = GameManager.Instance.AchieveManager.GetAchieveData(player.unique_id, player.teamType); if (achieveData != null) { this._data.heroKill = achieveData.TotalKill; this._data.monsterKill = achieveData.MonsterKillNum; this._data.assist = player.assistantNum; this._data.death = achieveData.SelfDeathTime; } } }
private void OnUpdateGridData(UIGridBase grid, int index) { if (grid is UICtrTypeGrid) { UICtrTypeGrid tabGrid = grid as UICtrTypeGrid; if (tabGrid != null) { if (index == 0) { int haveNum = 0; int totalNum = 0; achievementManager.GetGainAchieveNum(out haveNum, out totalNum); string titleTips = "综合"; tabGrid.SetRedPointStatus(achievementManager.HaveCanReceiveAchieveByType((uint)index)); if (index < mlstFirstTabIds.Count) { tabGrid.SetData(mlstFirstTabIds[index], titleTips, 0); } } else { AchievementDataBase achievementData = achievementManager.GetParentAchievementData(index); if (achievementData != null) { int haveNum = 0; int totalNum = 0; int count = 0; if (achieveDic.ContainsKey((uint)index)) { count = achieveDic[(uint)(index)].Count; } achievementManager.GetGainAchieveByType(achievementData.type, out haveNum, out totalNum); string titleTips = string.Format("{0}({1}/{2})", achievementData.typeName, haveNum, totalNum); tabGrid.SetRedPointStatus(achievementManager.HaveCanReceiveAchieveByType((uint)index)); if (index < mlstFirstTabIds.Count) { tabGrid.SetData(mlstFirstTabIds[index], titleTips, count); } } } } } else if (grid is UIAchievemenGrid) { UIAchievemenGrid achieveGrid = grid as UIAchievemenGrid; if (null != achieveGrid) { AchieveData achieveData = dailyAchieveDataList.Count > index ? dailyAchieveDataList[index] : null; achieveGrid.UpdateItemInfo(achieveData); achieveGrid.SetGridData(index); achieveGrid.SetSelect(false); } } }
public static void UpdateTowerDestroyByTeam(TeamType team) { if (team == TeamType.LM) { AchieveData.TowerDestrouByLm++; } else if (team == TeamType.BL) { AchieveData.TowerDestroyByBl++; } AchieveData.updataMusicState(team); }
public override void Release(bool depthRelease = true) { base.Release(depthRelease); if (m_playerAvataCASD != null) { m_playerAvataCASD.Release(depthRelease); m_playerAvataCASD = null; } if (achieveData != null) { achieveData = null; } }
private void AddAchieve(BaseAchievement ac, int i, AchieveData acheiveData) { int index = i % 4; if (index == 0) { this.AddButton(658, 524, 4005, 4006, 0, GumpButtonType.Page, (i / 4) + 1); AddPage((i / 4) + 1); this.AddLabel(484, 526, 32, "Page " + ((i / 4) + 1)); this.AddButton(345, 524, 4014, 4015, 0, GumpButtonType.Page, i / 4); } int bg = 9350; if (acheiveData != null && acheiveData.CompletedOn != DateTime.MinValue) { bg = 9300; } this.AddBackground(340, 122 + (index * 100), 347, 97, bg); this.AddLabel(414, 131 + (index * 100), 49, ac.Title); if (ac.ItemIcon > 0) { this.AddItem(357, 147 + (index * 100), ac.ItemIcon); } this.AddImageTiled(416, 203 + (index * 100), 95, 9, 9750); var step = 95.0 / ac.CompletionTotal; var progress = 0; // Todo //if (acheiveData != null && acheiveData.CompletedOn != DateTime.MinValue) // progress = acheiveData.Progress; if (acheiveData != null) { progress = acheiveData.Progress; } this.AddImageTiled(416, 203 + (index * 100), (int)(progress * step), 9, 9752); this.AddHtml(413, 152 + (index * 100), 194, 47, ac.Desc, (bool)true, (bool)true); if (acheiveData != null && acheiveData.CompletedOn != DateTime.MinValue) { this.AddLabel(530, 127 + (index * 100), 32, acheiveData.CompletedOn.ToString()); } if (ac.CompletionTotal > 1) { this.AddLabel(522, 196 + (index * 100), 0, progress + @" / " + ac.CompletionTotal); } this.AddBackground(628, 149 + (index * 100), 48, 48, 9200); this.AddLabel(648, 163 + (index * 100), 32, ac.RewardPoints.ToString()); }
public static void SetData(AchieveData data) { AchievementContent ac = new AchievementContent(data); if (!achievementByTab.ContainsKey(data._Category)) { achievementByTab.Add(data._Category, new Dictionary <AchievementType, List <AchievementContent> >()); } if (!achievementByTab[data._Category].ContainsKey(data._AchieveType)) { achievementByTab[data._Category].Add(data._AchieveType, new List <AchievementContent>()); } achievementByTab[data._Category][data._AchieveType].Add(ac); }
int SortAchieveData(AchieveData dataA, AchieveData dataB) { if (dataA == null || dataB == null) { return(0); } if (dataA.status == (uint)AchieveStatus.AchieveStatus_CanReceive) { if (dataB.status == (uint)AchieveStatus.AchieveStatus_CanReceive) { return((int)dataA.id - (int)dataB.id); } else { return(-1); } } else if (dataB.status == (uint)AchieveStatus.AchieveStatus_CanReceive) { return(1); } else { if (dataA.status == (uint)AchieveStatus.AchieveStatus_Proceed) { if (dataB.status == (uint)AchieveStatus.AchieveStatus_Proceed) { return((int)dataA.id - (int)dataB.id); } else { return(-1); } } else if (dataB.status == (uint)AchieveStatus.AchieveStatus_Proceed) { return(1); } else { return((int)dataA.id - (int)dataB.id); } } }
void Awake() { instance = this; PlayerProfile.UpgradeProfile(); this.Coin = PlayerProfile.LoadCoin(); if (Config.enableHardActive) { this.isActivated = PlayerProfile.LoadIsActivated(); } else { this.isActivated = true; } this.isVIP = PlayerProfile.LoadIsVIP(); this.giftData = PlayerProfile.LoadGiftData(); iOSInterfaces.CallGameFullyLoaded(); LoadScenes(); AchieveData.init(); }
public static bool isReceived(int id) { AchieveData data = AchieveData.GetData(id); if (achievementByTab.ContainsKey(data._Category)) { if (achievementByTab[data._Category].ContainsKey(data._AchieveType)) { for (int j = 0; j < achievementByTab[data._Category][data._AchieveType].Count; ++j) { if (achievementByTab[data._Category][data._AchieveType][j].data_._Id == id) { return(achievementByTab[data._Category][data._AchieveType][j].isAward_); } } } } return(false); }
private void MonsterKilling() { Units triggerUnit = TriggerManager.GetTriggerUnit(); Units targetUnit = TriggerManager.GetTargetUnit(); if (triggerUnit && targetUnit && (targetUnit.CompareTag("Hero") || targetUnit.CompareTag("Player")) && triggerUnit.CompareTag("Monster")) { TeamType teamType = (TeamType)targetUnit.teamType; int unique_id = targetUnit.unique_id; string npc_id = targetUnit.npc_id; this.CheckRecords(teamType, unique_id, npc_id, string.Empty); this._allRecords[(int)teamType][unique_id].UpdateKillingMonsterData(); } SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(triggerUnit.npc_id); if (monsterMainData != null && monsterMainData.item_type == this._bossType) { TeamType teamType2 = (TeamType)targetUnit.teamType; AchieveData.UpdateEpicMonster(teamType2); } }
public void GetGainAchieveNum(out int haveNum, out int totalNum) { haveNum = 0; totalNum = 0; foreach (var item in subAchievementData) { List <AchievementDataBase> list = item.Value; totalNum += list.Count; for (int i = 0; i < list.Count; i++) { AchieveData achieveData = null; if (achievementServerData.TryGetValue(list[i].id, out achieveData)) { if (achieveData != null && achieveData.status > 0) { haveNum++; } } } } }
public static void ParseData(string content, string fileName) { metaData = new Dictionary <int, AchieveData> (); CSVParser parser = new CSVParser(); if (!parser.Parse(content)) { ClientLog.Instance.LogError("AchieveData" + ConfigLoader.Instance.csvext + "解析错误"); return; } int recordCounter = parser.GetRecordCounter(); AchieveData data = null; for (int i = 0; i < recordCounter; ++i) { data = new AchieveData(); data._Id = parser.GetInt(i, "ID"); data._Desc = parser.GetString(i, "desc"); data._Num = parser.GetInt(i, "target"); data._DropId = parser.GetInt(i, "DropID"); data._AtName = parser.GetString(i, "AtName"); data._Category = (CategoryType)Enum.Parse(typeof(CategoryType), parser.GetString(i, "Category")); data._AchieveType = (AchievementType)Enum.Parse(typeof(AchievementType), parser.GetString(i, "type")); if (metaData.ContainsKey(data._Id)) { ClientLog.Instance.LogError("AchieveData" + ConfigLoader.Instance.csvext + "ID重复"); return; } metaData[data._Id] = data; SuccessSystem.SetData(data); } parser.Dispose(); parser = null; //ParseBase (); }
public void UpdateItemInfo(AchieveData achieveData) { this.achieveData = achieveData; if (achieveData == null) { return; } AchievementDataBase achieveDataBase = DataManager.Manager <AchievementManager>().GetAchievementTableData(achieveData.id); if (achieveDataBase != null) { name.text = achieveDataBase.name; description.text = achieveDataBase.condition; process.value = 0; processNum.text = string.Format("{0}/{1}", achieveData.progress, achieveDataBase.aggregate); process.value = (achieveDataBase.aggregate <= 0) ? 0 : (achieveData.progress * 1.0f / achieveDataBase.aggregate); point.text = achieveDataBase.get_point.ToString(); switch (achieveData.status) { case (uint)AchieveStatus.AchieveStatus_CanReceive: ControlStatus(false, true, false); break; case (uint)AchieveStatus.AchieveStatus_HaveReceive: ControlStatus(false, false, true); break; default: ControlStatus(true, false, false); break; } if (rewardRoot != null) { ParseReward(achieveDataBase.items); } } }
public void CheckAchievemtCondition(AchieveData attackData, AchieveData targetData, KillType killtype = KillType.Normal) { EAchievementType conditionResult = this.GetConditionResult(attackData, targetData, killtype); string promptId = this.GetPromptId(attackData, targetData, killtype, conditionResult); if (conditionResult != EAchievementType.None) { if (LevelManager.Instance.IsPvpBattleType) { AchieveHelper.BrocastMsg(promptId, this.HeroName, targetData.HeroName, attackData._heroTeam, targetData._heroTeam, this.SummerName, targetData.SummerName); } else { AchieveHelper.BrocastMsg(promptId, this.HeroName, targetData.HeroName, attackData._heroTeam, targetData._heroTeam, string.Empty, string.Empty); } } else { Debug.LogError(string.Concat(new object[] { "Achievement is none, 连杀:", this.ContinusKillWithTime, " 累积杀:", this.ContinusKillNoTime })); } if ((targetData._heroTeam == TeamType.LM && MapManager.Instance.IsHeroAllDead(TeamType.LM) && GameManager.Instance.Spawner.GetPlayerNum(TeamType.LM) >= AchieveManager.TuanmieTotalCount) || (targetData._heroTeam == TeamType.BL && MapManager.Instance.IsHeroAllDead(TeamType.BL) && GameManager.Instance.Spawner.GetPlayerNum(TeamType.BL) >= AchieveManager.TuanmieTotalCount)) { promptId = this.GetPromptId(attackData, targetData, killtype, EAchievementType.TuanMie); if (LevelManager.Instance.IsPvpBattleType) { AchieveHelper.BrocastMsg(promptId, this.HeroName, targetData.HeroName, attackData._heroTeam, targetData._heroTeam, this.SummerName, targetData.SummerName); } else { AchieveHelper.BrocastMsg(promptId, this.HeroName, targetData.HeroName, attackData._heroTeam, targetData._heroTeam, string.Empty, string.Empty); } } }
private EAchievementType GetConditionResult(AchieveData attackData, AchieveData targetData, KillType killtype = KillType.Normal) { if (LevelManager.CurBattleType == 6) { return(EAchievementType.NormalKill); } EAchievementType result = EAchievementType.None; if (killtype == KillType.StopKill) { return(EAchievementType.ZhongJie); } if (killtype == KillType.FirstBoold) { return(EAchievementType.FirstBlood); } if (!LevelManager.Instance.IsPvpBattleType && GameManager.Instance.AchieveManager.AllHeroDeathNum == 1 && this.ContinusKillNoTime == 1) { result = EAchievementType.FirstBlood; } else if (attackData.ContinusKillWithTime >= AchieveManager.DoubleKillCount && attackData.ContinusKillWithTime <= AchieveManager.HexaKillCount) { if (attackData.ContinusKillWithTime == AchieveManager.DoubleKillCount) { result = EAchievementType.DoubleKill; } else if (attackData.ContinusKillWithTime == AchieveManager.TripleKillCount) { result = EAchievementType.TribleKill; } else if (attackData.ContinusKillWithTime == AchieveManager.FourthKillCount) { result = EAchievementType.FourKill; } else if (attackData.ContinusKillWithTime == AchieveManager.FifthKillCount) { result = EAchievementType.FiveKill; } else if (attackData.ContinusKillWithTime == AchieveManager.HexaKillCount) { result = EAchievementType.HexaKill; } } else if (targetData.ContinusKillNoTime >= AchieveManager.ZhongjieCount) { result = EAchievementType.ZhongJie; } else if (attackData.ContinusKillNoTime >= AchieveManager.DashaKillCount) { if (attackData.ContinusKillNoTime < AchieveManager.BaozouKillCount) { result = EAchievementType.DaShaTeSha; } else if (attackData.ContinusKillNoTime < AchieveManager.WurenKillCount) { result = EAchievementType.BaoZou; } else if (attackData.ContinusKillNoTime < AchieveManager.ZhuzaiKillCount) { result = EAchievementType.WuRenNengDang; } else if (attackData.ContinusKillNoTime < AchieveManager.GodlikeKillCount) { result = EAchievementType.ZhuZaiBiSai; } else if (attackData.ContinusKillNoTime < AchieveManager.LegendaryKillCount) { result = EAchievementType.GodLike; } else { result = EAchievementType.Legendary; } } else if (attackData.ContinusKillNoTime < AchieveManager.DashaKillCount) { result = EAchievementType.NormalKill; } targetData.UpdateKillingHeroData(targetData); return(result); }
void UpdateUI() { CategoryType[] cTypes = new CategoryType[(int)CategoryType.ACH_Max]; if (index == (int)CategoryType.ACH_All) { for (int i = 0; i < (int)CategoryType.ACH_Max; ++i) { cTypes[i] = (CategoryType)i; } } else { cTypes[index] = (CategoryType)index; } int counter = 0; GameObject go = null; Dictionary <AchievementType, List <AchievementContent> > data = null; List <AchievementContent> finalList = new List <AchievementContent>(); for (int i = 0; i < cTypes.Length; ++i) { if (!SuccessSystem.achievementByTab.ContainsKey(cTypes[i])) { continue; } data = SuccessSystem.achievementByTab[cTypes[i]]; foreach (List <AchievementContent> seris in data.Values) { AchievementContent ac = null; for (int j = 0; j < seris.Count; ++j) { if (!seris[j].isAward_) { ac = seris[j]; break; } } if (ac == null) { ac = seris[seris.Count - 1]; } if (AchieveData.GetData(ac.data_._Id)._AchieveType == AchievementType.AT_Reward50) { continue; } finalList.Add(ac); } } finalList.Sort(Compare); for (int i = 0; i < finalList.Count; ++i) { if (counter >= objPool.Count) { go = GameObject.Instantiate(item) as GameObject; objPool.Add(go); } else { go = objPool[counter]; } go.SetActive(true); SuccessCell aCell = go.GetComponent <SuccessCell>(); aCell.Info = finalList[i]; UIManager.SetButtonEventHandler(aCell.receiveBtn.gameObject, EnumButtonEvent.OnClick, OnClickReceive, finalList[i].data_._Id, 0); go.transform.parent = grid.transform; go.transform.localPosition = Vector3.zero; go.transform.localScale = Vector3.one; if (i == 0) { GuideManager.Instance.RegistGuideAim(aCell.receiveBtn.gameObject, GuideAimType.GAT_FirstAchievement); } counter++; } for (int i = counter; i < objPool.Count; ++i) { objPool[i].SetActive(false); } SpringPanel sp = contentPanel.GetComponent <SpringPanel>(); if (sp != null) { sp.enabled = false; } contentPanel.clipOffset = Vector2.zero; contentPanel.transform.localPosition = Vector3.zero; contentPanel.GetComponent <UIScrollView>().ResetPosition(); grid.Reposition(); objInfo.GetComponent <RewardInfo>().Percentage(SuccessSystem.FinishCount, SuccessSystem.Reward50(), AchieveData.metaData.Count - 1); // remove reward50 SuccessSystem.isDirty = false; }
/// <summary> /// 更新成就内容 /// </summary> private void UpdateAchieveContent() { if (null != m_ctor_AchievementScrollView) { if (m_uint_activeFType == 0) { List <AchievementDataBase> list = GameTableManager.Instance.GetTableList <AchievementDataBase>(); dailyAchieveDataList.Clear(); for (int i = 1; i < list.Count; i++) { uint id = list[i].id; AchieveData achieveData = achievementManager.GetAchieveData(id); if (achieveData != null) { if (m_toggle_HideAchievement.value && achieveData.status == (uint)AchieveStatus.AchieveStatus_HaveReceive) { continue; } } else { achieveData = new AchieveData(); achieveData.id = list[i].id; } dailyAchieveDataList.Add(achieveData); } } else { AchievementDataBase typeData = achievementManager.GetParentAchievementData((int)m_uint_activeFType); if (typeData == null) { return; } List <AchievementDataBase> list = achievementManager.GetSubAchievementDataList(typeData.type); dailyAchieveDataList.Clear(); for (int i = 0; i < list.Count; i++) { if (list[i].type == m_uint_activeFType && list[i].childType == m_uint_activeStype) { uint id = list[i].id; AchieveData achieveData = achievementManager.GetAchieveData(id); if (achieveData != null) { if (m_toggle_HideAchievement.value && achieveData.status == (uint)AchieveStatus.AchieveStatus_HaveReceive) { continue; } } else { achieveData = new AchieveData(); achieveData.id = list[i].id; } dailyAchieveDataList.Add(achieveData); } } } dailyAchieveDataList.Sort(SortAchieveData); m_ctor_AchievementScrollView.CreateGrids(dailyAchieveDataList.Count); } }
public void BrocastAchievement(int attackId, int deathId, KillType killtype, List <int> helpers, int killWithTime, int killNoTime, string typeId) { Units units = null; if (attackId != 0) { units = MapManager.Instance.GetUnit(attackId); } Units unit = MapManager.Instance.GetUnit(deathId); if (unit == null) { ClientLogger.Error("Can't get units: " + deathId); return; } TeamType teamType = (TeamType)unit.teamType; int unique_id = unit.unique_id; string npc_id = unit.npc_id; bool flag = teamType != (TeamType)PlayerControlMgr.Instance.GetPlayer().teamType; if (attackId == 0) { SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(typeId); if (monsterMainData != null) { int item_type = monsterMainData.item_type; EntityType attackerType = EntityType.None; string promptId = (!flag) ? "1100" : "1099"; if (Singleton <PvpManager> .Instance.IsObserver) { promptId = ((teamType != TeamType.BL) ? ((teamType != TeamType.LM) ? "1103" : "1102") : "1101"); } if (item_type == 1) { attackerType = EntityType.Monster; } else if (item_type == 3 || item_type == this._bossType) { attackerType = EntityType.Creep; } else if (item_type == 2 || item_type == 4) { attackerType = EntityType.Tower; } UIMessageBox.ShowKillPrompt(promptId, monsterMainData.npc_id, npc_id, attackerType, EntityType.None, string.Empty, string.Empty, units.TeamType, unit.TeamType); return; } UnityEngine.Debug.LogError("can't get monster data with type id:" + typeId); return; } else { if (units == null) { ClientLogger.Error("Can't get units: " + attackId); return; } this.IncHeroDeath(teamType); TeamType teamType2 = (TeamType)units.teamType; int unique_id2 = units.unique_id; string npc_id2 = units.npc_id; SysPromptVo dataById = BaseDataMgr.instance.GetDataById <SysPromptVo>("201"); if (dataById != null) { float icon_time = dataById.icon_time; } List <string> list = new List <string>(); if (helpers != null) { foreach (int current in helpers) { Units unit2 = MapManager.Instance.GetUnit(current); if (unit2 != null) { list.Add(unit2.npc_id); } else { ClientLogger.Error("can't get hero with id:" + current); } } } HUDModuleMsgTools.CallBattleMsg_SiderTipsModule_Kill(npc_id2, npc_id, flag, list, units.TeamType, unit.TeamType); AchieveData achieveData = new AchieveData(attackId, units.npc_id, (TeamType)units.teamType); AchieveData achieveData2 = new AchieveData(deathId, unit.npc_id, (TeamType)unit.teamType); achieveData2.unittype = units.tag; if (killtype == KillType.StopKill) { achieveData.CheckAchievemtCondition(achieveData, achieveData2, KillType.StopKill); return; } if (killtype == KillType.FirstBoold) { achieveData.ContinusKillNoTime = 1; achieveData.ContinusKillWithTime = 1; } else { achieveData.ContinusKillNoTime = killNoTime; achieveData.ContinusKillWithTime = killWithTime; } achieveData.CheckAchievemtCondition(achieveData, achieveData2, killtype); return; } }
private string GetPromptId(AchieveData attackData, AchieveData targetData, KillType killtype = KillType.Normal, EAchievementType arcType = EAchievementType.None) { Units player = PlayerControlMgr.Instance.GetPlayer(); if (null == player) { return(string.Empty); } bool flag = targetData._heroTeam != (TeamType)player.teamType; string result = string.Empty; if (arcType == EAchievementType.TuanMie) { result = ((!flag) ? "1100" : "1099"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1103" : "1102") : "1101"); } return(result); } if (arcType == EAchievementType.KilledByMonster) { result = ((!flag) ? "1089" : "1088"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1092" : "1091") : "1090"); } return(result); } if (killtype == KillType.StopKill) { result = ((!flag) ? "1094" : "1093"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1097" : "1096") : "1095"); } return(result); } if (killtype == KillType.FirstBoold) { result = ((!flag) ? "1017" : "1016"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1020" : "1019") : "1018"); } return(result); } if (!LevelManager.Instance.IsPvpBattleType && GameManager.Instance.AchieveManager.AllHeroDeathNum == 1 && this.ContinusKillNoTime == 1) { result = ((!flag) ? "1017" : "1016"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1020" : "1019") : "1018"); } } else if (attackData.ContinusKillWithTime >= AchieveManager.DoubleKillCount && attackData.ContinusKillWithTime <= AchieveManager.HexaKillCount) { if (attackData.ContinusKillWithTime == AchieveManager.DoubleKillCount) { result = ((!flag) ? "1026" : "1021"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1041" : "1036") : "1031"); } } else if (attackData.ContinusKillWithTime == AchieveManager.TripleKillCount) { result = ((!flag) ? "1027" : "1022"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1042" : "1037") : "1032"); } } else if (attackData.ContinusKillWithTime == AchieveManager.FourthKillCount) { result = ((!flag) ? "1028" : "1023"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1043" : "1038") : "1033"); } } else if (attackData.ContinusKillWithTime == AchieveManager.FifthKillCount) { result = ((!flag) ? "1029" : "1024"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1044" : "1039") : "1034"); } } else if (attackData.ContinusKillWithTime == AchieveManager.HexaKillCount) { result = ((!flag) ? "1030" : "1025"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1045" : "1040") : "1035"); } } } else if (targetData.ContinusKillNoTime >= AchieveManager.ZhongjieCount) { result = ((!flag) ? "1094" : "1093"); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1097" : "1096") : "1095"); } } else if (attackData.ContinusKillNoTime >= AchieveManager.DashaKillCount) { if (attackData.ContinusKillNoTime < AchieveManager.BaozouKillCount) { result = ((!flag) ? "1052" : ((!attackData.HeroName.Equals(player.npc_id)) ? "1046" : "1058")); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1076" : "1070") : "1064"); } } else if (attackData.ContinusKillNoTime < AchieveManager.WurenKillCount) { result = ((!flag) ? "1053" : ((!attackData.HeroName.Equals(player.npc_id)) ? "1047" : "1059")); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1077" : "1071") : "1065"); } } else if (attackData.ContinusKillNoTime < AchieveManager.ZhuzaiKillCount) { result = ((!flag) ? "1054" : ((!attackData.HeroName.Equals(player.npc_id)) ? "1048" : "1060")); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1078" : "1072") : "1066"); } } else if (attackData.ContinusKillNoTime < AchieveManager.GodlikeKillCount) { result = ((!flag) ? "1055" : ((!attackData.HeroName.Equals(player.npc_id)) ? "1049" : "1061")); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1079" : "1073") : "1067"); } } else if (attackData.ContinusKillNoTime < AchieveManager.LegendaryKillCount) { result = ((!flag) ? "1056" : ((!attackData.HeroName.Equals(player.npc_id)) ? "1050" : "1062")); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1080" : "1074") : "1068"); } } else { result = ((!flag) ? "1057" : ((!attackData.HeroName.Equals(player.npc_id)) ? "1051" : "1063")); if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1081" : "1075") : "1069"); } } } else if (attackData.ContinusKillNoTime < AchieveManager.DashaKillCount) { result = ((!flag) ? ((!targetData.HeroName.Equals(player.npc_id)) ? "1083" : "1098") : ((!attackData.HeroName.Equals(player.npc_id)) ? "1084" : "1082")); if (targetData.unittype.Equals("Building") || targetData.unittype.Equals("Monster")) { result = ((!flag) ? "1089" : "1088"); } if (Singleton <PvpManager> .Instance.IsObserver) { result = ((targetData._heroTeam != TeamType.BL) ? ((targetData._heroTeam != TeamType.LM) ? "1087" : "1086") : "1085"); } } targetData.UpdateKillingHeroData(targetData); return(result); }
private IEnumerator DelayBrocast(AchieveData invoker, AchieveData target, KillType killtype) { AchieveManager.< DelayBrocast > c__Iterator1A5 <DelayBrocast> c__Iterator1A = new AchieveManager.< DelayBrocast > c__Iterator1A5();
public override void Show(bool active) { base.Show(active); if (active) { int score = GameSystem.GetInstance().Score; int gainedCoin = GameSystem.GetInstance().CurrentModeLogic.ShouldGainBouns ? score / Constant.SCORE_TO_COIN : 0; if (GameSystem.GetInstance().IsVIP) { bonusBlockLabel.text = string.Format("+{0} x 2", gainedCoin); } else { bonusBlockLabel.text = string.Format("+{0}", gainedCoin); } totalBlockLabel.text = GameSystem.GetInstance().Coin.ToString(); int bestRecord = PlayerProfile.LoadBestRecord(GameSystem.GetInstance().CurrentMode, GameSystem.GetInstance().CurrentModeType); modeNameLabel.text = TextManager.GetText(string.Format("mode_name_{0}", (int)GameSystem.GetInstance().CurrentMode)); modeTypeNameLabel.text = string.Format("({0})", TextManager.GetText(string.Format("mode_type_name_{0}", (int)GameSystem.GetInstance().CurrentModeType))); if (GameSystem.GetInstance().CurrentModeType == GameSystem.ModeType.PassLevel) { scoreLabel.text = string.Format("{0}/{1}", GameSystem.GetInstance().DisplayWaveNumber, Constant.MAX_PASSLEVEL); newBestRecordLabel.text = string.Format("{0}/{1}", bestRecord, Constant.MAX_PASSLEVEL); //passLevelElement.SetActive(true); nonePassLevelElement.SetActive(false); } else { scoreLabel.text = score.ToString(); bestRecordLabel.text = bestRecord.ToString(); newBestRecordLabel.text = bestRecord.ToString(); //passLevelElement.SetActive(false); nonePassLevelElement.SetActive(true); } if (GameSystem.GetInstance().BrokenRecord) { commonResultPanel.SetActive(false); brokenRecordPanel.SetActive(true); } else { commonResultPanel.SetActive(true); brokenRecordPanel.SetActive(false); } if (score >= popADScore) { adTrigger.ToShow(true); } if (GameSystem.GetInstance().IsActivated && gainedCoin > 0 && (GameSystem.GetInstance().BrokenRecord || GameSystem.GetInstance().CurrentModeType != GameSystem.ModeType.PassLevel)) { PlayGetBonusAnimation(); } else { bonusAnimationObj.SetActive(false); } for (int i = 0; i < modeContents.Length; i++) { modeContents[i].SetActive(i == (int)GameSystem.GetInstance().CurrentMode); } if (GameSystem.GetInstance().CurrentMode == GameSystem.Mode.Dual) { dualWinnerSprite.color = DualMode.GetInstance().IsLeftWin ? Constant.LEFT_COLOR : Constant.RIGHT_COLOR; } int percent = AchieveData.computePercentByScore(GameSystem.GetInstance().CurrentMode, GameSystem.GetInstance().CurrentModeType, score); achieveLabel.text = string.Format(TextManager.GetText("achieve_desc"), percent); } }