Bane refactor (now uses damage multipliers) (#96003)

This commit is contained in:
MrMelbert
2026-05-15 20:41:29 -05:00
committed by GitHub
parent 15f771dd11
commit ea0859d5fe
26 changed files with 287 additions and 203 deletions
@@ -41,4 +41,4 @@
/obj/item/storage/toolbox/medical/coroner/Initialize(mapload)
. = ..()
AddElement(/datum/element/bane, mob_biotypes = MOB_UNDEAD, damage_multiplier = 1) //Just in case one of the tennants get uppity
AddComponent(/datum/component/bane, affected_biotypes = MOB_UNDEAD, damage_multiplier = 2) //Just in case one of the tennants get uppity
+12 -1
View File
@@ -488,7 +488,18 @@
/obj/effect/decal/cleanable/ants,
/obj/item/queen_bee,
))
AddElement(/datum/element/bane, mob_biotypes = MOB_BUG, target_type = /mob/living/basic, damage_multiplier = 0, added_damage = 24, requires_combat_mode = FALSE)
AddComponent(/datum/component/bane, affected_biotypes = MOB_BUG, pre_bane_callback = CALLBACK(src, PROC_REF(bane_check)) )
// Different type of bug mobs get different amounts of damage multipliers
/obj/item/melee/flyswatter/proc/bane_check(mob/living/target, mob/living/attacker, list/attack_modifiers)
if(isanimal_or_basicmob(target))
MODIFY_ATTACK_FORCE(attack_modifiers, 24)
else if(isflyperson(target))
MODIFY_ATTACK_FORCE(attack_modifiers, 29)
else if(ismoth(target))
MODIFY_ATTACK_FORCE(attack_modifiers, 9)
else // ?? Whatever
MODIFY_ATTACK_FORCE(attack_modifiers, 14)
/obj/item/melee/flyswatter/afterattack(atom/target, mob/user, list/modifiers, list/attack_modifiers)
if(is_type_in_typecache(target, splattable))
+16 -22
View File
@@ -34,29 +34,23 @@
bonus_modifier = 5, \
)
// The weight of authority comes down on the tider's crimes.
AddElement(/datum/element/bane, target_type = /mob/living/carbon/human, damage_multiplier = 0.35)
RegisterSignal(src, COMSIG_OBJECT_PRE_BANING, PROC_REF(attempt_bane))
RegisterSignal(src, COMSIG_OBJECT_ON_BANING, PROC_REF(bane_effects))
/**
* If the target reeks of maintenance, the blade can tear through their body with a total of 20 damage.
*/
/obj/item/melee/sabre/proc/attempt_bane(element_owner, mob/living/carbon/criminal)
SIGNAL_HANDLER
var/obj/item/organ/liver/liver = criminal.get_organ_slot(ORGAN_SLOT_LIVER)
if(isnull(liver) || !HAS_TRAIT(liver, TRAIT_MAINTENANCE_METABOLISM))
return COMPONENT_CANCEL_BANING
/**
* Assistants should fear this weapon.
*/
/obj/item/melee/sabre/proc/bane_effects(element_owner, mob/living/carbon/human/baned_target)
SIGNAL_HANDLER
baned_target.visible_message(
span_warning("[src] tears through [baned_target] with unnatural ease!"),
span_userdanger("As [src] tears into your body, you feel the weight of authority collapse into your wounds!"),
AddComponent(/datum/component/bane, \
damage_multiplier = 1.35, \
should_bane_callback = CALLBACK(src, PROC_REF(bane_check)), \
on_bane_callback = CALLBACK(src, PROC_REF(bane_message)), \
label_text = "assistants", \
)
INVOKE_ASYNC(baned_target, TYPE_PROC_REF(/mob/living/carbon/human, emote), "scream")
/obj/item/melee/sabre/proc/bane_check(mob/living/target)
var/obj/item/organ/liver/liver = target.get_organ_slot(ORGAN_SLOT_LIVER)
return !isnull(liver) && HAS_TRAIT(liver, TRAIT_MAINTENANCE_METABOLISM)
/obj/item/melee/sabre/proc/bane_message(mob/living/target, mob/living/attacker)
target.visible_message(
span_warning("[src] tears through [target] with unnatural ease!"),
span_boldwarning("As [src] tears into your body, you feel the weight of authority collapse into your wounds!"),
)
INVOKE_ASYNC(target, TYPE_PROC_REF(/mob, emote), "scream")
/obj/item/melee/sabre/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE)
if(attack_type == PROJECTILE_ATTACK || attack_type == LEAP_ATTACK || attack_type == OVERWHELMING_ATTACK)
@@ -38,7 +38,7 @@
RegisterSignal(soul, COMSIG_MOB_ATTACK_RANGED, PROC_REF(on_attack))
RegisterSignal(soul, COMSIG_MOB_ATTACK_RANGED_SECONDARY, PROC_REF(on_secondary_attack))
RegisterSignal(src, COMSIG_ATOM_INTEGRITY_CHANGED, PROC_REF(on_integrity_change))
AddElement(/datum/element/bane, mob_biotypes = MOB_PLANT, damage_multiplier = 0.5, requires_combat_mode = FALSE)
AddComponent(/datum/component/bane, affected_biotypes = MOB_PLANT, damage_multiplier = 1.5)
/obj/item/soulscythe/examine(mob/user)
. = ..()
@@ -462,7 +462,7 @@
/obj/item/spear/dragonator/Initialize(mapload)
. = ..()
AddElement(/datum/element/bane, mob_biotypes = MOB_MINING, damage_multiplier = 0, added_damage = 80, requires_combat_mode = FALSE) //For killing really big monsters.
AddComponent(/datum/component/bane, affected_biotypes = MOB_MINING, added_damage = 80) //For killing really big monsters.
/*
* Untreated Giantslayer , needs to be thrown into lava