Glorious /vg/ Lighting Port (#66)

* fuck

* [CANT WAKE UP]

* AAAAAAAAAHHHHHHHHHHHH

* SAAAAVE MEEEEEEEEEEEEEEEE

* this is so bad how can i even call myself a coder

* thanks fam

* hello darkness my old friend

i've come to talk with you again

* ugh go away

* OH

* much less broken

* ayy

* aaaaa

* OH YEAAAAAAAAHHHHHHHHHHH

* aaaa

* k

* dfgjtxkytkjyd

* debug

* dangerously cheesy

* mm

* OH YEAAAAAAAAAAAAAAAAAAAAAAAAAA

* oH YEAH

* Some final touches and cleanup of the lighting port.

* One more

* More fixes.

* varedit hack for easy modification

* fixed

* C O L O R

* slym

* fffff

* oh great what the fuck is wrong now

* Revert "oh great what the fuck is wrong now"

This reverts commit e589ad51facb5464e107ca515317d41136dd1e5e.

* fu

* will it blend

* aaaaaaaaaaaaaaaaaaaa

* this is why im bad at porting

falalalala, lala la la

* k

* yeh

* can't forget majestic fire
This commit is contained in:
L.E.D
2016-11-06 09:51:16 -05:00
committed by TalkingCactus
parent 9b07cb4798
commit e1956df149
141 changed files with 1508 additions and 958 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
/obj/effect/anomaly/New()
..()
poi_list |= src
SetLuminosity(initial(luminosity))
set_light(initial(luminosity))
aSignal = new(src)
aSignal.code = rand(1,100)
+1 -1
View File
@@ -34,7 +34,7 @@ obj/effect/glowshroom/glowcap
/obj/effect/glowshroom/New()
..()
SetLuminosity(round(potency/10))
set_light(round(potency/10))
setDir(CalcDir())
var/base_icon_state = initial(icon_state)
if(!floor)
+2 -2
View File
@@ -213,12 +213,12 @@
turfs -= key
if(A)
A.contents += turfs
A.SetDynamicLighting()
A.set_dynamic_lighting()
else
A = new
A.setup(str)
A.contents += turfs
A.SetDynamicLighting()
A.set_dynamic_lighting()
A.has_gravity = old_gravity
interact()
return 1
+2 -17
View File
@@ -64,7 +64,7 @@
if(show_message)
usr.visible_message(
"<span class='danger'>[usr] lights the [name].</span>")
SetLuminosity(CANDLE_LUMINOSITY)
set_light(CANDLE_LUMINOSITY)
START_PROCESSING(SSobj, src)
update_icon()
@@ -89,22 +89,7 @@
"<span class='notice'>[user] snuffs [src].</span>")
lit = FALSE
update_icon()
SetLuminosity(0)
user.AddLuminosity(-CANDLE_LUMINOSITY)
/obj/item/candle/pickup(mob/user)
..()
if(lit)
SetLuminosity(0)
user.AddLuminosity(CANDLE_LUMINOSITY)
/obj/item/candle/dropped(mob/user)
..()
if(lit)
user.AddLuminosity(-CANDLE_LUMINOSITY)
SetLuminosity(CANDLE_LUMINOSITY)
set_light(0)
/obj/item/candle/is_hot()
return lit * heat
+2 -2
View File
@@ -655,9 +655,9 @@
if(actually_paints)
target.color = paint_color
if(color_hex2num(paint_color) < 255)
target.SetOpacity(255)
target.set_opacity(255)
else
target.SetOpacity(initial(target.opacity))
target.set_opacity(initial(target.opacity))
. = use_charges(2)
var/fraction = min(1, . / reagents.maximum_volume)
reagents.reaction(target, TOUCH, fraction * volume_multiplier)
+3 -26
View File
@@ -50,27 +50,10 @@ var/global/list/obj/item/device/pda/PDAs = list()
var/image/photo = null //Scanned photo
/obj/item/device/pda/pickup(mob/user)
..()
if(fon)
SetLuminosity(0)
user.AddLuminosity(f_lum)
/obj/item/device/pda/dropped(mob/user)
..()
if(fon)
user.AddLuminosity(-f_lum)
SetLuminosity(f_lum)
/obj/item/device/pda/New()
..()
if(fon)
if(!isturf(loc))
loc.AddLuminosity(f_lum)
SetLuminosity(0)
else
SetLuminosity(f_lum)
set_light(f_lum)
PDAs += src
if(default_cartridge)
cartridge = new default_cartridge(src)
@@ -343,16 +326,10 @@ var/global/list/obj/item/device/pda/PDAs = list()
if("Light")
if(fon)
fon = 0
if(src in U.contents)
U.AddLuminosity(-f_lum)
else
SetLuminosity(0)
set_light(0)
else
fon = 1
if(src in U.contents)
U.AddLuminosity(f_lum)
else
SetLuminosity(f_lum)
set_light(f_lum)
if("Medical Scan")
if(scanmode == 1)
scanmode = 0
+11 -41
View File
@@ -14,33 +14,19 @@
/obj/item/device/flashlight/initialize()
..()
if(on)
icon_state = "[initial(icon_state)]-on"
SetLuminosity(brightness_on)
else
icon_state = initial(icon_state)
SetLuminosity(0)
update_brightness()
/obj/item/device/flashlight/proc/update_brightness(mob/user = null)
/obj/item/device/flashlight/proc/update_brightness()
if(on)
icon_state = "[initial(icon_state)]-on"
if(loc == user)
user.AddLuminosity(brightness_on)
else if(isturf(loc))
SetLuminosity(brightness_on)
set_light(brightness_on)
else
icon_state = initial(icon_state)
if(loc == user)
user.AddLuminosity(-brightness_on)
else if(isturf(loc))
SetLuminosity(0)
set_light(0)
/obj/item/device/flashlight/attack_self(mob/user)
if(!isturf(user.loc))
user << "<span class='warning'>You cannot turn the light on while in this [user.loc]!</span>" //To prevent some lighting anomalities.
return 0
on = !on
update_brightness(user)
update_brightness()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
@@ -85,21 +71,6 @@
else
return ..()
/obj/item/device/flashlight/pickup(mob/user)
..()
if(on)
user.AddLuminosity(brightness_on)
SetLuminosity(0)
/obj/item/device/flashlight/dropped(mob/user)
..()
if(on)
user.AddLuminosity(-brightness_on)
SetLuminosity(brightness_on)
/obj/item/device/flashlight/pen
name = "penlight"
desc = "A pen-sized light, used by medical staff. It can also be used to create a hologram to alert people of incoming medical assistance."
@@ -193,6 +164,7 @@ obj/item/device/flashlight/lamp/bananalamp
var/on_damage = 7
var/produce_heat = 1500
heat = 1000
light_color = LIGHT_COLOR_FLARE
/obj/item/device/flashlight/flare/New()
fuel = rand(800, 1000) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds.
@@ -213,13 +185,9 @@ obj/item/device/flashlight/lamp/bananalamp
on = 0
force = initial(src.force)
damtype = initial(src.damtype)
if(ismob(loc))
var/mob/U = loc
update_brightness(U)
else
update_brightness(null)
update_brightness()
/obj/item/device/flashlight/flare/update_brightness(mob/user = null)
/obj/item/device/flashlight/flare/update_brightness()
..()
if(on)
item_state = "[initial(item_state)]-on"
@@ -262,6 +230,7 @@ obj/item/device/flashlight/lamp/bananalamp
item_state = "lantern"
desc = "A mining lantern."
brightness_on = 6 // luminosity when on
light_color = LIGHT_COLOR_FIRE
/obj/item/device/flashlight/slime
@@ -275,9 +244,10 @@ obj/item/device/flashlight/lamp/bananalamp
slot_flags = SLOT_BELT
materials = list()
brightness_on = 6 //luminosity when on
light_color = LIGHT_COLOR_SLIME_LAMP
/obj/item/device/flashlight/emp
origin_tech = "magnets=3;syndicate=´1"
origin_tech = "magnets=3;syndicate=1"
var/emp_max_charges = 4
var/emp_cur_charges = 4
var/charge_tick = 0
+2 -2
View File
@@ -52,7 +52,7 @@
mode = value
update_icon()
SetLuminosity(0)
set_light(0)
/obj/item/device/powersink/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/screwdriver))
@@ -113,7 +113,7 @@
var/datum/powernet/PN = attached.powernet
if(PN)
SetLuminosity(5)
set_light(5)
// found a powernet, so drain up to max power from it
@@ -188,6 +188,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
hitsound = 'sound/items/welder.ogg'
damtype = "fire"
force = 4
update_brightness()
if(reagents.get_reagent_amount("plasma")) // the plasma explodes when exposed to fire
var/datum/effect_system/reagents_explosion/e = new()
e.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0)
@@ -223,6 +224,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM
M.update_inv_l_hand()
M.update_inv_r_hand()
/obj/item/clothing/mask/cigarette/proc/update_brightness()
if(lit)
set_light(1)
else
set_light(0)
/obj/item/clothing/mask/cigarette/proc/handle_reagents()
if(reagents.total_volume)
@@ -245,6 +251,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM
smoketime--
if(smoketime < 1)
new type_butt(location)
lit = 0
update_brightness()
if(ismob(loc))
M << "<span class='notice'>Your [name] goes out.</span>"
M.unEquip(src, 1) //un-equip it so the overlays can update //Force the un-equip so the overlays update
@@ -259,6 +267,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
user.visible_message("<span class='notice'>[user] calmly drops and treads on \the [src], putting it out instantly.</span>")
new type_butt(user.loc)
new /obj/effect/decal/cleanable/ash(user.loc)
update_brightness()
qdel(src)
return ..()
@@ -511,7 +520,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
user.apply_damage(5, BURN, hitzone)
user.visible_message("<span class='warning'>After a few attempts, [user] manages to light [src] - they however burn their finger in the process.</span>", "<span class='warning'>You burn yourself while lighting the lighter!</span>")
user.AddLuminosity(1)
set_light(1)
START_PROCESSING(SSobj, src)
else
lit = 0
@@ -523,7 +532,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
user.visible_message("You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing. Wow.", "<span class='notice'>You quietly shut off [src] without even looking at what you're doing. Wow.</span>")
else
user.visible_message("[user] quietly shuts off [src].", "<span class='notice'>You quietly shut off [src].")
user.AddLuminosity(-1)
set_light(0)
STOP_PROCESSING(SSobj, src)
else
return ..()
@@ -553,22 +562,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM
location.hotspot_expose(700, 5)
return
/obj/item/weapon/lighter/pickup(mob/user)
..()
if(lit)
SetLuminosity(0)
user.AddLuminosity(1)
return
/obj/item/weapon/lighter/dropped(mob/user)
..()
if(lit)
if(user)
user.AddLuminosity(-1)
SetLuminosity(1)
return
/obj/item/weapon/lighter/is_hot()
return lit * heat
@@ -72,7 +72,7 @@
if(do_after(user, src.cleanspeed, target = target))
user << "<span class='notice'>You clean \the [target.name].</span>"
target.color = initial(target.color)
target.SetOpacity(initial(target.opacity))
target.set_opacity(initial(target.opacity))
else
user.visible_message("[user] begins to clean \the [target.name] with [src]...", "<span class='notice'>You begin to clean \the [target.name] with [src]...</span>")
if(do_after(user, src.cleanspeed, target = target))
+1 -1
View File
@@ -25,7 +25,7 @@
if(ticker)
cameranet.updateVisibility(src)
if(opacity)
UpdateAffectingLights()
update_light()
if(smooth)
queue_smooth_neighbors(src)
return ..()
+2 -2
View File
@@ -45,7 +45,7 @@
sleep(5)
if(!qdeleted(src))
density = 0
SetOpacity(0)
set_opacity(0)
update_icon()
else
var/srcturf = get_turf(src)
@@ -56,7 +56,7 @@
density = 1
sleep(5)
if(!qdeleted(src))
SetOpacity(1)
set_opacity(1)
update_icon()
air_update_turf(1)
opening = 0