summaryrefslogtreecommitdiff
path: root/src/defaultencyclopedia.rs
blob: 9f93e4037cd011c5226b260bcf658ab2df8c4c61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118

use crate::encyclopedia::Encyclopedia;
use serde_json::json;

pub fn default_encyclopedia() -> Encyclopedia {
	Encyclopedia::from_json(json!({
		"wall": {
			"components": ["Blocking"],
			"sprite": "wall",
			"height": 2
		},
		"rock": {
			"components": ["Blocking"],
			"sprite": "rock",
			"height": 10
		},
		"tree": {
			"components": ["Blocking"],
			"sprite": "tree",
			"height": 3
		},
		"fence": {
			"components": ["Blocking"],
			"sprite": "fence",
			"height": 1
		},
		"grass": {
			"components": [
				["Visible", {
					"sprite": ["random", [
						["string", "grass1"],
						["string", "grass2"],
						["string", "grass3"],
						["string", "grass1"],
						["string", "grass2"],
						["string", "grass3"],
						["string", "ground"]
					]],
					"height": ["float", 0.1],
					"name": ["string", "grass"]
				}],
				"Floor"
			]
		},
		"greengrass": {
			"components": [
				["Visible", {
					"sprite": ["random", [
						["string", "grass1"],
						["string", "grass2"],
						["string", "grass3"]
					]],
					"height": ["float", 0.1],
					"name": ["string", "grass"]
				}],
				"Floor"
			]
		},
		"ground": {
			"components": ["Floor"],
			"sprite": "ground",
			"height": 0.1
		},
		"floor": {
			"components": ["Floor"],
			"sprite": "floor",
			"height": 0.1
		},
		"bridge": {
			"components": [
				"Floor"
			],
			"sprite": "bridge",
			"height": 0.1
		},
		"water": {
			"components": [],
			"sprite": "water",
			"height": 0.1
		},
		"pebble": {
			"components": [
				["Item", {"ent": ["template", "pebble"], "name": ["string", "pebble"]}]
			],
			"sprite": "pebble",
			"height": 0.4
		},
		"stone": {
			"components": [
				["Item", {"ent": ["template", "stone"], "name": ["string", "stone"]}]
			],
			"sprite": "stone",
			"height": 0.4
		},
		"player": {
			"arguments": [["name", "string", null]],
			"components": [
				["Visible", {
					"sprite": ["string", "player"],
					"height": ["float", 1.0],
					"name": ["arg", "name"]
				}],
				["Player", {
					"name": ["arg", "name"]
				}],
				["Inventory", {"capacity": ["int", 3]}],
				["Health", {"health": ["int", 9], "maxhealth": ["int", 10]}]
			]
		},
		"portal": {
			"arguments": [["destination", "string", null]],
			"components": [
				["RoomExit", {"destination": ["arg", "destination"]}],
				"Floor"
			]
		}
	})).unwrap()
}