mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Moving some inventory/equipping related stuff into separate files whilst I tidy up and reorganise them.
Removed some Geas stuff that didn't do anything. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3856 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -139,88 +139,6 @@
|
||||
|
||||
return
|
||||
|
||||
//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
|
||||
|
||||
/mob/living/carbon/alien/humanoid/meteorhit(O as obj)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
|
||||
@@ -138,9 +138,6 @@
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
//can't unequip since it can't equip anything
|
||||
/mob/living/carbon/alien/larva/u_equip(obj/item/W as obj)
|
||||
return
|
||||
|
||||
//can't equip anything
|
||||
/mob/living/carbon/alien/larva/db_click(text, t1)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -383,11 +383,7 @@
|
||||
else
|
||||
lying = 0
|
||||
canmove = 1
|
||||
/* for(var/obj/effect/stop/S in geaslist)
|
||||
if(S.victim == src)
|
||||
geaslist -= S
|
||||
del(S)
|
||||
*/
|
||||
|
||||
|
||||
proc/handle_breath(datum/gas_mixture/breath)
|
||||
if(nodamage || REBREATHER in augmentations)
|
||||
|
||||
@@ -511,188 +511,6 @@
|
||||
del(src)
|
||||
return
|
||||
|
||||
/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
|
||||
|
||||
/mob/living/carbon/monkey/IsAdvancedToolUser()//Unless its monkey mode monkeys cant use advanced tools
|
||||
if(!ticker) return 0
|
||||
|
||||
+16
-181
@@ -136,93 +136,6 @@
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
/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/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_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/reset_view(atom/A)
|
||||
if (client)
|
||||
if (istype(A, /atom/movable))
|
||||
@@ -237,17 +150,6 @@
|
||||
client.eye = loc
|
||||
return
|
||||
|
||||
/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
|
||||
return
|
||||
|
||||
/mob/proc/show_inv(mob/user as mob)
|
||||
user.machine = src
|
||||
@@ -268,37 +170,6 @@
|
||||
onclose(user, "mob[name]")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/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
|
||||
|
||||
|
||||
/mob/proc/ret_grab(obj/effect/list_container/mobl/L as obj, flag)
|
||||
if ((!( istype(l_hand, /obj/item/weapon/grab) ) && !( istype(r_hand, /obj/item/weapon/grab) )))
|
||||
if (!( L ))
|
||||
@@ -336,12 +207,18 @@
|
||||
/mob/verb/mode()
|
||||
set name = "Activate Held Object"
|
||||
set category = "IC"
|
||||
|
||||
set src = usr
|
||||
|
||||
var/obj/item/W = equipped()
|
||||
if (W)
|
||||
W.attack_self(src)
|
||||
if(hand)
|
||||
var/obj/item/W = l_hand
|
||||
if (W)
|
||||
W.attack_self(src)
|
||||
update_inv_l_hand()
|
||||
else
|
||||
var/obj/item/W = r_hand
|
||||
if (W)
|
||||
W.attack_self(src)
|
||||
update_inv_r_hand()
|
||||
return
|
||||
|
||||
/*
|
||||
@@ -825,27 +702,12 @@ note dizziness decrements automatically in the mob's Life() proc.
|
||||
/mob/proc/IsAdvancedToolUser()//This might need a rename but it should replace the can this mob use things check
|
||||
return 0
|
||||
|
||||
/mob/proc/createGeas()
|
||||
/*
|
||||
var/obj/effect/stop/S
|
||||
for(var/obj/effect/stop/temp in loc)
|
||||
if(temp.victim == src)
|
||||
S = temp
|
||||
|
||||
if(!S)
|
||||
S = new /obj/effect/stop
|
||||
S.victim = src
|
||||
S.loc = src.loc
|
||||
geaslist += S
|
||||
*/
|
||||
return
|
||||
|
||||
|
||||
/mob/proc/Stun(amount)
|
||||
if(canstun)
|
||||
stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
|
||||
if(stunned)
|
||||
createGeas()
|
||||
|
||||
|
||||
else
|
||||
if(istype(src, /mob/living/carbon/alien)) // add some movement delay
|
||||
var/mob/living/carbon/alien/Alien = src
|
||||
@@ -855,95 +717,68 @@ note dizziness decrements automatically in the mob's Life() proc.
|
||||
/mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"
|
||||
if(canstun)
|
||||
stunned = max(amount,0)
|
||||
if(stunned)
|
||||
createGeas()
|
||||
|
||||
|
||||
return
|
||||
|
||||
/mob/proc/AdjustStunned(amount)
|
||||
if(canstun)
|
||||
stunned = max(stunned + amount,0)
|
||||
if(stunned)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
/mob/proc/Weaken(amount)
|
||||
if(canweaken)
|
||||
weakened = max(max(weakened,amount),0)
|
||||
if(weakened)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
/mob/proc/SetWeakened(amount)
|
||||
if(canweaken)
|
||||
weakened = max(amount,0)
|
||||
if(weakened)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
/mob/proc/AdjustWeakened(amount)
|
||||
if(canweaken)
|
||||
weakened = max(weakened + amount,0)
|
||||
if(weakened)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
/mob/proc/Paralyse(amount)
|
||||
paralysis = max(max(paralysis,amount),0)
|
||||
if(paralysis)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
/mob/proc/SetParalysis(amount)
|
||||
paralysis = max(amount,0)
|
||||
return
|
||||
if(paralysis)
|
||||
createGeas()
|
||||
|
||||
/mob/proc/AdjustParalysis(amount)
|
||||
paralysis = max(paralysis + amount,0)
|
||||
if(paralysis)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
/mob/proc/Sleeping(amount)
|
||||
sleeping = max(max(sleeping,amount),0)
|
||||
if(sleeping)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
/mob/proc/SetSleeping(amount)
|
||||
sleeping = max(amount,0)
|
||||
return
|
||||
if(sleeping)
|
||||
createGeas()
|
||||
|
||||
|
||||
/mob/proc/AdjustSleeping(amount)
|
||||
sleeping = max(sleeping + amount,0)
|
||||
if(sleeping)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
/mob/proc/Resting(amount)
|
||||
resting = max(max(resting,amount),0)
|
||||
if(resting)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
/mob/proc/SetResting(amount)
|
||||
resting = max(amount,0)
|
||||
return
|
||||
if(resting)
|
||||
createGeas()
|
||||
|
||||
/mob/proc/AdjustResting(amount)
|
||||
resting = max(resting + amount,0)
|
||||
if(resting)
|
||||
createGeas()
|
||||
return
|
||||
|
||||
|
||||
// ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching
|
||||
// ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching.
|
||||
// Stop! ... Hammertime! ~Carn
|
||||
|
||||
/mob/proc/getBruteLoss()
|
||||
return bruteloss
|
||||
|
||||
@@ -253,8 +253,7 @@ the mob is also allowed to move without any sort of restriction. For instance, i
|
||||
var/incorporeal_move = 0
|
||||
|
||||
|
||||
var/update_icon = 1 // Set to 0 if you want that the mob's icon doesn't update when it moves -- Skie
|
||||
// This can be used if you want to change the icon on the fly and want it to stay
|
||||
var/update_icon = 1 //Set to 1 to trigger update_icons() at the next life() call
|
||||
|
||||
var/UI = 'screen1_Midnight.dmi' // For changing the UI from preferences
|
||||
|
||||
@@ -270,7 +269,6 @@ the mob is also allowed to move without any sort of restriction. For instance, i
|
||||
|
||||
var/datum/preferences/storedpreferences = null
|
||||
|
||||
var/geaslist = list()
|
||||
|
||||
var/list/radar_blips = list() // list of screen objects, radar blips
|
||||
var/radar_open = 0 // nonzero is radar is open
|
||||
|
||||
@@ -268,17 +268,3 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/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)
|
||||
Reference in New Issue
Block a user