nerfed coin/ore spawning rate by 10%

This commit is contained in:
Alexandre 2024-07-17 23:18:55 +02:00
parent 0a874da94d
commit a96ed3b1bd
5 changed files with 12 additions and 4 deletions

BIN
a.out

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -37,9 +37,14 @@ let coin_magnet_dist = 1. ;;
(* -------------------------------------------------------------------------------------------------------- *)
let structure_1_frequency = 2500 ;;
(* avg number of chunk generation required before encountering a structure of type 1 *)
let structure_1_frequency = 2500 ;;
(* 0 ~ 1000 *)
let oreMissChance = 50 ;;
(* avg number of chunk generation required before encountering a structure of type 2 *)
(* NOTE : structure 2 attempts to spawn after structure 1, so the odds will be ever so slightly less than this number *)
let structure_2_frequency = 2500 ;;
(* -------------------------------------------------------------------------------------------------------- *)
@ -1242,7 +1247,8 @@ let generate_structure_1 hash mem ch_x ch_y ch_z =
for i = 0 to chunk_size -1 do
for j = 0 to chunk_size -1 do
for k = 0 to chunk_size -1 do
dyn_append filled {flag = "10" ; cube = create_cube (chx*chunk_size+i) (chy*chunk_size+j) (chz*chunk_size+k) 1; red = 250; green = 250; blue = 64};
if (Random.int 1000 >= oreMissChance) then
dyn_append filled {flag = "10" ; cube = create_cube (chx*chunk_size+i) (chy*chunk_size+j) (chz*chunk_size+k) 1; red = 250; green = 250; blue = 64};
done
done
done;
@ -1353,8 +1359,10 @@ let generate_structure_2 hash mem ch_x ch_y ch_z =
for i = 0 to chunk_size -1 do
for j = 0 to chunk_size -1 do
for k = 0 to chunk_size -1 do
let (cOre, cColors) = generate_random_ore () in
dyn_append filled {flag = cOre ; cube = create_cube (chx*chunk_size+i) (chy*chunk_size+j) (chz*chunk_size+k) 1; red = cColors.(0); green = cColors.(1); blue = cColors.(2)};
if (Random.int 1000 >= oreMissChance) then begin
let (cOre, cColors) = generate_random_ore () in
dyn_append filled {flag = cOre ; cube = create_cube (chx*chunk_size+i) (chy*chunk_size+j) (chz*chunk_size+k) 1; red = cColors.(0); green = cColors.(1); blue = cColors.(2)};
end
done
done
done;

BIN
display.o

Binary file not shown.