예제 #1
0
        /// <summary>
        /// Checks if the cut is big enough for the contained organs to escape.
        /// If the cut isn't big enough or has failed a chance check, apply internal damage + bleeding.
        /// </summary>
        private void Disembowel()
        {
            BodyPart randomBodyPart       = OrganList.GetRandom().GetComponent <BodyPart>();
            BodyPart randomCustomBodyPart = OptionalOrgans.GetRandom();

            if (currentCutSize >= BodyPartStorageContentsSpillOutOnCutSize)
            {
                float chance = UnityEngine.Random.Range(0.0f, 1.0f);
                if (chance >= spillChanceWhenCutPresent)
                {
                    HealthMaster.DismemberingBodyParts.Add(randomBodyPart);
                    if (randomCustomBodyPart != null)
                    {
                        HealthMaster.DismemberingBodyParts.Add(randomCustomBodyPart);
                    }
                }
                else
                {
                    randomBodyPart.ApplyInternalDamage();
                    if (randomCustomBodyPart != null)
                    {
                        randomCustomBodyPart.ApplyInternalDamage();
                    }
                }
            }
            else
            {
                randomBodyPart.ApplyInternalDamage();
                if (randomCustomBodyPart != null)
                {
                    randomCustomBodyPart.ApplyInternalDamage();
                }
            }
        }
        /// <summary>
        /// Checks if the cut is big enough for the contained organs to escape.
        /// If the cut isn't big enough or has failed a chance check, apply internal damage + bleeding.
        /// </summary>
        private void Disembowel()
        {
            BodyPart randomBodyPart       = OrganList.GetRandom().GetComponent <BodyPart>();
            BodyPart randomCustomBodyPart = OptionalOrgans.GetRandom();
            float    chance = UnityEngine.Random.Range(0.0f, 1.0f);

            if (chance >= spillChanceWhenCutPresent)
            {
                HealthMaster.DismemberBodyPart(randomBodyPart);
                if (randomCustomBodyPart != null)
                {
                    HealthMaster.DismemberBodyPart(randomCustomBodyPart);
                }
            }
            else
            {
                randomBodyPart.ApplyInternalDamage();
                if (randomCustomBodyPart != null)
                {
                    randomCustomBodyPart.ApplyInternalDamage();
                }
            }

            if (currentPierceDamageLevel >= TraumaDamageLevel.SMALL &&
                isBleedingExternally == false && IsSurface)
            {
                StartCoroutine(ExternalBleedingLogic());
            }
        }