游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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