private bool DoTalking(Conversation setup, MinionIdentity new_speaker)
    {
        DebugUtil.Assert(setup != null, "setup was null");
        DebugUtil.Assert((UnityEngine.Object)new_speaker != (UnityEngine.Object)null, "new_speaker was null");
        if ((UnityEngine.Object)setup.lastTalked != (UnityEngine.Object)null)
        {
            setup.lastTalked.Trigger(25860745, setup.lastTalked.gameObject);
        }
        DebugUtil.Assert(setup.conversationType != null, "setup.conversationType was null");
        Conversation.Topic nextTopic = setup.conversationType.GetNextTopic(new_speaker, setup.lastTopic);
        if (nextTopic == null || nextTopic.mode == Conversation.ModeType.End || nextTopic.mode == Conversation.ModeType.Segue)
        {
            return(false);
        }
        Thought thoughtForTopic = GetThoughtForTopic(setup, nextTopic);

        if (thoughtForTopic == null)
        {
            return(false);
        }
        ThoughtGraph.Instance sMI = new_speaker.GetSMI <ThoughtGraph.Instance>();
        if (sMI == null)
        {
            return(false);
        }
        sMI.AddThought(thoughtForTopic);
        setup.lastTopic      = nextTopic;
        setup.lastTalked     = new_speaker;
        setup.lastTalkedTime = GameClock.Instance.GetTime();
        DebugUtil.Assert(lastConvoTimeByMinion != null, "lastConvoTimeByMinion was null");
        lastConvoTimeByMinion[setup.lastTalked] = GameClock.Instance.GetTime();
        Effects component = setup.lastTalked.GetComponent <Effects>();

        DebugUtil.Assert((UnityEngine.Object)component != (UnityEngine.Object)null, "effects was null");
        component.Add("GoodConversation", true);
        Conversation.Mode mode = Conversation.Topic.Modes[(int)nextTopic.mode];
        DebugUtil.Assert(mode != null, "mode was null");
        StartedTalkingEvent startedTalkingEvent = new StartedTalkingEvent();

        startedTalkingEvent.talker = new_speaker.gameObject;
        startedTalkingEvent.anim   = mode.anim;
        StartedTalkingEvent data = startedTalkingEvent;

        foreach (MinionIdentity minion in setup.minions)
        {
            if (!(bool)minion)
            {
                DebugUtil.DevAssert(false, "minion in setup.minions was null");
            }
            else
            {
                minion.Trigger(-594200555, data);
            }
        }
        setup.numUtterances++;
        return(true);
    }
 private void UnapplyModifier(ModifierType modifier)
 {
     if (modifier.modifier != null)
     {
         Attributes attributes = this.GetAttributes();
         attributes.Remove(modifier.modifier);
     }
     if (modifier.statusItem != null)
     {
         KSelectable component = GetComponent <KSelectable>();
         component.RemoveStatusItem(modifier.statusItem, false);
     }
     if (modifier.thought != null)
     {
         ThoughtGraph.Instance sMI = this.GetSMI <ThoughtGraph.Instance>();
         sMI.RemoveThought(modifier.thought);
     }
 }