diff --git a/code/game/objects/items/weapons/material/misc.dm b/code/game/objects/items/weapons/material/misc.dm index 754943671ef..d8906955a15 100644 --- a/code/game/objects/items/weapons/material/misc.dm +++ b/code/game/objects/items/weapons/material/misc.dm @@ -93,3 +93,118 @@ //icon_state = "reinf-snowball" force_divisor = 0.20 thrown_force_divisor = 0.25 + +/obj/item/weapon/material/whip + name = "whip" + desc = "A tool used to discipline animals, or look cool. Mostly the latter." + description_info = "Help - Standard attack, no modifiers.
\ + Disarm - Disarming strike. Attempts to disarm the target at range, similar to an unarmed disarm. Additionally, will force the target (if possible) to move away from you.
\ + Grab - Grappling strike. Attempts to pull the target toward you. This can also move objects.
\ + Harm - A standard strike with a small chance to disarm." + icon = 'icons/obj/weapons.dmi' + icon_state = "whip" + item_state = "chain" + default_material = MAT_LEATHER + slot_flags = SLOT_BELT + w_class = ITEMSIZE_NORMAL + origin_tech = list(TECH_COMBAT = 2) + attack_verb = list("flogged", "whipped", "lashed", "disciplined") + force_divisor = 0.15 + thrown_force_divisor = 0.25 + reach = 2 + + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_melee.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_melee.dmi', + ) + +/obj/item/weapon/material/whip/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity) + ..() + + if(!proximity) + return + + if(istype(A, /atom/movable)) + var/atom/movable/AM = A + if(AM.anchored) + to_chat(user, "\The [AM] won't budge.") + return + + else + if(!istype(AM, /obj/item)) + user.visible_message("\The [AM] is pulled along by \the [src]!") + AM.Move(get_step(AM, get_dir(AM, src))) + return + + else + user.visible_message("\The [AM] is snatched by \the [src]!") + AM.throw_at(user, reach, 0.1, user) + +/obj/item/weapon/material/whip/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone) + if(user.a_intent) + switch(user.a_intent) + if(I_HURT) + if(prob(10) && istype(target, /mob/living/carbon/human) && user.zone_sel in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND)) + to_chat(target, "\The [src] rips at your hands!") + ranged_disarm(target) + if(I_DISARM) + if(prob(min(90, force * 3)) && istype(target, /mob/living/carbon/human) && user.zone_sel in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND)) + ranged_disarm(target) + else + target.visible_message("\The [src] sends \the [target] stumbling away.") + target.Move(get_step(target,get_dir(user,target))) + if(I_GRAB) + var/turf/STurf = get_turf(target) + spawn(2) + playsound(STurf, 'sound/effects/snap.ogg', 60, 1) + target.visible_message("\The [src] yanks \the [target] towards \the [user]!") + target.throw_at(get_turf(get_step(user,get_dir(user,target))), 2, 1, src) + + ..() + +/obj/item/weapon/material/whip/proc/ranged_disarm(var/mob/living/carbon/human/H, var/mob/living/user) + if(istype(H)) + var/list/holding = list(H.get_active_hand() = 40, H.get_inactive_hand() = 20) + + if(user.zone_sel in list(BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND)) + for(var/obj/item/weapon/gun/W in holding) + if(W && prob(holding[W])) + var/list/turfs = list() + for(var/turf/T in view()) + turfs += T + if(turfs.len) + var/turf/target = pick(turfs) + visible_message("[H]'s [W] goes off due to \the [src]!") + return W.afterattack(target,H) + + if(!(H.species.flags & NO_SLIP) && prob(10) && user.zone_sel in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT)) + var/armor_check = H.run_armor_check(user.zone_sel, "melee") + H.apply_effect(3, WEAKEN, armor_check) + playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + if(armor_check < 60) + visible_message("\The [src] has tripped [H]!") + else + visible_message("\The [src] attempted to trip [H]!") + return + + else + if(H.break_all_grabs(user)) + playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + return + + if(user.zone_sel in list(BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND)) + for(var/obj/item/I in holding) + if(I && prob(holding[I])) + H.drop_from_inventory(I) + visible_message("\The [src] has disarmed [H]!") + playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + return + +/obj/item/weapon/material/whip/suicide_act(mob/user) + var/datum/gender/T = gender_datums[user.get_visible_gender()] + user.visible_message(span("danger", "\The [user] [T.is] strangling [T.himself] with \the [src]! It looks like [T.he] [T.is] trying to commit suicide."), span("danger", "You start to strangle yourself with \the [src]!"), span("danger", "You hear the sound of someone choking!")) + return (OXYLOSS) + +/obj/item/weapon/material/whip/attack_self(mob/user) + user.visible_message("\The [user] cracks \the [src]!") + playsound(src, 'sound/effects/snap.ogg', 50, 1) diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index 4185cf92c24..b7684d6a7fa 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -9,10 +9,12 @@ origin_tech = list(TECH_COMBAT = 4) attack_verb = list("flogged", "whipped", "lashed", "disciplined") - suicide_act(mob/user) - var/datum/gender/T = gender_datums[user.get_visible_gender()] - user.visible_message(span("danger", "\The [user] [T.is] strangling [T.himself] with \the [src]! It looks like [T.he] [T.is] trying to commit suicide."), span("danger", "You start to strangle yourself with \the [src]!"), span("danger", "You hear the sound of someone choking!")) - return (OXYLOSS) + reach = 2 + +/obj/item/weapon/melee/chainofcommand/suicide_act(mob/user) + var/datum/gender/T = gender_datums[user.get_visible_gender()] + user.visible_message(span("danger", "\The [user] [T.is] strangling [T.himself] with \the [src]! It looks like [T.he] [T.is] trying to commit suicide."), span("danger", "You start to strangle yourself with \the [src]!"), span("danger", "You hear the sound of someone choking!")) + return (OXYLOSS) /obj/item/weapon/melee/umbrella name = "umbrella" diff --git a/code/modules/materials/material_recipes.dm b/code/modules/materials/material_recipes.dm index 57bf6b9b7dc..6e4b7c741fa 100644 --- a/code/modules/materials/material_recipes.dm +++ b/code/modules/materials/material_recipes.dm @@ -269,3 +269,4 @@ recipes += new/datum/stack_recipe("[display_name] ring", /obj/item/clothing/gloves/ring/material, 1, on_floor = 1, supplied_material = "[name]", pass_stack_color = TRUE) recipes += new/datum/stack_recipe("[display_name] bracelet", /obj/item/clothing/accessory/bracelet/material, 1, on_floor = 1, supplied_material = "[name]", pass_stack_color = TRUE) recipes += new/datum/stack_recipe("[display_name] armor plate", /obj/item/weapon/material/armor_plating, 1, time = 20, on_floor = 1, supplied_material = "[name]", pass_stack_color = TRUE) + recipes += new/datum/stack_recipe("whip", /obj/item/weapon/material/whip, 5, time = 15 SECONDS, pass_stack_color = TRUE, supplied_material = "[name]")