[MIRROR] Removes AI and Charge parts from tablets, adds support for more later. [MDB IGNORE] (#16381)

* Removes AI and Charge parts from tablets, adds support for more later.

* merge conflict

* remove modular tablet loadout item

* fix SR maps referencing tablets, add clear PDA instead of modular tablet loadout

* remove pda loadout item

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
This commit is contained in:
SkyratBot
2022-09-27 23:52:24 +02:00
committed by GitHub
parent 3ddbc27081
commit d0b706c041
49 changed files with 311 additions and 726 deletions

View File

@@ -3,7 +3,6 @@
var/_has_second_id_slot = FALSE
var/_has_printer = FALSE
var/_has_battery = FALSE
var/_has_ai = FALSE
/obj/machinery/modular_computer/console/preset/Initialize(mapload)
. = ..()
@@ -17,8 +16,6 @@
cpu.install_component(new /obj/item/computer_hardware/printer)
if(_has_battery)
cpu.install_component(new /obj/item/computer_hardware/battery(cpu, /obj/item/stock_parts/cell/computer/super))
if(_has_ai)
cpu.install_component(new /obj/item/computer_hardware/ai_slot)
install_programs()
// Override in child types to install preset-specific programs.
@@ -43,13 +40,12 @@
name = "research director's console"
desc = "A stationary computer. This one comes preloaded with research programs."
_has_second_id_slot = TRUE
_has_ai = TRUE
/obj/machinery/modular_computer/console/preset/research/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/ntnetmonitor())
hard_drive.store_file(new/datum/computer_file/program/chatclient())
hard_drive.store_file(new/datum/computer_file/program/aidiag())
hard_drive.store_file(new/datum/computer_file/program/ai_restorer())
hard_drive.store_file(new/datum/computer_file/program/robocontrol())
hard_drive.store_file(new/datum/computer_file/program/scipaper_program())

View File

@@ -2,12 +2,12 @@
// DO NOT SPAWN THIS TYPE. Use /laptop/ or /console/ instead.
/obj/machinery/modular_computer
name = "modular computer"
desc = "An advanced computer."
desc = "You shouldn't see this. If you do, report it." //they should be examining the processor instead
// Modular computers can run on various devices. Each DEVICE (Laptop, Console, Tablet,..)
// must have it's own DMI file. Icon states must be called exactly the same in all files, but may look differently
// If you create a program which is limited to Laptops and Consoles you don't have to add it's icon_state overlay for Tablets too, for example.
icon = null
icon = 'icons/obj/modular_console.dmi'
icon_state = null
idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 0.05
@@ -39,7 +39,7 @@
var/base_idle_power_usage = 10
///CPU that handles most logic while this type only handles power and other specific things.
var/obj/item/modular_computer/processor/cpu = null
var/obj/item/modular_computer/processor/cpu
/obj/machinery/modular_computer/Initialize(mapload)
. = ..()
@@ -51,8 +51,9 @@
return ..()
/obj/machinery/modular_computer/examine(mob/user)
. = ..()
. += get_modular_computer_parts_examine(user)
if(cpu)
return cpu.examine(user)
return ..()
/obj/machinery/modular_computer/attack_ghost(mob/dead/observer/user)
. = ..()
@@ -65,27 +66,33 @@
if(!cpu)
to_chat(user, span_warning("You'd need to turn the [src] on first."))
return FALSE
return (cpu.emag_act(user))
return cpu.emag_act(user)
/obj/machinery/modular_computer/update_appearance(updates)
. = ..()
set_light(cpu?.enabled ? light_strength : 0)
/obj/machinery/modular_computer/update_icon_state()
icon_state = (cpu?.enabled || (!(machine_stat & NOPOWER) && cpu?.use_power())) ? icon_state_powered : icon_state_unpowered
if(!cpu || !cpu.enabled || !cpu.use_power() || (machine_stat & NOPOWER))
icon_state = icon_state_unpowered
else
icon_state = icon_state_powered
return ..()
/obj/machinery/modular_computer/update_overlays()
. = ..()
if(!cpu?.enabled)
if (!(machine_stat & NOPOWER) && (cpu?.use_power()))
. += screen_icon_screensaver
else
. += cpu.active_program?.program_icon_state || screen_icon_state_menu
if(!cpu)
return .
if(cpu && cpu.get_integrity() <= cpu.integrity_failure * cpu.max_integrity)
if(cpu.enabled && cpu.use_power())
. += cpu.active_program?.program_icon_state || screen_icon_state_menu
else if(!(machine_stat & NOPOWER))
. += screen_icon_screensaver
if(cpu.get_integrity() <= cpu.integrity_failure * cpu.max_integrity)
. += "bsod"
. += "broken"
return .
/// Eats the "source" arg because update_icon actually expects args now.
/obj/machinery/modular_computer/proc/relay_icon_update(datum/source, updates, updated)
@@ -103,9 +110,8 @@
// On-click handling. Turns on the computer if it's off and opens the GUI.
/obj/machinery/modular_computer/interact(mob/user)
if(cpu)
return cpu.interact(user) // CPU is an item, that's why we route attack_hand to attack_self
else
return ..()
return cpu.interact(user)
return ..()
// Process currently calls handle_power(), may be expanded in future if more things are added.
/obj/machinery/modular_computer/process(delta_time)
@@ -114,33 +120,23 @@
cpu.name = name
cpu.process(delta_time)
// Used in following function to reduce copypaste
/obj/machinery/modular_computer/proc/power_failure(malfunction = 0)
var/obj/item/computer_hardware/battery/battery_module = cpu.all_components[MC_CELL]
if(cpu?.enabled) // Shut down the computer
visible_message(span_danger("\The [src]'s screen flickers [battery_module ? "\"BATTERY [malfunction ? "MALFUNCTION" : "CRITICAL"]\"" : "\"EXTERNAL POWER LOSS\""] warning as it shuts down unexpectedly."))
if(cpu)
cpu.shutdown_computer(0)
set_machine_stat(machine_stat | NOPOWER)
update_appearance()
// Modular computers can have battery in them, we handle power in previous proc, so prevent this from messing it up for us.
/obj/machinery/modular_computer/power_change()
if(cpu?.use_power()) // If it still has a power source, PC wouldn't go offline.
set_machine_stat(machine_stat & ~NOPOWER)
update_appearance()
return
. = ..()
return ..()
/obj/machinery/modular_computer/screwdriver_act(mob/user, obj/item/tool)
if(cpu)
return cpu.screwdriver_act(user, tool)
/obj/machinery/modular_computer/attackby(obj/item/W as obj, mob/living/user)
if (!user.combat_mode && cpu && !(flags_1 & NODECONSTRUCT_1))
return cpu.attackby(W, user)
return ..()
/obj/machinery/modular_computer/attackby(obj/item/W as obj, mob/living/user)
if (cpu && !user.combat_mode && !(flags_1 & NODECONSTRUCT_1))
return cpu.attackby(W, user)
return ..()
// Stronger explosions cause serious damage to internal components
// Minor explosions are mostly mitigitated by casing.
@@ -170,4 +166,5 @@
// "Brute" damage mostly damages the casing.
/obj/machinery/modular_computer/bullet_act(obj/projectile/Proj)
if(cpu)
cpu.bullet_act(Proj)
return cpu.bullet_act(Proj)
return ..()

View File

@@ -6,7 +6,6 @@
icon_state = "console"
icon_state_powered = "console"
icon_state_unpowered = "console-off"
screen_icon_state_menu = "menu"
hardware_flag = PROGRAM_CONSOLE
density = TRUE
base_idle_power_usage = 100
@@ -24,10 +23,8 @@
// User-built consoles start as empty frames.
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
var/obj/item/computer_hardware/hard_drive/network_card = cpu.all_components[MC_NET]
var/obj/item/computer_hardware/hard_drive/recharger = cpu.all_components[MC_CHARGE]
qdel(recharger)
qdel(network_card)
qdel(hard_drive)
qdel(network_card)
/obj/machinery/modular_computer/console/Initialize(mapload)
. = ..()
@@ -38,7 +35,6 @@
var/obj/item/computer_hardware/network_card/wired/network_card = new()
cpu.install_component(network_card)
cpu.install_component(new /obj/item/computer_hardware/recharger/apc_recharger)
cpu.install_component(new /obj/item/computer_hardware/hard_drive/super) // Consoles generally have better HDDs due to lower space limitations
var/area/A = get_area(src)