游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in f56b114da9 that are changed by the sequence of edits moving toward check-in 04eb866260:

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