Example #1
0
        public static void add_breasts(Pawn pawn, Pawn parent = null, Gender gender = Gender.None)
        {
            //--Log.Message("[RJW] add_breasts( " + xxx.get_pawnname(pawn) + " ) called");
            BodyPartRecord partBPR = Genital_Helper.get_breastsBPR(pawn);

            if (partBPR == null)
            {
                //--Log.Message("[RJW] add_breasts( " + xxx.get_pawnname(pawn) + " ) - pawn doesn't have a breasts");
                return;
            }
            else if (pawn.health.hediffSet.PartIsMissing(partBPR))
            {
                //--Log.Message("[RJW] add_breasts( " + xxx.get_pawnname(pawn) + " ) had breasts but were removed.");
                return;
            }
            if (Genital_Helper.has_breasts(pawn))
            {
                //--Log.Message("[RJW] add_breasts( " + xxx.get_pawnname(pawn) + " ) - pawn already has breasts");
                return;
            }

            //TODO: figure out how to add (flat) breasts to males
            var racePartType = (pawn.gender == Gender.Female || gender == Gender.Female)
                                ? SexPartType.FemaleBreast
                                : SexPartType.MaleBreast;

            if (pawn.TryAddRacePart(racePartType))
            {
                return;
            }

            LegacySexPartAdder.AddBreasts(pawn, partBPR, parent);
        }
        public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn p, RecipeDef r)
        {
            if (Genital_Helper.has_breasts(p))
            {
                bool blocked = Genital_Helper.breasts_blocked(p) || xxx.is_slime(p);                //|| xxx.is_demon(p)

                foreach (BodyPartRecord part in p.health.hediffSet.GetNotMissingParts())
                {
                    if (r.appliedOnFixedBodyParts.Contains(part.def) && (!blocked))
                    {
                        yield return(part);
                    }
                }
            }
        }
Example #3
0
        public static Sex GetSex(Pawn pawn)
        {
            var partBPR = Genital_Helper.get_genitalsBPR(pawn);
            var parts   = Genital_Helper.get_PartsHediffList(pawn, partBPR);

            bool has_vagina          = Genital_Helper.has_vagina(pawn, parts);
            bool has_penis           = Genital_Helper.has_penis_fertile(pawn, parts);
            bool has_penis_infertile = Genital_Helper.has_penis_infertile(pawn, parts);
            bool has_breasts         = Genital_Helper.has_breasts(pawn);
            bool has_male_breasts    = Genital_Helper.has_male_breasts(pawn);
            //BodyType? bt = pawn.story?.bodyType;
            //if (bt != null)
            //	bt = BodyType.Undefined;

            Sex res;

            if (has_vagina && !has_penis && !has_penis_infertile)
            {
                res = Sex.female;
            }
            else if (has_vagina && (has_penis || has_penis_infertile))
            {
                res = Sex.futa;
            }
            else if ((has_penis || has_penis_infertile) && has_breasts && !has_male_breasts)
            {
                res = Sex.trap;
            }
            else if (has_penis || has_penis_infertile)             //probably should change this later
            {
                res = Sex.male;
            }
            else if (pawn.gender == Gender.Male)
            {
                res = Sex.male;
            }
            else if (pawn.gender == Gender.Female)
            {
                res = Sex.female;
            }
            else
            {
                res = Sex.none;
            }
            return(res);
        }