diff --git a/TODO.txt b/TODO.txt index e172693d..52051b79 100644 --- a/TODO.txt +++ b/TODO.txt @@ -310,13 +310,13 @@ X rubber hose X rifle X rifle ammo X wrench +X Donut spare headlight lantern golf club food twinkie hot dog -donut duct tape coffee - adds a temp 1/2 heart diff --git a/assets/inventory/AI_Generated_Image_2023-12-19_440708845039201 (2) (1).png b/assets/inventory/AI_Generated_Image_2023-12-19_440708845039201 (2) (1).png new file mode 100644 index 00000000..17302b99 Binary files /dev/null and b/assets/inventory/AI_Generated_Image_2023-12-19_440708845039201 (2) (1).png differ diff --git a/assets/inventory/donut.png b/assets/inventory/donut.png new file mode 100644 index 00000000..17302b99 Binary files /dev/null and b/assets/inventory/donut.png differ diff --git a/lib/inventory-list.js b/lib/inventory-list.js index f1799bb7..2cc90d0b 100644 --- a/lib/inventory-list.js +++ b/lib/inventory-list.js @@ -12,7 +12,9 @@ define({ {"clazz":"Glock19","percent":0.08,"dice":"1","ammo":"3d5"}, {"clazz":"Nine_mm","percent":0.08,"dice":"2d6","stacked":true}, {"clazz":"Remington700","percent":0.07,"dice":"1","ammo":"1d5"}, - {"clazz":"TwoTwoThree","percent":0.07,"dice":"3d6","stacked":"true"} + {"clazz":"TwoTwoThree","percent":0.07,"dice":"3d6","stacked":"true"}, + {"clazz":"Donut","percent":0.3,"dice":"1d2"}, + {"clazz":"Donut","percent":0.3,"dice":"1d2"} ], gas_station: [ {"clazz":"Flashlight","percent":0.1,"dice":"1d2"}, @@ -45,6 +47,7 @@ define({ ], start: [ {"clazz":"Beans","percent":1,"dice":"8d12"}, + {"clazz":"Donut","percent":1,"dice":"1"}, {"clazz":"Glock19","percent":1,"dice":"1","ammo":15} ] }); diff --git a/lib/inventory/Donut.js b/lib/inventory/Donut.js new file mode 100644 index 00000000..4729e92c --- /dev/null +++ b/lib/inventory/Donut.js @@ -0,0 +1,30 @@ +// Donut + +define(['Game', 'inventory/InventoryItem'], + function (Game, InventoryItem) { + + + var Donut = function () { + this.consumed = false; + }; + + Donut.prototype = { + use: function () { + Game.dude.heal(3); + this.consume(); + }, + viable: function () { + return !this.consumed; + } + }; + + InventoryItem(Donut, { + width: 1, + height: 1, + image: 'donut', + clazz: 'Donut', + description: 'DONUT' + }); + + return Donut; +});