游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Origin for each line in script/c0.lua from check-in a806df48aa:

0f75e3f03e 2023-08-02    1: local string = string
0f75e3f03e 2023-08-02    2: local table = table
6fdfa2454c 2024-02-14    3: local Debug = Debug
6fdfa2454c 2024-02-14    4: local Effect = Effect
6fdfa2454c 2024-02-14    5: local Duel = Duel
6fdfa2454c 2024-02-14    6: local Card = Card
511cb54144 2024-06-27    7: local d = {}
511cb54144 2024-06-27    8: local f = {}
6bc844fccc 2024-02-13    9: local s = {}
b05c665024 2024-02-14   10: s["效卡之类排"] = {
7da070fada 2024-06-27   11:   TYPE_SPELL,
7da070fada 2024-06-27   12:   TYPE_TRAP,
7da070fada 2024-06-27   13:   TYPE_EFFECT,
7da070fada 2024-06-27   14:   }
21cd94e151 2024-02-14   15: s["无效灵摆怪兽之卡编排"] = {
7da070fada 2024-06-27   16:   28363749,
7da070fada 2024-06-27   17:   19474136,
7da070fada 2024-06-27   18:   17390179,
7da070fada 2024-06-27   19:   83980492,
7da070fada 2024-06-27   20:   }
ef7b6d6995 2024-02-14   21: s["全区"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA
1301c8be40 2024-02-13   22: do
1301c8be40 2024-02-13   23:   local h1
1301c8be40 2024-02-13   24:   --~ 则对
1301c8be40 2024-02-13   25:   h1 = {
632b8c0287 2024-06-27   26:   [3] = "大师规则 ",
632b8c0287 2024-06-27   27:   [4] = "新大师规则(2017) ",
632b8c0287 2024-06-27   28:   [5] = "大师规则(2020) ",
1301c8be40 2024-02-13   29:   }
1301c8be40 2024-02-13   30:   s["Debug.ReloadFieldBegin"] = _G.Debug.ReloadFieldBegin
1301c8be40 2024-02-13   31:   --~ 模
1301c8be40 2024-02-13   32:   --~ 则数
1301c8be40 2024-02-13   33:   function _G.Debug.ReloadFieldBegin(u1, u2)
b05c665024 2024-02-14   34:     s["伪洗卡"] = u1 & DUEL_PSEUDO_SHUFFLE
719cb47a61 2024-02-13   35:     s["战段"] = u1 & DUEL_ATTACK_FIRST_TURN
1301c8be40 2024-02-13   36:     s["机智"] = u1 & DUEL_SIMPLE_AI
1301c8be40 2024-02-13   37:     if u2 then
1301c8be40 2024-02-13   38:       s["则"] = h1[u2]
1301c8be40 2024-02-13   39:     else
1301c8be40 2024-02-13   40:       s["则"] = h1[5]
1301c8be40 2024-02-13   41:       end
1301c8be40 2024-02-13   42:     s["Debug.ReloadFieldBegin"](u1, u2)
1301c8be40 2024-02-13   43:     end
1301c8be40 2024-02-13   44:   end
8ab63a7caf 2024-02-14   45: s["不被连锁"] = function()
d3790b56e8 2024-02-13   46:   Duel.SetChainLimit(aux.FALSE)
d3790b56e8 2024-02-13   47:   return true
d3790b56e8 2024-02-13   48:   end
b05c665024 2024-02-14   49: s["是否效卡"] = function(card)
b05c665024 2024-02-14   50:   for i = 1, #s["效卡之类排"] do
b05c665024 2024-02-14   51:     if Card.IsType(card, s["效卡之类排"][i]) then
f4490a058a 2024-02-14   52:       return true
f4490a058a 2024-02-14   53:       end
f4490a058a 2024-02-14   54:     end
f4490a058a 2024-02-14   55:   if Card.IsType(card, TYPE_PENDULUM) then
f4490a058a 2024-02-14   56:     for i = 1, #s["无效灵摆怪兽之卡编排"] do
f4490a058a 2024-02-14   57:       if Card.IsCode(card, s["无效灵摆怪兽之卡编排"][i]) then
23eca3b462 2024-06-26   58:         return false
033930309a 2024-02-14   59:       else
033930309a 2024-02-14   60:         end
033930309a 2024-02-14   61:       end
540c3085ee 2024-06-26   62:     return true
033930309a 2024-02-14   63:     end
033930309a 2024-02-14   64:   end
033930309a 2024-02-14   65: do
033930309a 2024-02-14   66:   local h1
033930309a 2024-02-14   67:   --~ “调该效果”的效果
033930309a 2024-02-14   68:   --~ “调该效果”的玩家
b05c665024 2024-02-14   69:   s["_开局选卡入手"] = function(u1, u2)
033930309a 2024-02-14   70:     local h2
b05c665024 2024-02-14   71:     --~ 玩家选定的卡
033930309a 2024-02-14   72:     h2 = Duel.SelectMatchingCard(u2, Card.IsAbleToHand, u2, LOCATION_DECK, 0, h1, h1, nil)
033930309a 2024-02-14   73:     Duel.SendtoHand(h2, nil, REASON_RULE)
033930309a 2024-02-14   74:     u1:Reset()
033930309a 2024-02-14   75:     end
b05c665024 2024-02-14   76:   s["开局选卡入手"] = function(u1)
033930309a 2024-02-14   77:     local h2
bb85d78743 2024-02-17   78:     s["「开局选卡入手」之量"] = u1
bb85d78743 2024-02-17   79:     --~ 「开局选卡入手」之量
033930309a 2024-02-14   80:     h1 = u1
033930309a 2024-02-14   81:     --~ 效果
033930309a 2024-02-14   82:     h2 = Effect.GlobalEffect()
033930309a 2024-02-14   83:     h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
033930309a 2024-02-14   84:     h2:SetCode(EVENT_ADJUST)
033930309a 2024-02-14   85:     h2:SetCondition(aux.TRUE)
b05c665024 2024-02-14   86:     h2:SetOperation(s["_开局选卡入手"])
033930309a 2024-02-14   87:     Duel.RegisterEffect(h2, 0)
033930309a 2024-02-14   88:     end
033930309a 2024-02-14   89:   end
2f6b499b2b 2024-06-27   90: --~ 禁几个怪兽格
2f6b499b2b 2024-06-27   91: f["禁格"] = function(o1)
2f6b499b2b 2024-06-27   92:   local k1
2f6b499b2b 2024-06-27   93:   d["禁几个怪兽格"] = o1
6d3e8243f0 2024-06-27   94:   --~ 效果
2f6b499b2b 2024-06-27   95:   k1 = Effect.GlobalEffect()
2f6b499b2b 2024-06-27   96:   k1:SetCode(EFFECT_USE_EXTRA_MZONE)
2f6b499b2b 2024-06-27   97:   k1:SetValue(k1)
2f6b499b2b 2024-06-27   98:   Duel.RegisterEffect(k1, 0)
fd436744e5 2024-02-14   99:   end
fd436744e5 2024-02-14  100: do
fd436744e5 2024-02-14  101:   local h1, h2, h3, h4
b05c665024 2024-02-14  102:   --~ 印卡过多之示
b05c665024 2024-02-14  103:   h1 = "印卡过多"
b05c665024 2024-02-14  104:   --~ 现之印卡数
fd436744e5 2024-02-14  105:   h2 = 1
b05c665024 2024-02-14  106:   --~ 印手卡之上限
fd436744e5 2024-02-14  107:   h3 = 0
b05c665024 2024-02-14  108:   --~ 总印卡之上限
fd436744e5 2024-02-14  109:   h4 = 0
fd436744e5 2024-02-14  110:   --~ 「调该效果」的效果
fd436744e5 2024-02-14  111:   --~ 「调该效果」的玩家
b05c665024 2024-02-14  112:   s["_印卡"] = function(u1, u2)
fd436744e5 2024-02-14  113:     local h5, h6
fd436744e5 2024-02-14  114:     --~ 印卡之卡编
fd436744e5 2024-02-14  115:     h5 = Duel.AnnounceCard(u2)
fd436744e5 2024-02-14  116:     --~ 卡
fd436744e5 2024-02-14  117:     h6 = Duel.CreateToken(u2, h5)
fd436744e5 2024-02-14  118:     if h2 <= h3 then
fd436744e5 2024-02-14  119:       h2 = h2 + 1
fd436744e5 2024-02-14  120:       Duel.SendtoHand(h6, nil, REASON_RULE)
fd436744e5 2024-02-14  121:     else
fd436744e5 2024-02-14  122:       if h2 <= h4 then
fd436744e5 2024-02-14  123:         h2 = h2 + 1
2e27c4daad 2024-02-14  124:         Duel.SendtoDeck(h6, u2, 0, REASON_RULE)
7029b5245e 2024-02-14  125:       else
7029b5245e 2024-02-14  126:         Debug.ShowHint(h1)
7029b5245e 2024-02-14  127:         u1:Reset()
7029b5245e 2024-02-14  128:         end
7029b5245e 2024-02-14  129:       end
7029b5245e 2024-02-14  130:     end
b05c665024 2024-02-14  131:   s["印卡"] = function(u1, u2, u3)
7029b5245e 2024-02-14  132:     local h5, h6
7029b5245e 2024-02-14  133:     h3 = u2
7029b5245e 2024-02-14  134:     h4 = u3 or u2
0b9e931ff1 2024-02-17  135:     Debug.ShowHint("点对方额外卡组,可印卡\n只能印手卡" .. h3 .. "张\n最多可印" .. h4 .. "张")
7029b5245e 2024-02-14  136:     h5 = Effect.CreateEffect(u1)
7029b5245e 2024-02-14  137:     h5:SetType(EFFECT_TYPE_IGNITION)
7029b5245e 2024-02-14  138:     h5:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
7029b5245e 2024-02-14  139:     h5:SetTarget(s["不被连锁"])
7029b5245e 2024-02-14  140:     h5:SetRange(LOCATION_EXTRA)
b05c665024 2024-02-14  141:     h5:SetOperation(s["_印卡"])
7029b5245e 2024-02-14  142:     u1:RegisterEffect(h5)
7029b5245e 2024-02-14  143:     end
7029b5245e 2024-02-14  144:   end
b158c7a4ac 2024-02-17  145: s["开局示"] = function()
7029b5245e 2024-02-14  146:   local h1, h2, h3
b05c665024 2024-02-14  147:   --~ 此局效卡之数
b05c665024 2024-02-14  148:   h2 = Duel.GetMatchingGroupCount(s["是否效卡"], 0, s["全区"], s["全区"], nil)
7029b5245e 2024-02-14  149:   --~ 超量材组
7029b5245e 2024-02-14  150:   h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
7029b5245e 2024-02-14  151:   for u1 in aux.Next(h3) do
b05c665024 2024-02-14  152:     if s["是否效卡"](u1) then
ef7b6d6995 2024-02-14  153:       h2 = h2 + 1
091f486d37 2024-02-13  154:       end
091f486d37 2024-02-13  155:     end
091f486d37 2024-02-13  156:   --~ 开局说明
b05c665024 2024-02-14  157:   h1 = h2 .. "卡 " .. s["则"]
b05c665024 2024-02-14  158:   if s["伪洗卡"] == 0 then
091f486d37 2024-02-13  159:   else
b05c665024 2024-02-14  160:     h1 = h1 .. "伪洗卡 "
719cb47a61 2024-02-13  161:     end
719cb47a61 2024-02-13  162:   if s["战段"] == 0 then
719cb47a61 2024-02-13  163:     h1 = h1 .. "无战段 "
719cb47a61 2024-02-13  164:     end
ef7b6d6995 2024-02-14  165:   if s["机智"] == 0 then
ef7b6d6995 2024-02-14  166:     h1 = h1 .. "无机智 "
ef7b6d6995 2024-02-14  167:     end
bb85d78743 2024-02-17  168:   if s["「开局选卡入手」之量"] then
bb85d78743 2024-02-17  169:     h1 = h1 .. "选" .. s["「开局选卡入手」之量"] .. "卡 "
bb85d78743 2024-02-17  170:     end
bb85d78743 2024-02-17  171:   if s["「禁主怪格」之量"] then
bb85d78743 2024-02-17  172:     h1 = h1 .. "禁" .. s["「禁主怪格」之量"] .. "怪格 "
bb85d78743 2024-02-17  173:     end
bb85d78743 2024-02-17  174:   if s["「禁魔陷格」之量"] then
bb85d78743 2024-02-17  175:     h1 = h1 .. "禁" .. s["「禁魔陷格」之量"] .. "魔格 "
091f486d37 2024-02-13  176:     end
091f486d37 2024-02-13  177:   Debug.ShowHint(h1)
091f486d37 2024-02-13  178:   end
1301c8be40 2024-02-13  179: do
1301c8be40 2024-02-13  180:   s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
7a80b7fa09 2024-02-17  181:   --~ 「开局选卡入手」之量
7a80b7fa09 2024-02-17  182:   --~ 传入对方额外卡组最上面表侧卡,并将其作为印卡源
b158c7a4ac 2024-02-17  183:   --~ 能印手卡几张
b158c7a4ac 2024-02-17  184:   --~ 最多能印卡几张
5990d10d96 2024-06-27  185:   function _G.aux.BeginPuzzle(o1, o2, o3, o4, o5)
e14f5fd087 2024-02-14  186:     s["aux.BeginPuzzle"]()
5990d10d96 2024-06-27  187:     if o1 then
5990d10d96 2024-06-27  188:       s["开局选卡入手"](o1)
2f6b499b2b 2024-06-27  189:     else
2f6b499b2b 2024-06-27  190:       end
2f6b499b2b 2024-06-27  191:     if o2 then
2f6b499b2b 2024-06-27  192:       f["禁格"](o2)
2f6b499b2b 2024-06-27  193:     else
ef8dd0e5a0 2024-02-17  194:       end
5990d10d96 2024-06-27  195:     if o3 then
5990d10d96 2024-06-27  196:       s["印卡"](o3, o4, o5)
0f9865b09c 2024-02-14  197:     else
0f9865b09c 2024-02-14  198:       end
b158c7a4ac 2024-02-17  199:     s["开局示"]()
e14f5fd087 2024-02-14  200:     end
e14f5fd087 2024-02-14  201:   end