Skip to content

Commit

Permalink
pAI Redux (#22751)
Browse files Browse the repository at this point in the history
* Maybe converts expansion card slots into pai holders

* Update card_slot.dm

* Update card_slot.dm

* Update card_slot.dm

* card

* No aux card slot pAI

* Progress

* Half the way there to ejecting pAIs from PDAs

* Works

* pAI card has a description now

* New message proc

* Old PDAs have backwards compatibility working now, at least

* TGUI start

* .map()

* Update PaiInterface.tsx

* Attempted debugging

* Not causing errors now

* Directives

* That's one page (somewhat) done

* Now for software

* All modules converted

* Buttons

* Semi-working software downloads

* Update software.dm

* Better than whatever that was

* It didn't throw an error this time

* Now it actually works

* Now it fills up space

* Apparently those existed

* I hate the atmos sensor

* Never have I needed such an annoying if statement

* Remote signaller

* Tab highlighting works

* Removes old interface

* I forgot ministation got merged

* Update MiniStation.dmm

* Card interface & cleans up some other stuff

* Diagnostics now measured in GQ rather than arbitrary units

* Maybe lints will stop being angry with this (I hope)

* I thought I fixed all of those

* Arrows
  • Loading branch information
Oblisk234 authored Oct 28, 2024
1 parent 157e1cf commit 4b2a9d3
Show file tree
Hide file tree
Showing 35 changed files with 971 additions and 756 deletions.
2 changes: 1 addition & 1 deletion _maps/RandomRuins/LavaRuins/lavaland_biodome_fishing.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,7 @@
/obj/item/stack/sheet/mineral/bamboo{
amount = 50
},
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/obj/item/reagent_containers/glass/gromitmug,
/turf/open/floor/plasteel/dark,
/area/ruin/powered/fishing/shop)
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/TheDerelict.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@
/area/ruin/space/derelict/bridge/access)
"eC" = (
/obj/structure/table,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/plasteel,
/area/ruin/space/derelict/bridge)
"eD" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/bigderelict1.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2114,7 +2114,7 @@
/obj/structure/closet/crate{
icon_state = "crateopen"
},
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/obj/machinery/light,
/obj/effect/turf_decal/delivery,
/turf/open/floor/plasteel,
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/bus.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
/area/ruin/unpowered/no_grav)
"av" = (
/obj/structure/table,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/plating/asteroid/airless,
/area/ruin/unpowered/no_grav)
"aw" = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"ar" = (
/obj/structure/table/wood,
/obj/effect/decal/cleanable/dirt,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/carpet,
/area/template_noop)
"as" = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
/obj/item/laser_pointer/blue,
/obj/item/lighter/greyscale,
/obj/structure/closet/crate,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/obj/item/clothing/gloves/color/yellow,
/obj/item/clothing/glasses/yogs/eyepatch,
/turf/open/floor/plating,
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomZLevels/VR/syndicate_trainer.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,7 @@
/area/space/nearstation)
"kW" = (
/obj/structure/table,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/indestructible,
/area/awaymission/centcomAway/thunderdome)
"kX" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomZLevels/VR/vrhub.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@
/area/awaymission/vr/syndicate)
"Jl" = (
/obj/structure/table,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/indestructible,
/area/awaymission/vr/syndicate)
"Jz" = (
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/DonutStation/DonutStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -19697,7 +19697,7 @@
/obj/structure/cable{
icon_state = "4-8"
},
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/plasteel,
/area/crew_quarters/dorms)
"iiz" = (
Expand Down Expand Up @@ -31840,7 +31840,7 @@
/area/maintenance/port/fore)
"nlA" = (
/obj/structure/closet/crate,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/plating,
/area/maintenance/aft)
"nlC" = (
Expand Down Expand Up @@ -44878,7 +44878,7 @@
/obj/item/taperecorder{
pixel_x = -3
},
/obj/item/paicard{
/obj/item/computer_hardware/paicard{
pixel_x = 4
},
/obj/effect/turf_decal/stripes/line{
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/GaxStation/GaxStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -10356,7 +10356,7 @@
/obj/machinery/keycard_auth{
pixel_x = 24
},
/obj/item/paicard{
/obj/item/computer_hardware/paicard{
pixel_x = -6;
pixel_y = 4
},
Expand Down Expand Up @@ -28835,7 +28835,7 @@
/area/security/execution/transfer)
"nOj" = (
/obj/structure/table/wood,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/plasteel,
/area/crew_quarters/dorms)
"nOx" = (
Expand Down
10 changes: 5 additions & 5 deletions _maps/map_files/IceMeta/IceMeta.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -15674,7 +15674,7 @@
/area/aisat)
"eFc" = (
/obj/structure/table,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/plasteel,
/area/crew_quarters/locker)
"eFd" = (
Expand Down Expand Up @@ -34307,7 +34307,7 @@
pixel_x = -9;
pixel_y = 7
},
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/wood,
/area/library)
"jZd" = (
Expand Down Expand Up @@ -49329,7 +49329,7 @@
/obj/item/taperecorder{
pixel_x = -3
},
/obj/item/paicard{
/obj/item/computer_hardware/paicard{
pixel_x = 4
},
/obj/machinery/firealarm{
Expand Down Expand Up @@ -56429,7 +56429,7 @@
/area/storage/tools)
"qnr" = (
/obj/structure/table,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/obj/item/folder/white{
pixel_x = 4;
pixel_y = -3
Expand Down Expand Up @@ -80540,7 +80540,7 @@
/obj/item/poster/random_official,
/obj/item/poster/random_official,
/obj/item/poster/random_official,
/obj/item/paicard{
/obj/item/computer_hardware/paicard{
desc = "A real Nanotrasen success, these personal AIs provide all of the companionship of an AI without any law related red-tape.";
name = "Nanotrasen-brand personal AI device exhibit"
},
Expand Down
8 changes: 4 additions & 4 deletions _maps/map_files/ManateeStation/ManateeStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@
/area/maintenance/solars/port/fore)
"afV" = (
/obj/structure/table/wood,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/plasteel,
/area/crew_quarters/dorms)
"agk" = (
Expand Down Expand Up @@ -3115,7 +3115,7 @@
"aBH" = (
/obj/structure/table/glass,
/obj/item/disk/design_disk,
/obj/item/paicard{
/obj/item/computer_hardware/paicard{
pixel_x = 4
},
/turf/open/floor/plasteel/white,
Expand Down Expand Up @@ -3453,7 +3453,7 @@
"aDJ" = (
/obj/structure/table/wood,
/obj/item/storage/pill_bottle/dice,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/obj/effect/turf_decal/siding/wood{
dir = 10
},
Expand Down Expand Up @@ -43147,7 +43147,7 @@
/obj/item/taperecorder{
pixel_x = -3
},
/obj/item/paicard{
/obj/item/computer_hardware/paicard{
pixel_x = 4
},
/obj/effect/turf_decal/stripes/line{
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/MiniStation/MiniStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -12227,7 +12227,7 @@
"dfg" = (
/obj/machinery/atmospherics/pipe/simple/supply/hidden/layer2,
/obj/structure/table/wood,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/plasteel,
/area/crew_quarters/dorms)
"dfZ" = (
Expand Down Expand Up @@ -21899,7 +21899,7 @@
/obj/machinery/keycard_auth{
pixel_x = 24
},
/obj/item/paicard{
/obj/item/computer_hardware/paicard{
pixel_x = -6;
pixel_y = 4
},
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/YogStation/YogStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -8592,7 +8592,7 @@
/area/science/lab)
"bnv" = (
/obj/structure/table/wood,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/plasteel,
/area/crew_quarters/dorms)
"bnx" = (
Expand Down Expand Up @@ -10038,7 +10038,7 @@
/obj/item/taperecorder{
pixel_x = -3
},
/obj/item/paicard{
/obj/item/computer_hardware/paicard{
pixel_x = 4
},
/obj/effect/turf_decal/stripes/line{
Expand Down Expand Up @@ -61616,7 +61616,7 @@
/obj/item/disk/design_disk{
pixel_x = 1
},
/obj/item/paicard{
/obj/item/computer_hardware/paicard{
pixel_x = -8;
pixel_y = -3
},
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/generic/CentCom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
"aff" = (
/obj/structure/table/wood,
/obj/item/pizzabox/vegetable,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/obj/effect/turf_decal/tile/bar,
/obj/effect/turf_decal/tile/bar{
dir = 1
Expand Down Expand Up @@ -8310,7 +8310,7 @@
/area/space)
"awV" = (
/obj/structure/table/wood,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/turf/open/floor/wood,
/area/centcom/syndicate_mothership/control)
"awW" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/templates/infiltrator_base.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@
"aV" = (
/obj/structure/table/wood,
/obj/item/pizzabox/vegetable,
/obj/item/paicard,
/obj/item/computer_hardware/paicard,
/obj/effect/turf_decal/tile/bar,
/obj/effect/turf_decal/tile/bar{
dir = 1
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/modular_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
#define MC_AI "AI"
#define MC_SENSORS "SENSORS"
#define MC_AI_NETWORK "AINETWORK"
#define MC_PAI "PAI"

//NTNet stuff, for modular computers
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/lists/maintenance_loot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ GLOBAL_LIST_INIT(maintenance_loot_minor,list(
/obj/item/kitchen/knife = W_RARE,
/obj/item/melee/skateboard = W_RARE,
/obj/item/mining_scanner = W_RARE,
/obj/item/paicard = W_RARE,
/obj/item/computer_hardware/paicard = W_RARE,
/obj/item/paint/anycolor = W_MYTHICAL,
/obj/item/paint/paint_remover = W_RARE,
/obj/item/phone = W_RARE,
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/pai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if(!..())
return
var/mob/living/silicon/pai/pAI = usr
pAI.paiInterface()
pAI.ui_interact(usr)

/atom/movable/screen/pai/shell
name = "Toggle Holoform"
Expand Down
58 changes: 9 additions & 49 deletions code/controllers/subsystem/pai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ SUBSYSTEM_DEF(pai)
/datum/controller/subsystem/pai/Topic(href, href_list[])
if(href_list["download"])
var/datum/paiCandidate/candidate = locate(href_list["candidate"]) in candidates
var/obj/item/paicard/card = locate(href_list["device"]) in paicard_list
var/obj/item/computer_hardware/paicard/card = locate(href_list["device"]) in paicard_list
if(card.pai)
return
if(istype(card, /obj/item/paicard) && istype(candidate, /datum/paiCandidate))
if(istype(card, /obj/item/computer_hardware/paicard) && istype(candidate, /datum/paiCandidate))
if(check_ready(candidate) != candidate)
return FALSE
var/mob/living/silicon/pai/pai = new(card)
Expand Down Expand Up @@ -69,7 +69,7 @@ SUBSYSTEM_DEF(pai)
if("submit")
if(candidate)
candidate.ready = 1
for(var/obj/item/paicard/p in paicard_list)
for(var/obj/item/computer_hardware/paicard/p in paicard_list)
if(!p.pai)
p.alertUpdate()
usr << browse(null, "window=paiRecruit")
Expand All @@ -85,8 +85,6 @@ SUBSYSTEM_DEF(pai)
candidate = new /datum/paiCandidate()
candidate.key = M.key
candidates.Add(candidate)


var/dat = ""
dat += "<HTML><HEAD><meta charset='UTF-8'></HEAD><BODY>"
dat += {"
Expand Down Expand Up @@ -141,58 +139,20 @@ SUBSYSTEM_DEF(pai)
return C
return FALSE

/datum/controller/subsystem/pai/proc/findPAI(obj/item/paicard/p, mob/user)
/datum/controller/subsystem/pai/proc/findPAI(obj/item/computer_hardware/paicard/p, mob/user)
if(!(GLOB.ghost_role_flags & GHOSTROLE_SILICONS))
to_chat(user, span_warning("Due to growing incidents of SELF corrupted independent artificial intelligences, freeform personality devices have been temporarily banned in this sector."))
return
if(!ghost_spam)
ghost_spam = TRUE
for(var/mob/dead/observer/G in GLOB.player_list)
if(!G.key || !G.client)
continue
if(!(ROLE_PAI in G.client.prefs.be_special))
continue
to_chat(G, span_ghostalert("[user] is requesting a pAI personality! Use the pAI button to submit yourself as one."))
notify_ghosts("[user] is requesting a pAI personality! Use the pAI button to submit yourself as one.")
addtimer(CALLBACK(src, PROC_REF(spam_again)), spam_delay)
var/list/available = list()
for(var/datum/paiCandidate/c in SSpai.candidates)
available.Add(check_ready(c))
var/dat = ""
dat += "<HTML><HEAD><meta charset='UTF-8'></HEAD><BODY>"
dat += {"
<style type="text/css">

p.top {
background-color: #AAAAAA; color: black;
}

tr.d0 td {
background-color: #CC9999; color: black;
}
tr.d1 td {
background-color: #9999CC; color: black;
}
tr.d2 td {
background-color: #99CC99; color: black;
}
</style>
"}
dat += "<p class=\"top\">Requesting AI personalities from central database... If there are no entries, or if a suitable entry is not listed, check again later as more personalities may be added.</p>"

dat += "<table>"

for(var/datum/paiCandidate/c in available)
dat += "<tr class=\"d0\"><td>Name:</td><td>[c.name]</td></tr>"
dat += "<tr class=\"d1\"><td>Description:</td><td>[c.description]</td></tr>"
dat += "<tr class=\"d0\"><td>Preferred Role:</td><td>[c.role]</td></tr>"
dat += "<tr class=\"d1\"><td>OOC Comments:</td><td>[c.comments]</td></tr>"
dat += "<tr class=\"d2\"><td><a href='byond://?src=[REF(src)];download=1;candidate=[REF(c)];device=[REF(p)]'>\[Download [c.name]\]</a></td><td></td></tr>"

dat += "</table>"

dat += "</BODY></HTML>"

user << browse(dat, "window=findPai")
if(check_ready(c))
var/candidate = list("name" = c.name, "description"=c.description, "prefrole"=c.role, "ooccomments"=c.comments)
available += list(candidate)
return available

/datum/paiCandidate
var/name
Expand Down
Loading

0 comments on commit 4b2a9d3

Please sign in to comment.