Admin borg panel (#36990)

* borgpanel

* wip borg upgrades

* some more

* lockdown

* Update borgopanel.ract

* Update borgopanel.ract

* Update borgpanel.dm

* fuggin borg upgrades :DDD

* more compile, less whatever

* meaningless churn

* and we're done

* usr, vtec

* Update borgopanel.ract

* Update borgpanel.dm

* many squid are cool

* reviews

* coerce to client, much nicer this way

* add admin logging

* review stuff
This commit is contained in:
vuonojenmustaturska
2018-04-08 18:46:27 +03:00
committed by Nich
parent bbd4943750
commit 3b0ee90cf8
11 changed files with 579 additions and 206 deletions

View File

@@ -14,14 +14,20 @@
// if module is reset
var/one_use = FALSE
/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R)
/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R, user = usr)
if(R.stat == DEAD)
to_chat(usr, "<span class='notice'>[src] will not function on a deceased cyborg.</span>")
return 1
to_chat(user, "<span class='notice'>[src] will not function on a deceased cyborg.</span>")
return FALSE
if(module_type && !istype(R.module, module_type))
to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!")
to_chat(usr, "There's no mounting point for the module!")
return 1
to_chat(user, "There's no mounting point for the module!")
return FALSE
return TRUE
/obj/item/borg/upgrade/proc/deactivate(mob/living/silicon/robot/R, user = usr)
if (!(src in R.upgrades))
return FALSE
return TRUE
/obj/item/borg/upgrade/rename
name = "cyborg reclassification board"
@@ -34,18 +40,13 @@
heldname = stripped_input(user, "Enter new robot name", "Cyborg Reclassification", heldname, MAX_NAME_LEN)
/obj/item/borg/upgrade/rename/action(mob/living/silicon/robot/R)
if(..())
return
var/oldname = R.real_name
R.custom_name = heldname
R.updatename()
if(oldname == R.real_name)
R.notify_ai(RENAME, oldname, R.real_name)
return 1
. = ..()
if(.)
var/oldname = R.real_name
R.custom_name = heldname
R.updatename()
if(oldname == R.real_name)
R.notify_ai(RENAME, oldname, R.real_name)
/obj/item/borg/upgrade/restart
name = "cyborg emergency reboot module"
@@ -53,10 +54,10 @@
icon_state = "cyborg_upgrade1"
one_use = TRUE
/obj/item/borg/upgrade/restart/action(mob/living/silicon/robot/R)
/obj/item/borg/upgrade/restart/action(mob/living/silicon/robot/R, user = usr)
if(R.health < 0)
to_chat(usr, "<span class='warning'>You have to repair the cyborg before using this module!</span>")
return 0
to_chat(user, "<span class='warning'>You have to repair the cyborg before using this module!</span>")
return FALSE
if(R.mind)
R.mind.grab_ghost()
@@ -64,25 +65,26 @@
R.revive()
return 1
/obj/item/borg/upgrade/vtec
name = "cyborg VTEC module"
desc = "Used to kick in a cyborg's VTEC systems, increasing their speed."
icon_state = "cyborg_upgrade2"
require_module = 1
/obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R)
if(..())
return
if(R.speed < 0)
to_chat(R, "<span class='notice'>A VTEC unit is already installed!</span>")
to_chat(usr, "<span class='notice'>There's no room for another VTEC unit!</span>")
return
/obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.speed < 0)
to_chat(R, "<span class='notice'>A VTEC unit is already installed!</span>")
to_chat(user, "<span class='notice'>There's no room for another VTEC unit!</span>")
return FALSE
R.speed = -2 // Gotta go fast.
R.speed = -2 // Gotta go fast.
return 1
/obj/item/borg/upgrade/vtec/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.speed = initial(R.speed)
/obj/item/borg/upgrade/disablercooler
name = "cyborg rapid disabler cooling module"
@@ -91,38 +93,46 @@
require_module = 1
module_type = /obj/item/robot_module/security
/obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules
if(!T)
to_chat(user, "<span class='notice'>There's no disabler in this unit!</span>")
return FALSE
if(T.charge_delay <= 2)
to_chat(R, "<span class='notice'>A cooling unit is already installed!</span>")
to_chat(user, "<span class='notice'>There's no room for another cooling unit!</span>")
return FALSE
var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules
if(!T)
to_chat(usr, "<span class='notice'>There's no disabler in this unit!</span>")
return
if(T.charge_delay <= 2)
to_chat(R, "<span class='notice'>A cooling unit is already installed!</span>")
to_chat(usr, "<span class='notice'>There's no room for another cooling unit!</span>")
return
T.charge_delay = max(2 , T.charge_delay - 4)
T.charge_delay = max(2 , T.charge_delay - 4)
return 1
/obj/item/borg/upgrade/disablercooler/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules
if(!T)
return FALSE
T.charge_delay = initial(T.charge_delay)
/obj/item/borg/upgrade/thrusters
name = "ion thruster upgrade"
desc = "An energy-operated thruster system for cyborgs."
icon_state = "cyborg_upgrade3"
/obj/item/borg/upgrade/thrusters/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/thrusters/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.ionpulse)
to_chat(user, "<span class='notice'>This unit already has ion thrusters installed!</span>")
return FALSE
if(R.ionpulse)
to_chat(usr, "<span class='notice'>This unit already has ion thrusters installed!</span>")
return
R.ionpulse = TRUE
R.ionpulse = TRUE
return 1
/obj/item/borg/upgrade/thrusters/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.ionpulse = FALSE
/obj/item/borg/upgrade/ddrill
name = "mining cyborg diamond drill"
@@ -131,19 +141,30 @@
require_module = 1
module_type = /obj/item/robot_module/miner
/obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
for(var/obj/item/pickaxe/drill/cyborg/D in R.module)
R.module.remove_module(D, TRUE)
for(var/obj/item/shovel/S in R.module)
R.module.remove_module(S, TRUE)
for(var/obj/item/pickaxe/drill/cyborg/D in R.module)
R.module.remove_module(D, TRUE)
for(var/obj/item/shovel/S in R.module)
R.module.remove_module(S, TRUE)
var/obj/item/pickaxe/drill/cyborg/diamond/DD = new /obj/item/pickaxe/drill/cyborg/diamond(R.module)
R.module.basic_modules += DD
R.module.add_module(DD, FALSE, TRUE)
var/obj/item/pickaxe/drill/cyborg/diamond/DD = new /obj/item/pickaxe/drill/cyborg/diamond(R.module)
R.module.basic_modules += DD
R.module.add_module(DD, FALSE, TRUE)
return 1
/obj/item/borg/upgrade/ddrill/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
for(var/obj/item/pickaxe/drill/cyborg/diamond/DD in R.module)
R.module.remove_module(DD, TRUE)
var/obj/item/pickaxe/drill/cyborg/D = new (R.module)
R.module.basic_modules += D
R.module.add_module(D, FALSE, TRUE)
var/obj/item/shovel/S = new (R.module)
R.module.basic_modules += S
R.module.add_module(S, FALSE, TRUE)
/obj/item/borg/upgrade/soh
name = "mining cyborg satchel of holding"
@@ -153,16 +174,24 @@
module_type = /obj/item/robot_module/miner
/obj/item/borg/upgrade/soh/action(mob/living/silicon/robot/R)
if(..())
return
. = ..()
if(.)
for(var/obj/item/storage/bag/ore/cyborg/S in R.module)
R.module.remove_module(S, TRUE)
for(var/obj/item/storage/bag/ore/cyborg/S in R.module)
R.module.remove_module(S, TRUE)
var/obj/item/storage/bag/ore/holding/H = new /obj/item/storage/bag/ore/holding(R.module)
R.module.basic_modules += H
R.module.add_module(H, FALSE, TRUE)
var/obj/item/storage/bag/ore/holding/H = new /obj/item/storage/bag/ore/holding(R.module)
R.module.basic_modules += H
R.module.add_module(H, FALSE, TRUE)
return 1
/obj/item/borg/upgrade/soh/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
for(var/obj/item/storage/bag/ore/holding/H in R.module)
R.module.remove_module(H, TRUE)
var/obj/item/storage/bag/ore/cyborg/S = new (R.module)
R.module.basic_modules += S
R.module.add_module(S, FALSE, TRUE)
/obj/item/borg/upgrade/syndicate
name = "illegal equipment module"
@@ -170,16 +199,20 @@
icon_state = "cyborg_upgrade3"
require_module = 1
/obj/item/borg/upgrade/syndicate/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/syndicate/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.emagged)
return FALSE
if(R.emagged)
return
R.SetEmagged(1)
R.SetEmagged(1)
return TRUE
return 1
/obj/item/borg/upgrade/syndicate/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.SetEmagged(FALSE)
/obj/item/borg/upgrade/lavaproof
name = "mining cyborg lavaproof tracks"
@@ -189,11 +222,15 @@
require_module = 1
module_type = /obj/item/robot_module/miner
/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R)
if(..())
return
R.weather_immunities += "lava"
return 1
/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
R.weather_immunities += "lava"
/obj/item/borg/upgrade/lavaproof/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.weather_immunities -= "lava"
/obj/item/borg/upgrade/selfrepair
name = "self-repair module"
@@ -208,20 +245,26 @@
var/mob/living/silicon/robot/cyborg
var/datum/action/toggle_action
/obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/borg/upgrade/selfrepair/U = locate() in R
if(U)
to_chat(user, "<span class='warning'>This unit is already equipped with a self-repair module.</span>")
return FALSE
var/obj/item/borg/upgrade/selfrepair/U = locate() in R
if(U)
to_chat(usr, "<span class='warning'>This unit is already equipped with a self-repair module.</span>")
return 0
cyborg = R
icon_state = "selfrepair_off"
toggle_action = new /datum/action/item_action/toggle(src)
toggle_action.Grant(R)
cyborg = R
icon_state = "selfrepair_off"
toggle_action = new /datum/action/item_action/toggle(src)
toggle_action.Grant(R)
return 1
/obj/item/borg/upgrade/selfrepair/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
toggle_action.Remove(cyborg)
QDEL_NULL(toggle_action)
cyborg = null
deactivate_sr()
/obj/item/borg/upgrade/selfrepair/dropped()
addtimer(CALLBACK(src, .proc/check_dropped), 1)
@@ -231,7 +274,7 @@
toggle_action.Remove(cyborg)
QDEL_NULL(toggle_action)
cyborg = null
deactivate()
deactivate_sr()
/obj/item/borg/upgrade/selfrepair/ui_action_click()
on = !on
@@ -252,7 +295,7 @@
else
icon_state = "cyborg_upgrade5"
/obj/item/borg/upgrade/selfrepair/proc/deactivate()
/obj/item/borg/upgrade/selfrepair/proc/deactivate_sr()
STOP_PROCESSING(SSobj, src)
on = FALSE
update_icon()
@@ -265,12 +308,12 @@
if(cyborg && (cyborg.stat != DEAD) && on)
if(!cyborg.cell)
to_chat(cyborg, "<span class='warning'>Self-repair module deactivated. Please, insert the power cell.</span>")
deactivate()
deactivate_sr()
return
if(cyborg.cell.charge < powercost * 2)
to_chat(cyborg, "<span class='warning'>Self-repair module deactivated. Please recharge.</span>")
deactivate()
deactivate_sr()
return
if(cyborg.health < cyborg.maxHealth)
@@ -297,7 +340,7 @@
to_chat(cyborg, "<span class='notice'>Self-repair is active in <span class='boldnotice'>[msgmode]</span> mode.</span>")
msg_cooldown = world.time
else
deactivate()
deactivate_sr()
/obj/item/borg/upgrade/hypospray
name = "medical cyborg hypospray advanced synthesiser"
@@ -308,15 +351,21 @@
module_type = /obj/item/robot_module/medical
var/list/additional_reagents = list()
/obj/item/borg/upgrade/hypospray/action(mob/living/silicon/robot/R)
if(..())
return
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
if(H.accepts_reagent_upgrades)
for(var/re in additional_reagents)
H.add_reagent(re)
/obj/item/borg/upgrade/hypospray/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
if(H.accepts_reagent_upgrades)
for(var/re in additional_reagents)
H.add_reagent(re)
return 1
/obj/item/borg/upgrade/hypospray/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
if(H.accepts_reagent_upgrades)
for(var/re in additional_reagents)
H.del_reagent(re)
/obj/item/borg/upgrade/hypospray/expanded
name = "medical cyborg expanded hypospray"
@@ -338,19 +387,22 @@
pierce armor and thick material."
icon_state = "cyborg_upgrade3"
/obj/item/borg/upgrade/piercing_hypospray/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/piercing_hypospray/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/found_hypo = FALSE
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
H.bypass_protection = TRUE
found_hypo = TRUE
var/found_hypo = FALSE
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
H.bypass_protection = TRUE
found_hypo = TRUE
if(!found_hypo)
return FALSE
if(!found_hypo)
return
return 1
/obj/item/borg/upgrade/piercing_hypospray/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
H.bypass_protection = initial(H.bypass_protection)
/obj/item/borg/upgrade/defib
name = "medical cyborg defibrillator"
@@ -360,66 +412,81 @@
require_module = 1
module_type = /obj/item/robot_module/medical
/obj/item/borg/upgrade/defib/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/defib/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/twohanded/shockpaddles/cyborg/S = new(R.module)
R.module.basic_modules += S
R.module.add_module(S, FALSE, TRUE)
var/obj/item/twohanded/shockpaddles/cyborg/S = new(R.module)
R.module.basic_modules += S
R.module.add_module(S, FALSE, TRUE)
return 1
/obj/item/borg/upgrade/defib/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
var/obj/item/twohanded/shockpaddles/cyborg/S = locate() in R.module
R.module.remove_module(S, TRUE)
/obj/item/borg/upgrade/ai
name = "B.O.R.I.S. module"
desc = "Bluespace Optimized Remote Intelligence Synchronization. An uplink device which takes the place of an MMI in cyborg endoskeletons, creating a robotic shell controlled by an AI."
icon_state = "boris"
/obj/item/borg/upgrade/ai/action(mob/living/silicon/robot/R)
if(..())
return
if(R.shell)
to_chat(usr, "<span class='warning'>This unit is already an AI shell!</span>")
return
if(R.key) //You cannot replace a player unless the key is completely removed.
to_chat(usr, "<span class='warning'>Intelligence patterns detected in this [R.braintype]. Aborting.</span>")
return
/obj/item/borg/upgrade/ai/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.shell)
to_chat(user, "<span class='warning'>This unit is already an AI shell!</span>")
return FALSE
if(R.key) //You cannot replace a player unless the key is completely removed.
to_chat(user, "<span class='warning'>Intelligence patterns detected in this [R.braintype]. Aborting.</span>")
return FALSE
R.make_shell(src)
return TRUE
R.make_shell(src)
/obj/item/borg/upgrade/ai/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
if(R.shell)
R.undeploy()
R.notify_ai(AI_SHELL)
/obj/item/borg/upgrade/expand
name = "borg expander"
desc = "A cyborg resizer, it makes a cyborg huge."
icon_state = "cyborg_upgrade3"
/obj/item/borg/upgrade/expand/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/expand/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.hasExpanded)
to_chat(usr, "<span class='notice'>This unit already has an expand module installed!</span>")
return
if(R.hasExpanded)
to_chat(usr, "<span class='notice'>This unit already has an expand module installed!</span>")
return FALSE
R.notransform = TRUE
var/prev_lockcharge = R.lockcharge
R.SetLockdown(1)
R.anchored = TRUE
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(1, R.loc)
smoke.start()
sleep(2)
for(var/i in 1 to 4)
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1)
sleep(12)
if(!prev_lockcharge)
R.SetLockdown(0)
R.anchored = FALSE
R.notransform = FALSE
R.resize = 2
R.hasExpanded = TRUE
R.update_transform()
return TRUE
R.notransform = TRUE
var/prev_lockcharge = R.lockcharge
R.SetLockdown(1)
R.anchored = TRUE
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(1, R.loc)
smoke.start()
sleep(2)
for(var/i in 1 to 4)
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1)
sleep(12)
if(!prev_lockcharge)
R.SetLockdown(0)
R.anchored = FALSE
R.notransform = FALSE
R.resize = 2
R.hasExpanded = TRUE
R.update_transform()
/obj/item/borg/upgrade/expand/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.resize = 0.5
R.hasExpanded = FALSE
R.update_transform()
/obj/item/borg/upgrade/rped
name = "engineering cyborg RPED"
@@ -429,19 +496,25 @@
require_module = TRUE
module_type = /obj/item/robot_module/engineering
/obj/item/borg/upgrade/rped/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/rped/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R
if(RPED)
to_chat(usr, "<span class='warning'>This unit is already equipped with a RPED module.</span>")
return FALSE
var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R
if(RPED)
to_chat(user, "<span class='warning'>This unit is already equipped with a RPED module.</span>")
return FALSE
RPED = new(R.module)
R.module.basic_modules += RPED
R.module.add_module(RPED, FALSE, TRUE)
return TRUE
RPED = new(R.module)
R.module.basic_modules += RPED
R.module.add_module(RPED, FALSE, TRUE)
/obj/item/borg/upgrade/rped/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R.module
if (RPED)
R.module.remove_module(RPED, TRUE)
/obj/item/borg/upgrade/pinpointer
name = "medical cyborg crew pinpointer"
@@ -451,16 +524,22 @@
require_module = TRUE
module_type = /obj/item/robot_module/medical
/obj/item/borg/upgrade/pinpointer/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/pinpointer/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/pinpointer/crew/PP = locate() in R
if(PP)
to_chat(usr, "<span class='warning'>This unit is already equipped with a pinpointer module.</span>")
return FALSE
var/obj/item/pinpointer/crew/PP = locate() in R
if(PP)
to_chat(user, "<span class='warning'>This unit is already equipped with a pinpointer module.</span>")
return FALSE
PP = new(R.module)
R.module.basic_modules += PP
R.module.add_module(PP, FALSE, TRUE)
return TRUE
PP = new(R.module)
R.module.basic_modules += PP
R.module.add_module(PP, FALSE, TRUE)
/obj/item/borg/upgrade/pinpointer/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
var/obj/item/pinpointer/crew/PP = locate() in R.module
if (PP)
R.module.remove_module(PP, TRUE)

View File

@@ -58,6 +58,8 @@
body += "<a href='?_src_=holder;[HrefToken()];traitor=[REF(M)]'>TP</a> - "
else
body += "<a href='?_src_=holder;[HrefToken()];initmind=[REF(M)]'>Init Mind</a> - "
if (iscyborg(M))
body += "<a href='?_src_=holder;[HrefToken()];borgpanel=[REF(M)]'>BP</a> - "
body += "<a href='?priv_msg=[M.ckey]'>PM</a> - "
body += "<a href='?_src_=holder;[HrefToken()];subtlemessage=[REF(M)]'>SM</a> - "
body += "<a href='?_src_=holder;[HrefToken()];adminplayerobservefollow=[REF(M)]'>FLW</a> - "

View File

@@ -70,7 +70,8 @@ GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin())
/client/proc/deadchat,
/client/proc/toggleprayers,
/client/proc/toggleadminhelpsound,
/client/proc/respawn_character
/client/proc/respawn_character,
/datum/admins/proc/open_borgopanel
)
GLOBAL_PROTECT(admin_verbs_ban)
GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel, /client/proc/DB_ban_panel, /client/proc/stickybanpanel))

View File

@@ -80,6 +80,8 @@
body += "<a href='?_src_=holder;[HrefToken()];showmessageckey="+ckey+"'>N</a> - "
body += "<a href='?_src_=vars;[HrefToken()];Vars="+ref+"'>VV</a> - "
body += "<a href='?_src_=holder;[HrefToken()];traitor="+ref+"'>TP</a> - "
if (job == "Cyborg")
body += "<a href='?_src_=holder;[HrefToken()];borgpanel="+ref+"'>BP</a> - "
body += "<a href='?priv_msg="+ckey+"'>PM</a> - "
body += "<a href='?_src_=holder;[HrefToken()];subtlemessage="+ref+"'>SM</a> - "
body += "<a href='?_src_=holder;[HrefToken()];adminplayerobservefollow="+ref+"'>FLW</a> - "

View File

@@ -1915,6 +1915,16 @@
else
show_traitor_panel(M)
else if(href_list["borgpanel"])
if(!check_rights(R_ADMIN))
return
var/mob/M = locate(href_list["borgpanel"])
if(!iscyborg(M))
to_chat(usr, "This can only be used on cyborgs")
else
open_borgopanel(M)
else if(href_list["initmind"])
if(!check_rights(R_ADMIN))
return

View File

@@ -0,0 +1,217 @@
/datum/admins/proc/open_borgopanel(borgo in GLOB.silicon_mobs)
set category = "Admin"
set name = "Show Borg Panel"
set desc = "Show borg panel"
if(!check_rights(R_ADMIN))
return
if (!istype(borgo, /mob/living/silicon/robot))
borgo = input("Select a borg", "Select a borg", null, null) as null|anything in GLOB.silicon_mobs
if (!istype(borgo, /mob/living/silicon/robot))
to_chat(usr, "<span class='warning'>Borg is required for borgpanel</span>")
var/datum/borgpanel/borgpanel = new(usr, borgo)
borgpanel.ui_interact(usr)
/datum/borgpanel
var/mob/living/silicon/robot/borg
var/user
/datum/borgpanel/New(user, mob/living/silicon/robot/borg)
if(!istype(borg))
CRASH("Borg panel is only available for borgs")
qdel(src)
if (istype(user, /mob))
var/mob/M = user
if (!M.client)
CRASH("Borg panel attempted to open to a mob without a client")
src.user = M.client
else
src.user = user
src.borg = borg
/datum/borgpanel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.admin_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "borgopanel", "Borg Panel", 700, 700, master_ui, state)
ui.open()
/datum/borgpanel/ui_data(mob/user)
. = list()
.["borg"] = list(
"ref" = REF(borg),
"name" = "[borg]",
"emagged" = borg.emagged,
"active_module" = "[borg.module.type]",
"lawupdate" = borg.lawupdate,
"lockdown" = borg.lockcharge,
"scrambledcodes" = borg.scrambledcodes
)
.["upgrades"] = list()
for (var/upgradetype in subtypesof(/obj/item/borg/upgrade)-/obj/item/borg/upgrade/hypospray) //hypospray is a dummy parent for hypospray upgrades
var/obj/item/borg/upgrade/upgrade = upgradetype
if (initial(upgrade.module_type) && !istype(borg.module, initial(upgrade.module_type))) // Upgrade requires a different module
continue
var/installed = FALSE
if (locate(upgradetype) in borg)
installed = TRUE
.["upgrades"] += list(list("name" = initial(upgrade.name), "installed" = installed, "type" = upgradetype))
.["laws"] = borg.laws ? borg.laws.get_law_list(include_zeroth = TRUE) : list()
.["channels"] = list()
for (var/k in GLOB.radiochannels)
if (k == "Common")
continue
.["channels"] += list(list("name" = k, "installed" = (k in borg.radio.channels)))
.["cell"] = borg.cell ? list("missing" = FALSE, "maxcharge" = borg.cell.maxcharge, "charge" = borg.cell.charge) : list("missing" = TRUE, "maxcharge" = 1, "charge" = 0)
.["modules"] = list()
for(var/moduletype in typesof(/obj/item/robot_module))
var/obj/item/robot_module/module = moduletype
.["modules"] += list(list(
"name" = initial(module.name),
"type" = "[module]"
))
.["ais"] = list(list("name" = "None", "ref" = "null", "connected" = isnull(borg.connected_ai)))
for(var/mob/living/silicon/ai/ai in GLOB.ai_list)
.["ais"] += list(list("name" = ai.name, "ref" = REF(ai), "connected" = (borg.connected_ai == ai)))
/datum/borgpanel/ui_act(action, params)
if(..())
return
switch (action)
if ("set_charge")
var/newcharge = input("New charge (0-[borg.cell.maxcharge]):", borg.name, borg.cell.charge) as num|null
if (newcharge)
borg.cell.charge = CLAMP(newcharge, 0, borg.cell.maxcharge)
message_admins("[key_name_admin(user)] set the charge of [key_name_admin(borg)][ADMIN_FLW(borg)] to [borg.cell.charge].")
log_admin("[key_name(user)] set the charge of [key_name(borg)] to [borg.cell.charge].")
if ("remove_cell")
QDEL_NULL(borg.cell)
message_admins("[key_name_admin(user)] deleted the cell of [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] deleted the cell of [key_name(borg)].")
if ("change_cell")
var/chosen = pick_closest_path(null, make_types_fancy(typesof(/obj/item/stock_parts/cell)))
if (!ispath(chosen))
chosen = text2path(chosen)
if (chosen)
if (borg.cell)
QDEL_NULL(borg.cell)
var/new_cell = new chosen(borg)
borg.cell = new_cell
borg.cell.charge = borg.cell.maxcharge
borg.diag_hud_set_borgcell()
message_admins("[key_name_admin(user)] changed the cell of [key_name_admin(borg)][ADMIN_FLW(borg)] to [new_cell].")
log_admin("[key_name(user)] changed the cell of [key_name(borg)] to [new_cell].")
if ("toggle_emagged")
borg.SetEmagged(!borg.emagged)
if (borg.emagged)
message_admins("[key_name_admin(user)] emagged [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] emagged [key_name(borg)].")
else
message_admins("[key_name_admin(user)] un-emagged [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] un-emagged [key_name(borg)].")
if ("toggle_lawupdate")
borg.lawupdate = !borg.lawupdate
if (borg.lawupdate)
message_admins("[key_name_admin(user)] enabled lawsync on [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] enabled lawsync on [key_name(borg)].")
else
message_admins("[key_name_admin(user)] disabled lawsync on [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] disabled lawsync on [key_name(borg)].")
if ("toggle_lockdown")
borg.SetLockdown(!borg.lockcharge)
if (borg.lockcharge)
message_admins("[key_name_admin(user)] locked down [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] locked down [key_name(borg)].")
else
message_admins("[key_name_admin(user)] released [key_name_admin(borg)][ADMIN_FLW(borg)] from lockdown.")
log_admin("[key_name(user)] released [key_name(borg)] from lockdown.")
if ("toggle_scrambledcodes")
borg.scrambledcodes = !borg.scrambledcodes
if (borg.scrambledcodes)
message_admins("[key_name_admin(user)] enabled scrambled codes on [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] enabled scrambled codes on [key_name(borg)].")
else
message_admins("[key_name_admin(user)] disabled scrambled codes on [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] disabled scrambled codes on [key_name(borg)].")
if ("rename")
var/new_name = stripped_input(user,"What would you like to name this cyborg?","Input a name",borg.real_name,MAX_NAME_LEN)
if(!new_name)
return
message_admins("[key_name_admin(user)] renamed [key_name_admin(borg)][ADMIN_FLW(borg)] to [new_name].")
log_admin("[key_name(user)] renamed [key_name(borg)] to [new_name].")
borg.fully_replace_character_name(borg.real_name,new_name)
if ("toggle_upgrade")
var/upgradepath = text2path(params["upgrade"])
var/obj/item/borg/upgrade/installedupgrade = locate(upgradepath) in borg
if (installedupgrade)
installedupgrade.deactivate(borg, user)
borg.upgrades -= installedupgrade
message_admins("[key_name_admin(user)] removed the [installedupgrade] upgrade from [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] removed the [installedupgrade] upgrade from [key_name(borg)].")
qdel(installedupgrade)
else
var/obj/item/borg/upgrade/upgrade = new upgradepath(borg)
upgrade.action(borg, user)
borg.upgrades += upgrade
message_admins("[key_name_admin(user)] added the [upgrade] borg upgrade to [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] added the [upgrade] borg upgrade to [key_name(borg)].")
if ("toggle_radio")
var/channel = params["channel"]
if (channel in borg.radio.channels) // We're removing a channel
if (!borg.radio.keyslot) // There's no encryption key. This shouldn't happen but we can cope
borg.radio.channels -= channel
if (channel == "Syndicate")
borg.radio.syndie = FALSE
else if (channel == "CentCom")
borg.radio.independent = FALSE
else
borg.radio.keyslot.channels -= channel
if (channel == "Syndicate")
borg.radio.keyslot.syndie = FALSE
else if (channel == "CentCom")
borg.radio.keyslot.independent = FALSE
message_admins("[key_name_admin(user)] removed the [channel] radio channel from [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] removed the [channel] radio channel from [key_name(borg)].")
else // We're adding a channel
if (!borg.radio.keyslot) // Assert that an encryption key exists
borg.radio.keyslot = new (borg.radio)
borg.radio.keyslot.channels[channel] = 1
if (channel == "Syndicate")
borg.radio.keyslot.syndie = TRUE
else if (channel == "CentCom")
borg.radio.keyslot.independent = TRUE
message_admins("[key_name_admin(user)] added the [channel] radio channel to [key_name_admin(borg)][ADMIN_FLW(borg)].")
log_admin("[key_name(user)] added the [channel] radio channel to [key_name(borg)].")
borg.radio.recalculateChannels()
if ("setmodule")
var/newmodulepath = text2path(params["module"])
if (ispath(newmodulepath))
borg.module.transform_to(newmodulepath)
message_admins("[key_name_admin(user)] changed the module of [key_name_admin(borg)][ADMIN_FLW(borg)] to [newmodulepath].")
log_admin("[key_name(user)] changed the module of [key_name(borg)] to [newmodulepath].")
if ("slavetoai")
var/mob/living/silicon/ai/newai = locate(params["slavetoai"]) in GLOB.ai_list
if (newai && newai != borg.connected_ai)
borg.notify_ai(DISCONNECT)
if(borg.shell)
borg.undeploy()
borg.connected_ai = newai
borg.notify_ai(TRUE)
message_admins("[key_name_admin(user)] slaved [key_name_admin(borg)][ADMIN_FLW(borg)] to the AI [key_name_admin(newai)][ADMIN_FLW(newai)].")
log_admin("[key_name(user)] slaved [key_name(borg)] to the AI [key_name(newai)].")
else if (params["slavetoai"] == "null")
borg.notify_ai(DISCONNECT)
if(borg.shell)
borg.undeploy()
borg.connected_ai = null
message_admins("[key_name_admin(user)] freed [key_name_admin(borg)][ADMIN_FLW(borg)] from being slaved to an AI.")
log_admin("[key_name(user)] freed [key_name(borg)] from being slaved to an AI.")
if (borg.lawupdate)
borg.lawsync()
. = TRUE

View File

@@ -67,6 +67,21 @@ Borg Hypospray
modes[reagent] = modes.len + 1
/obj/item/reagent_containers/borghypo/proc/del_reagent(reagent)
reagent_ids -= reagent
var/datum/reagents/RG
var/datum/reagents/TRG
for(var/i in 1 to reagent_ids.len)
TRG = reagent_list[i]
if (TRG.has_reagent(reagent))
RG = TRG
break
if (RG)
reagent_list -= RG
RG.del_reagent(reagent)
modes[reagent] = modes.len - 1
/obj/item/reagent_containers/borghypo/proc/regenerate_reagents()
if(iscyborg(src.loc))
var/mob/living/silicon/robot/R = src.loc

View File

@@ -1046,6 +1046,7 @@
#include "code\modules\admin\verbs\adminsay.dm"
#include "code\modules\admin\verbs\atmosdebug.dm"
#include "code\modules\admin\verbs\bluespacearty.dm"
#include "code\modules\admin\verbs\borgpanel.dm"
#include "code\modules\admin\verbs\BrokenInhands.dm"
#include "code\modules\admin\verbs\buildmode.dm"
#include "code\modules\admin\verbs\cinematic.dm"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
<ui-display title='{{data.borg.name}}' button>
{{#partial button}}
<ui-button icon='pencil' action='rename'>Rename</ui-button>
{{/partial}}
<ui-section label='Status'>
<ui-button icon='{{data.borg.emagged ? "check-square-o" : "square-o"}}' style='{{data.borg.emagged ? "selected" : null}}' action='toggle_emagged'>Emagged</ui-button>
<ui-button icon='{{data.borg.lockdown ? "check-square-o" : "square-o"}}' style='{{data.borg.lockdown ? "selected" : null}}' action='toggle_lockdown'>Locked down</ui-button>
<ui-button icon='{{data.borg.scrambledcodes ? "check-square-o" : "square-o"}}' style='{{data.borg.scrambledcodes ? "selected" : null}}' action='toggle_scrambledcodes'>Scrambled codes</ui-button>
</ui-section>
<ui-section label='Charge'>
{{#if !data.cell.missing}}
<ui-bar min='0' max='{{data.cell.maxcharge}}' value='{{data.cell.charge}}'>{{Math.round(data.cell.charge)}} / {{Math.round(data.cell.maxcharge)}}</ui-bar>
{{else}}
<span class='warning'>Cell missing</span><br/>
{{/if}}
<ui-button icon='pencil' action='set_charge'>Set</ui-button><ui-button icon='eject' action='change_cell'>Change</ui-button><ui-button icon='trash' class='bad' action='remove_cell'>Remove</ui-button>
</ui-section>
<ui-section label='Radio channels'>
{{#each data.channels}}
<ui-button icon='{{installed ? "check-square-o" : "square-o"}}' style='{{installed ? "selected" : null}}' action='toggle_radio' params='{"channel": "{{name}}"}'>{{name}}</ui-button>
{{/each}}
</ui-section>
<ui-section label='Module'>
{{#each data.modules}}
<ui-button icon='{{data.borg.active_module == type ? "check-square-o" : "square-o"}}' style='{{data.borg.active_module == type ? "selected" : null}}' action='setmodule' params='{"module": "{{type}}"}'>{{name}}</ui-button>
{{/each}}
</ui-section>
<ui-section label='Upgrades'>
{{#each data.upgrades}}
<ui-button icon='{{installed ? "check-square-o" : "square-o"}}' style='{{installed ? "selected" : null}}' action='toggle_upgrade' params='{"upgrade": "{{type}}"}'>{{name}}</ui-button>
{{/each}}
</ui-section>
<ui-section label='Master AI'>
{{#each data.ais}}
<ui-button icon='{{connected ? "check-square-o" : "square-o"}}' style='{{connected ? "selected" : null}}' action='slavetoai' params='{"slavetoai": "{{ref}}"}'>{{name}}</ui-button>
{{/each}}
</ui-section>
</ui-display>
<ui-display title='Laws' button>
{{#partial button}}
<ui-button icon='{{data.borg.lawupdate ? "check-square-o" : "square-o"}}' style='{{data.borg.lawupdate ? "selected" : null}}' action='toggle_lawupdate'>Lawsync</ui-button>
{{/partial}}
{{#each data.laws}}
<p>{{this}}</p>
{{/each}}
</ui-display>