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.

Kingdom Rush: Alleria's arrows and Magnus' bolts as their own classes fly; the device test reads save version 2

Mason3634b597205b87a
diff --git a/games/kingdomrush/src/hero.c b/games/kingdomrush/src/hero.c
index 2aaaf330..92042b23 100644
--- a/games/kingdomrush/src/hero.c
+++ b/games/kingdomrush/src/hero.c
@@ -428,16 +428,16 @@ static int shot_target(const Soldier *so, float w, float min_d, bool first, bool
return got;
}
-static void arrow(Soldier *so, int target, int dmg, bool multi) { /* Alleria's arrows (Arrow, ArrowAlleriaMultishoot) */
+static void arrow(Soldier *so, int target, int dmg, bool multi) { /* Alleria's arrows (§const§, ArrowAlleriaMultishoot) */
Enemy *e = EN(target);
Bullet *b = e ? bullet_new(BU_ARROW) : 0;
if (!b) return;
b->x0 = b->x = so->x, b->y0 = b->y = so->y - 12;
b->target = (int8_t)target;
b->level = 1, b->min_dmg = b->max_dmg = (int16_t)(dmg ? dmg : 1);
- b->t1 = multi ? (int16_t)rnd_round(12, 20) : 20;
+ b->t1 = multi ? (int16_t)rnd_round(12, 20) : 15;
float tx = e->x + enemy_stats[e->type].x_adj, ty = e->y + enemy_stats[e->type].y_adj;
- if (!e->blocked && !multi) tx += 0, ty += 0;
+ if (!e->blocked && !e->held) tx += e->xs * b->t1 + rnd() * 10, ty += e->ys * b->t1 + rnd() * 10 - 10; /* (where it will be) */
b->g = 1;
b->xs = (tx - b->x0) / b->t1, b->ys = (ty - b->y0 - b->g * b->t1 * b->t1 / 2) / b->t1;
}
@@ -461,7 +461,7 @@ static void bolt(float x, float y, int target, int dmg) { /* Magnus' (and his
Bullet *b = bullet_new(HB_BOLT);
if (!b) return;
b->x = x, b->y = y - 19;
- b->target = (int8_t)target, b->acc = 1, b->acc_max = 10, b->first = 1;
+ b->target = (int8_t)target, b->acc = 1, b->acc_max = 20, b->first = 1; /* (maxAceleration 20) */
b->min_dmg = b->max_dmg = (int16_t)dmg;
Enemy *e = EN(target);
if (e) b->tx = e->x + enemy_stats[e->type].x_adj, b->ty = e->y + enemy_stats[e->type].y_adj;
diff --git a/tests/test_games.py b/tests/test_games.py
index 119ccd66..6987e11a 100644
--- a/tests/test_games.py
+++ b/tests/test_games.py
@@ -734,10 +734,10 @@ CHECKS = {
# "CTN1", version 1: how to play read (flags at 5), in level 1 (the level at 9); after the reinstall, from the
# copy, back in it through the title map and on (level 1 or 2)
"catninja": (lambda v: catninja_ok(v) and v[5] & 1 and v[9] == 0, lambda v: catninja_ok(v) and v[5] & 1 and v[9] in (0, 1)),
- # "KRS", version 1, the check byte last: the goblin's notification read (seen_note at 48); after the reinstall,
- # from the copy, still read
- "kingdomrush": (lambda v: len(v) == 57 and v[:4] == b"KRS\1" and v[48] & 8,
- lambda v: len(v) == 57 and v[:4] == b"KRS\1" and v[48] & 8),
+ # "KRS", version 2 (the Hero Room's 2 bytes at the end), the check byte last: the goblin's notification read
+ # (seen_note at 48); after the reinstall, from the copy, still read
+ "kingdomrush": (lambda v: len(v) == 59 and v[:4] == b"KRS\2" and v[48] & 8,
+ lambda v: len(v) == 59 and v[:4] == b"KRS\2" and v[48] & 8),
# "MRB1", version 1, its size (1216): the first level's three stars (8), cleared (604), how to play read (1208);
# after the reinstall, from the copy, the same
"mrbullet": (lambda v: len(v) == 1216 and v[:4] == b"MRB1" and v[8] == 3 and v[604] == 1 and v[1208] == 1,) * 2,