游戏王残局简化版

Artifact [66c0cc8156]
Login

Artifact [66c0cc8156]

Artifact 66c0cc8156f65f956cd1451a8d0c54fc7ca26d9ad43a92eb20c4ce0924c8e78e:


local string = string
local table = table
local Debug = Debug
local Effect = Effect
local Duel = Duel
local Card = Card
local d = {}
local f = {}
local s = {}
s["效卡之类排"] = {
  TYPE_SPELL,
  TYPE_TRAP,
  TYPE_EFFECT,
  }
s["无效灵摆怪兽之卡编排"] = {
  28363749,
  19474136,
  17390179,
  83980492,
  }
s["全区"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA
do
  local h1
  --~ 则对
  h1 = {
  [3] = "大师规则 ",
  [4] = "新大师规则(2017) ",
  [5] = "大师规则(2020) ",
  }
  s["Debug.ReloadFieldBegin"] = _G.Debug.ReloadFieldBegin
  --~ 模
  --~ 则数
  function _G.Debug.ReloadFieldBegin(u1, u2)
    s["伪洗卡"] = u1 & DUEL_PSEUDO_SHUFFLE
    s["战段"] = u1 & DUEL_ATTACK_FIRST_TURN
    s["机智"] = u1 & DUEL_SIMPLE_AI
    if u2 then
      s["则"] = h1[u2]
    else
      s["则"] = h1[5]
      end
    s["Debug.ReloadFieldBegin"](u1, u2)
    end
  end
s["不被连锁"] = function()
  Duel.SetChainLimit(aux.FALSE)
  return true
  end
s["是否效卡"] = function(card)
  for i = 1, #s["效卡之类排"] do
    if Card.IsType(card, s["效卡之类排"][i]) then
      return true
      end
    end
  if Card.IsType(card, TYPE_PENDULUM) then
    for i = 1, #s["无效灵摆怪兽之卡编排"] do
      if Card.IsCode(card, s["无效灵摆怪兽之卡编排"][i]) then
        return false
      else
        end
      end
    return true
    end
  end
do
  local h1
  --~ “调该效果”的效果
  --~ “调该效果”的玩家
  s["_开局选卡入手"] = function(u1, u2)
    local h2
    --~ 玩家选定的卡
    h2 = Duel.SelectMatchingCard(u2, Card.IsAbleToHand, u2, LOCATION_DECK, 0, h1, h1, nil)
    Duel.SendtoHand(h2, nil, REASON_RULE)
    u1:Reset()
    end
  s["开局选卡入手"] = function(u1)
    local h2
    s["「开局选卡入手」之量"] = u1
    --~ 「开局选卡入手」之量
    h1 = u1
    --~ 效果
    h2 = Effect.GlobalEffect()
    h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
    h2:SetCode(EVENT_ADJUST)
    h2:SetCondition(aux.TRUE)
    h2:SetOperation(s["_开局选卡入手"])
    Duel.RegisterEffect(h2, 0)
    end
  end
--~ 禁几个怪兽格
f["禁格"] = function(o1)
  local k1
  d["禁几个怪兽格"] = o1
  --~ 效果
  k1 = Effect.GlobalEffect()
  k1:SetCode(EFFECT_USE_EXTRA_MZONE)
  k1:SetValue(k1)
  Duel.RegisterEffect(k1, 0)
  end
do
  local k1, k2, k3, k4
  --~ 印卡过多时的提示
  k1 = "印卡过多"
  --~ 现在的印卡数量
  k2 = 1
  --~ 手卡印卡数量的上限
  k3 = 0
  --~ 印卡总数量的上限
  k4 = 0
  --~ 所调用这个效果的效果
  --~ 所调用这个效果的玩家
  f["_印卡"] = function(o1, o2)
    local k5, k6
    --~ 要印的卡的卡编
    k5 = Duel.AnnounceCard(o2)
    --~ 卡
    k6 = Duel.CreateToken(o2, k5)
    if k2 <= k3 then
      k2 = k2 + 1
      Duel.SendtoHand(k6, nil, REASON_RULE)
    else
      if k2 <= k4 then
        k2 = k2 + 1
        Duel.SendtoDeck(k6, o2, 0, REASON_RULE)
      else
        Debug.ShowHint(k1)
        o1:Reset()
        end
      end
    end
  --~ 印卡的启动源
  --~ 手卡印卡数量的上限
  --~ 印卡总数量的上限
  f["印卡"] = function(o1, o2, o3)
    local k5
    k3 = o2
    k4 = o3 or o2
    Debug.ShowHint("点对方额外卡组,可印卡\n只能印手卡 " .. k3 .. " 张\n最多可印 " .. k4 .. " 张")
    k5 = Effect.CreateEffect(o1)
    k5:SetType(EFFECT_TYPE_IGNITION)
    k5:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
    k5:SetTarget(f["不被连锁"])
    k5:SetRange(LOCATION_EXTRA)
    k5:SetOperation(f["_印卡"])
    o1:RegisterEffect(k5)
    end
  end
s["开局示"] = function()
  local h1, h2, h3
  --~ 此局效卡之数
  h2 = Duel.GetMatchingGroupCount(s["是否效卡"], 0, s["全区"], s["全区"], nil)
  --~ 超量材组
  h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
  for u1 in aux.Next(h3) do
    if s["是否效卡"](u1) then
      h2 = h2 + 1
      end
    end
  --~ 开局说明
  h1 = h2 .. "卡 " .. s["则"]
  if s["伪洗卡"] == 0 then
  else
    h1 = h1 .. "伪洗卡 "
    end
  if s["战段"] == 0 then
    h1 = h1 .. "无战段 "
    end
  if s["机智"] == 0 then
    h1 = h1 .. "无机智 "
    end
  if s["「开局选卡入手」之量"] then
    h1 = h1 .. "选" .. s["「开局选卡入手」之量"] .. "卡 "
    end
  if s["「禁主怪格」之量"] then
    h1 = h1 .. "禁" .. s["「禁主怪格」之量"] .. "怪格 "
    end
  if s["「禁魔陷格」之量"] then
    h1 = h1 .. "禁" .. s["「禁魔陷格」之量"] .. "魔格 "
    end
  Debug.ShowHint(h1)
  end
do
  s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
  --~ 「开局选卡入手」之量
  --~ 传入对方额外卡组最上面表侧卡,并将其作为印卡源
  --~ 能印手卡几张
  --~ 最多能印卡几张
  function _G.aux.BeginPuzzle(o1, o2, o3, o4, o5)
    s["aux.BeginPuzzle"]()
    if o1 then
      s["开局选卡入手"](o1)
    else
      end
    if o2 then
      f["禁格"](o2)
    else
      end
    if o3 then
      s["印卡"](o3, o4, o5)
    else
      end
    s["开局示"]()
    end
  end