mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
Metal and related materials now noticeable more user-friendly. Added new canister color: yellow "CAUTION". Used for newly created from metal canisters. Can be relabeled once. Some typos were fixed. dsay verb now uses fakekey in stealth mode. AI cannot remove the cell from the charger. Added alientalk chat prefix: ":a" by Barhandar. Also added keyboard layout independent russian prefixes. Binary translator done by more convenient may by Barhandar. Is possible now to wash bloody hands in sink. Probably fixed bug causes gibbed revheads be not counted as dead. Some other fixes. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@752 316c924e-a436-60f5-8080-3fe189b3f50e
150 lines
4.9 KiB
Plaintext
150 lines
4.9 KiB
Plaintext
//Motherboard is just used in assembly/disassembly, doesn't exist in the actual computer object.
|
|
/obj/item/weapon/motherboard
|
|
name = "Computer mainboard"
|
|
desc = "A computer motherboard."
|
|
icon = 'module.dmi'
|
|
icon_state = "mainboard"
|
|
item_state = "electronic"
|
|
w_class = 3
|
|
var/created_name = null //If defined, result computer will have this name.
|
|
|
|
/obj/computer2frame
|
|
density = 1
|
|
anchored = 0
|
|
name = "Computer-frame"
|
|
icon = 'computer_frame.dmi'
|
|
icon_state = "0"
|
|
var/state = 0
|
|
var/obj/item/weapon/motherboard/mainboard = null
|
|
var/obj/item/weapon/disk/data/fixed_disk/hd = null
|
|
var/list/peripherals = list()
|
|
var/created_icon_state = "aiupload"
|
|
|
|
/obj/computer2frame/attackby(obj/item/P as obj, mob/user as mob)
|
|
switch(state)
|
|
if(0)
|
|
if(istype(P, /obj/item/weapon/wrench))
|
|
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
|
if(do_after(user, 20))
|
|
user << "\blue You wrench the frame into place."
|
|
src.anchored = 1
|
|
src.state = 1
|
|
if(istype(P, /obj/item/weapon/weldingtool))
|
|
playsound(src.loc, 'Welder.ogg', 50, 1)
|
|
if(do_after(user, 20))
|
|
user << "\blue You deconstruct the frame."
|
|
new /obj/item/stack/sheet/metal( src.loc, 5 )
|
|
del(src)
|
|
if(1)
|
|
if(istype(P, /obj/item/weapon/wrench))
|
|
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
|
if(do_after(user, 20))
|
|
user << "\blue You unfasten the frame."
|
|
src.anchored = 0
|
|
src.state = 0
|
|
if(istype(P, /obj/item/weapon/motherboard) && !mainboard)
|
|
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
|
|
user << "\blue You place the mainboard inside the frame."
|
|
src.icon_state = "1"
|
|
src.mainboard = P
|
|
user.drop_item()
|
|
P.loc = src
|
|
if(istype(P, /obj/item/weapon/screwdriver) && mainboard)
|
|
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
|
user << "\blue You screw the mainboard into place."
|
|
src.state = 2
|
|
src.icon_state = "2"
|
|
if(istype(P, /obj/item/weapon/crowbar) && mainboard)
|
|
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
|
user << "\blue You remove the mainboard."
|
|
src.state = 1
|
|
src.icon_state = "0"
|
|
mainboard.loc = src.loc
|
|
src.mainboard = null
|
|
if(2)
|
|
if(istype(P, /obj/item/weapon/screwdriver) && mainboard && (!peripherals.len))
|
|
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
|
user << "\blue You unfasten the mainboard."
|
|
src.state = 1
|
|
src.icon_state = "1"
|
|
|
|
if(istype(P, /obj/item/weapon/peripheral))
|
|
if(src.peripherals.len < 3)
|
|
user.drop_item()
|
|
src.peripherals.Add(P)
|
|
P.loc = src
|
|
user << "\blue You add [P] to the frame."
|
|
else
|
|
user << "\red There is no more room for peripheral cards."
|
|
|
|
if(istype(P, /obj/item/weapon/crowbar) && src.peripherals.len)
|
|
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
|
user << "\blue You remove the peripheral boards."
|
|
for(var/obj/item/weapon/peripheral/W in src.peripherals)
|
|
W.loc = src.loc
|
|
src.peripherals.Remove(W)
|
|
|
|
if(istype(P, /obj/item/weapon/cable_coil))
|
|
if(P:amount >= 5)
|
|
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
|
|
if(do_after(user, 20))
|
|
P:amount -= 5
|
|
if(!P:amount) del(P)
|
|
user << "\blue You add cables to the frame."
|
|
src.state = 3
|
|
src.icon_state = "3"
|
|
if(3)
|
|
if(istype(P, /obj/item/weapon/wirecutters))
|
|
playsound(src.loc, 'wirecutter.ogg', 50, 1)
|
|
user << "\blue You remove the cables."
|
|
src.state = 2
|
|
src.icon_state = "2"
|
|
var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc )
|
|
A.amount = 5
|
|
if(src.hd)
|
|
src.hd.loc = src.loc
|
|
src.hd = null
|
|
|
|
if(istype(P, /obj/item/weapon/disk/data/fixed_disk) && !src.hd)
|
|
user.drop_item()
|
|
src.hd = P
|
|
P.loc = src
|
|
user << "\blue You connect the drive to the cabling."
|
|
|
|
if(istype(P, /obj/item/weapon/crowbar) && src.hd)
|
|
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
|
user << "\blue You remove the hard drive."
|
|
src.hd.loc = src.loc
|
|
src.hd = null
|
|
|
|
if(istype(P, /obj/item/stack/sheet/glass))
|
|
if(P:amount >= 2)
|
|
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
|
|
if(do_after(user, 20))
|
|
P:use(2)
|
|
user << "\blue You put in the glass panel."
|
|
src.state = 4
|
|
src.icon_state = "4"
|
|
if(4)
|
|
if(istype(P, /obj/item/weapon/crowbar))
|
|
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
|
user << "\blue You remove the glass panel."
|
|
src.state = 3
|
|
src.icon_state = "3"
|
|
new /obj/item/stack/sheet/glass( src.loc, 2 )
|
|
if(istype(P, /obj/item/weapon/screwdriver))
|
|
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
|
user << "\blue You connect the monitor."
|
|
var/obj/machinery/computer2/C= new /obj/machinery/computer2( src.loc )
|
|
C.setup_drive_size = 0
|
|
C.icon_state = src.created_icon_state
|
|
if(mainboard.created_name) C.name = mainboard.created_name
|
|
del(mainboard)
|
|
if(hd)
|
|
C.hd = hd
|
|
hd.loc = C
|
|
for(var/obj/item/weapon/peripheral/W in src.peripherals)
|
|
W.loc = C
|
|
W.host = C
|
|
C.peripherals.Add(W)
|
|
del(src) |