forked from townforge/townforge
more intricate shoreline
This commit is contained in:
parent
48870f3d1d
commit
636d8b7a84
@ -116,7 +116,7 @@ static const fixed_t ZERO_DOT_FOUR = fixed_t(4) / fixed_t(10);
|
||||
static const fixed_t ZERO_DOT_SEVEN = fixed_t(7) / fixed_t(10);
|
||||
static const fixed_t ZERO_DOT_NINE = fixed_t(9) / fixed_t(10);
|
||||
static const fixed_t ZERO_DOT_EIGHT = fixed_t(8) / fixed_t(10);
|
||||
static const fixed_t ZERO_DOT_SEVENTY_NINE = fixed_t(79) / fixed_t(100);
|
||||
static const fixed_t ZERO_DOT_SEVEN_NINE_FIVE = fixed_t(795) / fixed_t(1000);
|
||||
static const fixed_t ZERO_DOT_FORTYFIVE = fixed_t(45) / fixed_t(100);
|
||||
static const fixed_t ONE_DOT_TWO = fixed_t(12) / fixed_t(10);
|
||||
static const fixed_t ONE_DOT_SEVEN = fixed_t(17) / fixed_t(10);
|
||||
@ -1136,7 +1136,7 @@ static const std::shared_ptr<terrain_tile_t> require_terrain(const cc::cc_potent
|
||||
const fixed_t term2_bounding = ONE_DOT_TWO / THREE;
|
||||
static const uint32_t base_zoom = -1;
|
||||
static const fixed_t base_scale = QUARTER;
|
||||
static const fixed_t hills_scale = ZERO_DOT_SEVENTY_NINE;
|
||||
static const fixed_t hills_scale = ZERO_DOT_SEVEN_NINE_FIVE;
|
||||
static const struct { fixed_t dx; fixed_t dy; int32_t zoom; fixed_t scale; } layers[12] = {
|
||||
{ZERO, ZERO, 3, fixed_t(18) / fixed_t(100)},
|
||||
{fixed_t(739), fixed_t(329), 0, fixed_t(14) / fixed_t(100) * base_scale},
|
||||
@ -1153,7 +1153,7 @@ static const std::shared_ptr<terrain_tile_t> require_terrain(const cc::cc_potent
|
||||
{fixed_t(233), fixed_t(-28), -1, fixed_t(7) / fixed_t(100) * base_scale},
|
||||
{fixed_t(-43), fixed_t(13), -2, fixed_t(5) / fixed_t(100) * base_scale},
|
||||
};
|
||||
static const fixed_t water_offset = ZERO_DOT_SEVEN;
|
||||
static const fixed_t water_offset = fixed_t(57) / fixed_t(100);
|
||||
static const fixed_t water_angle = fixed_t::PI * HALF;
|
||||
static const fixed_t water_width = ZERO_DOT_ZERO_FIVE;
|
||||
for (uint32_t y = y0; y <= y1 + 1; y += HILLS_STEP, Y += FIXED_HILLS_STEP)
|
||||
@ -1186,10 +1186,17 @@ static const std::shared_ptr<terrain_tile_t> require_terrain(const cc::cc_potent
|
||||
*hill_ptr++ = p_hills;
|
||||
|
||||
// shoreline
|
||||
const fixed_t wX = X - fixed_t(13632), wY = Y + fixed_t(1792);
|
||||
fixed_t wX = X - fixed_t(13632), wY = Y + fixed_t(1792);
|
||||
const fixed_t x2 = wX * ZERO_DOT_FIFTEEN;
|
||||
const fixed_t y2 = wY * ZERO_DOT_FIFTEEN;
|
||||
const fixed_t x3 = wX * ZERO_DOT_ZERO_FIVE * HALF;
|
||||
const fixed_t y3 = wY * ZERO_DOT_ZERO_FIVE * HALF;
|
||||
wX += SingleCubic(state, 0, x2, y2) * fixed_t(20) + SingleCubic(state, 2, x3, y3) * fixed_t(4) * (HALF + ONE + y3.sin());
|
||||
wY += SingleCubic(state, 1, x2, y2) * fixed_t(20) + SingleCubic(state, 3, x3, y3) * fixed_t(4) * (HALF + ONE + x3.sin());
|
||||
|
||||
fixed_t water = Gradient(state, water_offset, wX.right_shift(8), wY.right_shift(8), water_width, water_angle);
|
||||
fixed_t extra_water = SingleCubic(state, 0, wX.right_shift(10), wY.right_shift(10) - HALF) * ZERO_DOT_THREE;
|
||||
extra_water = blend_add(extra_water, SingleCubic(state, 0, wX.right_shift(11), wY.right_shift(11)) * ZERO_DOT_THREE);
|
||||
fixed_t extra_water = SingleCubic(state, 0, wX.right_shift(10), wY.right_shift(10) - HALF) * ZERO_DOT_TWO;
|
||||
extra_water = blend_add(extra_water, SingleCubic(state, 0, wX.right_shift(11), wY.right_shift(11)) * ZERO_DOT_TWO);
|
||||
if (extra_water > ZERO)
|
||||
water += extra_water;
|
||||
int32_t p_water = water.left_shift(16).get_int32_t();
|
||||
|
@ -4598,8 +4598,8 @@ class CCTest():
|
||||
# build a fishery, needs to be partway in water
|
||||
res = self.wallet[2].cc_buy_items(entries = [{'type': ITEM_STONE, 'amount': 1843}, {'type': ITEM_WOOD, 'amount': 30720 + 500}, {'type': ITEM_LABOUR, 'amount': 137624}])
|
||||
self.generate_blocks('TF1MM8HqWBathu8hS5mwMNHm1da3cZCzg2rkqWLKCxpUarKtPszP3MjiocrJeLvph4AghgYu1AXonCmckfEuyE8Q2FFm8jNdiz3', 1)
|
||||
res = daemon.cc_get_new_flag_cost(0, FIRST_CITY_X - 1200, FIRST_CITY_Y - 3380, FIRST_CITY_X - 1200 + 128 - 1, FIRST_CITY_Y - 3380 + 48 - 1)
|
||||
res = self.wallet[2].cc_buy_land(FIRST_CITY_X - 1200, FIRST_CITY_Y - 3380, FIRST_CITY_X - 1200 + 128 - 1, FIRST_CITY_Y - 3380 + 48 - 1)
|
||||
res = daemon.cc_get_new_flag_cost(0, FIRST_CITY_X - 1100, FIRST_CITY_Y - 3170, FIRST_CITY_X - 1100 + 128 - 1, FIRST_CITY_Y - 3170 + 48 - 1)
|
||||
res = self.wallet[2].cc_buy_land(FIRST_CITY_X - 1100, FIRST_CITY_Y - 3170, FIRST_CITY_X - 1100 + 128 - 1, FIRST_CITY_Y - 3170 + 48 - 1)
|
||||
self.generate_blocks('TF1MM8HqWBathu8hS5mwMNHm1da3cZCzg2rkqWLKCxpUarKtPszP3MjiocrJeLvph4AghgYu1AXonCmckfEuyE8Q2FFm8jNdiz3', 1)
|
||||
res = daemon.cc_get_account(account_id)
|
||||
assert 'flags' in res and len(res.flags) > 0
|
||||
@ -4700,8 +4700,8 @@ class CCTest():
|
||||
# fisheries stand in for farms for influence need
|
||||
res = self.wallet[2].cc_buy_items(entries = [{'type': ITEM_STONE, 'amount': 3072}, {'type': ITEM_WOOD, 'amount': 8192}, {'type': ITEM_LABOUR, 'amount': 57344}])
|
||||
self.generate_blocks('TF1MM8HqWBathu8hS5mwMNHm1da3cZCzg2rkqWLKCxpUarKtPszP3MjiocrJeLvph4AghgYu1AXonCmckfEuyE8Q2FFm8jNdiz3', 1)
|
||||
res = daemon.cc_get_new_flag_cost(0, FIRST_CITY_X - 1400, FIRST_CITY_Y - 3250, FIRST_CITY_X - 1400 + 32 - 1, FIRST_CITY_Y - 3250 + 32 - 1)
|
||||
res = self.wallet[2].cc_buy_land(FIRST_CITY_X - 1400, FIRST_CITY_Y - 3250, FIRST_CITY_X - 1400 + 32 - 1, FIRST_CITY_Y - 3250 + 32 - 1)
|
||||
res = daemon.cc_get_new_flag_cost(0, FIRST_CITY_X - 1100, FIRST_CITY_Y - 3030, FIRST_CITY_X - 1100 + 32 - 1, FIRST_CITY_Y - 3030 + 32 - 1)
|
||||
res = self.wallet[2].cc_buy_land(FIRST_CITY_X - 1100, FIRST_CITY_Y - 3030, FIRST_CITY_X - 1100 + 32 - 1, FIRST_CITY_Y - 3030 + 32 - 1)
|
||||
self.generate_blocks('TF1MM8HqWBathu8hS5mwMNHm1da3cZCzg2rkqWLKCxpUarKtPszP3MjiocrJeLvph4AghgYu1AXonCmckfEuyE8Q2FFm8jNdiz3', 1)
|
||||
res = daemon.cc_get_account(account_id)
|
||||
assert 'flags' in res and len(res.flags) > 0
|
||||
|
Loading…
Reference in New Issue
Block a user