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 2 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: copper
char: '░'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I can not see the character very well. Maybe its the dirt background and copper attribute?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, the name of the character is "light shade" and my font takes that literally:

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same character used for dirt, grass, and stone, but should be the same color as copper. I do want to make sure it's distinguishable in different terminals which don't all handle color the same...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, in my terminal the copper and dirt colors are easily distinguishable. But I tried it in gnome-terminal and the two colors are very very hard to tell apart. Any suggestions for a different color and/or character to use?

Copy link
Member

@xsebek xsebek Jun 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest IceT background and the sand attribute which I completely forgot about. 😄

No idea what I used sand for half a year ago:

, (sandAttr, fg (V.rgbColor @Int 194 178 128)) -- Ondřej Šebek, 8 months ago Add drill command (#186)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, didn't know we had a sand attribute! I updated it, how does it look now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good enough, in light colour schemes it very much looks like sand for me, in dark ones it's a bit muddy but still distinguishable. 👍

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: '*'
byorgey marked this conversation as resolved.
Show resolved Hide resolved
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]
-- String operations, which for now are enabled by CLog
Expand All @@ -277,7 +283,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 @@ -289,11 +294,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