Пример #1
0
        //public new Pawn_HealthTracker_CantHeal health;

        public Thought_Memory GiveObservedThought()
        {
            Thought_MemoryObservation thought = ((Thought_MemoryObservation)ThoughtMaker.MakeThought(D9HDefOf.ObservedSpookySkeleton));

            thought.Target = this;
            return(thought);
        }
Пример #2
0
 public Thought_Memory GiveObservedThought()
 {
     if (!InnerPawn.RaceProps.Humanlike)
     {
         return(null);
     }
     if (this.StoringThing() == null)
     {
         Thought_MemoryObservation thought_MemoryObservation = ((!this.IsNotFresh()) ? ((Thought_MemoryObservation)ThoughtMaker.MakeThought(ThoughtDefOf.ObservedLayingCorpse)) : ((Thought_MemoryObservation)ThoughtMaker.MakeThought(ThoughtDefOf.ObservedLayingRottingCorpse)));
         thought_MemoryObservation.Target = this;
         return(thought_MemoryObservation);
     }
     return(null);
 }
Пример #3
0
        public Thought_Memory GiveObservedThought()
        {
            string     concept    = string.Format("RRY_Concept_{0}s", pawn.def.label);
            string     thought    = string.Format("RRY_Observed_{0}", pawn.def.label);
            ConceptDef conceptDef = null;
            ThoughtDef thoughtDef = null;
            Thought_MemoryObservation observation = null;

            thoughtDef = DefDatabase <ThoughtDef> .GetNamedSilentFail(thought);

            conceptDef = DefDatabase <ConceptDef> .GetNamedSilentFail(concept);

            lastSpottedTick = Find.TickManager.TicksGame;
            if (conceptDef != null && !pawn.isXenomorph() && !pawn.isNeomorph())
            {
                if (PlayerKnowledgeDatabase.IsComplete(conceptDef))
                {
                    if (thoughtDef != null)
                    {
                        observation = (Thought_MemoryObservation)ThoughtMaker.MakeThought(thoughtDef);
                    }
                    //   LessonAutoActivator.TeachOpportunity(conceptDef, OpportunityType.Important);
                }
                else
                {
                    thoughtDef = DefDatabase <ThoughtDef> .GetNamedSilentFail(thought);

                    if (thoughtDef != null)
                    {
                        observation = (Thought_MemoryObservation)ThoughtMaker.MakeThought(thoughtDef);
                    }
                }
            }
            else
            {
                thoughtDef = DefDatabase <ThoughtDef> .GetNamedSilentFail(thought);

                if (thoughtDef != null)
                {
                    observation = (Thought_MemoryObservation)ThoughtMaker.MakeThought(thoughtDef);
                }
            }
            if (observation != null)
            {
                observation.Target = this.parent;
                return(observation);
            }

            return(null);
        }
Пример #4
0
        public Thought_Memory GiveObservedThought()
        {
            Thought_MemoryObservation thought_MemoryObservation = null;

            if (this.Dead)
            {
                if (ThoughtDef.Named("LotRD_ObservedDragonDead") is ThoughtDef td)
                {
                    thought_MemoryObservation =
                        (Thought_MemoryObservation)ThoughtMaker.MakeThought(td);
                }
            }
            else if (this.InAggroMentalState)
            {
                if (ThoughtDef.Named("LotRD_ObservedDragonEnraged") is ThoughtDef td)
                {
                    thought_MemoryObservation =
                        (Thought_MemoryObservation)ThoughtMaker.MakeThought(td);
                }
            }
            else
            {
                if (ThoughtDef.Named("LotRD_ObservedDragon") is ThoughtDef td)
                {
                    thought_MemoryObservation =
                        (Thought_MemoryObservation)ThoughtMaker.MakeThought(td);
                }
            }

            if (thought_MemoryObservation != null)
            {
                thought_MemoryObservation.Target = this;
                return(thought_MemoryObservation);
            }

            return(null);
        }
Пример #5
0
        public static void HandleWitnessesOf(JobDef crime, Pawn criminal, Pawn victim)
        {
            if (!criminal.IsVampire())
            {
                return;
            }

            Crime?curCrime = GetCrime(crime);

            if (curCrime == null)
            {
                return;
            }

            //Log.Message("1");
            List <Pawn> witnesses = WitnessesOf(criminal, victim, crime);

            //Log.Message("2");


            if (!witnesses.NullOrEmpty())
            {
                //Log.Message("Loop 1 Enter");


                foreach (Pawn witness in witnesses)
                {
                    //Log.Message("Loop 1 Step 1");

                    //Log.Message("Loop 1 Step 2");

                    Thought_MemoryObservation thought_MemoryObservation = null;
                    //Log.Message("Loop 1 Step 3");

                    switch (witness.GetReactionTo(criminal, victim))
                    {
                    case CrimeReaction.MoodColonist:
                        if (curCrime.Value.ColonistThought != null)
                        {
                            thought_MemoryObservation =
                                (Thought_MemoryObservation)ThoughtMaker
                                .MakeThought(curCrime.Value.ColonistThought);
                        }
                        break;

                    case CrimeReaction.MoodVisitor:
                        if (curCrime.Value.VisitorThought != null)
                        {
                            thought_MemoryObservation =
                                (Thought_MemoryObservation)ThoughtMaker
                                .MakeThought(curCrime.Value.VisitorThought);
                        }
                        break;

                    case CrimeReaction.MoodVisitorFlee:
                        if (curCrime.Value.VisitorThought != null)
                        {
                            thought_MemoryObservation =
                                (Thought_MemoryObservation)ThoughtMaker
                                .MakeThought(curCrime.Value.VisitorThought);
                        }
                        if (CanTakeWitnessJob(witness))
                        {
                            IntVec3 fleeLoc = CellFinderLoose.GetFleeDest(witness, new List <Thing>()
                            {
                                criminal
                            });
                            witness.jobs.StartJob(new Job(JobDefOf.FleeAndCower, fleeLoc));
                            if (witness.Faction != null && !witness.Faction.HostileTo(criminal.Faction))
                            {
                                witness.Faction.TrySetRelationKind(criminal.Faction, FactionRelationKind.Hostile);
                            }
                        }
                        break;

                    case CrimeReaction.MoodVisitorAggro:
                        if (curCrime.Value.VisitorThought != null)
                        {
                            thought_MemoryObservation =
                                (Thought_MemoryObservation)ThoughtMaker
                                .MakeThought(curCrime.Value.VisitorThought);
                        }
                        if (CanTakeWitnessJob(witness))
                        {
                            witness.jobs.StartJob(new Job(JobDefOf.AttackMelee, criminal));
                            if (witness.Faction != null && !witness.Faction.HostileTo(criminal.Faction))
                            {
                                witness.Faction.TrySetRelationKind(criminal.Faction, FactionRelationKind.Hostile);
                            }
                        }
                        break;
                    }
                    //Log.Message("Loop 1 Step 6");

                    if (thought_MemoryObservation != null)
                    {
                        //Log.Message("Loop 1 Step 7");
                        thought_MemoryObservation.Target = criminal;
                        //Log.Message("Loop 1 Step 8");

                        witness.needs.mood.thoughts.memories.TryGainMemory(thought_MemoryObservation);
                        //Log.Message("Loop 1 Step 9");
                    }
                }
            }
        }