Exemplo n.º 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>());
        }
Exemplo n.º 2
0
        public override void RemovedFromBody(LivingHealthMasterBase livingHealthMasterBase)
        {
            var dynamicItemStorage = livingHealthMasterBase.GetComponent <DynamicItemStorage>();

            if (dynamicItemStorage != null)
            {
                dynamicItemStorage.Remove(this);
            }
        }
Exemplo n.º 3
0
        public override void RemovedFromBody(LivingHealthMasterBase livingHealthMasterBase)
        {
            StartCoroutine(RelatedStorageAddRemove(false, livingHealthMasterBase));
            var dynamicItemStorage = livingHealthMasterBase.GetComponent <DynamicItemStorage>();

            if (dynamicItemStorage != null)
            {
                dynamicItemStorage.Remove(this);
            }
        }
Exemplo n.º 4
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>());
        }
Exemplo n.º 5
0
        void Awake()
        {
            healthMaster = GetComponentInParent <LivingHealthMasterBase>();
            foreach (BodyPartSprites b in GetComponentsInParent <BodyPartSprites>())
            {
                if (b.BodyPartType.Equals(BodyPartType))
                {
                    Debug.Log(b);
                }

                //TODO: Do we need to add listeners for implant removal
            }

            if (Storage == null)
            {
                Storage = GetComponent <ItemStorage>();
            }

            Storage.ServerInventoryItemSlotSet += ImplantAdded;
            //TODO Make generic version for mobs \/
            Storage.SetRegisterPlayer(healthMaster.GetComponent <RegisterPlayer>());
        }