mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 16:10:02 +01:00
Some refactors, DMDoc and UT (#18365)
* dsfa * accessories fix * fixed "has been hit by" message with intent check * sdfa
This commit is contained in:
@@ -214,13 +214,13 @@
|
||||
else
|
||||
. += "This one seems particularly lifeless. Perhaps it will regain some of its luster later.."
|
||||
|
||||
/obj/item/organ/internal/brain/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/surgery/surgicaldrill))
|
||||
/obj/item/organ/internal/brain/attackby(obj/item/attacking_item, mob/user)
|
||||
if(istype(attacking_item, /obj/item/surgery/surgicaldrill))
|
||||
if(!can_prepare)
|
||||
to_chat(user, SPAN_WARNING("\The [src] cannot be prepared!"))
|
||||
return
|
||||
if(!prepared)
|
||||
user.visible_message(SPAN_DANGER("[user] deftly uses \the [I] to drill into \the [src]!"))
|
||||
user.visible_message(SPAN_DANGER("[user] deftly uses \the [attacking_item] to drill into \the [src]!"))
|
||||
prepared = TRUE
|
||||
else
|
||||
to_chat(user, SPAN_WARNING("The brain has already been prepared!"))
|
||||
|
||||
@@ -243,28 +243,28 @@
|
||||
continue
|
||||
. += "<span class='danger'>There is \a [I] sticking out of it.</span>"
|
||||
|
||||
/obj/item/organ/external/attackby(obj/item/W as obj, mob/user as mob)
|
||||
/obj/item/organ/external/attackby(obj/item/attacking_item, mob/user)
|
||||
switch(stage)
|
||||
if(0)
|
||||
if(istype(W,/obj/item/surgery/scalpel))
|
||||
user.visible_message("<span class='danger'><b>[user]</b> cuts [src] open with [W]!</span>")
|
||||
if(istype(attacking_item, /obj/item/surgery/scalpel))
|
||||
user.visible_message("<span class='danger'><b>[user]</b> cuts [src] open with [attacking_item]!</span>")
|
||||
stage++
|
||||
return
|
||||
if(1)
|
||||
if(istype(W,/obj/item/surgery/retractor))
|
||||
user.visible_message("<span class='danger'><b>[user]</b> cracks [src] open like an egg with [W]!</span>")
|
||||
if(istype(attacking_item, /obj/item/surgery/retractor))
|
||||
user.visible_message("<span class='danger'><b>[user]</b> cracks [src] open like an egg with [attacking_item]!</span>")
|
||||
stage++
|
||||
return
|
||||
if(2)
|
||||
if(istype(W,/obj/item/surgery/hemostat))
|
||||
if(istype(attacking_item, /obj/item/surgery/hemostat))
|
||||
if(contents.len)
|
||||
var/obj/item/removing = pick(contents)
|
||||
removing.forceMove(get_turf(user.loc))
|
||||
if(!(user.l_hand && user.r_hand))
|
||||
user.put_in_hands(removing)
|
||||
user.visible_message("<span class='danger'><b>[user]</b> extracts [removing] from [src] with [W]!</span>")
|
||||
user.visible_message("<span class='danger'><b>[user]</b> extracts [removing] from [src] with [attacking_item]!</span>")
|
||||
else
|
||||
user.visible_message("<span class='danger'><b>[user]</b> fishes around fruitlessly in [src] with [W].</span>")
|
||||
user.visible_message("<span class='danger'><b>[user]</b> fishes around fruitlessly in [src] with [attacking_item].</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -116,8 +116,8 @@
|
||||
if(cell)
|
||||
cell.emp_act(severity)
|
||||
|
||||
/obj/item/organ/internal/cell/attackby(obj/item/W, mob/user)
|
||||
if(W.isscrewdriver())
|
||||
/obj/item/organ/internal/cell/attackby(obj/item/attacking_item, mob/user)
|
||||
if(attacking_item.isscrewdriver())
|
||||
if(open)
|
||||
open = FALSE
|
||||
to_chat(user, SPAN_NOTICE("You screw the battery panel in place."))
|
||||
@@ -125,7 +125,7 @@
|
||||
open = TRUE
|
||||
to_chat(user, SPAN_NOTICE("You unscrew the battery panel."))
|
||||
|
||||
if(W.iscrowbar())
|
||||
if(attacking_item.iscrowbar())
|
||||
if(open)
|
||||
if(cell)
|
||||
user.put_in_hands(cell)
|
||||
@@ -136,12 +136,12 @@
|
||||
else
|
||||
to_chat(user, SPAN_WARNING("You need to unscrew the battery panel first."))
|
||||
|
||||
if(istype(W, /obj/item/cell))
|
||||
if(istype(attacking_item, /obj/item/cell))
|
||||
if(open)
|
||||
if(cell)
|
||||
to_chat(user, SPAN_WARNING("There is a power cell already installed."))
|
||||
else if(user.unEquip(W, src))
|
||||
replace_cell(W)
|
||||
else if(user.unEquip(attacking_item, src))
|
||||
replace_cell(attacking_item)
|
||||
to_chat(user, SPAN_NOTICE("You insert \the [cell]."))
|
||||
else
|
||||
to_chat(user, SPAN_WARNING("You need to unscrew the battery panel first."))
|
||||
@@ -237,12 +237,12 @@
|
||||
. += SPAN_NOTICE("Ownership Info: [ownership_info]")
|
||||
. += SPAN_NOTICE("Citizenship Info: [citizenship_info]")
|
||||
|
||||
/obj/item/organ/internal/ipc_tag/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/ipc_tag_scanner))
|
||||
/obj/item/organ/internal/ipc_tag/attackby(obj/item/attacking_item, mob/user)
|
||||
if(istype(attacking_item, /obj/item/ipc_tag_scanner))
|
||||
if(src.loc != user)
|
||||
to_chat(user, SPAN_WARNING("You can't scan \the [src] if it's not on your person!"))
|
||||
return
|
||||
var/obj/item/ipc_tag_scanner/S = W
|
||||
var/obj/item/ipc_tag_scanner/S = attacking_item
|
||||
if(!S.powered)
|
||||
to_chat(user, SPAN_WARNING("\The [src] reads, \"Scanning failure, please submit scanner for repairs.\""))
|
||||
return
|
||||
@@ -254,31 +254,38 @@
|
||||
if(src.loc != user)
|
||||
to_chat(user, SPAN_WARNING("You can only modify \the [src] if it's on your person!"))
|
||||
return
|
||||
|
||||
var/static/list/modification_options = list("Serial Number", "Ownership Status", "Citizenship")
|
||||
var/choice = input(user, "How do you want to modify the IPC tag?", "IPC Tag Modification") as null|anything in modification_options
|
||||
if(choice)
|
||||
if(choice == "Serial Number")
|
||||
var/serial_selection = alert(user, "In what way do you want to modify the serial number?", "Serial Number Selection", "Auto Generation", "Manual Input", "Cancel")
|
||||
var/choice = tgui_input_list(user, "How do you want to modify the IPC tag?", "IPC Tag Modification", modification_options)
|
||||
switch(choice)
|
||||
|
||||
if("Serial Number")
|
||||
var/serial_selection = tgui_input_list(user, "In what way do you want to modify the serial number?","Serial Number Selection",
|
||||
list("Auto Generation", "Manual Input", "Cancel"), default = "Cancel")
|
||||
if(serial_selection != "Cancel")
|
||||
if(serial_selection == "Auto Generation")
|
||||
var/auto_generation_choice = alert(user, "Do you wish for the IPC tag to automatically generate its serial number based on the IPCs name?", "Serial Autogeneration", "Yes", "No")
|
||||
var/auto_generation_choice = tgui_input_list(user, "Do you wish for the IPC tag to automatically generate its serial number based on the IPCs name?", "Serial Autogeneration",
|
||||
list("Yes", "No"), "No")
|
||||
if(auto_generation_choice == "Yes")
|
||||
auto_generate = TRUE
|
||||
else
|
||||
auto_generate = FALSE
|
||||
|
||||
if(serial_selection == "Manual Input")
|
||||
var/new_serial = input(user, "What do you wish for the new serial number to be? (Limit of 12 characters)", "Serial Number Modification", serial_number) as text|null
|
||||
var/new_serial = tgui_input_text(user, "What do you wish for the new serial number to be? (Limit of 12 characters)", "Serial Number Modification", serial_number, 12)
|
||||
new_serial = uppertext(dd_limittext(new_serial, 12))
|
||||
if(new_serial)
|
||||
serial_number = new_serial
|
||||
auto_generate = FALSE
|
||||
if(choice == "Ownership Status")
|
||||
|
||||
if("Ownership Status")
|
||||
var/static/list/ownership_options = list(IPC_OWNERSHIP_COMPANY, IPC_OWNERSHIP_PRIVATE, IPC_OWNERSHIP_SELF)
|
||||
var/new_ownership = input(user, "What do you wish for the new ownership status to be?", "Ownership Status Modification") as null|anything in ownership_options
|
||||
var/new_ownership = tgui_input_list(user, "What do you wish for the new ownership status to be?", "Ownership Status Modification", ownership_options)
|
||||
if(new_ownership)
|
||||
ownership_info = new_ownership
|
||||
if(choice == "Citizenship")
|
||||
var/datum/citizenship/citizenship = input(user, "What do you wish for the new citizenship setting to be?", "Citizenship Setting Modification") as null|anything in SSrecords.citizenships
|
||||
|
||||
if("Citizenship")
|
||||
var/datum/citizenship/citizenship = tgui_input_list(user, "What do you wish for the new citizenship setting to be?", "Citizenship Setting Modification", SSrecords.citizenships)
|
||||
if(citizenship)
|
||||
citizenship_info = citizenship
|
||||
else
|
||||
|
||||
@@ -357,12 +357,12 @@
|
||||
descriptive = "cold"
|
||||
. += "<span class='notice'>\The [src] feels [descriptive].</span>"
|
||||
|
||||
/obj/item/organ/internal/vaurca/preserve/attackby(obj/item/W as obj, mob/user as mob)
|
||||
/obj/item/organ/internal/vaurca/preserve/attackby(obj/item/attacking_item, mob/user)
|
||||
..()
|
||||
var/obj/icon = src
|
||||
|
||||
if ((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
|
||||
user.visible_message("<span class='warning'>[user] has used [W] on [icon2html(icon, viewers(get_turf(user)))] [src].</span>")
|
||||
if ((istype(attacking_item, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
|
||||
user.visible_message("<span class='warning'>[user] has used [attacking_item] on [icon2html(icon, viewers(get_turf(user)))] [src].</span>")
|
||||
|
||||
var/pressure = air_contents.return_pressure()
|
||||
manipulated_by = user.real_name //This person is aware of the contents of the tank.
|
||||
@@ -377,8 +377,8 @@
|
||||
else
|
||||
to_chat(user, "<span class='notice'>Tank is empty!</span>")
|
||||
src.add_fingerprint(user)
|
||||
else if (istype(W,/obj/item/toy/balloon))
|
||||
var/obj/item/toy/balloon/B = W
|
||||
else if (istype(attacking_item, /obj/item/toy/balloon))
|
||||
var/obj/item/toy/balloon/B = attacking_item
|
||||
B.blow(src)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user