Files
vgstation13/code/ATMOSPHERICS/pipe/pipe_planner.dm
clusterfack 6edf0208ac 64x64 Sprites (#11214)
* Move DMI files over to 64x64

* Lighting overlay + world.icon_size.

* Change 32 to world icon size

* Adds pixel shift multiplier

* Fix accidentaly 16 -> world_icon_size/4 conversion to proper world_icon_size/2 conversion

* Fixes lighting properly

* Fix spacepods bounds

* Redo all icons with BYONDTools bug fixed

* Update ALL the map files dear god

* Double crayon font size

* Update all screen locs

* Fix contextual clicks

Couldn't use PIXEL MULTIPLIER here for the most part due to the fact most of these are ranges and doubling them would leave empty spaces

* Fixes maptext size and the final touch ups on antag screen locs

* Runs optipng on the DMI files in last commit.

Because my optipng version was outdated (blame the optipng package I had installed) it failed to run on the erge commit. This fixed that.

* Reduces parallax size a bit for 64x64 map sizes

* Fix lobby screens

* Fix DME
2016-08-05 02:07:02 +02:00

54 lines
1.4 KiB
Plaintext

/obj/item/pipe_planner
name = "pipe planner"
desc = "A lightweight frame for placing and aligning piping before it is fixed down."
icon = 'icons/obj/pipe-item.dmi'
icon_state = "pipe-planner"
w_class = W_CLASS_LARGE
var/datum/context_click/pipe_planner/planner
layer = OBJ_LAYER + (PIPING_LAYER_MIN - (PIPING_LAYER_DEFAULT + PIPING_LAYER_INCREMENT)) * PIPING_LAYER_LCHANGE
plane = OBJ_PLANE
/obj/item/pipe_planner/New()
..()
planner = new(src)
/obj/item/pipe_planner/attackby(var/obj/item/I, mob/user, params)
if(get_turf(src) == src.loc)
return planner.action(I, user, params)
return ..()
/obj/item/pipe_planner/attack_self(mob/user)
dir = turn(dir, 90)
..()
/datum/context_click/pipe_planner/return_clicked_id(var/x_pos, var/y_pos)
var/found_id = 0
var/temp_dis = 0
var/temp_mod = 0
if(holder.dir & (EAST|WEST))
temp_dis = x_pos
temp_mod = PIPING_LAYER_P_X
else
temp_dis = y_pos
temp_mod = PIPING_LAYER_P_Y
if(temp_dis - WORLD_ICON_SIZE/2 == 0)
return 0
found_id = Floor(abs(temp_dis - WORLD_ICON_SIZE/2), abs(temp_mod)) / (temp_mod * sign(temp_dis - WORLD_ICON_SIZE/2))
return found_id
/datum/context_click/pipe_planner/action(obj/item/used_item, mob/user, params)
if(istype(used_item, /obj/item/pipe))
var/obj/item/pipe/pipe = used_item
if(user.drop_item(pipe, get_turf(holder)))
var/dis = PIPING_LAYER_DEFAULT + (PIPING_LAYER_INCREMENT * return_clicked_id_by_params(params))
pipe.setPipingLayer(dis)
return 1
return 0