mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-05 23:12:26 +00:00
Added construction drone variant, updated the construction area map slightly.
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
|
||||
//Used for self-mailing.
|
||||
var/mail_destination = ""
|
||||
var/obj/machinery/drone_fabricator/master_fabricator
|
||||
var/law_type = /datum/ai_laws/drone
|
||||
var/can_pull_size = 2
|
||||
var/can_pull_mobs
|
||||
|
||||
holder_type = /obj/item/weapon/holder/drone
|
||||
|
||||
@@ -36,9 +40,6 @@
|
||||
add_language("Robot Talk", 0)
|
||||
add_language("Drone Talk", 1)
|
||||
|
||||
if(camera && "Robots" in camera.network)
|
||||
camera.add_network("Engineering")
|
||||
|
||||
//They are unable to be upgraded, so let's give them a bit of a better battery.
|
||||
cell.maxcharge = 10000
|
||||
cell.charge = 10000
|
||||
@@ -52,15 +53,15 @@
|
||||
C.max_damage = 10
|
||||
|
||||
verbs -= /mob/living/silicon/robot/verb/Namepick
|
||||
module = new /obj/item/weapon/robot_module/drone(src)
|
||||
|
||||
//Some tidying-up.
|
||||
flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'NanoTrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
|
||||
updateicon()
|
||||
|
||||
/mob/living/silicon/robot/drone/init()
|
||||
laws = new /datum/ai_laws/drone()
|
||||
laws = new law_type
|
||||
aiCamera = new/obj/item/device/camera/siliconcam/drone_camera(src)
|
||||
if(camera && "Robots" in camera.network)
|
||||
camera.add_network("Engineering")
|
||||
module = new /obj/item/weapon/robot_module/drone(src)
|
||||
flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'NanoTrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
|
||||
|
||||
//Redefining some robot procs...
|
||||
@@ -185,7 +186,7 @@
|
||||
//Drones killed by damage will gib.
|
||||
/mob/living/silicon/robot/drone/handle_regular_status_updates()
|
||||
|
||||
if(health <= -35 && src.stat != 2)
|
||||
if((health <= -35 || (master_fabricator && src.z != master_fabricator.z)) && src.stat != 2)
|
||||
timeofdeath = world.time
|
||||
death() //Possibly redundant, having trouble making death() cooperate.
|
||||
gib()
|
||||
@@ -219,7 +220,7 @@
|
||||
clear_supplied_laws()
|
||||
clear_inherent_laws()
|
||||
clear_ion_laws()
|
||||
laws = new /datum/ai_laws/drone
|
||||
laws = new law_type
|
||||
|
||||
//Reboot procs.
|
||||
|
||||
@@ -267,17 +268,33 @@
|
||||
..()
|
||||
else if(istype(AM,/obj/item))
|
||||
var/obj/item/O = AM
|
||||
if(O.w_class > 2)
|
||||
if(O.w_class > can_pull_size)
|
||||
src << "<span class='warning'>You are too small to pull that.</span>"
|
||||
return
|
||||
else
|
||||
..()
|
||||
else
|
||||
src << "<span class='warning'>You are too small to pull that.</span>"
|
||||
return
|
||||
if(!can_pull_mobs)
|
||||
src << "<span class='warning'>You are too small to pull that.</span>"
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/drone/add_robot_verbs()
|
||||
src.verbs |= silicon_verbs_subsystems
|
||||
|
||||
/mob/living/silicon/robot/drone/remove_robot_verbs()
|
||||
src.verbs -= silicon_verbs_subsystems
|
||||
|
||||
/mob/living/silicon/robot/drone/construction
|
||||
can_pull_size = 5
|
||||
can_pull_mobs = 1
|
||||
|
||||
/mob/living/silicon/robot/drone/construction/init()
|
||||
laws = new /datum/ai_laws/construction_drone()
|
||||
aiCamera = new/obj/item/device/camera/siliconcam/drone_camera(src)
|
||||
module = new /obj/item/weapon/robot_module/drone/construction(src)
|
||||
flavor_text = "It's a bulky construction drone stamped with a Sol Central glyph."
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
|
||||
|
||||
/mob/living/silicon/robot/drone/construction/updatename()
|
||||
real_name = "construction drone ([rand(100,999)])"
|
||||
name = real_name
|
||||
@@ -19,7 +19,7 @@
|
||||
return
|
||||
|
||||
if(!allowed(user))
|
||||
user << "\red Access denied."
|
||||
user << "<span class='danger'>Access denied.</span>"
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
@@ -27,6 +27,8 @@
|
||||
dat += "<B>Maintenance Units</B><BR>"
|
||||
|
||||
for(var/mob/living/silicon/robot/drone/D in world)
|
||||
if(D.z != src.z)
|
||||
continue
|
||||
dat += "<BR>[D.real_name] ([D.stat == 2 ? "<font color='red'>INACTIVE" : "<font color='green'>ACTIVE"]</FONT>)"
|
||||
dat += "<font dize = 9><BR>Cell charge: [D.cell.charge]/[D.cell.maxcharge]."
|
||||
dat += "<BR>Currently located in: [get_area(D)]."
|
||||
@@ -46,7 +48,7 @@
|
||||
return
|
||||
|
||||
if(!allowed(usr))
|
||||
usr << "\red Access denied."
|
||||
usr << "<span class='danger'>Access denied.</span>"
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
@@ -61,11 +63,11 @@
|
||||
return
|
||||
|
||||
drone_call_area = t_area
|
||||
usr << "\blue You set the area selector to [drone_call_area]."
|
||||
usr << "<span class='notice'>You set the area selector to [drone_call_area].</span>"
|
||||
|
||||
else if (href_list["ping"])
|
||||
|
||||
usr << "\blue You issue a maintenance request for all active drones, highlighting [drone_call_area]."
|
||||
usr << "<span class='notice'>You issue a maintenance request for all active drones, highlighting [drone_call_area].</span>"
|
||||
for(var/mob/living/silicon/robot/drone/D in world)
|
||||
if(D.client && D.stat == 0)
|
||||
D << "-- Maintenance drone presence requested in: [drone_call_area]."
|
||||
@@ -75,7 +77,7 @@
|
||||
var/mob/living/silicon/robot/drone/D = locate(href_list["resync"])
|
||||
|
||||
if(D.stat != 2)
|
||||
usr << "\red You issue a law synchronization directive for the drone."
|
||||
usr << "<span class='danger'>You issue a law synchronization directive for the drone.</span>"
|
||||
D.law_resync()
|
||||
|
||||
else if (href_list["shutdown"])
|
||||
@@ -83,7 +85,7 @@
|
||||
var/mob/living/silicon/robot/drone/D = locate(href_list["shutdown"])
|
||||
|
||||
if(D.stat != 2)
|
||||
usr << "\red You issue a kill command for the unfortunate drone."
|
||||
usr << "<span class='danger'>You issue a kill command for the unfortunate drone.</span>"
|
||||
message_admins("[key_name_admin(usr)] issued kill order for drone [key_name_admin(D)] from control console.")
|
||||
log_game("[key_name(usr)] issued kill order for [key_name(src)] from control console.")
|
||||
D.shut_down()
|
||||
@@ -98,10 +100,10 @@
|
||||
continue
|
||||
|
||||
dronefab = fab
|
||||
usr << "\blue Drone fabricator located."
|
||||
usr << "<span class='notice'>Drone fabricator located.</span>"
|
||||
return
|
||||
|
||||
usr << "\red Unable to locate drone fabricator."
|
||||
usr << "<span class='danger'>Unable to locate drone fabricator.</span>"
|
||||
|
||||
else if (href_list["toggle_fab"])
|
||||
|
||||
@@ -110,10 +112,10 @@
|
||||
|
||||
if(get_dist(src,dronefab) > 3)
|
||||
dronefab = null
|
||||
usr << "\red Unable to locate drone fabricator."
|
||||
usr << "<span class='danger'>Unable to locate drone fabricator.</span>"
|
||||
return
|
||||
|
||||
dronefab.produce_drones = !dronefab.produce_drones
|
||||
usr << "\blue You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator."
|
||||
usr << "<span class='notice'>You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator.</span>"
|
||||
|
||||
src.updateUsrDialog()
|
||||
@@ -1,3 +1,10 @@
|
||||
/proc/count_drones()
|
||||
var/drones = 0
|
||||
for(var/mob/living/silicon/robot/drone/D in world)
|
||||
if(D.key && D.client)
|
||||
drones++
|
||||
return drones
|
||||
|
||||
/obj/machinery/drone_fabricator
|
||||
name = "drone fabricator"
|
||||
desc = "A large automated factory for producing maintenance drones."
|
||||
@@ -8,13 +15,20 @@
|
||||
idle_power_usage = 20
|
||||
active_power_usage = 5000
|
||||
|
||||
var/fabricator_tag = "Exodus"
|
||||
var/drone_progress = 0
|
||||
var/produce_drones = 1
|
||||
var/time_last_drone = 500
|
||||
var/drone_type = /mob/living/silicon/robot/drone
|
||||
|
||||
icon = 'icons/obj/machines/drone_fab.dmi'
|
||||
icon_state = "drone_fab_idle"
|
||||
|
||||
/obj/machinery/drone_fabricator/derelict
|
||||
name = "construction drone fabricator"
|
||||
fabricator_tag = "Derelict"
|
||||
drone_type = /mob/living/silicon/robot/drone/construction
|
||||
|
||||
/obj/machinery/drone_fabricator/New()
|
||||
..()
|
||||
|
||||
@@ -48,13 +62,6 @@
|
||||
if(produce_drones && drone_progress >= 100 && istype(user,/mob/dead) && config.allow_drone_spawn && count_drones() < config.max_maint_drones)
|
||||
user << "<BR><B>A drone is prepared. Select 'Join As Drone' from the Ghost tab to spawn as a maintenance drone.</B>"
|
||||
|
||||
/obj/machinery/drone_fabricator/proc/count_drones()
|
||||
var/drones = 0
|
||||
for(var/mob/living/silicon/robot/drone/D in world)
|
||||
if(D.key && D.client)
|
||||
drones++
|
||||
return drones
|
||||
|
||||
/obj/machinery/drone_fabricator/proc/create_drone(var/client/player)
|
||||
|
||||
if(stat & NOPOWER)
|
||||
@@ -71,13 +78,12 @@
|
||||
flick("h_lathe_leave",src)
|
||||
|
||||
time_last_drone = world.time
|
||||
var/mob/living/silicon/robot/drone/new_drone = new(get_turf(src))
|
||||
var/mob/living/silicon/robot/drone/new_drone = new drone_type(get_turf(src))
|
||||
new_drone.transfer_personality(player)
|
||||
new_drone.master_fabricator = src
|
||||
|
||||
drone_progress = 0
|
||||
|
||||
|
||||
|
||||
/mob/dead/verb/join_as_drone()
|
||||
|
||||
set category = "Ghost"
|
||||
@@ -86,11 +92,11 @@
|
||||
|
||||
|
||||
if(ticker.current_state < GAME_STATE_PLAYING)
|
||||
src << "\red The game hasn't started yet!"
|
||||
src << "<span class='danger'>The game hasn't started yet!</span>"
|
||||
return
|
||||
|
||||
if(!(config.allow_drone_spawn))
|
||||
src << "\red That verb is not currently permitted."
|
||||
src << "<span class='danger'>That verb is not currently permitted.</span>"
|
||||
return
|
||||
|
||||
if (!src.stat)
|
||||
@@ -100,14 +106,14 @@
|
||||
return 0 //something is terribly wrong
|
||||
|
||||
if(jobban_isbanned(src,"Cyborg"))
|
||||
usr << "\red You are banned from playing synthetics and cannot spawn as a drone."
|
||||
usr << "<span class='danger'>You are banned from playing synthetics and cannot spawn as a drone.</span>"
|
||||
return
|
||||
|
||||
var/deathtime = world.time - src.timeofdeath
|
||||
if(istype(src,/mob/dead/observer))
|
||||
var/mob/dead/observer/G = src
|
||||
if(G.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
|
||||
usr << "\blue <B>Upon using the antagHUD you forfeighted the ability to join the round.</B>"
|
||||
usr << "<span class='notice'>Upon using the antagHUD you forfeighted the ability to join the round.</span>"
|
||||
return
|
||||
|
||||
var/deathtimeminutes = round(deathtime / 600)
|
||||
@@ -125,16 +131,19 @@
|
||||
usr << "You must wait 10 minutes to respawn as a drone!"
|
||||
return
|
||||
|
||||
var/list/all_fabricators = list()
|
||||
for(var/obj/machinery/drone_fabricator/DF in world)
|
||||
if(DF.stat & NOPOWER || !DF.produce_drones)
|
||||
continue
|
||||
|
||||
if(DF.count_drones() >= config.max_maint_drones)
|
||||
src << "\red There are too many active drones in the world for you to spawn."
|
||||
return
|
||||
|
||||
if(DF.drone_progress >= 100)
|
||||
DF.create_drone(src.client)
|
||||
return
|
||||
all_fabricators[DF.fabricator_tag] = DF
|
||||
|
||||
src << "\red There are no available drone spawn points, sorry."
|
||||
if(!all_fabricators.len)
|
||||
src << "<span class='danger'>There are no available drone spawn points, sorry.</span>"
|
||||
return
|
||||
|
||||
var/choice = input(src,"Which fabricator do you wish to use?") as null|anything in all_fabricators
|
||||
if(choice)
|
||||
var/obj/machinery/drone_fabricator/chosen_fabricator = all_fabricators[choice]
|
||||
chosen_fabricator.create_drone(src.client)
|
||||
@@ -504,6 +504,13 @@
|
||||
P.synths = list(plastic)
|
||||
src.modules += P
|
||||
|
||||
/obj/item/weapon/robot_module/drone/construction
|
||||
name = "construction drone module"
|
||||
|
||||
/obj/item/weapon/robot_module/drone/construction/New()
|
||||
..()
|
||||
src.modules += new /obj/item/weapon/rcd/borg(src)
|
||||
|
||||
/obj/item/weapon/robot_module/drone/add_languages(var/mob/living/silicon/robot/R)
|
||||
return //not much ROM to spare in that tiny microprocessor!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user