Lines of
script/c0.lua
from check-in 511cb54144
that are changed by the sequence of edits moving toward
check-in 5990d10d96:
1: local string = string
2: local table = table
3: local Debug = Debug
4: local Effect = Effect
5: local Duel = Duel
6: local Card = Card
7: local d = {}
8: local f = {}
9: local s = {}
10: s["效卡之类排"] = {
11: TYPE_SPELL,
12: TYPE_TRAP,
13: TYPE_EFFECT,
14: }
15: s["无效灵摆怪兽之卡编排"] = {
16: 28363749,
17: 19474136,
18: 17390179,
19: 83980492,
20: }
21: s["全区"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA
22: do
23: local h1
24: --~ 则对
25: h1 = {
26: [3] = "大师规则 ",
27: [4] = "新大师规则(2017) ",
28: [5] = "大师规则(2020) ",
29: }
30: s["Debug.ReloadFieldBegin"] = _G.Debug.ReloadFieldBegin
31: --~ 模
32: --~ 则数
33: function _G.Debug.ReloadFieldBegin(u1, u2)
34: s["伪洗卡"] = u1 & DUEL_PSEUDO_SHUFFLE
35: s["战段"] = u1 & DUEL_ATTACK_FIRST_TURN
36: s["机智"] = u1 & DUEL_SIMPLE_AI
37: if u2 then
38: s["则"] = h1[u2]
39: else
40: s["则"] = h1[5]
41: end
42: s["Debug.ReloadFieldBegin"](u1, u2)
43: end
44: end
45: s["不被连锁"] = function()
46: Duel.SetChainLimit(aux.FALSE)
47: return true
48: end
49: s["是否效卡"] = function(card)
50: for i = 1, #s["效卡之类排"] do
51: if Card.IsType(card, s["效卡之类排"][i]) then
52: return true
53: end
54: end
55: if Card.IsType(card, TYPE_PENDULUM) then
56: for i = 1, #s["无效灵摆怪兽之卡编排"] do
57: if Card.IsCode(card, s["无效灵摆怪兽之卡编排"][i]) then
58: return false
59: else
60: end
61: end
62: return true
63: end
64: end
65: do
66: local h1
67: --~ “调该效果”的效果
68: --~ “调该效果”的玩家
69: s["_开局选卡入手"] = function(u1, u2)
70: local h2
71: --~ 玩家选定的卡
72: h2 = Duel.SelectMatchingCard(u2, Card.IsAbleToHand, u2, LOCATION_DECK, 0, h1, h1, nil)
73: Duel.SendtoHand(h2, nil, REASON_RULE)
74: u1:Reset()
75: end
76: s["开局选卡入手"] = function(u1)
77: local h2
78: s["「开局选卡入手」之量"] = u1
79: --~ 「开局选卡入手」之量
80: h1 = u1
81: --~ 效果
82: h2 = Effect.GlobalEffect()
83: h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
84: h2:SetCode(EVENT_ADJUST)
85: h2:SetCondition(aux.TRUE)
86: h2:SetOperation(s["_开局选卡入手"])
87: Duel.RegisterEffect(h2, 0)
88: end
89: end
90: --~ 「禁主怪格」之几个
91: s["「禁主怪格」之几个"] = function(u1)
92: local h1
93: s["「禁主怪格」之量"] = u1
94: --~ 效果
95: h1 = Effect.GlobalEffect()
96: h1:SetCode(EFFECT_USE_EXTRA_MZONE)
97: h1:SetValue(u1)
98: Duel.RegisterEffect(h1, 0)
99: end
100: do
101: s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
102: --~ 「禁主怪格」之几个
103: function _G.Debug.ReloadFieldEnd(u1)
104: s["Debug.ReloadFieldEnd"]()
105: if u1 then
106: s["「禁主怪格」之几个"](u1)
107: end
108: end
109: end
110: do
111: local h1, h2, h3, h4
112: --~ 印卡过多之示
113: h1 = "印卡过多"
114: --~ 现之印卡数
115: h2 = 1
116: --~ 印手卡之上限
117: h3 = 0
118: --~ 总印卡之上限
119: h4 = 0
120: --~ 「调该效果」的效果
121: --~ 「调该效果」的玩家
122: s["_印卡"] = function(u1, u2)
123: local h5, h6
124: --~ 印卡之卡编
125: h5 = Duel.AnnounceCard(u2)
126: --~ 卡
127: h6 = Duel.CreateToken(u2, h5)
128: if h2 <= h3 then
129: h2 = h2 + 1
130: Duel.SendtoHand(h6, nil, REASON_RULE)
131: else
132: if h2 <= h4 then
133: h2 = h2 + 1
134: Duel.SendtoDeck(h6, u2, 0, REASON_RULE)
135: else
136: Debug.ShowHint(h1)
137: u1:Reset()
138: end
139: end
140: end
141: s["印卡"] = function(u1, u2, u3)
142: local h5, h6
143: h3 = u2
144: h4 = u3 or u2
145: Debug.ShowHint("点对方额外卡组,可印卡\n只能印手卡" .. h3 .. "张\n最多可印" .. h4 .. "张")
146: h5 = Effect.CreateEffect(u1)
147: h5:SetType(EFFECT_TYPE_IGNITION)
148: h5:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
149: h5:SetTarget(s["不被连锁"])
150: h5:SetRange(LOCATION_EXTRA)
151: h5:SetOperation(s["_印卡"])
152: u1:RegisterEffect(h5)
153: end
154: end
155: s["开局示"] = function()
156: local h1, h2, h3
157: --~ 此局效卡之数
158: h2 = Duel.GetMatchingGroupCount(s["是否效卡"], 0, s["全区"], s["全区"], nil)
159: --~ 超量材组
160: h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
161: for u1 in aux.Next(h3) do
162: if s["是否效卡"](u1) then
163: h2 = h2 + 1
164: end
165: end
166: --~ 开局说明
167: h1 = h2 .. "卡 " .. s["则"]
168: if s["伪洗卡"] == 0 then
169: else
170: h1 = h1 .. "伪洗卡 "
171: end
172: if s["战段"] == 0 then
173: h1 = h1 .. "无战段 "
174: end
175: if s["机智"] == 0 then
176: h1 = h1 .. "无机智 "
177: end
178: if s["「开局选卡入手」之量"] then
179: h1 = h1 .. "选" .. s["「开局选卡入手」之量"] .. "卡 "
180: end
181: if s["「禁主怪格」之量"] then
182: h1 = h1 .. "禁" .. s["「禁主怪格」之量"] .. "怪格 "
183: end
184: if s["「禁魔陷格」之量"] then
185: h1 = h1 .. "禁" .. s["「禁魔陷格」之量"] .. "魔格 "
186: end
187: Debug.ShowHint(h1)
188: end
189: do
190: s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
191: --~ 「开局选卡入手」之量
192: --~ 传入对方额外卡组最上面表侧卡,并将其作为印卡源
193: --~ 能印手卡几张
194: --~ 最多能印卡几张
511cb54144 2024-06-27 195: function _G.aux.BeginPuzzle(u1, u2, u3, u4)
196: s["aux.BeginPuzzle"]()
511cb54144 2024-06-27 197: if u1 then
511cb54144 2024-06-27 198: s["开局选卡入手"](u1)
199: end
511cb54144 2024-06-27 200: if u2 then
511cb54144 2024-06-27 201: s["印卡"](u2, u3, u4)
202: else
203: end
204: s["开局示"]()
205: end
206: end