游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 8bc031aa19 that are changed by the sequence of edits moving toward check-in 7ec48625c2:

                         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: do
                        44:   local h1
                        45:   --~ “调该效果”的效果
                        46:   s["_开局洗牌抽牌"] = function(u1)
                        47:     Duel.ShuffleDeck(0)
                        48:     Duel.Draw(0, h1, REASON_RULE)
                        49:     u1:Reset()
                        50:     end
                        51:   s["开局洗牌抽牌"] = function(u1)
                        52:     local h2
                        53:     --~ 抽卡之数
                        54:     h1 = u1
                        55:     s["开局洗牌抽牌之数"] = u1
                        56:     --~ 效果
                        57:     h2 = Effect.GlobalEffect()
                        58:     h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
                        59:     h2:SetCode(EVENT_ADJUST)
                        60:     h2:SetCondition(aux.TRUE)
                        61:     h2:SetOperation(s["开局洗牌抽牌"])
                        62:     Duel.RegisterEffect(h2, 0)
                        63:     end
                        64:   end
                        65: s["不被连锁"] = function()
                        66:   Duel.SetChainLimit(aux.FALSE)
                        67:   return true
                        68:   end
                        69: do
                        70:   local h1, h2
                        71:   --~ 原解邀请
                        72:   h1 = "残局群181175613"
                        73:   --~ 二解邀请,备用:圣魔术师
                        74:   h2 = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
                        75:     --~ 通关之邀
                        76:   s["_通关之邀"] = function()
                        77:     local h3
                        78:     --~ 对方之血
                        79:     h3 = Duel.GetLP(1)
                        80:     if h3 <= 0 then
                        81:       if h3 == 0 then
                        82:         Debug.ShowHint(h1)
                        83:       else
                        84:         Debug.ShowHint(h2)
                        85:         end
                        86:       end
                        87:     end
                        88:   s["通关之邀"] = function()
                        89:     local h1
                        90:     --~ 效果
                        91:     h1 = Effect.GlobalEffect()
                        92:     h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
                        93:     h1:SetCode(EVENT_DAMAGE)
                        94:     h1:SetCondition(s["_通关之邀"])
                        95:     h1:SetOperation(aux.NULL)
                        96:     Duel.RegisterEffect(h1, 0)
                        97:     end
                        98:   end
                        99: s["是否效牌"] = function(card)
                       100:   for i = 1, #s["效牌之类排"] do
                       101:     if Card.IsType(card, s["效牌之类排"][i]) then
                       102:       return true
                       103:       end
                       104:     end
                       105:   if Card.IsType(card, TYPE_PENDULUM) then
                       106:     for i = 1, #s["无效灵摆怪兽之卡编排"] do
                       107:       if Card.IsCode(card, s["无效灵摆怪兽之卡编排"][i]) then
                       108:       else
                       109:         return true
                       110:         end
                       111:       end
                       112:     end
                       113:   end
                       114: do
                       115:   local h1
                       116:   --~ “调该效果”的效果
                       117:   --~ “调该效果”的玩家
                       118:   s["_开局选牌入手"] = function(u1, u2)
                       119:     local h2
                       120:     --~ 玩家选定的牌
                       121:     h2 = Duel.SelectMatchingCard(u2, Card.IsAbleToHand, u2, LOCATION_DECK, 0, h1, h1, nil)
                       122:     Duel.SendtoHand(h2, nil, REASON_RULE)
                       123:     u1:Reset()
                       124:     end
                       125:   s["开局选牌入手"] = function(u1)
                       126:     local h2
                       127:     s["开局选牌入手之数"] = u1
                       128:     --~ 开局选牌入手之数
                       129:     h1 = u1
                       130:     --~ 效果
                       131:     h2 = Effect.GlobalEffect()
                       132:     h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
                       133:     h2:SetCode(EVENT_ADJUST)
                       134:     h2:SetCondition(aux.TRUE)
                       135:     h2:SetOperation(s["_开局选牌入手"])
                       136:     Duel.RegisterEffect(h2, 0)
                       137:     end
                       138:   end
                       139: s["禁格"] = function(u1)
                       140:   local h1
                       141:   s["禁格之数"] = u1
                       142:   --~ 效果
                       143:   h1 = Effect.GlobalEffect()
                       144:   h1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       145:   h1:SetValue(u1)
                       146:   Duel.RegisterEffect(h1, 0)
                       147:   end
                       148: do
                       149:   s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
                       150:   --~ 开局洗牌抽牌之数
                       151:   function _G.Debug.ReloadFieldEnd(u1)
                       152:     s["Debug.ReloadFieldEnd"]()
                       153:     if u1 then
                       154:       s["开局洗牌抽牌"](u1)
                       155:       end
                       156:     end
                       157:   end
                       158: do
                       159:   local h1, h2, h3, h4
                       160:   --~ 印牌过多之示
                       161:   h1 = "印牌过多"
                       162:   --~ 现之印牌数
                       163:   h2 = 1
                       164:   --~ 印手牌之上限
                       165:   h3 = 0
                       166:   --~ 总印牌之上限
                       167:   h4 = 0
                       168:   --~ 「调该效果」的效果
                       169:   --~ 「调该效果」的玩家
                       170:   s["_印牌"] = function(u1, u2)
                       171:     local h5, h6
                       172:     --~ 印卡之卡编
                       173:     h5 = Duel.AnnounceCard(u2)
                       174:     --~ 卡
                       175:     h6 = Duel.CreateToken(u2, h5)
                       176:     if h2 <= h3 then
                       177:       h2 = h2 + 1
                       178:       Duel.SendtoHand(h6, nil, REASON_RULE)
                       179:     else
                       180:       if h2 <= h4 then
                       181:         h2 = h2 + 1
                       182:         Duel.Remove(h6, POS_FACEUP, REASON_RULE)
                       183:         Duel.SendtoDeck(card, u2, 0, REASON_RULE)
                       184:       else
                       185:         Debug.ShowHint(h1)
                       186:         u1:Reset()
                       187:         end
                       188:       end
                       189:     end
                       190:   s["印牌"] = function(u1, u2, u3)
                       191:     local h5, h6
                       192:     h3 = u2
                       193:     h4 = u3 or u2
8bc031aa19 2024-02-14  194:     Debug.ShowHint("点击对方额外牌组可以进行印牌\n手牌只能印" .. h3 .. "张。\n最多可以印" .. h4 .. "张")
                       195:     h5 = Effect.CreateEffect(u1)
                       196:     h5:SetType(EFFECT_TYPE_IGNITION)
                       197:     h5:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
                       198:     h5:SetTarget(s["不被连锁"])
                       199:     h5:SetRange(LOCATION_EXTRA)
                       200:     h5:SetOperation(s["_印牌"])
                       201:     u1:RegisterEffect(h5)
                       202:     end
                       203:   end
                       204: s["开局之示"] = function()
                       205:   local h1, h2, h3
                       206:   --~ 此局效牌之数
                       207:   h2 = Duel.GetMatchingGroupCount(s["是否效牌"], 0, s["全区"], s["全区"], nil)
                       208:   --~ 超量材组
                       209:   h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
                       210:   for u1 in aux.Next(h3) do
                       211:     if s["是否效牌"](u1) then
                       212:       h2 = h2 + 1
                       213:       end
                       214:     end
                       215:   --~ 开局说明
                       216:   h1 = h2 .. "牌 " .. s["则"]
                       217:   if s["伪洗牌"] == 0 then
                       218:   else
                       219:     h1 = h1 .. "伪洗牌 "
                       220:     end
                       221:   if s["战段"] == 0 then
                       222:     h1 = h1 .. "无战段 "
                       223:     end
                       224:   if s["机智"] == 0 then
                       225:     h1 = h1 .. "无机智 "
                       226:     end
                       227:   if s["开局选牌入手之数"] then
                       228:     h1 = h1 .. "选" .. s["开局选牌入手之数"] .. "牌 "
                       229:     end
                       230:   if s["禁格之数"] then
                       231:     h1 = h1 .. "禁" .. s["禁格之数"] .. "格 "
                       232:     end
                       233:   if s["开局洗牌抽牌之数"] then
                       234:     h1 = h1 .. "抽" .. s["开局洗牌抽牌之数"] .. "牌 "
                       235:     end
                       236:   Debug.ShowHint(h1)
                       237:   end
                       238: do
                       239:   s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
                       240:   --~ 开局选牌入手之数
                       241:   --~ 禁格之数
                       242:   function _G.aux.BeginPuzzle(u1, u2, u3, u4, u5)
                       243:     s["aux.BeginPuzzle"]()
                       244:     if u1 then
                       245:       s["开局选牌入手"](u1)
                       246:       end
                       247:     if u2 then
                       248:       s["禁格"](u2)
                       249:       end
                       250:     if u3 then
                       251:       s["印牌"](u3, u4, u5)
                       252:     else
                       253:       end
                       254:     s["开局之示"]()
                       255:     s["通关之邀"]()
                       256:     end
                       257:   end