Skip to content

add: Добавление рывка к катане #6690

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

Draft
wants to merge 3 commits into
base: master220
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,11 @@
/datum/action/item_action/activate/enchant/New(Target)
..()
UpdateButtonIcon()

/datum/action/item_action/katana
name = "Рывок"
desc = "Сделайте рывок вперёд, чтобы отрубить голову вашего врага"

/datum/action/item_action/halt
name = "HALT!"

Expand Down
44 changes: 44 additions & 0 deletions code/game/objects/items/weapons/weaponry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,56 @@
max_integrity = 200
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 50)
resistance_flags = FIRE_PROOF
var/katana_cooldown
var/mob/living/user = null
var/mob/living/target
actions_types = list(/datum/action/item_action/katana)


/obj/item/melee/katana/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is slitting [user.p_their()] stomach open with [src]! It looks like [user.p_theyre()] trying to commit seppuku.</span>")
return BRUTELOSS

/obj/item/melee/katana/proc/reset_cooldown()
katana_cooldown = FALSE
if(user)
user.update_action_buttons()
to_chat(user, span_notice("Вы готовы к новому рывку."))


/obj/item/melee/katana/ui_action_click(mob/user, datum/action/action, leftclick)
if(istype(action, /datum/action/item_action/katana))
jerk()

/obj/item/melee/katana/proc/jerk()
if(katana_cooldown)
to_chat(user, span_warning("Вам нужна отдышка перед новым рывком!"))
return

charge()

katana_cooldown = TRUE
addtimer(CALLBACK(src, PROC_REF(reset_cooldown)), 100 SECONDS) // 100 секунд для повторного рывка

/obj/item/melee/katana/proc/charge(atom/newloc)
user.cached_multiplicative_slowdown = -1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Работать с этим параметром напрямую -- не очень идея. Лучше использовать модификаторы скорости. Посмотреть, как они работают можно тут.https://github.com/ss220-space/Paradise/blob/16af5c1b9cb1756214627b943b032456f1adc7ff/code/modules/movespeed/_movespeed_modifier.dm

user.Move(newloc,Dir=0,step_x=5,step_y=0)

Check failure on line 133 in code/game/objects/items/weapons/weaponry.dm

View workflow job for this annotation

GitHub Actions / Run Linters

bad keyword argument "step_y" to /mob/living/proc/Move

Check failure on line 133 in code/game/objects/items/weapons/weaponry.dm

View workflow job for this annotation

GitHub Actions / Run Linters

bad keyword argument "step_x" to /mob/living/proc/Move

Check failure on line 133 in code/game/objects/items/weapons/weaponry.dm

View workflow job for this annotation

GitHub Actions / Run Linters

bad keyword argument "Dir" to /mob/living/proc/Move
user.emote("scream")

/obj/item/melee/katana/Bump(atom/bumped)
var/obj/item/organ/external/head/head = target.get_organ(BODY_ZONE_HEAD)
if(!charge())
return
if(isliving(bumped))
if(ismegafauna(bumped))
return
target = bumped
head.droplimb()
add_attack_logs(user, target, "beheaded with [src]")
target.regenerate_icons()
if(!HAS_TRAIT(user, TRAIT_FLOORED))
user.Weaken(3 SECONDS)

/obj/item/melee/katana/basalt
name = "basalt katana"
desc = "a katana made out of hardened basalt. Particularly damaging to lavaland fauna."
Expand Down
Loading