public void SetupHairCap(SkinSetCollection skin, float hairNum, float meshNum, MaterialPropertyBlock block)
    {
        float   single;
        float   single1;
        int     index = skin.GetIndex(meshNum);
        SkinSet skins = skin.Skins[index];

        if (skins != null)
        {
            for (int i = 0; i < 5; i++)
            {
                if (((int)this.hairCapMask & 1 << (i & 31)) != 0)
                {
                    PlayerModelHair.GetRandomVariation(hairNum, i, index, out single, out single1);
                    HairType hairType = (HairType)i;
                    HairSetCollection.HairSetEntry hairSetEntry = skins.HairCollection.Get(hairType, single);
                    if (hairSetEntry.HairSet != null)
                    {
                        HairDyeCollection hairDyeCollection = hairSetEntry.HairDyeCollection;
                        if (hairDyeCollection != null)
                        {
                            HairDye hairDye = hairDyeCollection.Get(single1);
                            if (hairDye != null)
                            {
                                hairDye.ApplyCap(hairDyeCollection, hairType, block);
                            }
                        }
                    }
                }
            }
        }
    }
Esempio n. 2
0
 public Person(String birthName, int birthYear, HairType typeOfHair)
 {
     this.birthName = birthName;
     this.birthYear = birthYear;
     this.hair = new Hair(typeOfHair);
     Person.peopleCounter++;
 }
    public HairSetCollection.HairSetEntry[] GetListByType(HairType hairType)
    {
        switch (hairType)
        {
        case HairType.Head:
        {
            return(this.Head);
        }

        case HairType.Eyebrow:
        {
            return(this.Eyebrow);
        }

        case HairType.Facial:
        {
            return(this.Facial);
        }

        case HairType.Armpit:
        {
            return(this.Armpit);
        }

        case HairType.Pubic:
        {
            return(this.Pubic);
        }
        }
        return(null);
    }
    private void Setup(HairType type, HairSetCollection hair, int meshIndex, float typeNum, float dyeNum, MaterialPropertyBlock block)
    {
        this.CacheOriginalMaterials();
        HairSetCollection.HairSetEntry hairSetEntry = hair.Get(type, typeNum);
        if (hairSetEntry.HairSet == null)
        {
            Debug.LogWarning("Hair.Get returned a NULL hair");
            return;
        }
        int num = -1;

        if (type == HairType.Facial || type == HairType.Eyebrow)
        {
            num = meshIndex;
        }
        HairDye           hairDye           = null;
        HairDyeCollection hairDyeCollection = hairSetEntry.HairDyeCollection;

        if (hairDyeCollection != null)
        {
            hairDye = hairDyeCollection.Get(dyeNum);
        }
        hairSetEntry.HairSet.Process(this, hairDyeCollection, hairDye, block);
        hairSetEntry.HairSet.ProcessMorphs(base.gameObject, num);
    }
 private void Setup(
     HairType type,
     HairSetCollection hair,
     int meshIndex,
     float typeNum,
     float dyeNum,
     MaterialPropertyBlock block)
 {
     this.CacheOriginalMaterials();
     HairSetCollection.HairSetEntry hairSetEntry = hair.Get(type, typeNum);
     if (Object.op_Equality((Object)hairSetEntry.HairSet, (Object)null))
     {
         Debug.LogWarning((object)"Hair.Get returned a NULL hair");
     }
     else
     {
         int blendShapeIndex = -1;
         if (type == HairType.Facial || type == HairType.Eyebrow)
         {
             blendShapeIndex = meshIndex;
         }
         HairDye           dye = (HairDye)null;
         HairDyeCollection hairDyeCollection = hairSetEntry.HairDyeCollection;
         if (Object.op_Inequality((Object)hairDyeCollection, (Object)null))
         {
             dye = hairDyeCollection.Get(dyeNum);
         }
         hairSetEntry.HairSet.Process(this, hairDyeCollection, dye, block);
         hairSetEntry.HairSet.ProcessMorphs(((Component)this).get_gameObject(), blendShapeIndex);
     }
 }
Esempio n. 6
0
    public void SetupHairCap(
        SkinSetCollection skin,
        float hairNum,
        float meshNum,
        MaterialPropertyBlock block)
    {
        int     index = skin.GetIndex(meshNum);
        SkinSet skin1 = skin.Skins[index];

        if (!Object.op_Inequality((Object)skin1, (Object)null))
        {
            return;
        }
        for (int typeIndex = 0; typeIndex < 5; ++typeIndex)
        {
            if ((this.hairCapMask & (HairCapMask)(1 << typeIndex)) != (HairCapMask)0)
            {
                float typeNum;
                float dyeNum;
                PlayerModelHair.GetRandomVariation(hairNum, typeIndex, index, out typeNum, out dyeNum);
                HairType hairType = (HairType)typeIndex;
                HairSetCollection.HairSetEntry hairSetEntry = skin1.HairCollection.Get(hairType, typeNum);
                if (Object.op_Inequality((Object)hairSetEntry.HairSet, (Object)null))
                {
                    HairDyeCollection hairDyeCollection = hairSetEntry.HairDyeCollection;
                    if (Object.op_Inequality((Object)hairDyeCollection, (Object)null))
                    {
                        hairDyeCollection.Get(dyeNum)?.ApplyCap(hairDyeCollection, hairType, block);
                    }
                }
            }
        }
    }
Esempio n. 7
0
        public static Hair GetHairAsset(HairType type)
        {
            if (type == HairType.None)
            {
                return(null);
            }

            return(AssetLoader.LoadScriptableObjectAsset <Hair>(type.ToString()));
        }
Esempio n. 8
0
 public void SetFromStoreData(StoreData storeData)
 {
     Nickname        = storeData.CoreData.Nickname;
     CreateId        = storeData.CreateId;
     FontRegion      = storeData.CoreData.FontRegion;
     FavoriteColor   = storeData.CoreData.FavoriteColor;
     Gender          = storeData.CoreData.Gender;
     Height          = storeData.CoreData.Height;
     Build           = storeData.CoreData.Build;
     Type            = storeData.CoreData.Type;
     RegionMove      = storeData.CoreData.RegionMove;
     FacelineType    = storeData.CoreData.FacelineType;
     FacelineColor   = storeData.CoreData.FacelineColor;
     FacelineWrinkle = storeData.CoreData.FacelineWrinkle;
     FacelineMake    = storeData.CoreData.FacelineMake;
     HairType        = storeData.CoreData.HairType;
     HairColor       = storeData.CoreData.HairColor;
     HairFlip        = storeData.CoreData.HairFlip;
     EyeType         = storeData.CoreData.EyeType;
     EyeColor        = storeData.CoreData.EyeColor;
     EyeScale        = storeData.CoreData.EyeScale;
     EyeAspect       = storeData.CoreData.EyeAspect;
     EyeRotate       = storeData.CoreData.EyeRotate;
     EyeX            = storeData.CoreData.EyeX;
     EyeY            = storeData.CoreData.EyeY;
     EyebrowType     = storeData.CoreData.EyebrowType;
     EyebrowColor    = storeData.CoreData.EyebrowColor;
     EyebrowScale    = storeData.CoreData.EyebrowScale;
     EyebrowAspect   = storeData.CoreData.EyebrowAspect;
     EyebrowRotate   = storeData.CoreData.EyebrowRotate;
     EyebrowX        = storeData.CoreData.EyebrowX;
     EyebrowY        = storeData.CoreData.EyebrowY;
     NoseType        = storeData.CoreData.NoseType;
     NoseScale       = storeData.CoreData.NoseScale;
     NoseY           = storeData.CoreData.NoseY;
     MouthType       = storeData.CoreData.MouthType;
     MouthColor      = storeData.CoreData.MouthColor;
     MouthScale      = storeData.CoreData.MouthScale;
     MouthAspect     = storeData.CoreData.MouthAspect;
     MouthY          = storeData.CoreData.MouthY;
     BeardColor      = storeData.CoreData.BeardColor;
     BeardType       = storeData.CoreData.BeardType;
     MustacheType    = storeData.CoreData.MustacheType;
     MustacheScale   = storeData.CoreData.MustacheScale;
     MustacheY       = storeData.CoreData.MustacheY;
     GlassType       = storeData.CoreData.GlassType;
     GlassColor      = storeData.CoreData.GlassColor;
     GlassScale      = storeData.CoreData.GlassScale;
     GlassY          = storeData.CoreData.GlassY;
     MoleType        = storeData.CoreData.MoleType;
     MoleScale       = storeData.CoreData.MoleScale;
     MoleX           = storeData.CoreData.MoleX;
     MoleY           = storeData.CoreData.MoleY;
     Reserved        = 0;
 }
Esempio n. 9
0
        public NpcTemplate(NPCName name, SpeciesType species, JobType job, FaceType face, HairType hair, ClothingTopType top, ClothingBottomType bottom) : this()
        {
            Name    = name;
            Species = species;
            Job     = job;

            Top    = top;
            Bottom = bottom;
            Hair   = hair;
            Face   = face;
        }
Esempio n. 10
0
        public async Task <ActionResult> OnGet(int id)
        {
            HairType = await _context.HairTypes
                       .Include(r => r.RazaHairTypes)
                       .ThenInclude(o => o.Raza)
                       .SingleOrDefaultAsync(r => r.Id == id);

            if (HairType == null)
            {
                return(RedirectToPage("/Error"));
            }
            return(Page());
        }
Esempio n. 11
0
        public async Task <int> SaveHairType(HairType hairType)
        {
            if (hairType.Id != 0)
            {
                _context.HairTypes.Update(hairType);

                await _context.SaveChangesAsync();

                return(1);
            }
            else
            {
                await _context.HairTypes.AddAsync(hairType);

                await _context.SaveChangesAsync();

                return(1);
            }
        }
Esempio n. 12
0
    public void ApplyCap(HairDyeCollection collection, HairType type, MaterialPropertyBlock block)
    {
        if (collection.applyCap)
        {
            switch (type)
            {
            case HairType.Head:
            case HairType.Armpit:
            case HairType.Pubic:
                block.SetColor(_HairBaseColorUV1, capBaseColor.gamma);
                block.SetTexture(_HairPackedMapUV1, (collection.capMask != null) ? collection.capMask : Texture2D.blackTexture);
                break;

            case HairType.Facial:
                block.SetColor(_HairBaseColorUV2, capBaseColor.gamma);
                block.SetTexture(_HairPackedMapUV2, (collection.capMask != null) ? collection.capMask : Texture2D.blackTexture);
                break;
            }
        }
    }
Esempio n. 13
0
    public void ApplyCap(HairDyeCollection collection, HairType type, MaterialPropertyBlock block)
    {
        if (!collection.applyCap)
        {
            return;
        }
        switch (type)
        {
        case HairType.Head:
        case HairType.Armpit:
        case HairType.Pubic:
            block.SetColor(HairDye._HairBaseColorUV1, ((Color) ref this.capBaseColor).get_gamma());
            block.SetTexture(HairDye._HairPackedMapUV1, Object.op_Inequality((Object)collection.capMask, (Object)null) ? collection.capMask : (Texture)Texture2D.get_blackTexture());
            break;

        case HairType.Facial:
            block.SetColor(HairDye._HairBaseColorUV2, ((Color) ref this.capBaseColor).get_gamma());
            block.SetTexture(HairDye._HairPackedMapUV2, Object.op_Inequality((Object)collection.capMask, (Object)null) ? collection.capMask : (Texture)Texture2D.get_blackTexture());
            break;
        }
    }
Esempio n. 14
0
    public void ApplyCap(HairDyeCollection collection, HairType type, MaterialPropertyBlock block)
    {
        Texture texture;
        Texture texture1;

        if (collection.applyCap)
        {
            if (type == HairType.Head || type == HairType.Armpit || type == HairType.Pubic)
            {
                block.SetColor(HairDye._HairBaseColorUV1, this.capBaseColor.gamma);
                MaterialPropertyBlock materialPropertyBlock = block;
                int num = HairDye._HairPackedMapUV1;
                if (collection.capMask != null)
                {
                    texture = collection.capMask;
                }
                else
                {
                    texture = Texture2D.blackTexture;
                }
                materialPropertyBlock.SetTexture(num, texture);
                return;
            }
            if (type == HairType.Facial)
            {
                block.SetColor(HairDye._HairBaseColorUV2, this.capBaseColor.gamma);
                MaterialPropertyBlock materialPropertyBlock1 = block;
                int num1 = HairDye._HairPackedMapUV2;
                if (collection.capMask != null)
                {
                    texture1 = collection.capMask;
                }
                else
                {
                    texture1 = Texture2D.blackTexture;
                }
                materialPropertyBlock1.SetTexture(num1, texture1);
            }
        }
    }
Esempio n. 15
0
    public void DeprivedHair(HairType type) //髪を減らされた時
    {
        switch (type)
        {
        case HairType.GachiGachi: image.GetComponent <Image>().sprite = gachigachiUp; break;

        case HairType.SaraSara: image.GetComponent <Image>().sprite = sarasaraUp; break;

        case HairType.MojaMoja: image.GetComponent <Image>().sprite = mojamojaUp; break;
        }

        image.gameObject.SetActive(true);
        image.MovePositionOnAnchor(Vector2.up * 3);
        image.MovePosition(showCurve, Vector2.zero, 0.3f, () =>
        {
            image.MovePosition(null, Vector2.zero, 0.3f, () =>
            {
                image.gameObject.SetActive(false);
            });
        });
        image.UpdateAlpha(0, 1f, 0.15f);
    }
    public HairSetCollection.HairSetEntry[] GetListByType(HairType hairType)
    {
        switch (hairType)
        {
        case HairType.Head:
            return(this.Head);

        case HairType.Eyebrow:
            return(this.Eyebrow);

        case HairType.Facial:
            return(this.Facial);

        case HairType.Armpit:
            return(this.Armpit);

        case HairType.Pubic:
            return(this.Pubic);

        default:
            return((HairSetCollection.HairSetEntry[])null);
        }
    }
Esempio n. 17
0
    public HairSetEntry[] GetListByType(HairType hairType)
    {
        switch (hairType)
        {
        case HairType.Head:
            return(Head);

        case HairType.Eyebrow:
            return(Eyebrow);

        case HairType.Facial:
            return(Facial);

        case HairType.Armpit:
            return(Armpit);

        case HairType.Pubic:
            return(Pubic);

        default:
            return(null);
        }
    }
        protected internal override string DoTransformation(Creature target, out bool isBadEnd)
        {
            isBadEnd = false;

            //by default, this is 2 rolls at 50%, so a 25% chance of 0 additional tfs, 50% chance of 1 additional tf, 25% chance of 2 additional tfs.
            //also takes into consideration any perks that increase or decrease tf effectiveness. if you need to roll out your own, feel free to do so.
            int changeCount      = GenerateChangeCount(target, new int[] { 2, 2, 4 });
            int remainingChanges = changeCount;

            StringBuilder sb = new StringBuilder();

            //For all of these, any text regarding the transformation should be instead abstracted out as an abstract string function. append the result of this abstract function
            //to the string builder declared above (aka sb.Append(FunctionCall(variables));) string builder is just a fancy way of telling the compiler that you'll be creating a
            //long string, piece by piece, so don't do any crazy optimizations first.

            //the initial text for starting the transformation. feel free to add additional variables to this if needed.
            sb.Append(InitialTransformationText(target));

            //Add any free changes here - these can occur even if the change count is 0. these include things such as change in stats (intelligence, etc)
            //change in height, hips, and/or butt, or other similar stats.

            //this will handle the edge case where the change count starts out as 0.
            if (remainingChanges <= 0)
            {
                return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
            }

            //Any transformation related changes go here. these typically cost 1 change. these can be anything from body parts to gender (which technically also changes body parts,
            //but w/e). You are required to make sure you return as soon as you've applied changeCount changes, but a single line of code can be applied at the end of a change to do
            //this for you.

            //paste this line after any tf is applied, and it will: automatically decrement the remaining changes count. if it becomes 0 or less, apply the total number of changes
            //underwent to the target's change count (if applicable) and then return the StringBuilder content.
            //if (--remainingChanges <= 0) return ApplyChangesAndReturn(target, sb, changeCount - remainingChanges);

#warning fix me
            int ngPlus(int value) => value;


            //+3 spe if less than 50
            if (target.speed < ngPlus(50))
            {
                target.IncreaseSpeed(3);
            }
            //+2 spe if less than 75
            else if (target.speed < ngPlus(75))
            {
                target.IncreaseSpeed(2);
            }
            //+1 if above 75.
            else
            {
                target.IncreaseSpeed();
            }

            // ------------- Sexual changes -------------
            //-Nipples reduction to 1 per tit.
            if (target.genitals.hasQuadNipples && Utils.Rand(4) == 0)
            {
                target.genitals.SetQuadNipples(false);

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            //-Remove extra breast rows
            if (target.breasts.Count > 1 && Utils.Rand(3) == 0 && !hyperHappy)
            {
                target.RemoveExtraBreastRows();
            }

            //-Butt > 5 - decrease butt size
            if (target.butt.size > 5 && Utils.Rand(4) == 0)
            {
                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }

                target.butt.ShrinkButt();
            }

            if (target.gender.HasFlag(Gender.FEMALE))
            {
                //Breasts > D cup - Decrease breast size by up to 3 cups
                //Breasts < B cup - Increase breast size by 1 cup
                if (target.breasts.Any(x => x.cupSize > CupSize.D || x.cupSize < CupSize.B) && Utils.Rand(3) == 0)
                {
                    foreach (Breasts breast in target.breasts)
                    {
                        if (breast.cupSize > CupSize.D)
                        {
                            breast.ShrinkBreasts((byte)(1 + Utils.Rand(3)));
                        }
                        else if (breast.cupSize < CupSize.B)
                        {
                            breast.GrowBreasts();
                        }
                    }

                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                //Hips > 12 - decrease hip size by 1-3 sizes
                if (target.hips.size > 12 && Utils.Rand(3) == 0)
                {
                    target.hips.ShrinkHips((byte)(1 + Utils.Rand(3)));

                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                //Hips < 6 - increase hip size by 1-3 sizes
                if (target.hips.size < 6 && Utils.Rand(3) == 0)
                {
                    target.hips.GrowHips((byte)(1 + Utils.Rand(3)));
                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                if (target.genitals.nippleLength > 1 && Utils.Rand(3) == 0)
                {
                    target.genitals.SetNippleLength(target.genitals.nippleLength / 2);
                }

                if (target.hasVagina && target.vaginas[0].wetness < VaginalWetness.SLICK && Utils.Rand(4) == 0)
                {
                    target.vaginas[0].IncreaseWetness();
                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                //Increase tone (up to 65)
                if (target.build.muscleTone < 65 && Utils.Rand(3) == 0)
                {
                }

                //Decrease thickness (down to 35)
                if (target.build.thickness > 35 && Utils.Rand(3) == 0)
                {
                }
            }

            if (target.gender == Gender.MALE)
            {
                //Breasts > B cup (or applicable male max size if it's somehow > B cup) - decrease by 1 cup size
                CupSize targetSize = EnumHelper.Max(target.genitals.smallestPossibleMaleCupSize, CupSize.B);
                if (target.genitals.BiggestCupSize() > targetSize && Utils.Rand(3) == 0)
                {
                    foreach (Breasts breast in target.breasts)
                    {
                        if (breast.cupSize > targetSize)
                        {
                            breast.ShrinkBreasts();
                        }
                    }

                    target.IncreaseSpeed();

                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                if (target.genitals.nippleLength > 1 && Utils.Rand(3) == 0)
                {
                    target.genitals.SetNippleLength(target.genitals.nippleLength / 2);
                }

                //Hips > 10 - decrease hip size by 1-3 sizes
                if (target.hips.size > 10 && Utils.Rand(3) == 0)
                {
                    target.hips.ShrinkHips((byte)(1 + Utils.Rand(3)));
                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                //Hips < 2 - increase hip size by 1-3 sizes
                if (target.hips.size < 2 && Utils.Rand(3) == 0)
                {
                    target.hips.GrowHips((byte)(1 + Utils.Rand(3)));
                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                //Increase tone (up to 70)
                if (target.build.muscleTone < 70 && Utils.Rand(3) == 0)
                {
                }

                //Decrease thickness (down to 35)
                if (target.build.thickness > 35 && Utils.Rand(3) == 0)
                {
                }
            }

            if (target.gender.HasFlag(Gender.MALE))
            {
                //C**k -> Red Panda C**k
                if (target.hasCock && target.cocks[0].type != CockType.RED_PANDA && Utils.Rand(3) == 0)
                {
                    target.genitals.UpdateCock(0, CockType.RED_PANDA);
                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                C**k shortest = target.genitals.ShortestCock();

                //C**k < 6 inches - increase by 1-2 inches
                if (shortest.length < 6 && Utils.Rand(3) == 0)
                {
                    double increment = shortest.IncreaseLength(1 + Utils.Rand(2));
                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                C**k longest = target.genitals.LongestCock();

                //Shrink oversized cocks
                if (longest.length > 16 && Utils.Rand(3) == 0)
                {
                    longest.DecreaseLength((Utils.Rand(10) + 5) / 10);
                    if (longest.girth > 3)
                    {
                        longest.DecreaseThickness((Utils.Rand(4) + 1) / 10);
                    }
                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }

                C**k smallestArea = target.genitals.SmallestCockByArea();

                //C**k thickness <2 - Increase c**k thickness
                if (smallestArea.area < 10 && Utils.Rand(3) == 0)
                {
                    smallestArea.IncreaseThickness(1.5);
                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }
            }

            //Remove additional cocks
            if (target.cocks.Count > 1 && Utils.Rand(3) == 0)
            {
                //what a dick. removes the second, and only the second. not the last one or anything. ok. it's supported now.
                target.genitals.RemoveCockAt(1, 1);

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            //Remove additional balls/remove uniball
            if (target.balls.count > 0 && Utils.Rand(3) == 0)
            {
                if (target.balls.size > 5)
                {
                    target.balls.ShrinkBalls((byte)(2 + Utils.Rand(3)));

                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }
                else if (target.balls.size > 2)
                {
                    target.balls.ShrinkBalls(1);

                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }
                else if (target.balls.count != 2)
                {
                    //removes uniball, sets count to 2.
                    target.balls.MakeStandard();

                    if (--remainingChanges <= 0)
                    {
                        return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                    }
                }
            }

            //Ovi perk loss
            if (target.womb.canRemoveOviposition && Utils.Rand(5) == 0)
            {
                target.womb.ClearOviposition();
                //if (--remainingChanges <= 0) return ApplyChangesAndReturn(target, sb, changeCount - remainingChanges);
            }

            // ------------- Physical changes -------------
            // Ears
            if (target.ears.type != EarType.RED_PANDA && Utils.Rand(3) == 0)
            {
                EarData oldData = target.ears.AsReadOnlyData();
                target.UpdateEars(EarType.RED_PANDA);
                sb.Append(UpdateEarsText(target, oldData));

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            // Remove non-cockatrice antennae
            if (target.antennae.type != AntennaeType.COCKATRICE && !target.antennae.isDefault && Utils.Rand(3) == 0)
            {
                AntennaeData oldData = target.antennae.AsReadOnlyData();
                target.RestoreAntennae();
                sb.Append(RestoredAntennaeText(target, oldData));
                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            // Restore eyes, if more than two
            if (target.eyes.count > 2 && Utils.Rand(4) == 0)
            {
                EyeData oldData = target.eyes.AsReadOnlyData();
                target.RestoreEyes();
                sb.Append(RestoredEyesText(target, oldData));

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            // Hair
            // store current states first
            bool     hasPandaHairColor = Species.RED_PANDA.availableHairColors.Contains(target.hair.hairColor);
            bool     hasNormalHair     = target.hair.type == HairType.NORMAL;
            HairType oldHairType       = target.hair.type;

            if ((!hasNormalHair || target.hair.length == 0 || !hasPandaHairColor) && Utils.Rand(3) == 0)
            {
                target.UpdateHair(HairType.NORMAL);
                if (!hasPandaHairColor)
                {
                    target.hair.SetHairColor(Utils.RandomChoice(Species.RED_PANDA.availableHairColors));
                }

                if (target.hair.length == 0)
                {                 // target is bald
                    target.hair.SetHairLength(1);
                }

                target.hair.SetHairGrowthStatus(true);

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            // Face
            if (target.face.type != FaceType.RED_PANDA && target.ears.type == EarType.RED_PANDA && target.body.IsFurBodyType() && Utils.Rand(3) == 0)
            {
                FaceData oldData = target.face.AsReadOnlyData();
                target.UpdateFace(FaceType.RED_PANDA);
                sb.Append(UpdateFaceText(target, oldData));

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            // Arms
            if (target.arms.type != ArmType.RED_PANDA && target.ears.type == EarType.RED_PANDA && target.tail.type == TailType.RED_PANDA && Utils.Rand(3) == 0)
            {
                ArmData oldData = target.arms.AsReadOnlyData();
                target.UpdateArms(ArmType.RED_PANDA);
                sb.Append(UpdateArmsText(target, oldData));

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            // Legs
            if (target.lowerBody.type != LowerBodyType.RED_PANDA && target.arms.type == ArmType.RED_PANDA && Utils.Rand(4) == 0)
            {
                LowerBodyData oldData = target.lowerBody.AsReadOnlyData();
                target.UpdateLowerBody(LowerBodyType.RED_PANDA);
                sb.Append(UpdateLowerBodyText(target, oldData));

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            // Tail
            if (target.tail.type != TailType.RED_PANDA && Utils.Rand(4) == 0)
            {
                TailData oldData = target.tail.AsReadOnlyData();
                target.UpdateTail(TailType.RED_PANDA);
                sb.Append(UpdateTailText(target, oldData));

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            // SKin


            // Fix the underBody, if the skin is already furred
            if (target.body.type == BodyType.SIMPLE_FUR && Utils.Rand(3) == 0)
            {
                BodyData oldData = target.body.AsReadOnlyData();
                target.UpdateBody(BodyType.UNDERBODY_FUR, new FurColor(HairFurColors.RUSSET), new FurColor(HairFurColors.BLACK));
                sb.Append(UpdateBodyText(target, oldData));

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            else if (!target.body.IsFurBodyType() && target.arms.type == ArmType.RED_PANDA && target.lowerBody.type == LowerBodyType.RED_PANDA && Utils.Rand(4) == 0)
            {
                BodyData oldData = target.body.AsReadOnlyData();
                target.UpdateBody(BodyType.UNDERBODY_FUR, new FurColor(HairFurColors.RUSSET), new FurColor(HairFurColors.BLACK));
                sb.Append(UpdateBodyText(target, oldData));

                if (--remainingChanges <= 0)
                {
                    return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
                }
            }

            //FAILSAFE CHANGE
            if (remainingChanges == changeCount)
            {
                if (Utils.Rand(100) == 0)
                {
                }
                else
                {
                    if (target is CombatCreature)
                    {
                        ((CombatCreature)target).AddHP(250);
                    }

                    target.ChangeLust(3);
                }
            }


            //this is the fallthrough that occurs when a tf item goes through all the changes, but does not proc enough of them to exit early. it will apply however many changes
            //occurred, then return the contents of the stringbuilder.
            return(ApplyChangesAndReturn(target, sb, changeCount - remainingChanges));
        }
Esempio n. 19
0
 public static int LoadHair(HairType type)
 {
     return(PlayerPrefs.GetInt(type.ToString(), 0));
 }
Esempio n. 20
0
 public Builder withHairType(HairType hairType)
 {
     this.hairType = hairType;
     return(this);
 }
    public float charInformation;     // this determines how much you have spied of them, unlocking more knowledge and info about them. It increases with relationship or spies. 0 to 100



    public NPCData(int charid, int charportrait, string charname, string charnickname, string charsurname, CharSex charsex, int corruptionstage, int slavestage, CharGender chargender, CharAge charage, CityFaction cityfaction,

                   bool isrecruited, bool isenemy, bool ismonster, bool isneutral, bool isprisoner, bool isslave, bool isbroken, float chargold, float charvalue, bool isfurry, bool isfuta, float attphysical, float attmental, float attsocial,
                   float attmagicpower, float attbeauty, float atttemperament, float attwillpower, float attnature, float attopenness, float attdignity, float attobedience, float atthappiness, float attlibido, float attmorality,
                   float attpiety, float attstyle, CharRank charrank, CharPersonality charpersonality, CharFetish charfetish, CharClass charclass, Jobs cityposition, float coremartial, float coresecurity,
                   float corelabor, float coretactics, float coregovernance, float corestewardship, float corepersuasion, float coreintrigue, float corediplomacy, float utilitycraft, float utilityhouse,
                   float utilityfarm, float utilitymedicine, float utilityalchemy, float utilitylearning, float utilityperformance, float utilityetiquette, float utilitystreetwise, float sexmasseuse,
                   float sexstripping, float sexbondage, float sexpetplay, float sexpetting, float sexgroupsex, float sexdemonstration, float sexwhoring, float sexescorting, BgAdulthood bgadult, BgChildhood bgchild,
                   string[] bgstory, BgUpgring bgupbring, float charloy, float charlove, float charcorruption, float charrelation, float[] charaddictions, int charcd, CharRace charrace, HeadType headtype, CharFurColor charfurcolor, CharFeatherColor charfeathercolor,
                   CharSkinColor charskincolor, CharSkinType charskintype, DickType dicktype, LowerBack lowerback, ShoulderBlades shoulderblades, ArmsType armstype, LegsType legstype, BeardStyle beardstyle, BeardLength beardlength, HeadAccesory1 headacc1, HeadAccesory2 headacc2,
                   HairColor haircolor, HairStyle hairstyle, HairType hairtype, float hairlenghtcm, HairLength hairlength, EyesType eyestype, EyesColor eyescolor, bool hasfur, bool hasfeathers, bool hasscales, bool hastentacles, bool isflying,
                   GenderBehavior genderbehavior, float genderbehstat, FacialFeatures facialfeatures, float facialfeatstat, BodyFeatures bodyfeatures, float bodyfeatstat, float heigthchar, HeightName heigthname, BodyPhysique bodyphys,
                   float bodyphystat, BodyBuild bodybuild, float bodybuildstat, bool hasknot, bool hasvagina, bool isvirgin, bool isfertile, bool ispregnant, int pregcd, string pregtext, bool islactating, float charfertility, CharRace childrace,
                   float lactationml, int dicknum, DickSize dicksize, float dicksizecm, TesticleSize testiclesize, float testiclesizecm, float clitorissize, int breastrow, float breast1size, float breast2size, BreastName breast1name,
                   BreastName breast2name, BreastCup breast1cup, BreastCup breast2cup, float areola1size, float areola2size, VagLoose vagloose, float vaglooseness, AssName assname, float asssize, HipsName hipsname, float hipssize, WaistName waistname,
                   float waistsize, float maxhealth, float currenthealth, float maxarousal, float currentarousal, float maxmp, float currentmp,
                   /*int[] charequip,*/ float charreputation, float politicalpower, float charinfo


                   )
    {
        isMarried   = new List <NPCFamily> ();
        isParent    = new List <NPCFamily> ();
        isProgeny   = new List <NPCFamily>();      // list of its two parents
        charTraits  = new List <CharTraits>();
        charAttacks = new List <CharAttacks> ();
        charTitles  = new List <Titles> ();
        charID      = charid;

        charPortraitLayer0 = charportrait;
        charName           = charname;
        charNickname       = charnickname;
        charSurname        = charsurname;
        charSex            = charsex;
        corruptionStage    = corruptionstage;
        slaveStage         = slavestage;
        charGender         = chargender;
        charAge            = charage;
        cityFaction        = cityfaction;
        isRecruited        = isrecruited;
        isEnemy            = isenemy;
        isMonster          = ismonster;
        isNeutral          = isneutral;
        isPrisoner         = isprisoner;
        isSlave            = isslave;
        isBroken           = isbroken;
        charGold           = chargold;
        charValue          = charvalue;
        isFurry            = isfurry;
        isFuta             = isfuta;

        attPhysical     = attphysical;
        attMental       = attmental;
        attSocial       = attsocial;
        attMagicPower   = attmagicpower;
        attBeauty       = attbeauty;
        attTemperament  = atttemperament;
        attWillpower    = attwillpower;
        attNature       = attnature;
        attOpenness     = attopenness;
        attDignity      = attdignity;
        attObedience    = attobedience;
        attHappiness    = atthappiness;
        attLibido       = attlibido;
        attMorality     = attmorality;
        attPiety        = attpiety;
        attStyle        = attstyle;
        charRank        = charrank;
        charPersonality = charpersonality;
        charFetish      = charfetish;
        charClass       = charclass;
        cityJobs        = cityposition;

        coreSkillMartial     = coremartial;     //0
        coreSkillSecurity    = coresecurity;
        coreSkillLabor       = corelabor;
        coreSkillTactics     = coretactics;
        coreSkillGovernance  = coregovernance;
        coreSkillStewardship = corestewardship;
        coreSkillPersuasion  = corepersuasion;
        coreSkillIntrigue    = coreintrigue;
        coreSkillDiplomacy   = corediplomacy;       //8


        utilitySkillCrafting     = utilitycraft;
        utilitySkillHouseKeeping = utilityhouse;
        utilitySkillFarmHand     = utilityfarm;
        utilitySkillMedicine     = utilitymedicine;
        utilitySkillAlchemy      = utilityalchemy;
        utilitySkillLearning     = utilitylearning;
        utilitySkillPerformance  = utilityperformance;
        utilitySkillEtiquette    = utilityetiquette;
        utilitySkillStreetwise   = utilitystreetwise;


        sexSkillMasseuse    = sexmasseuse;
        sexSkillStripping   = sexstripping;
        sexSkillBondage     = sexbondage;
        sexSkillPetplay     = sexpetplay;
        sexSkillPetting     = sexpetting;
        sexSkillGroupSex    = sexgroupsex;
        sexSkillPenetration = sexdemonstration;
        sexSkillWhoring     = sexwhoring;
        sexSkillEscorting   = sexescorting;

        bgAdulthood = bgadult;
        bgChildhood = bgchild;
        bgStory     = bgstory;       // childhood, young adulthood, current
        bgUpbring   = bgupbring;

        charLoyalty      = charloy;
        charLove         = charlove; // how much it loves the MC
        charCorruption   = charcorruption;
        charRelationship = charrelation;

        charAddictions = charaddictions;         // alcohol, tobacco, opium, coke, shrooms, hero, s***n

        charCD = charcd;

        charRace = charrace;
        headType = headtype;
        //tailType = tailtype;
        charFurColor     = charfurcolor;
        charFeatherColor = charfeathercolor;
        charSkinColor    = charskincolor;
        charSkinType     = charskintype;

        dickType       = dicktype;
        lowerBack      = lowerback;
        shoulderBlades = shoulderblades;
        armsType       = armstype;
        legsType       = legstype;
        beardStyle     = beardstyle;
        beardLength    = beardlength;
        headAccesory1  = headacc1;
        headAccesory2  = headacc2;

        hairColor    = haircolor;
        hairStyle    = hairstyle;
        hairType     = hairtype;
        hairLengthCM = hairlenghtcm;
        hairLength   = hairlength;
        eyesType     = eyestype;
        eyesColor    = eyescolor;

        hasFur       = hasfur;
        hasFeathers  = hasfeathers;
        hasScales    = hasscales;
        hasTentacles = hastentacles;
        isFlying     = isflying;

        genderBehavior     = genderbehavior;
        genderBehaviorStat = genderbehstat;         // this is what sets the above, this can make a char more feminine or masculine after certain point

        facialFeatures     = facialfeatures;
        facialFeaturesStat = facialfeatstat;

        bodyFeatures     = bodyfeatures;
        bodyFeaturesStat = bodyfeatstat;

        heightChar = heigthchar;         // in cm
        heightName = heigthname;

        bodyPhysique = bodyphys;
        bodyPhysStat = bodyphystat;         // to change it

        bodyBuild     = bodybuild;
        bodyBuildStat = bodybuildstat;         // to change it

        hasKnot       = hasknot;
        hasVagina     = hasvagina;
        isVirgin      = isvirgin;
        isFertile     = isfertile;
        isPregnant    = ispregnant;
        pregnantCD    = pregcd;      // turns until giving birth
        pregnantText  = pregtext;    //
        charFertility = charfertility;
        isLactating   = islactating;
        lactationML   = lactationml;       // how much it lactates in ml
        childRace     = childrace;

        dickNum    = dicknum;          //how many dicks it has
        dickSize   = dicksize;
        dickSizeCM = dicksizecm;       // in cm

        testiclesSize  = testiclesize; // in cm, used to determine if you have or not
        testicleSizeCM = testiclesizecm;

        clitorisSize = clitorissize;       // in cm

        areola1Size = areola1size;         // aerola size of the first row, 1 change, in cm
        areola2Size = areola2size;         // aerola size of the first row, 1 change, in cm

        breastRow   = breastrow;
        breast1Size = breast1size;
        breast2Size = breast2size;

        breast1Name = breast1name;
        breast2Name = breast2name;

        breast1Cup = breast1cup;
        breast2Cup = breast2cup;

        vagLooseness = vaglooseness;         // 0 virgin, 1-5 etc

        assName = assname;
        assSize = asssize;

        hipsName = hipsname;
        hipsSize = hipssize;

        waistName = waistname;
        waistSize = waistsize;

        maxHealth     = maxhealth;
        currentHealth = currenthealth;

        maxArousal     = maxarousal;
        currentArousal = currentarousal;

        maxMP     = maxmp;
        currentMP = currentmp;


        charReputation = charreputation;
        politicalPower = politicalpower;

        charInformation = charinfo;

        vagloose = vagLoose;
    }
Esempio n. 22
0
 public HairState(HairType hair)
 {
     this.hair = hair;
 }
Esempio n. 23
0
 public Hair(HairType type)
 {
     this.type = type;
 }
Esempio n. 24
0
 public void setType(HairType type)
 {
     this.type = type;
 }
Esempio n. 25
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model", false, out subEle))
            {
                if (Model == null)
                {
                    Model = new Model();
                }

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("BaseStats", false, out subEle))
            {
                if (BaseStats == null)
                {
                    BaseStats = new NPCBaseStats();
                }

                BaseStats.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Factions", false, out subEle))
            {
                if (Factions == null)
                {
                    Factions = new List <FactionMembership>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    FactionMembership tempSNAM = new FactionMembership();
                    tempSNAM.ReadXML(e, master);
                    Factions.Add(tempSNAM);
                }
            }
            if (ele.TryPathTo("DeathItem", false, out subEle))
            {
                if (DeathItem == null)
                {
                    DeathItem = new RecordReference();
                }

                DeathItem.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("VoiceType", false, out subEle))
            {
                if (VoiceType == null)
                {
                    VoiceType = new RecordReference();
                }

                VoiceType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Template", false, out subEle))
            {
                if (Template == null)
                {
                    Template = new RecordReference();
                }

                Template.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Race", false, out subEle))
            {
                if (Race == null)
                {
                    Race = new RecordReference();
                }

                Race.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ActorEffects", false, out subEle))
            {
                if (ActorEffects == null)
                {
                    ActorEffects = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempSPLO = new RecordReference();
                    tempSPLO.ReadXML(e, master);
                    ActorEffects.Add(tempSPLO);
                }
            }
            if (ele.TryPathTo("Unarmed/AttackEffect", false, out subEle))
            {
                if (UnarmedAttackEffect == null)
                {
                    UnarmedAttackEffect = new RecordReference();
                }

                UnarmedAttackEffect.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unarmed/AttackAnimation", false, out subEle))
            {
                if (UnarmedAttackAnimation == null)
                {
                    UnarmedAttackAnimation = new SimpleSubrecord <UInt16>();
                }

                UnarmedAttackAnimation.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Destructable", false, out subEle))
            {
                if (Destructable == null)
                {
                    Destructable = new Destructable();
                }

                Destructable.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new RecordReference();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Contents", false, out subEle))
            {
                if (Contents == null)
                {
                    Contents = new List <InventoryItem>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    InventoryItem tempCNTO = new InventoryItem();
                    tempCNTO.ReadXML(e, master);
                    Contents.Add(tempCNTO);
                }
            }
            if (ele.TryPathTo("AIData", false, out subEle))
            {
                if (AIData == null)
                {
                    AIData = new AIData();
                }

                AIData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Packages", false, out subEle))
            {
                if (Packages == null)
                {
                    Packages = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempPKID = new RecordReference();
                    tempPKID.ReadXML(e, master);
                    Packages.Add(tempPKID);
                }
            }
            if (ele.TryPathTo("Class", false, out subEle))
            {
                if (Class == null)
                {
                    Class = new RecordReference();
                }

                Class.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new NPCData();
                }

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Skills", false, out subEle))
            {
                if (Skills == null)
                {
                    Skills = new NPCSkills();
                }

                Skills.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("HeadParts", false, out subEle))
            {
                if (HeadParts == null)
                {
                    HeadParts = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempPNAM = new RecordReference();
                    tempPNAM.ReadXML(e, master);
                    HeadParts.Add(tempPNAM);
                }
            }
            if (ele.TryPathTo("Hair/Type", false, out subEle))
            {
                if (HairType == null)
                {
                    HairType = new RecordReference();
                }

                HairType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Hair/Length", false, out subEle))
            {
                if (HairLength == null)
                {
                    HairLength = new SimpleSubrecord <Single>();
                }

                HairLength.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Eyes", false, out subEle))
            {
                if (Eyes == null)
                {
                    Eyes = new RecordReference();
                }

                Eyes.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Hair/Color", false, out subEle))
            {
                if (HairColor == null)
                {
                    HairColor = new SimpleSubrecord <Color>();
                }

                HairColor.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("CombatStyle", false, out subEle))
            {
                if (CombatStyle == null)
                {
                    CombatStyle = new RecordReference();
                }

                CombatStyle.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ImpactMaterialType", false, out subEle))
            {
                if (ImpactMaterialType == null)
                {
                    ImpactMaterialType = new SimpleSubrecord <MaterialTypeUInt>();
                }

                ImpactMaterialType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Geometry/Symmetric", false, out subEle))
            {
                if (FaceGenGeometrySymmetric == null)
                {
                    FaceGenGeometrySymmetric = new SimpleSubrecord <Byte[]>();
                }

                FaceGenGeometrySymmetric.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Geometry/Asymmetric", false, out subEle))
            {
                if (FaceGenGeometryAsymmetric == null)
                {
                    FaceGenGeometryAsymmetric = new SimpleSubrecord <Byte[]>();
                }

                FaceGenGeometryAsymmetric.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Texture", false, out subEle))
            {
                if (FaceGenTexture == null)
                {
                    FaceGenTexture = new SimpleSubrecord <Byte[]>();
                }

                FaceGenTexture.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown", false, out subEle))
            {
                if (Unknown == null)
                {
                    Unknown = new SimpleSubrecord <UInt16>();
                }

                Unknown.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Height", false, out subEle))
            {
                if (Height == null)
                {
                    Height = new SimpleSubrecord <Single>();
                }

                Height.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Weight", false, out subEle))
            {
                if (Weight == null)
                {
                    Weight = new SimpleSubrecord <Single>();
                }

                Weight.ReadXML(subEle, master);
            }
        }
 public HairSetCollection.HairSetEntry Get(HairType hairType, float typeNum)
 {
     HairSetCollection.HairSetEntry[] listByType = this.GetListByType(hairType);
     return(listByType[this.GetIndex(listByType, typeNum)]);
 }
Esempio n. 27
0
 public int GetIndex(HairType hairType, float typeNum)
 {
     HairSetEntry[] listByType = GetListByType(hairType);
     return(GetIndex(listByType, typeNum));
 }
Esempio n. 28
0
 public void addPerson(String birthName, int birthYear, HairType typeOfHair)
 {
     this.addPerson(new Person(birthName, birthYear, typeOfHair));
 }
Esempio n. 29
0
 public static void SaveHair(HairType type, int count)
 {
     PlayerPrefs.SetInt(type.ToString(), count);
 }
Esempio n. 30
0
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (ObjectBounds != null)
            {
                ele.TryPathTo("ObjectBounds", true, out subEle);
                ObjectBounds.WriteXML(subEle, master);
            }
            if (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (Model != null)
            {
                ele.TryPathTo("Model", true, out subEle);
                Model.WriteXML(subEle, master);
            }
            if (BaseStats != null)
            {
                ele.TryPathTo("BaseStats", true, out subEle);
                BaseStats.WriteXML(subEle, master);
            }
            if (Factions != null)
            {
                ele.TryPathTo("Factions", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Faction"
                };
                int i = 0;
                Factions.Sort();
                foreach (var entry in Factions)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (DeathItem != null)
            {
                ele.TryPathTo("DeathItem", true, out subEle);
                DeathItem.WriteXML(subEle, master);
            }
            if (VoiceType != null)
            {
                ele.TryPathTo("VoiceType", true, out subEle);
                VoiceType.WriteXML(subEle, master);
            }
            if (Template != null)
            {
                ele.TryPathTo("Template", true, out subEle);
                Template.WriteXML(subEle, master);
            }
            if (Race != null)
            {
                ele.TryPathTo("Race", true, out subEle);
                Race.WriteXML(subEle, master);
            }
            if (ActorEffects != null)
            {
                ele.TryPathTo("ActorEffects", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "ActorEffect"
                };
                int i = 0;
                ActorEffects.Sort();
                foreach (var entry in ActorEffects)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (UnarmedAttackEffect != null)
            {
                ele.TryPathTo("Unarmed/AttackEffect", true, out subEle);
                UnarmedAttackEffect.WriteXML(subEle, master);
            }
            if (UnarmedAttackAnimation != null)
            {
                ele.TryPathTo("Unarmed/AttackAnimation", true, out subEle);
                UnarmedAttackAnimation.WriteXML(subEle, master);
            }
            if (Destructable != null)
            {
                ele.TryPathTo("Destructable", true, out subEle);
                Destructable.WriteXML(subEle, master);
            }
            if (Script != null)
            {
                ele.TryPathTo("Script", true, out subEle);
                Script.WriteXML(subEle, master);
            }
            if (Contents != null)
            {
                ele.TryPathTo("Contents", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Item"
                };
                int i = 0;
                Contents.Sort();
                foreach (var entry in Contents)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (AIData != null)
            {
                ele.TryPathTo("AIData", true, out subEle);
                AIData.WriteXML(subEle, master);
            }
            if (Packages != null)
            {
                ele.TryPathTo("Packages", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Package"
                };
                int i = 0;
                foreach (var entry in Packages)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (Class != null)
            {
                ele.TryPathTo("Class", true, out subEle);
                Class.WriteXML(subEle, master);
            }
            if (Data != null)
            {
                ele.TryPathTo("Data", true, out subEle);
                Data.WriteXML(subEle, master);
            }
            if (Skills != null)
            {
                ele.TryPathTo("Skills", true, out subEle);
                Skills.WriteXML(subEle, master);
            }
            if (HeadParts != null)
            {
                ele.TryPathTo("HeadParts", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "HeadPart"
                };
                int i = 0;
                HeadParts.Sort();
                foreach (var entry in HeadParts)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (HairType != null)
            {
                ele.TryPathTo("Hair/Type", true, out subEle);
                HairType.WriteXML(subEle, master);
            }
            if (HairLength != null)
            {
                ele.TryPathTo("Hair/Length", true, out subEle);
                HairLength.WriteXML(subEle, master);
            }
            if (Eyes != null)
            {
                ele.TryPathTo("Eyes", true, out subEle);
                Eyes.WriteXML(subEle, master);
            }
            if (HairColor != null)
            {
                ele.TryPathTo("Hair/Color", true, out subEle);
                HairColor.WriteXML(subEle, master);
            }
            if (CombatStyle != null)
            {
                ele.TryPathTo("CombatStyle", true, out subEle);
                CombatStyle.WriteXML(subEle, master);
            }
            if (ImpactMaterialType != null)
            {
                ele.TryPathTo("ImpactMaterialType", true, out subEle);
                ImpactMaterialType.WriteXML(subEle, master);
            }
            if (FaceGenGeometrySymmetric != null)
            {
                ele.TryPathTo("FaceGen/Geometry/Symmetric", true, out subEle);
                FaceGenGeometrySymmetric.WriteXML(subEle, master);
            }
            if (FaceGenGeometryAsymmetric != null)
            {
                ele.TryPathTo("FaceGen/Geometry/Asymmetric", true, out subEle);
                FaceGenGeometryAsymmetric.WriteXML(subEle, master);
            }
            if (FaceGenTexture != null)
            {
                ele.TryPathTo("FaceGen/Texture", true, out subEle);
                FaceGenTexture.WriteXML(subEle, master);
            }
            if (Unknown != null)
            {
                ele.TryPathTo("Unknown", true, out subEle);
                Unknown.WriteXML(subEle, master);
            }
            if (Height != null)
            {
                ele.TryPathTo("Height", true, out subEle);
                Height.WriteXML(subEle, master);
            }
            if (Weight != null)
            {
                ele.TryPathTo("Weight", true, out subEle);
                Weight.WriteXML(subEle, master);
            }
        }
Esempio n. 31
0
 public HairSetEntry Get(HairType hairType, float typeNum)
 {
     HairSetEntry[] listByType = GetListByType(hairType);
     return(listByType[GetIndex(listByType, typeNum)]);
 }
 public int GetIndex(HairType hairType, float typeNum)
 {
     return(this.GetIndex(this.GetListByType(hairType), typeNum));
 }
Esempio n. 33
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "OBND":
                    if (ObjectBounds == null)
                    {
                        ObjectBounds = new ObjectBounds();
                    }

                    ObjectBounds.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "MODL":
                    if (Model == null)
                    {
                        Model = new Model();
                    }

                    Model.ReadBinary(reader);
                    break;

                case "ACBS":
                    if (BaseStats == null)
                    {
                        BaseStats = new NPCBaseStats();
                    }

                    BaseStats.ReadBinary(reader);
                    break;

                case "SNAM":
                    if (Factions == null)
                    {
                        Factions = new List <FactionMembership>();
                    }

                    FactionMembership tempSNAM = new FactionMembership();
                    tempSNAM.ReadBinary(reader);
                    Factions.Add(tempSNAM);
                    break;

                case "INAM":
                    if (DeathItem == null)
                    {
                        DeathItem = new RecordReference();
                    }

                    DeathItem.ReadBinary(reader);
                    break;

                case "VTCK":
                    if (VoiceType == null)
                    {
                        VoiceType = new RecordReference();
                    }

                    VoiceType.ReadBinary(reader);
                    break;

                case "TPLT":
                    if (Template == null)
                    {
                        Template = new RecordReference();
                    }

                    Template.ReadBinary(reader);
                    break;

                case "RNAM":
                    if (Race == null)
                    {
                        Race = new RecordReference();
                    }

                    Race.ReadBinary(reader);
                    break;

                case "SPLO":
                    if (ActorEffects == null)
                    {
                        ActorEffects = new List <RecordReference>();
                    }

                    RecordReference tempSPLO = new RecordReference();
                    tempSPLO.ReadBinary(reader);
                    ActorEffects.Add(tempSPLO);
                    break;

                case "EITM":
                    if (UnarmedAttackEffect == null)
                    {
                        UnarmedAttackEffect = new RecordReference();
                    }

                    UnarmedAttackEffect.ReadBinary(reader);
                    break;

                case "EAMT":
                    if (UnarmedAttackAnimation == null)
                    {
                        UnarmedAttackAnimation = new SimpleSubrecord <UInt16>();
                    }

                    UnarmedAttackAnimation.ReadBinary(reader);
                    break;

                case "DEST":
                    if (Destructable == null)
                    {
                        Destructable = new Destructable();
                    }

                    Destructable.ReadBinary(reader);
                    break;

                case "SCRI":
                    if (Script == null)
                    {
                        Script = new RecordReference();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "CNTO":
                    if (Contents == null)
                    {
                        Contents = new List <InventoryItem>();
                    }

                    InventoryItem tempCNTO = new InventoryItem();
                    tempCNTO.ReadBinary(reader);
                    Contents.Add(tempCNTO);
                    break;

                case "AIDT":
                    if (AIData == null)
                    {
                        AIData = new AIData();
                    }

                    AIData.ReadBinary(reader);
                    break;

                case "PKID":
                    if (Packages == null)
                    {
                        Packages = new List <RecordReference>();
                    }

                    RecordReference tempPKID = new RecordReference();
                    tempPKID.ReadBinary(reader);
                    Packages.Add(tempPKID);
                    break;

                case "CNAM":
                    if (Class == null)
                    {
                        Class = new RecordReference();
                    }

                    Class.ReadBinary(reader);
                    break;

                case "DATA":
                    if (Data == null)
                    {
                        Data = new NPCData();
                    }

                    Data.ReadBinary(reader);
                    break;

                case "DNAM":
                    if (Skills == null)
                    {
                        Skills = new NPCSkills();
                    }

                    Skills.ReadBinary(reader);
                    break;

                case "PNAM":
                    if (HeadParts == null)
                    {
                        HeadParts = new List <RecordReference>();
                    }

                    RecordReference tempPNAM = new RecordReference();
                    tempPNAM.ReadBinary(reader);
                    HeadParts.Add(tempPNAM);
                    break;

                case "HNAM":
                    if (HairType == null)
                    {
                        HairType = new RecordReference();
                    }

                    HairType.ReadBinary(reader);
                    break;

                case "LNAM":
                    if (HairLength == null)
                    {
                        HairLength = new SimpleSubrecord <Single>();
                    }

                    HairLength.ReadBinary(reader);
                    break;

                case "ENAM":
                    if (Eyes == null)
                    {
                        Eyes = new RecordReference();
                    }

                    Eyes.ReadBinary(reader);
                    break;

                case "HCLR":
                    if (HairColor == null)
                    {
                        HairColor = new SimpleSubrecord <Color>();
                    }

                    HairColor.ReadBinary(reader);
                    break;

                case "ZNAM":
                    if (CombatStyle == null)
                    {
                        CombatStyle = new RecordReference();
                    }

                    CombatStyle.ReadBinary(reader);
                    break;

                case "NAM4":
                    if (ImpactMaterialType == null)
                    {
                        ImpactMaterialType = new SimpleSubrecord <MaterialTypeUInt>();
                    }

                    ImpactMaterialType.ReadBinary(reader);
                    break;

                case "FGGS":
                    if (FaceGenGeometrySymmetric == null)
                    {
                        FaceGenGeometrySymmetric = new SimpleSubrecord <Byte[]>();
                    }

                    FaceGenGeometrySymmetric.ReadBinary(reader);
                    break;

                case "FGGA":
                    if (FaceGenGeometryAsymmetric == null)
                    {
                        FaceGenGeometryAsymmetric = new SimpleSubrecord <Byte[]>();
                    }

                    FaceGenGeometryAsymmetric.ReadBinary(reader);
                    break;

                case "FGTS":
                    if (FaceGenTexture == null)
                    {
                        FaceGenTexture = new SimpleSubrecord <Byte[]>();
                    }

                    FaceGenTexture.ReadBinary(reader);
                    break;

                case "NAM5":
                    if (Unknown == null)
                    {
                        Unknown = new SimpleSubrecord <UInt16>();
                    }

                    Unknown.ReadBinary(reader);
                    break;

                case "NAM6":
                    if (Height == null)
                    {
                        Height = new SimpleSubrecord <Single>();
                    }

                    Height.ReadBinary(reader);
                    break;

                case "NAM7":
                    if (Weight == null)
                    {
                        Weight = new SimpleSubrecord <Single>();
                    }

                    Weight.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Esempio n. 34
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (BaseStats != null)
     {
         BaseStats.WriteBinary(writer);
     }
     if (Factions != null)
     {
         Factions.Sort();
         foreach (var item in Factions)
         {
             item.WriteBinary(writer);
         }
     }
     if (DeathItem != null)
     {
         DeathItem.WriteBinary(writer);
     }
     if (VoiceType != null)
     {
         VoiceType.WriteBinary(writer);
     }
     if (Template != null)
     {
         Template.WriteBinary(writer);
     }
     if (Race != null)
     {
         Race.WriteBinary(writer);
     }
     if (ActorEffects != null)
     {
         ActorEffects.Sort();
         foreach (var item in ActorEffects)
         {
             item.WriteBinary(writer);
         }
     }
     if (UnarmedAttackEffect != null)
     {
         UnarmedAttackEffect.WriteBinary(writer);
     }
     if (UnarmedAttackAnimation != null)
     {
         UnarmedAttackAnimation.WriteBinary(writer);
     }
     if (Destructable != null)
     {
         Destructable.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (Contents != null)
     {
         Contents.Sort();
         foreach (var item in Contents)
         {
             item.WriteBinary(writer);
         }
     }
     if (AIData != null)
     {
         AIData.WriteBinary(writer);
     }
     if (Packages != null)
     {
         foreach (var item in Packages)
         {
             item.WriteBinary(writer);
         }
     }
     if (Class != null)
     {
         Class.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
     if (Skills != null)
     {
         Skills.WriteBinary(writer);
     }
     if (HeadParts != null)
     {
         HeadParts.Sort();
         foreach (var item in HeadParts)
         {
             item.WriteBinary(writer);
         }
     }
     if (HairType != null)
     {
         HairType.WriteBinary(writer);
     }
     if (HairLength != null)
     {
         HairLength.WriteBinary(writer);
     }
     if (Eyes != null)
     {
         Eyes.WriteBinary(writer);
     }
     if (HairColor != null)
     {
         HairColor.WriteBinary(writer);
     }
     if (CombatStyle != null)
     {
         CombatStyle.WriteBinary(writer);
     }
     if (ImpactMaterialType != null)
     {
         ImpactMaterialType.WriteBinary(writer);
     }
     if (FaceGenGeometrySymmetric != null)
     {
         FaceGenGeometrySymmetric.WriteBinary(writer);
     }
     if (FaceGenGeometryAsymmetric != null)
     {
         FaceGenGeometryAsymmetric.WriteBinary(writer);
     }
     if (FaceGenTexture != null)
     {
         FaceGenTexture.WriteBinary(writer);
     }
     if (Unknown != null)
     {
         Unknown.WriteBinary(writer);
     }
     if (Height != null)
     {
         Height.WriteBinary(writer);
     }
     if (Weight != null)
     {
         Weight.WriteBinary(writer);
     }
 }