游戏王残局简化版

Check-in [d1652d7fa4]
Login

Check-in [d1652d7fa4]

Overview
Comment:好
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d1652d7fa47f67c5740224246b32eb29ee9570e770cbdaa1388a377ed80f1e34
User & Date: 顽雨沉风 on 2024-02-13 14:53:10.951
Other Links: manifest | tags
Context
2024-02-13
14:57
好 check-in: 719cb47a61 user: 顽雨沉风 tags: trunk
14:53
好 check-in: d1652d7fa4 user: 顽雨沉风 tags: trunk
14:43
好 check-in: 1301c8be40 user: 顽雨沉风 tags: trunk
Changes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
local str = {}
local string = string
local table = table
local s = {}
_G.fun = {}
str["效果卡的种类表"] = {
  TYPE_SPELL,
  TYPE_TRAP,
  TYPE_EFFECT,
}
str["无效果灵摆怪兽表"] = {
  28363749,
  19474136,
  17390179,
  83980492,
}
local h1
--~ 区域
h1 = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED
str["除卡组与额外卡组以外的区域"] = h1
h1 = h1 + LOCATION_DECK + LOCATION_EXTRA
str["所有区域"] = h1
--第一层-------------------------------
local cache_1
local cache_2
local cache_3
local cache_4





|













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
local str = {}
local string = string
local table = table
local s = {}
_G.fun = {}
str["效果牌的种类表"] = {
  TYPE_SPELL,
  TYPE_TRAP,
  TYPE_EFFECT,
}
str["无效果灵摆怪兽表"] = {
  28363749,
  19474136,
  17390179,
  83980492,
}
local h1
--~ 区域
h1 = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED
str["除牌组与额外牌组以外的区域"] = h1
h1 = h1 + LOCATION_DECK + LOCATION_EXTRA
str["所有区域"] = h1
--第一层-------------------------------
local cache_1
local cache_2
local cache_3
local cache_4
︙︙
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
      s["则"] = h1[u2]
    else
      s["则"] = h1[5]
      end
    s["Debug.ReloadFieldBegin"](u1, u2)
    end
  end
function s["开局洗卡抽卡"](u1)
  local h1, h2
  s["开局洗卡抽卡之数"] = u1
  --~ 效果
  h1 = Effect.GlobalEffect()
  h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  h1:SetCode(EVENT_ADJUST)
  h1:SetCondition(aux.TRUE)
  -- 随机抽卡
  --~ 调该效果的效果
  function h2(u2)
    Duel.ShuffleDeck(0)
    Duel.Draw(0, u1, REASON_RULE)
    u2:Reset()
    end
  h1:SetOperation(h2)







|

|





|







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
      s["则"] = h1[u2]
    else
      s["则"] = h1[5]
      end
    s["Debug.ReloadFieldBegin"](u1, u2)
    end
  end
function s["开局洗牌抽牌"](u1)
  local h1, h2
  s["开局洗牌抽牌之数"] = u1
  --~ 效果
  h1 = Effect.GlobalEffect()
  h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  h1:SetCode(EVENT_ADJUST)
  h1:SetCondition(aux.TRUE)
  -- 随机抽牌
  --~ 调该效果的效果
  function h2(u2)
    Duel.ShuffleDeck(0)
    Duel.Draw(0, u1, REASON_RULE)
    u2:Reset()
    end
  h1:SetOperation(h2)
︙︙
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
        end
      end
    h3:SetCondition(h4)
    h3:SetOperation(aux.NULL)
    Duel.RegisterEffect(h3, 0)
    end
  end
fun["一_是否效果卡"] = function(card)
  for i = 1, #str["效果卡的种类表"] do
    if Card.IsType(card, str["效果卡的种类表"][i]) then
      return true
    end
  end
  if Card.IsType(card, TYPE_PENDULUM) then
    for i = 1, #str["无效果灵摆怪兽表"] do
      if Card.IsCode(card, str["无效果灵摆怪兽表"][i]) then
      else
        return true
      end
    end
  end
end
function s["开局选卡入手"](u1)
  local h1, h2
  str["开局选卡入手之数"] = u1
  --~ 效果
  h1 = Effect.GlobalEffect()
  h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  h1:SetCode(EVENT_ADJUST)
  h1:SetCondition(aux.TRUE)
  --~ 调该效果的效果
  --~ 调该效果的玩家
  function h2(u2, u3)
    local h3
    --~ 玩家选定的卡
    h3 = Duel.SelectMatchingCard(u3, Card.IsAbleToHand, u3, LOCATION_DECK, 0, u1, u1, nil)
    Duel.SendtoHand(h3, nil, REASON_RULE)
    u2:Reset()
    end
  h1:SetOperation(h2)
  Duel.RegisterEffect(h1, 0)
  end







|
|
|












|

|









|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
        end
      end
    h3:SetCondition(h4)
    h3:SetOperation(aux.NULL)
    Duel.RegisterEffect(h3, 0)
    end
  end
fun["一_是否效果牌"] = function(card)
  for i = 1, #str["效果牌的种类表"] do
    if Card.IsType(card, str["效果牌的种类表"][i]) then
      return true
    end
  end
  if Card.IsType(card, TYPE_PENDULUM) then
    for i = 1, #str["无效果灵摆怪兽表"] do
      if Card.IsCode(card, str["无效果灵摆怪兽表"][i]) then
      else
        return true
      end
    end
  end
end
function s["开局选牌入手"](u1)
  local h1, h2
  str["开局选牌入手之数"] = u1
  --~ 效果
  h1 = Effect.GlobalEffect()
  h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  h1:SetCode(EVENT_ADJUST)
  h1:SetCondition(aux.TRUE)
  --~ 调该效果的效果
  --~ 调该效果的玩家
  function h2(u2, u3)
    local h3
    --~ 玩家选定的牌
    h3 = Duel.SelectMatchingCard(u3, Card.IsAbleToHand, u3, LOCATION_DECK, 0, u1, u1, nil)
    Duel.SendtoHand(h3, nil, REASON_RULE)
    u2:Reset()
    end
  h1:SetOperation(h2)
  Duel.RegisterEffect(h1, 0)
  end
︙︙
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
local cache_6
local cache_7
local cache_8
local cache_9
local _
do
  s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
  --~ 开局洗卡抽卡之数
  function _G.Debug.ReloadFieldEnd(u1)
    s["Debug.ReloadFieldEnd"]()
    if u1 then
      s["开局洗卡抽卡"](u1)
      end
    end
  end
fun["二_印卡"] = function(u1, u2, u3)
  u3 = u3 or u2
  Debug.ShowHint(
    "点击对方额外卡组可以进行印卡。\n手卡只能印 "
      .. u2
      .. " 张。\n最多可以印 "
      .. u3
      .. " 张"
  )
  str["效果"] = Effect.CreateEffect(u1)
  str["当前印卡数"] = 1
  str["效果"]:SetType(EFFECT_TYPE_IGNITION)
  str["效果"]:SetProperty(
    EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE
  )
  str["效果"]:SetTarget(fun["一_该效果不能被连锁"])
  str["效果"]:SetRange(LOCATION_EXTRA)
  function print_hand(effect_event, player_who_activate_the_effect)
    announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
    card = Duel.CreateToken(player_who_activate_the_effect, announce_card)
    if str["当前印卡数"] <= u2 then
      str["当前印卡数"] = str["当前印卡数"] + 1
      Duel.SendtoHand(card, nil, REASON_RULE)
    else
      if str["当前印卡数"] <= u3 then
        str["当前印卡数"] = str["当前印卡数"] + 1
        Duel.Remove(card, POS_FACEUP, REASON_RULE)
        Duel.SendtoDeck(card, player_who_activate_the_effect, 0, REASON_RULE)
      else
        Debug.ShowHint("印卡过多!")
        effect_event:Reset()
      end
    end
  end
  str["效果"]:SetOperation(print_hand)
  u1:RegisterEffect(str["效果"])
end
fun["二_开局说明"] = function()
  local h1
  str["这个残局的效果卡数量"] =
    Duel.GetMatchingGroupCount(fun["是否效果卡"], 0, str["所有区域"], str["所有区域"], nil)
  str["超量素材组"] = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
  for k in aux.Next(str["超量素材组"]) do
    if fun["一_是否效果卡"](k) then
      str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
      end
    end
  --~ 开局说明
  h1 = str["这个残局的效果卡数量"] .. "卡 " .. str["规则"]
  if str["不洗牌"] == 0 then
  else
    h1 = h1 .. "伪洗牌 "
    end
  if str["无BP"] == 0 then
    h1 = h1 .. "无BP "
    end
  if str["无AI"] == 0 then
    h1 = h1 .. "无AI "
    end
  if s["开局选卡入手之数"] then
    h1 = h1 .. "选" .. s["开局选卡入手之数"] .. "卡 "
    end
  if s["禁格之数"] then
    h1 = h1 .. "禁" .. s["禁格之数"] .. "格 "
    end
  if s["开局洗卡抽卡之数"] then
    h1 = h1 .. "抽" .. s["开局洗卡抽卡之数"] .. "卡 "
    end
  Debug.ShowHint(h1)
  end
do
  s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
  --~ 开局选卡入手之数
  --~ 禁格之数
  function _G.aux.BeginPuzzle(u1, u2)
    s["aux.BeginPuzzle"]()
    if u1 then
      s["开局选卡入手"](u1)
      end
    if u2 then
      s["禁格"](u2)
      end
    fun["二_开局说明"]()
    s["通关之邀"]()
    end
  end
--兼容层-------------------------------
fun["印卡"] = fun["二_印卡"]
fun["开局添加手卡"] = s["开局选卡入手"]
fun["是否效果卡"] = fun["一_是否效果卡"]
fun["禁格"] = s["禁格"]
fun["随机抽卡"] = s["开局洗卡抽卡"]







|



|



|


|






|









|
|


|
|



|









|
|


|
|



|










|
|




|
|





|




|









|
|
|

|
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
local cache_6
local cache_7
local cache_8
local cache_9
local _
do
  s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
  --~ 开局洗牌抽牌之数
  function _G.Debug.ReloadFieldEnd(u1)
    s["Debug.ReloadFieldEnd"]()
    if u1 then
      s["开局洗牌抽牌"](u1)
      end
    end
  end
fun["二_印牌"] = function(u1, u2, u3)
  u3 = u3 or u2
  Debug.ShowHint(
    "点击对方额外牌组可以进行印牌。\n手牌只能印 "
      .. u2
      .. " 张。\n最多可以印 "
      .. u3
      .. " 张"
  )
  str["效果"] = Effect.CreateEffect(u1)
  str["当前印牌数"] = 1
  str["效果"]:SetType(EFFECT_TYPE_IGNITION)
  str["效果"]:SetProperty(
    EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE
  )
  str["效果"]:SetTarget(fun["一_该效果不能被连锁"])
  str["效果"]:SetRange(LOCATION_EXTRA)
  function print_hand(effect_event, player_who_activate_the_effect)
    announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
    card = Duel.CreateToken(player_who_activate_the_effect, announce_card)
    if str["当前印牌数"] <= u2 then
      str["当前印牌数"] = str["当前印牌数"] + 1
      Duel.SendtoHand(card, nil, REASON_RULE)
    else
      if str["当前印牌数"] <= u3 then
        str["当前印牌数"] = str["当前印牌数"] + 1
        Duel.Remove(card, POS_FACEUP, REASON_RULE)
        Duel.SendtoDeck(card, player_who_activate_the_effect, 0, REASON_RULE)
      else
        Debug.ShowHint("印牌过多!")
        effect_event:Reset()
      end
    end
  end
  str["效果"]:SetOperation(print_hand)
  u1:RegisterEffect(str["效果"])
end
fun["二_开局说明"] = function()
  local h1
  str["这个残局的效果牌数量"] =
    Duel.GetMatchingGroupCount(fun["是否效果牌"], 0, str["所有区域"], str["所有区域"], nil)
  str["超量素材组"] = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
  for k in aux.Next(str["超量素材组"]) do
    if fun["一_是否效果牌"](k) then
      str["这个残局的效果牌数量"] = str["这个残局的效果牌数量"] + 1
      end
    end
  --~ 开局说明
  h1 = str["这个残局的效果牌数量"] .. "牌 " .. str["规则"]
  if str["不洗牌"] == 0 then
  else
    h1 = h1 .. "伪洗牌 "
    end
  if str["无BP"] == 0 then
    h1 = h1 .. "无BP "
    end
  if str["无AI"] == 0 then
    h1 = h1 .. "无AI "
    end
  if s["开局选牌入手之数"] then
    h1 = h1 .. "选" .. s["开局选牌入手之数"] .. "牌 "
    end
  if s["禁格之数"] then
    h1 = h1 .. "禁" .. s["禁格之数"] .. "格 "
    end
  if s["开局洗牌抽牌之数"] then
    h1 = h1 .. "抽" .. s["开局洗牌抽牌之数"] .. "牌 "
    end
  Debug.ShowHint(h1)
  end
do
  s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
  --~ 开局选牌入手之数
  --~ 禁格之数
  function _G.aux.BeginPuzzle(u1, u2)
    s["aux.BeginPuzzle"]()
    if u1 then
      s["开局选牌入手"](u1)
      end
    if u2 then
      s["禁格"](u2)
      end
    fun["二_开局说明"]()
    s["通关之邀"]()
    end
  end
--兼容层-------------------------------
fun["印牌"] = fun["二_印牌"]
fun["开局添加手牌"] = s["开局选牌入手"]
fun["是否效果牌"] = fun["一_是否效果牌"]
fun["禁格"] = s["禁格"]
fun["随机抽牌"] = s["开局洗牌抽牌"]