From 8f6b31c26eceb03e0c0bfe77a29940dbc09c8282 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Fri, 26 Jun 2020 18:40:20 +0200
Subject: [PATCH] Solving several issues.
---
code/datums/looping_sounds/_looping_sound.dm | 12 +++++--
code/game/machinery/doors/door.dm | 2 +-
code/game/machinery/doors/windowdoor.dm | 26 +++++++++++----
code/game/objects/items/crayons.dm | 7 +---
.../objects/items/devices/radio/headset.dm | 3 ++
code/game/objects/structures/window.dm | 28 +++++++---------
.../antagonists/changeling/changeling.dm | 31 ++++++++++++------
.../antagonists/changeling/powers/spiders.dm | 2 +-
.../subtypes/weaponized.dm | 2 +-
code/modules/mob/mob.dm | 2 +-
.../guns/energy/kinetic_accelerator.dm | 9 +----
code/modules/research/techweb/_techweb.dm | 2 +-
icons/mob/robots.dmi | Bin 254536 -> 254534 bytes
13 files changed, 72 insertions(+), 54 deletions(-)
diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm
index bafb6fbf0e..f110d5e8ed 100644
--- a/code/datums/looping_sounds/_looping_sound.dm
+++ b/code/datums/looping_sounds/_looping_sound.dm
@@ -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)
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 1fb50e13c6..15f83fa268 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -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
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 492e90720c..f04b401a26 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -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)
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index a4ed8dedd1..fc98da2c0d 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -737,12 +737,7 @@
to_chat(usr, "A color that dark on an object like this? Surely not...")
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)
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index 5728a97dda..6ac2d310a1 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -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 "
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index e896f8072b..17031a51df 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -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)
diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm
index 35639bfd97..3267f2bdc1 100644
--- a/code/modules/antagonists/changeling/changeling.dm
+++ b/code/modules/antagonists/changeling/changeling.dm
@@ -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))
diff --git a/code/modules/antagonists/changeling/powers/spiders.dm b/code/modules/antagonists/changeling/powers/spiders.dm
index 6bd15fea92..63213afbea 100644
--- a/code/modules/antagonists/changeling/powers/spiders.dm
+++ b/code/modules/antagonists/changeling/powers/spiders.dm
@@ -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
diff --git a/code/modules/integrated_electronics/subtypes/weaponized.dm b/code/modules/integrated_electronics/subtypes/weaponized.dm
index 3123eeabbe..f7dea13052 100644
--- a/code/modules/integrated_electronics/subtypes/weaponized.dm
+++ b/code/modules/integrated_electronics/subtypes/weaponized.dm
@@ -81,7 +81,7 @@
to_chat(user, "There's no weapon to remove from the mechanism.")
/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
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index c5d2a34f89..56668a68f5 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -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
diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
index 49c069ca62..0c723199a1 100644
--- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
+++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
@@ -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()
diff --git a/code/modules/research/techweb/_techweb.dm b/code/modules/research/techweb/_techweb.dm
index 503bd8bae7..a0f0c651f0 100644
--- a/code/modules/research/techweb/_techweb.dm
+++ b/code/modules/research/techweb/_techweb.dm
@@ -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
diff --git a/icons/mob/robots.dmi b/icons/mob/robots.dmi
index 9bb41bf52798a8387bb5f82fb84fcf29de454d99..2bb8af7c61a853ad2e8774aee0b5cb10eeaf023e 100644
GIT binary patch
delta 1185
zcmV;S1YY~d#1F>A50E5(b$V1-bVOxyV{&P5bZKvH004NL&6-Vb+eQ$E&(g0TlB4Ce
zqNJob=u$W+3^eJXKY&=0LuwszM_5u4)L-8NsSnCr&bu;`6a);|csL*L%+4-1c^~}o
z`OoLC!PA%L>7Hz**#zrg`O9z9$w8;}CRhiHa5~wL&Np@QOI53Xnu2xkE}g%dPEu{F
zU>z){lgz4;s$d<=uaHni79tYMj$+wSj5vB=z!d^50LXI8^#ea77jiyGKBDA-L@-5i
zO_5wvIM;}aR3xcXd4KdDrjwKkbqvqc|P
zmg_j>gF(367NJ6a1X>`_5`k6-^Z|k50#fTE0u|&ac^6Z*6tRCO*;!p5#d2o_vz1fG
z3T7)8DJz(*T&ApGwsN7eg4xQY$_i#H7b`26tz3tywxqtviZq-oNyEvSG@L9-!^x^x
zDwQ^s<(O*`=KUjY$t1id8(hy&M!X0(QJJ3dmnk0-8OOK2{@&EVh}0
zTfXeOB}O+h!Z$mAMpQZl(l
z8=6e6(FG+OJlw~+&fAW_u(!oP|79*?6;-u=GO4oiUDpi{NOAi{+PPA5+!jM&UCs2B
zd!~aC`x$Gl4dC42TZWq#ytEpM>7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