From 54c87c2ec717b22bf1af3aeda110ba3325cb57fa Mon Sep 17 00:00:00 2001 From: Venuska1117 <89580971+Venuska1117@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:52:33 +0200 Subject: [PATCH] Boii here we go again. --- .../mob/living/carbon/xenomorph/Evolution.dm | 12 +++++----- .../mob/living/carbon/xenomorph/Xenomorph.dm | 1 + .../living/carbon/xenomorph/castes/Boiler.dm | 1 + .../carbon/xenomorph/castes/Burrower.dm | 1 + .../living/carbon/xenomorph/castes/Carrier.dm | 1 + .../living/carbon/xenomorph/castes/Crusher.dm | 1 + .../carbon/xenomorph/castes/Defender.dm | 1 + .../living/carbon/xenomorph/castes/Drone.dm | 3 ++- .../carbon/xenomorph/castes/Hivelord.dm | 1 + .../living/carbon/xenomorph/castes/Larva.dm | 2 +- .../living/carbon/xenomorph/castes/Lurker.dm | 1 + .../carbon/xenomorph/castes/Praetorian.dm | 1 + .../living/carbon/xenomorph/castes/Queen.dm | 1 + .../living/carbon/xenomorph/castes/Ravager.dm | 1 + .../living/carbon/xenomorph/castes/Runner.dm | 1 + .../carbon/xenomorph/castes/Sentinel.dm | 1 + .../living/carbon/xenomorph/castes/Spitter.dm | 1 + .../living/carbon/xenomorph/castes/Warrior.dm | 1 + .../carbon/xenomorph/castes/caste_datum.dm | 4 ++++ .../mob/living/carbon/xenomorph/life.dm | 22 ++++++++++++++++++- 20 files changed, 49 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index e0f0844bfa13..02c991e136fe 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -46,7 +46,7 @@ if(!evolve_checks()) return - if((!hive.living_xeno_queen) && castepick != XENO_CASTE_QUEEN && !islarva(src) && !hive.allow_no_queen_evo) + if((!hive.living_xeno_queen) && castepick != XENO_CASTE_QUEEN && !islarva(src) && !hive.allow_no_queen_evo && castepick != XENO_CASTE_RUNNER && castepick != XENO_CASTE_DEFENDER && castepick != XENO_CASTE_SENTINEL) to_chat(src, SPAN_WARNING("The Hive is shaken by the death of the last Queen. We can't find the strength to evolve.")) return @@ -66,9 +66,9 @@ else to_chat(src, SPAN_WARNING("Nuh-uhh.")) return - if(evolution_threshold && castepick != XENO_CASTE_QUEEN) //Does the caste have an evolution timer? Then check it - if(evolution_stored < evolution_threshold) - to_chat(src, SPAN_WARNING("We must wait before evolving. Currently at: [evolution_stored] / [evolution_threshold].")) + if(caste_datum.evolution_cost && castepick != XENO_CASTE_QUEEN) //Does the caste have an evolution timer? Then check it + if(evolution_stored < caste_datum.evolution_cost) + to_chat(src, SPAN_WARNING("We must wait before evolving. Currently at: [evolution_stored] / [caste_datum.evolution_cost].")) return // Used for restricting benos to evolve to drone/queen when they're the only potential queen @@ -128,8 +128,8 @@ else if(!can_evolve(castepick, potential_queens)) return - // subtract the threshold, keep the stored amount - evolution_stored -= evolution_threshold + // subtract the evolution cost, keep the stored amount + evolution_stored -= caste_datum.evolution_cost var/obj/item/organ/xeno/organ = locate() in src if(!isnull(organ)) qdel(organ) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index eed2dce5f7a8..e14db298b9d7 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -151,6 +151,7 @@ var/show_only_numbers = FALSE var/evolution_stored = 0 //How much evolution they have stored var/evolution_threshold = 200 + var/evolution_cost = 30 //How much evolution to caste will cost var/tier = 1 //This will track their "tier" to restrict/limit evolutions var/time_of_birth diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm b/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm index f7e906a82b28..6eb869781a5c 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm @@ -34,6 +34,7 @@ tacklestrength_max = 4 minimum_evolve_time = 15 MINUTES + evolution_cost = 500 minimap_icon = "boiler" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm index 106dcdcacb62..6d9f04cc132b 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm @@ -34,6 +34,7 @@ tremor_cooldown = 450 minimum_evolve_time = 7 MINUTES + evolution_cost = 200 minimap_icon = "burrower" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm index d46bfce6bf71..c787e811e17d 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm @@ -39,6 +39,7 @@ egg_cooldown = 250 minimum_evolve_time = 5 MINUTES + evolution_cost = 200 minimap_icon = "carrier" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm b/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm index a84b9965f9c3..26f08feb2fc0 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm @@ -18,6 +18,7 @@ behavior_delegate_type = /datum/behavior_delegate/crusher_base minimum_evolve_time = 15 MINUTES + evolution_cost = 500 tackle_min = 2 tackle_max = 6 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm b/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm index 548b0389e683..9a4acf31a8c8 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm @@ -25,6 +25,7 @@ tackle_max = 4 minimum_evolve_time = 4 MINUTES + evolution_cost = 30 minimap_icon = "defender" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm b/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm index e6c4a76c9353..db5dfb0b52a8 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm @@ -20,7 +20,7 @@ build_time_mult = BUILD_TIME_MULT_BUILDER caste_desc = "A builder of hives. Only drones may evolve into Queens." - evolves_to = list(XENO_CASTE_QUEEN, XENO_CASTE_BURROWER, XENO_CASTE_CARRIER, XENO_CASTE_HIVELORD) //Add more here separated by commas + evolves_to = list(XENO_CASTE_RUNNER, XENO_CASTE_SENTINEL, XENO_CASTE_DEFENDER, XENO_CASTE_QUEEN, XENO_CASTE_CARRIER, XENO_CASTE_HIVELORD, XENO_CASTE_BURROWER) //Add more here separated by commas deevolves_to = list("Larva") can_hold_facehuggers = 1 can_hold_eggs = CAN_HOLD_TWO_HANDS @@ -36,6 +36,7 @@ aura_strength = 2 minimum_evolve_time = 1 MINUTES + evolution_cost = 30 minimap_icon = "drone" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm index 8024ed366405..4e8c8fa506d8 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm @@ -35,6 +35,7 @@ aura_strength = 2.5 minimum_evolve_time = 3 MINUTES + evolution_cost = 200 minimap_icon = "hivelord" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm index 8dc427e2c55e..32750ac3c06a 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm @@ -10,7 +10,7 @@ caste_desc = "D'awwwww, so cute!" speed = XENO_SPEED_TIER_10 innate_healing = TRUE //heals even outside weeds so you're not stuck unable to evolve when hiding on the ship wounded. - evolves_to = XENO_T1_CASTES + evolves_to = list(XENO_CASTE_DRONE) evolve_without_queen = TRUE can_be_revived = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index 1dca7eb23f70..4b41628bee36 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -25,6 +25,7 @@ heal_resting = 1.5 minimum_evolve_time = 9 MINUTES + evolution_cost = 200 minimap_icon = "lurker" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm b/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm index 70d33b905a00..95c5917defba 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm @@ -35,6 +35,7 @@ behavior_delegate_type = /datum/behavior_delegate/praetorian_base minimum_evolve_time = 15 MINUTES + evolution_cost = 500 minimap_icon = "praetorian" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index 5b9c410e235a..8b90065a9afe 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -48,6 +48,7 @@ minimap_icon = "xenoqueen" royal_caste = TRUE + evolution_cost = 0 /proc/update_living_queens() // needed to update when you change a queen to a different hive outer_loop: diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm b/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm index 90614e338071..b1077df33a6e 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm @@ -33,6 +33,7 @@ behavior_delegate_type = /datum/behavior_delegate/ravager_base minimum_evolve_time = 15 MINUTES + evolution_cost = 500 minimap_icon = "ravager" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm b/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm index 12fdb8d02843..1851ac4b68bd 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm @@ -28,6 +28,7 @@ heal_resting = 1.75 minimum_evolve_time = 5 MINUTES + evolution_cost = 30 minimap_icon = "runner" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm b/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm index 3e7416f39fc5..f95104a344fc 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm @@ -28,6 +28,7 @@ minimap_icon = "sentinel" minimum_evolve_time = 5 MINUTES + evolution_cost = 30 /mob/living/carbon/xenomorph/sentinel caste_type = XENO_CASTE_SENTINEL diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm b/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm index 006f66b7f1b2..79205181a83b 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm @@ -28,6 +28,7 @@ tacklestrength_max = 5 minimum_evolve_time = 9 MINUTES + evolution_cost = 200 minimap_icon = "spitter" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm index 2885dd6ac553..89360c95d9cd 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm @@ -28,6 +28,7 @@ heal_resting = 1.4 minimum_evolve_time = 9 MINUTES + evolution_cost = 200 minimap_icon = "warrior" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/caste_datum.dm b/code/modules/mob/living/carbon/xenomorph/castes/caste_datum.dm index feee2edecb67..3d631c962dfb 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/caste_datum.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/caste_datum.dm @@ -21,6 +21,10 @@ var/evolution_allowed = 1 ///Threshold to next evolution var/evolution_threshold = 0 + ///How much evolution is stored + var/evolution_stored = 0 + ///How much caste cost in evo points + var/evolution_cost = 0 /// whether they can get evo points without needing an ovi queen var/evolve_without_queen = FALSE ///This is where you add castes to evolve into. "Separated", "by", "commas" diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index 1657d078ffda..c13cc65c67d1 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -57,11 +57,31 @@ evolution_stored -= progress_amount return + if(evolution_stored >= evolution_cost) + if(!got_evolution_message) + early_evolve_message() + got_evolution_message = TRUE + + if(ROUND_TIME < XENO_ROUNDSTART_PROGRESS_TIME_2) + evolution_stored += progress_amount + return + + if(evolution_stored > evolution_threshold + progress_amount) + evolution_stored -= progress_amount + return + else evolution_stored += progress_amount /mob/living/carbon/xenomorph/proc/evolve_message() - to_chat(src, SPAN_XENODANGER("Our carapace crackles and our tendons strengthen. We are ready to evolve!")) //Makes this bold so the Xeno doesn't miss it + to_chat(src, SPAN_XENODANGER("Our carapace crackles and we become matured. We are ready to evolve!")) //Makes this bold so the Xeno doesn't miss it + playsound_client(client, sound('sound/effects/xeno_evolveready.ogg')) + + var/datum/action/xeno_action/onclick/evolve/evolve_action = new() + evolve_action.give_to(src) + +/mob/living/carbon/xenomorph/proc/early_evolve_message() + to_chat(src, SPAN_XENODANGER("Your tendons strengthen, you can now evolve to young castes!")) //Placeholder evo message, someone can improve it. playsound_client(client, sound('sound/effects/xeno_evolveready.ogg')) var/datum/action/xeno_action/onclick/evolve/evolve_action = new()