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