Fix: Bespoke DCS elements use all requested args. (#26387)

This commit is contained in:
warriorstar-orion
2024-08-06 15:29:39 -04:00
committed by GitHub
parent 52327cea40
commit 78ef86989f
8 changed files with 19 additions and 9 deletions
+11 -1
View File
@@ -10,11 +10,21 @@
/**
* The index of the first attach argument to consider for duplicate elements
*
* All arguments from this index onwards (1 based, until `argument_hash_end_idx` is reached, if set)
* are hashed into the key to determine if this is a new unique element or one already exists
*
* Is only used when flags contains [ELEMENT_BESPOKE]
*
* This is infinity so you must explicitly set this
*/
var/id_arg_index = INFINITY
var/argument_hash_start_idx = INFINITY
/**
* The index of the last attach argument to consider for duplicate elements
* Only used when `element_flags` contains [ELEMENT_BESPOKE].
* If not set, it'll copy every argument from `argument_hash_start_idx` onwards as normal
*/
var/argument_hash_end_idx = 0
/// Activates the functionality defined by the element on the given target datum
/datum/element/proc/Attach(datum/target)
+1 -1
View File
@@ -1,6 +1,6 @@
/datum/element/rad_insulation
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY | ELEMENT_BESPOKE
id_arg_index = 2
argument_hash_start_idx = 2
var/amount // Multiplier for radiation strength passing through
/datum/element/rad_insulation/Attach(datum/target, _amount = RAD_MEDIUM_INSULATION, protects = TRUE, contamination_proof = TRUE)
+1 -1
View File
@@ -8,7 +8,7 @@
*/
/datum/element/ridable
element_flags = ELEMENT_BESPOKE
id_arg_index = 2
argument_hash_start_idx = 2
/// The specific riding component subtype we're loading our instructions from, don't leave this as default please!
var/riding_component_type = /datum/component/riding
/// If we have a xenobio red potion applied to us, we get split off so we can pass our special status onto new riding components
+1 -1
View File
@@ -3,7 +3,7 @@
*/
/datum/element/shatters_when_thrown
element_flags = ELEMENT_BESPOKE
id_arg_index = 2
argument_hash_start_idx = 2
/// What type of item is spawned as a 'shard' once the shattering happens
var/obj/item/shard_type
/// How many shards total are made when the thing we're attached to shatters
+1 -1
View File
@@ -3,7 +3,7 @@
/// An element for atoms that, when dragged and dropped onto a mob, opens a strip panel.
/datum/element/strippable
element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH_ON_HOST_DESTROY
id_arg_index = 2
argument_hash_start_idx = 2
/// An assoc list of keys to /datum/strippable_item
var/list/items