コード例 #1
0
ファイル: CoopRagdoll.cs プロジェクト: DevZhav/The-Forest
    private void transferClientFire()
    {
        if (this.closestStoredToken == null)
        {
            return;
        }
        mutantTransferFire component = base.transform.GetComponent <mutantTransferFire>();

        if (component && component.allBones.Count > 0)
        {
            storeLocalMutantInfo2 component2 = this.closestStoredToken.transform.GetComponent <storeLocalMutantInfo2>();
            if (component2 == null || component2.fire.Count == 0)
            {
                return;
            }
            for (int i = 0; i < component2.fire.Count; i++)
            {
                if (component2.fire[i] && component2.fire[i].gameObject.activeSelf)
                {
                    component2.fire[i].parent        = component.allBones[i];
                    component2.fire[i].localPosition = component2.firePos[i];
                    component2.fire[i].localRotation = component2.fireRot[i];
                }
            }
        }
    }
コード例 #2
0
 public override void Detached()
 {
     if (BoltNetwork.isClient && Scene.MutantControler.activeNetCannibals.Contains(base.gameObject))
     {
         Scene.MutantControler.activeNetCannibals.Remove(base.gameObject);
     }
     if (this.creepy && BoltNetwork.isClient)
     {
         GameObject            gameObject = UnityEngine.Object.Instantiate <GameObject>(this.storePrefab, base.transform.position, base.transform.rotation);
         storeLocalMutantInfo2 component  = gameObject.GetComponent <storeLocalMutantInfo2>();
         Scene.SceneTracker.storedRagDollPrefabs.Add(gameObject);
         component.identifier   = this.storedRagDollName;
         component.rootRotation = this.rootTr.rotation;
         component.rootPosition = this.rootTr.position;
         mutantTransferFire component2 = base.transform.GetComponent <mutantTransferFire>();
         if (component2)
         {
             for (int i = 0; i < component2.clientFireGo.Count; i++)
             {
                 spawnParticleController component3 = component2.clientFireGo[i].GetComponent <spawnParticleController>();
                 if (component3 && component3.spawnedPrefab)
                 {
                     int value = component2.allBones.IndexOf(component2.clientFireGo[i].transform.parent);
                     component.fireIndex.Add(component3.spawnedPrefab.transform, value);
                     component.firePos.Add(component2.clientFireGo[i].transform.localPosition);
                     component.fireRot.Add(component2.clientFireGo[i].transform.localRotation);
                     component3.spawnedPrefab.SendMessage("disableFollowTarget");
                 }
             }
         }
         CoopMutantMaterialSync component4 = base.transform.GetComponent <CoopMutantMaterialSync>();
         if (component4)
         {
             component.matColor = component4.storedColor;
         }
         for (int j = 0; j < this.storedCreepyJoints.Length; j++)
         {
             component.jointAngles.Add(this.storedCreepyJoints[j].localRotation);
         }
         if (this.ast)
         {
             int num = 0;
             foreach (KeyValuePair <Transform, int> keyValuePair in this.ast.stuckArrows)
             {
                 if (keyValuePair.Key)
                 {
                     component.stuckArrowsIndex.Add(keyValuePair.Key, keyValuePair.Value);
                     component.stuckArrowPos.Add(keyValuePair.Key.localPosition);
                     component.stuckArrowRot.Add(keyValuePair.Key.localRotation);
                     if (num < this.ast.stuckArrowsTypeList.Count)
                     {
                         component.stuckArrowType.Add(this.ast.stuckArrowsTypeList[num]);
                     }
                     num++;
                 }
             }
         }
     }
 }
コード例 #3
0
    public IEnumerator generateStoredJointList()
    {
        yield return(new WaitForEndOfFrame());

        if (this.doneGenerateList)
        {
            yield break;
        }
        GameObject            store = UnityEngine.Object.Instantiate <GameObject>(this.storePrefab, base.transform.position, base.transform.rotation);
        storeLocalMutantInfo2 slmi  = store.GetComponent <storeLocalMutantInfo2>();

        slmi.identifier = this.cms.storedRagDollName;
        slmi.jointAngles.Clear();
        for (int i = 0; i < this.jointsToSync.Length; i++)
        {
            slmi.jointAngles.Add(this.jointsToSync[i].localRotation);
        }
        CoopMutantMaterialSync cmms = base.transform.parent.GetComponent <CoopMutantMaterialSync>();

        if (cmms)
        {
            slmi.matColor = cmms.storedColor;
        }
        if (this.ast)
        {
            foreach (KeyValuePair <Transform, int> keyValuePair in this.ast.stuckArrows)
            {
                if (keyValuePair.Key)
                {
                    slmi.stuckArrowsIndex.Add(keyValuePair.Key, keyValuePair.Value);
                    slmi.stuckArrowPos.Add(keyValuePair.Key.localPosition);
                    slmi.stuckArrowRot.Add(keyValuePair.Key.localRotation);
                }
            }
        }
        mutantTransferFire mtf = base.transform.parent.GetComponent <mutantTransferFire>();

        if (mtf)
        {
            for (int j = 0; j < mtf.clientFireGo.Count; j++)
            {
                spawnParticleController component = mtf.clientFireGo[j].GetComponent <spawnParticleController>();
                if (component && component.spawnedPrefab)
                {
                    int value = mtf.allBones.IndexOf(mtf.clientFireGo[j].transform.parent);
                    slmi.fireIndex.Add(component.spawnedPrefab.transform, value);
                    slmi.firePos.Add(mtf.clientFireGo[j].transform.localPosition);
                    slmi.fireRot.Add(mtf.clientFireGo[j].transform.localRotation);
                    component.spawnedPrefab.SendMessage("disableFollowTarget");
                }
            }
        }
        Scene.SceneTracker.storedRagDollPrefabs.Add(store);
        this.doneGenerateList = true;
        yield break;
    }
コード例 #4
0
ファイル: CoopAnimalFX.cs プロジェクト: DevZhav/The-Forest
    public override void Detached()
    {
        if (!Scene.SceneTracker)
        {
            return;
        }
        GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("storeRagDollPrefab"), base.transform.position, base.transform.rotation);

        gameObject.transform.position = base.transform.position;
        gameObject.transform.rotation = base.transform.rotation;
        storeLocalMutantInfo2 component = gameObject.GetComponent <storeLocalMutantInfo2>();

        Scene.SceneTracker.storedRagDollPrefabs.Add(gameObject);
        if (this.ca.isSnow)
        {
            component.isSnow = true;
        }
        if (!this.ast)
        {
            this.ast = base.transform.GetComponentInChildren <arrowStickToTarget>();
        }
        if (!this.ast)
        {
            this.ast = base.transform.GetComponent <arrowStickToTarget>();
        }
        if (this.ast)
        {
            foreach (KeyValuePair <Transform, int> keyValuePair in this.ast.stuckArrows)
            {
                if (keyValuePair.Key)
                {
                    component.stuckArrowsIndex.Add(keyValuePair.Key, keyValuePair.Value);
                    component.stuckArrowPos.Add(keyValuePair.Key.localPosition);
                    component.stuckArrowRot.Add(keyValuePair.Key.localRotation);
                }
            }
        }
        mutantTransferFire component2 = base.transform.GetComponent <mutantTransferFire>();

        if (component2)
        {
            for (int i = 0; i < component2.clientFireGo.Count; i++)
            {
                spawnParticleController component3 = component2.clientFireGo[i].GetComponent <spawnParticleController>();
                if (component3 && component3.spawnedPrefab)
                {
                    component.fire.Add(component3.spawnedPrefab.transform);
                    component.firePos.Add(component2.clientFireGo[i].transform.localPosition);
                    component.fireRot.Add(component2.clientFireGo[i].transform.localRotation);
                    component3.spawnedPrefab.SendMessage("disableFollowTarget");
                    Debug.Log("detached client fire");
                }
            }
        }
    }
コード例 #5
0
    public void transferFireToTarget(GameObject fire, GameObject target)
    {
        spawnParticleController component  = fire.GetComponent <spawnParticleController>();
        mutantTransferFire      component2 = target.GetComponent <mutantTransferFire>();

        if (component && component.spawnedPrefab && component2)
        {
            component.spawnedPrefab.SendMessage("disableFollowTarget");
            int index = this.allBones.IndexOf(fire.transform.parent);
            component.spawnedPrefab.transform.parent        = component2.allBones[index];
            component.spawnedPrefab.transform.localPosition = fire.transform.localPosition;
            component.spawnedPrefab.transform.localRotation = fire.transform.localRotation;
        }
    }
コード例 #6
0
    private IEnumerator transferClientFire(storeLocalMutantInfo2 store)
    {
        mutantTransferFire mtf = base.transform.GetComponent <mutantTransferFire>();

        if (mtf && mtf.allBones.Count > 0)
        {
            if (store == null || store.fireIndex.Count == 0)
            {
                yield break;
            }
            float     targetDist = float.PositiveInfinity;
            Transform key        = null;
            foreach (KeyValuePair <Transform, int> keyValuePair in store.fireIndex)
            {
                if (key == null)
                {
                    key = keyValuePair.Key;
                }
            }
            float timer = Time.time + 2f;
            while (targetDist > 10f)
            {
                if (Time.time > timer)
                {
                    yield break;
                }
                targetDist = Vector3.Distance(key.position, base.transform.position);
                yield return(null);
            }
            int indexCount = 0;
            foreach (KeyValuePair <Transform, int> keyValuePair2 in store.fireIndex)
            {
                if (keyValuePair2.Key && keyValuePair2.Key.gameObject.activeSelf)
                {
                    keyValuePair2.Key.parent        = mtf.allBones[keyValuePair2.Value];
                    keyValuePair2.Key.localPosition = store.firePos[indexCount];
                    keyValuePair2.Key.localRotation = store.fireRot[indexCount];
                    indexCount++;
                }
            }
        }
        yield break;
    }
コード例 #7
0
    public Transform metgoragdoll(Vector3 varpvelocity = default(Vector3))
    {
        Transform transform = UnityEngine.Object.Instantiate <Transform>(this.vargamragdoll, base.transform.position, base.transform.rotation);

        if (!this.ignoreScale)
        {
            transform.localScale = base.transform.localScale;
        }
        this.metcopytransforms(base.transform, transform, varpvelocity * 1f);
        if (this.doCreepySkin && this.enemyHealth)
        {
            transform.gameObject.SendMessage("setSkin", this.enemyHealth.MySkin.sharedMaterial, SendMessageOptions.DontRequireReceiver);
            this.enemyHealth.MySkin.GetPropertyBlock(this.bloodPropertyBlock);
            transform.gameObject.SendMessage("setSkinDamageProperty", this.bloodPropertyBlock, SendMessageOptions.DontRequireReceiver);
            if (this.enemyHealth.Fire.Length > 0)
            {
                mutantTransferFire component = base.transform.parent.GetComponent <mutantTransferFire>();
                foreach (GameObject gameObject in this.enemyHealth.Fire)
                {
                    if (gameObject.activeSelf && component)
                    {
                        component.transferFireToTarget(gameObject, transform.gameObject);
                    }
                }
            }
            if (BoltNetwork.isServer)
            {
                BoltEntity component2 = base.transform.parent.GetComponent <BoltEntity>();
                if (component2)
                {
                    IMutantState         state = component2.GetState <IMutantState>();
                    CoopMutantDummyToken coopMutantDummyToken = new CoopMutantDummyToken();
                    coopMutantDummyToken.Scale       = base.transform.localScale;
                    coopMutantDummyToken.skinDamage1 = this.bloodPropertyBlock.GetFloat("_Damage1");
                    coopMutantDummyToken.skinDamage2 = this.bloodPropertyBlock.GetFloat("_Damage2");
                    coopMutantDummyToken.skinDamage3 = this.bloodPropertyBlock.GetFloat("_Damage3");
                    coopMutantDummyToken.skinDamage4 = this.bloodPropertyBlock.GetFloat("_Damage4");
                    coopMutantDummyToken.skinColor   = this.enemyHealth.MySkin.sharedMaterial.GetColor("_Color");
                    mutantTypeSetup component3 = base.transform.parent.GetComponent <mutantTypeSetup>();
                    if (component3)
                    {
                    }
                    BoltNetwork.Attach(transform.gameObject, coopMutantDummyToken);
                }
            }
        }
        if (this.animalHealth && this.animalHealth.mySkin)
        {
            this.animalHealth.mySkin.GetPropertyBlock(this.bloodPropertyBlock);
            float @float = this.bloodPropertyBlock.GetFloat("_Damage1");
            transform.gameObject.SendMessage("setSkinDamageProperty", this.bloodPropertyBlock, SendMessageOptions.DontRequireReceiver);
        }
        if (this.animalHealth && this.animalHealth.Fire)
        {
            mutantTransferFire component4;
            if (base.transform.parent)
            {
                component4 = base.transform.parent.GetComponent <mutantTransferFire>();
            }
            else
            {
                component4 = base.transform.GetComponent <mutantTransferFire>();
            }
            if (this.animalHealth.Fire.activeSelf && component4)
            {
                component4.transferFireToTarget(this.animalHealth.Fire, transform.gameObject);
            }
        }
        if (this.bat && this.burning)
        {
            transform.gameObject.SendMessage("enableFire", SendMessageOptions.DontRequireReceiver);
        }
        if (this.animal)
        {
            animalSpawnFunctions component5 = base.transform.root.GetComponent <animalSpawnFunctions>();
            if (component5)
            {
                transform.gameObject.SendMessage("setSkin", component5.meshRenderer.sharedMaterial, SendMessageOptions.DontRequireReceiver);
            }
            if (this.ca && this.ca.isSnow)
            {
                transform.gameObject.SendMessage("setupSnowRabbitTypeTrigger", SendMessageOptions.DontRequireReceiver);
            }
        }
        if (this.bird)
        {
            if (this.burning)
            {
                transform.gameObject.SendMessage("enableFire", SendMessageOptions.DontRequireReceiver);
            }
            lb_Bird component6 = base.transform.GetComponent <lb_Bird>();
            transform.gameObject.SendMessage("setSkin", component6.skin.sharedMaterial, SendMessageOptions.DontRequireReceiver);
        }
        if (this.fish)
        {
            transform.gameObject.SendMessage("doSkinSetup", this.fishScript.fishTypeInt, SendMessageOptions.DontRequireReceiver);
            transform.gameObject.SendMessage("setupFishType", this.fishScript.fishNatureGuideValue, SendMessageOptions.DontRequireReceiver);
        }
        if (this.alreadyBurnt)
        {
            transform.gameObject.SendMessage("enableBurntSkin", SendMessageOptions.DontRequireReceiver);
        }
        if (this.ast)
        {
            arrowStickToTarget component7 = transform.GetComponent <arrowStickToTarget>();
            if (component7)
            {
                int num = 0;
                foreach (KeyValuePair <Transform, int> keyValuePair in this.ast.stuckArrows)
                {
                    if (keyValuePair.Key)
                    {
                        component7.CreatureType(this.ast.IsAnimal, this.ast.IsBird, this.ast.IsFish);
                        int arrowType = 0;
                        if (num < this.ast.stuckArrowsTypeList.Count)
                        {
                            arrowType = this.ast.stuckArrowsTypeList[num];
                        }
                        component7.applyStuckArrowToDummy(keyValuePair.Key, keyValuePair.Key.localPosition, keyValuePair.Key.localRotation, keyValuePair.Value, arrowType);
                        num++;
                    }
                }
            }
        }
        this.burning      = false;
        this.alreadyBurnt = false;
        return(transform);
    }
コード例 #8
0
    public IEnumerator spawnDummy(getAnimatorParams.DummyParams p)
    {
        Quaternion angle = p.Angle;

        if (BoltNetwork.isClient)
        {
            yield break;
        }
        Vector3 bodyPosition    = base.transform.position;
        bool    useBodyPosition = false;

        if (this.setup && this.setup.ai && this.setup.ai.pale && !p.IsDummyLoad && this.health.trapGo)
        {
            trapTrigger componentInChildren = this.health.trapGo.GetComponentInChildren <trapTrigger>();
            if (componentInChildren)
            {
                componentInChildren.FixPalePosition(this.setup, false);
                bodyPosition   += -0.15f * Vector3.up;
                useBodyPosition = true;
            }
        }
        GameObject dummy = UnityEngine.Object.Instantiate <GameObject>(this.dummyMutant, bodyPosition, base.transform.rotation);

        dummy.transform.rotation = angle;
        if (p.IsDummyLoad || (this.animator.GetBool("trapBool") && this.animator.GetInteger("trapTypeInt1") == 2))
        {
            dummy.transform.localEulerAngles = new Vector3(0f, dummy.transform.localEulerAngles.y, 0f);
        }
        dummy.transform.localScale = this.mutantBase.localScale;
        dummy.SendMessage("setCalledFromDeath", SendMessageOptions.DontRequireReceiver);
        SkinnedMeshRenderer[] sk = dummy.GetComponentsInChildren <SkinnedMeshRenderer>();
        foreach (SkinnedMeshRenderer skinnedMeshRenderer in sk)
        {
            skinnedMeshRenderer.enabled = false;
        }
        Animator          dummyAnim = dummy.GetComponent <Animator>();
        AnimatorStateInfo state     = this.animator.GetCurrentAnimatorStateInfo(0);

        dummyAnim.CrossFade(state.nameHash, 0f, 0, state.normalizedTime);
        dummyAnim.CopyParamsFrom(this.animator);
        if (p.IsDummyLoad)
        {
            if (this.animator.GetInteger("trapTypeInt1") != 3)
            {
                dummyAnim.SetBoolReflected("trapBool", true);
                if (this.animator.GetInteger("trapTypeInt1") == 2)
                {
                    dummyAnim.SetBoolReflected("enterTrapBool", true);
                    dummyAnim.SetBoolReflected("deathBOOL", true);
                }
                else
                {
                    dummyAnim.SetTriggerReflected("deathTrigger");
                }
            }
        }
        this.dummyHips.rotation    = this.hips.rotation;
        this.dummyHips.position    = bodyPosition;
        dummy.transform.position   = bodyPosition;
        dummy.transform.localScale = this.mutantBase.localScale;
        if (this.setup.health.Fire.Length > 0)
        {
            mutantTransferFire component = base.transform.GetComponent <mutantTransferFire>();
            foreach (GameObject gameObject in this.setup.health.Fire)
            {
                if (gameObject.activeSelf)
                {
                    component.transferFireToTarget(gameObject, dummy);
                }
            }
        }
        if (p.IsDummyLoad || this.animator.GetBool("trapBool"))
        {
            if (this.animator.GetInteger("trapTypeInt1") == 2 && this.health.trapParent)
            {
                dummy.transform.parent = this.health.trapParent.transform;
                dummy.SendMessageUpwards("setTrapDummy", dummy);
                CoopMutantDummy componentInChildren2 = dummy.GetComponentInChildren <CoopMutantDummy>();
                if (componentInChildren2 && this.health.trapGo)
                {
                    this.health.trapGo.SendMessage("SetNooseRope", componentInChildren2, SendMessageOptions.DontRequireReceiver);
                }
            }
            if ((p.IsDummyLoad || this.animator.GetInteger("trapTypeInt1") == 0) && this.health.trapGo)
            {
                this.health.trapGo.SendMessage("addTrappedMutant", new object[]
                {
                    dummy,
                    this.setup
                }, SendMessageOptions.DontRequireReceiver);
                dummy.SendMessage("setTrapGo", this.health.trapGo, SendMessageOptions.DontRequireReceiver);
            }
        }
        string TYPE   = string.Empty;
        bool   skinny = false;

        dummy.SendMessage("invokePickupSpawn", SendMessageOptions.DontRequireReceiver);
        if (this.setup.ai.femaleSkinny)
        {
            skinny = true;
            dummy.SendMessage(TYPE = "setFemaleSkinny", base.transform);
        }
        if (this.setup.ai.maleSkinny)
        {
            skinny = true;
            if (this.setup.ai.pale)
            {
                dummy.SendMessage(TYPE = "enableMaleSkinnyPaleProps");
                dummy.SendMessage(TYPE = "setMaleSkinnyPale", base.transform);
                if (this.setup.ai.skinned)
                {
                    dummy.SendMessage(TYPE = "setSkinnedMutant", this.setup.ai.skinned);
                }
            }
            else
            {
                dummy.SendMessage(TYPE = "enableMaleSkinnyProps");
                dummy.SendMessage(TYPE = "setMaleSkinny", base.transform);
            }
        }
        if (this.setup.ai.pale && !this.setup.ai.maleSkinny)
        {
            dummy.SendMessage(TYPE = "enablePaleProps");
            dummy.SendMessage(TYPE = "setPaleMale");
            if (this.setup.ai.skinned)
            {
                dummy.SendMessage(TYPE = "setSkinnedMutant", this.setup.ai.skinned);
            }
        }
        if (this.setup.ai.leader && !this.setup.ai.maleSkinny && !this.setup.ai.pale && !this.setup.ai.female)
        {
            dummy.SendMessage(TYPE = "setRegularMale", this.setup.propManager ? this.setup.propManager.regularMaleDice : 0);
            dummy.SendMessage(TYPE = "enableLeaderProps", this.setup.propManager ? this.setup.propManager.LeaderDice : 0);
            if (this.setup.ai.painted)
            {
                dummy.SendMessage(TYPE = "setPaintedLeader");
            }
            dummy.SendMessage(TYPE = "setRegularMaleLeader");
        }
        if (this.setup.ai.fireman)
        {
            if (this.setup.ai.fireman_dynamite)
            {
                dummy.SendMessage(TYPE = "setDynamiteMan");
            }
            dummy.SendMessage(TYPE = "enableFiremanProps");
            dummy.SendMessage(TYPE = "setRegularMaleFireman");
        }
        if (this.setup.ai.female && !this.setup.ai.femaleSkinny)
        {
            if (this.setup.ai.painted)
            {
                dummy.SendMessage(TYPE = "setFemalePainted", this.setup.bodyVariation ? this.setup.bodyVariation.femaleDice : 0);
            }
            else
            {
                dummy.SendMessage(TYPE = "setFemaleRegular", this.setup.bodyVariation ? this.setup.bodyVariation.femaleDice : 0);
            }
            if (this.bodyVar && this.bodyVar.Hair && this.bodyVar.Hair.activeSelf)
            {
                dummy.SendMessage(TYPE = "setFemaleHair");
            }
            if (this.bodyVar && this.bodyVar.Clothing && this.bodyVar.Clothing.activeSelf)
            {
                dummy.SendMessage(TYPE = "setFemaleClothes");
            }
            if (this.bodyVar && this.bodyVar.FireDice == 2)
            {
                dummy.SendMessage(TYPE = "setFemaleFire");
            }
        }
        if (this.setup.ai.male && !this.setup.ai.maleSkinny && !this.setup.ai.pale && !this.setup.ai.fireman && !this.setup.ai.leader)
        {
            if (this.setup.ai.painted)
            {
                dummy.SendMessage(TYPE = "setPaintedMale", this.setup.propManager ? this.setup.propManager.regularMaleDice : 0);
            }
            else
            {
                dummy.SendMessage(TYPE = "setRegularMale", this.setup.propManager ? this.setup.propManager.regularMaleDice : 0);
            }
        }
        if (this.setup.health.alreadyBurnt)
        {
            dummy.SendMessage("setBurntSkin", SendMessageOptions.DontRequireReceiver);
        }
        dummy.SendMessage("setPoisoned", this.health.poisoned, SendMessageOptions.DontRequireReceiver);
        if (this.setup.arrowSticker)
        {
            arrowStickToTarget componentInChildren3 = dummy.GetComponentInChildren <arrowStickToTarget>();
            foreach (KeyValuePair <Transform, int> keyValuePair in this.setup.arrowSticker.stuckArrows)
            {
                if (keyValuePair.Key)
                {
                    componentInChildren3.applyStuckArrowToDummy(keyValuePair.Key, keyValuePair.Key.localPosition, keyValuePair.Key.localRotation, keyValuePair.Value);
                }
            }
        }
        this.setup.health.MySkin.GetPropertyBlock(this.bloodPropertyBlock);
        dummy.SendMessage("setSkinDamageProperty", this.bloodPropertyBlock, SendMessageOptions.DontRequireReceiver);
        dummy.SendMessage("setSkinMaterialProperties", this.health.MySkin.material, SendMessageOptions.DontRequireReceiver);
        if (BoltNetwork.isServer)
        {
            CoopMutantDummyToken coopMutantDummyToken = new CoopMutantDummyToken();
            coopMutantDummyToken.Skinny         = skinny;
            coopMutantDummyToken.HipPosition    = bodyPosition;
            coopMutantDummyToken.HipRotation    = this.hips.rotation;
            coopMutantDummyToken.OriginalMutant = base.GetComponent <BoltEntity>();
            coopMutantDummyToken.Scale          = this.mutantBase.localScale;
            coopMutantDummyToken.skinDamage1    = this.bloodPropertyBlock.GetFloat("_Damage1");
            coopMutantDummyToken.skinDamage2    = this.bloodPropertyBlock.GetFloat("_Damage2");
            coopMutantDummyToken.skinDamage3    = this.bloodPropertyBlock.GetFloat("_Damage3");
            coopMutantDummyToken.skinDamage4    = this.bloodPropertyBlock.GetFloat("_Damage4");
            if (p.IsDummyLoad)
            {
                foreach (SkinnedMeshRenderer skinnedMeshRenderer2 in sk)
                {
                    skinnedMeshRenderer2.enabled = true;
                }
                CoopMutantMaterialSync component2 = dummy.GetComponent <CoopMutantMaterialSync>();
                component2.ForceStart();
                coopMutantDummyToken.MaterialIndex = component2.GetMaterialIndex();
                CoopMutantPropSync component3 = dummy.GetComponent <CoopMutantPropSync>();
                coopMutantDummyToken.Props = component3.GetPropMask();
            }
            else
            {
                IMutantState state2 = base.GetComponent <BoltEntity>().GetState <IMutantState>();
                coopMutantDummyToken.MaterialIndex = state2.MainMaterialIndex;
                coopMutantDummyToken.Props         = state2.prop_mask;
            }
            if (this.health.poisoned)
            {
                coopMutantDummyToken.skinColor = new Color(0.670588255f, 0.796078444f, 0.5529412f, 1f);
            }
            else if (this.setup.ai.pale && !this.setup.ai.skinned)
            {
                coopMutantDummyToken.skinColor = new Color(0.8039216f, 0.870588243f, 0.9137255f, 1f);
            }
            else
            {
                coopMutantDummyToken.skinColor = new Color(0.698039234f, 0.698039234f, 0.698039234f, 1f);
            }
            BoltNetwork.Attach(dummy, coopMutantDummyToken);
        }
        if (BoltNetwork.isServer)
        {
            IMutantFemaleDummyState mutantFemaleDummyState;
            if (dummy.GetComponent <BoltEntity>().TryFindState <IMutantFemaleDummyState>(out mutantFemaleDummyState))
            {
                mutantFemaleDummyState.Type          = TYPE;
                mutantFemaleDummyState.CrossFadeHash = state.nameHash;
                mutantFemaleDummyState.CrossFadeTime = state.normalizedTime;
            }
            IMutantMaleDummyState mutantMaleDummyState;
            if (dummy.GetComponent <BoltEntity>().TryFindState <IMutantMaleDummyState>(out mutantMaleDummyState))
            {
                mutantMaleDummyState.Type          = TYPE;
                mutantMaleDummyState.CrossFadeHash = state.nameHash;
                mutantMaleDummyState.CrossFadeTime = state.normalizedTime;
            }
        }
        List <Quaternion> jointRotations = new List <Quaternion>();

        for (int l = 0; l < this.mrs.jointsToSync.Length; l++)
        {
            jointRotations.Add(this.mrs.jointsToSync[l].localRotation);
        }
        if (!p.IsDummyLoad && !this.animator.GetBool("trapBool"))
        {
            dummy.SendMessage("syncRagDollJoints", jointRotations, SendMessageOptions.DontRequireReceiver);
        }
        yield return(new WaitForFixedUpdate());

        yield return(new WaitForFixedUpdate());

        yield return(new WaitForFixedUpdate());

        yield return(new WaitForFixedUpdate());

        yield return(new WaitForFixedUpdate());

        dummy.transform.localScale = this.mutantBase.localScale;
        dummy.transform.position   = ((!useBodyPosition) ? this.DeadPosition : bodyPosition);
        if (this.animator.GetBool("trapBool") && this.animator.GetInteger("trapTypeInt1") == 2)
        {
            this.setup.rootTr.parent = null;
        }
        foreach (SkinnedMeshRenderer skinnedMeshRenderer3 in sk)
        {
            skinnedMeshRenderer3.enabled = true;
        }
        if (PoolManager.Pools["enemies"].IsSpawned(base.transform))
        {
            PoolManager.Pools["enemies"].Despawn(base.transform);
        }
        else if (BoltNetwork.isServer)
        {
            dummy.GetComponent <BoltEntity>().DestroyDelayed(0.1f);
        }
        else
        {
            UnityEngine.Object.Destroy(base.transform.gameObject);
        }
        yield return(null);

        yield break;
    }