File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,20 @@ function card.add_seen()
204204 seen = seen + 1
205205 draw_pile [seen ], draw_pile [idx ] = draw_pile [idx ], draw_pile [seen ]
206206 GAME .seen = seen
207+ else
208+ -- draw a random card from discard pile into draw pile
209+ -- See https://github.com/cloudwu/deepfuture/issues/63
210+ assert (# draw_pile == seen )
211+ local discard_pile = GAME .discard
212+ local discard_n = # discard_pile
213+ if discard_n > 0 then
214+ local idx = math.random (discard_n )
215+ seen = seen + 1
216+ draw_pile [seen ] = discard_pile [idx ]
217+ discard_pile [idx ] = discard_pile [discard_n ]
218+ discard_pile [discard_n ] = nil
219+ GAME .seen = seen
220+ end
207221 end
208222 return seen
209223end
Original file line number Diff line number Diff line change @@ -566,7 +566,7 @@ function adv_check.infrastructure()
566566end
567567
568568function adv_check .history ()
569- return card .count " draw" - card .seen () > 0
569+ return card .count " draw" + card . count " discard " - card .seen () > 0
570570end
571571
572572function adv_check .economy ()
You can’t perform that action at this time.
0 commit comments