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; }
void Start() { uiController = UIController.Instance; questController = QuestController.Instance; questController.onQuestChangeCallback += UpdatePanel; }
// 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); }
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); }
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 )); }
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); }
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(); } } } }
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); }
// Start is called before the first frame update void Start() { questController = FindObjectOfType <QuestController>(); EventController.OnQuestCompleted += Completed; questGiven = false; }
//public List<Quest> quests; // Use this for initialization void Start() { questController = FindObjectOfType <QuestController>(); EventController.OnQuestCompleted += Completed; GiveQuest(null); EventController.OnQuestCompleted += GiveQuest; }
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"; }
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"; }
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 } }; }
private void Start() { choiceUI = ChoiceUI.Instance; uiController = UIController.Instance; questController = QuestController.Instance; cancelQuestButton.onClick.AddListener(() => { TogglePanel(false); }); }
public void SetCurrentDialogue(Dialogue dialogue, bool _is_endgame) { is_endgame = _is_endgame; current_quest_controller = null; current_dialogue = dialogue; PlayDialogue(); }
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); }
void Start() { questController = GameObject.Find("QuestPanel").GetComponent<QuestController>(); currentAttackCooldown = attackRate; currentSummonCooldown = summonSkillCoolDown; currentFireballCooldown = fireBallCoolDown; currentBottleCooldown = bottleCooldown; }
// 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(); }
public void initialize() { findCurrentQuest(); players = new List <PlayerModel>(); numStages = currQuest.stages; activePlayer = -1; currStageId = -1; controller = gameObject.GetComponent <QuestController>(); }
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); }
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); } }
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); } }
private void Start() { questController = QuestController.Instance; interactionUI = InteractionUI.Instance; if (quest != null && quest.done) { LoadNextQuest(); } }
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; }
// 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); } }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
// Start is called before the first frame update void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
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; }
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); } } }
void Start() { quest = GameObject.Find("QuestPanel").GetComponent<QuestController>(); }