Example #1
0
def draw_splatter(position, render_at):
	_has_splatter = has_splatter(position)
	
	if not _has_splatter:
		return False
	
	gfx.tint_tile(render_at[0],render_at[1],_has_splatter['color'],_has_splatter['coef'])
Example #2
0
def draw_vapor(pos, vapor):
    gfx.tint_tile(
        pos[0], pos[1], vapor['color'],
        bad_numbers.clip(
            vapor['max_intensity'] *
            (1 - (vapor['age'] / float(vapor['age_max']))), 0,
            vapor['max_intensity']))
Example #3
0
def rain(size):
    _running_time = WORLD_INFO['real_time_of_day'] - WORLD_INFO[
        'real_time_of_day'] / (WORLD_INFO['length_of_day'] /
                               len(WORLD_INFO['weather']['colors'])) * (
                                   WORLD_INFO['length_of_day'] /
                                   len(WORLD_INFO['weather']['colors']))

    _rate = .009

    for i in range(0, int(round(_running_time * _rate))):
        _x = random.randint(0, size[0] - 1)
        _y = random.randint(0, size[1] - 1)
        _skip = False

        if not alife.sight.is_in_fov(LIFE[SETTINGS['controlling']],
                                     (CAMERA_POS[0] + _x, CAMERA_POS[1] + _y)):
            continue

        for z in range(LIFE[SETTINGS['controlling']]['pos'][2] + 1,
                       MAP_SIZE[2]):
            if maps.is_solid((CAMERA_POS[0] + _x, CAMERA_POS[1] + _y, z)):
                _skip = True
                break

        if _skip:
            continue

        REFRESH_POSITIONS.append((_x, _y))

        gfx.tint_tile(_x, _y, tcod.blue, random.uniform(0.1, 0.6))

    #"Wind"
    if logic.can_tick():
        for i in range(random.randint(1, 4)):
            _x = random.randint(0, size[0] - 1)
            _y = random.randint(0, size[1] - 1)
            _skip = False

            if not alife.sight.is_in_fov(
                    LIFE[SETTINGS['controlling']],
                (CAMERA_POS[0] + _x, CAMERA_POS[1] + _y)):
                continue

            for z in range(LIFE[SETTINGS['controlling']]['pos'][2] + 1,
                           MAP_SIZE[2]):
                if maps.is_solid((CAMERA_POS[0] + _x, CAMERA_POS[1] + _y, z)):
                    _skip = True
                    break

            if _skip:
                continue

            effects.create_smoke((CAMERA_POS[0] + _x, CAMERA_POS[1] + _y),
                                 color=tcod.white,
                                 grow=0.1,
                                 decay=0.03,
                                 direction=195,
                                 speed=random.uniform(0.35, 0.8),
                                 max_opacity=.3)
Example #4
0
def draw_splatter(position, render_at):
    _has_splatter = has_splatter(position)

    if not _has_splatter:
        return False

    gfx.tint_tile(render_at[0], render_at[1], _has_splatter['color'],
                  _has_splatter['coef'])
Example #5
0
def rain(size):
	_running_time = WORLD_INFO['real_time_of_day'] - WORLD_INFO['real_time_of_day']/(WORLD_INFO['length_of_day']/len(WORLD_INFO['weather']['colors']))*(WORLD_INFO['length_of_day']/len(WORLD_INFO['weather']['colors']))
	
	_rate = .009
	
	for i in range(0, int(round(_running_time*_rate))):
		_x = random.randint(0, size[0]-1)
		_y = random.randint(0, size[1]-1)
		_skip = False
		
		if not alife.sight.is_in_fov(LIFE[SETTINGS['controlling']], (CAMERA_POS[0]+_x, CAMERA_POS[1]+_y)):
			continue
		
		for z in range(LIFE[SETTINGS['controlling']]['pos'][2]+1, MAP_SIZE[2]):
			if maps.is_solid((CAMERA_POS[0]+_x, CAMERA_POS[1]+_y, z)):
				_skip = True
				break
		
		if _skip:
			continue
		
		REFRESH_POSITIONS.append((_x, _y))
		
		gfx.tint_tile(_x, _y, tcod.blue, random.uniform(0.1, 0.6))
	
	#"Wind"
	if logic.can_tick():
		for i in range(random.randint(1, 4)):
			_x = random.randint(0, size[0]-1)
			_y = random.randint(0, size[1]-1)
			_skip = False
			
			if not alife.sight.is_in_fov(LIFE[SETTINGS['controlling']], (CAMERA_POS[0]+_x, CAMERA_POS[1]+_y)):
				continue
			
			for z in range(LIFE[SETTINGS['controlling']]['pos'][2]+1, MAP_SIZE[2]):
				if maps.is_solid((CAMERA_POS[0]+_x, CAMERA_POS[1]+_y, z)):
					_skip = True
					break
		
			if _skip:
				continue
			
			effects.create_smoke((CAMERA_POS[0]+_x, CAMERA_POS[1]+_y), color=tcod.white, grow=0.1, decay=0.03, direction=195, speed=random.uniform(0.35, 0.8), max_opacity=.3)
Example #6
0
def draw_fire(pos, fire):
    _intensity = fire['intensity'] / float(8)
    _rand_intensity = bad_numbers.clip(_intensity - random.uniform(0, .2), 0,
                                       1)

    gfx.tint_tile(pos[0], pos[1], fire['color'], _rand_intensity)
Example #7
0
def draw_smoke(pos, smoke):
    gfx.tint_tile(
        pos[0], pos[1], smoke['color'],
        bad_numbers.clip(smoke['intensity'], 0, smoke['max_intensity']))
Example #8
0
def draw_ash(pos, ash):
    gfx.tint_tile(pos[0], pos[1], ash['color'], ash['intensity'])
Example #9
0
def draw_fire(pos, fire):
	_intensity = fire['intensity']/float(8)
	_rand_intensity = numbers.clip(_intensity-random.uniform(0, .2), 0, 1)
	
	gfx.tint_tile(pos[0], pos[1], fire['color'], _rand_intensity)
Example #10
0
def draw_vapor(pos, vapor):
	gfx.tint_tile(pos[0], pos[1], vapor['color'], numbers.clip(vapor['max_intensity']*(1-(vapor['age']/float(vapor['age_max']))), 0, vapor['max_intensity']))
Example #11
0
def draw_smoke(pos, smoke):
	gfx.tint_tile(pos[0], pos[1], smoke['color'], numbers.clip(smoke['intensity'], 0, smoke['max_intensity']))
Example #12
0
def draw_ash(pos, ash):
	gfx.tint_tile(pos[0], pos[1], ash['color'], ash['intensity'])