Files
Bubberstation/code/datums/elements/ranged_armour.dm
Ben10Omintrix 2ecff6862d adds a new fish to lava and plasma rivers (#83146)
## About The Pull Request
this pr adds a new fish to lavaland and icebox, the lavaloop! i noticed
neither has any exclusive fish so im trying to add one of my own. u can
find this fish by using reinforced rods on lava or plasmarivers. this
fish is also lobstrosity's favorite delicacy as you will now often see
AI controlled lobstrosities fishing for it in lava and then eating it.

![fished](https://github.com/tgstation/tgstation/assets/138636438/03cd4095-940d-4cc0-8d1e-2064cae1921d)

because of its body's curvature and razor sharp spikes, this fish can
also be used as a make-shift boomerang weapon against mining mobs,
although it comes with some new mechanics. u can increase the damage it
does to mobs by winding up ur throw. when the bar reaches purple, this
indicates maximum damage. however, if it goes over the purple, it will
react violently and explode your arm off, so you have to time it just
right to get the best damage possible. On icebox, instead of dealing raw
damage, fish will freeze mobs depending on how long you charged ur
throw. charging it for too long will cause the fish to freeze you
instead

https://github.com/tgstation/tgstation/assets/138636438/c8ac3696-3705-45b0-bc43-c5b81d75cb1b

while its nowhere near as effective as using PKA's or crushers, it can
be a useful tool for hermits and ashwalkers.
## Why It's Good For The Game
having lobstrosities fish and hunt for it makes lavaland feel more like
an ecosystem with a food chain. also i think tossing fish at eldritch
horrors is a funny way to fight them

## Changelog
🆑
add: adds a new fish to lava and plasma rivers, the lava loop
/🆑
2024-05-23 01:14:52 -04:00

62 lines
2.6 KiB
Plaintext

/// Reduces or nullifies damage from ranged weaponry with force below a certain value
/datum/element/ranged_armour
element_flags = ELEMENT_BESPOKE
argument_hash_start_idx = 2
/// The minimum force a projectile must have to ignore our armour
var/minimum_projectile_force
/// Projectile damage below the minimum is multiplied by this value
var/below_projectile_multiplier
/// Projectile damage types which work regardless of force
var/list/vulnerable_projectile_types
/// The minimum force a thrown object must have to ignore our armour
var/minimum_thrown_force
/// Message to output if throwing damage is absorbed
var/throw_blocked_message
/datum/element/ranged_armour/Attach(
atom/target,
minimum_projectile_force = 0,
below_projectile_multiplier = 0,
list/vulnerable_projectile_types = list(),
minimum_thrown_force = 0,
throw_blocked_message = "bounces off",
)
. = ..()
if (!isatom(target))
return ELEMENT_INCOMPATIBLE
src.minimum_projectile_force = minimum_projectile_force
src.below_projectile_multiplier = below_projectile_multiplier
src.vulnerable_projectile_types = vulnerable_projectile_types
src.minimum_thrown_force = minimum_thrown_force
src.throw_blocked_message = throw_blocked_message
if (minimum_projectile_force > 0)
RegisterSignal(target, COMSIG_PROJECTILE_PREHIT, PROC_REF(pre_bullet_impact))
if (minimum_thrown_force > 0)
RegisterSignal(target, COMSIG_ATOM_PREHITBY, PROC_REF(pre_thrown_impact))
/datum/element/ranged_armour/Detach(datum/target)
UnregisterSignal(target, list(COMSIG_PROJECTILE_PREHIT, COMSIG_ATOM_PREHITBY))
return ..()
/// Modify or ignore bullet damage based on projectile properties
/datum/element/ranged_armour/proc/pre_bullet_impact(atom/parent, list/signal_args, obj/projectile/bullet)
SIGNAL_HANDLER
if (bullet.damage >= minimum_projectile_force || (bullet.damage_type in vulnerable_projectile_types))
return
if (below_projectile_multiplier == 0)
parent.visible_message(span_danger("[parent] seems unharmed by [bullet]!"))
return PROJECTILE_INTERRUPT_HIT
bullet.damage *= below_projectile_multiplier
parent.visible_message(span_danger("[parent] seems resistant to [bullet]!"))
/// Ignore thrown damage based on projectile properties. There's no elegant way to multiply the damage because throwforce is persistent.
/datum/element/ranged_armour/proc/pre_thrown_impact(atom/parent, obj/item/hit_atom, datum/thrownthing/throwingdatum)
SIGNAL_HANDLER
if (!isitem(hit_atom) || HAS_TRAIT(hit_atom, TRAIT_BYPASS_RANGED_ARMOR))
return
if (hit_atom.throwforce >= minimum_thrown_force)
return
parent.visible_message(span_danger("[hit_atom] [throw_blocked_message] [parent]!"))
return COMSIG_HIT_PREVENTED