Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QoL Changes to Sword Sheaths + Katana Sakuride Coating #16383

Merged
merged 11 commits into from
Oct 18, 2023
12 changes: 12 additions & 0 deletions code/modules/items/specials/ItemSpecials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1515,15 +1515,18 @@ ABSTRACT_TYPE(/datum/item_special/spark)
K.start.loc = T1
K.start.set_dir(direction)
flick(K.start.icon_state, K.start)
apply_dash_reagent(user, T1)
sleep(0.1 SECONDS)
if (T4)
K.mid1.loc = T2
K.mid1.set_dir(direction)
flick(K.mid1.icon_state, K.mid1)
apply_dash_reagent(user, T2)
sleep(0.1 SECONDS)
K.mid2.loc = T3
K.mid2.set_dir(direction)
flick(K.mid2.icon_state, K.mid2)
apply_dash_reagent(user, T3)
sleep(0.1 SECONDS)
K.end.loc = T4
K.end.set_dir(direction)
Expand All @@ -1532,6 +1535,7 @@ ABSTRACT_TYPE(/datum/item_special/spark)
K.mid1.loc = T2
K.mid1.set_dir(direction)
flick(K.mid1.icon_state, K.mid1)
apply_dash_reagent(user, T2)
sleep(0.1 SECONDS)
K.end.loc = T3
K.end.set_dir(direction)
Expand Down Expand Up @@ -1561,6 +1565,14 @@ ABSTRACT_TYPE(/datum/item_special/spark)
playsound(master, 'sound/effects/sparks6.ogg', 70, FALSE)
return

proc/apply_dash_reagent(mob/user, var/turf/loc)
if(K.reagents.has_reagent("sakuride", 1))
var/datum/reagent/sakuride = K.reagents.get_reagent("sakuride")
sakuride.reaction_turf(loc, 1)
K.reagents.remove_reagent("sakuride", 1)
if(K.reagents.get_reagent_amount("sakuride") < 1)
boutput(user, "The blade's coating tarnishes.")

proc/on_hit(var/mob/hit)
if (ishuman(hit))
var/mob/living/carbon/human/H = hit
Expand Down
37 changes: 36 additions & 1 deletion code/obj/item/misc_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1245,10 +1245,10 @@ TYPEINFO(/obj/item/swords/katana)
contraband = 7 //Fun fact: sheathing your katana makes you 100% less likely to be tazed by beepsky, probably
hitsound = 'sound/impact_sounds/katana_slash.ogg'
midair_fruit_slice = TRUE
var/reagent_capacity = 15
HELP_MESSAGE_OVERRIDE({"Hit someone while aiming at a specific limb to immediatly slice off the targeted limb. If both arms and legs are sliced off, you can decapitate your target by aiming for the head.\n
While on any intent other than <span class='help'>help</span>, click a tile away from you to quickly dash forward to it's location, slicing those in the way."})


// pickup_sfx = 'sound/items/blade_pull.ogg'
var/obj/itemspecialeffect/katana_dash/start/start
var/obj/itemspecialeffect/katana_dash/mid/mid1
Expand All @@ -1269,9 +1269,29 @@ TYPEINFO(/obj/item/swords/katana)
mid1 = new/obj/itemspecialeffect/katana_dash/mid(src)
mid2 = new/obj/itemspecialeffect/katana_dash/mid(src)
end = new/obj/itemspecialeffect/katana_dash/end(src)
src.create_reagents(src.reagent_capacity)
src.setItemSpecial(/datum/item_special/katana_dash)
BLOCK_SETUP(BLOCK_SWORD)

afterattack(atom/target, mob/user)
..()
apply_coating(target, user)

proc/apply_coating(var/atom/target, var/mob/user)
if (target.is_open_container())
KevinfromHP marked this conversation as resolved.
Show resolved Hide resolved
var/obj/item/reagent_containers/RC = target
KevinfromHP marked this conversation as resolved.
Show resolved Hide resolved
if(RC.reagents.has_reagent("sakuride", 1))
if(length(RC.reagents.reagent_list) > 1)
boutput(user, "<span class='alert'>This coating is impure!</span>")
return
if(src.reagents.has_reagent("sakuride", src.reagent_capacity))
boutput(user, "<span class='alert'>The blade is already coated!</span>")
return
RC.reagents.trans_to(src, src.reagent_capacity)
boutput(user, "You apply the coating to the blade.")
else
boutput(user, "<span class='alert'>You cannot coat the [src] in this!</span>")

/obj/item/swords/katana/suicide(var/mob/user as mob)
user.visible_message("<span class='alert'><b>[user] thrusts [src] through their stomach!</b></span>")
var/say = pick("Kono shi wa watashinokazoku ni meiyo o ataeru","Haji no mae no shi", "Watashi wa kyo nagura reta.", "Teki ga katta", "Shinjiketo ga modotte kuru")
Expand Down Expand Up @@ -1458,6 +1478,21 @@ TYPEINFO(/obj/item/swords/captain)
if(W.cant_drop == 1)
boutput(user, "<span class='notice'>You can't sheathe the [W] while its attached to your arm.</span>")

mouse_drop(atom/over_object, src_location, over_location)
..()
var/atom/movable/screen/hud/S = over_object
if (istype(S))
playsound(src.loc, "rustle", 50, 1, -5)
if (can_act(usr) && src.loc == usr)
if (S.id == "rhand")
if (!usr.r_hand)
usr.u_equip(src)
usr.put_in_hand_or_drop(src, 0)
else
if (S.id == "lhand")
if (!usr.l_hand)
usr.u_equip(src)
usr.put_in_hand_or_drop(src, 1)

/obj/item/swords_sheaths/proc/draw_sword(mob/living/carbon/human/user)
if(src.sword_inside) //Checks if a sword is inside
Expand Down