ygopro-msg-encode 1.1.3 → 1.1.5

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.mjs CHANGED
@@ -1780,6 +1780,9 @@ var YGOProMsgBase = class extends PayloadBase {
1780
1780
  return this.opponentView();
1781
1781
  }
1782
1782
  playerView(playerId) {
1783
+ if (playerId === 7 /* OBSERVER */) {
1784
+ return this.observerView();
1785
+ }
1783
1786
  if (typeof this["player"] === "number") {
1784
1787
  const selfPlayerId = this["player"];
1785
1788
  if (selfPlayerId === playerId) {
@@ -2282,6 +2285,7 @@ var YGOProMsgConfirmDeckTop = class extends YGOProMsgBase {
2282
2285
  });
2283
2286
  return view;
2284
2287
  }
2288
+ // confirm-decktop 使用基类的 playerView (基于 player 字段)
2285
2289
  };
2286
2290
  __decorateClass([
2287
2291
  BinaryField("u8", 0)
@@ -2324,6 +2328,7 @@ var YGOProMsgConfirmExtraTop = class extends YGOProMsgBase {
2324
2328
  });
2325
2329
  return view;
2326
2330
  }
2331
+ // confirm-extratop 使用基类的 playerView (基于 player 字段)
2327
2332
  };
2328
2333
  __decorateClass([
2329
2334
  BinaryField("u8", 0)
@@ -2375,6 +2380,7 @@ var YGOProMsgDeckTop = class extends YGOProMsgBase {
2375
2380
  }
2376
2381
  return view;
2377
2382
  }
2383
+ // deck-top 使用基类的 playerView (基于 player 字段)
2378
2384
  };
2379
2385
  __decorateClass([
2380
2386
  BinaryField("u8", 0)
@@ -2558,748 +2564,6 @@ __decorateClass([
2558
2564
  BinaryField("i32", 5)
2559
2565
  ], YGOProMsgMissedEffect.prototype, "desc", 2);
2560
2566
 
2561
- // src/protos/msg/proto/move.ts
2562
- var YGOProMsgMove_CardLocation = class {
2563
- };
2564
- __decorateClass([
2565
- BinaryField("u8", 0)
2566
- ], YGOProMsgMove_CardLocation.prototype, "controller", 2);
2567
- __decorateClass([
2568
- BinaryField("u8", 1)
2569
- ], YGOProMsgMove_CardLocation.prototype, "location", 2);
2570
- __decorateClass([
2571
- BinaryField("u8", 2)
2572
- ], YGOProMsgMove_CardLocation.prototype, "sequence", 2);
2573
- __decorateClass([
2574
- BinaryField("u8", 3)
2575
- ], YGOProMsgMove_CardLocation.prototype, "position", 2);
2576
- var YGOProMsgMove = class extends YGOProMsgBase {
2577
- static {
2578
- this.identifier = OcgcoreCommonConstants.MSG_MOVE;
2579
- }
2580
- };
2581
- __decorateClass([
2582
- BinaryField("i32", 0)
2583
- ], YGOProMsgMove.prototype, "code", 2);
2584
- __decorateClass([
2585
- BinaryField(() => YGOProMsgMove_CardLocation, 4)
2586
- ], YGOProMsgMove.prototype, "previous", 2);
2587
- __decorateClass([
2588
- BinaryField(() => YGOProMsgMove_CardLocation, 8)
2589
- ], YGOProMsgMove.prototype, "current", 2);
2590
- __decorateClass([
2591
- BinaryField("i32", 12)
2592
- ], YGOProMsgMove.prototype, "reason", 2);
2593
-
2594
- // src/protos/msg/proto/new-phase.ts
2595
- var YGOProMsgNewPhase = class extends YGOProMsgBase {
2596
- static {
2597
- this.identifier = OcgcoreCommonConstants.MSG_NEW_PHASE;
2598
- }
2599
- };
2600
- __decorateClass([
2601
- BinaryField("u16", 0)
2602
- ], YGOProMsgNewPhase.prototype, "phase", 2);
2603
-
2604
- // src/protos/msg/proto/new-turn.ts
2605
- var YGOProMsgNewTurn = class extends YGOProMsgBase {
2606
- static {
2607
- this.identifier = OcgcoreCommonConstants.MSG_NEW_TURN;
2608
- }
2609
- };
2610
- __decorateClass([
2611
- BinaryField("u8", 0)
2612
- ], YGOProMsgNewTurn.prototype, "player", 2);
2613
-
2614
- // src/protos/msg/proto/pay-lpcost.ts
2615
- var YGOProMsgPayLpCost = class extends YGOProMsgBase {
2616
- static {
2617
- this.identifier = OcgcoreCommonConstants.MSG_PAY_LPCOST;
2618
- }
2619
- };
2620
- __decorateClass([
2621
- BinaryField("u8", 0)
2622
- ], YGOProMsgPayLpCost.prototype, "player", 2);
2623
- __decorateClass([
2624
- BinaryField("i32", 1)
2625
- ], YGOProMsgPayLpCost.prototype, "cost", 2);
2626
-
2627
- // src/protos/msg/proto/player-hint.ts
2628
- var YGOProMsgPlayerHint = class extends YGOProMsgBase {
2629
- static {
2630
- this.identifier = OcgcoreCommonConstants.MSG_PLAYER_HINT;
2631
- }
2632
- };
2633
- __decorateClass([
2634
- BinaryField("u8", 0)
2635
- ], YGOProMsgPlayerHint.prototype, "player", 2);
2636
- __decorateClass([
2637
- BinaryField("u8", 1)
2638
- ], YGOProMsgPlayerHint.prototype, "type", 2);
2639
- __decorateClass([
2640
- BinaryField("i32", 2)
2641
- ], YGOProMsgPlayerHint.prototype, "value", 2);
2642
-
2643
- // src/protos/msg/proto/pos-change.ts
2644
- var YGOProMsgPosChange_CardLocation = class {
2645
- };
2646
- __decorateClass([
2647
- BinaryField("u8", 0)
2648
- ], YGOProMsgPosChange_CardLocation.prototype, "controller", 2);
2649
- __decorateClass([
2650
- BinaryField("u8", 1)
2651
- ], YGOProMsgPosChange_CardLocation.prototype, "location", 2);
2652
- __decorateClass([
2653
- BinaryField("u8", 2)
2654
- ], YGOProMsgPosChange_CardLocation.prototype, "sequence", 2);
2655
- var YGOProMsgPosChange = class extends YGOProMsgBase {
2656
- static {
2657
- this.identifier = OcgcoreCommonConstants.MSG_POS_CHANGE;
2658
- }
2659
- };
2660
- __decorateClass([
2661
- BinaryField(() => YGOProMsgPosChange_CardLocation, 0)
2662
- ], YGOProMsgPosChange.prototype, "card", 2);
2663
- __decorateClass([
2664
- BinaryField("u8", 3)
2665
- ], YGOProMsgPosChange.prototype, "previousPosition", 2);
2666
- __decorateClass([
2667
- BinaryField("u8", 4)
2668
- ], YGOProMsgPosChange.prototype, "currentPosition", 2);
2669
-
2670
- // src/protos/msg/proto/random-selected.ts
2671
- var YGOProMsgRandomSelected = class extends YGOProMsgBase {
2672
- static {
2673
- this.identifier = OcgcoreCommonConstants.MSG_RANDOM_SELECTED;
2674
- }
2675
- };
2676
- __decorateClass([
2677
- BinaryField("u8", 0)
2678
- ], YGOProMsgRandomSelected.prototype, "player", 2);
2679
- __decorateClass([
2680
- BinaryField("u8", 1)
2681
- ], YGOProMsgRandomSelected.prototype, "count", 2);
2682
- __decorateClass([
2683
- BinaryField("i32", 2, (obj) => obj.count)
2684
- ], YGOProMsgRandomSelected.prototype, "cards", 2);
2685
-
2686
- // src/protos/msg/proto/recover.ts
2687
- var YGOProMsgRecover = class extends YGOProMsgBase {
2688
- static {
2689
- this.identifier = OcgcoreCommonConstants.MSG_RECOVER;
2690
- }
2691
- };
2692
- __decorateClass([
2693
- BinaryField("u8", 0)
2694
- ], YGOProMsgRecover.prototype, "player", 2);
2695
- __decorateClass([
2696
- BinaryField("i32", 1)
2697
- ], YGOProMsgRecover.prototype, "value", 2);
2698
-
2699
- // src/protos/msg/proto/reload-field.ts
2700
- var YGOProMsgReloadField_ZoneCard = class {
2701
- };
2702
- var YGOProMsgReloadField_PlayerInfo = class {
2703
- };
2704
- var YGOProMsgReloadField_ChainInfo = class {
2705
- };
2706
- var YGOProMsgReloadField = class extends YGOProMsgBase {
2707
- static {
2708
- this.identifier = 162;
2709
- }
2710
- fromPayload(data) {
2711
- if (data.length < 1) {
2712
- throw new Error("MSG data too short");
2713
- }
2714
- const msgType = data[0];
2715
- if (msgType !== this.identifier) {
2716
- throw new Error(
2717
- `MSG type mismatch: expected ${this.identifier}, got ${msgType}`
2718
- );
2719
- }
2720
- const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
2721
- let offset = 1;
2722
- this.duelRule = view.getUint8(offset++);
2723
- this.players = [];
2724
- for (let i = 0; i < 2; i++) {
2725
- const player = {
2726
- lp: view.getInt32(offset, true),
2727
- mzone: [],
2728
- szone: [],
2729
- deckCount: 0,
2730
- handCount: 0,
2731
- graveCount: 0,
2732
- removedCount: 0,
2733
- extraCount: 0,
2734
- extraPCount: 0
2735
- };
2736
- offset += 4;
2737
- for (let seq = 0; seq < 7; seq++) {
2738
- const occupied = view.getUint8(offset++);
2739
- const card = { occupied };
2740
- if (occupied) {
2741
- card.position = view.getUint8(offset++);
2742
- card.xyzCount = view.getUint8(offset++);
2743
- }
2744
- player.mzone.push(card);
2745
- }
2746
- for (let seq = 0; seq < 8; seq++) {
2747
- const occupied = view.getUint8(offset++);
2748
- const card = { occupied };
2749
- if (occupied) {
2750
- card.position = view.getUint8(offset++);
2751
- }
2752
- player.szone.push(card);
2753
- }
2754
- player.deckCount = view.getUint8(offset++);
2755
- player.handCount = view.getUint8(offset++);
2756
- player.graveCount = view.getUint8(offset++);
2757
- player.removedCount = view.getUint8(offset++);
2758
- player.extraCount = view.getUint8(offset++);
2759
- player.extraPCount = view.getUint8(offset++);
2760
- this.players.push(player);
2761
- }
2762
- const chainCount = view.getUint8(offset++);
2763
- this.chains = [];
2764
- for (let i = 0; i < chainCount; i++) {
2765
- const chain = {
2766
- code: view.getInt32(offset, true),
2767
- chainCardController: view.getUint8(offset + 4),
2768
- chainCardLocation: view.getUint8(offset + 5),
2769
- chainCardSequence: view.getUint8(offset + 6),
2770
- chainCardSubsequence: view.getUint8(offset + 7),
2771
- triggerController: view.getUint8(offset + 8),
2772
- triggerLocation: view.getUint8(offset + 9),
2773
- triggerSequence: view.getUint8(offset + 10),
2774
- desc: view.getInt32(offset + 11, true)
2775
- };
2776
- offset += 15;
2777
- this.chains.push(chain);
2778
- }
2779
- return this;
2780
- }
2781
- toPayload() {
2782
- let size = 1 + 1;
2783
- for (const player of this.players) {
2784
- size += 4;
2785
- for (const card of player.mzone) {
2786
- size += 1;
2787
- if (card.occupied) {
2788
- size += 2;
2789
- }
2790
- }
2791
- for (const card of player.szone) {
2792
- size += 1;
2793
- if (card.occupied) {
2794
- size += 1;
2795
- }
2796
- }
2797
- size += 6;
2798
- }
2799
- size += 1;
2800
- size += this.chains.length * 15;
2801
- const result = new Uint8Array(size);
2802
- const view = new DataView(result.buffer);
2803
- let offset = 0;
2804
- result[offset++] = this.identifier;
2805
- result[offset++] = this.duelRule;
2806
- for (const player of this.players) {
2807
- view.setInt32(offset, player.lp, true);
2808
- offset += 4;
2809
- for (const card of player.mzone) {
2810
- result[offset++] = card.occupied;
2811
- if (card.occupied) {
2812
- result[offset++] = card.position || 0;
2813
- result[offset++] = card.xyzCount || 0;
2814
- }
2815
- }
2816
- for (const card of player.szone) {
2817
- result[offset++] = card.occupied;
2818
- if (card.occupied) {
2819
- result[offset++] = card.position || 0;
2820
- }
2821
- }
2822
- result[offset++] = player.deckCount;
2823
- result[offset++] = player.handCount;
2824
- result[offset++] = player.graveCount;
2825
- result[offset++] = player.removedCount;
2826
- result[offset++] = player.extraCount;
2827
- result[offset++] = player.extraPCount;
2828
- }
2829
- result[offset++] = this.chains.length;
2830
- for (const chain of this.chains) {
2831
- view.setInt32(offset, chain.code, true);
2832
- result[offset + 4] = chain.chainCardController;
2833
- result[offset + 5] = chain.chainCardLocation;
2834
- result[offset + 6] = chain.chainCardSequence;
2835
- result[offset + 7] = chain.chainCardSubsequence;
2836
- result[offset + 8] = chain.triggerController;
2837
- result[offset + 9] = chain.triggerLocation;
2838
- result[offset + 10] = chain.triggerSequence;
2839
- view.setInt32(offset + 11, chain.desc, true);
2840
- offset += 15;
2841
- }
2842
- return result;
2843
- }
2844
- };
2845
-
2846
- // src/protos/msg/proto/remove-counter.ts
2847
- var YGOProMsgRemoveCounter = class extends YGOProMsgBase {
2848
- static {
2849
- this.identifier = OcgcoreCommonConstants.MSG_REMOVE_COUNTER;
2850
- }
2851
- };
2852
- __decorateClass([
2853
- BinaryField("u16", 0)
2854
- ], YGOProMsgRemoveCounter.prototype, "counterType", 2);
2855
- __decorateClass([
2856
- BinaryField("u8", 2)
2857
- ], YGOProMsgRemoveCounter.prototype, "controller", 2);
2858
- __decorateClass([
2859
- BinaryField("u8", 3)
2860
- ], YGOProMsgRemoveCounter.prototype, "location", 2);
2861
- __decorateClass([
2862
- BinaryField("u8", 4)
2863
- ], YGOProMsgRemoveCounter.prototype, "sequence", 2);
2864
- __decorateClass([
2865
- BinaryField("u16", 5)
2866
- ], YGOProMsgRemoveCounter.prototype, "count", 2);
2867
-
2868
- // src/protos/msg/proto/reset-time.ts
2869
- var YGOProMsgResetTime = class extends YGOProMsgBase {
2870
- static {
2871
- this.identifier = OcgcoreCommonConstants.MSG_RESET_TIME;
2872
- }
2873
- getSendTargets() {
2874
- return [];
2875
- }
2876
- };
2877
- __decorateClass([
2878
- BinaryField("i8", 0)
2879
- ], YGOProMsgResetTime.prototype, "player", 2);
2880
- __decorateClass([
2881
- BinaryField("i16", 1)
2882
- ], YGOProMsgResetTime.prototype, "time", 2);
2883
-
2884
- // src/protos/msg/proto/retry.ts
2885
- var YGOProMsgRetry = class extends YGOProMsgBase {
2886
- static {
2887
- this.identifier = OcgcoreCommonConstants.MSG_RETRY;
2888
- }
2889
- getSendTargets() {
2890
- return [];
2891
- }
2892
- };
2893
-
2894
- // src/protos/msg/proto/reverse-deck.ts
2895
- var YGOProMsgReverseDeck = class extends YGOProMsgBase {
2896
- static {
2897
- this.identifier = OcgcoreCommonConstants.MSG_REVERSE_DECK;
2898
- }
2899
- };
2900
-
2901
- // src/protos/msg/proto/rock-paper-scissors.ts
2902
- var YGOProMsgRockPaperScissors = class extends YGOProMsgResponseBase {
2903
- static {
2904
- this.identifier = OcgcoreCommonConstants.MSG_ROCK_PAPER_SCISSORS;
2905
- }
2906
- responsePlayer() {
2907
- return this.player;
2908
- }
2909
- prepareResponse(choice) {
2910
- if (choice < 1 /* ROCK */ || choice > 3 /* PAPER */) {
2911
- throw new TypeError(`Invalid choice: ${choice}. Must be 1 (ROCK), 2 (SCISSORS), or 3 (PAPER)`);
2912
- }
2913
- const buffer = new Uint8Array(1);
2914
- buffer[0] = choice;
2915
- return buffer;
2916
- }
2917
- };
2918
- __decorateClass([
2919
- BinaryField("u8", 0)
2920
- ], YGOProMsgRockPaperScissors.prototype, "player", 2);
2921
-
2922
- // src/protos/msg/proto/select-battlecmd.ts
2923
- var BattleCmdType = /* @__PURE__ */ ((BattleCmdType2) => {
2924
- BattleCmdType2[BattleCmdType2["ACTIVATE"] = 0] = "ACTIVATE";
2925
- BattleCmdType2[BattleCmdType2["ATTACK"] = 1] = "ATTACK";
2926
- BattleCmdType2[BattleCmdType2["TO_M2"] = 2] = "TO_M2";
2927
- BattleCmdType2[BattleCmdType2["TO_EP"] = 3] = "TO_EP";
2928
- return BattleCmdType2;
2929
- })(BattleCmdType || {});
2930
- var YGOProMsgSelectBattleCmd_ActivatableInfo = class {
2931
- };
2932
- __decorateClass([
2933
- BinaryField("i32", 0)
2934
- ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "code", 2);
2935
- __decorateClass([
2936
- BinaryField("u8", 4)
2937
- ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "controller", 2);
2938
- __decorateClass([
2939
- BinaryField("u8", 5)
2940
- ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "location", 2);
2941
- __decorateClass([
2942
- BinaryField("u8", 6)
2943
- ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "sequence", 2);
2944
- __decorateClass([
2945
- BinaryField("i32", 7)
2946
- ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "desc", 2);
2947
- var YGOProMsgSelectBattleCmd_AttackableInfo = class {
2948
- };
2949
- __decorateClass([
2950
- BinaryField("i32", 0)
2951
- ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "code", 2);
2952
- __decorateClass([
2953
- BinaryField("u8", 4)
2954
- ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "controller", 2);
2955
- __decorateClass([
2956
- BinaryField("u8", 5)
2957
- ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "location", 2);
2958
- __decorateClass([
2959
- BinaryField("u8", 6)
2960
- ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "sequence", 2);
2961
- __decorateClass([
2962
- BinaryField("u8", 7)
2963
- ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "directAttack", 2);
2964
- var YGOProMsgSelectBattleCmd = class extends YGOProMsgResponseBase {
2965
- static {
2966
- this.identifier = OcgcoreCommonConstants.MSG_SELECT_BATTLECMD;
2967
- }
2968
- responsePlayer() {
2969
- return this.player;
2970
- }
2971
- prepareResponse(type, option) {
2972
- let sequence;
2973
- if (type === 0 /* ACTIVATE */) {
2974
- if (option == null) {
2975
- throw new TypeError("Option required for ACTIVATE");
2976
- }
2977
- if (isIndexResponse(option)) {
2978
- sequence = option.index;
2979
- if (sequence < 0 || sequence >= this.activatableCount) {
2980
- throw new TypeError(`Index out of range: ${sequence}`);
2981
- }
2982
- } else {
2983
- const idx = this.activatableCards.findIndex(
2984
- (card) => (option.code == null || card.code === option.code) && (option.controller == null || card.controller === option.controller) && (option.location == null || card.location === option.location) && (option.sequence == null || card.sequence === option.sequence) && (option.desc == null || card.desc === option.desc)
2985
- );
2986
- if (idx === -1) {
2987
- throw new TypeError("Activatable card not found");
2988
- }
2989
- sequence = idx;
2990
- }
2991
- } else if (type === 1 /* ATTACK */) {
2992
- if (option == null) {
2993
- throw new TypeError("Option required for ATTACK");
2994
- }
2995
- if (isIndexResponse(option)) {
2996
- sequence = option.index;
2997
- if (sequence < 0 || sequence >= this.attackableCount) {
2998
- throw new TypeError(`Index out of range: ${sequence}`);
2999
- }
3000
- } else {
3001
- const idx = this.attackableCards.findIndex(
3002
- (card) => (option.code == null || card.code === option.code) && (option.controller == null || card.controller === option.controller) && (option.location == null || card.location === option.location) && (option.sequence == null || card.sequence === option.sequence)
3003
- );
3004
- if (idx === -1) {
3005
- throw new TypeError("Attackable card not found");
3006
- }
3007
- sequence = idx;
3008
- }
3009
- } else if (type === 2 /* TO_M2 */) {
3010
- if (this.canM2 === 0) {
3011
- throw new TypeError("Cannot go to M2");
3012
- }
3013
- sequence = 0;
3014
- } else if (type === 3 /* TO_EP */) {
3015
- if (this.canEp === 0) {
3016
- throw new TypeError("Cannot go to EP");
3017
- }
3018
- sequence = 0;
3019
- } else {
3020
- throw new TypeError(`Unknown type: ${type}`);
3021
- }
3022
- const buffer = new Uint8Array(4);
3023
- const view = new DataView(buffer.buffer);
3024
- view.setUint32(0, sequence << 16 | type, true);
3025
- return buffer;
3026
- }
3027
- };
3028
- __decorateClass([
3029
- BinaryField("u8", 0)
3030
- ], YGOProMsgSelectBattleCmd.prototype, "player", 2);
3031
- __decorateClass([
3032
- BinaryField("u8", 1)
3033
- ], YGOProMsgSelectBattleCmd.prototype, "activatableCount", 2);
3034
- __decorateClass([
3035
- BinaryField(
3036
- () => YGOProMsgSelectBattleCmd_ActivatableInfo,
3037
- 2,
3038
- (obj) => obj.activatableCount
3039
- )
3040
- ], YGOProMsgSelectBattleCmd.prototype, "activatableCards", 2);
3041
- __decorateClass([
3042
- BinaryField("u8", (obj) => {
3043
- return 2 + obj.activatableCount * 11;
3044
- })
3045
- ], YGOProMsgSelectBattleCmd.prototype, "attackableCount", 2);
3046
- __decorateClass([
3047
- BinaryField(
3048
- () => YGOProMsgSelectBattleCmd_AttackableInfo,
3049
- (obj) => {
3050
- return 3 + obj.activatableCount * 11;
3051
- },
3052
- (obj) => obj.attackableCount
3053
- )
3054
- ], YGOProMsgSelectBattleCmd.prototype, "attackableCards", 2);
3055
- __decorateClass([
3056
- BinaryField("u8", (obj) => {
3057
- return 3 + obj.activatableCount * 11 + obj.attackableCount * 8;
3058
- })
3059
- ], YGOProMsgSelectBattleCmd.prototype, "canM2", 2);
3060
- __decorateClass([
3061
- BinaryField("u8", (obj) => {
3062
- return 4 + obj.activatableCount * 11 + obj.attackableCount * 8;
3063
- })
3064
- ], YGOProMsgSelectBattleCmd.prototype, "canEp", 2);
3065
-
3066
- // src/protos/msg/proto/select-card.ts
3067
- var YGOProMsgSelectCard_CardInfo = class {
3068
- };
3069
- __decorateClass([
3070
- BinaryField("i32", 0)
3071
- ], YGOProMsgSelectCard_CardInfo.prototype, "code", 2);
3072
- __decorateClass([
3073
- BinaryField("u8", 4)
3074
- ], YGOProMsgSelectCard_CardInfo.prototype, "controller", 2);
3075
- __decorateClass([
3076
- BinaryField("u8", 5)
3077
- ], YGOProMsgSelectCard_CardInfo.prototype, "location", 2);
3078
- __decorateClass([
3079
- BinaryField("u8", 6)
3080
- ], YGOProMsgSelectCard_CardInfo.prototype, "sequence", 2);
3081
- __decorateClass([
3082
- BinaryField("u8", 7)
3083
- ], YGOProMsgSelectCard_CardInfo.prototype, "subsequence", 2);
3084
- var YGOProMsgSelectCard = class extends YGOProMsgResponseBase {
3085
- static {
3086
- this.identifier = OcgcoreCommonConstants.MSG_SELECT_CARD;
3087
- }
3088
- responsePlayer() {
3089
- return this.player;
3090
- }
3091
- defaultResponse() {
3092
- if (this.cancelable === 0) {
3093
- return void 0;
3094
- }
3095
- return this.prepareResponse(null);
3096
- }
3097
- prepareResponse(cardOptions) {
3098
- if (cardOptions == null) {
3099
- const buffer2 = new Uint8Array(4);
3100
- const view = new DataView(buffer2.buffer);
3101
- view.setInt32(0, -1, true);
3102
- return buffer2;
3103
- }
3104
- const indices = [];
3105
- const usedIndices = /* @__PURE__ */ new Set();
3106
- for (const option of cardOptions) {
3107
- let index;
3108
- if (isIndexResponse(option)) {
3109
- index = option.index;
3110
- if (index < 0 || index >= this.count) {
3111
- throw new TypeError(`Index out of range: ${index}`);
3112
- }
3113
- } else {
3114
- index = this.cards.findIndex(
3115
- (card, idx) => !usedIndices.has(idx) && (option.code == null || card.code === option.code) && (option.controller == null || card.controller === option.controller) && (option.location == null || card.location === option.location) && (option.sequence == null || card.sequence === option.sequence)
3116
- );
3117
- if (index === -1) {
3118
- throw new TypeError("Card not found");
3119
- }
3120
- }
3121
- indices.push(index);
3122
- usedIndices.add(index);
3123
- }
3124
- const buffer = new Uint8Array(1 + indices.length);
3125
- buffer[0] = indices.length;
3126
- indices.forEach((idx, i) => {
3127
- buffer[1 + i] = idx;
3128
- });
3129
- return buffer;
3130
- }
3131
- };
3132
- __decorateClass([
3133
- BinaryField("u8", 0)
3134
- ], YGOProMsgSelectCard.prototype, "player", 2);
3135
- __decorateClass([
3136
- BinaryField("u8", 1)
3137
- ], YGOProMsgSelectCard.prototype, "cancelable", 2);
3138
- __decorateClass([
3139
- BinaryField("u8", 2)
3140
- ], YGOProMsgSelectCard.prototype, "min", 2);
3141
- __decorateClass([
3142
- BinaryField("u8", 3)
3143
- ], YGOProMsgSelectCard.prototype, "max", 2);
3144
- __decorateClass([
3145
- BinaryField("u8", 4)
3146
- ], YGOProMsgSelectCard.prototype, "count", 2);
3147
- __decorateClass([
3148
- BinaryField(() => YGOProMsgSelectCard_CardInfo, 5, (obj) => obj.count)
3149
- ], YGOProMsgSelectCard.prototype, "cards", 2);
3150
-
3151
- // src/protos/msg/proto/select-chain.ts
3152
- var YGOProMsgSelectChain_ChainInfo = class {
3153
- };
3154
- __decorateClass([
3155
- BinaryField("u8", 0)
3156
- ], YGOProMsgSelectChain_ChainInfo.prototype, "edesc", 2);
3157
- __decorateClass([
3158
- BinaryField("u8", 1)
3159
- ], YGOProMsgSelectChain_ChainInfo.prototype, "forced", 2);
3160
- __decorateClass([
3161
- BinaryField("i32", 2)
3162
- ], YGOProMsgSelectChain_ChainInfo.prototype, "code", 2);
3163
- __decorateClass([
3164
- BinaryField("u8", 6)
3165
- ], YGOProMsgSelectChain_ChainInfo.prototype, "controller", 2);
3166
- __decorateClass([
3167
- BinaryField("u8", 7)
3168
- ], YGOProMsgSelectChain_ChainInfo.prototype, "location", 2);
3169
- __decorateClass([
3170
- BinaryField("u8", 8)
3171
- ], YGOProMsgSelectChain_ChainInfo.prototype, "sequence", 2);
3172
- __decorateClass([
3173
- BinaryField("u8", 9)
3174
- ], YGOProMsgSelectChain_ChainInfo.prototype, "subsequence", 2);
3175
- __decorateClass([
3176
- BinaryField("i32", 10)
3177
- ], YGOProMsgSelectChain_ChainInfo.prototype, "desc", 2);
3178
- var YGOProMsgSelectChain = class extends YGOProMsgResponseBase {
3179
- static {
3180
- this.identifier = OcgcoreCommonConstants.MSG_SELECT_CHAIN;
3181
- }
3182
- responsePlayer() {
3183
- return this.player;
3184
- }
3185
- defaultResponse() {
3186
- const hasForced = this.chains.some((chain) => chain.forced !== 0);
3187
- if (hasForced) {
3188
- return void 0;
3189
- }
3190
- return this.prepareResponse(null);
3191
- }
3192
- prepareResponse(option) {
3193
- let index;
3194
- if (option == null) {
3195
- index = -1;
3196
- } else if (isIndexResponse(option)) {
3197
- index = option.index;
3198
- if (index < -1 || index >= this.count) {
3199
- throw new TypeError(`Index out of range: ${index}`);
3200
- }
3201
- } else {
3202
- index = this.chains.findIndex(
3203
- (chain) => (option.code == null || chain.code === option.code) && (option.controller == null || chain.controller === option.controller) && (option.location == null || chain.location === option.location) && (option.sequence == null || chain.sequence === option.sequence) && (option.desc == null || chain.desc === option.desc)
3204
- );
3205
- if (index === -1) {
3206
- throw new TypeError("Chain not found");
3207
- }
3208
- }
3209
- const buffer = new Uint8Array(4);
3210
- const view = new DataView(buffer.buffer);
3211
- view.setInt32(0, index, true);
3212
- return buffer;
3213
- }
3214
- };
3215
- __decorateClass([
3216
- BinaryField("u8", 0)
3217
- ], YGOProMsgSelectChain.prototype, "player", 2);
3218
- __decorateClass([
3219
- BinaryField("u8", 1)
3220
- ], YGOProMsgSelectChain.prototype, "count", 2);
3221
- __decorateClass([
3222
- BinaryField("u8", 2)
3223
- ], YGOProMsgSelectChain.prototype, "specialCount", 2);
3224
- __decorateClass([
3225
- BinaryField("i32", 3)
3226
- ], YGOProMsgSelectChain.prototype, "hint0", 2);
3227
- __decorateClass([
3228
- BinaryField("i32", 7)
3229
- ], YGOProMsgSelectChain.prototype, "hint1", 2);
3230
- __decorateClass([
3231
- BinaryField(() => YGOProMsgSelectChain_ChainInfo, 11, (obj) => obj.count)
3232
- ], YGOProMsgSelectChain.prototype, "chains", 2);
3233
-
3234
- // src/protos/msg/proto/select-counter.ts
3235
- var YGOProMsgSelectCounter_CardInfo = class {
3236
- };
3237
- __decorateClass([
3238
- BinaryField("i32", 0)
3239
- ], YGOProMsgSelectCounter_CardInfo.prototype, "code", 2);
3240
- __decorateClass([
3241
- BinaryField("u8", 4)
3242
- ], YGOProMsgSelectCounter_CardInfo.prototype, "controller", 2);
3243
- __decorateClass([
3244
- BinaryField("u8", 5)
3245
- ], YGOProMsgSelectCounter_CardInfo.prototype, "location", 2);
3246
- __decorateClass([
3247
- BinaryField("u8", 6)
3248
- ], YGOProMsgSelectCounter_CardInfo.prototype, "sequence", 2);
3249
- __decorateClass([
3250
- BinaryField("u16", 7)
3251
- ], YGOProMsgSelectCounter_CardInfo.prototype, "counterCount", 2);
3252
- var YGOProMsgSelectCounter = class extends YGOProMsgResponseBase {
3253
- static {
3254
- this.identifier = OcgcoreCommonConstants.MSG_SELECT_COUNTER;
3255
- }
3256
- responsePlayer() {
3257
- return this.player;
3258
- }
3259
- prepareResponse(counterOptions) {
3260
- const counterCounts = new Array(this.count).fill(0);
3261
- for (const option of counterOptions) {
3262
- let index;
3263
- if (isIndexResponse(option.card)) {
3264
- index = option.card.index;
3265
- if (index < 0 || index >= this.count) {
3266
- throw new TypeError(`Index out of range: ${index}`);
3267
- }
3268
- } else {
3269
- const card = option.card;
3270
- index = this.cards.findIndex(
3271
- (card2) => (card2.code == null || card2.code === card2.code) && (card2.controller == null || card2.controller === card2.controller) && (card2.location == null || card2.location === card2.location) && (card2.sequence == null || card2.sequence === card2.sequence)
3272
- );
3273
- if (index === -1) {
3274
- throw new TypeError("Card not found");
3275
- }
3276
- }
3277
- counterCounts[index] = option.count;
3278
- }
3279
- const buffer = new Uint8Array(counterCounts.length * 2);
3280
- const view = new DataView(buffer.buffer);
3281
- counterCounts.forEach((count, i) => {
3282
- view.setUint16(i * 2, count, true);
3283
- });
3284
- return buffer;
3285
- }
3286
- };
3287
- __decorateClass([
3288
- BinaryField("u8", 0)
3289
- ], YGOProMsgSelectCounter.prototype, "player", 2);
3290
- __decorateClass([
3291
- BinaryField("u16", 1)
3292
- ], YGOProMsgSelectCounter.prototype, "counterType", 2);
3293
- __decorateClass([
3294
- BinaryField("u16", 3)
3295
- ], YGOProMsgSelectCounter.prototype, "counterCount", 2);
3296
- __decorateClass([
3297
- BinaryField("u8", 5)
3298
- ], YGOProMsgSelectCounter.prototype, "count", 2);
3299
- __decorateClass([
3300
- BinaryField(() => YGOProMsgSelectCounter_CardInfo, 6, (obj) => obj.count)
3301
- ], YGOProMsgSelectCounter.prototype, "cards", 2);
3302
-
3303
2567
  // src/vendor/script-constants.ts
3304
2568
  var OcgcoreScriptConstants = {
3305
2569
  ACTIVITY_ATTACK: 5,
@@ -4138,6 +3402,783 @@ var OcgcoreScriptConstants = {
4138
3402
  TYPE_XYZ: 8388608
4139
3403
  };
4140
3404
 
3405
+ // src/protos/msg/proto/move.ts
3406
+ var YGOProMsgMove_CardLocation = class {
3407
+ };
3408
+ __decorateClass([
3409
+ BinaryField("u8", 0)
3410
+ ], YGOProMsgMove_CardLocation.prototype, "controller", 2);
3411
+ __decorateClass([
3412
+ BinaryField("u8", 1)
3413
+ ], YGOProMsgMove_CardLocation.prototype, "location", 2);
3414
+ __decorateClass([
3415
+ BinaryField("u8", 2)
3416
+ ], YGOProMsgMove_CardLocation.prototype, "sequence", 2);
3417
+ __decorateClass([
3418
+ BinaryField("u8", 3)
3419
+ ], YGOProMsgMove_CardLocation.prototype, "position", 2);
3420
+ var YGOProMsgMove = class extends YGOProMsgBase {
3421
+ static {
3422
+ this.identifier = OcgcoreCommonConstants.MSG_MOVE;
3423
+ }
3424
+ opponentView() {
3425
+ const view = this.copy();
3426
+ const cl = view.current.location;
3427
+ const cp = view.current.position;
3428
+ if (cl & (OcgcoreScriptConstants.LOCATION_GRAVE | OcgcoreScriptConstants.LOCATION_OVERLAY)) {
3429
+ return view;
3430
+ }
3431
+ if (cl & (OcgcoreScriptConstants.LOCATION_DECK | OcgcoreScriptConstants.LOCATION_HAND) || cp & OcgcoreCommonConstants.POS_FACEDOWN) {
3432
+ view.code = 0;
3433
+ }
3434
+ return view;
3435
+ }
3436
+ teammateView() {
3437
+ const view = this.copy();
3438
+ const cl = view.current.location;
3439
+ const cp = view.current.position;
3440
+ if (cl & (OcgcoreScriptConstants.LOCATION_GRAVE | OcgcoreScriptConstants.LOCATION_OVERLAY)) {
3441
+ return view;
3442
+ }
3443
+ if (cl & (OcgcoreScriptConstants.LOCATION_DECK | OcgcoreScriptConstants.LOCATION_HAND)) {
3444
+ view.code = 0;
3445
+ }
3446
+ return view;
3447
+ }
3448
+ playerView(playerId) {
3449
+ if (playerId === 7 /* OBSERVER */) {
3450
+ return this.observerView();
3451
+ }
3452
+ if (playerId === this.current.controller) {
3453
+ return this.copy();
3454
+ }
3455
+ return this.opponentView();
3456
+ }
3457
+ };
3458
+ __decorateClass([
3459
+ BinaryField("i32", 0)
3460
+ ], YGOProMsgMove.prototype, "code", 2);
3461
+ __decorateClass([
3462
+ BinaryField(() => YGOProMsgMove_CardLocation, 4)
3463
+ ], YGOProMsgMove.prototype, "previous", 2);
3464
+ __decorateClass([
3465
+ BinaryField(() => YGOProMsgMove_CardLocation, 8)
3466
+ ], YGOProMsgMove.prototype, "current", 2);
3467
+ __decorateClass([
3468
+ BinaryField("i32", 12)
3469
+ ], YGOProMsgMove.prototype, "reason", 2);
3470
+
3471
+ // src/protos/msg/proto/new-phase.ts
3472
+ var YGOProMsgNewPhase = class extends YGOProMsgBase {
3473
+ static {
3474
+ this.identifier = OcgcoreCommonConstants.MSG_NEW_PHASE;
3475
+ }
3476
+ };
3477
+ __decorateClass([
3478
+ BinaryField("u16", 0)
3479
+ ], YGOProMsgNewPhase.prototype, "phase", 2);
3480
+
3481
+ // src/protos/msg/proto/new-turn.ts
3482
+ var YGOProMsgNewTurn = class extends YGOProMsgBase {
3483
+ static {
3484
+ this.identifier = OcgcoreCommonConstants.MSG_NEW_TURN;
3485
+ }
3486
+ };
3487
+ __decorateClass([
3488
+ BinaryField("u8", 0)
3489
+ ], YGOProMsgNewTurn.prototype, "player", 2);
3490
+
3491
+ // src/protos/msg/proto/pay-lpcost.ts
3492
+ var YGOProMsgPayLpCost = class extends YGOProMsgBase {
3493
+ static {
3494
+ this.identifier = OcgcoreCommonConstants.MSG_PAY_LPCOST;
3495
+ }
3496
+ };
3497
+ __decorateClass([
3498
+ BinaryField("u8", 0)
3499
+ ], YGOProMsgPayLpCost.prototype, "player", 2);
3500
+ __decorateClass([
3501
+ BinaryField("i32", 1)
3502
+ ], YGOProMsgPayLpCost.prototype, "cost", 2);
3503
+
3504
+ // src/protos/msg/proto/player-hint.ts
3505
+ var YGOProMsgPlayerHint = class extends YGOProMsgBase {
3506
+ static {
3507
+ this.identifier = OcgcoreCommonConstants.MSG_PLAYER_HINT;
3508
+ }
3509
+ };
3510
+ __decorateClass([
3511
+ BinaryField("u8", 0)
3512
+ ], YGOProMsgPlayerHint.prototype, "player", 2);
3513
+ __decorateClass([
3514
+ BinaryField("u8", 1)
3515
+ ], YGOProMsgPlayerHint.prototype, "type", 2);
3516
+ __decorateClass([
3517
+ BinaryField("i32", 2)
3518
+ ], YGOProMsgPlayerHint.prototype, "value", 2);
3519
+
3520
+ // src/protos/msg/proto/pos-change.ts
3521
+ var YGOProMsgPosChange_CardLocation = class {
3522
+ };
3523
+ __decorateClass([
3524
+ BinaryField("u8", 0)
3525
+ ], YGOProMsgPosChange_CardLocation.prototype, "controller", 2);
3526
+ __decorateClass([
3527
+ BinaryField("u8", 1)
3528
+ ], YGOProMsgPosChange_CardLocation.prototype, "location", 2);
3529
+ __decorateClass([
3530
+ BinaryField("u8", 2)
3531
+ ], YGOProMsgPosChange_CardLocation.prototype, "sequence", 2);
3532
+ var YGOProMsgPosChange = class extends YGOProMsgBase {
3533
+ static {
3534
+ this.identifier = OcgcoreCommonConstants.MSG_POS_CHANGE;
3535
+ }
3536
+ };
3537
+ __decorateClass([
3538
+ BinaryField(() => YGOProMsgPosChange_CardLocation, 0)
3539
+ ], YGOProMsgPosChange.prototype, "card", 2);
3540
+ __decorateClass([
3541
+ BinaryField("u8", 3)
3542
+ ], YGOProMsgPosChange.prototype, "previousPosition", 2);
3543
+ __decorateClass([
3544
+ BinaryField("u8", 4)
3545
+ ], YGOProMsgPosChange.prototype, "currentPosition", 2);
3546
+
3547
+ // src/protos/msg/proto/random-selected.ts
3548
+ var YGOProMsgRandomSelected = class extends YGOProMsgBase {
3549
+ static {
3550
+ this.identifier = OcgcoreCommonConstants.MSG_RANDOM_SELECTED;
3551
+ }
3552
+ };
3553
+ __decorateClass([
3554
+ BinaryField("u8", 0)
3555
+ ], YGOProMsgRandomSelected.prototype, "player", 2);
3556
+ __decorateClass([
3557
+ BinaryField("u8", 1)
3558
+ ], YGOProMsgRandomSelected.prototype, "count", 2);
3559
+ __decorateClass([
3560
+ BinaryField("i32", 2, (obj) => obj.count)
3561
+ ], YGOProMsgRandomSelected.prototype, "cards", 2);
3562
+
3563
+ // src/protos/msg/proto/recover.ts
3564
+ var YGOProMsgRecover = class extends YGOProMsgBase {
3565
+ static {
3566
+ this.identifier = OcgcoreCommonConstants.MSG_RECOVER;
3567
+ }
3568
+ };
3569
+ __decorateClass([
3570
+ BinaryField("u8", 0)
3571
+ ], YGOProMsgRecover.prototype, "player", 2);
3572
+ __decorateClass([
3573
+ BinaryField("i32", 1)
3574
+ ], YGOProMsgRecover.prototype, "value", 2);
3575
+
3576
+ // src/protos/msg/proto/reload-field.ts
3577
+ var YGOProMsgReloadField_ZoneCard = class {
3578
+ };
3579
+ var YGOProMsgReloadField_PlayerInfo = class {
3580
+ };
3581
+ var YGOProMsgReloadField_ChainInfo = class {
3582
+ };
3583
+ var YGOProMsgReloadField = class extends YGOProMsgBase {
3584
+ static {
3585
+ this.identifier = 162;
3586
+ }
3587
+ fromPayload(data) {
3588
+ if (data.length < 1) {
3589
+ throw new Error("MSG data too short");
3590
+ }
3591
+ const msgType = data[0];
3592
+ if (msgType !== this.identifier) {
3593
+ throw new Error(
3594
+ `MSG type mismatch: expected ${this.identifier}, got ${msgType}`
3595
+ );
3596
+ }
3597
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
3598
+ let offset = 1;
3599
+ this.duelRule = view.getUint8(offset++);
3600
+ this.players = [];
3601
+ for (let i = 0; i < 2; i++) {
3602
+ const player = {
3603
+ lp: view.getInt32(offset, true),
3604
+ mzone: [],
3605
+ szone: [],
3606
+ deckCount: 0,
3607
+ handCount: 0,
3608
+ graveCount: 0,
3609
+ removedCount: 0,
3610
+ extraCount: 0,
3611
+ extraPCount: 0
3612
+ };
3613
+ offset += 4;
3614
+ for (let seq = 0; seq < 7; seq++) {
3615
+ const occupied = view.getUint8(offset++);
3616
+ const card = { occupied };
3617
+ if (occupied) {
3618
+ card.position = view.getUint8(offset++);
3619
+ card.xyzCount = view.getUint8(offset++);
3620
+ }
3621
+ player.mzone.push(card);
3622
+ }
3623
+ for (let seq = 0; seq < 8; seq++) {
3624
+ const occupied = view.getUint8(offset++);
3625
+ const card = { occupied };
3626
+ if (occupied) {
3627
+ card.position = view.getUint8(offset++);
3628
+ }
3629
+ player.szone.push(card);
3630
+ }
3631
+ player.deckCount = view.getUint8(offset++);
3632
+ player.handCount = view.getUint8(offset++);
3633
+ player.graveCount = view.getUint8(offset++);
3634
+ player.removedCount = view.getUint8(offset++);
3635
+ player.extraCount = view.getUint8(offset++);
3636
+ player.extraPCount = view.getUint8(offset++);
3637
+ this.players.push(player);
3638
+ }
3639
+ const chainCount = view.getUint8(offset++);
3640
+ this.chains = [];
3641
+ for (let i = 0; i < chainCount; i++) {
3642
+ const chain = {
3643
+ code: view.getInt32(offset, true),
3644
+ chainCardController: view.getUint8(offset + 4),
3645
+ chainCardLocation: view.getUint8(offset + 5),
3646
+ chainCardSequence: view.getUint8(offset + 6),
3647
+ chainCardSubsequence: view.getUint8(offset + 7),
3648
+ triggerController: view.getUint8(offset + 8),
3649
+ triggerLocation: view.getUint8(offset + 9),
3650
+ triggerSequence: view.getUint8(offset + 10),
3651
+ desc: view.getInt32(offset + 11, true)
3652
+ };
3653
+ offset += 15;
3654
+ this.chains.push(chain);
3655
+ }
3656
+ return this;
3657
+ }
3658
+ toPayload() {
3659
+ let size = 1 + 1;
3660
+ for (const player of this.players) {
3661
+ size += 4;
3662
+ for (const card of player.mzone) {
3663
+ size += 1;
3664
+ if (card.occupied) {
3665
+ size += 2;
3666
+ }
3667
+ }
3668
+ for (const card of player.szone) {
3669
+ size += 1;
3670
+ if (card.occupied) {
3671
+ size += 1;
3672
+ }
3673
+ }
3674
+ size += 6;
3675
+ }
3676
+ size += 1;
3677
+ size += this.chains.length * 15;
3678
+ const result = new Uint8Array(size);
3679
+ const view = new DataView(result.buffer);
3680
+ let offset = 0;
3681
+ result[offset++] = this.identifier;
3682
+ result[offset++] = this.duelRule;
3683
+ for (const player of this.players) {
3684
+ view.setInt32(offset, player.lp, true);
3685
+ offset += 4;
3686
+ for (const card of player.mzone) {
3687
+ result[offset++] = card.occupied;
3688
+ if (card.occupied) {
3689
+ result[offset++] = card.position || 0;
3690
+ result[offset++] = card.xyzCount || 0;
3691
+ }
3692
+ }
3693
+ for (const card of player.szone) {
3694
+ result[offset++] = card.occupied;
3695
+ if (card.occupied) {
3696
+ result[offset++] = card.position || 0;
3697
+ }
3698
+ }
3699
+ result[offset++] = player.deckCount;
3700
+ result[offset++] = player.handCount;
3701
+ result[offset++] = player.graveCount;
3702
+ result[offset++] = player.removedCount;
3703
+ result[offset++] = player.extraCount;
3704
+ result[offset++] = player.extraPCount;
3705
+ }
3706
+ result[offset++] = this.chains.length;
3707
+ for (const chain of this.chains) {
3708
+ view.setInt32(offset, chain.code, true);
3709
+ result[offset + 4] = chain.chainCardController;
3710
+ result[offset + 5] = chain.chainCardLocation;
3711
+ result[offset + 6] = chain.chainCardSequence;
3712
+ result[offset + 7] = chain.chainCardSubsequence;
3713
+ result[offset + 8] = chain.triggerController;
3714
+ result[offset + 9] = chain.triggerLocation;
3715
+ result[offset + 10] = chain.triggerSequence;
3716
+ view.setInt32(offset + 11, chain.desc, true);
3717
+ offset += 15;
3718
+ }
3719
+ return result;
3720
+ }
3721
+ };
3722
+
3723
+ // src/protos/msg/proto/remove-counter.ts
3724
+ var YGOProMsgRemoveCounter = class extends YGOProMsgBase {
3725
+ static {
3726
+ this.identifier = OcgcoreCommonConstants.MSG_REMOVE_COUNTER;
3727
+ }
3728
+ };
3729
+ __decorateClass([
3730
+ BinaryField("u16", 0)
3731
+ ], YGOProMsgRemoveCounter.prototype, "counterType", 2);
3732
+ __decorateClass([
3733
+ BinaryField("u8", 2)
3734
+ ], YGOProMsgRemoveCounter.prototype, "controller", 2);
3735
+ __decorateClass([
3736
+ BinaryField("u8", 3)
3737
+ ], YGOProMsgRemoveCounter.prototype, "location", 2);
3738
+ __decorateClass([
3739
+ BinaryField("u8", 4)
3740
+ ], YGOProMsgRemoveCounter.prototype, "sequence", 2);
3741
+ __decorateClass([
3742
+ BinaryField("u16", 5)
3743
+ ], YGOProMsgRemoveCounter.prototype, "count", 2);
3744
+
3745
+ // src/protos/msg/proto/reset-time.ts
3746
+ var YGOProMsgResetTime = class extends YGOProMsgBase {
3747
+ static {
3748
+ this.identifier = OcgcoreCommonConstants.MSG_RESET_TIME;
3749
+ }
3750
+ getSendTargets() {
3751
+ return [];
3752
+ }
3753
+ };
3754
+ __decorateClass([
3755
+ BinaryField("i8", 0)
3756
+ ], YGOProMsgResetTime.prototype, "player", 2);
3757
+ __decorateClass([
3758
+ BinaryField("i16", 1)
3759
+ ], YGOProMsgResetTime.prototype, "time", 2);
3760
+
3761
+ // src/protos/msg/proto/retry.ts
3762
+ var YGOProMsgRetry = class extends YGOProMsgBase {
3763
+ static {
3764
+ this.identifier = OcgcoreCommonConstants.MSG_RETRY;
3765
+ }
3766
+ getSendTargets() {
3767
+ return [];
3768
+ }
3769
+ };
3770
+
3771
+ // src/protos/msg/proto/reverse-deck.ts
3772
+ var YGOProMsgReverseDeck = class extends YGOProMsgBase {
3773
+ static {
3774
+ this.identifier = OcgcoreCommonConstants.MSG_REVERSE_DECK;
3775
+ }
3776
+ };
3777
+
3778
+ // src/protos/msg/proto/rock-paper-scissors.ts
3779
+ var YGOProMsgRockPaperScissors = class extends YGOProMsgResponseBase {
3780
+ static {
3781
+ this.identifier = OcgcoreCommonConstants.MSG_ROCK_PAPER_SCISSORS;
3782
+ }
3783
+ responsePlayer() {
3784
+ return this.player;
3785
+ }
3786
+ prepareResponse(choice) {
3787
+ if (choice < 1 /* ROCK */ || choice > 3 /* PAPER */) {
3788
+ throw new TypeError(
3789
+ `Invalid choice: ${choice}. Must be 1 (ROCK), 2 (SCISSORS), or 3 (PAPER)`
3790
+ );
3791
+ }
3792
+ const buffer = new Uint8Array(1);
3793
+ buffer[0] = choice;
3794
+ return buffer;
3795
+ }
3796
+ };
3797
+ __decorateClass([
3798
+ BinaryField("u8", 0)
3799
+ ], YGOProMsgRockPaperScissors.prototype, "player", 2);
3800
+
3801
+ // src/protos/msg/proto/select-battlecmd.ts
3802
+ var BattleCmdType = /* @__PURE__ */ ((BattleCmdType2) => {
3803
+ BattleCmdType2[BattleCmdType2["ACTIVATE"] = 0] = "ACTIVATE";
3804
+ BattleCmdType2[BattleCmdType2["ATTACK"] = 1] = "ATTACK";
3805
+ BattleCmdType2[BattleCmdType2["TO_M2"] = 2] = "TO_M2";
3806
+ BattleCmdType2[BattleCmdType2["TO_EP"] = 3] = "TO_EP";
3807
+ return BattleCmdType2;
3808
+ })(BattleCmdType || {});
3809
+ var YGOProMsgSelectBattleCmd_ActivatableInfo = class {
3810
+ };
3811
+ __decorateClass([
3812
+ BinaryField("i32", 0)
3813
+ ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "code", 2);
3814
+ __decorateClass([
3815
+ BinaryField("u8", 4)
3816
+ ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "controller", 2);
3817
+ __decorateClass([
3818
+ BinaryField("u8", 5)
3819
+ ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "location", 2);
3820
+ __decorateClass([
3821
+ BinaryField("u8", 6)
3822
+ ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "sequence", 2);
3823
+ __decorateClass([
3824
+ BinaryField("i32", 7)
3825
+ ], YGOProMsgSelectBattleCmd_ActivatableInfo.prototype, "desc", 2);
3826
+ var YGOProMsgSelectBattleCmd_AttackableInfo = class {
3827
+ };
3828
+ __decorateClass([
3829
+ BinaryField("i32", 0)
3830
+ ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "code", 2);
3831
+ __decorateClass([
3832
+ BinaryField("u8", 4)
3833
+ ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "controller", 2);
3834
+ __decorateClass([
3835
+ BinaryField("u8", 5)
3836
+ ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "location", 2);
3837
+ __decorateClass([
3838
+ BinaryField("u8", 6)
3839
+ ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "sequence", 2);
3840
+ __decorateClass([
3841
+ BinaryField("u8", 7)
3842
+ ], YGOProMsgSelectBattleCmd_AttackableInfo.prototype, "directAttack", 2);
3843
+ var YGOProMsgSelectBattleCmd = class extends YGOProMsgResponseBase {
3844
+ static {
3845
+ this.identifier = OcgcoreCommonConstants.MSG_SELECT_BATTLECMD;
3846
+ }
3847
+ responsePlayer() {
3848
+ return this.player;
3849
+ }
3850
+ prepareResponse(type, option) {
3851
+ let sequence;
3852
+ if (type === 0 /* ACTIVATE */) {
3853
+ if (option == null) {
3854
+ throw new TypeError("Option required for ACTIVATE");
3855
+ }
3856
+ if (isIndexResponse(option)) {
3857
+ sequence = option.index;
3858
+ if (sequence < 0 || sequence >= this.activatableCount) {
3859
+ throw new TypeError(`Index out of range: ${sequence}`);
3860
+ }
3861
+ } else {
3862
+ const idx = this.activatableCards.findIndex(
3863
+ (card) => (option.code == null || card.code === option.code) && (option.controller == null || card.controller === option.controller) && (option.location == null || card.location === option.location) && (option.sequence == null || card.sequence === option.sequence) && (option.desc == null || card.desc === option.desc)
3864
+ );
3865
+ if (idx === -1) {
3866
+ throw new TypeError("Activatable card not found");
3867
+ }
3868
+ sequence = idx;
3869
+ }
3870
+ } else if (type === 1 /* ATTACK */) {
3871
+ if (option == null) {
3872
+ throw new TypeError("Option required for ATTACK");
3873
+ }
3874
+ if (isIndexResponse(option)) {
3875
+ sequence = option.index;
3876
+ if (sequence < 0 || sequence >= this.attackableCount) {
3877
+ throw new TypeError(`Index out of range: ${sequence}`);
3878
+ }
3879
+ } else {
3880
+ const idx = this.attackableCards.findIndex(
3881
+ (card) => (option.code == null || card.code === option.code) && (option.controller == null || card.controller === option.controller) && (option.location == null || card.location === option.location) && (option.sequence == null || card.sequence === option.sequence)
3882
+ );
3883
+ if (idx === -1) {
3884
+ throw new TypeError("Attackable card not found");
3885
+ }
3886
+ sequence = idx;
3887
+ }
3888
+ } else if (type === 2 /* TO_M2 */) {
3889
+ if (this.canM2 === 0) {
3890
+ throw new TypeError("Cannot go to M2");
3891
+ }
3892
+ sequence = 0;
3893
+ } else if (type === 3 /* TO_EP */) {
3894
+ if (this.canEp === 0) {
3895
+ throw new TypeError("Cannot go to EP");
3896
+ }
3897
+ sequence = 0;
3898
+ } else {
3899
+ throw new TypeError(`Unknown type: ${type}`);
3900
+ }
3901
+ const buffer = new Uint8Array(4);
3902
+ const view = new DataView(buffer.buffer);
3903
+ view.setUint32(0, sequence << 16 | type, true);
3904
+ return buffer;
3905
+ }
3906
+ };
3907
+ __decorateClass([
3908
+ BinaryField("u8", 0)
3909
+ ], YGOProMsgSelectBattleCmd.prototype, "player", 2);
3910
+ __decorateClass([
3911
+ BinaryField("u8", 1)
3912
+ ], YGOProMsgSelectBattleCmd.prototype, "activatableCount", 2);
3913
+ __decorateClass([
3914
+ BinaryField(
3915
+ () => YGOProMsgSelectBattleCmd_ActivatableInfo,
3916
+ 2,
3917
+ (obj) => obj.activatableCount
3918
+ )
3919
+ ], YGOProMsgSelectBattleCmd.prototype, "activatableCards", 2);
3920
+ __decorateClass([
3921
+ BinaryField("u8", (obj) => {
3922
+ return 2 + obj.activatableCount * 11;
3923
+ })
3924
+ ], YGOProMsgSelectBattleCmd.prototype, "attackableCount", 2);
3925
+ __decorateClass([
3926
+ BinaryField(
3927
+ () => YGOProMsgSelectBattleCmd_AttackableInfo,
3928
+ (obj) => {
3929
+ return 3 + obj.activatableCount * 11;
3930
+ },
3931
+ (obj) => obj.attackableCount
3932
+ )
3933
+ ], YGOProMsgSelectBattleCmd.prototype, "attackableCards", 2);
3934
+ __decorateClass([
3935
+ BinaryField("u8", (obj) => {
3936
+ return 3 + obj.activatableCount * 11 + obj.attackableCount * 8;
3937
+ })
3938
+ ], YGOProMsgSelectBattleCmd.prototype, "canM2", 2);
3939
+ __decorateClass([
3940
+ BinaryField("u8", (obj) => {
3941
+ return 4 + obj.activatableCount * 11 + obj.attackableCount * 8;
3942
+ })
3943
+ ], YGOProMsgSelectBattleCmd.prototype, "canEp", 2);
3944
+
3945
+ // src/protos/msg/proto/select-card.ts
3946
+ var YGOProMsgSelectCard_CardInfo = class {
3947
+ };
3948
+ __decorateClass([
3949
+ BinaryField("i32", 0)
3950
+ ], YGOProMsgSelectCard_CardInfo.prototype, "code", 2);
3951
+ __decorateClass([
3952
+ BinaryField("u8", 4)
3953
+ ], YGOProMsgSelectCard_CardInfo.prototype, "controller", 2);
3954
+ __decorateClass([
3955
+ BinaryField("u8", 5)
3956
+ ], YGOProMsgSelectCard_CardInfo.prototype, "location", 2);
3957
+ __decorateClass([
3958
+ BinaryField("u8", 6)
3959
+ ], YGOProMsgSelectCard_CardInfo.prototype, "sequence", 2);
3960
+ __decorateClass([
3961
+ BinaryField("u8", 7)
3962
+ ], YGOProMsgSelectCard_CardInfo.prototype, "subsequence", 2);
3963
+ var YGOProMsgSelectCard = class extends YGOProMsgResponseBase {
3964
+ static {
3965
+ this.identifier = OcgcoreCommonConstants.MSG_SELECT_CARD;
3966
+ }
3967
+ responsePlayer() {
3968
+ return this.player;
3969
+ }
3970
+ defaultResponse() {
3971
+ if (this.cancelable === 0) {
3972
+ return void 0;
3973
+ }
3974
+ return this.prepareResponse(null);
3975
+ }
3976
+ prepareResponse(cardOptions) {
3977
+ if (cardOptions == null) {
3978
+ const buffer2 = new Uint8Array(4);
3979
+ const view = new DataView(buffer2.buffer);
3980
+ view.setInt32(0, -1, true);
3981
+ return buffer2;
3982
+ }
3983
+ const indices = [];
3984
+ const usedIndices = /* @__PURE__ */ new Set();
3985
+ for (const option of cardOptions) {
3986
+ let index;
3987
+ if (isIndexResponse(option)) {
3988
+ index = option.index;
3989
+ if (index < 0 || index >= this.count) {
3990
+ throw new TypeError(`Index out of range: ${index}`);
3991
+ }
3992
+ } else {
3993
+ index = this.cards.findIndex(
3994
+ (card, idx) => !usedIndices.has(idx) && (option.code == null || card.code === option.code) && (option.controller == null || card.controller === option.controller) && (option.location == null || card.location === option.location) && (option.sequence == null || card.sequence === option.sequence)
3995
+ );
3996
+ if (index === -1) {
3997
+ throw new TypeError("Card not found");
3998
+ }
3999
+ }
4000
+ indices.push(index);
4001
+ usedIndices.add(index);
4002
+ }
4003
+ const buffer = new Uint8Array(1 + indices.length);
4004
+ buffer[0] = indices.length;
4005
+ indices.forEach((idx, i) => {
4006
+ buffer[1 + i] = idx;
4007
+ });
4008
+ return buffer;
4009
+ }
4010
+ };
4011
+ __decorateClass([
4012
+ BinaryField("u8", 0)
4013
+ ], YGOProMsgSelectCard.prototype, "player", 2);
4014
+ __decorateClass([
4015
+ BinaryField("u8", 1)
4016
+ ], YGOProMsgSelectCard.prototype, "cancelable", 2);
4017
+ __decorateClass([
4018
+ BinaryField("u8", 2)
4019
+ ], YGOProMsgSelectCard.prototype, "min", 2);
4020
+ __decorateClass([
4021
+ BinaryField("u8", 3)
4022
+ ], YGOProMsgSelectCard.prototype, "max", 2);
4023
+ __decorateClass([
4024
+ BinaryField("u8", 4)
4025
+ ], YGOProMsgSelectCard.prototype, "count", 2);
4026
+ __decorateClass([
4027
+ BinaryField(() => YGOProMsgSelectCard_CardInfo, 5, (obj) => obj.count)
4028
+ ], YGOProMsgSelectCard.prototype, "cards", 2);
4029
+
4030
+ // src/protos/msg/proto/select-chain.ts
4031
+ var YGOProMsgSelectChain_ChainInfo = class {
4032
+ };
4033
+ __decorateClass([
4034
+ BinaryField("u8", 0)
4035
+ ], YGOProMsgSelectChain_ChainInfo.prototype, "edesc", 2);
4036
+ __decorateClass([
4037
+ BinaryField("u8", 1)
4038
+ ], YGOProMsgSelectChain_ChainInfo.prototype, "forced", 2);
4039
+ __decorateClass([
4040
+ BinaryField("i32", 2)
4041
+ ], YGOProMsgSelectChain_ChainInfo.prototype, "code", 2);
4042
+ __decorateClass([
4043
+ BinaryField("u8", 6)
4044
+ ], YGOProMsgSelectChain_ChainInfo.prototype, "controller", 2);
4045
+ __decorateClass([
4046
+ BinaryField("u8", 7)
4047
+ ], YGOProMsgSelectChain_ChainInfo.prototype, "location", 2);
4048
+ __decorateClass([
4049
+ BinaryField("u8", 8)
4050
+ ], YGOProMsgSelectChain_ChainInfo.prototype, "sequence", 2);
4051
+ __decorateClass([
4052
+ BinaryField("u8", 9)
4053
+ ], YGOProMsgSelectChain_ChainInfo.prototype, "subsequence", 2);
4054
+ __decorateClass([
4055
+ BinaryField("i32", 10)
4056
+ ], YGOProMsgSelectChain_ChainInfo.prototype, "desc", 2);
4057
+ var YGOProMsgSelectChain = class extends YGOProMsgResponseBase {
4058
+ static {
4059
+ this.identifier = OcgcoreCommonConstants.MSG_SELECT_CHAIN;
4060
+ }
4061
+ responsePlayer() {
4062
+ return this.player;
4063
+ }
4064
+ defaultResponse() {
4065
+ const hasForced = this.chains.some((chain) => chain.forced !== 0);
4066
+ if (hasForced) {
4067
+ return void 0;
4068
+ }
4069
+ return this.prepareResponse(null);
4070
+ }
4071
+ prepareResponse(option) {
4072
+ let index;
4073
+ if (option == null) {
4074
+ index = -1;
4075
+ } else if (isIndexResponse(option)) {
4076
+ index = option.index;
4077
+ if (index < -1 || index >= this.count) {
4078
+ throw new TypeError(`Index out of range: ${index}`);
4079
+ }
4080
+ } else {
4081
+ index = this.chains.findIndex(
4082
+ (chain) => (option.code == null || chain.code === option.code) && (option.controller == null || chain.controller === option.controller) && (option.location == null || chain.location === option.location) && (option.sequence == null || chain.sequence === option.sequence) && (option.desc == null || chain.desc === option.desc)
4083
+ );
4084
+ if (index === -1) {
4085
+ throw new TypeError("Chain not found");
4086
+ }
4087
+ }
4088
+ const buffer = new Uint8Array(4);
4089
+ const view = new DataView(buffer.buffer);
4090
+ view.setInt32(0, index, true);
4091
+ return buffer;
4092
+ }
4093
+ };
4094
+ __decorateClass([
4095
+ BinaryField("u8", 0)
4096
+ ], YGOProMsgSelectChain.prototype, "player", 2);
4097
+ __decorateClass([
4098
+ BinaryField("u8", 1)
4099
+ ], YGOProMsgSelectChain.prototype, "count", 2);
4100
+ __decorateClass([
4101
+ BinaryField("u8", 2)
4102
+ ], YGOProMsgSelectChain.prototype, "specialCount", 2);
4103
+ __decorateClass([
4104
+ BinaryField("i32", 3)
4105
+ ], YGOProMsgSelectChain.prototype, "hint0", 2);
4106
+ __decorateClass([
4107
+ BinaryField("i32", 7)
4108
+ ], YGOProMsgSelectChain.prototype, "hint1", 2);
4109
+ __decorateClass([
4110
+ BinaryField(() => YGOProMsgSelectChain_ChainInfo, 11, (obj) => obj.count)
4111
+ ], YGOProMsgSelectChain.prototype, "chains", 2);
4112
+
4113
+ // src/protos/msg/proto/select-counter.ts
4114
+ var YGOProMsgSelectCounter_CardInfo = class {
4115
+ };
4116
+ __decorateClass([
4117
+ BinaryField("i32", 0)
4118
+ ], YGOProMsgSelectCounter_CardInfo.prototype, "code", 2);
4119
+ __decorateClass([
4120
+ BinaryField("u8", 4)
4121
+ ], YGOProMsgSelectCounter_CardInfo.prototype, "controller", 2);
4122
+ __decorateClass([
4123
+ BinaryField("u8", 5)
4124
+ ], YGOProMsgSelectCounter_CardInfo.prototype, "location", 2);
4125
+ __decorateClass([
4126
+ BinaryField("u8", 6)
4127
+ ], YGOProMsgSelectCounter_CardInfo.prototype, "sequence", 2);
4128
+ __decorateClass([
4129
+ BinaryField("u16", 7)
4130
+ ], YGOProMsgSelectCounter_CardInfo.prototype, "counterCount", 2);
4131
+ var YGOProMsgSelectCounter = class extends YGOProMsgResponseBase {
4132
+ static {
4133
+ this.identifier = OcgcoreCommonConstants.MSG_SELECT_COUNTER;
4134
+ }
4135
+ responsePlayer() {
4136
+ return this.player;
4137
+ }
4138
+ prepareResponse(counterOptions) {
4139
+ const counterCounts = new Array(this.count).fill(0);
4140
+ for (const option of counterOptions) {
4141
+ let index;
4142
+ if (isIndexResponse(option.card)) {
4143
+ index = option.card.index;
4144
+ if (index < 0 || index >= this.count) {
4145
+ throw new TypeError(`Index out of range: ${index}`);
4146
+ }
4147
+ } else {
4148
+ const card = option.card;
4149
+ index = this.cards.findIndex(
4150
+ (card2) => (card2.code == null || card2.code === card2.code) && (card2.controller == null || card2.controller === card2.controller) && (card2.location == null || card2.location === card2.location) && (card2.sequence == null || card2.sequence === card2.sequence)
4151
+ );
4152
+ if (index === -1) {
4153
+ throw new TypeError("Card not found");
4154
+ }
4155
+ }
4156
+ counterCounts[index] = option.count;
4157
+ }
4158
+ const buffer = new Uint8Array(counterCounts.length * 2);
4159
+ const view = new DataView(buffer.buffer);
4160
+ counterCounts.forEach((count, i) => {
4161
+ view.setUint16(i * 2, count, true);
4162
+ });
4163
+ return buffer;
4164
+ }
4165
+ };
4166
+ __decorateClass([
4167
+ BinaryField("u8", 0)
4168
+ ], YGOProMsgSelectCounter.prototype, "player", 2);
4169
+ __decorateClass([
4170
+ BinaryField("u16", 1)
4171
+ ], YGOProMsgSelectCounter.prototype, "counterType", 2);
4172
+ __decorateClass([
4173
+ BinaryField("u16", 3)
4174
+ ], YGOProMsgSelectCounter.prototype, "counterCount", 2);
4175
+ __decorateClass([
4176
+ BinaryField("u8", 5)
4177
+ ], YGOProMsgSelectCounter.prototype, "count", 2);
4178
+ __decorateClass([
4179
+ BinaryField(() => YGOProMsgSelectCounter_CardInfo, 6, (obj) => obj.count)
4180
+ ], YGOProMsgSelectCounter.prototype, "cards", 2);
4181
+
4141
4182
  // src/protos/msg/proto/select-place-common.ts
4142
4183
  var YGOProMsgSelectPlaceCommon = class extends YGOProMsgResponseBase {
4143
4184
  getSelectablePlaces() {
@@ -4830,6 +4871,29 @@ var YGOProMsgSet = class extends YGOProMsgBase {
4830
4871
  static {
4831
4872
  this.identifier = OcgcoreCommonConstants.MSG_SET;
4832
4873
  }
4874
+ // MSG_SET 是盖放卡片,所有人都看不到 code(包括玩家自己)
4875
+ // 服务器在发送前会将 code 清零
4876
+ opponentView() {
4877
+ const view = this.copy();
4878
+ view.code = 0;
4879
+ return view;
4880
+ }
4881
+ teammateView() {
4882
+ const view = this.copy();
4883
+ view.code = 0;
4884
+ return view;
4885
+ }
4886
+ observerView() {
4887
+ const view = this.copy();
4888
+ view.code = 0;
4889
+ return view;
4890
+ }
4891
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4892
+ playerView(playerId) {
4893
+ const view = this.copy();
4894
+ view.code = 0;
4895
+ return view;
4896
+ }
4833
4897
  };
4834
4898
  __decorateClass([
4835
4899
  BinaryField("i32", 0)
@@ -5010,6 +5074,25 @@ var YGOProMsgSpSummoning = class extends YGOProMsgBase {
5010
5074
  static {
5011
5075
  this.identifier = OcgcoreCommonConstants.MSG_SPSUMMONING;
5012
5076
  }
5077
+ opponentView() {
5078
+ const view = this.copy();
5079
+ if (view.position & OcgcoreCommonConstants.POS_FACEDOWN) {
5080
+ view.code = 0;
5081
+ }
5082
+ return view;
5083
+ }
5084
+ teammateView() {
5085
+ return this.copy();
5086
+ }
5087
+ playerView(playerId) {
5088
+ if (playerId === 7 /* OBSERVER */) {
5089
+ return this.observerView();
5090
+ }
5091
+ if (playerId === this.controller) {
5092
+ return this.copy();
5093
+ }
5094
+ return this.opponentView();
5095
+ }
5013
5096
  };
5014
5097
  __decorateClass([
5015
5098
  BinaryField("i32", 0)
@@ -5246,6 +5329,9 @@ var YGOProMsgUpdateCard = class extends YGOProMsgBase {
5246
5329
  }
5247
5330
  }
5248
5331
  playerView(playerId) {
5332
+ if (playerId === 7 /* OBSERVER */) {
5333
+ return this.observerView();
5334
+ }
5249
5335
  if (this.controller === playerId) {
5250
5336
  return this.copy();
5251
5337
  }
@@ -5296,7 +5382,7 @@ var YGOProMsgUpdateCard = class extends YGOProMsgBase {
5296
5382
  return result;
5297
5383
  }
5298
5384
  getSendTargets() {
5299
- return [this.controller, 1 - this.controller, 7 /* OBSERVER */];
5385
+ return [];
5300
5386
  }
5301
5387
  };
5302
5388