mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 11:42:27 +00:00
## About The Pull Request Refactors martial arts off the mind. Don't worry the martial arts you learn still transfer with mindswap Instead, they are just tracked on a list on the mob, and they also independently track the datum that created them This fixes a lot of jank with martial arts, like say, having your krav maga gloves transfer across slime clones or something... But it also opens an opportunity: As we track all martial arts available, I added a verb (ic tab) that lets you swap between the ones you know  (Some don't let you swap like that one brain trauma) ## Why It's Good For The Game Aforementioned fixes a lot of jank Recently martial arts have just been up and disappearing and this was entirely spurred on by that bug Probably fixes #84710 (haven't checked) Probably fixes #89247 Probably fixes #89948 Probably fixes #90067 ## Changelog 🆑 Melbert refactor: Refactored martial arts, if you notice any oddities like managing to know two martial arts at once or having your powers disappear, report it! add: If you know multiple martial arts, such as krav maga from gloves and cqc from a book, you can now swap between them at will via a button in the IC tab! /🆑 --------- Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
/// A martial art that is owned by this mind and will transfer as mind moves
|
|
/datum/component/mindbound_martial_arts
|
|
dupe_mode = COMPONENT_DUPE_SELECTIVE
|
|
/// The style transferred between minds
|
|
var/datum/martial_art/style
|
|
|
|
/datum/component/mindbound_martial_arts/Initialize(style_type)
|
|
if(!istype(parent, /datum/mind))
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
style = new style_type(src)
|
|
|
|
/datum/component/mindbound_martial_arts/CheckDupeComponent(datum/component/new_comp, new_style_type)
|
|
return style.type == new_style_type
|
|
|
|
/datum/component/mindbound_martial_arts/RegisterWithParent()
|
|
RegisterSignal(parent, COMSIG_MIND_TRANSFERRED, PROC_REF(mind_transferred))
|
|
|
|
var/datum/mind/mind = parent
|
|
style.teach(mind.current)
|
|
|
|
/datum/component/mindbound_martial_arts/UnregisterFromParent()
|
|
UnregisterSignal(parent, COMSIG_MIND_TRANSFERRED)
|
|
|
|
var/datum/mind/mind = parent
|
|
style.unlearn(mind.current)
|
|
|
|
/datum/component/mindbound_martial_arts/Destroy()
|
|
QDEL_NULL(style)
|
|
return ..()
|
|
|
|
/// Signal proc for [COMSIG_MOB_MIND_TRANSFERRED_OUT_OF] to pass martial arts between bodies on mind transfer
|
|
/// By this point the martial art's holder is the old body, but the mind that owns it is in the new body
|
|
/datum/component/mindbound_martial_arts/proc/mind_transferred(datum/mind/source, mob/living/old_body)
|
|
SIGNAL_HANDLER
|
|
|
|
style.unlearn(old_body)
|
|
style.teach(source.current)
|