Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONUT #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/inventory/donut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion lib/inventory-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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}
]
});
30 changes: 30 additions & 0 deletions lib/inventory/Donut.js
Original file line number Diff line number Diff line change
@@ -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;
});