游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Origin for each line in script/c0.lua from check-in 7c21defa68:

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