@n1xx1/ocgcore-wasm@0.0.29Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
n1xx1/ocgcore-wasmProjectIgnis' EDOPro Core built for WebAssembly using emscripten.
This package works with Node.js, Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Bun
JSR Score
88%
Published
6 months ago (0.0.29)
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021/** * Utility function to check if the specified card matches the opcode sequence. * @param card - The card to check against * @param opcodes - The opcode sequence */ export declare function cardMatchesOpcode(card: OcgCardData, opcodes: OcgOpCode[]): boolean; /** * Instantiate the basic interface to use ygocore. * @param options - Options. sync: Whether to use the sync interface or not. Defaults to false (async). */ declare function createCore(options?: InitializerAsync): Promise<OcgCore>; /** * Instantiate the basic interface to use ygocore. * @param options - Options. sync: Whether to use the sync interface or not. Defaults to false (async). */ declare function createCore(options: InitializerSync): Promise<OcgCoreSync>; export default createCore; declare const DuelHandleSymbol: unique symbol; /** * The initializer to create a core. If both {@link Initializer.locateFile} and * {@link Initializer.wasmBinary} are missing then it will be imported * automatically. */ export declare interface Initializer { /** Override the stdout print */ print?(str: string): void; /** Override the stderr print */ printErr?(str: string): void; /** {@link https://emscripten.org/docs/api_reference/module.html#Module.locateFile} */ locateFile?(url: string, scriptDirectory: string): string; /** The binary of the wasm module */ wasmBinary?: ArrayBuffer; sync?: boolean; } /** Initialize async version */ export declare type InitializerAsync = Omit<Initializer, "sync"> & { sync?: false; }; /** Initialize sync version */ export declare type InitializerSync = Omit<Initializer, "sync"> & { sync: true; }; export declare type InternalDepromisifyFunction<Fn> = Fn extends (...args: infer Args) => infer Ret ? (...args: Args) => Awaited<Ret> : Fn; export declare type InternalMappedMap<E extends readonly (readonly [any, any])[]> = Omit<Map<E[any][0], E[any][1]>, "get"> & { get<K extends E[any][0]>(this: InternalMappedMap<E>, key: K): Extract<E[any], readonly [K, any]>[1]; }; /** Monster card attribute. */ export declare type OcgAttribute = (typeof OcgAttribute)[keyof typeof OcgAttribute]; /** Monster card attribute. */ export declare const OcgAttribute: { /** Earth. */ readonly EARTH: 1; /** Water. */ readonly WATER: 2; /** Fire. */ readonly FIRE: 4; /** Wind. */ readonly WIND: 8; /** Light. */ readonly LIGHT: 16; /** Dark. */ readonly DARK: 32; /** Divine. */ readonly DIVINE: 64; }; /** * Parse a {@link (OcgAttribute:type)} mask and return the matching attributes. * @param attribute - The mask to parse. */ export declare function ocgAttributeParse(attribute: OcgAttribute): (2 | 1 | 4 | 8 | 16 | 32 | 64)[]; export declare const ocgAttributeString: InternalMappedMap<readonly [readonly [1, "earth"], readonly [2, "water"], readonly [4, "fire"], readonly [8, "wind"], readonly [16, "light"], readonly [32, "dark"], readonly [64, "divine"]]>; /** * Card data definition. These values should be imported as is from the * cards.cdb of the card database you want to use. These will be requested * in {@link OcgDuelOptions#cardReader}. * * EdoPro card database: {@link https://github.com/ProjectIgnis/BabelCDB} */ export declare interface OcgCardData { /** Passcode. */ code: number; /** The passcode alias, 0 if it doesn't have any. */ alias: number; /** Codes of all the sets (archetypes) this card is a part of. */ setcodes: number[]; /** Card type. */ type: OcgType | (number & {}); /** Level, rank or link rating, 0 if not applicable. */ level: number; /** Monster attribute, 0 if not applicable. */ attribute: OcgAttribute | (number & {}); /** Monster race, 0 if not applicable. */ race: OcgRace | (bigint & {}); /** Monster card attack, 0 if not applicable. */ attack: number; /** Monster card defense, 0 if not applicable. */ defense: number; /** Left pendulum scale, 0 if not applicable. */ lscale: number; /** Right pendulum scale, 0 if not applicable. */ rscale: number; /** Link markers bitmask. */ link_marker: OcgLinkMarker | (number & {}); } export declare enum OcgCardHintType { TURN = 1, CARD = 2, RACE = 3, ATTRIBUTE = 4, NUMBER = 5, DESC_ADD = 6, DESC_REMOVE = 7 } export declare const ocgCardHintTypeStrings: InternalMappedMap<readonly [readonly [OcgCardHintType.TURN, "turn"], readonly [OcgCardHintType.CARD, "card"], readonly [OcgCardHintType.RACE, "race"], readonly [OcgCardHintType.ATTRIBUTE, "attribute"], readonly [OcgCardHintType.NUMBER, "number"], readonly [OcgCardHintType.DESC_ADD, "desc_add"], readonly [OcgCardHintType.DESC_REMOVE, "desc_remove"]]>; /** Card passcode, location. */ export declare interface OcgCardLoc { code: number; controller: 0 | 1; location: OcgLocation; sequence: number; } /** Card passcode, location, effect activation info. */ export declare interface OcgCardLocActive extends OcgCardLoc { description: bigint; client_mode: OcgEffectClientMode; } /** Card passcode, location, attack info. */ export declare interface OcgCardLocAttack extends OcgCardLoc { can_direct: boolean; } /** Card passcode, location, battle stats. */ export declare interface OcgCardLocBattle extends OcgLocPos { attack: number; defense: number; destroyed: boolean; } /** Card passcode, location, counter info. */ export declare interface OcgCardLocCounter extends OcgCardLoc { count: number; } /** Card passcode, location, position. */ export declare interface OcgCardLocPos extends OcgCardLoc { position: OcgPosition; overlay_sequence?: number; } /** Card passcode, location, position, activation info. */ export declare interface OcgCardLocPosActive extends OcgCardLocPos { description: bigint; client_mode: OcgEffectClientMode; } /** Card passcode, location, sum info */ export declare interface OcgCardLocSum extends OcgCardLoc { amount: number; } /** Card passcode, location, tribute info. */ export declare interface OcgCardLocTribute extends OcgCardLoc { release_param: number; } /** Card passcode and position. */ export declare interface OcgCardPos { code: number; position: OcgPosition; } export declare type OcgCardQueryInfo = { /** Passcode, requested by {@link OcgQueryFlags#CODE}. */ code?: number; /** Position, requested by {@link OcgQueryFlags#POSITION}. */ position?: OcgPosition; /** Alias, requested by {@link OcgQueryFlags#ALIAS}. */ alias?: number; /** Type, requested by {@link OcgQueryFlags#TYPE}. */ type?: OcgType; /** Level, requested by {@link OcgQueryFlags#LEVEL}. */ level?: number; /** Rank, requested by {@link OcgQueryFlags#RANK}. */ rank?: number; /** Attribute, requested by {@link OcgQueryFlags#ATTRIBUTE}. */ attribute?: OcgAttribute; /** Race, requested by {@link OcgQueryFlags#RACE}. */ race?: OcgRace; /** Attack, requested by {@link OcgQueryFlags#ATTACK}. */ attack?: number; /** Defense, requested by {@link OcgQueryFlags#DEFENSE}. */ defense?: number; /** Base attack, requested by {@link OcgQueryFlags#BASE_ATTACK}. */ baseAttack?: number; /** Base defense, requested by {@link OcgQueryFlags#BASE_DEFENSE}. */ baseDefense?: number; /** Reason, requested by {@link OcgQueryFlags#REASON}. */ reason?: number; /** Cover, requested by {@link OcgQueryFlags#COVER}. */ cover?: number; /** Reason card, requested by {@link OcgQueryFlags#REASON_CARD}. */ reasonCard?: OcgCardQueryInfoCard | null; /** Equip card, requested by {@link OcgQueryFlags#EQUIP_CARD}. */ equipCard?: OcgCardQueryInfoCard | null; /** Target cards, requested by {@link OcgQueryFlags#TARGET_CARD}. */ targetCards?: OcgCardQueryInfoCard[]; /** Overlay card codes, requested by {@link OcgQueryFlags#OVERLAY_CARD}. */ overlayCards?: number[]; /** Counters, requested by {@link OcgQueryFlags#COUNTERS}. */ counters?: Record<number, number>; /** Owner, requested by {@link OcgQueryFlags#OWNER}. */ owner?: number; /** Status, requested by {@link OcgQueryFlags#STATUS}. */ status?: number; /** Is public, requested by {@link OcgQueryFlags#IS_PUBLIC}. */ isPublic?: boolean; /** Left scale, requested by {@link OcgQueryFlags#LSCALE}. */ leftScale?: number; /** Right scale, requested by {@link OcgQueryFlags#RSCALE}. */ rightScale?: number; /** Link arrows, requested by {@link OcgQueryFlags#LINK}. */ link?: { /** Rating. */ rating: number; /** Link arrows mask. */ marker: OcgLinkMarker; }; /** Is hidden, requested by {@link OcgQueryFlags#IS_HIDDEN}. */ isHidden?: boolean; }; /** Returned cards by {@link OcgCardQueryInfo}. */ export declare interface OcgCardQueryInfoCard { /** Controller. */ controller: 0 | 1; /** Location. */ location: OcgLocation; /** Sequence. */ sequence: number; /** Position. */ position: OcgPosition; } /** Card passcode, location, position, chain info. */ export declare interface OcgChain extends OcgCardLocPos { triggering_controller: 0 | 1; triggering_location: OcgLocation; triggering_sequence: number; description: bigint; } /** OcgCore interface. */ export declare interface OcgCore { /** * Request the ocgcore version. * @returns The [major, minor] version tuple. */ getVersion(): readonly [number, number]; /** * Create a duel instance. * @param options - Creation options. * @returns null if the creation failed, a duel handle otherwise. */ createDuel(options: OcgDuelOptions): Promise<OcgDuelHandle | null>; /** * Deallocates the specified duel. * @param handle - A duel handle. */ destroyDuel(handle: OcgDuelHandle): void; /** * Add a new card to the duel. * @param handle - A duel handle. * @param cardInfo - The card that will be added. */ duelNewCard(handle: OcgDuelHandle, cardInfo: OcgNewCardInfo): Promise<void>; /** * Triggers the start of the duel. * @param handle - A duel handle. */ startDuel(handle: OcgDuelHandle): Promise<void>; /** * Performs a process step of the duel. * @param handle - A duel handle. * @returns The result of the process step. * * ```ts * while (true) { * const status = await lib.duelProcess(handle); * const messages = lib.duelGetMessage(handle); * // handle messages * if (status === OcgProcessResult.END) break; * if (status === OcgProcessResult.CONTINUE) continue; * // reply * } * ``` */ duelProcess(handle: OcgDuelHandle): Promise<OcgProcessResult>; /** * Get the list of the messages between the last two {@link OcgCore#duelProcess} calls. * @param handle - A duel handle. * @returns A list of messages. */ duelGetMessage(handle: OcgDuelHandle): OcgMessage[]; /** * Sets the response, called after {@link OcgCore#duelProcess} returns {@link OcgProcessResult#WAITING}. * @param handle - A duel handle. * @param response - Response object. */ duelSetResponse(handle: OcgDuelHandle, response: OcgResponse): void; /** * Make the core load and execute the specified script. * @param handle - A duel handle * @param name - Name of the loaded script. * @param content - Contents of the loaded script. */ loadScript(handle: OcgDuelHandle, name: string, content: string): Promise<boolean>; /** * Counts the number of card of the specified player and location. * @param handle - A duel handle * @param team - The player to query * @param location - The location to query * @returns The number of cards. */ duelQueryCount(handle: OcgDuelHandle, team: number, location: OcgLocation): number; /** * Queries a specific card pulling only the requested informations ({@link OcgQuery#flags}) * @param handle - A duel handle * @param query - The query request * @returns An object with all the requested infos. */ duelQuery(handle: OcgDuelHandle, query: OcgQuery): Partial<OcgCardQueryInfo> | null; /** * Like {@link OcgCore.duelQuery} but for all the cards in the specified location. * @param handle - A duel handle * @param query - The query request * @returns A list of objects with all the requested infos. */ duelQueryLocation(handle: OcgDuelHandle, query: OcgQueryLocation): (Partial<OcgCardQueryInfo> | null)[]; /** * Queries the current field state. * @param handle - A duel handle * @returns The current field state. */ duelQueryField(handle: OcgDuelHandle): OcgFieldState; } export declare type OcgCoreSync = { [F in keyof Omit<OcgCore, "createDuel">]: InternalDepromisifyFunction<OcgCore[F]>; } & { createDuel: (options: OcgDuelOptionsSync) => OcgDuelHandle | null; }; /** * Internal representation of a duel. */ export declare interface OcgDuelHandle { [DuelHandleSymbol]: number; } /** Duel creation options. */ export declare type OcgDuelMode = (typeof OcgDuelMode)[Exclude<keyof typeof OcgDuelMode, `MODE_${string}`>]; /** Duel creation options. */ export declare const OcgDuelMode: { /** Speed duel ruleset. */ readonly MODE_SPEED: bigint; /** Rush duel ruleset. */ readonly MODE_RUSH: bigint; /** Goat ruleset. */ readonly MODE_GOAT: bigint; /** Master Rule 2 ruleset */ readonly MODE_MR2: bigint; /** Master Rule 3 ruleset */ readonly MODE_MR3: bigint; /** New Master Rule ruleset */ readonly MODE_MR4: bigint; /** New Master Rule (April 2020) ruleset */ readonly MODE_MR5: bigint; /** Master Rule 1 ruleset. */ readonly MODE_MR1: bigint; /** @deprecated Unused. */ readonly TEST_MODE: 1n; /** Allow battle phase in the first turn. */ readonly ATTACK_FIRST_TURN: 2n; /** Continuous traps effects cannot be activated until the end of the chain they're flipped in. */ readonly USE_TRAPS_IN_NEW_CHAIN: 4n; /** After damage calculation substep actually separated sub steps. */ readonly SIX_STEP_BATLLE_STEP: 8n; /** Disable decks shuffling. */ readonly PSEUDO_SHUFFLE: 16n; /** Searching the deck doesn't require knowledge checking. */ readonly TRIGGER_WHEN_PRIVATE_KNOWLEDGE: 32n; /** Automate some responses with a simple AI. */ readonly SIMPLE_AI: 64n; /** Is tag duel. */ readonly RELAY: 128n; /** Master Rule 1 obsolete ignition effects. */ readonly OBSOLETE_IGNITION: 256n; /** Draw on the first turn. */ readonly FIRST_TURN_DRAW: 512n; /** Only allow a single face-up field spell. */ readonly ONE_FACEUP_FIELD: 1024n; /** Enable pendulum zones. */ readonly PZONE: 2048n; /** Pendulum zones are separated from S/T zones. */ readonly SEPARATE_PZONE: 4096n; /** Enable extra monster zone. */ readonly EMZONE: 8192n; /** Fusion, synchro and xyz from the extra deck can go into the main monster zones. */ readonly FSX_MMZONE: 16384n; /** Trap monsters do not take a spell/trap zone aswell as a main monster zone. */ readonly TRAP_MONSTERS_NOT_USE_ZONE: 32768n; /** Return to main deck or extra deck do not trigger "leaving the field" effects. */ readonly RETURN_TO_DECK_TRIGGERS: 65536n; /** Trigger effect cannot be activated if the card is moved to other place. */ readonly TRIGGER_ONLY_IN_LOCATION: 131072n; /** Negated summons and special summons count towards any limit. */ readonly SPSUMMON_ONCE_OLD_NEGATE: 262144n; /** Negated summons and special summons count towards any limit. */ readonly CANNOT_SUMMON_OATH_OLD: 524288n; /** Disable standby phase (rush duels). */ readonly NO_STANDBY_PHASE: 1048576n; /** Disable main phase 2 (rush and speed duels). */ readonly NO_MAIN_PHASE_2: 2097152n; /** Only 3 main monster zones and spell/trap zones (rush and speed duels). */ readonly THREE_COLUMNS_FIELD: 4194304n; /** In draw phase draw until 5 cards in hand (rush duels). */ readonly DRAW_UNTIL_5: 8388608n; /** Disable hand limit checks. */ readonly NO_HAND_LIMIT: 16777216n; /** Remove limit of 1 normal summon per turn (rush duels). */ readonly UNLIMITED_SUMMONS: 33554432n; /** Inverted quick effects priority (rush duels). */ readonly INVERTED_QUICK_PRIORITY: 67108864n; /** The to be equipped monster is not sent to the grave if the equip target is no longer valid (goat duels). */ readonly EQUIP_NOT_SENT_IF_MISSING_TARGET: 134217728n; /** If a 0 atk monster attacks a 0 atk monster, both get destroyed (goat duels). */ readonly ZERO_ATK_DESTROYED: 268435456n; /** Attack replays can be used later (goat duels). */ readonly STORE_ATTACK_REPLAYS: 536870912n; /** One chain per damage sub step (goat duels). */ readonly SINGLE_CHAIN_IN_DAMAGE_SUBSTEP: 1073741824n; /** Cards can be repositioned if the control changed (goat duels). */ readonly CAN_REPOS_IF_NON_SUMPLAYER: 2147483648n; /** TCG Simultaneous Effects Go On Chain for non public knowledge. */ readonly TCG_SEGOC_NONPUBLIC: 4294967296n; /** TCG Simultaneous Effects Go On Chain. */ readonly TCG_SEGOC_FIRSTTRIGGER: 8589934592n; }; /** * Parse a {@link (OcgDuelMode:type)} mask and return the matching options. * @param mode - The mask to parse. */ export declare function ocgDuelModeParse(mode: OcgDuelMode): OcgDuelMode[]; export declare const ocgDuelModeString: InternalMappedMap<readonly [readonly [1n, "test_mode"], readonly [2n, "attack_first_turn"], readonly [4n, "use_traps_in_new_chain"], readonly [8n, "six_step_batlle_step"], readonly [16n, "pseudo_shuffle"], readonly [32n, "trigger_when_private_knowledge"], readonly [64n, "simple_ai"], readonly [128n, "relay"], readonly [256n, "obsolete_ignition"], readonly [512n, "first_turn_draw"], readonly [1024n, "one_faceup_field"], readonly [2048n, "pzone"], readonly [4096n, "separate_pzone"], readonly [8192n, "emzone"], readonly [16384n, "fsx_mmzone"], readonly [32768n, "trap_monsters_not_use_zone"], readonly [65536n, "return_to_extra_deck_triggers"], readonly [131072n, "trigger_only_in_location"], readonly [262144n, "spsummon_once_old_negate"], readonly [524288n, "cannot_summon_oath_old"], readonly [1048576n, "no_standby_phase"], readonly [2097152n, "no_main_phase_2"], readonly [4194304n, "three_columns_field"], readonly [8388608n, "draw_until_5"], readonly [16777216n, "no_hand_limit"], readonly [33554432n, "unlimited_summons"], readonly [67108864n, "inverted_quick_priority"], readonly [134217728n, "equip_not_sent_if_missing_target"], readonly [268435456n, "zero_atk_destroyed"], readonly [536870912n, "store_attack_replays"], readonly [1073741824n, "single_chain_in_damage_substep"], readonly [2147483648n, "can_repos_if_non_sumplayer"], readonly [4294967296n, "tcg_segoc_nonpublic"], readonly [8589934592n, "tcg_segoc_firsttrigger"], readonly [bigint, "mode_speed"], readonly [bigint, "mode_rush"], readonly [bigint, "mode_goat"], readonly [bigint, "mode_mr2"], readonly [bigint, "mode_mr3"], readonly [bigint, "mode_mr4"], readonly [bigint, "mode_mr5"]]>; /** * Duel creation options. */ export declare interface OcgDuelOptions { /** Duel flags */ flags: OcgDuelMode | (bigint & {}); /** Xoshiro256** seed. Don't use [0n,0n,0n,0n] */ seed: [bigint, bigint, bigint, bigint]; /** Team 1 settings. */ team1: OcgDuelOptionsTeam; /** Team 2 settings. */ team2: OcgDuelOptionsTeam; /** Requests card infos for the given passcode. */ cardReader: (card: number) => Promise<OcgCardData | null> | OcgCardData | null; /** Requests the script contents for the given path. */ scriptReader: (name: string) => Promise<string> | string; /** Handle script or core errors. */ errorHandler?: (type: OcgLogType, text: string) => void; } /** * Remapped options for the sync version of the core. */ export declare type OcgDuelOptionsSync = { [F in keyof OcgDuelOptions]: InternalDepromisifyFunction<OcgDuelOptions[F]>; }; /** * Duel creation team settings. */ export declare interface OcgDuelOptionsTeam { /** Starting life points. */ startingLP: number; /** Initial hand size. */ startingDrawCount: number; /** How many cards are drawn per turn. */ drawCountPerTurn: number; } export declare enum OcgEffectClientMode { NORMAL = 0, RESOLVE = 1, RESET = 2 } export declare const ocgEffectClientModeStrings: InternalMappedMap<readonly [readonly [OcgEffectClientMode.NORMAL, "normal"], readonly [OcgEffectClientMode.RESOLVE, "resolve"], readonly [OcgEffectClientMode.RESET, "reset"]]>; export declare interface OcgFieldCard { position: OcgPosition; materials: number; } export declare interface OcgFieldPlayer { monsters: [ OcgFieldCard, OcgFieldCard, OcgFieldCard, OcgFieldCard, OcgFieldCard, OcgFieldCard, OcgFieldCard ]; spells: [ OcgFieldCard, OcgFieldCard, OcgFieldCard, OcgFieldCard, OcgFieldCard, OcgFieldCard, OcgFieldCard, OcgFieldCard ]; deck_size: number; hand_size: number; grave_size: number; banish_size: number; extra_size: number; extra_faceup_count: number; } export declare type OcgFieldState = { flags: OcgDuelMode; players: [OcgFieldPlayer, OcgFieldPlayer]; chain: OcgChain[]; }; export declare const ocgHintString: InternalMappedMap<readonly [readonly [1, "event"], readonly [2, "message"], readonly [3, "selectmsg"], readonly [4, "opselected"], readonly [5, "effect"], readonly [6, "race"], readonly [7, "attrib"], readonly [8, "code"], readonly [9, "number"], readonly [10, "card"], readonly [11, "zone"]]>; /** Hint type. */ export declare type OcgHintType = (typeof OcgHintType)[keyof typeof OcgHintType]; /** Hint type. */ export declare const OcgHintType: { /** Event. */ readonly EVENT: 1; /** Message. */ readonly MESSAGE: 2; /** Select message. */ readonly SELECTMSG: 3; /** Operation selected. */ readonly OPSELECTED: 4; /** Effect. */ readonly EFFECT: 5; /** Race. */ readonly RACE: 6; /** Attribute. */ readonly ATTRIB: 7; /** Card code. */ readonly CODE: 8; /** Number. */ readonly NUMBER: 9; /** Card. */ readonly CARD: 10; /** Zone. */ readonly ZONE: 11; }; /** Link monster markers positions. */ export declare type OcgLinkMarker = number; /** Link monster markers positions. */ export declare const OcgLinkMarker: { BOTTOM_LEFT: number; BOTTOM: number; BOTTOM_RIGHT: number; LEFT: number; RIGHT: number; TOP_LEFT: number; TOP: number; TOP_RIGHT: number; }; /** * Parse a {@link (OcgLinkMarker:type)} mask and return the matching markers. * @param marker - The mask to parse. */ export declare function ocgLinkMarkerParse(marker: OcgLinkMarker): number[]; export declare const ocgLinkMarkerString: InternalMappedMap<readonly [readonly [number, "bottom_left"], readonly [number, "bottom"], readonly [number, "bottom_right"], readonly [number, "left"], readonly [number, "right"], readonly [number, "top_left"], readonly [number, "top"], readonly [number, "top_right"]]>; /** Location of a card. */ export declare type OcgLocation = (typeof OcgLocation)[keyof typeof OcgLocation]; /** Location of a card. */ export declare const OcgLocation: { /** Main deck. */ readonly DECK: 1; /** Hand. */ readonly HAND: 2; /** Monster zone. */ readonly MZONE: 4; /** Spell/Trap zone. */ readonly SZONE: 8; /** Graveyard. */ readonly GRAVE: 16; /** Banished (removed from play). */ readonly REMOVED: 32; /** Extra deck. */ readonly EXTRA: 64; /** Xyz material. */ readonly OVERLAY: 128; /** Field spell zone. */ readonly FZONE: 256; /** Pendulum zone. */ readonly PZONE: 512; /** Onfield mask. */ readonly ONFIELD: 12; /** All possible locations mask. */ readonly ALL: 1023; }; export declare const ocgLocationString: InternalMappedMap<readonly [readonly [1, "deck"], readonly [2, "hand"], readonly [4, "mzone"], readonly [8, "szone"], readonly [16, "grave"], readonly [32, "removed"], readonly [64, "extra"], readonly [128, "overlay"], readonly [256, "fzone"], readonly [512, "pzone"], readonly [12, "onfield"], readonly [1023, "all"]]>; /** Location and position. */ export declare interface OcgLocPos { controller: 0 | 1; location: OcgLocation; sequence: number; position: OcgPosition; overlay_sequence?: number; } /** Log type. */ export declare type OcgLogType = (typeof OcgLogType)[keyof typeof OcgLogType]; /** Log type. */ export declare const OcgLogType: { /** Error. */ readonly ERROR: 0; /** From script. */ readonly FROM_SCRIPT: 1; /** Debug. */ readonly FOR_DEBUG: 2; /** Undefined. */ readonly UNDEFINED: 3; }; export declare const ocgLogTypeString: InternalMappedMap<readonly [readonly [0, "error"], readonly [1, "from_script"], readonly [2, "for_debug"], readonly [3, "undefined"]]>; export declare type OcgMessage = OcgMessageRetry | OcgMessageHint | OcgMessageWaiting | OcgMessageStart | OcgMessageWin | OcgMessageUpdateData | OcgMessageUpdateCard | OcgMessageRequestDeck | OcgMessageSelectBattleCMD | OcgMessageSelectIdlecmd | OcgMessageSelectEffectYN | OcgMessageSelectYesno | OcgMessageSelectOption | OcgMessageSelectCard | OcgMessageSelectChain | OcgMessageSelectPlace | OcgMessageSelectPosition | OcgMessageSelectTribute | OcgMessageSortChain | OcgMessageSelectCounter | OcgMessageSelectSum | OcgMessageSelectDisfield | OcgMessageSortCard | OcgMessageSelectUnselectCard | OcgMessageConfirmDeckTop | OcgMessageConfirmCards | OcgMessageShuffleDeck | OcgMessageShuffleHand | OcgMessageRefreshDeck | OcgMessageSwapGraveDeck | OcgMessageShuffleSetCard | OcgMessageReverseDeck | OcgMessageDeckTop | OcgMessageShuffleExtra | OcgMessageNewTurn | OcgMessageNewPhase | OcgMessageConfirmExtratop | OcgMessageMove | OcgMessagePosChange | OcgMessageSet | OcgMessageSwap | OcgMessageFieldDisabled | OcgMessageSummoning | OcgMessageSummoned | OcgMessageSpsummoning | OcgMessageSpsummoned | OcgMessageFlipsummoning | OcgMessageFlipsummoned | OcgMessageChaining | OcgMessageChained | OcgMessageChainSolving | OcgMessageChainSolved | OcgMessageChainEnd | OcgMessageChainNegated | OcgMessageChainDisabled | OcgMessageCardSelected | OcgMessageRandomSelected | OcgMessageBecomeTarget | OcgMessageDraw | OcgMessageDamage | OcgMessageRecover | OcgMessageEquip | OcgMessageLPUpdate | OcgMessageCardTarget | OcgMessageCancelTarget | OcgMessagePayLPCost | OcgMessageAddCounter | OcgMessageRemoveCounter | OcgMessageAttack | OcgMessageBattle | OcgMessageAttackDisabled | OcgMessageDamageStepStart | OcgMessageDamageStepEnd | OcgMessageMissedEffect | OcgMessageBeChainTarget | OcgMessageCreateRelation | OcgMessageReleaseRelation | OcgMessageTossCoin | OcgMessageTossDice | OcgMessageRockPaperScissors | OcgMessageHandRes | OcgMessageAnnounceRace | OcgMessageAnnounceAttrib | OcgMessageAnnounceCard | OcgMessageAnnounceNumber | OcgMessageCardHint | OcgMessageTagSwap | OcgMessageReloadField | OcgMessageAiName | OcgMessageShowHint | OcgMessagePlayerHint | OcgMessageMatchKill | OcgMessageCustomMsg | OcgMessageRemoveCards; export declare interface OcgMessageAddCounter { type: OcgMessageType.ADD_COUNTER; counter_type: number; controller: 0 | 1; location: OcgLocation; sequence: number; count: number; } export declare interface OcgMessageAiName { type: OcgMessageType.AI_NAME; name: string; } export declare interface OcgMessageAnnounceAttrib { type: OcgMessageType.ANNOUNCE_ATTRIB; player: number; count: number; available: OcgAttribute; } export declare interface OcgMessageAnnounceCard { type: OcgMessageType.ANNOUNCE_CARD; player: number; opcodes: OcgOpCode[]; } export declare interface OcgMessageAnnounceNumber { type: OcgMessageType.ANNOUNCE_NUMBER; player: number; options: bigint[]; } export declare interface OcgMessageAnnounceRace { type: OcgMessageType.ANNOUNCE_RACE; player: number; count: number; available: OcgRace; } export declare interface OcgMessageAttack { type: OcgMessageType.ATTACK; card: OcgLocPos; target: OcgLocPos | null; } export declare interface OcgMessageAttackDisabled { type: OcgMessageType.ATTACK_DISABLED; } export declare interface OcgMessageBattle { type: OcgMessageType.BATTLE; card: OcgCardLocBattle; target: OcgCardLocBattle | null; } export declare interface OcgMessageBeChainTarget { type: OcgMessageType.BE_CHAIN_TARGET; } export declare interface OcgMessageBecomeTarget { type: OcgMessageType.BECOME_TARGET; cards: OcgLocPos[]; } export declare interface OcgMessageCancelTarget { type: OcgMessageType.CANCEL_TARGET; card: OcgLocPos; target: OcgLocPos; } export declare interface OcgMessageCardHint { type: OcgMessageType.CARD_HINT; controller: 0 | 1; location: OcgLocation; sequence: number; position: OcgPosition; overlay_sequence?: number; card_hint: OcgCardHintType; description: bigint; } export declare interface OcgMessageCardSelected { type: OcgMessageType.CARD_SELECTED; cards: OcgLocPos[]; } export declare interface OcgMessageCardTarget { type: OcgMessageType.CARD_TARGET; card: OcgLocPos; target: OcgLocPos; } export declare interface OcgMessageChainDisabled { type: OcgMessageType.CHAIN_DISABLED; chain_size: number; } export declare interface OcgMessageChained { type: OcgMessageType.CHAINED; chain_size: number; } export declare interface OcgMessageChainEnd { type: OcgMessageType.CHAIN_END; } export declare interface OcgMessageChaining { type: OcgMessageType.CHAINING; code: number; controller: 0 | 1; location: OcgLocation; sequence: number; position: OcgPosition; overlay_sequence?: number; triggering_controller: 0 | 1; triggering_location: OcgLocation; triggering_sequence: number; description: bigint; chain_size: number; } export declare interface OcgMessageChainNegated { type: OcgMessageType.CHAIN_NEGATED; chain_size: number; } export declare interface OcgMessageChainSolved { type: OcgMessageType.CHAIN_SOLVED; chain_size: number; } export declare interface OcgMessageChainSolving { type: OcgMessageType.CHAIN_SOLVING; chain_size: number; } export declare interface OcgMessageConfirmCards { type: OcgMessageType.CONFIRM_CARDS; player: number; cards: OcgCardLoc[]; } export declare interface OcgMessageConfirmDeckTop { type: OcgMessageType.CONFIRM_DECKTOP; player: number; cards: OcgCardLoc[]; } export declare interface OcgMessageConfirmExtratop { type: OcgMessageType.CONFIRM_EXTRATOP; player: number; cards: OcgCardLoc[]; } export declare interface OcgMessageCreateRelation { type: OcgMessageType.CREATE_RELATION; } export declare interface OcgMessageCustomMsg { type: OcgMessageType.CUSTOM_MSG; } export declare interface OcgMessageDamage { type: OcgMessageType.DAMAGE; player: number; amount: number; } export declare interface OcgMessageDamageStepEnd { type: OcgMessageType.DAMAGE_STEP_END; } export declare interface OcgMessageDamageStepStart { type: OcgMessageType.DAMAGE_STEP_START; } export declare interface OcgMessageDeckTop { type: OcgMessageType.DECK_TOP; player: number; count: number; code: number; position: OcgPosition; overlay_sequence?: number; } export declare interface OcgMessageDraw { type: OcgMessageType.DRAW; player: number; drawn: { code: number; position: OcgPosition; }[]; } export declare interface OcgMessageEquip { type: OcgMessageType.EQUIP; card: OcgLocPos; target: OcgLocPos; } export declare interface OcgMessageFieldDisabled { type: OcgMessageType.FIELD_DISABLED; field_mask: number; } export declare interface OcgMessageFlipsummoned { type: OcgMessageType.FLIPSUMMONED; } export declare interface OcgMessageFlipsummoning { type: OcgMessageType.FLIPSUMMONING; code: number; controller: 0 | 1; location: OcgLocation; sequence: number; position: OcgPosition; } export declare interface OcgMessageHandRes { type: OcgMessageType.HAND_RES; results: readonly [OcgRPS, OcgRPS]; } /** Additional information, usually card specific or for things that don't belong to a specific message. */ export declare interface OcgMessageHint { type: OcgMessageType.HINT; hint_type: OcgHintType; player: number; hint: bigint; } export declare interface OcgMessageLPUpdate { type: OcgMessageType.LPUPDATE; player: number; lp: number; } export declare interface OcgMessageMatchKill { type: OcgMessageType.MATCH_KILL; card: number; } export declare interface OcgMessageMissedEffect { type: OcgMessageType.MISSED_EFFECT; code: number; controller: 0 | 1; location: OcgLocation; sequence: number; position: OcgPosition; overlay_sequence?: number; } export declare interface OcgMessageMove { type: OcgMessageType.MOVE; card: number; from: OcgLocPos; to: OcgLocPos; } export declare interface OcgMessageNewPhase { type: OcgMessageType.NEW_PHASE; phase: OcgPhase; } export declare interface OcgMessageNewTurn { type: OcgMessageType.NEW_TURN; player: number; } export declare interface OcgMessagePayLPCost { type: OcgMessageType.PAY_LPCOST; player: number; amount: number; } export declare interface OcgMessagePlayerHint { type: OcgMessageType.PLAYER_HINT; player: number; player_hint: OcgPlayerHintType; description: bigint; } export declare interface OcgMessagePosChange { type: OcgMessageType.POS_CHANGE; code: number; controller: 0 | 1; location: OcgLocation; sequence: number; prev_position: OcgPosition; position: OcgPosition; } export declare interface OcgMessageRandomSelected { type: OcgMessageType.RANDOM_SELECTED; player: number; cards: OcgLocPos[]; } export declare interface OcgMessageRecover { type: OcgMessageType.RECOVER; player: number; amount: number; } export declare interface OcgMessageRefreshDeck { type: OcgMessageType.REFRESH_DECK; } export declare interface OcgMessageReleaseRelation { type: OcgMessageType.RELEASE_RELATION; } export declare interface OcgMessageReloadField extends OcgFieldState { type: OcgMessageType.RELOAD_FIELD; } export declare interface OcgMessageRemoveCards { type: OcgMessageType.REMOVE_CARDS; cards: OcgLocPos[]; } export declare interface OcgMessageRemoveCounter { type: OcgMessageType.REMOVE_COUNTER; counter_type: number; controller: 0 | 1; location: OcgLocation; sequence: number; count: number; } /** @deprecated Not used. */ export declare interface OcgMessageRequestDeck { type: OcgMessageType.REQUEST_DECK; } /** Sent when an invalid response was provided. */ export declare interface OcgMessageRetry { type: OcgMessageType.RETRY; } export declare interface OcgMessageReverseDeck { type: OcgMessageType.REVERSE_DECK; } export declare interface OcgMessageRockPaperScissors { type: OcgMessageType.ROCK_PAPER_SCISSORS; player: number; } /** Available battle step actions. */ export declare interface OcgMessageSelectBattleCMD { type: OcgMessageType.SELECT_BATTLECMD; player: number; /** Activatable cards. */ chains: OcgCardLocActive[]; /** Cards that can attack. */ attacks: OcgCardLocAttack[]; /** Can go to main phase 2. */ to_m2: boolean; /** Can go to end phase. */ to_ep: boolean; } export declare interface OcgMessageSelectCard { type: OcgMessageType.SELECT_CARD; player: number; can_cancel: boolean; min: number; max: number; selects: OcgCardLocPos[]; } export declare interface OcgMessageSelectChain { type: OcgMessageType.SELECT_CHAIN; player: number; spe_count: number; forced: boolean; hint_timing: number; hint_timing_other: number; selects: OcgCardLocPosActive[]; } export declare interface OcgMessageSelectCounter { type: OcgMessageType.SELECT_COUNTER; player: number; counter_type: number; count: number; cards: OcgCardLocCounter[]; } export declare interface OcgMessageSelectDisfield { type: OcgMessageType.SELECT_DISFIELD; player: number; count: number; field_mask: number; } export declare interface OcgMessageSelectEffectYN { type: OcgMessageType.SELECT_EFFECTYN; player: number; code: number; controller: 0 | 1; location: OcgLocation; sequence: number; position: OcgPosition; overlay_sequence?: number; description: bigint; } /** Available main phase actions. */ export declare interface OcgMessageSelectIdlecmd { type: OcgMessageType.SELECT_IDLECMD; player: number; /** Summonable cards. */ summons: OcgCardLoc[]; /** Special summonable cards. */ special_summons: OcgCardLoc[]; /** Cards that can change battle position. */ pos_changes: OcgCardLoc[]; /** Settable monster cards. */ monster_sets: OcgCardLoc[]; /** Settable spell/trap cards. */ spell_sets: OcgCardLoc[]; /** Activatable cards. */ activates: OcgCardLocActive[]; /** Can go to battle phase. */ to_bp: boolean; /** Can go to end phase. */ to_ep: boolean; /** Can manually shuffle. */ shuffle: boolean; } export declare interface OcgMessageSelectOption { type: OcgMessageType.SELECT_OPTION; player: number; options: bigint[]; } export declare interface OcgMessageSelectPlace { type: OcgMessageType.SELECT_PLACE; player: number; count: number; field_mask: number; } export declare interface OcgMessageSelectPosition { type: OcgMessageType.SELECT_POSITION; player: number; code: number; positions: OcgPosition; } export declare interface OcgMessageSelectSum { type: OcgMessageType.SELECT_SUM; player: number; select_max: number; amount: number; min: number; max: number; selects_must: OcgCardLocSum[]; selects: OcgCardLocSum[]; } export declare interface OcgMessageSelectTribute { type: OcgMessageType.SELECT_TRIBUTE; player: number; can_cancel: boolean; min: number; max: number; selects: OcgCardLocTribute[]; } export declare interface OcgMessageSelectUnselectCard { type: OcgMessageType.SELECT_UNSELECT_CARD; player: number; can_finish: boolean; can_cancel: boolean; min: number; max: number; select_cards: OcgCardLocPos[]; unselect_cards: OcgCardLocPos[]; } export declare interface OcgMessageSelectYesno { type: OcgMessageType.SELECT_YESNO; player: number; description: bigint; } export declare interface OcgMessageSet { type: OcgMessageType.SET; code: number; controller: 0 | 1; location: OcgLocation; sequence: number; position: OcgPosition; } export declare interface OcgMessageShowHint { type: OcgMessageType.SHOW_HINT; hint: string; } export declare interface OcgMessageShuffleDeck { type: OcgMessageType.SHUFFLE_DECK; player: number; } export declare interface OcgMessageShuffleExtra { type: OcgMessageType.SHUFFLE_EXTRA; player: number; cards: number[]; } export declare interface OcgMessageShuffleHand { type: OcgMessageType.SHUFFLE_HAND; player: number; cards: number[]; } export declare interface OcgMessageShuffleSetCard { type: OcgMessageType.SHUFFLE_SET_CARD; location: OcgLocation; cards: { from: OcgLocPos; to: OcgLocPos; }[]; } export declare interface OcgMessageSortCard { type: OcgMessageType.SORT_CARD; player: number; cards: OcgCardLoc[]; } export declare interface OcgMessageSortChain { type: OcgMessageType.SORT_CHAIN; player: number; cards: OcgCardLoc[]; } export declare interface OcgMessageSpsummoned { type: OcgMessageType.SPSUMMONED; } export declare interface OcgMessageSpsummoning { type: OcgMessageType.SPSUMMONING; code: number; controller: 0 | 1; location: OcgLocation; sequence: number; position: OcgPosition; } /** Duel start. */ export declare interface OcgMessageStart { type: OcgMessageType.START; } export declare interface OcgMessageSummoned { type: OcgMessageType.SUMMONED; } export declare interface OcgMessageSummoning { type: OcgMessageType.SUMMONING; code: number; controller: 0 | 1; location: OcgLocation; sequence: number; position: OcgPosition; } export declare interface OcgMessageSwap { type: OcgMessageType.SWAP; card1: OcgCardLocPos; card2: OcgCardLocPos; } export declare interface OcgMessageSwapGraveDeck { type: OcgMessageType.SWAP_GRAVE_DECK; player: number; deck_size: number; returned_to_extra: number[]; } export declare interface OcgMessageTagSwap { type: OcgMessageType.TAG_SWAP; player: number; deck_size: number; extra_faceup_count: number; deck_top_card: number | null; hand: OcgCardPos[]; extra: OcgCardPos[]; } export declare interface OcgMessageTossCoin { type: OcgMessageType.TOSS_COIN; player: number; results: boolean[]; } export declare interface OcgMessageTossDice { type: OcgMessageType.TOSS_DICE; player: number; results: number[]; } /** Message type enum. */ export declare enum OcgMessageType { RETRY = 1, HINT = 2, WAITING = 3, START = 4, WIN = 5, UPDATE_DATA = 6, UPDATE_CARD = 7, REQUEST_DECK = 8, SELECT_BATTLECMD = 10, SELECT_IDLECMD = 11, SELECT_EFFECTYN = 12, SELECT_YESNO = 13, SELECT_OPTION = 14, SELECT_CARD = 15, SELECT_CHAIN = 16, SELECT_PLACE = 18, SELECT_POSITION = 19, SELECT_TRIBUTE = 20, SORT_CHAIN = 21, SELECT_COUNTER = 22, SELECT_SUM = 23, SELECT_DISFIELD = 24, SORT_CARD = 25, SELECT_UNSELECT_CARD = 26, CONFIRM_DECKTOP = 30, CONFIRM_CARDS = 31, SHUFFLE_DECK = 32, SHUFFLE_HAND = 33, REFRESH_DECK = 34, SWAP_GRAVE_DECK = 35, SHUFFLE_SET_CARD = 36, REVERSE_DECK = 37, DECK_TOP = 38, SHUFFLE_EXTRA = 39, NEW_TURN = 40, NEW_PHASE = 41, CONFIRM_EXTRATOP = 42, MOVE = 50, POS_CHANGE = 53, SET = 54, SWAP = 55, FIELD_DISABLED = 56, SUMMONING = 60, SUMMONED = 61, SPSUMMONING = 62, SPSUMMONED = 63, FLIPSUMMONING = 64, FLIPSUMMONED = 65, CHAINING = 70, CHAINED = 71, CHAIN_SOLVING = 72, CHAIN_SOLVED = 73, CHAIN_END = 74, CHAIN_NEGATED = 75, CHAIN_DISABLED = 76, CARD_SELECTED = 80, RANDOM_SELECTED = 81, BECOME_TARGET = 83, DRAW = 90, DAMAGE = 91, RECOVER = 92, EQUIP = 93, LPUPDATE = 94, CARD_TARGET = 96, CANCEL_TARGET = 97, PAY_LPCOST = 100, ADD_COUNTER = 101, REMOVE_COUNTER = 102, ATTACK = 110, BATTLE = 111, ATTACK_DISABLED = 112, DAMAGE_STEP_START = 113, DAMAGE_STEP_END = 114, MISSED_EFFECT = 120, BE_CHAIN_TARGET = 121, CREATE_RELATION = 122, RELEASE_RELATION = 123, TOSS_COIN = 130, TOSS_DICE = 131, ROCK_PAPER_SCISSORS = 132, HAND_RES = 133, ANNOUNCE_RACE = 140, ANNOUNCE_ATTRIB = 141, ANNOUNCE_CARD = 142, ANNOUNCE_NUMBER = 143, CARD_HINT = 160, TAG_SWAP = 161, RELOAD_FIELD = 162, AI_NAME = 163, SHOW_HINT = 164, PLAYER_HINT = 165, MATCH_KILL = 170, CUSTOM_MSG = 180, REMOVE_CARDS = 190 } export declare const ocgMessageTypeStrings: InternalMappedMap<readonly [readonly [OcgMessageType.RETRY, "retry"], readonly [OcgMessageType.HINT, "hint"], readonly [OcgMessageType.WAITING, "waiting"], readonly [OcgMessageType.START, "start"], readonly [OcgMessageType.WIN, "win"], readonly [OcgMessageType.UPDATE_DATA, "update_data"], readonly [OcgMessageType.UPDATE_CARD, "update_card"], readonly [OcgMessageType.REQUEST_DECK, "request_deck"], readonly [OcgMessageType.SELECT_BATTLECMD, "select_battlecmd"], readonly [OcgMessageType.SELECT_IDLECMD, "select_idlecmd"], readonly [OcgMessageType.SELECT_EFFECTYN, "select_effectyn"], readonly [OcgMessageType.SELECT_YESNO, "select_yesno"], readonly [OcgMessageType.SELECT_OPTION, "select_option"], readonly [OcgMessageType.SELECT_CARD, "select_card"], readonly [OcgMessageType.SELECT_CHAIN, "select_chain"], readonly [OcgMessageType.SELECT_PLACE, "select_place"], readonly [OcgMessageType.SELECT_POSITION, "select_position"], readonly [OcgMessageType.SELECT_TRIBUTE, "select_tribute"], readonly [OcgMessageType.SORT_CHAIN, "sort_chain"], readonly [OcgMessageType.SELECT_COUNTER, "select_counter"], readonly [OcgMessageType.SELECT_SUM, "select_sum"], readonly [OcgMessageType.SELECT_DISFIELD, "select_disfield"], readonly [OcgMessageType.SORT_CARD, "sort_card"], readonly [OcgMessageType.SELECT_UNSELECT_CARD, "select_unselect_card"], readonly [OcgMessageType.CONFIRM_DECKTOP, "confirm_decktop"], readonly [OcgMessageType.CONFIRM_CARDS, "confirm_cards"], readonly [OcgMessageType.SHUFFLE_DECK, "shuffle_deck"], readonly [OcgMessageType.SHUFFLE_HAND, "shuffle_hand"], readonly [OcgMessageType.REFRESH_DECK, "refresh_deck"], readonly [OcgMessageType.SWAP_GRAVE_DECK, "swap_grave_deck"], readonly [OcgMessageType.SHUFFLE_SET_CARD, "shuffle_set_card"], readonly [OcgMessageType.REVERSE_DECK, "reverse_deck"], readonly [OcgMessageType.DECK_TOP, "deck_top"], readonly [OcgMessageType.SHUFFLE_EXTRA, "shuffle_extra"], readonly [OcgMessageType.NEW_TURN, "new_turn"], readonly [OcgMessageType.NEW_PHASE, "new_phase"], readonly [OcgMessageType.CONFIRM_EXTRATOP, "confirm_extratop"], readonly [OcgMessageType.MOVE, "move"], readonly [OcgMessageType.POS_CHANGE, "pos_change"], readonly [OcgMessageType.SET, "set"], readonly [OcgMessageType.SWAP, "swap"], readonly [OcgMessageType.FIELD_DISABLED, "field_disabled"], readonly [OcgMessageType.SUMMONING, "summoning"], readonly [OcgMessageType.SUMMONED, "summoned"], readonly [OcgMessageType.SPSUMMONING, "spsummoning"], readonly [OcgMessageType.SPSUMMONED, "spsummoned"], readonly [OcgMessageType.FLIPSUMMONING, "flipsummoning"], readonly [OcgMessageType.FLIPSUMMONED, "flipsummoned"], readonly [OcgMessageType.CHAINING, "chaining"], readonly [OcgMessageType.CHAINED, "chained"], readonly [OcgMessageType.CHAIN_SOLVING, "chain_solving"], readonly [OcgMessageType.CHAIN_SOLVED, "chain_solved"], readonly [OcgMessageType.CHAIN_END, "chain_end"], readonly [OcgMessageType.CHAIN_NEGATED, "chain_negated"], readonly [OcgMessageType.CHAIN_DISABLED, "chain_disabled"], readonly [OcgMessageType.CARD_SELECTED, "card_selected"], readonly [OcgMessageType.RANDOM_SELECTED, "random_selected"], readonly [OcgMessageType.BECOME_TARGET, "become_target"], readonly [OcgMessageType.DRAW, "draw"], readonly [OcgMessageType.DAMAGE, "damage"], readonly [OcgMessageType.RECOVER, "recover"], readonly [OcgMessageType.EQUIP, "equip"], readonly [OcgMessageType.LPUPDATE, "lpupdate"], readonly [OcgMessageType.CARD_TARGET, "card_target"], readonly [OcgMessageType.CANCEL_TARGET, "cancel_target"], readonly [OcgMessageType.PAY_LPCOST, "pay_lpcost"], readonly [OcgMessageType.ADD_COUNTER, "add_counter"], readonly [OcgMessageType.REMOVE_COUNTER, "remove_counter"], readonly [OcgMessageType.ATTACK, "attack"], readonly [OcgMessageType.BATTLE, "battle"], readonly [OcgMessageType.ATTACK_DISABLED, "attack_disabled"], readonly [OcgMessageType.DAMAGE_STEP_START, "damage_step_start"], readonly [OcgMessageType.DAMAGE_STEP_END, "damage_step_end"], readonly [OcgMessageType.MISSED_EFFECT, "missed_effect"], readonly [OcgMessageType.BE_CHAIN_TARGET, "be_chain_target"], readonly [OcgMessageType.CREATE_RELATION, "create_relation"], readonly [OcgMessageType.RELEASE_RELATION, "release_relation"], readonly [OcgMessageType.TOSS_COIN, "toss_coin"], readonly [OcgMessageType.TOSS_DICE, "toss_dice"], readonly [OcgMessageType.ROCK_PAPER_SCISSORS, "rock_paper_scissors"], readonly [OcgMessageType.HAND_RES, "hand_res"], readonly [OcgMessageType.ANNOUNCE_RACE, "announce_race"], readonly [OcgMessageType.ANNOUNCE_ATTRIB, "announce_attrib"], readonly [OcgMessageType.ANNOUNCE_CARD, "announce_card"], readonly [OcgMessageType.ANNOUNCE_NUMBER, "announce_number"], readonly [OcgMessageType.CARD_HINT, "card_hint"], readonly [OcgMessageType.TAG_SWAP, "tag_swap"], readonly [OcgMessageType.RELOAD_FIELD, "reload_field"], readonly [OcgMessageType.AI_NAME, "ai_name"], readonly [OcgMessageType.SHOW_HINT, "show_hint"], readonly [OcgMessageType.PLAYER_HINT, "player_hint"], readonly [OcgMessageType.MATCH_KILL, "match_kill"], readonly [OcgMessageType.CUSTOM_MSG, "custom_msg"], readonly [OcgMessageType.REMOVE_CARDS, "remove_cards"]]>; /** @deprecated Not used. */ export declare interface OcgMessageUpdateCard { type: OcgMessageType.UPDATE_CARD; } /** @deprecated Not used. */ export declare interface OcgMessageUpdateData { type: OcgMessageType.UPDATE_DATA; } /** Provide a response. */ export declare interface OcgMessageWaiting { type: OcgMessageType.WAITING; } /** Duel win. */ export declare interface OcgMessageWin { type: OcgMessageType.WIN; player: number; reason: number; } /** * Card creation definition. Used in {@link OcgCore#duelNewCard}. */ export declare interface OcgNewCardInfo { /** Owner team. */ team: 0 | 1; /** Owner duelist index, always 0 unless it's a tag duel. */ duelist: number; /** Card passcode. */ code: number; /** Current controller of the card. Usually same as team. */ controller: 0 | 1; /** Current location of the card. If duelist isn't 0 then it should always be {@link OcgLocation#DECK} or {@link OcgLocation#EXTRA} */ location: OcgLocation; /** * Index of the card in the specified location. * If location is DECK then if sequence == 0 it's the top, if sequence == 1 it's the bottom, otherwise the deck is shuffled. * If location is EXTRA, REMOVED, GRAVE, or HAND it's ignored. */ sequence: number; /** Position, may be automatically overriden depending on the location. */ position: OcgPosition; } /** Opcode for the stack based card announcing process, used in {@link OcgMessageAnnounceCard}. */ export declare type OcgOpCode = (typeof OcgOpCode)[keyof typeof OcgOpCode]; /** Available Opcodes, any value that isn't a Opcode is added to the stack. */ export declare const OcgOpCode: { /** stack in: ... (A) (B); stack out: ... (A + B) */ ADD: bigint; /** stack in: ... (A) (B); stack out: ... (A - B) */ SUB: bigint; /** stack in: ... (A) (B); stack out: ... (A * B) */ MUL: bigint; /** stack in: ... (A) (B); stack out: ... (A / B) */ DIV: bigint; /** stack in: ... (A) (B); stack out: ... (A && B) */ AND: bigint; /** stack in: ... (A) (B); stack out: ... (A || B) */ OR: bigint; /** stack in: ... (A); stack out: ... (-A) */ NEG: bigint; /** stack in: ... (A); stack out: ... (!A) */ NOT: bigint; /** stack in: ... (A) (B); stack out: ... (A & B) */ BAND: bigint; /** stack in: ... (A) (B); stack out: ... (A | B) */ BOR: bigint; /** stack in: ... (A); stack out: ... (~A) */ BNOT: bigint; /** stack in: ... (A) (B); stack out: ... (A ^ B) */ BXOR: bigint; /** stack in: ... (A) (B); stack out: ... (A \<\< B) */ LSHIFT: bigint; /** stack in: ... (A) (B); stack out: ... (A \>\> B) */ RSHIFT: bigint; /** stack in: ...; stack out: ... */ ALLOW_ALIASES: bigint; /** stack in: ...; stack out: ... */ ALLOW_TOKENS: bigint; /** stack in: ... (A); stack out: ... (A == code) */ ISCODE: bigint; /** stack in: ... (A); stack out: ... (setcodes includes A) */ ISSETCARD: bigint; /** stack in: ... (A); stack out: ... (A == type) */ ISTYPE: bigint; /** stack in: ... (A); stack out: ... (A == race) */ ISRACE: bigint; /** stack in: ... (A); stack out: ... (A == attribute) */ ISATTRIBUTE: bigint; /** stack in: ...; stack out: ... (code) */ GETCODE: bigint; /** @deprecated Does nothing. */ GETSETCARD: bigint; /** stack in: ...; stack out: ... (type) */ GETTYPE: bigint; /** stack in: ...; stack out: ... (race) */ GETRACE: bigint; /** stack in: ...; stack out: ... (attribute) */ GETATTRIBUTE: bigint; }; /** * Convert a {@link (OcgOpCode:type)} to its string representation. */ export declare const ocgOpCodeString: InternalMappedMap<readonly [readonly [bigint, "add"], readonly [bigint, "sub"], readonly [bigint, "mul"], readonly [bigint, "div"], readonly [bigint, "and"], readonly [bigint, "or"], readonly [bigint, "neg"], readonly [bigint, "not"], readonly [bigint, "band"], readonly [bigint, "bor"], readonly [bigint, "bnot"], readonly [bigint, "bxor"], readonly [bigint, "lshift"], readonly [bigint, "rshift"], readonly [bigint, "allow_aliases"], readonly [bigint, "allow_tokens"], readonly [bigint, "iscode"], readonly [bigint, "issetcard"], readonly [bigint, "istype"], readonly [bigint, "israce"], readonly [bigint, "isattribute"], readonly [bigint, "getcode"], readonly [bigint, "getsetcard"], readonly [bigint, "gettype"], readonly [bigint, "getrace"], readonly [bigint, "getattribute"]]>; /** Turn phase. */ export declare type OcgPhase = (typeof OcgPhase)[keyof typeof OcgPhase]; /** Turn phase. */ export declare const OcgPhase: { /** Draw phase. */ readonly DRAW: 1; /** Stand-by phase. */ readonly STANDBY: 2; /** Main phase 1. */ readonly MAIN1: 4; /** Battle phase: start step */ readonly BATTLE_START: 8; /** Battle phase: battle step */ readonly BATTLE_STEP: 16; /** Battle phase: damage step */ readonly DAMAGE: 32; /** Battle phase: damage calculation */ readonly DAMAGE_CAL: 64; /** Battle phase: end step */ readonly BATTLE: 128; /** Main phase 2. */ readonly MAIN2: 256; /** End phase. */ readonly END: 512; }; export declare const ocgPhaseString: InternalMappedMap<readonly [readonly [1, "draw"], readonly [2, "standby"], readonly [4, "main1"], readonly [8, "battle_start"], readonly [16, "battle_step"], readonly [32, "damage"], readonly [64, "damage_cal"], readonly [128, "battle"], readonly [256, "main2"], readonly [512, "end"]]>; export declare enum OcgPlayerHintType { DESC_ADD = 6, DESC_REMOVE = 7 } export declare const ocgPlayerHintTypeStrings: InternalMappedMap<readonly [readonly [OcgPlayerHintType.DESC_ADD, "desc_add"], readonly [OcgPlayerHintType.DESC_REMOVE, "desc_remove"]]>; /** Position (faceup or facedown and defense or attack) of a card. */ export declare type OcgPosition = (typeof OcgPosition)[keyof typeof OcgPosition]; /** Position (faceup or facedown and defense or attack) of a card. */ export declare const OcgPosition: { /** FACEUP_ATTACK */ readonly FACEUP_ATTACK: 1; /** FACEDOWN_ATTACK */ readonly FACEDOWN_ATTACK: 2; /** FACEUP_DEFENSE */ readonly FACEUP_DEFENSE: 4; /** FACEDOWN_DEFENSE */ readonly FACEDOWN_DEFENSE: 8; /** FACEUP_ATTACK | FACEUP_DEFENSE */ readonly FACEUP: 5; /** FACEDOWN_ATTACK | FACEDOWN_DEFENSE */ readonly FACEDOWN: 10; /** FACEUP_ATTACK | FACEDOWN_ATTACK */ readonly ATTACK: 3; /** FACEUP_DEFENSE | FACEDOWN_DEFENSE */ readonly DEFENSE: 12; }; /** * Parse a position mask and returns the list of actual positions it matches. * @param positionMask - The mask to parse */ export declare function ocgPositionParse(positionMask: OcgPosition): Extract<OcgPosition, 0x1 | 0x2 | 0x4 | 0x8>[]; export declare const ocgPositionString: InternalMappedMap<readonly [readonly [1, "faceup_attack"], readonly [2, "facedown_attack"], readonly [4, "faceup_defense"], readonly [8, "facedown_defense"], readonly [5, "faceup"], readonly [10, "facedown"], readonly [3, "attack"], readonly [12, "defense"]]>; /** The result of each call to {@link OcgCore#duelProcess}. */ export declare type OcgProcessResult = (typeof OcgProcessResult)[keyof typeof OcgProcessResult]; /** The result of each call to {@link OcgCore#duelProcess}. */ export declare const OcgProcessResult: { /** * Duel ended, you can't no longer call {@link OcgCore#duelProcess}. */ readonly END: 0; /** * Waiting for a player action, provide a response with {@link OcgCore#duelSetResponse} * before calling {@link OcgCore#duelProcess} again. */ readonly WAITING: 1; /** * Intermidate processing step, you should call {@link OcgCore#duelProcess} again. */ readonly CONTINUE: 2; }; export declare const ocgProcessResultString: InternalMappedMap<readonly [readonly [0, "end"], readonly [1, "waiting"], readonly [2, "continue"]]>; /** * Query interface to request information about a location. */ export declare interface OcgQuery { /** Informations to requests. */ flags: OcgQueryFlags; /** Controller of the card. */ controller: 0 | 1; /** Card location. */ location: OcgLocation; /** Index sequence in location. */ sequence: number; /** Overlay card sequence, used when `(location & OcgLocation.OVERLAY) != 0`. */ overlaySequence: number; } /** Requested card properties, used when querying. */ export declare type OcgQueryFlags = (typeof OcgQueryFlags)[keyof typeof OcgQueryFlags]; /** Requested card properties, used when querying. */ export declare const OcgQueryFlags: { /** Code. */ readonly CODE: 1; /** Position. */ readonly POSITION: 2; /** Aliases. */ readonly ALIAS: 4; /** Type. */ readonly TYPE: 8; /** Level. */ readonly LEVEL: 16; /** Rank. */ readonly RANK: 32; /** Attribute. */ readonly ATTRIBUTE: 64; /** Race. */ readonly RACE: 128; /** Attack. */ readonly ATTACK: 256; /** Defense. */ readonly DEFENSE: 512; /** Base attack. */ readonly BASE_ATTACK: 1024; /** Base defense. */ readonly BASE_DEFENSE: 2048; /** Reason. */ readonly REASON: 4096; /** Reason card. */ readonly REASON_CARD: 8192; /** Equipped to card. */ readonly EQUIP_CARD: 16384; /** Targeted card. */ readonly TARGET_CARD: 32768; /** Overlayed card. */ readonly OVERLAY_CARD: 65536; /** Counters. */ readonly COUNTERS: 131072; /** Owner. */ readonly OWNER: 262144; /** Status. */ readonly STATUS: 524288; /** Is public knowledge. */ readonly IS_PUBLIC: 1048576; /** Left pendulum scale. */ readonly LSCALE: 2097152; /** Right pendulum scale. */ readonly RSCALE: 4194304; /** Link arrows. */ readonly LINK: 8388608; /** Is hidden. */ readonly IS_HIDDEN: 16777216; /** Cover. */ readonly COVER: 33554432; }; export declare const ocgQueryFlagsString: InternalMappedMap<readonly [readonly [1, "code"], readonly [2, "position"], readonly [4, "alias"], readonly [8, "type"], readonly [16, "level"], readonly [32, "rank"], readonly [64, "attribute"], readonly [128, "race"], readonly [256, "attack"], readonly [512, "defense"], readonly [1024, "base_attack"], readonly [2048, "base_defense"], readonly [4096, "reason"], readonly [8192, "reason_card"], readonly [16384, "equip_card"], readonly [32768, "target_card"], readonly [65536, "overlay_card"], readonly [131072, "counters"], readonly [262144, "owner"], readonly [524288, "status"], readonly [1048576, "is_public"], readonly [2097152, "lscale"], readonly [4194304, "rscale"], readonly [8388608, "link"], readonly [16777216, "is_hidden"], readonly [33554432, "cover"]]>; export declare type OcgQueryLocation = Omit<OcgQuery, "sequence" | "overlaySequence">; /** Monster card race. */ export declare type OcgRace = (typeof OcgRace)[keyof typeof OcgRace]; /** Monster card race. */ export declare const OcgRace: { /** Warrior. */ readonly WARRIOR: 1n; /** Spellcaster. */ readonly SPELLCASTER: 2n; /** Fairy. */ readonly FAIRY: 4n; /** Fiend. */ readonly FIEND: 8n; /** Zombie. */ readonly ZOMBIE: 16n; /** Machine. */ readonly MACHINE: 32n; /** Aqua. */ readonly AQUA: 64n; /** Pyro. */ readonly PYRO: 128n; /** Rock. */ readonly ROCK: 256n; /** Winged beast. */ readonly WINGEDBEAST: 512n; /** Plant. */ readonly PLANT: 1024n; /** Insect. */ readonly INSECT: 2048n; /** Thunder. */ readonly THUNDER: 4096n; /** Dragon. */ readonly DRAGON: 8192n; /** Beast. */ readonly BEAST: 16384n; /** Beast-warrior. */ readonly BEASTWARRIOR: 32768n; /** Dinosaur. */ readonly DINOSAUR: 65536n; /** Fish. */ readonly FISH: 131072n; /** Seaserpent. */ readonly SEASERPENT: 262144n; /** Reptile. */ readonly REPTILE: 524288n; /** Psychic. */ readonly PSYCHIC: 1048576n; /** Divine. */ readonly DIVINE: 2097152n; /** Creator god. */ readonly CREATORGOD: 4194304n; /** Wyrm. */ readonly WYRM: 8388608n; /** Cyberse. */ readonly CYBERSE: 16777216n; /** Illusion. */ readonly ILLUSION: 33554432n; /** Cyborg. */ readonly CYBORG: 67108864n; /** Magical knight. */ readonly MAGICALKNIGHT: 134217728n; /** High dragon. */ readonly HIGHDRAGON: 268435456n; /** Omega psychic. */ readonly OMEGAPSYCHIC: 536870912n; /** Celestial warrior. */ readonly CELESTIALWARRIOR: 1073741824n; /** Galaxy. */ readonly GALAXY: 2147483648n; }; /** * Parse a {@link (OcgRace:type)} mask and return the matching races. * @param race - The mask to parse. */ export declare function ocgRaceParse(race: OcgRace): (1n | 2n | 4n | 8n | 16n | 32n | 64n | 128n | 256n | 512n | 1024n | 2048n | 4096n | 8192n | 16384n | 32768n | 65536n | 131072n | 262144n | 524288n | 1048576n | 2097152n | 4194304n | 8388608n | 16777216n | 33554432n | 67108864n | 134217728n | 268435456n | 536870912n | 1073741824n | 2147483648n)[]; export declare const ocgRaceString: InternalMappedMap<readonly [readonly [1n, "warrior"], readonly [2n, "spellcaster"], readonly [4n, "fairy"], readonly [8n, "fiend"], readonly [16n, "zombie"], readonly [32n, "machine"], readonly [64n, "aqua"], readonly [128n, "pyro"], readonly [256n, "rock"], readonly [512n, "winged_beast"], readonly [1024n, "plant"], readonly [2048n, "insect"], readonly [4096n, "thunder"], readonly [8192n, "dragon"], readonly [16384n, "beast"], readonly [32768n, "beast_warrior"], readonly [65536n, "dinosaur"], readonly [131072n, "fish"], readonly [262144n, "sea_serpent"], readonly [524288n, "reptile"], readonly [1048576n, "psychic"], readonly [2097152n, "divine"], readonly [4194304n, "creator_god"], readonly [8388608n, "wyrm"], readonly [16777216n, "cyberse"], readonly [33554432n, "illusion"], readonly [67108864n, "cyborg"], readonly [134217728n, "magical_knight"], readonly [268435456n, "high_dragon"], readonly [536870912n, "omega_psychic"], readonly [1073741824n, "celestial_warrior"], readonly [2147483648n, "galaxy"]]>; export declare type OcgResponse = OcgResponseSelectBattleCMD | OcgResponseSelectIdleCMD | OcgResponseSelectEffectYN | OcgResponseSelectYesNo | OcgResponseSelectOption | OcgResponseSelectCard | OcgResponseSelectCardCodes | OcgResponseSelectUnselectCard | OcgResponseSelectChain | OcgResponseSelectDisfield | OcgResponseSelectPlace | OcgResponseSelectPosition | OcgResponseSelectCounter | OcgResponseSelectSum | OcgResponseSelectTribute | OcgResponseSortCard | OcgResponseAnnounceRace | OcgResponseAnnounceAttrib | OcgResponseAnnounceCard | OcgResponseAnnounceNumber | OcgResponseRockPaperScissors; export declare type OcgResponseAnnounceAttrib = { type: OcgResponseType.ANNOUNCE_ATTRIB; attributes: OcgAttribute[]; }; export declare type OcgResponseAnnounceCard = { type: OcgResponseType.ANNOUNCE_CARD; card: number; }; export declare type OcgResponseAnnounceNumber = { type: OcgResponseType.ANNOUNCE_NUMBER; value: number; }; export declare type OcgResponseAnnounceRace = { type: OcgResponseType.ANNOUNCE_RACE; races: OcgRace[]; }; export declare type OcgResponseRockPaperScissors = { type: OcgResponseType.ROCK_PAPER_SCISSORS; value: 1 | 2 | 3; }; export declare type OcgResponseSelectBattleCMD = { type: OcgResponseType.SELECT_BATTLECMD; action: SelectBattleCMDAction; index: number | null; }; export declare type OcgResponseSelectCard = { type: OcgResponseType.SELECT_CARD; indicies: number[] | null; }; export declare type OcgResponseSelectCardCodes = { type: OcgResponseType.SELECT_CARD_CODES; codes: number[] | null; }; export declare type OcgResponseSelectChain = { type: OcgResponseType.SELECT_CHAIN; index: number | null; }; export declare type OcgResponseSelectCounter = { type: OcgResponseType.SELECT_COUNTER; counters: number[]; }; export declare type OcgResponseSelectDisfield = { type: OcgResponseType.SELECT_DISFIELD; places: SelectFieldPlace[]; }; export declare type OcgResponseSelectEffectYN = { type: OcgResponseType.SELECT_EFFECTYN; yes: boolean; }; export declare type OcgResponseSelectIdleCMD = { type: OcgResponseType.SELECT_IDLECMD; action: SelectIdleCMDAction; index: number | null; }; export declare type OcgResponseSelectOption = { type: OcgResponseType.SELECT_OPTION; index: number; }; export declare type OcgResponseSelectPlace = { type: OcgResponseType.SELECT_PLACE; places: SelectFieldPlace[]; }; export declare type OcgResponseSelectPosition = { type: OcgResponseType.SELECT_POSITION; position: OcgPosition; }; export declare type OcgResponseSelectSum = { type: OcgResponseType.SELECT_SUM; indicies: number[]; }; export declare type OcgResponseSelectTribute = { type: OcgResponseType.SELECT_TRIBUTE; indicies: number[] | null; }; export declare type OcgResponseSelectUnselectCard = { type: OcgResponseType.SELECT_UNSELECT_CARD; index: number | null; }; export declare type OcgResponseSelectYesNo = { type: OcgResponseType.SELECT_YESNO; yes: boolean; }; export declare type OcgResponseSortCard = { type: OcgResponseType.SORT_CARD; order: number[] | null; }; export declare enum OcgResponseType { SELECT_BATTLECMD = 0, SELECT_IDLECMD = 1, SELECT_EFFECTYN = 2, SELECT_YESNO = 3, SELECT_OPTION = 4, SELECT_CARD = 5, SELECT_CARD_CODES = 6, SELECT_UNSELECT_CARD = 7, SELECT_CHAIN = 8, SELECT_DISFIELD = 9, SELECT_PLACE = 10, SELECT_POSITION = 11, SELECT_TRIBUTE = 12, SELECT_COUNTER = 13, SELECT_SUM = 14, SORT_CARD = 15, ANNOUNCE_RACE = 16, ANNOUNCE_ATTRIB = 17, ANNOUNCE_CARD = 18, ANNOUNCE_NUMBER = 19, ROCK_PAPER_SCISSORS = 20 } /** Rock paper scissor. */ export declare type OcgRPS = number; /** Rock paper scissor. */ export declare const OcgRPS: { /** Scissors. */ SCISSORS: number; /** Rock. */ ROCK: number; /** Paper. */ PAPER: number; }; export declare const ocgRPSString: InternalMappedMap<readonly [readonly [number, "scissors"], readonly [number, "rock"], readonly [number, "paper"]]>; /** Legality scope of a card. */ export declare type OcgScope = (typeof OcgScope)[keyof typeof OcgScope]; /** Legality scope of a card. */ export declare const OcgScope: { /** OCG legal. */ readonly OCG: 1; /** TCG legal.*/ readonly TCG: 2; /** Anime card.*/ readonly ANIME: 4; /** Cannot be used in a duel.*/ readonly ILLEGAL: 8; /** Video game card.*/ readonly VIDEO_GAME: 16; /** Custom card.*/ readonly CUSTOM: 32; /** Speed duel card.*/ readonly SPEED: 64; /** Prerelease.*/ readonly PRERELEASE: 256; /** Rush duel card.*/ readonly RUSH: 512; /** Rush duel legend card.*/ readonly LEGEND: 1024; /** Hidden.*/ readonly HIDDEN: 4096; }; export declare const ocgScopeString: InternalMappedMap<readonly [readonly [1, "ocg"], readonly [2, "tcg"], readonly [4, "anime"], readonly [8, "illegal"], readonly [16, "video_game"], readonly [32, "custom"], readonly [64, "speed"], readonly [256, "prerelease"], readonly [512, "rush"], readonly [1024, "legend"], readonly [4096, "hidden"]]>; /** Card type (monster/spell/trap and additional properties in case of a monster). */ export declare type OcgType = (typeof OcgType)[keyof typeof OcgType]; /** Card type (monster/spell/trap and additional properties in case of a monster). */ export declare const OcgType: { /** Monster. */ readonly MONSTER: 1; /** Spell. */ readonly SPELL: 2; /** Trap. */ readonly TRAP: 4; /** Normal monster. */ readonly NORMAL: 16; /** Effect monster. */ readonly EFFECT: 32; /** Fusion monster. */ readonly FUSION: 64; /** Ritual monster. */ readonly RITUAL: 128; /** Trap monster trap. */ readonly TRAPMONSTER: 256; /** Spirit monster. */ readonly SPIRIT: 512; /** Union monster. */ readonly UNION: 1024; /** Gemini monster. */ readonly GEMINI: 2048; /** Tuner monster. */ readonly TUNER: 4096; /** Synchro monster. */ readonly SYNCHRO: 8192; /** Token monster. */ readonly TOKEN: 16384; /** Maximum monster. */ readonly MAXIMUM: 32768; /** Quickplay spell. */ readonly QUICKPLAY: 65536; /** Continuous spell or trap. */ readonly CONTINUOUS: 131072; /** Equip spell. */ readonly EQUIP: 262144; /** Field spell. */ readonly FIELD: 524288; /** Counter trap. */ readonly COUNTER: 1048576; /** Flip monster. */ readonly FLIP: 2097152; /** Toon monster. */ readonly TOON: 4194304; /** Xyz monster. */ readonly XYZ: 8388608; /** Pendulum monster. */ readonly PENDULUM: 16777216; /** Special summonable monster. */ readonly SPSUMMON: 33554432; /** Link monster. */ readonly LINK: 67108864; }; /** * Parse a OcgType mask and return the matching types. * @param type - The mask to parse. */ export declare function ocgTypeParse(type: OcgType): (2 | 1 | 4 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 16384 | 4096 | 8192 | 32768 | 65536 | 131072 | 262144 | 524288 | 1048576 | 2097152 | 4194304 | 8388608 | 16777216 | 33554432 | 67108864)[]; export declare const ocgTypeString: InternalMappedMap<readonly [readonly [1, "monster"], readonly [2, "spell"], readonly [4, "trap"], readonly [16, "normal"], readonly [32, "effect"], readonly [64, "fusion"], readonly [128, "ritual"], readonly [256, "trapmonster"], readonly [512, "spirit"], readonly [1024, "union"], readonly [2048, "gemini"], readonly [4096, "tuner"], readonly [8192, "synchro"], readonly [16384, "token"], readonly [32768, "maximum"], readonly [65536, "quickplay"], readonly [131072, "continuous"], readonly [262144, "equip"], readonly [524288, "field"], readonly [1048576, "counter"], readonly [2097152, "flip"], readonly [4194304, "toon"], readonly [8388608, "xyz"], readonly [16777216, "pendulum"], readonly [33554432, "spsummon"], readonly [67108864, "link"]]>; export declare const responseTypeStrings: InternalMappedMap<readonly [readonly [OcgResponseType.SELECT_BATTLECMD, "select_battlecmd"], readonly [OcgResponseType.SELECT_IDLECMD, "select_idlecmd"], readonly [OcgResponseType.SELECT_EFFECTYN, "select_effectyn"], readonly [OcgResponseType.SELECT_YESNO, "select_yesno"], readonly [OcgResponseType.SELECT_OPTION, "select_option"], readonly [OcgResponseType.SELECT_CARD, "select_card"], readonly [OcgResponseType.SELECT_CARD_CODES, "select_card_codes"], readonly [OcgResponseType.SELECT_UNSELECT_CARD, "select_unselect_card"], readonly [OcgResponseType.SELECT_CHAIN, "select_chain"], readonly [OcgResponseType.SELECT_DISFIELD, "select_disfield"], readonly [OcgResponseType.SELECT_PLACE, "select_place"], readonly [OcgResponseType.SELECT_POSITION, "select_position"], readonly [OcgResponseType.SELECT_TRIBUTE, "select_tribute"], readonly [OcgResponseType.SELECT_COUNTER, "select_counter"], readonly [OcgResponseType.SELECT_SUM, "select_sum"], readonly [OcgResponseType.SORT_CARD, "sort_card"], readonly [OcgResponseType.ANNOUNCE_RACE, "announce_race"], readonly [OcgResponseType.ANNOUNCE_ATTRIB, "announce_attrib"], readonly [OcgResponseType.ANNOUNCE_CARD, "announce_card"], readonly [OcgResponseType.ANNOUNCE_NUMBER, "announce_number"], readonly [OcgResponseType.ROCK_PAPER_SCISSORS, "rock_paper_scissors"]]>; export declare enum SelectBattleCMDAction { SELECT_CHAIN = 0, SELECT_BATTLE = 1, TO_M2 = 2, TO_EP = 3 } export declare const selectBattleCMDActionStrings: InternalMappedMap<readonly [readonly [SelectBattleCMDAction.SELECT_CHAIN, "select_chain"], readonly [SelectBattleCMDAction.SELECT_BATTLE, "select_battle"], readonly [SelectBattleCMDAction.TO_M2, "to_m2"], readonly [SelectBattleCMDAction.TO_EP, "to_ep"]]>; export declare type SelectFieldPlace = { player: number; location: OcgLocation; sequence: number; }; export declare enum SelectIdleCMDAction { SELECT_SUMMON = 0, SELECT_SPECIAL_SUMMON = 1, SELECT_POS_CHANGE = 2, SELECT_MONSTER_SET = 3, SELECT_SPELL_SET = 4, SELECT_ACTIVATE = 5, TO_BP = 6, TO_EP = 7, SHUFFLE = 8 } export declare const selectIdleCMDActionStrings: InternalMappedMap<readonly [readonly [SelectIdleCMDAction.SELECT_SUMMON, "select_summon"], readonly [SelectIdleCMDAction.SELECT_SPECIAL_SUMMON, "select_special_summon"], readonly [SelectIdleCMDAction.SELECT_POS_CHANGE, "select_pos_change"], readonly [SelectIdleCMDAction.SELECT_MONSTER_SET, "select_monster_set"], readonly [SelectIdleCMDAction.SELECT_SPELL_SET, "select_spell_set"], readonly [SelectIdleCMDAction.SELECT_ACTIVATE, "select_activate"], readonly [SelectIdleCMDAction.TO_BP, "to_bp"], readonly [SelectIdleCMDAction.TO_EP, "to_ep"], readonly [SelectIdleCMDAction.SHUFFLE, "shuffle"]]>; export { }