Commit 2a038f30 authored by nanahira's avatar nanahira

update_dazz

parent 9a82de62
...@@ -19,22 +19,6 @@ function cm.initial_effect(c) ...@@ -19,22 +19,6 @@ function cm.initial_effect(c)
e2:SetCondition(cm.spcon) e2:SetCondition(cm.spcon)
e2:SetOperation(cm.spop) e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(m)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
if not cm.chk then
cm.chk=true
cm.effect_list={}
local ex=Effect.GlobalEffect()
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_ADJUST)
ex:SetOperation(cm.reg)
Duel.RegisterEffect(ex,0)
end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1)) e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
...@@ -43,6 +27,38 @@ function cm.initial_effect(c) ...@@ -43,6 +27,38 @@ function cm.initial_effect(c)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.operation) e1:SetOperation(cm.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local ex=Effect.CreateEffect(c)
ex:SetDescription(m*16)
ex:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
ex:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL,0)
ex:SetType(EFFECT_TYPE_ACTIVATE)
ex:SetCode(EVENT_CHAINING)
ex:SetCost(cm.desccost)
ex:SetCondition(cm.condition2)
ex:SetTarget(cm.target2)
ex:SetOperation(cm.activate2)
local ex_q=ex:Clone()
ex_q:SetType(EFFECT_TYPE_ACTIVATE+EFFECT_TYPE_QUICK_O)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetTargetRange(LOCATION_SZONE,0)
e3:SetTarget(function(e,c)
return c:IsType(TYPE_QUICKPLAY+TYPE_TRAP) and c:GetSequence()<5
end)
e3:SetLabelObject(ex)
c:RegisterEffect(e3)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetTargetRange(LOCATION_SZONE,0)
e3:SetTarget(function(e,c)
return c:IsType(TYPE_SPELL) and not c:IsType(TYPE_QUICKPLAY) and c:GetSequence()<5
end)
e3:SetLabelObject(ex_q)
c:RegisterEffect(e3)
end end
function cm.spfilter(c) function cm.spfilter(c)
return c.Senya_desc_with_nanahira and c:IsType(TYPE_TRAP) and c:IsAbleToGraveAsCost() return c.Senya_desc_with_nanahira and c:IsType(TYPE_TRAP) and c:IsAbleToGraveAsCost()
...@@ -50,72 +66,23 @@ end ...@@ -50,72 +66,23 @@ end
function cm.spcon(e,c) function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetMZoneCount(tp)>0 local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,nil) return Senya.CheckGroup(g,Senya.CheckFieldFilter,nil,3,3,tp,c)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Senya.SelectGroup(tp,HINTMSG_TOGRAVE,g,Senya.CheckFieldFilter,nil,3,3,tp,c)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,3,nil)
c:SetMaterial(g) c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function cm.f(c)
return c:GetSequence()<5 and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.add(tc)
local p2=0
if (tc:GetOriginalType() & TYPE_QUICKPLAY+TYPE_TRAP)==0 then p2=EFFECT_TYPE_QUICK_O end
local e2=Effect.CreateEffect(tc)
e2:SetDescription(m*16)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL,0)
e2:SetType(EFFECT_TYPE_ACTIVATE+p2)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_CHAINING)
e2:SetCost(cm.desccost)
e2:SetCondition(cm.condition2)
e2:SetTarget(cm.target2)
e2:SetOperation(cm.activate2)
tc:RegisterEffect(e2)
cm.effect_list[tc]=e2
end
function cm.desccost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.desccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.rmv(tc)
local e=cm.effect_list[tc]
e:Reset()
cm.effect_list[tc]=nil
end
function cm.reg(e,tp,eg,ep,ev,re,r,rp)
local rg=Group.CreateGroup()
for tc,te in pairs(cm.effect_list) do
if tc and te then rg:AddCard(tc) end
end
for i=0,1 do
local rg2=rg:Filter(Card.IsControler,nil,i)
if Duel.IsPlayerAffectedByEffect(i,m) then
rg2:ForEach(function(tc)
if tc:IsLocation(LOCATION_SZONE) and cm.f(tc) then return end
rg:RemoveCard(tc)
cm.rmv(tc)
end)
local g=Duel.GetMatchingGroup(cm.f,i,LOCATION_SZONE,0,nil)
g:Sub(rg)
g:ForEach(cm.add)
else
rg2:ForEach(cm.rmv)
end
end
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp) function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsChainNegatable(ev) then return false end if not Duel.IsChainNegatable(ev) then return false end
if e:GetHandler():GetTurnID()==Duel.GetTurnCount() and (e:GetHandler():GetOriginalType() & TYPE_QUICKPLAY+TYPE_TRAP)==0 then return false end if e:GetHandler():IsStatus(STATUS_SET_TURN) and (e:GetHandler():GetOriginalType() & TYPE_QUICKPLAY+TYPE_TRAP)==0 then return false end
local t1=(e:GetHandler():GetOriginalType() & 0x7) return (e:GetHandler():GetOriginalType() & re:GetHandler():GetOriginalType() & 0x7)~=0
local t2=(re:GetHandler():GetOriginalType() & 0x7)
return (t1 & t2)~=0
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true 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