mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
Vendors and newscasters
Yep, constructable too now
This commit is contained in:
@@ -161,6 +161,28 @@ Note: Once everything is added to the public areas, will add m_amt and g_amt to
|
||||
to destroy them and players will be able to make replacements.
|
||||
*/
|
||||
|
||||
/obj/item/weapon/circuitboard/vendor
|
||||
name = "circuit board (Booze-O-Mat Vendor)"
|
||||
build_path = /obj/machinery/vending/boozeomat
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=1"
|
||||
req_components = list(
|
||||
"/obj/item/weapon/vending_refill/boozeomat" = 3)
|
||||
|
||||
/obj/item/weapon/circuitboard/vendor/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
var/list/names = list(/obj/machinery/vending/boozeomat = "Booze-O-Mat",
|
||||
/obj/machinery/vending/coffee = "Getmore Chocolate Corp",
|
||||
/obj/machinery/vending/snack = "Hot Drinks",
|
||||
/obj/machinery/vending/cola = "Robust Softdrinks",
|
||||
/obj/machinery/vending/cigarette = "Cigarette",
|
||||
/obj/machinery/vending/autodrobe = "AutoDrobe")
|
||||
|
||||
build_path = pick(names)
|
||||
name = "circuit board ([names[build_path]] Vendor)"
|
||||
user << "<span class='notice'>You set the board to [names[build_path]].</span>"
|
||||
req_components = list("/obj/item/weapon/vending_refill/[copytext("[build_path]", 24)]" = 3) //Never before has i used a method as horrible as this one, im so sorry
|
||||
|
||||
/obj/item/weapon/circuitboard/smes
|
||||
name = "circuit board (SMES)"
|
||||
build_path = /obj/machinery/power/smes
|
||||
|
||||
@@ -309,11 +309,11 @@ Class Procs:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/default_unfasten_wrench(mob/user, obj/item/weapon/wrench/W)
|
||||
/obj/machinery/proc/default_unfasten_wrench(mob/user, obj/item/weapon/wrench/W, time = 20)
|
||||
if(istype(W))
|
||||
user << "<span class='notice'>Now [anchored ? "un" : ""]securing [name]</span>"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if(do_after(user, time))
|
||||
anchored = !anchored
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
return 1
|
||||
|
||||
@@ -47,6 +47,39 @@ var/datum/feed_network/news_network = new /datum/feed_network //The global n
|
||||
var/list/obj/machinery/newscaster/allCasters = list() //Global list that will contain reference to all newscasters in existence.
|
||||
|
||||
|
||||
/obj/item/newscaster_frame
|
||||
name = "newscaster frame"
|
||||
desc = "Used to build newscasters, just secure to the wall."
|
||||
icon_state = "newscaster"
|
||||
item_state = "syringe_kit"
|
||||
m_amt = 25000
|
||||
g_amt = 15000
|
||||
|
||||
/obj/item/newscaster_frame/proc/try_build(turf/on_wall)
|
||||
if (get_dist(on_wall,usr)>1)
|
||||
return
|
||||
var/ndir = get_dir(usr,on_wall)
|
||||
if (!(ndir in cardinal))
|
||||
return
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "<span class='alert'>Newscaster cannot be placed on this spot.</span>"
|
||||
return
|
||||
if (A.requires_power == 0 || A.name == "Space")
|
||||
usr << "<span class='alert'>Newscaster cannot be placed in this area.</span>"
|
||||
return
|
||||
for(var/obj/machinery/newscaster/T in loc)
|
||||
usr << "<span class='alert'>There is another newscaster here.</span>"
|
||||
return
|
||||
var/obj/machinery/newscaster/N = new(loc)
|
||||
N.pixel_y -= (loc.y - on_wall.y) * 32
|
||||
N.pixel_x -= (loc.x - on_wall.x) * 32
|
||||
del(src)
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/machinery/newscaster
|
||||
name = "newscaster"
|
||||
desc = "A standard Nanotrasen-licensed newsfeed handler for use in commercial space stations. All the news you absolutely have no use for, in one place!"
|
||||
@@ -711,6 +744,15 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
|
||||
src.scanned_user = text("[T.registered_name] ([T.assignment])")
|
||||
src.screen=2*/ //Obsolete after autorecognition
|
||||
|
||||
if(istype(I, /obj/item/weapon/wrench))
|
||||
user << "<span class='notice'>Now [anchored ? "un" : ""]securing [name]</span>"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 60))
|
||||
new /obj/item/newscaster_frame(loc)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
del(src)
|
||||
return
|
||||
|
||||
if (src.isbroken)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
|
||||
for (var/mob/O in hearers(5, src.loc))
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
/obj/machinery/vending/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/vendor(null)
|
||||
wires = new(src)
|
||||
spawn(4)
|
||||
slogan_list = text2list(product_slogans, ";")
|
||||
@@ -137,11 +139,19 @@
|
||||
|
||||
|
||||
/obj/machinery/vending/attackby(obj/item/weapon/W, mob/user)
|
||||
if(panel_open)
|
||||
if(default_unfasten_wrench(user, W, time = 60))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
malfunction()
|
||||
default_deconstruction_crowbar(W)
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag))
|
||||
emagged = 1
|
||||
user << "You short out the product lock on [src]"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && anchored)
|
||||
panel_open = !panel_open
|
||||
user << "You [panel_open ? "open" : "close"] the maintenance panel."
|
||||
overlays.Cut()
|
||||
@@ -384,7 +394,7 @@
|
||||
while(R.amount>0)
|
||||
new dump_path(loc)
|
||||
R.amount--
|
||||
break
|
||||
continue
|
||||
|
||||
stat |= BROKEN
|
||||
icon_state = "[initial(icon_state)]-broken"
|
||||
|
||||
@@ -247,6 +247,11 @@
|
||||
AH.try_build(src)
|
||||
return
|
||||
|
||||
else if(istype(W,/obj/item/newscaster_frame))
|
||||
var/obj/item/newscaster_frame/AH = W
|
||||
AH.try_build(src)
|
||||
return
|
||||
|
||||
else if(istype(W,/obj/item/alarm_frame))
|
||||
var/obj/item/alarm_frame/AH = W
|
||||
AH.try_build(src)
|
||||
|
||||
@@ -237,6 +237,11 @@
|
||||
var/obj/item/apc_frame/AH = W
|
||||
AH.try_build(src)
|
||||
|
||||
else if(istype(W,/obj/item/newscaster_frame)) //Be damned the man who thought only mobs need attack() and walls dont need inheritance, hitler incarnate
|
||||
var/obj/item/newscaster_frame/AH = W
|
||||
AH.try_build(src)
|
||||
return
|
||||
|
||||
else if( istype(W,/obj/item/alarm_frame) )
|
||||
var/obj/item/alarm_frame/AH = W
|
||||
AH.try_build(src)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Reference in New Issue
Block a user