コード例 #1
0
    public void activateGirlMutant()
    {
        Debug.Log("activating girl mutant");
        Scene.SceneTracker.visibleEnemies.Add(this.rootTr.gameObject);
        girlMutantAiManager component = base.transform.GetComponent <girlMutantAiManager>();

        if (component)
        {
            component.setInitialWeightParams();
            component.girlStartPos = base.transform.position;
            component.setupHealthParams();
        }
        GameObject gameObject = new GameObject("girlSpawnGo");

        gameObject.transform.position = base.transform.position;
        this.setup.spawnGo            = gameObject;
        this.setup.homeGo             = gameObject;
        this.setup.typeSetup.inCave   = true;
        this.fsmInCaveBool            = this.setup.pmCombat.FsmVariables.GetFsmBool("inCaveBool");
        this.fsmInCaveBool.Value      = true;
        this.setup.pmCombat.SendEvent("begin");
        this.setup.ai.enabled        = true;
        this.ai.girlFullyTransformed = true;
        this.ai.animSpeed            = 1.2f;
        this.animator.speed          = 1.2f;
        this.ast = base.transform.parent.GetComponentInChildren <arrowStickToTarget>();
        if (this.ast)
        {
            this.ast.enabled = true;
        }
        if (LocalPlayer.Stats)
        {
            LocalPlayer.Stats.IsFightingBoss = true;
        }
        if (BoltNetwork.isServer)
        {
            setupEndBoss setupEndBoss = setupEndBoss.Create(GlobalTargets.Everyone);
            setupEndBoss.bossActive = 1;
            setupEndBoss.Send();
        }
    }
コード例 #2
0
 private void spawnRealGirl()
 {
     if (BoltNetwork.isRunning)
     {
         setupEndBoss setupEndBoss = setupEndBoss.Create(GlobalTargets.Everyone);
         setupEndBoss.spawnBoss = true;
         setupEndBoss.pos       = this.placedPrefab.transform.position;
         setupEndBoss.rot       = this.placedPrefab.transform.rotation;
         setupEndBoss.Send();
         UnityEngine.Object.Destroy(this.placedPrefab);
         base.enabled = false;
         return;
     }
     if (!Scene.SceneTracker.endBossSpawned)
     {
         this.updateTimer = Time.time + 1f;
         GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.realPrefab, this.placedPrefab.transform.position, this.placedPrefab.transform.rotation);
         UnityEngine.Object.Destroy(this.placedPrefab);
         this.activateGirlScript.girlAnimator = gameObject.GetComponentInChildren <Animator>();
         base.enabled = false;
     }
 }
コード例 #3
0
 public override void OnEvent(setupEndBoss evnt)
 {
     if (!this.ValidateSender(evnt, SenderTypes.Any))
     {
         return;
     }
     if (evnt.bossActive > 0)
     {
         if (evnt.bossActive == 1)
         {
             LocalPlayer.Stats.IsFightingBoss = true;
         }
         else if (evnt.bossActive == 2)
         {
             LocalPlayer.Stats.IsFightingBoss = false;
         }
         return;
     }
     if (evnt.disableBossTrigger)
     {
         GameObject gameObject = GameObject.FindWithTag("endGameBossPrefab");
         if (gameObject)
         {
             SphereCollider componentInChildren = gameObject.GetComponentInChildren <SphereCollider>();
             if (componentInChildren)
             {
                 componentInChildren.enabled = false;
             }
         }
         return;
     }
     if (evnt.spawnBoss)
     {
         TheForest.Utils.Scene.SceneTracker.endBossSpawned = true;
     }
 }
コード例 #4
0
        public IEnumerator doGirlTransformRoutine(Transform mark)
        {
            if (!this.spectator)
            {
                setupEndBoss setupEndBoss = setupEndBoss.Create(GlobalTargets.Everyone);
                setupEndBoss.disableBossTrigger = true;
                setupEndBoss.Send();
            }
            Vector3 fixLocalPos = new Vector3(0f, -2.344841f, 0f);

            yield return(new WaitForSeconds(0.5f));

            if (!this.spectator)
            {
                LocalPlayer.PlayerBase.SendMessage("loadCustomAnimation", "girlTransformReaction", SendMessageOptions.DontRequireReceiver);
                while (LocalPlayer.AnimControl.loadingAnimation)
                {
                    yield return(null);
                }
                this.ActorAnimator = LocalPlayer.Animator;
                LocalPlayer.Inventory.Close();
                LocalPlayer.Inventory.UnequipItemAtSlot(Item.EquipmentSlot.Chest, false, true, false);
                LocalPlayer.FpCharacter.allowFallDamage = false;
                LocalPlayer.ScriptSetup.bodyCollisionGo.SetActive(false);
                LocalPlayer.AnimControl.endGameCutScene   = true;
                LocalPlayer.vrPlayerControl.useGhostMode  = true;
                LocalPlayer.ScriptSetup.pmControl.enabled = false;
                LocalPlayer.FpCharacter.Locked            = true;
                LocalPlayer.FpCharacter.CanJump           = false;
                LocalPlayer.Create.Grabber.gameObject.SetActive(false);
                LocalPlayer.AnimControl.playerHeadCollider.enabled = false;
                LocalPlayer.Animator.SetBool("onHand", false);
                LocalPlayer.Animator.SetBool("jumpBool", false);
                LocalPlayer.Inventory.HideAllEquiped(false, false);
                LocalPlayer.Animator.SetLayerWeightReflected(0, 1f);
                LocalPlayer.Animator.SetLayerWeightReflected(1, 1f);
                LocalPlayer.Animator.SetLayerWeightReflected(2, 1f);
                LocalPlayer.Animator.SetLayerWeightReflected(3, 0f);
                LocalPlayer.ScriptSetup.pmControl.FsmVariables.GetFsmBool("noControl").Value = true;
                LocalPlayer.MainRotator.rotationRange = new Vector2(0f, 0f);
                LocalPlayer.MainRotator.enabled       = false;
                LocalPlayer.CamRotator.stopInput      = true;
                LocalPlayer.CamRotator.rotationRange  = new Vector2(0f, 0f);
                LocalPlayer.FpCharacter.drinking      = true;
                LocalPlayer.FpCharacter.enabled       = false;
                LocalPlayer.CamFollowHead.smoothLock  = true;
                LocalPlayer.CamFollowHead.lockYCam    = true;
                LocalPlayer.AnimControl.lockGravity   = true;
                LocalPlayer.AnimControl.animEvents.StartCoroutine("smoothDisableSpine");
                LocalPlayer.Animator.SetBool("girlTransform", true);
                LocalPlayer.HitReactions.disableControllerFreeze();
                LocalPlayer.Animator.CrossFade("Base Layer.idle", 0f, 0, 0f);
                LocalPlayer.Animator.CrossFade("upperBody.idle", 0f, 1, 0f);
                LocalPlayer.Animator.CrossFade("fullBodyActions.idle", 0f, 2, 0f);
            }
            Vector3 playerPos = mark.position;

            playerPos.y += 2.35f;
            float t = 0f;

            while (t < 1f)
            {
                if (!this.spectator)
                {
                    LocalPlayer.Transform.position = Vector3.Slerp(LocalPlayer.Transform.position, playerPos, t);
                    LocalPlayer.Transform.rotation = Quaternion.Slerp(LocalPlayer.Transform.rotation, mark.rotation, t);
                    LocalPlayer.PlayerBase.transform.localPosition = fixLocalPos;
                }
                t += Time.deltaTime;
                yield return(null);
            }
            if (!this.spectator)
            {
                LocalPlayer.Transform.position = playerPos;
                LocalPlayer.Transform.rotation = mark.rotation;
                LocalPlayer.PlayerBase.transform.localPosition = fixLocalPos;
                LocalPlayer.AnimControl.useRootMotion          = true;
            }
            if (this.girlAnimator)
            {
                this.girlAnimator.transform.parent.localScale = new Vector3(1f, 1f, 1f);
            }
            this.currState2 = this.ActorAnimator.GetCurrentAnimatorStateInfo(2);
            while (!this.currState2.IsName("fullBodyActions.girlTransformReaction"))
            {
                this.currState2 = this.ActorAnimator.GetCurrentAnimatorStateInfo(2);
                if (!this.spectator)
                {
                    LocalPlayer.Animator.SetLayerWeightReflected(3, 0f);
                    LocalPlayer.Animator.SetLayerWeightReflected(1, 1f);
                    LocalPlayer.Animator.SetLayerWeightReflected(2, 1f);
                    LocalPlayer.Transform.position = playerPos;
                    LocalPlayer.PlayerBase.transform.localPosition = fixLocalPos;
                    this.lockPlayerParams();
                }
                yield return(null);
            }
            if (!this.spectator)
            {
                LocalPlayer.Animator.SetBool("girlTransform", false);
            }
            this.currState2 = this.ActorAnimator.GetCurrentAnimatorStateInfo(2);
            this.girlAnimator.CrossFade("Base Layer.transform", 0.2f, 0, this.currState2.normalizedTime);
            bool doScaleHack = false;

            while (this.currState2.IsName("fullBodyActions.girlTransformReaction"))
            {
                if (!this.spectator)
                {
                    this.lockPlayerParams();
                    LocalPlayer.PlayerBase.transform.localPosition = fixLocalPos;
                    LocalPlayer.HitReactions.disableControllerFreeze();
                    LocalPlayer.Animator.SetLayerWeightReflected(1, 1f);
                    LocalPlayer.Animator.SetLayerWeightReflected(2, 1f);
                    LocalPlayer.Animator.SetLayerWeightReflected(3, 0f);
                    LocalPlayer.Animator.SetLayerWeightReflected(4, 0f);
                }
                if (this.currState2.normalizedTime > 0.92f && !doScaleHack)
                {
                    base.StartCoroutine(this.scaleGirlMutant(1.25f));
                    doScaleHack = true;
                    if (BoltNetwork.isClient && !this.spectator)
                    {
                        setupEndBoss setupEndBoss2 = setupEndBoss.Create(GlobalTargets.OnlyServer);
                        setupEndBoss2.target    = this.girlAnimator.transform.parent.GetComponent <BoltEntity>();
                        setupEndBoss2.scaleHack = true;
                        setupEndBoss2.Send();
                    }
                }
                this.currState2 = this.ActorAnimator.GetCurrentAnimatorStateInfo(2);
                yield return(null);
            }
            if (!BoltNetwork.isClient)
            {
                creepyAnimatorControl creepyAnimatorControl = this.girlAnimator.transform.parent.GetComponentsInChildren <creepyAnimatorControl>(true)[0];
                creepyAnimatorControl.enabled = true;
                creepyAnimatorControl.activateGirlMutant();
            }
            if (BoltNetwork.isClient && !this.spectator)
            {
                setupEndBoss setupEndBoss3 = setupEndBoss.Create(GlobalTargets.OnlyServer);
                setupEndBoss3.target       = this.girlAnimator.transform.parent.GetComponent <BoltEntity>();
                setupEndBoss3.activateBoss = true;
                setupEndBoss3.Send();
            }
            if (!this.spectator)
            {
                LocalPlayer.AnimControl.playerHeadCollider.enabled = true;
                LocalPlayer.AnimControl.playerCollider.enabled     = true;
                LocalPlayer.AnimControl.lockGravity = false;
            }
            yield return(null);

            if (!this.spectator)
            {
                LocalPlayer.PlayerBase.SendMessage("unloadCustomAnimation", "girlTransformReaction", SendMessageOptions.DontRequireReceiver);
                while (LocalPlayer.AnimControl.loadingAnimation)
                {
                    yield return(null);
                }
                this.unlockPlayerParams();
                LocalPlayer.Inventory.UnlockEquipmentSlot(Item.EquipmentSlot.LeftHand);
                LocalPlayer.FpCharacter.enabled           = true;
                LocalPlayer.ScriptSetup.pmControl.enabled = true;
                LocalPlayer.ScriptSetup.bodyCollisionGo.SetActive(true);
                LocalPlayer.AnimControl.endGameCutScene  = false;
                LocalPlayer.vrPlayerControl.useGhostMode = false;
                LocalPlayer.AnimControl.skinningAnimal   = false;
                LocalPlayer.AnimControl.useRootMotion    = false;
                LocalPlayer.AnimControl.useRootRotation  = false;
                LocalPlayer.Create.Grabber.gameObject.SetActive(true);
                LocalPlayer.AnimControl.playerHeadCollider.enabled = true;
                LocalPlayer.AnimControl.playerCollider.enabled     = true;
                LocalPlayer.CamFollowHead.lockYCam           = false;
                LocalPlayer.CamFollowHead.smoothLock         = false;
                LocalPlayer.CamRotator.resetOriginalRotation = true;
                LocalPlayer.CamRotator.stopInput             = false;
                LocalPlayer.CamRotator.rotationRange         = new Vector2(LocalPlayer.FpCharacter.minCamRotationRange, 0f);
                LocalPlayer.FpCharacter.Locked    = false;
                LocalPlayer.FpCharacter.drinking  = false;
                LocalPlayer.FpCharacter.CanJump   = true;
                LocalPlayer.Rigidbody.isKinematic = false;
                LocalPlayer.Animator.SetLayerWeightReflected(4, 1f);
                LocalPlayer.AnimControl.animEvents.StartCoroutine("smoothEnableSpine");
                LocalPlayer.Inventory.ShowAllEquiped(true);
                LocalPlayer.ScriptSetup.pmControl.FsmVariables.GetFsmBool("noControl").Value = false;
                if (LocalPlayer.ScriptSetup.events.toyHeld)
                {
                    LocalPlayer.ScriptSetup.events.toyHeld.SetActive(false);
                }
                LocalPlayer.MainRotator.rotationRange         = new Vector2(0f, 999f);
                LocalPlayer.MainRotator.resetOriginalRotation = true;
                LocalPlayer.MainRotator.enabled = true;
                float timer = 0f;
                while (timer < 1f)
                {
                    LocalPlayer.CamFollowHead.transform.localRotation = Quaternion.Lerp(LocalPlayer.CamFollowHead.transform.localRotation, LocalPlayer.CamFollowHead.transform.parent.localRotation, timer);
                    timer += Time.deltaTime * 3f;
                    yield return(null);
                }
            }
            LocalPlayer.Inventory.UnlockEquipmentSlot(Item.EquipmentSlot.LeftHand);
            yield break;
        }