Interaction/Attack Hand Refactor (#36405)

This commit is contained in:
kevinz000
2018-03-23 11:20:54 +01:00
committed by AnturK
parent 80f6e451fc
commit f300a5c155
347 changed files with 1483 additions and 1186 deletions
+2 -1
View File
@@ -69,7 +69,8 @@
last_power-=bitcoins_mined
/obj/machinery/power/rad_collector/attack_hand(mob/user)
if(..())
. = ..()
if(.)
return
if(anchored)
if(!src.locked)
@@ -9,6 +9,8 @@
density = FALSE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
use_power = NO_POWER_USE
interaction_flags_atom = NONE
interaction_flags_machine = NONE
light_range = 4
layer = ABOVE_OBJ_LAYER
var/obj/machinery/field/generator/FG1 = null
@@ -19,6 +21,7 @@
FG2.fields -= src
return ..()
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/machinery/field/containment/attack_hand(mob/user)
if(get_dist(src, user) > 1)
return FALSE
+4 -3
View File
@@ -23,6 +23,7 @@
var/shot_number = 0
var/state = 0
var/locked = FALSE
var/allow_switch_interact = TRUE
var/projectile_type = /obj/item/projectile/beam/emitter
@@ -101,13 +102,13 @@
icon_state = initial(icon_state)
/obj/machinery/power/emitter/attack_hand(mob/user)
src.add_fingerprint(user)
/obj/machinery/power/emitter/interact(mob/user)
add_fingerprint(user)
if(state == 2)
if(!powernet)
to_chat(user, "<span class='warning'>The emitter isn't connected to a wire!</span>")
return 1
if(!src.locked)
if(!locked && allow_switch_interact)
if(src.active==1)
src.active = 0
to_chat(user, "<span class='notice'>You turn off \the [src].</span>")
@@ -65,6 +65,9 @@ field_generator power level display
calc_power()
/obj/machinery/field/generator/attack_hand(mob/user)
. = ..()
if(.)
return
if(state == FG_WELDED)
if(get_dist(src, user) <= 1)//Need to actually touch the thing to turn it on
if(active >= FG_CHARGING)
+2 -1
View File
@@ -17,10 +17,11 @@
var/energy = 0
var/creation_type = /obj/singularity
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/machinery/the_singularitygen/attack_hand(mob/user)
if(user.a_intent == INTENT_GRAB && user_buckle_mob(user.pulling, user, check_loc = 0))
return
..()
. = ..()
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
+1 -2
View File
@@ -93,11 +93,10 @@
/proc/cult_ending_helper(var/no_explosion = 0)
Cinematic(CINEMATIC_CULT,world,CALLBACK(GLOBAL_PROC,.ending_helper))
//ATTACK GHOST IGNORING PARENT RETURN VALUE
/obj/singularity/narsie/large/attack_ghost(mob/dead/observer/user as mob)
makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, user, cultoverride = TRUE, loc_override = src.loc)
/obj/singularity/narsie/process()
if(clashing)
return
@@ -35,6 +35,9 @@
return ..()
/obj/machinery/particle_accelerator/control_box/attack_hand(mob/user)
. = ..()
if(.)
return
if(construction_state == PA_CONSTRUCTION_COMPLETE)
interact(user)
else if(construction_state == PA_CONSTRUCTION_PANEL_OPEN)
@@ -223,13 +226,13 @@
return 1
/obj/machinery/particle_accelerator/control_box/interact(mob/user)
/obj/machinery/particle_accelerator/control_box/ui_interact(mob/user)
. = ..()
if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER)))
if(!issilicon(user))
user.unset_machine()
user << browse(null, "window=pacontrol")
return
user.set_machine(src)
var/dat = ""
dat += "<A href='?src=[REF(src)];close=1'>Close</A><BR><BR>"
@@ -58,10 +58,9 @@
last_failed_movement = direct
return 0
/obj/singularity/attack_hand(mob/user)
consume(user)
return 1
return TRUE
/obj/singularity/attack_paw(mob/user)
consume(user)