游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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