Merge branch 'master' of https://github.com/raspy-on-osu/Citadel-Station-13 into ventcrawl-refactor

This commit is contained in:
raspy-on-osu
2021-01-24 19:21:24 -05:00
888 changed files with 17584 additions and 11569 deletions
+60
View File
@@ -0,0 +1,60 @@
/// Tucking element, for things that can be tucked into bed.
/datum/element/bed_tuckable
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH
id_arg_index = 2
/// our pixel_x offset - how much the item moves x when in bed (+x is closer to the pillow)
var/x_offset = 0
/// our pixel_y offset - how much the item move y when in bed (-y is closer to the middle)
var/y_offset = 0
/// our rotation degree - how much the item turns when in bed (+degrees turns it more parallel)
var/rotation_degree = 0
/datum/element/bed_tuckable/Attach(obj/target, x = 0, y = 0, rotation = 0)
. = ..()
if(!isitem(target))
return ELEMENT_INCOMPATIBLE
x_offset = x
y_offset = y
rotation_degree = rotation
RegisterSignal(target, COMSIG_ITEM_ATTACK_OBJ, .proc/tuck_into_bed)
/datum/element/bed_tuckable/Detach(obj/target)
. = ..()
UnregisterSignal(target, list(COMSIG_ITEM_ATTACK_OBJ, COMSIG_ITEM_PICKUP))
/**
* Tuck our object into bed.
*
* tucked - the object being tucked
* target_bed - the bed we're tucking them into
* tucker - the guy doing the tucking
*/
/datum/element/bed_tuckable/proc/tuck_into_bed(obj/item/tucked, obj/structure/bed/target_bed, mob/living/tucker)
if(!istype(target_bed))
return
if(!tucker.transferItemToLoc(tucked, target_bed.drop_location()))
return
to_chat(tucker, "<span class='notice'>You lay [tucked] out on [target_bed].</span>")
tucked.pixel_x = x_offset
tucked.pixel_y = y_offset
if(rotation_degree)
tucked.transform = turn(tucked.transform, rotation_degree)
RegisterSignal(tucked, COMSIG_ITEM_PICKUP, .proc/untuck)
return COMPONENT_NO_AFTERATTACK
/**
* If we rotate our object, then we need to un-rotate it when it's picked up
*
* tucked - the object that is tucked
*/
/datum/element/bed_tuckable/proc/untuck(obj/item/tucked)
tucked.transform = turn(tucked.transform, -rotation_degree)
UnregisterSignal(tucked, COMSIG_ITEM_PICKUP)
+38 -2
View File
@@ -13,6 +13,8 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
var/save_key
/// Do not attempt to render a preview on examine. If this is on, it will display as \[flavor_name\]
var/examine_no_preview = FALSE
/// Examine FULLY views. Overrides examine_no_preview
var/examine_full_view = FALSE
/datum/element/flavor_text/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE, _save_key, _examine_no_preview = FALSE)
. = ..()
@@ -37,7 +39,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
if(can_edit && ismob(target)) //but only mobs receive the proc/verb for the time being
var/mob/M = target
LAZYOR(GLOB.mobs_with_editable_flavor_text[M], src)
M.verbs |= /mob/proc/manage_flavor_tests
add_verb(M, /mob/proc/manage_flavor_tests)
if(save_key && ishuman(target))
RegisterSignal(target, COMSIG_HUMAN_PREFS_COPIED_TO, .proc/update_prefs_flavor_text)
@@ -71,6 +73,9 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
examine_list += "<span class='notice'><a href='?src=[REF(src)];show_flavor=[REF(target)]'>\[[flavor_name]\]</a></span>"
return
var/msg = replacetext(text, "\n", " ")
if(examine_full_view)
examine_list += "[msg]"
return
if(length_char(msg) <= 40)
examine_list += "<span class='notice'>[msg]</span>"
else
@@ -113,6 +118,21 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
var/datum/element/flavor_text/F = choices[chosen]
F.set_flavor(src)
/mob/proc/set_pose()
set name = "Set Pose"
set desc = "Sets your temporary flavor text"
set category = "IC"
var/list/L = GLOB.mobs_with_editable_flavor_text[src]
var/datum/element/flavor_text/carbon/temporary/T
for(var/i in L)
if(istype(i, /datum/element/flavor_text/carbon/temporary))
T = i
if(!T)
to_chat(src, "<span class='warning'>Your mob type does not support temporary flavor text.</span>")
return
T.set_flavor(src)
/datum/element/flavor_text/proc/set_flavor(mob/user)
if(!(user in texts_by_atom))
return FALSE
@@ -135,7 +155,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
var/static/list/i_dont_even_know_who_you_are = typecacheof(list(/datum/antagonist/abductor, /datum/antagonist/ert,
/datum/antagonist/nukeop, /datum/antagonist/wizard))
/datum/element/flavor_text/carbon/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE, _save_key = "flavor_text", _examine_no_preview = FALSE)
/datum/element/flavor_text/carbon/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE, _save_key, _examine_no_preview = FALSE)
if(!iscarbon(target))
return ELEMENT_INCOMPATIBLE
. = ..()
@@ -167,3 +187,19 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
texts_by_atom[user] = ""
if(user.dna)
user.dna.features[save_key] = ""
/datum/element/flavor_text/carbon/temporary
examine_full_view = TRUE
max_len = 1024
/datum/element/flavor_text/carbon/temporary/Attach(datum/target, text, _name, _addendum, _max_len, _always_show, _edit, _save_key, _examine_no_preview)
. = ..()
if(. & ELEMENT_INCOMPATIBLE)
return
if(ismob(target))
add_verb(target, /mob/proc/set_pose)
/datum/element/flavor_Text/carbon/temporary/Detach(datum/source, force)
. = ..()
if(ismob(source))
remove_verb(source, /mob/proc/set_pose)
+9
View File
@@ -165,6 +165,15 @@
/datum/element/polychromic/proc/on_examine(atom/source, mob/user, list/examine_list)
examine_list += "<span class='notice'>Alt-click to recolor it.</span>"
/datum/element/polychromic/proc/connect_helmet(atom/I, var/applycolor)
if(isitem(I))
if(istype(I,/obj/item/clothing/suit/hooded))
var/obj/item/clothing/suit/hooded/Isuit = I
colors_by_atom[Isuit.hood] = applycolor
else if(istype(I,/obj/item/clothing/suit/space/hardsuit))
var/obj/item/clothing/suit/space/hardsuit/Isuit = I
colors_by_atom[Isuit.helmet] = applycolor
/datum/element/polychromic/proc/register_helmet(atom/source, obj/item/clothing/head/H)
if(!isitem(H)) //backup in case if it messes up somehow
if(istype(source,/obj/item/clothing/suit/hooded)) //so how come it be like this, where toggleable headslots are named separately (helmet/hood) anyways?