コード例 #1
0
 public static float GetManhunterOnDamageChance(Pawn pawn, Thing instigator = null)
 {
     if (instigator != null)
     {
         return(PawnUtility.GetManhunterOnDamageChance(pawn, pawn.Position.DistanceTo(instigator.Position), instigator));
     }
     return(PawnUtility.GetManhunterOnDamageChance(pawn.kindDef));
 }
コード例 #2
0
        private void ShowDesignationWarnings(Pawn pawn)
        {
            float manhunterOnDamageChance  = pawn.RaceProps.manhunterOnDamageChance;
            float manhunterOnDamageChance2 = PawnUtility.GetManhunterOnDamageChance(pawn.kindDef);

            if (manhunterOnDamageChance >= 0.015f)
            {
                Messages.Message("MessageAnimalsGoPsychoHunted".Translate(pawn.kindDef.GetLabelPlural().CapitalizeFirst(), manhunterOnDamageChance2.ToStringPercent(), pawn.Named("ANIMAL")).CapitalizeFirst(), pawn, MessageTypeDefOf.CautionInput, historical: false);
            }
        }
コード例 #3
0
        public static float GetManhunterOnDamageChance(Pawn pawn, float distance, Thing instigator)
        {
            float num = PawnUtility.GetManhunterOnDamageChance(pawn.kindDef);

            num *= GenMath.LerpDoubleClamped(1f, 30f, 3f, 1f, distance);
            if (instigator != null)
            {
                num *= 1f - instigator.GetStatValue(StatDefOf.HuntingStealth, true);
            }
            return(num);
        }
コード例 #4
0
        public static float GetManhunterOnDamageChance(Pawn pawn, Thing instigator = null)
        {
            float manhunterOnDamageChance;

            if (instigator != null)
            {
                manhunterOnDamageChance = PawnUtility.GetManhunterOnDamageChance(pawn, pawn.Position.DistanceTo(instigator.Position));
            }
            else
            {
                manhunterOnDamageChance = PawnUtility.GetManhunterOnDamageChance(pawn.kindDef);
            }
            return(manhunterOnDamageChance);
        }
コード例 #5
0
        private void ShowDesignationWarnings(Pawn pawn)
        {
            float manhunterOnDamageChance  = pawn.RaceProps.manhunterOnDamageChance;
            float manhunterOnDamageChance2 = PawnUtility.GetManhunterOnDamageChance(pawn.kindDef);

            if (manhunterOnDamageChance >= 0.015f)
            {
                string text = "MessageAnimalsGoPsychoHunted".Translate(new object[]
                {
                    pawn.kindDef.GetLabelPlural(-1).CapitalizeFirst(),
                    manhunterOnDamageChance2.ToStringPercent()
                }).CapitalizeFirst();
                Messages.Message(text, pawn, MessageTypeDefOf.CautionInput, false);
            }
        }
 protected override string GetTextFor(Pawn pawn)
 {
     return(PawnUtility.GetManhunterOnDamageChance(pawn).ToStringPercent());
 }
コード例 #7
0
        public static float GetManhunterOnDamageChance(Pawn pawn, float distance)
        {
            float manhunterOnDamageChance = PawnUtility.GetManhunterOnDamageChance(pawn.kindDef);

            return(manhunterOnDamageChance * GenMath.LerpDoubleClamped(1f, 30f, 3f, 1f, distance));
        }