游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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