游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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