Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MODsuits can now be activated when undeployed. Deployment is per-part, and modules can be used when their respective mount is deployed #549

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions code/modules/mod/mod_activation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
var/obj/item/part = locate(part_reference) in mod_parts
if(!istype(part) || user.incapacitated())
return
if((active || activating) && !(part == helmet && helmet_desync)) // NON-MODULE CHANGE: Allows the helmet desynchronizer to work by adding in a check for a new var.
/* NON-MODULE CHANGE - Suits can be retracted or deployed when active
if((active || activating))
balloon_alert(user, "deactivate the suit first!")
playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
return
*/
var/parts_to_check = mod_parts - part
if(part.loc == src)
deploy(user, part)
Expand All @@ -43,8 +45,10 @@

/// Quickly deploys all parts (or retracts if all are on the wearer)
/obj/item/mod/control/proc/quick_deploy(mob/user)
if(active || activating)
balloon_alert(user, "deactivate the suit first!")
// NON-MODULE CHANGE START - Suits can be deployed/retracted when active
if(activating)
balloon_alert(user, "suit still activating!")
//NON-MODULE CHANGE END
playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
return FALSE
var/deploy = TRUE
Expand Down Expand Up @@ -132,11 +136,15 @@
if(!force_deactivate && (SEND_SIGNAL(src, COMSIG_MOD_ACTIVATE, user) & MOD_CANCEL_ACTIVATE))
playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
return FALSE
// NON-MODULE CHANGE START - Suits can be deployed/retracted while active
/*
for(var/obj/item/part as anything in mod_parts)
if(!force_deactivate && part.loc == src)
if(!force_deactivate && part.loc == src)
balloon_alert(user, "deploy all parts first!")
playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
return FALSE
*/
// NON-MODULE CHANGE END
if(locked && !active && !allowed(user) && !force_deactivate)
balloon_alert(user, "access insufficient!")
playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
Expand Down Expand Up @@ -164,19 +172,23 @@
if (ai_assistant)
to_chat(ai_assistant, span_notice("MODsuit [active ? "shutting down" : "starting up"]."))
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
to_chat(wearer, span_notice("[boots] [active ? "relax their grip on your legs" : "seal around your feet"]."))
if (boots.loc == wearer) // NON-MODULE CHANGE
to_chat(wearer, span_notice("[boots] [active ? "relax their grip on your legs" : "seal around your feet"]."))
playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
seal_part(boots, seal = !active)
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
to_chat(wearer, span_notice("[gauntlets] [active ? "become loose around your fingers" : "tighten around your fingers and wrists"]."))
if (gauntlets.loc == wearer) // NON-MODULE CHANGE
to_chat(wearer, span_notice("[gauntlets] [active ? "become loose around your fingers" : "tighten around your fingers and wrists"]."))
playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
seal_part(gauntlets, seal = !active)
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
to_chat(wearer, span_notice("[chestplate] [active ? "releases your chest" : "cinches tightly against your chest"]."))
if (chestplate.loc == wearer) // NON-MODULE CHANGE
to_chat(wearer, span_notice("[chestplate] [active ? "releases your chest" : "cinches tightly against your chest"]."))
playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
seal_part(chestplate, seal = !active)
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
to_chat(wearer, span_notice("[helmet] hisses [active ? "open" : "closed"]."))
if (helmet.loc == wearer) // NON-MODULE CHANGE
to_chat(wearer, span_notice("[helmet] hisses [active ? "open" : "closed"]."))
playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
seal_part(helmet, seal = !active)
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
Expand Down Expand Up @@ -233,7 +245,10 @@
active = on
if(active)
for(var/obj/item/mod/module/module as anything in modules)
module.on_suit_activation()
// NON-MODULE CHANGE START
if (module.module_deployed())
module.on_suit_activation()
// NON-MODULE CHANGE END
else
for(var/obj/item/mod/module/module as anything in modules)
module.on_suit_deactivation()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mod/mod_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
new_module.on_install()
if(wearer)
new_module.on_equip()
if(active)
if(active && new_module.module_deployed()) // NON-MODULE CHANGE
new_module.on_suit_activation()
if(user)
balloon_alert(user, "[new_module] added")
Expand Down
10 changes: 10 additions & 0 deletions code/modules/mod/modules/_module.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
if(mod.wearer)
balloon_alert(mod.wearer, "not active!")
return
// NON-MODULE CHANGE START
if (!module_deployed())
balloon_alert(mod.wearer, "mount not deployed!")
return FALSE
// NON-MODULE CHANGE END
if(module_type != MODULE_USABLE)
if(active)
on_deactivation()
Expand All @@ -99,6 +104,11 @@
if(!mod.active || mod.activating || !mod.get_charge())
balloon_alert(mod.wearer, "unpowered!")
return FALSE
// NON-MODULE CHANGE START
if (!module_deployed())
balloon_alert(mod.wearer, "mount not deployed!")
return FALSE
// NON-MODULE CHANGE END
if(!(allow_flags & MODULE_ALLOW_PHASEOUT) && istype(mod.wearer.loc, /obj/effect/dummy/phased_mob))
//specifically a to_chat because the user is phased out.
to_chat(mod.wearer, span_warning("You cannot activate this right now."))
Expand Down
11 changes: 10 additions & 1 deletion maplestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6440,7 +6440,17 @@
#include "maplestation_modules\code\modules\mob\living\simple_animal\corpse.dm"
#include "maplestation_modules\code\modules\mob\living\simple_animal\noble_cat.dm"
#include "maplestation_modules\code\modules\mod\mod_control.dm"
#include "maplestation_modules\code\modules\mod\modules\module.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_antag.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_engineering.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_general.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_maint.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_medical.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_ninja.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_science.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_security.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_service.dm"
#include "maplestation_modules\code\modules\mod\modules\modules_supply.dm"
#include "maplestation_modules\code\modules\movespeed\modifiers\reagent.dm"
#include "maplestation_modules\code\modules\paperwork\stamps.dm"
#include "maplestation_modules\code\modules\pixel_shift\code\pixel_shift_component.dm"
Expand All @@ -6463,7 +6473,6 @@
#include "maplestation_modules\code\modules\recycling\holder.dm"
#include "maplestation_modules\code\modules\research\designs\autolathe_designs.dm"
#include "maplestation_modules\code\modules\research\designs\mecha_designs.dm"
#include "maplestation_modules\code\modules\research\designs\mechfabricator_designs.dm"
#include "maplestation_modules\code\modules\research\designs\medical_designs.dm"
#include "maplestation_modules\code\modules\research\designs\wiremod_designs.dm"
#include "maplestation_modules\code\modules\research\machinery\_production.dm"
Expand Down
36 changes: 33 additions & 3 deletions maplestation_modules/code/modules/mod/mod_control.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
/obj/item/mod/control
/datum/mod_theme
activation_step_time = 1 SECONDS
///Allows concealing the helmet when the suit is activated if true.
var/helmet_desync = FALSE

/obj/item/mod/control/update_speed()
var/list/all_parts = mod_parts + src
if (gauntlets)
all_parts -= gauntlets
if (helmet)
all_parts -= helmet
for(var/obj/item/part as anything in all_parts)
part.slowdown = (active ? slowdown_active : 0) / length(all_parts)
wearer?.update_equipment_speed_mods()

/obj/item/mod/control/deploy(mob/user, obj/item/part)
. = ..()
if (!active)
return
for (var/obj/item/mod/module/module in modules)
if ((part.slot_flags in module.mount_part) && module.module_deployed())
module.on_suit_activation()
if (user && (module.overlay_state_inactive || module.overlay_state_active))
user.update_worn_back()

/obj/item/mod/control/retract(mob/user, obj/item/part)
. = ..()
if (!active)
return
for (var/obj/item/mod/module/module in modules)
if (part.slot_flags in module.mount_part)
module.on_suit_deactivation()
if (module.active)
module.on_deactivation()
if (user && (module.overlay_state_inactive || module.overlay_state_active))
user.update_worn_back()
33 changes: 33 additions & 0 deletions maplestation_modules/code/modules/mod/modules/module.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/obj/item/mod/module/storage
max_combined_w_class = 17
max_items = 17

/obj/item/mod/module/storage/large_capacity
max_combined_w_class = 21

/obj/item/mod/module
/// Clothing slots on which this part is mounted. Module does not work or show up if its not deployed
var/mount_part = list()

/obj/item/mod/module/proc/module_deployed()
if (isnull(mod) || isnull(mod.wearer))
return FALSE

if (!mount_part)
return TRUE

for (var/slot_flag in mount_part)
var/obj/item/worn_item = mod.wearer.get_item_by_slot(slot_flag)
if (mod.boots != worn_item && mod.gauntlets != worn_item && mod.chestplate != worn_item && mod.helmet != worn_item)
return FALSE
return TRUE

/obj/item/mod/module/add_module_overlay(obj/item/source, list/overlays, mutable_appearance/standing, isinhands, icon_file)
if (module_deployed())
overlays += generate_worn_overlay(standing)

/obj/item/mod/module/anomaly_locked/kinesis
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/visor
mount_part = list(ITEM_SLOT_HEAD)
23 changes: 23 additions & 0 deletions maplestation_modules/code/modules/mod/modules/modules_antag.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/obj/item/mod/module/armor_booster
mount_part = list(ITEM_SLOT_GLOVES, ITEM_SLOT_FEET, ITEM_SLOT_OCLOTHING, ITEM_SLOT_HEAD)

/obj/item/mod/module/energy_shield
mount_part = list(ITEM_SLOT_OCLOTHING)

/obj/item/mod/module/insignia
mount_part = list(ITEM_SLOT_OCLOTHING, ITEM_SLOT_HEAD)

/obj/item/mod/module/noslip
mount_part = list(ITEM_SLOT_FEET)

/obj/item/mod/module/flamethrower
mount_part = list(ITEM_SLOT_OCLOTHING)

/obj/item/mod/module/power_kick
mount_part = list(ITEM_SLOT_FEET)

/obj/item/mod/module/medbeam
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/tem
mount_part = list(ITEM_SLOT_GLOVES)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/obj/item/mod/module/welding
mount_part = list(ITEM_SLOT_HEAD)

/obj/item/mod/module/t_ray
mount_part = list(ITEM_SLOT_HEAD)

/obj/item/mod/module/magboot
mount_part = list(ITEM_SLOT_FEET)

/obj/item/mod/module/rad_protection
mount_part = list(ITEM_SLOT_GLOVES, ITEM_SLOT_FEET, ITEM_SLOT_OCLOTHING, ITEM_SLOT_HEAD)

/obj/item/mod/module/constructor
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/mister
mount_part = list(ITEM_SLOT_GLOVES)
43 changes: 29 additions & 14 deletions maplestation_modules/code/modules/mod/modules/modules_general.dm
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
///Helmet Desynchronizer - Allows undeploying the helmet once the suit is activated.
/obj/item/mod/module/helmet_desync
name = "MOD helmet desynchronizer"
desc = "A module designed to allow the helmet to operate independently from the rest of the modsuit modules. \
Allows the helmet of the modsuit to be undeployed once the suit is activated. Head modules are kept operational for maximum efficiency." //and totally not because slot-restricted modules arent a thing yet and are coming in a refactor // update: it's been a year, the refactor still hasn't been made. rip
icon_state = "regulator"
complexity = 1
incompatible_modules = list(/obj/item/mod/module/helmet_desync)

/obj/item/mod/module/helmet_desync/on_install()
mod.helmet_desync = TRUE

/obj/item/mod/module/helmet_desync/on_uninstall(deleting = FALSE)
mod.helmet_desync = FALSE
/obj/item/mod/module/jetpack
mount_part = list(ITEM_SLOT_OCLOTHING)

/obj/item/mod/module/jump_jet
mount_part = list(ITEM_SLOT_OCLOTHING)

/obj/item/mod/module/mouthhole
mount_part = list(ITEM_SLOT_HEAD)

/obj/item/mod/module/flashlight
mount_part = list(ITEM_SLOT_HEAD)

/obj/item/mod/module/dispenser
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/longfall
mount_part = list(ITEM_SLOT_FEET)

/obj/item/mod/module/thermal_regulator
mount_part = list(ITEM_SLOT_OCLOTHING)

/obj/item/mod/module/signlang_radio
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/joint_torsion
mount_part = list(ITEM_SLOT_FEET)

/obj/item/mod/module/recycler
mount_part = list(ITEM_SLOT_OCLOTHING)
11 changes: 11 additions & 0 deletions maplestation_modules/code/modules/mod/modules/modules_maint.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/obj/item/mod/module/visor/rave
mount_part = list(ITEM_SLOT_HEAD)

/obj/item/mod/module/balloon
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/paper_dispenser
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/stamp
mount_part = list(ITEM_SLOT_GLOVES)
17 changes: 17 additions & 0 deletions maplestation_modules/code/modules/mod/modules/modules_medical.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/obj/item/mod/module/quick_carry
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/injector
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/organ_thrower
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/criminalcapture/patienttransport
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/defibrillator
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/thread_ripper
mount_part = list(ITEM_SLOT_GLOVES)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/obj/item/mod/module/welding/camera_vision
mount_part = list(ITEM_SLOT_HEAD)

/obj/item/mod/module/hacker
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/energy_net
mount_part = list(ITEM_SLOT_GLOVES)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/obj/item/mod/module/reagent_scanner
mount_part = list(ITEM_SLOT_HEAD)
20 changes: 20 additions & 0 deletions maplestation_modules/code/modules/mod/modules/modules_security.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/obj/item/mod/module/magnetic_harness
mount_part = list(ITEM_SLOT_OCLOTHING)

/obj/item/mod/module/pepper_shoulders
mount_part = list(ITEM_SLOT_OCLOTHING)

/obj/item/mod/module/megaphone
mount_part = list(ITEM_SLOT_HEAD)

/obj/item/mod/module/criminalcapture
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/active_sonar
mount_part = list(ITEM_SLOT_HEAD)

/obj/item/mod/module/shooting_assistant
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/anti_stagger
mount_part = list(ITEM_SLOT_OCLOTHING)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/obj/item/mod/module/microwave_beam
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/waddle
mount_part = list(ITEM_SLOT_FEET)
17 changes: 17 additions & 0 deletions maplestation_modules/code/modules/mod/modules/modules_supply.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/obj/item/mod/module/clamp
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/drill
mount_part = list(ITEM_SLOT_GLOVES)

/obj/item/mod/module/hydraulic
mount_part = list(ITEM_SLOT_OCLOTHING)

/obj/item/mod/module/magnet
mount_part = list(ITEM_SLOT_OCLOTHING)

/obj/item/mod/module/ash_accretion
mount_part = list(ITEM_SLOT_GLOVES, ITEM_SLOT_FEET, ITEM_SLOT_OCLOTHING, ITEM_SLOT_HEAD)

/obj/item/mod/module/sphere_transform
mount_part = list(ITEM_SLOT_GLOVES, ITEM_SLOT_FEET, ITEM_SLOT_OCLOTHING, ITEM_SLOT_HEAD)

This file was deleted.

Loading
Loading