From 522aad7889cd62e96af7c420789507ccbf5b7aaa Mon Sep 17 00:00:00 2001 From: troido Date: Sat, 22 Feb 2020 23:41:51 +0100 Subject: it is now possible to use items --- src/defaultencyclopedia.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/defaultencyclopedia.rs') diff --git a/src/defaultencyclopedia.rs b/src/defaultencyclopedia.rs index cce8931..260c5f7 100644 --- a/src/defaultencyclopedia.rs +++ b/src/defaultencyclopedia.rs @@ -80,14 +80,18 @@ pub fn default_encyclopedia() -> Encyclopedia { }, "pebble": { "components": [ - ["Item", {"ent": ["template", "pebble"], "name": ["string", "pebble"]}] + ["Item", { + "ent": ["template", "pebble"], + "name": ["string", "pebble"], + "action": ["action", ["eat", 1]] + }] ], "sprite": "pebble", "height": 0.3 }, "stone": { "components": [ - ["Item", {"ent": ["template", "stone"], "name": ["string", "stone"]}] + ["Item", {"ent": ["template", "stone"], "name": ["string", "stone"], "action": ["action", ["build", "builtwall"]]}] ], "sprite": "stone", "height": 0.4 @@ -113,6 +117,15 @@ pub fn default_encyclopedia() -> Encyclopedia { ["RoomExit", {"destination": ["arg", "destination"]}], "Floor" ] - } + }, + "builtwall": { + "arguments": [["health", "int", 100]], + "components": [ + "Blocking", + ["Health", {"health": ["arg", "health"], "maxhealth": ["int", 100]}] + ], + "sprite": "wall", + "height": 2 + }, })).unwrap() } -- cgit