Energy Katana Teleport Attack (and misc. tweaks) (#91825)

## About The Pull Request

1. The Energy Katana, when clicking on a mob, no longer refuses to
teleport. It will instead teleport you adjacent to the mob (to the tile
closest to your origin) and immediately perform an attack.

2. Energy Katana is now a bit more consistent about what you can and
cannot teleport to, now abiding by the same rules as the heirophant
staff - you can teleport onto tables, but you can't teleport into dense
objects by clicking on the tile instead of the object.

3. The Energy Katana now has `NEEDS_PERMIT` flag, like the Energy Sword,
meaning Beepsky will consider it a threat (but it won't hunt down Ninjas
over it)

Also added pass_flags_self bitfield and updated pass_flags bitfield.

## Why It's Good For The Game

I ran around with it for like 3 seconds and found it a little clunky. So
I just cleaned it up a bit to make it 1. easier to use 2. cooler to use

The permit thing was just making it consistent with other melee weapons

## Changelog

🆑 Melbert
qol: Energy Katana is now a bit more consistent about what you can and
cannot teleport to, now abiding by the same rules as the heirophant
staff. IE, you can now teleport onto tables.
add: Energy Katana now has a "teleport attack" - if you click on a mob,
you will teleport adjacent to them and immediately perform an attack!
add: Energy Katana is now considered a threatening weapon by secbots.
Ninjas will be unaffected, but if you loot one off a dead ninja and
don't have a weapons permit, it might chase after you.
/🆑
This commit is contained in:
MrMelbert
2025-07-01 14:29:48 +01:00
committed by GitHub
parent 6c8395f38f
commit aae6dbb6db
4 changed files with 43 additions and 8 deletions
+23
View File
@@ -337,13 +337,36 @@ DEFINE_BITFIELD(obj_flags, list(
))
DEFINE_BITFIELD(pass_flags, list(
"PASSBLOB" = PASSBLOB,
"PASSCLOSEDTURF" = PASSCLOSEDTURF,
"PASSDOORS" = PASSDOORS,
"PASSFLAPS" = PASSFLAPS,
"PASSGLASS" = PASSGLASS,
"PASSGRILLE" = PASSGRILLE,
"PASSITEM" = PASSITEM,
"PASSMACHINE" = PASSMACHINE,
"PASSMOB" = PASSMOB,
"PASSSTRUCTURE" = PASSSTRUCTURE,
"PASSTABLE" = PASSTABLE,
"PASSVEHICLE" = PASSVEHICLE,
"PASSWINDOW" = PASSWINDOW,
))
DEFINE_BITFIELD(pass_flags_self, list(
"LETPASSCLICKS" = LETPASSCLICKS,
"LETPASSTHROW" = LETPASSTHROW,
"PASSBLOB" = PASSBLOB,
"PASSCLOSEDTURF" = PASSCLOSEDTURF,
"PASSDOORS" = PASSDOORS,
"PASSFLAPS" = PASSFLAPS,
"PASSGLASS" = PASSGLASS,
"PASSGRILLE" = PASSGRILLE,
"PASSITEM" = PASSITEM,
"PASSMACHINE" = PASSMACHINE,
"PASSMOB" = PASSMOB,
"PASSSTRUCTURE" = PASSSTRUCTURE,
"PASSTABLE" = PASSTABLE,
"PASSVEHICLE" = PASSVEHICLE,
"PASSWINDOW" = PASSWINDOW,
))
+3 -1
View File
@@ -50,7 +50,9 @@
if(!(target in view(user.client.view, user)))
user.balloon_alert(user, "out of view!")
return FALSE
if(target_turf.is_blocked_turf_ignore_climbable())
user.balloon_alert(user, "destination blocked!")
return FALSE
if(!do_teleport(user, target_turf, no_effects = TRUE))
user.balloon_alert(user, "dash blocked!")
return FALSE
@@ -35,6 +35,7 @@
sharpness = SHARP_EDGED
max_integrity = 200
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
item_flags = NEEDS_PERMIT
var/datum/effect_system/spark_spread/spark_system
var/datum/action/innate/dash/ninja/jaunt
@@ -46,8 +47,10 @@
spark_system.attach(src)
/obj/item/energy_katana/ranged_interact_with_atom_secondary(atom/interacting_with, mob/living/user, list/modifiers)
if(!interacting_with.density)
jaunt?.teleport(user, interacting_with)
if(isliving(interacting_with))
jaunt.attack_teleport(user, interacting_with)
return ITEM_INTERACT_SUCCESS
if(jaunt.teleport(user, interacting_with))
return ITEM_INTERACT_SUCCESS
return NONE
@@ -78,3 +81,15 @@
/datum/action/innate/dash/ninja/HideFrom(mob/viewer)
return
/// Teleports to a tile adjacent to a mob, then attacks it
/datum/action/innate/dash/ninja/proc/attack_teleport(mob/living/user, mob/living/stabbing)
var/list/turf/line = get_line(user, stabbing)
var/obj/item/sword = target
if(length(line) <= 1 || !teleport(user, line[length(line) - 1])) // teleports to the second last turf, should be adjacent to the target
return
if(!user.CanReach(stabbing, target))
return
sword.melee_attack_chain(user, stabbing)
if(prob(5) && check_holidays(APRIL_FOOLS))
user.say("Heh, nothin' personnel kid!", forced = "*teleports behind you**")
@@ -243,11 +243,6 @@
user.balloon_alert(user, "destination out of range!")
return FALSE
var/turf/target_turf = get_turf(target)
if(target_turf.is_blocked_turf_ignore_climbable())
user.balloon_alert(user, "destination blocked!")
return FALSE
. = ..()
var/obj/item/hierophant_club/club = target