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;
                     RoR2.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);
 }
 public static void RubyMatUpdate(CharacterBody self)
 {
     if (self && self.inventory)
     {
         EliteIndex equipmentEliteIndex = RoR2.EliteCatalog.GetEquipmentEliteIndex(self.inventory.GetEquipmentIndex());
         if (self && equipmentEliteIndex == EliteIndex.None && self.isElite)
         {
             int itemCount = self.inventory.GetItemCount(Assets.AffixOrangeItemIndex);
             if (itemCount > 0)
             {
                 equipmentEliteIndex = EliteAspectsChanges.AffixOrangeIndex;
             }
         }
         RoR2.CharacterModel characterModelFromCharacterBody = CloudUtils.GetCharacterModelFromCharacterBody(self);
         if (equipmentEliteIndex == EliteAspectsChanges.AffixOrangeIndex && !self.gameObject.GetComponent <DestroyEffectOnBuffEnd>() && characterModelFromCharacterBody)
         {
             DestroyEffectOnBuffEnd destroyEffectOnBuffEnd = self.gameObject.AddComponent <DestroyEffectOnBuffEnd>();
             destroyEffectOnBuffEnd.body = self;
             destroyEffectOnBuffEnd.buff = EliteAspectsChanges.AffixOrangeBuff;
             RoR2.TemporaryOverlay temporaryOverlay = characterModelFromCharacterBody.gameObject.AddComponent <RoR2.TemporaryOverlay>();
             temporaryOverlay.duration              = float.PositiveInfinity;
             temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
             temporaryOverlay.animateShaderAlpha    = true;
             temporaryOverlay.destroyComponentOnEnd = true;
             temporaryOverlay.originalMaterial      = Cloudburst.Cores.AssetsCore.mainAssetBundle.LoadAsset <Material>("Assets/Cloudburst/753network/Crystallize/Ruby.mat");
             temporaryOverlay.AddToCharacerModel(characterModelFromCharacterBody);
             destroyEffectOnBuffEnd.effect = temporaryOverlay;
         }
     }
 }
 // Token: 0x060016AA RID: 5802 RVA: 0x0006C0DC File Offset: 0x0006A2DC
 public static void AddTPOutEffect(CharacterModel characterModel, float beginAlpha, float endAlpha, float duration)
 {
     if (characterModel)
     {
         TemporaryOverlay temporaryOverlay = characterModel.gameObject.AddComponent <TemporaryOverlay>();
         temporaryOverlay.duration              = duration;
         temporaryOverlay.animateShaderAlpha    = true;
         temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, beginAlpha, 1f, endAlpha);
         temporaryOverlay.destroyComponentOnEnd = true;
         temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matTPInOut");
         temporaryOverlay.AddToCharacerModel(characterModel);
     }
 }
Exemple #4
0
 private void VoidheartOverlayManager(On.RoR2.CharacterBody.orig_FixedUpdate orig, RoR2.CharacterBody self)
 {
     if (self.modelLocator && self.modelLocator.modelTransform && self.HasBuff(VoidInstabilityDebuff) && !self.GetComponent <VoidheartCooldown>())
     {
         var Meshes = Voidheart.ItemBodyModelPrefab.GetComponentsInChildren <MeshRenderer>();
         RoR2.TemporaryOverlay overlay = self.modelLocator.modelTransform.gameObject.AddComponent <RoR2.TemporaryOverlay>();
         overlay.duration              = voidHeartCooldownDebuffDuration;
         overlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
         overlay.animateShaderAlpha    = true;
         overlay.destroyComponentOnEnd = true;
         overlay.originalMaterial      = Meshes[0].material;
         overlay.AddToCharacerModel(self.modelLocator.modelTransform.GetComponent <RoR2.CharacterModel>());
         var VoidheartCooldownTracker = self.gameObject.AddComponent <Voidheart.VoidheartCooldown>();
         VoidheartCooldownTracker.Overlay = overlay;
         VoidheartCooldownTracker.Body    = self;
     }
     orig(self);
 }
Exemple #5
0
        public CharacterMaster OpenSummonReturnMaster(Interactor activator)
        {
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'RoR2.CharacterMaster RoR2.SummonMasterBehavior::OpenSummonReturnMaster(RoR2.Interactor)' called on client");
                return(null);
            }
            float           d = 0f;
            CharacterMaster characterMaster = new MasterSummon
            {
                masterPrefab          = this.masterPrefab,
                position              = base.transform.position + Vector3.up * d,
                rotation              = base.transform.rotation,
                summonerBodyObject    = ((activator != null) ? activator.gameObject : null),
                ignoreTeamMemberLimit = true
            }.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>());
                    }
                }
            }
            if (this.destroyAfterSummoning)
            {
                UnityEngine.Object.Destroy(base.gameObject);
            }
            return(characterMaster);
        }
Exemple #6
0
 internal static void HookSetup()
 {
     On.RoR2.CharacterBody.RecalculateStats += delegate(On.RoR2.CharacterBody.orig_RecalculateStats orig, RoR2.CharacterBody self)
     {
         orig(self);
         bool flag = self && self.HasBuff(Buffs.TemplArmorBuff);
         if (flag)
         {
             self.SetPropertyValue("armor", self.armor + 50f);
         }
         bool flag2 = self && self.HasBuff(Buffs.TemplarstationaryArmorBuff);
         if (flag2)
         {
             self.SetPropertyValue("armor", self.armor + 100f);
         }
         bool flag3 = self && self.HasBuff(Buffs.TemplarOverdriveBuff);
         if (flag3)
         {
             self.SetPropertyValue("regen", self.regen * 12f);
             self.SetPropertyValue("attackSpeed", self.attackSpeed * 1.5f);
         }
         bool flag4 = self && self.HasBuff(Buffs.TemplarigniteDebuff);
         if (flag4)
         {
             self.SetPropertyValue("armor", self.armor - 45f);
             self.SetPropertyValue("moveSpeed", self.moveSpeed * 0.8f);
         }
     };
     On.RoR2.HealthComponent.TakeDamage += delegate(On.RoR2.HealthComponent.orig_TakeDamage orig, RoR2.HealthComponent self, RoR2.DamageInfo di)
     {
         orig(self, di);
         bool flag = di.inflictor != null && self != null && di.attacker != null && di.attacker.GetComponent <RoR2.CharacterBody>() != null && di.attacker.GetComponent <RoR2.CharacterBody>().baseNameToken == "Templar_Survivor" && di.damageType.HasFlag(DamageType.BypassOneShotProtection) && self.GetComponent <RoR2.CharacterBody>().HasBuff(RoR2.RoR2Content.Buffs.ClayGoo) && !self.GetComponent <RoR2.CharacterBody>().HasBuff(Buffs.TemplarigniteDebuff);
         if (flag)
         {
             self.GetComponent <RoR2.CharacterBody>().AddTimedBuff(Buffs.TemplarigniteDebuff, 12f);
             bool flag2 = self.GetComponent <RoR2.CharacterBody>().modelLocator;
             bool flag3 = flag2;
             if (flag3)
             {
                 Transform modelTransform = self.GetComponent <RoR2.CharacterBody>().modelLocator.modelTransform;
                 bool      flag4          = modelTransform.GetComponent <RoR2.CharacterModel>();
                 bool      flag5          = flag4;
                 if (flag5)
                 {
                     RoR2.TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <RoR2.TemporaryOverlay>();
                     temporaryOverlay.duration              = 16f;
                     temporaryOverlay.animateShaderAlpha    = true;
                     temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                     temporaryOverlay.destroyComponentOnEnd = true;
                     temporaryOverlay.originalMaterial      = LegacyResourcesAPI.Load <Material>("Materials/matDoppelganger");
                     temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <RoR2.CharacterModel>());
                 }
                 RoR2.BlastAttack blastAttack = new RoR2.BlastAttack
                 {
                     attacker        = di.inflictor,
                     inflictor       = di.inflictor,
                     teamIndex       = TeamIndex.Player,
                     baseForce       = 0f,
                     position        = self.transform.position,
                     radius          = 12f,
                     falloffModel    = RoR2.BlastAttack.FalloffModel.None,
                     crit            = di.crit,
                     baseDamage      = di.damage * 0.2f,
                     procCoefficient = di.procCoefficient
                 };
                 blastAttack.damageType |= DamageType.Stun1s;
                 blastAttack.Fire();
                 RoR2.BlastAttack blastAttack2 = new RoR2.BlastAttack
                 {
                     attacker        = di.inflictor,
                     inflictor       = di.inflictor,
                     teamIndex       = TeamIndex.Player,
                     baseForce       = 0f,
                     position        = self.transform.position,
                     radius          = 16f,
                     falloffModel    = RoR2.BlastAttack.FalloffModel.None,
                     crit            = false,
                     baseDamage      = 0f,
                     procCoefficient = 0f,
                     damageType      = DamageType.BypassOneShotProtection
                 };
                 blastAttack2.Fire();
                 RoR2.EffectManager.SpawnEffect(LegacyResourcesAPI.Load <GameObject>("Prefabs/Effects/ImpactEffects/MagmaOrbExplosion"), new RoR2.EffectData
                 {
                     origin = self.transform.position,
                     scale  = 16f
                 }, true);
             }
         }
     };
 }
Exemple #7
0
        // Token: 0x06000D25 RID: 3365 RVA: 0x000412A8 File Offset: 0x0003F4A8
        private void UpdateOverlays()
        {
            for (int i = 0; i < this.overlaysCount; i++)
            {
                this.currentOverlays[i] = null;
            }
            this.overlaysCount = 0;
            if (this.visibility == VisibilityLevel.Invisible)
            {
                return;
            }
            EliteIndex eliteIndex = EliteCatalog.IsEquipmentElite(this.inventoryEquipmentIndex);

            this.myEliteIndex = (int)eliteIndex;
            if (this.myEliteIndex >= 0)
            {
                if (this.body)
                {
                    AkSoundEngine.SetRTPCValue("eliteEnemy", 1f, this.body.gameObject);
                }
            }
            else if (this.body)
            {
                AkSoundEngine.SetRTPCValue("eliteEnemy", 0f, this.body.gameObject);
            }
            if (this.body)
            {
                bool      flag      = this.body.HasBuff(BuffIndex.ClayGoo);
                Inventory inventory = this.body.inventory;
                this.isGhost = (inventory != null && inventory.GetItemCount(ItemIndex.Ghost) > 0);
                if (this.body.HasBuff(BuffIndex.RepairMode))
                {
                    Material[] array = this.currentOverlays;
                    int        j     = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array[j]           = CharacterModel.repairModeMaterial;
                }
                if (this.body.HasBuff(BuffIndex.AttackSpeedOnCrit))
                {
                    Material[] array2 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array2[j]          = CharacterModel.wolfhatMaterial;
                }
                if (this.body.healthComponent && this.body.healthComponent.shield > 0f)
                {
                    Material[] array3 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array3[j]          = CharacterModel.energyShieldMaterial;
                }
                if (this.body.HasBuff(BuffIndex.FullCrit))
                {
                    Material[] array4 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array4[j]          = CharacterModel.fullCritMaterial;
                }
                if (this.body.HasBuff(BuffIndex.BeetleJuice))
                {
                    Material[] array5 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array5[j]          = CharacterModel.beetleJuiceMaterial;
                }
                if (this.body.HasBuff(BuffIndex.Immune))
                {
                    Material[] array6 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array6[j]          = CharacterModel.immuneMaterial;
                }
                if (this.body.HasBuff(BuffIndex.Slow80))
                {
                    Material[] array7 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array7[j]          = CharacterModel.slow80Material;
                }
                if (this.body.HasBuff(BuffIndex.Invincibility))
                {
                    Material[] array8 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array8[j]          = CharacterModel.bellBuffMaterial;
                }
                if (flag)
                {
                    Material[] array9 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array9[j]          = CharacterModel.clayGooMaterial;
                }
                if (this.body.inventory && this.body.inventory.GetItemCount(ItemIndex.LunarDagger) > 0)
                {
                    Material[] array10 = this.currentOverlays;
                    int        j       = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array10[j]         = CharacterModel.brittleMaterial;
                }
                if (this.isGhost)
                {
                    Material[] array11 = this.currentOverlays;
                    int        j       = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array11[j]         = CharacterModel.ghostMaterial;
                }
                if (this.body.equipmentSlot)
                {
                    if (this.body.equipmentSlot.equipmentIndex == EquipmentIndex.AffixGold)
                    {
                        if (!this.goldAffixEffect)
                        {
                            this.goldAffixEffect = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/GoldAffixEffect"), base.transform);
                            ParticleSystem      component           = this.goldAffixEffect.GetComponent <ParticleSystem>();
                            SkinnedMeshRenderer skinnedMeshRenderer = null;
                            foreach (CharacterModel.RendererInfo rendererInfo in this.rendererInfos)
                            {
                                if (rendererInfo.renderer is SkinnedMeshRenderer)
                                {
                                    skinnedMeshRenderer = (SkinnedMeshRenderer)rendererInfo.renderer;
                                    break;
                                }
                            }
                            ParticleSystem.ShapeModule shape = component.shape;
                            if (skinnedMeshRenderer)
                            {
                                shape.shapeType           = ParticleSystemShapeType.SkinnedMeshRenderer;
                                shape.skinnedMeshRenderer = skinnedMeshRenderer;
                            }
                        }
                    }
                    else if (this.goldAffixEffect)
                    {
                        UnityEngine.Object.Destroy(this.goldAffixEffect);
                    }
                }
                if (this.wasPreviouslyClayGooed && !flag)
                {
                    TemporaryOverlay temporaryOverlay = base.gameObject.AddComponent <TemporaryOverlay>();
                    temporaryOverlay.duration              = 0.6f;
                    temporaryOverlay.animateShaderAlpha    = true;
                    temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                    temporaryOverlay.destroyComponentOnEnd = true;
                    temporaryOverlay.originalMaterial      = CharacterModel.clayGooMaterial;
                    temporaryOverlay.AddToCharacerModel(this);
                }
                this.wasPreviouslyClayGooed = this.body.HasBuff(BuffIndex.ClayGoo);
            }
            for (int k = 0; k < this.temporaryOverlays.Count; k++)
            {
                Material[] array13 = this.currentOverlays;
                int        j       = this.overlaysCount;
                this.overlaysCount = j + 1;
                array13[j]         = this.temporaryOverlays[k].materialInstance;
            }
            this.materialsDirty = true;
        }