SOURCE / PINNED RELEASE
Made of little things.
Gem Warden
- Release
- 7c457bfe5427…
- Author-recorded commit
- fb5453b5fc06…
- License
- LICENSE
- Author’s source reference
- nostr://npub1eg5pfnws6tg6rtp33tugpppqtv5u05crmf983qp438cdycwzngys0gxzcs/wss%3A%2F%2Fgit.napplet.soy%2F/n-3929629ef1d
Archive hash verified: 895b8dd430aad9fe…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
# Gem Warden
A gem tower defense napplet in the spirit of GemCraft Chapter 1. Forge gems,
combine them into higher grades, socket them into towers and traps, and keep the
monsters away from your mana orb across six fields.
Tooling notes for this soyLI project are in [docs/napplet-space.md](docs/napplet-space.md).
## How to play
- **Mana is everything.** It pays for buildings and gems, and it is your life:
a monster that reaches the orb is banished back to the start at a mana cost.
Run out and the orb shatters.
- **Tower** (T) goes on grass beside the path; **Trap** (R) goes on the path.
Traps hit weaker, but they strike every monster beside them at once, apply
their gem's special effect 2.5× as strongly (poison only 1.3×, since it
already ignores armour), and their slow and poison last longer. A trap just
ahead of your towers softens everything before the towers fire.
- **Forge** a gem by tapping a colour (keys 1–6). −/+ picks the grade.
- **Drag** a gem onto a tower, trap, inventory slot or Sell. Tapping a gem and then
a target does the same. Dropping a gem on another gem **combines** them: two
equal grades make the next grade; mixed colours share both specials, but
impurity costs: an even two-colour mix keeps 75% of each special and 90% of
its damage. Gem shape shows the grade: triangle, square, pentagon, hexagon,
then circle from grade 5.
- **Combining is free.** A forged grade costs exactly its grade-1 gems, so
forging a grade 4 costs the same as forging two grade 3s and combining them.
Combining unequal grades keeps the higher grade and moves it part of the way
to the next one.
- Hover (or drag over) anything to see what it does: forge buttons show the gem
at the chosen grade and its cost, and dragging onto a gem previews the result.
- The last forge tile (key 0) forges **three random gems** of this field's
colours at the chosen grade for the price of two and a half. It needs three free slots.
- **Pool +** (P) enlarges the mana pool and raises every mana gain by 15%.
- **Next wave** (N) calls the wave early for bonus mana. F changes speed,
Space pauses, S sells the selected gem.
| Gem | Special |
| --- | --- |
| Ruby | Splash damage around the target |
| Amber | Leeches mana on every hit |
| Topaz | Critical hits |
| Jade | Poison damage over time |
| Sapphire | Slows monsters |
| Amethyst | Tears away armor |
| Monster | Trait | Beat it with |
| --- | --- | --- |
| Crawler | Plain and steady | Anything |
| Swarm | Many small ones, close together | Ruby splash |
| Brute | Heavy armour blunts every hit | Amethyst, jade |
| Giant | Huge health, slow | Topaz crits, big gems |
| Runner | Twice as fast | Sapphire slow |
| Warded | Each ward charge eats one whole hit | Ruby splash, traps |
| Mender | Heals itself unless poisoned | Jade poison |
Each field adds monsters: runners and warded from the second field, menders from
the third. Hover a monster or an upcoming-wave icon to see what it is.
Each field unlocks the next. Stars: win, let nothing reach the orb, and win with
five or fewer buildings. Progress is kept through the optional storage domain
when the host offers it, and lasts for the session otherwise.
## Visual direction
- **Character:** arcane night. Dark slate earth and a worn violet path make the
glowing faceted gems and the blue orb the brightest things on screen, because
the gems are the whole game.
- **Main surface:** canvas-rendered tile field with procedural grass flecks, path
stones and rocks; towers are pale stone sockets, traps are rotating rune rings.
Monsters are simple shapes coloured by type so waves read at a glance.
- **Interface:** one canvas. A side panel in landscape and a bottom panel in
portrait; rounded dark buttons with gold for the active state and costs, blue for
mana and red for what you cannot afford.
- **Theme policy:** app-owned colours; the host theme is not followed.
- **Proof:** a mid-wave frame with gem towers firing, checked at 960×600,
1400×900, 844×390, 390×780 and 320×560. Below 280×200 a notice asks for room.
## Development
`src/game.ts` holds all rules with no DOM access; `src/main.ts` renders and
handles input. `node --experimental-strip-types tests/balance.ts` runs a greedy
bot over every field as a rough difficulty check. `tests/strategies.ts` plays
scripted builds (three rubies, towers with traps, rushing waves) through every
field, and `tests/matchups.ts` spends equal mana on each build and counts how many
monsters of each type get through: a one-colour build should not win there.
