游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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