public void Deserialize(JSON_ReqTowerResuponse.Json_TowerStatus json) { this.status = new TowerResuponse.Status(); this.status.fname = json.fname; this.status.state = json.questStates; TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(this.status.fname); if (towerFloor == null) { return; } List <TowerFloorParam> towerFloors = MonoSingleton <GameManager> .Instance.FindTowerFloors(towerFloor.tower_id); List <QuestParam> referenceQuestList = new List <QuestParam>(); for (short index = 0; (int)index < towerFloors.Count; ++index) { towerFloors[(int)index].FloorIndex = index; referenceQuestList.Add(towerFloors[(int)index].GetQuestParam()); } QuestParam questParam = towerFloor.GetQuestParam(); using (List <QuestParam> .Enumerator enumerator = referenceQuestList.GetEnumerator()) { while (enumerator.MoveNext()) { enumerator.Current.state = QuestStates.New; } } this.SetQuestState(referenceQuestList, questParam, QuestStates.Cleared, true); questParam.state = this.status.state; }
public override void OnActivate(int pinID) { string str1 = (string)null; string str2 = (string)null; TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID); if (towerFloor != null) { QuestParam questParam = towerFloor.GetQuestParam(); if (questParam != null) { str1 = questParam.iname; } } if (pinID == 0 && str1 != null) { str2 = PlayerPrefsUtility.GetString(PlayerPrefsUtility.CONFIRM_TOWER_MISSION_QUEST_ID, string.Empty); } if (str1 == str2) { this.ActivateOutputLinks(1); PlayerPrefsUtility.SetString(PlayerPrefsUtility.CONFIRM_TOWER_MISSION_QUEST_ID, string.Empty, true); } else { this.ActivateOutputLinks(2); } }
public override void OnActivate(int pinID) { bool flag = false; string str = (string)null; TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID); if (towerFloor != null) { QuestParam questParam = towerFloor.GetQuestParam(); if (questParam != null) { str = questParam.iname; } } if (pinID == 0 && str != null) { flag = PlayerPrefsUtility.SetString(PlayerPrefsUtility.CONFIRM_TOWER_MISSION_QUEST_ID, str, true); } if (!flag) { DebugUtility.Log("PlayerPrefsの設定に失敗しました"); } this.ActivateOutputLinks(1); }
public void Refresh() { TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID); if (towerFloor == null) { return; } QuestParam questParam = towerFloor.GetQuestParam(); DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), questParam); this.SetRecommendText((int)towerFloor.lv, (int)towerFloor.joblv); int downloadAssetNum = ((FlowNode_DownloadTowerMapSets)((Component)this).GetComponentInParent <FlowNode_DownloadTowerMapSets>()).DownloadAssetNum; TowerFloorParam currentFloor = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor(); if (currentFloor == null) { return; } if ((int)towerFloor.FloorIndex < (int)currentFloor.FloorIndex + downloadAssetNum) { if (questParam.state == QuestStates.Cleared) { GameUtility.SetGameObjectActive(this.UnkownIcon, false); GameUtility.SetGameObjectActive((Component)this.RewardText, true); GameUtility.SetGameObjectActive(this.ClearIcon, true); this.HideAllEnemyIcon(); this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id)); } else { string path = AssetPath.LocalMap(towerFloor.map[0].mapSetName); string src = AssetManager.LoadTextData(path); if (string.IsNullOrEmpty(src)) { DebugUtility.LogError("配置ファイルがありません : QuestIname = " + towerFloor.iname + ",SetFilePath = " + path); return; } JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src); GameUtility.SetGameObjectActive(this.UnkownIcon, false); GameUtility.SetGameObjectActive((Component)this.RewardText, true); GameUtility.SetGameObjectActive(this.ClearIcon, false); TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse; this.HideAllEnemyIcon(); if (jsonObject.enemy != null) { TowerFloorParam towerFloorParam = (TowerFloorParam)null; if (MonoSingleton <GameManager> .Instance.TowerResuponse != null) { towerFloorParam = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor(); } bool flag1 = towerResuponse.lot_enemies != null && towerResuponse.lot_enemies.Length > 0; bool flag2 = towerFloor.iname == currentFloor.iname; if (flag1 && flag2) { jsonObject.enemy = jsonObject.ReplacedRandEnemy(towerResuponse.lot_enemies, false); } List <TowerQuestInfo.EnemyIconData> enemyIconDataList1 = new List <TowerQuestInfo.EnemyIconData>(); for (int i = 0; i < jsonObject.enemy.Length; ++i) { bool flag3 = false; if (jsonObject.enemy[i].IsRandSymbol) { flag3 = true; } if (flag1 && flag2) { flag3 = Array.Find <RandDeckResult>(towerResuponse.lot_enemies, (Predicate <RandDeckResult>)(lot => lot.set_id == i)) != null; } Unit unit = (Unit)null; if (!jsonObject.enemy[i].IsRandSymbol) { NPCSetting npcSetting = new NPCSetting(jsonObject.enemy[i]); unit = new Unit(); unit.Setup((UnitData)null, (UnitSetting)npcSetting, (Unit.DropItem)null, (Unit.DropItem)null); } enemyIconDataList1.Add(new TowerQuestInfo.EnemyIconData() { unit = unit, enemy = jsonObject.enemy[i], is_rand = flag3 }); } List <TowerQuestInfo.EnemyIconData> enemyIconDataList2 = new List <TowerQuestInfo.EnemyIconData>(); for (int index = 0; index < enemyIconDataList1.Count; ++index) { if (!enemyIconDataList1[index].enemy.IsRandSymbol && !enemyIconDataList1[index].unit.IsGimmick) { enemyIconDataList2.Add(enemyIconDataList1[index]); } } List <TowerQuestInfo.EnemyIconData> enemyIconDataList3 = new List <TowerQuestInfo.EnemyIconData>((IEnumerable <TowerQuestInfo.EnemyIconData>)enemyIconDataList2); if (towerFloorParam != null && towerFloorParam.iname == GlobalVars.SelectedQuestID && MonoSingleton <GameManager> .Instance.TowerEnemyUnit != null) { for (int index = 0; index < enemyIconDataList3.Count; ++index) { if (enemyIconDataList3[index].unit != null) { int num = (int)enemyIconDataList3[index].unit.MaximumStatus.param.hp - MonoSingleton <GameManager> .Instance.TowerEnemyUnit[index].hp; enemyIconDataList3[index].unit.Damage(num, false); } } } List <TowerQuestInfo.EnemyIconData> icon_datas = new List <TowerQuestInfo.EnemyIconData>(); List <TowerQuestInfo.EnemyIconData> enemyIconDataList4 = new List <TowerQuestInfo.EnemyIconData>(); List <TowerQuestInfo.EnemyIconData> enemyIconDataList5 = new List <TowerQuestInfo.EnemyIconData>(); for (int index = 0; index < enemyIconDataList3.Count; ++index) { if (!enemyIconDataList3[index].is_rand) { enemyIconDataList4.Add(enemyIconDataList3[index]); } } if (towerResuponse.lot_enemies == null || (int)towerFloor.FloorIndex > (int)currentFloor.FloorIndex) { if (jsonObject.deck != null && jsonObject.deck.Length > 0 && (jsonObject.rand_tag != null && jsonObject.rand_tag.Length > 0)) { int num = 0; for (int index = 0; index < jsonObject.rand_tag.Length; ++index) { num += jsonObject.rand_tag[index].spawn; } for (int index = 0; index < num; ++index) { TowerQuestInfo.EnemyIconData enemyIconData = new TowerQuestInfo.EnemyIconData(); enemyIconDataList5.Add(enemyIconData); } } } else { for (int index = 0; index < enemyIconDataList3.Count; ++index) { if (enemyIconDataList3[index].is_rand) { enemyIconDataList5.Add(enemyIconDataList3[index]); } } } icon_datas.AddRange((IEnumerable <TowerQuestInfo.EnemyIconData>)enemyIconDataList4); icon_datas.AddRange((IEnumerable <TowerQuestInfo.EnemyIconData>)enemyIconDataList5); this.SetIcon(icon_datas); } this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id)); } } else { GameUtility.SetGameObjectActive(this.UnkownIcon, true); GameUtility.SetGameObjectActive((Component)this.RewardText, true); GameUtility.SetGameObjectActive(this.ClearIcon, false); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnkownIcon, (UnityEngine.Object)null)) { Text component = (Text)this.UnkownIcon.GetComponent <Text>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null)) { component.set_text(LocalizedText.Get("sys.TOWER_UNKNOWN_TEXT", new object[1] { (object)((int)towerFloor.FloorIndex - downloadAssetNum + 1) })); } } this.HideAllEnemyIcon(); this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id)); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_BattleResetCost, (UnityEngine.Object)null)) { this.m_BattleResetCost.set_text(MonoSingleton <GameManager> .Instance.FindTower(towerFloor.tower_id).floor_reset_coin.ToString()); } GameParameter.UpdateAll(((Component)this).get_gameObject()); this.FloorID = GlobalVars.SelectedQuestID; }
public void Refresh() { TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID); if (towerFloor == null) { return; } QuestParam questParam = towerFloor.GetQuestParam(); DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), questParam); this.SetRecommendText((int)towerFloor.lv, (int)towerFloor.joblv); int downloadAssetNum = ((FlowNode_DownloadTowerMapSets)((Component)this).GetComponentInParent <FlowNode_DownloadTowerMapSets>()).DownloadAssetNum; TowerFloorParam currentFloor = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor(); if (currentFloor == null) { return; } if ((int)towerFloor.FloorIndex < (int)currentFloor.FloorIndex + downloadAssetNum) { if (questParam.state == QuestStates.Cleared) { GameUtility.SetGameObjectActive(this.UnkownIcon, false); GameUtility.SetGameObjectActive((Component)this.RewardText, true); GameUtility.SetGameObjectActive(this.ClearIcon, true); for (int index = 0; index < this.EnemyList.Count; ++index) { ((Component)this.EnemyList[index]).get_gameObject().SetActive(false); } for (int index = 0; index < this.UnknownEnemyList.Count; ++index) { ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false); } this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id)); } else { string path = AssetPath.LocalMap(towerFloor.map[0].mapSetName); string src = AssetManager.LoadTextData(path); if (string.IsNullOrEmpty(src)) { DebugUtility.LogError("配置ファイルがありません : QuestIname = " + towerFloor.iname + ",SetFilePath = " + path); return; } JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src); GameUtility.SetGameObjectActive(this.UnkownIcon, false); GameUtility.SetGameObjectActive((Component)this.RewardText, true); GameUtility.SetGameObjectActive(this.ClearIcon, false); TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse; if ((int)jsonObject.is_rand > 0) { if (towerResuponse.lot_enemies == null || (int)towerFloor.FloorIndex > (int)currentFloor.FloorIndex) { for (int index = 0; index < this.EnemyList.Count; ++index) { ((Component)this.EnemyList[index]).get_gameObject().SetActive(false); } this.EnemyTemplateUnKnown.SetActive(true); int num = 0; for (int index = 0; index < towerFloor.rand_tag.Length; ++index) { num += (int)towerFloor.rand_tag[index]; } for (int index = 0; index < num; ++index) { if (index >= this.UnknownEnemyList.Count) { TowerEnemyListItem component = (TowerEnemyListItem)((GameObject)Object.Instantiate <GameObject>((M0)this.EnemyTemplateUnKnown)).GetComponent <TowerEnemyListItem>(); ((Component)component).get_transform().SetParent(this.EnemiesRoot.get_transform(), false); this.UnknownEnemyList.Add(component); } ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(true); } for (int index = num; index < this.UnknownEnemyList.Count; ++index) { ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false); } this.EnemyTemplateUnKnown.SetActive(false); } else { List <JSON_MapEnemyUnit> randFixedUnit = jsonObject.GetRandFixedUnit(); jsonObject.enemy = new JSON_MapEnemyUnit[towerResuponse.lot_enemies.Length]; for (int index = 0; index < jsonObject.enemy.Length; ++index) { jsonObject.enemy[index] = jsonObject.deck[(int)towerResuponse.lot_enemies[index]]; } List <JSON_MapEnemyUnit> jsonMapEnemyUnitList = new List <JSON_MapEnemyUnit>((IEnumerable <JSON_MapEnemyUnit>)jsonObject.enemy); jsonMapEnemyUnitList.AddRange((IEnumerable <JSON_MapEnemyUnit>)randFixedUnit); jsonObject.enemy = jsonMapEnemyUnitList.ToArray(); this.SetEnemies(jsonObject.enemy); } } else if (jsonObject.enemy != null) { this.SetEnemies(jsonObject.enemy); } this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id)); } } else { GameUtility.SetGameObjectActive(this.UnkownIcon, true); GameUtility.SetGameObjectActive((Component)this.RewardText, true); GameUtility.SetGameObjectActive(this.ClearIcon, false); if (Object.op_Inequality((Object)this.UnkownIcon, (Object)null)) { Text component = (Text)this.UnkownIcon.GetComponent <Text>(); if (Object.op_Inequality((Object)component, (Object)null)) { component.set_text(LocalizedText.Get("sys.TOWER_UNKNOWN_TEXT", new object[1] { (object)((int)towerFloor.FloorIndex - downloadAssetNum + 1) })); } } for (int index = 0; index < this.EnemyList.Count; ++index) { ((Component)this.EnemyList[index]).get_gameObject().SetActive(false); } for (int index = 0; index < this.UnknownEnemyList.Count; ++index) { ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false); } this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id)); } GameParameter.UpdateAll(((Component)this).get_gameObject()); this.FloorID = GlobalVars.SelectedQuestID; }
private void Refresh() { TowerParam tower = MonoSingleton <GameManager> .Instance.FindTower(GlobalVars.SelectedTowerID); if (tower == null) { return; } TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID); if (towerFloor == null) { return; } QuestParam questParam = towerFloor.GetQuestParam(); if (questParam == null || questParam.bonusObjective == null) { return; } int clearMissionNum = questParam.GetClearMissionNum(); int length = questParam.bonusObjective.Length; if (questParam.IsMissionCompleteALL()) { this.ClearConditionText01.set_text(string.Format(LocalizedText.Get("sys.TOWER_CLEAR_CINDITION_01_CLEAR"), (object)clearMissionNum, (object)length)); this.ClearConditionImage01.ImageIndex = 0; } else { this.ClearConditionText01.set_text(string.Format(LocalizedText.Get("sys.TOWER_CLEAR_CINDITION_01"), (object)clearMissionNum, (object)length)); this.ClearConditionImage01.ImageIndex = 1; } if (questParam.state == QuestStates.Cleared) { this.ClearConditionText02.set_text(LocalizedText.Get("sys.TOWER_CLEAR_CINDITION_02_CLEAR")); this.ClearConditionImage02.ImageIndex = 0; } else { this.ClearConditionText02.set_text(LocalizedText.Get("sys.TOWER_CLEAR_CINDITION_02")); this.ClearConditionImage02.ImageIndex = 1; } if (Object.op_Inequality((Object)this.TowerName, (Object)null)) { this.TowerName.set_text(tower.name); } if (Object.op_Inequality((Object)this.TowerFloorNum, (Object)null)) { this.TowerFloorNum.set_text(towerFloor.name); } this.CreateResetMissionItems(questParam); if (this.m_MissionListItems != null && this.m_MissionListItems.Count > 0) { GameUtility.SetGameObjectActive((Component)this.m_MissionListTitle, true); } else { GameUtility.SetGameObjectActive((Component)this.m_MissionListTitleNoItem, true); GameUtility.SetGameObjectActive((Component)this.m_MissionListParent, false); } }