[MIRROR] Completely removes proc_holders from existence. Refactors all wizard, xeno, spider, and genetics powers to be actions. Also refactors and sorts ton of accompanying code. [MDB IGNORE] (#14666)

* Completely removes `proc_holders` from existence. Refactors all wizard, xeno, spider, and genetics powers to be actions. Also refactors and sorts ton of accompanying code.

* our changes

* yes

* 0

* Update blackmesa.dmm

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-07-01 20:33:30 +01:00
committed by GitHub
co-authored by MrMelbert Gandalf
parent f507824ee7
commit c68fea7cba
405 changed files with 12842 additions and 11487 deletions
+11 -9
View File
@@ -5,9 +5,11 @@
name = "implant"
icon = 'icons/obj/implants.dmi'
icon_state = "generic" //Shows up as the action button icon
item_flags = DROPDEL
// This gives the user an action button that allows them to activate the implant.
// If the implant needs no action button, then null this out.
// Or, if you want to add a unique action button, then replace this.
actions_types = list(/datum/action/item_action/hands_free/activate)
///true for implant types that can be activated, false for ones that are "always on" like mindshield implants
var/activated = TRUE
///the mob that's implanted with this
var/mob/living/imp_in = null
///implant color, used for selecting either the "b" version or the "r" version of the implant case sprite when the implant is in a case.
@@ -16,7 +18,7 @@
var/allow_multiple = FALSE
///how many times this can do something, only relevant for implants with limited uses
var/uses = -1
item_flags = DROPDEL
/obj/item/implant/proc/activate()
SEND_SIGNAL(src, COMSIG_IMPLANT_ACTIVATED)
@@ -24,6 +26,9 @@
/obj/item/implant/ui_action_click()
INVOKE_ASYNC(src, .proc/activate, "action_button")
/obj/item/implant/item_action_slot_check(slot, mob/user)
return user == imp_in
/obj/item/implant/proc/can_be_implanted_in(mob/living/target)
if(issilicon(target))
return FALSE
@@ -86,10 +91,8 @@
forceMove(target)
imp_in = target
target.implants += src
if(activated)
for(var/X in actions)
var/datum/action/implant_action = X
implant_action.Grant(target)
for(var/datum/action/implant_action as anything in actions)
implant_action.Grant(target)
if(ishuman(target))
var/mob/living/carbon/human/target_human = target
target_human.sec_hud_set_implants()
@@ -113,8 +116,7 @@
moveToNullspace()
imp_in = null
source.implants -= src
for(var/X in actions)
var/datum/action/implant_action = X
for(var/datum/action/implant_action as anything in actions)
implant_action.Remove(source)
if(ishuman(source))
var/mob/living/carbon/human/human_source = source
@@ -3,7 +3,6 @@
desc = "Returns you to the mothership."
icon = 'icons/obj/abductor.dmi'
icon_state = "implant"
activated = 1
var/obj/machinery/abductor/pad/home
var/cooldown = 60 SECONDS
var/on_cooldown
@@ -2,7 +2,7 @@
name = "chem implant"
desc = "Injects things."
icon_state = "reagents"
activated = FALSE
actions_types = null
/obj/item/implant/chem/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
@@ -1,7 +1,7 @@
///A passive implant that plays sound/misc/sadtrombone.ogg when you deathgasp for any reason
/obj/item/implant/sad_trombone
name = "sad trombone implant"
activated = FALSE
actions_types = null
/obj/item/implant/sad_trombone/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
@@ -77,7 +77,7 @@
name = "deathrattle implant"
desc = "Hope no one else dies, prepare for when they do."
activated = FALSE
actions_types = null
/obj/item/implant/deathrattle/can_be_implanted_in(mob/living/target)
// Can be implanted in anything that's a mob. Syndicate cyborgs, talking fish, humans...
@@ -4,7 +4,7 @@
/obj/item/implant/exile
name = "exile implant"
desc = "Prevents you from returning from away missions."
activated = FALSE
actions_types = null
/obj/item/implant/exile/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
@@ -119,3 +119,7 @@
/obj/item/implanter/explosive_macro
name = "implanter (macrobomb)"
imp_type = /obj/item/implant/explosive/macro
/datum/action/item_action/explosive_implant
check_flags = NONE
name = "Activate Explosive Implant"
@@ -3,7 +3,6 @@
desc = "Teaches you the arts of Krav Maga in 5 short instructional videos beamed directly into your eyeballs."
icon = 'icons/obj/wizard.dmi'
icon_state ="scroll2"
activated = 1
var/datum/martial_art/krav_maga/style = new
/obj/item/implant/krav_maga/get_data()
@@ -34,4 +33,3 @@
name = "implant case - 'Krav Maga'"
desc = "A glass case containing an implant that can teach the user the arts of Krav Maga."
imp_type = /obj/item/implant/krav_maga
@@ -1,7 +1,7 @@
/obj/item/implant/mindshield
name = "mindshield implant"
desc = "Protects against brainwashing."
activated = FALSE
actions_types = null
/obj/item/implant/mindshield/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
@@ -2,7 +2,7 @@
name = "firearms authentication implant"
desc = "Lets you shoot your guns."
icon_state = "auth"
activated = FALSE
actions_types = null
/obj/item/implant/weapons_auth/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
@@ -33,7 +33,6 @@
/obj/item/implant/radio
name = "internal radio implant"
activated = TRUE
var/obj/item/radio/radio
var/radio_key
var/subspace_transmission = FALSE
@@ -1,36 +1,58 @@
/obj/item/implant/spell
name = "spell implant"
desc = "Allows you to cast a spell as if you were a wizard."
activated = FALSE
actions_types = null
var/autorobeless = TRUE // Whether to automagically make the spell robeless on implant
var/obj/effect/proc_holder/spell/spell
/// Whether to make the spell robeless
var/make_robeless = TRUE
/// The typepath of the spell we give to people. Instantiated in Initialize
var/datum/action/cooldown/spell/spell_type
/// The actual spell we give to the person on implant
var/datum/action/cooldown/spell/spell_to_give
/obj/item/implant/spell/Initialize(mapload)
. = ..()
if(!spell_type)
return
spell_to_give = new spell_type(src)
if(make_robeless && (spell_to_give.spell_requirements & SPELL_REQUIRES_WIZARD_GARB))
spell_to_give.spell_requirements &= ~SPELL_REQUIRES_WIZARD_GARB
/obj/item/implant/spell/Destroy()
QDEL_NULL(spell_to_give)
return ..()
/obj/item/implant/spell/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
<b>Name:</b> Spell Implant<BR>
<b>Life:</b> 4 hours after death of host<BR>
<b>Implant Details:</b> <BR>
<b>Function:</b> [spell ? "Allows a non-wizard to cast [spell] as if they were a wizard." : "None"]"}
<b>Function:</b> [spell_to_give ? "Allows a non-wizard to cast [spell_to_give] as if they were a wizard." : "None."]"}
return dat
/obj/item/implant/spell/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
. = ..()
if (.)
if (!spell)
return FALSE
if (autorobeless && spell.clothes_req)
spell.clothes_req = FALSE
target.AddSpell(spell)
return TRUE
if (!.)
return
/obj/item/implant/spell/removed(mob/target, silent = FALSE, special = 0)
if (!spell_to_give)
return FALSE
spell_to_give.Grant(target)
return TRUE
/obj/item/implant/spell/removed(mob/living/source, silent = FALSE, special = 0)
. = ..()
if (.)
target.RemoveSpell(spell)
if(target.stat != DEAD && !silent)
to_chat(target, span_boldnotice("The knowledge of how to cast [spell] slips out from your mind."))
if (!.)
return FALSE
if(spell_to_give)
spell_to_give.Remove(source)
if(source.stat != DEAD && !silent)
to_chat(source, span_boldnotice("The knowledge of how to cast [spell_to_give] slips out from your mind."))
return TRUE
/obj/item/implanter/spell
name = "implanter (spell)"
@@ -1,7 +1,8 @@
/obj/item/implant/tracking
name = "tracking implant"
desc = "Track with this."
activated = FALSE
actions_types = null
///for how many deciseconds after user death will the implant work?
var/lifespan_postmortem = 6000
///will people implanted with this act as teleporter beacons?