Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added two new syndicate items: chameleon boxes and mailman jumpsuits #90

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions code/datums/uplink_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ var/list/uplink_items = list()
item = /obj/item/device/camera_bug
cost = 2

/datum/uplink_item/stealthy_tools/chameleon_box
name = "Chameleon Box"
desc = "A normal-looking box that can be disguised as almost anything."
item = /obj/item/weapon/storage/box/chameleon
cost = 2

// DEVICE AND TOOLS

/datum/uplink_item/device_tools
Expand Down Expand Up @@ -392,6 +398,12 @@ var/list/uplink_items = list()
cost = 8
gamemodes = list(/datum/game_mode/nuclear)

/datum/uplink_item/device_tools/mailman_jumpsuit
name = "Mailman Jumpsuit"
desc = "This jumpsuit allows you to use disposals to break into departments by setting the sorting tag."
item = /obj/item/clothing/under/syndiemail
cost = 3


// IMPLANTS

Expand Down
113 changes: 113 additions & 0 deletions code/game/objects/items/weapons/storage/syndiebox.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/* Chameleon boxes!
Can hold everything a normal box can, but can be disguised as any item sized normal or smaller!
By Miauw */
/obj/item/weapon/storage/box/chameleon
name = "box"
desc = "It's just an ordinary box."
foldable = null
var/active = 0

var/saved_name //These vars contain info about the scanned object. Mostly self-explanatory.
var/saved_desc
var/saved_icon
var/saved_icon_state
var/saved_dir
var/saved_item_state
var/saved_pixel_x
var/saved_pixel_y

var/list/forbidden_objs = list(/obj/item/weapon/reagent_containers/food/snacks/icecream, /obj/structure/sign, /obj/structure/cable, /obj/machinery/atmospherics, /obj/machinery/light, /obj/machinery/hologram, /obj/machinery/camera, /obj/machinery/power/apc, /obj/machinery/field/containment, /obj/machinery/shieldwall, /obj/machinery/shield, /obj/effect, /obj/screen /*Just to be sure*/, /obj/structure/c_tray, /obj/structure/shuttle, /obj/structure/disposalpipe, /obj/machinery/alarm, /obj/machinery/access_button, /obj/machinery/embedded_controller, /obj/machinery/flasher_button, /obj/machinery/ignition_switch, /obj/machinery/light_switch, /obj/machinery/power/terminal, /obj/machinery/airlock_sensor, /obj/structure/extinguisher_cabinet, /obj/machinery/computer/security/telescreen/entertainment, /obj/item/ammo_casing, /obj/item/weapon/cigbutt, /obj/item/weapon/match, /obj/item/weapon/pai_cable, /obj/item/weapon/pen, /obj/item/weapon/paper_bin, /obj/item/device/radio/beacon, /obj/item/device/radio/intercom, /obj/item/trash, /obj/item/clothing/mask/cigarette, /obj/structure/flora, /obj/structure/m_tray, /obj/structure/window, /obj/structure/noticeboard, /obj/machinery/firealarm, /obj/machinery/newscaster, /obj/machinery/requests_console, /obj/structure/plasticflaps, /obj/structure/lattice, /obj/machinery/conveyor, /obj/machinery/keycard_auth, /obj/machinery/driver_button, /obj/machinery/door/firedoor) //Some things just shouldn't be scanned. This generally has to do with: 1. Overlays (Ice cream cones), 2. Stuff that doesn't make sense (Holograms) and 3. Balancing.
origin_tech = "syndicate=2;magnets=2"

/obj/item/weapon/storage/box/chameleon/attack_self(mob/user)
toggle()

/obj/item/weapon/storage/box/chameleon/afterattack(atom/target, mob/user , proximity)
if(!proximity) return

if(!active)
if(target.loc != src && istype(target,/obj)) //It can be everything you want it to be~ //Now it can truely be everything you want it to be, thanks to Pete. Have fun with your dildo-filled holographic doors.

for(var/checktype in forbidden_objs)
if(istype(target,checktype))
user << "<span class='warning'>You can't get a good read on [target].</span>"
return

playsound(get_turf(src), 'sound/weapons/flash.ogg', 100, 1, -6)
user << "<span class='notice'>Scanned [target].</span>"

saved_name = target.name
saved_desc = target.desc
saved_icon = target.icon
saved_icon_state = target.icon_state
saved_dir = target.dir
saved_pixel_x = target.pixel_x
saved_pixel_y = target.pixel_y

if(istype(target, /obj/item))
var/obj/item/targetitem = target //Neccesary for item_state
saved_item_state = targetitem.item_state

/obj/item/weapon/storage/box/chameleon/proc/toggle()
if(active)
name = initial(name)
desc = initial(desc)
icon_state = initial(icon_state)
icon = initial(icon)
item_state = initial(item_state)
dir = initial(dir)
pixel_x = initial(pixel_x)
pixel_y = initial(pixel_y)

playsound(get_turf(src), 'sound/effects/pop.ogg', 100, 1, -6)
active = 0

else if(!active && saved_name) //Only one saved_ var is checked because they're all set at the same time.
playsound(get_turf(src), 'sound/effects/pop.ogg', 100, 1, -6)

name = saved_name //Set the box's appearance
desc = saved_desc
icon = saved_icon
icon_state = saved_icon_state
item_state = saved_item_state
dir = saved_dir
pixel_x = saved_pixel_x
pixel_y = saved_pixel_y

saved_name = null //Reset the vars.
saved_desc = null
saved_icon = null
saved_icon_state = null
saved_item_state = null
saved_dir = null
saved_pixel_x = null
saved_pixel_y = null

active = 1

if(istype(loc, /mob/living/carbon)) //Update inhands (hopefully)
var/mob/living/carbon/C = loc
C.update_inv_l_hand()
C.update_inv_r_hand()

/obj/item/weapon/storage/box/chameleon/proc/disrupt()
if(active)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 0, src)
s.start()
toggle()
return //Attention, return here. If you're calling this make sure it's on the END of the proc you're calling it in!

/obj/item/weapon/storage/box/chameleon/handle_item_insertion(obj/item/W, prevent_warning = 0)
disrupt() //Can't push things trough from the outside if it's on.
..()

/obj/item/weapon/storage/box/chameleon/emp_act(var/severity)
disrupt()

/obj/item/weapon/storage/box/chameleon/ex_act(var/severity)
..()
disrupt()

/obj/item/weapon/storage/box/chameleon/bullet_act(var/obj/item/projectile/Proj)
disrupt()
31 changes: 31 additions & 0 deletions code/modules/clothing/under/mailman.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//Mail yourself anywhere, yo. ~By Miauw~
/obj/item/clothing/under/syndiemail
name = "mailman's jumpsuit"
desc = "<i>'Special delivery!'</i>"
icon_state = "mailman"
item_state = "b_suit"
item_color = "mailman"
var/sortTag //Disposals code reads this.
action_button_name = "Set Tag"


/obj/item/clothing/under/syndiemail/Topic(href, href_list)
if (usr.restrained() || usr.stat)
return
add_fingerprint(usr)
if(href_list["nextTag"])
var/n = text2num(href_list["nextTag"])
sortTag = n
tag_menu(usr, src)

/obj/item/clothing/under/syndiemail/attack_self(mob/user)
..()
tag_menu(user, src)

/obj/item/clothing/under/syndiemail/verb/toggle_light()
set name = "Set Tag"
set category = "Object"
set src in usr.contents

if(!usr.stat)
attack_self(usr)
24 changes: 10 additions & 14 deletions code/modules/recycling/disposal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,12 @@
// can breath normally in the disposal
/obj/machinery/disposal/alter_health()
return get_turf(src)

/obj/machinery/disposal/relaymove(mob/user as mob)
attempt_escape(user)

// resist to escape the bin
/obj/machinery/disposal/container_resist()
attempt_escape(usr)

/obj/machinery/disposal/proc/attempt_escape(mob/user as mob)
if(src.flushing)
return
go_out(user)
go_out(usr)
return

// leave the disposal
Expand Down Expand Up @@ -492,7 +486,7 @@

// initialize a holder from the contents of a disposal unit
proc/init(var/obj/machinery/disposal/D)
gas = D.air_contents// transfer gas resv. into holder object
gas = D.air_contents //transfer gas resv. into holder object

//Check for any living mobs trigger hasmob.
//hasmob effects whether the package goes to cargo or its tagged destination.
Expand All @@ -516,13 +510,15 @@
var/mob/living/carbon/human/H = AM
if(FAT in H.mutations) // is a human and fat?
has_fat_guy = 1 // set flag on holder
if(istype(H.get_item_by_slot(slot_w_uniform), /obj/item/clothing/under/syndiemail))
var/obj/item/clothing/under/syndiemail/temptag = H.get_item_by_slot(slot_w_uniform)
destinationTag = temptag.sortTag
if(istype(AM, /obj/structure/bigDelivery) && !hasmob)
var/obj/structure/bigDelivery/T = AM
src.destinationTag = T.sortTag
destinationTag = T.sortTag
if(istype(AM, /obj/item/smallDelivery) && !hasmob)
var/obj/item/smallDelivery/T = AM
src.destinationTag = T.sortTag

destinationTag = T.sortTag

// start the movement process
// argument is the disposal unit the holder started in
Expand Down Expand Up @@ -988,10 +984,10 @@
if(istype(I, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = I

if(O.currTag > 0)// Tag set
sortType = O.currTag
if(O.sortTag > 0)// Tag set
sortType = O.sortTag
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
var/tag = uppertext(TAGGERLOCATIONS[O.sortTag])
user << "\blue Changed filter to [tag]"
updatedesc()

Expand Down
125 changes: 60 additions & 65 deletions code/modules/recycling/sortingmachinery.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/proc/tag_menu(mob/user, obj/item/device/destTagger/target) //used for disposal taggers and mailman jumpsuits. totally worth it to prevent 14 lines of copypaste
var/dat = "<tt><center><h1><b>TagMaster 2.2</b></h1></center>"

dat += "<table style='width:100%; padding:4px;'><tr>"
for (var/i = 1, i <= TAGGERLOCATIONS.len, i++)
dat += "<td><a href='?src=\ref[target];nextTag=[i]'>[TAGGERLOCATIONS[i]]</a></td>"

if(i%4==0)
dat += "</tr><tr>"

dat += "</tr></table><br>Current Selection: [target.sortTag ? TAGGERLOCATIONS[target.sortTag] : "None"]</tt>"

user << browse(dat, "window=destTagScreen;size=450x350")
onclose(user, "destTagScreen")

/obj/structure/bigDelivery
name = "large parcel"
desc = "A big wrapped package."
Expand All @@ -10,44 +25,39 @@
var/sortTag = 0


/obj/structure/bigDelivery/attack_hand(mob/user as mob)
del(src)

/obj/structure/bigDelivery/Del()
if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
wrapped.loc = (get_turf(loc))
if(istype(wrapped, /obj/structure/closet))
var/obj/structure/closet/O = wrapped
O.welded = 0
var/turf/T = get_turf(src)
for(var/atom/movable/AM in contents)
AM.loc = T
..()

/obj/structure/bigDelivery/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W

if(sortTag != O.currTag)
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
user << "\blue *[tag]*"
sortTag = O.currTag
playsound(loc, 'sound/machines/twobeep.ogg', 100, 1)

else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
user << "<span class='notice'>Invalid text.</span>"
return
user.visible_message("<span class='notice'>[user] labels [src] as [str].</span>")
name = "[name] ([str])"
attack_hand(mob/user as mob)
if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
wrapped.loc = (get_turf(loc))
if(istype(wrapped, /obj/structure/closet))
var/obj/structure/closet/O = wrapped
O.welded = 0
del(src)

else if(istype(W, /obj/item/weapon/wrapping_paper))
user.visible_message("<span class='notice'>[user] wraps the package in festive paper!</span>")
if(istype(wrapped, /obj/structure/closet/crate))
icon_state = "giftcrate"
else
icon_state = "giftcloset"

attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W

if(sortTag != O.sortTag)
var/tag = uppertext(TAGGERLOCATIONS[O.sortTag])
user << "\blue *[tag]*"
sortTag = O.sortTag
playsound(loc, 'sound/machines/twobeep.ogg', 100, 1)

else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
user << "<span class='notice'>Invalid text.</span>"
return
user.visible_message("<span class='notice'>[user] labels [src] as [str].</span>")
name = "[name] ([str])"

else if(istype(W, /obj/item/weapon/wrapping_paper))
user.visible_message("<span class='notice'>[user] wraps the package in festive paper!</span>")
if(istype(wrapped, /obj/structure/closet/crate))
icon_state = "giftcrate"
else
icon_state = "giftcloset"


/obj/item/smallDelivery
Expand Down Expand Up @@ -75,10 +85,10 @@
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W

if(sortTag != O.currTag)
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
if(sortTag != O.sortTag)
var/tag = uppertext(TAGGERLOCATIONS[O.sortTag])
user << "\blue *[tag]*"
sortTag = O.currTag
sortTag = O.sortTag
playsound(loc, 'sound/machines/twobeep.ogg', 100, 1)

else if(istype(W, /obj/item/weapon/pen))
Expand Down Expand Up @@ -175,7 +185,7 @@
name = "destination tagger"
desc = "Used to set the destination of properly wrapped packages."
icon_state = "forensic0"
var/currTag = 0
var/sortTag = 0
//The whole system for the sorttype var is determined based on the order of this list,
//disposals must always be 1, since anything that's untagged will automatically go to disposals, or sorttype = 1 --Superxpdude

Expand All @@ -187,31 +197,16 @@
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT

proc/openwindow(mob/user as mob)
var/dat = "<tt><center><h1><b>TagMaster 2.2</b></h1></center>"

dat += "<table style='width:100%; padding:4px;'><tr>"
for (var/i = 1, i <= TAGGERLOCATIONS.len, i++)
dat += "<td><a href='?src=\ref[src];nextTag=[i]'>[TAGGERLOCATIONS[i]]</a></td>"

if(i%4==0)
dat += "</tr><tr>"

dat += "</tr></table><br>Current Selection: [currTag ? TAGGERLOCATIONS[currTag] : "None"]</tt>"

user << browse(dat, "window=destTagScreen;size=450x350")
onclose(user, "destTagScreen")

attack_self(mob/user as mob)
openwindow(user)
return
/obj/item/device/destTagger/attack_self(mob/user as mob)
tag_menu(user, src)
return

Topic(href, href_list)
add_fingerprint(usr)
if(href_list["nextTag"])
var/n = text2num(href_list["nextTag"])
currTag = n
openwindow(usr)
/obj/item/device/destTagger/Topic(href, href_list)
add_fingerprint(usr)
if(href_list["nextTag"])
var/n = text2num(href_list["nextTag"])
sortTag = n
tag_menu(usr, src)

/obj/machinery/disposal/deliveryChute
name = "delivery chute"
Expand Down
Loading