Lines of
script/c0.lua
from check-in 701420df8f
that are changed by the sequence of edits moving toward
check-in ba05430172:
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: d["排_效果卡的类型"] = {
11: TYPE_SPELL,
12: TYPE_TRAP,
13: TYPE_EFFECT,
14: }
15: d["排_非效果灵摆怪兽的卡编"] = {
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: f["不被连锁"] = function()
46: Duel.SetChainLimit(aux.FALSE)
47: return true
48: end
49: d["是否有效果卡"] = function(card)
50: for i = 1, #d["排_非效果灵摆怪兽的卡编"] do
51: if Card.IsCode(card, d["排_非效果灵摆怪兽的卡编"][i]) then
52: return false
53: end
54: end
55: return true
56: end
57: do
58: local h1
59: --~ “调该效果”的效果
60: --~ “调该效果”的玩家
61: s["_开局选卡入手"] = function(u1, u2)
62: local h2
63: --~ 玩家选定的卡
64: h2 = Duel.SelectMatchingCard(u2, Card.IsAbleToHand, u2, LOCATION_DECK, 0, h1, h1, nil)
65: Duel.SendtoHand(h2, nil, REASON_RULE)
66: u1:Reset()
67: end
68: s["开局选卡入手"] = function(u1)
69: local h2
70: s["「开局选卡入手」之量"] = u1
71: --~ 「开局选卡入手」之量
72: h1 = u1
73: --~ 效果
74: h2 = Effect.GlobalEffect()
75: h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
76: h2:SetCode(EVENT_ADJUST)
77: h2:SetCondition(aux.TRUE)
78: h2:SetOperation(s["_开局选卡入手"])
79: Duel.RegisterEffect(h2, 0)
80: end
81: end
82: --~ 禁几个怪兽格
83: f["禁格"] = function(o1)
84: local k1
85: d["禁几个怪兽格"] = o1
86: --~ 效果
87: k1 = Effect.GlobalEffect()
88: k1:SetCode(EFFECT_USE_EXTRA_MZONE)
89: k1:SetValue(k1)
90: Duel.RegisterEffect(k1, 0)
91: end
92: do
93: local k1, k2, k3, k4
94: --~ 印卡过多时的提示
95: k1 = "印卡过多"
96: --~ 现在的印卡数量
97: k2 = 1
98: --~ 手卡印卡数量的上限
99: k3 = 0
100: --~ 印卡总数量的上限
101: k4 = 0
102: --~ 所调用这个效果的效果
103: --~ 所调用这个效果的玩家
104: f["_印卡"] = function(o1, o2)
105: local k5, k6
106: --~ 要印之卡的卡编
107: k5 = Duel.AnnounceCard(o2)
108: --~ 卡
109: k6 = Duel.CreateToken(o2, k5)
110: if k2 <= k3 then
111: k2 = k2 + 1
112: Duel.SendtoHand(k6, nil, REASON_RULE)
113: else
114: if k2 <= k4 then
115: k2 = k2 + 1
116: Duel.SendtoDeck(k6, o2, 0, REASON_RULE)
117: else
118: Debug.ShowHint(k1)
119: o1:Reset()
120: end
121: end
122: end
123: --~ 印卡的启动源
124: --~ 手卡印卡数量的上限
125: --~ 印卡总数量的上限
126: f["印卡"] = function(o1, o2, o3)
127: local k5
128: k3 = o2
129: k4 = o3 or o2
130: Debug.ShowHint("点对方额外卡组,可印卡\n只能印手卡 " .. k3 .. " 张\n最多可印 " .. k4 .. " 张")
131: k5 = Effect.CreateEffect(o1)
132: k5:SetType(EFFECT_TYPE_IGNITION)
133: k5:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
134: k5:SetTarget(f["不被连锁"])
135: k5:SetRange(LOCATION_EXTRA)
136: k5:SetOperation(f["_印卡"])
137: o1:RegisterEffect(k5)
138: end
139: end
701420df8f 2024-06-27 140: s["开局示"] = function()
141: local h1, h2, h3
142: --~ 此局效卡之数
143: h2 = Duel.GetMatchingGroupCount(d["是否有效果卡"], 0, s["全区"], s["全区"], nil)
144: --~ 超量材组
145: h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
146: for u1 in aux.Next(h3) do
147: if d["是否有效果卡"](u1) then
148: h2 = h2 + 1
149: end
150: end
151: --~ 开局说明
152: h1 = h2 .. "卡 " .. s["则"]
153: if s["伪洗卡"] == 0 then
154: else
155: h1 = h1 .. "伪洗卡 "
156: end
157: if s["战段"] == 0 then
158: h1 = h1 .. "无战段 "
159: end
160: if s["机智"] == 0 then
161: h1 = h1 .. "无机智 "
162: end
163: if s["「开局选卡入手」之量"] then
164: h1 = h1 .. "选" .. s["「开局选卡入手」之量"] .. "卡 "
165: end
166: if s["「禁主怪格」之量"] then
167: h1 = h1 .. "禁" .. s["「禁主怪格」之量"] .. "怪格 "
168: end
169: if s["「禁魔陷格」之量"] then
170: h1 = h1 .. "禁" .. s["「禁魔陷格」之量"] .. "魔格 "
171: end
172: Debug.ShowHint(h1)
173: end
174: do
175: s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
176: --~ 「开局选卡入手」之量
177: --~ 传入对方额外卡组最上面表侧卡,并将其作为印卡源
178: --~ 能印手卡几张
179: --~ 最多能印卡几张
180: function _G.aux.BeginPuzzle(o1, o2, o3, o4, o5)
181: s["aux.BeginPuzzle"]()
182: if o1 then
183: s["开局选卡入手"](o1)
184: else
185: end
186: if o2 then
187: f["禁格"](o2)
188: else
189: end
190: if o3 then
191: s["印卡"](o3, o4, o5)
192: else
193: end
701420df8f 2024-06-27 194: s["开局示"]()
195: end
196: end