游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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