diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 7a051f999d..9f6ccb742d 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1636,11 +1636,6 @@ GLOBAL_LIST(objective_choices) for(var/X in spell_list) var/obj/effect/proc_holder/spell/S = X S.action.Grant(new_character) - var/datum/antagonist/changeling/changeling = new_character.mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling &&(ishuman(new_character) || ismonkey(new_character))) - for(var/P in changeling.purchasedpowers) - var/obj/effect/proc_holder/changeling/I = P - I.action.Grant(new_character) /datum/mind/proc/disrupt_spells(delay, list/exceptions = New()) for(var/X in spell_list) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index fd43b994e8..bf45fe7efe 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -876,7 +876,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) continue var/total_genetic_points = changeling.geneticpoints - for(var/obj/effect/proc_holder/changeling/p in changeling.purchasedpowers) + for(var/datum/action/changeling/p in changeling.purchasedpowers) total_genetic_points += p.dna_cost if(total_genetic_points > initial(changeling.geneticpoints)) diff --git a/code/modules/antagonists/changeling/cellular_emporium.dm b/code/modules/antagonists/changeling/cellular_emporium.dm index 2538394db7..d825fa048e 100644 --- a/code/modules/antagonists/changeling/cellular_emporium.dm +++ b/code/modules/antagonists/changeling/cellular_emporium.dm @@ -25,7 +25,7 @@ /datum/cellular_emporium/ui_data(mob/user) var/list/data = list() - var/can_readapt = changeling.canrespec + var/can_readapt = changeling.can_respec var/genetic_points_remaining = changeling.geneticpoints var/absorbed_dna_count = changeling.absorbedcount var/true_absorbs = changeling.trueabsorbs @@ -37,7 +37,7 @@ var/list/abilities = list() for(var/path in changeling.all_powers) - var/obj/effect/proc_holder/changeling/ability = path + var/datum/action/changeling/ability = path var/dna_cost = initial(ability.dna_cost) if(dna_cost <= 0) @@ -65,7 +65,7 @@ switch(action) if("readapt") - if(changeling.canrespec) + if(changeling.can_respec) changeling.readapt() if("evolve") var/sting_name = params["name"] @@ -75,7 +75,7 @@ name = "Cellular Emporium" icon_icon = 'icons/obj/drinks.dmi' button_icon_state = "changelingsting" - background_icon_state = "bg_ling" + background_icon_state = "bg_changeling" var/datum/cellular_emporium/cellular_emporium /datum/action/innate/cellular_emporium/New(our_target) diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index 8e6b5c9060..b92722eb8f 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -2,6 +2,9 @@ #define LING_DEAD_GENETICDAMAGE_HEAL_CAP 50 //The lowest value of geneticdamage handle_changeling() can take it to while dead. #define LING_ABSORB_RECENT_SPEECH 8 //The amount of recent spoken lines to gain on absorbing a mob +/// Helper to format the text that gets thrown onto the chem hud element. +#define FORMAT_CHEM_CHARGES_TEXT(charges) MAPTEXT("
[round(charges)]
") + /datum/antagonist/changeling name = "Changeling" roundend_category = "changelings" @@ -34,19 +37,19 @@ var/geneticpoints = 10 var/maxgeneticpoints = 10 var/purchasedpowers = list() + var/mimicing = "" - var/canrespec = 0 + var/can_respec = FALSE//set to TRUE in absorb.dm var/changeling_speak = 0 var/loudfactor = 0 //Used for blood tests. This is is the average loudness of the ling's abilities calculated with the below two vars var/loudtotal = 0 //Used to keep track of the sum of the ling's loudness var/totalpurchases = 0 //Used to keep track of how many purchases the ling's made after free abilities have been added var/datum/dna/chosen_dna - var/obj/effect/proc_holder/changeling/sting/chosen_sting + var/datum/action/changeling/sting/chosen_sting var/datum/cellular_emporium/cellular_emporium var/datum/action/innate/cellular_emporium/emporium_action - // wip stuff - var/static/list/all_powers = typecacheof(/obj/effect/proc_holder/changeling,TRUE) + var/static/list/all_powers = typecacheof(/datum/action/changeling,TRUE) /datum/antagonist/changeling/Destroy() @@ -72,6 +75,7 @@ /datum/antagonist/changeling/proc/create_actions() cellular_emporium = new(src) emporium_action = new(cellular_emporium) + emporium_action.Grant(owner.current) /datum/antagonist/changeling/on_gain() generate_name() @@ -127,11 +131,9 @@ reset_properties() QDEL_NULL(cellular_emporium) QDEL_NULL(emporium_action) - for(var/obj/effect/proc_holder/changeling/p in purchasedpowers) - if(p.always_keep) - continue + for(var/datum/action/changeling/p in purchasedpowers) purchasedpowers -= p - p.on_refund(owner.current) + p.Remove(owner.current) //MOVE THIS if(owner.current.hud_used) @@ -144,7 +146,7 @@ create_actions() //Repurchase free powers. for(var/path in all_powers) - var/obj/effect/proc_holder/changeling/S = new path() + var/datum/action/changeling/S = new path() if(!S.dna_cost) if(!has_sting(S)) purchasedpowers += S @@ -153,20 +155,28 @@ loudtotal = 0 totalpurchases = 0 -/datum/antagonist/changeling/proc/has_sting(obj/effect/proc_holder/changeling/power) - for(var/obj/effect/proc_holder/changeling/P in purchasedpowers) - if(initial(power.name) == P.name) +/datum/antagonist/changeling/proc/regain_powers()//for when action buttons are lost and need to be regained, such as when the mind enters a new mob + emporium_action.Grant(owner.current) + for(var/power in purchasedpowers) + var/datum/action/changeling/S = power + if(istype(S) && S.needs_button) + S.Grant(owner.current) + +/datum/antagonist/changeling/proc/has_sting(datum/action/changeling/power) + for(var/P in purchasedpowers) + var/datum/action/changeling/otherpower = P + if(initial(power.name) == otherpower.name) return TRUE return FALSE /datum/antagonist/changeling/proc/purchase_power(sting_name) - var/obj/effect/proc_holder/changeling/thepower = null + var/datum/action/changeling/thepower for(var/path in all_powers) - var/obj/effect/proc_holder/changeling/S = path + var/datum/action/changeling/S = path if(initial(S.name) == sting_name) - thepower = new path() + thepower = new path break if(!thepower) @@ -195,7 +205,7 @@ geneticpoints -= thepower.dna_cost purchasedpowers += thepower - thepower.on_purchase(owner.current) + thepower.on_purchase(owner.current)//Grant() is ran in this proc, see changeling_powers.dm loudtotal += thepower.loudness totalpurchases++ var/oldloudness = loudfactor @@ -213,11 +223,11 @@ if(!ishuman(owner.current)) to_chat(owner.current, "We can't remove our evolutions in this form!") return - if(canrespec) + if(can_respec) to_chat(owner.current, "We have removed our evolutions from this form, and are now ready to readapt.") reset_powers() playsound(get_turf(owner.current), 'sound/effects/lingreadapt.ogg', 75, TRUE, 5) - canrespec = 0 + can_respec = 0 SSblackbox.record_feedback("tally", "changeling_power_purchase", 1, "Readapt") return 1 else @@ -225,11 +235,9 @@ return 0 //Called in life() -/datum/antagonist/changeling/proc/regenerate() +/datum/antagonist/changeling/proc/regenerate()//grants the HuD in life.dm var/mob/living/carbon/the_ling = owner.current if(istype(the_ling)) - if(emporium_action) - emporium_action.Grant(the_ling) if(the_ling.stat == DEAD) chem_charges = min(max(0, chem_charges + chem_recharge_rate - chem_recharge_slowdown), (chem_storage*0.5)) geneticdamage = max(LING_DEAD_GENETICDAMAGE_HEAL_CAP,geneticdamage-1) @@ -237,7 +245,7 @@ chem_charges = min(max(0, chem_charges + chem_recharge_rate - chem_recharge_slowdown), chem_storage) geneticdamage = max(0, geneticdamage-1) owner.current.hud_used?.lingchemdisplay?.invisibility = 0 - owner.current.hud_used?.lingchemdisplay?.maptext = "
[round(chem_charges)]
" + owner.current.hud_used?.lingchemdisplay?.maptext = FORMAT_CHEM_CHARGES_TEXT(chem_charges) /datum/antagonist/changeling/proc/get_dna(dna_owner) diff --git a/code/modules/antagonists/changeling/changeling_power.dm b/code/modules/antagonists/changeling/changeling_power.dm index 6ea97b0595..c784939c0f 100644 --- a/code/modules/antagonists/changeling/changeling_power.dm +++ b/code/modules/antagonists/changeling/changeling_power.dm @@ -1,39 +1,42 @@ /* - * Don't use the apostrophe in name or desc. Causes script errors. - * TODO: combine atleast some of the functionality with /proc_holder/spell + * Don't use the apostrophe in name or desc. Causes script errors.//probably no longer true */ -/obj/effect/proc_holder/changeling - panel = "Changeling" - name = "Prototype Sting" - desc = "" // Fluff +/datum/action/changeling + name = "Prototype Sting - Debug button, ahelp this" + background_icon_state = "bg_changeling" + icon_icon = 'icons/mob/actions/actions_changeling.dmi' + var/needs_button = TRUE//for passive abilities like hivemind that dont need a button var/helptext = "" // Details var/chemical_cost = 0 // negative chemical cost is for passive abilities (chemical glands) - var/dna_cost = -1 //cost of the sting in dna points. 0 = auto-purchase, -1 = cannot be purchased + var/dna_cost = -1 //cost of the sting in dna points. 0 = auto-purchase (see changeling.dm), -1 = cannot be purchased var/req_dna = 0 //amount of dna needed to use this ability. Changelings always have atleast 1 var/req_human = 0 //if you need to be human to use this ability var/req_absorbs = 0 //similar to req_dna, but only gained from absorbing, not DNA sting var/req_stat = CONSCIOUS // CONSCIOUS, UNCONSCIOUS or DEAD - var/always_keep = 0 // important for abilities like revive that screw you if you lose them. var/ignores_fakedeath = FALSE // usable with the FAKEDEATH flag var/loudness = 0.5 //Determines how much having this ability will affect changeling blood tests. This is averaged with other purchased abilities. Above 1, the blood will react violently and turn to ash, creating a unique message in the process. Above 2, the blood will explode when heated. + var/active = FALSE//used by a few powers that toggle +/* +changeling code now relies on on_purchase to grant powers. +if you override it, MAKE SURE you call parent or it will not be usable +the same goes for Remove(). if you override Remove(), call parent or else your power wont be removed on respec +*/ -/obj/effect/proc_holder/changeling/proc/on_purchase(mob/user, is_respec) - action.Grant(user) +/datum/action/changeling/proc/on_purchase(mob/user, is_respec) if(!is_respec) SSblackbox.record_feedback("tally", "changeling_power_purchase", 1, name) + if(needs_button) + Grant(user)//how powers are added rather than the checks in mob.dm -/obj/effect/proc_holder/changeling/proc/on_refund(mob/user) - action.Remove(user) - return - -/obj/effect/proc_holder/changeling/Trigger(mob/user) +/datum/action/changeling/Trigger() + var/mob/user = owner if(!user || !user.mind || !user.mind.has_antag_datum(/datum/antagonist/changeling)) return try_to_sting(user) -/obj/effect/proc_holder/changeling/proc/try_to_sting(mob/user, mob/target) +/datum/action/changeling/proc/try_to_sting(mob/user, mob/target) if(!can_sting(user, target)) return var/datum/antagonist/changeling/c = user.mind.has_antag_datum(/datum/antagonist/changeling) @@ -42,39 +45,41 @@ sting_feedback(user, target) c.chem_charges -= chemical_cost -/obj/effect/proc_holder/changeling/proc/sting_action(mob/user, mob/target) +/datum/action/changeling/proc/sting_action(mob/user, mob/target) + SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]")) return 0 -/obj/effect/proc_holder/changeling/proc/sting_feedback(mob/user, mob/target) +/datum/action/changeling/proc/sting_feedback(mob/user, mob/target) return 0 -//Fairly important to remember to return 1 on success >.< -/obj/effect/proc_holder/changeling/proc/can_sting(mob/living/user, mob/target) +//Fairly important to remember to return TRUE on success >.< + +/datum/action/changeling/proc/can_sting(mob/living/user, mob/target) if(!ishuman(user) && !ismonkey(user)) //typecast everything from mob to carbon from this point onwards - return 0 + return FALSE if(req_human && !ishuman(user)) to_chat(user, "We cannot do that in this form!") - return 0 + return FALSE var/datum/antagonist/changeling/c = user.mind.has_antag_datum(/datum/antagonist/changeling) if(c.chem_charges < chemical_cost) to_chat(user, "We require at least [chemical_cost] unit\s of chemicals to do that!") - return 0 + return FALSE if(c.absorbedcount < req_dna) to_chat(user, "We require at least [req_dna] sample\s of compatible DNA.") - return 0 + return FALSE if(c.trueabsorbs < req_absorbs) to_chat(user, "We require at least [req_absorbs] sample\s of DNA gained through our Absorb ability.") if(req_stat < user.stat) to_chat(user, "We are incapacitated.") - return 0 + return FALSE if((HAS_TRAIT(user, TRAIT_DEATHCOMA)) && (!ignores_fakedeath)) to_chat(user, "We are incapacitated.") - return 0 - return 1 + return FALSE + return TRUE //used in /mob/Stat() -/obj/effect/proc_holder/changeling/proc/can_be_used_by(mob/user) - if(QDELETED(user)) +/datum/action/changeling/proc/can_be_used_by(mob/user) + if(!user || QDELETED(user)) return FALSE if(!ishuman(user) && !ismonkey(user)) return FALSE diff --git a/code/modules/antagonists/changeling/powers/absorb.dm b/code/modules/antagonists/changeling/powers/absorb.dm index 4e68e27583..00d99ea4c9 100644 --- a/code/modules/antagonists/changeling/powers/absorb.dm +++ b/code/modules/antagonists/changeling/powers/absorb.dm @@ -1,14 +1,11 @@ -/obj/effect/proc_holder/changeling/absorbDNA +/datum/action/changeling/absorbDNA name = "Absorb DNA" - desc = "Absorb the DNA of our victim." - chemical_cost = 0 + desc = "Absorb the DNA of our victim. Requires us to strangle them." + button_icon_state = "absorb_dna" dna_cost = 0 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_absorb_dna" - action_background_icon_state = "bg_ling" + req_human = TRUE -/obj/effect/proc_holder/changeling/absorbDNA/can_sting(mob/living/carbon/user) +/datum/action/changeling/absorbDNA/can_sting(mob/living/carbon/user) if(!..()) return @@ -29,7 +26,7 @@ -/obj/effect/proc_holder/changeling/absorbDNA/sting_action(mob/user) +/datum/action/changeling/absorbDNA/sting_action(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) var/mob/living/carbon/human/target = user.pulling changeling.isabsorbing = 1 @@ -100,7 +97,7 @@ changeling.geneticpoints += round(target_ling.geneticpoints/2) changeling.maxgeneticpoints += round(target_ling.geneticpoints/2) target_ling.geneticpoints = 0 - target_ling.canrespec = 0 + target_ling.can_respec = 0 changeling.chem_storage += round(target_ling.chem_storage/2) changeling.chem_charges += min(target_ling.chem_charges, changeling.chem_storage) target_ling.chem_charges = 0 @@ -114,7 +111,7 @@ changeling.chem_charges=min(changeling.chem_charges+10, changeling.chem_storage) changeling.isabsorbing = 0 - changeling.canrespec = 1 + changeling.can_respec = 1 target.death(0) target.Drain() diff --git a/code/modules/antagonists/changeling/powers/adrenaline.dm b/code/modules/antagonists/changeling/powers/adrenaline.dm index 643458d05a..7c58b65eb5 100644 --- a/code/modules/antagonists/changeling/powers/adrenaline.dm +++ b/code/modules/antagonists/changeling/powers/adrenaline.dm @@ -1,17 +1,15 @@ -/obj/effect/proc_holder/changeling/adrenaline +/datum/action/changeling/adrenaline name = "Adrenaline Sacs" - desc = "We evolve additional sacs of adrenaline throughout our body." + desc = "We evolve additional sacs of adrenaline throughout our body. Costs 30 chemicals." helptext = "Removes all stuns instantly and adds a short-term reduction in further stuns. Can be used while unconscious. Continued use poisons the body. This ability is loud, and might cause our blood to react violently to heat." + button_icon_state = "adrenaline" chemical_cost = 30 loudness = 2 dna_cost = 2 - req_human = 1 + req_human = TRUE req_stat = UNCONSCIOUS - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_adrenals" - action_background_icon_state = "bg_ling" //Recover from stuns. -/obj/effect/proc_holder/changeling/adrenaline/sting_action(mob/living/user) +/datum/action/changeling/adrenaline/sting_action(mob/living/user) user.do_adrenaline(0, FALSE, 70, 0, TRUE, list(/datum/reagent/medicine/epinephrine = 3, /datum/reagent/medicine/changelinghaste = 10, /datum/reagent/medicine/changelingadrenaline = 5), "Energy rushes through us.", 0, 0.75, 0) return TRUE diff --git a/code/modules/antagonists/changeling/powers/augmented_eyesight.dm b/code/modules/antagonists/changeling/powers/augmented_eyesight.dm index a6fdf7008a..b3ac83f62f 100644 --- a/code/modules/antagonists/changeling/powers/augmented_eyesight.dm +++ b/code/modules/antagonists/changeling/powers/augmented_eyesight.dm @@ -1,27 +1,24 @@ //Augmented Eyesight: Gives you X-ray vision or protection from flashes. Also, high DNA cost because of how powerful it is. //Possible todo: make a custom message for directing a penlight/flashlight at the eyes - not sure what would display though. -/obj/effect/proc_holder/changeling/augmented_eyesight +/datum/action/changeling/augmented_eyesight name = "Augmented Eyesight" desc = "Creates heat receptors in our eyes and dramatically increases light sensing ability, or protects your vision from flashes." helptext = "Grants us thermal vision or flash protection. We will become a lot more vulnerable to flash-based devices while thermal vision is active." - chemical_cost = 0 + button_icon_state = "augmented_eyesight" dna_cost = 2 //Would be 1 without thermal vision active = FALSE - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_augmented_eyesight" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/augmented_eyesight/on_purchase(mob/user) //The ability starts inactive, so we should be protected from flashes. +/datum/action/changeling/augmented_eyesight/on_purchase(mob/user) //The ability starts inactive, so we should be protected from flashes. + ..() var/obj/item/organ/eyes/E = user.getorganslot(ORGAN_SLOT_EYES) if (E) E.flash_protect = 2 //Adjust the user's eyes' flash protection to_chat(user, "We adjust our eyes to protect them from bright lights.") - action.Grant(user) else to_chat(user, "We can't adjust our eyes if we don't have any!") -/obj/effect/proc_holder/changeling/augmented_eyesight/sting_action(mob/living/carbon/human/user) +/datum/action/changeling/augmented_eyesight/sting_action(mob/living/carbon/human/user) if(!istype(user)) return var/obj/item/organ/eyes/E = user.getorganslot(ORGAN_SLOT_EYES) @@ -39,16 +36,13 @@ user.update_sight() else to_chat(user, "We can't adjust our eyes if we don't have any!") + return TRUE - - return 1 - - -/obj/effect/proc_holder/changeling/augmented_eyesight/on_refund(mob/user) //Get rid of X-ray vision and flash protection when the user refunds this ability - action.Remove(user) +/datum/action/changeling/augmented_eyesight/Remove(mob/user) //Get rid of x-ray vision and flash protection when the user refunds this ability REMOVE_TRAIT(user, TRAIT_THERMAL_VISION, CHANGELING_TRAIT) var/obj/item/organ/eyes/E = user.getorganslot(ORGAN_SLOT_EYES) if(E) E.flash_protect = initial(E.flash_protect) user.update_sight() + ..() diff --git a/code/modules/antagonists/changeling/powers/biodegrade.dm b/code/modules/antagonists/changeling/powers/biodegrade.dm index b440228a4e..1ca2f1456d 100644 --- a/code/modules/antagonists/changeling/powers/biodegrade.dm +++ b/code/modules/antagonists/changeling/powers/biodegrade.dm @@ -1,16 +1,14 @@ -/obj/effect/proc_holder/changeling/biodegrade +/datum/action/changeling/biodegrade name = "Biodegrade" - desc = "Dissolves restraints or other objects preventing free movement." + desc = "Dissolves restraints or other objects preventing free movement. Costs 15 chemicals." helptext = "This is obvious to nearby people, and can destroy standard restraints and closets. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "biodegrade" chemical_cost = 15 //High cost to prevent spam loudness = 1 dna_cost = 2 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_freedom" - action_background_icon_state = "bg_ling" + req_human = TRUE -/obj/effect/proc_holder/changeling/biodegrade/sting_action(mob/living/carbon/human/user) +/datum/action/changeling/biodegrade/sting_action(mob/living/carbon/human/user) var/used = FALSE // only one form of shackles removed per use if(!user.restrained() && !user.legcuffed && isopenturf(user.loc)) to_chat(user, "We are already free!") @@ -66,25 +64,25 @@ return used -/obj/effect/proc_holder/changeling/biodegrade/proc/dissolve_handcuffs(mob/living/carbon/human/user, obj/O) +/datum/action/changeling/biodegrade/proc/dissolve_handcuffs(mob/living/carbon/human/user, obj/O) if(O && user.handcuffed == O) user.visible_message("[O] dissolve[O.gender==PLURAL?"":"s"] into a puddle of sizzling goop.") new /obj/effect/decal/cleanable/greenglow(O.drop_location()) qdel(O) -/obj/effect/proc_holder/changeling/biodegrade/proc/dissolve_legcuffs(mob/living/carbon/human/user, obj/O) +/datum/action/changeling/biodegrade/proc/dissolve_legcuffs(mob/living/carbon/human/user, obj/O) if(O && user.legcuffed == O) user.visible_message("[O] dissolve[O.gender==PLURAL?"":"s"] into a puddle of sizzling goop.") new /obj/effect/decal/cleanable/greenglow(O.drop_location()) qdel(O) -/obj/effect/proc_holder/changeling/biodegrade/proc/dissolve_straightjacket(mob/living/carbon/human/user, obj/S) +/datum/action/changeling/biodegrade/proc/dissolve_straightjacket(mob/living/carbon/human/user, obj/S) if(S && user.wear_suit == S) user.visible_message("[S] dissolves into a puddle of sizzling goop.") new /obj/effect/decal/cleanable/greenglow(S.drop_location()) qdel(S) -/obj/effect/proc_holder/changeling/biodegrade/proc/open_closet(mob/living/carbon/human/user, obj/structure/closet/C) +/datum/action/changeling/biodegrade/proc/open_closet(mob/living/carbon/human/user, obj/structure/closet/C) if(C && user.loc == C) C.visible_message("[C]'s door breaks and opens!") new /obj/effect/decal/cleanable/greenglow(C.drop_location()) @@ -94,7 +92,7 @@ C.open() to_chat(user, "We open the container restraining us!") -/obj/effect/proc_holder/changeling/biodegrade/proc/dissolve_cocoon(mob/living/carbon/human/user, obj/structure/spider/cocoon/C) +/datum/action/changeling/biodegrade/proc/dissolve_cocoon(mob/living/carbon/human/user, obj/structure/spider/cocoon/C) if(C && user.loc == C) new /obj/effect/decal/cleanable/greenglow(C.drop_location()) qdel(C) //The cocoon's destroy will move the changeling outside of it without interference diff --git a/code/modules/antagonists/changeling/powers/chameleon_skin.dm b/code/modules/antagonists/changeling/powers/chameleon_skin.dm index c01a1e40c8..21d4717b33 100644 --- a/code/modules/antagonists/changeling/powers/chameleon_skin.dm +++ b/code/modules/antagonists/changeling/powers/chameleon_skin.dm @@ -1,14 +1,12 @@ -/obj/effect/proc_holder/changeling/chameleon_skin +/datum/action/changeling/chameleon_skin name = "Chameleon Skin" desc = "Our skin pigmentation rapidly changes to suit our current environment." helptext = "Allows us to become invisible after a few seconds of standing still. Can be toggled on and off." + button_icon_state = "chameleon_skin" dna_cost = 2 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_camouflage" - action_background_icon_state = "bg_ling" + req_human = TRUE -/obj/effect/proc_holder/changeling/chameleon_skin/sting_action(mob/user) +/datum/action/changeling/chameleon_skin/sting_action(mob/user) var/mob/living/carbon/human/H = user //SHOULD always be human, because req_human = 1 if(!istype(H)) // req_human could be done in can_sting stuff. return @@ -18,8 +16,8 @@ H.dna.add_mutation(CHAMELEON) return TRUE -/obj/effect/proc_holder/changeling/chameleon_skin/on_refund(mob/user) - action.Remove(user) +/datum/action/changeling/chameleon_skin/Remove(mob/user) if(user.has_dna()) var/mob/living/carbon/C = user C.dna.remove_mutation(CHAMELEON) + ..() diff --git a/code/modules/antagonists/changeling/powers/digitalcamo.dm b/code/modules/antagonists/changeling/powers/digitalcamo.dm index e44a7c0aa5..9354aec9ec 100644 --- a/code/modules/antagonists/changeling/powers/digitalcamo.dm +++ b/code/modules/antagonists/changeling/powers/digitalcamo.dm @@ -1,27 +1,25 @@ -/obj/effect/proc_holder/changeling/digitalcamo +/datum/action/changeling/digitalcamo name = "Digital Camouflage" desc = "By evolving the ability to distort our form and proportions, we defeat common algorithms used to detect lifeforms on cameras." helptext = "We cannot be tracked by camera or seen by AI units while using this skill. However, humans looking at us will find us... uncanny. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "digital_camo" dna_cost = 1 loudness = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_digital_camo" - action_background_icon_state = "bg_ling" //Prevents AIs tracking you but makes you easily detectable to the human-eye. -/obj/effect/proc_holder/changeling/digitalcamo/sting_action(mob/user) +/datum/action/changeling/digitalcamo/sting_action(mob/user) if(user.digitalcamo) to_chat(user, "We return to normal.") - user.digitalinvis = 0 - user.digitalcamo = 0 + user.digitalinvis = FALSE + user.digitalcamo = FALSE else - to_chat(user, "We distort our form to hide from the AI") - user.digitalcamo = 1 - user.digitalinvis = 1 + to_chat(user, "We distort our form to hide from the AI.") + user.digitalcamo = TRUE + user.digitalinvis = TRUE return TRUE -/obj/effect/proc_holder/changeling/digitalcamo/on_refund(mob/user) - action.Remove(user) - user.digitalcamo = 0 - user.digitalinvis = 0 +/datum/action/changeling/digitalcamo/Remove(mob/user) + user.digitalcamo = FALSE + user.digitalinvis = FALSE + ..() diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm index 08dc85efbf..7ce9da633e 100644 --- a/code/modules/antagonists/changeling/powers/fakedeath.dm +++ b/code/modules/antagonists/changeling/powers/fakedeath.dm @@ -1,41 +1,70 @@ -/obj/effect/proc_holder/changeling/fakedeath +/datum/action/changeling/fakedeath name = "Reviving Stasis" - desc = "We fall into a stasis, allowing us to regenerate and trick our enemies." + desc = "We fall into a stasis, allowing us to regenerate and trick our enemies. Costs 15 chemicals." + button_icon_state = "fake_death" chemical_cost = 15 dna_cost = 0 req_dna = 1 req_stat = DEAD ignores_fakedeath = TRUE - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_regenerative_stasis" - action_background_icon_state = "bg_ling" + var/revive_ready = FALSE //Fake our own death and fully heal. You will appear to be dead but regenerate fully after a short delay. -/obj/effect/proc_holder/changeling/fakedeath/sting_action(mob/living/user) - to_chat(user, "We begin our stasis, preparing energy to arise once more.") - if(user.stat != DEAD) - user.emote("deathgasp") - user.tod = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time) - user.fakedeath("changeling", TRUE) //play dead - user.update_stat() - - addtimer(CALLBACK(src, .proc/ready_to_regenerate, user), LING_FAKEDEATH_TIME, TIMER_UNIQUE) +/datum/action/changeling/fakedeath/sting_action(mob/living/user) + ..() + if(revive_ready) + revive(user) + else + to_chat(user, "We begin our stasis, preparing energy to arise once more.") + if(user.stat != DEAD) + user.emote("deathgasp") + user.tod = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time) + user.fakedeath("changeling", TRUE) //play dead + user.update_stat() + addtimer(CALLBACK(src, .proc/ready_to_regenerate, user), LING_FAKEDEATH_TIME, TIMER_UNIQUE) return TRUE -/obj/effect/proc_holder/changeling/fakedeath/proc/ready_to_regenerate(mob/user) +/datum/action/changeling/fakedeath/proc/revive(mob/living/user) + user.cure_fakedeath("changeling") + user.revive(full_heal = TRUE) + var/list/missing = user.get_missing_limbs() + missing -= BODY_ZONE_HEAD // headless changelings are funny + if(missing.len) + playsound(user, 'sound/magic/demon_consume.ogg', 50, 1) + user.visible_message("[user]'s missing limbs \ + reform, making a loud, grotesque sound!", + "Your limbs regrow, making a \ + loud, crunchy sound and giving you great pain!", + "You hear organic matter ripping \ + and tearing!") + user.emote("scream") + user.regenerate_limbs(0, list(BODY_ZONE_HEAD)) + user.regenerate_organs() + revive_ready = FALSE + name = "Reviving Stasis" + desc = "We fall into a stasis, allowing us to regenerate and trick our enemies. Costs 15 chemicals." + button_icon_state = "fake_death" + UpdateButtonIcon() + chemical_cost = 15 + to_chat(user, "We have revived ourselves.") + +/datum/action/changeling/fakedeath/proc/ready_to_regenerate(mob/user) if(user && user.mind) var/datum/antagonist/changeling/C = user.mind.has_antag_datum(/datum/antagonist/changeling) if(C && C.purchasedpowers) to_chat(user, "We are ready to revive.") - var/obj/effect/proc_holder/changeling/revive/RV = new /obj/effect/proc_holder/changeling/revive(null) - C.purchasedpowers += RV - RV.action.Grant(user) + name = "Revive" + desc = "We arise once more." + button_icon_state = "revive" + UpdateButtonIcon() + chemical_cost = 0 + revive_ready = TRUE -/obj/effect/proc_holder/changeling/fakedeath/can_sting(mob/living/user) - if(HAS_TRAIT_FROM(user, TRAIT_DEATHCOMA, "changeling")) +/datum/action/changeling/fakedeath/can_sting(mob/living/user) + if(HAS_TRAIT_FROM(user, TRAIT_DEATHCOMA, "changeling") && !revive_ready) to_chat(user, "We are already reviving.") return - if(!user.stat) //Confirmation for living changelings if they want to fake their death + if(!user.stat && !revive_ready) //Confirmation for living changelings if they want to fake their death switch(alert("Are we sure we wish to fake our own death?",,"Yes", "No")) if("No") return diff --git a/code/modules/antagonists/changeling/powers/fleshmend.dm b/code/modules/antagonists/changeling/powers/fleshmend.dm index 0299abb09a..4b62afb09b 100644 --- a/code/modules/antagonists/changeling/powers/fleshmend.dm +++ b/code/modules/antagonists/changeling/powers/fleshmend.dm @@ -1,18 +1,16 @@ -/obj/effect/proc_holder/changeling/fleshmend +/datum/action/changeling/fleshmend name = "Fleshmend" - desc = "Our flesh rapidly regenerates, healing our burns, bruises, and shortness of breath, as well as hiding all of our scars. Costs 20 chemicals." - helptext = "If we are on fire, the healing effect will not function. Does not regrow limbs or restore lost blood." + desc = "Our flesh rapidly regenerates, healing our burns, bruises, and shortness of breath. Costs 20 chemicals." + helptext = "If we are on fire, the healing effect will not function. Does not regrow limbs or restore lost blood. Functions while unconscious." + button_icon_state = "fleshmend" chemical_cost = 20 loudness = 2 dna_cost = 2 req_stat = UNCONSCIOUS - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_fleshmend" - action_background_icon_state = "bg_ling" //Starts healing you every second for 10 seconds. //Can be used whilst unconscious. -/obj/effect/proc_holder/changeling/fleshmend/sting_action(mob/living/user) +/datum/action/changeling/fleshmend/sting_action(mob/living/user) if(user.has_status_effect(STATUS_EFFECT_FLESHMEND)) to_chat(user, "We are already fleshmending!") return diff --git a/code/modules/antagonists/changeling/powers/headcrab.dm b/code/modules/antagonists/changeling/powers/headcrab.dm index 867f160081..08195fdbd7 100644 --- a/code/modules/antagonists/changeling/powers/headcrab.dm +++ b/code/modules/antagonists/changeling/powers/headcrab.dm @@ -1,16 +1,14 @@ -/obj/effect/proc_holder/changeling/headcrab +/datum/action/changeling/headcrab name = "Last Resort" - desc = "We sacrifice our current body in a moment of need, placing us in control of a vessel." + desc = "We sacrifice our current body in a moment of need, placing us in control of a vessel that can plant our likeness in a new host. Costs 20 chemicals." helptext = "We will be placed in control of a small, fragile creature. We may attack a corpse like this to plant an egg which will slowly mature into a new form for us. This ability is loud, and might cause our blood to react violently to heat." + button_icon_state = "last_resort" chemical_cost = 20 dna_cost = 1 loudness = 2 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_explode" - action_background_icon_state = "bg_ling" + req_human = TRUE -/obj/effect/proc_holder/changeling/headcrab/sting_action(mob/user) +/datum/action/changeling/headcrab/sting_action(mob/user) set waitfor = FALSE if(alert("Are we sure we wish to kill ourself and create a headslug?",,"Yes", "No") == "No") return diff --git a/code/modules/antagonists/changeling/powers/hivemind.dm b/code/modules/antagonists/changeling/powers/hivemind.dm index f7718d7708..95ad09c318 100644 --- a/code/modules/antagonists/changeling/powers/hivemind.dm +++ b/code/modules/antagonists/changeling/powers/hivemind.dm @@ -1,52 +1,55 @@ -//HIVEMIND COMMUNICATION //MODE_TOKEN_CHANGELING / :g -/obj/effect/proc_holder/changeling/hivemind_comms +//HIVEMIND COMMUNICATION (:g) +/datum/action/changeling/hivemind_comms name = "Hivemind Communication" desc = "We tune our senses to the airwaves to allow us to discreetly communicate and exchange DNA with other changelings." - helptext = "We will be able to talk with other changelings with :g. Exchanged DNA do not count towards absorb objectives." //MODE_TOKEN_CHANGELING needs to be manually updated here. + helptext = "We will be able to talk with other changelings with :g. Exchanged DNA do not count towards absorb objectives." + needs_button = FALSE dna_cost = 1 chemical_cost = -1 - action_icon = 'icons/mob/actions/actions_xeno.dmi' - action_icon_state = "alien_whisper" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/hivemind_comms/sting_action(var/mob/living/user) +/datum/action/changeling/hivemind_comms/sting_action(var/mob/living/user) if (HAS_TRAIT(user, CHANGELING_HIVEMIND_MUTE)) to_chat(user, "The poison in the air hinders our ability to interact with the hivemind.") return var/input = html_decode(stripped_input(usr, "Please choose a message to transmit.", "Changeling Hivemind", "")) user.say(".g[input]") -/obj/effect/proc_holder/changeling/hivemind_comms/on_purchase(mob/user, is_respec) +/datum/action/changeling/hivemind_comms/on_purchase(mob/user, is_respec) ..() var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) changeling.changeling_speak = 1 to_chat(user, "Use say \"[MODE_TOKEN_CHANGELING] message\" to communicate with the other changelings.") - var/obj/effect/proc_holder/changeling/hivemind_upload/S1 = new + var/datum/action/changeling/hivemind_upload/S1 = new if(!changeling.has_sting(S1)) - changeling.purchasedpowers+=S1 - S1.action.Grant(user) - var/obj/effect/proc_holder/changeling/hivemind_download/S2 = new + S1.Grant(user) + var/datum/action/changeling/hivemind_download/S2 = new if(!changeling.has_sting(S2)) - changeling.purchasedpowers+=S2 - S2.action.Grant(user) - var/obj/effect/proc_holder/changeling/linglink/S3 = new + S2.Grant(user) + var/datum/action/changeling/linglink/S3 = new if(!changeling.has_sting(S3)) - changeling.purchasedpowers+=S3 - S3.action.Grant(user) + S3.Grant(user) + +/datum/action/changeling/hivemind_comms/Remove(mob/user) + var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + if(changeling.changeling_speak) + changeling.changeling_speak = FALSE + for(var/p in changeling.purchasedpowers) + var/datum/action/changeling/otherpower = p + if(istype(otherpower, /datum/action/changeling/hivemind_upload) || istype(otherpower, /datum/action/changeling/hivemind_download)) + changeling.purchasedpowers -= otherpower + otherpower.Remove(changeling.owner.current) + ..() // HIVE MIND UPLOAD/DOWNLOAD DNA GLOBAL_LIST_EMPTY(hivemind_bank) -/obj/effect/proc_holder/changeling/hivemind_upload +/datum/action/changeling/hivemind_upload name = "Hive Channel DNA" - desc = "Allows us to channel DNA in the airwaves to allow other changelings to absorb it." + desc = "Allows us to channel DNA in the airwaves to allow other changelings to absorb it. Costs 10 chemicals." + button_icon_state = "hivemind_channel" chemical_cost = 10 - dna_cost = -1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_upload" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/hivemind_upload/sting_action(var/mob/living/user) +/datum/action/changeling/hivemind_upload/sting_action(var/mob/living/user) if (HAS_TRAIT(user, CHANGELING_HIVEMIND_MUTE)) to_chat(user, "The poison in the air hinders our ability to interact with the hivemind.") return @@ -74,16 +77,13 @@ GLOBAL_LIST_EMPTY(hivemind_bank) to_chat(user, "We channel the DNA of [chosen_name] to the air.") return TRUE -/obj/effect/proc_holder/changeling/hivemind_download +/datum/action/changeling/hivemind_download name = "Hive Absorb DNA" - desc = "Allows us to absorb DNA that has been channeled to the airwaves. Does not count towards absorb objectives." + desc = "Allows us to absorb DNA that has been channeled to the airwaves. Does not count towards absorb objectives. Costs 10 chemicals." + button_icon_state = "hive_absorb" chemical_cost = 10 - dna_cost = -1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_download" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/hivemind_download/can_sting(mob/living/carbon/user) +/datum/action/changeling/hivemind_download/can_sting(mob/living/carbon/user) if(!..()) return if (HAS_TRAIT(user, CHANGELING_HIVEMIND_MUTE)) @@ -96,7 +96,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank) return return 1 -/obj/effect/proc_holder/changeling/hivemind_download/sting_action(mob/user) +/datum/action/changeling/hivemind_download/sting_action(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) var/list/names = list() for(var/datum/changelingprofile/prof in GLOB.hivemind_bank) diff --git a/code/modules/antagonists/changeling/powers/humanform.dm b/code/modules/antagonists/changeling/powers/humanform.dm index c9edc12eeb..016ab5c6dd 100644 --- a/code/modules/antagonists/changeling/powers/humanform.dm +++ b/code/modules/antagonists/changeling/powers/humanform.dm @@ -1,14 +1,12 @@ -/obj/effect/proc_holder/changeling/humanform +/datum/action/changeling/humanform name = "Human Form" - desc = "We change into a human." + desc = "We change into a human. Costs 5 chemicals." + button_icon_state = "human_form" chemical_cost = 5 req_dna = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_human" - action_background_icon_state = "bg_ling" //Transform into a human. -/obj/effect/proc_holder/changeling/humanform/sting_action(mob/living/carbon/user) +/datum/action/changeling/humanform/sting_action(mob/living/carbon/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) var/datum/changelingprofile/chosen_prof = changeling.select_dna() diff --git a/code/modules/antagonists/changeling/powers/lesserform.dm b/code/modules/antagonists/changeling/powers/lesserform.dm index f3690ef5c5..1160e0908a 100644 --- a/code/modules/antagonists/changeling/powers/lesserform.dm +++ b/code/modules/antagonists/changeling/powers/lesserform.dm @@ -1,18 +1,17 @@ -/obj/effect/proc_holder/changeling/lesserform +/datum/action/changeling/lesserform name = "Lesser Form" - desc = "We debase ourselves and become lesser. We become a monkey. This ability is loud, and might cause our blood to react violently to heat." + desc = "We debase ourselves and become lesser. We become a monkey. This ability is loud, and might cause our blood to react violently to heat. Costs 5 chemicals." + helptext = "The transformation greatly reduces our size, allowing us to slip out of cuffs and climb through vents." + button_icon_state = "lesser_form" chemical_cost = 5 dna_cost = 1 loudness = 2 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_lesser" - action_background_icon_state = "bg_ling" + req_human = TRUE //Transform into a monkey. -/obj/effect/proc_holder/changeling/lesserform/sting_action(mob/living/carbon/human/user) +/datum/action/changeling/lesserform/sting_action(mob/living/carbon/human/user) if(!user || user.mob_transforming) - return 0 + return FALSE to_chat(user, "Our genes cry out!") user.monkeyize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_KEEPSE) diff --git a/code/modules/antagonists/changeling/powers/linglink.dm b/code/modules/antagonists/changeling/powers/linglink.dm index 332f543545..b82f215a04 100644 --- a/code/modules/antagonists/changeling/powers/linglink.dm +++ b/code/modules/antagonists/changeling/powers/linglink.dm @@ -1,14 +1,12 @@ -/obj/effect/proc_holder/changeling/linglink +/datum/action/changeling/linglink name = "Hivemind Link" - desc = "Link your victim's mind into the hivemind for personal interrogation." + desc = "We link our victim's mind into the hivemind for personal interrogation." + helptext = "If we find a human mad enough to support our cause, this can be a helpful tool to stay in touch." + button_icon_state = "hivemind_link" chemical_cost = 0 - dna_cost = -1 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_link" - action_background_icon_state = "bg_ling" + req_human = TRUE -/obj/effect/proc_holder/changeling/linglink/can_sting(mob/living/carbon/user) +/datum/action/changeling/linglink/can_sting(mob/living/carbon/user) if(!..()) return var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) @@ -37,7 +35,7 @@ return return changeling.can_absorb_dna(target) -/obj/effect/proc_holder/changeling/linglink/sting_action(mob/user) +/datum/action/changeling/linglink/sting_action(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) var/mob/living/carbon/human/target = user.pulling changeling.islinking = 1 diff --git a/code/modules/antagonists/changeling/powers/mimic_voice.dm b/code/modules/antagonists/changeling/powers/mimic_voice.dm index 170aea1e9c..dc7238d892 100644 --- a/code/modules/antagonists/changeling/powers/mimic_voice.dm +++ b/code/modules/antagonists/changeling/powers/mimic_voice.dm @@ -1,17 +1,14 @@ -/obj/effect/proc_holder/changeling/mimicvoice +/datum/action/changeling/mimicvoice name = "Mimic Voice" - desc = "We shape our vocal glands to sound like a desired voice." + desc = "We shape our vocal glands to sound like a desired voice. Maintaining this power slows chemical production." + button_icon_state = "mimic_voice" helptext = "Will turn your voice into the name that you enter. We must constantly expend chemicals to maintain our form like this." chemical_cost = 0 //constant chemical drain hardcoded dna_cost = 1 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_mimic_voice" - action_background_icon_state = "bg_ling" - + req_human = TRUE // Fake Voice -/obj/effect/proc_holder/changeling/mimicvoice/sting_action(mob/user) +/datum/action/changeling/mimicvoice/sting_action(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) if(changeling.mimicing) changeling.mimicing = "" diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index cb19f624fb..e327f62370 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -14,25 +14,24 @@ //Parent to shields and blades because muh copypasted code. -/obj/effect/proc_holder/changeling/weapon +/datum/action/changeling/weapon name = "Organic Weapon" desc = "Go tell a coder if you see this" helptext = "Yell at Miauw and/or Perakp" chemical_cost = 1000 - dna_cost = -1 var/recharge_slowdown = 0 var/silent = FALSE var/weapon_type var/weapon_name_simple -/obj/effect/proc_holder/changeling/weapon/try_to_sting(mob/user, mob/target) +/datum/action/changeling/weapon/try_to_sting(mob/user, mob/target) for(var/obj/item/I in user.held_items) if(check_weapon(user, I)) return ..(user, target) -/obj/effect/proc_holder/changeling/weapon/proc/check_weapon(mob/user, obj/item/hand_item) +/datum/action/changeling/weapon/proc/check_weapon(mob/user, obj/item/hand_item) if(istype(hand_item, weapon_type)) user.temporarilyRemoveItemFromInventory(hand_item, TRUE) //DROPDEL will delete the item if(!silent) @@ -43,7 +42,7 @@ user.update_inv_hands() return 1 -/obj/effect/proc_holder/changeling/weapon/sting_action(mob/living/user) +/datum/action/changeling/weapon/sting_action(mob/living/user) var/obj/item/held = user.get_active_held_item() if(held && !user.dropItemToGround(held)) to_chat(user, "[held] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!") @@ -64,19 +63,18 @@ changeling.chem_recharge_slowdown += recharge_slowdown return W -/obj/effect/proc_holder/changeling/weapon/on_refund(mob/user) - action.Remove(user) +/datum/action/changeling/weapon/Remove(mob/user) for(var/obj/item/I in user.held_items) check_weapon(user, I) + ..() //Parent to space suits and armor. -/obj/effect/proc_holder/changeling/suit +/datum/action/changeling/suit name = "Organic Suit" desc = "Go tell a coder if you see this" helptext = "Yell at Miauw and/or Perakp" chemical_cost = 1000 - dna_cost = -1 var/helmet_type = /obj/item var/suit_type = /obj/item @@ -85,17 +83,17 @@ var/recharge_slowdown = 0 var/blood_on_castoff = 0 -/obj/effect/proc_holder/changeling/suit/try_to_sting(mob/user, mob/target) +/datum/action/changeling/suit/try_to_sting(mob/user, mob/target) if(check_suit(user)) return var/mob/living/carbon/human/H = user ..(H, target) //checks if we already have an organic suit and casts it off. -/obj/effect/proc_holder/changeling/suit/proc/check_suit(mob/user) +/datum/action/changeling/suit/proc/check_suit(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) if(!ishuman(user) || !changeling) - return 1 + return TRUE var/mob/living/carbon/human/H = user if(istype(H.wear_suit, suit_type) || istype(H.head, helmet_type)) H.visible_message("[H] casts off [H.p_their()] [suit_name_simple]!", "We cast off our [suit_name_simple].", "You hear organic matter ripping and tearing!") @@ -110,16 +108,16 @@ playsound(H.loc, 'sound/effects/splat.ogg', 50, 1) //So real sounds changeling.chem_recharge_slowdown -= recharge_slowdown - return 1 + return TRUE -/obj/effect/proc_holder/changeling/suit/on_refund(mob/user) +/datum/action/changeling/suit/Remove(mob/user) if(!ishuman(user)) return - action.Remove(user) var/mob/living/carbon/human/H = user check_suit(H) + ..() -/obj/effect/proc_holder/changeling/suit/sting_action(mob/living/carbon/human/user) +/datum/action/changeling/suit/sting_action(mob/living/carbon/human/user) if(!user.canUnEquip(user.wear_suit)) to_chat(user, "\the [user.wear_suit] is stuck to your body, you cannot grow a [suit_name_simple] over it!") return @@ -142,20 +140,18 @@ /***************************************\ |***************ARM BLADE***************| \***************************************/ -/obj/effect/proc_holder/changeling/weapon/arm_blade +/datum/action/changeling/weapon/arm_blade name = "Arm Blade" - desc = "We reform one of our arms into a deadly blade." + desc = "We reform one of our arms into a deadly blade. Costs 5 chemicals." helptext = "We may retract our armblade in the same manner as we form it. Cannot be used while in lesser form. This ability is loud, and might cause our blood to react violently to heat." + button_icon_state = "armblade" chemical_cost = 5 dna_cost = 2 loudness = 2 - req_human = 1 + req_human = TRUE recharge_slowdown = 0.6 weapon_type = /obj/item/melee/arm_blade weapon_name_simple = "blade" - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_armblade" - action_background_icon_state = "bg_ling" /obj/item/melee/arm_blade name = "arm blade" @@ -231,23 +227,21 @@ |***********COMBAT TENTACLES*************| \***************************************/ -/obj/effect/proc_holder/changeling/weapon/tentacle +/datum/action/changeling/weapon/tentacle name = "Tentacle" - desc = "We ready a tentacle to grab items or victims with." + desc = "We ready a tentacle to grab items or victims with. Costs 10 chemicals." helptext = "We can use it once to retrieve a distant item. If used on living creatures, the effect depends on the intent: \ Help will simply drag them closer, Disarm will grab whatever they're holding instead of them, Grab will put the victim in our hold after catching it, \ and Harm will stun it, and stab it if we're also holding a sharp weapon. Cannot be used while in lesser form.\ This ability is loud, and might cause our blood to react violently to heat." + button_icon_state = "tentacle" chemical_cost = 10 dna_cost = 2 loudness = 2 - req_human = 1 + req_human = TRUE weapon_type = /obj/item/gun/magic/tentacle weapon_name_simple = "tentacle" silent = TRUE - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_tentacle" - action_background_icon_state = "bg_ling" /obj/item/gun/magic/tentacle name = "tentacle" @@ -417,22 +411,20 @@ /***************************************\ |****************SHIELD*****************| \***************************************/ -/obj/effect/proc_holder/changeling/weapon/shield +/datum/action/changeling/weapon/shield name = "Organic Shield" - desc = "We reform one of our arms into a hard shield." + desc = "We reform one of our arms into a hard shield. Costs 20 chemicals." helptext = "Organic tissue cannot resist damage forever; the shield will break after it is hit too much. The more genomes we absorb, the stronger it is. Cannot be used while in lesser form. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "organic_shield" chemical_cost = 20 dna_cost = 2 loudness = 1 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_shield" - action_background_icon_state = "bg_ling" + req_human = TRUE weapon_type = /obj/item/shield/changeling weapon_name_simple = "shield" -/obj/effect/proc_holder/changeling/weapon/shield/sting_action(mob/user) +/datum/action/changeling/weapon/shield/sting_action(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) //So we can read the absorbedcount. if(!changeling) return @@ -477,23 +469,21 @@ /***************************************\ |*********SPACE SUIT + HELMET***********| \***************************************/ -/obj/effect/proc_holder/changeling/suit/organic_space_suit +/datum/action/changeling/suit/organic_space_suit name = "Organic Space Suit" - desc = "We grow an organic suit to protect ourselves from space exposure." + desc = "We grow an organic suit to protect ourselves from space exposure. Costs 20 chemicals." helptext = "We must constantly repair our form to make it space-proof, reducing chemical production while we are protected. Cannot be used in lesser form. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "organic_suit" chemical_cost = 20 dna_cost = 2 loudness = 1 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_space_suit" - action_background_icon_state = "bg_ling" + req_human = TRUE + recharge_slowdown = 0.6 suit_type = /obj/item/clothing/suit/space/changeling helmet_type = /obj/item/clothing/head/helmet/space/changeling suit_name_simple = "flesh shell" helmet_name_simple = "space helmet" - recharge_slowdown = 0.6 blood_on_castoff = 1 /obj/item/clothing/suit/space/changeling @@ -534,18 +524,16 @@ /***************************************\ |*****************ARMOR*****************| \***************************************/ -/obj/effect/proc_holder/changeling/suit/armor +/datum/action/changeling/suit/armor name = "Chitinous Armor" - desc = "We turn our skin into tough chitin to protect us from damage." + desc = "We turn our skin into tough chitin to protect us from damage. Costs 10 chemicals." helptext = "Upkeep of the armor requires a constant expenditure of chemicals, resulting in a reduced chemical generation. The armor is strong against brute force, but does not provide much protection from lasers. Cannot be used in lesser form. This ability is loud, and might cause our blood to react violently to heat." + button_icon_state = "chitinous_armor" chemical_cost = 10 dna_cost = 1 loudness = 2 - req_human = 1 + req_human = TRUE recharge_slowdown = 0.6 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_armor" - action_background_icon_state = "bg_ling" suit_type = /obj/item/clothing/suit/armor/changeling helmet_type = /obj/item/clothing/head/helmet/changeling @@ -587,26 +575,26 @@ |*****************CLAWS*****************| \***************************************/ -/obj/effect/proc_holder/changeling/gloves +/datum/action/changeling/gloves name = "Mangled Claws" desc = "Go tell a coder if you see this" helptext = "Yell at Hatterhat, for fucking up Miauw and/or Perakp's work" + button_icon_state = "gauntlets" chemical_cost = 1000 - dna_cost = -1 var/glove_type = /obj/item var/glove_name_simple = " " // keep these plural bro var/recharge_slowdown = 0 var/blood_on_castoff = 0 -/obj/effect/proc_holder/changeling/gloves/try_to_sting(mob/user, mob/target) +/datum/action/changeling/gloves/try_to_sting(mob/user, mob/target) if(check_gloves(user)) return var/mob/living/carbon/human/H = user ..(H, target) //checks if we already have claws and casts it off -/obj/effect/proc_holder/changeling/gloves/proc/check_gloves(mob/user) +/datum/action/changeling/gloves/proc/check_gloves(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) if(!ishuman(user) || !changeling) return 1 @@ -623,14 +611,14 @@ changeling.chem_recharge_slowdown -= recharge_slowdown return 1 -/obj/effect/proc_holder/changeling/gloves/on_refund(mob/user) +/datum/action/changeling/gloves/Remove(mob/user) if(!ishuman(user)) return - action.Remove(user) var/mob/living/carbon/human/H = user check_gloves(H) + ..() -/obj/effect/proc_holder/changeling/gloves/sting_action(mob/living/carbon/human/user) +/datum/action/changeling/gloves/sting_action(mob/living/carbon/human/user) if(!user.canUnEquip(user.gloves)) to_chat(user, "\the [user.gloves] is stuck to your body, you cannot grow [glove_name_simple] over it!") return @@ -664,23 +652,21 @@ desc = "Good for prying things off of people and looking incredibly creepy." strip_mod = 2 -/obj/effect/proc_holder/changeling/gloves/gauntlets +/datum/action/changeling/gloves/gauntlets name = "Bone Gauntlets" - desc = "We turn our hands into solid bone and chitin, sacrificing dexterity for raw strength." + desc = "We turn our hands into solid bone and chitin, sacrificing dexterity for raw strength. Costs 5 chemicals." helptext = "These grotesque, bone-and-chitin gauntlets are remarkably good at beating victims senseless, and cannot be used in lesser form. This ability is loud, and might cause our blood to react violently to heat." + button_icon_state = "gauntlets" chemical_cost = 5 // same cost as armblade because its a sidegrade (sacrifice utility for punching people violently) dna_cost = 2 loudness = 2 - req_human = 1 + req_human = TRUE recharge_slowdown = 0.6 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_gauntlets" - action_background_icon_state = "bg_ling" glove_type = /obj/item/clothing/gloves/fingerless/pugilist/cling // just punch his head off dude glove_name_simple = "bone gauntlets" -/obj/effect/proc_holder/changeling/gloves/gauntlets/sting_action(mob/living/user) +/datum/action/changeling/gloves/gauntlets/sting_action(mob/living/user) if(HAS_TRAIT(user, TRAIT_NOPUGILIST)) to_chat(user, "We would gain nothing by forming our fists into brute-force weapons when we are trained in precision martial arts!") return diff --git a/code/modules/antagonists/changeling/powers/panacea.dm b/code/modules/antagonists/changeling/powers/panacea.dm index 3b59a0c042..b9c19001fe 100644 --- a/code/modules/antagonists/changeling/powers/panacea.dm +++ b/code/modules/antagonists/changeling/powers/panacea.dm @@ -1,16 +1,14 @@ -/obj/effect/proc_holder/changeling/panacea +/datum/action/changeling/panacea name = "Anatomic Panacea" - desc = "Expels impurifications from our form; curing diseases, removing parasites, sobering us, purging toxins and radiation, and resetting our genetic code completely." + desc = "Expels impurifications from our form; curing diseases, removing parasites, sobering us, purging toxins and radiation, and resetting our genetic code completely. Costs 20 chemicals." helptext = "Can be used while unconscious." + button_icon_state = "panacea" chemical_cost = 20 dna_cost = 2 req_stat = UNCONSCIOUS - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_anatomic_panacea" - action_background_icon_state = "bg_ling" //Heals the things that the other regenerative abilities don't. -/obj/effect/proc_holder/changeling/panacea/sting_action(mob/living/user) +/datum/action/changeling/panacea/sting_action(mob/living/user) if(user.has_status_effect(STATUS_EFFECT_PANACEA)) to_chat(user, "We are already cleansing our impurities!") return diff --git a/code/modules/antagonists/changeling/powers/pheromone_receptors.dm b/code/modules/antagonists/changeling/powers/pheromone_receptors.dm index 3bda7335a1..9d7eb8744d 100644 --- a/code/modules/antagonists/changeling/powers/pheromone_receptors.dm +++ b/code/modules/antagonists/changeling/powers/pheromone_receptors.dm @@ -3,18 +3,17 @@ #define CHANGELING_PHEROMONE_PING_TIME 20 //2s update time. -/obj/effect/proc_holder/changeling/pheromone_receptors +/datum/action/changeling/pheromone_receptors name = "Pheromone Receptors" desc = "We attune our senses to track other changelings by scent. The closer they are, the easier we can find them." helptext = "We will know the general direction of nearby changelings, with closer scents being stronger. Our chemical generation is slowed while this is active." + icon_icon = 'icons/mob/actions/actions_spells.dmi' + button_icon_state = "nose" chemical_cost = 0 //Reduces regain rate while active. dna_cost = 2 var/receptors_active = FALSE - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_pheromone" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/pheromone_receptors/sting_action(mob/living/carbon/user) +/datum/action/changeling/pheromone_receptors/sting_action(mob/living/carbon/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) if(!receptors_active) to_chat(user, "We search for the scent of any nearby changelings.") diff --git a/code/modules/antagonists/changeling/powers/regenerate.dm b/code/modules/antagonists/changeling/powers/regenerate.dm index a88422e7eb..2290b91f9a 100644 --- a/code/modules/antagonists/changeling/powers/regenerate.dm +++ b/code/modules/antagonists/changeling/powers/regenerate.dm @@ -1,18 +1,16 @@ -/obj/effect/proc_holder/changeling/regenerate +/datum/action/changeling/regenerate name = "Regenerate" desc = "Allows us to regrow and restore missing external limbs, and \ vital internal organs, as well as removing shrapnel and restoring \ - blood volume." + blood volume. Costs 10 chemicals." helptext = "Will alert nearby crew if any external limbs are \ regenerated. Can be used while unconscious." + button_icon_state = "regenerate" chemical_cost = 10 dna_cost = 0 req_stat = UNCONSCIOUS - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_regenerate" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/regenerate/sting_action(mob/living/user) +/datum/action/changeling/regenerate/sting_action(mob/living/user) to_chat(user, "You feel an itching, both inside and \ outside as your tissues knit and reknit.") if(iscarbon(user)) diff --git a/code/modules/antagonists/changeling/powers/revive.dm b/code/modules/antagonists/changeling/powers/revive.dm deleted file mode 100644 index 3b78960ff1..0000000000 --- a/code/modules/antagonists/changeling/powers/revive.dm +++ /dev/null @@ -1,52 +0,0 @@ -/obj/effect/proc_holder/changeling/revive - name = "Revive" - desc = "We regenerate, healing all damage from our form." - helptext = "Does not regrow lost organs or a missing head." - req_stat = DEAD - always_keep = TRUE - ignores_fakedeath = TRUE - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_revive" - action_background_icon_state = "bg_ling" - -//Revive from revival stasis -/obj/effect/proc_holder/changeling/revive/sting_action(mob/living/carbon/user) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) - if(!changeling) - return - if(changeling.hostile_absorbed) - to_chat(user, "We cannot muster up the strength to revive ourselves!") - changeling.purchasedpowers -= src - src.action.Remove(user) - return - user.cure_fakedeath("changeling") - user.revive(full_heal = 1) - var/list/missing = user.get_missing_limbs() - missing -= BODY_ZONE_HEAD // headless changelings are funny - if(missing.len) - playsound(user, 'sound/magic/demon_consume.ogg', 50, 1) - user.visible_message("[user]'s missing limbs \ - reform, making a loud, grotesque sound!", - "Your limbs regrow, making a \ - loud, crunchy sound and giving you great pain!", - "You hear organic matter ripping \ - and tearing!") - user.emote("scream") - user.regenerate_limbs(0, list(BODY_ZONE_HEAD)) - user.regenerate_organs() - to_chat(user, "We have revived ourselves.") - changeling.purchasedpowers -= src - src.action.Remove(user) - return TRUE - -/obj/effect/proc_holder/changeling/revive/can_be_used_by(mob/living/user) - . = ..() - if(!.) - return - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) - if(!changeling) - return FALSE - if(changeling.hostile_absorbed || ((user.stat != DEAD) && !(HAS_TRAIT(user, TRAIT_DEATHCOMA)))) - changeling.purchasedpowers -= src - return FALSE - diff --git a/code/modules/antagonists/changeling/powers/shriek.dm b/code/modules/antagonists/changeling/powers/shriek.dm index dae1da9f8f..c5ff3ab30f 100644 --- a/code/modules/antagonists/changeling/powers/shriek.dm +++ b/code/modules/antagonists/changeling/powers/shriek.dm @@ -1,17 +1,15 @@ -/obj/effect/proc_holder/changeling/resonant_shriek +/datum/action/changeling/resonant_shriek name = "Resonant Shriek" - desc = "Our lungs and vocal cords shift, allowing us to briefly emit a noise that deafens and confuses the weak-minded." + desc = "Our lungs and vocal cords shift, allowing us to briefly emit a noise that deafens and confuses the weak-minded. Costs 20 chemicals." helptext = "Emits a high-frequency sound that confuses and deafens humans, blows out nearby lights and overloads cyborg sensors. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "resonant_shriek" chemical_cost = 20 dna_cost = 2 loudness = 1 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_resonant" - action_background_icon_state = "bg_ling" + req_human = TRUE -//A flashy ability, good for crowd control and sewing chaos. -/obj/effect/proc_holder/changeling/resonant_shriek/sting_action(mob/user) +//A flashy ability, good for crowd control and sowing chaos. +/datum/action/changeling/resonant_shriek/sting_action(mob/user) for(var/mob/living/M in get_hearers_in_view(4, user)) if(iscarbon(M)) var/mob/living/carbon/C = M @@ -32,19 +30,17 @@ playsound(get_turf(user), 'sound/effects/lingscreech.ogg', 75, TRUE, 5) return TRUE -/obj/effect/proc_holder/changeling/dissonant_shriek +/datum/action/changeling/dissonant_shriek name = "Dissonant Shriek" - desc = "We shift our vocal cords to release a high-frequency sound that overloads nearby electronics." + desc = "We shift our vocal cords to release a high-frequency sound that overloads nearby electronics. Costs 20 chemicals." helptext = "Emits a high-frequency sound that overloads nearby electronics. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "dissonant_shriek" chemical_cost = 20 dna_cost = 2 loudness = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_dissonant" - action_background_icon_state = "bg_ling" -//A flashy ability, good for crowd control and sewing chaos. -/obj/effect/proc_holder/changeling/dissonant_shriek/sting_action(mob/user) +//A flashy ability, good for crowd control and sowing chaos. +/datum/action/changeling/dissonant_shriek/sting_action(mob/user) for(var/obj/machinery/light/L in range(5, usr)) L.on = 1 L.break_light_tube() diff --git a/code/modules/antagonists/changeling/powers/spiders.dm b/code/modules/antagonists/changeling/powers/spiders.dm index 69900ea8f9..f31c3a6c64 100644 --- a/code/modules/antagonists/changeling/powers/spiders.dm +++ b/code/modules/antagonists/changeling/powers/spiders.dm @@ -1,16 +1,15 @@ -/obj/effect/proc_holder/changeling/spiders +/datum/action/changeling/spiders name = "Spread Infestation" - desc = "Our form divides, creating arachnids which will grow into deadly beasts." + desc = "Our form divides, creating arachnids which will grow into deadly beasts. Costs 45 chemicals." helptext = "The spiders are thoughtless creatures, and may attack their creators when fully grown. Requires at least 3 DNA gained through Absorb (regardless of current amount), and not through DNA sting. This ability is very loud, and will guarantee that our blood will react violently to heat." + button_icon_state = "spread_infestation" chemical_cost = 45 dna_cost = 1 loudness = 4 req_absorbs = 3 - action_icon = 'icons/effects/effects.dmi' - action_icon_state = "spiderling" - action_background_icon_state = "bg_ling" //Makes some spiderlings. Good for setting traps and causing general trouble. -/obj/effect/proc_holder/changeling/spiders/sting_action(mob/user) +/datum/action/changeling/spiders/sting_action(mob/user) + ..() spawn_atom_to_turf(/obj/structure/spider/spiderling/hunter, user, 2, FALSE) return TRUE diff --git a/code/modules/antagonists/changeling/powers/strained_muscles.dm b/code/modules/antagonists/changeling/powers/strained_muscles.dm index 2fdf1baf04..5d3f2cdf9e 100644 --- a/code/modules/antagonists/changeling/powers/strained_muscles.dm +++ b/code/modules/antagonists/changeling/powers/strained_muscles.dm @@ -1,19 +1,18 @@ //Strained Muscles: Temporary speed boost at the cost of rapid damage //Limited because of hardsuits and such; ideally, used for a quick getaway -/obj/effect/proc_holder/changeling/strained_muscles +/datum/action/changeling/strained_muscles name = "Strained Muscles" desc = "We evolve the ability to reduce the acid buildup in our muscles, allowing us to move much faster." helptext = "The strain will make us tired, and we will rapidly become fatigued. Standard weight restrictions, like hardsuits, still apply. Our chemical generation is drastically slowed while this is active. Cannot be used in lesser form." + button_icon_state = "strained_muscles" dna_cost = 1 - req_human = 1 + req_human = TRUE var/stacks = 0 //Increments every 5 seconds; damage increases over time - active = 0 //Whether or not you are a hedgehog - action_icon = 'icons/obj/implants.dmi' - action_icon_state = "adrenal" - action_background_icon_state = "bg_ling" + active = FALSE //Whether or not you are a hedgehog -/obj/effect/proc_holder/changeling/strained_muscles/sting_action(mob/living/carbon/user) +/datum/action/changeling/strained_muscles/sting_action(mob/living/carbon/user) + ..() var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) active = !active if(active) @@ -32,7 +31,7 @@ return TRUE -/obj/effect/proc_holder/changeling/strained_muscles/proc/muscle_loop(mob/living/carbon/user) +/datum/action/changeling/strained_muscles/proc/muscle_loop(mob/living/carbon/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) while(active) user.add_movespeed_modifier(/datum/movespeed_modifier/strained_muscles) diff --git a/code/modules/antagonists/changeling/powers/tiny_prick.dm b/code/modules/antagonists/changeling/powers/tiny_prick.dm index 2e684b514b..93bddb2f70 100644 --- a/code/modules/antagonists/changeling/powers/tiny_prick.dm +++ b/code/modules/antagonists/changeling/powers/tiny_prick.dm @@ -1,9 +1,9 @@ -/obj/effect/proc_holder/changeling/sting +/datum/action/changeling/sting//parent path, not meant for users afaik name = "Tiny Prick" - desc = "Stabby stabby." + desc = "Stabby stabby" var/sting_icon = null -/obj/effect/proc_holder/changeling/sting/Trigger(mob/user) +/datum/action/changeling/sting/Trigger(mob/user) if(!user || !user.mind) return var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) @@ -15,15 +15,15 @@ unset_sting(user) return -/obj/effect/proc_holder/changeling/sting/proc/set_sting(mob/user) - to_chat(user, "We prepare our sting, use alt+click or middle mouse button on target to sting them.") +/datum/action/changeling/sting/proc/set_sting(mob/user) + to_chat(user, "We prepare our sting, use Alt+click or click the middle mouse button on a target to sting them.") var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) changeling.chosen_sting = src user.hud_used.lingstingdisplay.icon_state = sting_icon user.hud_used.lingstingdisplay.invisibility = 0 -/obj/effect/proc_holder/changeling/sting/proc/unset_sting(mob/user) +/datum/action/changeling/sting/proc/unset_sting(mob/user) to_chat(user, "We retract our sting, we can't sting anyone for now.") var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) changeling.chosen_sting = null @@ -37,7 +37,7 @@ if(changeling && changeling.chosen_sting) changeling.chosen_sting.unset_sting(src) -/obj/effect/proc_holder/changeling/sting/can_sting(mob/user, mob/target) +/datum/action/changeling/sting/can_sting(mob/user, mob/target) if(!..()) return var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) @@ -49,9 +49,12 @@ return if(!length(get_path_to(user, target, max_distance = changeling.sting_range, simulated_only = FALSE))) return // no path within the sting's range is found. what a weird place to use the pathfinding system + if(target.mind && target.mind.has_antag_datum(/datum/antagonist/changeling)) + sting_feedback(user, target) + changeling.chem_charges -= chemical_cost return 1 -/obj/effect/proc_holder/changeling/sting/sting_feedback(mob/user, mob/target) +/datum/action/changeling/sting/sting_feedback(mob/user, mob/target) if(!target) return to_chat(user, "We stealthily sting [target.name].") @@ -60,20 +63,18 @@ return 1 -/obj/effect/proc_holder/changeling/sting/transformation +/datum/action/changeling/sting/transformation name = "Temporary Transformation Sting" - desc = "We silently sting a human, injecting a chemical that forces them to transform into a chosen being for a limited time. Additional stings extend the duration." + desc = "We silently sting a human, injecting a chemical that forces them to transform into a chosen being for a limited time. Additional stings extend the duration. Costs 10 chemicals." helptext = "The victim will transform much like a changeling would for a limited time. Does not provide a warning to others. Mutations will not be transferred, and monkeys will become human. This ability is loud, and might cause our blood to react violently to heat." + button_icon_state = "sting_transform" sting_icon = "sting_transform" chemical_cost = 10 dna_cost = 2 loudness = 1 var/datum/changelingprofile/selected_dna = null - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_transform" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/sting/transformation/Trigger(mob/user) +/datum/action/changeling/sting/transformation/Trigger(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) if(changeling.chosen_sting) unset_sting(user) @@ -86,7 +87,7 @@ return ..() -/obj/effect/proc_holder/changeling/sting/transformation/can_sting(mob/user, mob/living/carbon/target) +/datum/action/changeling/sting/transformation/can_sting(mob/user, mob/living/carbon/target) if(!..()) return if((HAS_TRAIT(target, TRAIT_HUSK)) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits)) @@ -94,8 +95,7 @@ return 0 return 1 -/obj/effect/proc_holder/changeling/sting/transformation/sting_action(mob/user, mob/target) - +/datum/action/changeling/sting/transformation/sting_action(mob/user, mob/target) if(ismonkey(target)) to_chat(user, "Our genes cry out as we sting [target.name]!") @@ -109,25 +109,22 @@ C.reagents.add_reagent(/datum/reagent/changeling_string,120,list("desired_dna" = selected_dna.dna)) log_combat(user, target, "stung", "transformation sting", " new identity is '[selected_dna.dna.real_name]'") - -/obj/effect/proc_holder/changeling/sting/false_armblade +/datum/action/changeling/sting/false_armblade name = "False Armblade Sting" - desc = "We silently sting a human, injecting a retrovirus that mutates their arm to temporarily appear as an armblade." + desc = "We silently sting a human, injecting a retrovirus that mutates their arm to temporarily appear as an armblade. Costs 20 chemicals." helptext = "The victim will form an armblade much like a changeling would, except the armblade is dull and useless. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "sting_armblade" sting_icon = "sting_armblade" chemical_cost = 20 dna_cost = 1 loudness = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_fake" - action_background_icon_state = "bg_ling" /obj/item/melee/arm_blade/false desc = "A grotesque mass of flesh that used to be your arm. Although it looks dangerous at first, you can tell it's actually quite dull and useless." force = 5 //Basically as strong as a punch fake = TRUE -/obj/effect/proc_holder/changeling/sting/false_armblade/can_sting(mob/user, mob/target) +/datum/action/changeling/sting/false_armblade/can_sting(mob/user, mob/target) if(!..()) return if(isliving(target)) @@ -137,7 +134,7 @@ return 0 return 1 -/obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target) +/datum/action/changeling/sting/false_armblade/sting_action(mob/user, mob/target) log_combat(user, target, "stung", object="false armblade sting") var/obj/item/held = target.get_active_held_item() @@ -156,7 +153,7 @@ addtimer(CALLBACK(src, .proc/remove_fake, target, blade), 600) return TRUE -/obj/effect/proc_holder/changeling/sting/false_armblade/proc/remove_fake(mob/target, obj/item/melee/arm_blade/false/blade) +/datum/action/changeling/sting/false_armblade/proc/remove_fake(mob/target, obj/item/melee/arm_blade/false/blade) playsound(target, 'sound/effects/blobattack.ogg', 30, 1) target.visible_message("With a sickening crunch, \ [target] reforms [target.p_their()] [blade.name] into an arm!", @@ -166,59 +163,53 @@ qdel(blade) target.update_inv_hands() -/obj/effect/proc_holder/changeling/sting/extract_dna +/datum/action/changeling/sting/extract_dna name = "Extract DNA Sting" - desc = "We stealthily sting a target and extract their DNA." + desc = "We stealthily sting a target and extract their DNA. Costs 25 chemicals." helptext = "Will give you the DNA of your target, allowing you to transform into them." + button_icon_state = "sting_extract" sting_icon = "sting_extract" chemical_cost = 25 dna_cost = 0 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_extract" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/sting/extract_dna/can_sting(mob/user, mob/target) +/datum/action/changeling/sting/extract_dna/can_sting(mob/user, mob/target) if(..()) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) return changeling.can_absorb_dna(target) -/obj/effect/proc_holder/changeling/sting/extract_dna/sting_action(mob/user, mob/living/carbon/human/target) +/datum/action/changeling/sting/extract_dna/sting_action(mob/user, mob/living/carbon/human/target) log_combat(user, target, "stung", "extraction sting") var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) if(!(changeling.has_dna(target.dna))) changeling.add_new_profile(target) return TRUE -/obj/effect/proc_holder/changeling/sting/mute +/datum/action/changeling/sting/mute name = "Mute Sting" - desc = "We silently sting a human, completely silencing them for a short time." + desc = "We silently sting a human, completely silencing them for a short time. Costs 20 chemicals." helptext = "Does not provide a warning to the victim that they have been stung, until they try to speak and cannot. This ability is loud, and might cause our blood to react violently to heat." + button_icon_state = "sting_mute" sting_icon = "sting_mute" chemical_cost = 20 dna_cost = 2 loudness = 2 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_mute" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/sting/mute/sting_action(mob/user, mob/living/carbon/target) +/datum/action/changeling/sting/mute/sting_action(mob/user, mob/living/carbon/target) log_combat(user, target, "stung", "mute sting") target.silent += 30 return TRUE -/obj/effect/proc_holder/changeling/sting/blind +/datum/action/changeling/sting/blind name = "Blind Sting" - desc = "Temporarily blinds the target." + desc = "Temporarily blinds the target. Costs 25 chemicals." helptext = "This sting completely blinds a target for a short time. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "sting_blind" sting_icon = "sting_blind" chemical_cost = 25 dna_cost = 1 loudness = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_blind" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/sting/blind/sting_action(mob/user, mob/living/carbon/target) +/datum/action/changeling/sting/blind/sting_action(mob/user, mob/living/carbon/target) log_combat(user, target, "stung", "blind sting") to_chat(target, "Your eyes burn horrifically!") target.become_nearsighted(EYE_DAMAGE) @@ -226,38 +217,34 @@ target.blur_eyes(40) return TRUE -/obj/effect/proc_holder/changeling/sting/LSD +/datum/action/changeling/sting/LSD name = "Hallucination Sting" - desc = "Causes terror in the target and deals a minor amount of toxin damage." + desc = "Causes terror in the target and deals a minor amount of toxin damage. Costs 10 chemicals." helptext = "We evolve the ability to sting a target with a powerful toxic hallucinogenic chemical. The target does not notice they have been stung, and the effect begins instantaneously. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "sting_lsd" sting_icon = "sting_lsd" chemical_cost = 10 dna_cost = 1 loudness = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_lsd" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/sting/LSD/sting_action(mob/user, mob/target) +/datum/action/changeling/sting/LSD/sting_action(mob/user, mob/target) log_combat(user, target, "stung", "LSD sting") if(target.reagents) target.reagents.add_reagent(/datum/reagent/blob/regenerative_materia, 5) target.reagents.add_reagent(/datum/reagent/toxin/mindbreaker, 5) return TRUE -/obj/effect/proc_holder/changeling/sting/cryo +/datum/action/changeling/sting/cryo name = "Cryogenic Sting" - desc = "We silently sting a human with a cocktail of chemicals that freeze them." + desc = "We silently sting our victim with a cocktail of chemicals that freezes them from the inside. Costs 15 chemicals." helptext = "Does not provide a warning to the victim, though they will likely realize they are suddenly freezing. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + button_icon_state = "sting_cryo" sting_icon = "sting_cryo" chemical_cost = 15 dna_cost = 2 loudness = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_cryo" - action_background_icon_state = "bg_ling" -/obj/effect/proc_holder/changeling/sting/cryo/sting_action(mob/user, mob/target) +/datum/action/changeling/sting/cryo/sting_action(mob/user, mob/target) log_combat(user, target, "stung", "cryo sting") if(target.reagents) target.reagents.add_reagent(/datum/reagent/consumable/frostoil, 30) diff --git a/code/modules/antagonists/changeling/powers/transform.dm b/code/modules/antagonists/changeling/powers/transform.dm index e685cbabfa..72ff31d373 100644 --- a/code/modules/antagonists/changeling/powers/transform.dm +++ b/code/modules/antagonists/changeling/powers/transform.dm @@ -1,13 +1,11 @@ -/obj/effect/proc_holder/changeling/transform +/datum/action/changeling/transform name = "Transform" - desc = "We take on the appearance and voice of one we have absorbed." + desc = "We take on the appearance and voice of one we have absorbed. Costs 5 chemicals." + button_icon_state = "transform" chemical_cost = 5 dna_cost = 0 req_dna = 1 - req_human = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_transform" - action_background_icon_state = "bg_ling" + req_human = TRUE /obj/item/clothing/glasses/changeling name = "flesh" @@ -132,7 +130,7 @@ . = ..() //Change our DNA to that of somebody we've absorbed. -/obj/effect/proc_holder/changeling/transform/sting_action(mob/living/carbon/human/user) +/datum/action/changeling/transform/sting_action(mob/living/carbon/human/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) var/datum/changelingprofile/chosen_prof = changeling.select_dna() diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index e9bf3c5d49..30867a854f 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -22,5 +22,10 @@ if(ranged_ability) ranged_ability.add_ranged_ability(src, "You currently have [ranged_ability] active!") + + var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) + if(changeling) + changeling.regain_powers() + if((vore_flags & VORE_INIT) && !(vore_flags & VOREPREF_INIT)) //Vore's been initialized, voreprefs haven't. If this triggers then that means that voreprefs failed to load due to the client being missing. copy_from_prefs_vr() diff --git a/code/modules/mob/living/simple_animal/hostile/headcrab.dm b/code/modules/mob/living/simple_animal/hostile/headcrab.dm index c23e438b31..e5cf1cc989 100644 --- a/code/modules/mob/living/simple_animal/hostile/headcrab.dm +++ b/code/modules/mob/living/simple_animal/hostile/headcrab.dm @@ -83,9 +83,9 @@ if(C.can_absorb_dna(owner)) C.add_new_profile(owner) - var/obj/effect/proc_holder/changeling/humanform/hf = new + var/datum/action/changeling/humanform/hf = new C.purchasedpowers += hf - hf.on_purchase(origin.current, TRUE) + C.regain_powers() M.key = origin.key owner.gib() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index baa4d87075..f80866d97e 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -580,11 +580,6 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) L[++L.len] = list("[S.panel]", "[S.holder_var_type] [S.holder_var_amount]", S.name, REF(S)) return L -/mob/proc/add_stings_to_statpanel(list/stings) - for(var/obj/effect/proc_holder/changeling/S in stings) - if(S.chemical_cost >=0 && S.can_be_used_by(src)) - statpanel("[S.panel]",((S.chemical_cost > 0) ? "[S.chemical_cost]" : ""),S) - #define MOB_FACE_DIRECTION_DELAY 1 // facing verbs diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index fcaa77cac4..fa9dc9f4f8 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -100,9 +100,9 @@ mind.transfer_to(O) var/datum/antagonist/changeling/changeling = O.mind.has_antag_datum(/datum/antagonist/changeling) if(changeling) - var/obj/effect/proc_holder/changeling/humanform/HF = new /obj/effect/proc_holder/changeling/humanform(null) - changeling.purchasedpowers += HF - HF.action.Grant(O) + var/datum/action/changeling/humanform/hf = new + changeling.purchasedpowers += hf + changeling.regain_powers() for(var/X in internal_organs) var/obj/item/organ/I = X @@ -135,9 +135,9 @@ mind.transfer_to(O) var/datum/antagonist/changeling/changeling = O.mind.has_antag_datum(/datum/antagonist/changeling) if(changeling) - var/obj/effect/proc_holder/changeling/humanform/HF = new /obj/effect/proc_holder/changeling/humanform(null) - changeling.purchasedpowers += HF - HF.action.Grant(O) + var/datum/action/changeling/humanform/hf = new + changeling.purchasedpowers += hf + changeling.regain_powers() if (tr_flags & TR_DEFAULTMSG) to_chat(O, "You are now a monkey.") @@ -261,8 +261,9 @@ mind.transfer_to(O) var/datum/antagonist/changeling/changeling = O.mind.has_antag_datum(/datum/antagonist/changeling) if(changeling) - for(var/obj/effect/proc_holder/changeling/humanform/HF in changeling.purchasedpowers) + for(var/datum/action/changeling/humanform/HF in changeling.purchasedpowers) changeling.purchasedpowers -= HF + changeling.regain_powers() for(var/X in internal_organs) var/obj/item/organ/I = X @@ -295,8 +296,9 @@ mind.transfer_to(O) var/datum/antagonist/changeling/changeling = O.mind.has_antag_datum(/datum/antagonist/changeling) if(changeling) - for(var/obj/effect/proc_holder/changeling/humanform/HF in changeling.purchasedpowers) + for(var/datum/action/changeling/humanform/HF in changeling.purchasedpowers) changeling.purchasedpowers -= HF + changeling.regain_powers() O.a_intent = INTENT_HELP if (tr_flags & TR_DEFAULTMSG) diff --git a/icons/mob/actions/actions_changeling.dmi b/icons/mob/actions/actions_changeling.dmi index 2f384c6119..f394ef8a82 100644 Binary files a/icons/mob/actions/actions_changeling.dmi and b/icons/mob/actions/actions_changeling.dmi differ diff --git a/icons/mob/actions/backgrounds.dmi b/icons/mob/actions/backgrounds.dmi index 6b983df95a..a55e09bcfa 100644 Binary files a/icons/mob/actions/backgrounds.dmi and b/icons/mob/actions/backgrounds.dmi differ diff --git a/tgstation.dme b/tgstation.dme index bc69b85cdf..86f9534e45 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -159,11 +159,11 @@ #include "code\__DEFINES\dcs\flags.dm" #include "code\__DEFINES\dcs\helpers.dm" #include "code\__DEFINES\dcs\signals.dm" -#include "code\__DEFINES\dcs\signals\signals_painting.dm" -#include "code\__DEFINES\dcs\signals\signals_screentips.dm" #include "code\__DEFINES\dcs\signals\signals_medical.dm" #include "code\__DEFINES\dcs\signals\signals_mod.dm" +#include "code\__DEFINES\dcs\signals\signals_painting.dm" #include "code\__DEFINES\dcs\signals\signals_reagent.dm" +#include "code\__DEFINES\dcs\signals\signals_screentips.dm" #include "code\__DEFINES\dcs\signals\signals_subsystem.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_living.dm" @@ -1665,7 +1665,6 @@ #include "code\modules\antagonists\changeling\powers\panacea.dm" #include "code\modules\antagonists\changeling\powers\pheromone_receptors.dm" #include "code\modules\antagonists\changeling\powers\regenerate.dm" -#include "code\modules\antagonists\changeling\powers\revive.dm" #include "code\modules\antagonists\changeling\powers\shriek.dm" #include "code\modules\antagonists\changeling\powers\spiders.dm" #include "code\modules\antagonists\changeling\powers\strained_muscles.dm"