index.js
/**
 * Queries the field while matching the functionality of the original OCGCore
 * @param {string} id 
 * @param {number} length 
 */
Queries the field while matching the functionality of the original OCGCore
@param {string} id
@param {number} length
Queries the field while matching the functionality of the original OCGCore @param { string } id @param { number } length
function duelQueryField (id, length) {
    const duel = duels[id];
    let query;
    query.push(duel.game_field.core.duel_options);
    duel.game_field.player.forEach(function (p) {
        p.list_mzone.forEach(function (card) {
            if (card) {
                query.push(1);
                query.push(card.current.position);
                query.push(card.xyz_materials.length());
            } else {
                query.push(0);
            }
        })
        p.list_szone.forEach(function (card) {
            if (card) {
                query.push(1);
                query.push(card.current.position);
                query.push(card.xyz_materials.length());
            } else {
                query.push(0);
            }
        })
        query.push(p.list_main.length());
        query.push(p.list_hand.length());
        query.push(p.list_grave.length());
        query.push(p.list_remove.length());
        query.push(p.list_extra.length());
        query.push(p.extra_p_count);
    })
    query.push(duel.game_field.core.current_chain.length());
    duel.game_field.core.current_chain.forEach(function (chain) {
        const effect = chain.triggering_effect;
        query.push(effect.get_handler().data.code);
        info = effect.get_handler().get_info_location();
        query.push(info.controller);
        query.push(info.location);
        query.push(info.sequence);
        query.push(info.position);
        query.push(chain.triggering_controller);
        query.push(Number(chain.triggering_location));
        query.push(chain.triggering_sequence);
        query.push(effect.description);
    })
    return query;
}
function duelQueryField ( id , length ) { const duel = duels [ id ] ; let query ; query . push ( duel . game_field . core . duel_options ) ; duel . game_field . player . forEach ( function ( p ) { p . list_mzone . forEach ( function ( card ) { if ( card ) { query . push ( 1 ) ; query . push ( card . current . position ) ; query . push ( card . xyz_materials . length ( ) ) ; } else { query . push ( 0 ) ; } } ) p . list_szone . forEach ( function ( card ) { if ( card ) { query . push ( 1 ) ; query . push ( card . current . position ) ; query . push ( card . xyz_materials . length ( ) ) ; } else { query . push ( 0 ) ; } } ) query . push ( p . list_main . length ( ) ) ; query . push ( p . list_hand . length ( ) ) ; query . push ( p . list_grave . length ( ) ) ; query . push ( p . list_remove . length ( ) ) ; query . push ( p . list_extra . length ( ) ) ; query . push ( p . extra_p_count ) ; } ) query . push ( duel . game_field . core . current_chain . length ( ) ) ; duel . game_field . core . current_chain . forEach ( function ( chain ) { const effect = chain . triggering_effect ; query . push ( effect . get_handler ( ) . data . code ) ; info = effect . get_handler ( ) . get_info_location ( ) ; query . push ( info . controller ) ; query . push ( info . location ) ; query . push ( info . sequence ) ; query . push ( info . position ) ; query . push ( chain . triggering_controller ) ; query . push ( Number ( chain . triggering_location ) ) ; query . push ( chain . triggering_sequence ) ; query . push ( effect . description ) ; } ) return query ; }
Queries the field while matching the functionality of the original OCGCore
 @param {string} id
 @param {number} length
Queries the field while matching the functionality of the original OCGCore @param { string } id @param { number } length
// Initial query push // Get the total cards on the field // Push the number of chains to resolve // Query the current field