游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 7c21defa68 that are changed by the sequence of edits moving toward check-in 45478ef823:

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