summaryrefslogtreecommitdiff
path: root/src/defaultencyclopedia.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-22 23:41:51 +0100
committertroido <troido@protonmail.com>2020-02-22 23:41:51 +0100
commit522aad7889cd62e96af7c420789507ccbf5b7aaa (patch)
treebfb3c21d627552bcda6f2743854cee920722fd3b /src/defaultencyclopedia.rs
parentf4331041e5d906f95063f317852f32f19e6cdf9c (diff)
it is now possible to use items
Diffstat (limited to 'src/defaultencyclopedia.rs')
-rw-r--r--src/defaultencyclopedia.rs19
1 files changed, 16 insertions, 3 deletions
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()
}