@@ -609,8 +609,23 @@ export async function take_action(game) {
609
609
}
610
610
611
611
// Discard known trash at high pace, low clues
612
- if ( best_playable_order === undefined && trash_orders . length > 0 && state . pace > state . numPlayers * 2 && state . clue_tokens <= 2 )
612
+ if ( best_playable_order === undefined && trash_orders . length > 0 && state . pace > state . numPlayers * 2 && state . clue_tokens <= 2 ) {
613
+ // check if a TOCM would be better than not doing a TOCM, starting from Bob
614
+ let player_check_index = state . nextPlayerIndex ( state . ourPlayerIndex ) ;
615
+ if ( trash_orders . length >= 2 && game . level >= LEVEL . TRASH_PUSH ) {
616
+ for ( let i = 1 ; i < trash_orders . length ; i ++ ) {
617
+ const next_chop = me . chop ( state . hands [ player_check_index ] ) ;
618
+ const chop_value = cardValue ( state , me , state . deck [ next_chop ] , next_chop ) ;
619
+ const new_chop_value = me . withThoughts ( next_chop , ( draft ) => { draft . chop_moved = true ; } ) . chopValue ( state , nextPlayerIndex ) ;
620
+ if ( new_chop_value < chop_value && chop_value >= 1 ) {
621
+ return { tableID, type : ACTION . DISCARD , target : trash_orders [ i ] } ;
622
+ }
623
+ player_check_index = state . nextPlayerIndex ( player_check_index ) ;
624
+ }
625
+ }
626
+
613
627
return { tableID, type : ACTION . DISCARD , target : trash_orders [ 0 ] } ;
628
+ }
614
629
615
630
// Shout Discard on a valuable card that moves chop to trash
616
631
const next_chop = me . chop ( state . hands [ nextPlayerIndex ] ) ;
@@ -698,8 +713,22 @@ export async function take_action(game) {
698
713
}
699
714
700
715
// Discard known trash (no pace requirement)
701
- if ( trash_orders . length > 0 && ! state . inEndgame ( ) && state . clue_tokens < 8 )
716
+ if ( trash_orders . length > 0 && ! state . inEndgame ( ) && state . clue_tokens < 8 ) {
717
+ // check if a TOCM would be better than not doing a TOCM, starting from Bob
718
+ let player_check_index = state . nextPlayerIndex ( state . ourPlayerIndex ) ;
719
+ if ( trash_orders . length >= 2 && game . level >= LEVEL . TRASH_PUSH ) {
720
+ for ( let i = 1 ; i < trash_orders . length ; i ++ ) {
721
+ const next_chop = me . chop ( state . hands [ player_check_index ] ) ;
722
+ const chop_value = cardValue ( state , me , state . deck [ next_chop ] , next_chop ) ;
723
+ const new_chop_value = me . withThoughts ( next_chop , ( draft ) => { draft . chop_moved = true ; } ) . chopValue ( state , nextPlayerIndex ) ;
724
+ if ( new_chop_value < chop_value && chop_value >= 1 ) {
725
+ return { tableID, type : ACTION . DISCARD , target : trash_orders [ i ] } ;
726
+ }
727
+ player_check_index = state . nextPlayerIndex ( player_check_index ) ;
728
+ }
729
+ }
702
730
return { tableID, type : ACTION . DISCARD , target : trash_orders [ 0 ] } ;
731
+ }
703
732
704
733
// Early save
705
734
if ( state . clue_tokens > 0 && urgent_actions [ actionPrioritySize * 2 ] . length > 0 )
0 commit comments