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
Undertale: Waterfall's end, Undyne's fight, to Hotland's edge
Mason Chen3e2d41f7211e
diff --git a/README.md b/README.mdindex 9e9aab01..36798a38 100644--- a/README.md+++ b/README.md@@ -79,7 +79,7 @@ These are too big to fit next to NumPlay, so each one is its own app. Install it<tr><td align="center"><a href="games/celeste/README.md"><img src="docs/media/thumb_celeste.png" width="200" alt="Celeste"><br><b>Celeste</b></a><br><sub>The whole climb, with every B-side and C-side</sub><br><a href="https://github.com/Mason363/NumPlay/releases/latest/download/Celeste.nwa">Download</a></td><td align="center"><a href="games/championisland/README.md"><img src="docs/media/thumb_championisland.png" width="200" alt="Champion Island"><br><b>Champion Island</b></a><br><sub>The whole island and its seven sports</sub><br><a href="https://github.com/Mason363/NumPlay/releases/latest/download/ChampionIsland.nwa">Download</a></td>- <td align="center"><a href="games/undertale/README.md"><img src="docs/media/thumb_undertale.png" width="200" alt="Undertale"><br><b>Undertale</b></a><br><sub>The Ruins, Snowdin and most of Waterfall, from the golden flowers to Temmie Village</sub><br><a href="https://github.com/Mason363/NumPlay/releases/latest/download/Undertale.nwa">Download</a></td>+ <td align="center"><a href="games/undertale/README.md"><img src="docs/media/thumb_undertale.png" width="200" alt="Undertale"><br><b>Undertale</b></a><br><sub>The Ruins, Snowdin and Waterfall, from the golden flowers to Hotland's edge</sub><br><a href="https://github.com/Mason363/NumPlay/releases/latest/download/Undertale.nwa">Download</a></td></tr><tr><td align="center"><a href="#roadmap"><b>More on the way</b></a><br><sub>The rest of Undertale, The Binding of Isaac, Plants vs. Zombies, Doom and more: see the roadmap</sub></td>@@ -174,7 +174,7 @@ Filmed on my own calculator, no emulator.- [x] The Final Earth 2- [x] The Powder Toy (NumPowder)- [x] Block Blast-- [ ] Undertale: the Ruins, Snowdin and most of Waterfall are out, Undyne's fight, Hotland and New Home are next+- [ ] Undertale: the Ruins, Snowdin and Waterfall are out, Hotland, the CORE and New Home are next- [ ] The Binding of Isaac- [ ] Plants vs. Zombies- [ ] Doomdiff --git a/docs/play.md b/docs/play.mdindex 2455168f..7b94c10a 100644--- a/docs/play.md+++ b/docs/play.md@@ -268,7 +268,7 @@ Undertale comes as its own app, `Undertale.nwa`: it is too big to share the calc| **toolbox**, **shift** or **var** | The menu: ITEM, STAT, CELL (C in the game) || **Home** | Keep the moment and quit |-Name the fallen human, then walk and talk your way through the Ruins, Snowdin and Waterfall. In a battle, FIGHT attacks (press **OK** when the bar crosses the middle), ACT checks a monster or does something to it, ITEM eats, and MERCY spares a monster that no longer wants to fight, or flees. Then move your SOUL to dodge; when it turns blue, it falls, and **Up** jumps. On ice you slide until something stops you. In Snowdin Town, walk into the shop to buy, and into the inn to rest. In Waterfall, walk into a bridge seed to push it into the water, where it blooms into a flower you can walk on; the bell calls the seeds back. A green bullet heals you. Walk up to a star and press **OK** to SAVE. Home keeps the moment you were at, and the next start is back there. Your save is also copied into `undertale_saves.py`, so installing the app again doesn't erase it. The Tem Shop in Temmie Village also buys what you carry. For now the game ends past Waterfall's mushroom maze.+Name the fallen human, then walk and talk your way through the Ruins, Snowdin and Waterfall. In a battle, FIGHT attacks (press **OK** when the bar crosses the middle), ACT checks a monster or does something to it, ITEM eats, and MERCY spares a monster that no longer wants to fight, or flees. Then move your SOUL to dodge; when it turns blue, it falls, and **Up** jumps; when it turns green, it stays put, and the arrows turn its shield to block. On ice you slide until something stops you. In Snowdin Town, walk into the shop to buy, and into the inn to rest. In Waterfall, walk into a bridge seed to push it into the water, where it blooms into a flower you can walk on; the bell calls the seeds back. A green bullet heals you. Walk up to a star and press **OK** to SAVE. Home keeps the moment you were at, and the next start is back there. Your save is also copied into `undertale_saves.py`, so installing the app again doesn't erase it. The Tem Shop in Temmie Village also buys what you carry. For now the game ends in Hotland's first room.<br clear="right">diff --git a/games/undertale/README.md b/games/undertale/README.mdindex 59c4b0a6..c5d04f00 100644--- a/games/undertale/README.md+++ b/games/undertale/README.md@@ -8,7 +8,7 @@<p align="center"><b>Fall into the Underground as a human child, on the NumWorks calculator.</b><br>- The Ruins, Snowdin and most of Waterfall, from the bed of golden flowers to Temmie Village. The rest of the Underground is on the way.+ The Ruins, Snowdin and Waterfall, from the bed of golden flowers to Hotland's edge. The rest of the Underground is on the way.</p><p align="center">@@ -25,8 +25,8 @@* **The whole Ruins:** every room, from the golden flowers through Toriel's puzzles, the falling leaves, the spikes, the rocks, the cracked floors and the switches, to Toriel's home and the long corridor under it.* **Its people, with all they have to say:** Flowey, Toriel and her phone calls, Napstablook, the talking rock, the Froggits who give advice, the spider bake sale, the snail facts, and every sign, bookshelf and mirror.* **Snowdin:** Sans and Papyrus, and every one of Papyrus's puzzles: the invisible electricity maze, the X and O tiles, the one on ice, the multicolor tiles and the Gauntlet. Then Snowdin Town, with its shop, inn, library and Papyrus's house.-* **Waterfall:** Monster Kid, Grillby's with Sans, the echo flowers, the bridge seeds (and the secret bridge to the quiche), the wishing room, Undyne chasing you with her spears, Sans's telescope, the marsh where the land is black and the water glows, Onionsan, the piano's secret song, the statue in the rain and Monster Kid under your umbrella. Then the fall into the garbage dump, Mad Dummy, Napstablook's house and snail farm, the small bird back over the gap, Gerson's shop, the mushroom maze and Temmie Village with its Tem Shop.-* **Battles like in the game:** FIGHT with the timing bar, ACT, ITEM and MERCY, and your SOUL dodging each monster's own attacks in the box: Froggit, Whimsun, Moldsmal, Loox, Vegetoid, Migosp, Napstablook and Toriel in the Ruins; Snowdrake, Ice Cap, Gyftrot, Jerry, Chilldrake, Glyde, Doggo, Lesser Dog, Dogamy and Dogaressa, Greater Dog and Papyrus, whose blue attack makes your SOUL fall, in Snowdin; Aaron, Woshua, Moldbygg, Shyren, Temmie and Mad Dummy, who can't be hurt, in Waterfall.+* **Waterfall:** Monster Kid, Grillby's with Sans, the echo flowers, the bridge seeds (and the secret bridge to the quiche), the wishing room, Undyne chasing you with her spears, Sans's telescope, the marsh where the land is black and the water glows, Onionsan, the piano's secret song, the statue in the rain and Monster Kid under your umbrella. Then the fall into the garbage dump, Mad Dummy, Napstablook's house and snail farm, the small bird back over the gap, Gerson's shop, the mushroom maze and Temmie Village with its Tem Shop. And at the end of Waterfall: the lantern maze, Undyne at the dead end (and Monster Kid in her way), the echo flowers' path, Monster Kid on the chasm's bridge, Undyne on her crag, her fight and her chase, and Hotland's edge, where the heat gets her and the water cooler helps.+* **Battles like in the game:** FIGHT with the timing bar, ACT, ITEM and MERCY, and your SOUL dodging each monster's own attacks in the box: Froggit, Whimsun, Moldsmal, Loox, Vegetoid, Migosp, Napstablook and Toriel in the Ruins; Snowdrake, Ice Cap, Gyftrot, Jerry, Chilldrake, Glyde, Doggo, Lesser Dog, Dogamy and Dogaressa, Greater Dog and Papyrus, whose blue attack makes your SOUL fall, in Snowdin; Aaron, Woshua, Moldbygg, Shyren, Temmie, Mad Dummy, who can't be hurt, and Undyne, who turns your SOUL green, in Waterfall.* **Spare or fight:** every monster can be spared, and Flowey at the door remembers what you did. Lose to Papyrus and he only locks you in his shed.* **Saved like in the game:** SAVE at the stars, with the room and the time played. The C menu has your ITEM, STAT and CELL. Home keeps the moment you were at, and your save is also copied into `undertale_saves.py`, so installing the app again doesn't erase it.@@ -87,6 +87,18 @@<td align="center"><img src="docs/gerson.png" width="390" alt="Gerson's shop"><br><sub>Gerson's shop</sub></td><td align="center"><img src="docs/temmie.png" width="390" alt="Temmie Village"><br><sub>Temmie Village</sub></td></tr>+ <tr>+ <td align="center"><img src="docs/deadend.png" width="390" alt="Undyne and Monster Kid at the dead end"><br><sub>Monster Kid gets in Undyne's way</sub></td>+ <td align="center"><img src="docs/chasm.png" width="390" alt="Monster Kid hanging off the bridge"><br><sub>Monster Kid hangs off the bridge</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/crag.png" width="390" alt="Undyne on her crag"><br><sub>Undyne on her crag</sub></td>+ <td align="center"><img src="docs/undyne.png" width="390" alt="Undyne's fight, the green SOUL"><br><sub>Block Undyne's spears with the green SOUL</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/neon.png" width="390" alt="The neon sign"><br><sub>Welcome to Hotland</sub></td>+ <td align="center"><img src="docs/hotland.png" width="390" alt="Undyne in Hotland's heat"><br><sub>Water for Undyne, in Hotland's heat</sub></td>+ </tr></table>## How to play@@ -97,7 +109,7 @@ Monsters jump out as you walk. In a battle, choose FIGHT to attack (press OK wheSnowdin brings new things: when Papyrus turns your SOUL blue, it falls to the bottom of the box, and Up jumps over his bones. On ice you slide until something stops you. Snowdin Town's shop sells food and gear, and its inn gives you a night's rest.-In Waterfall, walk into a bridge seed to push it: in the water it blooms into a flower you can walk on, and the bell calls the seeds back. A green bullet heals you instead of hurting. Talk to the piano to play it, and keep an umbrella for the rain. The Tem Shop is the one shop that buys what you carry.+In Waterfall, walk into a bridge seed to push it: in the water it blooms into a flower you can walk on, and the bell calls the seeds back. A green bullet heals you instead of hurting. Talk to the piano to play it, and keep an umbrella for the rain. The Tem Shop is the one shop that buys what you carry. When Undyne turns your SOUL green, it can't move: turn its shield with the arrows to block her spears. She can't be spared: run, and she'll chase you.Walk up to a star and press OK to SAVE and fill your HP. The C menu (toolbox) shows your items, your STAT and the phone numbers you have.@@ -114,7 +126,7 @@ Walk up to a star and press OK to SAVE and fill your HP. The C menu (toolbox) sh## Good to know* **One app at a time:** Undertale is too big to sit next to NumPlay or the other big games. Installing it from the NumWorks website swaps them out, and installing them again swaps it out. Your saves in each one are kept.-* **The Ruins, Snowdin and most of Waterfall, for now:** the way on past the mushroom maze ends the game, on a screen that says the rest of the Underground is still to come. Undyne's fight at the end of Waterfall, Hotland and New Home come next, one at a time.+* **The Ruins, Snowdin and Waterfall, for now:** Hotland's first room ends the game, on a screen that says the rest of the Underground is still to come. Hotland, the CORE and New Home come next, one at a time.* **No music or sound:** the calculator has no speaker.* **The same Underground:** the rooms and pictures are the game's, everyone says what they say in the game (the longer speeches in shorter words of our own), and the puzzles and battles follow how the game plays them, at its 30 frames a second.diff --git a/games/undertale/docs/chasm.png b/games/undertale/docs/chasm.pngnew file mode 100644index 00000000..f7b31502Binary files /dev/null and b/games/undertale/docs/chasm.png differdiff --git a/games/undertale/docs/crag.png b/games/undertale/docs/crag.pngnew file mode 100644index 00000000..85b4489aBinary files /dev/null and b/games/undertale/docs/crag.png differdiff --git a/games/undertale/docs/deadend.png b/games/undertale/docs/deadend.pngnew file mode 100644index 00000000..109993c2Binary files /dev/null and b/games/undertale/docs/deadend.png differdiff --git a/games/undertale/docs/hotland.png b/games/undertale/docs/hotland.pngnew file mode 100644index 00000000..6fa8db7cBinary files /dev/null and b/games/undertale/docs/hotland.png differdiff --git a/games/undertale/docs/neon.png b/games/undertale/docs/neon.pngnew file mode 100644index 00000000..e5aa2d05Binary files /dev/null and b/games/undertale/docs/neon.png differdiff --git a/games/undertale/docs/undyne.png b/games/undertale/docs/undyne.pngnew file mode 100644index 00000000..6eba7344Binary files /dev/null and b/games/undertale/docs/undyne.png differdiff --git a/games/undertale/src/battle.c b/games/undertale/src/battle.cindex b677c8ea..0a2b4c3a 100644--- a/games/undertale/src/battle.c+++ b/games/undertale/src/battle.c@@ -756,6 +756,16 @@ void battle_draw(void) {attack_draw(&bt, bt.atk, bt.atk_t);bullets_draw();if (!bt.inv || (bt.inv / 2) % 2) gfx_sprite(SPR_HEART, bt.soul_mode, soul_x(), soul_y(), 0, 255);+ if (bt.soul_mode == SOUL_GREEN) {+ /* its ring, and the shield on the side it faces */+ int cx = soul_x(), cy = soul_y();+ for (int a = 0; a < 256; a += 8)+ gfx_rect(cx + 13 * gfx_cos(a) / 1024, cy + 13 * gfx_sin(a) / 1024, 1, 1, rgb565(0x00C000), 255);+ static const int8_t ox[4] = {0, 0, -11, 11}, oy[4] = {11, -11, 0, 0};+ int x = cx + ox[bt.shield], y = cy + oy[bt.shield];+ if (bt.shield < 2) gfx_rect(x - 7, y - 1, 15, 3, rgb565(0x3070FF), 255);+ else gfx_rect(x - 1, y - 7, 3, 15, rgb565(0x3070FF), 255);+ }}gfx_clip_all();if (bt.phase == P_FLEE) gfx_sprite(SPR_HEARTGTFO, (bt.t / 3) % 2, button_x[3] + 8 - bt.t * 3, BUTTON_Y + 11, 0, 255);diff --git a/games/undertale/src/battle.h b/games/undertale/src/battle.hindex 75e8ff34..97d1e857 100644--- a/games/undertale/src/battle.h+++ b/games/undertale/src/battle.h@@ -102,7 +102,7 @@ typedef struct {int16_t angle; /* drawn turned (1/256 turns) */uint8_t owner; /* the monster that made it */} Bullet;-enum { BF_NOCLIP = 1, BF_ONCE = 2, BF_HIDDEN = 4, BF_BOX = 8, BF_FRONT = 16, BF_HARMLESS = 32 };+enum { BF_NOCLIP = 1, BF_ONCE = 2, BF_HIDDEN = 4, BF_BOX = 8, BF_FRONT = 16, BF_HARMLESS = 32, BF_SHIELD = 64 }; /* (shield: the green SOUL's blocks it) */typedef struct Battle {int form;@@ -118,6 +118,7 @@ typedef struct Battle {/* the SOUL */int32_t sx, sy; /* its middle, 1/16 pixels */int soul_mode;+ int shield; /* green: the way its shield faces (DIR_*: down, up, left, right) */int inv; /* invincible for frames */int speed; /* 1/16 pixels a frame *//* the attack */@@ -157,7 +158,7 @@ void bullets_update(void);void bullets_draw(void);bool soul_hit_test(void); /* bullets touching the SOUL hurt it */void soul_update(uint32_t keys);-enum { SOUL_RED, SOUL_BLUE }; /* (the heart's frame too) */+enum { SOUL_RED, SOUL_BLUE, SOUL_GREEN }; /* (the heart's frame too): green stays put, its shield turns */void soul_set_mode(int mode); /* blue: it falls, up jumps */void gfx_bone(int cx, int cy, int w, int h, uint16_t col, uint8_t a);void soul_hurt(int dmg, int color);diff --git a/games/undertale/src/bullets.c b/games/undertale/src/bullets.cindex 489b926a..9672fd3f 100644--- a/games/undertale/src/bullets.c+++ b/games/undertale/src/bullets.c@@ -42,6 +42,14 @@ void soul_update(uint32_t keys) {if (keys & K_X) sp /= 2;int dx = ((keys & K_RIGHT) != 0) - ((keys & K_LEFT) != 0), dy = ((keys & K_DOWN) != 0) - ((keys & K_UP) != 0);int x0 = (bt.x0 + 2 + 4) * FX, x1 = (bt.x1 - 2 - 4) * FX, y0 = (bt.y0 + 2 + 4) * FX, y1 = (bt.y1 - 2 - 4) * FX;+ if (bt.soul_mode == SOUL_GREEN) {+ /* it stays in the middle; the arrows turn its shield */+ static const uint32_t bit[4] = {K_DOWN, K_UP, K_LEFT, K_RIGHT};+ for (int d = 0; d < 4; d++)+ if (keys & bit[d]) bt.shield = d;+ bt.sx = board_cx() * FX, bt.sy = board_cy() * FX;+ return;+ }if (bt.soul_mode == SOUL_BLUE) {bt.sx += dx * sp;if (bt.sy >= y1) {@@ -168,6 +176,15 @@ bool soul_hit_test(void) {Bullet *b = &bullets[i];if (b->kind == BK_NONE || (b->flags & (BF_HIDDEN | BF_HARMLESS))) continue;int bx = b->x / FX, by = b->y / FX;+ if (bt.soul_mode == SOUL_GREEN && (b->flags & BF_SHIELD)) {+ /* the shield stops what comes at it from the side it faces */+ int dx = bx - sx, dy = by - sy;+ int side = abs_i(dx) > abs_i(dy) ? (dx < 0 ? 2 : 3) : (dy < 0 ? 1 : 0);+ if (side == bt.shield && abs_i(dx) + abs_i(dy) <= 15) {+ b->kind = BK_NONE;+ continue;+ }+ }bool touch;if (b->flags & BF_BOX) touch = sx + 3 > bx - b->w / 2 && sx - 3 < bx + b->w / 2 && sy + 3 > by - b->h / 2 && sy - 3 < by + b->h / 2;else touch = (sx - bx) * (sx - bx) + (sy - by) * (sy - by) <= (b->r + 3) * (b->r + 3);diff --git a/games/undertale/src/data.bin b/games/undertale/src/data.binindex 8a4000a4..814b33a8 100644Binary files a/games/undertale/src/data.bin and b/games/undertale/src/data.bin differdiff --git a/games/undertale/src/data.h b/games/undertale/src/data.hindex 6ef50f76..3854ddbb 100644--- a/games/undertale/src/data.h+++ b/games/undertale/src/data.h@@ -207,62 +207,67 @@#define SPR_BIRD 193#define SPR_TUTU 194#define SPR_ARTIFACT 195-#define SPR_SPEAR 196-#define SPR_NOTE 197-#define SPR_DROP 198-#define SPR_ARM 199-#define SPR_DEBRIS 200-#define SPR_AARON_B 201-#define SPR_AARON_HURT 202-#define SPR_WOSHUA_B 203-#define SPR_WOSHUA_HURT 204-#define SPR_MOLDBYGG_B 205-#define SPR_SHYREN_B 206-#define SPR_SHYREN_TURNED 207-#define SPR_INTROIMAGE 208-#define SPR_INTROLAST 209-#define SPR_UNDERTALETITLE 210-#define SPR_GAMEOVERBG 211-#define SPR_FACE_TORIELTALK 212-#define SPR_FACE_TORIELTALKSIDE 213-#define SPR_FACE_TORIELHAPPYTALK 214-#define SPR_FACE_TORIELWHAT 215-#define SPR_FACE_TORIELWHATSIDE 216-#define SPR_FACE_TORIELMAD 217-#define SPR_FACE_TORIELCOLD 218-#define SPR_FACE_TORIELSURPRISED 219-#define SPR_FACE_TORIELEMBARRASSED 220-#define SPR_FACE_TORIELGLASSES 221-#define SPR_FACE_TORIELREVENGETALK 222-#define SPR_FACE_TORIELSCARED 223-#define SPR_FACE_TORIELBLINK 224-#define SPR_FACE_TORIELHAPPYBLINK 225-#define SPR_FACE_TORIELBODY 226-#define SPR_FACE_SANS 227-#define SPR_FACE_SANSCHUCKLE 228-#define SPR_FACE_SANSWINK 229-#define SPR_FACE_PAPYRUS 230-#define SPR_FACE_PAPYRUSEVIL 231-#define SPR_FACE_PAPYRUSLAUGH 232-#define SPR_FACE_PAPYRUSMAD 233-#define SPR_FACE_PAPYRUSSIDE 234-#define SPR_FLOWEYNICE 235-#define SPR_FLOWEYNICESIDE 236-#define SPR_FLOWEYSASSY 237-#define SPR_FLOWEYEVIL 238-#define SPR_FLOWEYGRIN 239-#define SPR_FLOWEYPLAIN 240-#define SPR_FLOWEYPISSED 241-#define SPR_FLOWEYWINK 242-#define SPR_FLOWEYLAUGH 243-#define SPR_FLOWEYHURT 244-#define SPR_FLOWEYTORIEL 245-#define SPR_FLOWEYTORIEL2 246-#define SPR_FLOWEYSIDESHOCK 247+#define SPR_ECHO_OW 196+#define SPR_UNDYNE_FALLEN 197+#define SPR_SPEAR 198+#define SPR_ARROW 199+#define SPR_UNDYNE_B 200+#define SPR_NOTE 201+#define SPR_DROP 202+#define SPR_ARM 203+#define SPR_DEBRIS 204+#define SPR_AARON_B 205+#define SPR_AARON_HURT 206+#define SPR_WOSHUA_B 207+#define SPR_WOSHUA_HURT 208+#define SPR_MOLDBYGG_B 209+#define SPR_SHYREN_B 210+#define SPR_SHYREN_TURNED 211+#define SPR_INTROIMAGE 212+#define SPR_INTROLAST 213+#define SPR_UNDERTALETITLE 214+#define SPR_GAMEOVERBG 215+#define SPR_FACE_TORIELTALK 216+#define SPR_FACE_TORIELTALKSIDE 217+#define SPR_FACE_TORIELHAPPYTALK 218+#define SPR_FACE_TORIELWHAT 219+#define SPR_FACE_TORIELWHATSIDE 220+#define SPR_FACE_TORIELMAD 221+#define SPR_FACE_TORIELCOLD 222+#define SPR_FACE_TORIELSURPRISED 223+#define SPR_FACE_TORIELEMBARRASSED 224+#define SPR_FACE_TORIELGLASSES 225+#define SPR_FACE_TORIELREVENGETALK 226+#define SPR_FACE_TORIELSCARED 227+#define SPR_FACE_TORIELBLINK 228+#define SPR_FACE_TORIELHAPPYBLINK 229+#define SPR_FACE_TORIELBODY 230+#define SPR_FACE_SANS 231+#define SPR_FACE_SANSCHUCKLE 232+#define SPR_FACE_SANSWINK 233+#define SPR_FACE_PAPYRUS 234+#define SPR_FACE_PAPYRUSEVIL 235+#define SPR_FACE_PAPYRUSLAUGH 236+#define SPR_FACE_PAPYRUSMAD 237+#define SPR_FACE_PAPYRUSSIDE 238+#define SPR_FLOWEYNICE 239+#define SPR_FLOWEYNICESIDE 240+#define SPR_FLOWEYSASSY 241+#define SPR_FLOWEYEVIL 242+#define SPR_FLOWEYGRIN 243+#define SPR_FLOWEYPLAIN 244+#define SPR_FLOWEYPISSED 245+#define SPR_FLOWEYWINK 246+#define SPR_FLOWEYLAUGH 247+#define SPR_FLOWEYHURT 248+#define SPR_FLOWEYTORIEL 249+#define SPR_FLOWEYTORIEL2 250+#define SPR_FLOWEYSIDESHOCK 251#define AREA_RUINS 0#define AREA_SNOWDIN 1#define AREA_SNOWTOWN 2#define AREA_WATERFALL 3+#define AREA_HOTLAND 4#define ROOM_AREA1 0#define ROOM_AREA1_2 1#define ROOM_RUINS1 2@@ -382,10 +387,18 @@#define ROOM_WF_TWIN 116#define ROOM_WF_MUSHROOM 117#define ROOM_WF_TEMMIE 118+#define ROOM_WF_LANTERN 119+#define ROOM_WF_DEADEND 120+#define ROOM_WF_ECHOPATH 121+#define ROOM_WF_CHASM 122+#define ROOM_WF_ARENA 123+#define ROOM_WF_NORTH 124+#define ROOM_WF_HOTGATE 125+#define ROOM_HT_ENTRANCE 126#define FONT_MAIN 0#define FONT_MENU 1#define FONT_SMALL 2-#define NUM_SPRITES 248-#define NUM_ROOMS 119+#define NUM_SPRITES 252+#define NUM_ROOMS 127#define NUM_FONTS 3#endifdiff --git a/games/undertale/src/events.c b/games/undertale/src/events.cindex 8b583a81..169d0945 100644--- a/games/undertale/src/events.c+++ b/games/undertale/src/events.c@@ -115,5 +115,7 @@ int event_run(Ev *c) {if (r >= 0) return r;r = wf2_event(c);if (r >= 0) return r;+ r = wf3_event(c);+ if (r >= 0) return r;return 1;}diff --git a/games/undertale/src/events.h b/games/undertale/src/events.hindex 3bdfae3f..6e1f82b0 100644--- a/games/undertale/src/events.h+++ b/games/undertale/src/events.h@@ -41,7 +41,9 @@ enum {EV_WF_ONION, EV_PIANO, EV_SHYREN, EV_STATUE, EV_UMBRELLA, EV_MK_RAIN, EV_MK_TALK, EV_WF_BRIDGE_END,/* wf2.c */EV_DUMP_WAKE, EV_COOLER, EV_MAD_DUMMY, EV_NAPSTA_ROOM, EV_LOCKED_HOUSE, EV_SNAILS, EV_GERSON, EV_TEM_SHOP, EV_TEMMIE,- EV_WF_EAST_END,+ /* wf3.c */+ EV_LANTERN, EV_DEADEND, EV_MK_CHASM, EV_ARENA, EV_UNDYNE_CATCH, EV_PAP_NEON, EV_HOT_UNDYNE, EV_HOT_COOLER,+ EV_HOT_END,EV_COUNT};/* Toriel's calls on the way (EV_CALL's v[0]) */diff --git a/games/undertale/src/flags.h b/games/undertale/src/flags.hindex 7111f7eb..ada941ab 100644--- a/games/undertale/src/flags.h+++ b/games/undertale/src/flags.h@@ -117,7 +117,13 @@ enum {F_NAPSTA_HOME, /* 1 invited home, 2 lay on the floor with them */F_SNAIL_RACE, /* Thundersnail races run */F_TEM_VILLAGE, /* found */- F_WF_EAST1, /* the way past the mushroom maze reached (where the game now ends) */+ F_WF_EAST1, /* (unused: the mushroom maze's far side once ended the game) */+ F_DEADEND, /* Undyne at the dead end, Monster Kid in her way: the way north lit */+ F_MK_CHASM, /* Monster Kid on the chasm's bridge: 1 hanging, 2 helped up, 3 let fall, 4 left behind */+ F_UNDYNE, /* her fight: 1 fled (she chases), 2 killed, 3 fallen in the heat, 4 given water */+ F_WATER_CUP, /* a cup of the cooler's water: 1 carried, 2 poured */+ F_PAP_NEON, /* Papyrus's call by the neon sign */+ F_HOTLAND, /* Hotland reached (where the game now ends) */FLAG_COUNT = 256};#endifdiff --git a/games/undertale/src/menu.c b/games/undertale/src/menu.cindex 506e6387..67855c4e 100644--- a/games/undertale/src/menu.c+++ b/games/undertale/src/menu.c@@ -368,7 +368,7 @@ void menu_gameover_open(void) {void menu_end_open(void) {g_mode = MODE_END;t = 0;- writer_start(&w, "Past the mushrooms, the path\ngoes on into the dark...|The rest of Waterfall,\nand the underground beyond,\nare still to come...", 40, 90, FONT_MAIN);+ writer_start(&w, "Out of Waterfall at last,\ninto the heat of Hotland...|The rest of the underground\nis still to come...", 40, 90, FONT_MAIN);w.speed = 2;}diff --git a/games/undertale/src/menu.h b/games/undertale/src/menu.hindex c34a20f4..8e2ecbf5 100644--- a/games/undertale/src/menu.h+++ b/games/undertale/src/menu.h@@ -6,7 +6,7 @@ void menu_title_open(void);void menu_open(void);void menu_save_open(void);void menu_gameover_open(void);-void menu_end_open(void); /* past Waterfall's mushroom maze: what comes next isn't made yet */+void menu_end_open(void); /* at Hotland's edge: what comes next isn't made yet */void menu_update(uint32_t keys, uint32_t pressed);void menu_draw(void);void game_new(const char *name);diff --git a/games/undertale/src/monsters.h b/games/undertale/src/monsters.hindex 5c165146..8fd40598 100644--- a/games/undertale/src/monsters.h+++ b/games/undertale/src/monsters.h@@ -10,7 +10,7 @@ enum {MON_SNOWDRAKE = MON_RUINS_COUNT, MON_ICECAP, MON_GYFTROT, MON_DOGGO, MON_LESSERDOG, MON_DOGAMY, MON_DOGARESSA,MON_GREATERDOG, MON_JERRY, MON_CHILLDRAKE, MON_GLYDE, MON_PAPYRUS, MON_SNOW_COUNT,/* Waterfall (wfmon.c) */- MON_AARON = MON_SNOW_COUNT, MON_WOSHUA, MON_MOLDBYGG, MON_SHYREN, MON_MAD_DUMMY, MON_TEMMIE, MON_COUNT+ MON_AARON = MON_SNOW_COUNT, MON_WOSHUA, MON_MOLDBYGG, MON_SHYREN, MON_MAD_DUMMY, MON_TEMMIE, MON_UNDYNE, MON_COUNT};/* formations: who is fought */@@ -24,7 +24,7 @@ enum {FORM_GREATERDOG, FORM_PAPYRUS, FORM_SNOW_COUNT,/* Waterfall */FORM_AARON = FORM_SNOW_COUNT, FORM_WOSHUA, FORM_WOSHUA_AARON, FORM_MOLDBYGG, FORM_MOLDBYGG_MOLDSMAL,- FORM_MOLDBYGG_WOSHUA, FORM_SHYREN, FORM_MAD_DUMMY, FORM_TEMMIE, FORM_TEMMIE_MOLDBYGG, FORM_COUNT+ FORM_MOLDBYGG_WOSHUA, FORM_SHYREN, FORM_MAD_DUMMY, FORM_TEMMIE, FORM_TEMMIE_MOLDBYGG, FORM_UNDYNE, FORM_COUNT};enum {@@ -39,7 +39,7 @@ enum {/* Waterfall */ATK_AARON_ARMS = ATK_SNOW_COUNT, ATK_AARON_SWEAT, ATK_WOSHUA_DROPS, ATK_WOSHUA_BUBBLES, ATK_MOLDBYGG_HOPS,ATK_MOLDBYGG_RAIN, ATK_SHYREN_NOTES, ATK_DUMMY_MINIONS, ATK_DUMMY_MISSILES, ATK_TEMMIE_HOPS,- ATK_COUNT+ ATK_UNDYNE_ARROWS, ATK_UNDYNE_SPEARS, ATK_COUNT};/* a formation: up to three monsters, and what the first turn says */diff --git a/games/undertale/src/rooms.c b/games/undertale/src/rooms.cindex d2a0b73a..4f6c279e 100644--- a/games/undertale/src/rooms.c+++ b/games/undertale/src/rooms.c@@ -19,6 +19,7 @@ void room_setup(int room, int from) {town_setup(room, from);wf1_setup(room, from);wf2_setup(room, from);+ wf3_setup(room, from);}/* each frame Frisk can walk: what a room watches (a rock on its switch, a cracked floor) */@@ -27,6 +28,7 @@ void room_update(void) {snow1_update();snow2_update();wf1_update();+ wf3_update();}/* what a room draws on its floor, under everything (world.c) */diff --git a/games/undertale/src/waterfall.h b/games/undertale/src/waterfall.hindex ce53db9b..0e769607 100644--- a/games/undertale/src/waterfall.h+++ b/games/undertale/src/waterfall.h@@ -1,4 +1,5 @@-/* Undertale: Waterfall (wf1.c: from Snowdin to the bridge Undyne cuts), its monsters (wfmon.c). */+/* Undertale: Waterfall (wf1.c: from Snowdin to the bridge Undyne cuts; wf2.c: the dump to Temmie Village; wf3.c:+ * on to Hotland), its monsters (wfmon.c). */#ifndef UT_WATERFALL_H#define UT_WATERFALL_H#include "event.h"@@ -12,4 +13,10 @@ void wf_battle_done(int form);void wf2_setup(int room, int from);int wf2_event(Ev *c); /* -1: not one of its */void wf_bird_setup(int room); /* the small bird, on its side of the gap */+Obj *wf_mk(int x, int y, int dir); /* Monster Kid, Undyne in her armor (their feet at (x, y)) */+Obj *wf_undyne(int x, int y);+/* wf3.c: the lantern maze to Hotland's edge */+void wf3_setup(int room, int from);+int wf3_event(Ev *c); /* -1: not one of its */+void wf3_update(void);#endifdiff --git a/games/undertale/src/wf1.c b/games/undertale/src/wf1.cindex a81c3c79..5a29bbfe 100644--- a/games/undertale/src/wf1.c+++ b/games/undertale/src/wf1.c@@ -29,6 +29,8 @@ static Obj *obj_undyne(int x, int y) {if (o) o->flags &= (uint16_t)~OF_SOLID;return o;}+Obj *wf_mk(int x, int y, int dir) { return obj_mk(x, y, dir); }+Obj *wf_undyne(int x, int y) { return obj_undyne(x, y); }/* a thing to pick up: its item and the flag that says it's taken (and what's drawn of it, at (x, y)) */static void pickup(int x, int y, int w, int h, int item, int fl, uint16_t spr) {if (flag(fl)) return;@@ -545,7 +547,7 @@ static int ev_wf_grass(Ev *c) {WAIT(30);NARRATE("* (...and pulls out Monster Kid.)");WAIT(20);- NARRATE("* (She drops him, and walks away.)");+ NARRATE("* (She drops them, and walks away.)");}u = obj_get(ACTOR_UNDYNE);WALK(u, 6560, 520, 2);diff --git a/games/undertale/src/wf2.c b/games/undertale/src/wf2.cindex d47078df..23ccc1ed 100644--- a/games/undertale/src/wf2.c+++ b/games/undertale/src/wf2.c@@ -7,7 +7,6 @@#include "events.h"#include "game.h"#include "items.h"-#include "menu.h"#include "monsters.h"#include "save.h"#include "shop.h"@@ -113,11 +112,6 @@ void wf2_setup(int room, int from) {case ROOM_WF_TWIN:obj_sign(19860, 2290, 30, 20, "* (The water here is shallow. You wade on.)");break;- case ROOM_WF_MUSHROOM:- if (!flag(F_WF_EAST1)) {- obj_trigger(21144, 2350, 16, 500, EV_WF_EAST_END, ACTOR_TRIGGER);- }- break;case ROOM_WF_TEMMIE:set_flag(F_TEM_VILLAGE, 1);obj_save(21325, 3120, "* (The Temmies' cheer fills you with determination.)");@@ -253,15 +247,6 @@ static int ev_temmie(Ev *c) {EV_END;}-static int ev_east_end(Ev *c) {- EV_BEGIN;- set_flag(F_WF_EAST1, 1);- sv.room = (int16_t)g_room, sv.x = (int16_t)(pl.x - 30), sv.y = pl.y;- save_write_auto();- menu_end_open();- EV_END;-}-int wf2_event(Ev *c) {switch (c->id) {case EV_DUMP_WAKE: return ev_dump_wake(c);@@ -272,7 +257,6 @@ int wf2_event(Ev *c) {case EV_SNAILS: return ev_snails(c);case EV_GERSON: case EV_TEM_SHOP: return ev_shop_door(c);case EV_TEMMIE: return ev_temmie(c);- case EV_WF_EAST_END: return ev_east_end(c);}return -1;}diff --git a/games/undertale/src/wf3.c b/games/undertale/src/wf3.cnew file mode 100644index 00000000..bc291534--- /dev/null+++ b/games/undertale/src/wf3.c@@ -0,0 +1,380 @@+/* Waterfall, its end: the lantern maze, the dead end where Undyne finds Frisk (and Monster Kid gets in her way),+ * the echo flowers' path, the chasm's bridge, Undyne on her crag and her fight, the chase by the river and the+ * neon sign, and Hotland's edge, where she falls in the heat. (As the Undertale Wiki describes them; what they say+ * is ours, in short.) */+#include <stddef.h>+#include "battle.h"+#include "event.h"+#include "events.h"+#include "game.h"+#include "menu.h"+#include "monsters.h"+#include "save.h"+#include "snowdin.h"+#include "waterfall.h"+#include "world.h"++static void gone(Obj *o) { o->kind = OBJ_NONE; }++#define ECHO(s) "* (The echo flower whispers.)|* " s+static void echo(int x, int y, const char *text) { obj_sign(x - 10, y - 14, 20, 40, text); }++/* ---------------------------------------------------------------- Undyne, after Frisk */+/* fled from her fight, she chases Frisk through the arena, the river and the neon sign's hall: slower than Frisk,+ * but a catch is another fight */+static bool chasing;+static int stun_t;+static void chase_update(void) {+ if (!chasing || event_running()) return;+ Obj *u = obj_find(ACTOR_UNDYNE);+ if (!u) return;+ if (stun_t) {+ stun_t--;+ return;+ }+ int dx = pl.x + 10 - u->x, dy = pl.y + 29 - u->y;+ u->x = (int16_t)(u->x + clamp_i(dx, -2, 2)), u->y = (int16_t)(u->y + clamp_i(dy, -2, 2));+ if (abs_i(dx) < 14 && abs_i(dy) < 12) event_start(EV_UNDYNE_CATCH, u);+}+/* she comes in after Frisk, from the way Frisk came */+static void chase_setup(void) {+ if (flag(F_UNDYNE) != 1) return;+ static const int8_t back[4][2] = {{0, -1}, {0, 1}, {1, 0}, {-1, 0}};+ chasing = true, stun_t = 30;+ wf_undyne(pl.x + 10 + back[pl.dir][0] * 70, pl.y + 29 + back[pl.dir][1] * 70);+}++/* Monster Kid on the chasm's bridge: how it went (EV_MK_CHASM's v[0]: 0 they meet, 1 Frisk helps them up, 3+ * Undyne gets there first, 4 Frisk runs off) */+static int mk_how;++void wf3_update(void) {+ if (g_room < ROOM_WF_LANTERN || g_room > ROOM_HT_ENTRANCE) return;+ chase_update();+ if (g_room == ROOM_WF_CHASM && flag(F_MK_CHASM) == 1 && !event_running()) {+ Obj *u = obj_find(ACTOR_UNDYNE);+ if (pl.x < 22330) mk_how = 4, event_start(EV_MK_CHASM, NULL);+ else if (u && (!u->walking || u->x - (pl.x + 10) < 24)) mk_how = 3, event_start(EV_MK_CHASM, NULL);+ }+}++/* ---------------------------------------------------------------- the rooms */+void wf3_setup(int room, int from) {+ (void)from;+ chasing = false;+ if (room < ROOM_WF_LANTERN || room > ROOM_HT_ENTRANCE) return;+ switch (room) {+ case ROOM_WF_LANTERN:+ obj_sign(21176, 2414, 48, 28, "* (The lanterns light the way through the crystals.\n* Their glow is dim, but it's enough.)");+ {+ static const int16_t lx[5] = {21260, 21440, 21280, 21680, 21720}, ly[5] = {2440, 2640, 2740, 2800, 2420};+ for (int i = 0; i < 5; i++) obj_sign(lx[i], ly[i], 20, 20, "* (A lantern, glowing softly.)");+ }+ break;+ case ROOM_WF_DEADEND: {+ /* the end of the dark: an echo flower; the way north hidden in the grass until Undyne has come */+ Obj *e = obj_deco(SPR_ECHO_OW, 22420, 2686, true);+ if (e) obj_set_box(e, -8, -8, 16, 8);+ if (!flag(F_DEADEND)) {+ Obj *f = obj_trigger(22408, 2650, 24, 40, EV_DEADEND, ACTOR_TRIGGER);+ if (f) f->flags = OF_TALK;+ Obj *b = obj_trigger(22160, 2556, 62, 64, EV_NONE, ACTOR_TRIGGER2);+ if (b) b->flags = OF_SOLID | OF_HIDDEN;+ } else {+ echo(22420, 2666, ECHO("\"...\"\n* (It only gives back the quiet now.)"));+ }+ break;+ }+ case ROOM_WF_ECHOPATH:+ echo(22170, 2150, ECHO("\"It's so quiet back here.\n Does anyone ever come this way?\""));+ echo(22210, 2230, ECHO("\"One day I'll see the stars.\n The real ones, up on the surface.\""));+ echo(22170, 2330, ECHO("\"Shh... did you hear that?\n Footsteps...\""));+ echo(22210, 2370, ECHO("\"If you could wish for anything...\n what would it be?\""));+ break;+ case ROOM_WF_CHASM:+ /* the glyph at the end of the echo flowers' path, a SAVE, Monster Kid on the bridge */+ obj_sign(22180, 1978, 38, 44,+ "* (Ancient glyphs, about a prophecy.)|* (An angel will come down from the surface...)\n* (...and the underground will go empty.)");+ echo(22210, 2070, ECHO("\"Yo... where'd everybody go?\""));+ obj_save(22300, 2000, "* (The roar of the chasm fills you with determination.)");+ if (flag(F_MK_CHASM) == 1) set_flag(F_MK_CHASM, 4); /* (left in the middle of it) */+ if (!flag(F_MK_CHASM)) {+ wf_mk(22560, 2058, DIR_LEFT);+ obj_trigger(22396, 1990, 12, 110, EV_MK_CHASM, ACTOR_TRIGGER);+ }+ break;+ case ROOM_WF_ARENA:+ obj_save(23520, 2038, "* (Undyne's crag looms over you.)\n* (You're filled with determination.)");+ if (!flag(F_UNDYNE)) {+ wf_undyne(23455, 1570);+ obj_trigger(23300, 1980, 12, 100, EV_ARENA, ACTOR_TRIGGER);+ }+ chase_setup();+ break;+ case ROOM_WF_NORTH:+ chase_setup();+ break;+ case ROOM_WF_HOTGATE:+ obj_sign(23648, 672, 505, 100,+ flag(F_UNDYNE) == 2 ? "* (A neon sign. It's switched off.)" : "* (A neon sign.\n* It says WELCOME TO HOTLAND!)");+ if (!flag(F_PAP_NEON)) obj_trigger(23700, 760, 12, 70, EV_PAP_NEON, ACTOR_TRIGGER2);+ chase_setup();+ break;+ case ROOM_HT_ENTRANCE:+ obj_sign(130, 6140, 60, 92, "* (Sans's other sentry station.)\n* (He's here too, somehow.)");+ {+ Obj *k = obj_trigger(718, 6162, 30, 46, EV_HOT_COOLER, ACTOR_ITEM);+ if (k) k->flags = OF_TALK | OF_SOLID;+ }+ if (flag(F_UNDYNE) == 1) {+ obj_trigger(0, 6100, 1460, 300, EV_HOT_UNDYNE, ACTOR_TRIGGER); /* (she's right behind) */+ } else if (flag(F_UNDYNE) == 3) {+ Obj *f = obj_deco(SPR_UNDYNE_FALLEN, 534, 6213, false);+ if (f) f->name = ACTOR_UNDYNE, f->event = EV_HOT_UNDYNE, f->flags |= OF_TALK, obj_set_box(f, 0, 6, 50, 20);+ }+ if (!flag(F_HOTLAND)) obj_trigger(1000, 6100, 16, 300, EV_HOT_END, ACTOR_TRIGGER2);+ break;+ }+}++/* ---------------------------------------------------------------- the events */+static int ev_deadend(Ev *c) {+ Obj *u = obj_get(ACTOR_UNDYNE), *mk = obj_get(ACTOR_MK);+ EV_BEGIN;+ /* the echo flower at the end; the room lights up, and Undyne is there */+ NARRATE("* (The echo flower gives back the sound of your own footsteps.)");+ WAIT(20);+ pl.dir = DIR_LEFT;+ u = wf_undyne(pl.x - 170, pl.y + 29);+ WALK(u, pl.x - 50, pl.y + 29, 2);+ WAIT(20);+ NARRATE("* (Undyne raises her spear.)");+ /* ...and Monster Kid jumps out of the grass, right between them */+ mk = wf_mk(21960, pl.y + 31, DIR_RIGHT);+ WALK(mk, pl.x - 22, pl.y + 31, 6);+ mk->dir = DIR_LEFT;+ NARRATE("* Yo!! Undyne!! You're here!|* Are you gonna fight somebody?!\n* Can I watch? Please please please?!");+ WAIT(15);+ NARRATE("* (Undyne grabs Monster Kid by the arm...)");+ u = obj_get(ACTOR_UNDYNE), mk = obj_get(ACTOR_MK);+ WALK_TO(mk, 21840, mk->y, 2);+ WALK(u, 21810, u->y, 2);+ NARRATE("* (...and drags them away.)");+ gone(obj_get(ACTOR_UNDYNE)), gone(obj_get(ACTOR_MK));+ set_flag(F_DEADEND, 1);+ gone(obj_get(ACTOR_TRIGGER2));+ if (c->self) gone(c->self);+ WAIT(20);+ NARRATE("* (In the grass, a hidden path lights up.)");+ EV_END;+}++static int ev_mk_chasm(Ev *c) {+ Obj *u = obj_get(ACTOR_UNDYNE), *mk = obj_get(ACTOR_MK);+ EV_BEGIN;+ c->v[0] = c->self && c->self->name == ACTOR_MK ? 1 : mk_how;+ mk_how = 0;+ if (c->v[0] == 0) {+ /* they meet on the bridge: Monster Kid has learned what Frisk is */+ if (c->self) gone(c->self);+ WALK(mk, pl.x + 56, mk->y, 3);+ NARRATE("* Yo... I gotta ask you something.|* Undyne told me to stay away from you.\n* She says you're a human.|* ...|* So that means... I gotta be your enemy now, right?|* Okay! Here goes! You're a... you're a big...|* ...ugh. I can't think of anything mean.|* Forget it! See ya!");+ mk = obj_get(ACTOR_MK);+ mk->dir = DIR_RIGHT;+ WALK(mk, 22639, mk->y, 4);+ /* ...and trips over the edge */+ g_shake = 4;+ mk->y = 2084;+ obj_set_box(mk, -10, -30, 20, 30);+ mk->event = EV_MK_CHASM, mk->flags = OF_TALK;+ NARRATE("* (Monster Kid trips over the edge of the bridge!)|* Y-yo... a little help...?");+ u = wf_undyne(22900, 2058);+ WALK_TO(u, 22672, 2058, 1);+ set_flag(F_MK_CHASM, 1);+ NARRATE("* (Undyne is coming across the bridge.)");+ return 1;+ }+ if (c->v[0] == 1) {+ /* Frisk pulls them up: Monster Kid stands up to Undyne, and she backs off */+ u->walking = 0;+ NARRATE("* (You pull Monster Kid back up.)");+ mk->x = (int16_t)(pl.x + 40), mk->y = 2058, mk->dir = DIR_RIGHT, obj_set_box(mk, -6, -8, 12, 8);+ WAIT(10);+ NARRATE("* Undyne...|* If you wanna hurt them...\n* you'll have to get through me first!");+ WAIT(20);+ NARRATE("* (Undyne hesitates... then turns away.)");+ u = obj_get(ACTOR_UNDYNE);+ WALK(u, 22920, u->y, 3);+ gone(u);+ mk = obj_get(ACTOR_MK);+ mk->dir = DIR_LEFT;+ NARRATE("* Yo... thanks for saving me.|* We're still friends, right? Cool.|* I'd better get home before my parents worry. Later!");+ mk = obj_get(ACTOR_MK);+ WALK(mk, 22920, mk->y, 4);+ gone(mk);+ set_flag(F_MK_CHASM, 2);+ return 1;+ }+ if (c->v[0] == 3) {+ /* Undyne gets there first: Monster Kid falls, and she dives after them */+ NARRATE("* (Monster Kid can't hold on any more...)");+ gone(mk);+ WALK(u, 22650, u->y, 4);+ NARRATE("* (Undyne dives off the bridge after them!)");+ gone(obj_get(ACTOR_UNDYNE));+ WAIT(45);+ g_shake = 6;+ u = wf_undyne(22650, 2058);+ wf_mk(22676, 2058, DIR_LEFT);+ WAIT(15);+ NARRATE("* (Undyne climbs back up, Monster Kid with her.)\n* (She's badly hurt.)");+ NARRATE("* Undyne... you were right about them.|* They just stood there and watched me fall.");+ u = obj_get(ACTOR_UNDYNE), mk = obj_get(ACTOR_MK);+ WALK_TO(mk, 22940, mk->y, 2);+ WALK(u, 22920, u->y, 2);+ gone(obj_get(ACTOR_UNDYNE)), gone(obj_get(ACTOR_MK));+ set_flag(F_MK_CHASM, 3);+ return 1;+ }+ /* Frisk ran off: behind, Undyne helps Monster Kid up */+ gone(mk), gone(u);+ NARRATE("* (Behind you, Undyne pulls Monster Kid back up.)");+ set_flag(F_MK_CHASM, 4);+ EV_END;+}++/* after a fight: killed, she's gone; fled, she comes after Frisk */+static int undyne_after(void) {+ Obj *u = obj_find(ACTOR_UNDYNE);+ if (bt.mon[0].killed) {+ set_flag(F_UNDYNE, 2);+ chasing = false;+ if (u) gone(u);+ return 2;+ }+ set_flag(F_UNDYNE, 1);+ chasing = true, stun_t = 50;+ /* (she gets up behind Frisk, a little back the way Frisk came) */+ if (!u) u = wf_undyne(0, 0);+ u->x = (int16_t)(pl.x - 60), u->y = (int16_t)(pl.y + 29);+ return 1;+}++static int ev_arena(Ev *c) {+ EV_BEGIN;+ if (c->self) gone(c->self);+ /* Undyne, on top of her crag */+ WAIT_UNTIL(cam_pan(23290, 1440, 4));+ WAIT(15);+ NARRATE("* (Undyne stands on top of the crag.)");+ NARRATE("* You. Human.|* King Asgore has six human SOULs already.|* With one more, he can break the barrier\n and set every monster free.|* So yours is coming with me.|* I've chased you all through Waterfall.\n* No more running.|* Get ready, human! Here I come!");+ NARRATE("* (Undyne leaps down from the crag!)");+ gone(obj_get(ACTOR_UNDYNE));+ WAIT_UNTIL(cam_pan(23250, 1840, 8));+ cam_free();+ g_shake = 8;+ wf_undyne(pl.x + 50, pl.y + 29);+ WAIT(15);+ BATTLE(FORM_UNDYNE);+ if (undyne_after() == 2) {+ NARRATE("* Heh... so that's how it ends...|* Alphys... the rest... is on you...");+ NARRATE("* (Undyne melts away.)");+ } else {+ stun_t = 50;+ NARRATE("* (Undyne isn't letting you get away that easily!)");+ }+ EV_END;+}++static int ev_undyne_catch(Ev *c) {+ EV_BEGIN;+ NARRATE("* (Undyne catches up with you!)");+ BATTLE(FORM_UNDYNE);+ if (undyne_after() == 2) NARRATE("* Heh... so that's how it ends...|* Alphys... the rest... is on you...|* (Undyne melts away.)");+ EV_END;+}++static int ev_pap_neon(Ev *c) {+ EV_BEGIN;+ if (c->self) gone(c->self);+ set_flag(F_PAP_NEON, 1);+ SAY(FACE_PAPYRUS, "* Ring...|`0* HUMAN! PAPYRUS HERE!|* I'VE BEEN THINKING ABOUT FRIENDSHIP.|`2* AND I THINK YOU AND UNDYNE\n WOULD BE THE BEST OF FRIENDS!!!|* WE SHOULD ALL GET TOGETHER SOMETIME!|`0* WELL! BYE!");+ if (chasing) NARRATE("* (Undyne waited politely for you to hang up.)");+ EV_END;+}++/* Hotland's heat: Undyne, after Frisk in her armor, falls on the bridge; the cooler's water gets her up */+static int ev_hot_undyne(Ev *c) {+ Obj *u = obj_get(ACTOR_UNDYNE);+ EV_BEGIN;+ if (flag(F_UNDYNE) == 1) {+ if (c->self) gone(c->self);+ PL_WALK(640, 6206, 3);+ pl.dir = DIR_LEFT;+ u = wf_undyne(4, 6236);+ WALK(u, 300, 6236, 2);+ WALK(u, 556, 6236, 1);+ g_shake = 6;+ gone(u);+ u = obj_deco(SPR_UNDYNE_FALLEN, 534, 6213, false);+ if (u) u->name = ACTOR_UNDYNE, u->event = EV_HOT_UNDYNE, u->flags |= OF_TALK, obj_set_box(u, 0, 6, 50, 20);+ set_flag(F_UNDYNE, 3);+ NARRATE("* (Undyne collapses on the bridge.)\n* (In all that armor, the heat is too much for her.)");+ return 1;+ }+ if (flag(F_WATER_CUP) != 1) {+ NARRATE("* (Undyne lies there, dried out by the heat.)");+ return 1;+ }+ NARRATE("* (Pour the water on her?)@Pour@Don't");+ if (CHOICE() == 1) return 1;+ set_flag(F_WATER_CUP, 2);+ NARRATE("* (You pour the water on Undyne.)");+ WAIT(30);+ gone(u);+ u = wf_undyne(558, 6238);+ WAIT(20);+ NARRATE("* (Undyne gets up... and stares at you for a long time.)");+ u = obj_get(ACTOR_UNDYNE);+ WALK(u, -20, u->y, 2);+ gone(u);+ set_flag(F_UNDYNE, 4);+ EV_END;+}++static int ev_hot_cooler(Ev *c) {+ EV_BEGIN;+ if (flag(F_UNDYNE) == 3 && !flag(F_WATER_CUP)) {+ NARRATE("* (A water cooler.)\n* (Take a cup of water?)@Yes@No");+ if (CHOICE() == 0) {+ set_flag(F_WATER_CUP, 1);+ NARRATE("* (You fill a cup with cold water.)");+ }+ } else {+ NARRATE("* (A water cooler. The water's nice and cold.)");+ }+ EV_END;+}++static int ev_hot_end(Ev *c) {+ EV_BEGIN;+ set_flag(F_HOTLAND, 1);+ sv.room = (int16_t)g_room, sv.x = (int16_t)(pl.x - 30), sv.y = pl.y;+ save_write_auto();+ menu_end_open();+ EV_END;+}++int wf3_event(Ev *c) {+ switch (c->id) {+ case EV_DEADEND: return ev_deadend(c);+ case EV_MK_CHASM: return ev_mk_chasm(c);+ case EV_ARENA: return ev_arena(c);+ case EV_UNDYNE_CATCH: return ev_undyne_catch(c);+ case EV_PAP_NEON: return ev_pap_neon(c);+ case EV_HOT_UNDYNE: return ev_hot_undyne(c);+ case EV_HOT_COOLER: return ev_hot_cooler(c);+ case EV_HOT_END: return ev_hot_end(c);+ }+ return -1;+}diff --git a/games/undertale/src/wfmon.c b/games/undertale/src/wfmon.cindex 541eb51d..ec500afd 100644--- a/games/undertale/src/wfmon.c+++ b/games/undertale/src/wfmon.c@@ -173,6 +173,30 @@ static const char *talk_temmie(Battle *b, Monster *m) {}static int attack_temmie(Battle *b, Monster *m) { (void)b, (void)m; return ATK_TEMMIE_HOPS; }+/* ---------------------------------------------------------------- Undyne: no sparing her; she turns the SOUL green+ * (block her spears with its shield), then red again (her spears from the ground). Running is the friendly way */+static void act_undyne(Battle *b, Monster *m, int act, char *t, int cap) {+ (void)m;+ if (act == 0) snprintf(t, (size_t)cap, "* You tell Undyne you don't want to fight.\n* She isn't listening.");+ else {+ b->state[0]++;+ snprintf(t, (size_t)cap, "* You tell Undyne her spears are too slow.\n* Her spears get faster!");+ }+}+static const char *talk_undyne(Battle *b, Monster *m) {+ (void)m;+ static const char *const lines[] = {"Ha! You\ncan't run\nnow!", "Use the\nshield!\nBlock!", "Is that\nall you've\ngot?",+ "For every\nmonster's\nfuture!", "You're\ntougher\nthan you\nlook!", "NGAAH!"};+ return lines[(b->turn - 1) % 6];+}+static const char *flavor_undyne(Battle *b, Monster *m) {+ (void)m;+ static const char *const lines[] = {"* Undyne points her spear at you.", "* Undyne's eye is fixed on you.",+ "* Undyne flips her spear around.", "* Smells like sushi."};+ return lines[b->turn % 4];+}+static int attack_undyne(Battle *b, Monster *m) { (void)m; return b->turn % 2 ? ATK_UNDYNE_ARROWS : ATK_UNDYNE_SPEARS; }+static const MonDef wf_defs[MON_COUNT - MON_SNOW_COUNT] = {[MON_AARON - MON_SNOW_COUNT] = {.name = "Aaron", .spare_gold = 30, .hp = 98, .at = 7, .df = 2, .exp = 52, .gold = 30, .spr_idle = SPR_AARON_B,@@ -210,6 +234,11 @@ static const MonDef wf_defs[MON_COUNT - MON_SNOW_COUNT] = {.acts = {"Flex", "Talk", "Feed Flakes"}, .nacts = 3,.neutral = {"* Temmie is vibrating.", "* Temmie is trying to pet you.", "* Smells like Temmie Flakes."},.act = act_temmie, .talk = talk_temmie, .attack = attack_temmie},+ [MON_UNDYNE - MON_SNOW_COUNT] = {+ .name = "Undyne", .hp = 1500, .at = 6, .df = 20, .exp = 500, .gold = 0, .spr_idle = SPR_UNDYNE_B,+ .spr_hurt = SPR_UNDYNE_B, .idle_speed = 5, .check = "Head of the Royal Guard. She does not back down.",+ .acts = {"Plead", "Challenge"}, .nacts = 2, .act = act_undyne, .talk = talk_undyne, .attack = attack_undyne,+ .flavor = flavor_undyne},};const MonDef *wf_mon_def(int id) { return &wf_defs[id - MON_SNOW_COUNT]; }@@ -232,6 +261,7 @@ static const Form wf_forms[FORM_COUNT - FORM_SNOW_COUNT] = {[FORM_MAD_DUMMY - FORM_SNOW_COUNT] = {{MON_MAD_DUMMY}, 1, "* Mad Dummy blocks the way!"},[FORM_TEMMIE - FORM_SNOW_COUNT] = {{MON_TEMMIE}, 1, "* A Temmie bounces up!"},[FORM_TEMMIE_MOLDBYGG - FORM_SNOW_COUNT] = {{MON_TEMMIE, MON_MOLDBYGG}, 2, "* Temmie and Moldbygg come along."},+ [FORM_UNDYNE - FORM_SNOW_COUNT] = {{MON_UNDYNE}, 1, "* Undyne attacks!"},};const Form *wf_form(int form) { return &wf_forms[form - FORM_SNOW_COUNT]; }@@ -399,10 +429,45 @@ static void atk_temmie_hops(int t) {}}+/* Undyne: spears fly at the green SOUL from all four sides, faster as she goes on (and as she's challenged) */+static void atk_undyne_arrows(int t) {+ int speed = P(2) + P(min_i(bt.turn, 10)) / 6 + P(bt.state[0]) / 3;+ int every = max_i(10, 22 - bt.turn);+ if (t < 140 && t % every == 0) {+ static const int16_t ang[4] = {64, 192, 0, 128}; /* from above, below, the left, the right: pointing in */+ static const int8_t fx[4] = {0, 0, -1, 1}, fy[4] = {-1, 1, 0, 0};+ int side = rnd_n(4);+ Bullet *b = shot(SPR_ARROW, board_cx() + fx[side] * 60, board_cy() + fy[side] * 60, -fx[side] * speed, -fy[side] * speed);+ if (b) b->r = 3, b->angle = ang[side], b->flags |= BF_SHIELD | BF_NOCLIP;+ }+}+/* and at the red SOUL: a glint on the ground, then a spear shoots up there */+static void atk_undyne_spears(int t) {+ if (t < 130 && t % 14 == 0) {+ int x = clamp_i(soul_x() - 20 + rnd_n(41), bx0() + 6, bx1() - 6);+ Bullet *b = shot(SPR_SPEAR, x, by1() - 4, 0, 0);+ if (b) b->kind = BK_SCRIPT, b->flags |= BF_HARMLESS, b->alpha = 90, b->a = 0, b->r = 3;+ }+ for (int i = 0; i < MAX_BULLETS; i++) {+ Bullet *b = &bullets[i];+ if (b->kind != BK_SCRIPT || b->spr != SPR_SPEAR) continue;+ if (++b->a == 16) b->flags &= (uint8_t)~BF_HARMLESS, b->alpha = 255, b->vy = -P(5);+ b->y += b->vy;+ if (b->y < P(by0() - 30)) b->kind = BK_NONE;+ }+}+void wf_attack_run(Battle *b, int atk, int t) {(void)b;if (t < 0) {- board_set(atk == ATK_SHYREN_NOTES ? 160 : 130, 110);+ if (atk == ATK_UNDYNE_ARROWS) {+ board_set(80, 80);+ soul_set_mode(SOUL_GREEN);+ bt.shield = 1;+ } else {+ board_set(atk == ATK_SHYREN_NOTES ? 160 : 130, 110);+ soul_set_mode(SOUL_RED);+ }return;}switch (atk) {@@ -416,5 +481,7 @@ void wf_attack_run(Battle *b, int atk, int t) {case ATK_DUMMY_MINIONS: atk_dummy_minions(t); break;case ATK_DUMMY_MISSILES: atk_dummy_missiles(t); break;case ATK_TEMMIE_HOPS: atk_temmie_hops(t); break;+ case ATK_UNDYNE_ARROWS: atk_undyne_arrows(t); break;+ case ATK_UNDYNE_SPEARS: atk_undyne_spears(t); break;}}diff --git a/games/undertale/tests/check.py b/games/undertale/tests/check.pyindex cdd306cd..4a504611 100644--- a/games/undertale/tests/check.py+++ b/games/undertale/tests/check.py@@ -32,7 +32,7 @@ ROOMS = {m.group(1): int(m.group(2)) for m inre.finditer(r"#define ROOM_(\w+) (\d+)", open(os.path.join(HERE, "..", "src", "data.h")).read())}FORM_SNOWDRAKE, FORM_PAPYRUS = 19, 31(FORM_AARON, FORM_WOSHUA, FORM_WOSHUA_AARON, FORM_MOLDBYGG, FORM_MOLDBYGG_MOLDSMAL, FORM_MOLDBYGG_WOSHUA, FORM_SHYREN,- FORM_MAD_DUMMY, FORM_TEMMIE, FORM_TEMMIE_MOLDBYGG) = range(32, 42)+ FORM_MAD_DUMMY, FORM_TEMMIE, FORM_TEMMIE_MOLDBYGG, FORM_UNDYNE) = range(32, 43)ITEM_OLD_TUTU, ITEM_BALLET_SHOES, ITEM_QUICHE, ITEM_PUNCH_CARD, ITEM_ARTIFACT, ITEM_ASTRONAUT_FOOD = range(17, 23)@@ -103,8 +103,9 @@ check(s and s["mode"] == MODE_WORLD and s["hp"] == 1, f"Papyrus did not capture# Waterfall's battles: fled from, fought, and each spared its own way (Aaron out-flexed, Woshua's green caught after# asking to be cleaned, Moldbygg hugged then let go, Shyren hummed along with, Temmie talked to); Mad Dummy can't be-# fled or hurt: its fight lasts until Napstablook comes-for form in list(range(FORM_AARON, FORM_SHYREN + 1)) + [FORM_TEMMIE, FORM_TEMMIE_MOLDBYGG]:+# fled or hurt: its fight lasts until Napstablook comes. Undyne can't be spared: fled from (her arrows blocked with+# the green SOUL's shield)+for form in list(range(FORM_AARON, FORM_SHYREN + 1)) + [FORM_TEMMIE, FORM_TEMMIE_MOLDBYGG, FORM_UNDYNE]:s = run(["--god", "--battle", str(form), "--path", "flee"], 1500, what=f"battle {form}, fleeing")check(s and s["mode"] == MODE_WORLD, f"battle {form}: fleeing did not end it: {s}")for form in (FORM_AARON, FORM_WOSHUA, FORM_MOLDBYGG, FORM_SHYREN, FORM_TEMMIE):@@ -173,17 +174,20 @@ if not QUICK:# Waterfall, the friendly way: Monster Kid, Grillby's with Sans, the tutu, Papyrus's report, the bridge seeds (and# the secret one to the quiche), the wishing room, Undyne's spears, the telescope, the punch card, the marsh (the# ballet shoes), Onionsan, the piano and the artifact, Shyren, the umbrellas, Monster Kid in the rain, the bridge cut,-# the garbage dump, Mad Dummy, Napstablook's house, the snail farm, Gerson, the mushroom maze and Temmie Village+# the garbage dump, Mad Dummy, Napstablook's house, the snail farm, Gerson, the mushroom maze and Temmie Village, the+# dead end, Monster Kid helped up on the chasm's bridge, Undyne's fight (fled), her chase, Papyrus's call, and Hotland,+# where she falls in the heat and gets the cooler's waterif not QUICK:s = run(["--name", "Frisk", "--noenc", "--god", "--room", str(ROOMS["WF1"]), "--at", "30,1480", "--path-file",os.path.join(HERE, "waterfall.path")], 60000, what="Waterfall")- check(s and s["mode"] == MODE_END and s["room"] == ROOMS["WF_MUSHROOM"], f"Waterfall did not end past the maze: {s}")+ check(s and s["mode"] == MODE_END and s["room"] == ROOMS["HT_ENTRANCE"], f"Waterfall did not end in Hotland: {s}")if s:for name, v in (("WF_MK", 1), ("GRILLBYS", 1), ("WF_TUTU", 1), ("WF_UNDYNE1", 1), ("SEEDS1", 1), ("SEEDS2", 1),("SEEDS3", 1), ("WF_QUICHE", 1), ("CHASE1", 1), ("WF_TELESCOPE", 1), ("WF_PUNCH", 1), ("WF_BALLET", 1),("WF_ONION", 2), ("PIANO", 1), ("WF_ARTIFACT", 1), ("SHYREN", 1),("UMBRELLA", 3), ("MK_RAIN", 2), ("WF_BRIDGE", 1), ("WF_DUMP", 1), ("WF_COOLER", 2),- ("MAD_DUMMY", 1), ("NAPSTA_HOME", 2), ("TEM_VILLAGE", 1), ("WF_EAST1", 1)):+ ("MAD_DUMMY", 1), ("NAPSTA_HOME", 2), ("TEM_VILLAGE", 1), ("DEADEND", 1), ("MK_CHASM", 2),+ ("UNDYNE", 4), ("WATER_CUP", 2), ("PAP_NEON", 1), ("HOTLAND", 1)):check(flag(s, name) == v, f"Waterfall: F_{name} is {flag(s, name)}, not {v}")check(s["kills"] == 0, f"Waterfall: {s['kills']} killed on the friendly way")for item in (ITEM_OLD_TUTU, ITEM_BALLET_SHOES, ITEM_QUICHE, ITEM_PUNCH_CARD, ITEM_ARTIFACT, ITEM_ASTRONAUT_FOOD):diff --git a/games/undertale/tests/waterfall.path b/games/undertale/tests/waterfall.pathindex c3a9cef0..69d69bd2 100644--- a/games/undertale/tests/waterfall.path+++ b/games/undertale/tests/waterfall.path@@ -1,4 +1,4 @@-# Waterfall's west half from Snowdin's fog (play it with --room 85 --at 30,1480 --name Frisk --noenc --god), the+# Waterfall from Snowdin's fog to Hotland's edge (play it with --room 85 --at 30,1480 --name Frisk --noenc --god), the# friendly way, as in snowdin.path. Monster Kid, Sans's booth (Grillby's), the echo flowersgo:600,1480talk@@ -282,7 +282,7 @@ w5zw30# the twin waterfalls, the mushroom maze, Temmie Village down its hidden path (a Temmie, the Tem Shop), and out at-# the maze's far side, where the game now ends+# the maze's far sidego:20540,2310go:20700,2330go:21070,2860@@ -305,4 +305,54 @@ zw20go:21070,2950go:21070,2840-go:21150,2380+go:21130,2380+# the lantern maze, the dead end (its echo flower: Undyne, then Monster Kid in her way), the echo flowers' path north+21175,2380+go:21780,2665+21830,2665+go:22390,2660+r+z+talk+w30+go:22190,2580+22190,2530+go:22190,2110+22190,2030+# the chasm: Monster Kid on the bridge, then hanging off it, helped up; Undyne on her crag, her fight (fled), her+# chase by the river and the neon sign (Papyrus calls); Hotland: she falls in the heat, the cooler's water for her,+# and on, where the game now ends+go:22390,2030+talk+go:22626,2022+d+z+talk+go:23300,2030+talk+flee+talk+go:23449,1960+23449,1930+w20+go:23449,920+23449,890+w20+go:23690,780+talk+go:24200,780+24215,780+talk+w20+go:722,6188+u+z+pick:0+talk+go:590,6206+l+z+pick:0+talk+w20+go:1010,6220diff --git a/games/undertale/tools/rooms.py b/games/undertale/tools/rooms.pyindex e2ed0862..2dde8162 100644--- a/games/undertale/tools/rooms.py+++ b/games/undertale/tools/rooms.py@@ -127,6 +127,11 @@ AREAS.append(dict(name="waterfall", map="Waterfall_map.png", floor=WF_FLOOR, mar("erase", 18918, 2686, 22, 44, "ring"), ("erase", 18523, 2341, 16, 20, "ring", []), ("erase", 18578, 2058, 26, 48, "ring"),("erase", 18811, 2113, 24, 42, "ring"), ("erase", 18976, 2100, 38, 52, "ring"), ("erase", 19108, 2330, 42, 54, "ring"),("copy", 19276, 2090, 26, 52, 19316, 2090), ("erase", 18969, 1810, 26, 40, "ring"),+ # by the chasm: Undyne on the bridge, Monster Kid hanging off it, the old monster beyond; Undyne on her crag+ ("erase", 22494, 2006, 24, 52, "ring", []), ("erase", 22628, 2050, 24, 34, "ring"), ("erase", 23054, 2000, 32, 36, "ring"),+ ("erase", 23436, 1510, 38, 62, "ring", []),+ # the lantern maze, as the map draws it, has no way through for Frisk: two tufts of one wall left out+ ("erase", 21618, 2654, 26, 44, [(0, 0, 0)]),# the bird (it waits across the gap), the tutu and the artifact (objects, gone once taken)("erase", 8466, 578, 15, 19, [(27, 33, 90), (27, 21, 72), (23, 13, 43)]),("erase", 1240, 1240, 22, 10, [(23, 13, 43), (27, 21, 72), (27, 33, 90)]),@@ -135,6 +140,15 @@ AREAS.append(dict(name="waterfall", map="Waterfall_map.png", floor=WF_FLOOR, mar("erase", 2380, 1500, 80, 20, "ring"), ("erase", 2850, 1240, 30, 80, "ring"), ("erase", 3040, 1540, 80, 20, "ring"),]))+# Hotland: its orange rock floors (its black is nothing)+HT_FLOOR = [(181, 85, 21), (169, 124, 41), (178, 83, 19), (91, 65, 0)]+AREAS.append(dict(name="hotland", map="Hotland_map.png", floor=HT_FLOOR, margin=0, close=True, patches=[+ # Undyne, fallen on the bridge in the heat (an object here, there only if she chased Frisk): the planks repeat+ # every 40 pixels+ ("copy", 454, 6219, 50, 21, 534, 6219),+ ("erase", 536, 6208, 42, 11, [(19, 35, 45), (18, 34, 44), (19, 35, 44), (23, 37, 53), (20, 37, 47), (20, 36, 46)]),+]))+ROOMS = [# the landing: the bed of golden flowers, a hallway, the Delta Rune archdict(name="area1", area="ruins", rect=(0, 5900, 680, 260), title="Ruins", margin=0,@@ -432,12 +446,40 @@ ROOMS = [# (the way in, into the maze; out at its top right; the hidden way down to the village)dict(name="wf_temmie", area="waterfall", rect=(21040, 2880, 380, 280), title="Temmie Village", floor_colors=WF_WATER,fix=[("walk", 21056, 2880, 44, 24)]),+ # the crystal maze of lanterns, the dark dead end where Undyne finds Frisk, the echo flowers' path north, the chasm's+ # bridge (Monster Kid), Undyne's crag, the way north and the gate to Hotland+ dict(name="wf_lantern", area="waterfall", rect=(21160, 2340, 640, 560), title="Waterfall", floor_colors=[(0, 0, 0)],+ margin=3),+ # (the dead end's hidden way north, through the grass, walked once Undyne has gone; the echo flowers' path goes+ # on up into the chasm's room, the rooms meeting)+ dict(name="wf_deadend", area="waterfall", rect=(21800, 2560, 640, 200), title="Waterfall",+ floor_colors=[(0, 0, 0)] + WF_WATER + WF_DUMP, floor_rects=[(21800, 2616, 640, 90), (22160, 2556, 62, 64)],+ fix=[("walk", 22164, 2560, 54, 60)]),+ dict(name="wf_echopath", area="waterfall", rect=(21940, 2080, 420, 480), title="Waterfall",+ floor_colors=[(0, 0, 0)] + WF_WATER + WF_DUMP, floor_rects=[(22160, 2080, 62, 480)]),+ dict(name="wf_chasm", area="waterfall", rect=(22160, 1940, 1090, 160), title="Waterfall",+ floor_colors=WF_WATER + WF_DUMP + [(23, 13, 43)],+ fix=[("walk", 22416, 2040, 238, 20), ("walk", 23096, 2040, 70, 20)]),+ dict(name="wf_arena", area="waterfall", rect=(23250, 1440, 370, 640), title="Waterfall",+ floor_colors=WF_WATER + WF_DUMP + [(23, 13, 43)], floor_rects=[(23250, 1980, 370, 100), (23418, 1940, 80, 40)],+ doors=[((23418, 1940, 80, 8), "wf_north", (23449, 1340), "up")]),+ # the river under the crag, the neon sign's hall+ dict(name="wf_north", area="waterfall", rect=(23280, 880, 360, 560), title="Waterfall", floor_colors=WF_WATER,+ doors=[((23420, 1372, 78, 8), "wf_arena", (23449, 1950), "down"),+ ((23420, 897, 78, 8), "wf_hotgate", (23512, 776), "right")]),+ dict(name="wf_hotgate", area="waterfall", rect=(23480, 640, 740, 200), title="Waterfall", floor_colors=WF_WATER,+ doors=[((23498, 775, 8, 47), "wf_north", (23449, 910), "down"),+ ((24210, 775, 10, 47), "ht_entrance", (24, 6206), "right")]),+ # Hotland's first room: Sans's station, the bridge over the lava, the water cooler+ dict(name="ht_entrance", area="hotland", rect=(0, 6080, 1460, 320), title="Hotland",+ doors=[((0, 6215, 6, 45), "wf_hotgate", (24180, 776), "left")]),]# rooms one above the other through a dark doorway (tools/pack.py: apply_links); ("h", left, right, y, h): side# by side with a gap, a door each way along the rows y .. y + hLINKS = [("h", "wf_hist", "wf_chase1", 540, 60),+ ("h", "wf_mushroom", "wf_lantern", 2372, 26), ("h", "wf_lantern", "wf_deadend", 2682, 16),("v", "wf_wish", "wf_hist", 3112, 36, 818),("h", "snowdin1", "snowdin2", 404, 52),("h", "snowdin2", "snowdin3", 404, 52),diff --git a/games/undertale/tools/sprites.py b/games/undertale/tools/sprites.pyindex e241d4a1..e3bea48c 100644--- a/games/undertale/tools/sprites.py+++ b/games/undertale/tools/sprites.py@@ -114,6 +114,14 @@ def gen_spear():return [im]+def gen_arrow():+ # Undyne's spear in battle, pointing right (turned as it flies)+ im = _img(18, 7)+ d = ImageDraw.Draw(im)+ d.polygon([(17, 3), (11, 0), (11, 2), (0, 2), (0, 4), (11, 4), (11, 6)], fill=(255, 255, 255, 255))+ return [im]++def gen_note():im = _img(9, 11)d = ImageDraw.Draw(im)@@ -153,7 +161,7 @@ def gen_debris():GEN = {"otile": gen_otile, "snowball": gen_snowball, "bone": gen_bone, "orb": gen_orb, "snowflake": gen_snowflake,"iceshard": gen_iceshard, "present": gen_present, "knife": gen_knife, "dogpaw": gen_dogpaw,"heartbullet": gen_heartbullet, "spear": gen_spear, "note": gen_note, "drop": gen_drop, "arm": gen_arm,- "debris": gen_debris}+ "debris": gen_debris, "arrow": gen_arrow}SNOW_CLEAR = [(133, 163, 216), (114, 129, 177), (139, 163, 186), (180, 192, 201), (195, 207, 216)]PAP_GIF = "move:Papyrus_screenshot_back_and_forth.gif:0,280,640,450:"@@ -171,7 +179,7 @@ SPRITES = [("savepoint", "demo:spr_savepoint", {"origin": (0, 0), "keep": True}),("flowey", "demo:spr_flowey", {"origin": (0, 0), "keep": True}),# the SOUL, 8 x 8 as the game's 16 x 16 halved; frame 1: blue- ("heart", "demo2:spr_heart", {"center": True, "keep": True, "tints": [(0, 60, 255)]}), # red, blue+ ("heart", "demo2:spr_heart", {"center": True, "keep": True, "tints": [(0, 60, 255), (0, 192, 0)]}), # red, blue, green] + [# the battle: its buttons (orange, then yellow when chosen), the FIGHT target and its bar, the slash, the HP label(n, "demo2:spr_" + n, {"keep": True}) for n in [@@ -313,7 +321,14 @@ SPRITES = [("tutu", "map:Waterfall_map.png:1240,1240,22,10", {"keep": True, "clear": [(23, 13, 43), (27, 21, 72), (27, 33, 90)]}),("artifact", "map:Waterfall_map.png:10156,150,12,11",{"keep": True, "clear": [(27, 21, 72), (27, 33, 90), (54, 47, 121), (99, 102, 135)]}),+ ("echo_ow", "wiki:Echo_Flower_overworld.png", {"feet": True}),+ # Undyne fallen in Hotland's heat, on its bridge (cut from the map, the bridge and the rock behind see-through)+ ("undyne_fallen", "map:Hotland_map.png:534,6213,50,27",+ {"keep": True, "clear": [(169, 124, 41), (91, 65, 0), (62, 35, 0), (19, 35, 45), (18, 34, 44), (19, 35, 44),+ (23, 37, 53), (20, 37, 47), (20, 36, 46), (12, 29, 33), (19, 36, 46), (23, 36, 52)]}),("spear", "gen:spear", {"center": True}),+ ("arrow", "gen:arrow", {"center": True}),+ ("undyne_b", "wiki:Undyne_battle_armor.gif", {"feet": True, "every": 6}),("note", "gen:note", {"center": True}),("drop", "gen:drop", {"center": True}),("arm", "gen:arm", {"center": True}),