diff --git a/code/datums/components/embedded.dm b/code/datums/components/embedded.dm index 0368da8ca1..5686fb2835 100644 --- a/code/datums/components/embedded.dm +++ b/code/datums/components/embedded.dm @@ -305,15 +305,3 @@ weapon.invisibility = initial(weapon.invisibility) weapon.visible_message("[weapon] falls loose from [parent].") qdel(src) - SHOULD_CALL_PARENT(1) - if(type == /datum/element) - return ELEMENT_INCOMPATIBLE - SEND_SIGNAL(target, COMSIG_ELEMENT_ATTACH, src) - if(element_flags & ELEMENT_DETACH) - RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/Detach, override = TRUE) - -/// Deactivates the functionality defines by the element on the given datum -/datum/element/proc/Detach(datum/source, force) - SEND_SIGNAL(source, COMSIG_ELEMENT_DETACH, src) - SHOULD_CALL_PARENT(1) - UnregisterSignal(source, COMSIG_PARENT_QDELETING) diff --git a/code/datums/elements/_element.dm b/code/datums/elements/_element.dm index f74dcd0b6e..a147325170 100644 --- a/code/datums/elements/_element.dm +++ b/code/datums/elements/_element.dm @@ -19,11 +19,13 @@ SHOULD_CALL_PARENT(1) if(type == /datum/element) return ELEMENT_INCOMPATIBLE + SEND_SIGNAL(target, COMSIG_ELEMENT_ATTACH, src) if(element_flags & ELEMENT_DETACH) RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/Detach, override = TRUE) /// Deactivates the functionality defines by the element on the given datum /datum/element/proc/Detach(datum/source, force) + SEND_SIGNAL(source, COMSIG_ELEMENT_DETACH, src) SHOULD_CALL_PARENT(1) UnregisterSignal(source, COMSIG_PARENT_QDELETING) diff --git a/code/datums/embedding_behavior.dm b/code/datums/embedding_behavior.dm index 025465aeb2..d823bde934 100644 --- a/code/datums/embedding_behavior.dm +++ b/code/datums/embedding_behavior.dm @@ -1,73 +1,71 @@ #define EMBEDID "embed-[embed_chance]-[fall_chance]-[pain_chance]-[pain_mult]-[fall_pain_mult]-[impact_pain_mult]-[rip_pain_mult]-[rip_time]-[ignore_throwspeed_threshold]-[jostle_chance]-[jostle_pain_mult]-[pain_stam_pct]" /proc/getEmbeddingBehavior(embed_chance = EMBED_CHANCE, - fall_chance = EMBEDDED_ITEM_FALLOUT, - pain_chance = EMBEDDED_PAIN_CHANCE, - pain_mult = EMBEDDED_PAIN_MULTIPLIER, - fall_pain_mult = EMBEDDED_FALL_PAIN_MULTIPLIER, - impact_pain_mult = EMBEDDED_IMPACT_PAIN_MULTIPLIER, - rip_pain_mult = EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER, - rip_time = EMBEDDED_UNSAFE_REMOVAL_TIME, - ignore_throwspeed_threshold = FALSE, - jostle_chance = EMBEDDED_JOSTLE_CHANCE, - jostle_pain_mult = EMBEDDED_JOSTLE_PAIN_MULTIPLIER, - pain_stam_pct = EMBEDDED_PAIN_STAM_PCT) - - . = locate(EMBEDID) - if (!.) - . = new /datum/embedding_behavior(embed_chance, fall_chance, pain_chance, pain_mult, fall_pain_mult, impact_pain_mult, rip_pain_mult, rip_time, ignore_throwspeed_threshold, jostle_chance, jostle_pain_mult, pain_stam_pct) + fall_chance = EMBEDDED_ITEM_FALLOUT, + pain_chance = EMBEDDED_PAIN_CHANCE, + pain_mult = EMBEDDED_PAIN_MULTIPLIER, + fall_pain_mult = EMBEDDED_FALL_PAIN_MULTIPLIER, + impact_pain_mult = EMBEDDED_IMPACT_PAIN_MULTIPLIER, + rip_pain_mult = EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER, + rip_time = EMBEDDED_UNSAFE_REMOVAL_TIME, + ignore_throwspeed_threshold = FALSE, + jostle_chance = EMBEDDED_JOSTLE_CHANCE, + jostle_pain_mult = EMBEDDED_JOSTLE_PAIN_MULTIPLIER, + pain_stam_pct = EMBEDDED_PAIN_STAM_PCT) + . = locate(EMBEDID) + if (!.) + . = new /datum/embedding_behavior(embed_chance, fall_chance, pain_chance, pain_mult, fall_pain_mult, impact_pain_mult, rip_pain_mult, rip_time, ignore_throwspeed_threshold, jostle_chance, jostle_pain_mult, pain_stam_pct) /datum/embedding_behavior - var/fall_chance - var/pain_chance - var/pain_mult //The coefficient of multiplication for the damage this item does while embedded (this*w_class) - var/fall_pain_mult //The coefficient of multiplication for the damage this item does when falling out of a limb (this*w_class) - var/impact_pain_mult //The coefficient of multiplication for the damage this item does when first embedded (this*w_class) - var/rip_pain_mult //The coefficient of multiplication for the damage removing this without surgery causes (this*w_class) - var/rip_time //A time in ticks, multiplied by the w_class. - var/ignore_throwspeed_threshold //if we don't give a damn about EMBED_THROWSPEED_THRESHOLD - var/jostle_chance //Chance to cause pain every time the victim moves (1/2 chance if they're walking or crawling) - var/jostle_pain_mult //The coefficient of multiplication for the damage when jostle damage is applied (this*w_class) - var/pain_stam_pct //Percentage of all pain damage dealt as stamina instead of brute (none by default) + var/embed_chance + var/fall_chance + var/pain_chance + var/pain_mult //The coefficient of multiplication for the damage this item does while embedded (this*w_class) + var/fall_pain_mult //The coefficient of multiplication for the damage this item does when falling out of a limb (this*w_class) + var/impact_pain_mult //The coefficient of multiplication for the damage this item does when first embedded (this*w_class) + var/rip_pain_mult //The coefficient of multiplication for the damage removing this without surgery causes (this*w_class) + var/rip_time //A time in ticks, multiplied by the w_class. + var/ignore_throwspeed_threshold //if we don't give a damn about EMBED_THROWSPEED_THRESHOLD + var/jostle_chance //Chance to cause pain every time the victim moves (1/2 chance if they're walking or crawling) + var/jostle_pain_mult //The coefficient of multiplication for the damage when jostle damage is applied (this*w_class) + var/pain_stam_pct //Percentage of all pain damage dealt as stamina instead of brute (none by default) /datum/embedding_behavior/New(embed_chance = EMBED_CHANCE, - fall_chance = EMBEDDED_ITEM_FALLOUT, - pain_chance = EMBEDDED_PAIN_CHANCE, - pain_mult = EMBEDDED_PAIN_MULTIPLIER, - fall_pain_mult = EMBEDDED_FALL_PAIN_MULTIPLIER, - impact_pain_mult = EMBEDDED_IMPACT_PAIN_MULTIPLIER, - rip_pain_mult = EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER, - rip_time = EMBEDDED_UNSAFE_REMOVAL_TIME, - ignore_throwspeed_threshold = FALSE, - jostle_chance = EMBEDDED_JOSTLE_CHANCE, - jostle_pain_mult = EMBEDDED_JOSTLE_PAIN_MULTIPLIER, - pain_stam_pct = EMBEDDED_PAIN_STAM_PCT) - src.embed_chance = embed_chance - src.fall_chance = fall_chance - src.pain_chance = pain_chance - src.pain_mult = pain_mult - src.fall_pain_mult = fall_pain_mult - src.impact_pain_mult = impact_pain_mult - src.rip_pain_mult = rip_pain_mult - src.rip_time = rip_time - src.ignore_throwspeed_threshold = ignore_throwspeed_threshold - src.jostle_chance = jostle_chance - src.jostle_pain_mult = jostle_pain_mult - src.pain_stam_pct = pain_stam_pct - tag = EMBEDID - + fall_chance = EMBEDDED_ITEM_FALLOUT, + pain_chance = EMBEDDED_PAIN_CHANCE, + pain_mult = EMBEDDED_PAIN_MULTIPLIER, + fall_pain_mult = EMBEDDED_FALL_PAIN_MULTIPLIER, + impact_pain_mult = EMBEDDED_IMPACT_PAIN_MULTIPLIER, + rip_pain_mult = EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER, + rip_time = EMBEDDED_UNSAFE_REMOVAL_TIME, + ignore_throwspeed_threshold = FALSE, + jostle_chance = EMBEDDED_JOSTLE_CHANCE, + jostle_pain_mult = EMBEDDED_JOSTLE_PAIN_MULTIPLIER, + pain_stam_pct = EMBEDDED_PAIN_STAM_PCT) + src.embed_chance = embed_chance + src.fall_chance = fall_chance + src.pain_chance = pain_chance + src.pain_mult = pain_mult + src.fall_pain_mult = fall_pain_mult + src.impact_pain_mult = impact_pain_mult + src.rip_pain_mult = rip_pain_mult + src.rip_time = rip_time + src.ignore_throwspeed_threshold = ignore_throwspeed_threshold + src.jostle_chance = jostle_chance + src.jostle_pain_mult = jostle_pain_mult + src.pain_stam_pct = pain_stam_pct + tag = EMBEDID /datum/embedding_behavior/proc/setRating(embed_chance, fall_chance, pain_chance, pain_mult, fall_pain_mult, impact_pain_mult, rip_pain_mult, rip_time, ignore_throwspeed_threshold) - return getEmbeddingBehavior((isnull(embed_chance) ? src.embed_chance : embed_chance),\ - (isnull(fall_chance) ? src.fall_chance : fall_chance),\ - (isnull(pain_chance) ? src.pain_chance : pain_chance),\ - (isnull(pain_mult) ? src.pain_mult : pain_mult),\ - (isnull(fall_pain_mult) ? src.fall_pain_mult : fall_pain_mult),\ - (isnull(impact_pain_mult) ? src.impact_pain_mult : impact_pain_mult),\ - (isnull(rip_pain_mult) ? src.rip_pain_mult : rip_pain_mult),\ - (isnull(rip_time) ? src.rip_time : rip_time),\ - (isnull(ignore_throwspeed_threshold) ? src.ignore_throwspeed_threshold : ignore_throwspeed_threshold),\ - (isnull(jostle_chance) ? src.jostle_chance : jostle_chance),\ - (isnull(jostle_pain_mult) ? src.jostle_pain_mult : jostle_pain_mult),\ - (isnull(pain_stam_pct) ? src.pain_stam_pct : pain_stam_pct)) - + return getEmbeddingBehavior((isnull(embed_chance) ? src.embed_chance : embed_chance),\ + (isnull(fall_chance) ? src.fall_chance : fall_chance),\ + (isnull(pain_chance) ? src.pain_chance : pain_chance),\ + (isnull(pain_mult) ? src.pain_mult : pain_mult),\ + (isnull(fall_pain_mult) ? src.fall_pain_mult : fall_pain_mult),\ + (isnull(impact_pain_mult) ? src.impact_pain_mult : impact_pain_mult),\ + (isnull(rip_pain_mult) ? src.rip_pain_mult : rip_pain_mult),\ + (isnull(rip_time) ? src.rip_time : rip_time),\ + (isnull(ignore_throwspeed_threshold) ? src.ignore_throwspeed_threshold : ignore_throwspeed_threshold),\ + (isnull(jostle_chance) ? src.jostle_chance : jostle_chance),\ + (isnull(jostle_pain_mult) ? src.jostle_pain_mult : jostle_pain_mult),\ + (isnull(pain_stam_pct) ? src.pain_stam_pct : pain_stam_pct)) #undef EMBEDID diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 26aec47346..01bace6fc5 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -107,7 +107,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb mouse_drag_pointer = MOUSE_ACTIVE_POINTER //the icon to indicate this object is being dragged - var/list/embedding = NONE + var/datum/embedding_behavior/embedding var/flags_cover = 0 //for flags such as GLASSESCOVERSEYES var/heat = 0 diff --git a/code/game/objects/items/stacks/tape.dm b/code/game/objects/items/stacks/tape.dm index 30399613f7..7be6f7faed 100644 --- a/code/game/objects/items/stacks/tape.dm +++ b/code/game/objects/items/stacks/tape.dm @@ -11,7 +11,6 @@ amount = 5 max_amount = 5 resistance_flags = FLAMMABLE - grind_results = list(/datum/reagent/cellulose = 5) var/list/conferred_embed = EMBED_HARMLESS var/overwrite_existing = FALSE diff --git a/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm b/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm index 4c377f4b82..3981cf5c9c 100644 --- a/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm +++ b/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm @@ -30,7 +30,7 @@ hitsound = 'sound/weapons/bladeslice.ogg' force = 6 throwforce = 10 - embedding = list("embed_chance" = 25, "embedded_fall_chance" = 0.5) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled + embedding = list("embed_chance" = 25, "fall_chance" = 0.5) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled //embed_chance = 25 // Look up "is_pointed" to see where we set stakes able to do this. //embedded_fall_chance = 0.5 // Chance it will fall out. obj_integrity = 30 @@ -93,7 +93,7 @@ embedded() add_mob_blood(target)//Place blood on the stake loc = C // Put INSIDE the character - B.receive_damage(w_class * embedding.embedded_impact_pain_multiplier) + B.receive_damage(w_class * embedding.pain_mult) if(C.mind) var/datum/antagonist/bloodsucker/bloodsucker = C.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) if(bloodsucker) @@ -118,7 +118,7 @@ force = 8 throwforce = 12 armour_penetration = 10 - embedding = list("embed_chance" = 50, "embedded_fall_chance" = 0) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled + embedding = list("embed_chance" = 50, "fall_chance" = 0) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled obj_integrity = 120 max_integrity = 120 diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 6303cf4c5c..a6069d75cb 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -72,7 +72,7 @@ I.add_mob_blood(src)//it embedded itself in you, of course it's bloody! I.forceMove(src) I.embedded() - L.receive_damage(I.w_class*I.embedding.embedded_impact_pain_multiplier) + L.receive_damage(I.w_class*I.embedding.impact_pain_mult) visible_message("[I] embeds itself in [src]'s [L.name]!","[I] embeds itself in your [L.name]!") SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "embedded", /datum/mood_event/embedded) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 32cb1539e9..69bb58e82a 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -621,9 +621,9 @@ for(var/obj/item/I in LB.embedded_objects) if(I.is_embed_harmless()) - to_chat(src, "\t There is \a [I] stuck to your [LB.name]!") - else - to_chat(src, "\t There is \a [I] embedded in your [LB.name]!") + to_chat(src, "\t There is \a [I] stuck to your [LB.name]!") + else + to_chat(src, "\t There is \a [I] embedded in your [LB.name]!") for(var/t in missing) to_send += "Your [parse_zone(t)] is missing!\n" diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 7ddaa2ef73..1fbf7587db 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -124,7 +124,7 @@ return TRUE var/dtype = BRUTE var/volume = I.get_volume_by_throwforce_and_or_w_class() - var/nosell_hit = SEND_SIGNAL(I, COMSIG_MOVABLE_IMPACT_ZONE, src, zone, throwingdatum) // TODO: find a better way to handle hitpush and skipcatch for humans + var/nosell_hit = SEND_SIGNAL(I, COMSIG_MOVABLE_IMPACT_ZONE, src, impacting_zone, throwingdatum) // TODO: find a better way to handle hitpush and skipcatch for humans if(nosell_hit) skipcatch = TRUE hitpush = FALSE diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index d656d75a0e..171bd40af9 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -182,7 +182,7 @@ attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") //these wont show up if the pen is off sharpness = IS_SHARP var/on = FALSE - var/embedding = list(embed_chance = EMBED_CHANCE) + embedding = list(embed_chance = EMBED_CHANCE) /obj/item/pen/edagger/ComponentInitialize() . = ..() diff --git a/code/modules/research/techweb/nodes/misc_nodes.dm b/code/modules/research/techweb/nodes/misc_nodes.dm index 6fdca34dc6..3f8ad8592a 100644 --- a/code/modules/research/techweb/nodes/misc_nodes.dm +++ b/code/modules/research/techweb/nodes/misc_nodes.dm @@ -74,9 +74,7 @@ description = "The only thing left to do after researching this tech is to start printing out a bunch of 'kick me' signs." prereq_ids = list("base") design_ids = list("sticky_tape") - research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) - export_price = 2500 hidden = TRUE experimental = TRUE @@ -87,7 +85,5 @@ description = "Taking a good joke too far? Nonsense!" prereq_ids = list("sticky_basic") design_ids = list("super_sticky_tape", "pointy_tape") - research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) - export_price = 2500 hidden = TRUE \ No newline at end of file diff --git a/modular_citadel/code/modules/mob/living/carbon/human/human.dm b/modular_citadel/code/modules/mob/living/carbon/human/human.dm index 474c9d2823..168dd7680c 100644 --- a/modular_citadel/code/modules/mob/living/carbon/human/human.dm +++ b/modular_citadel/code/modules/mob/living/carbon/human/human.dm @@ -16,7 +16,7 @@ if(!I || !L || I.loc != src || !(I in L.embedded_objects)) return L.embedded_objects -= I - L.receive_damage(I.embedding.embedded_unsafe_removal_pain_multiplier*I.w_class*painmul)//It hurts to rip it out, get surgery you dingus. And if you're ripping it out quickly via resist, it's gonna hurt even more + L.receive_damage(I.embedding.rip_pain_mult*I.w_class*painmul)//It hurts to rip it out, get surgery you dingus. And if you're ripping it out quickly via resist, it's gonna hurt even more I.forceMove(get_turf(src)) I.unembedded() user.put_in_hands(I) diff --git a/tgstation.dme b/tgstation.dme index 9c24f3549c..f487e73e1f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -400,6 +400,7 @@ #include "code\datums\components\dejavu.dm" #include "code\datums\components\earprotection.dm" #include "code\datums\components\edit_complainer.dm" +#include "code\datums\components\embedded.dm" #include "code\datums\components\explodable.dm" #include "code\datums\components\field_of_vision.dm" #include "code\datums\components\footstep.dm" @@ -531,6 +532,7 @@ #include "code\datums\elements\dusts_on_leaving_area.dm" #include "code\datums\elements\dwarfism.dm" #include "code\datums\elements\earhealing.dm" +#include "code\datums\elements\embed.dm" #include "code\datums\elements\empprotection.dm" #include "code\datums\elements\firestacker.dm" #include "code\datums\elements\flavor_text.dm" @@ -1091,6 +1093,7 @@ #include "code\game\objects\items\stacks\medical.dm" #include "code\game\objects\items\stacks\rods.dm" #include "code\game\objects\items\stacks\stack.dm" +#include "code\game\objects\items\stacks\tape.dm" #include "code\game\objects\items\stacks\telecrystal.dm" #include "code\game\objects\items\stacks\wrap.dm" #include "code\game\objects\items\stacks\sheets\glass.dm" @@ -1919,6 +1922,7 @@ #include "code\modules\events\wizard\blobies.dm" #include "code\modules\events\wizard\curseditems.dm" #include "code\modules\events\wizard\departmentrevolt.dm" +#include "code\modules\events\wizard\embeddies.dm" #include "code\modules\events\wizard\fakeexplosion.dm" #include "code\modules\events\wizard\ghost.dm" #include "code\modules\events\wizard\greentext.dm"