游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 5593fe6ed7 that are changed by the sequence of edits moving toward check-in debc51c10d:

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