游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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