游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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