Esempio n. 1
0
        private void Explode()
        {
            if (!this.hasExploded)
            {
                this.hasExploded = true;

                BlastAttack blastAttack = new BlastAttack();
                blastAttack.radius            = 8f;
                blastAttack.procCoefficient   = 1f;
                blastAttack.position          = base.characterBody.corePosition + (0.5f * base.characterDirection.forward) + (Vector3.up * -0.25f);
                blastAttack.attacker          = null;
                blastAttack.crit              = base.RollCrit();
                blastAttack.baseDamage        = base.characterBody.damage * 100f;
                blastAttack.falloffModel      = BlastAttack.FalloffModel.SweetSpot;
                blastAttack.baseForce         = 8000f;
                blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                blastAttack.damageType        = DamageType.BypassOneShotProtection;
                blastAttack.attackerFiltering = AttackerFiltering.AlwaysHit;
                blastAttack.Fire();

                EffectData effectData = new EffectData();
                effectData.origin = base.characterBody.footPosition;
                effectData.scale  = 32;

                EffectManager.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/OmniEffect/OmniExplosionVFX"), effectData, false);
                Util.PlaySound(DiggerPlugin.Sounds.ToTheStarsExplosion, base.gameObject);
            }
        }
Esempio n. 2
0
 public override void FixedUpdate()
 {
     base.FixedUpdate();
     if ((bool)modelAnimator && modelAnimator.GetFloat("Slam.hitBoxActive") > 0.5f && !hasAttacked)
     {
         if (base.isAuthority)
         {
             if ((bool)base.characterDirection)
             {
                 base.characterDirection.moveVector = base.characterDirection.forward;
             }
             if ((bool)modelTransform)
             {
                 Transform transform = FindModelChild("SlamZone");
                 if ((bool)transform)
                 {
                     attack            = new BlastAttack();
                     attack.attacker   = base.gameObject;
                     attack.inflictor  = base.gameObject;
                     attack.teamIndex  = TeamComponent.GetObjectTeam(base.gameObject);
                     attack.baseDamage = damageStat * damageCoefficient;
                     attack.baseForce  = forceMagnitude;
                     attack.position   = transform.position;
                     attack.radius     = radius;
                     attack.Fire();
                 }
             }
         }
         hasAttacked = true;
     }
     if (base.fixedAge >= duration / attackSpeedStat && base.isAuthority)
     {
         outer.SetNextStateToMain();
     }
 }
Esempio n. 3
0
 public ItemExplosiveModel(Gameplay.GameItems.IDs _id, string aName, string theNames, string imageID, int fuseDelay, BlastAttack attack, string blastImageID, string flavor)
     : base(_id, aName, theNames, imageID, flavor, DollPart.RIGHT_HAND)
 {
     FuseDelay  = fuseDelay;
     m_Attack   = attack;
     BlastImage = blastImageID;
 }
Esempio n. 4
0
        // Token: 0x06002BC9 RID: 11209 RVA: 0x000B92A8 File Offset: 0x000B74A8
        protected override void Pulse()
        {
            BlastAttack blastAttack = new BlastAttack
            {
                baseDamage       = 0f,
                baseForce        = 0f,
                attacker         = (base.projectileController ? base.projectileController.owner : null),
                inflictor        = base.gameObject,
                bonusForce       = Vector3.zero,
                canHurtAttacker  = false,
                crit             = false,
                damageColorIndex = DamageColorIndex.Default,
                damageType       = DamageType.Stun1s,
                falloffModel     = BlastAttack.FalloffModel.None,
                procChainMask    = default(ProcChainMask),
                position         = base.transform.position,
                procCoefficient  = 0f,
                teamIndex        = (base.projectileController ? base.projectileController.teamFilter.teamIndex : TeamIndex.None),
                radius           = this.pulseRadius
            };

            blastAttack.Fire();
            EffectData effectData = new EffectData();

            effectData.origin = blastAttack.position;
            effectData.scale  = blastAttack.radius;
            EffectManager.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/ExplosionVFX"), effectData, true);
        }
Esempio n. 5
0
        private void FireShockwave()
        {
            if (this.hasFiredShockwave)
            {
                return;
            }
            this.hasFiredShockwave = true;

            if (EntityStates.GrandParentBoss.SpawnState.spawnEffect)
            {
                EffectManager.SimpleMuzzleFlash(Resources.Load <GameObject>("prefabs/effects/impacteffects/GrandparentDeathEffect"), base.gameObject, "HandR", false);
            }

            if (base.isAuthority)
            {
                BlastAttack blastAttack = new BlastAttack();
                blastAttack.attacker          = base.gameObject;
                blastAttack.inflictor         = base.gameObject;
                blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                blastAttack.position          = base.characterBody.corePosition;
                blastAttack.procCoefficient   = 0f;
                blastAttack.radius            = GigaImpact.blastAttackRadius;
                blastAttack.baseForce         = GigaImpact.blastAttackForce;
                blastAttack.bonusForce        = Vector3.up * GigaImpact.blastAttackBonusForce;
                blastAttack.baseDamage        = GigaImpact.blastAttackDamageCoefficient * this.damageStat;
                blastAttack.falloffModel      = BlastAttack.FalloffModel.Linear;
                blastAttack.damageColorIndex  = DamageColorIndex.Item;
                blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                blastAttack.Fire();
            }
        }
 private void On_CMOnHitGround(On.RoR2.CharacterMotor.orig_OnHitGround orig, CharacterMotor self, CharacterMotor.HitGroundInfo ghi)
 {
     orig(self, ghi);
     if (!self.body)
     {
         return;
     }
     if (GetCount(self.body) > 0 && Math.Abs(ghi.velocity.y) > velThreshold)
     {
         float scalefac = Mathf.Lerp(0f, baseDamage + (GetCount(self.body) - 1f) * stackDamage,
                                     Mathf.InverseLerp(velThreshold, velMax + velThreshold, Math.Abs(ghi.velocity.y)));
         //most properties borrowed from H3AD-5T v2
         BlastAttack blastAttack = new BlastAttack {
             attacker          = self.body.gameObject,
             inflictor         = self.body.gameObject,
             teamIndex         = TeamComponent.GetObjectTeam(self.body.gameObject),
             position          = ghi.position,
             procCoefficient   = 0.5f,
             radius            = 10f,
             baseForce         = 2000f,
             bonusForce        = Vector3.up * 2000f,
             baseDamage        = self.body.damage * scalefac,
             falloffModel      = BlastAttack.FalloffModel.SweetSpot,
             crit              = Util.CheckRoll(self.body.crit, self.body.master),
             damageColorIndex  = DamageColorIndex.Item,
             attackerFiltering = AttackerFiltering.NeverHit
         };
         blastAttack.Fire();
         EffectData effectData = new EffectData {
             origin = ghi.position,
             scale  = 10f
         };
         EffectManager.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/BootShockwave"), effectData, true);
     }
 }
Esempio n. 7
0
        private void FireShockwave()
        {
            Util.PlaySound("HenryFrenzyShockwave", base.gameObject);

            EffectData effectData = new EffectData();

            effectData.origin = base.characterBody.corePosition;
            effectData.scale  = 1;

            //EffectManager.SpawnEffect(Modules.Assets.frenzyShockwaveEffect, effectData, false);

            if (base.isAuthority)
            {
                BlastAttack blastAttack = new BlastAttack();
                blastAttack.attacker          = base.gameObject;
                blastAttack.inflictor         = base.gameObject;
                blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                blastAttack.position          = base.characterBody.corePosition;
                blastAttack.procCoefficient   = 0f;
                blastAttack.radius            = RageEnterOut.shockwaveRadius;
                blastAttack.baseForce         = RageEnterOut.shockwaveForce;
                blastAttack.bonusForce        = Vector3.up * RageEnterOut.shockwaveBonusForce;
                blastAttack.baseDamage        = 0f;
                blastAttack.falloffModel      = BlastAttack.FalloffModel.None;
                blastAttack.damageColorIndex  = DamageColorIndex.Item;
                blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                blastAttack.Fire();
            }

            if (this.rageController)
            {
                this.rageController.EnterBerserk();
            }
        }
Esempio n. 8
0
        private void Fire()
        {
            if (this.hasFired)
            {
                return;
            }
            this.hasFired = true;

            Util.PlaySound("Play_parent_attack1_slam", base.gameObject);
            if (EntityStates.BeetleGuardMonster.GroundSlam.slamEffectPrefab)
            {
                EffectManager.SimpleMuzzleFlash(EntityStates.BeetleGuardMonster.GroundSlam.slamEffectPrefab, base.gameObject, "HandR", false);
            }

            this.flashController.Flash();

            if (base.isAuthority)
            {
                BlastAttack blastAttack = new BlastAttack();
                blastAttack.attacker          = base.gameObject;
                blastAttack.inflictor         = base.gameObject;
                blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                blastAttack.position          = base.FindModelChild("HandR").position;
                blastAttack.procCoefficient   = 0f;
                blastAttack.radius            = GigaImpact.impactAttackRadius;
                blastAttack.baseForce         = GigaImpact.impactAttackForce;
                blastAttack.bonusForce        = Vector3.up * GigaImpact.impactAttackBonusForce;
                blastAttack.baseDamage        = GigaImpact.impactAttackDamageCoefficient * this.damageStat;
                blastAttack.falloffModel      = BlastAttack.FalloffModel.SweetSpot;
                blastAttack.damageColorIndex  = DamageColorIndex.Item;
                blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                blastAttack.Fire();
            }
        }
 // Token: 0x06002D84 RID: 11652 RVA: 0x000C1058 File Offset: 0x000BF258
 public override void OnEnter()
 {
     base.OnEnter();
     Util.PlaySound(FlyUpState.beginSoundString, base.gameObject);
     this.modelTransform = base.GetModelTransform();
     this.flyVector      = Vector3.up;
     this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject));
     base.PlayCrossfade("Body", "FlyUp", "FlyUp.playbackRate", FlyUpState.duration, 0.1f);
     base.characterMotor.Motor.ForceUnground();
     base.characterMotor.velocity = Vector3.zero;
     EffectManager.SimpleMuzzleFlash(FlyUpState.muzzleflashEffect, base.gameObject, "MuzzleLeft", false);
     EffectManager.SimpleMuzzleFlash(FlyUpState.muzzleflashEffect, base.gameObject, "MuzzleRight", false);
     if (base.isAuthority)
     {
         this.blastPosition = base.characterBody.corePosition;
     }
     if (NetworkServer.active)
     {
         BlastAttack blastAttack = new BlastAttack();
         blastAttack.radius          = FlyUpState.blastAttackRadius;
         blastAttack.procCoefficient = FlyUpState.blastAttackProcCoefficient;
         blastAttack.position        = this.blastPosition;
         blastAttack.attacker        = base.gameObject;
         blastAttack.crit            = Util.CheckRoll(base.characterBody.crit, base.characterBody.master);
         blastAttack.baseDamage      = base.characterBody.damage * FlyUpState.blastAttackDamageCoefficient;
         blastAttack.falloffModel    = BlastAttack.FalloffModel.SweetSpot;
         blastAttack.baseForce       = FlyUpState.blastAttackForce;
         blastAttack.teamIndex       = TeamComponent.GetObjectTeam(blastAttack.attacker);
         blastAttack.damageType      = DamageType.Stun1s;
         blastAttack.Fire();
     }
 }
Esempio n. 10
0
        public override void OnExit()
        {
            EffectData effectData = new EffectData();

            effectData.origin = this.swordController.sunPosition;

            EffectManager.SpawnEffect(Resources.Load <GameObject>("prefabs/effects/impacteffects/GrandparentSpawnImpact"), effectData, false);
            EffectManager.SpawnEffect(Resources.Load <GameObject>("prefabs/effects/ClayBossDeath"), effectData, false);

            if (base.isAuthority)
            {
                BlastAttack blastAttack = new BlastAttack();
                blastAttack.attacker          = base.gameObject;
                blastAttack.inflictor         = base.gameObject;
                blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                blastAttack.position          = this.swordController.sunPosition;
                blastAttack.procCoefficient   = ScepterCastCruelSun.flareProcCoefficient;
                blastAttack.radius            = ScepterCastCruelSun.flareRadius;
                blastAttack.baseForce         = ScepterCastCruelSun.flareForce;
                blastAttack.bonusForce        = Vector3.zero;
                blastAttack.baseDamage        = ScepterCastCruelSun.flareDamageCoefficient * this.damageStat;
                blastAttack.falloffModel      = BlastAttack.FalloffModel.Linear;
                blastAttack.damageColorIndex  = DamageColorIndex.Item;
                blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                blastAttack.Fire();
            }

            base.OnExit();

            base.PlayAnimation("Gesture, Override", "CastSunEnd", "Spell.playbackRate", 1.5f);
        }
Esempio n. 11
0
        private void LandingImpact()
        {
            base.characterMotor.velocity *= 0.1f;

            BlastAttack blastAttack = new BlastAttack();

            blastAttack.radius            = PeoplesElbow.slamRadius;
            blastAttack.procCoefficient   = PeoplesElbow.slamProcCoefficient;
            blastAttack.position          = base.characterBody.footPosition;
            blastAttack.attacker          = base.gameObject;
            blastAttack.crit              = base.RollCrit();
            blastAttack.baseDamage        = base.characterBody.damage * PeoplesElbow.slamDamageCoefficient;
            blastAttack.falloffModel      = BlastAttack.FalloffModel.SweetSpot;
            blastAttack.baseForce         = PeoplesElbow.slamForce;
            blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
            blastAttack.damageType        = DamageType.Stun1s;
            blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
            blastAttack.Fire();

            EffectManager.SpawnEffect(EntityStates.LemurianBruiserMonster.SpawnState.spawnEffectPrefab, new EffectData
            {
                origin = base.characterBody.footPosition,
                scale  = 4f
            }, true);
        }
Esempio n. 12
0
 // Token: 0x06002D99 RID: 11673 RVA: 0x000C1638 File Offset: 0x000BF838
 public override void OnExit()
 {
     EffectManager.SimpleMuzzleFlash(ChargeMeteor.muzzleflashEffect, base.gameObject, "Muzzle", false);
     if (this.areaIndicatorInstance)
     {
         if (this.fireMeteor)
         {
             float num = Util.Remap(Mathf.Clamp01(this.stopwatch / this.chargeDuration), 0f, 1f, ChargeMeteor.minDamageCoefficient, ChargeMeteor.maxDamageCoefficient);
             EffectManager.SpawnEffect(ChargeMeteor.meteorEffect, new EffectData
             {
                 origin = this.areaIndicatorInstance.transform.position,
                 scale  = this.radius
             }, true);
             BlastAttack blastAttack = new BlastAttack();
             blastAttack.radius          = this.radius;
             blastAttack.procCoefficient = ChargeMeteor.procCoefficient;
             blastAttack.position        = this.areaIndicatorInstance.transform.position;
             blastAttack.attacker        = base.gameObject;
             blastAttack.crit            = Util.CheckRoll(base.characterBody.crit, base.characterBody.master);
             blastAttack.baseDamage      = base.characterBody.damage * num;
             blastAttack.falloffModel    = BlastAttack.FalloffModel.SweetSpot;
             blastAttack.baseForce       = ChargeMeteor.force;
             blastAttack.teamIndex       = TeamComponent.GetObjectTeam(blastAttack.attacker);
             blastAttack.Fire();
         }
         EntityState.Destroy(this.areaIndicatorInstance.gameObject);
     }
     base.OnExit();
 }
Esempio n. 13
0
        private void FireBlast()
        {
            base.PlayAnimation("FullBody, Override", "BufferEmpty");
            Util.PlayAttackSpeedSound(DiggerPlugin.Sounds.ToTheStarsExplosion, base.gameObject, 0.5f);

            if (base.isAuthority)
            {
                BlastAttack blastAttack = new BlastAttack();
                blastAttack.radius            = 20f;
                blastAttack.procCoefficient   = 1f;
                blastAttack.position          = base.characterBody.footPosition;
                blastAttack.attacker          = base.gameObject;
                blastAttack.crit              = base.RollCrit();
                blastAttack.baseDamage        = base.characterBody.damage * FallingComet.blastDamageCoefficient;
                blastAttack.falloffModel      = BlastAttack.FalloffModel.Linear;
                blastAttack.baseForce         = 2000f;
                blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                blastAttack.damageType        = DamageType.PercentIgniteOnHit;
                blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                blastAttack.Fire();

                EffectData effectData = new EffectData();
                effectData.origin = base.characterBody.footPosition;
                effectData.scale  = 20;

                EffectManager.SpawnEffect(DiggerPlugin.DiggerPlugin.backblastEffect, effectData, false);
            }
        }
 public ItemExplosiveModel(string aName, string theNames, string imageID, int fuseDelay, BlastAttack attack, string blastImageID)
     : base(aName, theNames, imageID)
 {
     m_FuseDelay    = fuseDelay;
     m_Attack       = attack;
     m_BlastImageID = blastImageID;
 }
Esempio n. 15
0
 // Token: 0x06000571 RID: 1393 RVA: 0x00018B50 File Offset: 0x00016D50
 public override void FixedUpdate()
 {
     base.FixedUpdate();
     this.stopwatch += Time.fixedDeltaTime;
     if (this.stopwatch >= this.startDuration && !this.hasCastNova)
     {
         this.hasCastNova = true;
         EffectManager.instance.SpawnEffect(IceNova.novaEffectPrefab, new EffectData
         {
             origin = base.transform.position,
             scale  = IceNova.novaRadius
         }, true);
         BlastAttack blastAttack = new BlastAttack();
         blastAttack.radius          = IceNova.novaRadius;
         blastAttack.procCoefficient = IceNova.procCoefficient;
         blastAttack.position        = base.transform.position;
         blastAttack.attacker        = base.gameObject;
         blastAttack.crit            = Util.CheckRoll(base.characterBody.crit, base.characterBody.master);
         blastAttack.baseDamage      = base.characterBody.damage * IceNova.damageCoefficient;
         blastAttack.falloffModel    = BlastAttack.FalloffModel.None;
         blastAttack.damageType      = DamageType.Freeze2s;
         blastAttack.baseForce       = IceNova.force;
         blastAttack.teamIndex       = TeamComponent.GetObjectTeam(blastAttack.attacker);
         blastAttack.Fire();
     }
     if (this.stopwatch >= this.startDuration + this.endDuration && base.isAuthority)
     {
         this.outer.SetNextStateToMain();
         return;
     }
 }
Esempio n. 16
0
        public override void ElementBurst()
        {
            base.ElementBurst();

            BlastAttack blastAttack = MakeBlastAttack();

            blastAttack.Fire();
        }
        public override void ElementBurst()
        {
            base.ElementBurst();

            BlastAttack blastAttack = MakeBlastAttack();

            FireLightningBurst(blastAttack.crit, blastAttack.baseDamage);
            blastAttack.Fire();
        }
Esempio n. 18
0
        public override void FixedUpdate()
        {
            base.FixedUpdate();

            if (base.isAuthority && base.inputBank && base.skillLocator && base.skillLocator.utility.IsReady() && base.inputBank.skill3.justPressed)
            {
                base.skillLocator.utility.ExecuteIfReady();
                return;
            }

            if (this.modelAnimator)
            {
                if (base.fixedAge >= (0.5f * this.duration) && !this.hasFired)
                {
                    this.hasFired = true;

                    EffectManager.SimpleMuzzleFlash(EntityStates.BrotherMonster.WeaponSlam.slamImpactEffect, base.gameObject, "SwingCenter", false);

                    if (base.isAuthority)
                    {
                        if (base.characterDirection)
                        {
                            base.characterDirection.moveVector = base.characterDirection.forward;
                        }

                        if (this.modelTransform)
                        {
                            Transform transform = base.FindModelChild("SwingCenter");
                            if (transform)
                            {
                                this.blastAttack            = new BlastAttack();
                                this.blastAttack.attacker   = base.gameObject;
                                this.blastAttack.inflictor  = base.gameObject;
                                this.blastAttack.teamIndex  = TeamComponent.GetObjectTeam(base.gameObject);
                                this.blastAttack.baseDamage = this.damageStat * MaceSlam.damageCoefficient;
                                this.blastAttack.baseForce  = MaceSlam.forceMagnitude;
                                this.blastAttack.position   = transform.position;
                                this.blastAttack.radius     = MaceSlam.radius;
                                this.blastAttack.bonusForce = Vector3.up * MaceSlam.upwardForce;

                                this.blastAttack.Fire();
                            }

                            this.weaponAttack.Fire();
                        }
                    }
                }
            }

            if (base.fixedAge >= this.duration && base.isAuthority)
            {
                this.outer.SetNextStateToMain();
                return;
            }
        }
Esempio n. 19
0
        public override void OnEnter()
        {
            base.OnEnter();
            if (base.isAuthority)
            {
                this.duration      = this.baseDuration / base.attackSpeedStat;
                this.modelAnimator = base.GetModelAnimator();
                Transform modelTransform = base.GetModelTransform();
                this.attack            = new ExtendedOverlapAttack();
                this.attack.attacker   = base.gameObject;
                this.attack.inflictor  = base.gameObject;
                this.attack.teamIndex  = TeamComponent.GetObjectTeam(this.attack.attacker);
                this.attack.damage     = this.attackDamageCoefficient * this.damageStat;
                this.attack.isCrit     = RollCrit();
                this.attack.damageType = DamageType.Stun1s;
                this.blastAttack       = new BlastAttack();

                this.blastAttack.attacker        = base.gameObject;
                this.blastAttack.inflictor       = base.gameObject;
                this.blastAttack.teamIndex       = TeamComponent.GetObjectTeam(base.gameObject);
                this.blastAttack.baseDamage      = this.damageStat * this.blastDamageCoefficient;
                this.blastAttack.baseForce       = 16;
                this.blastAttack.position        = base.transform.position;
                this.blastAttack.radius          = 15;
                this.blastAttack.procCoefficient = 1f;
                this.blastAttack.falloffModel    = BlastAttack.FalloffModel.None;
                this.blastAttack.damageType      = DamageType.Stun1s;
                this.blastAttack.crit            = RollCrit();

                if (base.GetComponent <HANDOverclockController>().overclockOn&& Util.CheckRoll(30, base.characterBody.master))
                {
                    this.attack.damageType = DamageType.IgniteOnHit;
                }

                if (modelTransform)
                {
                    this.attack.hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Hammer");
                    ChildLocator component = modelTransform.GetComponent <ChildLocator>();
                    if (component)
                    {
                        this.hammerChildTransform = component.FindChild("SwingCenter");
                    }
                }
                if (this.modelAnimator)
                {
                    base.PlayAnimation("Gesture", "Slam", "Slam.playbackRate", this.duration);
                }
                if (base.characterBody)
                {
                    base.characterBody.SetAimTimer(2f);
                }
            }
        }
Esempio n. 20
0
        public override Skill Clone(int value)
        {
            var tmp = new BlastAttack
            {
                Description = Description,
                MaxValue    = MaxValue,
                Name        = Name,
                Value       = value
            };

            return(tmp);
        }
Esempio n. 21
0
        public override void FixedUpdate()
        {
            base.FixedUpdate();

            if (base.fixedAge >= this.duration && base.isAuthority)
            {
                if (!base.characterMotor.disableAirControlUntilCollision)
                {
                    base.characterMotor.velocity *= 0.4f;
                }
                this.outer.SetNextStateToMain();
                return;
            }

            if (base.isAuthority)
            {
                if (this.attack.Fire())
                {
                    base.characterMotor.velocity = Vector3.zero;

                    if (base.characterMotor && !base.characterMotor.isGrounded)
                    {
                        base.SmallHop(base.characterMotor, 12f);
                    }

                    BlastAttack blastAttack = new BlastAttack();
                    blastAttack.radius            = 10f;
                    blastAttack.procCoefficient   = 1f;
                    blastAttack.position          = base.characterBody.corePosition;
                    blastAttack.attacker          = base.gameObject;
                    blastAttack.crit              = base.RollCrit();
                    blastAttack.baseDamage        = base.characterBody.damage * DrillBreak.damageCoefficient;
                    blastAttack.falloffModel      = BlastAttack.FalloffModel.None;
                    blastAttack.baseForce         = 3f;
                    blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                    blastAttack.damageType        = DamageType.Generic;
                    blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                    blastAttack.Fire();

                    EffectData effectData = new EffectData();
                    effectData.origin = base.characterBody.corePosition;
                    effectData.scale  = 6;

                    EffectManager.SpawnEffect(DiggerPlugin.DiggerPlugin.backblastEffect, effectData, false);

                    base.PlayAnimation("FullBody, Override", "Flip", "Flip.playbackRate", 0.4f);

                    this.outer.SetNextStateToMain();
                    return;
                }
            }
        }
Esempio n. 22
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();
        }
Esempio n. 23
0
        public virtual BlastAttack MakeBlastAttack()
        {
            BlastAttack blastAttack = new BlastAttack();

            blastAttack.radius            = this.blastRadius;
            blastAttack.procCoefficient   = this.blastAttackProcCoefficient;
            blastAttack.position          = base.transform.position;
            blastAttack.attacker          = base.gameObject;
            blastAttack.crit              = Util.CheckRoll(base.characterBody.crit, base.characterBody.master);
            blastAttack.baseDamage        = base.characterBody.damage * this.blastAttackDamageCoefficient;
            blastAttack.falloffModel      = BlastAttack.FalloffModel.None;
            blastAttack.damageType        = (DamageType)this.damageType;
            blastAttack.baseForce         = this.blastAttackForce;
            blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
            blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
            return(blastAttack);
        }
Esempio n. 24
0
            private BlastAttack CreateBlastAttack(GameObject podObject, GameObject passengerObject)
            {
                var         characterBody = passengerObject.GetComponent <CharacterBody>();
                BlastAttack blastAttack   = new BlastAttack();

                blastAttack.radius          = FlyUpState.blastAttackRadius;
                blastAttack.procCoefficient = FlyUpState.blastAttackProcCoefficient;
                blastAttack.position        = podObject.transform.position;
                blastAttack.attacker        = passengerObject;
                blastAttack.crit            = characterBody ? Util.CheckRoll(characterBody.crit, characterBody.master) : false;
                // 12 is artificer's base damage
                blastAttack.baseDamage        = (characterBody ? characterBody.damage : 12f) * FlyUpState.blastAttackDamageCoefficient;
                blastAttack.falloffModel      = BlastAttack.FalloffModel.None;
                blastAttack.baseForce         = FlyUpState.blastAttackForce;
                blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                return(blastAttack);
            }
 // Token: 0x06002FDF RID: 12255 RVA: 0x000CD32C File Offset: 0x000CB52C
 public override void OnEnter()
 {
     base.OnEnter();
     this.duration = HeadstompersCooldown.baseDuration;
     if (this.body)
     {
         Inventory inventory = this.body.inventory;
         int       num       = inventory ? inventory.GetItemCount(ItemIndex.FallBoots) : 1;
         if (num > 0)
         {
             this.duration          /= (float)num;
             this.bodyMotor.velocity = Vector3.zero;
             if (NetworkServer.active && this.impactSpeed > 0f)
             {
                 float       num2        = 10f;
                 float       num3        = Mathf.Max(0f, this.impactSpeed - HeadstompersFall.fallSpeed);
                 float       num4        = 23f;
                 float       num5        = 7f;
                 float       num6        = num4 + num5 * num3;
                 BlastAttack blastAttack = new BlastAttack();
                 blastAttack.attacker         = this.body.gameObject;
                 blastAttack.inflictor        = this.body.gameObject;
                 blastAttack.teamIndex        = TeamComponent.GetObjectTeam(blastAttack.attacker);
                 blastAttack.position         = this.impactPosition;
                 blastAttack.procCoefficient  = 0.5f;
                 blastAttack.radius           = num2;
                 blastAttack.baseForce        = 2000f;
                 blastAttack.bonusForce       = Vector3.up * 2000f;
                 blastAttack.baseDamage       = this.body.damage * num6;
                 blastAttack.falloffModel     = BlastAttack.FalloffModel.SweetSpot;
                 blastAttack.crit             = Util.CheckRoll(this.body.crit, this.body.master);
                 blastAttack.damageColorIndex = DamageColorIndex.Item;
                 blastAttack.Fire();
                 EffectData effectData = new EffectData();
                 effectData.origin = this.impactPosition;
                 effectData.scale  = num2;
                 EffectManager.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/BootShockwave"), effectData, true);
             }
         }
     }
 }
Esempio n. 26
0
        public override void ElementBurst()
        {
            base.ElementBurst();

            BlastAttack blastAttack = MakeBlastAttack();

            blastAttack.Fire();

            BlastAttack.HitPoint[] hits = blastAttack.CollectHits();
            foreach (BlastAttack.HitPoint hit in hits)
            {
                CharacterBody victimBody = hit.hurtBox.healthComponent.body;
                if (victimBody)
                {
                    if (!victimBody.HasBuff(Buffs.chillCooldown))
                    {
                        victimBody.AddTimedBuff(Buffs.chillDebuff, StaticValues.chillDebuffDuration, StaticValues.chillDebuffMaxStacks);
                    }
                }
            }
        }
Esempio n. 27
0
        private void getHitList(BlastAttack ba)
        {
            Collider[] array = Physics.OverlapSphere(ba.position, ba.radius, LayerIndex.defaultLayer.mask);
            int        num   = 0;
            int        num2  = 0;

            while (num < array.Length && num2 < 12)
            {
                HealthComponent component = array[num].GetComponent <HealthComponent>();
                if (component)
                {
                    TeamComponent component2 = component.GetComponent <TeamComponent>();
                    if (component2.teamIndex != TeamIndex.Player)
                    {
                        this.AddToList(component.gameObject);
                        num2++;
                    }
                }
                num++;
            }
        }
Esempio n. 28
0
 public void FixedUpdate()
 {
     base.FixedUpdate();
     stopwatch += Time.fixedDeltaTime;
     if (characterMotor && characterDirection)
     {
         characterMotor.velocity    = Vector3.zero;
         characterMotor.rootMotion += blinkVector * (moveSpeedStat * BlinkState.speedCoefficient * Time.fixedDeltaTime);
     }
     if (stopwatch >= BlinkState.duration && isAuthority)
     {
         outer.SetNextStateToMain();
     }
     stopwatch2 += Time.fixedDeltaTime;
     if (stopwatch2 >= startDuration && !hasCastNova)
     {
         hasCastNova = true;
         EffectManager.instance.SpawnEffect(IceNova.novaEffectPrefab, new EffectData
         {
             origin = transform.position,
             scale  = 12f
         }, true);
         BlastAttack blastAttack = new BlastAttack();
         blastAttack.radius          = 12f;
         blastAttack.procCoefficient = IceNova.procCoefficient;
         blastAttack.position        = transform.position;
         blastAttack.attacker        = gameObject;
         blastAttack.crit            = Util.CheckRoll(characterBody.crit, characterBody.master);
         blastAttack.baseDamage      = characterBody.damage * IceNova.damageCoefficient;
         blastAttack.falloffModel    = 0;
         blastAttack.damageType      = DamageType.Freeze2s;
         blastAttack.baseForce       = IceNova.force;
         blastAttack.teamIndex       = TeamComponent.GetObjectTeam(blastAttack.attacker);
         blastAttack.Fire();
     }
     if (stopwatch2 >= startDuration + endDuration && isAuthority)
     {
         outer.SetNextStateToMain();
     }
 }
Esempio n. 29
0
        public override void Effect(GlobalEventManager globalEventManager, DamageInfo damageInfo, GameObject victim, int itemCount)
        {
            CharacterBody   body          = damageInfo.attacker.GetComponent <CharacterBody>();
            CharacterBody   Attacker      = damageInfo.attacker.GetComponent <CharacterBody>();
            CharacterBody   characterBody = victim ? victim.GetComponent <CharacterBody>() : null;
            CharacterMaster master        = Attacker.master;
            Inventory       inventory     = master.inventory;
            CharacterBody   component     = damageInfo.attacker.GetComponent <CharacterBody>();


            float ExplosionRadius   = (float)(1.5 + 2.5 * itemCount) * damageInfo.procCoefficient;
            float damageCoefficient = 0.6f;
            float Damage            = Util.OnHitProcDamage(damageInfo.damage, component.damage, damageCoefficient);

            EffectManager.instance.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/OmniEffect/OmniExplosionVFXQuick"), new EffectData()
            {
                origin   = damageInfo.position,
                scale    = ExplosionRadius,
                rotation = Util.QuaternionSafeLookRotation(damageInfo.force)
            }, true);
            BlastAttack blastAttack = new BlastAttack()
            {
                position   = damageInfo.position,
                baseDamage = Damage,
                baseForce  = 0.0f,
                radius     = ExplosionRadius,
                attacker   = damageInfo.attacker,
                inflictor  = null
            };

            blastAttack.teamIndex        = TeamComponent.GetObjectTeam(blastAttack.attacker);
            blastAttack.crit             = damageInfo.crit;
            blastAttack.procChainMask    = damageInfo.procChainMask;
            blastAttack.procCoefficient  = 0.0f;
            blastAttack.damageColorIndex = DamageColorIndex.Item;
            blastAttack.falloffModel     = BlastAttack.FalloffModel.None;
            blastAttack.damageType       = damageInfo.damageType;
            blastAttack.Fire();
        }
Esempio n. 30
0
        protected void Fire()
        {
            Ray aimRay = base.GetAimRay();

            this.aimDirection = aimRay.direction;

            //base.PlayAnimation("FullBody, Override", this.animString);

            base.characterBody.AddSpreadBloom(2f);
            EffectManager.SimpleMuzzleFlash(EntityStates.Commando.CommandoWeapon.FirePistol2.muzzleEffectPrefab, base.gameObject, "Muzzle", false);
            Util.PlaySound("HenryShootShotgun", base.gameObject);

            if (base.isAuthority)
            {
                base.characterMotor.velocity = -this.aimDirection * Burst.pushForce;
                //base.characterMotor.rootMotion = this.pushForce;
                base.AddRecoil(-1f * Burst.recoil, -2f * Burst.recoil, -0.5f * Burst.recoil, 0.5f * Burst.recoil);

                BlastAttack blastAttack = new BlastAttack();
                blastAttack.radius            = 10f;
                blastAttack.procCoefficient   = 1f;
                blastAttack.position          = aimRay.origin + 2 * aimRay.direction;
                blastAttack.attacker          = base.gameObject;
                blastAttack.crit              = base.RollCrit();
                blastAttack.baseDamage        = base.characterBody.damage * Burst.damageCoefficient;
                blastAttack.falloffModel      = BlastAttack.FalloffModel.None;
                blastAttack.baseForce         = Burst.blastForce;
                blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                blastAttack.damageType        = DamageType.Stun1s;
                blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                BlastAttack.Result result = blastAttack.Fire();

                EffectData effectData = new EffectData();
                effectData.origin = aimRay.origin + 2 * aimRay.direction;
                effectData.scale  = 8;

                EffectManager.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/FusionCellExplosion"), effectData, true);
            }
        }