-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds possibility to customize req crates
- Loading branch information
Showing
9 changed files
with
107 additions
and
24 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,35 @@ | ||
/datum/component/crate_tag | ||
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS | ||
/// The crate tag used for notifications and as label | ||
var/name | ||
|
||
/datum/component/crate_tag/Initialize(name, obj/structure/closet/crate/masquarade_type) | ||
var/obj/structure/closet/crate/crate = parent | ||
if(!istype(crate)) | ||
return COMPONENT_INCOMPATIBLE | ||
setup(name, masquarade_type) | ||
RegisterSignal(parent, COMSIG_STRUCTURE_CRATE_SQUAD_LAUNCHED, PROC_REF(notify_squad)) | ||
|
||
/datum/component/crate_tag/InheritComponent(datum/component/C, i_am_original, name, obj/structure/closet/crate/masquarade_type) | ||
. = ..() | ||
setup(name, masquarade_type) | ||
|
||
/datum/component/crate_tag/proc/setup(name, obj/structure/closet/crate/masquarade_type) | ||
var/obj/structure/closet/crate/crate = parent | ||
if(masquarade_type) | ||
crate.name = initial(masquarade_type.name) | ||
crate.desc = initial(masquarade_type.desc) | ||
crate.icon_opened = initial(masquarade_type.icon_opened) | ||
crate.icon_closed = initial(masquarade_type.icon_closed) | ||
if(crate.opened) | ||
crate.icon_state = crate.icon_opened | ||
else | ||
crate.icon_state = crate.icon_closed | ||
if(name) | ||
parent.AddComponent(/datum/component/label, name) | ||
src.name = name // Keep it around additionally for notifications | ||
|
||
/datum/component/crate_tag/proc/notify_squad(datum/source, datum/squad/squad) | ||
SIGNAL_HANDLER | ||
squad.send_message("'[name]' supply drop incoming. Heads up!") | ||
squad.send_maptext(name, "Incoming Supply Drop:") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
/obj/structure/droppod/supply | ||
name = "\improper USCM requisitions droppod" | ||
name = "\improper USCM requisitions package" | ||
drop_time = 10 SECONDS | ||
dropping_time = 2 SECONDS | ||
open_time = 2 SECONDS | ||
var/obj/structure/package | ||
|
||
/obj/structure/droppod/supply/Initialize(mapload, obj/structure/closet/crate/package) | ||
. = ..() | ||
if(!istype(package)) | ||
return INITIALIZE_HINT_QDEL | ||
package.forceMove(src) | ||
src.package = package | ||
|
||
/obj/structure/droppod/supply/Destroy() | ||
. = ..() | ||
package = null | ||
|
||
/* Pose as the crate so we see it falling from the skies */ | ||
/obj/structure/droppod/supply/update_icon() | ||
. = ..() | ||
icon = package.icon | ||
icon_state = package.icon_state | ||
|
||
/obj/structure/droppod/supply/open() | ||
. = ..() | ||
for(var/atom/movable/content as anything in contents) | ||
///Crates are anchored when launched to avoid pushing them while launching and this created issues with them being anchored when they landed groundside. | ||
///This unanchors them before moving them out to make sure that crates are able to be moved when groundside. | ||
if(istype(content, /obj/structure/closet/crate)) | ||
content.anchored = FALSE | ||
content.forceMove(loc) | ||
package = null | ||
qdel(src) | ||
|
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