游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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