Files
Bubberstation/code/modules/mining/lavaland/necropolis_chests.dm
SkyratBot 42d245a4be [MIRROR] Basic Guardians/Holoparasites [MDB IGNORE] (#24921)
* Basic Guardians/Holoparasites (#79473)

## About The Pull Request

Fixes #79485
Fixes #77552

Converts Guardians (aka Holoparasites) into Basic Mobs.
Changes a bunch of their behaviours into actions or components which we
can reuse.
Replaces some verbs it would give to you and hide in the status panel
with action buttons that you may be able to find more quickly.

They _**should**_ work basically like they did before but a bit
smoother. It is not unlikely that I made some changes by accident or
just by changing framework though.

My one creative touch was adding random name suggestions.
The Wizard federation have a convention of naming their arcane spirit
guardians by combining a colour and a major arcana of the tarot. The
Syndicate of course won't truck with any of that mystical claptrap and
for their codenames use the much more sensible construction of a colour
and a gamepiece.

This lets you be randomly assigned such creative names as "Sparkling
Hermit", "Bloody Queen", "Blue World", or "Purple Diamond".
You can of course still ignore this entirely and type "The Brapmaster"
into the box if so desired.

I made _one_ other intentional change, which is to swap to Mothblocks'
nice leash component instead of instantly teleporting guardians back to
you when they are pulled out of the edge of their range. They should now
be "dragged" along behind you until they can't path, at which point they
will teleport. This should make the experience a bit less disorienting,
you have the recall button if you _want_ to instantly catch up.

This is unfortunately a bumper-sized PR because it did not seem
plausible to not do all of it at once, but I can make a project branch
for atomisation if people think this is too much of a pain in the ass to
review.

Other changes:
- Some refactoring to how the charge action works so I could
individually override "what you can hit" and "what happens when you hit"
instead of those being the same proc
- Lightning Guardian damage chain is now a component
- Explosive Guardian explosive trap is now a component
- Added even more arguments to the Healing Touch component to allow it
to heal tox/oxy damage and require a specific click modifier
- Life Link component which implements the Guardian behaviour of using
another mob as your health bar
- Moved some stuff about deciding what guardians look and are described
like into a theming datum
- Added a generic proc which can return whether your mob is meant to
apply some kind of damage multiplier to a certain damage type. It's not
perfect because I couldn't figure out how ot cram limb modifiers in
there, which is where most of it is on carbons. Oh well.
- Riders of vehicles now inherit all movement traits of those vehicles,
so riding a charging holoparasite will let you cross chasms. Also works
if you piggyback someone with wings, probably.

## Changelog

🆑
refactor: Guardians/Powerminers/Holoparasites now use the basic mob
framework. Please report any unexpected changes or behaviour.
qol: The verbs used to communicate with, recall, or banish your Guardian
are now action buttons.
balance: If (as a Guardian) your host moves slightly out of range you
will now be dragged back into range if possible, rather than being
instantly teleported to them.
balance: Protectors now have a shorter leash range rather than a longer
one, in order to more easily take advantage of their ability to drag
their charge out of danger.
balance: Ranged Guardians can now hold down the mouse button to fire
automatically.
balance: People riding vehicles or other mobs now inherit all of their
movement traits, so riding a flying mob (or vehicle, if we have any of
those) will allow you to cross chasms and lava safely.
/🆑

---------

Co-authored-by: san7890 <the@ san7890.com>

* Basic Guardians/Holoparasites

* Modular

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: san7890 <the@ san7890.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-11-11 07:07:34 -05:00

183 lines
5.5 KiB
Plaintext

//The chests dropped by tendrils and megafauna.
/obj/structure/closet/crate/necropolis
name = "necropolis chest"
desc = "It's watching you closely."
icon_state = "necrocrate"
base_icon_state = "necrocrate"
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
can_install_electronics = FALSE
paint_jobs = null
/obj/structure/closet/crate/necropolis/tendril
desc = "It's watching you suspiciously. You need a skeleton key to open it."
integrity_failure = 0 //prevents bust_open from firing
/// var to check if it got opened by a key
var/spawned_loot = FALSE
/obj/structure/closet/crate/necropolis/tendril/attackby(obj/item/item, mob/user, params)
if(!istype(item, /obj/item/skeleton_key) || spawned_loot)
return ..()
var/loot = rand(1,20)
var/mod
switch(loot)
if(1)
new /obj/item/shared_storage/red(src)
if(2)
new /obj/item/soulstone/anybody/mining(src)
if(3)
new /obj/item/organ/internal/cyberimp/arm/shard/katana(src)
if(4)
new /obj/item/clothing/glasses/godeye(src)
if(5)
new /obj/item/reagent_containers/cup/bottle/potion/flight(src)
if(6)
new /obj/item/clothing/gloves/gauntlets(src)
if(7)
mod = rand(1,4)
switch(mod)
if(1)
new /obj/item/disk/design_disk/modkit_disc/resonator_blast(src)
if(2)
new /obj/item/disk/design_disk/modkit_disc/rapid_repeater(src)
if(3)
new /obj/item/disk/design_disk/modkit_disc/mob_and_turf_aoe(src)
if(4)
new /obj/item/disk/design_disk/modkit_disc/bounty(src)
if(8)
new /obj/item/rod_of_asclepius(src)
if(9)
new /obj/item/organ/internal/heart/cursed/wizard(src)
if(10)
new /obj/item/ship_in_a_bottle(src)
if(11)
new /obj/item/clothing/suit/hooded/berserker(src)
if(12)
new /obj/item/jacobs_ladder(src)
if(13)
new /obj/item/guardian_creator/miner(src)
if(14)
new /obj/item/warp_cube/red(src)
if(15)
new /obj/item/wisp_lantern(src)
if(16)
new /obj/item/immortality_talisman(src)
if(17)
new /obj/item/book/granter/action/spell/summonitem(src)
if(18)
new /obj/item/book_of_babel(src)
if(19)
new /obj/item/borg/upgrade/modkit/lifesteal(src)
new /obj/item/bedsheet/cult(src)
if(20)
new /obj/item/clothing/neck/necklace/memento_mori(src)
if(!contents.len)
to_chat(user, span_warning("[src] makes a clunking sound as you try to open it. You feel compelled to let the gods know! (Please open an adminhelp and try again!)"))
CRASH("Failed to generate loot. loot number: [loot][mod ? "subloot: [mod]" : null]")
spawned_loot = TRUE
qdel(item)
to_chat(user, span_notice("You disable the magic lock, revealing the loot."))
/obj/structure/closet/crate/necropolis/tendril/before_open(mob/living/user, force)
. = ..()
if(!.)
return FALSE
if(!broken && !force && !spawned_loot)
balloon_alert(user, "its locked!")
return FALSE
return TRUE
//Megafauna chests
/obj/structure/closet/crate/necropolis/dragon
name = "dragon chest"
/obj/structure/closet/crate/necropolis/dragon/PopulateContents()
var/loot = rand(1,4)
switch(loot)
if(1)
new /obj/item/melee/ghost_sword(src)
if(2)
new /obj/item/lava_staff(src)
if(3)
new /obj/item/book/granter/action/spell/sacredflame(src)
if(4)
new /obj/item/dragons_blood(src)
/obj/structure/closet/crate/necropolis/dragon/crusher
name = "firey dragon chest"
/obj/structure/closet/crate/necropolis/dragon/crusher/PopulateContents()
..()
new /obj/item/crusher_trophy/tail_spike(src)
/obj/structure/closet/crate/necropolis/bubblegum
name = "\improper Ancient Sarcophagus"
desc = "Once guarded by the King of Demons, this sarcophagus contains the relics of an ancient soldier."
icon_state = "necro_bubblegum"
base_icon_state = "necro_bubblegum"
lid_icon_state = "necro_bubblegum_lid"
lid_x = -26
lid_y = 2
/obj/structure/closet/crate/necropolis/bubblegum/PopulateContents()
new /obj/item/clothing/suit/hooded/hostile_environment(src)
var/loot = rand(1,2)
switch(loot)
if(1)
new /obj/item/bloodcrawl_bottle(src) //SKYRAT EDIT ORIGINAL : new /obj/item/mayhem(src)
if(2)
new /obj/item/soulscythe(src)
/obj/structure/closet/crate/necropolis/bubblegum/crusher
name = "bloody bubblegum chest"
/obj/structure/closet/crate/necropolis/bubblegum/crusher/PopulateContents()
..()
new /obj/item/crusher_trophy/demon_claws(src)
/obj/structure/closet/crate/necropolis/colossus
name = "colossus chest"
/obj/structure/closet/crate/necropolis/colossus/bullet_act(obj/projectile/P)
if(istype(P, /obj/projectile/colossus))
return BULLET_ACT_FORCE_PIERCE
return ..()
/obj/structure/closet/crate/necropolis/colossus/PopulateContents()
var/list/choices = subtypesof(/obj/machinery/anomalous_crystal)
var/random_crystal = pick(choices)
new random_crystal(src)
new /obj/item/organ/internal/vocal_cords/colossus(src)
/obj/structure/closet/crate/necropolis/colossus/crusher
name = "angelic colossus chest"
/obj/structure/closet/crate/necropolis/colossus/crusher/PopulateContents()
..()
new /obj/item/crusher_trophy/blaster_tubes(src)
//Other chests and minor stuff
/obj/structure/closet/crate/necropolis/puzzle
name = "puzzling chest"
/obj/structure/closet/crate/necropolis/puzzle/PopulateContents()
var/loot = rand(1,3)
switch(loot)
if(1)
new /obj/item/soulstone/anybody/mining(src)
if(2)
new /obj/item/wisp_lantern(src)
if(3)
new /obj/item/prisoncube(src)
/obj/item/skeleton_key
name = "skeleton key"
desc = "An artifact usually found in the hands of the natives of lavaland, which NT now holds a monopoly on."
icon = 'icons/obj/mining_zones/artefacts.dmi'
icon_state = "skeleton_key"
w_class = WEIGHT_CLASS_SMALL