mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-18 18:47:53 +01:00
## 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. /🆑
40 lines
1.9 KiB
Plaintext
40 lines
1.9 KiB
Plaintext
///Proxy element that attaches components, elements and traits that are common to more or less all nullrods.
|
|
/datum/element/nullrod_core
|
|
|
|
/**
|
|
* Called when the element is added to a datum. If the 'chaplain_spawnable' arg is TRUE and unit testing is enabled,
|
|
* we check that the target is actually in the nullrod_variants global list
|
|
*/
|
|
/datum/element/nullrod_core/Attach(obj/item/target, chaplain_spawnable = TRUE, rune_remove_line = "BEGONE FOUL MAGIKS!!")
|
|
. = ..()
|
|
if(!istype(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
|
|
target.AddComponent(/datum/component/anti_magic, MAGIC_RESISTANCE|MAGIC_RESISTANCE_HOLY)
|
|
target.AddComponent(/datum/component/effect_remover, \
|
|
success_feedback = "You disrupt the magic of %THEEFFECT with %THEWEAPON.", \
|
|
success_forcesay = rune_remove_line, \
|
|
tip_text = "Clear rune", \
|
|
on_clear_callback = CALLBACK(src, PROC_REF(on_cult_rune_removed), target), \
|
|
effects_we_clear = list(/obj/effect/rune, /obj/effect/heretic_rune, /obj/effect/cosmic_rune), \
|
|
)
|
|
target.AddComponent(/datum/component/cult_kill_tracker)
|
|
target.AddElement(/datum/element/bane, mob_biotypes = MOB_SPIRIT, damage_multiplier = 0, added_damage = 25, requires_combat_mode = FALSE)
|
|
ADD_TRAIT(target, TRAIT_NULLROD_ITEM, ELEMENT_TRAIT(type))
|
|
|
|
if(!PERFORM_ALL_TESTS(focus_only/nullrod_variants) || !chaplain_spawnable)
|
|
return
|
|
|
|
if(!GLOB.nullrod_variants[target.type])
|
|
stack_trace("[target.type] is absent from the nullrod_variants global list. Please include it.")
|
|
|
|
/// Callback for effect remover, invoked when a cult rune is cleared
|
|
/datum/element/nullrod_core/proc/on_cult_rune_removed(obj/item/nullrod, obj/effect/target, mob/living/user)
|
|
if(!istype(target, /obj/effect/rune))
|
|
return
|
|
|
|
var/obj/effect/rune/target_rune = target
|
|
if(target_rune.log_when_erased)
|
|
user.log_message("erased [target_rune.cultist_name] rune using [nullrod]", LOG_GAME)
|
|
SSshuttle.shuttle_purchase_requirements_met[SHUTTLE_UNLOCK_NARNAR] = TRUE
|