private QuestParam ConvertQuestParam(QuestParam original) { if (original == null) { return((QuestParam)null); } JSON_QuestParam json = new JSON_QuestParam(); json.iname = this.iname; json.title = this.title; json.name = this.name; json.expr = this.expr; json.cond = this.cond; json.cond_quests = new string[1] { this.cond_quest }; json.map = new JSON_MapParam[this.map.Count]; json.rdy_cnd = this.rdy_cnd; json.lv = (int)this.lv; json.pt = (int)this.pt; for (int index = 0; index < this.map.Count; ++index) { json.map[index] = new JSON_MapParam() { set = this.map[index].mapSetName, scn = this.map[index].mapSceneName, bgm = this.map[index].bgmName, btl = this.map[index].battleSceneName, ev = this.map[index].eventSceneName } } ; json.area = original.ChapterID; json.type = 7; json.notcon = 1; json.notitm = 1; json.gold = 0; TowerRewardParam towerReward = MonoSingleton <GameManager> .Instance.FindTowerReward(this.reward_id); if (towerReward != null) { List <TowerRewardItem> towerRewardItem1 = towerReward.GetTowerRewardItem(); for (int index = 0; index < towerRewardItem1.Count; ++index) { TowerRewardItem towerRewardItem2 = towerRewardItem1[index]; if (towerRewardItem2 != null && towerRewardItem2.type == TowerRewardItem.RewardType.Gold) { json.gold = towerRewardItem2.num; } } } QuestParam questParam = new QuestParam(); questParam.Deserialize(json); return(questParam); }
private QuestParam ConvertQuestParam(QuestParam original) { if (original == null) { return((QuestParam)null); } GameManager instance = MonoSingleton <GameManager> .Instance; JSON_QuestParam json = new JSON_QuestParam(); json.iname = this.tower_id + "_" + this.floor.ToString(); json.title = this.title; json.name = this.name; json.expr = this.expr; json.cond = this.cond; if (this.cond_floor != 0) { QuestParam quest = instance.FindQuest(this.tower_id + "_" + (object)this.cond_floor); if (quest != null) { json.cond_quests = new string[1] { quest.iname } } ; } json.map = new JSON_MapParam[this.map.Count]; json.lv = (int)this.lv; json.pt = (int)this.pt; for (int index = 0; index < this.map.Count; ++index) { json.map[index] = new JSON_MapParam() { set = this.map[index].mapSetName, scn = this.map[index].mapSceneName, bgm = this.map[index].bgmName, btl = this.map[index].battleSceneName, ev = this.map[index].eventSceneName } } ; json.area = original.ChapterID; json.type = (int)original.type; json.notcon = (int)this.notcon; json.notitm = 1; json.pnum = (int)original.playerNum; json.gold = 0; json.is_unit_chg = 0; json.multi = 1; json.me_id = this.me_id; json.is_wth_no_chg = this.is_wth_no_chg; json.wth_set_id = this.wth_set_id; TowerRewardParam towerReward = MonoSingleton <GameManager> .Instance.FindTowerReward(this.reward_id); if (towerReward != null) { List <TowerRewardItem> towerRewardItem1 = towerReward.GetTowerRewardItem(); for (int index = 0; index < towerRewardItem1.Count; ++index) { TowerRewardItem towerRewardItem2 = towerRewardItem1[index]; if (towerRewardItem2 != null && towerRewardItem2.type == TowerRewardItem.RewardType.Gold) { json.gold = towerRewardItem2.num; } } } QuestParam questParam = new QuestParam(); questParam.Deserialize(json); questParam.EntryCondition = original.EntryCondition; questParam.unitNum = (OShort)this.unitnum; return(questParam); }