Commit 52ae0ccb authored by IamIpanda's avatar IamIpanda

Fix 诱饵人形(Temp)

parent 96f38d2e
Pipeline #39053 passed with stages
in 2 minutes and 23 seconds
......@@ -41,7 +41,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
for k,_ in pairs(s.operationlist) do
s.banlist[k] = 1
end
if not s.activitated then
if not s.activitate then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......@@ -57,11 +57,15 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(id)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
if Duel.GetTurnPlayer()==tp then
e2:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e2:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e2,tp)
end
function s.aclimit(e,re,tp)
return s.banlist[re:GetCode()]~=nil
return s.banlist[re:GetHandler():GetCode()]~=nil
end
function s.counter(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -24,13 +24,6 @@ function s.initial_effect(c)
local e4=e2:Clone()
e4:SetCode(EVENT_DESTROYED)
c:RegisterEffect(e4)
--redirect
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetRange(LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED)
e5:SetOperation(s.retop)
c:RegisterEffect(e5)
end
function s.filter(c)
return c:IsFaceup()
......@@ -68,6 +61,7 @@ function s.can_trigger(te,tep,eg,ep,ev,re,r,rp)
return (condition==nil or condition(te,tep,eg,ep,ev,re,r,rp))
and (cost==nil or cost(te,tep,eg,ep,ev,re,r,rp,0))
and (target==nil or target(te,tep,eg,ep,ev,re,r,rp,0))
and te:CheckCountLimit(tep)
end
function s.force_effect(e,tp)
local te=e:Clone()
......@@ -103,19 +97,30 @@ end
function s.flagop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESET_CHAIN,0,1)
if c:GetFlagEffect(id)==0 then
c:RegisterFlagEffect(id,RESET_EVENT+RESET_CHAIN,0,1)
--redirect
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetRange(~0)
e5:SetCountLimit(1)
e5:SetOperation(s.retop)
e5:SetLabelObject(c)
Duel.RegisterEffect(e5,tp)
end
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(id)==0 then return end
Duel.SendtoHand(e:GetHandler(),tp,REASON_REDIRECT)
e:Reset()
end
s.originRegisterEffect = Card.RegisterEffect
s.register={}
s.register_counter=0
function Card.RegisterEffect(c,e)
if e:GetType()&EFFECT_TYPE_QUICK_O>0 or e:GetType()&EFFECT_TYPE_TRIGGER_O>0 then
if (e:GetType()&EFFECT_TYPE_QUICK_O>0 or e:GetType()&EFFECT_TYPE_TRIGGER_O>0) and (e:GetCode()==EVENT_CHAINING or e:GetCode()==EVENT_FREE_CHAIN) then
local label=c:GetFlagEffectLabel(id)
if label==nil then
s.register_counter=s.register_counter+1
......
......@@ -127,7 +127,8 @@ function s.drawcon(e,tp,eg,ep,ev,re,r,rp)
end
function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
if ct<0 then ct=0 end
if chk==0 then return true end --ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
......@@ -135,20 +136,21 @@ end
function s.drawop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ct==0 then return end
if ct<=0 then return end
if Duel.Draw(p,ct,REASON_EFFECT)>0 then
Duel.SkipPhase(1-tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local p=Duel.GetTurnPlayer()
Duel.SkipPhase(p,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(p,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(p,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(p,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(0,1)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterEffect(e1,p)
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment