Example #1
0
 private void AddWindedDebuff(On.RoR2.CharacterBody.orig_RemoveBuff orig, RoR2.CharacterBody self, BuffIndex buffType)
 {
     orig(self, buffType);
     if (buffType == SecondWindBuff)
     {
         self.AddTimedBuffAuthority(WindedDebuff, 10f);
     }
 }
Example #2
0
 // Aetherium: https://github.com/KomradeSpectre/AetheriumMod/blob/6f35f9d8c57f4b7fa14375f620518e7c904c8287/Aetherium/Items/AccursedPotion.cs#L344-L358
 public static void AddBuffAndDot(BuffDef buff, float duration, int stackCount, RoR2.CharacterBody body)
 {
     RoR2.DotController.DotIndex index = (RoR2.DotController.DotIndex)Array.FindIndex(RoR2.DotController.dotDefs, (dotDef) => dotDef.associatedBuff == buff);
     for (int y = 0; y < stackCount; y++)
     {
         if (index != RoR2.DotController.DotIndex.None)
         {
             RoR2.DotController.InflictDot(body.gameObject, body.gameObject, index, duration, 0.25f);
         }
         else
         {
             body.AddTimedBuffAuthority(buff.buffIndex, duration);
         }
     }
 }