Merge pull request #3208 from Citadel-Station-13/upstream-merge-31386

[MIRROR] Remove drop_item, drop_item_v, put_in_hands_or_del
This commit is contained in:
LetterJay
2017-10-08 16:18:18 -04:00
committed by GitHub
154 changed files with 2047 additions and 2234 deletions
+2 -18
View File
@@ -222,26 +222,10 @@
I.dropped(src)
return FALSE
/mob/proc/put_in_hands_or_del(obj/item/I)
return put_in_hands(I, TRUE)
/mob/proc/drop_item_v() //this is dumb.
if(stat == CONSCIOUS && isturf(loc))
return drop_item()
return FALSE
/mob/proc/drop_all_held_items()
. = FALSE
for(var/obj/item/I in held_items)
dropItemToGround(I)
//Drops the item in our active hand.
/mob/proc/drop_item()
var/obj/item/held = get_active_held_item()
return dropItemToGround(held)
. |= dropItemToGround(I)
//Here lie drop_from_inventory and before_item_take, already forgotten and not missed.
+1 -2
View File
@@ -115,9 +115,8 @@
//since these people will be dead M != usr
if(!C.getorgan(/obj/item/organ/brain))
if(!C.get_bodypart("head"))
if(!C.get_bodypart("head") || !C.temporarilyRemoveItemFromInventory(src))
return
user.drop_item()
var/msg = "[C] has [src] inserted into [C.p_their()] head by [user]."
if(C == user)
msg = "[user] inserts [src] into [user.p_their()] head!"
@@ -51,7 +51,7 @@
"<span class='userdanger'>[M] has pushed down [src]!</span>")
else
if (prob(50))
drop_item()
dropItemToGround(get_active_held_item())
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \
"<span class='userdanger'>[M] has disarmed [src]!</span>", null, COMBAT_MESSAGE_RANGE)
+2 -2
View File
@@ -44,7 +44,7 @@
user << "<span class='warning'>Your hands are full.</span>"
user << "<span class='warning'>Their hands are full.</span>"
return
if(!user.drop_item(I))
if(!user.dropItemToGround(I))
src << "<span class='warning'>[user] can't let go of \the [I]!</span>"
user << "<span class='warning'>You can't seem to let go of \the [I].</span>"
return
@@ -55,4 +55,4 @@
if("No")
src.visible_message("<span class='warning'>[user] tried to hand \the [I] to [src] but \he didn't want it.</span>")
else
user << "<span class='warning'>[src]'s hands are full.</span>"
user << "<span class='warning'>[src]'s hands are full.</span>"
@@ -205,7 +205,7 @@
return 0
if(M.a_intent == INTENT_DISARM) //Always drop item in hand, if no item, get stunned instead.
if(get_active_held_item() && drop_item())
if(dropItemToGround(get_active_held_item()))
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
visible_message("<span class='danger'>[M] disarmed [src]!</span>", \
"<span class='userdanger'>[M] disarmed [src]!</span>")
@@ -259,7 +259,7 @@
damage_clothes(damage, BRUTE, "melee", affecting.body_zone)
if(M.a_intent == INTENT_DISARM) //Always drop item in hand, if no item, get stun instead.
if(get_active_held_item() && drop_item())
if(dropItemToGround(get_active_held_item()))
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
visible_message("<span class='danger'>[M] disarmed [src]!</span>", \
"<span class='userdanger'>[M] disarmed [src]!</span>")
@@ -657,7 +657,7 @@
insert_into_backpack()
//---------FASHION
if(istype(TARGET, /obj/item/clothing))
drop_item()
temporarilyRemoveItemFromInventory(TARGET, TRUE)
dressup(TARGET)
update_hands = 1
if(MYPDA in src.loc || MYID in src.loc)
@@ -1373,7 +1373,7 @@
target.stop_pulling()
else
I = target.get_active_held_item()
if(target.drop_item())
if(target.dropItemToGround(I))
target.visible_message("<span class='danger'>[user] has disarmed [target]!</span>", \
"<span class='userdanger'>[user] has disarmed [target]!</span>", null, COMBAT_MESSAGE_RANGE)
else
@@ -74,11 +74,9 @@
add_logs(M, src, "pushed")
visible_message("<span class='danger'>[M] has pushed down [src]!</span>", \
"<span class='userdanger'>[M] has pushed down [src]!</span>", null, COMBAT_MESSAGE_RANGE)
else
if(drop_item())
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \
"<span class='userdanger'>[M] has disarmed [src]!</span>", null, COMBAT_MESSAGE_RANGE)
else if(dropItemToGround(get_active_held_item()))
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", "<span class='userdanger'>[M] has disarmed [src]!</span>", null, COMBAT_MESSAGE_RANGE)
/mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M)
if(..()) //if harm or disarm intent.
@@ -119,12 +117,10 @@
"<span class='userdanger'>[M] has tackled down [name]!</span>", null, COMBAT_MESSAGE_RANGE)
else
I = get_active_held_item()
if(drop_item())
visible_message("<span class='danger'>[M] has disarmed [name]!</span>", \
"<span class='userdanger'>[M] has disarmed [name]!</span>", null, COMBAT_MESSAGE_RANGE)
if(dropItemToGround(I))
visible_message("<span class='danger'>[M] has disarmed [name]!</span>", "<span class='userdanger'>[M] has disarmed [name]!</span>", null, COMBAT_MESSAGE_RANGE)
else
I = null//did not manage to actually disarm the item, gross but no time to refactor
I = null
add_logs(M, src, "disarmed", "[I ? " removing \the [I]" : ""]")
updatehealth()
@@ -427,9 +427,8 @@
else if(cell)
to_chat(user, "<span class='warning'>There is a power cell already installed!</span>")
else
if(!user.drop_item())
if(!user.transferItemToLoc(W, src))
return
W.loc = src
cell = W
to_chat(user, "<span class='notice'>You insert the power cell.</span>")
update_icons()
@@ -518,7 +517,7 @@
else if(U.locked)
to_chat(user, "<span class='warning'>The upgrade is locked and cannot be used yet!</span>")
else
if(!user.drop_item())
if(!user.temporarilyRemoveItemFromInventory(U))
return
if(U.action(src))
to_chat(user, "<span class='notice'>You apply the upgrade to [src].</span>")
@@ -529,12 +528,13 @@
upgrades += U
else
to_chat(user, "<span class='danger'>Upgrade error.</span>")
U.forceMove(drop_location())
else if(istype(W, /obj/item/device/toner))
if(toner >= tonermax)
to_chat(user, "<span class='warning'>The toner level of [src] is at its highest level possible!</span>")
else
if(!user.drop_item())
if(!user.temporarilyRemoveItemFromInventory(W))
return
toner = tonermax
qdel(W)
+383 -386
View File
@@ -1,386 +1,383 @@
/mob/living/silicon
gender = NEUTER
voice_name = "synthesized voice"
has_unlimited_silicon_privilege = 1
verb_say = "states"
verb_ask = "queries"
verb_exclaim = "declares"
verb_yell = "alarms"
initial_language_holder = /datum/language_holder/synthetic
see_in_dark = 8
bubble_icon = "machine"
weather_immunities = list("ash")
possible_a_intents = list(INTENT_HELP, INTENT_HARM)
var/syndicate = 0
var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS
var/last_lawchange_announce = 0
var/list/alarms_to_show = list()
var/list/alarms_to_clear = list()
var/designation = ""
var/radiomod = "" //Radio character used before state laws/arrivals announce to allow department transmissions, default, or none at all.
var/obj/item/device/camera/siliconcam/aicamera = null //photography
hud_possible = list(ANTAG_HUD, DIAG_STAT_HUD, DIAG_HUD, DIAG_TRACK_HUD)
var/obj/item/device/radio/borg/radio = null //AIs dont use this but this is at the silicon level to advoid copypasta in say()
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)
var/lawcheck[1]
var/ioncheck[1]
var/devillawcheck[5]
var/med_hud = DATA_HUD_MEDICAL_ADVANCED //Determines the med hud to use
var/sec_hud = DATA_HUD_SECURITY_ADVANCED //Determines the sec hud to use
var/d_hud = DATA_HUD_DIAGNOSTIC //There is only one kind of diag hud
var/law_change_counter = 0
var/obj/machinery/camera/builtInCamera = null
var/updating = FALSE //portable camera camerachunk update
/mob/living/silicon/Initialize()
. = ..()
GLOB.silicon_mobs += src
var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC]
diag_hud.add_to_hud(src)
diag_hud_set_status()
diag_hud_set_health()
/mob/living/silicon/med_hud_set_health()
return //we use a different hud
/mob/living/silicon/med_hud_set_status()
return //we use a different hud
/mob/living/silicon/Destroy()
radio = null
aicamera = null
QDEL_NULL(builtInCamera)
GLOB.silicon_mobs -= src
return ..()
/mob/living/silicon/contents_explosion(severity, target)
return
/mob/living/silicon/proc/cancelAlarm()
return
/mob/living/silicon/proc/triggerAlarm()
return
/mob/living/silicon/proc/queueAlarm(message, type, incoming = 1)
var/in_cooldown = (alarms_to_show.len > 0 || alarms_to_clear.len > 0)
if(incoming)
alarms_to_show += message
alarm_types_show[type] += 1
else
alarms_to_clear += message
alarm_types_clear[type] += 1
if(!in_cooldown)
spawn(3 * 10) // 3 seconds
if(alarms_to_show.len < 5)
for(var/msg in alarms_to_show)
to_chat(src, msg)
else if(alarms_to_show.len)
var/msg = "--- "
if(alarm_types_show["Burglar"])
msg += "BURGLAR: [alarm_types_show["Burglar"]] alarms detected. - "
if(alarm_types_show["Motion"])
msg += "MOTION: [alarm_types_show["Motion"]] alarms detected. - "
if(alarm_types_show["Fire"])
msg += "FIRE: [alarm_types_show["Fire"]] alarms detected. - "
if(alarm_types_show["Atmosphere"])
msg += "ATMOSPHERE: [alarm_types_show["Atmosphere"]] alarms detected. - "
if(alarm_types_show["Power"])
msg += "POWER: [alarm_types_show["Power"]] alarms detected. - "
if(alarm_types_show["Camera"])
msg += "CAMERA: [alarm_types_show["Camera"]] alarms detected. - "
msg += "<A href=?src=\ref[src];showalerts=1'>\[Show Alerts\]</a>"
to_chat(src, msg)
if(alarms_to_clear.len < 3)
for(var/msg in alarms_to_clear)
to_chat(src, msg)
else if(alarms_to_clear.len)
var/msg = "--- "
if(alarm_types_clear["Motion"])
msg += "MOTION: [alarm_types_clear["Motion"]] alarms cleared. - "
if(alarm_types_clear["Fire"])
msg += "FIRE: [alarm_types_clear["Fire"]] alarms cleared. - "
if(alarm_types_clear["Atmosphere"])
msg += "ATMOSPHERE: [alarm_types_clear["Atmosphere"]] alarms cleared. - "
if(alarm_types_clear["Power"])
msg += "POWER: [alarm_types_clear["Power"]] alarms cleared. - "
if(alarm_types_show["Camera"])
msg += "CAMERA: [alarm_types_clear["Camera"]] alarms cleared. - "
msg += "<A href=?src=\ref[src];showalerts=1'>\[Show Alerts\]</a>"
to_chat(src, msg)
alarms_to_show = list()
alarms_to_clear = list()
for(var/key in alarm_types_show)
alarm_types_show[key] = 0
for(var/key in alarm_types_clear)
alarm_types_clear[key] = 0
/mob/living/silicon/drop_item()
return
/mob/living/silicon/can_inject(mob/user, error_msg)
if(error_msg)
to_chat(user, "<span class='alert'>Their outer shell is too tough.</span>")
return 0
/mob/living/silicon/IsAdvancedToolUser()
return 1
/proc/islinked(mob/living/silicon/robot/bot, mob/living/silicon/ai/ai)
if(!istype(bot) || !istype(ai))
return 0
if (bot.connected_ai == ai)
return 1
return 0
/mob/living/silicon/Topic(href, href_list)
if (href_list["lawc"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
var/L = text2num(href_list["lawc"])
switch(lawcheck[L+1])
if ("Yes")
lawcheck[L+1] = "No"
if ("No")
lawcheck[L+1] = "Yes"
checklaws()
if (href_list["lawi"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
var/L = text2num(href_list["lawi"])
switch(ioncheck[L])
if ("Yes")
ioncheck[L] = "No"
if ("No")
ioncheck[L] = "Yes"
checklaws()
if (href_list["lawdevil"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
var/L = text2num(href_list["lawdevil"])
switch(devillawcheck[L])
if ("Yes")
devillawcheck[L] = "No"
if ("No")
devillawcheck[L] = "Yes"
checklaws()
if (href_list["laws"]) // With how my law selection code works, I changed statelaws from a verb to a proc, and call it through my law selection panel. --NeoFite
statelaws()
return
/mob/living/silicon/proc/statelaws(force = 0)
//"radiomod" is inserted before a hardcoded message to change if and how it is handled by an internal radio.
src.say("[radiomod] Current Active Laws:")
//src.laws_sanity_check()
//src.laws.show_laws(world)
var/number = 1
sleep(10)
if (src.laws.devillaws && src.laws.devillaws.len)
for(var/index = 1, index <= src.laws.devillaws.len, index++)
if (force || src.devillawcheck[index] == "Yes")
src.say("[radiomod] 666. [src.laws.devillaws[index]]")
sleep(10)
if (src.laws.zeroth)
if (force || src.lawcheck[1] == "Yes")
src.say("[radiomod] 0. [src.laws.zeroth]")
sleep(10)
for (var/index = 1, index <= src.laws.ion.len, index++)
var/law = src.laws.ion[index]
var/num = ionnum()
if (length(law) > 0)
if (force || src.ioncheck[index] == "Yes")
src.say("[radiomod] [num]. [law]")
sleep(10)
for (var/index = 1, index <= src.laws.inherent.len, index++)
var/law = src.laws.inherent[index]
if (length(law) > 0)
if (force || src.lawcheck[index+1] == "Yes")
src.say("[radiomod] [number]. [law]")
number++
sleep(10)
for (var/index = 1, index <= src.laws.supplied.len, index++)
var/law = src.laws.supplied[index]
if (length(law) > 0)
if(src.lawcheck.len >= number+1)
if (force || src.lawcheck[number+1] == "Yes")
src.say("[radiomod] [number]. [law]")
number++
sleep(10)
/mob/living/silicon/proc/checklaws() //Gives you a link-driven interface for deciding what laws the statelaws() proc will share with the crew. --NeoFite
var/list = "<b>Which laws do you want to include when stating them for the crew?</b><br><br>"
if (src.laws.devillaws && src.laws.devillaws.len)
for(var/index = 1, index <= src.laws.devillaws.len, index++)
if (!src.devillawcheck[index])
src.devillawcheck[index] = "No"
list += {"<A href='byond://?src=\ref[src];lawdevil=[index]'>[src.devillawcheck[index]] 666:</A> [src.laws.devillaws[index]]<BR>"}
if (src.laws.zeroth)
if (!src.lawcheck[1])
src.lawcheck[1] = "No" //Given Law 0's usual nature, it defaults to NOT getting reported. --NeoFite
list += {"<A href='byond://?src=\ref[src];lawc=0'>[src.lawcheck[1]] 0:</A> [src.laws.zeroth]<BR>"}
for (var/index = 1, index <= src.laws.ion.len, index++)
var/law = src.laws.ion[index]
if (length(law) > 0)
if (!src.ioncheck[index])
src.ioncheck[index] = "Yes"
list += {"<A href='byond://?src=\ref[src];lawi=[index]'>[src.ioncheck[index]] [ionnum()]:</A> [law]<BR>"}
src.ioncheck.len += 1
var/number = 1
for (var/index = 1, index <= src.laws.inherent.len, index++)
var/law = src.laws.inherent[index]
if (length(law) > 0)
src.lawcheck.len += 1
if (!src.lawcheck[number+1])
src.lawcheck[number+1] = "Yes"
list += {"<A href='byond://?src=\ref[src];lawc=[number]'>[src.lawcheck[number+1]] [number]:</A> [law]<BR>"}
number++
for (var/index = 1, index <= src.laws.supplied.len, index++)
var/law = src.laws.supplied[index]
if (length(law) > 0)
src.lawcheck.len += 1
if (!src.lawcheck[number+1])
src.lawcheck[number+1] = "Yes"
list += {"<A href='byond://?src=\ref[src];lawc=[number]'>[src.lawcheck[number+1]] [number]:</A> [law]<BR>"}
number++
list += {"<br><br><A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
usr << browse(list, "window=laws")
/mob/living/silicon/proc/set_autosay() //For allowing the AI and borgs to set the radio behavior of auto announcements (state laws, arrivals).
if(!radio)
to_chat(src, "Radio not detected.")
return
//Ask the user to pick a channel from what it has available.
var/Autochan = input("Select a channel:") as null|anything in list("Default","None") + radio.channels
if(!Autochan)
return
if(Autochan == "Default") //Autospeak on whatever frequency to which the radio is set, usually Common.
radiomod = ";"
Autochan += " ([radio.frequency])"
else if(Autochan == "None") //Prevents use of the radio for automatic annoucements.
radiomod = ""
else //For department channels, if any, given by the internal radio.
for(var/key in GLOB.department_radio_keys)
if(GLOB.department_radio_keys[key] == Autochan)
radiomod = ":" + key
break
to_chat(src, "<span class='notice'>Automatic announcements [Autochan == "None" ? "will not use the radio." : "set to [Autochan]."]</span>")
/mob/living/silicon/put_in_hand_check() // This check is for borgs being able to receive items, not put them in others' hands.
return 0
// The src mob is trying to place an item on someone
// But the src mob is a silicon!! Disable.
/mob/living/silicon/stripPanelEquip(obj/item/what, mob/who, slot)
return 0
/mob/living/silicon/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) //Secbots won't hunt silicon units
return -10
/mob/living/silicon/proc/remove_med_sec_hud()
var/datum/atom_hud/secsensor = GLOB.huds[sec_hud]
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
var/datum/atom_hud/diagsensor = GLOB.huds[d_hud]
secsensor.remove_hud_from(src)
medsensor.remove_hud_from(src)
diagsensor.remove_hud_from(src)
/mob/living/silicon/proc/add_sec_hud()
var/datum/atom_hud/secsensor = GLOB.huds[sec_hud]
secsensor.add_hud_to(src)
/mob/living/silicon/proc/add_med_hud()
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
medsensor.add_hud_to(src)
/mob/living/silicon/proc/add_diag_hud()
var/datum/atom_hud/diagsensor = GLOB.huds[d_hud]
diagsensor.add_hud_to(src)
/mob/living/silicon/proc/sensor_mode()
if(incapacitated())
return
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Diagnostic","Disable")
remove_med_sec_hud()
switch(sensor_type)
if ("Security")
add_sec_hud()
to_chat(src, "<span class='notice'>Security records overlay enabled.</span>")
if ("Medical")
add_med_hud()
to_chat(src, "<span class='notice'>Life signs monitor overlay enabled.</span>")
if ("Diagnostic")
add_diag_hud()
to_chat(src, "<span class='notice'>Robotics diagnostic overlay enabled.</span>")
if ("Disable")
to_chat(src, "Sensor augmentations disabled.")
/mob/living/silicon/proc/GetPhoto()
if (aicamera)
return aicamera.selectpicture(aicamera)
/mob/living/silicon/update_transform()
var/matrix/ntransform = matrix(transform) //aka transform.Copy()
var/changed = 0
if(resize != RESIZE_DEFAULT_SIZE)
changed++
ntransform.Scale(resize)
resize = RESIZE_DEFAULT_SIZE
if(changed)
animate(src, transform = ntransform, time = 2,easing = EASE_IN|EASE_OUT)
return ..()
/mob/living/silicon/is_literate()
return 1
/mob/living/silicon
gender = NEUTER
voice_name = "synthesized voice"
has_unlimited_silicon_privilege = 1
verb_say = "states"
verb_ask = "queries"
verb_exclaim = "declares"
verb_yell = "alarms"
initial_language_holder = /datum/language_holder/synthetic
see_in_dark = 8
bubble_icon = "machine"
weather_immunities = list("ash")
possible_a_intents = list(INTENT_HELP, INTENT_HARM)
var/syndicate = 0
var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS
var/last_lawchange_announce = 0
var/list/alarms_to_show = list()
var/list/alarms_to_clear = list()
var/designation = ""
var/radiomod = "" //Radio character used before state laws/arrivals announce to allow department transmissions, default, or none at all.
var/obj/item/device/camera/siliconcam/aicamera = null //photography
hud_possible = list(ANTAG_HUD, DIAG_STAT_HUD, DIAG_HUD, DIAG_TRACK_HUD)
var/obj/item/device/radio/borg/radio = null //AIs dont use this but this is at the silicon level to advoid copypasta in say()
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)
var/lawcheck[1]
var/ioncheck[1]
var/devillawcheck[5]
var/med_hud = DATA_HUD_MEDICAL_ADVANCED //Determines the med hud to use
var/sec_hud = DATA_HUD_SECURITY_ADVANCED //Determines the sec hud to use
var/d_hud = DATA_HUD_DIAGNOSTIC //There is only one kind of diag hud
var/law_change_counter = 0
var/obj/machinery/camera/builtInCamera = null
var/updating = FALSE //portable camera camerachunk update
/mob/living/silicon/Initialize()
. = ..()
GLOB.silicon_mobs += src
var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC]
diag_hud.add_to_hud(src)
diag_hud_set_status()
diag_hud_set_health()
/mob/living/silicon/med_hud_set_health()
return //we use a different hud
/mob/living/silicon/med_hud_set_status()
return //we use a different hud
/mob/living/silicon/Destroy()
radio = null
aicamera = null
QDEL_NULL(builtInCamera)
GLOB.silicon_mobs -= src
return ..()
/mob/living/silicon/contents_explosion(severity, target)
return
/mob/living/silicon/proc/cancelAlarm()
return
/mob/living/silicon/proc/triggerAlarm()
return
/mob/living/silicon/proc/queueAlarm(message, type, incoming = 1)
var/in_cooldown = (alarms_to_show.len > 0 || alarms_to_clear.len > 0)
if(incoming)
alarms_to_show += message
alarm_types_show[type] += 1
else
alarms_to_clear += message
alarm_types_clear[type] += 1
if(!in_cooldown)
spawn(3 * 10) // 3 seconds
if(alarms_to_show.len < 5)
for(var/msg in alarms_to_show)
to_chat(src, msg)
else if(alarms_to_show.len)
var/msg = "--- "
if(alarm_types_show["Burglar"])
msg += "BURGLAR: [alarm_types_show["Burglar"]] alarms detected. - "
if(alarm_types_show["Motion"])
msg += "MOTION: [alarm_types_show["Motion"]] alarms detected. - "
if(alarm_types_show["Fire"])
msg += "FIRE: [alarm_types_show["Fire"]] alarms detected. - "
if(alarm_types_show["Atmosphere"])
msg += "ATMOSPHERE: [alarm_types_show["Atmosphere"]] alarms detected. - "
if(alarm_types_show["Power"])
msg += "POWER: [alarm_types_show["Power"]] alarms detected. - "
if(alarm_types_show["Camera"])
msg += "CAMERA: [alarm_types_show["Camera"]] alarms detected. - "
msg += "<A href=?src=\ref[src];showalerts=1'>\[Show Alerts\]</a>"
to_chat(src, msg)
if(alarms_to_clear.len < 3)
for(var/msg in alarms_to_clear)
to_chat(src, msg)
else if(alarms_to_clear.len)
var/msg = "--- "
if(alarm_types_clear["Motion"])
msg += "MOTION: [alarm_types_clear["Motion"]] alarms cleared. - "
if(alarm_types_clear["Fire"])
msg += "FIRE: [alarm_types_clear["Fire"]] alarms cleared. - "
if(alarm_types_clear["Atmosphere"])
msg += "ATMOSPHERE: [alarm_types_clear["Atmosphere"]] alarms cleared. - "
if(alarm_types_clear["Power"])
msg += "POWER: [alarm_types_clear["Power"]] alarms cleared. - "
if(alarm_types_show["Camera"])
msg += "CAMERA: [alarm_types_clear["Camera"]] alarms cleared. - "
msg += "<A href=?src=\ref[src];showalerts=1'>\[Show Alerts\]</a>"
to_chat(src, msg)
alarms_to_show = list()
alarms_to_clear = list()
for(var/key in alarm_types_show)
alarm_types_show[key] = 0
for(var/key in alarm_types_clear)
alarm_types_clear[key] = 0
/mob/living/silicon/can_inject(mob/user, error_msg)
if(error_msg)
to_chat(user, "<span class='alert'>Their outer shell is too tough.</span>")
return 0
/mob/living/silicon/IsAdvancedToolUser()
return 1
/proc/islinked(mob/living/silicon/robot/bot, mob/living/silicon/ai/ai)
if(!istype(bot) || !istype(ai))
return 0
if (bot.connected_ai == ai)
return 1
return 0
/mob/living/silicon/Topic(href, href_list)
if (href_list["lawc"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
var/L = text2num(href_list["lawc"])
switch(lawcheck[L+1])
if ("Yes")
lawcheck[L+1] = "No"
if ("No")
lawcheck[L+1] = "Yes"
checklaws()
if (href_list["lawi"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
var/L = text2num(href_list["lawi"])
switch(ioncheck[L])
if ("Yes")
ioncheck[L] = "No"
if ("No")
ioncheck[L] = "Yes"
checklaws()
if (href_list["lawdevil"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
var/L = text2num(href_list["lawdevil"])
switch(devillawcheck[L])
if ("Yes")
devillawcheck[L] = "No"
if ("No")
devillawcheck[L] = "Yes"
checklaws()
if (href_list["laws"]) // With how my law selection code works, I changed statelaws from a verb to a proc, and call it through my law selection panel. --NeoFite
statelaws()
return
/mob/living/silicon/proc/statelaws(force = 0)
//"radiomod" is inserted before a hardcoded message to change if and how it is handled by an internal radio.
src.say("[radiomod] Current Active Laws:")
//src.laws_sanity_check()
//src.laws.show_laws(world)
var/number = 1
sleep(10)
if (src.laws.devillaws && src.laws.devillaws.len)
for(var/index = 1, index <= src.laws.devillaws.len, index++)
if (force || src.devillawcheck[index] == "Yes")
src.say("[radiomod] 666. [src.laws.devillaws[index]]")
sleep(10)
if (src.laws.zeroth)
if (force || src.lawcheck[1] == "Yes")
src.say("[radiomod] 0. [src.laws.zeroth]")
sleep(10)
for (var/index = 1, index <= src.laws.ion.len, index++)
var/law = src.laws.ion[index]
var/num = ionnum()
if (length(law) > 0)
if (force || src.ioncheck[index] == "Yes")
src.say("[radiomod] [num]. [law]")
sleep(10)
for (var/index = 1, index <= src.laws.inherent.len, index++)
var/law = src.laws.inherent[index]
if (length(law) > 0)
if (force || src.lawcheck[index+1] == "Yes")
src.say("[radiomod] [number]. [law]")
number++
sleep(10)
for (var/index = 1, index <= src.laws.supplied.len, index++)
var/law = src.laws.supplied[index]
if (length(law) > 0)
if(src.lawcheck.len >= number+1)
if (force || src.lawcheck[number+1] == "Yes")
src.say("[radiomod] [number]. [law]")
number++
sleep(10)
/mob/living/silicon/proc/checklaws() //Gives you a link-driven interface for deciding what laws the statelaws() proc will share with the crew. --NeoFite
var/list = "<b>Which laws do you want to include when stating them for the crew?</b><br><br>"
if (src.laws.devillaws && src.laws.devillaws.len)
for(var/index = 1, index <= src.laws.devillaws.len, index++)
if (!src.devillawcheck[index])
src.devillawcheck[index] = "No"
list += {"<A href='byond://?src=\ref[src];lawdevil=[index]'>[src.devillawcheck[index]] 666:</A> [src.laws.devillaws[index]]<BR>"}
if (src.laws.zeroth)
if (!src.lawcheck[1])
src.lawcheck[1] = "No" //Given Law 0's usual nature, it defaults to NOT getting reported. --NeoFite
list += {"<A href='byond://?src=\ref[src];lawc=0'>[src.lawcheck[1]] 0:</A> [src.laws.zeroth]<BR>"}
for (var/index = 1, index <= src.laws.ion.len, index++)
var/law = src.laws.ion[index]
if (length(law) > 0)
if (!src.ioncheck[index])
src.ioncheck[index] = "Yes"
list += {"<A href='byond://?src=\ref[src];lawi=[index]'>[src.ioncheck[index]] [ionnum()]:</A> [law]<BR>"}
src.ioncheck.len += 1
var/number = 1
for (var/index = 1, index <= src.laws.inherent.len, index++)
var/law = src.laws.inherent[index]
if (length(law) > 0)
src.lawcheck.len += 1
if (!src.lawcheck[number+1])
src.lawcheck[number+1] = "Yes"
list += {"<A href='byond://?src=\ref[src];lawc=[number]'>[src.lawcheck[number+1]] [number]:</A> [law]<BR>"}
number++
for (var/index = 1, index <= src.laws.supplied.len, index++)
var/law = src.laws.supplied[index]
if (length(law) > 0)
src.lawcheck.len += 1
if (!src.lawcheck[number+1])
src.lawcheck[number+1] = "Yes"
list += {"<A href='byond://?src=\ref[src];lawc=[number]'>[src.lawcheck[number+1]] [number]:</A> [law]<BR>"}
number++
list += {"<br><br><A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
usr << browse(list, "window=laws")
/mob/living/silicon/proc/set_autosay() //For allowing the AI and borgs to set the radio behavior of auto announcements (state laws, arrivals).
if(!radio)
to_chat(src, "Radio not detected.")
return
//Ask the user to pick a channel from what it has available.
var/Autochan = input("Select a channel:") as null|anything in list("Default","None") + radio.channels
if(!Autochan)
return
if(Autochan == "Default") //Autospeak on whatever frequency to which the radio is set, usually Common.
radiomod = ";"
Autochan += " ([radio.frequency])"
else if(Autochan == "None") //Prevents use of the radio for automatic annoucements.
radiomod = ""
else //For department channels, if any, given by the internal radio.
for(var/key in GLOB.department_radio_keys)
if(GLOB.department_radio_keys[key] == Autochan)
radiomod = ":" + key
break
to_chat(src, "<span class='notice'>Automatic announcements [Autochan == "None" ? "will not use the radio." : "set to [Autochan]."]</span>")
/mob/living/silicon/put_in_hand_check() // This check is for borgs being able to receive items, not put them in others' hands.
return 0
// The src mob is trying to place an item on someone
// But the src mob is a silicon!! Disable.
/mob/living/silicon/stripPanelEquip(obj/item/what, mob/who, slot)
return 0
/mob/living/silicon/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) //Secbots won't hunt silicon units
return -10
/mob/living/silicon/proc/remove_med_sec_hud()
var/datum/atom_hud/secsensor = GLOB.huds[sec_hud]
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
var/datum/atom_hud/diagsensor = GLOB.huds[d_hud]
secsensor.remove_hud_from(src)
medsensor.remove_hud_from(src)
diagsensor.remove_hud_from(src)
/mob/living/silicon/proc/add_sec_hud()
var/datum/atom_hud/secsensor = GLOB.huds[sec_hud]
secsensor.add_hud_to(src)
/mob/living/silicon/proc/add_med_hud()
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
medsensor.add_hud_to(src)
/mob/living/silicon/proc/add_diag_hud()
var/datum/atom_hud/diagsensor = GLOB.huds[d_hud]
diagsensor.add_hud_to(src)
/mob/living/silicon/proc/sensor_mode()
if(incapacitated())
return
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Diagnostic","Disable")
remove_med_sec_hud()
switch(sensor_type)
if ("Security")
add_sec_hud()
to_chat(src, "<span class='notice'>Security records overlay enabled.</span>")
if ("Medical")
add_med_hud()
to_chat(src, "<span class='notice'>Life signs monitor overlay enabled.</span>")
if ("Diagnostic")
add_diag_hud()
to_chat(src, "<span class='notice'>Robotics diagnostic overlay enabled.</span>")
if ("Disable")
to_chat(src, "Sensor augmentations disabled.")
/mob/living/silicon/proc/GetPhoto()
if (aicamera)
return aicamera.selectpicture(aicamera)
/mob/living/silicon/update_transform()
var/matrix/ntransform = matrix(transform) //aka transform.Copy()
var/changed = 0
if(resize != RESIZE_DEFAULT_SIZE)
changed++
ntransform.Scale(resize)
resize = RESIZE_DEFAULT_SIZE
if(changed)
animate(src, transform = ntransform, time = 2,easing = EASE_IN|EASE_OUT)
return ..()
/mob/living/silicon/is_literate()
return 1
@@ -846,9 +846,8 @@ Pass a positive integer as an argument to override a bot's default speed.
else if(allow_pai && !key)
if(!locked && !open)
if(card.pai && card.pai.mind)
if(!user.drop_item())
if(!user.transferItemToLoc(card, src))
return
card.forceMove(src)
paicard = card
user.visible_message("[user] inserts [card] into [src]!","<span class='notice'>You insert [card] into [src].</span>")
paicard.pai.mind.transfer_to(src)
@@ -223,10 +223,9 @@
if(!isnull(reagent_glass))
to_chat(user, "<span class='warning'>There is already a beaker loaded!</span>")
return
if(!user.drop_item())
if(!user.transferItemToLoc(W, src))
return
W.loc = src
reagent_glass = W
to_chat(user, "<span class='notice'>You insert [W].</span>")
show_controls(user)
@@ -84,11 +84,9 @@
if(open)
on = FALSE
else if(istype(I, /obj/item/stock_parts/cell) && open && !cell)
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
var/obj/item/stock_parts/cell/C = I
C.loc = src
cell = C
cell = I
visible_message("[user] inserts a cell into [src].",
"<span class='notice'>You insert the new cell into [src].</span>")
else if(istype(I, /obj/item/crowbar) && open && cell)
@@ -174,7 +174,7 @@
usr.visible_message("[usr] pets [src].","<span class='notice'>You rest your hand on [src]'s back for a moment.</span>")
return
if(!usr.drop_item())
if(!usr.temporarilyRemoveItemFromInventory(item_to_add))
to_chat(usr, "<span class='warning'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s back!</span>")
return
@@ -189,7 +189,7 @@
if(!allowed)
to_chat(usr, "<span class='warning'>You set [item_to_add] on [src]'s back, but it falls off!</span>")
item_to_add.loc = loc
item_to_add.forceMove(drop_location())
if(prob(25))
step_rand(item_to_add)
for(var/i in list(1,2,4,8,4,8,4,dir))
@@ -197,8 +197,7 @@
sleep(1)
return
usr.drop_item()
item_to_add.loc = src
item_to_add.forceMove(src)
src.inventory_back = item_to_add
update_corgi_fluff()
regenerate_icons()
@@ -226,7 +225,7 @@
user.visible_message("[user] pets [src].","<span class='notice'>You rest your hand on [src]'s head for a moment.</span>")
return
if(user && !user.drop_item())
if(user && !user.temporarilyRemoveItemFromInventory(item_to_add))
to_chat(user, "<span class='warning'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!</span>")
return 0
@@ -243,13 +242,13 @@
user.visible_message("[user] puts [item_to_add] on [real_name]'s head. [src] looks at [user] and barks once.",
"<span class='notice'>You put [item_to_add] on [real_name]'s head. [src] gives you a peculiar look, then wags [p_their()] tail once and barks.</span>",
"<span class='italics'>You hear a friendly-sounding bark.</span>")
item_to_add.loc = src
item_to_add.forceMove(src)
src.inventory_head = item_to_add
update_corgi_fluff()
regenerate_icons()
else
to_chat(user, "<span class='warning'>You set [item_to_add] on [src]'s head, but it falls off!</span>")
item_to_add.loc = loc
item_to_add.forceMove(drop_location())
if(prob(25))
step_rand(item_to_add)
for(var/i in list(1,2,4,8,4,8,4,dir))
@@ -275,7 +275,6 @@
if(!stat && eggsleft < 8)
var/feedmsg = "[user] feeds [O] to [name]! [pick(feedMessages)]"
user.visible_message(feedmsg)
user.drop_item()
qdel(O)
eggsleft += rand(1, 4)
else
@@ -246,8 +246,8 @@
var/obj/item/device/radio/headset/headset_to_add = item_to_add
usr.drop_item()
headset_to_add.loc = src
if(!usr.transferItemToLoc(headset_to_add, src))
return
src.ears = headset_to_add
to_chat(usr, "<span class='notice'>You fit the headset onto [src].</span>")
@@ -340,7 +340,6 @@
drop_held_item(0)
else if(istype(O, /obj/item/reagent_containers/food/snacks/cracker)) //Poly wants a cracker.
qdel(O)
user.drop_item()
if(health < maxHealth)
adjustBruteLoss(-10)
speak_chance *= 1.27 // 20 crackers to go from 1% to 100%
+5 -4
View File
@@ -53,10 +53,11 @@
/client/Northwest()
if(!usr.get_active_held_item())
var/obj/item/I = usr.get_active_held_item()
if(!I)
to_chat(usr, "<span class='warning'>You have nothing to drop in your hand!</span>")
return
usr.drop_item()
usr.dropItemToGround(I)
//This gets called when you press the delete button.
/client/verb/delete_key_pressed()
@@ -85,8 +86,8 @@
/client/verb/drop_item()
set hidden = 1
if(!iscyborg(mob))
mob.drop_item_v()
if(!iscyborg(mob) && mob.stat == CONSCIOUS)
mob.dropItemToGround(mob.get_active_held_item())
return