游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in b9c81ad464 that are changed by the sequence of edits moving toward check-in a6c06c688b:

                         1: local str = {}
                         2: local string = string
                         3: local table = table
                         4: local s = {}
                         5: _G.fun = {}
                         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
                        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: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
                        35: Debug.ReloadFieldBegin = function(u1, u2)
                        36:   str["不洗牌"] = u1 & DUEL_PSEUDO_SHUFFLE
                        37:   str["无BP"] = u1 & DUEL_ATTACK_FIRST_TURN
                        38:   str["无AI"] = u1 & DUEL_SIMPLE_AI
                        39:   str["规则表"] = {
                        40:     [3] = "大师3 ",
                        41:     [4] = "新大师 ",
                        42:     [5] = "大师2020 ",
                        43:   }
                        44:   if u2 then
                        45:     str["规则"] = str["规则表"][u2]
                        46:   else
                        47:     str["规则"] = str["规则表"][5]
                        48:   end
                        49:   fun["Debug.ReloadFieldBegin"](u1, u2)
                        50: end
                        51: function s["开局随机抽卡"](u1)
                        52:   local h1, h2
                        53:   s["开局洗卡抽卡之数"] = u1
                        54:   --~ 效果
                        55:   h1 = Effect.GlobalEffect()
                        56:   h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
                        57:   h1:SetCode(EVENT_ADJUST)
                        58:   h1:SetCondition(aux.TRUE)
                        59:   -- 随机抽卡
                        60:   --~ 调该效果的效果
                        61:   function h2(u2)
                        62:     Duel.ShuffleDeck(0)
                        63:     Duel.Draw(0, u1, REASON_RULE)
                        64:     u2:Reset()
                        65:     end
                        66:   h1:SetOperation(h2)
                        67:   Duel.RegisterEffect(h1, 0)
                        68:   end
                        69: fun["一_该效果不能被连锁"] = function()
                        70:   Duel.SetChainLimit(aux.FALSE)
                        71:   return true
                        72:   end
                        73: do
                        74:   local h1, h2
                        75:   --~ 原解邀请
                        76:   h1 = "残局群181175613"
                        77:   --~ 二解邀请,备用:圣魔术师
                        78:   h2 = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
                        79:   function s["通关之邀"]()
                        80:     local h3, h4
                        81:     --~ 效果
                        82:     h3 = Effect.GlobalEffect()
                        83:     h3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
                        84:     h3:SetCode(EVENT_DAMAGE)
                        85:     --~ 通关之邀
                        86:     function h4()
                        87:       local h5
                        88:       --~ 对方之血
                        89:       h5 = Duel.GetLP(1)
                        90:       if h5 <= 0 then
                        91:         if h5 == 0 then
                        92:           Debug.ShowHint(h1)
                        93:         else
                        94:           Debug.ShowHint(h2)
                        95:           end
                        96:       else
                        97:         return false
                        98:         end
                        99:       end
                       100:     h3:SetCondition(h4)
                       101:     h3:SetOperation(aux.NULL)
                       102:     Duel.RegisterEffect(h3, 0)
                       103:     end
                       104:   end
                       105: fun["一_是否效果卡"] = function(card)
                       106:   for i = 1, #str["效果卡的种类表"] do
                       107:     if Card.IsType(card, str["效果卡的种类表"][i]) then
                       108:       return true
                       109:     end
                       110:   end
                       111:   if Card.IsType(card, TYPE_PENDULUM) then
                       112:     for i = 1, #str["无效果灵摆怪兽表"] do
                       113:       if Card.IsCode(card, str["无效果灵摆怪兽表"][i]) then
                       114:       else
                       115:         return true
                       116:       end
                       117:     end
                       118:   end
                       119: end
                       120: fun["一_开局添加手卡"] = function(u1)
                       121:   str["开局添加手卡"] = true
                       122:   str["开局添加手卡的数量"] = u1
b9c81ad464 2024-02-13  123:   str["效果"] = Effect.GlobalEffect()
b9c81ad464 2024-02-13  124:   str["效果"]:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
b9c81ad464 2024-02-13  125:   str["效果"]:SetCode(EVENT_ADJUST)
b9c81ad464 2024-02-13  126:   str["效果"]:SetCondition(aux.TRUE)
b9c81ad464 2024-02-13  127:   function cache_1(effect_event, player_who_activate_the_effect)
b9c81ad464 2024-02-13  128:     str["玩家选定的卡"] = Duel.SelectMatchingCard(
b9c81ad464 2024-02-13  129:       player_who_activate_the_effect,
b9c81ad464 2024-02-13  130:       Card.IsAbleToHand,
b9c81ad464 2024-02-13  131:       player_who_activate_the_effect,
b9c81ad464 2024-02-13  132:       LOCATION_DECK,
b9c81ad464 2024-02-13  133:       0,
b9c81ad464 2024-02-13  134:       u1,
b9c81ad464 2024-02-13  135:       u1,
b9c81ad464 2024-02-13  136:       nil
b9c81ad464 2024-02-13  137:     )
b9c81ad464 2024-02-13  138:     Duel.SendtoHand(str["玩家选定的卡"], nil, REASON_RULE)
b9c81ad464 2024-02-13  139:     effect_event:Reset()
b9c81ad464 2024-02-13  140:   end
b9c81ad464 2024-02-13  141:   str["效果"]:SetOperation(cache_1)
b9c81ad464 2024-02-13  142:   Duel.RegisterEffect(str["效果"], 0)
b9c81ad464 2024-02-13  143: end
                       144: fun["一_禁格"] = function(u1)
                       145:   local h1
                       146:   s["禁格之数"] = 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:     s["开局随机抽卡"](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:   local h1
                       210:   str["这个残局的效果卡数量"] =
                       211:     Duel.GetMatchingGroupCount(fun["是否效果卡"], 0, str["所有区域"], str["所有区域"], nil)
                       212:   str["超量素材组"] = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
                       213:   for k in aux.Next(str["超量素材组"]) do
                       214:     if fun["一_是否效果卡"](k) then
                       215:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
                       216:       end
                       217:     end
                       218:   --~ 开局说明
                       219:   h1 = str["这个残局的效果卡数量"] .. "卡 " .. str["规则"]
                       220:   if str["不洗牌"] == 0 then
                       221:   else
                       222:     h1 = h1 .. "伪洗牌 "
                       223:     end
                       224:   if str["无BP"] == 0 then
                       225:     h1 = h1 .. "无BP "
                       226:     end
                       227:   if str["无AI"] == 0 then
                       228:     h1 = h1 .. "无AI "
                       229:     end
                       230:   if str["开局添加手卡"] then
                       231:     h1 = h1 .. "选" .. str["开局添加手卡的数量"] .. "卡 "
                       232:     end
                       233:   if s["禁格之数"] then
                       234:     h1 = h1 .. "禁" .. s["禁格之数"] .. "格 "
                       235:     end
                       236:   if s["开局洗卡抽卡之数"] then
                       237:     h1 = h1 .. "抽" .. s["开局洗卡抽卡之数"] .. "卡 "
                       238:     end
                       239:   Debug.ShowHint(h1)
                       240:   end
                       241: fun["aux.BeginPuzzle"] = aux.BeginPuzzle
                       242: aux.BeginPuzzle = function(u1, u2)
                       243:   fun["aux.BeginPuzzle"]()
                       244:   if u1 then
                       245:     fun["一_开局添加手卡"](u1)
                       246:   end
                       247:   if u2 then
                       248:     fun["一_禁格"](u2)
                       249:   end
                       250:   fun["二_开局说明"]()
                       251:   s["通关之邀"]()
                       252: end
                       253: --兼容层-------------------------------
                       254: fun["印卡"] = fun["二_印卡"]
                       255: fun["开局添加手卡"] = fun["一_开局添加手卡"]
                       256: fun["是否效果卡"] = fun["一_是否效果卡"]
                       257: fun["禁格"] = fun["一_禁格"]
                       258: fun["随机抽卡"] = s["开局随机抽卡"]