游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 540c3085ee that are changed by the sequence of edits moving toward check-in 9a0abc0f50:

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