mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 15:45:25 +01:00
AI/Cyborg HUD fixes, lets Vox's pick name when spawning, fixes Beepsky's/ED-209's ID'ing issue
This commit is contained in:
@@ -1618,9 +1618,6 @@
|
||||
var/obj/pageobj = B.contents[page]
|
||||
data += "<A href='?src=\ref[src];AdminFaxViewPage=[page];paper_bundle=\ref[B]'>Page [page] - [pageobj.name]</A><BR>"
|
||||
|
||||
world << data
|
||||
world << "Sent by: [usr]"
|
||||
|
||||
usr << browse(data, "window=[B.name]")
|
||||
else
|
||||
usr << "\red The faxed item is not viewable. This is probably a bug, and should be reported on the tracker: [fax.type]"
|
||||
|
||||
@@ -28,24 +28,10 @@
|
||||
darkness_view = 8
|
||||
|
||||
/obj/item/clothing/glasses/hud/health/process_hud(var/mob/M)
|
||||
if(!M) return
|
||||
if(!M.client) return
|
||||
var/client/C = M.client
|
||||
for(var/mob/living/carbon/human/patient in view(get_turf(M)))
|
||||
if(M.see_invisible < patient.invisibility)
|
||||
continue
|
||||
C.images += patient.hud_list[HEALTH_HUD]
|
||||
C.images += patient.hud_list[STATUS_HUD]
|
||||
process_med_hud(M,1)
|
||||
|
||||
/obj/item/clothing/glasses/hud/health_advanced/process_hud(var/mob/M)
|
||||
if(!M) return
|
||||
if(!M.client) return
|
||||
var/client/C = M.client
|
||||
for(var/mob/living/carbon/human/patient in view(get_turf(M)))
|
||||
if(M.see_invisible < patient.invisibility)
|
||||
continue
|
||||
C.images += patient.hud_list[HEALTH_HUD]
|
||||
C.images += patient.hud_list[STATUS_HUD]
|
||||
process_sec_hud(M,1)
|
||||
|
||||
|
||||
/obj/item/clothing/glasses/hud/security
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
if (M.internals)
|
||||
M.internals.icon_state = "internal1"
|
||||
|
||||
M.generate_name()
|
||||
//M.generate_name()
|
||||
|
||||
if( M.species.name=="Tajaran" || M.species.name=="Unathi" )
|
||||
if(M.mind.assigned_role == "Cyborg" || M.mind.assigned_role == "Clown")
|
||||
|
||||
@@ -474,30 +474,15 @@
|
||||
return istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(H.glasses, /obj/item/clothing/glasses/hud/health_advanced)
|
||||
else
|
||||
return 0
|
||||
else if(istype(M, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = M
|
||||
else if(istype(M, /mob/living/silicon))
|
||||
var/mob/living/silicon/R = M
|
||||
switch(hudtype)
|
||||
if("security")
|
||||
for(var/obj/I in R.contents)
|
||||
if(istype(I, /obj/item/borg/sight/hud/sec))
|
||||
return 1
|
||||
if(R.sensor_mode == 1)
|
||||
return 1
|
||||
if("medical")
|
||||
for(var/obj/I in R.contents)
|
||||
if(istype(I, /obj/item/borg/sight/hud/med))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
else if(istype(M, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/A = M
|
||||
switch(hudtype)
|
||||
if("security")
|
||||
for(var/obj/I in A.contents)
|
||||
if(istype(I, /obj/item/borg/sight/hud/sec))
|
||||
return 1
|
||||
if("medical")
|
||||
for(var/obj/I in A.contents)
|
||||
if(istype(I, /obj/item/borg/sight/hud/med))
|
||||
return 1
|
||||
if(R.sensor_mode == 2)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
else
|
||||
|
||||
@@ -1555,7 +1555,7 @@
|
||||
|
||||
//Check for ID
|
||||
var/obj/item/weapon/card/id/idcard = get_idcard()
|
||||
if(judgebot.idcheck && !idcard && name=="Unknown")
|
||||
if(judgebot.idcheck && !idcard)
|
||||
threatcount += 4
|
||||
|
||||
//Check for weapons
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
/mob/living/carbon/slime/proc/regular_hud_updates()
|
||||
/mob/living/carbon/slime/regular_hud_updates()
|
||||
return
|
||||
@@ -830,23 +830,10 @@ var/list/ai_list = list()
|
||||
lightNearbyCamera()
|
||||
|
||||
/mob/living/silicon/ai/proc/control_hud()
|
||||
set name = "Toggle Sensors"
|
||||
set desc = "Toggles your sensors to display security records, medical records or nothing."
|
||||
set name = "Set Sensor Augmentation"
|
||||
set desc = "Augment visual feed with internal sensor overlays."
|
||||
set category = "AI Commands"
|
||||
|
||||
if(stat != 0)
|
||||
return
|
||||
|
||||
var/hud = input("Please select a sensor module!", "Toggle Sensors", "None", null) in list("None","Security","Medical")
|
||||
for(var/obj/item/borg/sight/hud/H in contents)
|
||||
del(H)
|
||||
switch(hud)
|
||||
if("Security")
|
||||
sechud = new/obj/item/borg/sight/hud/sec(src)
|
||||
if("Medical")
|
||||
healthhud = new/obj/item/borg/sight/hud/med(src)
|
||||
else
|
||||
return
|
||||
toggle_sensor_mode()
|
||||
|
||||
// Handled camera lighting, when toggled.
|
||||
// It will get the nearest camera from the eyeobj, lighting it.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/mob/living/silicon/ai/Life()
|
||||
if(client)
|
||||
handle_regular_hud_updates()
|
||||
|
||||
if (src.stat == 2)
|
||||
return
|
||||
else //I'm not removing that shitton of tabs, unneeded as they are. -- Urist
|
||||
@@ -176,6 +173,13 @@
|
||||
sleep(50)
|
||||
theAPC = null
|
||||
|
||||
regular_hud_updates()
|
||||
switch(src.sensor_mode)
|
||||
if (SEC_HUD)
|
||||
process_sec_hud(src,1,src.eyeobj)
|
||||
if (MED_HUD)
|
||||
process_med_hud(src,1,src.eyeobj)
|
||||
|
||||
/mob/living/silicon/ai/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
health = 100
|
||||
@@ -184,12 +188,4 @@
|
||||
if(fire_res_on_core)
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getBruteLoss()
|
||||
else
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
|
||||
|
||||
/mob/living/silicon/ai/proc/handle_regular_hud_updates()
|
||||
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)
|
||||
|
||||
var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src)
|
||||
if(hud && hud.hud) hud.hud.process_hud(src)
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
|
||||
@@ -1,110 +0,0 @@
|
||||
/mob/living/silicon/pai/proc/regular_hud_updates()
|
||||
if(client)
|
||||
for(var/image/hud in client.images)
|
||||
if(copytext(hud.icon_state,1,4) == "hud")
|
||||
client.images -= hud
|
||||
|
||||
/mob/living/silicon/pai/proc/securityHUD()
|
||||
if(client)
|
||||
var/image/holder
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for(var/mob/living/carbon/human/perp in view(T))
|
||||
if(src.see_invisible < perp.invisibility)
|
||||
continue
|
||||
var/perpname = "wot"
|
||||
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(perp:wear_id:GetJobName())]"
|
||||
client.images += holder
|
||||
else
|
||||
perpname = perp.name
|
||||
holder.icon_state = "hudunknown"
|
||||
client.images += holder
|
||||
else
|
||||
holder.icon_state = "hudunknown"
|
||||
client.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"
|
||||
client.images += holder
|
||||
break
|
||||
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Incarcerated"))
|
||||
holder.icon_state = "hudprisoner"
|
||||
client.images += holder
|
||||
break
|
||||
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Parolled"))
|
||||
holder.icon_state = "hudparolled"
|
||||
client.images += holder
|
||||
break
|
||||
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Released"))
|
||||
holder.icon_state = "hudreleased"
|
||||
client.images += holder
|
||||
break
|
||||
|
||||
/mob/living/silicon/pai/proc/medicalHUD()
|
||||
if(client)
|
||||
var/image/holder
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for(var/mob/living/carbon/human/patient in view(T))
|
||||
if(src.see_invisible < patient.invisibility)
|
||||
continue
|
||||
var/foundVirus = 0
|
||||
|
||||
for (var/ID in patient.virus2)
|
||||
if (ID in virusDB)
|
||||
foundVirus = 1
|
||||
break
|
||||
|
||||
holder = patient.hud_list[HEALTH_HUD]
|
||||
if(patient.stat == 2)
|
||||
holder.icon_state = "hudhealth-100"
|
||||
client.images += holder
|
||||
else
|
||||
holder.icon_state = "hud[RoundHealth(patient.health)]"
|
||||
client.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 if(patient.has_brain_worms())
|
||||
var/mob/living/simple_animal/borer/B = patient.has_brain_worms()
|
||||
if(B.controlling)
|
||||
holder.icon_state = "hudbrainworm"
|
||||
else
|
||||
holder.icon_state = "hudhealthy"
|
||||
else
|
||||
holder.icon_state = "hudhealthy"
|
||||
client.images += holder
|
||||
|
||||
/mob/living/silicon/pai/proc/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(20 to 30)
|
||||
return "health25"
|
||||
if(5 to 15)
|
||||
return "health10"
|
||||
if(1 to 5)
|
||||
return "health1"
|
||||
if(-99 to 0)
|
||||
return "health0"
|
||||
else
|
||||
return "health-100"
|
||||
return "0"
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
regular_hud_updates()
|
||||
if(src.secHUD == 1)
|
||||
src.securityHUD()
|
||||
process_sec_hud(src, 1)
|
||||
if(src.medHUD == 1)
|
||||
src.medicalHUD()
|
||||
process_med_hud(src, 1)
|
||||
if(silence_time)
|
||||
if(world.timeofday >= silence_time)
|
||||
silence_time = null
|
||||
|
||||
@@ -177,12 +177,17 @@
|
||||
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()
|
||||
|
||||
var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src)
|
||||
if(hud && hud.hud) hud.hud.process_hud(src)
|
||||
if(hud && hud.hud)
|
||||
hud.hud.process_hud(src)
|
||||
else
|
||||
switch(src.sensor_mode)
|
||||
if (SEC_HUD)
|
||||
process_sec_hud(src,1)
|
||||
if (MED_HUD)
|
||||
process_med_hud(src,1)
|
||||
|
||||
if (src.healths)
|
||||
if (src.stat != 2)
|
||||
|
||||
@@ -461,23 +461,10 @@
|
||||
src << "\red You enable [C.name]."
|
||||
|
||||
/mob/living/silicon/robot/verb/control_hud()
|
||||
set name = "Toggle Sensors"
|
||||
set desc = "Toggles your sensors to display security records, medical records or nothing."
|
||||
set name = "Set Sensor Augmentation"
|
||||
set desc = "Augment visual feed with internal sensor overlays."
|
||||
set category = "Robot Commands"
|
||||
|
||||
if(stat != 0)
|
||||
return
|
||||
|
||||
var/hud = input("Please select a sensor module!", "Toggle Sensors", "None", null) in list("None","Security","Medical")
|
||||
for(var/obj/item/borg/sight/hud/H in contents)
|
||||
del(H)
|
||||
switch(hud)
|
||||
if("Security")
|
||||
sechud = new/obj/item/borg/sight/hud/sec(src)
|
||||
if("Medical")
|
||||
healthhud = new/obj/item/borg/sight/hud/med(src)
|
||||
else
|
||||
return
|
||||
toggle_sensor_mode()
|
||||
|
||||
/mob/living/silicon/robot/blob_act()
|
||||
if (stat != 2)
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
var/list/alarm_types_clear = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0, "Camera" = 0)
|
||||
var/designation = ""
|
||||
var/obj/item/device/camera/siliconcam/aiCamera = null //photography
|
||||
|
||||
var/sensor_mode = 0 //Determines the current HUD.
|
||||
#define SEC_HUD 1 //Security HUD mode
|
||||
#define MED_HUD 2 //Medical HUD mode
|
||||
|
||||
/mob/living/silicon/proc/cancelAlarm()
|
||||
return
|
||||
@@ -235,3 +239,16 @@
|
||||
|
||||
/mob/living/silicon/assess_threat() //Secbots won't hunt silicon units
|
||||
return -10
|
||||
|
||||
/mob/living/silicon/proc/toggle_sensor_mode()
|
||||
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","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 ("Disable")
|
||||
sensor_mode = 0
|
||||
src << "Sensor augmentations disabled."
|
||||
|
||||
Reference in New Issue
Block a user