游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

                         1: str = {}
                         2: fun = {}
                         3: 
                         4: str["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
                         5: 
                         6: Debug.ReloadFieldBegin = function(str_1, str_2)
                         7:   str["不洗牌"] = str_1 & DUEL_PSEUDO_SHUFFLE
                         8:   str["无BP"] = str_1 & DUEL_ATTACK_FIRST_TURN
                         9: 
                        10:   if str_2 then
                        11:     if str_2 == 3 then
                        12:     str["规则"] = "大师3 "
                        13:     elseif str_2 == 4 then
                        14:       str["规则"] = "新大师 "
                        15:     elseif str_2 == 5 then
                        16:       str["规则"] = "大师2020 "
                        17:       end
                        18:   else
                        19:     str["规则"] = "大师2020 "
                        20:     end
                        21:   str["Debug.ReloadFieldBegin"](str_1, str_2)
                        22:   end
                        23: 
                        24: fun["通关邀请"] = function(str_1, str_2)
                        25:   local effect_1
                        26:   effect_1 = Effect.GlobalEffect()
                        27:   effect_1:SetType(EFFECT_TYPE_FIELD
                        28:     + EFFECT_TYPE_CONTINUOUS)
                        29:   effect_1:SetCode(EVENT_DAMAGE)
                        30:   function cache_1()
                        31:     if str_1 then
                        32:       str["QB"] = 1
                        33:       str_1 = false
                        34:       end
                        35: 
                        36:     cache_1 = Duel.GetLP(1)
                        37:     if cache_1 <= 0 then
                        38: 
                        39:       if cache_1 < 0 then
                        40:         if str_2 then
                        41:           Debug.ShowHint(str_2)
                        42:           end
                        43:         end
                        44: 
                        45:       cache_1 = true
                        46:     else
                        47:       cache_1 = false
                        48:       end
                        49:     return cache_1
                        50:     end
                        51:   effect_1:SetCondition(cache_1)
f0ffe5edcc 2023-07-08   52:   function cache_1()
                        53:     if str["QB"] then
                        54: 
                        55:       end
f0ffe5edcc 2023-07-08   56:     Debug.ShowHint("残局群181175613")
                        57:     return
                        58:     end
                        59:   effect_1:SetOperation(cache_1)
                        60: 
                        61:   Duel.RegisterEffect(effect_1
                        62:     , 0)
                        63:   end
                        64: 
                        65: fun["是否效果卡"] = function(card)
                        66: 
                        67:   cache_1 = Card.IsType(card, TYPE_SPELL)
                        68:   cache_2 = Card.IsType(card, TYPE_TRAP)
                        69:   cache_3 = Card.IsType(card, TYPE_EFFECT)
                        70: 
                        71:   if cache_1
                        72:   or cache_2
                        73:   or cache_3 then
                        74:     return true
                        75:     end
                        76:   cache_1 = Card.IsType(card, TYPE_PENDULUM)
                        77: 
                        78:   if cache_1 then
                        79:     cache_1 = Card.IsCode(card, 28363749)
                        80:     cache_2 = Card.IsCode(card, 19474136)
                        81:     cache_3 = Card.IsCode(card, 17390179)
                        82:     cache_4 = Card.IsCode(card, 83980492)
                        83:     if cache_1
                        84:     or cache_2
                        85:     or cache_3
                        86:     or cache_4 then
                        87:     else
                        88:       return true
                        89:       end
                        90:     end
                        91: 
                        92:   return false
                        93:   end
                        94: 
                        95: fun["开局说明"] = function()
                        96:   if str["开局说明吗"] == 1 then
                        97:     return
                        98:   else
                        99:     str["开局说明吗"] = 1
                       100:     end
                       101: 
                       102:   cache_1 = 0
                       103:   cache_1 = cache_1 + LOCATION_DECK
                       104:   cache_1 = cache_1 + LOCATION_HAND
                       105:   cache_1 = cache_1 + LOCATION_MZONE
                       106:   cache_1 = cache_1 + LOCATION_SZONE
                       107:   cache_1 = cache_1 + LOCATION_GRAVE
                       108:   cache_1 = cache_1 + LOCATION_REMOVED
                       109:   cache_1 = cache_1 + LOCATION_EXTRA
                       110: 
                       111:   str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"],0,cache_1,cache_1,nil)
                       112: 
                       113:   cache_1 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
                       114: 
                       115:   for k in aux.Next(cache_1) do
                       116:     cache_1 = fun["是否效果卡"](k)
                       117:     if cache_1 then
                       118:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
                       119:       end
                       120:     end
                       121: 
                       122:   str["开局说明"] =""
                       123: 
                       124:   str["开局说明"] = str["开局说明"] .. str["这个残局的效果卡数量"]
                       125:   str["开局说明"] = str["开局说明"] .. "卡 "
                       126: 
                       127:   str["开局说明"] = str["开局说明"] .. str["规则"]
                       128: 
                       129:   if str["不洗牌"] == 0 then
                       130:   else
                       131:     str["开局说明"] = str["开局说明"] .. "伪洗牌 "
                       132:     end
                       133:   if str["无BP"] == 0 then
                       134:     str["开局说明"] = str["开局说明"] .. "无BP "
                       135:     end
                       136: 
                       137:   if str["开局添加手卡"] then
                       138:     str["开局说明"] = str["开局说明"] .. "选"
                       139:     str["开局说明"] = str["开局说明"] .. str["开局添加手卡"]
                       140:     str["开局说明"] = str["开局说明"] .. "卡 "
                       141:     end
                       142: 
                       143:   if str["禁格"] then
                       144:     str["开局说明"] = str["开局说明"] .. "禁"
                       145:     str["开局说明"] = str["开局说明"] .. str["禁格"]
                       146:     str["开局说明"] = str["开局说明"] .. "格 "
                       147:     end
                       148: 
                       149:   if str["印卡"] then
                       150:     str["开局说明"] = str["开局说明"] .. "印卡 "
                       151:     end
                       152: 
                       153:   Debug.ShowHint(str["开局说明"])
                       154:   fun["通关邀请"]()
                       155:   end
                       156: 
                       157: fun["开局添加手卡"] = function(str_1)
                       158:   str["开局添加手卡"] = str_1
                       159:   effect_1 = Effect.GlobalEffect()
                       160:   effect_1:SetType(EFFECT_TYPE_FIELD
                       161:     + EFFECT_TYPE_CONTINUOUS)
                       162:   effect_1:SetCode(EVENT_ADJUST)
                       163:   effect_1:SetCountLimit(1)
                       164:   function cache_1()
                       165:     if str["已添加手卡"] == 1 then
                       166:       return false
                       167:     else
                       168:       str["已添加手卡"] = 1
                       169:       return true
                       170:       end
                       171: 
                       172:     end
                       173:   effect_1:SetCondition(cache_1)
                       174:   function cache_1(effect_event
                       175:     , player_who_activate_the_effect)
                       176: 
                       177:     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
                       178:        , Card.IsAbleToHand
                       179:        , player_who_activate_the_effect
                       180:        , LOCATION_DECK
                       181:        , 0
                       182:        , str_1
                       183:        , str_1
                       184:        , nil)
                       185:     Duel.SendtoHand(str["玩家选定的卡"]
                       186:       , nil
                       187:       , REASON_RULE)
                       188:     end
                       189:   effect_1:SetOperation(cache_1)
                       190:   Duel.RegisterEffect(effect_1
                       191:     , 0)
                       192:   fun["开局说明"]()
                       193:   end
                       194: 
                       195: fun["禁格"] = function(str_1)
                       196:   str["禁格"] = str_1
                       197:   effect_1 = Effect.GlobalEffect()
                       198:   effect_1:SetType(EFFECT_TYPE_FIELD)
                       199:   effect_1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       200:   effect_1:SetValue(str_1)
                       201:   Duel.RegisterEffect(effect_1,0)
                       202:   end
                       203: 
                       204: fun["印卡"] = function(str_1, str_2, str_3)
                       205:   str["印卡"] = 1
                       206: 
                       207:   if str_3 then
                       208:   else
                       209:     str_3 = str_2
                       210:     end
                       211: 
                       212:   str["当前印卡数"] = 1
                       213: 
                       214:   effect_1 = Effect.CreateEffect(str_1)
                       215: 
                       216:   effect_1:SetType(EFFECT_TYPE_IGNITION)
                       217: 
                       218:   effect_1:SetProperty(EFFECT_FLAG_BOTH_SIDE
                       219:     + EFFECT_FLAG_UNCOPYABLE
                       220:     + EFFECT_FLAG_CANNOT_NEGATE
                       221:     + EFFECT_FLAG_CANNOT_DISABLE)
                       222: 
                       223: 
                       224:   cache_1 = function()
                       225:     Duel.SetChainLimit(aux.FALSE)
                       226:     return true
                       227:     end
                       228: 
                       229:   effect_1:SetTarget(cache_1)
                       230: 
                       231:   effect_1:SetRange(LOCATION_EXTRA)
                       232: 
                       233:   function print_hand(effect_event
                       234:       , player_who_activate_the_effect)
                       235:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
                       236:     card = Duel.CreateToken(player_who_activate_the_effect
                       237:       , announce_card)
                       238:     if str["当前印卡数"] <= str_2 then
                       239:       str["当前印卡数"] = str["当前印卡数"] + 1
                       240:       Duel.SendtoHand(card,nil,REASON_RULE)
                       241:     else
                       242:       if str["当前印卡数"] <= str_3 then
                       243:         str["当前印卡数"] = str["当前印卡数"] + 1
                       244:         Duel.Remove(card,POS_FACEUP,REASON_RULE)
                       245:         Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
                       246:       else
                       247:         Debug.ShowHint("印卡过多!")
                       248:         end
                       249: 
                       250:       end
                       251:     end
                       252:   effect_1:SetOperation(print_hand)
                       253:   str_1:RegisterEffect(effect_1)
                       254:   end
                       255: 
                       256: 
                       257: --~ fun["QB"] = function(str_1)
                       258: --~   effect_1 = Effect.GlobalEffect()
                       259: --~   effect_1:SetType(EFFECT_TYPE_FIELD
                       260: --~     + EFFECT_TYPE_CONTINUOUS)
                       261: --~   effect_1:SetCode(EVENT_ADJUST)
                       262: --~   effect_1:SetCountLimit(1)
                       263: --~   function cache_1()
                       264: --~     if str["已添加手卡"] == 1 then
                       265: --~       return false
                       266: --~     else
                       267: --~       str["已添加手卡"] = 1
                       268: --~       return true
                       269: --~       end
                       270: 
                       271: --~     end
                       272: --~   effect_1:SetCondition(cache_1)
                       273: --~   announce_card = Duel.AnnounceCard(0)
                       274: --~   card = Duel.CreateToken(0
                       275: --~     , announce_card)
                       276: --~   end