First round of fixes:

- Fixed swap hands finding the wrong index
- Fixed dual HANDS_LAYER reading for abductors
- Fixed old comments
- Removed lingering pieces of a previous version
- Finish hooking up stripping
This commit is contained in:
Remie Richards
2016-09-02 17:57:59 +01:00
parent 00738bd2a3
commit e19b154d00
9 changed files with 39 additions and 22 deletions

View File

@@ -17,8 +17,8 @@
#define slot_back 1
#define slot_wear_mask 2
#define slot_handcuffed 3
#define slot_hands 4 //wherever you provide a slot for hands you provide slot_hands AND a hand index (1 to held_items.len)
//there are various helper procs to find an appropriate index
#define slot_hands 4 //wherever you provide a slot for hands you provide slot_hands
//slot_hands as a slot will pick ANY available hand
#define slot_belt 5
#define slot_wear_id 6
#define slot_ears 7

View File

@@ -173,7 +173,7 @@
entry.name = target.name
entry.icon = target.icon
entry.icon_state = target.icon_state
entry.overlays = target.get_overlays_copy(list(HANDS_LAYER,HANDS_LAYER))
entry.overlays = target.get_overlays_copy(list(HANDS_LAYER))
for(var/i=1,i<=disguises.len,i++)
var/datum/icon_snapshot/temp = disguises[i]
if(temp.name == entry.name)

View File

@@ -228,10 +228,6 @@
return FALSE
/*
/mob/proc/drop_l_hand() //pending re-implementation
/mob/proc/drop_r_hand()
*/
/mob/proc/drop_all_held_items()
if(!loc || !loc.allow_drop())
return

View File

@@ -81,7 +81,7 @@
/mob/living/carbon/swap_hand(held_index)
if(!held_index)
held_index = (held_index % held_items.len)+1
held_index = (active_hand_index % held_items.len)+1
var/obj/item/item_in_hand = src.get_active_held_item()
if(item_in_hand) //this segment checks if the item in your hand is twohanded.
@@ -103,7 +103,7 @@
/mob/living/carbon/activate_hand(selhand) //l/r OR 1-held_items.len
if(!selhand)
selhand = (selhand % held_items.len)+1
selhand = (active_hand_index % held_items.len)+1
if(istext(selhand))
selhand = lowertext(selhand)

View File

@@ -458,7 +458,7 @@ There are several things that need to be remembered:
/mob/living/carbon/human/proc/get_overlays_copy(list/unwantedLayers)
var/list/out = new
for(var/i=1;i<=TOTAL_LAYERS;i++)
for(var/i in 1 to TOTAL_LAYERS)
if(overlays_standing[i])
if(i in unwantedLayers)
continue

View File

@@ -1,4 +1,4 @@
/mob/living/carbon/get_item_by_slot(slot_id, hand_index)
/mob/living/carbon/get_item_by_slot(slot_id)
switch(slot_id)
if(slot_back)
return back

View File

@@ -783,9 +783,15 @@
"<span class='userdanger'>[src] tries to remove [who]'s [what.name].</span>")
what.add_fingerprint(src)
if(do_mob(src, who, what.strip_delay))
if(what && what == who.get_item_by_slot(where) && Adjacent(who))
who.unEquip(what)
add_logs(src, who, "stripped", addition="of [what]")
if(what && Adjacent(who))
if(islist(where))
var/list/L = where
if(what == who.get_item_for_held_index(L[2]))
who.unEquip(what)
add_logs(src, who, "stripped", addition="of [what]")
if(what == who.get_item_by_slot(where))
who.unEquip(what)
add_logs(src, who, "stripped", addition="of [what]")
// The src mob is trying to place an item on someone
// Override if a certain mob should be behave differently when placing items (can't, for example)
@@ -795,14 +801,24 @@
src << "<span class='warning'>You can't put \the [what.name] on [who], it's stuck to your hand!</span>"
return
if(what)
if(!what.mob_can_equip(who, src, where, 1))
src << "<span class='warning'>\The [what.name] doesn't fit in that place!</span>"
return
var/list/where_list
if(islist(where))
where_list = where
if(!what.mob_can_equip(who, src, where[1], 1))
src << "<span class='warning'>\The [what.name] doesn't fit in that place!</span>"
return
else
if(!what.mob_can_equip(who, src, where, 1))
src << "<span class='warning'>\The [what.name] doesn't fit in that place!</span>"
return
visible_message("<span class='notice'>[src] tries to put [what] on [who].</span>")
if(do_mob(src, who, what.put_on_delay))
if(what && Adjacent(who))
unEquip(what)
who.equip_to_slot_if_possible(what, where, 0, 1)
if(where_list)
who.put_in_hand(what, where_list[2])
else
who.equip_to_slot_if_possible(what, where, 0, 1)
add_logs(src, who, "equipped", what)
/mob/living/singularity_act()

View File

@@ -621,7 +621,7 @@
if(!dextrous)
return ..()
if(!selhand)
selhand = (selhand % held_items.len)+1
selhand = (active_hand_index % held_items.len)+1
if(istext(selhand))
selhand = lowertext(selhand)
if(selhand == "right" || selhand == "r")
@@ -637,7 +637,7 @@
if(!dextrous)
return ..()
if(!hand_index)
hand_index = (hand_index % held_items.len)+1
hand_index = (active_hand_index % held_items.len)+1
var/obj/item/held_item = get_active_held_item()
if(held_item)
if(istype(held_item, /obj/item/weapon/twohanded))

View File

@@ -528,8 +528,13 @@ var/next_mob_id = 0
if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
if(href_list["item"])
var/slot = text2num(href_list["item"])
var/obj/item/what = get_item_by_slot(slot)
var/hand_index = text2num(href_list["hand_index"])
var/obj/item/what
if(hand_index)
what = get_item_for_held_index(hand_index)
slot = list(slot,hand_index)
else
what = get_item_by_slot(slot)
if(what)
usr.stripPanelUnequip(what,src,slot)
else