Exemple #1
0
        /// <summary>
        /// Initializes the body part
        /// </summary>
        public virtual void HealthMasterSet()
        {
            if (BodySpriteSet == false)
            {
                //If gendered part then set the sprite limb data to it
                if (isDimorphic)
                {
                    LimbSpriteData             = new ListSpriteDataSOWithOrder();
                    LimbSpriteData.SpriteOrder = BodyTypesSprites.SpriteOrder;
                    LimbSpriteData.Sprites     = BodyTypesSprites.BodyTypes[(int)HealthMaster.BodyType].Sprites;
                }
                else
                {
                    LimbSpriteData             = new ListSpriteDataSOWithOrder();
                    LimbSpriteData.SpriteOrder = BodyTypesSprites.SpriteOrder;
                    if (BodyTypesSprites.BodyTypes.Count > 0)
                    {
                        LimbSpriteData.Sprites = BodyTypesSprites.BodyTypes[(int)BodyType.NonBinary].Sprites;
                    }
                }

                BodySpriteSet = true;
            }

            UpdateIcons();
            foreach (var bodyPartModification in BodyPartModifications)
            {
                bodyPartModification.HealthMasterSet();
            }
            //TODO Make this generic \/ for mobs
            Storage.SetRegisterPlayer(healthMaster?.GetComponent <RegisterPlayer>());
        }
Exemple #2
0
        /// <summary>
        /// Initializes the body part
        /// </summary>
        public virtual void HealthMasterSet()
        {
            if (BodySpriteSet == false)
            {
                //If gendered part then set the sprite limb data to it
                if (isDimorphic)
                {
                    LimbSpriteData             = new ListSpriteDataSOWithOrder();
                    LimbSpriteData.SpriteOrder = BodyTypesSprites.SpriteOrder;
                    LimbSpriteData.Sprites     = BodyTypesSprites.BodyTypes[(int)HealthMaster.BodyType].Sprites;
                }
                else
                {
                    LimbSpriteData             = new ListSpriteDataSOWithOrder();
                    LimbSpriteData.SpriteOrder = BodyTypesSprites.SpriteOrder;
                    if (BodyTypesSprites.BodyTypes.Count > 0)
                    {
                        LimbSpriteData.Sprites = BodyTypesSprites.BodyTypes[(int)BodyType.NonBinary].Sprites;
                    }
                }

                BodySpriteSet = true;
            }
            UpdateIcons();
            foreach (var bodyPartModification in BodyPartModifications)
            {
                bodyPartModification.HealthMasterSet();
            }
        }
Exemple #3
0
        public void SetHealthMaster(LivingHealthMasterBase livingHealth)
        {
            HealthMaster = livingHealth;
            if (livingHealth)
            {
                playerSprites = livingHealth.GetComponent <PlayerSprites>();
            }

            if (BodySpriteSet == false)
            {
                //If gendered part then set the sprite limb data to it
                if (isDimorphic)
                {
                    LimbSpriteData             = new ListSpriteDataSOWithOrder();
                    LimbSpriteData.SpriteOrder = BodyTypesSprites.SpriteOrder;
                    LimbSpriteData.Sprites     = BodyTypesSprites.BodyTypes[(int)HealthMaster.BodyType].Sprites;
                }
                else
                {
                    LimbSpriteData             = new ListSpriteDataSOWithOrder();
                    LimbSpriteData.SpriteOrder = BodyTypesSprites.SpriteOrder;
                    if (BodyTypesSprites.BodyTypes.Count > 0)
                    {
                        LimbSpriteData.Sprites = BodyTypesSprites.BodyTypes[(int)BodyType.NonBinary].Sprites;
                    }
                }

                BodySpriteSet = true;
            }


            UpdateIcons();
            SetUpSystemsThis();

            var dynamicItemStorage = HealthMaster.GetComponent <DynamicItemStorage>();

            if (dynamicItemStorage != null)
            {
                var bodyPartUISlots = GetComponent <BodyPartUISlots>();
                if (bodyPartUISlots != null)
                {
                    dynamicItemStorage.Add(bodyPartUISlots);
                }
            }


            //TODO Make this generic \/ for mobs
            OrganStorage.SetRegisterPlayer(HealthMaster?.GetComponent <RegisterPlayer>());
        }