游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 8736d64183 that are changed by the sequence of edits moving toward check-in 3cb69d58d8:

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