Interaction/Attack Hand Refactor (#36405)

This commit is contained in:
kevinz000
2018-03-23 03:20:54 -07:00
committed by AnturK
parent 80f6e451fc
commit f300a5c155
347 changed files with 1483 additions and 1186 deletions
+5 -2
View File
@@ -244,12 +244,15 @@
icon_state = "[base_icon]_hatched"
/obj/structure/alien/egg/attack_paw(mob/living/user)
. = attack_hand(user)
return attack_hand(user)
/obj/structure/alien/egg/attack_alien(mob/living/carbon/alien/user)
. = attack_hand(user)
return attack_hand(user)
/obj/structure/alien/egg/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(user.getorgan(/obj/item/organ/alien/plasmavessel))
switch(status)
if(BURST)
+5 -7
View File
@@ -54,12 +54,13 @@
playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
/obj/structure/sign/barsign/attack_ai(mob/user)
return src.attack_hand(user)
return attack_hand(user)
/obj/structure/sign/barsign/attack_hand(mob/user)
if (!src.allowed(user))
. = ..()
if(.)
return
if(!allowed(user))
to_chat(user, "<span class='info'>Access denied.</span>")
return
if (broken)
@@ -67,9 +68,6 @@
return
pick_sign()
/obj/structure/sign/barsign/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/screwdriver))
if(!allowed(user))
+3 -2
View File
@@ -298,12 +298,13 @@ LINEN BINS
to_chat(user, "<span class='notice'>You hide [I] among the sheets.</span>")
/obj/structure/bedsheetbin/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/bedsheetbin/attack_hand(mob/user)
. = ..()
if(.)
return
if(user.lying)
return
if(amount >= 1)
@@ -311,13 +311,14 @@
container_resist()
/obj/structure/closet/attack_hand(mob/user)
..()
. = ..()
if(.)
return
if(user.lying && get_dist(src, user) > 0)
return
if(!toggle(user))
togglelock(user)
return
/obj/structure/closet/attack_paw(mob/user)
return attack_hand(user)
@@ -339,7 +340,7 @@
return
if(iscarbon(usr) || issilicon(usr) || isdrone(usr))
attack_hand(usr)
return attack_hand(usr)
else
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
@@ -50,7 +50,7 @@
return 0
/obj/structure/closet/body_bag/MouseDrop(over_object, src_location, over_location)
..()
. = ..()
if(over_object == usr && Adjacent(usr) && (in_range(src, usr) || usr.contents.Find(src)))
if(!ishuman(usr))
return 0
@@ -74,7 +74,7 @@
max_mob_size = MOB_SIZE_LARGE
/obj/structure/closet/body_bag/bluespace/MouseDrop(over_object, src_location, over_location)
..()
. = ..()
if(over_object == usr && Adjacent(usr) && (in_range(src, usr) || usr.contents.Find(src)))
if(!ishuman(usr))
return 0
@@ -42,4 +42,4 @@
new /obj/item/storage/bag/bio( src )
new /obj/item/clothing/suit/bio_suit/scientist( src )
new /obj/item/clothing/head/bio_hood/scientist( src )
@@ -15,7 +15,6 @@
new /obj/item/storage/belt/military(src)
new /obj/item/crowbar/red(src)
new /obj/item/clothing/glasses/night(src)
return
/obj/structure/closet/syndicate/nuclear
desc = "It's a storage unit for a Syndicate boarding party."
@@ -27,7 +26,6 @@
new /obj/item/storage/box/teargas(src)
new /obj/item/storage/backpack/duffelbag/syndie/med(src)
new /obj/item/device/pda/syndicate(src)
return
/obj/structure/closet/syndicate/resources
desc = "An old, dusty locker."
@@ -92,8 +90,6 @@
if(pickednum == 50)
new /obj/item/tank/jetpack/carbondioxide(src)
return
/obj/structure/closet/syndicate/resources/everything
desc = "It's an emergency storage closet for repairs."
@@ -117,5 +113,3 @@
for(var/res in resources)
var/obj/item/stack/R = new res(src)
R.amount = R.max_amount
return
@@ -39,10 +39,11 @@
add_overlay("manifest")
/obj/structure/closet/crate/attack_hand(mob/user)
. = ..()
if(.)
return
if(manifest)
tear_manifest(user)
return
..()
/obj/structure/closet/crate/open(mob/living/user)
. = ..()
@@ -7,6 +7,9 @@
delivery_icon = "deliverybox"
/obj/structure/closet/crate/large/attack_hand(mob/user)
. = ..()
if(.)
return
add_fingerprint(user)
if(manifest)
tear_manifest(user)
+4 -3
View File
@@ -155,9 +155,12 @@
update_icon()
/obj/structure/displaycase/attack_paw(mob/user)
return src.attack_hand(user)
return attack_hand(user)
/obj/structure/displaycase/attack_hand(mob/user)
. = ..()
if(.)
return
user.changeNext_move(CLICK_CD_MELEE)
if (showpiece && (broken || open))
to_chat(user, "<span class='notice'>You deactivate the hover field built into the case.</span>")
@@ -173,8 +176,6 @@
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
take_damage(2)
/obj/structure/displaycase_chassis
anchored = TRUE
density = FALSE
+6 -1
View File
@@ -8,7 +8,9 @@
can_buckle = 1
/obj/structure/sacrificealtar/attack_hand(mob/living/user)
..()
. = ..()
if(.)
return
if(!has_buckled_mobs())
return
var/mob/living/L = locate() in buckled_mobs
@@ -29,6 +31,9 @@
var/last_process = 0
/obj/structure/healingfountain/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(last_process + time_between_uses > world.time)
to_chat(user, "<span class='notice'>The fountain appears to be empty.</span>")
return
+3
View File
@@ -20,6 +20,9 @@
qdel(src)
/obj/structure/dresser/attack_hand(mob/user)
. = ..()
if(.)
return
if(!Adjacent(user))//no tele-grooming
return
if(ishuman(user))
+4 -1
View File
@@ -68,6 +68,9 @@
/obj/structure/extinguisher_cabinet/attack_hand(mob/user)
. = ..()
if(.)
return
if(iscyborg(user) || isalien(user))
return
if(stored_extinguisher)
@@ -95,7 +98,7 @@
/obj/structure/extinguisher_cabinet/attack_paw(mob/user)
attack_hand(user)
return attack_hand(user)
/obj/structure/extinguisher_cabinet/AltClick(mob/living/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
+4 -1
View File
@@ -50,6 +50,9 @@
/obj/structure/falsewall/attack_hand(mob/user)
if(opening)
return
. = ..()
if(.)
return
opening = TRUE
update_icon()
@@ -185,7 +188,7 @@
/obj/structure/falsewall/uranium/attack_hand(mob/user)
radiate()
..()
. = ..()
/obj/structure/falsewall/uranium/proc/radiate()
if(!active)
+4 -1
View File
@@ -104,6 +104,9 @@
qdel(src)
/obj/structure/fireaxecabinet/attack_hand(mob/user)
. = ..()
if(.)
return
if(open || broken)
if(fireaxe)
user.put_in_hands(fireaxe)
@@ -121,7 +124,7 @@
return
/obj/structure/fireaxecabinet/attack_paw(mob/living/user)
attack_hand(user)
return attack_hand(user)
/obj/structure/fireaxecabinet/attack_ai(mob/user)
toggle_lock(user)
+3
View File
@@ -66,6 +66,9 @@
var/list/ckeys_that_took = list()
/obj/structure/flora/tree/pine/xmas/presents/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(!user.ckey)
return
+2 -1
View File
@@ -104,7 +104,8 @@
icon_state = "driverseat"
/obj/structure/fluff/bus/passable/seat/driver/attack_hand(mob/user)
playsound(src.loc, 'sound/items/carhorn.ogg', 50, 1)
playsound(src, 'sound/items/carhorn.ogg', 50, 1)
. = ..()
/obj/structure/fluff/paper
name = "dense lining of papers"
@@ -161,6 +161,9 @@
new_spawn.mind.assigned_role = "Free Golem"
/obj/effect/mob_spawn/human/golem/attack_hand(mob/user)
. = ..()
if(.)
return
if(isgolem(user) && can_transfer)
var/transfer_choice = alert("Transfer your soul to [src]? (Warning, your old body will die!)",,"Yes","No")
if(transfer_choice != "Yes")
@@ -173,7 +176,6 @@
create(ckey = user.ckey,name = user.real_name)
user.death()
return
..()
/obj/effect/mob_spawn/human/golem/servant
has_owner = TRUE
+5 -2
View File
@@ -91,7 +91,7 @@
take_damage(rand(5,10), BRUTE, "melee", 1)
/obj/structure/grille/attack_paw(mob/user)
attack_hand(user)
return attack_hand(user)
/obj/structure/grille/hulk_damage()
return 60
@@ -103,6 +103,9 @@
return TRUE
/obj/structure/grille/attack_hand(mob/living/user)
. = ..()
if(.)
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
user.visible_message("<span class='warning'>[user] hits [src].</span>", null, null, COMBAT_MESSAGE_RANGE)
@@ -268,7 +271,7 @@
C.powernet.load += C.powernet.avail * 0.0375 // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock.
return ..()
/obj/structure/grille/get_dumping_location(obj/item/storage/source,mob/user)
/obj/structure/grille/get_dumping_location(datum/component/storage/source,mob/user)
return null
/obj/structure/grille/broken // Pre-broken grilles for map placement
+3
View File
@@ -54,6 +54,9 @@
return ..()
/obj/structure/guncase/attack_hand(mob/user)
. = ..()
if(.)
return
if(iscyborg(user) || isalien(user))
return
if(contents.len && open)
+3 -1
View File
@@ -38,7 +38,9 @@
add_overlay(H)
/obj/structure/headpike/attack_hand(mob/user)
..()
. = ..()
if(.)
return
to_chat(user, "<span class='notice'>You take down [src].</span>")
victim.forceMove(drop_location())
victim = null
+6
View File
@@ -22,6 +22,9 @@
return ..()
/obj/structure/holosign/attack_hand(mob/living/user)
. = ..()
if(.)
return
user.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
user.changeNext_move(CLICK_CD_MELEE)
take_damage(5 , BRUTE, "melee", 1)
@@ -112,6 +115,9 @@
shockcd = FALSE
/obj/structure/holosign/barrier/cyborg/hacked/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(!shockcd)
if(ismob(user))
var/mob/living/M = user
+5 -3
View File
@@ -16,10 +16,9 @@
var/const/max_signs = 4
/obj/structure/janitorialcart/New()
/obj/structure/janitorialcart/Initialize()
. = ..()
create_reagents(100)
..()
/obj/structure/janitorialcart/proc/wet_mop(obj/item/mop, mob/user)
if(reagents.total_volume < 1)
@@ -90,6 +89,9 @@
return ..()
/obj/structure/janitorialcart/attack_hand(mob/user)
. = ..()
if(.)
return
user.set_machine(src)
var/dat
if(mybag)
@@ -47,9 +47,8 @@
can_buckle = 1
max_integrity = 250
/obj/structure/kitchenspike/attack_paw(mob/user)
return src.attack_hand(usr)
return attack_hand(user)
/obj/structure/kitchenspike/crowbar_act(mob/living/user, obj/item/I)
if(has_buckled_mobs())
@@ -61,6 +60,7 @@
deconstruct(TRUE)
return TRUE
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/kitchenspike/attack_hand(mob/user)
if(VIABLE_MOB_CHECK(user.pulling) && user.a_intent == INTENT_GRAB && !has_buckled_mobs())
var/mob/living/L = user.pulling
+5
View File
@@ -110,6 +110,9 @@
add_fingerprint(user)
/obj/structure/ladder/attack_hand(mob/user)
. = ..()
if(.)
return
use(user)
/obj/structure/ladder/attack_paw(mob/user)
@@ -122,8 +125,10 @@
if(R.Adjacent(src))
return use(R)
//ATTACK GHOST IGNORING PARENT RETURN VALUE
/obj/structure/ladder/attack_ghost(mob/dead/observer/user)
use(user, TRUE)
return ..()
/obj/structure/ladder/proc/show_fluff_message(going_up, mob/user)
if(going_up)
@@ -25,6 +25,9 @@
var/respawn_sound = 'sound/magic/staff_animation.ogg'
/obj/structure/life_candle/attack_hand(mob/user)
. = ..()
if(.)
return
if(!user.mind)
return
if(user.mind in linked_minds)
@@ -53,9 +53,12 @@
return TryToSwitchState(user)
/obj/structure/mineral_door/attack_paw(mob/user)
return TryToSwitchState(user)
return attack_hand(user)
/obj/structure/mineral_door/attack_hand(mob/user)
. = ..()
if(.)
return
return TryToSwitchState(user)
/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target)
@@ -131,7 +134,7 @@
to_chat(user, "<span class='notice'>You finish digging.</span>")
deconstruct(TRUE)
else if(user.a_intent != INTENT_HARM)
attack_hand(user)
return attack_hand(user)
else
return ..()
+6
View File
@@ -15,6 +15,9 @@
obj_break(null, mapload)
/obj/structure/mirror/attack_hand(mob/user)
. = ..()
if(.)
return
if(broken || !Adjacent(user))
return
@@ -118,6 +121,9 @@
..()
/obj/structure/mirror/magic/attack_hand(mob/user)
. = ..()
if(.)
return
if(!ishuman(user))
return
+8 -2
View File
@@ -58,9 +58,12 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
open()
/obj/structure/bodycontainer/attack_paw(mob/user)
return src.attack_hand(user)
return attack_hand(user)
/obj/structure/bodycontainer/attack_hand(mob/user)
. = ..()
if(.)
return
if(locked)
to_chat(user, "<span class='danger'>It's locked.</span>")
return
@@ -316,9 +319,12 @@ GLOBAL_LIST_EMPTY(crematoriums)
qdel(src)
/obj/structure/tray/attack_paw(mob/user)
return src.attack_hand(user)
return attack_hand(user)
/obj/structure/tray/attack_hand(mob/user)
. = ..()
if(.)
return
if (src.connected)
connected.close()
add_fingerprint(user)
+10 -4
View File
@@ -355,18 +355,24 @@
song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded
/obj/structure/piano/attack_hand(mob/user)
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 1
. = ..()
if(.)
return
interact(user)
/obj/structure/piano/attack_paw(mob/user)
return src.attack_hand(user)
return attack_hand(user)
/obj/structure/piano/interact(mob/user)
ui_interact(user)
/obj/structure/piano/ui_interact(mob/user)
if(!user || !anchored)
return
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 1
user.set_machine(src)
song.interact(user)
+5 -1
View File
@@ -39,7 +39,11 @@
else
return ..()
/obj/structure/noticeboard/attack_hand(mob/user)
/obj/structure/noticeboard/interact(mob/user)
ui_interact(user)
/obj/structure/noticeboard/ui_interact(mob/user)
. = ..()
var/auth = allowed(user)
var/dat = "<B>[name]</B><BR>"
for(var/obj/item/P in src)
+3
View File
@@ -84,6 +84,9 @@ FLOOR SAFES
/obj/structure/safe/attack_hand(mob/user)
. = ..()
if(.)
return
user.set_machine(src)
var/dat = "<center>"
dat += "<a href='?src=[REF(src)];open=1'>[open ? "Close" : "Open"] [src]</a> | <a href='?src=[REF(src)];decrement=1'>-</a> [dial] <a href='?src=[REF(src)];increment=1'>+</a>"
+4 -2
View File
@@ -15,14 +15,16 @@
..()
/obj/structure/spirit_board/attack_hand(mob/user)
if(..())
. = ..()
if(.)
return
spirit_board_pick_letter(user)
//ATTACK GHOST IGNORING PARENT RETURN VALUE
/obj/structure/spirit_board/attack_ghost(mob/dead/observer/user)
spirit_board_pick_letter(user)
return ..()
/obj/structure/spirit_board/proc/spirit_board_pick_letter(mob/M)
if(!spirit_board_checks(M))
+6 -3
View File
@@ -35,6 +35,9 @@
return ..()
/obj/structure/statue/attack_hand(mob/living/user)
. = ..()
if(.)
return
user.changeNext_move(CLICK_CD_MELEE)
add_fingerprint(user)
user.visible_message("[user] rubs some dust off from the [name]'s surface.", \
@@ -80,11 +83,11 @@
/obj/structure/statue/uranium/attack_hand(mob/user)
radiate()
..()
. = ..()
/obj/structure/statue/uranium/attack_paw(mob/user)
radiate()
..()
. = ..()
/obj/structure/statue/uranium/proc/radiate()
if(!active)
@@ -239,7 +242,7 @@
/obj/structure/statue/bananium/attack_hand(mob/user)
honk()
..()
. = ..()
/obj/structure/statue/bananium/attack_paw(mob/user)
honk()
+6 -6
View File
@@ -57,7 +57,7 @@
new /obj/structure/table/reinforced/brass(A)
/obj/structure/table/attack_paw(mob/user)
attack_hand(user)
return attack_hand(user)
/obj/structure/table/attack_hand(mob/living/user)
if(Adjacent(user) && user.pulling && isliving(user.pulling))
@@ -78,8 +78,7 @@
else
return
user.stop_pulling()
else
..()
return ..()
/obj/structure/table/attack_tk()
return FALSE
@@ -138,7 +137,6 @@
if(T.contents.len > 0) // If the tray isn't empty
var/list/obj/item/oldContents = T.contents.Copy()
T.quick_empty()
for(var/obj/item/C in oldContents)
C.forceMove(drop_location())
@@ -475,6 +473,7 @@
. = . || (mover.pass_flags & PASSTABLE)
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
. = ..()
if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))
return
if(!user.dropItemToGround(O))
@@ -482,7 +481,6 @@
if(O.loc != src.loc)
step(O, get_dir(O, src))
/obj/structure/rack/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
W.play_tool_sound(src)
@@ -497,6 +495,9 @@
attack_hand(user)
/obj/structure/rack/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(user.IsKnockdown() || user.resting || user.lying || user.get_num_legs() < 2)
return
user.changeNext_move(CLICK_CD_MELEE)
@@ -504,7 +505,6 @@
user.visible_message("<span class='danger'>[user] kicks [src].</span>", null, null, COMBAT_MESSAGE_RANGE)
take_damage(rand(4,8), BRUTE, "melee", 1)
/obj/structure/rack/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
@@ -49,6 +49,9 @@
to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
/obj/structure/target_stake/attack_hand(mob/user)
. = ..()
if(.)
return
if(pinned_target)
removeTarget(user)
@@ -59,6 +59,9 @@
/obj/structure/transit_tube/station/attack_hand(mob/user)
. = ..()
if(.)
return
if(!pod_moving)
if(user.pulling && user.a_intent == INTENT_GRAB && isliving(user.pulling))
if(open_status == STATION_TUBE_OPEN)
+17 -4
View File
@@ -18,6 +18,9 @@
/obj/structure/toilet/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(swirlie)
user.changeNext_move(CLICK_CD_MELEE)
playsound(src.loc, "swing_hit", 25, 1)
@@ -133,6 +136,9 @@
hiddenitem = new /obj/item/reagent_containers/food/urinalcake
/obj/structure/urinal/attack_hand(mob/user)
. = ..()
if(.)
return
if(user.pulling && user.a_intent == INTENT_GRAB && isliving(user.pulling))
var/mob/living/GM = user.pulling
if(user.grab_state >= GRAB_AGGRESSIVE)
@@ -228,8 +234,10 @@
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/machinery/shower/attack_hand(mob/M)
. = ..()
if(.)
return
on = !on
update_icon()
add_fingerprint(M)
@@ -249,7 +257,6 @@
var/turf/open/tile = loc
tile.MakeSlippery(TURF_WET_WATER, min_wet_time = 5 SECONDS, wet_time_to_add = 1 SECONDS)
/obj/machinery/shower/attackby(obj/item/I, mob/user, params)
if(I.type == /obj/item/device/analyzer)
to_chat(user, "<span class='notice'>The water temperature seems to be [watertemp].</span>")
@@ -452,6 +459,9 @@
/obj/structure/sink/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(!user || !istype(user))
return
if(!iscarbon(user))
@@ -571,9 +581,10 @@
icon_state = "puddle"
resistance_flags = UNACIDABLE
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/sink/puddle/attack_hand(mob/M)
icon_state = "puddle-splash"
..()
. = ..()
icon_state = "puddle"
/obj/structure/sink/puddle/attackby(obj/item/O, mob/user, params)
@@ -643,9 +654,11 @@
/obj/structure/curtain/attack_hand(mob/user)
. = ..()
if(.)
return
playsound(loc, 'sound/effects/curtain.ogg', 50, 1)
toggle()
..()
/obj/structure/curtain/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/cloth (loc, 2)
+6 -1
View File
@@ -157,6 +157,9 @@
. = ..()
/obj/structure/window/attack_hand(mob/user)
. = ..()
if(.)
return
if(!can_be_reached(user))
return
user.changeNext_move(CLICK_CD_MELEE)
@@ -167,7 +170,6 @@
/obj/structure/window/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/window/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1) //used by attack_alien, attack_animal, and attack_slime
if(!can_be_reached(user))
return
@@ -699,6 +701,9 @@
update_icon()
/obj/structure/window/paperframe/attack_hand(mob/user)
. = ..()
if(.)
return
add_fingerprint(user)
if(user.a_intent != INTENT_HARM)
user.changeNext_move(CLICK_CD_MELEE)