Allows modsuits to be set to wear on other slots. (#66667)

Allows for MODsuit control units to be worn on slots that isn't the bag slot and actually work.
So far no MODsuits will actually use this, but I would like to add one in the future, I'm just not motivated to do the MODsuit itself, so I'm adding the support for it at least to see if it would be approved.

Lawyer tie modsuit will be real in 2023.

This doesn't really change the game much so I don't know how much I actually have to explain here.
This commit is contained in:
John Willard
2022-05-06 00:53:10 -07:00
committed by GitHub
parent a237baafa1
commit 8c90eb87b4
8 changed files with 19 additions and 17 deletions
+2 -2
View File
@@ -116,7 +116,7 @@
/obj/item/mod/control/proc/toggle_activate(mob/user, force_deactivate = FALSE)
if(!wearer)
if(!force_deactivate)
balloon_alert(user, "put suit on back!")
balloon_alert(user, "equip suit first!")
playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
return FALSE
if(!force_deactivate && (SEND_SIGNAL(src, COMSIG_MOD_ACTIVATE, user) & MOD_CANCEL_ACTIVATE))
@@ -226,7 +226,7 @@
STOP_PROCESSING(SSobj, src)
update_speed()
update_icon_state()
wearer.update_inv_back()
wearer.update_clothing(slot_flags)
/// Quickly deploys all the suit parts and if successful, seals them and turns on the suit. Intended mostly for outfits.
/obj/item/mod/control/proc/quick_activation()
+6 -4
View File
@@ -7,7 +7,7 @@
/obj/item/mod/control
name = "MOD control unit"
desc = "The control unit of a Modular Outerwear Device, a powered, back-mounted suit that protects against various environments."
desc = "The control unit of a Modular Outerwear Device, a powered suit that protects against various environments."
icon_state = "control"
inhand_icon_state = "mod_control"
w_class = WEIGHT_CLASS_BULKY
@@ -98,6 +98,7 @@
if(new_theme)
theme = new_theme
theme = GLOB.mod_themes[theme]
slot_flags = theme.slot_flags
extended_desc = theme.extended_desc
slowdown_inactive = theme.slowdown_inactive
slowdown_active = theme.slowdown_active
@@ -200,7 +201,8 @@
. += span_notice("Charge: [core ? "[get_charge_percent()]%" : "No core"].")
. += span_notice("Selected module: [selected_module || "None"].")
if(!open && !active)
. += span_notice("You could put it on your <b>back</b> to turn it on.")
if(!wearer)
. += span_notice("You could equip it to turn it on.")
. += span_notice("You could open the cover with a <b>screwdriver</b>.")
else if(open)
. += span_notice("You could close the cover with a <b>screwdriver</b>.")
@@ -239,7 +241,7 @@
/obj/item/mod/control/equipped(mob/user, slot)
..()
if(slot == ITEM_SLOT_BACK)
if(slot == slot_flags)
set_wearer(user)
else if(wearer)
unset_wearer()
@@ -250,7 +252,7 @@
unset_wearer()
/obj/item/mod/control/item_action_slot_check(slot)
if(slot == ITEM_SLOT_BACK)
if(slot == slot_flags)
return TRUE
/obj/item/mod/control/Moved(atom/old_loc, movement_dir, forced = FALSE, list/old_locs)
+2
View File
@@ -19,6 +19,8 @@
armor plating being installed by default, and their actuators only lead to slightly greater speed than industrial suits."
/// Default skin of the MOD.
var/default_skin = "standard"
/// The slot this mod theme fits on
var/slot_flags = ITEM_SLOT_BACK
/// Armor shared across the MOD parts.
var/armor = list(MELEE = 10, BULLET = 5, LASER = 5, ENERGY = 5, BOMB = 0, BIO = 100, FIRE = 25, ACID = 25, WOUND = 5)
/// Resistance flags shared across the MOD parts.
+4 -4
View File
@@ -140,7 +140,7 @@
balloon_alert(mod.wearer, "[src] activated, [used_button]-click to use")
active = TRUE
COOLDOWN_START(src, cooldown_timer, cooldown_time)
mod.wearer.update_inv_back()
mod.wearer.update_clothing(mod.slot_flags)
SEND_SIGNAL(src, COMSIG_MODULE_ACTIVATED)
return TRUE
@@ -158,7 +158,7 @@
else
UnregisterSignal(mod.wearer, used_signal)
used_signal = null
mod.wearer.update_inv_back()
mod.wearer.update_clothing(mod.slot_flags)
SEND_SIGNAL(src, COMSIG_MODULE_DEACTIVATED)
return TRUE
@@ -177,8 +177,8 @@
if(SEND_SIGNAL(src, COMSIG_MODULE_TRIGGERED) & MOD_ABORT_USE)
return FALSE
COOLDOWN_START(src, cooldown_timer, cooldown_time)
addtimer(CALLBACK(mod.wearer, /mob.proc/update_inv_back), cooldown_time+1) //need to run it a bit after the cooldown starts to avoid conflicts
mod.wearer.update_inv_back()
addtimer(CALLBACK(mod.wearer, /mob.proc/update_clothing, mod.slot_flags), cooldown_time+1) //need to run it a bit after the cooldown starts to avoid conflicts
mod.wearer.update_clothing(mod.slot_flags)
SEND_SIGNAL(src, COMSIG_MODULE_USED)
return TRUE
@@ -6,7 +6,7 @@
very control unit of the suit, allowing it flight at highway speeds, \
and to be able to locate the second part of the system; \
a pathfinding implant installed into the base of the user's spine, \
broadcasting their location to the suit and allowing them to recall it to their back at any time. \
broadcasting their location to the suit and allowing them to recall it to their person at any time. \
The implant is stored in the module and needs to be injected in a human to function. \
Nakamura Engineering swears up and down there's airbrakes."
icon_state = "pathfinder"
+3 -3
View File
@@ -295,7 +295,7 @@
balloon_alert(mod.wearer, "too dark!")
return
set_light_color(value)
mod.wearer.update_inv_back()
mod.wearer.update_clothing(mod.slot_flags)
if("light_range")
set_light_range(clamp(value, min_range, max_range))
@@ -565,7 +565,7 @@
if(mod.wearer.transferItemToLoc(hitting_item, src, force = FALSE, silent = TRUE))
attached_hat = hitting_item
balloon_alert(user, "hat attached, right-click to remove")
mod.wearer.update_inv_back()
mod.wearer.update_clothing(mod.slot_flags)
/obj/item/mod/module/hat_stabilizer/generate_worn_overlay()
. = ..()
@@ -583,7 +583,7 @@
else
balloon_alert_to_viewers("the hat falls to the floor!")
attached_hat = null
mod.wearer.update_inv_back()
mod.wearer.update_clothing(mod.slot_flags)
///Sign Language Translator - allows people to sign over comms using the modsuit's gloves.
/obj/item/mod/module/signlang_radio
+1 -1
View File
@@ -127,7 +127,7 @@
rave_number++
if(rave_number > length(rainbow_order))
rave_number = 1
mod.wearer.update_inv_back()
mod.wearer.update_clothing(mod.slot_flags)
rave_screen.update_colour(rainbow_order[rave_number])
/obj/item/mod/module/visor/rave/get_configuration()
@@ -64,7 +64,6 @@
picked_crate.forceMove(src)
balloon_alert(mod.wearer, "picked up [picked_crate]")
drain_power(use_power_cost)
mod.wearer.update_inv_back()
else if(length(stored_crates))
var/turf/target_turf = get_turf(target)
if(target_turf.is_blocked_turf())
@@ -79,7 +78,6 @@
dropped_crate.forceMove(target_turf)
balloon_alert(mod.wearer, "dropped [dropped_crate]")
drain_power(use_power_cost)
mod.wearer.update_inv_back()
else
balloon_alert(mod.wearer, "invalid target!")