游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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 = {}
738c457e01 2024-07-17    9: d["排_效果卡之类型"] = {
7da070fada 2024-06-27   10:   TYPE_SPELL,
7da070fada 2024-06-27   11:   TYPE_TRAP,
7da070fada 2024-06-27   12:   TYPE_EFFECT,
7da070fada 2024-06-27   13:   }
738c457e01 2024-07-17   14: d["排_非效果灵摆怪兽之卡片编号"] = {
7da070fada 2024-06-27   15:   28363749,
7da070fada 2024-06-27   16:   19474136,
7da070fada 2024-06-27   17:   17390179,
7da070fada 2024-06-27   18:   83980492,
7da070fada 2024-06-27   19:   }
7e1849c15c 2024-06-27   20: d["数_所有区域"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA
7e1849c15c 2024-06-27   21: do
7e1849c15c 2024-06-27   22:   --~ 这一局所适用规则的对
07dff49316 2024-07-17   23:   local k1
7e1849c15c 2024-06-27   24:   k1 = {
6d5fb7465f 2024-06-27   25:     [3] = "大师规则三(2014) ",
221188e89a 2024-06-27   26:     [4] = "新大师规则(2017) ",
221188e89a 2024-06-27   27:     [5] = "大师规则(2020) ",
7e1849c15c 2024-06-27   28:     }
7e1849c15c 2024-06-27   29:   f["Debug.ReloadFieldBegin"] = _G.Debug.ReloadFieldBegin
738c457e01 2024-07-17   30:   --~ 数_这一局的模式
738c457e01 2024-07-17   31:   --~ 数_规则参数
7e1849c15c 2024-06-27   32:   function _G.Debug.ReloadFieldBegin(o1, o2)
7e1849c15c 2024-06-27   33:     d["数_假洗卡"] = o1 & DUEL_PSEUDO_SHUFFLE
7e1849c15c 2024-06-27   34:     d["数_战斗阶段"] = o1 & DUEL_ATTACK_FIRST_TURN
7e1849c15c 2024-06-27   35:     d["数_人工智能"] = o1 & DUEL_SIMPLE_AI
7e1849c15c 2024-06-27   36:     if o2 then
a5616b998c 2024-06-27   37:       d["字_这一局的规则"] = k1[o2]
7e1849c15c 2024-06-27   38:     else
a5616b998c 2024-06-27   39:       d["字_这一局的规则"] = k1[5]
7e1849c15c 2024-06-27   40:       end
a5616b998c 2024-06-27   41:     f["Debug.ReloadFieldBegin"](o1, o2)
ef8dd0e5a0 2024-02-17   42:     end
ef8dd0e5a0 2024-02-17   43:   end
b06c61ebbe 2024-06-27   44: f["不被连锁"] = function()
04eb866260 2024-02-13   45:   Duel.SetChainLimit(aux.FALSE)
04eb866260 2024-02-13   46:   return true
d3790b56e8 2024-02-13   47:   end
a5616b998c 2024-06-27   48: f["是否有效果卡"] = function(card)
383ce45c59 2024-07-17   49:   for k11 = 1, #d["排_效果卡之类型"] do
383ce45c59 2024-07-17   50:     if Card.IsType(card, d["排_效果卡之类型"][k11]) then
1bc6d12501 2024-06-27   51:       return true
f4490a058a 2024-02-14   52:       end
f4490a058a 2024-02-14   53:     end
1bc6d12501 2024-06-27   54:   if Card.IsType(card, TYPE_PENDULUM) then
383ce45c59 2024-07-17   55:     for k11 = 1, #d["排_非效果灵摆怪兽之卡片编号"] do
383ce45c59 2024-07-17   56:       if Card.IsCode(card, d["排_非效果灵摆怪兽之卡片编号"][k11]) then
1bc6d12501 2024-06-27   57:         return false
1bc6d12501 2024-06-27   58:       else
1bc6d12501 2024-06-27   59:         end
1bc6d12501 2024-06-27   60:       end
1bc6d12501 2024-06-27   61:     return true
1bc6d12501 2024-06-27   62:     end
540c3085ee 2024-06-26   63:   end
540c3085ee 2024-06-26   64: do
ad5fabcb17 2024-07-17   65:   --~ 量_开局选卡入手的数量
bb9bb3e958 2024-06-27   66:   local k1
07dff49316 2024-07-17   67:   --~ 效果_所调用这个效果的效果
07dff49316 2024-07-17   68:   --~ 玩家_所调用这个效果的玩家
844b062240 2024-06-27   69:   f["_开局选卡入手"] = function(o1, o2)
ad5fabcb17 2024-07-17   70:     --~ 卡_玩家选定的卡
07dff49316 2024-07-17   71:     local k2
7e1849c15c 2024-06-27   72:     k2 = Duel.SelectMatchingCard(o2, Card.IsAbleToHand, o2, LOCATION_DECK, 0, k1, k1, nil)
07dff49316 2024-07-17   73:     local o2
07dff49316 2024-07-17   74:     local k1
bb9bb3e958 2024-06-27   75:     Duel.SendtoHand(k2, nil, REASON_RULE)
07dff49316 2024-07-17   76:     local k2
ad5fabcb17 2024-07-17   77:     o1:Reset()
07dff49316 2024-07-17   78:     local o1
ad5fabcb17 2024-07-17   79:     end
07dff49316 2024-07-17   80:   --~ 量_开局选卡入手的数量
ad5fabcb17 2024-07-17   81:   f["开局选卡入手"] = function(o1)
07dff49316 2024-07-17   82:     --~ 效果
ad5fabcb17 2024-07-17   83:     local k2
ad5fabcb17 2024-07-17   84:     d["量_选卡"] = o1
ad5fabcb17 2024-07-17   85:     k1 = o1
bb9bb3e958 2024-06-27   86:     k2 = Effect.GlobalEffect()
bb9bb3e958 2024-06-27   87:     k2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
bb9bb3e958 2024-06-27   88:     k2:SetCode(EVENT_ADJUST)
bb9bb3e958 2024-06-27   89:     k2:SetCondition(aux.TRUE)
844b062240 2024-06-27   90:     k2:SetOperation(f["_开局选卡入手"])
bb9bb3e958 2024-06-27   91:     Duel.RegisterEffect(k2, 0)
cb9ce9dc22 2024-06-27   92:     end
cb9ce9dc22 2024-06-27   93:   end
ad5fabcb17 2024-07-17   94: --~ 量_禁几个怪兽格
cb9ce9dc22 2024-06-27   95: f["禁格"] = function(o1)
cb9ce9dc22 2024-06-27   96:   local k1
ad5fabcb17 2024-07-17   97:   d["量_禁格"] = o1
cb9ce9dc22 2024-06-27   98:   --~ 效果
cb9ce9dc22 2024-06-27   99:   k1 = Effect.GlobalEffect()
cb9ce9dc22 2024-06-27  100:   k1:SetCode(EFFECT_USE_EXTRA_MZONE)
72a706f479 2024-06-27  101:   k1:SetValue(o1)
cb9ce9dc22 2024-06-27  102:   Duel.RegisterEffect(k1, 0)
cb9ce9dc22 2024-06-27  103:   end
cb9ce9dc22 2024-06-27  104: do
cb9ce9dc22 2024-06-27  105:   local k1, k2, k3, k4
ad5fabcb17 2024-07-17  106:   --~ 字_印卡过多时的提示
cb9ce9dc22 2024-06-27  107:   k1 = "印卡过多"
ad5fabcb17 2024-07-17  108:   --~ 量_现在的印卡数量
cb9ce9dc22 2024-06-27  109:   k2 = 1
ad5fabcb17 2024-07-17  110:   --~ 量_手卡印卡数量的上限
cb9ce9dc22 2024-06-27  111:   k3 = 0
ad5fabcb17 2024-07-17  112:   --~ 量_印卡总数量的上限
cb9ce9dc22 2024-06-27  113:   k4 = 0
ad5fabcb17 2024-07-17  114:   --~ 效果_所调用这个效果的效果
ad5fabcb17 2024-07-17  115:   --~ 数_所调用这个效果的玩家
cb9ce9dc22 2024-06-27  116:   f["_印卡"] = function(o1, o2)
cb9ce9dc22 2024-06-27  117:     local k5, k6
ad5fabcb17 2024-07-17  118:     --~ 数_要印之卡的卡编
cb9ce9dc22 2024-06-27  119:     k5 = Duel.AnnounceCard(o2)
cb9ce9dc22 2024-06-27  120:     --~ 卡
cb9ce9dc22 2024-06-27  121:     k6 = Duel.CreateToken(o2, k5)
cb9ce9dc22 2024-06-27  122:     if k2 <= k3 then
cb9ce9dc22 2024-06-27  123:       k2 = k2 + 1
cb9ce9dc22 2024-06-27  124:       Duel.SendtoHand(k6, nil, REASON_RULE)
cb9ce9dc22 2024-06-27  125:     else
cb9ce9dc22 2024-06-27  126:       if k2 <= k4 then
cb9ce9dc22 2024-06-27  127:         k2 = k2 + 1
cb9ce9dc22 2024-06-27  128:         Duel.SendtoDeck(k6, o2, 0, REASON_RULE)
cb9ce9dc22 2024-06-27  129:       else
cb9ce9dc22 2024-06-27  130:         Debug.ShowHint(k1)
cb9ce9dc22 2024-06-27  131:         o1:Reset()
cb9ce9dc22 2024-06-27  132:         end
cb9ce9dc22 2024-06-27  133:       end
cb9ce9dc22 2024-06-27  134:     end
ad5fabcb17 2024-07-17  135:   --~ 卡_印卡的启动源
ad5fabcb17 2024-07-17  136:   --~ 量_手卡印卡数量的上限
ad5fabcb17 2024-07-17  137:   --~ 量_印卡总数量的上限
cb9ce9dc22 2024-06-27  138:   f["印卡"] = function(o1, o2, o3)
cb9ce9dc22 2024-06-27  139:     local k5
cb9ce9dc22 2024-06-27  140:     k3 = o2
cb9ce9dc22 2024-06-27  141:     k4 = o3 or o2
d4deeab7e2 2024-07-01  142:     Debug.ShowHint("点击对方额外卡组,可以印卡\n手卡只能印" .. k3 .. "张\n最多可印" .. k4 .. "张")
cb9ce9dc22 2024-06-27  143:     k5 = Effect.CreateEffect(o1)
cb9ce9dc22 2024-06-27  144:     k5:SetType(EFFECT_TYPE_IGNITION)
3fe6e2d9f0 2024-07-01  145:     k5:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE)
cb9ce9dc22 2024-06-27  146:     k5:SetTarget(f["不被连锁"])
cb9ce9dc22 2024-06-27  147:     k5:SetRange(LOCATION_EXTRA)
cb9ce9dc22 2024-06-27  148:     k5:SetOperation(f["_印卡"])
cb9ce9dc22 2024-06-27  149:     o1:RegisterEffect(k5)
cb9ce9dc22 2024-06-27  150:     end
cb9ce9dc22 2024-06-27  151:   end
56066f42fa 2024-07-01  152: f["开局说明"] = function()
20dfebb117 2024-07-04  153:   --~ 字_开局说明
20dfebb117 2024-07-04  154:   --~ 量_我方的效果卡
20dfebb117 2024-07-04  155:   --~ 组_我方超量素材
20dfebb117 2024-07-04  156:   --~ 量_对方的效果卡
20dfebb117 2024-07-04  157:   --~ 组_对方超量素材
20dfebb117 2024-07-04  158:   --~ 量_效果卡
20dfebb117 2024-07-04  159:   local k1, k2, k3, k4, k5, k6
20dfebb117 2024-07-04  160:   k2 = Duel.GetMatchingGroupCount(f["是否有效果卡"], 0, d["数_所有区域"], nil, nil)
20dfebb117 2024-07-04  161:   k3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, nil)
bb9bb3e958 2024-06-27  162:   for o1 in aux.Next(k3) do
1bc6d12501 2024-06-27  163:     if f["是否有效果卡"](o1) then
bb9bb3e958 2024-06-27  164:       k2 = k2 + 1
bb9bb3e958 2024-06-27  165:       end
bb9bb3e958 2024-06-27  166:     end
20dfebb117 2024-07-04  167:   k4 = Duel.GetMatchingGroupCount(f["是否有效果卡"], 0, nil, d["数_所有区域"], nil)
20dfebb117 2024-07-04  168:   k5 = Duel.GetOverlayGroup(0, nil, LOCATION_MZONE)
20dfebb117 2024-07-04  169:   for o1 in aux.Next(k5) do
20dfebb117 2024-07-04  170:     if f["是否有效果卡"](o1) then
20dfebb117 2024-07-04  171:       k4 = k4 + 1
20dfebb117 2024-07-04  172:       end
20dfebb117 2024-07-04  173:     end
20dfebb117 2024-07-04  174:   k6 = k2 + k4
20dfebb117 2024-07-04  175:   k1 = "" .. k6 .. "卡 " .. k4 .. "卡 " .. d["字_这一局的规则"]
7e1849c15c 2024-06-27  176:   if d["数_假洗卡"] == 0 then
bb9bb3e958 2024-06-27  177:   else
221188e89a 2024-06-27  178:     k1 = k1 .. "假洗卡 "
7e1849c15c 2024-06-27  179:     end
7e1849c15c 2024-06-27  180:   if d["数_战斗阶段"] == 0 then
221188e89a 2024-06-27  181:     k1 = k1 .. "无战斗阶段 "
221188e89a 2024-06-27  182:     end
221188e89a 2024-06-27  183:   if d["数_人工智能"] == 0 then
221188e89a 2024-06-27  184:     k1 = k1 .. "无人工智能 "
221188e89a 2024-06-27  185:     end
ad5fabcb17 2024-07-17  186:   if d["量_选卡"] then
ad5fabcb17 2024-07-17  187:     k1 = k1 .. "选" .. d["量_选卡"] .. "卡 "
221188e89a 2024-06-27  188:     end
ad5fabcb17 2024-07-17  189:   if d["量_禁格"] then
ad5fabcb17 2024-07-17  190:     k1 = k1 .. "禁" .. d["量_禁格"] .. "格 "
bb9bb3e958 2024-06-27  191:     end
bb9bb3e958 2024-06-27  192:   Debug.ShowHint(k1)
88a69b97e2 2024-06-27  193:   end
88a69b97e2 2024-06-27  194: do
88a69b97e2 2024-06-27  195:   f["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
ad5fabcb17 2024-07-17  196:   --~ 量_开局选卡入手的数量
ad5fabcb17 2024-07-17  197:   --~ 量_禁几个我方主要怪兽格
ad5fabcb17 2024-07-17  198:   --~ 卡_传入对方额外卡组最上面的表侧卡,并将其作为印卡源
ad5fabcb17 2024-07-17  199:   --~ 量_能印几张手卡
ad5fabcb17 2024-07-17  200:   --~ 量_最多能印几张卡
88a69b97e2 2024-06-27  201:   function _G.aux.BeginPuzzle(o1, o2, o3, o4, o5)
88a69b97e2 2024-06-27  202:     f["aux.BeginPuzzle"]()
88a69b97e2 2024-06-27  203:     if o1 then
88a69b97e2 2024-06-27  204:       f["开局选卡入手"](o1)
2f6b499b2b 2024-06-27  205:     else
2f6b499b2b 2024-06-27  206:       end
2f6b499b2b 2024-06-27  207:     if o2 then
2f6b499b2b 2024-06-27  208:       f["禁格"](o2)
2f6b499b2b 2024-06-27  209:     else
2f6b499b2b 2024-06-27  210:       end
2f6b499b2b 2024-06-27  211:     if o3 then
88a69b97e2 2024-06-27  212:       f["印卡"](o3, o4, o5)
2f6b499b2b 2024-06-27  213:     else
2f6b499b2b 2024-06-27  214:       end
56066f42fa 2024-07-01  215:     f["开局说明"]()
929971b270 2024-07-01  216:     end
929971b270 2024-07-01  217:   end
929971b270 2024-07-01  218: Auxiliary.PuzzleOp = function()
929971b270 2024-07-01  219:   Duel.SetLP(0,0)
5eab3312e8 2024-07-15  220:   for i = 1, #d["排_局末提示"] do
5eab3312e8 2024-07-15  221:     Debug.ShowHint(d["排_局末提示"][i])
929971b270 2024-07-01  222:     end
929971b270 2024-07-01  223:   end
929971b270 2024-07-01  224: do
929971b270 2024-07-01  225:   f["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
c5bcca479f 2024-07-17  226:   --~ 局末提示
929971b270 2024-07-01  227:   function _G.Debug.ReloadFieldEnd(...)
929971b270 2024-07-01  228:     f["Debug.ReloadFieldEnd"]()
5eab3312e8 2024-07-15  229:     d["排_局末提示"] = {...}
e14f5fd087 2024-02-14  230:     end
e14f5fd087 2024-02-14  231:   end