diff --git a/MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs b/MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs new file mode 100644 index 0000000000000000000000000000000000000000..5455172387f374488cedb6d2b130a73aa1ac0837 --- /dev/null +++ b/MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.InputSystem; + + +namespace BigSock.Item { + + /* + An item that heals the user on kill. + */ + public class ItemPlasticStraw : OnKillItemBase { + public override ulong Id => 202; + public override string Name => "Plastic Straw"; + public override string Description => "Heal the user on kill."; + + public static readonly double CHANCE = 1.0; + + public override void Handler(Character source, Character target, AttackStats attack) { + // Check if it triggers. + var roll = RND.NextDouble(); + if(roll <= CHANCE) { + MonoBehaviour.print($"[ItemPlasticStraw.Handler()] Hit. ({roll:P1} <= {CHANCE:P1})"); + source.TryHeal(1.5f); + } else { + MonoBehaviour.print($"[ItemPlasticStraw.Handler()] Miss. ({roll:P1} > {CHANCE:P1})"); + } + } + + } +} \ No newline at end of file diff --git a/MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs.meta b/MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..55418100dec3194f3fde293cafdd23893ba3a634 --- /dev/null +++ b/MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c24f1f2ed9cc63f4b9de7e0997060e4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: