游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

e14f5fd087 2024-02-14  顽雨沉风: local string = string
e14f5fd087 2024-02-14  顽雨沉风: local table = table
6fdfa2454c 2024-02-14  顽雨沉风: local Debug = Debug
6fdfa2454c 2024-02-14  顽雨沉风: local Effect = Effect
6fdfa2454c 2024-02-14  顽雨沉风: local Duel = Duel
6fdfa2454c 2024-02-14  顽雨沉风: local Card = Card
511cb54144 2024-06-27  顽雨沉风: local d = {}
511cb54144 2024-06-27  顽雨沉风: local f = {}
5e3f812cd3 2024-06-27  顽雨沉风: d["排_效果卡的类型"] = {
7da070fada 2024-06-27  顽雨沉风:   TYPE_SPELL,
7da070fada 2024-06-27  顽雨沉风:   TYPE_TRAP,
7da070fada 2024-06-27  顽雨沉风:   TYPE_EFFECT,
7da070fada 2024-06-27  顽雨沉风:   }
5e3f812cd3 2024-06-27  顽雨沉风: d["排_非效果灵摆怪兽的卡编"] = {
7da070fada 2024-06-27  顽雨沉风:   28363749,
7da070fada 2024-06-27  顽雨沉风:   19474136,
7da070fada 2024-06-27  顽雨沉风:   17390179,
7da070fada 2024-06-27  顽雨沉风:   83980492,
7da070fada 2024-06-27  顽雨沉风:   }
7e1849c15c 2024-06-27  顽雨沉风: d["数_所有区域"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA
2f6b499b2b 2024-06-27  顽雨沉风: do
bb9bb3e958 2024-06-27  顽雨沉风:   local k1
a8393d7a2e 2024-06-27  顽雨沉风:   --~ 这一局所适用规则的对
bb9bb3e958 2024-06-27  顽雨沉风:   k1 = {
6d5fb7465f 2024-06-27  顽雨沉风:     [3] = "大师规则三(2014) ",
221188e89a 2024-06-27  顽雨沉风:     [4] = "新大师规则(2017) ",
221188e89a 2024-06-27  顽雨沉风:     [5] = "大师规则(2020) ",
7e1849c15c 2024-06-27  顽雨沉风:     }
7e1849c15c 2024-06-27  顽雨沉风:   f["Debug.ReloadFieldBegin"] = _G.Debug.ReloadFieldBegin
59e30ce26c 2024-06-27  顽雨沉风:   --~ 这一局的模式
59e30ce26c 2024-06-27  顽雨沉风:   --~ 规则参数
7e1849c15c 2024-06-27  顽雨沉风:   function _G.Debug.ReloadFieldBegin(o1, o2)
7e1849c15c 2024-06-27  顽雨沉风:     d["数_假洗卡"] = o1 & DUEL_PSEUDO_SHUFFLE
7e1849c15c 2024-06-27  顽雨沉风:     d["数_战斗阶段"] = o1 & DUEL_ATTACK_FIRST_TURN
7e1849c15c 2024-06-27  顽雨沉风:     d["数_人工智能"] = o1 & DUEL_SIMPLE_AI
7e1849c15c 2024-06-27  顽雨沉风:     if o2 then
a5616b998c 2024-06-27  顽雨沉风:       d["字_这一局的规则"] = k1[o2]
7e1849c15c 2024-06-27  顽雨沉风:     else
a5616b998c 2024-06-27  顽雨沉风:       d["字_这一局的规则"] = k1[5]
7e1849c15c 2024-06-27  顽雨沉风:       end
a5616b998c 2024-06-27  顽雨沉风:     f["Debug.ReloadFieldBegin"](o1, o2)
2f6b499b2b 2024-06-27  顽雨沉风:     end
2f6b499b2b 2024-06-27  顽雨沉风:   end
b06c61ebbe 2024-06-27  顽雨沉风: f["不被连锁"] = function()
2f6b499b2b 2024-06-27  顽雨沉风:   Duel.SetChainLimit(aux.FALSE)
2f6b499b2b 2024-06-27  顽雨沉风:   return true
2f6b499b2b 2024-06-27  顽雨沉风:   end
a5616b998c 2024-06-27  顽雨沉风: f["是否有效果卡"] = function(card)
a182a7e55e 2024-06-27  顽雨沉风:   for i = 1, #d["排_非效果灵摆怪兽的卡编"] do
a182a7e55e 2024-06-27  顽雨沉风:     if Card.IsCode(card, d["排_非效果灵摆怪兽的卡编"][i]) then
a182a7e55e 2024-06-27  顽雨沉风:       return false
a182a7e55e 2024-06-27  顽雨沉风:       end
a182a7e55e 2024-06-27  顽雨沉风:     end
a182a7e55e 2024-06-27  顽雨沉风:   return true
2f6b499b2b 2024-06-27  顽雨沉风:   end
2f6b499b2b 2024-06-27  顽雨沉风: do
bb9bb3e958 2024-06-27  顽雨沉风:   local k1
a5616b998c 2024-06-27  顽雨沉风:   --~ 所调用这个效果的效果
a5616b998c 2024-06-27  顽雨沉风:   --~ 所调用这个效果的玩家
844b062240 2024-06-27  顽雨沉风:   f["_开局选卡入手"] = function(o1, o2)
bb9bb3e958 2024-06-27  顽雨沉风:     local k2
2f6b499b2b 2024-06-27  顽雨沉风:     --~ 玩家选定的卡
7e1849c15c 2024-06-27  顽雨沉风:     k2 = Duel.SelectMatchingCard(o2, Card.IsAbleToHand, o2, LOCATION_DECK, 0, k1, k1, nil)
bb9bb3e958 2024-06-27  顽雨沉风:     Duel.SendtoHand(k2, nil, REASON_RULE)
7e1849c15c 2024-06-27  顽雨沉风:     o1:Reset()
2f6b499b2b 2024-06-27  顽雨沉风:     end
844b062240 2024-06-27  顽雨沉风:   f["开局选卡入手"] = function(o1)
bb9bb3e958 2024-06-27  顽雨沉风:     local k2
7e1849c15c 2024-06-27  顽雨沉风:     d["数_选卡"] = o1
8c0eee1624 2024-06-27  顽雨沉风:     --~ 开局选卡入手的数量
7e1849c15c 2024-06-27  顽雨沉风:     k1 = o1
2f6b499b2b 2024-06-27  顽雨沉风:     --~ 效果
bb9bb3e958 2024-06-27  顽雨沉风:     k2 = Effect.GlobalEffect()
bb9bb3e958 2024-06-27  顽雨沉风:     k2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
bb9bb3e958 2024-06-27  顽雨沉风:     k2:SetCode(EVENT_ADJUST)
bb9bb3e958 2024-06-27  顽雨沉风:     k2:SetCondition(aux.TRUE)
844b062240 2024-06-27  顽雨沉风:     k2:SetOperation(f["_开局选卡入手"])
bb9bb3e958 2024-06-27  顽雨沉风:     Duel.RegisterEffect(k2, 0)
2f6b499b2b 2024-06-27  顽雨沉风:     end
2f6b499b2b 2024-06-27  顽雨沉风:   end
2f6b499b2b 2024-06-27  顽雨沉风: --~ 禁几个怪兽格
2f6b499b2b 2024-06-27  顽雨沉风: f["禁格"] = function(o1)
2f6b499b2b 2024-06-27  顽雨沉风:   local k1
72a706f479 2024-06-27  顽雨沉风:   d["数_禁格"] = o1
cb9ce9dc22 2024-06-27  顽雨沉风:   --~ 效果
cb9ce9dc22 2024-06-27  顽雨沉风:   k1 = Effect.GlobalEffect()
cb9ce9dc22 2024-06-27  顽雨沉风:   k1:SetCode(EFFECT_USE_EXTRA_MZONE)
72a706f479 2024-06-27  顽雨沉风:   k1:SetValue(o1)
cb9ce9dc22 2024-06-27  顽雨沉风:   Duel.RegisterEffect(k1, 0)
cb9ce9dc22 2024-06-27  顽雨沉风:   end
cb9ce9dc22 2024-06-27  顽雨沉风: do
cb9ce9dc22 2024-06-27  顽雨沉风:   local k1, k2, k3, k4
cb9ce9dc22 2024-06-27  顽雨沉风:   --~ 印卡过多时的提示
cb9ce9dc22 2024-06-27  顽雨沉风:   k1 = "印卡过多"
cb9ce9dc22 2024-06-27  顽雨沉风:   --~ 现在的印卡数量
cb9ce9dc22 2024-06-27  顽雨沉风:   k2 = 1
cb9ce9dc22 2024-06-27  顽雨沉风:   --~ 手卡印卡数量的上限
cb9ce9dc22 2024-06-27  顽雨沉风:   k3 = 0
cb9ce9dc22 2024-06-27  顽雨沉风:   --~ 印卡总数量的上限
cb9ce9dc22 2024-06-27  顽雨沉风:   k4 = 0
a82e37fd3f 2024-06-27  顽雨沉风:   --~ 所调用这个效果的效果
a82e37fd3f 2024-06-27  顽雨沉风:   --~ 所调用这个效果的玩家
cb9ce9dc22 2024-06-27  顽雨沉风:   f["_印卡"] = function(o1, o2)
cb9ce9dc22 2024-06-27  顽雨沉风:     local k5, k6
b06c61ebbe 2024-06-27  顽雨沉风:     --~ 要印之卡的卡编
cb9ce9dc22 2024-06-27  顽雨沉风:     k5 = Duel.AnnounceCard(o2)
cb9ce9dc22 2024-06-27  顽雨沉风:     --~ 卡
cb9ce9dc22 2024-06-27  顽雨沉风:     k6 = Duel.CreateToken(o2, k5)
cb9ce9dc22 2024-06-27  顽雨沉风:     if k2 <= k3 then
cb9ce9dc22 2024-06-27  顽雨沉风:       k2 = k2 + 1
cb9ce9dc22 2024-06-27  顽雨沉风:       Duel.SendtoHand(k6, nil, REASON_RULE)
cb9ce9dc22 2024-06-27  顽雨沉风:     else
cb9ce9dc22 2024-06-27  顽雨沉风:       if k2 <= k4 then
cb9ce9dc22 2024-06-27  顽雨沉风:         k2 = k2 + 1
cb9ce9dc22 2024-06-27  顽雨沉风:         Duel.SendtoDeck(k6, o2, 0, REASON_RULE)
cb9ce9dc22 2024-06-27  顽雨沉风:       else
cb9ce9dc22 2024-06-27  顽雨沉风:         Debug.ShowHint(k1)
cb9ce9dc22 2024-06-27  顽雨沉风:         o1:Reset()
cb9ce9dc22 2024-06-27  顽雨沉风:         end
cb9ce9dc22 2024-06-27  顽雨沉风:       end
cb9ce9dc22 2024-06-27  顽雨沉风:     end
cb9ce9dc22 2024-06-27  顽雨沉风:   --~ 印卡的启动源
cb9ce9dc22 2024-06-27  顽雨沉风:   --~ 手卡印卡数量的上限
cb9ce9dc22 2024-06-27  顽雨沉风:   --~ 印卡总数量的上限
cb9ce9dc22 2024-06-27  顽雨沉风:   f["印卡"] = function(o1, o2, o3)
cb9ce9dc22 2024-06-27  顽雨沉风:     local k5
cb9ce9dc22 2024-06-27  顽雨沉风:     k3 = o2
cb9ce9dc22 2024-06-27  顽雨沉风:     k4 = o3 or o2
1b4c761c77 2024-06-27  顽雨沉风:     Debug.ShowHint("点对方额外卡组,可印卡\n只能印手卡" .. k3 .. "张\n最多可印" .. k4 .. "张")
cb9ce9dc22 2024-06-27  顽雨沉风:     k5 = Effect.CreateEffect(o1)
cb9ce9dc22 2024-06-27  顽雨沉风:     k5:SetType(EFFECT_TYPE_IGNITION)
cb9ce9dc22 2024-06-27  顽雨沉风:     k5:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
cb9ce9dc22 2024-06-27  顽雨沉风:     k5:SetTarget(f["不被连锁"])
cb9ce9dc22 2024-06-27  顽雨沉风:     k5:SetRange(LOCATION_EXTRA)
cb9ce9dc22 2024-06-27  顽雨沉风:     k5:SetOperation(f["_印卡"])
cb9ce9dc22 2024-06-27  顽雨沉风:     o1:RegisterEffect(k5)
cb9ce9dc22 2024-06-27  顽雨沉风:     end
cb9ce9dc22 2024-06-27  顽雨沉风:   end
bb9bb3e958 2024-06-27  顽雨沉风: f["开局提示"] = function()
bb9bb3e958 2024-06-27  顽雨沉风:   local k1, k2, k3
bb9bb3e958 2024-06-27  顽雨沉风:   --~ 这一局的效果卡数量
7e1849c15c 2024-06-27  顽雨沉风:   k2 = Duel.GetMatchingGroupCount(d["是否有效果卡"], 0, d["数_所有区域"], d["数_所有区域"], nil)
bb9bb3e958 2024-06-27  顽雨沉风:   --~ 超量素材的组
bb9bb3e958 2024-06-27  顽雨沉风:   k3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
bb9bb3e958 2024-06-27  顽雨沉风:   for o1 in aux.Next(k3) do
bb9bb3e958 2024-06-27  顽雨沉风:     if d["是否有效果卡"](o1) then
bb9bb3e958 2024-06-27  顽雨沉风:       k2 = k2 + 1
cb9ce9dc22 2024-06-27  顽雨沉风:       end
cb9ce9dc22 2024-06-27  顽雨沉风:     end
cb9ce9dc22 2024-06-27  顽雨沉风:   --~ 开局说明
72a706f479 2024-06-27  顽雨沉风:   k1 = "" .. k2 .. "卡 " .. d["字_这一局的规则"]
7e1849c15c 2024-06-27  顽雨沉风:   if d["数_假洗卡"] == 0 then
7e1849c15c 2024-06-27  顽雨沉风:   else
221188e89a 2024-06-27  顽雨沉风:     k1 = k1 .. "假洗卡 "
7e1849c15c 2024-06-27  顽雨沉风:     end
7e1849c15c 2024-06-27  顽雨沉风:   if d["数_战斗阶段"] == 0 then
221188e89a 2024-06-27  顽雨沉风:     k1 = k1 .. "无战斗阶段 "
7e1849c15c 2024-06-27  顽雨沉风:     end
7e1849c15c 2024-06-27  顽雨沉风:   if d["数_人工智能"] == 0 then
221188e89a 2024-06-27  顽雨沉风:     k1 = k1 .. "无人工智能 "
b0c9c72494 2024-06-27  顽雨沉风:     end
b0c9c72494 2024-06-27  顽雨沉风:   if d["数_选卡"] then
221188e89a 2024-06-27  顽雨沉风:     k1 = k1 .. "选" .. d["数_选卡"] .. "卡 "
b0c9c72494 2024-06-27  顽雨沉风:     end
b0c9c72494 2024-06-27  顽雨沉风:   if d["数_禁格"] then
221188e89a 2024-06-27  顽雨沉风:     k1 = k1 .. "禁" .. d["数_禁格"] .. "怪格 "
b0c9c72494 2024-06-27  顽雨沉风:     end
bb9bb3e958 2024-06-27  顽雨沉风:   Debug.ShowHint(k1)
cb9ce9dc22 2024-06-27  顽雨沉风:   end
cb9ce9dc22 2024-06-27  顽雨沉风: do
88a69b97e2 2024-06-27  顽雨沉风:   f["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
88a69b97e2 2024-06-27  顽雨沉风:   --~ 开局选卡入手的数量
88a69b97e2 2024-06-27  顽雨沉风:   --~ 禁几个我方主要怪兽格
88a69b97e2 2024-06-27  顽雨沉风:   --~ 传入对方额外卡组最上面的表侧卡,并将其作为印卡源
88a69b97e2 2024-06-27  顽雨沉风:   --~ 能印几张手卡
88a69b97e2 2024-06-27  顽雨沉风:   --~ 最多能印几张卡
cb9ce9dc22 2024-06-27  顽雨沉风:   function _G.aux.BeginPuzzle(o1, o2, o3, o4, o5)
88a69b97e2 2024-06-27  顽雨沉风:     f["aux.BeginPuzzle"]()
cb9ce9dc22 2024-06-27  顽雨沉风:     if o1 then
88a69b97e2 2024-06-27  顽雨沉风:       f["开局选卡入手"](o1)
2f6b499b2b 2024-06-27  顽雨沉风:     else
2f6b499b2b 2024-06-27  顽雨沉风:       end
2f6b499b2b 2024-06-27  顽雨沉风:     if o2 then
2f6b499b2b 2024-06-27  顽雨沉风:       f["禁格"](o2)
72a706f479 2024-06-27  顽雨沉风:       --~ Debug.ShowHint("2")
2f6b499b2b 2024-06-27  顽雨沉风:     else
2f6b499b2b 2024-06-27  顽雨沉风:       end
2f6b499b2b 2024-06-27  顽雨沉风:     if o3 then
88a69b97e2 2024-06-27  顽雨沉风:       f["印卡"](o3, o4, o5)
2f6b499b2b 2024-06-27  顽雨沉风:     else
2f6b499b2b 2024-06-27  顽雨沉风:       end
88a69b97e2 2024-06-27  顽雨沉风:     f["开局提示"]()
e14f5fd087 2024-02-14  顽雨沉风:     end
e14f5fd087 2024-02-14  顽雨沉风:   end