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