mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-01-23 23:43:28 +00:00
Replaced every l_hand = and r_hand = and all that if(hand) crap to use standardised procs. This means we can use procs like Dropped() reliably as they will always be called when things are dropped. Thorough documentation to come. But generally, if you want a mob's icons to update after deleting something in the inventory...use drop_from_inventory(the_thing_you_wanna_drop) just before deleting it. If you wanna put something in a mob's hands use put_in_hands() (or one of the variants). It'll try putting it in active hand first, then inactive, then the floor. They handle layers, overlays, screenlocs calling various procs such as dropped() etc for you. Easy mob.equipped() is now mob.get_active_hand() because there was another totally unrelated proc named equipped() and stuff was confusing. Weakening was made instantaneous. Minor optimisations for human/handle_regular_status_updates(). I'll port these changes over to the other mobs next. Basically it should stop it constantly incrementing every status effect even after death. umm... bunch of overlays related fixes... I think that's everything. :/ git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3900 316c924e-a436-60f5-8080-3fe189b3f50e
85 lines
2.2 KiB
Plaintext
85 lines
2.2 KiB
Plaintext
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
|
|
|
/obj/item/weapon/paper_bin
|
|
name = "paper bin"
|
|
icon = '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.
|
|
var/sealed = 1 //If it's brandnew and unopened, it's sealed.
|
|
|
|
MouseDrop(mob/user as mob)
|
|
if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr))))))
|
|
|
|
if( !usr.get_active_hand() ) //if active hand is empty
|
|
attack_hand(usr, 1, 1)
|
|
|
|
return
|
|
|
|
|
|
attack_paw(mob/user as mob)
|
|
return src.attack_hand(user)
|
|
|
|
attack_hand(mob/user as mob)
|
|
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 == "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()
|
|
|
|
P.loc = user.loc
|
|
if(ishuman(user))
|
|
if(!user.get_active_hand())
|
|
user.put_in_hands(P)
|
|
user << "You take a paper out of the bin."
|
|
else
|
|
P.loc = get_turf_loc(src)
|
|
user << "You take a paper out of the bin."
|
|
else
|
|
user << "The paper bin is empty!"
|
|
|
|
add_fingerprint(user)
|
|
return
|
|
|
|
attackby(obj/item/weapon/paper/i as obj, mob/user as mob)
|
|
if(!istype(i))
|
|
return
|
|
|
|
user.drop_item()
|
|
i.loc = src
|
|
usr << "You put the paper on the top of the paper bin."
|
|
papers.Add(i)
|
|
amount++
|
|
|
|
examine()
|
|
set src in oview(1)
|
|
|
|
if(amount)
|
|
usr << "There " + (amount > 1 ? "are [amount] papers" : "is one paper") + " in the bin."
|
|
else
|
|
usr << "There are no papers in the bin."
|
|
return
|
|
|
|
update_icon()
|
|
if(amount < 1)
|
|
icon_state = "paper_bin0"
|
|
else
|
|
icon_state = "paper_bin1"
|