Esempio n. 1
0
        // Token: 0x060032D9 RID: 13017 RVA: 0x000DC6DC File Offset: 0x000DA8DC
        public override void OnEnter()
        {
            base.OnEnter();
            Transform modelTransform = base.GetModelTransform();

            if (modelTransform && modelTransform.GetComponent <ChildLocator>() && DeathState.initialEffect)
            {
                EffectManager.SpawnEffect(DeathState.initialEffect, new EffectData
                {
                    origin = base.transform.position,
                    scale  = DeathState.initialEffectScale
                }, false);
            }
            if (modelTransform)
            {
                RagdollController component  = modelTransform.GetComponent <RagdollController>();
                Rigidbody         component2 = base.GetComponent <Rigidbody>();
                if (component && component2)
                {
                    component.BeginRagdoll(component2.velocity * DeathState.velocityMagnitude);
                }
            }
            ExplodeRigidbodiesOnStart component3 = modelTransform.GetComponent <ExplodeRigidbodiesOnStart>();

            if (component3)
            {
                component3.force   = DeathState.explosionForce;
                component3.enabled = true;
            }
        }
Esempio n. 2
0
        // Token: 0x060008DB RID: 2267 RVA: 0x0002CA80 File Offset: 0x0002AC80
        public override void OnExit()
        {
            base.OnExit();
            Util.PlaySound(DeathState.initialSoundString, base.gameObject);
            Transform modelTransform = base.GetModelTransform();

            if (modelTransform && NetworkServer.active && modelTransform.GetComponent <ChildLocator>() && DeathState.initialEffect)
            {
                EffectManager.instance.SpawnEffect(DeathState.initialEffect, new EffectData
                {
                    origin = base.transform.position,
                    scale  = DeathState.initialEffectScale
                }, true);
            }
            Rigidbody         component  = base.GetComponent <Rigidbody>();
            RagdollController component2 = modelTransform.GetComponent <RagdollController>();

            if (component2 && component)
            {
                component2.BeginRagdoll(component.velocity * DeathState.velocityMagnitude);
            }
            ExplodeRigidbodiesOnStart component3 = modelTransform.GetComponent <ExplodeRigidbodiesOnStart>();

            if (component3)
            {
                component3.force   = DeathState.explosionForce;
                component3.enabled = true;
            }
        }
        // Token: 0x06000809 RID: 2057 RVA: 0x00027CE0 File Offset: 0x00025EE0
        public override void OnEnter()
        {
            base.OnEnter();
            this.PlayDeathSound();
            Transform modelTransform = base.GetModelTransform();
            Vector3   vector         = Vector3.up * 3f;

            if (base.characterMotor)
            {
                vector += base.characterMotor.velocity;
                base.characterMotor.enabled = false;
            }
            if (base.characterBody && base.characterBody.inventory && base.characterBody.inventory.GetItemCount(ItemIndex.LunarDagger) > 0)
            {
                this.isBrittle = true;
            }
            if (base.modelLocator)
            {
                base.modelLocator.modelTransform = null;
            }
            if (modelTransform)
            {
                RagdollController component = modelTransform.GetComponent <RagdollController>();
                if (component)
                {
                    component.BeginRagdoll(vector);
                }
                if (this.isBrittle)
                {
                    TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                    temporaryOverlay.duration                 = 0.5f;
                    temporaryOverlay.destroyObjectOnEnd       = true;
                    temporaryOverlay.originalMaterial         = Resources.Load <Material>("Materials/matShatteredGlass");
                    temporaryOverlay.destroyEffectPrefab      = (GameObject)Resources.Load("Prefabs/Effects/BrittleDeath");
                    temporaryOverlay.destroyEffectChildString = "Chest";
                    temporaryOverlay.inspectorCharacterModel  = modelTransform.gameObject.GetComponent <CharacterModel>();
                    temporaryOverlay.alphaCurve               = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
                    temporaryOverlay.animateShaderAlpha       = true;
                }
            }
            if (base.cameraTargetParams)
            {
                ChildLocator component2 = modelTransform.GetComponent <ChildLocator>();
                if (component2)
                {
                    Transform transform = component2.FindChild("Chest");
                    if (transform)
                    {
                        base.cameraTargetParams.cameraPivotTransform = transform;
                        base.cameraTargetParams.aimMode            = CameraTargetParams.AimType.Aura;
                        base.cameraTargetParams.dontRaycastToPivot = true;
                    }
                }
            }
        }
        // Token: 0x060031D5 RID: 12757 RVA: 0x000D6A8C File Offset: 0x000D4C8C
        public override void OnEnter()
        {
            base.OnEnter();
            Vector3 vector = Vector3.up * 3f;

            if (base.characterMotor)
            {
                vector += base.characterMotor.velocity;
                base.characterMotor.enabled = false;
            }
            if (base.cachedModelTransform)
            {
                RagdollController component = base.cachedModelTransform.GetComponent <RagdollController>();
                if (component)
                {
                    component.BeginRagdoll(vector);
                }
            }
        }
Esempio n. 5
0
        public override void OnEnter()
        {
            base.OnEnter();

            Vector3 vector = Vector3.up * 3f;

            if (base.characterMotor)
            {
                vector += base.characterMotor.velocity;
                base.characterMotor.enabled = false;
            }

            if (base.modelLocator)
            {
                RagdollController ragdoll = base.modelLocator.modelTransform.GetComponent <RagdollController>();
                if (ragdoll)
                {
                    ragdoll.BeginRagdoll(vector);
                }
            }
        }
        // Token: 0x0600315C RID: 12636 RVA: 0x000D4788 File Offset: 0x000D2988
        public override void OnExit()
        {
            base.OnExit();
            Util.PlaySound(MegaDroneDeathState.initialSoundString, base.gameObject);
            Transform modelTransform = base.GetModelTransform();

            if (modelTransform && NetworkServer.active)
            {
                ChildLocator component = modelTransform.GetComponent <ChildLocator>();
                if (component)
                {
                    component.FindChild("LeftJet").gameObject.SetActive(false);
                    component.FindChild("RightJet").gameObject.SetActive(false);
                    if (MegaDroneDeathState.initialEffect)
                    {
                        EffectManager.SpawnEffect(MegaDroneDeathState.initialEffect, new EffectData
                        {
                            origin = base.transform.position,
                            scale  = MegaDroneDeathState.initialEffectScale
                        }, true);
                    }
                }
            }
            Rigidbody         component2 = base.GetComponent <Rigidbody>();
            RagdollController component3 = modelTransform.GetComponent <RagdollController>();

            if (component3 && component2)
            {
                component3.BeginRagdoll(component2.velocity * MegaDroneDeathState.velocityMagnitude);
            }
            ExplodeRigidbodiesOnStart component4 = modelTransform.GetComponent <ExplodeRigidbodiesOnStart>();

            if (component4)
            {
                component4.force   = MegaDroneDeathState.explosionForce;
                component4.enabled = true;
            }
        }