コード例 #1
0
        private static bool HasAnySocialMemoryWith(Pawn p, Pawn otherPawn)
        {
            bool result;

            if (!p.RaceProps.Humanlike || !otherPawn.RaceProps.Humanlike)
            {
                result = false;
            }
            else if (p.Dead)
            {
                result = false;
            }
            else
            {
                List <Thought_Memory> memories = p.needs.mood.thoughts.memories.Memories;
                for (int i = 0; i < memories.Count; i++)
                {
                    Thought_MemorySocial thought_MemorySocial = memories[i] as Thought_MemorySocial;
                    if (thought_MemorySocial != null && thought_MemorySocial.OtherPawn() == otherPawn)
                    {
                        return(true);
                    }
                }
                result = false;
            }
            return(result);
        }
コード例 #2
0
        public override bool GroupsWith(Thought other)
        {
            Thought_MemorySocial thought_MemorySocial = other as Thought_MemorySocial;

            if (thought_MemorySocial == null)
            {
                return(false);
            }
            return(base.GroupsWith(other) && otherPawn == thought_MemorySocial.otherPawn);
        }
コード例 #3
0
        public IndividualThoughtToAdd(ThoughtDef thoughtDef, Pawn addTo, Pawn otherPawn = null, float moodPowerFactor = 1f, float opinionOffsetFactor = 1f)
        {
            this.addTo     = addTo;
            this.otherPawn = otherPawn;
            this.thought   = (Thought_Memory)ThoughtMaker.MakeThought(thoughtDef);
            this.thought.moodPowerFactor = moodPowerFactor;
            this.thought.otherPawn       = otherPawn;
            Thought_MemorySocial thought_MemorySocial = this.thought as Thought_MemorySocial;

            if (thought_MemorySocial != null)
            {
                thought_MemorySocial.opinionOffset *= opinionOffsetFactor;
            }
        }
コード例 #4
0
        private static void AddInteractionThought(Pawn pawn, Pawn otherPawn, ThoughtDef thoughtDef)
        {
            float          statValue      = otherPawn.GetStatValue(StatDefOf.SocialImpact, true);
            Thought_Memory thought_Memory = (Thought_Memory)ThoughtMaker.MakeThought(thoughtDef);

            thought_Memory.moodPowerFactor = statValue;
            Thought_MemorySocial thought_MemorySocial = thought_Memory as Thought_MemorySocial;

            if (thought_MemorySocial != null)
            {
                thought_MemorySocial.opinionOffset *= statValue;
            }
            pawn.needs.mood.thoughts.memories.TryGainMemory(thought_Memory, otherPawn);
        }
コード例 #5
0
        public override bool GroupsWith(Thought other)
        {
            Thought_MemorySocial thought_MemorySocial = other as Thought_MemorySocial;

            return(thought_MemorySocial != null && base.GroupsWith(other) && this.otherPawn == thought_MemorySocial.otherPawn);
        }