Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutation qol #675

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/evolution.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/xenomorph/hive_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Helg2 marked this conversation as resolved.
Show resolved Hide resolved
var/max_chambers = 3

/datum/hive_upgrade/building/upgrade_chamber/shell
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 13 additions & 31 deletions code/modules/mob/living/carbon/xenomorph/xenoprocs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -659,16 +659,6 @@
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/dat = "<div align='center'>"

dat += "<hr>Active Upgrade Chambers:"
Expand All @@ -682,17 +672,17 @@
var/spur_chambers_built = length(user?.hive?.spur_chambers)
var/veil_chambers_built = length(user?.hive?.veil_chambers)
dat += "<div align='center'>SURVIVAL</div>"
dat += "[shell_chambers_built ? "<br><a href='?src=[text_ref(src)];carapace_buy=1'>Carapace</a> " : "<br>Carapace "] | Cost: [upgrade_price] | Increase our armor."
dat += "[shell_chambers_built ? "<br><a href='?src=[text_ref(src)];regeneration_buy=1'>Regeneration</a> " : "<br>Regeneration "] | Cost: [upgrade_price] | Increase our health regeneration."
dat += "[shell_chambers_built ? "<br><a href='?src=[text_ref(src)];vampirism_buy=1'>Vampirism</a> " : "<br>Vampirism "] | Cost: [upgrade_price] | Leech from our attacks."
dat += "[shell_chambers_built ? "<br><a href='?src=[text_ref(src)];carapace_buy=1'>Carapace</a> " : "<br>Carapace "] | Cost: [XENO_UPGRADE_COST] | Increase our armor."
dat += "[shell_chambers_built ? "<br><a href='?src=[text_ref(src)];regeneration_buy=1'>Regeneration</a> " : "<br>Regeneration "] | Cost: [XENO_UPGRADE_COST] | Increase our health regeneration."
dat += "[shell_chambers_built ? "<br><a href='?src=[text_ref(src)];vampirism_buy=1'>Vampirism</a> " : "<br>Vampirism "] | Cost: [XENO_UPGRADE_COST] | Leech from our attacks."
dat += "<div align='center'>ATTACK</div>"
dat += "[spur_chambers_built ? "<br><a href='?src=[text_ref(src)];celerity_buy=1'>Celerity</a> " : "<br>Celerity "] | Cost: [upgrade_price] | Increase our movement speed."
dat += "[spur_chambers_built ? "<br><a href='?src=[text_ref(src)];adrenalin_buy=1'>Adrenalin</a> " : "<br>Adrenalin "] | Cost: [upgrade_price] | Increase our plasma regeneration."
dat += "[spur_chambers_built ? "<br><a href='?src=[text_ref(src)];crush_buy=1'>Crush</a> " : "<br>Crush "] | Cost: [upgrade_price] | Increase our damage to objects."
dat += "[spur_chambers_built ? "<br><a href='?src=[text_ref(src)];celerity_buy=1'>Celerity</a> " : "<br>Celerity "] | Cost: [XENO_UPGRADE_COST] | Increase our movement speed."
dat += "[spur_chambers_built ? "<br><a href='?src=[text_ref(src)];adrenalin_buy=1'>Adrenalin</a> " : "<br>Adrenalin "] | Cost: [XENO_UPGRADE_COST] | Increase our plasma regeneration."
dat += "[spur_chambers_built ? "<br><a href='?src=[text_ref(src)];crush_buy=1'>Crush</a> " : "<br>Crush "] | Cost: [XENO_UPGRADE_COST] | Increase our damage to objects."
dat += "<div align='center'>UTILITY</div>"
dat += "[veil_chambers_built ? "<br><a href='?src=[text_ref(src)];toxin_buy=1'>Toxin</a> " : "<br>Toxin "] | Cost: [upgrade_price] | Inject neurotoxin into the target."
dat += "[veil_chambers_built ? "<br><a href='?src=[text_ref(src)];phero_buy=1'>Pheromones</a> " : "<br>Pheromones "] | Cost: [upgrade_price] | Ability to emit pheromones."
dat += "[veil_chambers_built ? "<br><a href='?src=[text_ref(src)];trail_buy=1'>Trail</a> " : "<br>Trail "] | Cost: [upgrade_price] | Leave a trail behind."
dat += "[veil_chambers_built ? "<br><a href='?src=[text_ref(src)];toxin_buy=1'>Toxin</a> " : "<br>Toxin "] | Cost: [XENO_UPGRADE_COST] | Inject neurotoxin into the target."
dat += "[veil_chambers_built ? "<br><a href='?src=[text_ref(src)];phero_buy=1'>Pheromones</a> " : "<br>Pheromones "] | Cost: [XENO_UPGRADE_COST] | Ability to emit pheromones."
dat += "[veil_chambers_built ? "<br><a href='?src=[text_ref(src)];trail_buy=1'>Trail</a> " : "<br>Trail "] | Cost: [XENO_UPGRADE_COST] | Leave a trail behind."

var/datum/browser/popup = new(user, "upgrademenu", "<div align='center'>Mutations Menu</div>", 600, 600)
popup.set_content(dat)
Expand All @@ -702,30 +692,22 @@
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)
Helg2 marked this conversation as resolved.
Show resolved Hide resolved
to_chat(usr, span_warning("You dont have enough biomass!"))
return
var/upgrade = locate(upgrade_to_apply) in status_effects
if(upgrade)
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.
Expand Down
Loading