Merge pull request #12734 from silicons/shoelaces

shoelaces. untying people's shoelaces. admin smite to untie someone's shoelaces. credit to shaps/tg.
This commit is contained in:
Lin
2020-07-28 21:51:43 -05:00
committed by GitHub
13 changed files with 288 additions and 8 deletions

View File

@@ -1280,12 +1280,12 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
ADMIN_PUNISHMENT_SUPPLYPOD,
ADMIN_PUNISHMENT_MAZING,
ADMIN_PUNISHMENT_ROD,
ADMIN_PUNISHMENT_SHOES,
ADMIN_PUNISHMENT_PICKLE,
ADMIN_PUNISHMENT_FRY,
ADMIN_PUNISHMENT_CRACK,
ADMIN_PUNISHMENT_BLEED,
ADMIN_PUNISHMENT_SCARIFY)
ADMIN_PUNISHMENT_CRACK,
ADMIN_PUNISHMENT_BLEED,
ADMIN_PUNISHMENT_SCARIFY)
var/punishment = input("Choose a punishment", "DIVINE SMITING") as null|anything in punishment_list
@@ -1395,6 +1395,17 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
if(ADMIN_PUNISHMENT_FRY)
target.fry()
if(ADMIN_PUNISHMENT_SHOES)
if(!iscarbon(target))
to_chat(usr,"<span class='warning'>This must be used on a carbon mob.</span>")
return
var/mob/living/carbon/C = target
var/obj/item/clothing/shoes/sick_kicks = C.shoes
if(!sick_kicks?.can_be_tied)
to_chat(usr,"<span class='warning'>[C] does not have knottable shoes!</span>")
return
sick_kicks.adjust_laces(SHOES_KNOTTED)
punish_log(target, punishment)
/client/proc/punish_log(var/whom, var/punishment)

View File

@@ -20,6 +20,15 @@
var/last_blood_DNA = "" //same as last one
var/last_blood_color = ""
///Whether these shoes have laces that can be tied/untied
var/can_be_tied = TRUE
///Are we currently tied? Can either be SHOES_UNTIED, SHOES_TIED, or SHOES_KNOTTED
var/tied = SHOES_TIED
///How long it takes to lace/unlace these shoes
var/lace_time = 5 SECONDS
///any alerts we have active
var/obj/screen/alert/our_alert
/obj/item/clothing/shoes/ComponentInitialize()
. = ..()
RegisterSignal(src, COMSIG_COMPONENT_CLEAN_ACT, /atom.proc/clean_blood)
@@ -43,6 +52,15 @@
playsound(user, 'sound/weapons/genhit2.ogg', 50, 1)
return(BRUTELOSS)
/obj/item/clothing/shoes/examine(mob/user)
. = ..()
if(!ishuman(loc))
return ..()
if(tied == SHOES_UNTIED)
. += "The shoelaces are untied."
else if(tied == SHOES_KNOTTED)
. += "The shoelaces are all knotted together."
/obj/item/clothing/shoes/transfer_blood_dna(list/blood_dna, diseases)
..()
@@ -74,6 +92,9 @@
worn_y_dimension -= (offset * 2)
user.update_inv_shoes()
equipped_before_drop = TRUE
if(can_be_tied && tied == SHOES_UNTIED)
our_alert = user.throw_alert("shoealert", /obj/screen/alert/shoes/untied)
RegisterSignal(src, COMSIG_SHOES_STEP_ACTION, .proc/check_trip, override=TRUE)
/obj/item/clothing/shoes/proc/restore_offsets(mob/user)
equipped_before_drop = FALSE
@@ -81,6 +102,8 @@
worn_y_dimension = world.icon_size
/obj/item/clothing/shoes/dropped(mob/user)
if(our_alert && (our_alert.mob_viewer == user))
user.clear_alert("shoealert")
if(offset && equipped_before_drop)
restore_offsets(user)
. = ..()
@@ -101,3 +124,167 @@
/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
*
* Arguments:
* *
* * state: SHOES_UNTIED, SHOES_TIED, or SHOES_KNOTTED, depending on what you want them to become
* * user: used to check to see if we're the ones unknotting our own laces
*/
/obj/item/clothing/shoes/proc/adjust_laces(state, mob/user)
if(!can_be_tied)
return
var/mob/living/carbon/human/our_guy
if(ishuman(loc))
our_guy = loc
tied = state
if(tied == SHOES_TIED)
if(our_guy)
our_guy.clear_alert("shoealert")
UnregisterSignal(src, COMSIG_SHOES_STEP_ACTION)
else
if(tied == SHOES_UNTIED && our_guy && user == our_guy)
our_alert = our_guy.throw_alert("shoealert", /obj/screen/alert/shoes/untied) // if we're the ones unknotting our own laces, of course we know they're untied
RegisterSignal(src, COMSIG_SHOES_STEP_ACTION, .proc/check_trip, override=TRUE)
/**
* handle_tying deals with all the actual tying/untying/knotting, inferring your intent from who you are in relation to the state of the laces
*
* If you're the wearer, you want them to move towards tied-ness (knotted -> untied -> tied). If you're not, you're pranking them, so you're moving towards knotted-ness (tied -> untied -> knotted)
*
* Arguments:
* *
* * user: who is the person interacting with the shoes?
*/
/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=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)
else
adjust_laces(SHOES_UNTIED, user)
else // if they're someone else's shoes, go knot-wards
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=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>", 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")
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)
///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/?
return
if(tied == SHOES_KNOTTED)
our_guy.Paralyze(5)
our_guy.Knockdown(10)
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(/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)
/obj/item/clothing/shoes/attack_hand(mob/living/carbon/human/user)
if(!istype(user))
return ..()
if(loc == user && tied != SHOES_TIED && (user.mobility_flags & MOBILITY_USE))
handle_tying(user)
return
..()
/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,extra_checks=CALLBACK(src, .proc/still_shoed, user)))
to_chat(user, "<span class='notice'>You [tied ? "untie" : "tie"] the laces on [src].</span>")
adjust_laces(tied ? SHOES_TIED : SHOES_UNTIED, user)

View File

@@ -17,6 +17,7 @@
resistance_flags = NONE
permeability_coefficient = 0.05 //Thick soles, and covers the ankle
pocket_storage_component_path = /datum/component/storage/concrete/pockets/shoes
lace_time = 12 SECONDS
/obj/item/clothing/shoes/combat/sneakboots
name = "insidious sneakboots"
@@ -49,6 +50,7 @@
strip_delay = 50
equip_delay_other = 50
permeability_coefficient = 0.9
can_be_tied = FALSE
/obj/item/clothing/shoes/sandal/marisa
desc = "A pair of magic black shoes."
@@ -73,6 +75,7 @@
resistance_flags = NONE
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 40, "acid" = 75)
custom_price = PRICE_ABOVE_EXPENSIVE
can_be_tied = FALSE
/obj/item/clothing/shoes/galoshes/dry
name = "absorbent galoshes"
@@ -99,6 +102,7 @@
icon_state = "clown_shoes"
slowdown = SHOES_SLOWDOWN+1
pocket_storage_component_path = /datum/component/storage/concrete/pockets/shoes/clown
lace_time = 20 SECONDS // how the hell do these laces even work??
/obj/item/clothing/shoes/clown_shoes/Initialize()
. = ..()
@@ -130,6 +134,7 @@
resistance_flags = NONE
permeability_coefficient = 0.05 //Thick soles, and covers the ankle
pocket_storage_component_path = /datum/component/storage/concrete/pockets/shoes
lace_time = 12 SECONDS
/obj/item/clothing/shoes/jackboots/fast
slowdown = -1
@@ -144,6 +149,7 @@
heat_protection = FEET|LEGS
max_heat_protection_temperature = SHOES_MAX_TEMP_PROTECT
pocket_storage_component_path = /datum/component/storage/concrete/pockets/shoes
lace_time = 8 SECONDS
/obj/item/clothing/shoes/winterboots/ice_boots
name = "ice hiking boots"
@@ -177,6 +183,7 @@
strip_delay = 40
equip_delay_other = 40
pocket_storage_component_path = /datum/component/storage/concrete/pockets/shoes
lace_time = 8 SECONDS
/obj/item/clothing/shoes/workboots/mining
name = "mining boots"
@@ -196,6 +203,7 @@
min_cold_protection_temperature = SHOES_MIN_TEMP_PROTECT
heat_protection = FEET
max_heat_protection_temperature = SHOES_MAX_TEMP_PROTECT
lace_time = 10 SECONDS
/obj/item/clothing/shoes/cult/alt
name = "cultist boots"
@@ -226,12 +234,14 @@
strip_delay = 100
equip_delay_other = 100
permeability_coefficient = 0.9
can_be_tied = FALSE
/obj/item/clothing/shoes/griffin
name = "griffon boots"
desc = "A pair of costume boots fashioned after bird talons."
icon_state = "griffinboots"
pocket_storage_component_path = /datum/component/storage/concrete/pockets/shoes
lace_time = 8 SECONDS
/obj/item/clothing/shoes/bhop
name = "jump boots"
@@ -284,6 +294,7 @@
desc = "A giant, clunky pair of shoes crudely made out of bronze. Why would anyone wear these?"
icon = 'icons/obj/clothing/clockwork_garb.dmi'
icon_state = "clockwork_treads"
lace_time = 8 SECONDS
/obj/item/clothing/shoes/bronze/Initialize()
. = ..()
@@ -358,6 +369,7 @@
icon_state = "rus_shoes"
item_state = "rus_shoes"
pocket_storage_component_path = /datum/component/storage/concrete/pockets/shoes
lace_time = 8 SECONDS
// kevin is into feet
/obj/item/clothing/shoes/wraps
@@ -365,6 +377,7 @@
desc = "Ankle coverings. These ones have a golden design."
icon_state = "gildedcuffs"
body_parts_covered = FALSE
can_be_tied = FALSE
/obj/item/clothing/shoes/wraps/silver
name = "silver leg wraps"
@@ -385,6 +398,7 @@
name = "cowboy boots"
desc = "A standard pair of brown cowboy boots."
icon_state = "cowboyboots"
can_be_tied = FALSE
/obj/item/clothing/shoes/cowboyboots/black
name = "black cowboy boots"

View File

@@ -24,7 +24,7 @@
var/obj/item/head = null
var/obj/item/gloves = null //only used by humans
var/obj/item/shoes = null //only used by humans.
var/obj/item/clothing/shoes/shoes = null //only used by humans.
var/obj/item/clothing/glasses/glasses = null //only used by humans.
var/obj/item/ears = null //only used by humans.

View File

@@ -170,7 +170,11 @@
if(SLOT_SHOES in obscured)
dat += "<tr><td><font color=grey><B>Shoes:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Shoes:</B></td><td><A href='?src=[REF(src)];item=[SLOT_SHOES]'>[(shoes && !(shoes.item_flags & ABSTRACT)) ? shoes : "<font color=grey>Empty</font>"]</A></td></tr>"
dat += "<tr><td><B>Shoes:</B></td><td><A href='?src=[REF(src)];item=[SLOT_SHOES]'>[(shoes && !(shoes.item_flags & ABSTRACT)) ? shoes : "<font color=grey>Empty</font>"]</A>"
if(shoes && shoes.can_be_tied && shoes.tied != SHOES_KNOTTED)
dat += "&nbsp;<A href='?src=[REF(src)];shoes=[SLOT_SHOES]'>[shoes.tied ? "Untie shoes" : "Knot shoes"]</A>"
dat += "</td></tr>"
if(SLOT_GLOVES in obscured)
dat += "<tr><td><font color=grey><B>Gloves:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
@@ -294,6 +298,12 @@
if (!strip_silence)
to_chat(src, "<span class='warning'>You feel your [pocket_side] pocket being fumbled with!</span>")
if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY, null, FALSE))
// separate from first canusetopic
var/mob/living/user = usr
if(istype(user) && href_list["shoes"] && (user.mobility_flags & MOBILITY_USE)) // we need to be on the ground, so we'll be a bit looser
shoes.handle_tying(usr)
..() //CITADEL CHANGE - removes a tab from behind this ..() so that flavortext can actually be examined

View File

@@ -162,3 +162,6 @@
var/typing_indicator_timerid
/// Current state of our typing indicator. Used for cut overlay, DO NOT RUNTIME ASSIGN OTHER THAN FROM SHOW/CLEAR. Used to absolutely ensure we do not get stuck overlays.
var/typing_indicator_current
///For storing what do_after's someone has, in case we want to restrict them to only one of a certain do_after at a time
var/list/do_afters