mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-23 16:11:56 +00:00
* Initial work * more * ass * wsedfwedff * asss * test * stuff * fuck * sss a * kms * asdadwedwdfwefwef * start * test * dwwdew * ewefwfef * Redemption machine (#8) * Redemption machine * Removes debug messages * changes * fuckmyshitup * coin mint works with new material shenanigans (#10) * Auto stash before merge of "materials" and "origin/materials" * woops * furnace (#11) * autolathe manufacturing of toolboxes * eggs in a basket * some small changes * matcolors * documentation * more documentation and effects * done * Color man bad (#12) * fixes designs * ass * more fixes * fuck me * firestacks adder * epic fixes * fixes designs * DONE DIDDILY DOO * removes category macro * ch-ch-ch-changes * fixes some stuff * Fixes display of ore values (#9) * Redemption machine * Removes debug messages * Re-adds value display * Replaces the fire stacking component with an element instead (#13) * fixes examine * fixes ligma bugs * double ligma boofus * fix * misses some defines * fixes ORM * Update code/datums/components/material_container.dm Co-Authored-By: Emmett Gaines <ninjanomnom@gmail.com> * fixes * Makes glass objects weaker (#14) * Makes glass objects weaker * uses correct proc * fixes shit * honk honk * better * oh shit oh fuck * fixes * fuck ORMs * fixes the biogen * documentation * ass (#15) * component * changes * ass * ass * doc * Auto stash before merge of "materials-plasmacomponent" and "origin/materials-plasmacomponent" * fixes rounding * fixed
41 lines
1.5 KiB
Plaintext
41 lines
1.5 KiB
Plaintext
/**
|
|
* Can be applied to /atom/movable subtypes to make them apply fire stacks to things they hit
|
|
*/
|
|
/datum/element/firestacker
|
|
element_flags = ELEMENT_DETACH
|
|
/// A list in format {atom/movable/owner, number}
|
|
/// Used to keep track of movables which want to apply a different number of fire stacks than default
|
|
var/list/amount_by_owner = list()
|
|
|
|
/datum/element/firestacker/Attach(datum/target, amount)
|
|
. = ..()
|
|
if(!ismovableatom(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
RegisterSignal(target, COMSIG_MOVABLE_IMPACT, .proc/impact)
|
|
if(isitem(target))
|
|
RegisterSignal(target, COMSIG_ITEM_ATTACK, .proc/item_attack)
|
|
RegisterSignal(target, COMSIG_ITEM_ATTACK_SELF, .proc/item_attack_self)
|
|
|
|
if(amount) // If amount is not given we default to 1 and don't need to save it here
|
|
amount_by_owner[target] = amount
|
|
|
|
/datum/element/firestacker/Detach(datum/source, force)
|
|
. = ..()
|
|
UnregisterSignal(source, list(COMSIG_MOVABLE_IMPACT, COMSIG_ITEM_ATTACK, COMSIG_ITEM_ATTACK_SELF))
|
|
amount_by_owner -= source
|
|
|
|
/datum/element/firestacker/proc/stack_on(datum/owner, mob/living/target)
|
|
target.adjust_fire_stacks(amount_by_owner[owner] || 1)
|
|
|
|
/datum/element/firestacker/proc/impact(datum/source, atom/hit_atom, datum/thrownthing/throwingdatum)
|
|
if(isliving(hit_atom))
|
|
stack_on(source, hit_atom)
|
|
|
|
/datum/element/firestacker/proc/item_attack(datum/source, atom/movable/target, mob/living/user)
|
|
if(isliving(target))
|
|
stack_on(source, target)
|
|
|
|
/datum/element/firestacker/proc/item_attack_self(datum/source, mob/user)
|
|
if(isliving(user))
|
|
stack_on(source, user)
|