Files
CHOMPStation2/code/game/machinery/frame.dm
Cameron653 28175d86c7 Late September Sync (#579)
* Elevators aren't bottomless voids!

* Updates changelog

* Sombrero Code

* Fixes #2365

* Adds changelog

* Sleeper is evil.

* no message

* Changelog

* Stops observers from leaving prints on the ground.

No more spooking the mortals, ghosts.

* Allows autotraitor in secret to start with 0 players

* Adds changelog

* Makes diona slightly less slow

* Adds changelog

* Bowling Shirts

* Updates changelog

* Adds a missing description

* Flat Cap Changes and Hair Bow

* Fixed Error

* Adds an in-hand

* Lower Torso cannot be amputated

* Smoke works, adds changelog

* Updates changelog

* Makes Unathi Voidsuits Less Fat

* Medical related fixes

* Fuzzy Cuffs

* Tube Top

* Made Icons for Security Suit Less Gaunt

* Revert "Medical related fixes"

This reverts commit d7c59520e6.

* Just the fix to random med item now

* Adds organ fixing

* Fixes Evening Glove Coloring

* HAZMAT Suits

* Changes Unathi sprite slightly

* Tweaks skirt pathing

* Corrects changelog

* Adds changelog

* Construction Voidsuits

* makes people bleed real good

* adderino changeling

* Biohazard Voidsuit

* Revert "Revert "Adds hub passwordu""

* Explosive implants should no longer gib on limbs.

* Adds space penguins and space geese.

* Revert "Revert "Revert "Adds hub passwordu"""

* Makes flash rounds respect eye protection

* Water > Fire

* There's plenty lying around, I think

* Naming inconsistencies fixed

The short naming of central command has been really inconsistent across
the game's files. This has always annoyed the shit out of me.

CentComm and Centcomm and Centcom are now all CentCom, specifically with
that capitalization. Why one M instead of two M's? Because Comm with two
'M's = Communications. Hence, Telecomms, NOT Telecoms. Telecoms is
incorrect. CentCom was also chosen because CentCom with one M and this
casing is most found throughout the game's files.

Speaking of Telecomms, I corrected one instance in the game where it's
Telecom. Like I said, this is not correct. There was only one
inconsistency.

Likewise, Nanotrasen has been changed to NanoTrasen. Nanotrasen only
appears 20 times, where NanoTrasen appears 62. NanoTrasen is clearly the
preferred, correct naming.

* Almost forgot plural of Telecomm

* Finalizes work, adds designs to research.

* Press Vest

* Removes Mags/Shells, Adds Recorder and Flashlight

* Fixes spans.

* Raises the number of players needed to start Ninja

* Still needs to fix internal bleeding

* Allows Wirer To Attach to Toolbelts

* Fixes #393

* Tweaks FBP temperature

* Corrects Changelog

* Fixes some Advanced Egun oversights

* Embiggens the laser carbine and the lasercannon.

* Messenger Bags

* Health analyzers detect appendicitis

* Custom Circuit Additions & Fixes
Adds Med Scanner and Advanced Med Scanner circuits.
Clock circuit is now functional.
Five second delay will delay for five seconds and not one second.
Renaming circuitry now respects ability to do so (e.g. being alive).
Firing circuit can now be obtained by science normally.
Examining inside assembly cases now requires adjacency.

* More Additions
You can now cancel inputting on a text or numberpad.
Zero is now displayed properly on the UI and not be shown as null.
The small and medium assemblies now have real sprites.
Total health percentage for med scanners and advanced med scanners now reports a proper percentage and not 1 or 0.
The constant memory chip now can be set by using it in hand, making it usable.
The constant memory chip now accepts refs as data to store.  To use, select 'ref' when using inhand, then hit it against the thing you want to store.

* Allows Chemists to View Medical Records on their PDA

* Refactors splinting

* Refactors the forceMove() drop.

Makes dropping a its proc instead, cleaning up forceMove() handling.

* Replaces ORGAN_SPLINTED

* Supportive suits now only loop through bad organs

* Adds changelog

* Lasercannon tweaks

* Bloodloss tweak

* Adds hawaii shirt

Attachable to any uniform, works like suit jackets.

* Changelog cause why not

At this rate I'll forget how to do those otherwise

* Adds randomized alohas

Also some color matrix helpers from TG

* Appendicitis doesn't cancel itself out.

* Removes debug stuff

* Radsuit Sprite Changes

* Allows us to actually use the messenger bags

* Fixes spelling mistake

* Ported ventcrawling from vg.

* Fixes changelog errors

* Updates changelog

* Tweaks vent crawling.

The ability to ventcrawl is now checked by the /handle_ventcrawl() proc, making it possible to properly check before and after the do_after() call.
Moves various checks into the base can_ventcrawl proc.
Now lists the first object that prevents a mob from ventcrawling, making it easier to correct the exception list.
Removes the issmall() check, instead checks if the crawling mob has the relevant verb. Fixes #14081.

* Suit Storage Items

* Adds in IB removal

* More Circuit Things
Adds Locomotion circuit, which makes the machine move in a given direction.
Adds Signaler circuit, which can send and receive signals from a signaler.
Adds a new tool, the Debugger, which lets one directly set data in a specific pin.  It can also pulse activation pins.
Adds ability to define custom cooldown times for each component.
Smoke generator now has a 30 second cooldown.
Cleans up some code somewhat.

* Adds design for locomotion circuit.

* Cleans up code

* Even more sprites by Mechoid.
Fixes abs to rel converter.

* Black Messenger Bag

* Powersink fix

* Even More Sodding Circuits
Adds new RNG circuit, to make random numbers each time.
Adds new Concatenating circuit, so you can make lots of small strings into one big one.
Adds new light and advanced light circuit.  Basic just has a normal light that can be toggled.  Advanced allows it to be any color using RGB, and a brightness between 0 and 6.
New sprites for the debugger and wirer, by Mechoid.
Hopefully finally fixes smoke generator from being unobtainable.

* Adds basic circuit kit and spare circuit tools to Tech Storage.

* Part the first

* Changelog

* Allows robots to be constructed with prosthetic limbs as well as borg limbs.

* Map change

* Secbelt can hold stun revolvers and eguns

* Voidsuit Sprite Changes

* Tweaks burst laser

* Lasers, energy projectiles, and muzzle flashes now produce light.

It's a bit wonky due to lighting only updating once every half-second,
but it's very much functional, at least on my desktop.

* Adds bridge bunnies

* Slightly cleans up the occupation screen, adds uniform to locker

* Map Changes

* Adds Changelog

* Fixes stuff

* Allows jobbanning of cargo department jobs

* Re-adds balance changes to heavy lasers.

They got changed by accident when I did the laser light show.
Also, adds changelogs for my last couple changes, because I'm an
    idiot and forgot them.

* Fixed missing sprite

* Dress Loadout Additions

* I Can't Believe It's Not Circuits (it is)
Fixes numberpad and letterpad pulsing.
Debugger and Constant chip can now have null written to it.
Adds new sound output, with two types so far.  One being the 'beeper' type, which can do things like buzz, ping, beep, etc.  The second type is a securitron speaker, which allows us to get closer to building a functioning Beepsky.

* Adds EPv2 Circuit
Adds a circuit that allows it to send and receive EPv2 messages, allowing for a more robust transmission of data that signalers cannot deliver.  Bonus: Communicators can send text messages to custom machines using this.

* Updates changelog

* Fixes not being able to put things in medkits.

* Technomancer Tweaks

Cost for various spells and equipment adjusted greatly.  In general, things are cheaper, and everything should now be in multiples of 25, so no points are wasted.
The default jumpsuit for Technomancers is now heavily insulated, protecting them from tasers, batons, and perhaps unfortunate lightning strikes.
Instability between 31 and 50 made less harsh.
Wards made with a scepter of enhancement will break the cloak of anyone invisible that it can see.
Fire aura buffed, increased rate of heating as well as temperature cap for both non-scepter and scepter effects.
Reflect spell made more forgiving for the Technomancer, lasting longer before expiring.
Projectile spells should be able to hit people more reliably.

* Shotgun Reloading Tweak
Adds ability to hit a shotgun or similar weapon with a container containing ammo, to load said ammo into the shotgun one at a time automatically, instead of having to play inventory tetris, as requested by some people.

* Use sanitizeName for the guest pass terminal name input to prevent excessively long names.

* Circuit UI and Assembly Tweaks
Adds new drone assembly, which has stats between the medium and large assembly.  Sprites by Mechoid.
Assemblies now have a light UI when examined while opened, which displays what's inside, as well as how close to the cap for parts or complexity you are getting.  Click the names of a component to open the wiring interface for that component.  You can also rename each component from the UI.  Bonus:  Having multiple components of the same name will no longer appear as one component.
Adds ability to rename the assembly, using the new UI.

* Revert "Ported ventcrawling from vg."

* Re-adds a nice, useful macro

* Fixes #2431

* Tweaks Riot armor

* Fixes a typo in the DNA Modifier

* Ripped Jeans (And White Shorts)

* Adds shanking

* Adds changelog

* Removes a stray world <<

* Ported ventcrawling from vg.

* Tweaks vent crawling.

The ability to ventcrawl is now checked by the /handle_ventcrawl() proc, making it possible to properly check before and after the do_after() call.
Moves various checks into the base can_ventcrawl proc.
Now lists the first object that prevents a mob from ventcrawling, making it easier to correct the exception list.
Removes the issmall() check, instead checks if the crawling mob has the relevant verb. Fixes #14081.

* Long, time-consuming not one-line fix

* Makes cigs branded too

Description of cig/cigbutt would reveal its brand for dastardly murdersolving revelations.

* Adding a article

* The door hacker now only pings the user

* Removes implants from Deathsquad

* Adds the ability to apply pressure to bleeding wounds

* Shoes

* EVA rigs should use their default sprites on Taj and Unathi

* Fixing some errors

* Update loadout_xeno.dm

* Delete back_vr.dmi

* Add files via upload
2016-09-24 14:12:43 -04:00

615 lines
17 KiB
Plaintext

/var/global/list/construction_frame_wall
/var/global/list/construction_frame_floor
/proc/populate_frame_types()
//Create global frame type list if it hasn't been made already.
construction_frame_wall = list()
construction_frame_floor = list()
for(var/R in typesof(/datum/frame/frame_types) - /datum/frame/frame_types)
var/datum/frame/frame_types/type = new R
if(type.frame_style == "wall")
construction_frame_wall += type
else
construction_frame_floor += type
var/datum/frame/frame_types/cancel/cancel = new /datum/frame/frame_types/cancel
construction_frame_wall += cancel
construction_frame_floor += cancel
/datum/frame/frame_types
var/name
var/frame_size = 5
var/frame_class
var/circuit
var/frame_style = "floor"
var/x_offset
var/y_offset
/datum/frame/frame_types/computer
name = "Computer"
frame_class = "computer"
/datum/frame/frame_types/machine
name = "Machine"
frame_class = "machine"
/datum/frame/frame_types/conveyor
name = "Conveyor"
frame_class = "machine"
circuit = /obj/item/weapon/circuitboard/conveyor
/datum/frame/frame_types/photocopier
name = "Photocopier"
frame_class = "machine"
/datum/frame/frame_types/washing_machine
name = "Washing Machine"
frame_class = "machine"
/datum/frame/frame_types/medical_console
name = "Medical Console"
frame_class = "computer"
/datum/frame/frame_types/medical_pod
name = "Medical Pod"
frame_class = "machine"
/datum/frame/frame_types/dna_analyzer
name = "DNA Analyzer"
frame_class = "machine"
/datum/frame/frame_types/mass_driver
name = "Mass Driver"
frame_class = "machine"
circuit = /obj/item/weapon/circuitboard/mass_driver
/datum/frame/frame_types/holopad
name = "Holopad"
frame_class = "computer"
frame_size = 4
/datum/frame/frame_types/microwave
name = "Microwave"
frame_class = "machine"
frame_size = 4
/datum/frame/frame_types/fax
name = "Fax"
frame_class = "machine"
frame_size = 3
/datum/frame/frame_types/recharger
name = "Recharger"
frame_class = "machine"
circuit = /obj/item/weapon/circuitboard/recharger
frame_size = 3
/datum/frame/frame_types/grinder
name = "Grinder"
frame_class = "machine"
circuit = /obj/item/weapon/circuitboard/grinder
frame_size = 3
/datum/frame/frame_types/display
name = "Display"
frame_class = "display"
frame_style = "wall"
x_offset = 32
y_offset = 32
/datum/frame/frame_types/supply_request_console
name = "Supply Request Console"
frame_class = "display"
frame_style = "wall"
x_offset = 32
y_offset = 32
/datum/frame/frame_types/atm
name = "ATM"
frame_class = "display"
frame_size = 3
frame_style = "wall"
x_offset = 32
y_offset = 32
/datum/frame/frame_types/newscaster
name = "Newscaster"
frame_class = "display"
frame_size = 3
frame_style = "wall"
x_offset = 28
y_offset = 30
/datum/frame/frame_types/wall_charger
name = "Wall Charger"
frame_class = "machine"
circuit = /obj/item/weapon/circuitboard/recharger/wrecharger
frame_size = 3
frame_style = "wall"
x_offset = 32
y_offset = 32
/datum/frame/frame_types/fire_alarm
name = "Fire Alarm"
frame_class = "alarm"
frame_size = 2
frame_style = "wall"
x_offset = 24
y_offset = 24
/datum/frame/frame_types/air_alarm
name = "Air Alarm"
frame_class = "alarm"
frame_size = 2
frame_style = "wall"
x_offset = 24
y_offset = 24
/datum/frame/frame_types/guest_pass_console
name = "Guest Pass Console"
frame_class = "display"
frame_size = 2
frame_style = "wall"
x_offset = 30
y_offset = 30
/datum/frame/frame_types/intercom
name = "Intercom"
frame_class = "alarm"
frame_size = 2
frame_style = "wall"
x_offset = 28
y_offset = 28
/datum/frame/frame_types/keycard_authenticator
name = "Keycard Authenticator"
frame_class = "alarm"
frame_size = 1
frame_style = "wall"
x_offset = 24
y_offset = 24
/datum/frame/frame_types/cancel //used to get out of input dialogue
name = "Cancel"
/obj/structure/frame
anchored = 0
name = "frame"
icon = 'icons/obj/stock_parts.dmi'
icon_state = "machine_0"
var/state = 0
var/obj/item/weapon/circuitboard/circuit = null
var/need_circuit = 1
var/datum/frame/frame_types/frame_type = new /datum/frame/frame_types/machine
var/list/components = null
var/list/req_components = null
var/list/req_component_names = null
/obj/structure/frame/computer //used for maps
frame_type = new /datum/frame/frame_types/computer
anchored = 1
density = 1
/obj/structure/frame/proc/update_desc()
var/D
if(req_components)
var/list/component_list = new
for(var/I in req_components)
if(req_components[I] > 0)
component_list += "[num2text(req_components[I])] [req_component_names[I]]"
D = "Requires [english_list(component_list)]."
desc = D
/obj/structure/frame/update_icon()
..()
var/type = lowertext(frame_type.name)
type = replacetext(type, " ", "_")
icon_state = "[type]_[state]"
/obj/structure/frame/proc/check_components(mob/user as mob)
components = list()
req_components = circuit.req_components.Copy()
for(var/A in circuit.req_components)
req_components[A] = circuit.req_components[A]
req_component_names = circuit.req_components.Copy()
for(var/A in req_components)
var/obj/ct = A
req_component_names[A] = initial(ct.name)
/obj/structure/frame/New(var/loc, var/dir, var/building = 0, var/datum/frame/frame_types/type, mob/user as mob)
..()
if(building)
frame_type = type
state = 0
if(dir)
set_dir(dir)
if(loc)
src.loc = loc
if(frame_type.x_offset)
pixel_x = (dir & 3)? 0 : (dir == 4 ? -frame_type.x_offset : frame_type.x_offset)
if(frame_type.y_offset)
pixel_y = (dir & 3)? (dir == 1 ? -frame_type.y_offset : frame_type.y_offset) : 0
if(frame_type.circuit)
need_circuit = 0
circuit = new frame_type.circuit(src)
if(frame_type.name == "Computer")
density = 1
if(frame_type.frame_class == "machine")
density = 1
update_icon()
/obj/structure/frame/attackby(obj/item/P as obj, mob/user as mob)
if(istype(P, /obj/item/weapon/wrench))
if(state == 0 && !anchored)
user << "<span class='notice'>You start to wrench the frame into place.</span>"
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20))
anchored = 1
if(!need_circuit && circuit)
state = 2
check_components()
update_desc()
user << "<span class='notice'>You wrench the frame into place and set the outer cover.</span>"
else
user << "<span class='notice'>You wrench the frame into place.</span>"
else if(state == 0 && anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20))
user << "<span class='notice'>You unfasten the frame.</span>"
anchored = 0
else if(istype(P, /obj/item/weapon/weldingtool))
if(state == 0)
var/obj/item/weapon/weldingtool/WT = P
if(WT.remove_fuel(0, user))
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
if(do_after(user, 20))
if(src && WT.isOn())
user << "<span class='notice'>You deconstruct the frame.</span>"
new /obj/item/stack/material/steel(src.loc, frame_type.frame_size)
qdel(src)
return
else if(!WT.remove_fuel(0, user))
user << "The welding tool must be on to complete this task."
return
else if(istype(P, /obj/item/weapon/circuitboard) && need_circuit && !circuit)
if(state == 0 && anchored)
var/obj/item/weapon/circuitboard/B = P
var/datum/frame/frame_types/board_type = B.board_type
if(board_type.name == frame_type.name)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user << "<span class='notice'>You place the circuit board inside the frame.</span>"
circuit = P
user.drop_item()
P.loc = src
state = 1
if(frame_type.frame_class == "machine")
check_components()
update_desc()
else
user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>"
return
else if(istype(P, /obj/item/weapon/screwdriver))
if(state == 1)
if(need_circuit && circuit)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You screw the circuit board into place.</span>"
state = 2
else if(state == 2)
if(need_circuit && circuit)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You unfasten the circuit board.</span>"
state = 1
else if(!need_circuit && circuit)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You unfasten the outer cover.</span>"
state = 0
else if(state == 3)
if(frame_type.frame_class == "machine")
var/component_check = 1
for(var/R in req_components)
if(req_components[R] > 0)
component_check = 0
break
if(component_check)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/machinery/new_machine = new circuit.build_path(src.loc, dir)
// Handle machines that have allocated default parts in thier constructor.
if(new_machine.component_parts)
for(var/CP in new_machine.component_parts)
qdel(CP)
new_machine.component_parts.Cut()
else
new_machine.component_parts = list()
circuit.construct(new_machine)
for(var/obj/O in components)
if(circuit.contain_parts)
O.loc = new_machine
else
O.loc = null
new_machine.component_parts += O
circuit.loc = null
new_machine.circuit = circuit
new_machine.RefreshParts()
new_machine.pixel_x = pixel_x
new_machine.pixel_y = pixel_y
qdel(src)
return
else if(frame_type.frame_class == "alarm")
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You fasten the cover.</span>"
var/obj/machinery/B = new circuit.build_path(src.loc)
B.pixel_x = pixel_x
B.pixel_y = pixel_y
B.set_dir(dir)
circuit.construct(B)
circuit.loc = null
B.circuit = circuit
qdel(src)
return
else if(state == 4)
if(frame_type.frame_class == "computer")
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You connect the monitor.</span>"
var/obj/machinery/B = new circuit.build_path(src.loc)
B.pixel_x = pixel_x
B.pixel_y = pixel_y
B.set_dir(dir)
circuit.construct(B)
circuit.loc = null
B.circuit = circuit
qdel(src)
return
else if(frame_type.frame_class == "display")
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You connect the monitor.</span>"
var/obj/machinery/B = new circuit.build_path(src.loc)
B.pixel_x = pixel_x
B.pixel_y = pixel_y
B.set_dir(dir)
circuit.construct(B)
circuit.loc = null
B.circuit = circuit
qdel(src)
return
else if(istype(P, /obj/item/weapon/crowbar))
if(state == 1)
if(need_circuit && circuit)
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the circuit board.</span>"
state = 0
circuit.forceMove(src.loc)
circuit = null
if(frame_type.frame_class == "machine")
req_components = null
else if(state == 3)
if(frame_type.frame_class == "machine")
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
if(components.len == 0)
user << "<span class='notice'>There are no components to remove.</span>"
else
user << "<span class='notice'>You remove the components.</span>"
for(var/obj/item/weapon/W in components)
W.forceMove(src.loc)
check_components()
update_desc()
user << desc
else if(state == 4)
if(frame_type.frame_class == "computer")
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the glass panel.</span>"
state = 3
new /obj/item/stack/material/glass(src.loc, 2)
else if(frame_type.frame_class == "display")
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the glass panel.</span>"
state = 3
new /obj/item/stack/material/glass(src.loc, 2)
else if(istype(P, /obj/item/stack/cable_coil))
if(state == 2)
var/obj/item/stack/cable_coil/C = P
if(C.get_amount() < 5)
user << "<span class='warning'>You need five coils of wire to add them to the frame.</span>"
return
user << "<span class='notice'>You start to add cables to the frame.</span>"
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20) && state == 2)
if(C.use(5))
user << "<span class='notice'>You add cables to the frame.</span>"
state = 3
if(frame_type.frame_class == "machine")
user << desc
else if(state == 3)
if(frame_type.frame_class == "machine")
for(var/I in req_components)
if(istype(P, I) && (req_components[I] > 0))
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CP = P
if(CP.get_amount() > 1)
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(src)
CC.amount = camt
CC.update_icon()
CP.use(camt)
components += CC
req_components[I] -= camt
update_desc()
break
user.drop_item()
P.forceMove(src)
components += P
req_components[I]--
update_desc()
break
user << desc
else if(istype(P, /obj/item/weapon/wirecutters))
if(state == 3)
if(frame_type.frame_class == "computer")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
user << "<span class='notice'>You remove the cables.</span>"
state = 2
new /obj/item/stack/cable_coil(src.loc, 5)
else if(frame_type.frame_class == "display")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
user << "<span class='notice'>You remove the cables.</span>"
state = 2
new /obj/item/stack/cable_coil(src.loc, 5)
else if(frame_type.frame_class == "alarm")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
user << "<span class='notice'>You remove the cables.</span>"
state = 2
new /obj/item/stack/cable_coil(src.loc, 5)
else if(frame_type.frame_class == "machine")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
user << "<span class='notice'>You remove the cables.</span>"
state = 2
new /obj/item/stack/cable_coil(src.loc, 5)
else if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass")
if(state == 3)
if(frame_type.frame_class == "computer")
var/obj/item/stack/G = P
if(G.get_amount() < 2)
user << "<span class='warning'>You need two sheets of glass to put in the glass panel.</span>"
return
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user << "<span class='notice'>You start to put in the glass panel.</span>"
if(do_after(user, 20) && state == 3)
if(G.use(2))
user << "<span class='notice'>You put in the glass panel.</span>"
state = 4
else if(frame_type.frame_class == "display")
var/obj/item/stack/G = P
if(G.get_amount() < 2)
user << "<span class='warning'>You need two sheets of glass to put in the glass panel.</span>"
return
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user << "<span class='notice'>You start to put in the glass panel.</span>"
if(do_after(user, 20) && state == 3)
if(G.use(2))
user << "<span class='notice'>You put in the glass panel.</span>"
state = 4
else if(istype(P, /obj/item))
if(state == 3)
if(frame_type.frame_class == "machine")
for(var/I in req_components)
if(istype(P, I) && (req_components[I] > 0))
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(istype(P, /obj/item/stack/material/glass/reinforced))
var/obj/item/stack/material/glass/reinforced/CP = P
if(CP.get_amount() > 1)
var/camt = min(CP.amount, req_components[I]) // amount of glass to take, idealy amount required, but limited by amount provided
var/obj/item/stack/material/glass/reinforced/CC = new /obj/item/stack/material/glass/reinforced(src)
CC.amount = camt
CC.update_icon()
CP.use(camt)
components += CC
req_components[I] -= camt
update_desc()
break
user.drop_item()
P.forceMove(src)
components += P
req_components[I]--
update_desc()
break
user << desc
if(P && P.loc != src && !istype(P, /obj/item/stack/material))
user << "<span class='warning'>You cannot add that component to the machine!</span>"
return
update_icon()
/obj/structure/frame/verb/rotate()
set name = "Rotate Frame Counter-Clockwise"
set category = "Object"
set src in oview(1)
if(usr.incapacitated())
return 0
if(anchored)
usr << "It is fastened to the floor therefore you can't rotate it!"
return 0
set_dir(turn(dir, 90))
var/dir_text
if(dir == 1)
dir_text = "north"
else if(dir == 2)
dir_text = "south"
else if(dir == 4)
dir_text = "east"
else if(dir == 8)
dir_text = "west"
usr << "<span class='notice'>You rotate the [src] to face [dir_text]!</span>"
return
/obj/structure/frame/verb/revrotate()
set name = "Rotate Frame Clockwise"
set category = "Object"
set src in oview(1)
if(usr.incapacitated())
return 0
if(anchored)
usr << "It is fastened to the floor therefore you can't rotate it!"
return 0
set_dir(turn(dir, 270))
var/dir_text
if(dir == 1)
dir_text = "north"
else if(dir == 2)
dir_text = "south"
else if(dir == 4)
dir_text = "east"
else if(dir == 8)
dir_text = "west"
usr << "<span class='notice'>You rotate the [src] to face [dir_text]!</span>"
return