Skip to content

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.

Undertale: Waterfall's marsh the way the game has it

Mason Chen21340aa949cd
diff --git a/games/undertale/README.md b/games/undertale/README.md
index 0160f77e..a822b6d5 100644
--- a/games/undertale/README.md
+++ b/games/undertale/README.md
@@ -25,7 +25,7 @@
* **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 bird over the gap, Onionsan, the piano's secret song, the statue in the rain and Monster Kid under your umbrella.
+* **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.
* **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.
diff --git a/games/undertale/docs/onionsan.png b/games/undertale/docs/onionsan.png
index 231095d6..147c2e01 100644
Binary files a/games/undertale/docs/onionsan.png and b/games/undertale/docs/onionsan.png differ
diff --git a/games/undertale/src/data.bin b/games/undertale/src/data.bin
index 0d14c6e7..93e1aae5 100644
Binary files a/games/undertale/src/data.bin and b/games/undertale/src/data.bin differ
diff --git a/games/undertale/src/data.h b/games/undertale/src/data.h
index 31099127..6eff4211 100644
--- a/games/undertale/src/data.h
+++ b/games/undertale/src/data.h
@@ -195,60 +195,61 @@
#define SPR_WOSHUA_OW 181
#define SPR_SEED 182
#define SPR_BLOOM 183
-#define SPR_TUTU 184
-#define SPR_ARTIFACT 185
-#define SPR_SPEAR 186
-#define SPR_NOTE 187
-#define SPR_DROP 188
-#define SPR_ARM 189
-#define SPR_DEBRIS 190
-#define SPR_AARON_B 191
-#define SPR_AARON_HURT 192
-#define SPR_WOSHUA_B 193
-#define SPR_WOSHUA_HURT 194
-#define SPR_MOLDBYGG_B 195
-#define SPR_SHYREN_B 196
-#define SPR_SHYREN_TURNED 197
-#define SPR_INTROIMAGE 198
-#define SPR_INTROLAST 199
-#define SPR_UNDERTALETITLE 200
-#define SPR_GAMEOVERBG 201
-#define SPR_FACE_TORIELTALK 202
-#define SPR_FACE_TORIELTALKSIDE 203
-#define SPR_FACE_TORIELHAPPYTALK 204
-#define SPR_FACE_TORIELWHAT 205
-#define SPR_FACE_TORIELWHATSIDE 206
-#define SPR_FACE_TORIELMAD 207
-#define SPR_FACE_TORIELCOLD 208
-#define SPR_FACE_TORIELSURPRISED 209
-#define SPR_FACE_TORIELEMBARRASSED 210
-#define SPR_FACE_TORIELGLASSES 211
-#define SPR_FACE_TORIELREVENGETALK 212
-#define SPR_FACE_TORIELSCARED 213
-#define SPR_FACE_TORIELBLINK 214
-#define SPR_FACE_TORIELHAPPYBLINK 215
-#define SPR_FACE_TORIELBODY 216
-#define SPR_FACE_SANS 217
-#define SPR_FACE_SANSCHUCKLE 218
-#define SPR_FACE_SANSWINK 219
-#define SPR_FACE_PAPYRUS 220
-#define SPR_FACE_PAPYRUSEVIL 221
-#define SPR_FACE_PAPYRUSLAUGH 222
-#define SPR_FACE_PAPYRUSMAD 223
-#define SPR_FACE_PAPYRUSSIDE 224
-#define SPR_FLOWEYNICE 225
-#define SPR_FLOWEYNICESIDE 226
-#define SPR_FLOWEYSASSY 227
-#define SPR_FLOWEYEVIL 228
-#define SPR_FLOWEYGRIN 229
-#define SPR_FLOWEYPLAIN 230
-#define SPR_FLOWEYPISSED 231
-#define SPR_FLOWEYWINK 232
-#define SPR_FLOWEYLAUGH 233
-#define SPR_FLOWEYHURT 234
-#define SPR_FLOWEYTORIEL 235
-#define SPR_FLOWEYTORIEL2 236
-#define SPR_FLOWEYSIDESHOCK 237
+#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 AREA_RUINS 0
#define AREA_SNOWDIN 1
#define AREA_SNOWTOWN 2
@@ -364,7 +365,7 @@
#define FONT_MAIN 0
#define FONT_MENU 1
#define FONT_SMALL 2
-#define NUM_SPRITES 238
+#define NUM_SPRITES 239
#define NUM_ROOMS 108
#define NUM_FONTS 3
#endif
diff --git a/games/undertale/src/wf1.c b/games/undertale/src/wf1.c
index c1565ef6..0b835bc6 100644
--- a/games/undertale/src/wf1.c
+++ b/games/undertale/src/wf1.c
@@ -370,11 +370,10 @@ void wf1_setup(int room, int from) {
break;
}
case ROOM_WF_MARSH_TOP: {
- /* the bird at the boardwalk's end, and (unseen) on the far side for the way back */
- Obj *b = obj_trigger(8462, 574, 22, 26, EV_WF_BIRD, ACTOR_ANY);
+ /* 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;
- Obj *r = obj_trigger(8536, 556, 8, 44, EV_WF_BIRD, ACTOR_ANY);
- if (r) r->flags = OF_TALK, r->arg = 1;
break;
}
case ROOM_WF_MARSH:
@@ -392,7 +391,7 @@ void wf1_setup(int room, int from) {
static const uint16_t o[4] = {SPR_ONIONSAN, SPR_ONIONSAN, SPR_ONIONSAN, SPR_ONIONSAN};
Obj *on = obj_npc(ACTOR_ONION, o, 8900, 650, DIR_DOWN, 0);
if (on) on->flags = OF_BACK, on->alpha = flag(F_WF_ONION) ? 255 : 0;
- if (!flag(F_WF_ONION)) obj_trigger(8780, 560, 20, 100, EV_WF_ONION, ACTOR_TRIGGER);
+ if (!flag(F_WF_ONION)) obj_trigger(8840, 656, 20, 48, EV_WF_ONION, ACTOR_TRIGGER);
}
break;
case ROOM_WF_PIANO: {
@@ -586,12 +585,9 @@ static int ev_wf_telescope(Ev *c) {
static int ev_wf_bird(Ev *c) {
EV_BEGIN;
- c->v[1] = c->self ? c->self->arg : 0;
- NARRATE(c->v[1] ? "* (The little bird offers to carry you back.)@Yes@No"
- : "* (A little bird offers to carry you over the gap.)@Yes@No");
+ NARRATE("* (The little bird offers to carry you over the gap.)@Yes@No");
if (CHOICE() == 0) {
- if (c->v[1]) FADE_TO(ROOM_WF_MARSH_TOP, 8440, 562, DIR_LEFT);
- else FADE_TO(ROOM_WF_MARSH_TOP, 8552, 562, DIR_RIGHT);
+ FADE_TO(ROOM_WF_MARSH_TOP, 8440, 562, DIR_LEFT);
set_flag(F_WF_BIRD, 1);
}
EV_END;
diff --git a/games/undertale/tests/check.py b/games/undertale/tests/check.py
index 4c7fd151..ac686bc9 100644
--- a/games/undertale/tests/check.py
+++ b/games/undertale/tests/check.py
@@ -169,8 +169,7 @@ if not QUICK:
# 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), the bird,
-# Onionsan, the piano and the artifact, Shyren, the umbrellas, Monster Kid in the rain, the bridge cut
+# (the ballet shoes), Onionsan, the piano and the artifact, Shyren, the umbrellas, Monster Kid in the rain, the bridge cut
if 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")
@@ -178,7 +177,7 @@ if not QUICK:
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_BIRD", 1), ("WF_ONION", 2), ("PIANO", 1), ("WF_ARTIFACT", 1), ("SHYREN", 1),
+ ("WF_ONION", 2), ("PIANO", 1), ("WF_ARTIFACT", 1), ("SHYREN", 1),
("UMBRELLA", 3), ("MK_RAIN", 2), ("WF_BRIDGE", 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")
diff --git a/games/undertale/tests/waterfall.path b/games/undertale/tests/waterfall.path
index 7f133bb1..60cceed7 100644
--- a/games/undertale/tests/waterfall.path
+++ b/games/undertale/tests/waterfall.path
@@ -119,7 +119,7 @@ go:6700,560
talk
w30
talk
-# the crystals' SAVE, Sans's telescope, the Nice Cream cart and the punch card upstairs, the bird
+# the crystals' SAVE, Sans's telescope, the Nice Cream cart and the punch card upstairs
go:7248,562
u
z
@@ -137,7 +137,8 @@ go:8050,130
u
z
talk
-# down the ladder into the marsh: the ballet shoes in the tall grass, an echo flower, the history sign
+# south past Loren, down the ladder into the marsh: the ballet shoes in the tall grass, an echo flower, the history
+# sign, then up to Onionsan's path; the piano's song (the artifact), Shyren (hummed along with)
go:8140,560
go:8140,700
go:7590,1250
@@ -152,23 +153,14 @@ go:8850,840
u
z
talk
-go:8140,700
-go:8140,560
-go:8000,560
-go:8300,560
-go:8440,560
-r
-z
-talk
-w60
-# Onionsan, the piano's song (the artifact), Shyren (hummed along with)
-go:8700,600
-go:8900,600
+go:8770,760
+go:8800,664
+go:8900,664
talk
-go:9300,600
-go:9600,600
+go:9300,664
+go:9600,664
talk
-go:9850,620
+go:9850,664
go:10070,640
go:10066,412
u
diff --git a/games/undertale/tools/pack.py b/games/undertale/tools/pack.py
index 60cbd01c..d44839a8 100644
--- a/games/undertale/tools/pack.py
+++ b/games/undertale/tools/pack.py
@@ -484,21 +484,6 @@ def collision(area, r):
big = np.zeros((Y1 - Y0, X1 - X0), bool)
xs0, ys0, xs1, ys1 = max(X0, 0), max(Y0, 0), min(X1, W), min(Y1, H)
big[ys0 - Y0:ys1 - Y0, xs0 - X0:xs1 - X0] = np.isin(area.idx[ys0:ys1, xs0:xs1], list(walk_idx))
- if r.get("tufts"):
- # black ground with grass tufts on it, black nothing without: black is floor only within `tufts` pixels of a
- # tuft (a little blot of another colour with black all around it)
- win = np.zeros(big.shape, area.idx.dtype)
- win[ys0 - Y0:ys1 - Y0, xs0 - X0:xs1 - X0] = area.idx[ys0:ys1, xs0:xs1]
- black = np.isin(win, [i for i, k in enumerate(area.rgb) if k == (0, 0, 0) and i != area.transparent])
- lab, n = ndimage.label(~black, np.ones((3, 3)))
- tuft = np.zeros_like(black)
- for i, sl in enumerate(ndimage.find_objects(lab)):
- hh, ww = sl[0].stop - sl[0].start, sl[1].stop - sl[1].start
- if hh <= 12 and ww <= 12:
- ring = ndimage.binary_dilation(lab[sl] == i + 1, iterations=1) & (lab[sl] != i + 1)
- if black[sl][ring].all():
- tuft[sl] |= lab[sl] == i + 1
- big &= ~black | (ndimage.distance_transform_edt(~tuft) <= r["tufts"])
sub = big[margin:margin + ch * 4, margin:margin + cw * 4]
if r.get("open"): # floors of many colours (a carpet, planks): its floor_rects alone say
sub = np.ones_like(sub)
diff --git a/games/undertale/tools/rooms.py b/games/undertale/tools/rooms.py
index 1ffe9c1b..f7d80b69 100644
--- a/games/undertale/tools/rooms.py
+++ b/games/undertale/tools/rooms.py
@@ -120,7 +120,8 @@ 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)]],
- # the tutu and the artifact (objects, gone once taken)
+ # 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)]),
("erase", 10156, 150, 12, 7, [(27, 21, 72), (27, 33, 90), (54, 47, 121)]),
("fill", 10156, 157, 12, 1, (0, 0, 0)), ("fill", 10156, 158, 12, 3, (99, 102, 135)),
@@ -364,19 +365,23 @@ ROOMS = [
dict(name="wf_sans2", area="waterfall", rect=(7840, 0, 360, 600), title="Waterfall", floor_colors=WF_WATER,
floor_rects=[(7860, 92, 300, 118), (7956, 206, 38, 360), (7840, 556, 360, 50)],
fix=[("walk", 7956, 420, 38, 140)]),
- # the marsh: its shallow glowing water and its grassy black ground are walked on (plain black is nothing, the
- # planks cross it); the boardwalk ends at a gap the bird carries Frisk over, a ladder goes down into the marsh
+ # the marsh, where the colours turn: its land is black, its water bright blue (the planks cross it), and around
+ # it plain black is nothing (its rectangles); the boardwalk ends at a gap the bird carries Frisk over, a ladder
+ # goes down into the marsh
dict(name="wf_marsh_top", area="waterfall", rect=(8200, 400, 450, 200), title="Waterfall",
- floor_colors=WF_WATER + [(23, 13, 43), (0, 0, 0)], tufts=44, floor_rects=[(8200, 556, 284, 64), (8536, 556, 114, 64)]),
+ floor_colors=WF_WATER + [(23, 13, 43), (0, 0, 0)], floor_rects=[(8200, 556, 284, 64), (8536, 556, 114, 64)]),
dict(name="wf_marsh_mid", area="waterfall", rect=(7400, 600, 1250, 200), title="Waterfall",
- floor_colors=[(0, 0, 0)] + WF_CYAN, tufts=44,
+ floor_colors=[(0, 0, 0)], floor_rects=[(8060, 600, 590, 100), (8060, 700, 110, 100), (7760, 780, 300, 20)],
fix=[("walk", 8140, 600, 20, 84)]),
dict(name="wf_marsh", area="waterfall", rect=(7400, 800, 1650, 660), title="Waterfall",
- floor_colors=[(0, 0, 0)] + WF_CYAN, tufts=44,
+ floor_colors=[(0, 0, 0)], floor_rects=[(7660, 800, 510, 660), (8170, 940, 190, 520), (8360, 1000, 380, 460),
+ (8740, 800, 55, 660), (8795, 800, 85, 120), (8795, 1000, 265, 460),
+ (7460, 1150, 200, 190)],
fix=[("walk", x, y - 2, w, h + 4) for x, y, w, h in [(7821, 825, 58, 55), (7921, 945, 58, 55), (8301, 1005, 58, 55),
(8741, 1005, 58, 55), (8561, 1145, 58, 55), (7941, 1220, 59, 60), (8501, 1360, 59, 57), (8741, 1440, 56, 17)]]),
- dict(name="wf_onion", area="waterfall", rect=(8650, 500, 1250, 300), title="Waterfall", floor_colors=WF_WATER,
- fix=[("walk", 8648, 560, 16, 40), ("walk", 9800, 600, 20, 58), ("walk", 9860, 640, 40, 58)]),
+ # (up from the marsh, a narrow black path by Onionsan's water)
+ dict(name="wf_onion", area="waterfall", rect=(8650, 500, 1250, 300), title="Waterfall", floor_colors=[(0, 0, 0)],
+ floor_rects=[(8740, 656, 1160, 48), (8740, 656, 60, 144)], fix=[("walk", 9860, 660, 40, 40)]),
dict(name="wf_piano", area="waterfall", rect=(9900, 20, 600, 780), title="Waterfall", floor_colors=WF_WATER,
floor_rects=[(10060, 140, 200, 64), (10136, 200, 48, 104), (10118, 300, 64, 100), (10040, 398, 220, 64),
(10118, 460, 64, 140), (10040, 598, 220, 124), (9900, 638, 142, 46), (10258, 638, 242, 46)]),
diff --git a/games/undertale/tools/sprites.py b/games/undertale/tools/sprites.py
index d93bf791..4ac2d9f2 100644
--- a/games/undertale/tools/sprites.py
+++ b/games/undertale/tools/sprites.py
@@ -297,8 +297,9 @@ SPRITES = [
("woshua_ow", "wiki:Woshua_overworld.gif", {"feet": True}),
("seed", "wiki:Bridge_Seed_overworld.png", {"keep": True}),
("bloom", "wiki:Bridge_Seed_overworld_flower.png", {"keep": True}),
- # what lies about Waterfall to be picked up (cut from the map, its floor made see-through): the tutu, the
- # artifact on its pedestal
+ # 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
+ ("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",
{"keep": True, "clear": [(27, 21, 72), (27, 33, 90), (54, 47, 121), (99, 102, 135)]}),