游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in ca60ae70a2 that are changed by the sequence of edits moving toward check-in 84f106ff09:

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