mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
## About The Pull Request This is an update that touches many more things all at once (compared to my other PRs) meant to make PDAs in general feel more consistent and not take away from one of the experiences we want to encourage: interaction between players. 1. Replaced all checks of a 'pda' with a 'modular pc'. This means technically (though not done in-game currently) other modpcs can hold an uplink, and microwaves can charge laptops. 2. Speaking of microwave, they now don't break and require deconstruction if the cell is removed mid-charge. 3. When a Mod PC is out of power, it will now allow the Messenger to work (which now also doesn't consume any additional power), if the app exists on the PC. Here's a video demonstration https://github.com/tgstation/tgstation/assets/53777086/7ae12f81-a271-49b8-95fa-2ba54d2e2d1f 4. Flashlights can't be turned on while the cell is dead 5. I replaced a bunch of program vars with ``program_flags`` and renamed ``usage_flags`` to ``can_run_on_flags``. 6. Added a debug modPC that has every app installed by default. Mafia had some issues in the past that were unknown because Mafia wasn't preinstalled with any tablet so was never in create & destroy nor in any other unit test. This was just an easy solution I had, but PDAs should get more in-depth unit tests in the future for running apps n stuff- I just wanted to make sure no other apps were broken/harddeling. ## Why It's Good For The Game Currently when a PDA dies, its only use is to reply to PDA messages sent to you, since you can still reply to them. Instead of just fixing it and telling players to cope, I thought it would be nice to allow PDA Messenger to still work, as it is a vital app. You can call it some emergency power mode or whatever, I don't really mind the reason behind why it is this way. When I made cells used more on PDAs, my main goal was to encourage upgrading your PDA and/or limiting how many apps you use at once, I did not want this to hit on players who use it as a form of interaction. This is the best of both worlds, I think. The rest of the changes is just for modularity, if some downstream wants to add tablets, phone computers, or whatever the hell else, they can still get just as far as PDAs should be able to get to, hopefully. ## Changelog 🆑 add: PDAs with a dead power cell are now limited to using their Messenger app. fix: Microwaves now stop charging PDAs if the cell was removed mid-charge. fix: Microwaves can now charge laptops. fix: PDA Flashlights can't be turned on while the PDA is dead. fix: You can now hold a laptop up to a camera (if it has a notekeeper app installed) like PDAs already could. /🆑 --------- Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
139 lines
5.4 KiB
Plaintext
139 lines
5.4 KiB
Plaintext
/datum/computer_file/program/robotact
|
|
filename = "robotact"
|
|
filedesc = "RoboTact"
|
|
downloader_category = PROGRAM_CATEGORY_SCIENCE
|
|
extended_desc = "A built-in app for cyborg self-management and diagnostics."
|
|
ui_header = "robotact.gif" //DEBUG -- new icon before PR
|
|
program_open_overlay = "command"
|
|
program_flags = NONE
|
|
undeletable = TRUE
|
|
can_run_on_flags = PROGRAM_PDA
|
|
size = 5
|
|
tgui_id = "NtosRobotact"
|
|
program_icon = "terminal"
|
|
|
|
/datum/computer_file/program/robotact/on_start(mob/living/user)
|
|
if(!istype(computer, /obj/item/modular_computer/pda/silicon))
|
|
to_chat(user, span_warning("A warning flashes across \the [computer]: Device Incompatible."))
|
|
return FALSE
|
|
. = ..()
|
|
if(.)
|
|
var/obj/item/modular_computer/pda/silicon/tablet = computer
|
|
if(tablet.device_theme == PDA_THEME_SYNDICATE)
|
|
program_open_overlay = "command-syndicate"
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/datum/computer_file/program/robotact/ui_data(mob/user)
|
|
var/list/data = list()
|
|
if(!iscyborg(user))
|
|
return data
|
|
|
|
//Implied, since we can't run on non tablets
|
|
var/obj/item/modular_computer/pda/silicon/tablet = computer
|
|
|
|
var/mob/living/silicon/robot/cyborg = tablet.silicon_owner
|
|
|
|
data["name"] = cyborg.name
|
|
data["designation"] = cyborg.model
|
|
data["masterAI"] = cyborg.connected_ai //Master AI
|
|
|
|
var/charge = 0
|
|
var/maxcharge = 1
|
|
if(cyborg.cell)
|
|
charge = cyborg.cell.charge
|
|
maxcharge = cyborg.cell.maxcharge
|
|
data["charge"] = charge //Current cell charge
|
|
data["maxcharge"] = maxcharge //Cell max charge
|
|
data["integrity"] = ((cyborg.health + 100) / 2) //health, as percentage
|
|
data["lampIntensity"] = cyborg.lamp_intensity //lamp power setting
|
|
data["sensors"] = "[cyborg.sensors_on?"ACTIVE":"DISABLED"]"
|
|
data["printerPictures"] = cyborg.connected_ai? cyborg.connected_ai.aicamera.stored.len : cyborg.aicamera.stored.len //Number of pictures taken, synced to AI if available
|
|
data["printerToner"] = cyborg.toner //amount of toner
|
|
data["printerTonerMax"] = cyborg.tonermax //It's a variable, might as well use it
|
|
data["thrustersInstalled"] = cyborg.ionpulse //If we have a thruster uprade
|
|
data["thrustersStatus"] = "[cyborg.ionpulse_on?"ACTIVE":"DISABLED"]" //Feedback for thruster status
|
|
data["selfDestructAble"] = (cyborg.emagged || istype(cyborg, /mob/living/silicon/robot/model/syndicate))
|
|
|
|
//Cover, TRUE for locked
|
|
data["cover"] = "[cyborg.locked? "LOCKED":"UNLOCKED"]"
|
|
//Ability to move. FAULT if lockdown wire is cut, DISABLED if borg locked, ENABLED otherwise
|
|
data["locomotion"] = "[cyborg.wires.is_cut(WIRE_LOCKDOWN)?"FAULT":"[cyborg.lockcharge?"DISABLED":"ENABLED"]"]"
|
|
//Model wire. FAULT if cut, NOMINAL otherwise
|
|
data["wireModule"] = "[cyborg.wires.is_cut(WIRE_RESET_MODEL)?"FAULT":"NOMINAL"]"
|
|
//DEBUG -- Camera(net) wire. FAULT if cut (or no cameranet camera), DISABLED if pulse-disabled, NOMINAL otherwise
|
|
data["wireCamera"] = "[!cyborg.builtInCamera || cyborg.wires.is_cut(WIRE_CAMERA)?"FAULT":"[cyborg.builtInCamera.can_use()?"NOMINAL":"DISABLED"]"]"
|
|
//AI wire. FAULT if wire is cut, CONNECTED if connected to AI, READY otherwise
|
|
data["wireAI"] = "[cyborg.wires.is_cut(WIRE_AI)?"FAULT":"[cyborg.connected_ai?"CONNECTED":"READY"]"]"
|
|
//Law sync wire. FAULT if cut, NOMINAL otherwise
|
|
data["wireLaw"] = "[cyborg.wires.is_cut(WIRE_LAWSYNC)?"FAULT":"NOMINAL"]"
|
|
|
|
return data
|
|
|
|
/datum/computer_file/program/robotact/ui_static_data(mob/user)
|
|
var/list/data = list()
|
|
if(!iscyborg(user))
|
|
return data
|
|
var/mob/living/silicon/robot/cyborg = user
|
|
//Implied
|
|
var/obj/item/modular_computer/pda/silicon/tablet = computer
|
|
|
|
data["Laws"] = cyborg.laws.get_law_list(TRUE, TRUE, FALSE)
|
|
data["borgLog"] = tablet.borglog
|
|
data["borgUpgrades"] = cyborg.upgrades
|
|
return data
|
|
|
|
/datum/computer_file/program/robotact/ui_act(action, params, datum/tgui/ui, datum/ui_state/state)
|
|
//Implied type, memes
|
|
var/obj/item/modular_computer/pda/silicon/tablet = computer
|
|
var/mob/living/silicon/robot/cyborg = tablet.silicon_owner
|
|
|
|
switch(action)
|
|
if("coverunlock")
|
|
if(cyborg.locked)
|
|
cyborg.locked = FALSE
|
|
cyborg.update_icons()
|
|
if(cyborg.emagged)
|
|
cyborg.logevent("ChÃ¥vÃis cover lock has been [cyborg.locked ? "engaged" : "released"]") //"The cover interface glitches out for a split second"
|
|
else
|
|
cyborg.logevent("Chassis cover lock has been [cyborg.locked ? "engaged" : "released"]")
|
|
|
|
if("lawchannel")
|
|
cyborg.set_autosay()
|
|
|
|
if("lawstate")
|
|
cyborg.checklaws()
|
|
|
|
if("alertPower")
|
|
if(cyborg.stat == CONSCIOUS)
|
|
if(!cyborg.cell || !cyborg.cell.charge)
|
|
cyborg.visible_message(span_notice("The power warning light on [span_name("[cyborg]")] flashes urgently."), \
|
|
"You announce you are operating in low power mode.")
|
|
playsound(cyborg, 'sound/machines/buzz-two.ogg', 50, FALSE)
|
|
|
|
if("toggleSensors")
|
|
cyborg.toggle_sensors()
|
|
|
|
if("viewImage")
|
|
if(cyborg.connected_ai)
|
|
cyborg.connected_ai.aicamera?.viewpictures(usr)
|
|
else
|
|
cyborg.aicamera?.viewpictures(usr)
|
|
|
|
if("printImage")
|
|
var/obj/item/camera/siliconcam/robot_camera/borgcam = cyborg.aicamera
|
|
borgcam?.borgprint(usr)
|
|
|
|
if("toggleThrusters")
|
|
cyborg.toggle_ionpulse()
|
|
|
|
if("lampIntensity")
|
|
cyborg.lamp_intensity = params["ref"]
|
|
cyborg.toggle_headlamp(FALSE, TRUE)
|
|
|
|
if("selfDestruct")
|
|
if(cyborg.stat || cyborg.lockcharge) //No detonation while stunned or locked down
|
|
return
|
|
if(cyborg.emagged || istype(cyborg, /mob/living/silicon/robot/model/syndicate)) //This option shouldn't even be showing otherwise
|
|
cyborg.self_destruct(cyborg)
|