示例#1
0
        private void Main_FirstFrame1()
        {
            foreach (var effect in skinnedEffects)
            {
                var ind = EffectCatalog.FindEffectIndexFromPrefab(effect);
                if (ind == EffectIndex.Invalid)
                {
                    Main.LogE("Invalid effect: " + effect.name);
                    continue;
                }

                skinnedEffectCache[ind] = new Dictionary <UInt32, EffectDef>();
            }

            foreach (var projectile in skinnedProjectiles)
            {
                var ind = ProjectileCatalog.GetProjectileIndex(projectile);
                if (ind == -1)
                {
                    Main.LogE("Invalid projectile: " + projectile.name);
                    continue;
                }

                skinnedGhostCache[ind] = new Dictionary <UInt32, GameObject>();
            }
        }
示例#2
0
        protected BlastAttack.Result DetonateAuthority()
        {
            Vector3 footPosition = base.characterBody.footPosition;

            EffectManager.SpawnEffect(this.blastEffectPrefab, new EffectData
            {
                origin = footPosition,
                scale  = BaseLeap.blastRadius
            }, true);
            return(new BlastAttack
            {
                attacker = base.gameObject,
                baseDamage = this.damageStat * this.blastDamageCoefficient,
                baseForce = this.blastForce,
                bonusForce = this.blastBonusForce,
                crit = this.isCritAuthority,
                damageType = this.GetBlastDamageType(),
                falloffModel = BlastAttack.FalloffModel.None,
                procCoefficient = BaseLeap.blastProcCoefficient,
                radius = BaseLeap.blastRadius,
                position = footPosition,
                attackerFiltering = AttackerFiltering.NeverHit,
                impactEffect = EffectCatalog.FindEffectIndexFromPrefab(this.blastImpactEffectPrefab),
                teamIndex = base.teamComponent.teamIndex
            }.Fire());
        }
示例#3
0
        public unsafe override void Begin()
        {
            this.currentlyInside = HashSetPool <HealthComponent> .item;
            this.timers          = DictionaryPool <HealthComponent, Single> .item;

            Single *ptr     = stackalloc Single[1];
            var     trigger = new SphereTriggerCallbackProvider <Callbacks>();
            var     data    = new EffectData();

            this.damageMult   = this.boost * this.power;
            trigger.cb.orb    = this;
            data.genericFloat = trigger.cb.maxDuration = this.duration *= this.boost;
            data.origin       = trigger.cb.origin = this.origin;
            data.scale        = trigger.cb.minRadius = minRadius;
            ptr[0]            = trigger.cb.maxRadius = maxRadius * this.boost;
            data.genericUInt  = *((UInt32 *)ptr);
            trigger.Start();

            if (orbEffect == EffectIndex.Invalid)
            {
                orbEffect = EffectCatalog.FindEffectIndexFromPrefab(VFXModule.GetSporeOrbPrefab());
            }
            EffectManager.SpawnEffect(orbEffect, data, true);
            base.Begin();
        }
示例#4
0
 protected void DetonateAuthority()
 {
     if (base.isAuthority)
     {
         Vector3 footPosition = base.characterBody.footPosition;
         EffectManager.SpawnEffect(GroundSlam.blastEffectPrefab, new EffectData
         {
             origin = footPosition,
             scale  = this.bonusMultiplier
         }, true);
         new BlastAttack
         {
             attacker          = base.gameObject,
             baseDamage        = this.damageStat * damageCoefficient,
             baseForce         = GroundSlam.blastForce / 2,
             bonusForce        = GroundSlam.blastBonusForce / 2,
             crit              = base.RollCrit(),
             damageType        = DamageType.Generic,
             falloffModel      = BlastAttack.FalloffModel.Linear,
             procCoefficient   = procCoefficient,
             radius            = this.bonusMultiplier * 5f,
             position          = footPosition,
             attackerFiltering = AttackerFiltering.NeverHitSelf,
             impactEffect      = EffectCatalog.FindEffectIndexFromPrefab(GroundSlam.blastImpactEffectPrefab),
             teamIndex         = base.teamComponent.teamIndex
         }.Fire();
     }
 }
示例#5
0
 private void FireSpike(Vector3 origin, Quaternion rotation)
 {
     if (base.isAuthority)
     {
         EffectManager.SpawnEffect(Assets.drillPopEffect, new EffectData
         {
             origin   = origin,
             rotation = rotation,
             scale    = this.bonusMultiplier
         }, true);
         new BlastAttack
         {
             attacker          = base.gameObject,
             baseDamage        = this.damageStat * damageCoefficient,
             baseForce         = GroundSlam.blastForce / 2,
             bonusForce        = GroundSlam.blastBonusForce / 2,
             crit              = base.RollCrit(),
             damageType        = DamageType.BypassArmor,
             falloffModel      = BlastAttack.FalloffModel.None,
             procCoefficient   = procCoefficient,
             radius            = this.bonusMultiplier * 5f,
             position          = origin,
             attackerFiltering = AttackerFiltering.NeverHitSelf,
             impactEffect      = EffectCatalog.FindEffectIndexFromPrefab(GroundSlam.blastImpactEffectPrefab),
             teamIndex         = base.teamComponent.teamIndex
         }.Fire();
     }
 }
示例#6
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();
                }
            }
        }
示例#7
0
        private void SpawnEffect___void_EffectIndex_EffectData_Boolean_Il(ILContext il)
        {
            ILCursor c = new ILCursor(il);

            c.GotoNext(MoveType.Before, x => x.MatchCall(typeof(RoR2.EffectCatalog), "GetEffectDef"));
            c.Remove();
            c.Emit(OpCodes.Ldarg_1);
            c.EmitDelegate <Func <EffectIndex, EffectData, EffectDef> >((index, data) =>
            {
                if (skinnedEffectCache.ContainsKey(index))
                {
                    var cache   = skinnedEffectCache[index];
                    var skinInd = data.genericUInt;
                    if (cache.ContainsKey(skinInd))
                    {
                        return(cache[skinInd]);
                    }
                    else
                    {
                        var origDef        = EffectCatalog.GetEffectDef(index);
                        var skinnedPrefab  = origDef.prefab.ClonePrefab("CachedEffect", false);
                        var skinController = skinnedPrefab.GetComponent <BitSkinController>();
                        skinController.Apply(WispBitSkin.GetWispSkin(skinInd));
                        Destroy(skinController);
                        var newDef = new EffectDef()
                        {
                            cullMethod            = origDef.cullMethod,
                            index                 = index,
                            prefab                = skinnedPrefab,
                            prefabEffectComponent = skinnedPrefab.GetComponent <EffectComponent>(),
                            prefabName            = origDef.prefabName,
                            prefabVfxAttributes   = skinnedPrefab.GetComponent <VFXAttributes>(),
                            spawnSoundEventName   = origDef.spawnSoundEventName
                        };


                        cache[skinInd] = newDef;
                        return(newDef);
                    }
                }
                else
                {
                    return(EffectCatalog.GetEffectDef(index));
                }
            });
        }
        // 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();
            }
        }