コード例 #1
0
        // Token: 0x060015FC RID: 5628 RVA: 0x0005E580 File Offset: 0x0005C780
        private void FireImpactBlastAttack(Vector3 impactPosition)
        {
            BlastAttack blastAttack = new BlastAttack();

            blastAttack.baseDamage      = this.characterBody.damage * this.blastAttackDamageCoefficient;
            blastAttack.procCoefficient = this.blastAttackProcCoefficient;
            blastAttack.baseForce       = this.blastAttackForce;
            blastAttack.bonusForce      = Vector3.up * this.blastAttackBonusVerticalForce;
            blastAttack.crit            = Util.CheckRoll(this.characterBody.crit, this.characterBody.master);
            blastAttack.radius          = this.blastAttackRadius;
            blastAttack.damageType      = DamageType.PercentIgniteOnHit;
            blastAttack.falloffModel    = BlastAttack.FalloffModel.SweetSpot;
            blastAttack.attacker        = base.gameObject;
            blastAttack.teamIndex       = TeamComponent.GetObjectTeam(blastAttack.attacker);
            blastAttack.position        = impactPosition;
            blastAttack.Fire();
            if (NetworkServer.active)
            {
                EffectManager.SpawnEffect(this.blastAttackEffect, new EffectData
                {
                    origin = impactPosition,
                    scale  = this.blastAttackRadius
                }, true);
            }
        }
コード例 #2
0
        // Token: 0x060017C1 RID: 6081 RVA: 0x000711A0 File Offset: 0x0006F3A0
        private void FireMeatballs(Vector3 impactNormal, Vector3 impactPosition, Vector3 forward, int meatballCount, float meatballAngle, float meatballForce)
        {
            float   num        = 360f / (float)meatballCount;
            Vector3 normalized = Vector3.ProjectOnPlane(forward, impactNormal).normalized;
            Vector3 point      = Vector3.RotateTowards(impactNormal, normalized, meatballAngle * 0.017453292f, float.PositiveInfinity);

            for (int i = 0; i < meatballCount; i++)
            {
                Vector3 forward2 = Quaternion.AngleAxis(num * (float)i, impactNormal) * point;
                ProjectileManager.instance.FireProjectile(this.meatballProjectile, impactPosition, Util.QuaternionSafeLookRotation(forward2), base.gameObject, this.characterBody.damage * this.meatballDamageCoefficient, meatballForce, Util.CheckRoll(this.characterBody.crit, this.characterBody.master), DamageColorIndex.Default, null, -1f);
            }
            BlastAttack blastAttack = new BlastAttack();

            blastAttack.baseDamage      = this.characterBody.damage * this.blastAttackDamageCoefficient;
            blastAttack.procCoefficient = this.blastAttackProcCoefficient;
            blastAttack.baseForce       = this.blastAttackForce;
            blastAttack.bonusForce      = Vector3.up * this.blastAttackBonusVerticalForce;
            blastAttack.crit            = Util.CheckRoll(this.characterBody.crit, this.characterBody.master);
            blastAttack.radius          = this.blastAttackRadius;
            blastAttack.damageType      = DamageType.IgniteOnHit;
            blastAttack.falloffModel    = BlastAttack.FalloffModel.SweetSpot;
            blastAttack.attacker        = base.gameObject;
            blastAttack.teamIndex       = TeamComponent.GetObjectTeam(blastAttack.attacker);
            blastAttack.position        = impactPosition;
            blastAttack.Fire();
            if (NetworkServer.active)
            {
                EffectManager.instance.SpawnEffect(this.blastAttackEffect, new EffectData
                {
                    origin = impactPosition,
                    scale  = this.blastAttackRadius
                }, true);
            }
        }
コード例 #3
0
        protected override bool PerformEquipmentAction(RoR2.EquipmentSlot slot)
        {
            if (!slot.characterBody)
            {
                return(false);
            }
            var body = slot.characterBody;

            if (NetworkServer.active)
            {
                var supernova = new RoR2.BlastAttack()
                {
                    radius            = 40,
                    procCoefficient   = 0.25f,
                    position          = body.corePosition,
                    attacker          = body.gameObject,
                    crit              = RoR2.Util.CheckRoll(body.crit, body.master),
                    baseDamage        = body.damage * 4,
                    falloffModel      = RoR2.BlastAttack.FalloffModel.None,
                    baseForce         = body.damage * 100,
                    teamIndex         = !body.teamComponent.teamIndex.Equals(TeamIndex.None) ? body.teamComponent.teamIndex : TeamIndex.None,
                    damageType        = DamageType.IgniteOnHit,
                    attackerFiltering = AttackerFiltering.NeverHit
                };
                supernova.Fire();
                RoR2.EffectData effectData = new RoR2.EffectData();
                effectData.origin = body.corePosition;
                effectData.scale  = 40f;
                RoR2.EffectManager.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/ExplosionVFX"), effectData, true);
                return(true);
            }
            return(false);
        }
コード例 #4
0
        private static void HandleReportBlastAttackDamage(NetworkMessage netMsg)
        {
            NetworkReader reader = netMsg.reader;

            BlastAttack.BlastAttackDamageInfo blastAttackDamageInfo = default(BlastAttack.BlastAttackDamageInfo);
            blastAttackDamageInfo.Read(reader);
            BlastAttack.PerformDamageServer(blastAttackDamageInfo);
        }
コード例 #5
0
        // Token: 0x06000AEB RID: 2795 RVA: 0x00030364 File Offset: 0x0002E564
        private void FixedUpdate()
        {
            this.timer += Time.fixedDeltaTime;
            CharacterBody characterBody = null;
            float         num           = 0f;

            if (this.owner)
            {
                characterBody             = this.owner.GetComponent <CharacterBody>();
                num                       = (characterBody ? Mathf.Lerp(characterBody.radius * 0.5f, characterBody.radius * 6f, 1f - Mathf.Abs(-1f + 2f * this.timer / 8f)) : 0f);
                base.transform.position   = this.owner.transform.position;
                base.transform.localScale = new Vector3(num, num, num);
            }
            if (NetworkServer.active)
            {
                if (!this.owner)
                {
                    UnityEngine.Object.Destroy(base.gameObject);
                    return;
                }
                this.attackStopwatch += Time.fixedDeltaTime;
                if (characterBody && this.attackStopwatch >= 0.25f)
                {
                    this.attackStopwatch = 0f;
                    BlastAttack blastAttack = new BlastAttack();
                    blastAttack.attacker        = this.owner;
                    blastAttack.inflictor       = base.gameObject;
                    blastAttack.teamIndex       = TeamComponent.GetObjectTeam(blastAttack.attacker);
                    blastAttack.position        = base.transform.position;
                    blastAttack.procCoefficient = 0.1f;
                    blastAttack.radius          = num;
                    blastAttack.baseForce       = 0f;
                    blastAttack.baseDamage      = 1f * characterBody.damage;
                    blastAttack.bonusForce      = Vector3.zero;
                    blastAttack.crit            = false;
                    blastAttack.damageType      = DamageType.Generic;
                    blastAttack.Fire();
                }
                if (this.timer >= 8f)
                {
                    UnityEngine.Object.Destroy(base.gameObject);
                }
            }
        }
コード例 #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);
             }
         }
     };
 }
コード例 #7
0
 // Token: 0x060010A6 RID: 4262 RVA: 0x00052F28 File Offset: 0x00051128
 private void FixedUpdate()
 {
     if (this.cachedOwnerInfo.gameObject != this.owner)
     {
         this.cachedOwnerInfo = new IcicleAuraController.OwnerInfo(this.owner);
     }
     this.UpdateRadius();
     this.UpdatePosition();
     if (NetworkServer.active)
     {
         if (!this.owner)
         {
             UnityEngine.Object.Destroy(base.gameObject);
             return;
         }
         for (int i = this.icicleLifetimes.Count - 1; i >= 0; i--)
         {
             List <float> list  = this.icicleLifetimes;
             int          index = i;
             list[index] -= Time.fixedDeltaTime;
             if (this.icicleLifetimes[i] <= 0f)
             {
                 this.icicleLifetimes.RemoveAt(i);
             }
         }
         this.NetworkfinalIcicleCount = Mathf.Min((this.icicleLifetimes.Count > 0) ? (2 + this.icicleLifetimes.Count) : 0, 5);
         this.attackStopwatch        += Time.fixedDeltaTime;
     }
     if (this.cachedOwnerInfo.characterBody)
     {
         if (this.finalIcicleCount > 0)
         {
             if (this.lastIcicleCount == 0)
             {
                 this.OnIciclesActivated();
             }
             if (this.lastIcicleCount < this.finalIcicleCount)
             {
                 this.OnIcicleGained();
             }
         }
         else if (this.lastIcicleCount > 0)
         {
             this.OnIciclesDeactivated();
         }
         this.lastIcicleCount = this.finalIcicleCount;
     }
     if (NetworkServer.active && this.cachedOwnerInfo.characterBody && this.finalIcicleCount > 0)
     {
         float num = 0f;
         if (this.cachedOwnerInfo.characterBody.inventory)
         {
             num = 0.5f + 0.5f * (float)this.cachedOwnerInfo.characterBody.inventory.GetItemCount(ItemIndex.Icicle);
         }
         if (this.attackStopwatch >= 0.25f)
         {
             this.attackStopwatch = 0f;
             BlastAttack blastAttack = new BlastAttack();
             blastAttack.attacker         = this.owner;
             blastAttack.inflictor        = base.gameObject;
             blastAttack.teamIndex        = TeamComponent.GetObjectTeam(blastAttack.attacker);
             blastAttack.position         = this.transform.position;
             blastAttack.procCoefficient  = 0.05f;
             blastAttack.radius           = this.actualRadius;
             blastAttack.baseForce        = 0f;
             blastAttack.baseDamage       = num * 0.25f * this.cachedOwnerInfo.characterBody.damage * (float)this.finalIcicleCount;
             blastAttack.bonusForce       = Vector3.zero;
             blastAttack.crit             = false;
             blastAttack.damageType       = DamageType.Generic;
             blastAttack.falloffModel     = BlastAttack.FalloffModel.None;
             blastAttack.damageColorIndex = DamageColorIndex.Item;
             blastAttack.Fire();
         }
     }
 }