游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 951ea1b58f that are changed by the sequence of edits moving toward check-in 0dd37b287e:

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