From 6a386ea3e722e4f17642693bc92a4fcb3a449469 Mon Sep 17 00:00:00 2001 From: homexp13 Date: Tue, 19 Nov 2024 21:17:46 +0300 Subject: [PATCH 1/2] UPGRADE --- code/__DEFINES/xeno.dm | 5 +--- .../mob/living/carbon/xenomorph/evolution.dm | 3 +++ .../living/carbon/xenomorph/hive_upgrades.dm | 1 + .../living/carbon/xenomorph/xeno_defines.dm | 2 ++ .../mob/living/carbon/xenomorph/xenoprocs.dm | 27 ++++--------------- 5 files changed, 12 insertions(+), 26 deletions(-) diff --git a/code/__DEFINES/xeno.dm b/code/__DEFINES/xeno.dm index 2e126ba00da..cd01397f1f8 100644 --- a/code/__DEFINES/xeno.dm +++ b/code/__DEFINES/xeno.dm @@ -219,10 +219,7 @@ GLOBAL_LIST_INIT(xeno_utility_upgrades, list( /datum/status_effect/upgrade_trail, )) -#define XENO_UPGRADE_BIOMASS_COST_T1 10 -#define XENO_UPGRADE_BIOMASS_COST_T2 15 -#define XENO_UPGRADE_BIOMASS_COST_T3 20 -#define XENO_UPGRADE_BIOMASS_COST_T4 25 +#define XENO_UPGRADE_COST 25 #define CHARGE_SPEED(charger) (min(charger.valid_steps_taken, charger.max_steps_buildup) * charger.speed_per_step) #define CHARGE_MAX_SPEED (speed_per_step * max_steps_buildup) diff --git a/code/modules/mob/living/carbon/xenomorph/evolution.dm b/code/modules/mob/living/carbon/xenomorph/evolution.dm index a3928a480b9..000dc41ff75 100644 --- a/code/modules/mob/living/carbon/xenomorph/evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/evolution.dm @@ -168,6 +168,9 @@ qdel(new_xeno.hunter_data) new_xeno.hunter_data = hunter_data hunter_data = null + new_xeno.upgrades_holder = upgrades_holder + for(var/datum/status_effect/S AS in new_xeno.upgrades_holder) + new_xeno.apply_status_effect(S) transfer_observers_to(new_xeno) if(new_xeno.health - getBruteLoss(src) - getFireLoss(src) > 0) //Cmon, don't kill the new one! Shouldnt be possible though diff --git a/code/modules/mob/living/carbon/xenomorph/hive_upgrades.dm b/code/modules/mob/living/carbon/xenomorph/hive_upgrades.dm index 562bb3cdb04..f0bfd843dd6 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_upgrades.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_upgrades.dm @@ -250,6 +250,7 @@ GLOBAL_LIST_INIT(tier_to_primo_upgrade, list( /datum/hive_upgrade/building/upgrade_chamber flags_upgrade = ABILITY_NUCLEARWAR + building_loc = 0 var/max_chambers = 3 /datum/hive_upgrade/building/upgrade_chamber/shell diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm index d669faf858f..8f4633a241a 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm @@ -346,6 +346,8 @@ GLOBAL_LIST_INIT(strain_list, init_glob_strain_list()) var/regen_power = 0 ///Stored biomass var/biomass = 0 + ///Stored upgrade effects, so we reapply them on evolve + var/list/upgrades_holder = list() var/is_zoomed = FALSE var/zoom_turf = null diff --git a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm index 075d4614579..39cd5486daf 100644 --- a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm +++ b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm @@ -659,16 +659,7 @@ get_upgrades(src) /mob/living/carbon/xenomorph/proc/get_upgrades(mob/living/carbon/xenomorph/user) - var/upgrade_price - switch(xeno_caste.tier) - if(XENO_TIER_ONE) - upgrade_price = XENO_UPGRADE_BIOMASS_COST_T1 - if(XENO_TIER_TWO) - upgrade_price = XENO_UPGRADE_BIOMASS_COST_T2 - if(XENO_TIER_THREE) - upgrade_price = XENO_UPGRADE_BIOMASS_COST_T3 - else - upgrade_price = XENO_UPGRADE_BIOMASS_COST_T4 + var/upgrade_price = XENO_UPGRADE_COST var/dat = "
" dat += "
Active Upgrade Chambers:" @@ -702,17 +693,7 @@ if(incapacitated(TRUE)) to_chat(usr, span_warning("Cant do that right now!")) return - var/upgrade_price - switch(xeno_caste.tier) - if(XENO_TIER_ONE) - upgrade_price = XENO_UPGRADE_BIOMASS_COST_T1 - if(XENO_TIER_TWO) - upgrade_price = XENO_UPGRADE_BIOMASS_COST_T2 - if(XENO_TIER_THREE) - upgrade_price = XENO_UPGRADE_BIOMASS_COST_T3 - else - upgrade_price = XENO_UPGRADE_BIOMASS_COST_T4 - if(biomass < upgrade_price) + if(biomass < XENO_UPGRADE_COST) to_chat(usr, span_warning("You dont have enough biomass!")) return var/upgrade = locate(upgrade_to_apply) in status_effects @@ -720,12 +701,14 @@ to_chat(usr, span_xenonotice("Existing mutation chosen. No biomass spent.")) DIRECT_OUTPUT(usr, browse(null, "window=["upgrademenu"]")) return - biomass -= upgrade_price + biomass -= XENO_UPGRADE_COST to_chat(usr, span_xenonotice("Mutation gained.")) for(var/datum/status_effect/S AS in upgrades_to_remove) remove_status_effect(S) + upgrades_holder.Remove(S.type) do_jitter_animation(500) apply_status_effect(upgrade_to_apply) + upgrades_holder.Add(upgrade_to_apply.type) DIRECT_OUTPUT(usr, browse(null, "window=["upgrademenu"]")) //Special override case. May not call the parent. From 582e9bfe5f266767af66c7cf66ab5b0c2668e4b0 Mon Sep 17 00:00:00 2001 From: homexp13 Date: Wed, 20 Nov 2024 09:13:48 +0300 Subject: [PATCH 2/2] XENO_UPGRADE_COST --- .../mob/living/carbon/xenomorph/xenoprocs.dm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm index 39cd5486daf..9278bafa11d 100644 --- a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm +++ b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm @@ -659,7 +659,6 @@ get_upgrades(src) /mob/living/carbon/xenomorph/proc/get_upgrades(mob/living/carbon/xenomorph/user) - var/upgrade_price = XENO_UPGRADE_COST var/dat = "
" dat += "
Active Upgrade Chambers:" @@ -673,17 +672,17 @@ var/spur_chambers_built = length(user?.hive?.spur_chambers) var/veil_chambers_built = length(user?.hive?.veil_chambers) dat += "
SURVIVAL
" - dat += "[shell_chambers_built ? "
Carapace " : "
Carapace "] | Cost: [upgrade_price] | Increase our armor." - dat += "[shell_chambers_built ? "
Regeneration " : "
Regeneration "] | Cost: [upgrade_price] | Increase our health regeneration." - dat += "[shell_chambers_built ? "
Vampirism " : "
Vampirism "] | Cost: [upgrade_price] | Leech from our attacks." + dat += "[shell_chambers_built ? "
Carapace " : "
Carapace "] | Cost: [XENO_UPGRADE_COST] | Increase our armor." + dat += "[shell_chambers_built ? "
Regeneration " : "
Regeneration "] | Cost: [XENO_UPGRADE_COST] | Increase our health regeneration." + dat += "[shell_chambers_built ? "
Vampirism " : "
Vampirism "] | Cost: [XENO_UPGRADE_COST] | Leech from our attacks." dat += "
ATTACK
" - dat += "[spur_chambers_built ? "
Celerity " : "
Celerity "] | Cost: [upgrade_price] | Increase our movement speed." - dat += "[spur_chambers_built ? "
Adrenalin " : "
Adrenalin "] | Cost: [upgrade_price] | Increase our plasma regeneration." - dat += "[spur_chambers_built ? "
Crush " : "
Crush "] | Cost: [upgrade_price] | Increase our damage to objects." + dat += "[spur_chambers_built ? "
Celerity " : "
Celerity "] | Cost: [XENO_UPGRADE_COST] | Increase our movement speed." + dat += "[spur_chambers_built ? "
Adrenalin " : "
Adrenalin "] | Cost: [XENO_UPGRADE_COST] | Increase our plasma regeneration." + dat += "[spur_chambers_built ? "
Crush " : "
Crush "] | Cost: [XENO_UPGRADE_COST] | Increase our damage to objects." dat += "
UTILITY
" - dat += "[veil_chambers_built ? "
Toxin " : "
Toxin "] | Cost: [upgrade_price] | Inject neurotoxin into the target." - dat += "[veil_chambers_built ? "
Pheromones " : "
Pheromones "] | Cost: [upgrade_price] | Ability to emit pheromones." - dat += "[veil_chambers_built ? "
Trail " : "
Trail "] | Cost: [upgrade_price] | Leave a trail behind." + dat += "[veil_chambers_built ? "
Toxin " : "
Toxin "] | Cost: [XENO_UPGRADE_COST] | Inject neurotoxin into the target." + dat += "[veil_chambers_built ? "
Pheromones " : "
Pheromones "] | Cost: [XENO_UPGRADE_COST] | Ability to emit pheromones." + dat += "[veil_chambers_built ? "
Trail " : "
Trail "] | Cost: [XENO_UPGRADE_COST] | Leave a trail behind." var/datum/browser/popup = new(user, "upgrademenu", "
Mutations Menu
", 600, 600) popup.set_content(dat)