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.

Plants vs. Zombies: its own app in the releases, tests and keys sheet

Mason363ec7548d3e980
diff --git a/Makefile b/Makefile
index e61f8beb..739287df 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ RAM_LIMIT = 148928
# custom builds of Epsilon 25.2's source give apps less: 133652 bytes; every game fits there too, in NumPlay and on
# its own (their big buffers are on the stack, 32 KB apart from that RAM, or in the RAM the software has left)
CUSTOM_RAM = 133652
-BIG_APPS = Celeste HollowKnight Undertale ChampionIsland FinalEarth2 NumPowder NumBlocks NumDrive SubwaySurfers FiveNightsAtFreddys Doom BindingOfIsaac HillClimbRacing
+BIG_APPS = Celeste HollowKnight Undertale ChampionIsland FinalEarth2 NumPowder NumBlocks NumDrive SubwaySurfers FiveNightsAtFreddys Doom BindingOfIsaac HillClimbRacing PlantsVsZombies
# the calculator's space for installed apps (0x90200000 to 0x903F0000 in its flash)
APP_SPACE = 2031616
# Upsilon, the N0110 and N0115's custom software, gives .nwa apps less RAM: NumPlay-Upsilon.nwa has
@@ -213,6 +213,7 @@ APP_finalearth2 = games/finalearth2/output/finalearth2.nwa:FinalEarth2.nwa
APP_numpowder = games/numpowder/output/numpowder.nwa:NumPowder.nwa
APP_doom = games/doom/output/doom.nwa:Doom.nwa
APP_isaac = games/isaac/output/isaac.nwa:BindingOfIsaac.nwa
+APP_pvz = games/pvz/output/pvz.nwa:PlantsVsZombies.nwa
apps: | $(B)
$(MAKE) -C games/numdash build NWLINK="node node_modules/nwlink/bin/nwlink"
@@ -234,6 +235,7 @@ apps: | $(B)
$(MAKE) -C games/numpowder build NWLINK="$(NWLINK)"
$(MAKE) -C games/doom build NWLINK="$(NWLINK)"
$(MAKE) -C games/isaac build NWLINK="$(NWLINK)"
+ $(MAKE) -C games/pvz build NWLINK="$(NWLINK)"
cd games/tetris/tetris && NWLINK="$(NWLINK)" $(CARGO) build --release --quiet
cp $(word 1,$(subst :, ,$(APP_numdash))) $(B)/apps/$(word 2,$(subst :, ,$(APP_numdash)))
cp $(word 1,$(subst :, ,$(APP_crossyroad))) $(B)/apps/$(word 2,$(subst :, ,$(APP_crossyroad)))
@@ -255,6 +257,7 @@ apps: | $(B)
cp $(word 1,$(subst :, ,$(APP_numpowder))) $(B)/apps/$(word 2,$(subst :, ,$(APP_numpowder)))
cp $(word 1,$(subst :, ,$(APP_doom))) $(B)/apps/$(word 2,$(subst :, ,$(APP_doom)))
cp $(word 1,$(subst :, ,$(APP_isaac))) $(B)/apps/$(word 2,$(subst :, ,$(APP_isaac)))
+ cp $(word 1,$(subst :, ,$(APP_pvz))) $(B)/apps/$(word 2,$(subst :, ,$(APP_pvz)))
arm-none-eabi-strip --strip-unneeded $(B)/apps/Tetris.nwa
STD_APPS = $(foreach g,$(STD_GAMES),$(B)/apps/$(NWA_$(g)))
@@ -317,5 +320,6 @@ clean:
-$(MAKE) -C games/numpowder clean
-$(MAKE) -C games/doom clean
-$(MAKE) -C games/isaac clean
+ -$(MAKE) -C games/pvz clean
-cd games/tetris/tetris && $(CARGO) clean
-$(foreach g,$(STD_GAMES),$(MAKE) -C games/$(g) clean;)
diff --git a/games/pvz/src/board.c b/games/pvz/src/board.c
index 3f64e3b2..007ece56 100644
--- a/games/pvz/src/board.c
+++ b/games/pvz/src/board.c
@@ -297,6 +297,8 @@ void board_start(int level) {
for (int i = 0; i < d->nseeds; i++) B.seeds[i] = d->seeds[i];
}
generate_waves();
+ /* (the zombies wait for the first plant, the first time through the Adventure) */
+ if (progress.finished) B.started = 1;
if (B.mode == MODE_BOWLING) {
B.npackets = 1, B.packets[0].kind = P_WALLNUT, B.packets[0].x = 0;
B.started = 1, B.wave_in = 200;
diff --git a/games/pvz/src/screens.c b/games/pvz/src/screens.c
index 62808449..e473082d 100644
--- a/games/pvz/src/screens.c
+++ b/games/pvz/src/screens.c
@@ -65,12 +65,11 @@ static int lawn_back(void) {
}
}
-/* the lawn as the camera sees it; sod: how far the sod rows are rolled out (-1 all) */
-static void show_lawn(int sod) {
+void show_lawn(int sod) {
int bg = lawn_back(), sx = 88 + (int)(cam_x * 0.4f + (cam_x < 0 ? -0.5f : 0.5f));
if (B.level > 3 || B.env != ENV_DAY) sod = 0;
else if (sod < 0) sod = 1000;
- if (loaded_bg == bg && loaded_x == sx && loaded_sod == sod) return;
+ if (loaded_bg == bg + (B.level == 50) * 100 && loaded_x == sx && loaded_sod == sod) return;
gfx_load_back(bg, sx);
if (B.level == 50)
/* the roof by night: Dr. Zomboss comes in the dark */
@@ -85,7 +84,7 @@ static void show_lawn(int sod) {
if (x1 > SCREEN_W) x1 = SCREEN_W;
if (x1 > 0) gfx_load_back_rows(BG_LAWN, sx, y0, y1, 0, x1);
}
- loaded_bg = bg, loaded_x = sx, loaded_sod = sod;
+ loaded_bg = bg + (B.level == 50) * 100, loaded_x = sx, loaded_sod = sod;
}
/* ---------------------------------------------------------------- Crazy Dave */
@@ -246,7 +245,7 @@ static void begin_level(int level) {
static void start_play(void) {
B.phase = PH_PLAY;
- if (B.level == 1) B.tutorial = 1;
+ if (B.level == 1 && !progress.finished) B.tutorial = 1;
if (B.level == 2 && !progress.finished) B.tutorial = 2, B.wave_in = 5000;
if (B.mode != MODE_WHACK && (progress.rakes > 0) && B.mode != MODE_VASE && !B.has_boss) {
/* the rake waits in a lane */
@@ -382,7 +381,8 @@ void game_frame(uint32_t keys) {
}
switch (g_state) {
case ST_TITLE:
- if (state_t > 30 && hit(K_OK | (K_ANY & ~K_BACK))) go(ST_MENU);
+ /* (the keys, the first time) */
+ if (state_t > 30 && hit(K_OK | (K_ANY & ~K_BACK))) go(progress.keys_seen ? ST_MENU : ST_HELP);
if (hit(K_BACK)) g_running = false;
break;
@@ -716,7 +716,10 @@ void game_frame(uint32_t keys) {
}
case ST_HELP:
- if (hit(K_OK | K_BACK)) go(ST_MENU);
+ if (hit(K_OK | K_BACK)) {
+ if (!progress.keys_seen) progress.keys_seen = 1, progress_save();
+ go(ST_MENU);
+ }
break;
}
}
@@ -1056,7 +1059,7 @@ static void draw_help(void) {
gfx_text(F_HEAD, 116, y, keys[i][0], rgb565(0x7A2010), GFX_RIGHT);
gfx_text(F_BODY, 126, y, keys[i][1], rgb565(0x3A2410), 0);
}
- gfx_text(F_SMALL, 160, 226, "OK: back", rgb565(0x5A3A1E), GFX_CENTER);
+ gfx_text(F_SMALL, 160, 226, progress.keys_seen ? "OK: back" : "OK: on to the game", rgb565(0x5A3A1E), GFX_CENTER);
}
void game_draw(void) {
diff --git a/games/pvz/src/screens.h b/games/pvz/src/screens.h
index 61f27528..e39031f7 100644
--- a/games/pvz/src/screens.h
+++ b/games/pvz/src/screens.h
@@ -9,6 +9,8 @@ void game_frame(uint32_t keys); /* a hundredth of a second */
void game_draw(void);
extern bool g_running;
extern int g_state;
+/* the lawn as the camera sees it; sod: how far the sod rows are rolled out (-1 all) */
+void show_lawn(int sod);
enum {
ST_TITLE, ST_MENU, ST_LEVELS, ST_DAVE, ST_PAN, ST_CHOOSE, ST_READY, ST_PLAY, ST_PAUSE, ST_WON, ST_AWARD, ST_LOST,
ST_ALMANAC, ST_SHOP, ST_HELP
diff --git a/games/pvz/tests/check.py b/games/pvz/tests/check.py
new file mode 100644
index 00000000..7793503f
--- /dev/null
+++ b/games/pvz/tests/check.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Checks of Plants vs. Zombies on a computer (make test): the host build, with AddressSanitizer and UBSan,
+through the first start, a level kept by Home and continued, the saves coming back from pvz_saves.py, every
+screen pressed through, a level lost, and every level of the Adventure played by a robot (tests/play.c --sim).
+
+ python3 tests/check.py build/play [--quick]
+
+--quick plays a dozen levels instead of all fifty."""
+import os
+import random
+import re
+import shutil
+import subprocess
+import sys
+import tempfile
+
+PLAY = sys.argv[1] if len(sys.argv) > 1 else "build/play"
+QUICK = "--quick" in sys.argv
+ENV = dict(os.environ, ASAN_OPTIONS="detect_leaks=0", UBSAN_OPTIONS="halt_on_error=1:print_stacktrace=1")
+ST_MENU, ST_PLAY, ST_PAUSE, ST_LOST = 1, 7, 8, 11
+failures = []
+
+
+def check(cond, msg):
+ if not cond:
+ failures.append(msg)
+
+
+def run(args, what, timeout=1200):
+ p = subprocess.run([PLAY] + args, capture_output=True, text=True, env=ENV, timeout=timeout)
+ if p.returncode not in (0, 1) or "runtime error" in p.stderr or "AddressSanitizer" in p.stderr:
+ failures.append(f"{what}: crashed or a sanitizer error\n{p.stderr[-2000:]}")
+ return None
+ return p.stdout
+
+
+def end_state(out, what):
+ m = re.search(r"state (\d+) level (\d+) phase (\d+) sun (-?\d+) zombies (\d+) plants (\d+) wave (\d+)/(\d+) "
+ r"progress (\d+) money (\d+) slots (\d+) items (\d+) running (\d+)", out or "")
+ if not m:
+ failures.append(f"{what}: no end state\n{(out or '')[-500:]}")
+ return None
+ return dict(zip(("state", "level", "phase", "sun", "zombies", "plants", "wave", "waves", "progress", "money",
+ "slots", "items", "running"), map(int, m.groups())))
+
+
+def play(saves, keys, frames, what, extra=()):
+ shots = tempfile.mkdtemp(prefix="pvz_shots_")
+ out = run(["--saves", saves, "--out", shots, "--frames", str(frames), "--keys", keys] + list(extra), what)
+ shutil.rmtree(shots, ignore_errors=True)
+ return end_state(out, what)
+
+
+saves = tempfile.mkdtemp(prefix="pvz_check_")
+try:
+ # the first start: the title, the keys, Adventure; the street, the sod rolled out, a peashooter planted on it,
+ # then Home: the progress, the level and their copy are kept
+ s = play(saves, "50:ok,150:ok,250:ok,1200:1,1250:ok,1500:home", 1600, "first start")
+ if s:
+ check(s["running"] == 0, "Home did not quit")
+ check(s["level"] == 1 and s["plants"] >= 1, f"no peashooter on level 1-1: {s}")
+ for f in ("pvz.sav", "pvzlevel.sav", "pvz_saves.py"):
+ check(os.path.exists(os.path.join(saves, f)), f"{f} not written by Home")
+ kept = tempfile.mkdtemp(prefix="pvz_copy_")
+ for f in os.listdir(saves):
+ shutil.copy(os.path.join(saves, f), kept)
+
+ # next time: past the title (no keys sheet now), Continue, Back to Game: the level goes on from where it was
+ s = play(saves, "50:ok,150:ok,250:ok", 2500, "continue")
+ if s:
+ check(s["state"] == ST_PLAY and s["level"] == 1 and s["plants"] >= 1, f"level 1-1 did not go on: {s}")
+ check(not os.path.exists(os.path.join(saves, "pvzlevel.sav")), "the level kept after it was continued")
+
+ # installing apps again erases everything but scripts: the saves come back from pvz_saves.py
+ for f in os.listdir(kept):
+ if not f.endswith(".py"):
+ os.remove(os.path.join(kept, f))
+ s = play(kept, "50:ok,150:ok,250:ok", 2500, "from the copy")
+ if s:
+ check(s["state"] == ST_PLAY and s["level"] == 1 and s["plants"] >= 1, f"the copy did not bring 1-1 back: {s}")
+ shutil.rmtree(kept, ignore_errors=True)
+
+ # a level with a sunflower and nothing else: the mowers go, then the zombies eat your brains
+ fresh = tempfile.mkdtemp(prefix="pvz_lost_")
+ s = play(fresh, "50:ok,150:ok,250:ok,1500:2,1550:ok", 40000, "a level lost", ["--progress", "6"])
+ if s:
+ check(s["state"] == ST_LOST, f"level 1-6 not lost with a sunflower alone: {s}")
+ shutil.rmtree(fresh, ignore_errors=True)
+
+ # every screen, pressed through at random from a well advanced Adventure: the menus, Choose a Level, the
+ # Almanac, the shop, Crazy Dave, the seed chooser, the levels, the pause menu and its questions
+ names = ["left", "right", "up", "down", "ok", "ok", "ok", "back", "shovel", "almanac"] + [str(d) for d in range(10)]
+ for prog in (12, 25, 35, 45):
+ rnd = random.Random(prog)
+ keys, t = [], 60
+ while t < 30000:
+ keys.append(f"{t}:{rnd.choice(names)}")
+ t += rnd.randint(8, 60)
+ tour = tempfile.mkdtemp(prefix="pvz_tour_")
+ s = play(tour, ",".join(keys), 30000, f"keys pressed at random from level {prog}",
+ ["--progress", str(prog), "--money", "60000"])
+ shutil.rmtree(tour, ignore_errors=True)
+
+ # every level, a robot planting (with all the sun it wants): it must not crash, and win nearly all of them
+ levels = [1, 5, 10, 15, 20, 25, 30, 35, 41, 45, 49, 50] if QUICK else range(1, 51)
+ won = 0
+ for level in levels:
+ out = run(["--sim", str(level), "--frames", "90000"], f"level {level} played by the robot")
+ if out is None:
+ continue
+ line = out.strip().splitlines()[0] if out.strip() else ""
+ if " won " in line:
+ won += 1
+ else:
+ print(" ", " ".join(out.split()))
+ need = len(levels) - 5
+ check(won >= need, f"the robot won {won} of {len(levels)} levels (at least {need} expected)")
+ print(f"robot: {won} of {len(levels)} levels won")
+finally:
+ shutil.rmtree(saves, ignore_errors=True)
+
+if failures:
+ print("FAILED:")
+ for f in failures:
+ print(" -", f)
+ sys.exit(1)
+print("all checks passed")
diff --git a/games/pvz/tests/play.c b/games/pvz/tests/play.c
index e2134cc2..22a4762a 100644
--- a/games/pvz/tests/play.c
+++ b/games/pvz/tests/play.c
@@ -3,12 +3,15 @@
* play [--frames N] [--keys "10-40:right,50:ok,..."] [--shots 30,60|every:N] [--out DIR] [--saves DIR]
* [--progress L] [--money M]
* play --sim L [--frames N] [--shots ...] [--out DIR] [--quiet]
+ * ... [--raw DIR --raw-from T --raw-to T] [--sun-from T]
*
* Keys: left right up down ok back shovel home almanac 0-9. "a-b:key" holds the key from tick a to b, "a:key" for
* one tick (ticks are hundredths of a second; a frame is drawn every 3).
* --progress L sets the adventure at level L with what it has found by then (then the menus play as scripted).
* --sim L plays level L straight away, a robot planting (with all the sun it wants, so that every level's zombies
- * come and go): it prints how the level went and fails if it isn't won. Screenshots are DIR/shot_<tick>.ppm. */
+ * come and go): it prints how the level went and fails if it isn't won. Screenshots are DIR/shot_<tick>.ppm.
+ * --raw saves every frame drawn from tick T to T as RGB565 (DIR/frame_<ms>.raw, for NumPlay's tools/record.py
+ * --frames); --sun-from T: from then on the robot has the sun it collects (a level as it looks). */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -59,6 +62,18 @@ static void parse_keys(const char *spec) {
}
static int shots[1024], nshots_at, every;
+static const char *raw_dir;
+static int raw_from, raw_to = -1, sun_from = 1 << 30;
+
+static void raw_frame(int tick) {
+ char p[512];
+ snprintf(p, sizeof p, "%s/frame_%06d.raw", raw_dir, tick * 10);
+ FILE *f = fopen(p, "wb");
+ if (!f) return;
+ fwrite(host_fb, 2, SCREEN_W * SCREEN_H, f);
+ fclose(f);
+}
+static bool raw_now(int tick) { return raw_dir && tick >= raw_from && tick <= raw_to && tick % 3 == 0; }
static void parse_shots(const char *s) {
if (!strncmp(s, "every:", 6)) {
every = atoi(s + 6);
@@ -192,7 +207,8 @@ static bool robot_packet(int i) {
static void robot(void) {
if (B.phase != PH_PLAY) return;
- B.sun = 5000;
+ if ((int)B.ticks < sun_from) B.sun = 5000;
+ else if ((int)B.ticks == sun_from) B.sun = 325;
/* sun and coins: picked up */
board_collect(400, 300, 5000);
if (B.mode == MODE_WHACK) {
@@ -279,11 +295,10 @@ static int sim(int level, int frames, const char *out, bool quiet) {
robot_seeds(level);
B.phase = PH_PLAY;
cam_x = 0;
- int bg = B.env == ENV_NIGHT ? BG_NIGHT : B.env == ENV_POOL ? BG_POOL : B.env == ENV_FOG ? BG_FOG
- : B.env == ENV_ROOF ? BG_ROOF : BG_LAWN;
- gfx_load_back(bg, 88);
+ show_lawn(-1);
int t;
- int most = 0;
+ int most = 0, planted = B.nplants;
+ hud.col = -10;
for (t = 0; t < frames && B.phase == PH_PLAY; t++) {
robot();
board_tick();
@@ -298,15 +313,23 @@ static int sim(int level, int frames, const char *out, bool quiet) {
B.zombies[i].armor, B.zombies[i].flags);
printf("\n");
}
- if (shot_now(t)) {
+ if (B.nplants > planted) {
+ /* (the cursor where the robot planted last) */
+ hud.col = B.plants[B.nplants - 1].col, hud.row = B.plants[B.nplants - 1].row;
+ hud.selected = -1, hud.shovel = false;
+ }
+ planted = B.nplants;
+ if (shot_now(t) || raw_now(t)) {
gfx_begin();
draw_lawn(true);
- hud.col = -10;
- hud_draw(false);
+ hud_draw(raw_dir != NULL);
gfx_end();
- char p[512];
- snprintf(p, sizeof p, "%s/shot_%06d.ppm", out, t);
- host_shot(p);
+ if (raw_now(t)) raw_frame(t);
+ if (shot_now(t)) {
+ char p[512];
+ snprintf(p, sizeof p, "%s/shot_%06d.ppm", out, t);
+ host_shot(p);
+ }
}
}
const char *how = B.phase == PH_WON ? "won" : B.phase == PH_LOST ? "LOST" : "UNFINISHED";
@@ -332,6 +355,10 @@ int main(int argc, char **argv) {
else if (!strcmp(argv[i], "--progress") && i + 1 < argc) prog = atoi(argv[++i]);
else if (!strcmp(argv[i], "--money") && i + 1 < argc) money = atol(argv[++i]);
else if (!strcmp(argv[i], "--quiet")) quiet = true;
+ else if (!strcmp(argv[i], "--raw") && i + 1 < argc) raw_dir = argv[++i];
+ else if (!strcmp(argv[i], "--raw-from") && i + 1 < argc) raw_from = atoi(argv[++i]);
+ else if (!strcmp(argv[i], "--raw-to") && i + 1 < argc) raw_to = atoi(argv[++i]);
+ else if (!strcmp(argv[i], "--sun-from") && i + 1 < argc) sun_from = atoi(argv[++i]);
}
mkdir(out, 0755);
mkdir(saves, 0755);
@@ -351,7 +378,7 @@ int main(int argc, char **argv) {
}
game_init();
if (prog) {
- progress.level = (uint8_t)prog, progress.slots = 6;
+ progress.level = (uint8_t)prog, progress.slots = 6, progress.keys_seen = 1;
for (int l = 1; l < prog; l++) {
int r = level_defs[l - 1].reward;
if (r == REWARD_SHOVEL) progress.items |= ITEM_SHOVEL;
@@ -368,13 +395,15 @@ int main(int argc, char **argv) {
game_frame(host_keys);
host_time += 10;
if (t % 3 == 0 || shot_now(t)) game_draw();
+ if (raw_now(t)) raw_frame(t);
if (shot_now(t)) {
char p[512];
snprintf(p, sizeof p, "%s/shot_%06d.ppm", out, t);
host_shot(p);
}
}
- printf("state %d level %d phase %d sun %d zombies %d plants %d wave %d/%d\n", g_state, B.level, B.phase, (int)B.sun,
- B.nzombies, B.nplants, B.wave, B.nwaves);
+ printf("state %d level %d phase %d sun %d zombies %d plants %d wave %d/%d progress %d money %u slots %d items %d "
+ "running %d\n", g_state, B.level, B.phase, (int)B.sun, B.nzombies, B.nplants, B.wave, B.nwaves, progress.level,
+ (unsigned)progress.money, progress.slots, progress.items, g_running);
return 0;
}
diff --git a/tests/test_games.py b/tests/test_games.py
index 1b5ede7a..4530b755 100644
--- a/tests/test_games.py
+++ b/tests/test_games.py
@@ -171,6 +171,11 @@ GAMES = {
presses((1500, "ok"), (2200, "ok"), (2800, "ok"), (3400, "ok"), (3900, "left", 1200), (4200, "6", 900),
(5400, "up", 600)), 7000,
presses((1500, "ok"), (2200, "ok"), (2800, "right", 900), (3000, "8", 600)), 4500),
+ # past the keys, Adventure: the street, Ready Set Plant, a peashooter on the sod; Home keeps the level. Next
+ # time Continue, Back to Game, and the level goes on
+ "pvz": ("PlantsVsZombies.nwa", "pvzlevel.sav", presses((1500, "ok"), (2500, "ok"), (3500, "ok"), (12500, "1"),
+ (13000, "ok")), 16000,
+ presses((1500, "ok"), (2500, "ok"), (3500, "ok")), 9000),
# a level, its message, then play; then back to the level select
"portal": ("PortalReturns.nwa", "portal.sav",
presses((1500, "ok"), (2500, "ok"), (3500, "ok")) + every(4000, 7000, 400, "right", 300), 8000,
@@ -201,7 +206,7 @@ COPIES = {"championisland": "champion_saves.py", "numblocks": "numblocks_saves.p
"hollowknight": "hollowknight_saves.py", "finalearth2": "finalearth2_saves.py",
"numpowder": "numpowder_saves.py", "undertale": "undertale_saves.py", "subway": "subway_saves.py",
"fnaf": "fnaf_saves.py", "doom": "doom_saves.py", "isaac": "isaac_saves.py",
- "hillclimb": "hillclimb_saves.py"}
+ "hillclimb": "hillclimb_saves.py", "pvz": "pvz_saves.py"}
CHECKS = {
# the island remembers where Lucky was; after the reinstall, from the copy
"championisland": (lambda v: v[:3] == b"CI1" and b"PLAYER_LOC" in v,) * 2,
@@ -226,6 +231,10 @@ CHECKS = {
# the run kept ("ISR1", the frames played at 16); after the reinstall, from the copy, it goes on
"isaac": (lambda v: v[:4] == b"ISR1" and struct.unpack_from("<I", v, 16)[0] > 30,
lambda v: v[:4] == b"ISR1" and struct.unpack_from("<I", v, 16)[0] > 80),
+ # the level kept ("PVZL", level 1-1 at 8, its ticks at 16, a plant on it); after the reinstall, from the copy, it
+ # goes on
+ "pvz": (lambda v: v[:4] == b"PVZL" and v[8] == 1 and struct.unpack_from("<I", v, 16)[0] > 0,
+ lambda v: v[:4] == b"PVZL" and v[8] == 1 and struct.unpack_from("<I", v, 16)[0] > 500),
# a simulation saved ("NPWD"); after the reinstall, from the copy, it goes on and is saved again
"numpowder": (lambda v: v[:4] == b"NPWD",) * 2,
# a run banked ("HCR1", runs at 212) with a best on the Countryside (at 48); after the reinstall, from the copy,
diff --git a/tools/release.py b/tools/release.py
index b21c3f2e..334dcbb9 100644
--- a/tools/release.py
+++ b/tools/release.py
@@ -47,6 +47,8 @@ ALONE = {
"big to share the calculator with NumPlay: install it on its own"),
"isaac": ("The Binding of Isaac", "a whole run, from the Basement past Mom and her heart to Sheol and the Cathedral. "
"Too big to share the calculator with NumPlay: install it on its own"),
+ "pvz": ("Plants vs. Zombies", "the whole Adventure, Day to Roof and Dr. Zomboss: 50 levels, 48 plants, 26 zombies, "
+ "Crazy Dave, the Almanac and his shop. Too big to share the calculator with NumPlay: install it on its own"),
}
VARIANTS = [
("NumPlay-Invisible.nwa", "The same app, hidden: a blank icon with no name"),