游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

6d182363a9 2023-06-30    1: str = {}
6d182363a9 2023-06-30    2: fun = {}
d95f494908 2023-06-30    3: 
d95f494908 2023-06-30    4: str["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
d95f494908 2023-06-30    5: 
d95f494908 2023-06-30    6: Debug.ReloadFieldBegin = function(str_1, str_2)
29959a9986 2023-06-30    7:   str["不洗牌"] = str_1 & DUEL_PSEUDO_SHUFFLE
4be88097db 2023-07-05    8:   str["无BP"] = str_1 & DUEL_ATTACK_FIRST_TURN
bf6cc894c2 2023-06-30    9: 
935340b0b8 2023-06-30   10:   if str_2 then
935340b0b8 2023-06-30   11:     if str_2 == 3 then
36a332440b 2023-06-30   12:     str["规则"] = "大师3 "
935340b0b8 2023-06-30   13:     elseif str_2 == 4 then
36a332440b 2023-06-30   14:       str["规则"] = "新大师 "
8210af4dfb 2023-07-01   15:     elseif str_2 == 5 then
8210af4dfb 2023-07-01   16:       str["规则"] = "大师2020 "
935340b0b8 2023-06-30   17:       end
ab8e787d19 2023-06-30   18:   else
36a332440b 2023-06-30   19:     str["规则"] = "大师2020 "
935340b0b8 2023-06-30   20:     end
2ed229a931 2023-06-30   21:   str["Debug.ReloadFieldBegin"](str_1, str_2)
d95f494908 2023-06-30   22:   end
d95f494908 2023-06-30   23: 
6d182363a9 2023-06-30   24: fun["通关邀请"] = function()
c3f96fe46f 2023-06-29   25:   local effect_1
c3f96fe46f 2023-06-29   26:   effect_1 = Effect.GlobalEffect()
c3f96fe46f 2023-06-29   27:   effect_1:SetType(EFFECT_TYPE_FIELD
c3f96fe46f 2023-06-29   28:     + EFFECT_TYPE_CONTINUOUS)
c3f96fe46f 2023-06-29   29:   effect_1:SetCode(EVENT_DAMAGE)
c3f96fe46f 2023-06-29   30:   function cache_1()
c3f96fe46f 2023-06-29   31:     cache_1 = Duel.GetLP(1)
fe3054fa0e 2023-06-29   32:     if cache_1 <= 0 then
c3f96fe46f 2023-06-29   33:       cache_1 = true
c3f96fe46f 2023-06-29   34:     else
c3f96fe46f 2023-06-29   35:       cache_1 = false
c3f96fe46f 2023-06-29   36:       end
c3f96fe46f 2023-06-29   37:     return cache_1
c3f96fe46f 2023-06-29   38:     end
c3f96fe46f 2023-06-29   39:   effect_1:SetCondition(cache_1)
c3f96fe46f 2023-06-29   40:   function cache_1()
c3f96fe46f 2023-06-29   41:     Debug.ShowHint("残局群181175613")
c3f96fe46f 2023-06-29   42:     return
c3f96fe46f 2023-06-29   43:     end
c3f96fe46f 2023-06-29   44:   effect_1:SetOperation(cache_1)
91bea80f83 2023-06-29   45: 
c2795c660d 2023-06-29   46:   Duel.RegisterEffect(effect_1
c2795c660d 2023-06-29   47:     , 0)
c2795c660d 2023-06-29   48:   end
c2795c660d 2023-06-29   49: 
78d7353d8f 2023-06-29   50: fun["是否效果卡"] = function(card)
d2dde12476 2023-06-29   51: 
d2dde12476 2023-06-29   52:   cache_1 = Card.IsType(card, TYPE_SPELL)
d2dde12476 2023-06-29   53:   cache_2 = Card.IsType(card, TYPE_TRAP)
d2dde12476 2023-06-29   54:   cache_3 = Card.IsType(card, TYPE_EFFECT)
d2dde12476 2023-06-29   55: 
d2dde12476 2023-06-29   56:   if cache_1
d2dde12476 2023-06-29   57:   or cache_2
6f3de2e0f3 2023-07-04   58:   or cache_3 then
e7130db7c4 2023-06-29   59:     return true
e7130db7c4 2023-06-29   60:     end
cc327b2c58 2023-07-04   61:   cache_1 = Card.IsType(card, TYPE_PENDULUM)
cc327b2c58 2023-07-04   62: 
cc327b2c58 2023-07-04   63:   if cache_1 then
d8d61432b6 2023-07-04   64:     cache_1 = Card.IsCode(card, 28363749)
d8d61432b6 2023-07-04   65:     cache_2 = Card.IsCode(card, 19474136)
1d09fc48b2 2023-07-04   66:     cache_3 = Card.IsCode(card, 17390179)
1d09fc48b2 2023-07-04   67:     cache_4 = Card.IsCode(card, 83980492)
1d09fc48b2 2023-07-04   68:     if cache_1
1d09fc48b2 2023-07-04   69:     or cache_2
1d09fc48b2 2023-07-04   70:     or cache_3
1d09fc48b2 2023-07-04   71:     or cache_4 then
5c3d90f056 2023-07-04   72:     else
1d09fc48b2 2023-07-04   73:       return true
1d09fc48b2 2023-07-04   74:       end
cc327b2c58 2023-07-04   75:     end
cc327b2c58 2023-07-04   76: 
e7130db7c4 2023-06-29   77:   return false
e7130db7c4 2023-06-29   78:   end
e7130db7c4 2023-06-29   79: 
6d182363a9 2023-06-30   80: fun["开局说明"] = function()
567a672978 2023-07-01   81:   if str["开局说明吗"] == 1 then
7592a88912 2023-07-01   82:     return
7592a88912 2023-07-01   83:   else
567a672978 2023-07-01   84:     str["开局说明吗"] = 1
7592a88912 2023-07-01   85:     end
7592a88912 2023-07-01   86: 
ff0aefc8cb 2023-06-30   87:   cache_1 = 0
0c34cecc84 2023-06-30   88:   cache_1 = cache_1 + LOCATION_DECK
0c34cecc84 2023-06-30   89:   cache_1 = cache_1 + LOCATION_HAND
0c34cecc84 2023-06-30   90:   cache_1 = cache_1 + LOCATION_MZONE
0c34cecc84 2023-06-30   91:   cache_1 = cache_1 + LOCATION_SZONE
0c34cecc84 2023-06-30   92:   cache_1 = cache_1 + LOCATION_GRAVE
0c34cecc84 2023-06-30   93:   cache_1 = cache_1 + LOCATION_REMOVED
0c34cecc84 2023-06-30   94:   cache_1 = cache_1 + LOCATION_EXTRA
ff0aefc8cb 2023-06-30   95: 
ff0aefc8cb 2023-06-30   96:   str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"],0,cache_1,cache_1,nil)
72f53d3a1a 2023-06-30   97: 
4e48d105e5 2023-06-30   98:   cache_1 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
72f53d3a1a 2023-06-30   99: 
4e48d105e5 2023-06-30  100:   for k in aux.Next(cache_1) do
4e48d105e5 2023-06-30  101:     cache_1 = fun["是否效果卡"](k)
4e48d105e5 2023-06-30  102:     if cache_1 then
4e48d105e5 2023-06-30  103:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
4e48d105e5 2023-06-30  104:       end
4e48d105e5 2023-06-30  105:     end
06ee05c026 2023-06-30  106: 
06ee05c026 2023-06-30  107:   str["开局说明"] =""
06ee05c026 2023-06-30  108: 
4f50d4f4dc 2023-06-29  109:   str["开局说明"] = str["开局说明"] .. str["这个残局的效果卡数量"]
36a332440b 2023-06-30  110:   str["开局说明"] = str["开局说明"] .. "卡 "
8338c6d2e6 2023-06-30  111: 
8338c6d2e6 2023-06-30  112:   str["开局说明"] = str["开局说明"] .. str["规则"]
8338c6d2e6 2023-06-30  113: 
3fd449f7a7 2023-06-30  114:   if str["不洗牌"] == 0 then
3fd449f7a7 2023-06-30  115:   else
36a332440b 2023-06-30  116:     str["开局说明"] = str["开局说明"] .. "伪洗牌 "
15b94d8040 2023-06-30  117:     end
be78d8f253 2023-07-05  118:   if str["无BP"] == 0 then
be78d8f253 2023-07-05  119:     str["开局说明"] = str["开局说明"] .. "无BP "
be78d8f253 2023-07-05  120:     end
15b94d8040 2023-06-30  121: 
15b94d8040 2023-06-30  122:   if str["开局添加手卡"] then
36a332440b 2023-06-30  123:     str["开局说明"] = str["开局说明"] .. "选"
15b94d8040 2023-06-30  124:     str["开局说明"] = str["开局说明"] .. str["开局添加手卡"]
36a332440b 2023-06-30  125:     str["开局说明"] = str["开局说明"] .. "卡 "
36a332440b 2023-06-30  126:     end
36a332440b 2023-06-30  127: 
6a26890958 2023-07-06  128:   if str["禁格"] then
38127bc74b 2023-07-06  129:     str["开局说明"] = str["开局说明"] .. "禁"
38127bc74b 2023-07-06  130:     str["开局说明"] = str["开局说明"] .. str["禁格"]
38127bc74b 2023-07-06  131:     str["开局说明"] = str["开局说明"] .. "格 "
6a26890958 2023-07-06  132:     end
6a26890958 2023-07-06  133: 
647c058939 2023-06-30  134:   Debug.ShowHint(str["开局说明"])
dbd1c234df 2023-07-05  135:   fun["通关邀请"]()
32fa479c6d 2023-06-30  136:   end
32fa479c6d 2023-06-30  137: 
45467c0d0c 2023-06-30  138: fun["开局添加手卡"] = function(str_1)
32fa479c6d 2023-06-30  139:   str["开局添加手卡"] = str_1
32fa479c6d 2023-06-30  140:   effect_1 = Effect.GlobalEffect()
32fa479c6d 2023-06-30  141:   effect_1:SetType(EFFECT_TYPE_FIELD
32fa479c6d 2023-06-30  142:     + EFFECT_TYPE_CONTINUOUS)
32fa479c6d 2023-06-30  143:   effect_1:SetCode(EVENT_ADJUST)
32fa479c6d 2023-06-30  144:   effect_1:SetCountLimit(1)
32fa479c6d 2023-06-30  145:   function cache_1()
287a20cec6 2023-07-01  146:     if str["已添加手卡"] == 1 then
287a20cec6 2023-07-01  147:       return false
287a20cec6 2023-07-01  148:     else
287a20cec6 2023-07-01  149:       str["已添加手卡"] = 1
287a20cec6 2023-07-01  150:       return true
287a20cec6 2023-07-01  151:       end
287a20cec6 2023-07-01  152: 
32fa479c6d 2023-06-30  153:     end
32fa479c6d 2023-06-30  154:   effect_1:SetCondition(cache_1)
32fa479c6d 2023-06-30  155:   function cache_1(effect_event
32fa479c6d 2023-06-30  156:     , player_who_activate_the_effect)
737aacba66 2023-06-30  157: 
32fa479c6d 2023-06-30  158:     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
32fa479c6d 2023-06-30  159:        , Card.IsAbleToHand
32fa479c6d 2023-06-30  160:        , player_who_activate_the_effect
32fa479c6d 2023-06-30  161:        , LOCATION_DECK
32fa479c6d 2023-06-30  162:        , 0
32fa479c6d 2023-06-30  163:        , str_1
32fa479c6d 2023-06-30  164:        , str_1
32fa479c6d 2023-06-30  165:        , nil)
32fa479c6d 2023-06-30  166:     Duel.SendtoHand(str["玩家选定的卡"]
32fa479c6d 2023-06-30  167:       , nil
32fa479c6d 2023-06-30  168:       , REASON_RULE)
32fa479c6d 2023-06-30  169:     end
32fa479c6d 2023-06-30  170:   effect_1:SetOperation(cache_1)
32fa479c6d 2023-06-30  171:   Duel.RegisterEffect(effect_1
32fa479c6d 2023-06-30  172:     , 0)
dbd1c234df 2023-07-05  173:   fun["开局说明"]()
1700f9f25e 2023-07-06  174:   end
1700f9f25e 2023-07-06  175: 
1700f9f25e 2023-07-06  176: fun["禁格"] = function(str_1)
6a26890958 2023-07-06  177:   str["禁格"] = str_1
1700f9f25e 2023-07-06  178:   effect_1 = Effect.GlobalEffect()
1700f9f25e 2023-07-06  179:   effect_1:SetType(EFFECT_TYPE_FIELD)
6a26890958 2023-07-06  180:   effect_1:SetCode(EFFECT_USE_EXTRA_MZONE)
6a26890958 2023-07-06  181:   effect_1:SetValue(str_1)
6a26890958 2023-07-06  182:   Duel.RegisterEffect(effect_1,0)
264925f3bc 2023-07-07  183:   end
264925f3bc 2023-07-07  184: 
f75e15cfc3 2023-07-07  185: fun["印卡"] = function(str_1)
f209dfc4fd 2023-07-07  186:   str["印卡"] = 1
4d7cf6cdaf 2023-07-07  187: 
4d7cf6cdaf 2023-07-07  188:   local n = 0
fdca6ce1f5 2023-07-07  189: 
fdca6ce1f5 2023-07-07  190:   effect_1 = Effect.GlobalEffect()
005039166c 2023-07-07  191:   effect_1:SetType(EFFECT_TYPE_SINGLE)
f75e15cfc3 2023-07-07  192: 
f75e15cfc3 2023-07-07  193: function print_hand(e,tp,eg,ep,ev,re,r,rp)
f75e15cfc3 2023-07-07  194:   local ac=Duel.AnnounceCard(tp)
f75e15cfc3 2023-07-07  195:   local c=Duel.CreateToken(tp,ac)
f75e15cfc3 2023-07-07  196:   if n<2 then
f75e15cfc3 2023-07-07  197:     Duel.SendtoHand(c,nil,REASON_RULE)
f75e15cfc3 2023-07-07  198:     Duel.ShuffleHand(tp)
f75e15cfc3 2023-07-07  199:     n=n+1
f75e15cfc3 2023-07-07  200:   else
f75e15cfc3 2023-07-07  201:     if n==10 then
f75e15cfc3 2023-07-07  202:       Debug.ShowHint("印卡过多,审判降临!")
f75e15cfc3 2023-07-07  203:       Duel.SetLP(0,0)
f75e15cfc3 2023-07-07  204:     else
f75e15cfc3 2023-07-07  205:       n=n+1
f75e15cfc3 2023-07-07  206:       Duel.Remove(c,POS_FACEUP,REASON_RULE)
f75e15cfc3 2023-07-07  207:       Duel.SendtoDeck(c,tp,0,REASON_RULE)
f75e15cfc3 2023-07-07  208:     end
f75e15cfc3 2023-07-07  209:   end
f75e15cfc3 2023-07-07  210: end
f75e15cfc3 2023-07-07  211: 
f75e15cfc3 2023-07-07  212: local e1=Effect.CreateEffect(c)
f75e15cfc3 2023-07-07  213: e1:SetType(EFFECT_TYPE_IGNITION)
f75e15cfc3 2023-07-07  214: e1:SetProperty(EFFECT_FLAG_BOTH_SIDE)
f75e15cfc3 2023-07-07  215: e1:SetRange(LOCATION_EXTRA)
f75e15cfc3 2023-07-07  216: e1:SetOperation(print_hand)
f75e15cfc3 2023-07-07  217: c:RegisterEffect(e1)
fb59790a7b 2023-06-30  218:   end