mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
Attack chain, initial setup. (pull *immediately* for *any* TM issues) (#26834)
* refactor: Attack chain, initial setup. * migrate curtain to make dreamchecker happy * update thurible * don't call attacked_by separately for legacy attack chain * remove duplicate proc * condense similar code, put allowances for legacy code in new procs * update docs, include diagram source * add comment on how to update diagram * fix admonition * mindflayer updates * remove commented out code * clarify all steps * after_attack should be overridable * whoops * retrofit recent changes * duh, can't restrict this yet because of tool_acts * i hate ore bags with the fire of a thousand suns * return correct value for object attack logic * Various cleanups. We don't want to attempt to pull stuff out of `/obj/item/attackby`, because those pieces are part of the related objects' migrations, not `/obj/item` itself. Attempting to do this causes knockon effects where things expected to call e.g. `/obj/item/storage/attackby` in the call chain were not ferried over to the new item interaction code, because the related objects hadn't actually been migrated over yet. I've used refactoring /obj/vehicle as the example for migrating `attackby` methods instead. * simplify some argument names * fuck it * make it do the thing * Rename CI module call * Prove that CI works * improve test output * aaand fix it again * fix curtain tool interactions * fix compile error * fix compile error * Better docs, introduce migration plan tool.
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
. = ..()
|
||||
. += extended_desc
|
||||
|
||||
/obj/item/mmi/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
/obj/item/mmi/attackby__legacy__attackchain(obj/item/O as obj, mob/user as mob, params)
|
||||
if(istype(O, /obj/item/organ/internal/brain/golem))
|
||||
to_chat(user, "<span class='warning'>You can't find a way to plug [O] into [src].</span>")
|
||||
return
|
||||
@@ -126,7 +126,7 @@
|
||||
"<span class='notice'>You uninstall the radio from [src].</span>")
|
||||
|
||||
|
||||
/obj/item/mmi/attack_self(mob/user as mob)
|
||||
/obj/item/mmi/attack_self__legacy__attackchain(mob/user as mob)
|
||||
if(!brainmob)
|
||||
to_chat(user, "<span class='warning'>You upend the MMI, but there's nothing in it.</span>")
|
||||
else
|
||||
@@ -307,7 +307,7 @@
|
||||
Whilst these specialty MMIs are rarely used owing to the far greater applicability and convenience of the mindslave implant, they do see occasional employment by undercover agents that wish to stealthily convert the AI-slaved cyborgs of Nanotrasen. \
|
||||
Just like the mindslave implant, these are extremely illegal in most regions of space. Simple possession (to say nothing of actual use) generally warrants a very long prison sentence."
|
||||
|
||||
/obj/item/mmi/syndie/attackby(obj/item/O, mob/user, params)
|
||||
/obj/item/mmi/syndie/attackby__legacy__attackchain(obj/item/O, mob/user, params)
|
||||
if(!master_uid && ishuman(user) && user.mind && istype(O,/obj/item/organ/internal/brain))
|
||||
to_chat(user, "<span class='notice'>You press your thumb on [src] and imprint your user information.</span>")
|
||||
master_uid = user.mind.UID()
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
imprinted_master = null
|
||||
return ..()
|
||||
|
||||
/obj/item/mmi/robotic_brain/attack_self(mob/user)
|
||||
/obj/item/mmi/robotic_brain/attack_self__legacy__attackchain(mob/user)
|
||||
if(isgolem(user))
|
||||
to_chat(user, "<span class='warning'>Your golem fingers are too large to press the switch on [src].</span>")
|
||||
return
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
if(obj_integrity < 90)
|
||||
Die()
|
||||
|
||||
/obj/item/clothing/mask/facehugger/attackby(obj/item/O, mob/user, params)
|
||||
return O.attack_obj(src, user, params)
|
||||
/obj/item/clothing/mask/facehugger/attackby__legacy__attackchain(obj/item/O, mob/user, params)
|
||||
return O.attack_obj__legacy__attackchain(src, user, params)
|
||||
|
||||
/obj/item/clothing/mask/facehugger/attack_hand(mob/user)
|
||||
if((stat != DEAD && !sterile) && !isalien(user))
|
||||
@@ -43,7 +43,7 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/clothing/mask/facehugger/attack(mob/living/M, mob/user)
|
||||
/obj/item/clothing/mask/facehugger/attack__legacy__attackchain(mob/living/M, mob/user)
|
||||
..()
|
||||
user.unEquip(src)
|
||||
Attach(M)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
if(volume > 10) // Anything over 10 volume will make the mob wetter.
|
||||
wetlevel = min(wetlevel + 1,5)
|
||||
|
||||
/mob/living/carbon/attackby(obj/item/I, mob/user, params)
|
||||
/mob/living/carbon/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(length(surgeries))
|
||||
if(user.a_intent == INTENT_HELP)
|
||||
for(var/datum/surgery/S in surgeries)
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
visible_message("<span class='warning'>[src] points [held_gun] towards [possible_target]!</span>")
|
||||
return
|
||||
// for his neutral special, he wields a Gun
|
||||
held_gun.afterattack(possible_target, src)
|
||||
held_gun.afterattack__legacy__attackchain(possible_target, src)
|
||||
visible_message("<span class='danger'>[src] fires [held_gun][isturf(possible_target) ? "" : " towards [possible_target]!"]</span>")
|
||||
|
||||
/mob/living/carbon/human/proc/dchat_step(dir)
|
||||
|
||||
@@ -466,7 +466,7 @@ emp_act
|
||||
return ..()
|
||||
|
||||
//Returns TRUE if the attack hit, FALSE if it missed.
|
||||
/mob/living/carbon/human/attacked_by(obj/item/I, mob/living/user, def_zone)
|
||||
/mob/living/carbon/human/attacked_by__legacy__attackchain(obj/item/I, mob/living/user, def_zone)
|
||||
if(!I || !user)
|
||||
return FALSE
|
||||
|
||||
@@ -819,7 +819,7 @@ emp_act
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/attackby(obj/item/I, mob/user, params)
|
||||
/mob/living/carbon/human/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(SEND_SIGNAL(src, COMSIG_HUMAN_ATTACKED, user) & COMPONENT_CANCEL_ATTACK_CHAIN)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
@@ -335,7 +335,7 @@
|
||||
I.forceMove(back)
|
||||
if(ITEM_SLOT_ACCESSORY)
|
||||
var/obj/item/clothing/under/uniform = src.w_uniform
|
||||
uniform.attackby(I, src)
|
||||
uniform.attackby__legacy__attackchain(I, src)
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>")
|
||||
|
||||
|
||||
@@ -575,7 +575,7 @@
|
||||
target.visible_message("<span class='danger'>[user] has knocked down [target]!</span>", \
|
||||
"<span class='userdanger'>[user] has knocked down [target]!</span>")
|
||||
target.KnockDown(4 SECONDS)
|
||||
SEND_SIGNAL(target, COMSIG_PARENT_ATTACKBY)
|
||||
SEND_SIGNAL(target, COMSIG_ATTACK_BY)
|
||||
|
||||
/datum/species/proc/disarm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
|
||||
if(user == target)
|
||||
|
||||
@@ -758,7 +758,7 @@
|
||||
cloth_golem = null
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/cloth_pile/attackby(obj/item/P, mob/living/carbon/human/user, params)
|
||||
/obj/structure/cloth_pile/attackby__legacy__attackchain(obj/item/P, mob/living/carbon/human/user, params)
|
||||
. = ..()
|
||||
|
||||
if(resistance_flags & ON_FIRE)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
mobility_flags = 0
|
||||
a_intent = INTENT_HARM // This is apparently the only thing that stops other mobs walking through them as if they were thin air.
|
||||
|
||||
/mob/living/silicon/decoy/attackby(obj/item/W, mob/user, params)
|
||||
/mob/living/silicon/decoy/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/aicard))
|
||||
to_chat(user, "<span class='warning'>You cannot find an intellicard slot on [src].</span>")
|
||||
return TRUE
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
update_icons()
|
||||
|
||||
//Overriding this will stop a number of headaches down the track.
|
||||
/mob/living/silicon/pai/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
/mob/living/silicon/pai/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/stack/nanopaste))
|
||||
var/obj/item/stack/nanopaste/N = W
|
||||
if(stat == DEAD)
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
"wood" = 0
|
||||
)
|
||||
|
||||
/obj/item/matter_decompiler/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
/obj/item/matter_decompiler/attack__legacy__attackchain(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/matter_decompiler/afterattack(atom/target, mob/living/user, proximity, params)
|
||||
/obj/item/matter_decompiler/afterattack__legacy__attackchain(atom/target, mob/living/user, proximity, params)
|
||||
if(!proximity)
|
||||
return // Not adjacent.
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
. += "<span class='notice'><i>The ever-loyal workers of Nanotrasen facilities. Known for their small and cute look, these drones seek only to repair damaged parts of the station, being lawed against hurting even a spiderling. These fine drones are programmed against interfering with any business of anyone, so they won't do anything you don't want them to.</i></span>"
|
||||
|
||||
//Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..().
|
||||
/mob/living/silicon/robot/drone/attackby(obj/item/I, mob/user, params)
|
||||
/mob/living/silicon/robot/drone/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/borg/upgrade))
|
||||
to_chat(user, "<span class='warning'>The maintenance drone chassis is not compatible with [I].</span>")
|
||||
return
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
name = "Printing Pen"
|
||||
var/mode = 1
|
||||
|
||||
/obj/item/pen/multi/robopen/attack_self(mob/user as mob)
|
||||
/obj/item/pen/multi/robopen/attack_self__legacy__attackchain(mob/user as mob)
|
||||
var/choice = tgui_input_list(user, "Would you like to change colour or mode?", name, list("Colour","Mode"))
|
||||
if(!choice)
|
||||
return
|
||||
@@ -45,10 +45,10 @@
|
||||
icon_state = "paper_bin1"
|
||||
item_state = "sheet-metal"
|
||||
|
||||
/obj/item/form_printer/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
/obj/item/form_printer/attack__legacy__attackchain(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/form_printer/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
|
||||
/obj/item/form_printer/afterattack__legacy__attackchain(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
|
||||
|
||||
if(!target || !flag)
|
||||
return
|
||||
@@ -56,7 +56,7 @@
|
||||
if(istype(target,/obj/structure/table))
|
||||
deploy_paper(get_turf(target))
|
||||
|
||||
/obj/item/form_printer/attack_self(mob/user as mob)
|
||||
/obj/item/form_printer/attack_self__legacy__attackchain(mob/user as mob)
|
||||
deploy_paper(get_turf(src))
|
||||
|
||||
/obj/item/form_printer/proc/deploy_paper(turf/T)
|
||||
|
||||
@@ -920,7 +920,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
return 2
|
||||
|
||||
|
||||
/mob/living/silicon/robot/attackby(obj/item/W, mob/user, params)
|
||||
/mob/living/silicon/robot/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
// Check if the user is trying to insert another component like a radio, actuator, armor etc.
|
||||
if(istype(W, /obj/item/robot_parts/robot_component) && opened)
|
||||
for(var/V in components)
|
||||
@@ -978,7 +978,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
|
||||
else if(istype(W, /obj/item/encryptionkey/) && opened)
|
||||
if(radio)//sanityyyyyy
|
||||
radio.attackby(W,user)//GTFO, you have your own procs
|
||||
radio.attackby__legacy__attackchain(W,user)//GTFO, you have your own procs
|
||||
else
|
||||
to_chat(user, "Unable to locate a radio.")
|
||||
|
||||
@@ -1132,7 +1132,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/robot/attacked_by(obj/item/I, mob/living/user, def_zone)
|
||||
/mob/living/silicon/robot/attacked_by__legacy__attackchain(obj/item/I, mob/living/user, def_zone)
|
||||
if(I.force && I.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt.
|
||||
spark_system.start()
|
||||
..()
|
||||
@@ -1303,7 +1303,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
if(href_list["mod"])
|
||||
var/obj/item/O = locate(href_list["mod"])
|
||||
if(istype(O) && (O.loc == src))
|
||||
O.attack_self(src)
|
||||
O.attack_self__legacy__attackchain(src)
|
||||
return 1
|
||||
|
||||
if(href_list["act"])
|
||||
@@ -1456,7 +1456,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
|
||||
var/obj/item/W = get_active_hand()
|
||||
if(W)
|
||||
W.attack_self(src)
|
||||
W.attack_self__legacy__attackchain(src)
|
||||
|
||||
/mob/living/silicon/robot/proc/SetLockdown(state = TRUE)
|
||||
// They stay locked down if their wire is cut.
|
||||
|
||||
@@ -415,7 +415,7 @@
|
||||
process_chamber()
|
||||
|
||||
//Cannot manually remove syringes
|
||||
/obj/item/gun/syringemalf/attack_self(mob/living/user)
|
||||
/obj/item/gun/syringemalf/attack_self__legacy__attackchain(mob/living/user)
|
||||
return
|
||||
|
||||
//Load syringe into the chamber
|
||||
@@ -601,7 +601,7 @@
|
||||
attack_verb = list("smashed", "slammed", "whacked", "thwacked", "swept")
|
||||
force = 20
|
||||
|
||||
/obj/item/malfbroom/attack(mob/target, mob/user)
|
||||
/obj/item/malfbroom/attack__legacy__attackchain(mob/target, mob/user)
|
||||
if(!ishuman(target))
|
||||
return ..()
|
||||
var/mob/living/carbon/human/H = target
|
||||
|
||||
@@ -111,9 +111,9 @@
|
||||
if(!cham_proj)
|
||||
to_chat(src, "<span class='warning'>Error : No chameleon projector system found.</span>")
|
||||
return
|
||||
cham_proj.attack_self(src)
|
||||
cham_proj.attack_self__legacy__attackchain(src)
|
||||
|
||||
/mob/living/silicon/robot/syndicate/saboteur/attackby()
|
||||
/mob/living/silicon/robot/syndicate/saboteur/attackby__legacy__attackchain()
|
||||
if(cham_proj)
|
||||
cham_proj.disrupt(src)
|
||||
..()
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/attacked_by(obj/item/I, mob/living/user, def_zone)
|
||||
/mob/living/silicon/attacked_by__legacy__attackchain(obj/item/I, mob/living/user, def_zone)
|
||||
if(istype(I, /obj/item/clothing/head) && user.a_intent == INTENT_HELP)
|
||||
place_on_head(user.get_active_hand(), user)
|
||||
return TRUE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/simple_animal/attackby(obj/item/O, mob/living/user)
|
||||
/mob/living/simple_animal/attackby__legacy__attackchain(obj/item/O, mob/living/user)
|
||||
if(can_collar && istype(O, /obj/item/petcollar) && !pcollar)
|
||||
add_collar(O, user)
|
||||
return
|
||||
|
||||
@@ -395,7 +395,7 @@
|
||||
/mob/living/simple_animal/bot/proc/interact(mob/user)
|
||||
show_controls(user)
|
||||
|
||||
/mob/living/simple_animal/bot/attackby(obj/item/W, mob/user, params)
|
||||
/mob/living/simple_animal/bot/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/card/id) || istype(W, /obj/item/pda))
|
||||
if(allowed(user) && !open && !emagged)
|
||||
locked = !locked
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
var/created_name = "Cleanbot"
|
||||
var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
|
||||
/obj/item/bucket_sensor/attackby(obj/item/W, mob/user as mob, params)
|
||||
/obj/item/bucket_sensor/attackby__legacy__attackchain(obj/item/W, mob/user as mob, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
|
||||
if(!user.unEquip(W))
|
||||
@@ -49,7 +49,7 @@
|
||||
var/lasercolor = ""
|
||||
var/new_name = ""
|
||||
|
||||
/obj/item/ed209_assembly/attackby(obj/item/W, mob/user, params)
|
||||
/obj/item/ed209_assembly/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
..()
|
||||
|
||||
if(is_pen(W))
|
||||
@@ -248,7 +248,7 @@
|
||||
desc = "It's a toolbox with tiles sticking out the top and a sensor attached."
|
||||
icon_state = "toolbox_tiles_sensor"
|
||||
|
||||
/obj/item/storage/toolbox/attackby(obj/item/stack/tile/plasteel/T, mob/user, params)
|
||||
/obj/item/storage/toolbox/attackby__legacy__attackchain(obj/item/stack/tile/plasteel/T, mob/user, params)
|
||||
if(!istype(T, /obj/item/stack/tile/plasteel))
|
||||
..()
|
||||
return
|
||||
@@ -289,7 +289,7 @@
|
||||
/obj/item/toolbox_tiles/update_icon_state()
|
||||
icon_state = "[toolbox_color]toolbox_tiles"
|
||||
|
||||
/obj/item/toolbox_tiles/attackby(obj/item/W, mob/user, params)
|
||||
/obj/item/toolbox_tiles/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(isprox(W))
|
||||
qdel(W)
|
||||
@@ -313,7 +313,7 @@
|
||||
/obj/item/toolbox_tiles/sensor/update_icon_state()
|
||||
icon_state = "[toolbox_color]toolbox_tiles_sensor"
|
||||
|
||||
/obj/item/toolbox_tiles/sensor/attackby(obj/item/W, mob/user, params)
|
||||
/obj/item/toolbox_tiles/sensor/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
|
||||
qdel(W)
|
||||
@@ -325,7 +325,7 @@
|
||||
qdel(src)
|
||||
|
||||
//Medbot Assembly
|
||||
/obj/item/storage/firstaid/attackby(obj/item/I, mob/user, params)
|
||||
/obj/item/storage/firstaid/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(!istype(I, /obj/item/robot_parts/l_arm) && !istype(I, /obj/item/robot_parts/r_arm))
|
||||
return ..()
|
||||
else
|
||||
@@ -383,7 +383,7 @@
|
||||
if(build_step > 0)
|
||||
. += "na_scanner"
|
||||
|
||||
/obj/item/firstaid_arm_assembly/attackby(obj/item/I, mob/user, params)
|
||||
/obj/item/firstaid_arm_assembly/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(is_pen(I))
|
||||
var/t = rename_interactive(user, I, prompt = "Enter new robot name")
|
||||
@@ -442,7 +442,7 @@
|
||||
var/build_step = 0
|
||||
var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
|
||||
/obj/item/clothing/head/helmet/attackby(obj/item/assembly/signaler/S, mob/user, params)
|
||||
/obj/item/clothing/head/helmet/attackby__legacy__attackchain(obj/item/assembly/signaler/S, mob/user, params)
|
||||
..()
|
||||
if(!issignaler(S))
|
||||
..()
|
||||
@@ -459,7 +459,7 @@
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/item/secbot_assembly/attackby(obj/item/I, mob/user, params)
|
||||
/obj/item/secbot_assembly/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_WELDER && I.use_tool(src, user, volume = I.tool_volume))
|
||||
if(!build_step)
|
||||
@@ -564,7 +564,7 @@
|
||||
var/build_step = 0
|
||||
var/toy_step = 0
|
||||
|
||||
/obj/item/griefsky_assembly/attackby(obj/item/I, mob/user, params)
|
||||
/obj/item/griefsky_assembly/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if((istype(I, /obj/item/melee/energy/sword)) && (build_step < 3))
|
||||
if(!user.unEquip(I))
|
||||
@@ -612,7 +612,7 @@
|
||||
return TRUE
|
||||
|
||||
//Honkbot Assembly
|
||||
/obj/item/storage/box/clown/attackby(obj/item/W, mob/user, params)
|
||||
/obj/item/storage/box/clown/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
if(!istype(W, /obj/item/robot_parts/l_arm) && !istype(W, /obj/item/robot_parts/r_arm))
|
||||
return ..()
|
||||
else
|
||||
@@ -640,7 +640,7 @@
|
||||
var/created_name = "Honkbot" //To preserve the name if it's a unique medbot I guess
|
||||
var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
|
||||
/obj/item/honkbot_arm_assembly/attackby(obj/item/W, mob/user, params)
|
||||
/obj/item/honkbot_arm_assembly/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(build_step == 0)
|
||||
if(istype(W, /obj/item/assembly/prox_sensor))
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
text_dehack = "[name]'s software has been reset!"
|
||||
text_dehack_fail = "[name] does not seem to respond to your repair code!"
|
||||
|
||||
/mob/living/simple_animal/bot/cleanbot/attackby(obj/item/W, mob/user, params)
|
||||
/mob/living/simple_animal/bot/cleanbot/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/card/id)||istype(W, /obj/item/pda))
|
||||
if(allowed(user) && !open && !emagged)
|
||||
locked = !locked
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
retaliate(H)
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/bot/ed209/attackby(obj/item/W, mob/user, params)
|
||||
/mob/living/simple_animal/bot/ed209/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(W.force && !target && W.damtype != STAMINA)
|
||||
retaliate(user)
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
if("ejectpai")
|
||||
ejectpai()
|
||||
|
||||
/mob/living/simple_animal/bot/floorbot/attackby(obj/item/W , mob/user, params)
|
||||
/mob/living/simple_animal/bot/floorbot/attackby__legacy__attackchain(obj/item/W , mob/user, params)
|
||||
if(istype(W, /obj/item/stack/tile/plasteel))
|
||||
var/obj/item/stack/tile/plasteel/T = W
|
||||
if(amount >= MAX_AMOUNT)
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/griefsky/attackby(obj/item/W, mob/user, params) //cant touch or attack him while spinning
|
||||
/mob/living/simple_animal/bot/secbot/griefsky/attackby__legacy__attackchain(obj/item/W, mob/user, params) //cant touch or attack him while spinning
|
||||
if(src.icon_state == spin_icon)
|
||||
if(prob(block_chance_melee))
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
addtimer(CALLBACK(src, PROC_REF(react_buzz)), 5)
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/bot/honkbot/attackby(obj/item/W, mob/user, params)
|
||||
/mob/living/simple_animal/bot/honkbot/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
|
||||
return
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
reagent_glass.forceMove(get_turf(src))
|
||||
reagent_glass = null
|
||||
|
||||
/mob/living/simple_animal/bot/medbot/attackby(obj/item/W, mob/user, params)
|
||||
/mob/living/simple_animal/bot/medbot/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/reagent_containers/glass))
|
||||
. = TRUE //no afterattack
|
||||
if(locked)
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
..()
|
||||
reached_target = 0
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/attackby(obj/item/I, mob/user, params)
|
||||
/mob/living/simple_animal/bot/mulebot/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(istype(I,/obj/item/stock_parts/cell) && open && !cell)
|
||||
if(!user.drop_item())
|
||||
return
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
retaliate(H)
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/attackby(obj/item/W, mob/user, params)
|
||||
/mob/living/simple_animal/bot/secbot/attackby__legacy__attackchain(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(W.force && !target && W.damtype != STAMINA)
|
||||
retaliate(user)
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/RangedAttack(atom/A, params)
|
||||
if(inventory_back)
|
||||
inventory_back.afterattack(A, src)
|
||||
inventory_back.afterattack__legacy__attackchain(A, src)
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/UnarmedAttack(atom/A)
|
||||
if(istype(inventory_back, /obj/item/extinguisher))
|
||||
@@ -184,7 +184,7 @@
|
||||
armorval += inventory_back.armor.getRating(type)
|
||||
return armorval * 0.5
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/attackby(obj/item/O, mob/user, params)
|
||||
/mob/living/simple_animal/pet/dog/corgi/attackby__legacy__attackchain(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/razor))
|
||||
if(shaved)
|
||||
to_chat(user, "<span class='warning'>You can't shave this corgi, it's already been shaved!</span>")
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
if(stat == CONSCIOUS)
|
||||
eat_plants()
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/attackby__legacy__attackchain(obj/item/O as obj, mob/user as mob, params)
|
||||
if(stat == CONSCIOUS && istype(O, /obj/item/reagent_containers/glass))
|
||||
udder.milkAnimal(O, user)
|
||||
else
|
||||
@@ -146,7 +146,7 @@
|
||||
QDEL_NULL(udder)
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/cow/attackby(obj/item/O, mob/user, params)
|
||||
/mob/living/simple_animal/cow/attackby__legacy__attackchain(obj/item/O, mob/user, params)
|
||||
if(stat == CONSCIOUS && istype(O, /obj/item/reagent_containers/glass))
|
||||
udder.milkAnimal(O, user)
|
||||
return TRUE
|
||||
@@ -314,7 +314,7 @@ GLOBAL_VAR_INIT(chicken_count, 0)
|
||||
return
|
||||
GLOB.chicken_count -= 1
|
||||
|
||||
/mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params)
|
||||
/mob/living/simple_animal/chicken/attackby__legacy__attackchain(obj/item/O, mob/user, params)
|
||||
if(istype(O, food_type)) //feedin' dem chickens
|
||||
if(stat == CONSCIOUS && eggsleft < 8)
|
||||
var/feedmsg = "[user] feeds [O] to [name]! [pick(feedMessages)]"
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
else
|
||||
get_scooped(M)
|
||||
|
||||
/mob/living/simple_animal/nian_caterpillar/attacked_by(obj/item/I, mob/living/user, def_zone)
|
||||
/mob/living/simple_animal/nian_caterpillar/attacked_by__legacy__attackchain(obj/item/I, mob/living/user, def_zone)
|
||||
if(istype(I, /obj/item/melee/flyswatter) && I.force)
|
||||
gib() // Commit die.
|
||||
else
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
speed = 0 // same speed as a person.
|
||||
hud_type = /datum/hud/corgi
|
||||
|
||||
/mob/living/simple_animal/pet/attackby(obj/item/O, mob/user, params)
|
||||
/mob/living/simple_animal/pet/attackby__legacy__attackchain(obj/item/O, mob/user, params)
|
||||
if(!istype(O, /obj/item/newspaper))
|
||||
return ..()
|
||||
var/obj/item/newspaper/paper = O
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
eject_brain()
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/spiderbot/attackby(obj/item/O, mob/living/user, params)
|
||||
/mob/living/simple_animal/spiderbot/attackby__legacy__attackchain(obj/item/O, mob/living/user, params)
|
||||
if(istype(O, /obj/item/mmi))
|
||||
var/obj/item/mmi/B = O
|
||||
if(mmi) //There's already a brain in it.
|
||||
|
||||
@@ -286,7 +286,7 @@
|
||||
var/mob/living/simple_animal/hostile/poison/bees/queen/queen
|
||||
|
||||
|
||||
/obj/item/queen_bee/attackby(obj/item/I, mob/user, params)
|
||||
/obj/item/queen_bee/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(!istype(I, /obj/item/reagent_containers/syringe))
|
||||
return ..()
|
||||
var/obj/item/reagent_containers/syringe/S = I
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/simple_animal/hostile/hellhound/attackby(obj/item/C, mob/user, params)
|
||||
/mob/living/simple_animal/hostile/hellhound/attackby__legacy__attackchain(obj/item/C, mob/user, params)
|
||||
. = ..()
|
||||
if(target && isliving(target))
|
||||
var/mob/living/L = target
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
Move(get_step(src, chosen_dir))
|
||||
face_atom(target) //Looks better if they keep looking at you when dodging
|
||||
|
||||
/mob/living/simple_animal/hostile/attacked_by(obj/item/I, mob/living/user)
|
||||
/mob/living/simple_animal/hostile/attacked_by__legacy__attackchain(obj/item/I, mob/living/user)
|
||||
if(stat == CONSCIOUS && !target && AIStatus != AI_OFF && !client && user)
|
||||
FindTarget(list(user), 1)
|
||||
return ..()
|
||||
|
||||
@@ -344,7 +344,7 @@ Difficulty: Hard
|
||||
if(P.damage)
|
||||
disable_shield()
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/ancient_robot/attacked_by(obj/item/I, mob/living/user)
|
||||
/mob/living/simple_animal/hostile/megafauna/ancient_robot/attacked_by__legacy__attackchain(obj/item/I, mob/living/user)
|
||||
if(!body_shield_enabled)
|
||||
return ..()
|
||||
do_sparks(2, 1, src)
|
||||
|
||||
@@ -116,7 +116,7 @@ Difficulty: Medium
|
||||
force = 6
|
||||
force_on = 10
|
||||
|
||||
/obj/item/melee/energy/cleaving_saw/miner/attack(mob/living/target, mob/living/carbon/human/user)
|
||||
/obj/item/melee/energy/cleaving_saw/miner/attack__legacy__attackchain(mob/living/target, mob/living/carbon/human/user)
|
||||
target.add_stun_absorption("miner", 10, INFINITY)
|
||||
..()
|
||||
target.remove_stun_absorption("miner")
|
||||
|
||||
@@ -784,7 +784,7 @@ Difficulty: Hard
|
||||
/obj/effect/hierophant/ex_act()
|
||||
return
|
||||
|
||||
/obj/effect/hierophant/attackby(obj/item/I, mob/user, params)
|
||||
/obj/effect/hierophant/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/hierophant_club))
|
||||
var/obj/item/hierophant_club/H = I
|
||||
if(H.timer > world.time)
|
||||
|
||||
@@ -297,7 +297,7 @@ While using this makes the system rely on OnFire, it still gives options for tim
|
||||
var/obj/effect/temp_visual/heal/H = new /obj/effect/temp_visual/heal(get_turf(mychild))
|
||||
H.color = "#FF0000"
|
||||
|
||||
/obj/structure/elite_tumor/attackby(obj/item/attacking_item, mob/user, params)
|
||||
/obj/structure/elite_tumor/attackby__legacy__attackchain(obj/item/attacking_item, mob/user, params)
|
||||
. = ..()
|
||||
if(istype(attacking_item, /obj/item/organ/internal/regenerative_core) && activity == TUMOR_INACTIVE && !boosted)
|
||||
var/obj/item/organ/internal/regenerative_core/core = attacking_item
|
||||
@@ -425,7 +425,7 @@ While using this makes the system rely on OnFire, it still gives options for tim
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
|
||||
/obj/item/tumor_shard/afterattack(atom/target, mob/user, proximity_flag)
|
||||
/obj/item/tumor_shard/afterattack__legacy__attackchain(atom/target, mob/user, proximity_flag)
|
||||
. = ..()
|
||||
if(istype(target, /mob/living/simple_animal/hostile/asteroid/elite) && proximity_flag)
|
||||
var/mob/living/simple_animal/hostile/asteroid/elite/E = target
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
if(prob(bonus_value) && target.stat != DEAD)
|
||||
new /obj/effect/temp_visual/goliath_tentacle/broodmother/patch(get_turf(target), user)
|
||||
|
||||
/obj/item/crusher_trophy/broodmother_tongue/attack_self(mob/user)
|
||||
/obj/item/crusher_trophy/broodmother_tongue/attack_self__legacy__attackchain(mob/user)
|
||||
if(!isliving(user))
|
||||
return
|
||||
var/mob/living/living_user = user
|
||||
|
||||
@@ -337,7 +337,7 @@
|
||||
A.friends += user
|
||||
A.faction = user.faction.Copy()
|
||||
|
||||
/obj/item/crusher_trophy/legionnaire_spine/attack_self(mob/user)
|
||||
/obj/item/crusher_trophy/legionnaire_spine/attack_self__legacy__attackchain(mob/user)
|
||||
if(!isliving(user))
|
||||
return
|
||||
var/mob/living/LivingUser = user
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
animal_species = /mob/living/simple_animal/hostile/asteroid/gutlunch
|
||||
childtype = list(/mob/living/simple_animal/hostile/asteroid/gutlunch/grublunch = 100)
|
||||
|
||||
wanted_objects = list(/obj/effect/decal/cleanable/blood/gibs, /obj/item/organ/internal/eyes,
|
||||
/obj/item/organ/internal/heart, /obj/item/organ/internal/lungs,
|
||||
/obj/item/organ/internal/liver, /obj/item/organ/internal/kidneys,
|
||||
wanted_objects = list(/obj/effect/decal/cleanable/blood/gibs, /obj/item/organ/internal/eyes,
|
||||
/obj/item/organ/internal/heart, /obj/item/organ/internal/lungs,
|
||||
/obj/item/organ/internal/liver, /obj/item/organ/internal/kidneys,
|
||||
/obj/item/organ/internal/appendix)
|
||||
var/obj/item/udder/gutlunch/udder = null
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
if(udder.reagents.total_volume == udder.reagents.maximum_volume)
|
||||
add_overlay("gl_full")
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/gutlunch/attackby(obj/item/O, mob/user, params)
|
||||
/mob/living/simple_animal/hostile/asteroid/gutlunch/attackby__legacy__attackchain(obj/item/O, mob/user, params)
|
||||
if(stat == CONSCIOUS && istype(O, /obj/item/reagent_containers/glass))
|
||||
udder.milkAnimal(O, user)
|
||||
regenerate_icons()
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
src.visible_message("<span class='notice'>[src] was bruised!</span>")
|
||||
bruised = 1
|
||||
|
||||
/mob/living/simple_animal/hostile/mushroom/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
/mob/living/simple_animal/hostile/mushroom/attackby__legacy__attackchain(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/food/grown/mushroom))
|
||||
if(stat == DEAD && !recovery_cooldown)
|
||||
Recover()
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
var/melee_block_chance = 20
|
||||
var/ranged_block_chance = 35
|
||||
|
||||
/mob/living/simple_animal/hostile/syndicate/melee/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
/mob/living/simple_animal/hostile/syndicate/melee/attackby__legacy__attackchain(obj/item/O as obj, mob/user as mob, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(src)
|
||||
if(O.force)
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
return
|
||||
|
||||
//Mobs with objects
|
||||
/mob/living/simple_animal/parrot/attackby(obj/item/O, mob/user, params)
|
||||
/mob/living/simple_animal/parrot/attackby__legacy__attackchain(obj/item/O, mob/user, params)
|
||||
..()
|
||||
if(stat == CONSCIOUS && !client && !istype(O, /obj/item/stack/medical))
|
||||
if(O.force)
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
name = spirit_name
|
||||
|
||||
if(A == src) // If we're clicking ourself we should not attack ourself.
|
||||
possessed_item.attack_self(src)
|
||||
possessed_item.attack_self__legacy__attackchain(src)
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
set_opacity(possessed_item.opacity)
|
||||
return ..(NONE)
|
||||
|
||||
/mob/living/simple_animal/possessed_object/attackby(obj/item/O, mob/living/user)
|
||||
/mob/living/simple_animal/possessed_object/attackby__legacy__attackchain(obj/item/O, mob/living/user)
|
||||
. = ..()
|
||||
if(istype(O, /obj/item/nullrod))
|
||||
visible_message("<span type='notice'>[O] dispels the spooky aura!</span>")
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
initial_traits = list(TRAIT_FLYING, TRAIT_SHOCKIMMUNE)
|
||||
var/holy = FALSE
|
||||
|
||||
/mob/living/simple_animal/shade/attackby(obj/item/O, mob/user) //Marker -Agouri
|
||||
/mob/living/simple_animal/shade/attackby__legacy__attackchain(obj/item/O, mob/user) //Marker -Agouri
|
||||
if(istype(O, /obj/item/soulstone))
|
||||
var/obj/item/soulstone/SS = O
|
||||
SS.transfer_soul("SHADE", src, user)
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
|
||||
|
||||
|
||||
/mob/living/simple_animal/slime/attackby(obj/item/I, mob/living/user, params)
|
||||
/mob/living/simple_animal/slime/attackby__legacy__attackchain(obj/item/I, mob/living/user, params)
|
||||
if(stat == DEAD && length(surgeries))
|
||||
if(user.a_intent == INTENT_HELP || user.a_intent == INTENT_DISARM)
|
||||
for(var/datum/surgery/S in surgeries)
|
||||
|
||||
@@ -701,12 +701,18 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
if(hand)
|
||||
var/obj/item/W = l_hand
|
||||
if(W)
|
||||
W.attack_self(src)
|
||||
if(W.new_attack_chain)
|
||||
W.activate_self(src)
|
||||
else
|
||||
W.attack_self__legacy__attackchain(src)
|
||||
update_inv_l_hand()
|
||||
else
|
||||
var/obj/item/W = r_hand
|
||||
if(W)
|
||||
W.attack_self(src)
|
||||
if(W.new_attack_chain)
|
||||
W.activate_self(src)
|
||||
else
|
||||
W.attack_self__legacy__attackchain(src)
|
||||
update_inv_r_hand()
|
||||
return
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
adjust_position()
|
||||
|
||||
|
||||
/obj/item/grab/attack_self(mob/user)
|
||||
/obj/item/grab/attack_self__legacy__attackchain(mob/user)
|
||||
s_click(hud)
|
||||
|
||||
//Updating pixelshift, position and direction
|
||||
@@ -370,7 +370,7 @@
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/grab/attack(mob/living/M, mob/living/carbon/user)
|
||||
/obj/item/grab/attack__legacy__attackchain(mob/living/M, mob/living/carbon/user)
|
||||
if(!affecting)
|
||||
return
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/item/holder/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
/obj/item/holder/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params)
|
||||
for(var/mob/M in src.contents)
|
||||
M.attackby(W,user, params)
|
||||
M.attackby__legacy__attackchain(W,user, params)
|
||||
|
||||
/obj/item/holder/proc/show_message(message, m_type, chat_message_type)
|
||||
for(var/mob/living/M in contents)
|
||||
|
||||
Reference in New Issue
Block a user