游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

e59d27b43b 2023-07-17    1: local str = {}
6f9888787e 2023-08-02    2: local string = string
6f9888787e 2023-08-02    3: local table = table
6bc844fccc 2024-02-13    4: local s = {}
6f9888787e 2023-08-02    5: _G.fun = {}
ef7b6d6995 2024-02-14    6: s["效牌之类排"] = {
ef7b6d6995 2024-02-14    7:   TYPE_SPELL
ef7b6d6995 2024-02-14    8:   , TYPE_TRAP
ef7b6d6995 2024-02-14    9:   , TYPE_EFFECT
a2e76b01c2 2024-01-26   10: }
ad4e2a7693 2023-08-02   11: str["无效果灵摆怪兽表"] = {
674765ddf2 2024-02-13   12:   28363749,
674765ddf2 2024-02-13   13:   19474136,
674765ddf2 2024-02-13   14:   17390179,
674765ddf2 2024-02-13   15:   83980492,
674765ddf2 2024-02-13   16: }
ef7b6d6995 2024-02-14   17: s["全区"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA
ad4e2a7693 2023-08-02   18: --第一层-------------------------------
dd1a253607 2023-08-02   19: local cache_1
dd1a253607 2023-08-02   20: local cache_2
dd1a253607 2023-08-02   21: local cache_3
dd1a253607 2023-08-02   22: local cache_4
dd1a253607 2023-08-02   23: local cache_5
dd1a253607 2023-08-02   24: local cache_6
dd1a253607 2023-08-02   25: local cache_7
dd1a253607 2023-08-02   26: local cache_8
dd1a253607 2023-08-02   27: local cache_9
70edc71d15 2023-08-02   28: local _
1301c8be40 2024-02-13   29: do
1301c8be40 2024-02-13   30:   local h1
1301c8be40 2024-02-13   31:   --~ 则对
1301c8be40 2024-02-13   32:   h1 = {
1301c8be40 2024-02-13   33:   [3] = "大师3 "
1301c8be40 2024-02-13   34:   , [4] = "新大师 "
1301c8be40 2024-02-13   35:   , [5] = "大师2020 "
1301c8be40 2024-02-13   36:   }
1301c8be40 2024-02-13   37:   s["Debug.ReloadFieldBegin"] = _G.Debug.ReloadFieldBegin
1301c8be40 2024-02-13   38:   --~ 模
1301c8be40 2024-02-13   39:   --~ 则数
1301c8be40 2024-02-13   40:   function _G.Debug.ReloadFieldBegin(u1, u2)
719cb47a61 2024-02-13   41:     s["伪洗牌"] = u1 & DUEL_PSEUDO_SHUFFLE
719cb47a61 2024-02-13   42:     s["战段"] = u1 & DUEL_ATTACK_FIRST_TURN
1301c8be40 2024-02-13   43:     s["机智"] = u1 & DUEL_SIMPLE_AI
1301c8be40 2024-02-13   44:     if u2 then
1301c8be40 2024-02-13   45:       s["则"] = h1[u2]
1301c8be40 2024-02-13   46:     else
1301c8be40 2024-02-13   47:       s["则"] = h1[5]
1301c8be40 2024-02-13   48:       end
1301c8be40 2024-02-13   49:     s["Debug.ReloadFieldBegin"](u1, u2)
1301c8be40 2024-02-13   50:     end
1301c8be40 2024-02-13   51:   end
d1652d7fa4 2024-02-13   52: function s["开局洗牌抽牌"](u1)
1301c8be40 2024-02-13   53:   local h1, h2
d1652d7fa4 2024-02-13   54:   s["开局洗牌抽牌之数"] = u1
af6ca14c70 2024-02-13   55:   --~ 效果
af6ca14c70 2024-02-13   56:   h1 = Effect.GlobalEffect()
af6ca14c70 2024-02-13   57:   h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
af6ca14c70 2024-02-13   58:   h1:SetCode(EVENT_ADJUST)
af6ca14c70 2024-02-13   59:   h1:SetCondition(aux.TRUE)
d1652d7fa4 2024-02-13   60:   -- 随机抽牌
951ea1b58f 2024-02-13   61:   --~ 调该效果的效果
951ea1b58f 2024-02-13   62:   function h2(u2)
f56b114da9 2024-02-13   63:     Duel.ShuffleDeck(0)
f56b114da9 2024-02-13   64:     Duel.Draw(0, u1, REASON_RULE)
951ea1b58f 2024-02-13   65:     u2:Reset()
af6ca14c70 2024-02-13   66:     end
af6ca14c70 2024-02-13   67:   h1:SetOperation(h2)
af6ca14c70 2024-02-13   68:   Duel.RegisterEffect(h1, 0)
f56b114da9 2024-02-13   69:   end
46bd1a8cd5 2024-02-13   70: fun["一_该效果不能被连锁"] = function()
674765ddf2 2024-02-13   71:   Duel.SetChainLimit(aux.FALSE)
674765ddf2 2024-02-13   72:   return true
d3790b56e8 2024-02-13   73:   end
951ea1b58f 2024-02-13   74: do
951ea1b58f 2024-02-13   75:   local h1, h2
951ea1b58f 2024-02-13   76:   --~ 原解邀请
951ea1b58f 2024-02-13   77:   h1 = "残局群181175613"
951ea1b58f 2024-02-13   78:   --~ 二解邀请,备用:圣魔术师
951ea1b58f 2024-02-13   79:   h2 = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
6bc844fccc 2024-02-13   80:   function s["通关之邀"]()
951ea1b58f 2024-02-13   81:     local h3, h4
951ea1b58f 2024-02-13   82:     --~ 效果
951ea1b58f 2024-02-13   83:     h3 = Effect.GlobalEffect()
951ea1b58f 2024-02-13   84:     h3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
951ea1b58f 2024-02-13   85:     h3:SetCode(EVENT_DAMAGE)
951ea1b58f 2024-02-13   86:     --~ 通关之邀
951ea1b58f 2024-02-13   87:     function h4()
951ea1b58f 2024-02-13   88:       local h5
951ea1b58f 2024-02-13   89:       --~ 对方之血
951ea1b58f 2024-02-13   90:       h5 = Duel.GetLP(1)
951ea1b58f 2024-02-13   91:       if h5 <= 0 then
951ea1b58f 2024-02-13   92:         if h5 == 0 then
951ea1b58f 2024-02-13   93:           Debug.ShowHint(h1)
951ea1b58f 2024-02-13   94:         else
951ea1b58f 2024-02-13   95:           Debug.ShowHint(h2)
951ea1b58f 2024-02-13   96:           end
951ea1b58f 2024-02-13   97:       else
951ea1b58f 2024-02-13   98:         return false
951ea1b58f 2024-02-13   99:         end
951ea1b58f 2024-02-13  100:       end
951ea1b58f 2024-02-13  101:     h3:SetCondition(h4)
951ea1b58f 2024-02-13  102:     h3:SetOperation(aux.NULL)
951ea1b58f 2024-02-13  103:     Duel.RegisterEffect(h3, 0)
951ea1b58f 2024-02-13  104:     end
951ea1b58f 2024-02-13  105:   end
d1652d7fa4 2024-02-13  106: fun["一_是否效果牌"] = function(card)
d1652d7fa4 2024-02-13  107:   for i = 1, #str["效果牌的种类表"] do
d1652d7fa4 2024-02-13  108:     if Card.IsType(card, str["效果牌的种类表"][i]) then
46bd1a8cd5 2024-02-13  109:       return true
46bd1a8cd5 2024-02-13  110:     end
46bd1a8cd5 2024-02-13  111:   end
46bd1a8cd5 2024-02-13  112:   if Card.IsType(card, TYPE_PENDULUM) then
46bd1a8cd5 2024-02-13  113:     for i = 1, #str["无效果灵摆怪兽表"] do
46bd1a8cd5 2024-02-13  114:       if Card.IsCode(card, str["无效果灵摆怪兽表"][i]) then
46bd1a8cd5 2024-02-13  115:       else
46bd1a8cd5 2024-02-13  116:         return true
46bd1a8cd5 2024-02-13  117:       end
46bd1a8cd5 2024-02-13  118:     end
46bd1a8cd5 2024-02-13  119:   end
f56b114da9 2024-02-13  120: end
d1652d7fa4 2024-02-13  121: function s["开局选牌入手"](u1)
a6c06c688b 2024-02-13  122:   local h1, h2
d1652d7fa4 2024-02-13  123:   str["开局选牌入手之数"] = u1
a6c06c688b 2024-02-13  124:   --~ 效果
a6c06c688b 2024-02-13  125:   h1 = Effect.GlobalEffect()
a6c06c688b 2024-02-13  126:   h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
a6c06c688b 2024-02-13  127:   h1:SetCode(EVENT_ADJUST)
a6c06c688b 2024-02-13  128:   h1:SetCondition(aux.TRUE)
a6c06c688b 2024-02-13  129:   --~ 调该效果的效果
a6c06c688b 2024-02-13  130:   --~ 调该效果的玩家
a6c06c688b 2024-02-13  131:   function h2(u2, u3)
a6c06c688b 2024-02-13  132:     local h3
d1652d7fa4 2024-02-13  133:     --~ 玩家选定的牌
a6c06c688b 2024-02-13  134:     h3 = Duel.SelectMatchingCard(u3, Card.IsAbleToHand, u3, LOCATION_DECK, 0, u1, u1, nil)
a6c06c688b 2024-02-13  135:     Duel.SendtoHand(h3, nil, REASON_RULE)
a6c06c688b 2024-02-13  136:     u2:Reset()
a6c06c688b 2024-02-13  137:     end
a6c06c688b 2024-02-13  138:   h1:SetOperation(h2)
a6c06c688b 2024-02-13  139:   Duel.RegisterEffect(h1, 0)
a6c06c688b 2024-02-13  140:   end
fbb83a06ea 2024-02-13  141: function s["禁格"](u1)
f7d8ee14bc 2024-02-13  142:   local h1
f7d8ee14bc 2024-02-13  143:   s["禁格之数"] = u1
af6ca14c70 2024-02-13  144:   --~ 效果
af6ca14c70 2024-02-13  145:   h1 = Effect.GlobalEffect()
af6ca14c70 2024-02-13  146:   h1:SetCode(EFFECT_USE_EXTRA_MZONE)
af6ca14c70 2024-02-13  147:   h1:SetValue(u1)
af6ca14c70 2024-02-13  148:   Duel.RegisterEffect(h1, 0)
af6ca14c70 2024-02-13  149:   end
155b00bc3f 2024-01-23  150: --第二层-------------------------------
e59d27b43b 2023-07-17  151: local cache_1
e59d27b43b 2023-07-17  152: local cache_2
e59d27b43b 2023-07-17  153: local cache_3
e59d27b43b 2023-07-17  154: local cache_4
e59d27b43b 2023-07-17  155: local cache_5
27cb01cd8e 2023-07-17  156: local cache_6
27cb01cd8e 2023-07-17  157: local cache_7
27cb01cd8e 2023-07-17  158: local cache_8
27cb01cd8e 2023-07-17  159: local cache_9
89674b235f 2023-08-02  160: local _
1301c8be40 2024-02-13  161: do
1301c8be40 2024-02-13  162:   s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
d1652d7fa4 2024-02-13  163:   --~ 开局洗牌抽牌之数
1301c8be40 2024-02-13  164:   function _G.Debug.ReloadFieldEnd(u1)
1301c8be40 2024-02-13  165:     s["Debug.ReloadFieldEnd"]()
1301c8be40 2024-02-13  166:     if u1 then
d1652d7fa4 2024-02-13  167:       s["开局洗牌抽牌"](u1)
1301c8be40 2024-02-13  168:       end
0dd37b287e 2024-02-13  169:     end
0dd37b287e 2024-02-13  170:   end
d1652d7fa4 2024-02-13  171: fun["二_印牌"] = function(u1, u2, u3)
43ea8c8217 2024-02-13  172:   u3 = u3 or u2
674765ddf2 2024-02-13  173:   Debug.ShowHint(
d1652d7fa4 2024-02-13  174:     "点击对方额外牌组可以进行印牌。\n手牌只能印 "
f56b114da9 2024-02-13  175:       .. u2
674765ddf2 2024-02-13  176:       .. " 张。\n最多可以印 "
04eb866260 2024-02-13  177:       .. u3
674765ddf2 2024-02-13  178:       .. " 张"
674765ddf2 2024-02-13  179:   )
f56b114da9 2024-02-13  180:   str["效果"] = Effect.CreateEffect(u1)
d1652d7fa4 2024-02-13  181:   str["当前印牌数"] = 1
674765ddf2 2024-02-13  182:   str["效果"]:SetType(EFFECT_TYPE_IGNITION)
674765ddf2 2024-02-13  183:   str["效果"]:SetProperty(
674765ddf2 2024-02-13  184:     EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE
674765ddf2 2024-02-13  185:   )
674765ddf2 2024-02-13  186:   str["效果"]:SetTarget(fun["一_该效果不能被连锁"])
674765ddf2 2024-02-13  187:   str["效果"]:SetRange(LOCATION_EXTRA)
46bd1a8cd5 2024-02-13  188:   function print_hand(effect_event, player_who_activate_the_effect)
674765ddf2 2024-02-13  189:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
674765ddf2 2024-02-13  190:     card = Duel.CreateToken(player_who_activate_the_effect, announce_card)
d1652d7fa4 2024-02-13  191:     if str["当前印牌数"] <= u2 then
d1652d7fa4 2024-02-13  192:       str["当前印牌数"] = str["当前印牌数"] + 1
674765ddf2 2024-02-13  193:       Duel.SendtoHand(card, nil, REASON_RULE)
46bd1a8cd5 2024-02-13  194:     else
d1652d7fa4 2024-02-13  195:       if str["当前印牌数"] <= u3 then
d1652d7fa4 2024-02-13  196:         str["当前印牌数"] = str["当前印牌数"] + 1
674765ddf2 2024-02-13  197:         Duel.Remove(card, POS_FACEUP, REASON_RULE)
674765ddf2 2024-02-13  198:         Duel.SendtoDeck(card, player_who_activate_the_effect, 0, REASON_RULE)
46bd1a8cd5 2024-02-13  199:       else
d1652d7fa4 2024-02-13  200:         Debug.ShowHint("印牌过多!")
674765ddf2 2024-02-13  201:         effect_event:Reset()
46bd1a8cd5 2024-02-13  202:       end
46bd1a8cd5 2024-02-13  203:     end
46bd1a8cd5 2024-02-13  204:   end
674765ddf2 2024-02-13  205:   str["效果"]:SetOperation(print_hand)
f56b114da9 2024-02-13  206:   u1:RegisterEffect(str["效果"])
46bd1a8cd5 2024-02-13  207: end
46bd1a8cd5 2024-02-13  208: fun["二_开局说明"] = function()
ef7b6d6995 2024-02-14  209:   local h1, h2, h3
ef7b6d6995 2024-02-14  210:   --~ 此局的效牌数
ef7b6d6995 2024-02-14  211:   h2 = Duel.GetMatchingGroupCount(fun["是否效果牌"], 0, s["全区"], s["全区"], nil)
ef7b6d6995 2024-02-14  212:   --~ 超量材组
ef7b6d6995 2024-02-14  213:   h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
ef7b6d6995 2024-02-14  214:   for u1 in aux.Next(h3) do
ef7b6d6995 2024-02-14  215:     if fun["一_是否效果牌"](u1) then
ef7b6d6995 2024-02-14  216:       h2 = h2 + 1
091f486d37 2024-02-13  217:       end
091f486d37 2024-02-13  218:     end
091f486d37 2024-02-13  219:   --~ 开局说明
d1652d7fa4 2024-02-13  220:   h1 = str["这个残局的效果牌数量"] .. "牌 " .. str["规则"]
719cb47a61 2024-02-13  221:   if s["伪洗牌"] == 0 then
091f486d37 2024-02-13  222:   else
091f486d37 2024-02-13  223:     h1 = h1 .. "伪洗牌 "
091f486d37 2024-02-13  224:     end
719cb47a61 2024-02-13  225:   if s["战段"] == 0 then
719cb47a61 2024-02-13  226:     h1 = h1 .. "无战段 "
d1652d7fa4 2024-02-13  227:     end
ef7b6d6995 2024-02-14  228:   if s["机智"] == 0 then
ef7b6d6995 2024-02-14  229:     h1 = h1 .. "无机智 "
d1652d7fa4 2024-02-13  230:     end
d1652d7fa4 2024-02-13  231:   if s["开局选牌入手之数"] then
d1652d7fa4 2024-02-13  232:     h1 = h1 .. "选" .. s["开局选牌入手之数"] .. "牌 "
f7d8ee14bc 2024-02-13  233:     end
f7d8ee14bc 2024-02-13  234:   if s["禁格之数"] then
f7d8ee14bc 2024-02-13  235:     h1 = h1 .. "禁" .. s["禁格之数"] .. "格 "
f7d8ee14bc 2024-02-13  236:     end
d1652d7fa4 2024-02-13  237:   if s["开局洗牌抽牌之数"] then
d1652d7fa4 2024-02-13  238:     h1 = h1 .. "抽" .. s["开局洗牌抽牌之数"] .. "牌 "
091f486d37 2024-02-13  239:     end
091f486d37 2024-02-13  240:   Debug.ShowHint(h1)
091f486d37 2024-02-13  241:   end
1301c8be40 2024-02-13  242: do
1301c8be40 2024-02-13  243:   s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
d1652d7fa4 2024-02-13  244:   --~ 开局选牌入手之数
1301c8be40 2024-02-13  245:   --~ 禁格之数
1301c8be40 2024-02-13  246:   function _G.aux.BeginPuzzle(u1, u2)
1301c8be40 2024-02-13  247:     s["aux.BeginPuzzle"]()
1301c8be40 2024-02-13  248:     if u1 then
d1652d7fa4 2024-02-13  249:       s["开局选牌入手"](u1)
1301c8be40 2024-02-13  250:       end
1301c8be40 2024-02-13  251:     if u2 then
1301c8be40 2024-02-13  252:       s["禁格"](u2)
1301c8be40 2024-02-13  253:       end
1301c8be40 2024-02-13  254:     fun["二_开局说明"]()
1301c8be40 2024-02-13  255:     s["通关之邀"]()
1301c8be40 2024-02-13  256:     end
1301c8be40 2024-02-13  257:   end
091f486d37 2024-02-13  258: --兼容层-------------------------------
d1652d7fa4 2024-02-13  259: fun["印牌"] = fun["二_印牌"]
d1652d7fa4 2024-02-13  260: fun["开局添加手牌"] = s["开局选牌入手"]
d1652d7fa4 2024-02-13  261: fun["是否效果牌"] = fun["一_是否效果牌"]
fbb83a06ea 2024-02-13  262: fun["禁格"] = s["禁格"]
d1652d7fa4 2024-02-13  263: fun["随机抽牌"] = s["开局洗牌抽牌"]