diff --git a/code/datums/embedding_behavior.dm b/code/datums/embedding_behavior.dm index a261ea48c6..5579e5dbf8 100644 --- a/code/datums/embedding_behavior.dm +++ b/code/datums/embedding_behavior.dm @@ -1,4 +1,4 @@ -#define EMBEDID "embed-[embed_chance]-[embedded_fall_chance]-[embedded_pain_chance]-[embedded_pain_multiplier]-[embedded_fall_pain_multiplier]-[embedded_impact_pain_multiplier]-[embedded_unsafe_removal_pain_multiplier]-[embedded_unsafe_removal_time]" +#define EMBEDID "embed-[embed_chance]-[embedded_fall_chance]-[embedded_pain_chance]-[embedded_pain_multiplier]-[embedded_fall_pain_multiplier]-[embedded_impact_pain_multiplier]-[embedded_unsafe_removal_pain_multiplier]-[embedded_unsafe_removal_time]-[ignore_throwspeed_threshold]" /proc/getEmbeddingBehavior(embed_chance = EMBED_CHANCE, embedded_fall_chance = EMBEDDED_ITEM_FALLOUT, @@ -7,10 +7,11 @@ embedded_fall_pain_multiplier = EMBEDDED_FALL_PAIN_MULTIPLIER, embedded_impact_pain_multiplier = EMBEDDED_IMPACT_PAIN_MULTIPLIER, embedded_unsafe_removal_pain_multiplier = EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER, - embedded_unsafe_removal_time = EMBEDDED_UNSAFE_REMOVAL_TIME) + embedded_unsafe_removal_time = EMBEDDED_UNSAFE_REMOVAL_TIME, + ignore_throwspeed_threshold = FALSE) . = locate(EMBEDID) if (!.) - . = new /datum/embedding_behavior(embed_chance, embedded_fall_chance, embedded_pain_chance, embedded_pain_multiplier, embedded_fall_pain_multiplier, embedded_impact_pain_multiplier, embedded_unsafe_removal_pain_multiplier, embedded_unsafe_removal_time) + . = new /datum/embedding_behavior(embed_chance, embedded_fall_chance, embedded_pain_chance, embedded_pain_multiplier, embedded_fall_pain_multiplier, embedded_impact_pain_multiplier, embedded_unsafe_removal_pain_multiplier, embedded_unsafe_removal_time, ignore_throwspeed_threshold) /datum/embedding_behavior var/embed_chance @@ -21,6 +22,7 @@ var/embedded_impact_pain_multiplier //The coefficient of multiplication for the damage this item does when first embedded (this*w_class) var/embedded_unsafe_removal_pain_multiplier //The coefficient of multiplication for the damage removing this without surgery causes (this*w_class) var/embedded_unsafe_removal_time //A time in ticks, multiplied by the w_class. + var/ignore_throwspeed_threshold //Does it ignore throwspeed requirements to embed? /datum/embedding_behavior/New(embed_chance = EMBED_CHANCE, embedded_fall_chance = EMBEDDED_ITEM_FALLOUT, @@ -29,7 +31,8 @@ embedded_fall_pain_multiplier = EMBEDDED_FALL_PAIN_MULTIPLIER, embedded_impact_pain_multiplier = EMBEDDED_IMPACT_PAIN_MULTIPLIER, embedded_unsafe_removal_pain_multiplier = EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER, - embedded_unsafe_removal_time = EMBEDDED_UNSAFE_REMOVAL_TIME) + embedded_unsafe_removal_time = EMBEDDED_UNSAFE_REMOVAL_TIME, + ignore_throwspeed_threshold = FALSE) src.embed_chance = embed_chance src.embedded_fall_chance = embedded_fall_chance src.embedded_pain_chance = embedded_pain_chance @@ -38,9 +41,10 @@ src.embedded_impact_pain_multiplier = embedded_impact_pain_multiplier src.embedded_unsafe_removal_pain_multiplier = embedded_unsafe_removal_pain_multiplier src.embedded_unsafe_removal_time = embedded_unsafe_removal_time + src.ignore_throwspeed_threshold = ignore_throwspeed_threshold tag = EMBEDID -/datum/embedding_behavior/proc/setRating(embed_chance, embedded_fall_chance, embedded_pain_chance, embedded_pain_multiplier, embedded_fall_pain_multiplier, embedded_impact_pain_multiplier, embedded_unsafe_removal_pain_multiplier, embedded_unsafe_removal_time) +/datum/embedding_behavior/proc/setRating(embed_chance, embedded_fall_chance, embedded_pain_chance, embedded_pain_multiplier, embedded_fall_pain_multiplier, embedded_impact_pain_multiplier, embedded_unsafe_removal_pain_multiplier, embedded_unsafe_removal_time, ignore_throwspeed_threshold) return getEmbeddingBehavior((isnull(embed_chance) ? src.embed_chance : embed_chance),\ (isnull(embedded_fall_chance) ? src.embedded_fall_chance : embedded_fall_chance),\ (isnull(embedded_pain_chance) ? src.embedded_pain_chance : embedded_pain_chance),\ @@ -48,6 +52,7 @@ (isnull(embedded_fall_pain_multiplier) ? src.embedded_fall_pain_multiplier : embedded_fall_pain_multiplier),\ (isnull(embedded_impact_pain_multiplier) ? src.embedded_impact_pain_multiplier : embedded_impact_pain_multiplier),\ (isnull(embedded_unsafe_removal_pain_multiplier) ? src.embedded_unsafe_removal_pain_multiplier : embedded_unsafe_removal_pain_multiplier),\ - (isnull(embedded_unsafe_removal_time) ? src.embedded_unsafe_removal_time : embedded_unsafe_removal_time)) + (isnull(embedded_unsafe_removal_time) ? src.embedded_unsafe_removal_time : embedded_unsafe_removal_time),\ + (isnull(ignore_throwspeed_threshold) ? src.ignore_throwspeed_threshold : ignore_throwspeed_threshold)) #undef EMBEDID diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index 5528669afa..b5835aef52 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -1,20 +1,21 @@ -/mob/living/carbon/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE) +/mob/living/carbon/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, spread_damage = FALSE) SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMGE, damage, damagetype, def_zone) var/hit_percent = (100-blocked)/100 if(!forced && hit_percent <= 0) return 0 var/obj/item/bodypart/BP = null - if(isbodypart(def_zone)) //we specified a bodypart object - BP = def_zone - else - if(!def_zone) - def_zone = ran_zone(def_zone) - BP = get_bodypart(check_zone(def_zone)) - if(!BP) - BP = bodyparts[1] + if(!spread_damage) + if(isbodypart(def_zone)) //we specified a bodypart object + BP = def_zone + else + if(!def_zone) + def_zone = ran_zone(def_zone) + BP = get_bodypart(check_zone(def_zone)) + if(!BP) + BP = bodyparts[1] var/damage_amount = forced ? damage : damage * hit_percent switch(damagetype) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 2ed5e349c3..6ab254852f 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1936,7 +1936,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) append_message += ", causing them to drop [target_held_item]" log_combat(user, target, "shoved", append_message) -/datum/species/proc/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H, forced = FALSE) +/datum/species/proc/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H, forced = FALSE, spread_damage = FALSE) SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMGE, damage, damagetype, def_zone) var/hit_percent = (100-(blocked+armor))/100 hit_percent = (hit_percent * (100-H.physiology.damage_resistance))/100 @@ -1944,20 +1944,20 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) return 0 var/obj/item/bodypart/BP = null - if(isbodypart(def_zone)) - if(damagetype == STAMINA && istype(def_zone, /obj/item/bodypart/head)) - BP = H.get_bodypart(check_zone(BODY_ZONE_CHEST)) + if(!spread_damage) + if(isbodypart(def_zone)) + if(damagetype == STAMINA && istype(def_zone, /obj/item/bodypart/head)) + BP = H.get_bodypart(check_zone(BODY_ZONE_CHEST)) + else + BP = def_zone else - BP = def_zone - else - if(!def_zone) - def_zone = ran_zone(def_zone) - if(damagetype == STAMINA && def_zone == BODY_ZONE_HEAD) - def_zone = BODY_ZONE_CHEST - BP = H.get_bodypart(check_zone(def_zone)) - - if(!BP) - BP = H.bodyparts[1] + if(!def_zone) + def_zone = ran_zone(def_zone) + if(damagetype == STAMINA && def_zone == BODY_ZONE_HEAD) + def_zone = BODY_ZONE_CHEST + BP = H.get_bodypart(check_zone(def_zone)) + if(!BP) + BP = H.bodyparts[1] switch(damagetype) if(BRUTE) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 3257b0e3bf..8ab6ae29c0 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -1,14 +1,20 @@ -/* - apply_damage(a,b,c) - args - a:damage - How much damage to take - b:damage_type - What type of damage to take, brute, burn - c:def_zone - Where to take the damage if its brute or burn - Returns - standard 0 if fail -*/ -/mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE) +/** + * Applies damage to this mob + * + * Sends [COMSIG_MOB_APPLY_DAMGE] + * + * Arguuments: + * * damage - amount of damage + * * damagetype - one of [BRUTE], [BURN], [TOX], [OXY], [CLONE], [STAMINA] + * * def_zone - zone that is being hit if any + * * blocked - armor value applied + * * forced - bypass hit percentage + * * spread_damage - used in overrides + * + * Returns TRUE if damage applied + */ +/mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, spread_damage = FALSE) var/hit_percent = (100-blocked)/100 if(!damage || (hit_percent <= 0)) return 0 diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 17eb51b154..f95cd68c39 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -115,7 +115,7 @@ hitpush = FALSE skipcatch = TRUE blocked = TRUE - else if(I && I.throw_speed >= EMBED_THROWSPEED_THRESHOLD && can_embed(I, src) && prob(I.embedding.embed_chance) && !HAS_TRAIT(src, TRAIT_PIERCEIMMUNE) && (!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) || incapacitated() || get_active_held_item())) + else if(I && (I.throw_speed >= EMBED_THROWSPEED_THRESHOLD || I.embedding.ignore_throwspeed_threshold) && can_embed(I, src) && prob(I.embedding.embed_chance) && !HAS_TRAIT(src, TRAIT_PIERCEIMMUNE) && (!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) || incapacitated() || get_active_held_item())) embed_item(I) hitpush = FALSE skipcatch = TRUE //can't catch the now embedded item diff --git a/code/modules/mob/living/silicon/damage_procs.dm b/code/modules/mob/living/silicon/damage_procs.dm index 91a6709bc9..2a03afb61a 100644 --- a/code/modules/mob/living/silicon/damage_procs.dm +++ b/code/modules/mob/living/silicon/damage_procs.dm @@ -1,5 +1,5 @@ -/mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE) +/mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, spread_damage = FALSE) var/hit_percent = (100-blocked)/100 if(!damage || (!forced && hit_percent <= 0)) return 0 diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 36ba19d2a2..7af0315934 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -101,7 +101,7 @@ GLOBAL_LIST_INIT(cargo_shuttle_leave_behind_typecache, typecacheof(list( if(!SSshuttle.shoppinglist.len) return - var/list/miscboxes = list() //miscboxes are combo boxes that contain all goody orders grouped + var/list/obj/miscboxes = list() //miscboxes are combo boxes that contain all goody orders grouped var/list/misc_order_num = list() //list of strings of order numbers, so that the manifest can show all orders in a box var/list/misc_contents = list() //list of lists of items that each box will contain