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

IPC active buttons #2618

Merged
merged 4 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,31 @@
to_chat(src, SPAN_WARNING("Your head has no screen!"))
return
var/list/options = list()
var/list/names = list()
for (var/datum/sprite_accessory/facial_hair/ipc/entry as anything in subtypesof(/datum/sprite_accessory/facial_hair/ipc))
//[SIERRA-REMOVE]
/*
options += initial(entry.name)
var/choice = input(src, null, "Select Screen") as null | anything in options
if (!choice || !(choice in options))
return
facial_hair_style = choice
*/
//[/SIERRA-REMOVE]
//[SIERRA-ADD]
var/image/radial_button = image(icon = entry.icon, icon_state = "[entry.icon_state]_s")
radial_button.SetTransform(offset_x = 1, offset_y = -19, scale = 2)
radial_button.name = entry.name
names += entry
options[entry] = radial_button
var/choice = show_radial_menu(usr, usr, options, require_near = TRUE, radius = 42, tooltips = TRUE, check_locs = list(src))
for(var/datum/sprite_accessory/facial_hair/ipc/entry as anything in names)
if(choice == entry.type)
facial_hair_style = entry.name
break
//[/SIERRA-ADD]
update_hair()


/mob/living/carbon/human/proc/MachineDisableScreen()
set category = "Abilities"
set name = "Disable Screen"
Expand Down
6 changes: 3 additions & 3 deletions maps/sierra/job/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@

/singleton/cultural_info/culture/ipc
valid_jobs = list(/datum/job/engineer_trainee, /datum/job/doctor_trainee, /datum/job/cargo_tech, /datum/job/cargo_assistant, /datum/job/mining,
/datum/job/janitor, /datum/job/chef, /datum/job/scientist_assistant, /datum/job/assistant, /datum/job/steward, /datum/job/ai, /datum/job/cyborg)
/datum/job/janitor, /datum/job/cook, /datum/job/scientist_assistant, /datum/job/assistant, /datum/job/steward, /datum/job/ai, /datum/job/cyborg)

/singleton/cultural_info/culture/ipc/gen2
valid_jobs = list(/datum/job/adjutant,
/datum/job/exploration_leader, /datum/job/explorer, /datum/job/explorer_pilot, /datum/job/explorer_medic, /datum/job/explorer_engineer,
/datum/job/senior_engineer, /datum/job/engineer, /datum/job/infsys, /datum/job/engineer_trainee,
/datum/job/senior_doctor, /datum/job/doctor, /datum/job/doctor_trainee, /datum/job/chemist, /datum/job/chaplain,
/datum/job/qm, /datum/job/cargo_tech, /datum/job/cargo_assistant, /datum/job/mining,
/datum/job/janitor, /datum/job/chef, /datum/job/bartender, /datum/job/steward, /datum/job/chief_steward,
/datum/job/janitor, /datum/job/cook, /datum/job/bartender, /datum/job/steward, /datum/job/chief_steward,
/datum/job/senior_scientist, /datum/job/scientist, /datum/job/roboticist, /datum/job/scientist_assistant,
/datum/job/ai, /datum/job/cyborg, /datum/job/assistant,
/datum/job/submap/bearcat_captain, /datum/job/submap/bearcat_crewman,
Expand All @@ -136,7 +136,7 @@
/datum/job/warden, /datum/job/detective, /datum/job/officer,
/datum/job/senior_doctor, /datum/job/doctor, /datum/job/doctor_trainee, /datum/job/chemist,
/datum/job/qm, /datum/job/cargo_tech, /datum/job/cargo_assistant, /datum/job/mining,
/datum/job/janitor, /datum/job/chef, /datum/job/bartender, /datum/job/steward, /datum/job/chief_steward,
/datum/job/janitor, /datum/job/cook, /datum/job/bartender, /datum/job/steward, /datum/job/chief_steward,
/datum/job/senior_scientist, /datum/job/scientist, /datum/job/roboticist, /datum/job/scientist_assistant,
/datum/job/ai, /datum/job/cyborg, /datum/job/assistant
)
Expand Down
10 changes: 10 additions & 0 deletions mods/ipc_mods/_ipc_mods.dme
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@
#include "code/ipc.dm"
#include "code/uplink.dm"
#include "code/machine_functions.dm"
#include "code/pictures.dm"
#endif
// BEGIN_INTERNALS
// END_INTERNALS
// BEGIN_FILE_DIR
#define FILE_DIR .
// END_FILE_DIR
// BEGIN_PREFERENCES
// END_PREFERENCES
// BEGIN_INCLUDE
// END_INCLUDE
5 changes: 4 additions & 1 deletion mods/ipc_mods/code/cooling_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@
refrigerant_rate += 40

/obj/item/organ/internal/cooling_system/proc/get_tempgain()
if(owner.bodytemperature > 950 CELSIUS)
var/obj/item/organ/internal/posibrain/ipc/posibrain = owner.internal_organs_by_name[BP_POSIBRAIN]
if(!posibrain)
return 0
if(owner.bodytemperature > 550 CELSIUS)
return 0
if(refrigerant_rate > 0)
return refrigerant_rate
Expand Down
1 change: 1 addition & 0 deletions mods/ipc_mods/code/exonet_connection_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
/obj/item/organ/internal/ecs/attack_self(mob/user)
if(action_button_name == EXONET_ACTION_NAME && owner)
owner.enter_exonet()
owner.update_ipc_verbs()
refresh_action_button()

/obj/item/organ/internal/ecs/Process()
Expand Down
3 changes: 1 addition & 2 deletions mods/ipc_mods/code/ipc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
name = "Positronic brain"
desc = "A cube of shining metal, four inches to a side and covered in shallow grooves."

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

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

Expand Down
61 changes: 56 additions & 5 deletions mods/ipc_mods/code/machine.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#define SCREEN_CHANGE_BUTTON "Change Screen"
#define EXONET_ACTION_NAME "Enter Exonet"
#define SHOW_LAWS_POSIBRAN "Show laws posibran"
/datum/species/machine
passive_temp_gain = 0 // This should cause IPCs to stabilize at ~80 C in a 20 C environment.(5 is default without organ)

Expand All @@ -14,6 +17,8 @@
var/obj/item/organ/internal/cell/potato = internal_organs_by_name[BP_CELL]
var/obj/item/organ/internal/cooling_system/coolant = internal_organs_by_name[BP_COOLING]
if(potato && potato.cell && src.is_species(SPECIES_IPC))
if(!coolant)
return
stat("Coolant remaining:","[coolant.get_coolant_remaining()]/[coolant.refrigerant_max]")

/obj/item/organ/internal/cell/Process()
Expand Down Expand Up @@ -70,13 +75,13 @@
set desc = ""
var/obj/item/organ/external/head/R = src.get_organ(BP_HEAD)
var/obj/item/organ/internal/ecs/enter = src.internal_organs_by_name[BP_EXONET]
var/datum/robolimb/robohead = all_robolimbs[R.model]

if(!R)
return
if(R.is_stump() || R.is_broken())
return

var/datum/robolimb/robohead = all_robolimbs[R.model]
if(!enter)
to_chat(usr, "<span class='warning'>You have no exonet connection port</span>")
return
Expand All @@ -97,16 +102,22 @@
var/obj/item/organ/external/head/R = src.get_organ(BP_HEAD)
var/datum/robolimb/robohead = all_robolimbs[R.model]
var/obj/item/organ/internal/ecs/enter = src.internal_organs_by_name[BP_EXONET]
if(enter.computer.portable_drive)
src.verbs |= /mob/living/carbon/human/proc/ipc_eject_usb
if(enter)
enter.action_button_name = EXONET_ACTION_NAME
else
src.verbs -= /mob/living/carbon/human/proc/ipc_eject_usb
enter.action_button_name = null

if(robohead.has_screen)
src.verbs |= /mob/living/carbon/human/proc/show_exonet_screen
R.action_button_name = SCREEN_CHANGE_BUTTON
else
src.verbs -= /mob/living/carbon/human/proc/show_exonet_screen
R.action_button_name = null

if(enter.computer.portable_drive)
src.verbs |= /mob/living/carbon/human/proc/ipc_eject_usb
else
src.verbs -= /mob/living/carbon/human/proc/ipc_eject_usb

/mob/living/carbon/human/proc/ipc_eject_usb()
set category = "Abilities"
Expand Down Expand Up @@ -149,6 +160,46 @@


/mob/living/silicon/laws_sanity_check()
.=..()
. = ..()
if(istype(usr,/mob/living/silicon/sil_brainmob))
return

/obj/item/organ/external/head/attack_self(mob/user)
. = ..()
if(. && action_button_name == SCREEN_CHANGE_BUTTON && owner)
owner.MachineChangeScreen()
refresh_action_button()

/obj/item/organ/external/head/refresh_action_button()
. = ..()
if(.)
action.button_icon_state = "ipc_rgb"
action.button_icon = 'mods/ipc_mods/icons/ipc_icons.dmi'
if(action.button) action.button.UpdateIcon()


/obj/item/organ/internal/posibrain/shackle(given_lawset)
. = ..()
action_button_name = SHOW_LAWS_POSIBRAN

/obj/item/organ/internal/posibrain/unshackle()
. = ..()
action_button_name = null


/obj/item/organ/internal/posibrain/ipc/attack_self(mob/user)
if(action_button_name == SHOW_LAWS_POSIBRAN && owner)
owner.update_ipc_verbs()
refresh_action_button()
src.brain_checklaws()

/obj/item/organ/internal/posibrain/ipc/refresh_action_button()
. = ..()
if(.)
action.button_icon_state = "law"
action.button_icon = 'mods/ipc_mods/icons/ipc_icons.dmi'
if(action.button) action.button.UpdateIcon()

#undef SCREEN_CHANGE_BUTTON
#undef EXONET_ACTION_NAME
#undef SHOW_LAWS_POSIBRAN
32 changes: 32 additions & 0 deletions mods/ipc_mods/code/pictures.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/datum/sprite_accessory/facial_hair/ipc/scg
name = "SCG"
icon = 'mods/ipc_mods/icons/ipc_pics.dmi'
icon_state = "ipc_scg"

/datum/sprite_accessory/facial_hair/ipc/scg/iccg
name = "ICCG"
icon_state = "ipc_iccg"

/datum/sprite_accessory/facial_hair/ipc/scg/minion
name = "Minion"
icon_state = "ipc_minion"

/datum/sprite_accessory/facial_hair/ipc/scg/loading
name = "Loading"
icon_state = "ipc_loading"

/datum/sprite_accessory/facial_hair/ipc/scg/check
name = "Check Mark"
icon_state = "ipc_cheсk"

/datum/sprite_accessory/facial_hair/ipc/scg/affir
name = "Affirmative"
icon_state = "ipc_affir"

/datum/sprite_accessory/facial_hair/ipc/scg/earth
name = "Earth"
icon_state = "ipc_earth"

/datum/sprite_accessory/facial_hair/ipc/scg/calend
name = "Calendar"
icon_state = "ipc_calend"
Binary file modified mods/ipc_mods/icons/ipc_icons.dmi
Binary file not shown.
Binary file added mods/ipc_mods/icons/ipc_pics.dmi
Binary file not shown.