mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
Tasty tasty bot features
This commit is contained in:
@@ -206,6 +206,7 @@
|
||||
#include "code\game\atoms_movable.dm"
|
||||
#include "code\game\centcomm_orders.dm"
|
||||
#include "code\game\communications.dm"
|
||||
#include "code\game\data_huds.dm"
|
||||
#include "code\game\response_team.dm"
|
||||
#include "code\game\shuttle_engines.dm"
|
||||
#include "code\game\skincmd.dm"
|
||||
|
||||
@@ -43,6 +43,11 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al
|
||||
// This is stupid as fuck.
|
||||
var/list/hit_appends = list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF")
|
||||
|
||||
//*-hud user lists
|
||||
var/global/list/table_recipes = list() //list of all table craft recipes
|
||||
var/global/list/med_hud_users = list() //list of all entities using a medical HUD.
|
||||
var/global/list/sec_hud_users = list() //list of all entities using a security HUD.
|
||||
|
||||
//////////////////////////
|
||||
/////Initial Building/////
|
||||
//////////////////////////
|
||||
|
||||
@@ -395,4 +395,9 @@ proc/listclearnulls(list/list)
|
||||
while(start < end)
|
||||
L.Swap(start++,end--)
|
||||
|
||||
return L
|
||||
return L
|
||||
|
||||
/proc/find_record(field, value, list/L)
|
||||
for(var/datum/data/record/R in L)
|
||||
if(R.fields[field] == value)
|
||||
return R
|
||||
@@ -65,7 +65,7 @@
|
||||
/var/const/access_sec_doors = 63 // Security front doors
|
||||
/var/const/access_psychiatrist = 64 // Psychiatrist's office
|
||||
/var/const/access_salvage_captain = 65 // Salvage ship captain's quarters
|
||||
|
||||
/var/const/access_weapons = 66 //Weapon authorization for secbots
|
||||
//BEGIN CENTCOM ACCESS
|
||||
/*Should leave plenty of room if we need to add more access levels.
|
||||
/var/const/Mostly for admin fun times.*/
|
||||
@@ -214,7 +214,7 @@
|
||||
access_tech_storage, access_chapel_office, access_atmospherics, access_kitchen,
|
||||
access_bar, access_janitor, access_crematorium, access_robotics, access_cargo, access_construction,
|
||||
access_hydroponics, access_library, access_lawyer, access_virology, access_psychiatrist, access_cmo, access_qm, access_clown, access_mime, access_surgery,
|
||||
access_theatre, access_research, access_mining, access_mailsorting,
|
||||
access_theatre, access_research, access_mining, access_mailsorting,access_weapons,
|
||||
access_heads_vault, access_mining_station, access_xenobiology, access_ce, access_hop, access_hos, access_RC_announce,
|
||||
access_keycard_auth, access_tcomsat, access_gateway, /*vg paramedic*/, access_paramedic)
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
if(0)
|
||||
return get_all_accesses()
|
||||
if(1) //security
|
||||
return list(access_sec_doors, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_hos)
|
||||
return list(access_sec_doors, access_weapons, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_hos)
|
||||
if(2) //medbay
|
||||
return list(access_medical, access_genetics, access_morgue, access_chemistry, access_paramedic, access_virology, access_surgery, access_cmo)
|
||||
if(3) //research
|
||||
@@ -396,6 +396,8 @@
|
||||
// /vg/ shit
|
||||
if(access_paramedic)
|
||||
return "Paramedic Station"
|
||||
if(access_weapons)
|
||||
return "Weapon Permit"
|
||||
|
||||
/proc/get_centcom_access_desc(A)
|
||||
switch(A)
|
||||
|
||||
@@ -61,13 +61,13 @@
|
||||
idtype = /obj/item/weapon/card/id/silver
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 10
|
||||
access = list(access_security, access_sec_doors, access_brig, access_court, access_forensics_lockers,
|
||||
access = list(access_security, access_sec_doors, access_brig, access_court, access_weapons, access_forensics_lockers,
|
||||
access_medical, access_engine, access_change_ids, access_ai_upload, access_eva, access_heads,
|
||||
access_all_personal_lockers, access_maint_tunnels, access_bar, access_janitor, access_construction, access_morgue,
|
||||
access_crematorium, access_kitchen, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer,
|
||||
access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station,
|
||||
access_clown, access_mime, access_hop, access_RC_announce, access_keycard_auth, access_gateway)
|
||||
minimal_access = list(access_security, access_sec_doors, access_brig, access_court, access_forensics_lockers,
|
||||
minimal_access = list(access_security, access_sec_doors, access_brig, access_court, access_weapons, access_forensics_lockers,
|
||||
access_medical, access_engine, access_change_ids, access_ai_upload, access_eva, access_heads,
|
||||
access_all_personal_lockers, access_maint_tunnels, access_bar, access_janitor, access_construction, access_morgue,
|
||||
access_crematorium, access_kitchen, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer,
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
spawn_positions = 1
|
||||
supervisors = "the head of personnel"
|
||||
selection_color = "#dddddd"
|
||||
access = list(access_hydroponics, access_bar, access_kitchen, access_morgue)
|
||||
minimal_access = list(access_bar)
|
||||
access = list(access_hydroponics, access_bar, access_kitchen, access_morgue, access_weapons)
|
||||
minimal_access = list(access_bar,access_weapons)
|
||||
|
||||
pdaslot=slot_belt
|
||||
pdatype=/obj/item/device/pda/bar
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
selection_color = "#ffdddd"
|
||||
idtype = /obj/item/weapon/card/id/hos
|
||||
req_admin_notify = 1
|
||||
access = list(access_security, access_sec_doors, access_brig, access_armory, access_court,
|
||||
access = list(access_weapons, access_security, access_sec_doors, access_brig, access_armory, access_court,
|
||||
access_forensics_lockers, access_morgue, access_maint_tunnels, access_all_personal_lockers,
|
||||
access_research, access_engine, access_mining, access_medical, access_construction, access_mailsorting,
|
||||
access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway)
|
||||
minimal_access = list(access_security, access_sec_doors, access_brig, access_armory, access_court,
|
||||
minimal_access = list(access_weapons, access_security, access_sec_doors, access_brig, access_armory, access_court,
|
||||
access_forensics_lockers, access_morgue, access_maint_tunnels, access_all_personal_lockers,
|
||||
access_research, access_engine, access_mining, access_medical, access_construction, access_mailsorting,
|
||||
access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway)
|
||||
@@ -62,8 +62,8 @@
|
||||
supervisors = "the head of security"
|
||||
selection_color = "#ffeeee"
|
||||
idtype = /obj/item/weapon/card/id/security
|
||||
access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels, access_morgue)
|
||||
minimal_access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels)
|
||||
access = list(access_weapons, access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels, access_morgue)
|
||||
minimal_access = list(access_weapons, access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels)
|
||||
minimal_player_age = 7
|
||||
|
||||
pdaslot=slot_belt
|
||||
@@ -110,8 +110,8 @@
|
||||
selection_color = "#ffeeee"
|
||||
idtype = /obj/item/weapon/card/id/security
|
||||
|
||||
access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
|
||||
minimal_access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
|
||||
access = list(access_weapons, access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
|
||||
minimal_access = list(access_weapons, access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
|
||||
alt_titles = list("Forensic Technician")
|
||||
|
||||
minimal_player_age = 7
|
||||
@@ -172,8 +172,8 @@
|
||||
supervisors = "the head of security"
|
||||
selection_color = "#ffeeee"
|
||||
idtype = /obj/item/weapon/card/id/security
|
||||
access = list(access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels, access_morgue)
|
||||
minimal_access = list(access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels)
|
||||
access = list(access_weapons, access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels, access_morgue)
|
||||
minimal_access = list(access_weapons, access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels)
|
||||
minimal_player_age = 7
|
||||
|
||||
pdaslot=slot_belt
|
||||
|
||||
@@ -13,6 +13,13 @@
|
||||
var/brute_dam_coeff = 1.0
|
||||
var/open = 0//Maint panel
|
||||
var/locked = 1
|
||||
var/bot_type
|
||||
var/declare_message = "" //What the bot will display to the HUD user.
|
||||
#define SEC_BOT 1 // Secutritrons (Beepsky) and ED-209s
|
||||
#define MULE_BOT 2 // MULEbots
|
||||
#define FLOOR_BOT 3 // Floorbots
|
||||
#define CLEAN_BOT 4 // Cleanbots
|
||||
#define MED_BOT 5 // Medibots
|
||||
//var/emagged = 0 //Urist: Moving that var to the general /bot tree as it's used by most bots
|
||||
|
||||
|
||||
@@ -69,7 +76,18 @@
|
||||
new /obj/effect/decal/cleanable/blood/oil(src.loc)
|
||||
healthcheck()
|
||||
|
||||
|
||||
/obj/machinery/bot/proc/declare() //Signals a medical or security HUD user to a relevant bot's activity.
|
||||
var/hud_user_list = list() //Determines which userlist to use.
|
||||
switch(bot_type) //Made into a switch so more HUDs can be added easily.
|
||||
if(SEC_BOT) //Securitrons and ED-209
|
||||
hud_user_list = sec_hud_users
|
||||
if(MED_BOT) //Medibots
|
||||
hud_user_list = med_hud_users
|
||||
var/area/myturf = get_turf(src)
|
||||
for(var/mob/huduser in hud_user_list)
|
||||
var/turf/mobturf = get_turf(huduser)
|
||||
if(mobturf.z == myturf.z)
|
||||
huduser.show_message(declare_message,1)
|
||||
|
||||
|
||||
/obj/machinery/bot/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
var/last_found //There's a delay
|
||||
var/frustration = 0
|
||||
//var/emagged = 0 //Emagged Secbots view everyone as a criminal
|
||||
var/idcheck = 1 //If false, all station IDs are authorized for weapons.
|
||||
var/check_records = 1 //Does it check security records?
|
||||
var/arrest_type = 0 //If true, don't handcuff
|
||||
var/declare_arrests = 0 //When making an arrest, should it notify everyone wearing sechuds?
|
||||
|
||||
var/projectile = null//Holder for projectile type, to avoid so many else if chains
|
||||
|
||||
var/mode = 0
|
||||
bot_type = SEC_BOT
|
||||
#define SECBOT_IDLE 0 // idle
|
||||
#define SECBOT_HUNT 1 // found target, hunting
|
||||
#define SECBOT_PREP_ARREST 2 // at target, preparing to arrest
|
||||
@@ -59,6 +59,14 @@
|
||||
|
||||
var/nearest_beacon // the nearest beacon's tag
|
||||
var/turf/nearest_beacon_loc // the nearest beacon's location
|
||||
var/declare_arrests = 1 //When making an arrest, should it notify everyone wearing sechuds?
|
||||
var/idcheck = 1 //If true, arrest people with no IDs
|
||||
var/weaponscheck = 1 //If true, arrest people for weapons if they don't have access
|
||||
//List of weapons that secbots will not arrest for
|
||||
var/safe_weapons = list(\
|
||||
/obj/item/weapon/gun/energy/laser/bluetag,\
|
||||
/obj/item/weapon/gun/energy/laser/redtag,\
|
||||
/obj/item/weapon/gun/energy/laser/practice)
|
||||
|
||||
|
||||
/obj/item/weapon/ed209_assembly
|
||||
@@ -129,13 +137,16 @@ Maintenance panel panel is [src.open ? "opened" : "closed"]"},
|
||||
if(!src.locked || issilicon(user))
|
||||
if(!lasercolor)
|
||||
dat += text({"<BR>
|
||||
Check for Weapon Authorization: []<BR>
|
||||
Check Security Records: []<BR>
|
||||
Arrest for No ID: [] <BR>
|
||||
Arrest for Unauthorized Weapons: [] <BR>
|
||||
Arrest for Warrant: [] <BR>
|
||||
<BR>
|
||||
Operating Mode: []<BR>
|
||||
Report Arrests: []<BR>
|
||||
Auto Patrol: []"},
|
||||
|
||||
"<A href='?src=\ref[src];operation=idcheck'>[src.idcheck ? "Yes" : "No"]</A>",
|
||||
"<A href='?src=\ref[src];operation=weaponscheck'>[weaponscheck ? "Yes" : "No"]</A>",
|
||||
"<A href='?src=\ref[src];operation=ignorerec'>[src.check_records ? "Yes" : "No"]</A>",
|
||||
"<A href='?src=\ref[src];operation=switchmode'>[src.arrest_type ? "Detain" : "Arrest"]</A>",
|
||||
"<A href='?src=\ref[src];operation=declarearrests'>[src.declare_arrests ? "Yes" : "No"]</A>",
|
||||
@@ -173,6 +184,9 @@ Auto Patrol: []"},
|
||||
if ("idcheck")
|
||||
src.idcheck = !src.idcheck
|
||||
src.updateUsrDialog()
|
||||
if("weaponscheck")
|
||||
weaponscheck = !weaponscheck
|
||||
updateUsrDialog()
|
||||
if ("ignorerec")
|
||||
src.check_records = !src.check_records
|
||||
src.updateUsrDialog()
|
||||
@@ -203,10 +217,13 @@ Auto Patrol: []"},
|
||||
..()
|
||||
if (!istype(W, /obj/item/weapon/screwdriver) && (!src.target))
|
||||
if(hasvar(W,"force") && W.force)//If force is defined and non-zero
|
||||
src.target = user
|
||||
if(lasercolor)//To make up for the fact that lasertag bots don't hunt
|
||||
src.shootAt(user)
|
||||
src.mode = SECBOT_HUNT
|
||||
threatlevel = user.assess_threat(src)
|
||||
threatlevel +=6
|
||||
if(threatlevel > 0)
|
||||
src.target = user
|
||||
if(lasercolor)//To make up for the fact that lasertag bots don't hunt
|
||||
src.shootAt(user)
|
||||
src.mode = SECBOT_HUNT
|
||||
|
||||
/obj/machinery/bot/ed209/Emag(mob/user as mob)
|
||||
..()
|
||||
@@ -224,6 +241,7 @@ Auto Patrol: []"},
|
||||
src.icon_state = "[lasercolor]ed209[src.on]"
|
||||
src.projectile = null
|
||||
mode = SECBOT_IDLE
|
||||
declare_arrests = 0
|
||||
|
||||
/obj/machinery/bot/ed209/process()
|
||||
//set background = 1
|
||||
@@ -236,7 +254,7 @@ Auto Patrol: []"},
|
||||
if ((C.stat) || (C.lying))
|
||||
continue
|
||||
if (istype(C, /mob/living/carbon/human))
|
||||
threatlevel = src.assess_perp(C)
|
||||
threatlevel = C.assess_threat(src,lasercolor)
|
||||
else if ((istype(C, /mob/living/carbon/monkey)) && (C.client) && (ticker.mode.name == "monkey"))
|
||||
threatlevel = 4
|
||||
//src.speak(C.real_name + text(": threat: []", threatlevel))
|
||||
@@ -1055,4 +1073,15 @@ Auto Patrol: []"},
|
||||
|
||||
/obj/machinery/bot/ed209/redtag/New()
|
||||
new /obj/machinery/bot/ed209(get_turf(src),null,"r")
|
||||
del(src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/bot/ed209/proc/check_for_weapons(var/obj/item/slot_item)
|
||||
if(istype(slot_item, /obj/item/weapon/gun) || istype(slot_item, /obj/item/weapon/melee))
|
||||
if(!(slot_item.type in safe_weapons))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/bot/ed209/declare()
|
||||
var/area/location = get_area(src)
|
||||
declare_message = "<span class='info'>\icon[src] [name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] scumbag <b>[target]</b> in <b>[location]</b></span>"
|
||||
..()
|
||||
@@ -38,6 +38,9 @@
|
||||
var/treatment_virus = "spaceacillin"
|
||||
var/declare_treatment = 0 //When attempting to treat a patient, should it notify everyone wearing medhuds?
|
||||
var/shut_up = 0 //self explanatory :)
|
||||
var/declare_crit = 1 //If active, the bot will transmit a critical patient alert to MedHUD users.
|
||||
var/declare_cooldown = 0 //Prevents spam of critical patient alerts.
|
||||
bot_type = MED_BOT
|
||||
|
||||
/obj/machinery/bot/medbot/mysterious
|
||||
name = "Mysterious Medibot"
|
||||
@@ -68,7 +71,6 @@
|
||||
/obj/machinery/bot/medbot/New()
|
||||
..()
|
||||
src.icon_state = "medibot[src.on]"
|
||||
|
||||
spawn(4)
|
||||
if(src.skin)
|
||||
src.overlays += image('icons/obj/aibots.dmi', "medskin_[src.skin]")
|
||||
@@ -135,6 +137,8 @@
|
||||
|
||||
dat += "The speaker switch is [src.shut_up ? "off" : "on"]. <a href='?src=\ref[src];togglevoice=[1]'>Toggle</a><br>"
|
||||
|
||||
dat += "Critical Patient Alerts: <a href='?src=\ref[src];critalerts=1'>[declare_crit ? "Yes" : "No"]</a><br>"
|
||||
|
||||
user << browse("<HEAD><TITLE>Medibot v1.0 controls</TITLE></HEAD>[dat]", "window=automed")
|
||||
onclose(user, "automed")
|
||||
return
|
||||
@@ -182,6 +186,9 @@
|
||||
else if ((href_list["declaretreatment"]) && (!src.locked || issilicon(usr)))
|
||||
src.declare_treatment = !src.declare_treatment
|
||||
|
||||
else if ((href_list["critalerts"]) && (!locked || issilicon(usr)))
|
||||
declare_crit = !declare_crit
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -222,6 +229,7 @@
|
||||
/obj/machinery/bot/medbot/Emag(mob/user as mob)
|
||||
..()
|
||||
if(open && !locked)
|
||||
declare_crit = 0
|
||||
if(user) user << "<span class='warning'>You short out [src]'s reagent synthesis circuits.</span>"
|
||||
spawn(0)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
@@ -341,6 +349,9 @@
|
||||
if(src.emagged == 2) //Everyone needs our medicine. (Our medicine is toxins)
|
||||
return 1
|
||||
|
||||
if(declare_crit && C.health <= 0) //Critical condition! Call for help!
|
||||
declare()
|
||||
|
||||
//If they're injured, we're using a beaker, and don't have one of our WONDERCHEMS.
|
||||
if((src.reagent_glass) && (src.use_beaker) && ((C.getBruteLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getOxyLoss() >= (heal_threshold + 15))))
|
||||
for(var/datum/reagent/R in src.reagent_glass.reagents.reagent_list)
|
||||
@@ -599,3 +610,13 @@
|
||||
user.drop_from_inventory(src)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/machinery/bot/medbot/declare()
|
||||
if(declare_cooldown)
|
||||
return
|
||||
var/area/location = get_area(src)
|
||||
declare_message = "<span class='info'>\icon[src] Medical emergency! A patient is in critical condition at [location]!</span>"
|
||||
..()
|
||||
declare_cooldown = 1
|
||||
spawn(100) //Ten seconds
|
||||
declare_cooldown = 0
|
||||
@@ -18,9 +18,11 @@
|
||||
var/target_lastloc //Loc of target when arrested.
|
||||
var/last_found //There's a delay
|
||||
var/frustration = 0
|
||||
var/check_records = 1
|
||||
// var/emagged = 0 //Emagged Secbots view everyone as a criminal
|
||||
var/idcheck = 0 //If false, all station IDs are authorized for weapons.
|
||||
var/check_records = 1 //Does it check security records?
|
||||
|
||||
var/idcheck = 0 //If true, arrest people with no IDs
|
||||
var/weaponscheck = 0 //If true, arrest people for weapons if they lack access var/check_records = 1 //Does it check security records?
|
||||
var/arrest_type = 0 //If true, don't handcuff
|
||||
var/declare_arrests = 0 //When making an arrest, should it notify everyone wearing sechuds?
|
||||
var/next_harm_time = 0
|
||||
@@ -51,7 +53,11 @@
|
||||
|
||||
var/nearest_beacon // the nearest beacon's tag
|
||||
var/turf/nearest_beacon_loc // the nearest beacon's location
|
||||
|
||||
var/weapons_check = 0
|
||||
var/safe_weapons = list(\
|
||||
/obj/item/weapon/gun/energy/laser/bluetag,\
|
||||
/obj/item/weapon/gun/energy/laser/redtag,\
|
||||
/obj/item/weapon/gun/energy/laser/practice)
|
||||
l_color = "#B40000"
|
||||
power_change()
|
||||
..()
|
||||
@@ -66,6 +72,7 @@
|
||||
desc = "It's Officer Beep O'sky! Powered by a potato and a shot of whiskey."
|
||||
idcheck = 0
|
||||
auto_patrol = 1
|
||||
weapons_check = 0
|
||||
|
||||
/obj/item/weapon/secbot_assembly
|
||||
name = "helmet/signaler assembly"
|
||||
@@ -124,13 +131,16 @@ Maintenance panel panel is [src.open ? "opened" : "closed"]"},
|
||||
|
||||
if(!src.locked || issilicon(user))
|
||||
dat += text({"<BR>
|
||||
Check for Weapon Authorization: []<BR>
|
||||
Check Security Records: []<BR>
|
||||
Arrest for No ID: [] <BR>
|
||||
Arrest for Unauthorized Weapons: []<BR>
|
||||
Arrest for Warrant: []<BR>
|
||||
<BR>
|
||||
Operating Mode: []<BR>
|
||||
Report Arrests: []<BR>
|
||||
Auto Patrol: []"},
|
||||
|
||||
"<A href='?src=\ref[src];operation=idcheck'>[src.idcheck ? "Yes" : "No"]</A>",
|
||||
"<A href='?src=\ref[src];operation=weaponscheck'>[weaponscheck ? "Yes" : "No"]</A>",
|
||||
"<A href='?src=\ref[src];operation=ignorerec'>[src.check_records ? "Yes" : "No"]</A>",
|
||||
"<A href='?src=\ref[src];operation=switchmode'>[src.arrest_type ? "Detain" : "Arrest"]</A>",
|
||||
"<A href='?src=\ref[src];operation=declarearrests'>[src.declare_arrests ? "Yes" : "No"]</A>",
|
||||
@@ -155,6 +165,9 @@ Auto Patrol: []"},
|
||||
if("idcheck")
|
||||
src.idcheck = !src.idcheck
|
||||
src.updateUsrDialog()
|
||||
if("weaponscheck")
|
||||
weaponscheck = !weaponscheck
|
||||
updateUsrDialog()
|
||||
if("ignorerec")
|
||||
src.check_records = !src.check_records
|
||||
src.updateUsrDialog()
|
||||
@@ -183,9 +196,14 @@ Auto Patrol: []"},
|
||||
user << "\red Access denied."
|
||||
else
|
||||
..()
|
||||
if(!istype(W, /obj/item/weapon/screwdriver) && (W.force) && (!src.target))
|
||||
src.target = user
|
||||
src.mode = SECBOT_HUNT
|
||||
if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != "harm") // Any intent but harm will heal, so we shouldn't get angry.
|
||||
return
|
||||
if(!istype(W, /obj/item/weapon/screwdriver) && (W.force) && (!target) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
|
||||
threatlevel = user.assess_threat(src)
|
||||
threatlevel += 6
|
||||
if(threatlevel > 0)
|
||||
target = user
|
||||
mode = SECBOT_HUNT
|
||||
|
||||
/obj/machinery/bot/secbot/Emag(mob/user as mob)
|
||||
..()
|
||||
@@ -250,6 +268,10 @@ Auto Patrol: []"},
|
||||
M.Weaken(10)
|
||||
M.stuttering = 10
|
||||
M.Stun(10)
|
||||
if(declare_arrests)
|
||||
declare()
|
||||
target.visible_message("<span class='danger'>[target] has been stunned by [src]!</span>",\
|
||||
"<span class='userdanger'>[target] has been stunned by [src]!</span>")
|
||||
maxstuns--
|
||||
if(maxstuns <= 0)
|
||||
target = null
|
||||
@@ -257,7 +279,7 @@ Auto Patrol: []"},
|
||||
if(declare_arrests)
|
||||
var/area/location = get_area(src)
|
||||
broadcast_security_hud_message("[src.name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] suspect <b>[target]</b> in <b>[location]</b>", src)
|
||||
visible_message("\red <B>[src.target] has been stunned by [src]!</B>")
|
||||
//visible_message("\red <B>[src.target] has been stunned by [src]!</B>")
|
||||
|
||||
mode = SECBOT_PREP_ARREST
|
||||
src.anchored = 1
|
||||
@@ -823,3 +845,14 @@ Auto Patrol: []"},
|
||||
if(!in_range(src, usr) && src.loc != usr)
|
||||
return
|
||||
src.created_name = t
|
||||
|
||||
/obj/machinery/bot/secbot/declare()
|
||||
var/area/location = get_area(src)
|
||||
declare_message = "<span class='info'>\icon[src] [name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] scumbag <b>[target]</b> in <b>[location]</b></span>"
|
||||
..()
|
||||
|
||||
/obj/machinery/bot/secbot/proc/check_for_weapons(var/obj/item/slot_item)
|
||||
if(istype(slot_item, /obj/item/weapon/gun) || istype(slot_item, /obj/item/weapon/melee))
|
||||
if(!(slot_item.type in safe_weapons))
|
||||
return 1
|
||||
return 0
|
||||
@@ -14,68 +14,9 @@
|
||||
name = "Health Scanner HUD"
|
||||
desc = "A heads-up display that scans the humans in view and provides accurate data about their health status."
|
||||
icon_state = "healthhud"
|
||||
proc
|
||||
RoundHealth(health)
|
||||
|
||||
|
||||
RoundHealth(health)
|
||||
switch(health)
|
||||
if(100 to INFINITY)
|
||||
return "health100"
|
||||
if(70 to 100)
|
||||
return "health80"
|
||||
if(50 to 70)
|
||||
return "health60"
|
||||
if(30 to 50)
|
||||
return "health40"
|
||||
if(18 to 30)
|
||||
return "health25"
|
||||
if(5 to 18)
|
||||
return "health10"
|
||||
if(1 to 5)
|
||||
return "health1"
|
||||
if(-99 to 0)
|
||||
return "health0"
|
||||
else
|
||||
return "health-100"
|
||||
return "0"
|
||||
|
||||
|
||||
process_hud(var/mob/M)
|
||||
if(!M) return
|
||||
if(!M.client) return
|
||||
var/client/C = M.client
|
||||
var/image/holder
|
||||
for(var/mob/living/carbon/human/patient in view(get_turf(M)))
|
||||
if(M.see_invisible < patient.invisibility)
|
||||
continue
|
||||
var/foundVirus = 0
|
||||
for(var/datum/disease/D in patient.viruses)
|
||||
if(!D.hidden[SCANNER])
|
||||
foundVirus++
|
||||
for (var/ID in patient.virus2)
|
||||
if (ID in virusDB)
|
||||
foundVirus = 1
|
||||
break
|
||||
if(!C) continue
|
||||
|
||||
holder = patient.hud_list[HEALTH_HUD]
|
||||
if(patient.stat == 2)
|
||||
holder.icon_state = "hudhealth-100"
|
||||
else
|
||||
holder.icon_state = "hud[RoundHealth(patient.health)]"
|
||||
C.images += holder
|
||||
|
||||
holder = patient.hud_list[STATUS_HUD]
|
||||
if(patient.stat == 2)
|
||||
holder.icon_state = "huddead"
|
||||
else if(patient.status_flags & XENO_HOST)
|
||||
holder.icon_state = "hudxeno"
|
||||
else if(foundVirus)
|
||||
holder.icon_state = "hudill"
|
||||
else
|
||||
holder.icon_state = "hudhealthy"
|
||||
C.images += holder
|
||||
/obj/item/clothing/glasses/hud/health/process_hud(var/mob/M)
|
||||
process_med_hud(M)
|
||||
|
||||
|
||||
/obj/item/clothing/glasses/hud/security
|
||||
@@ -92,62 +33,4 @@
|
||||
invisa_view = 2
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/process_hud(var/mob/M)
|
||||
if(!M) return
|
||||
if(!M.client) return
|
||||
var/client/C = M.client
|
||||
var/image/holder
|
||||
for(var/mob/living/carbon/human/perp in view(get_turf(M)))
|
||||
if(M.see_invisible < perp.invisibility)
|
||||
continue
|
||||
if(!C) continue
|
||||
var/perpname = perp.name
|
||||
holder = perp.hud_list[ID_HUD]
|
||||
if(perp.wear_id)
|
||||
var/obj/item/weapon/card/id/I = perp.wear_id.GetID()
|
||||
if(I)
|
||||
perpname = I.registered_name
|
||||
holder.icon_state = "hud[ckey(I.GetJobName())]"
|
||||
C.images += holder
|
||||
else
|
||||
perpname = perp.name
|
||||
holder.icon_state = "hudunknown"
|
||||
C.images += holder
|
||||
else
|
||||
perpname = perp.name
|
||||
holder.icon_state = "hudunknown"
|
||||
C.images += holder
|
||||
|
||||
for(var/datum/data/record/E in data_core.general)
|
||||
if(E.fields["name"] == perpname)
|
||||
holder = perp.hud_list[WANTED_HUD]
|
||||
for (var/datum/data/record/R in data_core.security)
|
||||
if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "*Arrest*"))
|
||||
holder.icon_state = "hudwanted"
|
||||
C.images += holder
|
||||
break
|
||||
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Incarcerated"))
|
||||
holder.icon_state = "hudprisoner"
|
||||
C.images += holder
|
||||
break
|
||||
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Parolled"))
|
||||
holder.icon_state = "hudparolled"
|
||||
C.images += holder
|
||||
break
|
||||
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Released"))
|
||||
holder.icon_state = "hudreleased"
|
||||
C.images += holder
|
||||
break
|
||||
for(var/obj/item/weapon/implant/I in perp)
|
||||
if(I.implanted)
|
||||
if(istype(I,/obj/item/weapon/implant/tracking))
|
||||
holder = perp.hud_list[IMPTRACK_HUD]
|
||||
holder.icon_state = "hud_imp_tracking"
|
||||
C.images += holder
|
||||
if(istype(I,/obj/item/weapon/implant/loyalty))
|
||||
holder = perp.hud_list[IMPLOYAL_HUD]
|
||||
holder.icon_state = "hud_imp_loyal"
|
||||
C.images += holder
|
||||
if(istype(I,/obj/item/weapon/implant/chem))
|
||||
holder = perp.hud_list[IMPCHEM_HUD]
|
||||
holder.icon_state = "hud_imp_chem"
|
||||
C.images += holder
|
||||
process_sec_hud(M,1)
|
||||
@@ -689,7 +689,8 @@
|
||||
/mob/living/carbon/human/Topic(href, href_list)
|
||||
var/pickpocket = 0
|
||||
var/list/ourlist = list()
|
||||
if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr) && Adjacent(usr))
|
||||
var/able = (!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr) && Adjacent(usr))
|
||||
|
||||
/*
|
||||
|
||||
if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr) && Adjacent(usr))
|
||||
@@ -702,7 +703,7 @@
|
||||
|
||||
*/
|
||||
|
||||
if(href_list["item"])
|
||||
if(href_list["item"] && able)
|
||||
var/slot = href_list["item"]
|
||||
var/obj/item/place_item = usr.get_active_hand()
|
||||
var/obj/item/id_item = src.wear_id
|
||||
@@ -756,7 +757,7 @@
|
||||
return
|
||||
|
||||
|
||||
if(href_list["pockets"])
|
||||
if(href_list["pockets"] && able)
|
||||
var/pocket_side = href_list["pockets"]
|
||||
var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store)
|
||||
var/obj/item/pocket_item = (pocket_id == slot_r_store ? src.r_store : src.l_store)
|
||||
@@ -789,9 +790,6 @@
|
||||
// Display a warning if the user mocks up
|
||||
src << "<span class='warning'>You feel your [pocket_side] pocket being fumbled with!</span>"
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
if (href_list["refresh"])
|
||||
if((machine)&&(in_range(src, usr)))
|
||||
@@ -821,10 +819,11 @@
|
||||
return
|
||||
*/
|
||||
if (href_list["criminal"])
|
||||
var/sechud = hasHUD(usr,"security")
|
||||
if(hasHUD(usr,"security"))
|
||||
|
||||
var/modified = 0
|
||||
var/perpname = "wot"
|
||||
var/modified
|
||||
|
||||
if(wear_id)
|
||||
var/obj/item/weapon/card/id/I = wear_id.GetID()
|
||||
if(I)
|
||||
@@ -836,6 +835,7 @@
|
||||
|
||||
if(perpname)
|
||||
for (var/datum/data/record/E in data_core.general)
|
||||
usr << E.fields["name"]
|
||||
if (E.fields["name"] == perpname)
|
||||
for (var/datum/data/record/R in data_core.security)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
@@ -1770,4 +1770,76 @@ mob/living/carbon/human/yank_out_object()
|
||||
ACL |= I.GetAccess()
|
||||
if(wear_id)
|
||||
ACL |= wear_id.GetAccess()
|
||||
return ACL
|
||||
return ACL
|
||||
|
||||
/mob/living/carbon/human/assess_threat(var/obj/machinery/bot/secbot/judgebot, var/lasercolor)
|
||||
if(judgebot.emagged == 2)
|
||||
return 10 //Everyone is a criminal!
|
||||
|
||||
var/threatcount = 0
|
||||
|
||||
//Lasertag
|
||||
if(lasercolor)
|
||||
if(lasercolor == "b")//Lasertag turrets target the opposing team.
|
||||
if(istype(wear_suit, /obj/item/clothing/suit/redtag))
|
||||
threatcount += 4
|
||||
if((istype(r_hand,/obj/item/weapon/gun/energy/laser/redtag)) || (istype(l_hand,/obj/item/weapon/gun/energy/laser/redtag)))
|
||||
threatcount += 4
|
||||
if(istype(belt, /obj/item/weapon/gun/energy/laser/redtag))
|
||||
threatcount += 2
|
||||
|
||||
if(lasercolor == "r")
|
||||
if(istype(wear_suit, /obj/item/clothing/suit/bluetag))
|
||||
threatcount += 4
|
||||
if((istype(r_hand,/obj/item/weapon/gun/energy/laser/bluetag)) || (istype(l_hand,/obj/item/weapon/gun/energy/laser/bluetag)))
|
||||
threatcount += 4
|
||||
if(istype(belt, /obj/item/weapon/gun/energy/laser/bluetag))
|
||||
threatcount += 2
|
||||
|
||||
return threatcount
|
||||
|
||||
//Check for ID
|
||||
var/obj/item/weapon/card/id/idcard = get_idcard()
|
||||
if(judgebot.idcheck && !idcard)
|
||||
threatcount += 4
|
||||
|
||||
//Check for weapons
|
||||
if(judgebot.weaponscheck)
|
||||
if(!idcard || !(access_weapons in idcard.access))
|
||||
if(judgebot.check_for_weapons(l_hand))
|
||||
threatcount += 4
|
||||
if(judgebot.check_for_weapons(r_hand))
|
||||
threatcount += 4
|
||||
if(judgebot.check_for_weapons(belt))
|
||||
threatcount += 2
|
||||
|
||||
//Check for arrest warrant
|
||||
if(judgebot.check_records)
|
||||
var/perpname = get_face_name(get_id_name())
|
||||
var/datum/data/record/R = find_record("name", perpname, data_core.security)
|
||||
if(R && R.fields["criminal"])
|
||||
switch(R.fields["criminal"])
|
||||
if("*Arrest*")
|
||||
threatcount += 5
|
||||
if("Incarcerated")
|
||||
threatcount += 2
|
||||
if("Parolled")
|
||||
threatcount += 2
|
||||
|
||||
//Check for dresscode violations
|
||||
if(istype(head, /obj/item/clothing/head/wizard) || istype(head, /obj/item/clothing/head/helmet/space/rig/wizard))
|
||||
threatcount += 2
|
||||
|
||||
//Loyalty implants imply trustworthyness
|
||||
if(isloyal(src))
|
||||
threatcount -= 1
|
||||
|
||||
//Secbots are racist!
|
||||
if(dna && dna.mutantrace && dna.mutantrace != "none")
|
||||
threatcount += 2
|
||||
|
||||
//Agent cards lower threatlevel.
|
||||
if(istype(idcard, /obj/item/weapon/card/id/syndicate))
|
||||
threatcount -= 2
|
||||
|
||||
return threatcount
|
||||
@@ -1093,20 +1093,11 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
|
||||
return 1
|
||||
|
||||
proc/handle_regular_hud_updates()
|
||||
if(hud_updateflag)
|
||||
handle_hud_list()
|
||||
|
||||
|
||||
if(!client) return 0
|
||||
|
||||
if(hud_updateflag)
|
||||
handle_hud_list()
|
||||
regular_hud_updates()
|
||||
|
||||
|
||||
for(var/image/hud in client.images)
|
||||
if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe
|
||||
client.images.Remove(hud)
|
||||
|
||||
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask/*, global_hud.nvg*/)
|
||||
|
||||
update_action_buttons()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
/mob/living/carbon/slime/proc/regular_hud_updates()
|
||||
/mob/living/carbon/slime/regular_hud_updates()
|
||||
return
|
||||
|
||||
|
||||
@@ -522,4 +522,35 @@
|
||||
var/obj/item/I = get_active_hand()
|
||||
if(istype(I))
|
||||
ACL |= I.GetAccess()
|
||||
return ACL
|
||||
return ACL
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/assess_threat(var/obj/machinery/bot/secbot/judgebot, var/lasercolor)
|
||||
if(judgebot.emagged == 2)
|
||||
return 10 //Everyone is a criminal!
|
||||
var/threatcount = 0
|
||||
|
||||
//Lasertag bullshit
|
||||
if(lasercolor)
|
||||
if(lasercolor == "b")//Lasertag turrets target the opposing team, how great is that? -Sieve
|
||||
if((istype(r_hand,/obj/item/weapon/gun/energy/laser/redtag)) || (istype(l_hand,/obj/item/weapon/gun/energy/laser/redtag)))
|
||||
threatcount += 4
|
||||
|
||||
if(lasercolor == "r")
|
||||
if((istype(r_hand,/obj/item/weapon/gun/energy/laser/bluetag)) || (istype(l_hand,/obj/item/weapon/gun/energy/laser/bluetag)))
|
||||
threatcount += 4
|
||||
|
||||
return threatcount
|
||||
|
||||
//Check for weapons
|
||||
if(judgebot.weaponscheck)
|
||||
if(judgebot.check_for_weapons(l_hand))
|
||||
threatcount += 4
|
||||
if(judgebot.check_for_weapons(r_hand))
|
||||
threatcount += 4
|
||||
|
||||
//Loyalty implants imply trustworthyness
|
||||
if(isloyal(src))
|
||||
threatcount -= 1
|
||||
|
||||
return threatcount
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/silicon/pai/proc/regular_hud_updates()
|
||||
/mob/living/silicon/pai/regular_hud_updates()
|
||||
if(client)
|
||||
for(var/image/hud in client.images)
|
||||
if(copytext(hud.icon_state,1,4) == "hud")
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
del(src.cable)
|
||||
|
||||
regular_hud_updates()
|
||||
if(src.secHUD == 1)
|
||||
src.securityHUD()
|
||||
if(src.medHUD == 1)
|
||||
src.medicalHUD()
|
||||
if(src.secHUD)
|
||||
process_sec_hud(src)
|
||||
if(src.medHUD)
|
||||
process_med_hud(src)
|
||||
if(silence_time)
|
||||
if(world.timeofday >= silence_time)
|
||||
silence_time = null
|
||||
|
||||
@@ -168,12 +168,13 @@
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
|
||||
for(var/image/hud in client.images) //COPIED FROM the human handle_regular_hud_updates() proc
|
||||
if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe
|
||||
client.images.Remove(hud)
|
||||
regular_hud_updates() //Handles MED/SEC HUDs for borgs.
|
||||
|
||||
var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src)
|
||||
if(hud && hud.hud) hud.hud.process_hud(src)
|
||||
switch(sensor_mode)
|
||||
if (SEC_HUD)
|
||||
process_sec_hud(src, 1)
|
||||
if (MED_HUD)
|
||||
process_med_hud(src)
|
||||
|
||||
if (src.healths)
|
||||
if (src.stat != 2)
|
||||
|
||||
@@ -1268,6 +1268,10 @@
|
||||
statelaws()
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/sensor_mode() //Medical/Security HUD controller for borgs
|
||||
set category = "Robot Commands"
|
||||
set desc = "Augment visual feed with internal sensor overlays."
|
||||
..()
|
||||
/mob/living/silicon/robot/proc/radio_menu()
|
||||
radio.interact(src)//Just use the radio's Topic() instead of bullshit special-snowflake code
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
New()
|
||||
..()
|
||||
src.modules += new /obj/item/borg/sight/hud/med(src)
|
||||
//src.modules += new /obj/item/borg/sight/hud/med(src)
|
||||
src.modules += new /obj/item/device/healthanalyzer(src)
|
||||
src.modules += new /obj/item/weapon/reagent_containers/borghypo(src)
|
||||
src.modules += new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
|
||||
@@ -191,7 +191,7 @@
|
||||
|
||||
New()
|
||||
..()
|
||||
src.modules += new /obj/item/borg/sight/hud/sec(src)
|
||||
//src.modules += new /obj/item/borg/sight/hud/sec(src)
|
||||
src.modules += new /obj/item/weapon/handcuffs/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/melee/baton/loaded(src)
|
||||
src.modules += new /obj/item/weapon/gun/energy/taser/cyborg(src)
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
var/list/alarms_to_clear = list()
|
||||
immune_to_ssd = 1
|
||||
|
||||
var/sensor_mode = 0 //Determines the current HUD.
|
||||
#define SEC_HUD 1 //Security HUD mode
|
||||
#define MED_HUD 2 //Medical HUD mode
|
||||
var/list/alarm_types_show = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0, "Camera" = 0)
|
||||
var/list/alarm_types_clear = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0, "Camera" = 0)
|
||||
|
||||
@@ -225,3 +228,23 @@
|
||||
return damage
|
||||
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/assess_threat() //Secbots will not target silicons!
|
||||
return -10
|
||||
|
||||
/mob/living/silicon/verb/sensor_mode()
|
||||
set name = "Set Sensor Augmentation"
|
||||
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical"/*,"Light Amplification"*/,"Disable")
|
||||
switch(sensor_type)
|
||||
if ("Security")
|
||||
sensor_mode = SEC_HUD
|
||||
src << "<span class='notice'>Security records overlay enabled.</span>"
|
||||
if ("Medical")
|
||||
sensor_mode = MED_HUD
|
||||
src << "<span class='notice'>Life signs monitor overlay enabled.</span>"/*
|
||||
if ("Light Amplification")
|
||||
src.sensor_mode = NIGHT
|
||||
src << "<span class='notice'>Light amplification mode enabled.</span>"*/
|
||||
if ("Disable")
|
||||
sensor_mode = 0
|
||||
src << "Sensor augmentations disabled."
|
||||
@@ -1455,4 +1455,7 @@ mob/verb/yank_out_object()
|
||||
|
||||
// Skip over all the complex list checks.
|
||||
/mob/proc/hasFullAccess()
|
||||
return 0
|
||||
|
||||
mob/proc/assess_threat()
|
||||
return 0
|
||||
Reference in New Issue
Block a user