diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm index 7a02dbddabb..d5cc72b7640 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm @@ -15,6 +15,14 @@ ///from base of atom/fire_act(): (exposed_temperature, exposed_volume) #define COMSIG_ATOM_FIRE_ACT "atom_fire_act" ///from base of atom/bullet_act(): (/obj/projectile, def_zone) +#define COMSIG_ATOM_PRE_BULLET_ACT "pre_atom_bullet_act" + /// All this does is prevent default bullet on_hit from being called, [BULLET_ACT_HIT] being return is implied + #define COMPONENT_BULLET_ACTED (1<<0) + /// Forces bullet act to return [BULLET_ACT_BLOCK], takes priority over above + #define COMPONENT_BULLET_BLOCKED (1<<1) + /// Forces bullet act to return [BULLET_ACT_FORCE_PIERCE], takes priority over above + #define COMPONENT_BULLET_PIERCED (1<<2) +///from base of atom/bullet_act(): (/obj/projectile, def_zone) #define COMSIG_ATOM_BULLET_ACT "atom_bullet_act" ///from base of atom/CheckParts(): (list/parts_list, datum/crafting_recipe/R) #define COMSIG_ATOM_CHECKPARTS "atom_checkparts" diff --git a/code/datums/components/singularity.dm b/code/datums/components/singularity.dm index 75fd4fd0abc..41b11a219c0 100644 --- a/code/datums/components/singularity.dm +++ b/code/datums/components/singularity.dm @@ -101,7 +101,7 @@ ) AddComponent(/datum/component/connect_loc_behalf, parent, loc_connections) - RegisterSignal(parent, COMSIG_ATOM_BULLET_ACT, PROC_REF(consume_bullets)) + RegisterSignal(parent, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(consume_bullets)) if (notify_admins) admin_investigate_setup() @@ -127,7 +127,7 @@ COMSIG_ATOM_ATTACK_PAW, COMSIG_ATOM_BLOB_ACT, COMSIG_ATOM_BSA_BEAM, - COMSIG_ATOM_BULLET_ACT, + COMSIG_ATOM_PRE_BULLET_ACT, COMSIG_ATOM_BUMPED, COMSIG_MOVABLE_PRE_MOVE, COMSIG_ATOM_ATTACKBY, @@ -180,6 +180,7 @@ SIGNAL_HANDLER qdel(projectile) + return COMPONENT_BULLET_BLOCKED /// Calls singularity_act on the thing passed, usually destroying the object /datum/component/singularity/proc/default_singularity_act(atom/thing) diff --git a/code/datums/martial/_martial.dm b/code/datums/martial/_martial.dm index a3c62f5ed3f..c91ae511788 100644 --- a/code/datums/martial/_martial.dm +++ b/code/datums/martial/_martial.dm @@ -101,7 +101,3 @@ if(help_verb) remove_verb(holder_living, help_verb) return - -///Gets called when a projectile hits the owner. Returning anything other than BULLET_ACT_HIT will stop the projectile from hitting the mob. -/datum/martial_art/proc/on_projectile_hit(mob/living/attacker, obj/projectile/P, def_zone) - return BULLET_ACT_HIT diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index cfbb37e08a9..1bc6659dfba 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -15,11 +15,13 @@ return target.add_traits(list(TRAIT_NOGUNS, TRAIT_HARDLY_WOUNDED, TRAIT_NODISMEMBER), SLEEPING_CARP_TRAIT) RegisterSignal(target, COMSIG_ATOM_ATTACKBY, PROC_REF(on_attackby)) + RegisterSignal(target, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(hit_by_projectile)) target.faction |= FACTION_CARP //:D /datum/martial_art/the_sleeping_carp/on_remove(mob/living/target) target.remove_traits(list(TRAIT_NOGUNS, TRAIT_HARDLY_WOUNDED, TRAIT_NODISMEMBER), SLEEPING_CARP_TRAIT) UnregisterSignal(target, COMSIG_ATOM_ATTACKBY) + UnregisterSignal(target, COMSIG_ATOM_PRE_BULLET_ACT) target.faction -= FACTION_CARP //:( . = ..() @@ -113,6 +115,8 @@ return ..() /datum/martial_art/the_sleeping_carp/proc/can_deflect(mob/living/carp_user) + if(!can_use(carp_user) || !carp_user.throw_mode) + return FALSE if(carp_user.incapacitated(IGNORE_GRAB)) //NO STUN return FALSE if(!(carp_user.mobility_flags & MOBILITY_USE)) //NO UNABLE TO USE @@ -124,17 +128,20 @@ return FALSE return TRUE -/datum/martial_art/the_sleeping_carp/on_projectile_hit(mob/living/carp_user, obj/projectile/P, def_zone) - . = ..() +/datum/martial_art/the_sleeping_carp/proc/hit_by_projectile(mob/living/carp_user, obj/projectile/hitting_projectile, def_zone) + SIGNAL_HANDLER + if(!can_deflect(carp_user)) - return BULLET_ACT_HIT - if(carp_user.throw_mode) - carp_user.visible_message(span_danger("[carp_user] effortlessly swats the projectile aside! They can block bullets with their bare hands!"), span_userdanger("You deflect the projectile!")) - playsound(get_turf(carp_user), pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, TRUE) - P.firer = carp_user - P.set_angle(rand(0, 360))//SHING - return BULLET_ACT_FORCE_PIERCE - return BULLET_ACT_HIT + return NONE + + carp_user.visible_message( + span_danger("[carp_user] effortlessly swats [hitting_projectile] aside! [carp_user.p_They()] can block bullets with [carp_user.p_their()] bare hands!"), + span_userdanger("You deflect [hitting_projectile]!"), + ) + playsound(carp_user, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, TRUE) + hitting_projectile.firer = carp_user + hitting_projectile.set_angle(rand(0, 360))//SHING + return COMPONENT_BULLET_PIERCED ///Signal from getting attacked with an item, for a special interaction with touch spells /datum/martial_art/the_sleeping_carp/proc/on_attackby(mob/living/carp_user, obj/item/attack_weapon, mob/attacker, params) diff --git a/code/game/atom_defense.dm b/code/game/atom_defense.dm index 90533d05f62..889aaba1101 100644 --- a/code/game/atom_defense.dm +++ b/code/game/atom_defense.dm @@ -151,4 +151,6 @@ /// A cut-out proc for [/atom/proc/bullet_act] so living mobs can have their own armor behavior checks without causing issues with needing their own on_hit call /atom/proc/check_projectile_armor(def_zone, obj/projectile/impacting_projectile, is_silent) + if(uses_integrity) + return clamp(PENETRATE_ARMOUR(get_armor_rating(impacting_projectile.armor_flag), impacting_projectile.armour_penetration), 0, 100) return 0 diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 9f3281bb348..31af4ca24e6 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -586,19 +586,33 @@ /** * React to a hit by a projectile object * - * Default behaviour is to send the [COMSIG_ATOM_BULLET_ACT] and then call [on_hit][/obj/projectile/proc/on_hit] on the projectile. - * * @params - * hitting_projectile - projectile - * def_zone - zone hit - * piercing_hit - is this hit piercing or normal? + * * hitting_projectile - projectile + * * def_zone - zone hit + * * piercing_hit - is this hit piercing or normal? */ /atom/proc/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) + SHOULD_CALL_PARENT(TRUE) + + var/sigreturn = SEND_SIGNAL(src, COMSIG_ATOM_PRE_BULLET_ACT, hitting_projectile, def_zone) + if(sigreturn & COMPONENT_BULLET_PIERCED) + return BULLET_ACT_FORCE_PIERCE + if(sigreturn & COMPONENT_BULLET_BLOCKED) + return BULLET_ACT_BLOCK + if(sigreturn & COMPONENT_BULLET_ACTED) + return BULLET_ACT_HIT + SEND_SIGNAL(src, COMSIG_ATOM_BULLET_ACT, hitting_projectile, def_zone) - // This armor check only matters for the visuals and messages in on_hit(), it's not actually used to reduce damage since - // only living mobs use armor to reduce damage, but on_hit() is going to need the value no matter what is shot. - var/visual_armor_check = check_projectile_armor(def_zone, hitting_projectile) - . = hitting_projectile.on_hit(src, visual_armor_check, def_zone, piercing_hit) + if(QDELETED(hitting_projectile)) // Signal deleted it? + return BULLET_ACT_BLOCK + + return hitting_projectile.on_hit( + target = src, + // This armor check only matters for the visuals and messages in on_hit(), it's not actually used to reduce damage since + // only living mobs use armor to reduce damage, but on_hit() is going to need the value no matter what is shot. + blocked = check_projectile_armor(def_zone, hitting_projectile), + pierce_hit = piercing_hit, + ) ///Return true if we're inside the passed in atom /atom/proc/in_contents_of(container)//can take class or object instance as argument diff --git a/code/game/objects/effects/phased_mob.dm b/code/game/objects/effects/phased_mob.dm index 273a4c772a5..1456fa350bf 100644 --- a/code/game/objects/effects/phased_mob.dm +++ b/code/game/objects/effects/phased_mob.dm @@ -61,7 +61,8 @@ /obj/effect/dummy/phased_mob/ex_act() return FALSE -/obj/effect/dummy/phased_mob/bullet_act(blah) +/obj/effect/dummy/phased_mob/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) + SHOULD_CALL_PARENT(FALSE) return BULLET_ACT_FORCE_PIERCE /obj/effect/dummy/phased_mob/relaymove(mob/living/user, direction) diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm index 65cfcfced21..d86f386950c 100644 --- a/code/game/objects/items/cardboard_cutouts.dm +++ b/code/game/objects/items/cardboard_cutouts.dm @@ -6,6 +6,7 @@ icon_state = "cutout_basic" w_class = WEIGHT_CLASS_BULKY resistance_flags = FLAMMABLE + obj_flags = CAN_BE_HIT item_flags = NO_PIXEL_RANDOM_DROP /// If the cutout is pushed over and has to be righted var/pushed_over = FALSE @@ -35,7 +36,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/cardboard_cutout/attack_hand(mob/living/user, list/modifiers) - if(!user.combat_mode || pushed_over) + if(!user.combat_mode || pushed_over || !isturf(loc)) return ..() user.visible_message(span_warning("[user] pushes over [src]!"), span_danger("You push over [src]!")) playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE) @@ -60,32 +61,20 @@ /obj/item/cardboard_cutout/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/toy/crayon)) change_appearance(I, user) - return - // Why yes, this does closely resemble mob and object attack code. - if(I.item_flags & NOBLUDGEON) - return - if(!I.force) - playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), TRUE, -1) - else if(I.hitsound) - playsound(loc, I.hitsound, get_clamped_volume(), TRUE, -1) - - user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation(src) - - if(I.force) - user.visible_message(span_danger("[user] hits [src] with [I]!"), \ - span_danger("You hit [src] with [I]!")) - if(prob(I.force)) - push_over() - -/obj/item/cardboard_cutout/bullet_act(obj/projectile/P, def_zone, piercing_hit = FALSE) - if(istype(P, /obj/projectile/bullet)) - P.on_hit(src, 0, piercing_hit) - visible_message(span_danger("[src] is hit by [P]!")) - playsound(src, 'sound/weapons/slice.ogg', 50, TRUE) - if(prob(P.damage)) + return TRUE + + return ..() + +/obj/item/cardboard_cutout/take_damage(damage_amount, damage_type, damage_flag, sound_effect, attack_dir, armour_penetration) + . = ..() + var/damage_sustained = . || 0 + if((damage_flag == BULLET || damage_flag == MELEE) && (damage_type == BRUTE) && prob(damage_sustained)) push_over() - return BULLET_ACT_HIT + +/obj/item/cardboard_cutout/deconstruct(disassembled) + if(!(flags_1 & (HOLOGRAM_1|NODECONSTRUCT_1))) + new /obj/item/stack/sheet/cardboard(loc, 1) + return ..() /proc/get_cardboard_cutout_instance(datum/cardboard_cutout/cardboard_cutout) ASSERT(ispath(cardboard_cutout), "[cardboard_cutout] is not a path of /datum/cardboard_cutout") diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index bfe1457aa52..7f7f733ad86 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -815,7 +815,8 @@ carbon_target.set_eye_blur_if_lower(6 SECONDS) carbon_target.adjust_temp_blindness(2 SECONDS) if(carbon_target.get_eye_protection() <= 0) // no eye protection? ARGH IT BURNS. Warning: don't add a stun here. It's a roundstart item with some quirks. - carbon_target.apply_effects(eyeblur = 5, jitter = 10) + carbon_target.adjust_jitter(1 SECONDS) + carbon_target.adjust_eye_blur(0.5 SECONDS) flash_color(carbon_target, flash_color=paint_color, flash_time=40) if(ishuman(carbon_target) && actually_paints) var/mob/living/carbon/human/human_target = carbon_target diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index cd196ed48cf..77f002c3f1e 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -235,6 +235,7 @@ shard.countdown = null START_PROCESSING(SSobj, src) visible_message(span_warning("[src] appears, balanced ever so perfectly on its hilt. This isn't ominous at all.")) + RegisterSignal(src, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(eat_bullets)) /obj/item/melee/supermatter_sword/process() if(balanced || throwing || ismob(src.loc) || isnull(src.loc)) @@ -283,11 +284,16 @@ consume_everything() return TRUE -/obj/item/melee/supermatter_sword/bullet_act(obj/projectile/projectile) - visible_message(span_danger("[projectile] smacks into [src] and rapidly flashes to ash."),\ - span_hear("You hear a loud crack as you are washed with a wave of heat.")) - consume_everything(projectile) - return BULLET_ACT_HIT +/obj/item/melee/supermatter_sword/proc/eat_bullets(datum/source, obj/projectile/hitting_projectile) + SIGNAL_HANDLER + + visible_message( + span_danger("[hitting_projectile] smacks into [source] and rapidly flashes to ash."), + null, + span_hear("You hear a loud crack as you are washed with a wave of heat."), + ) + consume_everything(hitting_projectile) + return COMPONENT_BULLET_BLOCKED /obj/item/melee/supermatter_sword/suicide_act(mob/living/user) user.visible_message(span_suicide("[user] touches [src]'s blade. It looks like [user.p_theyre()] tired of waiting for the radiation to kill [user.p_them()]!")) diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index 66df7997f66..ff08886e7d3 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -4,28 +4,75 @@ icon = 'icons/obj/structures.dmi' icon_state = "target_h" density = FALSE - var/hp = 1800 + max_integrity = 1800 + item_flags = CAN_BE_HIT /// Lazylist to keep track of bullet-hole overlays. var/list/bullethole_overlays -/obj/item/target/welder_act(mob/living/user, obj/item/I) - ..() - if(I.use_tool(src, user, 0, volume=40)) - for (var/bullethole in bullethole_overlays) - cut_overlay(bullethole) - bullethole_overlays = null - to_chat(user, span_notice("You slice off [src]'s uneven chunks of aluminium and scorch marks.")) +/obj/item/target/welder_act(mob/living/user, obj/item/tool) + if(tool.use_tool(src, user, 0 SECONDS, volume = 40)) + LAZYNULL(bullethole_overlays) + balloon_alert(user, "target repaired") + update_appearance(UPDATE_OVERLAYS) return TRUE +/obj/item/target/update_overlays() + . = ..() + . |= bullethole_overlays + +/obj/item/target/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) + if(prob(25)) + return ..() // RNG change to just not leave a mark, like walls + if(length(overlays) > 35) + return ..() // Too many bullets, we're done here + + // Projectiles which do not deal damage will not leave dent / scorch mark graphics. + // However we snowflake some projectiles to leave them anyway, because they're appropriate. + var/static/list/always_leave_marks + if(isnull(always_leave_marks)) + always_leave_marks = typecacheof(list( + /obj/projectile/beam/practice, + /obj/projectile/beam/laser/carbine/practice, + )) + + var/is_invalid_damage = hitting_projectile.damage_type != BRUTE && hitting_projectile.damage_type != BURN + var/is_safe = !hitting_projectile.is_hostile_projectile() + var/is_generic_projectile = !is_type_in_typecache(hitting_projectile, always_leave_marks) + if(is_generic_projectile && (is_invalid_damage || is_safe)) + return ..() // Don't bother unless it's real shit + + var/p_x = hitting_projectile.p_x + pick(0, 0, 0, 0, 0, -1, 1) // really ugly way of coding "sometimes offset p_x!" + var/p_y = hitting_projectile.p_y + pick(0, 0, 0, 0, 0, -1, 1) + var/icon/our_icon = icon(icon, icon_state) + if(!our_icon.GetPixel(p_x, p_y) || hitting_projectile.original != src) + return BULLET_ACT_FORCE_PIERCE // We, "missed", I guess? + + . = ..() + if(. != BULLET_ACT_HIT) + return + + var/image/bullet_hole = image('icons/effects/effects.dmi', "dent", OBJ_LAYER + 0.5) + bullet_hole.pixel_x = p_x - 1 //offset correction + bullet_hole.pixel_y = p_y - 1 + if(hitting_projectile.damage_type != BRUTE) + bullet_hole.setDir(pick(GLOB.cardinals))// random scorch design + if(hitting_projectile.damage < 20 && is_generic_projectile) + bullet_hole.icon_state = "light_scorch" + else + bullet_hole.icon_state = "scorch" + + LAZYADD(bullethole_overlays, bullet_hole) + update_appearance(UPDATE_OVERLAYS) + /obj/item/target/syndicate icon_state = "target_s" desc = "A shooting target that looks like syndicate scum." - hp = 2600 + max_integrity = 2600 /obj/item/target/alien icon_state = "target_q" desc = "A shooting target that looks like a xenomorphic alien." - hp = 2350 + max_integrity = 2350 /obj/item/target/alien/anchored anchored = TRUE @@ -33,44 +80,8 @@ /obj/item/target/clown icon_state = "target_c" desc = "A shooting target that looks like a useless clown." - hp = 2000 - -#define DECALTYPE_SCORCH 1 -#define DECALTYPE_BULLET 2 + max_integrity = 2000 /obj/item/target/clown/bullet_act(obj/projectile/P) . = ..() - playsound(src.loc, 'sound/items/bikehorn.ogg', 50, TRUE) - -/obj/item/target/bullet_act(obj/projectile/P) - if(istype(P, /obj/projectile/bullet)) // If it's a foam dart, don't bother with any of this other shit - return P.on_hit(src, 0) - var/p_x = P.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset P.p_x!" - var/p_y = P.p_y + pick(0,0,0,0,0,-1,1) - var/decaltype = DECALTYPE_SCORCH - if(istype(P, /obj/projectile/bullet)) - decaltype = DECALTYPE_BULLET - var/icon/C = icon(icon,icon_state) - if(C.GetPixel(p_x, p_y) && P.original == src && overlays.len <= 35) // if the located pixel isn't blank (null) - hp -= P.damage - if(hp <= 0) - visible_message(span_danger("[src] breaks into tiny pieces and collapses!")) - qdel(src) - var/image/bullet_hole = image('icons/effects/effects.dmi', "scorch", OBJ_LAYER + 0.5) - bullet_hole.pixel_x = p_x - 1 //offset correction - bullet_hole.pixel_y = p_y - 1 - if(decaltype == DECALTYPE_SCORCH) - bullet_hole.setDir(pick(NORTH,SOUTH,EAST,WEST))// random scorch design - if(P.damage >= 20 || istype(P, /obj/projectile/beam/practice)) - bullet_hole.setDir(pick(NORTH,SOUTH,EAST,WEST)) - else - bullet_hole.icon_state = "light_scorch" - else - bullet_hole.icon_state = "dent" - LAZYADD(bullethole_overlays, bullet_hole) - add_overlay(bullet_hole) - return BULLET_ACT_HIT - return BULLET_ACT_FORCE_PIERCE - -#undef DECALTYPE_SCORCH -#undef DECALTYPE_BULLET + playsound(src, 'sound/items/bikehorn.ogg', 50, TRUE) diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index a06b7fdaea7..7f135fe839c 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -23,14 +23,29 @@ return TRUE -/obj/bullet_act(obj/projectile/P) +/obj/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) . = ..() - playsound(src, P.hitsound, 50, TRUE) - var/damage + if(. != BULLET_ACT_HIT) + return . + + playsound(src, hitting_projectile.hitsound, 50, TRUE) + var/damage_sustained = 0 if(!QDELETED(src)) //Bullet on_hit effect might have already destroyed this object - damage = take_damage(P.damage * P.demolition_mod, P.damage_type, P.armor_flag, 0, REVERSE_DIR(P.dir), P.armour_penetration) - if(P.suppressed != SUPPRESSED_VERY) - visible_message(span_danger("[src] is hit by \a [P][damage ? "" : ", without leaving a mark"]!"), null, null, COMBAT_MESSAGE_RANGE) + damage_sustained = take_damage( + hitting_projectile.damage * hitting_projectile.demolition_mod, + hitting_projectile.damage_type, + hitting_projectile.armor_flag, + FALSE, + REVERSE_DIR(hitting_projectile.dir), + hitting_projectile.armour_penetration, + ) + if(hitting_projectile.suppressed != SUPPRESSED_VERY) + visible_message( + span_danger("[src] is hit by \a [hitting_projectile][damage_sustained ? "" : ", without leaving a mark"]!"), + vision_distance = COMBAT_MESSAGE_RANGE, + ) + + return damage_sustained > 0 ? BULLET_ACT_HIT : BULLET_ACT_BLOCK /obj/attack_hulk(mob/living/carbon/human/user) ..() diff --git a/code/game/objects/structures/holosign.dm b/code/game/objects/structures/holosign.dm index b3d51ceffa1..fdef93e77d6 100644 --- a/code/game/objects/structures/holosign.dm +++ b/code/game/objects/structures/holosign.dm @@ -139,14 +139,13 @@ density = TRUE max_integrity = 10 allow_walk = FALSE + armor_type = /datum/armor/structure_holosign/cyborg_barrier // Gets a special armor subtype which is extra good at defense. -/obj/structure/holosign/barrier/cyborg/bullet_act(obj/projectile/P) - take_damage((P.damage / 5) , BRUTE, MELEE, 1) //Doesn't really matter what damage flag it is. - if(istype(P, /obj/projectile/energy/electrode)) - take_damage(10, BRUTE, MELEE, 1) //Tasers aren't harmful. - if(istype(P, /obj/projectile/beam/disabler)) - take_damage(5, BRUTE, MELEE, 1) //Disablers aren't harmful. - return BULLET_ACT_HIT +/datum/armor/structure_holosign/cyborg_barrier + bullet = 80 + laser = 80 + energy = 80 + melee = 20 /obj/structure/holosign/barrier/medical name = "\improper PENLITE holobarrier" @@ -200,12 +199,9 @@ name = "Charged Energy Field" desc = "A powerful energy field that blocks movement. Energy arcs off it." max_integrity = 20 + armor_type = /datum/armor/structure_holosign //Yeah no this doesn't get projectile resistance. var/shockcd = 0 -/obj/structure/holosign/barrier/cyborg/hacked/bullet_act(obj/projectile/P) - take_damage(P.damage, BRUTE, MELEE, 1) //Yeah no this doesn't get projectile resistance. - return BULLET_ACT_HIT - /obj/structure/holosign/barrier/cyborg/hacked/proc/cooldown() shockcd = FALSE diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index 54027b7d8a2..9c5b6a10ec9 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -373,53 +373,87 @@ playsound(get_turf(H),I.hitsound,75,TRUE) return -/obj/projectile/tentacle/on_hit(atom/target, blocked = FALSE) - var/mob/living/carbon/human/H = firer +/obj/projectile/tentacle/on_hit(atom/movable/target, blocked = 0, pierce_hit) + if(!isliving(firer) || !ismovable(target)) + return ..() + if(blocked >= 100) return BULLET_ACT_BLOCK - if(isitem(target)) - var/obj/item/I = target - if(!I.anchored) - to_chat(firer, span_notice("You pull [I] towards yourself.")) - H.throw_mode_on(THROW_MODE_TOGGLE) - I.throw_at(H, 10, 2) - . = BULLET_ACT_HIT - - else if(isliving(target)) - var/mob/living/L = target - if(!L.anchored && !L.throwing)//avoid double hits - if(iscarbon(L)) - var/mob/living/carbon/C = L - var/firer_combat_mode = TRUE - var/mob/living/living_shooter = firer - if(istype(living_shooter)) - firer_combat_mode = living_shooter.combat_mode - if(fire_modifiers && fire_modifiers["right"]) - var/obj/item/I = C.get_active_held_item() - if(I) - if(C.dropItemToGround(I)) - C.visible_message(span_danger("[I] is yanked off [C]'s hand by [src]!"),span_userdanger("A tentacle pulls [I] away from you!")) - on_hit(I) //grab the item as if you had hit it directly with the tentacle - return BULLET_ACT_HIT - else - to_chat(firer, span_warning("You can't seem to pry [I] off [C]'s hands!")) - return BULLET_ACT_BLOCK - else - to_chat(firer, span_danger("[C] has nothing in hand to disarm!")) - return BULLET_ACT_HIT - if(firer_combat_mode) - C.visible_message(span_danger("[L] is thrown towards [H] by a tentacle!"),span_userdanger("A tentacle grabs you and throws you towards [H]!")) - C.throw_at(get_step_towards(H,C), 8, 2, H, TRUE, TRUE, callback=CALLBACK(src, PROC_REF(tentacle_grab), H, C)) - return BULLET_ACT_HIT - else - C.visible_message(span_danger("[L] is grabbed by [H]'s tentacle!"),span_userdanger("A tentacle grabs you and pulls you towards [H]!")) - C.throw_at(get_step_towards(H,C), 8, 2, H, TRUE, TRUE) - return BULLET_ACT_HIT - - else - L.visible_message(span_danger("[L] is pulled by [H]'s tentacle!"),span_userdanger("A tentacle grabs you and pulls you towards [H]!")) - L.throw_at(get_step_towards(H,L), 8, 2) - . = BULLET_ACT_HIT + + var/mob/living/ling = firer + if(isitem(target) && iscarbon(ling)) + var/obj/item/catching = target + if(catching.anchored) + return BULLET_ACT_BLOCK + + var/mob/living/carbon/carbon_ling = ling + to_chat(carbon_ling, span_notice("You pull [catching] towards yourself.")) + carbon_ling.throw_mode_on(THROW_MODE_TOGGLE) + catching.throw_at( + target = carbon_ling, + range = 10, + speed = 2, + thrower = carbon_ling, + diagonals_first = TRUE, + callback = CALLBACK(src, PROC_REF(reset_throw), carbon_ling), + gentle = TRUE, + ) + return BULLET_ACT_HIT + + . = ..() + if(. != BULLET_ACT_HIT) + return . + var/mob/living/victim = target + if(!isliving(victim) || target.anchored || victim.throwing) + return BULLET_ACT_BLOCK + + if(!iscarbon(victim) || !ishuman(ling) || !ling.combat_mode) + victim.visible_message( + span_danger("[victim] is grabbed by [ling]'s [src]]!"), + span_userdanger("\A [src] grabs you and pulls you towards [ling]!"), + ) + victim.throw_at( + target = get_step_towards(ling, victim), + range = 8, + speed = 2, + thrower = ling, + diagonals_first = TRUE, + gentle = TRUE, + ) + return BULLET_ACT_HIT + + if(LAZYACCESS(fire_modifiers, RIGHT_CLICK)) + var/obj/item/stealing = victim.get_active_held_item() + if(!isnull(stealing)) + if(victim.dropItemToGround(stealing)) + victim.visible_message( + span_danger("[stealing] is yanked off [victim]'s hand by [src]!"), + span_userdanger("\A [src] pulls [stealing] away from you!"), + ) + return on_hit(stealing) //grab the item as if you had hit it directly with the tentacle + + to_chat(ling, span_warning("You can't seem to pry [stealing] off [victim]'s hands!")) + return BULLET_ACT_BLOCK + + to_chat(ling, span_danger("[victim] has nothing in hand to disarm!")) + return BULLET_ACT_HIT + + if(ling.combat_mode) + victim.visible_message( + span_danger("[victim] is thrown towards [ling] by \a [src]!"), + span_userdanger("\A [src] grabs you and throws you towards [ling]!"), + ) + victim.throw_at( + target = get_step_towards(ling, victim), + range = 8, + speed = 2, + thrower = ling, + diagonals_first = TRUE, + callback = CALLBACK(src, PROC_REF(tentacle_grab), ling, victim), + gentle = TRUE, + ) + + return BULLET_ACT_HIT /obj/projectile/tentacle/Destroy() qdel(chain) diff --git a/code/modules/antagonists/heretic/magic/star_blast.dm b/code/modules/antagonists/heretic/magic/star_blast.dm index 297e24455e2..212e90535d6 100644 --- a/code/modules/antagonists/heretic/magic/star_blast.dm +++ b/code/modules/antagonists/heretic/magic/star_blast.dm @@ -37,7 +37,7 @@ . = ..() AddElement(/datum/element/effect_trail, /obj/effect/forcefield/cosmic_field/fast) -/obj/projectile/magic/star_ball/on_hit(atom/target, blocked = FALSE, pierce_hit) +/obj/projectile/magic/star_ball/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() var/mob/living/cast_on = firer for(var/mob/living/nearby_mob in range(star_mark_range, target)) diff --git a/code/modules/antagonists/nightmare/nightmare_organs.dm b/code/modules/antagonists/nightmare/nightmare_organs.dm index cf1142ee2fa..1e07ddc6941 100644 --- a/code/modules/antagonists/nightmare/nightmare_organs.dm +++ b/code/modules/antagonists/nightmare/nightmare_organs.dm @@ -27,10 +27,25 @@ terrorize_spell = new(src) terrorize_spell.Grant(brain_owner) + RegisterSignal(brain_owner, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(dodge_bullets)) + /obj/item/organ/internal/brain/shadow/nightmare/on_remove(mob/living/carbon/brain_owner) . = ..() QDEL_NULL(our_jaunt) QDEL_NULL(terrorize_spell) + UnregisterSignal(brain_owner, COMSIG_ATOM_PRE_BULLET_ACT) + +/obj/item/organ/internal/brain/shadow/nightmare/proc/dodge_bullets(mob/living/carbon/human/source, obj/projectile/hitting_projectile, def_zone) + SIGNAL_HANDLER + var/turf/dodge_turf = source.loc + if(!istype(dodge_turf) || dodge_turf.get_lumcount() >= SHADOW_SPECIES_LIGHT_THRESHOLD) + return NONE + source.visible_message( + span_danger("[source] dances in the shadows, evading [hitting_projectile]!"), + span_danger("You evade [hitting_projectile] with the cover of darkness!"), + ) + playsound(source, SFX_BULLET_MISS, 75, TRUE) + return COMPONENT_BULLET_PIERCED /obj/item/organ/internal/heart/nightmare name = "heart of darkness" diff --git a/code/modules/antagonists/nightmare/nightmare_species.dm b/code/modules/antagonists/nightmare/nightmare_species.dm index 88331353657..2db4ca2bb2c 100644 --- a/code/modules/antagonists/nightmare/nightmare_species.dm +++ b/code/modules/antagonists/nightmare/nightmare_species.dm @@ -42,15 +42,5 @@ C.fully_replace_character_name(null, pick(GLOB.nightmare_names)) C.set_safe_hunger_level() -/datum/species/shadow/nightmare/bullet_act(obj/projectile/P, mob/living/carbon/human/H) - var/turf/T = H.loc - if(istype(T)) - var/light_amount = T.get_lumcount() - if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD) - H.visible_message(span_danger("[H] dances in the shadows, evading [P]!")) - playsound(T, SFX_BULLET_MISS, 75, TRUE) - return BULLET_ACT_FORCE_PIERCE - return ..() - /datum/species/shadow/nightmare/check_roundstart_eligible() return FALSE diff --git a/code/modules/awaymissions/cordon.dm b/code/modules/awaymissions/cordon.dm index 5db4dd997d3..285d0d49e10 100644 --- a/code/modules/awaymissions/cordon.dm +++ b/code/modules/awaymissions/cordon.dm @@ -40,7 +40,8 @@ return /turf/cordon/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) - return BULLET_ACT_HIT + SHOULD_CALL_PARENT(FALSE) // Fuck you + return BULLET_ACT_BLOCK /turf/cordon/Adjacent(atom/neighbor, atom/target, atom/movable/mover) return FALSE diff --git a/code/modules/capture_the_flag/ctf_equipment.dm b/code/modules/capture_the_flag/ctf_equipment.dm index e822ae2dbb1..798bfa49be9 100644 --- a/code/modules/capture_the_flag/ctf_equipment.dm +++ b/code/modules/capture_the_flag/ctf_equipment.dm @@ -10,7 +10,7 @@ return PROJECTILE_PIERCE_NONE /// hey uhhh don't hit anyone behind them . = ..() -/obj/projectile/beam/ctf/on_hit(atom/target, blocked = FALSE) +/obj/projectile/beam/ctf/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(is_ctf_target(target) && blocked == FALSE) if(iscarbon(target)) @@ -176,7 +176,7 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect/purple_laser light_color = LIGHT_COLOR_PURPLE -/obj/projectile/beam/instakill/on_hit(atom/target) +/obj/projectile/beam/instakill/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(iscarbon(target)) var/mob/living/carbon/target_mob = target diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index de8458cb3a9..95f118a0c91 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -281,11 +281,11 @@ /obj/machinery/hydroponics/bullet_act(obj/projectile/Proj) //Works with the Somatoray to modify plant variables. if(!myseed) return ..() - if(istype(Proj , /obj/projectile/energy/floramut)) + if(istype(Proj , /obj/projectile/energy/flora/mut)) mutate() - else if(istype(Proj , /obj/projectile/energy/florayield)) + else if(istype(Proj , /obj/projectile/energy/flora/yield)) return myseed.bullet_act(Proj) - else if(istype(Proj , /obj/projectile/energy/florarevolution)) + else if(istype(Proj , /obj/projectile/energy/flora/evolution)) if(myseed) if(LAZYLEN(myseed.mutatelist)) myseed.set_instability(myseed.instability/2) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 36653ebafb9..3a399c87216 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -170,7 +170,7 @@ /obj/item/seeds/bullet_act(obj/projectile/Proj) //Works with the Somatoray to modify plant variables. - if(istype(Proj, /obj/projectile/energy/florayield)) + if(istype(Proj, /obj/projectile/energy/flora/yield)) var/rating = 1 if(istype(loc, /obj/machinery/hydroponics)) var/obj/machinery/hydroponics/H = loc diff --git a/code/modules/mapfluff/ruins/lavalandruin_code/biodome_winter.dm b/code/modules/mapfluff/ruins/lavalandruin_code/biodome_winter.dm index adb5afaf5c8..770d787f8ad 100644 --- a/code/modules/mapfluff/ruins/lavalandruin_code/biodome_winter.dm +++ b/code/modules/mapfluff/ruins/lavalandruin_code/biodome_winter.dm @@ -18,7 +18,7 @@ . = ..() . += span_notice("Throw this at objects or creatures to freeze them, it will boomerang back so be cautious!") -/obj/item/freeze_cube/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, quickstart = TRUE) +/obj/item/freeze_cube/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, gentle, quickstart = TRUE) . = ..() if(!.) return diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm index 4ceddb09854..f5676221f7a 100644 --- a/code/modules/mining/equipment/kinetic_crusher.dm +++ b/code/modules/mining/equipment/kinetic_crusher.dm @@ -201,7 +201,7 @@ hammer_synced = null return ..() -/obj/projectile/destabilizer/on_hit(atom/target, blocked = FALSE) +/obj/projectile/destabilizer/on_hit(atom/target, blocked = 0, pierce_hit) if(isliving(target)) var/mob/living/L = target var/had_effect = (L.has_status_effect(/datum/status_effect/crusher_mark)) //used as a boolean diff --git a/code/modules/mining/lavaland/megafauna_loot.dm b/code/modules/mining/lavaland/megafauna_loot.dm index 64414f10501..bdcf089e606 100644 --- a/code/modules/mining/lavaland/megafauna_loot.dm +++ b/code/modules/mining/lavaland/megafauna_loot.dm @@ -608,7 +608,7 @@ light_power = 1 light_color = LIGHT_COLOR_BLOOD_MAGIC -/obj/projectile/soulscythe/on_hit(atom/target, blocked = FALSE) +/obj/projectile/soulscythe/on_hit(atom/target, blocked = 0, pierce_hit) if(ishostile(target)) damage *= 2 return ..() diff --git a/code/modules/mob/living/basic/jungle/mega_arachnid/mega_arachnid_abilities.dm b/code/modules/mob/living/basic/jungle/mega_arachnid/mega_arachnid_abilities.dm index e8c4d1723e7..6e8ff992891 100644 --- a/code/modules/mob/living/basic/jungle/mega_arachnid/mega_arachnid_abilities.dm +++ b/code/modules/mob/living/basic/jungle/mega_arachnid/mega_arachnid_abilities.dm @@ -17,7 +17,7 @@ icon_state = "tentacle_end" damage = 0 -/obj/projectile/mega_arachnid/on_hit(atom/target, blocked = FALSE) +/obj/projectile/mega_arachnid/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(!iscarbon(target) || blocked >= 100) return diff --git a/code/modules/mob/living/basic/jungle/seedling/seedling_projectiles.dm b/code/modules/mob/living/basic/jungle/seedling/seedling_projectiles.dm index 726b8105933..37a3ec1c0ac 100644 --- a/code/modules/mob/living/basic/jungle/seedling/seedling_projectiles.dm +++ b/code/modules/mob/living/basic/jungle/seedling/seedling_projectiles.dm @@ -11,7 +11,7 @@ hitsound_wall = 'sound/weapons/effects/searwall.ogg' nondirectional_sprite = TRUE -/obj/projectile/seedling/on_hit(atom/target) +/obj/projectile/seedling/on_hit(atom/target, blocked = 0, pierce_hit) if(!isliving(target)) return ..() diff --git a/code/modules/mob/living/basic/lavaland/basilisk/basilisk.dm b/code/modules/mob/living/basic/lavaland/basilisk/basilisk.dm index 45bfd74d23b..d4fef239bf8 100644 --- a/code/modules/mob/living/basic/lavaland/basilisk/basilisk.dm +++ b/code/modules/mob/living/basic/lavaland/basilisk/basilisk.dm @@ -43,6 +43,9 @@ /mob/living/basic/mining/basilisk/bullet_act(obj/projectile/bullet, def_zone, piercing_hit) . = ..() + if(. != BULLET_ACT_HIT) + return + if (istype(bullet, /obj/projectile/temp)) var/obj/projectile/temp/heat_bullet = bullet if (heat_bullet.temperature < 0) diff --git a/code/modules/mob/living/basic/lavaland/goldgrub/goldgrub.dm b/code/modules/mob/living/basic/lavaland/goldgrub/goldgrub.dm index 58b0e1bbbdb..fe1cc001101 100644 --- a/code/modules/mob/living/basic/lavaland/goldgrub/goldgrub.dm +++ b/code/modules/mob/living/basic/lavaland/goldgrub/goldgrub.dm @@ -65,6 +65,8 @@ if(can_lay_eggs) make_egg_layer() + RegisterSignal(src, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(block_bullets)) + /mob/living/basic/mining/goldgrub/UnarmedAttack(atom/attack_target, proximity_flag, list/modifiers) . = ..() if(!.) @@ -76,12 +78,14 @@ if(istype(attack_target, /obj/item/stack/ore)) consume_ore(attack_target) -/mob/living/basic/mining/goldgrub/bullet_act(obj/projectile/bullet) - if(stat == DEAD) - return BULLET_ACT_FORCE_PIERCE +/mob/living/basic/mining/goldgrub/proc/block_bullets(datum/source, obj/projectile/hitting_projectile) + SIGNAL_HANDLER + + if(stat != CONSCIOUS) + return COMPONENT_BULLET_PIERCED - visible_message(span_danger("The [bullet.name] is repelled by [src]'s girth!")) - return BULLET_ACT_BLOCK + visible_message(span_danger("[hitting_projectile] is repelled by [source]'s girth!")) + return COMPONENT_BULLET_BLOCKED /mob/living/basic/mining/goldgrub/proc/barf_contents(gibbed) playsound(src, 'sound/effects/splat.ogg', 50, TRUE) @@ -188,4 +192,3 @@ current_growth = 0,\ location_allowlist = typecacheof(list(/turf)),\ ) - diff --git a/code/modules/mob/living/basic/lavaland/watcher/watcher_projectiles.dm b/code/modules/mob/living/basic/lavaland/watcher/watcher_projectiles.dm index 2680e9aa914..40afd58c1da 100644 --- a/code/modules/mob/living/basic/lavaland/watcher/watcher_projectiles.dm +++ b/code/modules/mob/living/basic/lavaland/watcher/watcher_projectiles.dm @@ -7,7 +7,7 @@ armor_flag = ENERGY temperature = -50 -/obj/projectile/temp/watcher/on_hit(mob/living/target, blocked = 0) +/obj/projectile/temp/watcher/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if (!isliving(target)) return diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 13b64776807..b68c7d6415a 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -106,7 +106,7 @@ if(CanHug(AM) && Adjacent(AM)) return Leap(AM) -/obj/item/clothing/mask/facehugger/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, quickstart = TRUE) +/obj/item/clothing/mask/facehugger/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, gentle, quickstart = TRUE) . = ..() if(!.) return diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index 6bd93d364d3..62d60a03fde 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -1454,20 +1454,6 @@ GLOBAL_LIST_EMPTY(features_by_species) SEND_SIGNAL(H, COMSIG_MOB_AFTER_APPLY_DAMAGE, damage, damagetype, def_zone, blocked, wound_bonus, bare_wound_bonus, sharpness, attack_direction, attacking_item) return TRUE -/datum/species/proc/on_hit(obj/projectile/P, mob/living/carbon/human/H) - // called when hit by a projectile - switch(P.type) - if(/obj/projectile/energy/floramut) // overwritten by plants/pods - H.show_message(span_notice("The radiation beam dissipates harmlessly through your body.")) - if(/obj/projectile/energy/florayield) - H.show_message(span_notice("The radiation beam dissipates harmlessly through your body.")) - if(/obj/projectile/energy/florarevolution) - H.show_message(span_notice("The radiation beam dissipates harmlessly through your body.")) - -/datum/species/proc/bullet_act(obj/projectile/P, mob/living/carbon/human/H) - // called before a projectile hit - return 0 - ////////////////////////// // ENVIRONMENT HANDLERS // ////////////////////////// diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index db55cd58d48..2b58f9a8206 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -44,59 +44,47 @@ covering_part += C return covering_part -/mob/living/carbon/human/on_hit(obj/projectile/P) - if(dna?.species) - dna.species.on_hit(P, src) - - /mob/living/carbon/human/bullet_act(obj/projectile/P, def_zone, piercing_hit = FALSE) - if(dna?.species) - var/spec_return = dna.species.bullet_act(P, src) - if(spec_return) - return spec_return - //MARTIAL ART STUFF - if(mind) - if(mind.martial_art && mind.martial_art.can_use(src)) //Some martial arts users can deflect projectiles! - var/martial_art_result = mind.martial_art.on_projectile_hit(src, P, def_zone) - if(!(martial_art_result == BULLET_ACT_HIT)) - return martial_art_result - - if(!(P.original == src && P.firer == src)) //can't block or reflect when shooting yourself - if(P.reflectable & REFLECT_NORMAL) - if(check_reflect(def_zone)) // Checks if you've passed a reflection% check - visible_message(span_danger("The [P.name] gets reflected by [src]!"), \ - span_userdanger("The [P.name] gets reflected by [src]!")) - // Finds and plays the block_sound of item which reflected - for(var/obj/item/I in held_items) - if(I.IsReflect(def_zone)) - playsound(src, I.block_sound, BLOCK_SOUND_VOLUME, TRUE) - // Find a turf near or on the original location to bounce to - if(!isturf(loc)) //Open canopy mech (ripley) check. if we're inside something and still got hit - P.force_hit = TRUE //The thing we're in passed the bullet to us. Pass it back, and tell it to take the damage. - loc.bullet_act(P, def_zone, piercing_hit) - return BULLET_ACT_HIT - if(P.starting) - var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) - var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) - var/turf/curloc = get_turf(src) - - // redirect the projectile - P.original = locate(new_x, new_y, P.z) - P.starting = curloc - P.firer = src - P.yo = new_y - curloc.y - P.xo = new_x - curloc.x - var/new_angle_s = P.Angle + rand(120,240) - while(new_angle_s > 180) // Translate to regular projectile degrees - new_angle_s -= 360 - P.set_angle(new_angle_s) - - return BULLET_ACT_FORCE_PIERCE // complete projectile permutation - - if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration, P.damage_type)) - P.on_hit(src, 100, def_zone, piercing_hit) - return BULLET_ACT_HIT + if(P.firer == src && P.original == src) //can't block or reflect when shooting yourself + return ..() + + if(P.reflectable & REFLECT_NORMAL) + if(check_reflect(def_zone)) // Checks if you've passed a reflection% check + visible_message( + span_danger("The [P.name] gets reflected by [src]!"), + span_userdanger("The [P.name] gets reflected by [src]!"), + ) + // Finds and plays the block_sound of item which reflected + for(var/obj/item/I in held_items) + if(I.IsReflect(def_zone)) + playsound(src, I.block_sound, BLOCK_SOUND_VOLUME, TRUE) + // Find a turf near or on the original location to bounce to + if(!isturf(loc)) //Open canopy mech (ripley) check. if we're inside something and still got hit + P.force_hit = TRUE //The thing we're in passed the bullet to us. Pass it back, and tell it to take the damage. + loc.bullet_act(P, def_zone, piercing_hit) + return BULLET_ACT_HIT + if(P.starting) + var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) + var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) + var/turf/curloc = get_turf(src) + + // redirect the projectile + P.original = locate(new_x, new_y, P.z) + P.starting = curloc + P.firer = src + P.yo = new_y - curloc.y + P.xo = new_x - curloc.x + var/new_angle_s = P.Angle + rand(120,240) + while(new_angle_s > 180) // Translate to regular projectile degrees + new_angle_s -= 360 + P.set_angle(new_angle_s) + + return BULLET_ACT_FORCE_PIERCE // complete projectile permutation + + if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration, P.damage_type)) + P.on_hit(src, 100, def_zone, piercing_hit) + return BULLET_ACT_HIT return ..() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 4f56c1403bc..15704d88b7a 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -93,22 +93,44 @@ /mob/living/proc/is_ears_covered() return null -/mob/living/proc/on_hit(obj/projectile/P) - return BULLET_ACT_HIT - -/mob/living/bullet_act(obj/projectile/P, def_zone, piercing_hit = FALSE) +/mob/living/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) . = ..() - if(P.is_hostile_projectile() && (. != BULLET_ACT_BLOCK)) - var/attack_direction = get_dir(P.starting, src) - // we need a second, silent armor check to actually know how much to reduce damage taken, as opposed to - // on [/atom/proc/bullet_act] where it's just to pass it to the projectile's on_hit(). - var/armor_check = check_projectile_armor(def_zone, P, is_silent = TRUE) - armor_check = min(ARMOR_MAX_BLOCK, armor_check) //cap damage reduction at 90% - apply_damage(P.damage, P.damage_type, def_zone, armor_check, wound_bonus=P.wound_bonus, bare_wound_bonus=P.bare_wound_bonus, sharpness = P.sharpness, attack_direction = attack_direction) - apply_effects(P.stun, P.knockdown, P.unconscious, P.slur, P.stutter, P.eyeblur, P.drowsy, armor_check, P.stamina, P.jitter, P.paralyze, P.immobilize) - if(P.dismemberment) - check_projectile_dismemberment(P, def_zone) - return . ? BULLET_ACT_HIT : BULLET_ACT_BLOCK + if(. != BULLET_ACT_HIT) + return . + if(!hitting_projectile.is_hostile_projectile()) + return BULLET_ACT_HIT + + // we need a second, silent armor check to actually know how much to reduce damage taken, as opposed to + // on [/atom/proc/bullet_act] where it's just to pass it to the projectile's on_hit(). + var/armor_check = check_projectile_armor(def_zone, hitting_projectile, is_silent = TRUE) + + apply_damage( + damage = hitting_projectile.damage, + damagetype = hitting_projectile.damage_type, + def_zone = def_zone, + blocked = min(ARMOR_MAX_BLOCK, armor_check), //cap damage reduction at 90% + wound_bonus = hitting_projectile.wound_bonus, + bare_wound_bonus = hitting_projectile.bare_wound_bonus, + sharpness = hitting_projectile.sharpness, + attack_direction = get_dir(hitting_projectile.starting, src), + ) + apply_effects( + stun = hitting_projectile.stun, + knockdown = hitting_projectile.knockdown, + unconscious = hitting_projectile.unconscious, + slur = (mob_biotypes & MOB_ROBOTIC) ? 0 SECONDS : hitting_projectile.slur, // Don't want your cyborgs to slur from being ebow'd + stutter = (mob_biotypes & MOB_ROBOTIC) ? 0 SECONDS : hitting_projectile.stutter, // Don't want your cyborgs to stutter from being tazed + eyeblur = hitting_projectile.eyeblur, + drowsy = hitting_projectile.drowsy, + blocked = armor_check, + stamina = hitting_projectile.stamina, + jitter = (mob_biotypes & MOB_ROBOTIC) ? 0 SECONDS : hitting_projectile.jitter, // Cyborgs can jitter but not from being shot + paralyze = hitting_projectile.paralyze, + immobilize = hitting_projectile.immobilize, + ) + if(hitting_projectile.dismemberment) + check_projectile_dismemberment(hitting_projectile, def_zone) + return BULLET_ACT_HIT /mob/living/check_projectile_armor(def_zone, obj/projectile/impacting_projectile, is_silent) return run_armor_check(def_zone, impacting_projectile.armor_flag, "","",impacting_projectile.armour_penetration, "", is_silent, impacting_projectile.weak_against_armour) diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm index 7445815c9d7..ad9a965242e 100644 --- a/code/modules/mob/living/silicon/ai/ai_defense.dm +++ b/code/modules/mob/living/silicon/ai/ai_defense.dm @@ -54,10 +54,6 @@ return TRUE -/mob/living/silicon/ai/bullet_act(obj/projectile/Proj) - . = ..(Proj) - updatehealth() - /mob/living/silicon/ai/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/flash, length = 25) return // no eyes, no flashing diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index f49fda57449..b9d3304ef8d 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -433,11 +433,15 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real return TRUE -/mob/living/silicon/robot/bullet_act(obj/projectile/Proj, def_zone) +/mob/living/silicon/robot/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) . = ..() - updatehealth() - if(prob(75) && Proj.damage > 0) - spark_system.start() + if(prob(25) || . != BULLET_ACT_HIT) + return + if(hitting_projectile.damage_type != BRUTE && hitting_projectile.damage_type != BURN) + return + if(!hitting_projectile.is_hostile_projectile() || hitting_projectile.damage <= 0) + return + spark_system.start() /mob/living/silicon/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) . = ..() diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm index 847e6867521..86fb4e74910 100644 --- a/code/modules/mob/living/silicon/silicon_defense.dm +++ b/code/modules/mob/living/silicon/silicon_defense.dm @@ -115,21 +115,22 @@ M.visible_message(span_boldwarning("[M] is thrown off of [src]!")) flash_act(affect_silicon = 1) -/mob/living/silicon/bullet_act(obj/projectile/Proj, def_zone, piercing_hit = FALSE) - SEND_SIGNAL(src, COMSIG_ATOM_BULLET_ACT, Proj, def_zone) - if((Proj.damage_type == BRUTE || Proj.damage_type == BURN)) - adjustBruteLoss(Proj.damage) - if(prob(Proj.damage*1.5)) - for(var/mob/living/M in buckled_mobs) - M.visible_message(span_boldwarning("[M] is knocked off of [src]!")) - unbuckle_mob(M) - M.Paralyze(40) - if(Proj.stun || Proj.knockdown || Proj.paralyze) - for(var/mob/living/M in buckled_mobs) - unbuckle_mob(M) - M.visible_message(span_boldwarning("[M] is knocked off of [src] by the [Proj]!")) - Proj.on_hit(src, 0, piercing_hit) - return BULLET_ACT_HIT +/mob/living/silicon/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) + . = ..() + if(. != BULLET_ACT_HIT) + return . + + var/prob_of_knocking_dudes_off = 0 + if(hitting_projectile.damage_type == BRUTE || hitting_projectile.damage_type == BURN) + prob_of_knocking_dudes_off = hitting_projectile.damage * 1.5 + if(hitting_projectile.stun || hitting_projectile.knockdown || hitting_projectile.paralyze) + prob_of_knocking_dudes_off = 100 + + if(prob(prob_of_knocking_dudes_off)) + for(var/mob/living/buckled in buckled_mobs) + buckled.visible_message(span_boldwarning("[buckled] is knocked off of [src] by [hitting_projectile]!")) + unbuckle_mob(buckled) + buckled.Paralyze(4 SECONDS) /mob/living/silicon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/flash/static, length = 25) if(affect_silicon) diff --git a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm index 828be3deebc..f2a2f9fbb65 100644 --- a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm +++ b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm @@ -12,6 +12,9 @@ var/block_chance = 50 +/mob/living/simple_animal/bot/secbot/grievous/Initialize(mapload) + . = ..() + RegisterSignal(src, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(block_bullets)) /mob/living/simple_animal/bot/secbot/grievous/toy //A toy version of general beepsky! name = "Genewul Bweepskee" @@ -21,10 +24,15 @@ baton_type = /obj/item/toy/sword weapon_force = 0 -/mob/living/simple_animal/bot/secbot/grievous/bullet_act(obj/projectile/P) - visible_message(span_warning("[src] deflects [P] with its energy swords!")) - playsound(src, 'sound/weapons/blade1.ogg', 50, TRUE) - return BULLET_ACT_BLOCK +/mob/living/simple_animal/bot/secbot/grievous/proc/block_bullets(datum/source, obj/projectile/hitting_projectile) + SIGNAL_HANDLER + + if(stat != CONSCIOUS) + return NONE + + visible_message(span_warning("[source] deflects [hitting_projectile] with its energy swords!")) + playsound(source, 'sound/weapons/blade1.ogg', 50, TRUE) + return COMPONENT_BULLET_BLOCKED /mob/living/simple_animal/bot/secbot/grievous/on_entered(datum/source, atom/movable/AM) . = ..() diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 0ae9b56d5b4..c369058a2a3 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -502,11 +502,15 @@ return do_sparks(5, TRUE, src) -/mob/living/simple_animal/bot/bullet_act(obj/projectile/Proj, def_zone, piercing_hit = FALSE) - if(Proj && (Proj.damage_type == BRUTE || Proj.damage_type == BURN)) - if(prob(75) && Proj.damage > 0) - do_sparks(5, TRUE, src) - return ..() +/mob/living/simple_animal/bot/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) + . = ..() + if(prob(25) || . != BULLET_ACT_HIT) + return + if(hitting_projectile.damage_type != BRUTE && hitting_projectile.damage_type != BURN) + return + if(!hitting_projectile.is_hostile_projectile() || hitting_projectile.damage <= 0) + return + do_sparks(5, TRUE, src) /mob/living/simple_animal/bot/emp_act(severity) . = ..() diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 04b62db59d3..5b994b1fc0c 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -262,11 +262,14 @@ return TRUE /mob/living/simple_animal/bot/secbot/bullet_act(obj/projectile/Proj) + . = ..() + if(. != BULLET_ACT_HIT) + return + if(istype(Proj, /obj/projectile/beam) || istype(Proj, /obj/projectile/bullet)) if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)) if(Proj.is_hostile_projectile() && Proj.damage < src.health && ishuman(Proj.firer)) retaliate(Proj.firer) - return ..() /mob/living/simple_animal/bot/secbot/UnarmedAttack(atom/attack_target, proximity_flag, list/modifiers) if(!(bot_mode_flags & BOT_MODE_ON)) diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm index aa11bcbd43e..3330b682a01 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm @@ -40,7 +40,7 @@ nondirectional_sprite = TRUE impact_effect_type = /obj/effect/temp_visual/leaper_projectile_impact -/obj/projectile/leaper/on_hit(atom/target, blocked = FALSE) +/obj/projectile/leaper/on_hit(atom/target, blocked = 0, pierce_hit) ..() if (!isliving(target)) return diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 5c63ca4e884..bbaa5356138 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -180,7 +180,6 @@ damage = 25 armour_penetration = 100 speed = 2 - eyeblur = 0 damage_type = BRUTE pass_flags = PASSTABLE plane = GAME_PLANE @@ -191,7 +190,7 @@ direct_target = TRUE return ..(target, direct_target, ignore_loc, cross_failed) -/obj/projectile/colossus/on_hit(atom/target, blocked = FALSE) +/obj/projectile/colossus/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) var/mob/living/dust_mob = target diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm index 8a307cec2bd..a013a48e944 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm @@ -200,7 +200,7 @@ Difficulty: Extremely Hard homing_turn_speed = 3 damage_type = BURN -/obj/projectile/colossus/frost_orb/on_hit(atom/target, blocked = FALSE) +/obj/projectile/colossus/frost_orb/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isturf(target) || isobj(target)) EX_ACT(target, EXPLODE_HEAVY) @@ -226,7 +226,7 @@ Difficulty: Extremely Hard range = 150 damage_type = BRUTE -/obj/projectile/colossus/ice_blast/on_hit(atom/target, blocked = FALSE) +/obj/projectile/colossus/ice_blast/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isturf(target) || isobj(target)) EX_ACT(target, EXPLODE_HEAVY) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm index 56c753c9c8b..eda344ad1da 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm @@ -324,7 +324,6 @@ hitsound = 'sound/magic/magic_missile.ogg' damage = 19 range = 6 - eyeblur = 0 light_color = COLOR_SOFT_RED impact_effect_type = /obj/effect/temp_visual/kinetic_blast tracer_type = /obj/effect/projectile/tracer/legion diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm index aa61c128e3f..9517bce4f92 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm @@ -227,11 +227,10 @@ damage = 20 armour_penetration = 60 speed = 2 - eyeblur = 0 damage_type = BRUTE pass_flags = PASSTABLE -/obj/projectile/herald/on_hit(atom/target, blocked = FALSE) +/obj/projectile/herald/on_hit(atom/target, blocked = 0, pierce_hit) if(ismob(target) && ismob(firer)) var/mob/living/mob_target = target if(mob_target.faction_check_atom(firer)) @@ -247,7 +246,7 @@ damage = 0 color = rgb(255,255,102) -/obj/projectile/herald/teleshot/on_hit(atom/target, blocked = FALSE) +/obj/projectile/herald/teleshot/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(!QDELETED(firer)) firer.forceMove(get_turf(src)) diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index 837457390f8..cdae01abd8c 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -298,15 +298,6 @@ amount = -abs(amount) return ..() //Heals them -/mob/living/simple_animal/slime/bullet_act(obj/projectile/Proj, def_zone, piercing_hit = FALSE) - attacked += 10 - if((Proj.damage_type == BURN)) - adjustBruteLoss(-abs(Proj.damage)) //fire projectiles heals slimes. - Proj.on_hit(src, 0, piercing_hit) - else - . = ..(Proj) - . = . || BULLET_ACT_BLOCK - /mob/living/simple_animal/slime/emp_act(severity) . = ..() if(. & EMP_PROTECT_SELF) diff --git a/code/modules/mod/modules/modules_engineering.dm b/code/modules/mod/modules/modules_engineering.dm index 9c1f5e65d78..9095bbd2c24 100644 --- a/code/modules/mod/modules/modules_engineering.dm +++ b/code/modules/mod/modules/modules_engineering.dm @@ -126,7 +126,7 @@ line = firer.Beam(src, "line", 'icons/obj/clothing/modsuit/mod_modules.dmi', emissive = FALSE) return ..() -/obj/projectile/tether/on_hit(atom/target) +/obj/projectile/tether/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(firer) firer.throw_at(target, 10, 1, firer, FALSE, FALSE, null, MOVE_FORCE_NORMAL, TRUE) diff --git a/code/modules/mod/modules/modules_medical.dm b/code/modules/mod/modules/modules_medical.dm index ca662d01ef2..c1a1cbce403 100644 --- a/code/modules/mod/modules/modules_medical.dm +++ b/code/modules/mod/modules/modules_medical.dm @@ -186,7 +186,7 @@ organ = null return ..() -/obj/projectile/organ/on_hit(atom/target) +/obj/projectile/organ/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(!ishuman(target)) organ.forceMove(drop_location()) diff --git a/code/modules/mod/modules/modules_ninja.dm b/code/modules/mod/modules/modules_ninja.dm index 31db6017609..42722607199 100644 --- a/code/modules/mod/modules/modules_ninja.dm +++ b/code/modules/mod/modules/modules_ninja.dm @@ -374,7 +374,7 @@ line = firer.Beam(src, "net_beam", 'icons/obj/clothing/modsuit/mod_modules.dmi') return ..() -/obj/projectile/energy_net/on_hit(mob/living/target) +/obj/projectile/energy_net/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(!istype(target)) return diff --git a/code/modules/mod/modules/modules_timeline.dm b/code/modules/mod/modules/modules_timeline.dm index f2440ba3833..7adf7b13cd9 100644 --- a/code/modules/mod/modules/modules_timeline.dm +++ b/code/modules/mod/modules/modules_timeline.dm @@ -297,11 +297,14 @@ ///Reference to the tem... given by the tem! weakref because back in the day we didn't know about harddels- or maybe we didn't care. var/datum/weakref/tem_weakref -/obj/projectile/energy/chrono_beam/on_hit(atom/target) +/obj/projectile/energy/chrono_beam/on_hit(atom/target, blocked = 0, pierce_hit) var/obj/item/mod/module/tem/tem = tem_weakref.resolve() if(target && tem && isliving(target)) var/obj/structure/chrono_field/field = new(target.loc, target, tem) tem.field_connect(field) + return BULLET_ACT_HIT + + return ..() /obj/structure/chrono_field name = "eradication field" @@ -403,9 +406,10 @@ var/obj/item/mod/module/tem/linked_tem = beam.tem_weakref.resolve() if(linked_tem && istype(linked_tem)) linked_tem.field_connect(src) - else return BULLET_ACT_HIT + return ..() + /obj/structure/chrono_field/assume_air() return FALSE diff --git a/code/modules/pai/defense.dm b/code/modules/pai/defense.dm index 75c437c2546..61fadf820bf 100644 --- a/code/modules/pai/defense.dm +++ b/code/modules/pai/defense.dm @@ -56,11 +56,11 @@ if(user.put_in_hands(card)) user.visible_message(span_notice("[user] promptly scoops up [user.p_their()] pAI's card.")) -/mob/living/silicon/pai/bullet_act(obj/projectile/Proj) - if(Proj.stun) +/mob/living/silicon/pai/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) + . = ..() + if(. == BULLET_ACT_HIT && (hitting_projectile.stun || hitting_projectile.paralyze)) fold_in(force = TRUE) - src.visible_message(span_warning("The electrically-charged projectile disrupts [src]'s holomatrix, forcing [src] to fold in!")) - . = ..(Proj) + visible_message(span_warning("The electrically-charged projectile disrupts [src]'s holomatrix, forcing [p_them()] to fold in!")) /mob/living/silicon/pai/ignite_mob(silent) return FALSE diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index 9f7432a1475..f664b79825e 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -99,7 +99,7 @@ return ..() -/obj/item/paperplane/throw_at(atom/target, range, speed, mob/thrower, spin=FALSE, diagonals_first = FALSE, datum/callback/callback, quickstart = TRUE) +/obj/item/paperplane/throw_at(atom/target, range, speed, mob/thrower, spin=FALSE, diagonals_first = FALSE, datum/callback/callback, gentle, quickstart = TRUE) . = ..(target, range, speed, thrower, FALSE, diagonals_first, callback, quickstart = quickstart) /obj/item/paperplane/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 8598b3cccf2..3f02447ddbc 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -203,7 +203,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) RegisterSignal(src, COMSIG_ATOM_BSA_BEAM, PROC_REF(force_delam)) RegisterSignal(src, COMSIG_ATOM_TIMESTOP_FREEZE, PROC_REF(time_frozen)) RegisterSignal(src, COMSIG_ATOM_TIMESTOP_UNFREEZE, PROC_REF(time_unfrozen)) - + RegisterSignal(src, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(eat_bullets)) var/static/list/loc_connections = list( COMSIG_TURF_INDUSTRIAL_LIFT_ENTER = PROC_REF(tram_contents_consume), ) diff --git a/code/modules/power/supermatter/supermatter_delamination/cascade_delam_objects.dm b/code/modules/power/supermatter/supermatter_delamination/cascade_delam_objects.dm index 34a7d6f420a..d19d17452e2 100644 --- a/code/modules/power/supermatter/supermatter_delamination/cascade_delam_objects.dm +++ b/code/modules/power/supermatter/supermatter_delamination/cascade_delam_objects.dm @@ -36,6 +36,9 @@ if(our_turf) our_turf.opacity = FALSE + // Ideally this'd be part of the SM component, but the SM itself snowflakes bullets (emitters are bullets). + RegisterSignal(src, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(eat_bullets)) + /obj/crystal_mass/process() if(!COOLDOWN_FINISHED(src, sm_wall_cooldown)) @@ -70,9 +73,18 @@ new /obj/crystal_mass(next_turf, get_dir(next_turf, src)) -/obj/crystal_mass/bullet_act(obj/projectile/projectile) - visible_message(span_notice("[src] is unscathed!")) - return BULLET_ACT_HIT +/obj/crystal_mass/proc/eat_bullets(datum/source, obj/projectile/hitting_projectile) + SIGNAL_HANDLER + + visible_message( + span_warning("[hitting_projectile] flies into [src] with a loud crack, before rapidly flashing into ash."), + null, + span_hear("You hear a loud crack as you are washed with a wave of heat."), + ) + + playsound(src, 'sound/effects/supermatter.ogg', 50, TRUE) + qdel(hitting_projectile) + return COMPONENT_BULLET_BLOCKED /obj/crystal_mass/singularity_act() return @@ -166,4 +178,3 @@ span_hear("You hear a loud crack as a small distortion passes through you.")) qdel(consumed_object) - diff --git a/code/modules/power/supermatter/supermatter_hit_procs.dm b/code/modules/power/supermatter/supermatter_hit_procs.dm index 452b37e0541..9d5b0d1067b 100644 --- a/code/modules/power/supermatter/supermatter_hit_procs.dm +++ b/code/modules/power/supermatter/supermatter_hit_procs.dm @@ -5,16 +5,20 @@ for(var/atom/thing_to_consume as anything in tram_contents) Bumped(thing_to_consume) -/obj/machinery/power/supermatter_crystal/bullet_act(obj/projectile/projectile) +/obj/machinery/power/supermatter_crystal/proc/eat_bullets(datum/source, obj/projectile/projectile) + SIGNAL_HANDLER + var/turf/local_turf = loc + if(!istype(local_turf)) + return NONE + var/kiss_power = 0 switch(projectile.type) if(/obj/projectile/kiss) kiss_power = 60 if(/obj/projectile/kiss/death) kiss_power = 20000 - if(!istype(local_turf)) - return FALSE + if(!istype(projectile.firer, /obj/machinery/power/emitter)) investigate_log("has been hit by [projectile] fired by [key_name(projectile.firer)]", INVESTIGATE_ENGINE) if(projectile.armor_flag != BULLET || kiss_power) @@ -29,7 +33,10 @@ var/damage_to_be = damage + external_damage_immediate * clamp((emergency_point - damage) / emergency_point, 0, 1) if(damage_to_be > danger_point) visible_message(span_notice("[src] compresses under stress, resisting further impacts!")) - return BULLET_ACT_HIT + + playsound(src, 'sound/effects/supermatter.ogg', 50, TRUE) + qdel(projectile) + return COMPONENT_BULLET_BLOCKED /obj/machinery/power/supermatter_crystal/singularity_act() var/gain = 100 diff --git a/code/modules/projectiles/ammunition/energy/special.dm b/code/modules/projectiles/ammunition/energy/special.dm index f2fc274ee8a..b4c29137a9f 100644 --- a/code/modules/projectiles/ammunition/energy/special.dm +++ b/code/modules/projectiles/ammunition/energy/special.dm @@ -20,15 +20,15 @@ harmful = FALSE /obj/item/ammo_casing/energy/flora/yield - projectile_type = /obj/projectile/energy/florayield + projectile_type = /obj/projectile/energy/flora/yield select_name = "yield" /obj/item/ammo_casing/energy/flora/mut - projectile_type = /obj/projectile/energy/floramut + projectile_type = /obj/projectile/energy/flora/mut select_name = "mutation" /obj/item/ammo_casing/energy/flora/revolution - projectile_type = /obj/projectile/energy/florarevolution + projectile_type = /obj/projectile/energy/flora/evolution select_name = "revolution" e_cost = LASER_SHOTS(4, STANDARD_CELL_CHARGE) diff --git a/code/modules/projectiles/guns/energy/beam_rifle.dm b/code/modules/projectiles/guns/energy/beam_rifle.dm index a451b14de9a..1c5b025baea 100644 --- a/code/modules/projectiles/guns/energy/beam_rifle.dm +++ b/code/modules/projectiles/guns/energy/beam_rifle.dm @@ -520,8 +520,8 @@ if(!QDELETED(target)) handle_impact(target) -/obj/projectile/beam/beam_rifle/on_hit(atom/target, blocked = FALSE, piercing_hit = FALSE) - handle_hit(target, piercing_hit) +/obj/projectile/beam/beam_rifle/on_hit(atom/target, blocked = 0, pierce_hit) + handle_hit(target, pierce_hit) return ..() /obj/projectile/beam/beam_rifle/is_hostile_projectile() @@ -567,7 +567,8 @@ /obj/projectile/beam/beam_rifle/hitscan/aiming_beam/prehit_pierce(atom/target) return PROJECTILE_DELETE_WITHOUT_HITTING -/obj/projectile/beam/beam_rifle/hitscan/aiming_beam/on_hit() +/obj/projectile/beam/beam_rifle/hitscan/aiming_beam/on_hit(atom/target, blocked = 0, pierce_hit) + SHOULD_CALL_PARENT(FALSE) // This is some snowflake stuff so whatever qdel(src) return BULLET_ACT_BLOCK diff --git a/code/modules/projectiles/guns/energy/dueling.dm b/code/modules/projectiles/guns/energy/dueling.dm index 7b3929d7574..932117abb5b 100644 --- a/code/modules/projectiles/guns/energy/dueling.dm +++ b/code/modules/projectiles/guns/energy/dueling.dm @@ -327,7 +327,7 @@ if(DUEL_SETTING_C) color = "blue" -/obj/projectile/energy/duel/on_hit(atom/target, blocked) +/obj/projectile/energy/duel/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() var/turf/T = get_turf(target) var/obj/effect/temp_visual/dueling_chaff/C = locate() in T diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 444b18ad274..c643092f8b8 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -209,7 +209,7 @@ strike_thing() ..() -/obj/projectile/kinetic/on_hit(atom/target) +/obj/projectile/kinetic/on_hit(atom/target, blocked = 0, pierce_hit) strike_thing(target) . = ..() @@ -616,4 +616,3 @@ var/new_color = input(user,"","Choose Color",bolt_color) as color|null bolt_color = new_color || bolt_color - diff --git a/code/modules/projectiles/guns/special/hand_of_midas.dm b/code/modules/projectiles/guns/special/hand_of_midas.dm index 9907352e3f5..69d3430cf9e 100644 --- a/code/modules/projectiles/guns/special/hand_of_midas.dm +++ b/code/modules/projectiles/guns/special/hand_of_midas.dm @@ -111,7 +111,7 @@ ..() // Gives human targets Midas Blight. -/obj/projectile/magic/midas_round/on_hit(atom/target) +/obj/projectile/magic/midas_round/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(ishuman(target)) var/mob/living/carbon/human/my_guy = target diff --git a/code/modules/projectiles/guns/special/meat_hook.dm b/code/modules/projectiles/guns/special/meat_hook.dm index 8adabdfce84..7438b22a5a9 100644 --- a/code/modules/projectiles/guns/special/meat_hook.dm +++ b/code/modules/projectiles/guns/special/meat_hook.dm @@ -51,7 +51,7 @@ ..() //TODO: root the firer until the chain returns -/obj/projectile/hook/on_hit(atom/target) +/obj/projectile/hook/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(ismovable(target)) var/atom/movable/A = target diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 7eb152d3e4a..5b84194f49e 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -158,13 +158,15 @@ var/decayedRange //stores original range var/reflect_range_decrease = 5 //amount of original range that falls off when reflecting, so it doesn't go forever var/reflectable = NONE // Can it be reflected or not? + // Status effects applied on hit - var/stun = 0 - var/knockdown = 0 - var/paralyze = 0 - var/immobilize = 0 - var/unconscious = 0 - var/eyeblur = 0 + var/stun = 0 SECONDS + var/knockdown = 0 SECONDS + var/paralyze = 0 SECONDS + var/immobilize = 0 SECONDS + var/unconscious = 0 SECONDS + /// Seconds of blurry eyes applied on projectile hit + var/eyeblur = 0 SECONDS /// Drowsiness applied on projectile hit var/drowsy = 0 SECONDS /// Jittering applied on projectile hit @@ -245,12 +247,22 @@ /** * Called when the projectile hits something * - * @params - * target - thing hit - * blocked - percentage of hit blocked - * pierce_hit - are we piercing through or regular hitting + * By default parent call will always return [BULLET_ACT_HIT] (unless qdeleted) + * so it is save to assume a successful hit in children (though not necessarily successfully damaged - it could've been blocked) + * + * Arguments + * * target - thing hit + * * blocked - percentage of hit blocked (0 to 100) + * * pierce_hit - boolean, are we piercing through or regular hitting + * + * Returns + * * Returns [BULLET_ACT_HIT] if we hit something. Default return value. + * * Returns [BULLET_ACT_BLOCK] if we were hit but sustained no effects (blocked it). Note, Being "blocked" =/= "blocked is 100". + * * Returns [BULLET_ACT_FORCE_PIERCE] to have the projectile keep going instead of "hitting", as if we were not hit at all. */ -/obj/projectile/proc/on_hit(atom/target, blocked = FALSE, pierce_hit) +/obj/projectile/proc/on_hit(atom/target, blocked = 0, pierce_hit) + SHOULD_CALL_PARENT(TRUE) + // i know that this is probably more with wands and gun mods in mind, but it's a bit silly that the projectile on_hit signal doesn't ping the projectile itself. // maybe we care what the projectile thinks! See about combining these via args some time when it's not 5AM var/hit_limb_zone @@ -262,7 +274,7 @@ SEND_SIGNAL(src, COMSIG_PROJECTILE_SELF_ON_HIT, firer, target, Angle, hit_limb_zone) if(QDELETED(src)) // in case one of the above signals deleted the projectile for whatever reason - return + return BULLET_ACT_BLOCK var/turf/target_turf = get_turf(target) var/hitx @@ -349,7 +361,6 @@ span_userdanger("You're hit by \a [src][organ_hit_text]!"), null, COMBAT_MESSAGE_RANGE) if(living_target.is_blind()) to_chat(living_target, span_userdanger("You feel something hit you[organ_hit_text]!")) - living_target.on_hit(src) var/reagent_note if(reagents?.reagent_list) diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index a7a5f83329a..0d16501d7eb 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -7,7 +7,7 @@ hitsound = 'sound/weapons/sear.ogg' hitsound_wall = 'sound/weapons/effects/searwall.ogg' armor_flag = LASER - eyeblur = 2 + eyeblur = 4 SECONDS impact_effect_type = /obj/effect/temp_visual/impact_effect/red_laser light_system = MOVABLE_LIGHT light_range = 1 @@ -57,7 +57,7 @@ muzzle_type = /obj/effect/projectile/muzzle/heavy_laser impact_type = /obj/effect/projectile/impact/heavy_laser -/obj/projectile/beam/laser/on_hit(atom/target, blocked = FALSE) +/obj/projectile/beam/laser/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(iscarbon(target)) var/mob/living/carbon/M = target @@ -116,7 +116,6 @@ damage_type = STAMINA armor_flag = ENERGY hitsound = 'sound/weapons/sear_disabler.ogg' - eyeblur = 0 impact_effect_type = /obj/effect/temp_visual/impact_effect/blue_laser light_color = LIGHT_COLOR_BLUE tracer_type = /obj/effect/projectile/tracer/disabler @@ -146,7 +145,7 @@ impact_type = /obj/effect/projectile/impact/pulse wound_bonus = 10 -/obj/projectile/beam/pulse/on_hit(atom/target, blocked = FALSE) +/obj/projectile/beam/pulse/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if (!QDELETED(target) && (isturf(target) || isstructure(target))) if(isobj(target)) @@ -163,7 +162,7 @@ projectile_piercing = ALL var/pierce_hits = 2 -/obj/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = FALSE) +/obj/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = 0, pierce_hit) if(pierce_hits <= 0) projectile_piercing = NONE pierce_hits -= 1 @@ -207,7 +206,7 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect/blue_laser light_color = LIGHT_COLOR_BLUE -/obj/projectile/beam/lasertag/on_hit(atom/target, blocked = FALSE) +/obj/projectile/beam/lasertag/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(ishuman(target)) var/mob/living/carbon/human/M = target @@ -249,7 +248,7 @@ light_color = LIGHT_COLOR_BLUE var/shrink_time = 90 -/obj/projectile/beam/shrink/on_hit(atom/target, blocked = FALSE) +/obj/projectile/beam/shrink/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isopenturf(target) || isindestructiblewall(target))//shrunk floors wouldnt do anything except look weird, i-walls shouldn't be bypassable return diff --git a/code/modules/projectiles/projectile/bullets/_incendiary.dm b/code/modules/projectiles/projectile/bullets/_incendiary.dm index 6808f7c48fd..85c2dce80c5 100644 --- a/code/modules/projectiles/projectile/bullets/_incendiary.dm +++ b/code/modules/projectiles/projectile/bullets/_incendiary.dm @@ -5,7 +5,7 @@ /// If TRUE, leaves a trail of hotspots as it flies, very very chaotic var/leaves_fire_trail = TRUE -/obj/projectile/bullet/incendiary/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/incendiary/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(iscarbon(target)) var/mob/living/carbon/M = target @@ -41,7 +41,7 @@ wound_falloff_tile = -4 fire_stacks = 3 -/obj/projectile/bullet/incendiary/fire/on_hit(atom/target, blocked) +/obj/projectile/bullet/incendiary/fire/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() var/turf/location = get_turf(target) if(isopenturf(location)) diff --git a/code/modules/projectiles/projectile/bullets/cannonball.dm b/code/modules/projectiles/projectile/bullets/cannonball.dm index 11ffa603cbf..2f57a3dcc99 100644 --- a/code/modules/projectiles/projectile/bullets/cannonball.dm +++ b/code/modules/projectiles/projectile/bullets/cannonball.dm @@ -22,7 +22,7 @@ /// How much our object damage decreases on hit, similar to normal damage. var/object_damage_decrease_on_hit = 0 -/obj/projectile/bullet/cannonball/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/cannonball/on_hit(atom/target, blocked = 0, pierce_hit) damage -= damage_decrease_on_hit if(object_damage_decreases) object_damage -= min(damage, object_damage_decrease_on_hit) @@ -46,7 +46,7 @@ projectile_piercing = NONE damage = 40 //set to 30 before first mob impact, but they're gonna be gibbed by the explosion -/obj/projectile/bullet/cannonball/explosive/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/cannonball/explosive/on_hit(atom/target, blocked = 0, pierce_hit) explosion(target, devastation_range = 2, heavy_impact_range = 3, light_impact_range = 4, explosion_cause = src) . = ..() @@ -56,7 +56,7 @@ projectile_piercing = NONE damage = 15 //very low -/obj/projectile/bullet/cannonball/emp/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/cannonball/emp/on_hit(atom/target, blocked = 0, pierce_hit) empulse(src, 4, 10) . = ..() @@ -65,7 +65,7 @@ icon_state = "biggest_one" damage = 70 //low pierce -/obj/projectile/bullet/cannonball/biggest_one/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/cannonball/biggest_one/on_hit(atom/target, blocked = 0, pierce_hit) if(projectile_piercing == NONE) explosion(target, devastation_range = GLOB.MAX_EX_DEVESTATION_RANGE, heavy_impact_range = GLOB.MAX_EX_HEAVY_RANGE, light_impact_range = GLOB.MAX_EX_LIGHT_RANGE, flash_range = GLOB.MAX_EX_FLASH_RANGE, explosion_cause = src) . = ..() diff --git a/code/modules/projectiles/projectile/bullets/dart_syringe.dm b/code/modules/projectiles/projectile/bullets/dart_syringe.dm index 1f853127858..405552a8909 100644 --- a/code/modules/projectiles/projectile/bullets/dart_syringe.dm +++ b/code/modules/projectiles/projectile/bullets/dart_syringe.dm @@ -10,7 +10,7 @@ . = ..() create_reagents(50, NO_REACT) -/obj/projectile/bullet/dart/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/dart/on_hit(atom/target, blocked = 0, pierce_hit) if(iscarbon(target)) var/mob/living/carbon/M = target if(blocked != 100) // not completely blocked diff --git a/code/modules/projectiles/projectile/bullets/dnainjector.dm b/code/modules/projectiles/projectile/bullets/dnainjector.dm index 139f20c339c..fdb051e7f80 100644 --- a/code/modules/projectiles/projectile/bullets/dnainjector.dm +++ b/code/modules/projectiles/projectile/bullets/dnainjector.dm @@ -7,7 +7,7 @@ embedding = null shrapnel_type = null -/obj/projectile/bullet/dnainjector/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/dnainjector/on_hit(atom/target, blocked = 0, pierce_hit) if(iscarbon(target)) var/mob/living/carbon/M = target if(blocked != 100) diff --git a/code/modules/projectiles/projectile/bullets/grenade.dm b/code/modules/projectiles/projectile/bullets/grenade.dm index b1d7278228f..a99a7b57ff3 100644 --- a/code/modules/projectiles/projectile/bullets/grenade.dm +++ b/code/modules/projectiles/projectile/bullets/grenade.dm @@ -8,7 +8,7 @@ embedding = null shrapnel_type = null -/obj/projectile/bullet/a40mm/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/a40mm/on_hit(atom/target, blocked = 0, pierce_hit) ..() explosion(target, devastation_range = -1, light_impact_range = 2, flame_range = 3, flash_range = 1, adminlog = FALSE, explosion_cause = src) return BULLET_ACT_HIT diff --git a/code/modules/projectiles/projectile/bullets/revolver.dm b/code/modules/projectiles/projectile/bullets/revolver.dm index b5411c937be..417f61534bc 100644 --- a/code/modules/projectiles/projectile/bullets/revolver.dm +++ b/code/modules/projectiles/projectile/bullets/revolver.dm @@ -65,7 +65,7 @@ damage = 10 ricochets_max = 0 -/obj/projectile/bullet/c38/trac/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/c38/trac/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() var/mob/living/carbon/M = target if(!istype(M)) @@ -83,7 +83,7 @@ damage = 20 ricochets_max = 0 -/obj/projectile/bullet/c38/hotshot/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/c38/hotshot/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(iscarbon(target)) var/mob/living/carbon/M = target @@ -96,7 +96,7 @@ var/temperature = 100 ricochets_max = 0 -/obj/projectile/bullet/c38/iceblox/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/c38/iceblox/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) var/mob/living/M = target diff --git a/code/modules/projectiles/projectile/bullets/shotgun.dm b/code/modules/projectiles/projectile/bullets/shotgun.dm index 639939e150f..13b6a6f9665 100644 --- a/code/modules/projectiles/projectile/bullets/shotgun.dm +++ b/code/modules/projectiles/projectile/bullets/shotgun.dm @@ -63,7 +63,7 @@ damage = 15 paralyze = 10 -/obj/projectile/bullet/shotgun_frag12/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/shotgun_frag12/on_hit(atom/target, blocked = 0, pierce_hit) ..() explosion(target, devastation_range = -1, light_impact_range = 1, explosion_cause = src) return BULLET_ACT_HIT diff --git a/code/modules/projectiles/projectile/bullets/sniper.dm b/code/modules/projectiles/projectile/bullets/sniper.dm index bc4f69eb946..4425b20eeed 100644 --- a/code/modules/projectiles/projectile/bullets/sniper.dm +++ b/code/modules/projectiles/projectile/bullets/sniper.dm @@ -14,7 +14,7 @@ ///Determines how much additional damage the round does to mechs. var/mecha_damage = 10 -/obj/projectile/bullet/p50/on_hit(atom/target, blocked = 0) +/obj/projectile/bullet/p50/on_hit(atom/target, blocked = 0, pierce_hit) if(isobj(target) && (blocked != 100)) var/obj/thing_to_break = target var/damage_to_deal = object_damage @@ -41,7 +41,7 @@ mecha_damage = 100 var/emp_radius = 2 -/obj/projectile/bullet/p50/disruptor/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/p50/disruptor/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if((blocked != 100) && isliving(target)) var/mob/living/living_guy = target @@ -60,7 +60,7 @@ object_damage = 30 mecha_damage = 0 -/obj/projectile/bullet/p50/incendiary/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/p50/incendiary/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(iscarbon(target)) var/mob/living/carbon/poor_burning_dork = target diff --git a/code/modules/projectiles/projectile/bullets/special.dm b/code/modules/projectiles/projectile/bullets/special.dm index c424f2cd6be..f595c3e1165 100644 --- a/code/modules/projectiles/projectile/bullets/special.dm +++ b/code/modules/projectiles/projectile/bullets/special.dm @@ -16,7 +16,7 @@ . = ..() SpinAnimation() -/obj/projectile/bullet/honker/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/honker/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() var/mob/M = target if(istype(M)) @@ -30,7 +30,7 @@ /obj/projectile/bullet/mime damage = 40 -/obj/projectile/bullet/mime/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/mime/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(!isliving(target)) return diff --git a/code/modules/projectiles/projectile/energy/ebow.dm b/code/modules/projectiles/projectile/energy/ebow.dm index 73faaffc22f..e1da23495f4 100644 --- a/code/modules/projectiles/projectile/energy/ebow.dm +++ b/code/modules/projectiles/projectile/energy/ebow.dm @@ -4,7 +4,7 @@ damage = 15 damage_type = TOX stamina = 60 - eyeblur = 10 + eyeblur = 20 SECONDS knockdown = 10 slur = 10 SECONDS diff --git a/code/modules/projectiles/projectile/energy/net_snare.dm b/code/modules/projectiles/projectile/energy/net_snare.dm index 440ab9438e2..c60c0c35d17 100644 --- a/code/modules/projectiles/projectile/energy/net_snare.dm +++ b/code/modules/projectiles/projectile/energy/net_snare.dm @@ -10,7 +10,7 @@ . = ..() SpinAnimation() -/obj/projectile/energy/net/on_hit(atom/target, blocked = FALSE) +/obj/projectile/energy/net/on_hit(atom/target, blocked = 0, pierce_hit) if(isliving(target)) var/turf/Tloc = get_turf(target) if(!locate(/obj/effect/nettingportal) in Tloc) @@ -64,7 +64,7 @@ hitsound = 'sound/weapons/taserhit.ogg' range = 4 -/obj/projectile/energy/trap/on_hit(atom/target, blocked = FALSE) +/obj/projectile/energy/trap/on_hit(atom/target, blocked = 0, pierce_hit) if(!ismob(target) || blocked >= 100) //Fully blocked by mob or collided with dense object - drop a trap new/obj/item/restraints/legcuffs/beartrap/energy(get_turf(loc)) else if(iscarbon(target)) @@ -82,7 +82,7 @@ hitsound = 'sound/weapons/taserhit.ogg' range = 10 -/obj/projectile/energy/trap/cyborg/on_hit(atom/target, blocked = FALSE) +/obj/projectile/energy/trap/cyborg/on_hit(atom/target, blocked = 0, pierce_hit) if(!ismob(target) || blocked >= 100) do_sparks(1, TRUE, src) qdel(src) diff --git a/code/modules/projectiles/projectile/energy/stun.dm b/code/modules/projectiles/projectile/energy/stun.dm index 9dadbd385be..67cbd4352ee 100644 --- a/code/modules/projectiles/projectile/energy/stun.dm +++ b/code/modules/projectiles/projectile/energy/stun.dm @@ -12,7 +12,7 @@ muzzle_type = /obj/effect/projectile/muzzle/stun impact_type = /obj/effect/projectile/impact/stun -/obj/projectile/energy/electrode/on_hit(atom/target, blocked = FALSE) +/obj/projectile/energy/electrode/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(!ismob(target) || blocked >= 100) //Fully blocked by mob or collided with dense object - burst into sparks! do_sparks(1, TRUE, src) diff --git a/code/modules/projectiles/projectile/energy/tesla.dm b/code/modules/projectiles/projectile/energy/tesla.dm index 687bd1b8e73..65b9ba0162e 100644 --- a/code/modules/projectiles/projectile/energy/tesla.dm +++ b/code/modules/projectiles/projectile/energy/tesla.dm @@ -7,7 +7,7 @@ var/zap_range = 3 var/power = 4e6 -/obj/projectile/energy/tesla/on_hit(atom/target) +/obj/projectile/energy/tesla/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() tesla_zap(src, zap_range, power, zap_flags) qdel(src) @@ -32,7 +32,7 @@ speed = 1.5 var/shock_damage = 5 -/obj/projectile/energy/tesla_cannon/on_hit(atom/target) +/obj/projectile/energy/tesla_cannon/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) var/mob/living/victim = target diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index c8da91b9dde..7b2d546b668 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -31,7 +31,7 @@ name = "bolt of death" icon_state = "pulse1_bl" -/obj/projectile/magic/death/on_hit(atom/target) +/obj/projectile/magic/death/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) @@ -57,7 +57,7 @@ name = "bolt of resurrection" icon_state = "ion" -/obj/projectile/magic/resurrection/on_hit(atom/target) +/obj/projectile/magic/resurrection/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) @@ -85,7 +85,7 @@ var/inner_tele_radius = 0 var/outer_tele_radius = 6 -/obj/projectile/magic/teleport/on_hit(mob/target) +/obj/projectile/magic/teleport/on_hit(mob/target, blocked = 0, pierce_hit) . = ..() var/teleammount = 0 var/teleloc = target @@ -104,7 +104,7 @@ name = "bolt of safety" icon_state = "bluespace" -/obj/projectile/magic/safety/on_hit(atom/target) +/obj/projectile/magic/safety/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isturf(target)) return BULLET_ACT_HIT @@ -123,7 +123,7 @@ icon_state = "energy" var/list/door_types = list(/obj/structure/mineral_door/wood, /obj/structure/mineral_door/iron, /obj/structure/mineral_door/silver, /obj/structure/mineral_door/gold, /obj/structure/mineral_door/uranium, /obj/structure/mineral_door/sandstone, /obj/structure/mineral_door/transparent/plasma, /obj/structure/mineral_door/transparent/diamond) -/obj/projectile/magic/door/on_hit(atom/target) +/obj/projectile/magic/door/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(istype(target, /obj/machinery/door)) OpenDoor(target) @@ -153,7 +153,7 @@ /// If set, this projectile will only pass certain changeflags to wabbajack var/set_wabbajack_changeflags -/obj/projectile/magic/change/on_hit(atom/target) +/obj/projectile/magic/change/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) @@ -171,7 +171,7 @@ icon_state = "red_1" damage_type = BURN -/obj/projectile/magic/animate/on_hit(atom/target, blocked = FALSE) +/obj/projectile/magic/animate/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() target.animate_atom_living(firer) @@ -251,7 +251,7 @@ target.forceMove(src) return PROJECTILE_PIERCE_PHASE -/obj/projectile/magic/locker/on_hit(target) +/obj/projectile/magic/locker/on_hit(atom/target, blocked = 0, pierce_hit) if(created) return ..() if(LAZYLEN(contents)) @@ -313,7 +313,7 @@ name = "bolt of flying" icon_state = "flight" -/obj/projectile/magic/flying/on_hit(mob/living/target) +/obj/projectile/magic/flying/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) var/atom/throw_target = get_edge_target_turf(target, angle2dir(Angle)) @@ -323,7 +323,7 @@ name = "bolt of bounty" icon_state = "bounty" -/obj/projectile/magic/bounty/on_hit(mob/living/target) +/obj/projectile/magic/bounty/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) target.apply_status_effect(/datum/status_effect/bounty, firer) @@ -332,16 +332,16 @@ name = "bolt of antimagic" icon_state = "antimagic" -/obj/projectile/magic/antimagic/on_hit(mob/living/target) +/obj/projectile/magic/antimagic/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() - if(isliving(target)) + if(istype(target)) target.apply_status_effect(/datum/status_effect/song/antimagic) /obj/projectile/magic/fetch name = "bolt of fetching" icon_state = "fetch" -/obj/projectile/magic/fetch/on_hit(mob/living/target) +/obj/projectile/magic/fetch/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) var/atom/throw_target = get_edge_target_turf(target, get_dir(target, firer)) @@ -351,7 +351,7 @@ name = "bolt of babel" icon_state = "babel" -/obj/projectile/magic/babel/on_hit(mob/living/carbon/target) +/obj/projectile/magic/babel/on_hit(mob/living/carbon/target, blocked = 0, pierce_hit) . = ..() if(iscarbon(target)) if(curse_of_babel(target)) @@ -361,7 +361,7 @@ name = "bolt of necropotence" icon_state = "necropotence" -/obj/projectile/magic/necropotence/on_hit(mob/living/target) +/obj/projectile/magic/necropotence/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(!isliving(target)) return @@ -378,7 +378,7 @@ name = "bolt of possession" icon_state = "wipe" -/obj/projectile/magic/wipe/on_hit(mob/living/carbon/target) +/obj/projectile/magic/wipe/on_hit(mob/living/carbon/target, blocked = 0, pierce_hit) . = ..() if(iscarbon(target)) for(var/x in target.get_traumas())//checks to see if the victim is already going through possession @@ -494,7 +494,7 @@ chain = firer.Beam(src, icon_state = "lightning[rand(1, 12)]") return ..() -/obj/projectile/magic/aoe/lightning/on_hit(target) +/obj/projectile/magic/aoe/lightning/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() tesla_zap(src, zap_range, zap_power, zap_flags) @@ -522,7 +522,7 @@ /// Flash radius of the fireball var/exp_flash = 3 -/obj/projectile/magic/fireball/on_hit(atom/target, blocked = FALSE, pierce_hit) +/obj/projectile/magic/fireball/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) var/mob/living/mob_target = target @@ -577,7 +577,7 @@ speed = 1 pixel_speed_multiplier = 1/7 -/obj/projectile/magic/aoe/juggernaut/on_hit(atom/target, blocked) +/obj/projectile/magic/aoe/juggernaut/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() var/turf/target_turf = get_turf(src) playsound(target_turf, 'sound/weapons/resonator_blast.ogg', 100, FALSE) diff --git a/code/modules/projectiles/projectile/special/floral.dm b/code/modules/projectiles/projectile/special/floral.dm index 0fef1ef7443..608679bf6da 100644 --- a/code/modules/projectiles/projectile/special/floral.dm +++ b/code/modules/projectiles/projectile/special/floral.dm @@ -1,59 +1,67 @@ -/obj/projectile/energy/floramut - name = "alpha somatoray" - icon_state = "energy" +/obj/projectile/energy/flora damage = 0 damage_type = TOX armor_flag = ENERGY -/obj/projectile/energy/floramut/on_hit(atom/target, blocked = FALSE) +/obj/projectile/energy/flora/on_hit(atom/target, blocked, pierce_hit) + if(!isliving(target)) + return ..() + + var/mob/living/hit_plant = target + if(!(hit_plant.mob_biotypes & MOB_PLANT)) + hit_plant.show_message(span_notice("The radiation beam dissipates harmlessly through your body.")) + return BULLET_ACT_BLOCK + . = ..() - if(isliving(target)) - var/mob/living/L = target - if(L.mob_biotypes & MOB_PLANT) - if(prob(15)) - L.adjustToxLoss(rand(3, 6)) - L.Paralyze(100) - L.visible_message(span_warning("[L] writhes in pain as [L.p_their()] vacuoles boil."), span_userdanger("You writhe in pain as your vacuoles boil!"), span_hear("You hear the crunching of leaves.")) - if(iscarbon(L) && L.has_dna()) - var/mob/living/carbon/C = L - if(prob(80)) - C.easy_random_mutate(NEGATIVE + MINOR_NEGATIVE) - else - C.easy_random_mutate(POSITIVE) - C.random_mutate_unique_identity() - C.random_mutate_unique_features() - C.domutcheck() - else - L.adjustFireLoss(rand(5, 15)) - L.show_message(span_userdanger("The radiation beam singes you!")) - -/obj/projectile/energy/florayield + if(. == BULLET_ACT_HIT && blocked < 100) + on_hit_plant_effect(target) + + return . + +/// Called when we hit a mob with plant biotype +/obj/projectile/energy/flora/proc/on_hit_plant_effect(mob/living/hit_plant) + return + +/obj/projectile/energy/flora/mut + name = "alpha somatoray" + icon_state = "energy" + +/obj/projectile/energy/flora/mut/on_hit_plant_effect(mob/living/hit_plant) + if(prob(85)) + hit_plant.adjustFireLoss(rand(5, 15)) + hit_plant.show_message(span_userdanger("The radiation beam singes you!")) + return + + hit_plant.adjustToxLoss(rand(3, 6)) + hit_plant.Paralyze(10 SECONDS) + hit_plant.visible_message( + span_warning("[hit_plant] writhes in pain as [hit_plant.p_their()] vacuoles boil."), + span_userdanger("You writhe in pain as your vacuoles boil!"), + span_hear("You hear the crunching of leaves."), + ) + if(iscarbon(hit_plant) && hit_plant.has_dna()) + var/mob/living/carbon/carbon_plant = hit_plant + if(prob(80)) + carbon_plant.easy_random_mutate(NEGATIVE + MINOR_NEGATIVE) + else + carbon_plant.easy_random_mutate(POSITIVE) + carbon_plant.random_mutate_unique_identity() + carbon_plant.random_mutate_unique_features() + carbon_plant.domutcheck() + +/obj/projectile/energy/flora/yield name = "beta somatoray" icon_state = "energy2" - damage = 0 - damage_type = TOX - armor_flag = ENERGY -/obj/projectile/energy/florayield/on_hit(atom/target, blocked = FALSE) - . = ..() - if(isliving(target)) - var/mob/living/L = target - if(L.mob_biotypes & MOB_PLANT) - L.set_nutrition(min(L.nutrition + 30, NUTRITION_LEVEL_FULL)) +/obj/projectile/energy/flora/yield/on_hit_plant_effect(mob/living/hit_plant) + hit_plant.set_nutrition(min(hit_plant.nutrition + 30, NUTRITION_LEVEL_FULL)) -/obj/projectile/energy/florarevolution +/obj/projectile/energy/flora/evolution name = "gamma somatoray" icon_state = "energy3" - damage = 0 - damage_type = TOX - armor_flag = ENERGY -/obj/projectile/energy/florarevolution/on_hit(atom/target, blocked = FALSE) - . = ..() - if(isliving(target)) - var/mob/living/L = target - if(L.mob_biotypes & MOB_PLANT) - L.show_message(span_notice("The radiation beam leaves you feeling disoriented!")) - L.set_dizzy_if_lower(30 SECONDS) - L.emote("flip") - L.emote("spin") +/obj/projectile/energy/flora/evolution/on_hit_plant_effect(mob/living/hit_plant) + hit_plant.show_message(span_notice("The radiation beam leaves you feeling disoriented!")) + hit_plant.set_dizzy_if_lower(30 SECONDS) + hit_plant.emote("flip") + hit_plant.emote("spin") diff --git a/code/modules/projectiles/projectile/special/gravity.dm b/code/modules/projectiles/projectile/special/gravity.dm index 2a0df1b510b..1a23b653a05 100644 --- a/code/modules/projectiles/projectile/special/gravity.dm +++ b/code/modules/projectiles/projectile/special/gravity.dm @@ -16,7 +16,7 @@ if(istype(C)) //Hard-coded maximum power so servers can't be crashed by trying to throw the entire Z level's items power = min(C.gun?.power, 15) -/obj/projectile/gravityrepulse/on_hit() +/obj/projectile/gravityrepulse/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() T = get_turf(src) for(var/atom/movable/A in range(T, power)) @@ -50,7 +50,7 @@ if(istype(C)) //Hard-coded maximum power so servers can't be crashed by trying to throw the entire Z level's items power = min(C.gun?.power, 15) -/obj/projectile/gravityattract/on_hit() +/obj/projectile/gravityattract/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() T = get_turf(src) for(var/atom/movable/A in range(T, power)) @@ -83,7 +83,7 @@ if(istype(C)) //Hard-coded maximum power so servers can't be crashed by trying to throw the entire Z level's items power = min(C.gun?.power, 15) -/obj/projectile/gravitychaos/on_hit() +/obj/projectile/gravitychaos/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() T = get_turf(src) for(var/atom/movable/A in range(T, power)) diff --git a/code/modules/projectiles/projectile/special/ion.dm b/code/modules/projectiles/projectile/special/ion.dm index 6dc0246d35b..9d25f1504cd 100644 --- a/code/modules/projectiles/projectile/special/ion.dm +++ b/code/modules/projectiles/projectile/special/ion.dm @@ -7,7 +7,7 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect/ion var/emp_radius = 1 -/obj/projectile/ion/on_hit(atom/target, blocked = FALSE) +/obj/projectile/ion/on_hit(atom/target, blocked = 0, pierce_hit) ..() empulse(target, emp_radius, emp_radius) return BULLET_ACT_HIT diff --git a/code/modules/projectiles/projectile/special/meteor.dm b/code/modules/projectiles/projectile/special/meteor.dm index a0020a573d3..7cecbecc6aa 100644 --- a/code/modules/projectiles/projectile/special/meteor.dm +++ b/code/modules/projectiles/projectile/special/meteor.dm @@ -9,7 +9,7 @@ damage_type = BRUTE armor_flag = BULLET -/obj/projectile/meteor/on_hit(atom/target, blocked = FALSE) +/obj/projectile/meteor/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(. == BULLET_ACT_HIT && isliving(target)) explosion(target, devastation_range = -1, light_impact_range = 2, flame_range = 0, flash_range = 1, adminlog = FALSE) diff --git a/code/modules/projectiles/projectile/special/mindflayer.dm b/code/modules/projectiles/projectile/special/mindflayer.dm index 54889bbced1..9f15e9389d5 100644 --- a/code/modules/projectiles/projectile/special/mindflayer.dm +++ b/code/modules/projectiles/projectile/special/mindflayer.dm @@ -1,7 +1,7 @@ /obj/projectile/beam/mindflayer name = "flayer ray" -/obj/projectile/beam/mindflayer/on_hit(atom/target, blocked = FALSE) +/obj/projectile/beam/mindflayer/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(ishuman(target)) var/mob/living/carbon/human/human_hit = target diff --git a/code/modules/projectiles/projectile/special/neurotoxin.dm b/code/modules/projectiles/projectile/special/neurotoxin.dm index 24d24f68d30..077b3a275e9 100644 --- a/code/modules/projectiles/projectile/special/neurotoxin.dm +++ b/code/modules/projectiles/projectile/special/neurotoxin.dm @@ -7,7 +7,7 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect/neurotoxin armour_penetration = 50 -/obj/projectile/neurotoxin/on_hit(atom/target, blocked = FALSE) +/obj/projectile/neurotoxin/on_hit(atom/target, blocked = 0, pierce_hit) if(isalien(target)) damage = 0 return ..() diff --git a/code/modules/projectiles/projectile/special/plasma.dm b/code/modules/projectiles/projectile/special/plasma.dm index cf8778fe4de..5564ba14dab 100644 --- a/code/modules/projectiles/projectile/special/plasma.dm +++ b/code/modules/projectiles/projectile/special/plasma.dm @@ -11,7 +11,7 @@ muzzle_type = /obj/effect/projectile/muzzle/plasma_cutter impact_type = /obj/effect/projectile/impact/plasma_cutter -/obj/projectile/plasma/on_hit(atom/target) +/obj/projectile/plasma/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(ismineralturf(target)) var/turf/closed/mineral/M = target diff --git a/code/modules/projectiles/projectile/special/rocket.dm b/code/modules/projectiles/projectile/special/rocket.dm index 08a2c18c2f7..22082d3809f 100644 --- a/code/modules/projectiles/projectile/special/rocket.dm +++ b/code/modules/projectiles/projectile/special/rocket.dm @@ -5,7 +5,7 @@ embedding = null shrapnel_type = null -/obj/projectile/bullet/gyro/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/gyro/on_hit(atom/target, blocked = 0, pierce_hit) ..() explosion(target, devastation_range = -1, light_impact_range = 2, explosion_cause = src) return BULLET_ACT_HIT @@ -25,7 +25,7 @@ /// Whether the rocket is capable of instantly killing a living target var/random_crits_enabled = TRUE // Worst thing Valve ever added -/obj/projectile/bullet/rocket/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/rocket/on_hit(atom/target, blocked = 0, pierce_hit) var/random_crit_gib = FALSE if(isliving(target) && prob(1) && random_crits_enabled) var/mob/living/gibbed_dude = target diff --git a/code/modules/projectiles/projectile/special/temperature.dm b/code/modules/projectiles/projectile/special/temperature.dm index 7eae3edfa20..10c652b77b5 100644 --- a/code/modules/projectiles/projectile/special/temperature.dm +++ b/code/modules/projectiles/projectile/special/temperature.dm @@ -9,7 +9,7 @@ /obj/projectile/temp/is_hostile_projectile() return temperature != 0 // our damage is done by cooling or heating (casting to boolean here) -/obj/projectile/temp/on_hit(atom/target, blocked = 0) +/obj/projectile/temp/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(iscarbon(target)) var/mob/living/carbon/hit_mob = target diff --git a/code/modules/projectiles/projectile/special/wormhole.dm b/code/modules/projectiles/projectile/special/wormhole.dm index 26873daac87..90eadd0bb09 100644 --- a/code/modules/projectiles/projectile/special/wormhole.dm +++ b/code/modules/projectiles/projectile/special/wormhole.dm @@ -22,9 +22,11 @@ gun = casing.gun -/obj/projectile/beam/wormhole/on_hit(atom/target) +/obj/projectile/beam/wormhole/on_hit(atom/target, blocked = 0, pierce_hit) var/obj/item/gun/energy/wormhole_projector/projector = gun.resolve() if(!projector) qdel(src) - return + return BULLET_ACT_BLOCK + + . = ..() projector.create_portal(src, get_turf(src)) diff --git a/code/modules/religion/burdened/psyker.dm b/code/modules/religion/burdened/psyker.dm index d4c752751b8..e6105195798 100644 --- a/code/modules/religion/burdened/psyker.dm +++ b/code/modules/religion/burdened/psyker.dm @@ -254,7 +254,7 @@ wound_bonus = -10 embedding = null -/obj/projectile/bullet/c38/holy/on_hit(atom/target, blocked, pierce_hit) +/obj/projectile/bullet/c38/holy/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() var/roll_them_bones = rand(1,38) if(roll_them_bones == 1 && isliving(target)) diff --git a/code/modules/research/xenobiology/crossbreeding/_weapons.dm b/code/modules/research/xenobiology/crossbreeding/_weapons.dm index 61f4e7a72e0..a7e54fa2c70 100644 --- a/code/modules/research/xenobiology/crossbreeding/_weapons.dm +++ b/code/modules/research/xenobiology/crossbreeding/_weapons.dm @@ -128,7 +128,7 @@ Slimecrossing Weapons icon_state = "pulse0_bl" hitsound = 'sound/effects/splat.ogg' -/obj/projectile/magic/bloodchill/on_hit(mob/living/target) +/obj/projectile/magic/bloodchill/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) target.apply_status_effect(/datum/status_effect/bloodchill) diff --git a/code/modules/spells/spell_types/conjure_item/lighting_packet.dm b/code/modules/spells/spell_types/conjure_item/lighting_packet.dm index cffddf7e0ce..2df0c85f470 100644 --- a/code/modules/spells/spell_types/conjure_item/lighting_packet.dm +++ b/code/modules/spells/spell_types/conjure_item/lighting_packet.dm @@ -33,7 +33,7 @@ hit_living.electrocute_act(80, src, flags = SHOCK_ILLUSION | SHOCK_NOGLOVES) qdel(src) -/obj/item/spellpacket/lightningbolt/throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = INFINITY, quickstart = TRUE) +/obj/item/spellpacket/lightningbolt/throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = INFINITY, gentle, quickstart = TRUE) . = ..() if(ishuman(thrower)) var/mob/living/carbon/human/human_thrower = thrower diff --git a/code/modules/vehicles/atv.dm b/code/modules/vehicles/atv.dm index c4fd2bcaceb..b72449de091 100644 --- a/code/modules/vehicles/atv.dm +++ b/code/modules/vehicles/atv.dm @@ -117,12 +117,11 @@ smoke.start() /obj/vehicle/ridden/atv/bullet_act(obj/projectile/P) - if(prob(50) || !buckled_mobs) + if(prob(50) || !LAZYLEN(buckled_mobs)) return ..() - for(var/m in buckled_mobs) - var/mob/buckled_mob = m + for(var/mob/buckled_mob as anything in buckled_mobs) buckled_mob.bullet_act(P) - return TRUE + return BULLET_ACT_HIT /obj/vehicle/ridden/atv/atom_destruction() explosion(src, devastation_range = -1, light_impact_range = 2, flame_range = 3, flash_range = 4) diff --git a/code/modules/vehicles/mecha/mecha_defense.dm b/code/modules/vehicles/mecha/mecha_defense.dm index 37fe73f4a2d..a72354d0c01 100644 --- a/code/modules/vehicles/mecha/mecha_defense.dm +++ b/code/modules/vehicles/mecha/mecha_defense.dm @@ -114,10 +114,19 @@ return ..() /obj/vehicle/sealed/mecha/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) //wrapper - if(!enclosed && LAZYLEN(occupants) && !(mecha_flags & SILICON_PILOT) && (hitting_projectile.def_zone == BODY_ZONE_HEAD || hitting_projectile.def_zone == BODY_ZONE_CHEST)) //allows bullets to hit the pilot of open-canopy mechs + . = ..() + if(. != BULLET_ACT_HIT) + return . + + //allows bullets to hit the pilot of open-canopy mechs + if(!enclosed \ + && LAZYLEN(occupants) \ + && !(mecha_flags & SILICON_PILOT) \ + && (def_zone == BODY_ZONE_HEAD || def_zone == BODY_ZONE_CHEST)) for(var/mob/living/hitmob as anything in occupants) hitmob.bullet_act(hitting_projectile, def_zone, piercing_hit) //If the sides are open, the occupant can be hit return BULLET_ACT_HIT + log_message("Hit by projectile. Type: [hitting_projectile]([hitting_projectile.damage_type]).", LOG_MECHA, color="red") // yes we *have* to run the armor calc proc here I love tg projectile code too try_damage_component(run_atom_armor( @@ -126,8 +135,7 @@ damage_flag = hitting_projectile.armor_flag, attack_dir = REVERSE_DIR(hitting_projectile.dir), armour_penetration = hitting_projectile.armour_penetration, - ), hitting_projectile.def_zone) - return ..() + ), def_zone) /obj/vehicle/sealed/mecha/ex_act(severity, target) log_message("Affected by explosion of severity: [severity].", LOG_MECHA, color="red") diff --git a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm index 06394cff6a5..f78a481cbd4 100644 --- a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm +++ b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm @@ -157,18 +157,21 @@ harass_target(thrown_by) -/mob/living/basic/pet/dog/corgi/borgi/bullet_act(obj/projectile/proj) +/mob/living/basic/pet/dog/corgi/borgi/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) . = ..() - if(!istype(proj, /obj/projectile/beam) && !istype(proj, /obj/projectile/bullet)) + if(. != BULLET_ACT_HIT) return - var/mob/living/carbon/human/target = proj.firer - if(proj.damage >= 10) - if(proj.damage_type != BRUTE && proj.damage_type != BURN) + if(!istype(hitting_projectile, /obj/projectile/beam) && !istype(hitting_projectile, /obj/projectile/bullet)) + return + + var/mob/living/carbon/human/target = hitting_projectile.firer + if(hitting_projectile.damage >= 10) + if(hitting_projectile.damage_type != BRUTE && hitting_projectile.damage_type != BURN) return - adjustBruteLoss(proj.damage) + adjustBruteLoss(hitting_projectile.damage) if(!isliving(target) || health <= 0) return diff --git a/modular_skyrat/modules/awaymissions_skyrat/mothership_astrum/mob.dm b/modular_skyrat/modules/awaymissions_skyrat/mothership_astrum/mob.dm index 6efc58b3e75..408f68c734d 100644 --- a/modular_skyrat/modules/awaymissions_skyrat/mothership_astrum/mob.dm +++ b/modular_skyrat/modules/awaymissions_skyrat/mothership_astrum/mob.dm @@ -121,8 +121,14 @@ attack_verb_continuous = "attacks" attack_verb_simple = "attack" -/mob/living/simple_animal/hostile/megafauna/hierophant/astrum/bullet_act(obj/projectile/bullet) - apply_damage(bullet.damage, bullet.damage_type) // no damage reduction +/mob/living/simple_animal/hostile/megafauna/hierophant/astrum/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) + if(. != BULLET_ACT_HIT) + return + + if(!hitting_projectile.is_hostile_projectile()) + return + + apply_damage(hitting_projectile.damage, hitting_projectile.damage_type) // no damage reduction /mob/living/simple_animal/hostile/megafauna/hierophant/astrum/death(gibbed) spawn_gibs() diff --git a/modular_skyrat/modules/black_mesa/code/mobs/bullsquid.dm b/modular_skyrat/modules/black_mesa/code/mobs/bullsquid.dm index 992ac35c43a..debcf75040f 100644 --- a/modular_skyrat/modules/black_mesa/code/mobs/bullsquid.dm +++ b/modular_skyrat/modules/black_mesa/code/mobs/bullsquid.dm @@ -45,6 +45,6 @@ hitsound = 'modular_skyrat/modules/black_mesa/sound/mobs/bullsquid/splat1.ogg' hitsound_wall = 'modular_skyrat/modules/black_mesa/sound/mobs/bullsquid/splat1.ogg' -/obj/projectile/bullsquid/on_hit(atom/target, blocked, pierce_hit) +/obj/projectile/bullsquid/on_hit(atom/target, blocked = 0, pierce_hit) new /obj/effect/decal/cleanable/greenglow(target.loc) return ..() diff --git a/modular_skyrat/modules/cellguns/code/medigun_cells.dm b/modular_skyrat/modules/cellguns/code/medigun_cells.dm index c02118d226e..c95d890b343 100644 --- a/modular_skyrat/modules/cellguns/code/medigun_cells.dm +++ b/modular_skyrat/modules/cellguns/code/medigun_cells.dm @@ -20,7 +20,7 @@ name = "oxygen heal shot" var/amount_healed = 10 -/obj/projectile/energy/medical/oxygen/on_hit(mob/living/target) +/obj/projectile/energy/medical/oxygen/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(!IsLivingHuman(target)) return FALSE @@ -145,7 +145,7 @@ var/max_clone = 2/3 var/base_disgust = 3 -/obj/projectile/energy/medical/brute/on_hit(mob/living/target) +/obj/projectile/energy/medical/brute/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() healBrute(target, amount_healed, max_clone, base_disgust) @@ -162,7 +162,7 @@ var/max_clone = 2/3 var/base_disgust = 3 -/obj/projectile/energy/medical/burn/on_hit(mob/living/target) +/obj/projectile/energy/medical/burn/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() healBurn(target, amount_healed, max_clone, base_disgust) @@ -177,7 +177,7 @@ icon_state = "green_laser" var/amount_healed = 5 -/obj/projectile/energy/medical/toxin/on_hit(mob/living/target) +/obj/projectile/energy/medical/toxin/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() healTox(target, amount_healed) @@ -191,7 +191,7 @@ var/amount_healed = 7.5 var/base_disgust = 3 -/obj/projectile/energy/medical/safe/brute/on_hit(mob/living/target) +/obj/projectile/energy/medical/safe/brute/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() safeBrute(target, amount_healed, base_disgust) @@ -204,7 +204,7 @@ var/amount_healed = 7.5 var/base_disgust = 3 -/obj/projectile/energy/medical/safe/burn/on_hit(mob/living/target) +/obj/projectile/energy/medical/safe/burn/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() safeBurn(target, amount_healed, base_disgust) @@ -328,7 +328,7 @@ name = "powerful toxin heal shot" amount_healed = 10 -/obj/projectile/energy/medical/upgraded/toxin3/on_hit(mob/living/target) +/obj/projectile/energy/medical/upgraded/toxin3/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() healTox(target, 10) @@ -367,7 +367,7 @@ /obj/projectile/energy/medical/utility/clotting name = "clotting agent shot" -/obj/projectile/energy/medical/utility/clotting/on_hit(mob/living/target) +/obj/projectile/energy/medical/utility/clotting/on_hit(mob/living/target, blocked = 0, pierce_hit) if(!IsLivingHuman(target)) return FALSE @@ -386,7 +386,7 @@ /obj/projectile/energy/medical/utility/temperature name = "temperature adjustment shot" -/obj/projectile/energy/medical/utility/temperature/on_hit(mob/living/target) +/obj/projectile/energy/medical/utility/temperature/on_hit(mob/living/target, blocked = 0, pierce_hit) if(!IsLivingHuman(target)) return FALSE @@ -408,7 +408,7 @@ /obj/projectile/energy/medical/utility/gown name = "hardlight surgical gown field" -/obj/projectile/energy/medical/utility/gown/on_hit(mob/living/target) +/obj/projectile/energy/medical/utility/gown/on_hit(mob/living/target, blocked = 0, pierce_hit) if(!istype(target, /mob/living/carbon/human)) //Dead check isn't fully needed, since it'd be reasonable for this to work on corpses. return @@ -435,7 +435,7 @@ embedding = list("embed_chance" = 100, ignore_throwspeed_threshold = TRUE, "pain_mult" = 0, "jostle_pain_mult" = 0, "fall_chance" = 0) damage = 0 -/obj/projectile/energy/medical/utility/salve/on_hit(mob/living/target) +/obj/projectile/energy/medical/utility/salve/on_hit(mob/living/target, blocked = 0, pierce_hit) if(!IsLivingHuman(target)) //No using this on the dead or synths. return FALSE . = ..() @@ -449,7 +449,7 @@ /obj/projectile/energy/medical/utility/bed name = "hardlight bed field" -/obj/projectile/energy/medical/utility/bed/on_hit(mob/living/target) +/obj/projectile/energy/medical/utility/bed/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(!istype(target, /mob/living/carbon/human)) //Only checks if they are human, it would make sense for this to work on the dead. @@ -476,7 +476,7 @@ /obj/projectile/energy/medical/utility/body_teleporter name = "bluespace transportation field" -/obj/projectile/energy/medical/utility/body_teleporter/on_hit(mob/living/target) +/obj/projectile/energy/medical/utility/body_teleporter/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(!ishuman(target) || (target.stat != DEAD && !HAS_TRAIT(target, TRAIT_DEATHCOMA))) @@ -611,7 +611,7 @@ grace_period = TRUE access_teleporting = TRUE -/obj/projectile/energy/medical/utility/relocation/on_hit(mob/living/target) +/obj/projectile/energy/medical/utility/relocation/on_hit(mob/living/target, blocked = 0, pierce_hit) . = ..() if(!ishuman(target)) diff --git a/modular_skyrat/modules/clock_cult/code/mobs/clockwork_marauder.dm b/modular_skyrat/modules/clock_cult/code/mobs/clockwork_marauder.dm index 77d35257bab..7094e11fcef 100644 --- a/modular_skyrat/modules/clock_cult/code/mobs/clockwork_marauder.dm +++ b/modular_skyrat/modules/clock_cult/code/mobs/clockwork_marauder.dm @@ -53,6 +53,7 @@ GLOBAL_LIST_EMPTY(clockwork_marauders) communicate.Grant(src) GLOB.clockwork_marauders += src + RegisterSignal(src, COMSIG_ATOM_PRE_BULLET_ACT, PROC_REF(block_bullets)) /mob/living/basic/clockwork_marauder/Destroy() @@ -80,13 +81,14 @@ GLOBAL_LIST_EMPTY(clockwork_marauders) return ..() -/mob/living/basic/clockwork_marauder/bullet_act(obj/projectile/proj) - //Block Ranged Attacks +/mob/living/basic/clockwork_marauder/proc/block_bullets(datum/source, obj/projectile/hitting_projectile) + SIGNAL_HANDLER + if(shield_health) damage_shield() - to_chat(src, span_warning("Your shield blocks the attack.")) - return BULLET_ACT_BLOCK - return ..() + visible_message(span_warning("[src]'s shield blocks the attack!")) + return COMPONENT_BULLET_BLOCKED + return NONE /// Damage the marauder's shield by one tick diff --git a/modular_skyrat/modules/customization/modules/reagents/chemistry/reagents/drinks.dm b/modular_skyrat/modules/customization/modules/reagents/chemistry/reagents/drinks.dm index 65b27fc0081..14d158734fb 100644 --- a/modular_skyrat/modules/customization/modules/reagents/chemistry/reagents/drinks.dm +++ b/modular_skyrat/modules/customization/modules/reagents/chemistry/reagents/drinks.dm @@ -51,9 +51,13 @@ return TRUE . = ..() -/obj/item/reagent_containers/cup/soda_cans/skyrat/bullet_act(obj/projectile/P) +/obj/item/reagent_containers/cup/soda_cans/skyrat/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) . = ..() - if(P.damage > 0 && P.damage_type == BRUTE && !QDELETED(src)) + + if(. != BULLET_ACT_HIT) + return + + if(hitting_projectile.damage > 0 && hitting_projectile.damage_type == BRUTE && !QDELETED(src)) var/obj/item/trash/can/skyrat/crushed_can = new /obj/item/trash/can/skyrat(src.loc) crushed_can.icon_state = icon_state var/atom/throw_target = get_edge_target_turf(crushed_can, pick(GLOB.alldirs)) diff --git a/modular_skyrat/modules/gunsgalore/code/ammo/ammo.dm b/modular_skyrat/modules/gunsgalore/code/ammo/ammo.dm index 419d60ec514..688938de1b0 100644 --- a/modular_skyrat/modules/gunsgalore/code/ammo/ammo.dm +++ b/modular_skyrat/modules/gunsgalore/code/ammo/ammo.dm @@ -131,7 +131,7 @@ var/heavy_emp_radius = -1 var/light_emp_radius = 0 -/obj/projectile/bullet/a762x39/emp/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/a762x39/emp/on_hit(atom/target, blocked = 0, pierce_hit) ..() empulse(target, heavy_emp_radius, light_emp_radius) return BULLET_ACT_HIT diff --git a/modular_skyrat/modules/medical/code/smartdarts.dm b/modular_skyrat/modules/medical/code/smartdarts.dm index ed649300e93..326f8382f41 100644 --- a/modular_skyrat/modules/medical/code/smartdarts.dm +++ b/modular_skyrat/modules/medical/code/smartdarts.dm @@ -92,7 +92,7 @@ /datum/reagent/medicine/morphine, ) -/obj/projectile/bullet/dart/syringe/dart/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/dart/syringe/dart/on_hit(atom/target, blocked = 0, pierce_hit) if(!iscarbon(target)) ..(target, blocked) reagents.flags &= ~(NO_REACT) diff --git a/modular_skyrat/modules/microfusion/code/projectiles.dm b/modular_skyrat/modules/microfusion/code/projectiles.dm index f14bb7c3888..53f19941f8d 100644 --- a/modular_skyrat/modules/microfusion/code/projectiles.dm +++ b/modular_skyrat/modules/microfusion/code/projectiles.dm @@ -40,7 +40,7 @@ color = LIGHT_COLOR_FIRE light_color = LIGHT_COLOR_FIRE -/obj/projectile/beam/laser/microfusion/superheated/on_hit(atom/target, blocked) +/obj/projectile/beam/laser/microfusion/superheated/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) var/mob/living/living = target diff --git a/modular_skyrat/modules/modular_weapons/code/company_and_or_faction_based/carwo_defense_systems/ammo/grenade.dm b/modular_skyrat/modules/modular_weapons/code/company_and_or_faction_based/carwo_defense_systems/ammo/grenade.dm index 37c9fc0f835..fa3e2e80460 100644 --- a/modular_skyrat/modules/modular_weapons/code/company_and_or_faction_based/carwo_defense_systems/ammo/grenade.dm +++ b/modular_skyrat/modules/modular_weapons/code/company_and_or_faction_based/carwo_defense_systems/ammo/grenade.dm @@ -52,7 +52,7 @@ sharpness = NONE -/obj/projectile/bullet/c980grenade/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/c980grenade/on_hit(atom/target, blocked = 0, pierce_hit) ..() fuse_activation(target) return BULLET_ACT_HIT diff --git a/modular_skyrat/modules/modular_weapons/code/company_and_or_faction_based/carwo_defense_systems/ammo/rifle.dm b/modular_skyrat/modules/modular_weapons/code/company_and_or_faction_based/carwo_defense_systems/ammo/rifle.dm index a012b594c29..4cb969f7b65 100644 --- a/modular_skyrat/modules/modular_weapons/code/company_and_or_faction_based/carwo_defense_systems/ammo/rifle.dm +++ b/modular_skyrat/modules/modular_weapons/code/company_and_or_faction_based/carwo_defense_systems/ammo/rifle.dm @@ -129,7 +129,7 @@ projectile_piercing = PASSMOB -/obj/projectile/bullet/c40sol/pierce/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/c40sol/pierce/on_hit(atom/target, blocked = 0, pierce_hit) if(isliving(target)) var/mob/living/poor_sap = target @@ -177,7 +177,7 @@ var/firestacks_to_give = 1 -/obj/projectile/bullet/c40sol/incendiary/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/c40sol/incendiary/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(iscarbon(target)) diff --git a/modular_skyrat/modules/modular_weapons/code/pepperball_gun.dm b/modular_skyrat/modules/modular_weapons/code/pepperball_gun.dm index aa24209512a..6b28643245d 100644 --- a/modular_skyrat/modules/modular_weapons/code/pepperball_gun.dm +++ b/modular_skyrat/modules/modular_weapons/code/pepperball_gun.dm @@ -48,7 +48,7 @@ var/contained_reagent = /datum/reagent/consumable/condensedcapsaicin var/reagent_volume = 5 -/obj/projectile/bullet/pepperball/on_hit(atom/target, blocked, pierce_hit) +/obj/projectile/bullet/pepperball/on_hit(atom/target, blocked = 0, pierce_hit) if(isliving(target)) var/mob/living/M = target if(M.can_inject()) diff --git a/modular_skyrat/modules/mold/code/mold_structures.dm b/modular_skyrat/modules/mold/code/mold_structures.dm index 30aa9f4e40c..e2e3a8c468e 100644 --- a/modular_skyrat/modules/mold/code/mold_structures.dm +++ b/modular_skyrat/modules/mold/code/mold_structures.dm @@ -272,11 +272,11 @@ discharge() . = ..() -/obj/structure/mold/structure/bulb/bullet_act(obj/projectile/hit_projectile) - if(istype(hit_projectile, /obj/projectile/energy/nuclear_particle)) - return ..() - discharge() +/obj/structure/mold/structure/bulb/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) . = ..() + if(istype(hitting_projectile, /obj/projectile/energy/nuclear_particle) || . != BULLET_ACT_HIT) + return + discharge() /obj/structure/mold/structure/bulb/Destroy() if(mold_controller) diff --git a/modular_skyrat/modules/novaya_ert/code/surplus_weapons.dm b/modular_skyrat/modules/novaya_ert/code/surplus_weapons.dm index aa9fda10f89..e1cc649d5f4 100644 --- a/modular_skyrat/modules/novaya_ert/code/surplus_weapons.dm +++ b/modular_skyrat/modules/novaya_ert/code/surplus_weapons.dm @@ -58,7 +58,7 @@ pass_flags = PASSTABLE | PASSGRILLE // His ass does NOT pass through glass! weak_against_armour = TRUE -/obj/projectile/beam/laser/plasma_glob/on_hit(atom/target, blocked) +/obj/projectile/beam/laser/plasma_glob/on_hit(atom/target, blocked = 0, pierce_hit) if(istype(target, /obj/structure/blob) || HAS_TRAIT(target, TRAIT_BLOB_ALLY)) damage = damage * 0.75 return ..() diff --git a/modular_skyrat/modules/shotgunrebalance/code/shotgun.dm b/modular_skyrat/modules/shotgunrebalance/code/shotgun.dm index 09e98b4bf08..e55e697861b 100644 --- a/modular_skyrat/modules/shotgunrebalance/code/shotgun.dm +++ b/modular_skyrat/modules/shotgunrebalance/code/shotgun.dm @@ -292,7 +292,7 @@ weak_against_armour = TRUE var/temperature = 30 -/obj/projectile/bullet/pellet/shotgun_buckshot/iceblox/on_hit(atom/target, blocked = FALSE) +/obj/projectile/bullet/pellet/shotgun_buckshot/iceblox/on_hit(atom/target, blocked = 0, pierce_hit) . = ..() if(isliving(target)) var/mob/living/UnluckyBastard = target diff --git a/modular_skyrat/modules/xenos_skyrat_redo/code/xeno_types/rouny.dm b/modular_skyrat/modules/xenos_skyrat_redo/code/xeno_types/rouny.dm index a8e749e3edc..5a7cb614fb5 100644 --- a/modular_skyrat/modules/xenos_skyrat_redo/code/xeno_types/rouny.dm +++ b/modular_skyrat/modules/xenos_skyrat_redo/code/xeno_types/rouny.dm @@ -82,12 +82,12 @@ addtimer(CALLBACK(owner, TYPE_PROC_REF(/datum, remove_filter), RUNNER_BLUR_EFFECT), 0.5 SECONDS) return BULLET_ACT_FORCE_PIERCE -/mob/living/carbon/alien/adult/skyrat/runner/bullet_act(obj/projectile/P, def_zone, piercing_hit = FALSE) +/mob/living/carbon/alien/adult/skyrat/runner/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE) if(evade_ability) var/evade_result = evade_ability.on_projectile_hit() if(!(evade_result == BULLET_ACT_HIT)) return evade_result - . = ..() + return ..() #undef EVASION_VENTCRAWL_INABILTY_CD_PERCENTAGE #undef RUNNER_BLUR_EFFECT diff --git a/modular_skyrat/modules/xenos_skyrat_redo/code/xeno_types/sentinel.dm b/modular_skyrat/modules/xenos_skyrat_redo/code/xeno_types/sentinel.dm index 759ee204f26..c517401954b 100644 --- a/modular_skyrat/modules/xenos_skyrat_redo/code/xeno_types/sentinel.dm +++ b/modular_skyrat/modules/xenos_skyrat_redo/code/xeno_types/sentinel.dm @@ -112,7 +112,7 @@ damage_type = STAMINA armor_flag = BIO -/obj/projectile/neurotoxin/on_hit(atom/target, blocked = FALSE) +/obj/projectile/neurotoxin/on_hit(atom/target, blocked = 0, pierce_hit) if(isalien(target)) damage = 0 return ..()