mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 16:44:33 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into STILLALOTOFBLOOD
This commit is contained in:
@@ -1646,6 +1646,32 @@
|
||||
log_admin("[src.owner] replied to [key_name(H)]'s HONKplanet message with the message [input].")
|
||||
H << "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from your HONKbrothers. Message as follows, HONK. [input]. Message ends, HONK.\""
|
||||
|
||||
else if(href_list["ErtReply"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
if(alert(src.owner, "Accept or Deny ERT request?", "CentComm Response", "Accept", "Deny") == "Deny")
|
||||
var/mob/living/carbon/human/H = locate(href_list["ErtReply"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human"
|
||||
return
|
||||
if(H.stat != 0)
|
||||
usr << "The person you are trying to contact is not conscious."
|
||||
return
|
||||
if(!istype(H.l_ear, /obj/item/device/radio/headset) && !istype(H.r_ear, /obj/item/device/radio/headset))
|
||||
usr << "The person you are trying to contact is not wearing a headset"
|
||||
return
|
||||
|
||||
var/input = input(src.owner, "Please enter a reason for denying [key_name(H)]'s ERT request.","Outgoing message from CentComm", "")
|
||||
if(!input) return
|
||||
|
||||
src.owner << "You sent [input] to [H] via a secure channel."
|
||||
log_admin("[src.owner] denied [key_name(H)]'s ERT request with the message [input].")
|
||||
H << "You hear something crackle in your headset for a moment before a voice speaks. \"Your ERT request has been denied for the following reasons: [input]. Message ends.\""
|
||||
else
|
||||
src.owner.response_team()
|
||||
|
||||
|
||||
else if(href_list["AdminFaxView"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
@@ -44,6 +44,14 @@
|
||||
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
|
||||
msg = "\blue <b><font color=pink>HONK:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) ([admin_jump_link(Sender, "holder")]) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;HONKReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
|
||||
|
||||
for(var/client/X in admins)
|
||||
if(R_EVENT & X.holder.rights)
|
||||
X << msg
|
||||
|
||||
/proc/ERT_Announce(var/text , var/mob/Sender)
|
||||
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
|
||||
msg = "\blue <b><font color=orange>ERT REQUEST:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) ([admin_jump_link(Sender, "holder")]) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;ErtReply=\ref[Sender]'>REPLY</A>):</b> [msg]"
|
||||
|
||||
for(var/client/X in admins)
|
||||
if(R_EVENT & X.holder.rights)
|
||||
X << msg
|
||||
@@ -148,6 +148,7 @@ obj/item/clothing/head/blob
|
||||
/obj/item/clothing/head/helmet/ert/command
|
||||
name = "emergency response team commander helmet"
|
||||
desc = "An in-atmosphere helmet worn by the commander of a NanoTrasen Emergency Response Team. Has blue highlights."
|
||||
icon_state = "erthelmet_cmd"
|
||||
|
||||
//Security
|
||||
/obj/item/clothing/head/helmet/ert/security
|
||||
|
||||
@@ -67,16 +67,16 @@ var/setup_economy = 0
|
||||
/proc/setup_economy()
|
||||
if(setup_economy)
|
||||
return
|
||||
|
||||
|
||||
var/datum/feed_channel/newChannel = new /datum/feed_channel
|
||||
newChannel.channel_name = "Public Station Announcements"
|
||||
newChannel.author = "Automated Announcement Listing"
|
||||
newChannel.locked = 1
|
||||
newChannel.is_admin_channel = 1
|
||||
news_network.network_channels += newChannel
|
||||
|
||||
news_network.network_channels += newChannel
|
||||
|
||||
newChannel = new /datum/feed_channel
|
||||
newChannel.channel_name = "Tau Ceti Daily"
|
||||
newChannel.channel_name = "Nyx Daily"
|
||||
newChannel.author = "CentComm Minister of Information"
|
||||
newChannel.locked = 1
|
||||
newChannel.is_admin_channel = 1
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
/datum/event/economic_event/announce()
|
||||
//copy-pasted from the admin verbs to submit new newscaster messages
|
||||
var/datum/feed_message/newMsg = new /datum/feed_message
|
||||
newMsg.author = "Tau Ceti Daily"
|
||||
newMsg.author = "Nyx Daily"
|
||||
newMsg.is_admin_message = 1
|
||||
|
||||
//see if our location has custom event info for this event
|
||||
@@ -95,11 +95,11 @@
|
||||
newMsg.body = "A [pick("festival","week long celebration","day of revelry","planet-wide holiday")] has been declared on [affected_dest.name] by [pick("Governor","Commissioner","General","Commandant","Administrator")] [random_name(pick(MALE,FEMALE))] to celebrate [pick("the birth of their [pick("son","daughter")]","coming of age of their [pick("son","daughter")]","the pacification of rogue military cell","the apprehension of a violent criminal who had been terrorising the planet")]. Massive stocks of food and meat have been bought driving up prices across the planet."
|
||||
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
if(FC.channel_name == "Tau Ceti Daily")
|
||||
if(FC.channel_name == "Nyx Daily")
|
||||
FC.messages += newMsg
|
||||
break
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
NEWSCASTER.newsAlert("Tau Ceti Daily")
|
||||
NEWSCASTER.newsAlert("Nyx Daily")
|
||||
|
||||
/datum/event/economic_event/end()
|
||||
for(var/good_type in dearer_goods)
|
||||
|
||||
@@ -13,15 +13,14 @@
|
||||
|
||||
//copy-pasted from the admin verbs to submit new newscaster messages
|
||||
var/datum/feed_message/newMsg = new /datum/feed_message
|
||||
newMsg.author = "Tau Ceti Daily"
|
||||
newMsg.author = "Nyx Daily"
|
||||
newMsg.is_admin_message = 1
|
||||
|
||||
//see if our location has custom event info for this event
|
||||
newMsg.body = affected_dest.get_custom_eventstring()
|
||||
if(!newMsg.body)
|
||||
newMsg.body = "[affected_dest.name] doesn't have custom events. Bug a coder."
|
||||
// Too many goddamn strings, Bay. - N3X
|
||||
/*
|
||||
newMsg.body = ""
|
||||
|
||||
switch(event_type)
|
||||
if(RESEARCH_BREAKTHROUGH)
|
||||
newMsg.body = "A major breakthough in the field of [pick("plasma research","super-compressed materials","nano-augmentation","bluespace research","volatile power manipulation")] \
|
||||
@@ -96,7 +95,7 @@
|
||||
if(prob(33))
|
||||
newMsg.body += "were surprised when an unusual species experts have since identified as \
|
||||
[pick("a subclass of mammal","a divergent abhuman species","an intelligent species of lemur","organic/cyborg hybrids")] turned up. Believed to have been brought in by \
|
||||
[pick("alien smugglers","early colonists","syndicate raiders","unwitting tourists")], this is the first such specimen discovered in the wild."
|
||||
[pick("alien smugglers","early colonists","Syndicate raiders","unwitting tourists")], this is the first such specimen discovered in the wild."
|
||||
else if(prob(50))
|
||||
newMsg.body += "were attacked by a vicious [pick("nas'r","diyaab","samak","predator which has not yet been identified")]\
|
||||
. Officials urge caution, and locals are advised to stock up on armaments."
|
||||
@@ -118,24 +117,21 @@
|
||||
newMsg.body += "announced their [pick("split","break up","marriage","engagement")] with [pick("TV host","webcast personality","superstar","model","actor","singer")] \
|
||||
[random_name(pick(MALE,FEMALE))] at [pick("a society ball","a new opening","a launch","a club")] on [affected_dest.name] yesterday, pundits are shocked."
|
||||
else
|
||||
|
||||
// AUTOFIXED BY fix_string_idiocy.py
|
||||
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Cael_Aislinn\Economy\Economy_Events_Mundane.dm:119: newMsg.body += "is recovering from plastic surgery in a clinic on [affected_dest.name] for the [pick("second","third","fourth")] time, reportedly having made the decision in response to "
|
||||
newMsg.body += {"is recovering from plastic surgery in a clinic on [affected_dest.name] for the [pick("second","third","fourth")] time, reportedly having made the decision in response to
|
||||
[pick("unkind comments by an ex","rumours started by jealous friends","the decision to be dropped by a major sponsor","a disasterous interview on Tau Ceti Tonight")]."}
|
||||
// END AUTOFIX
|
||||
newMsg.body += "is recovering from plastic surgery in a clinic on [affected_dest.name] for the [pick("second","third","fourth")] time, reportedly having made the decision in response to "
|
||||
newMsg.body += "[pick("unkind comments by an ex","rumours started by jealous friends",\
|
||||
"the decision to be dropped by a major sponsor","a disasterous interview on Nyx Tonight")]."
|
||||
if(TOURISM)
|
||||
newMsg.body += "Tourists are flocking to [affected_dest.name] after the surprise announcement of [pick("major shopping bargains by a wily retailer",\
|
||||
"a huge new ARG by a popular entertainment company","a secret tour by popular artiste [random_name(pick(MALE,FEMALE))]")]. \
|
||||
Tau Ceti Daily is offering discount tickets for two to see [random_name(pick(MALE,FEMALE))] live in return for eyewitness reports and up to the minute coverage."
|
||||
*/
|
||||
Nyx Daily is offering discount tickets for two to see [random_name(pick(MALE,FEMALE))] live in return for eyewitness reports and up to the minute coverage."
|
||||
|
||||
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
if(FC.channel_name == "Tau Ceti Daily")
|
||||
if(FC.channel_name == "Nyx Daily")
|
||||
FC.messages += newMsg
|
||||
break
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
NEWSCASTER.newsAlert("Tau Ceti Daily")
|
||||
NEWSCASTER.newsAlert("Nyx Daily")
|
||||
|
||||
/datum/event/trivial_news
|
||||
endWhen = 10
|
||||
|
||||
@@ -127,9 +127,9 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "PDA Spam", /datum/event/pda_spam, 0, list(ASSIGNMENT_ANY = 4), 0, 25, 50),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Money Lotto", /datum/event/money_lotto, 0, list(ASSIGNMENT_ANY = 1), 1, 5, 15),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Money Hacker", /datum/event/money_hacker, 0, list(ASSIGNMENT_ANY = 4), 1, 10, 25),
|
||||
// new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Economic News", /datum/event/economic_event, 300),
|
||||
// new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Trivial News", /datum/event/trivial_news, 400),
|
||||
// new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Mundane News", /datum/event/mundane_news, 300),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Economic News", /datum/event/economic_event, 300),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Trivial News", /datum/event/trivial_news, 400),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Mundane News", /datum/event/mundane_news, 300),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Lost Carp", /datum/event/carp_migration, 20, list(ASSIGNMENT_SECURITY = 10), 1),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation",/datum/event/infestation, 100, list(ASSIGNMENT_JANITOR = 100)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 0, list(ASSIGNMENT_ENGINEER = 30, ASSIGNMENT_GARDENER = 50)),
|
||||
|
||||
@@ -46,10 +46,10 @@ var/global/list/possibleEvents = list()
|
||||
// Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events_Mundane.dm
|
||||
|
||||
possibleEvents[/datum/event/economic_event] = 300
|
||||
//possibleEvents[/datum/event/trivial_news] = 400
|
||||
//possibleEvents[/datum/event/mundane_news] = 300
|
||||
possibleEvents[/datum/event/trivial_news] = 400
|
||||
possibleEvents[/datum/event/mundane_news] = 300
|
||||
|
||||
possibleEvents[/datum/event/cargo_bonus] = 150
|
||||
possibleEvents[/datum/event/cargo_bonus] = 100
|
||||
possibleEvents[/datum/event/revenant] = 75
|
||||
|
||||
possibleEvents[/datum/event/pda_spam] = max(min(25, player_list.len) * 4, 200)
|
||||
|
||||
@@ -11,13 +11,16 @@
|
||||
var/lum_g
|
||||
var/lum_b
|
||||
|
||||
var/list/effect_r
|
||||
var/list/effect_g
|
||||
var/list/effect_b
|
||||
var/tmp/old_lum_r
|
||||
var/tmp/old_lum_g
|
||||
var/tmp/old_lum_b
|
||||
|
||||
var/list/effect_str
|
||||
var/list/effect_turf
|
||||
|
||||
var/applied
|
||||
|
||||
var/vis_update //Whetever we should smartly recalculate visibility. and then only update tiles that became (in) visible to us
|
||||
var/needs_update
|
||||
var/destroyed
|
||||
var/force_update
|
||||
@@ -38,9 +41,7 @@
|
||||
|
||||
parse_light_color()
|
||||
|
||||
effect_r = list()
|
||||
effect_g = list()
|
||||
effect_b = list()
|
||||
effect_str = list()
|
||||
effect_turf = list()
|
||||
|
||||
update()
|
||||
@@ -71,6 +72,13 @@
|
||||
needs_update = 1
|
||||
lighting_update_lights += src
|
||||
|
||||
/datum/light_source/proc/vis_update()
|
||||
if(!needs_update)
|
||||
needs_update = 1
|
||||
lighting_update_lights += src
|
||||
|
||||
vis_update = 1
|
||||
|
||||
/datum/light_source/proc/check()
|
||||
if(!source_atom || !light_range || !light_power)
|
||||
destroy()
|
||||
@@ -96,14 +104,19 @@
|
||||
light_range = source_atom.light_range
|
||||
. = 1
|
||||
|
||||
if(light_range && light_power && !applied)
|
||||
. = 1
|
||||
|
||||
if(. || source_atom.light_color != light_color)//Save the old lumcounts if we need to update, if the colour changed DO IT BEFORE we parse the colour and LOSE the old lumcounts!
|
||||
old_lum_r = lum_r
|
||||
old_lum_g = lum_g
|
||||
old_lum_b = lum_b
|
||||
|
||||
if(source_atom.light_color != light_color)
|
||||
light_color = source_atom.light_color
|
||||
parse_light_color()
|
||||
. = 1
|
||||
|
||||
if(light_range && light_power && !applied)
|
||||
. = 1
|
||||
|
||||
/datum/light_source/proc/parse_light_color()
|
||||
if(light_color)
|
||||
lum_r = GetRedPart(light_color) / 255
|
||||
@@ -114,49 +127,50 @@
|
||||
lum_g = 1
|
||||
lum_b = 1
|
||||
|
||||
/datum/light_source/proc/falloff(atom/movable/lighting_overlay/O)
|
||||
#if LIGHTING_FALLOFF == 1 // circular
|
||||
. = (O.x - source_turf.x)**2 + (O.y - source_turf.y)**2 + LIGHTING_HEIGHT
|
||||
|
||||
#if LIGHTING_LAMBERTIAN == 1
|
||||
. = CLAMP01((1 - CLAMP01(sqrt(.) / max(1,light_range))) * (1 / (sqrt(. + 1))))
|
||||
#else
|
||||
. = 1 - CLAMP01(sqrt(.) / max(1,light_range))
|
||||
#endif
|
||||
|
||||
#elif LIGHTING_FALLOFF == 2 // square
|
||||
. = abs(O.x - source_turf.x) + abs(O.y - source_turf.y) + LIGHTING_HEIGHT
|
||||
|
||||
#if LIGHTING_LAMBERTIAN == 1
|
||||
. = CLAMP01((1 - CLAMP01(. / max(1,light_range))) * (1 / (sqrt(.)**2 + )))
|
||||
#else
|
||||
. = 1 - CLAMP01(. / max(1,light_range))
|
||||
#endif
|
||||
#if LIGHTING_FALLOFF == 1 //circular
|
||||
#define LUM_DISTANCE(swapvar, O, T) swapvar = (O.x - T.x)**2 + (O.y - T.y)**2 + LIGHTING_HEIGHT
|
||||
#if LIGHTING_LAMBERTIAN == 1
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = CLAMP01((1 - CLAMP01(sqrt(swapvar) / light_range)) * (1 / sqrt(swapvar + 1)))
|
||||
#else
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = 1 - CLAMP01(sqrt(swapvar) / light_range)
|
||||
#endif
|
||||
#elif LIGHTING_FALLOFF == 2 //square
|
||||
#define LUM_DISTANCE(swapvar, O, T) swapvar = abs(O.x - T.x) + abs(O.y - T.y) + LIGHTING_HEIGHT
|
||||
#if LIGHTING_LAMBERTIAN == 1
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = CLAMP01((1 - CLAMP01(swapvar / light_range)) * (1 / sqrt(swapvar**2 + 1)))
|
||||
#else
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = CLAMP01(swapvar / light_range)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define LUM_FALLOFF(swapvar, O, T) \
|
||||
LUM_DISTANCE(swapvar, O, T); \
|
||||
LUM_ATTENUATION(swapvar);
|
||||
|
||||
/datum/light_source/proc/apply_lum()
|
||||
applied = 1
|
||||
if(istype(source_turf))
|
||||
for(var/turf/T in dview(light_range, source_turf, INVISIBILITY_LIGHTING))
|
||||
FOR_DVIEW(var/turf/T, light_range, source_turf, INVISIBILITY_LIGHTING)
|
||||
if(T.lighting_overlay)
|
||||
var/strength = light_power * falloff(T.lighting_overlay)
|
||||
var/strength
|
||||
LUM_FALLOFF(strength, T, source_turf)
|
||||
strength *= light_power
|
||||
|
||||
if(!strength) //Don't add turfs that aren't affected to the affected turfs.
|
||||
continue
|
||||
|
||||
effect_r += round(lum_r * strength, LIGHTING_ROUND_VALUE)
|
||||
effect_g += round(lum_g * strength, LIGHTING_ROUND_VALUE)
|
||||
effect_b += round(lum_b * strength, LIGHTING_ROUND_VALUE)
|
||||
strength = round(strength, LIGHTING_ROUND_VALUE) //Screw sinking points.
|
||||
|
||||
effect_str += strength
|
||||
|
||||
T.lighting_overlay.update_lumcount(
|
||||
round(lum_r * strength, LIGHTING_ROUND_VALUE),
|
||||
round(lum_g * strength, LIGHTING_ROUND_VALUE),
|
||||
round(lum_b * strength, LIGHTING_ROUND_VALUE)
|
||||
lum_r * strength,
|
||||
lum_g * strength,
|
||||
lum_b * strength
|
||||
)
|
||||
|
||||
else
|
||||
effect_r += 0
|
||||
effect_g += 0
|
||||
effect_b += 0
|
||||
effect_str += 0
|
||||
|
||||
if(!T.affecting_lights)
|
||||
T.affecting_lights = list()
|
||||
@@ -172,11 +186,66 @@
|
||||
T.affecting_lights -= src
|
||||
|
||||
if(T.lighting_overlay)
|
||||
T.lighting_overlay.update_lumcount(-effect_r[i], -effect_g[i], -effect_b[i])
|
||||
var/str = effect_str[i]
|
||||
T.lighting_overlay.update_lumcount(-str * old_lum_r, -str * old_lum_g, -str * old_lum_b)
|
||||
|
||||
i++
|
||||
|
||||
effect_r.Cut()
|
||||
effect_g.Cut()
|
||||
effect_b.Cut()
|
||||
effect_str.Cut()
|
||||
effect_turf.Cut()
|
||||
|
||||
//Smartly updates the lighting, only removes lum from and adds lum to turfs that actually got changed.
|
||||
//This is for lights that need to reconsider due to nearby opacity changes.
|
||||
//Stupid dumb copy pasta because BYOND and speed.
|
||||
/datum/light_source/proc/smart_vis_update()
|
||||
var/list/view[0]
|
||||
FOR_DVIEW(var/turf/T, light_range, source_turf, INVISIBILITY_LIGHTING)
|
||||
view += T //Filter out turfs.
|
||||
|
||||
//This is the part where we calculate new turfs (if any)
|
||||
var/list/new_turfs = view - effect_turf //This will result with all the tiles that are added.
|
||||
for(var/turf/T in new_turfs)
|
||||
//Big huge copy paste from apply_lum() incoming because screw unreadable defines and screw proc call overhead.
|
||||
if(T.lighting_overlay)
|
||||
LUM_FALLOFF(., T, source_turf)
|
||||
. *= light_power
|
||||
|
||||
if(!.) //Don't add turfs that aren't affected to the affected turfs.
|
||||
continue
|
||||
|
||||
. = round(., LIGHTING_ROUND_VALUE)
|
||||
|
||||
effect_str += .
|
||||
|
||||
T.lighting_overlay.update_lumcount(
|
||||
lum_r * .,
|
||||
lum_g * .,
|
||||
lum_b * .
|
||||
)
|
||||
|
||||
else
|
||||
effect_str += 0
|
||||
|
||||
if(!T.affecting_lights)
|
||||
T.affecting_lights = list()
|
||||
|
||||
T.affecting_lights += src
|
||||
effect_turf += T
|
||||
|
||||
var/list/old_turfs = effect_turf - view
|
||||
for(var/turf/T in old_turfs)
|
||||
//Insert not-so-huge copy paste from remove_lum().
|
||||
var/idx = effect_turf.Find(T) //Get the index, luckily Find() is cheap in small lists like this. (with small I mean under a couple thousand len)
|
||||
if(T.affecting_lights)
|
||||
T.affecting_lights -= src
|
||||
|
||||
if(T.lighting_overlay)
|
||||
var/str = effect_str[idx]
|
||||
T.lighting_overlay.update_lumcount(-str * lum_r, -str * lum_g, -str * lum_b)
|
||||
|
||||
effect_turf.Cut(idx, idx + 1)
|
||||
effect_str.Cut(idx, idx + 1)
|
||||
|
||||
#undef LUM_FALLOFF
|
||||
#undef LUM_DISTANCE
|
||||
#undef LUM_ATTENUATION
|
||||
@@ -7,7 +7,6 @@
|
||||
icon = LIGHTING_ICON
|
||||
layer = LIGHTING_LAYER
|
||||
invisibility = INVISIBILITY_LIGHTING
|
||||
blend_mode = BLEND_MULTIPLY
|
||||
color = "#000000"
|
||||
icon_state = "light1"
|
||||
|
||||
@@ -62,34 +61,33 @@
|
||||
lighting_update_overlays += src
|
||||
|
||||
/atom/movable/lighting_overlay/proc/update_overlay()
|
||||
var/mx = max(lum_r, lum_g, lum_b)
|
||||
. = 1 // factor
|
||||
if(mx > 1)
|
||||
. = 1/mx
|
||||
#if LIGHTING_TRANSITIONS == 1
|
||||
animate(src,
|
||||
color = rgb(lum_r * 255 * ., lum_g * 255 * ., lum_b * 255 * .),
|
||||
LIGHTING_TRANSITION_SPEED
|
||||
)
|
||||
#else
|
||||
color = rgb(lum_r * 255 * ., lum_g * 255 * ., lum_b * 255 * .)
|
||||
#endif
|
||||
|
||||
var/turf/T = loc
|
||||
|
||||
if(istype(T)) //Incase we're not on a turf, pool ourselves, something happened.
|
||||
if(color != "#000000")
|
||||
T.luminosity = 1
|
||||
else //No light, set the turf's luminosity to 0 to remove it from view()
|
||||
#if LIGHTING_TRANSITIONS == 1
|
||||
spawn(LIGHTING_TRANSITION_SPEED)
|
||||
if(lum_r == lum_g && lum_r == lum_b) //greyscale
|
||||
blend_mode = BLEND_OVERLAY
|
||||
if(lum_r <= 0)
|
||||
T.luminosity = 0
|
||||
color = "#000000"
|
||||
alpha = 255
|
||||
else
|
||||
T.luminosity = 1
|
||||
color = "#000000"
|
||||
alpha = (1 - min(lum_r, 1)) * 255
|
||||
else
|
||||
alpha = 255
|
||||
var/mx = max(lum_r, lum_g, lum_b)
|
||||
. = 1 // factor
|
||||
if(mx > 1)
|
||||
. = 1/mx
|
||||
blend_mode = BLEND_MULTIPLY
|
||||
color = rgb(lum_r * 255 * ., lum_g * 255 * ., lum_b * 255 * .)
|
||||
if(color != "#000000")
|
||||
T.luminosity = 1
|
||||
else //No light, set the turf's luminosity to 0 to remove it from view()
|
||||
T.luminosity = 0
|
||||
#else
|
||||
T.luminosity = 0
|
||||
#endif
|
||||
|
||||
else
|
||||
warning("A lighting overlay realised it's loc was NOT a turf (actual loc: [loc], [loc.type]) in update_overlay() and got qdel'd!")
|
||||
warning("A lighting overlay realised its loc was NOT a turf (actual loc: [loc][loc ? ", " + loc.type : ""]) in update_overlay() and got qdel'ed!")
|
||||
qdel(src)
|
||||
|
||||
/atom/movable/lighting_overlay/singularity_act()
|
||||
@@ -104,9 +102,5 @@
|
||||
var/turf/T = loc
|
||||
if(istype(T))
|
||||
T.lighting_overlay = null
|
||||
for(var/datum/light_source/D in T.affecting_lights) //Remove references to us on the light sources affecting us.
|
||||
D.effect_r -= src
|
||||
D.effect_g -= src
|
||||
D.effect_b -= src
|
||||
|
||||
return ..()
|
||||
@@ -2,31 +2,37 @@ var/global/datum/controller/process/lighting/lighting_controller
|
||||
|
||||
/datum/controller/process/lighting/setup()
|
||||
name = "lighting"
|
||||
schedule_interval = LIGHTING_INTERVAL
|
||||
lighting_controller = src
|
||||
schedule_interval = LIGHTING_INTERVAL
|
||||
|
||||
create_lighting_overlays()
|
||||
|
||||
/datum/controller/process/lighting/doWork()
|
||||
var/list/lighting_update_lights_old = lighting_update_lights //We use a different list so any additions to the update lists during a delay from scheck() don't cause things to be cut from the list without being updated.
|
||||
lighting_update_lights = null //Nulling it first because of http://www.byond.com/forum/?post=1854520
|
||||
lighting_update_lights = list()
|
||||
|
||||
for(var/datum/light_source/L in lighting_update_lights_old)
|
||||
if(L.needs_update)
|
||||
if(L.destroyed || L.check() || L.force_update)
|
||||
L.remove_lum()
|
||||
if(!L.destroyed) L.apply_lum()
|
||||
L.force_update = 0
|
||||
L.needs_update = 0
|
||||
if(L.destroyed || L.check() || L.force_update)
|
||||
L.remove_lum()
|
||||
if(!L.destroyed)
|
||||
L.apply_lum()
|
||||
|
||||
else if(L.vis_update) //We smartly update only tiles that became (in) visible to use.
|
||||
L.smart_vis_update()
|
||||
|
||||
L.vis_update = 0
|
||||
L.force_update = 0
|
||||
L.needs_update = 0
|
||||
|
||||
scheck()
|
||||
|
||||
var/list/lighting_update_overlays_old = lighting_update_overlays //Same as above.
|
||||
lighting_update_overlays = null //Same as above
|
||||
lighting_update_overlays = list()
|
||||
|
||||
for(var/atom/movable/lighting_overlay/O in lighting_update_overlays_old)
|
||||
if(O.needs_update)
|
||||
O.update_overlay()
|
||||
O.needs_update = 0
|
||||
O.update_overlay()
|
||||
O.needs_update = 0
|
||||
|
||||
scheck()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/turf/proc/reconsider_lights()
|
||||
for(var/datum/light_source/L in affecting_lights)
|
||||
L.force_update()
|
||||
L.vis_update()
|
||||
|
||||
/turf/proc/lighting_clear_overlays()
|
||||
if(lighting_overlay)
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#undef LIGHTING_FALLOFF
|
||||
#undef LIGHTING_LAMBERTIAN
|
||||
#undef LIGHTING_HEIGHT
|
||||
#undef LIGHTING_TRANSITIONS
|
||||
|
||||
#undef LIGHTING_RESOLUTION
|
||||
#undef LIGHTING_LAYER
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//unequip
|
||||
/mob/living/carbon/alien/humanoid/unEquip(obj/item/I as obj)
|
||||
. = ..()
|
||||
/mob/living/carbon/alien/humanoid/unEquip(var/obj/item/I, var/force)
|
||||
. = ..(I, force)
|
||||
if(!. || !I)
|
||||
return
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
icon_state = "alien[caste]_leap"
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
else
|
||||
icon = initial(icon)
|
||||
else if(icon == 'icons/mob/alienleap.dmi' && icon_state == "alien[caste]_leap" && pixel_x == -32 && pixel_y == -32)
|
||||
icon = initial(icon)// ^ this looks odd, but in theory it will prevent the icon and pixel_xy from being reset unless it needs to be
|
||||
pixel_x = initial(pixel_x)
|
||||
pixel_y = initial(pixel_y)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
mob/living
|
||||
var/canEnterVentWith = "/obj/item/weapon/implant=0&/obj/item/clothing/mask/facehugger=0&/obj/item/device/radio/borg=0&/obj/machinery/camera=0"
|
||||
var/datum/middleClickOverride/middleClickOverride = null
|
||||
|
||||
/mob/living/carbon/Login()
|
||||
..()
|
||||
|
||||
@@ -7,20 +7,7 @@
|
||||
if ("help")
|
||||
visible_message(text("\blue [M] caresses [src] with its scythe like arm."))
|
||||
if ("grab")
|
||||
if(M == src || anchored)
|
||||
return
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message(text("\red [] has grabbed [] passively!", M, src))
|
||||
grabbedby(M)
|
||||
|
||||
if("harm")
|
||||
M.do_attack_animation(src)
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
if (!src.laws)
|
||||
make_laws()
|
||||
|
||||
/mob/living/silicon/ai/proc/set_zeroth_law(var/law, var/law_borg)
|
||||
/mob/living/silicon/ai/proc/set_zeroth_law(var/law, var/law_borg, var/law_type)
|
||||
src.laws_sanity_check()
|
||||
src.laws.set_zeroth_law(law, law_borg)
|
||||
src.laws.set_zeroth_law(law, law_borg, law_type)
|
||||
|
||||
/mob/living/silicon/ai/proc/clear_zeroth_law(var/law_borg)
|
||||
src.laws_sanity_check()
|
||||
|
||||
@@ -27,8 +27,13 @@
|
||||
w_class = 5.0
|
||||
|
||||
|
||||
/obj/item/weapon/grab/New(mob/user, mob/victim)
|
||||
/obj/item/weapon/grab/New(var/mob/user, var/mob/victim)
|
||||
..()
|
||||
|
||||
//Okay, first off, some fucking sanity checking. No user, or no victim, or they are not mobs, no grab.
|
||||
if(!istype(user) || !istype(victim))
|
||||
return
|
||||
|
||||
loc = user
|
||||
assailant = user
|
||||
affecting = victim
|
||||
@@ -52,8 +57,25 @@
|
||||
G.dancing = 1
|
||||
G.adjust_position()
|
||||
dancing = 1
|
||||
|
||||
clean_grabbed_by(assailant, affecting)
|
||||
adjust_position()
|
||||
|
||||
/obj/item/weapon/grab/proc/clean_grabbed_by(var/mob/user, var/mob/victim) //Cleans up any nulls in the grabbed_by list.
|
||||
if(istype(user))
|
||||
|
||||
for(var/entry in user.grabbed_by)
|
||||
if(isnull(entry) || !istype(entry, /obj/item/weapon/grab)) //the isnull() here is probably redundant- but it might outperform istype, who knows. Better safe than sorry.
|
||||
user.grabbed_by -= entry
|
||||
|
||||
if(istype(victim))
|
||||
|
||||
for(var/entry in victim.grabbed_by)
|
||||
if(isnull(entry) || !istype(entry, /obj/item/weapon/grab))
|
||||
victim.grabbed_by -= entry
|
||||
|
||||
return 1
|
||||
|
||||
//Used by throw code to hand over the mob, instead of throwing the grab. The grab is then deleted by the throw code.
|
||||
/obj/item/weapon/grab/proc/get_mob_if_throwable()
|
||||
if(affecting && assailant.Adjacent(affecting))
|
||||
@@ -73,7 +95,7 @@
|
||||
|
||||
|
||||
/obj/item/weapon/grab/process()
|
||||
confirm()
|
||||
if(!confirm()) return //If the confirm fails, the grab is about to be deleted. That means it shouldn't continue processing.
|
||||
|
||||
if(assailant.client)
|
||||
if(!hud) return //this somehow can runtime under the right circumstances
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
health = 100
|
||||
min_broken_damage = 50
|
||||
body_part = LOWER_TORSO
|
||||
vital = 1
|
||||
parent_organ = "chest"
|
||||
|
||||
/obj/item/organ/external/diona/arm
|
||||
@@ -117,6 +118,7 @@
|
||||
health = 50
|
||||
min_broken_damage = 25
|
||||
body_part = HEAD
|
||||
vital = 1
|
||||
parent_organ = "chest"
|
||||
|
||||
/obj/item/organ/external/diona/head/removed()
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
return 0
|
||||
if(targloc == curloc) //Fire the projectile
|
||||
user.bullet_act(in_chamber)
|
||||
qdel(in_chamber)
|
||||
del(in_chamber)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
else
|
||||
user << "<span class = 'notice'>Ow...</span>"
|
||||
user.apply_effect(110,AGONY,0)
|
||||
qdel(in_chamber)
|
||||
del(in_chamber)
|
||||
mouthshoot = 0
|
||||
return
|
||||
else
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
proc/on_range() //if we want there to be effects when they reach the end of their range
|
||||
proj_hit = 1
|
||||
qdel(src)
|
||||
del(src)
|
||||
|
||||
proc/on_hit(var/atom/target, var/blocked = 0, var/hit_zone)
|
||||
if(!isliving(target)) return 0
|
||||
@@ -97,7 +97,7 @@
|
||||
in_chamber.pass_flags = pass_flags //And the pass flags to that of the real projectile...
|
||||
in_chamber.firer = user
|
||||
var/output = in_chamber.process() //Test it!
|
||||
qdel(in_chamber) //No need for it anymore
|
||||
del(in_chamber) //No need for it anymore
|
||||
return output //Send it back to the gun!
|
||||
|
||||
Bump(atom/A as mob|obj|turf|area)
|
||||
@@ -168,7 +168,7 @@
|
||||
if(!istype(src, /obj/item/projectile/beam/lightning))
|
||||
density = 0
|
||||
invisibility = 101
|
||||
qdel(src)
|
||||
del(src)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
spawn() //New projectile system
|
||||
while(loc)
|
||||
if(kill_count < 1)
|
||||
qdel(src)
|
||||
del(src)
|
||||
return
|
||||
kill_count--
|
||||
if((!( current ) || loc == current))
|
||||
@@ -262,7 +262,7 @@
|
||||
spawn() //Old projectile system
|
||||
while(loc)
|
||||
if(kill_count < 1)
|
||||
qdel(src)
|
||||
del(src)
|
||||
return
|
||||
kill_count--
|
||||
if((!( current ) || loc == current))
|
||||
|
||||
@@ -28,4 +28,11 @@
|
||||
desc = "Helps with burn injuries."
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("silver_sulfadiazine", 40)
|
||||
reagents.add_reagent("silver_sulfadiazine", 40)
|
||||
|
||||
/obj/item/weapon/reagent_containers/pill/patch/synthflesh
|
||||
name = "syntheflesh patch"
|
||||
desc = "Helps with burn injuries."
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("synthflesh", 20)
|
||||
@@ -13,6 +13,7 @@
|
||||
var/obj/machinery/keycard_auth/event_source
|
||||
var/mob/event_triggered_by
|
||||
var/mob/event_confirmed_by
|
||||
var/ert_reason = "Reason for ERT"
|
||||
//1 = select event
|
||||
//2 = authenticate
|
||||
anchored = 1.0
|
||||
@@ -38,8 +39,8 @@
|
||||
event_source.confirmed = 1
|
||||
event_source.event_confirmed_by = usr
|
||||
else if(screen == 2)
|
||||
if(event == "Emergency Response Team" && !ert_chosen.len)
|
||||
user << "<span class='notice'>Pick the Emergency Response Team type first!</span>"
|
||||
if(event == "Emergency Response Team" && ert_reason == "Reason for ERT")
|
||||
user << "<span class='notice'>Supply a reason for calling the ERT first!</span>"
|
||||
return
|
||||
event_triggered_by = usr
|
||||
broadcast_request() //This is the device making the initial event request. It needs to broadcast to other devices
|
||||
@@ -69,12 +70,7 @@
|
||||
var/data[0]
|
||||
data["screen"] = screen
|
||||
data["event"] = event
|
||||
data["erttypes"] = list()
|
||||
for(var/type in response_team_types)
|
||||
var/active = 0
|
||||
if((type in ert_chosen))
|
||||
active = 1
|
||||
data["erttypes"] += list(list("name" = type, "active" = active))
|
||||
data["ertreason"] = ert_reason
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
@@ -92,17 +88,12 @@
|
||||
usr << "This device is without power."
|
||||
return
|
||||
if(href_list["triggerevent"])
|
||||
ert_chosen.Cut()
|
||||
event = href_list["triggerevent"]
|
||||
screen = 2
|
||||
if(href_list["reset"])
|
||||
reset()
|
||||
if(href_list["ert"])
|
||||
var/chosen = href_list["ert"]
|
||||
if((chosen in response_team_types) && !(chosen in ert_chosen))
|
||||
ert_chosen |= chosen
|
||||
else
|
||||
ert_chosen -= chosen
|
||||
ert_reason = input(usr, "Reason for ERT Call:", "", "")
|
||||
|
||||
nanomanager.update_uis(src)
|
||||
add_fingerprint(usr)
|
||||
@@ -165,9 +156,13 @@
|
||||
usr << "\red All Emergency Response Teams are dispatched and can not be called at this time."
|
||||
return
|
||||
|
||||
response_team_chosen_types += ert_chosen
|
||||
trigger_armed_response_team(1)
|
||||
feedback_inc("alert_keycard_auth_ert",1)
|
||||
usr << "<span class = 'notice'>ERT request transmitted.</span>"
|
||||
if(admins.len)
|
||||
ERT_Announce(ert_reason , event_triggered_by)
|
||||
ert_reason = "Reason for ERT"
|
||||
feedback_inc("alert_keycard_auth_ert",1)
|
||||
else
|
||||
trigger_armed_response_team(new /datum/response_team/amber) // No admins? No problem. Automatically send a code amber ERT.
|
||||
|
||||
/obj/machinery/keycard_auth/proc/is_ert_blocked()
|
||||
return ticker.mode && ticker.mode.ert_disabled
|
||||
|
||||
Reference in New Issue
Block a user