… | |
… | |
403 | else if (op->map->darkness > 0) // outdoor and darkness > 0 => use darkness as max radius |
403 | else if (op->map->darkness > 0) // outdoor and darkness > 0 => use darkness as max radius |
404 | light = lerp_rd (maptile::outdoor_darkness + 0, 0, MAX_DARKNESS, MAX_DARKNESS - op->map->darkness, 0); |
404 | light = lerp_rd (maptile::outdoor_darkness + 0, 0, MAX_DARKNESS, MAX_DARKNESS - op->map->darkness, 0); |
405 | else // outdoor and darkness <= 0 => start wide and decrease quickly |
405 | else // outdoor and darkness <= 0 => start wide and decrease quickly |
406 | light = lerp (maptile::outdoor_darkness + op->map->darkness, 0, MAX_DARKNESS, MAX_VISION, 2); |
406 | light = lerp (maptile::outdoor_darkness + op->map->darkness, 0, MAX_DARKNESS, MAX_VISION, 2); |
407 | |
407 | |
408 | light = clamp (light, 0, MAX_VISION); |
408 | light = clamp (light + bonus, 0, MAX_VISION); |
409 | |
409 | |
410 | apply_light<los_brighten> (pl, 0, 0, light, vision_atten [light]); |
410 | apply_light<los_brighten> (pl, 0, 0, light, vision_atten [light]); |
411 | } |
411 | } |
412 | } |
412 | } |
413 | |
413 | |