Files
Aurora.3/code/modules/assembly/holder.dm
T
Batrachophreno af6c74d917 Verb organization stuff (#21131)
Currently, only Preferences Verbs use subcategories. As a result, all
other Verb tabs are only organized alphabetically, meaning that a single
mechanic (ie. languages) has its governing Verbs scattered rather than
grouped together.

Verb organization by Tab handles broad organization - IC, OOC, Objects,
etc.- highly effectively but requires the user to click-navigate to
other Tabs to access any other verbs.

Verb organization within a Tab can be handled by A.) subcategories and
B.) Verb name prefixes (such as Earphones - *****). The first option is
the clearest and cleanest, but consumes additional vertical space. The
second option conserves vertical space at the cost of visual clarity.

This PR attempts to reorganize Verbs by their Tabs, Subcategories, and
prefixes with the following priorities in mind:
- Minimal disruption; any radical change must be justified (don't move
shit around just for the sake of moving shit around.)
- Verbs which share common functions (such as Languages) should be
grouped together.
- Maintainability. Contributors should not need to memorize an
excessively convoluted Subcategories list; Subcategories must be
intuitive and simple.
- Subcategories should be used judiciously when grouping Verbs to
conserve vertical space. Example: Instead of creating a Subcategory for
Emotes, just rename Audible Emote and Visual Emote to Emote (Audible)
and Emote (Visual).
- Subcategories should highlight uncommon or unusual verbs when
reasonable. Example: There are several animal husbandry-related Verbs,
and because most characters will not have access to those verbs
regularly, we can be less conservative with space (because they'll be
gone most of the time) for the sake of emphasizing their availability.

This PR covers the IC, OOC, and Object Tabs.

Subcategories:
OOC.Chat (Chat functions)
- AOOC
- LOOC
- Devsay (moved from Special Verbs)
- Dsay (moved from Special Verbs)
- OOC

OOC.Debug (Fix shit)
- Fit viewport
- Fix chat
- Refresh TGUI

OOC.Round (Round information)
- Check Gamemode Probability
- Check Round Info
- Custom Event Info
- Vote

IC.Antag (Antag verbs w/o their own tab)
- Invite to the Loyalists
- Invite to the Revolutionaries
- Set Ambition

IC.Critters (More critter stuff than you'd expect there to be)
- Befriend Carp (Previous name 'Become Friends')
- Befriend Cat (Previous name 'Become Friends')
- Befriend Dog
- Befriend Ives
- Name Alien Species
- Name Animal

IC.Language (Language-related stuff)
- Check Default Language
- Check Known Languages
- Set Default Language

IC.Maneuver (Movement, positioning, etc.)
- Adjust walk speed
- Do Pushup
- Face Direction
- Look Down
- Look Up
- Move Downwards
- Move Upwards
- Rest

Object.Equipped (Equipped object stuff, mostly for drip)
- Adjust Badge
- Adjust Bag Straps (Backpacks)
- Adjust Goggles
- Adjust Mask
- Adjust Welding Goggles
- Adjust Welding Mask
- Change Glasses Layer
- Change Pants Layer
- Change Wrist Radio Layer
- Change Wristwear Layer
- Check Time
- Flip Badge
- Flip Belt
- Flip Eyepatch
- Flip Hat
- Flip ID card (ID card)
- Flip Radio (Clip-on radio)
- Flip Wristwear
- Fold Collar
- Lock Antenna(e)
- Point At Watch
- Raise Shroud
- Roll Up Cape Mantle
- Roll Up/Down Jumpsuit
- Roll Up/Down Sleeves
- Switch Belt Layer
- Switch ID Layer
- Switch Lanyard Layer
- Switch Shoe Layer
- Toggle Aviators (Like a dozen variants)
- Toggle Ceremonial Garment Lights
- Toggle Coat Buttons
- Toggle Coat Zipper
- Toggle Hair Coverage (For hats helmets etc)
- Toggle Hair Coverage (FOR BABY CARP!!!!!)
- Toggle Helmet Camera
- Toggle Hood
- Toggle Lyodsuit Mask
- Toggle Poncho Tail Coverage
- Toggle Shirt Buttons
- Toggle Suit Sensors
- Toggle Visor (Pilot helmet)
- Toggle Waistcoat Buttons
- Transform Holoclothing
- Voidsuit - Eject Suit Cooler
- Voidsuit - Eject Tank
- Voidsuit - Toggle Helmet

Object.Held (If you're HOLDING it, its probably relevant to you rn)
- Activate Held Object (Silicons; moved from IC)
- Alter Beacon's Signal (Radio beacon)
- Change Bite Size (Utensils)
- Change Pen Colour
- Choose Colour (Paint sprayer)
- Choose Decal (Paint sprayer)
- Choose Direction (Paint sprayer)
- Choose Preset Colour (Paint sprayer)
- Describe Prototype
- Draw Boot Knife
- Empty Bee Net
- Empty Spray Bottle
- Holster
- Name Gun
- Name Prototype
- Plant Flag (Flags)
- Print Plant Report
- Remove Chopsticks
- Remove Top
- Set Detector High-Bound (Light meter)
- Set Detector Low-Bound (Light meter)
- Set Hailer Message (Hailer)
- Set Timer (Timer igniter)
- Set Valve Pressure (Pneumatic cannon)
- Show Held Item
- Spin Cylinder (Revolvers)
- Switch Verbosity (Health analyzer)
- Toggle Chainsaw Power (Chainsaw)
- Toggle Flashlight Brightness (Flashlights)
- Toggle Gun Safety
- Toggle Hazard Vest
- Toggle Pinpointer Mode (Pinpointer)
- Toggle Mister (Backpack water tank. Goes into/out of hands)
- Twist Cap
- Use Scope
- Wield Pick/Drill
- Wield Two-Handed Weapon (Two-handed weapons)

Object.Cards (I fucking hate cards!!!)
- Deck - Deal
- Deck - Draw
- Deck - Pick
- Hand - Pick
- Turn Hand Into Deck

Object.Earphones (Enough here to separate out)
- Eject Music Cartridge
- Change Volume
- Next Song
- Pause/Unpause
- Play/Stop
- Previous Song

Object.Jetpack (This is probably really important to see quickly)
- Toggle Jetpack
- Toggle Jetpack Stabilization

Object.Tape Recorder (Enough here to separate out)
- Start Recording
- Stop Recording
- Clear Memory
- Playback Memory
- Print Transcript
- Eject Portable Storage

**IC tab example:**
<img width="1061" height="277" alt="Screenshot 2025-08-09 101813"
src="https://github.com/user-attachments/assets/a2afe92d-34fd-4160-bf68-b459a4195e26"
/>
**Objects tab example:**
<img width="1100" height="472" alt="Screenshot 2025-08-09 101807"
src="https://github.com/user-attachments/assets/a36e4c76-594e-4569-93ba-ffcda57e8760"
/>
2025-08-11 15:12:56 +00:00

260 lines
7.0 KiB
Plaintext

/obj/item/device/assembly_holder
name = "assembly"
icon = 'icons/obj/assemblies/new_assemblies.dmi'
icon_state = "holder"
item_state = "assembly"
obj_flags = OBJ_FLAG_CONDUCTABLE
movable_flags = MOVABLE_FLAG_PROXMOVE
throwforce = 5
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 10
var/secured = FALSE
var/obj/item/device/assembly/a_left = null
var/obj/item/device/assembly/a_right = null
var/obj/special_assembly = null
/obj/item/device/assembly_holder/feedback_hints(mob/user, distance, is_adjacent)
. += ..()
if(distance <= 1 || src.loc == user)
if (src.secured)
. += SPAN_NOTICE("\The [src] is ready!")
else
. += SPAN_NOTICE("\The [src] can be attached!")
/obj/item/device/assembly_holder/Initialize(mapload, ...)
. = ..()
become_hearing_sensitive()
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
)
AddElement(/datum/element/connect_loc, loc_connections)
/obj/item/device/assembly_holder/Destroy()
lose_hearing_sensitivity()
QDEL_NULL(a_left)
QDEL_NULL(a_right)
QDEL_NULL(special_assembly)
. = ..()
/obj/item/device/assembly_holder/proc/detached()
if(a_left)
a_left.holder_movement()
if(a_right)
a_right.holder_movement()
return
/obj/item/device/assembly_holder/IsAssemblyHolder()
return TRUE
/obj/item/device/assembly_holder/proc/attach(var/obj/item/device/assembly/D, var/obj/item/device/assembly/D2, var/mob/user)
if(!istype(D) || !istype(D2))
return FALSE
if(D.secured || D2.secured)
return FALSE
if(user)
user.remove_from_mob(D)
user.remove_from_mob(D2)
D.holder = src
D2.holder = src
D.forceMove(src)
D2.forceMove(src)
a_left = D
a_right = D2
name = "[D.name]-[D2.name] assembly"
update_icon()
user.put_in_hands(src)
return TRUE
/obj/item/device/assembly_holder/proc/attach_special(var/obj/O, var/mob/user)
if(!O)
return
if(!O.IsSpecialAssembly())
return FALSE
/obj/item/device/assembly_holder/update_icon()
ClearOverlays()
if(a_left)
AddOverlays("[a_left.icon_state]_left")
for(var/O in a_left.attached_overlays)
AddOverlays("[O]_l")
if(a_right)
AddOverlays("[a_right.icon_state]_right")
for(var/O in a_right.attached_overlays)
AddOverlays("[O]_r")
if(master)
master.update_icon()
/obj/item/device/assembly_holder/HasProximity(atom/movable/AM as mob|obj)
if(a_left)
a_left.HasProximity(AM)
if(a_right)
a_right.HasProximity(AM)
if(special_assembly)
special_assembly.HasProximity(AM)
/obj/item/device/assembly_holder/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs)
SIGNAL_HANDLER
if(a_left)
a_left.on_entered(source, arrived, old_loc, old_locs)
if(a_right)
a_right.on_entered(source, arrived, old_loc, old_locs)
/obj/item/device/assembly_holder/on_found(mob/finder)
if(a_left)
a_left.on_found(finder)
if(a_right)
a_right.on_found(finder)
if(special_assembly)
if(istype(special_assembly, /obj/item))
var/obj/item/S = special_assembly
S.on_found(finder)
/obj/item/device/assembly_holder/Move()
. = ..()
if(a_left && a_right)
a_left.holder_movement()
a_right.holder_movement()
/obj/item/device/assembly_holder/attack_hand()//Perhapse this should be a holder_pickup proc instead, can add if needbe I guess
if(a_left && a_right)
a_left.holder_movement()
a_right.holder_movement()
return ..()
/obj/item/device/assembly_holder/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.isscrewdriver())
if(!a_left || !a_right)
to_chat(user, SPAN_DANGER("BUG: Assembly part missing, please report this!"))
return
a_left.toggle_secure()
a_right.toggle_secure()
secured = !secured
if(secured)
to_chat(user, SPAN_NOTICE("\The [src] is ready!"))
else
to_chat(user, SPAN_NOTICE("\The [src] can now be taken apart!"))
update_icon()
return
else if(attacking_item.IsSpecialAssembly())
attach_special(attacking_item, user)
else
return ..()
/obj/item/device/assembly_holder/attack_self(mob/user)
add_fingerprint(user)
if(secured)
if(!a_left || !a_right)
to_chat(user, SPAN_WARNING("Assembly part missing!"))
return
if(istype(a_left, a_right.type)) //If they are the same type it causes issues due to window code
switch(alert("Which side would you like to use?",,"Left","Right"))
if("Left")
a_left.attack_self(user)
if("Right")
a_right.attack_self(user)
return
else
if(!istype(a_left, /obj/item/device/assembly/igniter))
a_left.attack_self(user)
if(!istype(a_right, /obj/item/device/assembly/igniter))
a_right.attack_self(user)
else
var/turf/T = get_turf(src)
if(!T)
return FALSE
if(a_left)
a_left.holder = null
a_left.forceMove(T)
a_left = null
if(a_right)
a_right.holder = null
a_right.forceMove(T)
a_right = null
qdel(src)
/obj/item/device/assembly_holder/proc/process_activation(var/obj/D, var/normal = 1, var/special = 1)
if(!D)
return FALSE
if(!secured)
audible_message("[icon2html(src, viewers(get_turf(src)))] *beep* *beep*", "*beep* *beep*")
if(normal && a_right && a_left)
if(a_right != D)
a_right.pulsed(FALSE)
if(a_left != D)
a_left.pulsed(FALSE)
if(master)
master.receive_signal()
return TRUE
/obj/item/device/assembly_holder/hear_talk(mob/living/M, msg, verb, datum/language/speaking)
if(a_right)
a_right.hear_talk(M, msg, verb, speaking)
if(a_left)
a_left.hear_talk(M, msg, verb, speaking)
/obj/item/device/assembly_holder/timer_igniter
name = "timer-igniter assembly"
/obj/item/device/assembly_holder/timer_igniter/Initialize(mapload, ...)
. = ..()
var/obj/item/device/assembly/igniter/ign = new(src)
ign.secured = TRUE
ign.holder = src
var/obj/item/device/assembly/timer/tmr = new(src)
tmr.time = 5
tmr.secured = TRUE
tmr.holder = src
START_PROCESSING(SSprocessing, tmr)
a_left = tmr
a_right = ign
secured = TRUE
update_icon()
name = "[initial(name)] ([tmr.time] secs)"
loc.verbs += /obj/item/device/assembly_holder/timer_igniter/verb/configure
/obj/item/device/assembly_holder/timer_igniter/detached()
loc.verbs -= /obj/item/device/assembly_holder/timer_igniter/verb/configure
..()
/obj/item/device/assembly_holder/timer_igniter/verb/configure()
set name = "Set Timer"
set category = "Object.Held"
set src in usr
if(!(usr.stat || usr.restrained()))
var/obj/item/device/assembly_holder/holder
if(istype(src,/obj/item/grenade/chem_grenade))
var/obj/item/grenade/chem_grenade/gren = src
holder = gren.detonator
var/obj/item/device/assembly/timer/tmr = holder.a_left
if(!istype(tmr, /obj/item/device/assembly/timer))
tmr = holder.a_right
if(!istype(tmr, /obj/item/device/assembly/timer))
to_chat(usr, SPAN_WARNING("This detonator has no timer."))
return
if(tmr.timing)
to_chat(usr, SPAN_WARNING("The timer has already been activated."))
else
var/ntime = input("Enter desired time in seconds", "Time", "5") as num
ntime = clamp(ntime, 5, 1000)
tmr.time = ntime
name = "[initial(name)] ([tmr.time] secs)"
to_chat(usr, SPAN_NOTICE("Timer set to [tmr.time] seconds."))
else
to_chat(usr, SPAN_WARNING("You cannot do this while [usr.stat ? "unconscious/dead" : "restrained"]."))