游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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