forked from tas/major_tom
Add jetpack fuel pickup and slow base recharge to 30s
Jetpack charges now take 30s to passively recharge (up from 3s), making fuel management a core gameplay loop. A new fuel canister powerup (POWERUP_FUEL) restores exactly one charge on pickup. The existing jetpack powerup remains as the rare full-refill + 15s boost. Fuel pickups replace most procedural jetpack spawns at higher spawn rates to compensate for the weaker per-pickup value. Fuel canisters also appear in corridors and arenas. Adds orange canister pixel art, editor icon, entity registry entry, and places fuel pickups throughout moon01.
This commit is contained in:
@@ -273,11 +273,11 @@ static void gen_platforms(Tilemap *map, int x0, int w, int ground_row,
|
||||
}
|
||||
}
|
||||
|
||||
/* Jetpack refill on a high platform — reward for climbing */
|
||||
if (rng_float() < 0.3f) {
|
||||
/* Fuel pickup on a high platform — reward for climbing */
|
||||
if (rng_float() < 0.45f) {
|
||||
int top_py = ground_row - 3 - (num_plats - 1) * 3;
|
||||
if (top_py >= ceil_row) {
|
||||
add_entity(map, "powerup_jet", x0 + rng_range(2, w - 3), top_py - 1);
|
||||
add_entity(map, "powerup_fuel", x0 + rng_range(2, w - 3), top_py - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -340,6 +340,11 @@ static void gen_corridor(Tilemap *map, int x0, int w, int ground_row,
|
||||
if (difficulty > 0.3f && rng_float() < 0.35f) {
|
||||
add_entity(map, "powerup_hp", x0 + w - 3, ground_row - 1);
|
||||
}
|
||||
|
||||
/* Fuel pickup hidden in the corridor */
|
||||
if (rng_float() < 0.3f) {
|
||||
add_entity(map, "powerup_fuel", x0 + rng_range(2, w - 3), ceil_row + 2);
|
||||
}
|
||||
}
|
||||
|
||||
/* SEG_ARENA: wide open area, multiple enemies */
|
||||
@@ -405,6 +410,8 @@ static void gen_arena(Tilemap *map, int x0, int w, int ground_row,
|
||||
if (rng_float() < 0.5f) {
|
||||
if (difficulty > 0.6f && rng_float() < 0.25f) {
|
||||
add_entity(map, "powerup_drone", cp_x + 2, cp_y - 1);
|
||||
} else if (rng_float() < 0.35f) {
|
||||
add_entity(map, "powerup_fuel", cp_x + 2, cp_y - 1);
|
||||
} else {
|
||||
add_entity(map, "powerup_hp", cp_x + 2, cp_y - 1);
|
||||
}
|
||||
@@ -482,9 +489,9 @@ static void gen_shaft(Tilemap *map, int x0, int w, int ground_row,
|
||||
}
|
||||
}
|
||||
|
||||
/* Jetpack refill near the top — reward for climbing */
|
||||
if (rng_float() < 0.4f) {
|
||||
add_entity(map, "powerup_jet", x0 + w / 2, ceil_row + 3);
|
||||
/* Fuel pickup near the top — reward for climbing */
|
||||
if (rng_float() < 0.5f) {
|
||||
add_entity(map, "powerup_fuel", x0 + w / 2, ceil_row + 3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,10 +731,10 @@ static void gen_climb(Tilemap *map, int x0, int w,
|
||||
}
|
||||
}
|
||||
|
||||
/* Powerup midway through the climb */
|
||||
if (rng_float() < 0.4f) {
|
||||
/* Fuel pickup midway through the climb */
|
||||
if (rng_float() < 0.5f) {
|
||||
int mid_y = (top_ground + bot_ground) / 2;
|
||||
add_entity(map, "powerup_jet", (shaft_left + shaft_right) / 2, mid_y - 2);
|
||||
add_entity(map, "powerup_fuel", (shaft_left + shaft_right) / 2, mid_y - 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1381,9 +1388,9 @@ static void gen_station_vent(Tilemap *map, int x0, int w, float difficulty) {
|
||||
add_entity(map, "grunt", x0 + rng_range(2, w - 3), STATION_FLOOR_ROW - 1);
|
||||
}
|
||||
|
||||
/* Jetpack refill reward (useful in low gravity) */
|
||||
if (rng_float() < 0.35f) {
|
||||
add_entity(map, "powerup_jet", x0 + rng_range(2, w - 3), vent_ceil + 1);
|
||||
/* Fuel pickup reward (useful in low gravity) */
|
||||
if (rng_float() < 0.4f) {
|
||||
add_entity(map, "powerup_fuel", x0 + rng_range(2, w - 3), vent_ceil + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user