Nerfs circuit pneumatic cannons and guns with extra sanity checks.
This commit is contained in:
@@ -615,6 +615,11 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/electronic_assembly/can_trigger_gun(mob/living/user) //sanity checks against pocket death weapon circuits
|
||||
if(!can_fire_equipped || !user.is_holding(src))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/obj/item/electronic_assembly/default //The /default electronic_assemblys are to allow the introduction of the new naming scheme without breaking old saves.
|
||||
name = "type-a electronic assembly"
|
||||
|
||||
|
||||
@@ -402,3 +402,8 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
/obj/item/integrated_circuit/can_trigger_gun(mob/living/user)
|
||||
if(!user.is_holding(src))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
@@ -81,9 +81,13 @@
|
||||
to_chat(user, "<span class='notice'>There's no weapon to remove from the mechanism.</span>")
|
||||
|
||||
/obj/item/integrated_circuit/weaponized/weapon_firing/do_work()
|
||||
if(!installed_gun || !installed_gun.handle_pins())
|
||||
if(!assembly || !installed_gun)
|
||||
return
|
||||
if(!isturf(assembly.loc) && !(assembly.can_fire_equipped && ishuman(assembly.loc)))
|
||||
if(isliving(assembly.loc))
|
||||
var/mob/living/L = assembly.loc
|
||||
if(!assembly.can_fire_equipped || !L.is_holding(assembly) || !installed_gun.can_trigger_gun(L)) //includes pins, hulk and other chunky fingers checks.
|
||||
return
|
||||
else if(!isturf(assembly.loc) || !installed_gun.handle_pins())
|
||||
return
|
||||
set_pin_data(IC_OUTPUT, 1, WEAKREF(installed_gun))
|
||||
push_data()
|
||||
@@ -92,18 +96,17 @@
|
||||
var/datum/integrated_io/mode1 = inputs[3]
|
||||
|
||||
mode = mode1.data
|
||||
if(assembly)
|
||||
if(isnum(xo.data))
|
||||
xo.data = round(xo.data, 1)
|
||||
if(isnum(yo.data))
|
||||
yo.data = round(yo.data, 1)
|
||||
if(isnum(xo.data))
|
||||
xo.data = round(xo.data, 1)
|
||||
if(isnum(yo.data))
|
||||
yo.data = round(yo.data, 1)
|
||||
|
||||
var/turf/T = get_turf(assembly)
|
||||
var/target_x = CLAMP(T.x + xo.data, 0, world.maxx)
|
||||
var/target_y = CLAMP(T.y + yo.data, 0, world.maxy)
|
||||
var/turf/T = get_turf(assembly)
|
||||
var/target_x = CLAMP(T.x + xo.data, 0, world.maxx)
|
||||
var/target_y = CLAMP(T.y + yo.data, 0, world.maxy)
|
||||
|
||||
assembly.visible_message("<span class='danger'>[assembly] fires [installed_gun]!</span>")
|
||||
shootAt(locate(target_x, target_y, T.z))
|
||||
assembly.visible_message("<span class='danger'>[assembly] fires [installed_gun]!</span>")
|
||||
shootAt(locate(target_x, target_y, T.z))
|
||||
|
||||
/obj/item/integrated_circuit/weaponized/weapon_firing/proc/shootAt(turf/target)
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -246,26 +249,30 @@
|
||||
if(!A || A.anchored || A.throwing || A == assembly || istype(A, /obj/item/twohanded) || istype(A, /obj/item/transfer_valve))
|
||||
return
|
||||
|
||||
if(!AT || !AT.air_contents)
|
||||
var/obj/item/I = get_object()
|
||||
var/turf/T = get_turf(I)
|
||||
if(!T)
|
||||
return
|
||||
if(isliving(I.loc))
|
||||
var/mob/living/L = I.loc
|
||||
if(!I.can_trigger_gun(L)) //includes hulk and other chunky fingers checks.
|
||||
return
|
||||
if(HAS_TRAIT(L, TRAIT_PACIFISM) && A.throwforce)
|
||||
to_chat(L, "<span class='notice'> [I] is lethally chambered! You don't want to risk harming anyone...</span>")
|
||||
return
|
||||
else if(T != I.loc)
|
||||
return
|
||||
|
||||
if (istype(assembly.loc, /obj/item/implant/storage)) //Prevents the more abusive form of chestgun.
|
||||
if(!AT || !AT.air_contents)
|
||||
return
|
||||
|
||||
if(max_w_class && (A.w_class > max_w_class))
|
||||
return
|
||||
|
||||
if(!assembly.can_fire_equipped && ishuman(assembly.loc))
|
||||
return
|
||||
|
||||
// Is the target inside the assembly or close to it?
|
||||
if(!check_target(A, exclude_components = TRUE))
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(get_object())
|
||||
if(!T)
|
||||
return
|
||||
|
||||
// If the item is in mob's inventory, try to remove it from there.
|
||||
if(ismob(A.loc))
|
||||
var/mob/living/M = A.loc
|
||||
|
||||
Reference in New Issue
Block a user