From 72a3ecc8351c57dd0742e5e031a682628618f504 Mon Sep 17 00:00:00 2001 From: LiquidPotroh Date: Wed, 21 Feb 2024 02:32:59 +0300 Subject: [PATCH] toy sword no more lethal --- code/game/objects/items/toys.dm | 11 +++++++++++ code/game/objects/items/weapons/twohanded.dm | 10 ++++++++-- code/modules/martial_arts/theforce.dm | 2 ++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 77db10a3288..99bba96a8ec 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -246,6 +246,17 @@ if(wielded) return 2 +/obj/item/twohanded/dualsaber/toy/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum, speed) + . = ..(hit_atom, throwingdatum, speed, skip = TRUE) + +/obj/item/twohanded/dualsaber/toy/attack(mob/target, mob/living/user, def_zone, delimb_chance) + if((CLUMSY in user.mutations) && (active) && prob(40)) + to_chat(user, "You twirl around a bit before losing your balance and impaling yourself on the [src].") + return ..(user, user, def_zone, delimb_chance, skip = TRUE) + if(active && prob(50)) + INVOKE_ASYNC(src, PROC_REF(jedi_spin), user) + . = ..(target, user, def_zone, delimb_chance, skip = TRUE) + /obj/item/toy/katana name = "replica katana" desc = "Woefully underpowered in D20." diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 15331bc2c6a..45a733b202d 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -282,7 +282,10 @@ set_light(0) -/obj/item/twohanded/dualsaber/attack(mob/target, mob/living/user, def_zone, delimb_chance) +/obj/item/twohanded/dualsaber/attack(mob/target, mob/living/user, def_zone, delimb_chance, skip = FALSE) + if(skip) //if we come from /obj/item/twohanded/dualsaber/toy + return ..() + force = active ? force_wielded : initial(force) var/datum/martial_art/theforce/MA = user?.mind?.martial_art @@ -312,7 +315,10 @@ return FALSE -/obj/item/twohanded/dualsaber/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) +/obj/item/twohanded/dualsaber/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum, speed, skip = FALSE) + if(skip) //if we come from /obj/item/twohanded/dualsaber/toy + return ..() + var/datum/martial_art/theforce/MA = throwingdatum?.thrower?.mind?.martial_art if(istype(MA) && active) throwingdatum.delimb_chance = MA.throw_sword_delimb_chance diff --git a/code/modules/martial_arts/theforce.dm b/code/modules/martial_arts/theforce.dm index 7224b6fb128..e62a9ddad94 100644 --- a/code/modules/martial_arts/theforce.dm +++ b/code/modules/martial_arts/theforce.dm @@ -69,6 +69,8 @@ /obj/effect/proc_holder/spell/summon_sword/cast(targets, mob/user = usr) var/obj/item/sword for(var/obj/item/I in view(user)) + if(istype(I, /obj/item/twohanded/dualsaber/toy)) + continue if(is_type_in_list(I, list(/obj/item/melee/energy/sword, /obj/item/twohanded/dualsaber))) sword = I break