Example #1
0
    public override void Receive(ThoughtFocus thoughtFocus)
    {
        Thought original = thoughtFocus.MainThought;

        if (thoughtFocus.RemoveThought && original != null)
        {
            Remove(original);
        }

        Topic topic = null;

        if (thoughtFocus.Topic != null)
        {
            topic = topicsByName[thoughtFocus.Topic];
        }

        if (topic != null && topic.MyStage.Equals(Topic.Stage.Hidden))
        {
            ExitTo(topic, Topic.Stage.Orientation);
        }

        foreach (String tangent in thoughtFocus.Tangents)
        {
            //Debug.Log("\"" + tangent + "\"");
            Topic tangentialTopic = topicsByName[tangent];
            ExitTo(tangentialTopic, Topic.Stage.Orientation);
            if (tangentialTopic.MyStage.Equals(Topic.Stage.Complication))
            {
                ShiftFocusChange(tangentialTopic, tangentialTopic.Focus + 3f, true, thoughtFocus.FinalMultiplier);
            }
        }

        TopicHeard(topic, thoughtFocus);
    }
Example #2
0
    private void TopicHeard(Topic topic, ThoughtFocus thoughtFocus)
    {
        if (topic != null)
        {
            switch (topic.MyStage)
            {
            case Topic.Stage.Orientation:
                Orientation(topic, thoughtFocus);
                break;

            case Topic.Stage.Complication:
                Complication(topic, thoughtFocus);
                break;

            case Topic.Stage.Climax:
                Climax(topic, thoughtFocus);
                break;

            case Topic.Stage.Denouement:
                Denouement(topic, thoughtFocus);
                break;

            case Topic.Stage.Coda:
                Coda(topic, thoughtFocus);
                break;
            }

            ShiftAllTopics(-0.02f, 0f, thoughtFocus.FinalMultiplier);
        }

        FocusThoughts();
    }
Example #3
0
 private void Coda(Topic topic, ThoughtFocus thoughtFocus)
 {
     if (myInput.IsMe(thoughtFocus.MainThought.Actor) && thoughtFocus.MyStage.Equals(Topic.Stage.Coda))
     {
         ExitTo(topic, Topic.Stage.Ended);
     }
     ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, true, 5f, thoughtFocus.FinalMultiplier);
 }
Example #4
0
 private void Denouement(Topic topic, ThoughtFocus thoughtFocus)
 {
     if (thoughtFocus.MyStage.Equals(Topic.Stage.Coda))
     {
         ExitTo(topic, Topic.Stage.Coda);
     }
     ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, false, 3f, thoughtFocus.FinalMultiplier);
 }
Example #5
0
 private void Orientation(Topic topic, ThoughtFocus thoughtFocus)
 {
     if (thoughtFocus.MyStage.Equals(Topic.Stage.Complication))
     {
         ExitTo(topic, Topic.Stage.Complication);
     }
     ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, true, 5f, thoughtFocus.FinalMultiplier);
 }
Example #6
0
    private void HandleStageOne(Thought thought)
    {
        ThoughtFocus thoughtFocus = new ThoughtFocus(thought, 0.2f, false, false);

        Send(thoughtFocus);

        SocialInput socialInput = new SocialInput(thought.Actor, thought, 1);

        Send(socialInput);
    }
Example #7
0
    private void Climax(Topic topic, ThoughtFocus thoughtFocus)
    {
        float focusBefore = topic.Focus;

        ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, true, 1f, thoughtFocus.FinalMultiplier);
        float focusAfter = topic.Focus;

        if (focusAfter < focusBefore)
        {
            ExitTo(topic, Topic.Stage.Denouement);
        }
    }
Example #8
0
 private void Complication(Topic topic, ThoughtFocus thoughtFocus)
 {
     if (thoughtFocus.MyStage.Equals(Topic.Stage.Climax))
     {
         ExitTo(topic, Topic.Stage.Climax);
     }
     if (thoughtFocus.MyStage.Equals(Topic.Stage.Denouement))
     {
         ExitTo(topic, Topic.Stage.Denouement);
     }
     ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, true, 3f, thoughtFocus.FinalMultiplier);
 }
Example #9
0
    private void HandleStageThree(Thought thought)
    {
        ThoughtFocus thoughtFocus = new ThoughtFocus(thought, 0.5f, true, true);

        Send(thoughtFocus);

        SocialInput socialInput = new SocialInput(thought.Actor, thought, 3);

        Send(socialInput);

        if (!myInput.IsMe(thought.Actor))
        {
            foreach (Argument argument in thought.Arguments)
            {
                Argument newArgument = new Argument(argument.MyType, argument.Strength * 0.5f);
                Send(newArgument);
            }
        }
    }
Example #10
0
    private void HandleStageTwo(Thought thought)
    {
        ThoughtFocus thoughtFocus = new ThoughtFocus(thought, 0.3f, true, false);

        Send(thoughtFocus);

        SocialInput socialInput = new SocialInput(thought.Actor, thought, 2);

        Send(socialInput);

        if (!myInput.IsMe(thought.Actor))
        {
            foreach (Argument argument in thought.Arguments)
            {
                Argument newArgument = new Argument(argument.MyType, argument.Strength * 0.5f);
                Send(newArgument);
            }
        }
        else
        {
            myInput.myStack.conversation.manager.CallEvent(thought.EventCode);
        }
    }
Example #11
0
 public void Route(ThoughtFocus thoughtFocus) => attention.Receive(thoughtFocus);
Example #12
0
 public abstract void Receive(ThoughtFocus thoughtFocus);
Example #13
0
 public void Send(ThoughtFocus thoughtFocus)
 {
     myInput.Route(thoughtFocus);
 }