diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 8823579b..88054b53 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -145,7 +145,7 @@ GLOBAL_LIST_INIT(bitfields, list( "VOICEBOX_TOGGLABLE" = VOICEBOX_TOGGLABLE, "VOICEBOX_DISABLED" = VOICEBOX_DISABLED, "IGNORE_HAT_TOSS" = IGNORE_HAT_TOSS, - "SCAN_REAGENTS" = SCAN_REAGENTS + "SCAN_REAGENTS" = SCAN_REAGENTS, ), "tesla_flags" = list( "TESLA_MOB_DAMAGE" = TESLA_MOB_DAMAGE, diff --git a/code/controllers/subsystem/throwing.dm b/code/controllers/subsystem/throwing.dm index d0d69d97..908b8944 100644 --- a/code/controllers/subsystem/throwing.dm +++ b/code/controllers/subsystem/throwing.dm @@ -43,6 +43,7 @@ SUBSYSTEM_DEF(throwing) var/atom/movable/thrownthing var/atom/target var/turf/target_turf + var/target_zone var/init_dir var/maxrange var/speed diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 7f3f3f3e..fbc9fdf1 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -627,6 +627,8 @@ TT.diagonals_first = diagonals_first TT.force = force TT.callback = callback + if(!QDELETED(thrower)) + TT.target_zone = thrower.zone_selected var/dist_x = abs(target.x - src.x) var/dist_y = abs(target.y - src.y) diff --git a/code/modules/clothing/head/_head.dm b/code/modules/clothing/head/_head.dm index fc1e78b6..2a1626df 100644 --- a/code/modules/clothing/head/_head.dm +++ b/code/modules/clothing/head/_head.dm @@ -40,6 +40,37 @@ muzzle_var = NORMAL_STYLE H.update_inv_head() + +///Special throw_impact for hats to frisbee hats at people to place them on their heads. +/obj/item/clothing/head/throw_impact(atom/hit_atom, datum/thrownthing/thrownthing) + . = ..() + ///if the thrown object's target zone isn't the head + if(thrownthing.target_zone != BODY_ZONE_HEAD) + return + ///ignore any hats with downsides when worn + if(clothing_flags & IGNORE_HAT_TOSS) + return + ///if the hat happens to be capable of holding contents and has something in it. mostly to prevent super cheesy stuff like stuffing a mini-bomb in a hat and throwing it + if(LAZYLEN(contents)) + return + if(iscarbon(hit_atom)) + var/mob/living/carbon/H = hit_atom + if(istype(H.head, /obj/item)) + var/obj/item/WH = H.head + H.visible_message("[src] bounces off [H]'s [WH.name]!", "[src] bounces off your [WH.name], falling to the floor.") + return + if(H.equip_to_slot_if_possible(src, SLOT_HEAD, FALSE, TRUE)) + H.visible_message("[src] lands neatly on [H]'s head!", "[src] lands perfectly onto your head!") + return + if(iscyborg(hit_atom)) + var/mob/living/silicon/robot/R = hit_atom + ///hats in the borg's blacklist bounce off + if(!is_type_in_typecache(src, R.equippable_hats) || R.hat_offset == INFINITY) + R.visible_message("[src] bounces off [R]!", "[src] bounces off you, falling to the floor.") + return + else + R.visible_message("[src] lands neatly on top of [R].", "[src] lands perfectly on top of you.") + R.place_on_head(src) //hats aren't designed to snugly fit borg heads or w/e so they'll always manage to knock eachother off /obj/item/clothing/head/worn_overlays(isinhands = FALSE) . = list() diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index 82e5e782..48788842 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -158,4 +158,4 @@ /obj/item/clothing/head/hardhat/weldhat/dblue icon_state = "hardhat0_dblue" item_state = "hardhat0_dblue" - item_color = "dblue" \ No newline at end of file + item_color = "dblue" diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 15df4131..e7958d39 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -13,7 +13,6 @@ resistance_flags = NONE flags_cover = HEADCOVERSEYES flags_inv = HIDEHAIR - dog_fashion = /datum/dog_fashion/head/helmet /obj/item/clothing/head/helmet/ComponentInitialize() diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 46737f32..44644962 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -238,6 +238,7 @@ armor = list("melee" = 0, "bullet" = 0, "laser" = -5,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = -5, "fire" = 0, "acid" = 0) equip_delay_other = 140 var/datum/brain_trauma/mild/phobia/paranoia + clothing_flags = IGNORE_HAT_TOSS /obj/item/clothing/head/foilhat/equipped(mob/living/carbon/human/user, slot) ..()