Some on_hit fixes (#36741)

* more stuff

* Update silicon.dm

* stuff

* Update code/modules/spells/aoe_turf/conjure/forcewall.dm

Co-authored-by: west3436 <66280799+west3436@users.noreply.github.com>

---------

Co-authored-by: west3436 <66280799+west3436@users.noreply.github.com>
This commit is contained in:
boy2mantwicethefam
2024-07-09 15:55:48 +03:00
committed by GitHub
parent 7aa4f81f9c
commit 6b73f4f15a
8 changed files with 25 additions and 10 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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