mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-27 10:41:42 +00:00
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
175 lines
4.4 KiB
Plaintext
175 lines
4.4 KiB
Plaintext
/obj/structure/stool/ex_act(severity)
|
|
switch(severity)
|
|
if(1.0)
|
|
del(src)
|
|
return
|
|
if(2.0)
|
|
if (prob(50))
|
|
del(src)
|
|
return
|
|
if(3.0)
|
|
if (prob(5))
|
|
del(src)
|
|
return
|
|
return
|
|
|
|
/obj/structure/stool/blob_act()
|
|
if(prob(75))
|
|
new /obj/item/stack/sheet/metal(src.loc)
|
|
del(src)
|
|
|
|
/obj/structure/stool/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
if(istype(W, /obj/item/weapon/wrench))
|
|
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
|
new /obj/item/stack/sheet/metal(src.loc)
|
|
del(src)
|
|
return
|
|
|
|
/obj/structure/stool/bed/chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
..()
|
|
if(istype(W, /obj/item/assembly/shock_kit))
|
|
var/obj/structure/stool/bed/chair/e_chair/E = new /obj/structure/stool/bed/chair/e_chair(src.loc)
|
|
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
|
|
E.dir = src.dir
|
|
E.part = W
|
|
W.loc = E
|
|
W.master = E
|
|
user.u_equip(W)
|
|
W.layer = initial(W.layer)
|
|
del(src)
|
|
return
|
|
return
|
|
|
|
/obj/structure/stool/bed/Del()
|
|
unbuckle()
|
|
..()
|
|
return
|
|
|
|
/obj/structure/stool/bed/proc/unbuckle()
|
|
if(buckled_mob)
|
|
if(buckled_mob.buckled == src) //this is probably unneccesary, but it doesn't hurt
|
|
buckled_mob.buckled = null
|
|
buckled_mob.anchored = initial(buckled_mob.anchored)
|
|
buckled_mob.update_canmove()
|
|
buckled_mob = null
|
|
return
|
|
|
|
/obj/structure/stool/bed/proc/manual_unbuckle(mob/user as mob)
|
|
if(buckled_mob)
|
|
if(buckled_mob.buckled == src)
|
|
if(buckled_mob != user)
|
|
buckled_mob.visible_message(\
|
|
"\blue [buckled_mob.name] was unbuckled by [user.name]!",\
|
|
"You unbuckled from [src] by [user.name].",\
|
|
"You hear metal clanking")
|
|
else
|
|
buckled_mob.visible_message(\
|
|
"\blue [buckled_mob.name] unbuckled himself!",\
|
|
"You unbuckle yourself from [src].",\
|
|
"You hear metal clanking")
|
|
unbuckle()
|
|
src.add_fingerprint(user)
|
|
return
|
|
|
|
/obj/structure/stool/bed/proc/buckle_mob(mob/M as mob, mob/user as mob)
|
|
if (!ticker)
|
|
user << "You can't buckle anyone in before the game starts."
|
|
if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || usr.stat || M.buckled || istype(user, /mob/living/silicon/pai) )
|
|
return
|
|
|
|
unbuckle()
|
|
|
|
if (M == usr)
|
|
M.visible_message(\
|
|
"\blue [M.name] buckles in!",\
|
|
"You buckle yourself to [src].",\
|
|
"You hear metal clanking")
|
|
else
|
|
M.visible_message(\
|
|
"\blue [M.name] is buckled in to [src] by [user.name]!",\
|
|
"You are buckled in to [src] by [user.name].",\
|
|
"You hear metal clanking")
|
|
M.buckled = src
|
|
M.loc = src.loc
|
|
M.dir = src.dir
|
|
M.update_canmove()
|
|
src.buckled_mob = M
|
|
src.add_fingerprint(user)
|
|
return
|
|
|
|
/obj/structure/stool/bed/MouseDrop_T(mob/M as mob, mob/user as mob)
|
|
if(!istype(M)) return
|
|
buckle_mob(M, user)
|
|
return
|
|
|
|
/obj/structure/stool/bed/attack_paw(mob/user as mob)
|
|
return src.attack_hand(user)
|
|
|
|
/obj/structure/stool/bed/attack_hand(mob/user as mob)
|
|
manual_unbuckle(user)
|
|
return
|
|
|
|
/obj/structure/stool/bed/chair/New()
|
|
if(anchored)
|
|
src.verbs -= /atom/movable/verb/pull
|
|
if(src.dir == NORTH)
|
|
src.layer = FLY_LAYER
|
|
..()
|
|
return
|
|
|
|
/obj/structure/stool/bed/chair/verb/rotate()
|
|
set name = "Rotate Chair"
|
|
set category = "Object"
|
|
set src in oview(1)
|
|
|
|
src.dir = turn(src.dir, 90)
|
|
if(src.dir == NORTH)
|
|
src.layer = FLY_LAYER
|
|
else
|
|
src.layer = OBJ_LAYER
|
|
|
|
if(buckled_mob)
|
|
buckled_mob.dir = dir
|
|
return
|
|
|
|
/obj/structure/stool/bed/chair/MouseDrop_T(mob/M as mob, mob/user as mob)
|
|
if(!istype(M)) return
|
|
buckle_mob(M, user)
|
|
return
|
|
|
|
//roller bed
|
|
|
|
/obj/structure/stool/bed/roller
|
|
name = "roller bed"
|
|
icon = 'rollerbed.dmi'
|
|
icon_state = "down"
|
|
anchored = 0
|
|
|
|
/obj/structure/stool/bed/roller/Move()
|
|
..()
|
|
if(buckled_mob)
|
|
if(buckled_mob.buckled == src)
|
|
buckled_mob.loc = src.loc
|
|
|
|
/obj/structure/stool/bed/roller/buckle_mob(mob/M as mob, mob/user as mob)
|
|
if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || usr.stat || M.buckled || istype(usr, /mob/living/silicon/pai) )
|
|
return
|
|
M.pixel_y = 6
|
|
density = 1
|
|
icon_state = "up"
|
|
..()
|
|
return
|
|
|
|
/obj/structure/stool/bed/roller/manual_unbuckle(mob/user as mob)
|
|
if(buckled_mob)
|
|
if(buckled_mob.buckled == src) //this is probably unneccesary, but it doesn't hurt
|
|
buckled_mob.pixel_y = 0
|
|
buckled_mob.anchored = initial(buckled_mob.anchored)
|
|
buckled_mob.buckled = null
|
|
buckled_mob.update_canmove()
|
|
buckled_mob = null
|
|
density = 0
|
|
icon_state = "down"
|
|
..()
|
|
return
|