Gives non-standard nullrods the rest of the features common to regular null rods (#94980)

## About The Pull Request

Non-standard null-rods (the skateboard, bow, revolver, carpsie plush,
and eswords) did not receive all the common characteristics of regular
null rods in #93394. In particular, they were not given the
`UNIQUE_RENAME` obj flag, and they did not receive the ability to track
how many cultists they've crit/killed and be turned into cult weapons
when sacrificed. This PR corrects that by extracting the cult kill
tracking behavior to a component, while doing the following refactors to
ensure complete compatibility:

- Skateboard items now move themselves into the skateboard vehicle they
spawn on use, instead of deleting themselves. This was necessary for the
holy board to keep its custom name/desc and cultist kill count.
- Guns (which the bow technically is) will track cultists killed/crit
with bullets fired from them by a mob with a holy role.
- A signal can now be used for an item to provide an arbitrary response
when an offer rune underneath it is activated.

## Why It's Good For The Game

I just wanted the holy eswords to be renameable for chaplains to provide
plausible deniability for the possession of actual eswords, but after I
discovered this consistency issue, and felt the need to fix it.

## Changelog

🆑
fix: The holy energy swords and the carp-sie plushie can once again be
renamed
fix: The holy energy swords and the carp-sie plushie can once again be
sacrificed by cultists to spawn different weapons based on how many
unique cultists the chaplain has crit or killed with them
qol: The holy skateboard can be renamed like other null rod variants can
fix: Unusual null rod variants like the holy skateboard and bow can now
be sacrificed by cultists to spawn different weapons based on how many
unique cultists the chaplain has crit or killed with them. The bow and
the burdened chaplain's revolver, in particular, also count cultists
crit or killed by arrows/bullets fired from them by the chaplain.
/🆑
This commit is contained in:
Y0SH1M4S73R
2026-02-03 22:23:20 -05:00
committed by GitHub
parent f58b8511f0
commit 6f37db300b
12 changed files with 138 additions and 88 deletions
+23 -42
View File
@@ -242,7 +242,7 @@ structure_check() searches for nearby cultist structures required for the invoca
if(!IS_CULTIST(non_cultist))
myriad_targets += non_cultist
if(!length(myriad_targets) && !try_spawn_sword())
if(!length(myriad_targets) && !try_sacrifice_item())
fail_invoke()
return
@@ -400,57 +400,38 @@ structure_check() searches for nearby cultist structures required for the invoca
sacrificial.investigate_log("has been sacrificially gibbed by the cult.", INVESTIGATE_DEATHS)
sacrificial.gib(DROP_ALL_REMAINS)
try_spawn_sword() // after sharding and gibbing, which potentially dropped a null rod
try_sacrifice_item() // after sharding and gibbing, which potentially dropped a sacrificable item
return TRUE
/// Tries to convert a null rod over the rune to a cult sword
/obj/effect/rune/convert/proc/try_spawn_sword()
for(var/obj/item/potential_rod in loc)
if(!HAS_TRAIT(potential_rod, TRAIT_NULLROD_ITEM))
/// Tries to convert a valid item over the rune to something else
/obj/effect/rune/convert/proc/try_sacrifice_item()
for(var/obj/item/checked_item in loc)
if(checked_item.anchored || (checked_item.resistance_flags & INDESTRUCTIBLE))
continue
if(potential_rod.anchored || (potential_rod.resistance_flags & INDESTRUCTIBLE))
continue
var/num_slain = 0
if (istype(potential_rod, /obj/item/nullrod))
var/obj/item/nullrod/actual_rod = potential_rod
num_slain = LAZYLEN(actual_rod.cultists_slain)
var/displayed_message = "[potential_rod] glows an unholy red and begins to transform..."
if(num_slain && GET_ATOM_BLOOD_DNA_LENGTH(potential_rod))
displayed_message += " The blood of [num_slain] fallen cultist[num_slain == 1 ? "":"s"] is absorbed into [potential_rod]!"
potential_rod.visible_message(span_cult_italic(displayed_message))
switch(num_slain)
if(0)
animate_spawn_sword(potential_rod, /obj/item/melee/cultblade/dagger)
if(1)
animate_spawn_sword(potential_rod, /obj/item/melee/cultblade)
else
animate_spawn_sword(potential_rod, /obj/item/melee/cultblade/halberd)
return TRUE
if(SEND_SIGNAL(checked_item, COMSIG_ITEM_CULT_SACRIFICE, src) & COMPONENT_SACRIFICE_SUCCESSFUL)
return TRUE
return FALSE
/// Does an animation of a null rod transforming into a cult sword
/obj/effect/rune/convert/proc/animate_spawn_sword(obj/item/former_rod, new_blade_typepath)
/// Does an animation of a sacrificable item transforming into something else
/obj/effect/rune/convert/proc/animate_convert_item(obj/item/old_item, new_movable_typepath)
playsound(src, 'sound/effects/magic.ogg', 33, vary = TRUE, extrarange = SILENCED_SOUND_EXTRARANGE, frequency = 0.66)
former_rod.anchored = TRUE
former_rod.Shake()
animate(former_rod, alpha = 0, transform = matrix(former_rod.transform).Scale(0.01), time = 2 SECONDS, easing = BOUNCE_EASING, flags = ANIMATION_PARALLEL)
QDEL_IN(former_rod, 2 SECONDS)
old_item.anchored = TRUE
old_item.Shake()
animate(old_item, alpha = 0, transform = matrix(old_item.transform).Scale(0.01), time = 2 SECONDS, easing = BOUNCE_EASING, flags = ANIMATION_PARALLEL)
QDEL_IN(old_item, 2 SECONDS)
var/obj/item/new_blade = new new_blade_typepath(loc)
var/matrix/blade_matrix_on_spawn = matrix(new_blade.transform)
new_blade.name = "converted [new_blade.name]"
new_blade.anchored = TRUE
new_blade.alpha = 0
new_blade.transform = matrix(new_blade.transform).Scale(0.01)
new_blade.Shake()
animate(new_blade, alpha = 255, transform = blade_matrix_on_spawn, time = 2 SECONDS, easing = BOUNCE_EASING, flags = ANIMATION_PARALLEL)
addtimer(VARSET_CALLBACK(new_blade, anchored, FALSE), 2 SECONDS)
var/atom/movable/new_movable = new new_movable_typepath(loc)
var/matrix/matrix_on_spawn = matrix(new_movable.transform)
new_movable.name = "converted [new_movable.name]"
new_movable.anchored = TRUE
new_movable.alpha = 0
new_movable.transform = matrix(new_movable.transform).Scale(0.01)
new_movable.Shake()
animate(new_movable, alpha = 255, transform = matrix_on_spawn, time = 2 SECONDS, easing = BOUNCE_EASING, flags = ANIMATION_PARALLEL)
addtimer(VARSET_CALLBACK(new_movable, anchored, FALSE), 2 SECONDS)
/obj/effect/rune/empower
cultist_name = "Empower"