mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Here's the new files.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3857 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
/mob/proc/get_active_hand()
|
||||
if (hand)
|
||||
return l_hand
|
||||
else
|
||||
return r_hand
|
||||
|
||||
/mob/proc/get_inactive_hand()
|
||||
if (!hand)
|
||||
return l_hand
|
||||
else
|
||||
return r_hand
|
||||
|
||||
/mob/proc/put_in_hand(var/obj/item/I)
|
||||
if(!I) return
|
||||
I.loc = src
|
||||
if (hand)
|
||||
l_hand = I
|
||||
update_inv_l_hand()
|
||||
else
|
||||
r_hand = I
|
||||
update_inv_r_hand()
|
||||
I.layer = 20
|
||||
|
||||
/mob/proc/put_in_hands(var/obj/item/I) //A suprisingly useful proc. Allows a simple way to place an object in a mob's hands, or, if they are full, on the ground below them.
|
||||
if(!r_hand)
|
||||
I.loc = src
|
||||
r_hand = I
|
||||
update_inv_r_hand()
|
||||
I.layer = 20
|
||||
else if(!l_hand)
|
||||
I.loc = src
|
||||
l_hand = I
|
||||
update_inv_l_hand()
|
||||
I.layer = 20
|
||||
else
|
||||
I.loc = get_turf(src)
|
||||
|
||||
/mob/proc/drop_item_v()
|
||||
if (stat == 0)
|
||||
drop_item()
|
||||
return
|
||||
|
||||
/mob/proc/drop_from_slot(var/obj/item/item)
|
||||
if(!item)
|
||||
return
|
||||
if(!(item in contents))
|
||||
return
|
||||
u_equip(item)
|
||||
if (client)
|
||||
client.screen -= item
|
||||
if (item)
|
||||
item.loc = loc
|
||||
item.dropped(src)
|
||||
if (item)
|
||||
item.layer = initial(item.layer)
|
||||
var/turf/T = get_turf(loc)
|
||||
if (istype(T))
|
||||
T.Entered(item)
|
||||
return
|
||||
|
||||
/mob/proc/drop_item(var/atom/target)
|
||||
var/obj/item/W = equipped()
|
||||
|
||||
if (W)
|
||||
u_equip(W)
|
||||
update_icons()
|
||||
if (client)
|
||||
client.screen -= W
|
||||
if (W)
|
||||
W.layer = initial(W.layer)
|
||||
if(target)
|
||||
W.loc = target.loc
|
||||
else
|
||||
W.loc = loc
|
||||
W.dropped(src)
|
||||
var/turf/T = get_turf(loc)
|
||||
if (istype(T))
|
||||
T.Entered(W)
|
||||
return
|
||||
|
||||
/mob/proc/before_take_item(var/obj/item/item)
|
||||
item.loc = null
|
||||
item.layer = initial(item.layer)
|
||||
u_equip(item)
|
||||
//if (client)
|
||||
// client.screen -= item
|
||||
update_icons()
|
||||
return
|
||||
|
||||
/mob/proc/put_in_inactive_hand(var/obj/item/I)
|
||||
I.loc = src
|
||||
if (!hand)
|
||||
l_hand = I
|
||||
update_inv_l_hand()
|
||||
else
|
||||
r_hand = I
|
||||
update_inv_r_hand()
|
||||
I.layer = 20
|
||||
|
||||
|
||||
/mob/proc/equipped()
|
||||
if(issilicon(src))
|
||||
if(isrobot(src))
|
||||
if(src:module_active)
|
||||
return src:module_active
|
||||
else
|
||||
if (hand)
|
||||
return l_hand
|
||||
else
|
||||
return r_hand
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/proc/u_equip(W as obj)
|
||||
if (W == r_hand)
|
||||
r_hand = null
|
||||
update_inv_r_hand()
|
||||
else if (W == l_hand)
|
||||
l_hand = null
|
||||
update_inv_l_hand()
|
||||
else if (W == handcuffed)
|
||||
handcuffed = null
|
||||
update_inv_handcuffed()
|
||||
else if (W == back)
|
||||
back = null
|
||||
update_inv_back()
|
||||
else if (W == wear_mask)
|
||||
wear_mask = null
|
||||
update_inv_wear_mask()
|
||||
return
|
||||
|
||||
|
||||
//Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob.
|
||||
/mob/proc/remove_from_mob(var/obj/O)
|
||||
src.u_equip(O)
|
||||
if (src.client)
|
||||
src.client.screen -= O
|
||||
O.layer = initial(O.layer)
|
||||
O.screen_loc = null
|
||||
return 1
|
||||
@@ -0,0 +1,82 @@
|
||||
//unequip
|
||||
/mob/living/carbon/alien/humanoid/u_equip(obj/item/W as obj)
|
||||
if (W == wear_suit)
|
||||
wear_suit = null
|
||||
update_inv_wear_suit(0)
|
||||
else if (W == head)
|
||||
head = null
|
||||
update_inv_head(0)
|
||||
else if (W == r_store)
|
||||
r_store = null
|
||||
update_inv_pockets(0)
|
||||
else if (W == l_store)
|
||||
l_store = null
|
||||
update_inv_pockets(0)
|
||||
else if (W == r_hand)
|
||||
r_hand = null
|
||||
update_inv_r_hand(0)
|
||||
else if (W == l_hand)
|
||||
l_hand = null
|
||||
update_inv_l_hand(0)
|
||||
|
||||
/mob/living/carbon/alien/humanoid/db_click(text, t1)
|
||||
var/obj/item/W = equipped()
|
||||
var/emptyHand = (W == null)
|
||||
if ((!emptyHand) && (!istype(W, /obj/item)))
|
||||
return
|
||||
if (emptyHand)
|
||||
usr.next_move = usr.prev_move
|
||||
usr:lastDblClick -= 3 //permit the double-click redirection to proceed.
|
||||
switch(text)
|
||||
|
||||
//if emptyhand then wear the suit, no bedsheet clothes for the alien
|
||||
|
||||
if("o_clothing")
|
||||
if (wear_suit)
|
||||
if (emptyHand)
|
||||
wear_suit.DblClick()
|
||||
// else
|
||||
// update_inv_wear_suit()
|
||||
return
|
||||
/* if (!( istype(W, /obj/item/clothing/suit) ))
|
||||
return
|
||||
u_equip(W)
|
||||
wear_suit = W
|
||||
W.equipped(src, text)
|
||||
*/
|
||||
if("head")
|
||||
if (head)
|
||||
if (emptyHand)
|
||||
head.DblClick()
|
||||
else if (( istype(W, /obj/effect/alien/head) )) //TODO: figure out wtf this is about ~Carn
|
||||
u_equip(W)
|
||||
head = W
|
||||
update_inv_head()
|
||||
return
|
||||
/* if (!( istype(W, /obj/item/clothing/head) ))
|
||||
return
|
||||
u_equip(W)
|
||||
head = W
|
||||
W.equipped(src, text)
|
||||
*/
|
||||
if("storage1")
|
||||
if (l_store)
|
||||
if (emptyHand)
|
||||
l_store.DblClick()
|
||||
return
|
||||
if ((!( istype(W, /obj/item) ) || W.w_class > 3))
|
||||
return
|
||||
u_equip(W)
|
||||
l_store = W
|
||||
update_inv_pockets()
|
||||
if("storage2")
|
||||
if (r_store)
|
||||
if (emptyHand)
|
||||
r_store.DblClick()
|
||||
return
|
||||
if ((!( istype(W, /obj/item) ) || W.w_class > 3))
|
||||
return
|
||||
u_equip(W)
|
||||
r_store = W
|
||||
update_inv_pockets()
|
||||
return
|
||||
@@ -0,0 +1,3 @@
|
||||
//can't unequip since it can't equip anything
|
||||
/mob/living/carbon/alien/larva/u_equip(obj/item/W as obj)
|
||||
return
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,182 @@
|
||||
/obj/effect/equip_e/monkey/process()
|
||||
if (item)
|
||||
item.add_fingerprint(source)
|
||||
if (!( item ))
|
||||
switch(place)
|
||||
if("head")
|
||||
if (!( target.wear_mask ))
|
||||
del(src)
|
||||
return
|
||||
if("l_hand")
|
||||
if (!( target.l_hand ))
|
||||
del(src)
|
||||
return
|
||||
if("r_hand")
|
||||
if (!( target.r_hand ))
|
||||
del(src)
|
||||
return
|
||||
if("back")
|
||||
if (!( target.back ))
|
||||
del(src)
|
||||
return
|
||||
if("handcuff")
|
||||
if (!( target.handcuffed ))
|
||||
del(src)
|
||||
return
|
||||
if("internal")
|
||||
if ((!( (istype(target.wear_mask, /obj/item/clothing/mask) && istype(target.back, /obj/item/weapon/tank) && !( target.internal )) ) && !( target.internal )))
|
||||
del(src)
|
||||
return
|
||||
|
||||
if (item)
|
||||
for(var/mob/O in viewers(target, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] is trying to put a [] on []</B>", source, item, target), 1)
|
||||
else
|
||||
var/message = null
|
||||
switch(place)
|
||||
if("mask")
|
||||
if(istype(target.wear_mask, /obj/item/clothing)&&!target.wear_mask:canremove)
|
||||
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.wear_mask, target)
|
||||
else
|
||||
message = text("\red <B>[] is trying to take off \a [] from []'s head!</B>", source, target.wear_mask, target)
|
||||
if("l_hand")
|
||||
message = text("\red <B>[] is trying to take off a [] from []'s left hand!</B>", source, target.l_hand, target)
|
||||
if("r_hand")
|
||||
message = text("\red <B>[] is trying to take off a [] from []'s right hand!</B>", source, target.r_hand, target)
|
||||
if("back")
|
||||
message = text("\red <B>[] is trying to take off a [] from []'s back!</B>", source, target.back, target)
|
||||
if("handcuff")
|
||||
message = text("\red <B>[] is trying to unhandcuff []!</B>", source, target)
|
||||
if("internal")
|
||||
if (target.internal)
|
||||
message = text("\red <B>[] is trying to remove []'s internals</B>", source, target)
|
||||
else
|
||||
message = text("\red <B>[] is trying to set on []'s internals.</B>", source, target)
|
||||
else
|
||||
for(var/mob/M in viewers(target, null))
|
||||
M.show_message(message, 1)
|
||||
spawn( 30 )
|
||||
done()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/effect/equip_e/monkey/done()
|
||||
if(!source || !target) return
|
||||
if(source.loc != s_loc) return
|
||||
if(target.loc != t_loc) return
|
||||
if(LinkBlocked(s_loc,t_loc)) return
|
||||
if(item && source.equipped() != item) return
|
||||
if ((source.restrained() || source.stat)) return
|
||||
switch(place)
|
||||
if("mask")
|
||||
if (target.wear_mask)
|
||||
if(istype(target.wear_mask, /obj/item/clothing)&& !target.wear_mask:canremove)
|
||||
return
|
||||
var/obj/item/W = target.wear_mask
|
||||
target.u_equip(W)
|
||||
if (target.client)
|
||||
target.client.screen -= W
|
||||
if (W)
|
||||
W.loc = target.loc
|
||||
W.dropped(target)
|
||||
W.layer = initial(W.layer)
|
||||
W.add_fingerprint(source)
|
||||
else
|
||||
if (istype(item, /obj/item/clothing/mask))
|
||||
source.drop_item()
|
||||
loc = target
|
||||
item.layer = 20
|
||||
target.wear_mask = item
|
||||
item.loc = target
|
||||
if("l_hand")
|
||||
if (target.l_hand)
|
||||
var/obj/item/W = target.l_hand
|
||||
target.u_equip(W)
|
||||
if (target.client)
|
||||
target.client.screen -= W
|
||||
if (W)
|
||||
W.loc = target.loc
|
||||
W.dropped(target)
|
||||
W.layer = initial(W.layer)
|
||||
W.add_fingerprint(source)
|
||||
else
|
||||
if (istype(item, /obj/item))
|
||||
source.drop_item()
|
||||
loc = target
|
||||
item.layer = 20
|
||||
target.l_hand = item
|
||||
item.loc = target
|
||||
if("r_hand")
|
||||
if (target.r_hand)
|
||||
var/obj/item/W = target.r_hand
|
||||
target.u_equip(W)
|
||||
if (target.client)
|
||||
target.client.screen -= W
|
||||
if (W)
|
||||
W.loc = target.loc
|
||||
W.dropped(target)
|
||||
W.layer = initial(W.layer)
|
||||
W.add_fingerprint(source)
|
||||
else
|
||||
if (istype(item, /obj/item))
|
||||
source.drop_item()
|
||||
loc = target
|
||||
item.layer = 20
|
||||
target.r_hand = item
|
||||
item.loc = target
|
||||
if("back")
|
||||
if (target.back)
|
||||
var/obj/item/W = target.back
|
||||
target.u_equip(W)
|
||||
if (target.client)
|
||||
target.client.screen -= W
|
||||
if (W)
|
||||
W.loc = target.loc
|
||||
W.dropped(target)
|
||||
W.layer = initial(W.layer)
|
||||
W.add_fingerprint(source)
|
||||
else
|
||||
if ((istype(item, /obj/item) && item.slot_flags & SLOT_BACK ))
|
||||
source.drop_item()
|
||||
loc = target
|
||||
item.layer = 20
|
||||
target.back = item
|
||||
item.loc = target
|
||||
if("handcuff")
|
||||
if (target.handcuffed)
|
||||
var/obj/item/W = target.handcuffed
|
||||
target.u_equip(W)
|
||||
if (target.client)
|
||||
target.client.screen -= W
|
||||
if (W)
|
||||
W.loc = target.loc
|
||||
W.dropped(target)
|
||||
W.layer = initial(W.layer)
|
||||
W.add_fingerprint(source)
|
||||
else
|
||||
if (istype(item, /obj/item/weapon/handcuffs))
|
||||
source.drop_item()
|
||||
target.handcuffed = item
|
||||
item.loc = target
|
||||
if("internal")
|
||||
if (target.internal)
|
||||
target.internal.add_fingerprint(source)
|
||||
target.internal = null
|
||||
else
|
||||
if (target.internal)
|
||||
target.internal = null
|
||||
if (!( istype(target.wear_mask, /obj/item/clothing/mask) ))
|
||||
return
|
||||
else
|
||||
if (istype(target.back, /obj/item/weapon/tank))
|
||||
target.internal = target.back
|
||||
target.internal.add_fingerprint(source)
|
||||
for(var/mob/M in viewers(target, 1))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message(text("[] is now running on internals.", target), 1)
|
||||
else
|
||||
source.regenerate_icons()
|
||||
target.regenerate_icons()
|
||||
del(src)
|
||||
return
|
||||
Reference in New Issue
Block a user