From e39b511a5a5fd335fa846edc4560342c94fd4aeb Mon Sep 17 00:00:00 2001 From: izac112 Date: Sat, 13 Jun 2020 19:07:49 +0200 Subject: [PATCH] removes obosolote --- code/game/objects/items/weapons/RPD.dm | 347 ------------------------- 1 file changed, 347 deletions(-) delete mode 100644 code/game/objects/items/weapons/RPD.dm diff --git a/code/game/objects/items/weapons/RPD.dm b/code/game/objects/items/weapons/RPD.dm deleted file mode 100644 index 38806886a1..0000000000 --- a/code/game/objects/items/weapons/RPD.dm +++ /dev/null @@ -1,347 +0,0 @@ -#define PAINT_MODE -2 -#define EATING_MODE -1 -#define ATMOS_MODE 0 -#define DISPOSALS_MODE 1 -#define TRANSIT_MODE 2 - -/obj/item/weapon/pipe_dispenser - name = "Rapid Piping Device (RPD)" - desc = "A device used to rapidly pipe things." - icon = 'icons/obj/tools.dmi' - icon_state = "rpd" - flags = NOBLUDGEON - force = 10 - throwforce = 10 - throw_speed = 1 - throw_range = 5 - w_class = ITEMSIZE_NORMAL - matter = list(DEFAULT_WALL_MATERIAL = 50000, "glass" = 25000) - var/datum/effect/effect/system/spark_spread/spark_system - var/working = 0 - var/mode = ATMOS_MODE - var/p_dir = NORTH - var/p_flipped = FALSE - var/paint_color="grey" - var/screen = ATMOS_MODE //Starts on the atmos tab. - var/piping_layer = PIPING_LAYER_DEFAULT - var/wrench_mode = FALSE - var/obj/item/weapon/tool/wrench/tool - var/datum/pipe_recipe/recipe - var/static/datum/pipe_recipe/first_atmos - var/static/datum/pipe_recipe/first_disposal - -/obj/item/weapon/pipe_dispenser/New() - . = ..() - src.spark_system = new /datum/effect/effect/system/spark_spread - spark_system.set_up(5, 0, src) - spark_system.attach(src) - tool = new /obj/item/weapon/tool/wrench/cyborg(src) // RPDs have wrenches inside of them, so that they can wrench down spawned pipes without being used as superior wrenches themselves. - -/obj/item/weapon/pipe_dispenser/proc/SetupPipes() - if(!first_atmos) - first_atmos = atmos_pipe_recipes[atmos_pipe_recipes[1]][1] - recipe = first_atmos - if(!first_disposal) - first_disposal = disposal_pipe_recipes[disposal_pipe_recipes[1]][1] - -/obj/item/weapon/pipe_dispenser/Destroy() - qdel(spark_system) - spark_system = null - return ..() - -/obj/item/weapon/pipe_dispenser/suicide_act(mob/user) - var/datum/gender/TU = gender_datums[user.get_visible_gender()] - user.visible_message("[user] points the end of the RPD down [TU.his] throat and presses a button! It looks like [TU.hes] trying to commit suicide...") - playsound(get_turf(user), 'sound/machines/click.ogg', 50, 1) - playsound(get_turf(user), 'sound/items/deconstruct.ogg', 50, 1) - return(BRUTELOSS) - -/obj/item/weapon/pipe_dispenser/attack_self(mob/user) - src.interact(user) - -/obj/item/weapon/pipe_dispenser/interact(mob/user) - SetupPipes() - var/list/lines = list() - if(mode >= ATMOS_MODE) - lines += "

Direction:

" - var/icon/preview = null - var/icon/previewm = null - if(recipe.icon && recipe.icon_state) - preview = new /icon(recipe.icon, recipe.icon_state) - if (recipe.icon_state_m) - previewm = new /icon(recipe.icon, recipe.icon_state_m) - switch(recipe.dirtype) - - if(PIPE_STRAIGHT) // Straight, N-S, W-E - lines += render_dir_img(preview,user,NORTH,"Vertical","↕") - lines += render_dir_img(preview,user,EAST,"Horizontal","↔") - - if(PIPE_BENDABLE) // Bent, N-W, N-E etc - lines += render_dir_img(preview,user,NORTH,"Vertical","↕") - lines += render_dir_img(preview,user,EAST,"Horizontal","↔") - lines += "
" - lines += render_dir_img(preview,user,NORTHWEST,"West to North","╝") - lines += render_dir_img(preview,user,NORTHEAST,"North to East","╚") - lines += "
" - lines += render_dir_img(preview,user,SOUTHWEST,"South to West","╗") - lines += render_dir_img(preview,user,SOUTHEAST,"East to South","╔") - - if(PIPE_TRINARY) // Manifold - lines += render_dir_img(preview,user,NORTH,"West South East","╦") - lines += render_dir_img(preview,user,EAST,"North West South","╣") - lines += "
" - lines += render_dir_img(preview,user,SOUTH,"East North West","╩") - lines += render_dir_img(preview,user,WEST,"South East North","╠") - - if(PIPE_TRIN_M) // Mirrored ones - //each mirror icon is 45 anticlockwise from it's real direction - lines += render_dir_img(preview,user,NORTH,"West South East","╦") - lines += render_dir_img(preview,user,EAST,"North West South","╣") - lines += "
" - lines += render_dir_img(preview,user,SOUTH,"East North West","╩") - lines += render_dir_img(preview,user,WEST,"South East North","╠") - lines += "
" - lines += render_dir_img(previewm,user,SOUTH,"West South East","╦", 1) - lines += render_dir_img(previewm,user,EAST,"North West South","╣", 1) - lines += "
" - lines += render_dir_img(previewm,user,NORTH,"East North West","╩", 1) - lines += render_dir_img(previewm,user,WEST,"South East North","╠", 1) - - if(PIPE_DIRECTIONAL) // Stuff with four directions - includes pumps etc. - lines += render_dir_img(preview,user,NORTH,"North","↑") - lines += render_dir_img(preview,user,EAST,"East","→") - lines += render_dir_img(preview,user,SOUTH,"South","↓") - lines += render_dir_img(preview,user,WEST,"West","←") - - if(PIPE_ONEDIR) // Single icon_state (eg 4-way manifolds) - lines += render_dir_img(preview,user,SOUTH,"Pipe","↕") - lines += "
" - - if(mode == ATMOS_MODE || mode == PAINT_MODE) - lines += "

Color:

" - var/i = 0 - for(var/c in pipe_colors) - ++i - lines += "[c]" - if(i == 4) - lines += "
" - i = 0 - lines += "
" - - lines += "

Utilities:

" - lines += "Lay Pipes" - lines += "Eat Pipes" - lines += "Paint Pipes" - lines += "
" - - lines += "

Catagory:

" - lines += "Atmospherics" - lines += "Disposals" - //lines += "Transit Tube" - lines += "
Wrench Mode" - lines += "
" - - if(screen == ATMOS_MODE) - for(var/category in atmos_pipe_recipes) - lines += "

[category]:

" - if(category == "Pipes") - lines += "
" - lines += "Regular " - lines += "Supply " - lines += "Scrubber " - lines += "
" - for(var/i in 1 to atmos_pipe_recipes[category].len) - var/datum/pipe_recipe/PI = atmos_pipe_recipes[category][i] - lines += "
" - lines += "[PI.name]" - lines += "
" - lines += "
" - else if(screen == DISPOSALS_MODE) - for(var/category in disposal_pipe_recipes) - lines += "

[category]:

" - for(var/i in 1 to disposal_pipe_recipes[category].len) - var/datum/pipe_recipe/PI = disposal_pipe_recipes[category][i] - lines += "
" - lines += "[PI.name]" - lines += "
" - lines += "
" - - var/dat = lines.Join() - var/datum/browser/popup = new(user, "rpd", name, 300, 800, src) - popup.set_content("[dat]") - popup.open() - -/obj/item/weapon/pipe_dispenser/Topic(href,href_list) - SetupPipes() - if(..()) - return - if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) - return - var/playeffect = TRUE // Do we spark the device - var/anyclicked = FALSE // Tells us if we need to refresh the window. - if(href_list["paint_color"]) - paint_color = href_list["paint_color"] - playeffect = FALSE - anyclicked = TRUE - if(href_list["mode"]) - mode = text2num(href_list["mode"]) - anyclicked = TRUE - if(href_list["screen"]) - if(mode == screen) - mode = text2num(href_list["screen"]) - screen = text2num(href_list["screen"]) - switch(screen) - if(DISPOSALS_MODE) - recipe = first_disposal - if(ATMOS_MODE) - recipe = first_atmos - p_dir = NORTH - playeffect = FALSE - anyclicked = TRUE - if(href_list["piping_layer"]) - piping_layer = text2num(href_list["piping_layer"]) - playeffect = FALSE - anyclicked = TRUE - if(href_list["pipe_type"]) - recipe = all_pipe_recipes[href_list["category"]][text2num(href_list["pipe_type"])] - if(recipe.dirtype == PIPE_ONEDIR) // One hell of a hack for the fact that the image previews for the onedir types only show on the south, but the default pipe type is north. - p_dir = SOUTH // Did I fuck this up? Maybe. Or maybe it's just the icon files not being ready for an RPD. - else // If going to try and fix this hack, be aware the pipe dispensers might rely on pipes defaulting south instead of north. - p_dir = NORTH - p_flipped = FALSE - anyclicked = TRUE - if(href_list["dir"]) - p_dir = text2dir(href_list["dir"]) - p_flipped = text2num(href_list["flipped"]) - playeffect = FALSE - anyclicked = TRUE - if(href_list["switch_wrench"]) - wrench_mode = text2num(href_list["wrench_mode"]) - anyclicked = TRUE - if(anyclicked) - if(playeffect) - spark_system.start() - playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0) - src.interact(usr) - -/obj/item/weapon/pipe_dispenser/afterattack(atom/A, mob/user as mob, proximity) - if(!user.IsAdvancedToolUser() || istype(A, /turf/space/transit) || !proximity) - return ..() - - //So that changing the menu settings doesn't affect the pipes already being built. - var/queued_piping_layer = piping_layer - var/queued_p_type = recipe.pipe_type - var/queued_p_dir = p_dir - var/queued_p_flipped = p_flipped - var/queued_p_subtype = recipe.subtype - var/queued_p_paintable = recipe.paintable - - //make sure what we're clicking is valid for the current mode - var/static/list/make_pipe_whitelist // This should probably be changed to be in line with polaris standards. Oh well. - if(!make_pipe_whitelist) - make_pipe_whitelist = typecacheof(list(/obj/structure/lattice, /obj/structure/girder, /obj/item/pipe)) - var/can_make_pipe = (isturf(A) || is_type_in_typecache(A, make_pipe_whitelist)) - - . = FALSE - switch(mode) //if we've gotten this var, the target is valid - if(PAINT_MODE) //Paint pipes - if(!istype(A, /obj/machinery/atmospherics/pipe)) - return ..() - var/obj/machinery/atmospherics/pipe/P = A - playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - P.change_color(pipe_colors[paint_color]) - user.visible_message("[user] paints \the [P] [paint_color].","You paint \the [P] [paint_color].") - return - - if(EATING_MODE) //Eating pipes - if(!(istype(A, /obj/item/pipe) || istype(A, /obj/item/pipe_meter) || istype(A, /obj/structure/disposalconstruct))) - return ..() - to_chat(user, "You start destroying a pipe...") - playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if(do_after(user, 2, target = A)) - activate() - qdel(A) - - if(ATMOS_MODE) //Making pipes - if(!can_make_pipe) - return ..() - playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if (istype(recipe, /datum/pipe_recipe/meter)) - to_chat(user, "You start building a meter...") - if(do_after(user, 2, target = A)) - activate() - var/obj/item/pipe_meter/PM = new /obj/item/pipe_meter(get_turf(A)) - PM.setAttachLayer(queued_piping_layer) - if(wrench_mode) - do_wrench(PM, user) - else - to_chat(user, "You start building a pipe...") - if(do_after(user, 2, target = A)) - activate() - var/obj/machinery/atmospherics/path = queued_p_type - var/pipe_item_type = initial(path.construction_type) || /obj/item/pipe - var/obj/item/pipe/P = new pipe_item_type(get_turf(A), queued_p_type, queued_p_dir) - - P.update() - P.add_fingerprint(usr) - P.setPipingLayer(queued_piping_layer) - if (queued_p_paintable) - P.color = pipe_colors[paint_color] - if(queued_p_flipped) - P.do_a_flip() - if(wrench_mode) - do_wrench(P, user) - - if(DISPOSALS_MODE) //Making disposals pipes - if(!can_make_pipe) - return ..() - A = get_turf(A) - if(istype(A, /turf/unsimulated)) - to_chat(user, "[src]'s error light flickers; there's something in the way!") - return - to_chat(user, "You start building a disposals pipe...") - playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if(do_after(user, 4, target = A)) - var/obj/structure/disposalconstruct/C = new(A, queued_p_type, queued_p_dir, queued_p_flipped, queued_p_subtype) - - if(!C.can_place()) - to_chat(user, "There's not enough room to build that here!") - qdel(C) - return - - activate() - - C.add_fingerprint(usr) - C.update_icon() - if(wrench_mode) - do_wrench(C, user) - return - - else - return ..() - - -/obj/item/weapon/pipe_dispenser/proc/activate() - playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, 1) - -/obj/item/weapon/pipe_dispenser/proc/do_wrench(var/atom/target, mob/user) - var/resolved = target.attackby(tool,user) - if(!resolved && tool && target) - tool.afterattack(target,user,1) - -/obj/item/weapon/pipe_dispenser/proc/render_dir_img(preview,user,_dir,title,noimg,flipped=0) - var/dirtext = dir2text(_dir) - var/selected = " style=\"height:34px;width:34px;display:inline-block\"" - if(_dir == p_dir && flipped == p_flipped) - selected += " class=\"linkOn\"" - if(preview) - user << browse_rsc(new /icon(preview, dir=_dir), "[dirtext][flipped ? "m" : ""].png") - return "" - else - return "[noimg]" - - -#undef PAINT_MODE -#undef EATING_MODE -#undef ATMOS_MODE -#undef DISPOSALS_MODE