private void Initialize() { this.isInitialized = true; this.mFloorParams = MonoSingleton <GameManager> .Instance.FindTowerFloors(GlobalVars.SelectedTowerID); this.mListItemTemplate.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelectItem); // ISSUE: method pointer this.mScrollListController.OnListItemFocus.AddListener(new UnityAction <GameObject>((object)this, __methodptr(OnScrollStop))); this.mScrollListController.UpdateList(); if (MonoSingleton <GameManager> .Instance.TowerResuponse != null) { TowerFloorParam currentFloor = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor(); if (currentFloor == null) { return; } this.ScrollToCurrentFloor(currentFloor); GlobalVars.SelectedQuestID = currentFloor.iname; FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); } else { TowerFloorParam firstTowerFloor = MonoSingleton <GameManager> .Instance.FindFirstTowerFloor(GlobalVars.SelectedTowerID); if (firstTowerFloor == null) { return; } this.ScrollToCurrentFloor(firstTowerFloor); GlobalVars.SelectedQuestID = firstTowerFloor.iname; FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); } }
private void CheckBattleResetButton() { TowerParam tower = MonoSingleton <GameManager> .Instance.FindTower(GlobalVars.SelectedTowerID); if (tower == null) { return; } TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse; if (towerResuponse == null) { return; } TowerFloorParam currentFloor = towerResuponse.GetCurrentFloor(); if (currentFloor == null) { return; } if (MonoSingleton <GameManager> .Instance.Player.Coin > (int)tower.floor_reset_coin && GlobalVars.SelectedQuestID == currentFloor.iname && towerResuponse.CheckEnemyDeck()) { ((Selectable)this.BattleResetButton).set_interactable(true); } else { ((Selectable)this.BattleResetButton).set_interactable(false); } }
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 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 void UpdateParam(TowerFloorParam param, int floorNo) { if (param == null) { this.SetVisible(TowerQuestListItem.Type.Unknown); } else { QuestParam questParam = param.Clone((QuestParam)null, true); bool flag = questParam.IsQuestCondition(); if (flag && questParam.state != QuestStates.Cleared) { this.SetVisible(TowerQuestListItem.Type.Current); } else if (questParam.state == QuestStates.Cleared) { this.SetVisible(TowerQuestListItem.Type.Cleared); } else if (!flag) { this.SetVisible(TowerQuestListItem.Type.Locked); } if (param != null && Object.op_Inequality((Object)this.mText, (Object)null)) { this.mText.set_text(param.title + " " + param.name); } if (!Object.op_Inequality((Object)this.m_FloorText, (Object)null)) { return; } this.m_FloorText.set_text(param.GetFloorNo().ToString() + "!"); } }
public void Deserialize(JSON_ReqTowerResuponse res) { if (res == null) { return; } this.TowerID = GlobalVars.SelectedTowerID; this.rtime = res.rtime; if (res.stats != null) { this.Deserialize(res.stats); } else { TowerFloorParam firstTowerFloor = MonoSingleton <GameManager> .Instance.FindFirstTowerFloor(this.TowerID); if (firstTowerFloor != null) { this.Deserialize(new JSON_ReqTowerResuponse.Json_TowerStatus() { fname = firstTowerFloor.iname, questStates = QuestStates.New }); } } if (res.pdeck != null) { this.pdeck = new List <TowerResuponse.PlayerUnit>(); for (int index = 0; index < res.pdeck.Length; ++index) { this.pdeck.Add(new TowerResuponse.PlayerUnit()); this.pdeck[index].dmg = res.pdeck[index].damage; this.pdeck[index].unitname = res.pdeck[index].uname; this.pdeck[index].is_died = res.pdeck[index].is_died; } } this.reset_cost = res.reset_cost; this.round = res.round; this.is_reset = res.is_reset == (byte)1; if (res.lot_enemies != null && res.lot_enemies.Length > 0) { this.lot_enemies = new RandDeckResult[res.lot_enemies.Length]; for (int index = 0; index < res.lot_enemies.Length; ++index) { this.lot_enemies[index] = new RandDeckResult() { id = res.lot_enemies[index].id, set_id = res.lot_enemies[index].set_id } } ; } this.Deserialize(res.edeck); this.Deserialize(res.rank); this.UpdateCurrentFloor(); }
private void CreateSlots() { this.DestroyPartySlotObjects(); List <PartySlotData> mainSlotData = new List <PartySlotData>(); List <PartySlotData> subSlotData = new List <PartySlotData>(); PartySlotData supportSlotData = (PartySlotData)null; PartyUtility.CreatePartySlotData(this.mCurrentQuest, out mainSlotData, out subSlotData, out supportSlotData); List <GenericSlot> genericSlotList = new List <GenericSlot>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MainMemberHolder, (UnityEngine.Object)null) && mainSlotData.Count > 0) { using (List <PartySlotData> .Enumerator enumerator = mainSlotData.GetEnumerator()) { while (enumerator.MoveNext()) { PartySlotData current = enumerator.Current; GenericSlot genericSlot = current.Type == PartySlotType.Npc || current.Type == PartySlotType.NpcHero ? this.CreateSlotObject(current, this.NpcSlotTemplate, this.MainMemberHolder) : this.CreateSlotObject(current, this.UnitSlotTemplate, this.MainMemberHolder); genericSlotList.Add(genericSlot); } } if (supportSlotData != null) { this.FriendSlot = this.CreateSlotObject(supportSlotData, this.UnitSlotTemplate, this.MainMemberHolder); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SubMemberHolder, (UnityEngine.Object)null) && subSlotData.Count > 0) { using (List <PartySlotData> .Enumerator enumerator = subSlotData.GetEnumerator()) { while (enumerator.MoveNext()) { PartySlotData current = enumerator.Current; GenericSlot genericSlot = current.Type == PartySlotType.Npc || current.Type == PartySlotType.NpcHero ? this.CreateSlotObject(current, this.NpcSlotTemplate, this.SubMemberHolder) : this.CreateSlotObject(current, this.UnitSlotTemplate, this.SubMemberHolder); genericSlotList.Add(genericSlot); } } } this.mSlotData.AddRange((IEnumerable <PartySlotData>)mainSlotData); this.mSlotData.AddRange((IEnumerable <PartySlotData>)subSlotData); this.UnitSlots = genericSlotList.ToArray(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.FriendSlot, (UnityEngine.Object)null) && this.mCurrentQuest != null && this.mCurrentQuest.type == QuestTypes.Tower) { TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(this.mCurrentQuest.iname); if (towerFloor != null) { ((Component)this.FriendSlot).get_gameObject().SetActive(towerFloor.can_help); ((Component)this.SupportSkill).get_gameObject().SetActive(towerFloor.can_help); } } this.mGuestUnits = new List <UnitData>(); PartyUtility.MergePartySlotWithPartyUnits(this.mCurrentQuest, this.mSlotData, this.mCurrentParty, this.mGuestUnits, this.mIsUserOwnUnits); this.ReflectionUnitSlot(); }
private void OnScrollStop(GameObject go) { TowerFloorParam dataOfClass = DataSource.FindDataOfClass <TowerFloorParam>(go, (TowerFloorParam)null); if (dataOfClass == null) { return; } GlobalVars.SelectedQuestID = dataOfClass.iname; FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); }
private void UpdateMissionProgressRequestState(TowerFloorParam floorParam) { if (!string.IsNullOrEmpty(floorParam.mission)) { this.m_MissionProgressState = TowerManager.MissionProgressRequestState.RequireProgressRequest; } else { this.m_MissionProgressState = TowerManager.MissionProgressRequestState.UnrequireProgressRequest; } }
public HealParanm(Unit unit, TowerFloorParam FloorParam, HpBarSlider hp_bar, float GainRate, float GainTimeMax) { this.unit = unit; this.hp = unit.TowerStartHP; this.hp_heal = FloorParam.CalcHelaNum(this.hp); this.hp_gainRate = GainRate; if ((double)((float)this.hp_heal / GainRate) > (double)GainTimeMax) { this.hp_gainRate = (float)this.hp_heal / GainTimeMax; } this.hp_bar = hp_bar; }
private void OnSelectItem(GameObject go) { TowerFloorParam dataOfClass = DataSource.FindDataOfClass <TowerFloorParam>(go, (TowerFloorParam)null); if (dataOfClass == null) { return; } this.mScrollListController.SetScrollTo((float)((double)this.mScrollListController.ItemScaleMargin * (double)this.mFloorParams.IndexOf(dataOfClass) - (double)this.mScrollListController.ItemScaleMargin * 2.0)); GlobalVars.SelectedQuestID = dataOfClass.iname; FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); }
private void SetEnemies(JSON_MapEnemyUnit[] json) { for (int index = 0; index < this.UnknownEnemyList.Count; ++index) { ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false); } List <JSON_MapEnemyUnit> list = ((IEnumerable <JSON_MapEnemyUnit>)json).Where <JSON_MapEnemyUnit>((Func <JSON_MapEnemyUnit, bool>)(enemy => { if (enemy.elem != 0) { return(enemy.side == 1); } return(false); })).ToList <JSON_MapEnemyUnit>(); TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse; TowerFloorParam towerFloorParam = (TowerFloorParam)null; if (towerResuponse != null) { towerFloorParam = towerResuponse.GetCurrentFloor(); } this.EnemyUnits.Clear(); for (int index = 0; index < list.Count; ++index) { TowerEnemyListItem towerEnemyListItem; if (this.EnemyList.Count <= index) { towerEnemyListItem = (TowerEnemyListItem)((GameObject)Object.Instantiate <GameObject>((M0)this.EnemyTemplate)).GetComponent <TowerEnemyListItem>(); ((Component)towerEnemyListItem).get_transform().SetParent(this.EnemiesRoot.get_transform(), false); this.EnemyList.Add(towerEnemyListItem); } else { towerEnemyListItem = this.EnemyList[index]; } NPCSetting npcSetting = new NPCSetting(list[index]); Unit data = new Unit(); data.Setup((UnitData)null, (UnitSetting)npcSetting, (Unit.DropItem)null, (Unit.DropItem)null); DataSource.Bind <Unit>(((Component)towerEnemyListItem).get_gameObject(), data); this.EnemyUnits.Add(data); } if (towerFloorParam != null && towerFloorParam.iname == GlobalVars.SelectedQuestID) { MonoSingleton <GameManager> .Instance.TowerResuponse.CalcEnemyDamage(this.EnemyUnits); } for (int index = 0; index < this.EnemyList.Count; ++index) { bool flag = index < list.Count && index < 10; ((Component)this.EnemyList[index]).get_gameObject().SetActive(flag); this.EnemyList[index].UpdateValue(); } }
private void SetEnemies(JSON_MapEnemyUnit[] json) { for (int index = 0; index < this.UnknownEnemyList.Count; ++index) { ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false); } List <JSON_MapEnemyUnit> list = ((IEnumerable <JSON_MapEnemyUnit>)json).ToList <JSON_MapEnemyUnit>(); TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse; TowerFloorParam towerFloorParam = (TowerFloorParam)null; if (towerResuponse != null) { towerFloorParam = towerResuponse.GetCurrentFloor(); } this.EnemyUnits.Clear(); int index1 = 0; for (int index2 = 0; index2 < list.Count; ++index2) { NPCSetting npcSetting = new NPCSetting(list[index2]); Unit data = new Unit(); data.Setup((UnitData)null, (UnitSetting)npcSetting, (Unit.DropItem)null, (Unit.DropItem)null); if (!data.IsGimmick) { TowerEnemyListItem towerEnemyListItem; if (this.EnemyList.Count <= index1) { towerEnemyListItem = (TowerEnemyListItem)((GameObject)Object.Instantiate <GameObject>((M0)this.EnemyTemplate)).GetComponent <TowerEnemyListItem>(); ((Component)towerEnemyListItem).get_transform().SetParent(this.EnemiesRoot.get_transform(), false); this.EnemyList.Add(towerEnemyListItem); } else { towerEnemyListItem = this.EnemyList[index1]; } if (towerFloorParam != null && towerFloorParam.iname == GlobalVars.SelectedQuestID && MonoSingleton <GameManager> .Instance.TowerEnemyUnit != null) { TowerResuponse.EnemyUnit enemyUnit = MonoSingleton <GameManager> .Instance.TowerEnemyUnit[index2]; data.Damage((int)data.MaximumStatus.param.hp - enemyUnit.hp, false); } DataSource.Bind <Unit>(((Component)towerEnemyListItem).get_gameObject(), data); this.EnemyUnits.Add(data); ++index1; } } for (int index2 = 0; index2 < this.EnemyList.Count; ++index2) { bool flag = index2 < list.Count && index2 < 10; ((Component)this.EnemyList[index2]).get_gameObject().SetActive(flag); this.EnemyList[index2].UpdateValue(); } }
public override void OnActivate(int pinID) { MonoSingleton <GameManager> .Instance.AudienceMode = false; if (pinID == 10) { this.mResume = true; pinID = 0; } if (pinID != 0 || ((Behaviour)this).get_enabled()) { return; } ((Behaviour)this).set_enabled(true); CriticalSection.Enter(CriticalSections.SceneChange); PlayerPartyTypes type = PlayerPartyTypes.Tower; GlobalVars.SelectedPartyIndex.Set((int)type); MonoSingleton <GameManager> .Instance.Player.SetPartyCurrentIndex((int)type); PunMonoSingleton <MyPhoton> .Instance.IsMultiPlay = false; PunMonoSingleton <MyPhoton> .Instance.IsMultiVersus = false; if (this.mResume) { this.btlID = (long)GlobalVars.BtlID; GlobalVars.BtlID.Set(0L); this.ExecRequest((WebAPI) new ReqTowerBtlComResume(this.btlID, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback))); } else { GameManager instance = MonoSingleton <GameManager> .Instance; if (!string.IsNullOrEmpty(this.QuestID)) { GlobalVars.SelectedQuestID = this.QuestID; GlobalVars.SelectedFriendID = string.Empty; } this.mStartingQuest = instance.FindQuest(GlobalVars.SelectedQuestID); if (this.PlayOffline || Network.Mode != Network.EConnectMode.Online) { return; } PartyData partyOfType = instance.Player.FindPartyOfType(type); if (this.mStartingQuest.type != QuestTypes.Tower) { return; } TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(this.mStartingQuest.iname); this.ExecRequest((WebAPI) new ReqBtlTowerComReq(towerFloor.tower_id, towerFloor.iname, partyOfType, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback))); } }
public static void DownloadMapSets(List <TowerFloorParam> floorParams) { if (floorParams == null) { return; } for (int index = 0; index < floorParams.Count; ++index) { TowerFloorParam floorParam = floorParams[index]; if (floorParam.map.Count > 0) { string mapSetName = floorParam.map[0].mapSetName; if (!string.IsNullOrEmpty(mapSetName)) { AssetManager.PrepareAssets(AssetPath.LocalMap(mapSetName)); } } } }
public string ShowProgLockMessage() { if (this.Param == null || this.Param.is_unlock) { return(string.Empty); } TowerFloorParam towerFloorParam = this.GetTowerFloorParam(this.Param.unlock_quest); if (towerFloorParam == null) { return(string.Empty); } TowerParam towerParam = this.GetTowerParam(towerFloorParam.tower_id); if (towerParam == null) { return(string.Empty); } return(LocalizedText.Get("sys.UNLOCK_COND_TOWER_PROG", (object)towerParam.name, (object)towerFloorParam.name)); }
protected override void SetFriendSlot() { if (!Object.op_Inequality((Object)this.FriendSlot, (Object)null)) { return; } this.FriendSlot.OnSelect = new GenericSlot.SelectEvent(((PartyWindow2)this).OnUnitSlotClick); if (this.mCurrentQuest.type != QuestTypes.Tower) { return; } TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(this.mCurrentQuest.iname); if (towerFloor == null) { return; } ((Component)this.FriendSlot).get_gameObject().SetActive(towerFloor.can_help); ((Component)this.SupportSkill).get_gameObject().SetActive(towerFloor.can_help); }
public override void OnActivate(int pinID) { if (pinID != 1) { return; } TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse; if (towerResuponse == null) { return; } TowerFloorParam currentFloor = towerResuponse.GetCurrentFloor(); if (currentFloor == null) { return; } ((Behaviour)this).set_enabled(true); this.ExecRequest((WebAPI) new ReqTowerFloorReset(GlobalVars.SelectedTowerID, currentFloor.iname, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback))); }
public void OnClickDetail() { QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null); if (!Object.op_Equality((Object)this.Detail, (Object)null) || dataOfClass == null) { return; } this.Detail = (GameObject)Object.Instantiate <GameObject>((M0)this.DetailtTmplate); DataSource.Bind <QuestParam>(this.Detail, dataOfClass); QuestCampaignData[] questCampaigns = MonoSingleton <GameManager> .Instance.FindQuestCampaigns(dataOfClass); DataSource.Bind <QuestCampaignData[]>(this.Detail, questCampaigns.Length != 0 ? questCampaigns : (QuestCampaignData[])null); TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse; TowerFloorParam data = (TowerFloorParam)null; if (towerResuponse != null) { data = towerResuponse.GetCurrentFloor(); } DataSource.Bind <TowerFloorParam>(this.Detail, data); this.Detail.SetActive(true); }
private void UpdateCurrentFloor() { if (this.status == null) { this.currentFloor = MonoSingleton <GameManager> .Instance.FindFirstTowerFloor(GlobalVars.SelectedTowerID); } else { this.currentFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(this.status.fname); DebugUtility.Assert(this.currentFloor != null, string.Format("フロア [{0}] が見つかりません", (object)this.status.fname)); if (this.currentFloor == null || this.status.state != QuestStates.Cleared) { return; } TowerFloorParam nextTowerFloor = MonoSingleton <GameManager> .Instance.FindNextTowerFloor(this.currentFloor.tower_id, this.currentFloor.iname); if (nextTowerFloor == null) { return; } this.currentFloor = nextTowerFloor; } }
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); }
private void Start() { this.mSb = SceneBattle.Instance; if (!UnityEngine.Object.op_Implicit((UnityEngine.Object) this.mSb) || !UnityEngine.Object.op_Implicit((UnityEngine.Object) this.mSb.BattleUI)) { return; } this.mBc = this.mSb.Battle; if (this.mBc == null) { return; } this.mTargetSub = this.mSb.BattleUI.TargetSub; if (!UnityEngine.Object.op_Implicit((UnityEngine.Object) this.mTargetSub)) { return; } if (this.mBc.IsMultiTower) { if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoLeaderSkill)) { this.GoLeaderSkill.SetActive(true); } if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoLeader2Skill)) { this.GoLeader2Skill.SetActive(true); } if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoFriendSkill)) { this.GoFriendSkill.SetActive(false); } } else if (this.mBc.IsMultiPlay && !this.mBc.IsMultiVersus) { if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoLeaderSkill)) { this.GoLeaderSkill.SetActive(this.mBc.IsMultiLeaderSkill); } if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoLeader2Skill)) { this.GoLeader2Skill.SetActive(false); } if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoFriendSkill)) { this.GoFriendSkill.SetActive(false); } } else { if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoLeaderSkill)) { this.GoLeaderSkill.SetActive(true); } if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoLeader2Skill)) { this.GoLeader2Skill.SetActive(false); } if (this.mBc.IsTower) { TowerFloorParam tfParam = this.TF_Param; if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoFriendSkill)) { this.GoFriendSkill.SetActive(tfParam.can_help); } } else if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoFriendSkill)) { this.GoFriendSkill.SetActive(!this.mBc.IsMultiVersus); } } if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoLeaderSkillBadge)) { this.GoLeaderSkillBadge.SetActive(this.mBc.IsMultiTower); } this.Refresh(this.mTargetSub.SelectedUnit); }
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 ScrollToCurrentFloor(TowerFloorParam floorParam) { this.mScrollListController.SetAnchoredPosition((float)((double)this.mScrollListController.ItemScaleMargin * (double)this.mFloorParams.IndexOf(floorParam) - (double)this.mScrollListController.ItemScaleMargin * 2.0)); }
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); } }
public void Deserialize(JSON_ReqTowerResuponse res) { if (res == null) { return; } this.TowerID = GlobalVars.SelectedTowerID; this.rtime = res.rtime; if (res.stats != null) { this.Deserialize(res.stats); } else { TowerFloorParam firstTowerFloor = MonoSingleton <GameManager> .Instance.FindFirstTowerFloor(this.TowerID); if (firstTowerFloor != null) { this.Deserialize(new JSON_ReqTowerResuponse.Json_TowerStatus() { fname = firstTowerFloor.iname, questStates = QuestStates.New }); } } if (res.pdeck != null) { this.pdeck = new List <TowerResuponse.PlayerUnit>(); for (int index = 0; index < res.pdeck.Length; ++index) { this.pdeck.Add(new TowerResuponse.PlayerUnit()); this.pdeck[index].dmg = res.pdeck[index].damage; this.pdeck[index].unitname = res.pdeck[index].uname; this.pdeck[index].is_died = res.pdeck[index].is_died; } } this.reset_cost = res.reset_cost; this.round = res.round; this.is_reset = (int)res.is_reset == 1; if (res.lot_enemies != null) { this.lot_enemies = new byte[res.lot_enemies.Length]; for (int index = 0; index < res.lot_enemies.Length; ++index) { this.lot_enemies[index] = (byte)res.lot_enemies[index]; } } this.Deserialize(res.edeck); if (res.rank != null) { this.turn_num = res.rank.turn_num; this.died_num = res.rank.died_num; this.retire_num = res.rank.retire_num; this.recover_num = res.rank.recovery_num; this.speedRank = res.rank.spd_rank; this.techRank = res.rank.tec_rank; this.spd_score = res.rank.spd_score; this.tec_score = res.rank.tec_score; this.ret_score = res.rank.ret_score; this.rcv_score = res.rank.rcv_score; } this.UpdateCurrentFloor(); }
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; }