游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in a28dbc1e51 that are changed by the sequence of edits moving toward check-in 66a03a682a:

                         1: 
                         2: local str = {}
                         3: 
                         4: local cache_1
                         5: local cache_2
                         6: local cache_3
                         7: local cache_4
                         8: local cache_5
                         9: local cache_6
                        10: local cache_7
                        11: local cache_8
                        12: local cache_9
                        13: 
                        14: local i
                        15: 
                        16: _G.fun = {}
                        17: 
                        18: ---------------------------------
                        19: 
                        20: str["二解弹窗"] = "QB:「你居然二解了,请加群告诉我怎么二解。」"
                        21: str["原解弹窗"] = "残局群181175613"
                        22: 
                        23: str["规则"] = ""
                        24: 
                        25: str["规则表"] = {}
                        26: str["规则表"][3] = "大师3 "
                        27: str["规则表"][4] = "新大师 "
                        28: str["规则表"][5] = "大师2020 "
                        29: 
                        30: str["当前印卡数"] = 1
                        31: 
                        32: str["印卡过多的弹窗"] = "印卡过多!"
                        33: 
                        34: str["印卡弹窗1"] = "点击对方额外卡组可以进行印卡。\n手卡只能印 "
                        35: str["印卡弹窗2"] = " 张。\n最多可以印 "
                        36: str["印卡弹窗3"] = " 张"
                        37: 
                        38: str["不洗牌"] = false
                        39: str["无BP"] = false
                        40: 
                        41: str["不洗牌的说明"] = "伪洗牌 "
                        42: str["无BP的说明"] = "无BP "
                        43: 
                        44: str["开局说明"] = false
                        45: 
                        46: str["这个残局的效果卡数量"] = 0
                        47: str["效果卡数量的后缀"] = "卡 "
                        48: 
                        49: str["开局添加手卡"] = false
                        50: str["选卡的前缀"] = "选"
                        51: str["选卡的后缀"] = "卡 "
                        52: 
                        53: str["禁格"] = false
                        54: str["禁格的前缀"] = "禁"
                        55: str["禁格的后缀"] = "格 "
                        56: 
                        57: str["效果卡的种类表"] = {}
                        58: 
                        59: str["效果卡的种类表"][1] = TYPE_SPELL
                        60: str["效果卡的种类表"][2] = TYPE_TRAP
                        61: str["效果卡的种类表"][3] = TYPE_EFFECT
                        62: 
                        63: str["无效果灵摆怪兽表"] = {}
                        64: 
                        65: str["无效果灵摆怪兽表"][1] = 28363749
                        66: str["无效果灵摆怪兽表"][2] = 19474136
                        67: str["无效果灵摆怪兽表"][3] = 17390179
                        68: str["无效果灵摆怪兽表"][4] = 83980492
                        69: 
                        70: cache_1 = 0
                        71: 
                        72: cache_1 = cache_1 + LOCATION_HAND
                        73: cache_1 = cache_1 + LOCATION_MZONE
                        74: cache_1 = cache_1 + LOCATION_SZONE
                        75: cache_1 = cache_1 + LOCATION_GRAVE
                        76: cache_1 = cache_1 + LOCATION_REMOVED
                        77: 
                        78: str["除卡组与额外卡组以外的区域"] = cache_1
                        79: 
                        80: cache_1 = cache_1 + LOCATION_DECK
                        81: cache_1 = cache_1 + LOCATION_EXTRA
                        82: 
                        83: str["所有区域"] = cache_1
                        84: 
                        85: ---------------------------------
                        86: 
                        87: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
                        88: 
                        89: Debug.ReloadFieldBegin = function(str_1, str_2) --{
                        90:   
                        91:   str["不洗牌"] = str_1 & DUEL_PSEUDO_SHUFFLE
                        92:   
                        93:   str["无BP"] = str_1 & DUEL_ATTACK_FIRST_TURN
                        94:   
                        95:   if str_2 then --{
                        96:     
                        97:     str["规则"] = str["规则表"][str_2]
                        98:     
                        99:     --}
                       100:     
                       101:   else --{
                       102:     
                       103:     str["规则"] = str["规则表"][5]
                       104:     
                       105:     end --}
                       106:     
                       107:   fun["Debug.ReloadFieldBegin"](str_1, str_2)
                       108:   
                       109:   end --}
                       110:   
                       111: fun["aux.BeginPuzzle"] = aux.BeginPuzzle
                       112: 
a28dbc1e51 2023-07-20  113: aux.BeginPuzzle = function() --{
                       114:   
                       115:   fun["aux.BeginPuzzle"]()
                       116:   
                       117:   fun["开局说明"]()
                       118:   
                       119:   fun["通关邀请"]()
                       120:   
                       121:   end --}
                       122:   
                       123: fun["通关邀请"] = function() --{
                       124:   
                       125:   effect_1 = Effect.GlobalEffect()
                       126:   
                       127:   effect_1:SetType(EFFECT_TYPE_FIELD
                       128:   + EFFECT_TYPE_CONTINUOUS)
                       129:   
                       130:   effect_1:SetCode(EVENT_DAMAGE)
                       131:   
                       132:   function cache_1() --{
                       133:     
                       134:     cache_1 = Duel.GetLP(1)
                       135:     
                       136:     if cache_1 <= 0 then --{
                       137:       
                       138:       if cache_1 == 0 then --{
                       139:         
                       140:         --}
                       141:         
                       142:       else  --{
                       143:         
                       144:         Debug.ShowHint(str["二解弹窗"])
                       145:         
                       146:         end --}
                       147:         
                       148:       Debug.ShowHint(str["原解弹窗"])
                       149:       
                       150:       --}
                       151:       
                       152:     else --{
                       153:       
                       154:       return false
                       155:       
                       156:       end --}
                       157:       
                       158:     end --}
                       159:     
                       160:   effect_1:SetCondition(cache_1)
                       161:   
                       162:   effect_1:SetOperation(aux.NULL)
                       163:   
                       164:   Duel.RegisterEffect(effect_1
                       165:   , 0)
                       166:   
                       167:   end --}
                       168:   
                       169: fun["是否效果卡"] = function(card) --{
                       170:   
                       171:   cache_1 = #str["效果卡的种类表"]
                       172:   
                       173:   for i = 1, cache_1 do --{
                       174:     
                       175:     cache_1 = Card.IsType(card, str["效果卡的种类表"][i])
                       176:     
                       177:     if cache_1 then --{
                       178:       
                       179:       return true
                       180:       end --}
                       181:       
                       182:     end --}
                       183:     
                       184:   cache_1 = Card.IsType(card, TYPE_PENDULUM)
                       185:   
                       186:   if cache_1 then --{
                       187:     
                       188:     cache_1 = #str["无效果灵摆怪兽表"]
                       189:     
                       190:     for i = 1, cache_1 do --{
                       191:       
                       192:       cache_1 = Card.IsCode(card, str["无效果灵摆怪兽表"][i])
                       193:       
                       194:       if cache_1 then --{
                       195:         
                       196:         --}
                       197:         
                       198:       else  --{
                       199:         
                       200:         return true
                       201:         
                       202:         end --}
                       203:         
                       204:       end --}
                       205:       
                       206:     end --}
                       207:     
                       208:   return false
                       209:   
                       210:   end --}
                       211:   
                       212: fun["开局说明"] = function() --{
                       213:   
                       214:   str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"],0,str["所有区域"],str["所有区域"],nil)
                       215:   
                       216:   cache_1 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
                       217:   
                       218:   for k in aux.Next(cache_1) do --{
                       219:     
                       220:     cache_1 = fun["是否效果卡"](k)
                       221:     
                       222:     if cache_1 then --{
                       223:       
                       224:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
                       225:       
                       226:       end --}
                       227:       
                       228:     end --}
                       229:     
                       230:   str["开局说明"] = ""
                       231:   
                       232:   str["开局说明"] = str["开局说明"] .. str["这个残局的效果卡数量"]
                       233:   str["开局说明"] = str["开局说明"] .. str["效果卡数量的后缀"]
                       234:   
                       235:   str["开局说明"] = str["开局说明"] .. str["规则"]
                       236:   
                       237:   if str["不洗牌"] == 0 then --{
                       238:     
                       239:     --}
                       240:     
                       241:   else --{
                       242:     
                       243:     str["开局说明"] = str["开局说明"] .. str["不洗牌的说明"]
                       244:     
                       245:     end --}
                       246:     
                       247:   if str["无BP"] == 0 then --{
                       248:     
                       249:     str["开局说明"] = str["开局说明"] .. str["无BP的说明"]
                       250:     
                       251:     end --}
                       252:     
                       253:   if str["开局添加手卡"] then --{
                       254:     
                       255:     str["开局说明"] = str["开局说明"] .. str["选卡的前缀"]
                       256:     str["开局说明"] = str["开局说明"] .. str["开局添加手卡"]
                       257:     str["开局说明"] = str["开局说明"] .. str["选卡的后缀"]
                       258:     
                       259:     end --}
                       260:     
                       261:   if str["禁格"] then --{
                       262:     
                       263:     str["开局说明"] = str["开局说明"] .. str["禁格的前缀"]
                       264:     str["开局说明"] = str["开局说明"] .. str["禁格"]
                       265:     str["开局说明"] = str["开局说明"] .. str["禁格的后缀"]
                       266:     
                       267:     end --}
                       268:     
                       269:   Debug.ShowHint(str["开局说明"])
                       270:   
                       271:   end --}
                       272:   
                       273: fun["开局添加手卡"] = function(str_1) --{
                       274:   
                       275:   str["开局添加手卡"] = str_1
                       276:   
                       277:   effect_1 = Effect.GlobalEffect()
                       278:   
                       279:   effect_1:SetType(EFFECT_TYPE_FIELD
                       280:   + EFFECT_TYPE_CONTINUOUS)
                       281:   
                       282:   effect_1:SetCode(EVENT_ADJUST)
                       283:   
                       284:   effect_1:SetCondition(aux.TRUE)
                       285:   
                       286:   function cache_1(effect_event
                       287:   , player_who_activate_the_effect) --{
                       288:     
                       289:     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
                       290:     , Card.IsAbleToHand
                       291:     , player_who_activate_the_effect
                       292:     , LOCATION_DECK
                       293:     , 0
                       294:     , str_1
                       295:     , str_1
                       296:     , nil)
                       297:     
                       298:     Duel.SendtoHand(str["玩家选定的卡"]
                       299:     , nil
                       300:     , REASON_RULE)
                       301:     
                       302:     effect_event:Reset()
                       303:     
                       304:     end --}
                       305:     
                       306:   effect_1:SetOperation(cache_1)
                       307:   
                       308:   Duel.RegisterEffect(effect_1
                       309:   , 0)
                       310:   
                       311:   end --}
                       312:   
                       313: fun["禁格"] = function(str_1) --{
                       314:   
                       315:   str["禁格"] = str_1
                       316:   
                       317:   effect_1 = Effect.GlobalEffect()
                       318:   
                       319:   effect_1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       320:   
                       321:   effect_1:SetValue(str_1)
                       322:   
                       323:   Duel.RegisterEffect(effect_1,0)
                       324:   
                       325:   end --}
                       326:   
                       327: fun["印卡"] = function(str_1, str_2, str_3) --{
                       328:   
                       329:   if str_3 then --{
                       330:     
                       331:     --}
                       332:     
                       333:   else --{
                       334:     
                       335:     str_3 = str_2
                       336:     
                       337:     end --}
                       338:     
                       339:   str["印卡弹窗1"] = str["印卡弹窗1"] .. str_2
                       340:   str["印卡弹窗1"] = str["印卡弹窗1"] .. str["印卡弹窗2"]
                       341:   str["印卡弹窗1"] = str["印卡弹窗1"] .. str_3
                       342:   str["印卡弹窗1"] = str["印卡弹窗1"] .. str["印卡弹窗3"]
                       343:   
                       344:   Debug.ShowHint(str["印卡弹窗1"])
                       345:   
                       346:   effect_1 = Effect.CreateEffect(str_1)
                       347:   
                       348:   effect_1:SetType(EFFECT_TYPE_IGNITION)
                       349:   
                       350:   effect_1:SetProperty(EFFECT_FLAG_BOTH_SIDE
                       351:   + EFFECT_FLAG_UNCOPYABLE
                       352:   + EFFECT_FLAG_CANNOT_NEGATE
                       353:   + EFFECT_FLAG_CANNOT_DISABLE)
                       354:   
                       355:   cache_1 = function() --{
                       356:     
                       357:     Duel.SetChainLimit(aux.FALSE)
                       358:     
                       359:     return true
                       360:     
                       361:     end --}
                       362:     
                       363:   effect_1:SetTarget(cache_1)
                       364:   
                       365:   effect_1:SetRange(LOCATION_EXTRA)
                       366:   
                       367:   function print_hand(effect_event
                       368:   , player_who_activate_the_effect) --{
                       369:     
                       370:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
                       371:     
                       372:     card = Duel.CreateToken(player_who_activate_the_effect
                       373:     , announce_card)
                       374:     
                       375:     if str["当前印卡数"] <= str_2 then --{
                       376:       
                       377:       str["当前印卡数"] = str["当前印卡数"] + 1
                       378:       
                       379:       Duel.SendtoHand(card,nil,REASON_RULE)
                       380:       
                       381:       --}
                       382:       
                       383:     else --{
                       384:       
                       385:       if str["当前印卡数"] <= str_3 then --{
                       386:         
                       387:         str["当前印卡数"] = str["当前印卡数"] + 1
                       388:         
                       389:         Duel.Remove(card,POS_FACEUP,REASON_RULE)
                       390:         
                       391:         Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
                       392:         
                       393:         --}
                       394:         
                       395:       else --{
                       396:         
                       397:         Debug.ShowHint(str["印卡过多的弹窗"])
                       398:         
                       399:         effect_event:Reset()
                       400:         
                       401:         end --}
                       402:         
                       403:       end --}
                       404:       
                       405:     end --}
                       406:     
                       407:   effect_1:SetOperation(print_hand)
                       408:   
                       409:   str_1:RegisterEffect(effect_1)
                       410:   
                       411:   end --}
a28dbc1e51 2023-07-20  412:   
a28dbc1e51 2023-07-20  413: 
                       414: