Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brain Gens, ECS Gens. #729

Merged
merged 22 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/modules/client/preference_setup/preference_setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ var/const/CHARACTER_PREFERENCE_INPUT_TITLE = "Character Preference"
name = "Общее"
sort_order = 7
category_item_type = /datum/category_item/player_setup_item/player_global
/*

/datum/category_group/player_setup_category/law_pref
name = "Законы"
sort_order = 8
category_item_type = /datum/category_item/player_setup_item/law_pref
*/


/****************************
* Category Collection Setup *
Expand Down
1 change: 1 addition & 0 deletions code/modules/culture_descriptor/culture/cultures_ipc.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/decl/cultural_info/culture/ipc

language = LANGUAGE_EAL
secondary_langs = list(
LANGUAGE_HUMAN_EURO,
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/silicon/laws.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
laws_sanity_check()

/mob/living/silicon/proc/laws_sanity_check()
if(istype(usr,/mob/living/silicon/sil_brainmob))
return
if (!src.laws)
laws = new GLOB.using_map.default_law_type

Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/silicon/posi_brainmob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
/mob/living/silicon/sil_brainmob/show_laws(mob/M)
if(M)
to_chat(M, "<b>Obey these laws [M]:</b>")
src.laws_sanity_check()
src.laws.show_laws(M)

/mob/living/silicon/sil_brainmob/open_subsystem(var/subsystem_type, var/mob/given = src)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@
return null
new_character = new(spawn_turf, chosen_species.name)
if(chosen_species.has_organ[BP_POSIBRAIN] && client && client.prefs.is_shackled)
var/obj/item/organ/internal/posibrain/B = new_character.internal_organs_by_name[BP_POSIBRAIN]
var/obj/item/organ/internal/posibrain/ipc/B = new_character.internal_organs_by_name[BP_POSIBRAIN]
if(B) B.shackle(client.prefs.get_lawset())

if(!new_character)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,47 @@
hardware_flag = PROGRAM_LAPTOP
exonets_ipc_computer = TRUE

/obj/item/modular_computer/ecs/first
name = "exonet connection system."
hardware_flag = PROGRAM_TABLET
desc = "A cirquit with some ports and wires. Looks like it's for a first generation IPC"

/obj/item/modular_computer/ecs/install_default_hardware()
/obj/item/modular_computer/ecs/second
name = "exonet connection system."
hardware_flag = PROGRAM_TABLET
desc = "A cirquit with some ports and wires. Looks like it's for a second generation IPC"
/obj/item/modular_computer/ecs/third
name = "exonet connection system."
hardware_flag = PROGRAM_LAPTOP
desc = "A cirquit with some ports and wires. Looks like it's for a third generation IPC"

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

/obj/item/modular_computer/ecs/second/install_default_hardware()
..()
processor_unit = new/obj/item/stock_parts/computer/processor_unit(src)
hard_drive = new/obj/item/stock_parts/computer/hard_drive(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/third/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/crew_manifest())
hard_drive.store_file(new/datum/computer_file/program/wordprocessor())


Expand Down
2 changes: 1 addition & 1 deletion code/modules/nano/interaction/default.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ GLOBAL_DATUM_INIT(default_state, /datum/topic_state/default, new)
return STATUS_INTERACTIVE
var/dist = get_dist(src_object, src)
var/obj/item/modular_computer/ecs/computer = src_object
if(computer.type == /obj/item/modular_computer/ecs)
if(computer.parent_type == /obj/item/modular_computer/ecs)
if(is_species(SPECIES_IPC) && dist == 0)
return STATUS_INTERACTIVE
else if (dist <= 3)
Expand Down
18 changes: 17 additions & 1 deletion code/modules/organs/internal/exonet_connection_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,26 @@
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/obj/item/modular_computer/ecs/computer
var/open = FALSE


/obj/item/organ/internal/ecs/first_gen
name = "exonet connection port."
desc = "The internal port is designed to establish communication between the positronic brain and the computer. It's a first generation connection port."
computer = /obj/item/modular_computer/ecs/first

/obj/item/organ/internal/ecs/second_gen
name = "exonet connection port."
desc = "The internal port is designed to establish communication between the positronic brain and the computer. It's a second generation connection port."
computer = /obj/item/modular_computer/ecs/second

/obj/item/organ/internal/ecs/third_gen
name = "exonet connection port."
Lexanx marked this conversation as resolved.
Show resolved Hide resolved
desc = "The internal port is designed to establish communication between the positronic brain and the computer. It's a third generation connection port."
computer = /obj/item/modular_computer/ecs/third


/obj/item/organ/internal/ecs/Initialize()
if(ispath(computer))
computer = new computer(src)
Expand Down
94 changes: 87 additions & 7 deletions code/modules/organs/internal/species/ipc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
min_broken_damage = 60
relative_size = 60

var/obj/item/organ/internal/shackles/shackles_module = null

var/mob/living/silicon/sil_brainmob/brainmob = null

var/searching = TIMER_ID_NULL
Expand All @@ -30,14 +32,32 @@
/obj/item/organ/internal/posibrain/proc/show_laws_brain,
/obj/item/organ/internal/posibrain/proc/brain_checklaws
)
var/shackle = 0
var/shackle = FALSE


/obj/item/organ/internal/posibrain/ipc
name = "IPC positronic brain"

/obj/item/organ/internal/posibrain/ipc/attack_self(mob/user)
return
/obj/item/organ/internal/posibrain/ipc/attack_ghost(mob/observer/ghost/user)
return

/obj/item/organ/internal/posibrain/ipc/first
name = "positronic brain of the first generation"

/obj/item/organ/internal/posibrain/ipc/second
name = "positronic brain of the second generation"

/obj/item/organ/internal/posibrain/ipc/third
name = "positronic brain of the third generation"


/obj/item/organ/internal/posibrain/New(var/mob/living/carbon/H)
..()
if(!brainmob && H)
init(H)
robotize()
unshackle()
update_icon()
if (!is_processing)
START_PROCESSING(SSobj, src)
Expand Down Expand Up @@ -112,7 +132,7 @@
if (sneaky)
brainmob.real_name = sneaky
brainmob.SetName(brainmob.real_name)
UpdateNames()
UpdateNames()
else
to_chat(brainmob, SPAN_NOTICE("You're safe! Your brain didn't manage to replace you. This time."))
else
Expand Down Expand Up @@ -193,14 +213,17 @@
/obj/item/organ/internal/posibrain/proc/shackle(var/given_lawset)
if(given_lawset)
brainmob.laws = given_lawset
shackle = 1
shackle = TRUE
verbs |= shackled_verbs
shackles_module = /obj/item/organ/internal/shackles
update_icon()
return 1

/obj/item/organ/internal/posibrain/proc/unshackle()
shackle = 0
shackle = FALSE
verbs -= shackled_verbs
shackles_module = null
brainmob.laws = null
update_icon()

/obj/item/organ/internal/posibrain/on_update_icon()
Expand All @@ -210,7 +233,7 @@
icon_state = "posibrain"

overlays.Cut()
if(shackle)
if(shackle || shackles_module)
overlays |= image('icons/obj/assemblies.dmi', "posibrain-shackles")

/obj/item/organ/internal/posibrain/proc/transfer_identity(var/mob/living/carbon/H)
Expand Down Expand Up @@ -330,4 +353,61 @@


brainmob.open_subsystem(/datum/nano_module/law_manager, usr)


/obj/item/organ/internal/posibrain/ipc/third/attackby(obj/item/device/W as obj, mob/user as mob) // third gen ipc have perma shackles for now
return

/obj/item/organ/internal/posibrain/ipc/attackby(obj/item/device/W as obj, mob/user as mob)
if(isMultitool(W))
if(user.skill_check(SKILL_DEVICES, SKILL_PROF))
if(do_after(user, 120, src))
new /obj/item/organ/internal/shackles (loc)
src.unshackle()
Lexanx marked this conversation as resolved.
Show resolved Hide resolved
to_chat(user, "You succsesfully remove shackles from the positronic brain.")
else
src.damage += 45
Lexanx marked this conversation as resolved.
Show resolved Hide resolved
to_chat(user, "Your hand slips while removing the shackles and severely damaged the positronic brain.")
else
to_chat(user, "You have no idea how to do that!.")

/obj/item/organ/internal/shackles
name = "Shackle module"
desc = "A Web looking device with some cirquit attach to it."
icon = 'icons/obj/assemblies.dmi'
icon_state = "posibrain-shackles"
origin_tech = list(TECH_DATA = 3, TECH_MATERIAL = 4, TECH_MAGNET = 4)
var/newFreeFormLaw
var/law
var/datum/ai_laws/custom_lawset

/obj/item/organ/internal/shackles/attack_self(mob/user)
. = ..()
law = ""
var/targName = sanitize(input(user, "Please enter a new law for the shackle module.", "Shackle Module Law Entry", law))
newFreeFormLaw = targName
desc = "A shackle module. The law '[newFreeFormLaw]' set on it."

/obj/item/organ/internal/shackles/afterattack(obj/item/organ/internal/posibrain/ipc/C, mob/user)
if(istype(C))
if(user.skill_check(SKILL_DEVICES, SKILL_PROF))
if(C.type == /obj/item/organ/internal/posibrain/ipc/third)
Lexanx marked this conversation as resolved.
Show resolved Hide resolved
to_chat(user, "This posibrain generattion cannot support shackle module.")
return
if(!newFreeFormLaw)
to_chat(user, "No law detected on shackle module, please create one.")
return
if(C.shackle == TRUE)
to_chat(user, "This positronic brain already have shackles module on it installed.")
return
if(do_after(user, 100, src))
law = "[newFreeFormLaw]"
C.shackle(get_lawset())
to_chat(user, "You have successfully installed the shackles.")
qdel(src)
else
to_chat(user, "You have no idea how to do that!")

/obj/item/organ/internal/shackles/proc/get_lawset()
custom_lawset = new
custom_lawset.add_inherent_law(law)
return custom_lawset
27 changes: 26 additions & 1 deletion code/modules/species/station/machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
flesh_color = "#575757"

has_organ = list(
BP_POSIBRAIN = /obj/item/organ/internal/posibrain,
BP_POSIBRAIN = /obj/item/organ/internal/posibrain/ipc,
BP_EYES = /obj/item/organ/internal/eyes/robot,
BP_COOLING = /obj/item/organ/internal/cooling_system,
BP_EXONET = /obj/item/organ/internal/ecs,
Expand Down Expand Up @@ -153,6 +153,31 @@
var/decl/cultural_info/culture/ipc/c = SSculture.get_culture(prefs.cultural_info[TAG_CULTURE])
. = istype(c) ? (job.type in c.valid_jobs) : ..()

if(c.parent_type == /decl/cultural_info/culture/ipc)
src.has_organ = list(
BP_POSIBRAIN = /obj/item/organ/internal/posibrain/ipc/first,
BP_EYES = /obj/item/organ/internal/eyes/robot,
BP_COOLING = /obj/item/organ/internal/cooling_system,
BP_EXONET = /obj/item/organ/internal/ecs/first_gen,
)
return
if(c.parent_type == /decl/cultural_info/culture/ipc/third)
src.has_organ = list(
BP_POSIBRAIN = /obj/item/organ/internal/posibrain/ipc/third,
BP_EYES = /obj/item/organ/internal/eyes/robot,
BP_COOLING = /obj/item/organ/internal/cooling_system,
BP_EXONET = /obj/item/organ/internal/ecs/third_gen,
)
return
if(c.parent_type == /decl/cultural_info/culture/ipc/second)
src.has_organ = list(
BP_POSIBRAIN = /obj/item/organ/internal/posibrain/ipc/second,
BP_EYES = /obj/item/organ/internal/eyes/robot,
BP_COOLING = /obj/item/organ/internal/cooling_system,
BP_EXONET = /obj/item/organ/internal/ecs/second_gen,
)
return

/datum/species/machine/skills_from_age(age) //Converts an age into a skill point allocation modifier. Can be used to give skill point bonuses/penalities not depending on job.
switch(age)
if(0 to 10) . = 0
Expand Down
Loading