protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //Automatic Success
            if (traits.Quietude >= ConfiguredPassFailValue)
            {
                return(TestAttributeGreaterOrEqualThanSetValue(traits.Quietude, ConfiguredPassFailValue, "AutomaticSuccess", Qualities.Quietude.ToString(), CharacteristicType.Quality));
            }

            //Automatic Success
            if (traits.Tact >= ConfiguredPassFailValue)
            {
                return(TestAttributeGreaterOrEqualThanSetValue(traits.Tact, ConfiguredPassFailValue, "AutomaticSuccess", Qualities.Tact.ToString(), CharacteristicType.Quality));
            }

            if (CharacterHasPersonalValue(PersonalValues.Peace, traits))
            {
                return(true);
            }

            if (traits.Quietude > traits.Tact)
            {
                return(TestAttributeAgainstRandomValue(traits.Quietude, string.Empty, Qualities.Quietude.ToString()));
            }

            return(TestAttributeAgainstRandomValue(traits.Tact, string.Empty, Qualities.Tact.ToString()));
        }
예제 #2
0
 public List <Reaction> Evaluate(CharacterTraits traits, Memory memory, PerceivedEvent perceivedEvent)
 {
     return(new List <Reaction>
     {
         new Reaction
         {
             Tone = Tone.Annoyed,
             Target = perceivedEvent.Source,
             Intent = Intent.Hostile,
             ActionType = ActionType.NonVerbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "Pause",
             Message = $"{memory.Me.Name} pauses.",
             AssociatedKarma = 0,
             IntervalToNextReaction = 5
         },
         new Reaction
         {
             Tone = Tone.Annoyed,
             Target = perceivedEvent.Source,
             Intent = Intent.Hostile,
             ActionType = ActionType.Verbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "WhoAreYou",
             Message = "And who are you?",
             AssociatedKarma = -1
         }
     });
 }
예제 #3
0
 public List <Reaction> Evaluate(CharacterTraits traits, Memory memory, PerceivedEvent perceivedEvent)
 {
     return(new List <Reaction>
     {
         new Reaction
         {
             Tone = Tone.Casual,
             Target = perceivedEvent.Source,
             Intent = Intent.Neutral,
             ActionType = ActionType.Verbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "ImGood",
             Message = "I'm good", //TODO: Randomize
             Source = perceivedEvent.Target,
             IntervalToNextReaction = 1
         },
         new Reaction
         {
             Tone = Tone.Casual,
             Target = perceivedEvent.Source,
             Intent = Intent.Neutral,
             ActionType = ActionType.Verbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "AndYou",
             Message = "And you?", //TODO: Randomize
             Source = perceivedEvent.Target
         }
     });
 }
예제 #4
0
 public List <Reaction> Evaluate(CharacterTraits traits, Memory memory, PerceivedEvent perceivedEvent)
 {
     return(new List <Reaction>
     {
         new Reaction
         {
             Tone = Tone.Sarcastic,
             Target = perceivedEvent.Source,
             Intent = Intent.Neutral,
             ActionType = ActionType.Verbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "Yeah",
             Message = "Yeah...",
             AssociatedKarma = 0,
             IntervalToNextReaction = 1
         },
         new Reaction
         {
             Tone = Tone.Sarcastic,
             Target = perceivedEvent.Source,
             Intent = Intent.Neutral,
             ActionType = ActionType.Verbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "YouKnowMe",
             Message = "It's like you've known me all my life.",
             AssociatedKarma = 0
         }
     });
 }
예제 #5
0
 public List <Reaction> Evaluate(CharacterTraits traits, Memory memory, PerceivedEvent perceivedEvent)
 {
     return(new List <Reaction>
     {
         new Reaction
         {
             Tone = Tone.Enthusiastic,
             Target = perceivedEvent.Source,
             Intent = Intent.Friendly,
             ActionType = ActionType.Verbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "FriendlyImGood",
             Message = "I'm doing well", //TODO: Randomize
             Source = perceivedEvent.Target,
             IntervalToNextReaction = 1
         },
         new Reaction
         {
             Tone = Tone.Enthusiastic,
             Target = perceivedEvent.Source,
             Intent = Intent.Friendly,
             ActionType = ActionType.Verbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "WhatAboutYou",
             Message = "And you?", //TODO: Randomize
             Source = perceivedEvent.Target
         }
     });
 }
예제 #6
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            if (!CharacterHasPersonalValue(PersonalValues.Faith, traits))
            {
                return(false);
            }

            if (memory.HaveIDoneSomethingUnforgivable())
            {
                var unforgivenTestResult = new NodeTestInfo
                {
                    TestedCharacteristic = CharacteristicType.Memory,
                    CharacteristicName   = "PastActions",
                    Result      = true,
                    Description = "Conditional on:Value(Faith)"
                };
                DataToMemorize.Add(unforgivenTestResult);

                return(true);
            }

            var myTestResult = new NodeTestInfo
            {
                TestedCharacteristic = CharacteristicType.Karma,
                CharacteristicName   = "Karma",
                AttributeValue       = memory.MyKarmaScore,
                PassingValue         = -5,
                Result      = memory.MyKarmaScore < -5, //this is the test
                Description = "Conditional on:Value(Faith)"
            };

            DataToMemorize.Add(myTestResult);

            return(myTestResult.Result);
        }
예제 #7
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            if (CharacterHasPersonalValue(PersonalValues.Openness, traits) || CharacterHasPersonalValue(PersonalValues.Honesty, traits))
            {
                return(false);
            }

            return(TestAttributeAgainstRandomValue(traits.Expressiveness, string.Empty, Qualities.Expressiveness.ToString()));
        }
예제 #8
0
        private static string GetRudeGestureMessage(PerceivedEvent perceivedEvent, Memory memory)
        {
            if (memory.Me.Age(Cronos.Instance.GetCurrentTime()) <= 6)
            {
                return($"{perceivedEvent.Target} makes a grimace at {perceivedEvent.Source}");
            }

            return($"{perceivedEvent.Target} raises his middle finger to {perceivedEvent.Source}");
        }
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //Automatic Success
            if (traits.Expressiveness >= ConfiguredPassFailValue)
            {
                return(TestAttributeGreaterOrEqualThanSetValue(traits.Expressiveness, ConfiguredPassFailValue, "AutomaticSuccess", Qualities.Expressiveness.ToString(), CharacteristicType.Quality));
            }

            return(TestAttributeAgainstRandomValue(traits.Expressiveness, string.Empty, Qualities.Expressiveness.ToString()));
        }
예제 #10
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            if (traits.ShortTermEmotions.Sadness <= 3 && traits.ShortTermEmotions.Anger <= 3)
            {
                return(TestAttributeGreaterOrEqualThanSetValue(traits.ShortTermEmotions.Happiness, 8, "Conditional on:Eval(Sadness,2)&&Eval(Anger,3)",
                                                               Emotions.Happiness.ToString(), CharacteristicType.Emotion));
            }

            return(false);
        }
예제 #11
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //Automatic failure
            if (traits.Modesty <= ConfiguredPassFailValue)
            {
                return(TestAttributeSmallerOrEqualThanSetValue(traits.Modesty, ConfiguredPassFailValue, "AutomaticFailure", Qualities.Modesty.ToString()));
            }

            return(TestAttributeAgainstRandomValue(traits.Modesty, string.Empty, Qualities.Modesty.ToString()));
        }
예제 #12
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //Is money or (financial) security important to me?
            if (!CharacterHasPersonalValue(PersonalValues.Wealth, traits) && !CharacterHasPersonalValue(PersonalValues.Security, traits))
            {
                return(false);
            }

            return(TestAttributeAgainstRandomValue(traits.Confidence, "Conditional on:Value(Wealth,Security)", Qualities.Confidence.ToString()));
        }
예제 #13
0
        private static bool CheckConversationHistoryForIntroduction(PerceivedEvent eventReactedTo)
        {
            if (eventReactedTo.EventType == EventType.Interaction && eventReactedTo.EventName.Contains("Introduce"))
            {
                return(true);
            }

            var reaction = eventReactedTo as Reaction;

            return(reaction != null && CheckConversationHistoryForIntroduction(reaction.InitialEvent));
        }
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            Action perceivedAction = perceivedEvent as Action;

            if (perceivedAction == null)
            {
                throw new RnpcParameterException("Perceived events that are not of Action type should not be passed to social interactions", new Exception("Incorrect parameter type passed in class " + this));
            }

            return(IsItAFinancialThreat(perceivedAction.Message));
        }
예제 #15
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            Place whereIComeFrom = memory.Me.FindPlaceByPersonalTieType(PersonalTieType.LiveIn);

            if (whereIComeFrom == null)
            {
                return(false);
            }

            return(whereIComeFrom.IsThisASmallTown() && TestAttributeAgainstRandomValue(traits.Gregariousness, string.Empty, Qualities.Gregariousness.ToString()));
        }
예제 #16
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            var conflictEvents = memory.Events.FindEventsByTypeAndRelatedPerson(PastEventType.Conflict, perceivedEvent.Source);

            if (conflictEvents == null || conflictEvents.Count == 0)
            {
                return(false);
            }

            //Are we still in conflict about something?
            return(conflictEvents.Exists(e => e.Ended == null));
        }
예제 #17
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //Automatic Success
            if (traits.Energy >= 25 && traits.Compassion >= ConfiguredPassFailValue)
            {
                return(TestAttributeGreaterOrEqualThanSetValue(traits.Energy, 25, "Conditional on:Eval(Energy,25)", "Energy", CharacteristicType.Energy) &&
                       TestAttributeGreaterOrEqualThanSetValue(traits.Compassion, ConfiguredPassFailValue,
                                                               $"Conditional on:Eval(Compassion,{ConfiguredPassFailValue})", Qualities.Compassion.ToString(), CharacteristicType.Quality));
            }

            return(TestAttributeAgainstRandomValue(traits.Compassion, string.Empty, Qualities.Compassion.ToString()));
        }
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //If strength or boldness are part of my values I will not be afraid of injury
            if (CharacterHasPersonalValue(PersonalValues.Strength, traits) || CharacterHasPersonalValue(PersonalValues.Boldness, traits))
            {
                return(false);
            }

            //If my security is important I have a 20% penalty
            int penalty = -(CharacterHasPersonalValue(PersonalValues.Security, traits) ? 20: 0);

            return(TestAttributeAgainstRandomValue(traits.Confidence, penalty != 0 ? "Penalty(Security)" : string.Empty, Qualities.Confidence.ToString(), penalty));
        }
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            Person personInConflictWith = memory.Persons.FindPersonByName(perceivedEvent.Source);

            if (personInConflictWith == null)
            {
                return(false);
            }

            var relationship = memory.Me.WhatIsMyCurrentRelationshipWithThisPerson(personInConflictWith);

            return(relationship != null && relationship.Type == PersonalRelationshipType.Enmity);
        }
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            var sourcePerson = memory.Persons.FindPersonByName(perceivedEvent.Source);

            if (sourcePerson == null)
            {
                return(false);
            }

            var conflict = memory.Events.FindEventsByTypeAndRelatedPerson(PastEventType.Conflict, sourcePerson);

            return(conflict != null);
        }
예제 #21
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            var person = memory.Persons.FindPersonByName(perceivedEvent.Source);

            if (person == null)
            {
                return(false);
            }

            var opinion = memory.WhatIsMyOpinionAbout(person);

            return(opinion == OpinionType.Like || opinion == OpinionType.Love || opinion == OpinionType.Respect);
        }
예제 #22
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            var action = perceivedEvent as Action;

            if (action?.Tone == Tone.Apologetic)
            {
                //if i'm insecure I'll believe it's insincere
                return(!TestAttributeSmallerOrEqualThanSetValue(traits.Confidence, ConfiguredPassFailValue, string.Empty, Qualities.Confidence.ToString()));
            }

            //if my awareness is low I won't realize it's not sincere
            return(TestAttributeSmallerOrEqualThanSetValue(traits.Awareness, ConfiguredPassFailValue, string.Empty, Qualities.Awareness.ToString()));
        }
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            var person = memory.Persons.FindPersonByName(perceivedEvent.Source);

            if (person == null)
            {
                return(false);
            }

            var relationship = memory.Me.WhatIsMyCurrentRelationshipWithThisPerson(person);

            return(relationship != null && (relationship.Type == PersonalRelationshipType.Friendship ||
                                            relationship.Type == PersonalRelationshipType.Romantic ||
                                            relationship.Type == PersonalRelationshipType.Family));
        }
예제 #24
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //Automatic success
            if (CharacterHasPersonalValue(PersonalValues.Respect, traits))
            {
                return(true);
            }

            if (traits.Gregariousness <= ConfiguredPassFailValue)
            {
                return(TestAttributeSmallerOrEqualThanSetValue(traits.Gregariousness, ConfiguredPassFailValue, "AutomaticFailure", Qualities.Gregariousness.ToString()));
            }

            return(TestAttributeAgainstRandomValue(traits.Gregariousness, string.Empty, Qualities.Gregariousness.ToString()));
        }
예제 #25
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //If respect is important I'll automatically feel insulted
            if (CharacterHasPersonalValue(PersonalValues.Respect, traits))
            {
                return(true);
            }

            //If my ego is "too big" I'll be incapable of choosing not to feel insulted
            if (traits.Modesty <= ConfiguredPassFailValue)
            {
                return(TestAttributeSmallerOrEqualThanSetValue(traits.Modesty, ConfiguredPassFailValue, "AutomaticFailure", Qualities.Modesty.ToString()));
            }

            return(TestAttributeAgainstRandomValue(traits.Quietude, string.Empty, Qualities.Quietude.ToString()));
        }
예제 #26
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //Automatic failure
            if (traits.ShortTermEmotions.Anger >= 75)
            {
                return(TestAttributeGreaterOrEqualThanSetValue(traits.ShortTermEmotions.Anger, 75, string.Empty, Emotions.Anger.ToString(), CharacteristicType.Emotion));
            }

            //Automatic failure
            if (traits.Conscience <= ConfiguredPassFailValue && traits.Tolerance <= ConfiguredPassFailValue)
            {
                return(TestAttributeSmallerOrEqualThanSetValue(traits.Conscience, ConfiguredPassFailValue, $"Conditional on:Eval(Energy,{ConfiguredPassFailValue})", Qualities.Conscience.ToString()) &&
                       TestAttributeSmallerOrEqualThanSetValue(traits.Tolerance, ConfiguredPassFailValue, $"Conditional on:Eval(Compassion,{ConfiguredPassFailValue})", Qualities.Tolerance.ToString()));
            }

            return(false);
        }
예제 #27
0
        protected override bool EvaluateNode(PerceivedEvent perceivedEvent, Memory memory, CharacterTraits traits)
        {
            //Too blunt to avoid it
            if (traits.Tact <= ConfiguredPassFailValue)
            {
                return(TestAttributeSmallerOrEqualThanSetValue(traits.Tact, ConfiguredPassFailValue, "AutomaticFailure", Qualities.Determination.ToString()));
            }

            //Too determined to let it go
            if (traits.Determination >= Constants.MinStrongPoint)
            {
                return(TestAttributeGreaterOrEqualThanSetValue(traits.Determination, Constants.MinStrongPoint, "AutonmaticFailure", Qualities.Determination.ToString(), CharacteristicType.Quality));
            }

            //If their determination is strong enough, they won't shy from a confrontation.
            return(!TestAttributeAgainstRandomValue(traits.Determination, string.Empty, Qualities.Determination.ToString()));
        }
예제 #28
0
 public List <Reaction> Evaluate(CharacterTraits traits, Memory memory, PerceivedEvent perceivedEvent)
 {
     return(new List <Reaction>
     {
         new Reaction
         {
             Target = perceivedEvent.Source,
             Intent = Intent.Friendly,
             ActionType = ActionType.NonVerbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "Laugh",
             Message = $"{perceivedEvent.Target} laughs.",     //TODO: Randomize
             Source = perceivedEvent.Target
         }
     });
 }
예제 #29
0
 public List <Reaction> Evaluate(CharacterTraits traits, Memory memory, PerceivedEvent perceivedEvent)
 {
     return(new List <Reaction>
     {
         new Reaction
         {
             Tone = Tone.Curious,
             Target = perceivedEvent.Source,
             Intent = Intent.Neutral,
             ActionType = ActionType.Verbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "AskWhy",
             Message = "Why?"
         }
     });
 }
예제 #30
0
 public List <Reaction> Evaluate(CharacterTraits traits, Memory memory, PerceivedEvent perceivedEvent)
 {
     return(new List <Reaction>
     {
         new Reaction
         {
             Tone = Tone.Disappointed,
             Target = perceivedEvent.Source,
             Intent = Intent.Hostile,
             ActionType = ActionType.Verbal,
             InitialEvent = perceivedEvent,
             EventType = EventType.Interaction,
             ReactionScore = 0,
             EventName = "AskWhy",
             Message = "Why are you acting like this?"
         }
     });
 }