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

Synthetic Wrist Computer #4818

Draft
wants to merge 69 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d0da77f
Synth SIMI Tool
Geevies Apr 24, 2022
b8a409a
ability framework, repairing, rescue hook
Geevies Apr 24, 2022
2ed8b11
better cooldown, charge handling, reflex overclock
Geevies Apr 24, 2022
6f572a5
ocular designator WIP
Geevies Apr 24, 2022
4d974e0
convert repair form to synth_bracer action
Geevies Apr 24, 2022
ab235cb
integrated phone
Geevies Apr 24, 2022
222812d
tacmap
Geevies Apr 24, 2022
d4efe49
Merge remote-tracking branch 'ColonialMarines/master' into synth_bracer
Geevies May 1, 2022
e128a4d
sprites
Geevies May 1, 2022
eeaafe2
Merge branch 'synth_bracer' into project/SIMI
realforest2001 Oct 20, 2023
630a810
Conflicts
realforest2001 Oct 20, 2023
539db35
updates
realforest2001 Oct 20, 2023
88dd47c
Merge branch 'master' into project/SIMIBracer
realforest2001 Oct 20, 2023
60a1545
Tweaks to phone, animations and module fixes
realforest2001 Oct 21, 2023
f84fc32
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Oct 21, 2023
c2e12b9
code organising
realforest2001 Oct 21, 2023
fdfaf19
Starting work on porting abilities
realforest2001 Oct 21, 2023
87a74ec
monitor and actions proc
realforest2001 Oct 23, 2023
123e57a
This was throwing me errors, no idea why.
realforest2001 Oct 23, 2023
32ea35d
monitor works
realforest2001 Oct 23, 2023
e8f4f79
icons
realforest2001 Oct 23, 2023
28778ab
charging and subtypes (somehow broke hook)
realforest2001 Oct 23, 2023
422944a
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Oct 26, 2023
fc3ba75
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Oct 30, 2023
02fc711
circuit chips
realforest2001 Oct 30, 2023
fea1d59
Fixed hook (I'm stupid)
realforest2001 Oct 30, 2023
8f8c9e4
Motion Detector
realforest2001 Oct 30, 2023
3f364fc
chips in vendor
realforest2001 Oct 30, 2023
f40d299
anchor mode
realforest2001 Oct 31, 2023
f27f270
wear icons
realforest2001 Oct 31, 2023
cec220d
better white
realforest2001 Oct 31, 2023
c2da083
pmc preset
realforest2001 Oct 31, 2023
48f26ab
power check
realforest2001 Nov 1, 2023
f5ad6e5
lint fix
realforest2001 Nov 1, 2023
e1c485c
human adaptation
realforest2001 Nov 1, 2023
4cd1a30
charge report
realforest2001 Nov 1, 2023
64d0e32
remove direct target hook
realforest2001 Nov 1, 2023
5dbda8e
sounds
realforest2001 Nov 1, 2023
f68fbce
bugfixes and activation procs
realforest2001 Nov 1, 2023
058c4dc
Apply suggestions from code review
realforest2001 Nov 1, 2023
c62e5ef
Partial changes
realforest2001 Nov 1, 2023
d0b8c3a
Cost tweaks
realforest2001 Nov 1, 2023
eecd640
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Dec 1, 2023
7ef1235
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Dec 26, 2023
dd6ec46
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Jan 2, 2024
0634582
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Jan 24, 2024
05080cc
fixes
realforest2001 Jan 24, 2024
6e59b72
Gloves are back
realforest2001 Jan 24, 2024
2ae4864
tweaks
realforest2001 Jan 24, 2024
3f6da82
w
realforest2001 Jan 24, 2024
819df27
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Mar 27, 2024
b4350db
Merge branch 'master' into project/SIMIBracerPublic
realforest2001 Apr 3, 2024
d14897c
test
realforest2001 Apr 3, 2024
30085f4
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Jul 30, 2024
8c8c94e
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Aug 3, 2024
d47f9a0
f
realforest2001 Aug 3, 2024
8a5ed56
Update code/game/machinery/vending/vendor_types/crew/synthetic.dm
realforest2001 Aug 13, 2024
4a21dac
Update code/game/machinery/vending/vendor_types/crew/synthetic.dm
realforest2001 Aug 13, 2024
39af8a5
smartpack
realforest2001 Aug 13, 2024
93830af
x
realforest2001 Aug 19, 2024
ca990b2
Merge branch 'master' into project/SIMIBracerPublic
realforest2001 Aug 19, 2024
483b6bc
anchor fix and on-mob sprite tweaks
realforest2001 Aug 19, 2024
1451014
fix
realforest2001 Aug 19, 2024
a8e8d7e
drop fix
realforest2001 Aug 23, 2024
a390c58
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Aug 24, 2024
ae1e640
fix 2.0
realforest2001 Aug 24, 2024
cf39aa2
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Sep 8, 2024
1c7d403
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Sep 28, 2024
2dfc423
Merge remote-tracking branch 'cmss13-devs/master' into project/SIMIBr…
realforest2001 Oct 16, 2024
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
35 changes: 17 additions & 18 deletions code/game/machinery/vending/vendor_types/crew/synthetic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@
//------------CLOTHING VENDOR---------------

GLOBAL_LIST_INIT(cm_vending_clothing_synth, list(
list("EXPERIMENTAL TOOL TOKEN (TAKE ALL)", 0, null, null, null),
list("EXPERIMENTAL TOOLS (TAKE ALL)", 0, null, null, null),
list("Experimental Tool Vendor Token", 0, /obj/item/coin/marine/synth, MARINE_CAN_BUY_ESSENTIALS, VENDOR_ITEM_MANDATORY),
list("PK-130 SIMI wrist-mounted computer", 0, /obj/item/clothing/gloves/synth, MARINE_CAN_BUY_GLOVES, VENDOR_ITEM_MANDATORY),
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved

list("RADIO (TAKE ALL)", 0, null, null, null),
list("Headset", 0, /obj/item/device/radio/headset/almayer/mcom/cdrcom, MARINE_CAN_BUY_EAR, VENDOR_ITEM_MANDATORY),
Expand Down Expand Up @@ -124,17 +125,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_synth, list(
list("M3A1 Pattern Synthetic Utility Vest (UA Snow)", 0, /obj/item/clothing/suit/storage/marine/light/synvest/snow, MARINE_CAN_BUY_ARMOR, VENDOR_ITEM_REGULAR),
list("M3A1 Pattern Synthetic Utility Vest (UA Desert)", 0, /obj/item/clothing/suit/storage/marine/light/synvest/desert, MARINE_CAN_BUY_ARMOR, VENDOR_ITEM_REGULAR),

list("GLOVES (CHOOSE 1)", 0, null, null, null),
list("Insulated Gloves", 0, /obj/item/clothing/gloves/yellow, MARINE_CAN_BUY_GLOVES, VENDOR_ITEM_RECOMMENDED),
list("Black Gloves", 0, /obj/item/clothing/gloves/black, MARINE_CAN_BUY_GLOVES, VENDOR_ITEM_REGULAR),
list("Latex Gloves", 0, /obj/item/clothing/gloves/latex, MARINE_CAN_BUY_GLOVES, VENDOR_ITEM_REGULAR),

list("BACKPACK (CHOOSE 1)", 0, null, null, null),
list("Smartpack, Blue", 0, /obj/item/storage/backpack/marine/smartpack, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_REGULAR),
list("Smartpack, Green", 0, /obj/item/storage/backpack/marine/smartpack/green, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_REGULAR),
list("Smartpack, Tan", 0, /obj/item/storage/backpack/marine/smartpack/tan, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_REGULAR),
list("Smartpack, White", 0, /obj/item/storage/backpack/marine/smartpack/white, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_REGULAR),
list("Smartpack, Black", 0, /obj/item/storage/backpack/marine/smartpack/black, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_REGULAR),
list("Logistics IMP Backpack", 0, /obj/item/storage/backpack/marine/satchel/big, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_REGULAR),
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved

list("BELT (CHOOSE 1)", 0, null, null, null),
Expand Down Expand Up @@ -346,16 +337,24 @@ GLOBAL_LIST_INIT(cm_vending_clothing_synth_snowflake, list(

/obj/structure/machinery/cm_vending/own_points/experimental_tools/get_listed_products(mob/user)
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
return list(
list("Autocompressor", 15, /obj/item/clothing/suit/auto_cpr, null, VENDOR_ITEM_REGULAR),
list("PK-130 CIRCUIT CHIPS", 0, null, null, null),
list("PK-130 Repair Mode", 15, /obj/item/device/simi_chip/repair, null, VENDOR_ITEM_RECOMMENDED),
list("PK-130 Protection Mode", 15, /obj/item/device/simi_chip/protect, null, VENDOR_ITEM_REGULAR),
list("PK-130 Anchor Mode", 15, /obj/item/device/simi_chip/anchor, null, VENDOR_ITEM_REGULAR),
list("PK-130 Motion Detector", 5, /obj/item/device/simi_chip/motion_detector, null, VENDOR_ITEM_REGULAR),
list("UTILITY & SELF DEFENSE TOOLS", 0, null, null, null),
list("Telescopic Baton", 15, /obj/item/weapon/telebaton, null, VENDOR_ITEM_REGULAR),
list("Experimental Meson Goggles", 5, /obj/item/clothing/glasses/night/experimental_mesons, null, VENDOR_ITEM_REGULAR),
list("MEDICAL TOOLS", 0, null, null, null),
list("Autocompressor", 10, /obj/item/clothing/suit/auto_cpr, null, VENDOR_ITEM_REGULAR),
list("Backpack Firefighting Watertank", 15, /obj/item/reagent_container/glass/watertank/atmos, null, VENDOR_ITEM_REGULAR),
list("Breaching Hammer", 15, /obj/item/weapon/twohanded/breacher/synth, null, VENDOR_ITEM_REGULAR),
list("Compact Defibrillator", 15, /obj/item/device/defibrillator/compact, null, VENDOR_ITEM_REGULAR),
list("Crew Monitor", 5, /obj/item/tool/crew_monitor, null, VENDOR_ITEM_REGULAR),
list("Portable Dialysis Machine", 10, /obj/item/tool/portadialysis, null, VENDOR_ITEM_REGULAR),
list("CONSTRUCTION TOOLS", 0, null, null, null),
list("Breaching Hammer", 15, /obj/item/weapon/twohanded/breacher/synth, null, VENDOR_ITEM_REGULAR),
list("Compact Nailgun kit", 15, /obj/effect/essentials_set/cnailgun, null, VENDOR_ITEM_REGULAR),
list("Crew Monitor", 15, /obj/item/tool/crew_monitor, null, VENDOR_ITEM_REGULAR),
list("Experimental Meson Goggles", 15, /obj/item/clothing/glasses/night/experimental_mesons, null, VENDOR_ITEM_REGULAR),
list("Maintenance Jack", 15, /obj/item/maintenance_jack, null, VENDOR_ITEM_REGULAR),
list("Portable Dialysis Machine", 15, /obj/item/tool/portadialysis, null, VENDOR_ITEM_REGULAR),
list("Telescopic Baton", 15, /obj/item/weapon/telebaton, null, VENDOR_ITEM_REGULAR),
list("Maintenance Jack", 10, /obj/item/maintenance_jack, null, VENDOR_ITEM_REGULAR),
)

//------------EXPERIMENTAL TOOL KITS---------------
Expand Down
6 changes: 4 additions & 2 deletions code/game/objects/items/devices/motion_detector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@
if(ishuman(loc))
return loc

/obj/item/device/motiondetector/sg
/obj/item/device/motiondetector/integrated
name = "integrated motion detector"
desc = "A motion sensing component from another device."

/obj/item/device/motiondetector/sg/get_user()
/obj/item/device/motiondetector/integrated/get_user()
var/atom/A = loc
if(ishuman(A.loc))
return A.loc
Expand Down
44 changes: 44 additions & 0 deletions code/game/objects/items/tools/synth_bracer/_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Possible Bracer Colors
#define SIMI_COLOR_DEFAULT "default"
#define SIMI_COLOR_WHITE "white"

/// Loads/Reloads the available actions on the computer itself.
#define SIMI_ACTIONS_LOAD "load"
#define SIMI_ACTIONS_RELOAD "reload"
/// Cleans and then adds actions to the user.
#define SIMI_ACTIONS_ADD "add"
/// Removes actions from the user.
#define SIMI_ACTIONS_REMOVE "remove"

/// No active module.
#define SIMI_ACTIVE_NONE "none"

// Primary Abilities
#define SIMI_PRIMARY_ACTION "primary"

/// Synth self-repair
#define SIMI_ABILITY_REPAIR "repair"
#define SIMI_REPAIR_COST 100

/// Synth fortify, enforced stationary
#define SIMI_ABILITY_ANCHOR "anchor"
#define SIMI_IMMOBILE_COST 20

/// Damage reduced but incapable of self defense.
#define SIMI_ABILITY_PROTECT "protect"
#define SIMI_PROTECTIVE_COST 50

// Secondary Abilities
#define SIMI_SECONDARY_ACTION "secondary"

/// Rescue hook.
#define SIMI_SECONDARY_HOOK "hook"
/// Motion Detector
#define SIMI_SECONDARY_MD "motion"

// Statuses
#define SIMI_STATUS_IDLE "status_idle"
#define SIMI_STATUS_NOACCESS "status_unauthorized"
#define SIMI_STATUS_LOWPOWER "status_lowbattery"
#define SIMI_STATUS_NOPOWER "status_nobattery"
#define SIMI_STATUS_CHARGING "status_charging"
34 changes: 34 additions & 0 deletions code/game/objects/items/tools/synth_bracer/abilities/chips.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/obj/item/device/simi_chip
name = "PK-130 SIMI programmable circuit (NOT FOR USE)"
desc = "A programmable computer circuit used within the PK-130 SINI wrist-mounted computer to add or unlock various functions."
icon = 'icons/obj/items/synth/bracer.dmi'
icon_state = "simi_chip_white"

/// The action this chip will add to the SIMI
var/chip_action = /datum/action/human_action
/// If this chip is 'secret' or not (cannot be removed/one time use)
var/secret = FALSE

/obj/item/device/simi_chip/repair
name = "PK-130 SIMI programmable circuit (Self-Repair)"
chip_action = /datum/action/human_action/synth_bracer/repair_form
icon_state = "simi_chip_red"

/obj/item/device/simi_chip/protect
name = "PK-130 SIMI programmable circuit (Damage Bracing)"
icon_state = "simi_chip_blue"
chip_action = /datum/action/human_action/synth_bracer/protective_form

/obj/item/device/simi_chip/anchor
name = "PK-130 SIMI programmable circuit (Anchor)"
icon_state = "simi_chip_blue"
chip_action = /datum/action/human_action/synth_bracer/anchor_form

/obj/item/device/simi_chip/rescue_hook
name = "PK-130 SIMI programmable circuit (Rescue Hook)"
chip_action = /datum/action/human_action/activable/synth_bracer/rescue_hook

/obj/item/device/simi_chip/motion_detector
name = "PK-130 SIMI programmable circuit (Motion Detector)"
chip_action = /datum/action/human_action/synth_bracer/motion_detector
desc = "A programmable computer circuit used within the PK-130 SINI wrist-mounted computer to add or unlock various functions. This one activates a motion detector capability, at a running cost of power."
192 changes: 192 additions & 0 deletions code/game/objects/items/tools/synth_bracer/abilities/framework.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
/* -- ACTIVATABLE ACTIONS -- */

/datum/action/human_action/activable/synth_bracer
icon_file = 'icons/obj/items/synth/bracer.dmi'
var/mob/living/carbon/human/synth
var/obj/item/clothing/gloves/synth/synth_bracer
var/charge_cost = 0
var/handles_cooldown = FALSE
var/handles_charge_cost = FALSE
/// What cateogry of action it is. Can only have one active action from each type.
var/category = SIMI_SECONDARY_ACTION
var/human_adaptable = FALSE

/datum/action/human_action/activable/synth_bracer/give_to(user)
/// never add a check to see if the synth has gloves on, because they shouldn't have these abilities while not wearing gloves. it should runtime to let us know
synth = user
synth_bracer = synth.gloves
fira marked this conversation as resolved.
Show resolved Hide resolved
if(!issynth(user) && !is_human_usable())
synth = null
synth_bracer = null
return FALSE
return ..()

/datum/action/human_action/activable/synth_bracer/remove_from(mob/living/carbon/human/H)
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
synth = null
synth_bracer = null
return ..()

/datum/action/human_action/activable/synth_bracer/Destroy()
synth = null
synth_bracer = null
return ..()

/datum/action/human_action/activable/synth_bracer/use_ability(mob/M)
if(!can_use_action())
return FALSE
if(synth_bracer.battery_charge < charge_cost)
to_chat(synth, SPAN_WARNING("You don't have enough charge to to do this! Charge: <b>[synth_bracer.battery_charge]/[synth_bracer.battery_charge_max]</b> you need [SPAN_RED(charge_cost)]."))
return FALSE
if(!handles_cooldown && cooldown)
enter_cooldown()
if(!handles_charge_cost && charge_cost)
synth_bracer.drain_charge(owner, charge_cost)
return TRUE

/datum/action/human_action/activable/synth_bracer/can_use_action()
if(!issynth(owner) && !is_human_usable())
to_chat(owner, SPAN_WARNING("You have no idea how to use this!"))
if(owner.is_mob_incapacitated() || owner.dazed)
to_chat(owner, SPAN_WARNING("You cannot use this action while incapacitated!"))
return FALSE

switch(category)
if(SIMI_PRIMARY_ACTION)
if(synth_bracer.active_ability != SIMI_ACTIVE_NONE)
to_chat(owner, SPAN_WARNING("You cannot use this action while another primary ability is active."))
return FALSE
if(SIMI_SECONDARY_ACTION)
if(synth_bracer.active_utility != SIMI_ACTIVE_NONE)
to_chat(owner, SPAN_WARNING("You cannot use this action while another secondary ability is active."))
return FALSE

if(synth_bracer.battery_charge <= 0)
to_chat(synth, SPAN_WARNING("You cannot do this without power!"))
return FALSE
if(synth_bracer.battery_charge < charge_cost)
to_chat(synth, SPAN_WARNING("You don't have enough charge to to do this! Charge: <b>[synth_bracer.battery_charge]/[synth_bracer.battery_charge_max]</b> you need [SPAN_RED(charge_cost)]."))
return FALSE
if(!action_cooldown_check())
return FALSE
return ..()

/datum/action/human_action/activable/synth_bracer/proc/is_human_usable()
if(human_adaptable && synth_bracer.human_adapted)
return TRUE
return FALSE

/datum/action/human_action/activable/synth_bracer/proc/set_active(category = SIMI_SECONDARY_ACTION, set_ability = SIMI_ACTIVE_NONE)
switch(category)
if(SIMI_PRIMARY_ACTION)
synth_bracer.active_ability = set_ability
if(SIMI_SECONDARY_ACTION)
synth_bracer.active_utility = set_ability
if((synth_bracer.active_ability == SIMI_ACTIVE_NONE) && (synth_bracer.active_utility == SIMI_ACTIVE_NONE))
synth_bracer.flags_item &= ~NODROP
else
synth_bracer.flags_item |= NODROP
synth_bracer.update_icon(synth)

/datum/action/human_action/activable/synth_bracer/proc/set_inactive(category = SIMI_SECONDARY_ACTION)
set_active(category, SIMI_ACTIVE_NONE)
/* -- ON-CLICK ACTIONS -- */

/datum/action/human_action/synth_bracer
icon_file = 'icons/obj/items/synth/bracer.dmi'
var/mob/living/carbon/human/synth
var/obj/item/clothing/gloves/synth/synth_bracer
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
var/ability_used_time = 0
var/charge_cost = 0
var/handles_cooldown = FALSE // whether the cooldown gets handled by the child, or should be done automatically here
var/handles_charge_cost = FALSE
/// What cateogry of action it is. Can only have one active action from each type.
var/category = SIMI_SECONDARY_ACTION
var/human_adaptable = FALSE

/datum/action/human_action/synth_bracer/give_to(user)
synth = user
synth_bracer = synth.gloves
if(!issynth(user) && !is_human_usable())
synth = null
synth_bracer = null
return FALSE
return ..()

/datum/action/human_action/synth_bracer/remove_from(user)
synth = null
synth_bracer = null
return ..()

/datum/action/human_action/synth_bracer/Destroy()
synth = null
synth_bracer = null
return ..()

/datum/action/human_action/synth_bracer/action_cooldown_check()
return ability_used_time <= world.time

/datum/action/human_action/synth_bracer/proc/enter_cooldown(amount = cooldown)
ability_used_time = world.time + amount
update_button_icon()
addtimer(CALLBACK(src, PROC_REF(update_button_icon)), amount)

/datum/action/human_action/synth_bracer/update_button_icon()
if(!button)
return
if(!action_cooldown_check())
button.color = rgb(240,180,0,200)
else
button.color = rgb(255,255,255,255)

/datum/action/human_action/synth_bracer/can_use_action()
if(!issynth(owner) && !is_human_usable())
to_chat(owner, SPAN_WARNING("You have no idea how to use this!"))
if(owner.is_mob_incapacitated() || owner.dazed)
to_chat(owner, SPAN_WARNING("You cannot use this action while incapacitated!"))
return FALSE

switch(category)
if(SIMI_PRIMARY_ACTION)
if(synth_bracer.active_ability != SIMI_ACTIVE_NONE)
to_chat(owner, SPAN_WARNING("You cannot use this action while another primary ability is active."))
return FALSE
if(SIMI_SECONDARY_ACTION)
if(synth_bracer.active_utility != SIMI_ACTIVE_NONE)
to_chat(owner, SPAN_WARNING("You cannot use this action while another secondary ability is active."))
return FALSE

if(synth_bracer.battery_charge <= 0)
to_chat(synth, SPAN_WARNING("You cannot do this without power!"))
return FALSE
if(synth_bracer.battery_charge < charge_cost)
to_chat(synth, SPAN_WARNING("You don't have enough charge to to do this! Charge: <b>[synth_bracer.battery_charge]/[synth_bracer.battery_charge_max]</b> you need [SPAN_RED(charge_cost)]."))
return FALSE
if(!action_cooldown_check())
return FALSE
return ..()

/datum/action/human_action/synth_bracer/action_activate()
if(!handles_cooldown && cooldown)
enter_cooldown()
if(!handles_charge_cost && charge_cost)
synth_bracer.drain_charge(owner, charge_cost)

/datum/action/human_action/synth_bracer/proc/is_human_usable()
if(human_adaptable && synth_bracer.human_adapted)
return TRUE
return FALSE

/datum/action/human_action/synth_bracer/proc/set_active(category = SIMI_SECONDARY_ACTION, set_ability = SIMI_ACTIVE_NONE)
switch(category)
if(SIMI_PRIMARY_ACTION)
synth_bracer.active_ability = set_ability
if(SIMI_SECONDARY_ACTION)
synth_bracer.active_utility = set_ability
if((synth_bracer.active_ability == SIMI_ACTIVE_NONE) && (synth_bracer.active_utility == SIMI_ACTIVE_NONE))
synth_bracer.flags_item &= ~NODROP
else
synth_bracer.flags_item |= NODROP
synth_bracer.update_icon(synth)

/datum/action/human_action/synth_bracer/proc/set_inactive(category = SIMI_SECONDARY_ACTION)
set_active(category, SIMI_ACTIVE_NONE)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/datum/action/human_action/synth_bracer/crew_monitor
name = "View Crew Monitor"
action_icon_state = "crew_monitor"

var/datum/radar/lifeline/radar
human_adaptable = TRUE

/datum/action/human_action/synth_bracer/crew_monitor/New()
..()
radar = new /datum/radar/lifeline(src, "UNSET")

/datum/action/human_action/synth_bracer/crew_monitor/give_to(user)
..()
if(!synth_bracer)
return
radar.holder = synth_bracer
radar.faction = synth_bracer.faction

/datum/action/human_action/synth_bracer/crew_monitor/remove_from(user)
radar.holder = src
radar.faction = "UNSET"
return ..()

/datum/action/human_action/synth_bracer/crew_monitor/Destroy()
QDEL_NULL(radar)
return ..()

/datum/action/human_action/synth_bracer/crew_monitor/action_activate()
..()
if(COOLDOWN_FINISHED(synth_bracer, sound_cooldown))
COOLDOWN_START(synth_bracer, sound_cooldown, 5 SECONDS)
playsound(synth_bracer, 'sound/machines/terminal_processing.ogg', 35, TRUE)
radar.tgui_interact(usr)
Loading
Loading