Merge pull request #8825 from ShadowLarkens/tgui_research_rebased

TGUI Research
This commit is contained in:
Novacat
2020-08-25 17:12:24 -04:00
committed by GitHub
144 changed files with 9345 additions and 4773 deletions

View File

@@ -10,8 +10,8 @@
min_target_dist = 0
var/cleaning = 0
var/screwloose = 0
var/oddbutton = 0
var/wet_floors = 0
var/spray_blood = 0
var/blood = 1
var/list/target_types = list()
@@ -25,16 +25,16 @@
return ..()
/mob/living/bot/cleanbot/handleIdle()
if(!screwloose && !oddbutton && prob(2))
if(!wet_floors && !spray_blood && prob(2))
custom_emote(2, "makes an excited booping sound!")
playsound(src, 'sound/machines/synth_yes.ogg', 50, 0)
if(screwloose && prob(5)) // Make a mess
if(wet_floors && prob(5)) // Make a mess
if(istype(loc, /turf/simulated))
var/turf/simulated/T = loc
T.wet_floor()
if(oddbutton && prob(5)) // Make a big mess
if(spray_blood && prob(5)) // Make a big mess
visible_message("Something flies out of [src]. It seems to be acting oddly.")
var/obj/effect/decal/cleanable/blood/gibs/gib = new /obj/effect/decal/cleanable/blood/gibs(loc)
// TODO - I have a feeling weakrefs will not work in ignore_list, verify this ~Leshana
@@ -149,56 +149,65 @@
icon_state = "cleanbot[on]"
/mob/living/bot/cleanbot/attack_hand(var/mob/user)
var/dat
dat += "<TT><B>Automatic Station Cleaner v1.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];operation=start'>[on ? "On" : "Off"]</A><BR>"
dat += "Behaviour controls are [locked ? "locked" : "unlocked"]<BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]"
if(!locked || issilicon(user))
dat += "<BR>Cleans Blood: <A href='?src=\ref[src];operation=blood'>[blood ? "Yes" : "No"]</A><BR>"
if(using_map.bot_patrolling)
dat += "<BR>Patrol station: <A href='?src=\ref[src];operation=patrol'>[will_patrol ? "Yes" : "No"]</A><BR>"
if(open && !locked)
dat += "Odd looking screw twiddled: <A href='?src=\ref[src];operation=screw'>[screwloose ? "Yes" : "No"]</A><BR>"
dat += "Weird button pressed: <A href='?src=\ref[src];operation=oddbutton'>[oddbutton ? "Yes" : "No"]</A>"
tgui_interact(user)
user << browse("<HEAD><TITLE>Cleaner v1.0 controls</TITLE></HEAD>[dat]", "window=autocleaner")
onclose(user, "autocleaner")
return
/mob/living/bot/cleanbot/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Cleanbot", name)
ui.open()
/mob/living/bot/cleanbot/Topic(href, href_list)
/mob/living/bot/cleanbot/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
data["on"] = on
data["open"] = open
data["locked"] = locked
data["blood"] = blood
data["patrol"] = will_patrol
data["wet_floors"] = wet_floors
data["spray_blood"] = spray_blood
data["version"] = "v2.0"
return data
/mob/living/bot/cleanbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return
return TRUE
usr.set_machine(src)
add_fingerprint(usr)
switch(href_list["operation"])
switch(action)
if("start")
if(on)
turn_off()
else
turn_on()
. = TRUE
if("blood")
blood = !blood
get_targets()
. = TRUE
if("patrol")
will_patrol = !will_patrol
patrol_path = null
if("screw")
screwloose = !screwloose
. = TRUE
if("wet_floors")
wet_floors = !wet_floors
to_chat(usr, "<span class='notice'>You twiddle the screw.</span>")
if("oddbutton")
oddbutton = !oddbutton
. = TRUE
if("spray_blood")
spray_blood = !spray_blood
to_chat(usr, "<span class='notice'>You press the weird button.</span>")
attack_hand(usr)
. = TRUE
/mob/living/bot/cleanbot/emag_act(var/remaining_uses, var/mob/user)
. = ..()
if(!screwloose || !oddbutton)
if(!wet_floors || !spray_blood)
if(user)
to_chat(user, "<span class='notice'>The [src] buzzes and beeps.</span>")
playsound(src, 'sound/machines/buzzbeep.ogg', 50, 0)
oddbutton = 1
screwloose = 1
spray_blood = 1
wet_floors = 1
return 1
/mob/living/bot/cleanbot/proc/get_targets()

View File

@@ -71,53 +71,31 @@
qdel(src)
return
/mob/living/bot/cleanbot/edCLN/attack_hand(var/mob/user)
var/dat
usr.set_machine(src)
add_fingerprint(usr)
/mob/living/bot/cleanbot/edCLN/tgui_data(mob/user)
var/list/data = ..()
data["version"] = "v3.0"
data["rgbpanel"] = TRUE
data["red_switch"] = red_switch
data["green_switch"] = green_switch
data["blue_switch"] = blue_switch
return data
dat += "<TT><B>Automatic Station Cleaner v2.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];operation=start'>[on ? "On" : "Off"]</A><BR>"
dat += "Behaviour controls are [locked ? "locked" : "unlocked"]<BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]"
if(!locked || issilicon(user))
dat += "<BR>Cleans Blood: <A href='?src=\ref[src];operation=blood'>[blood ? "Yes" : "No"]</A><BR>"
if(using_map.bot_patrolling)
dat += "<BR>Patrol station: <A href='?src=\ref[src];operation=patrol'>[will_patrol ? "Yes" : "No"]</A><BR>"
if(open && !locked)
dat += "<BR>Red Switch: <A href='?src=\ref[src];operation=red_switch'>[red_switch ? "On" : "Off"]</A><BR>"
dat += "<BR>Green Switch: <A href='?src=\ref[src];operation=green_switch'>[green_switch ? "On" : "Off"]</A><BR>"
dat += "<BR>Blue Switch: <A href='?src=\ref[src];operation=blue_switch'>[blue_switch ? "On" : "Off"]</A>"
user << browse("<HEAD><TITLE>Cleaner v2.0 controls</TITLE></HEAD>[dat]", "window=autocleaner")
onclose(user, "autocleaner")
return
/mob/living/bot/cleanbot/edCLN/Topic(href, href_list)
usr.set_machine(src)
add_fingerprint(usr)
switch(href_list["operation"])
if("start")
if(on)
turn_off()
else
turn_on()
if("blood")
blood = !blood
get_targets()
if("patrol")
will_patrol = !will_patrol
patrol_path = null
/mob/living/bot/cleanbot/edCLN/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return TRUE
switch(action)
if("red_switch")
red_switch = !red_switch
to_chat(usr, "<span class='notice'>You flip the red switch [red_switch ? "on" : "off"].</span>")
. = TRUE
if("green_switch")
green_switch = !blue_switch
green_switch = !green_switch
to_chat(usr, "<span class='notice'>You flip the green switch [green_switch ? "on" : "off"].</span>")
. = TRUE
if("blue_switch")
blue_switch = !blue_switch
to_chat(usr, "<span class='notice'>You flip the blue switch [blue_switch ? "on" : "off"].</span>")
attack_hand(usr)
. = TRUE
/mob/living/bot/cleanbot/edCLN/emag_act(var/remaining_uses, var/mob/user)
. = ..()

View File

@@ -30,38 +30,45 @@
tank = newTank
tank.forceMove(src)
/mob/living/bot/farmbot/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Farmbot", name)
ui.open()
/mob/living/bot/farmbot/attack_hand(var/mob/user as mob)
/mob/living/bot/farmbot/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
data["on"] = on
data["tank"] = !!tank
if(tank)
data["tankVolume"] = tank.reagents.total_volume
data["tankMaxVolume"] = tank.reagents.maximum_volume
data["locked"] = locked
data["waters_trays"] = null
data["refills_water"] = null
data["uproots_weeds"] = null
data["replaces_nutriment"] = null
data["collects_produce"] = null
data["removes_dead"] = null
if(!locked)
data["waters_trays"] = waters_trays
data["refills_water"] = refills_water
data["uproots_weeds"] = uproots_weeds
data["replaces_nutriment"] = replaces_nutriment
data["collects_produce"] = collects_produce
data["removes_dead"] = removes_dead
return data
/mob/living/bot/farmbot/attack_hand(mob/user)
. = ..()
if(.)
return
var/dat = ""
dat += "<TT><B>Automatic Hyrdoponic Assisting Unit v1.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A><BR>"
dat += "Water Tank: "
if (tank)
dat += "[tank.reagents.total_volume]/[tank.reagents.maximum_volume]"
else
dat += "Error: Watertank not found"
dat += "<br>Behaviour controls are [locked ? "locked" : "unlocked"]<hr>"
if(!locked)
dat += "<TT>Watering controls:<br>"
dat += "Water plants : <A href='?src=\ref[src];water=1'>[waters_trays ? "Yes" : "No"]</A><BR>"
dat += "Refill watertank : <A href='?src=\ref[src];refill=1'>[refills_water ? "Yes" : "No"]</A><BR>"
dat += "<br>Weeding controls:<br>"
dat += "Weed plants: <A href='?src=\ref[src];weed=1'>[uproots_weeds ? "Yes" : "No"]</A><BR>"
dat += "<br>Nutriment controls:<br>"
dat += "Replace fertilizer: <A href='?src=\ref[src];replacenutri=1'>[replaces_nutriment ? "Yes" : "No"]</A><BR>"
/* VOREStation Removal - No whole-job lag-bot automation.
dat += "<br>Plant controls:<br>"
dat += "Collect produce: <A href='?src=\ref[src];collect=1'>[collects_produce ? "Yes" : "No"]</A><BR>"
dat += "Remove dead plants: <A href='?src=\ref[src];removedead=1'>[removes_dead ? "Yes" : "No"]</A><BR>"
*/
dat += "</TT>"
user << browse("<HEAD><TITLE>Farmbot v1.0 controls</TITLE></HEAD>[dat]", "window=autofarm")
onclose(user, "autofarm")
return
tgui_interact(user)
/mob/living/bot/farmbot/emag_act(var/remaining_charges, var/mob/user)
. = ..()
@@ -73,35 +80,47 @@
emagged = 1
return 1
/mob/living/bot/farmbot/Topic(href, href_list)
/mob/living/bot/farmbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return
usr.machine = src
return TRUE
add_fingerprint(usr)
if((href_list["power"]) && (access_scanner.allowed(usr)))
if(on)
turn_off()
else
turn_on()
switch(action)
if("power")
if(!access_scanner.allowed(usr))
return FALSE
if(on)
turn_off()
else
turn_on()
. = TRUE
if(locked)
return
return TRUE
if(href_list["water"])
waters_trays = !waters_trays
else if(href_list["refill"])
refills_water = !refills_water
else if(href_list["weed"])
uproots_weeds = !uproots_weeds
else if(href_list["replacenutri"])
replaces_nutriment = !replaces_nutriment
else if(href_list["collect"])
collects_produce = !collects_produce
else if(href_list["removedead"])
removes_dead = !removes_dead
switch(action)
if("water")
waters_trays = !waters_trays
. = TRUE
if("refill")
refills_water = !refills_water
. = TRUE
if("weed")
uproots_weeds = !uproots_weeds
. = TRUE
if("replacenutri")
replaces_nutriment = !replaces_nutriment
. = TRUE
// VOREStation Edit: No automatic hydroponics
// if("collect")
// collects_produce = !collects_produce
// . = TRUE
// if("removedead")
// removes_dead = !removes_dead
// . = TRUE
// VOREStation Edit End
attack_hand(usr)
return
/mob/living/bot/farmbot/update_icons()
if(on && action)
@@ -109,13 +128,10 @@
else
icon_state = "farmbot[on]"
/mob/living/bot/farmbot/handleRegular()
if(emagged && prob(1))
flick("farmbot_broke", src)
/mob/living/bot/farmbot/handleAdjacentTarget()
UnarmedAttack(target)
@@ -137,6 +153,7 @@
times_idle = 0 //VOREStation Add - Idle shutoff time
return
if(++times_idle == 150) turn_off() //VOREStation Add - Idle shutoff time
/mob/living/bot/farmbot/calcTargetPath() // We need to land NEXT to the tray, because the tray itself is impassable
for(var/trayDir in list(NORTH, SOUTH, EAST, WEST))
target_path = AStar(get_turf(loc), get_step(get_turf(target), trayDir), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, max_target_dist, id = botcard)

View File

@@ -29,28 +29,38 @@
else
icon_state = "floorbot[on]e"
/mob/living/bot/floorbot/attack_hand(var/mob/user)
user.set_machine(src)
var/list/dat = list()
dat += "<TT><B>Automatic Station Floor Repairer v1.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];operation=start'>[src.on ? "On" : "Off"]</A><BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]<BR>"
dat += "Tiles left: [amount]<BR>"
dat += "Behvaiour controls are [locked ? "locked" : "unlocked"]<BR>"
/mob/living/bot/floorbot/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Floorbot", name)
ui.open()
/mob/living/bot/floorbot/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
data["on"] = on
data["open"] = open
data["locked"] = locked
data["amount"] = amount
data["possible_bmode"] = list("NORTH", "EAST", "SOUTH", "WEST")
data["improvefloors"] = null
data["eattiles"] = null
data["maketiles"] = null
data["bmode"] = null
if(!locked || issilicon(user))
dat += "Improves floors: <A href='?src=\ref[src];operation=improve'>[improvefloors ? "Yes" : "No"]</A><BR>"
dat += "Finds tiles: <A href='?src=\ref[src];operation=tiles'>[eattiles ? "Yes" : "No"]</A><BR>"
dat += "Make singles pieces of metal into tiles when empty: <A href='?src=\ref[src];operation=make'>[maketiles ? "Yes" : "No"]</A><BR>"
var/bmode
if(targetdirection)
bmode = dir2text(targetdirection)
else
bmode = "Disabled"
dat += "<BR><BR>Bridge Mode : <A href='?src=\ref[src];operation=bridgemode'>[bmode]</A><BR>"
var/datum/browser/popup = new(user, "autorepair", "Repairbot v1.1 controls")
popup.set_content(jointext(dat,null))
popup.open()
return
data["improvefloors"] = improvefloors
data["eattiles"] = eattiles
data["maketiles"] = maketiles
data["bmode"] = dir2text(targetdirection)
return data
/mob/living/bot/floorbot/attack_hand(var/mob/user)
tgui_interact(user)
/mob/living/bot/floorbot/emag_act(var/remaining_charges, var/mob/user)
. = ..()
@@ -61,38 +71,36 @@
playsound(src, 'sound/machines/buzzbeep.ogg', 50, 0)
return 1
/mob/living/bot/floorbot/Topic(href, href_list)
/mob/living/bot/floorbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return
usr.set_machine(src)
return TRUE
add_fingerprint(usr)
switch(href_list["operation"])
switch(action)
if("start")
if (on)
if(on)
turn_off()
else
turn_on()
. = TRUE
if(locked && !issilicon(usr))
return
switch(action)
if("improve")
improvefloors = !improvefloors
. = TRUE
if("tiles")
eattiles = !eattiles
. = TRUE
if("make")
maketiles = !maketiles
. = TRUE
if("bridgemode")
switch(targetdirection)
if(null)
targetdirection = 1
if(1)
targetdirection = 2
if(2)
targetdirection = 4
if(4)
targetdirection = 8
if(8)
targetdirection = null
else
targetdirection = null
attack_hand(usr)
targetdirection = text2dir(params["dir"])
. = TRUE
/mob/living/bot/floorbot/handleRegular()
++tilemake

View File

@@ -8,6 +8,11 @@
#define MEDBOT_PANIC_ENDING 90
#define MEDBOT_PANIC_END 100
#define MEDBOT_MIN_INJECTION 5
#define MEDBOT_MAX_INJECTION 15
#define MEDBOT_MIN_HEAL 0.1
#define MEDBOT_MAX_HEAL 75
/mob/living/bot/medbot
name = "Medibot"
desc = "A little medical robot. He looks somewhat underwhelmed."
@@ -209,45 +214,39 @@
if(do_after(H, 3 SECONDS, target=src))
set_right(H)
else
interact(H)
tgui_interact(H)
/mob/living/bot/medbot/proc/interact(mob/user)
var/dat
dat += "<TT><B>Automatic Medical Unit v1.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A><BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]<BR>"
dat += "Beaker: "
if (reagent_glass)
dat += "<A href='?src=\ref[src];eject=1'>Loaded \[[reagent_glass.reagents.total_volume]/[reagent_glass.reagents.maximum_volume]\]</a>"
else
dat += "None Loaded"
dat += "<br>Behaviour controls are [locked ? "locked" : "unlocked"]<hr>"
/mob/living/bot/medbot/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
data["on"] = on
data["open"] = open
data["beaker"] = FALSE
if(reagent_glass)
data["beaker"] = TRUE
data["beaker_total"] = reagent_glass.reagents.total_volume
data["beaker_max"] = reagent_glass.reagents.maximum_volume
data["locked"] = locked
data["heal_threshold"] = null
data["heal_threshold_max"] = MEDBOT_MAX_HEAL
data["injection_amount_min"] = MEDBOT_MIN_INJECTION
data["injection_amount"] = null
data["injection_amount_max"] = MEDBOT_MAX_INJECTION
data["use_beaker"] = null
data["declare_treatment"] = null
data["vocal"] = null
if(!locked || issilicon(user))
dat += "<TT>Healing Threshold: "
dat += "<a href='?src=\ref[src];adj_threshold=-10'>--</a> "
dat += "<a href='?src=\ref[src];adj_threshold=-5'>-</a> "
dat += "[heal_threshold] "
dat += "<a href='?src=\ref[src];adj_threshold=5'>+</a> "
dat += "<a href='?src=\ref[src];adj_threshold=10'>++</a>"
dat += "</TT><br>"
data["heal_threshold"] = heal_threshold
data["injection_amount"] = injection_amount
data["use_beaker"] = use_beaker
data["declare_treatment"] = declare_treatment
data["vocal"] = vocal
return data
dat += "<TT>Injection Level: "
dat += "<a href='?src=\ref[src];adj_inject=-5'>-</a> "
dat += "[injection_amount] "
dat += "<a href='?src=\ref[src];adj_inject=5'>+</a> "
dat += "</TT><br>"
dat += "Reagent Source: "
dat += "<a href='?src=\ref[src];use_beaker=1'>[use_beaker ? "Loaded Beaker (When available)" : "Internal Synthesizer"]</a><br>"
dat += "Treatment report is [declare_treatment ? "on" : "off"]. <a href='?src=\ref[src];declaretreatment=[1]'>Toggle</a><br>"
dat += "The speaker switch is [vocal ? "on" : "off"]. <a href='?src=\ref[src];togglevoice=[1]'>Toggle</a><br>"
user << browse("<HEAD><TITLE>Medibot v1.0 controls</TITLE></HEAD>[dat]", "window=automed")
onclose(user, "automed")
return
/mob/living/bot/medbot/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Medbot", name)
ui.open()
/mob/living/bot/medbot/attackby(var/obj/item/O, var/mob/user)
if(istype(O, /obj/item/weapon/reagent_containers/glass))
@@ -266,51 +265,53 @@
else
..()
/mob/living/bot/medbot/Topic(href, href_list)
/mob/living/bot/medbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return
return TRUE
usr.set_machine(src)
add_fingerprint(usr)
if ((href_list["power"]) && access_scanner.allowed(usr))
if (on)
turn_off()
else
turn_on()
. = TRUE
switch(action)
if("power")
if(!access_scanner.allowed(usr))
return FALSE
if(on)
turn_off()
else
turn_on()
else if((href_list["adj_threshold"]) && (!locked || issilicon(usr)))
var/adjust_num = text2num(href_list["adj_threshold"])
heal_threshold += adjust_num
if(heal_threshold <= 0)
heal_threshold = 0.1
if(heal_threshold > 75)
heal_threshold = 75
if(locked && !issilicon(usr))
return TRUE
else if((href_list["adj_inject"]) && (!locked || issilicon(usr)))
var/adjust_num = text2num(href_list["adj_inject"])
injection_amount += adjust_num
if(injection_amount < 5)
injection_amount = 5
if(injection_amount > 15)
injection_amount = 15
switch(action)
if("adj_threshold")
heal_threshold = clamp(text2num(params["val"]), MEDBOT_MIN_HEAL, MEDBOT_MAX_HEAL)
. = TRUE
else if((href_list["use_beaker"]) && (!locked || issilicon(usr)))
use_beaker = !use_beaker
if("adj_inject")
injection_amount = clamp(text2num(params["val"]), MEDBOT_MIN_INJECTION, MEDBOT_MAX_INJECTION)
. = TRUE
else if (href_list["eject"] && (!isnull(reagent_glass)))
if(!locked)
reagent_glass.loc = get_turf(src)
reagent_glass = null
else
to_chat(usr, "<span class='notice'>You cannot eject the beaker because the panel is locked.</span>")
if("use_beaker")
use_beaker = !use_beaker
. = TRUE
else if ((href_list["togglevoice"]) && (!locked || issilicon(usr)))
vocal = !vocal
if("eject")
if(reagent_glass)
reagent_glass.forceMove(get_turf(src))
reagent_glass = null
. = TRUE
else if ((href_list["declaretreatment"]) && (!locked || issilicon(usr)))
declare_treatment = !declare_treatment
if("togglevoice")
vocal = !vocal
. = TRUE
if("declaretreatment")
declare_treatment = !declare_treatment
. = TRUE
attack_hand(usr)
return
/mob/living/bot/medbot/emag_act(var/remaining_uses, var/mob/user)
. = ..()

View File

@@ -88,53 +88,78 @@
else
set_light(0)
/mob/living/bot/secbot/attack_hand(var/mob/user)
user.set_machine(src)
var/list/dat = list()
dat += "<TT><B>Automatic Security Unit</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A><BR>"
dat += "Behaviour controls are [locked ? "locked" : "unlocked"]<BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]"
if(!locked || issilicon(user))
dat += "<BR>Check for Weapon Authorization: <A href='?src=\ref[src];operation=idcheck'>[idcheck ? "Yes" : "No"]</A><BR>"
dat += "Check Security Records: <A href='?src=\ref[src];operation=ignorerec'>[check_records ? "Yes" : "No"]</A><BR>"
dat += "Check Arrest Status: <A href='?src=\ref[src];operation=ignorearr'>[check_arrest ? "Yes" : "No"]</A><BR>"
dat += "Operating Mode: <A href='?src=\ref[src];operation=switchmode'>[arrest_type ? "Detain" : "Arrest"]</A><BR>"
dat += "Report Arrests: <A href='?src=\ref[src];operation=declarearrests'>[declare_arrests ? "Yes" : "No"]</A><BR>"
if(using_map.bot_patrolling)
dat += "Auto Patrol: <A href='?src=\ref[src];operation=patrol'>[will_patrol ? "On" : "Off"]</A>"
var/datum/browser/popup = new(user, "autosec", "Securitron controls")
popup.set_content(jointext(dat,null))
popup.open()
/mob/living/bot/secbot/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Secbot", name)
ui.open()
/mob/living/bot/secbot/Topic(href, href_list)
/mob/living/bot/secbot/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
data["on"] = on
data["open"] = open
data["locked"] = locked
data["idcheck"] = null
data["check_records"] = null
data["check_arrest"] = null
data["arrest_type"] = null
data["declare_arrests"] = null
data["will_patrol"] = null
if(!locked || issilicon(user))
data["idcheck"] = idcheck
data["check_records"] = check_records
data["check_arrest"] = check_arrest
data["arrest_type"] = arrest_type
data["declare_arrests"] = declare_arrests
if(using_map.bot_patrolling)
data["will_patrol"] = will_patrol
return data
/mob/living/bot/secbot/attack_hand(var/mob/user)
tgui_interact(user)
/mob/living/bot/secbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return
usr.set_machine(src)
add_fingerprint(usr)
if((href_list["power"]) && (access_scanner.allowed(usr)))
if(on)
turn_off()
else
turn_on()
return
switch(action)
if("power")
if(!access_scanner.allowed(usr))
return FALSE
if(on)
turn_off()
else
turn_on()
. = TRUE
switch(href_list["operation"])
if(locked && !issilicon(usr))
return TRUE
switch(action)
if("idcheck")
idcheck = !idcheck
. = TRUE
if("ignorerec")
check_records = !check_records
. = TRUE
if("ignorearr")
check_arrest = !check_arrest
. = TRUE
if("switchmode")
arrest_type = !arrest_type
. = TRUE
if("patrol")
will_patrol = !will_patrol
. = TRUE
if("declarearrests")
declare_arrests = !declare_arrests
attack_hand(usr)
. = TRUE
/mob/living/bot/secbot/emag_act(var/remaining_uses, var/mob/user)
. = ..()

View File

@@ -430,7 +430,7 @@
to_chat(src, "<span class='notice'>[pick(fruit_gland.empty_message)]</span>")
return
var/datum/seed/S = plant_controller.seeds["[fruit_gland.fruit_type]"]
var/datum/seed/S = SSplants.seeds["[fruit_gland.fruit_type]"]
S.harvest(usr,0,0,1)
var/index = rand(0,2)