tweaking balance a bit

This commit is contained in:
Tenari
2026-04-03 08:40:19 -05:00
parent e1e602ff1c
commit cf1522d303
3 changed files with 22 additions and 5 deletions
+4
View File
@@ -1094,6 +1094,10 @@ fn bool updateAndRender(TuiState* tui, void* s, u8* input_buffer, u64 loop_count
}
renderStrToBuffer(tui->frame_buffer, x_off, y_off++, sbuf, screen_dimensions);
MemoryZero(sbuf, SBUFLEN);
sprintf(sbuf, "(%d, %d)", state->pos.x, state->pos.y);
renderStrToBuffer(tui->frame_buffer, x_off, y_off++, sbuf, screen_dimensions);
if (user_pressed_enter) {
for (u32 i = 0; i < STAR_SYSTEM_COUNT; i++) {
if (state->pos.x == state->map[i].x && state->pos.y == state->map[i].y) {
+16 -3
View File
@@ -1467,12 +1467,25 @@ i32 main(i32 argc, ptr argv[]) {
// GAME LOGIC SETUP
// set position of all star systems
state.map[0].x = 3;
state.map[0].y = 4;
state.map[1].x = 13;
state.map[1].y = 2;
state.map[2].x = 22;
state.map[2].y = 3;
state.map[3].x = 25;
state.map[3].y = 8;
state.map[4].x = 17;
state.map[4].y = 9;
state.map[5].x = 6;
state.map[5].y = 7;
for (u32 i = 0; i < STAR_SYSTEM_COUNT; i++) {
state.map[i].idx = i;
state.map[i].name = STAR_NAMES[i];
state.map[i].crime = rand() % 100;
state.map[i].x = rand() % MAP_WIDTH;
state.map[i].y = rand() % MAP_HEIGHT;
if (state.map[i].x == 0 && state.map[i].y == 0) {
state.map[i].x = rand() % MAP_WIDTH;
state.map[i].y = rand() % MAP_HEIGHT;
}
// ensure all the star systems are "spaced out" a bit
bool conflicting_pos = false;
for (u32 ii = 0; ii < i; ii++) {
+2 -2
View File
@@ -71,7 +71,7 @@ global ShipTemplate SHIPS[] = {
.vacuum_cargo_slots = 30, .climate_cargo_slots = 0, .passenger_berths = 0,
.passenger_amenities_flags = 0,
.smugglers_hold_cu_m = 0, .base_cost = 275000,
.cu_m_fuel = 2500, .cu_m_o2 = 800,
.cu_m_fuel = 2500, .cu_m_o2 = 700,
},
{
.type = ShipNX400, .drive_efficiency = 6, .life_support_efficiency = 5,
@@ -434,7 +434,7 @@ static const char* MESSAGE_STRINGS[] = {
fn u32 fuelCostForTravel(u32 drive_efficiency, Pos2 current, Pos2 dest) {
u32 x_distance = Max(current.x, dest.x) - Min(current.x, dest.x);
u32 y_distance = Max(current.y, dest.y) - Min(current.y, dest.y);
u32 fuel_per_dist = 100 - drive_efficiency*5;
u32 fuel_per_dist = 100 - drive_efficiency*6;
return (x_distance + y_distance) * fuel_per_dist;
}