游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

af6ca14c70 2024-02-13    1: local string = string
af6ca14c70 2024-02-13    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
8388ccc6c5 2024-02-14    7: local s = {}
b05c665024 2024-02-14    8: s["效卡之类排"] = {
8388ccc6c5 2024-02-14    9: TYPE_SPELL
8388ccc6c5 2024-02-14   10: , TYPE_TRAP
8388ccc6c5 2024-02-14   11: , TYPE_EFFECT
8388ccc6c5 2024-02-14   12: }
21cd94e151 2024-02-14   13: s["无效灵摆怪兽之卡编排"] = {
8388ccc6c5 2024-02-14   14: 28363749
8388ccc6c5 2024-02-14   15: , 19474136
8388ccc6c5 2024-02-14   16: , 17390179
8388ccc6c5 2024-02-14   17: , 83980492
ef7b6d6995 2024-02-14   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
ad8a165722 2024-02-14   43: do
ac819336b2 2024-02-14   44:   local h1
14fe398ae9 2024-02-14   45:   --~ “调该效果”的效果
b05c665024 2024-02-14   46:   s["_开局洗卡抽卡"] = function(u1)
ac819336b2 2024-02-14   47:     Duel.ShuffleDeck(0)
ac819336b2 2024-02-14   48:     Duel.Draw(0, h1, REASON_RULE)
ac819336b2 2024-02-14   49:     u1:Reset()
ac819336b2 2024-02-14   50:     end
b05c665024 2024-02-14   51:   s["开局洗卡抽卡"] = function(u1)
ac819336b2 2024-02-14   52:     local h2
033930309a 2024-02-14   53:     --~ 抽卡之数
033930309a 2024-02-14   54:     h1 = u1
b05c665024 2024-02-14   55:     s["开局洗卡抽卡之数"] = u1
ad8a165722 2024-02-14   56:     --~ 效果
ac819336b2 2024-02-14   57:     h2 = Effect.GlobalEffect()
ac819336b2 2024-02-14   58:     h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
ac819336b2 2024-02-14   59:     h2:SetCode(EVENT_ADJUST)
ac819336b2 2024-02-14   60:     h2:SetCondition(aux.TRUE)
b05c665024 2024-02-14   61:     h2:SetOperation(s["_开局洗卡抽卡"])
ac819336b2 2024-02-14   62:     Duel.RegisterEffect(h2, 0)
ac819336b2 2024-02-14   63:     end
ac819336b2 2024-02-14   64:   end
8ab63a7caf 2024-02-14   65: s["不被连锁"] = function()
af6ca14c70 2024-02-13   66:   Duel.SetChainLimit(aux.FALSE)
af6ca14c70 2024-02-13   67:   return true
d3790b56e8 2024-02-13   68:   end
951ea1b58f 2024-02-13   69: do
951ea1b58f 2024-02-13   70:   local h1, h2
951ea1b58f 2024-02-13   71:   --~ 原解邀请
951ea1b58f 2024-02-13   72:   h1 = "残局群181175613"
951ea1b58f 2024-02-13   73:   --~ 二解邀请,备用:圣魔术师
951ea1b58f 2024-02-13   74:   h2 = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
14fe398ae9 2024-02-14   75:     --~ 通关之邀
2da5390976 2024-02-14   76:   s["_通关之邀"] = function()
14fe398ae9 2024-02-14   77:     local h3
14fe398ae9 2024-02-14   78:     --~ 对方之血
14fe398ae9 2024-02-14   79:     h3 = Duel.GetLP(1)
14fe398ae9 2024-02-14   80:     if h3 <= 0 then
14fe398ae9 2024-02-14   81:       if h3 == 0 then
14fe398ae9 2024-02-14   82:         Debug.ShowHint(h1)
14fe398ae9 2024-02-14   83:       else
14fe398ae9 2024-02-14   84:         Debug.ShowHint(h2)
14fe398ae9 2024-02-14   85:         end
14fe398ae9 2024-02-14   86:       end
14fe398ae9 2024-02-14   87:     end
2da5390976 2024-02-14   88:   s["通关之邀"] = function()
033930309a 2024-02-14   89:     local h1
14fe398ae9 2024-02-14   90:     --~ 效果
14fe398ae9 2024-02-14   91:     h1 = Effect.GlobalEffect()
14fe398ae9 2024-02-14   92:     h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
14fe398ae9 2024-02-14   93:     h1:SetCode(EVENT_DAMAGE)
14fe398ae9 2024-02-14   94:     h1:SetCondition(s["_通关之邀"])
14fe398ae9 2024-02-14   95:     h1:SetOperation(aux.NULL)
14fe398ae9 2024-02-14   96:     Duel.RegisterEffect(h1, 0)
14fe398ae9 2024-02-14   97:     end
14fe398ae9 2024-02-14   98:   end
b05c665024 2024-02-14   99: s["是否效卡"] = function(card)
b05c665024 2024-02-14  100:   for i = 1, #s["效卡之类排"] do
b05c665024 2024-02-14  101:     if Card.IsType(card, s["效卡之类排"][i]) then
f4490a058a 2024-02-14  102:       return true
f4490a058a 2024-02-14  103:       end
f4490a058a 2024-02-14  104:     end
f4490a058a 2024-02-14  105:   if Card.IsType(card, TYPE_PENDULUM) then
f4490a058a 2024-02-14  106:     for i = 1, #s["无效灵摆怪兽之卡编排"] do
f4490a058a 2024-02-14  107:       if Card.IsCode(card, s["无效灵摆怪兽之卡编排"][i]) then
f4490a058a 2024-02-14  108:       else
f4490a058a 2024-02-14  109:         return true
f4490a058a 2024-02-14  110:         end
f4490a058a 2024-02-14  111:       end
f4490a058a 2024-02-14  112:     end
f4490a058a 2024-02-14  113:   end
046e84141b 2024-02-14  114: do
033930309a 2024-02-14  115:   local h1
046e84141b 2024-02-14  116:   --~ “调该效果”的效果
046e84141b 2024-02-14  117:   --~ “调该效果”的玩家
b05c665024 2024-02-14  118:   s["_开局选卡入手"] = function(u1, u2)
033930309a 2024-02-14  119:     local h2
b05c665024 2024-02-14  120:     --~ 玩家选定的卡
033930309a 2024-02-14  121:     h2 = Duel.SelectMatchingCard(u2, Card.IsAbleToHand, u2, LOCATION_DECK, 0, h1, h1, nil)
033930309a 2024-02-14  122:     Duel.SendtoHand(h2, nil, REASON_RULE)
033930309a 2024-02-14  123:     u1:Reset()
046e84141b 2024-02-14  124:     end
b05c665024 2024-02-14  125:   s["开局选卡入手"] = function(u1)
033930309a 2024-02-14  126:     local h2
b05c665024 2024-02-14  127:     s["开局选卡入手之数"] = u1
b05c665024 2024-02-14  128:     --~ 开局选卡入手之数
033930309a 2024-02-14  129:     h1 = u1
046e84141b 2024-02-14  130:     --~ 效果
033930309a 2024-02-14  131:     h2 = Effect.GlobalEffect()
033930309a 2024-02-14  132:     h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
033930309a 2024-02-14  133:     h2:SetCode(EVENT_ADJUST)
033930309a 2024-02-14  134:     h2:SetCondition(aux.TRUE)
b05c665024 2024-02-14  135:     h2:SetOperation(s["_开局选卡入手"])
033930309a 2024-02-14  136:     Duel.RegisterEffect(h2, 0)
033930309a 2024-02-14  137:     end
033930309a 2024-02-14  138:   end
1706ec3d64 2024-02-17  139: --~ 禁几个「主怪格」
1706ec3d64 2024-02-17  140: s["禁几个「主怪格」"] = function(u1)
f4490a058a 2024-02-14  141:   local h1
1706ec3d64 2024-02-17  142:   s["量之禁「主怪格」"] = u1
af6ca14c70 2024-02-13  143:   --~ 效果
af6ca14c70 2024-02-13  144:   h1 = Effect.GlobalEffect()
af6ca14c70 2024-02-13  145:   h1:SetCode(EFFECT_USE_EXTRA_MZONE)
1706ec3d64 2024-02-17  146:   h1:SetValue(u1)
1706ec3d64 2024-02-17  147:   Duel.RegisterEffect(h1, 0)
1706ec3d64 2024-02-17  148:   end
1706ec3d64 2024-02-17  149: --~ 禁几个「魔陷格」
1706ec3d64 2024-02-17  150: s["禁几个「魔陷格」"] = function(u1)
1706ec3d64 2024-02-17  151:   local h1
1706ec3d64 2024-02-17  152:   s["量之禁「魔陷格」"] = u1
1706ec3d64 2024-02-17  153:   --~ 效果
1706ec3d64 2024-02-17  154:   h1 = Effect.GlobalEffect()
1706ec3d64 2024-02-17  155:   h1:SetCode(EFFECT_USE_EXTRA_SZONE)
ef883730cb 2024-02-17  156:   h1:SetValue(u1)
ef883730cb 2024-02-17  157:   Duel.RegisterEffect(h1, 0)
ef883730cb 2024-02-17  158:   end
fd436744e5 2024-02-14  159: do
fd436744e5 2024-02-14  160:   s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
b05c665024 2024-02-14  161:   --~ 开局洗卡抽卡之数
ef883730cb 2024-02-17  162:   --~ 禁几个我方怪兽格
ef883730cb 2024-02-17  163:   --~ 禁几个我方魔陷格
fd436744e5 2024-02-14  164:   function _G.Debug.ReloadFieldEnd(u1)
fd436744e5 2024-02-14  165:     s["Debug.ReloadFieldEnd"]()
fd436744e5 2024-02-14  166:     if u1 then
b05c665024 2024-02-14  167:       s["开局洗卡抽卡"](u1)
fd436744e5 2024-02-14  168:       end
fd436744e5 2024-02-14  169:     end
fd436744e5 2024-02-14  170:   end
fd436744e5 2024-02-14  171: do
fd436744e5 2024-02-14  172:   local h1, h2, h3, h4
b05c665024 2024-02-14  173:   --~ 印卡过多之示
b05c665024 2024-02-14  174:   h1 = "印卡过多"
b05c665024 2024-02-14  175:   --~ 现之印卡数
fd436744e5 2024-02-14  176:   h2 = 1
b05c665024 2024-02-14  177:   --~ 印手卡之上限
fd436744e5 2024-02-14  178:   h3 = 0
b05c665024 2024-02-14  179:   --~ 总印卡之上限
fd436744e5 2024-02-14  180:   h4 = 0
fd436744e5 2024-02-14  181:   --~ 「调该效果」的效果
fd436744e5 2024-02-14  182:   --~ 「调该效果」的玩家
b05c665024 2024-02-14  183:   s["_印卡"] = function(u1, u2)
fd436744e5 2024-02-14  184:     local h5, h6
fd436744e5 2024-02-14  185:     --~ 印卡之卡编
fd436744e5 2024-02-14  186:     h5 = Duel.AnnounceCard(u2)
fd436744e5 2024-02-14  187:     --~ 卡
fd436744e5 2024-02-14  188:     h6 = Duel.CreateToken(u2, h5)
fd436744e5 2024-02-14  189:     if h2 <= h3 then
fd436744e5 2024-02-14  190:       h2 = h2 + 1
fd436744e5 2024-02-14  191:       Duel.SendtoHand(h6, nil, REASON_RULE)
fd436744e5 2024-02-14  192:     else
fd436744e5 2024-02-14  193:       if h2 <= h4 then
fd436744e5 2024-02-14  194:         h2 = h2 + 1
2e27c4daad 2024-02-14  195:         Duel.SendtoDeck(h6, u2, 0, REASON_RULE)
7029b5245e 2024-02-14  196:       else
7029b5245e 2024-02-14  197:         Debug.ShowHint(h1)
7029b5245e 2024-02-14  198:         u1:Reset()
7029b5245e 2024-02-14  199:         end
7029b5245e 2024-02-14  200:       end
7029b5245e 2024-02-14  201:     end
b05c665024 2024-02-14  202:   s["印卡"] = function(u1, u2, u3)
7029b5245e 2024-02-14  203:     local h5, h6
7029b5245e 2024-02-14  204:     h3 = u2
7029b5245e 2024-02-14  205:     h4 = u3 or u2
b05c665024 2024-02-14  206:     Debug.ShowHint("点击对方额外卡组可以进行印卡\n手卡只能印" .. h3 .. "张\n最多可以印" .. h4 .. "张")
7029b5245e 2024-02-14  207:     h5 = Effect.CreateEffect(u1)
7029b5245e 2024-02-14  208:     h5:SetType(EFFECT_TYPE_IGNITION)
7029b5245e 2024-02-14  209:     h5:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
7029b5245e 2024-02-14  210:     h5:SetTarget(s["不被连锁"])
7029b5245e 2024-02-14  211:     h5:SetRange(LOCATION_EXTRA)
b05c665024 2024-02-14  212:     h5:SetOperation(s["_印卡"])
7029b5245e 2024-02-14  213:     u1:RegisterEffect(h5)
7029b5245e 2024-02-14  214:     end
7029b5245e 2024-02-14  215:   end
8ab63a7caf 2024-02-14  216: s["开局之示"] = function()
7029b5245e 2024-02-14  217:   local h1, h2, h3
b05c665024 2024-02-14  218:   --~ 此局效卡之数
b05c665024 2024-02-14  219:   h2 = Duel.GetMatchingGroupCount(s["是否效卡"], 0, s["全区"], s["全区"], nil)
7029b5245e 2024-02-14  220:   --~ 超量材组
7029b5245e 2024-02-14  221:   h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
7029b5245e 2024-02-14  222:   for u1 in aux.Next(h3) do
b05c665024 2024-02-14  223:     if s["是否效卡"](u1) then
ef7b6d6995 2024-02-14  224:       h2 = h2 + 1
091f486d37 2024-02-13  225:       end
091f486d37 2024-02-13  226:     end
091f486d37 2024-02-13  227:   --~ 开局说明
b05c665024 2024-02-14  228:   h1 = h2 .. "卡 " .. s["则"]
b05c665024 2024-02-14  229:   if s["伪洗卡"] == 0 then
d1652d7fa4 2024-02-13  230:   else
b05c665024 2024-02-14  231:     h1 = h1 .. "伪洗卡 "
719cb47a61 2024-02-13  232:     end
719cb47a61 2024-02-13  233:   if s["战段"] == 0 then
719cb47a61 2024-02-13  234:     h1 = h1 .. "无战段 "
719cb47a61 2024-02-13  235:     end
ef7b6d6995 2024-02-14  236:   if s["机智"] == 0 then
ef7b6d6995 2024-02-14  237:     h1 = h1 .. "无机智 "
719cb47a61 2024-02-13  238:     end
b05c665024 2024-02-14  239:   if s["开局选卡入手之数"] then
b05c665024 2024-02-14  240:     h1 = h1 .. "选" .. s["开局选卡入手之数"] .. "卡 "
f7d8ee14bc 2024-02-13  241:     end
f7d8ee14bc 2024-02-13  242:   if s["禁格之数"] then
f7d8ee14bc 2024-02-13  243:     h1 = h1 .. "禁" .. s["禁格之数"] .. "格 "
f7d8ee14bc 2024-02-13  244:     end
b05c665024 2024-02-14  245:   if s["开局洗卡抽卡之数"] then
b05c665024 2024-02-14  246:     h1 = h1 .. "抽" .. s["开局洗卡抽卡之数"] .. "卡 "
091f486d37 2024-02-13  247:     end
091f486d37 2024-02-13  248:   Debug.ShowHint(h1)
091f486d37 2024-02-13  249:   end
1301c8be40 2024-02-13  250: do
1301c8be40 2024-02-13  251:   s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
ef883730cb 2024-02-17  252:   --~ 开局洗卡抽卡之数
b05c665024 2024-02-14  253:   --~ 开局选卡入手之数
ef883730cb 2024-02-17  254:   --~ 传入对方额外卡组最上面的表侧卡,并将其作为印卡源
ef883730cb 2024-02-17  255:   --~ 能往手卡印几张卡
ef883730cb 2024-02-17  256:   --~ 最多能印几张卡
0f9865b09c 2024-02-14  257:   function _G.aux.BeginPuzzle(u1, u2, u3, u4, u5)
1301c8be40 2024-02-13  258:     s["aux.BeginPuzzle"]()
1301c8be40 2024-02-13  259:     if u1 then
b05c665024 2024-02-14  260:       s["开局选卡入手"](u1)
1301c8be40 2024-02-13  261:       end
1301c8be40 2024-02-13  262:     if u2 then
1301c8be40 2024-02-13  263:       s["禁格"](u2)
0f9865b09c 2024-02-14  264:       end
0f9865b09c 2024-02-14  265:     if u3 then
b05c665024 2024-02-14  266:       s["印卡"](u3, u4, u5)
0f9865b09c 2024-02-14  267:     else
e14f5fd087 2024-02-14  268:       end
e14f5fd087 2024-02-14  269:     s["开局之示"]()
1301c8be40 2024-02-13  270:     s["通关之邀"]()
1301c8be40 2024-02-13  271:     end
1301c8be40 2024-02-13  272:   end