游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

                         1: local str = {}
                         2: local string = string
                         3: local table = table
                         4: local s = {}
                         5: _G.fun = {}
                         6: s["效牌之类排"] = {
ef7b6d6995 2024-02-14    7:   TYPE_SPELL
ef7b6d6995 2024-02-14    8:   , TYPE_TRAP
ef7b6d6995 2024-02-14    9:   , TYPE_EFFECT
ef7b6d6995 2024-02-14   10: }
ef7b6d6995 2024-02-14   11: str["无效果灵摆怪兽表"] = {
ef7b6d6995 2024-02-14   12:   28363749,
ef7b6d6995 2024-02-14   13:   19474136,
ef7b6d6995 2024-02-14   14:   17390179,
ef7b6d6995 2024-02-14   15:   83980492,
                        16: }
                        17: s["全区"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA
                        18: --第一层-------------------------------
                        19: local cache_1
                        20: local cache_2
                        21: local cache_3
                        22: local cache_4
                        23: local cache_5
                        24: local cache_6
                        25: local cache_7
                        26: local cache_8
                        27: local cache_9
                        28: local _
                        29: do
                        30:   local h1
                        31:   --~ 则对
                        32:   h1 = {
                        33:   [3] = "大师3 "
                        34:   , [4] = "新大师 "
                        35:   , [5] = "大师2020 "
                        36:   }
                        37:   s["Debug.ReloadFieldBegin"] = _G.Debug.ReloadFieldBegin
                        38:   --~ 模
                        39:   --~ 则数
                        40:   function _G.Debug.ReloadFieldBegin(u1, u2)
                        41:     s["伪洗牌"] = u1 & DUEL_PSEUDO_SHUFFLE
                        42:     s["战段"] = u1 & DUEL_ATTACK_FIRST_TURN
                        43:     s["机智"] = u1 & DUEL_SIMPLE_AI
                        44:     if u2 then
                        45:       s["则"] = h1[u2]
                        46:     else
                        47:       s["则"] = h1[5]
                        48:       end
                        49:     s["Debug.ReloadFieldBegin"](u1, u2)
                        50:     end
                        51:   end
                        52: function s["开局洗牌抽牌"](u1)
                        53:   local h1, h2
                        54:   s["开局洗牌抽牌之数"] = u1
                        55:   --~ 效果
                        56:   h1 = Effect.GlobalEffect()
                        57:   h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
                        58:   h1:SetCode(EVENT_ADJUST)
                        59:   h1:SetCondition(aux.TRUE)
                        60:   -- 随机抽牌
                        61:   --~ 调该效果的效果
                        62:   function h2(u2)
                        63:     Duel.ShuffleDeck(0)
                        64:     Duel.Draw(0, u1, REASON_RULE)
                        65:     u2:Reset()
                        66:     end
                        67:   h1:SetOperation(h2)
                        68:   Duel.RegisterEffect(h1, 0)
                        69:   end
                        70: fun["一_该效果不能被连锁"] = function()
                        71:   Duel.SetChainLimit(aux.FALSE)
                        72:   return true
                        73:   end
                        74: do
                        75:   local h1, h2
                        76:   --~ 原解邀请
                        77:   h1 = "残局群181175613"
                        78:   --~ 二解邀请,备用:圣魔术师
                        79:   h2 = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
                        80:   function s["通关之邀"]()
                        81:     local h3, h4
                        82:     --~ 效果
                        83:     h3 = Effect.GlobalEffect()
                        84:     h3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
                        85:     h3:SetCode(EVENT_DAMAGE)
                        86:     --~ 通关之邀
                        87:     function h4()
                        88:       local h5
                        89:       --~ 对方之血
                        90:       h5 = Duel.GetLP(1)
                        91:       if h5 <= 0 then
                        92:         if h5 == 0 then
                        93:           Debug.ShowHint(h1)
                        94:         else
                        95:           Debug.ShowHint(h2)
                        96:           end
                        97:       else
                        98:         return false
                        99:         end
                       100:       end
                       101:     h3:SetCondition(h4)
                       102:     h3:SetOperation(aux.NULL)
                       103:     Duel.RegisterEffect(h3, 0)
                       104:     end
                       105:   end
                       106: fun["一_是否效果牌"] = function(card)
                       107:   for i = 1, #str["效果牌的种类表"] do
                       108:     if Card.IsType(card, str["效果牌的种类表"][i]) then
                       109:       return true
                       110:     end
                       111:   end
                       112:   if Card.IsType(card, TYPE_PENDULUM) then
                       113:     for i = 1, #str["无效果灵摆怪兽表"] do
                       114:       if Card.IsCode(card, str["无效果灵摆怪兽表"][i]) then
                       115:       else
                       116:         return true
                       117:       end
                       118:     end
                       119:   end
                       120: end
                       121: function s["开局选牌入手"](u1)
                       122:   local h1, h2
                       123:   str["开局选牌入手之数"] = u1
                       124:   --~ 效果
                       125:   h1 = Effect.GlobalEffect()
                       126:   h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
                       127:   h1:SetCode(EVENT_ADJUST)
                       128:   h1:SetCondition(aux.TRUE)
                       129:   --~ 调该效果的效果
                       130:   --~ 调该效果的玩家
                       131:   function h2(u2, u3)
                       132:     local h3
                       133:     --~ 玩家选定的牌
                       134:     h3 = Duel.SelectMatchingCard(u3, Card.IsAbleToHand, u3, LOCATION_DECK, 0, u1, u1, nil)
                       135:     Duel.SendtoHand(h3, nil, REASON_RULE)
                       136:     u2:Reset()
                       137:     end
                       138:   h1:SetOperation(h2)
                       139:   Duel.RegisterEffect(h1, 0)
                       140:   end
                       141: function s["禁格"](u1)
                       142:   local h1
                       143:   s["禁格之数"] = u1
                       144:   --~ 效果
                       145:   h1 = Effect.GlobalEffect()
                       146:   h1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       147:   h1:SetValue(u1)
                       148:   Duel.RegisterEffect(h1, 0)
                       149:   end
                       150: --第二层-------------------------------
                       151: local cache_1
                       152: local cache_2
                       153: local cache_3
                       154: local cache_4
                       155: local cache_5
                       156: local cache_6
                       157: local cache_7
                       158: local cache_8
                       159: local cache_9
                       160: local _
                       161: do
                       162:   s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
                       163:   --~ 开局洗牌抽牌之数
                       164:   function _G.Debug.ReloadFieldEnd(u1)
                       165:     s["Debug.ReloadFieldEnd"]()
                       166:     if u1 then
                       167:       s["开局洗牌抽牌"](u1)
                       168:       end
                       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, h2, h3
                       210:   --~ 此局的效牌数
                       211:   h2 = Duel.GetMatchingGroupCount(fun["是否效果牌"], 0, s["全区"], s["全区"], nil)
                       212:   --~ 超量材组
                       213:   h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
                       214:   for u1 in aux.Next(h3) do
                       215:     if fun["一_是否效果牌"](u1) then
                       216:       h2 = h2 + 1
                       217:       end
                       218:     end
                       219:   --~ 开局说明
                       220:   h1 = str["这个残局的效果牌数量"] .. "牌 " .. str["规则"]
                       221:   if s["伪洗牌"] == 0 then
                       222:   else
                       223:     h1 = h1 .. "伪洗牌 "
                       224:     end
                       225:   if s["战段"] == 0 then
                       226:     h1 = h1 .. "无战段 "
                       227:     end
                       228:   if s["机智"] == 0 then
                       229:     h1 = h1 .. "无机智 "
                       230:     end
                       231:   if s["开局选牌入手之数"] then
                       232:     h1 = h1 .. "选" .. s["开局选牌入手之数"] .. "牌 "
                       233:     end
                       234:   if s["禁格之数"] then
                       235:     h1 = h1 .. "禁" .. s["禁格之数"] .. "格 "
                       236:     end
                       237:   if s["开局洗牌抽牌之数"] then
                       238:     h1 = h1 .. "抽" .. s["开局洗牌抽牌之数"] .. "牌 "
                       239:     end
                       240:   Debug.ShowHint(h1)
                       241:   end
                       242: do
                       243:   s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
                       244:   --~ 开局选牌入手之数
                       245:   --~ 禁格之数
                       246:   function _G.aux.BeginPuzzle(u1, u2)
                       247:     s["aux.BeginPuzzle"]()
                       248:     if u1 then
                       249:       s["开局选牌入手"](u1)
                       250:       end
                       251:     if u2 then
                       252:       s["禁格"](u2)
                       253:       end
                       254:     fun["二_开局说明"]()
                       255:     s["通关之邀"]()
                       256:     end
                       257:   end
                       258: --兼容层-------------------------------
                       259: fun["印牌"] = fun["二_印牌"]
                       260: fun["开局添加手牌"] = s["开局选牌入手"]
                       261: fun["是否效果牌"] = fun["一_是否效果牌"]
                       262: fun["禁格"] = s["禁格"]
                       263: fun["随机抽牌"] = s["开局洗牌抽牌"]