Files
Bubberstation/code/datums/components/damage_aura.dm
carlarctg 4eaa299c0b Cult Vs. Heretic: 7 Months Later Edition (#82877)
## About The Pull Request

This PR was originally meant as a replacement for the Bloody Bastard
blade, but then I stopped existing for 7 months. Now that I'm here
again, I'm finishing the job once and for all.

### **HERETICS VERSUS CULTISTS**

### Heretics

Heretics can now sacrifice cultists, which will give them one of three
gifts: The Cursed Blade, the Crimson Focus, and the Rusted Harvester.
The gifts given are weighted to be spread out equally with each type.
They will also gain one knowledge point.

- The Cursed Blade is a free heretic blade that is more powerful than
the normal heretic blade, including a small block chance. It can also be
used to draw heretic runes off combat mode.
- The Crimson Focus is a necklace that grants focusing and a minor
regeneration effect which also affects nearby heretics, at the cost of
gaining the BLOODY_MESS trait while wearing it. Additionally, it can be
squeezed to heal 50 points of brute/burn damage, injecting yourself with
three to six (separately) units of Eldritch ~~Water~~ Essence and Unholy
Water. Yes, this isn't good.
- The Rusted Harvester is a heretic 'monster' summon. It's a normal
Harvester, but instead of Area Conversion and Forcewall, it has
Aggressive Spread and Rust Construction (Raise Wall). It can delimb, but
only cultists, with a delay. It has an aura of decay, corroding the
environment and withering enemies near it, but it's VERY fragile.

Rusting cultist item dispensers will now cause them to turn into a
Heretic object. Altars turn into small heretic runes, Archives turn into
Codex Cicatrixi, Forges turn into Mawed Crucibles.

Ideally, Heretics would be able to gain an amount of these new powers
and use them to turn the tide against the cultists, amassing their power
and almost forming a sect of their own in turn which sweeps over and
converts the cult.

### Cultists

When a Cultist sacrifices a heretic, two things will happen:

- A new item will be available for creation at one of the dispensers.
- The Heretic will be trapped inside a powerful Haunted Blade.

`/obj/item/melee/cultblade/haunted`
`	name = "haunted longsword"`
` desc = "An eerie sword with a blade that is less 'black' than it is
'absolute nothingness'. It glows with furious, restrained green
energy."`

This blade will be stronger across-the-board than a normal cult sword,
and will even allow those who wield it to cast one heretic spell from
their previous path. The only downside? The heretic can also cast one
spell. It's up to the trapped spirit if it wants to help you, or be a
nuisance.

The unlocked items are:
- The Cursed Blade, again. For cultists, it can be used to draw runes
twice as fast as usual, and they can even right-click it to teleport to
safety, just like a heretic!
- The Crimson Focus, again. Cultists are twice as fast at carving spells
into their body, and they gain a 5th spellslot as long as they wear the
amulet. It still causes hemophilia and grants weak regeneration.
- The Proteon Orb. This orb will create a gateway to Nar'sie's own
realm, spawning one Proteon every 15 seconds, which ghosts can possess.
The gateways cannot be placed close to one another.

Originally, they were going to be able to create a Harvester Shell, but
there were some concerns of it being too OP.

The true Bastard sword has been fully deleted. The null rod conversion
has been changed to a Bloody Halberd instead.

I'm considering re-enabling Stun Hand on Heretics, with Mansus Grasp
stats.

### Other

All the items above can be used by both Heretics and Cultists, no matter
how they were first created. Hell, even normal crew can use them! This
is probably not the best idea a lot of the time, though.

There are a lot of other changes in this PR. A loooooot. I will likely
miss some in the changelog, but I'll try to be as thorough as possible.
There's probably also some leftover garbo that I didn't find and clear
out yet.

## Why It's Good For The Game

Cult and Heretics, despite being mortally opposed, have very few
interactions with eachother, especially now that the Blade's gone. The
only thing of note is just the Heretic's unfair complete resistance to
stun hand, which is only marginally better than the alternative. This PR
will reintroduce their animosity, and give both sides a very, very good
reason to fight eachother.

The Cult will gain a sick sword that keeps the heretic in the game, and
unlike with the original implementation, will recieve a cult-wide bonus
in the form of a powerful, well deserved, and fun new item to summon.

The Heretic will gain powerful trinkets and knowledge from the
sacrifices, incentivizing them to become a terrifying cult-hunter. And
if they do succeed in wiping out the cult, they will have quite the
rewards to help with their ascension.

The crew, while mostly unaffected, will have a damn good reason to not
just Side with the heretic, out of fear of what they may become after
the cult is stomped down. They can also use a few of the items here in
an attempt to get one up on either side, as long as they manage to stay
clear of the side-effects.

Let the heretics eradicate the apostates.

Let the cultists root out the heathens.

![image](https://github.com/tgstation/tgstation/assets/53100513/b43d5d94-d06d-43b8-9b10-57f5a4a32bdb)
The haunted longsword creates an aura of darkness (disabled for the
cultist for the image)
Sprites... are not great. Hopefully someone comes by and improves them.

code: Added get_inactive_hand() as an easy shortcut for carbons
code: Wall walker element can now accept a trait for wall-checking
fix: Fixed soulsword component being unable to invoke the post summon
callback
refactor: Turned Heretic rust turf healing into an element, given to
Rust Walkers and Rusted Harvesters
refactor: Converted Limb Amputation from an element to a component

Blade and Sword sprites by meyhaza!!! I did the inhands though. Cuz im
cool
2024-06-29 12:40:33 -05:00

160 lines
5.4 KiB
Plaintext

#define DAMAGE_EFFECT_COOLDOWN (1 SECONDS)
/// Applies a status effect and deals damage to people in the area.
/// Will deal more damage the more people are present.
/datum/component/damage_aura
/// The range of which to damage
var/range = 5
/// Whether or not you must be a visible object of the parent
var/requires_visibility = TRUE
/// Brute damage to damage over a second
var/brute_damage = 0
/// Burn damage to damage over a second
var/burn_damage = 0
/// Toxin damage to damage over a second
var/toxin_damage = 0
/// Suffocation damage to damage over a second
var/suffocation_damage = 0
/// Stamina damage to damage over a second
var/stamina_damage = 0
/// Amount of blood to damage over a second
var/blood_damage = 0
/// Map of organ (such as ORGAN_SLOT_BRAIN) to damage damage over a second
var/list/organ_damage = null
/// Amount of damage to damage on simple mobs over a second
var/simple_damage = 0
/// Which factions are immune to the damage aura
var/list/immune_factions = null
/// If set, gives a message when damaged
var/damage_message = null
/// Probability for above.
var/message_probability = 0
/// Sets a special set of conditions for the owner
var/datum/weakref/current_owner = null
/// Declares the cooldown timer for the damage aura effect to take place
COOLDOWN_DECLARE(last_damage_effect_time)
/datum/component/damage_aura/Initialize(
range = 5,
requires_visibility = TRUE,
brute_damage = 0,
burn_damage = 0,
toxin_damage = 0,
suffocation_damage = 0,
stamina_damage = 0,
blood_damage = 0,
organ_damage = null,
simple_damage = 0,
immune_factions = null,
damage_message = null,
message_probability = 0,
mob/living/current_owner = null,
)
if (!isatom(parent))
return COMPONENT_INCOMPATIBLE
START_PROCESSING(SSaura, src)
src.range = range
src.requires_visibility = requires_visibility
src.brute_damage = brute_damage
src.burn_damage = burn_damage
src.toxin_damage = toxin_damage
src.suffocation_damage = suffocation_damage
src.stamina_damage = stamina_damage
src.blood_damage = blood_damage
src.organ_damage = organ_damage
src.simple_damage = simple_damage
src.immune_factions = immune_factions
src.damage_message = damage_message
src.message_probability = message_probability
src.current_owner = WEAKREF(current_owner)
/datum/component/damage_aura/Destroy(force)
STOP_PROCESSING(SSaura, src)
return ..()
/// The requirements for the mob to be effected by the damage aura.
/datum/component/damage_aura/proc/check_requirements(mob/living/target_mob)
if(target_mob.stat == DEAD || faction_check(target_mob.faction, immune_factions))
return TRUE
return FALSE
/// What effect the damage aura has if it has an owner.
/datum/component/damage_aura/proc/owner_effect(mob/living/owner_mob, seconds_per_tick)
var/need_mob_update = FALSE
need_mob_update += owner_mob.adjustStaminaLoss(-20 * seconds_per_tick, updating_stamina = FALSE)
need_mob_update += owner_mob.adjustBruteLoss(-1 * seconds_per_tick, updating_health = FALSE)
need_mob_update += owner_mob.adjustFireLoss(-1 * seconds_per_tick, updating_health = FALSE)
need_mob_update += owner_mob.adjustToxLoss(-1 * seconds_per_tick, updating_health = FALSE, forced = TRUE)
need_mob_update += owner_mob.adjustOxyLoss(-1 * seconds_per_tick, updating_health = FALSE)
if (owner_mob.blood_volume < BLOOD_VOLUME_NORMAL)
owner_mob.blood_volume += 2 * seconds_per_tick
if(need_mob_update)
owner_mob.updatehealth()
/datum/component/damage_aura/process(seconds_per_tick)
var/should_show_effect = COOLDOWN_FINISHED(src, last_damage_effect_time)
if (should_show_effect)
COOLDOWN_START(src, last_damage_effect_time, DAMAGE_EFFECT_COOLDOWN)
var/list/to_damage = list()
if(requires_visibility)
for(var/mob/living/candidate in view(range, parent))
to_damage += candidate
else
for(var/mob/living/candidate in range(range, parent))
to_damage += candidate
for (var/mob/living/candidate as anything in to_damage)
var/mob/living/owner = current_owner?.resolve()
if (owner && owner == candidate)
owner_effect(owner, seconds_per_tick)
continue
if (check_requirements(candidate))
continue
if (candidate.health < candidate.maxHealth)
new /obj/effect/temp_visual/cosmic_gem(get_turf(candidate))
if(damage_message && prob(message_probability))
to_chat(candidate, damage_message)
if (iscarbon(candidate) || issilicon(candidate) || isbasicmob(candidate))
candidate.adjustBruteLoss(brute_damage * seconds_per_tick, updating_health = FALSE)
candidate.adjustFireLoss(burn_damage * seconds_per_tick, updating_health = FALSE)
if (iscarbon(candidate))
candidate.adjustToxLoss(toxin_damage * seconds_per_tick, updating_health = FALSE)
candidate.adjustOxyLoss(suffocation_damage * seconds_per_tick, updating_health = FALSE)
candidate.adjustStaminaLoss(stamina_damage * seconds_per_tick, updating_stamina = FALSE)
for (var/organ in organ_damage)
candidate.adjustOrganLoss(organ, organ_damage[organ] * seconds_per_tick)
else if (isanimal(candidate))
var/mob/living/simple_animal/animal_candidate = candidate
animal_candidate.adjustHealth(simple_damage * seconds_per_tick, updating_health = FALSE)
else if (isbasicmob(candidate))
var/mob/living/basic/basic_candidate = candidate
basic_candidate.adjust_health(simple_damage * seconds_per_tick, updating_health = FALSE)
if (candidate.blood_volume > BLOOD_VOLUME_SURVIVE)
candidate.blood_volume -= blood_damage * seconds_per_tick
candidate.updatehealth()
#undef DAMAGE_EFFECT_COOLDOWN