Exemple #1
0
        private void On_SSOHOnTakeDamageServer(On.RoR2.SetStateOnHurt.orig_OnTakeDamageServer orig, SetStateOnHurt self, DamageReport damageReport)
        {
            orig(self, damageReport);
            int icnt = GetCount(damageReport.attackerMaster);

            if (icnt < 1)
            {
                return;
            }
            var ch = Util.ConvertAmplificationPercentageIntoReductionPercentage(procChance * icnt * damageReport.damageInfo.procCoefficient);

            if (!Util.CheckRoll(ch))
            {
                return;
            }
            if (self.canBeFrozen)
            {
                self.SetFrozen(freezeTime);
                damageReport.victim?.body.AddTimedBuff(ClassicItemsPlugin.freezeBuff, freezeTime);
            }
            if ((self.canBeFrozen || slowUnfreezable) && damageReport.victim)
            {
                damageReport.victim.body.AddTimedBuff(BuffIndex.Slow60, slowTime);
            }
        }
        private void On_SSOHOnTakeDamageServer(On.RoR2.SetStateOnHurt.orig_OnTakeDamageServer orig, SetStateOnHurt self, RoR2.DamageReport damageReport)
        {
            orig(self, damageReport);
            int icnt = GetCount(damageReport.attackerMaster);

            if (icnt < 1)
            {
                return;
            }
        }
        private void ShieldOnHit(On.RoR2.SetStateOnHurt.orig_OnTakeDamageServer orig, SetStateOnHurt self, DamageReport damageReport)
        {
            var InvenCount = GetCount(damageReport.attackerMaster);

            if (InvenCount > 0)
            {
                float procCoeff = damageReport.damageInfo.procCoefficient;
                damageReport.attackerBody.healthComponent.RechargeShield(InvenCount * procCoeff);
            }
            orig(self, damageReport);
        }