Skip to content

Commit d2fc6de

Browse files
Update dynamic_rulesets_roundstart.dm (#38014)
1 parent a7db72b commit d2fc6de

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

code/datums/gamemode/dynamic/dynamic_rulesets_roundstart.dm

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,25 @@
148148
weight = BASE_RULESET_WEIGHT
149149
weight_category = "Changeling"
150150
cost = 18
151+
var/additional_cost = 9
152+
var/maximum_lings = 2
153+
var/pop_per_ling = 12
151154
requirements = list(80,70,60,60,30,20,10,10,10,10)
152155
high_population_requirement = 30
153156

154157
// -- Currently a copypaste of traitors. Could be fixed to be less copy & paste.
155158
/datum/dynamic_ruleset/roundstart/changeling/choose_candidates()
156-
var/mob/M = pick(candidates)
157-
assigned += M
158-
candidates -= M
159+
//Check to see how many lings the ruleset supports and if there are enough candidates.
160+
var/num_changelings = min(min(floor(mode.roundstart_pop_ready / pop_per_ling), maximum_lings), candidates.len)
161+
for (var/i = 1 to num_changelings)
162+
if(i > 1)
163+
if((mode.threat > additional_cost))
164+
mode.spend_threat(additional_cost)
165+
else
166+
break
167+
var/mob/M = pick(candidates)
168+
assigned += M
169+
candidates -= M
159170
return (assigned.len > 0)
160171

161172
/datum/dynamic_ruleset/roundstart/changeling/execute()

0 commit comments

Comments
 (0)