[GBP no update] Minor refactor to reflecting projectiles, detgun fix (#18114)

* initial

* change these please

* let it not ignore carp, i suppose

* this instead

* review, fixes

* charlie code
This commit is contained in:
S34N
2022-06-28 22:37:04 +01:00
committed by GitHub
parent bb36a5b0d1
commit 3807bf43c7
11 changed files with 30 additions and 18 deletions
@@ -13,7 +13,7 @@ emp_act
if(!dna.species.bullet_act(P, src))
add_attack_logs(P.firer, src, "hit by [P.type] but got deflected by species '[dna.species]'")
return FALSE
if(P.is_reflectable)
if(P.is_reflectable(REFLECTABILITY_ENERGY))
var/can_reflect = check_reflect(def_zone)
var/reflected = FALSE
@@ -40,7 +40,7 @@ emp_act
if(!lying && !HAS_TRAIT(src, TRAIT_HULK) && mind.martial_art.try_deflect(src)) //But only if they're not lying down, and hulks can't do it
add_attack_logs(P.firer, src, "hit by [P.type] but got deflected by martial arts '[mind.martial_art]'")
playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, TRUE)
if(HAS_TRAIT(src, TRAIT_PACIFISM))
if(HAS_TRAIT(src, TRAIT_PACIFISM) || !P.is_reflectable(REFLECTABILITY_PHYSICAL)) //if it cannot be reflected, it hits the floor. This is the exception to the rule
// Pacifists can deflect projectiles, but not reflect them.
// Instead, they deflect them into the ground below them.
var/turf/T = get_turf(src)
@@ -412,7 +412,7 @@
/datum/species/golem/glass/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H)
if(!(P.original == H && P.firer == H)) //self-shots don't reflect
if(P.is_reflectable)
if(P.is_reflectable(REFLECTABILITY_ENERGY))
H.visible_message("<span class='danger'>[P] gets reflected by [H]'s glass skin!</span>", \
"<span class='userdanger'>[P] gets reflected by [H]'s glass skin!</span>")
@@ -1330,7 +1330,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
playsound(get_turf(src), 'sound/mecha/nominalnano.ogg', 75, FALSE)
/mob/living/silicon/robot/deathsquad/bullet_act(obj/item/projectile/P)
if(istype(P) && P.is_reflectable && P.starting)
if(istype(P) && P.is_reflectable(REFLECTABILITY_ENERGY) && P.starting)
visible_message("<span class='danger'>[P] gets reflected by [src]!</span>", "<span class='userdanger'>[P] gets reflected by [src]!</span>")
P.reflect_back(src)
return -1
@@ -140,7 +140,7 @@
environment_smash = 1 //only token destruction, don't smash the cult wall NO STOP
/mob/living/simple_animal/hostile/construct/armoured/bullet_act(obj/item/projectile/P)
if(P.is_reflectable)
if(P.is_reflectable(REFLECTABILITY_ENERGY))
var/reflectchance = 80 - round(P.damage/3)
if(prob(reflectchance))
if((P.damage_type == BRUTE || P.damage_type == BURN))