コード例 #1
0
 /// <summary>
 /// Talk the specified npc and iNpc.
 /// </summary>
 /// <param name="npc">Npc.</param>
 /// <param name="iNpc">I npc.</param>
 public void Talk(Npc npc, InteractiveNPC iNpc)
 {
     if (!dManager.isLocked)
     {
         dManager.Dialogue(iNpc, npc, npc.name, npc.message, npc.hasQuestion, npc.sells);
     }
 }
コード例 #2
0
ファイル: Interactions.cs プロジェクト: God601/mooege
 public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player)
 {
     return new NPCInteraction()
     {
         Type = NPCInteractionType.IdentifyAll,
         ConversationSNO = -1,
         Field2 = -1,
         State = NPCInteractionState.New // Has items to identify? If no disable,
     };
 }
コード例 #3
0
ファイル: Interactions.cs プロジェクト: God601/mooege
 public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player)
 {
     return new NPCInteraction()
     {
         Type = NPCInteractionType.Hire,
         ConversationSNO = -1,
         Field2 = -1,
         State = (npc as Hireling).HasHireling ? NPCInteractionState.New : NPCInteractionState.Disabled
     };
 }
コード例 #4
0
ファイル: Interactions.cs プロジェクト: God601/mooege
 public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player)
 {
     return new NPCInteraction()
     {
         Type = NPCInteractionType.Conversation,
         ConversationSNO = this.ConversationSNO,
         Field2 = -1,
         State = (Read ? NPCInteractionState.Used : NPCInteractionState.New),
     };
 }
コード例 #5
0
ファイル: Interactions.cs プロジェクト: realTobby/NullD
 public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player)
 {
     return(new NPCInteraction()
     {
         Type = NPCInteractionType.Craft,
         ConversationSNO = -1,
         Field2 = -1,
         State = NPCInteractionState.New,
     });
 }
コード例 #6
0
ファイル: Interactions.cs プロジェクト: ripper47/mooege
 public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player)
 {
     return new NPCInteraction()
     {
         Type = NPCInteractionType.Craft,
         ConversationSNO = -1,
         Field2 = -1,
         State = NPCInteractionState.New,
     };
 }
コード例 #7
0
ファイル: Interactions.cs プロジェクト: realTobby/NullD
 public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player)
 {
     return(new NPCInteraction()
     {
         Type = NPCInteractionType.IdentifyAll,
         ConversationSNO = -1,
         Field2 = -1,
         State = NPCInteractionState.New // Has items to identify? If no disable,
     });
 }
コード例 #8
0
ファイル: Interactions.cs プロジェクト: realTobby/NullD
 public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player)
 {
     return(new NPCInteraction()
     {
         Type = NPCInteractionType.Hire,
         ConversationSNO = -1,
         Field2 = -1,
         State = (npc as Hireling).HasHireling ? NPCInteractionState.New : NPCInteractionState.Disabled
     });
 }
コード例 #9
0
ファイル: Interactions.cs プロジェクト: realTobby/NullD
 public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player)
 {
     return(new NPCInteraction()
     {
         Type = NPCInteractionType.Conversation,
         ConversationSNO = this.ConversationSNO,
         Field2 = -1,
         State = (Read ? NPCInteractionState.Used : NPCInteractionState.New),
     });
 }
コード例 #10
0
 /// <summary>
 /// Start dialogue for specified npc. OLD DIALOGUE SYSTEM.
 /// </summary>
 /// <param name="iNpc">Interactive npc.</param>
 /// <param name="npc">Npc.</param>
 /// <param name="name">Name.</param>
 /// <param name="text">Text.</param>
 /// <param name="hasQuestion">If set to <c>true</c> has question.</param>
 /// <param name="sells">If set to <c>true</c> sells.</param>
 public void Dialogue(InteractiveNPC iNpc, Npc npc, string name, string text, bool hasQuestion, bool sells)
 {
     dialogueButtons.SetActive(true);
     if (!isActive)
     {
         Debug.Log("Talking to: " + name);
         this.iNpc  = iNpc;
         this.npc   = npc;
         currentNpc = name;
         dialogueButtons.SetActive(hasQuestion);
         dialogueButtonsSell.SetActive(sells);
         dialogueOkButton.SetActive(false);
         isActive          = true;
         dialgueName.text  = name + ":";
         dialogueText.text = text;
         locked            = true;
         isLocked          = true;
     }
 }
コード例 #11
0
    /// <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;
        }
    }
コード例 #12
0
    /// <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);
            }
        }
    }