diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 54360d7a231..473f6430885 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -43,6 +43,10 @@ /// Kudzu spread multiplier is a reciporal function of production speed, such that the better the production speed, ie. the lower the speed value is, the faster it spreads #define SPREAD_MULTIPLIER_MAX 50 +/// Kudzu's maximum possible maximum mutation severity (assuming ideal potency), used to balance mutation appearance chance +#define IDEAL_MAX_SEVERITY 20 + + /datum/round_event_control/spacevine name = "Space Vines" typepath = /datum/round_event/spacevine @@ -525,7 +529,7 @@ var/spread_multiplier = 5 // corresponds to artifical kudzu with production speed of 1, approaches 10% of total vines will spread per second ///Maximum spreading limit (ie. how many kudzu can there be) for this controller var/spread_cap = 30 // corresponds to artifical kudzu with production speed of 3.5 - var/list/vine_mutations_list + var/static/list/vine_mutations_list var/mutativeness = 1 ///Maximum sum of mutation severities var/max_mutation_severity = 20 @@ -540,10 +544,11 @@ if(event) event.announce_to_ghosts(vine) START_PROCESSING(SSobj, src) - vine_mutations_list = list() - init_subtypes(/datum/spacevine_mutation/, vine_mutations_list) - for(var/datum/spacevine_mutation/mutation as anything in vine_mutations_list) - vine_mutations_list[mutation] = max_mutation_severity - mutation.severity // this is intended to be before the potency check as the ideal maximum potency is used for weighting + if(!vine_mutations_list) + vine_mutations_list = list() + init_subtypes(/datum/spacevine_mutation/, vine_mutations_list) + for(var/datum/spacevine_mutation/mutation as anything in vine_mutations_list) + vine_mutations_list[mutation] = IDEAL_MAX_SEVERITY - mutation.severity // the ideal maximum potency is used for weighting if(potency != null) mutativeness = potency * MUTATIVENESS_SCALE_FACTOR // If potency is 100, 20 mutativeness; if 1: 0.2 mutativeness max_mutation_severity = round(potency * MAX_SEVERITY_LINEAR_COEFF + MAX_SEVERITY_CONSTANT_TERM) // If potency is 100, 25 max mutation severity; if 1, 10 max mutation severity @@ -760,4 +765,5 @@ #undef SPREAD_CAP_LINEAR_COEFF #undef SPREAD_CAP_CONSTANT_TERM #undef SPREAD_MULTIPLIER_MAX +#undef IDEAL_MAX_SEVERITY */ diff --git a/modular_skyrat/master_files/code/modules/events/spacevine.dm b/modular_skyrat/master_files/code/modules/events/spacevine.dm index 1d72fe39d5e..2697cc281cc 100644 --- a/modular_skyrat/master_files/code/modules/events/spacevine.dm +++ b/modular_skyrat/master_files/code/modules/events/spacevine.dm @@ -36,6 +36,10 @@ /// Kudzu spread multiplier is a reciporal function of production speed, such that the better the production speed, ie. the lower the speed value is, the faster it spreads #define SPREAD_MULTIPLIER_MAX 50 +/// Kudzu's maximum possible maximum mutation severity (assuming ideal potency), used to balance mutation appearance chance +#define IDEAL_MAX_SEVERITY 20 + + /datum/round_event_control/spacevine name = "Space Vines" typepath = /datum/round_event/spacevine @@ -767,7 +771,7 @@ /// The actual cap to how quickly it spreads. var/spread_cap = 30 /// A referenced list to all of the current mutations the vine has! - var/list/vine_mutations_list + var/list/static/vine_mutations_list /// How likely it is to mutate! var/mutativeness = 1 @@ -779,8 +783,9 @@ if (event) event.announce_to_ghosts(spawned_vine) START_PROCESSING(SSobj, src) - vine_mutations_list = list() - init_subtypes(/datum/spacevine_mutation/, vine_mutations_list) + if(!vine_mutations_list) + vine_mutations_list = list() + init_subtypes(/datum/spacevine_mutation/, vine_mutations_list) if(potency != null) mutativeness = potency / 10 if(production != null && production <= 10) // Prevents runtime in case production is set to 11. @@ -986,3 +991,4 @@ #undef SEVERITY_AVERAGE #undef SEVERITY_ABOVE_AVERAGE #undef SEVERITY_MAJOR +#undef IDEAL_MAX_SEVERITY