游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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