mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-31 20:11:56 +00:00
## About The Pull Request Assistants get a new liver trait, maintenance metabolism. This trait only lets them process maintenance drugs, grey bull, and pump-up for 20% more time and gives them a probably-positive 2 minute moodlet when ingesting these. The officer's sabre has gained a small amount of bloodthrist for assistants! Fixed liver masters being unable to inspect the liver of scientists. ## Why It's Good For The Game > Assistants get a new liver trait, maintenance metabolism. This trait only lets them process maintenance drugs, grey bull, and pump-up for 20% more time and gives them a probably-positive 2 minute moodlet when ingesting these. This trait is pretty much entirely here for the actual liver-identification of assistants the sabre uses, though I didn't want to just add an empty trait so I gave it the above effects as pretty damn harmless effects. I'm sure the maints will dislike even this so I'm open to anything. > The officer's sabre has gained a small amount of bloodthirst for assistants! Or at least their livers. I find the concept of the sabre having a bane against assistants amusing, and it wouldn't hurt to give them something that may help against tiders. As a smidgen of fairness, the detection is tied to the liver - if they want to take less damage they can have it replaced, though the captain can also help with that by disemboweling organs. The liver being used for something that isn't reagents processing might be a bit controversial, but like I said, I'd rather have that than have it permanently, intrinsically tied to a job. > Fixed liver masters being unable to inspect the liver of scientists. Ballmer metabolism quacks like a duck, traits like a duck, and thus should be able to be duck inspected by the duck master, since there is no practical difference between it and other 'official' metabolisms. ## Changelog 🆑 add: Assistants get a new liver trait, maintenance metabolism. This trait only lets them process maintenance drugs, grey bull, and pump-up for 20% more time and gives them a probably-positive 2 minute moodlet when ingesting these. add: The officer's sabre has gained a small amount of bloodthrist for assistants! fix: Fixed liver masters being unable to inspect the liver of scientists. /🆑 --------- Co-authored-by: san7890 <the@san7890.com>
94 lines
3.8 KiB
Plaintext
94 lines
3.8 KiB
Plaintext
/// Deals extra damage to mobs of a certain type, species, or biotype.
|
|
/// This doesn't directly modify the normal damage of the weapon, instead it applies it's own damage seperatedly ON TOP of normal damage
|
|
/// ie. a sword that does 10 damage with a bane elment attacthed that has a 0.5 damage_multiplier will do:
|
|
/// 10 damage from the swords normal attack + 5 damage (50%) from the bane element
|
|
/datum/element/bane
|
|
element_flags = ELEMENT_BESPOKE
|
|
argument_hash_start_idx = 2
|
|
/// can be a mob or a species.
|
|
var/target_type
|
|
/// multiplier of the extra damage based on the force of the item.
|
|
var/damage_multiplier
|
|
/// Added after the above.
|
|
var/added_damage
|
|
/// If it requires combat mode on to deal the extra damage or not.
|
|
var/requires_combat_mode
|
|
/// if we want it to only affect a certain mob biotype
|
|
var/mob_biotypes
|
|
|
|
/datum/element/bane/Attach(datum/target, target_type = /mob/living, mob_biotypes = NONE, damage_multiplier=1, added_damage = 0, requires_combat_mode = TRUE)
|
|
. = ..()
|
|
|
|
if(!ispath(target_type, /mob/living) && !ispath(target_type, /datum/species))
|
|
return ELEMENT_INCOMPATIBLE
|
|
|
|
src.target_type = target_type
|
|
src.damage_multiplier = damage_multiplier
|
|
src.added_damage = added_damage
|
|
src.requires_combat_mode = requires_combat_mode
|
|
src.mob_biotypes = mob_biotypes
|
|
target.AddComponent(/datum/component/on_hit_effect, CALLBACK(src, PROC_REF(do_bane)), CALLBACK(src, PROC_REF(check_bane)))
|
|
|
|
/datum/element/bane/Detach(datum/target)
|
|
qdel(target.GetComponent(/datum/component/on_hit_effect))
|
|
return ..()
|
|
|
|
/datum/element/bane/proc/check_bane(bane_applier, target, bane_weapon)
|
|
if(!check_biotype_path(bane_applier, target))
|
|
return
|
|
var/atom/movable/atom_owner = bane_weapon
|
|
if(SEND_SIGNAL(atom_owner, COMSIG_OBJECT_PRE_BANING, target) & COMPONENT_CANCEL_BANING)
|
|
return
|
|
return TRUE
|
|
|
|
/**
|
|
* Checks typepaths and the mob's biotype, returning TRUE if correct and FALSE if wrong.
|
|
* Additionally checks if combat mode is required, and if so whether it's enabled or not.
|
|
*/
|
|
/datum/element/bane/proc/check_biotype_path(mob/living/bane_applier, atom/target)
|
|
if(!isliving(target))
|
|
return FALSE
|
|
var/mob/living/living_target = target
|
|
if(bane_applier)
|
|
if(requires_combat_mode && !bane_applier.combat_mode)
|
|
return FALSE
|
|
var/is_correct_biotype = living_target.mob_biotypes & mob_biotypes
|
|
if(mob_biotypes && !(is_correct_biotype))
|
|
return FALSE
|
|
if(ispath(target_type, /mob/living))
|
|
return istype(living_target, target_type)
|
|
else //species type
|
|
return is_species(living_target, target_type)
|
|
|
|
/datum/element/bane/proc/do_bane(datum/element_owner, mob/living/bane_applier, mob/living/baned_target, hit_zone)
|
|
var/force_boosted
|
|
var/applied_dam_type
|
|
|
|
if(isitem(element_owner))
|
|
var/obj/item/item_owner = element_owner
|
|
force_boosted = item_owner.force
|
|
applied_dam_type = item_owner.damtype
|
|
else if(isprojectile(element_owner))
|
|
var/obj/projectile/projectile_owner = element_owner
|
|
force_boosted = projectile_owner.damage
|
|
applied_dam_type = projectile_owner.damage_type
|
|
else if (isliving(element_owner))
|
|
var/mob/living/living_owner = element_owner
|
|
force_boosted = (living_owner.melee_damage_lower + living_owner.melee_damage_upper) / 2
|
|
//commence crying. yes, these really are the same check. FUCK.
|
|
if(isbasicmob(living_owner))
|
|
var/mob/living/basic/basic_owner = living_owner
|
|
applied_dam_type = basic_owner.melee_damage_type
|
|
else if(isanimal(living_owner))
|
|
var/mob/living/simple_animal/simple_owner = living_owner
|
|
applied_dam_type = simple_owner.melee_damage_type
|
|
else
|
|
return
|
|
else
|
|
return
|
|
|
|
var/extra_damage = max(0, (force_boosted * damage_multiplier) + added_damage)
|
|
baned_target.apply_damage(extra_damage, applied_dam_type, hit_zone)
|
|
SEND_SIGNAL(baned_target, COMSIG_LIVING_BANED, bane_applier, baned_target) // for extra effects when baned.
|
|
SEND_SIGNAL(element_owner, COMSIG_OBJECT_ON_BANING, baned_target)
|