游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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 = {}
5e3f812cd3 2024-06-27   10: d["排_效果卡的类型"] = {
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:   }
5e3f812cd3 2024-06-27   15: d["排_非效果灵摆怪兽的卡编"] = {
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:   }
331b80d304 2024-06-27   21: d["所有区域"] = 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
b06c61ebbe 2024-06-27   45: f["不被连锁"] = function()
033930309a 2024-02-14   46:   Duel.SetChainLimit(aux.FALSE)
033930309a 2024-02-14   47:   return true
033930309a 2024-02-14   48:   end
701420df8f 2024-06-27   49: d["是否有效果卡"] = function(card)
a182a7e55e 2024-06-27   50:   for i = 1, #d["排_非效果灵摆怪兽的卡编"] do
a182a7e55e 2024-06-27   51:     if Card.IsCode(card, d["排_非效果灵摆怪兽的卡编"][i]) then
a182a7e55e 2024-06-27   52:       return false
a182a7e55e 2024-06-27   53:       end
a182a7e55e 2024-06-27   54:     end
a182a7e55e 2024-06-27   55:   return true
033930309a 2024-02-14   56:   end
ac819336b2 2024-02-14   57: do
ac819336b2 2024-02-14   58:   local h1
14fe398ae9 2024-02-14   59:   --~ “调该效果”的效果
033930309a 2024-02-14   60:   --~ “调该效果”的玩家
b05c665024 2024-02-14   61:   s["_开局选卡入手"] = function(u1, u2)
033930309a 2024-02-14   62:     local h2
b05c665024 2024-02-14   63:     --~ 玩家选定的卡
033930309a 2024-02-14   64:     h2 = Duel.SelectMatchingCard(u2, Card.IsAbleToHand, u2, LOCATION_DECK, 0, h1, h1, nil)
033930309a 2024-02-14   65:     Duel.SendtoHand(h2, nil, REASON_RULE)
ac819336b2 2024-02-14   66:     u1:Reset()
ac819336b2 2024-02-14   67:     end
b05c665024 2024-02-14   68:   s["开局选卡入手"] = function(u1)
ac819336b2 2024-02-14   69:     local h2
b0c9c72494 2024-06-27   70:     d["数_选卡"] = u1
bb85d78743 2024-02-17   71:     --~ 「开局选卡入手」之量
033930309a 2024-02-14   72:     h1 = u1
ac819336b2 2024-02-14   73:     --~ 效果
ac819336b2 2024-02-14   74:     h2 = Effect.GlobalEffect()
ac819336b2 2024-02-14   75:     h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
ac819336b2 2024-02-14   76:     h2:SetCode(EVENT_ADJUST)
ac819336b2 2024-02-14   77:     h2:SetCondition(aux.TRUE)
b05c665024 2024-02-14   78:     h2:SetOperation(s["_开局选卡入手"])
b05c665024 2024-02-14   79:     Duel.RegisterEffect(h2, 0)
b05c665024 2024-02-14   80:     end
b05c665024 2024-02-14   81:   end
2f6b499b2b 2024-06-27   82: --~ 禁几个怪兽格
2f6b499b2b 2024-06-27   83: f["禁格"] = function(o1)
2f6b499b2b 2024-06-27   84:   local k1
2f6b499b2b 2024-06-27   85:   d["禁几个怪兽格"] = o1
2f6b499b2b 2024-06-27   86:   --~ 效果
2f6b499b2b 2024-06-27   87:   k1 = Effect.GlobalEffect()
2f6b499b2b 2024-06-27   88:   k1:SetCode(EFFECT_USE_EXTRA_MZONE)
2f6b499b2b 2024-06-27   89:   k1:SetValue(k1)
2f6b499b2b 2024-06-27   90:   Duel.RegisterEffect(k1, 0)
2f6b499b2b 2024-06-27   91:   end
2f6b499b2b 2024-06-27   92: do
cb9ce9dc22 2024-06-27   93:   local k1, k2, k3, k4
cb9ce9dc22 2024-06-27   94:   --~ 印卡过多时的提示
cb9ce9dc22 2024-06-27   95:   k1 = "印卡过多"
cb9ce9dc22 2024-06-27   96:   --~ 现在的印卡数量
cb9ce9dc22 2024-06-27   97:   k2 = 1
cb9ce9dc22 2024-06-27   98:   --~ 手卡印卡数量的上限
cb9ce9dc22 2024-06-27   99:   k3 = 0
cb9ce9dc22 2024-06-27  100:   --~ 印卡总数量的上限
cb9ce9dc22 2024-06-27  101:   k4 = 0
a82e37fd3f 2024-06-27  102:   --~ 所调用这个效果的效果
a82e37fd3f 2024-06-27  103:   --~ 所调用这个效果的玩家
cb9ce9dc22 2024-06-27  104:   f["_印卡"] = function(o1, o2)
cb9ce9dc22 2024-06-27  105:     local k5, k6
b06c61ebbe 2024-06-27  106:     --~ 要印之卡的卡编
cb9ce9dc22 2024-06-27  107:     k5 = Duel.AnnounceCard(o2)
cb9ce9dc22 2024-06-27  108:     --~ 卡
cb9ce9dc22 2024-06-27  109:     k6 = Duel.CreateToken(o2, k5)
cb9ce9dc22 2024-06-27  110:     if k2 <= k3 then
cb9ce9dc22 2024-06-27  111:       k2 = k2 + 1
cb9ce9dc22 2024-06-27  112:       Duel.SendtoHand(k6, nil, REASON_RULE)
cb9ce9dc22 2024-06-27  113:     else
cb9ce9dc22 2024-06-27  114:       if k2 <= k4 then
cb9ce9dc22 2024-06-27  115:         k2 = k2 + 1
cb9ce9dc22 2024-06-27  116:         Duel.SendtoDeck(k6, o2, 0, REASON_RULE)
cb9ce9dc22 2024-06-27  117:       else
cb9ce9dc22 2024-06-27  118:         Debug.ShowHint(k1)
cb9ce9dc22 2024-06-27  119:         o1:Reset()
cb9ce9dc22 2024-06-27  120:         end
cb9ce9dc22 2024-06-27  121:       end
cb9ce9dc22 2024-06-27  122:     end
cb9ce9dc22 2024-06-27  123:   --~ 印卡的启动源
cb9ce9dc22 2024-06-27  124:   --~ 手卡印卡数量的上限
cb9ce9dc22 2024-06-27  125:   --~ 印卡总数量的上限
cb9ce9dc22 2024-06-27  126:   f["印卡"] = function(o1, o2, o3)
cb9ce9dc22 2024-06-27  127:     local k5
cb9ce9dc22 2024-06-27  128:     k3 = o2
cb9ce9dc22 2024-06-27  129:     k4 = o3 or o2
cb9ce9dc22 2024-06-27  130:     Debug.ShowHint("点对方额外卡组,可印卡\n只能印手卡 " .. k3 .. " 张\n最多可印 " .. k4 .. " 张")
cb9ce9dc22 2024-06-27  131:     k5 = Effect.CreateEffect(o1)
cb9ce9dc22 2024-06-27  132:     k5:SetType(EFFECT_TYPE_IGNITION)
cb9ce9dc22 2024-06-27  133:     k5:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
cb9ce9dc22 2024-06-27  134:     k5:SetTarget(f["不被连锁"])
cb9ce9dc22 2024-06-27  135:     k5:SetRange(LOCATION_EXTRA)
cb9ce9dc22 2024-06-27  136:     k5:SetOperation(f["_印卡"])
cb9ce9dc22 2024-06-27  137:     o1:RegisterEffect(k5)
cb9ce9dc22 2024-06-27  138:     end
cb9ce9dc22 2024-06-27  139:   end
ba05430172 2024-06-27  140: d["开局提示"] = function()
cb9ce9dc22 2024-06-27  141:   local h1, h2, h3
cb9ce9dc22 2024-06-27  142:   --~ 此局效卡之数
331b80d304 2024-06-27  143:   h2 = Duel.GetMatchingGroupCount(d["是否有效果卡"], 0, d["所有区域"], d["所有区域"], nil)
cb9ce9dc22 2024-06-27  144:   --~ 超量材组
cb9ce9dc22 2024-06-27  145:   h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
cb9ce9dc22 2024-06-27  146:   for u1 in aux.Next(h3) do
701420df8f 2024-06-27  147:     if d["是否有效果卡"](u1) then
ef7b6d6995 2024-02-14  148:       h2 = h2 + 1
ef7b6d6995 2024-02-14  149:       end
ef7b6d6995 2024-02-14  150:     end
ef7b6d6995 2024-02-14  151:   --~ 开局说明
b05c665024 2024-02-14  152:   h1 = h2 .. "卡 " .. s["则"]
b05c665024 2024-02-14  153:   if s["伪洗卡"] == 0 then
ef7b6d6995 2024-02-14  154:   else
b05c665024 2024-02-14  155:     h1 = h1 .. "伪洗卡 "
719cb47a61 2024-02-13  156:     end
719cb47a61 2024-02-13  157:   if s["战段"] == 0 then
719cb47a61 2024-02-13  158:     h1 = h1 .. "无战段 "
719cb47a61 2024-02-13  159:     end
ef7b6d6995 2024-02-14  160:   if s["机智"] == 0 then
ef7b6d6995 2024-02-14  161:     h1 = h1 .. "无机智 "
ef7b6d6995 2024-02-14  162:     end
b0c9c72494 2024-06-27  163:   if d["数_选卡"] then
b0c9c72494 2024-06-27  164:     h1 = h1 .. "选" .. d["数_选卡"] .. "卡 "
7d5b887170 2024-06-27  165:     end
b0c9c72494 2024-06-27  166:   if d["数_禁格"] then
b0c9c72494 2024-06-27  167:     h1 = h1 .. "禁" .. d["数_禁格"] .. "怪格 "
091f486d37 2024-02-13  168:     end
091f486d37 2024-02-13  169:   Debug.ShowHint(h1)
091f486d37 2024-02-13  170:   end
1301c8be40 2024-02-13  171: do
1301c8be40 2024-02-13  172:   s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
7a80b7fa09 2024-02-17  173:   --~ 「开局选卡入手」之量
7a80b7fa09 2024-02-17  174:   --~ 传入对方额外卡组最上面表侧卡,并将其作为印卡源
b158c7a4ac 2024-02-17  175:   --~ 能印手卡几张
b158c7a4ac 2024-02-17  176:   --~ 最多能印卡几张
5990d10d96 2024-06-27  177:   function _G.aux.BeginPuzzle(o1, o2, o3, o4, o5)
e14f5fd087 2024-02-14  178:     s["aux.BeginPuzzle"]()
5990d10d96 2024-06-27  179:     if o1 then
5990d10d96 2024-06-27  180:       s["开局选卡入手"](o1)
2f6b499b2b 2024-06-27  181:     else
2f6b499b2b 2024-06-27  182:       end
2f6b499b2b 2024-06-27  183:     if o2 then
2f6b499b2b 2024-06-27  184:       f["禁格"](o2)
2f6b499b2b 2024-06-27  185:     else
ef8dd0e5a0 2024-02-17  186:       end
5990d10d96 2024-06-27  187:     if o3 then
5990d10d96 2024-06-27  188:       s["印卡"](o3, o4, o5)
0f9865b09c 2024-02-14  189:     else
0f9865b09c 2024-02-14  190:       end
ba05430172 2024-06-27  191:     d["开局提示"]()
e14f5fd087 2024-02-14  192:     end
e14f5fd087 2024-02-14  193:   end