Merge remote-tracking branch 'ParadiseSS13/master' into nanoui-is-dead

This commit is contained in:
AffectedArc07
2020-11-27 10:21:41 +00:00
29 changed files with 506 additions and 191 deletions
+6 -3
View File
@@ -739,9 +739,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
//overriden here and in /mob/living for different point span classes and sanity checks
/mob/dead/observer/pointed(atom/A as mob|obj|turf in view())
if(!..())
return 0
usr.visible_message("<span class='deadsay'><b>[src]</b> points to [A].</span>")
return 1
return FALSE
var/follow_link
if(invisibility) // Only show the button if the ghost is not visible to the living
follow_link = " ([ghost_follow_link(A, src)])"
usr.visible_message("<span class='deadsay'><b>[src]</b> points to [A][follow_link].</span>")
return TRUE
/mob/dead/observer/proc/incarnate_ghost()
if(!client)
-4
View File
@@ -787,8 +787,6 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
if((I = get_restraining_item())) // If there is nothing to restrain him then he is not restrained
var/breakouttime = I.breakouttime
var/displaytime = breakouttime / 10
changeNext_move(CLICK_CD_BREAKOUT)
last_special = world.time + CLICK_CD_BREAKOUT
visible_message("<span class='warning'>[src] attempts to unbuckle [p_them()]self!</span>", \
"<span class='notice'>You attempt to unbuckle yourself... (This will take around [displaytime] seconds and you need to stay still.)</span>")
if(do_after(src, breakouttime, 0, target = src))
@@ -824,8 +822,6 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
else if(legcuffed)
I = legcuffed
if(I)
changeNext_move(CLICK_CD_BREAKOUT)
last_special = world.time + CLICK_CD_BREAKOUT
cuff_resist(I)
/mob/living/carbon/resist_muzzle()
@@ -1181,8 +1181,6 @@
/mob/living/carbon/human/resist_restraints()
if(wear_suit && wear_suit.breakouttime)
changeNext_move(CLICK_CD_BREAKOUT)
last_special = world.time + CLICK_CD_BREAKOUT
cuff_resist(wear_suit)
else
..()
@@ -1544,7 +1542,10 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
if(judgebot.check_for_weapons(r_hand))
threatcount += 4
if(judgebot.check_for_weapons(belt))
threatcount += 2
threatcount += 4
if(judgebot.check_for_weapons(s_store))
threatcount += 4
//Check for arrest warrant
if(judgebot.check_records)
@@ -871,29 +871,37 @@ Pass a positive integer as an argument to override a bot's default speed.
if("remote")
remote_disabled = !remote_disabled
if("hack")
if(emagged != 2)
emagged = 2
hacked = 1
locked = 1
to_chat(usr, "<span class='warning'>[text_hack]</span>")
show_laws()
bot_reset()
add_attack_logs(usr, src, "Hacked")
else if(!hacked)
to_chat(usr, "<span class='userdanger'>[text_dehack_fail]</span>")
else
emagged = 0
hacked = 0
to_chat(usr, "<span class='notice'>[text_dehack]</span>")
show_laws()
bot_reset()
add_attack_logs(usr, src, "Dehacked")
handle_hacking(usr)
if("ejectpai")
if(paicard && (!locked || issilicon(usr) || usr.can_admin_interact()))
to_chat(usr, "<span class='notice'>You eject [paicard] from [bot_name]</span>")
ejectpai(usr)
update_controls()
/mob/living/simple_animal/bot/proc/canhack(mob/M)
return ((issilicon(M) && !emagged) || M.can_admin_interact())
/mob/living/simple_animal/bot/proc/handle_hacking(mob/M) // refactored out of Topic/ to allow re-use by TGUIs
if(!canhack(M))
return
if(emagged != 2)
emagged = 2
hacked = TRUE
locked = TRUE
to_chat(M, "<span class='warning'>[text_hack]</span>")
show_laws()
bot_reset()
add_attack_logs(M, src, "Hacked")
else if(!hacked)
to_chat(M, "<span class='userdanger'>[text_dehack_fail]</span>")
else
emagged = FALSE
hacked = FALSE
to_chat(M, "<span class='notice'>[text_dehack]</span>")
show_laws()
bot_reset()
add_attack_logs(M, src, "Dehacked")
/mob/living/simple_animal/bot/proc/update_icon()
icon_state = "[initial(icon_state)][on]"
@@ -910,16 +918,17 @@ Pass a positive integer as an argument to override a bot's default speed.
/mob/living/simple_animal/bot/proc/topic_denied(mob/user) //Access check proc for bot topics! Remember to place in a bot's individual Topic if desired.
if(user.can_admin_interact())
return 0
return FALSE
if(user.incapacitated() || !(issilicon(user) || in_range(src, user)))
return 1
// 0 for access, 1 for denied.
return TRUE
if(emagged == 2) //An emagged bot cannot be controlled by humans, silicons can if one hacked it.
if(!hacked) //Manually emagged by a human - access denied to all.
return 1
return TRUE
else if(!issilicon(user)) //Bot is hacked, so only silicons are allowed access.
return 1
return 0
return TRUE
if(locked && !issilicon(user))
return TRUE
return FALSE
/mob/living/simple_animal/bot/proc/hack(mob/user)
var/hack
@@ -190,29 +190,58 @@
req_one_access = list(ACCESS_JANITOR, ACCESS_ROBOTICS)
/mob/living/simple_animal/bot/cleanbot/get_controls(mob/user)
var/dat
dat += hack(user)
dat += showpai(user)
dat += text({"
<TT><B>Cleaner v1.1 controls</B></TT><BR><BR>
Status: []<BR>
Behaviour controls are [locked ? "locked" : "unlocked"]<BR>
Maintenance panel panel is [open ? "opened" : "closed"]"},
text("<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>"))
if(!locked || issilicon(user) || user.can_admin_interact())
dat += text({"<BR>Cleans Blood: []<BR>"}, text("<A href='?src=[UID()];operation=blood'>[blood ? "Yes" : "No"]</A>"))
dat += text({"<BR>Patrol station: []<BR>"}, text("<A href='?src=[UID()];operation=patrol'>[auto_patrol ? "Yes" : "No"]</A>"))
return dat
/mob/living/simple_animal/bot/cleanbot/show_controls(mob/M)
tgui_interact(M)
/mob/living/simple_animal/bot/cleanbot/Topic(href, href_list)
if(..())
return 1
switch(href_list["operation"])
/mob/living/simple_animal/bot/cleanbot/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "BotClean", name, 500, 500)
ui.open()
/mob/living/simple_animal/bot/cleanbot/tgui_data(mob/user)
var/list/data = list(
"locked" = locked, // controls, locked or not
"noaccess" = topic_denied(user), // does the current user have access? admins, silicons etc can still access bots with locked controls
"maintpanel" = open,
"on" = on,
"autopatrol" = auto_patrol,
"painame" = paicard ? paicard.pai.name : null,
"canhack" = canhack(user),
"emagged" = emagged, // this is an int, NOT a boolean
"remote_disabled" = remote_disabled, // -- STUFF BELOW HERE IS SPECIFIC TO THIS BOT
"cleanblood" = blood
)
return data
/mob/living/simple_animal/bot/cleanbot/tgui_act(action, params)
if (..())
return
if(topic_denied(usr))
to_chat(usr, "<span class='warning'>[src]'s interface is not responding!</span>")
return
add_fingerprint(usr)
. = TRUE
switch(action)
if("power")
if(on)
turn_off()
else
turn_on()
if("autopatrol")
auto_patrol = !auto_patrol
bot_reset()
if("hack")
handle_hacking(usr)
if("disableremote")
remote_disabled = !remote_disabled
if("blood")
blood =!blood
get_targets()
update_controls()
if("ejectpai")
ejectpai()
/mob/living/simple_animal/bot/cleanbot/UnarmedAttack(atom/A)
if(istype(A,/obj/effect/decal/cleanable))
@@ -102,64 +102,77 @@
text_dehack = "You restore [name]'s combat inhibitor."
text_dehack_fail = "[name] ignores your attempts to restrict [p_them()]!"
/mob/living/simple_animal/bot/ed209/get_controls(mob/user)
var/dat
dat += hack(user)
dat += showpai(user)
dat += text({"
<TT><B>Security Unit v2.6 controls</B></TT><BR><BR>
Status: []<BR>
Behaviour controls are [locked ? "locked" : "unlocked"]<BR>
Maintenance panel panel is [open ? "opened" : "closed"]<BR>"},
/mob/living/simple_animal/bot/ed209/show_controls(mob/M)
tgui_interact(M)
"<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>" )
/mob/living/simple_animal/bot/ed209/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "BotSecurity", name, 500, 500)
ui.open()
if(!locked || issilicon(user) || user.can_admin_interact())
dat += "Auto Patrol <A href='?src=[UID()];operation=patrol'>[auto_patrol ? "On" : "Off"]</A><BR>"
/mob/living/simple_animal/bot/ed209/tgui_data(mob/user)
var/list/data = list(
"locked" = locked, // controls, locked or not
"noaccess" = topic_denied(user), // does the current user have access? admins, silicons etc can still access bots with locked controls
"maintpanel" = open,
"on" = on,
"autopatrol" = auto_patrol,
"painame" = paicard ? paicard.pai.name : null,
"canhack" = canhack(user),
"emagged" = emagged, // this is an int, NOT a boolean
"remote_disabled" = remote_disabled, // -- STUFF BELOW HERE IS SPECIFIC TO THIS BOT
"check_id" = idcheck,
"check_weapons" = weaponscheck,
"check_warrant" = check_records,
"arrest_mode" = arrest_type, // detain or arrest
"arrest_declare" = declare_arrests // announce arrests on radio
)
return data
if(!lasercolor)
dat += text({"<BR>
Arrest Unidentifiable Persons: []<BR>
Arrest for Unauthorized Weapons: []<BR>
Arrest for Warrant: []<BR>
<BR>
Operating Mode: []<BR>
Report Arrests[]<BR>"},
"<A href='?src=[UID()];operation=idcheck'>[idcheck ? "Yes" : "No"]</A>",
"<A href='?src=[UID()];operation=weaponscheck'>[weaponscheck ? "Yes" : "No"]</A>",
"<A href='?src=[UID()];operation=ignorerec'>[check_records ? "Yes" : "No"]</A>",
"<A href='?src=[UID()];operation=switchmode'>[arrest_type ? "Detain" : "Arrest"]</A>",
"<A href='?src=[UID()];operation=declarearrests'>[declare_arrests ? "Yes" : "No"]</A>")
return dat
/mob/living/simple_animal/bot/ed209/Topic(href, href_list)
if(lasercolor && (istype(usr,/mob/living/carbon/human)))
var/mob/living/carbon/human/H = usr
if((lasercolor == "b") && (istype(H.wear_suit, /obj/item/clothing/suit/redtag)))//Opposing team cannot operate it
return
else if((lasercolor == "r") && (istype(H.wear_suit, /obj/item/clothing/suit/bluetag)))
return
if(..())
return 1
switch(href_list["operation"])
if("idcheck")
idcheck = !idcheck
update_controls()
if("weaponscheck")
/mob/living/simple_animal/bot/ed209/tgui_act(action, params)
if (..())
return
if(topic_denied(usr))
to_chat(usr, "<span class='warning'>[src]'s interface is not responding!</span>")
return
add_fingerprint(usr)
. = TRUE
switch(action)
if("power")
if(on)
turn_off()
else
turn_on()
if("autopatrol")
auto_patrol = !auto_patrol
bot_reset()
if("hack")
handle_hacking(usr)
if("disableremote")
remote_disabled = !remote_disabled
if("authweapon")
weaponscheck = !weaponscheck
update_controls()
if("ignorerec")
if("authid")
idcheck = !idcheck
if("authwarrant")
check_records = !check_records
update_controls()
if("switchmode")
if("arrtype")
arrest_type = !arrest_type
update_controls()
if("declarearrests")
if("arrdeclare")
declare_arrests = !declare_arrests
update_controls()
if("ejectpai")
ejectpai()
/mob/living/simple_animal/bot/ed209/topic_denied(mob/user)
if(lasercolor && ishuman(user))
var/mob/living/carbon/human/H = user
if((lasercolor == "b") && (istype(H.wear_suit, /obj/item/clothing/suit/redtag))) //Opposing team cannot operate it
return TRUE
else if((lasercolor == "r") && (istype(H.wear_suit, /obj/item/clothing/suit/bluetag)))
return TRUE
return ..()
/mob/living/simple_animal/bot/ed209/proc/retaliate(mob/living/carbon/human/H)
threatlevel = H.assess_threat(src)
@@ -462,7 +475,6 @@
target = user
mode = BOT_HUNT
/mob/living/simple_animal/bot/ed209/emp_act(severity)
if(severity==2 && prob(70))
@@ -111,61 +111,71 @@
last_found = world.time
/mob/living/simple_animal/bot/secbot/set_custom_texts()
text_hack = "You overload [name]'s target identification system."
text_dehack = "You reboot [name] and restore the target identification."
text_dehack_fail = "[name] refuses to accept your authority!"
/mob/living/simple_animal/bot/secbot/get_controls(mob/user)
var/dat
dat += hack(user)
dat += showpai(user)
dat += text({"
<TT><B>[window_name]</B></TT><BR><BR>
Status: []<BR>
Behaviour controls are [locked ? "locked" : "unlocked"]<BR>
Maintenance panel panel is [open ? "opened" : "closed"]"},
/mob/living/simple_animal/bot/secbot/show_controls(mob/M)
tgui_interact(M)
"<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>" )
/mob/living/simple_animal/bot/secbot/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "BotSecurity", name, 500, 500)
ui.open()
if(!locked || issilicon(user) || user.can_admin_interact())
dat += text({"<BR>
Arrest Unidentifiable Persons: []<BR>
Arrest for Unauthorized Weapons: []<BR>
Arrest for Warrant: []<BR>
Operating Mode: []<BR>
Report Arrests[]<BR>
Auto Patrol: []"},
/mob/living/simple_animal/bot/secbot/tgui_data(mob/user)
var/list/data = list(
"locked" = locked, // controls, locked or not
"noaccess" = topic_denied(user), // does the current user have access? admins, silicons etc can still access bots with locked controls
"maintpanel" = open,
"on" = on,
"autopatrol" = auto_patrol,
"painame" = paicard ? paicard.pai.name : null,
"canhack" = canhack(user),
"emagged" = emagged, // this is an int, NOT a boolean
"remote_disabled" = remote_disabled, // -- STUFF BELOW HERE IS SPECIFIC TO THIS BOT
"check_id" = idcheck,
"check_weapons" = weaponscheck,
"check_warrant" = check_records,
"arrest_mode" = arrest_type, // detain or arrest
"arrest_declare" = declare_arrests // announce arrests on radio
)
return data
"<A href='?src=[UID()];operation=idcheck'>[idcheck ? "Yes" : "No"]</A>",
"<A href='?src=[UID()];operation=weaponscheck'>[weaponscheck ? "Yes" : "No"]</A>",
"<A href='?src=[UID()];operation=ignorerec'>[check_records ? "Yes" : "No"]</A>",
"<A href='?src=[UID()];operation=switchmode'>[arrest_type ? "Detain" : "Arrest"]</A>",
"<A href='?src=[UID()];operation=declarearrests'>[declare_arrests ? "Yes" : "No"]</A>",
"<A href='?src=[UID()];operation=patrol'>[auto_patrol ? "On" : "Off"]</A>" )
return dat
/mob/living/simple_animal/bot/secbot/Topic(href, href_list)
if(..())
return 1
switch(href_list["operation"])
if("idcheck")
idcheck = !idcheck
update_controls()
if("weaponscheck")
/mob/living/simple_animal/bot/secbot/tgui_act(action, params)
if (..())
return
if(topic_denied(usr))
to_chat(usr, "<span class='warning'>[src]'s interface is not responding!</span>")
return
add_fingerprint(usr)
. = TRUE
switch(action)
if("power")
if(on)
turn_off()
else
turn_on()
if("autopatrol")
auto_patrol = !auto_patrol
bot_reset()
if("hack")
handle_hacking(usr)
if("disableremote")
remote_disabled = !remote_disabled
if("authweapon")
weaponscheck = !weaponscheck
update_controls()
if("ignorerec")
if("authid")
idcheck = !idcheck
if("authwarrant")
check_records = !check_records
update_controls()
if("switchmode")
if("arrtype")
arrest_type = !arrest_type
update_controls()
if("declarearrests")
if("arrdeclare")
declare_arrests = !declare_arrests
update_controls()
if("ejectpai")
ejectpai()
/mob/living/simple_animal/bot/secbot/proc/retaliate(mob/living/carbon/human/H)
threatlevel = H.assess_threat(src)
@@ -47,11 +47,14 @@
..()
update_icon()
/mob/living/simple_animal/bot/ed209/syndicate/get_controls(mob/user)
/mob/living/simple_animal/bot/ed209/syndicate/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
to_chat(user, "<span class='warning'>[src] has no accessible control panel!</span>")
return
/mob/living/simple_animal/bot/ed209/syndicate/show_controls(mob/M)
/mob/living/simple_animal/bot/ed209/syndicate/tgui_data(mob/user)
return
/mob/living/simple_animal/bot/ed209/syndicate/tgui_act(action, params)
return
/mob/living/simple_animal/bot/ed209/syndicate/Topic(href, href_list)
+1
View File
@@ -14,6 +14,7 @@
update_sight()
update_blind_effects()
update_canmove()
set_typing_indicator(FALSE)
return 1
/mob/living/proc/WakeUp(updating = 1)
+2 -2
View File
@@ -27,7 +27,7 @@
return
*/
message = replace_characters(message, ILLEGAL_CHARACTERS_LIST)
set_typing_indicator(0)
set_typing_indicator(FALSE)
usr.say(message)
@@ -37,7 +37,7 @@
message = strip_html_properly(message)
set_typing_indicator(0)
set_typing_indicator(FALSE, TRUE)
if(use_me)
custom_emote(usr.emote_type, message)
else
+36 -15
View File
@@ -7,7 +7,14 @@
GLOBAL_LIST_EMPTY(typing_indicator)
/mob/proc/set_typing_indicator(state)
/**
* Toggles the floating chat bubble above a players head.
*
* Arguments:
* * state - Should a chat bubble be shown or hidden
* * me - Is the bubble being caused by the 'me' emote command
*/
/mob/proc/set_typing_indicator(state, me)
if(!GLOB.typing_indicator[bubble_icon])
GLOB.typing_indicator[bubble_icon] = image('icons/mob/talk.dmi', null, "[bubble_icon]typing", FLY_LAYER)
@@ -21,28 +28,28 @@ GLOBAL_LIST_EMPTY(typing_indicator)
return
if(client)
if((client.prefs.toggles & PREFTOGGLE_SHOW_TYPING) || stat != CONSCIOUS || is_muzzled())
if(stat != CONSCIOUS || is_muzzled() || (client.prefs.toggles & PREFTOGGLE_SHOW_TYPING) || (me && (client.prefs.toggles2 & PREFTOGGLE_2_EMOTE_BUBBLE)))
overlays -= GLOB.typing_indicator[bubble_icon]
else
if(state)
if(!typing)
overlays += GLOB.typing_indicator[bubble_icon]
typing = 1
typing = TRUE
else
if(typing)
overlays -= GLOB.typing_indicator[bubble_icon]
typing = 0
typing = FALSE
return state
/mob/verb/say_wrapper()
set name = ".Say"
set hidden = 1
set_typing_indicator(1)
set_typing_indicator(TRUE)
hud_typing = 1
var/message = typing_input(src, "", "say (text)")
hud_typing = 0
set_typing_indicator(0)
set_typing_indicator(FALSE)
if(message)
say_verb(message)
@@ -51,11 +58,11 @@ GLOBAL_LIST_EMPTY(typing_indicator)
set hidden = 1
set_typing_indicator(1)
set_typing_indicator(TRUE, TRUE)
hud_typing = 1
var/message = typing_input(src, "", "me (text)")
hud_typing = 0
set_typing_indicator(0)
set_typing_indicator(FALSE)
if(message)
me_verb(message)
@@ -69,26 +76,40 @@ GLOBAL_LIST_EMPTY(typing_indicator)
last_typed_time = world.time
if(world.time > last_typed_time + TYPING_INDICATOR_LIFETIME)
set_typing_indicator(0)
set_typing_indicator(FALSE)
return
if(length(temp) > 5 && findtext(temp, "Say \"", 1, 7))
set_typing_indicator(1)
set_typing_indicator(TRUE)
else if(length(temp) > 3 && findtext(temp, "Me ", 1, 5))
set_typing_indicator(1)
set_typing_indicator(TRUE, TRUE)
else
set_typing_indicator(0)
set_typing_indicator(FALSE)
/client/verb/typing_indicator()
set name = "Show/Hide Typing Indicator"
set category = "Preferences"
set desc = "Toggles showing an indicator when you are typing emote or say message."
set desc = "Toggles showing an indicator when you are typing a message."
prefs.toggles ^= PREFTOGGLE_SHOW_TYPING
prefs.save_preferences(src)
to_chat(src, "You will [(prefs.toggles & PREFTOGGLE_SHOW_TYPING) ? "no longer" : "now"] display a typing indicator.")
// Clear out any existing typing indicator.
if(prefs.toggles & PREFTOGGLE_SHOW_TYPING)
if(istype(mob)) mob.set_typing_indicator(0)
if(istype(mob))
mob.set_typing_indicator(FALSE)
feedback_add_details("admin_verb","TID") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
feedback_add_details("admin_verb", "TID") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/emote_indicator()
set name = "Show/Hide Emote Typing Indicator"
set category = "Preferences"
set desc = "Toggles showing an indicator when you are typing an emote."
prefs.toggles2 ^= PREFTOGGLE_2_EMOTE_BUBBLE
prefs.save_preferences(src)
to_chat(src, "You will [(prefs.toggles2 & PREFTOGGLE_2_EMOTE_BUBBLE) ? "no longer" : "now"] display a typing indicator for emotes.")
feedback_add_details("admin_verb", "EID") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
#undef TYPING_INDICATOR_LIFETIME