private void CharacterBody_AddTimedBuff(On.RoR2.CharacterBody.orig_AddTimedBuff orig, RoR2.CharacterBody self, RoR2.BuffIndex buffType, float duration) { if (buffType == BuffIndex.MedkitHeal) { duration = NewTime.Value; } orig(self, buffType, duration); }
public static void CharacterBody_AddTimedBuff(On.RoR2.CharacterBody.orig_AddTimedBuff orig, CharacterBody self, BuffIndex buffType, float duration) { if (self.masterObject && self.masterObject.GetComponent <AffixEquipBehaviour>() is AffixEquipBehaviour behaviour && !float.IsInfinity(duration) && !float.IsNaN(duration)) { behaviour.UpdateVultures(buffType, duration); } orig(self, buffType, duration); }
private static void ShortenTimedDebuffs(On.RoR2.CharacterBody.orig_AddTimedBuff orig, CharacterBody self, BuffIndex buffType, float duration) { float newduration = duration; var component = self.GetComponent <DebuffStatComponent>(); if (component) { var buffDef = BuffCatalog.GetBuffDef(buffType); if (buffDef.isDebuff) { newduration *= component.Reduction; } } orig(self, buffType, newduration); }