Inheritance: BaseController
示例#1
0
    private static void Initialize()
    {
        ServiceLocator.Logger = GlobalConfig.RELEASE_TYPE != ReleaseType.RTM ? new UnityLogger() as ILogger : new NullLogger() as ILogger;
        ServiceLocator.State  = FileState.Load();
        //ServiceLocator.Text = GlobalConfig.RELEASE_TYPE == ReleaseType.alpha ? new GoogleText() as IText : new LocalText() as IText;

        //if (ServiceLocator.State.VersionMiddle < GlobalConfig.VERSION_MIDDLE ||
        //	ServiceLocator.State.VersionMajor < GlobalConfig.VERSION_MAJOR)
        //{
        //	ServiceLocator.State.Reset(true);
        //	Initialize();
        //	ServiceLocator.Logger.LogWarning("The saved state is outdated and will be reseted!");
        //	return;
        //}

        // disable quests invoking if we don't have the text provider
        if (Text.GetType() != typeof(NullText))
        {
            Events.StateUpdated += () =>
            {
                foreach (var quest in State.QuestRecords.Where(q => q.Status == QuestStatus.NotStarted))
                {
                    QuestController.StartQuest(quest);
                }
                foreach (var record in State.JournalRecords.Where(r => r.Check()))
                {
                    record.AssignedDay = State.CurrentDay;
                }
            };
        }

        Initialized = true;
    }
示例#2
0
    void Start()
    {
        uiController    = UIController.Instance;
        questController = QuestController.Instance;

        questController.onQuestChangeCallback += UpdatePanel;
    }
示例#3
0
 // Start is called before the first frame update
 void Start()
 {
     // Get the quest controller
     questController = GameObject.FindObjectOfType <QuestController>();
     // Set the meshes active to false
     meshes.SetActive(false);
 }
示例#4
0
    public int StrongestFoe(QuestController QC)
    {
        int Highest      = 0;
        int temp         = 0;
        int HighestIndex = -1;
        int ID           = this.playerID;

        for (int i = 0; i < QC.hands[ID].cards.Count; i++)
        {
            if (QC.hands[ID].cards[i].Type == "Foe")
            {
                temp = ((FoeCard)QC.hands[ID].cards[i]).BattlePoints;
                if (temp > Highest)
                {
                    Highest      = temp;
                    HighestIndex = i;
                }
            }
        }
        if (HighestIndex != -1)
        {
            return(HighestIndex);
        }
        else
        {
            Debug.Log("if this happened then we have a serrious Problem");
            return(0);
        }
    }
        public void Test_1_Post()
        {
            // Arrange
            var c = new QuestController();

            c.Request       = new HttpRequestMessage();
            c.Configuration = new HttpConfiguration();

            var pr = new ProgressRequest()
            {
                PlayerId      = player_name,
                PlayerLevel   = 1,
                ChipAmountBet = 233
            };

            // Act
            var r  = c.Post(pr);
            var cr = r as OkNegotiatedContentResult <ProgressResponse>;

            // Assert
            Assert.IsNotNull(r);
            Assert.IsNotNull(cr);
            Assert.IsNotNull(cr.Content);
            Assert.IsTrue(cr.Content.QuestPointsEarned > 0);
        }
示例#6
0
        public IEnumerator Refresh()
        {
            void RefreshQuestAction(
                EzQuestGroupModel questGroupModel,
                EzCompletedQuestList completedQuestList
                )
            {
                QuestGroupModel    = questGroupModel;
                CompletedQuestList = completedQuestList;

                _onGetQuestModel.RemoveListener(RefreshQuestAction);
                onWatchQuestEvent.Invoke(questGroupModel, completedQuestList);
            }

            _onGetQuestModel.AddListener(RefreshQuestAction);

            yield return(QuestController.GetQuestModel(
                             _client,
                             _session,
                             _questNamespaceName,
                             _questGroupName,
                             _onGetQuestModel,
                             _onError
                             ));
        }
示例#7
0
    public int SetNthStage(int total, int stageindex, QuestController Qc, bool EquipmentAllowed)
    {
        int        nthTotal = 0;
        int        ID       = this.playerID;
        List <int> Indexes  = new List <int>();
        int        index    = StrongestFoe(Qc);
        FoeCard    FC       = (FoeCard)Qc.hands[playerID].cards[index];

        nthTotal += FC.BattlePoints;
        PlayCard(index, Qc, true, stageindex);
        Indexes.Add(index);

        if (EquipmentAllowed == true)
        {
            for (int i = 0; i < Qc.hands[ID].cards.Count; i++)
            {
                if (Qc.hands[ID].cards[i].Type == "Equipment")
                {
                    EquipmentCard EC = (EquipmentCard)Qc.hands[ID].cards[i];
                    if (EC.BattlePoints + nthTotal < total)
                    {
                        index     = i;
                        nthTotal += EC.BattlePoints;
                        PlayCard(i, Qc, true, stageindex);
                        Indexes.Add(index);
                        break;
                    }
                }
            }
        }
        RemoveCards(Indexes, Qc);
        return(nthTotal);
    }
示例#8
0
    protected override void PostDialogAction()
    {
        QuestController questController = QuestController.Instance;

        if (HasQuest())
        {
            if (questController.hasQuest(quests[0]))
            {
                if (questController.GetQuestState(quests[0]) == QuestTracker.QuestState.Complete)
                {
                    QuestController.Instance.TurnInQuest(quests[0]);
                    quests.RemoveAt(0);
                    if (HasQuest())
                    {
                        markerHandler.ShowExclamationMark();
                    }
                    else
                    {
                        markerHandler.HideAllMarks();
                    }
                }
            }
            else
            {
                QuestController.Instance.GiveQuest(quests[0]);
                if (markerHandler != null)
                {
                    markerHandler.ShowQuestionMark();
                }
            }
        }
    }
示例#9
0
    protected override Dialog GetDialog()
    {
        Dialog          currentDialog   = dialog;
        QuestController questController = QuestController.Instance;

        if (HasQuest())
        {
            if (questController.hasQuest(quests[0]))
            {
                if (questController.GetQuestState(quests[0]) == QuestTracker.QuestState.InProgress)
                {
                    currentDialog = quests[0].inProgressDialog;
                }
                else if (questController.GetQuestState(quests[0]) == QuestTracker.QuestState.Complete)
                {
                    currentDialog = quests[0].completeDialog;
                }
            }
            else
            {
                currentDialog = quests[0].questDialog;
            }
        }

        return(currentDialog);
    }
示例#10
0
    // Start is called before the first frame update
    void Start()
    {
        questController = FindObjectOfType <QuestController>();
        EventController.OnQuestCompleted += Completed;

        questGiven = false;
    }
示例#11
0
    //public List<Quest> quests;

    // Use this for initialization
    void Start()
    {
        questController = FindObjectOfType <QuestController>();
        EventController.OnQuestCompleted += Completed;
        GiveQuest(null);
        EventController.OnQuestCompleted += GiveQuest;
    }
示例#12
0
    void Start()
    {
        //create gameobject so we can have access to a tranform thats position is Vector3.zero
        GameObject goMat = new GameObject("VisualPath", typeof(VisualPath));
        GameObject go;

        tileSpriteController = new TileSpriteController(world);
        tileSpriteController.Render();
        characterSpriteController = new CharacterSpriteController(world);
        furnitureSpriteController = new FurnitureSpriteController(world);
        jobSpriteController       = new JobSpriteController(world, furnitureSpriteController);
        inventorySpriteController = new InventorySpriteController(world, inventoryUI);
        buildModeController       = new BuildModeController();
        if (Settings.getSettingAsBool("DevTools_enabled", false))
        {
            spawnInventoryController = new SpawnInventoryController();
        }
        mouseController    = new MouseController(buildModeController, furnitureSpriteController, circleCursorPrefab);
        keyboardController = new KeyboardController(buildModeController, Instance);
        questController    = new QuestController();
        cameraController   = new CameraController();

        //Initialising controllers
        GameObject Controllers = GameObject.Find("Controllers");

        Instantiate(Resources.Load("UIController"), Controllers.transform);

        GameObject Canvas = GameObject.Find("Canvas");

        go      = Instantiate(Resources.Load("UI/ContextMenu"), Canvas.transform.position, Canvas.transform.rotation, Canvas.transform) as GameObject;
        go.name = "ContextMenu";
    }
示例#13
0
    public void Start()
    {
        // Create gameobject so we can have access to a tranform thats position is "Vector3.zero".
        GameObject mat = new GameObject("VisualPath", typeof(VisualPath));
        GameObject go;

        tileSpriteController = new TileSpriteController(World);
        tileSpriteController.Render();
        characterSpriteController = new CharacterSpriteController(World);
        furnitureSpriteController = new FurnitureSpriteController(World);
        jobSpriteController       = new JobSpriteController(World, furnitureSpriteController);
        inventorySpriteController = new InventorySpriteController(World, inventoryUI);
        buildModeController       = new BuildModeController();
        spawnInventoryController  = new SpawnInventoryController();
        mouseController           = new MouseController(buildModeController, furnitureSpriteController, circleCursorPrefab);
        keyboardController        = new KeyboardController(buildModeController, Instance);
        questController           = new QuestController();
        cameraController          = new CameraController();

        // Hiding Dev Mode spawn inventory controller if devmode is off.
        spawnInventoryController.SetUIVisibility(Settings.GetSettingAsBool("DialogBoxSettings_developerModeToggle", false));

        // Initialising controllers.
        GameObject controllers = GameObject.Find("Controllers");

        Instantiate(Resources.Load("UIController"), controllers.transform);

        GameObject canvas = GameObject.Find("Canvas");

        go      = Instantiate(Resources.Load("UI/ContextMenu"), canvas.transform.position, canvas.transform.rotation, canvas.transform) as GameObject;
        go.name = "ContextMenu";
    }
示例#14
0
        public QuestControllerShould()
        {
            _mockLogger = new Mock <ILogger <QuestController> >();
            var mockICurrentSession = new Mock <ICurrentSession>();

            _mockQuestDao = new Mock <IDB_GenericInterface <Quest> >();

            _mockHttpResponse = new Mock <HttpResponse>();
            _mockHttpResponse.SetupAllProperties();
            var mockHttpContext = new Mock <HttpContext>();

            mockHttpContext.SetupAllProperties();
            mockHttpContext.SetupGet(x => x.Response).Returns(_mockHttpResponse.Object);

            var mockTempData = new Mock <ITempDataDictionary>();

            _sutController = new QuestController(
                _mockLogger.Object,
                mockICurrentSession.Object,
                _mockQuestDao.Object
                )
            {
                TempData          = mockTempData.Object,
                ControllerContext = new ControllerContext {
                    HttpContext = mockHttpContext.Object
                }
            };
        }
示例#15
0
    private void Start()
    {
        choiceUI        = ChoiceUI.Instance;
        uiController    = UIController.Instance;
        questController = QuestController.Instance;

        cancelQuestButton.onClick.AddListener(() => { TogglePanel(false); });
    }
示例#16
0
    public void SetCurrentDialogue(Dialogue dialogue, bool _is_endgame)
    {
        is_endgame = _is_endgame;

        current_quest_controller = null;
        current_dialogue         = dialogue;
        PlayDialogue();
    }
示例#17
0
文件: Story.cs 项目: HARd/Convicted
 public void OnOpenQuestLog(QuestController questController, bool isComplete)
 {
     questController.gameObject.SetActive(true);
     questController.questPin.SetActive(true);
     questController.questText.text = Localization.Instance.GetLocale(text_id);
     questController.hintText       = Localization.Instance.GetLocale(hint_id);
     questController.questOk.SetActive(isComplete);
 }
示例#18
0
 void Start()
 {
     questController = GameObject.Find("QuestPanel").GetComponent<QuestController>();
     currentAttackCooldown = attackRate;
     currentSummonCooldown = summonSkillCoolDown;
     currentFireballCooldown = fireBallCoolDown;
     currentBottleCooldown = bottleCooldown;
 }
示例#19
0
        // Use this for initialization
        void Start()
        {
            bc2D        = GetComponent <BoxCollider2D> ();
            player      = FindObjectOfType <PlayerController> ();
            qController = FindObjectOfType <QuestController>();

            //TAKE INPUT CAPTURE FROM TERMINAL
        }
 void Interact()
 {
     if (QuestController.questStarted(5))
     {
         QuestController.addToObjective(5, 0, 1);
         Destroy(gameObject);
     }
 }
 public void TutorialSetup()
 {
     qController = FindObjectOfType <QuestController> ();
     tutorialEv  = QuestFunctions.instance.questEvents[0];
     QuestController.PullQuest();
     QuestController.currentQuest = tutorialEv;
     //QuestList.lastEvent = tutorialEv;
     qController.BeginQuest();
 }
示例#22
0
 public void initialize()
 {
     findCurrentQuest();
     players      = new List <PlayerModel>();
     numStages    = currQuest.stages;
     activePlayer = -1;
     currStageId  = -1;
     controller   = gameObject.GetComponent <QuestController>();
 }
示例#23
0
文件: MobHP.cs 项目: Zabakot/WarOf5
    void Start()
    {
        quest = GameObject.Find("QuestPanel").GetComponent<QuestController>();
        gameCNTRL = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<GameController>();
        currentHP = originalHP;
        thisTransform = GetComponent<Transform>();

        //hpBar.transform.localScale = new Vector3(currentHP / originalHP, 0.0f, 0.0f);
    }
示例#24
0
    public override void joinQuest(int numberOfStages, QuestController qc)
    {
        int   TempBP     = 0;
        float count      = 0f;
        int   AmourFound = 0;

        foreach (Card c in qc.hands[playerID].cards)
        {
            TempBP = 0;
            switch (c.Type)
            {
            case "Ally":
                TempBP += ((AllyCard)c).BattlePoints;
                if (TempBP >= 10)
                {
                    count++;
                }
                else if (((AllyCard)c).name == "Sir Percival")
                {
                    count += .5f;
                }
                break;

            case "Equipment":
                EquipmentCard TempEC = (EquipmentCard)c;
                if (TempEC.BattlePoints >= 10)
                {
                    count++;
                }
                else if (TempEC.name == "Corsair Dagger")
                {
                    count += .5f;
                }
                break;

            case "Amour":
                if (AmourFound < 1)
                {
                    count++;
                    AmourFound++;
                }
                break;

            default:
                break;
            }
        }
        Debug.Log(count);
        if (count >= numberOfStages)
        {
            qc.join(true);
        }
        else
        {
            qc.join(false);
        }
    }
示例#25
0
    public override void SetupQuest(int stages, QuestController Qc)
    {
        int StageMax = 51;

        StageMax = SetNthStage(StageMax, stages - 1, Qc, true);
        for (int i = 0; i < stages - 1; ++i)
        {
            StageMax = SetNthStage(StageMax, i, Qc, true);
        }
    }
示例#26
0
    private void Start()
    {
        questController = QuestController.Instance;
        interactionUI   = InteractionUI.Instance;

        if (quest != null && quest.done)
        {
            LoadNextQuest();
        }
    }
示例#27
0
    public void Setup(GameObject currentQuest, QuestScrollList currentScrollList)
    {
        quest = currentQuest;
        QuestController questController = quest.GetComponent <QuestController>();

        goldLabel.text     = "Gold: " + questController.gold;
        distanceLabel.text = "Distance: ";
        nameLabel.text     = quest.gameObject.name;
        scrollList         = currentScrollList;
    }
示例#28
0
// Tournament End


    //Quest Setup Methods Not Tested but works simply Agro Ai will set up the last Stage to be at most 40 with 1 foe and equipment if posible
    //then then the Ai will set up each stage to be less than the total of the previous max

// Quest Start
    public override void SetupQuest(int stages, QuestController Qc)
    {
        Debug.Log(stages);
        int StageMax = 41;

        StageMax = SetNthStage(StageMax, stages - 1, Qc, true);
        for (int i = 0; i < stages - 1; ++i)
        {
            StageMax = SetNthStage(StageMax, i, Qc, false);
        }
    }
示例#29
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#30
0
 // Start is called before the first frame update
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#31
0
    private void Start()
    {
        enemyInfo        = EnemyInfo.Instance;
        questController  = QuestController.Instance;
        combatController = CombatController.Instance;

        if (tag.Equals("Enemy"))
        {
            enemySpawner = GetComponent <EnemyController>().spawner;
        }
    }
        public NetworkOperator(IMultiplayerHelper helper, IMultiplayerEvents events, QuestStateStore questStateStore, StatsManager statsManager, QuestController questController, IManifest modManifest, IMonitor monitor)
        {
            this.helper          = helper;
            this.questStateStore = questStateStore;
            this.questController = questController;
            this.statsManager    = statsManager;
            this.modManifest     = modManifest;
            this.monitor         = monitor;

            events.ModMessageReceived += this.OnMessageReceived;
            events.PeerConnected      += this.OnClientConnected;
        }
示例#33
0
文件: Dialog.cs 项目: Zabakot/WarOf5
 void Start()
 {
     questController = GameObject.Find("QuestPanel").GetComponent<QuestController>();
     gameController = GameObject.Find("Main Camera").GetComponent<GameController>();
     if (PlayerPrefs.GetInt("NewGame") == 1)
     {
         if (gameObject.tag == "Raks")
         {
             gameObject.SetActive(true);
             PlayerPrefs.SetInt("Raks", 1);
             
         }
     }
     else
     {
         if (PlayerPrefs.GetInt("Raks") == 0)
         {
             Raks1.SetActive(false);
             Raks2.SetActive(true);
         }
         
     }
 }
示例#34
0
 void Start()
 {
     quest = GameObject.Find("QuestPanel").GetComponent<QuestController>();
 }