游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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 = {}
8388ccc6c5 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)
719cb47a61 2024-02-13   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
ad8a165722 2024-02-14   44:   function s["开局洗牌抽牌"](u1)
ad8a165722 2024-02-14   45:     local h1, h2
ad8a165722 2024-02-14   46:     s["开局洗牌抽牌之数"] = u1
ad8a165722 2024-02-14   47:     --~ 效果
ad8a165722 2024-02-14   48:     h1 = Effect.GlobalEffect()
ad8a165722 2024-02-14   49:     h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
ad8a165722 2024-02-14   50:     h1:SetCode(EVENT_ADJUST)
ad8a165722 2024-02-14   51:     h1:SetCondition(aux.TRUE)
ad8a165722 2024-02-14   52:     -- 随机抽牌
ad8a165722 2024-02-14   53:     --~ 调该效果的效果
ad8a165722 2024-02-14   54:     function h2(u2)
ad8a165722 2024-02-14   55:       Duel.ShuffleDeck(0)
ad8a165722 2024-02-14   56:       Duel.Draw(0, u1, REASON_RULE)
ad8a165722 2024-02-14   57:       u2:Reset()
ad8a165722 2024-02-14   58:       end
ad8a165722 2024-02-14   59:     h1:SetOperation(h2)
ad8a165722 2024-02-14   60:     Duel.RegisterEffect(h1, 0)
e14f5fd087 2024-02-14   61:     end
e14f5fd087 2024-02-14   62:   end
e14f5fd087 2024-02-14   63: function s.["不被连锁"]()
951ea1b58f 2024-02-13   64:   Duel.SetChainLimit(aux.FALSE)
951ea1b58f 2024-02-13   65:   return true
951ea1b58f 2024-02-13   66:   end
951ea1b58f 2024-02-13   67: do
951ea1b58f 2024-02-13   68:   local h1, h2
951ea1b58f 2024-02-13   69:   --~ 原解邀请
951ea1b58f 2024-02-13   70:   h1 = "残局群181175613"
951ea1b58f 2024-02-13   71:   --~ 二解邀请,备用:圣魔术师
951ea1b58f 2024-02-13   72:   h2 = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
6bc844fccc 2024-02-13   73:   function s["通关之邀"]()
951ea1b58f 2024-02-13   74:     local h3, h4
951ea1b58f 2024-02-13   75:     --~ 效果
951ea1b58f 2024-02-13   76:     h3 = Effect.GlobalEffect()
951ea1b58f 2024-02-13   77:     h3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
951ea1b58f 2024-02-13   78:     h3:SetCode(EVENT_DAMAGE)
951ea1b58f 2024-02-13   79:     --~ 通关之邀
951ea1b58f 2024-02-13   80:     function h4()
951ea1b58f 2024-02-13   81:       local h5
951ea1b58f 2024-02-13   82:       --~ 对方之血
951ea1b58f 2024-02-13   83:       h5 = Duel.GetLP(1)
951ea1b58f 2024-02-13   84:       if h5 <= 0 then
951ea1b58f 2024-02-13   85:         if h5 == 0 then
951ea1b58f 2024-02-13   86:           Debug.ShowHint(h1)
951ea1b58f 2024-02-13   87:         else
951ea1b58f 2024-02-13   88:           Debug.ShowHint(h2)
951ea1b58f 2024-02-13   89:           end
951ea1b58f 2024-02-13   90:       else
951ea1b58f 2024-02-13   91:         return false
951ea1b58f 2024-02-13   92:         end
951ea1b58f 2024-02-13   93:       end
951ea1b58f 2024-02-13   94:     h3:SetCondition(h4)
951ea1b58f 2024-02-13   95:     h3:SetOperation(aux.NULL)
951ea1b58f 2024-02-13   96:     Duel.RegisterEffect(h3, 0)
951ea1b58f 2024-02-13   97:     end
951ea1b58f 2024-02-13   98:   end
f4490a058a 2024-02-14   99: function s.["是否效牌"](card)
f4490a058a 2024-02-14  100:   for i = 1, #s["效牌之类排"] do
f4490a058a 2024-02-14  101:     if Card.IsType(card, s["效牌之类排"][i]) then
951ea1b58f 2024-02-13  102:       return true
f4490a058a 2024-02-14  103:       end
951ea1b58f 2024-02-13  104:     end
951ea1b58f 2024-02-13  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
951ea1b58f 2024-02-13  108:       else
951ea1b58f 2024-02-13  109:         return true
f4490a058a 2024-02-14  110:         end
a6c06c688b 2024-02-13  111:       end
a6c06c688b 2024-02-13  112:     end
a6c06c688b 2024-02-13  113:   end
d1652d7fa4 2024-02-13  114: function s["开局选牌入手"](u1)
a6c06c688b 2024-02-13  115:   local h1, h2
d1652d7fa4 2024-02-13  116:   str["开局选牌入手之数"] = u1
a6c06c688b 2024-02-13  117:   --~ 效果
a6c06c688b 2024-02-13  118:   h1 = Effect.GlobalEffect()
a6c06c688b 2024-02-13  119:   h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
a6c06c688b 2024-02-13  120:   h1:SetCode(EVENT_ADJUST)
a6c06c688b 2024-02-13  121:   h1:SetCondition(aux.TRUE)
a6c06c688b 2024-02-13  122:   --~ 调该效果的效果
a6c06c688b 2024-02-13  123:   --~ 调该效果的玩家
a6c06c688b 2024-02-13  124:   function h2(u2, u3)
a6c06c688b 2024-02-13  125:     local h3
d1652d7fa4 2024-02-13  126:     --~ 玩家选定的牌
a6c06c688b 2024-02-13  127:     h3 = Duel.SelectMatchingCard(u3, Card.IsAbleToHand, u3, LOCATION_DECK, 0, u1, u1, nil)
a6c06c688b 2024-02-13  128:     Duel.SendtoHand(h3, nil, REASON_RULE)
a6c06c688b 2024-02-13  129:     u2:Reset()
a6c06c688b 2024-02-13  130:     end
a6c06c688b 2024-02-13  131:   h1:SetOperation(h2)
a6c06c688b 2024-02-13  132:   Duel.RegisterEffect(h1, 0)
a6c06c688b 2024-02-13  133:   end
fbb83a06ea 2024-02-13  134: function s["禁格"](u1)
af6ca14c70 2024-02-13  135:   local h1
f7d8ee14bc 2024-02-13  136:   s["禁格之数"] = u1
af6ca14c70 2024-02-13  137:   --~ 效果
af6ca14c70 2024-02-13  138:   h1 = Effect.GlobalEffect()
af6ca14c70 2024-02-13  139:   h1:SetCode(EFFECT_USE_EXTRA_MZONE)
af6ca14c70 2024-02-13  140:   h1:SetValue(u1)
af6ca14c70 2024-02-13  141:   Duel.RegisterEffect(h1, 0)
af6ca14c70 2024-02-13  142:   end
1301c8be40 2024-02-13  143: do
1301c8be40 2024-02-13  144:   s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
d1652d7fa4 2024-02-13  145:   --~ 开局洗牌抽牌之数
1301c8be40 2024-02-13  146:   function _G.Debug.ReloadFieldEnd(u1)
1301c8be40 2024-02-13  147:     s["Debug.ReloadFieldEnd"]()
1301c8be40 2024-02-13  148:     if u1 then
d1652d7fa4 2024-02-13  149:       s["开局洗牌抽牌"](u1)
d1652d7fa4 2024-02-13  150:       end
d1652d7fa4 2024-02-13  151:     end
d1652d7fa4 2024-02-13  152:   end
e14f5fd087 2024-02-14  153: function s.["印牌"](u1, u2, u3)
e14f5fd087 2024-02-14  154:   local h1, h2, h3
e14f5fd087 2024-02-14  155:   u3 = u3 or u2
e14f5fd087 2024-02-14  156:   Debug.ShowHint("点击对方额外牌组可以进行印牌。\n手牌只能印 " .. u2 .. " 张。\n最多可以印 " .. u3 .. " 张")
e14f5fd087 2024-02-14  157:   h1 = Effect.CreateEffect(u1)
e14f5fd087 2024-02-14  158:   --~ 现之印牌数
e14f5fd087 2024-02-14  159:   h2 = 1
e14f5fd087 2024-02-14  160:   h1:SetType(EFFECT_TYPE_IGNITION)
e14f5fd087 2024-02-14  161:   h1:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
e14f5fd087 2024-02-14  162:   h1:SetTarget(s["不被连锁"])
e14f5fd087 2024-02-14  163:   h1:SetRange(LOCATION_EXTRA)
e14f5fd087 2024-02-14  164:   -- 印牌
e14f5fd087 2024-02-14  165:   --~ 调该效果的效果
e14f5fd087 2024-02-14  166:   --~ 调该效果的玩家
e14f5fd087 2024-02-14  167:   function h3(u4, u5)
e14f5fd087 2024-02-14  168:     local h4, h5
e14f5fd087 2024-02-14  169:     --~ 印卡之卡编
e14f5fd087 2024-02-14  170:     h4 = Duel.AnnounceCard(u5)
e14f5fd087 2024-02-14  171:     --~ 卡
e14f5fd087 2024-02-14  172:     h5 = Duel.CreateToken(u5, h4)
e14f5fd087 2024-02-14  173:     if h2 <= u2 then
e14f5fd087 2024-02-14  174:       h2 = h2 + 1
e14f5fd087 2024-02-14  175:       Duel.SendtoHand(h5, nil, REASON_RULE)
e14f5fd087 2024-02-14  176:     else
e14f5fd087 2024-02-14  177:       if h2 <= u3 then
e14f5fd087 2024-02-14  178:         h2 = h2 + 1
e14f5fd087 2024-02-14  179:         Duel.Remove(h5, POS_FACEUP, REASON_RULE)
e14f5fd087 2024-02-14  180:         Duel.SendtoDeck(card, u5, 0, REASON_RULE)
e14f5fd087 2024-02-14  181:       else
e14f5fd087 2024-02-14  182:         Debug.ShowHint("印牌过多")
e14f5fd087 2024-02-14  183:         u4:Reset()
e14f5fd087 2024-02-14  184:         end
e14f5fd087 2024-02-14  185:       end
e14f5fd087 2024-02-14  186:     end
e14f5fd087 2024-02-14  187:   h1:SetOperation(h3)
e14f5fd087 2024-02-14  188:   u1:RegisterEffect(h1)
e14f5fd087 2024-02-14  189:   end
e14f5fd087 2024-02-14  190: function s.["开局之示"]()
e14f5fd087 2024-02-14  191:   local h1, h2, h3
e14f5fd087 2024-02-14  192:   --~ 此局效牌之数
e14f5fd087 2024-02-14  193:   h2 = Duel.GetMatchingGroupCount(s["是否效牌"], 0, s["全区"], s["全区"], nil)
ef7b6d6995 2024-02-14  194:   --~ 超量材组
ef7b6d6995 2024-02-14  195:   h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
ef7b6d6995 2024-02-14  196:   for u1 in aux.Next(h3) do
e14f5fd087 2024-02-14  197:     if s["是否效牌"](u1) then
ef7b6d6995 2024-02-14  198:       h2 = h2 + 1
091f486d37 2024-02-13  199:       end
091f486d37 2024-02-13  200:     end
091f486d37 2024-02-13  201:   --~ 开局说明
e14f5fd087 2024-02-14  202:   h1 = h2 .. "牌 " .. s["则"]
719cb47a61 2024-02-13  203:   if s["伪洗牌"] == 0 then
091f486d37 2024-02-13  204:   else
091f486d37 2024-02-13  205:     h1 = h1 .. "伪洗牌 "
091f486d37 2024-02-13  206:     end
719cb47a61 2024-02-13  207:   if s["战段"] == 0 then
719cb47a61 2024-02-13  208:     h1 = h1 .. "无战段 "
d1652d7fa4 2024-02-13  209:     end
ef7b6d6995 2024-02-14  210:   if s["机智"] == 0 then
ef7b6d6995 2024-02-14  211:     h1 = h1 .. "无机智 "
d1652d7fa4 2024-02-13  212:     end
d1652d7fa4 2024-02-13  213:   if s["开局选牌入手之数"] then
d1652d7fa4 2024-02-13  214:     h1 = h1 .. "选" .. s["开局选牌入手之数"] .. "牌 "
f7d8ee14bc 2024-02-13  215:     end
f7d8ee14bc 2024-02-13  216:   if s["禁格之数"] then
f7d8ee14bc 2024-02-13  217:     h1 = h1 .. "禁" .. s["禁格之数"] .. "格 "
f7d8ee14bc 2024-02-13  218:     end
d1652d7fa4 2024-02-13  219:   if s["开局洗牌抽牌之数"] then
d1652d7fa4 2024-02-13  220:     h1 = h1 .. "抽" .. s["开局洗牌抽牌之数"] .. "牌 "
091f486d37 2024-02-13  221:     end
091f486d37 2024-02-13  222:   Debug.ShowHint(h1)
091f486d37 2024-02-13  223:   end
1301c8be40 2024-02-13  224: do
1301c8be40 2024-02-13  225:   s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
d1652d7fa4 2024-02-13  226:   --~ 开局选牌入手之数
1301c8be40 2024-02-13  227:   --~ 禁格之数
1301c8be40 2024-02-13  228:   function _G.aux.BeginPuzzle(u1, u2)
1301c8be40 2024-02-13  229:     s["aux.BeginPuzzle"]()
1301c8be40 2024-02-13  230:     if u1 then
d1652d7fa4 2024-02-13  231:       s["开局选牌入手"](u1)
1301c8be40 2024-02-13  232:       end
1301c8be40 2024-02-13  233:     if u2 then
1301c8be40 2024-02-13  234:       s["禁格"](u2)
1301c8be40 2024-02-13  235:       end
e14f5fd087 2024-02-14  236:     s["开局之示"]()
1301c8be40 2024-02-13  237:     s["通关之邀"]()
1301c8be40 2024-02-13  238:     end
1301c8be40 2024-02-13  239:   end