游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 8c94409d80 that are changed by the sequence of edits moving toward check-in 0db518c6bf:

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