Skip to content

Commit

Permalink
add parsley entity that enables read command
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed Dec 19, 2024
1 parent 26356b8 commit c360930
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions data/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,33 @@
ignition: 0.1
duration: [20, 40]
product: ash
- name: parsley
display:
attr: plant
char: 'p'
description:
- A fast-growing plant with a pungent aroma, often found growing
near rocks.
- |
When equipped as a device, parsley enables the `read`
command, which can be used to turn text into values:
```
read : Text -> (Unit + a)
```
If the given `Text`{=type} represents a value of the expected
type, the value will be returned wrapped in `inr`; otherwise
`inl ()` is returned. For example:
- |
```
(read "3" : Unit + Int) == inr 3
```
but
```
(read "hello" : Unit + Int) == inl ()
```
properties: [pickable, growable]
capabilities: [read]
growth: [10, 100]
- name: linotype
display:
attr: silver
Expand Down
1 change: 1 addition & 0 deletions data/worlds/classic.world
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ overlay
[ {stone}
, mask (hash % 10 == 0) {stone, rock}
, mask (hash % 100 == 0) {stone, lodestone}
, mask (hash % 300 == 0) {grass, parsley}
]
)
, mask (big && soft && natural)
Expand Down

0 comments on commit c360930

Please sign in to comment.