mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Replaces flamethrower unique hit_reaction handling with the bullet_intercepting component (#92731)
## About The Pull Request Flamethrower exploding when shot was handled by hit_reaction previously, and will now use the generic bullet_intercepting component. Also adds handling for multiple projectile types in the bullet_intercepting component, as well as a check for whether the object currently can block bullets. Should have no gameplay changes. ## Why It's Good For The Game closes #81863 , they said it'd be better consistency
This commit is contained in:
@@ -237,6 +237,14 @@
|
||||
|
||||
/obj/item/flamethrower/Initialize(mapload)
|
||||
. = ..()
|
||||
AddComponent(\
|
||||
/datum/component/bullet_intercepting,\
|
||||
block_chance = 15,\
|
||||
on_intercepted = CALLBACK(src, PROC_REF(intercepted_bullet_reaction)),\
|
||||
active_slots = ITEM_SLOT_HANDS,\
|
||||
block_type = list(BULLET,LASER),\
|
||||
is_blocking_check = CALLBACK(src, PROC_REF(check_tank)),\
|
||||
)
|
||||
if(create_full)
|
||||
if(!weldtool)
|
||||
weldtool = new /obj/item/weldingtool(src)
|
||||
@@ -256,15 +264,15 @@
|
||||
/obj/item/flamethrower/full/tank
|
||||
create_with_tank = TRUE
|
||||
|
||||
/obj/item/flamethrower/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE)
|
||||
if(damage && attack_type == PROJECTILE_ATTACK && damage_type != STAMINA && prob(15))
|
||||
owner.visible_message(span_danger("\The [attack_text] hits the fuel tank on [owner]'s [name], rupturing it! What a shot!"))
|
||||
var/turf/target_turf = get_turf(owner)
|
||||
owner.log_message("held a flamethrower tank detonated by a projectile ([hitby])", LOG_GAME)
|
||||
igniter.ignite_turf(src,target_turf, release_amount = 100)
|
||||
qdel(ptank)
|
||||
return 1 //It hit the flamethrower, not them
|
||||
/obj/item/flamethrower/proc/intercepted_bullet_reaction(mob/living/holder, obj/projectile/bullet)
|
||||
holder.visible_message(span_danger("\The [bullet] hits the fuel tank on [holder]'s [name], rupturing it! What a shot!"))
|
||||
var/turf/target_turf = get_turf(holder)
|
||||
holder.log_message("held a flamethrower tank detonated by a projectile ([bullet])", LOG_GAME)
|
||||
igniter.ignite_turf(src,target_turf, release_amount = 100)
|
||||
qdel(ptank)
|
||||
|
||||
/obj/item/flamethrower/proc/check_tank()
|
||||
return ptank
|
||||
|
||||
/obj/item/assembly/igniter/proc/flamethrower_process(turf/open/location)
|
||||
location.hotspot_expose(heat,2)
|
||||
|
||||
Reference in New Issue
Block a user