mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-19 02:50:08 +01:00
This is part 1 of a project to, eventually, bring the render planes system from /tg/ and bay into Aurora. This is a prerequisite and blocker for many things the development team and community want to have, and this was long overdue. Many objects have been re-assigned layers, which are now thoroughly defined. Maps have had their custom layer defines purged, as we should be moving away from this in favor of saner definitions in the base items. This should be a test-merge due to the sheer amount of layers changed, which will very likely create issues that I cannot possibly discover and debug in a reasonable amount of time myself. --------- Co-authored-by: Cody Brittain <cbrittain10@live.com>
102 lines
3.3 KiB
Plaintext
102 lines
3.3 KiB
Plaintext
/obj/item/paper_bin
|
|
name = "paper bin"
|
|
icon = 'icons/obj/bureaucracy.dmi'
|
|
icon_state = "paper_bin1"
|
|
item_state = "sheet-metal"
|
|
drop_sound = 'sound/items/drop/cardboardbox.ogg'
|
|
pickup_sound = 'sound/items/pickup/cardboardbox.ogg'
|
|
throwforce = 1
|
|
w_class = ITEMSIZE_HUGE
|
|
throw_speed = 3
|
|
throw_range = 7
|
|
layer = BELOW_OBJ_LAYER
|
|
var/amount = 30 //How much paper is in the bin.
|
|
var/list/papers = new/list() //List of papers put in the bin for reference.
|
|
|
|
|
|
/obj/item/paper_bin/MouseDrop(mob/user as mob)
|
|
if((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr))))))
|
|
if(!istype(usr, /mob/living/carbon/slime) && !istype(usr, /mob/living/simple_animal))
|
|
if( !usr.get_active_hand() ) //if active hand is empty
|
|
var/mob/living/carbon/human/H = user
|
|
var/obj/item/organ/external/temp = H.organs_by_name[BP_R_HAND]
|
|
|
|
if (H.hand)
|
|
temp = H.organs_by_name[BP_L_HAND]
|
|
if(temp && !temp.is_usable())
|
|
to_chat(user, "<span class='notice'>You try to move your [temp.name], but cannot!</span>")
|
|
return
|
|
|
|
to_chat(user, "<span class='notice'>You pick up the [src].</span>")
|
|
user.put_in_hands(src)
|
|
|
|
return
|
|
|
|
/obj/item/paper_bin/attack_hand(mob/user as mob)
|
|
if(ishuman(user))
|
|
var/mob/living/carbon/human/H = user
|
|
var/obj/item/organ/external/temp = H.organs_by_name[BP_R_HAND]
|
|
if (H.hand)
|
|
temp = H.organs_by_name[BP_L_HAND]
|
|
if(temp && !temp.is_usable())
|
|
to_chat(user, "<span class='notice'>You try to move your [temp.name], but cannot!</span>")
|
|
return
|
|
var/response = ""
|
|
if(!papers.len > 0)
|
|
response = alert(user, "Do you take regular paper, or Carbon copy paper?", "Paper type request", "Regular", "Carbon-Copy", "Cancel")
|
|
if (response != "Regular" && response != "Carbon-Copy")
|
|
add_fingerprint(user)
|
|
return
|
|
if(amount >= 1)
|
|
amount--
|
|
if(amount==0)
|
|
update_icon()
|
|
|
|
var/obj/item/paper/P
|
|
if(papers.len > 0) //If there's any custom paper on the stack, use that instead of creating a new paper.
|
|
P = papers[papers.len]
|
|
papers.Remove(P)
|
|
else
|
|
if(response == "Regular")
|
|
P = new /obj/item/paper
|
|
if(Holiday == "April Fool's Day")
|
|
if(prob(30))
|
|
P.info = "<font face=\"[P.crayonfont]\" color=\"red\"><b>HONK HONK HONK HONK HONK HONK HONK<br>HOOOOOOOOOOOOOOOOOOOOOONK<br>APRIL FOOLS</b></font>"
|
|
P.rigged = 1
|
|
P.updateinfolinks()
|
|
else if (response == "Carbon-Copy")
|
|
P = new /obj/item/paper/carbon
|
|
|
|
P.forceMove(user.loc)
|
|
user.put_in_hands(P)
|
|
to_chat(user, "<span class='notice'>You take [P] out of the [src].</span>")
|
|
else
|
|
to_chat(user, "<span class='notice'>[src] is empty!</span>")
|
|
|
|
add_fingerprint(user)
|
|
return
|
|
|
|
|
|
/obj/item/paper_bin/attackby(obj/item/attacking_item, mob/user)
|
|
if(istype(attacking_item, /obj/item/paper))
|
|
var/obj/item/paper/i = attacking_item
|
|
user.drop_from_inventory(i,src)
|
|
to_chat(user, "<span class='notice'>You put [i] in [src].</span>")
|
|
papers.Add(i)
|
|
amount++
|
|
|
|
/obj/item/paper_bin/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
|
. = ..()
|
|
if(is_adjacent)
|
|
if(amount)
|
|
. += "<span class='notice'>There " + (amount > 1 ? "are [amount] papers" : "is one paper") + " in the bin.</span>"
|
|
else
|
|
. += "<span class='notice'>There are no papers in the bin.</span>"
|
|
|
|
|
|
/obj/item/paper_bin/update_icon()
|
|
if(amount < 1)
|
|
icon_state = "paper_bin0"
|
|
else
|
|
icon_state = "paper_bin1"
|