游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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