游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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