bluespace pipe dispenser and sprite previews, isn't it nice?

This commit is contained in:
Enric Gabriel
2020-07-02 00:13:08 -03:00
parent c8ff8d1a6f
commit e18a47ca8a
17 changed files with 295 additions and 11 deletions
+20 -9
View File
@@ -12,7 +12,6 @@ RPD
#define DESTROY_MODE (1<<2)
#define PAINT_MODE (1<<3)
GLOBAL_LIST_INIT(atmos_pipe_recipes, list(
"Pipes" = list(
new /datum/pipe_info/pipe("Pipe", /obj/machinery/atmospherics/pipe/simple),
@@ -175,6 +174,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if(dt == PIPE_UNARY_FLIPPABLE)
icon_state = "[icon_state]_preview"
// SKYRAT CHANGE: Made BSRPD into a subtype of RPD, additionally made it work at range.
/obj/item/pipe_dispenser
name = "Rapid Piping Device (RPD)"
desc = "A device used to rapidly pipe things."
@@ -209,6 +209,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
var/static/datum/pipe_info/first_disposal
var/static/datum/pipe_info/first_transit
var/mode = BUILD_MODE | DESTROY_MODE | WRENCH_MODE
var/has_bluespace_pipe = FALSE // Skyrat
/obj/item/pipe_dispenser/New()
. = ..()
@@ -266,7 +267,10 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
var/list/recipes
switch(category)
if(ATMOS_CATEGORY)
recipes = GLOB.atmos_pipe_recipes
if(has_bluespace_pipe) // stupid skyrat edit
recipes = GLOB.bsatmos_pipe_recipes
else
recipes = GLOB.atmos_pipe_recipes
if(DISPOSALS_CATEGORY)
recipes = GLOB.disposal_pipe_recipes
if(TRANSIT_CATEGORY)
@@ -307,7 +311,10 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if("pipe_type")
var/static/list/recipes
if(!recipes)
recipes = GLOB.disposal_pipe_recipes + GLOB.atmos_pipe_recipes + GLOB.transit_tube_recipes
if(has_bluespace_pipe) // skyrat hack
recipes = GLOB.disposal_pipe_recipes + GLOB.bsatmos_pipe_recipes + GLOB.transit_tube_recipes
else
recipes = GLOB.disposal_pipe_recipes + GLOB.atmos_pipe_recipes + GLOB.transit_tube_recipes
recipe = recipes[params["category"]][text2num(params["pipe_type"])]
p_dir = NORTH
if("setdir")
@@ -327,10 +334,13 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
return TRUE
/obj/item/pipe_dispenser/pre_attack(atom/A, mob/user)
/obj/item/pipe_dispenser/pre_attack(atom/A, mob/user) // Skyrat: All functionality moved to proc/dispense
dispense(A, user)
/obj/item/pipe_dispenser/proc/dispense(atom/A, mob/user)
var/turf/T = get_turf(A)
if(!user.IsAdvancedToolUser() || !T || istype(T, /turf/open/space/transit) || isindestructiblewall(T))
return ..()
return
//So that changing the menu settings doesn't affect the pipes already being built.
var/queued_p_type = recipe.id
@@ -377,7 +387,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
switch(category) //if we've gotten this var, the target is valid
if(ATMOS_CATEGORY) //Making pipes
if(!can_make_pipe)
return ..()
return
A = T
if(is_type_in_typecache(recipe, GLOB.ventcrawl_machinery) && isclosedturf(A)) //wall escapism sanity check.
to_chat(user, "<span class='warning'>[src]'s error light flickers; there's something in the way!</span>")
@@ -413,7 +423,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if(DISPOSALS_CATEGORY) //Making disposals pipes
if(!can_make_pipe)
return ..()
return
A = T
if(isclosedturf(A))
to_chat(user, "<span class='warning'>[src]'s error light flickers; there's something in the way!</span>")
@@ -438,7 +448,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if(TRANSIT_CATEGORY) //Making transit tubes
if(!can_make_pipe)
return ..()
return
A = T
if(isclosedturf(A))
to_chat(user, "<span class='warning'>[src]'s error light flickers; there's something in the way!</span>")
@@ -471,7 +481,8 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
return
else
return ..()
return
// End skyrat edit
/obj/item/pipe_dispenser/proc/activate()
playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, 1)
@@ -5,6 +5,9 @@
/obj/structure/closet/secure_closet/engineering_chief/PopulateContents()
..()
//SKYRAT EDIT - ATMS
new /obj/item/pipe_dispenser/bluespace(src) // SKYRAT: CE gets BPRPD instead of RPD, since they start with all other power tools too
//SKYRAT EDIT END
new /obj/item/clothing/neck/cloak/ce(src)
new /obj/item/clothing/head/beret/ce(src)
new /obj/item/clothing/under/rank/engineering/chief_engineer(src)
@@ -21,7 +24,6 @@
new /obj/item/assembly/flash/handheld(src)
new /obj/item/clothing/glasses/meson/engine(src)
new /obj/item/door_remote/chief_engineer(src)
new /obj/item/pipe_dispenser(src)
new /obj/item/inducer(src)
new /obj/item/circuitboard/machine/techfab/department/engineering(src)
new /obj/item/extinguisher/advanced(src)