Lines of
script/c0.lua
from check-in 0dd37b287e
that are changed by the sequence of edits moving toward
check-in 6bc844fccc:
1: local str = {}
2: local string = string
3: local table = table
4: _G.fun = {}
5: str["效果卡的种类表"] = {
6: TYPE_SPELL,
7: TYPE_TRAP,
8: TYPE_EFFECT,
9: }
10: str["无效果灵摆怪兽表"] = {
11: 28363749,
12: 19474136,
13: 17390179,
14: 83980492,
15: }
16: local h1
17: --~ 区域
18: h1 = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED
19: str["除卡组与额外卡组以外的区域"] = h1
20: h1 = h1 + LOCATION_DECK + LOCATION_EXTRA
21: str["所有区域"] = h1
22: --第一层-------------------------------
23: local cache_1
24: local cache_2
25: local cache_3
26: local cache_4
27: local cache_5
28: local cache_6
29: local cache_7
30: local cache_8
31: local cache_9
32: local _
33: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
34: Debug.ReloadFieldBegin = function(u1, u2)
35: str["不洗牌"] = u1 & DUEL_PSEUDO_SHUFFLE
36: str["无BP"] = u1 & DUEL_ATTACK_FIRST_TURN
37: str["无AI"] = u1 & DUEL_SIMPLE_AI
38: str["规则表"] = {
39: [3] = "大师3 ",
40: [4] = "新大师 ",
41: [5] = "大师2020 ",
42: }
43: if u2 then
44: str["规则"] = str["规则表"][u2]
45: else
46: str["规则"] = str["规则表"][5]
47: end
48: fun["Debug.ReloadFieldBegin"](u1, u2)
49: end
50: fun["一_随机抽卡"] = function(u1)
51: local h1, h2
52: str["随机抽卡的数量"] = u1
53: --~ 效果
54: h1 = Effect.GlobalEffect()
55: h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
56: h1:SetCode(EVENT_ADJUST)
57: h1:SetCondition(aux.TRUE)
58: -- 随机抽卡
59: --~ 调该效果的效果
60: function h2(u2)
61: Duel.ShuffleDeck(0)
62: Duel.Draw(0, u1, REASON_RULE)
63: u2:Reset()
64: end
65: h1:SetOperation(h2)
66: Duel.RegisterEffect(h1, 0)
67: end
68: fun["一_该效果不能被连锁"] = function()
69: Duel.SetChainLimit(aux.FALSE)
70: return true
71: end
72: do
73: local h1, h2
74: --~ 原解邀请
75: h1 = "残局群181175613"
76: --~ 二解邀请,备用:圣魔术师
77: h2 = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
0dd37b287e 2024-02-13 78: fun["一_通关邀请"] = function()
79: local h3, h4
80: --~ 效果
81: h3 = Effect.GlobalEffect()
82: h3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
83: h3:SetCode(EVENT_DAMAGE)
84: --~ 通关之邀
85: function h4()
86: local h5
87: --~ 对方之血
88: h5 = Duel.GetLP(1)
89: if h5 <= 0 then
90: if h5 == 0 then
91: Debug.ShowHint(h1)
92: else
93: Debug.ShowHint(h2)
94: end
95: else
96: return false
97: end
98: end
99: h3:SetCondition(h4)
100: h3:SetOperation(aux.NULL)
101: Duel.RegisterEffect(h3, 0)
102: end
103: end
104: fun["一_是否效果卡"] = function(card)
105: for i = 1, #str["效果卡的种类表"] do
106: if Card.IsType(card, str["效果卡的种类表"][i]) then
107: return true
108: end
109: end
110: if Card.IsType(card, TYPE_PENDULUM) then
111: for i = 1, #str["无效果灵摆怪兽表"] do
112: if Card.IsCode(card, str["无效果灵摆怪兽表"][i]) then
113: else
114: return true
115: end
116: end
117: end
118: end
119: fun["一_开局添加手卡"] = function(u1)
120: str["开局添加手卡"] = true
121: str["开局添加手卡的数量"] = u1
122: str["效果"] = Effect.GlobalEffect()
123: str["效果"]:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
124: str["效果"]:SetCode(EVENT_ADJUST)
125: str["效果"]:SetCondition(aux.TRUE)
126: function cache_1(effect_event, player_who_activate_the_effect)
127: str["玩家选定的卡"] = Duel.SelectMatchingCard(
128: player_who_activate_the_effect,
129: Card.IsAbleToHand,
130: player_who_activate_the_effect,
131: LOCATION_DECK,
132: 0,
133: u1,
134: u1,
135: nil
136: )
137: Duel.SendtoHand(str["玩家选定的卡"], nil, REASON_RULE)
138: effect_event:Reset()
139: end
140: str["效果"]:SetOperation(cache_1)
141: Duel.RegisterEffect(str["效果"], 0)
142: end
143: fun["一_禁格"] = function(u1)
144: local h1
145: str["禁格"] = true
146: str["禁格的数量"] = u1
147: --~ 效果
148: h1 = Effect.GlobalEffect()
149: h1:SetCode(EFFECT_USE_EXTRA_MZONE)
150: h1:SetValue(u1)
151: Duel.RegisterEffect(h1, 0)
152: end
153: --第二层-------------------------------
154: local cache_1
155: local cache_2
156: local cache_3
157: local cache_4
158: local cache_5
159: local cache_6
160: local cache_7
161: local cache_8
162: local cache_9
163: local _
164: fun["Debug.ReloadFieldEnd"] = Debug.ReloadFieldEnd
165: Debug.ReloadFieldEnd = function(u1)
166: fun["Debug.ReloadFieldEnd"]()
167: if u1 then
168: fun["一_随机抽卡"](u1)
169: end
170: end
171: fun["二_印卡"] = function(u1, u2, u3)
172: u3 = u3 or u2
173: Debug.ShowHint(
174: "点击对方额外卡组可以进行印卡。\n手卡只能印 "
175: .. u2
176: .. " 张。\n最多可以印 "
177: .. u3
178: .. " 张"
179: )
180: str["效果"] = Effect.CreateEffect(u1)
181: str["当前印卡数"] = 1
182: str["效果"]:SetType(EFFECT_TYPE_IGNITION)
183: str["效果"]:SetProperty(
184: EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE
185: )
186: str["效果"]:SetTarget(fun["一_该效果不能被连锁"])
187: str["效果"]:SetRange(LOCATION_EXTRA)
188: function print_hand(effect_event, player_who_activate_the_effect)
189: announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
190: card = Duel.CreateToken(player_who_activate_the_effect, announce_card)
191: if str["当前印卡数"] <= u2 then
192: str["当前印卡数"] = str["当前印卡数"] + 1
193: Duel.SendtoHand(card, nil, REASON_RULE)
194: else
195: if str["当前印卡数"] <= u3 then
196: str["当前印卡数"] = str["当前印卡数"] + 1
197: Duel.Remove(card, POS_FACEUP, REASON_RULE)
198: Duel.SendtoDeck(card, player_who_activate_the_effect, 0, REASON_RULE)
199: else
200: Debug.ShowHint("印卡过多!")
201: effect_event:Reset()
202: end
203: end
204: end
205: str["效果"]:SetOperation(print_hand)
206: u1:RegisterEffect(str["效果"])
207: end
208: fun["二_开局说明"] = function()
209: str["这个残局的效果卡数量"] =
210: Duel.GetMatchingGroupCount(fun["是否效果卡"], 0, str["所有区域"], str["所有区域"], nil)
211: str["超量素材组"] = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
212: for k in aux.Next(str["超量素材组"]) do
213: if fun["一_是否效果卡"](k) then
214: str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
215: end
216: end
217: str["开局说明"] = str["这个残局的效果卡数量"] .. "卡 " .. str["规则"]
218: if str["不洗牌"] == 0 then
219: else
220: str["开局说明"] = str["开局说明"] .. "伪洗牌 "
221: end
222: if str["无BP"] == 0 then
223: str["开局说明"] = str["开局说明"] .. "无BP "
224: end
225: if str["无AI"] == 0 then
226: str["开局说明"] = str["开局说明"] .. "无AI "
227: end
228: if str["开局添加手卡"] then
229: str["开局说明"] = str["开局说明"] .. "选" .. str["开局添加手卡的数量"] .. "卡 "
230: end
231: if str["禁格"] then
232: str["开局说明"] = str["开局说明"] .. "禁" .. str["禁格的数量"] .. "格 "
233: end
234: if str["随机抽卡的数量"] then
235: str["开局说明"] = str["开局说明"] .. "抽" .. str["随机抽卡的数量"] .. "卡 "
236: end
237: Debug.ShowHint(str["开局说明"])
238: end
239: fun["aux.BeginPuzzle"] = aux.BeginPuzzle
240: aux.BeginPuzzle = function(u1, u2)
241: fun["aux.BeginPuzzle"]()
242: if u1 then
243: fun["一_开局添加手卡"](u1)
244: end
245: if u2 then
246: fun["一_禁格"](u2)
247: end
248: fun["二_开局说明"]()
0dd37b287e 2024-02-13 249: fun["一_通关邀请"]()
250: end
251: --兼容层-------------------------------
252: fun["印卡"] = fun["二_印卡"]
253: fun["开局添加手卡"] = fun["一_开局添加手卡"]
254: fun["是否效果卡"] = fun["一_是否效果卡"]
255: fun["禁格"] = fun["一_禁格"]
256: fun["随机抽卡"] = fun["一_随机抽卡"]