-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into miscfix
- Loading branch information
Showing
37 changed files
with
738 additions
and
689 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/// Tucking element, for things that can be tucked into bed. | ||
/datum/element/bed_tuckable | ||
/// 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 many degrees we need to turn the item to get to the left/right side | ||
var/rotation_degree = 0 | ||
/// our starting angle for the item | ||
var/starting_angle = 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 | ||
starting_angle = rotation | ||
RegisterSignal(target, COMSIG_ITEM_ATTACK_OBJ, PROC_REF(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) | ||
SIGNAL_HANDLER | ||
|
||
if(!istype(target_bed)) | ||
return | ||
|
||
if(!tucker.transferItemToLoc(tucked, target_bed.drop_location())) | ||
return | ||
|
||
to_chat(tucker, span_notice("You lay [tucked] out on [target_bed].")) | ||
tucked.dir = target_bed.dir | ||
tucked.pixel_x = target_bed.dir & EAST ? -x_offset : x_offset | ||
tucked.pixel_y = y_offset | ||
tucked.layer = ABOVE_MOB_LAYER | ||
tucked.plane = -2 | ||
if(starting_angle) | ||
rotation_degree = target_bed.dir & EAST ? starting_angle + 180 : starting_angle | ||
tucked.transform = turn(tucked.transform, rotation_degree) | ||
RegisterSignal(tucked, COMSIG_ITEM_PICKUP, PROC_REF(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) | ||
SIGNAL_HANDLER | ||
|
||
tucked.transform = turn(tucked.transform, -rotation_degree) | ||
tucked.layer = initial(tucked.layer) | ||
tucked.plane = initial(tucked.plane) | ||
UnregisterSignal(tucked, COMSIG_ITEM_PICKUP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* | ||
CONTAINS: | ||
BEDSHEETS | ||
*/ | ||
|
||
/obj/item/bedsheet | ||
name = "bedsheet" | ||
desc = "" | ||
icon = 'icons/obj/bedsheets.dmi' | ||
lefthand_file = 'icons/mob/inhands/misc/bedsheet_lefthand.dmi' | ||
righthand_file = 'icons/mob/inhands/misc/bedsheet_righthand.dmi' | ||
icon_state = "sheetwhite" | ||
item_state = "sheetwhite" | ||
layer = OBJ_LAYER | ||
plane = GAME_PLANE_UPPER | ||
throwforce = 0 | ||
throw_speed = 1 | ||
throw_range = 2 | ||
w_class = WEIGHT_CLASS_TINY | ||
resistance_flags = FLAMMABLE | ||
dying_key = DYE_REGISTRY_BEDSHEET | ||
|
||
dog_fashion = /datum/dog_fashion/head/ghost | ||
var/list/dream_messages = list("white") | ||
var/datum/weakref/signal_sleeper //this is our goldylocks | ||
|
||
/obj/item/bedsheet/Initialize() | ||
. = ..() | ||
AddElement(/datum/element/bed_tuckable, 0, 0, 0) | ||
|
||
/obj/item/bedsheet/attack_self(mob/user) | ||
if(!user.CanReach(src)) //No telekenetic grabbing. | ||
return | ||
if(!user.dropItemToGround(src)) | ||
return | ||
coverup(user) | ||
add_fingerprint(user) | ||
|
||
/obj/item/bedsheet/proc/coverup(mob/living/sleeper) | ||
layer = ABOVE_MOB_LAYER | ||
plane = -2 | ||
pixel_x = 0 | ||
pixel_y = 0 | ||
to_chat(sleeper, span_notice("I cover myself with [src].")) | ||
var/angle = sleeper.lying_prev | ||
dir = angle2dir(angle + 180) // 180 flips it to be the same direction as the mob | ||
signal_sleeper = WEAKREF(sleeper) | ||
RegisterSignal(src, COMSIG_ITEM_PICKUP, PROC_REF(on_pickup)) | ||
RegisterSignal(sleeper, COMSIG_MOVABLE_MOVED, PROC_REF(smooth_sheets)) | ||
RegisterSignal(sleeper, COMSIG_LIVING_SET_RESTING, PROC_REF(smooth_sheets)) | ||
RegisterSignal(sleeper, COMSIG_PARENT_QDELETING, PROC_REF(smooth_sheets)) | ||
|
||
/obj/item/bedsheet/proc/smooth_sheets(mob/living/sleeper) | ||
SIGNAL_HANDLER | ||
UnregisterSignal(src, COMSIG_ITEM_PICKUP) | ||
UnregisterSignal(sleeper, COMSIG_MOVABLE_MOVED) | ||
UnregisterSignal(sleeper, COMSIG_LIVING_SET_RESTING) | ||
UnregisterSignal(sleeper, COMSIG_PARENT_QDELETING) | ||
to_chat(sleeper, span_notice("I smooth [src] out beneath you.")) | ||
layer = initial(layer) | ||
plane = initial(plane) | ||
signal_sleeper = null | ||
|
||
// We need to do this in case someone picks up a bedsheet while a mob is covered up | ||
// otherwise the bedsheet will disappear while in our hands if the sleeper signals get activated by moving | ||
/obj/item/bedsheet/proc/on_pickup(datum/source, mob/grabber) | ||
SIGNAL_HANDLER | ||
var/mob/living/sleeper = signal_sleeper?.resolve() | ||
UnregisterSignal(src, COMSIG_ITEM_PICKUP) | ||
UnregisterSignal(sleeper, COMSIG_MOVABLE_MOVED) | ||
UnregisterSignal(sleeper, COMSIG_LIVING_SET_RESTING) | ||
UnregisterSignal(sleeper, COMSIG_PARENT_QDELETING) | ||
signal_sleeper = null | ||
|
||
/obj/item/bedsheet/rogue/cloth | ||
desc = "" | ||
icon = 'icons/roguetown/misc/structure.dmi' | ||
icon_state = "cloth_bedsheet" | ||
item_state = "cloth_bedsheet" | ||
pixel_y = 5 | ||
|
||
/obj/item/bedsheet/rogue/pelt | ||
desc = "" | ||
icon = 'icons/roguetown/misc/structure.dmi' | ||
icon_state = "pelt_bedsheet" | ||
item_state = "pelt_bedsheet" | ||
pixel_y = 5 | ||
|
||
/obj/item/bedsheet/rogue/wool | ||
desc = "" | ||
icon = 'icons/roguetown/misc/structure.dmi' | ||
icon_state = "wool_bedsheet" | ||
item_state = "wool_bedsheet" | ||
pixel_y = 5 | ||
|
||
/obj/item/bedsheet/rogue/double_pelt | ||
desc = "" | ||
icon = 'icons/roguetown/misc/structure.dmi' | ||
icon_state = "double_pelt_bedsheet" | ||
item_state = "double_pelt_bedsheet" | ||
|
||
/obj/item/bedsheet/rogue/fabric | ||
desc = "" | ||
icon = 'icons/roguetown/misc/structure.dmi' | ||
icon_state = "fabric_bedsheet" | ||
item_state = "fabric_bedsheet" | ||
pixel_y = 5 | ||
|
||
/obj/item/bedsheet/rogue/fabric_double | ||
desc = "" | ||
icon = 'icons/roguetown/misc/structure.dmi' | ||
icon_state = "double_fabric_bedsheet" | ||
item_state = "double_fabric_bedsheet" | ||
|
||
/obj/item/bedsheet/random | ||
icon_state = "random_bedsheet" | ||
name = "random bedsheet" | ||
desc = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.