Hey it almost works

This commit is contained in:
Pieter-Jan Briers
2017-02-04 01:00:12 +01:00
parent d0a574ff21
commit aeb057579e
23 changed files with 68 additions and 78 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

+4 -4
View File
@@ -14,10 +14,10 @@
#define LIGHTING_BASE_MATRIX \
list \
( \
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \
1-LIGHTING_SOFT_THRESHOLD, 1-LIGHTING_SOFT_THRESHOLD, 1-LIGHTING_SOFT_THRESHOLD, 0, \
1-LIGHTING_SOFT_THRESHOLD, 1-LIGHTING_SOFT_THRESHOLD, 1-LIGHTING_SOFT_THRESHOLD, 0, \
1-LIGHTING_SOFT_THRESHOLD, 1-LIGHTING_SOFT_THRESHOLD, 1-LIGHTING_SOFT_THRESHOLD, 0, \
1-LIGHTING_SOFT_THRESHOLD, 1-LIGHTING_SOFT_THRESHOLD, 1-LIGHTING_SOFT_THRESHOLD, 0, \
0, 0, 0, 1 \
) \
+8 -3
View File
@@ -22,7 +22,12 @@
/obj/screen/plane_master/lighting
name = "lighting plane master"
plane = LIGHTING_PLANE
blend_mode = BLEND_OVERLAY
// blend_mode = BLEND_MULTIPLY
// color = list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,0, 0.1,0.1,0.1,0)
blend_mode = BLEND_MULTIPLY
color = list(
-1, 0, 0, 0,
0, -1, 0, 0,
0, 0, -1, 0,
0, 0, 0, 0,
1, 1, 1, 1
)
mouse_opacity = 0
@@ -91,9 +91,7 @@
/obj/effect/clockwork/sigil/submission/New()
..()
#warn what to do with falloff.
//SetLuminosity(glow_light,glow_falloff)
set_light(glow_light)
set_light(glow_light, glow_falloff/10)
/obj/effect/clockwork/sigil/submission/proc/post_channel(mob/living/L)
@@ -258,9 +256,7 @@
if(!power_charge)
set_light(0)
else
#warn what to do with falloff
//SetLuminosity(round(alpha*0.03, 1), round(alpha*0.02, 1))
set_light(round(alpha*0.03, 1))
set_light(round(alpha*0.03, 1), round(alpha*0.002, 1))
//Vitality Matrix: Drains health from non-servants to heal or even revive servants.
/obj/effect/clockwork/sigil/vitality
@@ -158,9 +158,7 @@
/obj/effect/clockwork/judicial_marker/New(loc, caster)
..()
#warn falloff?
//SetLuminosity(4, 3)
set_light(4)
set_light(4, 0.3)
user = caster
addtimer(CALLBACK(src, .proc/judicialblast), 0)
+2 -6
View File
@@ -80,9 +80,7 @@
/mob/living/simple_animal/hostile/clockwork/fragment/New()
..()
#warn falloff?
//SetLuminosity(2,1)
set_light(2)
set_light(2, 0.1)
if(prob(1))
name = "anime fragment"
real_name = name
@@ -161,9 +159,7 @@
..()
combattimer = 0
true_name = pick(possible_true_names)
#warn falloff?
//SetLuminosity(2,1)
set_light(2)
set_light(2, 0.1)
/mob/living/simple_animal/hostile/clockwork/marauder/Life()
..()
@@ -26,9 +26,7 @@
/obj/structure/destructible/clockwork/powered/interdiction_lens/toggle(fast_process, mob/living/user)
. = ..()
if(active)
#warn falloff?
//SetLuminosity(4, 2)
set_light(4)
set_light(4, 0.2)
else
set_light(0)
@@ -48,9 +46,7 @@
recharging = world.time + recharge_time
flick("interdiction_lens_discharged", src)
icon_state = "interdiction_lens_inactive"
#warn falloff?
//SetLuminosity(2,1)
set_light(2)
set_light(2, 0.1)
disabled = TRUE
return TRUE
@@ -53,9 +53,7 @@
/obj/structure/destructible/clockwork/powered/mania_motor/toggle(fast_process, mob/living/user)
. = ..()
if(active)
#warn falloff?
//SetLuminosity(2, 1)
set_light(2)
set_light(2, 0.1)
else
set_light(0)
@@ -18,9 +18,7 @@
START_PROCESSING(SSobj, src)
clockwork_caches++
update_slab_info()
#warn falloff?
//SetLuminosity(2,1)
set_light(2)
set_light(2, 0.1)
/obj/structure/destructible/clockwork/cache/Destroy()
clockwork_caches--
@@ -120,9 +120,7 @@
component_glow.color = component_color
add_overlay(component_glow)
production_time = world.time + production_cooldown //don't immediately produce when turned on after being off
#warn falloff?
//SetLuminosity(2, 1)
set_light(2)
set_light(2, 0.1)
else
cut_overlays()
set_light(0)
+9 -3
View File
@@ -212,7 +212,6 @@
var/area/old = get_area(get_turf(creator))
var/old_gravity = old.has_gravity
#warn TODO: doesn't change_area, probably fucked. Double check this. Damnit TG!
var/area/A
for(var/key in turfs)
if(key == str)
@@ -221,13 +220,20 @@
turfs -= turfs[key]
turfs -= key
if(A)
A.contents += turfs
A.set_dynamic_lighting()
for (var/turf/T in turfs)
var/area/old_area = T.loc
A.contents += T
T.change_area(old_area, T)
else
A = new
A.setup(str)
A.contents += turfs
A.set_dynamic_lighting()
for (var/turf/T in turfs)
var/area/old_area = T.loc
A.contents += T
T.change_area(old_area, T)
A.has_gravity = old_gravity
creator << "<span class='notice'>You have created a new area, named [str]. It is now weather proof, and constructing an APC will allow it to be powered.</span>"
return 1
@@ -82,9 +82,7 @@
icon_state = "basalt[rand(0, 12)]"
switch(icon_state)
if("basalt1", "basalt2", "basalt3")
#warn ???
//SetLuminosity(1, 1)
set_light(1)
set_light(1, 0.1)
/turf/open/floor/carpet
name = "carpet"
@@ -121,9 +121,7 @@
..()
switch(icon_state)
if("basalt1", "basalt2", "basalt3") //5 and 9 are too dark to glow and make the amount of glows in tunnels too high
#warn ???
//SetLuminosity(1, 1) //this is basically a 3.75% chance that a basalt floor glows
set_light(1)
set_light(1, 0.1)
/turf/open/floor/plating/asteroid/basalt/gets_dug()
if(!dug)
@@ -10,6 +10,10 @@
var/static/list/safeties_typecache = list(/obj/structure/lattice/catwalk)
//if anything matching this typecache is found in the lava, we don't burn things
light_range = 2
light_power = 0.75
light_color = "#c48a18"
/turf/open/floor/plating/lava/New()
..()
safeties_typecache = typecacheof(safeties_typecache)
+2 -3
View File
@@ -14,6 +14,8 @@
var/global/datum/gas_mixture/space/space_gas = new
plane = PLANE_SPACE
light_power = 0.25
dynamic_lighting = DYNAMIC_LIGHTING_DISABLED
/turf/open/space/New()
icon_state = SPACE_ICON_STATE
@@ -54,10 +56,7 @@
if(isspaceturf(t))
//let's NOT update this that much pls
continue
#warn a
//SetLuminosity(4,5)
set_light(2)
//light.mode = LIGHTING_STARLIGHT
return
set_light(0)
+1 -3
View File
@@ -119,9 +119,7 @@
/datum/spacevine_mutation/light/on_grow(obj/structure/spacevine/holder)
if(holder.energy)
#warn a
//holder.SetLuminosity(severity, 3)
holder.set_light(severity)
holder.set_light(severity, 0.3)
/datum/spacevine_mutation/toxicity
name = "toxic"
+3 -4
View File
@@ -151,13 +151,12 @@
// Lack of light hurts non-mushrooms
if(isturf(loc))
var/turf/currentTurf = loc
#warn TODO
var/lightAmt = 0//currentTurf.lighting_lumcount
var/lightAmt = currentTurf.get_lumcount()
if(myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
if(lightAmt < 2)
if(lightAmt < 0.2)
adjustHealth(-1 / rating)
else // Non-mushroom
if(lightAmt < 4)
if(lightAmt < 0.4)
adjustHealth(-2 / rating)
//Water//////////////////////////////////////////////////////////////////
+5 -6
View File
@@ -7,13 +7,12 @@
icon = LIGHTING_ICON
color = LIGHTING_BASE_MATRIX
#warn [insert crashing airplane noise here]
plane = LIGHTING_PLANE
mouse_opacity = 0
layer = LIGHTING_LAYER
invisibility = INVISIBILITY_LIGHTING
blend_mode = BLEND_MULTIPLY
blend_mode = BLEND_OVERLAY
var/needs_update = FALSE
@@ -80,10 +79,10 @@
var/max = max(cr.cache_mx, cg.cache_mx, cb.cache_mx, ca.cache_mx)
color = list(
cr.cache_r, cr.cache_g, cr.cache_b, 0,
cg.cache_r, cg.cache_g, cg.cache_b, 0,
cb.cache_r, cb.cache_g, cb.cache_b, 0,
ca.cache_r, ca.cache_g, ca.cache_b, 0,
1-cr.cache_r, 1-cr.cache_g, 1-cr.cache_b, 0,
1-cg.cache_r, 1-cg.cache_g, 1-cg.cache_b, 0,
1-cb.cache_r, 1-cb.cache_g, 1-cb.cache_b, 0,
1-ca.cache_r, 1-ca.cache_g, 1-ca.cache_b, 0,
0, 0, 0, 1
)
luminosity = max > LIGHTING_SOFT_THRESHOLD
+2 -5
View File
@@ -92,10 +92,7 @@
top_atom = new_top_atom
if (top_atom != source_atom)
if(!top_atom.light_sources)
top_atom.light_sources = list()
top_atom.light_sources += src // Add ourselves to the light sources of our new top atom.
LAZYADD(src, top_atom.light_sources) // Add ourselves to the light sources of our new top atom.
EFFECT_UPDATE
@@ -121,7 +118,7 @@
top_atom = source_atom
. = 1
if (istype(top_atom, /turf))
if (isturf(top_atom))
if (source_turf != top_atom)
source_turf = top_atom
. = 1
+10
View File
@@ -61,6 +61,16 @@
return CLAMP01(totallums)
// Returns a boolean whether the turf is on soft lighting.
// Soft lighting being the threshold at which point the overlay considers
// itself as too dark to allow sight and see_in_dark becomes useful.
// So basically if this returns true the tile is unlit black.
/turf/proc/is_softly_lit()
if (!lighting_overlay)
return FALSE
return !lighting_overlay.luminosity
// Can't think of a good name, this proc will recalculate the has_opaque_atom variable.
/turf/proc/recalc_atom_opacity()
has_opaque_atom = FALSE
@@ -127,9 +127,7 @@
/mob/living/simple_animal/drone/cogscarab/New()
. = ..()
#warn a
//SetLuminosity(2,1)
set_light(2)
set_light(2, 0.1)
qdel(access_card) //we don't have free access
access_card = null
verbs -= /mob/living/simple_animal/drone/verb/check_laws
@@ -112,9 +112,8 @@
// Check for darkness
var/turf/T = get_turf(loc)
if(T && destination && T.lighting_overlay)
#warn double check this
//if(T.lighting_lumcount<1 && destination.lighting_lumcount<1) // No one can see us in the darkness, right?
// return null
if(T.get_lumcount()<0.1 && destination.get_lumcount()<0.1) // No one can see us in the darkness, right?
return null
if(T == destination)
destination = null
+5 -5
View File
@@ -115,14 +115,14 @@ var/next_mob_id = 0
msg = blind_message
else
continue
#warn fix this
/*
else if(T.lighting_object)
if(T.lighting_object.invisibility <= M.see_invisible && !T.lighting_object.luminosity) //the light object is dark and not invisible to us
else if(T.lighting_overlay)
if(T.lighting_overlay.invisibility <= M.see_invisible && T.is_softly_lit()) //the light object is dark and not invisible to us
if(blind_message)
msg = blind_message
else
continue*/
continue
M.show_message(msg,1,blind_message,2)
// Show a message to all mobs in earshot of this one