Index: script/c0.lua ================================================================== --- script/c0.lua +++ script/c0.lua @@ -1,10 +1,8 @@ -local str = {} local string = string local table = table local s = {} -_G.fun = {} s["效牌之类排"] = { TYPE_SPELL , TYPE_TRAP , TYPE_EFFECT } @@ -13,21 +11,10 @@ , 19474136 , 17390179 , 83980492 } s["全区"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA ---第一层------------------------------- -local cache_1 -local cache_2 -local cache_3 -local cache_4 -local cache_5 -local cache_6 -local cache_7 -local cache_8 -local cache_9 -local _ do local h1 --~ 则对 h1 = { [3] = "大师3 " @@ -65,11 +52,11 @@ u2:Reset() end h1:SetOperation(h2) Duel.RegisterEffect(h1, 0) end -fun["一_该效果不能被连锁"] = function() +function s.["不被连锁"]() Duel.SetChainLimit(aux.FALSE) return true end do local h1, h2 @@ -145,21 +132,10 @@ h1 = Effect.GlobalEffect() h1:SetCode(EFFECT_USE_EXTRA_MZONE) h1:SetValue(u1) Duel.RegisterEffect(h1, 0) end ---第二层------------------------------- -local cache_1 -local cache_2 -local cache_3 -local cache_4 -local cache_5 -local cache_6 -local cache_7 -local cache_8 -local cache_9 -local _ do s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd --~ 开局洗牌抽牌之数 function _G.Debug.ReloadFieldEnd(u1) s["Debug.ReloadFieldEnd"]() @@ -166,60 +142,60 @@ if u1 then s["开局洗牌抽牌"](u1) end end end -fun["二_印牌"] = function(u1, u2, u3) - u3 = u3 or u2 - Debug.ShowHint( - "点击对方额外牌组可以进行印牌。\n手牌只能印 " - .. u2 - .. " 张。\n最多可以印 " - .. u3 - .. " 张" - ) - str["效果"] = Effect.CreateEffect(u1) - str["当前印牌数"] = 1 - str["效果"]:SetType(EFFECT_TYPE_IGNITION) - str["效果"]:SetProperty( - EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE - ) - str["效果"]:SetTarget(fun["一_该效果不能被连锁"]) - str["效果"]:SetRange(LOCATION_EXTRA) - function print_hand(effect_event, player_who_activate_the_effect) - announce_card = Duel.AnnounceCard(player_who_activate_the_effect) - card = Duel.CreateToken(player_who_activate_the_effect, announce_card) - if str["当前印牌数"] <= u2 then - str["当前印牌数"] = str["当前印牌数"] + 1 - Duel.SendtoHand(card, nil, REASON_RULE) - else - if str["当前印牌数"] <= u3 then - str["当前印牌数"] = str["当前印牌数"] + 1 - Duel.Remove(card, POS_FACEUP, REASON_RULE) - Duel.SendtoDeck(card, player_who_activate_the_effect, 0, REASON_RULE) - else - Debug.ShowHint("印牌过多!") - effect_event:Reset() - end - end - end - str["效果"]:SetOperation(print_hand) - u1:RegisterEffect(str["效果"]) -end -fun["二_开局说明"] = function() - local h1, h2, h3 - --~ 此局的效牌数 - h2 = Duel.GetMatchingGroupCount(fun["是否效果牌"], 0, s["全区"], s["全区"], nil) +function s.["印牌"](u1, u2, u3) + local h1, h2, h3 + u3 = u3 or u2 + Debug.ShowHint("点击对方额外牌组可以进行印牌。\n手牌只能印 " .. u2 .. " 张。\n最多可以印 " .. u3 .. " 张") + h1 = Effect.CreateEffect(u1) + --~ 现之印牌数 + h2 = 1 + h1:SetType(EFFECT_TYPE_IGNITION) + h1:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE) + h1:SetTarget(s["不被连锁"]) + h1:SetRange(LOCATION_EXTRA) + -- 印牌 + --~ 调该效果的效果 + --~ 调该效果的玩家 + function h3(u4, u5) + local h4, h5 + --~ 印卡之卡编 + h4 = Duel.AnnounceCard(u5) + --~ 卡 + h5 = Duel.CreateToken(u5, h4) + if h2 <= u2 then + h2 = h2 + 1 + Duel.SendtoHand(h5, nil, REASON_RULE) + else + if h2 <= u3 then + h2 = h2 + 1 + Duel.Remove(h5, POS_FACEUP, REASON_RULE) + Duel.SendtoDeck(card, u5, 0, REASON_RULE) + else + Debug.ShowHint("印牌过多") + u4:Reset() + end + end + end + h1:SetOperation(h3) + u1:RegisterEffect(h1) + end +function s.["开局之示"]() + 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 fun["一_是否效果牌"](u1) then + if s["是否效牌"](u1) then h2 = h2 + 1 end end --~ 开局说明 - h1 = str["这个残局的效果牌数量"] .. "牌 " .. str["规则"] + h1 = h2 .. "牌 " .. s["则"] if s["伪洗牌"] == 0 then else h1 = h1 .. "伪洗牌 " end if s["战段"] == 0 then @@ -249,15 +225,9 @@ s["开局选牌入手"](u1) end if u2 then s["禁格"](u2) end - fun["二_开局说明"]() + s["开局之示"]() s["通关之邀"]() end end ---兼容层------------------------------- -fun["印牌"] = fun["二_印牌"] -fun["开局添加手牌"] = s["开局选牌入手"] -fun["是否效果牌"] = fun["一_是否效果牌"] -fun["禁格"] = s["禁格"] -fun["随机抽牌"] = s["开局洗牌抽牌"]