Files
Paradise/code/modules/paperwork/paperbin.dm
MrPerson 3d9fd8d6a0 Change holidays into datums
Holidays are now actual datums with procs and vars and everything.
Holidays run a proc called celebrate() when it's time to celebrate them.
Currently none of them do anything but that should change, wink wink.
Holidays can now run for more than a day. The important ones, april fools,
christmas, halloween, new years, and easter, all last at least a week.
The idea is so people can celebrate christmas in game without having to,
you know, actually play on fucking christmas. And also to put a time limit
on how long stuff like the annoying spookoween closet skeletons will stick
around so it doesn't overstay its welcome and become annoying as shit like
last year.

The event SS now allows more than 1 holiday to run at a time.
This matters for new years + christmas, easter + april fools, easter + 4/20,
and any holiday that can happen on friday the 13th.
The events get stored in a list that's only initialized if there's an active
holiday so testing for potential holidays is still pretty easy.
Added more easter dates so we won't have to add more until 2040.
The current batch run out in 2017.

:-------------PARACODE NOTES------------:
Tied to event process
Extra procs for holidays to be able to run special events alone
Admin manual-override functionality maintained and ported to new system
2015-05-15 20:52:39 -07:00

142 lines
3.5 KiB
Plaintext

/obj/item/weapon/paper_bin
name = "paper bin"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "paper_bin1"
item_state = "sheet-metal"
throwforce = 1
w_class = 3
throw_speed = 3
throw_range = 7
pressure_resistance = 10
var/amount = 30 //How much paper is in the bin.
var/list/papers = new/list() //List of papers put in the bin for reference.
/*
autoignition_temperature = 519.15 // Kelvin
/obj/item/weapon/paper_bin/ignite(var/temperature)
on_fire=1
visible_message("\The [src]'s paper bursts into flame!")
overlays += fire_sprite
spawn(rand(3,10) SECONDS)
if(!on_fire)
return
new ashtype(src.loc)
papers=0
amount=0
update_icon()
*///LINDA shit figure out later
/obj/item/weapon/paper_bin/MouseDrop(atom/over_object)
var/mob/M = usr
if(M.restrained() || M.stat || !Adjacent(M))
return
if(over_object == M)
M.put_in_hands(src)
else if(istype(over_object, /obj/screen))
switch(over_object.name)
if("r_hand")
if(!M.unEquip(src))
return
M.put_in_r_hand(src)
if("l_hand")
if(!M.unEquip(src))
return
M.put_in_l_hand(src)
add_fingerprint(M)
/obj/item/weapon/paper_bin/attack_paw(mob/user as mob)
return attack_hand(user)
/obj/item/weapon/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["r_hand"]
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
H << "<span class='notice'>You try to move your [temp.name], but cannot!"
return
if(amount >= 1)
amount--
if(amount==0)
update_icon()
var/obj/item/weapon/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
P = new /obj/item/weapon/paper
if(holiday_master.holidays && holiday_master.holidays[APRIL_FOOLS])
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()
P.loc = user.loc
user.put_in_hands(P)
user << "<span class='notice'>You take [P] out of the [src].</span>"
else
user << "<span class='notice'>[src] is empty!</span>"
add_fingerprint(user)
return
/obj/item/weapon/paper_bin/attackby(obj/item/weapon/paper/i as obj, mob/user as mob, params)
if(!istype(i))
return
user.drop_item()
i.loc = src
user << "<span class='notice'>You put [i] in [src].</span>"
papers.Add(i)
amount++
/obj/item/weapon/paper_bin/examine()
set src in oview(1)
if(amount)
usr << "<span class='notice'>There " + (amount > 1 ? "are [amount] papers" : "is one paper") + " in the bin.</span>"
else
usr << "<span class='notice'>There are no papers in the bin.</span>"
return
/obj/item/weapon/paper_bin/update_icon()
if(amount < 1)
icon_state = "paper_bin0"
else
icon_state = "paper_bin1"
/obj/item/weapon/paper_bin/carbon
name = "carbonless paper bin"
icon_state = "paper_bin2"
/obj/item/weapon/paper_bin/carbon/attack_hand(mob/user as mob)
if(amount >= 1)
amount--
if(amount==0)
update_icon()
var/obj/item/weapon/paper/carbon/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
P = new /obj/item/weapon/paper/carbon
P.loc = user.loc
user.put_in_hands(P)
user << "<span class='notice'>You take [P] out of the [src].</span>"
else
user << "<span class='notice'>[src] is empty!</span>"
add_fingerprint(user)
return