Skip to content

Commit

Permalink
[MIRROR] unhardcodes modsuit parts (#2565)
Browse files Browse the repository at this point in the history
* unhardcodes modsuit parts

* Update more entombed mod_parts usage

* Makes our custom skins work

* whoopsie

* gloves!

* Resolve conflicts, preserve overslotting

* Get rid of the timeline theme

This doesn't exist upstream and isn't used here, replaced by the chrono
theme?

* Port our themes over, seal messages

* update some usage of mod_parts

* proc and argument updating

* some more usage updates

* retracts_into updating

* adds some required slots to modules

* Add a flashlight retracts_into

* deactivate() is the one that turns it off

* Require full deployment to activate modules

Worth investigating in the future, perhaps make it only require the
modules "required_slots" to be deployed to activate, and only deactivate
if one of those slots vanish

---------

Co-authored-by: Fikou <[email protected]>
Co-authored-by: Fluffles <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Jun 2, 2024
1 parent f5f3095 commit 82d0736
Show file tree
Hide file tree
Showing 46 changed files with 1,287 additions and 945 deletions.
8 changes: 6 additions & 2 deletions code/__DEFINES/dcs/signals/signals_mod.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
//MODsuit signals
/// Called when a module is selected to be the active one from on_select(obj/item/mod/module/module)
#define COMSIG_MOD_MODULE_SELECTED "mod_module_selected"
/// Called when a MOD deploys one or more of its parts.
/// Called when a MOD user deploys one or more of its parts.
#define COMSIG_MOD_DEPLOYED "mod_deployed"
/// Called when a MOD retracts one or more of its parts.
/// Called when a MOD user retracts one or more of its parts.
#define COMSIG_MOD_RETRACTED "mod_retracted"
/// Called when a MOD deploys a part.
#define COMSIG_MOD_PART_DEPLOYED "mod_part_deployed"
/// Called when a MOD retracts a part.
#define COMSIG_MOD_PART_RETRACTED "mod_part_retracted"
/// Called when a MOD is finished toggling itself.
#define COMSIG_MOD_TOGGLED "mod_toggled"
/// Called when a MOD activation is called from toggle_activate(mob/user)
Expand Down
22 changes: 14 additions & 8 deletions code/__DEFINES/mod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// The default cell drain of a modsuit. The standard modsuit active power usage drains this much energy per modsuit second.
#define DEFAULT_CHARGE_DRAIN (0.005 * STANDARD_CELL_CHARGE) // A standard cell lasts 200 seconds with this on active power usage, while a high power one lasts 2,000 seconds.

/// Default time for a part to seal
/// Default time for a part of the suit to seal.
#define MOD_ACTIVATION_STEP_TIME (2 SECONDS)

/// Passive module, just acts when put in naturally.
Expand All @@ -23,21 +23,17 @@
/// This module can be used while the suit is off
#define MODULE_ALLOW_INACTIVE (1<<2)

//Defines used by the theme for clothing flags and similar
#define CONTROL_LAYER "control_layer"
#define HELMET_FLAGS "helmet_flags"
#define CHESTPLATE_FLAGS "chestplate_flags"
#define GAUNTLETS_FLAGS "gauntlets_flags"
#define BOOTS_FLAGS "boots_flags"

#define UNSEALED_LAYER "unsealed_layer"
#define SEALED_LAYER "sealed_layer"
#define UNSEALED_CLOTHING "unsealed_clothing"
#define SEALED_CLOTHING "sealed_clothing"
#define UNSEALED_INVISIBILITY "unsealed_invisibility"
#define SEALED_INVISIBILITY "sealed_invisibility"
#define UNSEALED_COVER "unsealed_cover"
#define SEALED_COVER "sealed_cover"
#define CAN_OVERSLOT "can_overslot"
#define UNSEALED_MESSAGE "unsealed_message"
#define SEALED_MESSAGE "sealed_message"

//Defines used to override MOD clothing's icon and worn icon files in the skin.
#define MOD_ICON_OVERRIDE "mod_icon_override"
Expand All @@ -49,6 +45,16 @@
#define MODLINK_FREQ_CHARLIE "CHRL"
#define MODLINK_FREQ_CENTCOM "CC"

//Default text for different messages for the user.
#define HELMET_UNSEAL_MESSAGE "hisses open"
#define HELMET_SEAL_MESSAGE "hisses closed"
#define CHESTPLATE_UNSEAL_MESSAGE "releases your chest"
#define CHESTPLATE_SEAL_MESSAGE "cinches tightly around your chest"
#define GAUNTLET_UNSEAL_MESSAGE "become loose around your fingers"
#define GAUNTLET_SEAL_MESSAGE "tighten around your fingers and wrists"
#define BOOT_UNSEAL_MESSAGE "relax their grip on your legs"
#define BOOT_SEAL_MESSAGE "seal around your feet"

/// Global list of all /datum/mod_theme
GLOBAL_LIST_INIT(mod_themes, setup_mod_themes())
/// Global list of all ids associated to a /datum/mod_link instance
Expand Down
43 changes: 43 additions & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,49 @@ GLOBAL_LIST_INIT(skin_tone_names, list(
else
return precise_zone

///Returns a list of strings for a given slot flag.
/proc/parse_slot_flags(slot_flags)
var/list/slot_strings = list()
if(slot_flags & ITEM_SLOT_BACK)
slot_strings += "back"
if(slot_flags & ITEM_SLOT_MASK)
slot_strings += "mask"
if(slot_flags & ITEM_SLOT_NECK)
slot_strings += "neck"
if(slot_flags & ITEM_SLOT_HANDCUFFED)
slot_strings += "handcuff"
if(slot_flags & ITEM_SLOT_LEGCUFFED)
slot_strings += "legcuff"
if(slot_flags & ITEM_SLOT_BELT)
slot_strings += "belt"
if(slot_flags & ITEM_SLOT_ID)
slot_strings += "id"
if(slot_flags & ITEM_SLOT_EARS)
slot_strings += "ear"
if(slot_flags & ITEM_SLOT_EYES)
slot_strings += "glasses"
if(slot_flags & ITEM_SLOT_GLOVES)
slot_strings += "glove"
if(slot_flags & ITEM_SLOT_HEAD)
slot_strings += "head"
if(slot_flags & ITEM_SLOT_FEET)
slot_strings += "shoe"
if(slot_flags & ITEM_SLOT_OCLOTHING)
slot_strings += "oversuit"
if(slot_flags & ITEM_SLOT_ICLOTHING)
slot_strings += "undersuit"
if(slot_flags & ITEM_SLOT_SUITSTORE)
slot_strings += "suit storage"
if(slot_flags & (ITEM_SLOT_LPOCKET|ITEM_SLOT_RPOCKET))
slot_strings += "pocket"
if(slot_flags & ITEM_SLOT_HANDS)
slot_strings += "hand"
if(slot_flags & ITEM_SLOT_DEX_STORAGE)
slot_strings += "dextrous storage"
if(slot_flags & ITEM_SLOT_BACKPACK)
slot_strings += "backpack"
return slot_strings

///Returns the direction that the initiator and the target are facing
/proc/check_target_facings(mob/living/initiator, mob/living/target)
/*This can be used to add additional effects on interactions between mobs depending on how the mobs are facing each other, such as adding a crit damage to blows to the back of a guy's head.
Expand Down
77 changes: 0 additions & 77 deletions code/modules/bitrunning/antagonists/cyber_tac.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,80 +29,3 @@

var/obj/item/implant/weapons_auth/auth = new(user)
auth.implant(user)

/obj/item/mod/control/pre_equipped/glitch
theme = /datum/mod_theme/glitch
applied_cell = /obj/item/stock_parts/cell/bluespace
applied_modules = list(
/obj/item/mod/module/storage,
/obj/item/mod/module/magnetic_harness,
/obj/item/mod/module/jetpack/advanced,
/obj/item/mod/module/jump_jet,
/obj/item/mod/module/flashlight,
)
default_pins = list(
/obj/item/mod/module/armor_booster,
/obj/item/mod/module/jetpack/advanced,
/obj/item/mod/module/jump_jet,
)
starting_frequency = null

/datum/armor/mod_theme_glitch
melee = 15
bullet = 20
laser = 35
bomb = 65
bio = 100
fire = 100
acid = 100
wound = 100

/datum/mod_theme/glitch
name = "glitch"
desc = "A modsuit outfitted for elite Cyber Authority units to track, capture, and eliminate organic intruders."
extended_desc = "The Cyber Authority function as a digital police force, patrolling the digital realm and enforcing the law. Cyber Tac units are the elite of the elite, outfitted with lethal weaponry and fast mobility specially designed to quell organic uprisings."
default_skin = "glitch"
armor_type = /datum/armor/mod_theme_glitch
resistance_flags = FIRE_PROOF|ACID_PROOF
atom_flags = PREVENT_CONTENTS_EXPLOSION_1
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
complexity_max = DEFAULT_MAX_COMPLEXITY + 3
siemens_coefficient = 0
slowdown_inactive = 1
slowdown_active = 0.5
ui_theme = "terminal"
inbuilt_modules = list(/obj/item/mod/module/armor_booster)
allowed_suit_storage = list(
/obj/item/ammo_box,
/obj/item/ammo_casing,
/obj/item/restraints/handcuffs,
/obj/item/assembly/flash,
)
skins = list(
"glitch" = list(
HELMET_FLAGS = list(
UNSEALED_LAYER = null,
UNSEALED_CLOTHING = SNUG_FIT,
SEALED_CLOTHING = THICKMATERIAL|STOPSPRESSUREDAMAGE|BLOCK_GAS_SMOKE_EFFECT|HEADINTERNALS,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR,
SEALED_INVISIBILITY = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
SEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
CHESTPLATE_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
SEALED_INVISIBILITY = HIDEJUMPSUIT,
),
GAUNTLETS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
CAN_OVERSLOT = TRUE,
),
BOOTS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
CAN_OVERSLOT = TRUE,
),
),
)

1 change: 1 addition & 0 deletions code/modules/jobs/job_types/cargo_technician.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@
name = "Cargo Technician (MODsuit)"

back = /obj/item/mod/control/pre_equipped/loader
suit = null
71 changes: 31 additions & 40 deletions code/modules/mod/adding_new_mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,15 @@ So, now that we have our theme, we want to add a skin to it (or another theme of
armor_type = /datum/armor/modtheme_psychological
complexity_max = DEFAULT_MAX_COMPLEXITY - 7
charge_drain = DEFAULT_CHARGE_DRAIN * 0.5
skins = list(
variants = list(
"psychological" = list(
HELMET_LAYER = null,
HELMET_FLAGS = list(
/obj/item/clothing/head/mod = list(
),
CHESTPLATE_FLAGS = list(
/obj/item/clothing/suit/mod = list(
),
GAUNTLETS_FLAGS = list(
/obj/item/clothing/gloves/mod = list(
),
BOOTS_FLAGS = list(
/obj/item/clothing/shoes/mod = list(
),
),
)
Expand All @@ -101,8 +100,7 @@ We now have a psychological skin, this will apply the psychological icons to eve
For example, if our helmet's icon covers the full head (like the research skin), we want to do something like this.

```dm
HELMET_LAYER = null,
HELMET_FLAGS = list(
/obj/item/clothing/head/mod = list(
UNSEALED_CLOTHING = SNUG_FIT|THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE|BLOCK_GAS_SMOKE_EFFECT,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR|HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
Expand All @@ -113,8 +111,8 @@ For example, if our helmet's icon covers the full head (like the research skin),
Otherwise, with an open helmet that becomes closed (like the engineering skin), we'd do this.

```dm
HELMET_LAYER = NECK_LAYER,
HELMET_FLAGS = list(
/obj/item/clothing/head/mod = list(
UNSEALED_LAYER = NECK_LAYER
UNSEALED_CLOTHING = SNUG_FIT,
SEALED_CLOTHING = THICKMATERIAL|STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR,
Expand All @@ -137,47 +135,46 @@ There are specific cases of helmets that semi-cover the head, like the cosmohonk
armor_type = /datum/armor/modtheme_psychological
complexity_max = DEFAULT_MAX_COMPLEXITY - 7
charge_drain = DEFAULT_CHARGE_DRAIN * 0.5
skins = list(
variants = list(
"psychological" = list(
HELMET_LAYER = NECK_LAYER,
HELMET_FLAGS = list(
/obj/item/clothing/head/mod = list(
UNSEALED_LAYER = NECK_LAYER
UNSEALED_CLOTHING = SNUG_FIT,
SEALED_CLOTHING = THICKMATERIAL|STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR,
SEALED_INVISIBILITY = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
SEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
CHESTPLATE_FLAGS = list(
/obj/item/clothing/suit/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
SEALED_INVISIBILITY = HIDEJUMPSUIT,
),
GAUNTLETS_FLAGS = list(
/obj/item/clothing/gloves/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
BOOTS_FLAGS = list(
/obj/item/clothing/shoes/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
"psychotherapeutic" = list(
HELMET_LAYER = null,
HELMET_FLAGS = list(
/obj/item/clothing/head/mod = list(
UNSEALED_CLOTHING = SNUG_FIT|THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR|HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
UNSEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
CHESTPLATE_FLAGS = list(
/obj/item/clothing/suit/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
SEALED_INVISIBILITY = HIDEJUMPSUIT,
),
GAUNTLETS_FLAGS = list(
/obj/item/clothing/gloves/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
BOOTS_FLAGS = list(
/obj/item/clothing/shoes/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
Expand Down Expand Up @@ -207,7 +204,7 @@ As we want this effect to be on demand, we probably want this to be an usable mo
- Usable: You can use these for a one time effect.
- Active: You can only have one selected at a time. It gives you a special click effect.

As we have an usable module, we want to set a cooldown time. All modules are also incompatible with themselves, have a specific power cost and complexity varying on how powerful they are, so let's update our definition, and also add a new variable for how much brain damage we'll heal.
As we have an usable module, we want to set a cooldown time. All modules are also incompatible with themselves, have a specific power cost and complexity varying on how powerful they are, and are equippable to certain slots, so let's update our definition, and also add a new variable for how much brain damage we'll heal.

```dm
/obj/item/mod/module/neuron_healer
Expand All @@ -220,25 +217,20 @@ As we have an usable module, we want to set a cooldown time. All modules are als
use_energy_cost = DEFAULT_CHARGE_DRAIN
incompatible_modules = list(/obj/item/mod/module/neuron_healer)
cooldown_time = 15 SECONDS
required_slot = list(ITEM_SLOT_HEAD)
var/brain_damage_healed = 25
```

Now, we want to override the on_use proc for our new effect. We want to make sure the use checks passed from parent. You can read about most procs and variables by reading [this](modules/_module.dm)
Now, we want to override the on_use proc for our new effect. You can read about most procs and variables by reading [this](modules/_module.dm)

```dm
/obj/item/mod/module/neuron_healer/on_use()
. = ..()
if(!.)
return
```

After this, we want to put our special code, a basic effect of healing all mobs nearby for their brain damage and creating a beam to them.

```dm
/obj/item/mod/module/neuron_healer/on_use()
. = ..()
if(!.)
return
for(var/mob/living/carbon/carbon_mob in range(5, src))
if(carbon_mob == mod.wearer)
continue
Expand Down Expand Up @@ -272,47 +264,46 @@ Now we want to add it to the psychological theme, which is very simple, finishin
complexity_max = DEFAULT_MAX_COMPLEXITY - 7
charge_drain = DEFAULT_CHARGE_DRAIN * 0.5
inbuilt_modules = list(/obj/item/mod/module/neuron_healer/advanced)
skins = list(
variants = list(
"psychological" = list(
HELMET_LAYER = NECK_LAYER,
HELMET_FLAGS = list(
/obj/item/clothing/head/mod = list(
UNSEALED_LAYER = NECK_LAYER
UNSEALED_CLOTHING = SNUG_FIT,
SEALED_CLOTHING = THICKMATERIAL|STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR,
SEALED_INVISIBILITY = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
SEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
CHESTPLATE_FLAGS = list(
/obj/item/clothing/suit/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
SEALED_INVISIBILITY = HIDEJUMPSUIT,
),
GAUNTLETS_FLAGS = list(
/obj/item/clothing/gloves/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
BOOTS_FLAGS = list(
/obj/item/clothing/shoes/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
"psychotherapeutic" = list(
HELMET_LAYER = null,
HELMET_FLAGS = list(
/obj/item/clothing/head/mod = list(
UNSEALED_CLOTHING = SNUG_FIT|THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR|HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
UNSEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
CHESTPLATE_FLAGS = list(
/obj/item/clothing/suit/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
SEALED_INVISIBILITY = HIDEJUMPSUIT,
),
GAUNTLETS_FLAGS = list(
/obj/item/clothing/gloves/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
BOOTS_FLAGS = list(
/obj/item/clothing/shoes/mod = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
Expand Down
Loading

0 comments on commit 82d0736

Please sign in to comment.