游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 588454a9f9 that are changed by the sequence of edits moving toward check-in 1fb42895ff:

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