/// <summary> /// Method for QuestNPC dialogue /// </summary> /// <param name="questNpc">Quest npc.</param> /// <param name="name">Name.</param> /// <param name="hasQuestion">If set to <c>true</c> has question.</param> /// <param name="status">Status.</param> public void SideQuestDialogue(QuestNPC questNpc, string name, bool hasQuestion, string status) { if (!isActive) { isActive = true; questNPC = questNpc; dialogueButtons.SetActive(hasQuestion); dialogueButtonsSell.SetActive(false); dialogueOkButton.SetActive(false); currentNpc = name; dialgueName.text = name + ":"; dialogueText.text = dialogueMap.GetDialogue(name + status); locked = true; isLocked = true; } }
// Update is called once per frame void Update() { for (int i = 0; i < QuestNPC.Count; i++) { QG = QuestNPC[i]; if (QG && QG.HasQuests) { if (QG.AssignedQuest) { QG.Quest.TrackingQuest(); break; } } else { NoQuestFound(); } } }
/// <summary> /// Raises the trigger exit2 d event. /// </summary> /// <param name="other">Other.</param> void OnTriggerExit2D(Collider2D other) { if (other.gameObject.GetComponent <InteractiveNPC> ()) { InteractiveNPC npcCheck = other.gameObject.GetComponent <InteractiveNPC> (); if (npcCheck.talks) { currentIntreactiveNPC.StopTalk(); currentIntreactiveNPC = null; iButton.color = Color.white; } } if (other.gameObject.GetComponent <GenericNPC> ()) { GenericNPC npcCheck = other.gameObject.GetComponent <GenericNPC> (); if (npcCheck.talks) { currentGenericNpc.StopTalk(); currentGenericNpc = null; iButton.color = Color.white; } } if (other.gameObject.GetComponent <QuestNPC> ()) { QuestNPC npcCheck = other.gameObject.GetComponent <QuestNPC> (); currentQuestNpc.StopTalk(); currentQuestNpc = null; iButton.color = Color.white; } if (other.gameObject.GetComponent <MerchantNPC> ()) { MerchantNPC npcCheck = other.gameObject.GetComponent <MerchantNPC> (); currentMerchant.StopTalk(); currentMerchant = null; iButton.color = Color.white; } }
/// <summary> /// Creates a map in the map array. /// </summary> /// <param name="tileArr">The array of Tiles that make up the map</param> /// <param name="rectArr">The array of Rectangles that make up the minimap</param> /// <param name="monsArr">The list containing live monsters on this map</param> /// <param name="deadMons">The list containing dead monsters on this map</param> /// <param name="itemArr">The list containing items on this map</param> /// <param name="n">The map name to be displayed in the status area</param> /// <param name="t">The map type (determines BGM)</param> /// <param name="posX">X position in the game's map array</param> /// <param name="posY">Y position in the game's map array</param> /// <param name="d">Z position (depth) in the game's map array</param> /// <param name="hasShop">True if the map has a shop, false otherwise</param> /// <param name="rooms">Rooms on this map (applies to dungeon maps)</param> public Map(ref Tile[,] tileArr, ref Rectangle[,] rectArr, ref List <Monster> monsArr, ref List <Monster> deadMons, ref List <Item> itemArr, string n, int t, int posX, int posY, int d, bool hasShop, List <Room> rooms) { name = n; type = t; mapPosX = posX; mapPosY = posY; depth = d; questNPCs = new List <QuestNPC>(); if (t == 0) { // Forest/Grasslands Area defaultTileTx = Tile.grassTexture; overlay.velocity = new Vector2(0.25f, 0.25f); mapOverlayTx = Overlay.fogTx; overlay.isScrolling = true; mapScrRect = mapRectArray[0]; bgm = SoundUpdater.forestBGM; } else if (t == 2) { // Snow Area defaultTileTx = Tile.snowTexture; mapOverlayTx = Overlay.snowTx; overlay.velocity = new Vector2(2.0f, 2.0f); overlay.isScrolling = true; //mapScrPos = new Vector2(txObj.mapScrBG.Width * 0.85f, 0); mapScrRect = mapRectArray[1]; bgm = SoundUpdater.forestBGM; //to be changed (obviously) posX = mapPosX - (t + 1); } else if (t == 1) { // Catacombs/Dungeon Area defaultTileTx = Tile.floorTexture; mapOverlayTx = Overlay.undergroundTx; hasScrollingOverlay = false; overlay.isScrolling = false; overlay.velocity = Vector2.Zero; mapScrRect = mapRectArray[0]; bgm = SoundUpdater.dungeonBGM; }//if (t == 0) //else areaDisplayArr[t][posX, posY] = new Tile(defaultTileTx, "", "", Game1.miniMapRect.X + 10 + (Tile.tWidth * posX), Game1.miniMapRect.Y + 10 + (Tile.tHeight * posY), false); areaMapTile = areaDisplayArr[t][posX, posY]; savedTileArray = new Tile[maxTilesH, maxTilesV]; savedTileArray = tileArr; savedVisTileArray = new Tile[visibleTilesX, visibleTilesY]; savedVisTileArray = visibleTilesArray; savedMMapRects = new Rectangle[maxTilesH, maxTilesV]; savedMMapRects = rectArr; savedMonsterArray = new List <Monster>(); savedMonsterArray = monsArr; savedDMonsterArray = new List <Monster>(); savedDMonsterArray = deadMons; savedItemArray = new List <Item>(); savedItemArray = itemArr; isShopMap = hasShop; savedRooms = new List <Room>(rooms); questNPC = null; }
void Awake() { isQuestNPC = (GetComponent<QuestNPC> () != null); if (isQuestNPC) npcComponent = GetComponent<QuestNPC> (); }
/// <summary> /// Raises the trigger enter2 d event. /// </summary> /// <param name="other">Other.</param> void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.GetComponent <GenericNPC> ()) { currentGenericNpc = other.gameObject.GetComponent <GenericNPC> (); iButton.color = Color.green; } if (other.gameObject.GetComponent <QuestNPC> ()) { currentQuestNpc = other.gameObject.GetComponent <QuestNPC> (); iButton.color = Color.green; } if (other.gameObject.GetComponent <MerchantNPC> ()) { currentMerchant = other.gameObject.GetComponent <MerchantNPC> (); iButton.color = Color.green; } //Hospial door out if (other.gameObject.name.Equals("Door") && dManager.ObjectiveStatus > 0) { gameController.ChangeScene("hospital", "city", 84f, -72.5f); if (dManager.ObjectiveStatus == 1) { dManager.ObjectiveStatus += 1; gameController.ChangeObjective("Find a way to sell your meds"); dManager.Dialogue("Me", "I should go see my buddy at southwest from here. That junkie definitely buys this shit."); } } else if (other.gameObject.name.Equals("Door") && dManager.ObjectiveStatus == 0) { currentIntreactiveNPC = other.gameObject.GetComponent <InteractiveNPC> (); npc = currentIntreactiveNPC.hospitalDoor; currentIntreactiveNPC.Talk(npc, currentIntreactiveNPC); } if (other.gameObject.name.Equals("Hospital_Door")) { gameController.ChangeScene("city", "hospital", 7f, -17f); } //FastFood door 1 in if (other.gameObject.name.Equals("FastFood_1_Door")) { gameController.ChangeScene("city", "fastfood", 0f, -2.5f); } //FastFood door 1 out if (other.gameObject.name.Equals("FastFood_1_Door_Out")) { gameController.ChangeScene("fastfood", "city", 74f, -88.6f); } //FastFood door 2 in if (other.gameObject.name.Equals("FastFood_2_Door")) { gameController.ChangeScene("city", "fastfood2", 6f, -2.7f); } //FastFood door 2 out if (other.gameObject.name.Equals("FastFood_2_Door_Out")) { gameController.ChangeScene("fastfood2", "city", 82f, -88.6f); } //FastFood door 3 in if (other.gameObject.name.Equals("FastFood_3_Door")) { gameController.ChangeScene("city", "fastfood3", -2f, -17.5f); } //FastFood door 3 Out if (other.gameObject.name.Equals("FastFood_3_Door_Out")) { gameController.ChangeScene("fastfood3", "city", 24.5f, -53.5f); } //FastFood door 4 in if (other.gameObject.name.Equals("FastFood_4_Door")) { gameController.ChangeScene("city", "fastfood4", -2f, -17.5f); } //FastFood door 4 Out if (other.gameObject.name.Equals("FastFood_4_Door_Out")) { gameController.ChangeScene("fastfood4", "city", 37.3f, -53.5f); } //FastFood door 5 in if (other.gameObject.name.Equals("FastFood_5_Door")) { gameController.ChangeScene("city", "fastfood5", 0f, -1.2f); } //FastFood 5 out if (other.gameObject.name.Equals("FastFood_5_Door_Out")) { gameController.ChangeScene("fastfood5", "city", 52f, -89.5f); } //Restaurant door in if (other.gameObject.name.Equals("Restaurant_Door")) { gameController.ChangeScene("city", "restaurant", -4.5f, -12.5f); } //Restaurant out if (other.gameObject.name.Equals("Restaurant_Door_Out")) { gameController.ChangeScene("restaurant", "city", 108f, -74.5f); } //coin if (other.gameObject.name.Equals("Coin")) { gameController.player.wallet.AddMoney(150); Destroy(other.gameObject); } //merchant in fasfood1 if (other.gameObject.name.Equals("FastFoodMerchant")) { iButton.color = Color.green; currentIntreactiveNPC = other.gameObject.GetComponent <InteractiveNPC> (); npc = currentIntreactiveNPC.FastFoodJoe; } if (other.gameObject.name.Equals("BurgerBob")) { iButton.color = Color.green; currentIntreactiveNPC = other.gameObject.GetComponent <InteractiveNPC> (); npc = currentIntreactiveNPC.BurgerBob; } if (other.gameObject.name.Equals("DrugBuyer")) { iButton.color = Color.green; currentIntreactiveNPC = other.gameObject.GetComponent <InteractiveNPC> (); npc = currentIntreactiveNPC.DrugBuyer; } if (other.gameObject.name.Equals("objectiveVegan")) { iButton.color = Color.green; currentIntreactiveNPC = other.gameObject.GetComponent <InteractiveNPC> (); npc = currentIntreactiveNPC.MaleVegan; if (StaticObjects.FREE_CHEESEBURGER) { currentIntreactiveNPC.ChangeDialogueStatus(npc, "Hi I'm Vegan\n\n\"Beat him?\"", true, false); } } }