Merge branch 'pr/14'

This commit is contained in:
Fermi
2019-06-14 21:29:04 +01:00
506 changed files with 10079 additions and 6600 deletions
+2 -2
View File
@@ -24,7 +24,7 @@
if(ishuman(AM))
var/mob/living/carbon/human/H = AM
if(H.has_trait(TRAIT_PIERCEIMMUNE))
if(HAS_TRAIT(H, TRAIT_PIERCEIMMUNE))
return
if((flags & CALTROP_IGNORE_WALKERS) && H.m_intent == MOVE_INTENT_WALK)
@@ -46,7 +46,7 @@
return
var/damage = rand(min_damage, max_damage)
if(H.has_trait(TRAIT_LIGHT_STEP))
if(HAS_TRAIT(H, TRAIT_LIGHT_STEP))
damage *= 0.75
H.apply_damage(damage, BRUTE, picked_def_zone)
+1 -1
View File
@@ -23,7 +23,7 @@
if (!wearer)
STOP_PROCESSING(SSobj, src)
return
if(!wearer.has_trait(TRAIT_DEAF))
if(!HAS_TRAIT(wearer, TRAIT_DEAF))
var/obj/item/organ/ears/ears = wearer.getorganslot(ORGAN_SLOT_EARS)
if (ears)
ears.deaf = max(ears.deaf - 1, (ears.ear_damage < UNHEALING_EAR_DAMAGE ? 0 : 1)) // Do not clear deafness while above the unhealing ear damage threshold
+2 -2
View File
@@ -153,11 +153,11 @@
else
owner.crit_threshold -= (holdmyinsanityeffect - insanity_effect)
if(owner.has_trait(TRAIT_DEPRESSION))
if(HAS_TRAIT(owner, TRAIT_DEPRESSION))
if(prob(0.05))
add_event(null, "depression", /datum/mood_event/depression)
clear_event(null, "jolly")
if(owner.has_trait(TRAIT_JOLLY))
if(HAS_TRAIT(owner, TRAIT_JOLLY))
if(prob(0.05))
add_event(null, "jolly", /datum/mood_event/jolly)
clear_event(null, "depression")
@@ -6,6 +6,8 @@
/datum/component/storage/concrete
var/drop_all_on_deconstruct = TRUE
var/drop_all_on_destroy = FALSE
var/drop_all_on_break = FALSE
var/unlock_on_break = FALSE
var/transfer_contents_on_component_transfer = FALSE
var/list/datum/component/storage/slaves = list()
@@ -16,6 +18,7 @@
. = ..()
RegisterSignal(parent, COMSIG_ATOM_CONTENTS_DEL, .proc/on_contents_del)
RegisterSignal(parent, COMSIG_OBJ_DECONSTRUCT, .proc/on_deconstruct)
RegisterSignal(parent, COMSIG_OBJ_BREAK, .proc/on_break)
/datum/component/storage/concrete/Destroy()
var/atom/real_location = real_location()
@@ -100,6 +103,12 @@
if(drop_all_on_deconstruct)
do_quick_empty()
/datum/component/storage/concrete/proc/on_break(datum/source, damage_flag)
if(drop_all_on_break)
do_quick_empty()
if(unlock_on_break)
set_locked(source, FALSE)
/datum/component/storage/concrete/can_see_contents()
. = ..()
for(var/i in slaves)
@@ -0,0 +1,22 @@
/datum/component/storage/concrete/emergency
drop_all_on_break = TRUE
unlock_on_break = TRUE
locked = TRUE
/datum/component/storage/concrete/emergency/Initialize()
. = ..()
RegisterSignal(parent, COMSIG_ATOM_EMAG_ACT, .proc/unlock_me)
/datum/component/storage/concrete/emergency/signal_insertion_attempt(datum/source, obj/item/I, mob/M, silent = FALSE, force = FALSE)
if(!silent && istype(I, /obj/item/card/emag))
silent = TRUE // suppresses the message
return ..()
/datum/component/storage/concrete/check_locked(datum/source, mob/user, message = FALSE)
. = locked && GLOB.security_level < SEC_LEVEL_RED
if(message && . && user)
to_chat(user, "The storage unit will only unlock during a Red or Delta security alert.")
/datum/component/storage/concrete/emergency/proc/unlock_me(datum/source)
if(locked)
set_locked(source, FALSE)
+12 -18
View File
@@ -156,8 +156,7 @@
next += slave.parent
/datum/component/storage/proc/attack_self(datum/source, mob/M)
if(locked)
to_chat(M, "<span class='warning'>[parent] seems to be locked!</span>")
if(check_locked(source, M, TRUE))
return FALSE
if((M.get_active_held_item() == parent) && allow_quick_empty)
quick_empty(M)
@@ -166,8 +165,7 @@
if(!isitem(O) || !click_gather || SEND_SIGNAL(O, COMSIG_CONTAINS_STORAGE))
return FALSE
. = COMPONENT_NO_ATTACK
if(locked)
to_chat(M, "<span class='warning'>[parent] seems to be locked!</span>")
if(check_locked(source, M, TRUE))
return FALSE
var/atom/A = parent
var/obj/item/I = O
@@ -238,8 +236,7 @@
var/atom/A = parent
if((!ishuman(M) && (A.loc != M)) || (M.stat != CONSCIOUS) || M.restrained() || !M.canmove)
return
if(locked)
to_chat(M, "<span class='warning'>[parent] seems to be locked!</span>")
if(check_locked(null, M, TRUE))
return FALSE
A.add_fingerprint(M)
to_chat(M, "<span class='notice'>You start dumping out [parent].</span>")
@@ -281,7 +278,7 @@
/datum/component/storage/proc/set_locked(datum/source, new_state)
locked = new_state
if(locked)
if(check_locked())
close_all()
/datum/component/storage/proc/_process_numerical_display()
@@ -456,8 +453,7 @@
var/atom/A = parent
var/atom/dump_destination = dest_object.get_dumping_location()
if(A.Adjacent(M) && dump_destination && M.Adjacent(dump_destination))
if(locked)
to_chat(M, "<span class='warning'>[parent] seems to be locked!</span>")
if(check_locked(null, M, TRUE))
return FALSE
if(dump_destination.storage_contents_dump_act(src, M))
playsound(A, "rustle", 50, 1, -5)
@@ -563,10 +559,9 @@
var/atom/host = parent
if(real_location == I.loc)
return FALSE //Means the item is already in the storage item
if(locked)
if(check_locked(null, M, !stop_messages))
if(M && !stop_messages)
host.add_fingerprint(M)
to_chat(M, "<span class='warning'>[host] seems to be locked!</span>")
return FALSE
if(real_location.contents.len >= max_items)
if(!stop_messages)
@@ -659,8 +654,10 @@
/datum/component/storage/proc/on_check()
return TRUE
/datum/component/storage/proc/check_locked()
return locked
/datum/component/storage/proc/check_locked(datum/source, mob/user, message = FALSE)
. = locked
if(message && . && user)
to_chat(user, "<span class='warning'>[parent] seems to be locked!</span>")
/datum/component/storage/proc/signal_take_type(datum/source, type, atom/destination, amount = INFINITY, check_adjacent = FALSE, force = FALSE, mob/user, list/inserted)
if(!force)
@@ -720,9 +717,7 @@
if(A.loc == user)
. = COMPONENT_NO_ATTACK_HAND
if(locked)
to_chat(user, "<span class='warning'>[parent] seems to be locked!</span>")
else
if(!check_locked(source, user, TRUE))
show_to(user)
A.do_jiggle()
@@ -747,8 +742,7 @@
/datum/component/storage/proc/on_alt_click(datum/source, mob/user)
if(!isliving(user) || !user.CanReach(parent))
return
if(locked)
to_chat(user, "<span class='warning'>[parent] seems to be locked!</span>")
if(check_locked(source, user, TRUE))
return
var/atom/A = parent