游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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