From 21d8cf2c123827fc582c45c7f1facd1b6aea121f Mon Sep 17 00:00:00 2001 From: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> Date: Tue, 13 May 2025 00:40:57 -0400 Subject: [PATCH] All megafauna now drop ore on death (#29169) * All megafauna drop ore as a reward now * Fixes vetus * Apply suggestions from code review Batching lewc's changes Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> --------- Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- .../mining/lavaland/loot/ancient_loot.dm | 46 ------------------- .../mining/lavaland/loot/ashdragon_loot.dm | 25 ---------- .../mining/lavaland/loot/bubblegum_loot.dm | 15 ------ .../mining/lavaland/loot/colossus_loot.dm | 19 -------- .../hostile/megafauna/ancient_robot.dm | 32 +++++++++---- .../hostile/megafauna/blood_drunk_miner.dm | 2 +- .../hostile/megafauna/bubblegum.dm | 11 ++++- .../hostile/megafauna/colossus.dm | 11 ++++- .../simple_animal/hostile/megafauna/drake.dm | 20 ++++++-- .../hostile/megafauna/hierophant.dm | 3 +- .../simple_animal/hostile/megafauna/legion.dm | 15 ++++-- .../hostile/megafauna/megafauna.dm | 36 ++++++++++++++- paradise.dme | 1 - 13 files changed, 106 insertions(+), 130 deletions(-) delete mode 100644 code/modules/mining/lavaland/loot/ancient_loot.dm diff --git a/code/modules/mining/lavaland/loot/ancient_loot.dm b/code/modules/mining/lavaland/loot/ancient_loot.dm deleted file mode 100644 index ca6004c1230..00000000000 --- a/code/modules/mining/lavaland/loot/ancient_loot.dm +++ /dev/null @@ -1,46 +0,0 @@ -/obj/structure/closet/crate/necropolis/ancient - name = "ancient supply cache" - -/obj/structure/closet/crate/necropolis/ancient/populate_contents() - new /obj/item/pinpointer/tendril(src) // in pinpointers, with the rest of them - var/list/common_ore = list( - /obj/item/stack/ore/uranium, - /obj/item/stack/ore/silver, - /obj/item/stack/ore/gold, - /obj/item/stack/ore/plasma, - /obj/item/stack/ore/titanium - ) - - for(var/res in common_ore) - var/obj/item/stack/R = new res(src) - R.amount = rand(15, 30) - - var/list/rare_ore = list( - /obj/item/stack/ore/diamond, - /obj/item/stack/ore/bluespace_crystal, - /obj/item/stack/sheet/mineral/abductor // few ruins of it often spawn, should be fine. - ) - - for(var/res in rare_ore) - var/obj/item/stack/R = new res(src) - R.amount = rand(10, 15) //ash drakes drop 5, this is perfectly fine - - var/list/exquisite_ore = list( - /obj/item/stack/ore/platinum, // The vetus can have some, as a treat - /obj/item/stack/ore/iridium, - /obj/item/stack/ore/palladium - ) - - for(var/ore in exquisite_ore) - new ore(src, rand(5, 10)) // Don't want mining to step too much on explorer's toes. - -/obj/structure/closet/crate/necropolis/ancient/ex_act(severity) - return - -/obj/structure/closet/crate/necropolis/ancient/crusher - name = "alloyed ancient supply cache" - -/obj/structure/closet/crate/necropolis/ancient/crusher/populate_contents() - . = ..() - new /obj/item/crusher_trophy/adaptive_intelligence_core(src) - diff --git a/code/modules/mining/lavaland/loot/ashdragon_loot.dm b/code/modules/mining/lavaland/loot/ashdragon_loot.dm index 1aa79d0fda4..b57116b6a9a 100644 --- a/code/modules/mining/lavaland/loot/ashdragon_loot.dm +++ b/code/modules/mining/lavaland/loot/ashdragon_loot.dm @@ -1,28 +1,3 @@ -/obj/structure/closet/crate/necropolis/dragon - name = "dragon chest" - -/obj/structure/closet/crate/necropolis/dragon/populate_contents() - 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/spellbook/oneuse/sacredflame(src) - new /obj/item/gun/magic/wand/fireball(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/populate_contents() - . = ..() - new /obj/item/crusher_trophy/tail_spike(src) - - // Spectral Blade /obj/item/melee/ghost_sword diff --git a/code/modules/mining/lavaland/loot/bubblegum_loot.dm b/code/modules/mining/lavaland/loot/bubblegum_loot.dm index 19d6bf7fff3..11fc3286d47 100644 --- a/code/modules/mining/lavaland/loot/bubblegum_loot.dm +++ b/code/modules/mining/lavaland/loot/bubblegum_loot.dm @@ -1,18 +1,3 @@ -/obj/structure/closet/crate/necropolis/bubblegum - name = "bubblegum chest" - -/obj/structure/closet/crate/necropolis/bubblegum/populate_contents() - new /obj/item/clothing/suit/space/hostile_environment(src) - new /obj/item/clothing/head/helmet/space/hostile_environment(src) - new /obj/item/melee/spellblade/random(src) - -/obj/structure/closet/crate/necropolis/bubblegum/crusher - name = "bloody bubblegum chest" - -/obj/structure/closet/crate/necropolis/bubblegum/crusher/populate_contents() - . = ..() - new /obj/item/crusher_trophy/demon_claws(src) - /obj/structure/closet/crate/necropolis/bubblegum/bait/populate_contents() return diff --git a/code/modules/mining/lavaland/loot/colossus_loot.dm b/code/modules/mining/lavaland/loot/colossus_loot.dm index 57e20812fd3..573d3807e2e 100644 --- a/code/modules/mining/lavaland/loot/colossus_loot.dm +++ b/code/modules/mining/lavaland/loot/colossus_loot.dm @@ -1,22 +1,3 @@ -//Colossus -/obj/structure/closet/crate/necropolis/colossus - name = "colossus chest" - -/obj/structure/closet/crate/necropolis/colossus/populate_contents() - var/list/crystalchoices = subtypesof(/obj/machinery/anomalous_crystal) - var/random_crystal = pick(crystalchoices) - var/list/choices = list(/obj/item/organ/internal/vocal_cords/colossus, /obj/item/organ/internal/eyes/cybernetic/eyesofgod, random_crystal) - for(var/I in 1 to 2) - var/loot = pick_n_take(choices) - new loot(src) - -/obj/structure/closet/crate/necropolis/colossus/crusher - name = "angelic colossus chest" - -/obj/structure/closet/crate/necropolis/colossus/crusher/populate_contents() - . = ..() - new /obj/item/crusher_trophy/blaster_tubes(src) - ///Anomolous Crystal/// /obj/machinery/anomalous_crystal diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/ancient_robot.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/ancient_robot.dm index db41ea229fd..1fb6bc301d2 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/ancient_robot.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/ancient_robot.dm @@ -70,14 +70,15 @@ Difficulty: Hard pixel_x = -16 pixel_y = -16 del_on_death = TRUE - loot = list(/obj/structure/closet/crate/necropolis/ancient) - crusher_loot = list(/obj/structure/closet/crate/necropolis/ancient/crusher) + loot = list(/obj/item/pinpointer/tendril) + crusher_loot = list(/obj/item/crusher_trophy/adaptive_intelligence_core) internal_gps = /obj/item/gps/internal/ancient medal_type = BOSS_MEDAL_ROBOT score_type = ROBOT_SCORE deathmessage = "explodes into a shower of alloys" footstep_type = FOOTSTEP_MOB_HEAVY //make stomp like bubble attack_action_types = list() + difficulty_ore_modifier = 4 //Vetus' whole deal was that it dropped ore before all megas did, so it gets a ton var/charging = FALSE var/revving_charge = FALSE @@ -138,6 +139,18 @@ Difficulty: Hard QDEL_NULL(beam) return ..() +/mob/living/simple_animal/hostile/megafauna/ancient_robot/spawn_ore_reward(atom/spawn_location) + ..() + var/list/exquisite_ore = list( + /obj/item/stack/ore/platinum, // The vetus can have some, as a treat + /obj/item/stack/ore/iridium, + /obj/item/stack/ore/palladium + ) + + new /obj/item/stack/sheet/mineral/abductor(spawn_location, roll("4d8")) // This is the amount of the other rare ores spawned + for(var/ore in exquisite_ore) + new ore(spawn_location, rand(5, 10)) // Don't want mining to step too much on explorer's toes. + /obj/item/gps/internal/ancient icon_state = null gpstag = "Malfunctioning Signal" @@ -175,15 +188,14 @@ Difficulty: Hard core_type = /obj/item/assembly/signaler/anomaly/vortex if(CRYO) core_type = /obj/item/assembly/signaler/anomaly/cryo + loot += core_type - var/crate_type = pick(loot) - var/obj/structure/closet/crate/C = new crate_type(loc) - new core_type(C) - if(!enraged) - return - for(var/mob/living/M in urange(40, src)) //Bigger range, ran once per shift, as people run away from vetus as it blows up. - if(M.client) - new /obj/item/disk/fauna_research/vetus(C) + if(enraged) + for(var/mob/living/M in urange(40, src)) //Bigger range, ran once per shift, as people run away from vetus as it blows up. + if(!M.client) + return + loot += /obj/item/disk/fauna_research/vetus + ..() /mob/living/simple_animal/hostile/megafauna/ancient_robot/enrage() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm index 9c17631a35f..ec942960d64 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm @@ -38,7 +38,7 @@ Difficulty: Medium ranged = TRUE ranged_cooldown_time = 16 pixel_x = -7 - crusher_loot = list(/obj/item/melee/energy/cleaving_saw, /obj/item/gun/energy/kinetic_accelerator, /obj/item/crusher_trophy/miner_eye) + crusher_loot = list(/obj/item/crusher_trophy/miner_eye) loot = list(/obj/item/melee/energy/cleaving_saw, /obj/item/gun/energy/kinetic_accelerator) wander = FALSE del_on_death = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index 7bd2ee98227..2987b449b40 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -53,8 +53,11 @@ Difficulty: Hard ranged = TRUE pixel_x = -32 del_on_death = TRUE - crusher_loot = list(/obj/structure/closet/crate/necropolis/bubblegum/crusher) - loot = list(/obj/structure/closet/crate/necropolis/bubblegum) + difficulty_ore_modifier = 3 + crusher_loot = list(/obj/item/crusher_trophy/demon_claws) + loot = list(/obj/item/clothing/suit/space/hostile_environment, + /obj/item/clothing/head/helmet/space/hostile_environment, + /obj/item/melee/spellblade/random) blood_volume = BLOOD_VOLUME_MAXIMUM //BLEED FOR ME var/charging = FALSE var/enrage_till = 0 @@ -158,6 +161,10 @@ Difficulty: Hard new /obj/effect/bubblegum_exit(get_turf(src)) return ..() +/mob/living/simple_animal/hostile/megafauna/bubblegum/drop_loot() + if(enraged && !second_life) + return //The jebait chest already drops + return ..() /mob/living/simple_animal/hostile/megafauna/bubblegum/OpenFire(atom/A) if(second_life) Shoot(A) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 77946d7c0bf..ac2b7f0b39c 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -50,8 +50,8 @@ Difficulty: Very Hard internal_gps = /obj/item/gps/internal/colossus medal_type = BOSS_MEDAL_COLOSSUS score_type = COLOSSUS_SCORE - crusher_loot = list(/obj/structure/closet/crate/necropolis/colossus/crusher) - loot = list(/obj/structure/closet/crate/necropolis/colossus) + difficulty_ore_modifier = 3 + crusher_loot = list(/obj/item/crusher_trophy/blaster_tubes) deathmessage = "disintegrates, leaving a glowing core in its wake." death_sound = 'sound/misc/demon_dies.ogg' enraged_loot = /obj/item/disk/fauna_research/colossus @@ -343,6 +343,13 @@ Difficulty: Very Hard return floating = on +/mob/living/simple_animal/hostile/megafauna/colossus/generate_random_loot() + var/list/crystalchoices = subtypesof(/obj/machinery/anomalous_crystal) + var/random_crystal = pick(crystalchoices) + var/list/choices = list(/obj/item/organ/internal/vocal_cords/colossus, /obj/item/organ/internal/eyes/cybernetic/eyesofgod, random_crystal) + for(var/I in 1 to 2) + loot += pick_n_take(choices) + /obj/item/projectile/colossus name ="death bolt" icon_state= "chronobolt" diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm index d002d09a093..dfbfc72a346 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm @@ -50,8 +50,8 @@ Difficulty: Medium move_to_delay = 5 ranged = TRUE pixel_x = -32 - crusher_loot = list(/obj/structure/closet/crate/necropolis/dragon/crusher) - loot = list(/obj/structure/closet/crate/necropolis/dragon) + difficulty_ore_modifier = 2 + crusher_loot = list(/obj/item/crusher_trophy/tail_spike) butcher_results = list(/obj/item/stack/ore/diamond = 5, /obj/item/stack/sheet/sinew = 5, /obj/item/stack/sheet/animalhide/ashdrake = 10, /obj/item/stack/sheet/bone = 30) var/swooping = NONE var/player_cooldown = 0 @@ -425,6 +425,13 @@ Difficulty: Medium /mob/living/simple_animal/hostile/megafauna/dragon/Process_Spacemove(movement_dir = 0, continuous_move = FALSE) return 1 +/mob/living/simple_animal/hostile/megafauna/dragon/generate_random_loot() + var/list/choices = list(/obj/item/melee/ghost_sword, + /obj/item/lava_staff, + /obj/item/dragons_blood, + list(/obj/item/spellbook/oneuse/sacredflame, /obj/item/gun/magic/wand/fireball)) + loot += pick(choices) + /obj/effect/temp_visual/lava_warning icon_state = "lavastaff_warn" layer = BELOW_MOB_LAYER @@ -593,11 +600,14 @@ Difficulty: Medium melee_damage_lower = 30 mouse_opacity = MOUSE_OPACITY_ICON damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 1, CLONE = 1, STAMINA = 0, OXY = 1) - loot = list() crusher_loot = list() butcher_results = list(/obj/item/stack/ore/diamond = 5, /obj/item/stack/sheet/sinew = 5, /obj/item/stack/sheet/bone = 30) attack_action_types = list() +/mob/living/simple_animal/hostile/megafauna/dragon/lesser/generate_random_loot() + return + + /mob/living/simple_animal/hostile/megafauna/dragon/space_dragon name = "space dragon" desc = "A space carp turned dragon by vile magic. Has the same ferocity of a space carp, but also a much more enabling body." @@ -646,6 +656,10 @@ Difficulty: Medium ranged_cooldown = world.time + ranged_cooldown_time fire_stream() +/mob/living/simple_animal/hostile/megafauna/dragon/space_dragon/generate_random_loot() + return + + /datum/spell/aoe/repulse/spacedragon name = "Tail Sweep" desc = "Throw back attackers with a sweep of your tail." diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 5e74023c4e5..758a7a3c269 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -56,7 +56,8 @@ Difficulty: Hard ranged_cooldown_time = 40 aggro_vision_range = 21 //so it can see to one side of the arena to the other loot = list(/obj/item/hierophant_club) - crusher_loot = list(/obj/item/hierophant_club, /obj/item/crusher_trophy/vortex_talisman) + difficulty_ore_modifier = 2 + crusher_loot = list(/obj/item/crusher_trophy/vortex_talisman) wander = FALSE internal_gps = /obj/item/gps/internal/hierophant medal_type = BOSS_MEDAL_HIEROPHANT diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm index ec92013d609..a5a412abf89 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm @@ -44,7 +44,8 @@ Difficulty: Medium medal_type = BOSS_MEDAL_LEGION score_type = LEGION_SCORE loot = list(/obj/item/storm_staff) - crusher_loot = list(/obj/item/storm_staff, /obj/item/crusher_trophy/empowered_legion_skull) + difficulty_ore_modifier = 3 + crusher_loot = list(/obj/item/crusher_trophy/empowered_legion_skull) enraged_loot = /obj/item/disk/fauna_research/legion vision_range = 13 elimination = TRUE @@ -72,22 +73,28 @@ Difficulty: Medium legiontwo.transform /= 1.5 legiontwo.loot = list() legiontwo.crusher_loot = list() - + /mob/living/simple_animal/hostile/megafauna/legion/unrage() . = ..() for(var/mob/living/simple_animal/hostile/megafauna/legion/other in GLOB.mob_list) if(other != src) other.loot = list(/obj/item/storm_staff) //Initial does not work with lists. - other.crusher_loot = list(/obj/item/storm_staff, /obj/item/crusher_trophy/empowered_legion_skull) + other.crusher_loot = list(/obj/item/crusher_trophy/empowered_legion_skull) other.maxHealth = 2500 other.health = 2500 qdel(src) //Suprise, it's the one on lavaland that regrows to full. +/mob/living/simple_animal/hostile/megafauna/legion/drop_loot() + for(var/mob/living/simple_animal/hostile/megafauna/legion/other in GLOB.mob_list) + if(other != src) + return + ..() + /mob/living/simple_animal/hostile/megafauna/legion/death(gibbed) for(var/mob/living/simple_animal/hostile/megafauna/legion/other in GLOB.mob_list) if(other != src) other.loot = list(/obj/item/storm_staff) //Initial does not work with lists. - other.crusher_loot = list(/obj/item/storm_staff, /obj/item/crusher_trophy/empowered_legion_skull) + other.crusher_loot = list(/obj/item/crusher_trophy/empowered_legion_skull) . = ..() /mob/living/simple_animal/hostile/megafauna/legion/AttackingTarget() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index 9dc0364d059..5aaac9a66d3 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -44,6 +44,8 @@ var/enraged = FALSE /// Path of the hardmode loot disk, if applicable. var/enraged_loot + /// How much ore should killing this give + var/difficulty_ore_modifier = 1 /mob/living/simple_animal/hostile/megafauna/Initialize(mapload) . = ..() @@ -53,6 +55,7 @@ for(var/action_type in attack_action_types) var/datum/action/innate/megafauna_attack/attack_action = new action_type() attack_action.Grant(src) + generate_random_loot() RegisterSignal(src, COMSIG_HOSTILE_FOUND_TARGET, PROC_REF(hoverboard_deactivation)) /mob/living/simple_animal/hostile/megafauna/Destroy() @@ -91,8 +94,37 @@ SSblackbox.record_feedback("tally", "megafauna_kills", 1, "[initial(name)]") return ..() +/mob/living/simple_animal/hostile/megafauna/drop_loot() + var/obj/structure/closet/crate/necropolis/loot_drop = new(get_turf(src)) + for(var/item in loot) + new item(loot_drop) + spawn_ore_reward(loot_drop) + +/// If the megafauna has a pool of random loot items to pick from, override this proc to have it be set on initialization +/mob/living/simple_animal/hostile/megafauna/proc/generate_random_loot() + return + +/// Handling the ore part of the mega reward, the higher the difficulty_ore_modifier the more ore will spawn +/mob/living/simple_animal/hostile/megafauna/proc/spawn_ore_reward(atom/spawn_location) + var/list/common_ore = list( + /obj/item/stack/ore/uranium, + /obj/item/stack/ore/silver, + /obj/item/stack/ore/gold, + /obj/item/stack/ore/plasma, + /obj/item/stack/ore/titanium) + var/list/rare_ore = list( + /obj/item/stack/ore/diamond, + /obj/item/stack/ore/bluespace_crystal) + + for(var/ore in common_ore) + var/obj/item/stack/O = new ore(spawn_location) + O.amount = roll(difficulty_ore_modifier * 2, 4 + difficulty_ore_modifier) + for(var/ore in rare_ore) + var/obj/item/stack/O = new ore(spawn_location) + O.amount = roll(difficulty_ore_modifier, 4 + difficulty_ore_modifier) + /mob/living/simple_animal/hostile/megafauna/proc/spawn_crusher_loot() - loot = crusher_loot + loot += crusher_loot /mob/living/simple_animal/hostile/megafauna/AttackingTarget() if(recovery_time >= world.time) @@ -152,9 +184,11 @@ /mob/living/simple_animal/hostile/megafauna/proc/enrage() if(enraged || ((health / maxHealth) * 100 <= 80)) return + difficulty_ore_modifier += 4 // Hardmode only helps the station more and gives you bragging rights, no special items for hardmode enraged = TRUE /mob/living/simple_animal/hostile/megafauna/proc/unrage() + difficulty_ore_modifier -= 4 enraged = FALSE /mob/living/simple_animal/hostile/megafauna/DestroySurroundings() diff --git a/paradise.dme b/paradise.dme index efdd4e56593..dd96fcc6338 100644 --- a/paradise.dme +++ b/paradise.dme @@ -2290,7 +2290,6 @@ #include "code\modules\mining\laborcamp\laborshuttle.dm" #include "code\modules\mining\lavaland\ash_flora.dm" #include "code\modules\mining\lavaland\necropolis_chests.dm" -#include "code\modules\mining\lavaland\loot\ancient_loot.dm" #include "code\modules\mining\lavaland\loot\ashdragon_loot.dm" #include "code\modules\mining\lavaland\loot\bubblegum_loot.dm" #include "code\modules\mining\lavaland\loot\colossus_loot.dm"