Example #1
0
    void quest3()
    {
        QuestProgress questProgress = FindObjectOfType <DataManager>().questProgress;
        PlayerHandler playerHandler = FindObjectOfType <PlayerHandler>();
        Inventory     inventory     = playerHandler.GetInventory();

        if (questProgress.tutorial_subQuestProgress == 0)
        {
            QueueDialogue(quest1_start);
            questProgress.tutorial_subQuestProgress++;
            return;
        }

        if (questProgress.tutorial_subQuestProgress == 1)
        {
            if (slimesNeeded > inventory.CheckForItem(new Item("slime")))
            {
                QueueDialogue(quest1_incomplete);
                return;
            }
        }

        QueueDialogue(quest1_complete);

        // Give power core
        inventory.addItem(new Item("spaceshipPowerCore"));

        questProgress.tutorial_questProgress++;
        questProgress.tutorial_subQuestProgress = 0;
        return;
    }
Example #2
0
        void Disconnect()
        {
            r_Resources?.Dispose();
            r_Experience?.Dispose();
            r_Expedition?.Dispose();
            r_Construction?.Dispose();
            r_Development?.Dispose();
            r_Sortie?.Dispose();
            r_Battle?.Dispose();
            r_Fate?.Dispose();
            r_RankingPoints?.Dispose();
            r_SortieConsumption?.Dispose();
            r_BattleDetail?.Dispose();

            QuestProgress?.Dispose();

            if (r_Connection != null)
            {
                r_Connection.Update -= OnDatabaseUpdate;

                r_Connection.Dispose();
            }

            foreach (var rCustomGroup in r_CustomRecordsGroups.Values)
            {
                rCustomGroup.Dispose();
            }

            IsConnected = false;
        }
Example #3
0
    void quest2()
    {
        QuestProgress questProgress = FindObjectOfType <DataManager>().questProgress;
        PlayerHandler playerHandler = FindObjectOfType <PlayerHandler>();
        Inventory     inventory     = playerHandler.GetInventory();

        if (questProgress.tutorial_subQuestProgress == 0)
        {
            QueueDialogue(quest2_start);
            questProgress.tutorial_subQuestProgress++;
            return;
        }

        if (questProgress.tutorial_subQuestProgress == 1)
        {
            if (armsNeeded > inventory.CheckForItem(new Item("hoboRoboArm")))
            {
                QueueDialogue(quest2_incomplete);
                return;
            }
        }

        QueueDialogue(quest2_complete);

        // Give panel
        inventory.addItem(new Item("spaceshipControlPanel"));

        questProgress.tutorial_questProgress++;
        questProgress.tutorial_subQuestProgress = 0;
        return;
    }
Example #4
0
 void Awake()
 {
     database  = QuestDatabase.Instance(questJSON);
     qlogmodel = GetComponent <QuestLogModel>();
     qlogview  = GetComponent <QuestLogView>();
     qprogress = GameObject.Find("Data").GetComponentInChildren <QuestProgress>();
 }
Example #5
0
    public override bool Interact()
    {
        QuestProgress questProgress = FindObjectOfType <DataManager>().questProgress;

        switch (questProgress.tutorial_questProgress)
        {
        case 1:
            quest1();
            return(true);

        case 2:
            quest2();
            return(true);

        case 3:
            quest3();
            return(true);

        case 4:
            quest4();
            return(true);

        case 5:
            quest5();
            return(true);

        default:
            return(false);
        }
    }
Example #6
0
    void quest1()
    {
        QuestProgress questProgress = FindObjectOfType <DataManager>().questProgress;
        PlayerHandler playerHandler = FindObjectOfType <PlayerHandler>();
        Inventory     inventory     = playerHandler.GetInventory();

        if (questProgress.tutorial_subQuestProgress == 0)
        {
            QueueDialogue(quest1_start);
            questProgress.tutorial_subQuestProgress++;
            return;
        }

        if (questProgress.tutorial_subQuestProgress == 1)
        {
            if (ironNeeded > inventory.CheckForItem(new Item("ore.iron")))
            {
                QueueDialogue(quest1_incomplete);
                return;
            }
        }

        QueueDialogue(quest1_complete);
        questProgress.tutorial_questProgress++;
        questProgress.tutorial_subQuestProgress = 0;
        return;
    }
Example #7
0
    void quest4()
    {
        QuestProgress questProgress = FindObjectOfType <DataManager>().questProgress;

        QueueDialogue(quest3_complete);
        questProgress.tutorial_questProgress++;
    }
Example #8
0
 public bool goToHouse; // prolog5_0에서 집에 들어갈지 말지 정하는 변수
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #9
0
    public override void Decode(BinaryReader reader)
    {
        InJoyDebugBase.DebugCommandResponse(this, ref reader);
        errorCode = reader.ReadInt16();

        if (errorCode == 0)
        {
            qpList = new List <QuestProgress>();

            int count = reader.ReadByte();

            for (int i = 0; i < count; i++)
            {
                QuestProgress qp = new QuestProgress();

                qp.quest_id = reader.ReadInt32();

                qp.target_progress_list = new List <QuestTargetProgress>();

                QuestTargetProgress qtp = new QuestTargetProgress();

                qtp.actual_amount = reader.ReadInt32();

                qp.target_progress_list.Add(qtp);

                qtp = new QuestTargetProgress();

                qtp.actual_amount = reader.ReadInt32();

                qp.target_progress_list.Add(qtp);

                qpList.Add(qp);
            }
        }
    }
Example #10
0
 public UserQuestViewModel(User user)
 {
     if (user != null)
     {
         UserId        = user.Id;
         QuestProgress = (QuestProgress)user.QuestProgress;
     }
 }
Example #11
0
 public void ChangeState(QuestProgress newProgress)
 {
     progress = newProgress;
     if (StateChanged != null)
     {
         StateChanged();
     }
 }
Example #12
0
 public void SaveState()
 {
     QuestProgress.Update();
     Debug.Log("Saving state at: " + secondsElapsed);
     PlayerPrefs.SetFloat("sec", secondsElapsed);
     PlayerPrefs.SetFloat("min", minuetsElapsed);
     PlayerPrefs.SetFloat("hr", hoursElapsed);
 }
Example #13
0
    /// <summary>
    /// mark a new active quest upon taking it, generating a new instance of questProgress
    /// </summary>
    /// <param name="index"></param>
    public void setActiveQuest(int index, string[,] questScript, List <QuestEvent> questEvents)
    {
        activeQuestIndex = index;

        currQuestProgress = new QuestProgress(); //TODO might need to specialize based on quest
        Debug.Log("new QuestProgress created");

        currQuestScript = questScript;
        currQuestEvents = questEvents;
    }
Example #14
0
 // Use this for initialization
 void Start()
 {
     itemDb           = GameObject.FindGameObjectWithTag("GameManager").GetComponent <ItemDatabase> ();
     questProg        = GameObject.FindGameObjectWithTag("QuestManager").GetComponent <QuestProgress>();
     dropManager      = GameObject.FindGameObjectWithTag("DropManager");
     dropedItemParent = dropManager.GetComponent <DropItemList> ().dropedItemParent;
     dropedItemPrefab = dropManager.GetComponent <DropItemList> ().dropedItemPrefab;
     lootboxPanel     = dropManager.GetComponent <DropItemList> ().LootBoxFrame;
     dropManager.GetComponent <DropItemList> ().skeletonId = transform.parent.GetComponent <EnemyStats> ().id;
     //LootPanel.SetActive (false);
 }
Example #15
0
    public void AddProgress(int step, QuestProgress progress)
    {
        if (progresses.Count < step)
        {
            progresses.Resize <List <QuestProgress> >(step);
            progresses[step - 1] = new List <QuestProgress>();
        }

        List <QuestProgress> progressesInStep = progresses[step - 1];

        progressesInStep.Add(progress);
    }
Example #16
0
 private void AddNewQuest(QuestType type, QuestProgress progress)
 {
     if (progress == QuestProgress.Started || progress == QuestProgress.Failed)
     {
         questList.Add(new QuestState(type, progress));
     }
     else
     {
         Debug.Log(String.Format(
                       "Try to ADD quest '{0}' with progress '{1}'",
                       type, progress));
     }
 }
Example #17
0
 private void UpdateQuest(QuestState questPair, QuestProgress progress)
 {
     if (questPair.questProgress <= progress)
     {
         questPair.questProgress = progress;
     }
     else
     {
         Debug.Log(String.Format(
                       "Tried to UPDATE quest '{0}' ({1}) by progress '{2}'",
                       questPair.questType, questPair.questProgress, progress));
     }
 }
Example #18
0
    private void SetQuestProgress(QuestType type, QuestProgress progress)
    {
        QuestState questPair = questList.Find(pair => pair.questType == type);

        if (questPair == null)
        {
            AddNewQuest(type, progress);
        }
        else
        {
            UpdateQuest(questPair, progress);
        }
    }
Example #19
0
 public static bool ToQuestProgressDTO(QuestProgress input, QuestProgressDTO output)
 {
     if (input == null)
     {
         return(false);
     }
     output.CharacterId     = input.CharacterId;
     output.IsFinished      = input.IsFinished;
     output.QuestData       = input.QuestData;
     output.QuestId         = input.QuestId;
     output.QuestProgressId = input.QuestProgressId;
     return(true);
 }
Example #20
0
        private void questProgressbmdToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            string fpath = OpenDialog();

            if (string.IsNullOrEmpty(fpath))
            {
                return;
            }

            QuestProgress Decoder = new QuestProgress(fpath, BmdFile.FileType.QuestProgress);
            ClientEditor  editor  = new ClientEditor(Decoder, false);

            editor.Show();
        }
Example #21
0
        private static QuestProgressDTO Insert(QuestProgressDTO quest, OpenNosContext context)
        {
            QuestProgress entity = new QuestProgress();

            Mapper.Mappers.QuestProgressMapper.ToQuestProgress(quest, entity);
            context.QuestProgress.Add(entity);
            context.SaveChanges();
            if (Mapper.Mappers.QuestProgressMapper.ToQuestProgressDTO(entity, quest))
            {
                return(quest);
            }

            return(null);
        }
Example #22
0
    //private GameObject player;



    /// <summary>
    /// Arxikopoioume tis metavlites mas gia ton exthro
    /// </summary>
    void Start()
    {
        achievManager           = GameObject.FindGameObjectWithTag("AchievmentManager").GetComponent <AchievmentGenerator> ();
        questProg               = GameObject.FindGameObjectWithTag("QuestManager").GetComponent <QuestProgress> ();
        playerCalc              = GameObject.FindGameObjectWithTag("PlayerChar").GetComponent <PlayerCalculations> ();
        playerWorldInteractions = GameObject.FindGameObjectWithTag("Player").GetComponent <WorldInteractions> ();
        plManager               = playerCalc.GetComponent <PlayerManager> ();
        stamina       = CalculateStamina(level);
        strength      = CalcualteStrength(level);
        maxHealth     = CalculateMaxHealth(stamina);
        currentHealth = maxHealth;
        attackDmg     = CalculateAttackDmg(strength);
        isNotDead     = true;
        transform.GetChild(2).gameObject.SetActive(false);
    }
Example #23
0
        private static QuestProgressDTO Update(QuestProgress entity, QuestProgressDTO quest, OpenNosContext context)
        {
            if (entity != null)
            {
                Mapper.Mappers.QuestProgressMapper.ToQuestProgress(quest, entity);
                context.SaveChanges();
            }

            if (Mapper.Mappers.QuestProgressMapper.ToQuestProgressDTO(entity, quest))
            {
                return(quest);
            }

            return(null);
        }
Example #24
0
    void SetQuestHelper(Quest quest)
    {
        Debug.Log("Received a new Quest:" + quest.questName);
        SendMessage("OnStartedQuest", quest.questName);
        var questProgress = new QuestProgress(quest, null);

        questProgress.quest = quest;
        progressForQuests.Add(quest.questName, questProgress);
        quest.endOfSceneNotification   += OnCompletedQuest;
        quest.sceneAbortedNotification += OnFailedQuest;
        IAvatar avatar = GetComponentInChildren <CharacterAvatar>();

        quest.activeLineNotification += OnSetupNextLine;
        quest.PlayScene(avatar.playerNotifications);
    }
Example #25
0
        /// <inheritdoc/>
        public void ShowQuestProgress(QuestDefinition quest, bool wasProgressionRequested)
        {
            using var writer = this.player.Connection.StartSafeWrite(QuestProgress.HeaderType, QuestProgress.Length);
            _ = new QuestProgress(writer.Span)
            {
                QuestGroup = (ushort)quest.Group,
            };

            var questState = this.player.SelectedCharacter.QuestStates.FirstOrDefault(q => q.Group == quest.Group);

            // to write the quest state into the message, we can use the same logic as for the QuestState. The messages are equal in their content.
            QuestState progress = writer.Span;

            progress.AssignActiveQuestData(questState, this.player);
            writer.Commit();
        }
Example #26
0
 public void LoadData()
 {
     questTitle                = data.questTitle;
     id                        = data.id;
     questDescription          = data.questDescription;
     questHint                 = data.questHint;
     questCongrats             = data.questCongrats;
     questSummary              = data.questSummary;
     nextQuests                = data.nextQuests;
     questObjective            = data.questObjective;
     questObjectiveRequirement = data.questObjectiveRequirement;
     expReward                 = data.expReward;
     goldReward                = data.goldReward;
     itemReward                = data.itemReward;
     progress                  = data.initialQuestState;
 }
Example #27
0
    private void AddQuestItem(QuestProgress qp, UIQuest uiQuest)
    {
        GameObject go = GameObject.Instantiate(questItemPrefab) as GameObject;

        go.transform.parent = gridGO.transform;

        go.transform.localPosition = Vector3.zero;

        go.transform.localScale = Vector3.one;

        UIQuestItem item = go.GetComponent <UIQuestItem>();

        item.Init(qp, uiQuest);

        _itemList.Add(item);
    }
Example #28
0
    // Use this for initialization
    void Start()
    {
        ShipStats     shipstats        = GameObject.Find("Data").GetComponentInChildren <ShipStats>();
        BaseStats     basestats        = GameObject.Find("Data").GetComponentInChildren <BaseStats>();
        OtherStats    otherstats       = GameObject.Find("Data").GetComponentInChildren <OtherStats>();
        QuestProgress questprogress    = GameObject.Find("Data").GetComponentInChildren <QuestProgress>();
        int           upgradeshipcount = shipstats.healthStat + shipstats.armorStat + shipstats.damageStat + shipstats.fireRateStat + shipstats.topSpeed + shipstats.handlingStat;

        UpgradeRecapShip.text = "Ship upgrades : " + upgradeshipcount.ToString();
        int upgradebasecount = basestats.chargeStat + basestats.fireDroneStat + basestats.numberDronesStat + basestats.printerStat + basestats.scanRangeStat + basestats.shieldStat;

        UpgradeRecapBase.text        = "Base upgrades : " + upgradebasecount.ToString();
        QuestCompletedRecap.text     = "Numer of completed quests : " + questprogress.CompletedQuests.Count.ToString();
        AsteroidsDestroyedRecap.text = "Asteroids mined : " + otherstats.DestroyedAsteroids.ToString();
        EnemiesDestroyedRecap.text   = "Enemies destroyed : " + otherstats.DestroyedEnemies.ToString();
        ItemsCraftedRecap.text       = "Items crafted : " + otherstats.CraftedItems.ToString();
    }
Example #29
0
        public static QuestProgress Get(Guid playerID, string questID)
        {
            var key = BuildKey(playerID, questID);

            if (!DB.Exists(key))
            {
                var entity = new QuestProgress
                {
                    QuestID = questID
                };

                Set(playerID, entity);
                return(entity);
            }

            return(DB.Get <QuestProgress>(key));
        }
Example #30
0
        public void InsertOrUpdateFromList(List <QuestProgressDTO> questProgressList)
        {
            try
            {
                using (OpenNosContext context = DataAccessHelper.CreateContext())
                {
                    void Insert(QuestProgressDTO quest)
                    {
                        QuestProgress entity = new QuestProgress();

                        Mapper.Mappers.QuestProgressMapper.ToQuestProgress(quest, entity);
                        context.QuestProgress.Add(entity);
                    }

                    void Update(QuestProgress entity, QuestProgressDTO quest)
                    {
                        if (entity != null)
                        {
                            Mapper.Mappers.QuestProgressMapper.ToQuestProgress(quest, entity);
                            context.SaveChanges();
                        }
                    }

                    foreach (QuestProgressDTO item in questProgressList)
                    {
                        QuestProgress entity = context.QuestProgress.FirstOrDefault(s => s.QuestProgressId == item.QuestProgressId);

                        if (entity == null)
                        {
                            Insert(item);
                        }
                        else
                        {
                            Update(entity, item);
                        }
                    }

                    context.SaveChanges();
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
        internal void ResetByProgress(QuestState rpState, QuestProgress rpProgress)
        {
            if (ID == 214)
                return;

            var rLimit = (int)Math.Ceiling(Total * 0.5);
            if (rpProgress == QuestProgress.Progress50 && Current < rLimit)
                CurrentInternal = rLimit;

            rLimit = (int)Math.Ceiling(Total * 0.8);
            if (rpProgress == QuestProgress.Progress80 && Current < rLimit)
                CurrentInternal = rLimit;

            rLimit = Total;
            if (rpState == QuestState.Completed && Current < rLimit)
                CurrentInternal = rLimit;

            State = rpState;
        }
Example #32
0
    void StartQuest(Quest quest)
    {
        if (quest == null)
            return;

        m_hudService.HUDControl.EnableRanking (false);

        currentQuest = quest;
        currentQuest.completedAmount = 0;
        //			LoadQuest (ref currentQuest);
        if (questProgress == null){
            GameObject obj = GameObject.Instantiate(Resources.Load("Prefabs/Event/QuestProgress")) as GameObject;
            m_hudService.HUDControl.AttachTop(ref obj);

            //obj.transform.localPosition = new Vector3(0, -280f, 0);
            obj.transform.localScale = new Vector3(0.35f, 0.35f, 1);

            questProgress = obj.GetComponent<QuestProgress>();
            questProgress.Initialize(currentQuest.questName, "");
        }
        questProgress.gameObject.SetActive (true);
        questProgress.SetProgress (0);
        for (int i = 0; i < currentQuest.actionList.Count; ++i) {
            QuestAction currentAction = currentQuest.actionList [i];
            GameObject actionObj = NGUITools.AddChild (actionGroup, Resources.Load ("Prefabs/Event/ActionEvent") as GameObject);

            Vector3 pos = new Vector3 (currentAction.loc.x, currentAction.loc.y, -7);
            actionObj.transform.localPosition = pos;
            actionObj.transform.localScale = new Vector3(0.75f, 0.75f, 1);

            ActionEvent actionEvent = actionObj.GetComponent<ActionEvent> ();
            actionEvent.Initialize (i, currentAction.staminaCost, gameObject, currentAction.desc);

            actionList.Add(actionEvent);
        }

        if (currentQuest.startChain)
            PlayerProfile.Get ().currentEventSet = currentQuest.chain;

        EnableMapScroll (true);
    }