|
|
|
@@ -125,7 +125,6 @@
|
|
|
|
|
/obj/item/proc/negates_gravity()
|
|
|
|
|
return FALSE
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* adjust_laces adjusts whether our shoes (assuming they can_be_tied) and tied, untied, or knotted
|
|
|
|
|
*
|
|
|
|
|
* In addition to setting the state, it will deal with getting rid of alerts if they exist, as well as registering and unregistering the stepping signals
|
|
|
|
@@ -162,16 +161,23 @@
|
|
|
|
|
* *
|
|
|
|
|
* * user: who is the person interacting with the shoes?
|
|
|
|
|
*/
|
|
|
|
|
/obj/item/clothing/shoes/proc/handle_tying(mob/living/carbon/human/user)
|
|
|
|
|
/obj/item/clothing/shoes/proc/handle_tying(mob/user)
|
|
|
|
|
///our_guy here is the wearer, if one exists (and he must exist, or we don't care)
|
|
|
|
|
var/mob/living/carbon/human/our_guy = loc
|
|
|
|
|
if(!istype(our_guy))
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
if(!in_range(user, our_guy))
|
|
|
|
|
to_chat(user, "<span class='warning'>You aren't close enough to interact with [src]'s laces!</span>")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
if(user == loc && tied != SHOES_TIED) // if they're our own shoes, go tie-wards
|
|
|
|
|
if(INTERACTING_WITH(user, our_guy))
|
|
|
|
|
to_chat(user, "<span class='warning'>You're already interacting with [src]!</span>")
|
|
|
|
|
return
|
|
|
|
|
user.visible_message("<span class='notice'>[user] begins [tied ? "unknotting" : "tying"] the laces of [user.p_their()] [src.name].</span>", "<span class='notice'>You begin [tied ? "unknotting" : "tying"] the laces of your [src.name]...</span>")
|
|
|
|
|
|
|
|
|
|
if(do_after(user, lace_time, needhand=TRUE, target=src))
|
|
|
|
|
if(do_after(user, lace_time, needhand=TRUE, target=our_guy, extra_checks=CALLBACK(src, .proc/still_shoed, our_guy)))
|
|
|
|
|
to_chat(user, "<span class='notice'>You [tied ? "unknot" : "tie"] the laces of your [src.name].</span>")
|
|
|
|
|
if(tied == SHOES_UNTIED)
|
|
|
|
|
adjust_laces(SHOES_TIED, user)
|
|
|
|
@@ -179,36 +185,43 @@
|
|
|
|
|
adjust_laces(SHOES_UNTIED, user)
|
|
|
|
|
|
|
|
|
|
else // if they're someone else's shoes, go knot-wards
|
|
|
|
|
if(user.mobility_flags & MOBILITY_STAND)
|
|
|
|
|
var/mob/living/L = user
|
|
|
|
|
if(istype(L) && (L.mobility_flags & MOBILITY_STAND))
|
|
|
|
|
to_chat(user, "<span class='warning'>You must be on the floor to interact with [src]!</span>")
|
|
|
|
|
return
|
|
|
|
|
if(tied == SHOES_KNOTTED)
|
|
|
|
|
to_chat(user, "<span class='warning'>The laces on [loc]'s [src.name] are already a hopelessly tangled mess!</span>")
|
|
|
|
|
return
|
|
|
|
|
if(INTERACTING_WITH(user, our_guy))
|
|
|
|
|
to_chat(user, "<span class='warning'>You're already interacting with [src]!</span>")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
var/mod_time = lace_time
|
|
|
|
|
to_chat(user, "<span class='notice'>You quietly set to work [tied ? "untying" : "knotting"] [loc]'s [src.name]...</span>")
|
|
|
|
|
if(HAS_TRAIT(user, TRAIT_CLUMSY)) // based clowns trained their whole lives for this
|
|
|
|
|
mod_time *= 0.75
|
|
|
|
|
|
|
|
|
|
if(do_after(user, mod_time, needhand=TRUE, target=src))
|
|
|
|
|
if(do_after(user, mod_time, needhand=TRUE, target=our_guy, extra_checks=CALLBACK(src, .proc/still_shoed, our_guy)))
|
|
|
|
|
to_chat(user, "<span class='notice'>You [tied ? "untie" : "knot"] the laces on [loc]'s [src.name].</span>")
|
|
|
|
|
if(tied == SHOES_UNTIED)
|
|
|
|
|
adjust_laces(SHOES_KNOTTED, user)
|
|
|
|
|
else
|
|
|
|
|
adjust_laces(SHOES_UNTIED, user)
|
|
|
|
|
else // if one of us moved
|
|
|
|
|
user.visible_message("<span class='danger'>[our_guy] stamps on [user]'s hand, mid-shoelace [tied ? "knotting" : "untying"]!</span>", "<span class='userdanger'>Ow! [our_guy] stamps on your hand!</span>", user)
|
|
|
|
|
to_chat(our_guy, "<span class='userdanger'>You stamp on [user]'s hand! What the- they were [tied ? "knotting" : "untying"] your shoelaces!</span>")
|
|
|
|
|
user.visible_message("<span class='danger'>[our_guy] stamps on [user]'s hand, mid-shoelace [tied ? "knotting" : "untying"]!</span>", "<span class='userdanger'>Ow! [our_guy] stamps on your hand!</span>", list(our_guy))
|
|
|
|
|
to_chat(our_guy, "<span class='userdanger'>You stamp on [user]'s hand! What the- [user.p_they()] [user.p_were()] [tied ? "knotting" : "untying"] your shoelaces!</span>")
|
|
|
|
|
user.emote("scream")
|
|
|
|
|
var/obj/item/bodypart/ouchie = user.get_bodypart(pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))
|
|
|
|
|
if(ouchie)
|
|
|
|
|
ouchie.receive_damage(15)
|
|
|
|
|
user.Paralyze(5)
|
|
|
|
|
if(istype(L))
|
|
|
|
|
var/obj/item/bodypart/ouchie = L.get_bodypart(pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))
|
|
|
|
|
if(ouchie)
|
|
|
|
|
ouchie.receive_damage(brute = 10, stamina = 40)
|
|
|
|
|
L.Paralyze(10)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* check_trip runs on each step to see if we fall over as a result of our lace status. Knotted laces are a guaranteed trip, while untied shoes are just a chance to stumble
|
|
|
|
|
*/
|
|
|
|
|
///checking to make sure we're still on the person we're supposed to be, for lacing do_after's
|
|
|
|
|
/obj/item/clothing/shoes/proc/still_shoed(mob/living/carbon/our_guy)
|
|
|
|
|
return (loc == our_guy)
|
|
|
|
|
|
|
|
|
|
///check_trip runs on each step to see if we fall over as a result of our lace status. Knotted laces are a guaranteed trip, while untied shoes are just a chance to stumble
|
|
|
|
|
/obj/item/clothing/shoes/proc/check_trip()
|
|
|
|
|
var/mob/living/carbon/human/our_guy = loc
|
|
|
|
|
if(!istype(our_guy)) // are they REALLY /our guy/?
|
|
|
|
@@ -220,30 +233,35 @@
|
|
|
|
|
our_guy.visible_message("<span class='danger'>[our_guy] trips on [our_guy.p_their()] knotted shoelaces and falls! What a klutz!</span>", "<span class='userdanger'>You trip on your knotted shoelaces and fall over!</span>")
|
|
|
|
|
SEND_SIGNAL(our_guy, COMSIG_ADD_MOOD_EVENT, "trip", /datum/mood_event/tripped) // well we realized they're knotted now!
|
|
|
|
|
our_alert = our_guy.throw_alert("shoealert", /obj/screen/alert/shoes/knotted)
|
|
|
|
|
|
|
|
|
|
else if(tied == SHOES_UNTIED)
|
|
|
|
|
var/wiser = TRUE // did we stumble and realize our laces are undone?
|
|
|
|
|
switch(rand(1, 1000))
|
|
|
|
|
if(1) // .1% chance to trip and fall over (note these are per step while our laces are undone)
|
|
|
|
|
our_guy.Paralyze(5)
|
|
|
|
|
our_guy.Knockdown(10)
|
|
|
|
|
SEND_SIGNAL(our_guy, COMSIG_ADD_MOOD_EVENT, "trip", /datum/mood_event/tripped) // well we realized they're knotted now!
|
|
|
|
|
our_guy.visible_message("<span class='danger'>[our_guy] trips on [our_guy.p_their()] untied shoelaces and falls! What a klutz!</span>", "<span class='userdanger'>You trip on your untied shoelaces and fall over!</span>")
|
|
|
|
|
|
|
|
|
|
if(2 to 5) // .4% chance to stumble and lurch forward
|
|
|
|
|
our_guy.throw_at(get_step(our_guy, our_guy.dir), 3, 2)
|
|
|
|
|
to_chat(our_guy, "<span class='danger'>You stumble on your untied shoelaces and lurch forward!</span>")
|
|
|
|
|
|
|
|
|
|
if(6 to 13) // .7% chance to stumble and fling what we're holding
|
|
|
|
|
var/have_anything = FALSE
|
|
|
|
|
for(var/obj/item/I in our_guy.held_items)
|
|
|
|
|
have_anything = TRUE
|
|
|
|
|
our_guy.accident(I)
|
|
|
|
|
to_chat(our_guy, "<span class='danger'>You trip on your shoelaces a bit[have_anything ? ", flinging what you were holding" : ""]!</span>")
|
|
|
|
|
|
|
|
|
|
if(14 to 25) // 1.3ish% chance to stumble and be a bit off balance (like being disarmed)
|
|
|
|
|
to_chat(our_guy, "<span class='danger'>You stumble a bit on your untied shoelaces!</span>")
|
|
|
|
|
if(!our_guy.has_movespeed_modifier(MOVESPEED_ID_SHOVE))
|
|
|
|
|
our_guy.add_movespeed_modifier(MOVESPEED_ID_SHOVE, multiplicative_slowdown = SHOVE_SLOWDOWN_STRENGTH)
|
|
|
|
|
if(!our_guy.has_movespeed_modifier(/datum/movespeed_modifier/shove))
|
|
|
|
|
our_guy.add_movespeed_modifier(/datum/movespeed_modifier/shove)
|
|
|
|
|
addtimer(CALLBACK(our_guy, /mob/living/carbon/human/proc/clear_shove_slowdown), SHOVE_SLOWDOWN_LENGTH)
|
|
|
|
|
|
|
|
|
|
if(26 to 1000)
|
|
|
|
|
wiser = FALSE
|
|
|
|
|
|
|
|
|
|
if(wiser)
|
|
|
|
|
SEND_SIGNAL(our_guy, COMSIG_ADD_MOOD_EVENT, "untied", /datum/mood_event/untied) // well we realized they're untied now!
|
|
|
|
|
our_alert = our_guy.throw_alert("shoealert", /obj/screen/alert/shoes/untied)
|
|
|
|
@@ -252,7 +270,7 @@
|
|
|
|
|
/obj/item/clothing/shoes/attack_hand(mob/living/carbon/human/user)
|
|
|
|
|
if(!istype(user))
|
|
|
|
|
return ..()
|
|
|
|
|
if(loc == user && tied != SHOES_TIED)
|
|
|
|
|
if(loc == user && tied != SHOES_TIED && (user.mobility_flags & MOBILITY_USE))
|
|
|
|
|
handle_tying(user)
|
|
|
|
|
return
|
|
|
|
|
..()
|
|
|
|
@@ -260,10 +278,12 @@
|
|
|
|
|
/obj/item/clothing/shoes/attack_self(mob/user)
|
|
|
|
|
. = ..()
|
|
|
|
|
|
|
|
|
|
if(INTERACTING_WITH(user, src))
|
|
|
|
|
to_chat(user, "<span class='warning'>You're already interacting with [src]!</span>")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
to_chat(user, "<span class='notice'>You begin [tied ? "untying" : "tying"] the laces on [src]...</span>")
|
|
|
|
|
if(do_after(user, lace_time, needhand=TRUE, target=src))
|
|
|
|
|
|
|
|
|
|
if(do_after(user, lace_time, needhand=TRUE, target=src,extra_checks=CALLBACK(src, .proc/still_shoed, user)))
|
|
|
|
|
to_chat(user, "<span class='notice'>You [tied ? "untie" : "tie"] the laces on [src].</span>")
|
|
|
|
|
if(tied == SHOES_UNTIED)
|
|
|
|
|
adjust_laces(SHOES_TIED, user)
|
|
|
|
|
else
|
|
|
|
|
adjust_laces(SHOES_UNTIED, user)
|
|
|
|
|
adjust_laces(tied ? SHOES_TIED : SHOES_UNTIED, user)
|