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
+2 -2
View File
@@ -10,7 +10,7 @@
return
for(var/obj/item/W in M)
M.drop_from_slot(W)
M.drop_from_inventory(W)
log_admin("[key_name(usr)] made [key_name(M)] drop everything!")
message_admins("[key_name_admin(usr)] made [key_name_admin(M)] drop everything!", 1)
@@ -28,7 +28,7 @@
return
//strip their stuff before they teleport into a cell :downs:
for(var/obj/item/W in M)
M.drop_from_slot(W)
M.drop_from_inventory(W)
//teleport person to cell
M.Paralyse(5)
sleep(5) //so they black out before warping
+1 -1
View File
@@ -989,7 +989,7 @@ datum
for(var/mob/living/carbon/metroid/M in T)
M.adjustToxLoss(rand(5,10))
reaction_mob(var/mob/M, var/method=TOUCH, var/volume)
reaction_mob(var/mob/M, var/method=TOUCH, var/volume) //TODO: CARN
M.clean_blood()
if(istype(M, /mob/living/carbon))
var/mob/living/carbon/C = M
+21 -27
View File
@@ -1384,43 +1384,43 @@
switch(trash)
if ("raisins")
var/obj/item/trash/raisins/T = new /obj/item/trash/raisins/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("candy")
var/obj/item/trash/candy/T = new /obj/item/trash/candy/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("cheesie")
var/obj/item/trash/cheesie/T = new /obj/item/trash/cheesie/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("chips")
var/obj/item/trash/chips/T = new /obj/item/trash/chips/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("popcorn")
var/obj/item/trash/popcorn/T = new /obj/item/trash/popcorn/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("sosjerky")
var/obj/item/trash/sosjerky/T = new /obj/item/trash/sosjerky/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("syndi_cakes")
var/obj/item/trash/syndi_cakes/T = new /obj/item/trash/syndi_cakes/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("waffles")
var/obj/item/trash/waffles/T = new /obj/item/trash/waffles/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("plate")
var/obj/item/trash/plate/T = new /obj/item/trash/plate/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("snack_bowl")
var/obj/item/trash/snack_bowl/T = new /obj/item/trash/snack_bowl/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("pistachios")
var/obj/item/trash/pistachios/T = new /obj/item/trash/pistachios/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("semki")
var/obj/item/trash/semki/T = new /obj/item/trash/semki/( M )
M.put_in_hand(T)
M.put_in_hands(T)
if ("tray")
var/obj/item/trash/tray/T = new /obj/item/trash/tray/( M )
M.put_in_hand(T)
M.put_in_hands(T)
return
attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -1431,6 +1431,7 @@
attack(mob/M as mob, mob/user as mob, def_zone)
if(!reagents.total_volume) //Shouldn't be needed but it checks to see if it has anything left in it.
user << "\red None of [src] left, oh no!"
M.drop_from_inventory(src) //so icons update :[
del(src)
return 0
if(istype(M, /mob/living/carbon))
@@ -1491,6 +1492,7 @@
if(!reagents.total_volume)
if(M == user) user << "\red You finish eating [src]."
else user << "\red [M] finishes eating [src]."
M.drop_from_inventory(src) //so icons update :[
del(src)
playsound(M.loc,'eatfood.ogg', rand(10,50), 1)
return 1
@@ -1833,22 +1835,14 @@
attackby(var/obj/D, mob/user as mob)
if(isprox(D))
var/obj/item/weapon/bucket_sensor/B = new /obj/item/weapon/bucket_sensor
B.loc = user
if (user.r_hand == D)
user.u_equip(D)
user.r_hand = B
user.update_inv_r_hand()
else
user.u_equip(D)
user.l_hand = B
user.update_inv_l_hand()
B.layer = 20
user << "You add the sensor to the bucket"
user << "You add [D] to [src]."
del(D)
user.put_in_hands(new /obj/item/weapon/bucket_sensor)
user.drop_from_inventory(src)
del(src)
/obj/item/weapon/reagent_containers/glass/cantister
/*
/obj/item/weapon/reagent_containers/glass/canister //not used apparantly
desc = "It's a canister. Mainly used for transporting fuel."
name = "canister"
icon = 'tank.dmi'
@@ -1862,7 +1856,7 @@
possible_transfer_amounts = list(10,20,30,60)
volume = 120
flags = FPRINT
*/
/obj/item/weapon/reagent_containers/glass/dispenser
name = "reagent glass"
+2 -2
View File
@@ -148,7 +148,7 @@ obj/machinery/computer/forensic_scanning
temp = "Eject Failed: No Object"
if("insert")
var/mob/M = usr
var/obj/item/I = M.equipped()
var/obj/item/I = M.get_active_hand()
if(I && istype(I))
if(istype(I, /obj/item/weapon/evidencebag))
scanning = I.contents[1]
@@ -163,7 +163,7 @@ obj/machinery/computer/forensic_scanning
usr << "Invalid Object Rejected."
if("card") //Processing a fingerprint card.
var/mob/M = usr
var/obj/item/I = M.equipped()
var/obj/item/I = M.get_active_hand()
if(!(I && istype(I,/obj/item/weapon/f_card)))
I = card
if(I && istype(I,/obj/item/weapon/f_card))
+8 -4
View File
@@ -347,16 +347,20 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite
/obj/item/clothing/suit/space/nasavoid, /obj/item/weapon/tank)
/proc/fake_attack(var/mob/target)
var/list/possible_clones = new/list()
// var/list/possible_clones = new/list()
var/mob/living/carbon/human/clone = null
var/clone_weapon = null
for(var/mob/living/carbon/human/H in world)
if(H.stat || H.lying) continue
possible_clones += H
// possible_clones += H
clone = H
break //changed the code a bit. Less randomised, but less work to do. Should be ok, world.contents aren't stored in any particular order.
// if(!possible_clones.len) return
// clone = pick(possible_clones)
if(!clone) return
if(!possible_clones.len) return
clone = pick(possible_clones)
//var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(outside_range(target))
var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(target.loc)
if(clone.l_hand)
+4 -4
View File
@@ -636,7 +636,7 @@
var/mob/M = usr
var/obj/item/stack/rods/W = new /obj/item/stack/rods( M )
M << "\blue You lick clean the rod."
M.put_in_hand(W)
M.put_in_hands(W)
/obj/item/weapon/reagent_containers/food/snacks/monkeykabob
name = "Meat-kabob"
@@ -651,7 +651,7 @@
var/mob/M = usr
var/obj/item/stack/rods/W = new /obj/item/stack/rods( M )
M << "\blue You lick clean the rod."
M.put_in_hand(W)
M.put_in_hands(W)
/obj/item/weapon/reagent_containers/food/snacks/tofukabob
name = "Tofu-kabob"
@@ -666,7 +666,7 @@
var/mob/M = usr
var/obj/item/stack/rods/W = new /obj/item/stack/rods( M )
M << "\blue You lick clean the rod."
M.put_in_hand(W)
M.put_in_hands(W)
/obj/item/weapon/reagent_containers/food/snacks/cubancarp
name = "Cuban Carp"
@@ -813,7 +813,7 @@
"\blue [M] takes a piece of paper from the cookie!", \
"\blue You take a piece of paper from the cookie! Read it!" \
)
M.put_in_hand(paper)
M.put_in_hands(paper)
paper.add_fingerprint(M)
/obj/item/weapon/reagent_containers/food/snacks/badrecipe
+3 -3
View File
@@ -342,7 +342,7 @@
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
sleep(40)
if ((user.loc == T && user.equipped() == W))
if ((user.loc == T && user.get_active_hand() == W))
user << "\blue You dug a hole."
gets_dug()
@@ -359,7 +359,7 @@
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
sleep(30)
if ((user.loc == T && user.equipped() == W))
if ((user.loc == T && user.get_active_hand() == W))
user << "\blue You dug a hole."
gets_dug()
@@ -376,7 +376,7 @@
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
sleep(0)
if ((user.loc == T && user.equipped() == W))
if ((user.loc == T && user.get_active_hand() == W))
user << "\blue You dug a hole."
gets_dug()
+131 -95
View File
@@ -1,116 +1,152 @@
//These procs handle putting s tuff in your hand. It's probably best to use these rather than setting l_hand = ...etc
//as they handle all relevant stuff like adding it to the player's screen and updating their overlays.
//Returns the thing in our active hand
/mob/proc/get_active_hand()
if (hand)
return l_hand
else
return r_hand
if(hand) return l_hand
else return r_hand
//Returns the thing in our inactive hand
/mob/proc/get_inactive_hand()
if (!hand)
return l_hand
else
return r_hand
if(hand) return r_hand
else return l_hand
/mob/proc/put_in_hand(var/obj/item/I)
if(!I) return
I.loc = src
if (hand)
l_hand = I
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(var/obj/item/W)
if(!W) return 0
if(lying) return 0
if(!l_hand)
W.loc = src //TODO: move to equipped?
l_hand = W
W.layer = 20 //TODO: move to equipped?
// l_hand.screen_loc = ui_lhand
W.equipped(src,"l_hand")
if(client) client.screen |= W
update_inv_l_hand()
else
r_hand = I
update_inv_r_hand()
I.layer = 20
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.
//Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_r_hand(var/obj/item/W)
if(!W) return 0
if(lying) return 0
if(!r_hand)
I.loc = src
r_hand = I
W.loc = src
r_hand = W
W.layer = 20
// r_hand.screen_loc = ui_rhand
W.equipped(src,"r_hand")
if(client) client.screen |= W
update_inv_r_hand()
I.layer = 20
else if(!l_hand)
I.loc = src
l_hand = I
update_inv_l_hand()
I.layer = 20
return 1
return 0
//Puts the item into our active hand if possible. returns 1 on success.
/mob/proc/put_in_active_hand(var/obj/item/W)
if(hand) return put_in_l_hand(W)
else return put_in_r_hand(W)
//Puts the item into our inactive hand if possible. returns 1 on success.
/mob/proc/put_in_inactive_hand(var/obj/item/W)
if(hand) return put_in_r_hand(W)
else return put_in_l_hand(W)
//Puts the item our active hand if possible. Failing that it tries our inactive hand. Returns 1 on success.
//If both fail it drops it on the floor and returns 0.
//This is probably the main one you need to know :)
/mob/proc/put_in_hands(var/obj/item/W)
if(!W) return 0
if(put_in_active_hand(W)) return 1
else if(put_in_inactive_hand(W)) return 1
else
I.loc = get_turf(src)
W.loc = get_turf(src)
return 0
/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()
/mob/proc/drop_item_v() //this is dumb.
if(stat == CONSCIOUS)
return drop_item()
return 0
if (W)
/mob/proc/drop_from_inventory(var/obj/item/W)
if(W)
if(client) client.screen -= 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
W.layer = initial(W.layer)
W.loc = loc
/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
var/turf/T = get_turf(loc)
if(isturf(T))
T.Entered(W)
W.dropped(src)
update_icons()
return 1
return 0
//Drops the item in our left hand
/mob/proc/drop_l_hand(var/atom/Target)
if(l_hand)
if(client) client.screen -= l_hand
l_hand.layer = initial(l_hand.layer)
if(Target) l_hand.loc = Target.loc
else l_hand.loc = loc
var/turf/T = get_turf(loc)
if(isturf(T))
T.Entered(l_hand)
l_hand.dropped(src)
l_hand = null
update_inv_l_hand()
return 1
return 0
//Drops the item in our right hand
/mob/proc/drop_r_hand(var/atom/Target)
if(r_hand)
if(client) client.screen -= r_hand
r_hand.layer = initial(r_hand.layer)
if(Target) r_hand.loc = Target.loc
else r_hand.loc = loc
var/turf/T = get_turf(Target)
if(istype(T))
T.Entered(r_hand)
r_hand.dropped(src)
r_hand = null
update_inv_r_hand()
return 1
return 0
//Drops the item in our active hand.
/mob/proc/drop_item(var/atom/Target)
if(hand) return drop_l_hand(Target)
else return drop_r_hand(Target)
//TODO: phase out this proc
/mob/proc/before_take_item(var/obj/item/W) //TODO: what is this?
W.loc = null
W.layer = initial(W.layer)
u_equip(W)
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)
@@ -401,14 +401,10 @@
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
@@ -20,7 +20,7 @@
update_inv_l_hand(0)
/mob/living/carbon/alien/humanoid/db_click(text, t1)
var/obj/item/W = equipped()
var/obj/item/W = get_active_hand()
var/emptyHand = (W == null)
if ((!emptyHand) && (!istype(W, /obj/item)))
return
@@ -42,7 +42,7 @@
return
u_equip(W)
wear_suit = W
W.equipped(src, text)
W.get_active_hand(src, text)
*/
if("head")
if (head)
@@ -57,7 +57,7 @@
return
u_equip(W)
head = W
W.equipped(src, text)
W.get_active_hand(src, text)
*/
if("storage1")
if (l_store)
@@ -17,9 +17,7 @@
..()
if (src.stat != 2) //still breathing
if (src.stat != DEAD) //still breathing
//First, resolve location and get a breath
@@ -62,36 +60,25 @@
//Status updates, death etc.
handle_regular_status_updates()
//Being buckled to a chair or bed
check_if_buckled()
//Temporary, whilst I finish the regenerate_icons changes ~Carn
if( update_icon ) //forces a full overlay update
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
if(client)
handle_regular_hud_updates()
// Yup.
update_canmove()
clamp_values()
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
if(client)
handle_regular_hud_updates()
clamp_values()
/mob/living/carbon/alien/humanoid
proc
clamp_values()
SetStunned(min(stunned, 20))
// SetStunned(min(stunned, 20))
SetParalysis(min(paralysis, 20))
SetWeakened(min(weakened, 20))
// SetWeakened(min(weakened, 20))
sleeping = max(min(sleeping, 20), 0)
adjustBruteLoss(0)
adjustToxLoss(0)
@@ -256,10 +243,6 @@
src.internals.icon_state = "internal0"
return null
update_canmove()
if(paralysis || stunned || weakened || buckled) canmove = 0
else canmove = 1
handle_breath(datum/gas_mixture/breath)
if(src.nodamage)
return
@@ -115,7 +115,7 @@
if(r_hand)
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
r_hand.screen_loc = ui_rhand
// r_hand.screen_loc = ui_rhand
overlays_standing[X_R_HAND_LAYER] = image("icon" = 'items_righthand.dmi', "icon_state" = t_state)
else
overlays_standing[X_R_HAND_LAYER] = null
@@ -125,7 +125,7 @@
if(l_hand)
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
l_hand.screen_loc = ui_lhand
// l_hand.screen_loc = ui_lhand
overlays_standing[X_L_HAND_LAYER] = image("icon" = 'items_lefthand.dmi', "icon_state" = t_state)
else
overlays_standing[X_L_HAND_LAYER] = null
@@ -368,14 +368,10 @@
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
@@ -58,32 +58,26 @@
//Status updates, death etc.
handle_regular_status_updates()
// Update clothing
// regenerate_icons()
if(client)
handle_regular_hud_updates()
//Being buckled to a chair or bed
check_if_buckled()
// Yup.
//Handles updating canmove.
update_canmove()
clamp_values()
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
if(client)
handle_regular_hud_updates()
clamp_values()
/mob/living/carbon/alien/larva
proc
clamp_values()
SetStunned(min(stunned, 20))
// SetStunned(min(stunned, 20))
SetParalysis(min(paralysis, 20))
SetWeakened(min(weakened, 20))
// SetWeakened(min(weakened, 20))
sleeping = max(min(sleeping, 20), 0)
handle_mutations_and_radiation()
@@ -227,10 +221,6 @@
internals.icon_state = "internal0"
return null
update_canmove()
if(paralysis || stunned || weakened || buckled) canmove = 0
else canmove = 1
handle_breath(datum/gas_mixture/breath)
if(nodamage)
return
@@ -506,4 +496,4 @@
if(air_master.current_cycle%3==1)
if(!M.nodamage)
M.adjustBruteLoss(5)
nutrition += 10
nutrition += 10
+6 -10
View File
@@ -40,15 +40,13 @@
clamp_values()
proc
clamp_values()
AdjustParalysis(0)
AdjustStunned(0)
AdjustWeakened(0)
// AdjustStunned(0)
// AdjustWeakened(0)
adjustBruteLoss(0)
adjustFireLoss(0)
adjustOxyLoss(0)
@@ -89,12 +87,6 @@
emote("gasp")
updatehealth()
update_canmove()
if(in_contents_of(/obj/mecha))
canmove = 1
else
canmove = 0
return
handle_environment(datum/gas_mixture/environment)
if(!environment)
@@ -315,3 +307,7 @@
D.cure()
return
update_canmove()
if(in_contents_of(/obj/mecha)) canmove = 1
else canmove = 0
return canmove
+1 -1
View File
@@ -14,7 +14,7 @@
for(var/mob/M in hearers(4, src))
if(M.client)
M.show_message(text("\red You hear something rumbling inside [src]'s stomach..."), 2)
var/obj/item/I = user.equipped()
var/obj/item/I = user.get_active_hand()
if(I && I.force)
var/d = rand(round(I.force / 4), I.force)
if(istype(src, /mob/living/carbon/human))
@@ -622,7 +622,7 @@
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
O.source = usr
O.target = src
O.item = usr.equipped()
O.item = usr.get_active_hand()
O.s_loc = usr.loc
O.t_loc = loc
O.place = href_list["item"]
@@ -692,7 +692,7 @@
if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask || src.head || src.shoes || src.w_uniform || src.wear_suit || src.glasses || src.ears || src.gloves)))
return 1
if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )))
if( (src.l_hand && !src.l_hand.abstract) || (src.r_hand && !src.r_hand.abstract) )
return 1
return 0
@@ -14,14 +14,10 @@
w_uniform.add_fingerprint(M)
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M
@@ -87,14 +87,10 @@
if(w_uniform) w_uniform.add_fingerprint(M)
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M)
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M
@@ -559,7 +559,7 @@ It can still be worn/put on as normal.
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(item && source.get_active_hand() != item) return
if ((source.restrained() || source.stat)) return
switch(place)
if("mask")
@@ -920,8 +920,8 @@ It can still be worn/put on as normal.
W.add_fingerprint(source)
else
if (istype(item, /obj/item/weapon/handcuffs))
target.drop_from_slot(target.r_hand)
target.drop_from_slot(target.l_hand)
target.drop_from_inventory(target.r_hand)
target.drop_from_inventory(target.l_hand)
source.drop_item()
target.handcuffed = item
item.loc = target
@@ -1012,7 +1012,7 @@ It can still be worn/put on as normal.
return
/mob/living/carbon/human/db_click(text, t1)
var/obj/item/W = equipped()
var/obj/item/W = get_active_hand()
var/emptyHand = (W == null)
if(emptyHand)
usr.next_move = usr.prev_move
+74 -105
View File
@@ -68,16 +68,7 @@
//Status updates, death etc.
UpdateLuminosity()
handle_regular_status_updates() //TODO: optimise ~Carn
//Being buckled to chairs/beds/etc
check_if_buckled()
//Temporary, whilst I finish the regenerate_icons changes ~Carn
if( update_icon ) //forces a full overlay update
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
update_canmove() //TODO: remove from life() if viable ~Carn (read as: if it won't cause massive problems)
//Update our name based on whether our face is obscured/disfigured
name = get_visible_name() //TODO: this was broken by the dismemberment revert ~Carn
@@ -85,10 +76,6 @@
if(client)
handle_regular_hud_updates()
update_canmove() //TODO: check ~Carn
clamp_values() //TODO: check that dmage procs aren't outputing bad values outside clamp ranges ~Carn
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
@@ -99,6 +86,9 @@
if(!currentTurf.sd_lumcount)
playsound_local(src,pick(scarySounds),50, 1, -1)
clamp_values() //TODO: finish removing this ~Carn
/mob/living/carbon/human/calculate_affecting_pressure(var/pressure)
..()
var/pressure_difference = abs( pressure - ONE_ATMOSPHERE )
@@ -121,9 +111,9 @@
//This can probably be removed like Rockdtben suggested, but I'd like to go over the damage procs first just to be safe.
//Perhaps code view-vars to be unable to directly edit the damagevariables without using procs
proc/clamp_values()
stunned = max( min(stunned,20), 0 ) // positive and under 20
// stunned = max( min(stunned,20), 0 ) // positive and under 20
paralysis = max( min(paralysis,20), 0 ) // positive and under 20
weakened = max( min(weakened,20), 0 ) // positive and under 20
// weakened = max( min(weakened,20), 0 ) // positive and under 20
sleeping = max( min(sleeping, 20), 0 ) // positive and under 20
oxyloss = max(oxyloss,0) // positive
toxloss = max(toxloss,0) // positive
@@ -376,14 +366,6 @@
internals.icon_state = "internal0"
return null
proc/update_canmove()
if(stat || sleeping || paralysis || stunned || weakened || resting || buckled || (changeling && changeling.changeling_fakedeath))
canmove = 0
else
lying = 0
canmove = 1
proc/handle_breath(datum/gas_mixture/breath)
if(nodamage || REBREATHER in augmentations)
@@ -754,100 +736,87 @@
return //TODO: DEFERRED
proc/handle_regular_status_updates()
// health = 100 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
if(getOxyLoss() > 50) Paralyse(3)
if(health < config.health_threshold_dead || brain_op_stage == 4.0)
death()
else if(health < config.health_threshold_crit)
if(health <= 20 && prob(1)) spawn(0) emote("gasp")
//if(!rejuv) oxyloss++
if(!reagents.has_reagent("inaprovaline")) adjustOxyLoss(1)
if(stat != DEAD) stat = UNCONSCIOUS
Paralyse(5)
if (stat != DEAD) //Alive.
if (silent)
silent--
if (resting || sleeping || paralysis || stunned || weakened || (changeling && changeling.changeling_fakedeath)) //Stunned etc.
if (stunned > 0)
AdjustStunned(-1)
stat = CONSCIOUS
if (weakened > 0)
AdjustWeakened(-1)
lying = 1
stat = CONSCIOUS
if (paralysis > 0)
AdjustParalysis(-1)
blinded = 1
lying = 1
stat = UNCONSCIOUS
if (sleeping > 0)
handle_dreams()
adjustHalLoss(-5)
blinded = 1
lying = 1
stat = UNCONSCIOUS
if (prob(10) && health && !hal_crit)
spawn(0)
emote("snore")
sleeping--
if(resting)
lying = 1
stat = CONSCIOUS
var/h = hand
hand = 0
drop_item()
hand = 1
drop_item()
hand = h
else //Not stunned.
lying = 0
stat = CONSCIOUS
else //Dead.
lying = 1
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
blinded = 1
stat = DEAD
silent = 0
else //ALIVE. LIGHTS ARE ON
if(health < config.health_threshold_dead || brain_op_stage == 4.0)
death()
blinded = 1
stat = DEAD
silent = 0
return 1
if (stuttering) stuttering--
stat = CONSCIOUS
if(getOxyLoss() > 50)
Paralyse(3)
if (eye_blind)
eye_blind--
blinded = 1
if(health < config.health_threshold_crit) //UNCONSCIOUS. NO-ONE IS HOME
if( health <= 20 && prob(1) )
spawn(0)
emote("gasp")
if (ear_deaf > 0) ear_deaf--
if (ear_damage < 25)
ear_damage -= 0.05
ear_damage = max(ear_damage, 0)
if(!reagents.has_reagent("inaprovaline"))
adjustOxyLoss(1)
density = !( lying )
stat = UNCONSCIOUS
Paralyse(5)
if ((sdisabilities & 1 || istype(glasses, /obj/item/clothing/glasses/blindfold)))
blinded = 1
if ((sdisabilities & 4 || istype(ears, /obj/item/clothing/ears/earmuffs)))
ear_deaf = 1
if(silent)
silent = max(silent-1, 0)
if (eye_blurry > 0)
eye_blurry--
eye_blurry = max(0, eye_blurry)
if(stunned > 0)
AdjustStunned(-1)
if(weakened > 0)
AdjustWeakened(-1)
if (druggy > 0)
druggy--
druggy = max(0, druggy)
//Incapacitated
if(paralysis > 0)
AdjustParalysis(-1)
blinded = 1
stat = UNCONSCIOUS
if(sleeping > 0)
handle_dreams()
adjustHalLoss(-5)
blinded = 1
stat = UNCONSCIOUS
if( prob(10) && health && !hal_crit )
spawn(0)
emote("snore")
sleeping = max(sleeping-1, 0)
if(stuttering)
stuttering = max(stuttering-1, 0)
//Eyes & Ears
if(sdisabilities & 1) //disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
blinded = 1
else if(istype(glasses, /obj/item/clothing/glasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster
eye_blurry = max(eye_blurry-3, 0)
blinded = 1
else if(eye_blurry) //blurry eyes heal slowly
eye_blurry = max(eye_blurry-1, 0)
if(sdisabilities & 4) //disabled-deaf, doesn't get better on its own
ear_deaf = max(ear_deaf, 1)
else if(ear_deaf) //deafness, heals slowly over time
ear_deaf = max(ear_deaf-1, 0)
else if(istype(ears, /obj/item/clothing/ears/earmuffs)) //resting your ears with earmuffs heals ear damage faster
ear_damage = max(ear_damage-0.15, 0)
ear_deaf = max(ear_deaf, 1)
else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs
ear_damage = max(ear_damage-0.05, 0)
if(druggy)
druggy = max(druggy-1, 0)
return 1
proc/handle_regular_hud_updates()
if(!client) return 0
@@ -127,6 +127,8 @@ Please contact me on #coderbus IRC. ~Carn x
//this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers
//I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date.
/mob/living/carbon/human/update_icons()
if(Debug2) world << "human/update_icons()"
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
update_hud() //TODO: remove the need for this
overlays = null
@@ -354,19 +356,14 @@ Please contact me on #coderbus IRC. ~Carn x
if(!t_color) t_color = icon_state
var/image/lying = image("icon_state" = "[t_color]_l")
var/image/standing = image("icon_state" = "[t_color]_s")
if( (FAT in mutations) )
if(w_uniform.flags&ONESIZEFITSALL)
lying.icon = 'uniform_fat.dmi'
standing.icon = 'uniform_fat.dmi'
else
src << "\red You burst out of \the [w_uniform]!"
var/obj/item/clothing/c = w_uniform
w_uniform = null
if(client)
client.screen -= c
c.loc = loc
c.dropped(src)
c.layer = initial(c.layer)
drop_from_inventory(w_uniform)
lying = null
standing = null
else
@@ -451,14 +451,10 @@
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
@@ -557,14 +553,10 @@
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
@@ -66,7 +66,7 @@
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(item && source.get_active_hand() != item) return
if ((source.restrained() || source.stat)) return
switch(place)
if("mask")
+5 -22
View File
@@ -56,25 +56,13 @@
//Status updates, death etc.
UpdateLuminosity()
handle_regular_status_updates()
update_canmove()
clamp_values()
if(client)
handle_regular_hud_updates()
//Being buckled to a chair or bed
check_if_buckled()
//Temporary, whilst I finish the regenerate_icons changes ~Carn
if( update_icon ) //forces a full overlay update
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
// Yup.
update_canmove()
clamp_values()
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
@@ -93,10 +81,9 @@
proc/clamp_values()
AdjustStunned(0)
// AdjustStunned(0)
AdjustParalysis(0)
AdjustWeakened(0)
// AdjustWeakened(0)
proc/handle_disabilities()
@@ -250,10 +237,6 @@
src.internals.icon_state = "internal0"
return null
proc/update_canmove()
if(paralysis || stunned || weakened || buckled || (changeling && changeling.changeling_fakedeath)) canmove = 0
else canmove = 1
proc/handle_breath(datum/gas_mixture/breath)
if(src.nodamage)
return
@@ -85,7 +85,7 @@
var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( )
O.source = usr
O.target = src
O.item = usr.equipped()
O.item = usr.get_active_hand()
O.s_loc = usr.loc
O.t_loc = loc
O.place = href_list["item"]
@@ -211,14 +211,10 @@
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
@@ -286,14 +282,10 @@
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
+2 -15
View File
@@ -173,22 +173,9 @@
/mob/living/proc/UpdateDamageIcon()
return
/*CARN: Deprecated. Please use update_canmove()
/mob/living/proc/check_if_buckled()
if (buckled)
density = 1
if( istype(buckled, /obj/structure/stool/bed/chair) )
lying = 0
else
lying = 1
else
density = !lying
if(lying)
var/h = hand
hand = 0
drop_item()
hand = 1
drop_item()
hand = h
*/
/mob/living/proc/Examine_OOC()
set name = "Examine Meta-Info (OOC)"
@@ -40,6 +40,7 @@
var/obj/item/weapon/cloaking_device/C = locate((/obj/item/weapon/cloaking_device) in src)
if(C && C.active)
C.attack_self(src)//Should shut it off
update_icons()
src << "\blue Your [C.name] was disrupted!"
Stun(2)
@@ -0,0 +1,79 @@
//These procs handle putting s tuff in your hand. It's probably best to use these rather than setting stuff manually
//as they handle all relevant stuff like adding it to the player's screen and such
//Returns the thing in our active hand (whatever is in our active module-slot, in this case)
/mob/living/silicon/robot/get_active_hand()
return module_active
/*-------TODOOOOOOOOOO--------*/
/mob/living/silicon/robot/proc/uneq_active()
if(isnull(module_active))
return
if(module_state_1 == module_active)
if(istype(module_state_1,/obj/item/borg/sight))
sight_mode &= ~module_state_1:sight_mode
if (client)
client.screen -= module_state_1
contents -= module_state_1
module_active = null
module_state_1 = null
inv1.icon_state = "inv1"
else if(module_state_2 == module_active)
if(istype(module_state_2,/obj/item/borg/sight))
sight_mode &= ~module_state_2:sight_mode
if (client)
client.screen -= module_state_2
contents -= module_state_2
module_active = null
module_state_2 = null
inv2.icon_state = "inv2"
else if(module_state_3 == module_active)
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode &= ~module_state_3:sight_mode
if (client)
client.screen -= module_state_3
contents -= module_state_3
module_active = null
module_state_3 = null
inv3.icon_state = "inv3"
/mob/living/silicon/robot/proc/uneq_all()
module_active = null
if(module_state_1)
if(istype(module_state_1,/obj/item/borg/sight))
sight_mode &= ~module_state_1:sight_mode
if (client)
client.screen -= module_state_1
contents -= module_state_1
module_state_1 = null
inv1.icon_state = "inv1"
if(module_state_2)
if(istype(module_state_2,/obj/item/borg/sight))
sight_mode &= ~module_state_2:sight_mode
if (client)
client.screen -= module_state_2
contents -= module_state_2
module_state_2 = null
inv2.icon_state = "inv2"
if(module_state_3)
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode &= ~module_state_3:sight_mode
if (client)
client.screen -= module_state_3
contents -= module_state_3
module_state_3 = null
inv3.icon_state = "inv3"
/mob/living/silicon/robot/proc/activated(obj/item/O)
if(module_state_1 == O)
return 1
else if(module_state_2 == O)
return 1
else if(module_state_3 == O)
return 1
else
return 0
@@ -16,7 +16,7 @@
UpdateLuminosity()
handle_regular_hud_updates()
update_items()
if (src.stat != 2) //still using power
if (src.stat != DEAD) //still using power
use_power()
process_killswitch()
process_locks()
@@ -30,9 +30,9 @@
proc
clamp_values()
SetStunned(min(stunned, 30))
// SetStunned(min(stunned, 30))
SetParalysis(min(paralysis, 30))
SetWeakened(min(weakened, 20))
// SetWeakened(min(weakened, 20))
sleeping = 0
adjustBruteLoss(0)
adjustToxLoss(0)
@@ -66,12 +66,6 @@
uneq_all()
src.stat = 1
update_canmove()
if(paralysis || stunned || weakened || buckled || lockcharge) canmove = 0
else canmove = 1
update_mind()
if(!mind && client)
mind = new
@@ -315,3 +309,8 @@
src << "\red <B>Weapon Lock Timed Out!"
weapon_lock = 0
weaponlock_time = 120
update_canmove()
if(paralysis || stunned || weakened || buckled || lockcharge) canmove = 0
else canmove = 1
return canmove
+8 -91
View File
@@ -540,14 +540,10 @@
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
@@ -673,20 +669,11 @@
if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
if(cell)
cell.loc = usr
cell.layer = 20
if (user.hand )
user.l_hand = cell
user.update_inv_l_hand()
else
user.r_hand = cell
user.update_inv_r_hand()
cell.add_fingerprint(user)
cell.updateicon()
cell.add_fingerprint(user)
user.put_in_active_hand(cell)
user << "You remove \the [cell]."
cell = null
user << "You remove the power cell."
updateicon()
if(ishuman(user))
@@ -701,12 +688,12 @@
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
//if they are holding or wearing a card that has access, that works
if(check_access(H.equipped()) || check_access(H.wear_id))
if(check_access(H.get_active_hand()) || check_access(H.wear_id))
return 1
else if(istype(M, /mob/living/carbon/monkey))
var/mob/living/carbon/monkey/george = M
//they can only hold things :(
if(george.equipped() && istype(george.equipped(), /obj/item/weapon/card/id) && check_access(george.equipped()))
if(george.get_active_hand() && istype(george.get_active_hand(), /obj/item/weapon/card/id) && check_access(george.get_active_hand()))
return 1
return 0
@@ -855,76 +842,6 @@
installed_modules()
return
/mob/living/silicon/robot/proc/uneq_active()
if(isnull(module_active))
return
if(module_state_1 == module_active)
if(istype(module_state_1,/obj/item/borg/sight))
sight_mode &= ~module_state_1:sight_mode
if (client)
client.screen -= module_state_1
contents -= module_state_1
module_active = null
module_state_1 = null
inv1.icon_state = "inv1"
else if(module_state_2 == module_active)
if(istype(module_state_2,/obj/item/borg/sight))
sight_mode &= ~module_state_2:sight_mode
if (client)
client.screen -= module_state_2
contents -= module_state_2
module_active = null
module_state_2 = null
inv2.icon_state = "inv2"
else if(module_state_3 == module_active)
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode &= ~module_state_3:sight_mode
if (client)
client.screen -= module_state_3
contents -= module_state_3
module_active = null
module_state_3 = null
inv3.icon_state = "inv3"
/mob/living/silicon/robot/proc/uneq_all()
module_active = null
if(module_state_1)
if(istype(module_state_1,/obj/item/borg/sight))
sight_mode &= ~module_state_1:sight_mode
if (client)
client.screen -= module_state_1
contents -= module_state_1
module_state_1 = null
inv1.icon_state = "inv1"
if(module_state_2)
if(istype(module_state_2,/obj/item/borg/sight))
sight_mode &= ~module_state_2:sight_mode
if (client)
client.screen -= module_state_2
contents -= module_state_2
module_state_2 = null
inv2.icon_state = "inv2"
if(module_state_3)
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode &= ~module_state_3:sight_mode
if (client)
client.screen -= module_state_3
contents -= module_state_3
module_state_3 = null
inv3.icon_state = "inv3"
/mob/living/silicon/robot/proc/activated(obj/item/O)
if(module_state_1 == O)
return 1
else if(module_state_2 == O)
return 1
else if(module_state_3 == O)
return 1
else
return 0
/mob/living/silicon/robot/proc/radio_menu()
var/dat = {"
<TT>
@@ -98,7 +98,7 @@
usr.machine = src
if (href_list["borgwires"])
var/t1 = text2num(href_list["borgwires"])
if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) ))
if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
usr << "You need wirecutters!"
return
if (src.isWireColorCut(t1))
@@ -107,7 +107,7 @@
src.cut(t1)
else if (href_list["pulse"])
var/t1 = text2num(href_list["pulse"])
if (!istype(usr.equipped(), /obj/item/device/multitool))
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
usr << "You need a multitool!"
return
if (src.isWireColorCut(t1))
+41 -5
View File
@@ -108,7 +108,7 @@
//Used by monkeys, *chimpers* //TODO: eliminate this convoluted proc it's incredibly shitty. ~Carn
/mob/proc/db_click(text, t1)
var/obj/item/weapon/W = equipped()
var/obj/item/weapon/W = get_active_hand()
switch(text)
if("mask")
if (wear_mask)
@@ -666,6 +666,43 @@ note dizziness decrements automatically in the mob's Life() proc.
if(restrained()) return 0
return 1
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
/mob/proc/update_canmove()
if( stat || weakened || paralysis || resting || sleeping || (changeling && changeling.changeling_fakedeath) )
lying = 1
canmove = 0
else if( stunned )
// lying = 0
canmove = 0
else
lying = 0
canmove = 1
if(buckled)
anchored = 1
if( istype(buckled,/obj/structure/stool/bed/chair) )
lying = 0
else
lying = 1
if(lying)
density = 0
drop_l_hand()
drop_r_hand()
else
density = 1
//Temporarily moved here from the various life() procs
//I'm fixing stuff incrementally so this will likely find a better home.
//It just makes sense for now. ~Carn
if( update_icon ) //forces a full overlay update
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
return canmove
/mob/verb/eastface()
set hidden = 1
@@ -706,8 +743,6 @@ note dizziness decrements automatically in the mob's Life() proc.
/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
else
if(istype(src, /mob/living/carbon/alien)) // add some movement delay
var/mob/living/carbon/alien/Alien = src
@@ -717,8 +752,6 @@ 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)
return
/mob/proc/AdjustStunned(amount)
@@ -729,16 +762,19 @@ note dizziness decrements automatically in the mob's Life() proc.
/mob/proc/Weaken(amount)
if(canweaken)
weakened = max(max(weakened,amount),0)
update_canmove() //updates lying, canmove and icons
return
/mob/proc/SetWeakened(amount)
if(canweaken)
weakened = max(amount,0)
update_canmove() //updates lying, canmove and icons
return
/mob/proc/AdjustWeakened(amount)
if(canweaken)
weakened = max(weakened + amount,0)
update_canmove() //updates lying, canmove and icons
return
/mob/proc/Paralyse(amount)
+8 -3
View File
@@ -172,9 +172,14 @@
/client/verb/attack_self()
set hidden = 1
var/obj/item/weapon/W = mob.equipped()
if (W)
W.attack_self(mob)
if(mob.hand)
if(mob.l_hand)
mob.l_hand.attack_self(mob)
mob.update_inv_l_hand()
else
if(mob.r_hand)
mob.r_hand.attack_self(mob)
mob.update_inv_r_hand()
return
+2 -7
View File
@@ -277,14 +277,9 @@
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
+7 -7
View File
@@ -2,9 +2,9 @@
if (monkeyizing)
return
for(var/obj/item/W in src)
if (W==w_uniform) // will be teared
if (W==w_uniform) // will be torn
continue
drop_from_slot(W)
drop_from_inventory(W)
regenerate_icons()
monkeyizing = 1
canmove = 0
@@ -63,7 +63,7 @@
if (monkeyizing)
return
for(var/obj/item/W in src)
drop_from_slot(W)
drop_from_inventory(W)
regenerate_icons()
monkeyizing = 1
canmove = 0
@@ -155,7 +155,7 @@
if (monkeyizing)
return
for(var/obj/item/W in src)
drop_from_slot(W)
drop_from_inventory(W)
regenerate_icons()
monkeyizing = 1
canmove = 0
@@ -222,7 +222,7 @@
if (monkeyizing)
return
for(var/obj/item/W in src)
drop_from_slot(W)
drop_from_inventory(W)
regenerate_icons()
monkeyizing = 1
canmove = 0
@@ -262,7 +262,7 @@
if (monkeyizing)
return
for(var/obj/item/W in src)
drop_from_slot(W)
drop_from_inventory(W)
regenerate_icons()
monkeyizing = 1
canmove = 0
@@ -313,7 +313,7 @@
if (monkeyizing)
return
for(var/obj/item/W in src)
drop_from_slot(W)
drop_from_inventory(W)
regenerate_icons()
monkeyizing = 1
canmove = 0
+11 -13
View File
@@ -21,18 +21,16 @@
var/mob/M = usr
if (!(istype(over_object, /obj/screen) ))
return ..()
if((!(M.restrained()) && !(M.stat)))
if(over_object.name == "r_hand")
if(!(M.r_hand))
if(!M.restrained() && !M.stat)
switch(over_object.name)
if("r_hand")
M.u_equip(src)
M.r_hand = src
M.update_inv_r_hand()
else
if(over_object.name == "l_hand")
if(!(M.l_hand))
M.u_equip(src)
M.l_hand = src
M.update_inv_l_hand()
M.put_in_r_hand(src)
if("l_hand")
M.u_equip(src)
M.put_in_l_hand(src)
src.add_fingerprint(usr)
return
@@ -91,7 +89,7 @@
haspen.loc = usr.loc
if(ishuman(usr))
if(!usr.get_active_hand())
usr.put_in_hand(haspen)
usr.put_in_hands(haspen)
haspen = null
if(href_list["addpen"])
@@ -115,7 +113,7 @@
P.loc = usr.loc
if(ishuman(usr))
if(!usr.get_active_hand())
usr.put_in_hand(P)
usr.put_in_hands(P)
else
P.loc = get_turf(usr)
if(P == toppaper)
+1 -1
View File
@@ -46,7 +46,7 @@
var/obj/item/P = locate(href_list["retrieve"])//contents[retrieveindex]
if(!isnull(P) && in_range(src,usr))
if(!usr.get_active_hand())
usr.put_in_hand(P)
usr.put_in_hands(P)
else
P.loc = get_turf_loc(src)
+1 -1
View File
@@ -65,7 +65,7 @@
P.loc = usr.loc
if(ishuman(usr))
if(!usr.get_active_hand())
usr.put_in_hand(P)
usr.put_in_hands(P)
else
P.loc = get_turf(usr)
+3 -3
View File
@@ -228,7 +228,7 @@
var/id = href_list["write"]
//var/t = strip_html_simple(input(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null),8192) as message
var/t = strip_html_simple(input("Enter what you want to write:", "Write", null, null) as message, MAX_MESSAGE_LEN)
var/obj/item/i = usr.equipped() // Check to see if he still got that darn pen, also check if he's using a crayon or pen.
var/obj/item/i = usr.get_active_hand() // Check to see if he still got that darn pen, also check if he's using a crayon or pen.
var/iscrayon = 0
if(!istype(i, /obj/item/weapon/pen))
if(!istype(i, /obj/item/toy/crayon))
@@ -236,7 +236,7 @@
iscrayon = 1
if ((!in_range(src, usr) && src.loc != usr && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != usr && usr.equipped() != i)) // Some check to see if he's allowed to write
if ((!in_range(src, usr) && src.loc != usr && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != usr && usr.get_active_hand() != i)) // Some check to see if he's allowed to write
return
t = parsepencode(t, i, usr, iscrayon) // Encode everything from pencode to html
@@ -263,7 +263,7 @@
//openhelp(user)
return
else if(istype(P, /obj/item/weapon/stamp))
if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.equipped() != P))
if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.get_active_hand() != P))
return
stamps += (stamps=="" ? "<HR>" : "<BR>") + "<i>This paper has been stamped with the [P.name].</i>"
+5 -11
View File
@@ -16,16 +16,10 @@
MouseDrop(mob/user as mob)
if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr))))))
if (usr.hand)
if (!( usr.l_hand ))
spawn( 0 )
src.attack_hand(usr, 1, 1)
return
else
if (!( usr.r_hand ))
spawn( 0 )
src.attack_hand(usr, 0, 1)
return
if( !usr.get_active_hand() ) //if active hand is empty
attack_hand(usr, 1, 1)
return
@@ -53,7 +47,7 @@
P.loc = user.loc
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hand(P)
user.put_in_hands(P)
user << "You take a paper out of the bin."
else
P.loc = get_turf_loc(src)
+1 -1
View File
@@ -69,7 +69,7 @@
if(ishuman(usr))
if(!usr.get_active_hand())
copy.loc = usr.loc
usr.put_in_hand(copy)
usr.put_in_hands(copy)
usr << "You take the paper out of the photocopier."
copy = null
updateUsrDialog()
+3 -3
View File
@@ -442,7 +442,7 @@
src.add_fingerprint(user)
if(opened && (!istype(user, /mob/living/silicon)))
if(cell)
usr.put_in_hand(cell)
usr.put_in_hands(cell)
cell.add_fingerprint(user)
cell.updateicon()
@@ -763,7 +763,7 @@
usr.machine = src
if (href_list["apcwires"])
var/t1 = text2num(href_list["apcwires"])
if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) ))
if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
usr << "You need wirecutters!"
return
if (src.isWireColorCut(t1))
@@ -772,7 +772,7 @@
src.cut(t1)
else if (href_list["pulse"])
var/t1 = text2num(href_list["pulse"])
if (!istype(usr.equipped(), /obj/item/device/multitool))
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
usr << "You need a multitool!"
return
if (src.isWireColorCut(t1))
+6 -13
View File
@@ -366,12 +366,12 @@
switchcount = L.switchcount
rigged = L.rigged
brightness = L.brightness
del(L)
on = has_power()
update()
user.update_inv_l_hand(0)
user.update_inv_r_hand()
user.drop_item() //drop the item to update overlays and such
del(L)
if(on && rigged)
explode()
else
@@ -497,23 +497,16 @@
L.status = status
L.rigged = rigged
L.brightness = src.brightness
L.loc = usr
L.layer = 20
if(user.hand)
user.l_hand = L
user.update_inv_l_hand()
else
user.r_hand = L
user.update_inv_r_hand()
// light item inherits the switchcount, then zero it
L.switchcount = switchcount
switchcount = 0
L.update()
L.add_fingerprint(user)
user.put_in_active_hand(L) //puts it in our active hand
status = LIGHT_EMPTY
update()
+1 -3
View File
@@ -53,11 +53,9 @@
if(src.P)
user << "\red There's already a plasma tank loaded."
return 1
user.drop_item()
src.P = W
W.loc = src
if (user.client)
user.client.screen -= W
user.u_equip(W)
updateicon()
else if(istype(W, /obj/item/weapon/crowbar))
if(P && !src.locked)
@@ -23,7 +23,7 @@
for(var/obj/item/W in M)
if (istype(M, /mob/living/silicon/robot)||istype(W, /obj/item/weapon/implant))
del (W)
M.drop_from_slot(W)
M.drop_from_inventory(W)
var/randomize = pick("monkey","robot","metroid","alien","human")
switch(randomize)
if("monkey")
+1 -1
View File
@@ -47,7 +47,7 @@
if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
wrapped.loc = user.loc
if(ishuman(user))
user.put_in_hand(wrapped)
user.put_in_hands(wrapped)
else
wrapped.loc = get_turf_loc(src)
+2 -2
View File
@@ -73,7 +73,7 @@
src.add_fingerprint(usr)
if(href_list["pulse"])
var/temp_wire = href_list["wire"]
if (!istype(usr.equipped(), /obj/item/device/multitool))
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
usr << "You need a multitool!"
else
if(src.wires[temp_wire])
@@ -91,7 +91,7 @@
src.shock(usr,50)
spawn(100) src.shocked = !src.shocked
if(href_list["cut"])
if (!istype(usr.equipped(), /obj/item/weapon/wirecutters))
if (!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters))
usr << "You need wirecutters!"
else
var/temp_wire = href_list["wire"]