Skip to content

Commit

Permalink
Feat: add IPC exonet organ (#705)
Browse files Browse the repository at this point in the history
# Описание

Work in progress


## Основные изменения

Добавление ИПС обусловленной ЛОРом им возможности, сидеть в интернетике
и пользоваться программами без компьютера. Ведь компьютер у них в голове

## Скриншоты

![image](https://github.com/ss220-space/Baystation12/assets/61974560/1690b988-6ca4-4cd3-8d75-2f08d1b2d8cb)

![image](https://github.com/ss220-space/Baystation12/assets/61974560/f6a61ead-d5c9-489b-a177-746f4a5d4c0c)


## Changelog

<!-- С помощью этого раздела можно подготовить список изменений, которые
попадут в игровой чейндж-лог. --->
<!-- Вам нужно указать префикс изменения (Он идёт до двоеточия) и дать
описание, как на примере. --->
<!-- Префиксы можно использовать несколько раз. --->
<!-- Если Вы не планируете добавлять записи в чейндж-лог - просто
удалите из пулл-реквеста этот раздел. --->

:cl:
rscadd: IPC exonet organ
/:cl:
  • Loading branch information
Lexanx authored Feb 10, 2024
1 parent 1e68a25 commit 046842c
Show file tree
Hide file tree
Showing 24 changed files with 210 additions and 17 deletions.
2 changes: 2 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2486,6 +2486,7 @@
#include "code\modules\modular_computers\computers\modular_computer\power.dm"
#include "code\modules\modular_computers\computers\modular_computer\variables.dm"
#include "code\modules\modular_computers\computers\subtypes\dev_console.dm"
#include "code\modules\modular_computers\computers\subtypes\dev_exonet_connection_system.dm"
#include "code\modules\modular_computers\computers\subtypes\dev_laptop.dm"
#include "code\modules\modular_computers\computers\subtypes\dev_pda.dm"
#include "code\modules\modular_computers\computers\subtypes\dev_tablet.dm"
Expand Down Expand Up @@ -2634,6 +2635,7 @@
#include "code\modules\organs\internal\appendix.dm"
#include "code\modules\organs\internal\brain.dm"
#include "code\modules\organs\internal\cooling_system.dm"
#include "code\modules\organs\internal\exonet_connection_system.dm"
#include "code\modules\organs\internal\eyes.dm"
#include "code\modules\organs\internal\heart.dm"
#include "code\modules\organs\internal\kidneys.dm"
Expand Down
1 change: 1 addition & 0 deletions code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
#define BP_APPENDIX "appendix"
#define BP_CELL "cell"
#define BP_COOLING "cooling system"
#define BP_EXONET "exonet connection slot"
#define BP_HIVE "hive node"
#define BP_LARVA "alien larva" //INF
#define BP_MIMIC "mimic sac" //INF
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/interactive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
/datum/extension/interactive/Topic(var/href, var/list/href_list)
if(..())
return TRUE
return extension_act(href, href_list, usr)
return extension_act(href, href_list, usr)
1 change: 1 addition & 0 deletions code/game/machinery/bioprinter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
BP_R_HAND = list(/obj/item/organ/external/hand/right, 40),
BP_CELL = list(/obj/item/organ/internal/cell/print, 25),
BP_COOLING = list(/obj/item/organ/internal/cooling_system, 25),
BP_EXONET = list(/obj/item/organ/internal/ecs, 35),
)

machine_name = "prosthetic organ fabricator"
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
return
target.add_hiddenprint(src)

/atom/proc/CouldNotUseTopic(var/mob/user)
/atom/proc/CouldNotUseTopic(var/mob/user)
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
to_chat(user, "\The [src] was already emagged.")
return NO_EMAG_ACT
else
if(src.type == /obj/item/modular_computer/ecs)
return NO_EMAG_ACT
computer_emagged = TRUE
to_chat(user, "You emag \the [src]. It's screen briefly shows a \"OVERRIDE ACCEPTED: New software downloads available.\" message.")
return 1
Expand All @@ -98,7 +100,9 @@
return
if(tesla_link)
tesla_link.enabled = 1
var/issynth = issilicon(user) // Robots and AIs get different activation messages.
var/issynth = FALSE
if((user.is_species(SPECIES_IPC) && istype(src, /obj/item/modular_computer/ecs)) || issilicon(user))
issynth = TRUE // Robots and AIs and IPCs get different activation messages.
if(damage > broken_damage)
if(issynth)
to_chat(user, "You send an activation signal to \the [src], but it responds with an error code. It must be damaged.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@
all_components.Add(tesla_link)
if(scanner)
all_components.Add(scanner)
return all_components
return all_components
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
if(enabled)
bsod = 1
update_icon()
to_chat(usr, "You press a hard-reset button on \the [src]. It displays a brief debug screen before shutting down.")
if((usr.is_species(SPECIES_IPC) && istype(src, /obj/item/modular_computer/ecs)))
to_chat(usr, "You send signal for a hard-reset on \the [src].")
else
to_chat(usr, "You press a hard-reset button on \the [src]. It displays a brief debug screen before shutting down.")
shutdown_computer(FALSE)
spawn(2 SECONDS)
bsod = 0
Expand Down Expand Up @@ -164,10 +167,12 @@

if(istype(W, /obj/item/stock_parts/computer))
var/obj/item/stock_parts/computer/C = W
if(C.hardware_size <= max_hardware_size)
if((C.hardware_size <= max_hardware_size) && (!exonets_ipc_computer))
try_install_component(user, C)
else if(exonets_ipc_computer && C.exonets_ipc_computer_suitable)
try_install_component(user, C)
else
to_chat(user, "This component is too large for \the [src].")
to_chat(user, "This component is not suitable for \the [src].")
if(isWrench(W))
var/list/components = get_all_components()
if(components.len)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@

var/modifiable = TRUE // can't be modified or damaged if false

var/exonets_ipc_computer = FALSE // Checks if it suitable to install for IPCs head computers

var/stores_pen = FALSE
var/obj/item/pen/stored_pen

var/interact_sounds
var/interact_sound_volume = 40
var/interact_sound_volume = 40
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//// INTERNAL IPCs COMPUTER
/obj/item/modular_computer/ecs
name = "exonet connection system"
desc = "A cirquit with some ports and wires."
icon = 'icons/obj/surgery.dmi'
icon_state = "ecs_on"
icon_state_unpowered = "ecs_off"
anchored = FALSE
w_class = ITEM_SIZE_NORMAL
base_idle_power_usage = 5
base_active_power_usage = 50
light_strength = 0
max_damage = 100
broken_damage = 60
max_hardware_size = 2
hardware_flag = PROGRAM_LAPTOP
exonets_ipc_computer = TRUE


/obj/item/modular_computer/ecs/install_default_hardware()
..()
processor_unit = new/obj/item/stock_parts/computer/processor_unit(src)
hard_drive = new/obj/item/stock_parts/computer/hard_drive/advanced(src)
network_card = new/obj/item/stock_parts/computer/network_card/advanced(src)
battery_module = new/obj/item/stock_parts/computer/battery_module/converter(src)

/obj/item/modular_computer/ecs/install_default_programs()
..()
hard_drive.store_file(new/datum/computer_file/program/email_client())
hard_drive.store_file(new/datum/computer_file/program/wordprocessor())


/obj/item/modular_computer/ecs/attack_self(var/mob/user) // Оставляем возможность вызывать окно только через абилку ИПСа
return


/obj/item/modular_computer/ecs/proc/open_terminal_ecs(var/mob/user)
var/datum/extension/interactive/ntos/os = get_extension(src, /datum/extension/interactive/ntos)
return os.open_terminal(user)
1 change: 1 addition & 0 deletions code/modules/modular_computers/hardware/_hardware.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
var/malfunction_probability = 10// Chance of malfunction when the component is damaged
var/usage_flags = PROGRAM_ALL
var/external_slot // Whether attackby will be passed on it even with a closed panel
var/exonets_ipc_computer_suitable = FALSE

/obj/item/stock_parts/computer/attackby(var/obj/item/W as obj, var/mob/living/user as mob)
// Multitool. Runs diagnostics
Expand Down
8 changes: 8 additions & 0 deletions code/modules/modular_computers/hardware/battery_module.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
origin_tech = list(TECH_POWER = 1, TECH_ENGINEERING = 1)
battery_rating = 60

/obj/item/stock_parts/computer/battery_module/converter
name = "Converter battery"
desc = "A tiny device with sole purpose to connect main IPC battery"
icon_state = "battery_nano"
origin_tech = list(TECH_POWER = 1, TECH_ENGINEERING = 1)
battery_rating = 80
exonets_ipc_computer_suitable = TRUE

// This is not intended to be obtainable in-game. Intended for adminbus and debugging purposes.
/obj/item/stock_parts/computer/battery_module/lambda
name = "lambda coil"
Expand Down
1 change: 1 addition & 0 deletions code/modules/modular_computers/hardware/hard_drive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
icon_state = "hdd_normal"
hardware_size = 1
origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1)
exonets_ipc_computer_suitable = TRUE
var/max_capacity = 128
var/used_capacity = 0
var/list/stored_files = list() // List of stored files on this drive. DO NOT MODIFY DIRECTLY!
Expand Down
1 change: 1 addition & 0 deletions code/modules/modular_computers/hardware/network_card.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var/global/ntnet_card_uid = 1
var/ethernet = 0 // Hard-wired, therefore always on, ignores NTNet wireless checks.
var/proxy_id // If set, uses the value to funnel connections through another network card.
malfunction_probability = 1
exonets_ipc_computer_suitable = TRUE

/obj/item/stock_parts/computer/network_card/diagnostics()
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
hardware_size = 1
max_capacity = 16
origin_tech = list(TECH_DATA = 1)
exonets_ipc_computer_suitable = TRUE

/obj/item/stock_parts/computer/hard_drive/portable/advanced
name = "advanced data crystal"
Expand Down Expand Up @@ -38,4 +39,4 @@

/obj/item/stock_parts/computer/hard_drive/portable/merchant/Initialize()
. = ..()
store_file(new/datum/computer_file/program/merchant(src))
store_file(new/datum/computer_file/program/merchant(src))
2 changes: 1 addition & 1 deletion code/modules/modular_computers/hardware/processor_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
critical = 1
malfunction_probability = 1
origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 2)

exonets_ipc_computer_suitable = TRUE
var/processing_power = 2 // Used for DDoS speed calculations

/obj/item/stock_parts/computer/processor_unit/small
Expand Down
5 changes: 2 additions & 3 deletions code/modules/modular_computers/ntos/ntos.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
var/update_postshutdown

var/list/terminals

//[INF]
var/is_remote_ui = 0
GLOBAL_LIST_EMPTY(CreatedOSes)
Expand Down Expand Up @@ -61,7 +60,7 @@ GLOBAL_LIST_EMPTY(CreatedOSes)
on = FALSE
for(var/datum/computer_file/program/P in running_programs)
kill_program(P, 1)

var/obj/item/stock_parts/computer/network_card/network_card = get_component(PART_NETWORK)
if(network_card)
ntnet_global.unregister(network_card.identification_id)
Expand Down Expand Up @@ -201,4 +200,4 @@ GLOBAL_LIST_EMPTY(CreatedOSes)
LAZYADD(terminals, new /datum/terminal/(user, src))

/datum/extension/interactive/ntos/proc/emagged()
return FALSE
return FALSE
4 changes: 4 additions & 0 deletions code/modules/nano/interaction/default.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ GLOBAL_DATUM_INIT(default_state, /datum/topic_state/default, new)
. = min(., shared_living_nano_distance(src_object))
if(. == STATUS_UPDATE && (psi && !psi.suppressed && psi.get_rank(PSI_PSYCHOKINESIS) >= PSI_RANK_OPERANT))
return STATUS_INTERACTIVE
if(is_species(SPECIES_IPC))
var/obj/item/modular_computer/ecs/computer = src_object
if(computer.type == /obj/item/modular_computer/ecs)
return STATUS_INTERACTIVE
77 changes: 77 additions & 0 deletions code/modules/organs/internal/exonet_connection_system.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/obj/item/organ/internal/ecs
name = "exonet connection port"
icon_state = "setup_large"
organ_tag = BP_EXONET
parent_organ = BP_HEAD
status = ORGAN_ROBOTIC
desc = "The internal port is designed to establish communication between the positronic brain and the computer."
w_class = ITEM_SIZE_NORMAL
max_damage = 100
var/obj/item/modular_computer/ecs/computer = /obj/item/modular_computer/ecs
var/open = FALSE


/obj/item/organ/internal/ecs/Initialize()
if(ispath(computer))
computer = new computer(src)
. = ..()


/obj/item/organ/internal/ecs/Process()
..()
if(!owner)
return
if(owner.stat == DEAD)
return
if(!computer)
return
if(computer.battery_module.battery.charge < (computer.battery_module.battery.maxcharge))
transfer_charge()

/obj/item/organ/internal/ecs/proc/transfer_charge()
var/obj/item/organ/internal/cell/potato = owner.internal_organs_by_name[BP_CELL]
var/charge_needed =(computer.battery_module.battery.maxcharge - computer.battery_module.battery.charge)
if(charge_needed)
potato.cell.charge -= charge_needed
computer.battery_module.battery.charge += charge_needed

/obj/item/organ/internal/ecs/attackby(obj/item/W, mob/user)
if(isScrewdriver(W))
if(open)
open = FALSE
to_chat(user, "<span class='notice'>You screw the exonet connection slot panel in place.</span>")
else
open = TRUE
to_chat(user, "<span class='notice'>You unscrew the exonet connection slot panel.</span>")

if(isCrowbar(W))
if(open)
if(computer)
user.put_in_hands(computer)
to_chat(user, "<span class='notice'>You remove \the [computer] from \the [src].</span>")
computer = null
icon_state = "setup_large-open"

if (istype(W, /obj/item/modular_computer/ecs))
if(open)
if(computer)
to_chat(user, "<span class ='warning'>There \the [computer] already installed.</span>")
else if(user.unEquip(W, src))
computer = W
to_chat(user, "<span class = 'notice'>You insert \the [computer].</span>")
icon_state = "setup_large"


/obj/item/organ/internal/ecs/proc/exonet(mob/user)
if(!computer)
to_chat(user, "<span class='warning'>You have no exonet connection system installed</span>")
return
if(!computer.enabled && computer.screen_on)
return computer.turn_on(user)
switch(alert("Open Terminal or interact with it?", "Open Terminal or interact with it?", "Interact", "Terminal", "Emergency Shutdown"))
if("Interact")
return computer.ui_interact(user)
if("Terminal")
return computer.open_terminal_ecs(user)
if("Emergency Shutdown")
return computer.emergency_shutdown(user)
23 changes: 21 additions & 2 deletions code/modules/research/designs/designs_modular_computer.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/datum/design/item/modularcomponent
category_items = "Computer Parts"

// Drives
/datum/design/item/modularcomponent/disk/AssembleDesignName()
..()
Expand Down Expand Up @@ -281,6 +281,15 @@
build_path = /obj/item/stock_parts/computer/battery_module/micro
sort_string = "VBAEF"

/datum/design/item/modularcomponent/battery/converter
name = "Converter battery"
id = "bat_nano"
req_tech = list(TECH_POWER = 1, TECH_ENGINEERING = 1)
build_type = PROTOLATHE
materials = list(MATERIAL_STEEL = 200)
build_path = /obj/item/stock_parts/computer/battery_module/converter
sort_string = "VBAFE"

// Processor unit
/datum/design/item/modularcomponent/cpu/AssembleDesignName()
..()
Expand Down Expand Up @@ -324,4 +333,14 @@
materials = list(MATERIAL_STEEL = 3200, glass = 1000)
chemicals = list(/datum/reagent/acid = 20)
build_path = /obj/item/stock_parts/computer/processor_unit/photonic/small
sort_string = "VBAFD"
sort_string = "VBAFD"

/datum/design/item/modularcomponent/ecs
name = "exonet connection system"
id = "exonet"
req_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4)
build_type = IMPRINTER
materials = list(MATERIAL_STEEL = 4000, glass = 3000)
chemicals = list(/datum/reagent/acid = 50)
build_path = /obj/item/modular_computer/ecs
sort_string = "VBAFE"
3 changes: 2 additions & 1 deletion code/modules/species/station/machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
has_organ = list(
BP_POSIBRAIN = /obj/item/organ/internal/posibrain,
BP_EYES = /obj/item/organ/internal/eyes/robot,
BP_COOLING = /obj/item/organ/internal/cooling_system
BP_COOLING = /obj/item/organ/internal/cooling_system,
BP_EXONET = /obj/item/organ/internal/ecs,
)

heat_discomfort_level = 373.15
Expand Down
Binary file modified icons/obj/surgery.dmi
Binary file not shown.
Loading

0 comments on commit 046842c

Please sign in to comment.