From ba99a4cfec0e6e7d924852f2b951ed2f9c7ad8d3 Mon Sep 17 00:00:00 2001 From: hinomori_minori Date: Sat, 12 Sep 2026 13:44:15 +0900 Subject: [PATCH] =?UTF-8?q?=E7=81=B5=E6=84=9F=E5=86=8D=E6=AC=A1=E6=9E=AF?= =?UTF-8?q?=E7=AB=AD=EF=BC=8C=E6=88=91=E4=BC=91=E6=81=AF=E4=B8=80=E4=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/random.h | 3 ++- src/terrain.c | 14 ++++++++++++++ src/terrain.h | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/random.h b/src/random.h index 4ddd5d8..91c3dde 100644 --- a/src/random.h +++ b/src/random.h @@ -11,7 +11,8 @@ enum { PLATE_IS_OCEAN, PLATE_THICK, PLATE_SPEED_X, - PLATE_SPEED_Y + PLATE_SPEED_Y, + PLATE_AGE }; uint64_t game_hash(uint64_t seed,int type,int subtype); diff --git a/src/terrain.c b/src/terrain.c index a008da8..76684e1 100644 --- a/src/terrain.c +++ b/src/terrain.c @@ -109,6 +109,16 @@ static void plate_speed(struct Plate_list _i,uint64_t seed){ } } +static void plate_age(struct Plate_list _i,uint64_t seed){ + for(int i=0;i<_i.count;i++){ + if((_i._p+i)->is_ocean){ + (_i._p+i)->age=(double)game_hash(seed,PLATE_AGE,i)/UINT64_MAX*200; + }else{ + (_i._p+i)->age=200+(double)game_hash(seed,PLATE_AGE,i)/UINT64_MAX*3800; + } + } +} + struct Plate_list plate_init(uint64_t seed,struct World_Block *block){ int count = plate_count(seed); struct Plate_list list; @@ -117,5 +127,9 @@ struct Plate_list plate_init(uint64_t seed,struct World_Block *block){ plate_seed(list,seed); lloyd_init(block,list); lloyd_iterate(block,list,2); + plate_is_ocean(list,seed); + plate_thick(list,seed); + plate_speed(list,seed); + plate_age(list,seed); return list; } \ No newline at end of file diff --git a/src/terrain.h b/src/terrain.h index 5023f44..367167a 100644 --- a/src/terrain.h +++ b/src/terrain.h @@ -38,7 +38,6 @@ struct Plate { bool is_ocean; double thick; unsigned long age; - int rock_type; int world_block_count; }; @@ -50,6 +49,11 @@ struct Plate_list { struct World_Block { int plate_id; double nearest_plate_dist; + int north_plate_id; + int south_plate_id; + int west_plate_id; + int east_plate_id; + }; struct World {