Exemplo n.º 1
0
 // Token: 0x06000674 RID: 1652 RVA: 0x0001E610 File Offset: 0x0001C810
 public override void OnExit()
 {
     this.CreateBlinkEffect(base.transform.position);
     this.modelTransform = base.GetModelTransform();
     if (this.modelTransform)
     {
         TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
         temporaryOverlay.duration              = 0.6f;
         temporaryOverlay.animateShaderAlpha    = true;
         temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
         temporaryOverlay.destroyComponentOnEnd = true;
         temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matHuntressFlashBright");
         temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>());
         TemporaryOverlay temporaryOverlay2 = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
         temporaryOverlay2.duration              = 0.7f;
         temporaryOverlay2.animateShaderAlpha    = true;
         temporaryOverlay2.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
         temporaryOverlay2.destroyComponentOnEnd = true;
         temporaryOverlay2.originalMaterial      = Resources.Load <Material>("Materials/matHuntressFlashExpanded");
         temporaryOverlay2.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>());
     }
     if (this.characterModel)
     {
         this.characterModel.invisibilityCount--;
     }
     if (this.hurtboxGroup)
     {
         HurtBoxGroup hurtBoxGroup = this.hurtboxGroup;
         int          hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1;
         hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
     }
     base.OnExit();
 }
 // Token: 0x06002F2B RID: 12075 RVA: 0x000C9698 File Offset: 0x000C7898
 public override void OnExit()
 {
     Util.PlaySound(BlinkState.endSoundString, base.gameObject);
     this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject));
     this.modelTransform = base.GetModelTransform();
     if (this.modelTransform && BlinkState.destealthMaterial)
     {
         TemporaryOverlay temporaryOverlay = this.animator.gameObject.AddComponent <TemporaryOverlay>();
         temporaryOverlay.duration = 1f;
         temporaryOverlay.destroyComponentOnEnd   = true;
         temporaryOverlay.originalMaterial        = BlinkState.destealthMaterial;
         temporaryOverlay.inspectorCharacterModel = this.animator.gameObject.GetComponent <CharacterModel>();
         temporaryOverlay.alphaCurve         = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
         temporaryOverlay.animateShaderAlpha = true;
     }
     if (this.characterModel)
     {
         this.characterModel.invisibilityCount--;
     }
     if (this.hurtboxGroup)
     {
         HurtBoxGroup hurtBoxGroup = this.hurtboxGroup;
         int          hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1;
         hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
     }
     if (base.characterMotor)
     {
         base.characterMotor.enabled = true;
     }
     base.PlayAnimation("Gesture, Additive", "BlinkEnd");
     base.OnExit();
 }
Exemplo n.º 3
0
 public override void CreateOverlay(TemporaryOverlay overlay, CharacterBody body)
 {
     overlay.duration = -1f;
     overlay.destroyComponentOnEnd = false;
     overlay.destroyObjectOnEnd    = false;
     overlay.originalMaterial      = overlayMat;
 }
Exemplo n.º 4
0
        private void CharacterModel_UpdateOverlays(On.RoR2.CharacterModel.orig_UpdateOverlays orig, CharacterModel self)
        {
            orig(self);

            if (self)
            {
                if (self.body && self.body.HasBuff(Modules.Buffs.torporDebuff))
                {
                    var torporController = self.body.GetComponent <Misc.PaladinTorporTracker>();
                    if (!torporController)
                    {
                        torporController = self.body.gameObject.AddComponent <Misc.PaladinTorporTracker>();
                    }
                    else
                    {
                        return;
                    }

                    torporController.Body = self.body;
                    TemporaryOverlay overlay = self.gameObject.AddComponent <RoR2.TemporaryOverlay>();
                    overlay.duration              = float.PositiveInfinity;
                    overlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                    overlay.animateShaderAlpha    = true;
                    overlay.destroyComponentOnEnd = true;
                    overlay.originalMaterial      = Resources.Load <Material>("Materials/matDoppelganger");
                    overlay.AddToCharacerModel(self);
                    torporController.Overlay = overlay;
                }
            }
        }
 // Token: 0x060031F5 RID: 12789 RVA: 0x000D79DC File Offset: 0x000D5BDC
 public override void OnExit()
 {
     if (base.characterBody && NetworkServer.active)
     {
         if (base.characterBody.HasBuff(BuffIndex.Cloak))
         {
             base.characterBody.RemoveBuff(BuffIndex.Cloak);
         }
         if (base.characterBody.HasBuff(BuffIndex.CloakSpeed))
         {
             base.characterBody.RemoveBuff(BuffIndex.CloakSpeed);
         }
     }
     if (!this.outer.destroying)
     {
         this.CastSmoke();
     }
     if (CastSmokescreenNoDelay.destealthMaterial)
     {
         TemporaryOverlay temporaryOverlay = this.animator.gameObject.AddComponent <TemporaryOverlay>();
         temporaryOverlay.duration = 1f;
         temporaryOverlay.destroyComponentOnEnd   = true;
         temporaryOverlay.originalMaterial        = CastSmokescreenNoDelay.destealthMaterial;
         temporaryOverlay.inspectorCharacterModel = this.animator.gameObject.GetComponent <CharacterModel>();
         temporaryOverlay.alphaCurve         = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
         temporaryOverlay.animateShaderAlpha = true;
     }
     base.OnExit();
 }
Exemplo n.º 6
0
            public void Update()
            {
                if (!renderer)
                {
                    if (itemFollower && itemFollower.followerInstance)
                    {
                        renderer = itemFollower.followerInstance.GetComponentInChildren <Renderer>();
                    }
                }

                if (blinkTimer > 0f)
                {
                    blinkTimer -= Time.deltaTime;
                    if (blinkTimer <= 0f)
                    {
                        if (renderer)
                        {
                            renderer.shadowCastingMode = ShadowCastingMode.On;
                            renderer.enabled           = true;

                            EffectManager.SpawnEffect(blinkEffect, new EffectData
                            {
                                origin = renderer.transform.position
                            }, false);

                            TemporaryOverlay temporaryOverlay = renderer.gameObject.AddComponent <TemporaryOverlay>();
                            temporaryOverlay.duration              = flashTimer = flashDuration;
                            temporaryOverlay.destroyObjectOnEnd    = false;
                            temporaryOverlay.destroyComponentOnEnd = true;
                            temporaryOverlay.originalMaterial      = materialFlash;
                            temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                            temporaryOverlay.animateShaderAlpha    = true;
                            temporaryOverlay.SetupMaterial();

                            var materials = renderer.materials;
                            HG.ArrayUtils.ArrayAppend(ref materials, temporaryOverlay.materialInstance);
                            renderer.materials = materials;
                            materialInstance   = renderer.materials.Last();
                        }
                    }
                }

                if (flashTimer > 0f)
                {
                    flashTimer -= Time.deltaTime;
                    if (flashTimer <= 0f)
                    {
                        if (renderer && materialInstance)
                        {
                            var materials = renderer.materials;
                            var index     = System.Array.IndexOf(materials, materialInstance);
                            if (index != -1)
                            {
                                HG.ArrayUtils.ArrayRemoveAtAndResize(ref materials, index);
                            }
                            renderer.materials = materials;
                        }
                    }
                }
            }
Exemplo n.º 7
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.duration      = this.baseDuration;
            this.hasFallen     = false;
            this.cometParticle = base.GetModelChildLocator().FindChild("CometEffect").GetComponentInChildren <ParticleSystem>();

            base.characterBody.bodyFlags |= CharacterBody.BodyFlags.IgnoreFallDamage;

            if (base.isAuthority)
            {
                base.characterMotor.velocity     *= 0.2f;
                base.characterMotor.rootMotion.y += 0.5f;
                base.characterMotor.velocity.y    = 35;

                base.gameObject.layer = LayerIndex.fakeActor.intVal;
                base.characterMotor.Motor.RebuildCollidableLayers();
            }

            Transform modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                temporaryOverlay.duration              = this.duration;
                temporaryOverlay.animateShaderAlpha    = true;
                temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                temporaryOverlay.destroyComponentOnEnd = true;
                temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matDoppelganger");
                temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>());
            }

            base.PlayAnimation("FullBody, Override", "FallingCometStart", "ToTheStars.playbackRate", 1f);
            Util.PlayAttackSpeedSound(Croco.Leap.leapSoundString, base.gameObject, 0.75f);
        }
Exemplo n.º 8
0
        private static void CharacterModel_UpdateOverlays(On.RoR2.CharacterModel.orig_UpdateOverlays orig, CharacterModel self)
        {
            orig(self);

            if (self)
            {
                if (self.body && self.body.HasBuff(Charm))
                {
                    var isCharmed = self.body.GetComponent <IsCharmed>();
                    if (isCharmed && !isCharmed.Overlay)
                    {
                        TemporaryOverlay overlay = self.gameObject.AddComponent <TemporaryOverlay>();
                        overlay.duration              = float.PositiveInfinity;
                        overlay.alphaCurve            = AnimationCurve.Constant(0f, 0f, 0.54f);
                        overlay.animateShaderAlpha    = true;
                        overlay.destroyComponentOnEnd = true;
                        overlay.originalMaterial      = assetBundle.LoadAsset <Material>("Assets/Textures/Materials/Overlays/Charmed.mat");
                        overlay.AddToCharacerModel(self);
                        isCharmed.Overlay = overlay;
                    }
                    else
                    {
                        return;
                    }
                }
            }
        }
Exemplo n.º 9
0
 private void AddEliteMaterials(On.RoR2.CharacterBody.orig_FixedUpdate orig, RoR2.CharacterBody self)
 {
     if (self.HasBuff(EliteBuffIndex) && !self.GetComponent <HyperchargedBuffTracker>())
     {
         var modelLocator = self.modelLocator;
         if (modelLocator)
         {
             var modelTransform = self.modelLocator.modelTransform;
             if (modelTransform)
             {
                 var model = self.modelLocator.modelTransform.GetComponent <RoR2.CharacterModel>();
                 if (model)
                 {
                     var hyperchargedBuffTracker = self.gameObject.AddComponent <HyperchargedBuffTracker>();
                     hyperchargedBuffTracker.Body = self;
                     TemporaryOverlay overlay = self.modelLocator.modelTransform.gameObject.AddComponent <RoR2.TemporaryOverlay>();
                     overlay.duration              = float.PositiveInfinity;
                     overlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                     overlay.animateShaderAlpha    = true;
                     overlay.destroyComponentOnEnd = true;
                     overlay.originalMaterial      = EliteMaterial;
                     overlay.AddToCharacerModel(model);
                     hyperchargedBuffTracker.Overlay = overlay;
                 }
             }
         }
     }
     orig(self);
 }
Exemplo n.º 10
0
        private void FireShockwave()
        {
            if (!this.hasFired)
            {
                this.hasFired = true;

                if (NetworkServer.active)
                {
                    base.characterBody.RemoveBuff(Modules.Buffs.armorBuff);
                }

                AkSoundEngine.StopPlayingID(this.soundID);

                Vector3 position = base.transform.position;
                Util.PlaySound("UNUNUN", base.gameObject);

                if (FireMegaNova.novaEffectPrefab)
                {
                    EffectManager.SimpleMuzzleFlash(FireMegaNova.novaEffectPrefab, base.gameObject, "Chest", false);
                }

                Transform modelTransform = base.GetModelTransform();
                if (modelTransform)
                {
                    TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                    temporaryOverlay.duration              = 3f;
                    temporaryOverlay.animateShaderAlpha    = true;
                    temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                    temporaryOverlay.destroyComponentOnEnd = true;
                    temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matVagrantEnergized");
                    temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>());
                }

                if (base.isAuthority)
                {
                    new BlastAttack
                    {
                        attacker          = base.gameObject,
                        baseDamage        = this.storedDamage,
                        baseForce         = FireMegaNova.novaForce,
                        bonusForce        = Vector3.zero,
                        attackerFiltering = AttackerFiltering.NeverHit,
                        crit             = base.RollCrit(),
                        damageColorIndex = DamageColorIndex.Default,
                        damageType       = DamageType.Generic,
                        falloffModel     = BlastAttack.FalloffModel.None,
                        inflictor        = base.gameObject,
                        position         = position,
                        procChainMask    = default(ProcChainMask),
                        procCoefficient  = 1f,
                        radius           = this.shockwaveRadius,
                        losType          = BlastAttack.LoSType.NearestHit,
                        teamIndex        = base.teamComponent.teamIndex,
                        impactEffect     = EffectCatalog.FindEffectIndexFromPrefab(FireMegaNova.novaImpactEffectPrefab)
                    }.Fire();
                }
            }
        }
Exemplo n.º 11
0
        // Token: 0x0600050F RID: 1295 RVA: 0x00015B04 File Offset: 0x00013D04
        public override void FixedUpdate()
        {
            base.FixedUpdate();
            this.stopwatch       += Time.fixedDeltaTime;
            this.attackStopwatch += Time.fixedDeltaTime;
            float num = 1f / Evis.damageFrequency / this.attackSpeedStat;

            if (this.attackStopwatch >= num)
            {
                this.attackStopwatch -= num;
                HurtBox hurtBox = this.SearchForTarget();
                if (hurtBox)
                {
                    Util.PlayScaledSound(Evis.slashSoundString, base.gameObject, Evis.slashPitch);
                    Util.PlaySound(Evis.dashSoundString, base.gameObject);
                    Util.PlaySound(Evis.impactSoundString, base.gameObject);
                    HurtBoxGroup hurtBoxGroup = hurtBox.hurtBoxGroup;
                    HurtBox      hurtBox2     = hurtBoxGroup.hurtBoxes[UnityEngine.Random.Range(0, hurtBoxGroup.hurtBoxes.Length - 1)];
                    if (hurtBox2)
                    {
                        DamageInfo damageInfo = new DamageInfo();
                        damageInfo.damage          = Evis.damageCoefficient * this.damageStat;
                        damageInfo.attacker        = base.gameObject;
                        damageInfo.procCoefficient = Evis.procCoefficient;
                        damageInfo.position        = hurtBox2.transform.position;
                        damageInfo.crit            = this.crit;
                        hurtBox2.healthComponent.TakeDamage(damageInfo);
                        GlobalEventManager.instance.OnHitEnemy(damageInfo, hurtBox2.healthComponent.gameObject);
                        GlobalEventManager.instance.OnHitAll(damageInfo, hurtBox2.healthComponent.gameObject);
                        Vector3 position   = hurtBox2.transform.position;
                        Vector2 normalized = UnityEngine.Random.insideUnitCircle.normalized;
                        Vector3 normal     = new Vector3(normalized.x, 0f, normalized.y);
                        EffectManager.instance.SimpleImpactEffect(Evis.hitEffectPrefab, position, normal, false);
                        Transform        transform        = hurtBox.hurtBoxGroup.transform;
                        TemporaryOverlay temporaryOverlay = transform.gameObject.AddComponent <TemporaryOverlay>();
                        temporaryOverlay.duration              = num;
                        temporaryOverlay.animateShaderAlpha    = true;
                        temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                        temporaryOverlay.destroyComponentOnEnd = true;
                        temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matMercEvisTarget");
                        temporaryOverlay.AddToCharacerModel(transform.GetComponent <CharacterModel>());
                    }
                }
                else if (base.isAuthority && this.stopwatch > Evis.minimumDuration)
                {
                    this.outer.SetNextStateToMain();
                }
            }
            if (base.characterMotor)
            {
                base.characterMotor.velocity = Vector3.zero;
            }
            if (this.stopwatch >= Evis.duration && base.isAuthority)
            {
                this.outer.SetNextStateToMain();
            }
        }
Exemplo n.º 12
0
        // Token: 0x06002D67 RID: 11623 RVA: 0x000C009C File Offset: 0x000BE29C
        public override void FixedUpdate()
        {
            base.FixedUpdate();
            this.stopwatch += Time.fixedDeltaTime;
            if (this.stopwatch > EvisDash.dashPrepDuration && !this.isDashing)
            {
                this.isDashing  = true;
                this.dashVector = base.inputBank.aimDirection;
                this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject));
                base.PlayCrossfade("FullBody, Override", "EvisLoop", 0.1f);
                if (this.modelTransform)
                {
                    TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                    temporaryOverlay.duration              = 0.6f;
                    temporaryOverlay.animateShaderAlpha    = true;
                    temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                    temporaryOverlay.destroyComponentOnEnd = true;
                    temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matHuntressFlashBright");
                    temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>());
                    TemporaryOverlay temporaryOverlay2 = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                    temporaryOverlay2.duration              = 0.7f;
                    temporaryOverlay2.animateShaderAlpha    = true;
                    temporaryOverlay2.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                    temporaryOverlay2.destroyComponentOnEnd = true;
                    temporaryOverlay2.originalMaterial      = Resources.Load <Material>("Materials/matHuntressFlashExpanded");
                    temporaryOverlay2.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>());
                }
            }
            bool flag = this.stopwatch >= EvisDash.dashDuration + EvisDash.dashPrepDuration;

            if (this.isDashing)
            {
                if (base.characterMotor && base.characterDirection)
                {
                    base.characterMotor.rootMotion += this.dashVector * (this.moveSpeedStat * EvisDash.speedCoefficient * Time.fixedDeltaTime);
                }
                if (base.isAuthority)
                {
                    Collider[] array = Physics.OverlapSphere(base.transform.position, base.characterBody.radius + EvisDash.overlapSphereRadius * (flag ? EvisDash.lollypopFactor : 1f), LayerIndex.entityPrecise.mask);
                    for (int i = 0; i < array.Length; i++)
                    {
                        HurtBox component = array[i].GetComponent <HurtBox>();
                        if (component && component.healthComponent != base.healthComponent)
                        {
                            Evis nextState = new Evis();
                            this.outer.SetNextState(nextState);
                            return;
                        }
                    }
                }
            }
            if (flag && base.isAuthority)
            {
                this.outer.SetNextStateToMain();
            }
        }
Exemplo n.º 13
0
        public CharacterMaster SummonHeretic(GameObject summonerBodyObject, Vector3 spawnPosition)
        {
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'SummonHeretic(UnityEngine.GameObject)' called on client");
                return(null);
            }
            MasterSummon masterSummon = new MasterSummon
            {
                masterPrefab          = MasterCatalog.FindMasterPrefab("HereticMonsterMaster"),
                position              = spawnPosition,
                rotation              = Quaternion.identity,
                summonerBodyObject    = summonerBodyObject,
                ignoreTeamMemberLimit = true,
                useAmbientLevel       = new bool?(true),
            };
            CharacterMaster characterMaster = masterSummon.Perform();

            if (characterMaster)
            {
                GameObject bodyObject = characterMaster.GetBodyObject();
                if (bodyObject)
                {
                    ModelLocator component = bodyObject.GetComponent <ModelLocator>();
                    if (component && component.modelTransform)
                    {
                        TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                        temporaryOverlay.duration              = 0.5f;
                        temporaryOverlay.animateShaderAlpha    = true;
                        temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                        temporaryOverlay.destroyComponentOnEnd = true;
                        temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matSummonDrone");
                        temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>());
                    }
                    var inventory = characterMaster.inventory;
                    if (inventory)
                    {
                        inventory.CopyItemsFrom(summonerBodyObject.GetComponent <CharacterBody>().inventory);
                    }
                }
            }
            if (characterMaster && characterMaster.bodyInstanceObject)
            {
                characterMaster.GetBody().AddTimedBuff(RoR2Content.Buffs.Immune, 3f);
                GameObject gameObject = Resources.Load <GameObject>("Prefabs/Effects/HippoRezEffect");
                if (gameObject)
                {
                    EffectManager.SpawnEffect(gameObject, new EffectData
                    {
                        origin   = spawnPosition,
                        rotation = characterMaster.bodyInstanceObject.transform.rotation
                    }, true);
                }
            }
            return(characterMaster);
        }
Exemplo n.º 14
0
 // Token: 0x06000612 RID: 1554 RVA: 0x0001C158 File Offset: 0x0001A358
 private void ExitCleanup()
 {
     if (this.isExiting)
     {
         return;
     }
     this.isExiting = true;
     Util.PlaySound(BlinkState.endSoundString, base.gameObject);
     this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject));
     this.modelTransform = base.GetModelTransform();
     new BlastAttack
     {
         attacker     = base.gameObject,
         inflictor    = base.gameObject,
         teamIndex    = TeamComponent.GetObjectTeam(base.gameObject),
         baseDamage   = this.damageStat * BlinkState.blastAttackDamageCoefficient,
         baseForce    = BlinkState.blastAttackForce,
         position     = this.blinkDestination,
         radius       = BlinkState.blastAttackRadius,
         falloffModel = BlastAttack.FalloffModel.Linear
     }.Fire();
     if (this.modelTransform && BlinkState.destealthMaterial)
     {
         TemporaryOverlay temporaryOverlay = this.animator.gameObject.AddComponent <TemporaryOverlay>();
         temporaryOverlay.duration = 1f;
         temporaryOverlay.destroyComponentOnEnd   = true;
         temporaryOverlay.originalMaterial        = BlinkState.destealthMaterial;
         temporaryOverlay.inspectorCharacterModel = this.animator.gameObject.GetComponent <CharacterModel>();
         temporaryOverlay.alphaCurve         = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
         temporaryOverlay.animateShaderAlpha = true;
     }
     if (this.characterModel)
     {
         this.characterModel.invisibilityCount--;
     }
     if (this.hurtboxGroup)
     {
         HurtBoxGroup hurtBoxGroup = this.hurtboxGroup;
         int          hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1;
         hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
     }
     if (this.childLocator)
     {
         this.childLocator.FindChild("DustCenter").gameObject.SetActive(true);
     }
     if (this.blinkDestinationInstance)
     {
         EntityState.Destroy(this.blinkDestinationInstance);
     }
     if (base.characterMotor)
     {
         base.characterMotor.enabled = true;
     }
     base.PlayAnimation("Gesture, Additive", "BlinkEnd", "BlinkEnd.playbackRate", BlinkState.exitDuration);
 }
Exemplo n.º 15
0
        // 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;
                    }
                }
            }
        }
Exemplo n.º 16
0
        // Token: 0x060005CE RID: 1486 RVA: 0x0001A824 File Offset: 0x00018A24
        private void Detonate()
        {
            Vector3 position = base.transform.position;

            Util.PlaySound(FireMegaNova.novaSoundString, base.gameObject);
            if (FireMegaNova.novaEffectPrefab)
            {
                EffectManager.instance.SimpleMuzzleFlash(FireMegaNova.novaEffectPrefab, base.gameObject, "NovaCenter", false);
            }
            Transform modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                temporaryOverlay.duration              = 3f;
                temporaryOverlay.animateShaderAlpha    = true;
                temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                temporaryOverlay.destroyComponentOnEnd = true;
                temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matVagrantEnergized");
                temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>());
            }
            if (base.isAuthority)
            {
                BullseyeSearch bullseyeSearch = new BullseyeSearch();
                bullseyeSearch.filterByLoS       = true;
                bullseyeSearch.maxDistanceFilter = this.novaRadius;
                bullseyeSearch.searchOrigin      = position;
                bullseyeSearch.sortMode          = BullseyeSearch.SortMode.Distance;
                bullseyeSearch.teamMaskFilter    = TeamMask.allButNeutral;
                bullseyeSearch.teamMaskFilter.RemoveTeam(base.teamComponent.teamIndex);
                bullseyeSearch.RefreshCandidates();
                bullseyeSearch.queryTriggerInteraction = QueryTriggerInteraction.Collide;
                List <HurtBox> list = bullseyeSearch.GetResults().ToList <HurtBox>();
                if (list.Count > 0)
                {
                    DamageInfo damageInfo = new DamageInfo();
                    damageInfo.damage          = this.damageStat * FireMegaNova.novaDamageCoefficient;
                    damageInfo.attacker        = base.gameObject;
                    damageInfo.procCoefficient = 1f;
                    damageInfo.crit            = Util.CheckRoll(this.critStat, base.characterBody.master);
                    for (int i = 0; i < list.Count; i++)
                    {
                        HurtBox         hurtBox         = list[i];
                        HealthComponent healthComponent = hurtBox.healthComponent;
                        if (healthComponent)
                        {
                            damageInfo.force    = FireMegaNova.novaForce * (healthComponent.transform.position - position).normalized;
                            damageInfo.position = hurtBox.transform.position;
                            EffectManager.instance.SimpleImpactEffect(FireMegaNova.novaImpactEffectPrefab, hurtBox.transform.position, Vector3.up, true);
                            healthComponent.TakeDamage(damageInfo);
                        }
                    }
                }
            }
        }
Exemplo n.º 17
0
 // Token: 0x06002A12 RID: 10770 RVA: 0x000B0BA4 File Offset: 0x000AEDA4
 public override void OnEnter()
 {
     base.OnEnter();
     this.cachedModelTransform = (base.modelLocator ? base.modelLocator.modelTransform : null);
     this.isBrittle            = (base.characterBody && base.characterBody.inventory && base.characterBody.inventory.GetItemCount(ItemIndex.LunarDagger) > 0);
     this.isVoidDeath          = (base.healthComponent && (base.healthComponent.killingDamageType & DamageType.VoidDeath) > DamageType.Generic);
     if (this.isVoidDeath)
     {
         if (base.characterBody && base.isAuthority)
         {
             EffectManager.SpawnEffect(GenericCharacterDeath.voidDeathEffect, new EffectData
             {
                 origin = base.characterBody.corePosition,
                 scale  = base.characterBody.bestFitRadius
             }, true);
         }
         if (this.cachedModelTransform)
         {
             EntityState.Destroy(this.cachedModelTransform.gameObject);
             this.cachedModelTransform = null;
         }
     }
     if (this.cachedModelTransform)
     {
         if (this.isBrittle)
         {
             TemporaryOverlay temporaryOverlay = this.cachedModelTransform.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  = this.cachedModelTransform.gameObject.GetComponent <CharacterModel>();
             temporaryOverlay.alphaCurve               = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
             temporaryOverlay.animateShaderAlpha       = true;
         }
         if (base.cameraTargetParams)
         {
             ChildLocator component = this.cachedModelTransform.GetComponent <ChildLocator>();
             if (component)
             {
                 Transform transform = component.FindChild("Chest");
                 if (transform)
                 {
                     base.cameraTargetParams.cameraPivotTransform = transform;
                     base.cameraTargetParams.aimMode            = CameraTargetParams.AimType.Aura;
                     base.cameraTargetParams.dontRaycastToPivot = true;
                 }
             }
         }
     }
     this.PlayDeathSound();
     this.PlayDeathAnimation(0.1f);
 }
Exemplo n.º 18
0
        public override void OnEnter()
        {
            base.OnEnter();
            bool flag  = base.characterBody;
            bool flag2 = flag;

            if (flag2)
            {
                base.characterBody.AddTimedBuff(Buffs.TemplarOverdriveBuff, 3f);
            }
            EffectManager.SimpleMuzzleFlash(FireTarball.effectPrefab, base.gameObject, "Root", false);
            RoR2.EffectManager.SpawnEffect(LegacyResourcesAPI.Load <GameObject>("Prefabs/Effects/ImpactEffects/ExplosivePotExplosion"), new RoR2.EffectData
            {
                origin = base.characterBody.corePosition,
                scale  = 12f
            }, true);

            BlastAttack blastAttack = new BlastAttack
            {
                attacker        = base.gameObject,
                inflictor       = base.gameObject,
                teamIndex       = base.teamComponent.teamIndex,
                baseForce       = TemplarOverdrive.pushForce,
                bonusForce      = Vector3.zero,
                position        = base.transform.position,
                radius          = 12f,
                falloffModel    = BlastAttack.FalloffModel.None,
                crit            = false,
                baseDamage      = 0f,
                procCoefficient = 0f,
                damageType      = DamageType.ClayGoo
            };

            blastAttack.Fire();
            this.modelTransform = base.GetModelTransform();
            bool flag3 = this.modelTransform;
            bool flag4 = flag3;

            if (flag4)
            {
                TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                temporaryOverlay.duration              = 8f;
                temporaryOverlay.animateShaderAlpha    = true;
                temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                temporaryOverlay.destroyComponentOnEnd = true;
                temporaryOverlay.originalMaterial      = LegacyResourcesAPI.Load <Material>("Materials/matClayGooDebuff");
                temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>());
            }
            Util.PlayAttackSpeedSound(FireTarball.attackSoundString, base.gameObject, 0.75f);
            this.outer.SetNextStateToMain();
        }
Exemplo n.º 19
0
            public override void Update()
            {
                base.Update();

                if (!started)
                {
                    var parent = transform.parent;
                    if (parent)
                    {
                        started = true;

                        modelLocator = parent.GetComponent <ModelLocator>();
                        if (modelLocator && modelLocator.modelTransform)
                        {
                            temporaryOverlay                  = modelLocator.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                            temporaryOverlay.duration         = duration;
                            temporaryOverlay.originalMaterial = Main.AssetBundle.LoadAsset <Material>("Assets/Equipment/From Omar With Love/matOmarHackToolVFXOverlay.mat");
                            //temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 0f, 0.2f, 1f);
                            //temporaryOverlay.animateShaderAlpha = true;
                            temporaryOverlay.destroyComponentOnEnd = false;
                            temporaryOverlay.destroyObjectOnEnd    = false;
                            temporaryOverlay.SetupMaterial();

                            renderer = modelLocator.modelTransform.GetComponentInChildren <Renderer>();
                            if (renderer)
                            {
                                var materials = renderer.materials;
                                HG.ArrayUtils.ArrayAppend(ref materials, temporaryOverlay.materialInstance);
                                renderer.materials = materials;
                                materialInstance   = renderer.materials.Last();
                            }
                        }
                    }
                }

                if (age >= duration && !ended)
                {
                    ended = true;

                    if (renderer && materialInstance)
                    {
                        var materials = renderer.materials;
                        var index     = System.Array.IndexOf(materials, materialInstance);
                        if (index != -1)
                        {
                            HG.ArrayUtils.ArrayRemoveAtAndResize(ref materials, index);
                        }
                        renderer.materials = materials;
                    }
                }
            }
Exemplo n.º 20
0
            public override void Update()
            {
                base.Update();
                if (age >= shatterTime && !shatterFlag)
                {
                    shatterFlag = true;
                    if (pickupDisplay && pickupDisplay.modelObject)
                    {
                        var childLocator = pickupDisplay.modelObject.GetComponent <ChildLocator>();
                        if (!childLocator)
                        {
                            childLocator = pickupDisplay.modelObject.AddComponent <ChildLocator>();
                        }
                        if (childLocator.transformPairs == null)
                        {
                            childLocator.transformPairs = new ChildLocator.NameTransformPair[] { }
                        }
                        ;
                        var transformPair = new ChildLocator.NameTransformPair
                        {
                            name      = "ShatterOrigin",
                            transform = pickupDisplay.modelObject.transform
                        };
                        HGArrayUtilities.ArrayAppend(ref childLocator.transformPairs, ref transformPair);

                        TemporaryOverlay temporaryOverlay = pickupDisplay.modelObject.AddComponent <TemporaryOverlay>();
                        temporaryOverlay.duration                 = 0.5f;
                        temporaryOverlay.destroyObjectOnEnd       = true;
                        temporaryOverlay.originalMaterial         = LegacyResourcesAPI.Load <Material>("Materials/matShatteredGlass");
                        temporaryOverlay.destroyEffectPrefab      = (GameObject)LegacyResourcesAPI.Load <GameObject>("Prefabs/Effects/BrittleDeath");
                        temporaryOverlay.destroyEffectChildString = "ShatterOrigin";
                        temporaryOverlay.alphaCurve               = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
                        temporaryOverlay.animateShaderAlpha       = true;
                        temporaryOverlay.SetupMaterial();

                        var renderer = pickupDisplay.modelRenderer;
                        if (renderer)
                        {
                            var materials = renderer.materials;
                            HGArrayUtilities.ArrayAppend(ref materials, ref temporaryOverlay.materialInstance);
                            renderer.materials = materials;
                        }
                    }
                }
                if (age >= duration)
                {
                    Object.Destroy(gameObject);
                }
            }
        }
        // Token: 0x06002EA5 RID: 11941 RVA: 0x000C6560 File Offset: 0x000C4760
        private void Detonate()
        {
            Vector3 position = base.transform.position;

            Util.PlaySound(FireMegaNova.novaSoundString, base.gameObject);
            if (FireMegaNova.novaEffectPrefab)
            {
                EffectManager.SimpleMuzzleFlash(FireMegaNova.novaEffectPrefab, base.gameObject, "NovaCenter", false);
            }
            Transform modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                temporaryOverlay.duration              = 3f;
                temporaryOverlay.animateShaderAlpha    = true;
                temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                temporaryOverlay.destroyComponentOnEnd = true;
                temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matVagrantEnergized");
                temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>());
            }
            if (NetworkServer.active)
            {
                new BlastAttack
                {
                    attacker         = base.gameObject,
                    baseDamage       = this.damageStat * FireMegaNova.novaDamageCoefficient,
                    baseForce        = FireMegaNova.novaForce,
                    bonusForce       = Vector3.zero,
                    canHurtAttacker  = false,
                    crit             = base.characterBody.RollCrit(),
                    damageColorIndex = DamageColorIndex.Default,
                    damageType       = DamageType.Generic,
                    falloffModel     = BlastAttack.FalloffModel.None,
                    inflictor        = base.gameObject,
                    position         = position,
                    procChainMask    = default(ProcChainMask),
                    procCoefficient  = 3f,
                    radius           = this.novaRadius,
                    losType          = BlastAttack.LoSType.NearestHit,
                    teamIndex        = base.teamComponent.teamIndex,
                    impactEffect     = EffectCatalog.FindEffectIndexFromPrefab(FireMegaNova.novaImpactEffectPrefab)
                }.Fire();
            }
        }
Exemplo n.º 22
0
        public CharacterMaster SummonMage(GameObject summonerBody, Vector3 spawnPosition)
        {
            if (!NetworkServer.active)
            {
                return(null);
            }
            Inventory    summonerInventory = summonerBody.GetComponent <CharacterBody>()?.inventory ? summonerBody.GetComponent <CharacterBody>().inventory : null;
            MasterSummon masterSummon      = new MasterSummon
            {
                masterPrefab          = MageMasterPrefab,
                position              = spawnPosition,
                rotation              = Quaternion.identity,
                summonerBodyObject    = summonerBody ?? null,
                ignoreTeamMemberLimit = true,
                useAmbientLevel       = new bool?(true),
                inventoryToCopy       = cfgCopyInventory.Value ? summonerInventory : null,
            };
            CharacterMaster characterMaster = masterSummon.Perform();

            if (characterMaster)
            {
                DontDestroyOnLoad(characterMaster);
                if (characterMaster.inventory)
                {
                    characterMaster.inventory.GiveItem(RoR2Content.Items.ExtraLife, cfgLives.Value);
                }

                GameObject bodyObject = characterMaster.GetBodyObject();
                if (bodyObject)
                {
                    ModelLocator component = bodyObject.GetComponent <ModelLocator>();
                    if (component && component.modelTransform)
                    {
                        TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                        temporaryOverlay.duration              = 0.5f;
                        temporaryOverlay.animateShaderAlpha    = true;
                        temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                        temporaryOverlay.destroyComponentOnEnd = true;
                        temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matSummonDrone");
                        temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>());
                    }
                }
            }
            return(characterMaster);
        }
Exemplo n.º 23
0
 private void ExitCleanup()
 {
     if (isExiting)
     {
         return;
     }
     LogCore.LogM("Check");
     isExiting        = true;
     gameObject.layer = LayerIndex.defaultLayer.intVal;
     LogCore.LogM("Check");
     //Util.PlaySound(endSoundString, gameObject);
     LogCore.LogM("Check");
     CreateBlinkEffect(Util.GetCorePosition(gameObject));
     LogCore.LogM("Check");
     modelTransform = GetModelTransform();
     if (modelTransform && destealthMaterial)
     {
         TemporaryOverlay temporaryOverlay = animator.gameObject.AddComponent <TemporaryOverlay>();
         temporaryOverlay.duration = 1f;
         temporaryOverlay.destroyComponentOnEnd   = true;
         temporaryOverlay.originalMaterial        = destealthMaterial;
         temporaryOverlay.inspectorCharacterModel = animator.gameObject.GetComponent <CharacterModel>();
         temporaryOverlay.alphaCurve         = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
         temporaryOverlay.animateShaderAlpha = true;
     }
     LogCore.LogM("Check");
     if (characterModel)
     {
         characterModel.invisibilityCount--;
     }
     LogCore.LogM("Check");
     if (hurtboxGroup)
     {
         HurtBoxGroup hurtBoxGroup = hurtboxGroup;
         int          hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1;
         hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
     }
     if (rigidbodyMotor && rigidbodyDirection)
     {
         rigidbodyMotor.enabled     = true;
         rigidbodyDirection.enabled = true;
     }
     LogCore.LogM("Check");
 }
Exemplo n.º 24
0
        public override void OnEnter()
        {
            base.OnEnter();
            base.characterBody.isSprinting = true;
            this.duration = DashForwardOld.baseDuration;

            Util.PlayScaledSound(EntityStates.Croco.Leap.leapSoundString, base.gameObject, 1.75f);
            base.PlayAnimation("FullBody, Override", "DashForward", "Whirlwind.playbackRate", this.duration);

            if (base.isAuthority && base.inputBank && base.characterDirection)
            {
                this.forwardDirection = ((base.inputBank.moveVector == Vector3.zero) ? base.characterDirection.forward : base.inputBank.moveVector).normalized;
            }

            this.RecalculateSpeed();

            if (base.characterMotor && base.characterDirection)
            {
                base.characterMotor.velocity   = this.forwardDirection * this.dashSpeed;
                base.characterMotor.velocity.y = 0f;
            }

            Transform modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                temporaryOverlay.duration              = 0.75f;
                temporaryOverlay.animateShaderAlpha    = true;
                temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                temporaryOverlay.destroyComponentOnEnd = true;
                temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matDoppelganger");
                temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>());
            }

            if (NetworkServer.active)
            {
                base.characterBody.AddBuff(BuffIndex.HiddenInvincibility);
            }

            Vector3 b = base.characterMotor ? base.characterMotor.velocity : Vector3.zero;

            this.previousPosition = base.transform.position - b;
        }
Exemplo n.º 25
0
        public override void OnEnter()
        {
            this.baseDuration            = 15f;
            this.overrideDuration        = 15f;
            this.muzzleflashEffectPrefab = Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/ExplosionSolarFlare");
            this.projectilePrefab        = null;
            this.castSoundString         = Modules.Sounds.CastTorpor;
            this.swordController         = base.gameObject.GetComponent <PaladinSwordController>();

            base.OnEnter();

            if (NetworkServer.active)
            {
                Vector3?vector = this.sunSpawnPosition;

                float oldMinDistance   = ChannelSun.sunPlacementMinDistance;
                float oldIdealAltitude = ChannelSun.sunPlacementIdealAltitudeBonus;

                ChannelSun.sunPlacementMinDistance        = 0f;
                ChannelSun.sunPlacementIdealAltitudeBonus = 0f;

                this.sunSpawnPosition = this.swordController.sunPosition + Vector3.up;//((vector != null) ? vector : ChannelSun.FindSunSpawnPosition(this.spellPosition));
                if (this.sunSpawnPosition != null)
                {
                    this.sunInstance = this.CreateSun(this.sunSpawnPosition.Value);
                }

                ChannelSun.sunPlacementMinDistance        = oldMinDistance;
                ChannelSun.sunPlacementIdealAltitudeBonus = oldIdealAltitude;
            }

            Transform modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                temporaryOverlay.duration              = this.baseDuration;
                temporaryOverlay.animateShaderAlpha    = true;
                temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                temporaryOverlay.destroyComponentOnEnd = true;
                temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matGrandparentTeleportOutBoom");
                temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>());
            }
        }
Exemplo n.º 26
0
        private void PlayEffect()
        {
            this.playID = Util.PlaySound(EntityStates.Heretic.SpawnState.spawnSoundString, base.gameObject);
            EffectManager.SimpleEffect(EntityStates.Heretic.SpawnState.effectPrefab, transform.position + Vector3.up, Quaternion.identity, false);
            this.PlayAnimation("Body", "Spawn", "Spawn.playbackRate", EntityStates.Heretic.SpawnState.duration);

            CharacterModel characterModel = this.transform.GetComponent <CharacterModel>();

            if (characterModel && EntityStates.Heretic.SpawnState.overlayMaterial)
            {
                TemporaryOverlay temporaryOverlay = this.gameObject.AddComponent <TemporaryOverlay>();
                temporaryOverlay.duration = EntityStates.Heretic.SpawnState.overlayDuration;
                temporaryOverlay.destroyComponentOnEnd   = true;
                temporaryOverlay.originalMaterial        = EntityStates.Heretic.SpawnState.overlayMaterial;
                temporaryOverlay.inspectorCharacterModel = characterModel;
                temporaryOverlay.alphaCurve         = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                temporaryOverlay.animateShaderAlpha = true;
            }
        }
Exemplo n.º 27
0
            public CharacterMaster SummonDrone(GameObject bodyPrefab, Vector3 spawnPosition, EquipmentIndex equipmentIndex = EquipmentIndex.None)
            {
                if (!NetworkServer.active)
                {
                    Debug.LogWarning("[Server] function 'RoR2.CharacterMaster RoR2.MithrixSpawnsDronesActivator::SummonMaster(UnityEngine.GameObject)' called on client");
                    return(null);
                }
                MasterSummon masterSummon = new MasterSummon
                {
                    masterPrefab          = masterPrefab,
                    position              = spawnPosition,
                    rotation              = Quaternion.identity,
                    summonerBodyObject    = bodyPrefab,
                    ignoreTeamMemberLimit = true,
                    useAmbientLevel       = new bool?(true),
                };
                CharacterMaster characterMaster = masterSummon.Perform();

                if (characterMaster)
                {
                    GameObject bodyObject = characterMaster.GetBodyObject();
                    if (bodyObject)
                    {
                        ModelLocator component = bodyObject.GetComponent <ModelLocator>();
                        if (component && component.modelTransform)
                        {
                            TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                            temporaryOverlay.duration              = 0.5f;
                            temporaryOverlay.animateShaderAlpha    = true;
                            temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                            temporaryOverlay.destroyComponentOnEnd = true;
                            temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matSummonDrone");
                            temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>());
                        }
                        var inventory = characterMaster.inventory;
                        if (inventory)
                        {
                            inventory.SetEquipmentIndex(equipmentIndex);
                        }
                    }
                }
                return(characterMaster);
            }
Exemplo n.º 28
0
 public override void OnEnter()
 {
     base.OnEnter();
     if (base.isAuthority)
     {
         base.GetComponent <HANDOverclockController>().EnableOverclock();
         new BlastAttack
         {
             attacker        = base.gameObject,
             inflictor       = base.gameObject,
             teamIndex       = TeamComponent.GetObjectTeam(base.gameObject),
             baseDamage      = this.damageStat * 1.5f,
             baseForce       = -30,
             position        = base.modelLocator.transform.position,
             radius          = 15,
             procCoefficient = 0f,
             falloffModel    = BlastAttack.FalloffModel.None,
             damageType      = DamageType.Stun1s,
             crit            = RollCrit()
         }.Fire();
         if (OVERCLOCK.hitEffectPrefab)
         {
             EffectManager.SpawnEffect(OVERCLOCK.hitEffectPrefab, new EffectData
             {
                 origin = base.transform.position,
                 scale  = 15
             }, false);
         }
         this.modelTransform = GetModelTransform();
         if (this.modelTransform)
         {
             TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
             temporaryOverlay.duration              = base.GetComponent <HANDOverclockController>().maxDuration;
             temporaryOverlay.animateShaderAlpha    = true;
             temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
             temporaryOverlay.destroyComponentOnEnd = true;
             temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matMercEnergized");
             temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>());
         }
     }
 }
Exemplo n.º 29
0
        private void CharacterModel_UpdateOverlays(On.RoR2.CharacterModel.orig_UpdateOverlays orig, CharacterModel self)
        {
            orig(self);

            if (self && self.body)
            {
                var isJammed = self.body.GetComponent <IsJammed>();
                if (isJammed && !isJammed.Overlay)
                {
                    TemporaryOverlay overlay = self.gameObject.AddComponent <TemporaryOverlay>();
                    overlay.duration              = float.PositiveInfinity;
                    overlay.alphaCurve            = AnimationCurve.Constant(0f, 0f, 0.54f);
                    overlay.animateShaderAlpha    = true;
                    overlay.destroyComponentOnEnd = true;
                    overlay.originalMaterial      = Resources.Load <Material>("Materials/matFullCrit");
                    overlay.AddToCharacerModel(self);
                    isJammed.Overlay = overlay;
                }
                return;
            }
        }
Exemplo n.º 30
0
        public override void OnExit()
        {
            Util.PlaySound(LoomingPresence.endSoundString, base.gameObject);
            this.modelTransform = base.GetModelTransform();

            if (base.characterDirection)
            {
                base.characterDirection.forward = base.GetAimRay().direction;
            }

            if (this.modelTransform && LoomingPresence.destealthMaterial)
            {
                TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                temporaryOverlay.duration = LoomingPresence.destealthDuration;
                temporaryOverlay.destroyComponentOnEnd   = true;
                temporaryOverlay.originalMaterial        = LoomingPresence.destealthMaterial;
                temporaryOverlay.inspectorCharacterModel = this.modelTransform.gameObject.GetComponent <CharacterModel>();
                temporaryOverlay.alphaCurve         = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                temporaryOverlay.animateShaderAlpha = true;
            }

            if (this.characterModel)
            {
                this.characterModel.invisibilityCount--;
            }

            if (this.hurtboxGroup)
            {
                HurtBoxGroup hurtBoxGroup = this.hurtboxGroup;
                int          hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1;
                hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
            }

            if (base.characterMotor)
            {
                base.characterMotor.enabled = true;
            }

            base.OnExit();
        }