游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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