mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-27 03:56:29 +01:00
line endings
This commit is contained in:
@@ -0,0 +1,198 @@
|
||||
|
||||
// The base subtype for assemblies that can be worn. Certain pieces will have more or less capabilities
|
||||
// E.g. Glasses have less room than something worn over the chest.
|
||||
// Note that the electronic assembly is INSIDE the object that actually gets worn, in a similar way to implants.
|
||||
|
||||
/obj/item/electronic_assembly/clothing
|
||||
name = "electronic clothing"
|
||||
icon_state = "circuitry" // Needs to match the clothing's base icon_state.
|
||||
desc = "It's a case, for building machines attached to clothing."
|
||||
w_class = ITEMSIZE_SMALL
|
||||
max_components = IC_COMPONENTS_BASE
|
||||
max_complexity = IC_COMPLEXITY_BASE
|
||||
var/obj/item/clothing/clothing = null
|
||||
|
||||
/obj/item/electronic_assembly/clothing/nano_host()
|
||||
return clothing
|
||||
|
||||
/obj/item/electronic_assembly/clothing/resolve_nano_host()
|
||||
return clothing
|
||||
|
||||
/obj/item/electronic_assembly/clothing/update_icon()
|
||||
..()
|
||||
clothing.icon_state = icon_state
|
||||
// We don't need to update the mob sprite since it won't (and shouldn't) actually get changed.
|
||||
|
||||
// This is 'small' relative to the size of regular clothing assemblies.
|
||||
/obj/item/electronic_assembly/clothing/small
|
||||
max_components = IC_COMPONENTS_BASE / 2
|
||||
max_complexity = IC_COMPLEXITY_BASE / 2
|
||||
w_class = ITEMSIZE_TINY
|
||||
|
||||
// Ditto.
|
||||
/obj/item/electronic_assembly/clothing/large
|
||||
max_components = IC_COMPONENTS_BASE * 2
|
||||
max_complexity = IC_COMPLEXITY_BASE * 2
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
|
||||
|
||||
// This is defined higher up, in /clothing to avoid lots of copypasta.
|
||||
/obj/item/clothing
|
||||
var/obj/item/electronic_assembly/clothing/IC = null
|
||||
var/obj/item/integrated_circuit/built_in/action_button/action_circuit = null // This gets pulsed when someone clicks the button on the hud.
|
||||
|
||||
/obj/item/clothing/emp_act(severity)
|
||||
if(IC)
|
||||
IC.emp_act(severity)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/examine(mob/user)
|
||||
if(IC)
|
||||
IC.examine(user)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/attackby(obj/item/I, mob/user)
|
||||
if(IC)
|
||||
// This needs to be done in a better way...
|
||||
if(I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/cell/device) || istype(I, /obj/item/integrated_electronics) )
|
||||
IC.attackby(I, user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/clothing/attack_self(mob/user)
|
||||
if(IC)
|
||||
if(IC.opened)
|
||||
IC.attack_self(user)
|
||||
else
|
||||
action_circuit.do_work()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/clothing/Moved(oldloc)
|
||||
if(IC)
|
||||
IC.on_loc_moved(oldloc)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/clothing/on_loc_moved(oldloc)
|
||||
if(IC)
|
||||
IC.on_loc_moved(oldloc)
|
||||
else
|
||||
..()
|
||||
|
||||
// Does most of the repeatative setup.
|
||||
/obj/item/clothing/proc/setup_integrated_circuit(new_type)
|
||||
// Set up the internal circuit holder.
|
||||
IC = new new_type(src)
|
||||
IC.clothing = src
|
||||
IC.name = name
|
||||
|
||||
// Clothing assemblies can be triggered by clicking on the HUD. This allows that to occur.
|
||||
action_circuit = new(src.IC)
|
||||
IC.force_add_circuit(action_circuit)
|
||||
action_button_name = "Activate [name]"
|
||||
|
||||
/obj/item/clothing/Destroy()
|
||||
if(IC)
|
||||
IC.clothing = null
|
||||
action_circuit = null // Will get deleted by qdel-ing the IC assembly.
|
||||
qdel(IC)
|
||||
return ..()
|
||||
|
||||
// Specific subtypes.
|
||||
|
||||
// Jumpsuit.
|
||||
/obj/item/clothing/under/circuitry
|
||||
name = "electronic jumpsuit"
|
||||
desc = "It's a wearable case for electronics. This on is a black jumpsuit with wiring weaved into the fabric."
|
||||
icon_state = "circuitry"
|
||||
worn_state = "circuitry"
|
||||
|
||||
/obj/item/clothing/under/circuitry/Initialize(mapload)
|
||||
setup_integrated_circuit(/obj/item/electronic_assembly/clothing)
|
||||
return ..()
|
||||
|
||||
|
||||
// Gloves.
|
||||
/obj/item/clothing/gloves/circuitry
|
||||
name = "electronic gloves"
|
||||
desc = "It's a wearable case for electronics. This one is a pair of black gloves, with wires woven into them. A small \
|
||||
device with a screen is attached to the left glove."
|
||||
icon_state = "circuitry"
|
||||
item_state = "circuitry"
|
||||
|
||||
/obj/item/clothing/gloves/circuitry/Initialize(mapload)
|
||||
setup_integrated_circuit(/obj/item/electronic_assembly/clothing/small)
|
||||
return ..()
|
||||
|
||||
// Watch.
|
||||
/obj/item/clothing/gloves/ewatch
|
||||
name = "electronic watch"
|
||||
desc = "It's a wearable case for electronics. This one is a digital watch, with an antenna and button array attatched to it.\
|
||||
Practical and stylish!"
|
||||
icon_state = "communicator"
|
||||
item_state = "ewatch"
|
||||
|
||||
/obj/item/clothing/gloves/circuitry/Initialize(mapload)
|
||||
setup_integrated_circuit(/obj/item/electronic_assembly/clothing/small)
|
||||
return ..()
|
||||
|
||||
// Glasses.
|
||||
/obj/item/clothing/glasses/circuitry
|
||||
name = "electronic goggles"
|
||||
desc = "It's a wearable case for electronics. This one is a pair of goggles, with wiring sticking out. \
|
||||
Could this augment your vision?" // Sadly it won't, or at least not yet.
|
||||
icon_state = "circuitry"
|
||||
item_state = "night" // The on-mob sprite would be identical anyways.
|
||||
|
||||
/obj/item/clothing/glasses/circuitry/Initialize(mapload)
|
||||
setup_integrated_circuit(/obj/item/electronic_assembly/clothing/small)
|
||||
return ..()
|
||||
|
||||
// Shoes
|
||||
/obj/item/clothing/shoes/circuitry
|
||||
name = "electronic boots"
|
||||
desc = "It's a wearable case for electronics. This one is a pair of boots, with wires attached to a small \
|
||||
cover."
|
||||
icon_state = "circuitry"
|
||||
item_state = "circuitry"
|
||||
|
||||
/obj/item/clothing/shoes/circuitry/Initialize(mapload)
|
||||
setup_integrated_circuit(/obj/item/electronic_assembly/clothing/small)
|
||||
return ..()
|
||||
|
||||
// Head
|
||||
/obj/item/clothing/head/circuitry
|
||||
name = "electronic headwear"
|
||||
desc = "It's a wearable case for electronics. This one appears to be a very technical-looking piece that \
|
||||
goes around the collar, with a heads-up-display attached on the right."
|
||||
icon_state = "circuitry"
|
||||
item_state = "circuitry"
|
||||
|
||||
/obj/item/clothing/head/circuitry/Initialize(mapload)
|
||||
setup_integrated_circuit(/obj/item/electronic_assembly/clothing/small)
|
||||
return ..()
|
||||
|
||||
// Ear
|
||||
/obj/item/clothing/ears/circuitry
|
||||
name = "electronic earwear"
|
||||
desc = "It's a wearable case for electronics. This one appears to be a technical-looking headset."
|
||||
icon = 'icons/obj/clothing/ears.dmi'
|
||||
icon_state = "circuitry"
|
||||
item_state = "circuitry"
|
||||
|
||||
/obj/item/clothing/ears/circuitry/Initialize(mapload)
|
||||
setup_integrated_circuit(/obj/item/electronic_assembly/clothing/small)
|
||||
return ..()
|
||||
|
||||
// Exo-slot
|
||||
/obj/item/clothing/suit/circuitry
|
||||
name = "electronic chestpiece"
|
||||
desc = "It's a wearable case for electronics. This one appears to be a very technical-looking vest, that \
|
||||
almost looks professionally made, however the wiring popping out betrays that idea."
|
||||
icon_state = "circuitry"
|
||||
item_state = "circuitry"
|
||||
|
||||
/obj/item/clothing/suit/circuitry/Initialize(mapload)
|
||||
setup_integrated_circuit(/obj/item/electronic_assembly/clothing/large)
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user