游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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