Example #1
0
        public float CopyOfInternalMethod_TradeUI_GetMultiplier()
        {
            GameObject body = XRLCore.Core.Game.Player.Body;

            if (!body.Statistics.ContainsKey("Ego"))
            {
                return(0.25f);
            }
            float num = (float)body.Statistics["Ego"].Modifier;

            if (body.HasPart("Persuasion_SnakeOiler"))
            {
                num += 2f;
            }
            if (body.HasEffect("Glotrot"))
            {
                num = -3f;
            }
            float num2 = 0.35f + 0.07f * num;

            if (body.HasPart("SociallyRepugnant"))
            {
                num2 /= 5f;
            }
            if (num2 > 0.95f)
            {
                num2 = 0.95f;
            }
            else if (num2 < 0.05f)
            {
                num2 = 0.05f;
            }
            return(num2);
        }
Example #2
0
            private static void Postfix_IsSuitableTarget(Brain __instance, GameObject who, ref bool __result)
            {
                if (__result || !__instance.IsPlayerLed() || who.HasEffect <Asleep>() || !who.IsHostileTowards(__instance.PartyLeader) || !__instance.CheckPerceptionOf(who))
                {
                    return;
                }

                var parent = __instance.ParentObject;

                if (__instance.PartyLeader.DistanceTo(who) <= 10)
                {
                    __result = true;
                }
            }