예제 #1
0
        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);
        }
예제 #2
0
        public JSON_QuestParam ConvertQuestParam()
        {
            JSON_QuestParam jsonQuestParam = new JSON_QuestParam();

            jsonQuestParam.iname       = this.iname;
            jsonQuestParam.title       = this.title;
            jsonQuestParam.name        = this.name;
            jsonQuestParam.expr        = this.expr;
            jsonQuestParam.cond        = this.cond;
            jsonQuestParam.cond_quests = new string[1]
            {
                this.cond_quest
            };
            jsonQuestParam.map     = new JSON_MapParam[this.map.Length];
            jsonQuestParam.rdy_cnd = this.rdy_cnd;
            jsonQuestParam.lv      = (int)this.lv;
            jsonQuestParam.pt      = (int)this.pt;
            for (int index = 0; index < this.map.Length; ++index)
            {
                jsonQuestParam.map[index] = new JSON_MapParam()
                {
                    set = this.map[index].set,
                    scn = this.map[index].scn,
                    bgm = this.map[index].bgm,
                    btl = this.map[index].btl,
                    ev  = this.map[index].ev
                }
            }
            ;
            jsonQuestParam.type          = 7;
            jsonQuestParam.notcon        = 1;
            jsonQuestParam.notitm        = 1;
            jsonQuestParam.gold          = 0;
            jsonQuestParam.is_unit_chg   = (int)this.is_unit_chg;
            jsonQuestParam.naut          = this.naut;
            jsonQuestParam.me_id         = this.me_id;
            jsonQuestParam.is_wth_no_chg = this.is_wth_no_chg;
            jsonQuestParam.wth_set_id    = this.wth_set_id;
            jsonQuestParam.tower_mission = this.mission;
            return(jsonQuestParam);
        }
    }
예제 #3
0
        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);
        }