Refactored the attack proc (#19908)

Refactored the attack proc signature.
Added signals and components for the attack proc.
Added signals and components for the attackby proc.
Adjusted some leftover attackby procs signatures.
Added grep test to ensure people don't keep adding attack/attackby procs
with the wrong signature.
This commit is contained in:
Fluffy
2024-10-06 21:30:00 +00:00
committed by GitHub
parent b79b7c5177
commit 9636363e60
121 changed files with 878 additions and 663 deletions
+8 -8
View File
@@ -137,21 +137,21 @@
qdel(src)
return
/obj/item/pen/crayon/attack(mob/user, var/target_zone)
if(ishuman(user))
var/mob/living/carbon/human/H = user
/obj/item/pen/crayon/attack(mob/living/target_mob, mob/living/user, target_zone)
if(ishuman(target_mob))
var/mob/living/carbon/human/H = target_mob
if(H.check_has_mouth())
user.visible_message(SPAN_NOTICE("[user] takes a bite of their crayon and swallows it."),
target_mob.visible_message(SPAN_NOTICE("[target_mob] takes a bite of their crayon and swallows it."),
SPAN_NOTICE("You take a bite of your crayon and swallow it."))
user.adjustNutritionLoss(-1)
reagents.trans_to_mob(user, 2, CHEM_INGEST)
target_mob.adjustNutritionLoss(-1)
reagents.trans_to_mob(target_mob, 2, CHEM_INGEST)
if(reagents.total_volume <= 0)
user.visible_message(SPAN_NOTICE("[user] finished their crayon!"), SPAN_WARNING("You ate your crayon!"))
target_mob.visible_message(SPAN_NOTICE("[target_mob] finished their crayon!"), SPAN_WARNING("You ate your crayon!"))
qdel(src)
return TRUE
else
..(user, target_zone)
return ..()
/obj/item/pen/crayon/attack_self(var/mob/user)
return
+2 -2
View File
@@ -342,8 +342,8 @@
/obj/item/shockpaddles/proc/checked_use(charge_amt)
return 0
/obj/item/shockpaddles/attack(mob/living/M, mob/living/user, target_zone)
var/mob/living/carbon/human/H = M
/obj/item/shockpaddles/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/H = target_mob
if(!istype(H) || user.a_intent == I_HURT)
return ..() //Do a regular attack. Harm intent shocking happens as a hit effect
+3 -2
View File
@@ -22,8 +22,9 @@
message += SPAN_WARNING("inactive.")
. += message
/obj/item/aicard/attack(mob/living/silicon/decoy/M as mob, mob/user as mob, var/target_zone)
if (!istype (M, /mob/living/silicon/decoy))
/obj/item/aicard/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/silicon/decoy/M = target_mob
if (!istype(M))
return ..()
else
M.death()
+2 -1
View File
@@ -140,7 +140,8 @@
else
return FALSE
/obj/item/auto_cpr/attack(mob/living/carbon/human/H, mob/living/user, var/target_zone)
/obj/item/auto_cpr/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/H = target_mob
if(istype(H) && user.a_intent == I_HELP)
if(panel_open)
to_chat(user, SPAN_WARNING("You must screw \the [src]'s panel closed before fitting it onto anyone!"))
@@ -28,8 +28,8 @@
/obj/item/device/orbital_dropper/attack_self(mob/user)
zoom(user, tileoffset, viewsize)
/obj/item/device/orbital_dropper/attack(mob/living/M, mob/user)
laser_act(M, user)
/obj/item/device/orbital_dropper/attack(mob/living/target_mob, mob/living/user, target_zone)
laser_act(target_mob, user)
/obj/item/device/orbital_dropper/afterattack(var/atom/target, var/mob/living/user, flag, params)
if(flag) //we're placing the targetter on a table or in backpack
+12 -12
View File
@@ -87,22 +87,22 @@
QDEL_IN(animation, 5)
//attack_as_weapon
/obj/item/device/flash/attack(mob/living/L, mob/living/user, target_zone)
/obj/item/device/flash/attack(mob/living/target_mob, mob/living/user, target_zone)
// Single-target flash
if(!L || !user || !clumsy_check(user) || !cooldown())
if(!target_mob || !user || !clumsy_check(user) || !cooldown())
return
if(L == user)
if(target_mob == user)
if(user.a_intent == I_HURT)
attack_self(user)
return
L.attack_log += "\[[time_stamp()]\] <font color='orange'>Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])</font>"
user.attack_log += "\[[time_stamp()]\] <span class='warning'>Used the [src.name] to flash [L.name] ([L.ckey])</span>"
msg_admin_attack("[user.name] ([user.ckey]) Used the [src.name] to flash [L.name] ([L.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)",ckey=key_name(user),ckey_target=key_name(L))
target_mob.attack_log += "\[[time_stamp()]\] <font color='orange'>Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])</font>"
user.attack_log += "\[[time_stamp()]\] <span class='warning'>Used the [src.name] to flash [target_mob.name] ([target_mob.ckey])</span>"
msg_admin_attack("[user.name] ([user.ckey]) Used the [src.name] to flash [target_mob.name] ([target_mob.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)",ckey=key_name(user),ckey_target=key_name(target_mob))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(L)
user.do_attack_animation(target_mob)
if(broken)
to_chat(user, SPAN_WARNING("\The [src] is broken."))
return
@@ -115,13 +115,13 @@
if(isrobot(user))
robot_flash(user)
if(flash(L))
if(issilicon(L))
user.visible_message(SPAN_WARNING("[user] overloads [L]'s sensors with \the [src]!"))
if(flash(target_mob))
if(issilicon(target_mob))
user.visible_message(SPAN_WARNING("[user] overloads [target_mob]'s sensors with \the [src]!"))
else
user.visible_message(SPAN_WARNING("[user] blinds [L] with \the [src]!"))
user.visible_message(SPAN_WARNING("[user] blinds [target_mob] with \the [src]!"))
else
user.visible_message(SPAN_NOTICE("[user] fails to blind [L] with \the [src]."))
user.visible_message(SPAN_NOTICE("[user] fails to blind [target_mob] with \the [src]."))
/obj/item/device/flash/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
// AOE flash
@@ -86,13 +86,13 @@
play_message(SPAN_NOTICE("\The [src] pings, \"Active warrant modified.\""))
/obj/item/device/holowarrant/attack(mob/living/victim, mob/living/user)
/obj/item/device/holowarrant/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!selected_warrant)
to_chat(user, SPAN_WARNING("There are no warrants loaded!"))
return
user.visible_message("<b>[user]</b> holds \the [src] up to \the [victim].", SPAN_NOTICE("You hold up \the [src] to \the [victim]."))
show_content(victim)
user.visible_message("<b>[user]</b> holds \the [src] up to \the [target_mob].", SPAN_NOTICE("You hold up \the [src] to \the [target_mob]."))
show_content(target_mob)
/obj/item/device/holowarrant/update_icon()
if(selected_warrant)
@@ -38,8 +38,8 @@
/obj/item/device/laser_pointer/attack(mob/living/M, mob/user)
laser_act(M, user)
/obj/item/device/laser_pointer/attack(mob/living/target_mob, mob/living/user, target_zone)
laser_act(target_mob, user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
/obj/item/device/laser_pointer/attackby(obj/item/attacking_item, mob/user)
@@ -220,7 +220,7 @@
for(var/obj/O in contents)
O.emp_act(severity)
/obj/item/device/flashlight/attack(mob/living/M as mob, mob/living/user as mob)
/obj/item/device/flashlight/attack(mob/living/target_mob, mob/living/user, target_zone)
add_fingerprint(user)
if(on && user.zone_sel.selecting == BP_EYES)
@@ -231,10 +231,10 @@
to_chat(user, SPAN_WARNING("This light is too dim to see anything with!"))
return
var/mob/living/carbon/human/H = M //mob has protective eyewear
var/mob/living/carbon/human/H = target_mob //mob has protective eyewear
if(istype(H))
if(H.get_flash_protection())
to_chat(user, SPAN_WARNING("You're going to need to remove \the [M]'s eye protection first."))
to_chat(user, SPAN_WARNING("You're going to need to remove \the [H]'s eye protection first."))
return
var/obj/item/organ/vision
@@ -244,8 +244,8 @@
to_chat(user, SPAN_WARNING("You can't find any [H.species.vision_organ ? H.species.vision_organ : "eyes"] on [H]!"))
user.visible_message(
SPAN_NOTICE("\The [user] directs [src] to [M]'s eyes."),
SPAN_NOTICE("You direct [src] to [M]'s eyes.")
SPAN_NOTICE("\The [user] directs [src] to [H]'s eyes."),
SPAN_NOTICE("You direct [src] to [H]'s eyes.")
)
inspect_vision(vision, user)
+13 -10
View File
@@ -24,7 +24,7 @@ BREATH ANALYZER
var/mode = 1
var/sound_scan = FALSE
/obj/item/device/healthanalyzer/attack(mob/living/M, mob/living/user)
/obj/item/device/healthanalyzer/attack(mob/living/target_mob, mob/living/user, target_zone)
sound_scan = FALSE
if(last_scan <= world.time - 20) //Spam limiter.
last_scan = world.time
@@ -32,7 +32,7 @@ BREATH ANALYZER
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(src)
flick("[icon_state]-scan", src) //makes it so that it plays the scan animation on a successful scan
health_scan_mob(M, user, mode, sound_scan = sound_scan)
health_scan_mob(target_mob, user, mode, sound_scan = sound_scan)
add_fingerprint(user)
/obj/item/device/healthanalyzer/attack_self(mob/user)
@@ -533,11 +533,12 @@ BREATH ANALYZER
throw_range = 7
matter = list(MATERIAL_ALUMINIUM = 30, MATERIAL_GLASS = 20)
/obj/item/device/slime_scanner/attack(mob/living/M, mob/living/user)
if(!isslime(M))
/obj/item/device/slime_scanner/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!isslime(target_mob))
to_chat(user, SPAN_WARNING("This device can only scan slimes!"))
return
var/mob/living/carbon/slime/T = M
var/mob/living/carbon/slime/T = target_mob
to_chat(user, SPAN_NOTICE("**************************"))
to_chat(user, SPAN_NOTICE("Slime scan results:"))
to_chat(user, SPAN_NOTICE(capitalize_first_letters("[T.colour] [T.is_adult ? "adult" : "baby"] slime")))
@@ -599,7 +600,9 @@ BREATH ANALYZER
matter = list(MATERIAL_ALUMINIUM = 30, MATERIAL_GLASS = 20)
origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 2)
/obj/item/device/breath_analyzer/attack(mob/living/carbon/human/H, mob/living/user as mob)
/obj/item/device/breath_analyzer/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/H = target_mob
if (!istype(H))
to_chat(user,SPAN_WARNING("You can't find a way to use \the [src] on [H]!"))
@@ -716,14 +719,14 @@ BREATH ANALYZER
QDEL_NULL(connected)
return ..()
/obj/item/device/advanced_healthanalyzer/attack(mob/living/M, mob/living/user)
/obj/item/device/advanced_healthanalyzer/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!connected)
return
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(src)
user.visible_message("<b>[user]</b> starts scanning \the [M] with \the [src].", SPAN_NOTICE("You start scanning \the [M] with \the [src]."))
if(do_after(user, 7 SECONDS, M, DO_UNIQUE))
print_scan(M, user)
user.visible_message("<b>[user]</b> starts scanning \the [target_mob] with \the [src].", SPAN_NOTICE("You start scanning \the [target_mob] with \the [src]."))
if(do_after(user, 7 SECONDS, target_mob, DO_UNIQUE))
print_scan(target_mob, user)
add_fingerprint(user)
/obj/item/device/advanced_healthanalyzer/proc/print_scan(var/mob/M, var/mob/living/user)
+1 -1
View File
@@ -20,7 +20,7 @@
return ..()
/obj/item/device/animaltagger/attack()
/obj/item/device/animaltagger/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/device/animaltagger/afterattack(atom/A as mob|obj, mob/user as mob)
@@ -57,7 +57,7 @@ effective or pretty fucking useless.
desc = "Use this single-use injector on a Vaurca to grant them access to the Lii'dra Hivenet. Use it on an organic non-Vaurca to infect them with black k'ois. This is an OOC item, do not let anyone see it!"
icon_state = "animal_tagger1"
/obj/item/device/liidrafier/attack()
/obj/item/device/liidrafier/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/device/liidrafier/afterattack(atom/A as mob, mob/user as mob)
+1 -1
View File
@@ -75,7 +75,7 @@
if(I)
AddOverlays(I)
/obj/item/sampler/attack(atom/target, mob/user, proximity_flag, click_parameters)
/obj/item/sampler/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!vial || vial.reagents.total_volume)
return ..()
else
+73 -73
View File
@@ -29,9 +29,9 @@ Contains:
var/apply_sounds
var/applied_sounds
/obj/item/stack/medical/attack(mob/living/M as mob, mob/user as mob)
if (!istype(M) || istype(M, /mob/living/silicon) || istype(M, /mob/living/simple_animal/spiderbot))
to_chat(user, SPAN_WARNING("\The [src] cannot be applied to [M]!"))
/obj/item/stack/medical/attack(mob/living/target_mob, mob/living/user, target_zone)
if (!istype(target_mob) || istype(target_mob, /mob/living/silicon) || istype(target_mob, /mob/living/simple_animal/spiderbot))
to_chat(user, SPAN_WARNING("\The [src] cannot be applied to [target_mob]!"))
return 1
if ( ! (istype(user, /mob/living/carbon/human) || \
@@ -39,8 +39,8 @@ Contains:
to_chat(user, SPAN_WARNING("You don't have the dexterity to do this!"))
return 1
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if (istype(target_mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.name == BP_HEAD)
@@ -54,17 +54,17 @@ Contains:
if(affecting.status & ORGAN_LIFELIKE)
if(!(affecting.brute_dam || affecting.burn_dam))
to_chat(user, SPAN_NOTICE("[M] seems healthy, there are no wounds to treat! "))
to_chat(user, SPAN_NOTICE("[target_mob] seems healthy, there are no wounds to treat! "))
return 1
user.visible_message( \
SPAN_NOTICE("[user] starts applying \the [src] to [M]."), \
SPAN_NOTICE("You start applying \the [src] to [M].")\
SPAN_NOTICE("[user] starts applying \the [src] to [target_mob]."), \
SPAN_NOTICE("You start applying \the [src] to [target_mob].")\
)
if (do_mob(user, M, 30))
if (do_mob(user, target_mob, 30))
user.visible_message( \
SPAN_NOTICE("[M] has been applied with [src] by [user]."), \
SPAN_NOTICE("You apply \the [src] to [M].")\
SPAN_NOTICE("[target_mob] has been applied with [src] by [user]."), \
SPAN_NOTICE("You apply \the [src] to [target_mob].")\
)
use(1)
return 1
@@ -76,23 +76,23 @@ Contains:
H.UpdateDamageIcon()
else
if (!M.getBruteLoss() && !M.getFireLoss())
to_chat(user, SPAN_NOTICE("[M] seems healthy, there are no wounds to treat! "))
if (!target_mob.getBruteLoss() && !target_mob.getFireLoss())
to_chat(user, SPAN_NOTICE("[target_mob] seems healthy, there are no wounds to treat! "))
return 1
user.visible_message( \
SPAN_NOTICE("[user] starts applying \the [src] to [M]."), \
SPAN_NOTICE("You start applying \the [src] to [M].")\
SPAN_NOTICE("[user] starts applying \the [src] to [target_mob]."), \
SPAN_NOTICE("You start applying \the [src] to [target_mob].")\
)
if (do_mob(user, M, 30))
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
if (do_mob(user, target_mob, 30))
target_mob.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
user.visible_message( \
SPAN_NOTICE("[M] has been applied with [src] by [user]."), \
SPAN_NOTICE("You apply \the [src] to [M].")\
SPAN_NOTICE("[target_mob] has been applied with [src] by [user]."), \
SPAN_NOTICE("You apply \the [src] to [target_mob].")\
)
use(1)
M.updatehealth()
target_mob.updatehealth()
/obj/item/stack/medical/use()
. = ..()
@@ -134,44 +134,44 @@ Contains:
amount = max_amount
update_icon()
/obj/item/stack/medical/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
/obj/item/stack/medical/bruise_pack/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
if (!can_use(1, user))
return 0
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if (istype(target_mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(affecting.is_bandaged())
to_chat(user, SPAN_WARNING("The wounds on [M]'s [affecting.name] have already been bandaged."))
to_chat(user, SPAN_WARNING("The wounds on [target_mob]'s [affecting.name] have already been bandaged."))
return 1
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.visible_message(SPAN_NOTICE("\The [user] starts treating [M]'s [affecting.name]."), \
SPAN_NOTICE("You start treating [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] starts treating [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You start treating [target_mob]'s [affecting.name]."))
var/used = 0
for (var/datum/wound/W in affecting.wounds)
if(W.bandaged)
continue
if(used == amount)
break
if(!do_mob(user, M, W.damage/5))
if(!do_mob(user, target_mob, W.damage/5))
to_chat(user, SPAN_NOTICE("You must stand still to bandage wounds."))
break
if (W.current_stage <= W.max_bleeding_stage)
user.visible_message(SPAN_NOTICE("\The [user] bandages \a [W.desc] on [M]'s [affecting.name]."), \
SPAN_NOTICE("You bandage \a [W.desc] on [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] bandages \a [W.desc] on [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You bandage \a [W.desc] on [target_mob]'s [affecting.name]."))
//H.add_side_effect("Itch")
else if (W.damage_type == BRUISE)
user.visible_message(SPAN_NOTICE("\The [user] places a bruise patch over \a [W.desc] on [M]'s [affecting.name]."), \
SPAN_NOTICE("You place a bruise patch over \a [W.desc] on [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] places a bruise patch over \a [W.desc] on [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You place a bruise patch over \a [W.desc] on [target_mob]'s [affecting.name]."))
else
user.visible_message(SPAN_NOTICE("\The [user] places a bandaid over \a [W.desc] on [M]'s [affecting.name]."), \
SPAN_NOTICE("You place a bandaid over \a [W.desc] on [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] places a bandaid over \a [W.desc] on [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You place a bandaid over \a [W.desc] on [target_mob]'s [affecting.name]."))
W.bandage()
playsound(src, apply_sounds, 25)
used++
@@ -209,31 +209,31 @@ Contains:
amount = max_amount
update_icon()
/obj/item/stack/medical/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
/obj/item/stack/medical/ointment/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
if (!can_use(1, user))
return 0
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if (istype(target_mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(affecting.is_salved())
to_chat(user, SPAN_WARNING("The wounds on [M]'s [affecting.name] have already been salved."))
to_chat(user, SPAN_WARNING("The wounds on [target_mob]'s [affecting.name] have already been salved."))
return 1
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.visible_message(SPAN_NOTICE("\The [user] starts salving wounds on [M]'s [affecting.name]."), \
SPAN_NOTICE("You start salving the wounds on [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] starts salving wounds on [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You start salving the wounds on [target_mob]'s [affecting.name]."))
playsound(src, pick(apply_sounds), 25)
if(!do_mob(user, M, 10))
if(!do_mob(user, target_mob, 10))
to_chat(user, SPAN_NOTICE("You must stand still to salve wounds."))
return 1
user.visible_message(SPAN_NOTICE("[user] salved wounds on [M]'s [affecting.name]."), \
SPAN_NOTICE("You salved wounds on [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("[user] salved wounds on [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You salved wounds on [target_mob]'s [affecting.name]."))
use(1)
affecting.salve()
else
@@ -260,44 +260,44 @@ Contains:
amount = max_amount
update_icon()
/obj/item/stack/medical/advanced/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
/obj/item/stack/medical/advanced/bruise_pack/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
if (!can_use(1, user))
return 0
if (ishuman(M))
var/mob/living/carbon/human/H = M
if (ishuman(target_mob))
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(affecting.is_bandaged() && affecting.is_disinfected())
to_chat(user, SPAN_WARNING("The wounds on [M]'s [affecting.name] have already been treated."))
to_chat(user, SPAN_WARNING("The wounds on [target_mob]'s [affecting.name] have already been treated."))
return 1
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.visible_message(SPAN_NOTICE("\The [user] starts treating [M]'s [affecting.name]."), \
SPAN_NOTICE("You start treating [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] starts treating [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You start treating [target_mob]'s [affecting.name]."))
var/used = 0
for (var/datum/wound/W in affecting.wounds)
if (W.bandaged && W.disinfected)
continue
if(used == amount)
break
if(!do_mob(user, M, W.damage/5))
if(!do_mob(user, target_mob, W.damage/5))
to_chat(user, SPAN_NOTICE("You must stand still to bandage wounds."))
break
if (W.current_stage <= W.max_bleeding_stage)
user.visible_message(SPAN_NOTICE("\The [user] cleans \a [W.desc] on [M]'s [affecting.name] and seals the edges with bioglue."), \
SPAN_NOTICE("You clean and seal \a [W.desc] on [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] cleans \a [W.desc] on [target_mob]'s [affecting.name] and seals the edges with bioglue."), \
SPAN_NOTICE("You clean and seal \a [W.desc] on [target_mob]'s [affecting.name]."))
//H.add_side_effect("Itch")
else if (W.damage_type == BRUISE)
user.visible_message(SPAN_NOTICE("\The [user] places a medical patch over \a [W.desc] on [M]'s [affecting.name]."), \
SPAN_NOTICE("You place a medical patch over \a [W.desc] on [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] places a medical patch over \a [W.desc] on [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You place a medical patch over \a [W.desc] on [target_mob]'s [affecting.name]."))
else
user.visible_message(SPAN_NOTICE("\The [user] smears some bioglue over \a [W.desc] on [M]'s [affecting.name]."), \
SPAN_NOTICE("You smear some bioglue over \a [W.desc] on [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] smears some bioglue over \a [W.desc] on [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You smear some bioglue over \a [W.desc] on [target_mob]'s [affecting.name]."))
playsound(src, pick(apply_sounds), 25)
W.bandage()
W.disinfect()
@@ -335,28 +335,28 @@ Contains:
amount = max_amount
update_icon()
/obj/item/stack/medical/advanced/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
/obj/item/stack/medical/advanced/ointment/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if (istype(target_mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(affecting.is_salved())
to_chat(user, SPAN_WARNING("The wounds on [M]'s [affecting.name] have already been salved."))
to_chat(user, SPAN_WARNING("The wounds on [target_mob]'s [affecting.name] have already been salved."))
return 1
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.visible_message(SPAN_NOTICE("\The [user] starts salving wounds on [M]'s [affecting.name]."), \
SPAN_NOTICE("You start salving the wounds on [M]'s [affecting.name]."))
user.visible_message(SPAN_NOTICE("\The [user] starts salving wounds on [target_mob]'s [affecting.name]."), \
SPAN_NOTICE("You start salving the wounds on [target_mob]'s [affecting.name]."))
playsound(src, pick(apply_sounds), 25)
if(!do_mob(user, M, 10))
if(!do_mob(user, target_mob, 10))
to_chat(user, SPAN_NOTICE("You must stand still to salve wounds."))
return 1
user.visible_message(SPAN_NOTICE("[user] covers wounds on [M]'s [affecting.name] with regenerative membrane."), \
SPAN_NOTICE("You cover wounds on [M]'s [affecting.name] with regenerative membrane."))
user.visible_message(SPAN_NOTICE("[user] covers wounds on [target_mob]'s [affecting.name] with regenerative membrane."), \
SPAN_NOTICE("You cover wounds on [target_mob]'s [affecting.name] with regenerative membrane."))
affecting.heal_damage(0,heal_burn)
use(1)
affecting.salve()
@@ -383,33 +383,33 @@ Contains:
amount = max_amount
update_icon()
/obj/item/stack/medical/splint/attack(mob/living/carbon/M as mob, mob/user as mob)
/obj/item/stack/medical/splint/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
if (!can_use(1, user))
return 0
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if (istype(target_mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
var/limb = affecting.name
if(!(affecting.limb_name in splintable_organs))
to_chat(user, SPAN_DANGER("You can't apply a splint there!"))
return
if(affecting.status & ORGAN_SPLINTED)
to_chat(user, SPAN_DANGER("[M]'s [limb] is already splinted!"))
to_chat(user, SPAN_DANGER("[target_mob]'s [limb] is already splinted!"))
return
if (M != user)
user.visible_message(SPAN_DANGER("[user] starts to apply \the [src] to [M]'s [limb]."), SPAN_DANGER("You start to apply \the [src] to [M]'s [limb]."), SPAN_DANGER("You hear something being wrapped."))
if (target_mob != user)
user.visible_message(SPAN_DANGER("[user] starts to apply \the [src] to [target_mob]'s [limb]."), SPAN_DANGER("You start to apply \the [src] to [target_mob]'s [limb]."), SPAN_DANGER("You hear something being wrapped."))
else
if((!user.hand && affecting.limb_name == BP_R_ARM) || (user.hand && affecting.limb_name == BP_L_ARM))
to_chat(user, SPAN_DANGER("You can't apply a splint to the arm you're using!"))
return
user.visible_message(SPAN_DANGER("[user] starts to apply \the [src] to their [limb]."), SPAN_DANGER("You start to apply \the [src] to your [limb]."), SPAN_DANGER("You hear something being wrapped."))
if(do_after(user, 5 SECONDS, M))
if (M != user)
user.visible_message(SPAN_DANGER("[user] finishes applying \the [src] to [M]'s [limb]."), SPAN_DANGER("You finish applying \the [src] to [M]'s [limb]."), SPAN_DANGER("You hear something being wrapped."))
if(do_after(user, 5 SECONDS, target_mob))
if (target_mob != user)
user.visible_message(SPAN_DANGER("[user] finishes applying \the [src] to [target_mob]'s [limb]."), SPAN_DANGER("You finish applying \the [src] to [target_mob]'s [limb]."), SPAN_DANGER("You hear something being wrapped."))
else
if(prob(25))
user.visible_message(SPAN_DANGER("[user] successfully applies \the [src] to their [limb]."), SPAN_DANGER("You successfully apply \the [src] to your [limb]."), SPAN_DANGER("You hear something being wrapped."))
+12 -11
View File
@@ -24,17 +24,17 @@
icon_state = "[initial(icon_state)]-empty"
check_maptext(SMALL_FONTS(7, amount))
/obj/item/stack/nanopaste/attack(atom/M, mob/user, var/target_zone)
if(!ismob(M) || !istype(user))
/obj/item/stack/nanopaste/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!ismob(target_mob) || !istype(user))
return 0
if (!can_use(1, user))
return 0
if (isrobot(M)) //Repairing cyborgs
var/mob/living/silicon/robot/R = M
if (isrobot(target_mob)) //Repairing cyborgs
var/mob/living/silicon/robot/R = target_mob
if (R.getBruteLoss() || R.getFireLoss() )
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(do_mob(user, M, 7))
if(do_mob(user, target_mob, 7))
R.adjustBruteLoss(-15)
R.adjustFireLoss(-15)
R.updatehealth()
@@ -44,8 +44,8 @@
else
to_chat(user, SPAN_NOTICE("All [R]'s systems are nominal."))
else if(ishuman(M)) //Repairing robolimbs
var/mob/living/carbon/human/H = M
else if(ishuman(target_mob)) //Repairing robolimbs
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/S = H.get_organ(target_zone)
if (S && (S.status & ORGAN_ASSISTED))
@@ -61,12 +61,12 @@
to_chat(user, SPAN_WARNING("You can't apply [src] through [H.wear_suit]!"))
return
if(do_mob(user, M, 7))
if(do_mob(user, target_mob, 7))
S.heal_damage(15, 15, robo_repair = 1)
H.updatehealth()
use(1)
user.visible_message(SPAN_NOTICE("\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the [user]"] [S.name] with \the [src]."),\
SPAN_NOTICE("You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.name]."))
user.visible_message(SPAN_NOTICE("\The [user] applies some nanite paste at[user != target_mob ? " \the [target_mob]'s" : " \the [user]"] [S.name] with \the [src]."),\
SPAN_NOTICE("You apply some nanite paste at [user == target_mob ? "your" : "[target_mob]'s"] [S.name]."))
else
to_chat(user, SPAN_NOTICE("Nothing to fix here."))
else
@@ -87,7 +87,8 @@
var/used = FALSE
construction_cost = null
/obj/item/stack/nanopaste/surge/attack(mob/living/carbon/human/M as mob, mob/user as mob, var/target_zone)
/obj/item/stack/nanopaste/surge/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/M = target_mob
if (!istype(M) || !istype(user))
return 0
+3 -3
View File
@@ -66,11 +66,11 @@
if(distance <= 1)
. += "There [amount == 1 ? "is" : "are"] about [amount] [singular_name]\s of paper left!"
/obj/item/stack/wrapping_paper/attack(mob/target, mob/user)
if(!ishuman(target))
/obj/item/stack/wrapping_paper/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!ishuman(target_mob))
return
var/mob/living/carbon/human/H = target
var/mob/living/carbon/human/H = target_mob
if(istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket) || H.stat)
if(src.amount >= 2)
var/obj/effect/spresent/present = new /obj/effect/spresent (H.loc)
+7 -7
View File
@@ -51,7 +51,7 @@
reagents = R
R.my_atom = src
/obj/item/toy/waterballoon/attack(mob/living/carbon/human/M as mob, mob/user as mob)
/obj/item/toy/waterballoon/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/toy/waterballoon/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
@@ -486,17 +486,17 @@
return
/obj/item/toy/crossbow/attack(mob/M, mob/user)
/obj/item/toy/crossbow/attack(mob/living/target_mob, mob/living/user, target_zone)
src.add_fingerprint(user)
if (src.dart_count > 0 && M.lying) // Check
for(var/mob/O in viewers(M, null))
if (src.dart_count > 0 && target_mob.lying) // Check
for(var/mob/O in viewers(target_mob, null))
if(O.client)
O.show_message(SPAN_NOTICE("\The [user] casually lines up a shot with [M]'s head and pulls the trigger."), 1)
O.show_message(SPAN_WARNING("\The [M] was hit in the head by the foam dart!"), 1)
O.show_message(SPAN_NOTICE("\The [user] casually lines up a shot with [target_mob]'s head and pulls the trigger."), 1)
O.show_message(SPAN_WARNING("\The [target_mob] was hit in the head by the foam dart!"), 1)
playsound(src, 'sound/items/syringeproj.ogg', 50, TRUE)
new /obj/item/toy/ammo/crossbow(M.loc)
new /obj/item/toy/ammo/crossbow(target_mob.loc)
src.dart_count--
return
+1 -1
View File
@@ -11,7 +11,7 @@
drop_sound = 'sound/items/drop/wrapper.ogg'
pickup_sound = 'sound/items/pickup/wrapper.ogg'
/obj/item/trash/attack(mob/M as mob, mob/living/user as mob)
/obj/item/trash/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/trash/koisbar
+1 -1
View File
@@ -62,7 +62,7 @@ ABSTRACT_TYPE(/obj/item/rfd)
. = ..()
update_icon()
/obj/item/rfd/attack()
/obj/item/rfd/attack(mob/living/target_mob, mob/living/user, target_zone)
return FALSE
/obj/item/rfd/proc/can_use(var/mob/user,var/turf/T)
+2 -1
View File
@@ -151,7 +151,8 @@
usr.put_in_hands(P)
/obj/item/autopsy_scanner/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
/obj/item/autopsy_scanner/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/M = target_mob
if(!istype(M))
return
+6 -6
View File
@@ -234,22 +234,22 @@ var/const/NO_EMAG_ACT = -50
blind_message += " [blind_add_text]"
user.visible_message(message, blind_message)
/obj/item/card/id/attack(var/mob/living/M, var/mob/user, proximity)
/obj/item/card/id/attack(mob/living/target_mob, mob/living/user, target_zone)
if(user.zone_sel.selecting == BP_R_HAND || user.zone_sel.selecting == BP_L_HAND)
if(!ishuman(M))
if(!ishuman(target_mob))
return ..()
if (dna_hash == ID_CARD_UNSET && ishuman(user))
var/response = alert(user, "This ID card has not been imprinted with biometric data. Would you like to imprint [M]'s now?", "Biometric Imprinting", "Yes", "No")
var/response = alert(user, "This ID card has not been imprinted with biometric data. Would you like to imprint [target_mob]'s now?", "Biometric Imprinting", "Yes", "No")
if (response == "Yes")
if (!user.Adjacent(M) || user.restrained() || user.lying || user.stat)
to_chat(user, SPAN_WARNING("You must remain adjacent to [M] to scan their biometric data."))
if (!user.Adjacent(target_mob) || user.restrained() || user.lying || user.stat)
to_chat(user, SPAN_WARNING("You must remain adjacent to [target_mob] to scan their biometric data."))
return
var/mob/living/carbon/human/H = M
var/mob/living/carbon/human/H = target_mob
if(H.gloves)
to_chat(user, SPAN_WARNING("\The [H] is wearing gloves."))
@@ -254,10 +254,10 @@
qdel(src)
user.put_in_hands(chosenitem)
/obj/item/nullrod/attack(mob/M as mob, mob/living/user as mob)
/obj/item/nullrod/attack(mob/living/target_mob, mob/living/user, target_zone)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(M)
user.do_attack_animation(target_mob)
if(LAZYLEN(user.spell_list))
user.silence_spells(300) //30 seconds
@@ -275,8 +275,8 @@
user.Paralyse(20)
return
if(M.stat != DEAD && ishuman(M) && user.a_intent != I_HURT)
var/mob/living/K = M
if(target_mob.stat != DEAD && ishuman(target_mob) && user.a_intent != I_HURT)
var/mob/living/K = target_mob
var/datum/vampire/vampire = K.mind.antag_datums[MODE_VAMPIRE]
if(vampire)
if(vampire.status & VAMP_ISTHRALL)
@@ -288,12 +288,12 @@
K.visible_message(SPAN_WARNING("The gaze in [K]'s eyes remains determined."), SPAN_NOTICE("You turn away from the light, remaining true to your vampiric master!"))
K.say("*scream")
K.take_overall_damage(5, 15)
admin_attack_log(user, M, "attempted to deconvert", "was unsuccessfully deconverted by", "attempted to deconvert")
admin_attack_log(user, target_mob, "attempted to deconvert", "was unsuccessfully deconverted by", "attempted to deconvert")
if("Give in")
K.visible_message(SPAN_NOTICE("[K]'s eyes become clearer, the evil gone, but not without leaving scars."))
K.take_overall_damage(10, 20)
thralls.remove_antagonist(K.mind)
admin_attack_log(user, M, "successfully deconverted", "was successfully deconverted by", "successfully deconverted")
admin_attack_log(user, target_mob, "successfully deconverted", "was successfully deconverted by", "successfully deconverted")
else if (vampire.status & VAMP_FRENZIED)
K.visible_message(SPAN_DANGER("[user] thrusts \the [src] towards [K], who recoils in horror as they erupt into flames!"), SPAN_DANGER("[user] thrusts \the [src] towards you, its holy light scorching your corrupted flesh!"))
K.adjust_fire_stacks(10)
@@ -307,19 +307,19 @@
K.visible_message(SPAN_WARNING("The gaze in [K]'s eyes remains determined."), SPAN_NOTICE("You turn away from the light, remaining true to the Geometer!"))
K.say("*scream")
K.take_overall_damage(5, 15)
admin_attack_log(user, M, "attempted to deconvert", "was unsuccessfully deconverted by", "attempted to deconvert")
admin_attack_log(user, target_mob, "attempted to deconvert", "was unsuccessfully deconverted by", "attempted to deconvert")
if("Give in")
K.visible_message(SPAN_NOTICE("[K]'s eyes become clearer, the evil gone, but not without leaving scars."))
K.take_overall_damage(10, 20)
cult.remove_antagonist(K.mind)
admin_attack_log(user, M, "successfully deconverted", "was successfully deconverted by", "successfully deconverted")
admin_attack_log(user, target_mob, "successfully deconverted", "was successfully deconverted by", "successfully deconverted")
else
user.visible_message(SPAN_WARNING("[user]'s concentration is broken!"), SPAN_WARNING("Your concentration is broken! You and your target need to stay uninterrupted for longer!"))
return
else
to_chat(user, SPAN_DANGER("The [src] appears to do nothing."))
M.visible_message(SPAN_DANGER("\The [user] waves \the [src] over \the [M]'s head."))
target_mob.visible_message(SPAN_DANGER("\The [user] waves \the [src] over \the [target_mob]'s head."))
return
else if(user.a_intent != I_HURT) // to prevent the chaplain from hurting peoples accidentally
to_chat(user, SPAN_NOTICE("The [src] appears to do nothing."))
@@ -333,7 +333,9 @@ ABSTRACT_TYPE(/obj/item/clothing/mask/smokable)
if(lit)
die(TRUE)
/obj/item/clothing/mask/smokable/cigarette/attack(mob/living/carbon/human/H, mob/user, def_zone)
/obj/item/clothing/mask/smokable/cigarette/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/H = target_mob
if(lit && H == user && istype(H))
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
@@ -972,8 +974,10 @@ ABSTRACT_TYPE(/obj/item/clothing/mask/smokable)
/obj/item/flame/lighter/vendor_action(var/obj/machinery/vending/V)
handle_lighting()
/obj/item/flame/lighter/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!istype(M, /mob))
/obj/item/flame/lighter/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/M = target_mob
if(!istype(M))
return
if(lit && M.IgniteMob())
+10 -8
View File
@@ -111,13 +111,15 @@
open = !open
update_icon()
/obj/item/lipstick/attack(mob/M as mob, mob/user as mob)
if(!open) return
/obj/item/lipstick/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!open)
return
if(!istype(M, /mob)) return
if(!istype(target_mob))
return
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(ishuman(target_mob))
var/mob/living/carbon/human/H = target_mob
if(H.lipstick_color) //if they already have lipstick on
to_chat(user, SPAN_NOTICE("You need to wipe off the old lipstick first!"))
return
@@ -173,11 +175,11 @@
playsound(H, 'sound/items/welder_pry.ogg', 20, 1)
/obj/item/razor/attack(mob/M, mob/user, var/target_zone)
if(!ishuman(M))
/obj/item/razor/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!ishuman(target_mob))
return ..()
var/mob/living/carbon/human/H = M
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/E = H.get_organ(target_zone)
if(!E || E.is_stump())
+12 -11
View File
@@ -97,15 +97,16 @@
qdel(src)
return uses
/obj/item/dnainjector/attack(mob/M as mob, mob/user as mob)
if (!istype(M, /mob))
/obj/item/dnainjector/attack(mob/living/target_mob, mob/living/user, target_zone)
if (!istype(target_mob))
return
if (!usr.IsAdvancedToolUser())
return
if(inuse)
return 0
user.visible_message(SPAN_DANGER("\The [user] is trying to inject \the [M] with \the [src]!"))
user.visible_message(SPAN_DANGER("\The [user] is trying to inject \the [target_mob] with \the [src]!"))
inuse = 1
s_time = world.time
spawn(50)
@@ -115,11 +116,11 @@
return
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(M)
user.do_attack_animation(target_mob)
M.visible_message(SPAN_DANGER("\The [M] has been injected with \the [src] by \the [user]."))
target_mob.visible_message(SPAN_DANGER("\The [target_mob] has been injected with \the [src] by \the [user]."))
var/mob/living/carbon/human/H = M
var/mob/living/carbon/human/H = target_mob
if(!istype(H))
to_chat(user, SPAN_WARNING("Apparently it didn't work..."))
return
@@ -132,13 +133,13 @@
if((buf.types & DNA2_BUF_SE) && (block ? (GetState() && block == MONKEYBLOCK) : GetState(MONKEYBLOCK)))
injected_with_monkey = SPAN_DANGER(" (MONKEY)")
M.attack_log += "\[[time_stamp()]\] <font color='orange'>Has been injected with [name] by [user.name] ([user.ckey])</font>"
user.attack_log += "\[[time_stamp()]\] <span class='warning'>Used the [name] to inject [M.name] ([M.ckey])</span>"
log_attack("[user.name] ([user.ckey]) used the [name] to inject [M.name] ([M.ckey])")
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with \the [src][injected_with_monkey]")
target_mob.attack_log += "\[[time_stamp()]\] <font color='orange'>Has been injected with [name] by [user.name] ([user.ckey])</font>"
user.attack_log += "\[[time_stamp()]\] <span class='warning'>Used the [name] to inject [target_mob.name] ([target_mob.ckey])</span>"
log_attack("[user.name] ([user.ckey]) used the [name] to inject [target_mob.name] ([target_mob.ckey])")
message_admins("[key_name_admin(user)] injected [key_name_admin(target_mob)] with \the [src][injected_with_monkey]")
// Apply the DNA shit.
inject(M, user)
inject(target_mob, user)
return
/obj/item/dnainjector/hulkmut
+3 -1
View File
@@ -173,7 +173,9 @@
else
to_chat(user, SPAN_WARNING("\The [src] needs to be in one of your hands."))
/obj/item/clothing/mask/smokable/ecig/attack(mob/living/carbon/human/C, mob/user, def_zone)
/obj/item/clothing/mask/smokable/ecig/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/C = target_mob
if(active && C == user && istype(C))
var/obj/item/blocked = C.check_mouth_coverage()
if(blocked)
@@ -90,7 +90,7 @@
qdel(src)
/obj/item/plastique/attack(mob/M as mob, mob/user as mob, def_zone)
/obj/item/plastique/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/plastique/cyborg
@@ -137,8 +137,8 @@
. += SPAN_NOTICE("The safety is [safety ? "on" : "off"].")
return
/obj/item/extinguisher/attack(mob/living/M, mob/living/user, target_zone)
if(ismob(M) && user.a_intent != I_HURT)
/obj/item/extinguisher/attack(mob/living/target_mob, mob/living/user, target_zone)
if(ismob(target_mob) && user.a_intent != I_HURT)
return FALSE
return ..()
+5 -1
View File
@@ -25,7 +25,11 @@
drop_sound = 'sound/items/drop/accessory.ogg'
pickup_sound = 'sound/items/pickup/accessory.ogg'
/obj/item/handcuffs/attack(var/mob/living/carbon/C, var/mob/living/user)
/obj/item/handcuffs/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/C = target_mob
if(!istype(C))
return
if(!user.IsAdvancedToolUser())
return
@@ -32,7 +32,8 @@
else
..()
/obj/item/implanter/attack(mob/living/carbon/human/M, mob/user, var/target_zone)
/obj/item/implanter/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/M = target_mob
if(!istype(M))
return
@@ -81,15 +82,15 @@
icon_state = "cimplanter0"
return
/obj/item/implanter/ipc_tag/attack(mob/M, mob/user)
if(!ishuman(M))
/obj/item/implanter/ipc_tag/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!ishuman(target_mob))
return
if(!ipc_tag)
to_chat(user, SPAN_WARNING("\The [src] doesn't have an IPC tag loaded!"))
return
var/mob/living/carbon/human/H = M
var/mob/living/carbon/human/H = target_mob
if(!H.species || !isipc(H) || !H.organs_by_name[BP_HEAD])
to_chat(user, SPAN_WARNING("You cannot use \the [src] on a non-IPC!"))
return
@@ -98,16 +99,16 @@
to_chat(user, SPAN_WARNING("\The [H] is already tagged!"))
return
user.visible_message(SPAN_WARNING("\The [user] tags \the [M] with \the [src]!"), SPAN_NOTICE("You tag \the [M] with \the [src]."), range = 3)
user.visible_message(SPAN_WARNING("\The [user] tags \the [target_mob] with \the [src]!"), SPAN_NOTICE("You tag \the [target_mob] with \the [src]."), range = 3)
M.attack_log += "\[[time_stamp()]\] <font color='orange'> Implanted with [name] ([ipc_tag.name]) by [user.name] ([user.ckey])</font>"
user.attack_log += "\[[time_stamp()]\] <span class='warning'>Used the [name] ([ipc_tag.name]) to implant [M.name] ([M.ckey])</span>"
msg_admin_attack("[key_name_admin(user)] implanted [key_name_admin(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)",ckey=key_name(user),ckey_target=key_name(M))
target_mob.attack_log += "\[[time_stamp()]\] <font color='orange'> Implanted with [name] ([ipc_tag.name]) by [user.name] ([user.ckey])</font>"
user.attack_log += "\[[time_stamp()]\] <span class='warning'>Used the [name] ([ipc_tag.name]) to implant [target_mob.name] ([target_mob.ckey])</span>"
msg_admin_attack("[key_name_admin(user)] implanted [key_name_admin(target_mob)] with [name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)",ckey=key_name(user),ckey_target=key_name(target_mob))
ipc_tag.replaced(H, H.organs_by_name[BP_HEAD])
ipc_tag.forceMove(M)
ipc_tag.forceMove(target_mob)
if(ipc_tag.auto_generate)
ipc_tag.serial_number = uppertext(dd_limittext(md5(M.real_name), 12))
ipc_tag.serial_number = uppertext(dd_limittext(md5(target_mob.real_name), 12))
ipc_tag = null
update_icon()
@@ -29,17 +29,17 @@
QDEL_NULL(wires)
return ..()
/obj/item/ipc_tag_scanner/attack(mob/living/M, mob/living/user)
/obj/item/ipc_tag_scanner/attack(mob/living/target_mob, mob/living/user, target_zone)
add_fingerprint(user)
if(!powered)
to_chat(user, SPAN_WARNING("\The [src] reads, \"Scanning failure, please submit scanner for repairs.\""))
return
user.visible_message(SPAN_NOTICE("\The [user] starts analyzing \the [M] with \the [src]..."), SPAN_NOTICE("You start analyzing \the [M] with \the [src]..."))
user.visible_message(SPAN_NOTICE("\The [user] starts analyzing \the [target_mob] with \the [src]..."), SPAN_NOTICE("You start analyzing \the [target_mob] with \the [src]..."))
if(do_after(user, 5 SECONDS, src, DO_UNIQUE))
if(!isipc(M))
to_chat(user, SPAN_WARNING("You analyze \the [M], but find that they're not an IPC at all!"))
if(!isipc(target_mob))
to_chat(user, SPAN_WARNING("You analyze \the [target_mob], but find that they're not an IPC at all!"))
return
var/mob/living/carbon/human/IPC = M
var/mob/living/carbon/human/IPC = target_mob
var/obj/item/organ/internal/ipc_tag/tag = IPC.internal_organs_by_name[BP_IPCTAG]
if(isnull(tag) || !tag)
to_chat(user, SPAN_WARNING("Error: Serial Identification Missing."))
@@ -31,7 +31,9 @@
src.pixel_y = rand(0, 4)
create_reagents(5)
/obj/item/material/kitchen/utensil/attack(mob/living/carbon/M, mob/user, var/target_zone)
/obj/item/material/kitchen/utensil/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/M = target_mob
if(!istype(M))
return ..()
@@ -154,7 +156,7 @@
applies_material_colour = 0
unbreakable = 1
/obj/item/material/kitchen/utensil/knife/attack(mob/target, mob/living/user, var/target_zone)
/obj/item/material/kitchen/utensil/knife/attack(mob/living/target_mob, mob/living/user, target_zone)
if ((user.is_clumsy()) && prob(50))
to_chat(user, SPAN_WARNING("You accidentally cut yourself with \the [src]."))
user.take_organ_damage(20)
@@ -182,7 +184,7 @@
use_material_name = TRUE
applies_material_colour = TRUE
/obj/item/material/kitchen/rollingpin/attack(mob/living/M, mob/living/user, var/target_zone)
/obj/item/material/kitchen/rollingpin/attack(mob/living/target_mob, mob/living/user, target_zone)
if ((user.is_clumsy()) && prob(50))
to_chat(user, SPAN_WARNING("\The [src] slips out of your hand and hits your head."))
user.drop_from_inventory(src)
@@ -25,13 +25,13 @@
. = ..()
src.add_blood()
/obj/item/material/knife/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob, var/target_zone)
/obj/item/material/knife/attack(mob/living/target_mob, mob/living/user, target_zone)
if(active == 1)
if((target_zone != BP_EYES && target_zone != BP_HEAD) || M.eyes_protected(src, FALSE))
if((target_zone != BP_EYES && target_zone != BP_HEAD) || target_mob.eyes_protected(src, FALSE))
return ..()
if((user.is_clumsy()) && prob(50))
M = user
return eyestab(M,user)
target_mob = user
return eyestab(target_mob,user)
/obj/item/material/knife/verb/extract_embedded(var/mob/living/carbon/human/H as mob in view(1))
set name = "Extract Embedded Item"
@@ -302,7 +302,7 @@
icon_state = "spearglass[wielded]"
item_state = "spearglass[wielded]"
/obj/item/material/twohanded/spear/attack(mob/living/target, mob/living/user, var/target_zone)
/obj/item/material/twohanded/spear/attack(mob/living/target_mob, mob/living/user, target_zone)
..()
if(wielded && explosive)
@@ -481,7 +481,7 @@
if(powered)
. += SPAN_NOTICE("It is currently powered on.")
/obj/item/material/twohanded/chainsaw/attack(mob/M as mob, mob/living/user as mob)
/obj/item/material/twohanded/chainsaw/attack(mob/living/target_mob, mob/living/user, target_zone)
. = ..()
if(powered)
playsound(loc, 'sound/weapons/saw/chainsword.ogg', 25, 0, 30)
@@ -163,7 +163,7 @@
icon_state = initial(icon_state)
to_chat(user, SPAN_NOTICE("\The [src] is de-energised."))
/obj/item/melee/energy/glaive/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
/obj/item/melee/energy/glaive/attack(mob/living/target_mob, mob/living/user, target_zone)
user.setClickCooldown(16)
..()
+15 -15
View File
@@ -109,26 +109,26 @@
icon_state = "hammeroff"
item_state = "hammeroff"
/obj/item/melee/hammer/powered/attack(var/mob/target, var/mob/living/user, var/target_zone)
/obj/item/melee/hammer/powered/attack(mob/living/target_mob, mob/living/user, target_zone)
..()
if(prob(trigger_chance))
if(!on)
to_chat(user, SPAN_WARNING("\The [src] buzzes!"))
return
playsound(user, 'sound/weapons/beartrap_shut.ogg', 50, 1, -1)
user.visible_message(SPAN_DANGER("\The [user] slams \the [target] away with \the [src]!"))
user.visible_message(SPAN_DANGER("\The [user] slams \the [target_mob] away with \the [src]!"))
var/T = get_turf(user)
spark(T, 3, GLOB.alldirs)
step_away(target,user,15)
step_away(target_mob,user,15)
sleep(1)
step_away(target,user,15)
step_away(target_mob,user,15)
sleep(1)
step_away(target,user,15)
step_away(target_mob,user,15)
sleep(1)
step_away(target,user,15)
step_away(target_mob,user,15)
sleep(1)
if(ishuman(target))
var/mob/living/carbon/human/H = target
if(ishuman(target_mob))
var/mob/living/carbon/human/H = target_mob
H.apply_effect(2, WEAKEN)
on = FALSE
update_icon()
@@ -163,17 +163,17 @@
attack_verb = list("flogged", "whipped", "lashed", "disciplined")
hitsound = 'sound/weapons/whip.ogg'
/obj/item/melee/whip/attack(mob/target as mob, mob/living/user as mob, var/target_zone)
/obj/item/melee/whip/attack(mob/living/target_mob, mob/living/user, target_zone)
..()
if(ishuman(target))
if(ishuman(target_mob))
if(prob(25))
if(target_zone == BP_L_HAND || target_zone == BP_L_ARM)
if (target.l_hand && target.l_hand != src)
target.drop_l_hand()
if (target_mob.l_hand && target_mob.l_hand != src)
target_mob.drop_l_hand()
else if(target_zone == BP_R_HAND || target_zone == BP_R_ARM)
if (target.r_hand && target.r_hand != src)
target.drop_r_hand()
user.visible_message(SPAN_DANGER("\The [user] disarms \the [target] with \the [src]!"))
if (target_mob.r_hand && target_mob.r_hand != src)
target_mob.drop_r_hand()
user.visible_message(SPAN_DANGER("\The [user] disarms \the [target_mob] with \the [src]!"))
return
/obj/item/melee/ceremonial_sword
@@ -5,6 +5,3 @@
src.machine = M
else
user.visible_message("[user] dumbly fumbles to find a place on [M] to plug in [src].", "There aren't any ports on [M] that match the jack belonging to [src].")
/obj/item/pai_cable/attack(obj/machinery/M as obj, mob/user as mob)
src.plugin(M, user)
+3 -3
View File
@@ -98,9 +98,9 @@
return
//attack_as_weapon
/obj/item/soap/attack(mob/living/target, mob/living/user, var/target_zone)
if(target && user && ishuman(target) && ishuman(user) && !target.stat && !user.stat && user.zone_sel &&user.zone_sel.selecting == BP_MOUTH )
user.visible_message(SPAN_DANGER("\The [user] washes \the [target]'s mouth out with soap!"))
/obj/item/soap/attack(mob/living/target_mob, mob/living/user, target_zone)
if(target_mob && user && ishuman(target_mob) && ishuman(user) && !target_mob.stat && !user.stat && user.zone_sel &&user.zone_sel.selecting == BP_MOUTH )
user.visible_message(SPAN_DANGER("\The [user] washes \the [target_mob]'s mouth out with soap!"))
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //prevent spam
return
..()
@@ -326,39 +326,39 @@
reagents.trans_to_obj(C, (reagents.total_volume/contents.len))
return ..()
/obj/item/storage/box/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob, target_zone)
if(!ismob(M))
/obj/item/storage/box/fancy/cigarettes/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!ismob(target_mob))
return
if(!opened)
to_chat(user, SPAN_WARNING("\The [src] is closed."))
return
if(target_zone == BP_MOUTH && contents.len > 0)
if(M.wear_mask)
to_chat(user, SPAN_WARNING("\The [M.wear_mask] is in the way."))
if(target_mob.wear_mask)
to_chat(user, SPAN_WARNING("\The [target_mob.wear_mask] is in the way."))
return
var/obj/item/clothing/mask/smokable/cigarette/cig = locate() in src
if(!istype(cig))
to_chat(user, SPAN_WARNING("There isn't a cigarette in \the [src]!"))
return
if(M != user)
if(!use_check(M))
to_chat(user, SPAN_WARNING("[M.name] is in no condition to handle items!"))
if(target_mob != user)
if(!use_check(target_mob))
to_chat(user, SPAN_WARNING("[target_mob.name] is in no condition to handle items!"))
return
user.visible_message(SPAN_NOTICE("\The <b>[user]</b> holds up the open [src.name] to \the [M]'s mouth."), SPAN_NOTICE("You hold up the open [src.name] to \the [M]'s mouth, waiting for them to accept."))
var/response = alert(M, "\The [user] offers you \a [cig.name]. Do you accept?", "Smokable Offer", "Accept", "Decline")
user.visible_message(SPAN_NOTICE("\The <b>[user]</b> holds up the open [src.name] to \the [target_mob]'s mouth."), SPAN_NOTICE("You hold up the open [src.name] to \the [target_mob]'s mouth, waiting for them to accept."))
var/response = alert(target_mob, "\The [user] offers you \a [cig.name]. Do you accept?", "Smokable Offer", "Accept", "Decline")
if(response != "Accept")
M.visible_message(SPAN_NOTICE("<b>[M]</b> pushes [user]'s [src.name] away."))
target_mob.visible_message(SPAN_NOTICE("<b>[target_mob]</b> pushes [user]'s [src.name] away."))
return
if(!M.Adjacent(user))
if(!target_mob.Adjacent(user))
to_chat(user, SPAN_WARNING("You need to stay in reaching distance while giving an object."))
to_chat(M, SPAN_WARNING("\The [user] moved too far away."))
to_chat(target_mob, SPAN_WARNING("\The [user] moved too far away."))
return
remove_from_storage(cig, get_turf(M))
M.equip_to_slot_if_possible(cig, slot_wear_mask)
M.visible_message(SPAN_NOTICE("<b>[M]</b> casually pulls out a [icon_type] from \the [src] with [M.get_pronoun("his")] mouth."), SPAN_NOTICE("You casually pull out a [icon_type] from \the [src] with your mouth."), range = 3)
remove_from_storage(cig, get_turf(target_mob))
target_mob.equip_to_slot_if_possible(cig, slot_wear_mask)
target_mob.visible_message(SPAN_NOTICE("<b>[target_mob]</b> casually pulls out a [icon_type] from \the [src] with [target_mob.get_pronoun("his")] mouth."), SPAN_NOTICE("You casually pull out a [icon_type] from \the [src] with your mouth."), range = 3)
update_icon()
return
if(M == user && target_zone == BP_R_HAND || target_zone == BP_L_HAND) // Cig packing. Because obsessive smokers do it.
if(target_mob == user && target_zone == BP_R_HAND || target_zone == BP_L_HAND) // Cig packing. Because obsessive smokers do it.
user.visible_message(SPAN_NOTICE("<b>[user]</b> taps \the [src] against [user.get_pronoun("his")] palm."), SPAN_NOTICE("You tap \the [src] against your palm."))
else
..()
@@ -475,7 +475,7 @@
else
AddOverlays("ledb")
/obj/item/storage/lockbox/vials/attackby(attacking_item, mob/user)
/obj/item/storage/lockbox/vials/attackby(obj/item/attacking_item, mob/user, params)
..()
update_icon()
@@ -18,7 +18,7 @@
var/icon_broken = "lockbox+b"
/obj/item/storage/lockbox/attackby(attacking_item, mob/user)
/obj/item/storage/lockbox/attackby(obj/item/attacking_item, mob/user, params)
if(istype(attacking_item, /obj/item/card/id))
if(src.broken)
to_chat(user, SPAN_WARNING("It appears to be broken."))
@@ -131,14 +131,14 @@
update_force()
/obj/item/storage/toolbox/attack(mob/living/M as mob, mob/user as mob, var/target_zone)
/obj/item/storage/toolbox/attack(mob/living/target_mob, mob/living/user, target_zone)
update_force()
if (..())
if (contents.len)
spill(3, get_turf(M))
playsound(M, /singleton/sound_category/tray_hit_sound, 100, 1) //sound playin' again
spill(3, get_turf(target_mob))
playsound(target_mob, /singleton/sound_category/tray_hit_sound, 100, 1) //sound playin' again
update_force()
user.visible_message(SPAN_DANGER("[user] smashes the [src] into [M], causing it to break open and strew its contents across the area"))
user.visible_message(SPAN_DANGER("[user] smashes the [src] into [target_mob], causing it to break open and strew its contents across the area"))
/obj/item/storage/toolbox/lunchbox
name = "rainbow lunchbox"
+26 -25
View File
@@ -107,8 +107,9 @@
to_chat(user, SPAN_WARNING("[src] is out of charge."))
add_fingerprint(user)
/obj/item/melee/baton/attack(mob/living/L, mob/user, var/hit_zone)
if(!L) return
/obj/item/melee/baton/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!target_mob)
return
if(status && (user.is_clumsy()) && prob(50))
to_chat(user, SPAN_DANGER("You accidentally hit yourself with the [src]!"))
@@ -116,7 +117,7 @@
deductcharge(hitcost)
return
if(isrobot(L))
if(isrobot(target_mob))
..()
return
@@ -124,18 +125,18 @@
var/stun = stunforce
if(user.is_pacified())
to_chat(user, SPAN_NOTICE("You don't want to risk hurting [L]!"))
to_chat(user, SPAN_NOTICE("You don't want to risk hurting [target_mob]!"))
return 0
var/target_zone = check_zone(hit_zone)
target_zone = check_zone(target_zone)
if(user.a_intent == I_HURT)
if (!..()) //item/attack() does it's own messaging and logs
return 0 // item/attack() will return 1 if they hit, 0 if they missed.
stun *= 0.5
if(status) //Checks to see if the stunbaton is on.
agony *= 0.5 //whacking someone causes a much poorer contact than prodding them.
if(iscarbon(L))
var/mob/living/carbon/C = L
if(iscarbon(target_mob))
var/mob/living/carbon/C = target_mob
if(sheathed) //however breaking the skin results in a more potent electric shock or some bullshit. im a coder, not a doctor
C.electrocute_act(force * 2, src, def_zone = target_zone)
else
@@ -145,38 +146,38 @@
//we can't really extract the actual hit zone from ..(), unfortunately. Just act like they attacked the area they intended to.
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(L)
user.do_attack_animation(target_mob)
//copied from human_defense.dm - human defence code should really be refactored some time.
if (ishuman(L))
user.lastattacked = L //are these used at all, if we have logs?
L.lastattacker = user
if (ishuman(target_mob))
user.lastattacked = target_mob //are these used at all, if we have logs?
target_mob.lastattacker = user
if (user != L) // Attacking yourself can't miss
target_zone = get_zone_with_miss_chance(user.zone_sel.selecting, L)
if (user != target_mob) // Attacking yourself can't miss
target_zone = get_zone_with_miss_chance(user.zone_sel.selecting, target_mob)
if(!target_zone)
L.visible_message(SPAN_WARNING("[user] misses [L] with \the [src]!"))
target_mob.visible_message(SPAN_WARNING("[user] misses [target_mob] with \the [src]!"))
return 0
var/mob/living/carbon/human/H = L
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(target_zone)
if (affecting)
if(!status)
L.visible_message(SPAN_WARNING("[L] has been prodded in the [affecting.name] with \the [src] by [user]. Luckily it was off."))
target_mob.visible_message(SPAN_WARNING("[target_mob] has been prodded in the [affecting.name] with \the [src] by [user]. Luckily it was off."))
return 1
else
H.visible_message(SPAN_DANGER("[L] has been prodded in the [affecting.name] with \the [src] by [user]!"))
H.visible_message(SPAN_DANGER("[target_mob] has been prodded in the [affecting.name] with \the [src] by [user]!"))
var/intent = "(INTENT: [user? uppertext(user.a_intent) : "N/A"])"
admin_attack_log(user, L, "was stunned by this mob with [src] [intent]", "stunned this mob with [src] [intent]", "stunned with [src]")
admin_attack_log(user, target_mob, "was stunned by this mob with [src] [intent]", "stunned this mob with [src] [intent]", "stunned with [src]")
if(!sheathed)
H.electrocute_act(force * 2, src, ground_zero = target_zone)
if(isslime(L))
var/mob/living/carbon/slime/S = L
if(isslime(target_mob))
var/mob/living/carbon/slime/S = target_mob
if(!status)
L.visible_message(SPAN_WARNING("[S] has been prodded with \the [src] by [user]. Too bad it was off."))
target_mob.visible_message(SPAN_WARNING("[S] has been prodded with \the [src] by [user]. Too bad it was off."))
return TRUE
else
L.visible_message(SPAN_DANGER("[S] has been prodded with \the [src] by [user]!"))
target_mob.visible_message(SPAN_DANGER("[S] has been prodded with \the [src] by [user]!"))
S.discipline++
if(prob(1))
@@ -185,13 +186,13 @@
else
if(!status)
L.visible_message(SPAN_WARNING("[L] has been prodded with \the [src] by [user]. Luckily it was off."))
target_mob.visible_message(SPAN_WARNING("[target_mob] has been prodded with \the [src] by [user]. Luckily it was off."))
return TRUE
else
L.visible_message(SPAN_DANGER("[L] has been prodded with \the [src] by [user]!"))
target_mob.visible_message(SPAN_DANGER("[target_mob] has been prodded with \the [src] by [user]!"))
//stun effects
L.stun_effect_act(stun, agony, target_zone, src)
target_mob.stun_effect_act(stun, agony, target_zone, src)
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
@@ -287,11 +287,11 @@
return
/obj/item/storage/box/fancy/tray/attack(mob/living/M as mob, mob/user as mob, var/target_zone)
/obj/item/storage/box/fancy/tray/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..() && contents.len)
spill(3, get_turf(M))
playsound(M, /singleton/sound_category/tray_hit_sound, 50, 1) //sound playin' again
user.visible_message(SPAN_DANGER("[user] smashes \the [src] into [M], causing it to spill its contents across the area!"))
spill(3, get_turf(target_mob))
playsound(target_mob, /singleton/sound_category/tray_hit_sound, 50, 1) //sound playin' again
user.visible_message(SPAN_DANGER("[user] smashes \the [src] into [target_mob], causing it to spill its contents across the area!"))
/obj/item/storage/box/fancy/tray/throw_impact(atom/hit_atom)
..()
@@ -20,7 +20,7 @@
drop_sound = 'sound/items/drop/crowbar.ogg'
pickup_sound = 'sound/items/pickup/crowbar.ogg'
/obj/item/melee/classic_baton/attack(mob/M as mob, mob/living/user as mob, var/target_zone)
/obj/item/melee/classic_baton/attack(mob/living/target_mob, mob/living/user, target_zone)
if ((user.is_clumsy()) && prob(50))
to_chat(user, SPAN_WARNING("You club yourself over the head."))
user.Weaken(3 * force)
@@ -88,9 +88,9 @@
return
/obj/item/melee/telebaton/attack(mob/target, mob/living/user, var/target_zone)
/obj/item/melee/telebaton/attack(mob/living/target_mob, mob/living/user, target_zone)
if(on)
do_special_effects(target)
do_special_effects(target_mob)
if(user.is_clumsy() && prob(50))
to_chat(user, SPAN_WARNING("You club yourself over the head."))
user.Weaken(3 * force)
@@ -101,8 +101,8 @@
user.take_organ_damage(2 * force)
return
if(..() && user.a_intent == I_DISARM)
if(ishuman(target))
var/mob/living/carbon/human/T = target
if(ishuman(target_mob))
var/mob/living/carbon/human/T = target_mob
T.apply_damage(40, DAMAGE_PAIN, target_zone)
return
return ..()
+1 -1
View File
@@ -128,7 +128,7 @@
/obj/item/syndie/teleporter/set_initial_maptext()
held_maptext = SMALL_FONTS(7, "Ready")
/obj/item/syndie/teleporter/attack()
/obj/item/syndie/teleporter/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/syndie/teleporter/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
+2 -1
View File
@@ -8,7 +8,8 @@
pickup_sound = 'sound/items/pickup/cardboardbox.ogg'
surgerysound = /singleton/sound_category/rip_sound
/obj/item/tape_roll/attack(var/mob/living/carbon/human/H, var/mob/user, var/target_zone)
/obj/item/tape_roll/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/H = target_mob
if(istype(H))
if(target_zone == BP_EYES)
+11 -5
View File
@@ -103,7 +103,9 @@
..()
update_icon()
/obj/item/screwdriver/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob, var/target_zone)
/obj/item/screwdriver/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/M = target_mob
if(!istype(M) || user.a_intent == "help")
return ..()
if((target_zone != BP_EYES && target_zone != BP_HEAD) || M.eyes_protected(src, FALSE))
@@ -181,7 +183,11 @@
..()
update_icon()
/obj/item/wirecutters/attack(mob/living/carbon/C, mob/user, var/target_zone)
/obj/item/wirecutters/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/C = target_mob
if(!istype(C))
return
if(user.a_intent == I_HELP && (C.handcuffed) && (istype(C.handcuffed, /obj/item/handcuffs/cable)))
user.visible_message(SPAN_NOTICE("\The [user] cuts \the [C]'s restraints with \the [src]!"),\
SPAN_NOTICE("You cut \the [C]'s restraints with \the [src]!"),\
@@ -390,9 +396,9 @@
if (istype(location, /turf))
location.hotspot_expose(700, 5)
/obj/item/weldingtool/attack(mob/living/M, mob/user, var/target_zone)
if(ishuman(M))
var/mob/living/carbon/human/H = M
/obj/item/weldingtool/attack(mob/living/target_mob, mob/living/user, target_zone)
if(ishuman(target_mob))
var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/S = H.organs_by_name[target_zone]
if(!S)
+5 -3
View File
@@ -14,10 +14,12 @@
drop_sound = 'sound/items/drop/cloth.ogg'
pickup_sound = 'sound/items/pickup/cloth.ogg'
/obj/item/towel/attack_self(mob/living/user as mob)
attack(user,user)
/obj/item/towel/attack_self(mob/living/user)
attack(user, user)
/obj/item/towel/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/M = target_mob
/obj/item/towel/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
if(istype(M) && user.a_intent == I_HELP)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(user.on_fire)
+3 -3
View File
@@ -726,15 +726,15 @@
if(captured)
release(user, user.loc)
/obj/item/trap/animal/attack(var/target, mob/living/user)
/obj/item/trap/animal/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!deployed)
return
if(captured) // It is full
return
if(isliving(target))
var/mob/living/capturing_mob = target
if(isliving(target_mob))
var/mob/living/capturing_mob = target_mob
if(capturing_mob.mob_size > max_mob_size)
to_chat(user, SPAN_WARNING("\The [capturing_mob] doesn't fit in \the [src]!"))
return
@@ -400,7 +400,7 @@
base_block_chance = 60
shield_power = 150
/obj/item/melee/energy/vaurca_zweihander/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
/obj/item/melee/energy/vaurca_zweihander/attack(mob/living/target_mob, mob/living/user, target_zone)
user.setClickCooldown(16)
..()
+3 -3
View File
@@ -145,7 +145,7 @@
throw_range = 15
attack_verb = list("banned")
/obj/item/banhammer/attack(mob/M as mob, mob/user as mob)
to_chat(M, SPAN_WARNING("<b> You have been banned FOR NO REISIN by [user]</b>"))
to_chat(user, SPAN_WARNING(" You have <b>BANNED</b> [M]"))
/obj/item/banhammer/attack(mob/living/target_mob, mob/living/user, target_zone)
to_chat(target_mob, SPAN_WARNING("<b> You have been banned FOR NO REISIN by [user]</b>"))
to_chat(user, SPAN_WARNING(" You have <b>BANNED</b> [target_mob]"))
playsound(loc, 'sound/effects/adminhelp.ogg', 15)
+8 -9
View File
@@ -25,19 +25,19 @@
if(user.isSynthetic())
to_chat(user, SPAN_NOTICE("\The [src] does not seem to be doing anything, but you can feel it. A signal, beyond anything you can consciously understand, weaving and scratching a shield around the back of your mind."))
/obj/structure/ecd/attackby(obj/item/W, mob/user)
if(W.iswrench())
/obj/structure/ecd/attackby(obj/item/attacking_item, mob/user, params)
if(attacking_item.iswrench())
switch(state)
if(ECD_LOOSE)
state = ECD_BOLTED
W.play_tool_sound(get_turf(src), 75)
attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."), \
SPAN_NOTICE("You secure \the [src]'s external reinforcing bolts to the floor."), \
SPAN_WARNING("You hear a ratcheting noise."))
anchored = TRUE
if(ECD_BOLTED)
state = ECD_LOOSE
W.play_tool_sound(get_turf(src), 75)
attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src]'s reinforcing bolts from the floor."), \
SPAN_NOTICE("You undo \the [src]'s external reinforcing bolts."), \
SPAN_WARNING("You hear a ratcheting noise."))
@@ -46,8 +46,8 @@
to_chat(user, SPAN_WARNING("\The [src] needs to be unwelded from the floor."))
return
if(W.iswelder())
var/obj/item/weldingtool/WT = W
if(attacking_item.iswelder())
var/obj/item/weldingtool/WT = attacking_item
switch(state)
if(ECD_LOOSE)
to_chat(user, SPAN_WARNING("\The [src] needs to be wrenched to the floor."))
@@ -57,7 +57,7 @@
user.visible_message(SPAN_NOTICE("\The [user] starts to weld \the [src] to the floor."), \
SPAN_NOTICE("You start to weld \the [src] to the floor."), \
SPAN_WARNING("You hear the sound of metal being welded."))
if(W.use_tool(src, user, 20, volume = 50))
if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src || !WT.isOn())
return
state = ECD_WELDED
@@ -70,14 +70,13 @@
user.visible_message(SPAN_NOTICE("\The [user] starts to cut \the [src] free from the floor."), \
SPAN_NOTICE("You start to cut \the [src] free from the floor."), \
SPAN_WARNING("You hear the sound of metal being welded."))
if(W.use_tool(src, user, 20, volume = 50))
if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src || !WT.isOn())
return
state = ECD_BOLTED
to_chat(user, SPAN_NOTICE("You cut \the [src] free from the floor."))
else
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
return
#undef ECD_LOOSE
#undef ECD_BOLTED
+4 -4
View File
@@ -33,21 +33,21 @@
if(start_deployed)
deploy()
/obj/structure/survey_probe/attackby(obj/item/item, mob/living/user)
if(!timer_id && item.iswrench())
/obj/structure/survey_probe/attackby(obj/item/attacking_item, mob/user, params)
if(!timer_id && attacking_item.iswrench())
if(!anchored)
user.visible_message(
SPAN_NOTICE("\The [user] unfastens the locking bolts on \the [src], deploying it."),
SPAN_NOTICE("You unfasten the locking bolts on \the [src], and it deploys, lowering its devices and drill bits to the ground. It is ready to survey."),
)
item.play_tool_sound(user, 30)
attacking_item.play_tool_sound(user, 30)
deploy()
else
user.visible_message(
SPAN_NOTICE("\The [user] fastens the locking bolts on \the [src], stowing it."),
SPAN_NOTICE("You fasten the locking bolts \the [src], stowing it. It retracts its devices and drill bits."),
)
item.play_tool_sound(user, 30)
attacking_item.play_tool_sound(user, 30)
undeploy()
/obj/structure/survey_probe/attack_hand(mob/user as mob)