游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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