ugh...this was horrible. I'm really sorry if I fucked anything up, I was literally going braindead towards the end.

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
This commit is contained in:
elly1989@rocketmail.com
2012-06-23 21:24:45 +00:00
parent ce21bded5f
commit 48088b79d9
136 changed files with 972 additions and 1522 deletions
+14 -20
View File
@@ -755,14 +755,12 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/proc/remove_id()
if (id)
if (istype(loc, /mob))
if (ismob(loc))
var/mob/M = loc
if(M.equipped() == null)
M.put_in_hand(id)
id = null
usr << "\blue You remove the ID from the [name]."
return
id.loc = get_turf(src)
M.put_in_hands(id)
usr << "<span class='notice'>You remove the ID from the [name].</span>"
else
id.loc = get_turf(src)
id = null
/obj/item/device/pda/proc/telecomms_process(var/receipent, var/originator, var/data)
@@ -820,8 +818,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(O)
if (istype(loc, /mob))
var/mob/M = loc
if(M.equipped() == null)
M.put_in_hand(O)
if(M.get_active_hand() == null)
M.put_in_hands(O)
usr << "<span class='notify'>You remove \the [O] from \the [src].</span>"
return
O.loc = get_turf(src)
@@ -835,23 +833,19 @@ var/global/list/obj/item/device/pda/PDAs = list()
if (id)
remove_id()
else
var/obj/item/I = user.equipped()
var/obj/item/I = user.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
user.drop_item()
I.loc = src
id = I
else
var/obj/item/weapon/card/I = user.equipped()
var/obj/item/weapon/card/I = user.get_active_hand()
if (istype(I, /obj/item/weapon/card/id) && I:registered_name)
if(id)//Get id and replace it.
user.drop_item()
I.loc = src
user.put_in_hand(id)
id = I
else//Insert id.
user.drop_item()
I.loc = src
id = I
var/obj/old_id = id
user.drop_item()
I.loc = src
id = I
user.put_in_hands(old_id)
return
// access to status display signals