Lines of
script/c0.lua
from check-in 674765ddf2
that are changed by the sequence of edits moving toward
check-in 46bd1a8cd5:
1: local str = {}
2: local math = math
3: local string = string
4: local table = table
5: _G.fun = {}
6: ---------------------------------
7: local cache_1
8: local cache_2
9: local cache_3
10: local cache_4
11: local cache_5
12: local cache_6
13: local cache_7
14: local cache_8
15: local cache_9
16: local _
17: str["效果卡的种类表"] = {
18: TYPE_SPELL,
19: TYPE_TRAP,
20: TYPE_EFFECT,
21: }
22: str["无效果灵摆怪兽表"] = {
23: 28363749,
24: 19474136,
25: 17390179,
26: 83980492,
27: }
28: cache_1 = 0
29: cache_1 = cache_1 + LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED
30: str["除卡组与额外卡组以外的区域"] = cache_1
31: cache_1 = cache_1 + LOCATION_DECK + LOCATION_EXTRA
32: str["所有区域"] = cache_1
33: --第一层-------------------------------
34: local cache_1
35: local cache_2
36: local cache_3
37: local cache_4
38: local cache_5
39: local cache_6
40: local cache_7
41: local cache_8
42: local cache_9
43: local _
44: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
674765ddf2 2024-02-13 45: Debug.ReloadFieldBegin = function(str_1, str_2) --{
46: str["不洗牌"] = str_1 & DUEL_PSEUDO_SHUFFLE
47: str["无BP"] = str_1 & DUEL_ATTACK_FIRST_TURN
48: str["无AI"] = str_1 & DUEL_SIMPLE_AI
49: str["规则表"] = {
50: [3] = "大师3 ",
51: [4] = "新大师 ",
52: [5] = "大师2020 ",
53: }
674765ddf2 2024-02-13 54: if str_2 then --{
55: str["规则"] = str["规则表"][str_2]
674765ddf2 2024-02-13 56: --}
674765ddf2 2024-02-13 57: else --{
58: str["规则"] = str["规则表"][5]
674765ddf2 2024-02-13 59: end --}
60: fun["Debug.ReloadFieldBegin"](str_1, str_2)
674765ddf2 2024-02-13 61: end --}
674765ddf2 2024-02-13 62: fun["一_随机抽卡"] = function(str_1) --{
63: str["随机抽卡的数量"] = str_1
64: str["效果"] = Effect.GlobalEffect()
65: str["效果"]:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
66: str["效果"]:SetCode(EVENT_ADJUST)
67: str["效果"]:SetCondition(aux.TRUE)
674765ddf2 2024-02-13 68: function cache_1(effect_event, player_who_activate_the_effect) --{
69: Duel.ShuffleDeck(0)
70: Duel.Draw(0, str_1, REASON_RULE)
71: effect_event:Reset()
674765ddf2 2024-02-13 72: end --}
674765ddf2 2024-02-13 73: str["效果"]:SetOperation(cache_1)
674765ddf2 2024-02-13 74: Duel.RegisterEffect(str["效果"], 0)
674765ddf2 2024-02-13 75: end --}
674765ddf2 2024-02-13 76: fun["一_失败得分"] = function() --{
674765ddf2 2024-02-13 77: str["失败得分表"] = {
674765ddf2 2024-02-13 78: [0] = "神龙之圣刻印",
674765ddf2 2024-02-13 79: [100] = "调和支援士",
674765ddf2 2024-02-13 80: [200] = "深渊的暗杀者",
674765ddf2 2024-02-13 81: [300] = "救援猫",
674765ddf2 2024-02-13 82: [400] = "注射天使 莉莉",
674765ddf2 2024-02-13 83: [500] = "不知火的隐者",
674765ddf2 2024-02-13 84: [600] = "影依猎鹰",
674765ddf2 2024-02-13 85: [700] = "铁兽战线 姬特",
674765ddf2 2024-02-13 86: [800] = "召唤僧",
674765ddf2 2024-02-13 87: [900] = "恩底弥翁的仆从",
674765ddf2 2024-02-13 88: [1000] = "机壳工具 丑恶",
674765ddf2 2024-02-13 89: [1100] = "欧尼斯特",
674765ddf2 2024-02-13 90: [1200] = "次元吸引者",
674765ddf2 2024-02-13 91: [1300] = "黑羽-疾风之盖尔",
674765ddf2 2024-02-13 92: [1400] = "加农炮兵",
674765ddf2 2024-02-13 93: [1500] = "教导的大神祗官",
674765ddf2 2024-02-13 94: [1600] = "地中族导师",
674765ddf2 2024-02-13 95: [1700] = "相剑师-莫邪",
674765ddf2 2024-02-13 96: [1800] = "宝玉兽-青玉飞马",
674765ddf2 2024-02-13 97: [1900] = "命运英雄 血魔-D",
674765ddf2 2024-02-13 98: [2000] = "流离的狮鹫骑手",
674765ddf2 2024-02-13 99: [2100] = "电子龙",
674765ddf2 2024-02-13 100: [2200] = "古遗物-死镰",
674765ddf2 2024-02-13 101: [2300] = "能朋克 调狐",
674765ddf2 2024-02-13 102: [2400] = "俱舍怒威族·芬里尔狼",
674765ddf2 2024-02-13 103: [2500] = "黑魔术师",
674765ddf2 2024-02-13 104: [2600] = "雅典娜",
674765ddf2 2024-02-13 105: [2700] = "暗黑界的龙神 格拉法",
674765ddf2 2024-02-13 106: [2800] = "魔导兽 刻耳柏洛斯尊主",
674765ddf2 2024-02-13 107: [2900] = "元素英雄 永生侠",
674765ddf2 2024-02-13 108: [3000] = "青眼白龙",
674765ddf2 2024-02-13 109: }
674765ddf2 2024-02-13 110: str["对方玩家的初始生命值"] = Duel.GetLP(1)
674765ddf2 2024-02-13 111: str["效果"] = Effect.GlobalEffect()
674765ddf2 2024-02-13 112: str["效果"]:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
674765ddf2 2024-02-13 113: str["效果"]:SetCode(EVENT_PHASE_START + PHASE_END)
674765ddf2 2024-02-13 114: function cache_1(effect_event, player_who_activate_the_effect) --{
674765ddf2 2024-02-13 115: cache_1 = Duel.GetLP(1) - str["对方玩家的初始生命值"]
674765ddf2 2024-02-13 116: if cache_1 > 0 then --{
674765ddf2 2024-02-13 117: return
674765ddf2 2024-02-13 118: --}
674765ddf2 2024-02-13 119: else --{
674765ddf2 2024-02-13 120: cache_1 = math.abs(cache_1) / (str["对方玩家的初始生命值"] - 100)
674765ddf2 2024-02-13 121: cache_1 = math.tointeger(cache_1 * 3000 // 100 * 100)
674765ddf2 2024-02-13 122: end --}
674765ddf2 2024-02-13 123: if cache_1 > 3000 then --{
674765ddf2 2024-02-13 124: --}
674765ddf2 2024-02-13 125: else --{
674765ddf2 2024-02-13 126: Debug.ShowHint(
674765ddf2 2024-02-13 127: "这局,您的得分是 "
674765ddf2 2024-02-13 128: .. cache_1
674765ddf2 2024-02-13 129: .. " 分!\n处于「"
674765ddf2 2024-02-13 130: .. str["失败得分表"][cache_1]
674765ddf2 2024-02-13 131: .. "」级别!"
674765ddf2 2024-02-13 132: )
674765ddf2 2024-02-13 133: end --}
674765ddf2 2024-02-13 134: effect_event:Reset()
674765ddf2 2024-02-13 135: end --}
136: str["效果"]:SetOperation(cache_1)
137: Duel.RegisterEffect(str["效果"], 0)
674765ddf2 2024-02-13 138: end --}
674765ddf2 2024-02-13 139: fun["一_该效果不能被连锁"] = function() --{
140: Duel.SetChainLimit(aux.FALSE)
141: return true
674765ddf2 2024-02-13 142: end --}
674765ddf2 2024-02-13 143: fun["一_通关邀请"] = function() --{
144: --备用:圣魔术师
145: str["原解邀请"] = "残局群181175613"
146: str["二解邀请"] = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
147: str["效果"] = Effect.GlobalEffect()
148: str["效果"]:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
149: str["效果"]:SetCode(EVENT_DAMAGE)
674765ddf2 2024-02-13 150: function cache_1() --{
151: cache_1 = Duel.GetLP(1)
674765ddf2 2024-02-13 152: if cache_1 <= 0 then --{
674765ddf2 2024-02-13 153: if cache_1 == 0 then --{
674765ddf2 2024-02-13 154: --}
674765ddf2 2024-02-13 155: else --{
156: Debug.ShowHint(str["二解邀请"])
674765ddf2 2024-02-13 157: end --}
158: Debug.ShowHint(str["原解邀请"])
674765ddf2 2024-02-13 159: --}
674765ddf2 2024-02-13 160: else --{
161: return false
674765ddf2 2024-02-13 162: end --}
674765ddf2 2024-02-13 163: end --}
164: str["效果"]:SetCondition(cache_1)
165: str["效果"]:SetOperation(aux.NULL)
166: Duel.RegisterEffect(str["效果"], 0)
674765ddf2 2024-02-13 167: end --}
674765ddf2 2024-02-13 168: fun["一_是否效果卡"] = function(card) --{
674765ddf2 2024-02-13 169: for i = 1, #str["效果卡的种类表"] do --{
674765ddf2 2024-02-13 170: if Card.IsType(card, str["效果卡的种类表"][i]) then --{
674765ddf2 2024-02-13 171: return true
674765ddf2 2024-02-13 172: end --}
674765ddf2 2024-02-13 173: end --}
674765ddf2 2024-02-13 174: if Card.IsType(card, TYPE_PENDULUM) then --{
674765ddf2 2024-02-13 175: for i = 1, #str["无效果灵摆怪兽表"] do --{
674765ddf2 2024-02-13 176: if Card.IsCode(card, str["无效果灵摆怪兽表"][i]) then --{
674765ddf2 2024-02-13 177: --}
674765ddf2 2024-02-13 178: else --{
674765ddf2 2024-02-13 179: return true
674765ddf2 2024-02-13 180: end --}
674765ddf2 2024-02-13 181: end --}
674765ddf2 2024-02-13 182: end --}
674765ddf2 2024-02-13 183: return false
674765ddf2 2024-02-13 184: end --}
674765ddf2 2024-02-13 185: fun["一_开局添加手卡"] = function(str_1) --{
186: str["开局添加手卡"] = true
187: str["开局添加手卡的数量"] = str_1
188: str["效果"] = Effect.GlobalEffect()
189: str["效果"]:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
190: str["效果"]:SetCode(EVENT_ADJUST)
191: str["效果"]:SetCondition(aux.TRUE)
674765ddf2 2024-02-13 192: function cache_1(effect_event, player_who_activate_the_effect) --{
193: str["玩家选定的卡"] = Duel.SelectMatchingCard(
194: player_who_activate_the_effect,
195: Card.IsAbleToHand,
196: player_who_activate_the_effect,
197: LOCATION_DECK,
198: 0,
199: str_1,
200: str_1,
201: nil
202: )
203: Duel.SendtoHand(str["玩家选定的卡"], nil, REASON_RULE)
204: effect_event:Reset()
674765ddf2 2024-02-13 205: end --}
206: str["效果"]:SetOperation(cache_1)
207: Duel.RegisterEffect(str["效果"], 0)
674765ddf2 2024-02-13 208: end --}
674765ddf2 2024-02-13 209: fun["一_禁格"] = function(str_1) --{
210: str["禁格"] = true
211: str["禁格的数量"] = str_1
212: str["效果"] = Effect.GlobalEffect()
213: str["效果"]:SetCode(EFFECT_USE_EXTRA_MZONE)
214: str["效果"]:SetValue(str_1)
215: Duel.RegisterEffect(str["效果"], 0)
674765ddf2 2024-02-13 216: end --}
217: --第二层-------------------------------
218: local cache_1
219: local cache_2
220: local cache_3
221: local cache_4
222: local cache_5
223: local cache_6
224: local cache_7
225: local cache_8
226: local cache_9
227: local _
228: fun["Debug.ReloadFieldEnd"] = Debug.ReloadFieldEnd
674765ddf2 2024-02-13 229: Debug.ReloadFieldEnd = function(str_1) --{
230: fun["Debug.ReloadFieldEnd"]()
674765ddf2 2024-02-13 231: if str_1 then --{
232: fun["一_随机抽卡"](str_1)
674765ddf2 2024-02-13 233: end --}
674765ddf2 2024-02-13 234: end --}
674765ddf2 2024-02-13 235: fun["二_印卡"] = function(str_1, str_2, str_3) --{
674765ddf2 2024-02-13 236: if str_3 then --{
674765ddf2 2024-02-13 237: --}
674765ddf2 2024-02-13 238: else --{
239: str_3 = str_2
674765ddf2 2024-02-13 240: end --}
241: Debug.ShowHint(
242: "点击对方额外卡组可以进行印卡。\n手卡只能印 "
243: .. str_2
244: .. " 张。\n最多可以印 "
245: .. str_3
246: .. " 张"
247: )
248: str["效果"] = Effect.CreateEffect(str_1)
249: str["当前印卡数"] = 1
250: str["效果"]:SetType(EFFECT_TYPE_IGNITION)
251: str["效果"]:SetProperty(
252: EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE
253: )
254: str["效果"]:SetTarget(fun["一_该效果不能被连锁"])
255: str["效果"]:SetRange(LOCATION_EXTRA)
674765ddf2 2024-02-13 256: function print_hand(effect_event, player_who_activate_the_effect) --{
257: announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
258: card = Duel.CreateToken(player_who_activate_the_effect, announce_card)
674765ddf2 2024-02-13 259: if str["当前印卡数"] <= str_2 then --{
260: str["当前印卡数"] = str["当前印卡数"] + 1
261: Duel.SendtoHand(card, nil, REASON_RULE)
674765ddf2 2024-02-13 262: --}
674765ddf2 2024-02-13 263: else --{
674765ddf2 2024-02-13 264: if str["当前印卡数"] <= str_3 then --{
265: str["当前印卡数"] = str["当前印卡数"] + 1
266: Duel.Remove(card, POS_FACEUP, REASON_RULE)
267: Duel.SendtoDeck(card, player_who_activate_the_effect, 0, REASON_RULE)
674765ddf2 2024-02-13 268: --}
674765ddf2 2024-02-13 269: else --{
270: Debug.ShowHint("印卡过多!")
271: effect_event:Reset()
674765ddf2 2024-02-13 272: end --}
674765ddf2 2024-02-13 273: end --}
674765ddf2 2024-02-13 274: end --}
275: str["效果"]:SetOperation(print_hand)
276: str_1:RegisterEffect(str["效果"])
674765ddf2 2024-02-13 277: end --}
674765ddf2 2024-02-13 278: fun["二_开局说明"] = function() --{
279: str["这个残局的效果卡数量"] =
280: Duel.GetMatchingGroupCount(fun["是否效果卡"], 0, str["所有区域"], str["所有区域"], nil)
281: str["超量素材组"] = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
674765ddf2 2024-02-13 282: for k in aux.Next(str["超量素材组"]) do --{
674765ddf2 2024-02-13 283: if fun["一_是否效果卡"](k) then --{
284: str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
674765ddf2 2024-02-13 285: end --}
674765ddf2 2024-02-13 286: end --}
287: str["开局说明"] = str["这个残局的效果卡数量"] .. "卡 " .. str["规则"]
674765ddf2 2024-02-13 288: if str["不洗牌"] == 0 then --{
674765ddf2 2024-02-13 289: --}
674765ddf2 2024-02-13 290: else --{
291: str["开局说明"] = str["开局说明"] .. "伪洗牌 "
674765ddf2 2024-02-13 292: end --}
674765ddf2 2024-02-13 293: if str["无BP"] == 0 then --{
294: str["开局说明"] = str["开局说明"] .. "无BP "
674765ddf2 2024-02-13 295: end --}
674765ddf2 2024-02-13 296: if str["无AI"] == 0 then --{
297: str["开局说明"] = str["开局说明"] .. "无AI "
674765ddf2 2024-02-13 298: end --}
674765ddf2 2024-02-13 299: if str["开局添加手卡"] then --{
300: str["开局说明"] = str["开局说明"] .. "选" .. str["开局添加手卡的数量"] .. "卡 "
674765ddf2 2024-02-13 301: end --}
674765ddf2 2024-02-13 302: if str["禁格"] then --{
303: str["开局说明"] = str["开局说明"] .. "禁" .. str["禁格的数量"] .. "格 "
674765ddf2 2024-02-13 304: end --}
674765ddf2 2024-02-13 305: if str["随机抽卡的数量"] then --{
306: str["开局说明"] = str["开局说明"] .. "抽" .. str["随机抽卡的数量"] .. "卡 "
674765ddf2 2024-02-13 307: end --}
308: Debug.ShowHint(str["开局说明"])
674765ddf2 2024-02-13 309: end --}
310: --第三层-------------------------------
311: local cache_1
312: local cache_2
313: local cache_3
314: local cache_4
315: local cache_5
316: local cache_6
317: local cache_7
318: local cache_8
319: local cache_9
320: local _
321: fun["aux.BeginPuzzle"] = aux.BeginPuzzle
674765ddf2 2024-02-13 322: aux.BeginPuzzle = function(str_1, str_2) --{
323: fun["aux.BeginPuzzle"]()
674765ddf2 2024-02-13 324: if str_1 then --{
325: fun["一_开局添加手卡"](str_1)
674765ddf2 2024-02-13 326: end --}
674765ddf2 2024-02-13 327: if str_2 then --{
328: fun["一_禁格"](str_2)
674765ddf2 2024-02-13 329: end --}
330: fun["二_开局说明"]()
331: fun["一_通关邀请"]()
332: fun["一_失败得分"]()
674765ddf2 2024-02-13 333: end --}
334: --兼容层-------------------------------
335: fun["印卡"] = fun["二_印卡"]
336: fun["开局添加手卡"] = fun["一_开局添加手卡"]
337: fun["是否效果卡"] = fun["一_是否效果卡"]
338: fun["禁格"] = fun["一_禁格"]
339: fun["随机抽卡"] = fun["一_随机抽卡"]