Beispiel #1
0
    public IEnumerator UseAbilityCoroutine(ItemType ability)
    {
        AudioSource.PlayClipAtPoint(SelectSound, Camera.main.transform.position);

        abilityMenuObject.SetActive(false);
        fightMenuObject.SetActive(false);

        //textObject.text = string.Format ("{0} used {1}.", player.characterName, ability.ToString());
        textDisplayObject.SetText(string.Format("{0} used {1}.", player.characterName, ability.ToString()));

        ItemConversationData reply = enemy.TakeAbility(ability);

        string[] replyText = new string[1] {
            ". . ."
        };
        isHit = false;

        if (reply != null)
        {
            isHit     = (reply.damage > 0);
            replyText = reply.replies;
        }

        anim.SetBool("IsHit", isHit);
        anim.SetTrigger("Attack1");
        egoEnemyText.text = enemy.ego.ToString();


        yield return(StartCoroutine(WaitForInput()));

        yield return(StartCoroutine(textDisplayObject.DisplayTextCoroutine(replyText, enemy.color)));

        EndPlayerTurn();
    }
Beispiel #2
0
    /*public TierData TakeTalk(ReplyData data)
     * {
     *
     * }*/

    public virtual ItemConversationData TakeAbility(ItemType item)
    {
        //string[] returnVal = new string[1] {". . ."};

        ItemConversationData icd = null;

        foreach (ItemConversationData i in data.items)
        {
            //Debug.Log (item.ToString ());
            if (i.item == item.ToString())
            {
                icd = i;
            }
        }

        if (icd != null)
        {
            //returnVal = icd.replies;
            TakeDamage(icd.damage);
        }

        return(icd);
        //Debug.Log (returnVal [0]);
        //return returnVal;
    }