游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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