游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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