This commit is contained in:
SandPoot
2024-04-05 17:57:54 -03:00
parent bd7040a50d
commit 68fa21d602
34 changed files with 223 additions and 126 deletions
+4 -6
View File
@@ -6,7 +6,6 @@
var/current_charges = 1
var/max_charges = 1
var/charge_rate = 250
var/mob/living/carbon/human/holder
var/obj/item/dashing_item
var/dash_sound = 'sound/magic/blink.ogg'
var/recharge_sound = 'sound/magic/charge.ogg'
@@ -17,7 +16,6 @@
/datum/action/innate/dash/Grant(mob/user, obj/dasher)
. = ..()
dashing_item = dasher
holder = user
/datum/action/innate/dash/IsAvailable(silent = FALSE)
if(current_charges > 0)
@@ -26,7 +24,7 @@
return FALSE
/datum/action/innate/dash/Activate()
dashing_item.attack_self(holder) //Used to toggle dash behavior in the dashing item
dashing_item.attack_self(owner) //Used to toggle dash behavior in the dashing item
/datum/action/innate/dash/proc/Teleport(mob/user, atom/target)
if(!IsAvailable())
@@ -38,12 +36,12 @@
var/obj/spot2 = new phasein(get_turf(user), user.dir)
spot1.Beam(spot2,beam_effect,time=20)
current_charges--
holder.update_action_buttons_icon()
owner.update_action_buttons_icon()
addtimer(CALLBACK(src, PROC_REF(charge)), charge_rate)
/datum/action/innate/dash/proc/charge()
current_charges = clamp(current_charges + 1, 0, max_charges)
holder.update_action_buttons_icon()
owner.update_action_buttons_icon()
if(recharge_sound)
playsound(dashing_item, recharge_sound, 50, 1)
to_chat(holder, "<span class='notice'>[src] now has [current_charges]/[max_charges] charges.</span>")
to_chat(owner, "<span class='notice'>[src] now has [current_charges]/[max_charges] charges.</span>")
+4
View File
@@ -27,12 +27,16 @@
/datum/dna/Destroy()
if(iscarbon(holder))
var/mob/living/carbon/cholder = holder
// We do this because a lot of stuff keeps references on species, for some reason.
species.on_species_loss(holder)
if(cholder.dna == src)
cholder.dna = null
holder = null
if(delete_species)
QDEL_NULL(species)
else
species = null
mutations.Cut() //This only references mutations, just dereference.
temporary_mutations.Cut() //^
+7 -6
View File
@@ -39,12 +39,13 @@
attached_atoms[target]++
/datum/element/photosynthesis/Detach(datum/target)
attached_atoms[target]--
if(!attached_atoms[target])
attached_atoms -= target
if(!length(attached_atoms))
STOP_PROCESSING(SSobj, src)
attached_atoms = null
if(LAZYLEN(attached_atoms))
attached_atoms[target]--
if(!attached_atoms[target])
attached_atoms -= target
if(!length(attached_atoms))
STOP_PROCESSING(SSobj, src)
attached_atoms = null
return ..()
/datum/element/photosynthesis/process()
+26 -12
View File
@@ -81,13 +81,13 @@
var/list/ambitions
//ambition end
///What character we spawned in as- either at roundstart or latejoin, so we know for persistent scars if we ended as the same person or not
var/mob/original_character
///Weakref to the character we spawned in as- either at roundstart or latejoin, so we know for persistent scars if we ended as the same person or not
var/datum/weakref/original_character
/// A lazy list of statuses to add next to this mind in the traitor panel
var/list/special_statuses
/datum/mind/New(var/key)
/datum/mind/New(key)
skill_holder = new(src)
src.key = key
soulOwner = src
@@ -95,15 +95,29 @@
/datum/mind/Destroy()
SSticker.minds -= src
if(islist(antag_datums))
for(var/i in antag_datums)
var/datum/antagonist/antag_datum = i
if(antag_datum.delete_on_mind_deletion)
qdel(i)
antag_datums = null
QDEL_LIST(antag_datums)
QDEL_NULL(language_holder)
QDEL_NULL(skill_holder)
set_current(null)
soulOwner = null
return ..()
/datum/mind/proc/set_current(mob/new_current)
if(new_current && QDELETED(new_current))
CRASH("Tried to set a mind's current var to a qdeleted mob, what the fuck")
if(current)
UnregisterSignal(src, COMSIG_PARENT_QDELETING)
current = new_current
if(current)
RegisterSignal(src, COMSIG_PARENT_QDELETING, PROC_REF(clear_current))
/datum/mind/proc/clear_current(datum/source)
SIGNAL_HANDLER
set_current(null)
/datum/mind/proc/set_original_character(new_original_character)
original_character = WEAKREF(new_original_character)
/datum/mind/proc/get_language_holder()
if(!language_holder)
language_holder = new (src)
@@ -126,13 +140,13 @@
key = new_character.key
if(new_character.mind) //disassociate any mind currently in our new body's mind variable
new_character.mind.current = null
new_character.mind.set_current(null)
var/datum/atom_hud/antag/hud_to_transfer = antag_hud//we need this because leave_hud() will clear this list
var/mob/living/old_current = current
if(current)
current.transfer_observers_to(new_character) //transfer anyone observing the old character to the new one
current = new_character //associate ourself with our new body
set_current(new_character) //associate ourself with our new body
new_character.mind = src //and associate our new body with ourself
for(var/a in antag_datums) //Makes sure all antag datums effects are applied in the new body
var/datum/antagonist/A = a
@@ -1715,7 +1729,7 @@ GLOBAL_LIST(objective_choices)
SEND_SIGNAL(src, COMSIG_MOB_ON_NEW_MIND)
if(!mind.name)
mind.name = real_name
mind.current = src
mind.set_current(src)
mind.hide_ckey = client?.prefs?.hide_ckey
/mob/living/carbon/mind_initialize()
+16 -15
View File
@@ -422,13 +422,13 @@
embedding = list("embedded_pain_multiplier" = 4, "embed_chance" = 100, "embedded_fall_chance" = 0)
w_class = WEIGHT_CLASS_SMALL
sharpness = SHARP_POINTY
var/mob/living/carbon/human/fired_by
var/datum/weakref/fired_by
/// if we missed our target
var/missed = TRUE
/obj/item/hardened_spike/Initialize(mapload, firedby)
. = ..()
fired_by = firedby
fired_by = WEAKREF(firedby)
addtimer(CALLBACK(src, PROC_REF(checkembedded)), 5 SECONDS)
/obj/item/hardened_spike/proc/checkembedded()
@@ -478,13 +478,16 @@
return
been_places = TRUE
chems = new
chems.transfered = embedded_mob
chems.spikey = src
to_chat(fired_by, "<span class='notice'>Link established! Use the \"Transfer Chemicals\" ability to send your chemicals to the linked target!</span>")
chems.Grant(fired_by)
chems.transfered = WEAKREF(embedded_mob)
var/mob/fired_by_mob = fired_by.resolve()
if(fired_by_mob)
to_chat(fired_by_mob, span_notice("Link established! Use the \"Transfer Chemicals\" ability to send your chemicals to the linked target!"))
chems.Grant(fired_by_mob)
/obj/item/hardened_spike/chem/unembedded()
to_chat(fired_by, "<span class='warning'>Link lost!</span>")
var/mob/fired_by_mob = fired_by.resolve()
if(fired_by_mob)
to_chat(fired_by_mob, span_warning("Link lost!"))
QDEL_NULL(chems)
..()
@@ -496,19 +499,17 @@
name = "Transfer Chemicals"
desc = "Send all of your reagents into whomever the chem spike is embedded in. One use."
var/obj/item/hardened_spike/chem/spikey
var/mob/living/carbon/human/transfered
var/datum/weakref/transfered
/datum/action/innate/send_chems/Activate()
if(!ishuman(transfered) || !ishuman(owner))
var/mob/living/carbon/human/transfered_mob = transfered?.resolve()
if(!ishuman(transfered_mob) || !ishuman(owner))
return
var/mob/living/carbon/human/transferer = owner
to_chat(transfered, "<span class='warning'>You feel a tiny prick!</span>")
transferer.reagents.trans_to(transfered, transferer.reagents.total_volume, 1, 1, 0)
to_chat(transfered_mob, span_warning("You feel a tiny prick!"))
owner.reagents.trans_to(transfered_mob, owner.reagents.total_volume, 1, 1, 0)
var/obj/item/bodypart/L = spikey.checkembedded()
//this is where it would deal damage, if it transfers chems it removes itself so no damage
spikey.forceMove(get_turf(L))
transfered.visible_message("<span class='notice'>[spikey] falls out of [transfered]!</span>")
transfered_mob.visible_message(span_notice("[spikey] falls out of [transfered_mob]!"))
+1 -2
View File
@@ -28,8 +28,7 @@
/datum/mutation/human/antenna/on_losing(mob/living/carbon/human/owner)
if(..())
return
if(linked_radio)
linked_radio.Destroy()
QDEL_NULL(linked_radio)
/datum/mutation/human/antenna/New(class_ = MUT_OTHER, timer, datum/mutation/human/copymut)
..()