游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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