-
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 crates (#4868)
# About the pull request <!-- Remove this text and explain what the purpose of your PR is. Mention if you have tested your changes. If you changed a map, make sure you used the mapmerge tool. If this is an Issue Correction, you can type "Fixes Issue #169420" to link the PR to the corresponding Issue number #169420. Remember: something that is self-evident to you might not be to others. Explain your rationale fully, even if you feel it goes without saying. --> You can now customize non-secure crates using packaging wrap, by tagging them and changing their appearance to a list of common crates. The tag works as a labeler label, and is also displayed in the overwatch supply drop alert. # Explain why it's good for the game If anything, it's that these Squad crates are just sitting there unused. I don't know if this feature will be used much by live Reqs. # Changelog :cl: add: You can now use package wrap to change standard crates visuals. add: You can now label crate with package wrap, which will also be shown during overwatch supply drop alert. mapadd: Added more packaging wrap to Requisitions. /:cl:
- Loading branch information
Showing
9 changed files
with
124 additions
and
39 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,36 @@ | ||
/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 | ||
|
||
/// Handler to notify an overwatched squad that this crate has been dropped for them | ||
/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,32 @@ | ||
/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 | ||
/// The contained parimary object, used as a replacer for the droppod icon | ||
var/obj/structure/package | ||
|
||
/obj/structure/droppod/supply/Initialize(mapload, obj/structure/package) | ||
. = ..() | ||
if(!istype(package)) | ||
return INITIALIZE_HINT_QDEL | ||
package.forceMove(src) | ||
src.package = package | ||
|
||
/obj/structure/droppod/supply/Destroy(force) | ||
package = null | ||
return ..() | ||
|
||
/* 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