游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 75bd4dfc8f that are changed by the sequence of edits moving toward check-in 4e8f89ad97:

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