diff --git a/code/game/objects/structures/vehicles/vehicle.dm b/code/game/objects/structures/vehicles/vehicle.dm index 15b35cd4db5..9c27110e3f7 100644 --- a/code/game/objects/structures/vehicles/vehicle.dm +++ b/code/game/objects/structures/vehicles/vehicle.dm @@ -358,7 +358,7 @@ /obj/structure/bed/chair/vehicle/bullet_act(var/obj/item/projectile/Proj) var/hitrider = 0 if(istype(Proj, /obj/item/projectile/ion)) - Proj.on_hit(src, 2) + Proj.on_hit(src, 100) return if(occupant) diff --git a/code/modules/mob/living/carbon/complex/combat.dm b/code/modules/mob/living/carbon/complex/combat.dm index a45465182d7..b7fedec1d91 100644 --- a/code/modules/mob/living/carbon/complex/combat.dm +++ b/code/modules/mob/living/carbon/complex/combat.dm @@ -6,8 +6,8 @@ /mob/living/carbon/complex/bullet_act(var/obj/item/projectile/P, var/def_zone) if(check_shields(P.damage, P)) - P.on_hit(src, 2) - return 2 + P.on_hit(src, 100) + return PROJECTILE_COLLISION_BLOCKED return (..(P , def_zone)) /mob/living/carbon/complex/attack_hand(mob/living/M) @@ -80,4 +80,4 @@ if(!talked) target.drop_item() visible_message("[src] has disarmed [target]!") - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) \ No newline at end of file + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 5995cee532e..d7fecbe3e47 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -64,7 +64,7 @@ var/absorb = run_armor_check(def_zone, P.flag, armor_penetration = P.armor_penetration) if(absorb >= 100) - P.on_hit(src,2) + P.on_hit(src,100) return PROJECTILE_COLLISION_BLOCKED if(!P.nodamage) var/damage = run_armor_absorb(def_zone, P.flag, P.damage) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index d051f39671c..f4f00427f38 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -155,7 +155,7 @@ /mob/living/silicon/bullet_act(var/obj/item/projectile/Proj) if(!Proj.nodamage) adjustBruteLoss(Proj.damage) - Proj.on_hit(src,2) + Proj.robot_on_hit(src,100) //Unique variant of on_hit return PROJECTILE_COLLISION_DEFAULT /mob/living/silicon/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0) diff --git a/code/modules/mob/living/simple_animal/hostile/mannequin.dm b/code/modules/mob/living/simple_animal/hostile/mannequin.dm index e7736ce5a9a..9c56568d3b2 100644 --- a/code/modules/mob/living/simple_animal/hostile/mannequin.dm +++ b/code/modules/mob/living/simple_animal/hostile/mannequin.dm @@ -147,7 +147,7 @@ var/absorb = run_armor_check(def_zone, P.flag, armor_penetration = P.armor_penetration) if(absorb >= 100) - P.on_hit(src,2) + P.on_hit(src,100) return PROJECTILE_COLLISION_BLOCKED if(!P.nodamage) var/damage = run_armor_absorb(def_zone, P.flag, P.damage) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 79ecf54f066..2888d95d958 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -157,6 +157,11 @@ var/list/impact_master = list() playsound(loc, hitsound, 35, 1) return 1 +//A special on_hit variant that gets applied to robots, for when you want some things to affect robots but not everything. +//Code that checks for this is in code/modules/mob/living/silicon/silicon.dm +/obj/item/projectile/proc/robot_on_hit(var/atom/atarget, var/blocked = 0) + return on_hit(atarget, blocked) + /obj/item/projectile/proc/check_fire(var/mob/living/target as mob, var/mob/living/user as mob) //Checks if you can hit them or not. if(!istype(target) || !istype(user)) return 0 diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index 3bd423f3f95..121a264ed1f 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -36,6 +36,16 @@ spawn(30) X.tazed = 0 +//Robots get slowed down +/obj/item/projectile/energy/electrode/robot_on_hit(var/mob/living/atarget, var/blocked) + QDEL_NULL(tracker_datum) + if(atarget.tazed == 0) + atarget.movement_speed_modifier -= 0.75 + spawn(30) + atarget.movement_speed_modifier += 0.75 + atarget.tazed = 1 + spawn(30) + atarget.tazed = 0 /*/vg/ EDIT agony = 40 diff --git a/code/modules/spells/aoe_turf/conjure/forcewall.dm b/code/modules/spells/aoe_turf/conjure/forcewall.dm index eaa63c4d817..c77c64a5353 100644 --- a/code/modules/spells/aoe_turf/conjure/forcewall.dm +++ b/code/modules/spells/aoe_turf/conjure/forcewall.dm @@ -80,8 +80,8 @@ Unwall spell, sadly has to be targeted to be any fun to use /obj/effect/forcefield/bullet_act(var/obj/item/projectile/Proj, var/def_zone) var/turf/T = get_turf(src.loc) if(T) - for(var/mob/M in T) - Proj.on_hit(M,M.bullet_act(Proj, def_zone)) + var/mob/M = pick(T.contents) + M?.bullet_act(Proj, def_zone) return ..() /obj/effect/forcefield/wizard @@ -134,4 +134,4 @@ Unwall fields for(var/atom/B in src.loc) // Go through everything, discount passing through forbidden stuff if(is_type_in_list(B,forbidden_passes)) return - A.forceMove(src.loc) \ No newline at end of file + A.forceMove(src.loc)