Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.
C calculatorcalculator-gamescasiochesscrossy-roaddrive-madfx-cg50gamesgeometry-dashgraphing-calculatorndlessnumworksnumworks-appsnumworks-calculatornumworks-gamenumworks-gamestetristi-84-plus-ceti-nspire
NumBlocks.nwa: stronghold loot, the crystal's beam, README for the Nether and the End
Mason3634a97e752e95f
diff --git a/games/numblocks/README.md b/games/numblocks/README.mdindex 321b3875..7a0aced3 100644--- a/games/numblocks/README.md+++ b/games/numblocks/README.md@@ -14,7 +14,23 @@ Minecraft 1.8.8 on your NumWorks calculator. NumBlocks isn't a look-alike: it fo- **Creative mode:** fly, every block and item, break things at once, and search for any block.- **Commands:** /gamemode, /give, /time, /weather, /tp and more, with cheats on (Allow Cheats, or Open to LAN).- **Your worlds:** keep several, give them names, and they save as you play and when you quit. A copy also goes into `numblocks_saves.py`, so installing the game again doesn't erase them.-- **Not in yet:** the Nether and the End, redstone circuits and pistons, villages and other structures, enchanting and brewing.+- **The Nether and the End:** in `NumBlocks.nwa`, the app on its own (see below).+- **Not in yet:** redstone circuits and pistons, villages and the other structures, enchanting and brewing.++## The Nether and the End++`NumBlocks.nwa`, the app on its own, also has the Nether and the End, made the way Minecraft 1.8.8 makes them for your seed. NumPlay has no room for them, so its NumBlocks stays in the Overworld.++<img src="docs/nether.png" width="320" alt="NumBlocks: the Nether, netherrack, gravel and fire by a fortress wall"> <img src="docs/end.png" width="320" alt="NumBlocks: the Ender Dragon flying over the End, its health bar at the top">++- **Nether portals:** build an obsidian frame, from 4 by 5 up to 23 by 23, light it with flint and steel or a fire charge, and stand in it. One block in the Nether is eight in the Overworld, and the portal on the other side is found, or built, as in 1.8.8. Now and then a zombie pigman walks out of a portal.+- **The Nether:** netherrack, the lava sea, soul sand that slows you down, gravel, glowstone, nether quartz, fire that never goes out on netherrack, and lava that runs further and faster than in the Overworld. Water boils away, and beds blow up.+- **Nether fortresses:** laid out piece by piece as 1.8.8 does, with nether wart, chests and blaze spawners. Ghasts and their fireballs (hit them back), zombie pigmen that all turn on you when one is hit, blazes, magma cubes that split, and wither skeletons.+- **Endermen and ender pearls:** they teleport, carry blocks around and come after you if you look at them. A thrown ender pearl takes you where it lands.+- **Eyes of ender and strongholds:** blaze powder and an ender pearl make an eye of ender. Thrown, it flies towards the nearest of the world's three strongholds, the very ones 1.8.8 makes for your seed, with their corridors, prisons, libraries, fountains and iron doors that open with a button. Put an eye in each of the 12 frames of the portal room to open the End portal.+- **The End:** the island of end stone and its obsidian pillars, the ender crystals on top that heal the dragon, and the Ender Dragon itself: it circles, charges and dives, breaks through blocks, and shows its health at the top of the screen. Kill it for its experience, the exit portal and the dragon egg. The exit portal shows the End poem and the credits, then takes you home.+- **Saved:** each dimension keeps its own changes, and you come back where you left. Open a world saved in the Nether or the End in NumPlay's NumBlocks and you are in the Overworld where you last stood there, without the items it doesn't have.+- **Not in:** brewing (nether wart grows, but there are no potions), silverfish (the strongholds' stone bricks are plain ones), the other structures, and redstone.## Controls@@ -44,7 +60,7 @@ It comes inside [NumPlay](https://github.com/Mason363/NumPlay), or on its own as## Credits-Inspired by Minecraft, but not affiliated with Mojang or Microsoft. Go play the real Minecraft and support the people who made it! The textures, the font and the screens come from Minecraft 1.8.8, and the world is made the way Minecraft 1.8.8 makes it.+Inspired by Minecraft, but not affiliated with Mojang or Microsoft. Go play the real Minecraft and support the people who made it! The textures, the font, the screens, the End poem and the credits come from Minecraft 1.8.8, and the world is made the way Minecraft 1.8.8 makes it.Also try [Numcraft](https://github.com/yannis300307/NumcraftRust) by yannis300307, the first Minecraft-like game for the NumWorks.diff --git a/games/numblocks/docs/end.png b/games/numblocks/docs/end.pngnew file mode 100644index 00000000..ada2f498Binary files /dev/null and b/games/numblocks/docs/end.png differdiff --git a/games/numblocks/docs/nether.png b/games/numblocks/docs/nether.pngnew file mode 100644index 00000000..61b5f48fBinary files /dev/null and b/games/numblocks/docs/nether.png differdiff --git a/games/numblocks/src/end.c b/games/numblocks/src/end.cindex e2086b03..0f30eb97 100644--- a/games/numblocks/src/end.c+++ b/games/numblocks/src/end.c@@ -309,6 +309,14 @@ void end_tick(void) {if (e) e->tx = (int16_t)i, e->tz = 0, e->age = (int16_t)rnd(10000), e->health = 5;}if (!dst.dragon_dead && !dragon()) dragon_enter();+ /* the healing crystal's beam to it (RenderDragon): its light along the way, a few bits a tick */+ float a[3], b[3];+ if (dragon_beam(a, b))+ for (int k = 0; k < 3; k++) {+ float t = rndf();+ particle_add(a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t, 0, 0, 0,+ rnd(2) ? 0xFFFF : 0xC81F, 6);+ }}/* the boss bar: its health (0 to 1), or -1 with no dragon near (BossStatus, set as RenderDragon draws it) */diff --git a/games/numblocks/src/gui.c b/games/numblocks/src/gui.cindex 75e61cf3..dc9fb23a 100644--- a/games/numblocks/src/gui.c+++ b/games/numblocks/src/gui.c@@ -607,7 +607,7 @@ static Furnace *furnace;#define USED(t) ((t).used == 1 + dim)#define USE_TAG ((uint8_t)(1 + dim))#include "edits.h"-static void chest_loot(Chest *c);+static void chest_loot(Chest *c, int kind);#else#define USED(t) ((t).used)#define USE_TAG 1@@ -622,7 +622,11 @@ static Chest *chest_at(int x, int y, int z, bool make) {memset(&chests[i], 0, sizeof chests[i]);chests[i].used = USE_TAG, chests[i].x = (int16_t)x, chests[i].y = (uint8_t)y, chests[i].z = (int16_t)z;#if NB_DIMS- if (dim == DIM_NETHER && !edits_changed(x, y, z)) chest_loot(&chests[i]);+ if (dim == DIM_NETHER && !edits_changed(x, y, z)) chest_loot(&chests[i], 0);+ else if (dim == DIM_OVERWORLD && !edits_changed(x, y, z)) {+ int k = gen_stronghold_chest(x, y, z); /* (a stronghold's: 1-3; none: 0) */+ if (k) chest_loot(&chests[i], k);+ }#endifreturn &chests[i];}@@ -683,16 +687,31 @@ void tiles_merge(const void *t) {if (j < N_FURNACES) furnaces[j] = f[i];}}-/* a chest the world made (a fortress's): its loot, when first opened (StructureNetherBridgePieces's list;- * horse armour and saddles are not in NumBlocks: those draws leave nothing) */-static void chest_loot(Chest *c) {- static const struct { uint16_t id; uint8_t lo, hi, w; } L[] = {+/* a chest the world made: its loot, when first opened. kind 0 a fortress's (StructureNetherBridgePieces's list),+ * 1 a stronghold's corridor, 2 its room, 3 its library (StructureStrongholdPieces's); horse armour, saddles,+ * maps and enchanted books are not in NumBlocks: those draws leave nothing */+typedef struct { uint16_t id; uint8_t lo, hi, w; } Loot;+static void chest_loot(Chest *c, int kind) {+ static const Loot fort[] = {{I_DIAMOND, 1, 3, 5}, {I_IRON_INGOT, 1, 5, 5}, {I_GOLD_INGOT, 1, 3, 15}, {I_GOLDEN_SWORD, 1, 1, 5},{I_GOLDEN_CHESTPLATE, 1, 1, 5}, {I_FLINT_AND_STEEL, 1, 1, 5}, {I_NETHER_WART, 3, 7, 5}, {0, 1, 1, 10},{0, 1, 1, 8}, {0, 1, 1, 5}, {0, 1, 1, 3}, {B_OBSIDIAN, 2, 4, 2}};- int n = 2 + rnd(4);+ static const Loot corridor[] = {+ {I_ENDER_PEARL, 1, 1, 10}, {I_DIAMOND, 1, 3, 3}, {I_IRON_INGOT, 1, 5, 10}, {I_GOLD_INGOT, 1, 3, 5},+ {I_REDSTONE, 4, 9, 5}, {I_BREAD, 1, 3, 15}, {I_APPLE, 1, 3, 15}, {I_IRON_PICKAXE, 1, 1, 5},+ {I_IRON_SWORD, 1, 1, 5}, {I_IRON_CHESTPLATE, 1, 1, 5}, {I_IRON_HELMET, 1, 1, 5}, {I_IRON_LEGGINGS, 1, 1, 5},+ {I_IRON_BOOTS, 1, 1, 5}, {I_GOLDEN_APPLE, 1, 1, 1}, {0, 1, 1, 5}};+ static const Loot room[] = {+ {I_IRON_INGOT, 1, 5, 10}, {I_GOLD_INGOT, 1, 3, 5}, {I_REDSTONE, 4, 9, 5}, {I_COAL, 3, 8, 10},+ {I_BREAD, 1, 3, 15}, {I_APPLE, 1, 3, 15}, {I_IRON_PICKAXE, 1, 1, 1}, {0, 1, 1, 1}};+ static const Loot library[] = {{I_BOOK, 1, 3, 20}, {I_PAPER, 2, 7, 20}, {0, 1, 1, 1}, {I_COMPASS, 1, 1, 1}, {0, 1, 5, 2}};+ static const struct { const Loot *l; uint8_t total, n0, n1; } T[4] = {+ {fort, 75, 2, 4}, {corridor, 99, 2, 2}, {room, 62, 1, 4}, {library, 44, 1, 4}};+ if (kind < 0 || kind > 3) return;+ const Loot *L = T[kind].l;+ int n = T[kind].n0 + rnd(T[kind].n1);for (int k = 0; k < n; k++) {- int w = rnd(75), i = 0;+ int w = rnd(T[kind].total), i = 0;while (w >= L[i].w) w -= L[i++].w;int count = L[i].lo + rnd(L[i].hi - L[i].lo + 1), slot = rnd(27);if (L[i].id) c->s[slot] = (Stack){L[i].id, (uint16_t)(item_dur(L[i].id) ? 0 : count)};