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 past the bridge, to Temmie Village
Mason Chen22fd0447f159
diff --git a/README.md b/README.mdindex 32cf907f..9e9aab01 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 half of Waterfall, from the golden flowers to the bridge Undyne cuts</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 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></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 half of Waterfall are out, the rest of Waterfall, Hotland and New Home are next+- [ ] Undertale: the Ruins, Snowdin and most of Waterfall are out, Undyne's fight, Hotland and New Home are next- [ ] The Binding of Isaac- [ ] Plants vs. Zombies- [ ] Doomdiff --git a/docs/play.md b/docs/play.mdindex 1774ce4e..2455168f 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. For now the game ends halfway through Waterfall, where Undyne cuts the bridge.+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.<br clear="right">diff --git a/games/undertale/README.md b/games/undertale/README.mdindex a822b6d5..59c4b0a6 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 the first half of Waterfall, from the bed of golden flowers to the bridge Undyne cuts. The rest of the Underground is on the way.+ 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.</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's first half:** 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.-* **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 and Shyren 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.+* **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.* **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.@@ -79,6 +79,14 @@<td align="center"><img src="docs/woshua.png" width="390" alt="Woshua's green drop"><br><sub>Woshua's green drop heals</sub></td><td align="center"><img src="docs/shyren.png" width="390" alt="Shyren's notes"><br><sub>Shyren sings when you hum along</sub></td></tr>+ <tr>+ <td align="center"><img src="docs/maddummy.png" width="390" alt="Mad Dummy's dummies"><br><sub>Mad Dummy sends its dummies</sub></td>+ <td align="center"><img src="docs/napstahouse.png" width="390" alt="Napstablook's house"><br><sub>At Napstablook's house</sub></td>+ </tr>+ <tr>+ <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></table>## How to play@@ -89,7 +97,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.+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.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.@@ -106,7 +114,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 half of Waterfall, for now:** the bridge Undyne cuts ends the game, on a screen that says the rest of the Underground is still to come. The rest of Waterfall, Hotland and New Home come next, one at a time.+* **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.* **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/gerson.png b/games/undertale/docs/gerson.pngnew file mode 100644index 00000000..ea8d1680Binary files /dev/null and b/games/undertale/docs/gerson.png differdiff --git a/games/undertale/docs/maddummy.png b/games/undertale/docs/maddummy.pngnew file mode 100644index 00000000..5129514eBinary files /dev/null and b/games/undertale/docs/maddummy.png differdiff --git a/games/undertale/docs/napstahouse.png b/games/undertale/docs/napstahouse.pngnew file mode 100644index 00000000..83c69372Binary files /dev/null and b/games/undertale/docs/napstahouse.png differdiff --git a/games/undertale/docs/temmie.png b/games/undertale/docs/temmie.pngnew file mode 100644index 00000000..585ab069Binary files /dev/null and b/games/undertale/docs/temmie.png differdiff --git a/games/undertale/src/data.bin b/games/undertale/src/data.binindex 93e1aae5..8a4000a4 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 6eff4211..6ef50f76 100644--- a/games/undertale/src/data.h+++ b/games/undertale/src/data.h@@ -195,61 +195,70 @@#define SPR_WOSHUA_OW 181#define SPR_SEED 182#define SPR_BLOOM 183-#define SPR_BIRD 184-#define SPR_TUTU 185-#define SPR_ARTIFACT 186-#define SPR_SPEAR 187-#define SPR_NOTE 188-#define SPR_DROP 189-#define SPR_ARM 190-#define SPR_DEBRIS 191-#define SPR_AARON_B 192-#define SPR_AARON_HURT 193-#define SPR_WOSHUA_B 194-#define SPR_WOSHUA_HURT 195-#define SPR_MOLDBYGG_B 196-#define SPR_SHYREN_B 197-#define SPR_SHYREN_TURNED 198-#define SPR_INTROIMAGE 199-#define SPR_INTROLAST 200-#define SPR_UNDERTALETITLE 201-#define SPR_GAMEOVERBG 202-#define SPR_FACE_TORIELTALK 203-#define SPR_FACE_TORIELTALKSIDE 204-#define SPR_FACE_TORIELHAPPYTALK 205-#define SPR_FACE_TORIELWHAT 206-#define SPR_FACE_TORIELWHATSIDE 207-#define SPR_FACE_TORIELMAD 208-#define SPR_FACE_TORIELCOLD 209-#define SPR_FACE_TORIELSURPRISED 210-#define SPR_FACE_TORIELEMBARRASSED 211-#define SPR_FACE_TORIELGLASSES 212-#define SPR_FACE_TORIELREVENGETALK 213-#define SPR_FACE_TORIELSCARED 214-#define SPR_FACE_TORIELBLINK 215-#define SPR_FACE_TORIELHAPPYBLINK 216-#define SPR_FACE_TORIELBODY 217-#define SPR_FACE_SANS 218-#define SPR_FACE_SANSCHUCKLE 219-#define SPR_FACE_SANSWINK 220-#define SPR_FACE_PAPYRUS 221-#define SPR_FACE_PAPYRUSEVIL 222-#define SPR_FACE_PAPYRUSLAUGH 223-#define SPR_FACE_PAPYRUSMAD 224-#define SPR_FACE_PAPYRUSSIDE 225-#define SPR_FLOWEYNICE 226-#define SPR_FLOWEYNICESIDE 227-#define SPR_FLOWEYSASSY 228-#define SPR_FLOWEYEVIL 229-#define SPR_FLOWEYGRIN 230-#define SPR_FLOWEYPLAIN 231-#define SPR_FLOWEYPISSED 232-#define SPR_FLOWEYWINK 233-#define SPR_FLOWEYLAUGH 234-#define SPR_FLOWEYHURT 235-#define SPR_FLOWEYTORIEL 236-#define SPR_FLOWEYTORIEL2 237-#define SPR_FLOWEYSIDESHOCK 238+#define SPR_MADDUMMY_OW 184+#define SPR_MADDUMMY_B 185+#define SPR_DUMMY_MINION 186+#define SPR_DUMMY_BOT 187+#define SPR_TEMMIE_OW 188+#define SPR_TEMMIE_B 189+#define SPR_TEMMIE_HURT 190+#define SPR_SHOP_GERSON 191+#define SPR_SHOP_TEM 192+#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 AREA_RUINS 0#define AREA_SNOWDIN 1#define AREA_SNOWTOWN 2@@ -362,10 +371,21 @@#define ROOM_WF_CASTLE 105#define ROOM_WF_AARON 106#define ROOM_WF_BRIDGE 107+#define ROOM_WF_DUMP 108+#define ROOM_WF_TRASH 109+#define ROOM_WF_WALKWAY 110+#define ROOM_WF_QUIET 111+#define ROOM_WF_BIRD2 112+#define ROOM_WF_ACRES 113+#define ROOM_WF_NAPSTA_IN 114+#define ROOM_WF_GERSON 115+#define ROOM_WF_TWIN 116+#define ROOM_WF_MUSHROOM 117+#define ROOM_WF_TEMMIE 118#define FONT_MAIN 0#define FONT_MENU 1#define FONT_SMALL 2-#define NUM_SPRITES 239-#define NUM_ROOMS 108+#define NUM_SPRITES 248+#define NUM_ROOMS 119#define NUM_FONTS 3#endifdiff --git a/games/undertale/src/events.c b/games/undertale/src/events.cindex 8f00b765..8b583a81 100644--- a/games/undertale/src/events.c+++ b/games/undertale/src/events.c@@ -113,5 +113,7 @@ int event_run(Ev *c) {if (r >= 0) return r;r = wf1_event(c);if (r >= 0) return r;+ r = wf2_event(c);+ if (r >= 0) return r;return 1;}diff --git a/games/undertale/src/events.h b/games/undertale/src/events.hindex 8bedff15..3bdfae3f 100644--- a/games/undertale/src/events.h+++ b/games/undertale/src/events.h@@ -10,7 +10,8 @@ enum {ACTOR_SANS, ACTOR_PAPYRUS, ACTOR_DOGGO, ACTOR_DOGAMY, ACTOR_DOGARESSA, ACTOR_GREATERDOG, ACTOR_BALL, ACTOR_ORB,ACTOR_TILE, ACTOR_DOG, ACTOR_BLOCK, ACTOR_TRIGGER3,/* Waterfall */- ACTOR_MK, ACTOR_UNDYNE, ACTOR_SEED, ACTOR_BLOOM, ACTOR_SPEAR, ACTOR_ONION, ACTOR_DEBRIS, ACTOR_SHYREN+ ACTOR_MK, ACTOR_UNDYNE, ACTOR_SEED, ACTOR_BLOOM, ACTOR_SPEAR, ACTOR_ONION, ACTOR_DEBRIS, ACTOR_SHYREN,+ ACTOR_MADDUMMY, ACTOR_BIRD, ACTOR_TEMMIE};enum {@@ -38,6 +39,9 @@ enum {/* wf1.c */EV_WF_MK, EV_WF_ITEM, EV_WF_STREAM_FALL, EV_WF_UNDYNE1, EV_BELL, EV_WF_GRASS, EV_WF_TELESCOPE, EV_WF_BIRD,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,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 7628330c..7111f7eb 100644--- a/games/undertale/src/flags.h+++ b/games/undertale/src/flags.h@@ -110,7 +110,14 @@ enum {F_SHYREN, /* 1 spared, 2 killed */F_WF_BRIDGE, /* the bridge cut: Frisk fell */F_KILLS_WATERFALL,- F_WF_BIRD,+ F_WF_BIRD, /* the small bird: 1 it carried Frisk west (it waits there), 2 back east */+ F_WF_DUMP, /* woke up in the garbage dump */+ F_WF_COOLER, /* the cooler's Astronaut Food taken: how many */+ F_MAD_DUMMY, /* its fight, over (Napstablook came) */+ 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) */FLAG_COUNT = 256};#endifdiff --git a/games/undertale/src/items.c b/games/undertale/src/items.cindex 4302e410..2da369ea 100644--- a/games/undertale/src/items.c+++ b/games/undertale/src/items.c@@ -42,6 +42,16 @@ static const ItemInfo items[ITEM_COUNT] = {"* You look at the punch card.\n* It makes you want to punch\n something.", 15},[ITEM_ARTIFACT] = {"Legendary Artifact", "Artifact", IT_SPECIAL, 0, 0, 0, "A mysterious orb.\n* It's a little heavy.","* You hold the orb up.\n* Nothing happens.", 0},+ [ITEM_ASTRONAUT_FOOD] = {"Astronaut Food", "AstroFood", IT_FOOD, 21, 0, 0, "Food for a trip to space,\n found in a cooler.",+ "* You eat the Astronaut Food.", 25},+ [ITEM_CRAB_APPLE] = {"Crab Apple", "CrabApple", IT_FOOD, 18, 0, 0, "A fruit with little claws.",+ "* You eat the Crab Apple.", 5},+ [ITEM_SEA_TEA] = {"Sea Tea", "SeaTea", IT_FOOD, 10, 0, 0, "Tea made from sea grass.",+ "* You drink the Sea Tea.\n* Your feet feel lighter.", 5},+ [ITEM_CLOUDY_GLASSES] = {"Cloudy Glasses", "Glasses", IT_ARMOR, 0, 0, 5, "Glasses you can barely\n see through.", "", 30},+ [ITEM_TORN_NOTEBOOK] = {"Torn Notebook", "TornNotbo", IT_WEAPON, 0, 2, 0, "An old notebook, torn up.\n* It doesn't hit very hard.", "", 50},+ [ITEM_TEMMIE_FLAKES] = {"Temmie Flakes", "TemFlakes", IT_FOOD, 2, 0, 0, "Bits of paper, sold as\n food.",+ "* You eat the Temmie Flakes.", 2},};const ItemInfo *item_info(int id) { return &items[id >= 0 && id < ITEM_COUNT ? id : 0]; }diff --git a/games/undertale/src/items.h b/games/undertale/src/items.hindex a2fd470e..d2851666 100644--- a/games/undertale/src/items.h+++ b/games/undertale/src/items.h@@ -28,6 +28,12 @@ enum {ITEM_QUICHE,ITEM_PUNCH_CARD,ITEM_ARTIFACT,+ ITEM_ASTRONAUT_FOOD,+ ITEM_CRAB_APPLE,+ ITEM_SEA_TEA,+ ITEM_CLOUDY_GLASSES,+ ITEM_TORN_NOTEBOOK,+ ITEM_TEMMIE_FLAKES,ITEM_COUNT};enum { IT_FOOD, IT_WEAPON, IT_ARMOR, IT_SPECIAL };diff --git a/games/undertale/src/menu.c b/games/undertale/src/menu.cindex 97c29a61..506e6387 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, "You fall into the dark below\nthe bridge...|The rest of Waterfall,\nand the underground beyond,\nare still to come...", 40, 90, FONT_MAIN);+ 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);w.speed = 2;}diff --git a/games/undertale/src/menu.h b/games/undertale/src/menu.hindex 28da811b..c34a20f4 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); /* the fall from Waterfall's bridge: what comes next isn't made yet */+void menu_end_open(void); /* past Waterfall's mushroom maze: 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.c b/games/undertale/src/monsters.cindex 11155d90..14241618 100644--- a/games/undertale/src/monsters.c+++ b/games/undertale/src/monsters.c@@ -319,7 +319,7 @@ int form_setup(int form, Battle *b) {m->x = (int16_t)(xs[f->n - 1][i] + m->def->dx), m->y = (int16_t)(120 + m->def->dy);}/* Toriel and Flowey can't be fled from; Napstablook can */- if (form == FORM_TORIEL || form == FORM_FLOWEY || form == FORM_PAPYRUS) b->no_flee = true;+ if (form == FORM_TORIEL || form == FORM_FLOWEY || form == FORM_PAPYRUS || form == FORM_MAD_DUMMY) b->no_flee = true;b->captures = form == FORM_PAPYRUS;return 0;}diff --git a/games/undertale/src/monsters.h b/games/undertale/src/monsters.hindex 755879d1..5c165146 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_COUNT+ MON_AARON = MON_SNOW_COUNT, MON_WOSHUA, MON_MOLDBYGG, MON_SHYREN, MON_MAD_DUMMY, MON_TEMMIE, 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_COUNT+ FORM_MOLDBYGG_WOSHUA, FORM_SHYREN, FORM_MAD_DUMMY, FORM_TEMMIE, FORM_TEMMIE_MOLDBYGG, FORM_COUNT};enum {@@ -38,7 +38,8 @@ enum {ATK_GDOG_BARK, ATK_GLYDE_STARS, ATK_PAP_FIRST, ATK_PAP_LAST = ATK_PAP_FIRST + 24, ATK_SNOW_COUNT,/* 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_COUNT+ ATK_MOLDBYGG_RAIN, ATK_SHYREN_NOTES, ATK_DUMMY_MINIONS, ATK_DUMMY_MISSILES, ATK_TEMMIE_HOPS,+ 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 46a6c038..d2a0b73a 100644--- a/games/undertale/src/rooms.c+++ b/games/undertale/src/rooms.c@@ -18,6 +18,7 @@ void room_setup(int room, int from) {snow2_setup(room, from);town_setup(room, from);wf1_setup(room, from);+ wf2_setup(room, from);}/* each frame Frisk can walk: what a room watches (a rock on its switch, a cracked floor) */diff --git a/games/undertale/src/shop.c b/games/undertale/src/shop.cindex 4686cbdc..c408dff4 100644--- a/games/undertale/src/shop.c+++ b/games/undertale/src/shop.c@@ -22,6 +22,7 @@ typedef struct {const char *topics[4];const char *answers[4];int ntopics;+ bool buys; /* Sell: it buys what you carry (the Tem Shop) */} Shop;static const Shop shops[SHOP_COUNT] = {@@ -37,6 +38,27 @@ static const Shop shops[SHOP_COUNT] = {"* Long ago, monsters lived in the RUINS back there.|* When we came here, the cold made it easy to get used to the snow.","* Life is the same as usual.\n* A little cold, though..."},.ntopics = 4},+ [SHOP_GERSON] = {+ .pic = SPR_SHOP_GERSON, .hello = "* Hello there, little one!\n* Pay no mind to the junk.", .again = "* Take a look around!",+ .buying = "Take your\ntime.", .bought = "Wa ha ha!\nThank you!", .poor = "Not enough\nmoney, eh?",+ .full = "Your pockets\nare full,\nkid.", .nobuy = "Hmm?",+ .sell = "* Sell? I'm not that kind of shop, kid.\n* Try the Temmies, if you can find them.",+ .wares = {{ITEM_CRAB_APPLE, 25}, {ITEM_SEA_TEA, 18}, {ITEM_CLOUDY_GLASSES, 35}, {ITEM_TORN_NOTEBOOK, 55}}, .nwares = 4,+ .topics = {"About you", "About Undyne", "About the king", "About the junk"},+ .answers = {"* Me? Just an old turtle who's seen a lot.\n* They used to call me a hero, way back when.",+ "* Undyne? That girl's the head of the Royal Guard.\n* She'd fight anyone to protect us. Wa ha ha!",+ "* The king's a big softie.\n* Lost his family a long while back. Still keeps smiling.",+ "* All of this washed up in the dump.\n* One monster's trash is another's treasure!"},+ .ntopics = 4},+ [SHOP_TEM] = {+ .pic = SPR_SHOP_TEM, .hello = "* hOI!\n* welcom to... da TEM SHOP!!!", .again = "* hOI!", .buying = "tem has\nstuff!!",+ .bought = "thanks!!!", .poor = "no muns...", .full = "u hav too\nmany stuffs", .nobuy = "oh...",+ .sell = "", .buys = true,+ .wares = {{ITEM_TEMMIE_FLAKES, 1}}, .nwares = 1,+ .topics = {"Say hello", "About Temmies", "Tem history", "About shop"},+ .answers = {"* hOI!!! i'm temmie!!", "* temmies r the best!!!\n* we love humans... but some temmies r allergic...",+ "* temmie village is very old...\n* tem forget the rest.", "* tem wants to go to colleg someday!!"},+ .ntopics = 4},};static int shop_id, st, sel, sub;@@ -44,7 +66,7 @@ static Writer w;static char buf[300];static const char *right_text;static bool is_box;-enum { S_MENU, S_BUY, S_CONFIRM, S_TALK, S_SAY };+enum { S_MENU, S_BUY, S_CONFIRM, S_TALK, S_SAY, S_SELL };static void left_say(const char *s) {snprintf(buf, sizeof buf, "%s", s);@@ -135,6 +157,7 @@ void shop_update(uint32_t keys, uint32_t pressed) {if (pressed & K_DOWN) sel = (sel + 1) % 4;if (pressed & K_Z) {if (sel == 0) st = S_BUY, sub = 0, right_text = s->buying;+ else if (sel == 1 && s->buys) st = S_SELL, sub = 0, right_text = "what u\nsell??";else if (sel == 1) st = S_SAY, left_say(s->sell);else if (sel == 2) st = S_TALK, sub = 0;else g_mode = MODE_WORLD;@@ -173,6 +196,21 @@ void shop_update(uint32_t keys, uint32_t pressed) {case S_SAY:if (!typing) st = S_MENU, left_say(s->again);break;+ case S_SELL: {+ /* what's carried, and Exit: Z sells it for what it's worth */+ if (pressed & K_UP) sub = (sub + NUM_ITEMS) % (NUM_ITEMS + 1);+ if (pressed & K_DOWN) sub = (sub + 1) % (NUM_ITEMS + 1);+ if (pressed & K_X || ((pressed & K_Z) && sub == NUM_ITEMS)) {+ st = S_MENU, left_say(s->again);+ break;+ }+ if ((pressed & K_Z) && sv.items[sub]) {+ sv.gold = (uint16_t)min_i(9999, sv.gold + item_info(sv.items[sub])->sell);+ item_remove_at(sub);+ right_text = "thanks!!";+ }+ break;+ }}}@@ -188,6 +226,17 @@ static void wares_list(const Shop *s, bool topics) {if (!(st == S_CONFIRM)) gfx_sprite(SPR_HEART, 0, 20, 140 + sub * 18, 0, 255);}+static void sell_list(void) {+ for (int i = 0; i <= NUM_ITEMS; i++) {+ char line[48];+ if (i == NUM_ITEMS) snprintf(line, sizeof line, "Exit");+ else if (sv.items[i]) snprintf(line, sizeof line, "%dG - %s", item_info(sv.items[i])->sell, item_info(sv.items[i])->short_name);+ else line[0] = 0;+ gfx_text(FONT_SMALL, 30, 127 + i * 12, line, C_WHITE, 255);+ }+ gfx_sprite(SPR_HEART, 0, 20, 130 + sub * 12, 0, 255);+}+void shop_draw(void) {if (is_box) {box_draw();@@ -210,6 +259,11 @@ void shop_draw(void) {if (st == S_MENU) gfx_sprite(SPR_HEART, 0, 228, 140 + sel * 20, 0, 255);return;}+ if (st == S_SELL) {+ sell_list();+ if (right_text) gfx_text(FONT_SMALL, 222, 130, right_text, C_WHITE, 255);+ return;+ }wares_list(s, st == S_TALK);if (st == S_CONFIRM) {char q[40];diff --git a/games/undertale/src/shop.h b/games/undertale/src/shop.hindex 2d2bd970..f803103b 100644--- a/games/undertale/src/shop.h+++ b/games/undertale/src/shop.h@@ -2,7 +2,7 @@#ifndef UT_SHOP_H#define UT_SHOP_H#include <stdint.h>-enum { SHOP_SNOWDIN, SHOP_COUNT };+enum { SHOP_SNOWDIN, SHOP_GERSON, SHOP_TEM, SHOP_COUNT };void shop_open(int id); /* MODE_SHOP until Exit */void box_open(void);void shop_update(uint32_t keys, uint32_t pressed);diff --git a/games/undertale/src/waterfall.h b/games/undertale/src/waterfall.hindex 6f50ab71..ce53db9b 100644--- a/games/undertale/src/waterfall.h+++ b/games/undertale/src/waterfall.h@@ -8,4 +8,8 @@ void wf1_update(void);bool wf_seed_enters(Obj *o, int x, int y); /* a bridge seed pushed into the water */void wf_seed_moved(Obj *o);void wf_battle_done(int form);+/* wf2.c: past the bridge */+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 */#endifdiff --git a/games/undertale/src/wf1.c b/games/undertale/src/wf1.cindex 0b835bc6..a81c3c79 100644--- a/games/undertale/src/wf1.c+++ b/games/undertale/src/wf1.c@@ -369,13 +369,9 @@ void wf1_setup(int room, int from) {if (m) m->flags |= OF_SOLID;break;}- case ROOM_WF_MARSH_TOP: {- /* the small bird waits across the gap of bright water: from its side, it carries Frisk back over */- obj_deco(SPR_BIRD, 8544, 578, false);- Obj *b = obj_trigger(8540, 574, 22, 26, EV_WF_BIRD, ACTOR_ANY);- if (b) b->flags = OF_TALK | OF_SOLID;+ case ROOM_WF_MARSH_TOP:+ wf_bird_setup(room);break;- }case ROOM_WF_MARSH:pickup(7578, 1230, 30, 30, ITEM_BALLET_SHOES, F_WF_BALLET, 0);{@@ -583,12 +579,15 @@ static int ev_wf_telescope(Ev *c) {EV_END;}+/* the small bird carries Frisk over the gap: east from the boardwalk (arg 2), west from the Quiet Area's side (1) */static int ev_wf_bird(Ev *c) {EV_BEGIN;+ c->v[1] = c->self ? c->self->arg : 1;NARRATE("* (The little bird offers to carry you over the gap.)@Yes@No");if (CHOICE() == 0) {- FADE_TO(ROOM_WF_MARSH_TOP, 8440, 562, DIR_LEFT);- set_flag(F_WF_BIRD, 1);+ set_flag(F_WF_BIRD, c->v[1]);+ if (c->v[1] == 1) FADE_TO(ROOM_WF_MARSH_TOP, 8440, 562, DIR_LEFT);+ else FADE_TO(ROOM_WF_BIRD2, 18548, 2318, DIR_RIGHT);}EV_END;}@@ -733,9 +732,9 @@ static int ev_bridge_end(Ev *c) {WAIT(30);NARRATE("* (...and cuts the bridge from under you!)");set_flag(F_WF_BRIDGE, 1);- sv.room = (int16_t)g_room, sv.x = (int16_t)(pl.x - 40), sv.y = pl.y;- save_write_auto();- menu_end_open();+ /* down, into the dark: the garbage dump */+ world_fade_hold(ROOM_WF_DUMP, 17680, 3214, DIR_DOWN, 60);+ WAIT_UNTIL(!world_fading());EV_END;}diff --git a/games/undertale/src/wf2.c b/games/undertale/src/wf2.cnew file mode 100644index 00000000..d47078df--- /dev/null+++ b/games/undertale/src/wf2.c@@ -0,0 +1,278 @@+/* Waterfall, past the bridge: the garbage dump and Mad Dummy, Napstablook, the Quiet Area and the small bird, Blook+ * Acres, Gerson's shop, the twin waterfalls, the mushroom maze and Temmie Village. (As the Undertale Wiki describes+ * them; what they say is ours, in short.) */+#include <stdio.h>+#include "battle.h"+#include "event.h"+#include "events.h"+#include "game.h"+#include "items.h"+#include "menu.h"+#include "monsters.h"+#include "save.h"+#include "shop.h"+#include "waterfall.h"+#include "world.h"++static void gone(Obj *o) { o->kind = OBJ_NONE; }++/* something on the map to talk to (solid: it stands there) */+static Obj *thing(int x, int y, int w, int h, int event, int name, int arg) {+ Obj *o = obj_trigger(x, y, w, h, event, name);+ if (o) o->flags = OF_TALK | OF_SOLID, o->arg = (int16_t)arg;+ return o;+}+static Obj *solid_sign(int x, int y, int w, int h, const char *text) {+ Obj *o = obj_sign(x, y, w, h, text);+ if (o) o->flags |= OF_SOLID;+ return o;+}++static Obj *obj_napstablook(int x, int y) {+ static const uint16_t s[4] = {SPR_NAPSTA_OW, SPR_NAPSTA_OW, SPR_NAPSTA_OW, SPR_NAPSTA_OW};+ Obj *o = obj_npc(ACTOR_NAPSTA, s, x, y, DIR_DOWN, 0);+ if (o) o->alpha = 200;+ return o;+}++/* the small bird over the gap of bright water (F_WF_BIRD: 1, it waits on the west side) */+void wf_bird_setup(int room) {+ bool west = flag(F_WF_BIRD) == 1;+ if (room == ROOM_WF_MARSH_TOP) {+ if (west) {+ obj_deco(SPR_BIRD, 8466, 578, false);+ thing(8462, 574, 22, 26, EV_WF_BIRD, ACTOR_BIRD, 2);+ } else {+ obj_deco(SPR_BIRD, 8544, 578, false); /* (across the gap: out of reach) */+ }+ } else if (room == ROOM_WF_BIRD2 && !west) {+ obj_deco(SPR_BIRD, 18523, 2341, false);+ thing(18519, 2337, 24, 26, EV_WF_BIRD, ACTOR_BIRD, 1);+ }+}++void wf2_setup(int room, int from) {+ (void)from;+ if (room < ROOM_WF_DUMP || room > ROOM_WF_TEMMIE) return;+ switch (room) {+ case ROOM_WF_DUMP:+ if (!flag(F_WF_DUMP)) {+ Obj *t = obj_trigger(17660, 3220, 80, 50, EV_DUMP_WAKE, ACTOR_TRIGGER);+ if (t) t->flags = OF_TOUCH;+ }+ solid_sign(18030, 3292, 80, 44, "* (A heap of garbage.)\n* (A rusty bike sticks out of it.)");+ solid_sign(18120, 3292, 80, 44, "* (A heap of garbage.)\n* (There's an old computer in there.)");+ obj_sign(17880, 3250, 24, 20, "* (Water flows in from somewhere far above.)");+ break;+ case ROOM_WF_TRASH:+ obj_save(18540, 3234, "* (Bits of garbage float past and drop into the dark.)\n* (You're filled with determination.)");+ solid_sign(18560, 3170, 40, 50, "* (A pile of trash.)\n* (Someone left a box of old tapes.)");+ solid_sign(18690, 3170, 40, 50, "* (A pile of trash.)\n* (A DVD case. Something with claws scratched it.)");+ break;+ case ROOM_WF_WALKWAY:+ if (flag(F_WF_COOLER) < 2) thing(18922, 2816, 36, 22, EV_COOLER, ACTOR_ITEM, 0);+ else solid_sign(18922, 2816, 36, 22, "* (An empty cooler.)");+ solid_sign(18916, 2736, 60, 60, "* (A heap of garbage.)\n* (It smells like old rain.)");+ solid_sign(18824, 2836, 46, 58, "* (A heap of garbage.)\n* (A deflated ball is stuck on top.)");+ if (!flag(F_MAD_DUMMY)) {+ static const uint16_t s[4] = {SPR_MADDUMMY_OW, SPR_MADDUMMY_OW, SPR_MADDUMMY_OW, SPR_MADDUMMY_OW};+ obj_npc(ACTOR_MADDUMMY, s, 18929, 2730, DIR_DOWN, EV_MAD_DUMMY);+ }+ break;+ case ROOM_WF_QUIET:+ obj_save(18900, 2340, "* (The quiet of this place fills you with determination.)");+ obj_sign(18966, 2256, 22, 24, "* (West: the bird.\n North: the houses.\n East: the shop.)");+ break;+ case ROOM_WF_BIRD2:+ wf_bird_setup(room);+ break;+ case ROOM_WF_ACRES:+ thing(18568, 2060, 32, 44, EV_LOCKED_HOUSE, ACTOR_DOOR, 0);+ thing(18926, 2080, 26, 30, EV_LOCKED_HOUSE, ACTOR_DOOR, 1);+ obj_sign(18450, 2124, 64, 34, "* (A doormat shaped like a fish.)");+ obj_sign(19200, 2020, 30, 30, "* (The snail farm.\n* Thundersnail races: ask the ghost.)");+ if (flag(F_MAD_DUMMY)) {+ Obj *n = obj_napstablook(19316, 2092);+ if (n) n->event = EV_SNAILS, n->flags |= OF_TALK, obj_set_box(n, 0, 20, 26, 36); /* (over the fence) */+ }+ break;+ case ROOM_WF_NAPSTA_IN:+ solid_sign(18820, 1790, 30, 36, "* (A fridge.)\n* (There's a ghost sandwich inside. Your hand goes right through it.)");+ solid_sign(18866, 1800, 32, 30, "* (An old TV, showing a ghost show.)");+ solid_sign(18930, 1786, 36, 30, "* (A computer with a song playing on it.)\n* (It sounds spooky... and kind of nice.)");+ if (flag(F_NAPSTA_HOME)) {+ Obj *n = obj_napstablook(18969, 1810);+ if (n) n->event = EV_NAPSTA_ROOM, n->flags |= OF_TALK;+ }+ break;+ case ROOM_WF_GERSON:+ thing(19356, 2256, 44, 50, EV_GERSON, ACTOR_DOOR, 0); /* (the shop's doorway) */+ thing(19384, 2286, 26, 20, EV_BOX, ACTOR_ITEM, 0);+ obj_sign(19690, 2288, 30, 20, "* (Gerson's shop, behind you.\n* Waterfall goes on, ahead.)");+ break;+ 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.)");+ thing(21360, 3118, 26, 24, EV_BOX, ACTOR_ITEM, 0);+ thing(21334, 3020, 48, 56, EV_TEM_SHOP, ACTOR_DOOR, 0);+ obj_sign(21176, 3002, 78, 34, "* (A painting of a Temmie, very proud of itself.)");+ obj_sign(21122, 3062, 22, 26, "* (Welcome to Temmie Village!)");+ obj_sign(21316, 3056, 24, 26, "* (Tem Shop! Tem sells!)");+ for (int i = 0; i < 4; i++) {+ static const int16_t tx[4] = {21168, 21202, 21234, 21268}, ty[4] = {3072, 3080, 3068, 3074};+ thing(tx[i], ty[i], 24, 30, EV_TEMMIE, ACTOR_TEMMIE, i);+ }+ break;+ }+}++/* ---------------------------------------------------------------- the events */+static int ev_dump_wake(Ev *c) {+ EV_BEGIN;+ /* (a dream while Frisk lies there) */+ NARRATE("* (...)|* (In the dark, a voice keeps calling someone's name.)\n* (It isn't yours.)");+ WAIT(30);+ NARRATE("* (You wake up on a bed of golden flowers.)\n* (Garbage floats all around.)");+ set_flag(F_WF_DUMP, 1);+ if (c->self) gone(c->self);+ EV_END;+}++static int ev_cooler(Ev *c) {+ EV_BEGIN;+ NARRATE("* (A cooler. There's Astronaut Food inside.)\n* (Take some?)@Yes@No");+ if (CHOICE() == 0) {+ if (!item_add(ITEM_ASTRONAUT_FOOD)) {+ NARRATE("* (You're carrying too much.)");+ } else {+ set_flag(F_WF_COOLER, flag(F_WF_COOLER) + 1);+ NARRATE("* (You got the Astronaut Food.)");+ if (flag(F_WF_COOLER) >= 2 && c->self) gone(c->self);+ }+ }+ EV_END;+}++static int ev_mad_dummy(Ev *c) {+ Obj *d = obj_get(ACTOR_MADDUMMY), *n = obj_get(ACTOR_NAPSTA);+ EV_BEGIN;+ NARRATE("* (It's a training dummy.)\n* (Hit it?)@Yes@No");+ g_shake = 6;+ SAY(FACE_NONE, "* Hey! HEY! You!|* You're the one who picked on my cousin back in the Ruins!|* Ghosts like us live in dummies, you know! And you... you...|* GRR! Dummies, get them!!");+ BATTLE(FORM_MAD_DUMMY);+ /* Napstablook drifts in; their tears soak Mad Dummy, who storms off */+ n = obj_napstablook(d->x - 50, d->y);+ NARRATE("* (Napstablook drifts in, crying softly.)|* (Their tears rain down on Mad Dummy.)");+ SAY(FACE_NONE, "* Ugh! Gross! My dummy's all wet!|* This isn't over! I'll be back!!");+ d = obj_get(ACTOR_MADDUMMY);+ WALK(d, d->x, d->y - 120, 3);+ gone(obj_get(ACTOR_MADDUMMY));+ set_flag(F_MAD_DUMMY, 1);+ SAY(FACE_NONE, "* oh... sorry... i didn't mean to get in the way...|* um... i live just up north, past the pond.|* ...if you want, you could come over.\n* only if you want to...");+ set_flag(F_NAPSTA_HOME, 1);+ for (c->v[0] = 200; c->v[0] > 0; c->v[0] -= 10) {+ n = obj_get(ACTOR_NAPSTA);+ n->alpha = (uint8_t)c->v[0];+ WAIT(2);+ }+ gone(obj_get(ACTOR_NAPSTA));+ EV_END;+}++static int ev_napsta_room(Ev *c) {+ EV_BEGIN;+ if (flag(F_NAPSTA_HOME) >= 2) {+ SAY(FACE_NONE, "* oh... hi again.\n* it's nice to have company... i think.");+ return 1;+ }+ SAY(FACE_NONE, "* oh... you really came.|* uh... this is my room. it's not much.|* sometimes i just lie on the floor for a while...\n* want to do that with me?@Sure@No thanks");+ if (CHOICE() == 0) {+ NARRATE("* (You lie down on the floor next to Napstablook.)");+ WAIT(60);+ NARRATE("* (Time passes.)\n* (It's oddly peaceful.)");+ SAY(FACE_NONE, "* ...thanks. that was really nice.\n* i don't get to do that with anyone.");+ set_flag(F_NAPSTA_HOME, 2);+ } else {+ SAY(FACE_NONE, "* oh... that's okay...");+ }+ EV_END;+}++static int ev_locked_house(Ev *c) {+ EV_BEGIN;+ if (c->self && c->self->arg == 0) NARRATE("* (The door is locked.)\n* (Someone inside is clanking on something metal.)");+ else NARRATE("* (The door is locked tight.)\n* (It has a big star on it.)");+ EV_END;+}++/* Thundersnail: 10G a race; cheering doesn't help much */+static int ev_snails(Ev *c) {+ EV_BEGIN;+ SAY(FACE_NONE, "* oh... hi. this is our snail farm.|* want to race the snails? it's 10G...@Race@No");+ if (CHOICE() == 1) return 1;+ if (sv.gold < 10) {+ SAY(FACE_NONE, "* oh... you don't have enough money... that's okay.");+ return 1;+ }+ sv.gold = (uint16_t)(sv.gold - 10);+ set_flag(F_SNAIL_RACE, flag(F_SNAIL_RACE) + 1);+ NARRATE("* (The snails are off!)|* (Your yellow snail creeps forward...)");+ WAIT(40);+ if (rnd_n(2)) {+ sv.gold = (uint16_t)(sv.gold + 9);+ SAY(FACE_NONE, "* oh... your snail won... here's 9G.\n* ...sorry, that's all the prize money.");+ } else {+ SAY(FACE_NONE, "* oh... it lost. that's how it goes sometimes.");+ }+ EV_END;+}++static int ev_shop_door(Ev *c) {+ EV_BEGIN;+ shop_open(c->id == EV_GERSON ? SHOP_GERSON : SHOP_TEM);+ WAIT_UNTIL(g_mode == MODE_WORLD);+ EV_END;+}++static int ev_temmie(Ev *c) {+ static const char *const lines[4] = {+ "* hOI!!! im temmie!!|* and dis is my friend... temmie!!",+ "* hOI!! im temmie!!\n* don forget my friend!!",+ "* hOI!!!\n* yaya!!! human!!! so cute!!",+ "* hOI... tem is allergic to temmies...|* but tem still luvs dem!!"};+ EV_BEGIN;+ NARRATE(lines[(c->self ? c->self->arg : 0) & 3]);+ 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);+ case EV_COOLER: return ev_cooler(c);+ case EV_MAD_DUMMY: return ev_mad_dummy(c);+ case EV_NAPSTA_ROOM: return ev_napsta_room(c);+ case EV_LOCKED_HOUSE: return ev_locked_house(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/wfmon.c b/games/undertale/src/wfmon.cindex 86b3b28d..541eb51d 100644--- a/games/undertale/src/wfmon.c+++ b/games/undertale/src/wfmon.c@@ -5,6 +5,7 @@#include "battle.h"#include "game.h"#include "gfx.h"+#include "items.h"#include "monsters.h"#include "res.h"#include "world.h"@@ -113,6 +114,65 @@ static const char *talk_shyren(Battle *b, Monster *m) {}static int attack_shyren(Battle *b, Monster *m) { (void)b, (void)m; return ATK_SHYREN_NOTES; }+/* ---------------------------------------------------------------- Mad Dummy: a ghost, so a hit passes through; its+ * own missiles, led back up into it, do hurt it. Then its cousin Napstablook drifts in (the fight ends) */+static void act_maddummy(Battle *b, Monster *m, int act, char *t, int cap) {+ (void)b, (void)m, (void)act;+ snprintf(t, (size_t)cap, "* You try to talk.\n* Mad Dummy is too busy yelling to hear a word.");+}+static const char *talk_maddummy(Battle *b, Monster *m) {+ static const char *const lines[] = {"You! You\nhit my\ncousin!", "Dummies!\nGet them!", "Stand\nSTILL!",+ "Why won't\nyou go\ndown?!", "Grr... GRRR!"};+ if (m->state >= 2) return "That's it!\nNo more\nmagic!";+ if (m->state) return "Ow! Who\nthrew that?!";+ return lines[min_i(b->turn - 1, 4)];+}+static const char *flavor_maddummy(Battle *b, Monster *m) {+ (void)b;+ if (m->state) return "* Mad Dummy is hit by its own magic.";+ return NULL;+}+static bool hit_maddummy(Battle *b, Monster *m, int dmg) {+ (void)b, (void)dmg;+ m->dmg_shown = 0; /* (MISS: it's a ghost) */+ return true;+}+static int attack_maddummy(Battle *b, Monster *m) {+ (void)m;+ return b->turn <= 2 || b->turn % 2 ? ATK_DUMMY_MINIONS : ATK_DUMMY_MISSILES;+}+/* hit three times by its missiles, or after a long while: Napstablook comes, and the fight is over */+static bool ends_maddummy(Battle *b, Monster *m) { return m->state >= 3 || b->turn >= 8; }++/* ---------------------------------------------------------------- Temmie: talk to her (or feed her Temmie Flakes) */+static void act_temmie(Battle *b, Monster *m, int act, char *t, int cap) {+ (void)b;+ if (act == 0) { /* Flex */+ snprintf(t, (size_t)cap, "* You flex.\n* Temmie is so impressed she wanders off to tell her friends.");+ m->gone = true, m->fade = 1;+ } else if (act == 1) { /* Talk */+ snprintf(t, (size_t)cap, "* You say hi.\n* Temmie vibrates with joy.");+ m->spare = true;+ } else { /* Feed Temmie Flakes */+ int slot = -1;+ for (int i = 0; i < NUM_ITEMS; i++)+ if (sv.items[i] == ITEM_TEMMIE_FLAKES) slot = i;+ if (slot < 0) snprintf(t, (size_t)cap, "* You don't have any Temmie Flakes.");+ else {+ item_remove_at(slot);+ snprintf(t, (size_t)cap, "* You feed Temmie some Temmie Flakes.\n* She's so happy, she gives you money!");+ m->spare = true, m->spare_gold = 30;+ }+ }+}+static const char *talk_temmie(Battle *b, Monster *m) {+ (void)b;+ static const char *const lines[] = {"hOI!!", "tem!!!", "awa\nawa!!", "u cute!!"};+ if (m->spare) return "u r tem's\nfriend!!";+ return lines[rnd_n(4)];+}+static int attack_temmie(Battle *b, Monster *m) { (void)b, (void)m; return ATK_TEMMIE_HOPS; }+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,@@ -137,6 +197,19 @@ static const MonDef wf_defs[MON_COUNT - MON_SNOW_COUNT] = {.spr_hurt = SPR_SHYREN_TURNED, .check = "She'd love to sing, if nobody were watching.",.acts = {"Smile", "Hum", "Conduct"}, .nacts = 3, .neutral = {"* Shyren hides her face.", "* Shyren is humming to herself.", "* Shyren peeks at you."},.act = act_shyren, .talk = talk_shyren, .attack = attack_shyren},+ [MON_MAD_DUMMY - MON_SNOW_COUNT] = {+ .name = "Mad Dummy", .hp = 200, .at = 7, .df = 0, .exp = 0, .gold = 0, .spr_idle = SPR_MADDUMMY_B,+ .spr_hurt = SPR_MADDUMMY_B, .idle_speed = 4, .check = "Lives inside a dummy. Hits go right through.", .acts = {"Talk"},+ .nacts = 1, .neutral = {"* Mad Dummy is yelling at its dummies.", "* Mad Dummy glares at you.",+ "* Mad Dummy's dummies are getting nervous."},+ .flags = MF_BOSS | MF_NOT_KILLABLE, .act = act_maddummy, .talk = talk_maddummy, .attack = attack_maddummy,+ .flavor = flavor_maddummy, .on_hit = hit_maddummy, .ends = ends_maddummy},+ [MON_TEMMIE - MON_SNOW_COUNT] = {+ .name = "Temmie", .hp = 5, .at = 7, .df = 0, .exp = 40, .gold = 20, .spr_idle = SPR_TEMMIE_B,+ .spr_hurt = SPR_TEMMIE_HURT, .idle_speed = 4, .check = "Wants to pet you. You're allergic, though.",+ .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},};const MonDef *wf_mon_def(int id) { return &wf_defs[id - MON_SNOW_COUNT]; }@@ -156,6 +229,9 @@ static const Form wf_forms[FORM_COUNT - FORM_SNOW_COUNT] = {[FORM_MOLDBYGG_MOLDSMAL - FORM_SNOW_COUNT] = {{MON_MOLDSMAL, MON_MOLDBYGG}, 2, "* Moldbygg and Moldsmal block the way."},[FORM_MOLDBYGG_WOSHUA - FORM_SNOW_COUNT] = {{MON_MOLDBYGG, MON_WOSHUA}, 2, "* Moldbygg and Woshua appear."},[FORM_SHYREN - FORM_SNOW_COUNT] = {{MON_SHYREN}, 1, "* Shyren hums, then hides."},+ [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."},};const Form *wf_form(int form) { return &wf_forms[form - FORM_SNOW_COUNT]; }@@ -168,6 +244,10 @@ int wf_encounter(int room) {static const uint8_t pool[] = {FORM_WOSHUA, FORM_WOSHUA_AARON, FORM_MOLDBYGG, FORM_MOLDBYGG_MOLDSMAL, FORM_AARON};return pool[rnd_n(5)];}+ case ROOM_WF_TWIN: case ROOM_WF_MUSHROOM: {+ static const uint8_t pool[] = {FORM_TEMMIE, FORM_TEMMIE_MOLDBYGG, FORM_MOLDBYGG, FORM_WOSHUA, FORM_AARON};+ return pool[rnd_n(5)];+ }}return -1;}@@ -266,6 +346,59 @@ static void atk_shyren_notes(int t) {int wf_attack_length(int atk) { (void)atk; return 160; }+/* Mad Dummy: its dummies fly in from the sides and fire; later its magic missiles home in on the SOUL, and one that+ * flies into Mad Dummy (up at the board's top middle, where it shows) hurts it */+static void atk_dummy_minions(int t) {+ if (t < 130 && t % 22 == 0) {+ bool left = (t / 22) % 2;+ int y = by0() + 12 + rnd_n(by1() - by0() - 24);+ Bullet *d = shot((t / 22) % 3 == 2 ? SPR_DUMMY_BOT : SPR_DUMMY_MINION, left ? bx0() - 12 : bx1() + 12, y,+ (left ? 1 : -1) * P(2), 0);+ if (d) d->r = 7, d->flags |= BF_NOCLIP, d->life = 140;+ }+}+#define DUMMY_X (board_cx())+#define DUMMY_Y (by0() + 4)+static void atk_dummy_missiles(int t) {+ if (t < 100 && t % 25 == 0) {+ Bullet *b = shot(SPR_ORB, (t / 25) % 2 ? bx0() + 6 : bx1() - 6, by1() - 6, 0, -P(1));+ if (b) b->kind = BK_SCRIPT, b->r = 4, b->a = 0;+ }+ /* (the dummy's mark: what the missiles may fly into) */+ if (t == 0) {+ Bullet *m = shot(SPR_DUMMY_MINION, DUMMY_X, DUMMY_Y, 0, 0);+ if (m) m->flags |= BF_HARMLESS, m->kind = BK_NONE, m->life = 180, m->a = 1;+ }+ for (int i = 0; i < MAX_BULLETS; i++) {+ Bullet *b = &bullets[i];+ if (b->kind != BK_SCRIPT || b->spr != SPR_ORB) continue;+ /* steer toward the SOUL, a little at a time */+ int dx = soul_x() * FX - b->x, dy = soul_y() * FX - b->y;+ b->vx += dx > 0 ? 2 : -2, b->vy += dy > 0 ? 2 : -2;+ b->vx = clamp_i(b->vx, -P(2), P(2)), b->vy = clamp_i(b->vy, -P(2), P(2));+ b->x += b->vx, b->y += b->vy;+ if (abs_i(b->x / FX - DUMMY_X) < 8 && abs_i(b->y / FX - DUMMY_Y) < 8 && b->t > 20) {+ b->kind = BK_NONE;+ for (int k = 0; k < bt.nmon; k++)+ if (bt.mon[k].def == &wf_defs[MON_MAD_DUMMY - MON_SNOW_COUNT]) bt.mon[k].state++, bt.mon[k].hurt = 20, bt.mon[k].shake = 6;+ }+ if (b->t > 200) b->kind = BK_NONE;+ }+}+/* Temmie: little Temmies hop across the board */+static void atk_temmie_hops(int t) {+ if (t < 130 && t % 26 == 0) {+ bool left = (t / 26) % 2;+ Bullet *b = shot(SPR_TEMMIE_OW, left ? bx0() - 10 : bx1() + 10, by1() - 8, (left ? 1 : -1) * P(2), -P(3));+ if (b) b->kind = BK_GRAVITY, b->ay = 5, b->r = 7, b->flags |= BF_NOCLIP, b->life = 150, b->a = 4;+ }+ for (int i = 0; i < MAX_BULLETS; i++) {+ Bullet *b = &bullets[i];+ if (b->kind != BK_GRAVITY || b->spr != SPR_TEMMIE_OW || b->a <= 0) continue;+ if (b->y > P(by1() - 8) && b->vy > 0) b->vy = -P(3), b->a--;+ }+}+void wf_attack_run(Battle *b, int atk, int t) {(void)b;if (t < 0) {@@ -280,5 +413,8 @@ void wf_attack_run(Battle *b, int atk, int t) {case ATK_MOLDBYGG_HOPS: atk_moldbygg_hops(t); break;case ATK_MOLDBYGG_RAIN: atk_moldbygg_rain(t); break;case ATK_SHYREN_NOTES: atk_shyren_notes(t); break;+ 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;}}diff --git a/games/undertale/tests/check.py b/games/undertale/tests/check.pyindex ac686bc9..cdd306cd 100644--- a/games/undertale/tests/check.py+++ b/games/undertale/tests/check.py@@ -1,7 +1,7 @@#!/usr/bin/env python3"""Checks of Undertale on a computer (make test): the host build, withAddressSanitizer and UBSan, through the menus, every battle, the saves, the-whole Ruins, the whole of Snowdin and Waterfall's west half.+whole Ruins, the whole of Snowdin and Waterfall as far as it goes.python3 tests/check.py build/play [--quick]@@ -31,9 +31,9 @@ MODE_WORLD, MODE_BATTLE, MODE_END, MODE_SHOP = 2, 3, 8, 9ROOMS = {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 = \- range(32, 39)-ITEM_OLD_TUTU, ITEM_BALLET_SHOES, ITEM_QUICHE, ITEM_PUNCH_CARD, ITEM_ARTIFACT = range(17, 22)+(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)+ITEM_OLD_TUTU, ITEM_BALLET_SHOES, ITEM_QUICHE, ITEM_PUNCH_CARD, ITEM_ARTIFACT, ITEM_ASTRONAUT_FOOD = range(17, 23)def run(args, frames, saves=None, what=""):@@ -102,19 +102,22 @@ s = run(["--battle", str(FORM_PAPYRUS), "--path", "spare"], 6000, what="Papyrus,check(s and s["mode"] == MODE_WORLD and s["hp"] == 1, f"Papyrus did not capture Frisk: {s}")# 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)-for form in range(FORM_AARON, FORM_SHYREN + 1):+# 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]: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):+for form in (FORM_AARON, FORM_WOSHUA, FORM_MOLDBYGG, FORM_SHYREN, FORM_TEMMIE):s = run(["--god", "--battle", str(form), "--path", "fight"], 4000, what=f"battle {form}, fighting")check(s and s["mode"] == MODE_WORLD and s["kills"] >= 1, f"battle {form}: FIGHT did not win it: {s}")for form, seq, gold in ((FORM_AARON, "1,1,1", 30), (FORM_WOSHUA, "1,1,1", 25), (FORM_WOSHUA_AARON, "1,1@2,1@2,1@2", 55),(FORM_MOLDBYGG, "1,3", 20), (FORM_MOLDBYGG_WOSHUA, "1,3,1@2,1@2,1@2", 45),- (FORM_SHYREN, "2,2,2,2,2", 20)):+ (FORM_SHYREN, "2,2,2,2,2", 20), (FORM_TEMMIE, "2", 0), (FORM_TEMMIE_MOLDBYGG, "2,1@2,3@2", 20)):s = run(["--god", "--battle", str(form), "--path", "seq:" + seq], 9000, what=f"battle {form}, sparing")check(s and s["mode"] == MODE_WORLD and s["kills"] == 0 and s["gold"] == gold,f"battle {form}: the friendly way did not spare it: {s}")+s = run(["--god", "--battle", str(FORM_MAD_DUMMY), "--path", "act:1"], 9000, what="Mad Dummy")+check(s and s["mode"] == MODE_WORLD and s["kills"] == 0, f"Mad Dummy's fight did not end: {s}")# the shop in Snowdin: a Cinnamon Bunny for 25G; Papyrus's date: his phone numbers = run(["--name", "Frisk", "--noenc", "--room", str(ROOMS["SNOWTOWN"]), "--at", "446,1092", "--gold", "100", "--keys",@@ -167,21 +170,23 @@ if not QUICK:check(flag(s, name) == v, f"Snowdin: F_{name} is {flag(s, name)}, not {v}")check(s["kills"] == 0, f"Snowdin: {s['kills']} killed on the friendly way")-# Waterfall's west half, 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+# 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 Villageif not QUICK:s = run(["--name", "Frisk", "--noenc", "--god", "--room", str(ROOMS["WF1"]), "--at", "30,1480", "--path-file",- os.path.join(HERE, "waterfall.path")], 45000, what="Waterfall")- check(s and s["mode"] == MODE_END and s["room"] == ROOMS["WF_BRIDGE"], f"Waterfall did not end at the bridge: {s}")+ 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}")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)):+ ("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)):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):+ for item in (ITEM_OLD_TUTU, ITEM_BALLET_SHOES, ITEM_QUICHE, ITEM_PUNCH_CARD, ITEM_ARTIFACT, ITEM_ASTRONAUT_FOOD):check(item in s["items"], f"Waterfall: item {item} not picked up: {s['items']}")if failures:diff --git a/games/undertale/tests/waterfall.path b/games/undertale/tests/waterfall.pathindex 60cceed7..c3a9cef0 100644--- a/games/undertale/tests/waterfall.path+++ b/games/undertale/tests/waterfall.path@@ -223,5 +223,86 @@ talkgo:15400,1700go:16000,1700go:16800,1700-go:17400,1700+go:17370,1669+17400,1669talk+talk+# the garbage dump: waking on the golden flowers, the Trash Zone's SAVE, the walkway's cooler, Mad Dummy (until+# Napstablook comes)+go:18300,3240+go:18540,3256+u+z+talk+go:18880,3200+go:18930,2818+u+z+pick:0+talk+u+z+pick:0+talk+go:18905,2705+r+z+pick:0+talk+act:1+talk+# the Quiet Area, Napstablook's house (lying on the floor), the snail farm (no race), Gerson's shop (just looking)+go:18900,2440+go:18877,2116+18877,2080+w30+go:18972,1828+u+z+pick:0+talk+go:18840,1940+18840,1980+w30+go:19318,2134+u+z+pick:1+talk+go:19366,2290+u+z+w20+d+w5+d+w5+d+w5+z+w30+# 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+go:20540,2310+go:20700,2330+go:21070,2860+go:21070,2950+go:21170,3084+u+z+talk+go:21350,3070+u+z+w20+d+w5+d+w5+d+w5+z+w20+go:21070,2950+go:21070,2840+go:21150,2380diff --git a/games/undertale/tools/fetch.py b/games/undertale/tools/fetch.pyindex de4c4741..c5f52ffd 100644--- a/games/undertale/tools/fetch.py+++ b/games/undertale/tools/fetch.py@@ -58,7 +58,7 @@ PAGES = ["Ruins", "Ruins/Puzzles", "Toriel", "Toriel/In_battle", "Toriel's_Home""Junk_Food", "Annoying_Dog/In_battle", "Lesser_Dog/In_battle", "Greater_Dog/In_battle", "Doggo/In_battle","Dogamy_and_Dogaressa/In_battle"]# files the categories leave out, as their wiki names-FILES = ["QC sprite.png", "QC screenshot shop.png"]+FILES = ["QC sprite.png", "QC screenshot shop.png", "Gerson screenshot shop.png", "Tem Shop screenshot Temmie Armor.png"]DEMO = {"MacUnderTale.zip": "https://thisisatestofthevideogamedeliverysystem.sfo2.digitaloceanspaces.com/game/MacUnderTale.zip",}diff --git a/games/undertale/tools/rooms.py b/games/undertale/tools/rooms.pyindex f7d80b69..e2ed0862 100644--- a/games/undertale/tools/rooms.py+++ b/games/undertale/tools/rooms.py@@ -107,6 +107,8 @@ AREAS.append(dict(name="snowtown", map="Snowdin_Town_map.png", floor=SNOW, margiWF_FLOOR = [(54, 47, 121), (20, 26, 73)]WF_WATER = [(27, 33, 90), (27, 21, 72)]WF_CYAN = [(123, 251, 254), (47, 234, 255)]+WF_DUMP = [(17, 11, 49), (18, 24, 71), (5, 6, 33), (15, 9, 47)] # (the dump's water, waded in)+NAPSTA_FLOOR = [(198, 88, 41), (100, 50, 17), (133, 59, 41), (136, 68, 41)]AREAS.append(dict(name="waterfall", map="Waterfall_map.png", floor=WF_FLOOR, margin=0, close=True, patches=[# the people the game moves about (they're the game's objects here): Monster Kid, the fish by the first# echo flower, Undyne (her black ledges kept black), Woshua, the Goner Kid, Onionsan, Shyren, the grey@@ -120,6 +122,11 @@ AREAS.append(dict(name="waterfall", map="Waterfall_map.png", floor=WF_FLOOR, mar# the bridge seeds (the game's objects too) and the bridges they make, drawn solved*[("erase", x, y, 20, 20, WF_FLOOR) for x, y in [(2300, 1420), (2280, 1440), (2320, 1440), (2300, 1460),(2960, 1340), (3000, 1340), (2960, 1380), (3000, 1380)]],+ # past the bridge: Mad Dummy, the bird (on its side of the gap), Papyrus at Undyne's door, Napstablook (by the+ # houses, at the snail farm, at home), Mettaton, the creature by the pond (all the game's objects)+ ("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"),# 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)]),@@ -395,6 +402,36 @@ ROOMS = [fix=[("walk", 12920, 1676, 1480, 48)]),dict(name="wf_aaron", area="waterfall", rect=(14400, 1560, 960, 260), title="Waterfall", floor_colors=WF_WATER),dict(name="wf_bridge", area="waterfall", rect=(15360, 1540, 2300, 460), title="Waterfall"),+ # under the bridge: the garbage dump's landing (Frisk wades in its water), the Trash Zone, the walkway up to+ # Mad Dummy+ dict(name="wf_dump", area="waterfall", rect=(17580, 3120, 740, 260), title="Waterfall", floor_colors=WF_DUMP,+ fix=[("walk", 17666, 3226, 64, 40)]), # (the golden flowers Frisk wakes up on)+ dict(name="wf_trash", area="waterfall", rect=(18320, 3120, 500, 240), title="Waterfall", floor_colors=WF_DUMP),+ dict(name="wf_walkway", area="waterfall", rect=(18820, 2420, 160, 920), title="Waterfall", floor_colors=WF_DUMP),+ # the Quiet Area and its pond, the small bird's side of the gap, Blook Acres (Undyne's, Napstablook's and+ # Mettaton's houses, the snail farm), Napstablook's room, Gerson's crossroads+ dict(name="wf_quiet", area="waterfall", rect=(18660, 2200, 480, 220), title="Waterfall", floor_colors=WF_WATER,+ fix=[("walk", 18650, 2296, 50, 44)]),+ dict(name="wf_bird2", area="waterfall", rect=(18250, 2200, 410, 240), title="Waterfall",+ floor_colors=WF_WATER + [(23, 13, 43), (0, 0, 0)]),+ dict(name="wf_acres", area="waterfall", rect=(18420, 1960, 1000, 240), title="Waterfall", floor_colors=WF_WATER,+ fix=[("walk", 18876, 2088, 24, 30)], # (Napstablook's doorway)+ doors=[((18876, 2098, 24, 10), "wf_napsta_in", (18826, 1906), "up")]),+ dict(name="wf_napsta_in", area="waterfall", rect=(18780, 1720, 260, 240), title="Napstablook's house",+ floor_colors=NAPSTA_FLOOR, fix=[("walk", 18820, 1920, 40, 40)],+ doors=[((18820, 1954, 40, 6), "wf_acres", (18877, 2116), "down")]),+ dict(name="wf_gerson", area="waterfall", rect=(19140, 2200, 710, 280), title="Waterfall", floor_colors=WF_WATER),+ # the twin waterfalls (waded through), the mushroom maze (its walls dotted lines of grass: kept clear of), Temmie+ # Village below it+ dict(name="wf_twin", area="waterfall", rect=(19850, 2200, 700, 220), title="Waterfall",+ floor_colors=WF_WATER + WF_DUMP + [(0, 0, 0)], floor_rects=[(19850, 2286, 700, 48)]),+ dict(name="wf_mushroom", area="waterfall", rect=(20550, 2280, 610, 600), title="Waterfall",+ floor_colors=[(0, 0, 0)] + WF_WATER + WF_DUMP, margin=3, floor_rects=[(20550, 2306, 214, 48), (20555, 2350, 605, 530)],+ fix=[("walk", 20550, 2310, 214, 40), ("walk", 20556, 2346, 212, 16), ("walk", 20764, 2320, 24, 40),+ ("walk", 21020, 2372, 140, 26), ("walk", 21056, 2850, 44, 30)]),+ # (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)]),]# rooms one above the other through a dark doorway (tools/pack.py: apply_links); ("h", left, right, y, h): sidediff --git a/games/undertale/tools/sprites.py b/games/undertale/tools/sprites.pyindex 4ac2d9f2..e241d4a1 100644--- a/games/undertale/tools/sprites.py+++ b/games/undertale/tools/sprites.py@@ -299,6 +299,16 @@ SPRITES = [("bloom", "wiki:Bridge_Seed_overworld_flower.png", {"keep": True}),# what's about Waterfall (cut from the map, its floor made see-through): the small bird, and to be picked up,# the tutu, the artifact on its pedestal+ # past the bridge: Mad Dummy and its dummies, Temmie, the shops' keepers+ ("maddummy_ow", "wiki:Mad_Dummy_overworld.png", {"feet": True}),+ ("maddummy_b", "wiki:Mad_Dummy_battle.gif", {"feet": True, "every": 9}),+ ("dummy_minion", "wiki:Dummy_Minion_battle.png", {"center": True}),+ ("dummy_bot", "wiki:Dummy_Bot_battle.png", {"center": True}),+ ("temmie_ow", "wiki:Temmie_overworld.png", {"feet": True}),+ ("temmie_b", "wiki:Temmie_battle_idle.gif", {"feet": True, "every": 8}),+ ("temmie_hurt", "wiki:Temmie_battle_hurt.png", {"feet": True}),+ ("shop_gerson", "wiki:Gerson_screenshot_shop.png", {"keep": True, "box": (0, 0, 320, 120)}),+ ("shop_tem", "wiki:Tem_Shop_screenshot_Temmie_Armor.png", {"keep": True, "box": (0, 0, 320, 120)}),("bird", "map:Waterfall_map.png:8466,578,15,19", {"keep": True, "clear": [(27, 33, 90), (27, 21, 72), (23, 13, 43)]}),("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",diff --git a/tools/release.py b/tools/release.pyindex 6faf9e72..817b2e84 100644--- a/tools/release.py+++ b/tools/release.py@@ -27,9 +27,9 @@ ALONE = {"on its own"),"hollowknight": ("Hollow Knight", "from King's Pass to Hornet in Greenpath. Too big to share the calculator with ""NumPlay: install it on its own"),- "undertale": ("Undertale", "the Ruins, Snowdin and half of Waterfall, from the bed of golden flowers to the bridge "- "Undyne cuts: Flowey, Toriel, Sans, Papyrus, Monster Kid, Undyne's spears and every puzzle, the rest "- "of the Underground to come. Too big to share the calculator with NumPlay: install it on its own"),+ "undertale": ("Undertale", "the Ruins, Snowdin and most of Waterfall, from the bed of golden flowers to Temmie "+ "Village: Flowey, Toriel, Sans, Papyrus, Monster Kid, Undyne's spears, Mad Dummy and every puzzle, the "+ "rest of the Underground to come. Too big to share the calculator with NumPlay: install it on its own"),"championisland": ("Champion Island", "the Doodle Champion Island Games. Too big to share the calculator with ""NumPlay: install it on its own"),"numpowder": ("NumPowder", "The Powder Toy on the calculator: sand, water, fire, acid, electricity and nearly 200 "