예제 #1
0
 void AddSkillToEachCharacter(SkillActor skillActor, List <Skill> skills)
 {
     foreach (var skill in skills)
     {
         if (skillActor.skills.Contains(skill) == false)
         {
             skillActor.AddSkill(skill);
         }
     }
 }
예제 #2
0
    public override void Interact(GameObject obj)
    {
        if (isInteracted == true && activateOnce || Time.timeScale == 0 || !canInput)
        {
            return;
        }
        canInput = false;
        StartCoroutine(Delay());
        PlayerController player = obj.GetComponent <PlayerController>();
        SkillActor       actor  = player.GetComponent <SkillActor>();

        Debug.Log(actor);
        if (!actor.skills.Any(item => item.ID == skill.ID) && !giveToSpecificPlayer)
        {
            actor.AddSkill(skill);
        }
        if (!actor.skills.Any(item => item.ID == skill.ID) && giveToSpecificPlayer)
        {
            if (player.ID == playerID && !isInteracted)
            {
                actor.AddSkill(skill);
                if (item != null)
                {
                    gameManager.sharedInventory.AddItem(item);
                }
                GetComponent <SpriteRenderer>().sprite = on;
                isInteracted = true;
                EventActivated.Invoke(obj);
                EventInteracted.Invoke(obj);
            }

            else
            {
                if (Time.timeScale == 1)
                {
                    EventOnWrongPlayer.Invoke();
                }
            }
        }
    }
예제 #3
0
    public void ContinueTutorial()
    {
        //AddSkillToMage
        SkillActor sActor = combatManager.AllyTeam.Find(c => c.CharacterName == "Mage").GetComponent <SkillActor>();

        sActor.AddSkill(MageSkills.First());

        combatManager.OnTutorialRoundEnd.Invoke();

        OnPopUpInstruction.AddListener(First_Dialogue_Finish);

        ShowTutorialPanel();

        //Dialogues Setup
        if (DialogueList.Count > 1)
        {
            DialogueList.First().OnDialogueEnd.AddListener(First_Dialogue_Finish);
            NextDialogue();
        }
    }
예제 #4
0
    void Third_Dialogue_Start()
    {
        combatManager.OnCurrentRoundEnd.RemoveListener(Third_Dialogue_Start);

        //AddSkillToRogue
        SkillActor sActor = combatManager.AllyTeam.Find(c => c.CharacterName == "Rogue").GetComponent <SkillActor>();

        sActor.AddSkill(RogueSkills.First());

        combatManager.OnTutorialRoundEnd.Invoke();

        OnPopUpInstruction.AddListener(Third_Dialogue_Finish);
        ShowTutorialPanel();

        if (DialogueList.Count > 1)
        {
            //Update Dialogue
            NextDialogue();

            //AddListener
            DialogueList.First().OnDialogueEnd.AddListener(Third_Dialogue_Finish);
        }
    }