Skip to content

Commit

Permalink
Mutation qol (#675)
Browse files Browse the repository at this point in the history
* UPGRADE

* XENO_UPGRADE_COST

---------

Signed-off-by: Helg2 <[email protected]>
Co-authored-by: Helg2 <[email protected]>
  • Loading branch information
homexp13 and Helg2 authored Dec 2, 2024
1 parent c695a3d commit eb87b92
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 35 deletions.
5 changes: 1 addition & 4 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,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 @@ -167,6 +167,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)
new_xeno.generate_name() // This is specifically for numbered xenos who want to keep their previous number instead of a random new one.
new_xeno.hive?.update_ruler() // Since ruler wasn't set during initialization, update ruler now.
transfer_observers_to(new_xeno)
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
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 @@ -350,6 +350,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 @@ -657,16 +657,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 @@ -680,17 +670,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 @@ -700,30 +690,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)
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

0 comments on commit eb87b92

Please sign in to comment.