mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Kudzu Fixes v4, hopefully the last one: Fix kudzu possibly obtaining duplicate mutations when being planted from a seed that already has mutations (#68821)
See title, parent mutations that come from vines that came from seeds which came from a different master controller, hence the different addresses.
This commit is contained in:
@@ -42,6 +42,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
|
||||
@@ -524,7 +528,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
|
||||
@@ -539,10 +543,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,3 +765,4 @@
|
||||
#undef SPREAD_CAP_LINEAR_COEFF
|
||||
#undef SPREAD_CAP_CONSTANT_TERM
|
||||
#undef SPREAD_MULTIPLIER_MAX
|
||||
#undef IDEAL_MAX_SEVERITY
|
||||
|
||||
Reference in New Issue
Block a user