Example #1
0
    private string className; // For debuging only so you know the current emotion state's name

    #endregion Fields

    #region Constructors

    public EmotionState(NPC npcInState)
    {
        className = this.GetType().FullName;
        _npcInState = npcInState;
        _defaultTextToSay = null;
        _allChoiceReactions = new Dictionary<Choice, DispositionDependentReaction>();
        _allItemReactions = new Dictionary<string, DispositionDependentReaction>();
        Reaction defaultItemReact = new Reaction();
        defaultItemReact.AddAction(new UpdateCurrentTextAction(npcInState, "No thank you."));
        defaultItemReaction = new DispositionDependentReaction(defaultItemReact);
        interactionOpeningReaction = null;
    }
Example #2
0
 public NPCAddChoiceAction(NPC _npcToUpdate, Choice _newChoice, DispositionDependentReaction _reaction)
     : base(_npcToUpdate)
 {
     newChoice = _newChoice;
     reaction = _reaction;
 }
Example #3
0
 public void AddChoice(Choice newChoice, DispositionDependentReaction reaction)
 {
     _allChoiceReactions.Add(newChoice, reaction);
 }
Example #4
0
 protected void SetOnOpenInteractionReaction(DispositionDependentReaction reaction)
 {
     interactionOpeningReaction = reaction;
 }
Example #5
0
 /// <summary>
 /// Performs the reaction based on disposition. If the reaction does not have that type of reaction then it will 
 /// 	perform the default reaction
 /// </summary>
 /// <param name='reaction'>
 /// Reaction to do
 /// </param>
 private void PerformReactionBasedOnDisposition(DispositionDependentReaction reaction)
 {
     reaction.PerformReaction();
 }
Example #6
0
 protected void SetOnCloseInteractionReaction(DispositionDependentReaction reaction)
 {
     interactionClosingReaction = reaction;
 }
Example #7
0
 /// <summary>
 /// Adds the choice to the current emotion state
 /// </summary>
 public void AddChoice(Choice newChoice, DispositionDependentReaction reaction)
 {
     currentEmotion.AddChoice(newChoice, reaction);
 }
Example #8
0
        void LikesThePlayerReactions(NPC toControl)
        {
            DispositionDependentReaction reassuredByPlayerEffect = new DispositionDependentReaction(reassuredByPlayer);
            reassuredByPlayer.AddAction(new UpdateDefaultTextAction(toControl, "I hope my son gets married, I would be very greatful if he did."));
            reassuredByPlayer.AddAction(new NPCCallbackAction(BecomeNetural));
            reassuredByPlayer.AddAction(new NPCCallbackAction(ClearAllChoices));

            _allChoiceReactions.Add(reassureMusician, new DispositionDependentReaction(reassuredByPlayer));
        }
Example #9
0
        void HatesThePlayerReactions(NPC toControl)
        {
            DispositionDependentReaction shunsPlayerEffect = new DispositionDependentReaction(shunsPlayer);
                DispositionDependentReaction insultedByPlayerEffect = new DispositionDependentReaction(insultedByPlayer);
                DispositionDependentReaction apologizeToPlayerEffect = new DispositionDependentReaction(apologizesToPlayer);

                shunsPlayer.AddAction(new UpdateDefaultTextAction(toControl, "Oh... why hello there!"));
                shunsPlayer.AddAction(new NPCCallbackAction(AngeredByPlayer));

                insultedByPlayer.AddAction(new SetOffFlagAction("Scared By Player"));
                insultedByPlayer.AddAction(new UpdateDefaultTextAction(toControl, "GoodBye."));
                insultedByPlayer.AddAction(new NPCCallbackAction(ClearAllChoices));

                pissOffMusician.AddAction(new SetOffFlagAction("Scared By Player"));
                pissOffMusician.AddAction(new UpdateDefaultTextAction(toControl, "I have no business with you."));
                pissOffMusician.AddAction(new NPCCallbackAction(ClearAllChoices));

                apologizesToPlayer.AddAction(new NPCCallbackAction(BecomeNetural));
                apologizesToPlayer.AddAction(new NPCCallbackAction(ClearAllChoices));
                _allChoiceReactions.Add(distressMusician, shunsPlayerEffect);
        }
Example #10
0
 void AngeredByPlayer()
 {
     _allChoiceReactions.Clear();
     DispositionDependentReaction insultedByPlayerEffect = new DispositionDependentReaction(insultedByPlayer);
     DispositionDependentReaction apologizeToPlayerEffect = new DispositionDependentReaction(apologizesToPlayer);
     _allChoiceReactions.Add(makeFunOfMusician, insultedByPlayerEffect);
     _allChoiceReactions.Add(apologizeToMusician, apologizeToPlayerEffect);
     _allChoiceReactions.Add(bitchPlease, new DispositionDependentReaction(pissOffMusician));
     _npcInState.SetCharacterPortrait(StringsNPC.Angry);
     _npcInState.ChangeFacialExpression(StringsNPC.Angry);
     GUIManager.Instance.RefreshInteraction();
 }