Solving several issues.

This commit is contained in:
Ghommie
2020-06-26 18:40:20 +02:00
parent 07c7432f43
commit 8f6b31c26e
13 changed files with 72 additions and 54 deletions
+9 -3
View File
@@ -23,10 +23,14 @@
var/end_sound
var/chance
var/volume = 100
var/vary = FALSE
var/max_loops
var/direct
var/extra_range = 0
var/falloff
var/timerid
var/init_timerid
/datum/looping_sound/New(list/_output_atoms=list(), start_immediately=FALSE, _direct=FALSE)
if(!mid_sounds)
@@ -47,13 +51,15 @@
/datum/looping_sound/proc/start(atom/add_thing)
if(add_thing)
output_atoms |= add_thing
if(timerid)
if(timerid || init_timerid)
return
on_start()
/datum/looping_sound/proc/stop(atom/remove_thing)
if(remove_thing)
output_atoms -= remove_thing
if(init_timerid)
deltimer(init_timerid)
if(!timerid)
return
on_stop()
@@ -80,7 +86,7 @@
if(direct)
SEND_SOUND(thing, S)
else
playsound(thing, S, volume)
playsound(thing, S, volume, vary, extra_range, falloff)
/datum/looping_sound/proc/get_sound(starttime, _mid_sounds)
. = _mid_sounds || mid_sounds
@@ -92,7 +98,7 @@
if(start_sound)
play(start_sound)
start_wait = start_length
addtimer(CALLBACK(src, .proc/sound_loop), start_wait, TIMER_CLIENT_TIME)
init_timerid = addtimer(CALLBACK(src, .proc/sound_loop), start_wait, TIMER_CLIENT_TIME | TIMER_STOPPABLE)
/datum/looping_sound/proc/on_stop()
if(end_sound)
+1 -1
View File
@@ -18,7 +18,7 @@
var/secondsElectrified = 0
var/shockedby
var/visible = TRUE
var/visible = TRUE // To explain: Wheter the door can block line of sight when closed or not.
var/operating = FALSE
var/glass = FALSE
var/welded = FALSE
+20 -6
View File
@@ -54,6 +54,15 @@
else
icon_state = "[src.base_state]open"
/obj/machinery/door/window/update_atom_colour()
if((color && (color_hex2num(color) < 255)))
visible = TRUE
if(density)
set_opacity(TRUE)
else
visible = FALSE
set_opacity(density && visible)
/obj/machinery/door/window/proc/open_and_close()
open()
if(src.check_access(null))
@@ -143,16 +152,18 @@
do_animate("opening")
playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1)
src.icon_state ="[src.base_state]open"
sleep(10)
addtimer(CALLBACK(src, .proc/finish_opening), 10)
return TRUE
/obj/machinery/door/window/proc/finish_opening()
operating = FALSE
density = FALSE
// src.sd_set_opacity(0) //TODO: why is this here? Opaque windoors? ~Carn
if(visible)
set_opacity(FALSE)
air_update_turf(1)
update_freelook_sight()
if(operating == 1) //emag again
operating = FALSE
return 1
/obj/machinery/door/window/close(forced=0)
if (src.operating)
@@ -171,10 +182,13 @@
density = TRUE
air_update_turf(1)
update_freelook_sight()
sleep(10)
addtimer(CALLBACK(.proc/finish_closing), 10)
return TRUE
/obj/machinery/door/window/proc/finish_closing()
if(visible)
set_opacity(TRUE)
operating = FALSE
return 1
/obj/machinery/door/window/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
+1 -6
View File
@@ -737,12 +737,7 @@
to_chat(usr, "<span class='warning'>A color that dark on an object like this? Surely not...</span>")
return FALSE
if(istype(target, /obj/structure/window))
var/obj/structure/window/W = target
W.spraycan_paint(paint_color)
else
target.add_atom_colour(paint_color, WASHABLE_COLOUR_PRIORITY)
target.add_atom_colour(paint_color, WASHABLE_COLOUR_PRIORITY)
. = use_charges(user, 2)
var/fraction = min(1, . / reagents.maximum_volume)
@@ -258,6 +258,9 @@ GLOBAL_LIST_INIT(channel_tokens, list(
name = "\proper mini Integrated Subspace Transceiver "
subspace_transmission = FALSE
/obj/item/radio/headset/silicon/pai/ComponentInitialize()
. = ..()
AddElement(/datum/element/empprotection, EMP_PROTECT_WIRES)
/obj/item/radio/headset/silicon/ai
name = "\proper Integrated Subspace Transceiver "
+12 -16
View File
@@ -271,29 +271,27 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
air_update_turf(TRUE)
update_nearby_icons()
/obj/structure/window/proc/spraycan_paint(paint_color)
if(color_hex2num(paint_color) < 255)
set_opacity(255)
else
set_opacity(initial(opacity))
add_atom_colour(paint_color, WASHABLE_COLOUR_PRIORITY)
/obj/structure/window/proc/electrochromatic_dim()
if(electrochromatic_status == ELECTROCHROMATIC_DIMMED)
return
electrochromatic_status = ELECTROCHROMATIC_DIMMED
animate(src, color = "#222222", time = 2)
set_opacity(TRUE)
var/current = color
add_atom_colour("#222222", FIXED_COLOUR_PRIORITY)
var/newcolor = color
if(color != current)
color = current
animate(src, color = newcolor, time = 2)
/obj/structure/window/proc/electrochromatic_off()
if(electrochromatic_status == ELECTROCHROMATIC_OFF)
return
electrochromatic_status = ELECTROCHROMATIC_OFF
var/current = color
update_atom_colour()
remove_atom_colour(FIXED_COLOUR_PRIORITY, "#222222")
var/newcolor = color
color = current
animate(src, color = newcolor, time = 2)
if(color != current)
color = current
animate(src, color = newcolor, time = 2)
/obj/structure/window/proc/remove_electrochromatic()
electrochromatic_off()
@@ -348,11 +346,9 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
GLOB.electrochromatic_window_lookup[electrochromatic_id] |= src
/obj/structure/window/update_atom_colour()
if((electrochromatic_status != ELECTROCHROMATIC_OFF) && (electrochromatic_status != ELECTROCHROMATIC_DIMMED))
return FALSE
. = ..()
if(color && (color_hex2num(color) < 255))
set_opacity(255)
if(electrochromatic_status == ELECTROCHROMATIC_DIMMED || (color && (color_hex2num(color) < 255)))
set_opacity(TRUE)
else
set_opacity(FALSE)
@@ -397,20 +397,31 @@
escape_objective_possible = FALSE
break
var/changeling_objective = rand(1,3)
var/generic_absorb_objective = FALSE
var/multiple_lings = length(get_antag_minds(/datum/antagonist/changeling,TRUE)) > 1
switch(changeling_objective)
if(1)
var/datum/objective/absorb/absorb_objective = new
absorb_objective.owner = owner
absorb_objective.gen_amount_goal(6, 8)
objectives += absorb_objective
generic_absorb_objective = TRUE
if(2)
var/datum/objective/absorb_changeling/ac = new
ac.owner = owner
objectives += ac
if(multiple_lings)
var/datum/objective/absorb_changeling/ac = new
ac.owner = owner
objectives += ac
else
generic_absorb_objective = TRUE
if(3)
var/datum/objective/absorb_most/ac = new
ac.owner = owner
objectives += ac
if(multiple_lings)
var/datum/objective/absorb_most/ac = new
ac.owner = owner
objectives += ac
else
generic_absorb_objective = TRUE
if(generic_absorb_objective)
var/datum/objective/absorb/absorb_objective = new
absorb_objective.owner = owner
absorb_objective.gen_amount_goal(6, 8)
objectives += absorb_objective
if(prob(60))
if(prob(85))
@@ -1,7 +1,7 @@
/obj/effect/proc_holder/changeling/spiders
name = "Spread Infestation"
desc = "Our form divides, creating arachnids which will grow into deadly beasts."
helptext = "The spiders are thoughtless creatures, and may attack their creators when fully grown. Requires at least 3 DNA gained through Absorb, and not through DNA sting. This ability is very loud, and will guarantee that our blood will react violently to heat."
helptext = "The spiders are thoughtless creatures, and may attack their creators when fully grown. Requires to have gained 3 DNA through Absorb (regardless of current amount), and not through DNA sting. This ability is very loud, and will guarantee that our blood will react violently to heat."
chemical_cost = 45
dna_cost = 1
loudness = 4
@@ -81,7 +81,7 @@
to_chat(user, "<span class='notice'>There's no weapon to remove from the mechanism.</span>")
/obj/item/integrated_circuit/weaponized/weapon_firing/do_work()
if(!assembly || !installed_gun)
if(!assembly || !installed_gun || !installed_gun.can_shoot())
return
if(isliving(assembly.loc))
var/mob/living/L = assembly.loc
+1 -1
View File
@@ -338,7 +338,7 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA
set name = "Examine"
set category = "IC"
if(isturf(A) && !(sight & SEE_TURFS) && !(A in view(client ? client.view : world.view, src)))
if(isturf(A) && !(sight & SEE_TURFS) && !(src in viewers(client ? client.view : world.view, A)))
// shift-click catcher may issue examinate() calls for out-of-sight turfs
return
@@ -34,13 +34,6 @@
righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi'
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/premium)
/obj/item/gun/energy/kinetic_accelerator/premiumka/dropped(mob/user)
. = ..()
if(!QDELING(src) && !holds_charge)
// Put it on a delay because moving item from slot to hand
// calls dropped().
addtimer(CALLBACK(src, .proc/empty_if_not_held), 1.60)
/obj/item/ammo_casing/energy/kinetic/premium
projectile_type = /obj/item/projectile/kinetic/premium
@@ -151,7 +144,7 @@
addtimer(CALLBACK(src, .proc/empty_if_not_held), 2)
/obj/item/gun/energy/kinetic_accelerator/proc/empty_if_not_held()
if(!ismob(loc))
if(!ismob(loc) && !istype(loc, /obj/item/integrated_circuit))
empty()
/obj/item/gun/energy/kinetic_accelerator/proc/empty()
+1 -1
View File
@@ -24,10 +24,10 @@
var/list/tiers = list() //Assoc list, id = number, 1 is available, 2 is all reqs are 1, so on
/datum/techweb/New()
hidden_nodes = SSresearch.techweb_nodes_hidden.Copy()
for(var/i in SSresearch.techweb_nodes_starting)
var/datum/techweb_node/DN = SSresearch.techweb_node_by_id(i)
research_node(DN, TRUE, FALSE)
hidden_nodes = SSresearch.techweb_nodes_hidden.Copy()
return ..()
/datum/techweb/admin