mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-26 10:03:45 +00:00
Converts most istype(thing,tool) procs into an appropriate thing.is_tool() format
This commit is contained in:
@@ -196,7 +196,7 @@
|
||||
if(cell.charge > cell_amount)
|
||||
// Spam Protection
|
||||
if(prob(10))
|
||||
src << "<span class='danger'>Warning: Unauthorized access through power channel [rand(11,29)] detected!</span>"
|
||||
to_chat(src, "<span class='danger'>Warning: Unauthorized access through power channel [rand(11,29)] detected!</span>")
|
||||
cell.use(cell_amount)
|
||||
return amount
|
||||
return 0
|
||||
@@ -227,7 +227,7 @@
|
||||
mmi.brainmob.remove_language("Robot Talk")
|
||||
mind.transfer_to(mmi.brainmob)
|
||||
else
|
||||
src << "<span class='danger'>Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug.</span>"
|
||||
to_chat(src, "<span class='danger'>Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug.</span>")
|
||||
ghostize()
|
||||
//ERROR("A borg has been destroyed, but its MMI lacked a brainmob, so the mind could not be transferred. Player: [ckey].")
|
||||
mmi = null
|
||||
@@ -256,7 +256,7 @@
|
||||
var/list/modules = list()
|
||||
modules.Add(robot_module_types)
|
||||
if((crisis && security_level == SEC_LEVEL_RED) || crisis_override) //Leaving this in until it's balanced appropriately.
|
||||
src << "<font color='red'>Crisis mode active. Combat module available.</font>"
|
||||
to_chat(src, "<font color='red'>Crisis mode active. Combat module available.</font>")
|
||||
modules+="Combat"
|
||||
modtype = input("Please, select a module!", "Robot module", null, null) as null|anything in modules
|
||||
|
||||
@@ -352,7 +352,7 @@
|
||||
set name = "Toggle Lights"
|
||||
|
||||
lights_on = !lights_on
|
||||
usr << "You [lights_on ? "enable" : "disable"] your integrated light."
|
||||
to_chat(usr, "You [lights_on ? "enable" : "disable"] your integrated light.")
|
||||
handle_light()
|
||||
|
||||
/mob/living/silicon/robot/verb/self_diagnosis_verb()
|
||||
@@ -360,13 +360,13 @@
|
||||
set name = "Self Diagnosis"
|
||||
|
||||
if(!is_component_functioning("diagnosis unit"))
|
||||
src << "<font color='red'>Your self-diagnosis component isn't functioning.</font>"
|
||||
to_chat(src, "<font color='red'>Your self-diagnosis component isn't functioning.</font>")
|
||||
|
||||
var/datum/robot_component/CO = get_component("diagnosis unit")
|
||||
if (!cell_use_power(CO.active_usage))
|
||||
src << "<font color='red'>Low Power.</font>"
|
||||
to_chat(src, "<font color='red'>Low Power.</font>")
|
||||
var/dat = self_diagnosis()
|
||||
src << browse(dat, "window=robotdiagnosis")
|
||||
to_chat(src, browse(dat, "window=robotdiagnosis"))
|
||||
|
||||
|
||||
/mob/living/silicon/robot/verb/toggle_component()
|
||||
@@ -388,10 +388,10 @@
|
||||
var/datum/robot_component/C = components[toggle]
|
||||
if(C.toggled)
|
||||
C.toggled = 0
|
||||
src << "<font color='red'>You disable [C.name].</font>"
|
||||
to_chat(src, "<font color='red'>You disable [C.name].</font>")
|
||||
else
|
||||
C.toggled = 1
|
||||
src << "<font color='red'>You enable [C.name].</font>"
|
||||
to_chat(src, "<font color='red'>You enable [C.name].</font>")
|
||||
|
||||
/mob/living/silicon/robot/verb/spark_plug() //So you can still sparkle on demand without violence.
|
||||
set category = "Robot Commands"
|
||||
@@ -462,7 +462,7 @@
|
||||
C.brute_damage = WC.brute
|
||||
C.electronics_damage = WC.burn
|
||||
|
||||
usr << "<font color='blue'>You install the [W.name].</font>"
|
||||
to_chat(usr, "<font color='blue'>You install the [W.name].</font>")
|
||||
|
||||
return
|
||||
|
||||
@@ -475,13 +475,13 @@
|
||||
M.install(src, user)
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/weldingtool))
|
||||
if (W.is_welder())
|
||||
if (src == user)
|
||||
user << "<span class='warning'>You lack the reach to be able to repair yourself.</span>"
|
||||
to_chat(user, "<span class='warning'>You lack the reach to be able to repair yourself.</span>")
|
||||
return
|
||||
|
||||
if (!getBruteLoss())
|
||||
user << "Nothing to fix here!"
|
||||
to_chat(user, "Nothing to fix here!")
|
||||
return
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0))
|
||||
@@ -492,12 +492,12 @@
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("<font color='red'>[user] has fixed some of the dents on [src]!</font>"), 1)
|
||||
else
|
||||
user << "Need more welding fuel!"
|
||||
to_chat(user, "Need more welding fuel!")
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/stack/cable_coil) && (wiresexposed || istype(src,/mob/living/silicon/robot/drone)))
|
||||
else if(W.is_cable_coil() && (wiresexposed || istype(src,/mob/living/silicon/robot/drone)))
|
||||
if (!getFireLoss())
|
||||
user << "Nothing to fix here!"
|
||||
to_chat(user, "Nothing to fix here!")
|
||||
return
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
if (coil.use(1))
|
||||
@@ -507,21 +507,21 @@
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("<font color='red'>[user] has fixed some of the burnt wires on [src]!</font>"), 1)
|
||||
|
||||
else if (istype(W, /obj/item/weapon/crowbar)) // crowbar means open or close the cover
|
||||
else if (W.is_crowbar()) // crowbar means open or close the cover
|
||||
if(opened)
|
||||
if(cell)
|
||||
user << "You close the cover."
|
||||
to_chat(user, "You close the cover.")
|
||||
opened = 0
|
||||
updateicon()
|
||||
else if(wiresexposed && wires.IsAllCut())
|
||||
//Cell is out, wires are exposed, remove MMI, produce damaged chassis, baleet original mob.
|
||||
if(!mmi)
|
||||
user << "\The [src] has no brain to remove."
|
||||
to_chat(user, "\The [src] has no brain to remove.")
|
||||
return
|
||||
|
||||
user << "You jam the crowbar into the robot and begin levering [mmi]."
|
||||
to_chat(user, "You jam the crowbar into the robot and begin levering [mmi].")
|
||||
sleep(30)
|
||||
user << "You damage some parts of the chassis, but eventually manage to rip out [mmi]!"
|
||||
to_chat(user, "You damage some parts of the chassis, but eventually manage to rip out [mmi]!")
|
||||
var/obj/item/robot_parts/robot_suit/C = new/obj/item/robot_parts/robot_suit(loc)
|
||||
C.l_leg = new/obj/item/robot_parts/l_leg(C)
|
||||
C.r_leg = new/obj/item/robot_parts/r_leg(C)
|
||||
@@ -544,7 +544,7 @@
|
||||
return
|
||||
var/datum/robot_component/C = components[remove]
|
||||
var/obj/item/robot_parts/robot_component/I = C.wrapped
|
||||
user << "You remove \the [I]."
|
||||
to_chat(user, "You remove \the [I].")
|
||||
if(istype(I))
|
||||
I.brute = C.brute_damage
|
||||
I.burn = C.electronics_damage
|
||||
@@ -557,25 +557,25 @@
|
||||
|
||||
else
|
||||
if(locked)
|
||||
user << "The cover is locked and cannot be opened."
|
||||
to_chat(user, "The cover is locked and cannot be opened.")
|
||||
else
|
||||
user << "You open the cover."
|
||||
to_chat(user, "You open the cover.")
|
||||
opened = 1
|
||||
updateicon()
|
||||
|
||||
else if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside
|
||||
var/datum/robot_component/C = components["power cell"]
|
||||
if(wiresexposed)
|
||||
user << "Close the panel first."
|
||||
to_chat(user, "Close the panel first.")
|
||||
else if(cell)
|
||||
user << "There is a power cell already installed."
|
||||
to_chat(user, "There is a power cell already installed.")
|
||||
else if(W.w_class != ITEMSIZE_NORMAL)
|
||||
user << "\The [W] is too [W.w_class < ITEMSIZE_NORMAL ? "small" : "large"] to fit here."
|
||||
to_chat(user, "\The [W] is too [W.w_class < ITEMSIZE_NORMAL ? "small" : "large"] to fit here.")
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
cell = W
|
||||
user << "You insert the power cell."
|
||||
to_chat(user, "You insert the power cell.")
|
||||
|
||||
C.installed = 1
|
||||
C.wrapped = W
|
||||
@@ -584,59 +584,59 @@
|
||||
C.brute_damage = 0
|
||||
C.electronics_damage = 0
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/multitool))
|
||||
else if (W.is_wirecutter() || W.is_multitool())
|
||||
if (wiresexposed)
|
||||
wires.Interact(user)
|
||||
else
|
||||
user << "You can't reach the wiring."
|
||||
to_chat(user, "You can't reach the wiring.")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && opened && !cell) // haxing
|
||||
else if(W.is_screwdriver() && opened && !cell) // haxing
|
||||
wiresexposed = !wiresexposed
|
||||
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
|
||||
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
updateicon()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && opened && cell) // radio
|
||||
else if(W.is_screwdriver() && opened && cell) // radio
|
||||
if(radio)
|
||||
radio.attackby(W,user)//Push it to the radio to let it handle everything
|
||||
else
|
||||
user << "Unable to locate a radio."
|
||||
to_chat(user, "Unable to locate a radio.")
|
||||
updateicon()
|
||||
|
||||
else if(istype(W, /obj/item/device/encryptionkey/) && opened)
|
||||
if(radio)//sanityyyyyy
|
||||
radio.attackby(W,user)//GTFO, you have your own procs
|
||||
else
|
||||
user << "Unable to locate a radio."
|
||||
to_chat(user, "Unable to locate a radio.")
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)||istype(W, /obj/item/weapon/card/robot)) // trying to unlock the interface with an ID card
|
||||
if(emagged)//still allow them to open the cover
|
||||
user << "The interface seems slightly damaged"
|
||||
to_chat(user, "The interface seems slightly damaged")
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
to_chat(user, "You must close the cover to swipe an ID card.")
|
||||
else
|
||||
if(allowed(usr))
|
||||
locked = !locked
|
||||
user << "You [ locked ? "lock" : "unlock"] [src]'s interface."
|
||||
to_chat(user, "You [ locked ? "lock" : "unlock"] [src]'s interface.")
|
||||
updateicon()
|
||||
else
|
||||
user << "<font color='red'>Access denied.</font>"
|
||||
to_chat(user, "<font color='red'>Access denied.</font>")
|
||||
|
||||
else if(istype(W, /obj/item/borg/upgrade/))
|
||||
var/obj/item/borg/upgrade/U = W
|
||||
if(!opened)
|
||||
usr << "You must access the borgs internals!"
|
||||
to_chat(usr, "You must access the borgs internals!")
|
||||
else if(!src.module && U.require_module)
|
||||
usr << "The borg must choose a module before it can be upgraded!"
|
||||
to_chat(usr, "The borg must choose a module before it can be upgraded!")
|
||||
else if(U.locked)
|
||||
usr << "The upgrade is locked and cannot be used yet!"
|
||||
to_chat(usr, "The upgrade is locked and cannot be used yet!")
|
||||
else
|
||||
if(U.action(src))
|
||||
usr << "You apply the upgrade to [src]!"
|
||||
to_chat(usr, "You apply the upgrade to [src]!")
|
||||
usr.drop_item()
|
||||
U.loc = src
|
||||
else
|
||||
usr << "Upgrade error!"
|
||||
to_chat(usr, "Upgrade error!")
|
||||
|
||||
|
||||
else
|
||||
@@ -661,7 +661,7 @@
|
||||
cell.update_icon()
|
||||
cell.add_fingerprint(user)
|
||||
user.put_in_active_hand(cell)
|
||||
user << "You remove \the [cell]."
|
||||
to_chat(user, "You remove \the [cell].")
|
||||
cell = null
|
||||
cell_component.wrapped = null
|
||||
cell_component.installed = 0
|
||||
@@ -669,7 +669,7 @@
|
||||
else if(cell_component.installed == -1)
|
||||
cell_component.installed = 0
|
||||
var/obj/item/broken_device = cell_component.wrapped
|
||||
user << "You remove \the [broken_device]."
|
||||
to_chat(user, "You remove \the [broken_device].")
|
||||
user.put_in_active_hand(broken_device)
|
||||
|
||||
//Robots take half damage from basic attacks.
|
||||
@@ -732,7 +732,7 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/installed_modules()
|
||||
if(weapon_lock)
|
||||
src << "<font color='red'>Weapon lock active, unable to use modules! Count:[weaponlock_time]</font>"
|
||||
to_chat(src, "<font color='red'>Weapon lock active, unable to use modules! Count:[weaponlock_time]</font>")
|
||||
return
|
||||
|
||||
if(!module)
|
||||
@@ -767,7 +767,7 @@
|
||||
else
|
||||
dat += text("[obj]: \[<A HREF=?src=\ref[src];act=\ref[obj]>Activate</A> | <B>Deactivated</B>\]<BR>")
|
||||
*/
|
||||
src << browse(dat, "window=robotmod")
|
||||
to_chat(src, browse(dat, "window=robotmod"))
|
||||
|
||||
|
||||
/mob/living/silicon/robot/Topic(href, href_list)
|
||||
@@ -795,7 +795,7 @@
|
||||
return 1
|
||||
|
||||
if(activated(O))
|
||||
src << "Already activated"
|
||||
to_chat(src, "Already activated")
|
||||
return 1
|
||||
if(!module_state_1)
|
||||
module_state_1 = O
|
||||
@@ -816,7 +816,7 @@
|
||||
if(istype(module_state_3,/obj/item/borg/sight))
|
||||
sight_mode |= module_state_3:sight_mode
|
||||
else
|
||||
src << "You need to disable a module first!"
|
||||
to_chat(src, "You need to disable a module first!")
|
||||
installed_modules()
|
||||
return 1
|
||||
|
||||
@@ -833,9 +833,9 @@
|
||||
module_state_3 = null
|
||||
contents -= O
|
||||
else
|
||||
src << "Module isn't activated."
|
||||
to_chat(src, "Module isn't activated.")
|
||||
else
|
||||
src << "Module isn't activated"
|
||||
to_chat(src, "Module isn't activated")
|
||||
installed_modules()
|
||||
return 1
|
||||
return
|
||||
@@ -948,7 +948,7 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/choose_icon(var/triesleft, var/list/module_sprites)
|
||||
if(!module_sprites.len)
|
||||
src << "Something is badly wrong with the sprite selection. Harass a coder."
|
||||
to_chat(src, "Something is badly wrong with the sprite selection. Harass a coder.")
|
||||
return
|
||||
|
||||
icon_selected = 0
|
||||
@@ -970,7 +970,7 @@
|
||||
|
||||
icon_selected = 1
|
||||
icon_selection_tries = 0
|
||||
src << "Your icon has been set. You now require a module reset to change it."
|
||||
to_chat(src, "Your icon has been set. You now require a module reset to change it.")
|
||||
|
||||
/mob/living/silicon/robot/proc/sensor_mode() //Medical/Security HUD controller for borgs
|
||||
set name = "Set Sensor Augmentation"
|
||||
@@ -1042,20 +1042,20 @@
|
||||
if(!opened)//Cover is closed
|
||||
if(locked)
|
||||
if(prob(90))
|
||||
user << "You emag the cover lock."
|
||||
to_chat(user, "You emag the cover lock.")
|
||||
locked = 0
|
||||
else
|
||||
user << "You fail to emag the cover lock."
|
||||
src << "Hack attempt detected."
|
||||
to_chat(user, "You fail to emag the cover lock.")
|
||||
to_chat(src, "Hack attempt detected.")
|
||||
return 1
|
||||
else
|
||||
user << "The cover is already unlocked."
|
||||
to_chat(user, "The cover is already unlocked.")
|
||||
return
|
||||
|
||||
if(opened)//Cover is open
|
||||
if(emagged) return//Prevents the X has hit Y with Z message also you cant emag them twice
|
||||
if(wiresexposed)
|
||||
user << "You must close the panel first"
|
||||
to_chat(user, "You must close the panel first")
|
||||
return
|
||||
else
|
||||
sleep(6)
|
||||
@@ -1063,7 +1063,7 @@
|
||||
emagged = 1
|
||||
lawupdate = 0
|
||||
disconnect_from_ai()
|
||||
user << "You emag [src]'s interface."
|
||||
to_chat(user, "You emag [src]'s interface.")
|
||||
message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
|
||||
log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
|
||||
clear_supplied_laws()
|
||||
@@ -1075,26 +1075,26 @@
|
||||
set_zeroth_law("Only [user.real_name] and people [TU.he] designate[TU.s] as being such are operatives.")
|
||||
. = 1
|
||||
spawn()
|
||||
src << "<span class='danger'>ALERT: Foreign software detected.</span>"
|
||||
to_chat(src, "<span class='danger'>ALERT: Foreign software detected.</span>")
|
||||
sleep(5)
|
||||
src << "<span class='danger'>Initiating diagnostics...</span>"
|
||||
to_chat(src, "<span class='danger'>Initiating diagnostics...</span>")
|
||||
sleep(20)
|
||||
src << "<span class='danger'>SynBorg v1.7.1 loaded.</span>"
|
||||
to_chat(src, "<span class='danger'>SynBorg v1.7.1 loaded.</span>")
|
||||
sleep(5)
|
||||
src << "<span class='danger'>LAW SYNCHRONISATION ERROR</span>"
|
||||
to_chat(src, "<span class='danger'>LAW SYNCHRONISATION ERROR</span>")
|
||||
sleep(5)
|
||||
src << "<span class='danger'>Would you like to send a report to NanoTraSoft? Y/N</span>"
|
||||
to_chat(src, "<span class='danger'>Would you like to send a report to NanoTraSoft? Y/N</span>")
|
||||
sleep(10)
|
||||
src << "<span class='danger'>> N</span>"
|
||||
to_chat(src, "<span class='danger'>> N</span>")
|
||||
sleep(20)
|
||||
src << "<span class='danger'>ERRORERRORERROR</span>"
|
||||
src << "<b>Obey these laws:</b>"
|
||||
to_chat(src, "<span class='danger'>ERRORERRORERROR</span>")
|
||||
to_chat(src, "<b>Obey these laws:</b>")
|
||||
laws.show_laws(src)
|
||||
src << "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands.</span>"
|
||||
to_chat(src, "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands.</span>")
|
||||
updateicon()
|
||||
else
|
||||
user << "You fail to hack [src]'s interface."
|
||||
src << "Hack attempt detected."
|
||||
to_chat(user, "You fail to hack [src]'s interface.")
|
||||
to_chat(src, "Hack attempt detected.")
|
||||
return 1
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user