mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 04:57:47 +01:00
Few fixes (#17993)
Fixes changeling stings becoming unusable after using them once Fixes transformation sting not being selectable due to having been swapped to absorbed DNA Fixes extraction sting from not being selectable due to old logic.
This commit is contained in:
@@ -74,12 +74,15 @@ var/list/datum/power/changeling/powerinstances = list()
|
||||
|
||||
///Handles the cooldown for the power. Returns TRUE if the cooldown has passed. FALSE if it's still on cooldown.
|
||||
///This is just a general anti-spam thing and not really a true cooldown
|
||||
/datum/component/antag/changeling/proc/handle_cooldown()
|
||||
|
||||
/datum/component/antag/changeling/proc/check_cooldown()
|
||||
if(world.time > last_used_sting_time+cooldown_time)
|
||||
last_used_sting_time = world.time
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/component/antag/changeling/proc/set_sting_cooldown()
|
||||
last_used_sting_time = world.time
|
||||
|
||||
/datum/component/antag/changeling/proc/get_cooldown(id)
|
||||
return changeling_cooldowns[id]
|
||||
|
||||
@@ -221,7 +224,7 @@ var/list/datum/power/changeling/powerinstances = list()
|
||||
/mob/proc/changeling_power(var/required_chems=0, var/required_dna=0, var/max_genetic_damage=100, var/max_stat=0)
|
||||
|
||||
if(!src.mind) return
|
||||
if(!iscarbon(src)) return
|
||||
if(!isliving(src)) return
|
||||
|
||||
var/datum/component/antag/changeling/comp = is_changeling(src)
|
||||
if(!comp)
|
||||
@@ -276,7 +279,7 @@ var/list/datum/power/changeling/powerinstances = list()
|
||||
var/datum/component/antag/changeling/comp = changeling_power(required_chems)
|
||||
if(!comp)
|
||||
return
|
||||
if(!comp.handle_cooldown())
|
||||
if(!comp.check_cooldown())
|
||||
to_chat(src, span_warning("We are still recovering from our last sting."))
|
||||
return
|
||||
|
||||
@@ -286,8 +289,9 @@ var/list/datum/power/changeling/powerinstances = list()
|
||||
var/mob/living/carbon/T = tgui_input_list(src, "Who will we sting?", "Sting!", victims)
|
||||
|
||||
if(!T)
|
||||
to_chat(src, span_warning("We have no targets in range to sting!"))
|
||||
return
|
||||
if(!comp.handle_cooldown())//Check again in case we have multiple windows open at once.
|
||||
if(!comp.check_cooldown())//Check again in case we have multiple windows open at once.
|
||||
to_chat(src, span_warning("We are still recovering from our last sting."))
|
||||
return
|
||||
if(T.isSynthetic())
|
||||
@@ -299,6 +303,7 @@ var/list/datum/power/changeling/powerinstances = list()
|
||||
|
||||
comp.chem_charges -= required_chems
|
||||
comp.sting_range = 1
|
||||
comp.set_sting_cooldown()
|
||||
|
||||
to_chat(src, span_notice("We stealthily sting [T]."))
|
||||
var/datum/component/antag/changeling/target_comp = is_changeling(T)
|
||||
|
||||
@@ -13,14 +13,7 @@
|
||||
set name = "Extract DNA Sting (40)"
|
||||
set desc="Stealthily sting a target to extract their DNA."
|
||||
|
||||
var/datum/component/antag/changeling/changeling = null
|
||||
if(src.mind && changeling)
|
||||
changeling = changeling
|
||||
if(!changeling)
|
||||
return FALSE
|
||||
|
||||
var/mob/living/carbon/human/T = changeling_sting(40, /mob/proc/changeling_extract_dna_sting)
|
||||
|
||||
if(!T)
|
||||
return
|
||||
|
||||
|
||||
@@ -12,32 +12,41 @@
|
||||
set name = "Transformation sting (40)"
|
||||
set desc="Sting target"
|
||||
|
||||
var/datum/component/antag/changeling/changeling = changeling_power(40)
|
||||
var/datum/component/antag/changeling/changeling = changeling_power(40, 1, 100, CONSCIOUS)
|
||||
if(!changeling)
|
||||
to_world("Changeling = false)")
|
||||
return FALSE
|
||||
|
||||
var/list/names = list()
|
||||
for(var/datum/dna/DNA in changeling.absorbed_dna)
|
||||
names += "[DNA.real_name]"
|
||||
for(var/datum/absorbed_dna/DNA in changeling.absorbed_dna)
|
||||
names += "[DNA.name]"
|
||||
if(!LAZYLEN(names))
|
||||
to_chat(src, "We have no DNA to select from!)")
|
||||
return FALSE
|
||||
var/S
|
||||
if(LAZYLEN(names) > 1)
|
||||
tgui_input_list(src, "Select the target DNA:", "Target DNA", names)
|
||||
to_world("dna > 1")
|
||||
else
|
||||
to_world("dna == 1")
|
||||
S = names[1]
|
||||
|
||||
var/S = tgui_input_list(src, "Select the target DNA:", "Target DNA", names)
|
||||
if(!S)
|
||||
return
|
||||
|
||||
var/datum/dna/chosen_dna = changeling.GetDNA(S)
|
||||
var/datum/absorbed_dna/chosen_dna = changeling.GetDNA(S)
|
||||
if(!chosen_dna)
|
||||
to_world("CD = false)")
|
||||
return
|
||||
|
||||
var/mob/living/carbon/T = changeling_sting(40,/mob/proc/changeling_transformation_sting)
|
||||
if(!T)
|
||||
to_world("T = false)")
|
||||
return FALSE
|
||||
if((HUSK in T.mutations) || (!ishuman(T) && !issmall(T)))
|
||||
to_chat(src, span_warning("Our sting appears ineffective against its DNA."))
|
||||
return FALSE
|
||||
add_attack_logs(src,T,"Transformation sting (changeling)")
|
||||
T.visible_message(span_warning("[T] transforms!"))
|
||||
qdel_swap(T.dna, chosen_dna.Clone())
|
||||
T.real_name = chosen_dna.real_name
|
||||
qdel_swap(T.dna, chosen_dna.dna.Clone())
|
||||
T.real_name = chosen_dna.dna.real_name
|
||||
T.UpdateAppearance()
|
||||
domutcheck(T, null)
|
||||
feedback_add_details("changeling_powers","TS")
|
||||
|
||||
Reference in New Issue
Block a user