ygopro-msg-encode 1.1.11 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1772,10 +1772,7 @@ var _YGOProCtosExternalAddress = class _YGOProCtosExternalAddress extends YGOPro
1772
1772
  return this;
1773
1773
  }
1774
1774
  toPayload() {
1775
- const text = this.hostname.length > CTOS_EXTERNAL_ADDRESS_MAX_HOSTNAME_LENGTH ? this.hostname.substring(
1776
- 0,
1777
- CTOS_EXTERNAL_ADDRESS_MAX_HOSTNAME_LENGTH
1778
- ) : this.hostname;
1775
+ const text = this.hostname.length > CTOS_EXTERNAL_ADDRESS_MAX_HOSTNAME_LENGTH ? this.hostname.substring(0, CTOS_EXTERNAL_ADDRESS_MAX_HOSTNAME_LENGTH) : this.hostname;
1779
1776
  const utf16 = new Uint16Array(text.length + 1);
1780
1777
  for (let i = 0; i < text.length; i++) {
1781
1778
  utf16[i] = text.charCodeAt(i);
@@ -2012,6 +2009,12 @@ var _YGOProMsgBase = class _YGOProMsgBase extends PayloadBase {
2012
2009
  getSendTargets() {
2013
2010
  return SEND_TO_ALL;
2014
2011
  }
2012
+ getRequireRefreshZones() {
2013
+ return [];
2014
+ }
2015
+ getRequireRefreshCards() {
2016
+ return [];
2017
+ }
2015
2018
  };
2016
2019
  __name(_YGOProMsgBase, "YGOProMsgBase");
2017
2020
  var YGOProMsgBase = _YGOProMsgBase;
@@ -2323,488 +2326,35 @@ var _YGOProMsgCardTarget_CardLocation = class _YGOProMsgCardTarget_CardLocation
2323
2326
  __name(_YGOProMsgCardTarget_CardLocation, "YGOProMsgCardTarget_CardLocation");
2324
2327
  __decorateClass([
2325
2328
  BinaryField("u8", 0)
2326
- ], _YGOProMsgCardTarget_CardLocation.prototype, "controller", 2);
2327
- __decorateClass([
2328
- BinaryField("u8", 1)
2329
- ], _YGOProMsgCardTarget_CardLocation.prototype, "location", 2);
2330
- __decorateClass([
2331
- BinaryField("u8", 2)
2332
- ], _YGOProMsgCardTarget_CardLocation.prototype, "sequence", 2);
2333
- var YGOProMsgCardTarget_CardLocation = _YGOProMsgCardTarget_CardLocation;
2334
- var _YGOProMsgCardTarget = class _YGOProMsgCardTarget extends YGOProMsgBase {
2335
- };
2336
- __name(_YGOProMsgCardTarget, "YGOProMsgCardTarget");
2337
- _YGOProMsgCardTarget.identifier = OcgcoreCommonConstants.MSG_CARD_TARGET;
2338
- __decorateClass([
2339
- BinaryField(() => YGOProMsgCardTarget_CardLocation, 0)
2340
- ], _YGOProMsgCardTarget.prototype, "card1", 2);
2341
- __decorateClass([
2342
- BinaryField(() => YGOProMsgCardTarget_CardLocation, 3)
2343
- ], _YGOProMsgCardTarget.prototype, "card2", 2);
2344
- var YGOProMsgCardTarget = _YGOProMsgCardTarget;
2345
-
2346
- // src/protos/msg/proto/chain-disabled.ts
2347
- var _YGOProMsgChainDisabled = class _YGOProMsgChainDisabled extends YGOProMsgBase {
2348
- };
2349
- __name(_YGOProMsgChainDisabled, "YGOProMsgChainDisabled");
2350
- _YGOProMsgChainDisabled.identifier = OcgcoreCommonConstants.MSG_CHAIN_DISABLED;
2351
- __decorateClass([
2352
- BinaryField("u8", 0)
2353
- ], _YGOProMsgChainDisabled.prototype, "chainCount", 2);
2354
- var YGOProMsgChainDisabled = _YGOProMsgChainDisabled;
2355
-
2356
- // src/protos/msg/proto/chain-end.ts
2357
- var _YGOProMsgChainEnd = class _YGOProMsgChainEnd extends YGOProMsgBase {
2358
- };
2359
- __name(_YGOProMsgChainEnd, "YGOProMsgChainEnd");
2360
- _YGOProMsgChainEnd.identifier = OcgcoreCommonConstants.MSG_CHAIN_END;
2361
- var YGOProMsgChainEnd = _YGOProMsgChainEnd;
2362
-
2363
- // src/protos/msg/proto/chain-negated.ts
2364
- var _YGOProMsgChainNegated = class _YGOProMsgChainNegated extends YGOProMsgBase {
2365
- };
2366
- __name(_YGOProMsgChainNegated, "YGOProMsgChainNegated");
2367
- _YGOProMsgChainNegated.identifier = OcgcoreCommonConstants.MSG_CHAIN_NEGATED;
2368
- __decorateClass([
2369
- BinaryField("u8", 0)
2370
- ], _YGOProMsgChainNegated.prototype, "chainCount", 2);
2371
- var YGOProMsgChainNegated = _YGOProMsgChainNegated;
2372
-
2373
- // src/protos/msg/proto/chain-solved.ts
2374
- var _YGOProMsgChainSolved = class _YGOProMsgChainSolved extends YGOProMsgBase {
2375
- };
2376
- __name(_YGOProMsgChainSolved, "YGOProMsgChainSolved");
2377
- _YGOProMsgChainSolved.identifier = OcgcoreCommonConstants.MSG_CHAIN_SOLVED;
2378
- __decorateClass([
2379
- BinaryField("u8", 0)
2380
- ], _YGOProMsgChainSolved.prototype, "chainCount", 2);
2381
- var YGOProMsgChainSolved = _YGOProMsgChainSolved;
2382
-
2383
- // src/protos/msg/proto/chain-solving.ts
2384
- var _YGOProMsgChainSolving = class _YGOProMsgChainSolving extends YGOProMsgBase {
2385
- };
2386
- __name(_YGOProMsgChainSolving, "YGOProMsgChainSolving");
2387
- _YGOProMsgChainSolving.identifier = OcgcoreCommonConstants.MSG_CHAIN_SOLVING;
2388
- __decorateClass([
2389
- BinaryField("u8", 0)
2390
- ], _YGOProMsgChainSolving.prototype, "chainCount", 2);
2391
- var YGOProMsgChainSolving = _YGOProMsgChainSolving;
2392
-
2393
- // src/protos/msg/proto/chained.ts
2394
- var _YGOProMsgChained = class _YGOProMsgChained extends YGOProMsgBase {
2395
- };
2396
- __name(_YGOProMsgChained, "YGOProMsgChained");
2397
- _YGOProMsgChained.identifier = OcgcoreCommonConstants.MSG_CHAINED;
2398
- __decorateClass([
2399
- BinaryField("u8", 0)
2400
- ], _YGOProMsgChained.prototype, "chainCount", 2);
2401
- var YGOProMsgChained = _YGOProMsgChained;
2402
-
2403
- // src/protos/msg/proto/chaining.ts
2404
- var _YGOProMsgChaining = class _YGOProMsgChaining extends YGOProMsgBase {
2405
- };
2406
- __name(_YGOProMsgChaining, "YGOProMsgChaining");
2407
- _YGOProMsgChaining.identifier = OcgcoreCommonConstants.MSG_CHAINING;
2408
- __decorateClass([
2409
- BinaryField("i32", 0)
2410
- ], _YGOProMsgChaining.prototype, "code", 2);
2411
- __decorateClass([
2412
- BinaryField("u8", 4)
2413
- ], _YGOProMsgChaining.prototype, "controller", 2);
2414
- __decorateClass([
2415
- BinaryField("u8", 5)
2416
- ], _YGOProMsgChaining.prototype, "location", 2);
2417
- __decorateClass([
2418
- BinaryField("u8", 6)
2419
- ], _YGOProMsgChaining.prototype, "sequence", 2);
2420
- __decorateClass([
2421
- BinaryField("u8", 7)
2422
- ], _YGOProMsgChaining.prototype, "subsequence", 2);
2423
- __decorateClass([
2424
- BinaryField("u8", 8)
2425
- ], _YGOProMsgChaining.prototype, "chainCount", 2);
2426
- __decorateClass([
2427
- BinaryField("i32", 9)
2428
- ], _YGOProMsgChaining.prototype, "desc", 2);
2429
- __decorateClass([
2430
- BinaryField("u8", 13)
2431
- ], _YGOProMsgChaining.prototype, "chainPlayer", 2);
2432
- var YGOProMsgChaining = _YGOProMsgChaining;
2433
-
2434
- // src/protos/msg/proto/confirm-cards.ts
2435
- var _YGOProMsgConfirmCards_CardInfo = class _YGOProMsgConfirmCards_CardInfo {
2436
- };
2437
- __name(_YGOProMsgConfirmCards_CardInfo, "YGOProMsgConfirmCards_CardInfo");
2438
- __decorateClass([
2439
- BinaryField("i32", 0)
2440
- ], _YGOProMsgConfirmCards_CardInfo.prototype, "code", 2);
2441
- __decorateClass([
2442
- BinaryField("u8", 4)
2443
- ], _YGOProMsgConfirmCards_CardInfo.prototype, "controller", 2);
2444
- __decorateClass([
2445
- BinaryField("u8", 5)
2446
- ], _YGOProMsgConfirmCards_CardInfo.prototype, "location", 2);
2447
- __decorateClass([
2448
- BinaryField("u8", 6)
2449
- ], _YGOProMsgConfirmCards_CardInfo.prototype, "sequence", 2);
2450
- var YGOProMsgConfirmCards_CardInfo = _YGOProMsgConfirmCards_CardInfo;
2451
- var _YGOProMsgConfirmCards = class _YGOProMsgConfirmCards extends YGOProMsgBase {
2452
- // 对方视角可能需要隐藏卡片信息
2453
- opponentView() {
2454
- const view = this.copy();
2455
- view.cards = view.cards.map((card) => {
2456
- const c = { ...card };
2457
- if (!(c.code & 2147483648)) {
2458
- c.code = 0;
2459
- }
2460
- return c;
2461
- });
2462
- return view;
2463
- }
2464
- getSendTargets() {
2465
- if (this.cards.length > 0 && this.cards[0].location === 1) {
2466
- return [this.player];
2467
- }
2468
- return SEND_TO_ALL;
2469
- }
2470
- };
2471
- __name(_YGOProMsgConfirmCards, "YGOProMsgConfirmCards");
2472
- _YGOProMsgConfirmCards.identifier = OcgcoreCommonConstants.MSG_CONFIRM_CARDS;
2473
- __decorateClass([
2474
- BinaryField("u8", 0)
2475
- ], _YGOProMsgConfirmCards.prototype, "player", 2);
2476
- __decorateClass([
2477
- BinaryField("u8", 1)
2478
- ], _YGOProMsgConfirmCards.prototype, "skipPanel", 2);
2479
- __decorateClass([
2480
- BinaryField("u8", 2)
2481
- ], _YGOProMsgConfirmCards.prototype, "count", 2);
2482
- __decorateClass([
2483
- BinaryField(() => YGOProMsgConfirmCards_CardInfo, 3, (obj) => obj.count)
2484
- ], _YGOProMsgConfirmCards.prototype, "cards", 2);
2485
- var YGOProMsgConfirmCards = _YGOProMsgConfirmCards;
2486
-
2487
- // src/protos/msg/proto/confirm-decktop.ts
2488
- var _YGOProMsgConfirmDeckTop_CardInfo = class _YGOProMsgConfirmDeckTop_CardInfo {
2489
- };
2490
- __name(_YGOProMsgConfirmDeckTop_CardInfo, "YGOProMsgConfirmDeckTop_CardInfo");
2491
- __decorateClass([
2492
- BinaryField("i32", 0)
2493
- ], _YGOProMsgConfirmDeckTop_CardInfo.prototype, "code", 2);
2494
- __decorateClass([
2495
- BinaryField("u8", 4)
2496
- ], _YGOProMsgConfirmDeckTop_CardInfo.prototype, "controller", 2);
2497
- __decorateClass([
2498
- BinaryField("u8", 5)
2499
- ], _YGOProMsgConfirmDeckTop_CardInfo.prototype, "location", 2);
2500
- __decorateClass([
2501
- BinaryField("u8", 6)
2502
- ], _YGOProMsgConfirmDeckTop_CardInfo.prototype, "sequence", 2);
2503
- var YGOProMsgConfirmDeckTop_CardInfo = _YGOProMsgConfirmDeckTop_CardInfo;
2504
- var _YGOProMsgConfirmDeckTop = class _YGOProMsgConfirmDeckTop extends YGOProMsgBase {
2505
- // 对方视角可能需要隐藏卡片信息
2506
- opponentView() {
2507
- const view = this.copy();
2508
- view.cards = view.cards.map((card) => {
2509
- const c = { ...card };
2510
- if (!(c.code & 2147483648)) {
2511
- c.code = 0;
2512
- }
2513
- return c;
2514
- });
2515
- return view;
2516
- }
2517
- // confirm-decktop 使用基类的 playerView (基于 player 字段)
2518
- };
2519
- __name(_YGOProMsgConfirmDeckTop, "YGOProMsgConfirmDeckTop");
2520
- _YGOProMsgConfirmDeckTop.identifier = OcgcoreCommonConstants.MSG_CONFIRM_DECKTOP;
2521
- __decorateClass([
2522
- BinaryField("u8", 0)
2523
- ], _YGOProMsgConfirmDeckTop.prototype, "player", 2);
2524
- __decorateClass([
2525
- BinaryField("u8", 1)
2526
- ], _YGOProMsgConfirmDeckTop.prototype, "count", 2);
2527
- __decorateClass([
2528
- BinaryField(() => YGOProMsgConfirmDeckTop_CardInfo, 2, (obj) => obj.count)
2529
- ], _YGOProMsgConfirmDeckTop.prototype, "cards", 2);
2530
- var YGOProMsgConfirmDeckTop = _YGOProMsgConfirmDeckTop;
2531
-
2532
- // src/protos/msg/proto/confirm-extratop.ts
2533
- var _YGOProMsgConfirmExtraTop_CardInfo = class _YGOProMsgConfirmExtraTop_CardInfo {
2534
- };
2535
- __name(_YGOProMsgConfirmExtraTop_CardInfo, "YGOProMsgConfirmExtraTop_CardInfo");
2536
- __decorateClass([
2537
- BinaryField("i32", 0)
2538
- ], _YGOProMsgConfirmExtraTop_CardInfo.prototype, "code", 2);
2539
- __decorateClass([
2540
- BinaryField("u8", 4)
2541
- ], _YGOProMsgConfirmExtraTop_CardInfo.prototype, "controller", 2);
2542
- __decorateClass([
2543
- BinaryField("u8", 5)
2544
- ], _YGOProMsgConfirmExtraTop_CardInfo.prototype, "location", 2);
2545
- __decorateClass([
2546
- BinaryField("u8", 6)
2547
- ], _YGOProMsgConfirmExtraTop_CardInfo.prototype, "sequence", 2);
2548
- var YGOProMsgConfirmExtraTop_CardInfo = _YGOProMsgConfirmExtraTop_CardInfo;
2549
- var _YGOProMsgConfirmExtraTop = class _YGOProMsgConfirmExtraTop extends YGOProMsgBase {
2550
- // 对方视角可能需要隐藏卡片信息
2551
- opponentView() {
2552
- const view = this.copy();
2553
- view.cards = view.cards.map((card) => {
2554
- const c = { ...card };
2555
- if (!(c.code & 2147483648)) {
2556
- c.code = 0;
2557
- }
2558
- return c;
2559
- });
2560
- return view;
2561
- }
2562
- // confirm-extratop 使用基类的 playerView (基于 player 字段)
2563
- };
2564
- __name(_YGOProMsgConfirmExtraTop, "YGOProMsgConfirmExtraTop");
2565
- _YGOProMsgConfirmExtraTop.identifier = OcgcoreCommonConstants.MSG_CONFIRM_EXTRATOP;
2566
- __decorateClass([
2567
- BinaryField("u8", 0)
2568
- ], _YGOProMsgConfirmExtraTop.prototype, "player", 2);
2569
- __decorateClass([
2570
- BinaryField("u8", 1)
2571
- ], _YGOProMsgConfirmExtraTop.prototype, "count", 2);
2572
- __decorateClass([
2573
- BinaryField(() => YGOProMsgConfirmExtraTop_CardInfo, 2, (obj) => obj.count)
2574
- ], _YGOProMsgConfirmExtraTop.prototype, "cards", 2);
2575
- var YGOProMsgConfirmExtraTop = _YGOProMsgConfirmExtraTop;
2576
-
2577
- // src/protos/msg/proto/damage.ts
2578
- var _YGOProMsgDamage = class _YGOProMsgDamage extends YGOProMsgBase {
2579
- };
2580
- __name(_YGOProMsgDamage, "YGOProMsgDamage");
2581
- _YGOProMsgDamage.identifier = OcgcoreCommonConstants.MSG_DAMAGE;
2582
- __decorateClass([
2583
- BinaryField("u8", 0)
2584
- ], _YGOProMsgDamage.prototype, "player", 2);
2585
- __decorateClass([
2586
- BinaryField("i32", 1)
2587
- ], _YGOProMsgDamage.prototype, "value", 2);
2588
- var YGOProMsgDamage = _YGOProMsgDamage;
2589
-
2590
- // src/protos/msg/proto/damage-step-end.ts
2591
- var _YGOProMsgDamageStepEnd = class _YGOProMsgDamageStepEnd extends YGOProMsgBase {
2592
- };
2593
- __name(_YGOProMsgDamageStepEnd, "YGOProMsgDamageStepEnd");
2594
- _YGOProMsgDamageStepEnd.identifier = OcgcoreCommonConstants.MSG_DAMAGE_STEP_END;
2595
- var YGOProMsgDamageStepEnd = _YGOProMsgDamageStepEnd;
2596
-
2597
- // src/protos/msg/proto/damage-step-start.ts
2598
- var _YGOProMsgDamageStepStart = class _YGOProMsgDamageStepStart extends YGOProMsgBase {
2599
- };
2600
- __name(_YGOProMsgDamageStepStart, "YGOProMsgDamageStepStart");
2601
- _YGOProMsgDamageStepStart.identifier = OcgcoreCommonConstants.MSG_DAMAGE_STEP_START;
2602
- var YGOProMsgDamageStepStart = _YGOProMsgDamageStepStart;
2603
-
2604
- // src/protos/msg/proto/deck-top.ts
2605
- var _YGOProMsgDeckTop = class _YGOProMsgDeckTop extends YGOProMsgBase {
2606
- // 对方视角可能需要隐藏卡片信息
2607
- opponentView() {
2608
- const view = this.copy();
2609
- if (!(view.code & 2147483648)) {
2610
- view.code = 0;
2611
- }
2612
- return view;
2613
- }
2614
- // deck-top 使用基类的 playerView (基于 player 字段)
2615
- };
2616
- __name(_YGOProMsgDeckTop, "YGOProMsgDeckTop");
2617
- _YGOProMsgDeckTop.identifier = OcgcoreCommonConstants.MSG_DECK_TOP;
2618
- __decorateClass([
2619
- BinaryField("u8", 0)
2620
- ], _YGOProMsgDeckTop.prototype, "player", 2);
2621
- __decorateClass([
2622
- BinaryField("u8", 1)
2623
- ], _YGOProMsgDeckTop.prototype, "sequence", 2);
2624
- __decorateClass([
2625
- BinaryField("i32", 2)
2626
- ], _YGOProMsgDeckTop.prototype, "code", 2);
2627
- var YGOProMsgDeckTop = _YGOProMsgDeckTop;
2628
-
2629
- // src/protos/msg/proto/draw.ts
2630
- var _YGOProMsgDraw = class _YGOProMsgDraw extends YGOProMsgBase {
2631
- // 对方视角需要隐藏抽到的卡(如果卡片标志位 0x80 未设置)
2632
- opponentView() {
2633
- const view = this.copy();
2634
- view.cards = view.cards.map((card) => {
2635
- if (!(card & 2147483648)) {
2636
- return 0;
2637
- }
2638
- return card;
2639
- });
2640
- return view;
2641
- }
2642
- };
2643
- __name(_YGOProMsgDraw, "YGOProMsgDraw");
2644
- _YGOProMsgDraw.identifier = OcgcoreCommonConstants.MSG_DRAW;
2645
- __decorateClass([
2646
- BinaryField("u8", 0)
2647
- ], _YGOProMsgDraw.prototype, "player", 2);
2648
- __decorateClass([
2649
- BinaryField("u8", 1)
2650
- ], _YGOProMsgDraw.prototype, "count", 2);
2651
- __decorateClass([
2652
- BinaryField("i32", 2, (obj) => obj.count)
2653
- ], _YGOProMsgDraw.prototype, "cards", 2);
2654
- var YGOProMsgDraw = _YGOProMsgDraw;
2655
-
2656
- // src/protos/msg/proto/equip.ts
2657
- var _YGOProMsgEquip_CardLocation = class _YGOProMsgEquip_CardLocation {
2658
- };
2659
- __name(_YGOProMsgEquip_CardLocation, "YGOProMsgEquip_CardLocation");
2660
- __decorateClass([
2661
- BinaryField("u8", 0)
2662
- ], _YGOProMsgEquip_CardLocation.prototype, "controller", 2);
2663
- __decorateClass([
2664
- BinaryField("u8", 1)
2665
- ], _YGOProMsgEquip_CardLocation.prototype, "location", 2);
2666
- __decorateClass([
2667
- BinaryField("u8", 2)
2668
- ], _YGOProMsgEquip_CardLocation.prototype, "sequence", 2);
2669
- var YGOProMsgEquip_CardLocation = _YGOProMsgEquip_CardLocation;
2670
- var _YGOProMsgEquip = class _YGOProMsgEquip extends YGOProMsgBase {
2671
- };
2672
- __name(_YGOProMsgEquip, "YGOProMsgEquip");
2673
- _YGOProMsgEquip.identifier = OcgcoreCommonConstants.MSG_EQUIP;
2674
- __decorateClass([
2675
- BinaryField(() => YGOProMsgEquip_CardLocation, 0)
2676
- ], _YGOProMsgEquip.prototype, "equip", 2);
2677
- __decorateClass([
2678
- BinaryField(() => YGOProMsgEquip_CardLocation, 3)
2679
- ], _YGOProMsgEquip.prototype, "target", 2);
2680
- __decorateClass([
2681
- BinaryField("u8", 6)
2682
- ], _YGOProMsgEquip.prototype, "position", 2);
2683
- var YGOProMsgEquip = _YGOProMsgEquip;
2684
-
2685
- // src/protos/msg/proto/field-disabled.ts
2686
- var _YGOProMsgFieldDisabled = class _YGOProMsgFieldDisabled extends YGOProMsgBase {
2687
- };
2688
- __name(_YGOProMsgFieldDisabled, "YGOProMsgFieldDisabled");
2689
- _YGOProMsgFieldDisabled.identifier = OcgcoreCommonConstants.MSG_FIELD_DISABLED;
2690
- __decorateClass([
2691
- BinaryField("u32", 0)
2692
- ], _YGOProMsgFieldDisabled.prototype, "disabledField", 2);
2693
- var YGOProMsgFieldDisabled = _YGOProMsgFieldDisabled;
2694
-
2695
- // src/protos/msg/proto/flipsummoned.ts
2696
- var _YGOProMsgFlipSummoned = class _YGOProMsgFlipSummoned extends YGOProMsgBase {
2697
- };
2698
- __name(_YGOProMsgFlipSummoned, "YGOProMsgFlipSummoned");
2699
- _YGOProMsgFlipSummoned.identifier = OcgcoreCommonConstants.MSG_FLIPSUMMONED;
2700
- var YGOProMsgFlipSummoned = _YGOProMsgFlipSummoned;
2701
-
2702
- // src/protos/msg/proto/flipsummoning.ts
2703
- var _YGOProMsgFlipSummoning = class _YGOProMsgFlipSummoning extends YGOProMsgBase {
2704
- };
2705
- __name(_YGOProMsgFlipSummoning, "YGOProMsgFlipSummoning");
2706
- _YGOProMsgFlipSummoning.identifier = OcgcoreCommonConstants.MSG_FLIPSUMMONING;
2707
- __decorateClass([
2708
- BinaryField("i32", 0)
2709
- ], _YGOProMsgFlipSummoning.prototype, "code", 2);
2710
- __decorateClass([
2711
- BinaryField("u8", 4)
2712
- ], _YGOProMsgFlipSummoning.prototype, "controller", 2);
2713
- __decorateClass([
2714
- BinaryField("u8", 5)
2715
- ], _YGOProMsgFlipSummoning.prototype, "location", 2);
2716
- __decorateClass([
2717
- BinaryField("u8", 6)
2718
- ], _YGOProMsgFlipSummoning.prototype, "sequence", 2);
2719
- __decorateClass([
2720
- BinaryField("u8", 7)
2721
- ], _YGOProMsgFlipSummoning.prototype, "position", 2);
2722
- var YGOProMsgFlipSummoning = _YGOProMsgFlipSummoning;
2723
-
2724
- // src/protos/msg/proto/hand-res.ts
2725
- var _YGOProMsgHandRes = class _YGOProMsgHandRes extends YGOProMsgBase {
2726
- };
2727
- __name(_YGOProMsgHandRes, "YGOProMsgHandRes");
2728
- _YGOProMsgHandRes.identifier = OcgcoreCommonConstants.MSG_HAND_RES;
2729
- __decorateClass([
2730
- BinaryField("u8", 0)
2731
- ], _YGOProMsgHandRes.prototype, "result", 2);
2732
- var YGOProMsgHandRes = _YGOProMsgHandRes;
2733
-
2734
- // src/protos/msg/proto/hint.ts
2735
- var HINT_TYPES_SEND_TO_SELF = /* @__PURE__ */ new Set([1, 2, 3, 5]);
2736
- var HINT_TYPES_SEND_TO_OPPONENT = /* @__PURE__ */ new Set([4, 6, 7, 8, 9, 11]);
2737
- var _YGOProMsgHint = class _YGOProMsgHint extends YGOProMsgBase {
2738
- getSendTargets() {
2739
- if (HINT_TYPES_SEND_TO_SELF.has(this.type)) {
2740
- return [this.player];
2741
- }
2742
- if (HINT_TYPES_SEND_TO_OPPONENT.has(this.type)) {
2743
- return [1 - this.player, 7 /* OBSERVER */];
2744
- }
2745
- return SEND_TO_ALL;
2746
- }
2747
- };
2748
- __name(_YGOProMsgHint, "YGOProMsgHint");
2749
- _YGOProMsgHint.identifier = OcgcoreCommonConstants.MSG_HINT;
2750
- __decorateClass([
2751
- BinaryField("u8", 0)
2752
- ], _YGOProMsgHint.prototype, "type", 2);
2753
- __decorateClass([
2754
- BinaryField("u8", 1)
2755
- ], _YGOProMsgHint.prototype, "player", 2);
2756
- __decorateClass([
2757
- BinaryField("i32", 2)
2758
- ], _YGOProMsgHint.prototype, "desc", 2);
2759
- var YGOProMsgHint = _YGOProMsgHint;
2760
-
2761
- // src/protos/msg/proto/lpupdate.ts
2762
- var _YGOProMsgLpUpdate = class _YGOProMsgLpUpdate extends YGOProMsgBase {
2763
- };
2764
- __name(_YGOProMsgLpUpdate, "YGOProMsgLpUpdate");
2765
- _YGOProMsgLpUpdate.identifier = OcgcoreCommonConstants.MSG_LPUPDATE;
2766
- __decorateClass([
2767
- BinaryField("u8", 0)
2768
- ], _YGOProMsgLpUpdate.prototype, "player", 2);
2769
- __decorateClass([
2770
- BinaryField("i32", 1)
2771
- ], _YGOProMsgLpUpdate.prototype, "lp", 2);
2772
- var YGOProMsgLpUpdate = _YGOProMsgLpUpdate;
2773
-
2774
- // src/protos/msg/proto/match-kill.ts
2775
- var _YGOProMsgMatchKill = class _YGOProMsgMatchKill extends YGOProMsgBase {
2776
- };
2777
- __name(_YGOProMsgMatchKill, "YGOProMsgMatchKill");
2778
- _YGOProMsgMatchKill.identifier = OcgcoreCommonConstants.MSG_MATCH_KILL;
2779
- __decorateClass([
2780
- BinaryField("i32", 0)
2781
- ], _YGOProMsgMatchKill.prototype, "code", 2);
2782
- var YGOProMsgMatchKill = _YGOProMsgMatchKill;
2783
-
2784
- // src/protos/msg/proto/missed-effect.ts
2785
- var _YGOProMsgMissedEffect = class _YGOProMsgMissedEffect extends YGOProMsgBase {
2786
- getSendTargets() {
2787
- return [this.controller];
2788
- }
2789
- };
2790
- __name(_YGOProMsgMissedEffect, "YGOProMsgMissedEffect");
2791
- _YGOProMsgMissedEffect.identifier = OcgcoreCommonConstants.MSG_MISSED_EFFECT;
2792
- __decorateClass([
2793
- BinaryField("u8", 0)
2794
- ], _YGOProMsgMissedEffect.prototype, "controller", 2);
2329
+ ], _YGOProMsgCardTarget_CardLocation.prototype, "controller", 2);
2795
2330
  __decorateClass([
2796
2331
  BinaryField("u8", 1)
2797
- ], _YGOProMsgMissedEffect.prototype, "location", 2);
2332
+ ], _YGOProMsgCardTarget_CardLocation.prototype, "location", 2);
2798
2333
  __decorateClass([
2799
2334
  BinaryField("u8", 2)
2800
- ], _YGOProMsgMissedEffect.prototype, "sequence", 2);
2335
+ ], _YGOProMsgCardTarget_CardLocation.prototype, "sequence", 2);
2336
+ var YGOProMsgCardTarget_CardLocation = _YGOProMsgCardTarget_CardLocation;
2337
+ var _YGOProMsgCardTarget = class _YGOProMsgCardTarget extends YGOProMsgBase {
2338
+ };
2339
+ __name(_YGOProMsgCardTarget, "YGOProMsgCardTarget");
2340
+ _YGOProMsgCardTarget.identifier = OcgcoreCommonConstants.MSG_CARD_TARGET;
2801
2341
  __decorateClass([
2802
- BinaryField("u8", 3)
2803
- ], _YGOProMsgMissedEffect.prototype, "position", 2);
2342
+ BinaryField(() => YGOProMsgCardTarget_CardLocation, 0)
2343
+ ], _YGOProMsgCardTarget.prototype, "card1", 2);
2804
2344
  __decorateClass([
2805
- BinaryField("i32", 4)
2806
- ], _YGOProMsgMissedEffect.prototype, "code", 2);
2807
- var YGOProMsgMissedEffect = _YGOProMsgMissedEffect;
2345
+ BinaryField(() => YGOProMsgCardTarget_CardLocation, 3)
2346
+ ], _YGOProMsgCardTarget.prototype, "card2", 2);
2347
+ var YGOProMsgCardTarget = _YGOProMsgCardTarget;
2348
+
2349
+ // src/protos/msg/proto/chain-disabled.ts
2350
+ var _YGOProMsgChainDisabled = class _YGOProMsgChainDisabled extends YGOProMsgBase {
2351
+ };
2352
+ __name(_YGOProMsgChainDisabled, "YGOProMsgChainDisabled");
2353
+ _YGOProMsgChainDisabled.identifier = OcgcoreCommonConstants.MSG_CHAIN_DISABLED;
2354
+ __decorateClass([
2355
+ BinaryField("u8", 0)
2356
+ ], _YGOProMsgChainDisabled.prototype, "chainCount", 2);
2357
+ var YGOProMsgChainDisabled = _YGOProMsgChainDisabled;
2808
2358
 
2809
2359
  // src/vendor/script-constants.ts
2810
2360
  var OcgcoreScriptConstants = {
@@ -3644,6 +3194,508 @@ var OcgcoreScriptConstants = {
3644
3194
  TYPE_XYZ: 8388608
3645
3195
  };
3646
3196
 
3197
+ // src/protos/msg/proto/chain-end.ts
3198
+ var _YGOProMsgChainEnd = class _YGOProMsgChainEnd extends YGOProMsgBase {
3199
+ getRequireRefreshZones() {
3200
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE | OcgcoreScriptConstants.LOCATION_HAND;
3201
+ return [
3202
+ { player: 0, location },
3203
+ { player: 1, location }
3204
+ ];
3205
+ }
3206
+ };
3207
+ __name(_YGOProMsgChainEnd, "YGOProMsgChainEnd");
3208
+ _YGOProMsgChainEnd.identifier = OcgcoreCommonConstants.MSG_CHAIN_END;
3209
+ var YGOProMsgChainEnd = _YGOProMsgChainEnd;
3210
+
3211
+ // src/protos/msg/proto/chain-negated.ts
3212
+ var _YGOProMsgChainNegated = class _YGOProMsgChainNegated extends YGOProMsgBase {
3213
+ };
3214
+ __name(_YGOProMsgChainNegated, "YGOProMsgChainNegated");
3215
+ _YGOProMsgChainNegated.identifier = OcgcoreCommonConstants.MSG_CHAIN_NEGATED;
3216
+ __decorateClass([
3217
+ BinaryField("u8", 0)
3218
+ ], _YGOProMsgChainNegated.prototype, "chainCount", 2);
3219
+ var YGOProMsgChainNegated = _YGOProMsgChainNegated;
3220
+
3221
+ // src/protos/msg/proto/chain-solved.ts
3222
+ var _YGOProMsgChainSolved = class _YGOProMsgChainSolved extends YGOProMsgBase {
3223
+ getRequireRefreshZones() {
3224
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE | OcgcoreScriptConstants.LOCATION_HAND;
3225
+ return [
3226
+ { player: 0, location },
3227
+ { player: 1, location }
3228
+ ];
3229
+ }
3230
+ };
3231
+ __name(_YGOProMsgChainSolved, "YGOProMsgChainSolved");
3232
+ _YGOProMsgChainSolved.identifier = OcgcoreCommonConstants.MSG_CHAIN_SOLVED;
3233
+ __decorateClass([
3234
+ BinaryField("u8", 0)
3235
+ ], _YGOProMsgChainSolved.prototype, "chainCount", 2);
3236
+ var YGOProMsgChainSolved = _YGOProMsgChainSolved;
3237
+
3238
+ // src/protos/msg/proto/chain-solving.ts
3239
+ var _YGOProMsgChainSolving = class _YGOProMsgChainSolving extends YGOProMsgBase {
3240
+ };
3241
+ __name(_YGOProMsgChainSolving, "YGOProMsgChainSolving");
3242
+ _YGOProMsgChainSolving.identifier = OcgcoreCommonConstants.MSG_CHAIN_SOLVING;
3243
+ __decorateClass([
3244
+ BinaryField("u8", 0)
3245
+ ], _YGOProMsgChainSolving.prototype, "chainCount", 2);
3246
+ var YGOProMsgChainSolving = _YGOProMsgChainSolving;
3247
+
3248
+ // src/protos/msg/proto/chained.ts
3249
+ var _YGOProMsgChained = class _YGOProMsgChained extends YGOProMsgBase {
3250
+ getRequireRefreshZones() {
3251
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE | OcgcoreScriptConstants.LOCATION_HAND;
3252
+ return [
3253
+ { player: 0, location },
3254
+ { player: 1, location }
3255
+ ];
3256
+ }
3257
+ };
3258
+ __name(_YGOProMsgChained, "YGOProMsgChained");
3259
+ _YGOProMsgChained.identifier = OcgcoreCommonConstants.MSG_CHAINED;
3260
+ __decorateClass([
3261
+ BinaryField("u8", 0)
3262
+ ], _YGOProMsgChained.prototype, "chainCount", 2);
3263
+ var YGOProMsgChained = _YGOProMsgChained;
3264
+
3265
+ // src/protos/msg/proto/chaining.ts
3266
+ var _YGOProMsgChaining = class _YGOProMsgChaining extends YGOProMsgBase {
3267
+ };
3268
+ __name(_YGOProMsgChaining, "YGOProMsgChaining");
3269
+ _YGOProMsgChaining.identifier = OcgcoreCommonConstants.MSG_CHAINING;
3270
+ __decorateClass([
3271
+ BinaryField("i32", 0)
3272
+ ], _YGOProMsgChaining.prototype, "code", 2);
3273
+ __decorateClass([
3274
+ BinaryField("u8", 4)
3275
+ ], _YGOProMsgChaining.prototype, "controller", 2);
3276
+ __decorateClass([
3277
+ BinaryField("u8", 5)
3278
+ ], _YGOProMsgChaining.prototype, "location", 2);
3279
+ __decorateClass([
3280
+ BinaryField("u8", 6)
3281
+ ], _YGOProMsgChaining.prototype, "sequence", 2);
3282
+ __decorateClass([
3283
+ BinaryField("u8", 7)
3284
+ ], _YGOProMsgChaining.prototype, "subsequence", 2);
3285
+ __decorateClass([
3286
+ BinaryField("u8", 8)
3287
+ ], _YGOProMsgChaining.prototype, "chainCount", 2);
3288
+ __decorateClass([
3289
+ BinaryField("i32", 9)
3290
+ ], _YGOProMsgChaining.prototype, "desc", 2);
3291
+ __decorateClass([
3292
+ BinaryField("u8", 13)
3293
+ ], _YGOProMsgChaining.prototype, "chainPlayer", 2);
3294
+ var YGOProMsgChaining = _YGOProMsgChaining;
3295
+
3296
+ // src/protos/msg/proto/confirm-cards.ts
3297
+ var _YGOProMsgConfirmCards_CardInfo = class _YGOProMsgConfirmCards_CardInfo {
3298
+ };
3299
+ __name(_YGOProMsgConfirmCards_CardInfo, "YGOProMsgConfirmCards_CardInfo");
3300
+ __decorateClass([
3301
+ BinaryField("i32", 0)
3302
+ ], _YGOProMsgConfirmCards_CardInfo.prototype, "code", 2);
3303
+ __decorateClass([
3304
+ BinaryField("u8", 4)
3305
+ ], _YGOProMsgConfirmCards_CardInfo.prototype, "controller", 2);
3306
+ __decorateClass([
3307
+ BinaryField("u8", 5)
3308
+ ], _YGOProMsgConfirmCards_CardInfo.prototype, "location", 2);
3309
+ __decorateClass([
3310
+ BinaryField("u8", 6)
3311
+ ], _YGOProMsgConfirmCards_CardInfo.prototype, "sequence", 2);
3312
+ var YGOProMsgConfirmCards_CardInfo = _YGOProMsgConfirmCards_CardInfo;
3313
+ var _YGOProMsgConfirmCards = class _YGOProMsgConfirmCards extends YGOProMsgBase {
3314
+ // 对方视角可能需要隐藏卡片信息
3315
+ opponentView() {
3316
+ const view = this.copy();
3317
+ view.cards = view.cards.map((card) => {
3318
+ const c = { ...card };
3319
+ if (!(c.code & 2147483648)) {
3320
+ c.code = 0;
3321
+ }
3322
+ return c;
3323
+ });
3324
+ return view;
3325
+ }
3326
+ getSendTargets() {
3327
+ if (this.cards.length > 0 && this.cards[0].location === 1) {
3328
+ return [this.player];
3329
+ }
3330
+ return SEND_TO_ALL;
3331
+ }
3332
+ };
3333
+ __name(_YGOProMsgConfirmCards, "YGOProMsgConfirmCards");
3334
+ _YGOProMsgConfirmCards.identifier = OcgcoreCommonConstants.MSG_CONFIRM_CARDS;
3335
+ __decorateClass([
3336
+ BinaryField("u8", 0)
3337
+ ], _YGOProMsgConfirmCards.prototype, "player", 2);
3338
+ __decorateClass([
3339
+ BinaryField("u8", 1)
3340
+ ], _YGOProMsgConfirmCards.prototype, "skipPanel", 2);
3341
+ __decorateClass([
3342
+ BinaryField("u8", 2)
3343
+ ], _YGOProMsgConfirmCards.prototype, "count", 2);
3344
+ __decorateClass([
3345
+ BinaryField(() => YGOProMsgConfirmCards_CardInfo, 3, (obj) => obj.count)
3346
+ ], _YGOProMsgConfirmCards.prototype, "cards", 2);
3347
+ var YGOProMsgConfirmCards = _YGOProMsgConfirmCards;
3348
+
3349
+ // src/protos/msg/proto/confirm-decktop.ts
3350
+ var _YGOProMsgConfirmDeckTop_CardInfo = class _YGOProMsgConfirmDeckTop_CardInfo {
3351
+ };
3352
+ __name(_YGOProMsgConfirmDeckTop_CardInfo, "YGOProMsgConfirmDeckTop_CardInfo");
3353
+ __decorateClass([
3354
+ BinaryField("i32", 0)
3355
+ ], _YGOProMsgConfirmDeckTop_CardInfo.prototype, "code", 2);
3356
+ __decorateClass([
3357
+ BinaryField("u8", 4)
3358
+ ], _YGOProMsgConfirmDeckTop_CardInfo.prototype, "controller", 2);
3359
+ __decorateClass([
3360
+ BinaryField("u8", 5)
3361
+ ], _YGOProMsgConfirmDeckTop_CardInfo.prototype, "location", 2);
3362
+ __decorateClass([
3363
+ BinaryField("u8", 6)
3364
+ ], _YGOProMsgConfirmDeckTop_CardInfo.prototype, "sequence", 2);
3365
+ var YGOProMsgConfirmDeckTop_CardInfo = _YGOProMsgConfirmDeckTop_CardInfo;
3366
+ var _YGOProMsgConfirmDeckTop = class _YGOProMsgConfirmDeckTop extends YGOProMsgBase {
3367
+ // 对方视角可能需要隐藏卡片信息
3368
+ opponentView() {
3369
+ const view = this.copy();
3370
+ view.cards = view.cards.map((card) => {
3371
+ const c = { ...card };
3372
+ if (!(c.code & 2147483648)) {
3373
+ c.code = 0;
3374
+ }
3375
+ return c;
3376
+ });
3377
+ return view;
3378
+ }
3379
+ // confirm-decktop 使用基类的 playerView (基于 player 字段)
3380
+ };
3381
+ __name(_YGOProMsgConfirmDeckTop, "YGOProMsgConfirmDeckTop");
3382
+ _YGOProMsgConfirmDeckTop.identifier = OcgcoreCommonConstants.MSG_CONFIRM_DECKTOP;
3383
+ __decorateClass([
3384
+ BinaryField("u8", 0)
3385
+ ], _YGOProMsgConfirmDeckTop.prototype, "player", 2);
3386
+ __decorateClass([
3387
+ BinaryField("u8", 1)
3388
+ ], _YGOProMsgConfirmDeckTop.prototype, "count", 2);
3389
+ __decorateClass([
3390
+ BinaryField(() => YGOProMsgConfirmDeckTop_CardInfo, 2, (obj) => obj.count)
3391
+ ], _YGOProMsgConfirmDeckTop.prototype, "cards", 2);
3392
+ var YGOProMsgConfirmDeckTop = _YGOProMsgConfirmDeckTop;
3393
+
3394
+ // src/protos/msg/proto/confirm-extratop.ts
3395
+ var _YGOProMsgConfirmExtraTop_CardInfo = class _YGOProMsgConfirmExtraTop_CardInfo {
3396
+ };
3397
+ __name(_YGOProMsgConfirmExtraTop_CardInfo, "YGOProMsgConfirmExtraTop_CardInfo");
3398
+ __decorateClass([
3399
+ BinaryField("i32", 0)
3400
+ ], _YGOProMsgConfirmExtraTop_CardInfo.prototype, "code", 2);
3401
+ __decorateClass([
3402
+ BinaryField("u8", 4)
3403
+ ], _YGOProMsgConfirmExtraTop_CardInfo.prototype, "controller", 2);
3404
+ __decorateClass([
3405
+ BinaryField("u8", 5)
3406
+ ], _YGOProMsgConfirmExtraTop_CardInfo.prototype, "location", 2);
3407
+ __decorateClass([
3408
+ BinaryField("u8", 6)
3409
+ ], _YGOProMsgConfirmExtraTop_CardInfo.prototype, "sequence", 2);
3410
+ var YGOProMsgConfirmExtraTop_CardInfo = _YGOProMsgConfirmExtraTop_CardInfo;
3411
+ var _YGOProMsgConfirmExtraTop = class _YGOProMsgConfirmExtraTop extends YGOProMsgBase {
3412
+ // 对方视角可能需要隐藏卡片信息
3413
+ opponentView() {
3414
+ const view = this.copy();
3415
+ view.cards = view.cards.map((card) => {
3416
+ const c = { ...card };
3417
+ if (!(c.code & 2147483648)) {
3418
+ c.code = 0;
3419
+ }
3420
+ return c;
3421
+ });
3422
+ return view;
3423
+ }
3424
+ // confirm-extratop 使用基类的 playerView (基于 player 字段)
3425
+ };
3426
+ __name(_YGOProMsgConfirmExtraTop, "YGOProMsgConfirmExtraTop");
3427
+ _YGOProMsgConfirmExtraTop.identifier = OcgcoreCommonConstants.MSG_CONFIRM_EXTRATOP;
3428
+ __decorateClass([
3429
+ BinaryField("u8", 0)
3430
+ ], _YGOProMsgConfirmExtraTop.prototype, "player", 2);
3431
+ __decorateClass([
3432
+ BinaryField("u8", 1)
3433
+ ], _YGOProMsgConfirmExtraTop.prototype, "count", 2);
3434
+ __decorateClass([
3435
+ BinaryField(() => YGOProMsgConfirmExtraTop_CardInfo, 2, (obj) => obj.count)
3436
+ ], _YGOProMsgConfirmExtraTop.prototype, "cards", 2);
3437
+ var YGOProMsgConfirmExtraTop = _YGOProMsgConfirmExtraTop;
3438
+
3439
+ // src/protos/msg/proto/damage.ts
3440
+ var _YGOProMsgDamage = class _YGOProMsgDamage extends YGOProMsgBase {
3441
+ };
3442
+ __name(_YGOProMsgDamage, "YGOProMsgDamage");
3443
+ _YGOProMsgDamage.identifier = OcgcoreCommonConstants.MSG_DAMAGE;
3444
+ __decorateClass([
3445
+ BinaryField("u8", 0)
3446
+ ], _YGOProMsgDamage.prototype, "player", 2);
3447
+ __decorateClass([
3448
+ BinaryField("i32", 1)
3449
+ ], _YGOProMsgDamage.prototype, "value", 2);
3450
+ var YGOProMsgDamage = _YGOProMsgDamage;
3451
+
3452
+ // src/protos/msg/proto/damage-step-end.ts
3453
+ var _YGOProMsgDamageStepEnd = class _YGOProMsgDamageStepEnd extends YGOProMsgBase {
3454
+ getRequireRefreshZones() {
3455
+ return [
3456
+ { player: 0, location: OcgcoreScriptConstants.LOCATION_MZONE },
3457
+ { player: 1, location: OcgcoreScriptConstants.LOCATION_MZONE }
3458
+ ];
3459
+ }
3460
+ };
3461
+ __name(_YGOProMsgDamageStepEnd, "YGOProMsgDamageStepEnd");
3462
+ _YGOProMsgDamageStepEnd.identifier = OcgcoreCommonConstants.MSG_DAMAGE_STEP_END;
3463
+ var YGOProMsgDamageStepEnd = _YGOProMsgDamageStepEnd;
3464
+
3465
+ // src/protos/msg/proto/damage-step-start.ts
3466
+ var _YGOProMsgDamageStepStart = class _YGOProMsgDamageStepStart extends YGOProMsgBase {
3467
+ getRequireRefreshZones() {
3468
+ return [
3469
+ { player: 0, location: OcgcoreScriptConstants.LOCATION_MZONE },
3470
+ { player: 1, location: OcgcoreScriptConstants.LOCATION_MZONE }
3471
+ ];
3472
+ }
3473
+ };
3474
+ __name(_YGOProMsgDamageStepStart, "YGOProMsgDamageStepStart");
3475
+ _YGOProMsgDamageStepStart.identifier = OcgcoreCommonConstants.MSG_DAMAGE_STEP_START;
3476
+ var YGOProMsgDamageStepStart = _YGOProMsgDamageStepStart;
3477
+
3478
+ // src/protos/msg/proto/deck-top.ts
3479
+ var _YGOProMsgDeckTop = class _YGOProMsgDeckTop extends YGOProMsgBase {
3480
+ // 对方视角可能需要隐藏卡片信息
3481
+ opponentView() {
3482
+ const view = this.copy();
3483
+ if (!(view.code & 2147483648)) {
3484
+ view.code = 0;
3485
+ }
3486
+ return view;
3487
+ }
3488
+ // deck-top 使用基类的 playerView (基于 player 字段)
3489
+ };
3490
+ __name(_YGOProMsgDeckTop, "YGOProMsgDeckTop");
3491
+ _YGOProMsgDeckTop.identifier = OcgcoreCommonConstants.MSG_DECK_TOP;
3492
+ __decorateClass([
3493
+ BinaryField("u8", 0)
3494
+ ], _YGOProMsgDeckTop.prototype, "player", 2);
3495
+ __decorateClass([
3496
+ BinaryField("u8", 1)
3497
+ ], _YGOProMsgDeckTop.prototype, "sequence", 2);
3498
+ __decorateClass([
3499
+ BinaryField("i32", 2)
3500
+ ], _YGOProMsgDeckTop.prototype, "code", 2);
3501
+ var YGOProMsgDeckTop = _YGOProMsgDeckTop;
3502
+
3503
+ // src/protos/msg/proto/draw.ts
3504
+ var _YGOProMsgDraw = class _YGOProMsgDraw extends YGOProMsgBase {
3505
+ // 对方视角需要隐藏抽到的卡(如果卡片标志位 0x80 未设置)
3506
+ opponentView() {
3507
+ const view = this.copy();
3508
+ view.cards = view.cards.map((card) => {
3509
+ if (!(card & 2147483648)) {
3510
+ return 0;
3511
+ }
3512
+ return card;
3513
+ });
3514
+ return view;
3515
+ }
3516
+ };
3517
+ __name(_YGOProMsgDraw, "YGOProMsgDraw");
3518
+ _YGOProMsgDraw.identifier = OcgcoreCommonConstants.MSG_DRAW;
3519
+ __decorateClass([
3520
+ BinaryField("u8", 0)
3521
+ ], _YGOProMsgDraw.prototype, "player", 2);
3522
+ __decorateClass([
3523
+ BinaryField("u8", 1)
3524
+ ], _YGOProMsgDraw.prototype, "count", 2);
3525
+ __decorateClass([
3526
+ BinaryField("i32", 2, (obj) => obj.count)
3527
+ ], _YGOProMsgDraw.prototype, "cards", 2);
3528
+ var YGOProMsgDraw = _YGOProMsgDraw;
3529
+
3530
+ // src/protos/msg/proto/equip.ts
3531
+ var _YGOProMsgEquip_CardLocation = class _YGOProMsgEquip_CardLocation {
3532
+ };
3533
+ __name(_YGOProMsgEquip_CardLocation, "YGOProMsgEquip_CardLocation");
3534
+ __decorateClass([
3535
+ BinaryField("u8", 0)
3536
+ ], _YGOProMsgEquip_CardLocation.prototype, "controller", 2);
3537
+ __decorateClass([
3538
+ BinaryField("u8", 1)
3539
+ ], _YGOProMsgEquip_CardLocation.prototype, "location", 2);
3540
+ __decorateClass([
3541
+ BinaryField("u8", 2)
3542
+ ], _YGOProMsgEquip_CardLocation.prototype, "sequence", 2);
3543
+ var YGOProMsgEquip_CardLocation = _YGOProMsgEquip_CardLocation;
3544
+ var _YGOProMsgEquip = class _YGOProMsgEquip extends YGOProMsgBase {
3545
+ };
3546
+ __name(_YGOProMsgEquip, "YGOProMsgEquip");
3547
+ _YGOProMsgEquip.identifier = OcgcoreCommonConstants.MSG_EQUIP;
3548
+ __decorateClass([
3549
+ BinaryField(() => YGOProMsgEquip_CardLocation, 0)
3550
+ ], _YGOProMsgEquip.prototype, "equip", 2);
3551
+ __decorateClass([
3552
+ BinaryField(() => YGOProMsgEquip_CardLocation, 3)
3553
+ ], _YGOProMsgEquip.prototype, "target", 2);
3554
+ __decorateClass([
3555
+ BinaryField("u8", 6)
3556
+ ], _YGOProMsgEquip.prototype, "position", 2);
3557
+ var YGOProMsgEquip = _YGOProMsgEquip;
3558
+
3559
+ // src/protos/msg/proto/field-disabled.ts
3560
+ var _YGOProMsgFieldDisabled = class _YGOProMsgFieldDisabled extends YGOProMsgBase {
3561
+ };
3562
+ __name(_YGOProMsgFieldDisabled, "YGOProMsgFieldDisabled");
3563
+ _YGOProMsgFieldDisabled.identifier = OcgcoreCommonConstants.MSG_FIELD_DISABLED;
3564
+ __decorateClass([
3565
+ BinaryField("u32", 0)
3566
+ ], _YGOProMsgFieldDisabled.prototype, "disabledField", 2);
3567
+ var YGOProMsgFieldDisabled = _YGOProMsgFieldDisabled;
3568
+
3569
+ // src/protos/msg/proto/flipsummoned.ts
3570
+ var _YGOProMsgFlipSummoned = class _YGOProMsgFlipSummoned extends YGOProMsgBase {
3571
+ getRequireRefreshZones() {
3572
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE;
3573
+ return [
3574
+ { player: 0, location },
3575
+ { player: 1, location }
3576
+ ];
3577
+ }
3578
+ };
3579
+ __name(_YGOProMsgFlipSummoned, "YGOProMsgFlipSummoned");
3580
+ _YGOProMsgFlipSummoned.identifier = OcgcoreCommonConstants.MSG_FLIPSUMMONED;
3581
+ var YGOProMsgFlipSummoned = _YGOProMsgFlipSummoned;
3582
+
3583
+ // src/protos/msg/proto/flipsummoning.ts
3584
+ var _YGOProMsgFlipSummoning = class _YGOProMsgFlipSummoning extends YGOProMsgBase {
3585
+ getRequireRefreshCards() {
3586
+ return [
3587
+ {
3588
+ player: this.controller,
3589
+ location: this.location,
3590
+ sequence: this.sequence
3591
+ }
3592
+ ];
3593
+ }
3594
+ };
3595
+ __name(_YGOProMsgFlipSummoning, "YGOProMsgFlipSummoning");
3596
+ _YGOProMsgFlipSummoning.identifier = OcgcoreCommonConstants.MSG_FLIPSUMMONING;
3597
+ __decorateClass([
3598
+ BinaryField("i32", 0)
3599
+ ], _YGOProMsgFlipSummoning.prototype, "code", 2);
3600
+ __decorateClass([
3601
+ BinaryField("u8", 4)
3602
+ ], _YGOProMsgFlipSummoning.prototype, "controller", 2);
3603
+ __decorateClass([
3604
+ BinaryField("u8", 5)
3605
+ ], _YGOProMsgFlipSummoning.prototype, "location", 2);
3606
+ __decorateClass([
3607
+ BinaryField("u8", 6)
3608
+ ], _YGOProMsgFlipSummoning.prototype, "sequence", 2);
3609
+ __decorateClass([
3610
+ BinaryField("u8", 7)
3611
+ ], _YGOProMsgFlipSummoning.prototype, "position", 2);
3612
+ var YGOProMsgFlipSummoning = _YGOProMsgFlipSummoning;
3613
+
3614
+ // src/protos/msg/proto/hand-res.ts
3615
+ var _YGOProMsgHandRes = class _YGOProMsgHandRes extends YGOProMsgBase {
3616
+ };
3617
+ __name(_YGOProMsgHandRes, "YGOProMsgHandRes");
3618
+ _YGOProMsgHandRes.identifier = OcgcoreCommonConstants.MSG_HAND_RES;
3619
+ __decorateClass([
3620
+ BinaryField("u8", 0)
3621
+ ], _YGOProMsgHandRes.prototype, "result", 2);
3622
+ var YGOProMsgHandRes = _YGOProMsgHandRes;
3623
+
3624
+ // src/protos/msg/proto/hint.ts
3625
+ var HINT_TYPES_SEND_TO_SELF = /* @__PURE__ */ new Set([1, 2, 3, 5]);
3626
+ var HINT_TYPES_SEND_TO_OPPONENT = /* @__PURE__ */ new Set([4, 6, 7, 8, 9, 11]);
3627
+ var _YGOProMsgHint = class _YGOProMsgHint extends YGOProMsgBase {
3628
+ getSendTargets() {
3629
+ if (HINT_TYPES_SEND_TO_SELF.has(this.type)) {
3630
+ return [this.player];
3631
+ }
3632
+ if (HINT_TYPES_SEND_TO_OPPONENT.has(this.type)) {
3633
+ return [1 - this.player, 7 /* OBSERVER */];
3634
+ }
3635
+ return SEND_TO_ALL;
3636
+ }
3637
+ };
3638
+ __name(_YGOProMsgHint, "YGOProMsgHint");
3639
+ _YGOProMsgHint.identifier = OcgcoreCommonConstants.MSG_HINT;
3640
+ __decorateClass([
3641
+ BinaryField("u8", 0)
3642
+ ], _YGOProMsgHint.prototype, "type", 2);
3643
+ __decorateClass([
3644
+ BinaryField("u8", 1)
3645
+ ], _YGOProMsgHint.prototype, "player", 2);
3646
+ __decorateClass([
3647
+ BinaryField("i32", 2)
3648
+ ], _YGOProMsgHint.prototype, "desc", 2);
3649
+ var YGOProMsgHint = _YGOProMsgHint;
3650
+
3651
+ // src/protos/msg/proto/lpupdate.ts
3652
+ var _YGOProMsgLpUpdate = class _YGOProMsgLpUpdate extends YGOProMsgBase {
3653
+ };
3654
+ __name(_YGOProMsgLpUpdate, "YGOProMsgLpUpdate");
3655
+ _YGOProMsgLpUpdate.identifier = OcgcoreCommonConstants.MSG_LPUPDATE;
3656
+ __decorateClass([
3657
+ BinaryField("u8", 0)
3658
+ ], _YGOProMsgLpUpdate.prototype, "player", 2);
3659
+ __decorateClass([
3660
+ BinaryField("i32", 1)
3661
+ ], _YGOProMsgLpUpdate.prototype, "lp", 2);
3662
+ var YGOProMsgLpUpdate = _YGOProMsgLpUpdate;
3663
+
3664
+ // src/protos/msg/proto/match-kill.ts
3665
+ var _YGOProMsgMatchKill = class _YGOProMsgMatchKill extends YGOProMsgBase {
3666
+ };
3667
+ __name(_YGOProMsgMatchKill, "YGOProMsgMatchKill");
3668
+ _YGOProMsgMatchKill.identifier = OcgcoreCommonConstants.MSG_MATCH_KILL;
3669
+ __decorateClass([
3670
+ BinaryField("i32", 0)
3671
+ ], _YGOProMsgMatchKill.prototype, "code", 2);
3672
+ var YGOProMsgMatchKill = _YGOProMsgMatchKill;
3673
+
3674
+ // src/protos/msg/proto/missed-effect.ts
3675
+ var _YGOProMsgMissedEffect = class _YGOProMsgMissedEffect extends YGOProMsgBase {
3676
+ getSendTargets() {
3677
+ return [this.controller];
3678
+ }
3679
+ };
3680
+ __name(_YGOProMsgMissedEffect, "YGOProMsgMissedEffect");
3681
+ _YGOProMsgMissedEffect.identifier = OcgcoreCommonConstants.MSG_MISSED_EFFECT;
3682
+ __decorateClass([
3683
+ BinaryField("u8", 0)
3684
+ ], _YGOProMsgMissedEffect.prototype, "controller", 2);
3685
+ __decorateClass([
3686
+ BinaryField("u8", 1)
3687
+ ], _YGOProMsgMissedEffect.prototype, "location", 2);
3688
+ __decorateClass([
3689
+ BinaryField("u8", 2)
3690
+ ], _YGOProMsgMissedEffect.prototype, "sequence", 2);
3691
+ __decorateClass([
3692
+ BinaryField("u8", 3)
3693
+ ], _YGOProMsgMissedEffect.prototype, "position", 2);
3694
+ __decorateClass([
3695
+ BinaryField("i32", 4)
3696
+ ], _YGOProMsgMissedEffect.prototype, "code", 2);
3697
+ var YGOProMsgMissedEffect = _YGOProMsgMissedEffect;
3698
+
3647
3699
  // src/protos/msg/proto/move.ts
3648
3700
  var _YGOProMsgMove_CardLocation = class _YGOProMsgMove_CardLocation {
3649
3701
  };
@@ -3695,6 +3747,21 @@ var _YGOProMsgMove = class _YGOProMsgMove extends YGOProMsgBase {
3695
3747
  }
3696
3748
  return this.opponentView();
3697
3749
  }
3750
+ getRequireRefreshCards() {
3751
+ const current = this.current;
3752
+ const previous = this.previous;
3753
+ const shouldRefresh = current.location !== 0 && (current.location & OcgcoreScriptConstants.LOCATION_OVERLAY) === 0 && (current.location !== previous.location || current.controller !== previous.controller);
3754
+ if (!shouldRefresh) {
3755
+ return [];
3756
+ }
3757
+ return [
3758
+ {
3759
+ player: current.controller,
3760
+ location: current.location,
3761
+ sequence: current.sequence
3762
+ }
3763
+ ];
3764
+ }
3698
3765
  };
3699
3766
  __name(_YGOProMsgMove, "YGOProMsgMove");
3700
3767
  _YGOProMsgMove.identifier = OcgcoreCommonConstants.MSG_MOVE;
@@ -3714,6 +3781,13 @@ var YGOProMsgMove = _YGOProMsgMove;
3714
3781
 
3715
3782
  // src/protos/msg/proto/new-phase.ts
3716
3783
  var _YGOProMsgNewPhase = class _YGOProMsgNewPhase extends YGOProMsgBase {
3784
+ getRequireRefreshZones() {
3785
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE | OcgcoreScriptConstants.LOCATION_HAND;
3786
+ return [
3787
+ { player: 0, location },
3788
+ { player: 1, location }
3789
+ ];
3790
+ }
3717
3791
  };
3718
3792
  __name(_YGOProMsgNewPhase, "YGOProMsgNewPhase");
3719
3793
  _YGOProMsgNewPhase.identifier = OcgcoreCommonConstants.MSG_NEW_PHASE;
@@ -3724,6 +3798,13 @@ var YGOProMsgNewPhase = _YGOProMsgNewPhase;
3724
3798
 
3725
3799
  // src/protos/msg/proto/new-turn.ts
3726
3800
  var _YGOProMsgNewTurn = class _YGOProMsgNewTurn extends YGOProMsgBase {
3801
+ getRequireRefreshZones() {
3802
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE | OcgcoreScriptConstants.LOCATION_HAND;
3803
+ return [
3804
+ { player: 0, location },
3805
+ { player: 1, location }
3806
+ ];
3807
+ }
3727
3808
  };
3728
3809
  __name(_YGOProMsgNewTurn, "YGOProMsgNewTurn");
3729
3810
  _YGOProMsgNewTurn.identifier = OcgcoreCommonConstants.MSG_NEW_TURN;
@@ -3776,6 +3857,19 @@ __decorateClass([
3776
3857
  ], _YGOProMsgPosChange_CardLocation.prototype, "sequence", 2);
3777
3858
  var YGOProMsgPosChange_CardLocation = _YGOProMsgPosChange_CardLocation;
3778
3859
  var _YGOProMsgPosChange = class _YGOProMsgPosChange extends YGOProMsgBase {
3860
+ getRequireRefreshCards() {
3861
+ const shouldRefresh = (this.previousPosition & OcgcoreCommonConstants.POS_FACEDOWN) !== 0 && (this.currentPosition & OcgcoreCommonConstants.POS_FACEUP) !== 0;
3862
+ if (!shouldRefresh) {
3863
+ return [];
3864
+ }
3865
+ return [
3866
+ {
3867
+ player: this.card.controller,
3868
+ location: this.card.location,
3869
+ sequence: this.card.sequence
3870
+ }
3871
+ ];
3872
+ }
3779
3873
  };
3780
3874
  __name(_YGOProMsgPosChange, "YGOProMsgPosChange");
3781
3875
  _YGOProMsgPosChange.identifier = OcgcoreCommonConstants.MSG_POS_CHANGE;
@@ -4156,6 +4250,13 @@ var _YGOProMsgSelectBattleCmd = class _YGOProMsgSelectBattleCmd extends YGOProMs
4156
4250
  view.setUint32(0, sequence << 16 | type, true);
4157
4251
  return buffer;
4158
4252
  }
4253
+ getRequireRefreshZones() {
4254
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE | OcgcoreScriptConstants.LOCATION_HAND;
4255
+ return [
4256
+ { player: 0, location },
4257
+ { player: 1, location }
4258
+ ];
4259
+ }
4159
4260
  };
4160
4261
  __name(_YGOProMsgSelectBattleCmd, "YGOProMsgSelectBattleCmd");
4161
4262
  _YGOProMsgSelectBattleCmd.identifier = OcgcoreCommonConstants.MSG_SELECT_BATTLECMD;
@@ -4660,6 +4761,13 @@ var _YGOProMsgSelectIdleCmd = class _YGOProMsgSelectIdleCmd extends YGOProMsgRes
4660
4761
  view.setUint32(0, sequence << 16 | type, true);
4661
4762
  return buffer;
4662
4763
  }
4764
+ getRequireRefreshZones() {
4765
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE | OcgcoreScriptConstants.LOCATION_HAND;
4766
+ return [
4767
+ { player: 0, location },
4768
+ { player: 1, location }
4769
+ ];
4770
+ }
4663
4771
  };
4664
4772
  __name(_YGOProMsgSelectIdleCmd, "YGOProMsgSelectIdleCmd");
4665
4773
  _YGOProMsgSelectIdleCmd.identifier = OcgcoreCommonConstants.MSG_SELECT_IDLECMD;
@@ -5218,6 +5326,14 @@ var _YGOProMsgShuffleHand = class _YGOProMsgShuffleHand extends YGOProMsgBase {
5218
5326
  view.cards = view.cards.map(() => 0);
5219
5327
  return view;
5220
5328
  }
5329
+ getRequireRefreshZones() {
5330
+ return [
5331
+ {
5332
+ player: this.player,
5333
+ location: OcgcoreScriptConstants.LOCATION_HAND
5334
+ }
5335
+ ];
5336
+ }
5221
5337
  };
5222
5338
  __name(_YGOProMsgShuffleHand, "YGOProMsgShuffleHand");
5223
5339
  _YGOProMsgShuffleHand.identifier = OcgcoreCommonConstants.MSG_SHUFFLE_HAND;
@@ -5260,6 +5376,22 @@ __decorateClass([
5260
5376
  ], _YGOProMsgShuffleSetCard_SetCardInfo.prototype, "newLocation", 2);
5261
5377
  var YGOProMsgShuffleSetCard_SetCardInfo = _YGOProMsgShuffleSetCard_SetCardInfo;
5262
5378
  var _YGOProMsgShuffleSetCard = class _YGOProMsgShuffleSetCard extends YGOProMsgBase {
5379
+ getRequireRefreshZones() {
5380
+ let location = 0;
5381
+ if (this.location === OcgcoreScriptConstants.LOCATION_MZONE) {
5382
+ location = OcgcoreScriptConstants.LOCATION_MZONE;
5383
+ }
5384
+ if (this.location === OcgcoreScriptConstants.LOCATION_SZONE) {
5385
+ location = OcgcoreScriptConstants.LOCATION_SZONE;
5386
+ }
5387
+ if (location === 0) {
5388
+ return [];
5389
+ }
5390
+ return [
5391
+ { player: 0, location },
5392
+ { player: 1, location }
5393
+ ];
5394
+ }
5263
5395
  };
5264
5396
  __name(_YGOProMsgShuffleSetCard, "YGOProMsgShuffleSetCard");
5265
5397
  _YGOProMsgShuffleSetCard.identifier = OcgcoreCommonConstants.MSG_SHUFFLE_SET_CARD;
@@ -5344,6 +5476,13 @@ var YGOProMsgSortCard = _YGOProMsgSortCard;
5344
5476
 
5345
5477
  // src/protos/msg/proto/spsummoned.ts
5346
5478
  var _YGOProMsgSpSummoned = class _YGOProMsgSpSummoned extends YGOProMsgBase {
5479
+ getRequireRefreshZones() {
5480
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE;
5481
+ return [
5482
+ { player: 0, location },
5483
+ { player: 1, location }
5484
+ ];
5485
+ }
5347
5486
  };
5348
5487
  __name(_YGOProMsgSpSummoned, "YGOProMsgSpSummoned");
5349
5488
  _YGOProMsgSpSummoned.identifier = OcgcoreCommonConstants.MSG_SPSUMMONED;
@@ -5445,6 +5584,13 @@ var YGOProMsgStart = _YGOProMsgStart;
5445
5584
 
5446
5585
  // src/protos/msg/proto/summoned.ts
5447
5586
  var _YGOProMsgSummoned = class _YGOProMsgSummoned extends YGOProMsgBase {
5587
+ getRequireRefreshZones() {
5588
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE;
5589
+ return [
5590
+ { player: 0, location },
5591
+ { player: 1, location }
5592
+ ];
5593
+ }
5448
5594
  };
5449
5595
  __name(_YGOProMsgSummoned, "YGOProMsgSummoned");
5450
5596
  _YGOProMsgSummoned.identifier = OcgcoreCommonConstants.MSG_SUMMONED;
@@ -5490,6 +5636,20 @@ __decorateClass([
5490
5636
  ], _YGOProMsgSwap_CardLocation.prototype, "position", 2);
5491
5637
  var YGOProMsgSwap_CardLocation = _YGOProMsgSwap_CardLocation;
5492
5638
  var _YGOProMsgSwap = class _YGOProMsgSwap extends YGOProMsgBase {
5639
+ getRequireRefreshCards() {
5640
+ return [
5641
+ {
5642
+ player: this.card1.controller,
5643
+ location: this.card1.location,
5644
+ sequence: this.card1.sequence
5645
+ },
5646
+ {
5647
+ player: this.card2.controller,
5648
+ location: this.card2.location,
5649
+ sequence: this.card2.sequence
5650
+ }
5651
+ ];
5652
+ }
5493
5653
  };
5494
5654
  __name(_YGOProMsgSwap, "YGOProMsgSwap");
5495
5655
  _YGOProMsgSwap.identifier = OcgcoreCommonConstants.MSG_SWAP;
@@ -5528,6 +5688,13 @@ var _YGOProMsgTagSwap = class _YGOProMsgTagSwap extends YGOProMsgBase {
5528
5688
  teammateView() {
5529
5689
  return this.opponentView();
5530
5690
  }
5691
+ getRequireRefreshZones() {
5692
+ const location = OcgcoreScriptConstants.LOCATION_MZONE | OcgcoreScriptConstants.LOCATION_SZONE | OcgcoreScriptConstants.LOCATION_HAND;
5693
+ return [
5694
+ { player: 0, location },
5695
+ { player: 1, location }
5696
+ ];
5697
+ }
5531
5698
  };
5532
5699
  __name(_YGOProMsgTagSwap, "YGOProMsgTagSwap");
5533
5700
  _YGOProMsgTagSwap.identifier = OcgcoreCommonConstants.MSG_TAG_SWAP;
@@ -5665,6 +5832,15 @@ var _YGOProMsgUpdateCard = class _YGOProMsgUpdateCard extends YGOProMsgBase {
5665
5832
  getSendTargets() {
5666
5833
  return [];
5667
5834
  }
5835
+ getRequireRefreshCards() {
5836
+ return [
5837
+ {
5838
+ player: this.controller,
5839
+ location: this.location,
5840
+ sequence: this.sequence
5841
+ }
5842
+ ];
5843
+ }
5668
5844
  };
5669
5845
  __name(_YGOProMsgUpdateCard, "YGOProMsgUpdateCard");
5670
5846
  _YGOProMsgUpdateCard.identifier = OcgcoreCommonConstants.MSG_UPDATE_CARD;