def apply_cell(self, mapblock, rx, ry, hf, tf): # convert our hf to a hex. # dragon_scripts.groups.get_group_list() # funny group = select_tile_linear([2, 5] + [ 0, ] * 15 + [1, 1, 0xa, 0xa], hf) alt = int(hf * 10) # grass + forest tileg = dragon_scripts.groups.get_by_groupalt(group, alt) if tileg is None: mapblock.tiles[rx, ry] = 0x2 mapblock.heights[rx, ry] = 0 else: mapblock.tiles[rx, ry] = select_tile(tileg.tiles, tf) mapblock.heights[rx, ry] = tileg.alt
def layout_type(self, brx, bry): # this generates our layout types. cx, cy = int(brx / 8), int(bry / 8) return select_tile_linear([ # waterland [ (0.0, 0.9, DeepSea()), (0.9, 0.95, ShallowSea()), (0.95, 1.1, Coastal()), ], # green lands [ (0.0, 0.02, DeepSea()), (0.02, 0.05, ShallowSea()), (0.05, 0.15, Coastal()), (0.15, 1.1, GrassLand()), ], # murky green lands [ (0.00, 0.02, ShallowSea()), (0.02, 0.04, Coastal()), (0.04, 0.7, MurkyGrassLand()), (0.7, 1.1, GrassLand()), ], [ (0.0, 0.4, GrassLand()), (0.4, 1.1, Forest()), ], [ (0.0, 0.4, GrassLand()), (0.4, 1.1, Forest()), ], # rocky lands [ (0.0, 0.4, GrassLand(10)), (0.4, 0.9, Rocks(10)), (0.9, 0.95, Mountains(10)), (0.95, 1.1, Mountains(20)), ], # highlands [ (0.0, 0.3, Rocks(10)), (0.3, 0.4, HighLands(10)), (0.4, 0.6, Mountains(35)), (0.6, 0.9, Mountains(40)), (0.9, 1.1, Mountains(50)), ], ], self.noise[cx, cy])