游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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