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

add sand, glass, and calculator #362

Merged
merged 5 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion data/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,24 @@
properties: [portable]
capabilities: [float]

- name: sand
display:
attr: sand
char: '█'
description:
- A substance composed mostly of tiny rocks and mineral particles. It
tends to be found near water, and can be used in a furnace to make glass.
properties: [portable, growable]
growth: [0,0]

- name: glass
display:
attr: entity
char: '□'
description:
- A pane of a brittle, clear substance, made from melting sand in a furnace.
properties: [portable]

- name: bit (0)
display:
attr: entity
Expand Down Expand Up @@ -378,7 +396,7 @@
- name: plasma cutter
display:
attr: device
char: '+'
char: 'P'
description:
- "A plasma cutter uses a jet of hot plasma to cut through metal like
butter. Used via the 'salvage' command to cut apart old robots."
Expand Down Expand Up @@ -546,3 +564,14 @@
uses the 'log' command)."
properties: [portable]
capabilities: [log]

- name: calculator
display:
attr: device
char: '+'
description:
- "A calculator allows a robot to do basic arithmetic calculations:
addition, subtraction, multiplication, division, and
exponentiation."
properties: [portable]
capabilities: [arith]
21 changes: 21 additions & 0 deletions data/recipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,27 @@
required:
- [1, furnace]

- in:
- [1, sand]
out:
- [1, glass]
required:
- [1, furnace]

- in:
- [1, glass]
- [8, copper wire]
out:
- [1, solar panel]
required:
- [1, 3D printer]

- in:
- [1, counter]
- [1, solar panel]
out:
- [1, calculator]

- in:
- [32, gear]
- [6, copper wire]
Expand Down
1 change: 1 addition & 0 deletions src/Swarm/Game/WorldGen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ testWorld2 baseSeed (Coords ix@(r, c)) =
| h `mod` 10 == 0 = (StoneT, Just "rock")
| otherwise = (StoneT, Nothing)
genBiome Big Soft Natural
| abs (sample ix pn1) < 0.1 = (DirtT, Just "sand")
| even (r + c) = (DirtT, Just "wavy water")
| otherwise = (DirtT, Just "water")
genBiome Small Soft Natural
Expand Down
12 changes: 6 additions & 6 deletions src/Swarm/Language/Capability.hs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ constCaps =
Salvage -> [CSalvage]
Reprogram -> [CReprogram]
Drill -> [CDrill]
Neg -> [CArith]
Add -> [CArith]
Sub -> [CArith]
Mul -> [CArith]
Div -> [CArith]
Exp -> [CArith]
-- Some God-like sensing abilities.
As -> [CGod]
RobotNamed -> [CGod]
Expand All @@ -278,7 +284,6 @@ constCaps =
Appear -> [CAppear] -- paint?
Whereami -> [CSenseloc] -- GPS?
Random -> [CRandom] -- randomness device (with bitcoins)?
Neg -> [CArith] -- ALU? pocket calculator?
Whoami -> [CWhoami] -- mirror, needs a recipe

-- comparator?
Expand All @@ -290,11 +295,6 @@ constCaps =
Geq -> [CCompare]
And -> []
Or -> []
Add -> [CArith]
Sub -> [CArith]
Mul -> [CArith]
Div -> [CArith]
Exp -> [CArith]
-- Some more constants which *ought* to have their own capability but
-- currently don't.
Say -> []
Expand Down