コード例 #1
0
    public override Mood DetermineMood(Action action, ActionReciever receiver)
    {
        switch (action)
        {
        case Action.HELP:
            switch (receiver)
            {
            case ActionReciever.ROYALTY:         // Dislikes helping royalty
                return(Mood.UPSET);

            case ActionReciever.ANIMAL:         // Likes helping animals
                return(Mood.HAPPY);
            }
            break;

        case Action.HURT:
            switch (receiver)
            {
            case ActionReciever.ANIMAL:         // Dislikes hurting animals
                return(Mood.UPSET);

            case ActionReciever.CHILD:         // Dislikes hurting children
                return(Mood.UPSET);
            }
            break;
        }

        return(Mood.NEUTRAL);
    }
コード例 #2
0
    public override Mood DetermineMood(Action action, ActionReciever receiver)
    {
        switch (action)
        {
        case Action.HELP:
            switch (receiver)
            {
            case ActionReciever.CHILD:         // Likes helping children
                return(Mood.HAPPY);

            case ActionReciever.MURDERER:         // Dislikes helping murderers
                return(Mood.UPSET);

            case ActionReciever.PEASENT:         // Likes helping peasentry
                return(Mood.HAPPY);
            }
            break;

        case Action.HURT:
            switch (receiver)
            {
            case ActionReciever.CHILD:         // Dislikes hurting children
                return(Mood.UPSET);

            case ActionReciever.ROYALTY:         // Dislikes hurting royalty
                return(Mood.UPSET);

            case ActionReciever.PEASENT:        // Dislikes hurting peasentry
                return(Mood.UPSET);
            }
            break;
        }

        return(Mood.NEUTRAL);
    }
コード例 #3
0
    void PerformAction(Vector2 direction, int selection)
    {
        RaycastHit2D hit = Physics2D.Raycast((Vector2)transform.position + new Vector2(0, transform.GetComponent <Collider2D>().bounds.size.y / 2), direction, interactDistance, interactLayer);

        if (hit)
        {
            // Show the healthbar


            // For Key Actions
            ActionReciever receiver = hit.transform.GetComponent <ActionReciever> ();
            if (receiver)
            {
                receiver.SendActionMessage(selection);
            }
        }
    }
コード例 #4
0
    /// <summary>
    /// React to the player's actions
    /// </summary>
    /// <param name="action">Action type performed.</param>
    /// <param name="reciever">Type of person that recieved the action. </param>
    public void React(Action action, ActionReciever reciever)
    {
        if (CheckPartyStatus(approvalPoints))
        {
            switch (DetermineMood(action, reciever))
            {
            case Mood.HAPPY:
                Happy();
                break;

            case Mood.UPSET:
                Upset();
                break;

            case Mood.NEUTRAL:
                Neutral();
                break;
            }

            DisplayApprovalStatus();
        }
    }
コード例 #5
0
 /// <summary>
 /// How the follower feels about the situation
 /// </summary>
 /// <param name="action">Action type performed.</param>
 /// <param name="reciever">Type of person that recieved the action. </param>
 /// <returns> The mood the follower has about what happened. </returns>
 public virtual Mood DetermineMood(Action action, ActionReciever receiver)
 {
     return(Mood.NEUTRAL);
 }