Skip to content

Commit

Permalink
add sand, glass, and calculator (#362)
Browse files Browse the repository at this point in the history
- Sand is now found near water.  Sand regenerates immediately (like water).
- Sand can be used in a furnace to make glass.
- Glass + copper wires + 3D printer can be used to make solar panels.
    - Note that with #361 I intend to start the base with a small number of 3D printers, so other robots could carry this out.  But also, the base will start with a bunch of solar panels too.
- Solar panel + counter can be used to make a calculator.
  • Loading branch information
byorgey authored Jun 6, 2022
1 parent ee857a5 commit 7b4ffcc
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 7 deletions.
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

0 comments on commit 7b4ffcc

Please sign in to comment.