mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 20:37:34 +01:00
Drone Designators (#12302)
This commit is contained in:
@@ -10,4 +10,14 @@
|
||||
loc_type = GS_LOC_ATOM
|
||||
atom_add_message = "Someone is attempting to reboot a mining drone!"
|
||||
|
||||
spawn_mob = /mob/living/silicon/robot/drone/mining
|
||||
spawn_mob = /mob/living/silicon/robot/drone/mining
|
||||
|
||||
/datum/ghostspawner/mining_drone/spawn_mob(mob/user)
|
||||
var/drone_tag = sanitizeSafe(input(user, "Select a tag for your mining drone, for example, 'MD' would appear as 'NT-MD-[rand(100,999)]'. (Max length: 3 Characters)", "Name Tag Selection"), 4)
|
||||
if(!drone_tag)
|
||||
drone_tag = "MD"
|
||||
drone_tag = uppertext(drone_tag)
|
||||
var/mob/living/silicon/robot/drone/mining/M = ..()
|
||||
if(M)
|
||||
M.set_name("NT-[drone_tag]-[rand(100,999)]")
|
||||
return M
|
||||
@@ -47,6 +47,34 @@
|
||||
return FALSE
|
||||
fabricator = all_fabricators[choice]
|
||||
|
||||
if(user && fabricator && !((fabricator.stat & NOPOWER) || !fabricator.produce_drones || fabricator.drone_progress < 100))
|
||||
return fabricator.create_drone(user.client)
|
||||
return FALSE
|
||||
if(!fabricator_check(fabricator, user))
|
||||
return FALSE
|
||||
|
||||
var/drone_tag = sanitizeSafe(input(user, "Select a tag for your maintenance drone, for example, 'MT' would appear as 'maintenance drone (MT-[rand(100,999)])'. (Max length: 3 Characters)", "Name Tag Selection"), 4)
|
||||
if(!drone_tag)
|
||||
drone_tag = "MT"
|
||||
drone_tag = uppertext(drone_tag)
|
||||
|
||||
if(!fabricator_check(fabricator, user))
|
||||
return FALSE
|
||||
|
||||
return fabricator.create_drone(user.client, drone_tag)
|
||||
|
||||
/datum/ghostspawner/simplemob/maintdrone/proc/fabricator_check(var/obj/machinery/drone_fabricator/fabricator, var/mob/user)
|
||||
if(!fabricator)
|
||||
to_chat(user, SPAN_WARNING("Something has gone wrong and the fabricator couldn't be found! Make a github issue about this."))
|
||||
return FALSE
|
||||
|
||||
if(!fabricator.produce_drones)
|
||||
to_chat(user, SPAN_WARNING("The fabricator's drone production has been disabled, try again."))
|
||||
return FALSE
|
||||
|
||||
if(fabricator.stat & NOPOWER)
|
||||
to_chat(user, SPAN_WARNING("The fabricator has lost power, try again."))
|
||||
return FALSE
|
||||
|
||||
if(fabricator.drone_progress < 100)
|
||||
to_chat(user, SPAN_WARNING("The fabricator isn't ready to produce another drone, try again."))
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
@@ -1,4 +1,5 @@
|
||||
/mob/living/silicon/robot/drone/mining
|
||||
name = "NT-MD-000"
|
||||
icon_state = "miningdrone"
|
||||
mod_type = "Mining"
|
||||
law_type = /datum/ai_laws/mining_drone
|
||||
@@ -60,10 +61,6 @@
|
||||
output_text += " a jackhammer drill mounted to it."
|
||||
to_chat(user, SPAN_NOTICE(output_text))
|
||||
|
||||
/mob/living/silicon/robot/drone/mining/updatename()
|
||||
real_name = "NT-I-[rand(100,999)]"
|
||||
name = real_name
|
||||
|
||||
/mob/living/silicon/robot/drone/mining/init()
|
||||
ai_camera = new /obj/item/device/camera/siliconcam/drone_camera(src)
|
||||
if(!laws)
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
|
||||
/mob/living/silicon/robot/drone
|
||||
// Look and feel
|
||||
name = "drone"
|
||||
real_name = "drone"
|
||||
name = "maintenance drone"
|
||||
desc_info = "Drones are player-controlled synthetics which are lawed to maintain the station and not \
|
||||
interact with anyone else, except for other drones. They hold a wide array of tools to build, repair, maintain, and clean. \
|
||||
They fuction similarly to other synthetics, in that they require recharging regularly, have laws, and are resilient to many hazards, \
|
||||
@@ -122,6 +121,7 @@
|
||||
|
||||
/mob/living/silicon/robot/drone/construction
|
||||
// Look and feel
|
||||
name = "construction drone"
|
||||
icon_state = "constructiondrone"
|
||||
|
||||
// Components
|
||||
@@ -168,9 +168,6 @@
|
||||
/mob/living/silicon/robot/drone/construction/matriarch/request_player()
|
||||
SSghostroles.add_spawn_atom("matriarchmaintdrone", src)
|
||||
|
||||
/mob/living/silicon/robot/drone/construction/matriarch/updatename()
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/drone/Initialize()
|
||||
. = ..()
|
||||
|
||||
@@ -215,8 +212,7 @@
|
||||
name = real_name
|
||||
|
||||
/mob/living/silicon/robot/drone/updatename()
|
||||
real_name = "maintenance drone ([rand(100,999)])"
|
||||
name = real_name
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/drone/setup_icon_cache()
|
||||
cached_eye_overlays = list(
|
||||
@@ -516,10 +512,6 @@
|
||||
to_chat(src, SPAN_NOTICE("Use <b>:d</b> to talk to other drones and <b>say</b> to speak silently to your nearby fellows."))
|
||||
to_chat(src, SPAN_NOTICE("<b>You do not follow orders from anyone; not the AI, not humans, and not other synthetics.</b>."))
|
||||
|
||||
/mob/living/silicon/robot/drone/construction/updatename()
|
||||
real_name = "construction drone ([rand(100,999)])"
|
||||
name = real_name
|
||||
|
||||
/mob/living/silicon/robot/drone/construction/process_level_restrictions()
|
||||
//Abort if they should not get blown
|
||||
if(lock_charge || scrambled_codes || emagged)
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
if(produce_drones && drone_progress >= 100 && istype(user,/mob/abstract) && config.allow_drone_spawn && count_drones() < config.max_maint_drones)
|
||||
to_chat(user, SPAN_NOTICE("<B>A drone is prepared. use 'Ghost Spawner' from the Ghost tab to spawn as a maintenance drone.</B>"))
|
||||
|
||||
/obj/machinery/drone_fabricator/proc/create_drone(var/client/player)
|
||||
/obj/machinery/drone_fabricator/proc/create_drone(var/client/player, var/drone_tag)
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
if(!produce_drones || !config.allow_drone_spawn || count_drones() >= config.max_maint_drones)
|
||||
@@ -95,7 +95,11 @@
|
||||
if(player.mob?.mind)
|
||||
player.mob.mind.reset()
|
||||
|
||||
if(!drone_tag)
|
||||
drone_tag = "MT"
|
||||
|
||||
var/mob/living/silicon/robot/drone/new_drone = new drone_type(get_turf(src))
|
||||
new_drone.set_name("[initial(new_drone.name)] ([drone_tag]-[rand(100,999)])")
|
||||
new_drone.transfer_personality(player)
|
||||
new_drone.master_fabricator = src
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
author: Geeves
|
||||
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- rscadd: "When you join as a maintenance drone, construction drone, or mining drone, you will now be prompted to enter a tag, for example, 'MT' would appear as 'maintenance drone (MT-169)'."
|
||||
Reference in New Issue
Block a user