Exemplo n.º 1
0
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            if (!p.RaceProps.Humanlike)
            {
                return((ThoughtState)false);
            }

            if (!RelationsUtility.PawnsKnowEachOther(p, other))
            {
                return((ThoughtState)false);
            }

            Religion thisPawnReligion  = p.GetReligionComponent().Religion;
            Religion otherPawnReligion = other.GetReligionComponent().Religion;

            ReligionSettings_Social opinionSettings = thisPawnReligion.GetSettings <ReligionSettings_Social>(SettingsTagDefOf.OpinionTag);

            if (opinionSettings == null)
            {
                return((ThoughtState)false);
            }

            ReligionProperty property = opinionSettings.GetPropertyByObject(p, otherPawnReligion.Def, other);

            if (property == null || property.Witness == null || property.Witness.OpinionThought == null || property.Witness.OpinionThought != this.def)
            {
                return((ThoughtState)false);
            }

            return(ThoughtState.ActiveAtStage(p.GetReligionComponent().PietyTracker.PietyNeed.CurCategoryInt, otherPawnReligion.Def.LabelCap));
        }
Exemplo n.º 2
0
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            if (!other.RaceProps.Humanlike)
            {
                return(false);
            }
            if (!RelationsUtility.PawnsKnowEachOther(p, other))
            {
                return(false);
            }
            if (p.story.traits.HasTrait(TraitDefOf.Cannibal))
            {
                return(false);
            }

            Predicate <Tale> validator = delegate(Tale t)
            {
                return(other == t.DominantPawn);
            };
            var tale = VSIE_Utils.GetLatestTale(this.def.taleDef, validator);

            if (tale != null)
            {
                return(true);
            }
            return(false);
        }
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            if (!p.RaceProps.Humanlike)
            {
                return(false);
            }
            if (!p.story.traits.HasTrait(TraitDef.Named("BodyModificationEnthusiast")))
            {
                return(false);
            }
            if (!RelationsUtility.PawnsKnowEachOther(p, other))
            {
                return(false);
            }
            if (other.def != p.def)
            {
                return(false);
            }
            int num = Internal.countBodyMods(other.health.hediffSet);

            if (num > 0)
            {
                return(ThoughtState.ActiveAtStage(num - 1));
            }
            return(false);
        }
Exemplo n.º 4
0
        private bool canAutoLove(Pawn pawn, Pawn pawn2)
        {
            var tick = Find.TickManager.TicksGame;

            return(WoohooSettingHelper.latest.allowAIWoohoo &&
                   pawn.mindState.canLovinTick < tick
                   //idle
                   && JobUtilityIdle.isIdle(pawn2)

                   //still enjoys woohoo

                   && !(pawn2.needs.joy?.tolerances?.BoredOf(Constants.Joy_Woohoo) ?? false) &&
                   !pawn.needs.joy.tolerances.BoredOf(Constants.Joy_Woohoo) &&
                   (

                       ((pawn2.needs.joy?.CurLevel ?? 0f) < MINIMAL_JOY || pawn2.needs.mood.CurLevel < MINIMAL_JOY) &&
                       (pawn.needs.joy.CurLevel < MINIMAL_JOY || pawn.needs.mood.CurLevel < MINIMAL_JOY)
                   )

                   //and a 1d10
                   && (pawn.relations.DirectRelationExists(PawnRelationDefOf.Lover, pawn2) ||
                       pawn.relations.DirectRelationExists(PawnRelationDefOf.Fiance, pawn2) ||
                       pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, pawn2) ||
                       (Rand.Value < 0.1f / (pawn.GetSpouse() != null ? 4:1) &&
                        RelationsUtility.PawnsKnowEachOther(pawn, pawn2) &&
                        WoohooSettingHelper.latest.familyWeight * Math.Abs(LovePartnerRelationUtility.IncestOpinionOffsetFor(pawn2, pawn) * 0.01f) * Rand.Value < 0.5f
                       )
                       )
                   );
        }
Exemplo n.º 5
0
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            if (!p.RaceProps.Humanlike)
            {
                return(ThoughtState.Inactive);
            }
            if (!other.RaceProps.Humanlike)
            {
                return(ThoughtState.Inactive);
            }
            if (!RelationsUtility.PawnsKnowEachOther(p, other))
            {
                return(ThoughtState.Inactive);
            }
            float valuePawn      = Rand.ValueSeeded(p.thingIDNumber ^ 125);
            float valueOtherPawn = Rand.ValueSeeded(other.thingIDNumber ^ 125);

            if (valuePawn < 0.2f || valueOtherPawn < 0.2f)
            {
                return(ThoughtState.Inactive);
            }
            if ((valuePawn >= 0.6f && valueOtherPawn < 0.6f) || (valuePawn < 0.6f && valueOtherPawn >= 0.6f))
            {
                return(ThoughtState.ActiveAtStage(0));
            }
            if (valuePawn < 0.6f && valueOtherPawn < 0.6f)
            {
                return(ThoughtState.ActiveAtStage(1));
            }
            if (valuePawn >= 0.6f && valueOtherPawn >= 0.6f)
            {
                return(ThoughtState.ActiveAtStage(2));
            }
            return(ThoughtState.Inactive);
        }
        /// <summary>gets the current state of the thought with regards to the given pawns</summary>
        /// <param name="p">The pawn that has the thought</param>
        /// <param name="otherPawn">The pawn the thought is about</param>
        /// <returns></returns>
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn otherPawn)
        {
            if (!p.RaceProps.Humanlike)
            {
                return(false);
            }
            if (!otherPawn.RaceProps.Humanlike)
            {
                return(false);                                //make sure only humanlike pawns are affected by this
            }
            if (!p.story.traits.HasTrait(TraitDefOf.BodyPurist))
            {
                return(false);
            }
            if (!RelationsUtility.PawnsKnowEachOther(p, otherPawn))
            {
                return(false);                                                    //the pawns have to know each other
            }
            var tracker = otherPawn.GetMutationTracker();

            if (tracker == null)
            {
                return(false);
            }
            if (tracker.MutationsCount == 0)
            {
                return(false);
            }
            int n = Mathf.FloorToInt(tracker.TotalNormalizedInfluence * def.stages.Count);

            n = Mathf.Clamp(n, 0, def.stages.Count - 1);

            return(ThoughtState.ActiveAtStage(n));
        }
Exemplo n.º 7
0
        // Token: 0x0600001B RID: 27 RVA: 0x00002B64 File Offset: 0x00000D64
        protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
        {
            if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
            {
                return(false);
            }

            if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Breathing))
            {
                return(false);
            }

            Hediff SShedneutral;

            if (other.health == null)
            {
                SShedneutral = null;
            }
            else
            {
                var hedSet = other.health.hediffSet;
                SShedneutral = hedSet?.GetFirstHediffOfDef(SSHedCheckNeutral);
            }

            if (SShedneutral == null || !SShedneutral.Visible)
            {
                return(false);
            }

            return(ThoughtState.ActiveAtStage(0));
        }
        protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
        {
            if (pawn != null && other != null)
            {
                if (!other.RaceProps.Humanlike || other.Dead)
                {
                    return(false);
                }
                if (!RelationsUtility.PawnsKnowEachOther(pawn, other))
                {
                    return(false);
                }
                if (pawn.story.traits.HasTrait(TorannMagicDefOf.Undead) || pawn.story.traits.HasTrait(TorannMagicDefOf.Lich) || pawn.story.traits.HasTrait(TorannMagicDefOf.Enchanter))
                {
                    return(false);
                }
                if (other.health.hediffSet.HasHediff(TorannMagicDefOf.TM_EnchantedAuraHD, false))
                {
                    CompAbilityUserMagic comp = other.GetComp <CompAbilityUserMagic>();

                    if (comp != null)
                    {
                        return(ThoughtState.ActiveAtStage(comp.MagicData.MagicPowerSkill_EnchantedBody.FirstOrDefault((MagicPowerSkill x) => x.label == "TM_EnchantedBody_pwr").level));
                    }
                }
            }
            return(false);
        }
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            int num = p.story.traits.DegreeOfTrait(TraitDefOf.FeelingsTowardHumanity);

            if (!p.RaceProps.Humanlike)
            {
                return(false);
            }
            if (!RelationsUtility.PawnsKnowEachOther(p, other))
            {
                return(false);
            }
            if (other.IsAndroid() == true)
            {
                return(false);
            }
            if (num == 1)
            {
                return(ThoughtState.ActiveAtStage(0));
            }
            if (num == 2)
            {
                return(ThoughtState.ActiveAtStage(1));
            }
            return(false);
        }
Exemplo n.º 10
0
        protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
        {
            ThoughtState result;

            if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
            {
                result = false;
            }
            else if (RelationsUtility.IsDisfigured(other))
            {
                result = false;
            }
            else
            {
                if (other.health.hediffSet.HasHediff(PolarisblocDefOf.PolarisCombatChip_Charm))
                {
                    result = ThoughtState.ActiveAtStage(0);
                }

                /*int num = other.story.traits.DegreeOfTrait(TraitDefOf.Beauty);
                 * if (num == 1)
                 * {
                 *  result = ThoughtState.ActiveAtStage(0);
                 * }
                 * else if (num == 2)
                 * {
                 *  result = ThoughtState.ActiveAtStage(1);
                 * }*/
                else
                {
                    result = false;
                }
            }
            return(result);
        }
Exemplo n.º 11
0
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            if (!p.RaceProps.Humanlike)
            {
                return(false);
            }

            if (!RelationsUtility.PawnsKnowEachOther(p, other))
            {
                return(false);
            }

            if (other.def != p.def)
            {
                return(false);
            }

            foreach (var traitDef in def.requiredTraits)
            {
                if (p.story.traits.HasTrait(traitDef) && other.story.traits.HasTrait(traitDef))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 12
0
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn otherPawn)
        {
            if (!RelationsUtility.PawnsKnowEachOther(p, otherPawn))
            {
                return(false);
            }
            if (!LovePartnerRelationUtility.LovePartnerRelationExists(p, otherPawn))
            {
                return(false);
            }
            if (!PsycheHelper.PsychologyEnabled(p))
            {
                return(false);
            }
            if (p.Map == otherPawn.Map)
            {
                PsycheHelper.Comp(p).LDRTick = Find.TickManager.TicksAbs;
                return(false);
            }
            int tickSinceLastSeen = PsycheHelper.Comp(p).LDRTick;
            int ticksApart        = Find.TickManager.TicksAbs - tickSinceLastSeen;
            int quadrumsApart     = Mathf.FloorToInt((float)ticksApart / (float)GenDate.TicksPerQuadrum);
            int maxApart          = (p.relations.GetDirectRelation(PawnRelationDefOf.Spouse, otherPawn) == null ? 7 : 6);

            if (quadrumsApart > maxApart)
            {
                quadrumsApart = maxApart;
            }
            if (quadrumsApart > 1)
            {
                return(ThoughtState.ActiveAtStage(quadrumsApart - 1));
            }
            return(false);
        }
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            if (!other.RaceProps.Humanlike)
            {
                return(false);
            }
            if (!RelationsUtility.PawnsKnowEachOther(p, other))
            {
                return(false);
            }

            Predicate <Tale_TriplePawn> validator = delegate(Tale_TriplePawn t)
            {
                if (t.firstPawnData is null)
                {
                    Log.Error(t + " hasn't firstPawnData, this shouldn't happen.");
                }
                if (t.secondPawnData is null)
                {
                    Log.Error(t + " hasn't secondPawnData, this shouldn't happen.");
                }
                return(p == t.firstPawnData.pawn && other == t.secondPawnData.pawn);
            };

            var tale = VSIE_Utils.GetLatestTriplePawnTale(this.def.taleDef, validator);

            if (tale != null)
            {
                return(true);
            }
            return(false);
        }
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            if (!p.RaceProps.Humanlike)
            {
                return(false);
            }

            if (!RelationsUtility.PawnsKnowEachOther(p, other))
            {
                return(false);
            }

            if (other.def != p.def)
            {
                return(false);
            }

            if (!p.story.traits.allTraits.Any(x => x.def is TraitDef_ReligionTrait))
            {
                return(false);
            }

            if (other.story.traits.HasTrait(ReligionDefOf.Antitheist))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 15
0
        protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
        {
            if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
            {
                return(false);
            }
            if (RelationsUtility.IsDisfigured(other))
            {
                return(false);
            }
            if (pawn.health.capacities.GetEfficiency(PawnCapacityDefOf.Sight) == 0f)
            {
                return(false);
            }
            int num = other.story.traits.DegreeOfTrait(TraitDefOf.Beauty);

            if (num == 1)
            {
                return(ThoughtState.ActiveAtStage(0));
            }
            if (num == 2)
            {
                return(ThoughtState.ActiveAtStage(1));
            }
            return(false);
        }
Exemplo n.º 16
0
        private bool canAutoLove(Pawn pawn, Pawn pawn2)
        {
            var tick = Find.TickManager.TicksGame;

            return(WoohooSettingHelper.latest.allowAIWoohoo &&
                   pawn.mindState.canLovinTick < tick &&
                   pawn2.mindState.canLovinTick < tick
                   //idle
                   && JobUtilityIdle.isIdle(pawn2)

                   //still enjoys woohoo
                   && pawn2?.needs?.joy?.tolerances != null &&
                   pawn?.needs?.joy?.tolerances != null &&
                   pawn2?.needs?.mood?.CurLevel != null &&
                   pawn?.needs?.mood?.CurLevel != null

                   && !pawn2.needs.joy.tolerances.BoredOf(Constants.Joy_Woohoo) &&
                   !pawn.needs.joy.tolerances.BoredOf(Constants.Joy_Woohoo) &&
                   ((pawn2.needs.joy.CurLevel < .6f || pawn2.needs.mood.CurLevel < .6f) &&
                    (pawn.needs.joy.CurLevel < .6f || pawn.needs.mood.CurLevel < .6f)
                   )

                   //and a 1d10
                   && Rand.Value < 0.1f &&
                   (RelationsUtility.PawnsKnowEachOther(pawn, pawn2)) &&
                   WoohooSettingHelper.latest.familyWeight * LovePartnerRelationUtility.IncestOpinionOffsetFor(pawn2, pawn) * Rand.Value < 0.5f

                   // && (Math.Abs(LovePartnerRelationUtility.IncestOpinionOffsetFor(pawn2, pawn)) < 0.01f || Rand.Value > WoohooSettingHelper.latest.familyWeight)

                   );
        }
Exemplo n.º 17
0
        // Token: 0x06000076 RID: 118 RVA: 0x000050F4 File Offset: 0x000032F4
        protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
        {
            if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
            {
                return(false);
            }

            if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Breathing))
            {
                return(false);
            }

            if (other.health == null)
            {
                return(false);
            }

            var health    = other.health;
            var hediffSet = health?.hediffSet;

            var hedSet = hediffSet;

            if (hedSet?.GetFirstHediffOfDef(AYHedCheckLavSoap) != null)
            {
                return(ThoughtState.ActiveAtStage(1));
            }

            return(false);
        }
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            TraitDef feel = DefDatabase <TraitDef> .GetNamed("FeelingsTowardHumanity", false);

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

            int          num  = p.story.traits.DegreeOfTrait(feel);
            bool         flag = !p.RaceProps.Humanlike;
            ThoughtState result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = !RelationsUtility.PawnsKnowEachOther(p, other);
                if (flag2)
                {
                    result = false;
                }
                else
                {
                    bool flag3 = other.IsAndroid();
                    //SI androide OU un cyborg
                    if (flag3 || other.health.hediffSet.CountAddedAndImplantedParts() >= 5)
                    {
                        result = false;
                    }
                    else
                    {
                        bool flag4 = num == 1;
                        if (flag4)
                        {
                            result = ThoughtState.ActiveAtStage(0);
                        }
                        else
                        {
                            bool flag5 = num == 2;
                            if (flag5)
                            {
                                result = ThoughtState.ActiveAtStage(1);
                            }
                            else
                            {
                                result = false;
                            }
                        }
                    }
                }
            }
            return(result);
        }
Exemplo n.º 19
0
        public static float CalculateColonyTrust(this Pawn guest, Map map)
        {
            const int requiredAvgOpinion = 1;
            var       sum = map.mapPawns.FreeColonists.Where(p => RelationsUtility.PawnsKnowEachOther(guest, p)).Sum(p => guest.relations.OpinionOf(p) / requiredAvgOpinion);
            //var average = sum/Find.MapPawns.FreeColonistsCount;

            float score = Mathf.Abs(sum) * sum * 1f / map.mapPawns.FreeColonistsCount;

            //Log.Message(string.Format("{0}: sum = {1:F}, avg = {2:F}, score = {3:F}", guest.NameStringShort, sum, average, score));

            return(score);
        }
Exemplo n.º 20
0
 protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
 {
     if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
     {
         return(false);
     }
     if (pawn.kindDef != Helldrone.PawnKindDefOf.AndroidHellUnit)
     {
         return(false);
     }
     return(true);
 }
 protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
 {
     if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
     {
         return((ThoughtState)false);
     }
     if (pawn.story.traits.HasTrait(GATDefOf.GAT_Pervert) || !other.story.traits.HasTrait(GATDefOf.GAT_Pervert))             // crosscheck trait existance?!
     {
         return((ThoughtState)false);
     }
     return((ThoughtState)true);
 }
Exemplo n.º 22
0
 protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
 {
     if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
     {
         return(false);
     }
     if (!other.story.traits.HasTrait(TraitDefOfGR.MelodicVoice))
     {
         return(false);
     }
     if (pawn.health.capacities.GetLevel(PawnCapacityDefOf.Hearing) <= 0.15f)
     {
         return(false);
     }
     return(ThoughtState.ActiveAtStage(0));
 }
Exemplo n.º 23
0
 protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
 {
     if (!other.RaceProps.Humanlike)
     {
         return(false);
     }
     if (!RelationsUtility.PawnsKnowEachOther(p, other))
     {
         return(false);
     }
     if (IsRoyalty(p, other) && Rand.ChanceSeeded(0.1f, p.thingIDNumber))
     {
         return(true);
     }
     return(false);
 }
 protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
 {
     if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
     {
         return(false);
     }
     if (!other.story.traits.HasTrait(TraitDefOf.AnnoyingVoice))
     {
         return(false);
     }
     if (pawn.health.capacities.GetEfficiency(PawnCapacityDefOf.Hearing) == 0f && pawn.health.capacities.GetEfficiency(PawnCapacityDefOf.Sight) == 0f)
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 25
0
        /// <summary>gets the current state of the thought with regards to the given pawns</summary>
        /// <param name="p">The pawn that has the thought</param>
        /// <param name="otherPawn">The pawn the thought is about</param>
        /// <returns></returns>
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn otherPawn)
        {
            if (!p.RaceProps.Humanlike)
            {
                return(false);
            }
            if (!otherPawn.RaceProps.Humanlike)
            {
                return(false);                                //make sure only humanlike pawns are affected by this
            }
            if (!p.story.traits.HasTrait(TraitDefOf.BodyPurist))
            {
                return(false);
            }
            if (!RelationsUtility.PawnsKnowEachOther(p, otherPawn))
            {
                return(false);                                                    //the pawns have to know each other
            }
            MutationTracker tracker = otherPawn.GetMutationTracker();

            if (tracker == null)
            {
                return(false);
            }
            if (tracker.MutationsCount == 0)
            {
                return(false);
            }


            //check for aliens that naturally spawn with parts

            RaceMutationSettingsExtension raceExt = p.TryGetRaceMutationSettings();

            if (raceExt != null)
            {
                return(CalculateAlienBP(p, tracker, raceExt));
            }


            int n = Mathf.FloorToInt(tracker.TotalNormalizedInfluence * def.stages.Count);

            n = Mathf.Clamp(n, 0, def.stages.Count - 1);

            return(ThoughtState.ActiveAtStage(n));
        }
        protected override ThoughtState CurrentSocialStateInternal(Pawn p, Pawn other)
        {
            if (!p.RaceProps.Humanlike)
            {
                return(false);
            }

            if (!RelationsUtility.PawnsKnowEachOther(p, other))
            {
                return(false);
            }

            if (other.def != p.def)
            {
                return(false);
            }

            if (!p.story.traits.allTraits.Any(x => x.def is TraitDef_ReligionTrait))
            {
                return(false);
            }

            if (!other.story.traits.allTraits.Any(x => x.def is TraitDef_ReligionTrait))
            {
                return(false);
            }

            var pawnRel =
                p.story.traits.allTraits.Find(x => x.def is TraitDef_ReligionTrait).def as TraitDef_ReligionTrait;

            if (pawnRel != null && pawnRel.isAgressive)
            {
                return(true);
            }

            var otherRel = other.story.traits.allTraits.Find(x => x.def is TraitDef_ReligionTrait).def;

            if (pawnRel != null && pawnRel.foreignReligions.Contains(otherRel))
            {
                return(true);
            }

            return(false);
        }
 protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
 {
     if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
     {
         return(false);
     }
     else if (pawn.def.GetModExtension <XenoRomanceExtension>().faceCategory != pawn.def.GetModExtension <XenoRomanceExtension>().faceCategory)
     {
         return(false);
     }
     else if (RelationsUtility.IsDisfigured(other))
     {
         return(false);
     }
     else if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Sight))
     {
         return(false);
     }
     else
     {
         int num = other.story.traits.DegreeOfTrait(TraitDefOf.Beauty);
         if (num == 1)
         {
             return(ThoughtState.ActiveAtStage(0));
         }
         else if (num == 2)
         {
             return(ThoughtState.ActiveAtStage(1));
         }
         else if (num == 3)
         {
             return(ThoughtState.ActiveAtStage(2));
         }
         else if (num == 4)
         {
             return(ThoughtState.ActiveAtStage(3));
         }
         else
         {
             return(false);
         }
     }
 }
 public static void GRPrettyPatch(ref ThoughtState __result, Pawn pawn, Pawn other)
 {
     if (!other.RaceProps.Humanlike || !RelationsUtility.PawnsKnowEachOther(pawn, other))
     {
         __result = false;
     }
     else if (pawn.def.GetModExtension <XenoRomanceExtension>().faceCategory != pawn.def.GetModExtension <XenoRomanceExtension>().faceCategory)
     {
         __result = false;
     }
     else if (RelationsUtility.IsDisfigured(other))
     {
         __result = false;
     }
     else if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Sight))
     {
         __result = false;
     }
     else
     {
         int num = other.story.traits.DegreeOfTrait(TraitDefOf.Beauty);
         if (num == 1)
         {
             __result = ThoughtState.ActiveAtStage(0);
         }
         else if (num == 2)
         {
             __result = ThoughtState.ActiveAtStage(1);
         }
         else if (num == 3)
         {
             __result = ThoughtState.ActiveAtStage(2);
         }
         else if (num == 4)
         {
             __result = ThoughtState.ActiveAtStage(3);
         }
         else
         {
             __result = false;
         }
     }
 }
Exemplo n.º 29
0
 protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
 {
     if (pawn != null && other != null)
     {
         if (!other.RaceProps.Humanlike || other.Dead)
         {
             return(false);
         }
         if (!RelationsUtility.PawnsKnowEachOther(pawn, other))
         {
             return(false);
         }
         if (pawn.story.traits.HasTrait(TorannMagicDefOf.Undead))
         {
             return(false);
         }
         if (other.story.traits.HasTrait(TorannMagicDefOf.Succubus))
         {
             if (pawn.story.traits.HasTrait(TorannMagicDefOf.Succubus) || (pawn.gender == Gender.Female && !pawn.story.traits.HasTrait(TraitDefOf.Gay)))
             {
                 return(false);
             }
             else
             {
                 CompAbilityUserMagic magicComp = pawn.GetComp <CompAbilityUserMagic>();
                 CompAbilityUserMight mightComp = pawn.GetComp <CompAbilityUserMight>();
                 if (mightComp.IsMightUser)
                 {
                     return(ThoughtState.ActiveAtStage(0));
                 }
                 else if (magicComp.IsMagicUser)
                 {
                     return(ThoughtState.ActiveAtStage(1));
                 }
                 else
                 {
                     return(ThoughtState.ActiveAtStage(2));
                 }
             }
         }
     }
     return(false);
 }
Exemplo n.º 30
0
 protected override ThoughtState CurrentSocialStateInternal(Pawn pawn, Pawn other)
 {
     if (!other.RaceProps.Humanlike || other.Dead)
     {
         return(false);
     }
     if (!RelationsUtility.PawnsKnowEachOther(pawn, other))
     {
         return(false);
     }
     if (!RelationsUtility.IsDisfigured(other))
     {
         return(false);
     }
     if (pawn.health.capacities.GetEfficiency(PawnCapacityDefOf.Sight) == 0f)
     {
         return(false);
     }
     return(true);
 }