mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 02:56:14 +01:00
Duct Tape
First pass for adding duct tape. It can stick paper to things. It can patch up walls (crudely). Coder sprites!
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
/obj/item/weapon/tape_roll
|
||||
name = "tape roll"
|
||||
desc = "A roll of sticky tape. Possibly for taping ducks... or was that ducts?"
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "taperoll"
|
||||
w_class = 1
|
||||
|
||||
/obj/item/weapon/tape_roll/attack_self(mob/user as mob)
|
||||
user << "You remove a length of tape from [src]."
|
||||
|
||||
var/obj/item/weapon/ducttape/tape = new()
|
||||
user.put_in_hands(tape)
|
||||
|
||||
/obj/item/weapon/tape_roll/proc/stick(var/obj/item/weapon/W, mob/user as mob)
|
||||
if(!istype(W, /obj/item/weapon/paper))
|
||||
return
|
||||
|
||||
user.drop_from_inventory(W)
|
||||
var/obj/item/weapon/ducttape/tape = new(get_turf(src))
|
||||
tape.attach(W)
|
||||
user.put_in_hands(tape)
|
||||
|
||||
/obj/item/weapon/ducttape
|
||||
name = "tape"
|
||||
desc = "A piece of sticky tape."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "tape"
|
||||
w_class = 1
|
||||
layer = 4
|
||||
anchored = 1 //it's sticky, no you cant move it
|
||||
|
||||
var/obj/item/weapon/stuck = null
|
||||
|
||||
/obj/item/weapon/ducttape/New()
|
||||
..()
|
||||
flags |= NOBLUDGEON
|
||||
|
||||
/obj/item/weapon/ducttape/examine()
|
||||
return stuck.examine()
|
||||
|
||||
/obj/item/weapon/ducttape/proc/attach(var/obj/item/weapon/W)
|
||||
stuck = W
|
||||
W.forceMove(src)
|
||||
icon_state = W.icon_state + "_taped"
|
||||
name = W.name + " (taped)"
|
||||
|
||||
/obj/item/weapon/ducttape/attack_self(mob/user as mob)
|
||||
user << "You remove \the [initial(name)] from [stuck]."
|
||||
|
||||
user.drop_from_inventory(src)
|
||||
stuck.forceMove(get_turf(src))
|
||||
user.put_in_hands(stuck)
|
||||
stuck = null
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/ducttape/afterattack(var/A, mob/user as mob, flag, params)
|
||||
if(!in_range(user, A) || istype(A, /obj/machinery/door) || !stuck)
|
||||
return
|
||||
|
||||
var/turf/target_turf = get_turf(A)
|
||||
var/turf/source_turf = get_turf(user)
|
||||
|
||||
var/dir_offset = 0
|
||||
if(target_turf != source_turf)
|
||||
dir_offset = get_dir(source_turf, target_turf)
|
||||
|
||||
user.drop_from_inventory(src)
|
||||
forceMove(source_turf)
|
||||
|
||||
if(params)
|
||||
var/list/mouse_control = params2list(params)
|
||||
if(mouse_control["icon-x"])
|
||||
pixel_x = text2num(mouse_control["icon-x"]) - 16
|
||||
if(dir_offset & EAST)
|
||||
pixel_x += 32
|
||||
else if(dir_offset & WEST)
|
||||
pixel_x -= 32
|
||||
if(mouse_control["icon-y"])
|
||||
pixel_y = text2num(mouse_control["icon-y"]) - 16
|
||||
if(dir_offset & NORTH)
|
||||
pixel_y += 32
|
||||
else if(dir_offset & SOUTH)
|
||||
pixel_y -= 32
|
||||
Reference in New Issue
Block a user