Merge pull request #1229 from SinTwo/construction_update

Construction update
This commit is contained in:
Neerti
2016-03-26 15:45:19 -04:00
81 changed files with 1740 additions and 519 deletions

View File

@@ -310,6 +310,7 @@
use_power = 1
idle_power_usage = 5
active_power_usage = 100
circuit = /obj/item/weapon/circuitboard/grinder
var/inuse = 0
var/obj/item/weapon/reagent_containers/beaker = null
var/limit = 10
@@ -326,6 +327,10 @@
/obj/machinery/reagentgrinder/New()
..()
beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
component_parts = list()
component_parts += new /obj/item/weapon/stock_parts/motor(src)
component_parts += new /obj/item/weapon/stock_parts/gear(src)
RefreshParts()
return
/obj/machinery/reagentgrinder/update_icon()
@@ -333,6 +338,11 @@
return
/obj/machinery/reagentgrinder/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(beaker)
if(default_deconstruction_screwdriver(user, O))
return
if(default_deconstruction_crowbar(user, O))
return
if (istype(O,/obj/item/weapon/reagent_containers/glass) || \
istype(O,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass) || \

View File

@@ -40,7 +40,7 @@
/obj/machinery/sleeper,
/obj/machinery/smartfridge/,
/obj/machinery/biogenerator,
/obj/machinery/constructable_frame,
/obj/structure/frame,
/obj/machinery/radiocarbon_spectrometer
)
@@ -246,6 +246,17 @@
var/image/lid = image(icon, src, "lid_[initial(icon_state)]")
overlays += lid
/obj/item/weapon/reagent_containers/glass/cooler_bottle
desc = "A bottle for a water-cooler."
name = "water-cooler bottle"
icon = 'icons/obj/vending.dmi'
icon_state = "water_cooler_bottle"
matter = list(DEFAULT_WALL_MATERIAL = 200)
w_class = 3.0
amount_per_transfer_from_this = 20
possible_transfer_amounts = list(10,20,30,60,120)
volume = 120
/*
/obj/item/weapon/reagent_containers/glass/blender_jug
name = "Blender Jug"

View File

@@ -202,22 +202,66 @@
icon_state = "water_cooler"
possible_transfer_amounts = null
anchored = 1
New()
var/bottle = 0
/obj/structure/reagent_dispensers/water_cooler/New()
if(bottle == 1)
..()
reagents.add_reagent("water",500)
reagents.add_reagent("water",120)
else
icon_state = "water_cooler_0"
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W,/obj/item/weapon/wrench))
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/wrench))
src.add_fingerprint(user)
if(anchored)
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
if(bottle)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20))
user << "<span class='notice'>You unfasten the jug.</span>"
var/obj/item/weapon/reagent_containers/glass/cooler_bottle/G = new /obj/item/weapon/reagent_containers/glass/cooler_bottle( src.loc )
for(var/datum/reagent/R in reagents.reagent_list)
var/total_reagent = reagents.get_reagent_amount(R.id)
G.reagents.add_reagent(R.id, total_reagent)
reagents.clear_reagents()
bottle = 0
icon_state = "water_cooler_0"
else
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
if(anchored)
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
else
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
if(do_after(user, 20, src))
if(!src) return
user << "<span class='notice'>You [anchored? "un" : ""]secured \the [src]!</span>"
anchored = !anchored
return
if(do_after(user, 20, src))
if(!src) return
user << "<span class='notice'>You [anchored? "un" : ""]secured \the [src]!</span>"
anchored = !anchored
if(istype(I, /obj/item/weapon/screwdriver))
if(!bottle)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You take the water-cooler apart.</span>"
new /obj/item/stack/material/plastic( src.loc, 4 )
qdel(src)
return
if(istype(I, /obj/item/weapon/reagent_containers/glass/cooler_bottle))
src.add_fingerprint(user)
if(!bottle)
if(anchored)
var/obj/item/weapon/reagent_containers/glass/cooler_bottle/G = I
user << "<span class='notice'>You start to screw the bottle onto the water-cooler.</span>"
if(do_after(user, 20))
bottle = 1
icon_state = "water_cooler"
user << "<span class='notice'>You screw the bottle onto the water-cooler but accidently spill some!</span>" //you spill some because it for somereason transfers 5 units to the bottle after it gets attached but before it's deleted...
for(var/datum/reagent/R in G.reagents.reagent_list)
var/total_reagent = G.reagents.get_reagent_amount(R.id)
reagents.add_reagent(R.id, total_reagent)
qdel(G)
else
user << "<span class='warning'>You need to wrench down the cooler first.</span>"
else
user << "<span class='warning'>There is already a bottle there!</span>"
return
else
return ..()