コード例 #1
0
 public static void BloodDrawDatablock_UseItem(BloodDrawDatablock hook, IBloodDrawItem draw)
 {
     object[] args = new object[]
     {
         hook,
         draw
     };
     Method.Invoke("RustExtended.RustHook.BloodDrawDatablock_UseItem", args);
 }
コード例 #2
0
 public virtual void UseItem(IBloodDrawItem draw)
 {
     if (Time.time >= (draw.lastUseTime + 2f))
     {
         Inventory inventory = draw.inventory;
         if (inventory.GetLocal <HumanBodyTakeDamage>().health > this.bloodToTake)
         {
             IDMain idMain = inventory.idMain;
             TakeDamage.Hurt(idMain, idMain, this.bloodToTake, null);
             inventory.AddItem(ref LateLoaded.blood, Inventory.Slot.Preference.Define(Inventory.Slot.Kind.Default, true, Inventory.Slot.KindFlags.Belt), 1);
             draw.lastUseTime = Time.time;
         }
     }
 }